{"text": "import React from 'react';\nimport {\n HELMET_ATTRIBUTE,\n TAG_NAMES,\n REACT_TAG_MAP,\n TAG_PROPERTIES,\n ATTRIBUTE_NAMES,\n} from './constants';\nimport { flattenArray } from './utils';\n\nconst SELF_CLOSING_TAGS = [TAG_NAMES.NOSCRIPT, TAG_NAMES.SCRIPT, TAG_NAMES.STYLE];\n\nconst encodeSpecialCharacters = (str, encode = true) => {\n if (encode === false) {\n return String(str);\n }\n\n return String(str)\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n};\n\nconst generateElementAttributesAsString = attributes =>\n Object.keys(attributes).reduce((str, key) => {\n const attr = typeof attributes[key] !== 'undefined' ? `${key}=\"${attributes[key]}\"` : `${key}`;\n return str ? `${str} ${attr}` : attr;\n }, '');\n\nconst generateTitleAsString = (type, title, attributes, encode) => {\n const attributeString = generateElementAttributesAsString(attributes);\n const flattenedTitle = flattenArray(title);\n return attributeString\n ? `<${type} ${HELMET_ATTRIBUTE}=\"true\" ${attributeString}>${encodeSpecialCharacters(\n flattenedTitle,\n encode\n )}`\n : `<${type} ${HELMET_ATTRIBUTE}=\"true\">${encodeSpecialCharacters(\n flattenedTitle,\n encode\n )}`;\n};\n\nconst generateTagsAsString = (type, tags, encode) =>\n tags.reduce((str, tag) => {\n const attributeHtml = Object.keys(tag)\n .filter(\n attribute =>\n !(attribute === TAG_PROPERTIES.INNER_HTML || attribute === TAG_PROPERTIES.CSS_TEXT)\n )\n .reduce((string, attribute) => {\n const attr =\n typeof tag[attribute] === 'undefined'\n ? attribute\n : `${attribute}=\"${encodeSpecialCharacters(tag[attribute], encode)}\"`;\n return string ? `${string} ${attr}` : attr;\n }, '');\n\n const tagContent = tag.innerHTML || tag.cssText || '';\n\n const isSelfClosing = SELF_CLOSING_TAGS.indexOf(type) === -1;\n\n return `${str}<${type} ${HELMET_ATTRIBUTE}=\"true\" ${attributeHtml}${\n isSelfClosing ? `/>` : `>${tagContent}`\n }`;\n }, '');\n\nconst convertElementAttributesToReactProps = (attributes, initProps = {}) =>\n Object.keys(attributes).reduce((obj, key) => {\n obj[REACT_TAG_MAP[key] || key] = attributes[key];\n return obj;\n }, initProps);\n\nconst generateTitleAsReactComponent = (type, title, attributes) => {\n // assigning into an array to define toString function on it\n const initProps = {\n key: title,\n [HELMET_ATTRIBUTE]: true,\n };\n const props = convertElementAttributesToReactProps(attributes, initProps);\n\n return [React.createElement(TAG_NAMES.TITLE, props, title)];\n};\n\nconst generateTagsAsReactComponent = (type, tags) =>\n tags.map((tag, i) => {\n const mappedTag = {\n key: i,\n [HELMET_ATTRIBUTE]: true,\n };\n\n Object.keys(tag).forEach(attribute => {\n const mappedAttribute = REACT_TAG_MAP[attribute] || attribute;\n\n if (\n mappedAttribute === TAG_PROPERTIES.INNER_HTML ||\n mappedAttribute === TAG_PROPERTIES.CSS_TEXT\n ) {\n const content = tag.innerHTML || tag.cssText;\n mappedTag.dangerouslySetInnerHTML = { __html: content };\n } else {\n mappedTag[mappedAttribute] = tag[attribute];\n }\n });\n\n return React.createElement(type, mappedTag);\n });\n\nconst getMethodsForTag = (type, tags, encode) => {\n switch (type) {\n case TAG_NAMES.TITLE:\n return {\n toComponent: () =>\n generateTitleAsReactComponent(type, tags.title, tags.titleAttributes, encode),\n toString: () => generateTitleAsString(type, tags.title, tags.titleAttributes, encode),\n };\n case ATTRIBUTE_NAMES.BODY:\n case ATTRIBUTE_NAMES.HTML:\n return {\n toComponent: () => convertElementAttributesToReactProps(tags),\n toString: () => generateElementAttributesAsString(tags),\n };\n default:\n return {\n toComponent: () => generateTagsAsReactComponent(type, tags),\n toString: () => generateTagsAsString(type, tags, encode),\n };\n }\n};\n\nconst mapStateOnServer = ({\n baseTag,\n bodyAttributes,\n encode,\n htmlAttributes,\n linkTags,\n metaTags,\n noscriptTags,\n scriptTags,\n styleTags,\n title = '',\n titleAttributes,\n}) => ({\n base: getMethodsForTag(TAG_NAMES.BASE, baseTag, encode),\n bodyAttributes: getMethodsForTag(ATTRIBUTE_NAMES.BODY, bodyAttributes, encode),\n htmlAttributes: getMethodsForTag(ATTRIBUTE_NAMES.HTML, htmlAttributes, encode),\n link: getMethodsForTag(TAG_NAMES.LINK, linkTags, encode),\n meta: getMethodsForTag(TAG_NAMES.META, metaTags, encode),\n noscript: getMethodsForTag(TAG_NAMES.NOSCRIPT, noscriptTags, encode),\n script: getMethodsForTag(TAG_NAMES.SCRIPT, scriptTags, encode),\n style: getMethodsForTag(TAG_NAMES.STYLE, styleTags, encode),\n title: getMethodsForTag(TAG_NAMES.TITLE, { title, titleAttributes }, encode),\n});\n\nexport default mapStateOnServer;\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 * @generated by an internal plugin build system\n */\n\n#ifndef ABI38_0_0RN_DISABLE_OSS_PLUGIN_HEADER\n\n// OSS-compatibility layer\n\n#import \"ABI38_0_0RCTBlobPlugins.h\"\n\n#import \n#import \n\nClass ABI38_0_0RCTBlobClassProvider(const char *name) {\n static std::unordered_map sCoreModuleClassMap = {\n {\"FileReaderModule\", ABI38_0_0RCTFileReaderModuleCls},\n {\"BlobModule\", ABI38_0_0RCTBlobManagerCls},\n };\n\n auto p = sCoreModuleClassMap.find(name);\n if (p != sCoreModuleClassMap.end()) {\n auto classFunc = p->second;\n return classFunc();\n }\n return nil;\n}\n\n#endif // ABI38_0_0RN_DISABLE_OSS_PLUGIN_HEADER\n"} {"text": "/*\n * EliasDB\n *\n * Copyright 2016 Matthias Ladkau. 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\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n\npackage cluster\n\nimport (\n\t\"math\"\n\t\"testing\"\n\t\"time\"\n\n\t\"devt.de/krotik/eliasdb/cluster/manager\"\n)\n\nfunc TestSimpleDataReplicationFree(t *testing.T) {\n\n\t// Set a low distribution range\n\n\tdefaultDistributionRange = 5000\n\tdefer func() { defaultDistributionRange = math.MaxUint64 }()\n\n\t// Setup a cluster\n\n\tmanager.FreqHousekeeping = 5\n\tdefer func() { manager.FreqHousekeeping = 1000 }()\n\n\t// Log transfer worker runs\n\n\tlogTransferWorker = true\n\tdefer func() { logTransferWorker = false }()\n\n\t// Create a cluster with 3 members and a replication factor of 2\n\n\tcluster3, ms := createCluster(3, 2)\n\n\t// Debug output\n\n\t// manager.LogDebug = manager.LogInfo\n\t// log.SetOutput(os.Stderr)\n\t// defer func() { log.SetOutput(ioutil.Discard) }()\n\n\tfor i, dd := range cluster3 {\n\t\tdd.Start()\n\t\tdefer dd.Close()\n\n\t\tif i > 0 {\n\t\t\terr := dd.MemberManager.JoinCluster(cluster3[0].MemberManager.Name(), cluster3[0].MemberManager.NetAddr())\n\t\t\tif err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tsm := cluster3[1].StorageManager(\"test\", true)\n\n\t// Insert two strings into the store\n\n\tif loc, err := sm.Insert(\"test1\"); loc != 1 || err != nil {\n\t\tt.Error(\"Unexpected result:\", loc, err)\n\t\treturn\n\t}\n\n\tsm.Flush()\n\n\ttime.Sleep(10 * time.Millisecond)\n\n\tif loc, err := sm.Insert(\"test2\"); loc != 1666 || err != nil {\n\t\tt.Error(\"Unexpected result:\", loc, err)\n\t\treturn\n\t}\n\n\tsm.Flush()\n\n\t// Ensure the transfer worker is running on all members\n\n\tfor _, m := range ms {\n\t\tm.transferWorker()\n\t\tfor m.transferRunning {\n\t\t\ttime.Sleep(time.Millisecond)\n\t\t}\n\t}\n\n\t// Check that we have a certain storage layout in the cluster\n\n\tif res := clusterLayout(ms, \"test\"); res != `\nTestClusterMember-0 MemberStorageManager mgs1/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \ncloc: 1 (v:1) - lloc: 1 - \"\\b\\f\\x00\\x05test1\"\nTestClusterMember-1 MemberStorageManager mgs2/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \ncloc: 1 (v:1) - lloc: 1 - \"\\b\\f\\x00\\x05test1\"\ncloc: 1666 (v:1) - lloc: 2 - \"\\b\\f\\x00\\x05test2\"\nTestClusterMember-2 MemberStorageManager mgs3/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \ncloc: 1666 (v:1) - lloc: 1 - \"\\b\\f\\x00\\x05test2\"\n`[1:] && res != `\nTestClusterMember-0 MemberStorageManager mgs1/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \ncloc: 1 (v:1) - lloc: 1 - \"\\b\\f\\x00\\x05test1\"\nTestClusterMember-1 MemberStorageManager mgs2/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \ncloc: 1666 (v:1) - lloc: 1 - \"\\b\\f\\x00\\x05test2\"\ncloc: 1 (v:1) - lloc: 2 - \"\\b\\f\\x00\\x05test1\"\nTestClusterMember-2 MemberStorageManager mgs3/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \ncloc: 1666 (v:1) - lloc: 1 - \"\\b\\f\\x00\\x05test2\"\n`[1:] {\n\t\tt.Error(\"Unexpected cluster storage layout: \", res)\n\t\treturn\n\t}\n\n\t// Do a normal delete\n\n\tsm.Free(1666)\n\n\t// Ensure the transfer worker is running on all members\n\n\tfor _, m := range ms {\n\t\tm.transferWorker()\n\t\tfor m.transferRunning {\n\t\t\ttime.Sleep(time.Millisecond)\n\t\t}\n\t}\n\n\t// Check that we have a certain storage layout in the cluster\n\n\tif res := clusterLayout(ms, \"test\"); res != `\nTestClusterMember-0 MemberStorageManager mgs1/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \ncloc: 1 (v:1) - lloc: 1 - \"\\b\\f\\x00\\x05test1\"\nTestClusterMember-1 MemberStorageManager mgs2/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \ncloc: 1 (v:1) - lloc: 1 - \"\\b\\f\\x00\\x05test1\"\nTestClusterMember-2 MemberStorageManager mgs3/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \n`[1:] && res != `\nTestClusterMember-0 MemberStorageManager mgs1/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \ncloc: 1 (v:1) - lloc: 1 - \"\\b\\f\\x00\\x05test1\"\nTestClusterMember-1 MemberStorageManager mgs2/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \ncloc: 1 (v:1) - lloc: 2 - \"\\b\\f\\x00\\x05test1\"\nTestClusterMember-2 MemberStorageManager mgs3/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \n`[1:] {\n\t\tt.Error(\"Unexpected cluster storage layout: \", res)\n\t\treturn\n\t}\n\n\t// Simulate a failure on members 0\n\n\tmanager.MemberErrors = make(map[string]error)\n\tdefer func() { manager.MemberErrors = nil }()\n\n\tmanager.MemberErrors[cluster3[0].MemberManager.Name()] = &testNetError{}\n\tcluster3[0].MemberManager.StopHousekeeping = true\n\n\tsm.Free(1)\n\n\t// Make sure Housekeeping is running on member 1\n\n\tcluster3[1].MemberManager.HousekeepingWorker()\n\n\tif res := clusterLayout(ms, \"test\"); res != `\nTestClusterMember-0 MemberStorageManager mgs1/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \ncloc: 1 (v:1) - lloc: 1 - \"\\b\\f\\x00\\x05test1\"\nTestClusterMember-1 MemberStorageManager mgs2/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \ntransfer: [TestClusterMember-0] - Free {\"Loc\":1,\"StoreName\":\"test\"} \"null\"\nTestClusterMember-2 MemberStorageManager mgs3/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \n`[1:] {\n\t\tt.Error(\"Unexpected cluster storage layout: \", res)\n\t\treturn\n\t}\n\n\t// Now make member 0 work again\n\n\tdelete(manager.MemberErrors, cluster3[0].MemberManager.Name())\n\tcluster3[0].MemberManager.StopHousekeeping = false\n\n\t// Make sure Housekeeping is running on member 1\n\n\tcluster3[1].MemberManager.HousekeepingWorker()\n\n\tif res := clusterLayout(ms, \"test\"); res != `\nTestClusterMember-0 MemberStorageManager mgs1/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \nTestClusterMember-1 MemberStorageManager mgs2/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \nTestClusterMember-2 MemberStorageManager mgs3/ls_test\nRoots: 0=0 1=0 2=0 3=0 4=0 5=0 6=0 7=0 8=0 9=0 \n`[1:] {\n\t\tt.Error(\"Unexpected cluster storage layout: \", res)\n\t\treturn\n\t}\n}\n"} {"text": "// Copyright (C) 2018-2019 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\n// terms of the GNU General Public License as published by the\n// Free Software Foundation; either version 3, or (at your option)\n// 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 along\n// with this library; see the file COPYING3. If not see\n// .\n\n// { dg-options \"-std=gnu++17\" }\n// { dg-do run { target c++17 } }\n// { dg-require-cstdint \"\" }\n\n#include \n#include \n#include \n\nvoid\ntest01()\n{\n#ifdef _GLIBCXX_HAVE_ALIGNED_ALLOC\n void* p = std::aligned_alloc(256, 1);\n if (p)\n {\n VERIFY( (reinterpret_cast(p) % 256) == 0 );\n std::free(p);\n }\n#endif\n}\n\nint\nmain()\n{\n test01();\n}\n"} {"text": "package org.jetbrains.plugins.scala.lang.psi.impl.expr.xml\n\nimport com.intellij.lang.ASTNode\nimport org.jetbrains.plugins.scala.lang.psi.ScalaPsiElementImpl\nimport org.jetbrains.plugins.scala.lang.psi.api.expr.xml._\n\n/**\n* @author Alexander Podkhalyuzin\n* Date: 21.04.2008\n*/\n\nclass ScXmlPIImpl(node: ASTNode) extends ScalaPsiElementImpl (node) with ScXmlPI{\n override def toString: String = \"XmlProcessingInstructions\"\n}"} {"text": "// This file was automatically generated on Fri Dec 03 18:04:01 2004\n// by libs/config/tools/generate.cpp\n// Copyright John Maddock 2002-4.\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 copy at http://www.boost.org/LICENSE_1_0.txt)\n\n// See http://www.boost.org/libs/config for the most recent version.\n\n// Test file for macro BOOST_BCB_PARTIAL_SPECIALIZATION_BUG\n// This file should not compile, if it does then\n// BOOST_BCB_PARTIAL_SPECIALIZATION_BUG should not be defined.\n// See file boost_no_bcb_partial_spec.ipp for details\n\n// Must not have BOOST_ASSERT_CONFIG set; it defeats\n// the objective of this file:\n#ifdef BOOST_ASSERT_CONFIG\n# undef BOOST_ASSERT_CONFIG\n#endif\n\n#include \n#include \"test.hpp\"\n\n#ifdef BOOST_BCB_PARTIAL_SPECIALIZATION_BUG\n#include \"boost_no_bcb_partial_spec.ipp\"\n#else\n#error \"this file should not compile\"\n#endif\n\nint main( int, char *[] )\n{\n return boost_bcb_partial_specialization_bug::test();\n}\n\n"} {"text": "%%SITE_PERL%%/MCE.pm\n%%SITE_PERL%%/MCE.pod\n%%SITE_PERL%%/MCE/Candy.pm\n%%SITE_PERL%%/MCE/Channel.pm\n%%SITE_PERL%%/MCE/Channel/Mutex.pm\n%%SITE_PERL%%/MCE/Channel/Simple.pm\n%%SITE_PERL%%/MCE/Channel/Threads.pm\n%%SITE_PERL%%/MCE/Child.pm\n%%SITE_PERL%%/MCE/Core.pod\n%%SITE_PERL%%/MCE/Core/Input/Generator.pm\n%%SITE_PERL%%/MCE/Core/Input/Handle.pm\n%%SITE_PERL%%/MCE/Core/Input/Iterator.pm\n%%SITE_PERL%%/MCE/Core/Input/Request.pm\n%%SITE_PERL%%/MCE/Core/Input/Sequence.pm\n%%SITE_PERL%%/MCE/Core/Manager.pm\n%%SITE_PERL%%/MCE/Core/Validation.pm\n%%SITE_PERL%%/MCE/Core/Worker.pm\n%%SITE_PERL%%/MCE/Examples.pod\n%%SITE_PERL%%/MCE/Flow.pm\n%%SITE_PERL%%/MCE/Grep.pm\n%%SITE_PERL%%/MCE/Loop.pm\n%%SITE_PERL%%/MCE/Map.pm\n%%SITE_PERL%%/MCE/Mutex.pm\n%%SITE_PERL%%/MCE/Mutex/Channel.pm\n%%SITE_PERL%%/MCE/Mutex/Channel2.pm\n%%SITE_PERL%%/MCE/Mutex/Flock.pm\n%%SITE_PERL%%/MCE/Queue.pm\n%%SITE_PERL%%/MCE/Relay.pm\n%%SITE_PERL%%/MCE/Signal.pm\n%%SITE_PERL%%/MCE/Step.pm\n%%SITE_PERL%%/MCE/Stream.pm\n%%SITE_PERL%%/MCE/Subs.pm\n%%SITE_PERL%%/MCE/Util.pm\n%%PERL5_MAN3%%/MCE.3.gz\n%%PERL5_MAN3%%/MCE::Candy.3.gz\n%%PERL5_MAN3%%/MCE::Channel.3.gz\n%%PERL5_MAN3%%/MCE::Channel::Mutex.3.gz\n%%PERL5_MAN3%%/MCE::Channel::Simple.3.gz\n%%PERL5_MAN3%%/MCE::Channel::Threads.3.gz\n%%PERL5_MAN3%%/MCE::Child.3.gz\n%%PERL5_MAN3%%/MCE::Core.3.gz\n%%PERL5_MAN3%%/MCE::Core::Input::Generator.3.gz\n%%PERL5_MAN3%%/MCE::Core::Input::Handle.3.gz\n%%PERL5_MAN3%%/MCE::Core::Input::Iterator.3.gz\n%%PERL5_MAN3%%/MCE::Core::Input::Request.3.gz\n%%PERL5_MAN3%%/MCE::Core::Input::Sequence.3.gz\n%%PERL5_MAN3%%/MCE::Core::Manager.3.gz\n%%PERL5_MAN3%%/MCE::Core::Validation.3.gz\n%%PERL5_MAN3%%/MCE::Core::Worker.3.gz\n%%PERL5_MAN3%%/MCE::Examples.3.gz\n%%PERL5_MAN3%%/MCE::Flow.3.gz\n%%PERL5_MAN3%%/MCE::Grep.3.gz\n%%PERL5_MAN3%%/MCE::Loop.3.gz\n%%PERL5_MAN3%%/MCE::Map.3.gz\n%%PERL5_MAN3%%/MCE::Mutex.3.gz\n%%PERL5_MAN3%%/MCE::Mutex::Channel.3.gz\n%%PERL5_MAN3%%/MCE::Mutex::Channel2.3.gz\n%%PERL5_MAN3%%/MCE::Mutex::Flock.3.gz\n%%PERL5_MAN3%%/MCE::Queue.3.gz\n%%PERL5_MAN3%%/MCE::Relay.3.gz\n%%PERL5_MAN3%%/MCE::Signal.3.gz\n%%PERL5_MAN3%%/MCE::Step.3.gz\n%%PERL5_MAN3%%/MCE::Stream.3.gz\n%%PERL5_MAN3%%/MCE::Subs.3.gz\n%%PERL5_MAN3%%/MCE::Util.3.gz\n"} {"text": "#!/bin/sh\n\ndie () { echo \"$@\" ; exit 1; }\n\n\\. ../../nvm.sh\n\n# Remove the stuff we're clobbering.\n[ -e \"${NVM_DIR}/versions/io.js/v1.0.0\" ] && rm -R \"${NVM_DIR}/versions/io.js/v1.0.0\"\n[ -e \"${NVM_DIR}/versions/io.js/v1.0.1\" ] && rm -R \"${NVM_DIR}/versions/io.js/v1.0.1\"\n\n# Install from binary\nnvm install iojs-v1.0.0 || die \"'nvm install iojs-v1.0.0' failed\"\nnvm i iojs-v1.0.1 || die \"'nvm i iojs-v1.0.1' failed\"\n\n# Check\n[ -d \"${NVM_DIR}/versions/io.js/v1.0.0\" ] || die \"iojs v1.0.0 didn't exist\"\n[ -d \"${NVM_DIR}/versions/io.js/v1.0.1\" ] || die \"iojs v1.0.1 didn't exist\"\n\n# Use the first one\nnvm use iojs-1.0.0 || die \"'nvm use iojs-1.0.0' failed\"\n\n# Use the latest one\nnvm use iojs-1 || die \"'nvm use iojs-1' failed\"\n[ \"_$(node --version)\" = \"_v1.0.1\" ] || die \"'node --version' was not v1.0.1, got: $(node --version)\"\n[ \"_$(iojs --version)\" = \"_v1.0.1\" ] || die \"'iojs --version' was not v1.0.1, got: $(iojs --version)\"\n"} {"text": "---\ntitle: 如何使用自动实现的属性实现轻量类(C# 编程指南)\ndescription: 了解如何使用 C# 创建一个封装自动实现的属性的不可变轻型类。 有两种实现方法。\nms.date: 07/20/2015\nhelpviewer_keywords:\n- auto-implemented properties [C#]\n- properties [C#], auto-implemented\nms.assetid: 1dc5a8ad-a4f7-4f32-8506-3fc6d8c8bfed\nms.openlocfilehash: de9034772bad1f28e27abe01595309dd84ddc3e7\nms.sourcegitcommit: 3d84eac0818099c9949035feb96bbe0346358504\nms.translationtype: HT\nms.contentlocale: zh-CN\nms.lasthandoff: 07/21/2020\nms.locfileid: \"86864561\"\n---\n# 如何使用自动实现的属性实现轻量类(C# 编程指南)\n\n本示例演示如何创建一个仅用于封装一组自动实现的属性的不可变轻型类。 当你必须使用引用类型语义时,请使用此种构造而不是结构。\n\n可通过两种方法来实现不可变的属性:\n\n- 可以将 [set](../../language-reference/keywords/set.md) 访问器声明为[专用](../../language-reference/keywords/private.md)。 属性只能在该类型中设置,但它对于使用者是不可变的。\n\n 当你声明一个 private `set` 取值函数时,你无法使用对象初始值设定项来初始化属性。 你必须使用构造函数或工厂方法。\n- 也可以仅声明 [get](../../language-reference/keywords/get.md) 访问器,使属性除了能在该类型的构造函数中可变,在其他任何位置都不可变。\n\n下面的示例显示了只有 get 访问器的属性与具有 get 和 private set 的属性的区别。\n\n```csharp\nclass Contact\n{\n public string Name { get; }\n public string Address { get; private set; }\n\n public Contact(string contactName, string contactAddress)\n {\n // Both properties are accessible in the constructor.\n Name = contactName;\n Address = contactAddress;\n }\n\n // Name isn't assignable here. This will generate a compile error.\n //public void ChangeName(string newName) => Name = newName;\n\n // Address is assignable here.\n public void ChangeAddress(string newAddress) => Address = newAddress\n}\n```\n\n## 示例\n\n下面的示例演示了实现具有自动实现属性的不可变类的两种方法。 这两种方法均使用 private `set` 声明其中一个属性,使用单独的 `get` 声明另一个属性。 第一个类仅使用构造函数来初始化属性,第二个类则使用可调用构造函数的静态工厂方法。\n\n```csharp\n// This class is immutable. After an object is created,\n// it cannot be modified from outside the class. It uses a\n// constructor to initialize its properties.\nclass Contact\n{\n // Read-only property.\n public string Name { get; }\n\n // Read-write property with a private set accessor.\n public string Address { get; private set; }\n\n // Public constructor.\n public Contact(string contactName, string contactAddress)\n {\n Name = contactName;\n Address = contactAddress;\n }\n}\n\n// This class is immutable. After an object is created,\n// it cannot be modified from outside the class. It uses a\n// static method and private constructor to initialize its properties.\npublic class Contact2\n{\n // Read-write property with a private set accessor.\n public string Name { get; private set; }\n\n // Read-only property.\n public string Address { get; }\n\n // Private constructor.\n private Contact2(string contactName, string contactAddress)\n {\n Name = contactName;\n Address = contactAddress;\n }\n\n // Public factory method.\n public static Contact2 CreateContact(string name, string address)\n {\n return new Contact2(name, address);\n }\n}\n\npublic class Program\n{\n static void Main()\n {\n // Some simple data sources.\n string[] names = {\"Terry Adams\",\"Fadi Fakhouri\", \"Hanying Feng\",\n \"Cesar Garcia\", \"Debra Garcia\"};\n string[] addresses = {\"123 Main St.\", \"345 Cypress Ave.\", \"678 1st Ave\",\n \"12 108th St.\", \"89 E. 42nd St.\"};\n\n // Simple query to demonstrate object creation in select clause.\n // Create Contact objects by using a constructor.\n var query1 = from i in Enumerable.Range(0, 5)\n select new Contact(names[i], addresses[i]);\n\n // List elements cannot be modified by client code.\n var list = query1.ToList();\n foreach (var contact in list)\n {\n Console.WriteLine(\"{0}, {1}\", contact.Name, contact.Address);\n }\n\n // Create Contact2 objects by using a static factory method.\n var query2 = from i in Enumerable.Range(0, 5)\n select Contact2.CreateContact(names[i], addresses[i]);\n\n // Console output is identical to query1.\n var list2 = query2.ToList();\n\n // List elements cannot be modified by client code.\n // CS0272:\n // list2[0].Name = \"Eugene Zabokritski\";\n\n // Keep the console open in debug mode.\n Console.WriteLine(\"Press any key to exit.\");\n Console.ReadKey();\n }\n}\n\n/* Output:\n Terry Adams, 123 Main St.\n Fadi Fakhouri, 345 Cypress Ave.\n Hanying Feng, 678 1st Ave\n Cesar Garcia, 12 108th St.\n Debra Garcia, 89 E. 42nd St.\n*/\n```\n\n编译器为每个自动实现的属性创建了支持字段。 这些字段无法直接从源代码进行访问。\n\n## 请参阅\n\n- [属性](./properties.md)\n- [struct](../../language-reference/builtin-types/struct.md)\n- [对象和集合初始值设定项](./object-and-collection-initializers.md)\n"} {"text": "/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:\n Original: x32.xml */\n\n#include \"defs.h\"\n#include \"osabi.h\"\n#include \"target-descriptions.h\"\n\nstruct target_desc *tdesc_x32;\nstatic void\ninitialize_tdesc_x32 (void)\n{\n struct target_desc *result = allocate_target_description ();\n struct tdesc_feature *feature;\n struct tdesc_type *field_type;\n struct tdesc_type *type;\n\n set_tdesc_architecture (result, bfd_scan_arch (\"i386:x64-32\"));\n\n feature = tdesc_create_feature (result, \"org.gnu.gdb.i386.core\");\n field_type = tdesc_create_flags (feature, \"i386_eflags\", 4);\n tdesc_add_flag (field_type, 0, \"CF\");\n tdesc_add_flag (field_type, 1, \"\");\n tdesc_add_flag (field_type, 2, \"PF\");\n tdesc_add_flag (field_type, 4, \"AF\");\n tdesc_add_flag (field_type, 6, \"ZF\");\n tdesc_add_flag (field_type, 7, \"SF\");\n tdesc_add_flag (field_type, 8, \"TF\");\n tdesc_add_flag (field_type, 9, \"IF\");\n tdesc_add_flag (field_type, 10, \"DF\");\n tdesc_add_flag (field_type, 11, \"OF\");\n tdesc_add_flag (field_type, 14, \"NT\");\n tdesc_add_flag (field_type, 16, \"RF\");\n tdesc_add_flag (field_type, 17, \"VM\");\n tdesc_add_flag (field_type, 18, \"AC\");\n tdesc_add_flag (field_type, 19, \"VIF\");\n tdesc_add_flag (field_type, 20, \"VIP\");\n tdesc_add_flag (field_type, 21, \"ID\");\n\n tdesc_create_reg (feature, \"rax\", 0, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"rbx\", 1, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"rcx\", 2, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"rdx\", 3, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"rsi\", 4, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"rdi\", 5, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"rbp\", 6, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"rsp\", 7, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"r8\", 8, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"r9\", 9, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"r10\", 10, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"r11\", 11, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"r12\", 12, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"r13\", 13, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"r14\", 14, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"r15\", 15, 1, NULL, 64, \"int64\");\n tdesc_create_reg (feature, \"rip\", 16, 1, NULL, 64, \"uint64\");\n tdesc_create_reg (feature, \"eflags\", 17, 1, NULL, 32, \"i386_eflags\");\n tdesc_create_reg (feature, \"cs\", 18, 1, NULL, 32, \"int32\");\n tdesc_create_reg (feature, \"ss\", 19, 1, NULL, 32, \"int32\");\n tdesc_create_reg (feature, \"ds\", 20, 1, NULL, 32, \"int32\");\n tdesc_create_reg (feature, \"es\", 21, 1, NULL, 32, \"int32\");\n tdesc_create_reg (feature, \"fs\", 22, 1, NULL, 32, \"int32\");\n tdesc_create_reg (feature, \"gs\", 23, 1, NULL, 32, \"int32\");\n tdesc_create_reg (feature, \"st0\", 24, 1, NULL, 80, \"i387_ext\");\n tdesc_create_reg (feature, \"st1\", 25, 1, NULL, 80, \"i387_ext\");\n tdesc_create_reg (feature, \"st2\", 26, 1, NULL, 80, \"i387_ext\");\n tdesc_create_reg (feature, \"st3\", 27, 1, NULL, 80, \"i387_ext\");\n tdesc_create_reg (feature, \"st4\", 28, 1, NULL, 80, \"i387_ext\");\n tdesc_create_reg (feature, \"st5\", 29, 1, NULL, 80, \"i387_ext\");\n tdesc_create_reg (feature, \"st6\", 30, 1, NULL, 80, \"i387_ext\");\n tdesc_create_reg (feature, \"st7\", 31, 1, NULL, 80, \"i387_ext\");\n tdesc_create_reg (feature, \"fctrl\", 32, 1, \"float\", 32, \"int\");\n tdesc_create_reg (feature, \"fstat\", 33, 1, \"float\", 32, \"int\");\n tdesc_create_reg (feature, \"ftag\", 34, 1, \"float\", 32, \"int\");\n tdesc_create_reg (feature, \"fiseg\", 35, 1, \"float\", 32, \"int\");\n tdesc_create_reg (feature, \"fioff\", 36, 1, \"float\", 32, \"int\");\n tdesc_create_reg (feature, \"foseg\", 37, 1, \"float\", 32, \"int\");\n tdesc_create_reg (feature, \"fooff\", 38, 1, \"float\", 32, \"int\");\n tdesc_create_reg (feature, \"fop\", 39, 1, \"float\", 32, \"int\");\n\n feature = tdesc_create_feature (result, \"org.gnu.gdb.i386.sse\");\n field_type = tdesc_named_type (feature, \"ieee_single\");\n tdesc_create_vector (feature, \"v4f\", field_type, 4);\n\n field_type = tdesc_named_type (feature, \"ieee_double\");\n tdesc_create_vector (feature, \"v2d\", field_type, 2);\n\n field_type = tdesc_named_type (feature, \"int8\");\n tdesc_create_vector (feature, \"v16i8\", field_type, 16);\n\n field_type = tdesc_named_type (feature, \"int16\");\n tdesc_create_vector (feature, \"v8i16\", field_type, 8);\n\n field_type = tdesc_named_type (feature, \"int32\");\n tdesc_create_vector (feature, \"v4i32\", field_type, 4);\n\n field_type = tdesc_named_type (feature, \"int64\");\n tdesc_create_vector (feature, \"v2i64\", field_type, 2);\n\n type = tdesc_create_union (feature, \"vec128\");\n field_type = tdesc_named_type (feature, \"v4f\");\n tdesc_add_field (type, \"v4_float\", field_type);\n field_type = tdesc_named_type (feature, \"v2d\");\n tdesc_add_field (type, \"v2_double\", field_type);\n field_type = tdesc_named_type (feature, \"v16i8\");\n tdesc_add_field (type, \"v16_int8\", field_type);\n field_type = tdesc_named_type (feature, \"v8i16\");\n tdesc_add_field (type, \"v8_int16\", field_type);\n field_type = tdesc_named_type (feature, \"v4i32\");\n tdesc_add_field (type, \"v4_int32\", field_type);\n field_type = tdesc_named_type (feature, \"v2i64\");\n tdesc_add_field (type, \"v2_int64\", field_type);\n field_type = tdesc_named_type (feature, \"uint128\");\n tdesc_add_field (type, \"uint128\", field_type);\n\n field_type = tdesc_create_flags (feature, \"i386_mxcsr\", 4);\n tdesc_add_flag (field_type, 0, \"IE\");\n tdesc_add_flag (field_type, 1, \"DE\");\n tdesc_add_flag (field_type, 2, \"ZE\");\n tdesc_add_flag (field_type, 3, \"OE\");\n tdesc_add_flag (field_type, 4, \"UE\");\n tdesc_add_flag (field_type, 5, \"PE\");\n tdesc_add_flag (field_type, 6, \"DAZ\");\n tdesc_add_flag (field_type, 7, \"IM\");\n tdesc_add_flag (field_type, 8, \"DM\");\n tdesc_add_flag (field_type, 9, \"ZM\");\n tdesc_add_flag (field_type, 10, \"OM\");\n tdesc_add_flag (field_type, 11, \"UM\");\n tdesc_add_flag (field_type, 12, \"PM\");\n tdesc_add_flag (field_type, 15, \"FZ\");\n\n tdesc_create_reg (feature, \"xmm0\", 40, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm1\", 41, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm2\", 42, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm3\", 43, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm4\", 44, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm5\", 45, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm6\", 46, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm7\", 47, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm8\", 48, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm9\", 49, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm10\", 50, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm11\", 51, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm12\", 52, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm13\", 53, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm14\", 54, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"xmm15\", 55, 1, NULL, 128, \"vec128\");\n tdesc_create_reg (feature, \"mxcsr\", 56, 1, \"vector\", 32, \"i386_mxcsr\");\n\n tdesc_x32 = result;\n}\n"} {"text": " SUBROUTINE OFFSET_ccsdt_lr_alpha_offdiag_15_33_3_1(l_a_offset,k_a_\n &offset,size)\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 i3 ( h10 p11 p5 p6 )_ya\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 l_a_offset\n INTEGER k_a_offset\n INTEGER size\n INTEGER length\n INTEGER addr\n INTEGER h10b\n INTEGER p11b\n INTEGER p5b\n INTEGER p6b\n length = 0\n DO h10b = 1,noab\n DO p11b = noab+1,noab+nvab\n DO p5b = noab+1,noab+nvab\n DO p6b = p5b,noab+nvab\n IF (int_mb(k_spin+h10b-1)+int_mb(k_spin+p11b-1) .eq. int_mb(k_spin\n &+p5b-1)+int_mb(k_spin+p6b-1)) THEN\n IF (ieor(int_mb(k_sym+h10b-1),ieor(int_mb(k_sym+p11b-1),ieor(int_m\n &b(k_sym+p5b-1),int_mb(k_sym+p6b-1)))) .eq. ieor(irrep_y,irrep_a)) \n &THEN\n IF ((.not.restricted).or.(int_mb(k_spin+h10b-1)+int_mb(k_spin+p11b\n &-1)+int_mb(k_spin+p5b-1)+int_mb(k_spin+p6b-1).ne.8)) THEN\n length = length + 1\n END IF\n END IF\n END IF\n END DO\n END DO\n END DO\n END DO\n IF (.not.MA_PUSH_GET(mt_int,2*length+1,'noname',l_a_offset,k_a_off\n &set)) CALL ERRQUIT('ccsdt_lr_alpha_offdiag_15_33_3_1',0,MA_ERR)\n int_mb(k_a_offset) = length\n addr = 0\n size = 0\n DO h10b = 1,noab\n DO p11b = noab+1,noab+nvab\n DO p5b = noab+1,noab+nvab\n DO p6b = p5b,noab+nvab\n IF (int_mb(k_spin+h10b-1)+int_mb(k_spin+p11b-1) .eq. int_mb(k_spin\n &+p5b-1)+int_mb(k_spin+p6b-1)) THEN\n IF (ieor(int_mb(k_sym+h10b-1),ieor(int_mb(k_sym+p11b-1),ieor(int_m\n &b(k_sym+p5b-1),int_mb(k_sym+p6b-1)))) .eq. ieor(irrep_y,irrep_a)) \n &THEN\n IF ((.not.restricted).or.(int_mb(k_spin+h10b-1)+int_mb(k_spin+p11b\n &-1)+int_mb(k_spin+p5b-1)+int_mb(k_spin+p6b-1).ne.8)) THEN\n addr = addr + 1\n int_mb(k_a_offset+addr) = p6b - noab - 1 + nvab * (p5b - noab - 1 \n &+ nvab * (p11b - noab - 1 + nvab * (h10b - 1)))\n int_mb(k_a_offset+length+addr) = size\n size = size + int_mb(k_range+h10b-1) * int_mb(k_range+p11b-1) * in\n &t_mb(k_range+p5b-1) * int_mb(k_range+p6b-1)\n END IF\n END IF\n END IF\n END DO\n END DO\n END DO\n END DO\n RETURN\n END\n"} {"text": "// { dg-do compile }\n// { dg-options \"-std=gnu++0x\" }\n\n// Copyright (C) 2011-2013 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\n// terms of the GNU General Public License as published by the\n// Free Software Foundation; either version 3, or (at your option)\n// 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 along\n// with this library; see the file COPYING3. If not see\n// .\n\n// check for duplicates of complex overloads of acos, asin, atan and fabs\n\n#include \n#include \n#include \n\n"} {"text": "\tHello\r\n\tWorld\r\n"} {"text": "# logFaces Appender (UDP)\n\nThe logFaces appenders send JSON formatted log events to [logFaces](http://www.moonlit-software.com) receivers. This appender uses UDP to send the events (there is another logFaces appender that uses [HTTP](logFaces-HTTP.md)). It uses the node.js core UDP support, so you do not need to include any other dependencies.\n\n## Configuration\n\n* `type` - `logFaces-UDP`\n* `remoteHost` - `string` (optional, defaults to '127.0.0.1')- hostname or IP address of the logFaces receiver\n* `port` - `integer` (optional, defaults to 55201) - port the logFaces receiver is listening on\n* `application` - `string` (optional, defaults to empty string) - used to identify your application's logs\n\nThis appender will also pick up Logger context values from the events, and add them as `p_` values in the logFaces event. See the example below for more details.\n\n# Example (default config)\n\n```javascript\nlog4js.configure({\n appenders: {\n logfaces: { type: 'logFaces-UDP' }\n },\n categories: {\n default: { appenders: [ 'logfaces' ], level: 'info' }\n }\n});\n\nconst logger = log4js.getLogger();\nlogger.addContext('requestId', '123');\nlogger.info('some interesting log message');\nlogger.error('something has gone wrong');\n```\nThis example will result in two log events being sent via UDP to `127.0.0.1:55201`. Both events will have a `p_requestId` property with a value of `123`.\n"} {"text": "{\n\t\"parent\": \"draconicevolution:block/energy_core_stabilizer\"\n}\n"} {"text": "module.exports = path => () => import('@/views/' + path + '.vue');\n// module.exports = path => r => require.ensure([], () => r(require('@/views/' + path + '.vue')));"} {"text": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Input, Icon, Popover, Tooltip } from 'antd';\nimport Calendar from 'rc-calendar';\nimport moment from 'moment';\nimport _ from 'lodash';\nimport enUS from 'rc-calendar/lib/locale/en_US';\nimport 'rc-calendar/assets/index.css';\nimport './style.less';\n\nfunction transformGregorianToMoment(format: string) {\n return _.chain(format).replace('yyyy', 'YYYY').replace('dd', 'DD').value();\n}\n\nexport default class DateInput extends Component {\n static propTypes = {\n size: PropTypes.string, // antd Input size\n format: PropTypes.string.isRequired, // gregorian format\n locale: PropTypes.object,\n style: PropTypes.object,\n value: PropTypes.string,\n onChange: PropTypes.func,\n };\n\n static defaultProps = {\n size: 'default',\n value: undefined,\n locale: {},\n style: {},\n onChange: _.noop,\n };\n\n constructor(props: any) {\n super(props);\n this.state = {\n tempValue: props.value,\n tempSelectedValue: props.value,\n invalid: false,\n popoverVisible: false,\n tooltipVisible: false,\n };\n }\n\n componentDidMount() {\n this.checkTempValue();\n }\n\n componentWillReceiveProps(nextProps: any) {\n if (nextProps.value !== this.props.value) {\n this.setState({\n tempValue: nextProps.value,\n tempSelectedValue: nextProps.value,\n });\n }\n }\n\n checkTempValue = () => {\n const { format } = this.props;\n const { tempValue } = this.state;\n const momentFormat = transformGregorianToMoment(format);\n const date = moment(tempValue, momentFormat, true);\n let invalid = false;\n\n if (date.format() === 'Invalid date') {\n invalid = true;\n }\n\n this.setState({ invalid });\n }\n\n handleBlur = () => {\n const { invalid, tempValue } = this.state;\n if (!invalid) {\n this.props.onChange(moment(tempValue).toDate());\n } else {\n this.setState({\n tempValue: this.props.value,\n tooltipVisible: false,\n });\n }\n }\n\n handleKeyUp = (e: any) => {\n const { invalid, tempValue } = this.state;\n if (e.keyCode === 13 && !invalid) {\n this.props.onChange(moment(tempValue).toDate());\n }\n }\n\n handleChange = (e: any) => {\n const { value } = e.target;\n this.setState({ tempValue: value }, () => {\n const invalid = this.checkTempValue();\n this.setState({ invalid, tooltipVisible: invalid });\n });\n }\n\n closePopover = () => {\n this.setState({\n popoverVisible: false,\n tempSelectedValue: this.props.value,\n });\n }\n\n render() {\n const {\n size, style, format, locale, onChange,\n } = this.props;\n const {\n tempValue, tempSelectedValue, popoverVisible, tooltipVisible,\n } = this.state;\n const momentFormat = transformGregorianToMoment(format);\n const selectedValue = tempSelectedValue ? moment(tempSelectedValue) : null;\n\n return (\n \n {\n onChange(mDate.toDate());\n this.closePopover();\n }}\n onClear={() => {\n this.closePopover();\n }}\n onSelect={(mDate: any) => {\n if (mDate && mDate.format() !== 'Invalid date') {\n this.setState({ tempSelectedValue: mDate.format(momentFormat) });\n }\n }}\n />\n }\n onVisibleChange={() => {\n this.closePopover();\n }}\n >\n \n 请按照 {momentFormat} 格式填写\n \n }\n >\n {\n if (popoverVisible) {\n this.closePopover();\n } else {\n this.setState({ popoverVisible: true });\n }\n }}\n />\n }\n />\n \n \n \n );\n }\n}\n"} {"text": "// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations\n// under the License.\n#pragma once\n\n#include \n#include \n#include \n#include \n\n#include \"kudu/gutil/macros.h\"\n#include \"kudu/gutil/port.h\"\n#include \"kudu/util/rw_mutex.h\"\n\nnamespace kudu {\n\nclass Status;\n\nnamespace security {\n\nclass SignedTokenPB;\nclass TokenPB;\nclass TokenSigningPublicKey;\nclass TokenSigningPublicKeyPB;\nenum class VerificationResult;\n\n// Class responsible for verifying tokens provided to a server.\n//\n// This class manages a set of public keys, each identified by a sequence\n// number. It exposes the latest known sequence number, which can be sent\n// to a 'TokenSigner' running on another node. That node can then\n// export public keys, which are transferred back to this node and imported\n// into the 'TokenVerifier'.\n//\n// Each signed token also includes the key sequence number that signed it,\n// so this class can look up the correct key and verify the token's\n// validity and expiration.\n//\n// Note that this class does not perform any \"business logic\" around the\n// content of a token. It only verifies that the token has a valid signature\n// and is not yet expired. Any business rules around authorization or\n// authentication are left up to callers.\n//\n// NOTE: old tokens are never removed from the underlying storage of this\n// class. The assumption is that tokens rotate so infreqeuently that this\n// slow leak is not worrisome. If this class is adopted for any use cases\n// with frequent rotation, GC of expired tokens will need to be added.\n//\n// This class is thread-safe.\nclass TokenVerifier {\n public:\n TokenVerifier();\n ~TokenVerifier();\n\n // Return the highest key sequence number known by this instance.\n //\n // If no keys are known, return -1.\n int64_t GetMaxKnownKeySequenceNumber() const;\n\n // Import a set of public keys provided by a TokenSigner instance\n // (which might be running on a remote node). If any public keys already\n // exist with matching key sequence numbers, they are replaced by\n // the new keys.\n Status ImportKeys(const std::vector& keys) WARN_UNUSED_RESULT;\n\n // Export token signing public keys. Specifying the 'after_sequence_number'\n // allows to get public keys with sequence numbers greater than\n // 'after_sequence_number'. If the 'after_sequence_number' parameter is\n // omitted, all known public keys are exported.\n std::vector ExportKeys(\n int64_t after_sequence_number = -1) const;\n\n // Verify the signature on the given signed token, and deserialize the\n // contents into 'token'.\n VerificationResult VerifyTokenSignature(const SignedTokenPB& signed_token,\n TokenPB* token) const;\n\n private:\n typedef std::map> KeysMap;\n\n // Lock protecting keys_by_seq_\n mutable RWMutex lock_;\n KeysMap keys_by_seq_;\n\n DISALLOW_COPY_AND_ASSIGN(TokenVerifier);\n};\n\n// Result of a token verification.\n// Values added to this enum must also be added to VerificationResultToString().\nenum class VerificationResult {\n // The signature is valid and the token is not expired.\n VALID,\n // The token itself is invalid (e.g. missing its signature or data,\n // can't be deserialized, etc).\n INVALID_TOKEN,\n // The signature is invalid (i.e. cryptographically incorrect).\n INVALID_SIGNATURE,\n // The signature is valid, but the token has already expired.\n EXPIRED_TOKEN,\n // The signature is valid, but the signing key is no longer valid.\n EXPIRED_SIGNING_KEY,\n // The signing key used to sign this token is not available.\n UNKNOWN_SIGNING_KEY,\n // The token uses an incompatible feature which isn't supported by this\n // version of the server. We reject the token to give a \"default deny\"\n // policy.\n INCOMPATIBLE_FEATURE\n};\n\nconst char* VerificationResultToString(VerificationResult r);\n\n} // namespace security\n} // namespace kudu\n"} {"text": "\n\n \n \n \n"} {"text": "/*******************************************************************************\n Copyright (C) 2007-2009 STMicroelectronics Ltd\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 with\n this program; if not, write to the Free Software Foundation, Inc.,\n 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.\n\n The full GNU General Public License is included in this distribution in\n the file called \"COPYING\".\n\n Author: Giuseppe Cavallaro \n*******************************************************************************/\n\n#include \n#include \"common.h\"\n\n#define GMAC_CONTROL\t\t0x00000000\t/* Configuration */\n#define GMAC_FRAME_FILTER\t0x00000004\t/* Frame Filter */\n#define GMAC_HASH_HIGH\t\t0x00000008\t/* Multicast Hash Table High */\n#define GMAC_HASH_LOW\t\t0x0000000c\t/* Multicast Hash Table Low */\n#define GMAC_MII_ADDR\t\t0x00000010\t/* MII Address */\n#define GMAC_MII_DATA\t\t0x00000014\t/* MII Data */\n#define GMAC_FLOW_CTRL\t\t0x00000018\t/* Flow Control */\n#define GMAC_VLAN_TAG\t\t0x0000001c\t/* VLAN Tag */\n#define GMAC_VERSION\t\t0x00000020\t/* GMAC CORE Version */\n#define GMAC_WAKEUP_FILTER\t0x00000028\t/* Wake-up Frame Filter */\n\n#define GMAC_INT_STATUS\t\t0x00000038\t/* interrupt status register */\nenum dwmac1000_irq_status {\n\ttime_stamp_irq = 0x0200,\n\tmmc_rx_csum_offload_irq = 0x0080,\n\tmmc_tx_irq = 0x0040,\n\tmmc_rx_irq = 0x0020,\n\tmmc_irq = 0x0010,\n\tpmt_irq = 0x0008,\n\tpcs_ane_irq = 0x0004,\n\tpcs_link_irq = 0x0002,\n\trgmii_irq = 0x0001,\n};\n#define GMAC_INT_MASK\t\t0x0000003c\t/* interrupt mask register */\n\n/* PMT Control and Status */\n#define GMAC_PMT\t\t0x0000002c\nenum power_event {\n\tpointer_reset = 0x80000000,\n\tglobal_unicast = 0x00000200,\n\twake_up_rx_frame = 0x00000040,\n\tmagic_frame = 0x00000020,\n\twake_up_frame_en = 0x00000004,\n\tmagic_pkt_en = 0x00000002,\n\tpower_down = 0x00000001,\n};\n\n/* GMAC HW ADDR regs */\n#define GMAC_ADDR_HIGH(reg)\t\t(0x00000040+(reg * 8))\n#define GMAC_ADDR_LOW(reg)\t\t(0x00000044+(reg * 8))\n#define GMAC_MAX_UNICAST_ADDRESSES\t16\n\n#define GMAC_AN_CTRL\t0x000000c0\t/* AN control */\n#define GMAC_AN_STATUS\t0x000000c4\t/* AN status */\n#define GMAC_ANE_ADV\t0x000000c8\t/* Auto-Neg. Advertisement */\n#define GMAC_ANE_LINK\t0x000000cc\t/* Auto-Neg. link partener ability */\n#define GMAC_ANE_EXP\t0x000000d0\t/* ANE expansion */\n#define GMAC_TBI\t0x000000d4\t/* TBI extend status */\n#define GMAC_GMII_STATUS 0x000000d8\t/* S/R-GMII status */\n\n/* GMAC Configuration defines */\n#define GMAC_CONTROL_TC\t0x01000000\t/* Transmit Conf. in RGMII/SGMII */\n#define GMAC_CONTROL_WD\t0x00800000\t/* Disable Watchdog on receive */\n#define GMAC_CONTROL_JD\t0x00400000\t/* Jabber disable */\n#define GMAC_CONTROL_BE\t0x00200000\t/* Frame Burst Enable */\n#define GMAC_CONTROL_JE\t0x00100000\t/* Jumbo frame */\nenum inter_frame_gap {\n\tGMAC_CONTROL_IFG_88 = 0x00040000,\n\tGMAC_CONTROL_IFG_80 = 0x00020000,\n\tGMAC_CONTROL_IFG_40 = 0x000e0000,\n};\n#define GMAC_CONTROL_DCRS\t0x00010000 /* Disable carrier sense during tx */\n#define GMAC_CONTROL_PS\t\t0x00008000 /* Port Select 0:GMI 1:MII */\n#define GMAC_CONTROL_FES\t0x00004000 /* Speed 0:10 1:100 */\n#define GMAC_CONTROL_DO\t\t0x00002000 /* Disable Rx Own */\n#define GMAC_CONTROL_LM\t\t0x00001000 /* Loop-back mode */\n#define GMAC_CONTROL_DM\t\t0x00000800 /* Duplex Mode */\n#define GMAC_CONTROL_IPC\t0x00000400 /* Checksum Offload */\n#define GMAC_CONTROL_DR\t\t0x00000200 /* Disable Retry */\n#define GMAC_CONTROL_LUD\t0x00000100 /* Link up/down */\n#define GMAC_CONTROL_ACS\t0x00000080 /* Automatic Pad/FCS Stripping */\n#define GMAC_CONTROL_DC\t\t0x00000010 /* Deferral Check */\n#define GMAC_CONTROL_TE\t\t0x00000008 /* Transmitter Enable */\n#define GMAC_CONTROL_RE\t\t0x00000004 /* Receiver Enable */\n\n#define GMAC_CORE_INIT (GMAC_CONTROL_JD | GMAC_CONTROL_PS | GMAC_CONTROL_ACS | \\\n\t\t\tGMAC_CONTROL_JE | GMAC_CONTROL_BE)\n\n/* GMAC Frame Filter defines */\n#define GMAC_FRAME_FILTER_PR\t0x00000001\t/* Promiscuous Mode */\n#define GMAC_FRAME_FILTER_HUC\t0x00000002\t/* Hash Unicast */\n#define GMAC_FRAME_FILTER_HMC\t0x00000004\t/* Hash Multicast */\n#define GMAC_FRAME_FILTER_DAIF\t0x00000008\t/* DA Inverse Filtering */\n#define GMAC_FRAME_FILTER_PM\t0x00000010\t/* Pass all multicast */\n#define GMAC_FRAME_FILTER_DBF\t0x00000020\t/* Disable Broadcast frames */\n#define GMAC_FRAME_FILTER_SAIF\t0x00000100\t/* Inverse Filtering */\n#define GMAC_FRAME_FILTER_SAF\t0x00000200\t/* Source Address Filter */\n#define GMAC_FRAME_FILTER_HPF\t0x00000400\t/* Hash or perfect Filter */\n#define GMAC_FRAME_FILTER_RA\t0x80000000\t/* Receive all mode */\n/* GMII ADDR defines */\n#define GMAC_MII_ADDR_WRITE\t0x00000002\t/* MII Write */\n#define GMAC_MII_ADDR_BUSY\t0x00000001\t/* MII Busy */\n/* GMAC FLOW CTRL defines */\n#define GMAC_FLOW_CTRL_PT_MASK\t0xffff0000\t/* Pause Time Mask */\n#define GMAC_FLOW_CTRL_PT_SHIFT\t16\n#define GMAC_FLOW_CTRL_RFE\t0x00000004\t/* Rx Flow Control Enable */\n#define GMAC_FLOW_CTRL_TFE\t0x00000002\t/* Tx Flow Control Enable */\n#define GMAC_FLOW_CTRL_FCB_BPA\t0x00000001\t/* Flow Control Busy ... */\n\n/*--- DMA BLOCK defines ---*/\n/* DMA Bus Mode register defines */\n#define DMA_BUS_MODE_SFT_RESET\t0x00000001\t/* Software Reset */\n#define DMA_BUS_MODE_DA\t\t0x00000002\t/* Arbitration scheme */\n#define DMA_BUS_MODE_DSL_MASK\t0x0000007c\t/* Descriptor Skip Length */\n#define DMA_BUS_MODE_DSL_SHIFT\t2\t/* (in DWORDS) */\n/* Programmable burst length (passed thorugh platform)*/\n#define DMA_BUS_MODE_PBL_MASK\t0x00003f00\t/* Programmable Burst Len */\n#define DMA_BUS_MODE_PBL_SHIFT\t8\n\nenum rx_tx_priority_ratio {\n\tdouble_ratio = 0x00004000,\t/*2:1 */\n\ttriple_ratio = 0x00008000,\t/*3:1 */\n\tquadruple_ratio = 0x0000c000,\t/*4:1 */\n};\n\n#define DMA_BUS_MODE_FB\t\t0x00010000\t/* Fixed burst */\n#define DMA_BUS_MODE_RPBL_MASK\t0x003e0000\t/* Rx-Programmable Burst Len */\n#define DMA_BUS_MODE_RPBL_SHIFT\t17\n#define DMA_BUS_MODE_USP\t0x00800000\n#define DMA_BUS_MODE_4PBL\t0x01000000\n#define DMA_BUS_MODE_AAL\t0x02000000\n\n/* DMA CRS Control and Status Register Mapping */\n#define DMA_HOST_TX_DESC\t 0x00001048\t/* Current Host Tx descriptor */\n#define DMA_HOST_RX_DESC\t 0x0000104c\t/* Current Host Rx descriptor */\n/* DMA Bus Mode register defines */\n#define DMA_BUS_PR_RATIO_MASK\t 0x0000c000\t/* Rx/Tx priority ratio */\n#define DMA_BUS_PR_RATIO_SHIFT\t 14\n#define DMA_BUS_FB\t \t 0x00010000\t/* Fixed Burst */\n\n/* DMA operation mode defines (start/stop tx/rx are placed in common header)*/\n#define DMA_CONTROL_DT\t\t0x04000000 /* Disable Drop TCP/IP csum error */\n#define DMA_CONTROL_RSF\t\t0x02000000 /* Receive Store and Forward */\n#define DMA_CONTROL_DFF\t\t0x01000000 /* Disaable flushing */\n/* Threshold for Activating the FC */\nenum rfa {\n\tact_full_minus_1 = 0x00800000,\n\tact_full_minus_2 = 0x00800200,\n\tact_full_minus_3 = 0x00800400,\n\tact_full_minus_4 = 0x00800600,\n};\n/* Threshold for Deactivating the FC */\nenum rfd {\n\tdeac_full_minus_1 = 0x00400000,\n\tdeac_full_minus_2 = 0x00400800,\n\tdeac_full_minus_3 = 0x00401000,\n\tdeac_full_minus_4 = 0x00401800,\n};\n#define DMA_CONTROL_TSF\t\t0x00200000 /* Transmit Store and Forward */\n\nenum ttc_control {\n\tDMA_CONTROL_TTC_64 = 0x00000000,\n\tDMA_CONTROL_TTC_128 = 0x00004000,\n\tDMA_CONTROL_TTC_192 = 0x00008000,\n\tDMA_CONTROL_TTC_256 = 0x0000c000,\n\tDMA_CONTROL_TTC_40 = 0x00010000,\n\tDMA_CONTROL_TTC_32 = 0x00014000,\n\tDMA_CONTROL_TTC_24 = 0x00018000,\n\tDMA_CONTROL_TTC_16 = 0x0001c000,\n};\n#define DMA_CONTROL_TC_TX_MASK\t0xfffe3fff\n\n#define DMA_CONTROL_EFC\t\t0x00000100\n#define DMA_CONTROL_FEF\t\t0x00000080\n#define DMA_CONTROL_FUF\t\t0x00000040\n\nenum rtc_control {\n\tDMA_CONTROL_RTC_64 = 0x00000000,\n\tDMA_CONTROL_RTC_32 = 0x00000008,\n\tDMA_CONTROL_RTC_96 = 0x00000010,\n\tDMA_CONTROL_RTC_128 = 0x00000018,\n};\n#define DMA_CONTROL_TC_RX_MASK\t0xffffffe7\n\n#define DMA_CONTROL_OSF\t0x00000004\t/* Operate on second frame */\n\n/* MMC registers offset */\n#define GMAC_MMC_CTRL 0x100\n#define GMAC_MMC_RX_INTR 0x104\n#define GMAC_MMC_TX_INTR 0x108\n#define GMAC_MMC_RX_CSUM_OFFLOAD 0x208\n\nextern const struct stmmac_dma_ops dwmac1000_dma_ops;\n"} {"text": "/*\n * Copyright 2020 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\n/**\n * External dependencies\n */\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n DefaultParagraph1,\n StandardViewContentGutter,\n} from '../../../components';\n\nconst Text = styled(DefaultParagraph1)`\n margin-top: 40px;\n`;\n\nconst NoResults = ({ typeaheadValue }) => (\n \n \n {sprintf(\n /* translators: %s: search term. */\n __('Sorry, we couldn\\'t find any results matching \"%s\"', 'web-stories'),\n typeaheadValue\n )}\n \n \n);\n\nNoResults.propTypes = {\n typeaheadValue: PropTypes.string.isRequired,\n};\n\nexport default NoResults;\n"} {"text": "---\nlayout: default\nclass: Project\ntitle:\tfindname ';' PATH ( ';' FILTER )\nsummary: A list of filtered by name resource paths with optional replacement\n---\n\n\tpublic String _findname(String args[]) {\n\t\treturn findPath(\"findname\", args, false);\n\t}\n\n\tString findPath(String name, String[] args, boolean fullPathName) {\n\t\tif (args.length > 3) {\n\t\t\twarning(\"Invalid nr of arguments to \" + name + \" \" + Arrays.asList(args) + \", syntax: ${\" + name\n\t\t\t\t\t+ \" (; reg-expr (; replacement)? )? }\");\n\t\t\treturn null;\n\t\t}\n\n\t\tString regexp = \".*\";\n\t\tString replace = null;\n\n\t\tswitch (args.length) {\n\t\t\tcase 3 :\n\t\t\t\treplace = args[2];\n\t\t\t\t//$FALL-THROUGH$\n\t\t\tcase 2 :\n\t\t\t\tregexp = args[1];\n\t\t}\n\t\tStringBuilder sb = new StringBuilder();\n\t\tString del = \"\";\n\n\t\tPattern expr = Pattern.compile(regexp);\n\t\tfor (Iterator e = dot.getResources().keySet().iterator(); e.hasNext();) {\n\t\t\tString path = e.next();\n\t\t\tif (!fullPathName) {\n\t\t\t\tint n = path.lastIndexOf('/');\n\t\t\t\tif (n >= 0) {\n\t\t\t\t\tpath = path.substring(n + 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tMatcher m = expr.matcher(path);\n\t\t\tif (m.matches()) {\n\t\t\t\tif (replace != null)\n\t\t\t\t\tpath = m.replaceAll(replace);\n\n\t\t\t\tsb.append(del);\n\t\t\t\tsb.append(path);\n\t\t\t\tdel = \", \";\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}\n"} {"text": "\n\n# Quick reference\n\n-\t**Maintained by**: \n\t[Odoo](https://github.com/odoo/docker)\n\n-\t**Where to get help**: \n\t[the Docker Community Forums](https://forums.docker.com/), [the Docker Community Slack](https://dockr.ly/slack), or [Stack Overflow](https://stackoverflow.com/search?tab=newest&q=docker)\n\n# Supported tags and respective `Dockerfile` links\n\n-\t[`13.0`, `13`, `latest`](https://github.com/odoo/docker/blob/1bddcda4b2ef30c7443ebe0cae43d17f92aa43cd/13.0/Dockerfile)\n-\t[`12.0`, `12`](https://github.com/odoo/docker/blob/1bddcda4b2ef30c7443ebe0cae43d17f92aa43cd/12.0/Dockerfile)\n-\t[`11.0`, `11`](https://github.com/odoo/docker/blob/1bddcda4b2ef30c7443ebe0cae43d17f92aa43cd/11.0/Dockerfile)\n\n# Quick reference (cont.)\n\n-\t**Where to file issues**: \n\t[https://github.com/odoo/docker/issues](https://github.com/odoo/docker/issues)\n\n-\t**Supported architectures**: ([more info](https://github.com/docker-library/official-images#architectures-other-than-amd64)) \n\t[`amd64`](https://hub.docker.com/r/amd64/odoo/)\n\n-\t**Published image artifact details**: \n\t[repo-info repo's `repos/odoo/` directory](https://github.com/docker-library/repo-info/blob/master/repos/odoo) ([history](https://github.com/docker-library/repo-info/commits/master/repos/odoo)) \n\t(image metadata, transfer size, etc)\n\n-\t**Image updates**: \n\t[official-images PRs with label `library/odoo`](https://github.com/docker-library/official-images/pulls?q=label%3Alibrary%2Fodoo) \n\t[official-images repo's `library/odoo` file](https://github.com/docker-library/official-images/blob/master/library/odoo) ([history](https://github.com/docker-library/official-images/commits/master/library/odoo))\n\n-\t**Source of this description**: \n\t[docs repo's `odoo/` directory](https://github.com/docker-library/docs/tree/master/odoo) ([history](https://github.com/docker-library/docs/commits/master/odoo))\n\n# What is Odoo?\n\nOdoo, formerly known as OpenERP, is a suite of open-source business apps written in Python and released under the AGPL license. This suite of applications covers all business needs, from Website/Ecommerce down to manufacturing, inventory and accounting, all seamlessly integrated. It is the first time ever a software editor managed to reach such a functional coverage. Odoo is the most installed business software in the world. Odoo is used by 2.000.000 users worldwide ranging from very small companies (1 user) to very large ones (300 000 users).\n\n> [www.odoo.com](https://www.odoo.com)\n\n![logo](https://raw.githubusercontent.com/docker-library/docs/a11348f9798f9c5e51e92409ebf4d5b39988fd13/odoo/logo.png)\n\n# How to use this image\n\nThis image requires a running PostgreSQL server.\n\n## Start a PostgreSQL server\n\n```console\n$ docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres:10\n```\n\n## Start an Odoo instance\n\n```console\n$ docker run -p 8069:8069 --name odoo --link db:db -t odoo\n```\n\nThe alias of the container running Postgres must be db for Odoo to be able to connect to the Postgres server.\n\n## Stop and restart an Odoo instance\n\n```console\n$ docker stop odoo\n$ docker start -a odoo\n```\n\n## Stop and restart a PostgreSQL server\n\nWhen a PostgreSQL server is restarted, the Odoo instances linked to that server must be restarted as well because the server address has changed and the link is thus broken.\n\nRestarting a PostgreSQL server does not affect the created databases.\n\n## Run Odoo with a custom configuration\n\nThe default configuration file for the server (located at `/etc/odoo/odoo.conf`) can be overriden at startup using volumes. Suppose you have a custom configuration at `/path/to/config/odoo.conf`, then\n\n```console\n$ docker run -v /path/to/config:/etc/odoo -p 8069:8069 --name odoo --link db:db -t odoo\n```\n\nPlease use [this configuration template](https://github.com/odoo/docker/blob/master/12.0/odoo.conf) to write your custom configuration as we already set some arguments for running Odoo inside a Docker container.\n\nYou can also directly specify Odoo arguments inline. Those arguments must be given after the keyword `--` in the command-line, as follows\n\n```console\n$ docker run -p 8069:8069 --name odoo --link db:db -t odoo -- --db-filter=odoo_db_.*\n```\n\n## Mount custom addons\n\nYou can mount your own Odoo addons within the Odoo container, at `/mnt/extra-addons`\n\n```console\n$ docker run -v /path/to/addons:/mnt/extra-addons -p 8069:8069 --name odoo --link db:db -t odoo\n```\n\n## Run multiple Odoo instances\n\n```console\n$ docker run -p 8070:8069 --name odoo2 --link db:db -t odoo\n$ docker run -p 8071:8069 --name odoo3 --link db:db -t odoo\n```\n\nPlease note that for plain use of mails and reports functionalities, when the host and container ports differ (e.g. 8070 and 8069), one has to set, in Odoo, Settings->Parameters->System Parameters (requires technical features), web.base.url to the container port (e.g. 127.0.0.1:8069).\n\n## Environment Variables\n\nTweak these environment variables to easily connect to a postgres server:\n\n-\t`HOST`: The address of the postgres server. If you used a postgres container, set to the name of the container. Defaults to `db`.\n-\t`PORT`: The port the postgres server is listening to. Defaults to `5432`.\n-\t`USER`: The postgres role with which Odoo will connect. If you used a postgres container, set to the same value as `POSTGRES_USER`. Defaults to `odoo`.\n-\t`PASSWORD`: The password of the postgres role with which Odoo will connect. If you used a postgres container, set to the same value as `POSTGRES_PASSWORD`. Defaults to `odoo`.\n\n## Docker Compose examples\n\nThe simplest `docker-compose.yml` file would be:\n\n```yml\nversion: '2'\nservices:\n web:\n image: odoo:12.0\n depends_on:\n - db\n ports:\n - \"8069:8069\"\n db:\n image: postgres:10\n environment:\n - POSTGRES_DB=postgres\n - POSTGRES_PASSWORD=odoo\n - POSTGRES_USER=odoo\n```\n\nIf the default postgres credentials does not suit you, tweak the environment variables:\n\n```yml\nversion: '2'\nservices:\n web:\n image: odoo:12.0\n depends_on:\n - mydb\n ports:\n - \"8069:8069\"\n environment:\n - HOST=mydb\n - USER=odoo\n - PASSWORD=myodoo\n mydb:\n image: postgres:10\n environment:\n - POSTGRES_DB=postgres\n - POSTGRES_PASSWORD=myodoo\n - POSTGRES_USER=odoo\n```\n\nHere's a last example showing you how to mount custom addons, how to use a custom configuration file and how to use volumes for the Odoo and postgres data dir:\n\n```yml\nversion: '2'\nservices:\n web:\n image: odoo:12.0\n depends_on:\n - db\n ports:\n - \"8069:8069\"\n volumes:\n - odoo-web-data:/var/lib/odoo\n - ./config:/etc/odoo\n - ./addons:/mnt/extra-addons\n db:\n image: postgres:10\n environment:\n - POSTGRES_DB=postgres\n - POSTGRES_PASSWORD=odoo\n - POSTGRES_USER=odoo\n - PGDATA=/var/lib/postgresql/data/pgdata\n volumes:\n - odoo-db-data:/var/lib/postgresql/data/pgdata\nvolumes:\n odoo-web-data:\n odoo-db-data:\n```\n\nTo start your Odoo instance, go in the directory of the `docker-compose.yml` file you created from the previous examples and type:\n\n```console\ndocker-compose up -d\n```\n\n# How to upgrade this image\n\nOdoo images are updated on a regular basis to make them use recent releases (a new release of each version of Odoo is built [every night](http://nightly.odoo.com/)). Please be aware that what follows is about upgrading from an old release to the latest one provided of the same major version, as upgrading from a major version to another is a much more complex process requiring elaborated migration scripts (see [Odoo Enterprise Upgrade page](https://upgrade.odoo.com/database/upload) or this [community project](https://doc.therp.nl/openupgrade/) which aims to write those scripts).\n\nSuppose you created a database from an Odoo instance named old-odoo, and you want to access this database from a new Odoo instance named new-odoo, e.g. because you've just downloaded a newer Odoo image.\n\nBy default, Odoo 12.0 uses a filestore (located at /var/lib/odoo/filestore/) for attachments. You should restore this filestore in your new Odoo instance by running\n\n```console\n$ docker run --volumes-from old-odoo -p 8070:8069 --name new-odoo --link db:db -t odoo\n```\n\nYou can also simply prevent Odoo from using the filestore by setting the system parameter `ir_attachment.location` to `db-storage` in Settings->Parameters->System Parameters (requires technical features).\n\n# License\n\nView [license information](https://raw.githubusercontent.com/odoo/odoo/12.0/LICENSE) for the software contained in this image.\n\nAs with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).\n\nSome additional license information which was able to be auto-detected might be found in [the `repo-info` repository's `odoo/` directory](https://github.com/docker-library/repo-info/tree/master/repos/odoo).\n\nAs for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.\n"} {"text": "global.document= window.document;\nglobal.navigator= window.navigator;\nvar $ = require('jquery');\nvar React = require('react');\n\n// REACT CLASSES\nvar BoxViewer = React.createClass({displayName: \"BoxViewer\",\n\tgetInitialState:function(){\n\t\treturn {data:[]};\n\t},\n\trender:function(){\n\t\treturn (\n\t\t\tReact.createElement(\"div\", {className: \"message_list\"}, \n\t\t\tReact.createElement(List, {data: this.props.data})\n\t\t\t)\n\t\t);\n\t}\n});\n\nvar List = React.createClass({displayName: \"List\",\n\trender: function(){\n\t\tconsole.log(this.props.data);\n\t\tvar message_group_nodes = this.props.data.map(function(group_data){\n\t\t\treturn (\n\t\t\t\tReact.createElement(MessageGroup, {data: group_data})\n\t\t\t);\n\t\t});\n\t\treturn (\n\t\t\tReact.createElement(\"div\", {className: \"message_list\"}, \n\t\t\tmessage_group_nodes\n\t\t\t)\n\t\t);\n\t}\n});\n\nvar MessageGroup = React.createClass({displayName: \"MessageGroup\",\n\trender: function(){\n\t\tvar message_nodes = this.props.data.messages.map(function(message_data){\n\t\t\treturn (\n\t\t\t\tReact.createElement(Message, {data: message_data})\n\t\t\t);\n\t\t});\n\t\treturn (\n\t\t\tReact.createElement(\"div\", {className: \"message_group\"}, \n\t\t\t\tReact.createElement(\"div\", {className: \"message_group_title\"}, \n\t\t\t\t\tReact.createElement(\"span\", {className: \"triangle\"}, \"▼\"), \" \", \n\t\t\t\t\tReact.createElement(\"span\", {className: \"date_string\"}, this.props.data.id)\n\t\t\t\t), \n\t\t\t\tmessage_nodes\n\t\t\t)\n\t\t);\n\t}\n});\n\nvar Message = React.createClass({displayName: \"Message\",\n\trender: function(){\n\t\tvar mail_obj = this.props.data;\n\t\tif(!mail_obj.from){\n\t\t\treturn (\n\t\t\t\tReact.createElement(\"div\", {className: \"message\"})\n\t\t\t);\n\t\t}\n\t\tvar from = parseName(mail_obj.from);\n\t\tvar subject = mail_obj.headers.subject;\n\t\tvar preview_text = getPreviewText(mail_obj);\n\t\tvar mailbox = mail_obj.mailbox;\n\t\tvar unread = mail_obj.flags.indexOf('\\\\Seen')===-1;\n\t\treturn (\n\t\t\tReact.createElement(\"div\", {className: \"message\", \"data-mailbox\": mail_obj.mailbox, \"data-uid\": mail_obj.uid}, \n\t\t\t\tReact.createElement(\"div\", {className: \"from\"}, from), \n\t\t\t\tReact.createElement(\"div\", {className: \"subject\"}, subject), \n\t\t\t\tReact.createElement(\"div\", {className: \"text_preview\"}, preview_text)\n\t\t\t)\n\t\t);\n\t}\n});\n\nfunction MailboxView(container, conf){\n\tvar self = this;\n\tthis.container = container;\n\tthis.container\n\t\t.on('click', '.message', function(){\n\t\t\tif(conf.onSelection){\n\t\t\t\tconf.onSelection($(this).data('mailbox'), $(this).data('uid'));\n\t\t\t\tcontainer.find('.selected').removeClass('selected');\n\t\t\t\t$(this).addClass('selected');\n\t\t\t\tself.selected_email = $(this);\n\t\t\t}\n\t\t})\n\t\t.on('click', '.message_group_title', function(){\n\t\t\tif($(this).hasClass('collapsed')){\n\t\t\t\t$(this)\n\t\t\t\t\t.removeClass('collapsed')\n\t\t\t\t\t.siblings()\n\t\t\t\t\t\t.show()\n\t\t\t\t\t\t.end()\n\t\t\t\t\t.find('.triangle')\n\t\t\t\t\t\t.html('▼')\n\t\t\t\t\t\t.end();\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(this)\n\t\t\t\t\t.addClass('collapsed')\n\t\t\t\t\t.siblings()\n\t\t\t\t\t\t.hide()\n\t\t\t\t\t\t.end()\n\t\t\t\t\t.find('.triangle')\n\t\t\t\t\t\t.html('▶')\n\t\t\t\t\t\t.end();\n\t\t\t\t}\n\t\t});\n}\nMailboxView.prototype = {\n\trender:function(groups){\n\t\tReact.render(React.createElement(BoxViewer, {data: groups}), this.container[0]);\n\t},\n\treflectMessages: function(messages){\n\t\tvar self = this;\n\t\tvar groups = (function(){\n\t\t\tvar out = [];\n\t\t\tvar groups_added = {};\n\t\t\tvar group_index = -1;\n\t\t\tmessages.forEach(function(mail_obj){\n\t\t\t\tvar group_id = (function(){\n\t\t\t\t\tif(mail_obj.mailbox.substring(0, 'SlateMail/scheduled/'.length) === 'SlateMail/scheduled/'){\n\t\t\t\t\t\treturn 'Past Due';\n\t\t\t\t\t}\n\t\t\t\t\treturn self.getDateString(mail_obj.date);\n\t\t\t\t}());\n\t\t\t\tif(!(group_id in groups_added)){\n\t\t\t\t\tout.push({\n\t\t\t\t\t\tid: group_id,\n\t\t\t\t\t\tmessages: []\n\t\t\t\t\t});\n\t\t\t\t\tgroups_added[group_id] = true;\n\t\t\t\t\tgroup_index++;\n\t\t\t\t}\n\t\t\t\tout[group_index].messages.push(mail_obj);\n\t\t\t});\n\t\t\treturn out;\n\t\t}());\n\t\tthis.render(groups);\n\t},\n\tgetDateString:function(date){\n\t\tvar today = new Date();\n\t\tvar days_diff = Math.abs(Math.round(daysDiff(today, date)));\n\t\tvar days_of_week = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'];\n\t\tif(days_diff===0){\n\t\t\treturn 'today';\n\t\t}\n\t\tif(days_diff===1){\n\t\t\treturn 'yestersday';\n\t\t}\n\t\tif(days_diff>=2 && days_diff < 7){\n\t\t\treturn days_of_week[date.getDay()];\n\t\t}\n\t\tif(days_diff >= 7 && days_diff < 14){\n\t\t\treturn 'One week ago';\n\t\t}\n\t\tif(days_diff >= 14){\n\t\t\treturn 'Two weeks ago +';\n\t\t}\n\t\tif(days_diff >= 30){\n\t\t\treturn 'One month ago';\n\t\t}\n\t\tif(days_diff >= 60){\n\t\t\treturn 'Two months ago';\n\t\t}\n\t\tif(days_diff >= 90){\n\t\t\treturn 'Three months ago';\n\t\t}\n\t\tif(days_diff >= 360){\n\t\t\treturn 'One year ago';\n\t\t}\n\t\treturn false;\n\n\t\tfunction daysDiff(first, second) {\n\t\t\treturn (second-first)/(1000*60*60*24);\n\t\t}\n\t\treturn false;\n\t}\n};\n\nfunction getPreviewText(mail_object){\n\t/**\n\t * Return the preview text of a mail object. The preview text is a slice of\n\t * the email's message text.\n\t * @param {object} mail_object\n\t */\n\tif(mail_object.text){\n\t\treturn mail_object.text.replace(/[\\n\\r]/g, ' ').slice(0,125);\n\t}\n\tif(mail_object.html){\n\t\treturn mail_object.html.replace(/<[^>]*>/g, '').replace(/[\\n\\r]/g, '').trim().slice(0,125);\n\t}\n\treturn false;\n}\n\nfunction parseName(from_header){\n\tconsole.log('parsing name');\n\tif(!from_header || from_header.length === 0){\n\t\treturn '';\n\t}\n\tif(from_header[0].name){\n\t\ts = from_header[0].name;\n\t\ts = s.replace(/\"/g,\"\");\n\t\ts = s.split(',');\n\t\tif(s.length>1){\n\t\t\ts.reverse();\n\t\t\treturn s.join(' ');\n\t\t}\n\t\telse{\n\t\t\treturn s;\n\t\t}\n\t}\n\telse{\n\t\treturn from_header[0].address;\n\t}\n\treturn '';\n}\n\nmodule.exports = MailboxView;\n"} {"text": "// Copyright 2014 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 prometheus\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\n\t\"github.com/prometheus/common/model\"\n)\n\n// MetricVec is a Collector to bundle metrics of the same name that\n// differ in their label values. MetricVec is usually not used directly but as a\n// building block for implementations of vectors of a given metric\n// type. GaugeVec, CounterVec, SummaryVec, and UntypedVec are examples already\n// provided in this package.\ntype MetricVec struct {\n\tmtx sync.RWMutex // Protects the children.\n\tchildren map[uint64][]metricWithLabelValues\n\tdesc *Desc\n\n\tnewMetric func(labelValues ...string) Metric\n\thashAdd func(h uint64, s string) uint64 // replace hash function for testing collision handling\n\thashAddByte func(h uint64, b byte) uint64\n}\n\n// newMetricVec returns an initialized MetricVec. The concrete value is\n// returned for embedding into another struct.\nfunc newMetricVec(desc *Desc, newMetric func(lvs ...string) Metric) *MetricVec {\n\treturn &MetricVec{\n\t\tchildren: map[uint64][]metricWithLabelValues{},\n\t\tdesc: desc,\n\t\tnewMetric: newMetric,\n\t\thashAdd: hashAdd,\n\t\thashAddByte: hashAddByte,\n\t}\n}\n\n// metricWithLabelValues provides the metric and its label values for\n// disambiguation on hash collision.\ntype metricWithLabelValues struct {\n\tvalues []string\n\tmetric Metric\n}\n\n// Describe implements Collector. The length of the returned slice\n// is always one.\nfunc (m *MetricVec) Describe(ch chan<- *Desc) {\n\tch <- m.desc\n}\n\n// Collect implements Collector.\nfunc (m *MetricVec) Collect(ch chan<- Metric) {\n\tm.mtx.RLock()\n\tdefer m.mtx.RUnlock()\n\n\tfor _, metrics := range m.children {\n\t\tfor _, metric := range metrics {\n\t\t\tch <- metric.metric\n\t\t}\n\t}\n}\n\n// GetMetricWithLabelValues returns the Metric for the given slice of label\n// values (same order as the VariableLabels in Desc). If that combination of\n// label values is accessed for the first time, a new Metric is created.\n//\n// It is possible to call this method without using the returned Metric to only\n// create the new Metric but leave it at its start value (e.g. a Summary or\n// Histogram without any observations). See also the SummaryVec example.\n//\n// Keeping the Metric for later use is possible (and should be considered if\n// performance is critical), but keep in mind that Reset, DeleteLabelValues and\n// Delete can be used to delete the Metric from the MetricVec. In that case, the\n// Metric will still exist, but it will not be exported anymore, even if a\n// Metric with the same label values is created later. See also the CounterVec\n// example.\n//\n// An error is returned if the number of label values is not the same as the\n// number of VariableLabels in Desc.\n//\n// Note that for more than one label value, this method is prone to mistakes\n// caused by an incorrect order of arguments. Consider GetMetricWith(Labels) as\n// an alternative to avoid that type of mistake. For higher label numbers, the\n// latter has a much more readable (albeit more verbose) syntax, but it comes\n// with a performance overhead (for creating and processing the Labels map).\n// See also the GaugeVec example.\nfunc (m *MetricVec) GetMetricWithLabelValues(lvs ...string) (Metric, error) {\n\th, err := m.hashLabelValues(lvs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m.getOrCreateMetricWithLabelValues(h, lvs), nil\n}\n\n// GetMetricWith returns the Metric for the given Labels map (the label names\n// must match those of the VariableLabels in Desc). If that label map is\n// accessed for the first time, a new Metric is created. Implications of\n// creating a Metric without using it and keeping the Metric for later use are\n// the same as for GetMetricWithLabelValues.\n//\n// An error is returned if the number and names of the Labels are inconsistent\n// with those of the VariableLabels in Desc.\n//\n// This method is used for the same purpose as\n// GetMetricWithLabelValues(...string). See there for pros and cons of the two\n// methods.\nfunc (m *MetricVec) GetMetricWith(labels Labels) (Metric, error) {\n\th, err := m.hashLabels(labels)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m.getOrCreateMetricWithLabels(h, labels), nil\n}\n\n// WithLabelValues works as GetMetricWithLabelValues, but panics if an error\n// occurs. The method allows neat syntax like:\n// httpReqs.WithLabelValues(\"404\", \"POST\").Inc()\nfunc (m *MetricVec) WithLabelValues(lvs ...string) Metric {\n\tmetric, err := m.GetMetricWithLabelValues(lvs...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn metric\n}\n\n// With works as GetMetricWith, but panics if an error occurs. The method allows\n// neat syntax like:\n// httpReqs.With(Labels{\"status\":\"404\", \"method\":\"POST\"}).Inc()\nfunc (m *MetricVec) With(labels Labels) Metric {\n\tmetric, err := m.GetMetricWith(labels)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn metric\n}\n\n// DeleteLabelValues removes the metric where the variable labels are the same\n// as those passed in as labels (same order as the VariableLabels in Desc). It\n// returns true if a metric was deleted.\n//\n// It is not an error if the number of label values is not the same as the\n// number of VariableLabels in Desc. However, such inconsistent label count can\n// never match an actual Metric, so the method will always return false in that\n// case.\n//\n// Note that for more than one label value, this method is prone to mistakes\n// caused by an incorrect order of arguments. Consider Delete(Labels) as an\n// alternative to avoid that type of mistake. For higher label numbers, the\n// latter has a much more readable (albeit more verbose) syntax, but it comes\n// with a performance overhead (for creating and processing the Labels map).\n// See also the CounterVec example.\nfunc (m *MetricVec) DeleteLabelValues(lvs ...string) bool {\n\tm.mtx.Lock()\n\tdefer m.mtx.Unlock()\n\n\th, err := m.hashLabelValues(lvs)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn m.deleteByHashWithLabelValues(h, lvs)\n}\n\n// Delete deletes the metric where the variable labels are the same as those\n// passed in as labels. It returns true if a metric was deleted.\n//\n// It is not an error if the number and names of the Labels are inconsistent\n// with those of the VariableLabels in the Desc of the MetricVec. However, such\n// inconsistent Labels can never match an actual Metric, so the method will\n// always return false in that case.\n//\n// This method is used for the same purpose as DeleteLabelValues(...string). See\n// there for pros and cons of the two methods.\nfunc (m *MetricVec) Delete(labels Labels) bool {\n\tm.mtx.Lock()\n\tdefer m.mtx.Unlock()\n\n\th, err := m.hashLabels(labels)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\treturn m.deleteByHashWithLabels(h, labels)\n}\n\n// deleteByHashWithLabelValues removes the metric from the hash bucket h. If\n// there are multiple matches in the bucket, use lvs to select a metric and\n// remove only that metric.\nfunc (m *MetricVec) deleteByHashWithLabelValues(h uint64, lvs []string) bool {\n\tmetrics, ok := m.children[h]\n\tif !ok {\n\t\treturn false\n\t}\n\n\ti := m.findMetricWithLabelValues(metrics, lvs)\n\tif i >= len(metrics) {\n\t\treturn false\n\t}\n\n\tif len(metrics) > 1 {\n\t\tm.children[h] = append(metrics[:i], metrics[i+1:]...)\n\t} else {\n\t\tdelete(m.children, h)\n\t}\n\treturn true\n}\n\n// deleteByHashWithLabels removes the metric from the hash bucket h. If there\n// are multiple matches in the bucket, use lvs to select a metric and remove\n// only that metric.\nfunc (m *MetricVec) deleteByHashWithLabels(h uint64, labels Labels) bool {\n\tmetrics, ok := m.children[h]\n\tif !ok {\n\t\treturn false\n\t}\n\ti := m.findMetricWithLabels(metrics, labels)\n\tif i >= len(metrics) {\n\t\treturn false\n\t}\n\n\tif len(metrics) > 1 {\n\t\tm.children[h] = append(metrics[:i], metrics[i+1:]...)\n\t} else {\n\t\tdelete(m.children, h)\n\t}\n\treturn true\n}\n\n// Reset deletes all metrics in this vector.\nfunc (m *MetricVec) Reset() {\n\tm.mtx.Lock()\n\tdefer m.mtx.Unlock()\n\n\tfor h := range m.children {\n\t\tdelete(m.children, h)\n\t}\n}\n\nfunc (m *MetricVec) hashLabelValues(vals []string) (uint64, error) {\n\tif len(vals) != len(m.desc.variableLabels) {\n\t\treturn 0, errInconsistentCardinality\n\t}\n\th := hashNew()\n\tfor _, val := range vals {\n\t\th = m.hashAdd(h, val)\n\t\th = m.hashAddByte(h, model.SeparatorByte)\n\t}\n\treturn h, nil\n}\n\nfunc (m *MetricVec) hashLabels(labels Labels) (uint64, error) {\n\tif len(labels) != len(m.desc.variableLabels) {\n\t\treturn 0, errInconsistentCardinality\n\t}\n\th := hashNew()\n\tfor _, label := range m.desc.variableLabels {\n\t\tval, ok := labels[label]\n\t\tif !ok {\n\t\t\treturn 0, fmt.Errorf(\"label name %q missing in label map\", label)\n\t\t}\n\t\th = m.hashAdd(h, val)\n\t\th = m.hashAddByte(h, model.SeparatorByte)\n\t}\n\treturn h, nil\n}\n\n// getOrCreateMetricWithLabelValues retrieves the metric by hash and label value\n// or creates it and returns the new one.\n//\n// This function holds the mutex.\nfunc (m *MetricVec) getOrCreateMetricWithLabelValues(hash uint64, lvs []string) Metric {\n\tm.mtx.RLock()\n\tmetric, ok := m.getMetricWithLabelValues(hash, lvs)\n\tm.mtx.RUnlock()\n\tif ok {\n\t\treturn metric\n\t}\n\n\tm.mtx.Lock()\n\tdefer m.mtx.Unlock()\n\tmetric, ok = m.getMetricWithLabelValues(hash, lvs)\n\tif !ok {\n\t\t// Copy to avoid allocation in case wo don't go down this code path.\n\t\tcopiedLVs := make([]string, len(lvs))\n\t\tcopy(copiedLVs, lvs)\n\t\tmetric = m.newMetric(copiedLVs...)\n\t\tm.children[hash] = append(m.children[hash], metricWithLabelValues{values: copiedLVs, metric: metric})\n\t}\n\treturn metric\n}\n\n// getOrCreateMetricWithLabelValues retrieves the metric by hash and label value\n// or creates it and returns the new one.\n//\n// This function holds the mutex.\nfunc (m *MetricVec) getOrCreateMetricWithLabels(hash uint64, labels Labels) Metric {\n\tm.mtx.RLock()\n\tmetric, ok := m.getMetricWithLabels(hash, labels)\n\tm.mtx.RUnlock()\n\tif ok {\n\t\treturn metric\n\t}\n\n\tm.mtx.Lock()\n\tdefer m.mtx.Unlock()\n\tmetric, ok = m.getMetricWithLabels(hash, labels)\n\tif !ok {\n\t\tlvs := m.extractLabelValues(labels)\n\t\tmetric = m.newMetric(lvs...)\n\t\tm.children[hash] = append(m.children[hash], metricWithLabelValues{values: lvs, metric: metric})\n\t}\n\treturn metric\n}\n\n// getMetricWithLabelValues gets a metric while handling possible collisions in\n// the hash space. Must be called while holding read mutex.\nfunc (m *MetricVec) getMetricWithLabelValues(h uint64, lvs []string) (Metric, bool) {\n\tmetrics, ok := m.children[h]\n\tif ok {\n\t\tif i := m.findMetricWithLabelValues(metrics, lvs); i < len(metrics) {\n\t\t\treturn metrics[i].metric, true\n\t\t}\n\t}\n\treturn nil, false\n}\n\n// getMetricWithLabels gets a metric while handling possible collisions in\n// the hash space. Must be called while holding read mutex.\nfunc (m *MetricVec) getMetricWithLabels(h uint64, labels Labels) (Metric, bool) {\n\tmetrics, ok := m.children[h]\n\tif ok {\n\t\tif i := m.findMetricWithLabels(metrics, labels); i < len(metrics) {\n\t\t\treturn metrics[i].metric, true\n\t\t}\n\t}\n\treturn nil, false\n}\n\n// findMetricWithLabelValues returns the index of the matching metric or\n// len(metrics) if not found.\nfunc (m *MetricVec) findMetricWithLabelValues(metrics []metricWithLabelValues, lvs []string) int {\n\tfor i, metric := range metrics {\n\t\tif m.matchLabelValues(metric.values, lvs) {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn len(metrics)\n}\n\n// findMetricWithLabels returns the index of the matching metric or len(metrics)\n// if not found.\nfunc (m *MetricVec) findMetricWithLabels(metrics []metricWithLabelValues, labels Labels) int {\n\tfor i, metric := range metrics {\n\t\tif m.matchLabels(metric.values, labels) {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn len(metrics)\n}\n\nfunc (m *MetricVec) matchLabelValues(values []string, lvs []string) bool {\n\tif len(values) != len(lvs) {\n\t\treturn false\n\t}\n\tfor i, v := range values {\n\t\tif v != lvs[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (m *MetricVec) matchLabels(values []string, labels Labels) bool {\n\tif len(labels) != len(values) {\n\t\treturn false\n\t}\n\tfor i, k := range m.desc.variableLabels {\n\t\tif values[i] != labels[k] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (m *MetricVec) extractLabelValues(labels Labels) []string {\n\tlabelValues := make([]string, len(labels))\n\tfor i, k := range m.desc.variableLabels {\n\t\tlabelValues[i] = labels[k]\n\t}\n\treturn labelValues\n}\n"} {"text": "//\n// ReactiveCocoaTests.m\n// ReactiveCocoaTests\n//\n// Created by Mr.Wang on 16/4/19.\n// Copyright © 2016年 Mr.wang. All rights reserved.\n//\n\n#import \n\n@interface ReactiveCocoaTests : XCTestCase\n\n@end\n\n@implementation ReactiveCocoaTests\n\n- (void)setUp {\n [super setUp];\n // Put setup code here. This method is called before the invocation of each test method in the class.\n}\n\n- (void)tearDown {\n // Put teardown code here. This method is called after the invocation of each test method in the class.\n [super tearDown];\n}\n\n- (void)testExample {\n // This is an example of a functional test case.\n // Use XCTAssert and related functions to verify your tests produce the correct results.\n}\n\n- (void)testPerformanceExample {\n // This is an example of a performance test case.\n [self measureBlock:^{\n // Put the code you want to measure the time of here.\n }];\n}\n\n@end\n"} {"text": "\n\n\n Simple Example\n \n \n \n \n\n\n\n
\n
\n
\n
\n

Lorem

\n

\n Proin eget tortor risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Nulla porttitor accumsan tincidunt. Lorem ipsum dolor sit amet,\n consectetur adipiscing elit. Vivamus suscipit tortor eget felis porttitor volutpat. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Vestibulum ante ipsum\n primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit\n neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a.\n

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

Ipsum

\n

\n Donec sollicitudin molestie malesuada. Sed porttitor lectus nibh. Nulla porttitor accumsan tincidunt. Curabitur aliquet quam id dui posuere blandit. Donec rutrum congue leo eget malesuada. Nulla porttitor accumsan tincidunt. Donec rutrum congue leo eget\n malesuada. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Vivamus suscipit tortor eget felis porttitor volutpat. Cras ultricies ligula sed magna dictum porta.\n

\n

\n Donec rutrum congue leo eget malesuada. Curabitur aliquet quam id dui posuere blandit. Nulla quis lorem ut libero malesuada feugiat. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices\n posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Sed porttitor lectus nibh. Sed porttitor lectus nibh. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Quisque velit nisi, pretium\n ut lacinia in, elementum id enim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula.\n

\n
\n
\n
\n
\n

Toffee ipsum

\n

\n Proin eget tortor risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Nulla porttitor accumsan tincidunt. Lorem ipsum dolor sit amet,\n consectetur adipiscing elit. Vivamus suscipit tortor eget felis porttitor volutpat. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Vestibulum ante ipsum\n primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit\n neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a.\n

\n

\n Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Pellentesque in ipsum id orci porta dapibus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec rutrum congue leo eget malesuada. Lorem ipsum dolor sit amet, consectetur adipiscing\n elit. Pellentesque in ipsum id orci porta dapibus. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Nulla quis lorem ut libero malesuada feugiat. Pellentesque in ipsum id orci porta dapibus.\n

\n

\n Donec rutrum congue leo eget malesuada. Curabitur aliquet quam id dui posuere blandit. Nulla quis lorem ut libero malesuada feugiat. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices\n posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Sed porttitor lectus nibh. Sed porttitor lectus nibh. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Quisque velit nisi, pretium\n ut lacinia in, elementum id enim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula.\n

\n
\n
\n
\n
\n
\n
Menu
\n
\n
\n
\n
Home
\n
About
\n
Terms
\n
Contact
\n \n
\n
\n
\n
\n\n \n \n\n\n\n"} {"text": "# Sink.last\n\nMaterializes into a @scala[`Future`] @java[`CompletionStage`] which will complete with the last value emitted when the stream completes.\n\n@ref[Sink operators](../index.md#sink-operators)\n\n## Signature\n\n@apidoc[Sink.last](Sink$) { scala=\"#last[T]:akka.stream.scaladsl.Sink[T,scala.concurrent.Future[T]]\" java=\"#last()\" }\n\n\n## Description\n\nMaterializes into a @scala[`Future`] @java[`CompletionStage`] which will complete with the last value emitted when the stream\ncompletes. If the stream completes with no elements the @scala[`Future`] @java[`CompletionStage`] is failed.\n\n## Example\n\nScala\n: @@snip [LastSinkSpec.scala](/akka-stream-tests/src/test/scala/akka/stream/scaladsl/LastSinkSpec.scala) { #last-operator-example }\n\nJava\n: @@snip [SinkDocExamples.java](/akka-docs/src/test/java/jdocs/stream/operators/SinkDocExamples.java) { #last-operator-example }\n\n## Reactive Streams semantics\n\n@@@div { .callout }\n\n**cancels** never\n\n**backpressures** never\n\n@@@\n"} {"text": "/*\n * Huffman encoder, part of New Generation Entropy library\n * Copyright (C) 2013-2016, Yann Collet.\n *\n * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)\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 *\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 * This program is free software; you can redistribute it and/or modify it under\n * the terms of the GNU General Public License version 2 as published by the\n * Free Software Foundation. This program is dual-licensed; you may select\n * either version 2 of the GNU General Public License (\"GPL\") or BSD license\n * (\"BSD\").\n *\n * You can contact the author at :\n * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy\n */\n\n/* **************************************************************\n* Includes\n****************************************************************/\n#include \"bitstream.h\"\n#include \"fse.h\" /* header compression */\n#include \"huf.h\"\n#include \n#include /* memcpy, memset */\n\n/* **************************************************************\n* Error Management\n****************************************************************/\n#define HUF_STATIC_ASSERT(c) \\\n\t{ \\\n\t\tenum { HUF_static_assert = 1 / (int)(!!(c)) }; \\\n\t} /* use only *after* variable declarations */\n#define CHECK_V_F(e, f) \\\n\tsize_t const e = f; \\\n\tif (ERR_isError(e)) \\\n\treturn f\n#define CHECK_F(f) \\\n\t{ \\\n\t\tCHECK_V_F(_var_err__, f); \\\n\t}\n\n/* **************************************************************\n* Utils\n****************************************************************/\nunsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue)\n{\n\treturn FSE_optimalTableLog_internal(maxTableLog, srcSize, maxSymbolValue, 1);\n}\n\n/* *******************************************************\n* HUF : Huffman block compression\n*********************************************************/\n/* HUF_compressWeights() :\n * Same as FSE_compress(), but dedicated to huff0's weights compression.\n * The use case needs much less stack memory.\n * Note : all elements within weightTable are supposed to be <= HUF_TABLELOG_MAX.\n */\n#define MAX_FSE_TABLELOG_FOR_HUFF_HEADER 6\nsize_t HUF_compressWeights_wksp(void *dst, size_t dstSize, const void *weightTable, size_t wtSize, void *workspace, size_t workspaceSize)\n{\n\tBYTE *const ostart = (BYTE *)dst;\n\tBYTE *op = ostart;\n\tBYTE *const oend = ostart + dstSize;\n\n\tU32 maxSymbolValue = HUF_TABLELOG_MAX;\n\tU32 tableLog = MAX_FSE_TABLELOG_FOR_HUFF_HEADER;\n\n\tFSE_CTable *CTable;\n\tU32 *count;\n\tS16 *norm;\n\tsize_t spaceUsed32 = 0;\n\n\tHUF_STATIC_ASSERT(sizeof(FSE_CTable) == sizeof(U32));\n\n\tCTable = (FSE_CTable *)((U32 *)workspace + spaceUsed32);\n\tspaceUsed32 += FSE_CTABLE_SIZE_U32(MAX_FSE_TABLELOG_FOR_HUFF_HEADER, HUF_TABLELOG_MAX);\n\tcount = (U32 *)workspace + spaceUsed32;\n\tspaceUsed32 += HUF_TABLELOG_MAX + 1;\n\tnorm = (S16 *)((U32 *)workspace + spaceUsed32);\n\tspaceUsed32 += ALIGN(sizeof(S16) * (HUF_TABLELOG_MAX + 1), sizeof(U32)) >> 2;\n\n\tif ((spaceUsed32 << 2) > workspaceSize)\n\t\treturn ERROR(tableLog_tooLarge);\n\tworkspace = (U32 *)workspace + spaceUsed32;\n\tworkspaceSize -= (spaceUsed32 << 2);\n\n\t/* init conditions */\n\tif (wtSize <= 1)\n\t\treturn 0; /* Not compressible */\n\n\t/* Scan input and build symbol stats */\n\t{\n\t\tCHECK_V_F(maxCount, FSE_count_simple(count, &maxSymbolValue, weightTable, wtSize));\n\t\tif (maxCount == wtSize)\n\t\t\treturn 1; /* only a single symbol in src : rle */\n\t\tif (maxCount == 1)\n\t\t\treturn 0; /* each symbol present maximum once => not compressible */\n\t}\n\n\ttableLog = FSE_optimalTableLog(tableLog, wtSize, maxSymbolValue);\n\tCHECK_F(FSE_normalizeCount(norm, tableLog, count, wtSize, maxSymbolValue));\n\n\t/* Write table description header */\n\t{\n\t\tCHECK_V_F(hSize, FSE_writeNCount(op, oend - op, norm, maxSymbolValue, tableLog));\n\t\top += hSize;\n\t}\n\n\t/* Compress */\n\tCHECK_F(FSE_buildCTable_wksp(CTable, norm, maxSymbolValue, tableLog, workspace, workspaceSize));\n\t{\n\t\tCHECK_V_F(cSize, FSE_compress_usingCTable(op, oend - op, weightTable, wtSize, CTable));\n\t\tif (cSize == 0)\n\t\t\treturn 0; /* not enough space for compressed data */\n\t\top += cSize;\n\t}\n\n\treturn op - ostart;\n}\n\nstruct HUF_CElt_s {\n\tU16 val;\n\tBYTE nbBits;\n}; /* typedef'd to HUF_CElt within \"huf.h\" */\n\n/*! HUF_writeCTable_wksp() :\n\t`CTable` : Huffman tree to save, using huf representation.\n\t@return : size of saved CTable */\nsize_t HUF_writeCTable_wksp(void *dst, size_t maxDstSize, const HUF_CElt *CTable, U32 maxSymbolValue, U32 huffLog, void *workspace, size_t workspaceSize)\n{\n\tBYTE *op = (BYTE *)dst;\n\tU32 n;\n\n\tBYTE *bitsToWeight;\n\tBYTE *huffWeight;\n\tsize_t spaceUsed32 = 0;\n\n\tbitsToWeight = (BYTE *)((U32 *)workspace + spaceUsed32);\n\tspaceUsed32 += ALIGN(HUF_TABLELOG_MAX + 1, sizeof(U32)) >> 2;\n\thuffWeight = (BYTE *)((U32 *)workspace + spaceUsed32);\n\tspaceUsed32 += ALIGN(HUF_SYMBOLVALUE_MAX, sizeof(U32)) >> 2;\n\n\tif ((spaceUsed32 << 2) > workspaceSize)\n\t\treturn ERROR(tableLog_tooLarge);\n\tworkspace = (U32 *)workspace + spaceUsed32;\n\tworkspaceSize -= (spaceUsed32 << 2);\n\n\t/* check conditions */\n\tif (maxSymbolValue > HUF_SYMBOLVALUE_MAX)\n\t\treturn ERROR(maxSymbolValue_tooLarge);\n\n\t/* convert to weight */\n\tbitsToWeight[0] = 0;\n\tfor (n = 1; n < huffLog + 1; n++)\n\t\tbitsToWeight[n] = (BYTE)(huffLog + 1 - n);\n\tfor (n = 0; n < maxSymbolValue; n++)\n\t\thuffWeight[n] = bitsToWeight[CTable[n].nbBits];\n\n\t/* attempt weights compression by FSE */\n\t{\n\t\tCHECK_V_F(hSize, HUF_compressWeights_wksp(op + 1, maxDstSize - 1, huffWeight, maxSymbolValue, workspace, workspaceSize));\n\t\tif ((hSize > 1) & (hSize < maxSymbolValue / 2)) { /* FSE compressed */\n\t\t\top[0] = (BYTE)hSize;\n\t\t\treturn hSize + 1;\n\t\t}\n\t}\n\n\t/* write raw values as 4-bits (max : 15) */\n\tif (maxSymbolValue > (256 - 128))\n\t\treturn ERROR(GENERIC); /* should not happen : likely means source cannot be compressed */\n\tif (((maxSymbolValue + 1) / 2) + 1 > maxDstSize)\n\t\treturn ERROR(dstSize_tooSmall); /* not enough space within dst buffer */\n\top[0] = (BYTE)(128 /*special case*/ + (maxSymbolValue - 1));\n\thuffWeight[maxSymbolValue] = 0; /* to be sure it doesn't cause msan issue in final combination */\n\tfor (n = 0; n < maxSymbolValue; n += 2)\n\t\top[(n / 2) + 1] = (BYTE)((huffWeight[n] << 4) + huffWeight[n + 1]);\n\treturn ((maxSymbolValue + 1) / 2) + 1;\n}\n\nsize_t HUF_readCTable_wksp(HUF_CElt *CTable, U32 maxSymbolValue, const void *src, size_t srcSize, void *workspace, size_t workspaceSize)\n{\n\tU32 *rankVal;\n\tBYTE *huffWeight;\n\tU32 tableLog = 0;\n\tU32 nbSymbols = 0;\n\tsize_t readSize;\n\tsize_t spaceUsed32 = 0;\n\n\trankVal = (U32 *)workspace + spaceUsed32;\n\tspaceUsed32 += HUF_TABLELOG_ABSOLUTEMAX + 1;\n\thuffWeight = (BYTE *)((U32 *)workspace + spaceUsed32);\n\tspaceUsed32 += ALIGN(HUF_SYMBOLVALUE_MAX + 1, sizeof(U32)) >> 2;\n\n\tif ((spaceUsed32 << 2) > workspaceSize)\n\t\treturn ERROR(tableLog_tooLarge);\n\tworkspace = (U32 *)workspace + spaceUsed32;\n\tworkspaceSize -= (spaceUsed32 << 2);\n\n\t/* get symbol weights */\n\treadSize = HUF_readStats_wksp(huffWeight, HUF_SYMBOLVALUE_MAX + 1, rankVal, &nbSymbols, &tableLog, src, srcSize, workspace, workspaceSize);\n\tif (ERR_isError(readSize))\n\t\treturn readSize;\n\n\t/* check result */\n\tif (tableLog > HUF_TABLELOG_MAX)\n\t\treturn ERROR(tableLog_tooLarge);\n\tif (nbSymbols > maxSymbolValue + 1)\n\t\treturn ERROR(maxSymbolValue_tooSmall);\n\n\t/* Prepare base value per rank */\n\t{\n\t\tU32 n, nextRankStart = 0;\n\t\tfor (n = 1; n <= tableLog; n++) {\n\t\t\tU32 curr = nextRankStart;\n\t\t\tnextRankStart += (rankVal[n] << (n - 1));\n\t\t\trankVal[n] = curr;\n\t\t}\n\t}\n\n\t/* fill nbBits */\n\t{\n\t\tU32 n;\n\t\tfor (n = 0; n < nbSymbols; n++) {\n\t\t\tconst U32 w = huffWeight[n];\n\t\t\tCTable[n].nbBits = (BYTE)(tableLog + 1 - w);\n\t\t}\n\t}\n\n\t/* fill val */\n\t{\n\t\tU16 nbPerRank[HUF_TABLELOG_MAX + 2] = {0}; /* support w=0=>n=tableLog+1 */\n\t\tU16 valPerRank[HUF_TABLELOG_MAX + 2] = {0};\n\t\t{\n\t\t\tU32 n;\n\t\t\tfor (n = 0; n < nbSymbols; n++)\n\t\t\t\tnbPerRank[CTable[n].nbBits]++;\n\t\t}\n\t\t/* determine stating value per rank */\n\t\tvalPerRank[tableLog + 1] = 0; /* for w==0 */\n\t\t{\n\t\t\tU16 min = 0;\n\t\t\tU32 n;\n\t\t\tfor (n = tableLog; n > 0; n--) { /* start at n=tablelog <-> w=1 */\n\t\t\t\tvalPerRank[n] = min; /* get starting value within each rank */\n\t\t\t\tmin += nbPerRank[n];\n\t\t\t\tmin >>= 1;\n\t\t\t}\n\t\t}\n\t\t/* assign value within rank, symbol order */\n\t\t{\n\t\t\tU32 n;\n\t\t\tfor (n = 0; n <= maxSymbolValue; n++)\n\t\t\t\tCTable[n].val = valPerRank[CTable[n].nbBits]++;\n\t\t}\n\t}\n\n\treturn readSize;\n}\n\ntypedef struct nodeElt_s {\n\tU32 count;\n\tU16 parent;\n\tBYTE byte;\n\tBYTE nbBits;\n} nodeElt;\n\nstatic U32 HUF_setMaxHeight(nodeElt *huffNode, U32 lastNonNull, U32 maxNbBits)\n{\n\tconst U32 largestBits = huffNode[lastNonNull].nbBits;\n\tif (largestBits <= maxNbBits)\n\t\treturn largestBits; /* early exit : no elt > maxNbBits */\n\n\t/* there are several too large elements (at least >= 2) */\n\t{\n\t\tint totalCost = 0;\n\t\tconst U32 baseCost = 1 << (largestBits - maxNbBits);\n\t\tU32 n = lastNonNull;\n\n\t\twhile (huffNode[n].nbBits > maxNbBits) {\n\t\t\ttotalCost += baseCost - (1 << (largestBits - huffNode[n].nbBits));\n\t\t\thuffNode[n].nbBits = (BYTE)maxNbBits;\n\t\t\tn--;\n\t\t} /* n stops at huffNode[n].nbBits <= maxNbBits */\n\t\twhile (huffNode[n].nbBits == maxNbBits)\n\t\t\tn--; /* n end at index of smallest symbol using < maxNbBits */\n\n\t\t/* renorm totalCost */\n\t\ttotalCost >>= (largestBits - maxNbBits); /* note : totalCost is necessarily a multiple of baseCost */\n\n\t\t/* repay normalized cost */\n\t\t{\n\t\t\tU32 const noSymbol = 0xF0F0F0F0;\n\t\t\tU32 rankLast[HUF_TABLELOG_MAX + 2];\n\t\t\tint pos;\n\n\t\t\t/* Get pos of last (smallest) symbol per rank */\n\t\t\tmemset(rankLast, 0xF0, sizeof(rankLast));\n\t\t\t{\n\t\t\t\tU32 currNbBits = maxNbBits;\n\t\t\t\tfor (pos = n; pos >= 0; pos--) {\n\t\t\t\t\tif (huffNode[pos].nbBits >= currNbBits)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcurrNbBits = huffNode[pos].nbBits; /* < maxNbBits */\n\t\t\t\t\trankLast[maxNbBits - currNbBits] = pos;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (totalCost > 0) {\n\t\t\t\tU32 nBitsToDecrease = BIT_highbit32(totalCost) + 1;\n\t\t\t\tfor (; nBitsToDecrease > 1; nBitsToDecrease--) {\n\t\t\t\t\tU32 highPos = rankLast[nBitsToDecrease];\n\t\t\t\t\tU32 lowPos = rankLast[nBitsToDecrease - 1];\n\t\t\t\t\tif (highPos == noSymbol)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (lowPos == noSymbol)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t{\n\t\t\t\t\t\tU32 const highTotal = huffNode[highPos].count;\n\t\t\t\t\t\tU32 const lowTotal = 2 * huffNode[lowPos].count;\n\t\t\t\t\t\tif (highTotal <= lowTotal)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/* only triggered when no more rank 1 symbol left => find closest one (note : there is necessarily at least one !) */\n\t\t\t\t/* HUF_MAX_TABLELOG test just to please gcc 5+; but it should not be necessary */\n\t\t\t\twhile ((nBitsToDecrease <= HUF_TABLELOG_MAX) && (rankLast[nBitsToDecrease] == noSymbol))\n\t\t\t\t\tnBitsToDecrease++;\n\t\t\t\ttotalCost -= 1 << (nBitsToDecrease - 1);\n\t\t\t\tif (rankLast[nBitsToDecrease - 1] == noSymbol)\n\t\t\t\t\trankLast[nBitsToDecrease - 1] = rankLast[nBitsToDecrease]; /* this rank is no longer empty */\n\t\t\t\thuffNode[rankLast[nBitsToDecrease]].nbBits++;\n\t\t\t\tif (rankLast[nBitsToDecrease] == 0) /* special case, reached largest symbol */\n\t\t\t\t\trankLast[nBitsToDecrease] = noSymbol;\n\t\t\t\telse {\n\t\t\t\t\trankLast[nBitsToDecrease]--;\n\t\t\t\t\tif (huffNode[rankLast[nBitsToDecrease]].nbBits != maxNbBits - nBitsToDecrease)\n\t\t\t\t\t\trankLast[nBitsToDecrease] = noSymbol; /* this rank is now empty */\n\t\t\t\t}\n\t\t\t} /* while (totalCost > 0) */\n\n\t\t\twhile (totalCost < 0) {\t\t /* Sometimes, cost correction overshoot */\n\t\t\t\tif (rankLast[1] == noSymbol) { /* special case : no rank 1 symbol (using maxNbBits-1); let's create one from largest rank 0\n\t\t\t\t\t\t\t\t (using maxNbBits) */\n\t\t\t\t\twhile (huffNode[n].nbBits == maxNbBits)\n\t\t\t\t\t\tn--;\n\t\t\t\t\thuffNode[n + 1].nbBits--;\n\t\t\t\t\trankLast[1] = n + 1;\n\t\t\t\t\ttotalCost++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\thuffNode[rankLast[1] + 1].nbBits--;\n\t\t\t\trankLast[1]++;\n\t\t\t\ttotalCost++;\n\t\t\t}\n\t\t}\n\t} /* there are several too large elements (at least >= 2) */\n\n\treturn maxNbBits;\n}\n\ntypedef struct {\n\tU32 base;\n\tU32 curr;\n} rankPos;\n\nstatic void HUF_sort(nodeElt *huffNode, const U32 *count, U32 maxSymbolValue)\n{\n\trankPos rank[32];\n\tU32 n;\n\n\tmemset(rank, 0, sizeof(rank));\n\tfor (n = 0; n <= maxSymbolValue; n++) {\n\t\tU32 r = BIT_highbit32(count[n] + 1);\n\t\trank[r].base++;\n\t}\n\tfor (n = 30; n > 0; n--)\n\t\trank[n - 1].base += rank[n].base;\n\tfor (n = 0; n < 32; n++)\n\t\trank[n].curr = rank[n].base;\n\tfor (n = 0; n <= maxSymbolValue; n++) {\n\t\tU32 const c = count[n];\n\t\tU32 const r = BIT_highbit32(c + 1) + 1;\n\t\tU32 pos = rank[r].curr++;\n\t\twhile ((pos > rank[r].base) && (c > huffNode[pos - 1].count))\n\t\t\thuffNode[pos] = huffNode[pos - 1], pos--;\n\t\thuffNode[pos].count = c;\n\t\thuffNode[pos].byte = (BYTE)n;\n\t}\n}\n\n/** HUF_buildCTable_wksp() :\n * Same as HUF_buildCTable(), but using externally allocated scratch buffer.\n * `workSpace` must be aligned on 4-bytes boundaries, and be at least as large as a table of 1024 unsigned.\n */\n#define STARTNODE (HUF_SYMBOLVALUE_MAX + 1)\ntypedef nodeElt huffNodeTable[2 * HUF_SYMBOLVALUE_MAX + 1 + 1];\nsize_t HUF_buildCTable_wksp(HUF_CElt *tree, const U32 *count, U32 maxSymbolValue, U32 maxNbBits, void *workSpace, size_t wkspSize)\n{\n\tnodeElt *const huffNode0 = (nodeElt *)workSpace;\n\tnodeElt *const huffNode = huffNode0 + 1;\n\tU32 n, nonNullRank;\n\tint lowS, lowN;\n\tU16 nodeNb = STARTNODE;\n\tU32 nodeRoot;\n\n\t/* safety checks */\n\tif (wkspSize < sizeof(huffNodeTable))\n\t\treturn ERROR(GENERIC); /* workSpace is not large enough */\n\tif (maxNbBits == 0)\n\t\tmaxNbBits = HUF_TABLELOG_DEFAULT;\n\tif (maxSymbolValue > HUF_SYMBOLVALUE_MAX)\n\t\treturn ERROR(GENERIC);\n\tmemset(huffNode0, 0, sizeof(huffNodeTable));\n\n\t/* sort, decreasing order */\n\tHUF_sort(huffNode, count, maxSymbolValue);\n\n\t/* init for parents */\n\tnonNullRank = maxSymbolValue;\n\twhile (huffNode[nonNullRank].count == 0)\n\t\tnonNullRank--;\n\tlowS = nonNullRank;\n\tnodeRoot = nodeNb + lowS - 1;\n\tlowN = nodeNb;\n\thuffNode[nodeNb].count = huffNode[lowS].count + huffNode[lowS - 1].count;\n\thuffNode[lowS].parent = huffNode[lowS - 1].parent = nodeNb;\n\tnodeNb++;\n\tlowS -= 2;\n\tfor (n = nodeNb; n <= nodeRoot; n++)\n\t\thuffNode[n].count = (U32)(1U << 30);\n\thuffNode0[0].count = (U32)(1U << 31); /* fake entry, strong barrier */\n\n\t/* create parents */\n\twhile (nodeNb <= nodeRoot) {\n\t\tU32 n1 = (huffNode[lowS].count < huffNode[lowN].count) ? lowS-- : lowN++;\n\t\tU32 n2 = (huffNode[lowS].count < huffNode[lowN].count) ? lowS-- : lowN++;\n\t\thuffNode[nodeNb].count = huffNode[n1].count + huffNode[n2].count;\n\t\thuffNode[n1].parent = huffNode[n2].parent = nodeNb;\n\t\tnodeNb++;\n\t}\n\n\t/* distribute weights (unlimited tree height) */\n\thuffNode[nodeRoot].nbBits = 0;\n\tfor (n = nodeRoot - 1; n >= STARTNODE; n--)\n\t\thuffNode[n].nbBits = huffNode[huffNode[n].parent].nbBits + 1;\n\tfor (n = 0; n <= nonNullRank; n++)\n\t\thuffNode[n].nbBits = huffNode[huffNode[n].parent].nbBits + 1;\n\n\t/* enforce maxTableLog */\n\tmaxNbBits = HUF_setMaxHeight(huffNode, nonNullRank, maxNbBits);\n\n\t/* fill result into tree (val, nbBits) */\n\t{\n\t\tU16 nbPerRank[HUF_TABLELOG_MAX + 1] = {0};\n\t\tU16 valPerRank[HUF_TABLELOG_MAX + 1] = {0};\n\t\tif (maxNbBits > HUF_TABLELOG_MAX)\n\t\t\treturn ERROR(GENERIC); /* check fit into table */\n\t\tfor (n = 0; n <= nonNullRank; n++)\n\t\t\tnbPerRank[huffNode[n].nbBits]++;\n\t\t/* determine stating value per rank */\n\t\t{\n\t\t\tU16 min = 0;\n\t\t\tfor (n = maxNbBits; n > 0; n--) {\n\t\t\t\tvalPerRank[n] = min; /* get starting value within each rank */\n\t\t\t\tmin += nbPerRank[n];\n\t\t\t\tmin >>= 1;\n\t\t\t}\n\t\t}\n\t\tfor (n = 0; n <= maxSymbolValue; n++)\n\t\t\ttree[huffNode[n].byte].nbBits = huffNode[n].nbBits; /* push nbBits per symbol, symbol order */\n\t\tfor (n = 0; n <= maxSymbolValue; n++)\n\t\t\ttree[n].val = valPerRank[tree[n].nbBits]++; /* assign value within rank, symbol order */\n\t}\n\n\treturn maxNbBits;\n}\n\nstatic size_t HUF_estimateCompressedSize(HUF_CElt *CTable, const unsigned *count, unsigned maxSymbolValue)\n{\n\tsize_t nbBits = 0;\n\tint s;\n\tfor (s = 0; s <= (int)maxSymbolValue; ++s) {\n\t\tnbBits += CTable[s].nbBits * count[s];\n\t}\n\treturn nbBits >> 3;\n}\n\nstatic int HUF_validateCTable(const HUF_CElt *CTable, const unsigned *count, unsigned maxSymbolValue)\n{\n\tint bad = 0;\n\tint s;\n\tfor (s = 0; s <= (int)maxSymbolValue; ++s) {\n\t\tbad |= (count[s] != 0) & (CTable[s].nbBits == 0);\n\t}\n\treturn !bad;\n}\n\nstatic void HUF_encodeSymbol(BIT_CStream_t *bitCPtr, U32 symbol, const HUF_CElt *CTable)\n{\n\tBIT_addBitsFast(bitCPtr, CTable[symbol].val, CTable[symbol].nbBits);\n}\n\nsize_t HUF_compressBound(size_t size) { return HUF_COMPRESSBOUND(size); }\n\n#define HUF_FLUSHBITS(s) BIT_flushBits(s)\n\n#define HUF_FLUSHBITS_1(stream) \\\n\tif (sizeof((stream)->bitContainer) * 8 < HUF_TABLELOG_MAX * 2 + 7) \\\n\tHUF_FLUSHBITS(stream)\n\n#define HUF_FLUSHBITS_2(stream) \\\n\tif (sizeof((stream)->bitContainer) * 8 < HUF_TABLELOG_MAX * 4 + 7) \\\n\tHUF_FLUSHBITS(stream)\n\nsize_t HUF_compress1X_usingCTable(void *dst, size_t dstSize, const void *src, size_t srcSize, const HUF_CElt *CTable)\n{\n\tconst BYTE *ip = (const BYTE *)src;\n\tBYTE *const ostart = (BYTE *)dst;\n\tBYTE *const oend = ostart + dstSize;\n\tBYTE *op = ostart;\n\tsize_t n;\n\tBIT_CStream_t bitC;\n\n\t/* init */\n\tif (dstSize < 8)\n\t\treturn 0; /* not enough space to compress */\n\t{\n\t\tsize_t const initErr = BIT_initCStream(&bitC, op, oend - op);\n\t\tif (HUF_isError(initErr))\n\t\t\treturn 0;\n\t}\n\n\tn = srcSize & ~3; /* join to mod 4 */\n\tswitch (srcSize & 3) {\n\tcase 3: HUF_encodeSymbol(&bitC, ip[n + 2], CTable); HUF_FLUSHBITS_2(&bitC);\n\tcase 2: HUF_encodeSymbol(&bitC, ip[n + 1], CTable); HUF_FLUSHBITS_1(&bitC);\n\tcase 1: HUF_encodeSymbol(&bitC, ip[n + 0], CTable); HUF_FLUSHBITS(&bitC);\n\tcase 0:\n\tdefault:;\n\t}\n\n\tfor (; n > 0; n -= 4) { /* note : n&3==0 at this stage */\n\t\tHUF_encodeSymbol(&bitC, ip[n - 1], CTable);\n\t\tHUF_FLUSHBITS_1(&bitC);\n\t\tHUF_encodeSymbol(&bitC, ip[n - 2], CTable);\n\t\tHUF_FLUSHBITS_2(&bitC);\n\t\tHUF_encodeSymbol(&bitC, ip[n - 3], CTable);\n\t\tHUF_FLUSHBITS_1(&bitC);\n\t\tHUF_encodeSymbol(&bitC, ip[n - 4], CTable);\n\t\tHUF_FLUSHBITS(&bitC);\n\t}\n\n\treturn BIT_closeCStream(&bitC);\n}\n\nsize_t HUF_compress4X_usingCTable(void *dst, size_t dstSize, const void *src, size_t srcSize, const HUF_CElt *CTable)\n{\n\tsize_t const segmentSize = (srcSize + 3) / 4; /* first 3 segments */\n\tconst BYTE *ip = (const BYTE *)src;\n\tconst BYTE *const iend = ip + srcSize;\n\tBYTE *const ostart = (BYTE *)dst;\n\tBYTE *const oend = ostart + dstSize;\n\tBYTE *op = ostart;\n\n\tif (dstSize < 6 + 1 + 1 + 1 + 8)\n\t\treturn 0; /* minimum space to compress successfully */\n\tif (srcSize < 12)\n\t\treturn 0; /* no saving possible : too small input */\n\top += 6;\t /* jumpTable */\n\n\t{\n\t\tCHECK_V_F(cSize, HUF_compress1X_usingCTable(op, oend - op, ip, segmentSize, CTable));\n\t\tif (cSize == 0)\n\t\t\treturn 0;\n\t\tZSTD_writeLE16(ostart, (U16)cSize);\n\t\top += cSize;\n\t}\n\n\tip += segmentSize;\n\t{\n\t\tCHECK_V_F(cSize, HUF_compress1X_usingCTable(op, oend - op, ip, segmentSize, CTable));\n\t\tif (cSize == 0)\n\t\t\treturn 0;\n\t\tZSTD_writeLE16(ostart + 2, (U16)cSize);\n\t\top += cSize;\n\t}\n\n\tip += segmentSize;\n\t{\n\t\tCHECK_V_F(cSize, HUF_compress1X_usingCTable(op, oend - op, ip, segmentSize, CTable));\n\t\tif (cSize == 0)\n\t\t\treturn 0;\n\t\tZSTD_writeLE16(ostart + 4, (U16)cSize);\n\t\top += cSize;\n\t}\n\n\tip += segmentSize;\n\t{\n\t\tCHECK_V_F(cSize, HUF_compress1X_usingCTable(op, oend - op, ip, iend - ip, CTable));\n\t\tif (cSize == 0)\n\t\t\treturn 0;\n\t\top += cSize;\n\t}\n\n\treturn op - ostart;\n}\n\nstatic size_t HUF_compressCTable_internal(BYTE *const ostart, BYTE *op, BYTE *const oend, const void *src, size_t srcSize, unsigned singleStream,\n\t\t\t\t\t const HUF_CElt *CTable)\n{\n\tsize_t const cSize =\n\t singleStream ? HUF_compress1X_usingCTable(op, oend - op, src, srcSize, CTable) : HUF_compress4X_usingCTable(op, oend - op, src, srcSize, CTable);\n\tif (HUF_isError(cSize)) {\n\t\treturn cSize;\n\t}\n\tif (cSize == 0) {\n\t\treturn 0;\n\t} /* uncompressible */\n\top += cSize;\n\t/* check compressibility */\n\tif ((size_t)(op - ostart) >= srcSize - 1) {\n\t\treturn 0;\n\t}\n\treturn op - ostart;\n}\n\n/* `workSpace` must a table of at least 1024 unsigned */\nstatic size_t HUF_compress_internal(void *dst, size_t dstSize, const void *src, size_t srcSize, unsigned maxSymbolValue, unsigned huffLog,\n\t\t\t\t unsigned singleStream, void *workSpace, size_t wkspSize, HUF_CElt *oldHufTable, HUF_repeat *repeat, int preferRepeat)\n{\n\tBYTE *const ostart = (BYTE *)dst;\n\tBYTE *const oend = ostart + dstSize;\n\tBYTE *op = ostart;\n\n\tU32 *count;\n\tsize_t const countSize = sizeof(U32) * (HUF_SYMBOLVALUE_MAX + 1);\n\tHUF_CElt *CTable;\n\tsize_t const CTableSize = sizeof(HUF_CElt) * (HUF_SYMBOLVALUE_MAX + 1);\n\n\t/* checks & inits */\n\tif (wkspSize < sizeof(huffNodeTable) + countSize + CTableSize)\n\t\treturn ERROR(GENERIC);\n\tif (!srcSize)\n\t\treturn 0; /* Uncompressed (note : 1 means rle, so first byte must be correct) */\n\tif (!dstSize)\n\t\treturn 0; /* cannot fit within dst budget */\n\tif (srcSize > HUF_BLOCKSIZE_MAX)\n\t\treturn ERROR(srcSize_wrong); /* curr block size limit */\n\tif (huffLog > HUF_TABLELOG_MAX)\n\t\treturn ERROR(tableLog_tooLarge);\n\tif (!maxSymbolValue)\n\t\tmaxSymbolValue = HUF_SYMBOLVALUE_MAX;\n\tif (!huffLog)\n\t\thuffLog = HUF_TABLELOG_DEFAULT;\n\n\tcount = (U32 *)workSpace;\n\tworkSpace = (BYTE *)workSpace + countSize;\n\twkspSize -= countSize;\n\tCTable = (HUF_CElt *)workSpace;\n\tworkSpace = (BYTE *)workSpace + CTableSize;\n\twkspSize -= CTableSize;\n\n\t/* Heuristic : If we don't need to check the validity of the old table use the old table for small inputs */\n\tif (preferRepeat && repeat && *repeat == HUF_repeat_valid) {\n\t\treturn HUF_compressCTable_internal(ostart, op, oend, src, srcSize, singleStream, oldHufTable);\n\t}\n\n\t/* Scan input and build symbol stats */\n\t{\n\t\tCHECK_V_F(largest, FSE_count_wksp(count, &maxSymbolValue, (const BYTE *)src, srcSize, (U32 *)workSpace));\n\t\tif (largest == srcSize) {\n\t\t\t*ostart = ((const BYTE *)src)[0];\n\t\t\treturn 1;\n\t\t} /* single symbol, rle */\n\t\tif (largest <= (srcSize >> 7) + 1)\n\t\t\treturn 0; /* Fast heuristic : not compressible enough */\n\t}\n\n\t/* Check validity of previous table */\n\tif (repeat && *repeat == HUF_repeat_check && !HUF_validateCTable(oldHufTable, count, maxSymbolValue)) {\n\t\t*repeat = HUF_repeat_none;\n\t}\n\t/* Heuristic : use existing table for small inputs */\n\tif (preferRepeat && repeat && *repeat != HUF_repeat_none) {\n\t\treturn HUF_compressCTable_internal(ostart, op, oend, src, srcSize, singleStream, oldHufTable);\n\t}\n\n\t/* Build Huffman Tree */\n\thuffLog = HUF_optimalTableLog(huffLog, srcSize, maxSymbolValue);\n\t{\n\t\tCHECK_V_F(maxBits, HUF_buildCTable_wksp(CTable, count, maxSymbolValue, huffLog, workSpace, wkspSize));\n\t\thuffLog = (U32)maxBits;\n\t\t/* Zero the unused symbols so we can check it for validity */\n\t\tmemset(CTable + maxSymbolValue + 1, 0, CTableSize - (maxSymbolValue + 1) * sizeof(HUF_CElt));\n\t}\n\n\t/* Write table description header */\n\t{\n\t\tCHECK_V_F(hSize, HUF_writeCTable_wksp(op, dstSize, CTable, maxSymbolValue, huffLog, workSpace, wkspSize));\n\t\t/* Check if using the previous table will be beneficial */\n\t\tif (repeat && *repeat != HUF_repeat_none) {\n\t\t\tsize_t const oldSize = HUF_estimateCompressedSize(oldHufTable, count, maxSymbolValue);\n\t\t\tsize_t const newSize = HUF_estimateCompressedSize(CTable, count, maxSymbolValue);\n\t\t\tif (oldSize <= hSize + newSize || hSize + 12 >= srcSize) {\n\t\t\t\treturn HUF_compressCTable_internal(ostart, op, oend, src, srcSize, singleStream, oldHufTable);\n\t\t\t}\n\t\t}\n\t\t/* Use the new table */\n\t\tif (hSize + 12ul >= srcSize) {\n\t\t\treturn 0;\n\t\t}\n\t\top += hSize;\n\t\tif (repeat) {\n\t\t\t*repeat = HUF_repeat_none;\n\t\t}\n\t\tif (oldHufTable) {\n\t\t\tmemcpy(oldHufTable, CTable, CTableSize);\n\t\t} /* Save the new table */\n\t}\n\treturn HUF_compressCTable_internal(ostart, op, oend, src, srcSize, singleStream, CTable);\n}\n\nsize_t HUF_compress1X_wksp(void *dst, size_t dstSize, const void *src, size_t srcSize, unsigned maxSymbolValue, unsigned huffLog, void *workSpace,\n\t\t\t size_t wkspSize)\n{\n\treturn HUF_compress_internal(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, 1 /* single stream */, workSpace, wkspSize, NULL, NULL, 0);\n}\n\nsize_t HUF_compress1X_repeat(void *dst, size_t dstSize, const void *src, size_t srcSize, unsigned maxSymbolValue, unsigned huffLog, void *workSpace,\n\t\t\t size_t wkspSize, HUF_CElt *hufTable, HUF_repeat *repeat, int preferRepeat)\n{\n\treturn HUF_compress_internal(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, 1 /* single stream */, workSpace, wkspSize, hufTable, repeat,\n\t\t\t\t preferRepeat);\n}\n\nsize_t HUF_compress4X_wksp(void *dst, size_t dstSize, const void *src, size_t srcSize, unsigned maxSymbolValue, unsigned huffLog, void *workSpace,\n\t\t\t size_t wkspSize)\n{\n\treturn HUF_compress_internal(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, 0 /* 4 streams */, workSpace, wkspSize, NULL, NULL, 0);\n}\n\nsize_t HUF_compress4X_repeat(void *dst, size_t dstSize, const void *src, size_t srcSize, unsigned maxSymbolValue, unsigned huffLog, void *workSpace,\n\t\t\t size_t wkspSize, HUF_CElt *hufTable, HUF_repeat *repeat, int preferRepeat)\n{\n\treturn HUF_compress_internal(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, 0 /* 4 streams */, workSpace, wkspSize, hufTable, repeat,\n\t\t\t\t preferRepeat);\n}\n"} {"text": "Advanced usage instructions for the Independent JPEG Group's JPEG software\n==========================================================================\n\nThis file describes cjpeg's \"switches for wizards\".\n\nThe \"wizard\" switches are intended for experimentation with JPEG by persons\nwho are reasonably knowledgeable about the JPEG standard. If you don't know\nwhat you are doing, DON'T USE THESE SWITCHES. You'll likely produce files\nwith worse image quality and/or poorer compression than you'd get from the\ndefault settings. Furthermore, these switches must be used with caution\nwhen making files intended for general use, because not all JPEG decoders\nwill support unusual JPEG parameter settings.\n\n\nQuantization Table Adjustment\n-----------------------------\n\nOrdinarily, cjpeg starts with a default set of tables (the same ones given\nas examples in the JPEG standard) and scales them up or down according to\nthe -quality setting. The details of the scaling algorithm can be found in\njcparam.c. At very low quality settings, some quantization table entries\ncan get scaled up to values exceeding 255. Although 2-byte quantization\nvalues are supported by the IJG software, this feature is not in baseline\nJPEG and is not supported by all implementations. If you need to ensure\nwide compatibility of low-quality files, you can constrain the scaled\nquantization values to no more than 255 by giving the -baseline switch.\nNote that use of -baseline will result in poorer quality for the same file\nsize, since more bits than necessary are expended on higher AC coefficients.\n\nYou can substitute a different set of quantization values by using the\n-qtables switch:\n\n\t-qtables file\tUse the quantization tables given in the named file.\n\nThe specified file should be a text file containing decimal quantization\nvalues. The file should contain one to four tables, each of 64 elements.\nThe tables are implicitly numbered 0,1,etc. in order of appearance. Table\nentries appear in normal array order (NOT in the zigzag order in which they\nwill be stored in the JPEG file).\n\nQuantization table files are free format, in that arbitrary whitespace can\nappear between numbers. Also, comments can be included: a comment starts\nwith '#' and extends to the end of the line. Here is an example file that\nduplicates the default quantization tables:\n\n\t# Quantization tables given in JPEG spec, section K.1\n\n\t# This is table 0 (the luminance table):\n\t 16 11 10 16 24 40 51 61\n\t 12 12 14 19 26 58 60 55\n\t 14 13 16 24 40 57 69 56\n\t 14 17 22 29 51 87 80 62\n\t 18 22 37 56 68 109 103 77\n\t 24 35 55 64 81 104 113 92\n\t 49 64 78 87 103 121 120 101\n\t 72 92 95 98 112 100 103 99\n\n\t# This is table 1 (the chrominance table):\n\t 17 18 24 47 99 99 99 99\n\t 18 21 26 66 99 99 99 99\n\t 24 26 56 99 99 99 99 99\n\t 47 66 99 99 99 99 99 99\n\t 99 99 99 99 99 99 99 99\n\t 99 99 99 99 99 99 99 99\n\t 99 99 99 99 99 99 99 99\n\t 99 99 99 99 99 99 99 99\n\nIf the -qtables switch is used without -quality, then the specified tables\nare used exactly as-is. If both -qtables and -quality are used, then the\ntables taken from the file are scaled in the same fashion that the default\ntables would be scaled for that quality setting. If -baseline appears, then\nthe quantization values are constrained to the range 1-255.\n\nBy default, cjpeg will use quantization table 0 for luminance components and\ntable 1 for chrominance components. To override this choice, use the -qslots\nswitch:\n\n\t-qslots N[,...]\t\tSelect which quantization table to use for\n\t\t\t\teach color component.\n\nThe -qslots switch specifies a quantization table number for each color\ncomponent, in the order in which the components appear in the JPEG SOF marker.\nFor example, to create a separate table for each of Y,Cb,Cr, you could\nprovide a -qtables file that defines three quantization tables and say\n\"-qslots 0,1,2\". If -qslots gives fewer table numbers than there are color\ncomponents, then the last table number is repeated as necessary.\n\n\nSampling Factor Adjustment\n--------------------------\n\nBy default, cjpeg uses 2:1 horizontal and vertical downsampling when\ncompressing YCbCr data, and no downsampling for all other color spaces.\nYou can override this default with the -sample switch:\n\n\t-sample HxV[,...]\tSet JPEG sampling factors for each color\n\t\t\t\tcomponent.\n\nThe -sample switch specifies the JPEG sampling factors for each color\ncomponent, in the order in which they appear in the JPEG SOF marker.\nIf you specify fewer HxV pairs than there are components, the remaining\ncomponents are set to 1x1 sampling. For example, the default YCbCr setting\nis equivalent to \"-sample 2x2,1x1,1x1\", which can be abbreviated to\n\"-sample 2x2\".\n\nThere are still some JPEG decoders in existence that support only 2x1\nsampling (also called 4:2:2 sampling). Compatibility with such decoders can\nbe achieved by specifying \"-sample 2x1\". This is not recommended unless\nreally necessary, since it increases file size and encoding/decoding time\nwith very little quality gain.\n\n\nMultiple Scan / Progression Control\n-----------------------------------\n\nBy default, cjpeg emits a single-scan sequential JPEG file. The\n-progressive switch generates a progressive JPEG file using a default series\nof progression parameters. You can create multiple-scan sequential JPEG\nfiles or progressive JPEG files with custom progression parameters by using\nthe -scans switch:\n\n\t-scans file\tUse the scan sequence given in the named file.\n\nThe specified file should be a text file containing a \"scan script\".\nThe script specifies the contents and ordering of the scans to be emitted.\nEach entry in the script defines one scan. A scan definition specifies\nthe components to be included in the scan, and for progressive JPEG it also\nspecifies the progression parameters Ss,Se,Ah,Al for the scan. Scan\ndefinitions are separated by semicolons (';'). A semicolon after the last\nscan definition is optional.\n\nEach scan definition contains one to four component indexes, optionally\nfollowed by a colon (':') and the four progressive-JPEG parameters. The\ncomponent indexes denote which color component(s) are to be transmitted in\nthe scan. Components are numbered in the order in which they appear in the\nJPEG SOF marker, with the first component being numbered 0. (Note that these\nindexes are not the \"component ID\" codes assigned to the components, just\npositional indexes.)\n\nThe progression parameters for each scan are:\n\tSs\tZigzag index of first coefficient included in scan\n\tSe\tZigzag index of last coefficient included in scan\n\tAh\tZero for first scan of a coefficient, else Al of prior scan\n\tAl\tSuccessive approximation low bit position for scan\nIf the progression parameters are omitted, the values 0,63,0,0 are used,\nproducing a sequential JPEG file. cjpeg automatically determines whether\nthe script represents a progressive or sequential file, by observing whether\nSs and Se values other than 0 and 63 appear. (The -progressive switch is\nnot needed to specify this; in fact, it is ignored when -scans appears.)\nThe scan script must meet the JPEG restrictions on progression sequences.\n(cjpeg checks that the spec's requirements are obeyed.)\n\nScan script files are free format, in that arbitrary whitespace can appear\nbetween numbers and around punctuation. Also, comments can be included: a\ncomment starts with '#' and extends to the end of the line. For additional\nlegibility, commas or dashes can be placed between values. (Actually, any\nsingle punctuation character other than ':' or ';' can be inserted.) For\nexample, the following two scan definitions are equivalent:\n\t0 1 2: 0 63 0 0;\n\t0,1,2 : 0-63, 0,0 ;\n\nHere is an example of a scan script that generates a partially interleaved\nsequential JPEG file:\n\n\t0;\t\t\t# Y only in first scan\n\t1 2;\t\t\t# Cb and Cr in second scan\n\nHere is an example of a progressive scan script using only spectral selection\n(no successive approximation):\n\n\t# Interleaved DC scan for Y,Cb,Cr:\n\t0,1,2: 0-0, 0, 0 ;\n\t# AC scans:\n\t0: 1-2, 0, 0 ;\t# First two Y AC coefficients\n\t0: 3-5, 0, 0 ;\t# Three more\n\t1: 1-63, 0, 0 ;\t# All AC coefficients for Cb\n\t2: 1-63, 0, 0 ;\t# All AC coefficients for Cr\n\t0: 6-9, 0, 0 ;\t# More Y coefficients\n\t0: 10-63, 0, 0 ;\t# Remaining Y coefficients\n\nHere is an example of a successive-approximation script. This is equivalent\nto the default script used by \"cjpeg -progressive\" for YCbCr images:\n\n\t# Initial DC scan for Y,Cb,Cr (lowest bit not sent)\n\t0,1,2: 0-0, 0, 1 ;\n\t# First AC scan: send first 5 Y AC coefficients, minus 2 lowest bits:\n\t0: 1-5, 0, 2 ;\n\t# Send all Cr,Cb AC coefficients, minus lowest bit:\n\t# (chroma data is usually too small to be worth subdividing further;\n\t# but note we send Cr first since eye is least sensitive to Cb)\n\t2: 1-63, 0, 1 ;\n\t1: 1-63, 0, 1 ;\n\t# Send remaining Y AC coefficients, minus 2 lowest bits:\n\t0: 6-63, 0, 2 ;\n\t# Send next-to-lowest bit of all Y AC coefficients:\n\t0: 1-63, 2, 1 ;\n\t# At this point we've sent all but the lowest bit of all coefficients.\n\t# Send lowest bit of DC coefficients\n\t0,1,2: 0-0, 1, 0 ;\n\t# Send lowest bit of AC coefficients\n\t2: 1-63, 1, 0 ;\n\t1: 1-63, 1, 0 ;\n\t# Y AC lowest bit scan is last; it's usually the largest scan\n\t0: 1-63, 1, 0 ;\n\nIt may be worth pointing out that this script is tuned for quality settings\nof around 50 to 75. For lower quality settings, you'd probably want to use\na script with fewer stages of successive approximation (otherwise the\ninitial scans will be really bad). For higher quality settings, you might\nwant to use more stages of successive approximation (so that the initial\nscans are not too large).\n"} {"text": "class AddSubmissionLimitToChallengeRounds < ActiveRecord::Migration[5.1]\n def change\n add_column :challenge_rounds, :submission_limit, :integer\n add_column :challenge_rounds, :submission_limit_period_cd, :string\n end\nend\n"} {"text": "module.exports = require('../../../lint-staged.config.base');\n"} {"text": "#include \"types.h\"\n\n#include \n#include \n#include \n#include \n#include \n\n#include \"helper.h\"\n#include \"render.h\"\n\n#ifdef DBG\n#include \n#endif\n\nextern LinkList animationsList[];\nextern TTF_Font* font;\nextern SDL_Renderer* renderer;\nSDL_Color BLACK = {0, 0, 0, 255};\nSDL_Color WHITE = {255, 255, 255, 255};\nvoid initTexture(Texture* self, SDL_Texture* origin, int width, int height,\n int frames) {\n self->origin = origin;\n self->width = width;\n self->height = height;\n self->frames = frames;\n self->crops = malloc(sizeof(SDL_Rect) * frames);\n // self->crops = malloc(sizeof(SDL_Rect) * frames);\n}\nvoid destroyTexture(Texture* self) {\n#ifdef DBG\n assert(self);\n#endif\n free(self->crops);\n free(self);\n}\nbool initText(Text* self, const char* str, SDL_Color color) {\n self->color = color;\n strcpy(self->text, str);\n // Render text surface\n SDL_Surface* textSurface = TTF_RenderText_Solid(font, str, color);\n if (textSurface == NULL) {\n printf(\"Unable to render text surface! SDL_ttf Error: %s\\n\",\n TTF_GetError());\n } else {\n // Create texture from surface pixels\n SDL_Texture* texture = SDL_CreateTextureFromSurface(renderer, textSurface);\n self->width = textSurface->w;\n self->height = textSurface->h;\n SDL_FreeSurface(textSurface);\n if (texture == NULL) {\n printf(\"Unable to create texture from rendered text! SDL Error: %s\\n\",\n SDL_GetError());\n } else {\n self->origin = texture;\n return true;\n }\n }\n return false;\n}\nText* createText(const char* str, SDL_Color color) {\n Text* self = malloc(sizeof(Text));\n initText(self, str, color);\n return self;\n}\nvoid setText(Text* self, const char* str) {\n if (!strcmp(str, self->text)) return;\n SDL_DestroyTexture(self->origin);\n initText(self, str, self->color);\n}\nvoid destroyText(Text* self) {\n SDL_DestroyTexture(self->origin);\n free(self);\n}\nvoid initEffect(Effect* self, int duration, int length, SDL_BlendMode mode) {\n self->keys = malloc(sizeof(SDL_Color) * length);\n self->duration = duration;\n self->length = length;\n self->currentFrame = 0;\n self->mode = mode;\n}\n// deep copy\nvoid copyEffect(const Effect* src, Effect* dest) {\n memcpy(dest, src, sizeof(Effect));\n dest->keys = malloc(sizeof(SDL_Color) * src->length);\n memcpy(dest->keys, src->keys, sizeof(SDL_Color) * src->length);\n}\nvoid destroyEffect(Effect* self) {\n if (self) {\n free(self->keys);\n free(self);\n }\n}\n\nvoid initAnimation(Animation* self, Texture* origin, const Effect* effect,\n LoopType lp, int duration, int x, int y,\n SDL_RendererFlip flip, double angle, At at) {\n // will deep copy effect\n self->origin = origin;\n if (effect) {\n self->effect = malloc(sizeof(Effect));\n copyEffect(effect, self->effect);\n } else {\n self->effect = NULL;\n }\n self->lp = lp;\n self->duration = duration;\n self->currentFrame = 0;\n self->x = x;\n self->y = y;\n self->flip = flip;\n self->angle = angle;\n self->at = at;\n self->bind = NULL;\n self->strongBind = false;\n self->scaled = true;\n self->lifeSpan = duration;\n}\nAnimation* createAnimation(Texture* origin, const Effect* effect, LoopType lp,\n int duration, int x, int y, SDL_RendererFlip flip,\n double angle, At at) {\n Animation* self = malloc(sizeof(Animation));\n initAnimation(self, origin, effect, lp, duration, x, y, flip, angle, at);\n return self;\n}\nvoid destroyAnimation(Animation* self) {\n destroyEffect(self->effect);\n free(self);\n}\nvoid copyAnimation(Animation* src, Animation* dest) {\n memcpy(dest, src, sizeof(Animation));\n if (src->effect) {\n dest->effect = malloc(sizeof(Effect));\n copyEffect(src->effect, dest->effect);\n }\n}\n\nvoid initLinkNode(LinkNode* self) {\n self->nxt = self->pre = self->element = NULL;\n}\nLinkNode* createLinkNode(void* element) {\n LinkNode* self = malloc(sizeof(LinkNode));\n initLinkNode(self);\n self->element = element;\n return self;\n}\nvoid initLinkList(LinkList* self) { self->head = self->tail = NULL; }\nLinkList* createLinkList() {\n LinkList* self = malloc(sizeof(LinkList));\n initLinkList(self);\n return self;\n}\nvoid pushLinkNodeAtHead(LinkList* list, LinkNode* node) {\n if (list->head == NULL) {\n list->head = list->tail = node;\n } else {\n node->nxt = list->head;\n list->head->pre = node;\n list->head = node;\n }\n}\nvoid pushLinkNode(LinkList* list, LinkNode* node) {\n if (list->head == NULL) {\n list->head = list->tail = node;\n } else {\n list->tail->nxt = node;\n node->pre = list->tail;\n\n list->tail = node;\n }\n}\nvoid removeLinkNode(LinkList* list, LinkNode* node) {\n if (node->pre) {\n node->pre->nxt = node->nxt;\n } else {\n list->head = node->nxt;\n }\n if (node->nxt) {\n node->nxt->pre = node->pre;\n } else {\n list->tail = node->pre;\n }\n free(node);\n}\nvoid destroyLinkList(LinkList* self) {\n for (LinkNode *p = self->head, *nxt; p; p = nxt) {\n nxt = p->nxt;\n free(p);\n }\n free(self);\n}\nvoid destroyAnimationsByLinkList(LinkList* list) {\n for (LinkNode *p = list->head, *nxt; p; p = nxt) {\n nxt = p->nxt;\n destroyAnimation(p->element);\n removeLinkNode(list, p);\n }\n}\nvoid removeAnimationFromLinkList(LinkList* self, Animation* ani) {\n for (LinkNode* p = self->head; p; p = p->nxt)\n if (p->element == ani) {\n removeLinkNode(self, p);\n destroyAnimation(ani);\n break;\n }\n}\nvoid changeSpriteDirection(LinkNode* self, Direction newDirection) {\n Sprite* sprite = self->element;\n if (sprite->direction == (1 ^ newDirection)) return;\n sprite->direction = newDirection;\n if (newDirection == LEFT || newDirection == RIGHT)\n sprite->face = newDirection;\n if (self->nxt) {\n Sprite* nextSprite = self->nxt->element;\n nextSprite->buffer[nextSprite->bufferSize++] =\n (PositionBuffer){sprite->x, sprite->y, sprite->direction};\n }\n}\nvoid initScore(Score* score) { memset(score, 0, sizeof(Score)); }\nScore* createScore() {\n Score* score = malloc(sizeof(Score));\n initScore(score);\n return score;\n}\nvoid destroyScore(Score* self) { free(self); }\nvoid calcScore(Score* self) {\n if (!self->got) {\n self->rank = 0;\n return;\n }\n extern int gameLevel;\n self->rank = (double)self->damage / self->got +\n (double)self->stand / self->got + self->got * 50 +\n self->killed * 100;\n self->rank *= gameLevel + 1;\n}\nvoid addScore(Score* a, Score* b) {\n a->got += b->got;\n a->damage += b->damage;\n a->killed += b->killed;\n a->stand += b->stand;\n calcScore(a);\n}\n"} {"text": "/*\nCopyright IBM Corp. 2016 All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\t\t 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 clilogging\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/inklabsfoundation/inkchain/common/flogging\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nconst (\n\tloggingFuncName = \"logging\"\n\tshortDes = \"Log levels: getlevel|setlevel|revertlevels.\"\n\tlongDes = \"Log levels: getlevel|setlevel|revertlevels.\"\n)\n\nvar logger = flogging.MustGetLogger(\"cli/logging\")\n\n// Cmd returns the cobra command for Logging\nfunc Cmd(cf *LoggingCmdFactory) *cobra.Command {\n\tloggingCmd.AddCommand(getLevelCmd(cf))\n\tloggingCmd.AddCommand(setLevelCmd(cf))\n\tloggingCmd.AddCommand(revertLevelsCmd(cf))\n\n\treturn loggingCmd\n}\n\nvar loggingCmd = &cobra.Command{\n\tUse: loggingFuncName,\n\tShort: fmt.Sprint(shortDes),\n\tLong: fmt.Sprint(longDes),\n}\n"} {"text": "From: Maarten ter Huurne \nDate: Sun, 14 Sep 2014 23:58:34 +0200\nSubject: Do not create backup of old installed binary\n\nThis is a rather unusual feature that packagers will not expect.\n\nSigned-off-by: Maarten ter Huurne \n[baruch: update for 4.6.2]\nSigned-off-by: Baruch Siach \n---\n Makefile.in | 4 ----\n 1 file changed, 4 deletions(-)\n\ndiff --git a/Makefile.in b/Makefile.in\nindex 187a69b..65549e9 100644\n--- a/Makefile.in\n+++ b/Makefile.in\n@@ -83,12 +83,9 @@ screen: $(OFILES)\n \t $(OPTIONS) $(CFLAGS) $<\n \n install_bin: .version screen installdirs\n-\t-if [ -f $(DESTDIR)$(bindir)/$(SCREEN) ] && [ ! -f $(DESTDIR)$(bindir)/$(SCREEN).old ]; \\\n-\t\tthen mv $(DESTDIR)$(bindir)/$(SCREEN) $(DESTDIR)$(bindir)/$(SCREEN).old; fi\n \t$(INSTALL_PROGRAM) screen $(DESTDIR)$(bindir)/$(SCREEN)\n \t-chown root $(DESTDIR)$(bindir)/$(SCREEN) && chmod 4755 $(DESTDIR)$(bindir)/$(SCREEN)\n # This doesn't work if $(bindir)/screen is a symlink\n-\t-if [ -f $(DESTDIR)$(bindir)/screen ] && [ ! -f $(DESTDIR)$(bindir)/screen.old ]; then mv $(DESTDIR)$(bindir)/screen $(DESTDIR)$(bindir)/screen.old; fi\n \trm -f $(DESTDIR)$(bindir)/screen\n \t(cd $(DESTDIR)$(bindir) && ln -f -s $(SCREEN) screen)\n \tcp $(srcdir)/utf8encodings/?? $(DESTDIR)$(SCREENENCODINGS)\n@@ -113,7 +110,6 @@ installdirs:\n uninstall: .version\n \trm -f $(DESTDIR)$(bindir)/$(SCREEN)\n \trm -f $(DESTDIR)$(bindir)/screen\n-\t-mv $(DESTDIR)$(bindir)/screen.old $(DESTDIR)$(bindir)/screen\n \trm -f $(DESTDIR)$(ETCSCREENRC)\n \tcd doc; $(MAKE) uninstall\n \n-- \n1.8.4.5\n\n"} {"text": "\n \n netstandard1.5\n\tSharpRepository for AzureDocumentDb\n\tBen Griswold, Jeff Treuting\n SharpRepository generic repository Azure DocumentDb implementation\n Written in C#, includes support for various relational, document and object databases including Entity Framework, RavenDB, MongoDB, CouchDB and Db4o. SharpRepository includes Xml and InMemory repository implementations as well. SharpRepository offers built-in caching options for AppFabric, memcached and the standard System.Runtime.Caching. SharpRepository also supports Specifications, FetchStrategies, Batches and Traits!\n\tSharpRepository.AzureDocumentDbRepository\n 2.0.2-alpha4\n\t2.0.2-alpha4: configurable via appsettings.json\n\tSharpRepository Repository Azure DocumentDb\n\thttps://user-images.githubusercontent.com/6349515/28491142-7b6350c4-6eeb-11e7-9c5b-e3b8ef1e73b8.png\n\thttps://github.com/SharpRepository/SharpRepository\n\thttps://raw.githubusercontent.com/SharpRepository/SharpRepository/master/license.txt\n\tfalse\n https://github.com/SharpRepository/SharpRepository.git\n\tgit\n\t2.0.2-alpha4\n \n \n \n true\n Always\n \n \n \n \n \n \n \n \n \n"} {"text": "// This file is part of Eigen, a lightweight C++ template library\n// for linear algebra.\n//\n// Copyright (C) 2008-2009 Gael Guennebaud \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_SPARSE_BLOCKFORDYNAMICMATRIX_H\n#define EIGEN_SPARSE_BLOCKFORDYNAMICMATRIX_H\n\nnamespace Eigen { \n\n#if 0\n\n// NOTE Have to be reimplemented as a specialization of BlockImpl< DynamicSparseMatrix<_Scalar, _Options, _Index>, ... >\n// See SparseBlock.h for an example\n\n\n/***************************************************************************\n* specialisation for DynamicSparseMatrix\n***************************************************************************/\n\ntemplate\nclass SparseInnerVectorSet, Size>\n : public SparseMatrixBase, Size> >\n{\n typedef DynamicSparseMatrix<_Scalar, _Options, _Index> MatrixType;\n public:\n\n enum { IsRowMajor = internal::traits::IsRowMajor };\n\n EIGEN_SPARSE_PUBLIC_INTERFACE(SparseInnerVectorSet)\n class InnerIterator: public MatrixType::InnerIterator\n {\n public:\n inline InnerIterator(const SparseInnerVectorSet& xpr, Index outer)\n : MatrixType::InnerIterator(xpr.m_matrix, xpr.m_outerStart + outer), m_outer(outer)\n {}\n inline Index row() const { return IsRowMajor ? m_outer : this->index(); }\n inline Index col() const { return IsRowMajor ? this->index() : m_outer; }\n protected:\n Index m_outer;\n };\n\n inline SparseInnerVectorSet(const MatrixType& matrix, Index outerStart, Index outerSize)\n : m_matrix(matrix), m_outerStart(outerStart), m_outerSize(outerSize)\n {\n eigen_assert( (outerStart>=0) && ((outerStart+outerSize)<=matrix.outerSize()) );\n }\n\n inline SparseInnerVectorSet(const MatrixType& matrix, Index outer)\n : m_matrix(matrix), m_outerStart(outer), m_outerSize(Size)\n {\n eigen_assert(Size!=Dynamic);\n eigen_assert( (outer>=0) && (outer\n inline SparseInnerVectorSet& operator=(const SparseMatrixBase& other)\n {\n if (IsRowMajor != ((OtherDerived::Flags&RowMajorBit)==RowMajorBit))\n {\n // need to transpose => perform a block evaluation followed by a big swap\n DynamicSparseMatrix aux(other);\n *this = aux.markAsRValue();\n }\n else\n {\n // evaluate/copy vector per vector\n for (Index j=0; j aux(other.innerVector(j));\n m_matrix.const_cast_derived()._data()[m_outerStart+j].swap(aux._data());\n }\n }\n return *this;\n }\n\n inline SparseInnerVectorSet& operator=(const SparseInnerVectorSet& other)\n {\n return operator=(other);\n }\n\n Index nonZeros() const\n {\n Index count = 0;\n for (Index j=0; j0);\n return m_matrix.data()[m_outerStart].vale(m_matrix.data()[m_outerStart].size()-1);\n }\n\n// template\n// inline SparseInnerVectorSet& operator=(const SparseMatrixBase& other)\n// {\n// return *this;\n// }\n\n EIGEN_STRONG_INLINE Index rows() const { return IsRowMajor ? m_outerSize.value() : m_matrix.rows(); }\n EIGEN_STRONG_INLINE Index cols() const { return IsRowMajor ? m_matrix.cols() : m_outerSize.value(); }\n\n protected:\n\n const typename MatrixType::Nested m_matrix;\n Index m_outerStart;\n const internal::variable_if_dynamic m_outerSize;\n\n};\n\n#endif\n\n} // end namespace Eigen\n\n#endif // EIGEN_SPARSE_BLOCKFORDYNAMICMATRIX_H\n"} {"text": "\n
"} {"text": "/* styles */\r\n/* Template for items in the ListView */\r\n.VisitBackgroundEventsListViewItemStyle {\r\n width: 500px;\r\n padding: 4px;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n -ms-text-overflow: ellipsis;\r\n}\r\n\r\n/* CSS applied to the ListView */\r\n#VisitBackgroundEventsListView {\r\n height: 240px;\r\n width: 500px;\r\n padding: 4px;\r\n border: solid 2px rgba(0, 0, 0, 0.13);\r\n}"} {"text": "import sys\nimport json\n\nimport click\nimport django.apps\nfrom django.db import connection\n\nimport rssant_common.django_setup # noqa:F401\nfrom rssant_common.helper import pretty_format_json\n\nsql_count_limit = '''\nSELECT count(*) as row_count\nFROM (SELECT 1 FROM {table} LIMIT {limit}) t;\n'''\n\nsql_count_estimate = '''\nSELECT relname as table_name, reltuples AS row_count\nFROM pg_class WHERE relname=ANY(%s);\n'''\n\nstory_volume_tables = [\n 'story_volume_0',\n]\n\n\ndef pg_count_limit(tables, limit):\n result = {}\n with connection.cursor() as cursor:\n for table in tables:\n sql = sql_count_limit.format(table=table, limit=limit)\n cursor.execute(sql)\n (row_count,) = cursor.fetchone()\n row_count = int(row_count)\n if row_count < limit:\n result[table] = row_count\n return result\n\n\ndef pg_count_estimate(tables):\n result = {}\n with connection.cursor() as cursor:\n cursor.execute(sql_count_estimate, [tables])\n for table, count in cursor.fetchall():\n result[table] = int(count)\n return result\n\n\ndef pg_count():\n \"\"\"\n Problem:\n 1. count(*) is slow for large table.\n 2. estimate is not accuracy for small table.\n Solution:\n 1. count(*) with limit, avoid slow for large tables\n 2. query estimate from system table for large tables\n See also:\n https://stackoverflow.com/questions/7943233/fast-way-to-discover-the-row-count-of-a-table-in-postgresql\n https://wiki.postgresql.org/wiki/Count_estimate\n \"\"\"\n models = django.apps.apps.get_models()\n tables = [m._meta.db_table for m in models]\n tables.extend(story_volume_tables)\n result = pg_count_limit(tables, limit=10000)\n large_tables = list(set(tables) - set(result))\n result.update(pg_count_estimate(large_tables))\n result = list(sorted(result.items()))\n return result\n\n\ndef pg_verify(result, expect_result, bias):\n result_map = {name: count for name, count in result}\n is_all_ok = True\n for name, expect_count in expect_result:\n count = result_map.get(name)\n if count is None:\n v_bias = 1.0\n is_ok = False\n else:\n v_bias = abs(expect_count - count) / (expect_count + 1)\n is_ok = v_bias < bias\n if not is_ok:\n is_all_ok = False\n count_text = str(count) if count is not None else '#'\n status = 'OK' if is_ok else 'ERROR'\n bias_text = '{}%'.format(round(v_bias * 100, 2))\n print(f'{status:<5s} {name:<35s} count={count_text:<7s} expect={str(expect_count):<7s} bias={bias_text}')\n return is_all_ok\n\n\n@click.command()\n@click.option('--verify', type=str, help='target filepath, or - to query database')\n@click.option('--verify-bias', type=float, default=0.003)\n@click.argument('filepath', type=str, default='-')\ndef main(verify, filepath, verify_bias):\n if verify:\n if verify != '-':\n with open(verify) as f:\n data = json.load(f)\n result = [(x['name'], x['count']) for x in data['tables']]\n else:\n result = pg_count()\n if filepath and filepath != '-':\n with open(filepath) as f:\n content = f.read()\n else:\n content = sys.stdin.read()\n expect_data = json.loads(content)\n expect_result = [(x['name'], x['count']) for x in expect_data['tables']]\n is_ok = pg_verify(result, expect_result, verify_bias)\n sys.exit(0 if is_ok else 1)\n else:\n result = pg_count()\n tables = [dict(name=name, count=count) for name, count in result]\n content = pretty_format_json(dict(tables=tables))\n if filepath and filepath != '-':\n with open(filepath, 'w') as f:\n f.write(content)\n else:\n print(content)\n\n\nif __name__ == \"__main__\":\n main()\n"} {"text": "/*\n * reserved comment block\n * DO NOT REMOVE OR ALTER!\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\npackage com.sun.org.apache.xerces.internal.impl.dtd;\n\nimport com.sun.org.apache.xerces.internal.impl.dv.DatatypeValidator;\n\n/**\n */\npublic class XMLSimpleType {\n\n //\n // Constants\n //\n\n /** TYPE_CDATA */\n public static final short TYPE_CDATA = 0;\n\n /** TYPE_ENTITY */\n public static final short TYPE_ENTITY = 1;\n\n /** TYPE_ENUMERATION */\n public static final short TYPE_ENUMERATION = 2;\n\n /** TYPE_ID */\n public static final short TYPE_ID = 3;\n\n /** TYPE_IDREF */\n public static final short TYPE_IDREF = 4;\n\n /** TYPE_NMTOKEN */\n public static final short TYPE_NMTOKEN = 5;\n\n /** TYPE_NOTATION */\n public static final short TYPE_NOTATION = 6;\n\n /** TYPE_NAMED */\n public static final short TYPE_NAMED = 7;\n\n /** DEFAULT_TYPE_DEFAULT */\n public static final short DEFAULT_TYPE_DEFAULT = 3;\n\n /** DEFAULT_TYPE_FIXED */\n public static final short DEFAULT_TYPE_FIXED = 1;\n\n /** DEFAULT_TYPE_IMPLIED */\n public static final short DEFAULT_TYPE_IMPLIED = 0;\n\n /** DEFAULT_TYPE_REQUIRED */\n public static final short DEFAULT_TYPE_REQUIRED = 2;\n\n //\n // Data\n //\n\n /** type */\n public short type;\n\n /** name */\n public String name;\n\n /** enumeration */\n public String[] enumeration;\n\n /** list */\n public boolean list;\n\n /** defaultType */\n public short defaultType;\n\n /** defaultValue */\n public String defaultValue;\n\n /** non-normalized defaultValue */\n public String nonNormalizedDefaultValue;\n\n /** datatypeValidator */\n public DatatypeValidator datatypeValidator;\n\n //\n // Methods\n //\n\n /**\n * setValues\n *\n * @param type\n * @param name\n * @param enumeration\n * @param list\n * @param defaultType\n * @param defaultValue\n * @param nonNormalizedDefaultValue\n * @param datatypeValidator\n */\n public void setValues(short type, String name, String[] enumeration,\n boolean list, short defaultType,\n String defaultValue, String nonNormalizedDefaultValue,\n DatatypeValidator datatypeValidator) {\n\n this.type = type;\n this.name = name;\n // REVISIT: Should this be a copy? -Ac\n if (enumeration != null && enumeration.length > 0) {\n this.enumeration = new String[enumeration.length];\n System.arraycopy(enumeration, 0, this.enumeration, 0, this.enumeration.length);\n }\n else {\n this.enumeration = null;\n }\n this.list = list;\n this.defaultType = defaultType;\n this.defaultValue = defaultValue;\n this.nonNormalizedDefaultValue = nonNormalizedDefaultValue;\n this.datatypeValidator = datatypeValidator;\n\n } // setValues(short,String,String[],boolean,short,String,String,DatatypeValidator)\n\n /** Set values. */\n public void setValues(XMLSimpleType simpleType) {\n\n type = simpleType.type;\n name = simpleType.name;\n // REVISIT: Should this be a copy? -Ac\n if (simpleType.enumeration != null && simpleType.enumeration.length > 0) {\n enumeration = new String[simpleType.enumeration.length];\n System.arraycopy(simpleType.enumeration, 0, enumeration, 0, enumeration.length);\n }\n else {\n enumeration = null;\n }\n list = simpleType.list;\n defaultType = simpleType.defaultType;\n defaultValue = simpleType.defaultValue;\n nonNormalizedDefaultValue = simpleType.nonNormalizedDefaultValue;\n datatypeValidator = simpleType.datatypeValidator;\n\n } // setValues(XMLSimpleType)\n\n /**\n * clear\n */\n public void clear() {\n this.type = -1;\n this.name = null;\n this.enumeration = null;\n this.list = false;\n this.defaultType = -1;\n this.defaultValue = null;\n this.nonNormalizedDefaultValue = null;\n this.datatypeValidator = null;\n } // clear\n\n} // class XMLSimpleType\n"} {"text": "# Change Log\n\nAll notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n\n\n# [2.0.0](https://github.com/yargs/set-blocking/compare/v1.0.0...v2.0.0) (2016-05-17)\n\n\n### Features\n\n* add an isTTY check ([#3](https://github.com/yargs/set-blocking/issues/3)) ([66ce277](https://github.com/yargs/set-blocking/commit/66ce277))\n\n\n### BREAKING CHANGES\n\n* stdio/stderr will not be set to blocking if isTTY === false\n\n\n\n\n# 1.0.0 (2016-05-14)\n\n\n### Features\n\n* implemented shim for stream._handle.setBlocking ([6bde0c0](https://github.com/yargs/set-blocking/commit/6bde0c0))\n"} {"text": "\n\n\n\n\n\n \n \n \n \n \n \n 1\n \n \n \n \n \n \n \n \n \n 1\n \n \n \n 1\n \n \n \n \n\n"} {"text": "# Symbolic constants for Tk\n\n# Booleans\nNO=FALSE=OFF=0\nYES=TRUE=ON=1\n\n# -anchor and -sticky\nN='n'\nS='s'\nW='w'\nE='e'\nNW='nw'\nSW='sw'\nNE='ne'\nSE='se'\nNS='ns'\nEW='ew'\nNSEW='nsew'\nCENTER='center'\n\n# -fill\nNONE='none'\nX='x'\nY='y'\nBOTH='both'\n\n# -side\nLEFT='left'\nTOP='top'\nRIGHT='right'\nBOTTOM='bottom'\n\n# -relief\nRAISED='raised'\nSUNKEN='sunken'\nFLAT='flat'\nRIDGE='ridge'\nGROOVE='groove'\nSOLID = 'solid'\n\n# -orient\nHORIZONTAL='horizontal'\nVERTICAL='vertical'\n\n# -tabs\nNUMERIC='numeric'\n\n# -wrap\nCHAR='char'\nWORD='word'\n\n# -align\nBASELINE='baseline'\n\n# -bordermode\nINSIDE='inside'\nOUTSIDE='outside'\n\n# Special tags, marks and insert positions\nSEL='sel'\nSEL_FIRST='sel.first'\nSEL_LAST='sel.last'\nEND='end'\nINSERT='insert'\nCURRENT='current'\nANCHOR='anchor'\nALL='all' # e.g. Canvas.delete(ALL)\n\n# Text widget and button states\nNORMAL='normal'\nDISABLED='disabled'\nACTIVE='active'\n# Canvas state\nHIDDEN='hidden'\n\n# Menu item types\nCASCADE='cascade'\nCHECKBUTTON='checkbutton'\nCOMMAND='command'\nRADIOBUTTON='radiobutton'\nSEPARATOR='separator'\n\n# Selection modes for list boxes\nSINGLE='single'\nBROWSE='browse'\nMULTIPLE='multiple'\nEXTENDED='extended'\n\n# Activestyle for list boxes\n# NONE='none' is also valid\nDOTBOX='dotbox'\nUNDERLINE='underline'\n\n# Various canvas styles\nPIESLICE='pieslice'\nCHORD='chord'\nARC='arc'\nFIRST='first'\nLAST='last'\nBUTT='butt'\nPROJECTING='projecting'\nROUND='round'\nBEVEL='bevel'\nMITER='miter'\n\n# Arguments to xview/yview\nMOVETO='moveto'\nSCROLL='scroll'\nUNITS='units'\nPAGES='pages'\n"} {"text": "julia 0.3\nBinDeps\nCompat\nImages\nColors\nFactCheck\nTestImages\n"} {"text": "// Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.\n\n/*=============================================================================\n D3DPostProcess : Direct3D specific post processing special effects\n\n Revision history:\n* 23/02/2005: Re-factored/Converted to CryEngine 2.0 by Tiago Sousa\n* Created by Tiago Sousa\n\n =============================================================================*/\n\n#include \"StdAfx.h\"\n#include \n#include \"D3DPostProcess.h\"\n\n#if CRY_PLATFORM_WINDOWS\n\t#include \n#endif\n\nSD3DPostEffectsUtils SD3DPostEffectsUtils::m_pInstance;\n\n////////////////////////////////////////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////////////////////////////////////////\n\nvoid SD3DPostEffectsUtils::ResolveRT(CTexture*& pDst, const RECT* pSrcRect)\n{\n\tASSERT_LEGACY_PIPELINE\n\tassert(pDst);\n\tif (!pDst)\n\t\treturn;\n\t/*\n\tCRenderDisplayContext* pActiveContext = gcpRendD3D.GetActiveDisplayContext();\n\tCTexture* pSrc = pActiveContext->GetColorOutput();\n\tif (pSrc)\n\t{\n\t\tRECT defaultRect;\n\t\tif (!pSrcRect)\n\t\t{\n\t\t\tdefaultRect.left = 0;\n\t\t\tdefaultRect.top = 0;\n\t\t\tdefaultRect.right = min(pDst->GetWidth(), pActiveContext->GetResolution().x);\n\t\t\tdefaultRect.bottom = min(pDst->GetHeight(), pActiveContext->GetResolution().y);\n\n\t\t\tpSrcRect = &defaultRect;\n\t\t}\n\n\t\tconst SResourceRegionMapping region =\n\t\t{\n\t\t\t{ 0, 0, 0, 0 },\n\t\t\t{ pSrcRect->left, pSrcRect->top, 0, 0 },\n\t\t\t{ pSrcRect->right - pSrcRect->left, pSrcRect->bottom - pSrcRect->top, 1, 1 }\n\t\t};\n\n\t\tHRESULT hr = 0;\n\t\tSRenderStatistics::Write().m_RTCopied++;\n\t\tSRenderStatistics::Write().m_RTCopiedSize += pDst->GetDeviceDataSize();\n\n\t\tGetDeviceObjectFactory().GetCoreCommandList().GetCopyInterface()->Copy(pSrc->GetDevTexture(), pDst->GetDevTexture(), region);\n\t}\n\t*/\n}\n\nvoid SD3DPostEffectsUtils::CopyTextureToScreen(CTexture*& pSrc, const RECT* pSrcRegion, const int filterMode)\n{\n\tASSERT_LEGACY_PIPELINE\n/*\n\tstatic CCryNameTSCRC pRestoreTechName(\"TextureToTexture\");\n\tPostProcessUtils().ShBeginPass(CShaderMan::s_shPostEffects, pRestoreTechName, FEF_DONTSETTEXTURES | FEF_DONTSETSTATES);\n\tgRenDev->FX_SetState(GS_NODEPTHTEST);\n\tPostProcessUtils().SetTexture(pSrc, 0, filterMode >= 0 ? filterMode : FILTER_POINT);\n\tPostProcessUtils().DrawFullScreenTri(pSrc->GetWidth(), pSrc->GetHeight(), 0, pSrcRegion);\n\tPostProcessUtils().ShEndPass();\n*/\n}\n\nvoid SD3DPostEffectsUtils::CopyScreenToTexture(CTexture*& pDst, const RECT* pSrcRegion)\n{\n\tResolveRT(pDst, pSrcRegion);\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////////////////////////////////////////\n\nvoid SD3DPostEffectsUtils::StretchRect(CTexture* pSrc, CTexture*& pDst, bool bClearAlpha, bool bDecodeSrcRGBK, bool bEncodeDstRGBK, bool bBigDownsample, EDepthDownsample depthDownsample, bool bBindMultisampled, const RECT* srcRegion)\n{\n\tif (!pSrc || !pDst)\n\t{\n\t\treturn;\n\t}\n\n\tPROFILE_LABEL_SCOPE(\"STRETCHRECT\");\n\n\t// OLD PIPELINE\n\tASSERT_LEGACY_PIPELINE\n}\n////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/////////////////////////////////////////////////////////////////////////////////////////////////////\n/////////////////////////////////////////////////////////////////////////////////////////////////////\n\nvoid SD3DPostEffectsUtils::Downsample(CTexture* pSrc, CTexture* pDst, int nSrcW, int nSrcH, int nDstW, int nDstH, EFilterType eFilter /*= FilterType_Box*/, bool bSetTarget /*= true*/)\n{\n\tASSERT_LEGACY_PIPELINE\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////////////////////////////////////////\n\nvoid CD3D9Renderer::GetReprojectionMatrix(Matrix44A& matReproj,\n const Matrix44A& matView,\n const Matrix44A& matProj,\n const Matrix44A& matPrevView,\n const Matrix44A& matPrevProj,\n float fFarPlane) const\n{\n\t// Current camera screen-space to projection-space\n\tconst Matrix44A matSc2Pc\n\t (2.f, 0.f, -1.f, 0.f,\n\t 0.f, 2.f, -1.f, 0.f,\n\t 0.f, 0.f, 1.f, 0.f,\n\t 0.f, 0.f, 0.f, 1.f / fFarPlane);\n\n\t// Current camera view-space to projection-space\n\tconst Matrix44A matVc2Pc\n\t (matProj.m00, 0.f, 0.f, 0.f,\n\t 0.f, matProj.m11, 0.f, 0.f,\n\t 0.f, 0.f, 1.f, 0.f,\n\t 0.f, 0.f, 0.f, 1.f);\n\n\t// Current camera projection-space to world-space\n\tconst Matrix44A matPc2Wc = (matVc2Pc * matView).GetInverted();\n\n\t// Previous camera view-space to projection-space\n\tconst Matrix44A matVp2Pp\n\t (matPrevProj.m00, 0.f, 0.f, 0.f,\n\t 0.f, matPrevProj.m11, 0.f, 0.f,\n\t 0.f, 0.f, 1.f, 0.f,\n\t 0.f, 0.f, 0.f, 1.f);\n\n\t// Previous camera world-space to projection-space\n\tconst Matrix44A matWp2Pp = matVp2Pp * matPrevView;\n\n\t// Previous camera projection-space to texture-space\n\tconst Matrix44A matPp2Tp\n\t (0.5f, 0.f, 0.5f, 0.f,\n\t 0.f, 0.5f, 0.5f, 0.f,\n\t 0.f, 0.f, 1.f, 0.f,\n\t 0.f, 0.f, 0.f, 1.f);\n\n\t// Final reprojection matrix (from current camera screen-space to previous camera texture-space)\n\tmatReproj = matPp2Tp * matWp2Pp * matPc2Wc * matSc2Pc;\n}\n\n/////////////////////////////////////////////////////////////////////////////////////////////////////\n/////////////////////////////////////////////////////////////////////////////////////////////////////\n\nvoid CPostEffectsMgr::Begin()\n{\n\tPostProcessUtils().Log(\"### POST-PROCESSING BEGINS ### \");\n\tPostProcessUtils().m_pTimer = gEnv->pTimer;\n\tstatic EShaderQuality nPrevShaderQuality = eSQ_Low;\n\tstatic ERenderQuality nPrevRenderQuality = eRQ_Low;\n\n\tEShaderQuality nShaderQuality = (EShaderQuality) gcpRendD3D->EF_GetShaderQuality(eST_PostProcess);\n\tERenderQuality nRenderQuality = gRenDev->EF_GetRenderQuality();\n\tif (nPrevShaderQuality != nShaderQuality || nPrevRenderQuality != nRenderQuality)\n\t{\n\t\tCPostEffectsMgr::Reset(true);\n\t\tnPrevShaderQuality = nShaderQuality;\n\t\tnPrevRenderQuality = nRenderQuality;\n\t}\n\n\t//gcpRendD3D->RT_SetViewport(0, 0, gcpRendD3D->GetWidth(), gcpRendD3D->GetHeight());\n\n\tauto threadID = gRenDev->GetRenderThreadID();\n\tSPostEffectsUtils::m_fWaterLevel = gRenDev->m_p3DEngineCommon[threadID].m_OceanInfo.m_fWaterLevel;\n\n\tPostProcessUtils().UpdateOverscanBorderAspectRatio();\n}\n\nvoid CPostEffectsMgr::End(CRenderView* pRenderView)\n{\n\t//gcpRendD3D->RT_SetViewport(PostProcessUtils().m_pScreenRect.left, PostProcessUtils().m_pScreenRect.top, PostProcessUtils().m_pScreenRect.right, PostProcessUtils().m_pScreenRect.bottom);\n\tconst int kFloatMaxContinuousInt = 0x1000000; // 2^24\n\tconst bool bStereo = gcpRendD3D->GetS3DRend().IsStereoEnabled();\n\tconst bool bStereoSequentialSubmission = gcpRendD3D->GetS3DRend().GetStereoSubmissionMode() == EStereoSubmission::STEREO_SUBMISSION_SEQUENTIAL;\n\n\tif (!bStereo || (bStereo && (!bStereoSequentialSubmission || pRenderView->GetCurrentEye() == CCamera::eEye_Right)))\n\t\tSPostEffectsUtils::m_iFrameCounter = (SPostEffectsUtils::m_iFrameCounter + 1) % kFloatMaxContinuousInt;\n\n\tPostProcessUtils().Log(\"### POST-PROCESSING ENDS ### \");\n}\n"} {"text": "//===--- CFGStmtMap.h - Map from Stmt* to CFGBlock* -----------*- 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// This file defines the CFGStmtMap class, which defines a mapping from\n// Stmt* to CFGBlock*\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef LLVM_CLANG_ANALYSIS_CFGSTMTMAP_H\n#define LLVM_CLANG_ANALYSIS_CFGSTMTMAP_H\n\n#include \"clang/Analysis/CFG.h\"\n\nnamespace clang {\n\nclass CFG;\nclass CFGBlock;\nclass ParentMap;\nclass Stmt;\n\nclass CFGStmtMap {\n ParentMap *PM;\n void *M;\n \n CFGStmtMap(ParentMap *pm, void *m) : PM(pm), M(m) {}\n \npublic:\n ~CFGStmtMap();\n \n /// Returns a new CFGMap for the given CFG. It is the caller's\n /// responsibility to 'delete' this object when done using it.\n static CFGStmtMap *Build(CFG* C, ParentMap *PM);\n\n /// Returns the CFGBlock the specified Stmt* appears in. For Stmt* that\n /// are terminators, the CFGBlock is the block they appear as a terminator,\n /// and not the block they appear as a block-level expression (e.g, '&&').\n /// CaseStmts and LabelStmts map to the CFGBlock they label.\n CFGBlock *getBlock(Stmt * S);\n\n const CFGBlock *getBlock(const Stmt * S) const {\n return const_cast(this)->getBlock(const_cast(S));\n }\n};\n\n} // end clang namespace\n#endif\n"} {"text": "/*\n * ct_actions_help.cc\n *\n * Copyright 2009-2020\n * Giuseppe Penone \n * Evgenii Gurianov \n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n * MA 02110-1301, USA.\n */\n\n#include \"ct_actions.h\"\n#include \n\nvoid CtActions::online_help()\n{\n fs::open_weblink(\"https://giuspen.com/cherrytreemanual/\");\n}\n\nvoid CtActions::dialog_about()\n{\n CtDialogs::dialog_about(*_pCtMainWin, _pCtMainWin->get_icon_theme()->load_icon(CtConst::APP_NAME, 128));\n}\n\nvoid CtActions::folder_cfg_open()\n{\n fs::open_folderpath(Glib::get_user_config_dir() / fs::path(CtConst::APP_NAME), _pCtMainWin->get_ct_config());\n}\n\nvoid CtActions::check_for_newer_version()\n{\n auto& statusbar = _pCtMainWin->get_status_bar();\n statusbar.update_status(_(\"Checking for Newer Version...\"));\n while (gtk_events_pending()) gtk_main_iteration();\n\n std::string latest_version_from_server = str::trim(fs::download_file(\"https://www.giuspen.com/software/version_cherrytree\"));\n //g_print(\"v='%s'\\n\", latest_version_from_server.c_str());\n if (latest_version_from_server.empty() or latest_version_from_server.size() > 10) {\n statusbar.update_status(_(\"Failed to Retrieve Latest Version Information - Try Again Later\"));\n }\n else {\n std::vector splitted_latest_v = CtStrUtil::gstring_split_to_int64(latest_version_from_server.c_str(), \".\");\n std::vector splitted_local_v = CtStrUtil::gstring_split_to_int64(PACKAGE_VERSION, \".\");\n if (splitted_latest_v.size() != 3 or splitted_local_v.size() != 3) {\n g_critical(\"unexpected versions %s, %s\", latest_version_from_server.c_str(), PACKAGE_VERSION);\n }\n else {\n gint64 weighted_latest_v = splitted_latest_v[0]*10000 + splitted_latest_v[1]*100 + splitted_latest_v[2];\n gint64 weighted_local_v = splitted_local_v[0]*10000 + splitted_local_v[1]*100 + splitted_local_v[2];\n if (weighted_latest_v > weighted_local_v) {\n CtDialogs::info_dialog(Glib::ustring{_(\"A Newer Version Is Available!\")} + \" (\" + latest_version_from_server + \")\", *_pCtMainWin);\n _pCtMainWin->update_selected_node_statusbar_info();\n }\n else {\n if (weighted_latest_v == weighted_local_v) {\n statusbar.update_status(Glib::ustring{_(\"You Are Using the Latest Version Available\")} + \" (\" + latest_version_from_server + \")\");\n }\n else {\n statusbar.update_status(_(\"You Are Using a Development Version\"));\n }\n }\n }\n }\n}\n"} {"text": ".class public final Lc/a/e/t;\n.super Ljava/lang/Object;\n.source \"\"\n\n\n# annotations\n.annotation system Ldalvik/annotation/MemberClasses;\n value = {\n Lc/a/e/t$c;,\n Lc/a/e/t$a;,\n Lc/a/e/t$b;\n }\n.end annotation\n\n\n# instance fields\n.field a:J\n\n.field b:J\n\n.field final c:I\n\n.field final d:Lc/a/e/n;\n\n.field private final e:Ljava/util/List;\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"Ljava/util/List<\",\n \"Lc/a/e/c;\",\n \">;\"\n }\n .end annotation\n.end field\n\n.field private f:Ljava/util/List;\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"Ljava/util/List<\",\n \"Lc/a/e/c;\",\n \">;\"\n }\n .end annotation\n.end field\n\n.field private final g:Lc/a/e/t$b;\n\n.field final h:Lc/a/e/t$a;\n\n.field final i:Lc/a/e/t$c;\n\n.field final j:Lc/a/e/t$c;\n\n.field k:Lc/a/e/b;\n\n\n# direct methods\n.method constructor (ILc/a/e/n;ZZLjava/util/List;)V\n .locals 2\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"(I\",\n \"Lc/a/e/n;\",\n \"ZZ\",\n \"Ljava/util/List<\",\n \"Lc/a/e/c;\",\n \">;)V\"\n }\n .end annotation\n\n invoke-direct {p0}, Ljava/lang/Object;->()V\n\n const-wide/16 v0, 0x0\n\n iput-wide v0, p0, Lc/a/e/t;->a:J\n\n new-instance v0, Lc/a/e/t$c;\n\n invoke-direct {v0, p0}, Lc/a/e/t$c;->(Lc/a/e/t;)V\n\n iput-object v0, p0, Lc/a/e/t;->i:Lc/a/e/t$c;\n\n new-instance v0, Lc/a/e/t$c;\n\n invoke-direct {v0, p0}, Lc/a/e/t$c;->(Lc/a/e/t;)V\n\n iput-object v0, p0, Lc/a/e/t;->j:Lc/a/e/t$c;\n\n const/4 v0, 0x0\n\n iput-object v0, p0, Lc/a/e/t;->k:Lc/a/e/b;\n\n if-eqz p2, :cond_1\n\n if-eqz p5, :cond_0\n\n iput p1, p0, Lc/a/e/t;->c:I\n\n iput-object p2, p0, Lc/a/e/t;->d:Lc/a/e/n;\n\n iget-object p1, p2, Lc/a/e/n;->p:Lc/a/e/z;\n\n invoke-virtual {p1}, Lc/a/e/z;->c()I\n\n move-result p1\n\n int-to-long v0, p1\n\n iput-wide v0, p0, Lc/a/e/t;->b:J\n\n new-instance p1, Lc/a/e/t$b;\n\n iget-object p2, p2, Lc/a/e/n;->o:Lc/a/e/z;\n\n invoke-virtual {p2}, Lc/a/e/z;->c()I\n\n move-result p2\n\n int-to-long v0, p2\n\n invoke-direct {p1, p0, v0, v1}, Lc/a/e/t$b;->(Lc/a/e/t;J)V\n\n iput-object p1, p0, Lc/a/e/t;->g:Lc/a/e/t$b;\n\n new-instance p1, Lc/a/e/t$a;\n\n invoke-direct {p1, p0}, Lc/a/e/t$a;->(Lc/a/e/t;)V\n\n iput-object p1, p0, Lc/a/e/t;->h:Lc/a/e/t$a;\n\n iget-object p1, p0, Lc/a/e/t;->g:Lc/a/e/t$b;\n\n iput-boolean p4, p1, Lc/a/e/t$b;->e:Z\n\n iget-object p1, p0, Lc/a/e/t;->h:Lc/a/e/t$a;\n\n iput-boolean p3, p1, Lc/a/e/t$a;->c:Z\n\n iput-object p5, p0, Lc/a/e/t;->e:Ljava/util/List;\n\n return-void\n\n :cond_0\n new-instance p1, Ljava/lang/NullPointerException;\n\n const-string p2, \"requestHeaders == null\"\n\n invoke-direct {p1, p2}, Ljava/lang/NullPointerException;->(Ljava/lang/String;)V\n\n throw p1\n\n :cond_1\n new-instance p1, Ljava/lang/NullPointerException;\n\n const-string p2, \"connection == null\"\n\n invoke-direct {p1, p2}, Ljava/lang/NullPointerException;->(Ljava/lang/String;)V\n\n throw p1\n.end method\n\n.method private d(Lc/a/e/b;)Z\n .locals 2\n\n monitor-enter p0\n\n :try_start_0\n iget-object v0, p0, Lc/a/e/t;->k:Lc/a/e/b;\n\n const/4 v1, 0x0\n\n if-eqz v0, :cond_0\n\n monitor-exit p0\n\n return v1\n\n :cond_0\n iget-object v0, p0, Lc/a/e/t;->g:Lc/a/e/t$b;\n\n iget-boolean v0, v0, Lc/a/e/t$b;->e:Z\n\n if-eqz v0, :cond_1\n\n iget-object v0, p0, Lc/a/e/t;->h:Lc/a/e/t$a;\n\n iget-boolean v0, v0, Lc/a/e/t$a;->c:Z\n\n if-eqz v0, :cond_1\n\n monitor-exit p0\n\n return v1\n\n :cond_1\n iput-object p1, p0, Lc/a/e/t;->k:Lc/a/e/b;\n\n invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V\n\n monitor-exit p0\n :try_end_0\n .catchall {:try_start_0 .. :try_end_0} :catchall_0\n\n iget-object p1, p0, Lc/a/e/t;->d:Lc/a/e/n;\n\n iget v0, p0, Lc/a/e/t;->c:I\n\n invoke-virtual {p1, v0}, Lc/a/e/n;->d(I)Lc/a/e/t;\n\n const/4 p1, 0x1\n\n return p1\n\n :catchall_0\n move-exception p1\n\n :try_start_1\n monitor-exit p0\n :try_end_1\n .catchall {:try_start_1 .. :try_end_1} :catchall_0\n\n throw p1\n.end method\n\n\n# virtual methods\n.method a()V\n .locals 2\n\n monitor-enter p0\n\n :try_start_0\n iget-object v0, p0, Lc/a/e/t;->g:Lc/a/e/t$b;\n\n iget-boolean v0, v0, Lc/a/e/t$b;->e:Z\n\n if-nez v0, :cond_1\n\n iget-object v0, p0, Lc/a/e/t;->g:Lc/a/e/t$b;\n\n iget-boolean v0, v0, Lc/a/e/t$b;->d:Z\n\n if-eqz v0, :cond_1\n\n iget-object v0, p0, Lc/a/e/t;->h:Lc/a/e/t$a;\n\n iget-boolean v0, v0, Lc/a/e/t$a;->c:Z\n\n if-nez v0, :cond_0\n\n iget-object v0, p0, Lc/a/e/t;->h:Lc/a/e/t$a;\n\n iget-boolean v0, v0, Lc/a/e/t$a;->b:Z\n\n if-eqz v0, :cond_1\n\n :cond_0\n const/4 v0, 0x1\n\n goto :goto_0\n\n :cond_1\n const/4 v0, 0x0\n\n :goto_0\n invoke-virtual {p0}, Lc/a/e/t;->h()Z\n\n move-result v1\n\n monitor-exit p0\n :try_end_0\n .catchall {:try_start_0 .. :try_end_0} :catchall_0\n\n if-eqz v0, :cond_2\n\n sget-object v0, Lc/a/e/b;->f:Lc/a/e/b;\n\n invoke-virtual {p0, v0}, Lc/a/e/t;->a(Lc/a/e/b;)V\n\n goto :goto_1\n\n :cond_2\n if-nez v1, :cond_3\n\n iget-object v0, p0, Lc/a/e/t;->d:Lc/a/e/n;\n\n iget v1, p0, Lc/a/e/t;->c:I\n\n invoke-virtual {v0, v1}, Lc/a/e/n;->d(I)Lc/a/e/t;\n\n :cond_3\n :goto_1\n return-void\n\n :catchall_0\n move-exception v0\n\n :try_start_1\n monitor-exit p0\n :try_end_1\n .catchall {:try_start_1 .. :try_end_1} :catchall_0\n\n throw v0\n.end method\n\n.method a(J)V\n .locals 3\n\n iget-wide v0, p0, Lc/a/e/t;->b:J\n\n add-long/2addr v0, p1\n\n iput-wide v0, p0, Lc/a/e/t;->b:J\n\n const-wide/16 v0, 0x0\n\n cmp-long v2, p1, v0\n\n if-lez v2, :cond_0\n\n invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V\n\n :cond_0\n return-void\n.end method\n\n.method public a(Lc/a/e/b;)V\n .locals 2\n\n invoke-direct {p0, p1}, Lc/a/e/t;->d(Lc/a/e/b;)Z\n\n move-result v0\n\n if-nez v0, :cond_0\n\n return-void\n\n :cond_0\n iget-object v0, p0, Lc/a/e/t;->d:Lc/a/e/n;\n\n iget v1, p0, Lc/a/e/t;->c:I\n\n invoke-virtual {v0, v1, p1}, Lc/a/e/n;->b(ILc/a/e/b;)V\n\n return-void\n.end method\n\n.method a(Ld/g;I)V\n .locals 3\n\n iget-object v0, p0, Lc/a/e/t;->g:Lc/a/e/t$b;\n\n int-to-long v1, p2\n\n invoke-virtual {v0, p1, v1, v2}, Lc/a/e/t$b;->a(Ld/g;J)V\n\n return-void\n.end method\n\n.method a(Ljava/util/List;)V\n .locals 3\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"(\",\n \"Ljava/util/List<\",\n \"Lc/a/e/c;\",\n \">;)V\"\n }\n .end annotation\n\n const/4 v0, 0x1\n\n monitor-enter p0\n\n :try_start_0\n iget-object v1, p0, Lc/a/e/t;->f:Ljava/util/List;\n\n if-nez v1, :cond_0\n\n iput-object p1, p0, Lc/a/e/t;->f:Ljava/util/List;\n\n invoke-virtual {p0}, Lc/a/e/t;->h()Z\n\n move-result v0\n\n invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V\n\n goto :goto_0\n\n :cond_0\n new-instance v1, Ljava/util/ArrayList;\n\n invoke-direct {v1}, Ljava/util/ArrayList;->()V\n\n iget-object v2, p0, Lc/a/e/t;->f:Ljava/util/List;\n\n invoke-interface {v1, v2}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z\n\n invoke-interface {v1, p1}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z\n\n iput-object v1, p0, Lc/a/e/t;->f:Ljava/util/List;\n\n :goto_0\n monitor-exit p0\n :try_end_0\n .catchall {:try_start_0 .. :try_end_0} :catchall_0\n\n if-nez v0, :cond_1\n\n iget-object p1, p0, Lc/a/e/t;->d:Lc/a/e/n;\n\n iget v0, p0, Lc/a/e/t;->c:I\n\n invoke-virtual {p1, v0}, Lc/a/e/n;->d(I)Lc/a/e/t;\n\n :cond_1\n return-void\n\n :catchall_0\n move-exception p1\n\n :try_start_1\n monitor-exit p0\n :try_end_1\n .catchall {:try_start_1 .. :try_end_1} :catchall_0\n\n throw p1\n.end method\n\n.method b()V\n .locals 2\n\n iget-object v0, p0, Lc/a/e/t;->h:Lc/a/e/t$a;\n\n iget-boolean v1, v0, Lc/a/e/t$a;->b:Z\n\n if-nez v1, :cond_2\n\n iget-boolean v0, v0, Lc/a/e/t$a;->c:Z\n\n if-nez v0, :cond_1\n\n iget-object v0, p0, Lc/a/e/t;->k:Lc/a/e/b;\n\n if-nez v0, :cond_0\n\n return-void\n\n :cond_0\n new-instance v1, Lc/a/e/A;\n\n invoke-direct {v1, v0}, Lc/a/e/A;->(Lc/a/e/b;)V\n\n throw v1\n\n :cond_1\n new-instance v0, Ljava/io/IOException;\n\n const-string v1, \"stream finished\"\n\n invoke-direct {v0, v1}, Ljava/io/IOException;->(Ljava/lang/String;)V\n\n throw v0\n\n :cond_2\n new-instance v0, Ljava/io/IOException;\n\n const-string v1, \"stream closed\"\n\n invoke-direct {v0, v1}, Ljava/io/IOException;->(Ljava/lang/String;)V\n\n throw v0\n.end method\n\n.method public b(Lc/a/e/b;)V\n .locals 2\n\n invoke-direct {p0, p1}, Lc/a/e/t;->d(Lc/a/e/b;)Z\n\n move-result v0\n\n if-nez v0, :cond_0\n\n return-void\n\n :cond_0\n iget-object v0, p0, Lc/a/e/t;->d:Lc/a/e/n;\n\n iget v1, p0, Lc/a/e/t;->c:I\n\n invoke-virtual {v0, v1, p1}, Lc/a/e/n;->c(ILc/a/e/b;)V\n\n return-void\n.end method\n\n.method public c()I\n .locals 1\n\n iget v0, p0, Lc/a/e/t;->c:I\n\n return v0\n.end method\n\n.method declared-synchronized c(Lc/a/e/b;)V\n .locals 1\n\n monitor-enter p0\n\n :try_start_0\n iget-object v0, p0, Lc/a/e/t;->k:Lc/a/e/b;\n\n if-nez v0, :cond_0\n\n iput-object p1, p0, Lc/a/e/t;->k:Lc/a/e/b;\n\n invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V\n :try_end_0\n .catchall {:try_start_0 .. :try_end_0} :catchall_0\n\n :cond_0\n monitor-exit p0\n\n return-void\n\n :catchall_0\n move-exception p1\n\n monitor-exit p0\n\n throw p1\n.end method\n\n.method public declared-synchronized d()Ljava/util/List;\n .locals 2\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"()\",\n \"Ljava/util/List<\",\n \"Lc/a/e/c;\",\n \">;\"\n }\n .end annotation\n\n monitor-enter p0\n\n :try_start_0\n iget-object v0, p0, Lc/a/e/t;->i:Lc/a/e/t$c;\n\n invoke-virtual {v0}, Ld/c;->i()V\n :try_end_0\n .catchall {:try_start_0 .. :try_end_0} :catchall_1\n\n :goto_0\n :try_start_1\n iget-object v0, p0, Lc/a/e/t;->f:Ljava/util/List;\n\n if-nez v0, :cond_0\n\n iget-object v0, p0, Lc/a/e/t;->k:Lc/a/e/b;\n\n if-nez v0, :cond_0\n\n invoke-virtual {p0}, Lc/a/e/t;->k()V\n :try_end_1\n .catchall {:try_start_1 .. :try_end_1} :catchall_0\n\n goto :goto_0\n\n :cond_0\n :try_start_2\n iget-object v0, p0, Lc/a/e/t;->i:Lc/a/e/t$c;\n\n invoke-virtual {v0}, Lc/a/e/t$c;->l()V\n\n iget-object v0, p0, Lc/a/e/t;->f:Ljava/util/List;\n\n if-eqz v0, :cond_1\n\n iget-object v0, p0, Lc/a/e/t;->f:Ljava/util/List;\n :try_end_2\n .catchall {:try_start_2 .. :try_end_2} :catchall_1\n\n monitor-exit p0\n\n return-object v0\n\n :cond_1\n :try_start_3\n new-instance v0, Lc/a/e/A;\n\n iget-object v1, p0, Lc/a/e/t;->k:Lc/a/e/b;\n\n invoke-direct {v0, v1}, Lc/a/e/A;->(Lc/a/e/b;)V\n\n throw v0\n\n :catchall_0\n move-exception v0\n\n iget-object v1, p0, Lc/a/e/t;->i:Lc/a/e/t$c;\n\n invoke-virtual {v1}, Lc/a/e/t$c;->l()V\n\n throw v0\n :try_end_3\n .catchall {:try_start_3 .. :try_end_3} :catchall_1\n\n :catchall_1\n move-exception v0\n\n monitor-exit p0\n\n goto :goto_2\n\n :goto_1\n throw v0\n\n :goto_2\n goto :goto_1\n.end method\n\n.method public e()Ld/v;\n .locals 2\n\n monitor-enter p0\n\n :try_start_0\n iget-object v0, p0, Lc/a/e/t;->f:Ljava/util/List;\n\n if-nez v0, :cond_1\n\n invoke-virtual {p0}, Lc/a/e/t;->g()Z\n\n move-result v0\n\n if-eqz v0, :cond_0\n\n goto :goto_0\n\n :cond_0\n new-instance v0, Ljava/lang/IllegalStateException;\n\n const-string v1, \"reply before requesting the sink\"\n\n invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V\n\n throw v0\n\n :cond_1\n :goto_0\n monitor-exit p0\n :try_end_0\n .catchall {:try_start_0 .. :try_end_0} :catchall_0\n\n iget-object v0, p0, Lc/a/e/t;->h:Lc/a/e/t$a;\n\n return-object v0\n\n :catchall_0\n move-exception v0\n\n :try_start_1\n monitor-exit p0\n :try_end_1\n .catchall {:try_start_1 .. :try_end_1} :catchall_0\n\n throw v0\n.end method\n\n.method public f()Ld/w;\n .locals 1\n\n iget-object v0, p0, Lc/a/e/t;->g:Lc/a/e/t$b;\n\n return-object v0\n.end method\n\n.method public g()Z\n .locals 4\n\n iget v0, p0, Lc/a/e/t;->c:I\n\n const/4 v1, 0x1\n\n and-int/2addr v0, v1\n\n const/4 v2, 0x0\n\n if-ne v0, v1, :cond_0\n\n const/4 v0, 0x1\n\n goto :goto_0\n\n :cond_0\n const/4 v0, 0x0\n\n :goto_0\n iget-object v3, p0, Lc/a/e/t;->d:Lc/a/e/n;\n\n iget-boolean v3, v3, Lc/a/e/n;->b:Z\n\n if-ne v3, v0, :cond_1\n\n goto :goto_1\n\n :cond_1\n const/4 v1, 0x0\n\n :goto_1\n return v1\n.end method\n\n.method public declared-synchronized h()Z\n .locals 2\n\n monitor-enter p0\n\n :try_start_0\n iget-object v0, p0, Lc/a/e/t;->k:Lc/a/e/b;\n :try_end_0\n .catchall {:try_start_0 .. :try_end_0} :catchall_0\n\n const/4 v1, 0x0\n\n if-eqz v0, :cond_0\n\n monitor-exit p0\n\n return v1\n\n :cond_0\n :try_start_1\n iget-object v0, p0, Lc/a/e/t;->g:Lc/a/e/t$b;\n\n iget-boolean v0, v0, Lc/a/e/t$b;->e:Z\n\n if-nez v0, :cond_1\n\n iget-object v0, p0, Lc/a/e/t;->g:Lc/a/e/t$b;\n\n iget-boolean v0, v0, Lc/a/e/t$b;->d:Z\n\n if-eqz v0, :cond_3\n\n :cond_1\n iget-object v0, p0, Lc/a/e/t;->h:Lc/a/e/t$a;\n\n iget-boolean v0, v0, Lc/a/e/t$a;->c:Z\n\n if-nez v0, :cond_2\n\n iget-object v0, p0, Lc/a/e/t;->h:Lc/a/e/t$a;\n\n iget-boolean v0, v0, Lc/a/e/t$a;->b:Z\n\n if-eqz v0, :cond_3\n\n :cond_2\n iget-object v0, p0, Lc/a/e/t;->f:Ljava/util/List;\n :try_end_1\n .catchall {:try_start_1 .. :try_end_1} :catchall_0\n\n if-eqz v0, :cond_3\n\n monitor-exit p0\n\n return v1\n\n :cond_3\n const/4 v0, 0x1\n\n monitor-exit p0\n\n return v0\n\n :catchall_0\n move-exception v0\n\n monitor-exit p0\n\n throw v0\n.end method\n\n.method public i()Ld/y;\n .locals 1\n\n iget-object v0, p0, Lc/a/e/t;->i:Lc/a/e/t$c;\n\n return-object v0\n.end method\n\n.method j()V\n .locals 2\n\n monitor-enter p0\n\n :try_start_0\n iget-object v0, p0, Lc/a/e/t;->g:Lc/a/e/t$b;\n\n const/4 v1, 0x1\n\n iput-boolean v1, v0, Lc/a/e/t$b;->e:Z\n\n invoke-virtual {p0}, Lc/a/e/t;->h()Z\n\n move-result v0\n\n invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V\n\n monitor-exit p0\n :try_end_0\n .catchall {:try_start_0 .. :try_end_0} :catchall_0\n\n if-nez v0, :cond_0\n\n iget-object v0, p0, Lc/a/e/t;->d:Lc/a/e/n;\n\n iget v1, p0, Lc/a/e/t;->c:I\n\n invoke-virtual {v0, v1}, Lc/a/e/n;->d(I)Lc/a/e/t;\n\n :cond_0\n return-void\n\n :catchall_0\n move-exception v0\n\n :try_start_1\n monitor-exit p0\n :try_end_1\n .catchall {:try_start_1 .. :try_end_1} :catchall_0\n\n throw v0\n.end method\n\n.method k()V\n .locals 1\n\n :try_start_0\n invoke-virtual {p0}, Ljava/lang/Object;->wait()V\n :try_end_0\n .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0\n\n return-void\n\n :catch_0\n new-instance v0, Ljava/io/InterruptedIOException;\n\n invoke-direct {v0}, Ljava/io/InterruptedIOException;->()V\n\n throw v0\n.end method\n\n.method public l()Ld/y;\n .locals 1\n\n iget-object v0, p0, Lc/a/e/t;->j:Lc/a/e/t$c;\n\n return-object v0\n.end method\n"} {"text": " clang_lang -> bool\n\ntype translation_unit_context =\n { lang: clang_lang\n ; source_file: SourceFile.t\n ; integer_type_widths: Typ.IntegerWidths.t\n ; is_objc_arc_on: bool }\n\ntype decl_trans_context = [`DeclTraversal | `Translation | `CppLambdaExprTranslation]\n\n(** Constants *)\n\nval alloc : string\n\nval arrayWithObjects_count : string\n\nval dictionaryWithObjects_forKeys_count : string\n\nval dealloc : string\n\nval assert_fail : string\n\nval assert_rtn : string\n\nval biniou_buffer_size : int\n\nval builtin_expect : string\n\nval builtin_memset_chk : string\n\nval builtin_object_size : string\n\nval ckcomponent_cl : string\n\nval ckcomponentcontroller_cl : string\n\nval clang_bin : string -> string\n(** Script to run our own clang. The argument is expected to be either \"\" or \"++\". *)\n\nval class_method : string\n\nval fbAssertWithSignalAndLogFunctionHelper : string\n\nval google_LogMessageFatal : string\n\nval google_MakeCheckOpString : string\n\nval handleFailureInFunction : string\n\nval handleFailureInMethod : string\n\nval id_cl : string\n\nval infer : string\n\nval init : string\n\nval is_kind_of_class : string\n\nval malloc : string\n\nval new_str : string\n\nval next_object : string\n\nval nsenumerator_cl : string\n\nval nsproxy_cl : string\n\nval nsobject_cl : string\n\nval nsstring_cl : string\n\nval objc_class : string\n\nval objc_object : string\n\nval object_enumerator : string\n\nval return_param : string\n\nval self : string\n\nval std_addressof : QualifiedCppName.Match.quals_matcher\n\nval string_with_utf8_m : string\n\nval this : string\n\nval replace_with_deref_first_arg_attr : string\n\nval modeled_function_attributes : string list\n\n(** Global state *)\n\nval enum_map : (Clang_ast_t.pointer option * Exp.t option) ClangPointers.Map.t ref\n(** Map from enum constants pointers to their predecesor and their sil value *)\n\nval global_translation_unit_decls : Clang_ast_t.decl list ref\n\nval sil_types_map : Typ.desc Clang_ast_extend.TypePointerMap.t ref\n(** Map from type pointers (clang pointers and types created later by frontend) to sil types\n Populated during frontend execution when new type is found *)\n\nval procedures_attempted : int ref\n\nval procedures_failed : int ref\n\nval get_fresh_block_index : unit -> int\n\nval reset_block_counter : unit -> unit\n\nval reset_global_state : unit -> unit\n"} {"text": "\n\n \n \n \n"} {"text": "CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/React-Core\nGCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1\nHEADER_SEARCH_PATHS = $(inherited) \"${PODS_ROOT}/Headers/Private\" \"${PODS_ROOT}/Headers/Private/React-Core\" \"${PODS_ROOT}/Headers/Public\" \"${PODS_ROOT}/Headers/Public/DoubleConversion\" \"${PODS_ROOT}/Headers/Public/React-Core\" \"${PODS_ROOT}/Headers/Public/React-cxxreact\" \"${PODS_ROOT}/Headers/Public/React-jsi\" \"${PODS_ROOT}/Headers/Public/React-jsiexecutor\" \"${PODS_ROOT}/Headers/Public/React-jsinspector\" \"${PODS_ROOT}/Headers/Public/glog\" \"${PODS_ROOT}/Headers/Public/yoga\" \"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Folly\"\nPODS_BUILD_DIR = ${BUILD_DIR}\nPODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\nPODS_ROOT = ${SRCROOT}\nPODS_TARGET_SRCROOT = ${PODS_ROOT}/../../node_modules/react-native/React\nPRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}\nSKIP_INSTALL = YES\n"} {"text": "var common = require('../common');\nvar MultipartParserStub = GENTLY.stub('./multipart_parser', 'MultipartParser'),\n QuerystringParserStub = GENTLY.stub('./querystring_parser', 'QuerystringParser'),\n EventEmitterStub = GENTLY.stub('events', 'EventEmitter'),\n StreamStub = GENTLY.stub('stream', 'Stream'),\n FileStub = GENTLY.stub('./file');\n\nvar formidable = require(common.lib + '/index'),\n IncomingForm = formidable.IncomingForm,\n events = require('events'),\n fs = require('fs'),\n path = require('path'),\n Buffer = require('buffer').Buffer,\n fixtures = require(TEST_FIXTURES + '/multipart'),\n form,\n gently;\n\nfunction test(test) {\n gently = new Gently();\n gently.expect(EventEmitterStub, 'call');\n form = new IncomingForm();\n test();\n gently.verify(test.name);\n}\n\ntest(function constructor() {\n assert.strictEqual(form.error, null);\n assert.strictEqual(form.ended, false);\n assert.strictEqual(form.type, null);\n assert.strictEqual(form.headers, null);\n assert.strictEqual(form.keepExtensions, false);\n assert.strictEqual(form.uploadDir, '/tmp');\n assert.strictEqual(form.encoding, 'utf-8');\n assert.strictEqual(form.bytesReceived, null);\n assert.strictEqual(form.bytesExpected, null);\n assert.strictEqual(form.maxFieldsSize, 2 * 1024 * 1024);\n assert.strictEqual(form._parser, null);\n assert.strictEqual(form._flushing, 0);\n assert.strictEqual(form._fieldsSize, 0);\n assert.ok(form instanceof EventEmitterStub);\n assert.equal(form.constructor.name, 'IncomingForm');\n\n (function testSimpleConstructor() {\n gently.expect(EventEmitterStub, 'call');\n var form = IncomingForm();\n assert.ok(form instanceof IncomingForm);\n })();\n\n (function testSimpleConstructorShortcut() {\n gently.expect(EventEmitterStub, 'call');\n var form = formidable();\n assert.ok(form instanceof IncomingForm);\n })();\n});\n\ntest(function parse() {\n var REQ = {headers: {}}\n , emit = {};\n\n gently.expect(form, 'writeHeaders', function(headers) {\n assert.strictEqual(headers, REQ.headers);\n });\n\n var events = ['error', 'aborted', 'data', 'end'];\n gently.expect(REQ, 'on', events.length, function(event, fn) {\n assert.equal(event, events.shift());\n emit[event] = fn;\n return this;\n });\n\n form.parse(REQ);\n\n (function testPause() {\n gently.expect(REQ, 'pause');\n assert.strictEqual(form.pause(), true);\n })();\n\n (function testPauseCriticalException() {\n form.ended = false;\n\n var ERR = new Error('dasdsa');\n gently.expect(REQ, 'pause', function() {\n throw ERR;\n });\n\n gently.expect(form, '_error', function(err) {\n assert.strictEqual(err, ERR);\n });\n\n assert.strictEqual(form.pause(), false);\n })();\n\n (function testPauseHarmlessException() {\n form.ended = true;\n\n var ERR = new Error('dasdsa');\n gently.expect(REQ, 'pause', function() {\n throw ERR;\n });\n\n assert.strictEqual(form.pause(), false);\n })();\n\n (function testResume() {\n gently.expect(REQ, 'resume');\n assert.strictEqual(form.resume(), true);\n })();\n\n (function testResumeCriticalException() {\n form.ended = false;\n\n var ERR = new Error('dasdsa');\n gently.expect(REQ, 'resume', function() {\n throw ERR;\n });\n\n gently.expect(form, '_error', function(err) {\n assert.strictEqual(err, ERR);\n });\n\n assert.strictEqual(form.resume(), false);\n })();\n\n (function testResumeHarmlessException() {\n form.ended = true;\n\n var ERR = new Error('dasdsa');\n gently.expect(REQ, 'resume', function() {\n throw ERR;\n });\n\n assert.strictEqual(form.resume(), false);\n })();\n\n (function testEmitError() {\n var ERR = new Error('something bad happened');\n gently.expect(form, '_error',function(err) {\n assert.strictEqual(err, ERR);\n });\n emit.error(ERR);\n })();\n\n (function testEmitAborted() {\n gently.expect(form, 'emit',function(event) {\n assert.equal(event, 'aborted');\n });\n\n emit.aborted();\n })();\n\n\n (function testEmitData() {\n var BUFFER = [1, 2, 3];\n gently.expect(form, 'write', function(buffer) {\n assert.strictEqual(buffer, BUFFER);\n });\n emit.data(BUFFER);\n })();\n\n (function testEmitEnd() {\n form._parser = {};\n\n (function testWithError() {\n var ERR = new Error('haha');\n gently.expect(form._parser, 'end', function() {\n return ERR;\n });\n\n gently.expect(form, '_error', function(err) {\n assert.strictEqual(err, ERR);\n });\n\n emit.end();\n })();\n\n (function testWithoutError() {\n gently.expect(form._parser, 'end');\n emit.end();\n })();\n\n (function testAfterError() {\n form.error = true;\n emit.end();\n })();\n })();\n\n (function testWithCallback() {\n gently.expect(EventEmitterStub, 'call');\n var form = new IncomingForm(),\n REQ = {headers: {}},\n parseCalled = 0;\n\n gently.expect(form, 'writeHeaders');\n gently.expect(REQ, 'on', 4, function() {\n return this;\n });\n\n gently.expect(form, 'on', 4, function(event, fn) {\n if (event == 'field') {\n fn('field1', 'foo');\n fn('field1', 'bar');\n fn('field2', 'nice');\n }\n\n if (event == 'file') {\n fn('file1', '1');\n fn('file1', '2');\n fn('file2', '3');\n }\n\n if (event == 'end') {\n fn();\n }\n return this;\n });\n\n form.parse(REQ, gently.expect(function parseCbOk(err, fields, files) {\n assert.deepEqual(fields, {field1: 'bar', field2: 'nice'});\n assert.deepEqual(files, {file1: '2', file2: '3'});\n }));\n\n gently.expect(form, 'writeHeaders');\n gently.expect(REQ, 'on', 4, function() {\n return this;\n });\n\n var ERR = new Error('test');\n gently.expect(form, 'on', 3, function(event, fn) {\n if (event == 'field') {\n fn('foo', 'bar');\n }\n\n if (event == 'error') {\n fn(ERR);\n gently.expect(form, 'on');\n }\n return this;\n });\n\n form.parse(REQ, gently.expect(function parseCbErr(err, fields, files) {\n assert.strictEqual(err, ERR);\n assert.deepEqual(fields, {foo: 'bar'});\n }));\n })();\n});\n\ntest(function pause() {\n assert.strictEqual(form.pause(), false);\n});\n\ntest(function resume() {\n assert.strictEqual(form.resume(), false);\n});\n\n\ntest(function writeHeaders() {\n var HEADERS = {};\n gently.expect(form, '_parseContentLength');\n gently.expect(form, '_parseContentType');\n\n form.writeHeaders(HEADERS);\n assert.strictEqual(form.headers, HEADERS);\n});\n\ntest(function write() {\n var parser = {},\n BUFFER = [1, 2, 3];\n\n form._parser = parser;\n form.bytesExpected = 523423;\n\n (function testBasic() {\n gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) {\n assert.equal(event, 'progress');\n assert.equal(bytesReceived, BUFFER.length);\n assert.equal(bytesExpected, form.bytesExpected);\n });\n\n gently.expect(parser, 'write', function(buffer) {\n assert.strictEqual(buffer, BUFFER);\n return buffer.length;\n });\n\n assert.equal(form.write(BUFFER), BUFFER.length);\n assert.equal(form.bytesReceived, BUFFER.length);\n })();\n\n (function testParserError() {\n gently.expect(form, 'emit');\n\n gently.expect(parser, 'write', function(buffer) {\n assert.strictEqual(buffer, BUFFER);\n return buffer.length - 1;\n });\n\n gently.expect(form, '_error', function(err) {\n assert.ok(err.message.match(/parser error/i));\n });\n\n assert.equal(form.write(BUFFER), BUFFER.length - 1);\n assert.equal(form.bytesReceived, BUFFER.length + BUFFER.length);\n })();\n\n (function testUninitialized() {\n delete form._parser;\n\n gently.expect(form, '_error', function(err) {\n assert.ok(err.message.match(/unintialized parser/i));\n });\n form.write(BUFFER);\n })();\n});\n\ntest(function parseContentType() {\n var HEADERS = {};\n\n form.headers = {'content-type': 'application/x-www-form-urlencoded'};\n gently.expect(form, '_initUrlencoded');\n form._parseContentType();\n\n // accept anything that has 'urlencoded' in it\n form.headers = {'content-type': 'broken-client/urlencoded-stupid'};\n gently.expect(form, '_initUrlencoded');\n form._parseContentType();\n\n var BOUNDARY = '---------------------------57814261102167618332366269';\n form.headers = {'content-type': 'multipart/form-data; boundary='+BOUNDARY};\n\n gently.expect(form, '_initMultipart', function(boundary) {\n assert.equal(boundary, BOUNDARY);\n });\n form._parseContentType();\n\n (function testQuotedBoundary() {\n form.headers = {'content-type': 'multipart/form-data; boundary=\"' + BOUNDARY + '\"'};\n\n gently.expect(form, '_initMultipart', function(boundary) {\n assert.equal(boundary, BOUNDARY);\n });\n form._parseContentType();\n })();\n\n (function testNoBoundary() {\n form.headers = {'content-type': 'multipart/form-data'};\n\n gently.expect(form, '_error', function(err) {\n assert.ok(err.message.match(/no multipart boundary/i));\n });\n form._parseContentType();\n })();\n\n (function testNoContentType() {\n form.headers = {};\n\n gently.expect(form, '_error', function(err) {\n assert.ok(err.message.match(/no content-type/i));\n });\n form._parseContentType();\n })();\n\n (function testUnknownContentType() {\n form.headers = {'content-type': 'invalid'};\n\n gently.expect(form, '_error', function(err) {\n assert.ok(err.message.match(/unknown content-type/i));\n });\n form._parseContentType();\n })();\n});\n\ntest(function parseContentLength() {\n var HEADERS = {};\n\n form.headers = {};\n form._parseContentLength();\n assert.strictEqual(form.bytesReceived, null);\n assert.strictEqual(form.bytesExpected, null);\n\n form.headers['content-length'] = '8';\n gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) {\n assert.equal(event, 'progress');\n assert.equal(bytesReceived, 0);\n assert.equal(bytesExpected, 8);\n });\n form._parseContentLength();\n assert.strictEqual(form.bytesReceived, 0);\n assert.strictEqual(form.bytesExpected, 8);\n\n // JS can be evil, lets make sure we are not\n form.headers['content-length'] = '08';\n gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) {\n assert.equal(event, 'progress');\n assert.equal(bytesReceived, 0);\n assert.equal(bytesExpected, 8);\n });\n form._parseContentLength();\n assert.strictEqual(form.bytesExpected, 8);\n});\n\ntest(function _initMultipart() {\n var BOUNDARY = '123',\n PARSER;\n\n gently.expect(MultipartParserStub, 'new', function() {\n PARSER = this;\n });\n\n gently.expect(MultipartParserStub.prototype, 'initWithBoundary', function(boundary) {\n assert.equal(boundary, BOUNDARY);\n });\n\n form._initMultipart(BOUNDARY);\n assert.equal(form.type, 'multipart');\n assert.strictEqual(form._parser, PARSER);\n\n (function testRegularField() {\n var PART;\n gently.expect(StreamStub, 'new', function() {\n PART = this;\n });\n\n gently.expect(form, 'onPart', function(part) {\n assert.strictEqual(part, PART);\n assert.deepEqual\n ( part.headers\n , { 'content-disposition': 'form-data; name=\"field1\"'\n , 'foo': 'bar'\n }\n );\n assert.equal(part.name, 'field1');\n\n var strings = ['hello', ' world'];\n gently.expect(part, 'emit', 2, function(event, b) {\n assert.equal(event, 'data');\n assert.equal(b.toString(), strings.shift());\n });\n\n gently.expect(part, 'emit', function(event, b) {\n assert.equal(event, 'end');\n });\n });\n\n PARSER.onPartBegin();\n PARSER.onHeaderField(new Buffer('content-disposition'), 0, 10);\n PARSER.onHeaderField(new Buffer('content-disposition'), 10, 19);\n PARSER.onHeaderValue(new Buffer('form-data; name=\"field1\"'), 0, 14);\n PARSER.onHeaderValue(new Buffer('form-data; name=\"field1\"'), 14, 24);\n PARSER.onHeaderEnd();\n PARSER.onHeaderField(new Buffer('foo'), 0, 3);\n PARSER.onHeaderValue(new Buffer('bar'), 0, 3);\n PARSER.onHeaderEnd();\n PARSER.onHeadersEnd();\n PARSER.onPartData(new Buffer('hello world'), 0, 5);\n PARSER.onPartData(new Buffer('hello world'), 5, 11);\n PARSER.onPartEnd();\n })();\n\n (function testFileField() {\n var PART;\n gently.expect(StreamStub, 'new', function() {\n PART = this;\n });\n\n gently.expect(form, 'onPart', function(part) {\n assert.deepEqual\n ( part.headers\n , { 'content-disposition': 'form-data; name=\"field2\"; filename=\"C:\\\\Documents and Settings\\\\IE\\\\Must\\\\Die\\\\Sun\"et.jpg\"'\n , 'content-type': 'text/plain'\n }\n );\n assert.equal(part.name, 'field2');\n assert.equal(part.filename, 'Sun\"et.jpg');\n assert.equal(part.mime, 'text/plain');\n\n gently.expect(part, 'emit', function(event, b) {\n assert.equal(event, 'data');\n assert.equal(b.toString(), '... contents of file1.txt ...');\n });\n\n gently.expect(part, 'emit', function(event, b) {\n assert.equal(event, 'end');\n });\n });\n\n PARSER.onPartBegin();\n PARSER.onHeaderField(new Buffer('content-disposition'), 0, 19);\n PARSER.onHeaderValue(new Buffer('form-data; name=\"field2\"; filename=\"C:\\\\Documents and Settings\\\\IE\\\\Must\\\\Die\\\\Sun\"et.jpg\"'), 0, 85);\n PARSER.onHeaderEnd();\n PARSER.onHeaderField(new Buffer('Content-Type'), 0, 12);\n PARSER.onHeaderValue(new Buffer('text/plain'), 0, 10);\n PARSER.onHeaderEnd();\n PARSER.onHeadersEnd();\n PARSER.onPartData(new Buffer('... contents of file1.txt ...'), 0, 29);\n PARSER.onPartEnd();\n })();\n\n (function testEnd() {\n gently.expect(form, '_maybeEnd');\n PARSER.onEnd();\n assert.ok(form.ended);\n })();\n});\n\ntest(function _fileName() {\n // TODO\n return;\n});\n\ntest(function _initUrlencoded() {\n var PARSER;\n\n gently.expect(QuerystringParserStub, 'new', function() {\n PARSER = this;\n });\n\n form._initUrlencoded();\n assert.equal(form.type, 'urlencoded');\n assert.strictEqual(form._parser, PARSER);\n\n (function testOnField() {\n var KEY = 'KEY', VAL = 'VAL';\n gently.expect(form, 'emit', function(field, key, val) {\n assert.equal(field, 'field');\n assert.equal(key, KEY);\n assert.equal(val, VAL);\n });\n\n PARSER.onField(KEY, VAL);\n })();\n\n (function testOnEnd() {\n gently.expect(form, '_maybeEnd');\n\n PARSER.onEnd();\n assert.equal(form.ended, true);\n })();\n});\n\ntest(function _error() {\n var ERR = new Error('bla');\n\n gently.expect(form, 'pause');\n gently.expect(form, 'emit', function(event, err) {\n assert.equal(event, 'error');\n assert.strictEqual(err, ERR);\n });\n\n form._error(ERR);\n assert.strictEqual(form.error, ERR);\n\n // make sure _error only does its thing once\n form._error(ERR);\n});\n\ntest(function onPart() {\n var PART = {};\n gently.expect(form, 'handlePart', function(part) {\n assert.strictEqual(part, PART);\n });\n\n form.onPart(PART);\n});\n\ntest(function handlePart() {\n (function testUtf8Field() {\n var PART = new events.EventEmitter();\n PART.name = 'my_field';\n\n gently.expect(form, 'emit', function(event, field, value) {\n assert.equal(event, 'field');\n assert.equal(field, 'my_field');\n assert.equal(value, 'hello world: €');\n });\n\n form.handlePart(PART);\n PART.emit('data', new Buffer('hello'));\n PART.emit('data', new Buffer(' world: '));\n PART.emit('data', new Buffer([0xE2]));\n PART.emit('data', new Buffer([0x82, 0xAC]));\n PART.emit('end');\n })();\n\n (function testBinaryField() {\n var PART = new events.EventEmitter();\n PART.name = 'my_field2';\n\n gently.expect(form, 'emit', function(event, field, value) {\n assert.equal(event, 'field');\n assert.equal(field, 'my_field2');\n assert.equal(value, 'hello world: '+new Buffer([0xE2, 0x82, 0xAC]).toString('binary'));\n });\n\n form.encoding = 'binary';\n form.handlePart(PART);\n PART.emit('data', new Buffer('hello'));\n PART.emit('data', new Buffer(' world: '));\n PART.emit('data', new Buffer([0xE2]));\n PART.emit('data', new Buffer([0x82, 0xAC]));\n PART.emit('end');\n })();\n\n (function testFieldSize() {\n form.maxFieldsSize = 8;\n var PART = new events.EventEmitter();\n PART.name = 'my_field';\n\n gently.expect(form, '_error', function(err) {\n assert.equal(err.message, 'maxFieldsSize exceeded, received 9 bytes of field data');\n });\n\n form.handlePart(PART);\n form._fieldsSize = 1;\n PART.emit('data', new Buffer(7));\n PART.emit('data', new Buffer(1));\n })();\n\n (function testFilePart() {\n var PART = new events.EventEmitter(),\n FILE = new events.EventEmitter(),\n PATH = '/foo/bar';\n\n PART.name = 'my_file';\n PART.filename = 'sweet.txt';\n PART.mime = 'sweet.txt';\n\n gently.expect(form, '_uploadPath', function(filename) {\n assert.equal(filename, PART.filename);\n return PATH;\n });\n\n gently.expect(FileStub, 'new', function(properties) {\n assert.equal(properties.path, PATH);\n assert.equal(properties.name, PART.filename);\n assert.equal(properties.type, PART.mime);\n FILE = this;\n\n gently.expect(form, 'emit', function (event, field, file) {\n assert.equal(event, 'fileBegin');\n assert.strictEqual(field, PART.name);\n assert.strictEqual(file, FILE);\n });\n\n gently.expect(FILE, 'open');\n });\n\n form.handlePart(PART);\n assert.equal(form._flushing, 1);\n\n var BUFFER;\n gently.expect(form, 'pause');\n gently.expect(FILE, 'write', function(buffer, cb) {\n assert.strictEqual(buffer, BUFFER);\n gently.expect(form, 'resume');\n // @todo handle cb(new Err)\n cb();\n });\n\n PART.emit('data', BUFFER = new Buffer('test'));\n\n gently.expect(FILE, 'end', function(cb) {\n gently.expect(form, 'emit', function(event, field, file) {\n assert.equal(event, 'file');\n assert.strictEqual(file, FILE);\n });\n\n gently.expect(form, '_maybeEnd');\n\n cb();\n assert.equal(form._flushing, 0);\n });\n\n PART.emit('end');\n })();\n});\n\ntest(function _uploadPath() {\n (function testUniqueId() {\n var UUID_A, UUID_B;\n gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, uuid) {\n assert.equal(uploadDir, form.uploadDir);\n UUID_A = uuid;\n });\n form._uploadPath();\n\n gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, uuid) {\n UUID_B = uuid;\n });\n form._uploadPath();\n\n assert.notEqual(UUID_A, UUID_B);\n })();\n\n (function testFileExtension() {\n form.keepExtensions = true;\n var FILENAME = 'foo.jpg',\n EXT = '.bar';\n\n gently.expect(GENTLY.hijacked.path, 'extname', function(filename) {\n assert.equal(filename, FILENAME);\n gently.restore(path, 'extname');\n\n return EXT;\n });\n\n gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, name) {\n assert.equal(path.extname(name), EXT);\n });\n form._uploadPath(FILENAME);\n })();\n});\n\ntest(function _maybeEnd() {\n gently.expect(form, 'emit', 0);\n form._maybeEnd();\n\n form.ended = true;\n form._flushing = 1;\n form._maybeEnd();\n\n gently.expect(form, 'emit', function(event) {\n assert.equal(event, 'end');\n });\n\n form.ended = true;\n form._flushing = 0;\n form._maybeEnd();\n});\n"} {"text": "package com.baidu.vis.javacv_android_video_grabber;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n/**\n * Instrumented test, which will execute on an Android device.\n *\n * @see Testing documentation\n */\n@RunWith(AndroidJUnit4.class)\npublic class ExampleInstrumentedTest {\n @Test\n public void useAppContext() throws Exception {\n // Context of the app under test.\n Context appContext = InstrumentationRegistry.getTargetContext();\n\n assertEquals(\"com.baidu.vis.javacv_android_video_grabber\", appContext.getPackageName());\n }\n}\n"} {"text": "import 'package:flutter/material.dart';\n\nclass LoginPage extends StatefulWidget {\n final String title;\n const LoginPage({Key key, this.title = \"Login\"}) : super(key: key);\n\n @override\n _LoginPageState createState() => _LoginPageState();\n}\n\nclass _LoginPageState extends State {\n @override\n Widget build(BuildContext context) {\n return Scaffold(\n appBar: AppBar(\n title: Text(widget.title),\n ),\n body: Column(\n children: [],\n ),\n );\n }\n}\n"} {"text": "/// @ref ext_scalar_constants\n/// @file glm/ext/scalar_constants.hpp\n///\n/// @defgroup ext_scalar_constants GLM_EXT_scalar_constants\n/// @ingroup ext\n///\n/// Provides a list of constants and precomputed useful values.\n///\n/// Include to use the features of this extension.\n\n#pragma once\n\n// Dependencies\n#include \"../detail/setup.hpp\"\n\n#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)\n#\tpragma message(\"GLM: GLM_EXT_scalar_constants extension included\")\n#endif\n\nnamespace glm\n{\n\t/// @addtogroup ext_scalar_constants\n\t/// @{\n\n\t/// Return the epsilon constant for floating point types.\n\ttemplate\n\tGLM_FUNC_DECL GLM_CONSTEXPR genType epsilon();\n\n\t/// Return the pi constant for floating point types.\n\ttemplate\n\tGLM_FUNC_DECL GLM_CONSTEXPR genType pi();\n\n\t/// Return the value of cos(1 / 2) for floating point types.\n\ttemplate\n\tGLM_FUNC_DECL GLM_CONSTEXPR genType cos_one_over_two();\n\n\t/// @}\n} //namespace glm\n\n#include \"scalar_constants.inl\"\n"} {"text": "\r\n\r\n#include \"hw/amhw_hc32f07x_rcc.h\"\r\n#include \"ametal.h\"\r\n#include \"am_hc32f07x.h\"\r\n#include \"am_delay.h\"\r\n#include \"am_types.h\"\r\n#include \"am_clk.h\"\r\n#include \"am_usb.h\"\r\n#include \"am_gpio.h\"\r\n#include \"am_usbd.h\"\r\n#include \"am_usbd_cdc_vcom.h\"\r\n#include \"am_hc32f07x_usbd_cdc_vcom.h\"\r\n#include \"am_hc32f07x_usbd.h\"\r\n\r\n#define VIRTUAL_COM_PORT_SIZ_DEVICE_DESC 18\r\n#define VIRTUAL_COM_PORT_SIZ_CONFIG_DESC 67\r\n#define VIRTUAL_COM_PORT_SIZ_STRING_LANGID 4\r\n#define VIRTUAL_COM_PORT_SIZ_STRING_VENDOR 38\r\n#define VIRTUAL_COM_PORT_SIZ_STRING_PRODUCT 60\r\n#define VIRTUAL_COM_PORT_SIZ_STRING_SERIAL 26\r\n\r\n/* USB Standard Device Descriptor */\r\nstatic const uint8_t Virtual_Com_Port_DeviceDescriptor[] =\r\n {\r\n 0x12, /* bLength */\r\n AM_USB_DESC_TYPE_DEVICE, /* bDescriptorType */\r\n 0x10,\r\n 0x01, /* bcdUSB = 2.00 */\r\n 0x02, /* bDeviceClass: CDC */\r\n 0x00, /* bDeviceSubClass */\r\n 0x00, /* bDeviceProtocol */\r\n 0x40, /* bMaxPacketSize0 */\r\n 0x81,\r\n 0x2F, /* idVendor = 0x2F81 */\r\n 0x09,\r\n 0x72, /* idProduct = 0x7209 */\r\n 0x00,\r\n 0x02, /* bcdDevice = 2.00 */\r\n 1, /* Index of string descriptor describing manufacturer */\r\n 2, /* Index of string descriptor describing product */\r\n 3, /* Index of string descriptor describing the device's serial number */\r\n 0x01 /* bNumConfigurations */\r\n };\r\n\r\nstatic uint8_t Virtual_Com_Port_ConfigDescriptor[] =\r\n {\r\n /*Configuation Descriptor*/\r\n AM_USB_DESC_LENGTH_CONFIGURE, /* bLength: Configuation Descriptor size */\r\n AM_USB_DESC_TYPE_CONFIGURE, /* bDescriptorType: Configuration */\r\n VIRTUAL_COM_PORT_SIZ_CONFIG_DESC, /* wTotalLength:no of returned bytes */\r\n 0x00,\r\n 0x02, /* bNumInterfaces: 2 interface */\r\n 0x01, /* bConfigurationValue: Configuration value */\r\n 0x00, /* iConfiguration: Index of string descriptor describing the configuration */\r\n 0xC0, /* bmAttributes: self powered */\r\n 0x32, /* MaxPower 0 mA */\r\n /*Interface Descriptor*/\r\n 0x09, /* bLength: Interface Descriptor size */\r\n AM_USB_DESC_TYPE_INTERFACE, /* bDescriptorType: Interface */\r\n /* Interface descriptor type */\r\n 0x00, /* bInterfaceNumber: Number of Interface */\r\n 0x00, /* bAlternateSetting: Alternate setting */\r\n 0x01, /* bNumEndpoints: One endpoints used */\r\n 0x02, /* bInterfaceClass: Communication Interface Class */\r\n 0x02, /* bInterfaceSubClass: Abstract Control Model */\r\n 0x01, /* bInterfaceProtocol: Common AT commands */\r\n 0x00, /* iInterface: */\r\n /*Header Functional Descriptor*/\r\n 0x05, /* bLength: Endpoint Descriptor size */\r\n 0x24, /* bDescriptorType: CS_INTERFACE */\r\n 0x00, /* bDescriptorSubtype: Header Func Desc */\r\n 0x10, /* bcdCDC: spec release number */\r\n 0x01,\r\n /*Call Managment Functional Descriptor*/\r\n 0x05, /* bFunctionLength */\r\n 0x24, /* bDescriptorType: CS_INTERFACE */\r\n 0x01, /* bDescriptorSubtype: Call Management Func Desc */\r\n 0x00, /* bmCapabilities: D0+D1 */\r\n 0x00, /* bDataInterface: 1 */\r\n /*ACM Functional Descriptor*/\r\n 0x04, /* bFunctionLength */\r\n 0x24, /* bDescriptorType: CS_INTERFACE */\r\n 0x02, /* bDescriptorSubtype: Abstract Control Management desc */\r\n 0x02, /* bmCapabilities */\r\n /*Union Functional Descriptor*/\r\n 0x05, /* bFunctionLength */\r\n 0x24, /* bDescriptorType: CS_INTERFACE */\r\n 0x06, /* bDescriptorSubtype: Union func desc */\r\n 0x00, /* bMasterInterface: Communication class interface */\r\n 0x01, /* bSlaveInterface0: Data Class Interface */\r\n /*Endpoint 2 Descriptor*/\r\n 0x07, /* bLength: Endpoint Descriptor size */\r\n AM_USB_DESC_TYPE_ENDPOINT, /* bDescriptorType: Endpoint */\r\n 0x83, /* bEndpointAddress: (IN2) */\r\n 0x03\r\n\t\t, /* bmAttributes: Interrupt */\r\n 0x40, /* wMaxPacketSize: 64*/\r\n 0x00,\r\n 0xFF, /* bInterval: */\r\n /*Data class interface descriptor*/\r\n 0x09, /* bLength: Endpoint Descriptor size */\r\n AM_USB_DESC_TYPE_INTERFACE, /* bDescriptorType: */\r\n 0x01, /* bInterfaceNumber: Number of Interface */\r\n 0x00, /* bAlternateSetting: Alternate setting */\r\n 0x02, /* bNumEndpoints: Two endpoints used */\r\n 0x0A, /* bInterfaceClass: CDC */\r\n 0x00, /* bInterfaceSubClass: */\r\n 0x00, /* bInterfaceProtocol: */\r\n 0x00, /* iInterface: */\r\n /*Endpoint 3 Descriptor*/\r\n 0x07, /* bLength: Endpoint Descriptor size */\r\n AM_USB_DESC_TYPE_ENDPOINT, /* bDescriptorType: Endpoint */\r\n 0x02, /* bEndpointAddress: (OUT3) */\r\n 0x02, /* bmAttributes: Bulk */\r\n 0x40, /* wMaxPacketSize: 64*/\r\n 0x00,\r\n 0x00, /* bInterval: ignore for Bulk transfer */\r\n /*Endpoint 1 Descriptor*/\r\n 0x07, /* bLength: Endpoint Descriptor size */\r\n AM_USB_DESC_TYPE_ENDPOINT, /* bDescriptorType: Endpoint */\r\n 0x81, /* bEndpointAddress: (IN1) */\r\n 0x02, /* bmAttributes: Bulk */\r\n 0x40, /* wMaxPacketSize: 64*/\r\n 0x00,\r\n 0x00 /* bInterval */\r\n };\r\n\r\n/* USB String Descriptors */\r\nstatic const uint8_t Virtual_Com_Port_StringLangID[VIRTUAL_COM_PORT_SIZ_STRING_LANGID] =\r\n {\r\n VIRTUAL_COM_PORT_SIZ_STRING_LANGID,\r\n AM_USB_DESC_TYPE_STRING,\r\n 0x09,\r\n 0x04 /* LangID = 0x0409: U.S. English */\r\n };\r\n\r\nstatic const uint8_t Virtual_Com_Port_StringVendor[VIRTUAL_COM_PORT_SIZ_STRING_VENDOR] =\r\n {\r\n VIRTUAL_COM_PORT_SIZ_STRING_VENDOR, /* Size of Vendor string */\r\n AM_USB_DESC_TYPE_STRING, /* bDescriptorType*/\r\n /* Manufacturer: \"MindMotion\" */\r\n\r\n 'M', 0, \r\n 'i', 0, \r\n 'n', 0,\r\n 'd', 0,\r\n 'M', 0, \r\n 'o', 0,\r\n 't', 0,\r\n 'i', 0,\r\n 'o', 0,\r\n 'n', 0,\r\n \r\n };\r\n\r\nstatic const uint8_t Virtual_Com_Port_StringProduct[VIRTUAL_COM_PORT_SIZ_STRING_PRODUCT] =\r\n {\r\n VIRTUAL_COM_PORT_SIZ_STRING_PRODUCT, /* bLength */\r\n AM_USB_DESC_TYPE_STRING, /* bDescriptorType */\r\n /* Product name: \"\"MindMotion Virtual COM Port\" */\r\n\r\n 'M', 0, \r\n 'y', 0,\r\n ' ', 0, \r\n 'V', 0,\r\n 'i', 0,\r\n 'r', 0,\r\n 't', 0, \r\n 'u', 0,\r\n 'a', 0,\r\n 'l', 0, \r\n ' ', 0, \r\n 'C', 0,\r\n 'O', 0,\r\n 'M', 0, \r\n ' ', 0, \r\n 'P', 0,\r\n 'o', 0,\r\n 'r', 0,\r\n 't', 0, \r\n ' ', 0, \r\n ' ', 0\r\n \r\n };\r\n\r\nstatic const uint8_t Virtual_Com_Port_StringSerial[VIRTUAL_COM_PORT_SIZ_STRING_SERIAL] =\r\n {\r\n VIRTUAL_COM_PORT_SIZ_STRING_SERIAL, /* bLength */\r\n AM_USB_DESC_TYPE_STRING, /* bDescriptorType */\r\n \r\n\r\n 'Z', 0,\r\n 'M', 0,\r\n 'F', 0,\r\n '1', 0,\r\n '5', 0,\r\n '9', 0,\r\n 0, 0,\r\n };\r\n\r\n\r\n\r\n\r\n\r\n/******************************************************************************\r\n * 各描述符信息\r\n *****************************************************************************/\r\nstatic const am_usbd_descriptor_t __g_am_usbd_vcom_descriptor[] = {\r\n /* 设备描述符 */\r\n {\r\n (AM_USB_DESC_TYPE_DEVICE << 8) | (0x00),\r\n sizeof(Virtual_Com_Port_DeviceDescriptor),\r\n Virtual_Com_Port_DeviceDescriptor\r\n },\r\n\r\n /* 配置描述符及其下级描述符 */\r\n {\r\n (AM_USB_DESC_TYPE_CONFIGURE << 8) | (0x00),\r\n sizeof(Virtual_Com_Port_ConfigDescriptor),\r\n Virtual_Com_Port_ConfigDescriptor\r\n },\r\n\r\n /* 字符串描述符0,描述语言id */\r\n {\r\n (AM_USB_DESC_TYPE_STRING << 8) | (0x00),\r\n sizeof(Virtual_Com_Port_StringLangID),\r\n Virtual_Com_Port_StringLangID\r\n },\r\n\r\n /* 字符串描述符1,描述厂商 */\r\n {\r\n (AM_USB_DESC_TYPE_STRING << 8) | 0x01,\r\n sizeof(Virtual_Com_Port_StringVendor),\r\n Virtual_Com_Port_StringVendor\r\n },\r\n\r\n /* 字符串描述符2,描述产品 */\r\n {\r\n (AM_USB_DESC_TYPE_STRING << 8) | 0x02,\r\n sizeof(Virtual_Com_Port_StringProduct),\r\n Virtual_Com_Port_StringProduct\r\n },\r\n\r\n /* 字符串描述符3,描述设备 */\r\n {\r\n (AM_USB_DESC_TYPE_STRING << 8) | 0x03,\r\n sizeof(Virtual_Com_Port_StringSerial),\r\n Virtual_Com_Port_StringSerial\r\n },\r\n};\r\n\r\n\r\n/**\r\n * \\brief 平台初始化\r\n */\r\nstatic void __am_usbd_vcom_init (void) {\r\n\t\r\n /* 使能时钟 */\r\n amhw_hc32f07x_rcc_set_start(0x5A5A);\r\n amhw_hc32f07x_rcc_set_start(0xA5A5);\r\n amhw_hc32f07x_rcc_usbclk_adjust_set (AMHW_HC32F07X_USBCLK_ADJUST_PLL);\r\n am_clk_enable(CLK_USB);\r\n}\r\n\r\n/**\r\n * \\brief 平台去初始化\r\n */\r\nstatic void __am_usbd_vcom_deinit (void) {\r\n am_clk_disable(CLK_USB);\r\n amhw_hc32f07x_rcc_peripheral_disable (AMHW_HC32F07X_RCC_USB); /* 禁能USB时钟 */ /* 禁能USB时钟 */\r\n}\r\n\r\nstatic const am_usbd_devinfo_t __g_usbd_info = {\r\n __g_am_usbd_vcom_descriptor, /* 描述符地址 */\r\n sizeof(__g_am_usbd_vcom_descriptor) / sizeof(__g_am_usbd_vcom_descriptor[0]), /* 描述符个数 */\r\n};\r\n\r\n/**< \\brief 定义USB设备信息 */\r\nstatic const am_hc32f07x_usbd_devinfo_t __g_hc32f07x_usbd_vcom_info = {\r\n HC32F07X_USB_BASE, /* 寄存器基地址 */\r\n INUM_USB, /* 中断号 */\r\n __am_usbd_vcom_init, /**< \\brief 平台初始化 */\r\n __am_usbd_vcom_deinit, /**< \\brief 平台去初始化 */\r\n &__g_usbd_info,\r\n};\r\n\r\nstatic uint8_t __buffer_out[64 + 1] = {0};\r\n\r\nconst am_usbd_cdc_vcom_info_t __g_usbd_vcom_info = {\r\n 3,\r\n 1,\r\n 2,\r\n __buffer_out,\r\n};\r\n\r\n\r\nam_hc32f07x_usbd_dev_t __g_hc32f07x_dev;\r\nam_usbd_cdc_vcom_t __g_vcom_dev;\r\n\r\n\r\n/** \\brief usb_vcom实例初始化,获得usb_vcom标准服务句柄 */\r\nam_usbd_cdc_vcom_handle am_hc32f07x_usbd_vcom_inst_init (void)\r\n{\r\n return am_hc32f07x_usbd_cdc_vcom_init(&__g_vcom_dev,\r\n &__g_usbd_vcom_info,\r\n am_hc32f07x_usbd_init(&__g_hc32f07x_dev, &__g_hc32f07x_usbd_vcom_info));\r\n}\r\n\r\n\r\n/** \\brief usb_printer解初始化,获得usb_printer标准服务句柄 */\r\nvoid am_hc32f07x_usbd_vcom_inst_deinit (void)\r\n{\r\n\tam_hc32f07x_usbd_cdc_vcom_deinit(&__g_vcom_dev);\r\n}\r\n\r\n\r\n/* end of file */\r\n\r\n"} {"text": "/*\n * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,\n * and the EPL 1.0 (http://h2database.com/html/license.html).\n * Initial Developer: H2 Group\n */\n/**\n * Database constraints such as check constraints, unique constraints, and referential constraints.\n */\npackage org.lealone.db.constraint;\n"} {"text": "#! /your/favourite/path/to/ruby\n# -*- mode: ruby; coding: utf-8; indent-tabs-mode: nil; ruby-indent-level: 2 -*-\n# -*- frozen_string_literal: true; -*-\n# -*- warn_indent: true; -*-\n#\n# Copyright (c) 2017 Urabe, Shyouhei. All rights reserved.\n#\n# This file is a part of the programming language Ruby. Permission is hereby\n# granted, to either redistribute and/or modify this file, provided that the\n# conditions mentioned in the file COPYING are met. Consult the file for\n# details.\n\nrequire_relative '../helpers/c_escape.rb'\n\nclass RubyVM::CExpr\n include RubyVM::CEscape\n\n attr_reader :__FILE__, :__LINE__, :expr\n\n def initialize opts = {}\n @__FILE__ = opts[:location][0]\n @__LINE__ = opts[:location][1]\n @expr = opts[:expr]\n end\n\n # blank, in sense of C program.\n RE = %r'\\A{\\g*}\\z|\\A(?\\s|/[*][^*]*[*]+([^*/][^*]*[*]+)*/)*\\z'\n if RUBY_VERSION > '2.4' then\n def blank?\n RE.match? @expr\n end\n else\n def blank?\n RE =~ @expr\n end\n end\n\n def inspect\n sprintf \"#<%s:%d %s>\", @__FILE__, @__LINE__, @expr\n end\nend\n"} {"text": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n < Back\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n

Packages

\n
    \n
  • \n \n \n \n \n \n \n \n \n package\n \n \n root\n \n \n
    Definition Classes
    root
    \n
  • \n \n \n \n \n \n \n \n \n package\n \n \n provingground\n \n \n

    This is work towards automated theorem proving based on learning, using\nhomotopy type theory (HoTT) as foundations and natural language processing.

    This is work towards automated theorem proving based on learning, using\nhomotopy type theory (HoTT) as foundations and natural language processing.

    The implementation of homotopy type theory is split into:

    • the object HoTT with terms, types, functions and dependent functions, pairs etc
    • the package induction with general inductive types and recursion/induction on these.

    The learning package has the code for learning.

    Scala code, including the spire library, is integrated with homotopy type theory\nin the scalahott package

    We have implemented a functor based approach to translation in the translation\npackage, used for nlp as well as serialization and parsing.

    The library package is contains basic structures implemented in HoTT.\n

    Definition Classes
    root
    \n
  • \n \n \n \n \n \n \n \n \n package\n \n \n learning\n \n \n
    Definition Classes
    provingground
    \n
  • \n \n \n \n \n \n \n \n \n object\n \n \n FiniteDistributionLearner\n \n \n

    A combinator for learning systems with state finite distributions on vertices.

    A combinator for learning systems with state finite distributions on vertices.\nSystems are built from components labeled by elements of a set M.\nThe state also has weights for these components.\nThe components are built from: moves (partial functions), partial combinations and islands.

    Definition Classes
    learning
    \n
  • \n \n \n Atom\n
  • \n \n \n CombinationFn\n
  • \n \n \n Evaluate\n
  • \n \n \n ExtendM\n
  • \n \n \n MoveFn\n
  • \n \n \n NewVertex\n
  • \n \n \n NormalizeFD\n
  • \n \n \n ProjectV\n
  • \n \n \n PtwiseProd\n
  • \n \n \n Sample\n
  • \n
\n
\n
\n
\n \n \n\n

\n \n \n case class\n \n \n NewVertex[V](v: V) extends AdjDiffbleFunction[(Double, FiniteDistribution[V]), FiniteDistribution[V]] with Product with Serializable\n \n

\n\n \n

Add a new vertex, mainly for lambdas\n

\n \n Linear Supertypes\n \n
Serializable, Serializable, Product, Equals, AdjDiffbleFunction[(Double, FiniteDistribution[V]), FiniteDistribution[V]], AnyRef, Any
\n
\n \n\n
\n
\n
\n \n \n \n \n \n
\n
\n
\n Ordering\n
    \n \n
  1. Alphabetic
  2. \n
  3. By Inheritance
  4. \n
\n
\n
\n Inherited
\n
\n
    \n
  1. NewVertex
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AdjDiffbleFunction
  7. AnyRef
  8. Any
  9. \n
\n
\n Implicitly
\n
\n
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  5. \n
\n
\n \n
    \n
  1. Hide All
  2. \n
  3. Show All
  4. \n
\n
\n
\n Visibility\n
  1. Public
  2. All
\n
\n
\n
\n\n
\n
\n
\n

Instance Constructors

\n
  1. \n \n \n \n \n \n \n \n \n new\n \n \n NewVertex(v: V)\n \n \n \n
\n
\n\n \n\n \n\n
\n

Value Members

\n
    \n
  1. \n \n \n \n \n \n \n \n final \n def\n \n \n !=(arg0: Any): Boolean\n \n \n
    Definition Classes
    AnyRef → Any
    \n
  2. \n \n \n \n \n \n \n \n final \n def\n \n \n ##(): Int\n \n \n
    Definition Classes
    AnyRef → Any
    \n
  3. \n \n \n \n \n \n \n \n \n def\n \n \n **:(that: ((Double, FiniteDistribution[V])) ⇒ FiniteDistribution[V]): ((Double, FiniteDistribution[V])) ⇒ (Double, FiniteDistribution[V])\n \n \n

    post-compose by the gradient of this, for instance for a feedback.

    post-compose by the gradient of this, for instance for a feedback.\n

    Definition Classes
    AdjDiffbleFunction
    \n
  4. \n \n \n \n \n \n \n \n \n def\n \n \n *:[C](that: ⇒ AdjDiffbleFunction[FiniteDistribution[V], C]): AdjDiffbleFunction[(Double, FiniteDistribution[V]), C]\n \n \n

    Composition f *: g is f(g(_))\n

    Composition f *: g is f(g(_))\n

    Definition Classes
    AdjDiffbleFunction
    \n
  5. \n \n \n \n \n \n \n \n \n def\n \n \n +(other: String): String\n \n \n
    Implicit
    \n This member is added by an implicit conversion from NewVertex[V] to\n any2stringadd[NewVertex[V]] performed by method any2stringadd in scala.Predef.\n \n
    Definition Classes
    any2stringadd
    \n
  6. \n \n \n \n \n \n \n \n \n def\n \n \n ->[B](y: B): (NewVertex[V], B)\n \n \n
    Implicit
    \n This member is added by an implicit conversion from NewVertex[V] to\n ArrowAssoc[NewVertex[V]] performed by method ArrowAssoc in scala.Predef.\n \n
    Definition Classes
    ArrowAssoc
    Annotations
    \n @inline()\n \n
    \n
  7. \n \n \n \n \n \n \n \n final \n def\n \n \n ==(arg0: Any): Boolean\n \n \n
    Definition Classes
    AnyRef → Any
    \n
  8. \n \n \n \n \n \n \n \n \n def\n \n \n ^:(that: (FiniteDistribution[V]) ⇒ FiniteDistribution[V]): ((Double, FiniteDistribution[V])) ⇒ (Double, FiniteDistribution[V])\n \n \n

    Conjugate that by this.

    Conjugate that by this.\n

    Definition Classes
    AdjDiffbleFunction
    \n
  9. \n \n \n \n \n \n \n \n \n val\n \n \n adjDer: ((Double, FiniteDistribution[V])) ⇒ (FiniteDistribution[V]) ⇒ (Double, FiniteDistribution[V])\n \n \n
    Definition Classes
    NewVertexAdjDiffbleFunction
    \n
  10. \n \n \n \n \n \n \n \n \n def\n \n \n andthen[C](that: ⇒ AdjDiffbleFunction[FiniteDistribution[V], C]): AdjDiffbleFunction[(Double, FiniteDistribution[V]), C]\n \n \n
    Definition Classes
    AdjDiffbleFunction
    \n
  11. \n \n \n \n \n \n \n \n \n def\n \n \n apply(a: (Double, FiniteDistribution[V])): FiniteDistribution[V]\n \n \n
    Definition Classes
    AdjDiffbleFunction
    \n
  12. \n \n \n \n \n \n \n \n final \n def\n \n \n asInstanceOf[T0]: T0\n \n \n
    Definition Classes
    Any
    \n
  13. \n \n \n \n \n \n \n \n \n def\n \n \n clone(): AnyRef\n \n \n
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    \n @throws(\n \n ...\n )\n \n @native()\n \n
    \n
  14. \n \n \n \n \n \n \n \n \n def\n \n \n ensuring(cond: (NewVertex[V]) ⇒ Boolean, msg: ⇒ Any): NewVertex[V]\n \n \n
    Implicit
    \n This member is added by an implicit conversion from NewVertex[V] to\n Ensuring[NewVertex[V]] performed by method Ensuring in scala.Predef.\n \n
    Definition Classes
    Ensuring
    \n
  15. \n \n \n \n \n \n \n \n \n def\n \n \n ensuring(cond: (NewVertex[V]) ⇒ Boolean): NewVertex[V]\n \n \n
    Implicit
    \n This member is added by an implicit conversion from NewVertex[V] to\n Ensuring[NewVertex[V]] performed by method Ensuring in scala.Predef.\n \n
    Definition Classes
    Ensuring
    \n
  16. \n \n \n \n \n \n \n \n \n def\n \n \n ensuring(cond: Boolean, msg: ⇒ Any): NewVertex[V]\n \n \n
    Implicit
    \n This member is added by an implicit conversion from NewVertex[V] to\n Ensuring[NewVertex[V]] performed by method Ensuring in scala.Predef.\n \n
    Definition Classes
    Ensuring
    \n
  17. \n \n \n \n \n \n \n \n \n def\n \n \n ensuring(cond: Boolean): NewVertex[V]\n \n \n
    Implicit
    \n This member is added by an implicit conversion from NewVertex[V] to\n Ensuring[NewVertex[V]] performed by method Ensuring in scala.Predef.\n \n
    Definition Classes
    Ensuring
    \n
  18. \n \n \n \n \n \n \n \n final \n def\n \n \n eq(arg0: AnyRef): Boolean\n \n \n
    Definition Classes
    AnyRef
    \n
  19. \n \n \n \n \n \n \n \n \n def\n \n \n finalize(): Unit\n \n \n
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    \n @throws(\n \n classOf[java.lang.Throwable]\n )\n \n
    \n
  20. \n \n \n \n \n \n \n \n \n def\n \n \n formatted(fmtstr: String): String\n \n \n
    Implicit
    \n This member is added by an implicit conversion from NewVertex[V] to\n StringFormat[NewVertex[V]] performed by method StringFormat in scala.Predef.\n \n
    Definition Classes
    StringFormat
    Annotations
    \n @inline()\n \n
    \n
  21. \n \n \n \n \n \n \n \n \n val\n \n \n func: ((Double, FiniteDistribution[V])) ⇒ FiniteDistribution[V]\n \n \n
    Definition Classes
    NewVertexAdjDiffbleFunction
    \n
  22. \n \n \n \n \n \n \n \n final \n def\n \n \n getClass(): Class[_]\n \n \n
    Definition Classes
    AnyRef → Any
    Annotations
    \n @native()\n \n
    \n
  23. \n \n \n \n \n \n \n \n final \n def\n \n \n isInstanceOf[T0]: Boolean\n \n \n
    Definition Classes
    Any
    \n
  24. \n \n \n \n \n \n \n \n final \n def\n \n \n ne(arg0: AnyRef): Boolean\n \n \n
    Definition Classes
    AnyRef
    \n
  25. \n \n \n \n \n \n \n \n final \n def\n \n \n notify(): Unit\n \n \n
    Definition Classes
    AnyRef
    Annotations
    \n @native()\n \n
    \n
  26. \n \n \n \n \n \n \n \n final \n def\n \n \n notifyAll(): Unit\n \n \n
    Definition Classes
    AnyRef
    Annotations
    \n @native()\n \n
    \n
  27. \n \n \n \n \n \n \n \n \n def\n \n \n oplus[C, D](that: AdjDiffbleFunction[C, D]): Oplus[(Double, FiniteDistribution[V]), FiniteDistribution[V], C, D]\n \n \n
    Definition Classes
    AdjDiffbleFunction
    \n
  28. \n \n \n \n \n \n \n \n final \n def\n \n \n synchronized[T0](arg0: ⇒ T0): T0\n \n \n
    Definition Classes
    AnyRef
    \n
  29. \n \n \n \n \n \n \n \n \n val\n \n \n v: V\n \n \n \n
  30. \n \n \n \n \n \n \n \n final \n def\n \n \n wait(): Unit\n \n \n
    Definition Classes
    AnyRef
    Annotations
    \n @throws(\n \n ...\n )\n \n
    \n
  31. \n \n \n \n \n \n \n \n final \n def\n \n \n wait(arg0: Long, arg1: Int): Unit\n \n \n
    Definition Classes
    AnyRef
    Annotations
    \n @throws(\n \n ...\n )\n \n
    \n
  32. \n \n \n \n \n \n \n \n final \n def\n \n \n wait(arg0: Long): Unit\n \n \n
    Definition Classes
    AnyRef
    Annotations
    \n @throws(\n \n ...\n )\n \n @native()\n \n
    \n
  33. \n \n \n \n \n \n \n \n \n def\n \n \n [B](y: B): (NewVertex[V], B)\n \n \n
    Implicit
    \n This member is added by an implicit conversion from NewVertex[V] to\n ArrowAssoc[NewVertex[V]] performed by method ArrowAssoc in scala.Predef.\n \n
    Definition Classes
    ArrowAssoc
    \n
  34. \n
\n
\n\n \n\n \n
\n\n
\n
\n

Inherited from Serializable

\n
\n

Inherited from Serializable

\n
\n

Inherited from Product

\n
\n

Inherited from Equals

\n
\n

Inherited from AdjDiffbleFunction[(Double, FiniteDistribution[V]), FiniteDistribution[V]]

\n
\n

Inherited from AnyRef

\n
\n

Inherited from Any

\n
\n
\n

Inherited by implicit conversion any2stringadd from\n NewVertex[V] to any2stringadd[NewVertex[V]]\n

\n
\n

Inherited by implicit conversion StringFormat from\n NewVertex[V] to StringFormat[NewVertex[V]]\n

\n
\n

Inherited by implicit conversion Ensuring from\n NewVertex[V] to Ensuring[NewVertex[V]]\n

\n
\n

Inherited by implicit conversion ArrowAssoc from\n NewVertex[V] to ArrowAssoc[NewVertex[V]]\n

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

Ungrouped

\n \n
\n
\n\n
\n\n
\n\n
\n \n
\n
\n
\n \n \n"} {"text": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n"} {"text": "\n\n \n \n \n ZCL_AOC_CHECK_31\n E\n Extended Program Check, Filterable\n 1\n X\n X\n X\n P\n X\n \n \n \n I\n M01\n &1\n 12\n \n \n \n \n *\n abapOpenChecks\n \n \n *\n https://github.com/larshp/abapOpenChecks\n \n \n *\n MIT License\n \n \n \n \n\n"} {"text": "/*\n**==============================================================================\n**\n** Copyright (c) Microsoft Corporation. All rights reserved. See file LICENSE\n** for license information.\n**\n**==============================================================================\n*/\n\n/* @migen@ */\n#include \n#include \"X_Halves_Class_Provider.h\"\n\nMI_BEGIN_NAMESPACE\n\nX_SmallNumber_Class FillNumberByKey(\n Uint64 key);\n\nX_Halves_Class_Provider::X_Halves_Class_Provider(\n Module* module) :\n m_Module(module)\n{\n}\n\nX_Halves_Class_Provider::~X_Halves_Class_Provider()\n{\n}\n\nvoid X_Halves_Class_Provider::EnumerateInstances(\n Context& context,\n const String& nameSpace,\n const PropertySet& propertySet,\n bool keysOnly,\n const MI_Filter* filter)\n{\n context.Post(MI_RESULT_NOT_SUPPORTED);\n}\n\nvoid X_Halves_Class_Provider::GetInstance(\n Context& context,\n const String& nameSpace,\n const X_Halves_Class& instance_ref,\n const PropertySet& propertySet)\n{\n context.Post(MI_RESULT_NOT_SUPPORTED);\n}\n\nvoid X_Halves_Class_Provider::CreateInstance(\n Context& context,\n const String& nameSpace,\n const X_Halves_Class& new_instance)\n{\n context.Post(MI_RESULT_NOT_SUPPORTED);\n}\n\nvoid X_Halves_Class_Provider::ModifyInstance(\n Context& context,\n const String& nameSpace,\n const X_Halves_Class& new_instance,\n const PropertySet& propertySet)\n{\n context.Post(MI_RESULT_NOT_SUPPORTED);\n}\n\nvoid X_Halves_Class_Provider::DeleteInstance(\n Context& context,\n const String& nameSpace,\n const X_Halves_Class& instance_ref)\n{\n context.Post(MI_RESULT_NOT_SUPPORTED);\n}\n\nvoid X_Halves_Class_Provider::AssociatorInstances(\n Context& context,\n const String& nameSpace,\n const MI_Instance* instanceName, \n const String& resultClass,\n const String& role,\n const String& resultRole,\n const PropertySet& propertySet,\n bool keysOnly,\n const MI_Filter* filter)\n{\n if (!X_SmallNumber_IsA(instanceName))\n {\n context.Post(MI_RESULT_FAILED);\n return ;\n }\n\n X_SmallNumber_Class number((const X_SmallNumber*)instanceName,true);\n\n if (!number.Number().exists)\n { // key is missing\n context.Post(MI_RESULT_FAILED);\n return ;\n }\n \n Uint64 num = number.Number().value;\n\n // check if we have smaller half\n if (num % 2 == 0 && \n (role.GetSize() == 0 || role == MI_T(\"number\")) && // check role\n (resultRole.GetSize() == 0 || resultRole == MI_T(\"half\")) // check result role\n )\n {\n context.Post(FillNumberByKey(num / 2));\n }\n\n // check if we have bigger half\n if (num * 2 < 10000 && \n (role.GetSize() == 0 || role == MI_T(\"half\")) && // check role\n (resultRole.GetSize() == 0 || resultRole == MI_T(\"number\")) // check result role\n )\n {\n context.Post(FillNumberByKey(num * 2));\n }\n\n context.Post(MI_RESULT_OK);\n}\n\nvoid X_Halves_Class_Provider::ReferenceInstances(\n Context& context,\n const String& nameSpace,\n const MI_Instance* instanceName, \n const String& role,\n const PropertySet& propertySet,\n bool keysOnly,\n const MI_Filter* filter)\n{\n context.Post(MI_RESULT_NOT_SUPPORTED);\n}\n\n\nMI_END_NAMESPACE\nMI_BEGIN_NAMESPACE\nvoid X_Halves_Class_Provider::Load(\n Context& context)\n{\n context.Post(MI_RESULT_OK);\n}\n\nvoid X_Halves_Class_Provider::Unload(\n Context& context)\n{\n context.Post(MI_RESULT_OK);\n}\n\nMI_END_NAMESPACE\n"} {"text": "\"\"\"setuptools.command.egg_info\n\nCreate a distribution's .egg-info directory and contents\"\"\"\n\nfrom distutils.filelist import FileList as _FileList\nfrom distutils.errors import DistutilsInternalError\nfrom distutils.util import convert_path\nfrom distutils import log\nimport distutils.errors\nimport distutils.filelist\nimport os\nimport re\nimport sys\nimport io\nimport warnings\nimport time\nimport collections\n\nfrom setuptools.extern import six\nfrom setuptools.extern.six.moves import map\n\nfrom setuptools import Command\nfrom setuptools.command.sdist import sdist\nfrom setuptools.command.sdist import walk_revctrl\nfrom setuptools.command.setopt import edit_config\nfrom setuptools.command import bdist_egg\nfrom pkg_resources import (\n parse_requirements, safe_name, parse_version,\n safe_version, yield_lines, EntryPoint, iter_entry_points, to_filename)\nimport setuptools.unicode_utils as unicode_utils\nfrom setuptools.glob import glob\n\nfrom pkg_resources.extern import packaging\n\n\ndef translate_pattern(glob):\n \"\"\"\n Translate a file path glob like '*.txt' in to a regular expression.\n This differs from fnmatch.translate which allows wildcards to match\n directory separators. It also knows about '**/' which matches any number of\n directories.\n \"\"\"\n pat = ''\n\n # This will split on '/' within [character classes]. This is deliberate.\n chunks = glob.split(os.path.sep)\n\n sep = re.escape(os.sep)\n valid_char = '[^%s]' % (sep,)\n\n for c, chunk in enumerate(chunks):\n last_chunk = c == len(chunks) - 1\n\n # Chunks that are a literal ** are globstars. They match anything.\n if chunk == '**':\n if last_chunk:\n # Match anything if this is the last component\n pat += '.*'\n else:\n # Match '(name/)*'\n pat += '(?:%s+%s)*' % (valid_char, sep)\n continue # Break here as the whole path component has been handled\n\n # Find any special characters in the remainder\n i = 0\n chunk_len = len(chunk)\n while i < chunk_len:\n char = chunk[i]\n if char == '*':\n # Match any number of name characters\n pat += valid_char + '*'\n elif char == '?':\n # Match a name character\n pat += valid_char\n elif char == '[':\n # Character class\n inner_i = i + 1\n # Skip initial !/] chars\n if inner_i < chunk_len and chunk[inner_i] == '!':\n inner_i = inner_i + 1\n if inner_i < chunk_len and chunk[inner_i] == ']':\n inner_i = inner_i + 1\n\n # Loop till the closing ] is found\n while inner_i < chunk_len and chunk[inner_i] != ']':\n inner_i = inner_i + 1\n\n if inner_i >= chunk_len:\n # Got to the end of the string without finding a closing ]\n # Do not treat this as a matching group, but as a literal [\n pat += re.escape(char)\n else:\n # Grab the insides of the [brackets]\n inner = chunk[i + 1:inner_i]\n char_class = ''\n\n # Class negation\n if inner[0] == '!':\n char_class = '^'\n inner = inner[1:]\n\n char_class += re.escape(inner)\n pat += '[%s]' % (char_class,)\n\n # Skip to the end ]\n i = inner_i\n else:\n pat += re.escape(char)\n i += 1\n\n # Join each chunk with the dir separator\n if not last_chunk:\n pat += sep\n\n pat += r'\\Z'\n return re.compile(pat, flags=re.MULTILINE|re.DOTALL)\n\n\nclass egg_info(Command):\n description = \"create a distribution's .egg-info directory\"\n\n user_options = [\n ('egg-base=', 'e', \"directory containing .egg-info directories\"\n \" (default: top of the source tree)\"),\n ('tag-date', 'd', \"Add date stamp (e.g. 20050528) to version number\"),\n ('tag-build=', 'b', \"Specify explicit tag to add to version number\"),\n ('no-date', 'D', \"Don't include date stamp [default]\"),\n ]\n\n boolean_options = ['tag-date']\n negative_opt = {\n 'no-date': 'tag-date',\n }\n\n def initialize_options(self):\n self.egg_name = None\n self.egg_version = None\n self.egg_base = None\n self.egg_info = None\n self.tag_build = None\n self.tag_date = 0\n self.broken_egg_info = False\n self.vtags = None\n\n ####################################\n # allow the 'tag_svn_revision' to be detected and\n # set, supporting sdists built on older Setuptools.\n @property\n def tag_svn_revision(self):\n pass\n\n @tag_svn_revision.setter\n def tag_svn_revision(self, value):\n pass\n ####################################\n\n def save_version_info(self, filename):\n \"\"\"\n Materialize the value of date into the\n build tag. Install build keys in a deterministic order\n to avoid arbitrary reordering on subsequent builds.\n \"\"\"\n # python 2.6 compatibility\n odict = getattr(collections, 'OrderedDict', dict)\n egg_info = odict()\n # follow the order these keys would have been added\n # when PYTHONHASHSEED=0\n egg_info['tag_build'] = self.tags()\n egg_info['tag_date'] = 0\n edit_config(filename, dict(egg_info=egg_info))\n\n def finalize_options(self):\n self.egg_name = safe_name(self.distribution.get_name())\n self.vtags = self.tags()\n self.egg_version = self.tagged_version()\n\n parsed_version = parse_version(self.egg_version)\n\n try:\n is_version = isinstance(parsed_version, packaging.version.Version)\n spec = (\n \"%s==%s\" if is_version else \"%s===%s\"\n )\n list(\n parse_requirements(spec % (self.egg_name, self.egg_version))\n )\n except ValueError:\n raise distutils.errors.DistutilsOptionError(\n \"Invalid distribution name or version syntax: %s-%s\" %\n (self.egg_name, self.egg_version)\n )\n\n if self.egg_base is None:\n dirs = self.distribution.package_dir\n self.egg_base = (dirs or {}).get('', os.curdir)\n\n self.ensure_dirname('egg_base')\n self.egg_info = to_filename(self.egg_name) + '.egg-info'\n if self.egg_base != os.curdir:\n self.egg_info = os.path.join(self.egg_base, self.egg_info)\n if '-' in self.egg_name:\n self.check_broken_egg_info()\n\n # Set package version for the benefit of dumber commands\n # (e.g. sdist, bdist_wininst, etc.)\n #\n self.distribution.metadata.version = self.egg_version\n\n # If we bootstrapped around the lack of a PKG-INFO, as might be the\n # case in a fresh checkout, make sure that any special tags get added\n # to the version info\n #\n pd = self.distribution._patched_dist\n if pd is not None and pd.key == self.egg_name.lower():\n pd._version = self.egg_version\n pd._parsed_version = parse_version(self.egg_version)\n self.distribution._patched_dist = None\n\n def write_or_delete_file(self, what, filename, data, force=False):\n \"\"\"Write `data` to `filename` or delete if empty\n\n If `data` is non-empty, this routine is the same as ``write_file()``.\n If `data` is empty but not ``None``, this is the same as calling\n ``delete_file(filename)`. If `data` is ``None``, then this is a no-op\n unless `filename` exists, in which case a warning is issued about the\n orphaned file (if `force` is false), or deleted (if `force` is true).\n \"\"\"\n if data:\n self.write_file(what, filename, data)\n elif os.path.exists(filename):\n if data is None and not force:\n log.warn(\n \"%s not set in setup(), but %s exists\", what, filename\n )\n return\n else:\n self.delete_file(filename)\n\n def write_file(self, what, filename, data):\n \"\"\"Write `data` to `filename` (if not a dry run) after announcing it\n\n `what` is used in a log message to identify what is being written\n to the file.\n \"\"\"\n log.info(\"writing %s to %s\", what, filename)\n if six.PY3:\n data = data.encode(\"utf-8\")\n if not self.dry_run:\n f = open(filename, 'wb')\n f.write(data)\n f.close()\n\n def delete_file(self, filename):\n \"\"\"Delete `filename` (if not a dry run) after announcing it\"\"\"\n log.info(\"deleting %s\", filename)\n if not self.dry_run:\n os.unlink(filename)\n\n def tagged_version(self):\n version = self.distribution.get_version()\n # egg_info may be called more than once for a distribution,\n # in which case the version string already contains all tags.\n if self.vtags and version.endswith(self.vtags):\n return safe_version(version)\n return safe_version(version + self.vtags)\n\n def run(self):\n self.mkpath(self.egg_info)\n installer = self.distribution.fetch_build_egg\n for ep in iter_entry_points('egg_info.writers'):\n ep.require(installer=installer)\n writer = ep.resolve()\n writer(self, ep.name, os.path.join(self.egg_info, ep.name))\n\n # Get rid of native_libs.txt if it was put there by older bdist_egg\n nl = os.path.join(self.egg_info, \"native_libs.txt\")\n if os.path.exists(nl):\n self.delete_file(nl)\n\n self.find_sources()\n\n def tags(self):\n version = ''\n if self.tag_build:\n version += self.tag_build\n if self.tag_date:\n version += time.strftime(\"-%Y%m%d\")\n return version\n\n def find_sources(self):\n \"\"\"Generate SOURCES.txt manifest file\"\"\"\n manifest_filename = os.path.join(self.egg_info, \"SOURCES.txt\")\n mm = manifest_maker(self.distribution)\n mm.manifest = manifest_filename\n mm.run()\n self.filelist = mm.filelist\n\n def check_broken_egg_info(self):\n bei = self.egg_name + '.egg-info'\n if self.egg_base != os.curdir:\n bei = os.path.join(self.egg_base, bei)\n if os.path.exists(bei):\n log.warn(\n \"-\" * 78 + '\\n'\n \"Note: Your current .egg-info directory has a '-' in its name;\"\n '\\nthis will not work correctly with \"setup.py develop\".\\n\\n'\n 'Please rename %s to %s to correct this problem.\\n' + '-' * 78,\n bei, self.egg_info\n )\n self.broken_egg_info = self.egg_info\n self.egg_info = bei # make it work for now\n\n\nclass FileList(_FileList):\n # Implementations of the various MANIFEST.in commands\n\n def process_template_line(self, line):\n # Parse the line: split it up, make sure the right number of words\n # is there, and return the relevant words. 'action' is always\n # defined: it's the first word of the line. Which of the other\n # three are defined depends on the action; it'll be either\n # patterns, (dir and patterns), or (dir_pattern).\n (action, patterns, dir, dir_pattern) = self._parse_template_line(line)\n\n # OK, now we know that the action is valid and we have the\n # right number of words on the line for that action -- so we\n # can proceed with minimal error-checking.\n if action == 'include':\n self.debug_print(\"include \" + ' '.join(patterns))\n for pattern in patterns:\n if not self.include(pattern):\n log.warn(\"warning: no files found matching '%s'\", pattern)\n\n elif action == 'exclude':\n self.debug_print(\"exclude \" + ' '.join(patterns))\n for pattern in patterns:\n if not self.exclude(pattern):\n log.warn((\"warning: no previously-included files \"\n \"found matching '%s'\"), pattern)\n\n elif action == 'global-include':\n self.debug_print(\"global-include \" + ' '.join(patterns))\n for pattern in patterns:\n if not self.global_include(pattern):\n log.warn((\"warning: no files found matching '%s' \"\n \"anywhere in distribution\"), pattern)\n\n elif action == 'global-exclude':\n self.debug_print(\"global-exclude \" + ' '.join(patterns))\n for pattern in patterns:\n if not self.global_exclude(pattern):\n log.warn((\"warning: no previously-included files matching \"\n \"'%s' found anywhere in distribution\"),\n pattern)\n\n elif action == 'recursive-include':\n self.debug_print(\"recursive-include %s %s\" %\n (dir, ' '.join(patterns)))\n for pattern in patterns:\n if not self.recursive_include(dir, pattern):\n log.warn((\"warning: no files found matching '%s' \"\n \"under directory '%s'\"),\n pattern, dir)\n\n elif action == 'recursive-exclude':\n self.debug_print(\"recursive-exclude %s %s\" %\n (dir, ' '.join(patterns)))\n for pattern in patterns:\n if not self.recursive_exclude(dir, pattern):\n log.warn((\"warning: no previously-included files matching \"\n \"'%s' found under directory '%s'\"),\n pattern, dir)\n\n elif action == 'graft':\n self.debug_print(\"graft \" + dir_pattern)\n if not self.graft(dir_pattern):\n log.warn(\"warning: no directories found matching '%s'\",\n dir_pattern)\n\n elif action == 'prune':\n self.debug_print(\"prune \" + dir_pattern)\n if not self.prune(dir_pattern):\n log.warn((\"no previously-included directories found \"\n \"matching '%s'\"), dir_pattern)\n\n else:\n raise DistutilsInternalError(\n \"this cannot happen: invalid action '%s'\" % action)\n\n def _remove_files(self, predicate):\n \"\"\"\n Remove all files from the file list that match the predicate.\n Return True if any matching files were removed\n \"\"\"\n found = False\n for i in range(len(self.files) - 1, -1, -1):\n if predicate(self.files[i]):\n self.debug_print(\" removing \" + self.files[i])\n del self.files[i]\n found = True\n return found\n\n def include(self, pattern):\n \"\"\"Include files that match 'pattern'.\"\"\"\n found = [f for f in glob(pattern) if not os.path.isdir(f)]\n self.extend(found)\n return bool(found)\n\n def exclude(self, pattern):\n \"\"\"Exclude files that match 'pattern'.\"\"\"\n match = translate_pattern(pattern)\n return self._remove_files(match.match)\n\n def recursive_include(self, dir, pattern):\n \"\"\"\n Include all files anywhere in 'dir/' that match the pattern.\n \"\"\"\n full_pattern = os.path.join(dir, '**', pattern)\n found = [f for f in glob(full_pattern, recursive=True)\n if not os.path.isdir(f)]\n self.extend(found)\n return bool(found)\n\n def recursive_exclude(self, dir, pattern):\n \"\"\"\n Exclude any file anywhere in 'dir/' that match the pattern.\n \"\"\"\n match = translate_pattern(os.path.join(dir, '**', pattern))\n return self._remove_files(match.match)\n\n def graft(self, dir):\n \"\"\"Include all files from 'dir/'.\"\"\"\n found = [\n item\n for match_dir in glob(dir)\n for item in distutils.filelist.findall(match_dir)\n ]\n self.extend(found)\n return bool(found)\n\n def prune(self, dir):\n \"\"\"Filter out files from 'dir/'.\"\"\"\n match = translate_pattern(os.path.join(dir, '**'))\n return self._remove_files(match.match)\n\n def global_include(self, pattern):\n \"\"\"\n Include all files anywhere in the current directory that match the\n pattern. This is very inefficient on large file trees.\n \"\"\"\n if self.allfiles is None:\n self.findall()\n match = translate_pattern(os.path.join('**', pattern))\n found = [f for f in self.allfiles if match.match(f)]\n self.extend(found)\n return bool(found)\n\n def global_exclude(self, pattern):\n \"\"\"\n Exclude all files anywhere that match the pattern.\n \"\"\"\n match = translate_pattern(os.path.join('**', pattern))\n return self._remove_files(match.match)\n\n def append(self, item):\n if item.endswith('\\r'): # Fix older sdists built on Windows\n item = item[:-1]\n path = convert_path(item)\n\n if self._safe_path(path):\n self.files.append(path)\n\n def extend(self, paths):\n self.files.extend(filter(self._safe_path, paths))\n\n def _repair(self):\n \"\"\"\n Replace self.files with only safe paths\n\n Because some owners of FileList manipulate the underlying\n ``files`` attribute directly, this method must be called to\n repair those paths.\n \"\"\"\n self.files = list(filter(self._safe_path, self.files))\n\n def _safe_path(self, path):\n enc_warn = \"'%s' not %s encodable -- skipping\"\n\n # To avoid accidental trans-codings errors, first to unicode\n u_path = unicode_utils.filesys_decode(path)\n if u_path is None:\n log.warn(\"'%s' in unexpected encoding -- skipping\" % path)\n return False\n\n # Must ensure utf-8 encodability\n utf8_path = unicode_utils.try_encode(u_path, \"utf-8\")\n if utf8_path is None:\n log.warn(enc_warn, path, 'utf-8')\n return False\n\n try:\n # accept is either way checks out\n if os.path.exists(u_path) or os.path.exists(utf8_path):\n return True\n # this will catch any encode errors decoding u_path\n except UnicodeEncodeError:\n log.warn(enc_warn, path, sys.getfilesystemencoding())\n\n\nclass manifest_maker(sdist):\n template = \"MANIFEST.in\"\n\n def initialize_options(self):\n self.use_defaults = 1\n self.prune = 1\n self.manifest_only = 1\n self.force_manifest = 1\n\n def finalize_options(self):\n pass\n\n def run(self):\n self.filelist = FileList()\n if not os.path.exists(self.manifest):\n self.write_manifest() # it must exist so it'll get in the list\n self.add_defaults()\n if os.path.exists(self.template):\n self.read_template()\n self.prune_file_list()\n self.filelist.sort()\n self.filelist.remove_duplicates()\n self.write_manifest()\n\n def _manifest_normalize(self, path):\n path = unicode_utils.filesys_decode(path)\n return path.replace(os.sep, '/')\n\n def write_manifest(self):\n \"\"\"\n Write the file list in 'self.filelist' to the manifest file\n named by 'self.manifest'.\n \"\"\"\n self.filelist._repair()\n\n # Now _repairs should encodability, but not unicode\n files = [self._manifest_normalize(f) for f in self.filelist.files]\n msg = \"writing manifest file '%s'\" % self.manifest\n self.execute(write_file, (self.manifest, files), msg)\n\n def warn(self, msg):\n if not self._should_suppress_warning(msg):\n sdist.warn(self, msg)\n\n @staticmethod\n def _should_suppress_warning(msg):\n \"\"\"\n suppress missing-file warnings from sdist\n \"\"\"\n return re.match(r\"standard file .*not found\", msg)\n\n def add_defaults(self):\n sdist.add_defaults(self)\n self.filelist.append(self.template)\n self.filelist.append(self.manifest)\n rcfiles = list(walk_revctrl())\n if rcfiles:\n self.filelist.extend(rcfiles)\n elif os.path.exists(self.manifest):\n self.read_manifest()\n ei_cmd = self.get_finalized_command('egg_info')\n self.filelist.graft(ei_cmd.egg_info)\n\n def prune_file_list(self):\n build = self.get_finalized_command('build')\n base_dir = self.distribution.get_fullname()\n self.filelist.prune(build.build_base)\n self.filelist.prune(base_dir)\n sep = re.escape(os.sep)\n self.filelist.exclude_pattern(r'(^|' + sep + r')(RCS|CVS|\\.svn)' + sep,\n is_regex=1)\n\n\ndef write_file(filename, contents):\n \"\"\"Create a file with the specified name and write 'contents' (a\n sequence of strings without line terminators) to it.\n \"\"\"\n contents = \"\\n\".join(contents)\n\n # assuming the contents has been vetted for utf-8 encoding\n contents = contents.encode(\"utf-8\")\n\n with open(filename, \"wb\") as f: # always write POSIX-style manifest\n f.write(contents)\n\n\ndef write_pkg_info(cmd, basename, filename):\n log.info(\"writing %s\", filename)\n if not cmd.dry_run:\n metadata = cmd.distribution.metadata\n metadata.version, oldver = cmd.egg_version, metadata.version\n metadata.name, oldname = cmd.egg_name, metadata.name\n metadata.long_description_content_type = getattr(\n cmd.distribution,\n 'long_description_content_type'\n )\n try:\n # write unescaped data to PKG-INFO, so older pkg_resources\n # can still parse it\n metadata.write_pkg_info(cmd.egg_info)\n finally:\n metadata.name, metadata.version = oldname, oldver\n\n safe = getattr(cmd.distribution, 'zip_safe', None)\n\n bdist_egg.write_safety_flag(cmd.egg_info, safe)\n\n\ndef warn_depends_obsolete(cmd, basename, filename):\n if os.path.exists(filename):\n log.warn(\n \"WARNING: 'depends.txt' is not used by setuptools 0.6!\\n\"\n \"Use the install_requires/extras_require setup() args instead.\"\n )\n\n\ndef _write_requirements(stream, reqs):\n lines = yield_lines(reqs or ())\n append_cr = lambda line: line + '\\n'\n lines = map(append_cr, lines)\n stream.writelines(lines)\n\n\ndef write_requirements(cmd, basename, filename):\n dist = cmd.distribution\n data = six.StringIO()\n _write_requirements(data, dist.install_requires)\n extras_require = dist.extras_require or {}\n for extra in sorted(extras_require):\n data.write('\\n[{extra}]\\n'.format(**vars()))\n _write_requirements(data, extras_require[extra])\n cmd.write_or_delete_file(\"requirements\", filename, data.getvalue())\n\n\ndef write_setup_requirements(cmd, basename, filename):\n data = StringIO()\n _write_requirements(data, cmd.distribution.setup_requires)\n cmd.write_or_delete_file(\"setup-requirements\", filename, data.getvalue())\n\n\ndef write_toplevel_names(cmd, basename, filename):\n pkgs = dict.fromkeys(\n [\n k.split('.', 1)[0]\n for k in cmd.distribution.iter_distribution_names()\n ]\n )\n cmd.write_file(\"top-level names\", filename, '\\n'.join(sorted(pkgs)) + '\\n')\n\n\ndef overwrite_arg(cmd, basename, filename):\n write_arg(cmd, basename, filename, True)\n\n\ndef write_arg(cmd, basename, filename, force=False):\n argname = os.path.splitext(basename)[0]\n value = getattr(cmd.distribution, argname, None)\n if value is not None:\n value = '\\n'.join(value) + '\\n'\n cmd.write_or_delete_file(argname, filename, value, force)\n\n\ndef write_entries(cmd, basename, filename):\n ep = cmd.distribution.entry_points\n\n if isinstance(ep, six.string_types) or ep is None:\n data = ep\n elif ep is not None:\n data = []\n for section, contents in sorted(ep.items()):\n if not isinstance(contents, six.string_types):\n contents = EntryPoint.parse_group(section, contents)\n contents = '\\n'.join(sorted(map(str, contents.values())))\n data.append('[%s]\\n%s\\n\\n' % (section, contents))\n data = ''.join(data)\n\n cmd.write_or_delete_file('entry points', filename, data, True)\n\n\ndef get_pkg_info_revision():\n \"\"\"\n Get a -r### off of PKG-INFO Version in case this is an sdist of\n a subversion revision.\n \"\"\"\n warnings.warn(\"get_pkg_info_revision is deprecated.\", DeprecationWarning)\n if os.path.exists('PKG-INFO'):\n with io.open('PKG-INFO') as f:\n for line in f:\n match = re.match(r\"Version:.*-r(\\d+)\\s*$\", line)\n if match:\n return int(match.group(1))\n return 0\n"} {"text": "\r\n\r\n\r\n\r\n\r\nUses of Class org.deidentifier.arx.risk.RiskModelSampleSummary.RiskSummary\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
    \r\n
  • Prev
  • \r\n
  • Next
  • \r\n
\r\n\r\n\r\n
\r\n\r\n
\r\n\r\n\r\n
\r\n\r\n
\r\n

Uses of Class
org.deidentifier.arx.risk.RiskModelSampleSummary.RiskSummary

\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
    \r\n
  • Prev
  • \r\n
  • Next
  • \r\n
\r\n\r\n\r\n
\r\n\r\n
\r\n\r\n\r\n
\r\n\r\n\r\n\r\n"} {"text": "/*\nTo customize the look and feel of Ionic, you can override the variables\nin ionic's _variables.scss file.\n\nFor example, you might change some of the default colors:\n\n$light: #fff !default;\n$stable: #f8f8f8 !default;\n$positive: #387ef5 !default;\n$calm: #11c1f3 !default;\n$balanced: #33cd5f !default;\n$energized: #ffc900 !default;\n$assertive: #ef473a !default;\n$royal: #886aea !default;\n$dark: #444 !default;\n*/\n\n// The path for our ionicons font files, relative to the built CSS in www/css\n$ionicons-font-path: \"../lib/ionic/fonts\" !default;\n\n// Include all of Ionic\n@import \"www/lib/ionic/scss/ionic\";\n\n"} {"text": "

Module: A\n \n \n \n

\n
\n \n\n \n \n \n \n \n\n \n\n \n
\n
Defined in:
\n
(stdin)
\n
\n \n
\n\n\n\n\n\n

Foo collapse

\n
    \n \n
  • \n \n \n #foo_attr \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n
    Returns the value of attribute foo_attr.
    \n \n
  • \n\n \n
\n\n\n\n\n \n

\n Foo\n collapse\n

\n\n
    \n \n
  • \n \n \n .bar \n \n\n \n \n \n \n \n \n \n \n \n\n \n
    \n \n
  • \n\n \n
  • \n \n \n #foo \n \n\n \n \n \n \n \n \n \n \n \n\n \n
    \n \n
  • \n\n \n
\n \n

\n Bar\n collapse\n

\n\n
    \n \n
  • \n \n \n #baz \n \n\n \n \n \n \n \n \n \n \n \n\n \n
    \n \n
  • \n\n \n
\n \n

\n Class Method Summary\n collapse\n

\n\n
    \n \n
  • \n \n \n .baz \n \n\n \n \n \n \n \n \n \n \n \n\n \n
    \n \n
  • \n\n \n
\n \n\n\n
\n

Instance Attribute Details

\n \n \n \n
\n

\n \n #foo_attr \n \n\n \n\n \n

\n
\n Returns the value of attribute foo_attr.\n\n
\n
\n
\n \n\n
\n \n \n \n \n
\n
\n\n\n3\n4\n5
\n
\n
# File '(stdin)', line 3\n\ndef foo_attr\n  @foo_attr\nend
\n
\n
\n \n
\n\n\n
\n

Class Method Details

\n\n \n
\n

\n \n .bar \n \n\n \n\n \n

\n \n \n \n \n
\n
\n\n\n5
\n
\n
# File '(stdin)', line 5\n\ndef self.bar; end
\n
\n
\n \n
\n

\n \n .baz \n \n\n \n\n \n

\n \n \n \n \n
\n
\n\n\n12
\n
\n
# File '(stdin)', line 12\n\ndef self.baz; end
\n
\n
\n \n
\n\n
\n

Instance Method Details

\n\n \n
\n

\n \n #baz \n \n\n \n\n \n

\n \n \n \n \n
\n
\n\n\n8
\n
\n
# File '(stdin)', line 8\n\ndef baz; end
\n
\n
\n \n
\n

\n \n #foo \n \n\n \n\n \n

\n \n \n \n \n
\n
\n\n\n4
\n
\n
# File '(stdin)', line 4\n\ndef foo; end
\n
\n
\n \n
\n"} {"text": "import AFRAME from 'aframe';\nimport 'aframe-particle-system-component';"} {"text": "// SPDX-License-Identifier: GPL-2.0-or-later\n/*\n * Copyright (c) by Uros Bizjak \n *\n * Midi synth routines for OPL2/OPL3/OPL4 FM\n */\n\n#undef DEBUG_ALLOC\n#undef DEBUG_MIDI\n\n#include \"opl3_voice.h\"\n#include \n\nstatic void snd_opl3_note_off_unsafe(void *p, int note, int vel,\n\t\t\t\t struct snd_midi_channel *chan);\n/*\n * The next table looks magical, but it certainly is not. Its values have\n * been calculated as table[i]=8*log(i/64)/log(2) with an obvious exception\n * for i=0. This log-table converts a linear volume-scaling (0..127) to a\n * logarithmic scaling as present in the FM-synthesizer chips. so : Volume\n * 64 = 0 db = relative volume 0 and: Volume 32 = -6 db = relative\n * volume -8 it was implemented as a table because it is only 128 bytes and\n * it saves a lot of log() calculations. (Rob Hooft )\n */\n\nstatic const char opl3_volume_table[128] =\n{\n\t-63, -48, -40, -35, -32, -29, -27, -26,\n\t-24, -23, -21, -20, -19, -18, -18, -17,\n\t-16, -15, -15, -14, -13, -13, -12, -12,\n\t-11, -11, -10, -10, -10, -9, -9, -8,\n\t-8, -8, -7, -7, -7, -6, -6, -6,\n\t-5, -5, -5, -5, -4, -4, -4, -4,\n\t-3, -3, -3, -3, -2, -2, -2, -2,\n\t-2, -1, -1, -1, -1, 0, 0, 0,\n\t0, 0, 0, 1, 1, 1, 1, 1,\n\t1, 2, 2, 2, 2, 2, 2, 2,\n\t3, 3, 3, 3, 3, 3, 3, 4,\n\t4, 4, 4, 4, 4, 4, 4, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5,\n\t6, 6, 6, 6, 6, 6, 6, 6,\n\t6, 7, 7, 7, 7, 7, 7, 7,\n\t7, 7, 7, 8, 8, 8, 8, 8\n};\n\nvoid snd_opl3_calc_volume(unsigned char *volbyte, int vel,\n\t\t\t struct snd_midi_channel *chan)\n{\n\tint oldvol, newvol, n;\n\tint volume;\n\n\tvolume = (vel * chan->gm_volume * chan->gm_expression) / (127*127);\n\tif (volume > 127)\n\t\tvolume = 127;\n\n\toldvol = OPL3_TOTAL_LEVEL_MASK - (*volbyte & OPL3_TOTAL_LEVEL_MASK);\n\n\tnewvol = opl3_volume_table[volume] + oldvol;\n\tif (newvol > OPL3_TOTAL_LEVEL_MASK)\n\t\tnewvol = OPL3_TOTAL_LEVEL_MASK;\n\telse if (newvol < 0)\n\t\tnewvol = 0;\n\n\tn = OPL3_TOTAL_LEVEL_MASK - (newvol & OPL3_TOTAL_LEVEL_MASK);\n\n\t*volbyte = (*volbyte & OPL3_KSL_MASK) | (n & OPL3_TOTAL_LEVEL_MASK);\n}\n\n/*\n * Converts the note frequency to block and fnum values for the FM chip\n */\nstatic const short opl3_note_table[16] =\n{\n\t305, 323,\t/* for pitch bending, -2 semitones */\n\t343, 363, 385, 408, 432, 458, 485, 514, 544, 577, 611, 647,\n\t686, 726\t/* for pitch bending, +2 semitones */\n};\n\nstatic void snd_opl3_calc_pitch(unsigned char *fnum, unsigned char *blocknum,\n\t\t\t\tint note, struct snd_midi_channel *chan)\n{\n\tint block = ((note / 12) & 0x07) - 1;\n\tint idx = (note % 12) + 2;\n\tint freq;\n\n\tif (chan->midi_pitchbend) {\n\t\tint pitchbend = chan->midi_pitchbend;\n\t\tint segment;\n\n\t\tif (pitchbend < -0x2000)\n\t\t\tpitchbend = -0x2000;\n\t\tif (pitchbend > 0x1FFF)\n\t\t\tpitchbend = 0x1FFF;\n\n\t\tsegment = pitchbend / 0x1000;\n\t\tfreq = opl3_note_table[idx+segment];\n\t\tfreq += ((opl3_note_table[idx+segment+1] - freq) *\n\t\t\t (pitchbend % 0x1000)) / 0x1000;\n\t} else {\n\t\tfreq = opl3_note_table[idx];\n\t}\n\n\t*fnum = (unsigned char) freq;\n\t*blocknum = ((freq >> 8) & OPL3_FNUM_HIGH_MASK) |\n\t\t((block << 2) & OPL3_BLOCKNUM_MASK);\n}\n\n\n#ifdef DEBUG_ALLOC\nstatic void debug_alloc(struct snd_opl3 *opl3, char *s, int voice) {\n\tint i;\n\tchar *str = \"x.24\";\n\n\tprintk(KERN_DEBUG \"time %.5i: %s [%.2i]: \", opl3->use_time, s, voice);\n\tfor (i = 0; i < opl3->max_voices; i++)\n\t\tprintk(KERN_CONT \"%c\", *(str + opl3->voices[i].state + 1));\n\tprintk(KERN_CONT \"\\n\");\n}\n#endif\n\n/*\n * Get a FM voice (channel) to play a note on.\n */\nstatic int opl3_get_voice(struct snd_opl3 *opl3, int instr_4op,\n\t\t\t struct snd_midi_channel *chan) {\n\tint chan_4op_1;\t\t/* first voice for 4op instrument */\n\tint chan_4op_2;\t\t/* second voice for 4op instrument */\n\n\tstruct snd_opl3_voice *vp, *vp2;\n\tunsigned int voice_time;\n\tint i;\n\n#ifdef DEBUG_ALLOC\n\tchar *alloc_type[3] = { \"FREE \", \"CHEAP \", \"EXPENSIVE\" };\n#endif\n\n\t/* This is our \"allocation cost\" table */\n\tenum {\n\t\tFREE = 0, CHEAP, EXPENSIVE, END\n\t};\n\n\t/* Keeps track of what we are finding */\n\tstruct best {\n\t\tunsigned int time;\n\t\tint voice;\n\t} best[END];\n\tstruct best *bp;\n\n\tfor (i = 0; i < END; i++) {\n\t\tbest[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */\n\t\tbest[i].voice = -1;\n\t}\n\n\t/* Look through all the channels for the most suitable. */\n\tfor (i = 0; i < opl3->max_voices; i++) {\n\t\tvp = &opl3->voices[i];\n\n\t\tif (vp->state == SNDRV_OPL3_ST_NOT_AVAIL)\n\t\t /* skip unavailable channels, allocated by\n\t\t drum voices or by bounded 4op voices) */\n\t\t\tcontinue;\n\n\t\tvoice_time = vp->time;\n\t\tbp = best;\n\n\t\tchan_4op_1 = ((i < 3) || (i > 8 && i < 12));\n\t\tchan_4op_2 = ((i > 2 && i < 6) || (i > 11 && i < 15));\n\t\tif (instr_4op) {\n\t\t\t/* allocate 4op voice */\n\t\t\t/* skip channels unavailable to 4op instrument */\n\t\t\tif (!chan_4op_1)\n\t\t\t\tcontinue;\n\n\t\t\tif (vp->state)\n\t\t\t\t/* kill one voice, CHEAP */\n\t\t\t\tbp++;\n\t\t\t/* get state of bounded 2op channel\n\t\t\t to be allocated for 4op instrument */\n\t\t\tvp2 = &opl3->voices[i + 3];\n\t\t\tif (vp2->state == SNDRV_OPL3_ST_ON_2OP) {\n\t\t\t\t/* kill two voices, EXPENSIVE */\n\t\t\t\tbp++;\n\t\t\t\tvoice_time = (voice_time > vp->time) ?\n\t\t\t\t\tvoice_time : vp->time;\n\t\t\t}\n\t\t} else {\n\t\t\t/* allocate 2op voice */\n\t\t\tif ((chan_4op_1) || (chan_4op_2))\n\t\t\t\t/* use bounded channels for 2op, CHEAP */\n\t\t\t\tbp++;\n\t\t\telse if (vp->state)\n\t\t\t\t/* kill one voice on 2op channel, CHEAP */\n\t\t\t\tbp++;\n\t\t\t/* raise kill cost to EXPENSIVE for all channels */\n\t\t\tif (vp->state)\n\t\t\t\tbp++;\n\t\t}\n\t\tif (voice_time < bp->time) {\n\t\t\tbp->time = voice_time;\n\t\t\tbp->voice = i;\n\t\t}\n\t}\n\n\tfor (i = 0; i < END; i++) {\n\t\tif (best[i].voice >= 0) {\n#ifdef DEBUG_ALLOC\n\t\t\tprintk(KERN_DEBUG \"%s %iop allocation on voice %i\\n\",\n\t\t\t alloc_type[i], instr_4op ? 4 : 2,\n\t\t\t best[i].voice);\n#endif\n\t\t\treturn best[i].voice;\n\t\t}\n\t}\n\t/* not found */\n\treturn -1;\n}\n\n/* ------------------------------ */\n\n/*\n * System timer interrupt function\n */\nvoid snd_opl3_timer_func(struct timer_list *t)\n{\n\n\tstruct snd_opl3 *opl3 = from_timer(opl3, t, tlist);\n\tunsigned long flags;\n\tint again = 0;\n\tint i;\n\n\tspin_lock_irqsave(&opl3->voice_lock, flags);\n\tfor (i = 0; i < opl3->max_voices; i++) {\n\t\tstruct snd_opl3_voice *vp = &opl3->voices[i];\n\t\tif (vp->state > 0 && vp->note_off_check) {\n\t\t\tif (vp->note_off == jiffies)\n\t\t\t\tsnd_opl3_note_off_unsafe(opl3, vp->note, 0,\n\t\t\t\t\t\t\t vp->chan);\n\t\t\telse\n\t\t\t\tagain++;\n\t\t}\n\t}\n\tspin_unlock_irqrestore(&opl3->voice_lock, flags);\n\n\tspin_lock_irqsave(&opl3->sys_timer_lock, flags);\n\tif (again)\n\t\tmod_timer(&opl3->tlist, jiffies + 1);\t/* invoke again */\n\telse\n\t\topl3->sys_timer_status = 0;\n\tspin_unlock_irqrestore(&opl3->sys_timer_lock, flags);\n}\n\n/*\n * Start system timer\n */\nstatic void snd_opl3_start_timer(struct snd_opl3 *opl3)\n{\n\tunsigned long flags;\n\tspin_lock_irqsave(&opl3->sys_timer_lock, flags);\n\tif (! opl3->sys_timer_status) {\n\t\tmod_timer(&opl3->tlist, jiffies + 1);\n\t\topl3->sys_timer_status = 1;\n\t}\n\tspin_unlock_irqrestore(&opl3->sys_timer_lock, flags);\n}\n\n/* ------------------------------ */\n\n\nstatic const int snd_opl3_oss_map[MAX_OPL3_VOICES] = {\n\t0, 1, 2, 9, 10, 11, 6, 7, 8, 15, 16, 17, 3, 4 ,5, 12, 13, 14\n};\n\n/*\n * Start a note.\n */\nvoid snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)\n{\n\tstruct snd_opl3 *opl3;\n\tint instr_4op;\n\n\tint voice;\n\tstruct snd_opl3_voice *vp, *vp2;\n\tunsigned short connect_mask;\n\tunsigned char connection;\n\tunsigned char vol_op[4];\n\n\tint extra_prg = 0;\n\n\tunsigned short reg_side;\n\tunsigned char op_offset;\n\tunsigned char voice_offset;\n\tunsigned short opl3_reg;\n\tunsigned char reg_val;\n\tunsigned char prg, bank;\n\n\tint key = note;\n\tunsigned char fnum, blocknum;\n\tint i;\n\n\tstruct fm_patch *patch;\n\tstruct fm_instrument *fm;\n\tunsigned long flags;\n\n\topl3 = p;\n\n#ifdef DEBUG_MIDI\n\tsnd_printk(KERN_DEBUG \"Note on, ch %i, inst %i, note %i, vel %i\\n\",\n\t\t chan->number, chan->midi_program, note, vel);\n#endif\n\n\t/* in SYNTH mode, application takes care of voices */\n\t/* in SEQ mode, drum voice numbers are notes on drum channel */\n\tif (opl3->synth_mode == SNDRV_OPL3_MODE_SEQ) {\n\t\tif (chan->drum_channel) {\n\t\t\t/* percussion instruments are located in bank 128 */\n\t\t\tbank = 128;\n\t\t\tprg = note;\n\t\t} else {\n\t\t\tbank = chan->gm_bank_select;\n\t\t\tprg = chan->midi_program;\n\t\t}\n\t} else {\n\t\t/* Prepare for OSS mode */\n\t\tif (chan->number >= MAX_OPL3_VOICES)\n\t\t\treturn;\n\n\t\t/* OSS instruments are located in bank 127 */\n\t\tbank = 127;\n\t\tprg = chan->midi_program;\n\t}\n\n\tspin_lock_irqsave(&opl3->voice_lock, flags);\n\n\tif (use_internal_drums) {\n\t\tsnd_opl3_drum_switch(opl3, note, vel, 1, chan);\n\t\tspin_unlock_irqrestore(&opl3->voice_lock, flags);\n\t\treturn;\n\t}\n\n __extra_prg:\n\tpatch = snd_opl3_find_patch(opl3, prg, bank, 0);\n\tif (!patch) {\n\t\tspin_unlock_irqrestore(&opl3->voice_lock, flags);\n\t\treturn;\n\t}\n\n\tfm = &patch->inst;\n\tswitch (patch->type) {\n\tcase FM_PATCH_OPL2:\n\t\tinstr_4op = 0;\n\t\tbreak;\n\tcase FM_PATCH_OPL3:\n\t\tif (opl3->hardware >= OPL3_HW_OPL3) {\n\t\t\tinstr_4op = 1;\n\t\t\tbreak;\n\t\t}\n\t\tfallthrough;\n\tdefault:\n\t\tspin_unlock_irqrestore(&opl3->voice_lock, flags);\n\t\treturn;\n\t}\n#ifdef DEBUG_MIDI\n\tsnd_printk(KERN_DEBUG \" --> OPL%i instrument: %s\\n\",\n\t\t instr_4op ? 3 : 2, patch->name);\n#endif\n\t/* in SYNTH mode, application takes care of voices */\n\t/* in SEQ mode, allocate voice on free OPL3 channel */\n\tif (opl3->synth_mode == SNDRV_OPL3_MODE_SEQ) {\n\t\tvoice = opl3_get_voice(opl3, instr_4op, chan);\n\t} else {\n\t\t/* remap OSS voice */\n\t\tvoice = snd_opl3_oss_map[chan->number];\t\t\n\t}\n\n\tif (voice < 0) {\n\t\tspin_unlock_irqrestore(&opl3->voice_lock, flags);\n\t\treturn;\n\t}\n\n\tif (voice < MAX_OPL2_VOICES) {\n\t\t/* Left register block for voices 0 .. 8 */\n\t\treg_side = OPL3_LEFT;\n\t\tvoice_offset = voice;\n\t\tconnect_mask = (OPL3_LEFT_4OP_0 << voice_offset) & 0x07;\n\t} else {\n\t\t/* Right register block for voices 9 .. 17 */\n\t\treg_side = OPL3_RIGHT;\n\t\tvoice_offset = voice - MAX_OPL2_VOICES;\n\t\tconnect_mask = (OPL3_RIGHT_4OP_0 << voice_offset) & 0x38;\n\t}\n\n\t/* kill voice on channel */\n\tvp = &opl3->voices[voice];\n\tif (vp->state > 0) {\n\t\topl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK + voice_offset);\n\t\treg_val = vp->keyon_reg & ~OPL3_KEYON_BIT;\n\t\topl3->command(opl3, opl3_reg, reg_val);\n\t}\n\tif (instr_4op) {\n\t\tvp2 = &opl3->voices[voice + 3];\n\t\tif (vp->state > 0) {\n\t\t\topl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK +\n\t\t\t\t\t voice_offset + 3);\n\t\t\treg_val = vp->keyon_reg & ~OPL3_KEYON_BIT;\n\t\t\topl3->command(opl3, opl3_reg, reg_val);\n\t\t}\n\t}\n\n\t/* set connection register */\n\tif (instr_4op) {\n\t\tif ((opl3->connection_reg ^ connect_mask) & connect_mask) {\n\t\t\topl3->connection_reg |= connect_mask;\n\t\t\t/* set connection bit */\n\t\t\topl3_reg = OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT;\n\t\t\topl3->command(opl3, opl3_reg, opl3->connection_reg);\n\t\t}\n\t} else {\n\t\tif ((opl3->connection_reg ^ ~connect_mask) & connect_mask) {\n\t\t\topl3->connection_reg &= ~connect_mask;\n\t\t\t/* clear connection bit */\n\t\t\topl3_reg = OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT;\n\t\t\topl3->command(opl3, opl3_reg, opl3->connection_reg);\n\t\t}\n\t}\n\n#ifdef DEBUG_MIDI\n\tsnd_printk(KERN_DEBUG \" --> setting OPL3 connection: 0x%x\\n\",\n\t\t opl3->connection_reg);\n#endif\n\t/*\n\t * calculate volume depending on connection\n\t * between FM operators (see include/opl3.h)\n\t */\n\tfor (i = 0; i < (instr_4op ? 4 : 2); i++)\n\t\tvol_op[i] = fm->op[i].ksl_level;\n\n\tconnection = fm->feedback_connection[0] & 0x01;\n\tif (instr_4op) {\n\t\tconnection <<= 1;\n\t\tconnection |= fm->feedback_connection[1] & 0x01;\n\n\t\tsnd_opl3_calc_volume(&vol_op[3], vel, chan);\n\t\tswitch (connection) {\n\t\tcase 0x03:\n\t\t\tsnd_opl3_calc_volume(&vol_op[2], vel, chan);\n\t\t\tfallthrough;\n\t\tcase 0x02:\n\t\t\tsnd_opl3_calc_volume(&vol_op[0], vel, chan);\n\t\t\tbreak;\n\t\tcase 0x01:\n\t\t\tsnd_opl3_calc_volume(&vol_op[1], vel, chan);\n\t\t}\n\t} else {\n\t\tsnd_opl3_calc_volume(&vol_op[1], vel, chan);\n\t\tif (connection)\n\t\t\tsnd_opl3_calc_volume(&vol_op[0], vel, chan);\n\t}\n\n\t/* Program the FM voice characteristics */\n\tfor (i = 0; i < (instr_4op ? 4 : 2); i++) {\n#ifdef DEBUG_MIDI\n\t\tsnd_printk(KERN_DEBUG \" --> programming operator %i\\n\", i);\n#endif\n\t\top_offset = snd_opl3_regmap[voice_offset][i];\n\n\t\t/* Set OPL3 AM_VIB register of requested voice/operator */ \n\t\treg_val = fm->op[i].am_vib;\n\t\topl3_reg = reg_side | (OPL3_REG_AM_VIB + op_offset);\n\t\topl3->command(opl3, opl3_reg, reg_val);\n\n\t\t/* Set OPL3 KSL_LEVEL register of requested voice/operator */ \n\t\treg_val = vol_op[i];\n\t\topl3_reg = reg_side | (OPL3_REG_KSL_LEVEL + op_offset);\n\t\topl3->command(opl3, opl3_reg, reg_val);\n\n\t\t/* Set OPL3 ATTACK_DECAY register of requested voice/operator */ \n\t\treg_val = fm->op[i].attack_decay;\n\t\topl3_reg = reg_side | (OPL3_REG_ATTACK_DECAY + op_offset);\n\t\topl3->command(opl3, opl3_reg, reg_val);\n\n\t\t/* Set OPL3 SUSTAIN_RELEASE register of requested voice/operator */ \n\t\treg_val = fm->op[i].sustain_release;\n\t\topl3_reg = reg_side | (OPL3_REG_SUSTAIN_RELEASE + op_offset);\n\t\topl3->command(opl3, opl3_reg, reg_val);\n\n\t\t/* Select waveform */\n\t\treg_val = fm->op[i].wave_select;\n\t\topl3_reg = reg_side | (OPL3_REG_WAVE_SELECT + op_offset);\n\t\topl3->command(opl3, opl3_reg, reg_val);\n\t}\n\n\t/* Set operator feedback and 2op inter-operator connection */\n\treg_val = fm->feedback_connection[0];\n\t/* Set output voice connection */\n\treg_val |= OPL3_STEREO_BITS;\n\tif (chan->gm_pan < 43)\n\t\treg_val &= ~OPL3_VOICE_TO_RIGHT;\n\tif (chan->gm_pan > 85)\n\t\treg_val &= ~OPL3_VOICE_TO_LEFT;\n\topl3_reg = reg_side | (OPL3_REG_FEEDBACK_CONNECTION + voice_offset);\n\topl3->command(opl3, opl3_reg, reg_val);\n\n\tif (instr_4op) {\n\t\t/* Set 4op inter-operator connection */\n\t\treg_val = fm->feedback_connection[1] & OPL3_CONNECTION_BIT;\n\t\t/* Set output voice connection */\n\t\treg_val |= OPL3_STEREO_BITS;\n\t\tif (chan->gm_pan < 43)\n\t\t\treg_val &= ~OPL3_VOICE_TO_RIGHT;\n\t\tif (chan->gm_pan > 85)\n\t\t\treg_val &= ~OPL3_VOICE_TO_LEFT;\n\t\topl3_reg = reg_side | (OPL3_REG_FEEDBACK_CONNECTION +\n\t\t\t\t voice_offset + 3);\n\t\topl3->command(opl3, opl3_reg, reg_val);\n\t}\n\n\t/*\n\t * Special treatment of percussion notes for fm:\n\t * Requested pitch is really program, and pitch for\n\t * device is whatever was specified in the patch library.\n\t */\n\tif (fm->fix_key)\n\t\tnote = fm->fix_key;\n\t/*\n\t * use transpose if defined in patch library\n\t */\n\tif (fm->trnsps)\n\t\tnote += (fm->trnsps - 64);\n\n\tsnd_opl3_calc_pitch(&fnum, &blocknum, note, chan);\n\n\t/* Set OPL3 FNUM_LOW register of requested voice */\n\topl3_reg = reg_side | (OPL3_REG_FNUM_LOW + voice_offset);\n\topl3->command(opl3, opl3_reg, fnum);\n\n\topl3->voices[voice].keyon_reg = blocknum;\n\n\t/* Set output sound flag */\n\tblocknum |= OPL3_KEYON_BIT;\n\n#ifdef DEBUG_MIDI\n\tsnd_printk(KERN_DEBUG \" --> trigger voice %i\\n\", voice);\n#endif\n\t/* Set OPL3 KEYON_BLOCK register of requested voice */ \n\topl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK + voice_offset);\n\topl3->command(opl3, opl3_reg, blocknum);\n\n\t/* kill note after fixed duration (in centiseconds) */\n\tif (fm->fix_dur) {\n\t\topl3->voices[voice].note_off = jiffies +\n\t\t\t(fm->fix_dur * HZ) / 100;\n\t\tsnd_opl3_start_timer(opl3);\n\t\topl3->voices[voice].note_off_check = 1;\n\t} else\n\t\topl3->voices[voice].note_off_check = 0;\n\n\t/* get extra pgm, but avoid possible loops */\n\textra_prg = (extra_prg) ? 0 : fm->modes;\n\n\t/* do the bookkeeping */\n\tvp->time = opl3->use_time++;\n\tvp->note = key;\n\tvp->chan = chan;\n\n\tif (instr_4op) {\n\t\tvp->state = SNDRV_OPL3_ST_ON_4OP;\n\n\t\tvp2 = &opl3->voices[voice + 3];\n\t\tvp2->time = opl3->use_time++;\n\t\tvp2->note = key;\n\t\tvp2->chan = chan;\n\t\tvp2->state = SNDRV_OPL3_ST_NOT_AVAIL;\n\t} else {\n\t\tif (vp->state == SNDRV_OPL3_ST_ON_4OP) {\n\t\t\t/* 4op killed by 2op, release bounded voice */\n\t\t\tvp2 = &opl3->voices[voice + 3];\n\t\t\tvp2->time = opl3->use_time++;\n\t\t\tvp2->state = SNDRV_OPL3_ST_OFF;\n\t\t}\n\t\tvp->state = SNDRV_OPL3_ST_ON_2OP;\n\t}\n\n#ifdef DEBUG_ALLOC\n\tdebug_alloc(opl3, \"note on \", voice);\n#endif\n\n\t/* allocate extra program if specified in patch library */\n\tif (extra_prg) {\n\t\tif (extra_prg > 128) {\n\t\t\tbank = 128;\n\t\t\t/* percussions start at 35 */\n\t\t\tprg = extra_prg - 128 + 35 - 1;\n\t\t} else {\n\t\t\tbank = 0;\n\t\t\tprg = extra_prg - 1;\n\t\t}\n#ifdef DEBUG_MIDI\n\t\tsnd_printk(KERN_DEBUG \" *** allocating extra program\\n\");\n#endif\n\t\tgoto __extra_prg;\n\t}\n\tspin_unlock_irqrestore(&opl3->voice_lock, flags);\n}\n\nstatic void snd_opl3_kill_voice(struct snd_opl3 *opl3, int voice)\n{\n\tunsigned short reg_side;\n\tunsigned char voice_offset;\n\tunsigned short opl3_reg;\n\n\tstruct snd_opl3_voice *vp, *vp2;\n\n\tif (snd_BUG_ON(voice >= MAX_OPL3_VOICES))\n\t\treturn;\n\n\tvp = &opl3->voices[voice];\n\tif (voice < MAX_OPL2_VOICES) {\n\t\t/* Left register block for voices 0 .. 8 */\n\t\treg_side = OPL3_LEFT;\n\t\tvoice_offset = voice;\n\t} else {\n\t\t/* Right register block for voices 9 .. 17 */\n\t\treg_side = OPL3_RIGHT;\n\t\tvoice_offset = voice - MAX_OPL2_VOICES;\n\t}\n\n\t/* kill voice */\n#ifdef DEBUG_MIDI\n\tsnd_printk(KERN_DEBUG \" --> kill voice %i\\n\", voice);\n#endif\n\topl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK + voice_offset);\n\t/* clear Key ON bit */\n\topl3->command(opl3, opl3_reg, vp->keyon_reg);\n\n\t/* do the bookkeeping */\n\tvp->time = opl3->use_time++;\n\n\tif (vp->state == SNDRV_OPL3_ST_ON_4OP) {\n\t\tvp2 = &opl3->voices[voice + 3];\n\n\t\tvp2->time = opl3->use_time++;\n\t\tvp2->state = SNDRV_OPL3_ST_OFF;\n\t}\n\tvp->state = SNDRV_OPL3_ST_OFF;\n#ifdef DEBUG_ALLOC\n\tdebug_alloc(opl3, \"note off\", voice);\n#endif\n\n}\n\n/*\n * Release a note in response to a midi note off.\n */\nstatic void snd_opl3_note_off_unsafe(void *p, int note, int vel,\n\t\t\t\t struct snd_midi_channel *chan)\n{\n \tstruct snd_opl3 *opl3;\n\n\tint voice;\n\tstruct snd_opl3_voice *vp;\n\n\topl3 = p;\n\n#ifdef DEBUG_MIDI\n\tsnd_printk(KERN_DEBUG \"Note off, ch %i, inst %i, note %i\\n\",\n\t\t chan->number, chan->midi_program, note);\n#endif\n\n\tif (opl3->synth_mode == SNDRV_OPL3_MODE_SEQ) {\n\t\tif (chan->drum_channel && use_internal_drums) {\n\t\t\tsnd_opl3_drum_switch(opl3, note, vel, 0, chan);\n\t\t\treturn;\n\t\t}\n\t\t/* this loop will hopefully kill all extra voices, because\n\t\t they are grouped by the same channel and note values */\n\t\tfor (voice = 0; voice < opl3->max_voices; voice++) {\n\t\t\tvp = &opl3->voices[voice];\n\t\t\tif (vp->state > 0 && vp->chan == chan && vp->note == note) {\n\t\t\t\tsnd_opl3_kill_voice(opl3, voice);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t/* remap OSS voices */\n\t\tif (chan->number < MAX_OPL3_VOICES) {\n\t\t\tvoice = snd_opl3_oss_map[chan->number];\t\t\n\t\t\tsnd_opl3_kill_voice(opl3, voice);\n\t\t}\n\t}\n}\n\nvoid snd_opl3_note_off(void *p, int note, int vel,\n\t\t struct snd_midi_channel *chan)\n{\n\tstruct snd_opl3 *opl3 = p;\n\tunsigned long flags;\n\n\tspin_lock_irqsave(&opl3->voice_lock, flags);\n\tsnd_opl3_note_off_unsafe(p, note, vel, chan);\n\tspin_unlock_irqrestore(&opl3->voice_lock, flags);\n}\n\n/*\n * key pressure change\n */\nvoid snd_opl3_key_press(void *p, int note, int vel, struct snd_midi_channel *chan)\n{\n#ifdef DEBUG_MIDI\n\tsnd_printk(KERN_DEBUG \"Key pressure, ch#: %i, inst#: %i\\n\",\n\t\t chan->number, chan->midi_program);\n#endif\n}\n\n/*\n * terminate note\n */\nvoid snd_opl3_terminate_note(void *p, int note, struct snd_midi_channel *chan)\n{\n#ifdef DEBUG_MIDI\n\tsnd_printk(KERN_DEBUG \"Terminate note, ch#: %i, inst#: %i\\n\",\n\t\t chan->number, chan->midi_program);\n#endif\n}\n\nstatic void snd_opl3_update_pitch(struct snd_opl3 *opl3, int voice)\n{\n\tunsigned short reg_side;\n\tunsigned char voice_offset;\n\tunsigned short opl3_reg;\n\n\tunsigned char fnum, blocknum;\n\n\tstruct snd_opl3_voice *vp;\n\n\tif (snd_BUG_ON(voice >= MAX_OPL3_VOICES))\n\t\treturn;\n\n\tvp = &opl3->voices[voice];\n\tif (vp->chan == NULL)\n\t\treturn; /* not allocated? */\n\n\tif (voice < MAX_OPL2_VOICES) {\n\t\t/* Left register block for voices 0 .. 8 */\n\t\treg_side = OPL3_LEFT;\n\t\tvoice_offset = voice;\n\t} else {\n\t\t/* Right register block for voices 9 .. 17 */\n\t\treg_side = OPL3_RIGHT;\n\t\tvoice_offset = voice - MAX_OPL2_VOICES;\n\t}\n\n\tsnd_opl3_calc_pitch(&fnum, &blocknum, vp->note, vp->chan);\n\n\t/* Set OPL3 FNUM_LOW register of requested voice */\n\topl3_reg = reg_side | (OPL3_REG_FNUM_LOW + voice_offset);\n\topl3->command(opl3, opl3_reg, fnum);\n\n\tvp->keyon_reg = blocknum;\n\n\t/* Set output sound flag */\n\tblocknum |= OPL3_KEYON_BIT;\n\n\t/* Set OPL3 KEYON_BLOCK register of requested voice */ \n\topl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK + voice_offset);\n\topl3->command(opl3, opl3_reg, blocknum);\n\n\tvp->time = opl3->use_time++;\n}\n\n/*\n * Update voice pitch controller\n */\nstatic void snd_opl3_pitch_ctrl(struct snd_opl3 *opl3, struct snd_midi_channel *chan)\n{\n\tint voice;\n\tstruct snd_opl3_voice *vp;\n\n\tunsigned long flags;\n\n\tspin_lock_irqsave(&opl3->voice_lock, flags);\n\n\tif (opl3->synth_mode == SNDRV_OPL3_MODE_SEQ) {\n\t\tfor (voice = 0; voice < opl3->max_voices; voice++) {\n\t\t\tvp = &opl3->voices[voice];\n\t\t\tif (vp->state > 0 && vp->chan == chan) {\n\t\t\t\tsnd_opl3_update_pitch(opl3, voice);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t/* remap OSS voices */\n\t\tif (chan->number < MAX_OPL3_VOICES) {\n\t\t\tvoice = snd_opl3_oss_map[chan->number];\t\t\n\t\t\tsnd_opl3_update_pitch(opl3, voice);\n\t\t}\n\t}\n\tspin_unlock_irqrestore(&opl3->voice_lock, flags);\n}\n\n/*\n * Deal with a controller type event. This includes all types of\n * control events, not just the midi controllers\n */\nvoid snd_opl3_control(void *p, int type, struct snd_midi_channel *chan)\n{\n \tstruct snd_opl3 *opl3;\n\n\topl3 = p;\n#ifdef DEBUG_MIDI\n\tsnd_printk(KERN_DEBUG \"Controller, TYPE = %i, ch#: %i, inst#: %i\\n\",\n\t\t type, chan->number, chan->midi_program);\n#endif\n\n\tswitch (type) {\n\tcase MIDI_CTL_MSB_MODWHEEL:\n\t\tif (chan->control[MIDI_CTL_MSB_MODWHEEL] > 63)\n\t\t\topl3->drum_reg |= OPL3_VIBRATO_DEPTH;\n\t\telse \n\t\t\topl3->drum_reg &= ~OPL3_VIBRATO_DEPTH;\n\t\topl3->command(opl3, OPL3_LEFT | OPL3_REG_PERCUSSION,\n\t\t\t\t opl3->drum_reg);\n\t\tbreak;\n\tcase MIDI_CTL_E2_TREMOLO_DEPTH:\n\t\tif (chan->control[MIDI_CTL_E2_TREMOLO_DEPTH] > 63)\n\t\t\topl3->drum_reg |= OPL3_TREMOLO_DEPTH;\n\t\telse \n\t\t\topl3->drum_reg &= ~OPL3_TREMOLO_DEPTH;\n\t\topl3->command(opl3, OPL3_LEFT | OPL3_REG_PERCUSSION,\n\t\t\t\t opl3->drum_reg);\n\t\tbreak;\n\tcase MIDI_CTL_PITCHBEND:\n\t\tsnd_opl3_pitch_ctrl(opl3, chan);\n\t\tbreak;\n\t}\n}\n\n/*\n * NRPN events\n */\nvoid snd_opl3_nrpn(void *p, struct snd_midi_channel *chan,\n\t\t struct snd_midi_channel_set *chset)\n{\n#ifdef DEBUG_MIDI\n\tsnd_printk(KERN_DEBUG \"NRPN, ch#: %i, inst#: %i\\n\",\n\t\t chan->number, chan->midi_program);\n#endif\n}\n\n/*\n * receive sysex\n */\nvoid snd_opl3_sysex(void *p, unsigned char *buf, int len,\n\t\t int parsed, struct snd_midi_channel_set *chset)\n{\n#ifdef DEBUG_MIDI\n\tsnd_printk(KERN_DEBUG \"SYSEX\\n\");\n#endif\n}\n"} {"text": "{\n \"name\": \"SmartDraggableLocator\",\n \"namespace\": \"draw2d.layout.locator\",\n \"description\": \"

A DraggableLocator is used to place figures relative to the parent nearest corner. It is\\npossible to move a child node via drag&drop.

\",\n \"extends\": [],\n \"access\": \"\",\n \"virtual\": false,\n \"functions\": [\n {\n \"name\": \"init\",\n \"access\": \"\",\n \"virtual\": false,\n \"deprecated\": \"\",\n \"description\": \"

Constructs a locator with associated parent.

\",\n \"parameters\": [],\n \"inherited\": false,\n \"since\": \"\",\n \"examples\": []\n },\n {\n \"name\": \"relocate\",\n \"access\": \"\",\n \"virtual\": false,\n \"deprecated\": \"\",\n \"description\": \"

Controls the location of an I{@link draw2d.Figure}

\",\n \"parameters\": [\n {\n \"name\": \"index\",\n \"type\": \"Number\",\n \"description\": \"

child index of the figure

\",\n \"default\": \"\",\n \"optional\": \"\",\n \"nullable\": \"\"\n },\n {\n \"name\": \"figure\",\n \"type\": \"draw2d.Figure\",\n \"description\": \"

the figure to control

\",\n \"default\": \"\",\n \"optional\": \"\",\n \"nullable\": \"\"\n }\n ],\n \"inherited\": false,\n \"since\": \"\",\n \"examples\": []\n }\n ],\n \"fires\": \"\",\n \"constructor\": {\n \"name\": \"SmartDraggableLocator\",\n \"description\": \"\",\n \"parameters\": [],\n \"examples\": []\n }\n}"} {"text": "/*\n * Copyright (C) by Olivier Goffart \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, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n * for more details.\n */\n\n#include \"config.h\"\n#include \"propagateupload.h\"\n#include \"owncloudpropagator_p.h\"\n#include \"networkjobs.h\"\n#include \"account.h\"\n#include \"common/syncjournaldb.h\"\n#include \"common/syncjournalfilerecord.h\"\n#include \"common/utility.h\"\n#include \"filesystem.h\"\n#include \"propagatorjobs.h\"\n#include \"common/checksums.h\"\n#include \"syncengine.h\"\n#include \"propagateremotedelete.h\"\n#include \"common/asserts.h\"\n\n#include \n#include \n#include \n#include \n#include \n\nnamespace OCC {\n\nvoid PropagateUploadFileV1::doStartUpload()\n{\n _chunkCount = std::ceil(_fileToUpload._size / double(chunkSize()));\n _startChunk = 0;\n _transferId = qrand() ^ _item->_modtime ^ (_fileToUpload._size << 16);\n\n const SyncJournalDb::UploadInfo progressInfo = propagator()->_journal->getUploadInfo(_item->_file);\n\n if (progressInfo._valid && progressInfo.isChunked() && progressInfo._modtime == _item->_modtime && progressInfo._size == qint64(_item->_size)\n && (progressInfo._contentChecksum == _item->_checksumHeader || progressInfo._contentChecksum.isEmpty() || _item->_checksumHeader.isEmpty())) {\n _startChunk = progressInfo._chunk;\n _transferId = progressInfo._transferid;\n qCInfo(lcPropagateUpload) << _item->_file << \": Resuming from chunk \" << _startChunk;\n } else if (_chunkCount <= 1 && !_item->_checksumHeader.isEmpty()) {\n // If there is only one chunk, write the checksum in the database, so if the PUT is sent\n // to the server, but the connection drops before we get the etag, we can check the checksum\n // in reconcile (issue #5106)\n SyncJournalDb::UploadInfo pi;\n pi._valid = true;\n pi._chunk = 0;\n pi._transferid = 0; // We set a null transfer id because it is not chunked.\n pi._modtime = _item->_modtime;\n pi._errorCount = 0;\n pi._contentChecksum = _item->_checksumHeader;\n pi._size = _item->_size;\n propagator()->_journal->setUploadInfo(_item->_file, pi);\n propagator()->_journal->commit(\"Upload info\");\n }\n\n _currentChunk = 0;\n\n propagator()->reportProgress(*_item, 0);\n startNextChunk();\n}\n\nvoid PropagateUploadFileV1::startNextChunk()\n{\n if (propagator()->_abortRequested.fetchAndAddRelaxed(0))\n return;\n\n if (!_jobs.isEmpty() && _currentChunk + _startChunk >= _chunkCount - 1) {\n // Don't do parallel upload of chunk if this might be the last chunk because the server cannot handle that\n // https://github.com/owncloud/core/issues/11106\n // We return now and when the _jobs are finished we will proceed with the last chunk\n // NOTE: Some other parts of the code such as slotUploadProgress also assume that the last chunk\n // is sent last.\n return;\n }\n quint64 fileSize = _fileToUpload._size;\n auto headers = PropagateUploadFileCommon::headers();\n headers[\"OC-Total-Length\"] = QByteArray::number(fileSize);\n headers[\"OC-Chunk-Size\"] = QByteArray::number(quint64(chunkSize()));\n\n QString path = _fileToUpload._file;\n\n auto device = std::make_unique(&propagator()->_bandwidthManager);\n qint64 chunkStart = 0;\n qint64 currentChunkSize = fileSize;\n bool isFinalChunk = false;\n if (_chunkCount > 1) {\n int sendingChunk = (_currentChunk + _startChunk) % _chunkCount;\n // XOR with chunk size to make sure everything goes well if chunk size changes between runs\n uint transid = _transferId ^ chunkSize();\n qCInfo(lcPropagateUpload) << \"Upload chunk\" << sendingChunk << \"of\" << _chunkCount << \"transferid(remote)=\" << transid;\n path += QString(\"-chunking-%1-%2-%3\").arg(transid).arg(_chunkCount).arg(sendingChunk);\n\n headers[\"OC-Chunked\"] = \"1\";\n\n chunkStart = chunkSize() * quint64(sendingChunk);\n currentChunkSize = chunkSize();\n if (sendingChunk == _chunkCount - 1) { // last chunk\n currentChunkSize = (fileSize % chunkSize());\n if (currentChunkSize == 0) { // if the last chunk pretends to be 0, its actually the full chunk size.\n currentChunkSize = chunkSize();\n }\n isFinalChunk = true;\n }\n } else {\n // if there's only one chunk, it's the final one\n isFinalChunk = true;\n }\n qCDebug(lcPropagateUpload) << _chunkCount << isFinalChunk << chunkStart << currentChunkSize;\n\n if (isFinalChunk && !_transmissionChecksumHeader.isEmpty()) {\n qCInfo(lcPropagateUpload) << propagator()->_remoteFolder + path << _transmissionChecksumHeader;\n headers[checkSumHeaderC] = _transmissionChecksumHeader;\n }\n\n const QString fileName = _fileToUpload._path;\n qDebug() << \"Trying to upload\" << fileName;\n if (!device->prepareAndOpen(fileName, chunkStart, currentChunkSize)) {\n qCWarning(lcPropagateUpload) << \"Could not prepare upload device: \" << device->errorString();\n\n // If the file is currently locked, we want to retry the sync\n // when it becomes available again.\n if (FileSystem::isFileLocked(fileName)) {\n emit propagator()->seenLockedFile(fileName);\n }\n // Soft error because this is likely caused by the user modifying his files while syncing\n abortWithError(SyncFileItem::SoftError, device->errorString());\n return;\n }\n\n // job takes ownership of device via a QScopedPointer. Job deletes itself when finishing\n auto devicePtr = device.get(); // for connections later\n auto *job = new PUTFileJob(propagator()->account(), propagator()->_remoteFolder + path, std::move(device), headers, _currentChunk, this);\n _jobs.append(job);\n connect(job, &PUTFileJob::finishedSignal, this, &PropagateUploadFileV1::slotPutFinished);\n connect(job, &PUTFileJob::uploadProgress, this, &PropagateUploadFileV1::slotUploadProgress);\n connect(job, &PUTFileJob::uploadProgress, devicePtr, &UploadDevice::slotJobUploadProgress);\n connect(job, &QObject::destroyed, this, &PropagateUploadFileCommon::slotJobDestroyed);\n if (isFinalChunk)\n adjustLastJobTimeout(job, fileSize);\n job->start();\n propagator()->_activeJobList.append(this);\n _currentChunk++;\n\n bool parallelChunkUpload = true;\n\n if (propagator()->account()->capabilities().chunkingParallelUploadDisabled()) {\n // Server may also disable parallel chunked upload for any higher version\n parallelChunkUpload = false;\n } else {\n QByteArray env = qgetenv(\"OWNCLOUD_PARALLEL_CHUNK\");\n if (!env.isEmpty()) {\n parallelChunkUpload = env != \"false\" && env != \"0\";\n } else {\n int versionNum = propagator()->account()->serverVersionInt();\n if (versionNum < Account::makeServerVersion(8, 0, 3)) {\n // Disable parallel chunk upload severs older than 8.0.3 to avoid too many\n // internal sever errors (#2743, #2938)\n parallelChunkUpload = false;\n }\n }\n }\n\n if (_currentChunk + _startChunk >= _chunkCount - 1) {\n // Don't do parallel upload of chunk if this might be the last chunk because the server cannot handle that\n // https://github.com/owncloud/core/issues/11106\n parallelChunkUpload = false;\n }\n\n if (parallelChunkUpload && (propagator()->_activeJobList.count() < propagator()->maximumActiveTransferJob())\n && _currentChunk < _chunkCount) {\n startNextChunk();\n }\n if (!parallelChunkUpload || _chunkCount - _currentChunk <= 0) {\n propagator()->scheduleNextJob();\n }\n}\n\nvoid PropagateUploadFileV1::slotPutFinished()\n{\n auto *job = qobject_cast(sender());\n ASSERT(job);\n\n slotJobDestroyed(job); // remove it from the _jobs list\n\n propagator()->_activeJobList.removeOne(this);\n\n if (_finished) {\n // We have sent the finished signal already. We don't need to handle any remaining jobs\n return;\n }\n\n _item->_httpErrorCode = job->reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();\n QNetworkReply::NetworkError err = job->reply()->error();\n if (err != QNetworkReply::NoError) {\n commonErrorHandling(job);\n return;\n }\n\n // The server needs some time to process the request and provide us with a poll URL\n if (_item->_httpErrorCode == 202) {\n QString path = QString::fromUtf8(job->reply()->rawHeader(\"OC-Finish-Poll\"));\n if (path.isEmpty()) {\n done(SyncFileItem::NormalError, tr(\"Poll URL missing\"));\n return;\n }\n _finished = true;\n startPollJob(path);\n return;\n }\n\n // Check the file again post upload.\n // Two cases must be considered separately: If the upload is finished,\n // the file is on the server and has a changed ETag. In that case,\n // the etag has to be properly updated in the client journal, and because\n // of that we can bail out here with an error. But we can reschedule a\n // sync ASAP.\n // But if the upload is ongoing, because not all chunks were uploaded\n // yet, the upload can be stopped and an error can be displayed, because\n // the server hasn't registered the new file yet.\n QByteArray etag = getEtagFromReply(job->reply());\n _finished = etag.length() > 0;\n\n /* Check if the file still exists,\n * but we could be operating in a temporary file, so check both if\n * the file to upload is different than the file on disk\n */\n const QString fullFilePath(propagator()->getFilePath(_item->_file));\n if (!FileSystem::fileExists(fullFilePath)) {\n if (!_finished) {\n abortWithError(SyncFileItem::SoftError, tr(\"The local file was removed during sync.\"));\n return;\n } else {\n propagator()->_anotherSyncNeeded = true;\n }\n }\n\n // Check whether the file changed since discovery. the file check here is the original and not the temprary.\n if (!FileSystem::verifyFileUnchanged(fullFilePath, _item->_size, _item->_modtime)) {\n propagator()->_anotherSyncNeeded = true;\n if (!_finished) {\n abortWithError(SyncFileItem::SoftError, tr(\"Local file changed during sync.\"));\n // FIXME: the legacy code was retrying for a few seconds.\n // and also checking that after the last chunk, and removed the file in case of INSTRUCTION_NEW\n return;\n }\n }\n\n if (!_finished) {\n // Proceed to next chunk.\n if (_currentChunk >= _chunkCount) {\n if (!_jobs.empty()) {\n // just wait for the other job to finish.\n return;\n }\n done(SyncFileItem::NormalError, tr(\"The server did not acknowledge the last chunk. (No e-tag was present)\"));\n return;\n }\n\n // Deletes an existing blacklist entry on successful chunk upload\n if (_item->_hasBlacklistEntry) {\n propagator()->_journal->wipeErrorBlacklistEntry(_item->_file);\n _item->_hasBlacklistEntry = false;\n }\n\n SyncJournalDb::UploadInfo pi;\n pi._valid = true;\n auto currentChunk = job->_chunk;\n foreach (auto *job, _jobs) {\n // Take the minimum finished one\n if (auto putJob = qobject_cast(job)) {\n currentChunk = qMin(currentChunk, putJob->_chunk - 1);\n }\n }\n pi._chunk = (currentChunk + _startChunk + 1) % _chunkCount; // next chunk to start with\n pi._transferid = _transferId;\n pi._modtime = _item->_modtime;\n pi._errorCount = 0; // successful chunk upload resets\n pi._contentChecksum = _item->_checksumHeader;\n pi._size = _item->_size;\n propagator()->_journal->setUploadInfo(_item->_file, pi);\n propagator()->_journal->commit(\"Upload info\");\n startNextChunk();\n return;\n }\n // the following code only happens after all chunks were uploaded.\n\n // the file id should only be empty for new files up- or downloaded\n QByteArray fid = job->reply()->rawHeader(\"OC-FileID\");\n if (!fid.isEmpty()) {\n if (!_item->_fileId.isEmpty() && _item->_fileId != fid) {\n qCWarning(lcPropagateUpload) << \"File ID changed!\" << _item->_fileId << fid;\n }\n _item->_fileId = fid;\n }\n\n _item->_etag = etag;\n\n _item->_responseTimeStamp = job->responseTimestamp();\n\n if (job->reply()->rawHeader(\"X-OC-MTime\") != \"accepted\") {\n // X-OC-MTime is supported since owncloud 5.0. But not when chunking.\n // Normally Owncloud 6 always puts X-OC-MTime\n qCWarning(lcPropagateUpload) << \"Server does not support X-OC-MTime\" << job->reply()->rawHeader(\"X-OC-MTime\");\n // Well, the mtime was not set\n done(SyncFileItem::SoftError, \"Server does not support X-OC-MTime\");\n return;\n }\n\n finalize();\n}\n\n\nvoid PropagateUploadFileV1::slotUploadProgress(qint64 sent, qint64 total)\n{\n // Completion is signaled with sent=0, total=0; avoid accidentally\n // resetting progress due to the sent being zero by ignoring it.\n // finishedSignal() is bound to be emitted soon anyway.\n // See https://bugreports.qt.io/browse/QTBUG-44782.\n if (sent == 0 && total == 0) {\n return;\n }\n\n int progressChunk = _currentChunk + _startChunk - 1;\n if (progressChunk >= _chunkCount)\n progressChunk = _currentChunk - 1;\n\n // amount is the number of bytes already sent by all the other chunks that were sent\n // not including this one.\n // FIXME: this assumes all chunks have the same size, which is true only if the last chunk\n // has not been finished (which should not happen because the last chunk is sent sequentially)\n quint64 amount = progressChunk * chunkSize();\n\n sender()->setProperty(\"byteWritten\", sent);\n if (_jobs.count() > 1) {\n amount -= (_jobs.count() - 1) * chunkSize();\n foreach (QObject *j, _jobs) {\n amount += j->property(\"byteWritten\").toULongLong();\n }\n } else {\n // sender() is the only current job, no need to look at the byteWritten properties\n amount += sent;\n }\n propagator()->reportProgress(*_item, amount);\n}\n\nvoid PropagateUploadFileV1::abort(PropagatorJob::AbortType abortType)\n{\n abortNetworkJobs(\n abortType,\n [this, abortType](AbstractNetworkJob *job) {\n if (auto *putJob = qobject_cast(job)){\n if (abortType == AbortType::Asynchronous\n && _chunkCount > 0\n && (((_currentChunk + _startChunk) % _chunkCount) == 0)\n && putJob->device()->atEnd()) {\n return false;\n }\n }\n return true;\n });\n}\n\n}\n"} {"text": "/**\n * Copyright (c) 2016-present, RxJava Contributors.\n *\n * Licensed under the Apache License, Version 2.0 (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 *\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\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See\n * the License for the specific language governing permissions and limitations under the License.\n */\n\npackage io.reactivex.rxjava3.internal.operators.maybe;\n\nimport static org.junit.Assert.assertSame;\n\nimport org.junit.Test;\n\nimport io.reactivex.rxjava3.core.*;\nimport io.reactivex.rxjava3.functions.Function;\nimport io.reactivex.rxjava3.internal.fuseable.HasUpstreamSingleSource;\nimport io.reactivex.rxjava3.processors.PublishProcessor;\nimport io.reactivex.rxjava3.testsupport.TestHelper;\n\npublic class MaybeFromSingleTest extends RxJavaTest {\n @Test\n public void fromSingle() {\n Maybe.fromSingle(Single.just(1))\n .test()\n .assertResult(1);\n }\n\n @Test\n public void fromSingleThrows() {\n Maybe.fromSingle(Single.error(new UnsupportedOperationException()))\n .test()\n .assertFailure(UnsupportedOperationException.class);\n }\n\n @Test\n public void source() {\n Single c = Single.never();\n\n assertSame(c, ((HasUpstreamSingleSource)Maybe.fromSingle(c)).source());\n }\n\n @Test\n public void dispose() {\n TestHelper.checkDisposed(Maybe.fromSingle(PublishProcessor.create().singleOrError()));\n }\n\n @Test\n public void doubleOnSubscribe() {\n TestHelper.checkDoubleOnSubscribeSingleToMaybe(new Function, MaybeSource>() {\n @Override\n public MaybeSource apply(Single v) throws Exception {\n return Maybe.fromSingle(v);\n }\n });\n }\n}\n"} {"text": "---\ntitle: \"Figure 2a\"\noutput: html_document\n---\n\nTSNE of all FACS cells\n\n```{r}\nlibrary(tidyverse)\nlibrary(stringr)\nlibrary(Seurat)\nlibrary(here)\n```\n\n```{r}\nload(file=here(\"00_data_ingest\", \"11_global_robj\", \"FACS_all.Robj\"))\n```\n\n```{r}\ntissue_colors = read_csv(here(\"00_data_ingest\", \"15_color_palette\", \"tissue_colors.csv\"))\ntissue_colors <- rename(tissue_colors, tissue = X1)\n```\n\n```{r, fig.width = 8, fig.height = 6}\nlims = FetchData(tiss_FACS, c('tSNE_1', 'tSNE_2')) %>% summarize(xmin = min(tSNE_1), xmax = max(tSNE_1), ymin = min(tSNE_2), ymax = max(tSNE_2))\n\nplot_min = min(lims$xmin, lims$ymin)\nplot_max = max(lims$xmax, lims$ymax)\n\nFetchData(tiss_FACS, vars.all = c('tSNE_1','tSNE_2', 'color')) %>% \n ggplot(aes(x = tSNE_1, y = tSNE_2)) + geom_point(aes(color = color), size=0.1) + \n scale_color_identity(breaks = tissue_colors$color, \n labels = tissue_colors$tissue, \n guide = \"legend\") + \n guides(colour = guide_legend(override.aes = list(size=2))) +\n xlim(plot_min, plot_max) + ylim(plot_min, plot_max) + coord_fixed(ratio = 1) +\n xlab(\"tSNE 1\") + ylab(\"tSNE 2\")\n\nggsave(here(\"02_figure2\",\"facs_tsne_by_tissue.pdf\"), width = 14, height = 7, units = \"in\")\n\nTSNEPlot(tiss_FACS, do.label = T, pt.size = 0.1, do.return = T) +\n xlim(plot_min, plot_max) + ylim(plot_min, plot_max) + coord_fixed(ratio = 1) +\n xlab(\"tSNE 1\") + ylab(\"tSNE 2\")\n\nggsave(here(\"02_figure2\",\"facs_tsne_by_cluster.pdf\"), width = 14, height = 7, units = \"in\")\n```\n\n```{r, fig.width = 8, fig.height = 6}\nTSNEPlot(tiss_FACS, group.by = 'cell_ontology_class', do.label = T, pt.size = 0.1, do.return = T) +\n xlim(plot_min, plot_max) + ylim(plot_min, plot_max) + coord_fixed(ratio = 1) +\n xlab(\"tSNE 1\") + ylab(\"tSNE 2\")\nggsave(here(\"02_figure2\",\"facs_tsne_by_cell_ontology_class.pdf\"), width = 40, height = 25, units = \"in\")\n```\n"} {"text": "// Copyright 2017 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage idna_test\n\nimport (\n\t\"fmt\"\n\n\t\"golang.org/x/text/internal/export/idna\"\n)\n\nfunc ExampleProfile() {\n\t// Raw Punycode has no restrictions and does no mappings.\n\tfmt.Println(idna.ToASCII(\"\"))\n\tfmt.Println(idna.ToASCII(\"*.faß.com\"))\n\tfmt.Println(idna.Punycode.ToASCII(\"*.faß.com\"))\n\n\t// Rewrite IDN for lookup. This (currently) uses transitional mappings to\n\t// find a balance between IDNA2003 and IDNA2008 compatibility.\n\tfmt.Println(idna.Lookup.ToASCII(\"\"))\n\tfmt.Println(idna.Lookup.ToASCII(\"www.faß.com\"))\n\n\t// Convert an IDN to ASCII for registration purposes. This changes the\n\t// encoding, but reports an error if the input was illformed.\n\tfmt.Println(idna.Registration.ToASCII(\"\"))\n\tfmt.Println(idna.Registration.ToASCII(\"www.faß.com\"))\n\n\t// Output:\n\t// \n\t// *.xn--fa-hia.com \n\t// *.xn--fa-hia.com \n\t// \n\t// www.fass.com \n\t// idna: invalid label \"\"\n\t// www.xn--fa-hia.com \n}\n\nfunc ExampleNew() {\n\tvar p *idna.Profile\n\n\t// Raw Punycode has no restrictions and does no mappings.\n\tp = idna.New()\n\tfmt.Println(p.ToASCII(\"*.faß.com\"))\n\n\t// Do mappings. Note that star is not allowed in a DNS lookup.\n\tp = idna.New(\n\t\tidna.MapForLookup(),\n\t\tidna.Transitional(true)) // Map ß -> ss\n\tfmt.Println(p.ToASCII(\"*.faß.com\"))\n\n\t// Lookup for registration. Also does not allow '*'.\n\tp = idna.New(idna.ValidateForRegistration())\n\tfmt.Println(p.ToUnicode(\"*.faß.com\"))\n\n\t// Set up a profile maps for lookup, but allows wild cards.\n\tp = idna.New(\n\t\tidna.MapForLookup(),\n\t\tidna.Transitional(true), // Map ß -> ss\n\t\tidna.StrictDomainName(false)) // Set more permissive ASCII rules.\n\tfmt.Println(p.ToASCII(\"*.faß.com\"))\n\n\t// Output:\n\t// *.xn--fa-hia.com \n\t// *.fass.com idna: disallowed rune U+002A\n\t// *.faß.com idna: disallowed rune U+002A\n\t// *.fass.com \n}\n"} {"text": "//\n// PKSParserGenVisitor.m\n// ParseKit\n//\n// Created by Todd Ditchendorf on 3/16/13.\n//\n//\n\n#import \"PKSParserGenVisitor.h\"\n#import \n\n#import \n#import \"PKSTokenKindDescriptor.h\"\n#import \"NSString+ParseKitAdditions.h\"\n\n#import \"MGTemplateEngine.h\"\n#import \"ICUTemplateMatcher.h\"\n\n#define CLASS_NAME @\"className\"\n#define MANUAL_MEMORY @\"manualMemory\"\n#define TOKEN_KINDS_START_INDEX @\"startIndex\"\n#define TOKEN_KINDS @\"tokenKinds\"\n#define RULE_METHOD_NAMES @\"ruleMethodNames\"\n#define ENABLE_MEMOIZATION @\"enableMemoization\"\n#define ENABLE_ERROR_RECOVERY @\"enableAutomaticErrorRecovery\"\n#define PARSE_TREE @\"parseTree\"\n#define METHODS @\"methods\"\n#define METHOD_NAME @\"methodName\"\n#define METHOD_BODY @\"methodBody\"\n#define PRE_CALLBACK @\"preCallback\"\n#define POST_CALLBACK @\"postCallback\"\n#define TOKEN_KIND @\"tokenKind\"\n#define CHILD_NAME @\"childName\"\n#define DEPTH @\"depth\"\n#define LAST @\"last\"\n#define LOOKAHEAD_SET @\"lookaheadSet\"\n#define OPT_BODY @\"optBody\"\n#define DISCARD @\"discard\"\n#define NEEDS_BACKTRACK @\"needsBacktrack\"\n#define CHILD_STRING @\"childString\"\n#define TERMINAL_CALL_STRING @\"terminalCallString\"\n#define IF_TEST @\"ifTest\"\n#define ACTION_BODY @\"actionBody\"\n#define PREDICATE_BODY @\"predicateBody\"\n#define PREDICATE @\"predicate\"\n#define PREFIX @\"prefix\"\n#define SUFFIX @\"suffix\"\n#define PATTERN @\"pattern\"\n\n@interface PKSParserGenVisitor ()\n- (void)push:(NSMutableString *)mstr;\n- (NSMutableString *)pop;\n- (NSArray *)sortedLookaheadSetForNode:(PKBaseNode *)node;\n- (NSArray *)sortedArrayFromLookaheadSet:(NSSet *)set;\n- (NSSet *)lookaheadSetForNode:(PKBaseNode *)node;\n\n@property (nonatomic, retain) NSMutableArray *outputStringStack;\n@property (nonatomic, retain) NSString *currentDefName;\n@end\n\n@implementation PKSParserGenVisitor\n\n- (id)init {\n self = [super init];\n if (self) {\n self.enableHybridDFA = YES;\n self.enableMemoization = YES;\n self.preassemblerSettingBehavior = PKParserFactoryAssemblerSettingBehaviorNone;\n self.assemblerSettingBehavior = PKParserFactoryAssemblerSettingBehaviorAll;\n \n [self setUpTemplateEngine];\n }\n return self;\n}\n\n\n- (void)dealloc {\n self.engine = nil;\n self.interfaceOutputString = nil;\n self.implementationOutputString = nil;\n self.ruleMethodNames = nil;\n self.outputStringStack = nil;\n self.currentDefName = nil;\n [super dealloc];\n}\n\n\n- (NSString *)templateStringNamed:(NSString *)filename {\n NSError *err = nil;\n NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:filename ofType:@\"txt\"];\n NSString *template = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&err];\n NSAssert([template length], @\"\");\n if (!template) {\n if (err) NSLog(@\"%@\", err);\n }\n return template;\n}\n\n\n- (void)setUpTemplateEngine {\n self.engine = [MGTemplateEngine templateEngine];\n _engine.delegate = self;\n _engine.matcher = [ICUTemplateMatcher matcherWithTemplateEngine:_engine];\n}\n\n\n- (void)push:(NSMutableString *)mstr {\n NSParameterAssert([mstr isKindOfClass:[NSMutableString class]]);\n \n [_outputStringStack addObject:mstr];\n}\n\n\n- (NSMutableString *)pop {\n NSAssert([_outputStringStack count], @\"\");\n NSMutableString *mstr = [[[_outputStringStack lastObject] retain] autorelease];\n [_outputStringStack removeLastObject];\n\n NSAssert([mstr isKindOfClass:[NSMutableString class]], @\"\");\n return mstr;\n}\n\n\n- (NSArray *)sortedLookaheadSetForNode:(PKBaseNode *)node {\n return [self sortedArrayFromLookaheadSet:[self lookaheadSetForNode:node]];\n}\n\n\n- (NSArray *)sortedArrayFromLookaheadSet:(NSSet *)set {\n NSArray *result = [[set allObjects] sortedArrayUsingComparator:^NSComparisonResult(PKSTokenKindDescriptor *desc1, PKSTokenKindDescriptor *desc2) {\n return [desc1.name compare:desc2.name];\n }];\n \n return result;\n}\n\n\n- (NSSet *)lookaheadSetForNode:(PKBaseNode *)node {\n NSParameterAssert(node);\n NSAssert(self.symbolTable, @\"\");\n\n NSMutableSet *set = [NSMutableSet set];\n \n switch (node.type) {\n case PKNodeTypeConstant: {\n PKConstantNode *constNode = (PKConstantNode *)node;\n [set addObject:constNode.tokenKind];\n } break;\n case PKNodeTypeLiteral: {\n PKLiteralNode *litNode = (PKLiteralNode *)node;\n [set addObject:litNode.tokenKind];\n } break;\n case PKNodeTypeDelimited: {\n PKDelimitedNode *delimNode = (PKDelimitedNode *)node;\n [set addObject:delimNode.tokenKind];\n } break;\n case PKNodeTypeReference: {\n NSString *name = node.token.stringValue;\n PKDefinitionNode *defNode = self.symbolTable[name];\n if (!defNode) {\n NSLog(@\"missing rule named: `%@`\", name);\n }\n NSAssert1(defNode, @\"missing: %@\", name);\n [set unionSet:[self lookaheadSetForNode:defNode]];\n } break;\n case PKNodeTypeAlternation: {\n for (PKBaseNode *child in node.children) {\n [set unionSet:[self lookaheadSetForNode:child]];\n }\n } break;\n default: {\n for (PKBaseNode *child in node.children) {\n [set unionSet:[self lookaheadSetForNode:child]];\n break; // single look ahead. to implement full LL(*), this would need to be enhanced here.\n }\n } break;\n }\n \n return set;\n}\n\n\n- (void)setUpSymbolTableFromRoot:(PKRootNode *)node {\n \n NSUInteger c = [node.children count];\n \n NSMutableDictionary *symTab = [NSMutableDictionary dictionaryWithCapacity:c];\n \n for (PKBaseNode *child in node.children) {\n NSString *key = child.token.stringValue;\n symTab[key] = child;\n }\n \n self.symbolTable = symTab;\n}\n\n\n#pragma mark -\n#pragma mark PKVisitor\n\n- (void)visitRoot:(PKRootNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n NSParameterAssert(node);\n \n // setup symbol table\n [self setUpSymbolTableFromRoot:node];\n \n // setup stack\n self.outputStringStack = [NSMutableArray array];\n \n self.ruleMethodNames = [NSMutableArray array];\n \n // add namespace to token kinds\n for (PKSTokenKindDescriptor *desc in node.tokenKinds) {\n NSString *newName = [NSString stringWithFormat:@\"%@_%@\", [node.grammarName uppercaseString], desc.name];\n desc.name = newName;\n }\n \n // setup vars\n id vars = [NSMutableDictionary dictionary];\n vars[MANUAL_MEMORY] = @(!_enableARC);\n vars[TOKEN_KINDS_START_INDEX] = @(TOKEN_KIND_BUILTIN_ANY + 1);\n vars[TOKEN_KINDS] = node.tokenKinds;\n NSString *className = node.grammarName;\n if (![className hasSuffix:@\"Parser\"]) {\n className = [NSString stringWithFormat:@\"%@Parser\", className];\n }\n vars[CLASS_NAME] = className;\n\n // do interface (header)\n NSString *intTemplate = [self templateStringNamed:@\"PKSClassInterfaceTemplate\"];\n self.interfaceOutputString = [_engine processTemplate:intTemplate withVariables:vars];\n \n // do impl (.m)\n // setup child str buffer\n NSMutableString *childStr = [NSMutableString string];\n \n // recurse\n for (PKBaseNode *child in node.children) {\n [child visit:self];\n \n // pop\n [childStr appendString:[self pop]];\n }\n \n // merge\n vars[METHODS] = childStr;\n vars[RULE_METHOD_NAMES] = self.ruleMethodNames;\n vars[ENABLE_MEMOIZATION] = @(self.enableMemoization);\n vars[ENABLE_ERROR_RECOVERY] = @(self.enableAutomaticErrorRecovery);\n vars[PARSE_TREE] = @((_preassemblerSettingBehavior == PKParserFactoryAssemblerSettingBehaviorSyntax || _assemblerSettingBehavior == PKParserFactoryAssemblerSettingBehaviorSyntax));\n \n \n NSString *implTemplate = [self templateStringNamed:@\"PKSClassImplementationTemplate\"];\n self.implementationOutputString = [_engine processTemplate:implTemplate withVariables:vars];\n\n //NSLog(@\"%@\", _interfaceOutputString);\n //NSLog(@\"%@\", _implementationOutputString);\n}\n\n\n- (NSString *)actionStringFrom:(PKActionNode *)actNode {\n if (!actNode || self.isSpeculating) return @\"\";\n \n id vars = @{ACTION_BODY: actNode.source, DEPTH: @(_depth)};\n NSString *result = [_engine processTemplate:[self templateStringNamed:@\"PKSActionTemplate\"] withVariables:vars];\n\n return result;\n}\n\n\n- (NSString *)callbackStringForNode:(PKBaseNode *)node methodName:(NSString *)methodName isPre:(BOOL)isPre {\n // determine if we should include an assembler callback call\n BOOL fireCallback = NO;\n BOOL isTerminal = 1 == [node.children count] && [[self concreteNodeForNode:node.children[0]] isTerminal];\n NSString *templateName = isPre ? @\"PKSPreCallbackTemplate\" : @\"PKSPostCallbackTemplate\";\n \n BOOL flag = isPre ? _preassemblerSettingBehavior : _assemblerSettingBehavior;\n\n switch (flag) {\n case PKParserFactoryAssemblerSettingBehaviorNone:\n fireCallback = NO;\n break;\n case PKParserFactoryAssemblerSettingBehaviorAll:\n fireCallback = YES;\n break;\n case PKParserFactoryAssemblerSettingBehaviorTerminals: {\n fireCallback = isTerminal;\n } break;\n case PKParserFactoryAssemblerSettingBehaviorSyntax: {\n fireCallback = YES;\n if (isTerminal) {\n templateName = isPre ? @\"PKSPreCallbackSyntaxLeafTemplate\" : @\"PKSPostCallbackSyntaxLeafTemplate\";\n } else {\n templateName = isPre ? @\"PKSPreCallbackSyntaxInteriorTemplate\" : @\"PKSPostCallbackSyntaxInteriorTemplate\";\n }\n } break;\n default:\n NSAssert1(0, @\"unsupported assembler callback setting behavior %d\", _preassemblerSettingBehavior);\n break;\n }\n \n NSString *result = @\"\";\n \n if (fireCallback) {\n id vars = @{METHOD_NAME: methodName};\n result = [_engine processTemplate:[self templateStringNamed:templateName] withVariables:vars];\n }\n\n return result;\n}\n\n\n- (void)visitDefinition:(PKDefinitionNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n \n self.depth = 1; // 1 for the try/catch wrapper\n\n // setup vars\n id vars = [NSMutableDictionary dictionary];\n NSString *methodName = node.token.stringValue;\n \n BOOL isStartMethod = [methodName isEqualToString:@\"@start\"];\n if (isStartMethod) {\n methodName = @\"_start\";\n } else {\n [self.ruleMethodNames addObject:methodName];\n }\n vars[METHOD_NAME] = methodName;\n self.currentDefName = methodName;\n\n // setup child str buffer\n NSMutableString *childStr = [NSMutableString string];\n \n [childStr appendString:[self actionStringFrom:node.actionNode]];\n \n if (isStartMethod && _enableAutomaticErrorRecovery) self.depth++;\n\n // recurse\n for (PKBaseNode *child in node.children) {\n [child visit:self];\n\n // pop\n [childStr appendString:[self pop]];\n }\n \n if (isStartMethod && _enableAutomaticErrorRecovery) self.depth--;\n \n if (isStartMethod) {\n NSInteger depth = _depth + (_enableAutomaticErrorRecovery ? 1 : 0);\n id eofVars = @{DEPTH: @(depth)};\n NSString *eofCallStr = [_engine processTemplate:[self templateStringNamed:@\"PKSEOFCallTemplate\"] withVariables:eofVars];\n [childStr appendString:eofCallStr];\n \n if (_enableAutomaticErrorRecovery) {\n id resyncVars = @{DEPTH: @(_depth), CHILD_STRING: childStr};\n NSString *newChildStr = [_engine processTemplate:[self templateStringNamed:@\"PKSTryAndRecoverEOFTemplate\"] withVariables:resyncVars];\n [childStr setString:newChildStr];\n }\n }\n\n if (node.before) {\n [childStr insertString:[self actionStringFrom:node.before] atIndex:0];\n }\n \n if (node.after) {\n [childStr appendString:[self actionStringFrom:node.after]];\n }\n \n // merge\n vars[METHOD_BODY] = childStr;\n \n NSString *preCallbackStr = @\"\";\n NSString *postCallbackStr = @\"\";\n\n if (!isStartMethod) {\n preCallbackStr = [self callbackStringForNode:node methodName:methodName isPre:YES];\n postCallbackStr = [self callbackStringForNode:node methodName:methodName isPre:NO];\n }\n\n vars[PRE_CALLBACK] = preCallbackStr;\n vars[POST_CALLBACK] = postCallbackStr;\n\n NSString *templateName = nil;\n if (!isStartMethod && self.enableMemoization) {\n templateName = @\"PKSMethodMemoizationTemplate\";\n } else {\n templateName = @\"PKSMethodTemplate\";\n }\n\n NSString *template = [self templateStringNamed:templateName];\n NSMutableString *output = [NSMutableString stringWithString:[_engine processTemplate:template withVariables:vars]];\n \n // push\n [self push:output];\n}\n\n\n- (void)visitReference:(PKReferenceNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n \n // stup vars\n id vars = [NSMutableDictionary dictionary];\n NSString *methodName = node.token.stringValue;\n vars[METHOD_NAME] = methodName;\n vars[DEPTH] = @(_depth);\n vars[DISCARD] = @(node.discard);\n\n // merge\n NSMutableString *output = [NSMutableString string];\n [output appendString:[self semanticPredicateForNode:node throws:YES]];\n \n NSString *template = [self templateStringNamed:@\"PKSMethodCallTemplate\"];\n [output appendString:[_engine processTemplate:template withVariables:vars]];\n \n [output appendString:[self actionStringFrom:node.actionNode]];\n\n // push\n [self push:output];\n}\n\n\n- (void)visitComposite:(PKCompositeNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n \n NSAssert(1 == [node.token.stringValue length], @\"\");\n PKUniChar c = [node.token.stringValue characterAtIndex:0];\n switch (c) {\n case '*':\n [self visitRepetition:node];\n break;\n case '~':\n [self visitNegation:node];\n break;\n default:\n NSAssert2(0, @\"%s must be implemented in %@\", __PRETTY_FUNCTION__, [self class]);\n break;\n }\n}\n\n\n- (void)visitNegation:(PKCompositeNode *)node {\n \n // recurse\n NSAssert(1 == [node.children count], @\"\");\n PKBaseNode *child = node.children[0];\n \n NSArray *set = [self sortedLookaheadSetForNode:child];\n \n self.depth++;\n [child visit:self];\n self.depth--;\n \n // pop\n NSMutableString *childStr = [self pop];\n \n // setup vars\n id vars = [NSMutableDictionary dictionary];\n vars[DEPTH] = @(_depth);\n vars[METHOD_NAME] = self.currentDefName;\n vars[LOOKAHEAD_SET] = set;\n vars[LAST] = @([set count] - 1);\n vars[IF_TEST] = [self removeTabsAndNewLines:childStr];\n \n // TODO Predicates???\n \n NSMutableString *output = [NSMutableString string];\n [output appendString:[self semanticPredicateForNode:node throws:YES]];\n\n NSString *templateName = nil;\n if (_enableHybridDFA && [self isLL1:child]) { // ????\n templateName = @\"PKSNegationPredictTemplate\";\n } else {\n templateName = @\"PKSNegationSpeculateTemplate\";\n }\n \n [output appendString:[_engine processTemplate:[self templateStringNamed:templateName] withVariables:vars]];\n \n // action\n [output appendString:[self actionStringFrom:node.actionNode]];\n \n // push\n [self push:output];\n}\n\n\n// TODO make mutable\n- (NSMutableString *)removeTabsAndNewLines:(NSMutableString *)inStr {\n [inStr replaceOccurrencesOfString:@\"\\n\" withString:@\"\" options:0 range:NSMakeRange(0, [inStr length])];\n [inStr replaceOccurrencesOfString:@\" \" withString:@\"\" options:0 range:NSMakeRange(0, [inStr length])];\n return inStr;\n}\n\n\n- (void)visitRepetition:(PKCompositeNode *)node {\n // setup vars\n id vars = [NSMutableDictionary dictionary];\n vars[DEPTH] = @(_depth);\n \n NSAssert(1 == [node.children count], @\"\");\n PKBaseNode *child = node.children[0];\n \n NSArray *set = [self sortedLookaheadSetForNode:child];\n\n // setup template\n vars[LOOKAHEAD_SET] = set;\n vars[LAST] = @([set count] - 1);\n\n // Only need to speculate if this repetition's child is non-terminal\n BOOL isLL1 = (_enableHybridDFA && [self isLL1:child]);\n \n // rep body is always wrapped in an while AND an IF. so increase depth twice\n NSInteger depth = isLL1 ? 1 : 2;\n\n // recurse first and get entire child str\n self.depth += depth;\n \n // visit for speculative if test\n self.isSpeculating = YES;\n [child visit:self];\n self.isSpeculating = NO;\n NSString *ifTest = [self removeTabsAndNewLines:[self pop]];\n \n // visit for child body\n [child visit:self];\n\n self.depth -= depth;\n \n // pop\n NSMutableString *childStr = [self pop];\n vars[CHILD_STRING] = [[childStr copy] autorelease];\n \n NSString *templateName = nil;\n if (isLL1) { // ????\n templateName = @\"PKSRepetitionPredictTemplate\";\n } else {\n vars[IF_TEST] = ifTest;\n templateName = @\"PKSRepetitionSpeculateTemplate\";\n }\n \n // repetition\n NSMutableString *output = [NSMutableString string];\n [output appendString:[self semanticPredicateForNode:node throws:YES]];\n \n [output appendString:[_engine processTemplate:[self templateStringNamed:templateName] withVariables:vars]];\n\n // action\n [output appendString:[self actionStringFrom:node.actionNode]];\n\n // push\n [self push:output];\n\n}\n\n\n- (void)visitCollection:(PKCollectionNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n \n NSAssert(1 == [node.token.stringValue length], @\"\");\n PKUniChar c = [node.token.stringValue characterAtIndex:0];\n switch (c) {\n case '.':\n [self visitSequence:node];\n break;\n default:\n NSAssert2(0, @\"%s must be implemented in %@\", __PRETTY_FUNCTION__, [self class]);\n break;\n }\n}\n\n\n- (void)visitSequence:(PKCollectionNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n \n // setup vars\n id vars = [NSMutableDictionary dictionary];\n vars[DEPTH] = @(_depth);\n \n // setup child str buffer\n NSMutableString *childStr = [NSMutableString string];\n [childStr appendString:[self semanticPredicateForNode:node throws:YES]];\n\n NSMutableString *partialChildStr = [NSMutableString string];\n NSUInteger partialCount = 0;\n\n BOOL hasTerminal = NO;\n \n NSMutableArray *concreteChildren = [NSMutableArray arrayWithCapacity:[node.children count]];\n for (PKBaseNode *child in node.children) {\n PKBaseNode *concreteNode = [self concreteNodeForNode:child];\n if (concreteNode.isTerminal && [concreteChildren count]) hasTerminal = YES;\n [concreteChildren addObject:concreteNode];\n }\n\n // recurse\n BOOL depthIncreased = NO;\n NSUInteger i = 0;\n for (PKBaseNode *child in node.children) {\n PKBaseNode *concreteNode = concreteChildren[i++];\n \n if (_enableAutomaticErrorRecovery && hasTerminal && partialCount == 1) {\n [childStr appendString:partialChildStr];\n [partialChildStr setString:@\"\"];\n depthIncreased = YES;\n self.depth++;\n }\n\n [child visit:self];\n \n // pop\n NSString *terminalCallStr = [self pop];\n [partialChildStr appendString:terminalCallStr];\n \n if (_enableAutomaticErrorRecovery && concreteNode.isTerminal && partialCount > 0) {\n \n PKSTokenKindDescriptor *desc = [(PKConstantNode *)concreteNode tokenKind];\n id resyncVars = @{TOKEN_KIND: desc, DEPTH: @(_depth - 1), CHILD_STRING: partialChildStr, TERMINAL_CALL_STRING: terminalCallStr};\n NSString *tryAndResyncStr = [_engine processTemplate:[self templateStringNamed:@\"PKSTryAndRecoverTemplate\"] withVariables:resyncVars];\n \n [childStr appendString:tryAndResyncStr];\n \n // reset\n partialCount = 0;\n [partialChildStr setString:@\"\"];\n if (depthIncreased) {\n self.depth--;\n depthIncreased = NO;\n }\n } else {\n NSAssert([partialChildStr length], @\"\");\n ++partialCount;\n }\n }\n\n //if (_enableAutomaticErrorRecovery && [node.children count] > 1) self.depth--;\n\n [childStr appendString:partialChildStr];\n\n [childStr appendString:[self actionStringFrom:node.actionNode]];\n\n // push\n [self push:childStr];\n \n}\n\n\n- (NSString *)semanticPredicateForNode:(PKBaseNode *)node throws:(BOOL)throws {\n NSString *result = @\"\";\n \n if (node.semanticPredicateNode) {\n NSString *predBody = [node.semanticPredicateNode.source stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];\n NSAssert([predBody length], @\"\");\n BOOL isStat = [predBody rangeOfString:@\";\"].length > 0;\n \n NSString *templateName = nil;\n if (throws) {\n templateName = isStat ? @\"PKSSemanticPredicateTestAndThrowStatTemplate\" : @\"PKSSemanticPredicateTestAndThrowExprTemplate\";\n } else {\n templateName = isStat ? @\"PKSSemanticPredicateTestStatTemplate\" : @\"PKSSemanticPredicateTestExprTemplate\";\n }\n \n result = [_engine processTemplate:[self templateStringNamed:templateName] withVariables:@{PREDICATE_BODY: predBody, DEPTH: @(self.depth)}];\n NSAssert(result, @\"\");\n }\n\n return result;\n}\n\n\n- (BOOL)isEmptyNode:(PKBaseNode *)node {\n return [node.token.stringValue isEqualToString:@\"Empty\"];\n}\n\n\n- (NSMutableString *)recurseAlt:(PKAlternationNode *)node la:(NSMutableArray *)lookaheadSets {\n // setup child str buffer\n NSMutableString *result = [NSMutableString string];\n \n // recurse\n NSUInteger idx = 0;\n for (PKBaseNode *child in node.children) {\n if ([self isEmptyNode:child]) {\n node.hasEmptyAlternative = YES;\n ++idx;\n continue;\n }\n \n id vars = [NSMutableDictionary dictionary];\n \n NSArray *set = [self sortedArrayFromLookaheadSet:lookaheadSets[idx]];\n vars[LOOKAHEAD_SET] = set;\n vars[LAST] = @([set count] - 1);\n vars[DEPTH] = @(_depth);\n vars[NEEDS_BACKTRACK] = @(_needsBacktracking);\n\n // process template. cannot test `idx` here to determine `if` vs `else` due to possible Empty child borking `idx`\n NSString *templateName = [result length] ? @\"PKSPredictElseIfTemplate\" : @\"PKSPredictIfTemplate\";\n NSString *output = [_engine processTemplate:[self templateStringNamed:templateName] withVariables:vars];\n [result appendString:output];\n \n self.depth++;\n [child visit:self];\n self.depth--;\n \n // pop\n [result appendString:[self pop]];\n\n ++idx;\n }\n \n return result;\n}\n\n\n- (NSMutableString *)recurseAltForBracktracking:(PKAlternationNode *)node {\n // setup child str buffer\n NSMutableString *result = [NSMutableString string];\n \n // recurse\n NSUInteger idx = 0;\n for (PKBaseNode *child in node.children) {\n if ([self isEmptyNode:child]) {\n node.hasEmptyAlternative = YES;\n ++idx;\n continue;\n }\n\n // recurse first and get entire child str\n self.depth++;\n\n // visit for speculative if test\n self.isSpeculating = YES;\n [child visit:self];\n self.isSpeculating = NO;\n NSString *ifTest = [self removeTabsAndNewLines:[self pop]];\n\n // visit for child body\n [child visit:self];\n NSString *childBody = [self pop];\n self.depth--;\n\n // setup vars\n id vars = [NSMutableDictionary dictionary];\n vars[DEPTH] = @(_depth);\n vars[NEEDS_BACKTRACK] = @(_needsBacktracking);\n vars[CHILD_STRING] = ifTest;\n \n // process template. cannot test `idx` here to determine `if` vs `else` due to possible Empty child borking `idx`\n NSString *templateName = [result length] ? @\"PKSSpeculateElseIfTemplate\" : @\"PKSSpeculateIfTemplate\";\n NSString *output = [_engine processTemplate:[self templateStringNamed:templateName] withVariables:vars];\n\n [result appendString:output];\n [result appendString:childBody];\n\n ++idx;\n }\n \n return result;\n}\n\n\n- (void)visitAlternation:(PKAlternationNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n \n NSMutableString *childStr = nil;\n\n if (_enableHybridDFA) {\n // first fetch all child lookahead sets\n NSMutableArray *lookaheadSets = [NSMutableArray arrayWithCapacity:[node.children count]];\n \n for (PKBaseNode *child in node.children) {\n NSSet *set = [self lookaheadSetForNode:child];\n [lookaheadSets addObject:set];\n }\n \n NSMutableSet *all = [NSMutableSet setWithSet:lookaheadSets[0]];\n BOOL overlap = NO;\n for (NSUInteger i = 1; i < [lookaheadSets count]; ++i) {\n NSSet *set = lookaheadSets[i];\n overlap = [set intersectsSet:all];\n if (overlap) break;\n [all unionSet:set];\n }\n \n if (!overlap && [all containsObject:@(TOKEN_KIND_BUILTIN_DELIMITEDSTRING)]) {\n overlap = YES; // TODO ??\n }\n \n //NSLog(@\"%@\", lookaheadSets);\n self.needsBacktracking = overlap;\n \n if (_needsBacktracking) {\n childStr = [self recurseAltForBracktracking:node];\n } else {\n childStr = [self recurseAlt:node la:lookaheadSets];\n }\n self.needsBacktracking = NO;\n \n } else {\n self.needsBacktracking = YES;\n childStr = [self recurseAltForBracktracking:node];\n }\n\n id vars = [NSMutableDictionary dictionary];\n vars[METHOD_NAME] = _currentDefName;\n vars[DEPTH] = @(_depth);\n \n NSString *elseStr = nil;\n if (node.hasEmptyAlternative) {\n elseStr = [_engine processTemplate:[self templateStringNamed:@\"PKSPredictEndIfTemplate\"] withVariables:vars];\n } else {\n elseStr = [_engine processTemplate:[self templateStringNamed:@\"PKSPredictElseTemplate\"] withVariables:vars];\n }\n [childStr appendString:elseStr];\n\n // push\n [self push:childStr];\n}\n\n\n- (void)visitOptional:(PKOptionalNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n\n // recurse\n NSAssert(1 == [node.children count], @\"\");\n PKBaseNode *child = node.children[0];\n \n NSArray *set = [self sortedLookaheadSetForNode:child];\n \n BOOL isLL1 = _enableHybridDFA && [self isLL1:child];\n\n // recurse for speculation\n self.depth++;\n self.isSpeculating = YES;\n [child visit:self];\n self.isSpeculating = NO;\n \n NSMutableString *ifTest = [self removeTabsAndNewLines:[self pop]];\n\n // recurse for realz\n [child visit:self];\n self.depth--;\n\n // pop\n NSMutableString *childStr = [self pop];\n\n // setup vars\n id vars = [NSMutableDictionary dictionary];\n vars[DEPTH] = @(_depth);\n vars[LOOKAHEAD_SET] = set;\n vars[LAST] = @([set count] - 1);\n vars[CHILD_STRING] = childStr;\n vars[IF_TEST] = ifTest;\n \n NSMutableString *output = [NSMutableString string];\n [output appendString:[self semanticPredicateForNode:node throws:YES]];\n\n NSString *templateName = nil;\n if (isLL1) { // ????\n templateName = @\"PKSOptionalPredictTemplate\";\n } else {\n templateName = @\"PKSOptionalSpeculateTemplate\";\n }\n \n [output appendString:[_engine processTemplate:[self templateStringNamed:templateName] withVariables:vars]];\n \n // action\n [output appendString:[self actionStringFrom:node.actionNode]];\n\n // push\n [self push:output];\n}\n\n\n// if inNode is a #ref or $def, resolve to actual concrete node.\n- (PKBaseNode *)concreteNodeForNode:(PKBaseNode *)inNode {\n PKBaseNode *node = inNode;\n while ([node isKindOfClass:[PKReferenceNode class]] || [node isKindOfClass:[PKDefinitionNode class]]) {\n while ([node isKindOfClass:[PKReferenceNode class]]) {\n node = self.symbolTable[node.token.stringValue];\n }\n \n if ([node isKindOfClass:[PKDefinitionNode class]]) {\n NSAssert(1 == [node.children count], @\"\");\n node = node.children[0];\n }\n }\n return node;\n}\n\n\n- (BOOL)isLL1:(PKBaseNode *)inNode {\n BOOL result = YES;\n \n PKBaseNode *node = [self concreteNodeForNode:inNode];\n \n if ([node isKindOfClass:[PKAlternationNode class]]) {\n for (PKBaseNode *child in node.children) {\n if (![self isLL1:child]) {\n result = NO;\n break;\n }\n }\n } else {\n result = node.isTerminal;\n }\n \n return result;\n}\n\n\n- (void)visitMultiple:(PKMultipleNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n \n // recurse\n NSAssert(1 == [node.children count], @\"\");\n PKBaseNode *child = node.children[0];\n \n NSArray *set = [self sortedLookaheadSetForNode:child];\n \n BOOL isLL1 = _enableHybridDFA && [self isLL1:child];\n \n // recurse for speculation\n self.depth++;\n self.isSpeculating = YES;\n [child visit:self];\n self.isSpeculating = NO;\n \n NSMutableString *ifTest = [self removeTabsAndNewLines:[self pop]];\n \n // recurse for realz\n [child visit:self];\n self.depth--;\n \n // pop\n NSMutableString *childStr = [self pop];\n\n // setup vars\n id vars = [NSMutableDictionary dictionary];\n vars[DEPTH] = @(_depth);\n vars[LOOKAHEAD_SET] = set;\n vars[LAST] = @([set count] - 1);\n vars[CHILD_STRING] = childStr;\n vars[IF_TEST] = ifTest;\n \n NSMutableString *output = [NSMutableString string];\n [output appendString:[self semanticPredicateForNode:node throws:YES]];\n\n NSString *templateName = nil;\n if (isLL1) { // ????\n templateName = @\"PKSMultiplePredictTemplate\";\n } else {\n templateName = @\"PKSMultipleSpeculateTemplate\";\n }\n \n [output appendString:[_engine processTemplate:[self templateStringNamed:templateName] withVariables:vars]];\n\n // action\n [output appendString:[self actionStringFrom:node.actionNode]];\n\n // push\n [self push:output];\n}\n\n\n- (void)visitConstant:(PKConstantNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n \n // stup vars\n id vars = [NSMutableDictionary dictionary];\n NSString *methodName = node.token.stringValue;\n vars[METHOD_NAME] = methodName;\n vars[DEPTH] = @(_depth);\n vars[DISCARD] = @(node.discard);\n \n // merge\n NSMutableString *output = [NSMutableString string];\n [output appendString:[self semanticPredicateForNode:node throws:YES]];\n \n NSString *template = [self templateStringNamed:@\"PKSConstantMethodCallTemplate\"];\n [output appendString:[_engine processTemplate:template withVariables:vars]];\n \n [output appendString:[self actionStringFrom:node.actionNode]];\n\n // push\n [self push:output];\n}\n\n\n- (void)visitLiteral:(PKLiteralNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n \n // stup vars\n id vars = [NSMutableDictionary dictionary];\n vars[TOKEN_KIND] = node.tokenKind;\n vars[DEPTH] = @(_depth);\n vars[DISCARD] = @(node.discard);\n\n // merge\n NSMutableString *output = [NSMutableString string];\n [output appendString:[self semanticPredicateForNode:node throws:YES]];\n \n NSString *template = [self templateStringNamed:@\"PKSMatchCallTemplate\"];\n [output appendString:[_engine processTemplate:template withVariables:vars]];\n \n [output appendString:[self actionStringFrom:node.actionNode]];\n\n // push\n [self push:output];\n}\n\n\n- (void)visitDelimited:(PKDelimitedNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n \n // stup vars\n id vars = [NSMutableDictionary dictionary];\n vars[TOKEN_KIND] = node.tokenKind;\n vars[DEPTH] = @(_depth);\n vars[DISCARD] = @(node.discard);\n vars[PREFIX] = node.startMarker;\n vars[SUFFIX] = node.endMarker;\n vars[METHOD_NAME] = self.currentDefName;\n \n // merge\n NSMutableString *output = [NSMutableString string];\n [output appendString:[self semanticPredicateForNode:node throws:YES]];\n \n NSString *template = [self templateStringNamed:@\"PKSMatchDelimitedStringTemplate\"];\n [output appendString:[_engine processTemplate:template withVariables:vars]];\n \n [output appendString:[self actionStringFrom:node.actionNode]];\n \n // push\n [self push:output];\n}\n\n\n- (void)visitPattern:(PKPatternNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n \n // stup vars\n id vars = [NSMutableDictionary dictionary];\n //vars[TOKEN_KIND] = node.tokenKind;\n vars[DEPTH] = @(_depth);\n vars[DISCARD] = @(node.discard);\n vars[PATTERN] = [NSRegularExpression escapedPatternForString:node.string];\n vars[METHOD_NAME] = self.currentDefName;\n\n // merge\n NSMutableString *output = [NSMutableString string];\n [output appendString:[self semanticPredicateForNode:node throws:YES]];\n \n NSString *template = [self templateStringNamed:@\"PKSMatchPatternTemplate\"];\n [output appendString:[_engine processTemplate:template withVariables:vars]];\n \n [output appendString:[self actionStringFrom:node.actionNode]];\n \n // push\n [self push:output];\n}\n\n\n- (void)visitAction:(PKActionNode *)node {\n //NSLog(@\"%s %@\", __PRETTY_FUNCTION__, node);\n \n NSAssert2(0, @\"%s must be implemented in %@\", __PRETTY_FUNCTION__, [self class]);\n}\n\n\n#pragma mark -\n#pragma mark MGTemplateEngineDelegate\n\n- (void)templateEngine:(MGTemplateEngine *)engine blockStarted:(NSDictionary *)blockInfo {\n \n}\n\n\n- (void)templateEngine:(MGTemplateEngine *)engine blockEnded:(NSDictionary *)blockInfo {\n \n}\n\n\n- (void)templateEngineFinishedProcessingTemplate:(MGTemplateEngine *)engine {\n \n}\n\n\n- (void)templateEngine:(MGTemplateEngine *)engine encounteredError:(NSError *)error isContinuing:(BOOL)continuing {\n NSLog(@\"%@\", error);\n}\n\n@end\n"} {"text": "package mss\n\nimport \"github.com/omniscale/magnacarto/color\"\n\nvar attributeTypes map[string]isValid\n\ntype isValid func(interface{}) bool\n\nfunc isNumber(val interface{}) bool {\n\t_, ok := val.(float64)\n\treturn ok\n}\n\nfunc isNumbers(val interface{}) bool {\n\tvals, ok := val.([]Value)\n\tif !ok {\n\t\treturn false\n\t}\n\tfor _, v := range vals {\n\t\tif !isNumber(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc isString(val interface{}) bool {\n\t_, ok := val.(string)\n\treturn ok\n}\n\nfunc isStrings(val interface{}) bool {\n\tvals, ok := val.([]Value)\n\tif !ok {\n\t\treturn false\n\t}\n\tfor _, v := range vals {\n\t\tif !isString(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc isStringOrStrings(val interface{}) bool {\n\treturn isString(val) || isStrings(val)\n}\n\nfunc isFieldOr(other isValid) isValid {\n\treturn func(val interface{}) bool {\n\t\tif s, ok := val.(string); ok {\n\t\t\tif len(s) > 2 && s[0] == '[' && s[len(s)-1] == ']' {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\treturn other(val)\n\t}\n}\n\nfunc isColor(val interface{}) bool {\n\t_, ok := val.(color.Color)\n\treturn ok\n}\n\nfunc isBool(val interface{}) bool {\n\t_, ok := val.(bool)\n\treturn ok\n}\n\nfunc isKeyword(keywords ...string) isValid {\n\treturn func(val interface{}) bool {\n\t\tk, ok := val.(string)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\tfor _, expected := range keywords {\n\t\t\tif k == expected {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n}\n\nfunc isKeywordOr(other isValid, keywords ...string) isValid {\n\treturn func(val interface{}) bool {\n\t\tif other(val) {\n\t\t\treturn true\n\t\t}\n\t\treturn isKeyword(keywords...)(val)\n\t}\n}\n\nfunc isStops(val interface{}) bool {\n\tvals, ok := val.([]Value)\n\tif !ok {\n\t\treturn false\n\t}\n\tfor _, v := range vals {\n\t\tif _, ok := v.(Stop); !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc isCompOp(val interface{}) bool {\n\treturn isKeyword(\n\t\t\"clear\",\n\t\t\"src\",\n\t\t\"dst\",\n\t\t\"src-over\",\n\t\t\"dst-over\",\n\t\t\"src-in\",\n\t\t\"dst-in\",\n\t\t\"src-out\",\n\t\t\"dst-out\",\n\t\t\"src-atop\",\n\t\t\"dst-atop\",\n\t\t\"xor\",\n\t\t\"plus\",\n\t\t\"minus\",\n\t\t\"multiply\",\n\t\t\"divide\",\n\t\t\"screen\",\n\t\t\"overlay\",\n\t\t\"darken\",\n\t\t\"lighten\",\n\t\t\"color-dodge\",\n\t\t\"color-burn\",\n\t\t\"hard-light\",\n\t\t\"soft-light\",\n\t\t\"difference\",\n\t\t\"exclusion\",\n\t\t\"contrast\",\n\t\t\"invert\",\n\t\t\"invert-rgb\",\n\t\t\"grain-merge\",\n\t\t\"grain-extract\",\n\t\t\"hue\",\n\t\t\"saturation\",\n\t\t\"color\",\n\t\t\"value\",\n\t)(val)\n}\n\nfunc isScaling(val interface{}) bool {\n\treturn isKeyword(\n\t\t\"near\",\n\t\t\"fast\",\n\t\t\"bilinear\",\n\t\t\"bicubic\",\n\t\t\"spline16\",\n\t\t\"spline36\",\n\t\t\"hanning\",\n\t\t\"hamming\",\n\t\t\"hermite\",\n\t\t\"kaiser\",\n\t\t\"quadric\",\n\t\t\"catrom\",\n\t\t\"gaussian\",\n\t\t\"bessel\",\n\t\t\"mitchell\",\n\t\t\"sinc\",\n\t\t\"lanczos\",\n\t\t\"blackman\",\n\t)(val)\n}\n\nfunc isSimplifyAlgorithm(val interface{}) bool {\n\treturn isKeyword(\n\t\t\"radial-distance\",\n\t\t\"zhao-saalfeld\",\n\t\t\"visvalingam-whyatt\",\n\t)(val)\n}\n\nfunc isRasterizer(val interface{}) bool {\n\treturn isKeyword(\n\t\t\"full\",\n\t\t\"fast\",\n\t)(val)\n}\n\nfunc isVerticalAlignment(val interface{}) bool {\n\treturn isKeyword(\n\t\t\"top\",\n\t\t\"middle\",\n\t\t\"bottom\",\n\t\t\"auto\",\n\t)(val)\n}\n\nfunc isJustifyAlignment(val interface{}) bool {\n\treturn isKeyword(\n\t\t\"left\",\n\t\t\"center\",\n\t\t\"right\",\n\t\t\"auto\",\n\t)(val)\n}\n\nfunc init() {\n\tattributeTypes = map[string]isValid{\n\t\t\"background-color\": isColor,\n\n\t\t\"building-fill\": isColor,\n\t\t\"building-fill-opacity\": isNumber,\n\t\t\"building-height\": isNumber,\n\n\t\t\"dot-fill\": isColor,\n\t\t\"dot-opacity\": isNumber,\n\t\t\"dot-width\": isNumber,\n\t\t\"dot-height\": isNumber,\n\t\t\"dot-comp-op\": isCompOp,\n\n\t\t\"line-cap\": isKeyword(\"round\", \"butt\", \"square\"),\n\t\t\"line-clip\": isBool,\n\t\t\"line-color\": isColor,\n\t\t\"line-dasharray\": isNumbers,\n\t\t\"line-dash-offset\": isNumbers,\n\t\t\"line-gamma\": isNumber,\n\t\t\"line-gamma-method\": isKeyword(\"power\", \"linear\", \"none\", \"threshold\", \"multiply\"),\n\t\t\"line-join\": isKeyword(\"miter\", \"miter-revert\", \"round\", \"bevel\"),\n\t\t\"line-miterlimit\": isNumber,\n\t\t\"line-offset\": isNumber,\n\t\t\"line-opacity\": isNumber,\n\t\t\"line-rasterizer\": isRasterizer,\n\t\t\"line-simplify\": isNumber,\n\t\t\"line-simplify-algorithm\": isSimplifyAlgorithm,\n\t\t\"line-smooth\": isNumber,\n\t\t\"line-width\": isNumber,\n\t\t\"line-comp-op\": isCompOp,\n\t\t\"line-geometry-transform\": isString,\n\n\t\t\"line-pattern-file\": isString,\n\t\t\"line-pattern-clip\": isBool,\n\t\t\"line-pattern-opacity\": isNumber,\n\t\t\"line-pattern-simplify\": isNumber,\n\t\t\"line-pattern-simplify-algorithm\": isSimplifyAlgorithm,\n\t\t\"line-pattern-smooth\": isNumber,\n\t\t\"line-pattern-offset\": isNumber,\n\t\t\"line-pattern-geometry-transform\": isString,\n\t\t\"line-pattern-comp-op\": isCompOp,\n\n\t\t\"marker-allow-overlap\": isBool,\n\t\t\"marker-file\": isString,\n\t\t\"marker-fill\": isColor,\n\t\t\"marker-fill-opacity\": isNumber,\n\t\t\"marker-height\": isNumber,\n\t\t\"marker-line-color\": isColor,\n\t\t\"marker-line-width\": isNumber,\n\t\t\"marker-line-opacity\": isNumber,\n\t\t\"marker-opacity\": isNumber,\n\t\t\"marker-placement\": isKeyword(\"point\", \"interior\", \"line\", \"vertex-first\", \"vertex-last\"),\n\t\t\"marker-spacing\": isNumber,\n\t\t\"marker-transform\": isString,\n\t\t\"marker-type\": isKeyword(\"arrow\", \"ellipse\"),\n\t\t\"marker-width\": isNumber,\n\t\t\"marker-multi-policy\": isKeyword(\"each\", \"whole\", \"largest\"),\n\t\t\"marker-avoid-edges\": isBool,\n\t\t\"marker-ignore-placement\": isBool,\n\t\t\"marker-max-error\": isNumber,\n\t\t\"marker-clip\": isBool,\n\t\t\"marker-simplify\": isNumber,\n\t\t\"marker-simplify-algorithm\": isSimplifyAlgorithm,\n\t\t\"marker-smooth\": isNumber,\n\t\t\"marker-geometry-transform\": isString,\n\t\t\"marker-offset\": isNumber,\n\t\t\"marker-comp-op\": isCompOp,\n\t\t\"marker-direction\": isKeyword(\"auto\", \"auto-down\", \"left\", \"right\", \"left-only\", \"right-only\", \"up\", \"down\"),\n\n\t\t\"point-file\": isString,\n\t\t\"point-allow-overlap\": isBool,\n\t\t\"point-opacity\": isNumber,\n\t\t\"point-transform\": isString,\n\t\t\"point-ignore-placement\": isBool,\n\t\t\"point-placement\": isKeyword(\"centroid\", \"interior\"),\n\t\t\"point-comp-op\": isCompOp,\n\n\t\t\"polygon-fill\": isColor,\n\t\t\"polygon-gamma\": isNumber,\n\t\t\"polygon-gamma-method\": isKeyword(\"power\", \"linear\", \"none\", \"threshold\", \"multiply\"),\n\t\t\"polygon-opacity\": isNumber,\n\t\t\"polygon-clip\": isBool,\n\t\t\"polygon-simplify\": isNumber,\n\t\t\"polygon-simplify-algorithm\": isSimplifyAlgorithm,\n\t\t\"polygon-smooth\": isNumber,\n\t\t\"polygon-geometry-transform\": isString,\n\t\t\"polygon-comp-op\": isCompOp,\n\n\t\t\"polygon-pattern-alignment\": isKeyword(\"global\", \"local\"),\n\t\t\"polygon-pattern-file\": isString,\n\t\t\"polygon-pattern-gamma\": isNumber,\n\t\t\"polygon-pattern-opacity\": isNumber,\n\t\t\"polygon-pattern-clip\": isBool,\n\t\t\"polygon-pattern-simplify\": isNumber,\n\t\t\"polygon-pattern-simplify-algorithm\": isSimplifyAlgorithm,\n\t\t\"polygon-pattern-smooth\": isNumber,\n\t\t\"polygon-pattern-geometry-transform\": isString,\n\t\t\"polygon-pattern-comp-op\": isCompOp,\n\n\t\t\"shield-allow-overlap\": isBool,\n\t\t\"shield-avoid-edges\": isBool,\n\t\t\"shield-character-spacing\": isNumber,\n\t\t\"shield-clip\": isBool,\n\t\t\"shield-dx\": isNumber,\n\t\t\"shield-dy\": isNumber,\n\t\t\"shield-face-name\": isStringOrStrings,\n\t\t\"shield-file\": isString,\n\t\t\"shield-fill\": isColor,\n\t\t\"shield-halo-fill\": isColor,\n\t\t\"shield-halo-radius\": isNumber,\n\t\t\"shield-halo-rasterizer\": isRasterizer,\n\t\t\"shield-halo-transform\": isString,\n\t\t\"shield-halo-comp-op\": isCompOp,\n\t\t\"shield-halo-opacity\": isNumber,\n\t\t\"shield-line-spacing\": isNumber,\n\t\t\"shield-min-distance\": isNumber,\n\t\t\"shield-min-padding\": isNumber,\n\t\t\"shield-name\": isString,\n\t\t\"shield-opacity\": isNumber,\n\t\t\"shield-placement\": isKeyword(\"line\", \"point\", \"vertex\", \"interior\"),\n\t\t\"shield-placement-type\": isKeyword(\"dummy\", \"simple\", \"list\"),\n\t\t\"shield-placements\": isString,\n\t\t\"shield-transform\": isString,\n\t\t\"shield-simplify\": isNumber,\n\t\t\"shield-simplify-algorithm\": isSimplifyAlgorithm,\n\t\t\"shield-smooth\": isNumber,\n\t\t\"shield-comp-op\": isCompOp,\n\t\t\"shield-size\": isNumber,\n\t\t\"shield-spacing\": isNumber,\n\t\t\"shield-text-dx\": isNumber,\n\t\t\"shield-text-dy\": isNumber,\n\t\t\"shield-text-opacity\": isNumber,\n\t\t\"shield-text-transform\": isKeyword(\"none\", \"uppercase\", \"lowercase\", \"capitalize\", \"reverse\"),\n\t\t\"shield-wrap-before\": isBool,\n\t\t\"shield-wrap-character\": isString,\n\t\t\"shield-wrap-width\": isNumber,\n\t\t\"shield-unlock-image\": isBool,\n\t\t\"shield-margin\": isNumber,\n\t\t\"shield-repeat-distance\": isNumber,\n\t\t\"shield-label-position-tolerance\": isNumber,\n\t\t\"shield-horizontal-alignment\": isKeyword(\"left\", \"middle\", \"right\", \"auto\"),\n\t\t\"shield-vertical-alignment\": isVerticalAlignment,\n\t\t\"shield-justify-alignment\": isJustifyAlignment,\n\n\t\t\"text-allow-overlap\": isBool,\n\t\t\"text-avoid-edges\": isBool,\n\t\t\"text-character-spacing\": isNumber,\n\t\t\"text-clip\": isBool,\n\t\t\"text-dx\": isNumber,\n\t\t\"text-dy\": isNumber,\n\t\t\"text-face-name\": isStringOrStrings,\n\t\t\"text-font-feature-settings\": isString,\n\t\t\"text-fill\": isColor,\n\t\t\"text-halo-fill\": isColor,\n\t\t\"text-halo-radius\": isNumber,\n\t\t\"text-halo-opacity\": isNumber,\n\t\t\"text-halo-rasterizer\": isRasterizer,\n\t\t\"text-halo-transform\": isString,\n\t\t\"text-halo-comp-op\": isCompOp,\n\t\t\"text-line-spacing\": isNumber,\n\t\t\"text-min-distance\": isNumber,\n\t\t\"text-min-padding\": isNumber,\n\t\t\"text-name\": isString,\n\t\t\"text-opacity\": isNumber,\n\t\t\"text-orientation\": isFieldOr(isNumber),\n\t\t\"text-placement\": isKeyword(\"line\", \"point\", \"vertex\", \"interior\"),\n\t\t\"text-placement-type\": isKeyword(\"dummy\", \"simple\", \"list\"),\n\t\t\"text-placements\": isString,\n\t\t\"text-size\": isNumber,\n\t\t\"text-spacing\": isNumber,\n\t\t\"text-transform\": isKeyword(\"none\", \"uppercase\", \"lowercase\", \"capitalize\", \"reverse\"),\n\t\t\"text-wrap-before\": isBool,\n\t\t\"text-wrap-character\": isString,\n\t\t\"text-wrap-width\": isNumber,\n\t\t\"text-repeat-wrap-characater\": isBool,\n\t\t\"text-ratio\": isNumber,\n\t\t\"text-label-position-tolerance\": isNumber,\n\t\t\"text-max-char-angle-delta\": isNumber,\n\t\t\"text-vertical-alignment\": isVerticalAlignment,\n\t\t\"text-horizontal-alignment\": isKeyword(\"left\", \"middle\", \"right\", \"auto\", \"adjust\"),\n\t\t\"text-justify-alignment\": isJustifyAlignment,\n\t\t\"text-margin\": isNumber,\n\t\t\"text-repeat-distance\": isNumber,\n\t\t\"text-min-path-length\": isKeywordOr(isNumber, \"auto\"),\n\t\t\"text-rotate-displacement\": isBool,\n\t\t\"text-upgright\": isKeyword(\"auto\", \"auto-down\", \"left\", \"right\", \"left-only\", \"right-only\"),\n\t\t\"text-simplify\": isNumber,\n\t\t\"text-simplify-algorithm\": isSimplifyAlgorithm,\n\t\t\"text-smooth\": isNumber,\n\t\t\"text-comp-op\": isCompOp,\n\t\t\"text-largest-bbox-only\": isBool,\n\n\t\t\"raster-opacity\": isNumber,\n\t\t\"raster-scaling\": isScaling,\n\t\t\"raster-colorizer-default-mode\": isKeyword(\"discrete\", \"linear\", \"exact\"),\n\t\t\"raster-colorizer-default-color\": isColor,\n\t\t\"raster-colorizer-stops\": isStops,\n\t\t\"raster-comp-op\": isCompOp,\n\t\t\"raster-filter-factor\": isNumber,\n\t\t\"raster-mesh-size\": isNumber,\n\t\t\"raster-colorizer-epsilon\": isNumber,\n\t}\n}\n\n// validProperty returns whether the property and the value is valid.\nfunc validProperty(property string, value interface{}) (bool, bool) {\n\tcheckFunc, ok := attributeTypes[property]\n\tif !ok {\n\t\treturn false, false\n\t}\n\treturn true, checkFunc(value)\n}\n"} {"text": "\r\n\r\n\r\n\t\r\n\tMultiple Sorting - jQuery EasyUI Demo\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\r\n\r\n\t

Multiple Sorting

\r\n\t

Set 'multiSort' property to true to enable multiple column sorting.

\r\n\t
\r\n\t\r\n\t\r\n\t\t\r\n\t\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\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t
Item IDProductList PriceUnit CostAttributeStatus
\r\n\r\n\r\n"} {"text": "{\n \"name\": \"ChemieOnline\",\n \"displayName\": \"ChemieOnline\",\n \"properties\": [\n \"chemieonline.de\"\n ]\n}"} {"text": "#ifndef OPENMM_MONTECARLOMEMBRANEBAROSTATIMPL_H_\n#define OPENMM_MONTECARLOMEMBRANEBAROSTATIMPL_H_\n\n/* -------------------------------------------------------------------------- *\n * OpenMM *\n * -------------------------------------------------------------------------- *\n * This is part of the OpenMM molecular simulation toolkit originating from *\n * Simbios, the NIH National Center for Physics-Based Simulation of *\n * Biological Structures at Stanford, funded under the NIH Roadmap for *\n * Medical Research, grant U54 GM072970. See https://simtk.org. *\n * *\n * Portions copyright (c) 2010-2019 Stanford University and the Authors. *\n * Authors: Peter Eastman *\n * Contributors: *\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 NONINFRINGEMENT. IN NO EVENT SHALL *\n * THE AUTHORS, CONTRIBUTORS 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. *\n * -------------------------------------------------------------------------- */\n\n#include \"ForceImpl.h\"\n#include \"openmm/MonteCarloMembraneBarostat.h\"\n#include \"openmm/Kernel.h\"\n#include \n\nnamespace OpenMM {\n\n/**\n * This is the internal implementation of MonteCarloMembraneBarostat.\n */\n\nclass MonteCarloMembraneBarostatImpl : public ForceImpl {\npublic:\n MonteCarloMembraneBarostatImpl(const MonteCarloMembraneBarostat& owner);\n void initialize(ContextImpl& context);\n const MonteCarloMembraneBarostat& getOwner() const {\n return owner;\n }\n void updateContextState(ContextImpl& context);\n double calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy, int groups) {\n // This force doesn't apply forces to particles.\n return 0.0;\n }\n std::map getDefaultParameters();\n std::vector getKernelNames();\nprivate:\n const MonteCarloMembraneBarostat& owner;\n int step, numAttempted[3], numAccepted[3];\n double volumeScale[3];\n Kernel kernel;\n};\n\n} // namespace OpenMM\n\n#endif /*OPENMM_MONTECARLOMEMBRANEBAROSTATIMPL_H_*/\n"} {"text": "(** The HoTT Book Exercises formalization. *)\n\n(** This file records formalized solutions to the HoTT Book exercises. *)\n\n(* See HoTTBook.v for an IMPORTANT NOTE FOR THE HoTT DEVELOPERS.\n\n PROCEDURE FOR UPDATING THE FILE:\n\n 1. Compile the latest version of the HoTT Book to update the LaTeX\n labels. Do not forget to pull in changes from HoTT/HoTT.\n\n 2. Run `etc/Book.py` using the `--exercises` flag (so your command\n should look like `cat ../book/*.aux | etc/Book.py --exercises contrib/HoTTBookExercises.v`)\n If it complains, fix things.\n\n 3. Add contents to new entries.\n\n 4. Run `etc/Book.py` again to make sure it is happy.\n\n 5. Compile this file with `make contrib` or `make contrib/HoTTBookExercises.vo`.\n\n 6. Do the git thing to submit your changes.\n\n*)\n\nRequire Import HoTT Coq.Init.Peano.\nRequire Import HoTT.Metatheory.Core HoTT.Metatheory.FunextVarieties HoTT.Metatheory.UnivalenceImpliesFunext.\n\nLocal Open Scope path_scope.\n\n(* END OF PREAMBLE *)\n(* ================================================== ex:composition *)\n(** Exercise 1.1 *)\n\nDefinition Book_1_1 := (fun (A B C : Type) (f : A -> B) (g : B -> C) => g o f).\n\nTheorem Book_1_1_refl : forall (A B C D : Type) (f : A -> B) (g : B -> C) (h : C -> D),\n h o (g o f) = (h o g) o f.\nProof.\n reflexivity.\nDefined.\n\n(* ================================================== ex:pr-to-rec *)\n(** Exercise 1.2 *)\n\n(** Recursor as equivalence. *)\nDefinition Book_1_2_prod_lib := @HoTT.Types.Prod.equiv_uncurry.\nSection Book_1_2_prod.\n Variable A B : Type.\n\n (** Recursor with projection functions instead of pattern-matching. *)\n Let prod_rec_proj C (g : A -> B -> C) (p : A * B) : C :=\n g (fst p) (snd p).\n Definition Book_1_2_prod := prod_rec_proj.\n\n Proposition Book_1_2_prod_fst : fst = prod_rec_proj A (fun a b => a).\n Proof.\n reflexivity.\n Defined.\n\n Proposition Book_1_2_prod_snd : snd = prod_rec_proj B (fun a b => b).\n Proof.\n reflexivity.\n Defined.\nEnd Book_1_2_prod.\n\n(** Recursor as (dependent) equivalence. *)\nDefinition Book_1_2_sig_lib := @HoTT.Types.Sigma.equiv_sigT_ind.\nSection Book_1_2_sig.\n Variable A : Type.\n Variable B : A -> Type.\n\n (** Non-dependent recursor with projection functions instead of pattern matching. *)\n Let sig_rec_proj C (g : forall (x : A), B x -> C) (p : exists (x : A), B x) : C :=\n g (pr1 p) (pr2 p).\n Definition Book_1_2_sig := @sig_rec_proj.\n\n Proposition Book_1_2_sig_fst : @pr1 A B = sig_rec_proj A (fun a => fun b => a).\n Proof.\n reflexivity.\n Defined.\n\n (** NB: You cannot implement pr2 with only the recursor, so it is not possible\n to check its definitional equality as the exercise suggests. *)\nEnd Book_1_2_sig.\n\n(* ================================================== ex:pr-to-ind *)\n(** Exercise 1.3 *)\n\n(** The propositional uniqueness principles are named with an\n 'eta' postfix in the HoTT library. *)\n\nDefinition Book_1_3_prod_lib := @HoTT.Types.Prod.prod_ind.\nSection Book_1_3_prod.\n Variable A B : Type.\n\n Let prod_ind_eta (C : A * B -> Type) (g : forall (x : A) (y : B), C (x, y)) (x : A * B) : C x :=\n transport C (HoTT.Types.Prod.eta_prod x) (g (fst x) (snd x)).\n Definition Book_1_3_prod := prod_ind_eta.\n\n Proposition Book_1_3_prod_refl : forall C g a b, prod_ind_eta C g (a, b) = g a b.\n Proof.\n reflexivity.\n Defined.\nEnd Book_1_3_prod.\n\nDefinition Book_1_3_sig_lib := @Coq.Init.Specif.sigT_ind.\nSection Book_1_3_sig.\n Variable A : Type.\n Variable B : A -> Type.\n\n Let sig_ind_eta (C : (exists (a : A), B a) -> Type)\n (g : forall (a : A) (b : B a), C (a; b))\n (x : exists (a : A), B a) : C x :=\n transport C (HoTT.Types.Sigma.eta_sigma x) (g (pr1 x) (pr2 x)).\n Definition Book_1_3_sig := sig_ind_eta.\n\n Proposition Book_1_3_sig_refl : forall C g a b, sig_ind_eta C g (a; b) = g a b.\n Proof.\n reflexivity.\n Defined.\nEnd Book_1_3_sig.\n\n(* ================================================== ex:iterator *)\n(** Exercise 1.4 *)\n\n\n\n(* ================================================== ex:sum-via-bool *)\n(** Exercise 1.5 *)\n\nSection Book_1_5.\n Definition Book_1_5_sum (A B : Type) := { x : Bool & if x then A else B }.\n\n Notation \"'inl' a\" := (true; a) (at level 0).\n Notation \"'inr' b\" := (false; b) (at level 0).\n\n Definition Book_1_5_ind (A B : Type) (C : Book_1_5_sum A B -> Type) (f : forall a, C (inl a))\n (g : forall b, C (inr b)) : forall x : Book_1_5_sum A B, C x := fun x => match x with\n | inl a => f a\n | inr b => g b\n end.\n\n Theorem inl_red {A B : Type} {C : Book_1_5_sum A B -> Type} f g { a : A }\n : Book_1_5_ind A B C f g (inl a) = f a.\n Proof. reflexivity. Defined.\n\n Theorem inr_red {A B : Type} {C : Book_1_5_sum A B -> Type} f g { b : B }\n : Book_1_5_ind A B C f g (inr b) = g b.\n Proof. reflexivity. Defined.\nEnd Book_1_5.\n\n(* ================================================== ex:prod-via-bool *)\n(** Exercise 1.6 *)\n\n\n\n(* ================================================== ex:pm-to-ml *)\n(** Exercise 1.7 *)\n\n\n\n(* ================================================== ex:nat-semiring *)\n(** Exercise 1.8 *)\n\nFixpoint rec_nat' (C : Type) c0 cs (n : nat) : C :=\n match n with\n 0 => c0\n | S m => cs m (rec_nat' C c0 cs m)\n end.\n\nDefinition add : nat -> nat -> nat :=\n rec_nat' (nat -> nat) (fun m => m) (fun n g m => (S (g m))).\n\nDefinition mult : nat -> nat -> nat :=\n rec_nat' (nat -> nat) (fun m => 0) (fun n g m => add m (g m)).\n\n(* rec_nat' gives back a function with the wrong argument order, so we flip the\n order of the arguments p and q *)\nDefinition exp : nat -> nat -> nat :=\n fun p q => (rec_nat' (nat -> nat) (fun m => (S 0)) (fun n g m => mult m (g m))) q p.\n\nExample add_example: add 32 17 = 49. reflexivity. Defined.\nExample mult_example: mult 20 5 = 100. reflexivity. Defined.\nExample exp_example: exp 2 10 = 1024. reflexivity. Defined.\n\n(* To do: proof that these form a semiring *)\n\n(* ================================================== ex:fin *)\n(** Exercise 1.9 *)\n\n\n\n(* ================================================== ex:ackermann *)\n(** Exercise 1.10 *)\n\nFixpoint ack (n m : nat) : nat :=\n match n with\n | O => S m\n | S p => let fix ackn (m : nat) :=\n match m with\n | O => ack p 1\n | S q => ack p (ackn q)\n end\n in ackn m\n end.\n\nDefinition Book_1_10 := ack.\n\n(* ================================================== ex:neg-ldn *)\n(** Exercise 1.11 *)\n\nSection Book_1_11.\n Theorem dblneg : forall A, (~~~A) -> ~A.\n Proof.\n intros A f a; apply f.\n intros g; apply g.\n exact a.\n Defined.\nEnd Book_1_11.\n\n(* ================================================== ex:tautologies *)\n(** Exercise 1.12 *)\n\nSection Book_1_12.\n Theorem Book_1_12_part1 : forall A B, A -> (B -> A).\n Proof.\n intros ? ? a ?.\n exact a.\n Defined.\n\n Theorem Book_1_12_part2 : forall A, A -> ~~A.\n Proof.\n intros A a f.\n exact (f a).\n Defined.\n\n Theorem Book_1_12_part3 : forall A B, ((~A) + (~B)) -> ~(A * B).\n Proof.\n intros A B [na | nb] [a b].\n - exact (na a).\n - exact (nb b).\n Qed.\nEnd Book_1_12.\n\n(* ================================================== ex:not-not-lem *)\n(** Exercise 1.13 *)\n\n\n\n(* ================================================== ex:without-K *)\n(** Exercise 1.14 *)\n\n\n\n(* ================================================== ex:subtFromPathInd *)\n(** Exercise 1.15 *)\n\n(* concat_A1p? *)\n\n(* ================================================== ex:add-nat-commutative *)\n(** Exercise 1.16 *)\n\n\n\n(* ================================================== ex:basics:concat *)\n(** Exercise 2.1 *)\n\n(* Book_2_1_concatenation1 is equivalent to the proof given in the text *)\nDefinition Book_2_1_concatenation1 :\n forall {A : Type} {x y z : A}, x = y -> y = z -> x = z.\n intros A x y z x_eq_y y_eq_z.\n induction x_eq_y.\n induction y_eq_z.\n reflexivity.\nDefined.\n\nDefinition Book_2_1_concatenation2 :\n forall {A : Type} {x y z : A}, x = y -> y = z -> x = z.\n intros A x y z x_eq_y y_eq_z.\n induction x_eq_y.\n exact y_eq_z.\nDefined.\n\nDefinition Book_2_1_concatenation3 :\n forall {A : Type} {x y z : A}, x = y -> y = z -> x = z.\n intros A x y z x_eq_y y_eq_z.\n induction y_eq_z.\n exact x_eq_y.\nDefined.\n\nLocal Notation \"p *1 q\" := (Book_2_1_concatenation1 p q) (at level 10).\nLocal Notation \"p *2 q\" := (Book_2_1_concatenation2 p q) (at level 10).\nLocal Notation \"p *3 q\" := (Book_2_1_concatenation3 p q) (at level 10).\n\nSection Book_2_1_Proofs_Are_Equal.\n Context {A : Type} {x y z : A}.\n Variable (p : x = y) (q : y = z).\n Definition Book_2_1_concatenation1_eq_Book_2_1_concatenation2 : p *1 q = p *2 q.\n induction p, q.\n reflexivity.\n Defined.\n\n Definition Book_2_1_concatenation2_eq_Book_2_1_concatenation3 : p *2 q = p *3 q.\n induction p, q.\n reflexivity.\n Defined.\n\n Definition Book_2_1_concatenation1_eq_Book_2_1_concatenation3 : p *1 q = p *3 q.\n induction p, q.\n reflexivity.\n Defined.\nEnd Book_2_1_Proofs_Are_Equal.\n\n(* ================================================== ex:eq-proofs-commute *)\n(** Exercise 2.2 *)\n\nDefinition Book_2_2 :\n forall {A : Type} {x y z : A} (p : x = y) (q : y = z),\n (Book_2_1_concatenation1_eq_Book_2_1_concatenation2 p q) *1\n (Book_2_1_concatenation2_eq_Book_2_1_concatenation3 p q) =\n (Book_2_1_concatenation1_eq_Book_2_1_concatenation3 p q).\n induction p, q.\n reflexivity.\nDefined.\n\n(* ================================================== ex:fourth-concat *)\n(** Exercise 2.3 *)\n\n(* Since we have x_eq_y : x = y we can transport y_eq_z : y = z along\n x_eq_y⁻¹ : y = x in the type family λw.(w = z) to obtain a term\n of type x = z. *)\nDefinition Book_2_1_concatenation4\n {A : Type} {x y z : A} : x = y -> y = z -> x = z :=\n fun x_eq_y y_eq_z => transport (fun w => w = z) (inverse x_eq_y) y_eq_z.\n\nLocal Notation \"p *4 q\" := (Book_2_1_concatenation4 p q) (at level 10).\nDefinition Book_2_1_concatenation1_eq_Book_2_1_concatenation4 :\n forall {A : Type} {x y z : A} (p : x = y) (q : y = z), (p *1 q = p *4 q).\n induction p, q.\n reflexivity.\nDefined.\n\n(* ================================================== ex:npaths *)\n(** Exercise 2.4 *)\n\nDefinition Book_2_4_npath : nat -> Type -> Type\n := nat_ind (fun (n : nat) => Type -> Type)\n (* 0-dimensional paths are elements *)\n (fun A => A)\n (* (n+1)-dimensional paths are paths between n-dimimensional paths *)\n (fun n f A => (exists a1 a2 : (f A), a1 = a2)).\n\n(* This is the intuition behind definition of nboundary:\n As we've defined them, every (n+1)-path is a path between two n-paths. *)\nLemma npath_as_sig : forall {n : nat} {A : Type},\n (Book_2_4_npath (S n) A) = (exists (p1 p2 : Book_2_4_npath n A), p1 = p2).\n reflexivity.\nDefined.\n\n(* It can be helpful to take a look at what this definition does.\n Try uncommenting the following lines: *)\n(*\nContext {A : Type}.\nEval compute in (Book_2_4_npath 0 A). (* = A : Type *)\nEval compute in (Book_2_4_npath 1 A). (* = {a1 : A & {a2 : A & a1 = a2}} : Type *)\nEval compute in (Book_2_4_npath 2 A). (* and so on... *)\n*)\n\n(* Given an (n+1)-path, we simply project to a pair of n-paths. *)\nDefinition Book_2_4_nboundary\n : forall {n : nat} {A : Type}, Book_2_4_npath (S n) A ->\n (Book_2_4_npath n A * Book_2_4_npath n A)\n := fun {n} {A} p => (pr1 p, pr1 (pr2 p)).\n\n(* ================================================== ex:ap-to-apd-equiv-apd-to-ap *)\n(** Exercise 2.5 *)\n\n(* Note that \"@\" is notation for concatentation and ^ is for inversion *)\n\nDefinition Book_eq_2_3_6 {A B : Type} {x y : A} (p : x = y) (f : A -> B)\n : (f x = f y) -> (transport (fun _ => B) p (f x) = f y) :=\n fun fx_eq_fy =>\n (HoTT.Basics.PathGroupoids.transport_const p (f x)) @ fx_eq_fy.\n\nDefinition Book_eq_2_3_7 {A B : Type} {x y : A} (p : x = y) (f : A -> B)\n : (transport (fun _ => B) p (f x) = f y) -> f x = f y :=\n fun fx_eq_fy =>\n (HoTT.Basics.PathGroupoids.transport_const p (f x))^ @ fx_eq_fy.\n\n(* By induction on p, it suffices to assume that x ≡ y and p ≡ refl, so\n the above equations concatenate identity paths, which are units under\n concatenation.\n\n [isequiv_adjointify] is one way to prove two functions form an equivalence,\n specifically one proves that they are (category-theoretic) sections of one\n another, that is, each is a right inverse for the other. *)\nDefinition Equivalence_Book_eq_2_3_6_and_Book_eq_2_3_6\n {A B : Type} {x y : A} (p : x = y) (f : A -> B)\n : IsEquiv (Book_eq_2_3_6 p f).\n apply (isequiv_adjointify (Book_eq_2_3_6 p f) (Book_eq_2_3_7 p f));\n unfold Book_eq_2_3_6, Book_eq_2_3_7, transport_const, Sect;\n induction p;\n intros y;\n do 2 (rewrite concat_1p);\n reflexivity.\nDefined.\n\n(* ================================================== ex:equiv-concat *)\n(** Exercise 2.6 *)\n\n(* This exercise is solved in the library as\n HoTT.Types.Paths.isequiv_concat_l\n *)\n\nDefinition concat_left {A : Type} {x y : A} (z : A) (p : x = y)\n : (y = z) -> (x = z) :=\n fun q => p @ q.\n\nDefinition concat_right {A : Type} {x y : A} (z : A) (p : x = y)\n : (x = z) -> (y = z) :=\n fun q => (inverse p) @ q.\n\n(* Again, by induction on p, it suffices to assume that x ≡ y and p ≡ refl, so\n the above equations concatenate identity paths, which are units under\n concatenation. *)\nDefinition Book_2_6 {A : Type} {x y z : A} (p : x = y)\n : IsEquiv (concat_left z p).\n apply (isequiv_adjointify (concat_left z p) (concat_right z p));\n induction p;\n unfold Sect, concat_right, concat_left;\n intros y;\n do 2 (rewrite concat_1p);\n reflexivity.\nDefined.\n\n(* ================================================== ex:ap-sigma *)\n(** Exercise 2.7 *)\n\n(* Already solved as ap_functor_sigma; there is a copy here for completeness *)\n\nSection Book_2_7.\n Definition Book_2_7 {A B : Type} {P : A -> Type} {Q : B -> Type}\n (f : A -> B) (g : forall a, P a -> Q (f a))\n (u v : sigT P) (p : u.1 = v.1) (q : p # u.2 = v.2)\n : ap (functor_sigma f g) (path_sigma P u v p q)\n = path_sigma Q (functor_sigma f g u) (functor_sigma f g v)\n (ap f p)\n ((transport_compose Q f p (g u.1 u.2))^\n @ (@ap_transport _ P (fun x => Q (f x)) _ _ p g u.2)^\n @ ap (g v.1) q).\n Proof.\n destruct u as [u1 u2]; destruct v as [v1 v2]; simpl in p, q.\n destruct p; simpl in q.\n destruct q.\n reflexivity.\n Defined.\nEnd Book_2_7.\n\n(* ================================================== ex:ap-coprod *)\n(** Exercise 2.8 *)\n\n\n\n(* ================================================== ex:coprod-ump *)\n(** Exercise 2.9 *)\n\n(* This exercise is solved in the library as\n HoTT.Types.Sum.equiv_sum_ind\n *)\n(* To extract a function on either summand, compose with the injections *)\nDefinition coprod_ump1 {A B X} : (A + B -> X) -> (A -> X) * (B -> X) :=\n fun f => (f o inl, f o inr).\n\n(* To create a function on the direct sum from functions on the summands, work\n by cases *)\nCheck prod_rect.\nDefinition coprod_ump2 {A B X} : (A -> X) * (B -> X) -> (A + B -> X) :=\n prod_rect (fun _ => A + B -> X) (fun f g => sum_rect (fun _ => X) f g).\n\nDefinition Book_2_9 {A B X} `{Funext} : (A -> X) * (B -> X) <~> (A + B -> X).\n apply (equiv_adjointify coprod_ump2 coprod_ump1).\n - intros f.\n apply path_forall.\n intros [a | b]; reflexivity.\n - intros [f g].\n reflexivity.\nDefined.\n\n(* ================================================== ex:sigma-assoc *)\n(** Exercise 2.10 *)\n\n(* This exercise is solved in the library as\n HoTT.Types.Sigma.equiv_sigma_assoc\n *)\n\nSection TwoTen.\n Context `{A : Type} {B : A -> Type} {C : (exists a : A, B a) -> Type}.\n\n Local Definition f210 : (exists a : A, (exists b : B a, (C (a; b)))) ->\n (exists (p : exists a : A, B a), (C p)) :=\n fun pairpair =>\n match pairpair with (a; pp) =>\n match pp with (b; c) => ((a; b); c) end\n end.\n\n Local Definition g210 : (exists (p : exists a : A, B a), (C p)) ->\n (exists a : A, (exists b : B a, (C (a; b)))).\n intros pairpair.\n induction pairpair as [pair c].\n induction pair as [a b].\n exact (a; (b; c)).\n Defined.\n\n Definition Book_2_10 : (exists a : A, (exists b : B a, (C (a; b)))) <~>\n (exists (p : exists a : A, B a), (C p)).\n apply (equiv_adjointify f210 g210); compute; reflexivity.\n Defined.\nEnd TwoTen.\n\n(* ================================================== ex:pullback *)\n(** Exercise 2.11 *)\n\n\n\n(* ================================================== ex:pullback-pasting *)\n(** Exercise 2.12 *)\n\n\n\n(* ================================================== ex:eqvboolbool *)\n(** Exercise 2.13 *)\n\nDefinition Book_2_13 := @HoTT.Types.Bool.equiv_bool_aut_bool.\n\n(* ================================================== ex:equality-reflection *)\n(** Exercise 2.14 *)\n\n\n\n(* ================================================== ex:strengthen-transport-is-ap *)\n(** Exercise 2.15 *)\n\n\n\n(* ================================================== ex:strong-from-weak-funext *)\n(** Exercise 2.16 *)\n\n\n\n(* ================================================== ex:equiv-functor-types *)\n(** Exercise 2.17 *)\n\n\n\n(* ================================================== ex:dep-htpy-natural *)\n(** Exercise 2.18 *)\n\n\n\n(* ================================================== ex:equiv-functor-set *)\n(** Exercise 3.1 *)\n\nDefinition Book_3_1_solution_1 {A B} (f : A <~> B) (H : IsHSet A)\n := @HoTT.Basics.Trunc.trunc_equiv' A B f 0 H.\n\n(** Alternative solutions: [Book_3_1_solution_2] using UA, and [Book_3_1_solution_3] using two easy lemmas that may be of independent interest *)\n\nLemma Book_3_1_solution_2 `{Univalence} {A B} : A <~> B -> IsHSet A -> IsHSet B.\nProof.\n intro e.\n rewrite (path_universe_uncurried e).\n exact idmap.\nDefined.\n\nLemma retr_f_g_path_in_B {A B} (f : A -> B) (g : B -> A) (alpha : Sect g f) (x y : B) (p : x = y)\n : p = (alpha x)^ @ (ap f (ap g p)) @ (alpha y).\nProof.\n destruct p.\n simpl.\n rewrite concat_p1.\n rewrite concat_Vp.\n exact 1.\nDefined.\n\nLemma retr_f_g_isHSet_A_so_B {A B} (f : A -> B) (g : B -> A)\n : Sect g f -> IsHSet A -> IsHSet B.\nProof.\n intros retr_f_g isHSet_A.\n srapply hset_axiomK. unfold axiomK.\n intros x p.\n assert (ap g p = 1) as g_p_is_1.\n - apply (axiomK_hset isHSet_A).\n - assert (1 = (retr_f_g x) ^ @ (ap f (ap g p)) @ (retr_f_g x)) as rhs_is_1.\n + rewrite g_p_is_1. simpl. rewrite concat_p1. rewrite concat_Vp. exact 1.\n + rewrite (rhs_is_1).\n apply (retr_f_g_path_in_B f g retr_f_g).\nDefined.\n\nLemma Book_3_1_solution_3 {A B} : A <~> B -> IsHSet A -> IsHSet B.\nProof.\n intros equivalent_A_B isHSet_A.\n elim equivalent_A_B; intros f isequiv_f.\n elim isequiv_f; intros g retr_f_g sect_f_g coh.\n apply (retr_f_g_isHSet_A_so_B f g); assumption.\nDefined.\n\n(* ================================================== ex:isset-coprod *)\n(** Exercise 3.2 *)\n\nDefinition Book_3_2_solution_1 := @HoTT.Types.Sum.hset_sum.\n\n(** Alternative solution for replaying *)\n\nLemma Book_3_2_solution_2 (A B : Type) : IsHSet A -> IsHSet B -> IsHSet (A+B).\nProof.\n intros isHSet_A isHSet_B.\n srapply hset_axiomK. unfold axiomK. intros x p. destruct x.\n - rewrite (inverse (eisretr_path_sum p)).\n rewrite (axiomK_hset isHSet_A a (path_sum_inv p)).\n simpl; exact idpath.\n - rewrite (inverse (eisretr_path_sum p)).\n rewrite (axiomK_hset isHSet_B b (path_sum_inv p)).\n simpl; exact idpath.\nDefined.\n\n(* ================================================== ex:isset-sigma *)\n(** Exercise 3.3 *)\n\nDefinition Book_3_3_solution_1 (A : Type) (B : A -> Type)\n := @HoTT.Types.Sigma.trunc_sigma A B 0.\n\n(** This exercise is hard because 2-paths over Sigma types are not treated in the first three chapters of the book. Consult theories/Types/Sigma.v *)\n\nLemma Book_3_3_solution_2 (A : Type) (B : A -> Type) :\n IsHSet A -> (forall x:A, IsHSet (B x)) -> IsHSet { x:A | B x}.\nProof.\n intros isHSet_A allBx_HSet.\n srapply hset_axiomK. intros x xx.\n pose (path_path_sigma B x x xx 1) as useful.\n apply (useful (axiomK_hset _ _ _) (hset_path2 _ _)).\nDefined.\n\n(* ================================================== ex:prop-endocontr *)\n(** Exercise 3.4 *)\n\nLemma Book_3_4_solution_1 `{Funext} (A : Type) : IsHProp A <-> Contr (A -> A).\nProof.\n split.\n - intro isHProp_A.\n exists idmap.\n apply path_ishprop. (* automagically, from IsHProp A *)\n - intro contr_AA.\n apply hprop_allpath; intros a1 a2.\n exact (ap10 (path_contr (fun x:A => a1) (fun x:A => a2)) a1).\nDefined.\n\n(* ================================================== ex:prop-inhabcontr *)\n(** Exercise 3.5 *)\n\nDefinition Book_3_5_solution_1 := @HoTT.HProp.equiv_hprop_inhabited_contr.\n\n(* ================================================== ex:lem-mereprop *)\n(** Exercise 3.6 *)\n\nLemma Book_3_6_solution_1 `{Funext} (A : Type) : IsHProp A -> IsHProp (A + ~A).\nProof.\n intro isHProp_A.\n apply hprop_allpath. intros x y.\n destruct x as [a1|n1]; destruct y as [a2|n2]; apply path_sum; try apply path_ishprop.\n - exact (n2 a1).\n - exact (n1 a2).\nDefined.\n\n(* ================================================== ex:disjoint-or *)\n(** Exercise 3.7 *)\n\nLemma Book_3_7_solution_1 (A B: Type) :\n IsHProp A -> IsHProp B -> ~(A*B) -> IsHProp (A+B).\nProof.\n intros isHProp_A isProp_B nab.\n apply hprop_allpath. intros x y.\n destruct x as [a1|b1]; destruct y as [a2|b2]; apply path_sum; try apply path_ishprop.\n - exact (nab (a1,b2)).\n - exact (nab (a2,b1)).\nDefined.\n\n(* ================================================== ex:brck-qinv *)\n(** Exercise 3.8 *)\n\n\n\n(* ================================================== ex:lem-impl-prop-equiv-bool *)\n(** Exercise 3.9 *)\n\nDefinition LEM := forall (A : Type), IsHProp A -> A + ~A.\n\nDefinition LEM_hProp_Bool (lem : LEM) (hprop : hProp) : Bool\n := match (lem hprop _) with inl _ => true | inr _ => false end.\n\nLemma Book_3_9_solution_1 `{Univalence} : LEM -> hProp <~> Bool.\nProof.\n intro lem.\n apply (equiv_adjointify (LEM_hProp_Bool lem) is_true).\n - unfold Sect. intros []; simpl.\n + unfold LEM_hProp_Bool. elim (lem Unit_hp _).\n * exact (fun _ => 1).\n * intro nUnit. elim (nUnit tt).\n + unfold LEM_hProp_Bool. elim (lem False_hp _).\n * intro fals. elim fals.\n * exact (fun _ => 1).\n - unfold Sect. intro hprop.\n unfold LEM_hProp_Bool.\n elim (lem hprop _).\n + intro p.\n apply path_hprop; simpl. (* path_prop is silent *)\n exact ((if_hprop_then_equiv_Unit hprop p)^-1)%equiv.\n + intro np.\n apply path_hprop; simpl. (* path_prop is silent *)\n exact ((if_not_hprop_then_equiv_Empty hprop np)^-1)%equiv.\nDefined.\n\n(* ================================================== ex:lem-impred *)\n(** Exercise 3.10 *)\n\n\n\n(* ================================================== ex:not-brck-A-impl-A *)\n(** Exercise 3.11 *)\n\n(** This theorem extracts the main idea leading to the contradiction constructed\n in the proof of Theorem 3.2.2, that univalence implies that all functions are\n natural with respect to equivalences.\n\n The terms are complicated, but it pretty much follows the proof in the book,\n step by step.\n *)\nLemma univalence_func_natural_equiv `{Univalence}\n : forall (C : Type -> Type) (all_contr : forall A, Contr (C A -> C A))\n (g : forall A, C A -> A) {A : Type} (e : A <~> A),\n e o (g A) = (g A).\nProof.\n intros C all_contr g A e.\n apply path_forall.\n\n intros x.\n pose (p := path_universe_uncurried e).\n\n (* The propositional computation rule for univalence of section 2.10 *)\n refine (concat (happly (transport_idmap_path_universe_uncurried e)^ (g A x)) _).\n\n (** To obtain the situation of 2.9.4, we rewrite x using\n\n <<<\n x = transport (fun A : Type => C A) p^ x\n >>>\n\n This equality holds because [(C A) -> (C A)] is contractible, so\n\n <<<\n transport (fun A : Type => C A) p^ = idmap\n >>>\n\n In both Theorem 3.2.2 and the following result, the hypothesis\n [Contr ((C A) -> (C A))] will follow from the contractibility of [(C A)].\n *)\n refine (concat (ap _ (ap _ (happly (@path_contr _ (all_contr A)\n idmap (transport _ p^)) x))) _).\n\n (* Equation 2.9.4 is called transport_arrow in the library. *)\n refine (concat (@transport_arrow _ (fun A => C A) idmap _ _ p (g A) x)^ _).\n\n exact (happly (apD g p) x).\nDefined.\n\n(** For this proof, we closely follow the proof of Theorem 3.2.2\n from the text, replacing ¬¬A → A by ∥A∥ → A. *)\nLemma Book_3_11 `{Univalence} : ~ (forall A, Trunc (-1) A -> A).\n (* The proof is by contradiction. We'll assume we have such a\n function, and obtain an element of 0. *)\n intros g.\n\n assert (end_contr : forall A, Contr (Trunc (-1) A -> Trunc (-1) A)).\n {\n intros A.\n apply Book_3_4_solution_1.\n apply Trunc_is_trunc.\n }\n\n (** There are no fixpoints of the fix-point free autoequivalence of 2 (called\n negb). We will derive a contradiction by showing there must be such a fixpoint\n by naturality of g.\n\n We parametrize over b to emphasize that this proof depends only on the fact\n that Bool is inhabited, not on any specific value (we use \"true\" below).\n *)\n pose\n (contr b :=\n (not_fixed_negb (g Bool b))\n (happly (univalence_func_natural_equiv _ end_contr g equiv_negb) b)).\n\n contradiction (contr (tr true)).\nDefined.\n\n(* ================================================== ex:lem-impl-simple-ac *)\n(** Exercise 3.12 *)\n\n\n\n(* ================================================== ex:naive-lem-impl-ac *)\n(** Exercise 3.13 *)\n\nSection Book_3_13.\n Definition naive_LEM_impl_DN_elim (A : Type) (LEM : A + ~A)\n : ~~A -> A\n := fun nna => match LEM with\n | inl a => a\n | inr na => match nna na with end\n end.\n\n Lemma naive_LEM_implies_AC\n : (forall A : Type, A + ~A)\n -> forall X A P,\n (forall x : X, ~~{ a : A x | P x a })\n -> { g : forall x, A x | forall x, P x (g x) }.\n Proof.\n intros LEM X A P H.\n pose (fun x => @naive_LEM_impl_DN_elim _ (LEM _) (H x)) as H'.\n exists (fun x => (H' x).1).\n exact (fun x => (H' x).2).\n Defined.\n\n Lemma Book_3_13 `{Funext}\n : (forall A : Type, A + ~A)\n -> forall X A P,\n IsHSet X\n -> (forall x : X, IsHSet (A x))\n -> (forall x (a : A x), IsHProp (P x a))\n -> (forall x, merely { a : A x & P x a })\n -> merely { g : forall x, A x & forall x, P x (g x) }.\n Proof.\n intros LEM X A P HX HA HP H0.\n apply tr.\n apply (naive_LEM_implies_AC LEM).\n intro x.\n specialize (H0 x).\n revert H0.\n apply Trunc_rec.\n exact (fun x nx => nx x).\n Defined.\nEnd Book_3_13.\n\n(* ================================================== ex:lem-brck *)\n(** Exercise 3.14 *)\n\nSection Book_3_14.\n Context `{Funext}.\n Hypothesis LEM : forall A : Type, IsHProp A -> A + ~A.\n\n Definition Book_3_14\n : forall A (P : ~~A -> Type),\n (forall a, P (fun na => na a))\n -> (forall x y (z : P x) (w : P y), transport P (path_ishprop x y) z = w)\n -> forall x, P x.\n Proof.\n intros A P base p nna.\n assert (forall x, IsHProp (P x)).\n - intro x.\n apply hprop_allpath.\n intros x' y'.\n etransitivity; [ symmetry; apply (p x x y' x') | ].\n (* Without this it somehow proves [H'] using the wrong universe for hprop_Empty and fails when we do [Defined].\n See Coq #4862. *)\n set (path := path_ishprop x x).\n assert (H' : idpath = path) by apply path_ishprop.\n destruct H'.\n reflexivity.\n - destruct (LEM (P nna) _) as [pnna|npnna]; trivial.\n refine (match _ : Empty with end).\n apply nna.\n intro a.\n apply npnna.\n exact (transport P (path_ishprop _ _) (base a)).\n Defined.\n\n Lemma Book_3_14_equiv A : merely A <~> ~~A.\n Proof.\n apply equiv_iff_hprop.\n - apply Trunc_rec.\n exact (fun a na => na a).\n - intro nna.\n apply (@Book_3_14 A (fun _ => merely A)).\n * exact tr.\n * intros x y z w.\n apply path_ishprop.\n * exact nna.\n Defined.\nEnd Book_3_14.\n\n(* ================================================== ex:impred-brck *)\n(** Exercise 3.15 *)\n\n\n\n(* ================================================== ex:lem-impl-dn-commutes *)\n(** Exercise 3.16 *)\n\n\n\n(* ================================================== ex:prop-trunc-ind *)\n(** Exercise 3.17 *)\n\n\n\n(* ================================================== ex:lem-ldn *)\n(** Exercise 3.18 *)\n\n\n\n(* ================================================== ex:decidable-choice *)\n(** Exercise 3.19 *)\n\nDefinition Book_3_19 := @HoTT.BoundedSearch.minimal_n.\n\n(* ================================================== ex:omit-contr2 *)\n(** Exercise 3.20 *)\n\n\n\n(* ================================================== ex:isprop-equiv-equiv-bracket *)\n(** Exercise 3.21 *)\n\n\n\n(* ================================================== ex:finite-choice *)\n(** Exercise 3.22 *)\n\n\n\n(* ================================================== ex:decidable-choice-strong *)\n(** Exercise 3.23 *)\n\n\n\n(* ================================================== ex:two-sided-adjoint-equivalences *)\n(** Exercise 4.1 *)\n\n\n\n(* ================================================== ex:symmetric-equiv *)\n(** Exercise 4.2 *)\n\n\n\n(* ================================================== ex:qinv-autohtpy-no-univalence *)\n(** Exercise 4.3 *)\n\n\n\n(* ================================================== ex:unstable-octahedron *)\n(** Exercise 4.4 *)\n\n\n\n(* ================================================== ex:2-out-of-6 *)\n(** Exercise 4.5 *)\n\nSection Book_4_5.\n Section parts.\n Variables A B C D : Type.\n Variable f : A -> B.\n Variable g : B -> C.\n Variable h : C -> D.\n Context `{IsEquiv _ _ (g o f), IsEquiv _ _ (h o g)}.\n\n Local Instance Book_4_5_g : IsEquiv g.\n Proof.\n apply isequiv_biinv.\n split.\n - exists ((h o g)^-1 o h);\n repeat intro; simpl;\n try apply (@eissect _ _ (h o g)).\n - exists (f o (g o f)^-1);\n repeat intro; simpl;\n try apply (@eisretr _ _ (g o f)).\n Defined.\n\n Local Instance Book_4_5_f : IsEquiv f.\n Proof.\n apply (isequiv_homotopic (g^-1 o (g o f))); try exact _.\n intro; apply (eissect g).\n Defined.\n\n Local Instance Book_4_5_h : IsEquiv h.\n Proof.\n apply (isequiv_homotopic ((h o g) o g^-1)); try exact _.\n intro; apply (ap h); apply (eisretr g).\n Defined.\n\n Definition Book_4_5_hgf : IsEquiv (h o g o f).\n Proof.\n typeclasses eauto.\n Defined.\n End parts.\n\n (*Lemma Book_4_5 A B f `{IsEquiv A B f} (a a' : A) : IsEquiv (@ap _ _ f a a').\n Proof.\n pose (@ap _ _ (f^-1) (f a) (f a')) as f'.\n pose (fun p : f^-1 (f a) = _ => p @ (@eissect _ _ f _ a')) as g'.\n pose (fun p : _ = a' => (@eissect _ _ f _ a)^ @ p) as h'.\n pose (g' o f').\n pose (h' o g').\n admit.\n Qed.*)\nEnd Book_4_5.\n\n(* ================================================== ex:qinv-univalence *)\n(** Exercise 4.6 *)\n\nSection Book_4_6_i.\n\n Definition is_qinv {A B : Type} (f : A -> B)\n := { g : B -> A & (Sect g f * Sect f g)%type }.\n Definition qinv (A B : Type)\n := { f : A -> B & is_qinv f }.\n Definition qinv_id A : qinv A A\n := (fun x => x; (fun x => x ; (fun x => 1, fun x => 1))).\n Definition qinv_path A B : (A = B) -> qinv A B\n := fun p => match p with 1 => qinv_id _ end.\n Definition QInv_Univalence_type := forall (A B : Type@{i}),\n is_qinv (qinv_path A B).\n Definition isequiv_qinv {A B} {f : A -> B}\n : is_qinv f -> IsEquiv f.\n Proof.\n intros [g [s r]].\n exact (isequiv_adjointify f g s r).\n Defined.\n Definition equiv_qinv_path (qua: QInv_Univalence_type) (A B : Type)\n : (A = B) <~> qinv A B\n := Build_Equiv _ _ (qinv_path A B) (isequiv_qinv (qua A B)).\n\n Definition qinv_isequiv {A B} (f : A -> B) `{IsEquiv _ _ f}\n : qinv A B\n := (f ; (f^-1 ; (eisretr f , eissect f))).\n\n Context `{qua : QInv_Univalence_type}.\n\n Theorem qinv_univalence_isequiv_postcompose {A B : Type} {w : A -> B}\n `{H0 : IsEquiv A B w} C : IsEquiv (fun (g:C->A) => w o g).\n Proof.\n unfold QInv_Univalence_type in *.\n pose (w' := qinv_isequiv w).\n refine (isequiv_adjointify\n (fun (g:C->A) => w o g)\n (fun (g:C->B) => w^-1 o g)\n _\n _);\n intros g;\n first [ change ((fun x => w'.1 ( w'.2.1 (g x))) = g)\n | change ((fun x => w'.2.1 ( w'.1 (g x))) = g) ];\n clearbody w'; clear H0 w;\n rewrite <- (@eisretr _ _ (@qinv_path A B) (isequiv_qinv (qua A B)) w');\n generalize ((@equiv_inv _ _ (qinv_path A B) (isequiv_qinv (qua A B))) w');\n intro p; clear w'; destruct p; reflexivity.\n Defined.\n\n (** Now the rest is basically copied from UnivalenceImpliesFunext, with name changes so as to use the current assumption of qinv-univalence rather than a global assumption of ordinary univalence. *)\n\n Local Instance isequiv_src_compose A B\n : @IsEquiv (A -> {xy : B * B & fst xy = snd xy})\n (A -> B)\n (fun g => (fst o pr1) o g).\n Proof.\n rapply @qinv_univalence_isequiv_postcompose.\n refine (isequiv_adjointify\n (fst o pr1) (fun x => ((x, x); idpath))\n (fun _ => idpath)\n _);\n let p := fresh in\n intros [[? ?] p];\n simpl in p; destruct p;\n reflexivity.\n Defined.\n\n Local Instance isequiv_tgt_compose A B\n : @IsEquiv (A -> {xy : B * B & fst xy = snd xy})\n (A -> B)\n (fun g => (snd o pr1) o g).\n Proof.\n rapply @qinv_univalence_isequiv_postcompose.\n refine (isequiv_adjointify\n (snd o pr1) (fun x => ((x, x); idpath))\n (fun _ => idpath)\n _);\n let p := fresh in\n intros [[? ?] p];\n simpl in p; destruct p;\n reflexivity.\n Defined.\n\n Theorem QInv_Univalence_implies_FunextNondep (A B : Type)\n : forall f g : A -> B, f == g -> f = g.\n Proof.\n intros f g p.\n pose (d := fun x : A => existT (fun xy => fst xy = snd xy) (f x, f x) (idpath (f x))).\n pose (e := fun x : A => existT (fun xy => fst xy = snd xy) (f x, g x) (p x)).\n change f with ((snd o pr1) o d).\n change g with ((snd o pr1) o e).\n rapply (ap (fun g => snd o pr1 o g)).\n pose (fun A B x y=> @equiv_inv _ _ _ (@isequiv_ap _ _ _ (@isequiv_src_compose A B) x y)) as H'.\n apply H'.\n reflexivity.\n Defined.\n\n Definition QInv_Univalence_implies_Funext_type : Funext_type\n := NaiveNondepFunext_implies_Funext QInv_Univalence_implies_FunextNondep.\n\nEnd Book_4_6_i.\n\nSection EquivFunctorFunextType.\n (* We need a version of [equiv_functor_forall_id] that takes a [Funext_type] rather than a global axiom [Funext]. *)\n Context (fa : Funext_type).\n\n Definition ft_path_forall {A : Type} {P : A -> Type} (f g : forall x : A, P x) :\n f == g -> f = g\n :=\n @equiv_inv _ _ (@apD10 A P f g) (fa _ _ _ _).\n\n Local Instance ft_isequiv_functor_forall\n {A B:Type} `{P : A -> Type} `{Q : B -> Type}\n {f : B -> A} {g : forall b:B, P (f b) -> Q b}\n `{IsEquiv B A f} `{forall b, @IsEquiv (P (f b)) (Q b) (g b)}\n : IsEquiv (functor_forall f g) | 1000.\n Proof.\n simple refine (isequiv_adjointify\n (functor_forall f g)\n (functor_forall\n (f^-1)\n (fun (x:A) (y:Q (f^-1 x)) => eisretr f x # (g (f^-1 x))^-1 y\n )) _ _);\n intros h.\n - abstract (\n apply ft_path_forall; intros b; unfold functor_forall;\n rewrite eisadj;\n rewrite <- transport_compose;\n rewrite ap_transport;\n rewrite eisretr;\n apply apD\n ).\n - abstract (\n apply ft_path_forall; intros a; unfold functor_forall;\n rewrite eissect;\n apply apD\n ).\n Defined.\n\n Definition ft_equiv_functor_forall\n {A B:Type} `{P : A -> Type} `{Q : B -> Type}\n (f : B -> A) `{IsEquiv B A f}\n (g : forall b:B, P (f b) -> Q b)\n `{forall b, @IsEquiv (P (f b)) (Q b) (g b)}\n : (forall a, P a) <~> (forall b, Q b)\n := Build_Equiv _ _ (functor_forall f g) _.\n\n Definition ft_equiv_functor_forall_id\n {A:Type} `{P : A -> Type} `{Q : A -> Type}\n (g : forall a, P a <~> Q a)\n : (forall a, P a) <~> (forall a, Q a)\n := ft_equiv_functor_forall (equiv_idmap A) g.\n\nEnd EquivFunctorFunextType.\n\n(** Using the Kraus-Sattler space of loops rather than the version in the book, since it is simpler and avoids use of propositional truncation. *)\nDefinition Book_4_6_ii\n (qua1 qua2 : QInv_Univalence_type)\n : ~ IsHProp (forall A : { X : Type & X = X }, A = A).\nProof.\n pose (fa := @QInv_Univalence_implies_Funext_type qua2).\n intros H.\n pose (K := forall (X:Type) (p:X=X), { q : X=X & p @ q = q @ p }).\n assert (e : K <~> forall A : { X : Type & X = X }, A = A).\n { unfold K.\n refine (equiv_sigT_ind _ oE _).\n refine (ft_equiv_functor_forall_id fa _); intros X.\n refine (ft_equiv_functor_forall_id fa _); intros p.\n refine (equiv_path_sigma _ _ _ oE _); cbn.\n refine (equiv_functor_sigma_id _); intros q.\n refine ((equiv_concat_l (transport_paths_lr q p)^ p)^-1 oE _).\n refine ((equiv_concat_l (concat_p_pp _ _ _) _)^-1 oE _).\n apply equiv_moveR_Vp. }\n assert (HK := @trunc_equiv _ _ e^-1 (-1)).\n assert (u : forall (X:Type) (p:X=X), p @ 1 = 1 @ p).\n { intros X p; rewrite concat_p1, concat_1p; reflexivity. }\n pose (alpha := (fun X p => (idpath X ; u X p)) : K).\n pose (beta := (fun X p => (p ; 1)) : K).\n pose (isequiv_qinv (qua1 Bool Bool)).\n assert (r := pr1_path (apD10 (apD10 (path_ishprop alpha beta) Bool)\n ((qinv_path Bool Bool)^-1 (qinv_isequiv equiv_negb)))).\n unfold alpha, beta in r; clear alpha beta.\n apply (ap (qinv_path Bool Bool)) in r.\n rewrite eisretr in r.\n apply pr1_path in r; cbn in r.\n exact (true_ne_false (ap10 r true)).\nDefined.\n\nDefinition allqinv_coherent (qua : QInv_Univalence_type)\n (A B : Type) (f : qinv A B)\n : (fun x => ap f.2.1 (fst f.2.2 x)) = (fun x => snd f.2.2 (f.2.1 x)).\nProof.\n revert f.\n equiv_intro (equiv_qinv_path qua A B) p.\n destruct p; cbn; reflexivity.\nDefined.\n\nDefinition Book_4_6_iii (qua1 qua2 : QInv_Univalence_type) : Empty.\nProof.\n apply (Book_4_6_ii qua1 qua2).\n refine (trunc_succ).\n exists (fun A => 1); intros u.\n set (B := {X : Type & X = X}) in *.\n exact (allqinv_coherent qua2 B B (idmap ; (idmap ; (fun A:B => 1 , u)))).\nDefined.\n\n(* ================================================== ex:embedding-cancellable *)\n(** Exercise 4.7 *)\n\n\n\n(* ================================================== ex:cancellable-from-bool *)\n(** Exercise 4.8 *)\n\n\n\n(* ================================================== ex:funext-from-nondep *)\n(** Exercise 4.9 *)\n\n\n\n(* ================================================== ex:ind-lst *)\n(** Exercise 5.1 *)\n\n\n\n(* ================================================== ex:same-recurrence-not-defeq *)\n(** Exercise 5.2 *)\n\nSection Book_5_2.\n (** Here is one example of functions which are propositionally equal but not judgmentally equal. They satisfy the same reucrrence propositionally. *)\n Let ez : Bool := true.\n Let es : nat -> Bool -> Bool := fun _ => idmap.\n Definition Book_5_2_i : nat -> Bool := nat_ind (fun _ => Bool) ez es.\n Definition Book_5_2_ii : nat -> Bool := fun _ => true.\n Fail Definition Book_5_2_not_defn_eq : Book_5_2_i = Book_5_2_ii := idpath.\n Lemma Book_5_2_i_prop_eq : forall n, Book_5_2_i n = Book_5_2_ii n.\n Proof.\n induction n; simpl; trivial.\n Defined.\nEnd Book_5_2.\n\nSection Book_5_2'.\n (** Here's another example where two functions are not (currently) definitionally equal, but satisfy the same reucrrence judgmentally. This example is a bit less robust; it fails in CoqMT. *)\n Let ez : nat := 1.\n Let es : nat -> nat -> nat := fun _ => S.\n Definition Book_5_2'_i : nat -> nat := fun n => n + 1.\n Definition Book_5_2'_ii : nat -> nat := fun n => 1 + n.\n Fail Definition Book_5_2'_not_defn_eq : Book_5_2'_i = Book_5_2'_ii := idpath.\n Definition Book_5_2'_i_eq_ez : Book_5_2'_i 0 = ez := idpath.\n Definition Book_5_2'_ii_eq_ez : Book_5_2'_ii 0 = ez := idpath.\n Definition Book_5_2'_i_eq_es n : Book_5_2'_i (S n) = es n (Book_5_2'_i n) := idpath.\n Definition Book_5_2'_ii_eq_es n : Book_5_2'_ii (S n) = es n (Book_5_2'_ii n) := idpath.\nEnd Book_5_2'.\n\n(* ================================================== ex:one-function-two-recurrences *)\n(** Exercise 5.3 *)\n\nSection Book_5_3.\n Let ez : Bool := true.\n Let es : nat -> Bool -> Bool := fun _ => idmap.\n Let ez' : Bool := true.\n Let es' : nat -> Bool -> Bool := fun _ _ => true.\n Definition Book_5_3 : nat -> Bool := fun _ => true.\n Definition Book_5_3_satisfies_ez : Book_5_3 0 = ez := idpath.\n Definition Book_5_3_satisfies_ez' : Book_5_3 0 = ez' := idpath.\n Definition Book_5_3_satisfies_es n : Book_5_3 (S n) = es n (Book_5_3 n) := idpath.\n Definition Book_5_3_satisfies_es' n : Book_5_3 (S n) = es' n (Book_5_3 n) := idpath.\n Definition Book_5_3_es_ne_es' : ~(es = es')\n := fun H => false_ne_true (ap10 (ap10 H 0) false).\nEnd Book_5_3.\n\n(* ================================================== ex:bool *)\n(** Exercise 5.4 *)\n\nDefinition Book_5_4 := @HoTT.Types.Bool.equiv_bool_forall_prod.\n\n(* ================================================== ex:ind-nat-not-equiv *)\n(** Exercise 5.5 *)\n\nSection Book_5_5.\n Let ind_nat (P : nat -> Type) := fun x => @nat_ind P (fst x) (snd x).\n\n Lemma Book_5_5 `{fs : Funext} : ~forall P : nat -> Type,\n IsEquiv (@ind_nat P).\n Proof.\n intro H.\n specialize (H (fun _ => Bool)).\n pose proof (eissect (@ind_nat (fun _ => Bool)) (true, (fun _ _ => true))) as H1.\n pose proof (eissect (@ind_nat (fun _ => Bool)) (true, (fun _ => idmap))) as H2.\n cut (ind_nat (fun _ : nat => Bool) (true, fun (_ : nat) (_ : Bool) => true)\n = (ind_nat (fun _ : nat => Bool) (true, fun _ : nat => idmap))).\n - intro H'.\n apply true_ne_false.\n exact (ap10 (apD10 (ap snd (H1^ @ ap _ H' @ H2)) 0) false).\n - apply path_forall.\n intro n; induction n; trivial.\n unfold ind_nat in *; simpl in *.\n rewrite <- IHn.\n destruct n; reflexivity.\n Defined.\nEnd Book_5_5.\n\n(* ================================================== ex:no-dep-uniqueness-failure *)\n(** Exercise 5.6 *)\n\n\n\n(* ================================================== ex:loop *)\n(** Exercise 5.7 *)\n\n\n\n(* ================================================== ex:loop2 *)\n(** Exercise 5.8 *)\n\n\n\n(* ================================================== ex:inductive-lawvere *)\n(** Exercise 5.9 *)\n\n\n\n(* ================================================== ex:ilunit *)\n(** Exercise 5.10 *)\n\n\n\n(* ================================================== ex:empty-inductive-type *)\n(** Exercise 5.11 *)\n\n\n\n(* ================================================== ex:Wprop *)\n(** Exercise 5.12 *)\n\n\n\n(* ================================================== ex:Wbounds *)\n(** Exercise 5.13 *)\n\n\n\n(* ================================================== ex:Wdec *)\n(** Exercise 5.14 *)\n\n\n\n(* ================================================== ex:Wbounds-loose *)\n(** Exercise 5.15 *)\n\n\n\n(* ================================================== ex:Wimpred *)\n(** Exercise 5.16 *)\n\n\n\n(* ================================================== ex:no-nullary-constructor *)\n(** Exercise 5.17 *)\n\n\n\n(* ================================================== ex:torus *)\n(** Exercise 6.1 *)\n\n\n\n(* ================================================== ex:suspS1 *)\n(** Exercise 6.2 *)\n\n\n\n(* ================================================== ex:torus-s1-times-s1 *)\n(** Exercise 6.3 *)\n\n\n\n(* ================================================== ex:nspheres *)\n(** Exercise 6.4 *)\n\n\n\n(* ================================================== ex:susp-spheres-equiv *)\n(** Exercise 6.5 *)\n\n\n\n(* ================================================== ex:spheres-make-U-not-2-type *)\n(** Exercise 6.6 *)\n\n\n\n(* ================================================== ex:monoid-eq-prop *)\n(** Exercise 6.7 *)\n\n\n\n(* ================================================== ex:free-monoid *)\n(** Exercise 6.8 *)\n\n\n\n(* ================================================== ex:unnatural-endomorphisms *)\n(** Exercise 6.9 *)\n\nSection Book_6_9.\n Hypothesis LEM : forall A, IsHProp A -> A + ~A.\n\n Definition Book_6_9 {ua : Univalence} : forall X, X -> X.\n Proof.\n intro X.\n pose proof (@LEM (Contr { f : X <~> X & ~(forall x, f x = x) }) _) as contrXEquiv.\n destruct contrXEquiv as [[f H]|H].\n - (** In the case where we have exactly one autoequivalence which is not the identity, use it. *)\n exact (f.1).\n - (** In the other case, just use the identity. *)\n exact idmap.\n Defined.\n\n Lemma bool_map_equiv_not_idmap (f : { f : Bool <~> Bool & ~(forall x, f x = x) })\n : forall b, ~(f.1 b = b).\n Proof.\n intro b.\n intro H''.\n apply f.2.\n intro b'.\n pose proof (eval_bool_isequiv f.1).\n destruct b', b, (f.1 true), (f.1 false);\n simpl in *;\n match goal with\n | _ => assumption\n | _ => reflexivity\n | [ H : true = false |- _ ] => exact (match true_ne_false H with end)\n | [ H : false = true |- _ ] => exact (match false_ne_true H with end)\n end.\n Qed.\n\n Lemma Book_6_9_not_id {ua : Univalence} `{fs : Funext} : Book_6_9 Bool = negb.\n Proof.\n apply path_forall; intro b.\n unfold Book_6_9.\n destruct (@LEM (Contr { f : Bool <~> Bool & ~(forall x, f x = x) }) _) as [[f H']|H'].\n - pose proof (bool_map_equiv_not_idmap f b).\n destruct (f.1 b), b;\n match goal with\n | _ => assumption\n | _ => reflexivity\n | [ H : ~(_ = _) |- _ ] => exact (match H idpath with end)\n | [ H : true = false |- _ ] => exact (match true_ne_false H with end)\n | [ H : false = true |- _ ] => exact (match false_ne_true H with end)\n end.\n - refine (match H' _ with end).\n eexists (existT (fun f : Bool <~> Bool =>\n ~(forall x, f x = x))\n (Build_Equiv _ _ negb _)\n (fun H => false_ne_true (H true)));\n simpl.\n intro f.\n apply path_sigma_uncurried; simpl.\n refine ((fun H'' =>\n (equiv_path_equiv _ _ H'';\n path_ishprop _ _))\n _);\n simpl.\n apply path_forall; intro b'.\n pose proof (bool_map_equiv_not_idmap f b').\n destruct (f.1 b'), b';\n match goal with\n | _ => assumption\n | _ => reflexivity\n | [ H : ~(_ = _) |- _ ] => exact (match H idpath with end)\n | [ H : true = false |- _ ] => exact (match true_ne_false H with end)\n | [ H : false = true |- _ ] => exact (match false_ne_true H with end)\n end.\n Qed.\n\n(** Simpler solution not using univalence **)\n\n Definition AllExistsOther(X : Type) := forall x:X, { y:X | y <> x }.\n\n Definition centerAllExOthBool : AllExistsOther Bool :=\n fun (b:Bool) => (negb b ; not_fixed_negb b).\n\n Lemma centralAllExOthBool `{Funext} (f: AllExistsOther Bool) : centerAllExOthBool = f.\n Proof. apply path_forall. intro b. pose proof (inverse (negb_ne (f b).2)) as fst.\n unfold centerAllExOthBool.\n apply (@path_sigma _ _ (negb b; not_fixed_negb b) (f b) fst); simpl.\n apply equiv_hprop_allpath. apply trunc_forall.\n Defined.\n\n Definition contrAllExOthBool `{Funext} : Contr (AllExistsOther Bool) :=\n (Build_Contr _ centerAllExOthBool centralAllExOthBool).\n\n Definition solution_6_9 `{Funext} : forall X, X -> X.\n Proof.\n intro X.\n elim (@LEM (Contr (AllExistsOther X)) _); intro.\n - exact (fun x:X => (center (AllExistsOther X) x).1).\n - exact (fun x:X => x).\n Defined.\n\n Lemma not_id_on_Bool `{Funext} : solution_6_9 Bool <> idmap.\n Proof.\n intro Bad. pose proof ((happly Bad) true) as Ugly.\n assert ((solution_6_9 Bool true) = false) as Good.\n - unfold solution_6_9.\n destruct (LEM (Contr (AllExistsOther Bool)) _) as [[f C]|C];simpl.\n + elim (centralAllExOthBool f). reflexivity.\n + elim (C contrAllExOthBool).\n - apply false_ne_true. rewrite (inverse Good). assumption.\n Defined.\n\nEnd Book_6_9.\n\n(* ================================================== ex:funext-from-interval *)\n(** Exercise 6.10 *)\n\n\n\n(* ================================================== ex:susp-lump *)\n(** Exercise 6.11 *)\n\n\n\n(* ================================================== ex:alt-integers *)\n(** Exercise 6.12 *)\n\n\n\n(* ================================================== ex:trunc-bool-interval *)\n(** Exercise 6.13 *)\n\n\n\n(* ================================================== ex:all-types-sets *)\n(** Exercise 7.1 *)\n\nSection Book_7_1.\n Lemma Book_7_1_part_i (H : forall A, merely A -> A) A : IsHSet A.\n Proof.\n apply (@HoTT.HSet.ishset_hrel_subpaths\n A (fun x y => merely (x = y)));\n try typeclasses eauto.\n - intros ?.\n apply tr.\n reflexivity.\n - intros.\n apply H.\n assumption.\n Defined.\n\n Lemma Book_7_1_part_ii (H : forall A B (f : A -> B),\n (forall b, merely (hfiber f b))\n -> forall b, hfiber f b)\n : forall A, IsHSet A.\n Proof.\n apply Book_7_1_part_i.\n intros A a.\n apply (fun H' => (@H A (merely A) tr H' a).1).\n clear a.\n apply Trunc_ind; try exact _.\n intro x; compute; apply tr.\n exists x; reflexivity.\n Defined.\nEnd Book_7_1.\n\n(* ================================================== ex:s2-colim-unit *)\n(** Exercise 7.2 *)\n\n\n\n(* ================================================== ex:ntypes-closed-under-wtypes *)\n(** Exercise 7.3 *)\n\n\n\n(* ================================================== ex:connected-pointed-all-section-retraction *)\n(** Exercise 7.4 *)\n\n\n\n(* ================================================== ex:ntype-from-nconn-const *)\n(** Exercise 7.5 *)\n\n\n\n(* ================================================== ex:connectivity-inductively *)\n(** Exercise 7.6 *)\n\n\n\n(* ================================================== ex:lemnm *)\n(** Exercise 7.7 *)\n\n\n\n(* ================================================== ex:acnm *)\n(** Exercise 7.8 *)\n\n\n\n(* ================================================== ex:acnm-surjset *)\n(** Exercise 7.9 *)\n\n(** Solution for the case (oo,-1). *)\nDefinition Book_7_9_oo_neg1 `{Univalence} (AC_oo_neg1 : forall X : hSet, IsProjective' X) (A : Type)\n : merely (exists X : hSet, exists p : X -> A, IsSurjection p)\n := @HoTT.Projective.projective_cover_AC AC_oo_neg1 _ A.\n\n(* ================================================== ex:acconn *)\n(** Exercise 7.10 *)\n\n\n\n(* ================================================== ex:n-truncation-not-left-exact *)\n(** Exercise 7.11 *)\n\n\n\n(* ================================================== ex:double-negation-modality *)\n(** Exercise 7.12 *)\n\nDefinition Book_7_12 := @HoTT.Modalities.Notnot.NotNot.\n\n(* ================================================== ex:prop-modalities *)\n(** Exercise 7.13 *)\n\nDefinition Book_7_13_part_i := @HoTT.Modalities.Open.Op.\nDefinition Book_7_13_part_ii := @HoTT.Modalities.Closed.Cl.\n\n(* ================================================== ex:f-local-type *)\n(** Exercise 7.14 *)\n\n\n\n(* ================================================== ex:trunc-spokes-no-hub *)\n(** Exercise 7.15 *)\n\n\n\n(* ================================================== ex:s2-colim-unit-2 *)\n(** Exercise 7.16 *)\n\n\n\n(* ================================================== ex:fiber-map-not-conn *)\n(** Exercise 7.17 *)\n\n\n\n(* ================================================== ex:is-conn-trunc-functor *)\n(** Exercise 7.18 *)\n\n\n\n(* ================================================== ex:categorical-connectedness *)\n(** Exercise 7.19 *)\n\n\n\n(* ================================================== ex:homotopy-groups-resp-prod *)\n(** Exercise 8.1 *)\n\n\n\n(* ================================================== ex:decidable-equality-susp *)\n(** Exercise 8.2 *)\n\n\n\n(* ================================================== ex:contr-infinity-sphere-colim *)\n(** Exercise 8.3 *)\n\n\n\n(* ================================================== ex:contr-infinity-sphere-susp *)\n(** Exercise 8.4 *)\n\n\n\n(* ================================================== ex:unique-fiber *)\n(** Exercise 8.5 *)\n\n\n\n(* ================================================== ex:ap-path-inversion *)\n(** Exercise 8.6 *)\n\n\n\n(* ================================================== ex:pointed-equivalences *)\n(** Exercise 8.7 *)\n\n\n\n(* ================================================== ex:HopfJr *)\n(** Exercise 8.8 *)\n\n\n\n(* ================================================== ex:SuperHopf *)\n(** Exercise 8.9 *)\n\n\n\n(* ================================================== ex:vksusppt *)\n(** Exercise 8.10 *)\n\n\n\n(* ================================================== ex:vksuspnopt *)\n(** Exercise 8.11 *)\n\n\n\n(* ================================================== ex:slice-precategory *)\n(** Exercise 9.1 *)\n\n\n\n(* ================================================== ex:set-slice-over-equiv-functor-category *)\n(** Exercise 9.2 *)\n\n\n\n(* ================================================== ex:functor-equiv-right-adjoint *)\n(** Exercise 9.3 *)\n\n\n\n(* ================================================== ct:pre2cat *)\n(** Exercise 9.4 *)\n\n\n\n(* ================================================== ct:2cat *)\n(** Exercise 9.5 *)\n\n\n\n(* ================================================== ct:groupoids *)\n(** Exercise 9.6 *)\n\n\n\n(* ================================================== ex:2strict-cat *)\n(** Exercise 9.7 *)\n\n\n\n(* ================================================== ex:pre2dagger-cat *)\n(** Exercise 9.8 *)\n\n\n\n(* ================================================== ct:ex:hocat *)\n(** Exercise 9.9 *)\n\n\n\n(* ================================================== ex:dagger-rezk *)\n(** Exercise 9.10 *)\n\n\n\n(* ================================================== ex:rezk-vankampen *)\n(** Exercise 9.11 *)\n\n\n\n(* ================================================== ex:stack *)\n(** Exercise 9.12 *)\n\n\n\n(* ================================================== ex:utype-ct *)\n(** Exercise 10.1 *)\n\n\n\n(* ================================================== ex:surjections-have-sections-impl-ac *)\n(** Exercise 10.2 *)\n\n\n\n(* ================================================== ex:well-pointed *)\n(** Exercise 10.3 *)\n\n\n\n(* ================================================== ex:add-ordinals *)\n(** Exercise 10.4 *)\n\n\n\n(* ================================================== ex:multiply-ordinals *)\n(** Exercise 10.5 *)\n\n\n\n(* ================================================== ex:algebraic-ordinals *)\n(** Exercise 10.6 *)\n\n\n\n(* ================================================== ex:prop-ord *)\n(** Exercise 10.7 *)\n\n\n\n(* ================================================== ex:ninf-ord *)\n(** Exercise 10.8 *)\n\n\n\n(* ================================================== ex:well-founded-extensional-simulation *)\n(** Exercise 10.9 *)\n\n\n\n(* ================================================== ex:choice-function *)\n(** Exercise 10.10 *)\n\n\n\n(* ================================================== ex:cumhierhit *)\n(** Exercise 10.11 *)\n\n\n\n(* ================================================== ex:strong-collection *)\n(** Exercise 10.12 *)\n\n\n\n(* ================================================== ex:choice-cumulative-hierarchy-choice *)\n(** Exercise 10.13 *)\n\n\n\n(* ================================================== ex:plump-ordinals *)\n(** Exercise 10.14 *)\n\n\n\n(* ================================================== ex:not-plump *)\n(** Exercise 10.15 *)\n\n\n\n(* ================================================== ex:plump-successor *)\n(** Exercise 10.16 *)\n\n\n\n(* ================================================== ex:ZF-algebras *)\n(** Exercise 10.17 *)\n\n\n\n(* ================================================== ex:monos-are-split-monos-iff-LEM-holds *)\n(** Exercise 10.18 *)\n\n\n\n(* ================================================== ex:alt-dedekind-reals *)\n(** Exercise 11.1 *)\n\n\n\n(* ================================================== ex:RD-extended-reals *)\n(** Exercise 11.2 *)\n\n\n\n(* ================================================== ex:RD-lower-cuts *)\n(** Exercise 11.3 *)\n\n\n\n(* ================================================== ex:RD-interval-arithmetic *)\n(** Exercise 11.4 *)\n\n\n\n(* ================================================== ex:RD-lt-vs-le *)\n(** Exercise 11.5 *)\n\n\n\n(* ================================================== ex:reals-non-constant-into-Z *)\n(** Exercise 11.6 *)\n\n\n\n(* ================================================== ex:traditional-archimedean *)\n(** Exercise 11.7 *)\n\n\n\n(* ================================================== RC-Lipschitz-on-interval *)\n(** Exercise 11.8 *)\n\n\n\n(* ================================================== ex:metric-completion *)\n(** Exercise 11.9 *)\n\n\n\n(* ================================================== ex:reals-apart-neq-MP *)\n(** Exercise 11.10 *)\n\n\n\n(* ================================================== ex:reals-apart-zero-divisors *)\n(** Exercise 11.11 *)\n\n\n\n(* ================================================== ex:finite-cover-lebesgue-number *)\n(** Exercise 11.12 *)\n\n\n\n(* ================================================== ex:mean-value-theorem *)\n(** Exercise 11.13 *)\n\n\n\n(* ================================================== ex:knuth-surreal-check *)\n(** Exercise 11.14 *)\n\n\n\n(* ================================================== ex:reals-into-surreals *)\n(** Exercise 11.15 *)\n\n\n\n(* ================================================== ex:ord-into-surreals *)\n(** Exercise 11.16 *)\n\n\n\n(* ================================================== ex:hiit-plump *)\n(** Exercise 11.17 *)\n\n\n\n(* ================================================== ex:pseudo-ordinals *)\n(** Exercise 11.18 *)\n\n\n\n(* ================================================== ex:double-No-recursion *)\n(** Exercise 11.19 *)\n\n\n\n"} {"text": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# java2python.mod -> provides simple modification routines for the\n# library and projects using it.\n#\n# The java2python.mod.basic module contains various functions for\n# sprinkling generated source with docstrings, comments, decorators,\n# etc.\n#\n# The java2python.mod.inclues module contains functions that the\n# library will include directly -- as source code -- in the generated\n# output.\n#\n# The java2python.mod.transform module contains values and functions\n# for transforming input AST nodes.\n"} {"text": "package htpasswd\n\nimport (\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n\n\t\"github.com/docker/distribution/context\"\n\t\"github.com/docker/distribution/registry/auth\"\n)\n\nfunc TestBasicAccessController(t *testing.T) {\n\ttestRealm := \"The-Shire\"\n\ttestUsers := []string{\"bilbo\", \"frodo\", \"MiShil\", \"DeokMan\"}\n\ttestPasswords := []string{\"baggins\", \"baggins\", \"새주\", \"공주님\"}\n\ttestHtpasswdContent := `bilbo:{SHA}5siv5c0SHx681xU6GiSx9ZQryqs=\n\t\t\t\t\t\t\tfrodo:$2y$05$926C3y10Quzn/LnqQH86VOEVh/18T6RnLaS.khre96jLNL/7e.K5W\n\t\t\t\t\t\t\tMiShil:$2y$05$0oHgwMehvoe8iAWS8I.7l.KoECXrwVaC16RPfaSCU5eVTFrATuMI2\n\t\t\t\t\t\t\tDeokMan:공주님`\n\n\ttempFile, err := ioutil.TempFile(\"\", \"htpasswd-test\")\n\tif err != nil {\n\t\tt.Fatal(\"could not create temporary htpasswd file\")\n\t}\n\tif _, err = tempFile.WriteString(testHtpasswdContent); err != nil {\n\t\tt.Fatal(\"could not write temporary htpasswd file\")\n\t}\n\n\toptions := map[string]interface{}{\n\t\t\"realm\": testRealm,\n\t\t\"path\": tempFile.Name(),\n\t}\n\tctx := context.Background()\n\n\taccessController, err := newAccessController(options)\n\tif err != nil {\n\t\tt.Fatal(\"error creating access controller\")\n\t}\n\n\ttempFile.Close()\n\n\tvar userNumber = 0\n\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tctx := context.WithRequest(ctx, r)\n\t\tauthCtx, err := accessController.Authorized(ctx)\n\t\tif err != nil {\n\t\t\tswitch err := err.(type) {\n\t\t\tcase auth.Challenge:\n\t\t\t\terr.SetHeaders(w)\n\t\t\t\tw.WriteHeader(http.StatusUnauthorized)\n\t\t\t\treturn\n\t\t\tdefault:\n\t\t\t\tt.Fatalf(\"unexpected error authorizing request: %v\", err)\n\t\t\t}\n\t\t}\n\n\t\tuserInfo, ok := authCtx.Value(auth.UserKey).(auth.UserInfo)\n\t\tif !ok {\n\t\t\tt.Fatal(\"basic accessController did not set auth.user context\")\n\t\t}\n\n\t\tif userInfo.Name != testUsers[userNumber] {\n\t\t\tt.Fatalf(\"expected user name %q, got %q\", testUsers[userNumber], userInfo.Name)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t}))\n\n\tclient := &http.Client{\n\t\tCheckRedirect: nil,\n\t}\n\n\treq, _ := http.NewRequest(\"GET\", server.URL, nil)\n\tresp, err := client.Do(req)\n\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error during GET: %v\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\t// Request should not be authorized\n\tif resp.StatusCode != http.StatusUnauthorized {\n\t\tt.Fatalf(\"unexpected non-fail response status: %v != %v\", resp.StatusCode, http.StatusUnauthorized)\n\t}\n\n\tnonbcrypt := map[string]struct{}{\n\t\t\"bilbo\": {},\n\t\t\"DeokMan\": {},\n\t}\n\n\tfor i := 0; i < len(testUsers); i++ {\n\t\tuserNumber = i\n\t\treq, err := http.NewRequest(\"GET\", server.URL, nil)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"error allocating new request: %v\", err)\n\t\t}\n\n\t\treq.SetBasicAuth(testUsers[i], testPasswords[i])\n\n\t\tresp, err = client.Do(req)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"unexpected error during GET: %v\", err)\n\t\t}\n\t\tdefer resp.Body.Close()\n\n\t\tif _, ok := nonbcrypt[testUsers[i]]; ok {\n\t\t\t// these are not allowed.\n\t\t\t// Request should be authorized\n\t\t\tif resp.StatusCode != http.StatusUnauthorized {\n\t\t\t\tt.Fatalf(\"unexpected non-success response status: %v != %v for %s %s\", resp.StatusCode, http.StatusUnauthorized, testUsers[i], testPasswords[i])\n\t\t\t}\n\t\t} else {\n\t\t\t// Request should be authorized\n\t\t\tif resp.StatusCode != http.StatusNoContent {\n\t\t\t\tt.Fatalf(\"unexpected non-success response status: %v != %v for %s %s\", resp.StatusCode, http.StatusNoContent, testUsers[i], testPasswords[i])\n\t\t\t}\n\t\t}\n\t}\n\n}\n"} {"text": "package com.sohu.test.dao;\r\n\r\nimport javax.annotation.Resource;\r\n\r\nimport org.junit.Test;\r\n\r\nimport com.sohu.cache.constant.AppAuditLogTypeEnum;\r\nimport com.sohu.cache.dao.AppAuditLogDao;\r\nimport com.sohu.cache.entity.AppAuditLog;\r\nimport com.sohu.test.BaseTest;\r\n\r\n/**\r\n * @author leifu\r\n * @Date 2014年12月23日\r\n * @Time 上午9:41:16\r\n */\r\npublic class AppAuditLogDaoTest extends BaseTest {\r\n @Resource(name = \"appAuditLogDao\")\r\n private AppAuditLogDao appAuditLogDao;\r\n\r\n @Test\r\n public void getAuditByType() {\r\n Long appAuditId = 75L;\r\n AppAuditLog appAuditLog = appAuditLogDao.getAuditByType(appAuditId, AppAuditLogTypeEnum.APP_CHECK.value());\r\n logger.info(\"{}\", appAuditLog);\r\n }\r\n\r\n}\r\n"} {"text": ".inline-block {\n\tdisplay: inline-block;\n}\n\n.text-left {\n\ttext-align: left;\n}\n\n.text-right {\n\ttext-align: right;\n}\n\n.w-50 {\n\twidth: 49%;\n}\n\n.inline {\n\tdisplay: inline-block;\n}\n\n.meta-label {\n\tdisplay: inline-block;\n\tfont-weight: bold;\n\tmargin-bottom: 5px;\n}\n\n.meta-container {\n\tdisplay: block;\n\tmargin-top: 20px;\n}"} {"text": "import { darken } from 'polished'\nimport { mapValues } from 'lodash'\nimport { keyframes } from 'styled-components'\n\nimport { colors, AccentPaletteMap, Color, CorePalette, CorePaletteMap, AccentName } from './colors'\n\ninterface BaseTheme {\n white: Color\n black: Color\n transparent: Color\n\n primary: CorePalette\n secondary: CorePalette\n accents: AccentPaletteMap\n colors: typeof colors\n\n motion: Motion & {\n fast: Motion\n normal: Motion\n slow: Motion\n }\n\n shell: ColorPair\n\n overlay: ColorPair\n\n button: TouchableStyleSet\n\n // Known extensible properties\n backgroundColor: Color\n textColor: Color\n}\n/* eslint-disable-next-line */\ntype GeneratedTheme = ReturnType\nexport type Theme = BaseTheme & GeneratedTheme\n\ninterface Touchable {\n backgroundColor: Color\n textColor: Color\n\n active: ColorPair\n disabled: ColorPair\n}\nexport type TouchableIntentName = AccentName | 'primary' | 'secondary' | 'mute'\ntype TouchableStyleSet = { [style in TouchableIntentName]: Touchable }\n\ninterface Motion {\n duration: number\n easing: string\n}\n\ninterface ColorPair {\n backgroundColor: string\n textColor?: string\n}\n\nexport type ThemeSelector = (theme: Theme) => Color | undefined\n\nexport interface ColorProps {\n bg?: ThemeSelector\n fg?: ThemeSelector\n}\n\nfunction isColor(value: string | ThemeSelector): value is Color {\n return typeof value === 'string' && /^(#|rgb|hsl)/.test(value)\n}\nexport const getThemeColor = (theme: Theme, color: Color | ThemeSelector, fallback?: Color) =>\n typeof color === 'function' ? color(theme) || fallback : isColor(color) ? color : fallback\n\nconst createTheme = (\n name: string,\n { primary, secondary, core }: CorePaletteMap,\n accents: AccentPaletteMap\n) => ({\n name,\n core,\n white: colors.static.white,\n black: colors.static.black,\n transparent: colors.static.transparent,\n\n backgroundColor: core.darkBackground,\n textColor: core.textColor,\n\n primary,\n secondary,\n accents,\n colors,\n\n motion: {\n duration: 16 * 16,\n easing: 'cubic-bezier(0.165, 0.84, 0.44, 1)',\n\n fast: {\n duration: 16 * 16,\n easing: 'cubic-bezier(0.19, 1, 0.22, 1)'\n },\n\n normal: {\n duration: 16 * 16,\n easing: 'cubic-bezier(0.165, 0.84, 0.44, 1)'\n },\n\n slow: {\n duration: 16 * 16,\n easing: 'cubic-bezier(0.165, 0.84, 0.44, 1)'\n }\n },\n\n overlay: {\n backgroundColor: darken(0.1, primary[1]),\n textColor: secondary[2]\n },\n\n tile: {\n inputColor: secondary[4]\n },\n\n flash: keyframes`\n 0% {\n background-color: ${primary.base};\n }\n 50% {\n background-color: ${accents.primary.darker};\n }\n 100% {\n background-color: ${primary.base};\n }\n `,\n\n button: {\n mute: {\n backgroundColor: primary.base,\n textColor: secondary.base,\n\n active: {\n backgroundColor: primary[4]\n },\n disabled: {\n backgroundColor: primary[3]\n }\n },\n\n primary: {\n backgroundColor: accents.primary.base,\n textColor: colors.static.white,\n\n active: {\n backgroundColor: accents.primary.darker,\n textColor: colors.static.white\n },\n disabled: {\n backgroundColor: primary[1],\n textColor: secondary.base\n }\n },\n\n secondary: {\n backgroundColor: primary[1],\n textColor: secondary.base,\n\n active: {\n backgroundColor: accents.primary.darker,\n textColor: colors.static.white\n },\n disabled: {\n backgroundColor: primary[1]\n }\n },\n\n ...mapValues(accents, ({ base, darker }) => ({\n backgroundColor: base,\n textColor: colors.static.white,\n\n active: {\n backgroundColor: darker\n },\n disabled: {\n backgroundColor: primary[1],\n textColor: secondary.base\n }\n }))\n } as TouchableStyleSet,\n\n dropdown: {\n backgroundColor: primary.base,\n textColor: secondary.base,\n\n active: {\n backgroundColor: primary[2]\n },\n\n disabled: {\n backgroundColor: primary[1],\n textColor: primary[2]\n }\n }\n})\n\nconst lightTheme = createTheme('light', colors.light, colors.accents)\nconst darkTheme = createTheme('dark', colors.dark, colors.accents)\n\nexport const themes = {\n light: lightTheme,\n dark: darkTheme\n}\n"} {"text": "/*\n * Copyright 2016 The BigDL 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 com.intel.analytics.bigdl.utils.tf.loaders\n\nimport java.nio.ByteOrder\n\nimport com.intel.analytics.bigdl.Module\nimport com.intel.analytics.bigdl.nn.ops.{Inv => InvOps}\nimport com.intel.analytics.bigdl.tensor.TensorNumericMath.TensorNumeric\nimport com.intel.analytics.bigdl.utils.tf.Context\nimport org.tensorflow.framework.{DataType, NodeDef}\n\nimport scala.reflect.ClassTag\n\nclass Reciprocal extends TensorflowOpsLoader {\n\n import Utils._\n\n override def build[T: ClassTag](nodeDef: NodeDef, byteOrder: ByteOrder, context: Context[T])\n (implicit ev: TensorNumeric[T]): Module[T] = {\n\n val t = getType(nodeDef.getAttrMap, \"T\")\n if (t == DataType.DT_FLOAT) {\n InvOps[T, Float]()\n } else if (t == DataType.DT_DOUBLE) {\n InvOps[T, Double]()\n } else {\n throw new UnsupportedOperationException(s\"Not support load Inv when type is ${t}\")\n }\n }\n}\n"} {"text": "fileFormatVersion: 2\nguid: b1123199ddcc6c140b5f1ed109df7fa3\nfolderAsset: yes\ntimeCreated: 1507913837\nlicenseType: Free\nDefaultImporter:\n userData: \n assetBundleName: \n assetBundleVariant: \n"} {"text": "caption: Parámetros\ncreated: 20150220152540000\nes-title: Parámetros de filtro\nmodified: 20160421055748029\ntags: [[Filter Syntax]]\ntitle: Filter Parameter\ntype: text/vnd.tiddlywiki\n\n<$railroad text=\"\"\"\n( \"[\" [:{/\"nada excepto ]\"/}] \"]\"\n |\n \"{\" [:{/\"nada excepto }\"/}] \"}\"\n |\n \"<\" [:{/\"nada excepto >\"/}] \">\"\n)\n\"\"\"/>\n\nLos parámetros de un [[operador|Filter Operators]] son valores que pueden ser:\n\n;<<.def rígidos>> o <<.def \"a fuego\">>\n: `[tal cual]`\n: El parámetro es el valor exacto y literal que aparece entre corchetes.\n;<<.def flexibles>>\n: <<.def indirectos>>\n:: `{tal cual}`\n:: El parámetro es el texto indicado por la [[referencia|TextReference]] cuyo nombre se muestra entre llaves, es decir, el valor de determinado [[campo|TiddlerFields]] en un tiddler en concreto o el valor de una propiedad de determinado [[tiddler de datos|DataTiddlers]].\n: <<.def variables>>\n:: ``\n:: El parámetro es el valor actual de la [[variable|Variables]] cuyo nombre aparece entre comillas angulares simples. Los parámetros de macros <<.em no>> están soportados.\n"} {"text": "\r\n\r\n \r\n \r\n 909\r\n PrimeOCR\r\n 4.3\r\n \r\n \r\n \r\n \r\n Text (Structured)\r\n \r\n \r\n This is an outline record only, and requires further details, research or authentication to provide information that will enable users to further understand the format and to assess digital preservation risks associated with it if appropriate. If you are able to help by supplying any additional information concerning this entry, please return to the main PRONOM page and select ‘Add an Entry’.\r\n Binary\r\n \r\n \r\n \r\n \r\n \r\n \r\n 1\r\n Digital Preservation Department / The National Archives\r\n 06 Oct 2009\r\n \r\n \r\n 06 Oct 2009\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n fmt/188\r\n PUID\r\n \r\n \r\n 893\r\n pro\r\n File extension\r\n \r\n \r\n 252\r\n PrimeOCR 4.3\r\n Initial bytes of PrimeOCR output format represent Version,Format,Confidence and are represented in binary as ASCII at the beginning of the *.pro format. The value 430,0,450, represent version 4.3 of the format, custom word flag representing format and a confidence of 850 (PrimeOCR confidence * 100). The hex representation of this is 34 33 30 2C 30 2C 34 35 30 2C (we include the final signature represented in the format to create the unique signature). If version 4.3 is represented as 34 33 30 (ascii), version 4.2 for example is represented as 34 32 30, 3.8 as 33 38 39.\r\n \r\n 324\r\n Absolute from BOF\r\n 0\r\n \r\n \r\n \r\n \r\n \r\n \r\n Little-endian\r\n 3433302C??2C{3}2C\r\n \r\n \r\n \r\n Criteria\r\n \r\n\r\n"} {"text": "#N canvas 686 25 450 300 10;\n#X obj 129 123 deadzone 5;\n#X obj 116 79 hsl 128 15 -20 20 0 0 empty empty empty -2 -8 0 10 -262144\n-1 -1 12700 1;\n#X obj 116 169 hsl 128 15 -20 20 0 0 empty empty empty -2 -8 0 10 -262144\n-1 -1 12700 1;\n#X floatatom 140 148 5 0 0 0 - - -;\n#X text 16 18 [deadzone] converts all input within the range -N...0...N\nto 0 Useful with joysticks.;\n#X text 252 240 2009 Luke Iannini;\n#X text 252 260 proyekto.net;\n#X connect 0 0 2 0;\n#X connect 0 0 3 0;\n#X connect 1 0 0 0;\n"} {"text": "//------------------------------------------------------------------------------\r\n// \r\n// This code was generated by a tool.\r\n//\r\n// Changes to this file may cause incorrect behavior and will be lost if\r\n// the code is regenerated. \r\n// \r\n//------------------------------------------------------------------------------\r\n\r\nnamespace FST.Web {\r\n \r\n \r\n public partial class frmDefault {\r\n \r\n /// \r\n /// PnlCaseTypes control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Panel PnlCaseTypes;\r\n \r\n /// \r\n /// lblCase_Type control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Label lblCase_Type;\r\n \r\n /// \r\n /// ddlCase_Type control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.DropDownList ddlCase_Type;\r\n \r\n /// \r\n /// ddlTheta control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.DropDownList ddlTheta;\r\n \r\n /// \r\n /// Label1 control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Label Label1;\r\n \r\n /// \r\n /// ddlLabKit control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.DropDownList ddlLabKit;\r\n \r\n /// \r\n /// lblDegradedType control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Label lblDegradedType;\r\n \r\n /// \r\n /// ddlDegradedType control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.DropDownList ddlDegradedType;\r\n \r\n /// \r\n /// pnlSuspPrfl1 control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Panel pnlSuspPrfl1;\r\n \r\n /// \r\n /// lblSuspPrfl1_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Label lblSuspPrfl1_Nm;\r\n \r\n /// \r\n /// txtSuspPrfl1_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.TextBox txtSuspPrfl1_Nm;\r\n \r\n /// \r\n /// pnlSuspPrfl2 control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Panel pnlSuspPrfl2;\r\n \r\n /// \r\n /// lblSuspPrfl2_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Label lblSuspPrfl2_Nm;\r\n \r\n /// \r\n /// txtSuspPrfl2_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.TextBox txtSuspPrfl2_Nm;\r\n \r\n /// \r\n /// pnlSuspPrfl3 control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Panel pnlSuspPrfl3;\r\n \r\n /// \r\n /// lblSuspPrfl3_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Label lblSuspPrfl3_Nm;\r\n \r\n /// \r\n /// txtSuspPrfl3_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.TextBox txtSuspPrfl3_Nm;\r\n \r\n /// \r\n /// pnlSuspPrfl4 control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Panel pnlSuspPrfl4;\r\n \r\n /// \r\n /// lblSuspPrfl4_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Label lblSuspPrfl4_Nm;\r\n \r\n /// \r\n /// txtSuspPrfl4_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.TextBox txtSuspPrfl4_Nm;\r\n \r\n /// \r\n /// pnlKnownPrfl1 control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Panel pnlKnownPrfl1;\r\n \r\n /// \r\n /// lblKnownPrfl1_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Label lblKnownPrfl1_Nm;\r\n \r\n /// \r\n /// txtKnownPrfl1_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.TextBox txtKnownPrfl1_Nm;\r\n \r\n /// \r\n /// pnlKnownPrfl2 control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Panel pnlKnownPrfl2;\r\n \r\n /// \r\n /// lblKnownPrfl2_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Label lblKnownPrfl2_Nm;\r\n \r\n /// \r\n /// txtKnownPrfl2_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.TextBox txtKnownPrfl2_Nm;\r\n \r\n /// \r\n /// pnlKnownPrfl3 control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Panel pnlKnownPrfl3;\r\n \r\n /// \r\n /// lblKnownPrfl3_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Label lblKnownPrfl3_Nm;\r\n \r\n /// \r\n /// txtKnownPrfl3_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.TextBox txtKnownPrfl3_Nm;\r\n \r\n /// \r\n /// pnlKnownPrfl4 control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Panel pnlKnownPrfl4;\r\n \r\n /// \r\n /// lblKnownPrfl4_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Label lblKnownPrfl4_Nm;\r\n \r\n /// \r\n /// txtKnownPrfl4_Nm control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.TextBox txtKnownPrfl4_Nm;\r\n \r\n /// \r\n /// pnlUserWarning control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Panel pnlUserWarning;\r\n \r\n /// \r\n /// lblWarningMsg control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.Label lblWarningMsg;\r\n \r\n /// \r\n /// btnBulk control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.ImageButton btnBulk;\r\n \r\n /// \r\n /// btnGo control.\r\n /// \r\n /// \r\n /// Auto-generated field.\r\n /// To modify move field declaration from designer file to code-behind file.\r\n /// \r\n protected global::System.Web.UI.WebControls.ImageButton btnGo;\r\n }\r\n}\r\n"} {"text": "/* !\n * @overview es6-promise - an implementation of Promise API.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version v4.2.8+1e68dce6\n */\n\n(function(global, factory) {\n typeof exports === \"object\" && typeof module !== \"undefined\"\n ? (module.exports = factory())\n : typeof define === \"function\" && define.amd\n ? define(factory)\n : (global.ES6Promise = factory());\n})(this, function() {\n \"use strict\";\n\n function objectOrFunction(x) {\n var type = typeof x;\n return x !== null && (type === \"object\" || type === \"function\");\n }\n\n function isFunction(x) {\n return typeof x === \"function\";\n }\n\n var _isArray = void 0;\n if (Array.isArray) {\n _isArray = Array.isArray;\n } else {\n _isArray = function(x) {\n return Object.prototype.toString.call(x) === \"[object Array]\";\n };\n }\n\n var isArray = _isArray;\n\n var len = 0;\n var vertxNext = void 0;\n var customSchedulerFn = void 0;\n\n var asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n };\n\n function setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n }\n\n function setAsap(asapFn) {\n asap = asapFn;\n }\n\n var browserWindow = typeof window !== \"undefined\" ? window : undefined;\n var browserGlobal = browserWindow || {};\n var BrowserMutationObserver =\n browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\n var isNode =\n typeof self === \"undefined\" &&\n typeof process !== \"undefined\" &&\n {}.toString.call(process) === \"[object process]\";\n\n // test for web worker but not in IE10\n var isWorker =\n typeof Uint8ClampedArray !== \"undefined\" &&\n typeof importScripts !== \"undefined\" &&\n typeof MessageChannel !== \"undefined\";\n\n // node\n function useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function() {\n return process.nextTick(flush);\n };\n }\n\n // vertx\n function useVertxTimer() {\n if (typeof vertxNext !== \"undefined\") {\n return function() {\n vertxNext(flush);\n };\n }\n\n return useSetTimeout();\n }\n\n function useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode(\"\");\n observer.observe(node, { characterData: true });\n\n return function() {\n // eslint-disable-next-line no-plusplus\n node.data = iterations = ++iterations % 2;\n };\n }\n\n // web worker\n function useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function() {\n return channel.port2.postMessage(0);\n };\n }\n\n function useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function() {\n return globalSetTimeout(flush, 1);\n };\n }\n\n var queue = new Array(1000);\n function flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n }\n\n function attemptVertx() {\n try {\n var vertx = Function(\"return this\")().require(\"vertx\");\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n }\n\n var scheduleFlush = void 0;\n // Decide what async method to use to triggering processing of queued callbacks:\n if (isNode) {\n scheduleFlush = useNextTick();\n } else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n } else if (isWorker) {\n scheduleFlush = useMessageChannel();\n } else if (browserWindow === undefined && typeof require === \"function\") {\n scheduleFlush = attemptVertx();\n } else {\n scheduleFlush = useSetTimeout();\n }\n\n function then(onFulfillment, onRejection) {\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n if (_state) {\n var callback = arguments[_state - 1];\n asap(function() {\n return invokeCallback(_state, child, callback, parent._result);\n });\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n }\n\n /**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\n function resolve$1(object) {\n /* jshint validthis:true */\n var Constructor = this;\n\n if (\n object &&\n typeof object === \"object\" &&\n object.constructor === Constructor\n ) {\n return object;\n }\n\n var promise = new Constructor(noop);\n resolve(promise, object);\n return promise;\n }\n\n var PROMISE_ID = Math.random()\n .toString(36)\n .substring(2);\n\n function noop() {}\n\n var PENDING = void 0;\n var FULFILLED = 1;\n var REJECTED = 2;\n\n function selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n }\n\n function cannotReturnOwn() {\n return new TypeError(\n \"A promises callback cannot return that same promise.\"\n );\n }\n\n function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {\n try {\n then$$1.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n }\n\n function handleForeignThenable(promise, thenable, then$$1) {\n asap(function(promise) {\n var sealed = false;\n var error = tryThen(\n then$$1,\n thenable,\n function(value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n },\n function(reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n reject(promise, reason);\n },\n \"Settle: \" + (promise._label || \" unknown promise\")\n );\n\n if (!sealed && error) {\n sealed = true;\n reject(promise, error);\n }\n }, promise);\n }\n\n function handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n reject(promise, thenable._result);\n } else {\n subscribe(\n thenable,\n undefined,\n function(value) {\n return resolve(promise, value);\n },\n function(reason) {\n return reject(promise, reason);\n }\n );\n }\n }\n\n function handleMaybeThenable(promise, maybeThenable, then$$1) {\n if (\n maybeThenable.constructor === promise.constructor &&\n then$$1 === then &&\n maybeThenable.constructor.resolve === resolve$1\n ) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then$$1 === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then$$1)) {\n handleForeignThenable(promise, maybeThenable, then$$1);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n }\n\n function resolve(promise, value) {\n if (promise === value) {\n reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n var then$$1 = void 0;\n try {\n then$$1 = value.then;\n } catch (error) {\n reject(promise, error);\n return;\n }\n handleMaybeThenable(promise, value, then$$1);\n } else {\n fulfill(promise, value);\n }\n }\n\n function publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n }\n\n function fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n }\n\n function reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n }\n\n function subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n }\n\n function publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = void 0,\n callback = void 0,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n }\n\n function invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = void 0,\n error = void 0,\n succeeded = true;\n\n if (hasCallback) {\n try {\n value = callback(detail);\n } catch (e) {\n succeeded = false;\n error = e;\n }\n\n if (promise === value) {\n reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (succeeded === false) {\n reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n reject(promise, value);\n }\n }\n\n function initializePromise(promise, resolver) {\n try {\n resolver(\n function resolvePromise(value) {\n resolve(promise, value);\n },\n function rejectPromise(reason) {\n reject(promise, reason);\n }\n );\n } catch (e) {\n reject(promise, e);\n }\n }\n\n var id = 0;\n function nextId() {\n return (id += 1);\n }\n\n function makePromise(promise) {\n promise[PROMISE_ID] = id += 1;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n }\n\n function validationError() {\n return new Error(\"Array Methods must be provided an Array\");\n }\n\n var Enumerator = (function() {\n function Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate(input);\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n reject(this.promise, validationError());\n }\n }\n\n Enumerator.prototype._enumerate = function _enumerate(input) {\n for (var i = 0; this._state === PENDING && i < input.length; i++) {\n this._eachEntry(input[i], i);\n }\n };\n\n Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {\n var c = this._instanceConstructor;\n var resolve$$1 = c.resolve;\n\n if (resolve$$1 === resolve$1) {\n var _then = void 0;\n var error = void 0;\n var didError = false;\n try {\n _then = entry.then;\n } catch (e) {\n didError = true;\n error = e;\n }\n\n if (_then === then && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== \"function\") {\n this._remaining -= 1;\n this._result[i] = entry;\n } else if (c === Promise$2) {\n var promise = new c(noop);\n if (didError) {\n reject(promise, error);\n } else {\n handleMaybeThenable(promise, entry, _then);\n }\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(\n new c(function(resolve$$1) {\n return resolve$$1(entry);\n }),\n i\n );\n }\n } else {\n this._willSettleAt(resolve$$1(entry), i);\n }\n };\n\n Enumerator.prototype._settledAt = function _settledAt(state, i, value) {\n var promise = this.promise;\n\n if (promise._state === PENDING) {\n this._remaining -= 1;\n\n if (state === REJECTED) {\n reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n };\n\n Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {\n var enumerator = this;\n\n subscribe(\n promise,\n undefined,\n function(value) {\n return enumerator._settledAt(FULFILLED, i, value);\n },\n function(reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n }\n );\n };\n\n return Enumerator;\n })();\n\n /**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\n function all(entries) {\n return new Enumerator(this, entries).promise;\n }\n\n /**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\n function race(entries) {\n /* jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function(_, reject) {\n return reject(new TypeError(\"You must pass an array to race.\"));\n });\n } else {\n return new Constructor(function(resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n }\n\n /**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\n function reject$1(reason) {\n /* jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n reject(promise, reason);\n return promise;\n }\n\n function needsResolver() {\n throw new TypeError(\n \"You must pass a resolver function as the first argument to the promise constructor\"\n );\n }\n\n function needsNew() {\n throw new TypeError(\n \"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\"\n );\n }\n\n /**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {Function} resolver\n Useful for tooling.\n @constructor\n*/\n\n var Promise$2 = (function() {\n function Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== \"function\" && needsResolver();\n this instanceof Promise\n ? initializePromise(this, resolver)\n : needsNew();\n }\n }\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n let result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n let author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n\n Promise.prototype.catch = function _catch(onRejection) {\n return this.then(null, onRejection);\n };\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n\n Synchronous example:\n\n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n\n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n\n Asynchronous example:\n\n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n\n @method finally\n @param {Function} callback\n @return {Promise}\n */\n\n Promise.prototype.finally = function _finally(callback) {\n var promise = this;\n var constructor = promise.constructor;\n\n if (isFunction(callback)) {\n return promise.then(\n function(value) {\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n return constructor.resolve(callback()).then(function() {\n throw reason;\n });\n }\n );\n }\n\n return promise.then(callback, callback);\n };\n\n return Promise;\n })();\n\n Promise$2.prototype.then = then;\n Promise$2.all = all;\n Promise$2.race = race;\n Promise$2.resolve = resolve$1;\n Promise$2.reject = reject$1;\n Promise$2._setScheduler = setScheduler;\n Promise$2._setAsap = setAsap;\n Promise$2._asap = asap;\n\n function polyfill() {\n var local = void 0;\n\n if (typeof global !== \"undefined\") {\n local = global;\n } else if (typeof self !== \"undefined\") {\n local = self;\n } else {\n try {\n local = Function(\"return this\")();\n } catch (e) {\n throw new Error(\n \"polyfill failed because global object is unavailable in this environment\"\n );\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === \"[object Promise]\" && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise$2;\n }\n\n // Strange compat..\n Promise$2.polyfill = polyfill;\n Promise$2.Promise = Promise$2;\n\n Promise$2.polyfill();\n\n return Promise$2;\n});\n"} {"text": "/* \n 3w-xxxx.c -- 3ware Storage Controller device driver for Linux.\n\n Written By: Adam Radford \n Modifications By: Joel Jacobson \n \t\t Arnaldo Carvalho de Melo \n Brad Strand \n\n Copyright (C) 1999-2009 3ware Inc.\n\n Kernel compatibility By: \tAndre Hedrick \n Non-Copyright (C) 2000\tAndre Hedrick \n \n Further tiny build fixes and trivial hoovering Alan Cox\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 NO WARRANTY \n THE PROGRAM IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTIES OR \n CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT \n LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, \n MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is \n solely responsible for determining the appropriateness of using and \n distributing the Program and assumes all risks associated with its \n exercise of rights under this Agreement, including but not limited to \n the risks and costs of program errors, damage to or loss of data, \n programs or equipment, and unavailability or interruption of operations. \n\n DISCLAIMER OF LIABILITY \n NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY \n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL \n DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND \n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR \n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE \n USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED \n HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES \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 Bugs/Comments/Suggestions should be mailed to: \n linuxraid@amcc.com\n\n For more information, goto:\n http://www.amcc.com\n\n History\n -------\n 0.1.000 - Initial release.\n 0.4.000 - Added support for Asynchronous Event Notification through\n ioctls for 3DM.\n 1.0.000 - Added DPO & FUA bit support for WRITE_10 & WRITE_6 cdb\n to disable drive write-cache before writes.\n 1.1.000 - Fixed performance bug with DPO & FUA not existing for WRITE_6.\n 1.2.000 - Added support for clean shutdown notification/feature table.\n 1.02.00.001 - Added support for full command packet posts through ioctls\n for 3DM.\n Bug fix so hot spare drives don't show up.\n 1.02.00.002 - Fix bug with tw_setfeature() call that caused oops on some\n systems.\n 08/21/00 - release previously allocated resources on failure at\n tw_allocate_memory (acme)\n 1.02.00.003 - Fix tw_interrupt() to report error to scsi layer when\n controller status is non-zero.\n Added handling of request_sense opcode.\n Fix possible null pointer dereference in \n tw_reset_device_extension()\n 1.02.00.004 - Add support for device id of 3ware 7000 series controllers.\n Make tw_setfeature() call with interrupts disabled.\n Register interrupt handler before enabling interrupts.\n Clear attention interrupt before draining aen queue.\n 1.02.00.005 - Allocate bounce buffers and custom queue depth for raid5 for\n 6000 and 5000 series controllers.\n Reduce polling mdelays causing problems on some systems.\n Fix use_sg = 1 calculation bug.\n Check for scsi_register returning NULL.\n Add aen count to /proc/scsi/3w-xxxx.\n Remove aen code unit masking in tw_aen_complete().\n 1.02.00.006 - Remove unit from printk in tw_scsi_eh_abort(), causing\n possible oops.\n Fix possible null pointer dereference in tw_scsi_queue()\n if done function pointer was invalid.\n 1.02.00.007 - Fix possible null pointer dereferences in tw_ioctl().\n Remove check for invalid done function pointer from\n tw_scsi_queue().\n 1.02.00.008 - Set max sectors per io to TW_MAX_SECTORS in tw_findcards().\n Add tw_decode_error() for printing readable error messages.\n Print some useful information on certain aen codes.\n Add tw_decode_bits() for interpreting status register output.\n Make scsi_set_pci_device() for kernels >= 2.4.4\n Fix bug where aen's could be lost before a reset.\n Re-add spinlocks in tw_scsi_detect().\n Fix possible null pointer dereference in tw_aen_drain_queue()\n during initialization.\n Clear pci parity errors during initialization and during io.\n 1.02.00.009 - Remove redundant increment in tw_state_request_start().\n Add ioctl support for direct ATA command passthru.\n Add entire aen code string list.\n 1.02.00.010 - Cleanup queueing code, fix jbod thoughput.\n Fix get_param for specific units.\n 1.02.00.011 - Fix bug in tw_aen_complete() where aen's could be lost.\n Fix tw_aen_drain_queue() to display useful info at init.\n Set tw_host->max_id for 12 port cards.\n Add ioctl support for raw command packet post from userspace\n with sglist fragments (parameter and io).\n 1.02.00.012 - Fix read capacity to under report by 1 sector to fix get\n last sector ioctl.\n 1.02.00.013 - Fix bug where more AEN codes weren't coming out during\n driver initialization.\n Improved handling of PCI aborts.\n 1.02.00.014 - Fix bug in tw_findcards() where AEN code could be lost.\n Increase timeout in tw_aen_drain_queue() to 30 seconds.\n 1.02.00.015 - Re-write raw command post with data ioctl method.\n Remove raid5 bounce buffers for raid5 for 6XXX for kernel 2.5\n Add tw_map/unmap_scsi_sg/single_data() for kernel 2.5\n Replace io_request_lock with host_lock for kernel 2.5\n Set max_cmd_len to 16 for 3dm for kernel 2.5\n 1.02.00.016 - Set host->max_sectors back up to 256.\n 1.02.00.017 - Modified pci parity error handling/clearing from config space\n during initialization.\n 1.02.00.018 - Better handling of request sense opcode and sense information\n for failed commands. Add tw_decode_sense().\n Replace all mdelay()'s with scsi_sleep().\n 1.02.00.019 - Revert mdelay's and scsi_sleep's, this caused problems on\n some SMP systems.\n 1.02.00.020 - Add pci_set_dma_mask(), rewrite kmalloc()/virt_to_bus() to\n pci_alloc/free_consistent().\n Better alignment checking in tw_allocate_memory().\n Cleanup tw_initialize_device_extension().\n 1.02.00.021 - Bump cmd_per_lun in SHT to 255 for better jbod performance.\n Improve handling of errors in tw_interrupt().\n Add handling/clearing of controller queue error.\n Empty stale responses before draining aen queue.\n Fix tw_scsi_eh_abort() to not reset on every io abort.\n Set can_queue in SHT to 255 to prevent hang from AEN.\n 1.02.00.022 - Fix possible null pointer dereference in tw_scsi_release().\n 1.02.00.023 - Fix bug in tw_aen_drain_queue() where unit # was always zero.\n 1.02.00.024 - Add severity levels to AEN strings.\n 1.02.00.025 - Fix command interrupt spurious error messages.\n Fix bug in raw command post with data ioctl method.\n Fix bug where rollcall sometimes failed with cable errors.\n Print unit # on all command timeouts.\n 1.02.00.026 - Fix possible infinite retry bug with power glitch induced\n drive timeouts.\n Cleanup some AEN severity levels.\n 1.02.00.027 - Add drive not supported AEN code for SATA controllers.\n Remove spurious unknown ioctl error message.\n 1.02.00.028 - Fix bug where multiple controllers with no units were the\n same card number.\n Fix bug where cards were being shut down more than once.\n 1.02.00.029 - Add missing pci_free_consistent() in tw_allocate_memory().\n Replace pci_map_single() with pci_map_page() for highmem.\n Check for tw_setfeature() failure.\n 1.02.00.030 - Make driver 64-bit clean.\n 1.02.00.031 - Cleanup polling timeouts/routines in several places.\n Add support for mode sense opcode.\n Add support for cache mode page.\n Add support for synchronize cache opcode.\n 1.02.00.032 - Fix small multicard rollcall bug.\n Make driver stay loaded with no units for hot add/swap.\n Add support for \"twe\" character device for ioctls.\n Clean up request_id queueing code.\n Fix tw_scsi_queue() spinlocks.\n 1.02.00.033 - Fix tw_aen_complete() to not queue 'queue empty' AEN's.\n Initialize queues correctly when loading with no valid units.\n 1.02.00.034 - Fix tw_decode_bits() to handle multiple errors.\n Add support for user configurable cmd_per_lun.\n Add support for sht->slave_configure().\n 1.02.00.035 - Improve tw_allocate_memory() memory allocation.\n Fix tw_chrdev_ioctl() to sleep correctly.\n 1.02.00.036 - Increase character ioctl timeout to 60 seconds.\n 1.02.00.037 - Fix tw_ioctl() to handle all non-data ATA passthru cmds\n for 'smartmontools' support.\n 1.26.00.038 - Roll driver minor version to 26 to denote kernel 2.6.\n Add support for cmds_per_lun module parameter.\n 1.26.00.039 - Fix bug in tw_chrdev_ioctl() polling code.\n Fix data_buffer_length usage in tw_chrdev_ioctl().\n Update contact information.\n 1.26.02.000 - Convert driver to pci_driver format.\n 1.26.02.001 - Increase max ioctl buffer size to 512 sectors.\n Make tw_scsi_queue() return 0 for 'Unknown scsi opcode'.\n Fix tw_remove() to free irq handler/unregister_chrdev()\n before shutting down card.\n Change to new 'change_queue_depth' api.\n Fix 'handled=1' ISR usage, remove bogus IRQ check.\n 1.26.02.002 - Free irq handler in __tw_shutdown().\n Turn on RCD bit for caching mode page.\n Serialize reset code.\n*/\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 \"3w-xxxx.h\"\n\n/* Globals */\n#define TW_DRIVER_VERSION \"1.26.02.002\"\nstatic TW_Device_Extension *tw_device_extension_list[TW_MAX_SLOT];\nstatic int tw_device_extension_count = 0;\nstatic int twe_major = -1;\n\n/* Module parameters */\nMODULE_AUTHOR(\"AMCC\");\nMODULE_DESCRIPTION(\"3ware Storage Controller Linux Driver\");\nMODULE_LICENSE(\"GPL\");\nMODULE_VERSION(TW_DRIVER_VERSION);\n\n/* Function prototypes */\nstatic int tw_reset_device_extension(TW_Device_Extension *tw_dev);\n\n/* Functions */\n\n/* This function will check the status register for unexpected bits */\nstatic int tw_check_bits(u32 status_reg_value)\n{\n\tif ((status_reg_value & TW_STATUS_EXPECTED_BITS) != TW_STATUS_EXPECTED_BITS) { \n\t\tdprintk(KERN_WARNING \"3w-xxxx: tw_check_bits(): No expected bits (0x%x).\\n\", status_reg_value);\n\t\treturn 1;\n\t}\n\tif ((status_reg_value & TW_STATUS_UNEXPECTED_BITS) != 0) {\n\t\tdprintk(KERN_WARNING \"3w-xxxx: tw_check_bits(): Found unexpected bits (0x%x).\\n\", status_reg_value);\n\t\treturn 1;\n\t}\n\n\treturn 0;\n} /* End tw_check_bits() */\n\n/* This function will print readable messages from status register errors */\nstatic int tw_decode_bits(TW_Device_Extension *tw_dev, u32 status_reg_value, int print_host)\n{\n\tchar host[16];\n\n\tdprintk(KERN_WARNING \"3w-xxxx: tw_decode_bits()\\n\");\n\n\tif (print_host)\n\t\tsprintf(host, \" scsi%d:\", tw_dev->host->host_no);\n\telse\n\t\thost[0] = '\\0';\n\n\tif (status_reg_value & TW_STATUS_PCI_PARITY_ERROR) {\n\t\tprintk(KERN_WARNING \"3w-xxxx:%s PCI Parity Error: clearing.\\n\", host);\n\t\toutl(TW_CONTROL_CLEAR_PARITY_ERROR, TW_CONTROL_REG_ADDR(tw_dev));\n\t}\n\n\tif (status_reg_value & TW_STATUS_PCI_ABORT) {\n\t\tprintk(KERN_WARNING \"3w-xxxx:%s PCI Abort: clearing.\\n\", host);\n\t\toutl(TW_CONTROL_CLEAR_PCI_ABORT, TW_CONTROL_REG_ADDR(tw_dev));\n\t\tpci_write_config_word(tw_dev->tw_pci_dev, PCI_STATUS, TW_PCI_CLEAR_PCI_ABORT);\n\t}\n\n\tif (status_reg_value & TW_STATUS_QUEUE_ERROR) {\n\t\tprintk(KERN_WARNING \"3w-xxxx:%s Controller Queue Error: clearing.\\n\", host);\n\t\toutl(TW_CONTROL_CLEAR_QUEUE_ERROR, TW_CONTROL_REG_ADDR(tw_dev));\n\t}\n\n\tif (status_reg_value & TW_STATUS_SBUF_WRITE_ERROR) {\n\t\tprintk(KERN_WARNING \"3w-xxxx:%s SBUF Write Error: clearing.\\n\", host);\n\t\toutl(TW_CONTROL_CLEAR_SBUF_WRITE_ERROR, TW_CONTROL_REG_ADDR(tw_dev));\n\t}\n\n\tif (status_reg_value & TW_STATUS_MICROCONTROLLER_ERROR) {\n\t\tif (tw_dev->reset_print == 0) {\n\t\t\tprintk(KERN_WARNING \"3w-xxxx:%s Microcontroller Error: clearing.\\n\", host);\n\t\t\ttw_dev->reset_print = 1;\n\t\t}\n\t\treturn 1;\n\t}\n\t\n\treturn 0;\n} /* End tw_decode_bits() */\n\n/* This function will poll the status register for a flag */\nstatic int tw_poll_status(TW_Device_Extension *tw_dev, u32 flag, int seconds)\n{\n\tu32 status_reg_value;\n\tunsigned long before;\n\tint retval = 1;\n\n\tstatus_reg_value = inl(TW_STATUS_REG_ADDR(tw_dev));\n\tbefore = jiffies;\n\n\tif (tw_check_bits(status_reg_value))\n\t\ttw_decode_bits(tw_dev, status_reg_value, 0);\n\n\twhile ((status_reg_value & flag) != flag) {\n\t\tstatus_reg_value = inl(TW_STATUS_REG_ADDR(tw_dev));\n\n\t\tif (tw_check_bits(status_reg_value))\n\t\t\ttw_decode_bits(tw_dev, status_reg_value, 0);\n\n\t\tif (time_after(jiffies, before + HZ * seconds))\n\t\t\tgoto out;\n\n\t\tmsleep(50);\n\t}\n\tretval = 0;\nout:\n\treturn retval;\n} /* End tw_poll_status() */\n\n/* This function will poll the status register for disappearance of a flag */\nstatic int tw_poll_status_gone(TW_Device_Extension *tw_dev, u32 flag, int seconds)\n{\n\tu32 status_reg_value;\n\tunsigned long before;\n\tint retval = 1;\n\n\tstatus_reg_value = inl(TW_STATUS_REG_ADDR(tw_dev));\n\tbefore = jiffies;\n\n\tif (tw_check_bits(status_reg_value))\n\t\ttw_decode_bits(tw_dev, status_reg_value, 0);\n\n\twhile ((status_reg_value & flag) != 0) {\n\t\tstatus_reg_value = inl(TW_STATUS_REG_ADDR(tw_dev));\n\n\t\tif (tw_check_bits(status_reg_value))\n\t\t\ttw_decode_bits(tw_dev, status_reg_value, 0);\n\n\t\tif (time_after(jiffies, before + HZ * seconds))\n\t\t\tgoto out;\n\n\t\tmsleep(50);\n\t}\n\tretval = 0;\nout:\n\treturn retval;\n} /* End tw_poll_status_gone() */\n\n/* This function will attempt to post a command packet to the board */\nstatic int tw_post_command_packet(TW_Device_Extension *tw_dev, int request_id)\n{\n\tu32 status_reg_value;\n\tunsigned long command_que_value;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_post_command_packet()\\n\");\n\tcommand_que_value = tw_dev->command_packet_physical_address[request_id];\n\tstatus_reg_value = inl(TW_STATUS_REG_ADDR(tw_dev));\n\n\tif (tw_check_bits(status_reg_value)) {\n\t\tdprintk(KERN_WARNING \"3w-xxxx: tw_post_command_packet(): Unexpected bits.\\n\");\n\t\ttw_decode_bits(tw_dev, status_reg_value, 1);\n\t}\n\n\tif ((status_reg_value & TW_STATUS_COMMAND_QUEUE_FULL) == 0) {\n\t\t/* We successfully posted the command packet */\n\t\toutl(command_que_value, TW_COMMAND_QUEUE_REG_ADDR(tw_dev));\n\t\ttw_dev->state[request_id] = TW_S_POSTED;\n\t\ttw_dev->posted_request_count++;\n\t\tif (tw_dev->posted_request_count > tw_dev->max_posted_request_count) {\n\t\t\ttw_dev->max_posted_request_count = tw_dev->posted_request_count;\n\t\t}\n\t} else {\n\t\t/* Couldn't post the command packet, so we do it in the isr */\n\t\tif (tw_dev->state[request_id] != TW_S_PENDING) {\n\t\t\ttw_dev->state[request_id] = TW_S_PENDING;\n\t\t\ttw_dev->pending_request_count++;\n\t\t\tif (tw_dev->pending_request_count > tw_dev->max_pending_request_count) {\n\t\t\t\ttw_dev->max_pending_request_count = tw_dev->pending_request_count;\n\t\t\t}\n\t\t\ttw_dev->pending_queue[tw_dev->pending_tail] = request_id;\n\t\t\tif (tw_dev->pending_tail == TW_Q_LENGTH-1) {\n\t\t\t\ttw_dev->pending_tail = TW_Q_START;\n\t\t\t} else {\n\t\t\t\ttw_dev->pending_tail = tw_dev->pending_tail + 1;\n\t\t\t}\n\t\t} \n\t\tTW_UNMASK_COMMAND_INTERRUPT(tw_dev);\n\t\treturn 1;\n\t}\n\treturn 0;\n} /* End tw_post_command_packet() */\n\n/* This function will return valid sense buffer information for failed cmds */\nstatic int tw_decode_sense(TW_Device_Extension *tw_dev, int request_id, int fill_sense)\n{\n\tint i;\n\tTW_Command *command;\n\n dprintk(KERN_WARNING \"3w-xxxx: tw_decode_sense()\\n\");\n\tcommand = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];\n\n\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Command failed: status = 0x%x, flags = 0x%x, unit #%d.\\n\", tw_dev->host->host_no, command->status, command->flags, TW_UNIT_OUT(command->unit__hostid));\n\n\t/* Attempt to return intelligent sense information */\n\tif (fill_sense) {\n\t\tif ((command->status == 0xc7) || (command->status == 0xcb)) {\n\t\t\tfor (i = 0; i < ARRAY_SIZE(tw_sense_table); i++) {\n\t\t\t\tif (command->flags == tw_sense_table[i][0]) {\n\n\t\t\t\t\t/* Valid bit and 'current errors' */\n\t\t\t\t\ttw_dev->srb[request_id]->sense_buffer[0] = (0x1 << 7 | 0x70);\n\n\t\t\t\t\t/* Sense key */\n\t\t\t\t\ttw_dev->srb[request_id]->sense_buffer[2] = tw_sense_table[i][1];\n\n\t\t\t\t\t/* Additional sense length */\n\t\t\t\t\ttw_dev->srb[request_id]->sense_buffer[7] = 0xa; /* 10 bytes */\n\n\t\t\t\t\t/* Additional sense code */\n\t\t\t\t\ttw_dev->srb[request_id]->sense_buffer[12] = tw_sense_table[i][2];\n\n\t\t\t\t\t/* Additional sense code qualifier */\n\t\t\t\t\ttw_dev->srb[request_id]->sense_buffer[13] = tw_sense_table[i][3];\n\n\t\t\t\t\ttw_dev->srb[request_id]->result = (DID_OK << 16) | (CHECK_CONDITION << 1);\n\t\t\t\t\treturn TW_ISR_DONT_RESULT; /* Special case for isr to not over-write result */\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* If no table match, error so we get a reset */\n\t\treturn 1;\n\t}\n\n\treturn 0;\n} /* End tw_decode_sense() */\n\n/* This function will report controller error status */\nstatic int tw_check_errors(TW_Device_Extension *tw_dev) \n{\n\tu32 status_reg_value;\n \n\tstatus_reg_value = inl(TW_STATUS_REG_ADDR(tw_dev));\n\n\tif (TW_STATUS_ERRORS(status_reg_value) || tw_check_bits(status_reg_value)) {\n\t\ttw_decode_bits(tw_dev, status_reg_value, 0);\n\t\treturn 1;\n\t}\n\n\treturn 0;\n} /* End tw_check_errors() */\n\n/* This function will empty the response que */\nstatic void tw_empty_response_que(TW_Device_Extension *tw_dev) \n{\n\tu32 status_reg_value, response_que_value;\n\n\tstatus_reg_value = inl(TW_STATUS_REG_ADDR(tw_dev));\n\n\twhile ((status_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) {\n\t\tresponse_que_value = inl(TW_RESPONSE_QUEUE_REG_ADDR(tw_dev));\n\t\tstatus_reg_value = inl(TW_STATUS_REG_ADDR(tw_dev));\n\t}\n} /* End tw_empty_response_que() */\n\n/* This function will free a request_id */\nstatic void tw_state_request_finish(TW_Device_Extension *tw_dev, int request_id)\n{\n\ttw_dev->free_queue[tw_dev->free_tail] = request_id;\n\ttw_dev->state[request_id] = TW_S_FINISHED;\n\ttw_dev->free_tail = (tw_dev->free_tail + 1) % TW_Q_LENGTH;\n} /* End tw_state_request_finish() */\n\n/* This function will assign an available request_id */\nstatic void tw_state_request_start(TW_Device_Extension *tw_dev, int *request_id)\n{\n\t*request_id = tw_dev->free_queue[tw_dev->free_head];\n\ttw_dev->free_head = (tw_dev->free_head + 1) % TW_Q_LENGTH;\n\ttw_dev->state[*request_id] = TW_S_STARTED;\n} /* End tw_state_request_start() */\n\n/* Show some statistics about the card */\nstatic ssize_t tw_show_stats(struct device *dev, struct device_attribute *attr,\n\t\t\t char *buf)\n{\n\tstruct Scsi_Host *host = class_to_shost(dev);\n\tTW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata;\n\tunsigned long flags = 0;\n\tssize_t len;\n\n\tspin_lock_irqsave(tw_dev->host->host_lock, flags);\n\tlen = snprintf(buf, PAGE_SIZE, \"3w-xxxx Driver version: %s\\n\"\n\t\t \"Current commands posted: %4d\\n\"\n\t\t \"Max commands posted: %4d\\n\"\n\t\t \"Current pending commands: %4d\\n\"\n\t\t \"Max pending commands: %4d\\n\"\n\t\t \"Last sgl length: %4d\\n\"\n\t\t \"Max sgl length: %4d\\n\"\n\t\t \"Last sector count: %4d\\n\"\n\t\t \"Max sector count: %4d\\n\"\n\t\t \"SCSI Host Resets: %4d\\n\"\n\t\t \"AEN's: %4d\\n\", \n\t\t TW_DRIVER_VERSION,\n\t\t tw_dev->posted_request_count,\n\t\t tw_dev->max_posted_request_count,\n\t\t tw_dev->pending_request_count,\n\t\t tw_dev->max_pending_request_count,\n\t\t tw_dev->sgl_entries,\n\t\t tw_dev->max_sgl_entries,\n\t\t tw_dev->sector_count,\n\t\t tw_dev->max_sector_count,\n\t\t tw_dev->num_resets,\n\t\t tw_dev->aen_count);\n\tspin_unlock_irqrestore(tw_dev->host->host_lock, flags);\n\treturn len;\n} /* End tw_show_stats() */\n\n/* This function will set a devices queue depth */\nstatic int tw_change_queue_depth(struct scsi_device *sdev, int queue_depth,\n\t\t\t\t int reason)\n{\n\tif (reason != SCSI_QDEPTH_DEFAULT)\n\t\treturn -EOPNOTSUPP;\n\n\tif (queue_depth > TW_Q_LENGTH-2)\n\t\tqueue_depth = TW_Q_LENGTH-2;\n\tscsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, queue_depth);\n\treturn queue_depth;\n} /* End tw_change_queue_depth() */\n\n/* Create sysfs 'stats' entry */\nstatic struct device_attribute tw_host_stats_attr = {\n\t.attr = {\n\t\t.name = \t\"stats\",\n\t\t.mode =\t\tS_IRUGO,\n\t},\n\t.show = tw_show_stats\n};\n\n/* Host attributes initializer */\nstatic struct device_attribute *tw_host_attrs[] = {\n\t&tw_host_stats_attr,\n\tNULL,\n};\n\n/* This function will read the aen queue from the isr */\nstatic int tw_aen_read_queue(TW_Device_Extension *tw_dev, int request_id) \n{\n\tTW_Command *command_packet;\n\tTW_Param *param;\n\tunsigned long command_que_value;\n\tu32 status_reg_value;\n\tunsigned long param_value = 0;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_aen_read_queue()\\n\");\n\n\tstatus_reg_value = inl(TW_STATUS_REG_ADDR(tw_dev));\n\tif (tw_check_bits(status_reg_value)) {\n\t\tdprintk(KERN_WARNING \"3w-xxxx: tw_aen_read_queue(): Unexpected bits.\\n\");\n\t\ttw_decode_bits(tw_dev, status_reg_value, 1);\n\t\treturn 1;\n\t}\n\tif (tw_dev->command_packet_virtual_address[request_id] == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_aen_read_queue(): Bad command packet virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tcommand_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];\n\tmemset(command_packet, 0, sizeof(TW_Sector));\n\tcommand_packet->opcode__sgloffset = TW_OPSGL_IN(2, TW_OP_GET_PARAM);\n\tcommand_packet->size = 4;\n\tcommand_packet->request_id = request_id;\n\tcommand_packet->status = 0;\n\tcommand_packet->flags = 0;\n\tcommand_packet->byte6.parameter_count = 1;\n\tcommand_que_value = tw_dev->command_packet_physical_address[request_id];\n\tif (command_que_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_aen_read_queue(): Bad command packet physical address.\\n\");\n\t\treturn 1;\n\t}\n\t/* Now setup the param */\n\tif (tw_dev->alignment_virtual_address[request_id] == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_aen_read_queue(): Bad alignment virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tparam = (TW_Param *)tw_dev->alignment_virtual_address[request_id];\n\tmemset(param, 0, sizeof(TW_Sector));\n\tparam->table_id = 0x401; /* AEN table */\n\tparam->parameter_id = 2; /* Unit code */\n\tparam->parameter_size_bytes = 2;\n\tparam_value = tw_dev->alignment_physical_address[request_id];\n\tif (param_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_aen_read_queue(): Bad alignment physical address.\\n\");\n\t\treturn 1;\n\t}\n\tcommand_packet->byte8.param.sgl[0].address = param_value;\n\tcommand_packet->byte8.param.sgl[0].length = sizeof(TW_Sector);\n\n\t/* Now post the command packet */\n\tif ((status_reg_value & TW_STATUS_COMMAND_QUEUE_FULL) == 0) {\n\t\tdprintk(KERN_WARNING \"3w-xxxx: tw_aen_read_queue(): Post succeeded.\\n\");\n\t\ttw_dev->srb[request_id] = NULL; /* Flag internal command */\n\t\ttw_dev->state[request_id] = TW_S_POSTED;\n\t\toutl(command_que_value, TW_COMMAND_QUEUE_REG_ADDR(tw_dev));\n\t} else {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_aen_read_queue(): Post failed, will retry.\\n\");\n\t\treturn 1;\n\t}\n\n\treturn 0;\n} /* End tw_aen_read_queue() */\n\n/* This function will complete an aen request from the isr */\nstatic int tw_aen_complete(TW_Device_Extension *tw_dev, int request_id) \n{\n\tTW_Param *param;\n\tunsigned short aen;\n\tint error = 0, table_max = 0;\n\n\tdprintk(KERN_WARNING \"3w-xxxx: tw_aen_complete()\\n\");\n\tif (tw_dev->alignment_virtual_address[request_id] == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_aen_complete(): Bad alignment virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tparam = (TW_Param *)tw_dev->alignment_virtual_address[request_id];\n\taen = *(unsigned short *)(param->data);\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_aen_complete(): Queue'd code 0x%x\\n\", aen);\n\n\t/* Print some useful info when certain aen codes come out */\n\tif (aen == 0x0ff) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: AEN: INFO: AEN queue overflow.\\n\", tw_dev->host->host_no);\n\t} else {\n\t\ttable_max = ARRAY_SIZE(tw_aen_string);\n\t\tif ((aen & 0x0ff) < table_max) {\n\t\t\tif ((tw_aen_string[aen & 0xff][strlen(tw_aen_string[aen & 0xff])-1]) == '#') {\n\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: AEN: %s%d.\\n\", tw_dev->host->host_no, tw_aen_string[aen & 0xff], aen >> 8);\n\t\t\t} else {\n\t\t\t\tif (aen != 0x0) \n\t\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: AEN: %s.\\n\", tw_dev->host->host_no, tw_aen_string[aen & 0xff]);\n\t\t\t}\n\t\t} else {\n\t\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Received AEN %d.\\n\", tw_dev->host->host_no, aen);\n\t\t}\n\t}\n\tif (aen != TW_AEN_QUEUE_EMPTY) {\n\t\ttw_dev->aen_count++;\n\n\t\t/* Now queue the code */\n\t\ttw_dev->aen_queue[tw_dev->aen_tail] = aen;\n\t\tif (tw_dev->aen_tail == TW_Q_LENGTH - 1) {\n\t\t\ttw_dev->aen_tail = TW_Q_START;\n\t\t} else {\n\t\t\ttw_dev->aen_tail = tw_dev->aen_tail + 1;\n\t\t}\n\t\tif (tw_dev->aen_head == tw_dev->aen_tail) {\n\t\t\tif (tw_dev->aen_head == TW_Q_LENGTH - 1) {\n\t\t\t\ttw_dev->aen_head = TW_Q_START;\n\t\t\t} else {\n\t\t\t\ttw_dev->aen_head = tw_dev->aen_head + 1;\n\t\t\t}\n\t\t}\n\n\t\terror = tw_aen_read_queue(tw_dev, request_id);\n\t\tif (error) {\n\t\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Error completing AEN.\\n\", tw_dev->host->host_no);\n\t\t\ttw_dev->state[request_id] = TW_S_COMPLETED;\n\t\t\ttw_state_request_finish(tw_dev, request_id);\n\t\t}\n\t} else {\n\t\ttw_dev->state[request_id] = TW_S_COMPLETED;\n\t\ttw_state_request_finish(tw_dev, request_id);\n\t}\n\n\treturn 0;\n} /* End tw_aen_complete() */\n\n/* This function will drain the aen queue after a soft reset */\nstatic int tw_aen_drain_queue(TW_Device_Extension *tw_dev)\n{\n\tTW_Command *command_packet;\n\tTW_Param *param;\n\tint request_id = 0;\n\tunsigned long command_que_value;\n\tunsigned long param_value;\n\tTW_Response_Queue response_queue;\n\tunsigned short aen;\n\tunsigned short aen_code;\n\tint finished = 0;\n\tint first_reset = 0;\n\tint queue = 0;\n\tint found = 0, table_max = 0;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_aen_drain_queue()\\n\");\n\n\tif (tw_poll_status(tw_dev, TW_STATUS_ATTENTION_INTERRUPT | TW_STATUS_MICROCONTROLLER_READY, 30)) {\n\t\tdprintk(KERN_WARNING \"3w-xxxx: tw_aen_drain_queue(): No attention interrupt for card %d.\\n\", tw_device_extension_count);\n\t\treturn 1;\n\t}\n\tTW_CLEAR_ATTENTION_INTERRUPT(tw_dev);\n\n\t/* Empty response queue */\n\ttw_empty_response_que(tw_dev);\n\n\t/* Initialize command packet */\n\tif (tw_dev->command_packet_virtual_address[request_id] == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_aen_drain_queue(): Bad command packet virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tcommand_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];\n\tmemset(command_packet, 0, sizeof(TW_Sector));\n\tcommand_packet->opcode__sgloffset = TW_OPSGL_IN(2, TW_OP_GET_PARAM);\n\tcommand_packet->size = 4;\n\tcommand_packet->request_id = request_id;\n\tcommand_packet->status = 0;\n\tcommand_packet->flags = 0;\n\tcommand_packet->byte6.parameter_count = 1;\n\tcommand_que_value = tw_dev->command_packet_physical_address[request_id];\n\tif (command_que_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_aen_drain_queue(): Bad command packet physical address.\\n\");\n\t\treturn 1;\n\t}\n\n\t/* Now setup the param */\n\tif (tw_dev->alignment_virtual_address[request_id] == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_aen_drain_queue(): Bad alignment virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tparam = (TW_Param *)tw_dev->alignment_virtual_address[request_id];\n\tmemset(param, 0, sizeof(TW_Sector));\n\tparam->table_id = 0x401; /* AEN table */\n\tparam->parameter_id = 2; /* Unit code */\n\tparam->parameter_size_bytes = 2;\n\tparam_value = tw_dev->alignment_physical_address[request_id];\n\tif (param_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_aen_drain_queue(): Bad alignment physical address.\\n\");\n\t\treturn 1;\n\t}\n\tcommand_packet->byte8.param.sgl[0].address = param_value;\n\tcommand_packet->byte8.param.sgl[0].length = sizeof(TW_Sector);\n\n\t/* Now drain the controller's aen queue */\n\tdo {\n\t\t/* Post command packet */\n\t\toutl(command_que_value, TW_COMMAND_QUEUE_REG_ADDR(tw_dev));\n\n\t\t/* Now poll for completion */\n\t\tif (tw_poll_status_gone(tw_dev, TW_STATUS_RESPONSE_QUEUE_EMPTY, 30) == 0) {\n\t\t\tresponse_queue.value = inl(TW_RESPONSE_QUEUE_REG_ADDR(tw_dev));\n\t\t\trequest_id = TW_RESID_OUT(response_queue.response_id);\n\n\t\t\tif (request_id != 0) {\n\t\t\t\t/* Unexpected request id */\n\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: tw_aen_drain_queue(): Unexpected request id.\\n\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (command_packet->status != 0) {\n\t\t\t\tif (command_packet->flags != TW_AEN_TABLE_UNDEFINED) {\n\t\t\t\t\t/* Bad response */\n\t\t\t\t\ttw_decode_sense(tw_dev, request_id, 0);\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\t/* We know this is a 3w-1x00, and doesn't support aen's */\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Now check the aen */\n\t\t\taen = *(unsigned short *)(param->data);\n\t\t\taen_code = (aen & 0x0ff);\n\t\t\tqueue = 0;\n\t\t\tswitch (aen_code) {\n\t\t\t\tcase TW_AEN_QUEUE_EMPTY:\n\t\t\t\t\tdprintk(KERN_WARNING \"3w-xxxx: AEN: %s.\\n\", tw_aen_string[aen & 0xff]);\n\t\t\t\t\tif (first_reset != 1) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfinished = 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase TW_AEN_SOFT_RESET:\n\t\t\t\t\tif (first_reset == 0) {\n\t\t\t\t\t\tfirst_reset = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: AEN: %s.\\n\", tw_aen_string[aen & 0xff]);\n\t\t\t\t\t\ttw_dev->aen_count++;\n\t\t\t\t\t\tqueue = 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (aen == 0x0ff) {\n\t\t\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: AEN: INFO: AEN queue overflow.\\n\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttable_max = ARRAY_SIZE(tw_aen_string);\n\t\t\t\t\t\tif ((aen & 0x0ff) < table_max) {\n\t\t\t\t\t\t\tif ((tw_aen_string[aen & 0xff][strlen(tw_aen_string[aen & 0xff])-1]) == '#') {\n\t\t\t\t\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: AEN: %s%d.\\n\", tw_aen_string[aen & 0xff], aen >> 8);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: AEN: %s.\\n\", tw_aen_string[aen & 0xff]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: Received AEN %d.\\n\", aen);\n\t\t\t\t\t}\n\t\t\t\t\ttw_dev->aen_count++;\n\t\t\t\t\tqueue = 1;\n\t\t\t}\n\n\t\t\t/* Now put the aen on the aen_queue */\n\t\t\tif (queue == 1) {\n\t\t\t\ttw_dev->aen_queue[tw_dev->aen_tail] = aen;\n\t\t\t\tif (tw_dev->aen_tail == TW_Q_LENGTH - 1) {\n\t\t\t\t\ttw_dev->aen_tail = TW_Q_START;\n\t\t\t\t} else {\n\t\t\t\t\ttw_dev->aen_tail = tw_dev->aen_tail + 1;\n\t\t\t\t}\n\t\t\t\tif (tw_dev->aen_head == tw_dev->aen_tail) {\n\t\t\t\t\tif (tw_dev->aen_head == TW_Q_LENGTH - 1) {\n\t\t\t\t\t\ttw_dev->aen_head = TW_Q_START;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttw_dev->aen_head = tw_dev->aen_head + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfound = 1;\n\t\t}\n\t\tif (found == 0) {\n\t\t\tprintk(KERN_WARNING \"3w-xxxx: tw_aen_drain_queue(): Response never received.\\n\");\n\t\t\treturn 1;\n\t\t}\n\t} while (finished == 0);\n\n\treturn 0;\n} /* End tw_aen_drain_queue() */\n\n/* This function will allocate memory */\nstatic int tw_allocate_memory(TW_Device_Extension *tw_dev, int size, int which)\n{\n\tint i;\n\tdma_addr_t dma_handle;\n\tunsigned long *cpu_addr = NULL;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_allocate_memory()\\n\");\n\n\tcpu_addr = pci_alloc_consistent(tw_dev->tw_pci_dev, size*TW_Q_LENGTH, &dma_handle);\n\tif (cpu_addr == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: pci_alloc_consistent() failed.\\n\");\n\t\treturn 1;\n\t}\n\n\tif ((unsigned long)cpu_addr % (tw_dev->tw_pci_dev->device == TW_DEVICE_ID ? TW_ALIGNMENT_6000 : TW_ALIGNMENT_7000)) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: Couldn't allocate correctly aligned memory.\\n\");\n\t\tpci_free_consistent(tw_dev->tw_pci_dev, size*TW_Q_LENGTH, cpu_addr, dma_handle);\n\t\treturn 1;\n\t}\n\n\tmemset(cpu_addr, 0, size*TW_Q_LENGTH);\n\n\tfor (i=0;icommand_packet_physical_address[i] = dma_handle+(i*size);\n\t\t\ttw_dev->command_packet_virtual_address[i] = (unsigned long *)((unsigned char *)cpu_addr + (i*size));\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\ttw_dev->alignment_physical_address[i] = dma_handle+(i*size);\n\t\t\ttw_dev->alignment_virtual_address[i] = (unsigned long *)((unsigned char *)cpu_addr + (i*size));\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tprintk(KERN_WARNING \"3w-xxxx: tw_allocate_memory(): case slip in tw_allocate_memory()\\n\");\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\treturn 0;\n} /* End tw_allocate_memory() */\n\n/* This function handles ioctl for the character device */\nstatic int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)\n{\n\tint request_id;\n\tdma_addr_t dma_handle;\n\tunsigned short tw_aen_code;\n\tunsigned long flags;\n\tunsigned int data_buffer_length = 0;\n\tunsigned long data_buffer_length_adjusted = 0;\n\tunsigned long *cpu_addr;\n\tlong timeout;\n\tTW_New_Ioctl *tw_ioctl;\n\tTW_Passthru *passthru;\n\tTW_Device_Extension *tw_dev = tw_device_extension_list[iminor(inode)];\n\tint retval = -EFAULT;\n\tvoid __user *argp = (void __user *)arg;\n\n\tdprintk(KERN_WARNING \"3w-xxxx: tw_chrdev_ioctl()\\n\");\n\n\t/* Only let one of these through at a time */\n\tif (mutex_lock_interruptible(&tw_dev->ioctl_lock))\n\t\treturn -EINTR;\n\n\t/* First copy down the buffer length */\n\tif (copy_from_user(&data_buffer_length, argp, sizeof(unsigned int)))\n\t\tgoto out;\n\n\t/* Check size */\n\tif (data_buffer_length > TW_MAX_IOCTL_SECTORS * 512) {\n\t\tretval = -EINVAL;\n\t\tgoto out;\n\t}\n\n\t/* Hardware can only do multiple of 512 byte transfers */\n\tdata_buffer_length_adjusted = (data_buffer_length + 511) & ~511;\n\t\n\t/* Now allocate ioctl buf memory */\n\tcpu_addr = dma_alloc_coherent(&tw_dev->tw_pci_dev->dev, data_buffer_length_adjusted+sizeof(TW_New_Ioctl) - 1, &dma_handle, GFP_KERNEL);\n\tif (cpu_addr == NULL) {\n\t\tretval = -ENOMEM;\n\t\tgoto out;\n\t}\n\n\ttw_ioctl = (TW_New_Ioctl *)cpu_addr;\n\n\t/* Now copy down the entire ioctl */\n\tif (copy_from_user(tw_ioctl, argp, data_buffer_length + sizeof(TW_New_Ioctl) - 1))\n\t\tgoto out2;\n\n\tpassthru = (TW_Passthru *)&tw_ioctl->firmware_command;\n\n\t/* See which ioctl we are doing */\n\tswitch (cmd) {\n\t\tcase TW_OP_NOP:\n\t\t\tdprintk(KERN_WARNING \"3w-xxxx: tw_chrdev_ioctl(): caught TW_OP_NOP.\\n\");\n\t\t\tbreak;\n\t\tcase TW_OP_AEN_LISTEN:\n\t\t\tdprintk(KERN_WARNING \"3w-xxxx: tw_chrdev_ioctl(): caught TW_AEN_LISTEN.\\n\");\n\t\t\tmemset(tw_ioctl->data_buffer, 0, data_buffer_length);\n\n\t\t\tspin_lock_irqsave(tw_dev->host->host_lock, flags);\n\t\t\tif (tw_dev->aen_head == tw_dev->aen_tail) {\n\t\t\t\ttw_aen_code = TW_AEN_QUEUE_EMPTY;\n\t\t\t} else {\n\t\t\t\ttw_aen_code = tw_dev->aen_queue[tw_dev->aen_head];\n\t\t\t\tif (tw_dev->aen_head == TW_Q_LENGTH - 1) {\n\t\t\t\t\ttw_dev->aen_head = TW_Q_START;\n\t\t\t\t} else {\n\t\t\t\t\ttw_dev->aen_head = tw_dev->aen_head + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tspin_unlock_irqrestore(tw_dev->host->host_lock, flags);\n\t\t\tmemcpy(tw_ioctl->data_buffer, &tw_aen_code, sizeof(tw_aen_code));\n\t\t\tbreak;\n\t\tcase TW_CMD_PACKET_WITH_DATA:\n\t\t\tdprintk(KERN_WARNING \"3w-xxxx: tw_chrdev_ioctl(): caught TW_CMD_PACKET_WITH_DATA.\\n\");\n\t\t\tspin_lock_irqsave(tw_dev->host->host_lock, flags);\n\n\t\t\ttw_state_request_start(tw_dev, &request_id);\n\n\t\t\t/* Flag internal command */\n\t\t\ttw_dev->srb[request_id] = NULL;\n\n\t\t\t/* Flag chrdev ioctl */\n\t\t\ttw_dev->chrdev_request_id = request_id;\n\n\t\t\ttw_ioctl->firmware_command.request_id = request_id;\n\n\t\t\t/* Load the sg list */\n\t\t\tswitch (TW_SGL_OUT(tw_ioctl->firmware_command.opcode__sgloffset)) {\n\t\t\tcase 2:\n\t\t\t\ttw_ioctl->firmware_command.byte8.param.sgl[0].address = dma_handle + sizeof(TW_New_Ioctl) - 1;\n\t\t\t\ttw_ioctl->firmware_command.byte8.param.sgl[0].length = data_buffer_length_adjusted;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\ttw_ioctl->firmware_command.byte8.io.sgl[0].address = dma_handle + sizeof(TW_New_Ioctl) - 1;\n\t\t\t\ttw_ioctl->firmware_command.byte8.io.sgl[0].length = data_buffer_length_adjusted;\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tpassthru->sg_list[0].address = dma_handle + sizeof(TW_New_Ioctl) - 1;\n\t\t\t\tpassthru->sg_list[0].length = data_buffer_length_adjusted;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tmemcpy(tw_dev->command_packet_virtual_address[request_id], &(tw_ioctl->firmware_command), sizeof(TW_Command));\n\n\t\t\t/* Now post the command packet to the controller */\n\t\t\ttw_post_command_packet(tw_dev, request_id);\n\t\t\tspin_unlock_irqrestore(tw_dev->host->host_lock, flags);\n\n\t\t\ttimeout = TW_IOCTL_CHRDEV_TIMEOUT*HZ;\n\n\t\t\t/* Now wait for the command to complete */\n\t\t\ttimeout = wait_event_timeout(tw_dev->ioctl_wqueue, tw_dev->chrdev_request_id == TW_IOCTL_CHRDEV_FREE, timeout);\n\n\t\t\t/* We timed out, and didn't get an interrupt */\n\t\t\tif (tw_dev->chrdev_request_id != TW_IOCTL_CHRDEV_FREE) {\n\t\t\t\t/* Now we need to reset the board */\n\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Character ioctl (0x%x) timed out, resetting card.\\n\", tw_dev->host->host_no, cmd);\n\t\t\t\tretval = -EIO;\n\t\t\t\tif (tw_reset_device_extension(tw_dev)) {\n\t\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: tw_chrdev_ioctl(): Reset failed for card %d.\\n\", tw_dev->host->host_no);\n\t\t\t\t}\n\t\t\t\tgoto out2;\n\t\t\t}\n\n\t\t\t/* Now copy in the command packet response */\n\t\t\tmemcpy(&(tw_ioctl->firmware_command), tw_dev->command_packet_virtual_address[request_id], sizeof(TW_Command));\n\n\t\t\t/* Now complete the io */\n\t\t\tspin_lock_irqsave(tw_dev->host->host_lock, flags);\n\t\t\ttw_dev->posted_request_count--;\n\t\t\ttw_dev->state[request_id] = TW_S_COMPLETED;\n\t\t\ttw_state_request_finish(tw_dev, request_id);\n\t\t\tspin_unlock_irqrestore(tw_dev->host->host_lock, flags);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tretval = -ENOTTY;\n\t\t\tgoto out2;\n\t}\n\n\t/* Now copy the response to userspace */\n\tif (copy_to_user(argp, tw_ioctl, sizeof(TW_New_Ioctl) + data_buffer_length - 1))\n\t\tgoto out2;\n\tretval = 0;\nout2:\n\t/* Now free ioctl buf memory */\n\tdma_free_coherent(&tw_dev->tw_pci_dev->dev, data_buffer_length_adjusted+sizeof(TW_New_Ioctl) - 1, cpu_addr, dma_handle);\nout:\n\tmutex_unlock(&tw_dev->ioctl_lock);\n\treturn retval;\n} /* End tw_chrdev_ioctl() */\n\n/* This function handles open for the character device */\n/* NOTE that this function races with remove. */\nstatic int tw_chrdev_open(struct inode *inode, struct file *file)\n{\n\tunsigned int minor_number;\n\n\tcycle_kernel_lock();\n\tdprintk(KERN_WARNING \"3w-xxxx: tw_ioctl_open()\\n\");\n\n\tminor_number = iminor(inode);\n\tif (minor_number >= tw_device_extension_count)\n\t\treturn -ENODEV;\n\n\treturn 0;\n} /* End tw_chrdev_open() */\n\n/* File operations struct for character device */\nstatic const struct file_operations tw_fops = {\n\t.owner\t\t= THIS_MODULE,\n\t.ioctl\t\t= tw_chrdev_ioctl,\n\t.open\t\t= tw_chrdev_open,\n\t.release\t= NULL\n};\n\n/* This function will free up device extension resources */\nstatic void tw_free_device_extension(TW_Device_Extension *tw_dev)\n{\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_free_device_extension()\\n\");\n\n\t/* Free command packet and generic buffer memory */\n\tif (tw_dev->command_packet_virtual_address[0])\n\t\tpci_free_consistent(tw_dev->tw_pci_dev, sizeof(TW_Command)*TW_Q_LENGTH, tw_dev->command_packet_virtual_address[0], tw_dev->command_packet_physical_address[0]);\n\n\tif (tw_dev->alignment_virtual_address[0])\n\t\tpci_free_consistent(tw_dev->tw_pci_dev, sizeof(TW_Sector)*TW_Q_LENGTH, tw_dev->alignment_virtual_address[0], tw_dev->alignment_physical_address[0]);\n} /* End tw_free_device_extension() */\n\n/* This function will send an initconnection command to controller */\nstatic int tw_initconnection(TW_Device_Extension *tw_dev, int message_credits) \n{\n\tunsigned long command_que_value;\n\tTW_Command *command_packet;\n\tTW_Response_Queue response_queue;\n\tint request_id = 0;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_initconnection()\\n\");\n\n\t/* Initialize InitConnection command packet */\n\tif (tw_dev->command_packet_virtual_address[request_id] == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_initconnection(): Bad command packet virtual address.\\n\");\n\t\treturn 1;\n\t}\n\n\tcommand_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];\n\tmemset(command_packet, 0, sizeof(TW_Sector));\n\tcommand_packet->opcode__sgloffset = TW_OPSGL_IN(0, TW_OP_INIT_CONNECTION);\n\tcommand_packet->size = TW_INIT_COMMAND_PACKET_SIZE;\n\tcommand_packet->request_id = request_id;\n\tcommand_packet->status = 0x0;\n\tcommand_packet->flags = 0x0;\n\tcommand_packet->byte6.message_credits = message_credits; \n\tcommand_packet->byte8.init_connection.response_queue_pointer = 0x0;\n\tcommand_que_value = tw_dev->command_packet_physical_address[request_id];\n\n\tif (command_que_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_initconnection(): Bad command packet physical address.\\n\");\n\t\treturn 1;\n\t}\n \n\t/* Send command packet to the board */\n\toutl(command_que_value, TW_COMMAND_QUEUE_REG_ADDR(tw_dev));\n \n\t/* Poll for completion */\n\tif (tw_poll_status_gone(tw_dev, TW_STATUS_RESPONSE_QUEUE_EMPTY, 30) == 0) {\n\t\tresponse_queue.value = inl(TW_RESPONSE_QUEUE_REG_ADDR(tw_dev));\n\t\trequest_id = TW_RESID_OUT(response_queue.response_id);\n\n\t\tif (request_id != 0) {\n\t\t\t/* unexpected request id */\n\t\t\tprintk(KERN_WARNING \"3w-xxxx: tw_initconnection(): Unexpected request id.\\n\");\n\t\t\treturn 1;\n\t\t}\n\t\tif (command_packet->status != 0) {\n\t\t\t/* bad response */\n\t\t\ttw_decode_sense(tw_dev, request_id, 0);\n\t\t\treturn 1;\n\t\t}\n\t}\n\treturn 0;\n} /* End tw_initconnection() */\n\n/* Set a value in the features table */\nstatic int tw_setfeature(TW_Device_Extension *tw_dev, int parm, int param_size,\n unsigned char *val)\n{\n\tTW_Param *param;\n\tTW_Command *command_packet;\n\tTW_Response_Queue response_queue;\n\tint request_id = 0;\n\tunsigned long command_que_value;\n\tunsigned long param_value;\n\n \t/* Initialize SetParam command packet */\n\tif (tw_dev->command_packet_virtual_address[request_id] == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_setfeature(): Bad command packet virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tcommand_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];\n\tmemset(command_packet, 0, sizeof(TW_Sector));\n\tparam = (TW_Param *)tw_dev->alignment_virtual_address[request_id];\n\n\tcommand_packet->opcode__sgloffset = TW_OPSGL_IN(2, TW_OP_SET_PARAM);\n\tparam->table_id = 0x404; /* Features table */\n\tparam->parameter_id = parm;\n\tparam->parameter_size_bytes = param_size;\n\tmemcpy(param->data, val, param_size);\n\n\tparam_value = tw_dev->alignment_physical_address[request_id];\n\tif (param_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_setfeature(): Bad alignment physical address.\\n\");\n\t\ttw_dev->state[request_id] = TW_S_COMPLETED;\n\t\ttw_state_request_finish(tw_dev, request_id);\n\t\ttw_dev->srb[request_id]->result = (DID_OK << 16);\n\t\ttw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);\n\t}\n\tcommand_packet->byte8.param.sgl[0].address = param_value;\n\tcommand_packet->byte8.param.sgl[0].length = sizeof(TW_Sector);\n\n\tcommand_packet->size = 4;\n\tcommand_packet->request_id = request_id;\n\tcommand_packet->byte6.parameter_count = 1;\n\n \tcommand_que_value = tw_dev->command_packet_physical_address[request_id];\n\tif (command_que_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_setfeature(): Bad command packet physical address.\\n\");\n\treturn 1;\n\t}\n\n\t/* Send command packet to the board */\n\toutl(command_que_value, TW_COMMAND_QUEUE_REG_ADDR(tw_dev));\n\n\t/* Poll for completion */\n\tif (tw_poll_status_gone(tw_dev, TW_STATUS_RESPONSE_QUEUE_EMPTY, 30) == 0) {\n\t\tresponse_queue.value = inl(TW_RESPONSE_QUEUE_REG_ADDR(tw_dev));\n\t\trequest_id = TW_RESID_OUT(response_queue.response_id);\n\n\t\tif (request_id != 0) {\n\t\t\t/* unexpected request id */\n\t\t\tprintk(KERN_WARNING \"3w-xxxx: tw_setfeature(): Unexpected request id.\\n\");\n\t\t\treturn 1;\n\t\t}\n\t\tif (command_packet->status != 0) {\n\t\t\t/* bad response */\n\t\t\ttw_decode_sense(tw_dev, request_id, 0);\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\treturn 0;\n} /* End tw_setfeature() */\n\n/* This function will reset a controller */\nstatic int tw_reset_sequence(TW_Device_Extension *tw_dev) \n{\n\tint error = 0;\n\tint tries = 0;\n\tunsigned char c = 1;\n\n\t/* Reset the board */\n\twhile (tries < TW_MAX_RESET_TRIES) {\n\t\tTW_SOFT_RESET(tw_dev);\n\n\t\terror = tw_aen_drain_queue(tw_dev);\n\t\tif (error) {\n\t\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: AEN drain failed, retrying.\\n\", tw_dev->host->host_no);\n\t\t\ttries++;\n\t\t\tcontinue;\n\t\t}\n\n\t\t/* Check for controller errors */\n\t\tif (tw_check_errors(tw_dev)) {\n\t\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Controller errors found, retrying.\\n\", tw_dev->host->host_no);\n\t\t\ttries++;\n\t\t\tcontinue;\n\t\t}\n\n\t\t/* Now the controller is in a good state */\n\t\tbreak;\n\t}\n\n\tif (tries >= TW_MAX_RESET_TRIES) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Controller errors, card not responding, check all cabling.\\n\", tw_dev->host->host_no);\n\t\treturn 1;\n\t}\n\n\terror = tw_initconnection(tw_dev, TW_INIT_MESSAGE_CREDITS);\n\tif (error) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Connection initialization failed.\\n\", tw_dev->host->host_no);\n\t\treturn 1;\n\t}\n\n\terror = tw_setfeature(tw_dev, 2, 1, &c);\n\tif (error) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: Unable to set features for card, probable old firmware or card.\\n\");\n\t}\n\n\treturn 0;\n} /* End tw_reset_sequence() */\n\n/* This function will initialize the fields of a device extension */\nstatic int tw_initialize_device_extension(TW_Device_Extension *tw_dev)\n{\n\tint i, error=0;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_initialize_device_extension()\\n\");\n\n\t/* Initialize command packet buffers */\n\terror = tw_allocate_memory(tw_dev, sizeof(TW_Command), 0);\n\tif (error) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: Command packet memory allocation failed.\\n\");\n\t\treturn 1;\n\t}\n\n\t/* Initialize generic buffer */\n\terror = tw_allocate_memory(tw_dev, sizeof(TW_Sector), 1);\n\tif (error) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: Generic memory allocation failed.\\n\");\n\t\treturn 1;\n\t}\n\n\tfor (i=0;ifree_queue[i] = i;\n\t\ttw_dev->state[i] = TW_S_INITIAL;\n\t}\n\n\ttw_dev->pending_head = TW_Q_START;\n\ttw_dev->pending_tail = TW_Q_START;\n\ttw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE;\n\n\tmutex_init(&tw_dev->ioctl_lock);\n\tinit_waitqueue_head(&tw_dev->ioctl_wqueue);\n\n\treturn 0;\n} /* End tw_initialize_device_extension() */\n\nstatic int tw_map_scsi_sg_data(struct pci_dev *pdev, struct scsi_cmnd *cmd)\n{\n\tint use_sg;\n\n\tdprintk(KERN_WARNING \"3w-xxxx: tw_map_scsi_sg_data()\\n\");\n\n\tuse_sg = scsi_dma_map(cmd);\n\tif (use_sg < 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_map_scsi_sg_data(): pci_map_sg() failed.\\n\");\n\t\treturn 0;\n\t}\n\n\tcmd->SCp.phase = TW_PHASE_SGLIST;\n\tcmd->SCp.have_data_in = use_sg;\n\n\treturn use_sg;\n} /* End tw_map_scsi_sg_data() */\n\nstatic void tw_unmap_scsi_data(struct pci_dev *pdev, struct scsi_cmnd *cmd)\n{\n\tdprintk(KERN_WARNING \"3w-xxxx: tw_unmap_scsi_data()\\n\");\n\n\tif (cmd->SCp.phase == TW_PHASE_SGLIST)\n\t\tscsi_dma_unmap(cmd);\n} /* End tw_unmap_scsi_data() */\n\n/* This function will reset a device extension */\nstatic int tw_reset_device_extension(TW_Device_Extension *tw_dev)\n{\n\tint i = 0;\n\tstruct scsi_cmnd *srb;\n\tunsigned long flags = 0;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_reset_device_extension()\\n\");\n\n\tset_bit(TW_IN_RESET, &tw_dev->flags);\n\tTW_DISABLE_INTERRUPTS(tw_dev);\n\tTW_MASK_COMMAND_INTERRUPT(tw_dev);\n\tspin_lock_irqsave(tw_dev->host->host_lock, flags);\n\n\t/* Abort all requests that are in progress */\n\tfor (i=0;istate[i] != TW_S_FINISHED) && \n\t\t (tw_dev->state[i] != TW_S_INITIAL) &&\n\t\t (tw_dev->state[i] != TW_S_COMPLETED)) {\n\t\t\tsrb = tw_dev->srb[i];\n\t\t\tif (srb != NULL) {\n\t\t\t\tsrb->result = (DID_RESET << 16);\n\t\t\t\ttw_dev->srb[i]->scsi_done(tw_dev->srb[i]);\n\t\t\t\ttw_unmap_scsi_data(tw_dev->tw_pci_dev, tw_dev->srb[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Reset queues and counts */\n\tfor (i=0;ifree_queue[i] = i;\n\t\ttw_dev->state[i] = TW_S_INITIAL;\n\t}\n\ttw_dev->free_head = TW_Q_START;\n\ttw_dev->free_tail = TW_Q_START;\n\ttw_dev->posted_request_count = 0;\n\ttw_dev->pending_request_count = 0;\n\ttw_dev->pending_head = TW_Q_START;\n\ttw_dev->pending_tail = TW_Q_START;\n\ttw_dev->reset_print = 0;\n\n\tspin_unlock_irqrestore(tw_dev->host->host_lock, flags);\n\n\tif (tw_reset_sequence(tw_dev)) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Reset sequence failed.\\n\", tw_dev->host->host_no);\n\t\treturn 1;\n\t}\n\n\tTW_ENABLE_AND_CLEAR_INTERRUPTS(tw_dev);\n\tclear_bit(TW_IN_RESET, &tw_dev->flags);\n\ttw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE;\n\n\treturn 0;\n} /* End tw_reset_device_extension() */\n\n/* This funciton returns unit geometry in cylinders/heads/sectors */\nstatic int tw_scsi_biosparam(struct scsi_device *sdev, struct block_device *bdev,\n\t\tsector_t capacity, int geom[]) \n{\n\tint heads, sectors, cylinders;\n\tTW_Device_Extension *tw_dev;\n\t\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsi_biosparam()\\n\");\n\ttw_dev = (TW_Device_Extension *)sdev->host->hostdata;\n\n\theads = 64;\n\tsectors = 32;\n\tcylinders = sector_div(capacity, heads * sectors);\n\n\tif (capacity >= 0x200000) {\n\t\theads = 255;\n\t\tsectors = 63;\n\t\tcylinders = sector_div(capacity, heads * sectors);\n\t}\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsi_biosparam(): heads = %d, sectors = %d, cylinders = %d\\n\", heads, sectors, cylinders);\n\tgeom[0] = heads;\t\t\t \n\tgeom[1] = sectors;\n\tgeom[2] = cylinders;\n\n\treturn 0;\n} /* End tw_scsi_biosparam() */\n\n/* This is the new scsi eh reset function */\nstatic int tw_scsi_eh_reset(struct scsi_cmnd *SCpnt) \n{\n\tTW_Device_Extension *tw_dev=NULL;\n\tint retval = FAILED;\n\n\ttw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;\n\n\ttw_dev->num_resets++;\n\n\tsdev_printk(KERN_WARNING, SCpnt->device,\n\t\t\"WARNING: Command (0x%x) timed out, resetting card.\\n\",\n\t\tSCpnt->cmnd[0]);\n\n\t/* Make sure we are not issuing an ioctl or resetting from ioctl */\n\tmutex_lock(&tw_dev->ioctl_lock);\n\n\t/* Now reset the card and some of the device extension data */\n\tif (tw_reset_device_extension(tw_dev)) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Reset failed.\\n\", tw_dev->host->host_no);\n\t\tgoto out;\n\t}\n\n\tretval = SUCCESS;\nout:\n\tmutex_unlock(&tw_dev->ioctl_lock);\n\treturn retval;\n} /* End tw_scsi_eh_reset() */\n\n/* This function handles scsi inquiry commands */\nstatic int tw_scsiop_inquiry(TW_Device_Extension *tw_dev, int request_id)\n{\n\tTW_Param *param;\n\tTW_Command *command_packet;\n\tunsigned long command_que_value;\n\tunsigned long param_value;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_inquiry()\\n\");\n\n\t/* Initialize command packet */\n\tcommand_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];\n\tif (command_packet == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_inquiry(): Bad command packet virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tmemset(command_packet, 0, sizeof(TW_Sector));\n\tcommand_packet->opcode__sgloffset = TW_OPSGL_IN(2, TW_OP_GET_PARAM);\n\tcommand_packet->size = 4;\n\tcommand_packet->request_id = request_id;\n\tcommand_packet->status = 0;\n\tcommand_packet->flags = 0;\n\tcommand_packet->byte6.parameter_count = 1;\n\n\t/* Now setup the param */\n\tif (tw_dev->alignment_virtual_address[request_id] == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_inquiry(): Bad alignment virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tparam = (TW_Param *)tw_dev->alignment_virtual_address[request_id];\n\tmemset(param, 0, sizeof(TW_Sector));\n\tparam->table_id = 3;\t /* unit summary table */\n\tparam->parameter_id = 3; /* unitsstatus parameter */\n\tparam->parameter_size_bytes = TW_MAX_UNITS;\n\tparam_value = tw_dev->alignment_physical_address[request_id];\n\tif (param_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_inquiry(): Bad alignment physical address.\\n\");\n\t\treturn 1;\n\t}\n\n\tcommand_packet->byte8.param.sgl[0].address = param_value;\n\tcommand_packet->byte8.param.sgl[0].length = sizeof(TW_Sector);\n\tcommand_que_value = tw_dev->command_packet_physical_address[request_id];\n\tif (command_que_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_inquiry(): Bad command packet physical address.\\n\");\n\t\treturn 1;\n\t}\n\n\t/* Now try to post the command packet */\n\ttw_post_command_packet(tw_dev, request_id);\n\n\treturn 0;\n} /* End tw_scsiop_inquiry() */\n\nstatic void tw_transfer_internal(TW_Device_Extension *tw_dev, int request_id,\n\t\t\t\t void *data, unsigned int len)\n{\n\tscsi_sg_copy_from_buffer(tw_dev->srb[request_id], data, len);\n}\n\n/* This function is called by the isr to complete an inquiry command */\nstatic int tw_scsiop_inquiry_complete(TW_Device_Extension *tw_dev, int request_id)\n{\n\tunsigned char *is_unit_present;\n\tunsigned char request_buffer[36];\n\tTW_Param *param;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_inquiry_complete()\\n\");\n\n\tmemset(request_buffer, 0, sizeof(request_buffer));\n\trequest_buffer[0] = TYPE_DISK; /* Peripheral device type */\n\trequest_buffer[1] = 0;\t /* Device type modifier */\n\trequest_buffer[2] = 0;\t /* No ansi/iso compliance */\n\trequest_buffer[4] = 31;\t /* Additional length */\n\tmemcpy(&request_buffer[8], \"3ware \", 8);\t /* Vendor ID */\n\tsprintf(&request_buffer[16], \"Logical Disk %-2d \", tw_dev->srb[request_id]->device->id);\n\tmemcpy(&request_buffer[32], TW_DRIVER_VERSION, 3);\n\ttw_transfer_internal(tw_dev, request_id, request_buffer,\n\t\t\t sizeof(request_buffer));\n\n\tparam = (TW_Param *)tw_dev->alignment_virtual_address[request_id];\n\tif (param == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_inquiry_complete(): Bad alignment virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tis_unit_present = &(param->data[0]);\n\n\tif (is_unit_present[tw_dev->srb[request_id]->device->id] & TW_UNIT_ONLINE) {\n\t\ttw_dev->is_unit_present[tw_dev->srb[request_id]->device->id] = 1;\n\t} else {\n\t\ttw_dev->is_unit_present[tw_dev->srb[request_id]->device->id] = 0;\n\t\ttw_dev->srb[request_id]->result = (DID_BAD_TARGET << 16);\n\t\treturn TW_ISR_DONT_RESULT;\n\t}\n\n\treturn 0;\n} /* End tw_scsiop_inquiry_complete() */\n\n/* This function handles scsi mode_sense commands */\nstatic int tw_scsiop_mode_sense(TW_Device_Extension *tw_dev, int request_id)\n{\n\tTW_Param *param;\n\tTW_Command *command_packet;\n\tunsigned long command_que_value;\n\tunsigned long param_value;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_mode_sense()\\n\");\n\n\t/* Only page control = 0, page code = 0x8 (cache page) supported */\n\tif (tw_dev->srb[request_id]->cmnd[2] != 0x8) {\n\t\ttw_dev->state[request_id] = TW_S_COMPLETED;\n\t\ttw_state_request_finish(tw_dev, request_id);\n\t\ttw_dev->srb[request_id]->result = (DID_OK << 16);\n\t\ttw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);\n\t\treturn 0;\n\t}\n\n\t/* Now read firmware cache setting for this unit */\n\tcommand_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];\n\tif (command_packet == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_mode_sense(): Bad command packet virtual address.\\n\");\n\t\treturn 1;\n\t}\n\n\t/* Setup the command packet */\n\tmemset(command_packet, 0, sizeof(TW_Sector));\n\tcommand_packet->opcode__sgloffset = TW_OPSGL_IN(2, TW_OP_GET_PARAM);\n\tcommand_packet->size = 4;\n\tcommand_packet->request_id = request_id;\n\tcommand_packet->status = 0;\n\tcommand_packet->flags = 0;\n\tcommand_packet->byte6.parameter_count = 1;\n\n\t/* Setup the param */\n\tif (tw_dev->alignment_virtual_address[request_id] == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_mode_sense(): Bad alignment virtual address.\\n\");\n\t\treturn 1;\n\t}\n\n\tparam = (TW_Param *)tw_dev->alignment_virtual_address[request_id];\n\tmemset(param, 0, sizeof(TW_Sector));\n\tparam->table_id = TW_UNIT_INFORMATION_TABLE_BASE + tw_dev->srb[request_id]->device->id;\n\tparam->parameter_id = 7; /* unit flags */\n\tparam->parameter_size_bytes = 1;\n\tparam_value = tw_dev->alignment_physical_address[request_id];\n\tif (param_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_mode_sense(): Bad alignment physical address.\\n\");\n\t\treturn 1;\n\t}\n\n\tcommand_packet->byte8.param.sgl[0].address = param_value;\n\tcommand_packet->byte8.param.sgl[0].length = sizeof(TW_Sector);\n\tcommand_que_value = tw_dev->command_packet_physical_address[request_id];\n\tif (command_que_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_mode_sense(): Bad command packet physical address.\\n\");\n\t\treturn 1;\n\t}\n\n\t/* Now try to post the command packet */\n\ttw_post_command_packet(tw_dev, request_id);\n\t\n\treturn 0;\n} /* End tw_scsiop_mode_sense() */\n\n/* This function is called by the isr to complete a mode sense command */\nstatic int tw_scsiop_mode_sense_complete(TW_Device_Extension *tw_dev, int request_id)\n{\n\tTW_Param *param;\n\tunsigned char *flags;\n\tunsigned char request_buffer[8];\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_mode_sense_complete()\\n\");\n\n\tparam = (TW_Param *)tw_dev->alignment_virtual_address[request_id];\n\tif (param == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_mode_sense_complete(): Bad alignment virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tflags = (char *)&(param->data[0]);\n\tmemset(request_buffer, 0, sizeof(request_buffer));\n\n\trequest_buffer[0] = 0xf; /* mode data length */\n\trequest_buffer[1] = 0; /* default medium type */\n\trequest_buffer[2] = 0x10; /* dpo/fua support on */\n\trequest_buffer[3] = 0; /* no block descriptors */\n\trequest_buffer[4] = 0x8; /* caching page */\n\trequest_buffer[5] = 0xa; /* page length */\n\tif (*flags & 0x1)\n\t\trequest_buffer[6] = 0x5; /* WCE on, RCD on */\n\telse\n\t\trequest_buffer[6] = 0x1; /* WCE off, RCD on */\n\ttw_transfer_internal(tw_dev, request_id, request_buffer,\n\t\t\t sizeof(request_buffer));\n\n\treturn 0;\n} /* End tw_scsiop_mode_sense_complete() */\n\n/* This function handles scsi read_capacity commands */\nstatic int tw_scsiop_read_capacity(TW_Device_Extension *tw_dev, int request_id) \n{\n\tTW_Param *param;\n\tTW_Command *command_packet;\n\tunsigned long command_que_value;\n\tunsigned long param_value;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_read_capacity()\\n\");\n\n\t/* Initialize command packet */\n\tcommand_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];\n\n\tif (command_packet == NULL) {\n\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_read_capacity(): Bad command packet virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tmemset(command_packet, 0, sizeof(TW_Sector));\n\tcommand_packet->opcode__sgloffset = TW_OPSGL_IN(2, TW_OP_GET_PARAM);\n\tcommand_packet->size = 4;\n\tcommand_packet->request_id = request_id;\n\tcommand_packet->unit__hostid = TW_UNITHOST_IN(0, tw_dev->srb[request_id]->device->id);\n\tcommand_packet->status = 0;\n\tcommand_packet->flags = 0;\n\tcommand_packet->byte6.block_count = 1;\n\n\t/* Now setup the param */\n\tif (tw_dev->alignment_virtual_address[request_id] == NULL) {\n\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_read_capacity(): Bad alignment virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tparam = (TW_Param *)tw_dev->alignment_virtual_address[request_id];\n\tmemset(param, 0, sizeof(TW_Sector));\n\tparam->table_id = TW_UNIT_INFORMATION_TABLE_BASE + \n\ttw_dev->srb[request_id]->device->id;\n\tparam->parameter_id = 4;\t/* unitcapacity parameter */\n\tparam->parameter_size_bytes = 4;\n\tparam_value = tw_dev->alignment_physical_address[request_id];\n\tif (param_value == 0) {\n\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_read_capacity(): Bad alignment physical address.\\n\");\n\t\treturn 1;\n\t}\n \n\tcommand_packet->byte8.param.sgl[0].address = param_value;\n\tcommand_packet->byte8.param.sgl[0].length = sizeof(TW_Sector);\n\tcommand_que_value = tw_dev->command_packet_physical_address[request_id];\n\tif (command_que_value == 0) {\n\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_read_capacity(): Bad command packet physical address.\\n\");\n\t\treturn 1;\n\t}\n\n\t/* Now try to post the command to the board */\n\ttw_post_command_packet(tw_dev, request_id);\n \n\treturn 0;\n} /* End tw_scsiop_read_capacity() */\n\n/* This function is called by the isr to complete a readcapacity command */\nstatic int tw_scsiop_read_capacity_complete(TW_Device_Extension *tw_dev, int request_id)\n{\n\tunsigned char *param_data;\n\tu32 capacity;\n\tchar buff[8];\n\tTW_Param *param;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_read_capacity_complete()\\n\");\n\n\tmemset(buff, 0, sizeof(buff));\n\tparam = (TW_Param *)tw_dev->alignment_virtual_address[request_id];\n\tif (param == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_read_capacity_complete(): Bad alignment virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tparam_data = &(param->data[0]);\n\n\tcapacity = (param_data[3] << 24) | (param_data[2] << 16) | \n\t\t (param_data[1] << 8) | param_data[0];\n\n\t/* Subtract one sector to fix get last sector ioctl */\n\tcapacity -= 1;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_read_capacity_complete(): Capacity = 0x%x.\\n\", capacity);\n\n\t/* Number of LBA's */\n\tbuff[0] = (capacity >> 24);\n\tbuff[1] = (capacity >> 16) & 0xff;\n\tbuff[2] = (capacity >> 8) & 0xff;\n\tbuff[3] = capacity & 0xff;\n\n\t/* Block size in bytes (512) */\n\tbuff[4] = (TW_BLOCK_SIZE >> 24);\n\tbuff[5] = (TW_BLOCK_SIZE >> 16) & 0xff;\n\tbuff[6] = (TW_BLOCK_SIZE >> 8) & 0xff;\n\tbuff[7] = TW_BLOCK_SIZE & 0xff;\n\n\ttw_transfer_internal(tw_dev, request_id, buff, sizeof(buff));\n\n\treturn 0;\n} /* End tw_scsiop_read_capacity_complete() */\n\n/* This function handles scsi read or write commands */\nstatic int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id) \n{\n\tTW_Command *command_packet;\n\tunsigned long command_que_value;\n\tu32 lba = 0x0, num_sectors = 0x0;\n\tint i, use_sg;\n\tstruct scsi_cmnd *srb;\n\tstruct scatterlist *sglist, *sg;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_read_write()\\n\");\n\n\tsrb = tw_dev->srb[request_id];\n\n\tsglist = scsi_sglist(srb);\n\tif (!sglist) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_read_write(): Request buffer NULL.\\n\");\n\t\treturn 1;\n\t}\n\n\t/* Initialize command packet */\n\tcommand_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];\n\tif (command_packet == NULL) {\n\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_read_write(): Bad command packet virtual address.\\n\");\n\t\treturn 1;\n\t}\n\n\tif (srb->cmnd[0] == READ_6 || srb->cmnd[0] == READ_10) {\n\t\tcommand_packet->opcode__sgloffset = TW_OPSGL_IN(3, TW_OP_READ);\n\t} else {\n\t\tcommand_packet->opcode__sgloffset = TW_OPSGL_IN(3, TW_OP_WRITE);\n\t}\n\n\tcommand_packet->size = 3;\n\tcommand_packet->request_id = request_id;\n\tcommand_packet->unit__hostid = TW_UNITHOST_IN(0, srb->device->id);\n\tcommand_packet->status = 0;\n\tcommand_packet->flags = 0;\n\n\tif (srb->cmnd[0] == WRITE_10) {\n\t\tif ((srb->cmnd[1] & 0x8) || (srb->cmnd[1] & 0x10))\n\t\t\tcommand_packet->flags = 1;\n\t}\n\n\tif (srb->cmnd[0] == READ_6 || srb->cmnd[0] == WRITE_6) {\n\t\tlba = ((u32)srb->cmnd[1] << 16) | ((u32)srb->cmnd[2] << 8) | (u32)srb->cmnd[3];\n\t\tnum_sectors = (u32)srb->cmnd[4];\n\t} else {\n\t\tlba = ((u32)srb->cmnd[2] << 24) | ((u32)srb->cmnd[3] << 16) | ((u32)srb->cmnd[4] << 8) | (u32)srb->cmnd[5];\n\t\tnum_sectors = (u32)srb->cmnd[8] | ((u32)srb->cmnd[7] << 8);\n\t}\n \n\t/* Update sector statistic */\n\ttw_dev->sector_count = num_sectors;\n\tif (tw_dev->sector_count > tw_dev->max_sector_count)\n\t\ttw_dev->max_sector_count = tw_dev->sector_count;\n \n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_read_write(): lba = 0x%x num_sectors = 0x%x\\n\", lba, num_sectors);\n\tcommand_packet->byte8.io.lba = lba;\n\tcommand_packet->byte6.block_count = num_sectors;\n\n\tuse_sg = tw_map_scsi_sg_data(tw_dev->tw_pci_dev, tw_dev->srb[request_id]);\n\tif (!use_sg)\n\t\treturn 1;\n\n\tscsi_for_each_sg(tw_dev->srb[request_id], sg, use_sg, i) {\n\t\tcommand_packet->byte8.io.sgl[i].address = sg_dma_address(sg);\n\t\tcommand_packet->byte8.io.sgl[i].length = sg_dma_len(sg);\n\t\tcommand_packet->size+=2;\n\t}\n\n\t/* Update SG statistics */\n\ttw_dev->sgl_entries = scsi_sg_count(tw_dev->srb[request_id]);\n\tif (tw_dev->sgl_entries > tw_dev->max_sgl_entries)\n\t\ttw_dev->max_sgl_entries = tw_dev->sgl_entries;\n\n\tcommand_que_value = tw_dev->command_packet_physical_address[request_id];\n\tif (command_que_value == 0) {\n\t\tdprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_read_write(): Bad command packet physical address.\\n\");\n\t\treturn 1;\n\t}\n \n\t/* Now try to post the command to the board */\n\ttw_post_command_packet(tw_dev, request_id);\n\n\treturn 0;\n} /* End tw_scsiop_read_write() */\n\n/* This function will handle the request sense scsi command */\nstatic int tw_scsiop_request_sense(TW_Device_Extension *tw_dev, int request_id)\n{\n\tchar request_buffer[18];\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_request_sense()\\n\");\n\n\tmemset(request_buffer, 0, sizeof(request_buffer));\n\trequest_buffer[0] = 0x70; /* Immediate fixed format */\n\trequest_buffer[7] = 10;\t/* minimum size per SPC: 18 bytes */\n\t/* leave all other fields zero, giving effectively NO_SENSE return */\n\ttw_transfer_internal(tw_dev, request_id, request_buffer,\n\t\t\t sizeof(request_buffer));\n\n\ttw_dev->state[request_id] = TW_S_COMPLETED;\n\ttw_state_request_finish(tw_dev, request_id);\n\n\t/* If we got a request_sense, we probably want a reset, return error */\n\ttw_dev->srb[request_id]->result = (DID_ERROR << 16);\n\ttw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);\n\n\treturn 0;\n} /* End tw_scsiop_request_sense() */\n\n/* This function will handle synchronize cache scsi command */\nstatic int tw_scsiop_synchronize_cache(TW_Device_Extension *tw_dev, int request_id)\n{\n\tTW_Command *command_packet;\n\tunsigned long command_que_value;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_synchronize_cache()\\n\");\n\n\t/* Send firmware flush command for this unit */\n\tcommand_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];\n\tif (command_packet == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_synchronize_cache(): Bad command packet virtual address.\\n\");\n\t\treturn 1;\n\t}\n\n\t/* Setup the command packet */\n\tmemset(command_packet, 0, sizeof(TW_Sector));\n\tcommand_packet->opcode__sgloffset = TW_OPSGL_IN(0, TW_OP_FLUSH_CACHE);\n\tcommand_packet->size = 2;\n\tcommand_packet->request_id = request_id;\n\tcommand_packet->unit__hostid = TW_UNITHOST_IN(0, tw_dev->srb[request_id]->device->id);\n\tcommand_packet->status = 0;\n\tcommand_packet->flags = 0;\n\tcommand_packet->byte6.parameter_count = 1;\n\tcommand_que_value = tw_dev->command_packet_physical_address[request_id];\n\tif (command_que_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_synchronize_cache(): Bad command packet physical address.\\n\");\n\t\treturn 1;\n\t}\n\n\t/* Now try to post the command packet */\n\ttw_post_command_packet(tw_dev, request_id);\n\n\treturn 0;\n} /* End tw_scsiop_synchronize_cache() */\n\n/* This function will handle test unit ready scsi command */\nstatic int tw_scsiop_test_unit_ready(TW_Device_Extension *tw_dev, int request_id)\n{\n\tTW_Param *param;\n\tTW_Command *command_packet;\n\tunsigned long command_que_value;\n\tunsigned long param_value;\n\n\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsiop_test_unit_ready()\\n\");\n\n\t/* Initialize command packet */\n\tcommand_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];\n\tif (command_packet == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_test_unit_ready(): Bad command packet virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tmemset(command_packet, 0, sizeof(TW_Sector));\n\tcommand_packet->opcode__sgloffset = TW_OPSGL_IN(2, TW_OP_GET_PARAM);\n\tcommand_packet->size = 4;\n\tcommand_packet->request_id = request_id;\n\tcommand_packet->status = 0;\n\tcommand_packet->flags = 0;\n\tcommand_packet->byte6.parameter_count = 1;\n\n\t/* Now setup the param */\n\tif (tw_dev->alignment_virtual_address[request_id] == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_test_unit_ready(): Bad alignment virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tparam = (TW_Param *)tw_dev->alignment_virtual_address[request_id];\n\tmemset(param, 0, sizeof(TW_Sector));\n\tparam->table_id = 3;\t /* unit summary table */\n\tparam->parameter_id = 3; /* unitsstatus parameter */\n\tparam->parameter_size_bytes = TW_MAX_UNITS;\n\tparam_value = tw_dev->alignment_physical_address[request_id];\n\tif (param_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_test_unit_ready(): Bad alignment physical address.\\n\");\n\t\treturn 1;\n\t}\n\n\tcommand_packet->byte8.param.sgl[0].address = param_value;\n\tcommand_packet->byte8.param.sgl[0].length = sizeof(TW_Sector);\n\tcommand_que_value = tw_dev->command_packet_physical_address[request_id];\n\tif (command_que_value == 0) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_test_unit_ready(): Bad command packet physical address.\\n\");\n\t\treturn 1;\n\t}\n\n\t/* Now try to post the command packet */\n\ttw_post_command_packet(tw_dev, request_id);\n\n\treturn 0;\n} /* End tw_scsiop_test_unit_ready() */\n\n/* This function is called by the isr to complete a testunitready command */\nstatic int tw_scsiop_test_unit_ready_complete(TW_Device_Extension *tw_dev, int request_id)\n{\n\tunsigned char *is_unit_present;\n\tTW_Param *param;\n\n\tdprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_test_unit_ready_complete()\\n\");\n\n\tparam = (TW_Param *)tw_dev->alignment_virtual_address[request_id];\n\tif (param == NULL) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: tw_scsiop_test_unit_ready_complete(): Bad alignment virtual address.\\n\");\n\t\treturn 1;\n\t}\n\tis_unit_present = &(param->data[0]);\n\n\tif (is_unit_present[tw_dev->srb[request_id]->device->id] & TW_UNIT_ONLINE) {\n\t\ttw_dev->is_unit_present[tw_dev->srb[request_id]->device->id] = 1;\n\t} else {\n\t\ttw_dev->is_unit_present[tw_dev->srb[request_id]->device->id] = 0;\n\t\ttw_dev->srb[request_id]->result = (DID_BAD_TARGET << 16);\n\t\treturn TW_ISR_DONT_RESULT;\n\t}\n\n\treturn 0;\n} /* End tw_scsiop_test_unit_ready_complete() */\n\n/* This is the main scsi queue function to handle scsi opcodes */\nstatic int tw_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) \n{\n\tunsigned char *command = SCpnt->cmnd;\n\tint request_id = 0;\n\tint retval = 1;\n\tTW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;\n\n\t/* If we are resetting due to timed out ioctl, report as busy */\n\tif (test_bit(TW_IN_RESET, &tw_dev->flags))\n\t\treturn SCSI_MLQUEUE_HOST_BUSY;\n\n\t/* Save done function into Scsi_Cmnd struct */\n\tSCpnt->scsi_done = done;\n\t\t \n\t/* Queue the command and get a request id */\n\ttw_state_request_start(tw_dev, &request_id);\n\n\t/* Save the scsi command for use by the ISR */\n\ttw_dev->srb[request_id] = SCpnt;\n\n\t/* Initialize phase to zero */\n\tSCpnt->SCp.phase = TW_PHASE_INITIAL;\n\n\tswitch (*command) {\n\t\tcase READ_10:\n\t\tcase READ_6:\n\t\tcase WRITE_10:\n\t\tcase WRITE_6:\n\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsi_queue(): caught READ/WRITE.\\n\");\n\t\t\tretval = tw_scsiop_read_write(tw_dev, request_id);\n\t\t\tbreak;\n\t\tcase TEST_UNIT_READY:\n\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsi_queue(): caught TEST_UNIT_READY.\\n\");\n\t\t\tretval = tw_scsiop_test_unit_ready(tw_dev, request_id);\n\t\t\tbreak;\n\t\tcase INQUIRY:\n\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsi_queue(): caught INQUIRY.\\n\");\n\t\t\tretval = tw_scsiop_inquiry(tw_dev, request_id);\n\t\t\tbreak;\n\t\tcase READ_CAPACITY:\n\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsi_queue(): caught READ_CAPACITY.\\n\");\n\t\t\tretval = tw_scsiop_read_capacity(tw_dev, request_id);\n\t\t\tbreak;\n\t case REQUEST_SENSE:\n\t\t dprintk(KERN_NOTICE \"3w-xxxx: tw_scsi_queue(): caught REQUEST_SENSE.\\n\");\n\t\t retval = tw_scsiop_request_sense(tw_dev, request_id);\n\t\t break;\n\t\tcase MODE_SENSE:\n\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsi_queue(): caught MODE_SENSE.\\n\");\n\t\t\tretval = tw_scsiop_mode_sense(tw_dev, request_id);\n\t\t\tbreak;\n\t\tcase SYNCHRONIZE_CACHE:\n\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_scsi_queue(): caught SYNCHRONIZE_CACHE.\\n\");\n\t\t\tretval = tw_scsiop_synchronize_cache(tw_dev, request_id);\n\t\t\tbreak;\n\t\tcase TW_IOCTL:\n\t\t\tprintk(KERN_WARNING \"3w-xxxx: SCSI_IOCTL_SEND_COMMAND deprecated, please update your 3ware tools.\\n\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tprintk(KERN_NOTICE \"3w-xxxx: scsi%d: Unknown scsi opcode: 0x%x\\n\", tw_dev->host->host_no, *command);\n\t\t\ttw_dev->state[request_id] = TW_S_COMPLETED;\n\t\t\ttw_state_request_finish(tw_dev, request_id);\n\t\t\tSCpnt->result = (DID_BAD_TARGET << 16);\n\t\t\tdone(SCpnt);\n\t\t\tretval = 0;\n\t}\n\tif (retval) {\n\t\ttw_dev->state[request_id] = TW_S_COMPLETED;\n\t\ttw_state_request_finish(tw_dev, request_id);\n\t\tSCpnt->result = (DID_ERROR << 16);\n\t\tdone(SCpnt);\n\t\tretval = 0;\n\t}\n\treturn retval;\n} /* End tw_scsi_queue() */\n\n/* This function is the interrupt service routine */\nstatic irqreturn_t tw_interrupt(int irq, void *dev_instance) \n{\n\tint request_id;\n\tu32 status_reg_value;\n\tTW_Device_Extension *tw_dev = (TW_Device_Extension *)dev_instance;\n\tTW_Response_Queue response_que;\n\tint error = 0, retval = 0;\n\tTW_Command *command_packet;\n\tint handled = 0;\n\n\t/* Get the host lock for io completions */\n\tspin_lock(tw_dev->host->host_lock);\n\n\t/* Read the registers */\n\tstatus_reg_value = inl(TW_STATUS_REG_ADDR(tw_dev));\n\n\t/* Check if this is our interrupt, otherwise bail */\n\tif (!(status_reg_value & TW_STATUS_VALID_INTERRUPT))\n\t\tgoto tw_interrupt_bail;\n\n\thandled = 1;\n\n\t/* If we are resetting, bail */\n\tif (test_bit(TW_IN_RESET, &tw_dev->flags))\n\t\tgoto tw_interrupt_bail;\n\n\t/* Check controller for errors */\n\tif (tw_check_bits(status_reg_value)) {\n\t\tdprintk(KERN_WARNING \"3w-xxxx: tw_interrupt(): Unexpected bits.\\n\");\n\t\tif (tw_decode_bits(tw_dev, status_reg_value, 1)) {\n\t\t\tTW_CLEAR_ALL_INTERRUPTS(tw_dev);\n\t\t\tgoto tw_interrupt_bail;\n\t\t}\n\t}\n\n\t/* Handle host interrupt */\n\tif (status_reg_value & TW_STATUS_HOST_INTERRUPT) {\n\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_interrupt(): Received host interrupt.\\n\");\n\t\tTW_CLEAR_HOST_INTERRUPT(tw_dev);\n\t}\n\n\t/* Handle attention interrupt */\n\tif (status_reg_value & TW_STATUS_ATTENTION_INTERRUPT) {\n\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_interrupt(): Received attention interrupt.\\n\");\n\t\tTW_CLEAR_ATTENTION_INTERRUPT(tw_dev);\n\t\ttw_state_request_start(tw_dev, &request_id);\n\t\terror = tw_aen_read_queue(tw_dev, request_id);\n\t\tif (error) {\n\t\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Error reading aen queue.\\n\", tw_dev->host->host_no);\n\t\t\ttw_dev->state[request_id] = TW_S_COMPLETED;\n\t\t\ttw_state_request_finish(tw_dev, request_id);\n\t\t}\n\t}\n\n\t/* Handle command interrupt */\n\tif (status_reg_value & TW_STATUS_COMMAND_INTERRUPT) {\n\t\t/* Drain as many pending commands as we can */\n\t\twhile (tw_dev->pending_request_count > 0) {\n\t\t\trequest_id = tw_dev->pending_queue[tw_dev->pending_head];\n\t\t\tif (tw_dev->state[request_id] != TW_S_PENDING) {\n\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Found request id that wasn't pending.\\n\", tw_dev->host->host_no);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (tw_post_command_packet(tw_dev, request_id)==0) {\n\t\t\t\tif (tw_dev->pending_head == TW_Q_LENGTH-1) {\n\t\t\t\t\ttw_dev->pending_head = TW_Q_START;\n\t\t\t\t} else {\n\t\t\t\t\ttw_dev->pending_head = tw_dev->pending_head + 1;\n\t\t\t\t}\n\t\t\t\ttw_dev->pending_request_count--;\n\t\t\t} else {\n\t\t\t\t/* If we get here, we will continue re-posting on the next command interrupt */\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* If there are no more pending requests, we mask command interrupt */\n\t\tif (tw_dev->pending_request_count == 0) \n\t\t\tTW_MASK_COMMAND_INTERRUPT(tw_dev);\n\t}\n\n\t/* Handle response interrupt */\n\tif (status_reg_value & TW_STATUS_RESPONSE_INTERRUPT) {\n\t\t/* Drain the response queue from the board */\n\t\twhile ((status_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) {\n\t\t\t/* Read response queue register */\n\t\t\tresponse_que.value = inl(TW_RESPONSE_QUEUE_REG_ADDR(tw_dev));\n\t\t\trequest_id = TW_RESID_OUT(response_que.response_id);\n\t\t\tcommand_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];\n\t\t\terror = 0;\n\n\t\t\t/* Check for bad response */\n\t\t\tif (command_packet->status != 0) {\n\t\t\t\t/* If internal command, don't error, don't fill sense */\n\t\t\t\tif (tw_dev->srb[request_id] == NULL) {\n\t\t\t\t\ttw_decode_sense(tw_dev, request_id, 0);\n\t\t\t\t} else {\n\t\t\t\t\terror = tw_decode_sense(tw_dev, request_id, 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Check for correct state */\n\t\t\tif (tw_dev->state[request_id] != TW_S_POSTED) {\n\t\t\t\tif (tw_dev->srb[request_id] != NULL) {\n\t\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Received a request id that wasn't posted.\\n\", tw_dev->host->host_no);\n\t\t\t\t\terror = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_interrupt(): Response queue request id: %d.\\n\", request_id);\n\n\t\t\t/* Check for internal command completion */\n\t\t\tif (tw_dev->srb[request_id] == NULL) {\n\t\t\t\tdprintk(KERN_WARNING \"3w-xxxx: tw_interrupt(): Found internally posted command.\\n\");\n\t\t\t\t/* Check for chrdev ioctl completion */\n\t\t\t\tif (request_id != tw_dev->chrdev_request_id) {\n\t\t\t\t\tretval = tw_aen_complete(tw_dev, request_id);\n\t\t\t\t\tif (retval) {\n\t\t\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Error completing aen.\\n\", tw_dev->host->host_no);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE;\n\t\t\t\t\twake_up(&tw_dev->ioctl_wqueue);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch (tw_dev->srb[request_id]->cmnd[0]) {\n\t\t\t\tcase READ_10:\n\t\t\t\tcase READ_6:\n\t\t\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_interrupt(): caught READ_10/READ_6\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase WRITE_10:\n\t\t\t\tcase WRITE_6:\n\t\t\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_interrupt(): caught WRITE_10/WRITE_6\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEST_UNIT_READY:\n\t\t\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_interrupt(): caught TEST_UNIT_READY\\n\");\n\t\t\t\t\terror = tw_scsiop_test_unit_ready_complete(tw_dev, request_id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase INQUIRY:\n\t\t\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_interrupt(): caught INQUIRY\\n\");\n\t\t\t\t\terror = tw_scsiop_inquiry_complete(tw_dev, request_id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase READ_CAPACITY:\n\t\t\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_interrupt(): caught READ_CAPACITY\\n\");\n\t\t\t\t\terror = tw_scsiop_read_capacity_complete(tw_dev, request_id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MODE_SENSE:\n\t\t\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_interrupt(): caught MODE_SENSE\\n\");\n\t\t\t\t\terror = tw_scsiop_mode_sense_complete(tw_dev, request_id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SYNCHRONIZE_CACHE:\n\t\t\t\t\tdprintk(KERN_NOTICE \"3w-xxxx: tw_interrupt(): caught SYNCHRONIZE_CACHE\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tprintk(KERN_WARNING \"3w-xxxx: case slip in tw_interrupt()\\n\");\n\t\t\t\t\terror = 1;\n\t\t\t\t}\n\n\t\t\t\t/* If no error command was a success */\n\t\t\t\tif (error == 0) {\n\t\t\t\t\ttw_dev->srb[request_id]->result = (DID_OK << 16);\n\t\t\t\t}\n\n\t\t\t\t/* If error, command failed */\n\t\t\t\tif (error == 1) {\n\t\t\t\t\t/* Ask for a host reset */\n\t\t\t\t\ttw_dev->srb[request_id]->result = (DID_OK << 16) | (CHECK_CONDITION << 1);\n\t\t\t\t}\n\n\t\t\t\t/* Now complete the io */\n\t\t\t\tif ((error != TW_ISR_DONT_COMPLETE)) {\n\t\t\t\t\ttw_dev->state[request_id] = TW_S_COMPLETED;\n\t\t\t\t\ttw_state_request_finish(tw_dev, request_id);\n\t\t\t\t\ttw_dev->posted_request_count--;\n\t\t\t\t\ttw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);\n\t\t\t\t\t\n\t\t\t\t\ttw_unmap_scsi_data(tw_dev->tw_pci_dev, tw_dev->srb[request_id]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t/* Check for valid status after each drain */\n\t\t\tstatus_reg_value = inl(TW_STATUS_REG_ADDR(tw_dev));\n\t\t\tif (tw_check_bits(status_reg_value)) {\n\t\t\t\tdprintk(KERN_WARNING \"3w-xxxx: tw_interrupt(): Unexpected bits.\\n\");\n\t\t\t\tif (tw_decode_bits(tw_dev, status_reg_value, 1)) {\n\t\t\t\t\tTW_CLEAR_ALL_INTERRUPTS(tw_dev);\n\t\t\t\t\tgoto tw_interrupt_bail;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\ntw_interrupt_bail:\n\tspin_unlock(tw_dev->host->host_lock);\n\treturn IRQ_RETVAL(handled);\n} /* End tw_interrupt() */\n\n/* This function tells the controller to shut down */\nstatic void __tw_shutdown(TW_Device_Extension *tw_dev)\n{\n\t/* Disable interrupts */\n\tTW_DISABLE_INTERRUPTS(tw_dev);\n\n\t/* Free up the IRQ */\n\tfree_irq(tw_dev->tw_pci_dev->irq, tw_dev);\n\n\tprintk(KERN_WARNING \"3w-xxxx: Shutting down host %d.\\n\", tw_dev->host->host_no);\n\n\t/* Tell the card we are shutting down */\n\tif (tw_initconnection(tw_dev, 1)) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: Connection shutdown failed.\\n\");\n\t} else {\n\t\tprintk(KERN_WARNING \"3w-xxxx: Shutdown complete.\\n\");\n\t}\n\n\t/* Clear all interrupts just before exit */\n\tTW_ENABLE_AND_CLEAR_INTERRUPTS(tw_dev);\n} /* End __tw_shutdown() */\n\n/* Wrapper for __tw_shutdown */\nstatic void tw_shutdown(struct pci_dev *pdev)\n{\n\tstruct Scsi_Host *host = pci_get_drvdata(pdev);\n\tTW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata;\n\n\t__tw_shutdown(tw_dev);\n} /* End tw_shutdown() */\n\nstatic struct scsi_host_template driver_template = {\n\t.module\t\t\t= THIS_MODULE,\n\t.name\t\t\t= \"3ware Storage Controller\",\n\t.queuecommand\t\t= tw_scsi_queue,\n\t.eh_host_reset_handler\t= tw_scsi_eh_reset,\n\t.bios_param\t\t= tw_scsi_biosparam,\n\t.change_queue_depth\t= tw_change_queue_depth,\n\t.can_queue\t\t= TW_Q_LENGTH-2,\n\t.this_id\t\t= -1,\n\t.sg_tablesize\t\t= TW_MAX_SGL_LENGTH,\n\t.max_sectors\t\t= TW_MAX_SECTORS,\n\t.cmd_per_lun\t\t= TW_MAX_CMDS_PER_LUN,\t\n\t.use_clustering\t\t= ENABLE_CLUSTERING,\n\t.shost_attrs\t\t= tw_host_attrs,\n\t.emulated\t\t= 1\n};\n\n/* This function will probe and initialize a card */\nstatic int __devinit tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)\n{\n\tstruct Scsi_Host *host = NULL;\n\tTW_Device_Extension *tw_dev;\n\tint retval = -ENODEV;\n\n\tretval = pci_enable_device(pdev);\n\tif (retval) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: Failed to enable pci device.\");\n\t\tgoto out_disable_device;\n\t}\n\n\tpci_set_master(pdev);\n\n\tretval = pci_set_dma_mask(pdev, TW_DMA_MASK);\n\tif (retval) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: Failed to set dma mask.\");\n\t\tgoto out_disable_device;\n\t}\n\n\thost = scsi_host_alloc(&driver_template, sizeof(TW_Device_Extension));\n\tif (!host) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: Failed to allocate memory for device extension.\");\n\t\tretval = -ENOMEM;\n\t\tgoto out_disable_device;\n\t}\n\ttw_dev = (TW_Device_Extension *)host->hostdata;\n\n\t/* Save values to device extension */\n\ttw_dev->host = host;\n\ttw_dev->tw_pci_dev = pdev;\n\n\tif (tw_initialize_device_extension(tw_dev)) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: Failed to initialize device extension.\");\n\t\tgoto out_free_device_extension;\n\t}\n\n\t/* Request IO regions */\n\tretval = pci_request_regions(pdev, \"3w-xxxx\");\n\tif (retval) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: Failed to get mem region.\");\n\t\tgoto out_free_device_extension;\n\t}\n\n\t/* Save base address */\n\ttw_dev->base_addr = pci_resource_start(pdev, 0);\n\tif (!tw_dev->base_addr) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: Failed to get io address.\");\n\t\tgoto out_release_mem_region;\n\t}\n\n\t/* Disable interrupts on the card */\n\tTW_DISABLE_INTERRUPTS(tw_dev);\n\n\t/* Initialize the card */\n\tif (tw_reset_sequence(tw_dev))\n\t\tgoto out_release_mem_region;\n\n\t/* Set host specific parameters */\n\thost->max_id = TW_MAX_UNITS;\n\thost->max_cmd_len = TW_MAX_CDB_LEN;\n\n\t/* Luns and channels aren't supported by adapter */\n\thost->max_lun = 0;\n\thost->max_channel = 0;\n\n\t/* Register the card with the kernel SCSI layer */\n\tretval = scsi_add_host(host, &pdev->dev);\n\tif (retval) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: scsi add host failed\");\n\t\tgoto out_release_mem_region;\n\t}\n\n\tpci_set_drvdata(pdev, host);\n\n\tprintk(KERN_WARNING \"3w-xxxx: scsi%d: Found a 3ware Storage Controller at 0x%x, IRQ: %d.\\n\", host->host_no, tw_dev->base_addr, pdev->irq);\n\n\t/* Now setup the interrupt handler */\n\tretval = request_irq(pdev->irq, tw_interrupt, IRQF_SHARED, \"3w-xxxx\", tw_dev);\n\tif (retval) {\n\t\tprintk(KERN_WARNING \"3w-xxxx: Error requesting IRQ.\");\n\t\tgoto out_remove_host;\n\t}\n\n\ttw_device_extension_list[tw_device_extension_count] = tw_dev;\n\ttw_device_extension_count++;\n\n\t/* Re-enable interrupts on the card */\n\tTW_ENABLE_AND_CLEAR_INTERRUPTS(tw_dev);\n\n\t/* Finally, scan the host */\n\tscsi_scan_host(host);\n\n\tif (twe_major == -1) {\n\t\tif ((twe_major = register_chrdev (0, \"twe\", &tw_fops)) < 0)\n\t\t\tprintk(KERN_WARNING \"3w-xxxx: Failed to register character device.\");\n\t}\n\treturn 0;\n\nout_remove_host:\n\tscsi_remove_host(host);\nout_release_mem_region:\n\tpci_release_regions(pdev);\nout_free_device_extension:\n\ttw_free_device_extension(tw_dev);\n\tscsi_host_put(host);\nout_disable_device:\n\tpci_disable_device(pdev);\n\n\treturn retval;\n} /* End tw_probe() */\n\n/* This function is called to remove a device */\nstatic void tw_remove(struct pci_dev *pdev)\n{\n\tstruct Scsi_Host *host = pci_get_drvdata(pdev);\n\tTW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata;\n\n\tscsi_remove_host(tw_dev->host);\n\n\t/* Unregister character device */\n\tif (twe_major >= 0) {\n\t\tunregister_chrdev(twe_major, \"twe\");\n\t\ttwe_major = -1;\n\t}\n\n\t/* Shutdown the card */\n\t__tw_shutdown(tw_dev);\n\n\t/* Free up the mem region */\n\tpci_release_regions(pdev);\n\n\t/* Free up device extension resources */\n\ttw_free_device_extension(tw_dev);\n\n\tscsi_host_put(tw_dev->host);\n\tpci_disable_device(pdev);\n\ttw_device_extension_count--;\n} /* End tw_remove() */\n\n/* PCI Devices supported by this driver */\nstatic struct pci_device_id tw_pci_tbl[] __devinitdata = {\n\t{ PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_1000,\n\t PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},\n\t{ PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_7000,\n\t PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},\n\t{ }\n};\nMODULE_DEVICE_TABLE(pci, tw_pci_tbl);\n\n/* pci_driver initializer */\nstatic struct pci_driver tw_driver = {\n\t.name\t\t= \"3w-xxxx\",\n\t.id_table\t= tw_pci_tbl,\n\t.probe\t\t= tw_probe,\n\t.remove\t\t= tw_remove,\n\t.shutdown\t= tw_shutdown,\n};\n\n/* This function is called on driver initialization */\nstatic int __init tw_init(void)\n{\n\tprintk(KERN_WARNING \"3ware Storage Controller device driver for Linux v%s.\\n\", TW_DRIVER_VERSION);\n\n\treturn pci_register_driver(&tw_driver);\n} /* End tw_init() */\n\n/* This function is called on driver exit */\nstatic void __exit tw_exit(void)\n{\n\tpci_unregister_driver(&tw_driver);\n} /* End tw_exit() */\n\nmodule_init(tw_init);\nmodule_exit(tw_exit);\n\n"} {"text": "HTTP/1.1 200 OK\n\n\n\n \n \n\n\n"} {"text": "PLATFORM := x86-64-accton-asgvolt64\ninclude $(ONL)/packages/base/any/onlp/builds/platform/libonlp-platform.mk\n"} {"text": "# This file is distributed under the same license as the Django package.\n#\n# Translators:\n# Martijn Dekker , 2012.\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Django\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2012-10-22 09:28+0200\\n\"\n\"PO-Revision-Date: 2012-10-22 08:46+0000\\n\"\n\"Last-Translator: Martijn Dekker \\n\"\n\"Language-Team: Interlingua (http://www.transifex.com/projects/p/django/\"\n\"language/ia/)\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"Language: ia\\n\"\n\"Plural-Forms: nplurals=2; plural=(n != 1);\\n\"\n\n#: views.py:58 views.py:60 views.py:62\nmsgid \"tag:\"\nmsgstr \"etiquetta:\"\n\n#: views.py:93 views.py:95 views.py:97\nmsgid \"filter:\"\nmsgstr \"filtro:\"\n\n#: views.py:156 views.py:158 views.py:160\nmsgid \"view:\"\nmsgstr \"visualisation:\"\n\n#: views.py:188\n#, python-format\nmsgid \"App %r not found\"\nmsgstr \"Application %r non trovate\"\n\n#: views.py:195\n#, python-format\nmsgid \"Model %(model_name)r not found in app %(app_label)r\"\nmsgstr \"Modello %(model_name)r non trovate in application %(app_label)r\"\n\n#: views.py:207\n#, python-format\nmsgid \"the related `%(app_label)s.%(data_type)s` object\"\nmsgstr \"le objecto `%(app_label)s.%(data_type)s` connexe\"\n\n#: views.py:207 views.py:226 views.py:231 views.py:245 views.py:259\n#: views.py:264\nmsgid \"model:\"\nmsgstr \"modello:\"\n\n#: views.py:222 views.py:254\n#, python-format\nmsgid \"related `%(app_label)s.%(object_name)s` objects\"\nmsgstr \"objectos `%(app_label)s.%(object_name)s` connexe\"\n\n#: views.py:226 views.py:259\n#, python-format\nmsgid \"all %s\"\nmsgstr \"tote le %s\"\n\n#: views.py:231 views.py:264\n#, python-format\nmsgid \"number of %s\"\nmsgstr \"numero de %s\"\n\n#: views.py:269\n#, python-format\nmsgid \"Fields on %s objects\"\nmsgstr \"Campos sur %s objectos\"\n\n#: views.py:361\n#, python-format\nmsgid \"%s does not appear to be a urlpattern object\"\nmsgstr \"%s non pare esser un objecto urlpattern\"\n\n#: templates/admin_doc/bookmarklets.html:6 templates/admin_doc/index.html:6\n#: templates/admin_doc/missing_docutils.html:6\n#: templates/admin_doc/model_detail.html:14\n#: templates/admin_doc/model_index.html:8\n#: templates/admin_doc/template_detail.html:6\n#: templates/admin_doc/template_filter_index.html:7\n#: templates/admin_doc/template_tag_index.html:7\n#: templates/admin_doc/view_detail.html:6\n#: templates/admin_doc/view_index.html:7\nmsgid \"Home\"\nmsgstr \"Initio\"\n\n#: templates/admin_doc/bookmarklets.html:7 templates/admin_doc/index.html:7\n#: templates/admin_doc/missing_docutils.html:7\n#: templates/admin_doc/model_detail.html:15\n#: templates/admin_doc/model_index.html:9\n#: templates/admin_doc/template_detail.html:7\n#: templates/admin_doc/template_filter_index.html:8\n#: templates/admin_doc/template_tag_index.html:8\n#: templates/admin_doc/view_detail.html:7\n#: templates/admin_doc/view_index.html:8\nmsgid \"Documentation\"\nmsgstr \"Documentation\"\n\n#: templates/admin_doc/bookmarklets.html:8\nmsgid \"Bookmarklets\"\nmsgstr \"Bookmarklets\"\n\n#: templates/admin_doc/bookmarklets.html:11\nmsgid \"Documentation bookmarklets\"\nmsgstr \"Documentation bookmarklets\"\n\n#: templates/admin_doc/bookmarklets.html:15\nmsgid \"\"\n\"\\n\"\n\"

To install bookmarklets, drag the link to your bookmarks\\n\"\n\"toolbar, or right-click the link and add it to your bookmarks. Now you can\\n\"\n\"select the bookmarklet from any page in the site. Note that some of these\\n\"\n\"bookmarklets require you to be viewing the site from a computer designated\\n\"\n\"as \\\"internal\\\" (talk to your system administrator if you aren't sure if\\n\"\n\"your computer is \\\"internal\\\").

\\n\"\nmsgstr \"\"\n\"\\n\"\n\"

Pro installar bookmarklets, trahe le ligamine a tu barra \"\n\"de marcapaginas, o clicca sur le ligamine con le button dextre e adde lo a \"\n\"vostre marcapaginas. Ora vos pote seliger le bookmarklet ab omne pagina in \"\n\"le sito. Nota que alcunes de iste bookmarklets necessita visualisar le sito \"\n\"ab un computer destinate a esser \\\"interne\\\" (contacta vostre administrator \"\n\"de systema si vos non es secur si vostre computator es \\\"interne\\\").

\\n\"\n\n#: templates/admin_doc/bookmarklets.html:25\nmsgid \"Documentation for this page\"\nmsgstr \"Documentation pro iste pagina\"\n\n#: templates/admin_doc/bookmarklets.html:26\nmsgid \"\"\n\"Jumps you from any page to the documentation for the view that generates \"\n\"that page.\"\nmsgstr \"\"\n\"Transporta vos ab omne pagina al documentation pro le visualisation que \"\n\"genera ille pagina.\"\n\n#: templates/admin_doc/bookmarklets.html:28\nmsgid \"Show object ID\"\nmsgstr \"Monstrar le ID del objecto\"\n\n#: templates/admin_doc/bookmarklets.html:29\nmsgid \"\"\n\"Shows the content-type and unique ID for pages that represent a single \"\n\"object.\"\nmsgstr \"\"\n\"Monstrar le typo de contento e le ID unic pro paginas que representa un sol \"\n\"objecto.\"\n\n#: templates/admin_doc/bookmarklets.html:31\nmsgid \"Edit this object (current window)\"\nmsgstr \"Modificar iste objecto (fenestra actual)\"\n\n#: templates/admin_doc/bookmarklets.html:32\nmsgid \"Jumps to the admin page for pages that represent a single object.\"\nmsgstr \"\"\n\"Transporta vos al pagina administrative pro le paginas que representa un sol \"\n\"objecto.\"\n\n#: templates/admin_doc/bookmarklets.html:34\nmsgid \"Edit this object (new window)\"\nmsgstr \"Modificar iste objecto (nove fenestra)\"\n\n#: templates/admin_doc/bookmarklets.html:35\nmsgid \"As above, but opens the admin page in a new window.\"\nmsgstr \"Idem, ma aperi le pagina administrative in un nove fenestra.\"\n\n#: templates/admin_doc/model_detail.html:16\n#: templates/admin_doc/model_index.html:10\nmsgid \"Models\"\nmsgstr \"Modellos\"\n\n#: templates/admin_doc/template_detail.html:8\nmsgid \"Templates\"\nmsgstr \"Patronos\"\n\n#: templates/admin_doc/template_filter_index.html:9\nmsgid \"Filters\"\nmsgstr \"Filtros\"\n\n#: templates/admin_doc/template_tag_index.html:9\nmsgid \"Tags\"\nmsgstr \"Etiquettas\"\n\n#: templates/admin_doc/view_detail.html:8\n#: templates/admin_doc/view_index.html:9\nmsgid \"Views\"\nmsgstr \"Visualisationes\"\n\n#: tests/__init__.py:23\nmsgid \"Boolean (Either True or False)\"\nmsgstr \"Booleano (ver o false)\"\n\n#: tests/__init__.py:33\n#, python-format\nmsgid \"Field of type: %(field_type)s\"\nmsgstr \"Campo de typo: %(field_type)s\"\n"} {"text": "/*\n * Copyright (c) 2002 - 2006 IBM 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 * IBM Corporation - initial API and implementation\n */\npackage com.ibm.wala.ipa.callgraph.impl;\n\nimport com.ibm.wala.classLoader.IClass;\nimport com.ibm.wala.ipa.callgraph.AnalysisOptions;\nimport com.ibm.wala.ipa.callgraph.IAnalysisCacheView;\nimport com.ibm.wala.types.Descriptor;\nimport com.ibm.wala.types.MethodReference;\nimport com.ibm.wala.types.TypeName;\nimport com.ibm.wala.types.TypeReference;\nimport com.ibm.wala.util.strings.Atom;\n\n/** A synthetic method that calls all class initializers */\npublic class FakeWorldClinitMethod extends AbstractRootMethod {\n\n private static final Atom name = Atom.findOrCreateAsciiAtom(\"fakeWorldClinit\");\n\n private static final Descriptor descr =\n Descriptor.findOrCreate(new TypeName[0], TypeReference.VoidName);\n\n public FakeWorldClinitMethod(\n final IClass fakeRootClass, AnalysisOptions options, IAnalysisCacheView cache) {\n super(\n MethodReference.findOrCreate(fakeRootClass.getReference(), name, descr),\n fakeRootClass.getClassHierarchy(),\n options,\n cache);\n }\n}\n"} {"text": "require_relative '../../spec_helper'\n\nplatform_is_not :windows do\n require 'syslog'\n\n describe \"Syslog.ident\" do\n platform_is_not :windows do\n\n before :each do\n Syslog.opened?.should be_false\n end\n\n after :each do\n Syslog.opened?.should be_false\n end\n\n it \"returns the logging identity\" do\n Syslog.open(\"rubyspec\")\n Syslog.ident.should == \"rubyspec\"\n Syslog.close\n end\n\n it \"returns nil if the log is closed\" do\n Syslog.opened?.should == false\n Syslog.ident.should == nil\n end\n\n it \"defaults to $0\" do\n Syslog.open\n Syslog.ident.should == $0\n Syslog.close\n end\n end\n end\nend\n"} {"text": "Given an array of integers, find the pair of adjacent elements that has the largest product and return that product.\n\n```js\nfunction adjacentElementsProduct(inputArray) {\n let maxAdjacent = inputArray[0] * inputArray[1];\n\n for (let i = 1; i < inputArray.length - 1; i++) {\n if (getAdjacent(inputArray, i) > maxAdjacent) {\n maxAdjacent = getAdjacent(inputArray, i);\n }\n }\n\n return maxAdjacent;\n}\n\nfunction getAdjacent(inputArray, index) {\n return inputArray[index] * inputArray[index + 1];\n}\n```\n"} {"text": "// @flow\n\nexport type {ScrollIndices} from './types';\n\nexport {default} from './ArrowKeyStepper';\nexport {default as ArrowKeyStepper} from './ArrowKeyStepper';\n"} {"text": "####################################################################\r\n## script to create a database which exercises all known MySql types\r\n####################################################################\r\n\r\nDROP DATABASE IF EXISTS `AllTypes`;\r\n\r\nCREATE DATABASE `AllTypes`;\r\n\r\nUSE `AllTypes`;\r\n\r\nGRANT ALL ON AllTypes.* TO 'LinqUser'@'%';\r\nFLUSH PRIVILEGES;\r\n\r\n####################################################################\r\nCREATE TABLE `AllIntTypes` (\r\n `int` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,\r\n `intN` INTEGER UNSIGNED,\r\n `boolean` BOOLEAN NOT NULL DEFAULT 0,\r\n `boolN` BOOLEAN,\r\n `byte` TINYINT UNSIGNED NOT NULL DEFAULT 0,\r\n `byteN` TINYINT UNSIGNED,\r\n `short` MEDIUMINT UNSIGNED NOT NULL DEFAULT 0,\r\n `shortN` MEDIUMINT UNSIGNED NULL,\r\n `smallInt` SMALLINT UNSIGNED NOT NULL DEFAULT 0,\r\n `smallIntN` SMALLINT UNSIGNED,\r\n `tinyIntU` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,\r\n `tinyIntUN` TINYINT(1) UNSIGNED NULL DEFAULT 0,\r\n `tinyIntS` TINYINT(1) SIGNED DEFAULT 0,\r\n `bigInt` BIGINT NOT NULL,\r\n `bigIntN` BIGINT NULL,\r\n `DbLinq_EnumTest` SMALLINT UNSIGNED NOT NULL,\r\n PRIMARY KEY(`int`)\r\n)\r\nENGINE = InnoDB\r\nCOMMENT = 'Tests mapping of many MySQL types to CSharp types';\r\n\r\n####################################################################\r\nCREATE TABLE `FloatTypes` (\r\n `id1` INTEGER NOT NULL AUTO_INCREMENT,\r\n `double` DOUBLE NOT NULL DEFAULT 0,\r\n `doubleN` DOUBLE,\r\n `decimal` DECIMAL NOT NULL DEFAULT 0,\r\n `decimalN` DECIMAL,\r\n `float` FLOAT NOT NULL DEFAULT 0,\r\n `floatN` FLOAT,\r\n `numeric` NUMERIC NOT NULL DEFAULT 0,\r\n `numericN` NUMERIC,\r\n `real` REAL NOT NULL DEFAULT 0,\r\n `realN` REAL,\r\n PRIMARY KEY(`id1`)\r\n)\r\nENGINE = InnoDB\r\nCOMMENT = 'Tests mapping of many MySQL types to CSharp types';\r\n\r\n\r\n####################################################################\r\nCREATE TABLE `OtherTypes` (\r\n `id1` INTEGER NOT NULL AUTO_INCREMENT,\r\n `blob` BLOB NOT NULL,\r\n `blobN` BLOB,\r\n `DateTime` DATETIME NOT NULL DEFAULT 0,\r\n `DateTimeN` DATETIME,\r\n `char` CHAR NOT NULL DEFAULT '',\r\n `charN` CHAR,\r\n `text` TEXT NOT NULL,\r\n `textN` TEXT,\r\n `rainbow` ENUM ('red', 'orange', 'yellow') NOT NULL,\r\n `DbLinq_guid_test` CHAR(36),\r\n `DbLinq_guid_test2` BINARY(16) NOT NULL,\r\n PRIMARY KEY(`id1`)\r\n)\r\nENGINE = InnoDB\r\nCOMMENT = 'Tests mapping of many MySQL types to CSharp types';\r\n\r\n####################################################################\r\nCREATE TABLE ParsingData (\r\n id1 INTEGER NOT NULL AUTO_INCREMENT,\r\n dateTimeStr VARCHAR(20),\r\n PRIMARY KEY(id1)\r\n)\r\nENGINE = InnoDB\r\nCOMMENT = 'Tests DateTime.ParseExact on DB varchars';\r\n \r\n\r\nINSERT INTO AllIntTypes (`intN`,`boolean`, `BIGINT`, `byte`, `DbLinq_EnumTest`)\r\nVALUES (1,'2', -9223372036854775808, 7, 2);\r\n\r\nINSERT INTO FloatTypes (`double`,`decimal`,`float`)\r\nVALUES (1.1, 2.2, 3.3);\r\n\r\nINSERT INTO OtherTypes (`blob`,`text`, rainbow, DbLinq_guid_test, DbLinq_guid_test2)\r\nVALUES ( REPEAT(\"\\0\",(8)), 'text', 'red', 'E5F61BB0-38BA-4116-841D-C7E5AAA137A2', REPEAT(\"\\0\\1\",8) );\r\n\r\nINSERT INTO ParsingData (dateTimeStr) VALUES ('2008.12.31');"} {"text": "{\n \"compilerOptions\": {\n \"target\": \"esnext\",\n \"module\": \"esnext\",\n \"moduleResolution\": \"node\",\n \"importHelpers\": true,\n \"jsx\": \"react\",\n \"esModuleInterop\": true,\n \"sourceMap\": true,\n \"baseUrl\": \"./\",\n \"strict\": true,\n \"paths\": {\n \"@/*\": [\"src/*\"],\n \"@@/*\": [\"src/.umi/*\"]\n },\n \"allowSyntheticDefaultImports\": true\n },\n \"exclude\": [\"node_modules\", \"dist\", \"typings\"]\n}\n"} {"text": "\n\n\n\t
\n\t\t

\n\t\t\t批量导入 [{$data.title|default='顶级菜单'}]\n\t\t

\n\t
\n\t\n
\n\t
\n\t\n\t
\n\t\t\n\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t导入格式:标题|url(回车键)
          标题|url
\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t返 回\n\t\t\t\n\t\t\t\n\t\t
\n\t
\n\t
\n
\n
\n\n\n\n\n"} {"text": "/// @ref core\n/// @file glm/detail/func_geometric.inl\n\n#include \"../exponential.hpp\"\n#include \"../common.hpp\"\n#include \"type_vec2.hpp\"\n#include \"type_vec4.hpp\"\n#include \"type_float.hpp\"\n\nnamespace glm{\nnamespace detail\n{\n\ttemplate\n\tstruct compute_length\n\t{\n\t\tGLM_FUNC_QUALIFIER static T call(vec const& v)\n\t\t{\n\t\t\treturn sqrt(dot(v, v));\n\t\t}\n\t};\n\n\ttemplate\n\tstruct compute_distance\n\t{\n\t\tGLM_FUNC_QUALIFIER static T call(vec const& p0, vec const& p1)\n\t\t{\n\t\t\treturn length(p1 - p0);\n\t\t}\n\t};\n\n\ttemplate\n\tstruct compute_dot{};\n\n\ttemplate\n\tstruct compute_dot, T, Aligned>\n\t{\n\t\tGLM_FUNC_QUALIFIER static T call(vec<1, T, Q> const& a, vec<1, T, Q> const& b)\n\t\t{\n\t\t\treturn a.x * b.x;\n\t\t}\n\t};\n\n\ttemplate\n\tstruct compute_dot, T, Aligned>\n\t{\n\t\tGLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& a, vec<2, T, Q> const& b)\n\t\t{\n\t\t\tvec<2, T, Q> tmp(a * b);\n\t\t\treturn tmp.x + tmp.y;\n\t\t}\n\t};\n\n\ttemplate\n\tstruct compute_dot, T, Aligned>\n\t{\n\t\tGLM_FUNC_QUALIFIER static T call(vec<3, T, Q> const& a, vec<3, T, Q> const& b)\n\t\t{\n\t\t\tvec<3, T, Q> tmp(a * b);\n\t\t\treturn tmp.x + tmp.y + tmp.z;\n\t\t}\n\t};\n\n\ttemplate\n\tstruct compute_dot, T, Aligned>\n\t{\n\t\tGLM_FUNC_QUALIFIER static T call(vec<4, T, Q> const& a, vec<4, T, Q> const& b)\n\t\t{\n\t\t\tvec<4, T, Q> tmp(a * b);\n\t\t\treturn (tmp.x + tmp.y) + (tmp.z + tmp.w);\n\t\t}\n\t};\n\n\ttemplate\n\tstruct compute_cross\n\t{\n\t\tGLM_FUNC_QUALIFIER static vec<3, T, Q> call(vec<3, T, Q> const& x, vec<3, T, Q> const& y)\n\t\t{\n\t\t\tGLM_STATIC_ASSERT(std::numeric_limits::is_iec559, \"'cross' accepts only floating-point inputs\");\n\n\t\t\treturn vec<3, T, Q>(\n\t\t\t\tx.y * y.z - y.y * x.z,\n\t\t\t\tx.z * y.x - y.z * x.x,\n\t\t\t\tx.x * y.y - y.x * x.y);\n\t\t}\n\t};\n\n\ttemplate\n\tstruct compute_normalize\n\t{\n\t\tGLM_FUNC_QUALIFIER static vec call(vec const& v)\n\t\t{\n\t\t\tGLM_STATIC_ASSERT(std::numeric_limits::is_iec559, \"'normalize' accepts only floating-point inputs\");\n\n\t\t\treturn v * inversesqrt(dot(v, v));\n\t\t}\n\t};\n\n\ttemplate\n\tstruct compute_faceforward\n\t{\n\t\tGLM_FUNC_QUALIFIER static vec call(vec const& N, vec const& I, vec const& Nref)\n\t\t{\n\t\t\tGLM_STATIC_ASSERT(std::numeric_limits::is_iec559, \"'normalize' accepts only floating-point inputs\");\n\n\t\t\treturn dot(Nref, I) < static_cast(0) ? N : -N;\n\t\t}\n\t};\n\n\ttemplate\n\tstruct compute_reflect\n\t{\n\t\tGLM_FUNC_QUALIFIER static vec call(vec const& I, vec const& N)\n\t\t{\n\t\t\treturn I - N * dot(N, I) * static_cast(2);\n\t\t}\n\t};\n\n\ttemplate\n\tstruct compute_refract\n\t{\n\t\tGLM_FUNC_QUALIFIER static vec call(vec const& I, vec const& N, T eta)\n\t\t{\n\t\t\tT const dotValue(dot(N, I));\n\t\t\tT const k(static_cast(1) - eta * eta * (static_cast(1) - dotValue * dotValue));\n\t\t\treturn (eta * I - (eta * dotValue + std::sqrt(k)) * N) * static_cast(k >= static_cast(0));\n\t\t}\n\t};\n}//namespace detail\n\n\t// length\n\ttemplate\n\tGLM_FUNC_QUALIFIER genType length(genType x)\n\t{\n\t\tGLM_STATIC_ASSERT(std::numeric_limits::is_iec559, \"'length' accepts only floating-point inputs\");\n\n\t\treturn abs(x);\n\t}\n\n\ttemplate\n\tGLM_FUNC_QUALIFIER T length(vec const& v)\n\t{\n\t\tGLM_STATIC_ASSERT(std::numeric_limits::is_iec559, \"'length' accepts only floating-point inputs\");\n\n\t\treturn detail::compute_length::value>::call(v);\n\t}\n\n\t// distance\n\ttemplate\n\tGLM_FUNC_QUALIFIER genType distance(genType const& p0, genType const& p1)\n\t{\n\t\tGLM_STATIC_ASSERT(std::numeric_limits::is_iec559, \"'distance' accepts only floating-point inputs\");\n\n\t\treturn length(p1 - p0);\n\t}\n\n\ttemplate\n\tGLM_FUNC_QUALIFIER T distance(vec const& p0, vec const& p1)\n\t{\n\t\treturn detail::compute_distance::value>::call(p0, p1);\n\t}\n\n\t// dot\n\ttemplate\n\tGLM_FUNC_QUALIFIER T dot(T x, T y)\n\t{\n\t\tGLM_STATIC_ASSERT(std::numeric_limits::is_iec559, \"'dot' accepts only floating-point inputs\");\n\t\treturn x * y;\n\t}\n\n\ttemplate\n\tGLM_FUNC_QUALIFIER T dot(vec const& x, vec const& y)\n\t{\n\t\tGLM_STATIC_ASSERT(std::numeric_limits::is_iec559, \"'dot' accepts only floating-point inputs\");\n\t\treturn detail::compute_dot, T, detail::is_aligned::value>::call(x, y);\n\t}\n\n\t// cross\n\ttemplate\n\tGLM_FUNC_QUALIFIER vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y)\n\t{\n\t\treturn detail::compute_cross::value>::call(x, y);\n\t}\n\n\t// normalize\n\ttemplate\n\tGLM_FUNC_QUALIFIER genType normalize(genType const& x)\n\t{\n\t\tGLM_STATIC_ASSERT(std::numeric_limits::is_iec559, \"'normalize' accepts only floating-point inputs\");\n\n\t\treturn x < genType(0) ? genType(-1) : genType(1);\n\t}\n\n\ttemplate\n\tGLM_FUNC_QUALIFIER vec normalize(vec const& x)\n\t{\n\t\tGLM_STATIC_ASSERT(std::numeric_limits::is_iec559, \"'normalize' accepts only floating-point inputs\");\n\n\t\treturn detail::compute_normalize::value>::call(x);\n\t}\n\n\t// faceforward\n\ttemplate\n\tGLM_FUNC_QUALIFIER genType faceforward(genType const& N, genType const& I, genType const& Nref)\n\t{\n\t\treturn dot(Nref, I) < static_cast(0) ? N : -N;\n\t}\n\n\ttemplate\n\tGLM_FUNC_QUALIFIER vec faceforward(vec const& N, vec const& I, vec const& Nref)\n\t{\n\t\treturn detail::compute_faceforward::value>::call(N, I, Nref);\n\t}\n\n\t// reflect\n\ttemplate\n\tGLM_FUNC_QUALIFIER genType reflect(genType const& I, genType const& N)\n\t{\n\t\treturn I - N * dot(N, I) * genType(2);\n\t}\n\n\ttemplate\n\tGLM_FUNC_QUALIFIER vec reflect(vec const& I, vec const& N)\n\t{\n\t\treturn detail::compute_reflect::value>::call(I, N);\n\t}\n\n\t// refract\n\ttemplate\n\tGLM_FUNC_QUALIFIER genType refract(genType const& I, genType const& N, genType eta)\n\t{\n\t\tGLM_STATIC_ASSERT(std::numeric_limits::is_iec559, \"'refract' accepts only floating-point inputs\");\n\t\tgenType const dotValue(dot(N, I));\n\t\tgenType const k(static_cast(1) - eta * eta * (static_cast(1) - dotValue * dotValue));\n\t\treturn (eta * I - (eta * dotValue + sqrt(k)) * N) * static_cast(k >= static_cast(0));\n\t}\n\n\ttemplate\n\tGLM_FUNC_QUALIFIER vec refract(vec const& I, vec const& N, T eta)\n\t{\n\t\tGLM_STATIC_ASSERT(std::numeric_limits::is_iec559, \"'refract' accepts only floating-point inputs\");\n\t\treturn detail::compute_refract::value>::call(I, N, eta);\n\t}\n}//namespace glm\n\n#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS\n#\tinclude \"func_geometric_simd.inl\"\n#endif\n"} {"text": "{\n \"version\": \"1.0.0\",\n \"cells\": [\n {\n \"type\": \"cs\",\n \"input\": \"importFiles [ \\\"../smalldata/iris/iris_wheader.csv\\\" ]\"\n },\n {\n \"type\": \"cs\",\n \"input\": \"setupParse paths: [ \\\"../smalldata/iris/iris_wheader.csv\\\" ]\"\n },\n {\n \"type\": \"cs\",\n \"input\": \"parseFiles\\n paths: [\\\"../smalldata/iris/iris_wheader.csv\\\"]\\n destination_frame: \\\"iris_wheader.hex\\\"\\n parse_type: \\\"CSV\\\"\\n separator: 44\\n number_columns: 5\\n single_quotes: false\\n column_names: [\\\"sepal_len\\\",\\\"sepal_wid\\\",\\\"petal_len\\\",\\\"petal_wid\\\",\\\"class\\\"]\\n column_types: [\\\"Numeric\\\",\\\"Numeric\\\",\\\"Numeric\\\",\\\"Numeric\\\",\\\"Enum\\\"]\\n delete_on_done: true\\n check_header: 1\\n chunk_size: 4194304\"\n },\n {\n \"type\": \"cs\",\n \"input\": \"getFrameSummary \\\"iris_wheader.hex\\\"\"\n },\n {\n \"type\": \"cs\",\n \"input\": \"assist splitFrame, \\\"iris_wheader.hex\\\"\"\n },\n {\n \"type\": \"cs\",\n \"input\": \"splitFrame \\\"iris_wheader.hex\\\", [0.25], [\\\"iris_wheader_test\\\",\\\"iris_wheader_train\\\"], 123456\"\n },\n {\n \"type\": \"cs\",\n \"input\": \"buildModel \\\"glm\\\"\"\n },\n {\n \"type\": \"cs\",\n \"input\": \"buildModel 'glm', {\\\"model_id\\\":\\\"glm-fea3a411-3e2a-401d-8e06-4242b632ccd5\\\",\\\"training_frame\\\":\\\"iris_wheader_train\\\",\\\"validation_frame\\\":\\\"iris_wheader_test\\\",\\\"ignore_const_cols\\\":true,\\\"response_column\\\":\\\"sepal_len\\\",\\\"family\\\":\\\"gaussian\\\",\\\"solver\\\":\\\"IRLSM\\\",\\\"alpha\\\":[0.3],\\\"lambda\\\":[0.002],\\\"lambda_search\\\":false,\\\"standardize\\\":false,\\\"non_negative\\\":false,\\\"score_each_iteration\\\":false,\\\"max_iterations\\\":-1,\\\"link\\\":\\\"family_default\\\",\\\"intercept\\\":true,\\\"objective_epsilon\\\":0.00001,\\\"beta_epsilon\\\":0.0001,\\\"gradient_epsilon\\\":0.0001,\\\"prior\\\":-1,\\\"max_active_predictors\\\":-1}\"\n },\n {\n \"type\": \"cs\",\n \"input\": \"getModel \\\"glm-fea3a411-3e2a-401d-8e06-4242b632ccd5\\\"\"\n },\n {\n \"type\": \"cs\",\n \"input\": \"predict model: \\\"glm-fea3a411-3e2a-401d-8e06-4242b632ccd5\\\"\"\n },\n {\n \"type\": \"cs\",\n \"input\": \"predict model: \\\"glm-fea3a411-3e2a-401d-8e06-4242b632ccd5\\\", frame: \\\"iris_wheader_test\\\", predictions_frame: \\\"prediction-f9a4c850-f098-4dc5-93ff-febe15746a46\\\"\"\n }\n ]\n}"} {"text": "// Copyright 2018 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// Package buildssa defines an Analyzer that constructs the SSA\n// representation of an error-free package and returns the set of all\n// functions within it. It does not report any diagnostics itself but\n// may be used as an input to other analyzers.\n//\n// THIS INTERFACE IS EXPERIMENTAL AND MAY BE SUBJECT TO INCOMPATIBLE CHANGE.\npackage buildssa\n\nimport (\n\t\"go/ast\"\n\t\"go/types\"\n\t\"reflect\"\n\n\t\"golang.org/x/tools/go/analysis\"\n\t\"golang.org/x/tools/go/ssa\"\n)\n\nvar Analyzer = &analysis.Analyzer{\n\tName: \"buildssa\",\n\tDoc: \"build SSA-form IR for later passes\",\n\tRun: run,\n\tResultType: reflect.TypeOf(new(SSA)),\n}\n\n// SSA provides SSA-form intermediate representation for all the\n// non-blank source functions in the current package.\ntype SSA struct {\n\tPkg *ssa.Package\n\tSrcFuncs []*ssa.Function\n}\n\nfunc run(pass *analysis.Pass) (interface{}, error) {\n\t// Plundered from ssautil.BuildPackage.\n\n\t// We must create a new Program for each Package because the\n\t// analysis API provides no place to hang a Program shared by\n\t// all Packages. Consequently, SSA Packages and Functions do not\n\t// have a canonical representation across an analysis session of\n\t// multiple packages. This is unlikely to be a problem in\n\t// practice because the analysis API essentially forces all\n\t// packages to be analysed independently, so any given call to\n\t// Analysis.Run on a package will see only SSA objects belonging\n\t// to a single Program.\n\n\t// Some Analyzers may need GlobalDebug, in which case we'll have\n\t// to set it globally, but let's wait till we need it.\n\tmode := ssa.BuilderMode(0)\n\n\tprog := ssa.NewProgram(pass.Fset, mode)\n\n\t// Create SSA packages for all imports.\n\t// Order is not significant.\n\tcreated := make(map[*types.Package]bool)\n\tvar createAll func(pkgs []*types.Package)\n\tcreateAll = func(pkgs []*types.Package) {\n\t\tfor _, p := range pkgs {\n\t\t\tif !created[p] {\n\t\t\t\tcreated[p] = true\n\t\t\t\tprog.CreatePackage(p, nil, nil, true)\n\t\t\t\tcreateAll(p.Imports())\n\t\t\t}\n\t\t}\n\t}\n\tcreateAll(pass.Pkg.Imports())\n\n\t// Create and build the primary package.\n\tssapkg := prog.CreatePackage(pass.Pkg, pass.Files, pass.TypesInfo, false)\n\tssapkg.Build()\n\n\t// Compute list of source functions, including literals,\n\t// in source order.\n\tvar funcs []*ssa.Function\n\tfor _, f := range pass.Files {\n\t\tfor _, decl := range f.Decls {\n\t\t\tif fdecl, ok := decl.(*ast.FuncDecl); ok {\n\n\t\t\t\t// SSA will not build a Function\n\t\t\t\t// for a FuncDecl named blank.\n\t\t\t\t// That's arguably too strict but\n\t\t\t\t// relaxing it would break uniqueness of\n\t\t\t\t// names of package members.\n\t\t\t\tif fdecl.Name.Name == \"_\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// (init functions have distinct Func\n\t\t\t\t// objects named \"init\" and distinct\n\t\t\t\t// ssa.Functions named \"init#1\", ...)\n\n\t\t\t\tfn := pass.TypesInfo.Defs[fdecl.Name].(*types.Func)\n\t\t\t\tif fn == nil {\n\t\t\t\t\tpanic(fn)\n\t\t\t\t}\n\n\t\t\t\tf := ssapkg.Prog.FuncValue(fn)\n\t\t\t\tif f == nil {\n\t\t\t\t\tpanic(fn)\n\t\t\t\t}\n\n\t\t\t\tvar addAnons func(f *ssa.Function)\n\t\t\t\taddAnons = func(f *ssa.Function) {\n\t\t\t\t\tfuncs = append(funcs, f)\n\t\t\t\t\tfor _, anon := range f.AnonFuncs {\n\t\t\t\t\t\taddAnons(anon)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\taddAnons(f)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &SSA{Pkg: ssapkg, SrcFuncs: funcs}, nil\n}\n"} {"text": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!1 &1280514025168862034\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: 3173096996506704711}\n - component: {fileID: 6892711146562227269}\n - component: {fileID: 5287945060474684853}\n - component: {fileID: 5250466977172080201}\n - component: {fileID: 247113525463523334}\n - component: {fileID: 5685114479465610878}\n m_Layer: 9\n m_Name: Interactive\n m_TagString: Untagged\n m_Icon: {fileID: 0}\n m_NavMeshLayer: 0\n m_StaticEditorFlags: 0\n m_IsActive: 1\n--- !u!4 &3173096996506704711\nTransform:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 1280514025168862034}\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: 3999544795325332812}\n m_RootOrder: 0\n m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n--- !u!135 &6892711146562227269\nSphereCollider:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 1280514025168862034}\n m_Material: {fileID: 0}\n m_IsTrigger: 1\n m_Enabled: 1\n serializedVersion: 2\n m_Radius: 0.2\n m_Center: {x: 0, y: 0, z: 0}\n--- !u!114 &5287945060474684853\nMonoBehaviour:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 1280514025168862034}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: 11500000, guid: 70debdc38b7c8e8499334b4bb499ff83, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n OnInteract:\n - {fileID: 1363049396738489863}\n - {fileID: 5685114479465610878}\n MaxDistance: 5\n OnHoverIn:\n - {fileID: 247113525463523334}\n - {fileID: 3884817871706047487}\n OnHoverOut:\n - {fileID: 5250466977172080201}\n--- !u!114 &5250466977172080201\nMonoBehaviour:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 1280514025168862034}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: 11500000, guid: f78535f6bcf4e134fba8e5bdaadcf1da, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n Name: 'VFX ARUI-Hover = False '\n visualEffect: {fileID: 7134091276119853856}\n property: ARUI-Hover\n Override: 1\n dataType: 0\n BoolValue: 0\n FloatValue: 0\n Vector2Value: {x: 0, y: 0}\n Vector3Value: {x: 0, y: 0, z: 0}\n Vector4Value: {x: 0, y: 0, z: 0, w: 0}\n Texture2DValue: {fileID: 0}\n Texture3DValue: {fileID: 0}\n UIntValue: 0\n IntValue: 0\n--- !u!114 &247113525463523334\nMonoBehaviour:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 1280514025168862034}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: 11500000, guid: f78535f6bcf4e134fba8e5bdaadcf1da, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n Name: VFX ARUI-Hover = True\n visualEffect: {fileID: 7134091276119853856}\n property: ARUI-Hover\n Override: 1\n dataType: 0\n BoolValue: 1\n FloatValue: 0\n Vector2Value: {x: 0, y: 0}\n Vector3Value: {x: 0, y: 0, z: 0}\n Vector4Value: {x: 0, y: 0, z: 0, w: 0}\n Texture2DValue: {fileID: 0}\n Texture3DValue: {fileID: 0}\n UIntValue: 0\n IntValue: 0\n--- !u!114 &5685114479465610878\nMonoBehaviour:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 1280514025168862034}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: 11500000, guid: 846d5f33f7af4014ea15adf7a92dc953, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n Name: Disable Highlight\n Targets:\n - GameObject: {fileID: 2889974624162614199}\n State: 0\n--- !u!1 &2889974624162614199\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: 8117853888319312732}\n - component: {fileID: 1523985402491027206}\n - component: {fileID: 2092198507462036155}\n m_Layer: 0\n m_Name: Highlight\n m_TagString: Untagged\n m_Icon: {fileID: 0}\n m_NavMeshLayer: 0\n m_StaticEditorFlags: 0\n m_IsActive: 1\n--- !u!4 &8117853888319312732\nTransform:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 2889974624162614199}\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: 3999544795325332812}\n m_RootOrder: 3\n m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n--- !u!2083052967 &1523985402491027206\nVisualEffect:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 2889974624162614199}\n m_Enabled: 1\n m_Asset: {fileID: 8926484042661614526, guid: a6da47e691fd76d43a13eda07ff1a63e, type: 3}\n m_InitialEventName: OnPlay\n m_InitialEventNameOverriden: 0\n m_StartSeed: 0\n m_ResetSeedOnPlay: 1\n m_PropertySheet:\n m_Float:\n m_Array:\n - m_Value: 0.22\n m_Name: Radius\n m_Overridden: 1\n - m_Value: 1.5\n m_Name: CheckDistance\n m_Overridden: 1\n m_Vector2f:\n m_Array: []\n m_Vector3f:\n m_Array: []\n m_Vector4f:\n m_Array: []\n m_Uint:\n m_Array: []\n m_Int:\n m_Array: []\n m_Matrix4x4f:\n m_Array: []\n m_AnimationCurve:\n m_Array: []\n m_Gradient:\n m_Array: []\n m_NamedObject:\n m_Array: []\n m_Bool:\n m_Array: []\n--- !u!73398921 &2092198507462036155\nVFXRenderer:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 2889974624162614199}\n m_Enabled: 1\n m_CastShadows: 0\n m_ReceiveShadows: 0\n m_DynamicOccludee: 1\n m_MotionVectors: 0\n m_LightProbeUsage: 0\n m_ReflectionProbeUsage: 0\n m_RayTracingMode: 0\n m_RenderingLayerMask: 1\n m_RendererPriority: 0\n m_Materials:\n - {fileID: 0}\n m_StaticBatchInfo:\n firstSubMesh: 0\n subMeshCount: 0\n m_StaticBatchRoot: {fileID: 0}\n m_ProbeAnchor: {fileID: 0}\n m_LightProbeVolumeOverride: {fileID: 0}\n m_ScaleInLightmap: 1\n m_ReceiveGI: 1\n m_PreserveUVs: 0\n m_IgnoreNormalsForChartDetection: 0\n m_ImportantGI: 0\n m_StitchLightmapSeams: 1\n m_SelectedEditorRenderState: 3\n m_MinimumChartSize: 4\n m_AutoUVMaxDistance: 0.5\n m_AutoUVMaxAngle: 89\n m_LightmapParameters: {fileID: 0}\n m_SortingLayerID: 0\n m_SortingLayer: 0\n m_SortingOrder: 0\n--- !u!1 &3386493105140817582\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: 6456437248210268453}\n - component: {fileID: 3884817871706047487}\n - component: {fileID: 7054907629668396193}\n m_Layer: 0\n m_Name: Hover SFX\n m_TagString: Untagged\n m_Icon: {fileID: 0}\n m_NavMeshLayer: 0\n m_StaticEditorFlags: 0\n m_IsActive: 1\n--- !u!4 &6456437248210268453\nTransform:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 3386493105140817582}\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: 3999544795325332812}\n m_RootOrder: 1\n m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n--- !u!114 &3884817871706047487\nMonoBehaviour:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 3386493105140817582}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: 11500000, guid: d0e98867b2173494983582dfb1a01d0b, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n Name: Play Hover SFX\n OnExecute:\n m_PersistentCalls:\n m_Calls:\n - m_Target: {fileID: 7054907629668396193}\n m_MethodName: Play\n m_Mode: 1\n m_Arguments:\n m_ObjectArgument: {fileID: 0}\n m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine\n m_IntArgument: 0\n m_FloatArgument: 0\n m_StringArgument: \n m_BoolArgument: 0\n m_CallState: 2\n--- !u!82 &7054907629668396193\nAudioSource:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 3386493105140817582}\n m_Enabled: 1\n serializedVersion: 4\n OutputAudioMixerGroup: {fileID: 430732677433856307, guid: 6ba17f8357488334ab441a3007933556,\n type: 2}\n m_audioClip: {fileID: 8300000, guid: 94cb21dffe1bdc544a4fa7fc1fd6afc6, type: 3}\n m_PlayOnAwake: 0\n m_Volume: 1\n m_Pitch: 1\n Loop: 0\n Mute: 0\n Spatialize: 0\n SpatializePostEffects: 0\n Priority: 128\n DopplerLevel: 1\n MinDistance: 1\n MaxDistance: 500\n Pan2D: 0\n rolloffMode: 0\n BypassEffects: 0\n BypassListenerEffects: 0\n BypassReverbZones: 0\n rolloffCustomCurve:\n serializedVersion: 2\n m_Curve:\n - serializedVersion: 3\n time: 0\n value: 1\n inSlope: 0\n outSlope: 0\n tangentMode: 0\n weightedMode: 0\n inWeight: 0.33333334\n outWeight: 0.33333334\n - serializedVersion: 3\n time: 1\n value: 0\n inSlope: 0\n outSlope: 0\n tangentMode: 0\n weightedMode: 0\n inWeight: 0.33333334\n outWeight: 0.33333334\n m_PreInfinity: 2\n m_PostInfinity: 2\n m_RotationOrder: 4\n panLevelCustomCurve:\n serializedVersion: 2\n m_Curve:\n - serializedVersion: 3\n time: 0\n value: 0\n inSlope: 0\n outSlope: 0\n tangentMode: 0\n weightedMode: 0\n inWeight: 0.33333334\n outWeight: 0.33333334\n m_PreInfinity: 2\n m_PostInfinity: 2\n m_RotationOrder: 4\n spreadCustomCurve:\n serializedVersion: 2\n m_Curve:\n - serializedVersion: 3\n time: 0\n value: 0\n inSlope: 0\n outSlope: 0\n tangentMode: 0\n weightedMode: 0\n inWeight: 0.33333334\n outWeight: 0.33333334\n m_PreInfinity: 2\n m_PostInfinity: 2\n m_RotationOrder: 4\n reverbZoneMixCustomCurve:\n serializedVersion: 2\n m_Curve:\n - serializedVersion: 3\n time: 0\n value: 1\n inSlope: 0\n outSlope: 0\n tangentMode: 0\n weightedMode: 0\n inWeight: 0.33333334\n outWeight: 0.33333334\n m_PreInfinity: 2\n m_PostInfinity: 2\n m_RotationOrder: 4\n--- !u!1 &3999544795325332815\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: 3999544795325332812}\n - component: {fileID: 7134091276119853856}\n - component: {fileID: 7536699061915691602}\n m_Layer: 0\n m_Name: Target\n m_TagString: Untagged\n m_Icon: {fileID: 7866945982896999795, guid: 0000000000000000d000000000000000, type: 0}\n m_NavMeshLayer: 0\n m_StaticEditorFlags: 0\n m_IsActive: 1\n--- !u!4 &3999544795325332812\nTransform:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 3999544795325332815}\n m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}\n m_LocalPosition: {x: -2.503, y: 0, z: -1.0899999}\n m_LocalScale: {x: 1, y: 1, z: 1}\n m_Children:\n - {fileID: 3173096996506704711}\n - {fileID: 6456437248210268453}\n - {fileID: 1472195841513303902}\n - {fileID: 8117853888319312732}\n m_Father: {fileID: 0}\n m_RootOrder: 0\n m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n--- !u!2083052967 &7134091276119853856\nVisualEffect:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 3999544795325332815}\n m_Enabled: 1\n m_Asset: {fileID: 8926484042661614526, guid: 0dbeb55227748f74ca8971e80fb21dc8, type: 3}\n m_InitialEventName: OnPlay\n m_InitialEventNameOverriden: 0\n m_StartSeed: 0\n m_ResetSeedOnPlay: 1\n m_PropertySheet:\n m_Float:\n m_Array:\n - m_Value: 0.05\n m_Name: Size\n m_Overridden: 1\n m_Vector2f:\n m_Array: []\n m_Vector3f:\n m_Array: []\n m_Vector4f:\n m_Array:\n - m_Value: {x: 0, y: 79.07852, z: 255.99997, w: 1}\n m_Name: Color\n m_Overridden: 1\n m_Uint:\n m_Array: []\n m_Int:\n m_Array: []\n m_Matrix4x4f:\n m_Array: []\n m_AnimationCurve:\n m_Array: []\n m_Gradient:\n m_Array: []\n m_NamedObject:\n m_Array: []\n m_Bool:\n m_Array:\n - m_Value: 1\n m_Name: ARUI-Hover\n m_Overridden: 0\n--- !u!73398921 &7536699061915691602\nVFXRenderer:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 3999544795325332815}\n m_Enabled: 1\n m_CastShadows: 0\n m_ReceiveShadows: 0\n m_DynamicOccludee: 1\n m_MotionVectors: 1\n m_LightProbeUsage: 0\n m_ReflectionProbeUsage: 0\n m_RayTracingMode: 0\n m_RenderingLayerMask: 1\n m_RendererPriority: 1\n m_Materials:\n - {fileID: 0}\n - {fileID: 0}\n - {fileID: 0}\n - {fileID: 0}\n - {fileID: 0}\n - {fileID: 0}\n - {fileID: 0}\n m_StaticBatchInfo:\n firstSubMesh: 0\n subMeshCount: 0\n m_StaticBatchRoot: {fileID: 0}\n m_ProbeAnchor: {fileID: 0}\n m_LightProbeVolumeOverride: {fileID: 0}\n m_ScaleInLightmap: 1\n m_ReceiveGI: 1\n m_PreserveUVs: 0\n m_IgnoreNormalsForChartDetection: 0\n m_ImportantGI: 0\n m_StitchLightmapSeams: 1\n m_SelectedEditorRenderState: 3\n m_MinimumChartSize: 4\n m_AutoUVMaxDistance: 0.5\n m_AutoUVMaxAngle: 89\n m_LightmapParameters: {fileID: 0}\n m_SortingLayerID: 0\n m_SortingLayer: 0\n m_SortingOrder: 0\n--- !u!1 &9041848837367187887\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: 1472195841513303902}\n - component: {fileID: 1363049396738489863}\n - component: {fileID: 8694034831394248087}\n m_Layer: 0\n m_Name: Enter SFX\n m_TagString: Untagged\n m_Icon: {fileID: 0}\n m_NavMeshLayer: 0\n m_StaticEditorFlags: 0\n m_IsActive: 1\n--- !u!4 &1472195841513303902\nTransform:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 9041848837367187887}\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: 3999544795325332812}\n m_RootOrder: 2\n m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n--- !u!114 &1363049396738489863\nMonoBehaviour:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 9041848837367187887}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: 11500000, guid: d0e98867b2173494983582dfb1a01d0b, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n Name: Play Enter SFX\n OnExecute:\n m_PersistentCalls:\n m_Calls:\n - m_Target: {fileID: 8694034831394248087}\n m_MethodName: Play\n m_Mode: 1\n m_Arguments:\n m_ObjectArgument: {fileID: 0}\n m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine\n m_IntArgument: 0\n m_FloatArgument: 0\n m_StringArgument: \n m_BoolArgument: 0\n m_CallState: 2\n--- !u!82 &8694034831394248087\nAudioSource:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 9041848837367187887}\n m_Enabled: 1\n serializedVersion: 4\n OutputAudioMixerGroup: {fileID: 430732677433856307, guid: 6ba17f8357488334ab441a3007933556,\n type: 2}\n m_audioClip: {fileID: 8300000, guid: b2864874c063319499582b707a835c30, type: 3}\n m_PlayOnAwake: 0\n m_Volume: 1\n m_Pitch: 1\n Loop: 0\n Mute: 0\n Spatialize: 0\n SpatializePostEffects: 0\n Priority: 128\n DopplerLevel: 1\n MinDistance: 1\n MaxDistance: 500\n Pan2D: 0\n rolloffMode: 0\n BypassEffects: 0\n BypassListenerEffects: 0\n BypassReverbZones: 0\n rolloffCustomCurve:\n serializedVersion: 2\n m_Curve:\n - serializedVersion: 3\n time: 0\n value: 1\n inSlope: 0\n outSlope: 0\n tangentMode: 0\n weightedMode: 0\n inWeight: 0.33333334\n outWeight: 0.33333334\n - serializedVersion: 3\n time: 1\n value: 0\n inSlope: 0\n outSlope: 0\n tangentMode: 0\n weightedMode: 0\n inWeight: 0.33333334\n outWeight: 0.33333334\n m_PreInfinity: 2\n m_PostInfinity: 2\n m_RotationOrder: 4\n panLevelCustomCurve:\n serializedVersion: 2\n m_Curve:\n - serializedVersion: 3\n time: 0\n value: 0\n inSlope: 0\n outSlope: 0\n tangentMode: 0\n weightedMode: 0\n inWeight: 0.33333334\n outWeight: 0.33333334\n m_PreInfinity: 2\n m_PostInfinity: 2\n m_RotationOrder: 4\n spreadCustomCurve:\n serializedVersion: 2\n m_Curve:\n - serializedVersion: 3\n time: 0\n value: 0\n inSlope: 0\n outSlope: 0\n tangentMode: 0\n weightedMode: 0\n inWeight: 0.33333334\n outWeight: 0.33333334\n m_PreInfinity: 2\n m_PostInfinity: 2\n m_RotationOrder: 4\n reverbZoneMixCustomCurve:\n serializedVersion: 2\n m_Curve:\n - serializedVersion: 3\n time: 0\n value: 1\n inSlope: 0\n outSlope: 0\n tangentMode: 0\n weightedMode: 0\n inWeight: 0.33333334\n outWeight: 0.33333334\n m_PreInfinity: 2\n m_PostInfinity: 2\n m_RotationOrder: 4\n"} {"text": "/*\n * Copyright (c) 2016 The WebRTC 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\n#include \"modules/rtp_rtcp/source/rtcp_packet/tmmbr.h\"\n\n#include \"modules/rtp_rtcp/source/byte_io.h\"\n#include \"modules/rtp_rtcp/source/rtcp_packet/common_header.h\"\n#include \"rtc_base/checks.h\"\n#include \"rtc_base/logging.h\"\n\nnamespace webrtc {\nnamespace rtcp {\nconstexpr uint8_t Tmmbr::kFeedbackMessageType;\n// RFC 4585: Feedback format.\n// Common packet format:\n//\n// 0 1 2 3\n// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n// |V=2|P| FMT | PT | length |\n// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n// | SSRC of packet sender |\n// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n// | SSRC of media source (unused) = 0 |\n// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n// : Feedback Control Information (FCI) :\n// : :\n// Temporary Maximum Media Stream Bit Rate Request (TMMBR) (RFC 5104).\n// The Feedback Control Information (FCI) for the TMMBR\n// consists of one or more FCI entries.\n// FCI:\n// 0 1 2 3\n// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n// | SSRC |\n// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n// | MxTBR Exp | MxTBR Mantissa |Measured Overhead|\n// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\nTmmbr::Tmmbr() = default;\n\nTmmbr::~Tmmbr() = default;\n\nbool Tmmbr::Parse(const CommonHeader& packet) {\n RTC_DCHECK_EQ(packet.type(), kPacketType);\n RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType);\n\n if (packet.payload_size_bytes() < kCommonFeedbackLength + TmmbItem::kLength) {\n RTC_LOG(LS_WARNING) << \"Payload length \" << packet.payload_size_bytes()\n << \" is too small for a TMMBR.\";\n return false;\n }\n size_t items_size_bytes = packet.payload_size_bytes() - kCommonFeedbackLength;\n if (items_size_bytes % TmmbItem::kLength != 0) {\n RTC_LOG(LS_WARNING) << \"Payload length \" << packet.payload_size_bytes()\n << \" is not valid for a TMMBR.\";\n return false;\n }\n ParseCommonFeedback(packet.payload());\n\n const uint8_t* next_item = packet.payload() + kCommonFeedbackLength;\n size_t number_of_items = items_size_bytes / TmmbItem::kLength;\n items_.resize(number_of_items);\n for (TmmbItem& item : items_) {\n if (!item.Parse(next_item))\n return false;\n next_item += TmmbItem::kLength;\n }\n return true;\n}\n\nvoid Tmmbr::AddTmmbr(const TmmbItem& item) {\n items_.push_back(item);\n}\n\nsize_t Tmmbr::BlockLength() const {\n return kHeaderLength + kCommonFeedbackLength +\n TmmbItem::kLength * items_.size();\n}\n\nbool Tmmbr::Create(uint8_t* packet,\n size_t* index,\n size_t max_length,\n PacketReadyCallback callback) const {\n RTC_DCHECK(!items_.empty());\n while (*index + BlockLength() > max_length) {\n if (!OnBufferFull(packet, index, callback))\n return false;\n }\n const size_t index_end = *index + BlockLength();\n\n CreateHeader(kFeedbackMessageType, kPacketType, HeaderLength(), packet,\n index);\n RTC_DCHECK_EQ(0, Rtpfb::media_ssrc());\n CreateCommonFeedback(packet + *index);\n *index += kCommonFeedbackLength;\n for (const TmmbItem& item : items_) {\n item.Create(packet + *index);\n *index += TmmbItem::kLength;\n }\n RTC_CHECK_EQ(index_end, *index);\n return true;\n}\n} // namespace rtcp\n} // namespace webrtc\n"} {"text": "import * as vscode from 'vscode';\n\nimport * as error from '../../error';\nimport * as node from '../node';\n\nexport interface ICloseCommandArguments extends node.ICommandArgs {\n bang?: boolean;\n range?: node.LineRange;\n quitAll?: boolean;\n}\n\n//\n// Implements :close\n// http://vimdoc.sourceforge.net/htmldoc/windows.html#:close\n//\nexport class CloseCommand extends node.CommandBase {\n protected _arguments: ICloseCommandArguments;\n\n constructor(args: ICloseCommandArguments) {\n super();\n this._arguments = args;\n }\n\n get arguments(): ICloseCommandArguments {\n return this._arguments;\n }\n\n async execute(): Promise {\n if (this.activeTextEditor!.document.isDirty && !this.arguments.bang) {\n throw error.VimError.fromCode(error.ErrorCode.NoWriteSinceLastChange);\n }\n\n if (vscode.window.visibleTextEditors.length === 1) {\n throw error.VimError.fromCode(error.ErrorCode.CannotCloseLastWindow);\n }\n\n let oldViewColumn = this.activeTextEditor!.viewColumn;\n await vscode.commands.executeCommand('workbench.action.closeActiveEditor');\n\n if (\n vscode.window.activeTextEditor !== undefined &&\n vscode.window.activeTextEditor.viewColumn === oldViewColumn\n ) {\n await vscode.commands.executeCommand('workbench.action.previousEditor');\n }\n }\n}\n"} {"text": "\n\nwiderface\n44--Aerobics_44_Aerobics_Aerobics_44_216.jpg\n\nwider face Database\nPASCAL VOC2007\nflickr\n-1\n\n\nyanyu\nyanyu\n\n\n1024\n768\n3\n\n0\n\nface\nUnspecified\n1\n0\n\n836\n20\n854\n41\n\n\n\nface\nUnspecified\n1\n0\n\n793\n81\n810\n99\n\n\n\nface\nUnspecified\n1\n0\n\n728\n67\n744\n99\n\n\n\nface\nUnspecified\n1\n0\n\n739\n96\n753\n114\n\n\n\nface\nUnspecified\n1\n0\n\n679\n132\n691\n150\n\n\n\nface\nUnspecified\n1\n0\n\n322\n340\n337\n354\n\n\n\nface\nUnspecified\n1\n0\n\n314\n365\n326\n380\n\n\n\nface\nUnspecified\n1\n0\n\n234\n393\n250\n407\n\n\n\nface\nUnspecified\n1\n0\n\n224\n413\n237\n426\n\n\n\nface\nUnspecified\n1\n0\n\n123\n482\n135\n493\n\n\n\nface\nUnspecified\n1\n0\n\n79\n472\n94\n489\n\n\n\nface\nUnspecified\n1\n0\n\n575\n137\n591\n170\n\n\n\nface\nUnspecified\n1\n0\n\n568\n172\n581\n194\n\n\n\nface\nUnspecified\n1\n0\n\n153\n384\n174\n417\n\n\n\n"} {"text": "
\n

This document will be shown in the selection dialog when your template is highlighted. It must be written using XML and the tags defined by the Eclipse FormText control.

\n

Full HTML syntax is not supported.

\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#pragma mark Named Structures\n\nstruct CGPoint {\n double x;\n double y;\n};\n\nstruct CGRect {\n struct CGPoint origin;\n struct CGSize size;\n};\n\nstruct CGSize {\n double width;\n double height;\n};\n\n"} {"text": "OC.L10N.register(\n \"registration\",\n {\n \"Saved\" : \"Spremljeno\",\n \"Register\" : \"Registriraj se\",\n \"None\" : \"Nema\",\n \"Email\" : \"E-pošta\",\n \"Back to login\" : \"Natrag na prijavu\",\n \"Username\" : \"Korisničko ime\",\n \"Password\" : \"Zaporka\",\n \"Create account\" : \"Stvori račun\",\n \"Verify\" : \"Provjeri\"\n},\n\"nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\");\n"} {"text": "{\n \"type\": \"minecraft:crafting_shapeless\",\n \"result\": {\n \"item\": \"mekanism:ingot_lead\",\n \"count\": 9\n },\n \"ingredients\": [\n {\n \"tag\": \"forge:storage_blocks/lead\"\n }\n ]\n}"} {"text": ":107E000001C0B5C0112484B790E89093610010922E\r\n:107E10006100882361F0982F9A70923041F081FFC1\r\n:107E200002C097EF94BF282E80E0C4D0E9C085E05F\r\n:107E30008093810082E08093C00088E18093C1003C\r\n:107E40001092C40086E08093C2008EE0B3D0209AE6\r\n:107E500084E020E93FEF91E0309385002093840097\r\n:107E600096BBB09BFECF189AA8954091C00047FDE5\r\n:107E700002C0815089F792D0813479F48FD0182FC5\r\n:107E80009FD0123829F480E082D080E180D0F3CFF7\r\n:107E900083E01138C9F788E0F7CF823419F484E120\r\n:107EA00097D0F3CF853411F485E0FACF853541F4CE\r\n:107EB00075D0C82F73D0D82FCC0FDD1F81D0E5CF60\r\n:107EC000863519F484E084D0DECF843691F566D00F\r\n:107ED00065D0F82E63D0D82E00E011E058018FEF66\r\n:107EE000A81AB80A5BD0F80180838501FA10F6CF92\r\n:107EF00067D0F5E4DF1201C0FFCF50E040E063E05F\r\n:107F0000CE0135D08E01E0E0F1E06F0182E0C80ED5\r\n:107F1000D11C4081518161E0C80129D00E5F1F4F03\r\n:107F2000F601FC10F2CF50E040E065E0CE011FD03A\r\n:107F3000ACCF843771F432D031D0F82E2FD040D06E\r\n:107F40008E01F80185918F0122D0FA94F110F9CFBA\r\n:107F50009CCF853731F434D08EE119D085E917D024\r\n:107F60009ACF813509F0AACF88E024D0A7CFFC01B1\r\n:107F70000A0167BFE895112407B600FCFDCF6670C3\r\n:107F800029F0452B19F481E187BFE8950895909178\r\n:107F9000C00095FFFCCF8093C60008958091C0007B\r\n:107FA00087FFFCCF8091C00084FD01C0A89580911F\r\n:107FB000C6000895E0E6F0E098E19083808308959C\r\n:107FC000EDDF803219F088E0F5DFFFCF84E1DFCF0D\r\n:0E7FD000CF93C82FE3DFC150E9F7CF91F1CF77\r\n:027FFE00000879\r\n:0400000300007E007B\r\n:00000001FF\r\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.cxf.jaxrs.spring;\n\nimport java.lang.annotation.Annotation;\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.Map;\n\nimport javax.ws.rs.Path;\nimport javax.ws.rs.ext.Provider;\n\nimport org.apache.cxf.common.util.ClasspathScanner;\nimport org.apache.cxf.jaxrs.JAXRSServerFactoryBean;\nimport org.apache.cxf.service.factory.ServiceConstructionException;\nimport org.springframework.beans.factory.annotation.Value;\npublic abstract class AbstractJaxrsClassesScanServer extends AbstractSpringConfigurationFactory {\n @Value(\"${cxf.jaxrs.classes-scan-packages}\")\n private String basePackages;\n\n protected AbstractJaxrsClassesScanServer() {\n\n }\n protected void setJaxrsResources(JAXRSServerFactoryBean factory) {\n try {\n final Map< Class< ? extends Annotation >, Collection< Class< ? > > > classes =\n ClasspathScanner.findClasses(basePackages, Provider.class, Path.class);\n\n List jaxrsServices = JAXRSServerFactoryBeanDefinitionParser\n .createBeansFromDiscoveredClasses(super.applicationContext, classes.get(Path.class), null);\n List jaxrsProviders = JAXRSServerFactoryBeanDefinitionParser\n .createBeansFromDiscoveredClasses(super.applicationContext, classes.get(Provider.class), null);\n\n factory.setServiceBeans(jaxrsServices);\n factory.setProviders(jaxrsProviders);\n } catch (Exception ex) {\n throw new ServiceConstructionException(ex);\n }\n\n }\n\n}\n"} {"text": "// Copyright 2018 The Kubeflow 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 v1\n\nimport (\n\t\"strings\"\n\n\tcommon \"github.com/kubeflow/arena/pkg/operators/tf-operator/apis/common/v1\"\n\tv1 \"k8s.io/api/core/v1\"\n\t\"k8s.io/apimachinery/pkg/runtime\"\n)\n\n// Int32 is a helper routine that allocates a new int32 value\n// to store v and returns a pointer to it.\nfunc Int32(v int32) *int32 {\n\treturn &v\n}\n\nfunc addDefaultingFuncs(scheme *runtime.Scheme) error {\n\treturn RegisterDefaults(scheme)\n}\n\n// setDefaultPort sets the default ports for pytorch container.\nfunc setDefaultPort(spec *v1.PodSpec) {\n\tindex := 0\n\tfor i, container := range spec.Containers {\n\t\tif container.Name == DefaultContainerName {\n\t\t\tindex = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\thasPyTorchJobPort := false\n\tfor _, port := range spec.Containers[index].Ports {\n\t\tif port.Name == DefaultPortName {\n\t\t\thasPyTorchJobPort = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !hasPyTorchJobPort {\n\t\tspec.Containers[index].Ports = append(spec.Containers[index].Ports, v1.ContainerPort{\n\t\t\tName: DefaultPortName,\n\t\t\tContainerPort: DefaultPort,\n\t\t})\n\t}\n}\n\nfunc setDefaultReplicas(spec *common.ReplicaSpec) {\n\tif spec.Replicas == nil {\n\t\tspec.Replicas = Int32(1)\n\t}\n\tif spec.RestartPolicy == \"\" {\n\t\tspec.RestartPolicy = DefaultRestartPolicy\n\t}\n}\n\n// setTypeNamesToCamelCase sets the name of all replica types from any case to correct case.\nfunc setTypeNamesToCamelCase(job *PyTorchJob) {\n\tsetTypeNameToCamelCase(job, PyTorchReplicaTypeMaster)\n\tsetTypeNameToCamelCase(job, PyTorchReplicaTypeWorker)\n}\n\n// setTypeNameToCamelCase sets the name of the replica type from any case to correct case.\nfunc setTypeNameToCamelCase(job *PyTorchJob, typ PyTorchReplicaType) {\n\tfor t := range job.Spec.PyTorchReplicaSpecs {\n\t\tif strings.EqualFold(string(t), string(typ)) && t != typ {\n\t\t\tspec := job.Spec.PyTorchReplicaSpecs[t]\n\t\t\tdelete(job.Spec.PyTorchReplicaSpecs, t)\n\t\t\tjob.Spec.PyTorchReplicaSpecs[typ] = spec\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// SetDefaults_PyTorchJob sets any unspecified values to defaults.\nfunc SetDefaults_PyTorchJob(job *PyTorchJob) {\n\t// Set default cleanpod policy to None.\n\tif job.Spec.CleanPodPolicy == nil {\n\t\tpolicy := common.CleanPodPolicyNone\n\t\tjob.Spec.CleanPodPolicy = &policy\n\t}\n\n\t// Update the key of PyTorchReplicaSpecs to camel case.\n\tsetTypeNamesToCamelCase(job)\n\n\tfor rType, spec := range job.Spec.PyTorchReplicaSpecs {\n\t\t// Set default replicas to 1.\n\t\tsetDefaultReplicas(spec)\n\t\tif rType == PyTorchReplicaTypeMaster {\n\t\t\t// Set default port to pytorch container of Master.\n\t\t\tsetDefaultPort(&spec.Template.Spec)\n\t\t}\n\t}\n}\n"} {"text": "RunAsTI or RunAsTrustedInstaller\n\nIs a tool to launch a program of choice (usually cmd.exe) with the same privileges as the TrustedInstaller. That privilege is very powerfull! Actually the tool makes a clone of the token from TrustedInstaller, and thus the newly created process has an identical token.\n\nWhy would you need it? Sometimes it is just not enough to just be running as \"nt authority\\system\". Maybe it's a file or a registry key that is locked. Running a tool with this powerfull privilege most likely solve that. Usually such an issue may be due to Windows Resource Protection (WRP) protecting it (previously called Windows File Protection (WFP)); http://msdn.microsoft.com/en-us/library/windows/desktop/aa382503(v=vs.85).aspx\n\nHow do you run it? Simply double click it and cmd.exe will launch. Or pass it the program to launch as parameter.\n\nThere are reports that the tool does not work over an RDP session.\n\nThe tool is actually a merge of 2 previous tools; RunAsSystem and RunFromToken. The curious ones might notice that RunFromToken is attached as a resource.\n\nHave added the original source of RunFromToken as the exe's must be present in current directory when building RunAsTi.\n\nThe tool only runs on nt6.x (Vista and later), since TrustedInstaller does not exist on earlier Windows versions.\n\nRequirement: Administrator."} {"text": "using System.Reflection;\r\nusing System.Runtime.CompilerServices;\r\n#if ANDROID\r\nusing Android.App;\r\n#endif\r\n\r\n// Information about this assembly is defined by the following attributes. \r\n// Change them to the values specific to your project.\r\n\r\n[assembly: AssemblyTitle(\"CatapultWarsNet\")]\r\n[assembly: AssemblyDescription(\"\")]\r\n[assembly: AssemblyConfiguration(\"\")]\r\n[assembly: AssemblyCompany(\"\")]\r\n[assembly: AssemblyProduct(\"\")]\r\n[assembly: AssemblyCopyright(\"d_ellis\")]\r\n[assembly: AssemblyTrademark(\"\")]\r\n[assembly: AssemblyCulture(\"\")]\r\n\r\n// The assembly version has the format \"{Major}.{Minor}.{Build}.{Revision}\".\r\n// The form \"{Major}.{Minor}.*\" will automatically update the build and revision,\r\n// and \"{Major}.{Minor}.{Build}.*\" will update just the revision.\r\n\r\n[assembly: AssemblyVersion(\"1.0.0\")]\r\n\r\n// The following attributes are used to specify the signing key for the assembly, \r\n// if desired. See the Mono documentation for more information about signing.\r\n\r\n//[assembly: AssemblyDelaySign(false)]\r\n//[assembly: AssemblyKeyFile(\"\")]\r\n\r\n"} {"text": "'****************************************************************************\n'* Archie Jacobs\n'* Manufacturing Automation, LLC\n'* support@advancedhmi.com\n'* 12-JUN-11\n'*\n'* Copyright 2011 Archie Jacobs\n'*\n'* Distributed under the GNU General Public License (www.gnu.org)\n'*\n'* This program is free software; you can redistribute it and/or\n'* as published by the Free Software Foundation; either version 2\n'* of the License, or (at your option) any later version.\n'*\n'* This program is distributed in the hope that it will be useful,\n'* but WITHOUT ANY WARRANTY; without even the implied warranty of\n'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n'* GNU General Public License for more details.\n\n'* You should have received a copy of the GNU General Public License\n'* along with this program; if not, write to the Free Software\n'* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n'*\n'* 12-JUN-11 Created\n'****************************************************************************\nPublic Class Pipe\n Inherits MfgControl.AdvancedHMI.Controls.Pipe\n\n\n#Region \"Basic Properties\"\n Private SavedBackColor As System.Drawing.Color\n\n '******************************************************************************************\n '* Use the base control's text property and make it visible as a property on the designer\n '******************************************************************************************\n _\n _\nPublic Overrides Property Text() As String\n Get\n Return MyBase.Text\n End Get\n Set(ByVal value As String)\n If (m_Format IsNot Nothing AndAlso (String.Compare(m_Format, \"\") <> 0)) And (Not DesignMode) Then\n Try\n MyBase.Text = _Prefix & (CSng(value) * _ValueScaleFactor).ToString(m_Format) & _Suffix\n Catch ex As Exception\n MyBase.Text = \"Check NumericFormat and variable type\"\n End Try\n Else\n If _ValueScaleFactor = 1 Then\n MyBase.Text = _Prefix & value & _Suffix\n Else\n Try\n MyBase.Text = value * _ValueScaleFactor\n Catch ex As Exception\n DisplayError(\"Scale Factor Error - \" & ex.Message)\n End Try\n End If\n\n '* Highlight in red if an exclamation mark is in text\n If value.IndexOf(_HighlightKeyChar) >= 0 Then\n If MyBase.ForeColor <> _Highlightcolor Then SavedBackColor = MyBase.ForeColor\n MyBase.ForeColor = _Highlightcolor\n Else\n If SavedBackColor <> Nothing Then MyBase.ForeColor = SavedBackColor\n End If\n End If\n End Set\n End Property\n\n '**********************************\n '* Prefix and suffixes to text\n '**********************************\n Private _Prefix As String\n Public Property TextPrefix() As String\n Get\n Return _Prefix\n End Get\n Set(ByVal value As String)\n _Prefix = value\n Invalidate()\n End Set\n End Property\n\n Private _Suffix As String\n Public Property TextSuffix() As String\n Get\n Return _Suffix\n End Get\n Set(ByVal value As String)\n _Suffix = value\n Invalidate()\n End Set\n End Property\n\n\n '***************************************************************\n '* Property - Highlight Color\n '***************************************************************\n Private _Highlightcolor As Drawing.Color = Drawing.Color.Red\n _\n Public Property HighlightColor() As Drawing.Color\n Get\n Return _Highlightcolor\n End Get\n Set(ByVal value As Drawing.Color)\n _Highlightcolor = value\n End Set\n End Property\n\n Private _HighlightKeyChar As String = \"!\"\n _\n Public Property HighlightKeyCharacter() As String\n Get\n Return _HighlightKeyChar\n End Get\n Set(ByVal value As String)\n _HighlightKeyChar = value\n End Set\n End Property\n\n\n Private m_Format As String\n Public Property NumericFormat() As String\n Get\n Return m_Format\n End Get\n Set(ByVal value As String)\n m_Format = value\n End Set\n End Property\n\n Private _ValueScaleFactor As Decimal = 1\n Public Property ScaleFactor() As Decimal\n Get\n Return _ValueScaleFactor\n End Get\n Set(ByVal value As Decimal)\n _ValueScaleFactor = value\n End Set\n End Property\n#End Region\n\n#Region \"PLC Related Properties\"\n '*****************************************************\n '* Property - Component to communicate to PLC through\n '*****************************************************\n Private m_ComComponent As MfgControl.AdvancedHMI.Drivers.IComComponent\n _\n Public Property ComComponent() As MfgControl.AdvancedHMI.Drivers.IComComponent\n Get\n Return m_ComComponent\n End Get\n Set(ByVal value As MfgControl.AdvancedHMI.Drivers.IComComponent)\n If m_ComComponent IsNot value Then\n If SubScriptions IsNot Nothing Then\n SubScriptions.UnsubscribeAll()\n End If\n\n m_ComComponent = value\n\n SubscribeToComDriver()\n End If\n End Set\n End Property\n\n\n Private m_KeypadText As String\n Public Property KeypadText() As String\n Get\n Return m_KeypadText\n End Get\n Set(ByVal value As String)\n m_KeypadText = value\n End Set\n End Property\n\n '*****************************************\n '* Property - Address in PLC to Link to\n '*****************************************\n Private m_PLCAddressText As String = \"\"\n _\n Public Property PLCAddressText() As String\n Get\n Return m_PLCAddressText\n End Get\n Set(ByVal value As String)\n If m_PLCAddressText <> value Then\n m_PLCAddressText = value\n\n '* When address is changed, re-subscribe to new address\n SubscribeToComDriver()\n End If\n End Set\n End Property\n\n '*****************************************\n '* Property - Address in PLC to Link to\n '*****************************************\n Private m_PLCAddressVisible As String = \"\"\n _\n Public Property PLCAddressVisible() As String\n Get\n Return m_PLCAddressVisible\n End Get\n Set(ByVal value As String)\n If m_PLCAddressVisible <> value Then\n m_PLCAddressVisible = value\n\n '* When address is changed, re-subscribe to new address\n SubscribeToComDriver()\n End If\n End Set\n End Property\n\n '*****************************************\n '* Property - Address in PLC to Write Data To\n '*****************************************\n Private m_PLCAddressKeypad As String = \"\"\n _\n Public Property PLCAddressKeypad() As String\n Get\n Return m_PLCAddressKeypad\n End Get\n Set(ByVal value As String)\n If m_PLCAddressKeypad <> value Then\n m_PLCAddressKeypad = value\n End If\n End Set\n End Property\n\n '*****************************************\n '* Property - Address in PLC to Write Data To\n '*****************************************\n Private m_PLCAddressRotate As String = \"\"\n _\n Public Property PLCAddressRotate() As String\n Get\n Return m_PLCAddressRotate\n End Get\n Set(ByVal value As String)\n If m_PLCAddressRotate <> value Then\n m_PLCAddressRotate = value\n End If\n End Set\n End Property\n\n Private m_SuppressErrorDisplay As Boolean\n _\n Public Property SuppressErrorDisplay As Boolean\n Get\n Return m_SuppressErrorDisplay\n End Get\n Set(value As Boolean)\n m_SuppressErrorDisplay = value\n End Set\n End Property\n#End Region\n\n#Region \"Events\"\n '********************************************************************\n '* When an instance is added to the form, set the comm component\n '* property. If a comm component does not exist, add one to the form\n '********************************************************************\n Protected Overrides Sub OnCreateControl()\n MyBase.OnCreateControl()\n\n If Me.DesignMode Then\n '********************************************************\n '* Search for AdvancedHMIDrivers.IComComponent component in parent form\n '* If one exists, set the client of this component to it\n '********************************************************\n Dim i = 0\n Dim j As Integer = Me.Parent.Site.Container.Components.Count\n While m_ComComponent Is Nothing And i < j\n If Me.Parent.Site.Container.Components(i).GetType.GetInterface(\"IComComponent\") IsNot Nothing Then m_ComComponent = CType(Me.Parent.Site.Container.Components(i), MfgControl.AdvancedHMI.Drivers.IComComponent)\n i += 1\n End While\n\n '************************************************\n '* If no comm component was found, then add one and\n '* point the ComComponent property to it\n '*********************************************\n If m_ComComponent Is Nothing Then\n m_ComComponent = New AdvancedHMIDrivers.EthernetIPforCLXCom(Me.Site.Container)\n End If\n\n\n If DesignMode Then\n If Me.Parent.BackColor = System.Drawing.Color.Black And MyBase.ForeColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.ControlText) Then\n ForeColor = System.Drawing.Color.White\n End If\n End If\n Else\n SubscribeToComDriver()\n End If\n End Sub\n#End Region\n\n#Region \"Constructor/Destructor\"\n '****************************************************************\n '* UserControl overrides dispose to clean up the component list.\n '****************************************************************\n Protected Overrides Sub Dispose(ByVal disposing As Boolean)\n Try\n If disposing Then\n If SubScriptions IsNot Nothing Then\n SubScriptions.dispose()\n End If\n\n If KeypadPopUp IsNot Nothing Then\n KeypadPopUp.Dispose()\n End If\n End If\n Finally\n MyBase.Dispose(disposing)\n End Try\n End Sub\n#End Region\n\n#Region \"Subscribing and PLC data receiving\"\n Private SubScriptions As SubscriptionHandler\n '**************************************************\n '* Subscribe to addresses in the Comm(PLC) Driver\n '**************************************************\n Private Sub SubscribeToComDriver()\n If Not DesignMode And IsHandleCreated Then\n '* Create a subscription handler object\n If SubScriptions Is Nothing Then\n SubScriptions = New SubscriptionHandler\n SubScriptions.Parent = Me\n AddHandler SubScriptions.DisplayError, AddressOf DisplaySubscribeError\n End If\n SubScriptions.ComComponent = m_ComComponent\n\n SubScriptions.subscribeAutoProperties()\n End If\n End Sub\n\n '***************************************\n '* Call backs for returned data\n '***************************************\n Private OriginalText As String\n Private Sub PolledDataReturned(ByVal sender As Object, ByVal e As SubscriptionHandlerEventArgs)\n End Sub\n\n Private Sub DisplaySubscribeError(ByVal sender As Object, ByVal e As MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs)\n DisplayError(e.ErrorMessage)\n End Sub\n#End Region\n\n#Region \"Error Display\"\n '********************************************************\n '* Show an error via the text property for a short time\n '********************************************************\n Private WithEvents ErrorDisplayTime As System.Windows.Forms.Timer\n Private Sub DisplayError(ByVal ErrorMessage As String)\n If Not m_SuppressErrorDisplay Then\n If ErrorDisplayTime Is Nothing Then\n ErrorDisplayTime = New System.Windows.Forms.Timer\n AddHandler ErrorDisplayTime.Tick, AddressOf ErrorDisplay_Tick\n ErrorDisplayTime.Interval = 5000\n End If\n\n '* Save the text to return to\n If Not ErrorDisplayTime.Enabled Then\n OriginalText = Me.Text\n End If\n\n ErrorDisplayTime.Enabled = True\n\n MyBase.Text = ErrorMessage\n End If\n End Sub\n\n\n '**************************************************************************************\n '* Return the text back to its original after displaying the error for a few seconds.\n '**************************************************************************************\n Private Sub ErrorDisplay_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)\n Text = OriginalText\n\n If ErrorDisplayTime IsNot Nothing Then\n ErrorDisplayTime.Enabled = False\n ErrorDisplayTime.Dispose()\n ErrorDisplayTime = Nothing\n End If\n End Sub\n#End Region\n\n#Region \"Keypad popup for data entry\"\n Private WithEvents KeypadPopUp As MfgControl.AdvancedHMI.Controls.Keypad\n\n Private Sub KeypadPopUp_ButtonClick(ByVal sender As Object, ByVal e As MfgControl.AdvancedHMI.Controls.KeyPadEventArgs) Handles KeypadPopUp.ButtonClick\n If e.Key = \"Quit\" Then\n KeypadPopUp.Visible = False\n ElseIf e.Key = \"Enter\" Then\n If m_ComComponent IsNot Nothing And (KeypadPopUp.Value IsNot Nothing AndAlso (String.Compare(KeypadPopUp.Value, \"\") <> 0)) Then\n If ScaleFactor = 1 Then\n m_ComComponent.Write(m_PLCAddressKeypad, KeypadPopUp.Value)\n Else\n m_ComComponent.Write(m_PLCAddressKeypad, KeypadPopUp.Value / ScaleFactor)\n End If\n Else\n DisplayError(\"ComComponent Property not set\")\n End If\n KeypadPopUp.Visible = False\n End If\n End Sub\n\n '***********************************************************\n '* If labeled is clicked, pop up a keypad for data entry\n '***********************************************************\n Private Sub BasicLabelWithEntry_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click\n If m_PLCAddressKeypad IsNot Nothing AndAlso (String.Compare(m_PLCAddressKeypad, \"\") <> 0) And Enabled Then\n If KeypadPopUp Is Nothing Then\n KeypadPopUp = New MfgControl.AdvancedHMI.Controls.Keypad\n End If\n\n KeypadPopUp.Text = m_KeypadText\n KeypadPopUp.Value = \"\"\n KeypadPopUp.StartPosition = Windows.Forms.FormStartPosition.CenterScreen\n KeypadPopUp.TopMost = True\n KeypadPopUp.Show()\n End If\n End Sub\n#End Region\nEnd Class\n"} {"text": "/**\n * OEML - REST API\n * This section will provide necessary information about the `CoinAPI OEML REST API` protocol. This API is also available in the Postman application: https://postman.coinapi.io/ \n *\n * The version of the OpenAPI document: v1\n * Contact: support@coinapi.io\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport * as models from './models';\n\nexport interface ValidationError {\n type?: string;\n\n title?: string;\n\n status?: number;\n\n traceId?: string;\n\n errors?: string;\n\n}\n"} {"text": "MZGenre.Family\n"} {"text": "package aws\n\nimport (\n\t\"io\"\n\t\"sync\"\n)\n\n// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Should\n// only be used with an io.Reader that is also an io.Seeker. Doing so may\n// cause request signature errors, or request body's not sent for GET, HEAD\n// and DELETE HTTP methods.\n//\n// Deprecated: Should only be used with io.ReadSeeker. If using for\n// S3 PutObject to stream content use s3manager.Uploader instead.\nfunc ReadSeekCloser(r io.Reader) ReaderSeekerCloser {\n\treturn ReaderSeekerCloser{r}\n}\n\n// ReaderSeekerCloser represents a reader that can also delegate io.Seeker and\n// io.Closer interfaces to the underlying object if they are available.\ntype ReaderSeekerCloser struct {\n\tr io.Reader\n}\n\n// Read reads from the reader up to size of p. The number of bytes read, and\n// error if it occurred will be returned.\n//\n// If the reader is not an io.Reader zero bytes read, and nil error will be returned.\n//\n// Performs the same functionality as io.Reader Read\nfunc (r ReaderSeekerCloser) Read(p []byte) (int, error) {\n\tswitch t := r.r.(type) {\n\tcase io.Reader:\n\t\treturn t.Read(p)\n\t}\n\treturn 0, nil\n}\n\n// Seek sets the offset for the next Read to offset, interpreted according to\n// whence: 0 means relative to the origin of the file, 1 means relative to the\n// current offset, and 2 means relative to the end. Seek returns the new offset\n// and an error, if any.\n//\n// If the ReaderSeekerCloser is not an io.Seeker nothing will be done.\nfunc (r ReaderSeekerCloser) Seek(offset int64, whence int) (int64, error) {\n\tswitch t := r.r.(type) {\n\tcase io.Seeker:\n\t\treturn t.Seek(offset, whence)\n\t}\n\treturn int64(0), nil\n}\n\n// IsSeeker returns if the underlying reader is also a seeker.\nfunc (r ReaderSeekerCloser) IsSeeker() bool {\n\t_, ok := r.r.(io.Seeker)\n\treturn ok\n}\n\n// Close closes the ReaderSeekerCloser.\n//\n// If the ReaderSeekerCloser is not an io.Closer nothing will be done.\nfunc (r ReaderSeekerCloser) Close() error {\n\tswitch t := r.r.(type) {\n\tcase io.Closer:\n\t\treturn t.Close()\n\t}\n\treturn nil\n}\n\n// A WriteAtBuffer provides a in memory buffer supporting the io.WriterAt interface\n// Can be used with the s3manager.Downloader to download content to a buffer\n// in memory. Safe to use concurrently.\ntype WriteAtBuffer struct {\n\tbuf []byte\n\tm sync.Mutex\n\n\t// GrowthCoeff defines the growth rate of the internal buffer. By\n\t// default, the growth rate is 1, where expanding the internal\n\t// buffer will allocate only enough capacity to fit the new expected\n\t// length.\n\tGrowthCoeff float64\n}\n\n// NewWriteAtBuffer creates a WriteAtBuffer with an internal buffer\n// provided by buf.\nfunc NewWriteAtBuffer(buf []byte) *WriteAtBuffer {\n\treturn &WriteAtBuffer{buf: buf}\n}\n\n// WriteAt writes a slice of bytes to a buffer starting at the position provided\n// The number of bytes written will be returned, or error. Can overwrite previous\n// written slices if the write ats overlap.\nfunc (b *WriteAtBuffer) WriteAt(p []byte, pos int64) (n int, err error) {\n\tpLen := len(p)\n\texpLen := pos + int64(pLen)\n\tb.m.Lock()\n\tdefer b.m.Unlock()\n\tif int64(len(b.buf)) < expLen {\n\t\tif int64(cap(b.buf)) < expLen {\n\t\t\tif b.GrowthCoeff < 1 {\n\t\t\t\tb.GrowthCoeff = 1\n\t\t\t}\n\t\t\tnewBuf := make([]byte, expLen, int64(b.GrowthCoeff*float64(expLen)))\n\t\t\tcopy(newBuf, b.buf)\n\t\t\tb.buf = newBuf\n\t\t}\n\t\tb.buf = b.buf[:expLen]\n\t}\n\tcopy(b.buf[pos:], p)\n\treturn pLen, nil\n}\n\n// Bytes returns a slice of bytes written to the buffer.\nfunc (b *WriteAtBuffer) Bytes() []byte {\n\tb.m.Lock()\n\tdefer b.m.Unlock()\n\treturn b.buf\n}\n"} {"text": "#!/bin/bash\n\n# This is a comment\n\n: '\n This is a comment\n on multiple lines\n'\n\n# VARIABLES\n#\n# A variable is a symbol that represents a quantity that may vary.\n#\n# identifier=value;\n\nage='25' # The value 25 is assigned to variable age\n\n\n\n# BASIC DATA (Bash does not segregate its variables by type, all variables are character strings)\nage='25' # Integer\ntemperature='-3.82' # Real number\nname='Nacho López' # String\nhas_car='true' # Boolean (only two values: true or false)\n\n# NOTE: Depending on context, Bash permits arithmetic operations and comparisons on variables.\n\n# ARITHMETIC OPERATIONS WITH NUMBERS\nx='5'\ny='2'\n\nlet z=x+y # Addition. Result: 7.\nlet z=x-y # Subtraction. Result: 3.\nlet z=x*y # Multiplication. Result: 10.\nz=$(bc -l <<< \"${x}/${y}\") # Division. Result: 2.5.\nlet z=x%y # Modulo (remainder of the integer division). Result: 1.\n\nlet z=z+1 # Increase the value of z by 1. Result: 2.\nlet z=z-1 # Decrease the value of z by 1. Result: 1.\n\nz=$(bc -l <<< \"50 - ${x} * 6 / -0.5\") #\nz=$(bc -l <<< \"(50 - ${x}) * 6 / -0.5\") # The order of operations is as in mathematics\nz=$(bc -l <<< \"(50 - ${x} * 6) / -0.5\") #\n\n# NOTE: Bash does not support floating-point arithmetic, you must delegate to a tool.\n# ADVICE: If you operate with floating-point numbers or the result is a floating-point number, use the 'bc' tool.\n# ADVICE: If you operate with integer numbers and the result is an integer number, use the 'let' tool.\n\n# BASIC OPERATIONS WITH STRINGS\na='GNU/'\nb='Linux'\nc=${a}${b} # Concatenation Result: 'GNU/Linux'.\nd=$(printf %.s${a} {1..3}) # Repetition Result: 'GNU/GNU/GNU/'.\necho ${d}\n\n\n# PRINT VARIABLES ON SCREEN\n\necho 'Hello, world!' # Prints on screen: Hello, world!\necho ${x} # Prints the variable x\n\n# You can print on screen strings and variables\necho 'I have bought' ${x} 'oranges and' ${y} 'lemons.'\n\n\n\n# DATA TYPE CONVERSION\n\n# NOTE: Bash does not support data type conversion because Bash variables are character strings.\n\n\n\n\n\n\n\n\n\n\n\n\n"} {"text": "# Ubuntu upstart file at /etc/init/mongod.conf\n\n# Recommended ulimit values for mongod or mongos\n# See http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings\n#\nlimit fsize unlimited unlimited\nlimit cpu unlimited unlimited\nlimit as unlimited unlimited\nlimit nofile 64000 64000\nlimit rss unlimited unlimited\nlimit nproc 64000 64000\n\nkill timeout 300 # wait 300s between SIGTERM and SIGKILL.\n\npre-start script\n DAEMONUSER=${DAEMONUSER:-mongodb}\n if [ ! -d /var/lib/mongodb ]; then\n mkdir -p /var/lib/mongodb && chown mongodb:mongodb /var/lib/mongodb\n fi\n if [ ! -d /var/log/mongodb ]; then\n mkdir -p /var/log/mongodb && chown mongodb:mongodb /var/log/mongodb\n fi\n touch /var/run/mongodb.pid\n chown $DAEMONUSER /var/run/mongodb.pid\nend script\n\nstart on runlevel [2345]\nstop on runlevel [06]\n\nscript\n ENABLE_MONGOD=\"yes\"\n CONF=/etc/mongod.conf\n DAEMON=/usr/bin/mongod\n DAEMONUSER=${DAEMONUSER:-mongodb}\n DAEMONGROUP=${DAEMONGROUP:-mongodb}\n\n if [ -f /etc/default/mongod ]; then . /etc/default/mongod; fi\n\n # Handle NUMA access to CPUs (SERVER-3574)\n # This verifies the existence of numactl as well as testing that the command works\n NUMACTL_ARGS=\"--interleave=all\"\n if which numactl >/dev/null 2>/dev/null && numactl $NUMACTL_ARGS ls / >/dev/null 2>/dev/null\n then\n NUMACTL=\"$(which numactl) -- $NUMACTL_ARGS\"\n DAEMON_OPTS=${DAEMON_OPTS:-\"--config $CONF\"}\n else\n NUMACTL=\"\"\n DAEMON_OPTS=\"-- \"${DAEMON_OPTS:-\"--config $CONF\"}\n fi\n\n if [ \"x$ENABLE_MONGOD\" = \"xyes\" ]\n then\n exec start-stop-daemon --start \\\n --chuid $DAEMONUSER:$DAEMONGROUP \\\n --pidfile /var/run/mongodb.pid \\\n --make-pidfile \\\n --exec $NUMACTL $DAEMON $DAEMON_OPTS\n fi\nend script\n"} {"text": "/***********************************************************************************************************************\n* DISCLAIMER\n* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No \n* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all \n* applicable laws, including copyright laws. \n* THIS SOFTWARE IS PROVIDED \"AS IS\" AND RENESAS MAKES NO WARRANTIES REGARDING\n* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, \n* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM \n* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES \n* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS \n* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of \n* this software. By using this software, you agree to the additional terms and conditions found by accessing the \n* following link:\n* http://www.renesas.com/disclaimer\n*\n* Copyright (C) 2018 Renesas Electronics Corporation. All rights reserved.\n***********************************************************************************************************************/\n/***********************************************************************************************************************\n* File Name : hwsetup.c\n* Device(s) : RX\n* H/W Platform : GENERIC_RX66T\n* Description : Defines the initialization routines used each time the MCU is restarted.\n***********************************************************************************************************************/\n/***********************************************************************************************************************\n* History : DD.MM.YYYY Version Description\n* : 27.07.2018 1.00 First Release\n* : 31.08.2018 1.01 Corrected execution order for bsp_volsr_initial_configure function.\n* : 28.02.2019 1.02 Fixed coding style.\n* Added the following function.\n* - rom_cache_function_set\n* - rom_cache_noncacheable_area0_set\n* - rom_cache_noncacheable_area1_set\n***********************************************************************************************************************/\n\n\n/***********************************************************************************************************************\nIncludes , \"Project Includes\"\n***********************************************************************************************************************/\n/* I/O Register and board definitions */\n#include \"platform.h\"\n#if BSP_CFG_CONFIGURATOR_SELECT == 1\n#include \"r_cg_macrodriver.h\"\n#endif\n\n/***********************************************************************************************************************\nPrivate global variables and functions\n***********************************************************************************************************************/\n/* When using the user startup program, disable the following code. */\n#if BSP_CFG_STARTUP_DISABLE == 0\n/* ROM cache configuration function declaration */\n#if BSP_CFG_ROM_CACHE_ENABLE == 1\nstatic void rom_cache_function_set(void);\n#if BSP_CFG_NONCACHEABLE_AREA0_ENABLE == 1\nstatic void rom_cache_noncacheable_area0_set(void);\n#endif /* BSP_CFG_NONCACHEABLE_AREA0_ENABLE == 1 */\n#if BSP_CFG_NONCACHEABLE_AREA1_ENABLE == 1\nstatic void rom_cache_noncacheable_area1_set(void);\n#endif /* BSP_CFG_NONCACHEABLE_AREA1_ENABLE == 1 */\n#endif /* BSP_CFG_ROM_CACHE_ENABLE == 1 */\n#endif /* BSP_CFG_STARTUP_DISABLE == 0 */\n\n/* MCU I/O port configuration function declaration */\nstatic void output_ports_configure(void);\n\n/* Interrupt configuration function declaration */\nstatic void interrupts_configure(void);\n\n/* MCU peripheral module configuration function declaration */\nstatic void peripheral_modules_enable(void);\n\n/* VOLSR register initial configuration function declaration */\nstatic void bsp_volsr_initial_configure(void);\n\n\n/***********************************************************************************************************************\n* Function name: hardware_setup\n* Description : Contains setup functions called at device restart\n* Arguments : none\n* Return value : none\n***********************************************************************************************************************/\nvoid hardware_setup(void)\n{\n/* When using the user startup program, disable the following code. */\n#if BSP_CFG_STARTUP_DISABLE == 0\n#if BSP_CFG_ROM_CACHE_ENABLE == 1\n /* Initialize ROM cache function */\n rom_cache_function_set();\n#endif /* BSP_CFG_ROM_CACHE_ENABLE == 1 */\n#endif /* BSP_CFG_STARTUP_DISABLE == 0 */\n\n output_ports_configure();\n interrupts_configure();\n bsp_volsr_initial_configure();\n peripheral_modules_enable();\n bsp_non_existent_port_init();\n} /* End of function hardware_setup() */\n\n/* When using the user startup program, disable the following code. */\n#if BSP_CFG_STARTUP_DISABLE == 0\n#if BSP_CFG_ROM_CACHE_ENABLE == 1\n/***********************************************************************************************************************\n* Function name: rom_cache_function_set\n* Description : Configures the rom cache function.\n* Arguments : none\n* Return value : none\n***********************************************************************************************************************/\nstatic void rom_cache_function_set (void)\n{\n#if BSP_CFG_NONCACHEABLE_AREA0_ENABLE == 1\n rom_cache_noncacheable_area0_set();\n#endif /* BSP_CFG_NONCACHEABLE_AREA0_ENABLE == 1 */\n\n#if BSP_CFG_NONCACHEABLE_AREA1_ENABLE == 1\n rom_cache_noncacheable_area1_set();\n#endif /* BSP_CFG_NONCACHEABLE_AREA1_ENABLE == 1 */\n\n /* Invalidates the contents of the ROM cache. */\n FLASH.ROMCIV.WORD = 0x0001;\n\n /* Enables the ROM cache. */\n FLASH.ROMCE.WORD = 0x0001;\n} /* End of function rom_cache_function_set() */\n\n#if BSP_CFG_NONCACHEABLE_AREA0_ENABLE == 1\n/***********************************************************************************************************************\n* Function name: rom_cache_noncacheable_area0_set\n* Description : Configures non-cacheable area 0 of the ROM cache function.\n* Arguments : none\n* Return value : none\n***********************************************************************************************************************/\nstatic void rom_cache_noncacheable_area0_set (void)\n{\n /* Used to specify the value written to the NCRC0 register. */\n uint32_t tmp_ncrc = 0;\n\n /* Disables the ROM cache. */\n FLASH.ROMCE.WORD = 0x0000;\n\n /* Makes settings to the NCRG0 register. */\n #if (BSP_CFG_NONCACHEABLE_AREA0_ADDR >= 0xFFC00000) \\\n && ((BSP_CFG_NONCACHEABLE_AREA0_ADDR & 0x0000000F) == 0x00000000)\n FLASH.NCRG0 = BSP_CFG_NONCACHEABLE_AREA0_ADDR;\n #else\n #error \"Error! Invalid setting for BSP_CFG_NONCACHEABLE_AREA0_ADDR in r_bsp_config.h\"\n #endif\n\n /* Sets the value of the NCSZ bits. */\n#if BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0x0\n /* Do nothing since NCRC0 bits should be 0. */\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0x1\n tmp_ncrc |= 0x00000010;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0x2\n tmp_ncrc |= 0x00000030;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0x3\n tmp_ncrc |= 0x00000070;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0x4\n tmp_ncrc |= 0x000000F0;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0x5\n tmp_ncrc |= 0x000001F0;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0x6\n tmp_ncrc |= 0x000003F0;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0x7\n tmp_ncrc |= 0x000007F0;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0x8\n tmp_ncrc |= 0x00000FF0;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0x9\n tmp_ncrc |= 0x00001FF0;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0xA\n tmp_ncrc |= 0x00003FF0;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0xB\n tmp_ncrc |= 0x00007FF0;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0xC\n tmp_ncrc |= 0x0000FFF0;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0xD\n tmp_ncrc |= 0x0001FFF0;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0xE\n tmp_ncrc |= 0x0003FFF0;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0xF\n tmp_ncrc |= 0x0007FFF0;\n#elif BSP_CFG_NONCACHEABLE_AREA0_SIZE == 0x10\n tmp_ncrc |= 0x000FFFF0;\n#else\n #error \"Error! Invalid setting for BSP_CFG_NONCACHEABLE_AREA0_SIZE in r_bsp_config.h\"\n#endif\n\n /* Sets the value of the NC1E bits. */\n#if BSP_CFG_NONCACHEABLE_AREA0_IF_ENABLE == 1\n tmp_ncrc |= 0x00000002;\n#endif\n\n /* Sets the value of the NC2E bits. */\n#if BSP_CFG_NONCACHEABLE_AREA0_OA_ENABLE == 1\n tmp_ncrc |= 0x00000004;\n#endif\n\n /* Sets the value of the NC3E bits. */\n#if BSP_CFG_NONCACHEABLE_AREA0_DM_ENABLE == 1\n tmp_ncrc |= 0x00000008;\n#endif\n\n /* Makes settings to the NCRC0 register. */\n FLASH.NCRC0.LONG = tmp_ncrc;\n} /* End of function rom_cache_noncacheable_area0_set() */\n#endif /* BSP_CFG_NONCACHEABLE_AREA0_ENABLE == 1 */\n\n#if BSP_CFG_NONCACHEABLE_AREA1_ENABLE == 1\n/***********************************************************************************************************************\n* Function name: rom_cache_noncacheable_area1_set\n* Description : Configures non-cacheable area 1 of the ROM cache function.\n* Arguments : none\n* Return value : none\n***********************************************************************************************************************/\nstatic void rom_cache_noncacheable_area1_set (void)\n{\n /* Used to specify the value written to the NCRC1 register. */\n uint32_t tmp_ncrc = 0;\n\n /* Disables the ROM cache. */\n FLASH.ROMCE.WORD = 0x0000;\n\n /* Makes settings to the NCRG1 register. */\n #if (BSP_CFG_NONCACHEABLE_AREA1_ADDR >= 0xFFC00000) \\\n && ((BSP_CFG_NONCACHEABLE_AREA1_ADDR & 0x0000000F) == 0x00000000)\n FLASH.NCRG1 = BSP_CFG_NONCACHEABLE_AREA1_ADDR;\n #else\n #error \"Error! Invalid setting for BSP_CFG_NONCACHEABLE_AREA1_ADDR in r_bsp_config.h\"\n #endif\n\n /* Sets the value of the NCSZ bits. */\n#if BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0x0\n /* Do nothing since NCRC1 bits should be 0. */\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0x1\n tmp_ncrc |= 0x00000010;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0x2\n tmp_ncrc |= 0x00000030;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0x3\n tmp_ncrc |= 0x00000070;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0x4\n tmp_ncrc |= 0x000000F0;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0x5\n tmp_ncrc |= 0x000001F0;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0x6\n tmp_ncrc |= 0x000003F0;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0x7\n tmp_ncrc |= 0x000007F0;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0x8\n tmp_ncrc |= 0x00000FF0;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0x9\n tmp_ncrc |= 0x00001FF0;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0xA\n tmp_ncrc |= 0x00003FF0;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0xB\n tmp_ncrc |= 0x00007FF0;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0xC\n tmp_ncrc |= 0x0000FFF0;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0xD\n tmp_ncrc |= 0x0001FFF0;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0xE\n tmp_ncrc |= 0x0003FFF0;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0xF\n tmp_ncrc |= 0x0007FFF0;\n#elif BSP_CFG_NONCACHEABLE_AREA1_SIZE == 0x10\n tmp_ncrc |= 0x000FFFF0;\n#else\n #error \"Error! Invalid setting for BSP_CFG_NONCACHEABLE_AREA1_SIZE in r_bsp_config.h\"\n#endif\n\n /* Sets the value of the NC1E bits. */\n#if BSP_CFG_NONCACHEABLE_AREA1_IF_ENABLE == 1\n tmp_ncrc |= 0x00000002;\n#endif\n\n /* Sets the value of the NC2E bits. */\n#if BSP_CFG_NONCACHEABLE_AREA1_OA_ENABLE == 1\n tmp_ncrc |= 0x00000004;\n#endif\n\n /* Sets the value of the NC3E bits. */\n#if BSP_CFG_NONCACHEABLE_AREA1_DM_ENABLE == 1\n tmp_ncrc |= 0x00000008;\n#endif\n\n /* Makes settings to the NCRC1 register. */\n FLASH.NCRC1.LONG = tmp_ncrc;\n} /* End of function rom_cache_noncacheable_area1_set() */\n#endif /* BSP_CFG_NONCACHEABLE_AREA1_ENABLE == 1 */\n#endif /* BSP_CFG_ROM_CACHE_ENABLE == 1 */\n#endif /* BSP_CFG_STARTUP_DISABLE == 0 */\n\n/***********************************************************************************************************************\n* Function name: output_ports_configure\n* Description : Configures the port and pin direction settings, and sets the pin outputs to a safe level.\n* Arguments : none\n* Return value : none\n***********************************************************************************************************************/\nstatic void output_ports_configure(void)\n{\n /* Add code here to setup additional output ports */\n R_BSP_NOP();\n} /* End of function output_ports_configure() */\n\n/***********************************************************************************************************************\n* Function name: interrupts_configure\n* Description : Configures interrupts used\n* Arguments : none\n* Return value : none\n***********************************************************************************************************************/\nstatic void interrupts_configure(void)\n{\n /* Add code here to setup additional interrupts */\n R_BSP_NOP();\n} /* End of function interrupts_configure() */\n\n/***********************************************************************************************************************\n* Function name: peripheral_modules_enable\n* Description : Enables and configures peripheral devices on the MCU\n* Arguments : none\n* Return value : none\n***********************************************************************************************************************/\nstatic void peripheral_modules_enable(void)\n{\n /* Add code here to enable peripherals used by the application */\n#if BSP_CFG_CONFIGURATOR_SELECT == 1\n /* Smart Configurator initialization function */\n R_Systeminit();\n#endif\n} /* End of function peripheral_modules_enable() */\n\n/***********************************************************************************************************************\n* Function name: bsp_volsr_initial_configure\n* Description : Initializes the VOLSR register.\n* Arguments : none\n* Return value : none\n* Note : none\n***********************************************************************************************************************/\nstatic void bsp_volsr_initial_configure(void)\n{\n /* Used for argument of R_BSP_VoltageLevelSetting function. */\n uint8_t tmp_arg = 0;\n\n /* Set the pattern of the VOLSR(PGAVLS). */\n#if (0xB == BSP_CFG_MCU_PART_FUNCTION) || (0xF == BSP_CFG_MCU_PART_FUNCTION)\n /* Configure for package without PGA diffrential input. */\n tmp_arg = BSP_VOL_AD_NEGATIVE_VOLTAGE_NOINPUT;\n#else\n /* Configure for package with PGA diffrential input. */\n #if (3000 > BSP_CFG_MCU_AVCC_MV) || (5500 < BSP_CFG_MCU_AVCC_MV)\n #error \"Error! Invalid setting for BSP_CFG_MCU_AVCC_MV in r_bsp_config.h\"\n #elif 4000 > BSP_CFG_MCU_AVCC_MV\n tmp_arg = BSP_VOL_AD_NEGATIVE_VOLTAGE_NOINPUT;\n #else\n #if (0 == BSP_CFG_AD_NEGATIVE_VOLTAGE_INPUT_AN000) && (0 == BSP_CFG_AD_NEGATIVE_VOLTAGE_INPUT_AN001) \\\n && (0 == BSP_CFG_AD_NEGATIVE_VOLTAGE_INPUT_AN002) && (0 == BSP_CFG_AD_NEGATIVE_VOLTAGE_INPUT_PGAVSS0) \\\n && (0 == BSP_CFG_AD_NEGATIVE_VOLTAGE_INPUT_AN100) && (0 == BSP_CFG_AD_NEGATIVE_VOLTAGE_INPUT_AN101) \\\n && (0 == BSP_CFG_AD_NEGATIVE_VOLTAGE_INPUT_AN102) && (0 == BSP_CFG_AD_NEGATIVE_VOLTAGE_INPUT_PGAVSS1)\n tmp_arg = BSP_VOL_AD_NEGATIVE_VOLTAGE_NOINPUT;\n #else\n tmp_arg = BSP_VOL_AD_NEGATIVE_VOLTAGE_INPUT;\n #endif\n #endif\n#endif /* (0xB == BSP_CFG_MCU_PART_FUNCTION) || (0xF == BSP_CFG_MCU_PART_FUNCTION) */\n\n /* Set the pattern of the VOLSR(RICVLS). */\n#if (4500 <= BSP_CFG_MCU_VCC_MV) && (5500 >= BSP_CFG_MCU_VCC_MV)\n tmp_arg |= BSP_VOL_RIIC_4_5V_OROVER;\n#elif (2700 <= BSP_CFG_MCU_VCC_MV) && (4500 > BSP_CFG_MCU_VCC_MV)\n tmp_arg |= BSP_VOL_RIIC_UNDER_4_5V;\n#else\n #error \"Error! Invalid setting for BSP_CFG_MCU_VCC_MV in r_bsp_config.h\"\n#endif\n\n R_BSP_VoltageLevelSetting(tmp_arg);\n} /* End of function bsp_volsr_initial_configure() */\n\n"} {"text": "[config]\ncommand = stat\nargs = -dd kill >/dev/null 2>&1\nret = 1\n\n\n# PERF_TYPE_SOFTWARE / PERF_COUNT_SW_TASK_CLOCK\n[event1:base-stat]\nfd=1\ntype=1\nconfig=1\n\n# PERF_TYPE_SOFTWARE / PERF_COUNT_SW_CONTEXT_SWITCHES\n[event2:base-stat]\nfd=2\ntype=1\nconfig=3\n\n# PERF_TYPE_SOFTWARE / PERF_COUNT_SW_CPU_MIGRATIONS\n[event3:base-stat]\nfd=3\ntype=1\nconfig=4\n\n# PERF_TYPE_SOFTWARE / PERF_COUNT_SW_PAGE_FAULTS\n[event4:base-stat]\nfd=4\ntype=1\nconfig=2\n\n# PERF_TYPE_HARDWARE / PERF_COUNT_HW_CPU_CYCLES\n[event5:base-stat]\nfd=5\ntype=0\nconfig=0\n\n# PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_FRONTEND\n[event6:base-stat]\nfd=6\ntype=0\nconfig=7\n\n# PERF_TYPE_HARDWARE / PERF_COUNT_HW_STALLED_CYCLES_BACKEND\n[event7:base-stat]\nfd=7\ntype=0\nconfig=8\n\n# PERF_TYPE_HARDWARE / PERF_COUNT_HW_INSTRUCTIONS\n[event8:base-stat]\nfd=8\ntype=0\nconfig=1\n\n# PERF_TYPE_HARDWARE / PERF_COUNT_HW_BRANCH_INSTRUCTIONS\n[event9:base-stat]\nfd=9\ntype=0\nconfig=4\n\n# PERF_TYPE_HARDWARE / PERF_COUNT_HW_BRANCH_MISSES\n[event10:base-stat]\nfd=10\ntype=0\nconfig=5\n\n# PERF_TYPE_HW_CACHE /\n# PERF_COUNT_HW_CACHE_L1D << 0 |\n# (PERF_COUNT_HW_CACHE_OP_READ << 8) |\n# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)\n[event11:base-stat]\nfd=11\ntype=3\nconfig=0\n\n# PERF_TYPE_HW_CACHE /\n# PERF_COUNT_HW_CACHE_L1D << 0 |\n# (PERF_COUNT_HW_CACHE_OP_READ << 8) |\n# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)\n[event12:base-stat]\nfd=12\ntype=3\nconfig=65536\n\n# PERF_TYPE_HW_CACHE /\n# PERF_COUNT_HW_CACHE_LL << 0 |\n# (PERF_COUNT_HW_CACHE_OP_READ << 8) |\n# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)\n[event13:base-stat]\nfd=13\ntype=3\nconfig=2\n\n# PERF_TYPE_HW_CACHE,\n# PERF_COUNT_HW_CACHE_LL << 0 |\n# (PERF_COUNT_HW_CACHE_OP_READ << 8) |\n# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)\n[event14:base-stat]\nfd=14\ntype=3\nconfig=65538\n\n# PERF_TYPE_HW_CACHE,\n# PERF_COUNT_HW_CACHE_L1I << 0 |\n# (PERF_COUNT_HW_CACHE_OP_READ << 8) |\n# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)\n[event15:base-stat]\nfd=15\ntype=3\nconfig=1\n\n# PERF_TYPE_HW_CACHE,\n# PERF_COUNT_HW_CACHE_L1I << 0 |\n# (PERF_COUNT_HW_CACHE_OP_READ << 8) |\n# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)\n[event16:base-stat]\nfd=16\ntype=3\nconfig=65537\n\n# PERF_TYPE_HW_CACHE,\n# PERF_COUNT_HW_CACHE_DTLB << 0 |\n# (PERF_COUNT_HW_CACHE_OP_READ << 8) |\n# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)\n[event17:base-stat]\nfd=17\ntype=3\nconfig=3\n\n# PERF_TYPE_HW_CACHE,\n# PERF_COUNT_HW_CACHE_DTLB << 0 |\n# (PERF_COUNT_HW_CACHE_OP_READ << 8) |\n# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)\n[event18:base-stat]\nfd=18\ntype=3\nconfig=65539\n\n# PERF_TYPE_HW_CACHE,\n# PERF_COUNT_HW_CACHE_ITLB << 0 |\n# (PERF_COUNT_HW_CACHE_OP_READ << 8) |\n# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)\n[event19:base-stat]\nfd=19\ntype=3\nconfig=4\n\n# PERF_TYPE_HW_CACHE,\n# PERF_COUNT_HW_CACHE_ITLB << 0 |\n# (PERF_COUNT_HW_CACHE_OP_READ << 8) |\n# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)\n[event20:base-stat]\nfd=20\ntype=3\nconfig=65540\n"} {"text": "//\n// AutoLayoutSupportTestView.h\n// AppDevKit\n//\n// Created by Jeff Lin on 3/13/16.\n// Copyright © 2016, Yahoo Inc.\n// Licensed under the terms of the BSD License.\n// Please see the LICENSE file in the project root for terms.\n//\n\n#import \n\n@interface AutoLayoutSupportTestView : UIView\n@property (weak, nonatomic) IBOutlet UIView *centerView;\n@property (weak, nonatomic) IBOutlet UIView *buttomView;\n@property (weak, nonatomic) IBOutlet UIView *rightView;\n\n@end\n"} {"text": "from django import forms\n\nclass CheckoutForm(forms.Form):\n \"\"\"\n Captures extra info required for checkout\n \"\"\"\n email = forms.EmailField()\n shipping_option = forms.CharField(widget=forms.Select, required=False)\n different_billing_address = forms.BooleanField(required=False)\n class Media:\n js = ('checkout.js',)\n"} {"text": "var baseEach = require('../internal/baseEach'),\n invokePath = require('../internal/invokePath'),\n isArrayLike = require('../internal/isArrayLike'),\n isKey = require('../internal/isKey'),\n restParam = require('../function/restParam');\n\n/**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `methodName` is a function it's\n * invoked for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invoke([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\nvar invoke = restParam(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n isProp = isKey(path),\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);\n result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);\n });\n return result;\n});\n\nmodule.exports = invoke;\n"} {"text": "(*\n * copyright (c) 2005-2012 Michael Niedermayer \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 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 * This is a part of Pascal porting of ffmpeg.\n * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows.\n * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT\n * in the source codes.\n * - Changes and updates by the UltraStar Deluxe Team\n *\n * Conversion of libavutil/mathematics.h\n * avutil version 54.7.100\n *\n *)\n\nconst\n M_E = 2.7182818284590452354; // e\n M_LN2 = 0.69314718055994530942; // log_e 2\n M_LN10 = 2.30258509299404568402; // log_e 10\n M_LOG2_10 = 3.32192809488736234787; // log_2 10\n M_PHI = 1.61803398874989484820; // phi / golden ratio\n M_PI = 3.14159265358979323846; // pi\n M_PI_2 = 1.57079632679489661923; // pi/2\n M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2)\n M_SQRT2 = 1.41421356237309504880; // sqrt(2)\n NAN = $7fc00000; \n INFINITY = $7f800000; \n\n(**\n * @addtogroup lavu_math\n * @\n *)\n\ntype\n TAVRounding = (\n AV_ROUND_ZERO = 0, ///< Round toward zero.\n AV_ROUND_INF = 1, ///< Round away from zero.\n AV_ROUND_DOWN = 2, ///< Round toward -infinity.\n AV_ROUND_UP = 3, ///< Round toward +infinity.\n AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero.\n AV_ROUND_PASS_MINMAX = 8192 ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE\n );\n\n(**\n * Compute the greatest common divisor of a and b.\n *\n * @return gcd of a and b up to sign; if a >= 0 and b >= 0, return value is >= 0;\n * if a == 0 and b == 0, returns 0.\n *)\nfunction av_gcd(a, b: cint64): cint64;\n cdecl; external av__util; {av_const}\n\n(**\n * Rescale a 64-bit integer with rounding to nearest.\n * A simple a*b/c isn't possible as it can overflow.\n *)\nfunction av_rescale (a, b, c: cint64): cint64;\n cdecl; external av__util; {av_const}\n\n(**\n * Rescale a 64-bit integer with specified rounding.\n * A simple a*b/c isn't possible as it can overflow.\n *\n * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is\n * INT64_MIN or INT64_MAX then a is passed through unchanged.\n *)\nfunction av_rescale_rnd (a, b, c: cint64; d: TAVRounding): cint64;\n cdecl; external av__util; {av_const}\n\n(**\n * Rescale a 64-bit integer by 2 rational numbers.\n *)\nfunction av_rescale_q (a: cint64; bq, cq: TAVRational): cint64;\n cdecl; external av__util; {av_const}\n\n(**\n * Rescale a 64-bit integer by 2 rational numbers with specified rounding.\n *\n * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is\n * INT64_MIN or INT64_MAX then a is passed through unchanged.\n *)\nfunction av_rescale_q_rnd(a: cint64; bq, cq: TAVRational;\n d: TAVRounding): cint64;\n cdecl; external av__util; {av_const}\n\n(**\n * Compare 2 timestamps each in its own timebases.\n * The result of the function is undefined if one of the timestamps\n * is outside the int64_t range when represented in the others timebase.\n * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position\n *)\nfunction av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint;\n cdecl; external av__util;\n \n(**\n * Compare 2 integers modulo mod.\n * That is we compare integers a and b for which only the least\n * significant log2(mod) bits are known.\n *\n * @param mod must be a power of 2\n * @return a negative value if a is smaller than b\n * a positiv value if a is greater than b\n * 0 if a equals b\n *)\nfunction av_compare_mod(a, b, modVar: cuint64): cint64;\n cdecl; external av__util;\n\n(**\n * Rescale a timestamp while preserving known durations.\n *\n * @param in_ts Input timestamp\n * @param in_tb Input timebase\n * @param fs_tb Duration and *last timebase\n * @param duration duration till the next call\n * @param out_tb Output timebase\n *)\nfunction av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64;\n cdecl; external av__util;\n\n(**\n * Add a value to a timestamp.\n *\n * This function guarantees that when the same value is repeatly added that\n * no accumulation of rounding errors occurs.\n *\n * @param ts Input timestamp\n * @param ts_tb Input timestamp timebase\n * @param inc value to add to ts\n * @param inc_tb inc timebase\n *)\nfunction av_add_stable(ts_tb: TAVRational; ts: cint64; inc_tb: TAVRational; inc: cint64): cint64;\n cdecl; external av__util;\n"} {"text": "package libcve201710271\n\nvar (\n\t// DefaultURLs is the endpoint URL that we should scan by default.\n\tDefaultURLs = []string{\n\t\t\"/wls-wsat/CoordinatorPortType\",\n\t}\n\n\t// AllURLs is the endpoint URLs that are known to be vulnerable and may be\n\t// desirable to scan in certain cases.\n\tAllURLs = []string{\n\t\t\"/wls-wsat/CoordinatorPortType\",\n\t\t\"/wls-wsat/CoordinatorPortType11\",\n\t\t\"/wls-wsat/ParticipantPortType\",\n\t\t\"/wls-wsat/ParticipantPortType11\",\n\t\t\"/wls-wsat/RegistrationPortTypeRPC\",\n\t\t\"/wls-wsat/RegistrationPortTypeRPC11\",\n\t\t\"/wls-wsat/RegistrationRequesterPortType\",\n\t\t\"/wls-wsat/RegistrationRequesterPortType11\",\n\t}\n)\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\npackage rest\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"os\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\n\t\"fmt\"\n\n\t\"k8s.io/api/core/v1\"\n\tv1beta1 \"k8s.io/api/extensions/v1beta1\"\n\t\"k8s.io/apimachinery/pkg/api/errors\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/apimachinery/pkg/runtime\"\n\t\"k8s.io/apimachinery/pkg/runtime/serializer\"\n\t\"k8s.io/apimachinery/pkg/types\"\n\t\"k8s.io/apimachinery/pkg/util/diff\"\n\t\"k8s.io/client-go/kubernetes/scheme\"\n\tutiltesting \"k8s.io/client-go/util/testing\"\n)\n\ntype TestParam struct {\n\tactualError error\n\texpectingError bool\n\tactualCreated bool\n\texpCreated bool\n\texpStatus *metav1.Status\n\ttestBody bool\n\ttestBodyErrorIsNotNil bool\n}\n\n// TestSerializer makes sure that you're always able to decode metav1.Status\nfunc TestSerializer(t *testing.T) {\n\tgv := v1beta1.SchemeGroupVersion\n\tcontentConfig := ContentConfig{\n\t\tContentType: \"application/json\",\n\t\tGroupVersion: &gv,\n\t\tNegotiatedSerializer: serializer.DirectCodecFactory{CodecFactory: scheme.Codecs},\n\t}\n\n\tserializer, err := createSerializers(contentConfig)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// bytes based on actual return from API server when encoding an \"unversioned\" object\n\tobj, err := runtime.Decode(serializer.Decoder, []byte(`{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Success\"}`))\n\tt.Log(obj)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestDoRequestSuccess(t *testing.T) {\n\ttestServer, fakeHandler, status := testServerEnv(t, 200)\n\tdefer testServer.Close()\n\n\tc, err := restClient(testServer)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error: %v\", err)\n\t}\n\tbody, err := c.Get().Prefix(\"test\").Do().Raw()\n\n\ttestParam := TestParam{actualError: err, expectingError: false, expCreated: true,\n\t\texpStatus: status, testBody: true, testBodyErrorIsNotNil: false}\n\tvalidate(testParam, t, body, fakeHandler)\n}\n\nfunc TestDoRequestFailed(t *testing.T) {\n\tstatus := &metav1.Status{\n\t\tCode: http.StatusNotFound,\n\t\tStatus: metav1.StatusFailure,\n\t\tReason: metav1.StatusReasonNotFound,\n\t\tMessage: \" \\\"\\\" not found\",\n\t\tDetails: &metav1.StatusDetails{},\n\t}\n\texpectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), status)\n\tfakeHandler := utiltesting.FakeHandler{\n\t\tStatusCode: 404,\n\t\tResponseBody: string(expectedBody),\n\t\tT: t,\n\t}\n\ttestServer := httptest.NewServer(&fakeHandler)\n\tdefer testServer.Close()\n\n\tc, err := restClient(testServer)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error: %v\", err)\n\t}\n\terr = c.Get().Do().Error()\n\tif err == nil {\n\t\tt.Errorf(\"unexpected non-error\")\n\t}\n\tss, ok := err.(errors.APIStatus)\n\tif !ok {\n\t\tt.Errorf(\"unexpected error type %v\", err)\n\t}\n\tactual := ss.Status()\n\tif !reflect.DeepEqual(status, &actual) {\n\t\tt.Errorf(\"Unexpected mis-match: %s\", diff.ObjectReflectDiff(status, &actual))\n\t}\n}\n\nfunc TestDoRawRequestFailed(t *testing.T) {\n\tstatus := &metav1.Status{\n\t\tCode: http.StatusNotFound,\n\t\tStatus: metav1.StatusFailure,\n\t\tReason: metav1.StatusReasonNotFound,\n\t\tMessage: \"the server could not find the requested resource\",\n\t\tDetails: &metav1.StatusDetails{\n\t\t\tCauses: []metav1.StatusCause{\n\t\t\t\t{Type: metav1.CauseTypeUnexpectedServerResponse, Message: \"unknown\"},\n\t\t\t},\n\t\t},\n\t}\n\texpectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), status)\n\tfakeHandler := utiltesting.FakeHandler{\n\t\tStatusCode: 404,\n\t\tResponseBody: string(expectedBody),\n\t\tT: t,\n\t}\n\ttestServer := httptest.NewServer(&fakeHandler)\n\tdefer testServer.Close()\n\n\tc, err := restClient(testServer)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error: %v\", err)\n\t}\n\tbody, err := c.Get().Do().Raw()\n\n\tif err == nil || body == nil {\n\t\tt.Errorf(\"unexpected non-error: %#v\", body)\n\t}\n\tss, ok := err.(errors.APIStatus)\n\tif !ok {\n\t\tt.Errorf(\"unexpected error type %v\", err)\n\t}\n\tactual := ss.Status()\n\tif !reflect.DeepEqual(status, &actual) {\n\t\tt.Errorf(\"Unexpected mis-match: %s\", diff.ObjectReflectDiff(status, &actual))\n\t}\n}\n\nfunc TestDoRequestCreated(t *testing.T) {\n\ttestServer, fakeHandler, status := testServerEnv(t, 201)\n\tdefer testServer.Close()\n\n\tc, err := restClient(testServer)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error: %v\", err)\n\t}\n\tcreated := false\n\tbody, err := c.Get().Prefix(\"test\").Do().WasCreated(&created).Raw()\n\n\ttestParam := TestParam{actualError: err, expectingError: false, expCreated: true,\n\t\texpStatus: status, testBody: false}\n\tvalidate(testParam, t, body, fakeHandler)\n}\n\nfunc TestDoRequestNotCreated(t *testing.T) {\n\ttestServer, fakeHandler, expectedStatus := testServerEnv(t, 202)\n\tdefer testServer.Close()\n\tc, err := restClient(testServer)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error: %v\", err)\n\t}\n\tcreated := false\n\tbody, err := c.Get().Prefix(\"test\").Do().WasCreated(&created).Raw()\n\ttestParam := TestParam{actualError: err, expectingError: false, expCreated: false,\n\t\texpStatus: expectedStatus, testBody: false}\n\tvalidate(testParam, t, body, fakeHandler)\n}\n\nfunc TestDoRequestAcceptedNoContentReturned(t *testing.T) {\n\ttestServer, fakeHandler, _ := testServerEnv(t, 204)\n\tdefer testServer.Close()\n\n\tc, err := restClient(testServer)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error: %v\", err)\n\t}\n\tcreated := false\n\tbody, err := c.Get().Prefix(\"test\").Do().WasCreated(&created).Raw()\n\ttestParam := TestParam{actualError: err, expectingError: false, expCreated: false,\n\t\ttestBody: false}\n\tvalidate(testParam, t, body, fakeHandler)\n}\n\nfunc TestBadRequest(t *testing.T) {\n\ttestServer, fakeHandler, _ := testServerEnv(t, 400)\n\tdefer testServer.Close()\n\tc, err := restClient(testServer)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error: %v\", err)\n\t}\n\tcreated := false\n\tbody, err := c.Get().Prefix(\"test\").Do().WasCreated(&created).Raw()\n\ttestParam := TestParam{actualError: err, expectingError: true, expCreated: false,\n\t\ttestBody: true}\n\tvalidate(testParam, t, body, fakeHandler)\n}\n\nfunc validate(testParam TestParam, t *testing.T, body []byte, fakeHandler *utiltesting.FakeHandler) {\n\tswitch {\n\tcase testParam.expectingError && testParam.actualError == nil:\n\t\tt.Errorf(\"Expected error\")\n\tcase !testParam.expectingError && testParam.actualError != nil:\n\t\tt.Error(testParam.actualError)\n\t}\n\tif !testParam.expCreated {\n\t\tif testParam.actualCreated {\n\t\t\tt.Errorf(\"Expected object not to be created\")\n\t\t}\n\t}\n\tstatusOut, err := runtime.Decode(scheme.Codecs.UniversalDeserializer(), body)\n\tif testParam.testBody {\n\t\tif testParam.testBodyErrorIsNotNil && err == nil {\n\t\t\tt.Errorf(\"Expected Error\")\n\t\t}\n\t\tif !testParam.testBodyErrorIsNotNil && err != nil {\n\t\t\tt.Errorf(\"Unexpected Error: %v\", err)\n\t\t}\n\t}\n\n\tif testParam.expStatus != nil {\n\t\tif !reflect.DeepEqual(testParam.expStatus, statusOut) {\n\t\t\tt.Errorf(\"Unexpected mis-match. Expected %#v. Saw %#v\", testParam.expStatus, statusOut)\n\t\t}\n\t}\n\tfakeHandler.ValidateRequest(t, \"/\"+v1.SchemeGroupVersion.String()+\"/test\", \"GET\", nil)\n\n}\n\nfunc TestHttpMethods(t *testing.T) {\n\ttestServer, _, _ := testServerEnv(t, 200)\n\tdefer testServer.Close()\n\tc, _ := restClient(testServer)\n\n\trequest := c.Post()\n\tif request == nil {\n\t\tt.Errorf(\"Post : Object returned should not be nil\")\n\t}\n\n\trequest = c.Get()\n\tif request == nil {\n\t\tt.Errorf(\"Get: Object returned should not be nil\")\n\t}\n\n\trequest = c.Put()\n\tif request == nil {\n\t\tt.Errorf(\"Put : Object returned should not be nil\")\n\t}\n\n\trequest = c.Delete()\n\tif request == nil {\n\t\tt.Errorf(\"Delete : Object returned should not be nil\")\n\t}\n\n\trequest = c.Patch(types.JSONPatchType)\n\tif request == nil {\n\t\tt.Errorf(\"Patch : Object returned should not be nil\")\n\t}\n}\n\nfunc TestCreateBackoffManager(t *testing.T) {\n\n\ttheUrl, _ := url.Parse(\"http://localhost\")\n\n\t// 1 second base backoff + duration of 2 seconds -> exponential backoff for requests.\n\tos.Setenv(envBackoffBase, \"1\")\n\tos.Setenv(envBackoffDuration, \"2\")\n\tbackoff := readExpBackoffConfig()\n\tbackoff.UpdateBackoff(theUrl, nil, 500)\n\tbackoff.UpdateBackoff(theUrl, nil, 500)\n\tif backoff.CalculateBackoff(theUrl)/time.Second != 2 {\n\t\tt.Errorf(\"Backoff env not working.\")\n\t}\n\n\t// 0 duration -> no backoff.\n\tos.Setenv(envBackoffBase, \"1\")\n\tos.Setenv(envBackoffDuration, \"0\")\n\tbackoff.UpdateBackoff(theUrl, nil, 500)\n\tbackoff.UpdateBackoff(theUrl, nil, 500)\n\tbackoff = readExpBackoffConfig()\n\tif backoff.CalculateBackoff(theUrl)/time.Second != 0 {\n\t\tt.Errorf(\"Zero backoff duration, but backoff still occurring.\")\n\t}\n\n\t// No env -> No backoff.\n\tos.Setenv(envBackoffBase, \"\")\n\tos.Setenv(envBackoffDuration, \"\")\n\tbackoff = readExpBackoffConfig()\n\tbackoff.UpdateBackoff(theUrl, nil, 500)\n\tbackoff.UpdateBackoff(theUrl, nil, 500)\n\tif backoff.CalculateBackoff(theUrl)/time.Second != 0 {\n\t\tt.Errorf(\"Backoff should have been 0.\")\n\t}\n\n}\n\nfunc testServerEnv(t *testing.T, statusCode int) (*httptest.Server, *utiltesting.FakeHandler, *metav1.Status) {\n\tstatus := &metav1.Status{TypeMeta: metav1.TypeMeta{APIVersion: \"v1\", Kind: \"Status\"}, Status: fmt.Sprintf(\"%s\", metav1.StatusSuccess)}\n\texpectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), status)\n\tfakeHandler := utiltesting.FakeHandler{\n\t\tStatusCode: statusCode,\n\t\tResponseBody: string(expectedBody),\n\t\tT: t,\n\t}\n\ttestServer := httptest.NewServer(&fakeHandler)\n\treturn testServer, &fakeHandler, status\n}\n\nfunc restClient(testServer *httptest.Server) (*RESTClient, error) {\n\tc, err := RESTClientFor(&Config{\n\t\tHost: testServer.URL,\n\t\tContentConfig: ContentConfig{\n\t\t\tGroupVersion: &v1.SchemeGroupVersion,\n\t\t\tNegotiatedSerializer: serializer.DirectCodecFactory{CodecFactory: scheme.Codecs},\n\t\t},\n\t\tUsername: \"user\",\n\t\tPassword: \"pass\",\n\t})\n\treturn c, err\n}\n"} {"text": "\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nnamespace Symfony\\Component\\Routing\\Loader;\n\nuse Symfony\\Component\\Config\\Loader\\Loader;\nuse Symfony\\Component\\Routing\\RouteCollection;\n\n/**\n * ClosureLoader loads routes from a PHP closure.\n *\n * The Closure must return a RouteCollection instance.\n *\n * @author Fabien Potencier \n */\nclass ClosureLoader extends Loader\n{\n /**\n * Loads a Closure.\n *\n * @param \\Closure $closure A Closure\n * @param string|null $type The resource type\n *\n * @return RouteCollection A RouteCollection instance\n */\n public function load($closure, $type = null)\n {\n return $closure();\n }\n\n /**\n * {@inheritdoc}\n */\n public function supports($resource, $type = null)\n {\n return $resource instanceof \\Closure && (!$type || 'closure' === $type);\n }\n}\n"} {"text": "\n\nATL 3.0 test page for object AutoCtl\n\n\n\n\n"} {"text": "# Copyright 2012 Mozilla Foundation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# Main toolbar buttons (tooltips and alt text for images)\nprevious.title=Vorige bladsy\nprevious_label=Vorige\nnext.title=Volgende bladsy\nnext_label=Volgende\n\n# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input.\npage.title=Bladsy\n# LOCALIZATION NOTE (of_pages): \"{{pagesCount}}\" will be replaced by a number\n# representing the total number of pages in the document.\nof_pages=van {{pagesCount}}\n# LOCALIZATION NOTE (page_of_pages): \"{{pageNumber}}\" and \"{{pagesCount}}\"\n# will be replaced by a number representing the currently visible page,\n# respectively a number representing the total number of pages in the document.\npage_of_pages=({{pageNumber}} van {{pagesCount}})\n\nzoom_out.title=Zoem uit\nzoom_out_label=Zoem uit\nzoom_in.title=Zoem in\nzoom_in_label=Zoem in\nzoom.title=Zoem\npresentation_mode.title=Wissel na voorleggingsmodus\npresentation_mode_label=Voorleggingsmodus\nopen_file.title=Open lêer\nopen_file_label=Open\nprint.title=Druk\nprint_label=Druk\ndownload.title=Laai af\ndownload_label=Laai af\nbookmark.title=Huidige aansig (kopieer of open in nuwe venster)\nbookmark_label=Huidige aansig\n\n# Secondary toolbar and context menu\ntools.title=Nutsgoed\ntools_label=Nutsgoed\nfirst_page.title=Gaan na eerste bladsy\nfirst_page.label=Gaan na eerste bladsy\nfirst_page_label=Gaan na eerste bladsy\nlast_page.title=Gaan na laaste bladsy\nlast_page.label=Gaan na laaste bladsy\nlast_page_label=Gaan na laaste bladsy\npage_rotate_cw.title=Roteer kloksgewys\npage_rotate_cw.label=Roteer kloksgewys\npage_rotate_cw_label=Roteer kloksgewys\npage_rotate_ccw.title=Roteer anti-kloksgewys\npage_rotate_ccw.label=Roteer anti-kloksgewys\npage_rotate_ccw_label=Roteer anti-kloksgewys\n\nhand_tool_enable.title=Aktiveer handjie\nhand_tool_enable_label=Aktiveer handjie\nhand_tool_disable.title=Deaktiveer handjie\nhand_tool_disable_label=Deaktiveer handjie\n\n# Document properties dialog box\ndocument_properties.title=Dokumenteienskappe…\ndocument_properties_label=Dokumenteienskappe…\ndocument_properties_file_name=Lêernaam:\ndocument_properties_file_size=Lêergrootte:\n# LOCALIZATION NOTE (document_properties_kb): \"{{size_kb}}\" and \"{{size_b}}\"\n# will be replaced by the PDF file size in kilobytes, respectively in bytes.\ndocument_properties_kb={{size_kb}} kG ({{size_b}} grepe)\n# LOCALIZATION NOTE (document_properties_mb): \"{{size_mb}}\" and \"{{size_b}}\"\n# will be replaced by the PDF file size in megabytes, respectively in bytes.\ndocument_properties_mb={{size_mb}} MG ({{size_b}} grepe)\ndocument_properties_title=Titel:\ndocument_properties_author=Outeur:\ndocument_properties_subject=Onderwerp:\ndocument_properties_keywords=Sleutelwoorde:\ndocument_properties_creation_date=Skeppingsdatum:\ndocument_properties_modification_date=Wysigingsdatum:\n# LOCALIZATION NOTE (document_properties_date_string): \"{{date}}\" and \"{{time}}\"\n# will be replaced by the creation/modification date, and time, of the PDF file.\ndocument_properties_date_string={{date}}, {{time}}\ndocument_properties_creator=Skepper:\ndocument_properties_producer=PDF-vervaardiger:\ndocument_properties_version=PDF-weergawe:\ndocument_properties_page_count=Aantal bladsye:\ndocument_properties_close=Sluit\n\nprint_progress_message=Berei tans dokument voor om te druk…\n# LOCALIZATION NOTE (print_progress_percent): \"{{progress}}\" will be replaced by\n# a numerical per cent value.\nprint_progress_percent={{progress}}%\nprint_progress_close=Kanselleer\n\n# Tooltips and alt text for side panel toolbar buttons\n# (the _label strings are alt text for the buttons, the .title strings are\n# tooltips)\ntoggle_sidebar.title=Sypaneel aan/af\ntoggle_sidebar_label=Sypaneel aan/af\ndocument_outline.title=Wys dokumentskema (dubbelklik om alle items oop/toe te vou)\ndocument_outline_label=Dokumentoorsig\nattachments.title=Wys aanhegsels\nattachments_label=Aanhegsels\nthumbs.title=Wys duimnaels\nthumbs_label=Duimnaels\nfindbar.title=Soek in dokument\nfindbar_label=Vind\n\n# Thumbnails panel item (tooltip and alt text for images)\n# LOCALIZATION NOTE (thumb_page_title): \"{{page}}\" will be replaced by the page\n# number.\nthumb_page_title=Bladsy {{page}}\n# LOCALIZATION NOTE (thumb_page_canvas): \"{{page}}\" will be replaced by the page\n# number.\nthumb_page_canvas=Duimnael van bladsy {{page}}\n\n# Find panel button title and messages\nfind_label=Vind:\nfind_previous.title=Vind die vorige voorkoms van die frase\nfind_previous_label=Vorige\nfind_next.title=Vind die volgende voorkoms van die frase\nfind_next_label=Volgende\nfind_highlight=Verlig alle\nfind_match_case_label=Kassensitief\nfind_reached_top=Bokant van dokument is bereik; gaan voort van onder af\nfind_reached_bottom=Einde van dokument is bereik; gaan voort van bo af\nfind_not_found=Frase nie gevind nie\n\n# Error panel labels\nerror_more_info=Meer inligting\nerror_less_info=Minder inligting\nerror_close=Sluit\n# LOCALIZATION NOTE (error_version_info): \"{{version}}\" and \"{{build}}\" will be\n# replaced by the PDF.JS version and build ID.\nerror_version_info=PDF.js v{{version}} (ID: {{build}})\n# LOCALIZATION NOTE (error_message): \"{{message}}\" will be replaced by an\n# english string describing the error.\nerror_message=Boodskap: {{message}}\n# LOCALIZATION NOTE (error_stack): \"{{stack}}\" will be replaced with a stack\n# trace.\nerror_stack=Stapel: {{stack}}\n# LOCALIZATION NOTE (error_file): \"{{file}}\" will be replaced with a filename\nerror_file=Lêer: {{file}}\n# LOCALIZATION NOTE (error_line): \"{{line}}\" will be replaced with a line number\nerror_line=Lyn: {{line}}\nrendering_error='n Fout het voorgekom toe die bladsy weergegee is.\n\n# Predefined zoom values\npage_scale_width=Bladsywydte\npage_scale_fit=Pas bladsy\npage_scale_auto=Outomatiese zoem\npage_scale_actual=Werklike grootte\n# LOCALIZATION NOTE (page_scale_percent): \"{{scale}}\" will be replaced by a\n# numerical scale value.\npage_scale_percent={{scale}}%\n\n# Loading indicator messages\nloading_error_indicator=Fout\nloading_error='n Fout het voorgekom met die laai van die PDF.\ninvalid_file_error=Ongeldige of korrupte PDF-lêer.\nmissing_file_error=PDF-lêer is weg.\nunexpected_response_error=Onverwagse antwoord van bediener.\n\n# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.\n# \"{{type}}\" will be replaced with an annotation type from a list defined in\n# the PDF spec (32000-1:2008 Table 169 – Annotation types).\n# Some common types are e.g.: \"Check\", \"Text\", \"Comment\", \"Note\"\ntext_annotation_type.alt=[{{type}}-annotasie\npassword_label=Gee die wagwoord om dié PDF-lêer mee te open.\npassword_invalid=Ongeldige wagwoord. Probeer gerus weer.\npassword_ok=OK\npassword_cancel=Kanselleer\n\nprinting_not_supported=Waarskuwing: Dié blaaier ondersteun nie drukwerk ten volle nie.\nprinting_not_ready=Waarskuwing: Die PDF is nog nie volledig gelaai vir drukwerk nie.\nweb_fonts_disabled=Webfonte is gedeaktiveer: kan nie PDF-fonte wat ingebed is, gebruik nie.\ndocument_colors_not_allowed=PDF-dokumente word nie toegelaat om hul eie kleure te gebruik nie: 'Laat bladsye toe om hul eie kleure te kies' is gedeaktiveer in die blaaier.\n"} {"text": "module Fantomas.Extras.FakeHelpers\n\nopen System\nopen System.IO\nopen FSharp.Compiler.SourceCodeServices\nopen Fantomas\nopen Fantomas.FormatConfig\nopen Fantomas.Extras\n\n// Share an F# checker instance across formatting calls\nlet sharedChecker = lazy (FSharpChecker.Create())\n\nexception CodeFormatException of (string * Option) array with\n override x.ToString() =\n let errors =\n x.Data0\n |> Array.choose (fun z ->\n match z with\n | file, Some ex -> Some(file, ex)\n | _ -> None)\n |> Array.map (fun z ->\n let file, ex = z\n file + \":\\r\\n\" + ex.Message + \"\\r\\n\\r\\n\")\n\n let files =\n x.Data0\n |> Array.map (fun z ->\n match z with\n | file, Some _ -> file + \" !\"\n | file, None -> file)\n\n String.Join(String.Empty, errors)\n + \"The following files aren't formatted properly:\"\n + \"\\r\\n- \"\n + String.Join(\"\\r\\n- \", files)\n\ntype FormatResult =\n | Formatted of filename: string * formattedContent: string\n | Unchanged of filename: string\n | Error of filename: string * formattingError: Exception\n | IgnoredFile of filename: string\n\nlet createParsingOptionsFromFile fileName =\n { FSharpParsingOptions.Default with\n SourceFiles = [| fileName |] }\n\nlet formatContentAsync config (file: string) (originalContent: string) =\n if IgnoreFile.isIgnoredFile file then\n async { return IgnoredFile file }\n else\n async {\n try\n let fileName =\n if Path.GetExtension(file) = \".fsi\" then \"tmp.fsi\" else \"tmp.fsx\"\n\n let! formattedContent =\n CodeFormatter.FormatDocumentAsync\n (fileName,\n SourceOrigin.SourceString originalContent,\n config,\n createParsingOptionsFromFile fileName,\n sharedChecker.Value)\n\n if originalContent <> formattedContent then\n let! isValid =\n CodeFormatter.IsValidFSharpCodeAsync\n (fileName,\n (SourceOrigin.SourceString(formattedContent)),\n createParsingOptionsFromFile fileName,\n sharedChecker.Value)\n\n if not isValid then\n raise\n <| FormatException \"Formatted content is not valid F# code\"\n\n return Formatted(filename = file, formattedContent = formattedContent)\n else\n return Unchanged(filename = file)\n with ex -> return Error(file, ex)\n }\n\nlet formatFileAsync (file: string) =\n let config = EditorConfig.readConfiguration file\n\n if IgnoreFile.isIgnoredFile file then\n async { return IgnoredFile file }\n else\n let originalContent = File.ReadAllText file\n\n async {\n let! formatted = originalContent |> formatContentAsync config file\n return formatted\n }\n\nlet formatFilesAsync files =\n files |> Seq.map formatFileAsync |> Async.Parallel\n\nlet formatCode files =\n async {\n let! results = formatFilesAsync files\n\n // Check for formatting errors:\n let errors =\n results\n |> Array.choose (fun x ->\n match x with\n | Error (file, ex) -> Some(file, Some(ex))\n | _ -> None)\n\n if not <| Array.isEmpty errors then raise <| CodeFormatException errors\n\n // Overwrite source files with formatted content\n let result =\n results\n |> Array.choose (fun x ->\n match x with\n | Formatted (source, formatted) ->\n File.WriteAllText(source, formatted)\n Some source\n | _ -> None)\n\n return result\n }\n\ntype CheckResult =\n { Errors: (string * exn) list\n Formatted: string list }\n member this.HasErrors = List.isNotEmpty this.Errors\n member this.NeedsFormatting = List.isNotEmpty this.Formatted\n\n member this.IsValid =\n List.isEmpty this.Errors\n && List.isEmpty this.Formatted\n\n/// Runs a check on the given files and reports the result to the given output:\n///\n/// * It shows the paths of the files that need formatting\n/// * It shows the path and the error message of files that failed the format check\n///\n/// Returns:\n///\n/// A record with the file names that were formatted and the files that encounter problems while formatting.\nlet checkCode (filenames: seq) =\n async {\n let! formatted =\n filenames\n |> Seq.filter (IgnoreFile.isIgnoredFile >> not)\n |> Seq.map formatFileAsync\n |> Async.Parallel\n\n let getChangedFile =\n function\n | FormatResult.Unchanged _\n | FormatResult.IgnoredFile _ -> None\n | FormatResult.Formatted (f, _)\n | FormatResult.Error (f, _) -> Some f\n\n let changes =\n formatted\n |> Seq.choose getChangedFile\n |> Seq.toList\n\n let getErrors =\n function\n | FormatResult.Error (f, e) -> Some(f, e)\n | _ -> None\n\n let errors =\n formatted |> Seq.choose getErrors |> Seq.toList\n\n return { Errors = errors; Formatted = changes }\n }\n"} {"text": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n"} {"text": "// Code generated by protoc-gen-gogo. DO NOT EDIT.\n// source: wire.proto\n\npackage wire\n\nimport (\n\tencoding_binary \"encoding/binary\"\n\tfmt \"fmt\"\n\tproto \"gx/ipfs/QmddjPSGZb3ieihSseFeCfVRpZzcqczPNsD2DvarSwnjJB/gogo-protobuf/proto\"\n\tio \"io\"\n\tmath \"math\"\n)\n\n// Reference imports to suppress errors if they are not otherwise used.\nvar _ = proto.Marshal\nvar _ = fmt.Errorf\nvar _ = math.Inf\n\n// This is a compile-time assertion to ensure that this generated file\n// is compatible with the proto package it is being compiled against.\n// A compilation error at this line likely means your copy of the\n// proto package needs to be updated.\nconst _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package\n\ntype TracerState struct {\n\tTraceId uint64 `protobuf:\"fixed64,1,opt,name=trace_id,json=traceId,proto3\" json:\"trace_id,omitempty\"`\n\tSpanId uint64 `protobuf:\"fixed64,2,opt,name=span_id,json=spanId,proto3\" json:\"span_id,omitempty\"`\n\tSampled bool `protobuf:\"varint,3,opt,name=sampled,proto3\" json:\"sampled,omitempty\"`\n\tBaggageItems map[string]string `protobuf:\"bytes,4,rep,name=baggage_items,json=baggageItems,proto3\" json:\"baggage_items,omitempty\" protobuf_key:\"bytes,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value,proto3\"`\n}\n\nfunc (m *TracerState) Reset() { *m = TracerState{} }\nfunc (m *TracerState) String() string { return proto.CompactTextString(m) }\nfunc (*TracerState) ProtoMessage() {}\nfunc (*TracerState) Descriptor() ([]byte, []int) {\n\treturn fileDescriptor_f2dcdddcdf68d8e0, []int{0}\n}\nfunc (m *TracerState) XXX_Unmarshal(b []byte) error {\n\treturn m.Unmarshal(b)\n}\nfunc (m *TracerState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {\n\tif deterministic {\n\t\treturn xxx_messageInfo_TracerState.Marshal(b, m, deterministic)\n\t} else {\n\t\tb = b[:cap(b)]\n\t\tn, err := m.MarshalTo(b)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn b[:n], nil\n\t}\n}\nfunc (m *TracerState) XXX_Merge(src proto.Message) {\n\txxx_messageInfo_TracerState.Merge(m, src)\n}\nfunc (m *TracerState) XXX_Size() int {\n\treturn m.Size()\n}\nfunc (m *TracerState) XXX_DiscardUnknown() {\n\txxx_messageInfo_TracerState.DiscardUnknown(m)\n}\n\nvar xxx_messageInfo_TracerState proto.InternalMessageInfo\n\nfunc (m *TracerState) GetTraceId() uint64 {\n\tif m != nil {\n\t\treturn m.TraceId\n\t}\n\treturn 0\n}\n\nfunc (m *TracerState) GetSpanId() uint64 {\n\tif m != nil {\n\t\treturn m.SpanId\n\t}\n\treturn 0\n}\n\nfunc (m *TracerState) GetSampled() bool {\n\tif m != nil {\n\t\treturn m.Sampled\n\t}\n\treturn false\n}\n\nfunc (m *TracerState) GetBaggageItems() map[string]string {\n\tif m != nil {\n\t\treturn m.BaggageItems\n\t}\n\treturn nil\n}\n\nfunc init() {\n\tproto.RegisterType((*TracerState)(nil), \"loggabletracer.wire.TracerState\")\n\tproto.RegisterMapType((map[string]string)(nil), \"loggabletracer.wire.TracerState.BaggageItemsEntry\")\n}\n\nfunc init() { proto.RegisterFile(\"wire.proto\", fileDescriptor_f2dcdddcdf68d8e0) }\n\nvar fileDescriptor_f2dcdddcdf68d8e0 = []byte{\n\t// 250 bytes of a gzipped FileDescriptorProto\n\t0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0xcf, 0x2c, 0x4a,\n\t0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xce, 0xc9, 0x4f, 0x4f, 0x4f, 0x4c, 0xca, 0x49,\n\t0x2d, 0x29, 0x4a, 0x4c, 0x4e, 0x2d, 0xd2, 0x03, 0x49, 0x29, 0x7d, 0x65, 0xe4, 0xe2, 0x0e, 0x01,\n\t0xf3, 0x83, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x24, 0xb9, 0x38, 0xc0, 0xd2, 0xf1, 0x99, 0x29, 0x12,\n\t0x8c, 0x0a, 0x8c, 0x1a, 0x6c, 0x41, 0xec, 0x60, 0xbe, 0x67, 0x8a, 0x90, 0x38, 0x17, 0x7b, 0x71,\n\t0x41, 0x62, 0x1e, 0x48, 0x86, 0x09, 0x2c, 0xc3, 0x06, 0xe2, 0x7a, 0xa6, 0x08, 0x49, 0x70, 0xb1,\n\t0x17, 0x27, 0xe6, 0x16, 0xe4, 0xa4, 0xa6, 0x48, 0x30, 0x2b, 0x30, 0x6a, 0x70, 0x04, 0xc1, 0xb8,\n\t0x42, 0xe1, 0x5c, 0xbc, 0x49, 0x89, 0xe9, 0xe9, 0x89, 0xe9, 0xa9, 0xf1, 0x99, 0x25, 0xa9, 0xb9,\n\t0xc5, 0x12, 0x2c, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0x46, 0x7a, 0x58, 0x9c, 0xa2, 0x87, 0xe4, 0x0c,\n\t0x3d, 0x27, 0x88, 0x2e, 0x4f, 0x90, 0x26, 0xd7, 0xbc, 0x92, 0xa2, 0xca, 0x20, 0x9e, 0x24, 0x24,\n\t0x21, 0x29, 0x7b, 0x2e, 0x41, 0x0c, 0x25, 0x42, 0x02, 0x5c, 0xcc, 0xd9, 0xa9, 0x95, 0x60, 0x67,\n\t0x73, 0x06, 0x81, 0x98, 0x42, 0x22, 0x5c, 0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x60, 0x07, 0x73,\n\t0x06, 0x41, 0x38, 0x56, 0x4c, 0x16, 0x8c, 0x4e, 0x72, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24,\n\t0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78,\n\t0x2c, 0xc7, 0x10, 0xc5, 0x02, 0x72, 0x4c, 0x12, 0x1b, 0x38, 0xcc, 0x8c, 0x01, 0x01, 0x00, 0x00,\n\t0xff, 0xff, 0xe4, 0x48, 0xf4, 0xf8, 0x41, 0x01, 0x00, 0x00,\n}\n\nfunc (m *TracerState) Marshal() (dAtA []byte, err error) {\n\tsize := m.Size()\n\tdAtA = make([]byte, size)\n\tn, err := m.MarshalTo(dAtA)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn dAtA[:n], nil\n}\n\nfunc (m *TracerState) MarshalTo(dAtA []byte) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tif m.TraceId != 0 {\n\t\tdAtA[i] = 0x9\n\t\ti++\n\t\tencoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.TraceId))\n\t\ti += 8\n\t}\n\tif m.SpanId != 0 {\n\t\tdAtA[i] = 0x11\n\t\ti++\n\t\tencoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.SpanId))\n\t\ti += 8\n\t}\n\tif m.Sampled {\n\t\tdAtA[i] = 0x18\n\t\ti++\n\t\tif m.Sampled {\n\t\t\tdAtA[i] = 1\n\t\t} else {\n\t\t\tdAtA[i] = 0\n\t\t}\n\t\ti++\n\t}\n\tif len(m.BaggageItems) > 0 {\n\t\tfor k := range m.BaggageItems {\n\t\t\tdAtA[i] = 0x22\n\t\t\ti++\n\t\t\tv := m.BaggageItems[k]\n\t\t\tmapSize := 1 + len(k) + sovWire(uint64(len(k))) + 1 + len(v) + sovWire(uint64(len(v)))\n\t\t\ti = encodeVarintWire(dAtA, i, uint64(mapSize))\n\t\t\tdAtA[i] = 0xa\n\t\t\ti++\n\t\t\ti = encodeVarintWire(dAtA, i, uint64(len(k)))\n\t\t\ti += copy(dAtA[i:], k)\n\t\t\tdAtA[i] = 0x12\n\t\t\ti++\n\t\t\ti = encodeVarintWire(dAtA, i, uint64(len(v)))\n\t\t\ti += copy(dAtA[i:], v)\n\t\t}\n\t}\n\treturn i, nil\n}\n\nfunc encodeVarintWire(dAtA []byte, offset int, v uint64) int {\n\tfor v >= 1<<7 {\n\t\tdAtA[offset] = uint8(v&0x7f | 0x80)\n\t\tv >>= 7\n\t\toffset++\n\t}\n\tdAtA[offset] = uint8(v)\n\treturn offset + 1\n}\nfunc (m *TracerState) Size() (n int) {\n\tif m == nil {\n\t\treturn 0\n\t}\n\tvar l int\n\t_ = l\n\tif m.TraceId != 0 {\n\t\tn += 9\n\t}\n\tif m.SpanId != 0 {\n\t\tn += 9\n\t}\n\tif m.Sampled {\n\t\tn += 2\n\t}\n\tif len(m.BaggageItems) > 0 {\n\t\tfor k, v := range m.BaggageItems {\n\t\t\t_ = k\n\t\t\t_ = v\n\t\t\tmapEntrySize := 1 + len(k) + sovWire(uint64(len(k))) + 1 + len(v) + sovWire(uint64(len(v)))\n\t\t\tn += mapEntrySize + 1 + sovWire(uint64(mapEntrySize))\n\t\t}\n\t}\n\treturn n\n}\n\nfunc sovWire(x uint64) (n int) {\n\tfor {\n\t\tn++\n\t\tx >>= 7\n\t\tif x == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn n\n}\nfunc sozWire(x uint64) (n int) {\n\treturn sovWire(uint64((x << 1) ^ uint64((int64(x) >> 63))))\n}\nfunc (m *TracerState) Unmarshal(dAtA []byte) error {\n\tl := len(dAtA)\n\tiNdEx := 0\n\tfor iNdEx < l {\n\t\tpreIndex := iNdEx\n\t\tvar wire uint64\n\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\tif shift >= 64 {\n\t\t\t\treturn ErrIntOverflowWire\n\t\t\t}\n\t\t\tif iNdEx >= l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tb := dAtA[iNdEx]\n\t\t\tiNdEx++\n\t\t\twire |= uint64(b&0x7F) << shift\n\t\t\tif b < 0x80 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfieldNum := int32(wire >> 3)\n\t\twireType := int(wire & 0x7)\n\t\tif wireType == 4 {\n\t\t\treturn fmt.Errorf(\"proto: TracerState: wiretype end group for non-group\")\n\t\t}\n\t\tif fieldNum <= 0 {\n\t\t\treturn fmt.Errorf(\"proto: TracerState: illegal tag %d (wire type %d)\", fieldNum, wire)\n\t\t}\n\t\tswitch fieldNum {\n\t\tcase 1:\n\t\t\tif wireType != 1 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field TraceId\", wireType)\n\t\t\t}\n\t\t\tm.TraceId = 0\n\t\t\tif (iNdEx + 8) > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.TraceId = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:]))\n\t\t\tiNdEx += 8\n\t\tcase 2:\n\t\t\tif wireType != 1 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field SpanId\", wireType)\n\t\t\t}\n\t\t\tm.SpanId = 0\n\t\t\tif (iNdEx + 8) > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.SpanId = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:]))\n\t\t\tiNdEx += 8\n\t\tcase 3:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field Sampled\", wireType)\n\t\t\t}\n\t\t\tvar v int\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowWire\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tv |= int(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.Sampled = bool(v != 0)\n\t\tcase 4:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field BaggageItems\", wireType)\n\t\t\t}\n\t\t\tvar msglen int\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowWire\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tmsglen |= int(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif msglen < 0 {\n\t\t\t\treturn ErrInvalidLengthWire\n\t\t\t}\n\t\t\tpostIndex := iNdEx + msglen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthWire\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tif m.BaggageItems == nil {\n\t\t\t\tm.BaggageItems = make(map[string]string)\n\t\t\t}\n\t\t\tvar mapkey string\n\t\t\tvar mapvalue string\n\t\t\tfor iNdEx < postIndex {\n\t\t\t\tentryPreIndex := iNdEx\n\t\t\t\tvar wire uint64\n\t\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\t\tif shift >= 64 {\n\t\t\t\t\t\treturn ErrIntOverflowWire\n\t\t\t\t\t}\n\t\t\t\t\tif iNdEx >= l {\n\t\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t\t}\n\t\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\t\tiNdEx++\n\t\t\t\t\twire |= uint64(b&0x7F) << shift\n\t\t\t\t\tif b < 0x80 {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfieldNum := int32(wire >> 3)\n\t\t\t\tif fieldNum == 1 {\n\t\t\t\t\tvar stringLenmapkey uint64\n\t\t\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\t\t\tif shift >= 64 {\n\t\t\t\t\t\t\treturn ErrIntOverflowWire\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif iNdEx >= l {\n\t\t\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t\t\t}\n\t\t\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\t\t\tiNdEx++\n\t\t\t\t\t\tstringLenmapkey |= uint64(b&0x7F) << shift\n\t\t\t\t\t\tif b < 0x80 {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tintStringLenmapkey := int(stringLenmapkey)\n\t\t\t\t\tif intStringLenmapkey < 0 {\n\t\t\t\t\t\treturn ErrInvalidLengthWire\n\t\t\t\t\t}\n\t\t\t\t\tpostStringIndexmapkey := iNdEx + intStringLenmapkey\n\t\t\t\t\tif postStringIndexmapkey < 0 {\n\t\t\t\t\t\treturn ErrInvalidLengthWire\n\t\t\t\t\t}\n\t\t\t\t\tif postStringIndexmapkey > l {\n\t\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t\t}\n\t\t\t\t\tmapkey = string(dAtA[iNdEx:postStringIndexmapkey])\n\t\t\t\t\tiNdEx = postStringIndexmapkey\n\t\t\t\t} else if fieldNum == 2 {\n\t\t\t\t\tvar stringLenmapvalue uint64\n\t\t\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\t\t\tif shift >= 64 {\n\t\t\t\t\t\t\treturn ErrIntOverflowWire\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif iNdEx >= l {\n\t\t\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t\t\t}\n\t\t\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\t\t\tiNdEx++\n\t\t\t\t\t\tstringLenmapvalue |= uint64(b&0x7F) << shift\n\t\t\t\t\t\tif b < 0x80 {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tintStringLenmapvalue := int(stringLenmapvalue)\n\t\t\t\t\tif intStringLenmapvalue < 0 {\n\t\t\t\t\t\treturn ErrInvalidLengthWire\n\t\t\t\t\t}\n\t\t\t\t\tpostStringIndexmapvalue := iNdEx + intStringLenmapvalue\n\t\t\t\t\tif postStringIndexmapvalue < 0 {\n\t\t\t\t\t\treturn ErrInvalidLengthWire\n\t\t\t\t\t}\n\t\t\t\t\tif postStringIndexmapvalue > l {\n\t\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t\t}\n\t\t\t\t\tmapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])\n\t\t\t\t\tiNdEx = postStringIndexmapvalue\n\t\t\t\t} else {\n\t\t\t\t\tiNdEx = entryPreIndex\n\t\t\t\t\tskippy, err := skipWire(dAtA[iNdEx:])\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\tif skippy < 0 {\n\t\t\t\t\t\treturn ErrInvalidLengthWire\n\t\t\t\t\t}\n\t\t\t\t\tif (iNdEx + skippy) > postIndex {\n\t\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t\t}\n\t\t\t\t\tiNdEx += skippy\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.BaggageItems[mapkey] = mapvalue\n\t\t\tiNdEx = postIndex\n\t\tdefault:\n\t\t\tiNdEx = preIndex\n\t\t\tskippy, err := skipWire(dAtA[iNdEx:])\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif skippy < 0 {\n\t\t\t\treturn ErrInvalidLengthWire\n\t\t\t}\n\t\t\tif (iNdEx + skippy) < 0 {\n\t\t\t\treturn ErrInvalidLengthWire\n\t\t\t}\n\t\t\tif (iNdEx + skippy) > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tiNdEx += skippy\n\t\t}\n\t}\n\n\tif iNdEx > l {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\treturn nil\n}\nfunc skipWire(dAtA []byte) (n int, err error) {\n\tl := len(dAtA)\n\tiNdEx := 0\n\tfor iNdEx < l {\n\t\tvar wire uint64\n\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\tif shift >= 64 {\n\t\t\t\treturn 0, ErrIntOverflowWire\n\t\t\t}\n\t\t\tif iNdEx >= l {\n\t\t\t\treturn 0, io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tb := dAtA[iNdEx]\n\t\t\tiNdEx++\n\t\t\twire |= (uint64(b) & 0x7F) << shift\n\t\t\tif b < 0x80 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\twireType := int(wire & 0x7)\n\t\tswitch wireType {\n\t\tcase 0:\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn 0, ErrIntOverflowWire\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn 0, io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tiNdEx++\n\t\t\t\tif dAtA[iNdEx-1] < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn iNdEx, nil\n\t\tcase 1:\n\t\t\tiNdEx += 8\n\t\t\treturn iNdEx, nil\n\t\tcase 2:\n\t\t\tvar length int\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn 0, ErrIntOverflowWire\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn 0, io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tlength |= (int(b) & 0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif length < 0 {\n\t\t\t\treturn 0, ErrInvalidLengthWire\n\t\t\t}\n\t\t\tiNdEx += length\n\t\t\tif iNdEx < 0 {\n\t\t\t\treturn 0, ErrInvalidLengthWire\n\t\t\t}\n\t\t\treturn iNdEx, nil\n\t\tcase 3:\n\t\t\tfor {\n\t\t\t\tvar innerWire uint64\n\t\t\t\tvar start int = iNdEx\n\t\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\t\tif shift >= 64 {\n\t\t\t\t\t\treturn 0, ErrIntOverflowWire\n\t\t\t\t\t}\n\t\t\t\t\tif iNdEx >= l {\n\t\t\t\t\t\treturn 0, io.ErrUnexpectedEOF\n\t\t\t\t\t}\n\t\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\t\tiNdEx++\n\t\t\t\t\tinnerWire |= (uint64(b) & 0x7F) << shift\n\t\t\t\t\tif b < 0x80 {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tinnerWireType := int(innerWire & 0x7)\n\t\t\t\tif innerWireType == 4 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tnext, err := skipWire(dAtA[start:])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t\tiNdEx = start + next\n\t\t\t\tif iNdEx < 0 {\n\t\t\t\t\treturn 0, ErrInvalidLengthWire\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn iNdEx, nil\n\t\tcase 4:\n\t\t\treturn iNdEx, nil\n\t\tcase 5:\n\t\t\tiNdEx += 4\n\t\t\treturn iNdEx, nil\n\t\tdefault:\n\t\t\treturn 0, fmt.Errorf(\"proto: illegal wireType %d\", wireType)\n\t\t}\n\t}\n\tpanic(\"unreachable\")\n}\n\nvar (\n\tErrInvalidLengthWire = fmt.Errorf(\"proto: negative length found during unmarshaling\")\n\tErrIntOverflowWire = fmt.Errorf(\"proto: integer overflow\")\n)\n"} {"text": "\n \n \n \n \n \n \n \n\n

¿Quieres salir de casa?

\n \n

Indica el motivo por el que vas a salir de casa

\n\n \n \n \n \n\n
\n"} {"text": "/*\n * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com\n * The software in this package is published under the terms of the CPAL v1.0\n * license, a copy of which has been included with this distribution in the\n * LICENSE.txt file.\n */\npackage org.mule.runtime.module.extension.internal.runtime.source;\n\nimport org.mule.runtime.api.component.execution.CompletableCallback;\nimport org.mule.runtime.core.api.event.CoreEvent;\nimport org.mule.runtime.extension.api.runtime.source.Source;\nimport org.mule.runtime.extension.api.runtime.source.SourceCallbackContext;\n\nimport java.util.Map;\n\n/**\n * An abstract wrapper for {@link Source} implementations that allows to intercept\n * all the invocations related to a generic {@link Source} lifecycle and event handlers.\n *\n * @param \n * @param \n *\n * @since 4.1\n */\npublic abstract class SourceWrapper extends Source {\n\n protected final Source delegate;\n\n public SourceWrapper(Source delegate) {\n this.delegate = delegate;\n }\n\n public Source getDelegate() {\n return delegate;\n }\n\n public void onSuccess(CoreEvent event, Map parameters, SourceCallbackContext context,\n CompletableCallback callback) {\n callback.complete(null);\n }\n\n public void onError(CoreEvent event, Map parameters, SourceCallbackContext context,\n CompletableCallback callback) {\n callback.complete(null);\n }\n\n public void onTerminate(CoreEvent event, Map parameters, SourceCallbackContext context,\n CompletableCallback callback) {\n callback.complete(null);\n }\n\n public void onBackPressure(CoreEvent event, Map parameters, SourceCallbackContext context,\n CompletableCallback callback) {\n callback.complete(null);\n }\n}\n"} {"text": "/*\n JPC: An x86 PC Hardware Emulator for a pure Java Virtual Machine\n\n Copyright (C) 2012-2013 Ian Preston\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 published by\n the Free Software Foundation.\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 Details (including contact information) can be found at: \n\n jpc.sourceforge.net\n or the developer website\n sourceforge.net/projects/jpc/\n\n End of licence header\n*/\n\npackage org.jpc.emulator.execution.opcodes.vm;\n\nimport org.jpc.emulator.execution.*;\nimport org.jpc.emulator.execution.decoder.*;\nimport org.jpc.emulator.processor.*;\nimport org.jpc.emulator.processor.fpu64.*;\nimport static org.jpc.emulator.processor.Processor.*;\n\npublic class imul_Ed extends Executable\n{\n final int op1Index;\n\n public imul_Ed(int blockStart, int eip, int prefices, PeekableInputStream input)\n {\n super(blockStart, eip);\n int modrm = input.readU8();\n op1Index = Modrm.Ed(modrm);\n }\n\n public Branch execute(Processor cpu)\n {\n Reg op1 = cpu.regs[op1Index];\n int iop1 = op1.get32();\n int iop2 = cpu.r_eax.get32();\n long res64 = (((long) iop1)*iop2);\n cpu.r_eax.set32((int)res64);\n cpu.r_edx.set32((int)(res64 >> 32));\n cpu.setOSZAPC_Logic32((int)res64);\n if (res64 != (int) res64)\n {\n cpu.of(true);\n cpu.cf(true);\n }\n return Branch.None;\n }\n\n public boolean isBranch()\n {\n return false;\n }\n\n public String toString()\n {\n return this.getClass().getName();\n }\n}"} {"text": "#\n# The Python Imaging Library.\n# $Id$\n#\n# Basic McIdas support for PIL\n#\n# History:\n# 1997-05-05 fl Created (8-bit images only)\n# 2009-03-08 fl Added 16/32-bit support.\n#\n# Thanks to Richard Jones and Craig Swank for specs and samples.\n#\n# Copyright (c) Secret Labs AB 1997.\n# Copyright (c) Fredrik Lundh 1997.\n#\n# See the README file for information on usage and redistribution.\n#\n\nimport struct\nfrom . import Image, ImageFile\n\n__version__ = \"0.2\"\n\n\ndef _accept(s):\n return s[:8] == b\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x04\"\n\n\n##\n# Image plugin for McIdas area images.\n\nclass McIdasImageFile(ImageFile.ImageFile):\n\n format = \"MCIDAS\"\n format_description = \"McIdas area file\"\n\n def _open(self):\n\n # parse area file directory\n s = self.fp.read(256)\n if not _accept(s) or len(s) != 256:\n raise SyntaxError(\"not an McIdas area file\")\n\n self.area_descriptor_raw = s\n self.area_descriptor = w = [0] + list(struct.unpack(\"!64i\", s))\n\n # get mode\n if w[11] == 1:\n mode = rawmode = \"L\"\n elif w[11] == 2:\n # FIXME: add memory map support\n mode = \"I\"\n rawmode = \"I;16B\"\n elif w[11] == 4:\n # FIXME: add memory map support\n mode = \"I\"\n rawmode = \"I;32B\"\n else:\n raise SyntaxError(\"unsupported McIdas format\")\n\n self.mode = mode\n self.size = w[10], w[9]\n\n offset = w[34] + w[15]\n stride = w[15] + w[10]*w[11]*w[14]\n\n self.tile = [(\"raw\", (0, 0) + self.size, offset, (rawmode, stride, 1))]\n\n\n# --------------------------------------------------------------------\n# registry\n\nImage.register_open(McIdasImageFile.format, McIdasImageFile, _accept)\n\n# no default extension\n"} {"text": "COPYRIGHT NOTIFICATION (C) COPYRIGHT 2004 UNIVERSITY OF CHICAGO\n\nThis program discloses material protectable under copyright laws of the United\nStates. Permission to copy and modify this software and its documentation\nis hereby granted, provided that this notice is retained thereon and on all\ncopies or modifications. The University of Chicago makes no representations\nas to the suitability and operability of this software for any purpose. It\nis provided \"as is\"; without express or implied warranty. Permission is hereby\ngranted to use, reproduce, prepare derivative works, and to redistribute to\nothers, so long as this original copyright notice is retained. Any publication\nresulting from research that made use of this software should cite this document.\n\nThis software was authored by:\n\nSteven J. Benson Mathematics and Computer Science Division Argonne National\nLaboratory Argonne IL 60439\n\nYinyu Ye Department of Management Science and Engineering Stanford University\nStanford, CA U.S.A\n\nAny questions or comments on the software may be directed to benson@mcs.anl.gov\nor yinyu-ye@stanford.edu\n\nArgonne National Laboratory with facilities in the states of Illinois and\nIdaho, is owned by The United States Government, and operated by the University\nof Chicago under provision of a contract with the Department of Energy.\n\nDISCLAIMER\n\nTHIS PROGRAM WAS PREPARED AS AN ACCOUNT OF WORK SPONSORED BY AN AGENCY OF\nTHE UNITED STATES GOVERNMENT. NEITHER THE UNITED STATES GOVERNMENT NOR ANY\nAGENCY THEREOF, NOR THE UNIVERSITY OF CHICAGO, NOR ANY OF THEIR EMPLOYEES\nOR OFFICERS, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL\nLIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS\nOF ANY INFORMATION, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS\nTHAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS. REFERENCE HEREIN TO\nANY SPECIFIC COMMERCIAL PRODUCT, PROCESS, OR SERVICE BY TRADE NAME, TRADEMARK,\nMANUFACTURER, OR OTHERWISE, DOES NOT NECESSARILY CONSTITUTE OR IMPLY ITS ENDORSEMENT,\nRECOMMENDATION, OR FAVORING BY THE UNITED STATES GOVERNMENT OR ANY AGENCY\nTHEREOF. THE VIEW AND OPINIONS OF AUTHORS EXPRESSED HEREIN DO NOT NECESSARILY\nSTATE OR REFLECT THOSE OF THE UNITED STATES GOVERNMENT OR ANY AGENCY THEREOF.\n"} {"text": "\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n DsnIndy.dpr\r\n \r\n \r\n 7.0\r\n \r\n \r\n 0\r\n 0\r\n 1\r\n 1\r\n 0\r\n 0\r\n 1\r\n 1\r\n 1\r\n 0\r\n 0\r\n 1\r\n 0\r\n 1\r\n 1\r\n 1\r\n 0\r\n 0\r\n 0\r\n 0\r\n 0\r\n 1\r\n 0\r\n 1\r\n 1\r\n 1\r\n True\r\n True\r\n WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;\r\n \r\n False\r\n \r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n True\r\n \r\n \r\n 0\r\n 0\r\n 1\r\n True\r\n False\r\n False\r\n 4096\r\n 1048576\r\n 4194304\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n False\r\n \r\n \r\n \r\n \r\n \r\n False\r\n \r\n \r\n \r\n \r\n \r\n False\r\n \r\n \r\n \r\n $00000000\r\n \r\n \r\n \r\n False\r\n False\r\n 1\r\n 0\r\n 0\r\n 0\r\n False\r\n False\r\n False\r\n False\r\n False\r\n 1033\r\n 1252\r\n \r\n \r\n \r\n \r\n 1.0.0.0\r\n \r\n \r\n \r\n \r\n \r\n 1.0.0.0\r\n \r\n \r\n \r\n\r\n"} {"text": "package ml.combust.mleap.core.feature\n\nimport ml.combust.mleap.core.types.{StructField, TensorType}\nimport org.apache.spark.ml.linalg.Vectors\nimport org.scalatest.FunSpec\n\nimport org.apache.spark.ml.util.TestingUtils._\n\n/**\n * Created by mikhail on 9/18/16.\n */\nclass MaxAbsScalerModelSpec extends FunSpec {\n describe(\"Max Abs Scaler Model\") {\n val scaler = MaxAbsScalerModel(Vectors.dense(Array(20.0, 10.0, 10.0, 20.0)))\n\n it(\"Scales the vector based on absolute max value\"){\n val inputVector = Vectors.dense(15.0, -5.0, 5.0, 19.0)\n val expectedVector = Vectors.dense(0.75, -0.5, 0.5, 0.95)\n assert(scaler(inputVector) ~= expectedVector relTol 1E-9)\n }\n\n it(\"Has the right input schema\") {\n assert(scaler.inputSchema.fields == Seq(StructField(\"input\", TensorType.Double(4))))\n }\n\n it(\"Has the right output schema\") {\n assert(scaler.outputSchema.fields == Seq(StructField(\"output\", TensorType.Double(4))))\n }\n }\n}\n"} {"text": "// Generated by IcedCoffeeScript 1.7.1-e\n(function() {\n var BaseEngine, ExecEngine, SpawnEngine, bufferify, dos_cmd_escape, dos_flatten_argv, exec, fs, iced, run, semver, set_log, spawn, stream, util, __iced_k, __iced_k_noop, _engine, _log, _quiet, _ref,\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n __slice = [].slice;\n\n iced = require('iced-runtime');\n __iced_k = __iced_k_noop = function() {};\n\n _ref = require('child_process'), exec = _ref.exec, spawn = _ref.spawn;\n\n stream = require('./stream');\n\n util = require('util');\n\n semver = require('semver');\n\n fs = require('fs');\n\n _log = function(x) {\n return process.stderr.write(x.toString('utf8'));\n };\n\n _engine = null;\n\n exports.set_log = set_log = function(log) {\n return _log = log;\n };\n\n exports.set_default_engine = function(e) {\n return _engine = e;\n };\n\n _quiet = null;\n\n exports.set_default_quiet = function(q) {\n return _quiet = q;\n };\n\n BaseEngine = (function() {\n function BaseEngine(_arg) {\n this.args = _arg.args, this.stdin = _arg.stdin, this.stdout = _arg.stdout, this.stderr = _arg.stderr, this.name = _arg.name, this.opts = _arg.opts, this.log = _arg.log;\n this.stderr || (this.stderr = new stream.FnOutStream(this.log || _log));\n this.stdin || (this.stdin = new stream.NullInStream());\n this.stdout || (this.stdout = new stream.NullOutStream());\n this.opts || (this.opts = {});\n this.args || (this.args = []);\n this._exit_cb = null;\n }\n\n BaseEngine.prototype._maybe_call_callback = function() {\n var cb;\n if ((this._exit_cb != null) && this._can_finish()) {\n cb = this._exit_cb;\n this._exit_cb = null;\n return cb(this._err, this._exit_code);\n }\n };\n\n BaseEngine.prototype.wait = function(cb) {\n this._exit_cb = cb;\n return this._maybe_call_callback();\n };\n\n return BaseEngine;\n\n })();\n\n dos_cmd_escape = function(cmd) {\n var c, out;\n out = (function() {\n var _i, _len, _results;\n _results = [];\n for (_i = 0, _len = cmd.length; _i < _len; _i++) {\n c = cmd[_i];\n c = \"\" + c;\n if (c.match(/[&<>()@^| ]/)) {\n _results.push(\"^\" + c);\n } else {\n _results.push(c);\n }\n }\n return _results;\n })();\n return out.join('');\n };\n\n dos_flatten_argv = function(argv) {\n var a;\n return ((function() {\n var _i, _len, _results;\n _results = [];\n for (_i = 0, _len = argv.length; _i < _len; _i++) {\n a = argv[_i];\n _results.push(dos_cmd_escape(a));\n }\n return _results;\n })()).join(' ');\n };\n\n exports.SpawnEngine = SpawnEngine = (function(_super) {\n __extends(SpawnEngine, _super);\n\n function SpawnEngine(_arg) {\n var args, log, name, opts, stderr, stdin, stdout;\n args = _arg.args, stdin = _arg.stdin, stdout = _arg.stdout, stderr = _arg.stderr, name = _arg.name, opts = _arg.opts, log = _arg.log, this.other_fds = _arg.other_fds;\n SpawnEngine.__super__.constructor.call(this, {\n args: args,\n stdin: stdin,\n stdout: stdout,\n stderr: stderr,\n name: name,\n opts: opts,\n log: log\n });\n this._exit_code = null;\n this._err = null;\n this._win32 = process.platform === 'win32';\n this._closed = false;\n this._configure_other_fds();\n }\n\n SpawnEngine.prototype._configure_other_fds = function() {\n var i, k, max, pipes, v, _i, _ref1;\n if (this.other_fds != null) {\n max = 0;\n _ref1 = this.other_fds;\n for (k in _ref1) {\n v = _ref1[k];\n if (k > max) {\n max = k;\n }\n }\n pipes = (function() {\n var _i, _results;\n _results = [];\n for (_i = 0; _i <= 2; _i++) {\n _results.push('pipe');\n }\n return _results;\n })();\n for (i = _i = 3; 3 <= max ? _i <= max : _i >= max; i = 3 <= max ? ++_i : --_i) {\n pipes.push((this.other_fds[i] ? 'pipe' : null));\n }\n return this.opts.stdio = pipes;\n }\n };\n\n SpawnEngine.prototype._spawn = function() {\n var args, cmdline, name, opts;\n args = this.args;\n name = this.name;\n opts = this.opts;\n if (this._win32) {\n cmdline = dos_flatten_argv([name].concat(args));\n args = [\"/s\", \"/c\", '\"' + cmdline + '\"'];\n name = \"cmd.exe\";\n opts = util._extend({}, this.opts);\n opts.windowsVerbatimArguments = true;\n }\n return this.proc = spawn(name, args, opts);\n };\n\n SpawnEngine.prototype._node_v0_10_workarounds = function(cb) {\n var err, fd, stat, ___iced_passed_deferral, __iced_deferrals, __iced_k;\n __iced_k = __iced_k_noop;\n ___iced_passed_deferral = iced.findDeferral(arguments);\n (function(_this) {\n return (function(__iced_k) {\n if (true) {\n (function(__iced_k) {\n __iced_deferrals = new iced.Deferrals(__iced_k, {\n parent: ___iced_passed_deferral,\n filename: \"/home/max/src/iced/iced-spawn/src/cmd.iced\",\n funcname: \"SpawnEngine._node_v0_10_workarounds\"\n });\n fs.fstat(0, __iced_deferrals.defer({\n assign_fn: (function() {\n return function() {\n err = arguments[0];\n return stat = arguments[1];\n };\n })(),\n lineno: 105\n }));\n __iced_deferrals._fulfill();\n })(function() {\n (function(__iced_k) {\n if (typeof err !== \"undefined\" && err !== null) {\n (function(__iced_k) {\n __iced_deferrals = new iced.Deferrals(__iced_k, {\n parent: ___iced_passed_deferral,\n filename: \"/home/max/src/iced/iced-spawn/src/cmd.iced\",\n funcname: \"SpawnEngine._node_v0_10_workarounds\"\n });\n fs.open(process.execPath, \"r\", __iced_deferrals.defer({\n assign_fn: (function() {\n return function() {\n err = arguments[0];\n return fd = arguments[1];\n };\n })(),\n lineno: 107\n }));\n __iced_deferrals._fulfill();\n })(function() {\n return __iced_k(typeof err !== \"undefined\" && err !== null ? console.error(\"Workaround for stdin bug failed: \" + err.message) : void 0);\n });\n } else {\n return __iced_k();\n }\n })(__iced_k);\n });\n } else {\n return __iced_k();\n }\n });\n })(this)((function(_this) {\n return function() {\n return cb();\n };\n })(this));\n };\n\n SpawnEngine.prototype._node_workarounds = function(cb) {\n var ___iced_passed_deferral, __iced_deferrals, __iced_k;\n __iced_k = __iced_k_noop;\n ___iced_passed_deferral = iced.findDeferral(arguments);\n (function(_this) {\n return (function(__iced_k) {\n if (semver.lt(process.version, \"v0.11.0\")) {\n (function(__iced_k) {\n __iced_deferrals = new iced.Deferrals(__iced_k, {\n parent: ___iced_passed_deferral,\n filename: \"/home/max/src/iced/iced-spawn/src/cmd.iced\",\n funcname: \"SpawnEngine._node_workarounds\"\n });\n _this._node_v0_10_workarounds(__iced_deferrals.defer({\n lineno: 119\n }));\n __iced_deferrals._fulfill();\n })(__iced_k);\n } else {\n return __iced_k();\n }\n });\n })(this)((function(_this) {\n return function() {\n return cb();\n };\n })(this));\n };\n\n SpawnEngine.prototype.run = function(cb) {\n if (cb == null) {\n cb = null;\n }\n this._run(cb);\n return this;\n };\n\n SpawnEngine.prototype._run = function(cb) {\n var k, v, ___iced_passed_deferral, __iced_deferrals, __iced_k;\n __iced_k = __iced_k_noop;\n ___iced_passed_deferral = iced.findDeferral(arguments);\n (function(_this) {\n return (function(__iced_k) {\n __iced_deferrals = new iced.Deferrals(__iced_k, {\n parent: ___iced_passed_deferral,\n filename: \"/home/max/src/iced/iced-spawn/src/cmd.iced\",\n funcname: \"SpawnEngine._run\"\n });\n _this._node_workarounds(__iced_deferrals.defer({\n lineno: 133\n }));\n __iced_deferrals._fulfill();\n });\n })(this)((function(_this) {\n return function() {\n var _ref1;\n _this._spawn();\n _this.stdin.pipe(_this.proc.stdin);\n _this.proc.stdout.pipe(_this.stdout);\n _this.proc.stderr.pipe(_this.stderr);\n if (_this.other_fds != null) {\n _ref1 = _this.other_fds;\n for (k in _ref1) {\n v = _ref1[k];\n if (v.is_readable()) {\n v.pipe(_this.proc.stdio[k]);\n } else {\n _this.proc.stdio[k].pipe(v);\n }\n }\n }\n _this.pid = _this.proc.pid;\n _this.proc.on('exit', function(status) {\n return _this._got_exit(status);\n });\n _this.proc.on('error', function(err) {\n return _this._got_error(err);\n });\n _this.proc.on('close', function(code) {\n return _this._got_close(code);\n });\n return typeof cb === \"function\" ? cb(null) : void 0;\n };\n })(this));\n };\n\n SpawnEngine.prototype._got_close = function(code) {\n this._closed = true;\n return this._maybe_call_callback();\n };\n\n SpawnEngine.prototype._got_exit = function(status) {\n this._exit_code = status;\n this.proc = null;\n this.pid = -1;\n return this._maybe_call_callback();\n };\n\n SpawnEngine.prototype._got_error = function(err) {\n this._err = err;\n this.proc = null;\n this.pid = -1;\n return this._maybe_call_callback();\n };\n\n SpawnEngine.prototype._can_finish = function() {\n return ((this._err != null) || (this._exit_code != null)) && this._closed;\n };\n\n return SpawnEngine;\n\n })(BaseEngine);\n\n exports.ExecEngine = ExecEngine = (function(_super) {\n __extends(ExecEngine, _super);\n\n function ExecEngine(_arg) {\n var args, log, name, opts, stderr, stdin, stdout;\n args = _arg.args, stdin = _arg.stdin, stdout = _arg.stdout, stderr = _arg.stderr, name = _arg.name, opts = _arg.opts, log = _arg.log;\n ExecEngine.__super__.constructor.call(this, {\n args: args,\n stdin: stdin,\n stdout: stdout,\n stderr: stderr,\n name: name,\n opts: opts\n });\n this._exec_called_back = false;\n }\n\n ExecEngine.prototype.run = function() {\n var argv;\n argv = [this.name].concat(this.args).join(\" \");\n this.proc = exec(argv, this.opts, (function(_this) {\n return function() {\n var args;\n args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];\n return _this._got_exec_cb.apply(_this, args);\n };\n })(this));\n this.stdin.pipe(this.proc.stdin);\n return this;\n };\n\n ExecEngine.prototype._got_exec_cb = function(err, stdout, stderr) {\n var ___iced_passed_deferral, __iced_deferrals, __iced_k;\n __iced_k = __iced_k_noop;\n ___iced_passed_deferral = iced.findDeferral(arguments);\n (function(_this) {\n return (function(__iced_k) {\n __iced_deferrals = new iced.Deferrals(__iced_k, {\n parent: ___iced_passed_deferral,\n filename: \"/home/max/src/iced/iced-spawn/src/cmd.iced\",\n funcname: \"ExecEngine._got_exec_cb\"\n });\n _this.stdout.write(stdout, __iced_deferrals.defer({\n lineno: 199\n }));\n _this.stderr.write(stderr, __iced_deferrals.defer({\n lineno: 200\n }));\n __iced_deferrals._fulfill();\n });\n })(this)((function(_this) {\n return function() {\n _this._err = err;\n if (_this._err == null) {\n _this._exit_code = 0;\n } else if (_this._err != null) {\n if (_this._err.code === 127) {\n _this._err.errno = 'ENOENT';\n } else {\n _this._exit_code = _this._err.code;\n _this._err = null;\n }\n }\n _this._exec_called_back = true;\n return _this._maybe_call_callback();\n };\n })(this));\n };\n\n ExecEngine.prototype._can_finish = function() {\n return this._exec_called_back;\n };\n\n return ExecEngine;\n\n })(BaseEngine);\n\n exports.Engine = SpawnEngine;\n\n exports.bufferify = bufferify = function(x) {\n if (x == null) {\n return null;\n } else if (typeof x === 'string') {\n return new Buffer(x, 'utf8');\n } else if (Buffer.isBuffer(x)) {\n return x;\n } else {\n return null;\n }\n };\n\n exports.run = run = function(inargs, cb) {\n var args, b, def_out, eklass, eng, engklass, err, log, name, opts, other_fds, out, quiet, rc, stderr, stdin, stdout, ___iced_passed_deferral, __iced_deferrals, __iced_k;\n __iced_k = __iced_k_noop;\n ___iced_passed_deferral = iced.findDeferral(arguments);\n args = inargs.args, stdin = inargs.stdin, stdout = inargs.stdout, stderr = inargs.stderr, quiet = inargs.quiet, name = inargs.name, eklass = inargs.eklass, opts = inargs.opts, engklass = inargs.engklass, log = inargs.log, other_fds = inargs.other_fds;\n if ((b = bufferify(stdin)) != null) {\n stdin = new stream.BufferInStream(b);\n }\n if ((quiet || ((_quiet != null) && _quiet)) && (stderr == null)) {\n stderr = new stream.NullOutStream();\n }\n if (stdout == null) {\n def_out = true;\n stdout = new stream.BufferOutStream();\n } else {\n def_out = false;\n }\n err = null;\n engklass || (engklass = _engine || SpawnEngine);\n eng = new engklass({\n args: args,\n stdin: stdin,\n stdout: stdout,\n stderr: stderr,\n name: name,\n opts: opts,\n log: log,\n other_fds: other_fds\n });\n eng.run();\n (function(_this) {\n return (function(__iced_k) {\n __iced_deferrals = new iced.Deferrals(__iced_k, {\n parent: ___iced_passed_deferral,\n filename: \"/home/max/src/iced/iced-spawn/src/cmd.iced\"\n });\n eng.wait(__iced_deferrals.defer({\n assign_fn: (function() {\n return function() {\n err = arguments[0];\n return rc = arguments[1];\n };\n })(),\n lineno: 250\n }));\n __iced_deferrals._fulfill();\n });\n })(this)((function(_this) {\n return function() {\n if ((err == null) && (rc !== 0)) {\n eklass || (eklass = Error);\n err = new eklass(\"exit code \" + rc);\n err.rc = rc;\n }\n out = def_out ? stdout.data() : null;\n return cb(err, out);\n };\n })(this));\n };\n\n}).call(this);\n"} {"text": "/****************************************************************************\n**\n** This file is part of the LibreCAD project, a 2D CAD program\n**\n** Copyright (C) 2010 R. van Twisk (librecad@rvt.dds.nl)\n** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.\n**\n**\n** This file may be distributed and/or modified under the terms of the\n** GNU General Public License version 2 as published by the Free Software \n** Foundation and appearing in the file gpl-2.0.txt included in the\n** packaging of this file.\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** This copyright notice MUST APPEAR in all copies of the script! \n**\n**********************************************************************/\n\n#ifndef RS_ACTIONZOOMPAN_H\n#define RS_ACTIONZOOMPAN_H\n\n#include \"rs_actioninterface.h\"\n\n\n/**\n * This action class can handle user events to zoom in a window.\n *\n * @author Andrew Mustun\n */\nclass RS_ActionZoomPan : public RS_ActionInterface {\n\tQ_OBJECT\npublic:\n /*\n ** Action States.\n */\n enum Status {\n SetPanStart, /**< Setting Start. */\n SetPanning, /**< Setting panning. */\n SetPanEnd, /**< Setting End */\n };\n\npublic:\n RS_ActionZoomPan(RS_EntityContainer& container,\n RS_GraphicView& graphicView);\n\n\tvoid init(int status=0) override;\n\tvoid trigger() override;\n\tvoid mouseMoveEvent(QMouseEvent* e) override;\n\tvoid mousePressEvent(QMouseEvent* e) override;\n\tvoid mouseReleaseEvent(QMouseEvent* e) override;\n\tvoid updateMouseCursor() override;\n\tvoid updateMouseButtonHints() override;\n\nprotected:\n //RS_Vector v1;\n //RS_Vector v2;\n\tint x1;\n\tint y1;\n\tint x2;\n\tint y2;\n};\n\n#endif\n"} {"text": "15\ncharge = 0\n C -1.704557 0.670848 0.358653\n O -1.726527 -0.641870 -0.285067\n C -0.307346 -0.722922 0.028833\n C 0.965485 -1.122385 -0.668611\n C 1.858897 0.001512 -0.003532\n O 1.011372 1.073121 0.511160\n C -0.223992 0.745998 -0.061175\n H -1.871200 0.580156 1.437284\n H -2.414568 1.359294 -0.099513\n H -0.233517 -1.032254 1.082161\n H 0.907926 -0.987302 -1.749707\n H 1.353154 -2.117289 -0.446812\n H 2.555329 0.422476 -0.732582\n H 2.428726 -0.391758 0.840374\n H -0.241682 1.044886 -1.118943"} {"text": "/*------------------------------------------------------------------------------------------*\\\r\n This file contains material supporting chapter 7 of the cookbook:\r\n Computer Vision Programming using the OpenCV Library.\r\n by Robert Laganiere, Packt Publishing, 2011.\r\n\r\n This program is free software; permission is hereby granted to use, copy, modify,\r\n and distribute this source code, or portions thereof, for any purpose, without fee,\r\n subject to the restriction that the copyright notice may not be removed\r\n or altered from any source or altered source distribution.\r\n The software is released on an as-is basis and without any warranties of any kind.\r\n In particular, the software is not guaranteed to be fault-tolerant or free from failure.\r\n The author disclaims all warranties with regard to this software, any use,\r\n and any consequent failure, is purely the responsibility of the user.\r\n\r\n Copyright (C) 2010-2011 Robert Laganiere, www.laganiere.name\r\n\\*------------------------------------------------------------------------------------------*/\r\n\r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n\r\n#include \"edgedetector.h\"\r\n#include \"linefinder.h\"\r\n\r\n#define PI 3.1415926\r\n\r\nint main()\r\n{\r\n // Read input image\r\n cv::Mat image = cv::imread(\"../images/road.jpg\", 0);\r\n if (!image.data)\r\n return 0;\r\n\r\n // Display the image\r\n cv::namedWindow(\"Original Image\");\r\n cv::imshow(\"Original Image\", image);\r\n\r\n // Compute Sobel\r\n EdgeDetector ed;\r\n ed.computeSobel(image);\r\n\r\n // Display the Sobel orientation\r\n cv::namedWindow(\"Sobel (orientation)\");\r\n cv::imshow(\"Sobel (orientation)\", ed.getSobelOrientationImage());\r\n cv::imwrite(\"ori.bmp\", ed.getSobelOrientationImage());\r\n\r\n // Display the Sobel low threshold\r\n cv::namedWindow(\"Sobel (low threshold)\");\r\n cv::imshow(\"Sobel (low threshold)\", ed.getBinaryMap(125));\r\n\r\n // Display the Sobel high threshold\r\n cv::namedWindow(\"Sobel (high threshold)\");\r\n cv::imshow(\"Sobel (high threshold)\", ed.getBinaryMap(350));\r\n\r\n // Apply Canny algorithm\r\n cv::Mat contours;\r\n cv::Canny(image, contours, 125, 350);\r\n cv::Mat contoursInv;\r\n cv::threshold(contours, contoursInv, 128, 255, cv::THRESH_BINARY_INV);\r\n\r\n // Display the image of contours\r\n cv::namedWindow(\"Canny Contours\");\r\n cv::imshow(\"Canny Contours\", contoursInv);\r\n\r\n // Create a test image\r\n cv::Mat test(200, 200, CV_8U, cv::Scalar(0));\r\n cv::line(test, cv::Point(100, 0), cv::Point(200, 200), cv::Scalar(255));\r\n cv::line(test, cv::Point(0, 50), cv::Point(200, 200), cv::Scalar(255));\r\n cv::line(test, cv::Point(0, 200), cv::Point(200, 0), cv::Scalar(255));\r\n cv::line(test, cv::Point(200, 0), cv::Point(0, 200), cv::Scalar(255));\r\n cv::line(test, cv::Point(100, 0), cv::Point(100, 200), cv::Scalar(255));\r\n cv::line(test, cv::Point(0, 100), cv::Point(200, 100), cv::Scalar(255));\r\n\r\n // Display the test image\r\n cv::namedWindow(\"Test Image\");\r\n cv::imshow(\"Test Image\", test);\r\n cv::imwrite(\"test.bmp\", test);\r\n\r\n // Hough tranform for line detection\r\n std::vector lines;\r\n cv::HoughLines(contours, lines, 1, PI / 180, 60);\r\n\r\n // Draw the lines\r\n cv::Mat result(contours.rows, contours.cols, CV_8U, cv::Scalar(255));\r\n image.copyTo(result);\r\n\r\n std::cout << \"Lines detected: \" << lines.size() << std::endl;\r\n\r\n auto it = lines.begin();\r\n while (it != lines.end())\r\n {\r\n\r\n float rho = (*it)[0]; // first element is distance rho\r\n float theta = (*it)[1]; // second element is angle theta\r\n\r\n if (theta < PI / 4. || theta > 3. * PI / 4.)\r\n { // ~vertical line\r\n\r\n // point of intersection of the line with first row\r\n cv::Point pt1(rho / cos(theta), 0);\r\n // point of intersection of the line with last row\r\n cv::Point pt2((rho - result.rows * sin(theta)) / cos(theta), result.rows);\r\n // draw a white line\r\n cv::line(result, pt1, pt2, cv::Scalar(255), 1);\r\n }\r\n else\r\n { // ~horizontal line\r\n\r\n // point of intersection of the line with first column\r\n cv::Point pt1(0, rho / sin(theta));\r\n // point of intersection of the line with last column\r\n cv::Point pt2(result.cols, (rho - result.cols * cos(theta)) / sin(theta));\r\n // draw a white line\r\n cv::line(result, pt1, pt2, cv::Scalar(255), 1);\r\n }\r\n\r\n std::cout << \"line: (\" << rho << \",\" << theta << \")\\n\";\r\n\r\n ++it;\r\n }\r\n\r\n // Display the detected line image\r\n cv::namedWindow(\"Detected Lines with Hough\");\r\n cv::imshow(\"Detected Lines with Hough\", result);\r\n\r\n // Create LineFinder instance\r\n LineFinder ld;\r\n\r\n // Set probabilistic Hough parameters\r\n ld.setLineLengthAndGap(100, 20);\r\n ld.setMinVote(80);\r\n\r\n // Detect lines\r\n std::vector li = ld.findLines(contours);\r\n ld.drawDetectedLines(image);\r\n cv::namedWindow(\"Detected Lines with HoughP\");\r\n cv::imshow(\"Detected Lines with HoughP\", image);\r\n\r\n auto it2 = li.begin();\r\n while (it2 != li.end())\r\n {\r\n\r\n std::cout << \"(\" << (*it2)[0] << \",\" << (*it2)[1] << \")-(\" << (*it2)[2] << \",\" << (*it2)[3]\r\n << \")\" << std::endl;\r\n\r\n ++it2;\r\n }\r\n\r\n // Display one line\r\n image = cv::imread(\"../images/road.jpg\", 0);\r\n int n = 0;\r\n cv::line(image, cv::Point(li[n][0], li[n][1]), cv::Point(li[n][2], li[n][3]), cv::Scalar(255),\r\n 5);\r\n cv::namedWindow(\"One line of the Image\");\r\n cv::imshow(\"One line of the Image\", image);\r\n\r\n // Extract the contour pixels of the first detected line\r\n cv::Mat oneline(image.size(), CV_8U, cv::Scalar(0));\r\n cv::line(oneline, cv::Point(li[n][0], li[n][1]), cv::Point(li[n][2], li[n][3]), cv::Scalar(255),\r\n 5);\r\n cv::bitwise_and(contours, oneline, oneline);\r\n cv::Mat onelineInv;\r\n cv::threshold(oneline, onelineInv, 128, 255, cv::THRESH_BINARY_INV);\r\n cv::namedWindow(\"One line\");\r\n cv::imshow(\"One line\", onelineInv);\r\n\r\n std::vector points;\r\n\r\n // Iterate over the pixels to obtain all point positions\r\n for (int y = 0; y < oneline.rows; y++)\r\n {\r\n\r\n uchar* rowPtr = oneline.ptr(y);\r\n\r\n for (int x = 0; x < oneline.cols; x++)\r\n {\r\n\r\n // if on a contour\r\n if (rowPtr[x])\r\n {\r\n\r\n points.push_back(cv::Point(x, y));\r\n }\r\n }\r\n }\r\n\r\n // find the best fitting line\r\n cv::Vec4f line;\r\n cv::fitLine(cv::Mat(points), line, cv::DIST_L2, 0, 0.01, 0.01);\r\n\r\n std::cout << \"line: (\" << line[0] << \",\" << line[1] << \")(\" << line[2] << \",\" << line[3]\r\n << \")\\n\";\r\n\r\n int x0 = line[2];\r\n int y0 = line[3];\r\n int x1 = x0 - 200 * line[0];\r\n int y1 = y0 - 200 * line[1];\r\n image = cv::imread(\"../images/road.jpg\", 0);\r\n cv::line(image, cv::Point(x0, y0), cv::Point(x1, y1), cv::Scalar(0), 3);\r\n cv::namedWindow(\"Estimated line\");\r\n cv::imshow(\"Estimated line\", image);\r\n\r\n // eliminate inconsistent lines\r\n ld.removeLinesOfInconsistentOrientations(ed.getOrientation(), 0.4, 0.1);\r\n\r\n // Display the detected line image\r\n image = cv::imread(\"../images/road.jpg\", 0);\r\n ld.drawDetectedLines(image);\r\n cv::namedWindow(\"Detected Lines (2)\");\r\n cv::imshow(\"Detected Lines (2)\", image);\r\n\r\n // Create a Hough accumulator\r\n cv::Mat acc(200, 180, CV_8U, cv::Scalar(0));\r\n\r\n // Choose a point\r\n int x = 50, y = 30;\r\n\r\n // loop over all angles\r\n for (int i = 0; i < 180; i++)\r\n {\r\n\r\n double theta = i * PI / 180.;\r\n\r\n // find corresponding rho value\r\n double rho = x * cos(theta) + y * sin(theta);\r\n int j = static_cast(rho + 100.5);\r\n\r\n std::cout << i << \",\" << j << std::endl;\r\n\r\n // increment accumulator\r\n acc.at(j, i)++;\r\n }\r\n\r\n cv::imwrite(\"hough1.bmp\", acc * 100);\r\n\r\n // Choose a second point\r\n x = 30, y = 10;\r\n\r\n // loop over all angles\r\n for (int i = 0; i < 180; i++)\r\n {\r\n\r\n double theta = i * PI / 180.;\r\n double rho = x * cos(theta) + y * sin(theta);\r\n int j = static_cast(rho + 100.5);\r\n\r\n acc.at(j, i)++;\r\n }\r\n\r\n cv::namedWindow(\"Hough Accumulator\");\r\n cv::imshow(\"Hough Accumulator\", acc * 100);\r\n cv::imwrite(\"hough2.bmp\", acc * 100);\r\n\r\n // Detect circles\r\n image = cv::imread(\"../images/chariot.jpg\", 0);\r\n cv::GaussianBlur(image, image, cv::Size(5, 5), 1.5);\r\n std::vector circles;\r\n cv::HoughCircles(image, circles, cv::HOUGH_GRADIENT,\r\n 2, // accumulator resolution (size of the image / 2)\r\n 50, // minimum distance between two circles\r\n 200, // Canny high threshold\r\n 100, // minimum number of votes\r\n 25, 100); // min and max radius\r\n\r\n std::cout << \"Circles: \" << circles.size() << std::endl;\r\n\r\n // Draw the circles\r\n image = cv::imread(\"../images/chariot.jpg\", 0);\r\n auto itc = circles.begin();\r\n\r\n while (itc != circles.end())\r\n {\r\n\r\n cv::circle(image, cv::Point((*itc)[0], (*itc)[1]), // circle centre\r\n (*itc)[2], // circle radius\r\n cv::Scalar(255), // color\r\n 2); // thickness\r\n\r\n ++itc;\r\n }\r\n\r\n cv::namedWindow(\"Detected Circles\");\r\n cv::imshow(\"Detected Circles\", image);\r\n\r\n cv::waitKey();\r\n return 0;\r\n}"} {"text": "\n\n\n\t\n\t\t\n\t\tWOFF Test: Valid trademark Element With Two div Elements in text Element\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t\n\t\t

Test passes if the word PASS appears below.

\n\t\t

The Extended Metadata Block is valid and may be displayed to the user upon request.

\n\t\t
P
\n\t\t

The XML contained in the Extended Metadata Block is below.

\n\t\t
\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<metadata version=\"1.0\">\n\t<trademark>\n\t\t<text>\n\t\t\t<div>Paragraph 1</div>\n\t\t\t<div>Paragraph 2</div>\n\t\t</text>\n\t</trademark>\n</metadata>\n\t\t
\n\t\n"} {"text": "assign('msg',tra(\"Permission denied you cannot view pages like this page\"));\n $smarty->display(\"error.tpl\");\n die; \n}\n*/\nif ($feature_sheet != 'y') {\n\t$smarty->assign('msg', tra(\"This feature is disabled\").\": feature_sheets\");\n\n\t$smarty->display(\"error.tpl\");\n\tdie;\n}\n\nif ($tiki_p_view_sheet != 'y' && $tiki_p_admin != 'y' && $tiki_p_admin_sheet != 'y') {\n\t$smarty->assign('msg', tra(\"Access Denied\").\": feature_sheets\");\n\n\t$smarty->display(\"error.tpl\");\n\tdie;\n}\n\nif (isset($_REQUEST[\"find\"])) {\n\t$find = $_REQUEST[\"find\"];\n} else {\n\t$find = '';\n}\n\n$smarty->assign('find', $find);\n\nif (!isset($_REQUEST[\"sheetId\"])) {\n\t$_REQUEST[\"sheetId\"] = 0;\n}\n\n$smarty->assign('sheetId', $_REQUEST[\"sheetId\"]);\n\n// Individual permissions are checked because we may be trying to edit the gallery\n\n// Check here for indivdual permissions the objectType is 'image galleries' and the id is galleryId\n/*\n$smarty->assign('individual', 'n');\n\nif ($userlib->object_has_one_permission($_REQUEST[\"sheetId\"], 'image gallery')) {\n\t$smarty->assign('individual', 'y');\n\n\tif ($tiki_p_admin != 'y') {\n\t\t// Now get all the permissions that are set for this type of permissions 'image gallery'\n\t\t$perms = $userlib->get_permissions(0, -1, 'permName_desc', '', 'image galleries');\n\n\t\tforeach ($perms[\"data\"] as $perm) {\n\t\t\t$permName = $perm[\"permName\"];\n\n\t\t\tif ($userlib->object_has_permission($user, $_REQUEST[\"sheetId\"], 'image gallery', $permName)) {\n\t\t\t\t$$permName = 'y';\n\n\t\t\t\t$smarty->assign(\"$permName\", 'y');\n\t\t\t} else {\n\t\t\t\t$$permName = 'n';\n\n\t\t\t\t$smarty->assign(\"$permName\", 'n');\n\t\t\t}\n\t\t}\n\t}\n}\n*/\n\n// Init smarty variables to blank values\n//$smarty->assign('theme','');\n$smarty->assign('title', '');\n$smarty->assign('description', '');\n$smarty->assign('edit_mode', 'n');\n$smarty->assign('chart_enabled', (function_exists('imagepng') || function_exists('pdf_new')) ? 'y' : 'n');\n\n// If we are editing an existing gallery prepare smarty variables\nif (isset($_REQUEST[\"edit_mode\"]) && $_REQUEST[\"edit_mode\"]) {\n\tcheck_ticket('sheet');\n\n\t// Get information about this galleryID and fill smarty variables\n\t$smarty->assign('edit_mode', 'y');\n\n\tif ($_REQUEST[\"sheetId\"] > 0) {\n\t\t$info = $sheetlib->get_sheet_info($_REQUEST[\"sheetId\"]);\n\n\t\t$smarty->assign('title', $info[\"title\"]);\n\t\t$smarty->assign('description', $info[\"description\"]);\n\n\t\t$info = $sheetlib->get_sheet_layout($_REQUEST[\"sheetId\"]);\n\n\t\t$smarty->assign('className', $info[\"className\"]);\n\t\t$smarty->assign('headerRow', $info[\"headerRow\"]);\n\t\t$smarty->assign('footerRow', $info[\"footerRow\"]);\n\t}\n\telse\n\t{\n\t\t$smarty->assign('className', 'default');\n\t\t$smarty->assign('headerRow', '0');\n\t\t$smarty->assign('footerRow', '0');\n\t}\n}\n\n// Process the insertion or modification of a gallery here\nif (isset($_REQUEST[\"edit\"])) {\n\tcheck_ticket('sheet');\n\t// Saving information\n\t// If the user is not gallery admin\n\tif ($tiki_p_admin_sheet != 'y' && $tiki_p_admin != 'y') {\n\t\tif ($tiki_p_edit_sheet != 'y') {\n\t\t\t// If you can't create a gallery then you can't edit a gallery because you can't have a gallery\n\t\t\t$smarty->assign('msg', tra(\"Permission denied you cannot create galleries and so you cant edit them\"));\n\n\t\t\t$smarty->display(\"error.tpl\");\n\t\t\tdie;\n\t\t}\n\n\t\t/* No direct permission yet\n\t\t// If the user can create a gallery then check if he can edit THIS gallery\n\t\tif ($_REQUEST[\"sheetId\"] > 0) {\n\t\t\t$info = $imagegallib->get_gallery_info($_REQUEST[\"galleryId\"]);\n\n\t\t\tif (!$user || $info[\"user\"] != $user) {\n\t\t\t\t$smarty->assign('msg', tra(\"Permission denied you cannot edit this gallery\"));\n\n\t\t\t\t$smarty->display(\"error.tpl\");\n\t\t\t\tdie;\n\t\t\t}\n\t\t}*/\n\t}\n\n\t// Everything is ok so we proceed to edit the gallery\n\t$smarty->assign('edit_mode', 'y');\n\t//$smarty->assign_by_ref('theme',$_REQUEST[\"theme\"]);\n\t$smarty->assign_by_ref('title', $_REQUEST[\"title\"]);\n\t$smarty->assign_by_ref('description', $_REQUEST[\"description\"]);\n\n\t$smarty->assign_by_ref('className', $_REQUEST[\"className\"]);\n\t$smarty->assign_by_ref('headerRow', $_REQUEST[\"headerRow\"]);\n\t$smarty->assign_by_ref('footerRow', $_REQUEST[\"footerRow\"]);\n\n\t$gid = $sheetlib->replace_sheet($_REQUEST[\"sheetId\"], $_REQUEST[\"title\"], $_REQUEST[\"description\"], $user );\n\t$sheetlib->replace_layout($gid, $_REQUEST[\"className\"], $_REQUEST[\"headerRow\"], $_REQUEST[\"footerRow\"] );\n\n\t$cat_type = 'sheet';\n\t$cat_objid = $gid;\n\t$cat_desc = substr($_REQUEST[\"description\"], 0, 200);\n\t$cat_name = $_REQUEST[\"title\"];\n\t$cat_href = \"tiki-view_sheets.php?sheetId=\" . $cat_objid;\n\tinclude_once (\"categorize.php\");\n\n\t$smarty->assign('edit_mode', 'n');\n}\n\nif (isset($_REQUEST[\"removesheet\"])) {\n\tif ($tiki_p_admin_sheet != 'y' && $tiki_p_admin != 'y') {\n\n\t\t$smarty->assign('msg', tra(\"Permission denied you cannot remove this gallery\"));\n\n\t\t$smarty->display(\"error.tpl\");\n\t\tdie;\n\t}\n $area = 'delsheet';\n if ($feature_ticketlib2 != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION[\"ticket_$area\"]))) {\n key_check($area);\n\t\t$sheetlib->remove_sheet($_REQUEST[\"removesheet\"]);\n } else {\n key_get($area);\n }\n}\n\nif (!isset($_REQUEST[\"sort_mode\"])) {\n\t$sort_mode = 'title_desc';\n} else {\n\t$sort_mode = $_REQUEST[\"sort_mode\"];\n}\n\n$smarty->assign_by_ref('sort_mode', $sort_mode);\n\n// If offset is set use it if not then use offset =0\n// use the maxRecords php variable to set the limit\n// if sortMode is not set then use lastModif_desc\nif (!isset($_REQUEST[\"offset\"])) {\n\t$offset = 0;\n} else {\n\t$offset = $_REQUEST[\"offset\"];\n}\n\n$smarty->assign_by_ref('offset', $offset);\n\n// Get the list of libraries available for this user (or public galleries)\n// GET ALL GALLERIES SINCE ALL GALLERIES ARE BROWSEABLE\n$sheets = $sheetlib->list_sheets($offset, $maxRecords, $sort_mode, $find);\n\n// If there're more records then assign next_offset\n$cant_pages = ceil($sheets[\"cant\"] / $maxRecords);\n$smarty->assign_by_ref('cant_pages', $cant_pages);\n$smarty->assign('actual_page', 1 + ($offset / $maxRecords));\n\nif ($sheets[\"cant\"] > ($offset + $maxRecords)) {\n\t$smarty->assign('next_offset', $offset + $maxRecords);\n} else {\n\t$smarty->assign('next_offset', -1);\n}\n\n// If offset is > 0 then prev_offset\nif ($offset > 0) {\n\t$smarty->assign('prev_offset', $offset - $maxRecords);\n} else {\n\t$smarty->assign('prev_offset', -1);\n}\n\n$smarty->assign_by_ref('sheets', $sheets[\"data\"]);\n//print_r($galleries[\"data\"]);\n$cat_type = 'sheet';\n$cat_objid = $_REQUEST[\"sheetId\"];\ninclude_once (\"categorize_list.php\");\n\n$section = 'sheet';\ninclude_once ('tiki-section_options.php');\nask_ticket('sheet');\n\n// Display the template\n$smarty->assign('mid', 'tiki-sheets.tpl');\n$smarty->display(\"tiki.tpl\");\n\n?>\n"} {"text": "import {assert} from 'chai';\nimport {describe as context, describe, it} from 'mocha';\n\nimport * as NumberConverter from './number';\n\ndescribe('NumberConverter', () => {\n\t[\n\t\t{\n\t\t\targ: 3.14,\n\t\t\texpected: 3.14,\n\t\t},\n\t\t{\n\t\t\targ: '1.4141356',\n\t\t\texpected: 1.4141356,\n\t\t},\n\t\t{\n\t\t\targ: 'foobar',\n\t\t\texpected: 0,\n\t\t},\n\t\t{\n\t\t\targ: {foo: 'bar'},\n\t\t\texpected: 0,\n\t\t},\n\t].forEach((testCase) => {\n\t\tcontext(`when ${JSON.stringify(testCase.arg)}`, () => {\n\t\t\tit(`should convert to ${testCase.expected}`, () => {\n\t\t\t\tassert.strictEqual(\n\t\t\t\t\tNumberConverter.fromMixed(testCase.arg),\n\t\t\t\t\ttestCase.expected,\n\t\t\t\t);\n\t\t\t});\n\t\t});\n\t});\n\n\tit('should convert number to string', () => {\n\t\tassert.strictEqual(NumberConverter.toString(3.14), '3.14');\n\t});\n});\n"} {"text": "/*\t$NetBSD: if_arc.h,v 1.13 1999/11/19 20:41:19 thorpej Exp $\t*/\n/* $FreeBSD: src/sys/net/if_arc.h,v 1.3 2002/03/19 21:54:16 alfred Exp $ */\n\n/*\n * Copyright (c) 1982, 1986, 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. 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 * from: NetBSD: if_ether.h,v 1.10 1994/06/29 06:37:55 cgd Exp\n * @(#)if_ether.h\t8.1 (Berkeley) 6/10/93\n */\n\n#ifndef _NET_IF_ARC_H_\n#define _NET_IF_ARC_H_\n\n/*\n * Arcnet address - 1 octets\n * don't know who uses this.\n */\nstruct arc_addr {\n\tu_int8_t arc_addr_octet[1];\n} __attribute__((__packed__));\n\n/*\n * Structure of a 2.5MB/s Arcnet header.\n * as given to interface code.\n */\nstruct\tarc_header {\n\tu_int8_t arc_shost;\n\tu_int8_t arc_dhost;\n\tu_int8_t arc_type;\n\t/*\n\t * only present for newstyle encoding with LL fragmentation.\n\t * Don't use sizeof(anything), use ARC_HDR{,NEW}LEN instead.\n\t */\n\tu_int8_t arc_flag;\n\tu_int16_t arc_seqid;\n\n\t/*\n\t * only present in exception packets (arc_flag == 0xff)\n\t */\n\tu_int8_t arc_type2;\t/* same as arc_type */\n\tu_int8_t arc_flag2;\t/* real flag value */\n\tu_int16_t arc_seqid2;\t/* real seqid value */\n} __attribute__((__packed__));\n\n#define\tARC_ADDR_LEN\t\t1\n\n#define\tARC_HDRLEN\t\t3\n#define\tARC_HDRNEWLEN\t\t6\n#define\tARC_HDRNEWLEN_EXC\t10\n\n/* these lengths are data link layer length - 2*ARC_ADDR_LEN */\n#define\tARC_MIN_LEN\t\t1\n#define\tARC_MIN_FORBID_LEN\t254\n#define\tARC_MAX_FORBID_LEN\t256\n#define\tARC_MAX_LEN\t\t508\n\n\n/* RFC 1051 */\n#define\tARCTYPE_IP_OLD\t\t240\t/* IP protocol */\n#define\tARCTYPE_ARP_OLD\t\t241\t/* address resolution protocol */\n\n/* RFC 1201 */\n#define\tARCTYPE_IP\t\t212\t/* IP protocol */\n#define\tARCTYPE_ARP\t\t213\t/* address resolution protocol */\n#define\tARCTYPE_REVARP\t\t214\t/* reverse addr resolution protocol */\n\n#define\tARCTYPE_ATALK\t\t221\t/* Appletalk */\n#define\tARCTYPE_BANIAN\t\t247\t/* Banyan Vines */\n#define\tARCTYPE_IPX\t\t250\t/* Novell IPX */\n\n#define ARCTYPE_INET6\t\t0xc4\t/* IPng */\n#define ARCTYPE_DIAGNOSE\t0x80\t/* as per ANSI/ATA 878.1 */\n\n#define\tARCMTU\t\t\t507\n#define\tARCMIN\t\t\t0\n\n#define ARC_PHDS_MAXMTU\t\t60480\n\nstruct\tarccom {\n\tstruct\t ifnet ac_if;\t\t/* network-visible interface */\n\n\tu_int16_t ac_seqid;\t\t/* seq. id used by PHDS encap. */\n\n\tu_int8_t arc_shost;\n\tu_int8_t arc_dhost;\n\tu_int8_t arc_type;\n\n\tu_int8_t dummy0;\n\tu_int16_t dummy1;\n\tint sflag, fsflag, rsflag;\n\tstruct mbuf *curr_frag;\n\n\tstruct ac_frag {\n\t\tu_int8_t af_maxflag;\t/* from first packet */\n\t\tu_int8_t af_lastseen;\t/* last split flag seen */\n\t\tu_int16_t af_seqid;\n\t\tstruct mbuf *af_packet;\n\t} ac_fragtab[256];\t\t/* indexed by sender ll address */\n};\n\n#ifdef _KERNEL\nextern u_int8_t arcbroadcastaddr;\nextern int arc_ipmtu;\t/* XXX new ip only, no RFC 1051! */\n\nvoid\tarc_ifattach(struct ifnet *, u_int8_t);\nvoid\tarc_ifdetach(struct ifnet *);\nvoid\tarc_storelladdr(struct ifnet *, u_int8_t);\nchar\t*arc_sprintf(u_int8_t *);\nint\tarc_isphds(int);\nvoid\tarc_input(struct ifnet *, struct mbuf *);\nint\tarc_output(struct ifnet *, struct mbuf *,\n\t struct sockaddr *, struct rtentry *);\nint\tarc_ioctl(struct ifnet *, int, caddr_t);\n\nvoid\t\tarc_frag_init(struct ifnet *);\nstruct mbuf *\tarc_frag_next(struct ifnet *);\n#endif\n\n#endif /* _NET_IF_ARC_H_ */\n"} {"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;\n\nnamespace SubSonic.Schema\n{\n public interface ITable : IDBObject\n {\n IEnumerable Relations { get; }\n bool HasRelations { get; }\n IList Columns { get; set; }\n string ClassName { get; set; }\n bool HasPrimaryKey { get; }\n IColumn PrimaryKey { get; }\n IColumn Descriptor { get; }\n\n string CreateSql { get; }\n string DropSql { get; }\n IColumn GetColumn(string columName);\n IRelation GetRelation(string columName);\n IColumn GetColumnByPropertyName(string columName);\n string DropColumnSql(string columnName);\n }\n}"} {"text": "/**\n * The MIT License (MIT)\n *\n * Copyright (C) 2014 Bacon2D Project\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 * @author Roger Felipe Zanoni da Silva \n */\n\n#ifndef _SCROLLBEHAVIORIMPL_H_\n#define _SCROLLBEHAVIORIMPL_H_\n\n#include \"behavior.h\"\n\nclass ScrollBehaviorImpl : public Behavior\n{\n Q_OBJECT\n\n Q_PROPERTY(qreal horizontalStep READ horizontalStep WRITE setHorizontalStep)\n Q_PROPERTY(qreal verticalStep READ verticalStep WRITE setVerticalStep)\n\npublic:\n ScrollBehaviorImpl(QObject *parent = 0)\n\t : Behavior(parent)\n\t , m_horizontalStep(0)\n\t , m_verticalStep(0)\n {}\n\n virtual void update(const int &delta) = 0;\n\n qreal horizontalStep() { return m_horizontalStep; }\n void setHorizontalStep(qreal step) { m_horizontalStep = step; }\n\n qreal verticalStep() { return m_verticalStep; }\n void setVerticalStep(qreal step) { m_verticalStep = step; }\n\nprotected:\n qreal m_horizontalStep;\n qreal m_verticalStep;\n};\n\n#endif\n"} {"text": "CREATE TABLE list (id VARCHAR(2) NOT NULL, value VARCHAR(64) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;\n\nINSERT INTO `list` (`id`, `value`) VALUES ('af', 'Afrikaans');\nINSERT INTO `list` (`id`, `value`) VALUES ('af_NA', 'Afrikaans (Namibia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('af_ZA', 'Afrikaans (South Africa)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ak', 'Akan');\nINSERT INTO `list` (`id`, `value`) VALUES ('ak_GH', 'Akan (Ghana)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sq', 'Albanian');\nINSERT INTO `list` (`id`, `value`) VALUES ('sq_AL', 'Albanian (Albania)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sq_XK', 'Albanian (Kosovo)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sq_MK', 'Albanian (Macedonia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('am', 'Amharic');\nINSERT INTO `list` (`id`, `value`) VALUES ('am_ET', 'Amharic (Ethiopia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar', 'Arabic');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_DZ', 'Arabic (Algeria)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_BH', 'Arabic (Bahrain)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_TD', 'Arabic (Chad)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_KM', 'Arabic (Comoros)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_DJ', 'Arabic (Djibouti)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_EG', 'Arabic (Egypt)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_ER', 'Arabic (Eritrea)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_IQ', 'Arabic (Iraq)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_IL', 'Arabic (Israel)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_JO', 'Arabic (Jordan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_KW', 'Arabic (Kuwait)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_LB', 'Arabic (Lebanon)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_LY', 'Arabic (Libya)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_MR', 'Arabic (Mauritania)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_MA', 'Arabic (Morocco)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_OM', 'Arabic (Oman)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_PS', 'Arabic (Palestinian Territories)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_QA', 'Arabic (Qatar)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_SA', 'Arabic (Saudi Arabia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_SO', 'Arabic (Somalia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_SS', 'Arabic (South Sudan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_SD', 'Arabic (Sudan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_SY', 'Arabic (Syria)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_TN', 'Arabic (Tunisia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_AE', 'Arabic (United Arab Emirates)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_EH', 'Arabic (Western Sahara)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ar_YE', 'Arabic (Yemen)');\nINSERT INTO `list` (`id`, `value`) VALUES ('hy', 'Armenian');\nINSERT INTO `list` (`id`, `value`) VALUES ('hy_AM', 'Armenian (Armenia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('as', 'Assamese');\nINSERT INTO `list` (`id`, `value`) VALUES ('as_IN', 'Assamese (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('az', 'Azerbaijani');\nINSERT INTO `list` (`id`, `value`) VALUES ('az_AZ', 'Azerbaijani (Azerbaijan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('az_Cyrl_AZ', 'Azerbaijani (Cyrillic, Azerbaijan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('az_Cyrl', 'Azerbaijani (Cyrillic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('az_Latn_AZ', 'Azerbaijani (Latin, Azerbaijan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('az_Latn', 'Azerbaijani (Latin)');\nINSERT INTO `list` (`id`, `value`) VALUES ('bm', 'Bambara');\nINSERT INTO `list` (`id`, `value`) VALUES ('bm_Latn_ML', 'Bambara (Latin, Mali)');\nINSERT INTO `list` (`id`, `value`) VALUES ('bm_Latn', 'Bambara (Latin)');\nINSERT INTO `list` (`id`, `value`) VALUES ('eu', 'Basque');\nINSERT INTO `list` (`id`, `value`) VALUES ('eu_ES', 'Basque (Spain)');\nINSERT INTO `list` (`id`, `value`) VALUES ('be', 'Belarusian');\nINSERT INTO `list` (`id`, `value`) VALUES ('be_BY', 'Belarusian (Belarus)');\nINSERT INTO `list` (`id`, `value`) VALUES ('bn', 'Bengali');\nINSERT INTO `list` (`id`, `value`) VALUES ('bn_BD', 'Bengali (Bangladesh)');\nINSERT INTO `list` (`id`, `value`) VALUES ('bn_IN', 'Bengali (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('bs', 'Bosnian');\nINSERT INTO `list` (`id`, `value`) VALUES ('bs_BA', 'Bosnian (Bosnia & Herzegovina)');\nINSERT INTO `list` (`id`, `value`) VALUES ('bs_Cyrl_BA', 'Bosnian (Cyrillic, Bosnia & Herzegovina)');\nINSERT INTO `list` (`id`, `value`) VALUES ('bs_Cyrl', 'Bosnian (Cyrillic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('bs_Latn_BA', 'Bosnian (Latin, Bosnia & Herzegovina)');\nINSERT INTO `list` (`id`, `value`) VALUES ('bs_Latn', 'Bosnian (Latin)');\nINSERT INTO `list` (`id`, `value`) VALUES ('br', 'Breton');\nINSERT INTO `list` (`id`, `value`) VALUES ('br_FR', 'Breton (France)');\nINSERT INTO `list` (`id`, `value`) VALUES ('bg', 'Bulgarian');\nINSERT INTO `list` (`id`, `value`) VALUES ('bg_BG', 'Bulgarian (Bulgaria)');\nINSERT INTO `list` (`id`, `value`) VALUES ('my', 'Burmese');\nINSERT INTO `list` (`id`, `value`) VALUES ('my_MM', 'Burmese (Myanmar (Burma))');\nINSERT INTO `list` (`id`, `value`) VALUES ('ca', 'Catalan');\nINSERT INTO `list` (`id`, `value`) VALUES ('ca_AD', 'Catalan (Andorra)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ca_FR', 'Catalan (France)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ca_IT', 'Catalan (Italy)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ca_ES', 'Catalan (Spain)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh', 'Chinese');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_CN', 'Chinese (China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_HK', 'Chinese (Hong Kong SAR China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_MO', 'Chinese (Macau SAR China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_Hans_CN', 'Chinese (Simplified, China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_Hans_HK', 'Chinese (Simplified, Hong Kong SAR China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_Hans_MO', 'Chinese (Simplified, Macau SAR China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_Hans_SG', 'Chinese (Simplified, Singapore)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_Hans', 'Chinese (Simplified)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_SG', 'Chinese (Singapore)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_TW', 'Chinese (Taiwan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_Hant_HK', 'Chinese (Traditional, Hong Kong SAR China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_Hant_MO', 'Chinese (Traditional, Macau SAR China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_Hant_TW', 'Chinese (Traditional, Taiwan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zh_Hant', 'Chinese (Traditional)');\nINSERT INTO `list` (`id`, `value`) VALUES ('kw', 'Cornish');\nINSERT INTO `list` (`id`, `value`) VALUES ('kw_GB', 'Cornish (United Kingdom)');\nINSERT INTO `list` (`id`, `value`) VALUES ('hr', 'Croatian');\nINSERT INTO `list` (`id`, `value`) VALUES ('hr_BA', 'Croatian (Bosnia & Herzegovina)');\nINSERT INTO `list` (`id`, `value`) VALUES ('hr_HR', 'Croatian (Croatia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('cs', 'Czech');\nINSERT INTO `list` (`id`, `value`) VALUES ('cs_CZ', 'Czech (Czech Republic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('da', 'Danish');\nINSERT INTO `list` (`id`, `value`) VALUES ('da_DK', 'Danish (Denmark)');\nINSERT INTO `list` (`id`, `value`) VALUES ('da_GL', 'Danish (Greenland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('nl', 'Dutch');\nINSERT INTO `list` (`id`, `value`) VALUES ('nl_AW', 'Dutch (Aruba)');\nINSERT INTO `list` (`id`, `value`) VALUES ('nl_BE', 'Dutch (Belgium)');\nINSERT INTO `list` (`id`, `value`) VALUES ('nl_BQ', 'Dutch (Caribbean Netherlands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('nl_CW', 'Dutch (Curaçao)');\nINSERT INTO `list` (`id`, `value`) VALUES ('nl_NL', 'Dutch (Netherlands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('nl_SX', 'Dutch (Sint Maarten)');\nINSERT INTO `list` (`id`, `value`) VALUES ('nl_SR', 'Dutch (Suriname)');\nINSERT INTO `list` (`id`, `value`) VALUES ('dz', 'Dzongkha');\nINSERT INTO `list` (`id`, `value`) VALUES ('dz_BT', 'Dzongkha (Bhutan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en', 'English');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_AS', 'English (American Samoa)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_AI', 'English (Anguilla)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_AG', 'English (Antigua & Barbuda)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_AU', 'English (Australia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_BS', 'English (Bahamas)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_BB', 'English (Barbados)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_BE', 'English (Belgium)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_BZ', 'English (Belize)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_BM', 'English (Bermuda)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_BW', 'English (Botswana)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_IO', 'English (British Indian Ocean Territory)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_VG', 'English (British Virgin Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_CM', 'English (Cameroon)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_CA', 'English (Canada)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_KY', 'English (Cayman Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_CX', 'English (Christmas Island)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_CC', 'English (Cocos (Keeling) Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_CK', 'English (Cook Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_DG', 'English (Diego Garcia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_DM', 'English (Dominica)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_ER', 'English (Eritrea)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_FK', 'English (Falkland Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_FJ', 'English (Fiji)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_GM', 'English (Gambia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_GH', 'English (Ghana)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_GI', 'English (Gibraltar)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_GD', 'English (Grenada)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_GU', 'English (Guam)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_GG', 'English (Guernsey)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_GY', 'English (Guyana)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_HK', 'English (Hong Kong SAR China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_IN', 'English (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_IE', 'English (Ireland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_IM', 'English (Isle of Man)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_JM', 'English (Jamaica)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_JE', 'English (Jersey)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_KE', 'English (Kenya)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_KI', 'English (Kiribati)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_LS', 'English (Lesotho)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_LR', 'English (Liberia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_MO', 'English (Macau SAR China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_MG', 'English (Madagascar)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_MW', 'English (Malawi)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_MY', 'English (Malaysia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_MT', 'English (Malta)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_MH', 'English (Marshall Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_MU', 'English (Mauritius)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_FM', 'English (Micronesia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_MS', 'English (Montserrat)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_NA', 'English (Namibia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_NR', 'English (Nauru)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_NZ', 'English (New Zealand)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_NG', 'English (Nigeria)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_NU', 'English (Niue)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_NF', 'English (Norfolk Island)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_MP', 'English (Northern Mariana Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_PK', 'English (Pakistan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_PW', 'English (Palau)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_PG', 'English (Papua New Guinea)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_PH', 'English (Philippines)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_PN', 'English (Pitcairn Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_PR', 'English (Puerto Rico)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_RW', 'English (Rwanda)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_WS', 'English (Samoa)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_SC', 'English (Seychelles)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_SL', 'English (Sierra Leone)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_SG', 'English (Singapore)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_SX', 'English (Sint Maarten)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_SB', 'English (Solomon Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_ZA', 'English (South Africa)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_SS', 'English (South Sudan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_SH', 'English (St. Helena)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_KN', 'English (St. Kitts & Nevis)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_LC', 'English (St. Lucia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_VC', 'English (St. Vincent & Grenadines)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_SD', 'English (Sudan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_SZ', 'English (Swaziland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_TZ', 'English (Tanzania)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_TK', 'English (Tokelau)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_TO', 'English (Tonga)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_TT', 'English (Trinidad & Tobago)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_TC', 'English (Turks & Caicos Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_TV', 'English (Tuvalu)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_UM', 'English (U.S. Outlying Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_VI', 'English (U.S. Virgin Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_UG', 'English (Uganda)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_GB', 'English (United Kingdom)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_US', 'English (United States)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_VU', 'English (Vanuatu)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_ZM', 'English (Zambia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('en_ZW', 'English (Zimbabwe)');\nINSERT INTO `list` (`id`, `value`) VALUES ('eo', 'Esperanto');\nINSERT INTO `list` (`id`, `value`) VALUES ('et', 'Estonian');\nINSERT INTO `list` (`id`, `value`) VALUES ('et_EE', 'Estonian (Estonia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ee', 'Ewe');\nINSERT INTO `list` (`id`, `value`) VALUES ('ee_GH', 'Ewe (Ghana)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ee_TG', 'Ewe (Togo)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fo', 'Faroese');\nINSERT INTO `list` (`id`, `value`) VALUES ('fo_FO', 'Faroese (Faroe Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fi', 'Finnish');\nINSERT INTO `list` (`id`, `value`) VALUES ('fi_FI', 'Finnish (Finland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr', 'French');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_DZ', 'French (Algeria)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_BE', 'French (Belgium)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_BJ', 'French (Benin)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_BF', 'French (Burkina Faso)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_BI', 'French (Burundi)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_CM', 'French (Cameroon)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_CA', 'French (Canada)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_CF', 'French (Central African Republic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_TD', 'French (Chad)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_KM', 'French (Comoros)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_CG', 'French (Congo - Brazzaville)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_CD', 'French (Congo - Kinshasa)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_CI', 'French (Côte d’Ivoire)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_DJ', 'French (Djibouti)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_GQ', 'French (Equatorial Guinea)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_FR', 'French (France)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_GF', 'French (French Guiana)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_PF', 'French (French Polynesia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_GA', 'French (Gabon)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_GP', 'French (Guadeloupe)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_GN', 'French (Guinea)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_HT', 'French (Haiti)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_LU', 'French (Luxembourg)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_MG', 'French (Madagascar)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_ML', 'French (Mali)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_MQ', 'French (Martinique)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_MR', 'French (Mauritania)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_MU', 'French (Mauritius)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_YT', 'French (Mayotte)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_MC', 'French (Monaco)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_MA', 'French (Morocco)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_NC', 'French (New Caledonia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_NE', 'French (Niger)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_RE', 'French (Réunion)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_RW', 'French (Rwanda)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_SN', 'French (Senegal)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_SC', 'French (Seychelles)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_BL', 'French (St. Barthélemy)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_MF', 'French (St. Martin)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_PM', 'French (St. Pierre & Miquelon)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_CH', 'French (Switzerland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_SY', 'French (Syria)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_TG', 'French (Togo)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_TN', 'French (Tunisia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_VU', 'French (Vanuatu)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fr_WF', 'French (Wallis & Futuna)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ff', 'Fulah');\nINSERT INTO `list` (`id`, `value`) VALUES ('ff_CM', 'Fulah (Cameroon)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ff_GN', 'Fulah (Guinea)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ff_MR', 'Fulah (Mauritania)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ff_SN', 'Fulah (Senegal)');\nINSERT INTO `list` (`id`, `value`) VALUES ('gl', 'Galician');\nINSERT INTO `list` (`id`, `value`) VALUES ('gl_ES', 'Galician (Spain)');\nINSERT INTO `list` (`id`, `value`) VALUES ('lg', 'Ganda');\nINSERT INTO `list` (`id`, `value`) VALUES ('lg_UG', 'Ganda (Uganda)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ka', 'Georgian');\nINSERT INTO `list` (`id`, `value`) VALUES ('ka_GE', 'Georgian (Georgia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('de', 'German');\nINSERT INTO `list` (`id`, `value`) VALUES ('de_AT', 'German (Austria)');\nINSERT INTO `list` (`id`, `value`) VALUES ('de_BE', 'German (Belgium)');\nINSERT INTO `list` (`id`, `value`) VALUES ('de_DE', 'German (Germany)');\nINSERT INTO `list` (`id`, `value`) VALUES ('de_LI', 'German (Liechtenstein)');\nINSERT INTO `list` (`id`, `value`) VALUES ('de_LU', 'German (Luxembourg)');\nINSERT INTO `list` (`id`, `value`) VALUES ('de_CH', 'German (Switzerland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('el', 'Greek');\nINSERT INTO `list` (`id`, `value`) VALUES ('el_CY', 'Greek (Cyprus)');\nINSERT INTO `list` (`id`, `value`) VALUES ('el_GR', 'Greek (Greece)');\nINSERT INTO `list` (`id`, `value`) VALUES ('gu', 'Gujarati');\nINSERT INTO `list` (`id`, `value`) VALUES ('gu_IN', 'Gujarati (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ha', 'Hausa');\nINSERT INTO `list` (`id`, `value`) VALUES ('ha_GH', 'Hausa (Ghana)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ha_Latn_GH', 'Hausa (Latin, Ghana)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ha_Latn_NE', 'Hausa (Latin, Niger)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ha_Latn_NG', 'Hausa (Latin, Nigeria)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ha_Latn', 'Hausa (Latin)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ha_NE', 'Hausa (Niger)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ha_NG', 'Hausa (Nigeria)');\nINSERT INTO `list` (`id`, `value`) VALUES ('he', 'Hebrew');\nINSERT INTO `list` (`id`, `value`) VALUES ('he_IL', 'Hebrew (Israel)');\nINSERT INTO `list` (`id`, `value`) VALUES ('hi', 'Hindi');\nINSERT INTO `list` (`id`, `value`) VALUES ('hi_IN', 'Hindi (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('hu', 'Hungarian');\nINSERT INTO `list` (`id`, `value`) VALUES ('hu_HU', 'Hungarian (Hungary)');\nINSERT INTO `list` (`id`, `value`) VALUES ('is', 'Icelandic');\nINSERT INTO `list` (`id`, `value`) VALUES ('is_IS', 'Icelandic (Iceland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ig', 'Igbo');\nINSERT INTO `list` (`id`, `value`) VALUES ('ig_NG', 'Igbo (Nigeria)');\nINSERT INTO `list` (`id`, `value`) VALUES ('id', 'Indonesian');\nINSERT INTO `list` (`id`, `value`) VALUES ('id_ID', 'Indonesian (Indonesia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ga', 'Irish');\nINSERT INTO `list` (`id`, `value`) VALUES ('ga_IE', 'Irish (Ireland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('it', 'Italian');\nINSERT INTO `list` (`id`, `value`) VALUES ('it_IT', 'Italian (Italy)');\nINSERT INTO `list` (`id`, `value`) VALUES ('it_SM', 'Italian (San Marino)');\nINSERT INTO `list` (`id`, `value`) VALUES ('it_CH', 'Italian (Switzerland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ja', 'Japanese');\nINSERT INTO `list` (`id`, `value`) VALUES ('ja_JP', 'Japanese (Japan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('kl', 'Kalaallisut');\nINSERT INTO `list` (`id`, `value`) VALUES ('kl_GL', 'Kalaallisut (Greenland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('kn', 'Kannada');\nINSERT INTO `list` (`id`, `value`) VALUES ('kn_IN', 'Kannada (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ks', 'Kashmiri');\nINSERT INTO `list` (`id`, `value`) VALUES ('ks_Arab_IN', 'Kashmiri (Arabic, India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ks_Arab', 'Kashmiri (Arabic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ks_IN', 'Kashmiri (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('kk', 'Kazakh');\nINSERT INTO `list` (`id`, `value`) VALUES ('kk_Cyrl_KZ', 'Kazakh (Cyrillic, Kazakhstan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('kk_Cyrl', 'Kazakh (Cyrillic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('kk_KZ', 'Kazakh (Kazakhstan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('km', 'Khmer');\nINSERT INTO `list` (`id`, `value`) VALUES ('km_KH', 'Khmer (Cambodia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ki', 'Kikuyu');\nINSERT INTO `list` (`id`, `value`) VALUES ('ki_KE', 'Kikuyu (Kenya)');\nINSERT INTO `list` (`id`, `value`) VALUES ('rw', 'Kinyarwanda');\nINSERT INTO `list` (`id`, `value`) VALUES ('rw_RW', 'Kinyarwanda (Rwanda)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ko', 'Korean');\nINSERT INTO `list` (`id`, `value`) VALUES ('ko_KP', 'Korean (North Korea)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ko_KR', 'Korean (South Korea)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ky', 'Kyrgyz');\nINSERT INTO `list` (`id`, `value`) VALUES ('ky_Cyrl_KG', 'Kyrgyz (Cyrillic, Kyrgyzstan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ky_Cyrl', 'Kyrgyz (Cyrillic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ky_KG', 'Kyrgyz (Kyrgyzstan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('lo', 'Lao');\nINSERT INTO `list` (`id`, `value`) VALUES ('lo_LA', 'Lao (Laos)');\nINSERT INTO `list` (`id`, `value`) VALUES ('lv', 'Latvian');\nINSERT INTO `list` (`id`, `value`) VALUES ('lv_LV', 'Latvian (Latvia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ln', 'Lingala');\nINSERT INTO `list` (`id`, `value`) VALUES ('ln_AO', 'Lingala (Angola)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ln_CF', 'Lingala (Central African Republic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ln_CG', 'Lingala (Congo - Brazzaville)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ln_CD', 'Lingala (Congo - Kinshasa)');\nINSERT INTO `list` (`id`, `value`) VALUES ('lt', 'Lithuanian');\nINSERT INTO `list` (`id`, `value`) VALUES ('lt_LT', 'Lithuanian (Lithuania)');\nINSERT INTO `list` (`id`, `value`) VALUES ('lu', 'Luba-Katanga');\nINSERT INTO `list` (`id`, `value`) VALUES ('lu_CD', 'Luba-Katanga (Congo - Kinshasa)');\nINSERT INTO `list` (`id`, `value`) VALUES ('lb', 'Luxembourgish');\nINSERT INTO `list` (`id`, `value`) VALUES ('lb_LU', 'Luxembourgish (Luxembourg)');\nINSERT INTO `list` (`id`, `value`) VALUES ('mk', 'Macedonian');\nINSERT INTO `list` (`id`, `value`) VALUES ('mk_MK', 'Macedonian (Macedonia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('mg', 'Malagasy');\nINSERT INTO `list` (`id`, `value`) VALUES ('mg_MG', 'Malagasy (Madagascar)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ms', 'Malay');\nINSERT INTO `list` (`id`, `value`) VALUES ('ms_BN', 'Malay (Brunei)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ms_Latn_BN', 'Malay (Latin, Brunei)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ms_Latn_MY', 'Malay (Latin, Malaysia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ms_Latn_SG', 'Malay (Latin, Singapore)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ms_Latn', 'Malay (Latin)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ms_MY', 'Malay (Malaysia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ms_SG', 'Malay (Singapore)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ml', 'Malayalam');\nINSERT INTO `list` (`id`, `value`) VALUES ('ml_IN', 'Malayalam (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('mt', 'Maltese');\nINSERT INTO `list` (`id`, `value`) VALUES ('mt_MT', 'Maltese (Malta)');\nINSERT INTO `list` (`id`, `value`) VALUES ('gv', 'Manx');\nINSERT INTO `list` (`id`, `value`) VALUES ('gv_IM', 'Manx (Isle of Man)');\nINSERT INTO `list` (`id`, `value`) VALUES ('mr', 'Marathi');\nINSERT INTO `list` (`id`, `value`) VALUES ('mr_IN', 'Marathi (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('mn', 'Mongolian');\nINSERT INTO `list` (`id`, `value`) VALUES ('mn_Cyrl_MN', 'Mongolian (Cyrillic, Mongolia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('mn_Cyrl', 'Mongolian (Cyrillic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('mn_MN', 'Mongolian (Mongolia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ne', 'Nepali');\nINSERT INTO `list` (`id`, `value`) VALUES ('ne_IN', 'Nepali (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ne_NP', 'Nepali (Nepal)');\nINSERT INTO `list` (`id`, `value`) VALUES ('nd', 'North Ndebele');\nINSERT INTO `list` (`id`, `value`) VALUES ('nd_ZW', 'North Ndebele (Zimbabwe)');\nINSERT INTO `list` (`id`, `value`) VALUES ('se', 'Northern Sami');\nINSERT INTO `list` (`id`, `value`) VALUES ('se_FI', 'Northern Sami (Finland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('se_NO', 'Northern Sami (Norway)');\nINSERT INTO `list` (`id`, `value`) VALUES ('se_SE', 'Northern Sami (Sweden)');\nINSERT INTO `list` (`id`, `value`) VALUES ('no', 'Norwegian');\nINSERT INTO `list` (`id`, `value`) VALUES ('no_NO', 'Norwegian (Norway)');\nINSERT INTO `list` (`id`, `value`) VALUES ('nb', 'Norwegian Bokmål');\nINSERT INTO `list` (`id`, `value`) VALUES ('nb_NO', 'Norwegian Bokmål (Norway)');\nINSERT INTO `list` (`id`, `value`) VALUES ('nb_SJ', 'Norwegian Bokmål (Svalbard & Jan Mayen)');\nINSERT INTO `list` (`id`, `value`) VALUES ('nn', 'Norwegian Nynorsk');\nINSERT INTO `list` (`id`, `value`) VALUES ('nn_NO', 'Norwegian Nynorsk (Norway)');\nINSERT INTO `list` (`id`, `value`) VALUES ('or', 'Oriya');\nINSERT INTO `list` (`id`, `value`) VALUES ('or_IN', 'Oriya (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('om', 'Oromo');\nINSERT INTO `list` (`id`, `value`) VALUES ('om_ET', 'Oromo (Ethiopia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('om_KE', 'Oromo (Kenya)');\nINSERT INTO `list` (`id`, `value`) VALUES ('os', 'Ossetic');\nINSERT INTO `list` (`id`, `value`) VALUES ('os_GE', 'Ossetic (Georgia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('os_RU', 'Ossetic (Russia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ps', 'Pashto');\nINSERT INTO `list` (`id`, `value`) VALUES ('ps_AF', 'Pashto (Afghanistan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fa', 'Persian');\nINSERT INTO `list` (`id`, `value`) VALUES ('fa_AF', 'Persian (Afghanistan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fa_IR', 'Persian (Iran)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pl', 'Polish');\nINSERT INTO `list` (`id`, `value`) VALUES ('pl_PL', 'Polish (Poland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pt', 'Portuguese');\nINSERT INTO `list` (`id`, `value`) VALUES ('pt_AO', 'Portuguese (Angola)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pt_BR', 'Portuguese (Brazil)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pt_CV', 'Portuguese (Cape Verde)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pt_GW', 'Portuguese (Guinea-Bissau)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pt_MO', 'Portuguese (Macau SAR China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pt_MZ', 'Portuguese (Mozambique)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pt_PT', 'Portuguese (Portugal)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pt_ST', 'Portuguese (São Tomé & Príncipe)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pt_TL', 'Portuguese (Timor-Leste)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pa', 'Punjabi');\nINSERT INTO `list` (`id`, `value`) VALUES ('pa_Arab_PK', 'Punjabi (Arabic, Pakistan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pa_Arab', 'Punjabi (Arabic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pa_Guru_IN', 'Punjabi (Gurmukhi, India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pa_Guru', 'Punjabi (Gurmukhi)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pa_IN', 'Punjabi (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('pa_PK', 'Punjabi (Pakistan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('qu', 'Quechua');\nINSERT INTO `list` (`id`, `value`) VALUES ('qu_BO', 'Quechua (Bolivia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('qu_EC', 'Quechua (Ecuador)');\nINSERT INTO `list` (`id`, `value`) VALUES ('qu_PE', 'Quechua (Peru)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ro', 'Romanian');\nINSERT INTO `list` (`id`, `value`) VALUES ('ro_MD', 'Romanian (Moldova)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ro_RO', 'Romanian (Romania)');\nINSERT INTO `list` (`id`, `value`) VALUES ('rm', 'Romansh');\nINSERT INTO `list` (`id`, `value`) VALUES ('rm_CH', 'Romansh (Switzerland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('rn', 'Rundi');\nINSERT INTO `list` (`id`, `value`) VALUES ('rn_BI', 'Rundi (Burundi)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ru', 'Russian');\nINSERT INTO `list` (`id`, `value`) VALUES ('ru_BY', 'Russian (Belarus)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ru_KZ', 'Russian (Kazakhstan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ru_KG', 'Russian (Kyrgyzstan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ru_MD', 'Russian (Moldova)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ru_RU', 'Russian (Russia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ru_UA', 'Russian (Ukraine)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sg', 'Sango');\nINSERT INTO `list` (`id`, `value`) VALUES ('sg_CF', 'Sango (Central African Republic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('gd', 'Scottish Gaelic');\nINSERT INTO `list` (`id`, `value`) VALUES ('gd_GB', 'Scottish Gaelic (United Kingdom)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr', 'Serbian');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_BA', 'Serbian (Bosnia & Herzegovina)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_Cyrl_BA', 'Serbian (Cyrillic, Bosnia & Herzegovina)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_Cyrl_XK', 'Serbian (Cyrillic, Kosovo)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_Cyrl_ME', 'Serbian (Cyrillic, Montenegro)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_Cyrl_RS', 'Serbian (Cyrillic, Serbia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_Cyrl', 'Serbian (Cyrillic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_XK', 'Serbian (Kosovo)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_Latn_BA', 'Serbian (Latin, Bosnia & Herzegovina)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_Latn_XK', 'Serbian (Latin, Kosovo)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_Latn_ME', 'Serbian (Latin, Montenegro)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_Latn_RS', 'Serbian (Latin, Serbia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_Latn', 'Serbian (Latin)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_ME', 'Serbian (Montenegro)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sr_RS', 'Serbian (Serbia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sh', 'Serbo-Croatian');\nINSERT INTO `list` (`id`, `value`) VALUES ('sh_BA', 'Serbo-Croatian (Bosnia & Herzegovina)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sn', 'Shona');\nINSERT INTO `list` (`id`, `value`) VALUES ('sn_ZW', 'Shona (Zimbabwe)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ii', 'Sichuan Yi');\nINSERT INTO `list` (`id`, `value`) VALUES ('ii_CN', 'Sichuan Yi (China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('si', 'Sinhala');\nINSERT INTO `list` (`id`, `value`) VALUES ('si_LK', 'Sinhala (Sri Lanka)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sk', 'Slovak');\nINSERT INTO `list` (`id`, `value`) VALUES ('sk_SK', 'Slovak (Slovakia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sl', 'Slovenian');\nINSERT INTO `list` (`id`, `value`) VALUES ('sl_SI', 'Slovenian (Slovenia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('so', 'Somali');\nINSERT INTO `list` (`id`, `value`) VALUES ('so_DJ', 'Somali (Djibouti)');\nINSERT INTO `list` (`id`, `value`) VALUES ('so_ET', 'Somali (Ethiopia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('so_KE', 'Somali (Kenya)');\nINSERT INTO `list` (`id`, `value`) VALUES ('so_SO', 'Somali (Somalia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es', 'Spanish');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_AR', 'Spanish (Argentina)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_BO', 'Spanish (Bolivia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_IC', 'Spanish (Canary Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_EA', 'Spanish (Ceuta & Melilla)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_CL', 'Spanish (Chile)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_CO', 'Spanish (Colombia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_CR', 'Spanish (Costa Rica)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_CU', 'Spanish (Cuba)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_DO', 'Spanish (Dominican Republic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_EC', 'Spanish (Ecuador)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_SV', 'Spanish (El Salvador)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_GQ', 'Spanish (Equatorial Guinea)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_GT', 'Spanish (Guatemala)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_HN', 'Spanish (Honduras)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_MX', 'Spanish (Mexico)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_NI', 'Spanish (Nicaragua)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_PA', 'Spanish (Panama)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_PY', 'Spanish (Paraguay)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_PE', 'Spanish (Peru)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_PH', 'Spanish (Philippines)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_PR', 'Spanish (Puerto Rico)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_ES', 'Spanish (Spain)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_US', 'Spanish (United States)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_UY', 'Spanish (Uruguay)');\nINSERT INTO `list` (`id`, `value`) VALUES ('es_VE', 'Spanish (Venezuela)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sw', 'Swahili');\nINSERT INTO `list` (`id`, `value`) VALUES ('sw_KE', 'Swahili (Kenya)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sw_TZ', 'Swahili (Tanzania)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sw_UG', 'Swahili (Uganda)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sv', 'Swedish');\nINSERT INTO `list` (`id`, `value`) VALUES ('sv_AX', 'Swedish (Åland Islands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sv_FI', 'Swedish (Finland)');\nINSERT INTO `list` (`id`, `value`) VALUES ('sv_SE', 'Swedish (Sweden)');\nINSERT INTO `list` (`id`, `value`) VALUES ('tl', 'Tagalog');\nINSERT INTO `list` (`id`, `value`) VALUES ('tl_PH', 'Tagalog (Philippines)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ta', 'Tamil');\nINSERT INTO `list` (`id`, `value`) VALUES ('ta_IN', 'Tamil (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ta_MY', 'Tamil (Malaysia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ta_SG', 'Tamil (Singapore)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ta_LK', 'Tamil (Sri Lanka)');\nINSERT INTO `list` (`id`, `value`) VALUES ('te', 'Telugu');\nINSERT INTO `list` (`id`, `value`) VALUES ('te_IN', 'Telugu (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('th', 'Thai');\nINSERT INTO `list` (`id`, `value`) VALUES ('th_TH', 'Thai (Thailand)');\nINSERT INTO `list` (`id`, `value`) VALUES ('bo', 'Tibetan');\nINSERT INTO `list` (`id`, `value`) VALUES ('bo_CN', 'Tibetan (China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('bo_IN', 'Tibetan (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ti', 'Tigrinya');\nINSERT INTO `list` (`id`, `value`) VALUES ('ti_ER', 'Tigrinya (Eritrea)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ti_ET', 'Tigrinya (Ethiopia)');\nINSERT INTO `list` (`id`, `value`) VALUES ('to', 'Tongan');\nINSERT INTO `list` (`id`, `value`) VALUES ('to_TO', 'Tongan (Tonga)');\nINSERT INTO `list` (`id`, `value`) VALUES ('tr', 'Turkish');\nINSERT INTO `list` (`id`, `value`) VALUES ('tr_CY', 'Turkish (Cyprus)');\nINSERT INTO `list` (`id`, `value`) VALUES ('tr_TR', 'Turkish (Turkey)');\nINSERT INTO `list` (`id`, `value`) VALUES ('uk', 'Ukrainian');\nINSERT INTO `list` (`id`, `value`) VALUES ('uk_UA', 'Ukrainian (Ukraine)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ur', 'Urdu');\nINSERT INTO `list` (`id`, `value`) VALUES ('ur_IN', 'Urdu (India)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ur_PK', 'Urdu (Pakistan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ug', 'Uyghur');\nINSERT INTO `list` (`id`, `value`) VALUES ('ug_Arab_CN', 'Uyghur (Arabic, China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ug_Arab', 'Uyghur (Arabic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('ug_CN', 'Uyghur (China)');\nINSERT INTO `list` (`id`, `value`) VALUES ('uz', 'Uzbek');\nINSERT INTO `list` (`id`, `value`) VALUES ('uz_AF', 'Uzbek (Afghanistan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('uz_Arab_AF', 'Uzbek (Arabic, Afghanistan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('uz_Arab', 'Uzbek (Arabic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('uz_Cyrl_UZ', 'Uzbek (Cyrillic, Uzbekistan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('uz_Cyrl', 'Uzbek (Cyrillic)');\nINSERT INTO `list` (`id`, `value`) VALUES ('uz_Latn_UZ', 'Uzbek (Latin, Uzbekistan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('uz_Latn', 'Uzbek (Latin)');\nINSERT INTO `list` (`id`, `value`) VALUES ('uz_UZ', 'Uzbek (Uzbekistan)');\nINSERT INTO `list` (`id`, `value`) VALUES ('vi', 'Vietnamese');\nINSERT INTO `list` (`id`, `value`) VALUES ('vi_VN', 'Vietnamese (Vietnam)');\nINSERT INTO `list` (`id`, `value`) VALUES ('cy', 'Welsh');\nINSERT INTO `list` (`id`, `value`) VALUES ('cy_GB', 'Welsh (United Kingdom)');\nINSERT INTO `list` (`id`, `value`) VALUES ('fy', 'Western Frisian');\nINSERT INTO `list` (`id`, `value`) VALUES ('fy_NL', 'Western Frisian (Netherlands)');\nINSERT INTO `list` (`id`, `value`) VALUES ('yi', 'Yiddish');\nINSERT INTO `list` (`id`, `value`) VALUES ('yo', 'Yoruba');\nINSERT INTO `list` (`id`, `value`) VALUES ('yo_BJ', 'Yoruba (Benin)');\nINSERT INTO `list` (`id`, `value`) VALUES ('yo_NG', 'Yoruba (Nigeria)');\nINSERT INTO `list` (`id`, `value`) VALUES ('zu', 'Zulu');\nINSERT INTO `list` (`id`, `value`) VALUES ('zu_ZA', 'Zulu (South Africa)');\n"} {"text": "module github.com/openset/php2go\n\ngo 1.12\n"} {"text": "//\n// OCTClient+MRCRepository.h\n// MVVMReactiveCocoa\n//\n// Created by leichunfeng on 15/5/14.\n// Copyright (c) 2015年 leichunfeng. All rights reserved.\n//\n\n#import \n\n@interface OCTClient (MRCRepository)\n\n/// Star the given `repository`\n///\n/// repository - The repository to star. Cannot be nil.\n///\n/// Returns a signal, which will send completed on success. If the client\n/// is not `authenticated`, the signal will error immediately.\n- (RACSignal *)mrc_starRepository:(OCTRepository *)repository;\n\n/// Unstar the given `repository`\n///\n/// repository - The repository to unstar. Cannot be nil.\n///\n/// Returns a signal, which will send completed on success. If the client\n/// is not `authenticated`, the signal will error immediately.\n- (RACSignal *)mrc_unstarRepository:(OCTRepository *)repository;\n\n@end\n"} {"text": "\n\n\n\n\t\n\tSample — CKEditor\n\t\n\n\n\t

\n\t\tCKEditor — Posted Data\n\t

\n\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n $value )\n{\n\tif ( get_magic_quotes_gpc() )\n\t\t$postedValue = htmlspecialchars( stripslashes( $value ) ) ;\n\telse\n\t\t$postedValue = htmlspecialchars( $value ) ;\n\n?>\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t
Field NameValue
\n\t
\n\t\t
\n\t\t

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

\n\t\t

\n\t\t\tCopyright © 2003-2013, CKSource - Frederico Knabben. All rights reserved.\n\t\t

\n\t
\n\n\r\n"} {"text": "\n \n 返回\n \n \n \n \n \n
\n \n
短信发送成功,请耐心等待。
\n
\n
    \n
  • {{message}}
  • \n
\n
\n \n \n
\n
\n
\n
\n"} {"text": "\n\n AboutDialog\n \n About Flacon\n Tentang Flacon\n \n \n About\n Tentang\n \n \n Author\n Pembuat\n \n \n Thanks\n Terimakasih\n \n \n Translations\n Terjemahan\n \n \n External programs\n Program eksternal\n \n \n Homepage: %1\n Halaman utama: %1\n \n \n License: %1\n Lisensi: %1\n \n \n Special thanks to:\n Ucapan terimakasih untuk:\n \n \n Flacon uses external programs. Many thanks to their authors!\n Flacon menggunakan program pihak ketiga. Terimakasih banyak kepada para pengembang! \n \n \n Extracts individual tracks from one big audio file containing the entire album.\n Ekstrak setiap lagu dari satu file audio besar yang berisi seluruh album.\n \n \n Copyright: %1-%2 %3\n Copyright: %1-%2 %3\n \n \n Bug tracker %1\n About dialog, About tab\n \n \n \n Flacon is translated into many languages thanks to the work of the Flacon translation teams on <a href='%1'>Transifex</a>.\n Flacon telah diterjemahkan kedalam banyak bahasa, terimakasih atas kerja keras Tim Penerjemah Flacon dalam <a href='%1'>Transifex</a>\n \n \n WavPack support patch\n Thanks on the about page\n \n \n \n Packaging, testing\n Thanks on the about page\n \n \n \n Improvements in the UI\n Thanks on the about page\n \n \n \n Flacon account on github.com\n Thanks on the about page\n Akun Flacon di github.com\n \n \n Icon for application\n Thanks on the about page\n \n \n \n Icons for application\n Thanks on the about page\n \n \n\n\n AddProfileDialog\n \n To create a profile, fill out the following information:\n Add profile dialog, capton\n \n \n \n New profile name:\n Add profile dialog, profile name label\n \n \n \n Audio format:\n Add profile dialog, audio format label\n \n \n \n Create a profile\n Add profile dialog title\n \n \n \n Create a profile\n Button caption\n \n \n\n\n CodePageComboBox\n \n Auto detect\n Codepage auto detection\n Deteksi otomatis\n \n \n Unicode (UTF-8)\n Unicode (UTF-8)\n \n \n Unicode (UTF-16LE)\n Unicode (UTF-16LE)\n \n \n Unicode (UTF-16BE)\n Unicode (UTF-16BE)\n \n \n Cyrillic (Win-1251)\n Cyrillic (Win-1251)\n \n \n Cyrillic (CP-866)\n Cyrillic (CP-866)\n \n \n Latin-1 (ISO-8859-1)\n Latin-1 (ISO-8859-1)\n \n \n Latin-2 (ISO-8859-2)\n Latin-2 (ISO-8859-2)\n \n \n Latin-3 (ISO-8859-3)\n Latin-3 (ISO-8859-3)\n \n \n Latin-4 (ISO-8859-4)\n Latin-4 (ISO-8859-4)\n \n \n Latin-5 (ISO-8859-5)\n Latin-5 (ISO-8859-5)\n \n \n Latin-6 (ISO-8859-6)\n Latin-6 (ISO-8859-6)\n \n \n Latin-7 (ISO-8859-7)\n Latin-7 (ISO-8859-7)\n \n \n Latin-8 (ISO-8859-8)\n Latin-8 (ISO-8859-8)\n \n \n Latin-9 (ISO-8859-9)\n Latin-9 (ISO-8859-9)\n \n \n Latin-10 (ISO-8859-10)\n Latin-10 (ISO-8859-10)\n \n \n Latin-13 (ISO-8859-13)\n Latin-13 (ISO-8859-13)\n \n \n Latin-14 (ISO-8859-14)\n Latin-14 (ISO-8859-14)\n \n \n Latin-15 (ISO-8859-15)\n Latin-15 (ISO-8859-15)\n \n \n Latin-16 (ISO-8859-16)\n Latin-16 (ISO-8859-16)\n \n \n Windows 1250\n Windows 1250\n \n \n Windows 1252\n Windows 1252\n \n \n Windows 1253\n Windows 1253\n \n \n Windows 1254\n Windows 1254\n \n \n Windows 1255\n Windows 1255\n \n \n Windows 1256\n Windows 1256\n \n \n Windows 1257\n Windows 1257\n \n \n Windows 1258\n Windows 1258\n \n\n\n ConfigDialog\n \n Preferences\n Setelan\n \n \n General configuration\n Konfigurasi umum\n \n \n Thread count:\n Jumlah antrian:\n \n \n The number of threads in the conversion process.\n Jumlah antrian dalam proses konversi.\n \n \n Rescan\n Pindai ulang\n \n \n Full path of the external applications\n \n \n \n General\n Config fialog tab title\n Umum\n \n \n Programs\n Config fialog tab title\n Program\n \n \n Select temporary directory\n Pilih direktori lama\n \n \n px\n px\n \n \n Temporary directory:\n Direktori sementara:\n \n \n Default codepage:\n \n \n \n Cover image\n Gambar sampul\n \n \n Do not copy image\n Tidak dapat menyalin gambar\n \n \n Update\n Preferences tab title \n Memperbarui\n \n \n Automatically check for updates\n Otomatis mengecek pembaruan\n \n \n Check now\n Cek sekarang\n \n \n Last check was %1\n Information about last update\n Cek terakhir pada %1\n \n \n Never checked\n Information about last update\n Jangan pernah mengecek\n \n \n Keep original image size\n Pertahankan ukuran gambar original\n \n \n Resize if image size greater than\n Sesuaikan ketika gambar berukuran besar\n \n \n Audio formats\n Config fialog tab title\n \n \n \n +\n \n \n \n -\n \n \n \n Are you sure you want to delete the profile "%1"?\n Message box text\n \n \n \n Delete the profile\n Button caption\n \n \n \n %1:\n Template for the program name label on the preferences form. %1 is a program name.\n \n \n \n CDDB server: \n Preferences dialog label\n \n \n\n\n ConfigPage_Mp3\n \n VBR medium\n VBR medium\n \n \n VBR standard\n VBR standard\n \n \n VBR extreme\n VBR ekstrem\n \n \n VBR quality\n VBR kualitas\n \n \n CBR insane\n CBR super\n \n \n CBR kbps\n CBR kbps\n \n \n ABR kbps\n ABR kbps\n \n \n <dt>VBR medium</dt>\n <dd>By using a medium Variable BitRate, this preset should provide near transparency to most people and most music.</dd>\n\n <dt>VBR standard</dt>\n <dd>By using a standard Variable BitRate, this preset should generally be transparent to most people on most music and is already quite high in quality.</dd>\n\n <dt>VBR extreme</dt>\n <dd>By using the highest possible Variable BitRate, this preset provides slightly higher quality than the standard mode if you have extremely good hearing or high-end audio equipment.</dd>\n\n <dt>VBR quality</dt>\n <dd>This Variable BitRate option lets you specify the output quality.</dd>\n\n <dt>CBR insane</dt>\n <dd>If you must have the absolute highest quality with no regard to file size, you'll achieve it by using this Constant BitRate.</dd>\n\n <dt>CBR kbps</dt>\n <dd>Using this Constant BitRate preset will usually give you good quality at a specified bitrate.</dd>\n\n <dt>ABR kbps</dt>\n <dd>Using this Average BitRate preset will usually give you higher quality than the Constant BitRate option for a specified bitrate.</dd>\n \n Tooltip for the Mp3 presets combobox on preferences dialog.\n \n \n\n\n ConfigPage_Opus\n \n Opus encoding configuration\n Konfigurasi kode Opus\n \n \n Bitrate type:\n Tipe bitrate:\n \n \n Bitrate:\n Bitrate:\n \n \n Sets the target bitrate in kb/s (6-256 per channel).\n<p>\nIn VBR mode, this sets the average rate for a large and diverse collection of audio.\n<p>\nIn CBR mode, it sets the specific output bitrate.\n\n Set target bitrate dalam kb/s (2-256 per chennel)\n<p>\nDalam mode VBR, ini menetapkan rata - rata bitrate untuk \n \n \n <dt>VBR - variable bitrate</dt>\n<dd>Use variable bitrate encoding (recommended). In VBR mode, the bitrate may go up and down freely depending on the content ensure quality consistency.</dd>\n\n<dt>CVBR - constrained variable bitrate</dt>\n<dd>Use constrained variable bitrate encoding. Outputs to a specific bitrate. This mode is analogous to CBR in AAC/MP3 encoders and managed mode in vorbis coders. This delivers less consistent quality than VBR mode but consistent bitrate.</dd>\n \n \n \n VBR - variable bitrate\n Opus encoding mode\n VBR - variable bitrate (Statis)\n \n \n CVBR - constrained variable bitrate\n Opus encoding mode\n \n \n\n\n Converter\n \n Conversion is not possible:\n Konversi tidak memungkinkan:\n \n\n\n CoverDialog\n \n Select cover image\n Pilih gambar cover\n \n \n Without cover image\n Tanpa gambar cover\n \n\n\n CueDiscSelectDialog\n \n Select disc\n \n \n \n The CUE file contains information about multiple discs. Which disc do you want to use?\n \n \n \n %1 [ disc %2 ]\n Cue disc select dialog, string like 'The Wall [disc 1]'\n \n \n\n\n Decoder\n \n I can't write file <b>%1</b>:<br>%2\n Error string, %1 is a filename, %2 error message\n \n \n\n\n Disc\n \n Audio file not set.\n Berkas audio tidak diset\n \n \n Cue file not set.\n \n \n \n Audio file shorter than expected from CUE sheet.\n \n \n \n A maximum of %1-bit per sample is supported by this format. This value will be used for encoding.\n Warning message\n \n \n \n A maximum sample rate of %1 is supported by this format. This value will be used for encoding.\n Warning message\n \n \n\n\n DiscPipeline\n \n I can't rename file:\n%1 to %2\n%3\n Tidak dapat menamai:\n%1 to %2\n%3\n \n\n\n Encoder\n \n Encoder error:\n\n Pengkodean eror:\n\n \n \n I can't read %1 file\n Encoder error. %1 is a file name.\n Tidak dapat membaca %1 berkas\n \n \n I can't rename file:\n%1 to %2\n%3\n Tidak dapat menamai:\n%1 to %2\n%3\n \n\n\n EncoderConfigPage\n \n Sets encoding quality, between %1 (lowest) and %2 (highest).\n Tentukan kualitas encode, antara %1 (rendah) dan %2 (tinggi)\n \n \n Sets compression level, between %1 (fastest) and %2 (highest compression).\nThis only affects the file size. All settings are lossless.\n \n \n \n %1 kbps\n %1 kbps\n \n \n Default\n \n \n\n\n Gain\n \n Gain error:\n\n \n \n\n\n MainWindow\n \n Flacon\n Flacon\n \n \n Result Files\n Berkas Hasil\n \n \n Directory:\n \n \n \n Pattern:\n \n \n \n Format:\n Format:\n \n \n Output format\n Main form tooltip for "Format" edit\n Format keluaran\n \n \n Tags\n Tag\n \n \n Genre:\n Aliran:\n \n \n Year:\n Tahun:\n \n \n Artist:\n Artis:\n \n \n Album:\n Album:\n \n \n Start num:\n \n \n \n Disc ID:\n \n \n \n Codepage:\n \n \n \n &File\n &Berkas\n \n \n &Settings\n &Setelan\n \n \n &Help\n &Bantuan\n \n \n Add CUE or audio file\n \n \n \n Ctrl+O\n Ctrl+O\n \n \n Convert\n \n \n \n Start conversion process\n \n \n \n Ctrl+W\n Ctrl+W\n \n \n Abort\n Batalkan\n \n \n Abort conversion process\n \n \n \n Exit\n Keluar\n \n \n Ctrl+Q\n Ctrl+Q\n \n \n Program preferences\n Pengaturan program\n \n \n Ctrl+Del\n Ctrl+Del\n \n \n Configure encoder\n Konfigurasi pengkodean\n \n \n Get from CDDB\n \n \n \n Get album information from CDDB\n \n \n \n Ctrl+I\n Ctrl+I\n \n \n Recursive album search\n \n \n \n Some albums will not be converted, they contain errors.\nDo you want to continue?\n \n \n \n %1 files\n OpenFile dialog filter line, like "WAV files"\n %1 berkas\n \n \n All supported formats\n OpenFile dialog filter line\n \n \n \n All files\n OpenFile dialog filter line like "All files"\n Semua berkas\n \n \n Select audio file\n OpenFile dialog title\n Pilih berkas audio\n \n \n Select directory\n Pilih direktori\n \n \n <style type="text/css">\n.term {font-weight: bold;}\n.def { white-space: nowrap; }\n</style>\nTokens start with %. You can use the following tokens:\n<table>\n<tr><td class="term">%n</td> <td class="def"> - Track number </td>\n <td class="term">%N</td> <td class="def"> - Total number of tracks</td></tr>\n<tr><td class="term">%a</td> <td class="def"> - Artist</td>\n <td class="term">%A</td> <td class="def"> - Album title</td></tr>\n<tr><td class="term">%t</td> <td class="def"> - Track title</td>\n <td class="term">%y</td> <td class="def"> - Year</td></tr>\n<tr><td class="term">%g</td> <td class="def"> - Genre</td>\n <td class="term"></td> <td class="def"></td></tr>\n</table>\n<br><br>\nIf you surround sections of text that contain a token with braces, these sections will be hidden if the token is empty.\n Main form tooltip for "Pattern" edit\n \n \n \n You can browse to the destination directory. You can also input it manually.\n\nIf the path is left empty or starts with "." (dot), the result files will be placed in the same directory as the source.\n Main form tooltip for "Directory" edit\n \n \n \n Delete current pattern from history\n \n \n \n Preferences\n Setelan\n \n \n About Flacon\n Tentang Flacon\n \n \n Remove current directory from history\n \n \n \n Get data from CDDB\n context menu\n \n \n \n Select CUE file\n OpenFile dialog title\n \n \n \n Add CUE or audio file\n OpenFile dialog title\n \n \n \n Edit all tags…\n Button text\n \n \n \n Check for Updates…\n \n \n \n Edit tags…\n context menu\n \n \n \n Select another audio file…\n context menu\n \n \n \n Select another CUE file…\n context menu\n \n \n \n Album performer:\n \n \n \n Convert selected\n Main menu item\n \n \n \n Start conversion process for the selected tracks\n Main menu item tooltip\n \n \n \n Ctrl+Shift+W\n Main menu item shortcut\n \n \n \n Remove disc\n \n \n \n Remove disc from project\n \n \n \n Ctrl+Shift+O\n \n \n \n Add disc…\n Main menu item\n \n \n \n Add disc\n Toolbar item\n \n \n \n Add folder…\n Main menu item\n \n \n \n Add folder\n Toolbar item\n \n \n\n\n MultiValuesComboBox\n \n Multiple values\n \n \n\n\n MultiValuesLineEdit\n \n Multiple values\n \n \n\n\n MultiValuesSpinBox\n \n Multiple values\n \n \n\n\n OutDirButton\n \n Select directory…\n Menu item for output direcory button\n \n \n \n Standard music location\n Menu item for output direcory button\n \n \n \n Desktop\n Menu item for output direcory button\n \n \n \n Same directory as CUE file\n Menu item for output direcory button\n \n \n \n Select result directory\n \n \n\n\n OutDirComboBox\n \n Same directory as CUE file\n Placeholder for output direcory combobox\n \n \n\n\n OutPatternButton\n \n Insert "Track number"\n \n \n \n Insert "Total number of tracks"\n \n \n \n Insert "Artist"\n \n \n \n Insert "Album title"\n \n \n \n Insert "Track title"\n \n \n \n Insert "Year"\n \n \n \n Insert "Genre"\n \n \n \n Insert "Disc number"\n \n \n \n Insert "Total number of discs"\n \n \n \n Use "%1"\n Predefined out file pattern, string like 'Use "%a/%A/%n - %t"'\n \n \n\n\n ProfileWidget\n \n Resampling settings:\n Preferences dialog: group caption\n \n \n \n Maximum bit depth:\n \n \n \n Maximum sample rate:\n \n \n \n ReplayGain settings:\n \n \n \n Calculate gain:\n \n \n \n Disabled\n Dinonaktifkan\n \n \n Create per track CUE sheet\n Preferences dialog: group caption\n \n \n \n File name format:\n Settings dialog, label for the edit control with name of the created CUE file.\n \n \n \n First track pregap:\n \n \n \n Insert "Artist"\n \n \n \n Insert "Album title"\n \n \n \n Insert "Year"\n \n \n \n Insert "Genre"\n \n \n \n Use "%1"\n Predefined CUE file name, string like 'Use "%a/%A/%n - %t.cue"'\n \n \n \n Extract to separate file\n \n \n \n Add to first track\n Tambahkan ke trek pertama\n \n \n Same as source\n Item in combobox\n \n \n \n 16-bit\n Item in combobox\n \n \n \n 24-bit\n Item in combobox\n \n \n \n 32-bit\n Item in combobox\n \n \n \n 44100 Hz\n Item in combobox\n 44100 Hz\n \n \n 48000 Hz\n Item in combobox\n 48000 Hz\n \n \n 96000 Hz\n Item in combobox\n 96000 Hz\n \n \n 192000 Hz\n Item in combobox\n 192000 Hz\n \n \n Disabled\n ReplayGain type combobox\n Dinonaktifkan\n \n \n Per Track\n ReplayGain type combobox\n \n \n \n Per Album\n ReplayGain type combobox\n \n \n \n ReplayGain is a standard to normalize the perceived loudness of computer audio formats. \n\nThe analysis can be performed on individual tracks, so that all tracks will be of equal volume on playback. \nUsing the album-gain analysis will preserve the volume differences within an album.\n \n \n \n Result Files\n Berkas Hasil\n \n \n Directory:\n Preferences form label text\n \n \n \n You can browse to the destination directory. You can also input it manually.\n\nIf the path is left empty or starts with "." (dot), the result files will be placed in the same directory as the source.\n Preferences form tooltip for "Directory" edit\n \n \n \n Pattern:\n Preferences form label text\n \n \n \n <style type="text/css">\n.term {font-weight: bold;}\n.def { white-space: nowrap; }\n</style>\nTokens start with %. You can use the following tokens:\n<table>\n<tr><td class="term">%n</td> <td class="def"> - Track number </td>\n <td class="term">%N</td> <td class="def"> - Total number of tracks</td></tr>\n<tr><td class="term">%a</td> <td class="def"> - Artist</td>\n <td class="term">%A</td> <td class="def"> - Album title</td></tr>\n<tr><td class="term">%t</td> <td class="def"> - Track title</td>\n <td class="term">%y</td> <td class="def"> - Year</td></tr>\n<tr><td class="term">%g</td> <td class="def"> - Genre</td>\n <td class="term"></td> <td class="def"></td></tr>\n</table>\n<br><br>\nIf you surround sections of text that contain a token with braces, these sections will be hidden if the token is empty.\n Preferences form tooltip for "Pattern" edit\n \n \n \n %1 format\n Preferences dialog: format name label, %1 is a audio format name\n \n \n \n Same directory as CUE file\n Placeholder for output direcory combobox\n \n \n \n %1 encoder settings:\n Preferences group title, %1 is a audio format name\n \n \n\n\n ProgramEdit\n \n Select program file\n \n \n \n All files\n This is part of filter for 'select program' dialog. 'All files (*)'\n Semua berkas\n \n \n %1 program\n This is part of filter for 'select program' dialog. %1 is a name of required program. Example: 'flac program (flac)'\n \n \n\n\n QObject\n \n I can't find program <b>%1</b>.\n Tidak dapat menemukan program <b>%1</b>\n \n \n File <b>%1</b> is not a supported audio file. <br><br>Verify that all required programs are installed and in your preferences.\n \n \n \n Flacon\n Error\n Flacon\n \n \n File <b>"%1"</b> does not exist\n \n \n \n The audio file name is not set\n Nama berkas audio tidak diset\n \n \n you can't use 'ReplayGain' for files with sample rates above 48kHz. Metaflac doesn't support such files.\n This string should begin with a lowercase letter. This is a part of the complex sentence.\n \n \n \n The audio file <b>"%1"</b> does not exist\n Berkas audio <b>"%1"</b> tidak ditemukan\n \n \n I can't create directory "%1".\n Tidak dapat membuat direktori "%1".\n \n \n I can't write to directory "%1".\n Tidak dapat menulis di direktori "%1".\n \n \n I can't copy cover file <b>%1</b>:<br>%2\n \n \n \n I can't read cover image <b>%1</b>:<br>%2\n %1 - is a file name, %2 - an error text\n Tidak bisa membaca gambar cover <b>%1</b>:<br>%2\n \n \n Multiple values\n \n \n \n I can't write CUE file <b>%1</b>:<br>%2\n \n \n \n <b>%1</b> is not a valid CUE file. Incorrect track number on line %2.\n Cue parser error.\n \n \n \n <b>%1</b> is not a valid CUE file. Incorrect track index on line %2.\n Cue parser error.\n \n \n \n <b>%1</b> is not a valid CUE file. The CUE sheet has no FILE tag.\n \n \n \n I can't save cover image <b>%1</b>:<br>%2\n %1 - is file name, %2 - an error text\n \n \n \n <b>%1</b> is not a valid CUE file. Disc %2 has no tags.\n \n \n\n\n Splitter\n \n I can't read <b>%1</b>:<br>%2\n Splitter error. %1 is a file name, %2 is a system error text.\n Tidak dapat membaca <b>%1</b>:<br>%2\n \n\n\n TagEditor\n \n Edit tags\n Dialog title\n \n \n \n of\n \n \n \n Artist:\n Music tag name\n Artis:\n \n \n Album:\n Music tag name\n Album:\n \n \n Genre:\n Music tag name\n Aliran:\n \n \n Year:\n Music tag name\n Tahun:\n \n \n Track title:\n Music tag name\n \n \n \n Comment:\n Music tag name\n \n \n \n Start track number:\n Music tag name\n \n \n \n Album performer:\n Music tag name\n \n \n \n Disc number:\n Music tag name\n \n \n\n\n TrackView\n \n Get data from CDDB\n \n \n \n Select another CUE file…\n \n \n\n\n TrackViewDelegate\n \n Tracks:\n \n \n \n Audio:\n \n \n \n Error\n Status of the track conversion.\n Kesalahan\n \n \n Aborted\n Status of the track conversion.\n Dibatalkan\n \n \n OK\n Status of the track conversion.\n OK\n \n \n Extracting\n Status of the track conversion.\n \n \n \n Encoding\n Status of the track conversion.\n \n \n \n Queued\n Status of the track conversion.\n Diantrekan\n \n \n Calculating gain\n Status of the track conversion.\n \n \n \n Writing gain\n Status of the track conversion.\n \n \n \n Waiting for gain\n Status of the track conversion.\n \n \n\n\n TrackViewModel\n \n Track\n Table header.\n \n \n \n Title\n Table header.\n \n \n \n Artist\n Table header.\n \n \n \n Album\n Table header.\n \n \n \n Comment\n Table header.\n \n \n \n File\n Table header.\n \n \n \n Multiple values\n \n \n \n Length\n Table header.\n Durasi\n \n \n %1:%2:%3\n Track length, string like '01:02:56'\n \n \n \n %1:%2\n Track length, string like '02:56'\n %1:%2\n \n \n The conversion is not possible.\n%1\n \n \n\n\n aacConfigPage\n \n AAC encoding configuration\n Konfigurasi kode AAC\n \n \n Use quality setting (recommended)\n Gunakan pengaturan kualitas (Rekomendasi)\n \n \n Quality:\n ACC preferences: label caption\n Kualitas:\n \n \n Bitrate:\n ACC preferences: label caption\n Bitrate:\n \n \n Sets target bitrate (in kb/s).\n Atur target bitrate (dalam kb/s) \n \n\n\n flacConfigPage\n \n FLAC encoding configuration\n Konfigurasi kode FLAC\n \n \n Compression:\n Kompresi:\n \n\n\n mp3ConfigPage\n \n MP3 encoding configuration\n Konfigurasi kode MP3\n \n \n Preset:\n \n \n \n Bitrate:\n Bitrate:\n \n \n Sets target bitrate (in kb/s).\n Atur target bitrate (dalam kb/s) \n \n \n Quality:\n Kualitas:\n \n\n\n oggConfigPage\n \n Ogg encoding configuration\n Konfigurasi kode Ogg\n \n \n Use quality setting (recommended)\n Gunakan pengaturan kualitas (Rekomendasi)\n \n \n Quality:\n OGG preferences: label caption\n Kualitas:\n \n \n Minimal bitrate:\n Bitrate minimum:\n \n \n Sets minimum bitrate (in kb/s).\n Tentukan bitrate minimum (dalam kb/s)\n \n \n Nominal bitrate:\n Bitrate normal\n \n \n Sets target bitrate (in kb/s).\n Atur target bitrate (dalam kb/s) \n \n \n Maximum bitrate:\n Bitrate Maksimum:\n \n \n Sets maximum bitrate (in kb/s).\n Tentukan bitrate maksimum (dalam kb/s)\n \n\n\n wvConfigPage\n \n WavPack encoding configuration\n Konfigurasi kode WavPack\n \n \n Compression:\n Kompresi:\n \n\n"} {"text": "package org.batfish.datamodel.questions;\n\nimport static com.google.common.base.Preconditions.checkArgument;\nimport static com.google.common.base.Preconditions.checkNotNull;\nimport static com.google.common.collect.Ordering.natural;\nimport static java.util.Comparator.comparing;\nimport static org.batfish.datamodel.questions.BgpRoute.PROP_AS_PATH;\nimport static org.batfish.datamodel.questions.BgpRoute.PROP_COMMUNITIES;\nimport static org.batfish.datamodel.questions.BgpRoute.PROP_LOCAL_PREFERENCE;\nimport static org.batfish.datamodel.questions.BgpRoute.PROP_METRIC;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.google.common.collect.ImmutableSet;\nimport com.google.common.collect.ImmutableSortedSet;\nimport java.util.Objects;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.SortedSet;\nimport java.util.function.Function;\nimport java.util.stream.Stream;\nimport javax.annotation.Nullable;\nimport javax.annotation.ParametersAreNonnullByDefault;\n\n/** A representation of one difference between two routes. */\n@ParametersAreNonnullByDefault\npublic final class BgpRouteDiff implements Comparable {\n private static final String PROP_FIELD_NAME = \"fieldName\";\n private static final String PROP_OLD_VALUE = \"oldValue\";\n private static final String PROP_NEW_VALUE = \"newValue\";\n\n /*\n * We require the field names to match the route field names.\n */\n private static final Set ROUTE_DIFF_FIELD_NAMES =\n ImmutableSet.of(PROP_AS_PATH, PROP_COMMUNITIES, PROP_LOCAL_PREFERENCE, PROP_METRIC);\n\n private final String _fieldName;\n private final String _oldValue;\n private final String _newValue;\n\n public BgpRouteDiff(String fieldName, String oldValue, String newValue) {\n checkArgument(\n ROUTE_DIFF_FIELD_NAMES.contains(fieldName),\n \"fieldName must be one of \" + ROUTE_DIFF_FIELD_NAMES);\n checkArgument(!oldValue.equals(newValue), \"oldValue and newValule must be different\");\n _fieldName = fieldName;\n _oldValue = oldValue;\n _newValue = newValue;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (!(o instanceof BgpRouteDiff)) {\n return false;\n }\n BgpRouteDiff diff = (BgpRouteDiff) o;\n return Objects.equals(_fieldName, diff._fieldName)\n && Objects.equals(_oldValue, diff._oldValue)\n && Objects.equals(_newValue, diff._newValue);\n }\n\n @JsonCreator\n private static BgpRouteDiff jsonCreator(\n @Nullable @JsonProperty(PROP_FIELD_NAME) String fieldName,\n @Nullable @JsonProperty(PROP_OLD_VALUE) String oldValue,\n @Nullable @JsonProperty(PROP_NEW_VALUE) String newValue) {\n checkNotNull(fieldName);\n checkNotNull(oldValue);\n checkNotNull(newValue);\n return new BgpRouteDiff(fieldName, oldValue, newValue);\n }\n\n @JsonProperty(PROP_FIELD_NAME)\n public String getFieldName() {\n return _fieldName;\n }\n\n @JsonProperty(PROP_OLD_VALUE)\n public String getOldValue() {\n return _oldValue;\n }\n\n @Override\n public int hashCode() {\n return Objects.hash(_fieldName, _oldValue, _newValue);\n }\n\n @JsonProperty(PROP_NEW_VALUE)\n public String getNewValue() {\n return _newValue;\n }\n\n /** Compute the differences between two routes */\n public static SortedSet routeDiffs(\n @Nullable BgpRoute route1, @Nullable BgpRoute route2) {\n if (route1 == null || route2 == null || route1.equals(route2)) {\n return ImmutableSortedSet.of();\n }\n\n checkArgument(\n route1\n .toBuilder()\n .setAsPath(route2.getAsPath())\n .setCommunities(route2.getCommunities())\n .setLocalPreference(route2.getLocalPreference())\n .setMetric(route2.getMetric())\n .build()\n .equals(route2),\n \"routeDiffs only supports differences of fields: \" + ROUTE_DIFF_FIELD_NAMES);\n\n return Stream.of(\n routeDiff(route1, route2, PROP_AS_PATH, BgpRoute::getAsPath),\n routeDiff(route1, route2, PROP_COMMUNITIES, BgpRoute::getCommunities),\n routeDiff(route1, route2, PROP_LOCAL_PREFERENCE, BgpRoute::getLocalPreference),\n routeDiff(route1, route2, PROP_METRIC, BgpRoute::getMetric))\n .filter(Optional::isPresent)\n .map(Optional::get)\n .collect(ImmutableSortedSet.toImmutableSortedSet(natural()));\n }\n\n private static Optional routeDiff(\n BgpRoute route1, BgpRoute route2, String name, Function getter) {\n Object o1 = getter.apply(route1);\n Object o2 = getter.apply(route2);\n return o1.equals(o2)\n ? Optional.empty()\n : Optional.of(new BgpRouteDiff(name, o1.toString(), o2.toString()));\n }\n\n @Override\n public int compareTo(BgpRouteDiff that) {\n return comparing(BgpRouteDiff::getFieldName)\n .thenComparing(BgpRouteDiff::getOldValue)\n .thenComparing(BgpRouteDiff::getNewValue)\n .compare(this, that);\n }\n}\n"} {"text": "\n\n\n\n\n"} {"text": "#pragma once\n// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.\n\n\nextern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument = {0x2933BF90, 0x7B36, 0x11d2, {0xB2, 0x0E, 0x00, 0xC0, 0x4F, 0x98, 0x3E, 0x60}};\nextern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument20 = {0xF6D90F11, 0x9C73, 0x11D3, {0xB3, 0x2E, 0x00, 0xC0, 0x4F, 0x99, 0x0B, 0xB4}};\nextern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument26 = {0xf5078f1b, 0xc551, 0x11d3, {0x89, 0xb9, 0x00, 0x00, 0xf8, 0x1f, 0xe2, 0x21}};\nextern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument30 = {0xf5078f32, 0xc551, 0x11d3, {0x89, 0xb9, 0x00, 0x00, 0xf8, 0x1f, 0xe2, 0x21}};\nextern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument40 = {0x88d969c0, 0xf192, 0x11d4, {0xa6, 0x5f, 0x00, 0x40, 0x96, 0x32, 0x51, 0xe5}};\nextern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument50 = {0x88d969e5, 0xf192, 0x11d4, {0xa6, 0x5f, 0x00, 0x40, 0x96, 0x32, 0x51, 0xe5}};\nextern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument60 = {0x88d96a05, 0xf192, 0x11d4, {0xa6, 0x5f, 0x00, 0x40, 0x96, 0x32, 0x51, 0xe5}};\nextern __declspec(selectany) const CLSID XmlUtil_CLSID_XMLSchemaCache = {0x88d969c2, 0xf192, 0x11d4, {0xa6, 0x5f, 0x00, 0x40, 0x96, 0x32, 0x51, 0xe5}};\n\nextern __declspec(selectany) const IID XmlUtil_IID_IXMLDOMDocument = {0x2933BF81, 0x7B36, 0x11D2, {0xB2, 0x0E, 0x00, 0xC0, 0x4F, 0x98, 0x3E, 0x60}};\nextern __declspec(selectany) const IID XmlUtil_IID_IXMLDOMDocument2 = {0x2933BF95, 0x7B36, 0x11D2, {0xB2, 0x0E, 0x00, 0xC0, 0x4F, 0x98, 0x3E, 0x60}};\nextern __declspec(selectany) const IID XmlUtil_IID_IXMLDOMSchemaCollection = {0x373984C8, 0xB845, 0x449B, {0x91, 0xE7, 0x45, 0xAC, 0x83, 0x03, 0x6A, 0xDE}};\n\ntypedef enum XML_LOAD_ATTRIBUTE\n{\n XML_LOAD_PRESERVE_WHITESPACE = 1,\n} XML_LOAD_ATTRIBUTE;\n\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nHRESULT DAPI XmlInitialize();\nvoid DAPI XmlUninitialize();\n\nHRESULT DAPI XmlCreateElement(\n __in IXMLDOMDocument *pixdDocument,\n __in_z LPCWSTR wzElementName,\n __out IXMLDOMElement **ppixnElement\n );\nHRESULT DAPI XmlCreateDocument(\n __in_opt LPCWSTR pwzElementName, \n __out IXMLDOMDocument** ppixdDocument,\n __out_opt IXMLDOMElement** ppixeRootElement = NULL\n );\nHRESULT DAPI XmlLoadDocument(\n __in_z LPCWSTR wzDocument,\n __out IXMLDOMDocument** ppixdDocument\n );\nHRESULT DAPI XmlLoadDocumentEx(\n __in_z LPCWSTR wzDocument,\n __in DWORD dwAttributes,\n __out IXMLDOMDocument** ppixdDocument\n );\nHRESULT DAPI XmlLoadDocumentFromFile(\n __in_z LPCWSTR wzPath,\n __out IXMLDOMDocument** ppixdDocument\n );\nHRESULT DAPI XmlLoadDocumentFromBuffer(\n __in_bcount(cbSource) const BYTE* pbSource,\n __in DWORD cbSource,\n __out IXMLDOMDocument** ppixdDocument\n );\nHRESULT DAPI XmlLoadDocumentFromFileEx(\n __in_z LPCWSTR wzPath,\n __in DWORD dwAttributes,\n __out IXMLDOMDocument** ppixdDocument\n );\nHRESULT DAPI XmlSelectSingleNode(\n __in IXMLDOMNode* pixnParent,\n __in_z LPCWSTR wzXPath,\n __out IXMLDOMNode **ppixnChild\n );\nHRESULT DAPI XmlSetAttribute(\n __in IXMLDOMNode* pixnNode,\n __in_z LPCWSTR pwzAttribute,\n __in_z LPCWSTR pwzAttributeValue\n );\nHRESULT DAPI XmlCreateTextNode(\n __in IXMLDOMDocument *pixdDocument,\n __in_z LPCWSTR wzText,\n __out IXMLDOMText **ppixnTextNode\n );\nHRESULT DAPI XmlGetText(\n __in IXMLDOMNode* pixnNode,\n __deref_out_z BSTR* pbstrText\n );\nHRESULT DAPI XmlGetAttribute(\n __in IXMLDOMNode* pixnNode,\n __in_z LPCWSTR pwzAttribute,\n __deref_out_z BSTR* pbstrAttributeValue\n );\nHRESULT DAPI XmlGetAttributeEx(\n __in IXMLDOMNode* pixnNode,\n __in_z LPCWSTR wzAttribute,\n __deref_out_z LPWSTR* psczAttributeValue\n );\nHRESULT DAPI XmlGetYesNoAttribute(\n __in IXMLDOMNode* pixnNode,\n __in_z LPCWSTR wzAttribute,\n __out BOOL* pfYes\n );\nHRESULT DAPI XmlGetAttributeNumber(\n __in IXMLDOMNode* pixnNode,\n __in_z LPCWSTR pwzAttribute,\n __out DWORD* pdwValue\n );\nHRESULT DAPI XmlGetAttributeNumberBase(\n __in IXMLDOMNode* pixnNode,\n __in_z LPCWSTR pwzAttribute,\n __in int nBase,\n __out DWORD* pdwValue\n );\nHRESULT DAPI XmlGetAttributeLargeNumber(\n __in IXMLDOMNode* pixnNode,\n __in_z LPCWSTR pwzAttribute,\n __out DWORD64* pdw64Value\n );\nHRESULT DAPI XmlGetNamedItem(\n __in IXMLDOMNamedNodeMap *pixnmAttributes, \n __in_opt LPCWSTR wzName, \n __out IXMLDOMNode **ppixnNamedItem\n );\nHRESULT DAPI XmlSetText(\n __in IXMLDOMNode* pixnNode,\n __in_z LPCWSTR pwzText\n );\nHRESULT DAPI XmlSetTextNumber(\n __in IXMLDOMNode *pixnNode,\n __in DWORD dwValue\n );\nHRESULT DAPI XmlCreateChild(\n __in IXMLDOMNode* pixnParent,\n __in_z LPCWSTR pwzElementType,\n __out IXMLDOMNode** ppixnChild\n );\nHRESULT DAPI XmlRemoveAttribute(\n __in IXMLDOMNode* pixnNode,\n __in_z LPCWSTR pwzAttribute\n );\nHRESULT DAPI XmlSelectNodes(\n __in IXMLDOMNode* pixnParent,\n __in_z LPCWSTR wzXPath,\n __out IXMLDOMNodeList **ppixnChild\n );\nHRESULT DAPI XmlNextAttribute(\n __in IXMLDOMNamedNodeMap* pixnnm,\n __out IXMLDOMNode** pixnAttribute,\n __deref_opt_out_z_opt BSTR* pbstrAttribute\n );\nHRESULT DAPI XmlNextElement(\n __in IXMLDOMNodeList* pixnl,\n __out IXMLDOMNode** pixnElement,\n __deref_opt_out_z_opt BSTR* pbstrElement\n );\nHRESULT DAPI XmlRemoveChildren(\n __in IXMLDOMNode* pixnSource,\n __in_z LPCWSTR pwzXPath\n );\nHRESULT DAPI XmlSaveDocument(\n __in IXMLDOMDocument* pixdDocument, \n __inout LPCWSTR wzPath\n );\nHRESULT DAPI XmlSaveDocumentToBuffer(\n __in IXMLDOMDocument* pixdDocument,\n __deref_out_bcount(*pcbDest) BYTE** ppbDest,\n __out DWORD* pcbDest\n );\n\n#ifdef __cplusplus\n}\n#endif\n"} {"text": "[\n {\n \"category\": \"``glue``\", \n \"description\": \"[``botocore``] Update glue client to latest version\", \n \"type\": \"api-change\"\n }, \n {\n \"category\": \"``ec2``\", \n \"description\": \"[``botocore``] Update ec2 client to latest version\", \n \"type\": \"api-change\"\n }\n]"} {"text": "
\n\n

Frequently Asked Questions

\n\n

Some answers to the most commonly asked questions If your question and its answer is not listed below, you can e-mail it to contact@openbeautyfacts.org\nor through the Idea Forum.

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

How can I contact the Open Beauty Facts team, ask questions or make suggestions?

\n\n

You can ask questions or make suggestions on the Idea Forum or contact us by e-mail: contact@openbeautyfacts.org

\n\n\n\n

Is the information and data on products verified?

\n\n

The information and data is submited by the Open Beauty Facts contributors. The contributors also send pictures of the product, its labels, ingredients lists and health and beauty claims.\nWhen in doubt, visitors can thus check the accuracy by themselves, and if there is an error, they can correct it on the spot.

\n\n

To detect potential errors more easily, we will progressively add automated checks. e.g. if the ingredients of a product are very different from\nproducts of the same category, it may be an error.

\n\n\n

Can I add product pictures or data from the manufacturer's site, shopping sites or other sites?

\n\n

Almost all other sites forbid reproduction and reuse of their data and images, and that's actually the reason why we are creating Open Beauty Facts: to make all this data available to all and for all uses.

\n\n

To avoid any legal problem, we therefore ask contributors to only add pictures that they took themselves, and only data that is coming from the product packaging and label.

\n\n\n

I am a cosmetics product manufacturer, can I add my own products?

\n\n

Bəli! The only condition is to accept that the data and the pictures be made available under an open licence. (see the Terms of contribution)

\n\n

If you have a large number of products to add (more than 50), we can try to find a way to automatically add the products and their data. Contact-us to discuss how we could proceed: contact@openbeautyfacts.org

\n\n\n

What is the difference with other web sites, services and mobile applications that already allow to view cosmetics products information?

\n\n

The main difference is for us a critical one: our data is freely available to all and for all uses. It's what is called open data.

\n\n

Almost all other sites, services and applications forbid others from reproducting and reusing their data. Quite to the contrary, the jealously keep it for themselves. In almost all cases,\ntheir terms of service explicitly forbid any non-personal use and any extraction of all the data or parts of the data.

\n\n

We consider that cosmetics products information is too important and useful to keep it locked in a safe. So we decided to do exactly the opposite: not only we allow use and reuse of our database, freely and without fee,\nto everyone and for all uses (including commercial), but we also encourage it!

\n\n

Making the data publicly available (what is know as open data) allows individuals, associations, companies, researchers etc. from all around the world to think up and develop applications for the data that\nwe certainly would never have thought about.

\n\n\n\n

What is Open Beauty Facts' economic model

\n\n

Contributors are volunteers. Their contributions are gathered in an open database that can be used by everyone and for all uses.\n(see the Terms of reuse)

\n\n

Everyone (including but not limited to Open Beauty Facts contributors and creator) can thus redistribute and/or reuse the data to build web sites, services, software, mobile applications, or to\nwrite articles and studies. They are free to make the resulting work freely available, or to sell or monetize it (e.g. with ads), as long as they respect the terms of reuse.

\n\n\n

\n\n

Do you have other questions? Ask them!

\n\n\n
\n"} {"text": "{\n \"parameters\": {\n \"api-version\": \"2019-09-01\",\n \"subscriptionId\": \"subid\"\n },\n \"responses\": {\n \"200\": {\n \"body\": {\n \"value\": [\n {\n \"name\": \"AppGwSslPolicy20150501\",\n \"id\": \"/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20150501\",\n \"properties\": {\n \"cipherSuites\": [\n \"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\",\n \"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\",\n \"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384\",\n \"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256\",\n \"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA\",\n \"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA\",\n \"TLS_DHE_RSA_WITH_AES_256_GCM_SHA384\",\n \"TLS_DHE_RSA_WITH_AES_128_GCM_SHA256\",\n \"TLS_DHE_RSA_WITH_AES_256_CBC_SHA\",\n \"TLS_DHE_RSA_WITH_AES_128_CBC_SHA\",\n \"TLS_RSA_WITH_AES_256_GCM_SHA384\",\n \"TLS_RSA_WITH_AES_128_GCM_SHA256\",\n \"TLS_RSA_WITH_AES_256_CBC_SHA256\",\n \"TLS_RSA_WITH_AES_128_CBC_SHA256\",\n \"TLS_RSA_WITH_AES_256_CBC_SHA\",\n \"TLS_RSA_WITH_AES_128_CBC_SHA\",\n \"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384\",\n \"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256\",\n \"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384\",\n \"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256\",\n \"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA\",\n \"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA\",\n \"TLS_DHE_DSS_WITH_AES_256_CBC_SHA256\",\n \"TLS_DHE_DSS_WITH_AES_128_CBC_SHA256\",\n \"TLS_DHE_DSS_WITH_AES_256_CBC_SHA\",\n \"TLS_DHE_DSS_WITH_AES_128_CBC_SHA\",\n \"TLS_RSA_WITH_3DES_EDE_CBC_SHA\",\n \"TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA\"\n ],\n \"minProtocolVersion\": \"TLSv1_0\"\n }\n },\n {\n \"name\": \"AppGwSslPolicy20170401\",\n \"id\": \"/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401\",\n \"properties\": {\n \"cipherSuites\": [\n \"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256\",\n \"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384\",\n \"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA\",\n \"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA\",\n \"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256\",\n \"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384\",\n \"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\",\n \"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\",\n \"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA\",\n \"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA\",\n \"TLS_RSA_WITH_AES_256_GCM_SHA384\",\n \"TLS_RSA_WITH_AES_128_GCM_SHA256\",\n \"TLS_RSA_WITH_AES_256_CBC_SHA256\",\n \"TLS_RSA_WITH_AES_128_CBC_SHA256\",\n \"TLS_RSA_WITH_AES_256_CBC_SHA\",\n \"TLS_RSA_WITH_AES_128_CBC_SHA\"\n ],\n \"minProtocolVersion\": \"TLSv1_1\"\n }\n },\n {\n \"name\": \"AppGwSslPolicy20170401S\",\n \"id\": \"/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401S\",\n \"properties\": {\n \"cipherSuites\": [\n \"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256\",\n \"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384\",\n \"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA\",\n \"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA\",\n \"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256\",\n \"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384\",\n \"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\",\n \"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\",\n \"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA\",\n \"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA\",\n \"TLS_RSA_WITH_AES_256_GCM_SHA384\",\n \"TLS_RSA_WITH_AES_128_GCM_SHA256\",\n \"TLS_RSA_WITH_AES_256_CBC_SHA256\",\n \"TLS_RSA_WITH_AES_128_CBC_SHA256\",\n \"TLS_RSA_WITH_AES_256_CBC_SHA\",\n \"TLS_RSA_WITH_AES_128_CBC_SHA\"\n ],\n \"minProtocolVersion\": \"TLSv1_2\"\n }\n }\n ]\n }\n }\n }\n}\n"} {"text": "\n#\n# Configuration for Atmel's SAM3N series\n#\n\nsource [find target/swj-dp.tcl]\n\nif { [info exists CHIPNAME] } {\n\tset _CHIPNAME $CHIPNAME\n} else {\n\tset _CHIPNAME at91sam3n\n}\n\nif { [info exists CPUTAPID] } {\n\tset _CPUTAPID $CPUTAPID\n} else {\n\tset _CPUTAPID 0x4ba00477\n}\n\nswj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID\ndap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu\n\nset _TARGETNAME $_CHIPNAME.cpu\ntarget create $_TARGETNAME cortex_m -endian little -dap $_CHIPNAME.dap\n\nset _FLASHNAME $_CHIPNAME.flash\nflash bank flash0 at91sam3 0x00400000 0 0 0 $_TARGETNAME\n\nif {![using_hla]} {\n # if srst is not fitted use SYSRESETREQ to\n # perform a soft reset\n cortex_m reset_config sysresetreq\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#ifndef MSGRAPHSERVICEVIDEO_H\n#define MSGRAPHSERVICEVIDEO_H\n\n#import \n#import \"core/MSOrcChangesTrackingArray.h\"\n\n#import \"core/MSOrcBaseEntity.h\"\n#import \"api/MSOrcInteroperableWithDictionary.h\"\n\n/** Interface MSGraphServiceVideo\n *\n */\n@interface MSGraphServiceVideo : MSOrcBaseEntity \n\n/** Property bitrate\n *\n */\n@property (nonatomic, setter=setBitrate:, getter=bitrate) int bitrate;\n\n/** Property duration\n *\n */\n@property (nonatomic, setter=setDuration:, getter=duration) long long duration;\n\n/** Property height\n *\n */\n@property (nonatomic, setter=setHeight:, getter=height) int height;\n\n/** Property width\n *\n */\n@property (nonatomic, setter=setWidth:, getter=width) int width;\n\n\n+ (NSDictionary *) $$$_$$$propertiesNamesMappings;\n\n\n@end\n\n#endif\n"} {"text": "require('../modules/web.dom.iterable');\nrequire('../modules/es6.string.iterator');\nmodule.exports = require('../modules/core.is-iterable');"} {"text": "en:\n frontend:\n tags_input:\n label: Tags\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 \n\n@class NSDictionary;\n\n@interface CRKFetchIdentitiesTaskResultObject : CATTaskResultObject\n{\n NSDictionary *_courseIdentityInfosByGroupIdentifier;\n}\n\n+ (BOOL)supportsSecureCoding;\n- (void).cxx_destruct;\n@property(copy, nonatomic) NSDictionary *courseIdentityInfosByGroupIdentifier; // @synthesize courseIdentityInfosByGroupIdentifier=_courseIdentityInfosByGroupIdentifier;\n- (id)initWithCoder:(id)arg1;\n- (void)encodeWithCoder:(id)arg1;\n\n@end\n\n"} {"text": "//===----------------------------------------------------------------------===//\n// DuckDB\n//\n// duckdb/planner/operator/logical_delim_join.hpp\n//\n//\n//===----------------------------------------------------------------------===//\n\n#pragma once\n\n#include \"duckdb/planner/operator/logical_comparison_join.hpp\"\n\nnamespace duckdb {\n\n//! LogicalDelimJoin represents a special \"duplicate eliminated\" join. This join type is only used for subquery\n//! flattening, and involves performing duplicate elimination on the LEFT side which is then pushed into the RIGHT side.\nclass LogicalDelimJoin : public LogicalComparisonJoin {\npublic:\n\tLogicalDelimJoin(JoinType type) : LogicalComparisonJoin(type, LogicalOperatorType::DELIM_JOIN) {\n\t}\n\n\t//! The set of columns that will be duplicate eliminated from the LHS and pushed into the RHS\n\tvector> duplicate_eliminated_columns;\n};\n\n} // namespace duckdb\n"} {"text": "Fuse API functions and commands\n\nThe fuse API allows to control a fusebox and how it is used by the upper\nhardware layers.\n\nA fuse corresponds to a single non-volatile memory bit that can be programmed\n(i.e. blown, set to 1) only once. The programming operation is irreversible. A\nfuse that has not been programmed reads 0.\n\nFuses can be used by SoCs to store various permanent configuration and data,\ne.g. boot configuration, security configuration, MAC addresses, etc.\n\nA fuse word is the smallest group of fuses that can be read at once from the\nfusebox control IP registers. This is limited to 32 bits with the current API.\n\nA fuse bank is the smallest group of fuse words having a common ID, as defined\nby each SoC.\n\nUpon startup, the fusebox control IP reads the fuse values and stores them to a\nvolatile shadow cache.\n\nSee the README files of the drivers implementing this API in order to know the\nSoC- and implementation-specific details.\n\nFunctions / commands:\n\n int fuse_read(u32 bank, u32 word, u32 *val);\n fuse read []\n Read fuse words from the shadow cache.\n\n int fuse_sense(u32 bank, u32 word, u32 *val);\n fuse sense []\n Sense - i.e. read directly from the fusebox, skipping the shadow cache -\n fuse words. This operation does not update the shadow cache.\n\n This is useful to know the true value of fuses if an override has been\n performed (see below).\n\n int fuse_prog(u32 bank, u32 word, u32 val);\n fuse prog [-y] [...]\n Program fuse words. This operation directly affects the fusebox and is\n irreversible. The shadow cache is updated accordingly or not, depending on\n each IP.\n\n Only the bits to be programmed should be set in the input value (i.e. for\n fuse bits that have already been programmed and hence should be left\n unchanged by a further programming, it is preferable to clear the\n corresponding bits in the input value in order not to perform a new\n hardware programming operation on these fuse bits).\n\n int fuse_override(u32 bank, u32 word, u32 val);\n fuse override [...]\n Override fuse words in the shadow cache.\n\n The fusebox is unaffected, so following this operation, the shadow cache\n may differ from the fusebox values. Read or sense operations can then be\n used to get the values from the shadow cache or from the fusebox.\n\n This is useful to change the behaviors linked to some cached fuse values,\n either because this is needed only temporarily, or because some of the\n fuses have already been programmed or are locked (if the SoC allows to\n override a locked fuse).\n\nConfiguration:\n\n CONFIG_CMD_FUSE\n Define this to enable the fuse commands.\n"} {"text": "/*\n * drivers/pcmcia/sa1100_assabet.c\n *\n * PCMCIA implementation routines for Assabet\n *\n */\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \n#include \n\n#include \"sa1100_generic.h\"\n\nstatic int assabet_pcmcia_hw_init(struct soc_pcmcia_socket *skt)\n{\n\tskt->stat[SOC_STAT_CD].gpio = ASSABET_GPIO_CF_CD;\n\tskt->stat[SOC_STAT_CD].name = \"CF CD\";\n\tskt->stat[SOC_STAT_BVD1].gpio = ASSABET_GPIO_CF_BVD1;\n\tskt->stat[SOC_STAT_BVD1].name = \"CF BVD1\";\n\tskt->stat[SOC_STAT_BVD2].gpio = ASSABET_GPIO_CF_BVD2;\n\tskt->stat[SOC_STAT_BVD2].name = \"CF BVD2\";\n\tskt->stat[SOC_STAT_RDY].gpio = ASSABET_GPIO_CF_IRQ;\n\tskt->stat[SOC_STAT_RDY].name = \"CF RDY\";\n\n\treturn 0;\n}\n\nstatic void\nassabet_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state)\n{\n\tstate->vs_3v = 1; /* Can only apply 3.3V on Assabet. */\n\tstate->vs_Xv = 0;\n}\n\nstatic int\nassabet_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)\n{\n\tunsigned int mask;\n\n\tswitch (state->Vcc) {\n\tcase 0:\n\t\tmask = 0;\n\t\tbreak;\n\n\tcase 50:\n\t\tprintk(KERN_WARNING \"%s(): CS asked for 5V, applying 3.3V...\\n\",\n\t\t\t__func__);\n\n\tcase 33: /* Can only apply 3.3V to the CF slot. */\n\t\tmask = ASSABET_BCR_CF_PWR;\n\t\tbreak;\n\n\tdefault:\n\t\tprintk(KERN_ERR \"%s(): unrecognized Vcc %u\\n\", __func__,\n\t\t\tstate->Vcc);\n\t\treturn -1;\n\t}\n\n\t/* Silently ignore Vpp, speaker enable. */\n\n\tif (state->flags & SS_RESET)\n\t\tmask |= ASSABET_BCR_CF_RST;\n\tif (!(state->flags & SS_OUTPUT_ENA))\n\t\tmask |= ASSABET_BCR_CF_BUS_OFF;\n\n\tASSABET_BCR_frob(ASSABET_BCR_CF_RST | ASSABET_BCR_CF_PWR |\n\t\t\tASSABET_BCR_CF_BUS_OFF, mask);\n\n\treturn 0;\n}\n\n/*\n * Disable card status IRQs on suspend.\n */\nstatic void assabet_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)\n{\n\t/*\n\t * Tristate the CF bus signals. Also assert CF\n\t * reset as per user guide page 4-11.\n\t */\n\tASSABET_BCR_set(ASSABET_BCR_CF_BUS_OFF | ASSABET_BCR_CF_RST);\n}\n\nstatic struct pcmcia_low_level assabet_pcmcia_ops = { \n\t.owner\t\t\t= THIS_MODULE,\n\t.hw_init\t\t= assabet_pcmcia_hw_init,\n\t.socket_state\t\t= assabet_pcmcia_socket_state,\n\t.configure_socket\t= assabet_pcmcia_configure_socket,\n\t.socket_suspend\t\t= assabet_pcmcia_socket_suspend,\n};\n\nint __devinit pcmcia_assabet_init(struct device *dev)\n{\n\tint ret = -ENODEV;\n\n\tif (machine_is_assabet() && !machine_has_neponset())\n\t\tret = sa11xx_drv_pcmcia_probe(dev, &assabet_pcmcia_ops, 1, 1);\n\n\treturn ret;\n}\n"} {"text": "\n\n Your lists\n \n"} {"text": "[EN](./readme.md) | [ZH](./readme-zh.md)\n### MIPS basic content.\n\n\nThis is based on MIPS32 as an introduction.\n\n\n### 0x01 Register\n\n\n#### (1) General purpose registers\n\n\nMIPS has 32 general purpose registers, represented by the dollar sign ($). Can be expressed as $0~$31, and can also be represented by register names such as $sp, $t9, $fp, and so on.\n\n| Register Number | Conventional Name | Usage | Usage |\n| --------------- | ----------------- | ------------------------------------------------------ | --------------------------------------------------------- |\n| $0 | $zero | Hard-wired to 0 | |\n| $1 | $at | Reserved for pseudo-instructions | |\n$2 - $3 | $v0, $v1 | Return values from functions | Save expression or function return value |\n| $4 - $7 | $a0 - $a3 | Arguments to functions - not preserved by subprograms | \n| $8 - $15 | $t0 - $t7 | Temporary data, not preserved by subprograms | |\n| $16 - $23 | $s0 - $s7 | Saved registers, preserved by subprograms | |\n| $24 - $25 | $t8 - $t9 | More temporary registers, not preserved by subprograms | Temporary registers, as a complement to $t0 - $t7, $t9 is usually related to calling functions |\n| $26 - $27 | $k0 - $k1 | Reserved for kernel. Do not use. | |\n| $28 | $gp | Global Area Pointer (base of global data segment) | |\n\nMIPS as a load-store architecture means that when we want to access memory we must access it through load and store instructions. All other instructions (add, sub, mul, div, and so on) must fetch their operands from the register and store their results in registers. For example, the following example:\n\n```\nsum = x + y\n```\nWe assume that sum and x , y are variables in the program, and their MIPS assembly is expressed as:\n\n\n```\n # sum = x + y\n \n lw $t0, x # Load x from memory into a CPU register\n lw $t1, y # Load y from memory into a CPU register\n add $t0, $t0, $t1 # Add x and y\n sw $t0, sum # Store the result from the CPU register to memory\n```\n\n#### ( 2 ) Special registers\n\nThe MIPS32 architecture also defines three special registers, PC (program counter), HI (multiply and divide result high register), and LO (multiply and divide result low register). When multiplying, HI and LO hold the result of the multiplication, where HI holds the upper 32 bits and LO holds the lower 32 bits. In the division operation, HI saves the remainder and the LO saves the quotient.\n\n### 0x2 Instruction Instruction\n\n\n**ADD – Add (with overflow)**\n\n| Description: | Adds two registers and stores the result in a register |\n| ------------ | ------------------------------------------------------ |\n| Operation: | $d = $s + $t; advance_pc (4); |\n| Syntax: | add $d, $s, $t |\n| Encoding: | `0000 00ss ssh tttt dddd d000 0010 0000` |\n\n**ADDI -- Add immediate (with overflow)**\n\n| Description: | Adds a register and a sign-extended immediate value and stores the result in a register |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $t = $s + imm; advance_pc (4); |\n| Syntax: | addi $t, $s, imm |\n| Encoding: | `0010 00ss ssst tttt iiii iiii iiii iiii` |\n\n**ADDIU -- Add immediate unsigned (no overflow)**\n\n| Description: | Adds a register and a sign-extended immediate value and stores the result in a register |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $t = $s + imm; advance_pc (4); |\n| Syntax: | add $ t, $ s, imm |\n| Encoding: | `0010 01ss ssst tttt iiii iiii iiii iiii` |\n\n**ADDU -- Add unsigned (no overflow)**\n\n| Description: | Adds two registers and stores the result in a register |\n| ------------ | ------------------------------------------------------ |\n| Operation: | $d = $s + $t; advance_pc (4); |\n| Syntax: | addu $d, $s, $t |\n| Encoding: | `0000 00ss ssst tttt dddd d000 0010 0001` |\n\n**AND -- Bitwise and**\n\n| Description: | Bitwise ands two registers and stores the result in a register |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $d = $s & $t; advance_pc (4); |\n| Syntax: | and $d, $s, $t |\n| Encoding: | `0000 00ss ssst tttt dddd d000 0010 0100` |\n\n**ANDI -- Bitwise and immediate**\n\n| Description: | Bitwise ands a register and an immediate value and stores the result in a register |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $t = $s & imm; advance_pc (4); |\n| Syntax: | andi $t, $s, imm |\n| Encoding: | `0011 00ss ssst tttt iiii iiii iiii iiii` |\n\n**BEQ -- Branch on equal**\n\n| Description: | Branches if the two registers are equal |\n| ------------ | ----------------------------------------------------------- |\n| Operation: | if $s == $t advance_pc (offset << 2)); else advance_pc (4); |\n| Syntax: | beq $s, $t, offset |\n| Encoding: | `0001 00ss ssst tttt iiii iiii iiii iiii` |\n\n**BGEZ -- Branch on greater than or equal to zero**\n\n| Description: | Branches if the register is greater than or equal to zero |\n| ------------ | ---------------------------------------------------------- |\n| Operation: | if $s >= 0 advance_pc (offset << 2)); else advance_pc (4); |\n| Syntax: | bgez $s, offset |\n| Encoding: | `0000 01ss sss0 0001 iiii iiii iiii iiii` |\n\n**BGEZAL -- Branch on greater than or equal to zero and link**\n\n| Description: | Branches if the register is greater than or equal to zero and saves the return address in $31 |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | if $s >= 0 $31 = PC + 8 (or nPC + 4); advance_pc (offset << 2)); else advance_pc (4); |\n| Syntax: | bgezal $s, offset |\n| Encoding: | `0000 01ss sss1 0001 iiii iiii iiii iiii` |\n\n**BGTZ -- Branch on greater than zero**\n\n| Description: | Branches if the register is greater than zero |\n| ------------ | --------------------------------------------------------- |\n| Operation: | if $s > 0 advance_pc (offset << 2)); else advance_pc (4); |\n| Syntax: | bgtz $s, offset |\n| Encoding: | `0001 11ss sss0 0000 iiii iiii iiii iiii` |\n\n**BLEZ -- Branch on less than or equal to zero**\n\n| Description: | Branches if the register is less than or equal to zero |\n| ------------ | ---------------------------------------------------------- |\n| Operation: | if $s <= 0 advance_pc (offset << 2)); else advance_pc (4); |\n| Syntax: | blez $s, offset |\n| Encoding: | `0001 10ss sss0 0000 iiii iiii iiii iiii` |\n\n**BLTZ -- Branch on less than zero**\n\n| Description: | Branches if the register is less than zero |\n| ------------ | --------------------------------------------------------- |\n| Operation: | if $s < 0 advance_pc (offset << 2)); else advance_pc (4); |\n| Syntax: | bltz $s, offset |\n| Encoding: | `0000 01ss sss0 0000 iiii iiii iiii iiii` |\n\n**BLTZAL -- Branch on less than zero and link**\n\n| Description: | Branches if the register is less than zero and saves the return address in $31 |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | if $s < 0 $31 = PC + 8 (or nPC + 4); advance_pc (offset << 2)); else advance_pc (4); |\n| Syntax: | bltzal $s, offset |\n| Encoding: | `0000 01ss sss1 0000 iiii iiii iiii iiii` |\n\n**BNE -- Branch on not equal**\n\n| Description: | Branches if the two registers are not equal |\n| ------------ | ----------------------------------------------------------- |\n| Operation: | if $s != $t advance_pc (offset << 2)); else advance_pc (4); |\n| Syntax: | bne $s, $t, offset |\n| Encoding: | `0001 01ss ssst tttt iiii iiii iiii iiii` |\n\n**DIV -- Divide**\n\n| Description: | Divides $s by $t and stores the quotient in $LO and the remainder in $HI |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $LO = $s / $t; $HI = $s % $t; advance_pc (4); |\n| Syntax: | div $s, $t |\n| Encoding: | `0000 00ss ssst tttt 0000 0000 0001 1010` |\n\n**DIVU - Divide unsigned**\n\n| Description: | Divides $s by $t and stores the quotient in $LO and the remainder in $HI |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $LO = $s / $t; $HI = $s % $t; advance_pc (4); |\n| Syntax: | divu $s, $t |\n| Encoding: | `0000 00ss ssst tttt 0000 0000 0001 1011` |\n\n**J -- Jump**\n\n| Description: | Jumps to the calculated address |\n| ------------ | --------------------------------------------------- |\n| Operation: | PC = nPC; nPC = (PC & 0xf0000000) | (target << 2); |\n| Syntax: | j target |\n| Encoding: | `0000 10ii iiii iiii iiii iiii iiii iiii` |\n\n**JAL -- Jump and link**\n\n| Description: | Jumps to the calculated address and stores the return address in $31 |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $31 = PC + 8 (or nPC + 4); PC = nPC; nPC = (PC & 0xf0000000) | (target << 2); |\n| Syntax: | jal target |\n| Encoding: | `0000 11ii iiii iiii iiii iiii iiii iiii` |\n\n**JR -- Jump register**\n\n| Description: | Jump to the address contained in register $s |\n| ------------ | -------------------------------------------- |\n| Operation: | PC = nPC; nPC = $s; |\n| Syntax: | jr $s |\n| Encoding: | `0000 00ss sss0 0000 0000 0000 0000 1000` |\n\n**LB -- Load byte**\n\n| Description: | A byte is loaded into a register from the specified address. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $t = MEM[\\$s + offset]; advance_pc (4); |\n| Syntax: | lb $t, offset(\\$s) |\n| Encoding: | `1000 00ss ssst tttt iiii iiii iiii iiii` |\n\n**LUI -- Load upper immediate**\n\n| Description: | The immediate value is shifted left 16 bits and stored in the register. The lower 16 bits are zeroes. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $t = (imm << 16); advance_pc (4); |\n| Syntax: | lui $t, imm | \n| Encoding: | `0011 11-- ---t tttt iiii iiii iiii iiii` |\n\n**LW -- Load word**\n\n| Description: | A word is loaded into a register from the specified address. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $t = MEM[\\$s + offset]; advance_pc (4); |\n| Syntax: | lw $t, offset(\\$s) |\n| Encoding: | `1000 11ss ssst tttt iiii iiii iiii iiii` |\n\n**MFHI -- Move from HI**\n\n| Description: | The contents of register HI are moved to the specified register. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $d = $HI; advance_pc (4); |\n| Syntax: | mfhi $d |\n| Encoding: | `0000 0000 0000 0000 dddd d000 0001 0000` |\n\n**MFLO -- Move from LO**\n\n| Description: | The contents of register LO are moved to the specified register. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $d = $LO; advance_pc (4); |\n| Syntax: | mflo $d |\n| Encoding: | `0000 0000 0000 0000 dddd d000 0001 0010` |\n\n**MULT - Multiply**\n\n| Description: | Multiplies $s by $t and stores the result in $LO. |\n| ------------ | ------------------------------------------------- |\n| Operation: | $LO = $s * $t; advance_pc (4); |\n| Syntax: | mult $s, $t |\n| Encoding: | `0000 00ss ssst tttt 0000 0000 0001 1000` |\n\n**MULTU - Multiply unsigned**\n\n| Description: | Multiplies $s by $t and stores the result in $LO. |\n| ------------ | ------------------------------------------------- |\n| Operation: | $LO = $s * $t; advance_pc (4); |\n| Syntax: | multu $s, $t |\n| Encoding: | `0000 00ss ssst tttt 0000 0000 0001 1001` |\n\n**NOOP -- no operation**\n\n| Description: | Performs no operation. |\n| ------------ | ----------------------------------------- |\n| Operation: | advance_pc (4); |\n| Syntax: | noop |\n| Encoding: | `0000 0000 0000 0000 0000 0000 0000 0000` |\n\nNote: The encoding for a NOOP represents the instruction SLL $0, $0, 0 which has no side effects. In fact, nearly every instruction that has $0 as its destination register will have no side effect and can thus be considered a NOOP instruction.\n\n **OR -- Bitwise or**\n\n| Description: | Bitwise logical ors two registers and stores the result in a register |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $d = $s | $t; advance_pc (4); |\n| Syntax: | or $d, $s, $t |\n| Encoding: | `0000 00ss ssst tttt dddd d000 0010 0101` |\n\n**ORI -- Bitwise or immediate**\n\n| Description: | Bitwise ors a register and an immediate value and stores the result in a register |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $t = $s | imm; advance_pc (4); |\n| Syntax: | ori $t, $s, imm |\n| Encoding: | `0011 01ss ssst tttt iiii iiii iiii iiii` |\n\n**SB -- Store byte**\n\n| Description: | The least significant byte of $t is stored at the specified address. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | MEM[\\$s + offset] = (0xff & $t); advance_pc (4); |\n| Syntax: | sb $t, offset(\\$s) |\n| Encoding: | `1010 00ss ssst tttt iiii iiii iiii iiii` |\n\n**SLL -- Shift left logical**\n\n| Description: | Shifts a register value left by the shift amount listed in the instruction and places the result in a third register. Zeroes are shifted in. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $d = $t << h; advance_pc (4); |\n| Syntax: | sll $d, $t, h |\n| Encoding: | `0000 00ss ssst tttt dddd dhhh hh00 0000` |\n\n**SLLV -- Shift left logical variable**\n\n| Description: | Shifts a register value left by the value in a second register and places the result in a third register. Zeroes are shifted in. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $d = $t << $s; advance_pc (4); |\n| Syntax: | sllv $d, $t, $s |\n| Encoding: | `0000 00ss ssst tttt dddd d--- --00 0100` |\n\n**SLT -- Set on less than (signed)**\n\n| Description: | If $s is less than $t, $d is set to one. It gets zero otherwise. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | if $s < $t $d = 1; advance_pc (4); else $d = 0; advance_pc (4); |\n| Syntax: | slt $d, $s, $t |\n| Encoding: | `0000 00ss ssst tttt dddd d000 0010 1010` |\n\n**SLTI -- Set on less than immediate (signed)**\n\n| Description: | If $s is less than immediate, $t is set to one. It gets zero otherwise. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | if $s < imm $t = 1; advance_pc (4); else $t = 0; advance_pc (4); |\n| Syntax: | slti $t, $s, imm |\n| Encoding: | `0010 10ss ssst tttt iiii iiii iiii iiii` |\n\n**SLTIU -- Set on less than immediate unsigned**\n\n| Description: | If $s is less than the unsigned immediate, $t is set to one. It gets zero otherwise. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | if $s < imm $t = 1; advance_pc (4); else $t = 0; advance_pc (4); |\n| Syntax: | sltiu $t, $s, imm |\n| Encoding: | `0010 11ss ssst tttt iiii iiii iiii iiii` |\n\n**SLTU -- Set on less than unsigned**\n\n| Description: | If $s is less than $t, $d is set to one. It gets zero otherwise. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | if $s < $t $d = 1; advance_pc (4); else $d = 0; advance_pc (4); |\n| Syntax: | sltu $d, $s, $t |\n| Encoding: | `0000 00ss ssst tttt dddd d000 0010 1011` |\n\n**SRA -- Shift right arithmetic**\n\n| Description: | Shifts a register value right by the shift amount (shamt) and places the value in the destination register. The sign bit is shifted in. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $d = $t >> h; advance_pc (4); |\n| Syntax: | sra $d, $t, h |\n| Encoding: | `0000 00-- ---t tttt dddd dhhh hh00 0011` |\n\n**SRL -- Shift right logical**\n\n| Description: | Shifts a register value right by the shift amount (shamt) and places the value in the destination register. Zeroes are shifted in. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $d = $t >> h; advance_pc (4); |\n| Syntax: | srl $d, $t, h |\n| Encoding: | `0000 00-- ---t tttt dddd dhhh hh00 0010` |\n\n**SRLV -- Shift right logical variable**\n\n| Description: | Shifts a register value right by the amount specified in $s and places the value in the destination register. Zeroes are shifted in. |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $d = $t >> $s; advance_pc (4); |\n| Syntax: | srlv $d, $t, $s |\n| Encoding: | `0000 00ss ssst tttt dddd d000 0000 0110` |\n\n**SUB -- Subtract**\n\n| Description: | Subtracts two registers and stores the result in a register |\n| ------------ | ----------------------------------------------------------- |\n| Operation: | $d = $s - $t; advance_pc (4); |\n| Syntax: | sub $d, $s, $t |\n| Encoding: | `0000 00ss ssst tttt dddd d000 0010 0010` |\n\n**SUBU -- Subtract unsigned**\n\n| Description: | Subtracts two registers and stores the result in a register |\n| ------------ | ----------------------------------------------------------- |\n| Operation: | $d = $s - $t; advance_pc (4); |\n| Syntax: | subu $d, $s, $t |\n| Encoding: | `0000 00ss ssst tttt dddd d000 0010 0011` |\n\n**SW -- Store word**\n\n| Description: | The contents of $t is stored at the specified address. |\n| ------------ | ------------------------------------------------------ |\n| Operation: | MEM[\\$s + offset] = $t; advance_pc (4); |\n| Syntax: | sw $t, offset(\\$s) |\n| Encoding: | `1010 11ss ssst tttt iiii iiii iiii iiii` |\n\n**SYSCALL -- System call**\n\n| Description: | Generates a software interrupt. |\n| ------------ | ----------------------------------------- |\n| Operation: | advance_pc (4); |\n| Syntax: | syscall |\n| Encoding: | `0000 00-- ---- ---- ---- ---- --00 1100` |\n\n**XOR -- Bitwise exclusive or**\n\n| Description: | Exclusive ors two registers and stores the result in a register |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $d = $s ^ $t; advance_pc (4); |\n| Syntax: | xor $d, $s, $t |\n| Encoding: | `0000 00ss ssst tttt dddd d--- --10 0110` |\n\n**XORI -- Bitwise exclusive or immediate**\n\n| Description: | Bitwise exclusive ors a register and an immediate value and stores the result in a register |\n| ------------ | ------------------------------------------------------------ |\n| Operation: | $t = $s ^ imm; advance_pc (4); |\n| Syntax: | xori $t, $s, imm |\n| Encoding: | `0011 10ss ssst tttt iiii iiii iiii iiii` |\n\n### Reference\n[MIPS Instruction Reference](http://www.mrc.uidaho.edu/mrc/people/jff/digital/MIPSir.html)\n"} {"text": "CREATE TABLE {$NAMESPACE}_user.user_status (\n `id` int unsigned NOT NULL AUTO_INCREMENT,\n `userPHID` varchar(64) NOT NULL,\n `dateFrom` int unsigned NOT NULL,\n `dateTo` int unsigned NOT NULL,\n `status` tinyint unsigned NOT NULL,\n `dateCreated` int unsigned NOT NULL,\n `dateModified` int unsigned NOT NULL,\n PRIMARY KEY (`id`),\n INDEX `userPHID_dateFrom` (`userPHID`, `dateTo`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n"} {"text": "/****************************************************************************\r\n**\r\n** https://www.qxorm.com/\r\n** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)\r\n**\r\n** This file is part of the QxOrm library\r\n**\r\n** This software is provided 'as-is', without any express or implied\r\n** warranty. In no event will the authors be held liable for any\r\n** damages arising from the use of this software\r\n**\r\n** Commercial Usage\r\n** Licensees holding valid commercial QxOrm licenses may use this file in\r\n** accordance with the commercial license agreement provided with the\r\n** Software or, alternatively, in accordance with the terms contained in\r\n** a written agreement between you and Lionel Marty\r\n**\r\n** GNU General Public License Usage\r\n** Alternatively, this file may be used under the terms of the GNU\r\n** General Public License version 3.0 as published by the Free Software\r\n** Foundation and appearing in the file 'license.gpl3.txt' included in the\r\n** packaging of this file. Please review the following information to\r\n** ensure the GNU General Public License version 3.0 requirements will be\r\n** met : http://www.gnu.org/copyleft/gpl.html\r\n**\r\n** If you are unsure which license is appropriate for your use, or\r\n** if you have questions regarding the use of this file, please contact :\r\n** contact@qxorm.com\r\n**\r\n****************************************************************************/\r\n\r\nnamespace qx {\r\nnamespace dao {\r\nnamespace detail {\r\n\r\ntemplate \r\nstruct QxSqlQueryHelper_DeleteById\r\n{\r\n\r\n static void sql(QString & sql, qx::IxSqlQueryBuilder & builder, bool bSoftDelete)\r\n {\r\n static_assert(qx::trait::is_qx_registered::value, \"qx::trait::is_qx_registered::value\");\r\n qx::IxSqlQueryBuilder::sql_DeleteById(sql, builder, bSoftDelete);\r\n }\r\n\r\n static void resolveInput(T & t, QSqlQuery & query, qx::IxSqlQueryBuilder & builder)\r\n {\r\n static_assert(qx::trait::is_qx_registered::value, \"qx::trait::is_qx_registered::value\");\r\n qx::IxDataMember * pId = builder.getDataId(); qAssert(pId);\r\n pId->setSqlPlaceHolder(query, (& t));\r\n }\r\n\r\n static void resolveOutput(T & t, QSqlQuery & query, qx::IxSqlQueryBuilder & builder)\r\n { Q_UNUSED(t); Q_UNUSED(query); Q_UNUSED(builder); }\r\n\r\n};\r\n\r\n} // namespace detail\r\n} // namespace dao\r\n} // namespace qx\r\n"} {"text": "#pragma once\r\n\r\n// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。\r\n\r\n// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将\r\n// WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。\r\n\r\n#include \r\n"} {"text": "COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n\r\n\tCopyright (c) GeoWorks 1991 -- All Rights Reserved\r\n\r\nPROJECT:\tPC GEOS\r\nMODULE:\t\tGeoCalc\r\nFILE:\t\tspreadsheetStyleToken.def\r\n\r\nAUTHOR:\t\tGene Anderson, Feb 26, 1991\r\n\r\nREVISION HISTORY:\r\n\tName\tDate\t\tDescription\r\n\t----\t----\t\t-----------\r\n\teca\t2/26/91\t\tInitial revision\r\n\r\nDESCRIPTION:\r\n\tConstants and structures for style tokens.\r\n\t\t\r\n\t$Id: spreadsheetStyleToken.def,v 1.1 97/04/07 11:13:32 newdeal Exp $\r\n\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@\r\n\r\n;\r\n; initial # of handles for lmem block\r\n;\r\nSTYLE_TOKEN_NUM_HANDLES\t= 1\r\n\r\n;\r\n; ASSUME: style array is first chunk\r\n;\r\nSTYLE_ARRAY_CHUNK\t= (size LMemBlockHeader)\r\n\r\n;\r\n; default style token (first entry)\r\n;\r\nDEFAULT_STYLE_TOKEN\t= 0\r\n\r\n;\r\n; invalid style token (for initializing to force a mismatch)\r\n;\r\nINVALID_STYLE_TOKEN\t= -1\r\n\r\nglobal StyleGetAttrByTokenFar:far\r\n"} {"text": "package com.yfax.task.htt.dao;\n\nimport java.util.Map;\n\nimport com.yfax.task.htt.vo.HttLoginHisVo;\nimport com.yfax.task.htt.vo.HttWithdrawProveUserVo;\n\npublic interface HttWithdrawProveUserDao {\n\tpublic HttWithdrawProveUserVo selectHttWithdrawProveUserByPhoneNum(String phoneNum);\n\tpublic boolean insertHttWithdrawProveUser(HttWithdrawProveUserVo httWithdrawProveUserVo) throws Exception;\n\tpublic boolean updateHttWithdrawProveUser(HttWithdrawProveUserVo httWithdrawProveUserVo) throws Exception;\n\tpublic Long selectCountHttWithdrawProveUserOfAppUser(Map map);\n\tpublic String selectMasterPhoneNumOfAppUser(String phoneNum);\n\tpublic HttLoginHisVo selectLastestHttLoginHis(String phoneNum);\n\tpublic Map selectWechatAndAlipayInfo(String phoneNum);\n\tpublic Long selectCountHttLoginHis(Map map);\n}\n"} {"text": "/*!\n * jQuery UI Datepicker 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/datepicker/#theming\n */\n.ui-datepicker {\n\twidth: 17em;\n\tpadding: .2em .2em 0;\n\tdisplay: none;\n}\n.ui-datepicker .ui-datepicker-header {\n\tposition: relative;\n\tpadding: .2em 0;\n}\n.ui-datepicker .ui-datepicker-prev,\n.ui-datepicker .ui-datepicker-next {\n\tposition: absolute;\n\ttop: 2px;\n\twidth: 1.8em;\n\theight: 1.8em;\n}\n.ui-datepicker .ui-datepicker-prev-hover,\n.ui-datepicker .ui-datepicker-next-hover {\n\ttop: 1px;\n}\n.ui-datepicker .ui-datepicker-prev {\n\tleft: 2px;\n}\n.ui-datepicker .ui-datepicker-next {\n\tright: 2px;\n}\n.ui-datepicker .ui-datepicker-prev-hover {\n\tleft: 1px;\n}\n.ui-datepicker .ui-datepicker-next-hover {\n\tright: 1px;\n}\n.ui-datepicker .ui-datepicker-prev span,\n.ui-datepicker .ui-datepicker-next span {\n\tdisplay: block;\n\tposition: absolute;\n\tleft: 50%;\n\tmargin-left: -8px;\n\ttop: 50%;\n\tmargin-top: -8px;\n}\n.ui-datepicker .ui-datepicker-title {\n\tmargin: 0 2.3em;\n\tline-height: 1.8em;\n\ttext-align: center;\n}\n.ui-datepicker .ui-datepicker-title select {\n\tfont-size: 1em;\n\tmargin: 1px 0;\n}\n.ui-datepicker select.ui-datepicker-month,\n.ui-datepicker select.ui-datepicker-year {\n\twidth: 45%;\n}\n.ui-datepicker table {\n\twidth: 100%;\n\tfont-size: .9em;\n\tborder-collapse: collapse;\n\tmargin: 0 0 .4em;\n}\n.ui-datepicker th {\n\tpadding: .7em .3em;\n\ttext-align: center;\n\tfont-weight: bold;\n\tborder: 0;\n}\n.ui-datepicker td {\n\tborder: 0;\n\tpadding: 1px;\n}\n.ui-datepicker td span,\n.ui-datepicker td a {\n\tdisplay: block;\n\tpadding: .2em;\n\ttext-align: right;\n\ttext-decoration: none;\n}\n.ui-datepicker .ui-datepicker-buttonpane {\n\tbackground-image: none;\n\tmargin: .7em 0 0 0;\n\tpadding: 0 .2em;\n\tborder-left: 0;\n\tborder-right: 0;\n\tborder-bottom: 0;\n}\n.ui-datepicker .ui-datepicker-buttonpane button {\n\tfloat: right;\n\tmargin: .5em .2em .4em;\n\tcursor: pointer;\n\tpadding: .2em .6em .3em .6em;\n\twidth: auto;\n\toverflow: visible;\n}\n.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {\n\tfloat: left;\n}\n\n/* with multiple calendars */\n.ui-datepicker.ui-datepicker-multi {\n\twidth: auto;\n}\n.ui-datepicker-multi .ui-datepicker-group {\n\tfloat: left;\n}\n.ui-datepicker-multi .ui-datepicker-group table {\n\twidth: 95%;\n\tmargin: 0 auto .4em;\n}\n.ui-datepicker-multi-2 .ui-datepicker-group {\n\twidth: 50%;\n}\n.ui-datepicker-multi-3 .ui-datepicker-group {\n\twidth: 33.3%;\n}\n.ui-datepicker-multi-4 .ui-datepicker-group {\n\twidth: 25%;\n}\n.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,\n.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {\n\tborder-left-width: 0;\n}\n.ui-datepicker-multi .ui-datepicker-buttonpane {\n\tclear: left;\n}\n.ui-datepicker-row-break {\n\tclear: both;\n\twidth: 100%;\n\tfont-size: 0;\n}\n\n/* RTL support */\n.ui-datepicker-rtl {\n\tdirection: rtl;\n}\n.ui-datepicker-rtl .ui-datepicker-prev {\n\tright: 2px;\n\tleft: auto;\n}\n.ui-datepicker-rtl .ui-datepicker-next {\n\tleft: 2px;\n\tright: auto;\n}\n.ui-datepicker-rtl .ui-datepicker-prev:hover {\n\tright: 1px;\n\tleft: auto;\n}\n.ui-datepicker-rtl .ui-datepicker-next:hover {\n\tleft: 1px;\n\tright: auto;\n}\n.ui-datepicker-rtl .ui-datepicker-buttonpane {\n\tclear: right;\n}\n.ui-datepicker-rtl .ui-datepicker-buttonpane button {\n\tfloat: left;\n}\n.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,\n.ui-datepicker-rtl .ui-datepicker-group {\n\tfloat: right;\n}\n.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,\n.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {\n\tborder-right-width: 0;\n\tborder-left-width: 1px;\n}\n"} {"text": "{\n \"network\": [\n [\n \"probeNetwork - default - end\",\n 0,\n 0\n ],\n [\n \"probeNetwork - default - start\",\n 0,\n 0\n ]\n ],\n \"gfx\": [\n [\n \"probeGFX - default - end\",\n 2,\n 3,\n 7,\n 1,\n [\n 32768,\n 32768\n ],\n [\n 118,\n 118\n ],\n [\n 240,\n 240\n ]\n ]\n ]\n}"} {"text": "uucore_procs::main!(uu_numfmt); // spell-checker:ignore procs uucore numfmt\n"} {"text": "#include \"Pods-ZLMusicFlowWaveViewDemo-EZAudio.xcconfig\"\nGCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1\nHEADER_SEARCH_PATHS = \"${PODS_ROOT}/Headers/Build\" \"${PODS_ROOT}/Headers/Build/EZAudio\" \"${PODS_ROOT}/Headers/Public\" \"${PODS_ROOT}/Headers/Public/EZAudio\" \"${PODS_ROOT}/Headers/Public/ZLSinusWaveView\"\nOTHER_LDFLAGS = ${PODS_ZLMUSICFLOWWAVEVIEWDEMO_EZAUDIO_OTHER_LDFLAGS} -ObjC\nPODS_ROOT = ${SRCROOT}"} {"text": "// RUN: c-index-test core -print-source-symbols -- %s | FileCheck %s\n\n// Linkage decls are skipped in USRs for enclosed items.\n// Linkage decls themselves don't have USRs (no lines between ns and X).\n// CHECK: {{[0-9]+}}:11 | namespace/C++ | ns | c:@N@ns |\n// CHECK-NEXT: {{[0-9]+}}:33 | variable/C | X | c:@N@ns@X |\nnamespace ns { extern \"C\" { int X; } }\n"} {"text": "///////////////////////////////////////////////////////////////////////////////\n// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.\n// Copyright (c) 2009, Rob Eden All Rights Reserved.\n// Copyright (c) 2009, Jeff Randall 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 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\n// GNU 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n///////////////////////////////////////////////////////////////////////////////\n\npackage gnu.trove.list.array;\n\nimport gnu.trove.function.TFloatFunction;\nimport gnu.trove.list.TFloatList;\nimport gnu.trove.procedure.TFloatProcedure;\nimport gnu.trove.iterator.TFloatIterator;\nimport gnu.trove.TFloatCollection;\nimport gnu.trove.impl.*;\n\nimport java.io.Externalizable;\nimport java.io.IOException;\nimport java.io.ObjectInput;\nimport java.io.ObjectOutput;\nimport java.util.*;\n\n\n//////////////////////////////////////////////////\n// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //\n//////////////////////////////////////////////////\n\n\n/**\n * A resizable, array-backed list of float primitives.\n */\npublic class TFloatArrayList implements TFloatList, Externalizable {\n\tstatic final long serialVersionUID = 1L;\n\n /** the data of the list */\n protected float[] _data;\n\n /** the index after the last entry in the list */\n protected int _pos;\n\n /** the default capacity for new lists */\n protected static final int DEFAULT_CAPACITY = Constants.DEFAULT_CAPACITY;\n\n /** the float value that represents null */\n protected float no_entry_value;\n\n\n /**\n * Creates a new TFloatArrayList instance with the\n * default capacity.\n */\n @SuppressWarnings({\"RedundantCast\"})\n public TFloatArrayList() {\n this( DEFAULT_CAPACITY, ( float ) 0 );\n }\n\n\n /**\n * Creates a new TFloatArrayList instance with the\n * specified capacity.\n *\n * @param capacity an int value\n */\n @SuppressWarnings({\"RedundantCast\"})\n public TFloatArrayList( int capacity ) {\n this( capacity, ( float ) 0 );\n }\n\n\n /**\n * Creates a new TFloatArrayList instance with the\n * specified capacity.\n *\n * @param capacity an int value\n * @param no_entry_value an float value that represents null.\n */\n public TFloatArrayList( int capacity, float no_entry_value ) {\n _data = new float[ capacity ];\n _pos = 0;\n this.no_entry_value = no_entry_value;\n }\n\n /**\n * Creates a new TFloatArrayList instance that contains\n * a copy of the collection passed to us.\n *\n * @param collection the collection to copy\n */\n public TFloatArrayList ( TFloatCollection collection ) {\n this( collection.size() );\n addAll( collection ); \n }\n\n\n /**\n * Creates a new TFloatArrayList instance whose\n * capacity is the length of values array and whose\n * initial contents are the specified values.\n *

\n * A defensive copy of the given values is held by the new instance.\n *\n * @param values an float[] value\n */\n public TFloatArrayList( float[] values ) {\n this( values.length );\n add( values );\n }\n\n protected TFloatArrayList(float[] values, float no_entry_value, boolean wrap) {\n if (!wrap)\n throw new IllegalStateException(\"Wrong call\");\n\n if (values == null)\n throw new IllegalArgumentException(\"values can not be null\");\n\n _data = values;\n _pos = values.length;\n this.no_entry_value = no_entry_value;\n }\n\n /**\n * Returns a primitive List implementation that wraps around the given primitive array.\n *

\n * NOTE: mutating operation are allowed as long as the List does not grow. In that case\n * an IllegalStateException will be thrown\n *\n * @param values\n * @return\n */\n public static TFloatArrayList wrap(float[] values) {\n return wrap(values, ( float ) 0);\n }\n\n /**\n * Returns a primitive List implementation that wraps around the given primitive array.\n *

\n * NOTE: mutating operation are allowed as long as the List does not grow. In that case\n * an IllegalStateException will be thrown\n *\n * @param values\n * @param no_entry_value\n * @return\n */\n public static TFloatArrayList wrap(float[] values, float no_entry_value) {\n return new TFloatArrayList(values, no_entry_value, true) {\n /**\n * Growing the wrapped external array is not allow\n */\n @Override\n public void ensureCapacity(int capacity) {\n if (capacity > _data.length)\n throw new IllegalStateException(\"Can not grow ArrayList wrapped external array\");\n }\n };\n }\n\n /** {@inheritDoc} */\n public float getNoEntryValue() {\n return no_entry_value;\n }\n\n\n // sizing\n\n /**\n * Grow the internal array as needed to accommodate the specified number of elements.\n * The size of the array bytes on each resize unless capacity requires more than twice\n * the current capacity.\n */\n public void ensureCapacity( int capacity ) {\n if ( capacity > _data.length ) {\n int newCap = Math.max( _data.length << 1, capacity );\n float[] tmp = new float[ newCap ];\n System.arraycopy( _data, 0, tmp, 0, _data.length );\n _data = tmp;\n }\n }\n\n\n /** {@inheritDoc} */\n public int size() {\n return _pos;\n }\n\n\n /** {@inheritDoc} */\n public boolean isEmpty() {\n return _pos == 0;\n }\n\n\n /**\n * Sheds any excess capacity above and beyond the current size of the list.\n */\n public void trimToSize() {\n if ( _data.length > size() ) {\n float[] tmp = new float[ size() ];\n toArray( tmp, 0, tmp.length );\n _data = tmp;\n }\n }\n\n\n // modifying\n\n /** {@inheritDoc} */\n public boolean add( float val ) {\n ensureCapacity( _pos + 1 );\n _data[ _pos++ ] = val;\n return true;\n }\n\n\n /** {@inheritDoc} */\n public void add( float[] vals ) {\n add( vals, 0, vals.length );\n }\n\n\n /** {@inheritDoc} */\n public void add( float[] vals, int offset, int length ) {\n ensureCapacity( _pos + length );\n System.arraycopy( vals, offset, _data, _pos, length );\n _pos += length;\n }\n\n\n /** {@inheritDoc} */\n public void insert( int offset, float value ) {\n if ( offset == _pos ) {\n add( value );\n return;\n }\n ensureCapacity( _pos + 1 );\n // shift right\n System.arraycopy( _data, offset, _data, offset + 1, _pos - offset );\n // insert\n _data[ offset ] = value;\n _pos++;\n }\n\n\n /** {@inheritDoc} */\n public void insert( int offset, float[] values ) {\n insert( offset, values, 0, values.length );\n }\n\n\n /** {@inheritDoc} */\n public void insert( int offset, float[] values, int valOffset, int len ) {\n if ( offset == _pos ) {\n add( values, valOffset, len );\n return;\n }\n\n ensureCapacity( _pos + len );\n // shift right\n System.arraycopy( _data, offset, _data, offset + len, _pos - offset );\n // insert\n System.arraycopy( values, valOffset, _data, offset, len );\n _pos += len;\n }\n\n\n /** {@inheritDoc} */\n public float get( int offset ) {\n if ( offset >= _pos ) {\n throw new ArrayIndexOutOfBoundsException( offset );\n }\n return _data[ offset ];\n }\n\n\n /**\n * Returns the value at the specified offset without doing any bounds checking.\n */\n public float getQuick( int offset ) {\n return _data[ offset ];\n }\n\n\n /** {@inheritDoc} */\n public float set( int offset, float val ) {\n if ( offset >= _pos ) {\n throw new ArrayIndexOutOfBoundsException( offset );\n }\n\n\t\tfloat prev_val = _data[ offset ];\n _data[ offset ] = val;\n\t\treturn prev_val;\n }\n\n\n /** {@inheritDoc} */\n public float replace( int offset, float val ) {\n if ( offset >= _pos ) {\n throw new ArrayIndexOutOfBoundsException( offset );\n }\n float old = _data[ offset ];\n _data[ offset ] = val;\n return old;\n }\n\n\n /** {@inheritDoc} */\n public void set( int offset, float[] values ) {\n set( offset, values, 0, values.length );\n }\n\n\n /** {@inheritDoc} */\n public void set( int offset, float[] values, int valOffset, int length ) {\n if ( offset < 0 || offset + length > _pos ) {\n throw new ArrayIndexOutOfBoundsException( offset );\n }\n System.arraycopy( values, valOffset, _data, offset, length );\n }\n\n\n /**\n * Sets the value at the specified offset without doing any bounds checking.\n */\n public void setQuick( int offset, float val ) {\n _data[ offset ] = val;\n }\n\n\n /** {@inheritDoc} */\n public void clear() {\n clear( DEFAULT_CAPACITY );\n }\n\n\n /**\n * Flushes the internal state of the list, setting the capacity of the empty list to\n * capacity.\n */\n public void clear( int capacity ) {\n _data = new float[ capacity ];\n _pos = 0;\n }\n\n\n /**\n * Sets the size of the list to 0, but does not change its capacity. This method can\n * be used as an alternative to the {@link #clear()} method if you want to recycle a\n * list without allocating new backing arrays.\n */\n public void reset() {\n _pos = 0;\n Arrays.fill( _data, no_entry_value );\n }\n\n\n /**\n * Sets the size of the list to 0, but does not change its capacity. This method can\n * be used as an alternative to the {@link #clear()} method if you want to recycle a\n * list without allocating new backing arrays. This method differs from\n * {@link #reset()} in that it does not clear the old values in the backing array.\n * Thus, it is possible for getQuick to return stale data if this method is used and\n * the caller is careless about bounds checking.\n */\n public void resetQuick() {\n _pos = 0;\n }\n\n\n /** {@inheritDoc} */\n public boolean remove( float value ) {\n for ( int index = 0; index < _pos; index++ ) {\n if ( value == _data[index] ) {\n remove( index, 1 );\n return true;\n }\n }\n return false;\n }\n\n\n /** {@inheritDoc} */\n public float removeAt( int offset ) {\n float old = get( offset );\n remove( offset, 1 );\n return old;\n }\n\n\n /** {@inheritDoc} */\n public void remove( int offset, int length ) {\n\t\tif ( length == 0 ) return;\n if ( offset < 0 || offset >= _pos ) {\n throw new ArrayIndexOutOfBoundsException(offset);\n }\n\n if ( offset == 0 ) {\n // data at the front\n System.arraycopy( _data, length, _data, 0, _pos - length );\n }\n else if ( _pos - length == offset ) {\n // no copy to make, decrementing pos \"deletes\" values at\n // the end\n }\n else {\n // data in the middle\n System.arraycopy( _data, offset + length, _data, offset,\n _pos - ( offset + length ) );\n }\n _pos -= length;\n // no need to clear old values beyond _pos, because this is a\n // primitive collection and 0 takes as much room as any other\n // value\n }\n\n\n /** {@inheritDoc} */\n public TFloatIterator iterator() {\n return new TFloatArrayIterator( 0 );\n }\n\n\n /** {@inheritDoc} */\n public boolean containsAll( Collection collection ) {\n for ( Object element : collection ) {\n if ( element instanceof Float ) {\n float c = ( ( Float ) element ).floatValue();\n if ( ! contains( c ) ) {\n return false;\n }\n } else {\n return false;\n }\n\n }\n return true;\n }\n\n\n /** {@inheritDoc} */\n public boolean containsAll( TFloatCollection collection ) {\n if ( this == collection ) {\n return true;\n }\n TFloatIterator iter = collection.iterator();\n while ( iter.hasNext() ) {\n float element = iter.next();\n if ( ! contains( element ) ) {\n return false;\n }\n }\n return true;\n }\n\n\n /** {@inheritDoc} */\n public boolean containsAll( float[] array ) {\n for ( int i = array.length; i-- > 0; ) {\n if ( ! contains( array[i] ) ) {\n return false;\n }\n }\n return true;\n }\n\n\n /** {@inheritDoc} */\n public boolean addAll( Collection collection ) {\n boolean changed = false;\n for ( Float element : collection ) {\n float e = element.floatValue();\n if ( add( e ) ) {\n changed = true;\n }\n }\n return changed;\n }\n\n\n /** {@inheritDoc} */\n public boolean addAll( TFloatCollection collection ) {\n boolean changed = false;\n TFloatIterator iter = collection.iterator();\n while ( iter.hasNext() ) {\n float element = iter.next();\n if ( add( element ) ) {\n changed = true;\n }\n }\n return changed;\n }\n\n\n /** {@inheritDoc} */\n public boolean addAll( float[] array ) {\n boolean changed = false;\n for ( float element : array ) {\n if ( add( element ) ) {\n changed = true;\n }\n }\n return changed;\n }\n\n\n /** {@inheritDoc} */\n @SuppressWarnings({\"SuspiciousMethodCalls\"})\n public boolean retainAll( Collection collection ) {\n boolean modified = false;\n\t TFloatIterator iter = iterator();\n\t while ( iter.hasNext() ) {\n\t if ( ! collection.contains( Float.valueOf ( iter.next() ) ) ) {\n\t\t iter.remove();\n\t\t modified = true;\n\t }\n\t }\n\t return modified;\n }\n\n\n /** {@inheritDoc} */\n public boolean retainAll( TFloatCollection collection ) {\n if ( this == collection ) {\n return false;\n }\n boolean modified = false;\n\t TFloatIterator iter = iterator();\n\t while ( iter.hasNext() ) {\n\t if ( ! collection.contains( iter.next() ) ) {\n\t\t iter.remove();\n\t\t modified = true;\n\t }\n\t }\n\t return modified;\n }\n\n\n /** {@inheritDoc} */\n public boolean retainAll( float[] array ) {\n boolean changed = false;\n Arrays.sort( array );\n float[] data = _data;\n\n for ( int i = _pos; i-- > 0; ) {\n if ( Arrays.binarySearch( array, data[i] ) < 0 ) {\n remove( i, 1 );\n changed = true;\n }\n }\n return changed;\n }\n\n\n /** {@inheritDoc} */\n public boolean removeAll( Collection collection ) {\n boolean changed = false;\n for ( Object element : collection ) {\n if ( element instanceof Float ) {\n float c = ( ( Float ) element ).floatValue();\n if ( remove( c ) ) {\n changed = true;\n }\n }\n }\n return changed;\n }\n\n\n /** {@inheritDoc} */\n public boolean removeAll( TFloatCollection collection ) {\n if ( collection == this ) {\n clear();\n return true;\n }\n boolean changed = false;\n TFloatIterator iter = collection.iterator();\n while ( iter.hasNext() ) {\n float element = iter.next();\n if ( remove( element ) ) {\n changed = true;\n }\n }\n return changed;\n }\n\n\n /** {@inheritDoc} */\n public boolean removeAll( float[] array ) {\n boolean changed = false;\n for ( int i = array.length; i-- > 0; ) {\n if ( remove(array[i]) ) {\n changed = true;\n }\n }\n return changed;\n }\n\n\n /** {@inheritDoc} */\n public void transformValues( TFloatFunction function ) {\n for ( int i = _pos; i-- > 0; ) {\n _data[ i ] = function.execute( _data[ i ] );\n }\n }\n\n\n /** {@inheritDoc} */\n public void reverse() {\n reverse( 0, _pos );\n }\n\n\n /** {@inheritDoc} */\n public void reverse( int from, int to ) {\n if ( from == to ) {\n return; // nothing to do\n }\n if ( from > to ) {\n throw new IllegalArgumentException( \"from cannot be greater than to\" );\n }\n for ( int i = from, j = to - 1; i < j; i++, j-- ) {\n swap( i, j );\n }\n }\n\n\n /** {@inheritDoc} */\n public void shuffle( Random rand ) {\n for ( int i = _pos; i-- > 1; ) {\n swap( i, rand.nextInt( i ) );\n }\n }\n\n\n /**\n * Swap the values at offsets i and j.\n *\n * @param i an offset into the data array\n * @param j an offset into the data array\n */\n private void swap( int i, int j ) {\n float tmp = _data[ i ];\n _data[ i ] = _data[ j ];\n _data[ j ] = tmp;\n }\n\n\n // copying\n\n /** {@inheritDoc} */\n public TFloatList subList( int begin, int end ) {\n \tif ( end < begin ) {\n\t\t\tthrow new IllegalArgumentException( \"end index \" + end +\n\t\t\t\t\" greater than begin index \" + begin );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tthrow new IndexOutOfBoundsException( \"begin index can not be < 0\" );\n\t\t}\n\t\tif ( end > _data.length ) {\n\t\t\tthrow new IndexOutOfBoundsException( \"end index < \" + _data.length );\n\t\t}\n TFloatArrayList list = new TFloatArrayList( end - begin );\n for ( int i = begin; i < end; i++ ) {\n \tlist.add( _data[ i ] );\n }\n return list;\n }\n\n\n /** {@inheritDoc} */\n public float[] toArray() {\n return toArray( 0, _pos );\n }\n\n\n /** {@inheritDoc} */\n public float[] toArray( int offset, int len ) {\n float[] rv = new float[ len ];\n toArray( rv, offset, len );\n return rv;\n }\n\n\n /** {@inheritDoc} */\n public float[] toArray( float[] dest ) {\n int len = dest.length;\n if ( dest.length > _pos ) {\n len = _pos;\n dest[len] = no_entry_value;\n }\n toArray( dest, 0, len );\n return dest;\n }\n\n\n /** {@inheritDoc} */\n public float[] toArray( float[] dest, int offset, int len ) {\n if ( len == 0 ) {\n return dest; // nothing to copy\n }\n if ( offset < 0 || offset >= _pos ) {\n throw new ArrayIndexOutOfBoundsException( offset );\n }\n System.arraycopy( _data, offset, dest, 0, len );\n return dest;\n }\n\n\n /** {@inheritDoc} */\n public float[] toArray( float[] dest, int source_pos, int dest_pos, int len ) {\n if ( len == 0 ) {\n return dest; // nothing to copy\n }\n if ( source_pos < 0 || source_pos >= _pos ) {\n throw new ArrayIndexOutOfBoundsException( source_pos );\n }\n System.arraycopy( _data, source_pos, dest, dest_pos, len );\n return dest;\n }\n\n\n // comparing\n\n /** {@inheritDoc} */\n @Override\n public boolean equals( Object other ) {\n if ( other == this ) {\n return true;\n }\n else if ( other instanceof TFloatArrayList ) {\n TFloatArrayList that = ( TFloatArrayList )other;\n if ( that.size() != this.size() ) return false;\n else {\n for ( int i = _pos; i-- > 0; ) {\n if ( this._data[ i ] != that._data[ i ] ) {\n return false;\n }\n }\n return true;\n }\n }\n else return false;\n }\n\n\n /** {@inheritDoc} */\n @Override\n public int hashCode() {\n int h = 0;\n for ( int i = _pos; i-- > 0; ) {\n h += HashFunctions.hash( _data[ i ] );\n }\n return h;\n }\n\n\n // procedures\n\n /** {@inheritDoc} */\n public boolean forEach( TFloatProcedure procedure ) {\n for ( int i = 0; i < _pos; i++ ) {\n if ( !procedure.execute( _data[ i ] ) ) {\n return false;\n }\n }\n return true;\n }\n\n\n /** {@inheritDoc} */\n public boolean forEachDescending( TFloatProcedure procedure ) {\n for ( int i = _pos; i-- > 0; ) {\n if ( !procedure.execute( _data[ i ] ) ) {\n return false;\n }\n }\n return true;\n }\n\n\n // sorting\n\n /** {@inheritDoc} */\n public void sort() {\n Arrays.sort( _data, 0, _pos );\n }\n\n\n /** {@inheritDoc} */\n public void sort( int fromIndex, int toIndex ) {\n Arrays.sort( _data, fromIndex, toIndex );\n }\n\n\n // filling\n\n /** {@inheritDoc} */\n public void fill( float val ) {\n Arrays.fill( _data, 0, _pos, val );\n }\n\n\n /** {@inheritDoc} */\n public void fill( int fromIndex, int toIndex, float val ) {\n if ( toIndex > _pos ) {\n ensureCapacity( toIndex );\n _pos = toIndex;\n }\n Arrays.fill( _data, fromIndex, toIndex, val );\n }\n\n\n // searching\n\n /** {@inheritDoc} */\n public int binarySearch( float value ) {\n return binarySearch( value, 0, _pos );\n }\n\n\n /** {@inheritDoc} */\n public int binarySearch(float value, int fromIndex, int toIndex) {\n if ( fromIndex < 0 ) {\n throw new ArrayIndexOutOfBoundsException( fromIndex );\n }\n if ( toIndex > _pos ) {\n throw new ArrayIndexOutOfBoundsException( toIndex );\n }\n\n int low = fromIndex;\n int high = toIndex - 1;\n\n while ( low <= high ) {\n int mid = ( low + high ) >>> 1;\n float midVal = _data[ mid ];\n\n if ( midVal < value ) {\n low = mid + 1;\n }\n else if ( midVal > value ) {\n high = mid - 1;\n }\n else {\n return mid; // value found\n }\n }\n return -( low + 1 ); // value not found.\n }\n\n\n /** {@inheritDoc} */\n public int indexOf( float value ) {\n return indexOf( 0, value );\n }\n\n\n /** {@inheritDoc} */\n public int indexOf( int offset, float value ) {\n for ( int i = offset; i < _pos; i++ ) {\n if ( _data[ i ] == value ) {\n return i;\n }\n }\n return -1;\n }\n\n\n /** {@inheritDoc} */\n public int lastIndexOf( float value ) {\n return lastIndexOf( _pos, value );\n }\n\n\n /** {@inheritDoc} */\n public int lastIndexOf( int offset, float value ) {\n for ( int i = offset; i-- > 0; ) {\n if ( _data[ i ] == value ) {\n return i;\n }\n }\n return -1;\n }\n\n\n /** {@inheritDoc} */\n public boolean contains( float value ) {\n return lastIndexOf( value ) >= 0;\n }\n\n\n /** {@inheritDoc} */\n public TFloatList grep( TFloatProcedure condition ) {\n TFloatArrayList list = new TFloatArrayList();\n for ( int i = 0; i < _pos; i++ ) {\n if ( condition.execute( _data[ i ] ) ) {\n list.add( _data[ i ] );\n }\n }\n return list;\n }\n\n\n /** {@inheritDoc} */\n public TFloatList inverseGrep( TFloatProcedure condition ) {\n TFloatArrayList list = new TFloatArrayList();\n for ( int i = 0; i < _pos; i++ ) {\n if ( !condition.execute( _data[ i ] ) ) {\n list.add( _data[ i ] );\n }\n }\n return list;\n }\n\n\n /** {@inheritDoc} */\n public float max() {\n if ( size() == 0 ) {\n throw new IllegalStateException(\"cannot find maximum of an empty list\");\n }\n float max = Float.NEGATIVE_INFINITY;\n for ( int i = 0; i < _pos; i++ ) {\n \tif ( _data[ i ] > max ) {\n \t\tmax = _data[ i ];\n \t}\n }\n return max;\n }\n\n\n /** {@inheritDoc} */\n public float min() {\n if ( size() == 0 ) {\n throw new IllegalStateException( \"cannot find minimum of an empty list\" );\n }\n float min = Float.POSITIVE_INFINITY;\n for ( int i = 0; i < _pos; i++ ) {\n \tif ( _data[i] < min ) {\n \t\tmin = _data[i];\n \t}\n }\n return min;\n }\n\n\n /** {@inheritDoc} */\n public float sum() {\n float sum = 0;\n for ( int i = 0; i < _pos; i++ ) {\n\t\t\tsum += _data[ i ];\n }\n return sum;\n }\n\n\n // stringification\n\n /** {@inheritDoc} */\n @Override\n public String toString() {\n final StringBuilder buf = new StringBuilder( \"{\" );\n for ( int i = 0, end = _pos - 1; i < end; i++ ) {\n buf.append( _data[ i ] );\n buf.append( \", \" );\n }\n if ( size() > 0 ) {\n buf.append( _data[ _pos - 1 ] );\n }\n buf.append( \"}\" );\n return buf.toString();\n }\n\n\n /** TFloatArrayList iterator */\n class TFloatArrayIterator implements TFloatIterator {\n\n /** Index of element to be returned by subsequent call to next. */\n private int cursor = 0;\n\n /**\n * Index of element returned by most recent call to next or\n * previous. Reset to -1 if this element is deleted by a call\n * to remove.\n */\n int lastRet = -1;\n\n\n TFloatArrayIterator( int index ) {\n cursor = index;\n }\n\n\n /** {@inheritDoc} */\n public boolean hasNext() {\n return cursor < size();\n\t }\n\n\n /** {@inheritDoc} */\n public float next() {\n try {\n float next = get( cursor );\n lastRet = cursor++;\n return next;\n } catch ( IndexOutOfBoundsException e ) {\n throw new NoSuchElementException();\n }\n }\n\n\n /** {@inheritDoc} */\n public void remove() {\n if ( lastRet == -1 )\n\t\t throw new IllegalStateException();\n\n try {\n TFloatArrayList.this.remove( lastRet, 1);\n if ( lastRet < cursor )\n cursor--;\n lastRet = -1;\n } catch ( IndexOutOfBoundsException e ) {\n throw new ConcurrentModificationException();\n }\n }\n }\n\n\n public void writeExternal( ObjectOutput out ) throws IOException {\n \t// VERSION\n \tout.writeByte( 0 );\n\n \t// POSITION\n \tout.writeInt( _pos );\n\n \t// NO_ENTRY_VALUE\n \tout.writeFloat( no_entry_value );\n\n \t// ENTRIES\n \tint len = _data.length;\n \tout.writeInt( len );\n \tfor( int i = 0; i < len; i++ ) {\n \t\tout.writeFloat( _data[ i ] );\n \t}\n }\n\n\n public void readExternal( ObjectInput in )\n \tthrows IOException, ClassNotFoundException {\n\n \t// VERSION\n \tin.readByte();\n\n \t// POSITION\n \t_pos = in.readInt();\n\n \t// NO_ENTRY_VALUE\n \tno_entry_value = in.readFloat();\n\n \t// ENTRIES\n \tint len = in.readInt();\n \t_data = new float[ len ];\n \tfor( int i = 0; i < len; i++ ) {\n \t\t_data[ i ] = in.readFloat();\n \t}\n }\n} // TFloatArrayList\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/less_equal.hpp\" header\n// -- DO NOT modify by hand!\n\nnamespace boost { namespace mpl {\n\ntemplate<\n typename Tag1\n , typename Tag2\n >\nstruct less_equal_impl\n : if_c<\n ( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)\n > BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)\n )\n\n , aux::cast2nd_impl< less_equal_impl< Tag1,Tag1 >,Tag1, Tag2 >\n , aux::cast1st_impl< less_equal_impl< Tag2,Tag2 >,Tag1, Tag2 >\n >::type\n{\n};\n\n/// for Digital Mars C++/compilers with no CTPS/TTP support\ntemplate<> struct less_equal_impl< na,na >\n{\n template< typename U1, typename U2 > struct apply\n {\n typedef apply type;\n BOOST_STATIC_CONSTANT(int, value = 0);\n };\n};\n\ntemplate< typename Tag > struct less_equal_impl< na,Tag >\n{\n template< typename U1, typename U2 > struct apply\n {\n typedef apply type;\n BOOST_STATIC_CONSTANT(int, value = 0);\n };\n};\n\ntemplate< typename Tag > struct less_equal_impl< Tag,na >\n{\n template< typename U1, typename U2 > struct apply\n {\n typedef apply type;\n BOOST_STATIC_CONSTANT(int, value = 0);\n };\n};\n\ntemplate< typename T > struct less_equal_tag\n{\n typedef typename T::tag type;\n};\n\ntemplate<\n typename BOOST_MPL_AUX_NA_PARAM(N1)\n , typename BOOST_MPL_AUX_NA_PARAM(N2)\n >\nstruct less_equal\n\n : less_equal_impl<\n typename less_equal_tag::type\n , typename less_equal_tag::type\n >::template apply< N1,N2 >::type\n{\n BOOST_MPL_AUX_LAMBDA_SUPPORT(2, less_equal, (N1, N2))\n\n};\n\nBOOST_MPL_AUX_NA_SPEC2(2, 2, less_equal)\n\n}}\n\nnamespace boost { namespace mpl {\n\ntemplate<>\nstruct less_equal_impl< integral_c_tag,integral_c_tag >\n{\n template< typename N1, typename N2 > struct apply\n\n : bool_< ( BOOST_MPL_AUX_VALUE_WKND(N1)::value <= BOOST_MPL_AUX_VALUE_WKND(N2)::value ) >\n {\n };\n};\n\n}}\n"} {"text": "# Maintainer: ArchStrike \n\nbuildarch=1\n\npkgname=mimikittenz-git\npkgver=20160709.r8\npkgrel=3\ngroups=('archstrike' 'archstrike-exploit')\narch=('any')\npkgdesc=\"A post-exploitation powershell tool for extracting juicy info from memory\"\nurl=\"https://github.com/orlyjamie/mimikittenz\"\nlicense=('custom')\nmakedepends=('git')\nsource=(\"${pkgname}::git+${url}\"\n \"LICENSE\")\nsha512sums=('SKIP'\n '4ac4bba96e2c65e4499913f14c1161e22d67c930529fbcfa74f9c691f96537370ca4f60446ed273288ce372b97974f6c22df145db68a42c373dbe3c0caba5dec')\n\npkgver() {\n cd \"${srcdir}/${pkgname}\"\n printf \"%s.r%s\" \"$(git show -s --format=%ci master | sed 's/\\ .*//g;s/-//g')\" \"$(git rev-list --count HEAD)\"\n}\n\npackage() {\n cd \"${srcdir}/${pkgname}\"\n install -dm755 \"${pkgdir}/usr/share/${pkgname}\"\n install -dm755 \"${pkgdir}/usr/share/licenses/${pkgname}\"\n\n cp -a --no-preserve=ownership ./* \"${pkgdir}/usr/share/${pkgname}/\"\n cp \"${srcdir}/LICENSE\" \"${pkgdir}/usr/share/licenses/${pkgname}/\"\n\n}\n"} {"text": "/**\r\n * \\file\r\n *\r\n * \\brief Component description for CCL\r\n *\r\n * Copyright (c) 2018 Microchip Technology Inc.\r\n *\r\n * \\asf_license_start\r\n *\r\n * \\page License\r\n *\r\n * SPDX-License-Identifier: Apache-2.0\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may\r\n * not use this file except in compliance with the License.\r\n * You may obtain a copy of the Licence at\r\n * \r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an AS IS BASIS, WITHOUT\r\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n *\r\n * \\asf_license_stop\r\n *\r\n */\r\n\r\n#ifndef _SAML21_CCL_COMPONENT_\r\n#define _SAML21_CCL_COMPONENT_\r\n\r\n/* ========================================================================== */\r\n/** SOFTWARE API DEFINITION FOR CCL */\r\n/* ========================================================================== */\r\n/** \\addtogroup SAML21_CCL Configurable Custom Logic */\r\n/*@{*/\r\n\r\n#define CCL_U2225\r\n#define REV_CCL 0x100\r\n\r\n/* -------- CCL_CTRL : (CCL Offset: 0x0) (R/W 8) Control -------- */\r\n#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))\r\ntypedef union {\r\n struct {\r\n uint8_t SWRST:1; /*!< bit: 0 Software Reset */\r\n uint8_t ENABLE:1; /*!< bit: 1 Enable */\r\n uint8_t :4; /*!< bit: 2.. 5 Reserved */\r\n uint8_t RUNSTDBY:1; /*!< bit: 6 Run during Standby */\r\n uint8_t :1; /*!< bit: 7 Reserved */\r\n } bit; /*!< Structure used for bit access */\r\n uint8_t reg; /*!< Type used for register access */\r\n} CCL_CTRL_Type;\r\n#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */\r\n\r\n#define CCL_CTRL_OFFSET 0x0 /**< \\brief (CCL_CTRL offset) Control */\r\n#define CCL_CTRL_RESETVALUE _U_(0x00) /**< \\brief (CCL_CTRL reset_value) Control */\r\n\r\n#define CCL_CTRL_SWRST_Pos 0 /**< \\brief (CCL_CTRL) Software Reset */\r\n#define CCL_CTRL_SWRST (_U_(0x1) << CCL_CTRL_SWRST_Pos)\r\n#define CCL_CTRL_ENABLE_Pos 1 /**< \\brief (CCL_CTRL) Enable */\r\n#define CCL_CTRL_ENABLE (_U_(0x1) << CCL_CTRL_ENABLE_Pos)\r\n#define CCL_CTRL_RUNSTDBY_Pos 6 /**< \\brief (CCL_CTRL) Run during Standby */\r\n#define CCL_CTRL_RUNSTDBY (_U_(0x1) << CCL_CTRL_RUNSTDBY_Pos)\r\n#define CCL_CTRL_MASK _U_(0x43) /**< \\brief (CCL_CTRL) MASK Register */\r\n\r\n/* -------- CCL_SEQCTRL : (CCL Offset: 0x4) (R/W 8) SEQ Control x -------- */\r\n#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))\r\ntypedef union {\r\n struct {\r\n uint8_t SEQSEL:4; /*!< bit: 0.. 3 Sequential Selection */\r\n uint8_t :4; /*!< bit: 4.. 7 Reserved */\r\n } bit; /*!< Structure used for bit access */\r\n uint8_t reg; /*!< Type used for register access */\r\n} CCL_SEQCTRL_Type;\r\n#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */\r\n\r\n#define CCL_SEQCTRL_OFFSET 0x4 /**< \\brief (CCL_SEQCTRL offset) SEQ Control x */\r\n#define CCL_SEQCTRL_RESETVALUE _U_(0x00) /**< \\brief (CCL_SEQCTRL reset_value) SEQ Control x */\r\n\r\n#define CCL_SEQCTRL_SEQSEL_Pos 0 /**< \\brief (CCL_SEQCTRL) Sequential Selection */\r\n#define CCL_SEQCTRL_SEQSEL_Msk (_U_(0xF) << CCL_SEQCTRL_SEQSEL_Pos)\r\n#define CCL_SEQCTRL_SEQSEL(value) (CCL_SEQCTRL_SEQSEL_Msk & ((value) << CCL_SEQCTRL_SEQSEL_Pos))\r\n#define CCL_SEQCTRL_SEQSEL_DISABLE_Val _U_(0x0) /**< \\brief (CCL_SEQCTRL) Sequential logic is disabled */\r\n#define CCL_SEQCTRL_SEQSEL_DFF_Val _U_(0x1) /**< \\brief (CCL_SEQCTRL) D flip flop */\r\n#define CCL_SEQCTRL_SEQSEL_JK_Val _U_(0x2) /**< \\brief (CCL_SEQCTRL) JK flip flop */\r\n#define CCL_SEQCTRL_SEQSEL_LATCH_Val _U_(0x3) /**< \\brief (CCL_SEQCTRL) D latch */\r\n#define CCL_SEQCTRL_SEQSEL_RS_Val _U_(0x4) /**< \\brief (CCL_SEQCTRL) RS latch */\r\n#define CCL_SEQCTRL_SEQSEL_DISABLE (CCL_SEQCTRL_SEQSEL_DISABLE_Val << CCL_SEQCTRL_SEQSEL_Pos)\r\n#define CCL_SEQCTRL_SEQSEL_DFF (CCL_SEQCTRL_SEQSEL_DFF_Val << CCL_SEQCTRL_SEQSEL_Pos)\r\n#define CCL_SEQCTRL_SEQSEL_JK (CCL_SEQCTRL_SEQSEL_JK_Val << CCL_SEQCTRL_SEQSEL_Pos)\r\n#define CCL_SEQCTRL_SEQSEL_LATCH (CCL_SEQCTRL_SEQSEL_LATCH_Val << CCL_SEQCTRL_SEQSEL_Pos)\r\n#define CCL_SEQCTRL_SEQSEL_RS (CCL_SEQCTRL_SEQSEL_RS_Val << CCL_SEQCTRL_SEQSEL_Pos)\r\n#define CCL_SEQCTRL_MASK _U_(0x0F) /**< \\brief (CCL_SEQCTRL) MASK Register */\r\n\r\n/* -------- CCL_LUTCTRL : (CCL Offset: 0x8) (R/W 32) LUT Control x -------- */\r\n#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))\r\ntypedef union {\r\n struct {\r\n uint32_t :1; /*!< bit: 0 Reserved */\r\n uint32_t ENABLE:1; /*!< bit: 1 LUT Enable */\r\n uint32_t :2; /*!< bit: 2.. 3 Reserved */\r\n uint32_t FILTSEL:2; /*!< bit: 4.. 5 Filter Selection */\r\n uint32_t :1; /*!< bit: 6 Reserved */\r\n uint32_t EDGESEL:1; /*!< bit: 7 Edge Selection */\r\n uint32_t INSEL0:4; /*!< bit: 8..11 Input Selection 0 */\r\n uint32_t INSEL1:4; /*!< bit: 12..15 Input Selection 1 */\r\n uint32_t INSEL2:4; /*!< bit: 16..19 Input Selection 2 */\r\n uint32_t INVEI:1; /*!< bit: 20 Input Event Invert */\r\n uint32_t LUTEI:1; /*!< bit: 21 Event Input Enable */\r\n uint32_t LUTEO:1; /*!< bit: 22 Event Output Enable */\r\n uint32_t :1; /*!< bit: 23 Reserved */\r\n uint32_t TRUTH:8; /*!< bit: 24..31 Truth Value */\r\n } bit; /*!< Structure used for bit access */\r\n uint32_t reg; /*!< Type used for register access */\r\n} CCL_LUTCTRL_Type;\r\n#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */\r\n\r\n#define CCL_LUTCTRL_OFFSET 0x8 /**< \\brief (CCL_LUTCTRL offset) LUT Control x */\r\n#define CCL_LUTCTRL_RESETVALUE _U_(0x00000000) /**< \\brief (CCL_LUTCTRL reset_value) LUT Control x */\r\n\r\n#define CCL_LUTCTRL_ENABLE_Pos 1 /**< \\brief (CCL_LUTCTRL) LUT Enable */\r\n#define CCL_LUTCTRL_ENABLE (_U_(0x1) << CCL_LUTCTRL_ENABLE_Pos)\r\n#define CCL_LUTCTRL_FILTSEL_Pos 4 /**< \\brief (CCL_LUTCTRL) Filter Selection */\r\n#define CCL_LUTCTRL_FILTSEL_Msk (_U_(0x3) << CCL_LUTCTRL_FILTSEL_Pos)\r\n#define CCL_LUTCTRL_FILTSEL(value) (CCL_LUTCTRL_FILTSEL_Msk & ((value) << CCL_LUTCTRL_FILTSEL_Pos))\r\n#define CCL_LUTCTRL_FILTSEL_DISABLE_Val _U_(0x0) /**< \\brief (CCL_LUTCTRL) Filter disabled */\r\n#define CCL_LUTCTRL_FILTSEL_SYNCH_Val _U_(0x1) /**< \\brief (CCL_LUTCTRL) Synchronizer enabled */\r\n#define CCL_LUTCTRL_FILTSEL_FILTER_Val _U_(0x2) /**< \\brief (CCL_LUTCTRL) Filter enabled */\r\n#define CCL_LUTCTRL_FILTSEL_DISABLE (CCL_LUTCTRL_FILTSEL_DISABLE_Val << CCL_LUTCTRL_FILTSEL_Pos)\r\n#define CCL_LUTCTRL_FILTSEL_SYNCH (CCL_LUTCTRL_FILTSEL_SYNCH_Val << CCL_LUTCTRL_FILTSEL_Pos)\r\n#define CCL_LUTCTRL_FILTSEL_FILTER (CCL_LUTCTRL_FILTSEL_FILTER_Val << CCL_LUTCTRL_FILTSEL_Pos)\r\n#define CCL_LUTCTRL_EDGESEL_Pos 7 /**< \\brief (CCL_LUTCTRL) Edge Selection */\r\n#define CCL_LUTCTRL_EDGESEL (_U_(0x1) << CCL_LUTCTRL_EDGESEL_Pos)\r\n#define CCL_LUTCTRL_INSEL0_Pos 8 /**< \\brief (CCL_LUTCTRL) Input Selection 0 */\r\n#define CCL_LUTCTRL_INSEL0_Msk (_U_(0xF) << CCL_LUTCTRL_INSEL0_Pos)\r\n#define CCL_LUTCTRL_INSEL0(value) (CCL_LUTCTRL_INSEL0_Msk & ((value) << CCL_LUTCTRL_INSEL0_Pos))\r\n#define CCL_LUTCTRL_INSEL0_MASK_Val _U_(0x0) /**< \\brief (CCL_LUTCTRL) Masked input */\r\n#define CCL_LUTCTRL_INSEL0_FEEDBACK_Val _U_(0x1) /**< \\brief (CCL_LUTCTRL) Feedback input source */\r\n#define CCL_LUTCTRL_INSEL0_LINK_Val _U_(0x2) /**< \\brief (CCL_LUTCTRL) Linked LUT input source */\r\n#define CCL_LUTCTRL_INSEL0_EVENT_Val _U_(0x3) /**< \\brief (CCL_LUTCTRL) Event in put source */\r\n#define CCL_LUTCTRL_INSEL0_IO_Val _U_(0x4) /**< \\brief (CCL_LUTCTRL) I/O pin input source */\r\n#define CCL_LUTCTRL_INSEL0_AC_Val _U_(0x5) /**< \\brief (CCL_LUTCTRL) AC input source */\r\n#define CCL_LUTCTRL_INSEL0_TC_Val _U_(0x6) /**< \\brief (CCL_LUTCTRL) TC input source */\r\n#define CCL_LUTCTRL_INSEL0_ALTTC_Val _U_(0x7) /**< \\brief (CCL_LUTCTRL) Alternate TC input source */\r\n#define CCL_LUTCTRL_INSEL0_TCC_Val _U_(0x8) /**< \\brief (CCL_LUTCTRL) TCC input source */\r\n#define CCL_LUTCTRL_INSEL0_SERCOM_Val _U_(0x9) /**< \\brief (CCL_LUTCTRL) SERCOM inout source */\r\n#define CCL_LUTCTRL_INSEL0_MASK (CCL_LUTCTRL_INSEL0_MASK_Val << CCL_LUTCTRL_INSEL0_Pos)\r\n#define CCL_LUTCTRL_INSEL0_FEEDBACK (CCL_LUTCTRL_INSEL0_FEEDBACK_Val << CCL_LUTCTRL_INSEL0_Pos)\r\n#define CCL_LUTCTRL_INSEL0_LINK (CCL_LUTCTRL_INSEL0_LINK_Val << CCL_LUTCTRL_INSEL0_Pos)\r\n#define CCL_LUTCTRL_INSEL0_EVENT (CCL_LUTCTRL_INSEL0_EVENT_Val << CCL_LUTCTRL_INSEL0_Pos)\r\n#define CCL_LUTCTRL_INSEL0_IO (CCL_LUTCTRL_INSEL0_IO_Val << CCL_LUTCTRL_INSEL0_Pos)\r\n#define CCL_LUTCTRL_INSEL0_AC (CCL_LUTCTRL_INSEL0_AC_Val << CCL_LUTCTRL_INSEL0_Pos)\r\n#define CCL_LUTCTRL_INSEL0_TC (CCL_LUTCTRL_INSEL0_TC_Val << CCL_LUTCTRL_INSEL0_Pos)\r\n#define CCL_LUTCTRL_INSEL0_ALTTC (CCL_LUTCTRL_INSEL0_ALTTC_Val << CCL_LUTCTRL_INSEL0_Pos)\r\n#define CCL_LUTCTRL_INSEL0_TCC (CCL_LUTCTRL_INSEL0_TCC_Val << CCL_LUTCTRL_INSEL0_Pos)\r\n#define CCL_LUTCTRL_INSEL0_SERCOM (CCL_LUTCTRL_INSEL0_SERCOM_Val << CCL_LUTCTRL_INSEL0_Pos)\r\n#define CCL_LUTCTRL_INSEL1_Pos 12 /**< \\brief (CCL_LUTCTRL) Input Selection 1 */\r\n#define CCL_LUTCTRL_INSEL1_Msk (_U_(0xF) << CCL_LUTCTRL_INSEL1_Pos)\r\n#define CCL_LUTCTRL_INSEL1(value) (CCL_LUTCTRL_INSEL1_Msk & ((value) << CCL_LUTCTRL_INSEL1_Pos))\r\n#define CCL_LUTCTRL_INSEL2_Pos 16 /**< \\brief (CCL_LUTCTRL) Input Selection 2 */\r\n#define CCL_LUTCTRL_INSEL2_Msk (_U_(0xF) << CCL_LUTCTRL_INSEL2_Pos)\r\n#define CCL_LUTCTRL_INSEL2(value) (CCL_LUTCTRL_INSEL2_Msk & ((value) << CCL_LUTCTRL_INSEL2_Pos))\r\n#define CCL_LUTCTRL_INVEI_Pos 20 /**< \\brief (CCL_LUTCTRL) Input Event Invert */\r\n#define CCL_LUTCTRL_INVEI (_U_(0x1) << CCL_LUTCTRL_INVEI_Pos)\r\n#define CCL_LUTCTRL_LUTEI_Pos 21 /**< \\brief (CCL_LUTCTRL) Event Input Enable */\r\n#define CCL_LUTCTRL_LUTEI (_U_(0x1) << CCL_LUTCTRL_LUTEI_Pos)\r\n#define CCL_LUTCTRL_LUTEO_Pos 22 /**< \\brief (CCL_LUTCTRL) Event Output Enable */\r\n#define CCL_LUTCTRL_LUTEO (_U_(0x1) << CCL_LUTCTRL_LUTEO_Pos)\r\n#define CCL_LUTCTRL_TRUTH_Pos 24 /**< \\brief (CCL_LUTCTRL) Truth Value */\r\n#define CCL_LUTCTRL_TRUTH_Msk (_U_(0xFF) << CCL_LUTCTRL_TRUTH_Pos)\r\n#define CCL_LUTCTRL_TRUTH(value) (CCL_LUTCTRL_TRUTH_Msk & ((value) << CCL_LUTCTRL_TRUTH_Pos))\r\n#define CCL_LUTCTRL_MASK _U_(0xFF7FFFB2) /**< \\brief (CCL_LUTCTRL) MASK Register */\r\n\r\n/** \\brief CCL hardware registers */\r\n#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))\r\ntypedef struct {\r\n __IO CCL_CTRL_Type CTRL; /**< \\brief Offset: 0x0 (R/W 8) Control */\r\n RoReg8 Reserved1[0x3];\r\n __IO CCL_SEQCTRL_Type SEQCTRL[2]; /**< \\brief Offset: 0x4 (R/W 8) SEQ Control x */\r\n RoReg8 Reserved2[0x2];\r\n __IO CCL_LUTCTRL_Type LUTCTRL[4]; /**< \\brief Offset: 0x8 (R/W 32) LUT Control x */\r\n} Ccl;\r\n#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */\r\n\r\n/*@}*/\r\n\r\n#endif /* _SAML21_CCL_COMPONENT_ */\r\n"} {"text": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n As cotações são fornecidas pelo serviço BitcoinAverage. Os preços de Bitcoin podem variar rapidamente, portanto outros serviços podem informar cotações diferentes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \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": "{ \"translations\": {\n \"Cannot write into \\\"config\\\" directory!\" : \"Kan ikke skrive i \\\"config\\\"-mappen!\",\n \"This can usually be fixed by giving the webserver write access to the config directory\" : \"Dette kan vanligvis ordnes ved å gi web-serveren skrivetilgang til config-mappen\",\n \"See %s\" : \"Se %s\",\n \"This can usually be fixed by %sgiving the webserver write access to the config directory%s.\" : \"Dette kan vanligvis ordnes ved %så gi web-serveren skrivetilgang til config-mappen%s.\",\n \"Sample configuration detected\" : \"Eksempelkonfigurasjon oppdaget\",\n \"It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php\" : \"Det ble oppdaget at eksempelkonfigurasjonen er blitt kopiert. Dette kan ødelegge installasjonen din og støttes ikke. Les dokumentasjonen før du gjør endringer i config.php\",\n \"PHP %s or higher is required.\" : \"PHP %s eller nyere kreves.\",\n \"PHP with a version lower than %s is required.\" : \"PHP med en versjon lavere enn %s kreves.\",\n \"%sbit or higher PHP required.\" : \"%sbit eller høyere PHP kreves.\",\n \"Following databases are supported: %s\" : \"Følgende databaser støttes: %s\",\n \"The command line tool %s could not be found\" : \"Kommandolinjeverktøyet %s ble ikke funnet\",\n \"The library %s is not available.\" : \"Biblioteket %s er ikke tilgjengelig.\",\n \"Library %s with a version higher than %s is required - available version %s.\" : \"Bibliotek %s med en versjon høyere enn %s kreves - tilgjengelig versjon %s.\",\n \"Library %s with a version lower than %s is required - available version %s.\" : \"Bibliotek %s med en versjon lavere enn %s kreves - tilgjengelig version %s.\",\n \"Following platforms are supported: %s\" : \"Følgende plattformer støttes: %s\",\n \"ownCloud %s or higher is required.\" : \"ownCloud %s eller høyere kreves.\",\n \"ownCloud %s or lower is required.\" : \"ownCloud %s eller lavere kreves.\",\n \"Unknown filetype\" : \"Ukjent filtype\",\n \"Invalid image\" : \"Ugyldig bilde\",\n \"Avatar image is not square\" : \"Bildet er ikke kvadratisk\",\n \"today\" : \"i dag\",\n \"yesterday\" : \"i går\",\n \"_%n day ago_::_%n days ago_\" : [\"%n dag siden\",\"%n dager siden\"],\n \"last month\" : \"forrige måned\",\n \"_%n month ago_::_%n months ago_\" : [\"for %n måned siden\",\"for %n måneder siden\"],\n \"last year\" : \"forrige år\",\n \"_%n year ago_::_%n years ago_\" : [\"%n år siden\",\"%n år siden\"],\n \"_%n hour ago_::_%n hours ago_\" : [\"for %n time siden\",\"for %n timer siden\"],\n \"_%n minute ago_::_%n minutes ago_\" : [\"for %n minutt siden\",\"for %n minutter siden\"],\n \"seconds ago\" : \"for få sekunder siden\",\n \"Module with id: %s does not exist. Please enable it in your apps settings or contact your administrator.\" : \"Modul med id: %s eksisterer ikke. Aktiver den i app-innstillingene eller kontakt en administrator.\",\n \"Builtin\" : \"Innebygget\",\n \"None\" : \"Ingen\",\n \"Username and password\" : \"Brukernavn og passord\",\n \"Username\" : \"Brukernavn\",\n \"Password\" : \"Passord\",\n \"Log-in credentials, save in session\" : \"Påloggingsdetaljer, lagre i økten\",\n \"Empty filename is not allowed\" : \"Tomt filnavn er ikke tillatt\",\n \"Dot files are not allowed\" : \"Punktum-filer er ikke tillatt\",\n \"4-byte characters are not supported in file names\" : \"4-byte tegn er ikke tillatt i filnavn\",\n \"File name is a reserved word\" : \"Filnavnet er et reservert ord\",\n \"File name contains at least one invalid character\" : \"Filnavnet inneholder minst ett ulovlig tegn\",\n \"File name is too long\" : \"Filnavnet er for langt\",\n \"__language_name__\" : \"__language_name__\",\n \"App directory already exists\" : \"App-mappe finnes allerede\",\n \"Can't create app folder. Please fix permissions. %s\" : \"Kan ikke opprette app-mappe. Vennligst ordne opp i tillatelser. %s\",\n \"Archive does not contain a directory named %s\" : \"Arkivet inneholder ikke en mappe med navn %s\",\n \"No source specified when installing app\" : \"Ingen kilde spesifisert ved installering av app\",\n \"No href specified when installing app from http\" : \"Ingen href spesifisert ved installering av app fra http\",\n \"No path specified when installing app from local file\" : \"Ingen sti spesifisert ved installering av app fra lokal fil\",\n \"Archives of type %s are not supported\" : \"Arkiver av type %s støttes ikke\",\n \"Failed to open archive when installing app\" : \"Klarte ikke å åpne arkiv ved installering av app\",\n \"App does not provide an info.xml file\" : \"App-en inneholder ikke filen info.xml\",\n \"App cannot be installed because appinfo file cannot be read.\" : \"App kan ikke installeres fordi appinfo-filen ikke kan leses.\",\n \"Signature could not get checked. Please contact the app developer and check your admin screen.\" : \"Signatur kunne ikke sjekkes. Kontakt app-utvikleren og sjekk admin-bildet.\",\n \"App can't be installed because it is not compatible with this version of ownCloud\" : \"App kan ikke installeres fordi den ikke er kompatibel med denne versjonen av ownCloud\",\n \"App can't be installed because it contains the true tag which is not allowed for non shipped apps\" : \"App kan ikke installeres fordi den er merket med true som ikke er tillatt for apper som ikke leveres med systemet\",\n \"App can't be installed because the version in info.xml is not the same as the version reported from the app store\" : \"App kan ikke installeres fordi versjonen i info.xml ikke er den samme som versjonen som rapporteres fra app-butikken\",\n \"Apps\" : \"Apper\",\n \"General\" : \"Generelt\",\n \"Storage\" : \"Lager\",\n \"Security\" : \"Sikkerhet\",\n \"User Authentication\" : \"Bruker autentisering\",\n \"Encryption\" : \"Kryptering\",\n \"Workflows & Tags\" : \"Arbeidsflyt og stikkord\",\n \"Sharing\" : \"Deling\",\n \"Search\" : \"Søk\",\n \"Help & Tips\" : \"Hjelp og tips\",\n \"Additional\" : \"Flere\",\n \"%s enter the database username and name.\" : \"%s legg inn brukernavn og navn for databasen.\",\n \"%s enter the database username.\" : \"%s legg inn brukernavn for databasen.\",\n \"%s enter the database name.\" : \"%s legg inn navnet på databasen.\",\n \"Oracle connection could not be established\" : \"Klarte ikke å etablere forbindelse til Oracle\",\n \"Oracle username and/or password not valid\" : \"Oracle-brukernavn og/eller passord er ikke gyldig\",\n \"DB Error: \\\"%s\\\"\" : \"Databasefeil: \\\"%s\\\"\",\n \"Offending command was: \\\"%s\\\"\" : \"Kommandoen som feilet: \\\"%s\\\"\",\n \"You need to enter either an existing account or the administrator.\" : \"Du må legge inn enten en eksisterende konto eller administratoren.\",\n \"Offending command was: \\\"%s\\\", name: %s, password: %s\" : \"Kommando som feilet: \\\"%s\\\", navn: %s, passord: %s\",\n \"PostgreSQL username and/or password not valid\" : \"PostgreSQL-brukernavn og/eller passord er ikke gyldig\",\n \"%s is not supported and %s will not work properly on this platform. Use it at your own risk! \" : \"%ser ikke støttet og %svil ikke fungere tilstrekkelig på denne platformen. Bruk på egen risiko.\",\n \"For the best results, please consider using a GNU/Linux server instead.\" : \"For beste resultat, vurder å bruke en GNU/Linux-server i stedet.\",\n \"It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. This will lead to problems with files over 4 GB and is highly discouraged.\" : \"Det ser ut for at %s-instansen kjører i et 32-bit PHP-miljø med open_basedir konfigurert i php.ini. Dette vil føre til problemer med filer over 4 GB og frarådes på det sterkeste.\",\n \"Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP.\" : \"Vennligst fjern innstillingen open_basedir i php.ini eller bytt til 64-bit PHP.\",\n \"Set an admin username.\" : \"Sett et admin-brukernavn.\",\n \"Set an admin password.\" : \"Sett et admin-passord.\",\n \"Can't create or write into the data directory %s\" : \"Kan ikke opprette eller skrive i datamappen %s\",\n \"Invalid Federated Cloud ID\" : \"Ugyldig ID for Forent Sky\",\n \"%s shared »%s« with you\" : \"%s delte »%s« med deg\",\n \"%s via %s\" : \"%s via %s\",\n \"Sharing %s failed, because the file does not exist\" : \"Deling av %s feilet, fordi filen ikke eksisterer\",\n \"You are not allowed to share %s\" : \"Du har ikke lov til å dele %s\",\n \"Sharing %s failed, because you can not share with yourself\" : \"Deling av %s feilet fordi du ikke kan dele med deg selv\",\n \"Sharing %s failed, because the user %s does not exist\" : \"Deling av %s feilet, fordi brukeren %s ikke finnes\",\n \"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of\" : \"Deling av %s feilet, fordi brukeren %s ikke er medlem av noen grupper som %s er medlem av\",\n \"Sharing %s failed, because this item is already shared with %s\" : \"Deling av %s feilet, fordi dette elementet allerede er delt med %s\",\n \"Sharing %s failed, because this item is already shared with user %s\" : \"Deling av %s feilet, fordi dette elementet allerede er delt med bruker %s\",\n \"Sharing %s failed, because the group %s does not exist\" : \"Deling av %s feilet, fordi gruppen %s ikke finnes\",\n \"Sharing %s failed, because %s is not a member of the group %s\" : \"Deling av %s feilet, fordi %s ikke er medlem av gruppen %s\",\n \"You need to provide a password to create a public link, only protected links are allowed\" : \"Du må oppgi et passord for å lage en offentlig lenke. Bare beskyttede lenker er tillatt\",\n \"Sharing %s failed, because sharing with links is not allowed\" : \"Deling av %s feilet, fordi deling med lenker ikke er tillatt\",\n \"Not allowed to create a federated share with the same user\" : \"Ikke tillatt å opprette en forent sky-deling med den samme brukeren\",\n \"Sharing %s failed, could not find %s, check spelling and server availability.\" : \"Deling %s mislyktes, kunne ikke finne %s, kontroller input og server tilgjengelighet.\",\n \"Share type %s is not valid for %s\" : \"Delingstype %s er ikke gyldig for %s\",\n \"Setting permissions for %s failed, because the permissions exceed permissions granted to %s\" : \"Setting av tillatelser for %s feilet, fordi tillatelsene gikk ut over tillatelsene som er gitt til %s\",\n \"Setting permissions for %s failed, because the item was not found\" : \"Setting av tillatelser for %s feilet, fordi elementet ikke ble funnet\",\n \"Cannot set expiration date. Shares cannot expire later than %s after they have been shared\" : \"Kan ikke sette utøpsdato. Delinger kan ikke utløpe senere enn %s etter at de har blitt delt\",\n \"Cannot set expiration date. Expiration date is in the past\" : \"Kan ikke sette utløpsdato. Utløpsdato er tilbake i tid\",\n \"Cannot clear expiration date. Shares are required to have an expiration date.\" : \"Kan ikke fjerne utløpsdato. Delinger må ha en utløpsdato.\",\n \"Sharing backend %s must implement the interface OCP\\\\Share_Backend\" : \"Delings-server %s må implementere grensesnittet OCP\\\\Share_Backend\",\n \"Sharing backend %s not found\" : \"Delings-server %s ikke funnet\",\n \"Sharing backend for %s not found\" : \"Delings-server for %s ikke funnet\",\n \"Sharing failed, because the user %s is the original sharer\" : \"Deling feilet fordi brukeren %s er den som delte opprinnelig\",\n \"Sharing %s failed, because the permissions exceed permissions granted to %s\" : \"Deling av %s feilet, fordi tillatelsene går utover tillatelsene som er gitt til %s\",\n \"Sharing %s failed, because resharing is not allowed\" : \"Deling av %s feilet, fordi videre-deling ikke er tillatt\",\n \"Sharing %s failed, because the sharing backend for %s could not find its source\" : \"Deling av %s feilet, fordi delings-serveren for %s ikke kunne finne kilden\",\n \"Sharing %s failed, because the file could not be found in the file cache\" : \"Deling av %s feilet, fordi filen ikke ble funnet i fil-mellomlageret\",\n \"Cannot remove all permissions\" : \"Kan ikke fjerne alle tilganger\",\n \"Expiration date is in the past\" : \"Utløpsdato er tilbake i tid\",\n \"Cannot set expiration date more than %s days in the future\" : \"Kan ikke sette utløpsdato mer enn %s dager fram i tid\",\n \"Could not find category \\\"%s\\\"\" : \"Kunne ikke finne kategori \\\"%s\\\"\",\n \"A valid username must be provided\" : \"Oppgi et gyldig brukernavn\",\n \"Username contains whitespace at the beginning or at the end\" : \"Brukernavn inneholder blanke på begynnelsen eller slutten\",\n \"The username must be at least 3 characters long\" : \"Brukernavn må være minst tre tegn langt\",\n \"The username can not be longer than 64 characters\" : \"Brukernavn kan ikke være lengre en 64 tegn\",\n \"A valid password must be provided\" : \"Oppgi et gyldig passord\",\n \"The username is already being used\" : \"Brukernavnet er allerede i bruk\",\n \"Login canceled by app\" : \"Pålogging avbrutt av ap\",\n \"User disabled\" : \"Bruker deaktivert\",\n \"Settings\" : \"Innstillinger\",\n \"Users\" : \"Brukere\",\n \"App \\\"%s\\\" cannot be installed because the following dependencies are not fulfilled: %s\" : \"App \\\"%s\\\" kan ikke installeres fordi følgende avhengigheter ikke er tilfredsstilt: %s\",\n \"A safe home for all your data\" : \"Et trygt hjem for alle dine data\",\n \"Imprint\" : \"Avtrykk\",\n \"Privacy Policy\" : \"Personvern regler\",\n \"File is currently busy, please try again later\" : \"Filen er opptatt for øyeblikket, prøv igjen senere\",\n \"Application is not enabled\" : \"Applikasjon er ikke påslått\",\n \"Authentication error\" : \"Autentikasjonsfeil\",\n \"Token expired. Please reload page.\" : \"Symbol utløpt. Vennligst last inn siden på nytt.\",\n \"Unknown user\" : \"Ukjent bruker\",\n \"No database drivers (sqlite, mysql, or postgresql) installed.\" : \"Ingen databasedrivere (sqlite, mysql, or postgresql) installert.\",\n \"Cannot write into \\\"config\\\" directory\" : \"Kan ikke skrive i \\\"config\\\"-mappen\",\n \"Cannot create \\\"data\\\" directory\" : \"Kan ikke opprette \\\"data\\\"-mappen\",\n \"This can usually be fixed by giving the webserver write access to the root directory.\" : \"Dette kan vanligvis ordnes ved å gi web-serveren skrivetilgang til rotmappen.\",\n \"Permissions can usually be fixed by %sgiving the webserver write access to the root directory%s.\" : \"Tillatelser kan vanligvis ordnes ved %så gi web-serveren skrivetilgang til rotmappen%s.\",\n \"Setting locale to %s failed\" : \"Setting av nasjonale innstillinger til %s feilet.\",\n \"Please install one of these locales on your system and restart your webserver.\" : \"Vennligst installer en av disse nasjonale innstillingene på systemet ditt og start webserveren på nytt.\",\n \"Please ask your server administrator to install the module.\" : \"Be server-administratoren om å installere modulen.\",\n \"PHP module %s not installed.\" : \"PHP-modul %s er ikke installert.\",\n \"PHP setting \\\"%s\\\" is not set to \\\"%s\\\".\" : \"PHP-innstilling \\\"%s\\\" er ikke satt til \\\"%s\\\".\",\n \"Adjusting this setting in php.ini will make ownCloud run again\" : \"Endring av denne innstillingen i php.ini vil få ownCloud til å kjøre igjen.\",\n \"mbstring.func_overload is set to \\\"%s\\\" instead of the expected value \\\"0\\\"\" : \"mbstring.func_overload er satt til \\\"%s\\\" i stedet for den forventede verdien \\\"0\\\"\",\n \"To fix this issue set mbstring.func_overload to 0 in your php.ini\" : \"Sett mbstring.func_overload til 0 in php.ini for å fikse dette problemet\",\n \"libxml2 2.7.0 is at least required. Currently %s is installed.\" : \"libxml2 2.7.0 kreves minst. Nå er %s installert.\",\n \"To fix this issue update your libxml2 version and restart your web server.\" : \"Oppdater libxml2-versjonen og start web-serveren på nytt for å ordne dette problemet.\",\n \"PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible.\" : \"Det ser ut for at PHP er satt opp til å fjerne innebygde doc blocks. Dette gjør at flere av kjerneapplikasjonene blir utilgjengelige.\",\n \"This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.\" : \"Dette forårsakes sannsynligvis av en bufrer/akselerator, som f.eks. Zend OPcache eller eAccelerator.\",\n \"PHP modules have been installed, but they are still listed as missing?\" : \"PHP-moduler har blitt installert, men de listes fortsatt som fraværende?\",\n \"Please ask your server administrator to restart the web server.\" : \"Be server-administratoren om å starte web-serveren på nytt.\",\n \"PostgreSQL >= 9 required\" : \"PostgreSQL >= 9 kreves\",\n \"Please upgrade your database version\" : \"Vennligst oppgrader versjonen av databasen din\",\n \"Please change the permissions to 0770 so that the directory cannot be listed by other users.\" : \"Endre tillatelsene til 0770 slik at mappen ikke kan listes av andre brukere.\",\n \"Your Data directory is readable by other users\" : \"Datamappen din kan leses av andre brukere\",\n \"Your Data directory must be an absolute path\" : \"Datamappen din må være en absolutt sti\",\n \"Check the value of \\\"datadirectory\\\" in your configuration\" : \"Sjekk verdien for \\\"datadirectory\\\" i konfigurasjonen din\",\n \"Your Data directory is invalid\" : \"Datamappen din er ugyldig\",\n \"Please check that the data directory contains a file \\\".ocdata\\\" in its root.\" : \"Sjekk at det ligger en fil \\\".ocdata\\\" i roten av data-mappen.\",\n \"Could not obtain lock type %d on \\\"%s\\\".\" : \"Klarte ikke å låse med type %d på \\\"%s\\\".\",\n \"Storage unauthorized. %s\" : \"Lager uautorisert: %s\",\n \"Storage incomplete configuration. %s\" : \"Ikke komplett oppsett for lager. %s\",\n \"Storage connection error. %s\" : \"Tilkoblingsfeil for lager. %s\",\n \"Storage is temporarily not available\" : \"Lagring er for tiden ikke tilgjengelig\",\n \"Storage connection timeout. %s\" : \"Tidsavbrudd ved tilkobling av lager: %s\"\n},\"pluralForm\" :\"nplurals=2; plural=(n != 1);\"\n}"} {"text": "/*\nLanguage: Stylus\nAuthor: Bryant Williams \nDescription: Stylus (https://github.com/LearnBoost/stylus/)\nCategory: css\n*/\n\nfunction(hljs) {\n\n var VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.IDENT_RE\n };\n\n var HEX_COLOR = {\n className: 'number',\n begin: '#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})'\n };\n\n var AT_KEYWORDS = [\n 'charset',\n 'css',\n 'debug',\n 'extend',\n 'font-face',\n 'for',\n 'import',\n 'include',\n 'media',\n 'mixin',\n 'page',\n 'warn',\n 'while'\n ];\n\n var PSEUDO_SELECTORS = [\n 'after',\n 'before',\n 'first-letter',\n 'first-line',\n 'active',\n 'first-child',\n 'focus',\n 'hover',\n 'lang',\n 'link',\n 'visited'\n ];\n\n var TAGS = [\n 'a',\n 'abbr',\n 'address',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'blockquote',\n 'body',\n 'button',\n 'canvas',\n 'caption',\n 'cite',\n 'code',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'hgroup',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'mark',\n 'menu',\n 'nav',\n 'object',\n 'ol',\n 'p',\n 'q',\n 'quote',\n 'samp',\n 'section',\n 'span',\n 'strong',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'ul',\n 'var',\n 'video'\n ];\n\n var TAG_END = '[\\\\.\\\\s\\\\n\\\\[\\\\:,]';\n\n var ATTRIBUTES = [\n 'align-content',\n 'align-items',\n 'align-self',\n 'animation',\n 'animation-delay',\n 'animation-direction',\n 'animation-duration',\n 'animation-fill-mode',\n 'animation-iteration-count',\n 'animation-name',\n 'animation-play-state',\n 'animation-timing-function',\n 'auto',\n 'backface-visibility',\n 'background',\n 'background-attachment',\n 'background-clip',\n 'background-color',\n 'background-image',\n 'background-origin',\n 'background-position',\n 'background-repeat',\n 'background-size',\n 'border',\n 'border-bottom',\n 'border-bottom-color',\n 'border-bottom-left-radius',\n 'border-bottom-right-radius',\n 'border-bottom-style',\n 'border-bottom-width',\n 'border-collapse',\n 'border-color',\n 'border-image',\n 'border-image-outset',\n 'border-image-repeat',\n 'border-image-slice',\n 'border-image-source',\n 'border-image-width',\n 'border-left',\n 'border-left-color',\n 'border-left-style',\n 'border-left-width',\n 'border-radius',\n 'border-right',\n 'border-right-color',\n 'border-right-style',\n 'border-right-width',\n 'border-spacing',\n 'border-style',\n 'border-top',\n 'border-top-color',\n 'border-top-left-radius',\n 'border-top-right-radius',\n 'border-top-style',\n 'border-top-width',\n 'border-width',\n 'bottom',\n 'box-decoration-break',\n 'box-shadow',\n 'box-sizing',\n 'break-after',\n 'break-before',\n 'break-inside',\n 'caption-side',\n 'clear',\n 'clip',\n 'clip-path',\n 'color',\n 'column-count',\n 'column-fill',\n 'column-gap',\n 'column-rule',\n 'column-rule-color',\n 'column-rule-style',\n 'column-rule-width',\n 'column-span',\n 'column-width',\n 'columns',\n 'content',\n 'counter-increment',\n 'counter-reset',\n 'cursor',\n 'direction',\n 'display',\n 'empty-cells',\n 'filter',\n 'flex',\n 'flex-basis',\n 'flex-direction',\n 'flex-flow',\n 'flex-grow',\n 'flex-shrink',\n 'flex-wrap',\n 'float',\n 'font',\n 'font-family',\n 'font-feature-settings',\n 'font-kerning',\n 'font-language-override',\n 'font-size',\n 'font-size-adjust',\n 'font-stretch',\n 'font-style',\n 'font-variant',\n 'font-variant-ligatures',\n 'font-weight',\n 'height',\n 'hyphens',\n 'icon',\n 'image-orientation',\n 'image-rendering',\n 'image-resolution',\n 'ime-mode',\n 'inherit',\n 'initial',\n 'justify-content',\n 'left',\n 'letter-spacing',\n 'line-height',\n 'list-style',\n 'list-style-image',\n 'list-style-position',\n 'list-style-type',\n 'margin',\n 'margin-bottom',\n 'margin-left',\n 'margin-right',\n 'margin-top',\n 'marks',\n 'mask',\n 'max-height',\n 'max-width',\n 'min-height',\n 'min-width',\n 'nav-down',\n 'nav-index',\n 'nav-left',\n 'nav-right',\n 'nav-up',\n 'none',\n 'normal',\n 'object-fit',\n 'object-position',\n 'opacity',\n 'order',\n 'orphans',\n 'outline',\n 'outline-color',\n 'outline-offset',\n 'outline-style',\n 'outline-width',\n 'overflow',\n 'overflow-wrap',\n 'overflow-x',\n 'overflow-y',\n 'padding',\n 'padding-bottom',\n 'padding-left',\n 'padding-right',\n 'padding-top',\n 'page-break-after',\n 'page-break-before',\n 'page-break-inside',\n 'perspective',\n 'perspective-origin',\n 'pointer-events',\n 'position',\n 'quotes',\n 'resize',\n 'right',\n 'tab-size',\n 'table-layout',\n 'text-align',\n 'text-align-last',\n 'text-decoration',\n 'text-decoration-color',\n 'text-decoration-line',\n 'text-decoration-style',\n 'text-indent',\n 'text-overflow',\n 'text-rendering',\n 'text-shadow',\n 'text-transform',\n 'text-underline-position',\n 'top',\n 'transform',\n 'transform-origin',\n 'transform-style',\n 'transition',\n 'transition-delay',\n 'transition-duration',\n 'transition-property',\n 'transition-timing-function',\n 'unicode-bidi',\n 'vertical-align',\n 'visibility',\n 'white-space',\n 'widows',\n 'width',\n 'word-break',\n 'word-spacing',\n 'word-wrap',\n 'z-index'\n ];\n\n // illegals\n var ILLEGAL = [\n '\\\\?',\n '(\\\\bReturn\\\\b)', // monkey\n '(\\\\bEnd\\\\b)', // monkey\n '(\\\\bend\\\\b)', // vbscript\n '(\\\\bdef\\\\b)', // gradle\n ';', // a whole lot of languages\n '#\\\\s', // markdown\n '\\\\*\\\\s', // markdown\n '===\\\\s', // markdown\n '\\\\|',\n '%', // prolog\n ];\n\n return {\n aliases: ['styl'],\n case_insensitive: false,\n keywords: 'if else for in',\n illegal: '(' + ILLEGAL.join('|') + ')',\n contains: [\n\n // strings\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE,\n\n // comments\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n\n // hex colors\n HEX_COLOR,\n\n // class tag\n {\n begin: '\\\\.[a-zA-Z][a-zA-Z0-9_-]*' + TAG_END,\n returnBegin: true,\n contains: [\n {className: 'selector-class', begin: '\\\\.[a-zA-Z][a-zA-Z0-9_-]*'}\n ]\n },\n\n // id tag\n {\n begin: '\\\\#[a-zA-Z][a-zA-Z0-9_-]*' + TAG_END,\n returnBegin: true,\n contains: [\n {className: 'selector-id', begin: '\\\\#[a-zA-Z][a-zA-Z0-9_-]*'}\n ]\n },\n\n // tags\n {\n begin: '\\\\b(' + TAGS.join('|') + ')' + TAG_END,\n returnBegin: true,\n contains: [\n {className: 'selector-tag', begin: '\\\\b[a-zA-Z][a-zA-Z0-9_-]*'}\n ]\n },\n\n // psuedo selectors\n {\n begin: '&?:?:\\\\b(' + PSEUDO_SELECTORS.join('|') + ')' + TAG_END\n },\n\n // @ keywords\n {\n begin: '\\@(' + AT_KEYWORDS.join('|') + ')\\\\b'\n },\n\n // variables\n VARIABLE,\n\n // dimension\n hljs.CSS_NUMBER_MODE,\n\n // number\n hljs.NUMBER_MODE,\n\n // functions\n // - only from beginning of line + whitespace\n {\n className: 'function',\n begin: '^[a-zA-Z][a-zA-Z0-9_\\-]*\\\\(.*\\\\)',\n illegal: '[\\\\n]',\n returnBegin: true,\n contains: [\n {className: 'title', begin: '\\\\b[a-zA-Z][a-zA-Z0-9_\\-]*'},\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n contains: [\n HEX_COLOR,\n VARIABLE,\n hljs.APOS_STRING_MODE,\n hljs.CSS_NUMBER_MODE,\n hljs.NUMBER_MODE,\n hljs.QUOTE_STRING_MODE\n ]\n }\n ]\n },\n\n // attributes\n // - only from beginning of line + whitespace\n // - must have whitespace after it\n {\n className: 'attribute',\n begin: '\\\\b(' + ATTRIBUTES.reverse().join('|') + ')\\\\b',\n starts: {\n // value container\n end: /;|$/,\n contains: [\n HEX_COLOR,\n VARIABLE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE,\n hljs.NUMBER_MODE,\n hljs.C_BLOCK_COMMENT_MODE\n ],\n illegal: /\\./,\n relevance: 0\n }\n }\n ]\n };\n}\n"} {"text": "_testArgs = null;\n $this->_testResult = null;\n $this->_error = null;\n\n $this->_connOptions = [\n \"realm\" => 'testRealm',\n \"url\" => 'ws://127.0.0.1:8090',\n \"max_retries\" => 0,\n ];\n\n $this->_conn = new \\Thruway\\Connection($this->_connOptions);\n\n $this->_loop = $this->_conn->getClient()->getLoop();\n\n $this->_conn2 = new \\Thruway\\Connection($this->_connOptions, $this->_loop);\n }\n\n\n public function testCall()\n {\n $this->_conn->on(\n 'open',\n function (\\Thruway\\ClientSession $session) {\n $session->call('com.example.testcall', ['testing123'])->then(\n function ($res) {\n $this->_conn->close();\n $this->_testResult = $res;\n },\n function ($error) {\n $this->_conn->close();\n $this->_error = $error;\n }\n );\n }\n );\n\n $this->_conn->open();\n\n $this->assertNull($this->_error, \"Got this error when making an RPC call: {$this->_error}\");\n $this->assertEquals($this->_testResult[0], $this->_testResult, \"__toString should be the 0 index of the result\");\n $this->assertEquals('testing123', $this->_testResult[0]);\n }\n\n public function xtestPing()\n {\n $this->_conn->on(\n 'open',\n function (\\Thruway\\ClientSession $session) {\n $session->ping(10)->then(\n function ($res) {\n $this->_conn->close();\n// $this->_testResult = $res;\n// $this->_echoResult = $res->getEcho();\n },\n function ($error) {\n $this->_conn->close();\n $this->_error = $error;\n }\n );\n }\n );\n\n $this->_conn->open();\n\n $this->assertNull($this->_error, \"Got this error when pinging: {$this->_error}\");\n $this->assertEquals($this->_echoResult[0], \"echo content\", \"Ping echoed correctly\");\n $this->assertTrue($this->_testResult instanceof \\Thruway\\Message\\PongMessage);\n }\n\n /**\n * This calls an RPC in the InternalClient object that calls ping from the server\n * side and returns the result.\n */\n public function xtestServerPing()\n {\n $this->_conn->on(\n 'open',\n function (\\Thruway\\ClientSession $session) {\n $session->call('com.example.ping', [])->then(\n function ($res) {\n $this->_conn->close();\n $this->_testResult = \\Thruway\\Message\\Message::createMessageFromRaw(json_encode($res[0]));\n },\n function ($error) {\n $this->_conn->close();\n $this->_error = $error;\n }\n );\n }\n );\n\n $this->_conn->open();\n\n $this->assertNull($this->_error, \"Got this error when pinging: {$this->_error}\");\n $this->assertTrue($this->_testResult instanceof \\Thruway\\Message\\PongMessage);\n $this->assertEquals(\"echo content\", $this->_testResult->getEcho()[0], \"Ping echoed correctly\");\n }\n\n /**\n * @depends testCall\n */\n public function testSubscribe()\n {\n $this->_conn->on(\n 'open',\n function (\\Thruway\\ClientSession $session) {\n\n /**\n * Subscribe to event\n */\n $session->subscribe(\n 'com.example.publish',\n function ($args, $kwargs = null, $details = null, $publicationId = null) {\n //$this->_conn->close();\n $this->_testArgs = $args;\n $this->_testKWArgs = $kwargs;\n $this->_publicationId = $publicationId;\n\n }\n )->then(function () use ($session) {\n /**\n * Tell the server to publish\n */\n $session->call('com.example.publish', ['test publish'])->then(\n function ($res) {\n $this->_testResult = $res;\n\n },\n function ($error) {\n $this->_conn->close();\n $this->_error = $error;\n })->then(function () use ($session) {\n $session->close();\n });\n },\n function () use ($session) {\n $session->close();\n throw new \\Exception(\"subscribe failed.\");\n });\n }\n );\n\n $this->_conn->open();\n\n $this->assertNull($this->_error, \"Got this error when making an RPC call: {$this->_error}\");\n $this->assertEquals('test publish', $this->_testArgs[0]);\n $this->assertEquals('test1', $this->_testKWArgs->key1);\n $this->assertNotNull($this->_publicationId);\n $this->assertEquals('ok', $this->_testResult[0]);\n }\n\n\n /**\n * @depends testCall\n */\n public function testUnregister()\n {\n $this->_error = null;\n\n $this->_conn->on(\n 'open',\n function (\\Thruway\\ClientSession $session) {\n\n $callback = function () {\n return \"Hello\";\n };\n\n $session->register('com.example.somethingToUnregister', $callback)\n ->then(function () use ($session) {\n $session->unregister('com.example.somethingToUnregister')\n ->then(function () {\n $this->_conn->close();\n $this->_testResult = \"unregistered\";\n },\n function () {\n $this->_conn->close();\n $this->_error = \"Error during unregistration\";\n }\n );\n\n },\n function () {\n $this->_conn->close();\n $this->_error = \"Couldn't even register the call\";\n }\n );\n\n // TODO: test unregistering again\n // TODO: test unregistering a different session's registration\n }\n );\n\n $this->_conn->open();\n\n $this->assertNull($this->_error, \"Got this error when making an RPC call: {$this->_error}\");\n $this->assertEquals('unregistered', $this->_testResult);\n }\n\n function xtestRealmUnauthenticated() {\n $this->_error = null;\n\n $this->_testResult = \"nothing\";\n\n $conn = new \\Thruway\\Connection(\n [\n \"realm\" => 'not_allowed',\n \"url\" => 'ws://127.0.0.1:8090',\n \"max_retries\" => 0,\n ]\n );\n\n $conn->on(\n 'open',\n function (\\Thruway\\ClientSession $session) {\n $session->close();\n }\n );\n\n $conn->on('error', function ($reason) {\n $this->_testResult = $reason;\n });\n\n $conn->open();\n\n $this->assertNull($this->_error, \"Got this error when making an RPC call: {$this->_error}\");\n\n $this->assertEquals('wamp.error.not_authorized', $this->_testResult);\n }\n\n public function xtestCallWithArguments()\n {\n $this->_conn->on(\n 'open',\n function (\\Thruway\\ClientSession $session) {\n $session->call('com.example.testcallwitharguments', ['testing123'])->then(\n function ($res) {\n $this->_conn->close();\n $this->_testResult = $res;\n },\n function ($error) {\n $this->_conn->close();\n $this->_error = $error;\n }\n );\n }\n );\n\n $this->_conn->open();\n\n $this->assertNull($this->_error, \"Got this error when making an RPC call: {$this->_error}\");\n $this->assertEquals('testing123', $this->_testResult[0]);\n }\n\n public function testNotGettingPublishedEvent() {\n $this->_error = null;\n $this->_conn->on('open', function (\\Thruway\\ClientSession $session) {\n $session->subscribe('com.example.topic', function ($args) {\n $this->_error = \"got message\";\n })->then(\n function () use ($session) {\n // successfully subscribed\n // try publishing\n $session->publish('com.example.topic', [\"test\"]);\n\n $session->getLoop()->addTimer(1, function () use ($session) {\n $session->close();\n });\n },\n function () use ($session) {\n $this->_error = \"Subscribe failed\";\n $session->close();\n }\n );\n });\n\n $this->_conn->open();\n\n $this->assertNull($this->_error, \"Error \" . $this->_error);\n }\n\n public function testGettingPublishedEvent() {\n $this->_error = null;\n $this->_testResult = null;\n $this->_conn->on('open', function (\\Thruway\\ClientSession $session) {\n $session->subscribe('com.example.topic', function ($args) {\n $this->_testResult = \"got message\";\n })->then(\n function () use ($session) {\n // successfully subscribed\n // try publishing\n $session->publish('com.example.topic', [\"test\"], null, [\"exclude_me\" => false]);\n\n $session->getLoop()->addTimer(1, function () use ($session) {\n $session->close();\n });\n },\n function () use ($session) {\n $this->_error = \"Subscribe failed\";\n $session->close();\n }\n );\n });\n\n $this->_conn->open();\n\n $this->assertNull($this->_error, \"Error \" . $this->_error);\n $this->assertEquals(\"got message\", $this->_testResult);\n }\n\n public function testSubscribeFailure() {\n $this->_error = null;\n $this->_testResult = null;\n\n $this->_conn->on('open', function (\\Thruway\\ClientSession $session) {\n $session->subscribe('!?/&', function () {})->then(\n function () use ($session) {\n $this->_error = \"Able to subscribe to bad Uri\";\n $session->close();\n },\n function () use ($session) {\n $this->_testResult = \"subscribe failed\";\n $session->close();\n }\n );\n }\n );\n\n $this->_conn->open();\n\n $this->assertNull($this->_error, \"Error \" . $this->_error);\n $this->assertEquals(\"subscribe failed\", $this->_testResult);\n }\n\n public function testPublishNoArguments() {\n $this->_testResult = null;\n $this->_error = null;\n\n $this->_conn->on('open', function (\\Thruway\\ClientSession $session) {\n $session->subscribe(\"some.topic\", function ($args, $argsKw) {\n $this->_testResult = $args;\n $this->_conn->close();\n })->then(\n function ($asdf) use ($session) {\n $session->publish(\"some.topic\", null, null, [\"exclude_me\" => false]);\n },\n function ($err) {\n $this->_error = \"Subscribe failed.\";\n $this->_conn->close();\n }\n );\n });\n\n $this->_conn->open();\n\n $this->assertTrue(is_array($this->_testResult));\n $this->assertEmpty($this->_testResult);\n $this->assertNull($this->_error, \"Error: \" . $this->_error);\n }\n\n public function testPublishExclude() {\n $this->_testResult = null;\n $this->_deferred = new \\React\\Promise\\Deferred();\n\n $this->_conn->on('open', function (\\Thruway\\ClientSession $session) {\n $session->subscribe(\"some.topic\", function ($args) {\n $this->_testResult .= $args[0];\n if ($args[0] == 3) {\n $this->_deferred->resolve();\n }\n })->then(function ($subscribedMsg) use ($session) {\n $this->assertInstanceOf('\\Thruway\\Message\\SubscribedMessage', $subscribedMsg);\n\n $this->_conn2->on('open', function (\\Thruway\\ClientSession $s2) use ($session, $subscribedMsg) {\n $promises = [];\n\n $promises[] = $s2->publish(\"some.topic\", [1], null, ['acknowledge' => true]);\n $promises[] = $s2->publish(\"some.topic\", [2], null, ['acknowledge' => true, 'exclude' => [$session->getSessionId()]]);\n $promises[] = $s2->publish(\"some.topic\", [3], null, ['acknowledge' => true]);\n\n // add the subscription deferred so we can wait until we get the\n // published events before exiting\n $promises[] = $this->_deferred->promise();\n\n $pAll = \\React\\Promise\\all($promises);\n\n $pAll->then(function () use ($session, $s2) {\n $session->close();\n $s2->close();\n }, function () use ($session, $s2) {\n $this->fail(\"Publish failed\");\n $session->close();\n $s2->close();\n });\n });\n\n $this->_conn2->open(false);\n }, function () use ($session) {\n $session->close();\n $this->fail(\"Subscribe failed\");\n });\n });\n\n $this->_conn->open();\n\n $this->assertEquals(\"13\", $this->_testResult);\n }\n\n public function testWhiteList() {\n\n $conns = [];\n $sessionIds = [];\n $results = [];\n\n $loop = $this->_loop;\n\n $subscribePromises = [];\n\n for ($i = 0; $i < 5; $i++) {\n $results[$i] = \"\";\n $conns[$i] = $conn = new \\Thruway\\Connection($this->_connOptions, $loop);\n $conn->on('open', function (\\Thruway\\ClientSession $session) use ($i, &$sessionIds, &$subscribePromises, &$results) {\n $sessionIds[$i] = $session->getSessionId();\n $subscribePromises[] = $session->subscribe('test.whitelist', function ($args) use ($i, $session, &$results) {\n $results[$i] .= \"-\" . $args[0] . \".\" . $i . \"-\";\n if ($args[0] == \"X\") {\n $session->close();\n }\n });\n });\n\n $conn->open(false);\n }\n\n $this->_conn->on('open', function (\\Thruway\\ClientSession $session) use ($subscribePromises, &$sessionIds) {\n \\React\\Promise\\all($subscribePromises)->then(function () use ($session, &$sessionIds) {\n $session->publish('test.whitelist', [\"A\"], null,\n ['acknowledge' => true]\n )->then(function () use ($session, &$sessionIds) {\n $session->publish('test.whitelist', [\"B\"], null, [\n 'acknowledge' => true,\n 'eligible' => $sessionIds\n ])->then(function () use ($session, &$sessionIds) {\n $session->publish('test.whitelist', [\"C\"], null, [\n 'acknowledge' => true,\n 'exclude' => [$sessionIds[1]],\n 'eligible' => $sessionIds\n ])->then(function () use ($session, &$sessionIds) {\n $session->publish('test.whitelist', [\"D\"], null, [\n 'acknowledge' => true,\n 'exclude' => [$sessionIds[1]],\n 'eligible' => [$sessionIds[2]]\n ])->then(function () use ($session, &$sessionIds) {\n $session->publish('test.whitelist', [\"E\"], null, [\n 'acknowledge' => true,\n 'exclude' => [$sessionIds[1]],\n 'eligible' => []\n ])->then(function () use ($session, &$sessionIds) {\n $session->publish('test.whitelist', [\"F\"], null, [\n 'acknowledge' => true,\n 'exclude' => [],\n 'eligible' => [$sessionIds[0]]\n ])->then(function () use ($session, &$sessionIds) {\n // shutdown the sessions\n $session->publish('test.whitelist', [\"X\"], null, [\n 'acknowledge' => true\n ])->then(function () use ($session) {\n $session->close();\n });;\n });\n });\n });\n });\n });\n });\n });\n });\n\n $this->_conn->open();\n\n $this->assertEquals(\"-A.0--B.0--C.0--F.0--X.0-\", $results[0]);\n $this->assertEquals(\"-A.1--B.1--X.1-\", $results[1]);\n $this->assertEquals(\"-A.2--B.2--C.2--D.2--X.2-\", $results[2]);\n $this->assertEquals(\"-A.3--B.3--C.3--X.3-\", $results[3]);\n $this->assertEquals(\"-A.4--B.4--C.4--X.4-\", $results[4]);\n }\n\n public function testCallCancelEndToEnd()\n {\n $canceled = false;\n $callHasBegun = new Deferred();\n $callHasBeenCanceled = new Deferred();\n\n /** @var CancellablePromiseInterface $callPromise */\n $callPromise = null;\n\n $this->_conn->on('open', function (ClientSession $session) use (&$canceled, $callHasBegun, &$callPromise, $callHasBeenCanceled) {\n $session->register('registration.that.supports.cancel', function () use (&$canceled, $callHasBegun, $callHasBeenCanceled) {\n $defered = new Deferred(function () use (&$canceled, $callHasBeenCanceled) {\n $canceled = true;\n $callHasBeenCanceled->resolve();\n });\n\n $callHasBegun->resolve();\n\n return $defered->promise();\n })->then(function () use ($session, $callHasBegun, &$callPromise) { // registration successful\n $callPromise = $session->call('registration.that.supports.cancel');\n\n return $callHasBegun->promise();\n })->then(function () use (&$callPromise, $callHasBeenCanceled) { // invocation has been run\n $callPromise->cancel();\n\n return $callHasBeenCanceled->promise();\n })->then(function () use ($session) {\n $session->close();\n });\n });\n\n $this->_conn->open();\n\n $this->assertTrue($canceled);\n }\n}\n"} {"text": "begin;\n\nalter table users add delay_time interval not null default '00:00:00'::interval;\n\nrollback; -- change this to: commit;\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 com.google.wave.api;\n\nimport java.io.Serializable;\n\n/**\n * ParticipantProfile represents participant information. It contains display\n * name, avatar's URL, and an external URL to view the participant's profile\n * page. This is a data transfer object that is being sent from Robot when Rusty\n * queries a profile. A participant can be the Robot itself, or a user in the\n * Robot's domain.\n *\n * @author mprasetya@google.com (Marcel Prasetya)\n */\npublic final class ParticipantProfile implements Serializable {\n\n private final String address;\n private final String name;\n private final String imageUrl;\n private final String profileUrl;\n\n /**\n * Constructs an empty profile.\n */\n public ParticipantProfile() {\n this(\"\", \"\", \"\", \"\");\n }\n\n /**\n * Constructs a profile.\n *\n * @param name the name of the participant.\n * @param imageUrl the URL of the participant's avatar.\n * @param profileUrl the URL of the participant's external profile page.\n */\n public ParticipantProfile(String name, String imageUrl, String profileUrl) {\n this(\"\", name, imageUrl, profileUrl);\n }\n\n /**\n * Constructs a profile.\n *\n * @param address the address of the participant.\n * @param name the name of the participant.\n * @param imageUrl the URL of the participant's avatar.\n * @param profileUrl the URL of the participant's external profile page.\n */\n public ParticipantProfile(String address, String name, String imageUrl,\n String profileUrl) {\n this.address = address;\n this.name = name;\n this.imageUrl = imageUrl;\n this.profileUrl = profileUrl;\n }\n\n /**\n * @return the address of the participant.\n */\n public String getAddress() {\n return address;\n }\n\n /**\n * @return the name of the participant.\n */\n public String getName() {\n return name;\n }\n\n /**\n * @return the URL of the participant's avatar.\n */\n public String getImageUrl() {\n return imageUrl;\n }\n\n /**\n * @return the URL of the profile page.\n */\n public String getProfileUrl() {\n return profileUrl;\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 arm64,darwin\n\npackage unix\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc Getpagesize() int { return 16384 }\n\nfunc TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }\n\nfunc NsecToTimespec(nsec int64) (ts Timespec) {\n\tts.Sec = nsec / 1e9\n\tts.Nsec = nsec % 1e9\n\treturn\n}\n\nfunc TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }\n\nfunc NsecToTimeval(nsec int64) (tv Timeval) {\n\tnsec += 999 // round up to microsecond\n\ttv.Usec = int32(nsec % 1e9 / 1e3)\n\ttv.Sec = int64(nsec / 1e9)\n\treturn\n}\n\n//sysnb\tgettimeofday(tp *Timeval) (sec int64, usec int32, err error)\nfunc Gettimeofday(tv *Timeval) (err error) {\n\t// The tv passed to gettimeofday must be non-nil\n\t// but is otherwise unused. The answers come back\n\t// in the two registers.\n\tsec, usec, err := gettimeofday(tv)\n\ttv.Sec = sec\n\ttv.Usec = usec\n\treturn err\n}\n\nfunc SetKevent(k *Kevent_t, fd, mode, flags int) {\n\tk.Ident = uint64(fd)\n\tk.Filter = int16(mode)\n\tk.Flags = uint16(flags)\n}\n\nfunc (iov *Iovec) SetLen(length int) {\n\tiov.Len = uint64(length)\n}\n\nfunc (msghdr *Msghdr) SetControllen(length int) {\n\tmsghdr.Controllen = uint32(length)\n}\n\nfunc (cmsg *Cmsghdr) SetLen(length int) {\n\tcmsg.Len = uint32(length)\n}\n\nfunc sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {\n\tvar length = uint64(count)\n\n\t_, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0)\n\n\twritten = int(length)\n\n\tif e1 != 0 {\n\t\terr = e1\n\t}\n\treturn\n}\n\nfunc Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic\n\n// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions\n// of darwin/arm64 the syscall is called sysctl instead of __sysctl.\nconst SYS___SYSCTL = SYS_SYSCTL\n"} {"text": "/*\n * Generated by class-dump 3.3.4 (64 bit).\n *\n * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.\n */\n\n//#import \"NSObject.h\"\n//\n//#import \"NSCoding-Protocol.h\"\n\n@class CMessageWrap, NSString;\n\n@interface OpenInfo : NSObject //\n{\n unsigned int m_uiLocalID;\n NSString *m_nsUsrName;\n unsigned int m_uiCreateTime;\n unsigned int m_uiScene;\n CMessageWrap *m_wrapMsg;\n unsigned int m_uiStartPos;\n unsigned int m_uiAddQueueTime;\n BOOL m_bCheckMd5;\n NSString *m_nsAttachId;\n NSString *m_nsAttachFileExt;\n unsigned int m_uiAttachDataSize;\n}\n\n- (id)init;\n- (void)dealloc;\n- (void)encodeWithCoder:(id)arg1;\n- (id)initWithCoder:(id)arg1;\n- (id)description;\n- (void)GetMsg;\n- (BOOL)IsCanUpload;\n- (BOOL)IsCanDownload;\n- (void)SetStatus;\n@property(nonatomic) unsigned int m_uiAttachDataSize; // @synthesize m_uiAttachDataSize;\n@property(retain, nonatomic) NSString *m_nsAttachFileExt; // @synthesize m_nsAttachFileExt;\n@property(retain, nonatomic) NSString *m_nsAttachId; // @synthesize m_nsAttachId;\n@property(nonatomic) BOOL m_bCheckMd5; // @synthesize m_bCheckMd5;\n@property(nonatomic) unsigned int m_uiAddQueueTime; // @synthesize m_uiAddQueueTime;\n@property(nonatomic) unsigned int m_uiStartPos; // @synthesize m_uiStartPos;\n@property(retain, nonatomic) CMessageWrap *m_wrapMsg; // @synthesize m_wrapMsg;\n@property(nonatomic) unsigned int m_uiScene; // @synthesize m_uiScene;\n@property(nonatomic) unsigned int m_uiCreateTime; // @synthesize m_uiCreateTime;\n@property(retain, nonatomic) NSString *m_nsUsrName; // @synthesize m_nsUsrName;\n@property(nonatomic) unsigned int m_uiLocalID; // @synthesize m_uiLocalID;\n\n@end\n\n"} {"text": "/*\n * Copyright (c) 2016, Eistec AB.\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 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 HOLDER 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\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * 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)\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 * \\addtogroup oma-lwm2m\n * @{\n */\n\n/**\n * \\file\n * Implementation of the Contiki OMA LWM2M JSON writer\n * \\author\n * Joakim Nohlgård \n */\n\n#include \"lwm2m-object.h\"\n#include \"lwm2m-json.h\"\n#include \"lwm2m-plain-text.h\"\n#include \n#include \n#include \n#include \n\n#define DEBUG 0\n#if DEBUG\n#define PRINTF(...) printf(__VA_ARGS__)\n#else\n#define PRINTF(...)\n#endif\n\n/*---------------------------------------------------------------------------*/\nstatic size_t\nwrite_boolean(const lwm2m_context_t *ctx, uint8_t *outbuf, size_t outlen,\n int value)\n{\n int len = snprintf((char *)outbuf, outlen, \"{\\\"e\\\":[{\\\"n\\\":\\\"%u\\\",\\\"bv\\\":%s}]}\\n\", ctx->resource_id, value ? \"true\" : \"false\");\n if((len < 0) || (len >= outlen)) {\n return 0;\n }\n return len;\n}\n/*---------------------------------------------------------------------------*/\nstatic size_t\nwrite_int(const lwm2m_context_t *ctx, uint8_t *outbuf, size_t outlen,\n int32_t value)\n{\n int len = snprintf((char *)outbuf, outlen, \"{\\\"e\\\":[{\\\"n\\\":\\\"%u\\\",\\\"v\\\":%\" PRId32 \"}]}\\n\", ctx->resource_id, value);\n if((len < 0) || (len >= outlen)) {\n return 0;\n }\n return len;\n}\n/*---------------------------------------------------------------------------*/\nstatic size_t\nwrite_float32fix(const lwm2m_context_t *ctx, uint8_t *outbuf, size_t outlen,\n int32_t value, int bits)\n{\n size_t len = 0;\n int res;\n res = snprintf((char *)outbuf, outlen, \"{\\\"e\\\":[{\\\"n\\\":\\\"%u\\\",\\\"v\\\":\", ctx->resource_id);\n if(res <= 0 || res >= outlen) {\n return 0;\n }\n len += res;\n outlen -= res;\n res = lwm2m_plain_text_write_float32fix(&outbuf[len], outlen, value, bits);\n if((res <= 0) || (res >= outlen)) {\n return 0;\n }\n len += res;\n outlen -= res;\n res = snprintf((char *)&outbuf[len], outlen, \"}]}\\n\");\n if((res <= 0) || (res >= outlen)) {\n return 0;\n }\n len += res;\n return len;\n}\n/*---------------------------------------------------------------------------*/\nstatic size_t\nwrite_string(const lwm2m_context_t *ctx, uint8_t *outbuf, size_t outlen,\n const char *value, size_t stringlen)\n{\n size_t i;\n size_t len = 0;\n int res;\n PRINTF(\"{\\\"e\\\":[{\\\"n\\\":\\\"%u\\\",\\\"sv\\\":\\\"\", ctx->resource_id);\n res = snprintf((char *)outbuf, outlen, \"{\\\"e\\\":[{\\\"n\\\":\\\"%u\\\",\\\"sv\\\":\\\"\", ctx->resource_id);\n if(res < 0 || res >= outlen) {\n return 0;\n }\n len += res;\n for (i = 0; i < stringlen && len < outlen; ++i) {\n /* Escape special characters */\n /* TODO: Handle UTF-8 strings */\n if(value[i] < '\\x20') {\n PRINTF(\"\\\\x%x\", value[i]);\n res = snprintf((char *)&outbuf[len], outlen - len, \"\\\\x%x\", value[i]);\n if((res < 0) || (res >= (outlen - len))) {\n return 0;\n }\n len += res;\n continue;\n } else if(value[i] == '\"' || value[i] == '\\\\') {\n PRINTF(\"\\\\\");\n outbuf[len] = '\\\\';\n ++len;\n if(len >= outlen) {\n return 0;\n }\n }\n PRINTF(\"%c\", value[i]);\n outbuf[len] = value[i];\n ++len;\n if(len >= outlen) {\n return 0;\n }\n }\n PRINTF(\"\\\"}]}\\n\");\n res = snprintf((char *)&outbuf[len], outlen - len, \"\\\"}]}\\n\");\n if((res < 0) || (res >= (outlen - len))) {\n return 0;\n }\n len += res;\n return len;\n}\n/*---------------------------------------------------------------------------*/\nconst lwm2m_writer_t lwm2m_json_writer = {\n write_int,\n write_string,\n write_float32fix,\n write_boolean\n};\n/*---------------------------------------------------------------------------*/\n/** @} */\n"} {"text": "23\n12\n21\n16\n15\n10\n15\n16\n5\n20\n8\n19\n15\n14\n13\n20\n13\n21\n9\n16\n7\n14\n28\n17\n18\n18\n34\n22\n18\n13\n11\n10\n15\n26\n19\n14\n21\n9\n13\n15\n12\n16\n15\n18\n9\n17\n7\n19\n12\n12\n7\n12\n14\n13\n9\n27\n12\n32\n11\n20\n16\n17\n11\n27\n11\n10\n18\n17\n11\n18\n24\n23\n25\n5\n11\n19\n10\n9\n9\n14\n14\n18\n18\n19\n19\n14\n12\n12\n14\n10\n12\n16\n10\n15\n12\n18\n9\n23\n12\n13\n11\n12\n19\n20\n13\n17\n17\n13\n17\n16\n13\n16\n9\n10\n14\n15\n9\n14\n16\n14\n12\n15\n14\n12\n11\n11\n12\n10\n14\n16\n18\n19\n11\n7\n9\n9\n16\n10\n12\n10\n11\n12\n16\n16\n12\n6\n10\n13\n10\n13\n7\n12\n10\n19\n20\n24\n16\n13\n17\n20\n21\n14\n11\n18\n15\n16\n18\n10\n21\n20\n12\n3\n14\n13\n11\n10\n12\n11\n15\n17\n16\n6\n9\n10\n6\n19\n18\n19\n10\n19\n20\n21\n13\n15\n8\n23\n14\n13\n13\n19\n9\n16\n27\n22\n25\n8\n11\n9\n11\n15\n14\n14\n22\n16\n21\n10\n16\n17\n16\n9\n12\n17\n22\n25\n13\n16\n24\n18\n10\n4\n13\n9\n25\n23\n20\n9\n15\n22\n20\n9\n19\n2\n14\n10\n11\n16\n13\n10\n15\n21\n21\n14\n13\n13\n14\n23\n15\n14\n17\n19\n9\n8\n16\n11\n34\n18\n15\n10\n12\n9\n16\n10\n12\n12\n21\n18\n13\n11\n10\n10\n7\n12\n16\n12\n9\n16\n34\n20\n"} {"text": "class B19950219 {\n @Override\n String normalizeWord(String word) {\n return Ascii.toLowerCase(word);\n }\n\n @Override\n String convert(CaseFormat format, String s) {}\n}\n"} {"text": "class CryptoApi\n BASE_URL = ENV['CRYPTO_API_URL']\n DEFAULT_HEADERS = {'Content-Type' => 'application/json', 'api_key' => ENV['CRYPTO_API_SECRET']}\n\n class MissingIssueAddressError < StandardError; end\n class CryptoPayOutFailed < StandardError; end\n class RefundTransactionError < StandardError; end\n\n\n def self.generate_address(issue_id)\n url = \"#{BASE_URL}issues/#{issue_id}/issue_address\"\n response = RestClient.post(url, {id: issue_id, category: 1}.to_json, DEFAULT_HEADERS)\n raise MissingIssueAddressError unless response.code == 200\n end\n\n def self.refresh_bounties(issue_id)\n url = \"#{BASE_URL}issues/#{issue_id}/bounties/refresh\"\n response = RestClient.get(url, DEFAULT_HEADERS)\n end\n\n def self.verify_wallet(wallet, signed_txn)\n url = \"#{BASE_URL}wallets/#{wallet.id}/verify\"\n\n params = {\n signedTxn: signed_txn,\n personId: wallet.person_id,\n walletAddrs: wallet.eth_addr\n }\n response = RestClient.post(url, params.to_json, DEFAULT_HEADERS )\n\n if response.code == 201\n true\n else\n false\n end\n end\n\n def self.refund_transaction(issue_id, transaction_hash)\n url = \"#{BASE_URL}issues/#{issue_id}/refund/#{transaction_hash}\"\n\n response = RestClient.get(url, DEFAULT_HEADERS )\n\n raise RefundTransactionError unless response.code == 200\n end\n\n def self.send_crypto_pay_out(issue_id)\n url = \"#{BASE_URL}issues/#{issue_id}/bounties/pay-out\"\n\n response = RestClient.get(url, DEFAULT_HEADERS)\n\n raise CryptoPayOutFailed unless response.code == 200\n end\nend"} {"text": "// Copyright 2009 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// Test Unicode character ranges in regexps.\n\n\n// Cyrillic.\nvar cyrillic = {\n FIRST: \"\\u0410\", // A\n first: \"\\u0430\", // a\n LAST: \"\\u042f\", // YA\n last: \"\\u044f\", // ya\n MIDDLE: \"\\u0427\", // CHE\n middle: \"\\u0447\", // che\n // Actually no characters are between the cases in Cyrillic.\n BetweenCases: false};\n\nvar SIGMA = \"\\u03a3\";\nvar sigma = \"\\u03c3\";\nvar alternative_sigma = \"\\u03c2\";\n\n// Greek.\nvar greek = {\n FIRST: \"\\u0391\", // ALPHA\n first: \"\\u03b1\", // alpha\n LAST: \"\\u03a9\", // OMEGA\n last: \"\\u03c9\", // omega\n MIDDLE: SIGMA, // SIGMA\n middle: sigma, // sigma\n // Epsilon acute is between ALPHA-OMEGA and alpha-omega, ie it\n // is between OMEGA and alpha.\n BetweenCases: \"\\u03ad\"};\n\n\nfunction Range(from, to, flags) {\n return new RegExp(\"[\" + from + \"-\" + to + \"]\", flags);\n}\n\n// Test Cyrillic and Greek separately.\nfor (var lang = 0; lang < 2; lang++) {\n var chars = (lang == 0) ? cyrillic : greek;\n\n for (var i = 0; i < 2; i++) {\n var lc = (i == 0); // Lower case.\n var first = lc ? chars.first : chars.FIRST;\n var middle = lc ? chars.middle : chars.MIDDLE;\n var last = lc ? chars.last : chars.LAST;\n var first_other_case = lc ? chars.FIRST : chars.first;\n var middle_other_case = lc ? chars.MIDDLE : chars.middle;\n var last_other_case = lc ? chars.LAST : chars.last;\n\n assertTrue(Range(first, last).test(first), 1);\n assertTrue(Range(first, last).test(middle), 2);\n assertTrue(Range(first, last).test(last), 3);\n\n assertFalse(Range(first, last).test(first_other_case), 4);\n assertFalse(Range(first, last).test(middle_other_case), 5);\n assertFalse(Range(first, last).test(last_other_case), 6);\n\n assertTrue(Range(first, last, \"i\").test(first), 7);\n assertTrue(Range(first, last, \"i\").test(middle), 8);\n assertTrue(Range(first, last, \"i\").test(last), 9);\n\n assertTrue(Range(first, last, \"i\").test(first_other_case), 10);\n assertTrue(Range(first, last, \"i\").test(middle_other_case), 11);\n assertTrue(Range(first, last, \"i\").test(last_other_case), 12);\n\n if (chars.BetweenCases) {\n assertFalse(Range(first, last).test(chars.BetweenCases), 13);\n assertFalse(Range(first, last, \"i\").test(chars.BetweenCases), 14);\n }\n }\n if (chars.BetweenCases) {\n assertTrue(Range(chars.FIRST, chars.last).test(chars.BetweenCases), 15);\n assertTrue(Range(chars.FIRST, chars.last, \"i\").test(chars.BetweenCases), 16);\n }\n}\n\n// Test range that covers both greek and cyrillic characters.\nfor (key in greek) {\n assertTrue(Range(greek.FIRST, cyrillic.last).test(greek[key]), 17 + key);\n if (cyrillic[key]) {\n assertTrue(Range(greek.FIRST, cyrillic.last).test(cyrillic[key]), 18 + key);\n }\n}\n\nfor (var i = 0; i < 2; i++) {\n var ignore_case = (i == 0);\n var flag = ignore_case ? \"i\" : \"\";\n assertTrue(Range(greek.first, cyrillic.LAST, flag).test(greek.first), 19);\n assertTrue(Range(greek.first, cyrillic.LAST, flag).test(greek.middle), 20);\n assertTrue(Range(greek.first, cyrillic.LAST, flag).test(greek.last), 21);\n\n assertTrue(Range(greek.first, cyrillic.LAST, flag).test(cyrillic.FIRST), 22);\n assertTrue(Range(greek.first, cyrillic.LAST, flag).test(cyrillic.MIDDLE), 23);\n assertTrue(Range(greek.first, cyrillic.LAST, flag).test(cyrillic.LAST), 24);\n\n // A range that covers the lower case greek letters and the upper case cyrillic\n // letters.\n assertEquals(ignore_case, Range(greek.first, cyrillic.LAST, flag).test(greek.FIRST), 25);\n assertEquals(ignore_case, Range(greek.first, cyrillic.LAST, flag).test(greek.MIDDLE), 26);\n assertEquals(ignore_case, Range(greek.first, cyrillic.LAST, flag).test(greek.LAST), 27);\n\n assertEquals(ignore_case, Range(greek.first, cyrillic.LAST, flag).test(cyrillic.first), 28);\n assertEquals(ignore_case, Range(greek.first, cyrillic.LAST, flag).test(cyrillic.middle), 29);\n assertEquals(ignore_case, Range(greek.first, cyrillic.LAST, flag).test(cyrillic.last), 30);\n}\n\n\n// Sigma is special because there are two lower case versions of the same upper\n// case character. JS requires that case independence means that you should\n// convert everything to upper case, so the two sigma variants are equal to each\n// other in a case independt comparison.\nfor (var i = 0; i < 2; i++) {\n var simple = (i != 0);\n var name = simple ? \"\" : \"[]\";\n var regex = simple ? SIGMA : \"[\" + SIGMA + \"]\";\n\n assertFalse(new RegExp(regex).test(sigma), 31 + name);\n assertFalse(new RegExp(regex).test(alternative_sigma), 32 + name);\n assertTrue(new RegExp(regex).test(SIGMA), 33 + name);\n\n assertTrue(new RegExp(regex, \"i\").test(sigma), 34 + name);\n // JSC and Tracemonkey fail this one.\n assertTrue(new RegExp(regex, \"i\").test(alternative_sigma), 35 + name);\n assertTrue(new RegExp(regex, \"i\").test(SIGMA), 36 + name);\n\n regex = simple ? sigma : \"[\" + sigma + \"]\";\n\n assertTrue(new RegExp(regex).test(sigma), 41 + name);\n assertFalse(new RegExp(regex).test(alternative_sigma), 42 + name);\n assertFalse(new RegExp(regex).test(SIGMA), 43 + name);\n\n assertTrue(new RegExp(regex, \"i\").test(sigma), 44 + name);\n // JSC and Tracemonkey fail this one.\n assertTrue(new RegExp(regex, \"i\").test(alternative_sigma), 45 + name);\n assertTrue(new RegExp(regex, \"i\").test(SIGMA), 46 + name);\n\n regex = simple ? alternative_sigma : \"[\" + alternative_sigma + \"]\";\n\n assertFalse(new RegExp(regex).test(sigma), 51 + name);\n assertTrue(new RegExp(regex).test(alternative_sigma), 52 + name);\n assertFalse(new RegExp(regex).test(SIGMA), 53 + name);\n\n // JSC and Tracemonkey fail this one.\n assertTrue(new RegExp(regex, \"i\").test(sigma), 54 + name);\n assertTrue(new RegExp(regex, \"i\").test(alternative_sigma), 55 + name);\n // JSC and Tracemonkey fail this one.\n assertTrue(new RegExp(regex, \"i\").test(SIGMA), 56 + name);\n}\n\n\nfor (var add_non_ascii_character_to_subject = 0;\n add_non_ascii_character_to_subject < 2;\n add_non_ascii_character_to_subject++) {\n var suffix = add_non_ascii_character_to_subject ? \"\\ufffe\" : \"\";\n // A range that covers both ASCII and non-ASCII.\n for (var i = 0; i < 2; i++) {\n var full = (i != 0);\n var mixed = full ? \"[a-\\uffff]\" : \"[a-\" + cyrillic.LAST + \"]\";\n var f = full ? \"f\" : \"c\";\n for (var j = 0; j < 2; j++) {\n var ignore_case = (j == 0);\n var flag = ignore_case ? \"i\" : \"\";\n var re = new RegExp(mixed, flag);\n var expected =\n ignore_case || (full && !!add_non_ascii_character_to_subject);\n assertEquals(expected, re.test(\"A\" + suffix), 58 + flag + f);\n assertTrue(re.test(\"a\" + suffix), 59 + flag + f);\n assertTrue(re.test(\"~\" + suffix), 60 + flag + f);\n assertTrue(re.test(cyrillic.MIDDLE), 61 + flag + f);\n assertEquals(ignore_case || full, re.test(cyrillic.middle), 62 + flag + f);\n }\n }\n}\n"} {"text": "# This file is dual licensed under the terms of the Apache License, Version\n# 2.0, and the BSD License. See the LICENSE file in the root of this repository\n# for complete details.\n\nfrom __future__ import absolute_import, division, print_function\n\n\nfrom cryptography import utils\nfrom cryptography.exceptions import (\n AlreadyFinalized, UnsupportedAlgorithm, _Reasons\n)\n\n\nclass Poly1305(object):\n def __init__(self, key):\n from cryptography.hazmat.backends.openssl.backend import backend\n if not backend.poly1305_supported():\n raise UnsupportedAlgorithm(\n \"poly1305 is not supported by this version of OpenSSL.\",\n _Reasons.UNSUPPORTED_MAC\n )\n self._ctx = backend.create_poly1305_ctx(key)\n\n def update(self, data):\n if self._ctx is None:\n raise AlreadyFinalized(\"Context was already finalized.\")\n utils._check_byteslike(\"data\", data)\n self._ctx.update(data)\n\n def finalize(self):\n if self._ctx is None:\n raise AlreadyFinalized(\"Context was already finalized.\")\n mac = self._ctx.finalize()\n self._ctx = None\n return mac\n\n def verify(self, tag):\n utils._check_bytes(\"tag\", tag)\n if self._ctx is None:\n raise AlreadyFinalized(\"Context was already finalized.\")\n\n ctx, self._ctx = self._ctx, None\n ctx.verify(tag)\n\n @classmethod\n def generate_tag(cls, key, data):\n p = Poly1305(key)\n p.update(data)\n return p.finalize()\n\n @classmethod\n def verify_tag(cls, key, data, tag):\n p = Poly1305(key)\n p.update(data)\n p.verify(tag)\n"} {"text": "#! /usr/bin/env perl\n##**************************************************************\n##\n## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,\n## University of Wisconsin-Madison, WI.\n## \n## Licensed under the Apache License, Version 2.0 (the \"License\"); you\n## may not use this file except in compliance with the License. You may\n## 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 test check availability and usage contol of the new\n## local, resources in both a static configuration and in psolts.\n## It is model after what we did to test concurrency limits\n## as we are checking the same sorts of things. bt\n##\n##**************************************************************\n\nuse CondorTest;\nuse CondorUtils;\nuse Check::SimpleJob;\nuse Check::CondorLog;\n\n\nmy $ClusterId = 0;\nmy $expect_return = 0;\n\nmy $firstappend_condor_config = '\n\tDAEMON_LIST = MASTER,SCHEDD,COLLECTOR,NEGOTIATOR,STARTD\n\tWANT_SUSPEND = FALSE\n\tKILLING_TIMEOUT = 1\n\tMachineMaxVacateTime = 5\n\tNEGOTIATION_INTERVAL = 10\n\tKILL = FALSE\n\tSTART = TRUE\n\tTOOL_DEBUG = D_FULLDEBUG\n\tALL_DEBUG = D_ALWAYS\n\tNUM_CPUS = 4\n\tSTARTD_SLOT_ATTRS = activity,state,memory\n\tSLOT_TYPE_1 = cpus=25%,mem=500\n\tSLOT_TYPE_1_PARTITIONABLE = FALSE\n\tNUM_SLOTS_TYPE_1 = 1\n\tSLOT_TYPE_2 = cpus=25%,mem=200\n\tSLOT_TYPE_2_PARTITIONABLE = FALSE\n\tNUM_SLOTS_TYPE_2 = 1\n\tSLOT_TYPE_3 = cpus=25%,mem=700\n\tSLOT_TYPE_3_PARTITIONABLE = FALSE\n\tNUM_SLOTS_TYPE_3 = 1\n\tSLOT_TYPE_4 = cpus=25%,mem=300\n\tSLOT_TYPE_4_PARTITIONABLE = FALSE\n\tNUM_SLOTS_TYPE_4 = 1\n';\n\nmy %memoryhash = (\n\tslot1 => 500,\n\tslot2 => 200,\n\tslot3 => 700,\n\tslot4 => 300,\n);\n\n\nmy $testname = \"basic_startd_slot_attrs\";\n\n$configfile = CondorTest::CreateLocalConfig($firstappend_condor_config,\"startdslotattrs\");\n\nCondorTest::StartCondorWithParams(\n\tcondor_name => \"startdslotattrs\",\n\tfresh_local => \"TRUE\",\n\tcondorlocalsrc => \"$configfile\",\n);\n\nmy $on_abort = sub {\n\tCondorTest::debug(\"Abort from removing trap signal job.\\n\",1);\n};\n\nmy %startdslotattrs = ();\nmy $return = \"\";\nmy $executecount = 0;\nmy $namelist = \"\";\nmy $result = 1;\nmy $on_execute = sub {\n\tprint \"********************************** OnExecute *****************************\\n\";\n\t$namelist = GetSlotNames(4);\n\tprint \"SlotNames:<$namelist>\\n\";\n\tGetStartdSlotAttrs($namelist);\n\tsystem(\"condor_rm $ClusterId\");\n};\n\nmy $on_evictedwithoutcheckpoint = sub {\n\tprint \"Evicted Without Checkpoint\\n\";\n};\n\nmy $GetClusterId = sub {\n\tmy $cid = shift;\n\t$ClusterId = $cid;\n\tprint \"Resquestd Cluster Got $ClusterId\\n\";\n\t##########################\n\t#\n\t# Convoluted: This function is paased to RunCheck which uses it in RunTest in the fourth\n\t# position which is always an undefined variable EXCEPT when it is a call back routine \n\t# to pass out the cluster Id.\n\t#\n\t##########################\n\t#runcmd(\"condor_q\",{emit_output => 1});\n};\n\n#Do a job before setting tesing exit codes\nprint \"First test basic job\\n\";\n$result = SimpleJob::RunCheck(); # jobid 1\n\n$expect_return = 0;\n$result = SimpleJob::RunCheck(\n\ttest_name => \"$testname\",\n\ton_abort => $on_abort,\n\ton_evictedwithoutcheckpoint => $on_evictedwithoutcheckpoint,\n\ton_execute => $on_execute,\n\ttimeout => 120,\n\tqueue_sz => 1,\n\tduration => $expect_return,\n\tGetClusterId => $GetClusterId,\n);\nprint \"******************** Test for startd slot attrs/publishing\\n\";\nif($result == 1) {\n\tprint \"ok\\n\\n\\n\";\n} else {\n\tprint \"bad\\n\\n\\n\";\n}\n\nCondorTest::EndTest();\n\nsub GetSlotNames\n{\n\tmy $target = shift;\n\tmy $line = \"\";\n\tmy $names = \"\";\n\tmy $count = 0;\n\n\tmy @name = ();\n\trunCondorTool(\"condor_status -af name\",\\@name,2,{emit_output=>0});\n\tforeach my $try (@name) {\n\t\tCondorUtils::fullchomp($try);\n\t\tif($count == 0) {\n\t\t\t$names = $try;\n\t\t} else {\n\t\t\t$names = $names . \",$try\"\n\t\t}\n\t\t$count += 1;\n\t\t#print \"$names\\n\";\n\t\tif($count == $target) {\n\t\t\tlast;\n\t\t}\n\t}\n\treturn($names);\n}\n\n# stash expected atrributs into hash and expect the counts of all\n# to match count of slots passed %stardslotattrs\n\nsub GetStartdSlotAttrs\n{\n\tmy $names = shift;\n\tmy @namearray = split /,/, $names;\n\tmy $namecount = @namearray;\n\tmy @fullslot1 = ();\n\tmy $cmdstatus = 1;\n\tmy $simpleslot = \"\";\n\n\tforeach my $slot (@namearray) {\n\t\t# extract simple slot name for access to memory hash\n\t\tif($slot =~ /^(slot\\d).*$/) {\n\t\t\tprint \"looking at $1 information\\n\";\n\t\t\t$simpleslot = $1;\n\t\t} else {\n\t\t\tdie \"Something horribly wrong. Could not extract simple slot name\\n\";\n\t\t}\n\t\t# get slot memmory from condor_status\n\t\t$cmdstatus = runCondorTool(\"condor_status $slot -af memory \",\\@fullslot1,2,{emit_output=>0});\n\t\tif(!$cmdstatus) {\n\t\t\tprint \"This:condor_status $slot -af memory : should not have failed\\n\";\n\t\t}\n\t\t# there is but one line for memory\n\t\tmy $mem = \"\";\n\t\tCondorUtils::fullchomp($fullslot1[0]);\n\t\t$mem = $fullslot1[0];\n\t\tif($mem == $memoryhash{$simpleslot}) {\n\t\t\tprint \"condor status for $simpleslot reporting config requested memory\\n\";\n\t\t\tCondorTest::RegisterResult(1,test_name,$testname);\n\t\t} else {\n\t\t\tprint \"condor status for $simpleslot NOT reporting config requested memory\\n\";\n\t\t\tprint \"Configured:$memoryhash{$simpleslot} Reported:$mem\\n\";\n\t\t\tCondorTest::RegisterResult(0,test_name,$testname);\n\t\t}\n\n\t\tmy @results = ();\n\t\t# TODO: This used to have \"-debug\" and it would be nifty if it did again. However\n\t\t# the IPv4/6 mixed-mode work seems to break that case. NEEDS TO BE INVESTIGATED.\n\t\t$cmdstatus = runCondorTool(\"condor_status -l $slot \",\\@results, 2,{emit_output=>0});\n\t\t\tif(!$cmdstatus) {\n\t\t\t\tprint \"This:condor_status -l $slot should not have failed\\n\";\n\t\t\t}\n\t\tmy $statusres = @results;\n\t\t#print \"condor_status for slot <$slot> returned <$statusres> lines\\n\";\n\t\tforeach my $item (@results) {\n\t\t\tCondorUtils::fullchomp($item);\n\t\t\t#print \"$slot: $item\\n\";\n\t\t\tif($item =~ /(slot\\d_memory)\\s*=\\s*(\\d+).*/) {\n\t\t\t\t#ensure reported slot memory matches configured memory\n\t\t\t\tmy $memory = $2;\n\t\t\t\tmy $attr = $1;\n\t\t\t\t# dig out simple slot for hash comparison\n\t\t\t\tmy $sslot = \"\";\n\t\t\t\tif($attr =~ /(slot\\d)/) { # does by definition\n\t\t\t\t\t$sslot = $1;\n\t\t\t\t\tif($memory == $memoryhash{$sslot}) {\n\t\t\t\t\t\tprint \"$attr memory being advertised correctly to $slot\\n\";\n\t\t\t\t\t\tCondorTest::RegisterResult(1,test_name,$testname);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprint \"$attr memory NOT being advertised correctly to $slot\\n\";\n\t\t\t\t\t\tprint \"Configured:$memoryhash{$simpleslot} Reported:$memory\\n\";\n\t\t\t\t\t\tCondorTest::RegisterResult(0,test_name,$testname);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#print \"*************** $attr *********************\\n\";\n\t\t\t\tif(exists $stardslotattrs{$attr}) {\n\t\t\t\t\t$stardslotattrs{$attr} += 1;\n\t\t\t\t} else {\n\t\t\t\t\t$stardslotattrs{$attr} = 1;\n\t\t\t\t}\n\t\t\t} elsif($item =~ /(slot\\d_state)\\s.*/) {\n\t\t\t\t#print \"*************** $1 *********************\\n\";\n\t\t\t\tif(exists $stardslotattrs{$1}) {\n\t\t\t\t\t$stardslotattrs{$1} += 1;\n\t\t\t\t} else {\n\t\t\t\t\t$stardslotattrs{$1} = 1;\n\t\t\t\t}\n\t\t\t} elsif($item =~ /(slot\\d_activity)\\s.*/) {\n\t\t\t\t#print \"*************** $1 *********************\\n\";\n\t\t\t\tif(exists $stardslotattrs{$1}) {\n\t\t\t\t\t$stardslotattrs{$1} += 1;\n\t\t\t\t} else {\n\t\t\t\t\t$stardslotattrs{$1} = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\tforeach my $key(sort keys %stardslotattrs) {\n\t\tif($stardslotattrs{$key} != $namecount) {\n\t\t\tdie \"Ad<$key> has $stardslotattrs{$key} and should be $namecount\\n\";\n\t\t}\n\t}\n\tprint \"Slot attributes equally advertised across all slots\\n\";\n\tCondorTest::RegisterResult(1,test_name,$testname);\n}\n"} {"text": "{\n \"title\":\"Ruby annotation\",\n \"description\":\"Method of adding pronunciation or other annotations using ruby elements (primarily used in East Asian typography).\",\n \"spec\":\"https://html.spec.whatwg.org/multipage/semantics.html#the-ruby-element\",\n \"status\":\"ls\",\n \"links\":[\n {\n \"url\":\"http://html5doctor.com/ruby-rt-rp-element/\",\n \"title\":\"HTML5 Doctor article\"\n },\n {\n \"url\":\"http://docs.webplatform.org/wiki/html/elements/ruby\",\n \"title\":\"WebPlatform Docs\"\n },\n {\n \"url\":\"https://addons.mozilla.org/firefox/addon/1935/\",\n \"title\":\"Add-on \\\"XHTML Ruby Support\\\" for Firefox\"\n },\n {\n \"url\":\"https://addons.mozilla.org/firefox/addon/6812/\",\n \"title\":\"Addon \\\"HTML Ruby\\\" for Firefox support\"\n },\n {\n \"url\":\"http://www.w3.org/TR/css-ruby-1/\",\n \"title\":\"CSS specification\"\n }\n ],\n \"bugs\":[\n {\n \"description\":\"IE and Firefox do not appear to have support for nested ruby structures [see testcase](http://jsfiddle.net/tabletguy/49412u7r/)\"\n }\n ],\n \"categories\":[\n \"HTML5\"\n ],\n \"stats\":{\n \"ie\":{\n \"5.5\":\"a\",\n \"6\":\"a\",\n \"7\":\"a\",\n \"8\":\"a\",\n \"9\":\"a\",\n \"10\":\"a\",\n \"11\":\"a\"\n },\n \"edge\":{\n \"12\":\"a\",\n \"13\":\"a\",\n \"14\":\"a\",\n \"15\":\"a\"\n },\n \"firefox\":{\n \"2\":\"p\",\n \"3\":\"p\",\n \"3.5\":\"p\",\n \"3.6\":\"p\",\n \"4\":\"p\",\n \"5\":\"p\",\n \"6\":\"p\",\n \"7\":\"p\",\n \"8\":\"p\",\n \"9\":\"p\",\n \"10\":\"p\",\n \"11\":\"p\",\n \"12\":\"p\",\n \"13\":\"p\",\n \"14\":\"p\",\n \"15\":\"p\",\n \"16\":\"p\",\n \"17\":\"p\",\n \"18\":\"p\",\n \"19\":\"p\",\n \"20\":\"p\",\n \"21\":\"p\",\n \"22\":\"p\",\n \"23\":\"p\",\n \"24\":\"p\",\n \"25\":\"p\",\n \"26\":\"p\",\n \"27\":\"p\",\n \"28\":\"p\",\n \"29\":\"p\",\n \"30\":\"p\",\n \"31\":\"p\",\n \"32\":\"p\",\n \"33\":\"p\",\n \"34\":\"p\",\n \"35\":\"p\",\n \"36\":\"p\",\n \"37\":\"p\",\n \"38\":\"y\",\n \"39\":\"y\",\n \"40\":\"y\",\n \"41\":\"y\",\n \"42\":\"y\",\n \"43\":\"y\",\n \"44\":\"y\",\n \"45\":\"y\",\n \"46\":\"y\",\n \"47\":\"y\",\n \"48\":\"y\",\n \"49\":\"y\",\n \"50\":\"y\",\n \"51\":\"y\",\n \"52\":\"y\",\n \"53\":\"y\"\n },\n \"chrome\":{\n \"4\":\"p\",\n \"5\":\"a\",\n \"6\":\"a\",\n \"7\":\"a\",\n \"8\":\"a\",\n \"9\":\"a\",\n \"10\":\"a\",\n \"11\":\"a\",\n \"12\":\"a\",\n \"13\":\"a\",\n \"14\":\"a\",\n \"15\":\"a\",\n \"16\":\"a\",\n \"17\":\"a\",\n \"18\":\"a\",\n \"19\":\"a\",\n \"20\":\"a\",\n \"21\":\"a\",\n \"22\":\"a\",\n \"23\":\"a\",\n \"24\":\"a\",\n \"25\":\"a\",\n \"26\":\"a\",\n \"27\":\"a\",\n \"28\":\"a\",\n \"29\":\"a\",\n \"30\":\"a\",\n \"31\":\"a\",\n \"32\":\"a\",\n \"33\":\"a\",\n \"34\":\"a\",\n \"35\":\"a\",\n \"36\":\"a\",\n \"37\":\"a\",\n \"38\":\"a\",\n \"39\":\"a\",\n \"40\":\"a\",\n \"41\":\"a\",\n \"42\":\"a\",\n \"43\":\"a\",\n \"44\":\"a\",\n \"45\":\"a\",\n \"46\":\"a\",\n \"47\":\"a\",\n \"48\":\"a\",\n \"49\":\"a\",\n \"50\":\"a\",\n \"51\":\"a\",\n \"52\":\"a\",\n \"53\":\"a\",\n \"54\":\"a\",\n \"55\":\"a\",\n \"56\":\"a\",\n \"57\":\"a\",\n \"58\":\"a\"\n },\n \"safari\":{\n \"3.1\":\"p\",\n \"3.2\":\"p\",\n \"4\":\"p\",\n \"5\":\"a\",\n \"5.1\":\"a\",\n \"6\":\"a\",\n \"6.1\":\"a\",\n \"7\":\"a\",\n \"7.1\":\"a\",\n \"8\":\"a\",\n \"9\":\"a\",\n \"9.1\":\"a\",\n \"10\":\"a\",\n \"TP\":\"a\"\n },\n \"opera\":{\n \"9\":\"p\",\n \"9.5-9.6\":\"p\",\n \"10.0-10.1\":\"p\",\n \"10.5\":\"p\",\n \"10.6\":\"p\",\n \"11\":\"p\",\n \"11.1\":\"p\",\n \"11.5\":\"p\",\n \"11.6\":\"p\",\n \"12\":\"p\",\n \"12.1\":\"p\",\n \"15\":\"a\",\n \"16\":\"a\",\n \"17\":\"a\",\n \"18\":\"a\",\n \"19\":\"a\",\n \"20\":\"a\",\n \"21\":\"a\",\n \"22\":\"a\",\n \"23\":\"a\",\n \"24\":\"a\",\n \"25\":\"a\",\n \"26\":\"a\",\n \"27\":\"a\",\n \"28\":\"a\",\n \"29\":\"a\",\n \"30\":\"a\",\n \"31\":\"a\",\n \"32\":\"a\",\n \"33\":\"a\",\n \"34\":\"a\",\n \"35\":\"a\",\n \"36\":\"a\",\n \"37\":\"a\",\n \"38\":\"a\",\n \"39\":\"a\",\n \"40\":\"a\",\n \"41\":\"a\",\n \"42\":\"a\",\n \"43\":\"a\",\n \"44\":\"a\"\n },\n \"ios_saf\":{\n \"3.2\":\"p\",\n \"4.0-4.1\":\"p\",\n \"4.2-4.3\":\"p\",\n \"5.0-5.1\":\"a\",\n \"6.0-6.1\":\"a\",\n \"7.0-7.1\":\"a\",\n \"8\":\"a\",\n \"8.1-8.4\":\"a\",\n \"9.0-9.2\":\"a\",\n \"9.3\":\"a\",\n \"10-10.1\":\"a\"\n },\n \"op_mini\":{\n \"all\":\"p\"\n },\n \"android\":{\n \"2.1\":\"p\",\n \"2.2\":\"p\",\n \"2.3\":\"p\",\n \"3\":\"a\",\n \"4\":\"a\",\n \"4.1\":\"a\",\n \"4.2-4.3\":\"a\",\n \"4.4\":\"a\",\n \"4.4.3-4.4.4\":\"a\",\n \"53\":\"a\"\n },\n \"bb\":{\n \"7\":\"p\",\n \"10\":\"a\"\n },\n \"op_mob\":{\n \"10\":\"p\",\n \"11\":\"p\",\n \"11.1\":\"p\",\n \"11.5\":\"p\",\n \"12\":\"p\",\n \"12.1\":\"p\",\n \"37\":\"a\"\n },\n \"and_chr\":{\n \"55\":\"a\"\n },\n \"and_ff\":{\n \"50\":\"y\"\n },\n \"ie_mob\":{\n \"10\":\"a\",\n \"11\":\"a\"\n },\n \"and_uc\":{\n \"11\":\"a\"\n },\n \"samsung\":{\n \"4\":\"a\"\n }\n },\n \"notes\":\"Browsers without native support can still simulate support using CSS. Partial support refers to only supporting basic ruby, may still be missing writing-mode, Complex ruby and CSS3 Ruby.\",\n \"notes_by_num\":{\n \"1\":\"IE9+ supports [properties](https://msdn.microsoft.com/en-us/library/hh772055%28v=vs.85%29.aspx) of an older version of the CSS Ruby specification.\"\n },\n \"usage_perc_y\":6.21,\n \"usage_perc_a\":86.88,\n \"ucprefix\":false,\n \"parent\":\"\",\n \"keywords\":\"ruby-base,ruby-text,ruby-position,ruby-merge,ruby-align\",\n \"ie_id\":\"\",\n \"chrome_id\":\"\",\n \"firefox_id\":\"\",\n \"webkit_id\":\"\",\n \"shown\":true\n}\n"} {"text": "// Copyright 2012 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#if V8_TARGET_ARCH_X64\n\n#include \"src/codegen/interface-descriptors.h\"\n\n#include \"src/execution/frames.h\"\n\nnamespace v8 {\nnamespace internal {\n\nconst Register CallInterfaceDescriptor::ContextRegister() { return rsi; }\n\nvoid CallInterfaceDescriptor::DefaultInitializePlatformSpecific(\n CallInterfaceDescriptorData* data, int register_parameter_count) {\n const Register default_stub_registers[] = {rax, rbx, rcx, rdx, rdi};\n CHECK_LE(static_cast(register_parameter_count),\n arraysize(default_stub_registers));\n data->InitializePlatformSpecific(register_parameter_count,\n default_stub_registers);\n}\n\nvoid RecordWriteDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n const Register default_stub_registers[] = {arg_reg_1, arg_reg_2, arg_reg_3,\n arg_reg_4, kReturnRegister0};\n\n data->RestrictAllocatableRegisters(default_stub_registers,\n arraysize(default_stub_registers));\n\n CHECK_LE(static_cast(kParameterCount),\n arraysize(default_stub_registers));\n data->InitializePlatformSpecific(kParameterCount, default_stub_registers);\n}\n\nvoid EphemeronKeyBarrierDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n const Register default_stub_registers[] = {arg_reg_1, arg_reg_2, arg_reg_3,\n arg_reg_4, kReturnRegister0};\n\n data->RestrictAllocatableRegisters(default_stub_registers,\n arraysize(default_stub_registers));\n\n CHECK_LE(static_cast(kParameterCount),\n arraysize(default_stub_registers));\n data->InitializePlatformSpecific(kParameterCount, default_stub_registers);\n}\n\nconst Register FastNewFunctionContextDescriptor::ScopeInfoRegister() {\n return rdi;\n}\nconst Register FastNewFunctionContextDescriptor::SlotsRegister() { return rax; }\n\nconst Register LoadDescriptor::ReceiverRegister() { return rdx; }\nconst Register LoadDescriptor::NameRegister() { return rcx; }\nconst Register LoadDescriptor::SlotRegister() { return rax; }\n\nconst Register LoadWithVectorDescriptor::VectorRegister() { return rbx; }\n\nconst Register StoreDescriptor::ReceiverRegister() { return rdx; }\nconst Register StoreDescriptor::NameRegister() { return rcx; }\nconst Register StoreDescriptor::ValueRegister() { return rax; }\nconst Register StoreDescriptor::SlotRegister() { return rdi; }\n\nconst Register StoreWithVectorDescriptor::VectorRegister() { return rbx; }\n\nconst Register StoreTransitionDescriptor::SlotRegister() { return rdi; }\nconst Register StoreTransitionDescriptor::VectorRegister() { return rbx; }\nconst Register StoreTransitionDescriptor::MapRegister() { return r11; }\n\nconst Register ApiGetterDescriptor::HolderRegister() { return rcx; }\nconst Register ApiGetterDescriptor::CallbackRegister() { return rbx; }\n\nconst Register GrowArrayElementsDescriptor::ObjectRegister() { return rax; }\nconst Register GrowArrayElementsDescriptor::KeyRegister() { return rbx; }\n\nvoid TypeofDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n Register registers[] = {rbx};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\n// static\nconst Register TypeConversionDescriptor::ArgumentRegister() { return rax; }\n\nvoid CallTrampolineDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n // rax : number of arguments\n // rdi : the target to call\n Register registers[] = {rdi, rax};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid CallVarargsDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n // rax : number of arguments (on the stack, not including receiver)\n // rdi : the target to call\n // rcx : arguments list length (untagged)\n // rbx : arguments list (FixedArray)\n Register registers[] = {rdi, rax, rcx, rbx};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid CallForwardVarargsDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n // rax : number of arguments\n // rcx : start index (to support rest parameters)\n // rdi : the target to call\n Register registers[] = {rdi, rax, rcx};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid CallFunctionTemplateDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n // rdx: the function template info\n // rcx: number of arguments (on the stack, not including receiver)\n Register registers[] = {rdx, rcx};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid CallWithSpreadDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n // rax : number of arguments (on the stack, not including receiver)\n // rdi : the target to call\n // rbx : the object to spread\n Register registers[] = {rdi, rax, rbx};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid CallWithArrayLikeDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n // rdi : the target to call\n // rbx : the arguments list\n Register registers[] = {rdi, rbx};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid ConstructVarargsDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n // rax : number of arguments (on the stack, not including receiver)\n // rdi : the target to call\n // rdx : the new target\n // rcx : arguments list length (untagged)\n // rbx : arguments list (FixedArray)\n Register registers[] = {rdi, rdx, rax, rcx, rbx};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid ConstructForwardVarargsDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n // rax : number of arguments\n // rdx : the new target\n // rcx : start index (to support rest parameters)\n // rdi : the target to call\n Register registers[] = {rdi, rdx, rax, rcx};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid ConstructWithSpreadDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n // rax : number of arguments (on the stack, not including receiver)\n // rdi : the target to call\n // rdx : the new target\n // rbx : the object to spread\n Register registers[] = {rdi, rdx, rax, rbx};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid ConstructWithArrayLikeDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n // rdi : the target to call\n // rdx : the new target\n // rbx : the arguments list\n Register registers[] = {rdi, rdx, rbx};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid ConstructStubDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n // rax : number of arguments\n // rdx : the new target\n // rdi : the target to call\n // rbx : allocation site or undefined\n Register registers[] = {rdi, rdx, rax, rbx};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid AbortDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n Register registers[] = {rdx};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid AllocateHeapNumberDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n data->InitializePlatformSpecific(0, nullptr);\n}\n\nvoid CompareDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n Register registers[] = {rdx, rax};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid BinaryOpDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n Register registers[] = {rdx, rax};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid ArgumentsAdaptorDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n Register registers[] = {\n rdi, // JSFunction\n rdx, // the new target\n rax, // actual number of arguments\n rbx, // expected number of arguments\n };\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid ApiCallbackDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n Register registers[] = {\n rdx, // api function address\n rcx, // argument count (not including receiver)\n rbx, // call data\n rdi, // holder\n };\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid InterpreterDispatchDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n Register registers[] = {\n kInterpreterAccumulatorRegister, kInterpreterBytecodeOffsetRegister,\n kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid InterpreterPushArgsThenCallDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n Register registers[] = {\n rax, // argument count (not including receiver)\n rbx, // address of first argument\n rdi // the target callable to be call\n };\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid InterpreterPushArgsThenConstructDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n Register registers[] = {\n rax, // argument count (not including receiver)\n rcx, // address of first argument\n rdi, // constructor to call\n rdx, // new target\n rbx, // allocation site feedback if available, undefined otherwise\n };\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid ResumeGeneratorDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n Register registers[] = {\n rax, // the value to pass to the generator\n rdx // the JSGeneratorObject / JSAsyncGeneratorObject to resume\n };\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid FrameDropperTrampolineDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n Register registers[] = {\n rbx, // loaded new FP\n };\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\nvoid RunMicrotasksEntryDescriptor::InitializePlatformSpecific(\n CallInterfaceDescriptorData* data) {\n Register registers[] = {arg_reg_1, arg_reg_2};\n data->InitializePlatformSpecific(arraysize(registers), registers);\n}\n\n} // namespace internal\n} // namespace v8\n\n#endif // V8_TARGET_ARCH_X64\n"} {"text": "#include \"rapidjson/writer.h\"\n#include \"rapidjson/stringbuffer.h\"\n#include \n\nusing namespace rapidjson;\nusing namespace std;\n\nint main() {\n StringBuffer s;\n Writer writer(s);\n \n writer.StartObject(); // Between StartObject()/EndObject(), \n writer.Key(\"hello\"); // output a key,\n writer.String(\"world\"); // follow by a value.\n writer.Key(\"t\");\n writer.Bool(true);\n writer.Key(\"f\");\n writer.Bool(false);\n writer.Key(\"n\");\n writer.Null();\n writer.Key(\"i\");\n writer.Uint(123);\n writer.Key(\"pi\");\n writer.Double(3.1416);\n writer.Key(\"a\");\n writer.StartArray(); // Between StartArray()/EndArray(),\n for (unsigned i = 0; i < 4; i++)\n writer.Uint(i); // all values are elements of the array.\n writer.EndArray();\n writer.EndObject();\n\n // {\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[0,1,2,3]}\n cout << s.GetString() << endl;\n\n return 0;\n}\n"} {"text": "// Copyright 2014 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#ifndef V8_SRC_ZONE_ZONE_CONTAINERS_H_\n#define V8_SRC_ZONE_ZONE_CONTAINERS_H_\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \"src/zone/zone-allocator.h\"\n\nnamespace v8 {\nnamespace internal {\n\n// A wrapper subclass for std::vector to make it easy to construct one\n// that uses a zone allocator.\ntemplate \nclass ZoneVector : public std::vector> {\n public:\n // Constructs an empty vector.\n explicit ZoneVector(Zone* zone)\n : std::vector>(ZoneAllocator(zone)) {}\n\n // Constructs a new vector and fills it with {size} elements, each\n // constructed via the default constructor.\n ZoneVector(size_t size, Zone* zone)\n : std::vector>(size, T(), ZoneAllocator(zone)) {}\n\n // Constructs a new vector and fills it with {size} elements, each\n // having the value {def}.\n ZoneVector(size_t size, T def, Zone* zone)\n : std::vector>(size, def, ZoneAllocator(zone)) {}\n\n // Constructs a new vector and fills it with the contents of the range\n // [first, last).\n template \n ZoneVector(InputIt first, InputIt last, Zone* zone)\n : std::vector>(first, last, ZoneAllocator(zone)) {}\n};\n\n// A wrapper subclass std::deque to make it easy to construct one\n// that uses a zone allocator.\ntemplate \nclass ZoneDeque : public std::deque> {\n public:\n // Constructs an empty deque.\n explicit ZoneDeque(Zone* zone)\n : std::deque>(\n RecyclingZoneAllocator(zone)) {}\n};\n\n// A wrapper subclass std::list to make it easy to construct one\n// that uses a zone allocator.\n// TODO(mstarzinger): This should be renamed to ZoneList once we got rid of our\n// own home-grown ZoneList that actually is a ZoneVector.\ntemplate \nclass ZoneLinkedList : public std::list> {\n public:\n // Constructs an empty list.\n explicit ZoneLinkedList(Zone* zone)\n : std::list>(ZoneAllocator(zone)) {}\n};\n\n// A wrapper subclass std::priority_queue to make it easy to construct one\n// that uses a zone allocator.\ntemplate >\nclass ZonePriorityQueue\n : public std::priority_queue, Compare> {\n public:\n // Constructs an empty list.\n explicit ZonePriorityQueue(Zone* zone)\n : std::priority_queue, Compare>(Compare(),\n ZoneVector(zone)) {}\n};\n\n// A wrapper subclass for std::queue to make it easy to construct one\n// that uses a zone allocator.\ntemplate \nclass ZoneQueue : public std::queue> {\n public:\n // Constructs an empty queue.\n explicit ZoneQueue(Zone* zone)\n : std::queue>(ZoneDeque(zone)) {}\n};\n\n// A wrapper subclass for std::stack to make it easy to construct one that uses\n// a zone allocator.\ntemplate \nclass ZoneStack : public std::stack> {\n public:\n // Constructs an empty stack.\n explicit ZoneStack(Zone* zone)\n : std::stack>(ZoneDeque(zone)) {}\n};\n\n// A wrapper subclass for std::set to make it easy to construct one that uses\n// a zone allocator.\ntemplate >\nclass ZoneSet : public std::set> {\n public:\n // Constructs an empty set.\n explicit ZoneSet(Zone* zone)\n : std::set>(Compare(),\n ZoneAllocator(zone)) {}\n};\n\n// A wrapper subclass for std::map to make it easy to construct one that uses\n// a zone allocator.\ntemplate >\nclass ZoneMap\n : public std::map>> {\n public:\n // Constructs an empty map.\n explicit ZoneMap(Zone* zone)\n : std::map>>(\n Compare(), ZoneAllocator>(zone)) {}\n};\n\n// A wrapper subclass for std::multimap to make it easy to construct one that\n// uses a zone allocator.\ntemplate >\nclass ZoneMultimap\n : public std::multimap>> {\n public:\n // Constructs an empty multimap.\n explicit ZoneMultimap(Zone* zone)\n : std::multimap>>(\n Compare(), ZoneAllocator>(zone)) {}\n};\n\n// Typedefs to shorten commonly used vectors.\ntypedef ZoneVector BoolVector;\ntypedef ZoneVector IntVector;\n\n} // namespace internal\n} // namespace v8\n\n#endif // V8_SRC_ZONE_ZONE_CONTAINERS_H_\n"} {"text": "using System;\nusing System.IO;\nusing System.Security.Principal;\nusing Trinet.Core.IO.Ntfs;\n\nnamespace HidWizards.UCR.Utilities\n{\n public static class FileUnblockManager\n {\n\n public static bool IsAdmin()\n {\n return new WindowsPrincipal\n (WindowsIdentity.GetCurrent()).IsInRole\n (WindowsBuiltInRole.Administrator);\n }\n\n public static bool UnblockAllProgramFiles(string directory)\n {\n var success = true;\n foreach (var file in Directory.GetFiles(directory, \"*\", SearchOption.AllDirectories))\n {\n success &= UnblockFile(file);\n }\n\n return success;\n }\n\n private static bool UnblockFile(string path)\n {\n var file = new FileInfo(path);\n if (!file.AlternateDataStreamExists(\"Zone.Identifier\")) return true;\n \n return file.DeleteAlternateDataStream(\"Zone.Identifier\");\n }\n }\n}\n"} {"text": "/* Datepicker\n----------------------------------*/\n.ui-datepicker { width: 17em; padding: .2em .2em 0; }\n.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }\n.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }\n.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }\n.ui-datepicker .ui-datepicker-prev { left:2px; }\n.ui-datepicker .ui-datepicker-next { right:2px; }\n.ui-datepicker .ui-datepicker-prev-hover { left:1px; }\n.ui-datepicker .ui-datepicker-next-hover { right:1px; }\n.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }\n.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }\n.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; }\n.ui-datepicker select.ui-datepicker-month-year {width: 100%;}\n.ui-datepicker select.ui-datepicker-month, \n.ui-datepicker select.ui-datepicker-year { width: 49%;}\n.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; }\n.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }\n.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }\n.ui-datepicker td { border: 0; padding: 1px; }\n.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }\n.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }\n.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }\n.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }\n\n/* with multiple calendars */\n.ui-datepicker.ui-datepicker-multi { width:auto; }\n.ui-datepicker-multi .ui-datepicker-group { float:left; }\n.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }\n.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }\n.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }\n.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }\n.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }\n.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }\n.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }\n.ui-datepicker-row-break { clear:both; width:100%; }\n\n/* RTL support */\n.ui-datepicker-rtl { direction: rtl; }\n.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }\n.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }\n.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }\n.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }\n.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }\n.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }\n.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }\n.ui-datepicker-rtl .ui-datepicker-group { float:right; }\n.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }\n.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }\n\n/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */\n.ui-datepicker-cover {\n display: none; /*sorry for IE5*/\n display/**/: block; /*sorry for IE5*/\n position: absolute; /*must have*/\n z-index: -1; /*must have*/\n filter: mask(); /*must have*/\n top: -4px; /*must have*/\n left: -4px; /*must have*/\n width: 200px; /*must have*/\n height: 200px; /*must have*/\n}"} {"text": "# -*- coding:utf-8 -*- \r\n\r\n"} {"text": "import type { CovariantF, CovariantK } from \"../Covariant\"\nimport type { URIS } from \"../HKT\"\nimport type { IdentityBothF, IdentityBothK } from \"../IdentityBoth\"\n\nexport type ApplicativeF = IdentityBothF<\n F,\n TL0,\n TL1,\n TL2,\n TL3\n> &\n CovariantF\n\nexport type ApplicativeK<\n F extends URIS,\n TL0 = any,\n TL1 = any,\n TL2 = any,\n TL3 = any\n> = IdentityBothK & CovariantK\n"} {"text": "version: 1\nn_points: 4\n{\n120.960 112.646\n120.960 266.354\n290.040 266.354\n290.040 112.646\n}\n"} {"text": "org.hibernate.ogm.boot.impl.OgmSessionFactoryBuilderFactory\n"} {"text": "{% rendercontent \"docs/note\" title: \"Top Top: Adding Concurrently Processes\" %}\nWant to run even more background processes or change up your build tools? Take a look\nat the provided `sync.js` script and read up on the\n[Concurrently](https://github.com/kimmobrunfeldt/concurrently#readme) documentation to\nsee which options are available.\n{% endrendercontent %}\n"} {"text": "// +build !go1.7\n\npackage request\n\nimport \"github.com/aws/aws-sdk-go/aws\"\n\n// setContext updates the Request to use the passed in context for cancellation.\n// Context will also be used for request retry delay.\n//\n// Creates shallow copy of the http.Request with the WithContext method.\nfunc setRequestContext(r *Request, ctx aws.Context) {\n\tr.context = ctx\n\tr.HTTPRequest.Cancel = ctx.Done()\n}\n"} {"text": "// nonetwork, break standard network functions using LD_PRELOAD\n// Source: https://github.com/starius/nonetwork\n// Copyright (C) 2015 Boris Nagaev\n// License: MIT\n\n#include \n#include \n\nstatic void print_message() {\n fflush(stderr);\n fprintf(stderr, \"\\nDon't use network from MXE build rules!\\n\");\n fflush(stderr);\n}\n\nint connect(int sock, const void *addr, unsigned int len) {\n print_message();\n errno = 13; // EACCES, Permission denied\n return -1;\n}\n\nvoid *gethostbyname(const char *name) {\n print_message();\n return 0;\n}\n\nint getaddrinfo(const char *node, const char *service,\n const void *hints,\n void **res) {\n print_message();\n return -4; // EAI_FAIL\n}\n\nvoid freeaddrinfo(void *res) {\n print_message();\n}\n\nint getnameinfo(const void * sa,\n unsigned int salen, char * host,\n unsigned int hostlen, char * serv,\n unsigned int servlen, int flags) {\n print_message();\n return -4; // EAI_FAIL\n}\n\nstruct hostent *gethostbyaddr(const void *addr, unsigned int len,\n int type) {\n print_message();\n return 0;\n}\n"} {"text": "//------------------------------------------------------------\n// Game Framework\n// Copyright © 2013-2019 Jiang Yin. All rights reserved.\n// Homepage: http://gameframework.cn/\n// Feedback: mailto:jiangyin@gameframework.cn\n//------------------------------------------------------------\n\nusing System.IO;\n\nnamespace UnityGameFramework.Editor.DataTableTools\n{\n public sealed partial class DataTableProcessor\n {\n private sealed class SByteProcessor : GenericDataProcessor\n {\n public override bool IsSystem\n {\n get\n {\n return true;\n }\n }\n\n public override string LanguageKeyword\n {\n get\n {\n return \"sbyte\";\n }\n }\n\n public override string[] GetTypeStrings()\n {\n return new string[]\n {\n \"sbyte\",\n \"system.sbyte\"\n };\n }\n\n public override sbyte Parse(string value)\n {\n return sbyte.Parse(value);\n }\n\n public override void WriteToStream(BinaryWriter stream, string value)\n {\n stream.Write(Parse(value));\n }\n }\n }\n}\n"} {"text": "class Lancamento {\n constructor(nome = 'Genérico', valor = 0) {\n this.nome = nome\n this.valor = valor\n }\n}\n\nclass CicloFinanceiro {\n constructor(mes, ano) {\n this.mes = mes\n this.ano = ano\n this.lancamentos = []\n }\n\n addLancamentos(...lancamentos) {\n lancamentos.forEach(l => this.lancamentos.push(l))\n }\n\n sumario() {\n let valorConsolidado = 0\n this.lancamentos.forEach(l => {\n valorConsolidado += l.valor\n })\n return valorConsolidado\n }\n}\n\nconst salario = new Lancamento('Salario', 45000)\nconst contaDeLuz = new Lancamento('Luz', -220)\n\nconst contas = new CicloFinanceiro(6, 2018)\ncontas.addLancamentos(salario, contaDeLuz)\nconsole.log(contas.sumario())"} {"text": "/*\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; either version 2\n * of the License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * The Original Code is Copyright (C) 2008 Blender Foundation\n */\n\n/** \\file\n * \\ingroup edanimation\n */\n\n#include \n#include \n#include \n#include \n\n#include \"MEM_guardedalloc.h\"\n\n#include \"BLI_blenlib.h\"\n#include \"BLI_utildefines.h\"\n#include \"BLI_lasso_2d.h\"\n#include \"BLI_math.h\"\n\n#include \"DNA_anim_types.h\"\n#include \"DNA_object_types.h\"\n#include \"DNA_scene_types.h\"\n\n#include \"BKE_fcurve.h\"\n#include \"BKE_nla.h\"\n\n#include \"ED_anim_api.h\"\n#include \"ED_keyframes_edit.h\"\n#include \"ED_markers.h\"\n\n/* This file defines an API and set of callback-operators for\n * non-destructive editing of keyframe data.\n *\n * Two API functions are defined for actually performing the operations on the data:\n * ANIM_fcurve_keyframes_loop()\n * which take the data they operate on, a few callbacks defining what operations to perform.\n *\n * As operators which work on keyframes usually apply the same operation on all BezTriples in\n * every channel, the code has been optimized providing a set of functions which will get the\n * appropriate bezier-modify function to set. These functions (ANIM_editkeyframes_*) will need\n * to be called before getting any channels.\n *\n * A set of 'validation' callbacks are provided for checking if a BezTriple should be operated on.\n * These should only be used when using a 'general' BezTriple editor (i.e. selection setters which\n * don't check existing selection status).\n *\n * - Joshua Leung, Dec 2008\n */\n\n/* ************************************************************************** */\n/* Keyframe Editing Loops - Exposed API */\n\n/* --------------------------- Base Functions ------------------------------------ */\n\n/* This function is used to loop over BezTriples in the given F-Curve, applying a given\n * operation on them, and optionally applies an F-Curve validation function afterwards.\n */\n// TODO: make this function work on samples too...\nshort ANIM_fcurve_keyframes_loop(KeyframeEditData *ked,\n FCurve *fcu,\n KeyframeEditFunc key_ok,\n KeyframeEditFunc key_cb,\n FcuEditFunc fcu_cb)\n{\n BezTriple *bezt;\n short ok = 0;\n unsigned int i;\n\n /* sanity check */\n if (ELEM(NULL, fcu, fcu->bezt)) {\n return 0;\n }\n\n /* set the F-Curve into the editdata so that it can be accessed */\n if (ked) {\n ked->fcu = fcu;\n ked->curIndex = 0;\n ked->curflags = ok;\n }\n\n /* if function to apply to bezier curves is set, then loop through executing it on beztriples */\n if (key_cb) {\n /* if there's a validation func, include that check in the loop\n * (this is should be more efficient than checking for it in every loop)\n */\n if (key_ok) {\n for (bezt = fcu->bezt, i = 0; i < fcu->totvert; bezt++, i++) {\n if (ked) {\n /* advance the index, and reset the ok flags (to not influence the result) */\n ked->curIndex = i;\n ked->curflags = 0;\n }\n\n /* Only operate on this BezTriple if it fulfills the criteria of the validation func */\n if ((ok = key_ok(ked, bezt))) {\n if (ked) {\n ked->curflags = ok;\n }\n\n /* Exit with return-code '1' if function returns positive\n * This is useful if finding if some BezTriple satisfies a condition.\n */\n if (key_cb(ked, bezt)) {\n return 1;\n }\n }\n }\n }\n else {\n for (bezt = fcu->bezt, i = 0; i < fcu->totvert; bezt++, i++) {\n if (ked) {\n ked->curIndex = i;\n }\n\n /* Exit with return-code '1' if function returns positive\n * This is useful if finding if some BezTriple satisfies a condition.\n */\n if (key_cb(ked, bezt)) {\n return 1;\n }\n }\n }\n }\n\n /* unset the F-Curve from the editdata now that it's done */\n if (ked) {\n ked->fcu = NULL;\n ked->curIndex = 0;\n ked->curflags = 0;\n }\n\n /* if fcu_cb (F-Curve post-editing callback) has been specified then execute it */\n if (fcu_cb) {\n fcu_cb(fcu);\n }\n\n /* done */\n return 0;\n}\n\n/* --------------------- Further Abstracted (Not Exposed Directly) ----------------------------- */\n\n/* This function is used to loop over the keyframe data in an Action Group */\nstatic short agrp_keyframes_loop(KeyframeEditData *ked,\n bActionGroup *agrp,\n KeyframeEditFunc key_ok,\n KeyframeEditFunc key_cb,\n FcuEditFunc fcu_cb)\n{\n FCurve *fcu;\n\n /* sanity check */\n if (agrp == NULL) {\n return 0;\n }\n\n /* only iterate over the F-Curves that are in this group */\n for (fcu = agrp->channels.first; fcu && fcu->grp == agrp; fcu = fcu->next) {\n if (ANIM_fcurve_keyframes_loop(ked, fcu, key_ok, key_cb, fcu_cb)) {\n return 1;\n }\n }\n\n return 0;\n}\n\n/* This function is used to loop over the keyframe data in an Action */\nstatic short act_keyframes_loop(KeyframeEditData *ked,\n bAction *act,\n KeyframeEditFunc key_ok,\n KeyframeEditFunc key_cb,\n FcuEditFunc fcu_cb)\n{\n FCurve *fcu;\n\n /* sanity check */\n if (act == NULL) {\n return 0;\n }\n\n /* just loop through all F-Curves */\n for (fcu = act->curves.first; fcu; fcu = fcu->next) {\n if (ANIM_fcurve_keyframes_loop(ked, fcu, key_ok, key_cb, fcu_cb)) {\n return 1;\n }\n }\n\n return 0;\n}\n\n/* This function is used to loop over the keyframe data in an Object */\nstatic short ob_keyframes_loop(KeyframeEditData *ked,\n bDopeSheet *ads,\n Object *ob,\n KeyframeEditFunc key_ok,\n KeyframeEditFunc key_cb,\n FcuEditFunc fcu_cb)\n{\n bAnimContext ac = {NULL};\n ListBase anim_data = {NULL, NULL};\n bAnimListElem *ale;\n int filter;\n int ret = 0;\n\n bAnimListElem dummychan = {NULL};\n Base dummybase = {NULL};\n\n if (ob == NULL) {\n return 0;\n }\n\n /* create a dummy wrapper data to work with */\n dummybase.object = ob;\n\n dummychan.type = ANIMTYPE_OBJECT;\n dummychan.data = &dummybase;\n dummychan.id = &ob->id;\n dummychan.adt = ob->adt;\n\n ac.ads = ads;\n ac.data = &dummychan;\n ac.datatype = ANIMCONT_CHANNEL;\n\n /* get F-Curves to take keyframes from */\n filter = ANIMFILTER_DATA_VISIBLE; // curves only\n ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);\n\n /* Loop through each F-Curve, applying the operation as required,\n * but stopping on the first one. */\n for (ale = anim_data.first; ale; ale = ale->next) {\n if (ANIM_fcurve_keyframes_loop(ked, (FCurve *)ale->data, key_ok, key_cb, fcu_cb)) {\n ret = 1;\n break;\n }\n }\n\n ANIM_animdata_freelist(&anim_data);\n\n /* return return code - defaults to zero if nothing happened */\n return ret;\n}\n\n/* This function is used to loop over the keyframe data in a Scene */\nstatic short scene_keyframes_loop(KeyframeEditData *ked,\n bDopeSheet *ads,\n Scene *sce,\n KeyframeEditFunc key_ok,\n KeyframeEditFunc key_cb,\n FcuEditFunc fcu_cb)\n{\n bAnimContext ac = {NULL};\n ListBase anim_data = {NULL, NULL};\n bAnimListElem *ale;\n int filter;\n int ret = 0;\n\n bAnimListElem dummychan = {NULL};\n\n if (sce == NULL) {\n return 0;\n }\n\n /* create a dummy wrapper data to work with */\n dummychan.type = ANIMTYPE_SCENE;\n dummychan.data = sce;\n dummychan.id = &sce->id;\n dummychan.adt = sce->adt;\n\n ac.ads = ads;\n ac.data = &dummychan;\n ac.datatype = ANIMCONT_CHANNEL;\n\n /* get F-Curves to take keyframes from */\n filter = ANIMFILTER_DATA_VISIBLE; // curves only\n ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);\n\n /* Loop through each F-Curve, applying the operation as required,\n * but stopping on the first one. */\n for (ale = anim_data.first; ale; ale = ale->next) {\n if (ANIM_fcurve_keyframes_loop(ked, (FCurve *)ale->data, key_ok, key_cb, fcu_cb)) {\n ret = 1;\n break;\n }\n }\n\n ANIM_animdata_freelist(&anim_data);\n\n /* return return code - defaults to zero if nothing happened */\n return ret;\n}\n\n/* This function is used to loop over the keyframe data in a DopeSheet summary */\nstatic short summary_keyframes_loop(KeyframeEditData *ked,\n bAnimContext *ac,\n KeyframeEditFunc key_ok,\n KeyframeEditFunc key_cb,\n FcuEditFunc fcu_cb)\n{\n ListBase anim_data = {NULL, NULL};\n bAnimListElem *ale;\n int filter, ret_code = 0;\n\n /* sanity check */\n if (ac == NULL) {\n return 0;\n }\n\n /* get F-Curves to take keyframes from */\n filter = ANIMFILTER_DATA_VISIBLE;\n ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);\n\n /* loop through each F-Curve, working on the keyframes until the first curve aborts */\n for (ale = anim_data.first; ale; ale = ale->next) {\n switch (ale->datatype) {\n case ALE_MASKLAY:\n case ALE_GPFRAME:\n break;\n\n case ALE_FCURVE:\n default: {\n if (ked && ked->iterflags) {\n /* make backups of the current values, so that a localized fix\n * (e.g. NLA time remapping) can be applied to these values\n */\n float f1 = ked->f1;\n float f2 = ked->f2;\n\n if (ked->iterflags & (KED_F1_NLA_UNMAP | KED_F2_NLA_UNMAP)) {\n AnimData *adt = ANIM_nla_mapping_get(ac, ale);\n\n if (ked->iterflags & KED_F1_NLA_UNMAP) {\n ked->f1 = BKE_nla_tweakedit_remap(adt, f1, NLATIME_CONVERT_UNMAP);\n }\n if (ked->iterflags & KED_F2_NLA_UNMAP) {\n ked->f2 = BKE_nla_tweakedit_remap(adt, f2, NLATIME_CONVERT_UNMAP);\n }\n }\n\n /* now operate on the channel as per normal */\n ret_code = ANIM_fcurve_keyframes_loop(ked, ale->data, key_ok, key_cb, fcu_cb);\n\n /* reset */\n ked->f1 = f1;\n ked->f2 = f2;\n }\n else {\n /* no special handling required... */\n ret_code = ANIM_fcurve_keyframes_loop(ked, ale->data, key_ok, key_cb, fcu_cb);\n }\n break;\n }\n }\n\n if (ret_code) {\n break;\n }\n }\n\n ANIM_animdata_freelist(&anim_data);\n\n return ret_code;\n}\n\n/* --- */\n\n/* This function is used to apply operation to all keyframes, regardless of the type */\nshort ANIM_animchannel_keyframes_loop(KeyframeEditData *ked,\n bDopeSheet *ads,\n bAnimListElem *ale,\n KeyframeEditFunc key_ok,\n KeyframeEditFunc key_cb,\n FcuEditFunc fcu_cb)\n{\n /* sanity checks */\n if (ale == NULL) {\n return 0;\n }\n\n /* method to use depends on the type of keyframe data */\n switch (ale->datatype) {\n /* direct keyframe data (these loops are exposed) */\n case ALE_FCURVE: /* F-Curve */\n return ANIM_fcurve_keyframes_loop(ked, ale->key_data, key_ok, key_cb, fcu_cb);\n\n /* indirect 'summaries' (these are not exposed directly)\n * NOTE: must keep this code in sync with the drawing code and also the filtering code!\n */\n case ALE_GROUP: /* action group */\n return agrp_keyframes_loop(ked, (bActionGroup *)ale->data, key_ok, key_cb, fcu_cb);\n case ALE_ACT: /* action */\n return act_keyframes_loop(ked, (bAction *)ale->key_data, key_ok, key_cb, fcu_cb);\n\n case ALE_OB: /* object */\n return ob_keyframes_loop(ked, ads, (Object *)ale->key_data, key_ok, key_cb, fcu_cb);\n case ALE_SCE: /* scene */\n return scene_keyframes_loop(ked, ads, (Scene *)ale->data, key_ok, key_cb, fcu_cb);\n case ALE_ALL: /* 'all' (DopeSheet summary) */\n return summary_keyframes_loop(ked, (bAnimContext *)ale->data, key_ok, key_cb, fcu_cb);\n }\n\n return 0;\n}\n\n/* This function is used to apply operation to all keyframes,\n * regardless of the type without needed an AnimListElem wrapper */\nshort ANIM_animchanneldata_keyframes_loop(KeyframeEditData *ked,\n bDopeSheet *ads,\n void *data,\n int keytype,\n KeyframeEditFunc key_ok,\n KeyframeEditFunc key_cb,\n FcuEditFunc fcu_cb)\n{\n /* sanity checks */\n if (data == NULL) {\n return 0;\n }\n\n /* method to use depends on the type of keyframe data */\n switch (keytype) {\n /* direct keyframe data (these loops are exposed) */\n case ALE_FCURVE: /* F-Curve */\n return ANIM_fcurve_keyframes_loop(ked, data, key_ok, key_cb, fcu_cb);\n\n /* indirect 'summaries' (these are not exposed directly)\n * NOTE: must keep this code in sync with the drawing code and also the filtering code!\n */\n case ALE_GROUP: /* action group */\n return agrp_keyframes_loop(ked, (bActionGroup *)data, key_ok, key_cb, fcu_cb);\n case ALE_ACT: /* action */\n return act_keyframes_loop(ked, (bAction *)data, key_ok, key_cb, fcu_cb);\n\n case ALE_OB: /* object */\n return ob_keyframes_loop(ked, ads, (Object *)data, key_ok, key_cb, fcu_cb);\n case ALE_SCE: /* scene */\n return scene_keyframes_loop(ked, ads, (Scene *)data, key_ok, key_cb, fcu_cb);\n case ALE_ALL: /* 'all' (DopeSheet summary) */\n return summary_keyframes_loop(ked, (bAnimContext *)data, key_ok, key_cb, fcu_cb);\n }\n\n return 0;\n}\n\n/* ************************************************************************** */\n/* Keyframe Integrity Tools */\n\n/* Rearrange keyframes if some are out of order */\n// used to be recalc_*_ipos() where * was object or action\nvoid ANIM_editkeyframes_refresh(bAnimContext *ac)\n{\n ListBase anim_data = {NULL, NULL};\n bAnimListElem *ale;\n int filter;\n\n /* filter animation data */\n filter = ANIMFILTER_DATA_VISIBLE;\n ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);\n\n /* Loop over F-Curves that are likely to have been edited, and tag them to\n * ensure the keyframes are in order and handles are in a valid position. */\n for (ale = anim_data.first; ale; ale = ale->next) {\n ale->update |= ANIM_UPDATE_DEPS | ANIM_UPDATE_HANDLES | ANIM_UPDATE_ORDER;\n }\n\n /* free temp data */\n ANIM_animdata_update(ac, &anim_data);\n ANIM_animdata_freelist(&anim_data);\n}\n\n/* ************************************************************************** */\n/* BezTriple Validation Callbacks */\n\n/* ------------------------ */\n/* Some macros to make this easier... */\n\n/* run the given check on the 3 handles:\n * - Check should be a macro, which takes the handle index as its single arg,\n * which it substitutes later.\n * - Requires that a var, of type short, is named 'ok',\n * and has been initialized to 0.\n */\n#define KEYFRAME_OK_CHECKS(check) \\\n { \\\n CHECK_TYPE(ok, short); \\\n if (check(1)) \\\n ok |= KEYFRAME_OK_KEY; \\\n\\\n if (ked && (ked->iterflags & KEYFRAME_ITER_INCL_HANDLES)) { \\\n if (check(0)) \\\n ok |= KEYFRAME_OK_H1; \\\n if (check(2)) \\\n ok |= KEYFRAME_OK_H2; \\\n } \\\n } \\\n (void)0\n\n/* ------------------------ */\n\nstatic short ok_bezier_frame(KeyframeEditData *ked, BezTriple *bezt)\n{\n short ok = 0;\n\n /* frame is stored in f1 property (this float accuracy check may need to be dropped?) */\n#define KEY_CHECK_OK(_index) IS_EQF(bezt->vec[_index][0], ked->f1)\n KEYFRAME_OK_CHECKS(KEY_CHECK_OK);\n#undef KEY_CHECK_OK\n\n /* return ok flags */\n return ok;\n}\n\nstatic short ok_bezier_framerange(KeyframeEditData *ked, BezTriple *bezt)\n{\n short ok = 0;\n\n /* frame range is stored in float properties */\n#define KEY_CHECK_OK(_index) ((bezt->vec[_index][0] > ked->f1) && (bezt->vec[_index][0] < ked->f2))\n KEYFRAME_OK_CHECKS(KEY_CHECK_OK);\n#undef KEY_CHECK_OK\n\n /* return ok flags */\n return ok;\n}\n\nstatic short ok_bezier_selected(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n /* this macro checks all beztriple handles for selection...\n * only one of the verts has to be selected for this to be ok...\n */\n if (BEZT_ISSEL_ANY(bezt)) {\n return KEYFRAME_OK_ALL;\n }\n else {\n return 0;\n }\n}\n\nstatic short ok_bezier_value(KeyframeEditData *ked, BezTriple *bezt)\n{\n short ok = 0;\n\n /* Value is stored in f1 property:\n * - This float accuracy check may need to be dropped?\n * - Should value be stored in f2 instead\n * so that we won't have conflicts when using f1 for frames too?\n */\n#define KEY_CHECK_OK(_index) IS_EQF(bezt->vec[_index][1], ked->f1)\n KEYFRAME_OK_CHECKS(KEY_CHECK_OK);\n#undef KEY_CHECK_OK\n\n /* return ok flags */\n return ok;\n}\n\nstatic short ok_bezier_valuerange(KeyframeEditData *ked, BezTriple *bezt)\n{\n short ok = 0;\n\n /* value range is stored in float properties */\n#define KEY_CHECK_OK(_index) ((bezt->vec[_index][1] > ked->f1) && (bezt->vec[_index][1] < ked->f2))\n KEYFRAME_OK_CHECKS(KEY_CHECK_OK);\n#undef KEY_CHECK_OK\n\n /* return ok flags */\n return ok;\n}\n\nstatic short ok_bezier_region(KeyframeEditData *ked, BezTriple *bezt)\n{\n /* rect is stored in data property (it's of type rectf, but may not be set) */\n if (ked->data) {\n short ok = 0;\n\n#define KEY_CHECK_OK(_index) BLI_rctf_isect_pt_v(ked->data, bezt->vec[_index])\n KEYFRAME_OK_CHECKS(KEY_CHECK_OK);\n#undef KEY_CHECK_OK\n\n /* return ok flags */\n return ok;\n }\n else {\n return 0;\n }\n}\n\n/**\n * Called from #ok_bezier_region_lasso and #ok_bezier_channel_lasso\n */\nbool keyframe_region_lasso_test(const KeyframeEdit_LassoData *data_lasso, const float xy[2])\n{\n if (BLI_rctf_isect_pt_v(data_lasso->rectf_scaled, xy)) {\n float xy_view[2];\n\n BLI_rctf_transform_pt_v(data_lasso->rectf_view, data_lasso->rectf_scaled, xy_view, xy);\n\n if (BLI_lasso_is_point_inside(\n data_lasso->mcords, data_lasso->mcords_tot, xy_view[0], xy_view[1], INT_MAX)) {\n return true;\n }\n }\n\n return false;\n}\n\nstatic short ok_bezier_region_lasso(KeyframeEditData *ked, BezTriple *bezt)\n{\n /* check for lasso customdata (KeyframeEdit_LassoData) */\n if (ked->data) {\n short ok = 0;\n\n#define KEY_CHECK_OK(_index) keyframe_region_lasso_test(ked->data, bezt->vec[_index])\n KEYFRAME_OK_CHECKS(KEY_CHECK_OK);\n#undef KEY_CHECK_OK\n\n /* return ok flags */\n return ok;\n }\n else {\n return 0;\n }\n}\n\nstatic short ok_bezier_channel_lasso(KeyframeEditData *ked, BezTriple *bezt)\n{\n /* check for lasso customdata (KeyframeEdit_LassoData) */\n if (ked->data) {\n KeyframeEdit_LassoData *data = ked->data;\n float pt[2];\n\n /* late-binding remap of the x values (for summary channels) */\n /* XXX: Ideally we reset, but it should be fine just leaving it as-is\n * as the next channel will reset it properly, while the next summary-channel\n * curve will also reset by itself...\n */\n if (ked->iterflags & (KED_F1_NLA_UNMAP | KED_F2_NLA_UNMAP)) {\n data->rectf_scaled->xmin = ked->f1;\n data->rectf_scaled->xmax = ked->f2;\n }\n\n /* only use the x-coordinate of the point; the y is the channel range... */\n pt[0] = bezt->vec[1][0];\n pt[1] = ked->channel_y;\n\n if (keyframe_region_lasso_test(data, pt)) {\n return KEYFRAME_OK_KEY;\n }\n }\n return 0;\n}\n\n/**\n * Called from #ok_bezier_region_circle and #ok_bezier_channel_circle\n */\nbool keyframe_region_circle_test(const KeyframeEdit_CircleData *data_circle, const float xy[2])\n{\n if (BLI_rctf_isect_pt_v(data_circle->rectf_scaled, xy)) {\n float xy_view[2];\n\n BLI_rctf_transform_pt_v(data_circle->rectf_view, data_circle->rectf_scaled, xy_view, xy);\n\n xy_view[0] = xy_view[0] - data_circle->mval[0];\n xy_view[1] = xy_view[1] - data_circle->mval[1];\n return len_squared_v2(xy_view) < data_circle->radius_squared;\n }\n\n return false;\n}\n\nstatic short ok_bezier_region_circle(KeyframeEditData *ked, BezTriple *bezt)\n{\n /* check for circle select customdata (KeyframeEdit_CircleData) */\n if (ked->data) {\n short ok = 0;\n\n#define KEY_CHECK_OK(_index) keyframe_region_circle_test(ked->data, bezt->vec[_index])\n KEYFRAME_OK_CHECKS(KEY_CHECK_OK);\n#undef KEY_CHECK_OK\n\n /* return ok flags */\n return ok;\n }\n else {\n return 0;\n }\n}\n\nstatic short ok_bezier_channel_circle(KeyframeEditData *ked, BezTriple *bezt)\n{\n /* check for circle select customdata (KeyframeEdit_CircleData) */\n if (ked->data) {\n KeyframeEdit_CircleData *data = ked->data;\n float pt[2];\n\n /* late-binding remap of the x values (for summary channels) */\n /* XXX: Ideally we reset, but it should be fine just leaving it as-is\n * as the next channel will reset it properly, while the next summary-channel\n * curve will also reset by itself...\n */\n if (ked->iterflags & (KED_F1_NLA_UNMAP | KED_F2_NLA_UNMAP)) {\n data->rectf_scaled->xmin = ked->f1;\n data->rectf_scaled->xmax = ked->f2;\n }\n\n /* only use the x-coordinate of the point; the y is the channel range... */\n pt[0] = bezt->vec[1][0];\n pt[1] = ked->channel_y;\n\n if (keyframe_region_circle_test(data, pt)) {\n return KEYFRAME_OK_KEY;\n }\n }\n return 0;\n}\n\nKeyframeEditFunc ANIM_editkeyframes_ok(short mode)\n{\n /* eEditKeyframes_Validate */\n switch (mode) {\n case BEZT_OK_FRAME:\n /* only if bezt falls on the right frame (float) */\n return ok_bezier_frame;\n case BEZT_OK_FRAMERANGE:\n /* only if bezt falls within the specified frame range (floats) */\n return ok_bezier_framerange;\n case BEZT_OK_SELECTED:\n /* only if bezt is selected (self) */\n return ok_bezier_selected;\n case BEZT_OK_VALUE:\n /* only if bezt value matches (float) */\n return ok_bezier_value;\n case BEZT_OK_VALUERANGE:\n /* only if bezier falls within the specified value range (floats) */\n return ok_bezier_valuerange;\n case BEZT_OK_REGION:\n /* only if bezier falls within the specified rect (data -> rectf) */\n return ok_bezier_region;\n case BEZT_OK_REGION_LASSO:\n /* only if the point falls within KeyframeEdit_LassoData defined data */\n return ok_bezier_region_lasso;\n case BEZT_OK_REGION_CIRCLE:\n /* only if the point falls within KeyframeEdit_CircleData defined data */\n return ok_bezier_region_circle;\n case BEZT_OK_CHANNEL_LASSO:\n /* same as BEZT_OK_REGION_LASSO, but we're only using the x-value of the points */\n return ok_bezier_channel_lasso;\n case BEZT_OK_CHANNEL_CIRCLE:\n /* same as BEZT_OK_REGION_CIRCLE, but we're only using the x-value of the points */\n return ok_bezier_channel_circle;\n default: /* nothing was ok */\n return NULL;\n }\n}\n\n/* ******************************************* */\n/* Assorted Utility Functions */\n\n/**\n * Helper callback for _cfrasnap_exec() ->\n * used to help get the average time of all selected beztriples\n */\nshort bezt_calc_average(KeyframeEditData *ked, BezTriple *bezt)\n{\n /* only if selected */\n if (bezt->f2 & SELECT) {\n /* store average time in float 1 (only do rounding at last step) */\n ked->f1 += bezt->vec[1][0];\n\n /* store average value in float 2 (only do rounding at last step)\n * - this isn't always needed, but some operators may also require this\n */\n ked->f2 += bezt->vec[1][1];\n\n /* increment number of items */\n ked->i1++;\n }\n\n return 0;\n}\n\n/* helper callback for columnselect__keys() -> populate\n * list CfraElems with frame numbers from selected beztriples */\nshort bezt_to_cfraelem(KeyframeEditData *ked, BezTriple *bezt)\n{\n /* only if selected */\n if (bezt->f2 & SELECT) {\n CfraElem *ce = MEM_callocN(sizeof(CfraElem), \"cfraElem\");\n BLI_addtail(&ked->list, ce);\n\n ce->cfra = bezt->vec[1][0];\n }\n\n return 0;\n}\n\n/* used to remap times from one range to another\n * requires: ked->data = KeyframeEditCD_Remap\n */\nvoid bezt_remap_times(KeyframeEditData *ked, BezTriple *bezt)\n{\n KeyframeEditCD_Remap *rmap = (KeyframeEditCD_Remap *)ked->data;\n const float scale = (rmap->newMax - rmap->newMin) / (rmap->oldMax - rmap->oldMin);\n\n /* perform transform on all three handles unless indicated otherwise */\n // TODO: need to include some checks for that\n\n bezt->vec[0][0] = scale * (bezt->vec[0][0] - rmap->oldMin) + rmap->newMin;\n bezt->vec[1][0] = scale * (bezt->vec[1][0] - rmap->oldMin) + rmap->newMin;\n bezt->vec[2][0] = scale * (bezt->vec[2][0] - rmap->oldMin) + rmap->newMin;\n}\n\n/* ******************************************* */\n/* Transform */\n\n/* snaps the keyframe to the nearest frame */\nstatic short snap_bezier_nearest(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->vec[1][0] = (float)(floorf(bezt->vec[1][0] + 0.5f));\n }\n return 0;\n}\n\n/* snaps the keyframe to the nearest second */\nstatic short snap_bezier_nearestsec(KeyframeEditData *ked, BezTriple *bezt)\n{\n const Scene *scene = ked->scene;\n const float secf = (float)FPS;\n\n if (bezt->f2 & SELECT) {\n bezt->vec[1][0] = (floorf(bezt->vec[1][0] / secf + 0.5f) * secf);\n }\n return 0;\n}\n\n/* snaps the keyframe to the current frame */\nstatic short snap_bezier_cframe(KeyframeEditData *ked, BezTriple *bezt)\n{\n const Scene *scene = ked->scene;\n if (bezt->f2 & SELECT) {\n bezt->vec[1][0] = (float)CFRA;\n }\n return 0;\n}\n\n/* snaps the keyframe time to the nearest marker's frame */\nstatic short snap_bezier_nearmarker(KeyframeEditData *ked, BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->vec[1][0] = (float)ED_markers_find_nearest_marker_time(&ked->list, bezt->vec[1][0]);\n }\n return 0;\n}\n\n/* make the handles have the same value as the key */\nstatic short snap_bezier_horizontal(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->vec[0][1] = bezt->vec[2][1] = bezt->vec[1][1];\n\n if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM, HD_VECT)) {\n bezt->h1 = HD_ALIGN;\n }\n if (ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM, HD_VECT)) {\n bezt->h2 = HD_ALIGN;\n }\n }\n return 0;\n}\n\n/* frame to snap to is stored in the custom data -> first float value slot */\nstatic short snap_bezier_time(KeyframeEditData *ked, BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->vec[1][0] = ked->f1;\n }\n return 0;\n}\n\n/* value to snap to is stored in the custom data -> first float value slot */\nstatic short snap_bezier_value(KeyframeEditData *ked, BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->vec[1][1] = ked->f1;\n }\n return 0;\n}\n\nKeyframeEditFunc ANIM_editkeyframes_snap(short type)\n{\n /* eEditKeyframes_Snap */\n switch (type) {\n case SNAP_KEYS_NEARFRAME: /* snap to nearest frame */\n return snap_bezier_nearest;\n case SNAP_KEYS_CURFRAME: /* snap to current frame */\n return snap_bezier_cframe;\n case SNAP_KEYS_NEARMARKER: /* snap to nearest marker */\n return snap_bezier_nearmarker;\n case SNAP_KEYS_NEARSEC: /* snap to nearest second */\n return snap_bezier_nearestsec;\n case SNAP_KEYS_HORIZONTAL: /* snap handles to same value */\n return snap_bezier_horizontal;\n case SNAP_KEYS_TIME: /* snap to given frame/time */\n return snap_bezier_time;\n case SNAP_KEYS_VALUE: /* snap to given value */\n return snap_bezier_value;\n default: /* just in case */\n return snap_bezier_nearest;\n }\n}\n\n/* --------- */\n\nstatic void mirror_bezier_xaxis_ex(BezTriple *bezt, const float center)\n{\n float diff;\n int i;\n\n for (i = 0; i < 3; i++) {\n diff = (center - bezt->vec[i][0]);\n bezt->vec[i][0] = (center + diff);\n }\n swap_v3_v3(bezt->vec[0], bezt->vec[2]);\n\n SWAP(char, bezt->h1, bezt->h2);\n SWAP(char, bezt->f1, bezt->f3);\n}\n\nstatic void mirror_bezier_yaxis_ex(BezTriple *bezt, const float center)\n{\n float diff;\n int i;\n\n for (i = 0; i < 3; i++) {\n diff = (center - bezt->vec[i][1]);\n bezt->vec[i][1] = (center + diff);\n }\n}\n\nstatic short mirror_bezier_cframe(KeyframeEditData *ked, BezTriple *bezt)\n{\n const Scene *scene = ked->scene;\n\n if (bezt->f2 & SELECT) {\n mirror_bezier_xaxis_ex(bezt, CFRA);\n }\n\n return 0;\n}\n\nstatic short mirror_bezier_yaxis(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n /* Yes, names are inverted, we are mirroring across y axis, hence along x axis... */\n mirror_bezier_xaxis_ex(bezt, 0.0f);\n }\n\n return 0;\n}\n\nstatic short mirror_bezier_xaxis(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n /* Yes, names are inverted, we are mirroring across x axis, hence along y axis... */\n mirror_bezier_yaxis_ex(bezt, 0.0f);\n }\n\n return 0;\n}\n\nstatic short mirror_bezier_marker(KeyframeEditData *ked, BezTriple *bezt)\n{\n /* mirroring time stored in f1 */\n if (bezt->f2 & SELECT) {\n mirror_bezier_xaxis_ex(bezt, ked->f1);\n }\n\n return 0;\n}\n\nstatic short mirror_bezier_time(KeyframeEditData *ked, BezTriple *bezt)\n{\n /* value to mirror over is stored in f1 */\n if (bezt->f2 & SELECT) {\n mirror_bezier_xaxis_ex(bezt, ked->f1);\n }\n\n return 0;\n}\n\nstatic short mirror_bezier_value(KeyframeEditData *ked, BezTriple *bezt)\n{\n /* value to mirror over is stored in the custom data -> first float value slot */\n if (bezt->f2 & SELECT) {\n mirror_bezier_yaxis_ex(bezt, ked->f1);\n }\n\n return 0;\n}\n\n/* Note: for markers and 'value', the values to use must be supplied as the first float value */\n// calchandles_fcurve\nKeyframeEditFunc ANIM_editkeyframes_mirror(short type)\n{\n switch (type) {\n case MIRROR_KEYS_CURFRAME: /* mirror over current frame */\n return mirror_bezier_cframe;\n case MIRROR_KEYS_YAXIS: /* mirror over frame 0 */\n return mirror_bezier_yaxis;\n case MIRROR_KEYS_XAXIS: /* mirror over value 0 */\n return mirror_bezier_xaxis;\n case MIRROR_KEYS_MARKER: /* mirror over marker */\n return mirror_bezier_marker;\n case MIRROR_KEYS_TIME: /* mirror over frame/time */\n return mirror_bezier_time;\n case MIRROR_KEYS_VALUE: /* mirror over given value */\n return mirror_bezier_value;\n default: /* just in case */\n return mirror_bezier_yaxis;\n }\n}\n\n/* ******************************************* */\n/* Settings */\n\n/**\n * Standard validation step for a few of these\n * (implemented as macro for inlining without fn-call overhead):\n * \"if the handles are not of the same type, set them to type free\".\n */\n#define ENSURE_HANDLES_MATCH(bezt) \\\n if (bezt->h1 != bezt->h2) { \\\n if (ELEM(bezt->h1, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) \\\n bezt->h1 = HD_FREE; \\\n if (ELEM(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) \\\n bezt->h2 = HD_FREE; \\\n } \\\n (void)0\n\n/* Sets the selected bezier handles to type 'auto' */\nstatic short set_bezier_auto(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if ((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) {\n if (bezt->f1 & SELECT) {\n bezt->h1 = HD_AUTO;\n }\n if (bezt->f3 & SELECT) {\n bezt->h2 = HD_AUTO;\n }\n\n ENSURE_HANDLES_MATCH(bezt);\n }\n return 0;\n}\n\n/* Sets the selected bezier handles to type 'auto-clamped'\n * NOTE: this is like auto above, but they're handled a bit different\n */\nstatic short set_bezier_auto_clamped(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if ((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) {\n if (bezt->f1 & SELECT) {\n bezt->h1 = HD_AUTO_ANIM;\n }\n if (bezt->f3 & SELECT) {\n bezt->h2 = HD_AUTO_ANIM;\n }\n\n ENSURE_HANDLES_MATCH(bezt);\n }\n return 0;\n}\n\n/* Sets the selected bezier handles to type 'vector' */\nstatic short set_bezier_vector(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f1 & SELECT) {\n bezt->h1 = HD_VECT;\n }\n if (bezt->f3 & SELECT) {\n bezt->h2 = HD_VECT;\n }\n return 0;\n}\n\n/* Queries if the handle should be set to 'free' or 'align' */\n// NOTE: this was used for the 'toggle free/align' option\n// currently this isn't used, but may be restored later\nstatic short bezier_isfree(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if ((bezt->f1 & SELECT) && (bezt->h1)) {\n return 1;\n }\n if ((bezt->f3 & SELECT) && (bezt->h2)) {\n return 1;\n }\n return 0;\n}\n\n/* Sets selected bezier handles to type 'align' */\nstatic short set_bezier_align(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f1 & SELECT) {\n bezt->h1 = HD_ALIGN;\n }\n if (bezt->f3 & SELECT) {\n bezt->h2 = HD_ALIGN;\n }\n return 0;\n}\n\n/* Sets selected bezier handles to type 'free' */\nstatic short set_bezier_free(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f1 & SELECT) {\n bezt->h1 = HD_FREE;\n }\n if (bezt->f3 & SELECT) {\n bezt->h2 = HD_FREE;\n }\n return 0;\n}\n\n/* Set all selected Bezier Handles to a single type */\n// calchandles_fcurve\nKeyframeEditFunc ANIM_editkeyframes_handles(short code)\n{\n switch (code) {\n case HD_AUTO: /* auto */\n return set_bezier_auto;\n case HD_AUTO_ANIM: /* auto clamped */\n return set_bezier_auto_clamped;\n\n case HD_VECT: /* vector */\n return set_bezier_vector;\n case HD_FREE: /* free */\n return set_bezier_free;\n case HD_ALIGN: /* align */\n return set_bezier_align;\n\n default: /* check for toggle free or align? */\n return bezier_isfree;\n }\n}\n\n/* ------- */\n\nstatic short set_bezt_constant(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->ipo = BEZT_IPO_CONST;\n }\n return 0;\n}\n\nstatic short set_bezt_linear(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->ipo = BEZT_IPO_LIN;\n }\n return 0;\n}\n\nstatic short set_bezt_bezier(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->ipo = BEZT_IPO_BEZ;\n }\n return 0;\n}\n\nstatic short set_bezt_back(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->ipo = BEZT_IPO_BACK;\n }\n return 0;\n}\n\nstatic short set_bezt_bounce(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->ipo = BEZT_IPO_BOUNCE;\n }\n return 0;\n}\n\nstatic short set_bezt_circle(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->ipo = BEZT_IPO_CIRC;\n }\n return 0;\n}\n\nstatic short set_bezt_cubic(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->ipo = BEZT_IPO_CUBIC;\n }\n return 0;\n}\n\nstatic short set_bezt_elastic(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->ipo = BEZT_IPO_ELASTIC;\n }\n return 0;\n}\n\nstatic short set_bezt_expo(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->ipo = BEZT_IPO_EXPO;\n }\n return 0;\n}\n\nstatic short set_bezt_quad(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->ipo = BEZT_IPO_QUAD;\n }\n return 0;\n}\n\nstatic short set_bezt_quart(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->ipo = BEZT_IPO_QUART;\n }\n return 0;\n}\n\nstatic short set_bezt_quint(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->ipo = BEZT_IPO_QUINT;\n }\n return 0;\n}\n\nstatic short set_bezt_sine(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->ipo = BEZT_IPO_SINE;\n }\n return 0;\n}\n\n/* Set the interpolation type of the selected BezTriples in each F-Curve to the specified one */\n// ANIM_editkeyframes_ipocurve_ipotype() !\nKeyframeEditFunc ANIM_editkeyframes_ipo(short code)\n{\n switch (code) {\n /* interpolation */\n case BEZT_IPO_CONST: /* constant */\n return set_bezt_constant;\n case BEZT_IPO_LIN: /* linear */\n return set_bezt_linear;\n\n /* easing */\n case BEZT_IPO_BACK:\n return set_bezt_back;\n case BEZT_IPO_BOUNCE:\n return set_bezt_bounce;\n case BEZT_IPO_CIRC:\n return set_bezt_circle;\n case BEZT_IPO_CUBIC:\n return set_bezt_cubic;\n case BEZT_IPO_ELASTIC:\n return set_bezt_elastic;\n case BEZT_IPO_EXPO:\n return set_bezt_expo;\n case BEZT_IPO_QUAD:\n return set_bezt_quad;\n case BEZT_IPO_QUART:\n return set_bezt_quart;\n case BEZT_IPO_QUINT:\n return set_bezt_quint;\n case BEZT_IPO_SINE:\n return set_bezt_sine;\n\n default: /* bezier */\n return set_bezt_bezier;\n }\n}\n\n/* ------- */\n\nstatic short set_keytype_keyframe(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n BEZKEYTYPE(bezt) = BEZT_KEYTYPE_KEYFRAME;\n }\n return 0;\n}\n\nstatic short set_keytype_breakdown(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n BEZKEYTYPE(bezt) = BEZT_KEYTYPE_BREAKDOWN;\n }\n return 0;\n}\n\nstatic short set_keytype_extreme(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n BEZKEYTYPE(bezt) = BEZT_KEYTYPE_EXTREME;\n }\n return 0;\n}\n\nstatic short set_keytype_jitter(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n BEZKEYTYPE(bezt) = BEZT_KEYTYPE_JITTER;\n }\n return 0;\n}\n\nstatic short set_keytype_moving_hold(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n BEZKEYTYPE(bezt) = BEZT_KEYTYPE_MOVEHOLD;\n }\n return 0;\n}\n\n/* Set the interpolation type of the selected BezTriples in each F-Curve to the specified one */\nKeyframeEditFunc ANIM_editkeyframes_keytype(short code)\n{\n switch (code) {\n case BEZT_KEYTYPE_BREAKDOWN: /* breakdown */\n return set_keytype_breakdown;\n\n case BEZT_KEYTYPE_EXTREME: /* extreme keyframe */\n return set_keytype_extreme;\n\n case BEZT_KEYTYPE_JITTER: /* jitter keyframe */\n return set_keytype_jitter;\n\n case BEZT_KEYTYPE_MOVEHOLD: /* moving hold */\n return set_keytype_moving_hold;\n\n case BEZT_KEYTYPE_KEYFRAME: /* proper keyframe */\n default:\n return set_keytype_keyframe;\n }\n}\n\n/* ------- */\n\nstatic short set_easingtype_easein(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->easing = BEZT_IPO_EASE_IN;\n }\n return 0;\n}\n\nstatic short set_easingtype_easeout(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->easing = BEZT_IPO_EASE_OUT;\n }\n return 0;\n}\n\nstatic short set_easingtype_easeinout(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->easing = BEZT_IPO_EASE_IN_OUT;\n }\n return 0;\n}\n\nstatic short set_easingtype_easeauto(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n if (bezt->f2 & SELECT) {\n bezt->easing = BEZT_IPO_EASE_AUTO;\n }\n return 0;\n}\n\n/* Set the easing type of the selected BezTriples in each F-Curve to the specified one */\nKeyframeEditFunc ANIM_editkeyframes_easing(short mode)\n{\n switch (mode) {\n case BEZT_IPO_EASE_IN: /* ease in */\n return set_easingtype_easein;\n\n case BEZT_IPO_EASE_OUT: /* ease out */\n return set_easingtype_easeout;\n\n case BEZT_IPO_EASE_IN_OUT: /* both */\n return set_easingtype_easeinout;\n\n default: /* auto */\n return set_easingtype_easeauto;\n }\n}\n\n/* ******************************************* */\n/* Selection */\n\nstatic short select_bezier_add(KeyframeEditData *ked, BezTriple *bezt)\n{\n /* if we've got info on what to select, use it, otherwise select all */\n if ((ked) && (ked->iterflags & KEYFRAME_ITER_INCL_HANDLES)) {\n if (ked->curflags & KEYFRAME_OK_KEY) {\n bezt->f2 |= SELECT;\n }\n if (ked->curflags & KEYFRAME_OK_H1) {\n bezt->f1 |= SELECT;\n }\n if (ked->curflags & KEYFRAME_OK_H2) {\n bezt->f3 |= SELECT;\n }\n }\n else {\n BEZT_SEL_ALL(bezt);\n }\n\n return 0;\n}\n\nstatic short select_bezier_subtract(KeyframeEditData *ked, BezTriple *bezt)\n{\n /* if we've got info on what to deselect, use it, otherwise deselect all */\n if ((ked) && (ked->iterflags & KEYFRAME_ITER_INCL_HANDLES)) {\n if (ked->curflags & KEYFRAME_OK_KEY) {\n bezt->f2 &= ~SELECT;\n }\n if (ked->curflags & KEYFRAME_OK_H1) {\n bezt->f1 &= ~SELECT;\n }\n if (ked->curflags & KEYFRAME_OK_H2) {\n bezt->f3 &= ~SELECT;\n }\n }\n else {\n BEZT_DESEL_ALL(bezt);\n }\n\n return 0;\n}\n\nstatic short select_bezier_invert(KeyframeEditData *UNUSED(ked), BezTriple *bezt)\n{\n /* Invert the selection for the whole bezier triple */\n bezt->f2 ^= SELECT;\n if (bezt->f2 & SELECT) {\n bezt->f1 |= SELECT;\n bezt->f3 |= SELECT;\n }\n else {\n bezt->f1 &= ~SELECT;\n bezt->f3 &= ~SELECT;\n }\n return 0;\n}\n\nKeyframeEditFunc ANIM_editkeyframes_select(short selectmode)\n{\n switch (selectmode) {\n case SELECT_ADD: /* add */\n return select_bezier_add;\n case SELECT_SUBTRACT: /* subtract */\n return select_bezier_subtract;\n case SELECT_INVERT: /* invert */\n return select_bezier_invert;\n default: /* replace (need to clear all, then add) */\n return select_bezier_add;\n }\n}\n\n/* ******************************************* */\n/* Selection Maps */\n\n/* Selection maps are simply fancy names for char arrays that store on/off\n * info for whether the selection status. The main purpose for these is to\n * allow extra info to be tagged to the keyframes without influencing their\n * values or having to be removed later.\n */\n\n/* ----------- */\n\nstatic short selmap_build_bezier_more(KeyframeEditData *ked, BezTriple *bezt)\n{\n FCurve *fcu = ked->fcu;\n char *map = ked->data;\n int i = ked->curIndex;\n\n /* if current is selected, just make sure it stays this way */\n if (BEZT_ISSEL_ANY(bezt)) {\n map[i] = 1;\n return 0;\n }\n\n /* if previous is selected, that means that selection should extend across */\n if (i > 0) {\n BezTriple *prev = bezt - 1;\n\n if (BEZT_ISSEL_ANY(prev)) {\n map[i] = 1;\n return 0;\n }\n }\n\n /* if next is selected, that means that selection should extend across */\n if (i < (fcu->totvert - 1)) {\n BezTriple *next = bezt + 1;\n\n if (BEZT_ISSEL_ANY(next)) {\n map[i] = 1;\n return 0;\n }\n }\n\n return 0;\n}\n\nstatic short selmap_build_bezier_less(KeyframeEditData *ked, BezTriple *bezt)\n{\n FCurve *fcu = ked->fcu;\n char *map = ked->data;\n int i = ked->curIndex;\n\n /* if current is selected, check the left/right keyframes\n * since it might need to be deselected (but otherwise no)\n */\n if (BEZT_ISSEL_ANY(bezt)) {\n /* if previous is not selected, we're on the tip of an iceberg */\n if (i > 0) {\n BezTriple *prev = bezt - 1;\n\n if (BEZT_ISSEL_ANY(prev) == 0) {\n return 0;\n }\n }\n else if (i == 0) {\n /* current keyframe is selected at an endpoint, so should get deselected */\n return 0;\n }\n\n /* if next is not selected, we're on the tip of an iceberg */\n if (i < (fcu->totvert - 1)) {\n BezTriple *next = bezt + 1;\n\n if (BEZT_ISSEL_ANY(next) == 0) {\n return 0;\n }\n }\n else if (i == (fcu->totvert - 1)) {\n /* current keyframe is selected at an endpoint, so should get deselected */\n return 0;\n }\n\n /* if we're still here, that means that keyframe should remain untouched */\n map[i] = 1;\n }\n\n return 0;\n}\n\n/* Get callback for building selection map */\nKeyframeEditFunc ANIM_editkeyframes_buildselmap(short mode)\n{\n switch (mode) {\n case SELMAP_LESS: /* less */\n return selmap_build_bezier_less;\n\n case SELMAP_MORE: /* more */\n default:\n return selmap_build_bezier_more;\n }\n}\n\n/* ----------- */\n\n/* flush selection map values to the given beztriple */\nshort bezt_selmap_flush(KeyframeEditData *ked, BezTriple *bezt)\n{\n const char *map = ked->data;\n short on = map[ked->curIndex];\n\n /* select or deselect based on whether the map allows it or not */\n if (on) {\n BEZT_SEL_ALL(bezt);\n }\n else {\n BEZT_DESEL_ALL(bezt);\n }\n\n return 0;\n}\n"} {"text": "\n#include \"IpUtils.h\"\n#include \"EndianPortable.h\"\n\nnamespace pcpp\n{\n\nvoid IPv6Layer::initLayer()\n{\n\tm_DataLen = sizeof(ip6_hdr);\n\tm_Data = new uint8_t[m_DataLen];\n\tm_Protocol = IPv6;\n\tm_FirstExtension = NULL;\n\tm_LastExtension = NULL;\n\tm_ExtensionsLen = 0;\n\tmemset(m_Data, 0, sizeof(ip6_hdr));\n}\n\nIPv6Layer::IPv6Layer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet) : Layer(data, dataLen, prevLayer, packet)\n{\n\tm_Protocol = IPv6;\n\tm_FirstExtension = NULL;\n\tm_LastExtension = NULL;\n\tm_ExtensionsLen = 0;\n\n\tparseExtensions();\n\n\tsize_t totalLen = be16toh(getIPv6Header()->payloadLength) + getHeaderLen();\n\tif (totalLen < m_DataLen)\n\t\tm_DataLen = totalLen;\n}\n\nIPv6Layer::IPv6Layer()\n{\n\tinitLayer();\n}\n\nIPv6Layer::IPv6Layer(const IPv6Address& srcIP, const IPv6Address& dstIP)\n{\n\tinitLayer();\n\tip6_hdr* ipHdr = getIPv6Header();\n\tsrcIP.copyTo(ipHdr->ipSrc);\n\tdstIP.copyTo(ipHdr->ipDst);\n}\n\nIPv6Layer::IPv6Layer(const IPv6Layer& other) : Layer(other)\n{\n\tm_FirstExtension = NULL;\n\tm_LastExtension = NULL;\n\tm_ExtensionsLen = 0;\n\tparseExtensions();\n}\n\nIPv6Layer::~IPv6Layer()\n{\n\tdeleteExtensions();\n}\n\nIPv6Layer& IPv6Layer::operator=(const IPv6Layer& other)\n{\n\tLayer::operator=(other);\n\n\tdeleteExtensions();\n\n\tparseExtensions();\n\n\treturn *this;\n}\n\nvoid IPv6Layer::parseExtensions()\n{\n\tuint8_t nextHdr = getIPv6Header()->nextHeader;\n\tIPv6Extension* curExt = NULL;\n\n\tsize_t offset = sizeof(ip6_hdr);\n\n\twhile (offset <= m_DataLen - 2*sizeof(uint8_t)) // 2*sizeof(uint8_t) is the min len for IPv6 extensions\n\t{\n\t\tIPv6Extension* newExt = NULL;\n\n\t\tswitch (nextHdr)\n\t\t{\n\t\tcase PACKETPP_IPPROTO_FRAGMENT:\n\t\t{\n\t\t\tnewExt = new IPv6FragmentationHeader(this, offset);\n\t\t\tbreak;\n\t\t}\n\t\tcase PACKETPP_IPPROTO_HOPOPTS:\n\t\t{\n\t\t\tnewExt = new IPv6HopByHopHeader(this, offset);\n\t\t\tbreak;\n\t\t}\n\t\tcase PACKETPP_IPPROTO_DSTOPTS:\n\t\t{\n\t\t\tnewExt = new IPv6DestinationHeader(this, offset);\n\t\t\tbreak;\n\t\t}\n\t\tcase PACKETPP_IPPROTO_ROUTING:\n\t\t{\n\t\t\tnewExt = new IPv6RoutingHeader(this, offset);\n\t\t\tbreak;\n\t\t}\n\t\tcase PACKETPP_IPPROTO_AH:\n\t\t{\n\t\t\tnewExt = new IPv6AuthenticationHeader(this, offset);\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t\t}\n\n\t\tif (newExt == NULL)\n\t\t\tbreak;\n\n\t\tif (m_FirstExtension == NULL)\n\t\t{\n\t\t\tm_FirstExtension = newExt;\n\t\t\tcurExt = m_FirstExtension;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcurExt->setNextHeader(newExt);\n\t\t\tcurExt = curExt->getNextHeader();\n\t\t}\n\n\t\toffset += newExt->getExtensionLen();\n\t\tnextHdr = newExt->getBaseHeader()->nextHeader;\n\t\tm_ExtensionsLen += newExt->getExtensionLen();\n\t}\n\n\tm_LastExtension = curExt;\n}\n\nvoid IPv6Layer::deleteExtensions()\n{\n\tIPv6Extension* curExt = m_FirstExtension;\n\twhile (curExt != NULL)\n\t{\n\t\tIPv6Extension* tmpExt = curExt->getNextHeader();\n\t\tdelete curExt;\n\t\tcurExt = tmpExt;\n\t}\n\n\tm_FirstExtension = NULL;\n\tm_LastExtension = NULL;\n\tm_ExtensionsLen = 0;\n\n}\n\nsize_t IPv6Layer::getExtensionCount() const\n{\n\tsize_t extensionCount = 0;\n\n\tIPv6Extension* curExt = m_FirstExtension;\n\n\twhile (curExt != NULL)\n\t{\n\t\textensionCount++;\n\t\tcurExt = curExt->getNextHeader();\n\t}\n\n\treturn extensionCount;\n}\n\nvoid IPv6Layer::removeAllExtensions()\n{\n\tif (m_LastExtension != NULL)\n\t\tgetIPv6Header()->nextHeader = m_LastExtension->getBaseHeader()->nextHeader;\n\n\tshortenLayer((int)sizeof(ip6_hdr), m_ExtensionsLen);\n\n\tdeleteExtensions();\n}\n\nbool IPv6Layer::isFragment() const\n{\n\tIPv6FragmentationHeader* fragHdr = getExtensionOfType();\n\treturn (fragHdr != NULL);\n}\n\nvoid IPv6Layer::parseNextLayer()\n{\n\tsize_t headerLen = getHeaderLen();\n\n\tif (m_DataLen <= headerLen)\n\t\treturn;\n\n\tuint8_t* payload = m_Data + headerLen;\n\tsize_t payloadLen = m_DataLen - headerLen;\n\n\tuint8_t nextHdr;\n\tif (m_LastExtension != NULL)\n\t{\n\t\tif (m_LastExtension->getExtensionType() == IPv6Extension::IPv6Fragmentation)\n\t\t{\n\t\t\tm_NextLayer = new PayloadLayer(payload, payloadLen, this, m_Packet);\n\t\t\treturn;\n\t\t}\n\n\t\tnextHdr = m_LastExtension->getBaseHeader()->nextHeader;\n\t}\n\telse\n\t{\n\t\tnextHdr = getIPv6Header()->nextHeader;\n\t}\n\n\tswitch (nextHdr)\n\t{\n\tcase PACKETPP_IPPROTO_UDP:\n\t\tm_NextLayer = new UdpLayer(payload, payloadLen, this, m_Packet);\n\t\tbreak;\n\tcase PACKETPP_IPPROTO_TCP:\n\t\tm_NextLayer = TcpLayer::isDataValid(payload, payloadLen)\n\t\t\t? static_cast(new TcpLayer(payload, payloadLen, this, m_Packet))\n\t\t\t: static_cast(new PayloadLayer(payload, payloadLen, this, m_Packet));\n\t\tbreak;\n\tcase PACKETPP_IPPROTO_IPIP:\n\t{\n\t\tuint8_t ipVersion = *payload >> 4;\n\t\tif (ipVersion == 4 && IPv4Layer::isDataValid(payload, payloadLen))\n\t\t\tm_NextLayer = new IPv4Layer(payload, payloadLen, this, m_Packet);\n\t\telse if (ipVersion == 6 && IPv6Layer::isDataValid(payload, payloadLen))\n\t\t\tm_NextLayer = new IPv6Layer(payload, payloadLen, this, m_Packet);\n\t\telse\n\t\t\tm_NextLayer = new PayloadLayer(payload, payloadLen, this, m_Packet);\n\t\tbreak;\n\t}\n\tcase PACKETPP_IPPROTO_GRE:\n\t{\n\t\tProtocolType greVer = GreLayer::getGREVersion(payload, payloadLen);\n\t\tif (greVer == GREv0)\n\t\t\tm_NextLayer = new GREv0Layer(payload, payloadLen, this, m_Packet);\n\t\telse if (greVer == GREv1)\n\t\t\tm_NextLayer = new GREv1Layer(payload, payloadLen, this, m_Packet);\n\t\telse\n\t\t\tm_NextLayer = new PayloadLayer(payload, payloadLen, this, m_Packet);\n\t\tbreak;\n\t}\n\tdefault:\n\t\tm_NextLayer = new PayloadLayer(payload, payloadLen, this, m_Packet);\n\t\treturn;\n\t}\n}\n\nvoid IPv6Layer::computeCalculateFields()\n{\n\tip6_hdr* ipHdr = getIPv6Header();\n\tipHdr->payloadLength = htobe16(m_DataLen - sizeof(ip6_hdr));\n\tipHdr->ipVersion = (6 & 0x0f);\n\n\tif (m_NextLayer != NULL)\n\t{\n\t\tuint8_t nextHeader = 0;\n\t\tswitch (m_NextLayer->getProtocol())\n\t\t{\n\t\tcase TCP:\n\t\t\tnextHeader = PACKETPP_IPPROTO_TCP;\n\t\t\tbreak;\n\t\tcase UDP:\n\t\t\tnextHeader = PACKETPP_IPPROTO_UDP;\n\t\t\tbreak;\n\t\tcase ICMP:\n\t\t\tnextHeader = PACKETPP_IPPROTO_ICMP;\n\t\t\tbreak;\n\t\tcase GRE:\n\t\t\tnextHeader = PACKETPP_IPPROTO_GRE;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t\tif (nextHeader != 0)\n\t\t{\n\t\t\tif (m_LastExtension != NULL)\n\t\t\t\tm_LastExtension->getBaseHeader()->nextHeader = nextHeader;\n\t\t\telse\n\t\t\t\tipHdr->nextHeader = nextHeader;\n\t\t}\n\t}\n}\n\nstd::string IPv6Layer::toString() const\n{\n\tstd::string result = \"IPv6 Layer, Src: \" + getSrcIpAddress().toString() + \", Dst: \" + getDstIpAddress().toString();\n\tif (m_ExtensionsLen > 0)\n\t{\n\t\tresult += \", Options=[\";\n\t\tIPv6Extension* curExt = m_FirstExtension;\n\t\twhile (curExt != NULL)\n\t\t{\n\t\t\tswitch (curExt->getExtensionType())\n\t\t\t{\n\t\t\tcase IPv6Extension::IPv6Fragmentation:\n\t\t\t\tresult += \"Fragment,\";\n\t\t\t\tbreak;\n\t\t\tcase IPv6Extension::IPv6HopByHop:\n\t\t\t\tresult += \"Hop-By-Hop,\";\n\t\t\t\tbreak;\n\t\t\tcase IPv6Extension::IPv6Destination:\n\t\t\t\tresult += \"Destination,\";\n\t\t\t\tbreak;\n\t\t\tcase IPv6Extension::IPv6Routing:\n\t\t\t\tresult += \"Routing,\";\n\t\t\t\tbreak;\n\t\t\tcase IPv6Extension::IPv6AuthenticationHdr:\n\t\t\t\tresult += \"Authentication,\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tresult += \"Unknown,\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcurExt = curExt->getNextHeader();\n\t\t}\n\n\t\t// replace the last ','\n\t\tresult[result.size() - 1] = ']';\n\t}\n\n\treturn result;\n}\n\n}// namespace pcpp\n"} {"text": "\n\n\n\n CFBundleDevelopmentRegion\n en\n CFBundleExecutable\n ${EXECUTABLE_NAME}\n CFBundleIdentifier\n ${PRODUCT_BUNDLE_IDENTIFIER}\n CFBundleInfoDictionaryVersion\n 6.0\n CFBundleName\n ${PRODUCT_NAME}\n CFBundlePackageType\n FMWK\n CFBundleShortVersionString\n 4.1.0\n CFBundleSignature\n ????\n CFBundleVersion\n ${CURRENT_PROJECT_VERSION}\n NSPrincipalClass\n \n\n\n"} {"text": "// SPDX-License-Identifier: GPL-2.0-only\n/*\n * Copyright (C) 2016 Red Hat\n * Author: Rob Clark \n */\n\n#include \"mdp5_kms.h\"\n\nint mdp5_pipe_assign(struct drm_atomic_state *s, struct drm_plane *plane,\n\t\t uint32_t caps, uint32_t blkcfg,\n\t\t struct mdp5_hw_pipe **hwpipe,\n\t\t struct mdp5_hw_pipe **r_hwpipe)\n{\n\tstruct msm_drm_private *priv = s->dev->dev_private;\n\tstruct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(priv->kms));\n\tstruct mdp5_global_state *new_global_state, *old_global_state;\n\tstruct mdp5_hw_pipe_state *old_state, *new_state;\n\tint i, j;\n\n\tnew_global_state = mdp5_get_global_state(s);\n\tif (IS_ERR(new_global_state))\n\t\treturn PTR_ERR(new_global_state);\n\n\t/* grab old_state after mdp5_get_global_state(), since now we hold lock: */\n\told_global_state = mdp5_get_existing_global_state(mdp5_kms);\n\n\told_state = &old_global_state->hwpipe;\n\tnew_state = &new_global_state->hwpipe;\n\n\tfor (i = 0; i < mdp5_kms->num_hwpipes; i++) {\n\t\tstruct mdp5_hw_pipe *cur = mdp5_kms->hwpipes[i];\n\n\t\t/* skip if already in-use.. check both new and old state,\n\t\t * since we cannot immediately re-use a pipe that is\n\t\t * released in the current update in some cases:\n\t\t * (1) mdp5 can have SMP (non-double-buffered)\n\t\t * (2) hw pipe previously assigned to different CRTC\n\t\t * (vblanks might not be aligned)\n\t\t */\n\t\tif (new_state->hwpipe_to_plane[cur->idx] ||\n\t\t\t\told_state->hwpipe_to_plane[cur->idx])\n\t\t\tcontinue;\n\n\t\t/* skip if doesn't support some required caps: */\n\t\tif (caps & ~cur->caps)\n\t\t\tcontinue;\n\n\t\t/*\n\t\t * don't assign a cursor pipe to a plane that isn't going to\n\t\t * be used as a cursor\n\t\t */\n\t\tif (cur->caps & MDP_PIPE_CAP_CURSOR &&\n\t\t\t\tplane->type != DRM_PLANE_TYPE_CURSOR)\n\t\t\tcontinue;\n\n\t\t/* possible candidate, take the one with the\n\t\t * fewest unneeded caps bits set:\n\t\t */\n\t\tif (!(*hwpipe) || (hweight_long(cur->caps & ~caps) <\n\t\t\t\t hweight_long((*hwpipe)->caps & ~caps))) {\n\t\t\tbool r_found = false;\n\n\t\t\tif (r_hwpipe) {\n\t\t\t\tfor (j = i + 1; j < mdp5_kms->num_hwpipes;\n\t\t\t\t j++) {\n\t\t\t\t\tstruct mdp5_hw_pipe *r_cur =\n\t\t\t\t\t\t\tmdp5_kms->hwpipes[j];\n\n\t\t\t\t\t/* reject different types of hwpipes */\n\t\t\t\t\tif (r_cur->caps != cur->caps)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t/* respect priority, eg. VIG0 > VIG1 */\n\t\t\t\t\tif (cur->pipe > r_cur->pipe)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t*r_hwpipe = r_cur;\n\t\t\t\t\tr_found = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!r_hwpipe || r_found)\n\t\t\t\t*hwpipe = cur;\n\t\t}\n\t}\n\n\tif (!(*hwpipe))\n\t\treturn -ENOMEM;\n\n\tif (r_hwpipe && !(*r_hwpipe))\n\t\treturn -ENOMEM;\n\n\tif (mdp5_kms->smp) {\n\t\tint ret;\n\n\t\t/* We don't support SMP and 2 hwpipes/plane together */\n\t\tWARN_ON(r_hwpipe);\n\n\t\tDBG(\"%s: alloc SMP blocks\", (*hwpipe)->name);\n\t\tret = mdp5_smp_assign(mdp5_kms->smp, &new_global_state->smp,\n\t\t\t\t(*hwpipe)->pipe, blkcfg);\n\t\tif (ret)\n\t\t\treturn -ENOMEM;\n\n\t\t(*hwpipe)->blkcfg = blkcfg;\n\t}\n\n\tDBG(\"%s: assign to plane %s for caps %x\",\n\t\t\t(*hwpipe)->name, plane->name, caps);\n\tnew_state->hwpipe_to_plane[(*hwpipe)->idx] = plane;\n\n\tif (r_hwpipe) {\n\t\tDBG(\"%s: assign to right of plane %s for caps %x\",\n\t\t (*r_hwpipe)->name, plane->name, caps);\n\t\tnew_state->hwpipe_to_plane[(*r_hwpipe)->idx] = plane;\n\t}\n\n\treturn 0;\n}\n\nvoid mdp5_pipe_release(struct drm_atomic_state *s, struct mdp5_hw_pipe *hwpipe)\n{\n\tstruct msm_drm_private *priv = s->dev->dev_private;\n\tstruct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(priv->kms));\n\tstruct mdp5_global_state *state = mdp5_get_global_state(s);\n\tstruct mdp5_hw_pipe_state *new_state = &state->hwpipe;\n\n\tif (!hwpipe)\n\t\treturn;\n\n\tif (WARN_ON(!new_state->hwpipe_to_plane[hwpipe->idx]))\n\t\treturn;\n\n\tDBG(\"%s: release from plane %s\", hwpipe->name,\n\t\tnew_state->hwpipe_to_plane[hwpipe->idx]->name);\n\n\tif (mdp5_kms->smp) {\n\t\tDBG(\"%s: free SMP blocks\", hwpipe->name);\n\t\tmdp5_smp_release(mdp5_kms->smp, &state->smp, hwpipe->pipe);\n\t}\n\n\tnew_state->hwpipe_to_plane[hwpipe->idx] = NULL;\n}\n\nvoid mdp5_pipe_destroy(struct mdp5_hw_pipe *hwpipe)\n{\n\tkfree(hwpipe);\n}\n\nstruct mdp5_hw_pipe *mdp5_pipe_init(enum mdp5_pipe pipe,\n\t\tuint32_t reg_offset, uint32_t caps)\n{\n\tstruct mdp5_hw_pipe *hwpipe;\n\n\thwpipe = kzalloc(sizeof(*hwpipe), GFP_KERNEL);\n\tif (!hwpipe)\n\t\treturn ERR_PTR(-ENOMEM);\n\n\thwpipe->name = pipe2name(pipe);\n\thwpipe->pipe = pipe;\n\thwpipe->reg_offset = reg_offset;\n\thwpipe->caps = caps;\n\thwpipe->flush_mask = mdp_ctl_flush_mask_pipe(pipe);\n\n\treturn hwpipe;\n}\n"} {"text": "/*\nSyntax highlighting with language autodetection.\nhttps://highlightjs.org/\n*/\n\n(function(factory) {\n\n // Setup highlight.js for different environments. First is Node.js or\n // CommonJS.\n if(typeof exports !== 'undefined') {\n factory(exports);\n } else {\n // Export hljs globally even when using AMD for cases when this script\n // is loaded with others that may still expect a global hljs.\n self.hljs = factory({});\n\n // Finally register the global hljs with AMD.\n if(typeof define === 'function' && define.amd) {\n define('hljs', [], function() {\n return self.hljs;\n });\n }\n }\n\n}(function(hljs) {\n\n /* Utility functions */\n\n function escape(value) {\n return value.replace(/&/gm, '&').replace(//gm, '>');\n }\n\n function tag(node) {\n return node.nodeName.toLowerCase();\n }\n\n function testRe(re, lexeme) {\n var match = re && re.exec(lexeme);\n return match && match.index == 0;\n }\n\n function isNotHighlighted(language) {\n return (/^(no-?highlight|plain|text)$/i).test(language);\n }\n\n function blockLanguage(block) {\n var i, match, length,\n classes = block.className + ' ';\n\n classes += block.parentNode ? block.parentNode.className : '';\n\n // language-* takes precedence over non-prefixed class names\n match = (/\\blang(?:uage)?-([\\w-]+)\\b/i).exec(classes);\n if (match) {\n return getLanguage(match[1]) ? match[1] : 'no-highlight';\n }\n\n classes = classes.split(/\\s+/);\n for (i = 0, length = classes.length; i < length; i++) {\n if (getLanguage(classes[i]) || isNotHighlighted(classes[i])) {\n return classes[i];\n }\n }\n }\n\n function inherit(parent, obj) {\n var result = {}, key;\n for (key in parent)\n result[key] = parent[key];\n if (obj)\n for (key in obj)\n result[key] = obj[key];\n return result;\n }\n\n /* Stream merging */\n\n function nodeStream(node) {\n var result = [];\n (function _nodeStream(node, offset) {\n for (var child = node.firstChild; child; child = child.nextSibling) {\n if (child.nodeType == 3)\n offset += child.nodeValue.length;\n else if (child.nodeType == 1) {\n result.push({\n event: 'start',\n offset: offset,\n node: child\n });\n offset = _nodeStream(child, offset);\n // Prevent void elements from having an end tag that would actually\n // double them in the output. There are more void elements in HTML\n // but we list only those realistically expected in code display.\n if (!tag(child).match(/br|hr|img|input/)) {\n result.push({\n event: 'stop',\n offset: offset,\n node: child\n });\n }\n }\n }\n return offset;\n })(node, 0);\n return result;\n }\n\n function mergeStreams(original, highlighted, value) {\n var processed = 0;\n var result = '';\n var nodeStack = [];\n\n function selectStream() {\n if (!original.length || !highlighted.length) {\n return original.length ? original : highlighted;\n }\n if (original[0].offset != highlighted[0].offset) {\n return (original[0].offset < highlighted[0].offset) ? original : highlighted;\n }\n\n /*\n To avoid starting the stream just before it should stop the order is\n ensured that original always starts first and closes last:\n\n if (event1 == 'start' && event2 == 'start')\n return original;\n if (event1 == 'start' && event2 == 'stop')\n return highlighted;\n if (event1 == 'stop' && event2 == 'start')\n return original;\n if (event1 == 'stop' && event2 == 'stop')\n return highlighted;\n\n ... which is collapsed to:\n */\n return highlighted[0].event == 'start' ? original : highlighted;\n }\n\n function open(node) {\n function attr_str(a) {return ' ' + a.nodeName + '=\"' + escape(a.value) + '\"';}\n result += '<' + tag(node) + Array.prototype.map.call(node.attributes, attr_str).join('') + '>';\n }\n\n function close(node) {\n result += '';\n }\n\n function render(event) {\n (event.event == 'start' ? open : close)(event.node);\n }\n\n while (original.length || highlighted.length) {\n var stream = selectStream();\n result += escape(value.substr(processed, stream[0].offset - processed));\n processed = stream[0].offset;\n if (stream == original) {\n /*\n On any opening or closing tag of the original markup we first close\n the entire highlighted node stack, then render the original tag along\n with all the following original tags at the same offset and then\n reopen all the tags on the highlighted stack.\n */\n nodeStack.reverse().forEach(close);\n do {\n render(stream.splice(0, 1)[0]);\n stream = selectStream();\n } while (stream == original && stream.length && stream[0].offset == processed);\n nodeStack.reverse().forEach(open);\n } else {\n if (stream[0].event == 'start') {\n nodeStack.push(stream[0].node);\n } else {\n nodeStack.pop();\n }\n render(stream.splice(0, 1)[0]);\n }\n }\n return result + escape(value.substr(processed));\n }\n\n /* Initialization */\n\n function compileLanguage(language) {\n\n function reStr(re) {\n return (re && re.source) || re;\n }\n\n function langRe(value, global) {\n return new RegExp(\n reStr(value),\n 'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : '')\n );\n }\n\n function compileMode(mode, parent) {\n if (mode.compiled)\n return;\n mode.compiled = true;\n\n mode.keywords = mode.keywords || mode.beginKeywords;\n if (mode.keywords) {\n var compiled_keywords = {};\n\n var flatten = function(className, str) {\n if (language.case_insensitive) {\n str = str.toLowerCase();\n }\n str.split(' ').forEach(function(kw) {\n var pair = kw.split('|');\n compiled_keywords[pair[0]] = [className, pair[1] ? Number(pair[1]) : 1];\n });\n };\n\n if (typeof mode.keywords == 'string') { // string\n flatten('keyword', mode.keywords);\n } else {\n Object.keys(mode.keywords).forEach(function (className) {\n flatten(className, mode.keywords[className]);\n });\n }\n mode.keywords = compiled_keywords;\n }\n mode.lexemesRe = langRe(mode.lexemes || /\\b\\w+\\b/, true);\n\n if (parent) {\n if (mode.beginKeywords) {\n mode.begin = '\\\\b(' + mode.beginKeywords.split(' ').join('|') + ')\\\\b';\n }\n if (!mode.begin)\n mode.begin = /\\B|\\b/;\n mode.beginRe = langRe(mode.begin);\n if (!mode.end && !mode.endsWithParent)\n mode.end = /\\B|\\b/;\n if (mode.end)\n mode.endRe = langRe(mode.end);\n mode.terminator_end = reStr(mode.end) || '';\n if (mode.endsWithParent && parent.terminator_end)\n mode.terminator_end += (mode.end ? '|' : '') + parent.terminator_end;\n }\n if (mode.illegal)\n mode.illegalRe = langRe(mode.illegal);\n if (mode.relevance === undefined)\n mode.relevance = 1;\n if (!mode.contains) {\n mode.contains = [];\n }\n var expanded_contains = [];\n mode.contains.forEach(function(c) {\n if (c.variants) {\n c.variants.forEach(function(v) {expanded_contains.push(inherit(c, v));});\n } else {\n expanded_contains.push(c == 'self' ? mode : c);\n }\n });\n mode.contains = expanded_contains;\n mode.contains.forEach(function(c) {compileMode(c, mode);});\n\n if (mode.starts) {\n compileMode(mode.starts, parent);\n }\n\n var terminators =\n mode.contains.map(function(c) {\n return c.beginKeywords ? '\\\\.?(' + c.begin + ')\\\\.?' : c.begin;\n })\n .concat([mode.terminator_end, mode.illegal])\n .map(reStr)\n .filter(Boolean);\n mode.terminators = terminators.length ? langRe(terminators.join('|'), true) : {exec: function(/*s*/) {return null;}};\n }\n\n compileMode(language);\n }\n\n /*\n Core highlighting function. Accepts a language name, or an alias, and a\n string with the code to highlight. Returns an object with the following\n properties:\n\n - relevance (int)\n - value (an HTML string with highlighting markup)\n\n */\n function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage == 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }\n\n /*\n Highlighting with language detection. Accepts a string with the code to\n highlight. Returns an object with the following properties:\n\n - language (detected language)\n - relevance (int)\n - value (an HTML string with highlighting markup)\n - second_best (object with the same structure for second-best heuristically\n detected language, may be absent)\n\n */\n function highlightAuto(text, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n var result = {\n relevance: 0,\n value: escape(text)\n };\n var second_best = result;\n languageSubset.forEach(function(name) {\n if (!getLanguage(name)) {\n return;\n }\n var current = highlight(name, text, false);\n current.language = name;\n if (current.relevance > second_best.relevance) {\n second_best = current;\n }\n if (current.relevance > result.relevance) {\n second_best = result;\n result = current;\n }\n });\n if (second_best.language) {\n result.second_best = second_best;\n }\n return result;\n }\n\n /*\n Post-processing of the highlighted markup:\n\n - replace TABs with something more useful\n - replace real line-breaks with '
' for non-pre containers\n\n */\n function fixMarkup(value) {\n if (options.tabReplace) {\n value = value.replace(/^((<[^>]+>|\\t)+)/gm, function(match, p1 /*..., offset, s*/) {\n return p1.replace(/\\t/g, options.tabReplace);\n });\n }\n if (options.useBR) {\n value = value.replace(/\\n/g, '
');\n }\n return value;\n }\n\n function buildClassName(prevClassName, currentLang, resultLang) {\n var language = currentLang ? aliases[currentLang] : resultLang,\n result = [prevClassName.trim()];\n\n if (!prevClassName.match(/\\bhljs\\b/)) {\n result.push('hljs');\n }\n\n if (prevClassName.indexOf(language) === -1) {\n result.push(language);\n }\n\n return result.join(' ').trim();\n }\n\n /*\n Applies highlighting to a DOM node containing code. Accepts a DOM node and\n two optional parameters for fixMarkup.\n */\n function highlightBlock(block) {\n var language = blockLanguage(block);\n if (isNotHighlighted(language))\n return;\n\n var node;\n if (options.useBR) {\n node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n node.innerHTML = block.innerHTML.replace(/\\n/g, '').replace(//g, '\\n');\n } else {\n node = block;\n }\n var text = node.textContent;\n var result = language ? highlight(language, text, true) : highlightAuto(text);\n\n var originalStream = nodeStream(node);\n if (originalStream.length) {\n var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n result.value = fixMarkup(result.value);\n\n block.innerHTML = result.value;\n block.className = buildClassName(block.className, language, result.language);\n block.result = {\n language: result.language,\n re: result.relevance\n };\n if (result.second_best) {\n block.second_best = {\n language: result.second_best.language,\n re: result.second_best.relevance\n };\n }\n }\n\n var options = {\n classPrefix: 'hljs-',\n tabReplace: null,\n useBR: false,\n languages: undefined\n };\n\n /*\n Updates highlight.js global options with values passed in the form of an object\n */\n function configure(user_options) {\n options = inherit(options, user_options);\n }\n\n /*\n Applies highlighting to all
..
blocks on a page.\n */\n function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }\n\n /*\n Attaches highlighting to the page load event.\n */\n function initHighlightingOnLoad() {\n addEventListener('DOMContentLoaded', initHighlighting, false);\n addEventListener('load', initHighlighting, false);\n }\n\n var languages = {};\n var aliases = {};\n\n function registerLanguage(name, language) {\n var lang = languages[name] = language(hljs);\n if (lang.aliases) {\n lang.aliases.forEach(function(alias) {aliases[alias] = name;});\n }\n }\n\n function listLanguages() {\n return Object.keys(languages);\n }\n\n function getLanguage(name) {\n name = (name || '').toLowerCase();\n return languages[name] || languages[aliases[name]];\n }\n\n /* Interface definition */\n\n hljs.highlight = highlight;\n hljs.highlightAuto = highlightAuto;\n hljs.fixMarkup = fixMarkup;\n hljs.highlightBlock = highlightBlock;\n hljs.configure = configure;\n hljs.initHighlighting = initHighlighting;\n hljs.initHighlightingOnLoad = initHighlightingOnLoad;\n hljs.registerLanguage = registerLanguage;\n hljs.listLanguages = listLanguages;\n hljs.getLanguage = getLanguage;\n hljs.inherit = inherit;\n\n // Common regexps\n hljs.IDENT_RE = '[a-zA-Z]\\\\w*';\n hljs.UNDERSCORE_IDENT_RE = '[a-zA-Z_]\\\\w*';\n hljs.NUMBER_RE = '\\\\b\\\\d+(\\\\.\\\\d+)?';\n hljs.C_NUMBER_RE = '(-?)(\\\\b0[xX][a-fA-F0-9]+|(\\\\b\\\\d+(\\\\.\\\\d*)?|\\\\.\\\\d+)([eE][-+]?\\\\d+)?)'; // 0x..., 0..., decimal, float\n hljs.BINARY_NUMBER_RE = '\\\\b(0b[01]+)'; // 0b...\n hljs.RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\\\*|\\\\*=|\\\\+|\\\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\\\?|\\\\[|\\\\{|\\\\(|\\\\^|\\\\^=|\\\\||\\\\|=|\\\\|\\\\||~';\n\n // Common modes\n hljs.BACKSLASH_ESCAPE = {\n begin: '\\\\\\\\[\\\\s\\\\S]', relevance: 0\n };\n hljs.APOS_STRING_MODE = {\n className: 'string',\n begin: '\\'', end: '\\'',\n illegal: '\\\\n',\n contains: [hljs.BACKSLASH_ESCAPE]\n };\n hljs.QUOTE_STRING_MODE = {\n className: 'string',\n begin: '\"', end: '\"',\n illegal: '\\\\n',\n contains: [hljs.BACKSLASH_ESCAPE]\n };\n hljs.PHRASAL_WORDS_MODE = {\n begin: /\\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|like)\\b/\n };\n hljs.COMMENT = function (begin, end, inherits) {\n var mode = hljs.inherit(\n {\n className: 'comment',\n begin: begin, end: end,\n contains: []\n },\n inherits || {}\n );\n mode.contains.push(hljs.PHRASAL_WORDS_MODE);\n mode.contains.push({\n className: 'doctag',\n begin: \"(?:TODO|FIXME|NOTE|BUG|XXX):\",\n relevance: 0\n });\n return mode;\n };\n hljs.C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$');\n hljs.C_BLOCK_COMMENT_MODE = hljs.COMMENT('/\\\\*', '\\\\*/');\n hljs.HASH_COMMENT_MODE = hljs.COMMENT('#', '$');\n hljs.NUMBER_MODE = {\n className: 'number',\n begin: hljs.NUMBER_RE,\n relevance: 0\n };\n hljs.C_NUMBER_MODE = {\n className: 'number',\n begin: hljs.C_NUMBER_RE,\n relevance: 0\n };\n hljs.BINARY_NUMBER_MODE = {\n className: 'number',\n begin: hljs.BINARY_NUMBER_RE,\n relevance: 0\n };\n hljs.CSS_NUMBER_MODE = {\n className: 'number',\n begin: hljs.NUMBER_RE + '(' +\n '%|em|ex|ch|rem' +\n '|vw|vh|vmin|vmax' +\n '|cm|mm|in|pt|pc|px' +\n '|deg|grad|rad|turn' +\n '|s|ms' +\n '|Hz|kHz' +\n '|dpi|dpcm|dppx' +\n ')?',\n relevance: 0\n };\n hljs.REGEXP_MODE = {\n className: 'regexp',\n begin: /\\//, end: /\\/[gimuy]*/,\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n {\n begin: /\\[/, end: /\\]/,\n relevance: 0,\n contains: [hljs.BACKSLASH_ESCAPE]\n }\n ]\n };\n hljs.TITLE_MODE = {\n className: 'title',\n begin: hljs.IDENT_RE,\n relevance: 0\n };\n hljs.UNDERSCORE_TITLE_MODE = {\n className: 'title',\n begin: hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n };\n\n return hljs;\n}));\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 UI_ACCESSIBILITY_AX_ACTION_HANDLER_H_\n#define UI_ACCESSIBILITY_AX_ACTION_HANDLER_H_\n\n#include \"ui/accessibility/ax_export.h\"\n#include \"ui/accessibility/ax_tree_id.h\"\n\nnamespace ui {\n\nstruct AXActionData;\n\n// Classes that host an accessibility tree in the browser process that also wish\n// to become visible to accessibility clients (e.g. for relaying targets to\n// source accessibility trees), can subclass this class.\n//\n// Subclasses can use |tree_id| when annotating their |AXNodeData| for clients\n// to respond with the appropriate target node id.\nclass AX_EXPORT AXActionHandler {\n public:\n virtual ~AXActionHandler();\n\n // Handle an action from an accessibility client.\n virtual void PerformAction(const AXActionData& data) = 0;\n\n // Returns whether this handler expects points in pixels (true) or dips\n // (false) for data passed to |PerformAction|.\n virtual bool RequiresPerformActionPointInPixels() const;\n\n // A tree id appropriate for annotating events sent to an accessibility\n // client.\n const AXTreeID& ax_tree_id() const { return tree_id_; }\n\n protected:\n AXActionHandler();\n\n private:\n // Register or unregister this class with |AXTreeIDRegistry|.\n void UpdateActiveState(bool active);\n\n // Automatically assigned.\n AXTreeID tree_id_;\n};\n\n} // namespace ui\n\n#endif // UI_ACCESSIBILITY_AX_ACTION_HANDLER_H_\n"} {"text": "\n\n\n \n\n\n\nProvides a set of classes that monitor and track operational aspects of the Sphinx system.\n

\n\n\n"} {"text": "package ini\n\nimport (\n\t\"fmt\"\n)\n\nvar (\n\temptyRunes = []rune{}\n)\n\nfunc isSep(b []rune) bool {\n\tif len(b) == 0 {\n\t\treturn false\n\t}\n\n\tswitch b[0] {\n\tcase '[', ']':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nvar (\n\topenBrace = []rune(\"[\")\n\tcloseBrace = []rune(\"]\")\n)\n\nfunc newSepToken(b []rune) (Token, int, error) {\n\ttok := Token{}\n\n\tswitch b[0] {\n\tcase '[':\n\t\ttok = newToken(TokenSep, openBrace, NoneType)\n\tcase ']':\n\t\ttok = newToken(TokenSep, closeBrace, NoneType)\n\tdefault:\n\t\treturn tok, 0, NewParseError(fmt.Sprintf(\"unexpected sep type, %v\", b[0]))\n\t}\n\treturn tok, 1, nil\n}\n"} {"text": ".icon-block {\n padding-left: 15px;\n padding-right: 15px;\n padding-bottom: 25px;\n}\n\n.icon-block p {\n min-height: 150px;\n}\n\nmain h2 {\n margin-top: 0px;\n margin-bottom: 50px;\n}\n\n@media (max-width: 992px) {\n .icon-block p {\n min-height: 200px;\n }\n}\n\n@media (max-width: 600px) {\n .icon-block p {\n min-height: inherit;\n }\n}\n"} {"text": "import moment from 'moment';\n\nexport const getMomentChartLabelsAndData = () => {\n\tconst timingLabels = [];\n\tconst initData = [];\n\tconst today = moment().startOf('day');\n\tfor (let m = today; m.diff(moment(), 'hours') < 0; m.add(1, 'hours')) {\n\t\tconst hour = m.format('H');\n\t\ttimingLabels.push(`${ moment(hour, ['H']).format('hA') }-${ moment((parseInt(hour) + 1) % 24, ['H']).format('hA') }`);\n\t\tinitData.push(0);\n\t}\n\n\treturn [timingLabels, initData];\n};\n"} {"text": "package org.scalaide.core.internal.builder\n\nimport org.eclipse.core.resources.IResource\nimport org.eclipse.core.resources.IMarker\nimport org.scalaide.core.resources.MarkerFactory\nimport org.scalaide.core.resources.MarkerFactory.Position\nimport org.scalaide.core.resources.MarkerFactory.NoPosition\nimport org.scalaide.core.resources.MarkerFactory.RegionPosition\nimport org.scalaide.core.IScalaProject\nimport scala.reflect.internal.util.{ Position => ScalacPosition }\nimport org.scalaide.core.SdtConstants\n\n/** Factory for creating markers used to report build problems (i.e., compilation errors). */\nobject BuildProblemMarker extends MarkerFactory(SdtConstants.ProblemMarkerId) {\n /** Create a marker indicating an error state for the passed Scala `project`. */\n def create(project: IScalaProject, e: Throwable): Unit =\n create(project.underlying, \"Error in Scala compiler: \" + e.getMessage)\n\n /** Create a marker indicating an error state for the passed `resource`. */\n def create(resource: IResource, msg: String): Unit =\n create(resource, IMarker.SEVERITY_ERROR, msg)\n\n /** Create marker with a source position in the Problem view.\n * @param resource The resource to use to create the marker (hence, the marker will be associated to the passed resource)\n * @param severity Indicates the marker's error state. Its value can be one of:\n * [IMarker.SEVERITY_ERROR, IMarker.SEVERITY_WARNING, IMarker.SEVERITY_INFO]\n * @param msg The text message displayed by the marker. Note, the passed message is truncated to 21000 chars.\n * @param pos The source position for the marker.\n */\n def create(resource: IResource, severity: Int, msg: String, pos: ScalacPosition): Unit =\n create(resource, severity, msg, position(pos))\n\n private def position(pos: ScalacPosition): Position = {\n if (pos.isDefined) {\n val source = pos.source\n val length = source.identifier(pos).map(_.length).getOrElse(0)\n RegionPosition(pos.point, length, pos.line)\n } else NoPosition\n }\n}\n"} {"text": " '4123',\n 'numberSymbols' => \n array (\n 'decimal' => '.',\n 'group' => ',',\n 'list' => ';',\n 'percentSign' => '%',\n 'plusSign' => '+',\n 'minusSign' => '-',\n 'exponential' => 'E',\n 'perMille' => '‰',\n 'infinity' => '∞',\n 'nan' => 'NaN',\n 'alias' => '',\n ),\n 'decimalFormat' => '#,##0.###',\n 'scientificFormat' => '#E0',\n 'percentFormat' => '#,##0%',\n 'currencyFormat' => '¤ #,##0.00',\n 'currencySymbols' => \n array (\n 'AUD' => 'AU$',\n 'BRL' => 'BR$',\n 'CAD' => 'CA$',\n 'CNY' => 'CN¥',\n 'EUR' => '€',\n 'GBP' => '£',\n 'HKD' => 'HK$',\n 'ILS' => '₪',\n 'INR' => '₹',\n 'JPY' => 'JP¥',\n 'KRW' => '₩',\n 'MXN' => 'MX$',\n 'NZD' => 'NZ$',\n 'THB' => '฿',\n 'TWD' => 'NT$',\n 'USD' => 'US$',\n 'VND' => '₫',\n 'XAF' => 'FCFA',\n 'XCD' => 'EC$',\n 'XOF' => 'CFA',\n 'XPF' => 'CFPF',\n ),\n 'monthNames' => \n array (\n 'wide' => \n array (\n 1 => 'کانوونی دووەم',\n 2 => 'شوبات',\n 3 => 'ئازار',\n 4 => 'نیسان',\n 5 => 'ئایار',\n 6 => 'حوزەیران',\n 7 => 'تەمووز',\n 8 => 'ئاب',\n 9 => 'ئەیلوول',\n 10 => 'تشرینی یەکەم',\n 11 => 'تشرینی دووەم',\n 12 => 'کانونی یەکەم',\n ),\n 'abbreviated' => \n array (\n 1 => 'کانوونی دووەم',\n 2 => 'شوبات',\n 3 => 'ئازار',\n 4 => 'نیسان',\n 5 => 'ئایار',\n 6 => 'حوزەیران',\n 7 => 'تەمووز',\n 8 => 'ئاب',\n 9 => 'ئەیلوول',\n 10 => 'تشرینی یەکەم',\n 11 => 'تشرینی دووەم',\n 12 => 'کانونی یەکەم',\n ),\n 'narrow' => \n array (\n 12 => 'D',\n ),\n ),\n 'monthNamesSA' => \n array (\n 'narrow' => \n array (\n 1 => '1',\n 2 => '2',\n 3 => '3',\n 4 => '4',\n 5 => '5',\n 6 => '6',\n 7 => '7',\n 8 => '8',\n 9 => '9',\n 10 => '10',\n 11 => '11',\n 12 => 'D',\n ),\n 'abbreviated' => \n array (\n 1 => 'کانوونی دووەم',\n 2 => 'شوبات',\n 3 => 'ئازار',\n 4 => 'نیسان',\n 5 => 'ئایار',\n 6 => 'حوزەیران',\n 7 => 'تەمووز',\n 8 => 'ئاب',\n 9 => 'ئەیلوول',\n 10 => 'تشرینی یەکەم',\n 11 => 'تشرینی دووەم',\n 12 => 'کانونی یەکەم',\n ),\n 'wide' => \n array (\n 1 => 'کانوونی دووەم',\n 2 => 'شوبات',\n 3 => 'ئازار',\n 4 => 'نیسان',\n 5 => 'ئایار',\n 6 => 'حوزەیران',\n 7 => 'تەمووز',\n 8 => 'ئاب',\n 9 => 'ئەیلوول',\n 10 => 'تشرینی یەکەم',\n 11 => 'تشرینی دووەم',\n 12 => 'کانونی یەکەم',\n ),\n ),\n 'weekDayNames' => \n array (\n 'wide' => \n array (\n 0 => 'یەکشەممە',\n 1 => 'دووشەممە',\n 2 => 'سێشەممە',\n 3 => 'چوارشەممە',\n 4 => 'پێنجشەممە',\n 5 => 'ھەینی',\n 6 => 'شەممە',\n ),\n 'abbreviated' => \n array (\n 0 => 'یەکشەممە',\n 1 => 'دووشەممە',\n 2 => 'سێشەممە',\n 3 => 'چوارشەممە',\n 4 => 'پێنجشەممە',\n 5 => 'ھەینی',\n 6 => 'شەممە',\n ),\n 'narrow' => \n array (\n 0 => 'ی',\n 1 => 'د',\n 2 => 'س',\n 3 => 'چ',\n 4 => 'پ',\n 5 => 'ھ',\n 6 => 'ش',\n ),\n ),\n 'weekDayNamesSA' => \n array (\n 'narrow' => \n array (\n 0 => 'ی',\n 1 => 'د',\n 2 => 'س',\n 3 => 'چ',\n 4 => 'پ',\n 5 => 'ھ',\n 6 => 'ش',\n ),\n 'abbreviated' => \n array (\n 0 => 'یەکشەممە',\n 1 => 'دووشەممە',\n 2 => 'سێشەممە',\n 3 => 'چوارشەممە',\n 4 => 'پێنجشەممە',\n 5 => 'ھەینی',\n 6 => 'شەممە',\n ),\n 'wide' => \n array (\n 0 => 'یەکشەممە',\n 1 => 'دووشەممە',\n 2 => 'سێشەممە',\n 3 => 'چوارشەممە',\n 4 => 'پێنجشەممە',\n 5 => 'ھەینی',\n 6 => 'شەممە',\n ),\n ),\n 'eraNames' => \n array (\n 'abbreviated' => \n array (\n 0 => 'پێش زاییین',\n 1 => 'ز',\n ),\n 'wide' => \n array (\n 0 => 'پێش زایین',\n 1 => 'زایینی',\n ),\n 'narrow' => \n array (\n 0 => 'پ.ن',\n 1 => 'ز',\n ),\n ),\n 'dateFormats' => \n array (\n 'full' => 'EEEE, y MMMM dd',\n 'long' => 'dی MMMMی y',\n 'medium' => 'y MMM d',\n 'short' => 'yyyy-MM-dd',\n ),\n 'timeFormats' => \n array (\n 'full' => 'HH:mm:ss zzzz',\n 'long' => 'HH:mm:ss z',\n 'medium' => 'HH:mm:ss',\n 'short' => 'HH:mm',\n ),\n 'dateTimeFormat' => '{1} {0}',\n 'amName' => 'ب.ن',\n 'pmName' => 'د.ن',\n 'orientation' => 'rtl',\n 'languages' => \n array (\n 'af' => 'ئه‌فریكای',\n 'am' => 'ئه‌مهه‌رینجی',\n 'ar' => 'عەرەبی',\n 'as' => 'ئا سسامی (زوبان)',\n 'az' => 'ئازه‌ربایجانی',\n 'be' => 'بێلاڕووسی',\n 'bg' => 'بۆلگاری',\n 'bh' => 'بیهاری',\n 'bn' => 'به‌نگلادێشی',\n 'br' => 'برێتونی',\n 'bs' => 'بۆسنی',\n 'ca' => 'كاتالۆنی',\n 'cs' => 'چه‌كی',\n 'cy' => 'وێلزی',\n 'da' => 'دانماركی',\n 'de' => 'ئاڵمانی',\n 'el' => 'یۆنانی',\n 'en' => 'ئینگلیزی',\n 'en_au' => 'ئینگلیزیی ئۆسترالیایی',\n 'en_ca' => 'ئینگلیزیی کەنەدایی',\n 'en_gb' => 'ئینگلیزیی بریتانیایی',\n 'en_us' => 'ئینگلیزیی ئەمەریکایی',\n 'eo' => 'ئێسپیرانتۆ',\n 'es' => 'ئیسپانی',\n 'et' => 'ئیستۆنی',\n 'eu' => 'باسکی',\n 'fa' => 'فارسی',\n 'fi' => 'فینله‌ندی',\n 'fil' => 'تاگالۆگی',\n 'fo' => 'فه‌رئۆیی',\n 'fr' => 'فه‌رانسی',\n 'fy' => 'فریسی',\n 'ga' => 'ئیرله‌ندی',\n 'gd' => 'گه‌لیكی سكۆتله‌ندی',\n 'gl' => 'گالیسی',\n 'gn' => 'گووارانی',\n 'gu' => 'گوجاراتی',\n 'he' => 'هیبرێ',\n 'hi' => 'هیندی',\n 'hr' => 'كرواتی',\n 'hu' => 'هه‌نگاری (مه‌جاری)',\n 'hy' => 'ئەرمەنی',\n 'ia' => 'ئینترلینگوی',\n 'id' => 'ئێه‌ندونیزی',\n 'ie' => 'ئینتەرلیگ',\n 'is' => 'ئیسله‌ندی',\n 'it' => 'ئیتالی',\n 'ja' => 'ژاپۆنی',\n 'jv' => 'جاڤانی',\n 'ka' => 'گۆرجستانی',\n 'kk' => 'کازاخی',\n 'km' => 'کامبۆجی (زوبان)',\n 'kn' => 'كه‌نه‌دایی',\n 'ko' => 'كۆری',\n 'ku' => 'کوردی',\n 'ky' => 'كرگیزی',\n 'la' => 'لاتینی',\n 'ln' => 'لينگالا',\n 'lo' => 'لاو‏ى',\n 'lt' => 'لیتوانی',\n 'lv' => 'لێتۆنی',\n 'mk' => 'ماكێدۆنی',\n 'ml' => 'مالایلام',\n 'mn' => 'مەنگۆلی',\n 'mr' => 'ماراتی',\n 'ms' => 'مالیزی',\n 'mt' => 'ماڵتایی',\n 'ne' => 'نیپالی',\n 'nl' => 'هۆڵه‌ندی',\n 'no' => 'نۆروێژی',\n 'oc' => 'ئۆسیتانی',\n 'or' => 'ئۆرییا',\n 'pa' => 'په‌نجابی',\n 'pl' => 'پۆڵۆنیایی (له‌هستانی)',\n 'ps' => 'پەشتوو',\n 'pt' => 'پورتوگالی',\n 'pt_br' => 'پورتوگاڵی (برازیل)',\n 'pt_pt' => 'پورتوگاڵی (پورتوگاڵ)',\n 'ro' => 'ڕۆمانی',\n 'ru' => 'ڕووسی',\n 'sa' => 'سانسکريت',\n 'sd' => 'سيندی(زوبان)',\n 'sh' => 'سێربۆكرواتی',\n 'si' => 'سینهه‌لی',\n 'sk' => 'سلۆڤاكی',\n 'sl' => 'سلۆڤێنی',\n 'so' => 'سۆمالی',\n 'sq' => 'ئاڵبانی',\n 'sr' => 'سه‌ربی',\n 'st' => 'سێسۆتۆ',\n 'su' => 'سودانی',\n 'sv' => 'سویدی',\n 'sw' => 'سواهیلی',\n 'ta' => 'تامیلی',\n 'te' => 'ته‌لۆگوی',\n 'tg' => 'تاجیکی',\n 'th' => 'تایله‌ندی',\n 'ti' => 'تیگرینیای',\n 'tk' => 'تورکمانی',\n 'tlh' => 'كلینگۆن',\n 'tr' => 'تورکی',\n 'tw' => 'توی',\n 'ug' => 'ئويخووری',\n 'uk' => 'ئۆكراینی',\n 'und' => 'زمانی نەناسراو',\n 'ur' => 'ئۆردو‌و',\n 'uz' => 'ئوزبەکی',\n 'vi' => 'ڤیەتنامی',\n 'xh' => 'سسوسا',\n 'yi' => 'یوددی',\n 'zh' => 'چینی',\n 'zu' => 'زولو',\n ),\n 'scripts' => \n array (\n 'arab' => 'عەرەبی',\n 'armn' => 'ئەرمەنی',\n 'beng' => 'بەنگالی',\n 'bopo' => 'بۆپۆمۆفۆ',\n 'brai' => 'برەیل',\n 'cyrl' => 'سریلیک',\n 'deva' => 'دەڤەناگەری',\n 'ethi' => 'ئەتیۆپیک',\n 'geor' => 'گورجی',\n 'grek' => 'یۆنانی',\n 'gujr' => 'گوجەراتی',\n 'guru' => 'گورموکھی',\n 'hang' => 'ھانگول',\n 'hani' => 'ھان',\n 'hans' => 'چینیی ئاسانکراو',\n 'hant' => 'چینیی دێرین',\n 'hebr' => 'عیبری',\n 'hira' => 'ھیراگانا',\n 'jpan' => 'ژاپۆنی',\n 'kana' => 'کاتاکانا',\n 'khmr' => 'خمێری',\n 'knda' => 'کەنەدا',\n 'kore' => 'کۆریایی',\n 'laoo' => 'لاو',\n 'latn' => 'لاتینی',\n 'mlym' => 'مالایالام',\n 'mong' => 'مەنگۆلی',\n 'mymr' => 'میانمار',\n 'orya' => 'ئۆریا',\n 'sinh' => 'سینھالا',\n 'taml' => 'تامیلی',\n 'telu' => 'تیلوگو',\n 'thaa' => 'تانە',\n 'thai' => 'تایلەندی',\n 'zxxx' => 'نەنووسراو',\n 'zzzz' => 'خەتی نەناسراو',\n ),\n 'territories' => \n array (\n '002' => 'ئەفریقا',\n '003' => 'ئەمەریکای باکوور',\n '005' => 'ئەمەریکای باشوور',\n '009' => 'ئۆقیانووسیا',\n '011' => 'ڕۆژاوای ئەفریقا',\n '013' => 'ئەمریکای ناوەڕاست',\n '014' => 'ڕۆژھەڵاتی ئەفریقا',\n '018' => 'باشووری ئەفریقا',\n '019' => 'ئەمریکاکان',\n '021' => 'ئەمریکای باکوور',\n '030' => 'ئاسیای ڕۆژھەڵات',\n '034' => 'باشووری ئاسیا',\n '035' => 'باشووری ڕۆژھەڵاتی ئاسیا',\n '039' => 'باشووری ئەورووپا',\n '057' => 'ناوچەی مایکرۆنیزیا',\n 142 => 'ئاسیا',\n 143 => 'ئاسیای ناوەڕاست',\n 145 => 'ڕۆژاوای ئاسیا',\n 150 => 'ئەورووپا',\n 151 => 'ئەورووپای ڕۆژھەڵات',\n 154 => 'ئەورووپای باکوور',\n 155 => 'ڕۆژاوای ئەورووپا',\n 419 => 'ئەمەریکای لاتین',\n 'ad' => 'ئاندۆرا',\n 'ae' => 'میرنشینە یەکگرتووە عەرەبییەکان',\n 'af' => 'ئەفغانستان',\n 'ag' => 'ئانتیگوا و باربودا',\n 'al' => 'ئەڵبانیا',\n 'am' => 'ئەرمەنستان',\n 'ao' => 'ئەنگۆلا',\n 'aq' => 'ئانتارکتیکا',\n 'ar' => 'ئارجەنتینا',\n 'as' => 'ساموای ئەمەریکایی',\n 'at' => 'نەمسا',\n 'au' => 'ئۆسترالیا',\n 'aw' => 'ئارووبا',\n 'az' => 'ئازەربایجان',\n 'ba' => 'بۆسنیا و ھەرزەگۆڤینا',\n 'bb' => 'باربادۆس',\n 'bd' => 'بەنگلادیش',\n 'be' => 'بەلژیک',\n 'bf' => 'بورکینافاسۆ',\n 'bg' => 'بولگاریا',\n 'bh' => 'بەحرەین',\n 'bi' => 'بوروندی',\n 'bj' => 'بنین',\n 'bn' => 'بروونای',\n 'bo' => 'بۆلیڤیا',\n 'br' => 'برازیل',\n 'bs' => 'بەھاما',\n 'bt' => 'بووتان',\n 'bw' => 'بۆتسوانا',\n 'by' => 'بیلاڕووس',\n 'bz' => 'بەلیز',\n 'ca' => 'کانەدا',\n 'cd' => 'کۆماری دیموکراتیکی کۆنگۆ',\n 'cf' => 'کۆماری ئەفریقای ناوەڕاست',\n 'cg' => 'کۆماری کۆنگۆ',\n 'ch' => 'سویسرا',\n 'ci' => 'کۆتدیڤوار',\n 'cl' => 'شیلی',\n 'cm' => 'کامیروون',\n 'cn' => 'چین',\n 'co' => 'کۆلۆمبیا',\n 'cr' => 'کۆستاریکا',\n 'cu' => 'کووبا',\n 'cv' => 'کەیپڤەرد',\n 'cy' => 'قیبرس',\n 'cz' => 'کۆماری چیک',\n 'de' => 'ئەڵمانیا',\n 'dj' => 'جیبووتی',\n 'dk' => 'دانمارک',\n 'dm' => 'دۆمینیکا',\n 'dz' => 'ئەلجەزایر',\n 'ec' => 'ئیکوادۆر',\n 'eg' => 'میسر',\n 'eh' => 'ڕۆژاوای سەحرا',\n 'er' => 'ئەریتریا',\n 'es' => 'ئیسپانیا',\n 'et' => 'ئەتیۆپیا',\n 'eu' => 'یەکێتیی ئەورووپا',\n 'fi' => 'فینلاند',\n 'fj' => 'فیجی',\n 'fm' => 'مایکرۆنیزیا',\n 'fr' => 'فەڕەنسا',\n 'ga' => 'گابۆن',\n 'gb' => 'شانشینی یەکگرتوو',\n 'gd' => 'گرینادا',\n 'ge' => 'گورجستان',\n 'gh' => 'غەنا',\n 'gl' => 'گرینلاند',\n 'gm' => 'گامبیا',\n 'gn' => 'گینێ',\n 'gr' => 'یۆنان',\n 'gt' => 'گواتیمالا',\n 'gu' => 'گوام',\n 'gw' => 'گینێ بیساو',\n 'gy' => 'گویانا',\n 'hn' => 'ھۆندووراس',\n 'hr' => 'کرۆواتیا',\n 'ht' => 'ھایتی',\n 'hu' => 'مەجارستان',\n 'id' => 'ئیندۆنیزیا',\n 'ie' => 'ئیرلەند',\n 'il' => 'ئیسرائیل',\n 'in' => 'ھیندستان',\n 'iq' => 'عێراق',\n 'ir' => 'ئێران',\n 'is' => 'ئایسلەند',\n 'it' => 'ئیتاڵی',\n 'jm' => 'جامایکا',\n 'jo' => 'ئوردن',\n 'jp' => 'ژاپۆن',\n 'kg' => 'قرغیزستان',\n 'kh' => 'کەمبۆدیا',\n 'ki' => 'کیریباس',\n 'km' => 'دوورگەکانی قەمەر',\n 'kn' => 'سەینت کیتس و نیڤیس',\n 'kp' => 'کۆریای باکوور',\n 'kr' => 'کۆریای باشوور',\n 'kw' => 'کوەیت',\n 'kz' => 'کازاخستان',\n 'la' => 'لاوس',\n 'lb' => 'لوبنان',\n 'lc' => 'سەینت لووسیا',\n 'li' => 'لیختنشتاین',\n 'lk' => 'سریلانکا',\n 'lr' => 'لیبەریا',\n 'ls' => 'لەسۆتۆ',\n 'lt' => 'لیتوانایا',\n 'lu' => 'لوکسەمبورگ',\n 'lv' => 'لاتڤیا',\n 'ly' => 'لیبیا',\n 'ma' => 'مەغریب',\n 'mc' => 'مۆناکۆ',\n 'md' => 'مۆلدۆڤا',\n 'me' => 'مۆنتینیگرۆ',\n 'mg' => 'ماداگاسکار',\n 'mh' => 'دوورگەکانی مارشاڵ',\n 'ml' => 'مالی',\n 'mm' => 'میانمار',\n 'mn' => 'مەنگۆلیا',\n 'mo' => 'ماکاو',\n 'mr' => 'مۆریتانیا',\n 'mt' => 'ماڵتا',\n 'mv' => 'مالدیڤ',\n 'mw' => 'مالاوی',\n 'mx' => 'مەکسیک',\n 'my' => 'مالیزیا',\n 'mz' => 'مۆزامبیک',\n 'na' => 'نامیبیا',\n 'ne' => 'نیجەر',\n 'ni' => 'نیکاراگوا',\n 'nl' => 'ھۆڵەندا',\n 'no' => 'نۆرویژ',\n 'np' => 'نیپال',\n 'nr' => 'نائوروو',\n 'nz' => 'نیوزیلاند',\n 'om' => 'عومان',\n 'pa' => 'پاناما',\n 'pe' => 'پیروو',\n 'pg' => 'پاپوا گینێی نوێ',\n 'ph' => 'فلیپین',\n 'pk' => 'پاکستان',\n 'pl' => 'پۆڵەندا',\n 'ps' => 'فەلەستین',\n 'pt' => 'پورتوگال',\n 'pw' => 'پالاو',\n 'py' => 'پاراگوای',\n 'qa' => 'قەتەر',\n 'ro' => 'ڕۆمانیا',\n 'rs' => 'سربیا',\n 'ru' => 'ڕووسیا',\n 'rw' => 'ڕواندا',\n 'sa' => 'عەرەبستانی سەعوودی',\n 'sb' => 'دوورگەکانی سلێمان',\n 'sc' => 'سیشێل',\n 'sd' => 'سوودان',\n 'se' => 'سوید',\n 'sg' => 'سینگاپور',\n 'si' => 'سلۆڤێنیا',\n 'sk' => 'سلۆڤاکیا',\n 'sl' => 'سیەرالیۆن',\n 'sm' => 'سان مارینۆ',\n 'sn' => 'سینیگال',\n 'so' => 'سۆمالیا',\n 'sr' => 'سورینام',\n 'st' => 'ساوتۆمێ و پرینسیپی',\n 'sv' => 'ئێلسالڤادۆر',\n 'sy' => 'سووریا',\n 'sz' => 'سوازیلاند',\n 'td' => 'چاد',\n 'tg' => 'تۆگۆ',\n 'th' => 'تایلەند',\n 'tj' => 'تاجیکستان',\n 'tl' => 'تیمۆری ڕۆژھەڵات',\n 'tm' => 'تورکمانستان',\n 'tn' => 'توونس',\n 'to' => 'تۆنگا',\n 'tr' => 'تورکیا',\n 'tt' => 'ترینیداد و تۆباگو',\n 'tv' => 'تووڤالوو',\n 'tw' => 'تایوان',\n 'tz' => 'تانزانیا',\n 'ua' => 'ئۆکرانیا',\n 'ug' => 'ئوگاندا',\n 'us' => 'وڵاتە یەکگرتووەکان',\n 'uy' => 'ئوروگوای',\n 'uz' => 'ئوزبەکستان',\n 'va' => 'ڤاتیکان',\n 'vc' => 'سەینت ڤینسەنت و گرینادینز',\n 'vn' => 'ڤیەتنام',\n 'vu' => 'ڤانوواتوو',\n 'ws' => 'ساموا',\n 'ye' => 'یەمەن',\n 'za' => 'ئەفریقای باشوور',\n 'zm' => 'زامبیا',\n 'zw' => 'زیمبابوی',\n 'zz' => 'نەناسراو',\n ),\n 'pluralRules' => \n array (\n 0 => 'n==1',\n 1 => 'true',\n ),\n);\n"} {"text": "{\n \"type\": \"forge:ore_shapeless\",\n \"ingredients\": [\n {\n \"type\": \"forge:ore_dict\",\n \"ore\": \"ingotSilver\"\n },\n {\n \"type\": \"forge:ore_dict\",\n \"ore\": \"ingotSilver\"\n },\n {\n \"type\": \"forge:ore_dict\",\n \"ore\": \"ingotSilver\"\n },\n {\n \"type\": \"forge:ore_dict\",\n \"ore\": \"ingotSilver\"\n },\n {\n \"type\": \"forge:ore_dict\",\n \"ore\": \"ingotSilver\"\n },\n {\n \"type\": \"forge:ore_dict\",\n \"ore\": \"ingotSilver\"\n },\n {\n \"type\": \"forge:ore_dict\",\n \"ore\": \"ingotSilver\"\n },\n {\n \"type\": \"forge:ore_dict\",\n \"ore\": \"ingotSilver\"\n },\n {\n \"type\": \"forge:ore_dict\",\n \"ore\": \"ingotSilver\"\n }\n ],\n \"result\": {\n \"item\": \"iceandfire:silver_block\",\n \"data\": 0,\n \"count\": 1\n }\n}"} {"text": "{\n \"name\": \"SpryWare-MIS\",\n \"author\": \"Brendan Coles \",\n \"version\": \"0.1\",\n \"description\": \"SpryWare Market Information Server (MIS)\",\n \"website\": \"http://www.spryware.com/products_MIS.html\",\n \"matches\": [\n {\n \"search\": \"headers[server]\",\n \"regexp\": \"(?-mix:^SpryWare\\\\/([^\\\\s]+)$)\",\n \"offset\": 1\n },\n {\n \"search\": \"headers[x-deprecated-response]\",\n \"regexp\": \"(?-mix:^Invalid CheckSum Received$)\"\n }\n ]\n}\n"} {"text": "Silk icon set 1.3\n\n_________________________________________\nMark James\nhttp://www.famfamfam.com/lab/icons/silk/\n_________________________________________\n\nThis work is licensed under a\nCreative Commons Attribution 2.5 License.\n[ http://creativecommons.org/licenses/by/2.5/ ]\n\nThis means you may use it for any purpose,\nand make any changes you like.\nAll I ask is that you include a link back\nto this page in your credits.\n\nAre you using this icon set? Send me an email\n(including a link or picture if available) to\nmjames@gmail.com\n\nAny other questions about this icon set please\ncontact mjames@gmail.com"} {"text": "const spacingAlone = theme => ({\n spacing: theme.spacing.unit,\n});\n\nconst spacingMultiply = theme => ({\n spacing: theme.spacing.unit * 5,\n});\n\nconst spacingDivide = theme => ({\n spacing: theme.spacing.unit / 5,\n});\n\nconst spacingAdd = theme => ({\n spacing: theme.spacing.unit + 5,\n});\n\nconst spacingSubtract = theme => ({\n spacing: theme.spacing.unit - 5,\n});\n\nconst variable = 3;\n\nconst spacingVariable = theme => ({\n spacing: theme.spacing.unit * variable,\n});\n\nconst spacingParamNameChange = muiTheme => ({\n spacing: muiTheme.spacing.unit,\n});\n\nfunction styleFunction(theme) {\n return {\n spacing: theme.spacing.unit,\n };\n}\n\nconst theme = {};\nconst shouldntTouch = theme.spacing.unit;\n\nconst styles = muiTheme => ({ root: { spacing: muiTheme.spacing.unit } });\n\nconst longChain = theme => ({\n spacing: theme.spacing.unit * 5 * 5,\n});\n"} {"text": "/* XMRig\n * Copyright 2010 Jeff Garzik \n * Copyright 2012-2014 pooler \n * Copyright 2014 Lucas Jones \n * Copyright 2014-2016 Wolf9466 \n * Copyright 2016 Jay D Dee \n * Copyright 2017-2018 XMR-Stak , \n * Copyright 2018-2019 SChernykh \n * Copyright 2016-2019 XMRig , \n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\n\n#include \n#include \n#include \n#include \n#include \n#include \n\n\n#ifndef XMRIG_NO_TLS\n# include \n# include \n# include \"common/net/Tls.h\"\n#endif\n\n\n#include \"common/interfaces/IClientListener.h\"\n#include \"common/log/Log.h\"\n#include \"common/net/Client.h\"\n#include \"net/JobResult.h\"\n#include \"rapidjson/document.h\"\n#include \"rapidjson/error/en.h\"\n#include \"rapidjson/stringbuffer.h\"\n#include \"rapidjson/writer.h\"\n\n\n#ifdef _MSC_VER\n# define strncasecmp(x,y,z) _strnicmp(x,y,z)\n#endif\n\n\nnamespace xmrig {\n\nint64_t Client::m_sequence = 1;\nStorage Client::m_storage;\n\n} /* namespace xmrig */\n\n\n#ifdef APP_DEBUG\nstatic const char *states[] = {\n \"unconnected\",\n \"host-lookup\",\n \"connecting\",\n \"connected\",\n \"closing\",\n \"reconnecting\"\n};\n#endif\n\n\nxmrig::Client::Client(int id, const char *agent, IClientListener *listener) :\n m_ipv6(false),\n m_nicehash(false),\n m_quiet(false),\n m_agent(agent),\n m_listener(listener),\n m_extensions(0),\n m_id(id),\n m_retries(5),\n m_retryPause(5000),\n m_failures(0),\n m_recvBufPos(0),\n m_state(UnconnectedState),\n m_tls(nullptr),\n m_expire(0),\n m_jobs(0),\n m_keepAlive(0),\n m_key(0),\n m_stream(nullptr),\n m_socket(nullptr)\n{\n m_key = m_storage.add(this);\n\n memset(m_ip, 0, sizeof(m_ip));\n memset(&m_hints, 0, sizeof(m_hints));\n\n m_resolver.data = m_storage.ptr(m_key);\n\n m_hints.ai_family = AF_UNSPEC;\n m_hints.ai_socktype = SOCK_STREAM;\n m_hints.ai_protocol = IPPROTO_TCP;\n\n m_recvBuf.base = m_buf;\n m_recvBuf.len = sizeof(m_buf);\n}\n\n\nxmrig::Client::~Client()\n{\n delete m_socket;\n}\n\n\nvoid xmrig::Client::connect()\n{\n# ifndef XMRIG_NO_TLS\n if (m_pool.isTLS()) {\n m_tls = new Tls(this);\n }\n# endif\n\n resolve(m_pool.host());\n}\n\n\n/**\n * @brief Connect to server.\n *\n * @param url\n */\nvoid xmrig::Client::connect(const Pool &url)\n{\n setPool(url);\n connect();\n}\n\n\nvoid xmrig::Client::deleteLater()\n{\n if (!m_listener) {\n return;\n }\n\n m_listener = nullptr;\n\n if (!disconnect()) {\n m_storage.remove(m_key);\n }\n}\n\n\n\nvoid xmrig::Client::setPool(const Pool &pool)\n{\n if (!pool.isValid()) {\n return;\n }\n\n m_pool = pool;\n}\n\n\nvoid xmrig::Client::tick(uint64_t now)\n{\n if (m_state == ConnectedState) {\n if (m_expire && now > m_expire) {\n LOG_DEBUG_ERR(\"[%s] timeout\", m_pool.url());\n close();\n }\n else if (m_keepAlive && now > m_keepAlive) {\n ping();\n }\n\n return;\n }\n\n if (m_state == ReconnectingState && m_expire && now > m_expire) {\n return connect();\n }\n\n if (m_state == ConnectingState && m_expire && now > m_expire) {\n return reconnect();\n }\n}\n\n\nbool xmrig::Client::disconnect()\n{\n m_keepAlive = 0;\n m_expire = 0;\n m_failures = -1;\n\n return close();\n}\n\n\nconst char *xmrig::Client::tlsFingerprint() const\n{\n# ifndef XMRIG_NO_TLS\n if (isTLS() && m_pool.fingerprint() == nullptr) {\n return m_tls->fingerprint();\n }\n# endif\n\n return nullptr;\n}\n\n\nconst char *xmrig::Client::tlsVersion() const\n{\n# ifndef XMRIG_NO_TLS\n if (isTLS()) {\n return m_tls->version();\n }\n# endif\n\n return nullptr;\n}\n\n\nint64_t xmrig::Client::submit(const JobResult &result)\n{\n# ifndef XMRIG_PROXY_PROJECT\n if (result.clientId != m_rpcId) {\n return -1;\n }\n# endif\n\n using namespace rapidjson;\n\n# ifdef XMRIG_PROXY_PROJECT\n const char *nonce = result.nonce;\n const char *data = result.result;\n# else\n char *nonce = m_sendBuf;\n char *data = m_sendBuf + 16;\n\n Job::toHex(reinterpret_cast(&result.nonce), 4, nonce);\n nonce[8] = '\\0';\n\n Job::toHex(result.result, 32, data);\n data[64] = '\\0';\n# endif\n\n Document doc(kObjectType);\n auto &allocator = doc.GetAllocator();\n\n doc.AddMember(\"id\", m_sequence, allocator);\n doc.AddMember(\"jsonrpc\", \"2.0\", allocator);\n doc.AddMember(\"method\", \"submit\", allocator);\n\n Value params(kObjectType);\n params.AddMember(\"id\", StringRef(m_rpcId.data()), allocator);\n params.AddMember(\"job_id\", StringRef(result.jobId.data()), allocator);\n params.AddMember(\"nonce\", StringRef(nonce), allocator);\n params.AddMember(\"result\", StringRef(data), allocator);\n\n if (m_extensions & AlgoExt) {\n params.AddMember(\"algo\", StringRef(result.algorithm.shortName()), allocator);\n }\n\n doc.AddMember(\"params\", params, allocator);\n\n# ifdef XMRIG_PROXY_PROJECT\n m_results[m_sequence] = SubmitResult(m_sequence, result.diff, result.actualDiff(), result.id);\n# else\n m_results[m_sequence] = SubmitResult(m_sequence, result.diff, result.actualDiff());\n# endif\n\n return send(doc);\n}\n\n\nbool xmrig::Client::close()\n{\n if (m_state == ClosingState) {\n return m_socket != nullptr;\n }\n\n if (m_state == UnconnectedState || m_socket == nullptr) {\n return false;\n }\n\n setState(ClosingState);\n\n if (uv_is_closing(reinterpret_cast(m_socket)) == 0) {\n uv_close(reinterpret_cast(m_socket), Client::onClose);\n }\n\n return true;\n}\n\n\nbool xmrig::Client::isCriticalError(const char *message)\n{\n if (!message) {\n return false;\n }\n\n if (strncasecmp(message, \"Unauthenticated\", 15) == 0) {\n return true;\n }\n\n if (strncasecmp(message, \"your IP is banned\", 17) == 0) {\n return true;\n }\n\n if (strncasecmp(message, \"IP Address currently banned\", 27) == 0) {\n return true;\n }\n\n return false;\n}\n\n\nbool xmrig::Client::isTLS() const\n{\n# ifndef XMRIG_NO_TLS\n return m_pool.isTLS() && m_tls;\n# else\n return false;\n# endif\n}\n\n\nbool xmrig::Client::parseJob(const rapidjson::Value ¶ms, int *code)\n{\n if (!params.IsObject()) {\n *code = 2;\n return false;\n }\n\n Job job(m_id, m_nicehash, m_pool.algorithm(), m_rpcId);\n\n if (!job.setId(params[\"job_id\"].GetString())) {\n *code = 3;\n return false;\n }\n\n if (!job.setBlob(params[\"blob\"].GetString())) {\n *code = 4;\n return false;\n }\n\n if (!job.setTarget(params[\"target\"].GetString())) {\n *code = 5;\n return false;\n }\n\n if (params.HasMember(\"algo\")) {\n job.setAlgorithm(params[\"algo\"].GetString());\n }\n\n if (params.HasMember(\"variant\")) {\n const rapidjson::Value &variant = params[\"variant\"];\n\n if (variant.IsInt()) {\n job.setVariant(variant.GetInt());\n }\n else if (variant.IsString()){\n job.setVariant(variant.GetString());\n }\n }\n\n if (params.HasMember(\"height\")) {\n const rapidjson::Value &variant = params[\"height\"];\n\n if (variant.IsUint64()) {\n job.setHeight(variant.GetUint64());\n }\n }\n\n if (!verifyAlgorithm(job.algorithm())) {\n *code = 6;\n\n close();\n return false;\n }\n\n m_job.setClientId(m_rpcId);\n\n if (m_job != job) {\n m_jobs++;\n m_job = std::move(job);\n return true;\n }\n\n if (m_jobs == 0) { // https://github.com/xmrig/xmrig/issues/459\n return false;\n }\n\n if (!isQuiet()) {\n LOG_WARN(\"[%s] duplicate job received, reconnect\", m_pool.url());\n }\n\n close();\n return false;\n}\n\n\nbool xmrig::Client::parseLogin(const rapidjson::Value &result, int *code)\n{\n if (!m_rpcId.setId(result[\"id\"].GetString())) {\n *code = 1;\n return false;\n }\n\n m_nicehash = m_pool.isNicehash();\n\n if (result.HasMember(\"extensions\")) {\n parseExtensions(result[\"extensions\"]);\n }\n\n const bool rc = parseJob(result[\"job\"], code);\n m_jobs = 0;\n\n return rc;\n}\n\n\nbool xmrig::Client::send(BIO *bio)\n{\n# ifndef XMRIG_NO_TLS\n uv_buf_t buf;\n buf.len = BIO_get_mem_data(bio, &buf.base);\n\n if (buf.len == 0) {\n return true;\n }\n\n LOG_DEBUG(\"[%s] TLS send (%d bytes)\", m_pool.url(), static_cast(buf.len));\n\n bool result = false;\n if (state() == ConnectedState && uv_is_writable(m_stream)) {\n result = uv_try_write(m_stream, &buf, 1) > 0;\n\n if (!result) {\n close();\n }\n }\n else {\n LOG_DEBUG_ERR(\"[%s] send failed, invalid state: %d\", m_pool.url(), m_state);\n }\n\n (void) BIO_reset(bio);\n\n return result;\n# else\n return false;\n# endif\n}\n\n\nbool xmrig::Client::verifyAlgorithm(const Algorithm &algorithm) const\n{\n# ifdef XMRIG_PROXY_PROJECT\n if (m_pool.algorithm().variant() == VARIANT_AUTO || m_id == -1) {\n return true;\n }\n# endif\n\n if (m_pool.isCompatible(algorithm)) {\n return true;\n }\n\n if (isQuiet()) {\n return false;\n }\n\n if (algorithm.isValid()) {\n LOG_ERR(\"Incompatible algorithm \\\"%s\\\" detected, reconnect\", algorithm.name());\n }\n else {\n LOG_ERR(\"Unknown/unsupported algorithm detected, reconnect\");\n }\n\n return false;\n}\n\n\nint xmrig::Client::resolve(const char *host)\n{\n setState(HostLookupState);\n\n m_recvBufPos = 0;\n\n if (m_failures == -1) {\n m_failures = 0;\n }\n\n const int r = uv_getaddrinfo(uv_default_loop(), &m_resolver, Client::onResolved, host, nullptr, &m_hints);\n if (r) {\n if (!isQuiet()) {\n LOG_ERR(\"[%s:%u] getaddrinfo error: \\\"%s\\\"\", host, m_pool.port(), uv_strerror(r));\n }\n return 1;\n }\n\n return 0;\n}\n\n\nint64_t xmrig::Client::send(const rapidjson::Document &doc)\n{\n using namespace rapidjson;\n\n StringBuffer buffer(0, 512);\n Writer writer(buffer);\n doc.Accept(writer);\n\n const size_t size = buffer.GetSize();\n if (size > (sizeof(m_sendBuf) - 2)) {\n LOG_ERR(\"[%s] send failed: \\\"send buffer overflow: %zu > %zu\\\"\", m_pool.url(), size, (sizeof(m_sendBuf) - 2));\n close();\n return -1;\n }\n\n memcpy(m_sendBuf, buffer.GetString(), size);\n m_sendBuf[size] = '\\n';\n m_sendBuf[size + 1] = '\\0';\n\n return send(size + 1);\n}\n\n\nint64_t xmrig::Client::send(size_t size)\n{\n LOG_DEBUG(\"[%s] send (%d bytes): \\\"%s\\\"\", m_pool.url(), size, m_sendBuf);\n\n# ifndef XMRIG_NO_TLS\n if (isTLS()) {\n if (!m_tls->send(m_sendBuf, size)) {\n return -1;\n }\n }\n else\n# endif\n {\n if (state() != ConnectedState || !uv_is_writable(m_stream)) {\n LOG_DEBUG_ERR(\"[%s] send failed, invalid state: %d\", m_pool.url(), m_state);\n return -1;\n }\n\n uv_buf_t buf = uv_buf_init(m_sendBuf, (unsigned int) size);\n\n if (uv_try_write(m_stream, &buf, 1) < 0) {\n close();\n return -1;\n }\n }\n\n m_expire = uv_now(uv_default_loop()) + kResponseTimeout;\n return m_sequence++;\n}\n\n\nvoid xmrig::Client::connect(const std::vector &ipv4, const std::vector &ipv6)\n{\n addrinfo *addr = nullptr;\n m_ipv6 = ipv4.empty() && !ipv6.empty();\n\n if (m_ipv6) {\n addr = ipv6[ipv6.size() == 1 ? 0 : rand() % ipv6.size()];\n uv_ip6_name(reinterpret_cast(addr->ai_addr), m_ip, 45);\n }\n else {\n addr = ipv4[ipv4.size() == 1 ? 0 : rand() % ipv4.size()];\n uv_ip4_name(reinterpret_cast(addr->ai_addr), m_ip, 16);\n }\n\n connect(addr->ai_addr);\n}\n\n\nvoid xmrig::Client::connect(sockaddr *addr)\n{\n setState(ConnectingState);\n\n reinterpret_cast(addr)->sin_port = htons(m_pool.port());\n\n uv_connect_t *req = new uv_connect_t;\n req->data = m_storage.ptr(m_key);\n\n m_socket = new uv_tcp_t;\n m_socket->data = m_storage.ptr(m_key);\n\n uv_tcp_init(uv_default_loop(), m_socket);\n uv_tcp_nodelay(m_socket, 1);\n\n# ifndef WIN32\n uv_tcp_keepalive(m_socket, 1, 60);\n# endif\n\n uv_tcp_connect(req, m_socket, reinterpret_cast(addr), Client::onConnect);\n}\n\n\nvoid xmrig::Client::handshake()\n{\n# ifndef XMRIG_NO_TLS\n if (isTLS()) {\n m_expire = uv_now(uv_default_loop()) + kResponseTimeout;\n\n m_tls->handshake();\n }\n else\n# endif\n {\n login();\n }\n}\n\n\nvoid xmrig::Client::login()\n{\n using namespace rapidjson;\n m_results.clear();\n\n Document doc(kObjectType);\n auto &allocator = doc.GetAllocator();\n\n doc.AddMember(\"id\", 1, allocator);\n doc.AddMember(\"jsonrpc\", \"2.0\", allocator);\n doc.AddMember(\"method\", \"login\", allocator);\n\n Value params(kObjectType);\n params.AddMember(\"login\", StringRef(m_pool.user()), allocator);\n params.AddMember(\"pass\", StringRef(m_pool.password()), allocator);\n params.AddMember(\"agent\", StringRef(m_agent), allocator);\n\n if (m_pool.rigId()) {\n params.AddMember(\"rigid\", StringRef(m_pool.rigId()), allocator);\n }\n\n# ifdef XMRIG_PROXY_PROJECT\n if (m_pool.algorithm().variant() != xmrig::VARIANT_AUTO)\n# endif\n {\n Value algo(kArrayType);\n\n for (const auto &a : m_pool.algorithms()) {\n algo.PushBack(StringRef(a.shortName()), allocator);\n }\n\n params.AddMember(\"algo\", algo, allocator);\n }\n\n doc.AddMember(\"params\", params, allocator);\n\n send(doc);\n}\n\n\nvoid xmrig::Client::onClose()\n{\n delete m_socket;\n\n m_stream = nullptr;\n m_socket = nullptr;\n setState(UnconnectedState);\n\n# ifndef XMRIG_NO_TLS\n if (m_tls) {\n delete m_tls;\n m_tls = nullptr;\n }\n# endif\n\n reconnect();\n}\n\n\nvoid xmrig::Client::parse(char *line, size_t len)\n{\n startTimeout();\n\n line[len - 1] = '\\0';\n\n LOG_DEBUG(\"[%s] received (%d bytes): \\\"%s\\\"\", m_pool.url(), len, line);\n\n if (len < 32 || line[0] != '{') {\n if (!isQuiet()) {\n LOG_ERR(\"[%s] JSON decode failed\", m_pool.url());\n }\n\n return;\n }\n\n rapidjson::Document doc;\n if (doc.ParseInsitu(line).HasParseError()) {\n if (!isQuiet()) {\n LOG_ERR(\"[%s] JSON decode failed: \\\"%s\\\"\", m_pool.url(), rapidjson::GetParseError_En(doc.GetParseError()));\n }\n\n return;\n }\n\n if (!doc.IsObject()) {\n return;\n }\n\n const rapidjson::Value &id = doc[\"id\"];\n if (id.IsInt64()) {\n parseResponse(id.GetInt64(), doc[\"result\"], doc[\"error\"]);\n }\n else {\n parseNotification(doc[\"method\"].GetString(), doc[\"params\"], doc[\"error\"]);\n }\n}\n\n\nvoid xmrig::Client::parseExtensions(const rapidjson::Value &value)\n{\n m_extensions = 0;\n\n if (!value.IsArray()) {\n return;\n }\n\n for (const rapidjson::Value &ext : value.GetArray()) {\n if (!ext.IsString()) {\n continue;\n }\n\n if (strcmp(ext.GetString(), \"algo\") == 0) {\n m_extensions |= AlgoExt;\n continue;\n }\n\n if (strcmp(ext.GetString(), \"nicehash\") == 0) {\n m_extensions |= NicehashExt;\n m_nicehash = true;\n continue;\n }\n }\n}\n\n\nvoid xmrig::Client::parseNotification(const char *method, const rapidjson::Value ¶ms, const rapidjson::Value &error)\n{\n if (error.IsObject()) {\n if (!isQuiet()) {\n LOG_ERR(\"[%s] error: \\\"%s\\\", code: %d\", m_pool.url(), error[\"message\"].GetString(), error[\"code\"].GetInt());\n }\n return;\n }\n\n if (!method) {\n return;\n }\n\n if (strcmp(method, \"job\") == 0) {\n int code = -1;\n if (parseJob(params, &code)) {\n m_listener->onJobReceived(this, m_job);\n }\n\n return;\n }\n\n LOG_WARN(\"[%s] unsupported method: \\\"%s\\\"\", m_pool.url(), method);\n}\n\n\nvoid xmrig::Client::parseResponse(int64_t id, const rapidjson::Value &result, const rapidjson::Value &error)\n{\n if (error.IsObject()) {\n const char *message = error[\"message\"].GetString();\n\n auto it = m_results.find(id);\n if (it != m_results.end()) {\n it->second.done();\n m_listener->onResultAccepted(this, it->second, message);\n m_results.erase(it);\n }\n else if (!isQuiet()) {\n LOG_ERR(\"[%s] error: \\\"%s\\\", code: %d\", m_pool.url(), message, error[\"code\"].GetInt());\n }\n\n if (isCriticalError(message)) {\n close();\n }\n\n return;\n }\n\n if (!result.IsObject()) {\n return;\n }\n\n if (id == 1) {\n int code = -1;\n if (!parseLogin(result, &code)) {\n if (!isQuiet()) {\n LOG_ERR(\"[%s] login error code: %d\", m_pool.url(), code);\n }\n\n close();\n return;\n }\n\n m_failures = 0;\n m_listener->onLoginSuccess(this);\n m_listener->onJobReceived(this, m_job);\n return;\n }\n\n auto it = m_results.find(id);\n if (it != m_results.end()) {\n it->second.done();\n m_listener->onResultAccepted(this, it->second, nullptr);\n m_results.erase(it);\n }\n}\n\n\nvoid xmrig::Client::ping()\n{\n send(snprintf(m_sendBuf, sizeof(m_sendBuf), \"{\\\"id\\\":%\" PRId64 \",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"method\\\":\\\"keepalived\\\",\\\"params\\\":{\\\"id\\\":\\\"%s\\\"}}\\n\", m_sequence, m_rpcId.data()));\n\n m_keepAlive = 0;\n}\n\n\nvoid xmrig::Client::read()\n{\n char* end;\n char* start = m_recvBuf.base;\n size_t remaining = m_recvBufPos;\n\n while ((end = static_cast(memchr(start, '\\n', remaining))) != nullptr) {\n end++;\n size_t len = end - start;\n parse(start, len);\n\n remaining -= len;\n start = end;\n }\n\n if (remaining == 0) {\n m_recvBufPos = 0;\n return;\n }\n\n if (start == m_recvBuf.base) {\n return;\n }\n\n memcpy(m_recvBuf.base, start, remaining);\n m_recvBufPos = remaining;\n}\n\n\nvoid xmrig::Client::reconnect()\n{\n if (!m_listener) {\n m_storage.remove(m_key);\n\n return;\n }\n\n m_keepAlive = 0;\n\n if (m_failures == -1) {\n return m_listener->onClose(this, -1);\n }\n\n setState(ReconnectingState);\n\n m_failures++;\n m_listener->onClose(this, (int) m_failures);\n\n m_expire = uv_now(uv_default_loop()) + m_retryPause;\n}\n\n\nvoid xmrig::Client::setState(SocketState state)\n{\n LOG_DEBUG(\"[%s] state: \\\"%s\\\"\", m_pool.url(), states[state]);\n\n if (m_state == state) {\n return;\n }\n\n switch (state) {\n case HostLookupState:\n m_expire = 0;\n break;\n\n case ConnectingState:\n m_expire = uv_now(uv_default_loop()) + kConnectTimeout;\n break;\n\n case ReconnectingState:\n m_expire = uv_now(uv_default_loop()) + m_retryPause;\n break;\n\n default:\n break;\n }\n\n m_state = state;\n}\n\n\nvoid xmrig::Client::startTimeout()\n{\n m_expire = 0;\n\n if (m_pool.keepAlive()) {\n m_keepAlive = uv_now(uv_default_loop()) + (m_pool.keepAlive() * 1000);\n }\n}\n\n\nvoid xmrig::Client::onAllocBuffer(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)\n{\n auto client = getClient(handle->data);\n if (!client) {\n return;\n }\n\n buf->base = &client->m_recvBuf.base[client->m_recvBufPos];\n buf->len = client->m_recvBuf.len - client->m_recvBufPos;\n}\n\n\nvoid xmrig::Client::onClose(uv_handle_t *handle)\n{\n auto client = getClient(handle->data);\n if (!client) {\n return;\n }\n\n client->onClose();\n}\n\n\nvoid xmrig::Client::onConnect(uv_connect_t *req, int status)\n{\n auto client = getClient(req->data);\n if (!client) {\n delete req;\n return;\n }\n\n if (status < 0) {\n if (!client->isQuiet()) {\n LOG_ERR(\"[%s] connect error: \\\"%s\\\"\", client->m_pool.url(), uv_strerror(status));\n }\n\n delete req;\n client->close();\n return;\n }\n\n client->m_stream = static_cast(req->handle);\n client->m_stream->data = req->data;\n client->setState(ConnectedState);\n\n uv_read_start(client->m_stream, Client::onAllocBuffer, Client::onRead);\n delete req;\n\n client->handshake();\n}\n\n\nvoid xmrig::Client::onRead(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)\n{\n auto client = getClient(stream->data);\n if (!client) {\n return;\n }\n\n if (nread < 0) {\n if (!client->isQuiet()) {\n LOG_ERR(\"[%s] read error: \\\"%s\\\"\", client->m_pool.url(), uv_strerror((int) nread));\n }\n\n client->close();\n return;\n }\n\n if ((size_t) nread > (sizeof(m_buf) - 8 - client->m_recvBufPos)) {\n client->close();\n return;\n }\n\n assert(client->m_listener != nullptr);\n if (!client->m_listener) {\n return client->reconnect();\n }\n\n client->m_recvBufPos += nread;\n\n# ifndef XMRIG_NO_TLS\n if (client->isTLS()) {\n LOG_DEBUG(\"[%s] TLS received (%d bytes)\", client->m_pool.url(), static_cast(nread));\n\n client->m_tls->read(client->m_recvBuf.base, client->m_recvBufPos);\n client->m_recvBufPos = 0;\n }\n else\n# endif\n {\n client->read();\n }\n}\n\n\nvoid xmrig::Client::onResolved(uv_getaddrinfo_t *req, int status, struct addrinfo *res)\n{\n auto client = getClient(req->data);\n if (!client) {\n return;\n }\n\n assert(client->m_listener != nullptr);\n if (!client->m_listener) {\n return client->reconnect();\n }\n\n if (status < 0) {\n if (!client->isQuiet()) {\n LOG_ERR(\"[%s] DNS error: \\\"%s\\\"\", client->m_pool.url(), uv_strerror(status));\n }\n\n return client->reconnect();\n }\n\n addrinfo *ptr = res;\n std::vector ipv4;\n std::vector ipv6;\n\n while (ptr != nullptr) {\n if (ptr->ai_family == AF_INET) {\n ipv4.push_back(ptr);\n }\n\n if (ptr->ai_family == AF_INET6) {\n ipv6.push_back(ptr);\n }\n\n ptr = ptr->ai_next;\n }\n\n if (ipv4.empty() && ipv6.empty()) {\n if (!client->isQuiet()) {\n LOG_ERR(\"[%s] DNS error: \\\"No IPv4 (A) or IPv6 (AAAA) records found\\\"\", client->m_pool.url());\n }\n\n uv_freeaddrinfo(res);\n return client->reconnect();\n }\n\n client->connect(ipv4, ipv6);\n uv_freeaddrinfo(res);\n}\n"} {"text": "{\n \"states\": [\n {\n \"kind\": \"state\",\n \"id\": \"a\",\n \"transitions\": [\n {\n \"target\": \"b\",\n \"event\": \"some_event\"\n }\n ]\n },\n {\n \"kind\": \"state\",\n \"id\": \"b\"\n }\n ]\n}"} {"text": "# 前端工程师技能之photoshop巧用系列扩展篇——自动切图 \n\n  随着photoshop版本的不断升级,软件本身增加了很多新的功能,也为切图工作增加了很多的便利。photoshop最新的版本新增了自动切图功能,本文将详细介绍photoshop的这个新功能\n\n \n\n \n\n### 初始设置\n\n  当然首先还是要进行一些首选项设置\n\n  【1】在编辑 -> 首选项 -> 增效工具中,选中启用生成器\n\n![autocut1](https://pic.xiaohuochai.site/blog/ps_autocut1.jpg)\n\n  【2】重启photoshop,在文件 -> 生成中,点击图像资源在文件 -> 生成中,点击图像资源\n\n    注意:只有在photoshop中有文件打开的情况下,该项才可以点击\n\n![autocut2](https://pic.xiaohuochai.site/blog/ps_autocut2.jpg)\n \n\n \n\n### 自动切图\n\n【png】\n\n  比如,我们要将收藏前的小图标切出来,先找到该图标对应的图层或组,再将其重命名。重点是给其添加后缀。如果想要保存png8格式的图片,后缀名写为.png8。类似地,如果要保存png24格式,则后缀名写为.png24\n\n  此时,图像的存放目录下会多出一个assets文件夹,里面会存放刚才保存的图片sc.png\n\n![autocut3](https://pic.xiaohuochai.site/blog/ps_autocut3.gif)\n\n【jpg】\n\n  类似地,jpg格式图片也是如此切法。比如我们要把脚丫的图片切出来\n\n![autocut4](https://pic.xiaohuochai.site/blog/ps_autocut4.gif)\n\n  实际上,jpg格式的图片存储时,是有品质选择的,从0-100。如果我们把后缀名写为.jpg6,则代表品质为60。如果后缀名为.jpg,则表示品质为100\n\n  我们先打开原来切的那张图片,大小为13.6k。将其后缀名改为.jpg5后,大小变成了4.52k\n\n![autocut5](https://pic.xiaohuochai.site/blog/ps_autocut5.gif)\n\n【2倍图】\n\n  如果我们需要适应视网膜屏幕,切出2倍图时,也可以使用自动切图的功能。只需要将其重命名为200% 图片名称 @2x.jpg就可以\n\n  首先,我们先查看脚丫图片的尺寸是200*200,当我们将其设置为200% jy @2x.jpg5后,再查看脚丫图片的尺寸变成了400*400,也就是生成了2倍图\n\n![autocut6](https://pic.xiaohuochai.site/blog/ps_autocut6.gif)\n\n  类似地,3倍图也是相似做法\n\n![autocut7](https://pic.xiaohuochai.site/blog/ps_autocut7.gif)"} {"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 \n\n@class NSColor;\n\n@interface IPGrowBar : NSView\n{\n double _min;\n double _max;\n NSColor *_fillColor;\n id _delegate;\n int _edge;\n BOOL _delegateHasWillResize;\n BOOL _delegateHasDidResize;\n BOOL _delegateHasBeginResize;\n BOOL _delegateHasEndResize;\n}\n\n- (void)dealloc;\n- (void)setEdge:(int)arg1;\n- (int)edge;\n- (void)setDelegate:(id)arg1;\n- (id)delegate;\n- (void)setFillColor:(id)arg1;\n- (id)fillColor;\n- (void)setMax:(double)arg1;\n- (double)max;\n- (void)setMin:(double)arg1;\n- (double)min;\n- (void)mouseDown:(id)arg1;\n- (BOOL)acceptsFirstMouse;\n- (void)setFrame:(struct CGRect)arg1;\n- (void)resetCursorRects;\n- (void)drawRect:(struct CGRect)arg1;\n- (id)initWithFrame:(struct CGRect)arg1;\n\n@end\n\n"} {"text": "#pragma warning disable 108 // new keyword hiding\n#pragma warning disable 114 // new keyword hiding\nnamespace Windows.UI.Xaml.Controls\n{\n\t#if false || false || false || false || false || false || false\n\t[global::Uno.NotImplemented]\n\t#endif\n\tpublic partial class ContentDialogButtonClickDeferral \n\t{\n\t\t// Skipping already declared method Windows.UI.Xaml.Controls.ContentDialogButtonClickDeferral.Complete()\n\t}\n}\n"} {"text": "import numpy as np\nimport pytest\nfrom pvlib import pvsystem\nfrom pvlib.ivtools import sde\n\n\n@pytest.fixture\ndef get_test_iv_params():\n return {'IL': 8.0, 'I0': 5e-10, 'Rs': 0.2, 'Rsh': 1000, 'nNsVth': 1.61864}\n\n\ndef test_fit_sandia_simple(get_test_iv_params, get_bad_iv_curves):\n test_params = get_test_iv_params\n testcurve = pvsystem.singlediode(photocurrent=test_params['IL'],\n saturation_current=test_params['I0'],\n resistance_shunt=test_params['Rsh'],\n resistance_series=test_params['Rs'],\n nNsVth=test_params['nNsVth'],\n ivcurve_pnts=300)\n expected = tuple(test_params[k] for k in ['IL', 'I0', 'Rs', 'Rsh',\n 'nNsVth'])\n result = sde.fit_sandia_simple(voltage=testcurve['v'],\n current=testcurve['i'])\n assert np.allclose(result, expected, rtol=5e-5)\n result = sde.fit_sandia_simple(voltage=testcurve['v'],\n current=testcurve['i'],\n v_oc=testcurve['v_oc'],\n i_sc=testcurve['i_sc'])\n assert np.allclose(result, expected, rtol=5e-5)\n result = sde.fit_sandia_simple(voltage=testcurve['v'],\n current=testcurve['i'],\n v_oc=testcurve['v_oc'],\n i_sc=testcurve['i_sc'],\n v_mp_i_mp=(testcurve['v_mp'],\n testcurve['i_mp']))\n assert np.allclose(result, expected, rtol=5e-5)\n result = sde.fit_sandia_simple(voltage=testcurve['v'],\n current=testcurve['i'], vlim=0.1)\n assert np.allclose(result, expected, rtol=5e-5)\n\n\ndef test_fit_sandia_simple_bad_iv(get_bad_iv_curves):\n # bad IV curves for coverage of if/then in sde._sandia_simple_params\n v1, i1, v2, i2 = get_bad_iv_curves\n result = sde.fit_sandia_simple(voltage=v1, current=i1)\n assert np.allclose(result, (-2.4322856072799985, 8.826830831727355,\n 111.18558915546389, -63.56227601452038,\n -137.9965046659527))\n result = sde.fit_sandia_simple(voltage=v2, current=i2)\n assert np.allclose(result, (2.62405311949227, 5.075520636620032,\n -65.652554411442, 110.35202827739991,\n 174.49362093001415))\n\n\n@pytest.mark.parametrize('i,v,nsvth,expected', [\n (np.array(\n [4., 3.95, 3.92, 3.9, 3.89, 3.88, 3.82, 3.8, 3.75, 3.7, 3.68, 3.66,\n 3.65, 3.5, 3.2, 2.7, 2.2, 1.3, .6, 0.]),\n np.array(\n [0., .2, .4, .6, .8, 1., 1.2, 1.4, 1.6, 1.8, 2., 2.2, 2.4, 2.6, 2.7,\n 2.76, 2.78, 2.81, 2.85, 2.88]),\n 2.,\n (-96695.792, 96699.876, 7.4791, .0288, -.1413)),\n (np.array([3., 2.9, 2.8, 2.7, 2.6, 2.5, 2.4, 1.7, 0.8, 0.]),\n np.array([0., 0.2, 0.4, 0.6, 0.8, 1., 1.2, 1.4, 1.45, 1.5]),\n 10.,\n (2.3392, 11.6865, -.232, -.2596, -.7119)),\n (np.array(\n [5., 4.9, 4.8, 4.7, 4.6, 4.5, 4.4, 4.3, 4.2, 4.1, 4., 3.8, 3.5, 1.7,\n 0.]),\n np.array(\n [0., .1, .2, .3, .4, .5, .6, .7, .8, .9, 1., 1.1, 1.18, 1.2, 1.22]),\n 15.,\n (-22.0795, 27.1196, -4.2076, -.0056, -.0498))])\ndef test__fit_sandia_cocontent(i, v, nsvth, expected):\n # test confirms agreement with Matlab code. The returned parameters\n # are nonsense\n iph, io, rsh, rs, n = sde._fit_sandia_cocontent(v, i, nsvth)\n np.testing.assert_allclose(iph, np.array(expected[0]), atol=.0001)\n np.testing.assert_allclose(io, np.array([expected[1]]), atol=.0001)\n np.testing.assert_allclose(rs, np.array([expected[2]]), atol=.0001)\n np.testing.assert_allclose(rsh, np.array([expected[3]]), atol=.0001)\n np.testing.assert_allclose(n, np.array([expected[4]]), atol=.0001)\n\n\ndef test__fit_sandia_cocontent_fail():\n # tests for ValueError\n exc_text = 'voltage and current should have the same length'\n with pytest.raises(ValueError, match=exc_text):\n sde._fit_sandia_cocontent(np.array([0., 1., 2.]), np.array([4., 3.]),\n 2.)\n exc_text = 'at least 6 voltage points are required; ~50 are recommended'\n with pytest.raises(ValueError, match=exc_text):\n sde._fit_sandia_cocontent(np.array([0., 1., 2., 3., 4.]),\n np.array([4., 3.9, 3.4, 2., 0.]),\n 2.)\n\n\n@pytest.fixture\ndef get_bad_iv_curves():\n # v1, i1 produces a bad value for I0_voc\n v1 = np.array([0, 0.338798867469060, 0.677597734938121, 1.01639660240718,\n 1.35519546987624, 1.69399433734530, 2.03279320481436,\n 2.37159207228342, 2.71039093975248, 3.04918980722154,\n 3.38798867469060, 3.72678754215966, 4.06558640962873,\n 4.40438527709779, 4.74318414456685, 5.08198301203591,\n 5.42078187950497, 5.75958074697403, 6.09837961444309,\n 6.43717848191215, 6.77597734938121, 7.11477621685027,\n 7.45357508431933, 7.79237395178839, 8.13117281925745,\n 8.46997168672651, 8.80877055419557, 9.14756942166463,\n 9.48636828913369, 9.82516715660275, 10.1639660240718,\n 10.5027648915409, 10.8415637590099, 11.1803626264790,\n 11.5191614939481, 11.8579603614171, 12.1967592288862,\n 12.5355580963552, 12.8743569638243, 13.2131558312934,\n 13.5519546987624, 13.8907535662315, 14.2295524337005,\n 14.5683513011696, 14.9071501686387, 15.2459490361077,\n 15.5847479035768, 15.9235467710458, 16.2623456385149,\n 16.6011445059840, 16.9399433734530, 17.2787422409221,\n 17.6175411083911, 17.9563399758602, 18.2951388433293,\n 18.6339377107983, 18.9727365782674, 19.3115354457364,\n 19.6503343132055, 19.9891331806746, 20.3279320481436,\n 20.6667309156127, 21.0055297830817, 21.3443286505508,\n 21.6831275180199, 22.0219263854889, 22.3607252529580,\n 22.6995241204270, 23.0383229878961, 23.3771218553652,\n 23.7159207228342, 24.0547195903033, 24.3935184577724,\n 24.7323173252414, 25.0711161927105, 25.4099150601795,\n 25.7487139276486, 26.0875127951177, 26.4263116625867,\n 26.7651105300558, 27.1039093975248, 27.4427082649939,\n 27.7815071324630, 28.1203059999320, 28.4591048674011,\n 28.7979037348701, 29.1367026023392, 29.4755014698083,\n 29.8143003372773, 30.1530992047464, 30.4918980722154,\n 30.8306969396845, 31.1694958071536, 31.5082946746226,\n 31.8470935420917, 32.1858924095607, 32.5246912770298,\n 32.8634901444989, 33.2022890119679, 33.5410878794370])\n i1 = np.array([3.39430882774470, 2.80864492110761, 3.28358165429196,\n 3.41191190551673, 3.11975662808148, 3.35436585834612,\n 3.23953272899809, 3.60307083325333, 2.80478101508277,\n 2.80505102853845, 3.16918996870373, 3.21088388439857,\n 3.46332865310431, 3.09224155015883, 3.17541550741062,\n 3.32470179290389, 3.33224664316240, 3.07709000050741,\n 2.89141245343405, 3.01365768561537, 3.23265176770231,\n 3.32253647634228, 2.97900657569736, 3.31959549243966,\n 3.03375461550111, 2.97579298978937, 3.25432831375159,\n 2.89178382564454, 3.00341909207567, 3.72637492250097,\n 3.28379856976360, 2.96516169245835, 3.25658381110230,\n 3.41655911533139, 3.02718097944604, 3.11458376760376,\n 3.24617304369762, 3.45935502367636, 3.21557333256913,\n 3.27611176482650, 2.86954135732485, 3.32416319254657,\n 3.15277467598732, 3.08272557013770, 3.15602202666259,\n 3.49432799877150, 3.53863997177632, 3.10602611478455,\n 3.05373911151821, 3.09876772570781, 2.97417228624287,\n 2.84573593699237, 3.16288578405195, 3.06533173612783,\n 3.02118336639575, 3.34374977225502, 2.97255164138821,\n 3.19286135682863, 3.10999753817133, 3.26925354620079,\n 3.11957809501529, 3.20155017481720, 3.31724984405837,\n 3.42879043512927, 3.17933067619240, 3.47777362613969,\n 3.20708912539777, 3.48205761174907, 3.16804363684327,\n 3.14055472378230, 3.13445657434470, 2.91152696252998,\n 3.10984113847427, 2.80443349399489, 3.23146278164875,\n 2.94521083406108, 3.17388903141715, 3.05930294897030,\n 3.18985234673287, 3.27946609274898, 3.33717523113602,\n 2.76394303462702, 3.19375132937510, 2.82628616689450,\n 2.85238527394143, 2.82975892599489, 2.79196912313914,\n 2.72860792049395, 2.75585977414140, 2.44280222448805,\n 2.36052347370628, 2.26785071765738, 2.10868255743462,\n 2.06165739407987, 1.90047259509385, 1.39925575828709,\n 1.24749015957606, 0.867823806536762, 0.432752457749993, 0])\n # v2, i2 produces a bad value for I0_vmp\n v2 = np.array([0, 0.365686097622586, 0.731372195245173, 1.09705829286776,\n 1.46274439049035, 1.82843048811293, 2.19411658573552,\n 2.55980268335810, 2.92548878098069, 3.29117487860328,\n 3.65686097622586, 4.02254707384845, 4.38823317147104,\n 4.75391926909362, 5.11960536671621, 5.48529146433880,\n 5.85097756196138, 6.21666365958397, 6.58234975720655,\n 6.94803585482914, 7.31372195245173, 7.67940805007431,\n 8.04509414769690, 8.41078024531949, 8.77646634294207,\n 9.14215244056466, 9.50783853818725, 9.87352463580983,\n 10.2392107334324, 10.6048968310550, 10.9705829286776,\n 11.3362690263002, 11.7019551239228, 12.0676412215454,\n 12.4333273191679, 12.7990134167905, 13.1646995144131,\n 13.5303856120357, 13.8960717096583, 14.2617578072809,\n 14.6274439049035, 14.9931300025260, 15.3588161001486,\n 15.7245021977712, 16.0901882953938, 16.4558743930164,\n 16.8215604906390, 17.1872465882616, 17.5529326858841,\n 17.9186187835067, 18.2843048811293, 18.6499909787519,\n 19.0156770763745, 19.3813631739971, 19.7470492716197,\n 20.1127353692422, 20.4784214668648, 20.8441075644874,\n 21.2097936621100, 21.5754797597326, 21.9411658573552,\n 22.3068519549778, 22.6725380526004, 23.0382241502229,\n 23.4039102478455, 23.7695963454681, 24.1352824430907,\n 24.5009685407133, 24.8666546383359, 25.2323407359585,\n 25.5980268335810, 25.9637129312036, 26.3293990288262,\n 26.6950851264488, 27.0607712240714, 27.4264573216940,\n 27.7921434193166, 28.1578295169392, 28.5235156145617,\n 28.8892017121843, 29.2548878098069, 29.6205739074295,\n 29.9862600050521, 30.3519461026747, 30.7176322002973,\n 31.0833182979198, 31.4490043955424, 31.8146904931650,\n 32.1803765907876, 32.5460626884102, 32.9117487860328,\n 33.2774348836554, 33.6431209812779, 34.0088070789005,\n 34.3744931765231, 34.7401792741457, 35.1058653717683,\n 35.4715514693909, 35.8372375670135, 36.2029236646360])\n i2 = np.array([6.49218806928330, 6.49139336899548, 6.17810697175204,\n 6.75197816263663, 6.59529074137515, 6.18164578868300,\n 6.38709397931910, 6.30685422248427, 6.44640615548925,\n 6.88727230397772, 6.42074852785591, 6.46348580823746,\n 6.38642309763941, 5.66356277572311, 6.61010381702082,\n 6.33288284311125, 6.22475343933610, 6.30651399433833,\n 6.44435022944051, 6.43741711131908, 6.03536180208946,\n 6.23814639328170, 5.97229140403242, 6.20790000748341,\n 6.22933550182341, 6.22992127804882, 6.13400871899299,\n 6.83491312449950, 6.07952797245846, 6.35837746415450,\n 6.41972128662324, 6.85256717258275, 6.25807797296759,\n 6.25124948151766, 6.22229212812413, 6.72249444167406,\n 6.41085549981649, 6.75792874870056, 6.22096181559171,\n 6.47839564388996, 6.56010208597432, 6.63300966556949,\n 6.34617546039339, 6.79812221146153, 6.14486056194136,\n 6.14979256889311, 6.16883037644880, 6.57309183229605,\n 6.40064681038509, 6.18861448239873, 6.91340138179698,\n 5.94164388433788, 6.23638991745862, 6.31898940411710,\n 6.45247884556830, 6.58081455524297, 6.64915284801713,\n 6.07122119270245, 6.41398258148256, 6.62144271089614,\n 6.36377197712687, 6.51487678829345, 6.53418950147730,\n 6.18886469125371, 6.26341063475750, 6.83488211680259,\n 6.62699397226695, 6.41286837534735, 6.44060085001851,\n 6.48114130629288, 6.18607038456406, 6.16923370572396,\n 6.64223126283631, 6.07231852289266, 5.79043710204375,\n 6.48463886529882, 6.36263392044401, 6.11212476454494,\n 6.14573900812925, 6.12568047243240, 6.43836230231577,\n 6.02505694060219, 6.13819468942244, 6.22100593815064,\n 6.02394682666345, 5.89016573063789, 5.74448527739202,\n 5.50415294280017, 5.31883018164157, 4.87476769510305,\n 4.74386713755523, 4.60638346931628, 4.06177345572680,\n 3.73334482123538, 3.13848311672243, 2.71638862600768,\n 2.02963773590165, 1.49291145092070, 0.818343889647352, 0])\n\n return v1, i1, v2, i2\n"} {"text": "@file:Suppress(\"unused\")\n\npackage coil.transform\n\nimport android.graphics.Bitmap\nimport android.graphics.ColorMatrix\nimport android.graphics.ColorMatrixColorFilter\nimport android.graphics.Paint\nimport androidx.core.graphics.applyCanvas\nimport coil.bitmap.BitmapPool\nimport coil.size.Size\nimport coil.util.safeConfig\n\n/**\n * A [Transformation] that converts an image to shades of gray.\n */\nclass GrayscaleTransformation : Transformation {\n\n override fun key(): String = GrayscaleTransformation::class.java.name\n\n override suspend fun transform(pool: BitmapPool, input: Bitmap, size: Size): Bitmap {\n val paint = Paint(Paint.ANTI_ALIAS_FLAG or Paint.FILTER_BITMAP_FLAG)\n paint.colorFilter = COLOR_FILTER\n\n val output = pool.get(input.width, input.height, input.safeConfig)\n output.applyCanvas {\n drawBitmap(input, 0f, 0f, paint)\n }\n\n return output\n }\n\n override fun equals(other: Any?) = other is GrayscaleTransformation\n\n override fun hashCode() = javaClass.hashCode()\n\n override fun toString() = \"GrayscaleTransformation()\"\n\n private companion object {\n val COLOR_FILTER = ColorMatrixColorFilter(ColorMatrix().apply { setSaturation(0f) })\n }\n}\n"} {"text": "\nmodule.exports = process.env.STYLUS_COV\n ? require('./lib-cov/stylus')\n : require('./lib/stylus');"} {"text": "---\nlayout: base\ntitle: 'Statistics of PRON in UD_Italian-PUD'\nudver: '2'\n---\n\n## Treebank Statistics: UD_Italian-PUD: POS Tags: `PRON`\n\nThere are 43 `PRON` lemmas (1%), 61 `PRON` types (1%) and 861 `PRON` tokens (4%).\nOut of 16 observed tags, the rank of `PRON` is: 9 in number of lemmas, 10 in number of types and 9 in number of tokens.\n\nThe 10 most frequent `PRON` lemmas: si, che, suo, loro, ci, cui, lo, questo, quello, proprio\n\nThe 10 most frequent `PRON` types: che, si, sua, loro, suo, cui, lo, ci, questo, sue\n\nThe 10 most frequent ambiguous lemmas: che (PRON 173, SCONJ 143, ADP 13, CCONJ 10, DET 1), suo (PRON 140, DET 2), ci (PRON 36, PART 1), lo (PRON 31, DET 3), questo (DET 73, PRON 30), quello (PRON 28, DET 17), proprio (PRON 17, ADV 2, ADJ 1), quale (PRON 17, DET 1), il (DET 3052, PRON 9), quanto (PRON 9, ADV 1, CCONJ 1)\n\nThe 10 most frequent ambiguous types: che (PRON 173, SCONJ 143, ADP 13, CCONJ 10, DET 1), sua (PRON 55, DET 2), lo (DET 50, PRON 32), ci (PRON 19, PART 1), questo (DET 22, PRON 14), quella (PRON 14, DET 4), quali (PRON 10, ADP 2, DET 1), gli (DET 128, PRON 9), quanto (PRON 9, ADV 1, CCONJ 1), quale (PRON 7, DET 1)\n\n\n* che\n * PRON 173: Di solito , si tratta di artisti che vogliono fare molte cose .\n * SCONJ 143: È corretto sostenere che Rocco Catalano lavora , vive e respira retrò .\n * ADP 13: Forse non sarà importante visto che non mi disturberà a lungo .\n * CCONJ 10: Non avevo visto molto di gli episodi che il mio telefono iniziò a illuminar si .\n * DET 1: Non si capisce in che modo i due drammaturghi abbiano potuto lavorare insieme .\n* sua\n * PRON 55: Prima ha iniziato a piangere una donna Yazidi , poi una sua amica .\n * DET 2: La sua reputazione crebbe ulteriormente a corte quando fu mandato come emissario a la dinastia Khitan Liao in l' estate di il 1075 .\n* lo\n * DET 50: Chitarrista appassionato , ha tenuto lì un concerto lo stesso anno .\n * PRON 32: Non lo definisco una bestia con leggerezza .\n* ci\n * PRON 19: In il sito web Yas Marina Circuit ci sono gli orari esatti .\n * PART 1: Sfortunatamente ancora una volta per colpa di qualcuno ci rimettono in molti , ha scritto Jesse LaBrocca , fondatrice di Hack Forums , in un messaggio volto a spiegare i motivi che hanno portato a la chiusura di la sezione .\n* questo\n * DET 22: In questo contesto , ha senso essere contrari a il commercio .\n * PRON 14: Amici , questo non è ciò di cui abbiamo bisogno in il nostro paese .\n* quella\n * PRON 14: George era inorridito da quella che considerava la loro decadenza morale .\n * DET 4: Posto che la serie 1 non è più quella vecchia , molti utenti possono risparmiare 100 euro .\n* quali\n * PRON 10: Numerosi sono i reperti di epoca preistorica , tra i quali diversi menhir e dolmen .\n * ADP 2: Tuttavia , tra i risultati di l' urbanizzazione in Thailandia si conta anche l' aumento di problemi quali l' obesità .\n * DET 1: Ha ammesso , inoltre , che \" bisogna vedere in quali casi abbia riconosciuto la necessità di fare qualcosa di diverso - qualcosa di migliore - e in quali abbia espresso sentimenti di pentimento \" .\n* gli\n * DET 128: Stanotte useremo gli abbaglianti per le punizioni , si legge su il post .\n * PRON 9: Eppure , non tutti in il partito avevano capito il messaggio che il presidente aveva provato a mandar gli ieri .\n* quanto\n * PRON 9: È quanto scrive in una nota a Mps dopo la decisione di l' ex ministro di uscire da la partita .\n * ADV 1: Per quanto possa sembrare sorprendente , persino le nuvole di pioggia acida possono avere un risvolto positivo .\n * CCONJ 1: Ha anche rimarcato che \" l' esistenza di tale documento potrebbe portare a delle conseguenze tanto probabili quanto inaccettabili \" .\n* quale\n * PRON 7: Il 1 gennaio 49 d.C. , Marco Antonio lesse una dichiarazione di Cesare in la quale il proconsole si dichiarò amico di la pace .\n * DET 1: Ora è solo poco chiaro in quale .\n\n## Morphology\n\nThe form / lemma ratio of `PRON` is 1.418605 (the average of all parts of speech is 1.285799).\n\nThe 1st highest number of forms (4) was observed with the lemma “nostro”: nostra, nostre, nostri, nostro.\n\nThe 2nd highest number of forms (4) was observed with the lemma “proprio”: propri, propria, proprie, proprio.\n\nThe 3rd highest number of forms (4) was observed with the lemma “quello”: quella, quelle, quelli, quello.\n\n`PRON` occurs with 7 features: Number (824; 96% instances), Gender (609; 71% instances), Person (526; 61% instances), PronType (241; 28% instances), Number[psor] (225; 26% instances), Case (112; 13% instances), Reflex (3; 0% instances)\n\n`PRON` occurs with 14 feature-value pairs: `Case=Acc`, `Case=Nom`, `Gender=Fem`, `Gender=Masc`, `Number=Plur`, `Number=Sing`, `Number[psor]=Plur`, `Number[psor]=Sing`, `Person=1`, `Person=2`, `Person=3`, `PronType=Dem`, `PronType=Prs`, `Reflex=Yes`\n\n`PRON` occurs with 46 feature combinations.\nThe most frequent feature combination is `Number=Sing|Person=3` (139 tokens).\nExamples: si, se, ci, ne, s'\n\n\n## Relations\n\n`PRON` nodes are attached to their parents using 13 different relations: det:poss (228; 26% instances), expl (223; 26% instances), nsubj (177; 21% instances), obl (79; 9% instances), obj (78; 9% instances), iobj (21; 2% instances), nmod (21; 2% instances), nsubj:pass (20; 2% instances), conj (6; 1% instances), root (5; 1% instances), ccomp (1; 0% instances), det (1; 0% instances), expl:impers (1; 0% instances)\n\nParents of `PRON` nodes belong to 8 different parts of speech: VERB (553; 64% instances), NOUN (267; 31% instances), ADJ (27; 3% instances), PROPN (5; 1% instances), (5; 1% instances), NUM (2; 0% instances), ADV (1; 0% instances), DET (1; 0% instances)\n\n731 (85%) `PRON` nodes are leaves.\n\n76 (9%) `PRON` nodes have one child.\n\n39 (5%) `PRON` nodes have two children.\n\n15 (2%) `PRON` nodes have three or more children.\n\nThe highest child degree of a `PRON` node is 9.\n\nChildren of `PRON` nodes are attached using 19 different relations: case (104; 49% instances), punct (19; 9% instances), det (18; 8% instances), amod (13; 6% instances), nmod (12; 6% instances), acl:relcl (11; 5% instances), cop (7; 3% instances), advmod (6; 3% instances), cc (6; 3% instances), acl (4; 2% instances), nsubj (4; 2% instances), conj (3; 1% instances), advcl (1; 0% instances), appos (1; 0% instances), aux (1; 0% instances), ccomp (1; 0% instances), discourse (1; 0% instances), obj (1; 0% instances), parataxis (1; 0% instances)\n\nChildren of `PRON` nodes belong to 11 different parts of speech: ADP (102; 48% instances), PUNCT (19; 9% instances), DET (18; 8% instances), NOUN (15; 7% instances), VERB (15; 7% instances), ADJ (13; 6% instances), ADV (9; 4% instances), AUX (8; 4% instances), PROPN (7; 3% instances), CCONJ (6; 3% instances), NUM (2; 1% instances)\n\n"} {"text": "package org.zstack.test.core.thread;\n\nimport junit.framework.Assert;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.zstack.core.componentloader.ComponentLoader;\nimport org.zstack.core.thread.ChainTask;\nimport org.zstack.core.thread.SyncTaskChain;\nimport org.zstack.core.thread.ThreadFacade;\nimport org.zstack.test.BeanConstructor;\nimport org.zstack.utils.Utils;\nimport org.zstack.utils.logging.CLogger;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.concurrent.CountDownLatch;\nimport java.util.concurrent.TimeUnit;\n\npublic class TestChainTask6 {\n CLogger logger = Utils.getLogger(TestChainTask6.class);\n ComponentLoader loader;\n ThreadFacade thdf;\n int threadNum = 100000;\n List res = new ArrayList(threadNum);\n CountDownLatch latch = new CountDownLatch(threadNum);\n\n class Tester extends ChainTask {\n int index;\n\n Tester(int index) {\n super(null);\n this.index = index;\n }\n\n @Override\n public String getName() {\n return \"Test\";\n }\n\n @Override\n public String getSyncSignature() {\n return \"Test\";\n }\n\n @Override\n public int getSyncLevel() {\n return 10;\n }\n\n @Override\n public void run(SyncTaskChain chain) {\n logger.debug(String.valueOf(index));\n synchronized (res) {\n res.add(index);\n }\n\n latch.countDown();\n chain.next();\n }\n }\n\n @Before\n public void setUp() throws Exception {\n BeanConstructor con = new BeanConstructor();\n loader = con.build();\n thdf = loader.getComponent(ThreadFacade.class);\n }\n\n @Test\n public void test() throws InterruptedException {\n for (int i = 0; i < threadNum; i++) {\n Tester t = new Tester(i);\n thdf.chainSubmit(t);\n }\n\n latch.await(2, TimeUnit.MINUTES);\n Assert.assertEquals(threadNum, res.size());\n }\n}\n"} {"text": "

\n

\n Can I allow users to clear their selections?\n

\n\n

\n You can allow people to clear their current selections with the allowClear option when initializing Select2. Setting this option to true will enable an \"x\" icon that will reset the selection to the placeholder.\n

\n\n{% highlight js linenos %}\n$('select').select2({\n placeholder: 'This is my placeholder',\n allowClear: true\n});\n{% endhighlight %}\n\n

\n Why is a placeholder required?\n

\n\n {% include options/not-written.html %}\n\n

\n The \"x\" icon is not clearing the selection\n

\n\n {% include options/not-written.html %}\n\n

\n Can users remove all of their selections in a multiple select at once?\n

\n\n {% include options/not-written.html %}\n
"} {"text": "/* Icecast\n *\n * This program is distributed under the GNU General Public License, version 2.\n * A copy of this license is included with this source.\n *\n * Copyright 2000-2004, Jack Moffitt ,\n * oddsock ,\n * Karl Heyes \n * and others (see AUTHORS for details).\n */\n\n#ifndef __AUTH_CMD_H__\n#define __AUTH_CMD_H__\n\nint auth_get_cmd_auth (auth_t *, config_options_t *options);\n\n#endif\n\n\n"} {"text": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n text/microsoft-resx\n \n \n 2.0\n \n \n System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\n \n \n System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\n \n \n \n Fill\n \n \n \n 0, 0\n \n \n 608, 361\n \n \n \n 0\n \n \n findDataFrameControl\n \n \n CANAPE.Controls.FindDataFrameControl, CANAPE.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0d5b25a3516745f0\n \n \n $this\n \n \n 0\n \n \n True\n \n \n 6, 13\n \n \n 608, 361\n \n \n \n AAABAAMAEBAAAAAAAABoBQAANgAAACAgAAAAAAAAqAgAAJ4FAABAQAAAAAAAACgWAABGDgAAKAAAABAA\n AAAgAAAAAQAIAAAAAABAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8ALB2+ACMeUwAnHYQAHx4iACod\n oQAhHjYAJR5nACYdcgAgHiwAKR2XACIeSQAqHasAKx21ACEeQAAoHY4AJh1wACEePwAmHXEAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUFBQUFAAAAAAAAAAAAAAUF\n AAUFBQUAAAAAAAAAAAAFBQUFBQUFBQAAAAAAAAUFBQURCw0LEwoFAAAAAAUFBQUEAgIGAgIQBQUAAAAF\n BQUSAgIPBQoRCAUFBQAAAAUFCAILBQUFBQUFBQAAAAAFBRECCwUFBQUFBQUFAAAABQUDAg0FBQoOCAUF\n BQAABQUFCg4CEAwEAgkFBQAAAAAFBQUSDgICAgIRBQAAAAAABQUFBQoDCAwDBwUAAAAAAAAABQUFBQUF\n BQUFAAAAAAAAAAAFBQUFAAUFBQAAAAAAAAAAAAUFBQAAAAAAAAAAAAAAAAAFAAUAAAAAAAAA+D8AAPIf\n AADwDwAAwAcAAIADAACAAQAAwAMAAMABAADAAQAAgAMAAMAHAADABwAA8AcAAPhHAAD8fwAA/X8AACgA\n AAAgAAAAQAAAAAEACAAAAAAAgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AC0evwAXD2AACwgwACIX\n jwARC0gABgQYACcapwAcE3cAAwIMACocswAUDVQAHxWDAA4JPAAIBiQAJRibABkRawAMCDMAGhFtAAMC\n DQAGBBkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGDQgCCwUTBwAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAKEAICAgICAgICEQAAAAAAAAAAAAAAAAAAAAAAAAAAChACAgICAgICAgICAwAAAAAAAAAA\n AAAAAAAAAAAAAAAJAgICBQcAAAYQAgIJAAAAAAAAAAAAAAAAAAAAAAAACgICAggUAAAAAAAGAw8AAAAA\n AAAAAAAAAAAAAAAAAAAGAgICDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMCAgIEAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAwICAgoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAgICBAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYCAgIOAAAAAAAPCwgKAAAAAAAAAAAAAAAAAAAAAAAABwICAgUA\n AAAAAAkCAgQAAAAAAAAAAAAAAAAAAAAAAAAABQICAgMAAAAPAgICBAAAAAAAAAAAAAAAAAAAAAAAAAAH\n CwICAggFBQICAgISAAAAAAAAAAAAAAAAAAAAAAAAAAAPCwICAgICAgICAgQAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAKCQsCAgILCQICBwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8EBwAAFQcAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////5T///6AP//8M\n D///BA3//wAI//uABH/wAAD/8AAAP/AAAN/wAACP4AAAD+gAAB/4AAAf8AAAH/gAAA/cAAAP7AAAC/gA\n AB/oAAAf+QAA/+EAAP/4AAB//gAAf/8AAD//wAB//8Bj///gAz//8T////M////3P///////KAAAAEAA\n AACAAAAAAQAIAAAAAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AYlbPAFBQUACysbsAJBiZAICA\n gAASDEwA1dPnAFNNkwCJgNsAMDAwADoswwCVk6cAJh9vAAkGJgBLR3AAZl+vAO/v7wDFw9cAICAgAEBA\n QABgYGAAcHBwACocswAQEBAAj4+PAIN9wwAhG1gAHxWDADImnwAYEGcAVEjLAOLh6wC/v78ApaO3AHxy\n 1wBFRFgADQk3AMvH7wDPz88An5+fAIuHrwADAg8AFQ5ZACcapgDy8fsA39/fANjV8wATEhwAIyIsAMLB\n ywAbEnMAMzI8AK+vrwAtHr8AKSF7AJiVswBWT58AQ0JMAAYEGwCCgYsAIhePAFBMdwAPCkAAHRN7AAsI\n MAAXD2AAFA1UACAViAAOCTwAEAtEABkRawAeFH8AEQtIABwTdwAKBikADAgzACMYlgADAgwABgQYACoc\n sAAHBR0ACAYkACUYmwAnGqQAAwINAAYEGQAOCTsAJxqnAB8VhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAA3NwAAAAAAAAAANzcAAAAAAEsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADc3NzdFAABQAAAdAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANwAAAAAAAAAANzc3Nz5KUAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADcAAAAAAE83Nzc3AAAAGB0AAABQAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3AAAAU0ZTWTc3NwAAAAA3QgAAUwAAAD5XAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE0AUFQ3NwAAAAA3NwBAUEQAT1NU\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN0IAQhg3Nz4AAAAANwBPT0JL\n Pj43BwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADdGNzcYRFlUAAAAAEEA\n UwBQTwBLVFRPAABQRA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYAEs3VEMYPk9G\n QzdDQk8dPgAAAFk3SQAAT09DNwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYGD4Y\n N0tQRlBTAEIdQ1MAAFAAWTcAAAAAVDc3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AFMASE0AAAAAQlBURlAAUAAAAFdMAAAAAFQ3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n Nzc3QzcAAAAAAAAZFg0zJyIzEyMXAAAAAAAAAFlZAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAATzc3Nzc3AAAAABkGEgEBAQEBAQEBAQEoFgBPAENQTyxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAUB03Nzc3NwAAABUSAQEBAQEBAQEBAQEBAQEvNUpDT1A3GEFDAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAABLWUJGPkMAABYBAQEBAQEBAQEBAQEBAQEBAQERGEJLNwAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAA8QkIARgBTTzUBAQEBAQEBAQEBAQEBAQEBAQEBLktTSDcAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAABGAAAAAAAAJjEvAQEBAQEBLxYUSlkgOSEBAQEBAQEAT0Y3AAAAAABUNwAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAABQVPAAAAAFM9AQEBAQEBKQAAAENZN0g3JC4BAQESAFNTGDcAGEIA\n NzcAAAAAAAAAAAAAAAAAAAAAAAAAAAAARzc3PlNPAAAALgEBAQEBKAAAAAAAT0hQVFQMGy8vFQBTAFQ3\n Nx1PUzc3AAAAAAAAAAAAAAAAAAAAAAAAAAAAQlQ3AFlKWUIAAwEBAQEBARVTU0JOAFBLAERPQ0sAUAAA\n AEJGRjdITwA+NwAAAAAAAAAAAAAAAAAAAAAAAAAAK1Q3AAA3NzcdAA0BAQEBASgAAABXVFQ3N1QdUEJU\n AAAAAFMAU09QUwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3AAA0Pj43WUsiAQEBAQENQ1BQT1k3NzdU\n REhCTwAAAAAAT08AUlNPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQxhUEgEBAQEBG09PAE9E\n Q0MYNzdDUAAAAAAAAABPAABLDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASkQAQgBUHQEBAQEBARBQ\n VFBKN0MASDc3QwAAAAAAAABQQkYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT0oAAAABAQEB\n AQEVAEtEPgAAAE9PUFAAAAAAAAAAAERIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABaLVRCAAAA\n AQEBAQEBFQBPU09EQgAAT1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANxg3\n QwAAACgBAQEBAQYAAAAAT0QAAAAAAAAAAAAAAFAATwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAHUoAAAA2AQEBAQEpAABEHUZLAEJQRE8GAQEiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAABPAAAAFwEBAQEBL0Y+NzdIQgAAQj4yAQEBARUAAAAAAAAAAAAAAAAAADcAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAATwAAABQBAQEBAQEkGEQ3Q1QAAABGFwEBAQEVAE9PU09QAAAAAAAAADcAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAIgEBAQEBLjgAPjc3UwBEQi8BAQEBFQBDS0YAAAAAAFAAAAA3AAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABTACUBAQEBAQEoC0Q3N1MATykBAQEBARUAUVNQAE8AAAA3AAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAE9QAEMAAAAAGgEBAQEBAQEECgIJBi8BAQEBAQEVAABGGFMAAFNI\n WQAAAAAAAAAAAAAAAAAAAAAAAAAANzcAAABPAAA+SwAAAA4wAQEBAQEBAQEBAQEBAQEBAQEBFQAAAABG\n AABQAAAAAAAAAAAAAAAAAAAAAAAAAAAANwA3AAAAQwAAAAAmAABLDAgBAQEBAQEBAQEBAQEBAQEBAT8F\n SgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEMAAAAAQwAAWUgcDQEBAQEBAQEBAQEBAQEB\n AQE7GERPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADc3NwAAAEoAAAAAAERPQgAVNgEBAQEBAQEB\n LxopAQEBFEo3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADcAAABVUwAAAE9EAEIAUwAeOioG\n BgYWCwAAABcGFQBMQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVwAAAABDQwAARBgA\n HUZCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQ\n U0ZKN0NTUwAAAAAAAAAAAAAAJgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3AAAAAAAA\n AAAAAAAAAFQ+AFAAAAAAAAAAAAAAAE8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAABQN0IAAABPAAAAAAAAAAVTUwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAUEtTAFBQT0kAAAAAAABCRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPTwAAAAAAAAAAADxTAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASlMAAAAAAAAAAAAAH1MAAE8AAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANzcYQgAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVkoAUwAAADwAADcAADdEAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFgAAAAAAAAAAAA3RgAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVwAAAAAAAAAAQgAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAH0IAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVAAAAAAAAEZK\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADcAAAAA\n AABWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////\n //////////////////////////////////////////////////////////P8+5////////wDD//////9\n 7gIB//////3Aco3//////YB4Gf//////gPAD//////8ANAGf/////wAxAY//////AAABh//////AAAGD\n ////9+AAAcP////EAAARy////9AAAAAD////0AAAAAD///+IAAAABX///6AAAAAGn///yAAAAAfP///A\n AAAAAg///4AAEAAAD///iAACAAAP//8YAAAAAD///7AAAAAAH///4AAAAABf///AAAAAAB///+AAAAAA\n H///4AAAAAAH///gAAAAAGf//vgAAAAAB///+AAAAAAO//84AAAAAA3//zAAAABAjf//8AAAAEDf//+Q\n AAAAYB///nAAAAAZP//9cYAAAAP////xgAAAB////xmAAAAT////0AAAAAD////0AAAEAv////8AAAAB\n ////7wAAAgD/////gAACA//////AAEAC//////wAQAH/////+gBwA//////6AHg///////wAMHz/////\n /AIWfP/////+Al5///////8EH////////w8/////////vz////////+/X////////78f////////////\n //////////////////////////////////8=\n\n \n \n Find DataFrame\n \n \n FindDataFrameForm\n \n \n System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\n \n"} {"text": "uses\n\tCore,\n\tRichText,\n\tPdfDraw;\n\nfile\n\ttest.qtf,\n\tQtf.cpp;\n\nmainconfig\n\t\"\" = \"\";\n\n"} {"text": "/*****Argon2d optimized implementation (SSE3)*\n* Code written by Daniel Dinu and Dmitry Khovratovich\n* khovratovich@gmail.com\n**/\n\n\n\n#include \n#include \n#include \n#if defined(_MSC_VER) // ADDED\n#else\n#include \n#include \n#endif\n\n#include \n#include \nusing namespace std;\n\n// Intrinsics\n#if defined(_MSC_VER) // ADDED\n#else\n#include \n\n#include \n\n#endif\n// BLAKE2 round\n#include \"blake2-round.h\"\n#include \"blake2.h\"\n\n// Constants\n# include \"argon2i.h\"\n\n\n\n\n#define MEASURE\n\n\n\n\n\n\n__m128i t0, t1;\nconst __m128i r16 = _mm_setr_epi8(2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9);\nconst __m128i r24 = _mm_setr_epi8(3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, 14, 15, 8, 9, 10);\n\n//#define BLOCK_OFFSET(l,s) {}\n\n\nvoid allocate_memory(uint8_t **memory,uint32_t m_cost)\n{\n\t*memory = (uint8_t *) _mm_malloc((size_t)m_cost<<10, ALIGN_ARGON);\n\tif(!*memory)\n\t{\n\t\tprintf(\"Could not allocate the requested memory!\\n\");\n\t\texit(1);\n\t}\n}\n\nvoid free_memory(uint8_t **memory)\n{\n\tif(*memory)\n\t{\n\t\t_mm_free ((void *) *memory);\n\t}\n}\n\n\n\nvoid ComputeBlock(__m128i *state, uint8_t* ref_block_ptr, uint8_t* next_block_ptr)\n{\n\t__m128i ref_block[64];\n\n\n\n\tfor (uint8_t i = 0; i < 64; i++)\n\t{\n\t\tref_block[i] = _mm_load_si128((__m128i *) ref_block_ptr);\n\t\tref_block_ptr += 16;\n\t}\n\n\tfor (uint8_t i = 0; i < 64; i++)\n\t{\n\t\tref_block[i] = state[i] = _mm_xor_si128(state[i], ref_block[i]); //XORing the reference block to the state and storing the copy of the result\n\t}\n\n\n\t// BLAKE2 - begin\n\n\tBLAKE2_ROUND(state[0], state[1], state[2], state[3],\n\t\tstate[4], state[5], state[6], state[7]);\n\n\tBLAKE2_ROUND(state[8], state[9], state[10], state[11],\n\t\tstate[12], state[13], state[14], state[15]);\n\n\tBLAKE2_ROUND(state[16], state[17], state[18], state[19],\n\t\tstate[20], state[21], state[22], state[23]);\n\n\tBLAKE2_ROUND(state[24], state[25], state[26], state[27],\n\t\tstate[28], state[29], state[30], state[31]);\n\n\tBLAKE2_ROUND(state[32], state[33], state[34], state[35],\n\t\tstate[36], state[37], state[38], state[39]);\n\n\tBLAKE2_ROUND(state[40], state[41], state[42], state[43],\n\t\tstate[44], state[45], state[46], state[47]);\n\n\tBLAKE2_ROUND(state[48], state[49], state[50], state[51],\n\t\tstate[52], state[53], state[54], state[55]);\n\n\tBLAKE2_ROUND(state[56], state[57], state[58], state[59],\n\t\tstate[60], state[61], state[62], state[63]);\n\n\n\tBLAKE2_ROUND(state[0], state[8], state[16], state[24],\n\t\tstate[32], state[40], state[48], state[56]);\n\n\tBLAKE2_ROUND(state[1], state[9], state[17], state[25],\n\t\tstate[33], state[41], state[49], state[57]);\n\n\tBLAKE2_ROUND(state[2], state[10], state[18], state[26],\n\t\tstate[34], state[42], state[50], state[58]);\n\n\tBLAKE2_ROUND(state[3], state[11], state[19], state[27],\n\t\tstate[35], state[43], state[51], state[59]);\n\n\tBLAKE2_ROUND(state[4], state[12], state[20], state[28],\n\t\tstate[36], state[44], state[52], state[60]);\n\n\tBLAKE2_ROUND(state[5], state[13], state[21], state[29],\n\t\tstate[37], state[45], state[53], state[61]);\n\n\tBLAKE2_ROUND(state[6], state[14], state[22], state[30],\n\t\tstate[38], state[46], state[54], state[62]);\n\n\tBLAKE2_ROUND(state[7], state[15], state[23], state[31],\n\t\tstate[39], state[47], state[55], state[63]);\n\n\t// BLAKE2 - end\n\n\tfor (uint8_t i = 0; i< 64; i++)\n\t{\n\t\tstate[i] = _mm_xor_si128(state[i], ref_block[i]); //Feedback\n\t\t_mm_store_si128((__m128i *) next_block_ptr, state[i]);\n\t\tnext_block_ptr += 16;\n\t}\n}\n\n\n\nvoid Initialize(scheme_info_t* info,uint8_t* input_hash)\n{\n\tuint8_t block_input[BLAKE_INPUT_HASH_SIZE + 8];\n\tuint32_t segment_length = (info->mem_size / (SYNC_POINTS*(info->lanes)));\n\tmemcpy(block_input, input_hash, BLAKE_INPUT_HASH_SIZE);\n\tmemset(block_input + BLAKE_INPUT_HASH_SIZE, 0, 8);\n\tfor (uint8_t l = 0; l < info->lanes; ++l)\n\t{\n\t\tblock_input[BLAKE_INPUT_HASH_SIZE + 4] = l;\n\t\tblock_input[BLAKE_INPUT_HASH_SIZE] = 0;\n\t\tblake2b_long(info->state + l * segment_length*BLOCK_SIZE, block_input, BLOCK_SIZE, BLAKE_INPUT_HASH_SIZE + 8);\n\t\tblock_input[BLAKE_INPUT_HASH_SIZE] = 1;\n\t\tblake2b_long(info->state + (l * segment_length + 1)*BLOCK_SIZE, block_input, BLOCK_SIZE, BLAKE_INPUT_HASH_SIZE + 8);\n\t}\n\tmemset(block_input, 0, BLAKE_INPUT_HASH_SIZE + 8);\n}\n\nvoid Finalize(uint8_t *state, uint8_t* out, uint32_t outlen, uint8_t lanes, uint32_t m_cost)//XORing the last block of each lane, hashing it, making the tag.\n{\n\t__m128i blockhash[BLOCK_SIZE/16];\n\tmemset(blockhash, 0, BLOCK_SIZE);\n\tfor (uint8_t l = 0; l < lanes; ++l)//XORing all last blocks of the lanes\n\t{\n\t\tuint32_t segment_length = m_cost / (SYNC_POINTS*lanes);\n\t\tuint8_t* block_ptr = state + (((SYNC_POINTS - 1)*lanes+l+1)*segment_length-1)*BLOCK_SIZE; //points to the last block of the first lane\n\n\t\tfor (uint32_t j = 0; j < BLOCK_SIZE / 16; ++j)\n\t\t{\n\t\t\tblockhash[j] = _mm_xor_si128(blockhash[j], *(__m128i*)block_ptr);\n\t\t\tblock_ptr += 16;\n\t\t}\n\t}\n\tblake2b_long(out, blockhash, outlen, BLOCK_SIZE);\n\n#ifdef KAT\n\tFILE* fp = fopen(KAT_FILENAME, \"a+\");\n\tfprintf(fp, \"Tag: \");\n\tfor (unsigned i = 0; ipass;\n\tinput_block[1] = position->lane;\n\tinput_block[2] = position->slice;\n\tinput_block[3] = position->index;\n\tinput_block[4] = 0xFFFFFFFF;\n\tComputeBlock((__m128i*)input_block, zero_block, (uint8_t*)addresses);\n\tComputeBlock((__m128i*)zero_block, (uint8_t*)addresses, (uint8_t*)addresses);\n\n\n\t/*Making block offsets*/\n\tuint32_t segment_length = info->mem_size / ((info->lanes)*SYNC_POINTS);\n\tuint32_t barrier1 = (position->slice) * segment_length*(info->lanes); //Number of blocks generated in previous slices\n\tuint32_t barrier2; //Number of blocks that we can reference in total (including the last blocks of each lane\n\n\tuint32_t start = 0;\n\tif (position->pass == 0)//Including later slices for second and later passes\n\t{\n\t\tbarrier2 = barrier1;\n\t\tif (position->slice == 0 && position->index==0)\n\t\t\tstart = 2;\n\t}\n\telse\n\t\tbarrier2 = barrier1 + (SYNC_POINTS - position->slice - 1) * segment_length*(info->lanes);\n\t\n\tif (position->index == 0 && start==0)/*Special rule for first block of the segment, if not very first blocks*/\n\t{\n\t\tuint32_t r = barrier2 - (info->lanes);\n\t\tuint32_t reference_block_index = addresses[0] % r;\n\t\tuint32_t prev_block_recalc = (position->slice > 0) ? ((position->slice - 1)*(info->lanes)*segment_length) : (SYNC_POINTS - 2)*(info->lanes)*segment_length;\n\n\t\t/*Shifting to have gaps in the last blocks of each lane*/\n\t\tif (reference_block_index >= prev_block_recalc)\n\t\t{\n\t\t\tuint32_t shift = (reference_block_index - prev_block_recalc) / (segment_length - 1);\n\t\t\treference_block_index += (shift > info->lanes) ? info->lanes : shift;\n\t\t}\n\t\tif (reference_block_index < barrier1)\n\t\t\taddresses[0] = reference_block_index*BLOCK_SIZE;\n\t\telse\n\t\t{\n\t\t\tif (reference_block_index >= barrier1 && reference_block_index < barrier2)\n\t\t\t\taddresses[0] = (reference_block_index + segment_length*(info->lanes)) * BLOCK_SIZE;\n\t\t\telse\n\t\t\t\taddresses[0] = (reference_block_index - (barrier2 - barrier1) + (position->lane) * segment_length) * BLOCK_SIZE;\n\t\t}\n\t\tstart = 1;\n\t}\n\t\n\tfor (uint32_t i = start; i < ADDRESSES_PER_BLOCK; ++i)\n\t{\n\t\tuint32_t r = barrier2 + (position->index)*ADDRESSES_PER_BLOCK+i - 1;\n\t\tuint32_t reference_block_index = addresses[i] % r;\n\t\t//Mapping the reference block address into the memory\n\t\tif (reference_block_index < barrier1)\n\t\t\taddresses[i] = reference_block_index*BLOCK_SIZE;\n\t\telse\n\t\t{\n\t\t\tif (reference_block_index >= barrier1 && reference_block_index < barrier2)\n\t\t\t\taddresses[i] = (reference_block_index + segment_length*(info->lanes)) * BLOCK_SIZE;\n\t\t\telse\n\t\t\t\taddresses[i] = (reference_block_index - (barrier2 - barrier1) + (position->lane) * segment_length) * BLOCK_SIZE;\n\t\t}\n\t}\n}\n\nvoid FillSegment(const scheme_info_t* info, const position_info_t position)\n{\n\t__m128i prev_block[64];\n\tuint32_t addresses[ADDRESSES_PER_BLOCK];\n\tuint32_t next_block_offset;\n\tuint8_t *memory = info->state;\n\tuint32_t pass = position.pass;\n\tuint32_t slice = position.slice;\n\tuint8_t lane = position.lane;\n\tuint8_t lanes = info->lanes;\n\tuint32_t m_cost = info->mem_size;\n\tposition_info_t position_local = position;\n\n\tuint32_t segment_length = m_cost / (lanes*SYNC_POINTS);\n\t//uint32_t stop = segment_length;//Number of blocks to produce in the segment, is different for the first slice, first pass\n\tuint32_t start=0;\n\n\tuint32_t prev_block_offset; //offset of previous block\n\tuint32_t prev_block_recalc=0; //number of the first block in the reference area in the previous slice \n\n\tif(0 == pass && 0 == slice) // First pass; first slice\n\t{\n\t\tstart += 3;\n\t\tif (segment_length <= 2)\n\t\t\treturn;\n\n\t\tuint32_t bi = prev_block_offset = (lane * segment_length + 1) * BLOCK_SIZE;// -- temporary variable for loading previous block\n\t\tfor (uint8_t i = 0; i < 64; i++)\n\t\t{\n\t\t\tprev_block[i] = _mm_load_si128((__m128i *) &memory[bi]);\n\t\t\tbi += 16;\n\t\t}\n\t\t\n\t\tnext_block_offset = (lane * segment_length + 2) * BLOCK_SIZE;\n\n\t\tuint32_t reference_block_offset = (lane * segment_length) * BLOCK_SIZE;\n\n\t\t// compute block\n\t\tComputeBlock(prev_block, memory+ reference_block_offset, memory+next_block_offset);//Computing third block in the segment\n\t\tposition_local.index = 0;\n\t\tGenerateAddresses(info, &position_local, addresses);\n\t}\n\telse\n\t{\n\t\tuint32_t prev_slice = (slice>0)?(slice-1):(SYNC_POINTS-1);\n\t\tuint32_t bi = prev_block_offset = ((prev_slice * lanes + lane + 1) * segment_length - 1) * BLOCK_SIZE;// -- temporary variable for loading previous block\n\t\tfor (uint8_t i = 0; i < 64; i++)\n\t\t{\n\t\t\tprev_block[i] = _mm_load_si128((__m128i *) &memory[bi]);\n\t\t\tbi += 16;\n\t\t}\n\t}\n\n\tnext_block_offset = ((slice*lanes + lane)*segment_length + start)*BLOCK_SIZE;\n\tfor(uint32_t i = start; i < segment_length; i++)\n\t{\n\t\t// compute block\n\t\tif ((i&ADDRESSES_MASK) == 0)\n\t\t{\n\t\t\tposition_local.index = i / ADDRESSES_PER_BLOCK;\n\t\t\tGenerateAddresses(info, &position_local, addresses);\n\t\t}\n\t\tComputeBlock(prev_block, memory+addresses[i&ADDRESSES_MASK], memory + next_block_offset);\n\t\tnext_block_offset += BLOCK_SIZE;\n\t}\n}\n\n\n\nvoid FillMemory(const scheme_info_t* info)//Main loop: filling memory times\n{\n\tvector Threads;\n\tposition_info_t position(0,0,0,0);\n\tfor (uint32_t p = 0; p < info->passes; p++)\n\t{\n\t\tposition.pass = p;\n\t\tfor (uint32_t s = 0; s < SYNC_POINTS; s++)\n\t\t{\n\t\t\tposition.slice = s;\n\t\t\tfor (uint32_t t = 0; t < info->lanes; t++)\n\t\t\t{\n\t\t\t\tposition.lane = t;\n\t\t\t\tThreads.push_back(thread(FillSegment,info,position));\n\t\t\t\t//FillSegment(info, position);\n\t\t\t}\n\t\t\tfor (auto& th : Threads)\n\t\t\t{\n\t\t\t\tth.join();\n\t\t\t}\n\t\t\tThreads.clear();\n\t\t}\n#ifdef KAT_INTERNAL\n\t\tFILE* fp = fopen(KAT_FILENAME, \"a+\");\n\t\tfprintf(fp, \"\\n After pass %d:\\n\", p);\n\t\tfor (uint32_t i = 0; i < info->mem_size; ++i)\n\t\t{\n\t\t\tfprintf(fp, \"Block %.4d [0]: %x\\n\", i, *(uint32_t*)(info->state+i*BLOCK_SIZE));\n\n\t\t}\n\t\tfclose(fp);\n#endif\n\t}\n}\n\n\nint Argon2iOpt(uint8_t *out, uint32_t outlen, const uint8_t *msg, uint32_t msglen, const uint8_t *nonce, uint32_t noncelen, const uint8_t *secret,\n\tuint8_t secretlen, const uint8_t *ad, uint32_t adlen, uint32_t t_cost, uint32_t m_cost, uint8_t lanes)\n{\n\tif (outlen>MAX_OUTLEN)\n\t\toutlen = MAX_OUTLEN;\n\tif (outlen < MIN_OUTLEN)\n\t\treturn -1; //Tag too short\n\n\tif (msglen> MAX_MSG)\n\t\tmsglen = MAX_MSG;\n\tif (msglen < MIN_MSG)\n\t\treturn -2; //Password too short\n\n\tif (noncelen < MIN_NONCE)\n\t\treturn -3; //Salt too short\n\tif (noncelen> MAX_NONCE)\n\t\tnoncelen = MAX_NONCE;\n\n\tif (secretlen> MAX_SECRET)\n\t\tsecretlen = MAX_SECRET;\n\tif (secretlen < MIN_SECRET)\n\t\treturn -4; //Secret too short\n\n\tif (adlen> MAX_AD)\n\t\tadlen = MAX_AD;\n\tif (adlen < MIN_AD)\n\t\treturn -5; //Associated data too short\n\n\t//minumum m_cost =8L blocks, where L is the number of lanes\n\tif (m_cost < 2 * SYNC_POINTS*(uint32_t)lanes)\n\t\tm_cost = 2 * SYNC_POINTS*(uint32_t)lanes;\n\tif (m_cost>MAX_MEMORY)\n\t\tm_cost = MAX_MEMORY;\n\n\tm_cost = (m_cost / (lanes*SYNC_POINTS))*(lanes*SYNC_POINTS); //Ensure that all segments have equal length;\n\n\t//minimum t_cost =3\n\tif (t_costm_cost / BLOCK_SIZE_KILOBYTE)\n\t\tlanes = m_cost / BLOCK_SIZE_KILOBYTE;\n\n\tuint64_t begin, end;\n\tunsigned int ui1, ui2; \n\t//struct timeval tv1, tv2;\n\n\t\n\t//printf(\"---Begin---\\n\");\n\tuint8_t *memory;\n\t\n#ifdef MEASURE\n//\tgettimeofday(&tv1, NULL);\n\tbegin = __rdtscp(&ui1);\n#endif \n\n\t//Initial hashing\n\tuint8_t blockhash[BLAKE_INPUT_HASH_SIZE];//H_0 in the document\n\tmemset(blockhash, 0, BLAKE_INPUT_HASH_SIZE);\n\tuint8_t version = VERSION_NUMBER;\n\tblake2b_state BlakeHash;\n\tblake2b_init(&BlakeHash, BLAKE_INPUT_HASH_SIZE);\n\n\tblake2b_update(&BlakeHash, (const uint8_t*)&lanes, sizeof(lanes));\n\tblake2b_update(&BlakeHash, (const uint8_t*)&outlen, sizeof(outlen));\n\tblake2b_update(&BlakeHash, (const uint8_t*)&m_cost, sizeof(m_cost));\n\tblake2b_update(&BlakeHash, (const uint8_t*)&t_cost, sizeof(t_cost));\n\tblake2b_update(&BlakeHash, (const uint8_t*)&version, sizeof(version));\n\tblake2b_update(&BlakeHash, (const uint8_t*)&msglen, sizeof(msglen));\n\tblake2b_update(&BlakeHash, (const uint8_t*)msg, msglen);\n\tblake2b_update(&BlakeHash, (const uint8_t*)&noncelen, sizeof(noncelen));\n\tblake2b_update(&BlakeHash, (const uint8_t*)nonce, noncelen);\n\tblake2b_update(&BlakeHash, (const uint8_t*)&secretlen, sizeof(secretlen));\n\tblake2b_update(&BlakeHash, (const uint8_t*)secret, secretlen);\n\tblake2b_update(&BlakeHash, (const uint8_t*)&adlen, sizeof(adlen));\n\tblake2b_update(&BlakeHash, (const uint8_t*)ad, adlen);\n\n\n\tblake2b_final(&BlakeHash, blockhash, BLAKE_INPUT_HASH_SIZE); //Calculating H0\n#ifdef KAT\n\tFILE* fp = fopen(KAT_FILENAME, \"a+\");\n\n\tfprintf(fp, \"=======================================\\n\");\n\tfprintf(fp, \"Iterations: %d, Memory: %d KBytes, Parallelism: %d lanes, Tag length: %d bytes\\n\", t_cost, m_cost, lanes, outlen);\n\n\n\n\tfprintf(fp, \"Message: \");\n\tfor (unsigned i = 0; i passes\n\n\tFinalize(memory, out,outlen, lanes, m_cost);\n\n\tfree_memory(&memory);\n\n#ifdef MEASURE\n\tend = __rdtscp(&ui2);\n#endif\n\t//gettimeofday(&tv2, NULL);\n\n\n\t//print_block(&memory[(BLOCKS - 1) * BLOCK_SIZE]);\n\t\n/*#ifdef MEASURE\t\n\tuint64_t cycles = end - begin;\n\t//double time = (tv2.tv_sec - tv1.tv_sec) + (tv2.tv_usec - tv1.tv_usec) / USEC_TO_SEC;\n\t\n\tprintf(\"=== Results - begin === \\n\");\n\tprintf(\"Memory Size (GB): %lf\\n\", m_cost >> 20);\n\tprintf(\"\\n\");\n\tprintf(\"Passes: %d\\n\", t_cost);\n\tprintf(\"Syncs: %d\\n\", SYNC_POINTS);\n\tprintf(\"Threads: %d\\n\", lanes);\n\tprintf(\"\\n\");\n\tprintf(\"Cycles: %\" PRIu64 \"\\n\", cycles);\n\tprintf(\"Cycles/Byte: %lf\\n\", (double)(cycles / (m_cost * 1024.0))); \n\tprintf(\"Time (s): %lf\\n\", time);\n\t//printf(\"Bandwidth (GB/s): %lf\\n\", (((2 * THREAD_BLOCKS - 1) * THREADS * PASSES * BLOCK_SIZE) / BYTES_TO_GIGABYTES) / time);\n\tprintf(\"=== Results - end === \\n\");\n\n\tprintf(\"---End---\\n\");\n#endif*/\n\n\treturn 0;\n}\n\nint PHS(void *out, size_t outlen, const void *in, size_t inlen, const void *salt, size_t saltlen,\n\t unsigned int t_cost, unsigned int m_cost)\n {\n\treturn Argon2iOpt((uint8_t*)out, (uint32_t)outlen, (const uint8_t*)in, (uint32_t)inlen, (const uint8_t*)salt, (uint32_t)saltlen, NULL, 0, NULL, 0, (uint32_t)t_cost, (uint32_t)m_cost, 1);\n }\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\nCLASS({\n package: 'foam.grammars',\n name: 'CSSDeclTest',\n\n requires: [ 'foam.grammars.CSSDecl' ],\n imports: [ 'assert' ],\n\n properties: [\n {\n type: 'foam.grammars.CSSDecl',\n name: 'css',\n defaultValue: ''\n }\n ],\n\n methods: [\n function testSetUp() {\n this.css = this.CSSDecl.create();\n },\n function testTearDown() {\n this.css = '';\n },\n function parseString(str, opt_production) {\n var production = opt_production || 'START';\n var p = this.css.parser;\n var ps = p.stringPS;\n ps.str = str;\n var res = p.parse(p[production], ps);\n\n return res;\n },\n function testProduction(production, posEg, opt_negEg) {\n var negEg = opt_negEg || [], results = [];\n var res, i;\n for ( i = 0; i < posEg.length; ++i ) {\n res = this.parseString(posEg[i], production);\n this.assert(res && typeof res.value === 'string' &&\n res.toString() === '',\n 'Expected parse from \"' + posEg[i] + '\" on production \"' +\n production + '\"');\n results.push(res);\n }\n for ( i = 0; i < negEg.length; ++i ) {\n try {\n res = this.parseString(negEg[i], production);\n this.assert(!(res && res.value) || res.toString() !== '',\n 'Expected parse failure from \"' + negEg[i] +\n '\" on production \"' + production + '\"');\n results.push(res);\n } catch (e) {\n results.push(res);\n }\n }\n return results;\n },\n ],\n\n tests: [\n {\n model_: 'UnitTest',\n name: 'Stylesheet',\n description: 'Test stylesheet production',\n code: function() {\n var posEgs = [\n '',\n 'a;',\n ' a; ',\n 'a{}',\n ' a {} ',\n 'a .b{}',\n 'a .b {}',\n 'a .b #c {}',\n 'a .b #c:d {}',\n 'a .b #c:d e::f {}',\n 'a;b{}',\n ' a ; b { } ',\n 'a { b: c }',\n 'a { b: c; }',\n 'a { b{} }',\n 'a { b #c:d e::f {} }',\n 'a { b{ c{} } }',\n 'a { b{ #c:d e::f {} } }',\n 'a { b{ c{ d: e; f: g; } } }',\n ];\n var negEgs = [\n '}',\n ' }',\n ' } ',\n 'a { b{} c; }',\n 'a { b; c{} }',\n 'a { b: c; d{} }',\n ];\n\n this.testProduction('stylesheet', posEgs, negEgs);\n }\n },\n {\n model_: 'UnitTest',\n name: 'Stylesheet',\n description: 'Test declaration rewrite',\n code: function() {\n var prefixes = this.css.PREFIXES;\n var keys = this.css.PREFIXED_KEYS;\n var posEgs = [];\n var negEgs = [];\n var expected = [];\n Object_forEach(keys, function(v, k) {\n posEgs.push('a{' + k + ':' + v + '}');\n var exp = [];\n for ( var i = 0; i < prefixes.length; ++i ) {\n if ( v === true ) exp.push(prefixes[i] + k + ':' + v);\n else exp.push(k + ':' + prefixes[i] + v);\n }\n expected.push(exp);\n });\n\n var results = this.testProduction('stylesheet', posEgs, negEgs);\n this.assert(results.length == expected.length, 'Expected number of ' +\n 'results to match number of expectations');\n for ( var i = 0; i < results.length; ++i ) {\n for ( var j = 0; j < expected[i].length; ++j ) {\n this.assert(results[i].value.indexOf(expected[i][j]) >= 0,\n 'Expected parse value \"' + results[i].value + '\" to ' +\n 'contain \"' + expected[i][j] + '\"');\n }\n }\n }\n },\n {\n model_: 'UnitTest',\n name: 'Function-in-function',\n description: 'Test functions in functions',\n code: function() {\n var posEgs = [\n multiline(function() {/*\n@font-face {\nbackground: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );\n}\n*/}),\n ];\n var negEgs = [];\n\n var results = this.testProduction('stylesheet', posEgs, negEgs);\n\n var result = results[0].value;\n var expected = '@font-face{background:-webkit-gradient(linear, left ' +\n 'top, left bottom, color-stop(0.05, #ededed), color-stop(1, ' +\n '#dfdfdf))}';\n this.assert(result === expected, 'Expected parse to be \"' + expected +\n '\", and got \"' + result + '\"');\n }\n },\n {\n model_: 'UnitTest',\n name: 'Stylesheet',\n description: 'Test large stylesheet',\n code: function() {\n var posEgs = [\n multiline(function() {/*\nhtml, body {\n margin: 0px;\n padding: 0px;\n}\n\nbody {\n font-family: Roboto, \"Lucida Grande\", \"Lucida Sans Unicode\", Verdana, Arial, Helvetica, sans-serif;\n font-size: 12px;\n}\np, h1, form, button {\n border: 0;\n margin: 0;\n padding: 0;\n}\n\n.spacer {\n clear: both;\n height: 1px;\n}\n\n.foamform {\n margin: 0 auto;\n width: 450px;\n padding: 14px;\n}\n\n.stackview {\n width: 100%;\n}\n\n.stackview-viewarea {\n width: 100%;\n}\n\n.stackview-previewarea {\n height: 100%;\n}\n\n.stackview-previewarea .actionToolbar {\n display: none;\n}\n\n.stackview-slidearea {\n background: white;\n box-shadow: 0px 0px 30px black;\n height: 100%;\n position: fixed;\n z-index: 4;\n}\n\n.stackview-dimmer {\n background: black;\n height: 100%;\n width: 100%;\n position: fixed;\n top: 0;\n opacity: 0;\n z-index: -1;\n transition: opacity 0.3s;\n}\n\n\n.detailView {\n display: table;\n border: solid 2px #dddddd;\n background: #fafafa;\n width: 99%;\n}\n\n.detailView .heading {\n float: left;\n font-size: 14px;\n font-weight: bold;\n margin-bottom: 8px;\n}\n\n.detailView .propertyLabel {\n font-size: 14px;\n display: block;\n font-weight: bold;\n text-align: right;\n float: left;\n}\n\n.detailView input {\n font-size: 12px;\n padding: 4px 2px;\n border: solid 1px #aacfe4;\n margin: 2px 0 0px 10px;\n}\n\n.detailView textarea {\n float: left;\n font-size: 12px;\n padding: 4px 2px;\n border: solid 1px #aacfe4;\n margin: 2px 0 0px 10px;\n width: 98%;\n overflow: auto;\n}\n\n.detailView select {\n font-size: 12px;\n padding: 4px 2px;\n border: solid 1px #aacfe4;\n margin: 2px 0 0px 10px;\n}\n\n.detailView .label {\n vertical-align: top;\n}\n\n.detailArrayLabel {\n font-size: medium;\n}\n\n.detailArrayLabel .foamTable {\n margin: 1px;\n width: 99%;\n}\n\n\n.summaryView {\n background: white;\n width: 100%;\n height: 100%;\n overflow: auto;\n}\n\n.summaryView .table {\n table-layout: fixed;\n}\n\n.summaryView td: first-child { width: 50px; }\n\n.summaryView .label{\n font-size: 14px;\n display: block;\n font-weight: bold;\n text-align: right;\n width: 120px;\n float: left;\n}\n\n.summaryView .value{\n float: left;\n font-size: 12px;\n padding-left: 8px;\n margin: 2px 15px 2px 0px;\n}\n\n\n.foamSearchView select{\n font-family: 'Courier New', Courier, monospace;\n}\n\n.helpView {\n width: 100%;\n}\n\n.helpView .intro{\n padding-top: 10px;\n font-size: 16px;\n font-weight: bold;\n}\n\n.helpView .label{\n padding-top: 10px;\n font-size: 14px;\n font-weight: bold;\n}\n\n.helpView .text{\n width: 100%;\n font-size: 14px;\n padding-left: 8px;\n margin: 2px 15px 2px 0px;\n}\n\n.actionBorder {\n width: 95%;\n}\n\n.actionToolbar {\n float: right;\n}\n\n.actionBorderActions {\n padding-right: 15px;\n text-align: right;\n}\n\n.ActionMenuPopup {\n position: absolute;\n width: 150px;\n border: 2px solid grey;\n background: white;\n}\n\n.ActionMenu .actionButton {\n background: white;\n border: none;\n border-radius: 0;\n text-align: left;\n width: 100%;\n}\n\n.imageView {\n display: inline-block;\n}\n\n#stylized {\n border: solid 2px #b7ddf2;\n background: #ebf4fb;\n}\n#stylized h1 {\n font-size: 14px;\n font-weight: bold;\n margin-bottom: 8px;\n}\n#stylized p{\n font-size: 11px;\n color: #666666;\n margin-bottom: 20px;\n border-bottom: solid 1px #b7ddf2;\n padding-bottom: 10px;\n}\n#stylized label{\n display: block;\n font-weight: bold;\n text-align: right;\n width: 140px;\n float: left;\n}\n#stylized .small{\n color: #666666;\n display: block;\n font-size: 11px;\n font-weight: normal;\n text-align: right;\n width: 140px;\n}\n#stylized input{\n float: left;\n font-size: 12px;\n padding: 4px 2px;\n border: solid 1px #aacfe4;\n margin: 2px 0 20px 10px;\n width: 200px;\n}\n#stylized button{\n background: #666666;\n clear: both;\n color: #FFFFFF;\n font-size: 11px;\n font-weight: bold;\n height: 31px;\n line-height: 31px;\n margin-left: 150px;\n text-align: center;\n width: 125px;\n}\n\n\n.foamTable {\n background: #fff;\n border-collapse: collapse;\n font-family: Roboto, \"Lucida Sans Unicode\", \"Lucida Grande\", Sans-Serif;\n font-size: 12px;\n margin: 10px;\n table-layout:fixed;\n text-align: left;\n width: 98%;\n}\n.BookmarkTable {\n width: 800px;\n}\n.foamTable caption {\n font-size: 16px;\n font-weight: bold;\n color: #039;\n padding: 10px 8px;\n text-align: left;\n}\n.foamTable th {\n font-size: 14px;\n font-weight: normal;\n color: #039;\n padding: 10px 8px;\n border-bottom: 2px solid #6678b1;\n}\n.foamTable td {\n color: #669;\n padding: 4px 8px 4px 8px;\n}\n.foamTable tbody tr:hover td {\n color: #009;\n background: #eee;\n}\n.foamTable tbody tr.rowSoftSelected td {\n color: #009;\n background: #eee;\n}\n.foamTable tr.rowSelected {\n color: #900;\n background: #eee;\n border: 2px solid #f00;\n}\n.foamTable .numeric {\n text-align: right;\n}\n\nbutton.actionButton {\n -webkit-box-shadow: inset 0 1px 0 0 #ffffff;\n box-shadow: inset 0 1px 0 0 #ffffff;\n background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );\n background: -moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );\n background-color: #ededed;\n -moz-border-radius: 3px;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n border: 1px solid #dcdcdc;\n display: inline-block;\n color: #777777;\n font-family: arial;\n font-size: 12px;\n font-weight: bold;\n padding: 4px 16px;\n text-decoration: none;\n visibility: hidden;\n}\n\nbutton.actionButton.available {\n visibility: visible;\n}\n\nbutton.actionButton:hover {\n background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #ededed) );\n background: -moz-linear-gradient( center top, #dfdfdf 5%, #ededed 100% );\n background-color: #dfdfdf;\n}\n\n.actionButton img {\n vertical-align: middle;\n}\n\n.scrollSpacer {\n height: 52;\n}\n\n.foamTable td,\n.foamTable th,\n.summaryView td,\n.summaryView th,\n.detailView td,\n.detailView th {\n white-space: nowrap;\n overflow: hidden;\n text-overflow:ellipsis;\n}\n\nselect {\n background-color:rgb(240,240,240);\n margin-bottom: 15px;\n}\n\n.foamSearchViewLabel {\n margin-top: 5px;\n padding-left: 4px;\n}\n\n.searchTitle {\n color:#039;\n font-size: 16px;\n padding-left: 5px;\n}\n\n.messageBody {\n white-space: normal;\n}\n\n.summaryView table {\n width: 100%;\n}\n\n.summaryView .label[colspan=\"2\"] {\n width: 100%;\n}\n\n.summaryView .label {\n width: 30%;\n}\n\ndiv.gridtile td div a {\n color: #000;\n text-decoration: none;\n white-space: normal;\n}\n\ndiv.gridtile {\n width: 10em;\n float: left;\n margin: 2px;\n}\n\ndiv.gridtile {\n border: 2px solid #c3d9ff;\n border-radius: 6px;\n padding: 1px;\n}\n\ndiv.gridtile td.id {\n width: 5em;\n text-align: left;\n margin-left: 4px;\n}\n\ndiv.gridtile td.id a {\n margin-left: 4px;\n}\n\ndiv.gridtile td.status {\n font-size: 11px;\n text-align: right;\n width: 70%;\n}\n\ndiv.gridtile table, div.projecttile table {\n width: 100%;\n table-layout: fixed;\n}\n\ndiv.gridtile td, div.projecttile td {\n border: 0;\n padding: 2px;\n overflow: hidden;\n font-family: arial, sans-serif;\n font-size: 13px;\n font-style: normal;\n}\n\ndiv.gridtile td div {\n height: 5.5ex;\n font-size: 90%;\n line-height: 100%;\n}\n\ndiv.gridViewControl {\n padding: 5px;\n background: rgb(235, 239, 249);\n border-color: rgb(187, 187, 187);\n border-style: solid;\n border-width: 1px;\n}\n\ndiv.gridViewControl select {\n margin-bottom: 6px;\n font-family: arial, sans-serif;\n font-size: 10px;\n font-style: normal;\n font-variant: normal;\n font-weight: normal;\n color: rgb(0, 0, 0);\n outline-color: rgb(223, 215, 207);\n background-color: rgb(221, 221, 221);\n}\n\n.gridBy th {\n background: #eeeeee;\n border: 1px solid #ccc;\n border-spacing: 2px;\n font-family: arial, sans-serif;\n font-size: 13px;\n font-style: normal;\n font-variant: normal;\n font-weight: bold;\n padding: 2px;\n text-align: left;\n}\n\n.gridBy td {\n vertical-align: top;\n border-right: 1px solid #ccc;\n border-bottom: 1px solid #ccc;\n padding: 4px;\n}\n\n.idcount {\n color: #0000cc;\n text-decoration: underline;\n font: 82% arial,sans-serif;\n}\n\n.idlist {\n color: #0000cc;\n text-decoration: underline;\n font: 82% arial,sans-serif;\n}\n\n\n.buttonify {\n font-size: 100%;\n background: url(\"//ssl.gstatic.com/codesite/ph/images/button-bg.gif\") repeat-x scroll left top #e3e3e3;\n background: -webkit-gradient(linear,0% 40%,0% 70%,from(#f9f9f9),to(#e3e3e3));\n background: -moz-linear-gradient(top,#fff,#ddd);\n vertical-align: baseline;\n padding: 1px 3px 1px 3px;\n border: 1px solid #aaa;\n border-top-color: #ccc;\n border-bottom-color: #888;\n border-radius: 3px;\n cursor: pointer;\n text-decoration: none;\n}\n\n.mode_button_active\n{\n background: url(\"//ssl.gstatic.com/codesite/ph/images/button-bg.gif\") repeat-x scroll left bottom #bbb;\n background: -webkit-gradient(linear,0% 40%,0% 70%,from(#e3e3e3),to(#f9f9f9));\n background: -moz-linear-gradient(top,#e3e3e3,#f9f9f9);\n border-color: #aaa;\n}\n\n.capsule_right {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.capsule_left {\n border-right: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.altViewButtons {\n margin-right: 17px;\n float: right;\n}\n\n.arrayTileView {\n margin: 0;\n width: 100%;\n padding: 0px;\n display: inline-block;\n border-bottom: 2px inset;\n}\n\n.arrayTileItem {\n display: inline-block;\n list-style-type: none;\n margin: 2px 2px;\n}\n\n.arrayTileLastView {\n display: inline-block;\n margin: 0;\n list-style-type: none;\n vertical-align: 7px;\n}\n\n.listInputView {\n width: 100%;\n border: none;\n padding: 1px 0 1px 8px;\n outline: none;\n height: 36px;\n}\n\n.autocompleteListView {\n position: absolute;\n padding: 8px;\n margin: 0px;\n width: 300px;\n background: white;\n border-radius: 5px;\n border: 1px solid lightgrey;\n z-index: 10;\n}\n\n.autocompleteListItem {\n border: 1px solid transparent;\n border-radius: 3px;\n list-style-type: none;\n overflow: hidden;\n}\n\n.autocompleteSelectedItem {\n border: 1px solid #99e;\n}\n\n.richtext {\n overflow: hidden;\n position: relative;\n}\n\n.richtext iframe {\n background: white;\n height: 100%;\n position: absolute;\n}\n\n.dropzone {\n -webkit-box-orient: vertical;\n border: 4px dashed #ddd;\n box-sizing: border-box;\n color: #ddd;\n display: -webkit-box;\n font: 270% arial,sans-serif;\n height: 94%;\n margin: 7px;\n position: absolute;\n text-align: center;\n width: 95%;\n z-index: -1;\n}\n\n.dropzone .spacer {\n -webkit-box-flex: 1;\n}\n\n::-webkit-input-placeholder {\n color: #999;\n font-family: Arial;\n font-size: 13px;\n font-weight: normal;\n}\n\n.richtext .placeholder {\n color: #999;\n font-family: Arial;\n font-size: 13px;\n padding: 6px;\n position: absolute;\n z-index: 2;\n}\n\n.linkDialog {\n border: 1px solid;\n border-color: #bbb #bbb #a8a8a8;\n padding: 8px;\n z-index: 2;\n background: white;\n}\n\n\n.linkDialog .actionButton-insert {\n background: #4d90fe;\n border-radius: 3px;\n box-shadow: none;\n color: white;\n margin-left: 7px;\n padding: 10px 16px;\n text-shadow: none;\n}\n\n.linkDialog input {\n height: 32px;\n padding-left: 8px;\n margin: 2px;\n border: 1px solid #d9d9d9 !important;\n}\n\n.linkDialog input[name=\"label\"] {\n width: 99%;\n}\n\n.linkDialog th {\n font: normal 15px arial,sans-serif;\n padding-right: 10px;\n}\n\n.actionButton:disabled { color: #bbb; -webkit-filter: grayscale(0.8); }\n\n.editColumnView {\n font-size: 80%;\n font-weight: normal;\n z-index: 2;\n}\n.editColumnView td {\n color: #0000cc;\n font-size: 80%;\n font-weight: normal;\n padding: 1px;\n text-align2: left;\n}\n\n.multiLineStringRemove {\n float: right;\n}\n\n\n.column {\n display: flex;\n flex-direction: column;\n}\n\n.row {\n display: flex;\n}\n\n.expand {\n flex: 1 1 auto;\n}\n\n.rigid {\n flex: none;\n}\n\n.waiting * {\n cursor: wait;\n x-unused: white;\n}\n\ninput.clickToEnableEdit:not(:focus) {\n border: none;\n background-color: inherit;\n}\n\n.galleryView {\n text-align: center;\n}\n\n.galleryView .swipeAltInner {\n overflow: hidden;\n}\n\n.galleryCirclesOuter {\n float: left;\n text-align: center;\n position: relative;\n width: 100%;\n bottom: 20px;\n}\n\n.galleryCircle {\n display: inline-block;\n margin: 5px;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background-color: #aaa;\n}\n\n.galleryCircle.selected {\n background-color: #333;\n}\n\n.galleryImage {\n width: 100%;\n}\n\n.foamTest {\n border: 1px solid black;\n border-radius: 5px;\n line-height: 150%;\n margin: 2px;\n padding: 6px;\n}\n\n.foamTestPassed {\n background-color: #cfc;\n}\n\n.foamTestFailed {\n background-color: #fcc;\n}\n\n.foamInnerTests {\n padding-left: 10px;\n}\n\n.foamTestOutput {\n background-color: #e3e3e3;\n margin: 4px;\n padding: 5px;\n}\n\n@media not print {\n\n @media (max-width: 800px) {\n\n book-title {\n border: 2px solid rgba(0,0,0);\n font-weight: bold;\n font-size: 40px;\n margin-top: 15px;\n }\n\n }\n\n @media (min-width: 800px) {\n\n book-title {\n font-weight: bold;\n font-size: 50px;\n margin-top: 20px;\n }\n\n }\n\n}\n\n@import url(http://www.google.com);\n\n@media print {\n\n book-title {\n font-weight: bold;\n font-size: 32pt;\n margin-top: 1in;\n }\n\n}\n@font-face {\n font-family: 'RobotoDraft';\n font-style: normal;\n font-weight: 300;\n src: url('data:font/woff2;base64,fd09GMgABAAAAADlUABEAAAAAg3QAADjxAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAG5lWHIEIBmAAhjgIUgmDUhEMCoHLfIG1UhKBaAE2AiQDhnYLgz4ABCAFgjwHIAyCNhthdSXs2IsCzgMAKrW75kiEsHEA9OO9fhRlm/Sd2f9/PpBjjAZ6A82qf5HZVUmXOqx2CZnaHQsItMAiLCzSupwQiA5OFydzbk6C7t4buf2QvR0QIidxYAbxkxPP+US85bxV85PXKh6mnggRwaQ1SnvUjD+MGByq9NuhwlVx/XRqh265+Ou6yZb2rEOSopaHJ//6Orfqvn4DoAdrOtyJF2Ao/hUjZ+plJqa/hufn1vsrRo+NEJOQDBVHiBI1kKgRvQEDHL3BqGqRGyBItmDQ2qSFFWfaf0s39yKhq6T/IzqOrnvblZTWLayQCN2G/i8Yg0KvEila3Hbb9v95EFACcZJhmgQWc2DQWu49FBGFrRNvRSZFJXvvVHxJd5Z00rZ3YsdZs3MDVoDyCuB/xaXkF8A//7zc/qwt/S6MINPAJMV3AwAZcsAa4ucRJtj/bRNpUNqk5DXNJ5uXqCEvNrHX9csJMDEeiGP+W+jAR7vxjGc7H9j6p1CWjqroRxRmXq+zd1dg2JUMPwhVuvw6ky6TGh8Y7kYH7AAbttGzO8ku2t8UIeyIBQch0FBX2Z4AbpTlOSYd8T8Xfa2ClfX5bKbt/BuvgSfcKmzzBltTlRKbIkWlXeFohGdcE691tFZo7wKSTAogVkjaYxkl8x0bANsAdemSMn2qIm0HWOXl/9dZfvue7BDYoaJNU8ozDhVdqnLeu4KVnuQdwYJpNqYl8AS9Ad1n50SSnXMkeTcw23gmAFBlNvCJivpXBVTfcts6/rpNI4lWr8WfRTY4DURniI5Sj0btQj/9IVej3zxo6yIsy+LfmMrzUDumOWNtaoyhBgUVAQFnbP4a+3s1H13zK+66204aknhgxpJAMvYGFYBJrIVC7Ln3yAyOn3FxuA3xcw5XtqB84cLxLrQgANo/urh0QGhAGIG/iQvOOtzF8XgKIDwbAgyIZcsdpKjizL1CpDZpHYZk4GtHHaj36lxox18YQn9h41qki0ZxKYF1sySUtMSUBky+qGCqIlUx+asxcKfqvnAeStXUjt3JA3Wu3T3/5ksyIPy/iSB6EFDYccARI0GSFGkKFKlQdc55avDUadJyiRFjBFdZsGQlNdiy58CRM1eFipQo1aZdh+s63dDlP0zdevQaNGTYiFFTlty2bMWqNes2bNry2BMQtbYh4PFSh6WJ31RkDcElRAEmfliUm1i25OfHi5deTxn0hiGCEUxgBRtr2w4Re82hl5yRPPsbxfmV2drb6sB1dOIGumzTn5rBLOYwjwXb4jeWcBvLWMEa1rGBTWzZtr/2AA/xyPb4S0+iEMcm47o2gbHHJX4tJLU24Nun3hHNnpgCjiCAyd/mcG/H3IOGyLCtj2PzAkZFJSm+qZQ50tdD4MTrMh627XKHQ+AGB94IrobNB1Dke+eihzGMYwKTPfJCwWB38jFiGfSSIcAIJrBR+fLsRF4IowhGCUr1xS8tYdzGMlZ6ZGfQEUMYwQQ2yMYilnAby1jJDc4YN3vKHPFAserIGsI6NrCJrR4RMCXBohhlqjw4whGOcIQj8xF2BEKuAsytrYpjVx5H7NZSvg7YwCa2BETMHU60afa959gzcJz9XO6LL6fDGPfuRX8NEl8Q5cLWS1djuDrpy2zca7Zts09UPRkD6hLVCuXPuDopJ6WfUH4NpCgTxBgn2GqOANa/So9jQMWldefso9OZwisvWyNLO2T6Ql/Hfr+94Rrun9gdHFU/GQdAL4EWm7pje4W3/oZ34WugDfzqFb3+it7/NpqBO/+c7x8Kb/MSpVv7gzof3NdgSodfCZ26k5/w6nYanMBPH3DF3/X4vL3UYlCe6xl8Zw//9WeiZLuad2B65yGQGq2xu9yqK8Q9ZrUPAxDuFaq+gWaKA3Qs5oe98EH6Wr0OtMq/TPu/0hlIfUQq3vjsjpy32MwxhZK9W53RjdPEd+sF/d16o6m7t0pnbOhW421H6ebu4akOFo9l7MGju+VwAi2vE93pEmo28MZLPfQe6+0DTd6/UeF99TE/t657L32lVjNPXl+F97dP5DkY+8lUGe8hpT/y4w/Zsm8AB9D22Lr1Ixy8TBuPxc7jdnzW3HNTMeG2j3jPXTisD9G8gb6wMDioHQMmMwiGwWDrAidGCoIsVazUaMHSY0CQEWInEeSnWLB2mi0T4SAX5cTFWRkrIqFQGUltVshbtcV64xJ1AKPSCIUA6WJgxDGDk2AIkgxJSo4iSw4LeYamwFgpytkoUcZChSGpMnZqjMNFhoZnnNQZFw3GTZNhaDEeegxLn+EYCF6JKF97ftwy5laYCbAWOOnoMQjaYcc5M0Eu4oSkGk4xMEgZg7TJkdp1gfmvLghMvVBuGsBi0CikMZPQppAcY9oCrEU5ryUr+KzG8luzRUBjEBSqZhoQEjxY8OpQ4lG1p6HJYIHWmODTj4Z2DjO0C4JfS5SVslF2ykGxlJPiOBzrRhBMsEBohiIpSkOyAYZgx1gQBZeWKDcVoNwaRiIwtCyGlh2LkK8A74ZYQNoTPBtjpw41Hq27VF4QaL1RNGWjnICPWYHQGEXGomx7hAsC3Dc0UVmGoNuXmtDYQEceNSXA3sS4X2NhF563tgCu+Fr8gOIGBVAURQgiU4gGkU1eG6EOjCmxHRb1wrziyhiD5x2ykEB3X6cCxHJcWL9ALvU4wx3yA7ZmTvhaACsA9jlkvB/aQPszAH+Bs/uKAoRADwPk9h2TEKGygRoVLgEHJRWzAXEqRJyArUUvyw+YKkbdrceGHDfnrkPv/YMOw6rMlYfl8bCWpGSlRbqlR47laWVz9R9QBULt61l1mTDvnhc+IMnSVklc0gN2VR20b20fqk21n21yM9TYXaA5xJcX/vSVv3yMZ/hIT/Pu3t5LNeGzT0835ogPvwBxCUmUcEv18vxc+Xbqhy8UK9VavVEaaLbanW5vcOg2a/HDI/sHh0fHoydbvS6B/QFjhQEi0ZJDRGWEGUNLnmGcJVKW0YrNskKVtBptKcbRATtLossaq6zDrp9jg13K7LFPgQNOqHDKGSXOuaHJLVryIHfc0+cBNX2IR282efdhmE+/TQX+4KxR/s88Qdux2Uq4HojDgTgCcANQPkK9uQkoX/fmZqCMenALMJwtnwPgVmC4QL4IwO3AcMkFlwG4Cxiu7MG9wHC7C24P4D5guGdvHgCGV/bmQWD4ZG8eAlbOytHDpPlw4MZWHTPXZFlI+nMzA5gzvja8pRKmXQTneCmwVRh7HngzG6Zj2uIHx/ANJmCKI2yPAFI/rLMND1Cshx77FtB33ED8Sx6D7tIIK/gpJxcUtOFQejd6GG5HEdiGJ5H1VxxqgW847GMV23vK5K04Vbiflxv2yfrCMlMsUc5arLjjFISsjt2Ir2t9bMhdiamvSSRru3nkIWiG3XEMl83KdFPxefmCtUJueICwih9qJg3X9Jzgrro2FYbSy3fMTXp1K2ItRQglpJKMu9mIiwuWCGp934/mUMkRhrueIOJ112VM+ZBrnEs5GVyvj6YmgksMIGnnq0DRQnQvjbhDz3vjpi91Yt92KSJGbE+zhFWbNr2vJCzBSbLPrtO7yWSybraKY8Pn1gnShu4I+2hXgOA5NgGkHVlmEvXlpTbFVayLh/djjcg7JDVzbvjsrmljAodXXRLYc/HHqtSXe9oCIDBosPYPDcBoaox4A/ATMOVnYM7WAPUxoGwIbLbKBRyhKLurDkGCg1JhiRr54Pxdv4IWgKqlwmmSvro5z+UuBOOSCh0Sqs51tVuDhBAwsW4NwcNDG2ihqyAEjwPw1COJS8IAdPDwcRESxPOBol9GCzvML9VaaIpixLsPLuBsnazK6DQShqAWd4urzqvOuH7VhqgG99FpiESTM6rLzmFyMpoULLUh0lmXVDkyGvWFrTXb5FbJ9rpduhrJG4+bOsXkk4vHNqvKZTPgEPsObbdj7BA/RueGFCeSIbaExjrsTlg7iir4hUngeqKgH3enVxGJFsYkj73bek3WtaTD7RKUwiM22KvuZDGFHP516eJDQfttcVNENU46x7TgmdvmH0NW2ScyoDHrfeSVKNAJ43EUdeQBYyCFxEd3dRBHpiJ0bJGhRCBHlAGk+OeRIQUFhN9ZcoqcszjOEXCUMkL9MAyRNjg/n9yP7hjRwn3RnCOkQh3WIadCkyl4KI16t5lsj259tMGrLVJpv+dySgfSXCEnzl9ZXXh255DaC60qdzlNzbkytb9C1+pibGkvZM/ujniwr3eGajQw0xgij/zuTvF5aLoVSSeZWdYd871uVkSTsCwNZW7krzzndqjqWyXlpZZzb7skO7jPN/VwUgsyFchx+98sqIOucH7Woa+RlN2phToJAwmyhA4Kz7pNlSRd6AyoFboqbhkufVb7mACtPwNm1LKiS3+Iq//+1vkGsPtemZH0sC+1cRWCgic2OHO0hqXXWJiRpaEUIgnH9q95sPxEZPnv//dytkgznrwECxR4tQPmEy/jHGZ4XIe6aAdJzm1FMHBbtjaLAlEwt80+sPUFLb1VNLqPvfpF2eP8/OLPo+YT+pvCfV+X4yv/N+fPi1kZ+Dph+/+cS2dAwnNadBcssTI7Z0GsnHAvbsX+kRQPyujSoPM1jwlNl1FmPDCcz7biP/68AEjNH7RoxfnfR/cz0gn6kCTygm7q0oEzoa/W6h/77aoiAJH2qWt+hN2bKOxdegkH/ZDjpCPc0Ldm3padqILnNIRfndN+l32LZS7DJWEyo8U22bpJAC5Vq83SHi/7PfT835unIwcrV5e9dDjPn9CxFnBpnT3fMxH1WbWrjooWOk5jeTBVjkyj4Kw6BVo8ErrU0V+mCh29fFRzic2Xy6M5SYQ3SaMHmy/TlG4f3DA2X7jjLmEJenysbev5nmU8o+APsEz45JTOTmhyxlPSdQIKF2z7UKLrTMI/mjNEEmvhwRLPI2S5dIsmfErzoqcJjbj/xvjvvpktUJg54owOUgl26VNxNy6poUypHgDbdc1I5YLbLxgbWh06tG0H+/AWADZ1THAuQ56TKRT+xORr/270XEYV9VkL0ANDNnUx53p5F6uKm4Q8Z7Vb6jNWwxiixn3HcmvgCltCYMMGXx440op2QOE92MfpmNo8mp/Bh9ITbft2moftcX6Cso37dKI8S9pmj/nglBztjK6ZN3uny0kpTJai/a2knqCdSHT4C9NHZDqGQFMlDWq0H5SB0TlmvVGJyqH7DnMoZVety5zWJU/wrM1q28RjoICDr987ty0kZF9U94shB8t0o5vcon0nq9m/9cH7b50c33p0wCn+6esFZXXzeM7WLth2oYfSwT787cvxVYJ5jLUJ/5kIUlEGcCEPSXhY99Hpb5vKloTeMoUM2qDE03TiKMvT5mI7sVpuJG4s3cJgKeSvjl8qo6/9ybAU7fgP+XNbqxEhj1TSHsYw/faUMvbxX9DG6noprVZlkAqtFmmNdm2c3hqK6bg6EUMEa5iFUfOMh4NyV5NCnvWPmyq0i4JuiEO2GvARn3eoUz5ffAndRNbI1B3fTweSwnpQ2JvSetc4c3+Rzt/2e8n1/qLp3FEzGMyxbGrqTm+UliHZSL4ZPOaTh/tZkMUqmOkn5Xrr16VlGtv4g12PmnM/88dSvAPMjQfHyOcZ6mmna7CnO85xJ8WFMy5LPp9fVqcdPF6g+d3niydVLFwTjFU7EcznPrq3wYAkOAbXDE0xXsJuuIiefzPPk5Ec8P2lHdO+59sJhQr3WVjLN0vM35wW7j60LnOn0tfvDfl2zMtGpi3pjZbD030I292ILYq/aI+P7OGxPjhURwcLyRmlyFaLCYzY7arszpZSVrCeODULnuR98eL8Wo7pxpfhSvq0FZmY2l3XrEKX/95H7PuCHAnU5Hfm67ohYEo8UYs67kAHxvefKOY5P+ZHGajbU5SJ9KwjKbsTEedne1pRDYON2CwlW7MHKyvljfLFo/GyWhvBpzahgXwuzmrQcegx6O4YwAuOng4yjPPbOgGfhdvSK64fSr6QGwELtgf9Wa7bquPbQK0+XToVuIkm0Kxqre+MjnpAQh1G2/snUshogHIrBR13KTtrL/j2W2GFnlu6juV61ZLJDVaNzljluk3tmxzSER6zHMIBOQa/1o5FIo79RkjI0bbVn3OpNATTCldwZHkD4ngEDNToKuZgtdgJKlbqzpxiq16gO6oehuPJVxgICCMzw7X867wWxMLrta0kCgJ2kJS9DwuSMwDJnIGTnACShSdBL/w9O22vHg45p8Xaw0tPFFGB14kodDNFZIxwR0R4mTCiwX0uFKdmDptxf5N5t7eAl+T7UI4nlHuS7p9zz3JAwE3KrNbTiDrxmnng9t1y4F/JPqHc69E39WevUs9Xs/Cm5mb1ae3o901VNs4vXedcIi/9xz3xYp5W3TCQnVNTFEXPT3EJr/E3K/JpWl7o4RwjjS5wPNqdpVf1MRtzekoZqPWyhLqOH2OjpRnE1XREMRpbM9xQzmSanY0X3c3I2ZtubeVD85KYlkuoa//W0JZhkExKc0W4XEBsa/cwciOH2lp7h3l+f2GsIBsaPI/qa4I6x219zJosyvu6yzOv10XlNWfUMnLvOxQMUX/Edsy9yIvONzO9Yxdy7/N6DyVqpCqsfcyxg6CjX7L1dHW6tiSxtwbOKxuZ0pzg+cciwNjMz8fBIySawSUWglF0QEiUkDkyTR5SK7asGUYnzS/Lx/eSvmupztx3iW8W9/xJR4gx2bL0L8FAGo/XxA2LOFN+Xd31WsRcUw7uusa1ybvqniREEzYsqJUY/sKXJn5nvEwi4UE+LKE6MUJehOCnYtZaG4q35a01hML2hgOHdyN2ewJ7ViNOJHDrqzhEwBIqw6LvYbmvPiM9w+YZiE6Y39N/bL58MiMqQBwl54+7FOyquqP1ePtADSaNVNlTf7S9pwiXpCF/Nvxrbmj8H/p8+v82lvq6Jgj8GOinA6RQZkHg+1u8eME8p0/nGDmug/YZL/+r5BTeHC6hMa4tLgcnLjy/30eO+Vh7s3jpj7mgimCUd7mheYxVVnV1UVZPUyo9KGhokcSY29sa8U1ihsikimUOxA1/3ltO2PYOH4qiZ052lVV21pQWDJX30+PPx2/skfYC6YE3dKVFfydKiT46rq3qaPzglf7sNjVI+U3o1erZV//Kw70/d8ferGHGQjBFrWW5VTWzt+q6FytsoqX1NH1V+4Z9uZAyytwYdctBh5CJXfRmju/ebEzsfaT8B3qqZ6c+/CEpeCZFyJs8NvW+KqvzSXtn512SdrOf+IFftHizsQZ5VEVL9WJQYo+fVLR06XjM8J+H99d+PxiJyp+MkfaTiu0J6nu5Efd6CynqlzbZJT9+nX+wqbZyuBHmqRfd2ZKS1laXGNdWmZ7aUZV44UrDJedRMjVqNNZ7JyXv2pu5hIRHn5WP+2dczSTyA29pBJz7jO0UfSxHIkjv6cCX6py+/a7Wrqfud3NuycSodDPc0yIyRkMzRPMK5QoSpZNQVS6ck2eo3o90t/XPiFKmFUJh6rmzU2rmp920opNyaPSCNCiUBjU+mGnrnFvo9HcfSYsOdOlLMRXpkhAf0b8B4hKdJgENEKLA/WdnSrB7BAnn6Dc5lpX+kWeZqyH871hOgGmINEFb+SJriFmsHaPsA3oFW0Qsc12zXJ2OF/heFaOx8sipW6bn9NXk28o+P72f97SwH2fne9wZ+/rrv4WivVzX4h/tE/2NB+3+ysKvKDpSG5gm5+M06suKi0vjRcKYYXDcxCl6QIZYHUGDAYBkdr3+ODESFNlCEY05UTEZO/lj+6nfsHVQzUBdbiqzqiqSbF4Oa8tIzupK6lYJNPk4d+yA//PLhh/1qZJgbHQqVeZvQ8trrt98T6PkgklzryWQPb/3ZaYnpwf4B66wXkelvScaahSmUqar5U43DvGcM3jGe8iniIj7xSP3DBhqTg21W3L7ZFxkmezLJtZuq9nQ1trGON7uKb7s51t1TRVvXHLAkNqvszbmy4DJAQUlF9gOz77gAuN47Z2m1uW3wujOlsC/q5nptUFKRkLq9FQfmOv7qCHtoeqxjBztnChLs68GnlLpY0b9+/7d18X1vSfzjJrmmtLMrltQteK/1eVF1u8z88g38lS6p0rhJEsIKt53fUzOlBslxdfHFC5GCvchm57Lj2RNFz5AuArP/GunMRVKEb8wVK2fPo2i216qXs+eRRLMptIXMxSgxvZ/F/3Pl8xnKUNN5qA+UwI2FcnN8lbq7u0P0hxl8Pfyd+6/kmY3VDa3YLHBP+yhXtxe+f30Q5B3WO9we1npUM91KPqqWUL6vQLVVDP0obWJJLDgt2mBNWbLgplGlvLWDqgxS2khEnS6t0Tedb/3RmrylnOrizhb68Er5M7trMaNdEk/CmeiYvB8ROXwf1kV0+3djp6XIHJEe9Z0jLdxoW9nK/beZv4+NXqeEVV8+2ZfZ7NFdGp3ZiplMZhUG9CJvbtTAQKSZuMYFQfd4x0rxWQjPYPPAGnAiNbpJ183BeNzzF1QEPvgZWjpIe9PxJM3kQ8G7i/53Lvd/1DzWm9Mzsmm36nCB8xwdCymKM2kye6c38LNKFFxSUrnHijsYUIlYgRsmOG8TSFnc0Vz+c6GhAvoMWOIEiqG5d6FOysfdopaGe2Mgo87uyuFVh7FJ9aO5wjtZZ1lnBVayypQeued6HPM+Tzitb7vU3v905vHVwHqaJVsDFgGjM/CkcywidcQhgOoOJOcZkJeK8hmTeK4DXZPLVR600FqM1TmghApSL+lJ094PQnY4c87Y4BFeGpZTNkHVE3cSK5B3XrzgBGak5Qe3RjrQAPx70f+67t3E1YPqoVMOb7b0EdCpN3ebfZAizFUxxRaorYy9s8zydHdkFZEYSBAAZpnEPP5xNOzSBpss/llaUhtoKT/S+Lt/aKWV2QZ8+i2LBQ1BOER1DDi6L/xQ+Ln2Trq13vJWT2HayydISwxLZWxDT2v1kTv9rww9RP//Vx68lFwpyuN5x9PICI3uPHZ8L4soKPuNr8rfeI09dtp9VFp65GnFi7jaSrjU6lMFf3/rZyY2UOOVzoIgYHVL3VuBXrqBGO1xDEe3O/UgVlcSzonorJ1mvRpu9ejN7GlrbtUtw7teULdMyAyKAXmAdv28RP/+1xy8knwf8jKwLP3X31eCFr2wltdMYip/K+klQmrSguufTyyJ/OPHrTA5Dj7Xcq72p96X68UHpVEvNst34Cu9mkwPUebB3n07GRqR4Zk2EHrS9GMReh4epba1c46010hjF7iWccPl+RWZ50XgTxG5HtWBtXTJcZ0RyXEb+h2mVQJpSVW08ssgr4VGFFdUro0/yko10Iktw1OYYrw8P/U3XvdrwHd+xe9Jv3DnFCMVfoiyIvMzIyDuhtYQ5fpqyAjLi0lqD5OPOaw1s8Qs4+HD2h49vlcE20S3pooq7laH2dkbbPL/xSspv98lJq9xfGUpKGnFn40NuTClgWiHFeaA/3qFn/e1tMW6fEsRp6GVUrSAPIhFVkW2vl06rGYrRD8bvv7smvVvlJeLNJOte4BpW0fAvVpnH4U1IIsCKSMoYuHlW+N6e9fy2rbu5It1yGsrFuNj29p+7sAKfi6rUxgRZRQ+AsaPgy67jK+qrxsoHwZR8zxO6NRY0YIsojbaGnte9iTR3etiY4Iz/Gxtgi3xxtVWZmEWac/buwZfd2fRUf5NISmRJcHkPlIV/meezy/76BtRzh9hRXh/tyCQc3JXJ33mOdzP6ed7lf19kbvAjQzQes+9xOhu8lNx4daHDXxFhYzBHXx7oJeeIZazQ8eJwF3jI4GGYM7dyKI34dzTysKdxNP5vF0WLrNgyOScU14BvF9gmh/zjVsjHi2yqJGZUeL116ebfXpOm46J/7k/iea/cyQDCfw2LD3txXzVc0XTFJK1H3tNU6yspeCM6K8cUT9qMJWpfad4ScsL3xeIA9Af+tOm7Kg2WfTixvfbhneInzch4t+Mpfj5yQB1BgJh9Y5S8BFn/+Z0BkZfm1ofDYRNOtQbtkfeoYsu4NZngy377QqyZl5/C5uGY83jDrfV2cnqUz0CAv0A8X1IynGSZqOFle0XJUv2HtHB+BvdFNBqGAUupgkMkpYccyfBl1zRlsGOiiEJWN5upB7n34wwL926tXZp6sig/yP6Y8quOfvIytH69FkUZiE5oVuXCa+8jnw8ZAVdMYZQRZovhGfAbTwwuOjwf7V1W5GanFhfHQhsxItbO8TpM9MNjWYNw/abSqtqLa2qaljtD7aS+po7bC2bWlvyuxsym7vtLHr6Ipvf74V0dbQaGOrncDIiHu/k7XEP8uMfZeRmfDuSSp4lrr/0i67PGm6nzvzjkpsWG6wb9Bl6NbY1yzXEK9Nv8sNreGE0+EL9G/0Y3of//OKzPAXclBwy7zW9Gv8QcDEBR215KBlGlR1p6u7bjgjyFTXudbU3fUG2T6H5BWa5StkI++Y6V8PTW08/7GzQi8Y769vHkwLuarpXGpSIzutPEK2yy5758cRFkK00netM1m64HiCypEYbOuRHNZ5IQn9NfRaiKzMvHHzjMgY3rGmjPG9ZvSEPta1rLFetn+tz6Hr1rp0c12Z5/NtSmx9tmNKdIM/xd83XOV5JLNBRay3rVW4u0W5t6dZUYTZel2sr1bB+sbSENF4Ls5obhxMS7O9dsb35maN7/TZladNvLa09UsNSwz1utYS0ZCpaXPV2cKBrG9IQZKbE1Ki8nNS1J0EbU3NzwWrv2mLPyyIycXHJ9BP3qTIniBtM8wzbj/fl38nw8/Keq63RUWEaSbKbFLtYdYriPReb+t7f7PinQ9EDwNYYXVkdHLWJQPBC/5lLDopGPJaAdHYyGHYoc/Cx0rPxtbQF+qqUUy+WuNeg5XwWvLJzvYi5ebcyS+YyynIIuvY2yXZ2Ono2RCvXCYStcRxmqnk1H5qfw25Zh3//Gc/65B0LleUqZtcuugbYHTJnHDVztneyNe/Ovt3NoNMCosg79zrt8PctLI1h1wMNLRsjCwIrkZ4X7cqBi0un0ZWM3HWE6iXKiRXMxLiG2K8KVo+5tZ2TiZXcu4Y0XB9X/IP+X1P8xTho25GD6QnlQefDIHR8QGocvcbGwO2UaxT215Dakf7lzwJCVvP3GD9u/8cIJkyDcui4+bP9J+aj4l+G2/iLXGq9ktDmRIDtS/gbWXsWU7GEO5WUUpf6DnoULhU0KH+5cyxgsKcWeNS/t/oJ9vukVo/RHBgso9ncCLdNSQkaSE4NewKr29U8S4oUilseDjA3CcxPjkzjpadCYXSoeb7M9d7luZvUH0Xc1Ks9VH+kG6q2Y9mZZiuT6egD0ApJVkfJBVc4GO6kfv5hUzJRoLOYzZK+ZwwFc1spx6Sv62z2VUb59ie9q/rmpmR/Lz81LZtFQ4luXnV+qRt992yLtxmLX/b88JMSpt30VFyLzj2U7sGGVEmkfg6PGH8Wq7cC3motavZ4p+fUKzKN3Q5+WC/MhX1ctdIgSOMwc/PV+GWunQF/UekFQXrVo93HOvvKIETueneC2PbHeVjbRn44676cccsFNUsvcey7dOuFqz1Nln3KcQKexHKVXQiC2M9NO0C+5MdU0zdop9ZO0eHO36HK5lfxfBmzvmru6m77/lltg+25VU/7lmGcdknxRTGJDTH+4Zz5L3s7Y9mUiR81T1HAkNnnn+AtilfTy2O73YOZoTJ2+Ylaud5OQ453pUF6dcj0D5w9wSqmmhZUu80tpVxpqKuZ0G5T+Dt/8jSa7XUv4tZMQlrkYzdtIN3nPNenQT8Famfra3PM5QNV2LTfFeuiJM/GrRkTtKVDeGefMfELW+4Uut77g96E3tqvEjZXT/W3K/sJh2GHmoZuIj4+Vn4xHzUyn6VXcfBngqmtS6et50NvF8VCldF/HqUmuXvKGlW5+Kx5Kkf8LaMdk1/VFfjmNVxY2nH+iXXepPN+3Lfu2Mq/DrCtvWr8Rgf7eBtF3+yBN+QDljq6E6h7Y+fPE89sEoRqz0CI2ShK4B6nArMA4QR3siqz4WpHFA7vjOZ52txVXIvzuCnCPf5YbJ/GCoeSw7h/BTGmTz+jAU8P7e3w1HpLFtN//UwNSPnUYZmknr0Rn7M7MGPR26/Tw3OfqpYDQ5XsUhK/5L2JPciQyP+YXr2FvqaYRvNzn5tqJv5eldgeu679uz3O0Y7cwm3FrE1cacLWgc6ZW9+YaO29rf0B3C+/UtQZrEJMQ8MML8aFI0K8GuJvY9gpnz5srKSjrbKOb3LCkpXdJQU+1bcAkMtCXkBFxXeqhFhTv40W0Ud4cFJKXnty2paXIdYA2ViGCw1jhboZNyOQ1ub6KsQ6bCkxHDSfRz1sKW1vMYSDspppHuC1PdnGvtIWHojLeGBc9x1LrsIWEYjfS1l8t9fJXlaWZLcIIKkBcnVyprkbiHwQhqX6CseiTuMvhiOXqZ47KE0BZeIS8ek0o1+fcc+91XWYypYlUaeJ9sf58JIwqyUkFPB/58UgyFPTBAnmiYcJrhOyfzvmXSa1Z8qEjC3ebTf6NDY1FihldClQ9bB7m/f9LhJvTE8dj0lG48jR6jGfIcC/nj82dbtrRunqYTlFJ7y8KZuTX30q9alZWSGaHzi6fH6hwZAfnnN3t8c8wDw90+QT/YJbIP+j+GwvfnO3P2eN3xz7PIN8/ceQnjNj1b/3S+t9t37Q7cf4ZaDDW/005u2bsXD/HR674oSD47g6TXs2/SzmdMQh/0DoIdtH2oliQQHOgoGeGcV099OrAjdRm7iKmcB9CrDArCOhva1lKGKqoIfOhrNZZIUrfIauogcKnBSY4U6RYutuaoCuTdRKOX01X4FCJ9oA+yjtoUDZ5+dlru2wgCgV+i3+45FgzFFflYa+WsGyh0FBR6grE0s33WDP9QxhsU45riT8iyH7kghx9wwDe1NAhAjYrd9D1Jd1z/oETAs2jDHLaMEOdRtLRjGDHOai1GC8pMXQiJSRbZsoNPDsPiAOf6lPH/CnBQyL3IoWpLyIuiLjKPfwCjUpFrr41zVw82W1qkHGpdxNBdSnmysI4Ucc4MLSBroOdiZUVnyaAQaknE0AYzCTHgZv0AecK16OV4mlapnlGoJu3Toxaq5y41WoHTP0VRwNLkKKeRKxLP7GUcjwdF0MAqd4daCbwDKQfgjtmTOsJzEDZyR0NtQuOS2+hGyeYHG+IcQRpkYiqp2rRaioepUJuoRdNd0XbzwAMLT/9INqi1dmV55RVuHri+zZ7oX5QGWbpoU9gLYYWx9n/q7dkrFvGBKn9NA/tgrgKQkCUjg2wuSOP6C492MASB3788h6YIRBU4gTiSphtYX9efaX2xbr7/Q3vJ9ilQa/h/vNxbdjvKoV/ckTUmUcaDh0hp7BUnp2wNgAZBP91K82lGd774g6Zv0uM2s5eA8l3FdWE4zDphv0CbB0jer2bYLxGbdS7WI/NmhrZnHka/bFFCW6Hz2KqB+3D3Cw1KoarwnfXMXdZ9V1qEuJQHpmx2b0LgJMJ2wMrOv4YDBM7O5S3HMGAM+RxJKYtU4P/e2hL2OVbBNFkdgTu1sT/JAd2Cqv/gXlRVGE4qQh3YsEnqyYhvV6ia14+SwV51rtOnrH3P+WT7lxBIJmAr2z2gyEnHnOILjrrG6ROb/0+XHoknd4oLz4LAwgQhdXBolAGid8ZRxV0cKpiMHZ6nHAotJTp0Q4D1aTJwIs0YITpmAjIl9umV0wSwLgoCURIv6EtJ6GaLP8VVrJglXu3ynFKbhWzdNKUldM47o+o71jG7tbbsq4qDzcyCkinerAhmOT23BrDiTyxmuh494Tz5So3RP93cj8MXCMCnjG++OD+whkzfxM5sraWVCXnusk5XH8/kYD9Apdte9SeWNklaNSve0V/qKL6rQ5qO0ymSWI7wnlu4fgkTedtJFJ2BtqOjZCJza8eF+NR2mQRRM8Vbcfo4mMcahhBAv8ogErmy1FOBWH9QM5rXuIRjeDs6aKlvZbIqgTGE9wQSrmK3ZcxiQVUXNjYaCArsMkttyDaSvkxaNohxllPXFULBfRQa06QsjsMYrtDGtlaZ5zYwaGSckjoXX4zNCoiUwcEdXlw87OtKxL98aKP1cTv/EePpyf/Trd6zPL39JiGbYtpihehNyreeWiyp0w2JjLcleDXiIgaE57vAaG81EAB/bCu+pCwuBnoJ144HFzjzlN3LqqedCqaGioh9H0dzzR+JV9fspZHFpaeLzg3+0+mTDsIlB8UZdNCoxx+Bo/TpEINovqkM23RuJr2ZlHyAPgwKKLjSYW7T213tPp/eAFLsrwWh9Yw1qZtDyWo86j6tJlQvl4sBFbYAlrsDF1Mi4sTWpRdtYpDZk3/l47RJ77h2tZmpvtLRUyipMu/cAUupbMkzexGJSYcyPsVL3MGiGeFtRjhfJyOYqSpHq/C8oAgIYZuA5qHUY8IwvNl61KEVBwbdQkpjQsknDyFgZshmXRMJ2MzINSW6+O/68/PAvwY285YCQQEU9NALTR4tE0zzqi31PJ75FppSzbsaKvpFU/DN1PDLXStdfWBk43EpZHtJj0BBYF6pif4kIPyteNmtMmvNdtY/sh3r6cl09EwfMrUO/yvCWzJXKbeIB2J7DS7Q5HRO3Rlkz9G2W47W87QYIMXm9KsdbNcc7Dl5AzbnsNlucsvRl20VkgQWI+Q1PqrP3iW4EqxWkTrCTOOgxe7iiHzwiDWgbDdKtmtBk0Nq28FKwpfqndRqvi6bysDqqVDBKtF5EDEIpAybJAwUG8dQLMwID1Ed8fB7pPC1WIqz80y0dROdQYoeUjj2rIZD2jYuwYLgreI4OTXWR7lF0Wx6821FdyTBJduCNDYGJbQnT1W1q2Be5CFQd4yMwZ34kCKp4bd5gigW0STQJxqNr5qPA6AYHl5OmrqHWuAtgU02CwTFwdIaNaViKsY45VykZWO/WyFpGtV1PkvaqCoU2AyWEJrFGEnbu+aRr22N0tqkJDGPopEwVsd05MtRTBi3IEb4j54LjPgkTchDmsAsk3J5XMW6BouXmhwdnesqccB28dNhFjP84JMcd03pjK8TLZvgURkqMDTWhsit546w4DOOQgt3HAPEDWUQ5WleFILU4M/18eGSG0CXgCmFmX2/HYDCPV0jRpVy99ZC+ND6ngMrzgoulP9zNiZBYiEd2BIoMHYzkJeB2hzlcvpCepkUrl+Oj63xFm+viKYunQ8nFGqh0F9sZOoek3dLOg41pIIFYCeG6fXD8etn97BFPDiihD1arntvDef0DHLL7ElrVX04VYjKasTLNAYok5FWLTgrT8XMuXEGBeCokAMileczBWq9AlXrW6PjIk3yZMWr1mzPfv68HoELyphb3wF8tTAvTSYda23dpbxF+ZnsFIemitB3rBciNhCx5LPCGmx6pdAER8VGsDDaxO8MJ93O5NSRzIfSFhNC4vi1yj886bHX3pxsAOGGzCNatcQfy1A0DGKKmNKXzY9vxrJXIY4MXuOmlrOazdi9cLrtWYZa6MqJMxDb4mw4zVRTKcEdX9oEyq+Fy9TQEZ5WT+alVv5qIecYNmzrEKmvASXIZrsiPUTE+x5CJXaub64kQlMpF1ySd1J/BpKzENDA+W28XKoDoBROefvDY09zu4Q5tbmzoyllRAtQFyk6aR+2F7bhea/Jr4stgfwOD5eJWnhWBmH4vcXcBIWGpxpCl8Kh2KaoSxYhb8k94TsDC5wwRrAx1QO3CGeKkMwSdl+FEMBdzhvBTduu52mEHO6T6a66blxmYLzhElG/1mMyjWMHJOpBKdTYqEFviPl+PayR1K9bHFTJmkHgIYwADEk53znHWSC/WJfRRni/SAlDr2qX9PWDGIaxikJfuPBEq53zWf7uymOSOB2tQIBIj2ZHlgMqm6wJH6lnelMfyuPaIT30VLsrNuk1WmDEsFYYh9Yq9ZYNUURSoPUI+0PrUIC73hPFd9awnJn06q0JMZYld/7/Ekr6a2z6fmWLbxXRQHLLsSeKzmIigUWDyl52RGlneKaskGBmNJ+0sRKoinljZreXBcnpbomkKxk/cYBGqASFy8+QDGVmagbrj2eSUowkEgzkXKTMIri3OUEI3ZYgn8zDK7pTUOpp24XKHhy1YC9ReQhITiagW/AgJOZsKbVPbBtZI1rVV45DLeCeMzKnP/oqz+eHaE8TC091ImehpElkHPMXPbMLTWSNbMQq5UxYRbh2pHv6/kwP94VAPelAOwc/jMJb8ichGYX0P+kRcA0HG5Xw8mnxUv+nOL0dX8C6KC3JXxSoxYCYgsUmj99b0evlWTKtoLHbfKZveG3fF0XfKu0A8asUSaro7zbWh+uqE+z71xarUcSIcjMBzsyKQ5m64Rx2r75CpjUXutQcR0wVXt0F3G4vZFk+WLETae/tdLINOYLOniH1fi0S7ml+2Yfc5j70cK3EyorJUgxKok4UyN2sLXlXcMRtrbUHDU0bpMSGrXz5vyRcfdSgNczdciQG9dkjOEm7kbnjFww1XdP3HWiu2ste4UHm7s/Am3pL6HTxuH/f+MeAhrpGv33ZzRvhyFxZjrlVUqgQ+4PigYyCx6CmlLN18zRS6nLBSx4UqdBcTHCA06tUEDcnAapExl9ZwBhJCLFwNiJ5wxU5YYP0CYynWtcU0QQc6tOTe7zotOCf8L8ZfaWoVmHgNwtWHan1cdabjScS1c9apsLfk/8nPGGbAnggAmgRldTwA1ikYtcbnDqkaRsEANTLY8IJ8fXuqsgIDijkgszjs8kD97qoN5BCyQp/Y93GG9jBUjUqi8ofhRCKq4C6u1hfroWuMSJWhpqSONmJN0uM2s/khhslWMWMv1fdJKLmbcy36Y6Veo1b2y/uhxE1GV3zoJrfxgtBaYLJ51JS/cBAHCphkCVBD9t7GB0TZEP9ISiDX5Gfg0cv5SjPXEcKmx5c19GXDn+sYyAEPllTZECjVGmeIogFv39QPRvLMxIZBIRWgOw0Bmyoc5IlsnB1+mHtsi5kD9xc4MXDXEX6ApZiQqa5rgb2UghxpGq1po0qY6jRL2C4Plghz0p98YrlcwEGABu5aqW9RmAUVbpSlPWPeQCbjp9HtokliJa+yuvDzcab8lzq4X28VNlUkvMSdzqWZbbcAdkToC0pgB9JzG37dPxm67CO+dR/CN2a70OqTc+mRlEhgkyf+6m4/g0+L6oQWMwnudvAQM1N3cX47ePsxO5ChoZsPGEaa2gUTqrQpVKZgcZi0bSNZMkW2vfeM/9Qs+ecEB/FzoxbcEO+42S+t514LeJMAaE1ZfiNOnc8JU7ASGEQOJnAGv4teq/vZmMlXsKaflT9i9Ts8KBG+bKFm6JQcKqVJuW5UKVwm1C8u6ctp9VyrT7JKW9q4TzrfZdCVLxelin/SYe4bDeDqxdhwJKF/qqrpxduO45t4eJPsZy7cHFdeDg96v/xJQTsnJv3lDqWIUQlmMUIcANQ/8RPLmae1w1Mo1wgaxJtXftrvL4SQUCgmpc53+wORQtJY8GdRC9IZ9pCIT1nx8q7roXhDJ2eHFQg73YKKdk4Z5Z2Lb1x9hPmkoNXTEGqJNdJLAOnaaNmt3k/Alj+41ZjxJ7vcdEeUEuFrJQ1TBGWMSruvPSlPp60/1g8+bmkeWGRpc2jgYd2lsd0MS3pKFgboM1QxAekAhfNzHjtF1uBMRBXopTziWaCl9IlFNFHBLuPZ1F1igbo+/0g0aGk03B7A7RBMkk/PH1dL4sW9Uo8MRLWWOY1TAp/GDNbcXYgIVRG/s3C13YCbQN4LkqWuWrjXwJyLyC41OW5PXYmo6BWhfWBONpdhd3gzq6hZKf2dk0H+HZ6eSQDmnyZMsLzYaofa//Qnxrl6WcEzIm1Ve0wrZ97/V4bTQP/YtizFDlgxQMtVlLVqk1dQI58DwCjfU8ArooxYyjGCvm9DcY74tPVw18P1NfKOlNDnZLWggpqDahqR6uGqB2PxgVoY/dnoOJJegZfhV4Aa0S6CJqVxyqCg10Er7GX2Rc5APUJqEYWjzLGIsPd+iZFSEUdhK7OpcQpPg8cUM+BF+EneiVETUf4KVIbU7IpAVYDgIjK4Htl65OuR+xpVRurS5+Ritc/XoFRBHSKvHpF6zp6VGqlz/I/ANrGv5fBNHEotyCmlVqQPFLjkCgRGpHqE6hGuR7QeEUvSU6sqLA4LOY4FhdPh9JB1IdpF+PBHHB8pcSuS81EwaRj6nwYC8MNEtAGK/y0lXZQcig7yyH3TU7CZMGAqRxBYE2+jaYvO1mPHnHRDTbfPe1SFzTSQbaYNlu5Zc0ftds/DT6TEBGcsV4sCnsaUHxgH3dME2iBXlYuICvc6DmwJ/50F+P7XvsB1usb/4MQEAPDBXzzyAHz++BOHP4X+bLAenxACmPjfMXBMF0B/4TgHABO3eWn/Vy/5/0xQ9G3N4nU0PP6JtvWnygtBbraySaqQ7pWAPOIfTmglW1apJFxJTmUSk0ijUYwpxSv5Vc7ppKIj9MAXHtBBGxJgCooVKbrERi6NFMjXPUBxiomqDax7M0H5D2TzhYFOWWKnaSCzoe5xBjq6/K7dQBG2lt4MOg4M5AUDgyMDXReKUkTn22TdRnS8+nKUfc5T7a5oyPfO9LI088CFXHIsFznEG41VgiKqBdQjmdZQULl4J7l6JVVlnuGSwfxThENpcSkD04q9VMVtxbHWyuobdO6OXkBJkqYkg0MVPZx/6c4aOUEqBQTImcvqA+IDNC7VfYp1hVAitytNdGNGj87aPfJT66x0RMsCzt2iALHrKhsjanMLuQbJHZD41QzVtRkjnUUNKKRMFJSKQm5qsi77CJHZoGiLylANTZit4jtojE/AA9c1plZIrXVCumUhAw54Dc4Lr53seyM8qdicqrttPeZWMpUOZthkq+LMYpihiBmjNha09RH8ey8uNVBdYQirDJTuvNqBrOjw5xFl0gp3UsWLZ/GlWyxSY4mC4s4fwu6V3LXKPvWksso8zUmgmI4ulT0xAAIMuLq4PuBSUzpHwq4wJ091DYdbxGMFOCeQpQ7tb/CtSyQHxR0SwAGqyeeIVRd4hAgHOC0W2q6qj0hbg9CU6ZOCYvYEUEHZVQ0BvpOLHxFyRJadBhSwy6Gy5p4DOCiXu3H8wJ0GwwZOOAtOhNCAiLOQpF05C0WEf+5crOWwROWBKhSVrmDuyMhI4Mubz2EuilKF7uW2SIKF8LW6RogyeYqUdvxCKtRz6t3tUeUzoJwaGUMFwlPYUZouz10g6J58kDJWVMG8KfDnm9dJrgmJeciLFYERHXrMWEFATgjXX668W6PMagne8o7h2GAM2MAQCDvYBjGEA/SJ8QbhKZJyGhYwYQPjIAGI9Cg7dVrT22BieDOn5l8cLpwbE+cvjpDIixm8hmSQiWNb9dtQ8tE4wRPFt87STFVoFq5QJUYAVcXqIgVnHYdBt87G49bYRZlkCOeugGWDMeB/wiiviIkHdMVrzBNypRSXF0iuGsPtVJGPCr6rAAAA') format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;\n}\n\n */}),\n ];\n var negEgs = [];\n\n this.testProduction('stylesheet', posEgs, negEgs);\n }\n },\n ],\n});\n"} {"text": "Microsoft.CSharp\ngroup fcs\n FSharp.Core"} {"text": "{\n \"addr\": \"0xac3211a5025414af2866ff09c23fc18bc97e79b1\",\n \"decimals\": 18,\n \"description\": \"Blockchain Powered Mobility\\nDOVU is shaping the crypto model for the mobility ecosystem. Introducing a transport focused protocol to accelerate the development of mobility related decentralised applications (dApps), the DOV token powers new business models in the transportation sector. The creation of these dApps will be fueled by data, therefore the DOVU API Marketplace will support the community further by simplifying the development of mobility data globally.\",\n \"links\": [\n {\n \"Bitcointalk\": \"https://bitcointalk.org/index.php?topic=2116249.0\"\n },\n {\n \"Blog\": \"https://blog.dovu.io/\"\n },\n {\n \"Email\": \"mailto:support@dovu.io\"\n },\n {\n \"Facebook\": \"https://www.facebook.com/DOVUglobal/\"\n },\n {\n \"Github\": \"https://github.com/TokenMarketNet/ico\"\n },\n {\n \"Slack\": \"https://discordapp.com/invite/6uFPys2\"\n },\n {\n \"Telegram\": \"https://t.me/dovuico\"\n },\n {\n \"Twitter\": \"https://twitter.com/dovuapi\"\n },\n {\n \"Website\": \"https://dovu.io/\"\n },\n {\n \"Whitepaper\": \"https://dovu.io/whitepaper.pdf\"\n }\n ],\n \"name\": \"DOVU\",\n \"symbol\": \"DOVU\"\n}"} {"text": "CONFIG_ARM=y\nCONFIG_ARCH_CPU_INIT=y\n# CONFIG_SPL_USE_ARCH_MEMCPY is not set\n# CONFIG_SPL_USE_ARCH_MEMSET is not set\nCONFIG_ARCH_EXYNOS=y\nCONFIG_SYS_TEXT_BASE=0x43E00000\nCONFIG_ARCH_EXYNOS5=y\nCONFIG_TARGET_SMDK5250=y\nCONFIG_ENV_SIZE=0x4000\nCONFIG_ENV_OFFSET=0x3FC000\nCONFIG_NR_DRAM_BANKS=8\nCONFIG_SPL=y\nCONFIG_ENV_SECT_SIZE=0x4000\nCONFIG_IDENT_STRING=\" for SMDK5250\"\nCONFIG_SPL_TEXT_BASE=0x02023400\nCONFIG_DISTRO_DEFAULTS=y\nCONFIG_FIT=y\nCONFIG_FIT_BEST_MATCH=y\nCONFIG_SILENT_CONSOLE=y\nCONFIG_CONSOLE_MUX=y\n# CONFIG_SPL_FRAMEWORK is not set\nCONFIG_SYS_PROMPT=\"SMDK5250 # \"\nCONFIG_CMD_GPIO=y\nCONFIG_CMD_I2C=y\nCONFIG_CMD_MMC=y\nCONFIG_CMD_SPI=y\nCONFIG_CMD_USB=y\n# CONFIG_CMD_SETEXPR is not set\nCONFIG_CMD_CACHE=y\nCONFIG_CMD_TIME=y\nCONFIG_CMD_SOUND=y\nCONFIG_CMD_PMIC=y\nCONFIG_CMD_REGULATOR=y\nCONFIG_CMD_EXT4_WRITE=y\nCONFIG_DEFAULT_DEVICE_TREE=\"exynos5250-smdk5250\"\nCONFIG_ENV_IS_IN_SPI_FLASH=y\nCONFIG_USE_ENV_SPI_BUS=y\nCONFIG_ENV_SPI_BUS=1\nCONFIG_SYS_RELOC_GD_ENV_ADDR=y\nCONFIG_SUPPORT_EMMC_BOOT=y\nCONFIG_MMC_DW=y\nCONFIG_MMC_SDHCI=y\nCONFIG_MMC_SDHCI_S5P=y\nCONFIG_MTD=y\nCONFIG_SF_DEFAULT_MODE=0\nCONFIG_SF_DEFAULT_SPEED=50000000\nCONFIG_SPI_FLASH_GIGADEVICE=y\nCONFIG_SPI_FLASH_WINBOND=y\nCONFIG_SMC911X=y\nCONFIG_SMC911X_BASE=0x5000000\nCONFIG_DM_PMIC=y\nCONFIG_DM_PMIC_MAX77686=y\nCONFIG_DM_REGULATOR=y\nCONFIG_DM_REGULATOR_MAX77686=y\nCONFIG_SOUND=y\nCONFIG_I2S=y\nCONFIG_I2S_SAMSUNG=y\nCONFIG_SOUND_MAX98095=y\nCONFIG_SOUND_WM8994=y\nCONFIG_EXYNOS_SPI=y\nCONFIG_USB=y\nCONFIG_DM_USB=y\nCONFIG_USB_XHCI_HCD=y\nCONFIG_USB_XHCI_DWC3=y\nCONFIG_USB_EHCI_HCD=y\nCONFIG_USB_HOST_ETHER=y\nCONFIG_USB_ETHER_ASIX88179=y\nCONFIG_VIDEO_BRIDGE=y\nCONFIG_ERRNO_STR=y\n"} {"text": "package cuke4duke.internal.language;\n\nimport org.junit.Test;\n\nimport java.io.UnsupportedEncodingException;\nimport java.util.List;\nimport java.util.regex.Pattern;\n\nimport static org.junit.Assert.assertEquals;\n\npublic class JdkPatternArgumentMatcherTest {\n @Test\n public void shouldDealWithOnlyAscii() throws UnsupportedEncodingException {\n assertVariables(\"Ja (.+) elsker (.+) landet\", \"Ja vi elsker dette landet\", \"vi\", 3, \"dette\", 13);\n }\n\n @Test\n public void shouldDealWithUnicodeInsideCaptures() throws UnsupportedEncodingException {\n assertVariables(\"Ja (.+) elsker (.+) landet\", \"Ja vø elsker døtte landet\", \"vø\", 3, \"døtte\", 14);\n }\n\n @Test\n public void shouldDealWithUnicodeOutsideCaptures() throws UnsupportedEncodingException {\n assertVariables(\"Jæ (.+) ålsker (.+) lændet\", \"Jæ vi ålsker dette lændet\", \"vi\", 4, \"dette\", 15);\n }\n\n @Test\n public void shouldDealWithUnicodeEverywhere() throws UnsupportedEncodingException {\n assertVariables(\"Jæ (.+) ålsker (.+) lændet\", \"Jæ vø ålsker døtte lændet\", \"vø\", 4, \"døtte\", 16);\n }\n\n private void assertVariables(String regex, String string, String v1, int pos1, String v2, int pos2) throws UnsupportedEncodingException {\n List args = JdkPatternArgumentMatcher.argumentsFrom(Pattern.compile(regex), string);\n assertEquals(2, args.size());\n assertEquals(v1, args.get(0).getVal());\n assertEquals(pos1, args.get(0).getByteOffset());\n assertEquals(v2, args.get(1).getVal());\n assertEquals(pos2, args.get(1).getByteOffset());\n }\n}\n"} {"text": "#pragma once\n\n#include \n#include \n\nnamespace FishEngine\n{\n\n\n/**************************************************\n* FishEditor::ModelImporterMeshCompression\n**************************************************/\n\n// enum count\ntemplate<>\nconstexpr int EnumCount() { return 4; }\n\n// string array\nstatic const char* ModelImporterMeshCompressionStrings[] =\n{\n \"Off\",\n\t\"Low\",\n\t\"Medium\",\n\t\"High\"\n};\n\n// cstring array\ntemplate<>\ninline constexpr const char** EnumToCStringArray()\n{\n return ModelImporterMeshCompressionStrings;\n}\n\n// index to enum\ntemplate<>\ninline FishEditor::ModelImporterMeshCompression ToEnum(const int index)\n{\n switch (index) {\n case 0: return FishEditor::ModelImporterMeshCompression::Off; break;\n\tcase 1: return FishEditor::ModelImporterMeshCompression::Low; break;\n\tcase 2: return FishEditor::ModelImporterMeshCompression::Medium; break;\n\tcase 3: return FishEditor::ModelImporterMeshCompression::High; break;\n\t\n default: abort(); break;\n }\n}\n\n// enum to index\ntemplate<>\ninline int EnumToIndex(FishEditor::ModelImporterMeshCompression e)\n{\n switch (e) {\n case FishEditor::ModelImporterMeshCompression::Off: return 0; break;\n\tcase FishEditor::ModelImporterMeshCompression::Low: return 1; break;\n\tcase FishEditor::ModelImporterMeshCompression::Medium: return 2; break;\n\tcase FishEditor::ModelImporterMeshCompression::High: return 3; break;\n\t\n default: abort(); break;\n }\n}\n\n// string to enum\ntemplate<>\ninline FishEditor::ModelImporterMeshCompression ToEnum(const std::string& s)\n{\n if (s == \"Off\") return FishEditor::ModelImporterMeshCompression::Off;\n\tif (s == \"Low\") return FishEditor::ModelImporterMeshCompression::Low;\n\tif (s == \"Medium\") return FishEditor::ModelImporterMeshCompression::Medium;\n\tif (s == \"High\") return FishEditor::ModelImporterMeshCompression::High;\n\t\n abort();\n}\n\n\n} // namespace FishEngine\n"} {"text": "\n\n"} {"text": "/*\n * Copyright (C) 2007 PA Semi, Inc\n *\n * Maintained by: Olof Johansson \n *\n * Based on drivers/pcmcia/omap_cf.c\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#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \n\nstatic const char driver_name[] = \"electra-cf\";\n\nstruct electra_cf_socket {\n\tstruct pcmcia_socket\tsocket;\n\n\tstruct timer_list\ttimer;\n\tunsigned\t\tpresent:1;\n\tunsigned\t\tactive:1;\n\n\tstruct of_device\t*ofdev;\n\tunsigned long\t\tmem_phys;\n\tvoid __iomem *\t\tmem_base;\n\tunsigned long\t\tmem_size;\n\tvoid __iomem *\t\tio_virt;\n\tunsigned int\t\tio_base;\n\tunsigned int\t\tio_size;\n\tu_int\t\t\tirq;\n\tstruct resource\t\tiomem;\n\tvoid __iomem *\t\tgpio_base;\n\tint\t\t\tgpio_detect;\n\tint\t\t\tgpio_vsense;\n\tint\t\t\tgpio_3v;\n\tint\t\t\tgpio_5v;\n};\n\n#define\tPOLL_INTERVAL\t\t(2 * HZ)\n\n\nstatic int electra_cf_present(struct electra_cf_socket *cf)\n{\n\tunsigned int gpio;\n\n\tgpio = in_le32(cf->gpio_base+0x40);\n\treturn !(gpio & (1 << cf->gpio_detect));\n}\n\nstatic int electra_cf_ss_init(struct pcmcia_socket *s)\n{\n\treturn 0;\n}\n\n/* the timer is primarily to kick this socket's pccardd */\nstatic void electra_cf_timer(unsigned long _cf)\n{\n\tstruct electra_cf_socket *cf = (void *) _cf;\n\tint present = electra_cf_present(cf);\n\n\tif (present != cf->present) {\n\t\tcf->present = present;\n\t\tpcmcia_parse_events(&cf->socket, SS_DETECT);\n\t}\n\n\tif (cf->active)\n\t\tmod_timer(&cf->timer, jiffies + POLL_INTERVAL);\n}\n\nstatic irqreturn_t electra_cf_irq(int irq, void *_cf)\n{\n\telectra_cf_timer((unsigned long)_cf);\n\treturn IRQ_HANDLED;\n}\n\nstatic int electra_cf_get_status(struct pcmcia_socket *s, u_int *sp)\n{\n\tstruct electra_cf_socket *cf;\n\n\tif (!sp)\n\t\treturn -EINVAL;\n\n\tcf = container_of(s, struct electra_cf_socket, socket);\n\n\t/* NOTE CF is always 3VCARD */\n\tif (electra_cf_present(cf)) {\n\t\t*sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD;\n\n\t\ts->pci_irq = cf->irq;\n\t} else\n\t\t*sp = 0;\n\treturn 0;\n}\n\nstatic int electra_cf_set_socket(struct pcmcia_socket *sock,\n\t\t\t\t struct socket_state_t *s)\n{\n\tunsigned int gpio;\n\tunsigned int vcc;\n\tstruct electra_cf_socket *cf;\n\n\tcf = container_of(sock, struct electra_cf_socket, socket);\n\n\t/* \"reset\" means no power in our case */\n\tvcc = (s->flags & SS_RESET) ? 0 : s->Vcc;\n\n\tswitch (vcc) {\n\tcase 0:\n\t\tgpio = 0;\n\t\tbreak;\n\tcase 33:\n\t\tgpio = (1 << cf->gpio_3v);\n\t\tbreak;\n\tcase 5:\n\t\tgpio = (1 << cf->gpio_5v);\n\t\tbreak;\n\tdefault:\n\t\treturn -EINVAL;\n\t}\n\n\tgpio |= 1 << (cf->gpio_3v + 16); /* enwr */\n\tgpio |= 1 << (cf->gpio_5v + 16); /* enwr */\n\tout_le32(cf->gpio_base+0x90, gpio);\n\n\tpr_debug(\"%s: Vcc %d, io_irq %d, flags %04x csc %04x\\n\",\n\t\tdriver_name, s->Vcc, s->io_irq, s->flags, s->csc_mask);\n\n\treturn 0;\n}\n\nstatic int electra_cf_set_io_map(struct pcmcia_socket *s,\n\t\t\t\t struct pccard_io_map *io)\n{\n\treturn 0;\n}\n\nstatic int electra_cf_set_mem_map(struct pcmcia_socket *s,\n\t\t\t\t struct pccard_mem_map *map)\n{\n\tstruct electra_cf_socket *cf;\n\n\tif (map->card_start)\n\t\treturn -EINVAL;\n\tcf = container_of(s, struct electra_cf_socket, socket);\n\tmap->static_start = cf->mem_phys;\n\tmap->flags &= MAP_ACTIVE|MAP_ATTRIB;\n\tif (!(map->flags & MAP_ATTRIB))\n\t\tmap->static_start += 0x800;\n\treturn 0;\n}\n\nstatic struct pccard_operations electra_cf_ops = {\n\t.init\t\t\t= electra_cf_ss_init,\n\t.get_status\t\t= electra_cf_get_status,\n\t.set_socket\t\t= electra_cf_set_socket,\n\t.set_io_map\t\t= electra_cf_set_io_map,\n\t.set_mem_map\t\t= electra_cf_set_mem_map,\n};\n\nstatic int __devinit electra_cf_probe(struct of_device *ofdev,\n\t\t\t\t const struct of_device_id *match)\n{\n\tstruct device *device = &ofdev->dev;\n\tstruct device_node *np = ofdev->node;\n\tstruct electra_cf_socket *cf;\n\tstruct resource mem, io;\n\tint status;\n\tconst unsigned int *prop;\n\tint err;\n\tstruct vm_struct *area;\n\n\terr = of_address_to_resource(np, 0, &mem);\n\tif (err)\n\t\treturn -EINVAL;\n\n\terr = of_address_to_resource(np, 1, &io);\n\tif (err)\n\t\treturn -EINVAL;\n\n\tcf = kzalloc(sizeof *cf, GFP_KERNEL);\n\tif (!cf)\n\t\treturn -ENOMEM;\n\n\tsetup_timer(&cf->timer, electra_cf_timer, (unsigned long)cf);\n\tcf->irq = NO_IRQ;\n\n\tcf->ofdev = ofdev;\n\tcf->mem_phys = mem.start;\n\tcf->mem_size = PAGE_ALIGN(mem.end - mem.start);\n\tcf->mem_base = ioremap(cf->mem_phys, cf->mem_size);\n\tcf->io_size = PAGE_ALIGN(io.end - io.start);\n\n\tarea = __get_vm_area(cf->io_size, 0, PHB_IO_BASE, PHB_IO_END);\n\tif (area == NULL)\n\t\treturn -ENOMEM;\n\n\tcf->io_virt = (void __iomem *)(area->addr);\n\n\tcf->gpio_base = ioremap(0xfc103000, 0x1000);\n\tdev_set_drvdata(device, cf);\n\n\tif (!cf->mem_base || !cf->io_virt || !cf->gpio_base ||\n\t (__ioremap_at(io.start, cf->io_virt, cf->io_size,\n\t\t_PAGE_NO_CACHE | _PAGE_GUARDED) == NULL)) {\n\t\tdev_err(device, \"can't ioremap ranges\\n\");\n\t\tstatus = -ENOMEM;\n\t\tgoto fail1;\n\t}\n\n\n\tcf->io_base = (unsigned long)cf->io_virt - VMALLOC_END;\n\n\tcf->iomem.start = (unsigned long)cf->mem_base;\n\tcf->iomem.end = (unsigned long)cf->mem_base + (mem.end - mem.start);\n\tcf->iomem.flags = IORESOURCE_MEM;\n\n\tcf->irq = irq_of_parse_and_map(np, 0);\n\n\tstatus = request_irq(cf->irq, electra_cf_irq, IRQF_SHARED,\n\t\t\t driver_name, cf);\n\tif (status < 0) {\n\t\tdev_err(device, \"request_irq failed\\n\");\n\t\tgoto fail1;\n\t}\n\n\tcf->socket.pci_irq = cf->irq;\n\n\tprop = of_get_property(np, \"card-detect-gpio\", NULL);\n\tif (!prop)\n\t\tgoto fail1;\n\tcf->gpio_detect = *prop;\n\n\tprop = of_get_property(np, \"card-vsense-gpio\", NULL);\n\tif (!prop)\n\t\tgoto fail1;\n\tcf->gpio_vsense = *prop;\n\n\tprop = of_get_property(np, \"card-3v-gpio\", NULL);\n\tif (!prop)\n\t\tgoto fail1;\n\tcf->gpio_3v = *prop;\n\n\tprop = of_get_property(np, \"card-5v-gpio\", NULL);\n\tif (!prop)\n\t\tgoto fail1;\n\tcf->gpio_5v = *prop;\n\n\tcf->socket.io_offset = cf->io_base;\n\n\t/* reserve chip-select regions */\n\tif (!request_mem_region(cf->mem_phys, cf->mem_size, driver_name)) {\n\t\tstatus = -ENXIO;\n\t\tdev_err(device, \"Can't claim memory region\\n\");\n\t\tgoto fail1;\n\t}\n\n\tif (!request_region(cf->io_base, cf->io_size, driver_name)) {\n\t\tstatus = -ENXIO;\n\t\tdev_err(device, \"Can't claim I/O region\\n\");\n\t\tgoto fail2;\n\t}\n\n\tcf->socket.owner = THIS_MODULE;\n\tcf->socket.dev.parent = &ofdev->dev;\n\tcf->socket.ops = &electra_cf_ops;\n\tcf->socket.resource_ops = &pccard_static_ops;\n\tcf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP |\n\t\t\t\tSS_CAP_MEM_ALIGN;\n\tcf->socket.map_size = 0x800;\n\n\tstatus = pcmcia_register_socket(&cf->socket);\n\tif (status < 0) {\n\t\tdev_err(device, \"pcmcia_register_socket failed\\n\");\n\t\tgoto fail3;\n\t}\n\n\tdev_info(device, \"at mem 0x%lx io 0x%llx irq %d\\n\",\n\t\t cf->mem_phys, io.start, cf->irq);\n\n\tcf->active = 1;\n\telectra_cf_timer((unsigned long)cf);\n\treturn 0;\n\nfail3:\n\trelease_region(cf->io_base, cf->io_size);\nfail2:\n\trelease_mem_region(cf->mem_phys, cf->mem_size);\nfail1:\n\tif (cf->irq != NO_IRQ)\n\t\tfree_irq(cf->irq, cf);\n\n\tif (cf->io_virt)\n\t\t__iounmap_at(cf->io_virt, cf->io_size);\n\tif (cf->mem_base)\n\t\tiounmap(cf->mem_base);\n\tif (cf->gpio_base)\n\t\tiounmap(cf->gpio_base);\n\tdevice_init_wakeup(&ofdev->dev, 0);\n\tkfree(cf);\n\treturn status;\n\n}\n\nstatic int __devexit electra_cf_remove(struct of_device *ofdev)\n{\n\tstruct device *device = &ofdev->dev;\n\tstruct electra_cf_socket *cf;\n\n\tcf = dev_get_drvdata(device);\n\n\tcf->active = 0;\n\tpcmcia_unregister_socket(&cf->socket);\n\tfree_irq(cf->irq, cf);\n\tdel_timer_sync(&cf->timer);\n\n\t__iounmap_at(cf->io_virt, cf->io_size);\n\tiounmap(cf->mem_base);\n\tiounmap(cf->gpio_base);\n\trelease_mem_region(cf->mem_phys, cf->mem_size);\n\trelease_region(cf->io_base, cf->io_size);\n\n\tkfree(cf);\n\n\treturn 0;\n}\n\nstatic struct of_device_id electra_cf_match[] = {\n\t{\n\t\t.compatible = \"electra-cf\",\n\t},\n\t{},\n};\nMODULE_DEVICE_TABLE(of, electra_cf_match);\n\nstatic struct of_platform_driver electra_cf_driver = {\n\t.name\t = (char *)driver_name,\n\t.match_table = electra_cf_match,\n\t.probe\t = electra_cf_probe,\n\t.remove = electra_cf_remove,\n};\n\nstatic int __init electra_cf_init(void)\n{\n\treturn of_register_platform_driver(&electra_cf_driver);\n}\nmodule_init(electra_cf_init);\n\nstatic void __exit electra_cf_exit(void)\n{\n\tof_unregister_platform_driver(&electra_cf_driver);\n}\nmodule_exit(electra_cf_exit);\n\nMODULE_LICENSE(\"GPL\");\nMODULE_AUTHOR (\"Olof Johansson \");\nMODULE_DESCRIPTION(\"PA Semi Electra CF driver\");\n"} {"text": "# This file is just a pointer to the file\n#\n# \"Library/Rochester/setAlgebra02ExponentsRadicals/sw1_3_7c.pg\"\n#\n# You may want to change your problem set to use that problem\n# directly, especially if you want to make a copy of the problem\n# for modification.\n\nDOCUMENT();\nincludePGproblem(\"Library/Rochester/setAlgebra02ExponentsRadicals/sw1_3_7c.pg\");\nENDDOCUMENT();\n\n## These tags keep this problem from being added to the NPL database\n## \n## DBsubject('ZZZ-Inserted Text')\n## DBchapter('ZZZ-Inserted Text')\n## DBsection('ZZZ-Inserted Text')\n\n"} {"text": "//#define ASTAR_POOL_DEBUG //@SHOWINEDITOR Enables debugging of path pooling. Will log warnings and info messages about paths not beeing pooled correctly.\n\nusing UnityEngine;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Pathfinding {\n\t/** Provides additional traversal information to a path request.\n\t * \\see \\ref turnbased\n\t */\n\tpublic interface ITraversalProvider {\n\t\tbool CanTraverse (Path path, GraphNode node);\n\t\tuint GetTraversalCost (Path path, GraphNode node);\n\t}\n\n\t/** Base class for all path types */\n\tpublic abstract class Path : IPathInternals {\n#if ASTAR_POOL_DEBUG\n\t\tprivate string pathTraceInfo = \"\";\n\t\tprivate List claimInfo = new List();\n\t\t~Path() {\n\t\t\tDebug.Log(\"Destroying \" + GetType().Name + \" instance\");\n\t\t\tif (claimed.Count > 0) {\n\t\t\t\tDebug.LogWarning(\"Pool Is Leaking. See list of claims:\\n\" +\n\t\t\t\t\t\"Each message below will list what objects are currently claiming the path.\" +\n\t\t\t\t\t\" These objects have removed their reference to the path object but has not called .Release on it (which is bad).\\n\" + pathTraceInfo+\"\\n\");\n\t\t\t\tfor (int i = 0; i < claimed.Count; i++) {\n\t\t\t\t\tDebug.LogWarning(\"- Claim \"+ (i+1) + \" is by a \" + claimed[i].GetType().Name + \"\\n\"+claimInfo[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tDebug.Log(\"Some scripts are not using pooling.\\n\" + pathTraceInfo + \"\\n\");\n\t\t\t}\n\t\t}\n#endif\n\n\t\t/** Data for the thread calculating this path */\n\t\tprotected PathHandler pathHandler;\n\n\t\t/** Callback to call when the path is complete.\n\t\t * This is usually sent to the Seeker component which post processes the path and then calls a callback to the script which requested the path\n\t\t */\n\t\tpublic OnPathDelegate callback;\n\n\t\t/** Immediate callback to call when the path is complete.\n\t\t * \\warning This may be called from a separate thread. Usually you do not want to use this one.\n\t\t *\n\t\t * \\see callback\n\t\t */\n\t\tpublic OnPathDelegate immediateCallback;\n\n\t\t/** Returns the state of the path in the pathfinding pipeline */\n\t\tinternal PathState PipelineState { get; private set; }\n\t\tSystem.Object stateLock = new object();\n\n\t\t/** Provides additional traversal information to a path request.\n\t\t * \\see \\ref turnbased\n\t\t */\n\t\tpublic ITraversalProvider traversalProvider;\n\n\n\t\t/** Current state of the path */\n\t\tpublic PathCompleteState CompleteState { get; protected set; }\n\n\t\t/** If the path failed, this is true.\n\t\t * \\see #errorLog\n\t\t */\n\t\tpublic bool error { get { return CompleteState == PathCompleteState.Error; } }\n\n\t\t/** Additional info on what went wrong.\n\t\t * \\see #error\n\t\t */\n\t\tprivate string _errorLog = \"\";\n\n\t\t/** Log messages with info about any errors. */\n\t\tpublic string errorLog {\n\t\t\tget { return _errorLog; }\n\t\t}\n\n\t\t/** Holds the path as a Node array. All nodes the path traverses.\n\t\t * This may not be the same nodes as the post processed path traverses.\n\t\t */\n\t\tpublic List path;\n\n\t\t/** Holds the (possibly post processed) path as a Vector3 list */\n\t\tpublic List vectorPath;\n\n\t\t/** The node currently being processed */\n\t\tprotected PathNode currentR;\n\n\t\t/** How long it took to calculate this path in milliseconds */\n\t\tinternal float duration;\n\n\t\t/** Number of nodes this path has searched */\n\t\tprotected int searchedNodes;\n\n\t\t/** True if the path is currently pooled.\n\t\t * Do not set this value. Only read. It is used internally.\n\t\t *\n\t\t * \\see PathPool\n\t\t * \\version Was named 'recycled' in 3.7.5 and earlier.\n\t\t */\n\t\tbool IPathInternals.Pooled { get; set; }\n\n\t\t/** True if the path is currently recycled (i.e in the path pool).\n\t\t * Do not set this value. Only read. It is used internally.\n\t\t *\n\t\t * \\deprecated Has been renamed to 'pooled' to use more widely underestood terminology\n\t\t */\n\t\t[System.Obsolete(\"Has been renamed to 'Pooled' to use more widely underestood terminology\", true)]\n\t\tinternal bool recycled { get { return false; } }\n\n\t\t/** True if the Reset function has been called.\n\t\t * Used to alert users when they are doing something wrong.\n\t\t */\n\t\tprotected bool hasBeenReset;\n\n\t\t/** Constraint for how to search for nodes */\n\t\tpublic NNConstraint nnConstraint = PathNNConstraint.Default;\n\n\t\t/** Internal linked list implementation.\n\t\t * \\warning This is used internally by the system. You should never change this.\n\t\t */\n\t\tinternal Path next;\n\n\t\t/** Determines which heuristic to use */\n\t\tpublic Heuristic heuristic;\n\n\t\t/** Scale of the heuristic values.\n\t\t * \\see AstarPath.heuristicScale\n\t\t */\n\t\tpublic float heuristicScale = 1F;\n\n\t\t/** ID of this path. Used to distinguish between different paths */\n\t\tinternal ushort pathID { get; private set; }\n\n\t\t/** Target to use for H score calculation. Used alongside #hTarget. */\n\t\tprotected GraphNode hTargetNode;\n\n\t\t/** Target to use for H score calculations. \\see Pathfinding.Node.H */\n\t\tprotected Int3 hTarget;\n\n\t\t/** Which graph tags are traversable.\n\t\t * This is a bitmask so -1 = all bits set = all tags traversable.\n\t\t * For example, to set bit 5 to true, you would do\n\t\t * \\code myPath.enabledTags |= 1 << 5; \\endcode\n\t\t * To set it to false, you would do\n\t\t * \\code myPath.enabledTags &= ~(1 << 5); \\endcode\n\t\t *\n\t\t * The Seeker has a popup field where you can set which tags to use.\n\t\t * \\note If you are using a Seeker. The Seeker will set this value to what is set in the inspector field on StartPath.\n\t\t * So you need to change the Seeker value via script, not set this value if you want to change it via script.\n\t\t *\n\t\t * \\see CanTraverse\n\t\t */\n\t\tpublic int enabledTags = -1;\n\n\t\t/** List of zeroes to use as default tag penalties */\n\t\tstatic readonly int[] ZeroTagPenalties = new int[32];\n\n\t\t/** The tag penalties that are actually used.\n\t\t * If manualTagPenalties is null, this will be ZeroTagPenalties\n\t\t * \\see tagPenalties\n\t\t */\n\t\tprotected int[] internalTagPenalties;\n\n\t\t/** Tag penalties set by other scripts\n\t\t * \\see tagPenalties\n\t\t */\n\t\tprotected int[] manualTagPenalties;\n\n\t\t/** Penalties for each tag.\n\t\t * Tag 0 which is the default tag, will have added a penalty of tagPenalties[0].\n\t\t * These should only be positive values since the A* algorithm cannot handle negative penalties.\n\t\t * \\note This array will never be null. If you try to set it to null or with a length which is not 32. It will be set to \"new int[0]\".\n\t\t *\n\t\t * \\note If you are using a Seeker. The Seeker will set this value to what is set in the inspector field on StartPath.\n\t\t * So you need to change the Seeker value via script, not set this value if you want to change it via script.\n\t\t *\n\t\t * \\see Seeker.tagPenalties\n\t\t */\n\t\tpublic int[] tagPenalties {\n\t\t\tget {\n\t\t\t\treturn manualTagPenalties;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (value == null || value.Length != 32) {\n\t\t\t\t\tmanualTagPenalties = null;\n\t\t\t\t\tinternalTagPenalties = ZeroTagPenalties;\n\t\t\t\t} else {\n\t\t\t\t\tmanualTagPenalties = value;\n\t\t\t\t\tinternalTagPenalties = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/** True for paths that want to search all nodes and not jump over nodes as optimizations.\n\t\t * This disables Jump Point Search when that is enabled to prevent e.g ConstantPath and FloodPath\n\t\t * to become completely useless.\n\t\t */\n\t\tinternal virtual bool FloodingPath {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t/** Total Length of the path.\n\t\t * Calculates the total length of the #vectorPath.\n\t\t * Cache this rather than call this function every time since it will calculate the length every time, not just return a cached value.\n\t\t * \\returns Total length of #vectorPath, if #vectorPath is null positive infinity is returned.\n\t\t */\n\t\tpublic float GetTotalLength () {\n\t\t\tif (vectorPath == null) return float.PositiveInfinity;\n\t\t\tfloat tot = 0;\n\t\t\tfor (int i = 0; i < vectorPath.Count-1; i++) tot += Vector3.Distance(vectorPath[i], vectorPath[i+1]);\n\t\t\treturn tot;\n\t\t}\n\n\t\t/** Waits until this path has been calculated and returned.\n\t\t * Allows for very easy scripting.\n\t\t * \\code\n\t\t * IEnumerator Start () {\n\t\t * var path = seeker.StartPath (transform.position, transform.position+transform.forward*10, OnPathComplete);\n\t\t * yield return StartCoroutine (path.WaitForPath());\n\t\t * // The path is calculated no\n\t\t * }\n\t\t * \\endcode\n\t\t *\n\t\t * \\note Do not confuse this with AstarPath.WaitForPath. This one will wait using yield until it has been calculated\n\t\t * while AstarPath.WaitForPath will halt all operations until the path has been calculated.\n\t\t *\n\t\t * \\throws System.InvalidOperationException if the path is not started. Send the path to Seeker.StartPath or AstarPath.StartPath before calling this function.\n\t\t *\n\t\t * \\see BlockUntilCalculated\n\t\t */\n\t\tpublic IEnumerator WaitForPath () {\n\t\t\tif (PipelineState == PathState.Created) throw new System.InvalidOperationException(\"This path has not been started yet\");\n\n\t\t\twhile (PipelineState != PathState.Returned) yield return null;\n\t\t}\n\n\t\t/** Blocks until this path has been calculated and returned.\n\t\t * Normally it takes a few frames for a path to be calculated and returned.\n\t\t * This function will ensure that the path will be calculated when this function returns\n\t\t * and that the callback for that path has been called.\n\t\t *\n\t\t * Use this function only if you really need to.\n\t\t * There is a point to spreading path calculations out over several frames.\n\t\t * It smoothes out the framerate and makes sure requesting a large\n\t\t * number of paths at the same time does not cause lag.\n\t\t *\n\t\t * \\note Graph updates and other callbacks might get called during the execution of this function.\n\t\t *\n\t\t * \\code\n\t\t * Path p = seeker.StartPath (transform.position, transform.position + Vector3.forward * 10);\n\t\t * p.BlockUntilCalculated();\n\t\t * // The path is calculated now\n\t\t * \\endcode\n\t\t *\n\t\t * \\see This is equivalent to calling AstarPath.BlockUntilCalculated(Path)\n\t\t * \\see WaitForPath\n\t\t */\n\t\tpublic void BlockUntilCalculated () {\n\t\t\tAstarPath.BlockUntilCalculated(this);\n\t\t}\n\n\t\t/** Estimated cost from the specified node to the target.\n\t\t * \\see https://en.wikipedia.org/wiki/A*_search_algorithm\n\t\t */\n\t\tinternal uint CalculateHScore (GraphNode node) {\n\t\t\tuint h;\n\n\t\t\tswitch (heuristic) {\n\t\t\tcase Heuristic.Euclidean:\n\t\t\t\th = (uint)(((GetHTarget() - node.position).costMagnitude)*heuristicScale);\n\t\t\t\t// Inlining this check and the return\n\t\t\t\t// for each case saves an extra jump.\n\t\t\t\t// This code is pretty hot\n\t\t\t\tif (hTargetNode != null) {\n\t\t\t\t\th = System.Math.Max(h, AstarPath.active.euclideanEmbedding.GetHeuristic(node.NodeIndex, hTargetNode.NodeIndex));\n\t\t\t\t}\n\t\t\t\treturn h;\n\t\t\tcase Heuristic.Manhattan:\n\t\t\t\tInt3 p2 = node.position;\n\t\t\t\th = (uint)((System.Math.Abs(hTarget.x-p2.x) + System.Math.Abs(hTarget.y-p2.y) + System.Math.Abs(hTarget.z-p2.z))*heuristicScale);\n\t\t\t\tif (hTargetNode != null) {\n\t\t\t\t\th = System.Math.Max(h, AstarPath.active.euclideanEmbedding.GetHeuristic(node.NodeIndex, hTargetNode.NodeIndex));\n\t\t\t\t}\n\t\t\t\treturn h;\n\t\t\tcase Heuristic.DiagonalManhattan:\n\t\t\t\tInt3 p = GetHTarget() - node.position;\n\t\t\t\tp.x = System.Math.Abs(p.x);\n\t\t\t\tp.y = System.Math.Abs(p.y);\n\t\t\t\tp.z = System.Math.Abs(p.z);\n\t\t\t\tint diag = System.Math.Min(p.x, p.z);\n\t\t\t\tint diag2 = System.Math.Max(p.x, p.z);\n\t\t\t\th = (uint)((((14*diag)/10) + (diag2-diag) + p.y) * heuristicScale);\n\t\t\t\tif (hTargetNode != null) {\n\t\t\t\t\th = System.Math.Max(h, AstarPath.active.euclideanEmbedding.GetHeuristic(node.NodeIndex, hTargetNode.NodeIndex));\n\t\t\t\t}\n\t\t\t\treturn h;\n\t\t\t}\n\t\t\treturn 0U;\n\t\t}\n\n\t\t/** Returns penalty for the given tag.\n\t\t * \\param tag A value between 0 (inclusive) and 32 (exclusive).\n\t\t */\n\t\tinternal uint GetTagPenalty (int tag) {\n\t\t\treturn (uint)internalTagPenalties[tag];\n\t\t}\n\n\t\tinternal Int3 GetHTarget () {\n\t\t\treturn hTarget;\n\t\t}\n\n\t\t/** Returns if the node can be traversed.\n\t\t * This per default equals to if the node is walkable and if the node's tag is included in #enabledTags */\n\t\tinternal bool CanTraverse (GraphNode node) {\n\t\t\t// Use traversal provider if set, otherwise fall back on default behaviour\n\t\t\t// This method is hot, but this branch is extremely well predicted so it\n\t\t\t// doesn't affect performance much (profiling indicates it is just above\n\t\t\t// the noise level, somewhere around 0%-0.3%)\n\t\t\tif (traversalProvider != null)\n\t\t\t\treturn traversalProvider.CanTraverse(this, node);\n\n\t\t\tunchecked { return node.Walkable && (enabledTags >> (int)node.Tag & 0x1) != 0; }\n\t\t}\n\n\t\tinternal uint GetTraversalCost (GraphNode node) {\n#if ASTAR_NO_TRAVERSAL_COST\n\t\t\treturn 0;\n#else\n\t\t\t// Use traversal provider if set, otherwise fall back on default behaviour\n\t\t\tif (traversalProvider != null)\n\t\t\t\treturn traversalProvider.GetTraversalCost(this, node);\n\n\t\t\tunchecked { return GetTagPenalty((int)node.Tag) + node.Penalty; }\n#endif\n\t\t}\n\n\t\t/** May be called by graph nodes to get a special cost for some connections.\n\t\t * Nodes may call it when PathNode.flag2 is set to true, for example mesh nodes, which have\n\t\t * a very large area can be marked on the start and end nodes, this method will be called\n\t\t * to get the actual cost for moving from the start position to its neighbours instead\n\t\t * of as would otherwise be the case, from the start node's position to its neighbours.\n\t\t * The position of a node and the actual start point on the node can vary quite a lot.\n\t\t *\n\t\t * The default behaviour of this method is to return the previous cost of the connection,\n\t\t * essentiall making no change at all.\n\t\t *\n\t\t * This method should return the same regardless of the order of a and b.\n\t\t * That is f(a,b) == f(b,a) should hold.\n\t\t *\n\t\t * \\param a Moving from this node\n\t\t * \\param b Moving to this node\n\t\t * \\param currentCost The cost of moving between the nodes. Return this value if there is no meaningful special cost to return.\n\t\t */\n\t\tinternal virtual uint GetConnectionSpecialCost (GraphNode a, GraphNode b, uint currentCost) {\n\t\t\treturn currentCost;\n\t\t}\n\n\t\t/** Returns if this path is done calculating.\n\t\t * \\returns If CompleteState is not PathCompleteState.NotCalculated.\n\t\t *\n\t\t * \\note The callback for the path might not have been called yet.\n\t\t *\n\t\t * \\since Added in 3.0.8\n\t\t *\n\t\t * \\see Seeker.IsDone\n\t\t */\n\t\tpublic bool IsDone () {\n\t\t\treturn CompleteState != PathCompleteState.NotCalculated;\n\t\t}\n\n\t\t/** Threadsafe increment of the state */\n\t\tvoid IPathInternals.AdvanceState (PathState s) {\n\t\t\tlock (stateLock) {\n\t\t\t\tPipelineState = (PathState)System.Math.Max((int)PipelineState, (int)s);\n\t\t\t}\n\t\t}\n\n\t\t/** Returns the state of the path in the pathfinding pipeline.\n\t\t * \\deprecated Use the #Pathfinding.Path.PipelineState property instead\n\t\t */\n\t\t[System.Obsolete(\"Use the 'PipelineState' property instead\")]\n\t\tpublic PathState GetState () {\n\t\t\treturn PipelineState;\n\t\t}\n\n\t\t/** Appends \\a msg to #errorLog and logs \\a msg to the console.\n\t\t * Debug.Log call is only made if AstarPath.logPathResults is not equal to None and not equal to InGame.\n\t\t * Consider calling Error() along with this call.\n\t\t */\n// Ugly Code Inc. wrote the below code :D\n// What it does is that it disables the LogError function if ASTAR_NO_LOGGING is enabled\n// since the DISABLED define will never be enabled\n// Ugly way of writing Conditional(\"!ASTAR_NO_LOGGING\")\n#if ASTAR_NO_LOGGING\n\t\t[System.Diagnostics.Conditional(\"DISABLED\")]\n#endif\n\t\tinternal void LogError (string msg) {\n#if !UNITY_EDITOR\n\t\t\t// Optimize for release builds\n\t\t\t// If no path logging is enabled\n\t\t\t// don't append to the error log string\n\t\t\t// to reduce allocations\n\t\t\tif (AstarPath.active.logPathResults != PathLog.None) {\n\t\t\t\t_errorLog += msg;\n\t\t\t}\n#endif\n\n\t\t\tif (AstarPath.active.logPathResults != PathLog.None && AstarPath.active.logPathResults != PathLog.InGame) {\n\t\t\t\tDebug.LogWarning(msg);\n\t\t\t}\n\t\t}\n\n\t\t/** Logs an error and calls Error().\n\t\t * This is called only if something is very wrong or the user is doing something he/she really should not be doing.\n\t\t */\n\t\tinternal void ForceLogError (string msg) {\n\t\t\tError();\n\t\t\t_errorLog += msg;\n\t\t\tDebug.LogError(msg);\n\t\t}\n\n\t\t/** Appends a message to the #errorLog.\n\t\t * Nothing is logged to the console.\n\t\t *\n\t\t * \\note If AstarPath.logPathResults is PathLog.None and this is a standalone player, nothing will be logged as an optimization.\n\t\t */\n\t\tinternal void Log (string msg) {\n#if !UNITY_EDITOR\n\t\t\t// Optimize for release builds\n\t\t\t// If no path logging is enabled\n\t\t\t// don't append to the error log string\n\t\t\t// to reduce allocations\n\t\t\tif (AstarPath.active.logPathResults != PathLog.None) {\n\t\t\t\t_errorLog += msg;\n\t\t\t}\n#endif\n\t\t}\n\n\t\t/** Aborts the path because of an error.\n\t\t * Sets #error to true.\n\t\t * This function is called when an error has ocurred (e.g a valid path could not be found).\n\t\t * \\see LogError\n\t\t */\n\t\tpublic void Error () {\n\t\t\tCompleteState = PathCompleteState.Error;\n\t\t}\n\n\t\t/** Does some error checking.\n\t\t * Makes sure the user isn't using old code paths and that no major errors have been done.\n\t\t *\n\t\t * \\throws An exception if any errors are found\n\t\t */\n\t\tprivate void ErrorCheck () {\n\t\t\tif (!hasBeenReset) throw new System.Exception(\"The path has never been reset. Use the static Construct call, do not use the normal constructors.\");\n\t\t\tif (((IPathInternals) this).Pooled) throw new System.Exception(\"The path is currently in a path pool. Are you sending the path for calculation twice?\");\n\t\t\tif (pathHandler == null) throw new System.Exception(\"Field pathHandler is not set. Please report this bug.\");\n\t\t\tif (PipelineState > PathState.Processing) throw new System.Exception(\"This path has already been processed. Do not request a path with the same path object twice.\");\n\t\t}\n\n\t\t/** Called when the path enters the pool.\n\t\t * This method should release e.g pooled lists and other pooled resources\n\t\t * The base version of this method releases vectorPath and path lists.\n\t\t * Reset() will be called after this function, not before.\n\t\t * \\warning Do not call this function manually.\n\t\t */\n\t\tprotected virtual void OnEnterPool () {\n\t\t\tif (vectorPath != null) Pathfinding.Util.ListPool.Release(vectorPath);\n\t\t\tif (path != null) Pathfinding.Util.ListPool.Release(path);\n\t\t\tvectorPath = null;\n\t\t\tpath = null;\n\t\t\t// Clear the callback to remove a potential memory leak\n\t\t\t// while the path is in the pool (which it could be for a long time).\n\t\t\tcallback = null;\n\t\t\timmediateCallback = null;\n\t\t\ttraversalProvider = null;\n\t\t}\n\n\t\t/** Reset all values to their default values.\n\t\t *\n\t\t * \\note All inheriting path types (e.g ConstantPath, RandomPath, etc.) which declare their own variables need to\n\t\t * override this function, resetting ALL their variables to enable pooling of paths.\n\t\t * If this is not done, trying to use that path type for pooling could result in weird behaviour.\n\t\t * The best way is to reset to default values the variables declared in the extended path type and then\n\t\t * call the base function in inheriting types with base.Reset().\n\t\t */\n\t\tprotected virtual void Reset () {\n#if ASTAR_POOL_DEBUG\n\t\t\tpathTraceInfo = \"This path was got from the pool or created from here (stacktrace):\\n\";\n\t\t\tpathTraceInfo += System.Environment.StackTrace;\n#endif\n\n\t\t\tif (System.Object.ReferenceEquals(AstarPath.active, null))\n\t\t\t\tthrow new System.NullReferenceException(\"No AstarPath object found in the scene. \" +\n\t\t\t\t\t\"Make sure there is one or do not create paths in Awake\");\n\n\t\t\thasBeenReset = true;\n\t\t\tPipelineState = (int)PathState.Created;\n\t\t\treleasedNotSilent = false;\n\n\t\t\tpathHandler = null;\n\t\t\tcallback = null;\n\t\t\timmediateCallback = null;\n\t\t\t_errorLog = \"\";\n\t\t\tCompleteState = PathCompleteState.NotCalculated;\n\n\t\t\tpath = Pathfinding.Util.ListPool.Claim();\n\t\t\tvectorPath = Pathfinding.Util.ListPool.Claim();\n\n\t\t\tcurrentR = null;\n\n\t\t\tduration = 0;\n\t\t\tsearchedNodes = 0;\n\n\t\t\tnnConstraint = PathNNConstraint.Default;\n\t\t\tnext = null;\n\n\t\t\theuristic = AstarPath.active.heuristic;\n\t\t\theuristicScale = AstarPath.active.heuristicScale;\n\n\t\t\tenabledTags = -1;\n\t\t\ttagPenalties = null;\n\n\t\t\tpathID = AstarPath.active.GetNextPathID();\n\n\t\t\thTarget = Int3.zero;\n\t\t\thTargetNode = null;\n\n\t\t\ttraversalProvider = null;\n\t\t}\n\n\t\t/** List of claims on this path with reference objects */\n\t\tprivate List claimed = new List();\n\n\t\t/** True if the path has been released with a non-silent call yet.\n\t\t *\n\t\t * \\see Release\n\t\t * \\see Claim\n\t\t */\n\t\tprivate bool releasedNotSilent;\n\n\t\t/** Claim this path (pooling).\n\t\t * A claim on a path will ensure that it is not pooled.\n\t\t * If you are using a path, you will want to claim it when you first get it and then release it when you will not\n\t\t * use it anymore. When there are no claims on the path, it will be reset and put in a pool.\n\t\t *\n\t\t * This is essentially just reference counting.\n\t\t *\n\t\t * The object passed to this method is merely used as a way to more easily detect when pooling is not done correctly.\n\t\t * It can be any object, when used from a movement script you can just pass \"this\". This class will throw an exception\n\t\t * if you try to call Claim on the same path twice with the same object (which is usually not what you want) or\n\t\t * if you try to call Release with an object that has not been used in a Claim call for that path.\n\t\t * The object passed to the Claim method needs to be the same as the one you pass to this method.\n\t\t *\n\t\t * \\see Release\n\t\t * \\see Pool\n\t\t * \\see \\ref pooling\n\t\t * \\see https://en.wikipedia.org/wiki/Reference_counting\n\t\t */\n\t\tpublic void Claim (System.Object o) {\n\t\t\tif (System.Object.ReferenceEquals(o, null)) throw new System.ArgumentNullException(\"o\");\n\n\t\t\tfor (int i = 0; i < claimed.Count; i++) {\n\t\t\t\t// Need to use ReferenceEquals because it might be called from another thread\n\t\t\t\tif (System.Object.ReferenceEquals(claimed[i], o))\n\t\t\t\t\tthrow new System.ArgumentException(\"You have already claimed the path with that object (\"+o+\"). Are you claiming the path with the same object twice?\");\n\t\t\t}\n\n\t\t\tclaimed.Add(o);\n#if ASTAR_POOL_DEBUG\n\t\t\tclaimInfo.Add(o.ToString() + \"\\n\\nClaimed from:\\n\" + System.Environment.StackTrace);\n#endif\n\t\t}\n\n\t\t/** Releases the path silently (pooling).\n\t\t * \\deprecated Use Release(o, true) instead\n\t\t */\n\t\t[System.Obsolete(\"Use Release(o, true) instead\")]\n\t\tinternal void ReleaseSilent (System.Object o) {\n\t\t\tRelease(o, true);\n\t\t}\n\n\t\t/** Releases a path claim (pooling).\n\t\t * Removes the claim of the path by the specified object.\n\t\t * When the claim count reaches zero, the path will be pooled, all variables will be cleared and the path will be put in a pool to be used again.\n\t\t * This is great for memory since less allocations are made.\n\t\t *\n\t\t * If the silent parameter is true, this method will remove the claim by the specified object\n\t\t * but the path will not be pooled if the claim count reches zero unless a Release call (not silent) has been made earlier.\n\t\t * This is used by the internal pathfinding components such as Seeker and AstarPath so that they will not cause paths to be pooled.\n\t\t * This enables users to skip the claim/release calls if they want without the path being pooled by the Seeker or AstarPath and\n\t\t * thus causing strange bugs.\n\t\t *\n\t\t * \\see Claim\n\t\t * \\see PathPool\n\t\t */\n\t\tpublic void Release (System.Object o, bool silent = false) {\n\t\t\tif (o == null) throw new System.ArgumentNullException(\"o\");\n\n\t\t\tfor (int i = 0; i < claimed.Count; i++) {\n\t\t\t\t// Need to use ReferenceEquals because it might be called from another thread\n\t\t\t\tif (System.Object.ReferenceEquals(claimed[i], o)) {\n\t\t\t\t\tclaimed.RemoveAt(i);\n#if ASTAR_POOL_DEBUG\n\t\t\t\t\tclaimInfo.RemoveAt(i);\n#endif\n\t\t\t\t\tif (!silent) {\n\t\t\t\t\t\treleasedNotSilent = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (claimed.Count == 0 && releasedNotSilent) {\n\t\t\t\t\t\tPathPool.Pool(this);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (claimed.Count == 0) {\n\t\t\t\tthrow new System.ArgumentException(\"You are releasing a path which is not claimed at all (most likely it has been pooled already). \" +\n\t\t\t\t\t\"Are you releasing the path with the same object (\"+o+\") twice?\" +\n\t\t\t\t\t\"\\nCheck out the documentation on path pooling for help.\");\n\t\t\t}\n\t\t\tthrow new System.ArgumentException(\"You are releasing a path which has not been claimed with this object (\"+o+\"). \" +\n\t\t\t\t\"Are you releasing the path with the same object twice?\\n\" +\n\t\t\t\t\"Check out the documentation on path pooling for help.\");\n\t\t}\n\n\t\t/** Traces the calculated path from the end node to the start.\n\t\t * This will build an array (#path) of the nodes this path will pass through and also set the #vectorPath array to the #path arrays positions.\n\t\t * Assumes the #vectorPath and #path are empty and not null (which will be the case for a correctly initialized path).\n\t\t */\n\t\tprotected virtual void Trace (PathNode from) {\n\t\t\t// Current node we are processing\n\t\t\tPathNode c = from;\n\t\t\tint count = 0;\n\n\t\t\twhile (c != null) {\n\t\t\t\tc = c.parent;\n\t\t\t\tcount++;\n\t\t\t\tif (count > 2048) {\n\t\t\t\t\tDebug.LogWarning(\"Infinite loop? >2048 node path. Remove this message if you really have that long paths (Path.cs, Trace method)\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Ensure capacities for lists\n\t\t\tAstarProfiler.StartProfile(\"Check List Capacities\");\n\n\t\t\tif (path.Capacity < count) path.Capacity = count;\n\t\t\tif (vectorPath.Capacity < count) vectorPath.Capacity = count;\n\n\t\t\tAstarProfiler.EndProfile();\n\n\t\t\tc = from;\n\n\t\t\tfor (int i = 0; i < count; i++) {\n\t\t\t\tpath.Add(c.node);\n\t\t\t\tc = c.parent;\n\t\t\t}\n\n\t\t\t// Reverse\n\t\t\tint half = count/2;\n\t\t\tfor (int i = 0; i < half; i++) {\n\t\t\t\tvar tmp = path[i];\n\t\t\t\tpath[i] = path[count-i-1];\n\t\t\t\tpath[count - i - 1] = tmp;\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < count; i++) {\n\t\t\t\tvectorPath.Add((Vector3)path[i].position);\n\t\t\t}\n\t\t}\n\n\t\t/** Writes text shared for all overrides of DebugString to the string builder.\n\t\t * \\see DebugString\n\t\t */\n\t\tprotected void DebugStringPrefix (PathLog logMode, System.Text.StringBuilder text) {\n\t\t\ttext.Append(error ? \"Path Failed : \" : \"Path Completed : \");\n\t\t\ttext.Append(\"Computation Time \");\n\t\t\ttext.Append(duration.ToString(logMode == PathLog.Heavy ? \"0.000 ms \" : \"0.00 ms \"));\n\n\t\t\ttext.Append(\"Searched Nodes \").Append(searchedNodes);\n\n\t\t\tif (!error) {\n\t\t\t\ttext.Append(\" Path Length \");\n\t\t\t\ttext.Append(path == null ? \"Null\" : path.Count.ToString());\n\t\t\t}\n\t\t}\n\n\t\t/** Writes text shared for all overrides of DebugString to the string builder.\n\t\t * \\see DebugString\n\t\t */\n\t\tprotected void DebugStringSuffix (PathLog logMode, System.Text.StringBuilder text) {\n\t\t\tif (error) {\n\t\t\t\ttext.Append(\"\\nError: \").Append(errorLog);\n\t\t\t}\n\n\t\t\t// Can only print this from the Unity thread\n\t\t\t// since otherwise an exception might be thrown\n\t\t\tif (logMode == PathLog.Heavy && !AstarPath.active.IsUsingMultithreading) {\n\t\t\t\ttext.Append(\"\\nCallback references \");\n\t\t\t\tif (callback != null) text.Append(callback.Target.GetType().FullName).AppendLine();\n\t\t\t\telse text.AppendLine(\"NULL\");\n\t\t\t}\n\n\t\t\ttext.Append(\"\\nPath Number \").Append(pathID).Append(\" (unique id)\");\n\t\t}\n\n\t\t/** Returns a string with information about it.\n\t\t * More information is emitted when logMode == Heavy.\n\t\t * An empty string is returned if logMode == None\n\t\t * or logMode == OnlyErrors and this path did not fail.\n\t\t */\n\t\tinternal virtual string DebugString (PathLog logMode) {\n\t\t\tif (logMode == PathLog.None || (!error && logMode == PathLog.OnlyErrors)) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\t// Get a cached string builder for this thread\n\t\t\tSystem.Text.StringBuilder text = pathHandler.DebugStringBuilder;\n\t\t\ttext.Length = 0;\n\n\t\t\tDebugStringPrefix(logMode, text);\n\t\t\tDebugStringSuffix(logMode, text);\n\n\t\t\treturn text.ToString();\n\t\t}\n\n\t\t/** Calls callback to return the calculated path. \\see #callback */\n\t\tprotected virtual void ReturnPath () {\n\t\t\tif (callback != null) {\n\t\t\t\tcallback(this);\n\t\t\t}\n\t\t}\n\n\t\t/** Prepares low level path variables for calculation.\n\t\t * Called before a path search will take place.\n\t\t * Always called before the Prepare, Initialize and CalculateStep functions\n\t\t */\n\t\tprotected void PrepareBase (PathHandler pathHandler) {\n\t\t\t//Path IDs have overflowed 65K, cleanup is needed\n\t\t\t//Since pathIDs are handed out sequentially, we can do this\n\t\t\tif (pathHandler.PathID > pathID) {\n\t\t\t\tpathHandler.ClearPathIDs();\n\t\t\t}\n\n\t\t\t//Make sure the path has a reference to the pathHandler\n\t\t\tthis.pathHandler = pathHandler;\n\t\t\t//Assign relevant path data to the pathHandler\n\t\t\tpathHandler.InitializeForPath(this);\n\n\t\t\t// Make sure that internalTagPenalties is an array which has the length 32\n\t\t\tif (internalTagPenalties == null || internalTagPenalties.Length != 32)\n\t\t\t\tinternalTagPenalties = ZeroTagPenalties;\n\n\t\t\ttry {\n\t\t\t\tErrorCheck();\n\t\t\t} catch (System.Exception e) {\n\t\t\t\tForceLogError(\"Exception in path \"+pathID+\"\\n\"+e);\n\t\t\t}\n\t\t}\n\n\t\t/** Called before the path is started.\n\t\t * Called right before Initialize\n\t\t */\n\t\tprotected abstract void Prepare ();\n\n\t\t/** Always called after the path has been calculated.\n\t\t * Guaranteed to be called before other paths have been calculated on\n\t\t * the same thread.\n\t\t * Use for cleaning up things like node tagging and similar.\n\t\t */\n\t\tprotected virtual void Cleanup () {}\n\n\t\t/** Initializes the path.\n\t\t * Sets up the open list and adds the first node to it\n\t\t */\n\t\tprotected abstract void Initialize ();\n\n\t\t/** Calculates the until it is complete or the time has progressed past \\a targetTick */\n\t\tprotected abstract void CalculateStep (long targetTick);\n\n\t\tPathHandler IPathInternals.PathHandler { get { return pathHandler; } }\n\t\tvoid IPathInternals.OnEnterPool () { OnEnterPool(); }\n\t\tvoid IPathInternals.Reset () { Reset(); }\n\t\tvoid IPathInternals.ReturnPath () { ReturnPath(); }\n\t\tvoid IPathInternals.PrepareBase (PathHandler handler) { PrepareBase(handler); }\n\t\tvoid IPathInternals.Prepare () { Prepare(); }\n\t\tvoid IPathInternals.Cleanup () { Cleanup(); }\n\t\tvoid IPathInternals.Initialize () { Initialize(); }\n\t\tvoid IPathInternals.CalculateStep (long targetTick) { CalculateStep(targetTick); }\n\t}\n\n\t/** Used for hiding internal methods of the Path class */\n\tinternal interface IPathInternals {\n\t\tPathHandler PathHandler { get; }\n\t\tbool Pooled { get; set; }\n\t\tvoid AdvanceState (PathState s);\n\t\tvoid OnEnterPool ();\n\t\tvoid Reset ();\n\t\tvoid ReturnPath ();\n\t\tvoid PrepareBase (PathHandler handler);\n\t\tvoid Prepare ();\n\t\tvoid Initialize ();\n\t\tvoid Cleanup ();\n\t\tvoid CalculateStep (long targetTick);\n\t}\n}\n"} {"text": "/*\nCopyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\nFor licensing, see LICENSE.md or http://ckeditor.com/license\n*/\nCKEDITOR.plugins.setLang( 'indent', 'af', {\n\tindent: 'Vergroot inspring',\n\toutdent: 'Verklein inspring'\n} );\n"} {"text": "/*\n * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.\n *\n * @APPLE_LICENSE_HEADER_START@\n * \n * The contents of this file constitute Original Code as defined in and\n * are subject to the Apple Public Source License Version 1.1 (the\n * \"License\"). You may not use this file except in compliance with the\n * License. Please obtain a copy of the License at\n * http://www.apple.com/publicsource and read it before using this file.\n * \n * This 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 OR NON-INFRINGEMENT. Please see the\n * License for the specific language governing rights and limitations\n * under the License.\n * \n * @APPLE_LICENSE_HEADER_END@\n */\n/*\n * HISTORY\n *\n */\n\n/*\n * IOKit user library\n */\n\n#ifndef _IOKIT_IOKITLIB_H\n#define _IOKIT_IOKITLIB_H\n\n#ifdef KERNEL\n#error This file is not for kernel use\n#endif\n\n#include \n#include \n\n#include \n#include \n\n#include \n#include \n#include \n\n#include \"IOTypes.h\"\n#include \"IOKitKeys.h\"\n\n#include \"OSMessageNotification.h\"\n\n#include \n\n__BEGIN_DECLS\n\n/*! @header IOKitLib\nIOKitLib implements non-kernel task access to common IOKit object types - IORegistryEntry, IOService, IOIterator etc. These functions are generic - families may provide API that is more specific.
\nIOKitLib represents IOKit objects outside the kernel with the types io_object_t, io_registry_entry_t, io_service_t, & io_connect_t. Function names usually begin with the type of object they are compatible with - eg. IOObjectRelease can be used with any io_object_t. Inside the kernel, the c++ class hierarchy allows the subclasses of each object type to receive the same requests from user level clients, for example in the kernel, IOService is a subclass of IORegistryEntry, which means any of the IORegistryEntryXXX functions in IOKitLib may be used with io_service_t's as well as io_registry_t's. There are functions available to introspect the class of the kernel object which any io_object_t et al. represents.\nIOKit objects returned by all functions should be released with IOObjectRelease.\n*/\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\ntypedef struct IONotificationPort * IONotificationPortRef;\n\n\n/*! @typedef IOServiceMatchingCallback\n @abstract Callback function to be notified of IOService publication.\n @param refcon The refcon passed when the notification was installed.\n @param iterator The notification iterator which now has new objects.\n*/\ntypedef void\n(*IOServiceMatchingCallback)(\n\tvoid *\t\t\trefcon,\n\tio_iterator_t\t\titerator );\n\n/*! @typedef IOServiceInterestCallback\n @abstract Callback function to be notified of changes in state of an IOService.\n @param refcon The refcon passed when the notification was installed.\n @param service The IOService whose state has changed.\n @param messageType A messageType enum, defined by IOKit/IOMessage.h or by the IOService's family.\n @param messageArgument An argument for the message, dependent on the messageType.\n*/\n\ntypedef void\n(*IOServiceInterestCallback)(\n\tvoid *\t\t\trefcon,\n\tio_service_t\t\tservice,\n\tuint32_t\t\tmessageType,\n\tvoid *\t\t\tmessageArgument );\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/*! @const kIOMasterPortDefault\n @abstract The default mach port used to initiate communication with IOKit.\n @discussion When specifying a master port to IOKit functions, the NULL argument indicates \"use the default\". This is a synonym for NULL, if you'd rather use a named constant.\n*/\n\nextern\nconst mach_port_t kIOMasterPortDefault;\n\n/*! @function IOMasterPort\n @abstract Returns the mach port used to initiate communication with IOKit.\n @discussion Functions that don't specify an existing object require the IOKit master port to be passed. This function obtains that port.\n @param bootstrapPort Pass MACH_PORT_NULL for the default.\n @param masterPort The master port is returned.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOMasterPort( mach_port_t\tbootstrapPort,\n\t mach_port_t *\tmasterPort );\n\n\n/*! @function IONotificationPortCreate\n @abstract Creates and returns a notification object for receiving IOKit notifications of new devices or state changes.\n @discussion Creates the notification object to receive notifications from IOKit of new device arrivals or state changes. The notification object can be supply a CFRunLoopSource, or mach_port_t to be used to listen for events.\n @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.\n @result A reference to the notification object. */\n\nIONotificationPortRef\nIONotificationPortCreate(\n\tmach_port_t\t\tmasterPort );\n\n/*! @function IONotificationPortDestroy\n @abstract Destroys a notification object created with IONotificationPortCreate.\n @param notify A reference to the notification object. */\n\nvoid\nIONotificationPortDestroy(\n\tIONotificationPortRef\tnotify );\n\n/*! @function IONotificationPortGetRunLoopSource\n @abstract Returns a CFRunLoopSource to be used to listen for notifications.\n @discussion A notification object may deliver notifications to a CFRunLoop client by adding the run loop source returned by this function to the run loop.\n @param notify The notification object.\n @result A CFRunLoopSourceRef for the notification object. */\n\nCFRunLoopSourceRef\nIONotificationPortGetRunLoopSource(\n\tIONotificationPortRef\tnotify );\n\n/*! @function IONotificationPortGetMachPort\n @abstract Returns a mach_port to be used to listen for notifications.\n @discussion A notification object may deliver notifications to a mach messaging client if they listen for messages on the port obtained from this function. Callbacks associated with the notifications may be delivered by calling IODispatchCalloutFromMessage with messages received \n @param notify The notification object.\n @result A mach_port for the notification object. */\n\nmach_port_t\nIONotificationPortGetMachPort(\n\tIONotificationPortRef\tnotify );\n\n/*! @function IODispatchCalloutFromMessage\n @abstract Dispatches callback notifications from a mach message.\n @discussion A notification object may deliver notifications to a mach messaging client, which should call this function to generate the callbacks associated with the notifications arriving on the port.\n @param unused Not used, set to zero.\n @param msg A pointer to the message received.\n @param reference Pass the IONotificationPortRef for the object. */\n\nvoid\nIODispatchCalloutFromMessage(\n void \t\t\t*unused,\n mach_msg_header_t\t*msg,\n void\t\t\t*reference );\n\n/*! @function IOCreateReceivePort\n @abstract Creates and returns a mach port suitable for receiving IOKit messages of the specified type.\n @discussion In the future IOKit may use specialized messages and ports\n instead of the standard ports created by mach_port_allocate(). Use this\n function instead of mach_port_allocate() to ensure compatibility with future\n revisions of IOKit.\n @param msgType Type of message to be sent to this port\n (kOSNotificationMessageID or kOSAsyncCompleteMessageID)\n @param recvPort The created port is returned.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOCreateReceivePort( uint32_t msgType, mach_port_t * recvPort );\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/*\n * IOObject\n */\n\n/*! @function IOObjectRelease\n @abstract Releases an object handle previously returned by IOKitLib.\n @discussion All objects returned by IOKitLib should be released with this function when access to them is no longer needed. Using the object after it has been released may or may not return an error, depending on how many references the task has to the same object in the kernel.\n @param object The IOKit object to release.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOObjectRelease(\n\tio_object_t\tobject );\n\n/*! @function IOObjectRetain\n @abstract Retains an object handle previously returned by IOKitLib.\n @discussion Gives the caller an additional reference to an existing object handle previously returned by IOKitLib.\n @param object The IOKit object to retain.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOObjectRetain(\n\tio_object_t\tobject );\n\n/*! @function IOObjectGetClass\n @abstract Return the class name of an IOKit object.\n @discussion This function uses the OSMetaClass system in the kernel to derive the name of the class the object is an instance of.\n @param object The IOKit object.\n @param className Caller allocated buffer to receive the name string.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOObjectGetClass(\n\tio_object_t\tobject,\n\tio_name_t\tclassName );\n\t\n/*! @function CFStringRef IOObjectCopyClass\n @abstract Return the class name of an IOKit object.\n\t@discussion This function does the same thing as IOObjectGetClass, but returns the result as a CFStringRef.\n\t@param object The IOKit object.\n\t@result The resulting CFStringRef. This should be released by the caller. If a valid object is not passed in, then NULL is returned.*/\n\t\nCFStringRef \nIOObjectCopyClass(io_object_t object)\nAVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;\n\n/*! @function CFStringRef IOObjectCopySuperclassForClass\n @abstract Return the superclass name of the given class.\n @discussion This function uses the OSMetaClass system in the kernel to derive the name of the superclass of the class.\n\t@param classname The name of the class as a CFString.\n\t@result The resulting CFStringRef. This should be released by the caller. If there is no superclass, or a valid class name is not passed in, then NULL is returned.*/\n\nCFStringRef \nIOObjectCopySuperclassForClass(CFStringRef classname)\nAVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;\n\n/*! @function CFStringRef IOObjectCopyBundleIdentifierForClass\n @abstract Return the bundle identifier of the given class.\n\t@discussion This function uses the OSMetaClass system in the kernel to derive the name of the kmod, which is the same as the bundle identifier.\n\t@param classname The name of the class as a CFString.\n\t@result The resulting CFStringRef. This should be released by the caller. If a valid class name is not passed in, then NULL is returned.*/\n\nCFStringRef \nIOObjectCopyBundleIdentifierForClass(CFStringRef classname)\nAVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;\n\n/*! @function IOObjectConformsTo\n @abstract Performs an OSDynamicCast operation on an IOKit object.\n @discussion This function uses the OSMetaClass system in the kernel to determine if the object will dynamic cast to a class, specified as a C-string. In other words, if the object is of that class or a subclass.\n @param object An IOKit object.\n @param className The name of the class, as a C-string.\n @result If the object handle is valid, and represents an object in the kernel that dynamic casts to the class true is returned, otherwise false. */\n\nboolean_t\nIOObjectConformsTo(\n\tio_object_t\tobject,\n\tconst io_name_t\tclassName );\n\n/*! @function IOObjectIsEqualTo\n @abstract Checks two object handles to see if they represent the same kernel object.\n @discussion If two object handles are returned by IOKitLib functions, this function will compare them to see if they represent the same kernel object.\n @param object An IOKit object.\n @param anObject Another IOKit object.\n @result If both object handles are valid, and represent the same object in the kernel true is returned, otherwise false. */\n\nboolean_t\nIOObjectIsEqualTo(\n\tio_object_t\tobject,\n\tio_object_t\tanObject );\n\n/*! @function IOObjectGetRetainCount\n @abstract Returns kernel retain count of an IOKit object.\n @discussion This function may be used in diagnostics to determine the current retain count of the kernel object.\n @param object An IOKit object.\n @result If the object handle is valid, the kernel objects retain count is returned, otherwise zero is returned. */\n\nuint32_t\nIOObjectGetRetainCount(\n\tio_object_t\tobject );\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/*\n * IOIterator, subclass of IOObject\n */\n\n/*! @function IOIteratorNext\n @abstract Returns the next object in an iteration.\n @discussion This function returns the next object in an iteration, or zero if no more remain or the iterator is invalid.\n @param iterator An IOKit iterator handle.\n @result If the iterator handle is valid, the next element in the iteration is returned, otherwise zero is returned. The element should be released by the caller when it is finished. */\n\nio_object_t\nIOIteratorNext(\n\tio_iterator_t\titerator );\n\n/*! @function IOIteratorReset\n @abstract Resets an iteration back to the beginning.\n @discussion If an iterator is invalid, or if the caller wants to start over, IOIteratorReset will set the iteration back to the beginning.\n @param iterator An IOKit iterator handle. */\n\nvoid\nIOIteratorReset(\n\tio_iterator_t\titerator );\n\n/*! @function IOIteratorIsValid\n @abstract Checks an iterator is still valid.\n @discussion Some iterators will be made invalid if changes are made to the structure they are iterating over. This function checks the iterator is still valid and should be called when IOIteratorNext returns zero. An invalid iterator can be reset and the iteration restarted.\n @param iterator An IOKit iterator handle.\n @result True if the iterator handle is valid, otherwise false is returned. */\n\nboolean_t\nIOIteratorIsValid(\n\tio_iterator_t\titerator );\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/*\n * IOService, subclass of IORegistryEntry\n */\n\n/*!\n @function IOServiceGetMatchingService\n @abstract Look up a registered IOService object that matches a matching dictionary.\n @discussion This is the preferred method of finding IOService objects currently registered by IOKit (that is, objects that have had their registerService() methods invoked). To find IOService objects that aren't yet registered, use an iterator as created by IORegistryEntryCreateIterator(). IOServiceAddMatchingNotification can also supply this information and install a notification of new IOServices. The matching information used in the matching dictionary may vary depending on the class of service being looked up.\n @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.\n @param matching A CF dictionary containing matching information, of which one reference is always consumed by this function (Note prior to the Tiger release there was a small chance that the dictionary might not be released if there was an error attempting to serialize the dictionary). IOKitLib can construct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOServiceNameMatching, IOBSDNameMatching, IOOpenFirmwarePathMatching.\n @result The first service matched is returned on success. The service must be released by the caller.\n */\n\nio_service_t\nIOServiceGetMatchingService(\n\tmach_port_t\tmasterPort,\n\tCFDictionaryRef\tmatching );\n\n/*! @function IOServiceGetMatchingServices\n @abstract Look up registered IOService objects that match a matching dictionary.\n @discussion This is the preferred method of finding IOService objects currently registered by IOKit (that is, objects that have had their registerService() methods invoked). To find IOService objects that aren't yet registered, use an iterator as created by IORegistryEntryCreateIterator(). IOServiceAddMatchingNotification can also supply this information and install a notification of new IOServices. The matching information used in the matching dictionary may vary depending on the class of service being looked up.\n @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.\n @param matching A CF dictionary containing matching information, of which one reference is always consumed by this function (Note prior to the Tiger release there was a small chance that the dictionary might not be released if there was an error attempting to serialize the dictionary). IOKitLib can construct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOServiceNameMatching, IOBSDNameMatching, IOOpenFirmwarePathMatching.\n @param existing An iterator handle is returned on success, and should be released by the caller when the iteration is finished.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOServiceGetMatchingServices(\n\tmach_port_t\tmasterPort,\n\tCFDictionaryRef\tmatching,\n\tio_iterator_t * existing );\n\n\nkern_return_t\nIOServiceAddNotification(\n\tmach_port_t\tmasterPort,\n\tconst io_name_t\tnotificationType,\n\tCFDictionaryRef\tmatching,\n\tmach_port_t\twakePort,\n\tuintptr_t\treference,\n\tio_iterator_t *\tnotification ) DEPRECATED_ATTRIBUTE;\n\n/*! @function IOServiceAddMatchingNotification\n @abstract Look up registered IOService objects that match a matching dictionary, and install a notification request of new IOServices that match.\n @discussion This is the preferred method of finding IOService objects that may arrive at any time. The type of notification specifies the state change the caller is interested in, on IOService's that match the match dictionary. Notification types are identified by name, and are defined in IOKitKeys.h. The matching information used in the matching dictionary may vary depending on the class of service being looked up.\n @param notifyPort A IONotificationPortRef object that controls how messages will be sent when the armed notification is fired. When the notification is delivered, the io_iterator_t representing the notification should be iterated through to pick up all outstanding objects. When the iteration is finished the notification is rearmed. See IONotificationPortCreate.\n @param notificationType A notification type from IOKitKeys.h\n
\tkIOPublishNotification Delivered when an IOService is registered.\n
\tkIOFirstPublishNotification Delivered when an IOService is registered, but only once per IOService instance. Some IOService's may be reregistered when their state is changed.\n
\tkIOMatchedNotification Delivered when an IOService has had all matching drivers in the kernel probed and started.\n
\tkIOFirstMatchNotification Delivered when an IOService has had all matching drivers in the kernel probed and started, but only once per IOService instance. Some IOService's may be reregistered when their state is changed.\n
\tkIOTerminatedNotification Delivered after an IOService has been terminated.\n @param matching A CF dictionary containing matching information, of which one reference is always consumed by this function (Note prior to the Tiger release there was a small chance that the dictionary might not be released if there was an error attempting to serialize the dictionary). IOKitLib can construct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOServiceNameMatching, IOBSDNameMatching, IOOpenFirmwarePathMatching.\n @param callback A callback function called when the notification fires.\n @param refCon A reference constant for the callbacks use.\n @param notification An iterator handle is returned on success, and should be released by the caller when the notification is to be destroyed. The notification is armed when the iterator is emptied by calls to IOIteratorNext - when no more objects are returned, the notification is armed. Note the notification is not armed when first created.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOServiceAddMatchingNotification(\n\tIONotificationPortRef\tnotifyPort,\n\tconst io_name_t\t\tnotificationType,\n\tCFDictionaryRef\t\tmatching,\n IOServiceMatchingCallback callback,\n void *\t\t\trefCon,\n\tio_iterator_t * \tnotification );\n\n/*! @function IOServiceAddInterestNotification\n @abstract Register for notification of state changes in an IOService.\n @discussion IOService objects deliver notifications of their state changes to their clients via the IOService::message API, and to other interested parties including callers of this function. Message type s are defined IOKit/IOMessage.h.\n @param notifyPort A IONotificationPortRef object that controls how messages will be sent when the notification is fired. See IONotificationPortCreate.\n @param interestType A notification type from IOKitKeys.h\n
\tkIOGeneralInterest General state changes delivered via the IOService::message API.\n
\tkIOBusyInterest Delivered when the IOService changes its busy state to or from zero. The message argument contains the new busy state causing the notification.\n @param callback A callback function called when the notification fires, with messageType and messageArgument for the state change.\n @param refCon A reference constant for the callbacks use.\n @param notification An object handle is returned on success, and should be released by the caller when the notification is to be destroyed.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOServiceAddInterestNotification(\n\tIONotificationPortRef\tnotifyPort,\n io_service_t\t\tservice,\n\tconst io_name_t \tinterestType,\n IOServiceInterestCallback callback,\n void *\t\t\trefCon,\n io_object_t *\t\tnotification );\n\n/*! @function IOServiceMatchPropertyTable\n @abstract Match an IOService objects with matching dictionary.\n @discussion This function calls the matching method of an IOService object and returns the boolean result.\n @param service The IOService object to match.\n @param matching A CF dictionary containing matching information. IOKitLib can construct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOServiceNameMatching, IOBSDNameMatching, IOOpenFirmwarePathMatching.\n @param matches The boolean result is returned.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOServiceMatchPropertyTable(\n io_service_t\tservice,\n CFDictionaryRef matching,\n boolean_t *\tmatches );\n\n/*! @function IOServiceGetBusyState\n @abstract Returns the busyState of an IOService.\n @discussion Many activities in IOService are asynchronous. When registration, matching, or termination is in progress on an IOService, its busyState is increased by one. Change in busyState to or from zero also changes the IOService's provider's busyState by one, which means that an IOService is marked busy when any of the above activities is ocurring on it or any of its clients.\n @param service The IOService whose busyState to return.\n @param busyState The busyState count is returned.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOServiceGetBusyState(\n\tio_service_t service,\n\tuint32_t *\tbusyState );\n\n/*! @function IOServiceWaitQuiet\n @abstract Wait for an IOService's busyState to be zero.\n @discussion Blocks the caller until an IOService is non busy, see IOServiceGetBusyState.\n @param service The IOService wait on.\n @param waitTime Specifies a maximum time to wait.\n @result Returns an error code if mach synchronization primitives fail, kIOReturnTimeout, or kIOReturnSuccess. */\n\nkern_return_t\nIOServiceWaitQuiet(\n\tio_service_t service,\n\tmach_timespec_t * waitTime );\n\n/*! @function IOKitGetBusyState\n @abstract Returns the busyState of all IOServices.\n @discussion Many activities in IOService are asynchronous. When registration, matching, or termination is in progress on an IOService, its busyState is increased by one. Change in busyState to or from zero also changes the IOService's provider's busyState by one, which means that an IOService is marked busy when any of the above activities is ocurring on it or any of its clients. IOKitGetBusyState returns the busy state of the root of the service plane which reflects the busy state of all IOServices.\n @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.\n @param busyState The busyState count is returned.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOKitGetBusyState(\n\tmach_port_t\tmasterPort,\n\tuint32_t *\tbusyState );\n\n/*! @function IOKitWaitQuiet\n @abstract Wait for a all IOServices' busyState to be zero.\n @discussion Blocks the caller until all IOServices are non busy, see IOKitGetBusyState.\n @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.\n @param waitTime Specifies a maximum time to wait.\n @result Returns an error code if mach synchronization primitives fail, kIOReturnTimeout, or kIOReturnSuccess. */\n\nkern_return_t\nIOKitWaitQuiet(\n\tmach_port_t\t masterPort,\n\tmach_timespec_t * waitTime );\n\n/*! @function IOServiceOpen\n @abstract A request to create a connection to an IOService.\n @discussion A non kernel client may request a connection be opened via the IOServiceOpen() library function, which will call IOService::newUserClient in the kernel. The rules & capabilities of user level clients are family dependent, the default IOService implementation returns kIOReturnUnsupported.\n @param service The IOService object to open a connection to, usually obtained via the IOServiceGetMatchingServices or IOServiceAddNotification APIs.\n @param owningTask The mach task requesting the connection.\n @param type A constant specifying the type of connection to be created, interpreted only by the IOService's family.\n @param connect An io_connect_t handle is returned on success, to be used with the IOConnectXXX APIs. It should be destroyed with IOServiceClose().\n @result A return code generated by IOService::newUserClient. */\n\nkern_return_t\nIOServiceOpen(\n\tio_service_t service,\n\ttask_port_t\towningTask,\n\tuint32_t\ttype,\n\tio_connect_t *\tconnect );\n\n/*! @function IOServiceRequestProbe\n @abstract A request to rescan a bus for device changes.\n @discussion A non kernel client may request a bus or controller rescan for added or removed devices, if the bus family does automatically notice such changes. For example, SCSI bus controllers do not notice device changes. The implementation of this routine is family dependent, and the default IOService implementation returns kIOReturnUnsupported.\n @param service The IOService object to request a rescan, usually obtained via the IOServiceGetMatchingServices or IOServiceAddNotification APIs.\n @param options An options mask, interpreted only by the IOService's family.\n @result A return code generated by IOService::requestProbe. */\n\nkern_return_t\nIOServiceRequestProbe(\n\tio_service_t service,\n\tuint32_t\toptions );\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/*\n * IOService connection\n */\n\n/*! @function IOServiceClose\n @abstract Close a connection to an IOService and destroy the connect handle.\n @discussion A connection created with the IOServiceOpen should be closed when the connection is no longer to be used with IOServiceClose.\n @param connect The connect handle created by IOServiceOpen. It will be destroyed by this function, and should not be released with IOObjectRelease.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOServiceClose(\n\tio_connect_t\tconnect );\n\n/*! @function IOConnectAddRef\n @abstract Adds a reference to the connect handle.\n @discussion Adds a reference to the connect handle.\n @param connect The connect handle created by IOServiceOpen.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOConnectAddRef(\n\tio_connect_t\tconnect );\n\n/*! @function IOConnectRelease\n @abstract Remove a reference to the connect handle.\n @discussion Removes a reference to the connect handle. If the last reference is removed an implicit IOServiceClose is performed.\n @param connect The connect handle created by IOServiceOpen.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOConnectRelease(\n\tio_connect_t\tconnect );\n\n/*! @function IOConnectGetService\n @abstract Returns the IOService a connect handle was opened on.\n @discussion Finds the service object a connection was opened on.\n @param connect The connect handle created by IOServiceOpen.\n @param service On succes, the service handle the connection was opened on, which should be released with IOObjectRelease.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOConnectGetService(\n\tio_connect_t\tconnect,\n\tio_service_t *\tservice );\n\n/*! @function IOConnectSetNotificationPort\n @abstract Set a port to receive family specific notifications.\n @discussion This is a generic method to pass a mach port send right to be be used by family specific notifications. \n @param connect The connect handle created by IOServiceOpen.\n @param type The type of notification requested, not interpreted by IOKit and family defined.\n @param port The port to which to send notifications.\n @param reference Some families may support passing a reference parameter for the callers use with the notification.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOConnectSetNotificationPort(\n\tio_connect_t\tconnect,\n\tuint32_t\ttype,\n\tmach_port_t\tport,\n\tuintptr_t\treference );\n\n/*! @function IOConnectMapMemory\n @abstract Map hardware or shared memory into the caller's task.\n @discussion This is a generic method to create a mapping in the callers task. The family will interpret the type parameter to determine what sort of mapping is being requested. Cache modes and placed mappings may be requested by the caller.\n @param connect The connect handle created by IOServiceOpen.\n @param memoryType What is being requested to be mapped, not interpreted by IOKit and family defined. The family may support physical hardware or shared memory mappings.\n @param intoTask The task port for the task in which to create the mapping. This may be different to the task which the opened the connection.\n @param atAddress An in/out parameter - if the kIOMapAnywhere option is not set, the caller should pass the address where it requests the mapping be created, otherwise nothing need to set on input. The address of the mapping created is passed back on sucess.\n @param ofSize The size of the mapping created is passed back on success.\n @result A kern_return_t error code. */\n\n#if !__LP64__\nkern_return_t\nIOConnectMapMemory(\n\tio_connect_t\tconnect,\n\tuint32_t\tmemoryType,\n\ttask_port_t\tintoTask,\n\tvm_address_t\t*atAddress,\n\tvm_size_t\t*ofSize,\n\tIOOptionBits\t options );\n\nkern_return_t IOConnectMapMemory64\n#else\nkern_return_t IOConnectMapMemory\n#endif\n\t(io_connect_t\t\tconnect,\n\t uint32_t\t\tmemoryType,\n\t task_port_t\t\tintoTask,\n\t mach_vm_address_t\t*atAddress,\n\t mach_vm_size_t\t\t*ofSize,\n\t IOOptionBits\t\t options );\n\n/*! @function IOConnectUnmapMemory\n @abstract Remove a mapping made with IOConnectMapMemory.\n @discussion This is a generic method to remove a mapping in the callers task.\n @param connect The connect handle created by IOServiceOpen.\n @param memoryType The memory type originally requested in IOConnectMapMemory.\n @param intoTask The task port for the task in which to remove the mapping. This may be different to the task which the opened the connection.\n @param atAddress The address of the mapping to be removed.\n @result A kern_return_t error code. */\n\n#if !__LP64__\nkern_return_t\nIOConnectUnmapMemory(\n\tio_connect_t\tconnect,\n\tuint32_t\tmemoryType,\n\ttask_port_t\tfromTask,\n\tvm_address_t\tatAddress );\n\nkern_return_t IOConnectUnmapMemory64\n#else\nkern_return_t IOConnectUnmapMemory\n#endif\n\t(io_connect_t\t\tconnect,\n\t uint32_t\t\tmemoryType,\n\t task_port_t\t\tfromTask,\n\t mach_vm_address_t\tatAddress );\n\n/*! @function IOConnectSetCFProperties\n @abstract Set CF container based properties on a connection.\n @discussion This is a generic method to pass a CF container of properties to the connection. The properties are interpreted by the family and commonly represent configuration settings, but may be interpreted as anything.\n @param connect The connect handle created by IOServiceOpen.\n @param properties A CF container - commonly a CFDictionary but this is not enforced. The container should consist of objects which are understood by IOKit - these are currently : CFDictionary, CFArray, CFSet, CFString, CFData, CFNumber, CFBoolean, and are passed in the kernel as the corresponding OSDictionary etc. objects.\n @result A kern_return_t error code returned by the family. */\n\nkern_return_t\nIOConnectSetCFProperties(\n\tio_connect_t\tconnect,\n\tCFTypeRef\tproperties );\n\n/*! @function IOConnectSetCFProperty\n @abstract Set a CF container based property on a connection.\n @discussion This is a generic method to pass a CF property to the connection. The property is interpreted by the family and commonly represent configuration settings, but may be interpreted as anything.\n @param connect The connect handle created by IOServiceOpen.\n @param propertyName The name of the property as a CFString.\n @param property A CF container - should consist of objects which are understood by IOKit - these are currently : CFDictionary, CFArray, CFSet, CFString, CFData, CFNumber, CFBoolean, and are passed in the kernel as the corresponding OSDictionary etc. objects.\n @result A kern_return_t error code returned by the object. */\n\nkern_return_t\nIOConnectSetCFProperty(\n\tio_connect_t\tconnect,\n CFStringRef\tpropertyName,\n\tCFTypeRef\tproperty );\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n// Combined LP64 & ILP32 Extended IOUserClient::externalMethod\n\nkern_return_t\nIOConnectCallMethod(\n\tmach_port_t\t connection,\t\t// In\n\tuint32_t\t selector,\t\t// In\n\tconst uint64_t\t*input,\t\t\t// In\n\tuint32_t\t inputCnt,\t\t// In\n\tconst void *inputStruct,\t\t// In\n\tsize_t\t\t inputStructCnt,\t// In\n\tuint64_t\t*output,\t\t// Out\n\tuint32_t\t*outputCnt,\t\t// In/Out\n\tvoid\t\t*outputStruct,\t\t// Out\n\tsize_t\t\t*outputStructCnt)\t// In/Out\nAVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;\n\nkern_return_t\nIOConnectCallAsyncMethod(\n\tmach_port_t\t connection,\t\t// In\n\tuint32_t\t selector,\t\t// In\n\tmach_port_t\t wake_port,\t\t// In\n\tuint64_t\t*reference,\t\t// In\n\tuint32_t\t referenceCnt,\t\t// In\n\tconst uint64_t\t*input,\t\t\t// In\n\tuint32_t\t inputCnt,\t\t// In\n\tconst void\t*inputStruct,\t\t// In\n\tsize_t\t\t inputStructCnt,\t// In\n\tuint64_t\t*output,\t\t// Out\n\tuint32_t\t*outputCnt,\t\t// In/Out\n\tvoid\t\t*outputStruct,\t\t// Out\n\tsize_t\t\t*outputStructCnt)\t// In/Out\nAVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;\n\nkern_return_t\nIOConnectCallStructMethod(\n\tmach_port_t\t connection,\t\t// In\n\tuint32_t\t selector,\t\t// In\n\tconst void\t*inputStruct,\t\t// In\n\tsize_t\t\t inputStructCnt,\t// In\n\tvoid\t\t*outputStruct,\t\t// Out\n\tsize_t\t\t*outputStructCnt)\t// In/Out\nAVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;\n\nkern_return_t\nIOConnectCallAsyncStructMethod(\n\tmach_port_t\t connection,\t\t// In\n\tuint32_t\t selector,\t\t// In\n\tmach_port_t\t wake_port,\t\t// In\n\tuint64_t\t*reference,\t\t// In\n\tuint32_t\t referenceCnt,\t\t// In\n\tconst void\t*inputStruct,\t\t// In\n\tsize_t\t\t inputStructCnt,\t// In\n\tvoid\t\t*outputStruct,\t\t// Out\n\tsize_t\t\t*outputStructCnt)\t// In/Out\nAVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;\n\nkern_return_t\nIOConnectCallScalarMethod(\n\tmach_port_t\t connection,\t\t// In\n\tuint32_t\t selector,\t\t// In\n\tconst uint64_t\t*input,\t\t\t// In\n\tuint32_t\t inputCnt,\t\t// In\n\tuint64_t\t*output,\t\t// Out\n\tuint32_t\t*outputCnt)\t\t// In/Out\nAVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;\n\nkern_return_t\nIOConnectCallAsyncScalarMethod(\n\tmach_port_t\t connection,\t\t// In\n\tuint32_t\t selector,\t\t// In\n\tmach_port_t\t wake_port,\t\t// In\n\tuint64_t\t*reference,\t\t// In\n\tuint32_t\t referenceCnt,\t\t// In\n\tconst uint64_t\t*input,\t\t\t// In\n\tuint32_t\t inputCnt,\t\t// In\n\tuint64_t\t*output,\t\t// Out\n\tuint32_t\t*outputCnt)\t\t// In/Out\nAVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\nkern_return_t\nIOConnectTrap0(io_connect_t\tconnect,\n\t uint32_t\t\tindex );\n\nkern_return_t\nIOConnectTrap1(io_connect_t\tconnect,\n\t uint32_t\t\tindex,\n\t uintptr_t\tp1 );\n\nkern_return_t\nIOConnectTrap2(io_connect_t\tconnect,\n\t uint32_t\t\tindex,\n\t uintptr_t\tp1,\n\t uintptr_t\tp2);\n\nkern_return_t\nIOConnectTrap3(io_connect_t\tconnect,\n\t uint32_t\t\tindex,\n\t uintptr_t\tp1,\n\t uintptr_t\tp2,\n\t uintptr_t\tp3);\n\nkern_return_t\nIOConnectTrap4(io_connect_t\tconnect,\n\t uint32_t\t\tindex,\n\t uintptr_t\tp1,\n\t uintptr_t\tp2,\n\t uintptr_t\tp3,\n\t uintptr_t\tp4);\n\nkern_return_t\nIOConnectTrap5(io_connect_t\tconnect,\n\t uint32_t\t\tindex,\n\t uintptr_t\tp1,\n\t uintptr_t\tp2,\n\t uintptr_t\tp3,\n\t uintptr_t\tp4,\n\t uintptr_t\tp5);\n\nkern_return_t\nIOConnectTrap6(io_connect_t\tconnect,\n\t uint32_t\t\tindex,\n\t uintptr_t\tp1,\n\t uintptr_t\tp2,\n\t uintptr_t\tp3,\n\t uintptr_t\tp4,\n\t uintptr_t\tp5,\n\t uintptr_t\tp6);\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/*! @function IOConnectAddClient\n @abstract Inform a connection of a second connection.\n @discussion This is a generic method to inform a family connection of a second connection, and is rarely used.\n @param connect The connect handle created by IOServiceOpen.\n @param client Another connect handle created by IOServiceOpen.\n @result A kern_return_t error code returned by the family. */\n\nkern_return_t\nIOConnectAddClient(\n\tio_connect_t\tconnect,\n\tio_connect_t\tclient );\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/*\n * IORegistry accessors\n */\n\n/*! @function IORegistryGetRootEntry\n @abstract Return a handle to the registry root.\n @discussion This method provides an accessor to the root of the registry for the machine. The root may be passed to a registry iterator when iterating a plane, and contains properties that describe the available planes, and diagnostic information for IOKit.\n @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.\n @result A handle to the IORegistryEntry root instance, to be released with IOObjectRelease by the caller, or MACH_PORT_NULL on failure. */\n\nio_registry_entry_t\nIORegistryGetRootEntry(\n\tmach_port_t\tmasterPort );\n\n/*! @function IORegistryEntryFromPath\n @abstract Looks up a registry entry by path.\n @discussion This function parses paths to lookup registry entries. The path should begin with ':' If there are characters remaining unparsed after an entry has been looked up, this is considered an invalid lookup. Paths are further documented in IORegistryEntry.h\n @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.\n @param path A C-string path.\n @result A handle to the IORegistryEntry witch was found with the path, to be released with IOObjectRelease by the caller, or MACH_PORT_NULL on failure. */\n\nio_registry_entry_t\nIORegistryEntryFromPath(\n\tmach_port_t\t\tmasterPort,\n\tconst io_string_t\tpath );\n\n// options for IORegistryCreateIterator(), IORegistryEntryCreateIterator, IORegistryEntrySearchCFProperty()\nenum {\n kIORegistryIterateRecursively\t= 0x00000001,\n kIORegistryIterateParents\t\t= 0x00000002\n};\n\n/*! @function IORegistryCreateIterator\n @abstract Create an iterator rooted at the registry root.\n @discussion This method creates an IORegistryIterator in the kernel that is set up with options to iterate children of the registry root entry, and to recurse automatically into entries as they are returned, or only when instructed with calls to IORegistryIteratorEnterEntry. The iterator object keeps track of entries that have been recursed into previously to avoid loops.\n @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.\n @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.\n @param options kIORegistryIterateRecursively may be set to recurse automatically into each entry as it is returned from IOIteratorNext calls on the registry iterator. \n @param iterator A created iterator handle, to be released by the caller when it has finished with it.\n @result A kern_return_t error code. */\n\nkern_return_t\nIORegistryCreateIterator(\n\tmach_port_t\tmasterPort,\n\tconst io_name_t\tplane,\n\tIOOptionBits\toptions,\n\tio_iterator_t * iterator );\n\n/*! @function IORegistryEntryCreateIterator\n @abstract Create an iterator rooted at a given registry entry.\n @discussion This method creates an IORegistryIterator in the kernel that is set up with options to iterate children or parents of a root entry, and to recurse automatically into entries as they are returned, or only when instructed with calls to IORegistryIteratorEnterEntry. The iterator object keeps track of entries that have been recursed into previously to avoid loops.\n @param entry The root entry to begin the iteration at.\n @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.\n @param options kIORegistryIterateRecursively may be set to recurse automatically into each entry as it is returned from IOIteratorNext calls on the registry iterator. kIORegistryIterateParents may be set to iterate the parents of each entry, by default the children are iterated.\n @param iterator A created iterator handle, to be released by the caller when it has finished with it.\n @result A kern_return_t error code. */\n\nkern_return_t\nIORegistryEntryCreateIterator(\n\tio_registry_entry_t\tentry,\n\tconst io_name_t\t\tplane,\n\tIOOptionBits\t\toptions,\n\tio_iterator_t \t * iterator );\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/*\n * IORegistryIterator, subclass of IOIterator\n */\n\n/*! @function IORegistryIteratorEnterEntry\n @abstract Recurse into the current entry in the registry iteration.\n @discussion This method makes the current entry, ie. the last entry returned by IOIteratorNext, the root in a new level of recursion.\n @result A kern_return_t error code. */\n\nkern_return_t\nIORegistryIteratorEnterEntry(\n\tio_iterator_t\titerator );\n\n/*! @function IORegistryIteratorExitEntry\n @abstract Exits a level of recursion, restoring the current entry.\n @discussion This method undoes an IORegistryIteratorEnterEntry, restoring the current entry. If there are no more levels of recursion to exit false is returned, otherwise true is returned.\n @result kIOReturnSuccess if a level of recursion was undone, kIOReturnNoDevice if no recursive levels are left in the iteration. */\n\nkern_return_t\nIORegistryIteratorExitEntry(\n\tio_iterator_t\titerator );\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/*\n * IORegistryEntry, subclass of IOObject\n */\n\n/*! @function IORegistryEntryGetName\n @abstract Returns a C-string name assigned to a registry entry.\n @discussion Registry entries can be named in a particular plane, or globally. This function returns the entry's global name. The global name defaults to the entry's meta class name if it has not been named.\n @param entry The registry entry handle whose name to look up.\n @param name The caller's buffer to receive the name.\n @result A kern_return_t error code. */\n\nkern_return_t\nIORegistryEntryGetName(\n\tio_registry_entry_t\tentry,\n\tio_name_t \t name );\n\n/*! @function IORegistryEntryGetNameInPlane\n @abstract Returns a C-string name assigned to a registry entry, in a specified plane.\n @discussion Registry entries can be named in a particular plane, or globally. This function returns the entry's name in the specified plane or global name if it has not been named in that plane. The global name defaults to the entry's meta class name if it has not been named.\n @param entry The registry entry handle whose name to look up.\n @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.\n @param name The caller's buffer to receive the name.\n @result A kern_return_t error code. */\n\nkern_return_t\nIORegistryEntryGetNameInPlane(\n\tio_registry_entry_t\tentry,\n\tconst io_name_t \tplane,\n\tio_name_t \t name );\n\n/*! @function IORegistryEntryGetLocationInPlane\n @abstract Returns a C-string location assigned to a registry entry, in a specified plane.\n @discussion Registry entries can given a location string in a particular plane, or globally. If the entry has had a location set in the specified plane that location string will be returned, otherwise the global location string is returned. If no global location string has been set, an error is returned.\n @param entry The registry entry handle whose name to look up.\n @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.\n @param location The caller's buffer to receive the location string.\n @result A kern_return_t error code. */\n\nkern_return_t\nIORegistryEntryGetLocationInPlane(\n\tio_registry_entry_t\tentry,\n\tconst io_name_t \tplane,\n\tio_name_t \t location );\n\n/*! @function IORegistryEntryGetPath\n @abstract Create a path for a registry entry.\n @discussion The path for a registry entry is copied to the caller's buffer. The path describes the entry's attachment in a particular plane, which must be specified. The path begins with the plane name followed by a colon, and then followed by '/' separated path components for each of the entries between the root and the registry entry. An alias may also exist for the entry, and will be returned if available.\n @param entry The registry entry handle whose path to look up.\n @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.\n @param path A char buffer allocated by the caller.\n @result IORegistryEntryGetPath will fail if the entry is not attached in the plane, or if the buffer is not large enough to contain the path. */\n\nkern_return_t\nIORegistryEntryGetPath(\n\tio_registry_entry_t\tentry,\n\tconst io_name_t plane,\n\tio_string_t\t\tpath );\n\n/*! @function IORegistryEntryCreateCFProperties\n @abstract Create a CF dictionary representation of a registry entry's property table.\n @discussion This function creates an instantaneous snapshot of a registry entry's property table, creating a CFDictionary analogue in the caller's task. Not every object available in the kernel is represented as a CF container; currently OSDictionary, OSArray, OSSet, OSSymbol, OSString, OSData, OSNumber, OSBoolean are created as their CF counterparts. \n @param entry The registry entry handle whose property table to copy.\n @param properties A CFDictionary is created and returned the caller on success. The caller should release with CFRelease.\n @param allocator The CF allocator to use when creating the CF containers.\n @param options No options are currently defined.\n @result A kern_return_t error code. */\n\nkern_return_t\nIORegistryEntryCreateCFProperties(\n\tio_registry_entry_t\tentry,\n\tCFMutableDictionaryRef * properties,\n CFAllocatorRef\t\tallocator,\n\tIOOptionBits\t\toptions );\n\n/*! @function IORegistryEntryCreateCFProperty\n @abstract Create a CF representation of a registry entry's property.\n @discussion This function creates an instantaneous snapshot of a registry entry property, creating a CF container analogue in the caller's task. Not every object available in the kernel is represented as a CF container; currently OSDictionary, OSArray, OSSet, OSSymbol, OSString, OSData, OSNumber, OSBoolean are created as their CF counterparts. \n @param entry The registry entry handle whose property to copy.\n @param key A CFString specifying the property name.\n @param allocator The CF allocator to use when creating the CF container.\n @param options No options are currently defined.\n @result A CF container is created and returned the caller on success. The caller should release with CFRelease. */\n\nCFTypeRef\nIORegistryEntryCreateCFProperty(\n\tio_registry_entry_t\tentry,\n\tCFStringRef\t\tkey,\n CFAllocatorRef\t\tallocator,\n\tIOOptionBits\t\toptions );\n\n/*! @function IORegistryEntrySearchCFProperty\n @abstract Create a CF representation of a registry entry's property.\n @discussion This function creates an instantaneous snapshot of a registry entry property, creating a CF container analogue in the caller's task. Not every object available in the kernel is represented as a CF container; currently OSDictionary, OSArray, OSSet, OSSymbol, OSString, OSData, OSNumber, OSBoolean are created as their CF counterparts. \nThis function will search for a property, starting first with specified registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the same semantics as IORegistryEntryCreateCFProperty. The iteration keeps track of entries that have been recursed into previously to avoid loops.\n @param entry The registry entry at which to start the search.\n @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.\n @param key A CFString specifying the property name.\n @param allocator The CF allocator to use when creating the CF container.\n @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard IORegistryEntryCreateCFProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children.\n @result A CF container is created and returned the caller on success. The caller should release with CFRelease. */\n\nCFTypeRef\nIORegistryEntrySearchCFProperty(\n\tio_registry_entry_t\tentry,\n\tconst io_name_t\t\tplane,\n\tCFStringRef\t\tkey,\n CFAllocatorRef\t\tallocator,\n\tIOOptionBits\t\toptions );\n\n/* @function IORegistryEntryGetProperty - deprecated,\n use IORegistryEntryCreateCFProperty */\n\nkern_return_t\nIORegistryEntryGetProperty(\n\tio_registry_entry_t\tentry,\n\tconst io_name_t\t\tpropertyName,\n\tio_struct_inband_t\tbuffer,\n\tuint32_t\t * size );\n\n/*! @function IORegistryEntrySetCFProperties\n @abstract Set CF container based properties in a registry entry.\n @discussion This is a generic method to pass a CF container of properties to an object in the registry. Setting properties in a registry entry is not generally supported, it is more common to support IOConnectSetCFProperties for connection based property setting. The properties are interpreted by the object.\n @param entry The registry entry whose properties to set.\n @param properties A CF container - commonly a CFDictionary but this is not enforced. The container should consist of objects which are understood by IOKit - these are currently : CFDictionary, CFArray, CFSet, CFString, CFData, CFNumber, CFBoolean, and are passed in the kernel as the corresponding OSDictionary etc. objects.\n @result A kern_return_t error code returned by the object. */\n\nkern_return_t\nIORegistryEntrySetCFProperties(\n\tio_registry_entry_t\tentry,\n\tCFTypeRef\t \tproperties );\n\n/*! @function IORegistryEntrySetCFProperty\n @abstract Set a CF container based property in a registry entry.\n @discussion This is a generic method to pass a CF container as a property to an object in the registry. Setting properties in a registry entry is not generally supported, it is more common to support IOConnectSetCFProperty for connection based property setting. The property is interpreted by the object.\n @param entry The registry entry whose property to set.\n @param propertyName The name of the property as a CFString.\n @param property A CF container - should consist of objects which are understood by IOKit - these are currently : CFDictionary, CFArray, CFSet, CFString, CFData, CFNumber, CFBoolean, and are passed in the kernel as the corresponding OSDictionary etc. objects.\n @result A kern_return_t error code returned by the object. */\n\nkern_return_t\nIORegistryEntrySetCFProperty(\n\tio_registry_entry_t\tentry,\n CFStringRef\t\tpropertyName,\n\tCFTypeRef\t \tproperty );\n\n/*! @function IORegistryEntryGetChildIterator\n @abstract Returns an iterator over an registry entry's child entries in a plane.\n @discussion This method creates an iterator which will return each of a registry entry's child entries in a specified plane.\n @param entry The registry entry whose children to iterate over.\n @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.\n @param iterator The created iterator over the children of the entry, on success. The iterator must be released when the iteration is finished.\n @result A kern_return_t error code. */\n\nkern_return_t\nIORegistryEntryGetChildIterator(\n\tio_registry_entry_t\tentry,\n\tconst io_name_t\t\tplane,\n\tio_iterator_t\t * iterator );\n\n/*! @function IORegistryEntryGetChildEntry\n @abstract Returns the first child of a registry entry in a plane.\n @discussion This function will return the child which first attached to a registry entry in a plane.\n @param entry The registry entry whose child to look up.\n @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.\n @param child The first child of the registry entry, on success. The child must be released by the caller.\n @result A kern_return_t error code. */\n\nkern_return_t\nIORegistryEntryGetChildEntry(\n\tio_registry_entry_t\tentry,\n\tconst io_name_t\t\tplane,\n\tio_registry_entry_t * child );\n\n/*! @function IORegistryEntryGetParentIterator\n @abstract Returns an iterator over an registry entry's parent entries in a plane.\n @discussion This method creates an iterator which will return each of a registry entry's parent entries in a specified plane.\n @param entry The registry entry whose parents to iterate over.\n @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.\n @param iterator The created iterator over the parents of the entry, on success. The iterator must be released when the iteration is finished.\n @result A kern_return_t error. */\n\nkern_return_t\nIORegistryEntryGetParentIterator(\n\tio_registry_entry_t\tentry,\n\tconst io_name_t\t\tplane,\n\tio_iterator_t\t * iterator );\n\n/*! @function IORegistryEntryGetParentEntry\n @abstract Returns the first parent of a registry entry in a plane.\n @discussion This function will return the parent to which the registry entry was first attached in a plane.\n @param entry The registry entry whose parent to look up.\n @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.\n @param child The first parent of the registry entry, on success. The parent must be released by the caller.\n @result A kern_return_t error code. */\n\nkern_return_t\nIORegistryEntryGetParentEntry(\n\tio_registry_entry_t\tentry,\n\tconst io_name_t\t\tplane,\n\tio_registry_entry_t * parent );\n\n/*! @function IORegistryEntryInPlane\n @abstract Determines if the registry entry is attached in a plane.\n @discussion This method determines if the entry is attached in a plane to any other entry.\n @param entry The registry entry.\n @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.\n @result If the entry has a parent in the plane, true is returned, otherwise false is returned. */\n\nboolean_t\nIORegistryEntryInPlane(\n\tio_registry_entry_t\tentry,\n\tconst io_name_t\t\tplane );\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/*\n * Matching dictionary creation helpers\n */\n\n/*! @function IOServiceMatching\n @abstract Create a matching dictionary that specifies an IOService class match.\n @discussion A very common matching criteria for IOService is based on its class. IOServiceMatching will create a matching dictionary that specifies any IOService of a class, or its subclasses. The class is specified by C-string name.\n @param name The class name, as a const C-string. Class matching is successful on IOService's of this class or any subclass.\n @result The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. */\n\nCFMutableDictionaryRef\nIOServiceMatching(\n\tconst char *\tname );\n\n/*! @function IOServiceNameMatching\n @abstract Create a matching dictionary that specifies an IOService name match.\n @discussion A common matching criteria for IOService is based on its name. IOServiceNameMatching will create a matching dictionary that specifies an IOService with a given name. Some IOServices created from the OpenFirmware device tree will perform name matching on the standard OF compatible, name, model properties.\n @param name The IOService name, as a const C-string.\n @result The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. */\n\nCFMutableDictionaryRef\nIOServiceNameMatching(\n\tconst char *\tname );\n\n/*! @function IOBSDNameMatching\n @abstract Create a matching dictionary that specifies an IOService match based on BSD device name.\n @discussion IOServices that represent BSD devices have an associated BSD name. This function creates a matching dictionary that will match IOService's with a given BSD name.\n @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.\n @param options No options are currently defined.\n @param bsdName The BSD name, as a const char *.\n @result The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. */\n\nCFMutableDictionaryRef\nIOBSDNameMatching(\n\tmach_port_t\tmasterPort,\n\tuint32_t\toptions,\n\tconst char *\tbsdName );\n\n/*! @function IOOpenFirmwarePathMatching\n @abstract Create a matching dictionary that specifies an IOService match based on an OpenFirmware device path.\n @discussion Certain IOServices (currently, block and ethernet boot devices) may be looked up by a path that specifies their location in the OpenFirmware device tree, represented in the registry by the kIODeviceTreePlane plane. This function creates a matching dictionary that will match IOService's found with a given OpenFirmware device path.\n @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.\n @param options No options are currently defined.\n @param path The OpenFirmware device path, as a const char *.\n @result The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. */\n\nCFMutableDictionaryRef\nIOOpenFirmwarePathMatching(\n\tmach_port_t\tmasterPort,\n\tuint32_t\toptions,\n\tconst char *\tpath );\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/*! @function IOServiceOFPathToBSDName\n @abstract Utility to look up an IOService from its OpenFirmware device path, and return its BSD device name if available.\n @discussion Certain IOServices (currently, block and ethernet boot devices) may be looked up by a path that specifies their location in the OpenFirmware device tree, represented in the registry by the kIODeviceTreePlane plane. This function looks up an IOService object with a given OpenFirmware device path, and returns its associated BSD device name.\n @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.\n @param openFirmwarePath The OpenFirmware device path, as a const char *.\n @param bsdName The BSD name, as a const char *, is copied to the callers buffer.\n @result A kern_return_t error code. */\n\nkern_return_t\nIOServiceOFPathToBSDName(mach_port_t\t\tmasterPort,\n const io_name_t\topenFirmwarePath,\n io_name_t\t\tbsdName);\n\t\t\t\t\t\t \n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/*! @typedef IOAsyncCallback0\n @abstract standard callback function for asynchronous I/O requests with\n no extra arguments beyond a refcon and result code.\n @param refcon The refcon passed into the original I/O request\n @param result The result of the I/O operation\n*/\ntypedef void (*IOAsyncCallback0)(void *refcon, IOReturn result);\n\n/*! @typedef IOAsyncCallback1\n @abstract standard callback function for asynchronous I/O requests with\n one extra argument beyond a refcon and result code.\n This is often a count of the number of bytes transferred\n @param refcon The refcon passed into the original I/O request\n @param result The result of the I/O operation\n @param arg0\tExtra argument\n*/\ntypedef void (*IOAsyncCallback1)(void *refcon, IOReturn result, void *arg0);\n\n/*! @typedef IOAsyncCallback2\n @abstract standard callback function for asynchronous I/O requests with\n two extra arguments beyond a refcon and result code.\n @param refcon The refcon passed into the original I/O request\n @param result The result of the I/O operation\n @param arg0\tExtra argument\n @param arg1\tExtra argument\n*/\ntypedef void (*IOAsyncCallback2)(void *refcon, IOReturn result, void *arg0, void *arg1);\n\n/*! @typedef IOAsyncCallback\n @abstract standard callback function for asynchronous I/O requests with\n lots of extra arguments beyond a refcon and result code.\n @param refcon The refcon passed into the original I/O request\n @param result The result of the I/O operation\n @param args\tArray of extra arguments\n @param numArgs Number of extra arguments\n*/\ntypedef void (*IOAsyncCallback)(void *refcon, IOReturn result, void **args,\n uint32_t numArgs);\n\n\n/* Internal use */\n\nkern_return_t\nOSGetNotificationFromMessage(\n\tmach_msg_header_t * msg,\n\tuint32_t\t \tindex,\n uint32_t \t * type,\n uintptr_t\t * reference,\n\tvoid\t\t ** content,\n vm_size_t\t * size );\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/* Internal use */\n\nkern_return_t\nIOCatalogueSendData(\n mach_port_t masterPort,\n uint32_t flag,\n const char *buffer,\n uint32_t size );\n\nkern_return_t\nIOCatalogueTerminate(\n mach_port_t\t\tmasterPort,\n uint32_t flag,\n\tio_name_t\t\tdescription );\n\nkern_return_t\nIOCatalogueGetData(\n mach_port_t masterPort,\n uint32_t flag,\n char **buffer,\n uint32_t *size );\n\nkern_return_t\nIOCatalogueModuleLoaded(\n mach_port_t masterPort,\n io_name_t name );\n\nkern_return_t\nIOCatalogueReset(\n mach_port_t masterPort,\n uint32_t flag );\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n// obsolete API\n\n#if !defined(__LP64__)\n\n// for Power Mgt\n\ntypedef struct IOObject IOObject;\n\n// for MacOS.app\n\nkern_return_t\nIORegistryDisposeEnumerator(\n\tio_enumerator_t\tenumerator ) DEPRECATED_ATTRIBUTE;\n\nkern_return_t\nIOMapMemory(\n\tio_connect_t\tconnect,\n\tuint32_t\tmemoryType,\n\ttask_port_t\tintoTask,\n\tvm_address_t *\tatAddress,\n\tvm_size_t *\tofSize,\n\tuint32_t\tflags ) DEPRECATED_ATTRIBUTE;\n\n// for CGS\n\nkern_return_t\nIOCompatibiltyNumber(\n\tmach_port_t\tconnect,\n\tuint32_t *\tobjectNumber ) DEPRECATED_ATTRIBUTE;\n\n// Traditional IOUserClient transport routines\nkern_return_t\nIOConnectMethodScalarIScalarO( \n\tio_connect_t\tconnect,\n uint32_t\tindex,\n IOItemCount\tscalarInputCount,\n IOItemCount\tscalarOutputCount,\n ... ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;\n\nkern_return_t\nIOConnectMethodScalarIStructureO(\n\tio_connect_t\tconnect,\n uint32_t\tindex,\n IOItemCount\tscalarInputCount,\n IOByteCount *\tstructureSize,\n ... ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;\n\nkern_return_t\nIOConnectMethodScalarIStructureI(\n\tio_connect_t\tconnect,\n uint32_t\tindex,\n IOItemCount\tscalarInputCount,\n IOByteCount\tstructureSize,\n ... ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;\n\nkern_return_t\nIOConnectMethodStructureIStructureO(\n\tio_connect_t\tconnect,\n uint32_t\tindex,\n IOItemCount\tstructureInputSize,\n IOByteCount *\tstructureOutputSize,\n void *\t\tinputStructure,\n void *\t\touputStructure ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;\n\n// Compatability with earlier Mig interface routines\n#if IOCONNECT_NO_32B_METHODS\n\nkern_return_t\nio_connect_map_memory(\n\tio_connect_t\t\tconnect,\n\tuint32_t\t\tmemoryType,\n\ttask_port_t\t\tintoTask,\n\tvm_address_t\t\t*atAddress,\n\tvm_size_t\t\t*ofSize,\n\tIOOptionBits\t\toptions) DEPRECATED_ATTRIBUTE;\n\nkern_return_t\nio_connect_unmap_memory(\n\tio_connect_t\t\tconnect,\n\tuint32_t\t\tmemoryType,\n\ttask_port_t\t\tfromTask,\n\tvm_address_t\t\tatAddress) DEPRECATED_ATTRIBUTE;\n\nkern_return_t\nio_connect_method_scalarI_scalarO(\n\tmach_port_t connection,\n\tint selector,\n\tio_scalar_inband_t input,\n\tmach_msg_type_number_t inputCnt,\n\tio_scalar_inband_t output,\n\tmach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE;\n\nkern_return_t\nio_connect_method_scalarI_structureO(\n\tmach_port_t connection,\n\tint selector,\n\tio_scalar_inband_t input,\n\tmach_msg_type_number_t inputCnt,\n\tio_struct_inband_t output,\n\tmach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE;\n\nkern_return_t\nio_connect_method_scalarI_structureI(\n\tmach_port_t connection,\n\tint selector,\n\tio_scalar_inband_t input,\n\tmach_msg_type_number_t inputCnt,\n\tio_struct_inband_t inputStruct,\n\tmach_msg_type_number_t inputStructCnt) DEPRECATED_ATTRIBUTE;\n\nkern_return_t\nio_connect_method_structureI_structureO(\n\tmach_port_t connection,\n\tint selector,\n\tio_struct_inband_t input,\n\tmach_msg_type_number_t inputCnt,\n\tio_struct_inband_t output,\n\tmach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE;\n\nkern_return_t\nio_async_method_scalarI_scalarO(\n\tmach_port_t connection,\n\tmach_port_t wake_port,\n\tio_async_ref_t reference,\n\tmach_msg_type_number_t referenceCnt,\n\tint selector,\n\tio_scalar_inband_t input,\n\tmach_msg_type_number_t inputCnt,\n\tio_scalar_inband_t output,\n\tmach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE;\n\nkern_return_t\nio_async_method_scalarI_structureO(\n\tmach_port_t connection,\n\tmach_port_t wake_port,\n\tio_async_ref_t reference,\n\tmach_msg_type_number_t referenceCnt,\n\tint selector,\n\tio_scalar_inband_t input,\n\tmach_msg_type_number_t inputCnt,\n\tio_struct_inband_t output,\n\tmach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE;\n\nkern_return_t\nio_async_method_scalarI_structureI(\n\tmach_port_t connection,\n\tmach_port_t wake_port,\n\tio_async_ref_t reference,\n\tmach_msg_type_number_t referenceCnt,\n\tint selector,\n\tio_scalar_inband_t input,\n\tmach_msg_type_number_t inputCnt,\n\tio_struct_inband_t inputStruct,\n\tmach_msg_type_number_t inputStructCnt) DEPRECATED_ATTRIBUTE;\n\nkern_return_t\nio_async_method_structureI_structureO(\n\tmach_port_t connection,\n\tmach_port_t wake_port,\n\tio_async_ref_t reference,\n\tmach_msg_type_number_t referenceCnt,\n\tint selector,\n\tio_struct_inband_t input,\n\tmach_msg_type_number_t inputCnt,\n\tio_struct_inband_t output,\n\tmach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE;\n#endif // IOCONNECT_NO_32B_METHODS\n\n#endif /* defined(__LP64__) */\n\n__END_DECLS\n\n#endif /* ! _IOKIT_IOKITLIB_H */\n"} {"text": "// Screen Readers\n// -------------------------\n\n.sr-only { .sr-only(); }\n.sr-only-focusable { .sr-only-focusable(); }\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 */\n\npackage com.microsoft.azure.management.network.v2018_06_01;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\n/**\n * VirtualNetworkGatewaySku details.\n */\npublic class VirtualNetworkGatewaySku {\n /**\n * Gateway SKU name. Possible values include: 'Basic', 'HighPerformance',\n * 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3',\n * 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'.\n */\n @JsonProperty(value = \"name\")\n private VirtualNetworkGatewaySkuName name;\n\n /**\n * Gateway SKU tier. Possible values include: 'Basic', 'HighPerformance',\n * 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3',\n * 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'.\n */\n @JsonProperty(value = \"tier\")\n private VirtualNetworkGatewaySkuTier tier;\n\n /**\n * The capacity.\n */\n @JsonProperty(value = \"capacity\")\n private Integer capacity;\n\n /**\n * Get gateway SKU name. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'.\n *\n * @return the name value\n */\n public VirtualNetworkGatewaySkuName name() {\n return this.name;\n }\n\n /**\n * Set gateway SKU name. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'.\n *\n * @param name the name value to set\n * @return the VirtualNetworkGatewaySku object itself.\n */\n public VirtualNetworkGatewaySku withName(VirtualNetworkGatewaySkuName name) {\n this.name = name;\n return this;\n }\n\n /**\n * Get gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'.\n *\n * @return the tier value\n */\n public VirtualNetworkGatewaySkuTier tier() {\n return this.tier;\n }\n\n /**\n * Set gateway SKU tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ'.\n *\n * @param tier the tier value to set\n * @return the VirtualNetworkGatewaySku object itself.\n */\n public VirtualNetworkGatewaySku withTier(VirtualNetworkGatewaySkuTier tier) {\n this.tier = tier;\n return this;\n }\n\n /**\n * Get the capacity.\n *\n * @return the capacity value\n */\n public Integer capacity() {\n return this.capacity;\n }\n\n /**\n * Set the capacity.\n *\n * @param capacity the capacity value to set\n * @return the VirtualNetworkGatewaySku object itself.\n */\n public VirtualNetworkGatewaySku withCapacity(Integer capacity) {\n this.capacity = capacity;\n return this;\n }\n\n}\n"} {"text": "#ifndef DEBUG_RENDERER_H\n#define DEBUG_RENDERER_H\n\n#include \"engine.h\"\n\nclass DebugRenderer : public Renderable, public InputEventHandler\n{\nprivate:\n sf::Clock fps_timer;\n float fps;\n int fps_counter;\n\n bool show_fps;\n bool show_datarate;\n bool show_timing_graph;\n\n std::vector timing_graph_points;\npublic:\n DebugRenderer();\n\n virtual void render(sf::RenderTarget& window);\n virtual void handleKeyPress(sf::Event::KeyEvent key, int unicode);\n};\n\n#endif//DEBUG_RENDERER_H\n"} {"text": "flags &\n (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) != 0)\n {\n if (*error_message == PNG_LITERAL_SHARP)\n {\n /* Strip \"#nnnn \" from beginning of error message. */\n int offset;\n for (offset = 1; offset<15; offset++)\n if (error_message[offset] == ' ')\n break;\n\n if ((png_ptr->flags & PNG_FLAG_STRIP_ERROR_TEXT) != 0)\n {\n int i;\n for (i = 0; i < offset - 1; i++)\n msg[i] = error_message[i + 1];\n msg[i - 1] = '\\0';\n error_message = msg;\n }\n\n else\n error_message += offset;\n }\n\n else\n {\n if ((png_ptr->flags & PNG_FLAG_STRIP_ERROR_TEXT) != 0)\n {\n msg[0] = '0';\n msg[1] = '\\0';\n error_message = msg;\n }\n }\n }\n }\n#endif\n if (png_ptr != NULL && png_ptr->error_fn != NULL)\n (*(png_ptr->error_fn))(png_constcast(png_structrp,png_ptr),\n error_message);\n\n /* If the custom handler doesn't exist, or if it returns,\n use the default handler, which will not return. */\n png_default_error(png_ptr, error_message);\n}\n#else\nPNG_FUNCTION(void,PNGAPI\npng_err,(png_const_structrp png_ptr),PNG_NORETURN)\n{\n /* Prior to 1.5.2 the error_fn received a NULL pointer, expressed\n * erroneously as '\\0', instead of the empty string \"\". This was\n * apparently an error, introduced in libpng-1.2.20, and png_default_error\n * will crash in this case.\n */\n if (png_ptr != NULL && png_ptr->error_fn != NULL)\n (*(png_ptr->error_fn))(png_constcast(png_structrp,png_ptr), \"\");\n\n /* If the custom handler doesn't exist, or if it returns,\n use the default handler, which will not return. */\n png_default_error(png_ptr, \"\");\n}\n#endif /* ERROR_TEXT */\n\n/* Utility to safely appends strings to a buffer. This never errors out so\n * error checking is not required in the caller.\n */\nsize_t\npng_safecat(png_charp buffer, size_t bufsize, size_t pos,\n png_const_charp string)\n{\n if (buffer != NULL && pos < bufsize)\n {\n if (string != NULL)\n while (*string != '\\0' && pos < bufsize-1)\n buffer[pos++] = *string++;\n\n buffer[pos] = '\\0';\n }\n\n return pos;\n}\n\n#if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_TIME_RFC1123_SUPPORTED)\n/* Utility to dump an unsigned value into a buffer, given a start pointer and\n * and end pointer (which should point just *beyond* the end of the buffer!)\n * Returns the pointer to the start of the formatted string.\n */\npng_charp\npng_format_number(png_const_charp start, png_charp end, int format,\n png_alloc_size_t number)\n{\n int count = 0; /* number of digits output */\n int mincount = 1; /* minimum number required */\n int output = 0; /* digit output (for the fixed point format) */\n\n *--end = '\\0';\n\n /* This is written so that the loop always runs at least once, even with\n * number zero.\n */\n while (end > start && (number != 0 || count < mincount))\n {\n\n static const char digits[] = \"0123456789ABCDEF\";\n\n switch (format)\n {\n case PNG_NUMBER_FORMAT_fixed:\n /* Needs five digits (the fraction) */\n mincount = 5;\n if (output != 0 || number % 10 != 0)\n {\n *--end = digits[number % 10];\n output = 1;\n }\n number /= 10;\n break;\n\n case PNG_NUMBER_FORMAT_02u:\n /* Expects at least 2 digits. */\n mincount = 2;\n /* FALLTHROUGH */\n\n case PNG_NUMBER_FORMAT_u:\n *--end = digits[number % 10];\n number /= 10;\n break;\n\n case PNG_NUMBER_FORMAT_02x:\n /* This format expects at least two digits */\n mincount = 2;\n /* FALLTHROUGH */\n\n case PNG_NUMBER_FORMAT_x:\n *--end = digits[number & 0xf];\n number >>= 4;\n break;\n\n default: /* an error */\n number = 0;\n break;\n }\n\n /* Keep track of the number of digits added */\n ++count;\n\n /* Float a fixed number here: */\n if ((format == PNG_NUMBER_FORMAT_fixed) && (count == 5) && (end > start))\n {\n /* End of the fraction, but maybe nothing was output? In that case\n * drop the decimal point. If the number is a true zero handle that\n * here.\n */\n if (output != 0)\n *--end = '.';\n else if (number == 0) /* and !output */\n *--end = '0';\n }\n }\n\n return end;\n}\n#endif\n\n#ifdef PNG_WARNINGS_SUPPORTED\n/* This function is called whenever there is a non-fatal error. This function\n * should not be changed. If there is a need to handle warnings differently,\n * you should supply a replacement warning function and use\n * png_set_error_fn() to replace the warning function at run-time.\n */\nvoid PNGAPI\npng_warning(png_const_structrp png_ptr, png_const_charp warning_message)\n{\n int offset = 0;\n if (png_ptr != NULL)\n {\n#ifdef PNG_ERROR_NUMBERS_SUPPORTED\n if ((png_ptr->flags &\n (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) != 0)\n#endif\n {\n if (*warning_message == PNG_LITERAL_SHARP)\n {\n for (offset = 1; offset < 15; offset++)\n if (warning_message[offset] == ' ')\n break;\n }\n }\n }\n if (png_ptr != NULL && png_ptr->warning_fn != NULL)\n (*(png_ptr->warning_fn))(png_constcast(png_structrp,png_ptr),\n warning_message + offset);\n else\n png_default_warning(png_ptr, warning_message + offset);\n}\n\n/* These functions support 'formatted' warning messages with up to\n * PNG_WARNING_PARAMETER_COUNT parameters. In the format string the parameter\n * is introduced by @, where 'number' starts at 1. This follows the\n * standard established by X/Open for internationalizable error messages.\n */\nvoid\npng_warning_parameter(png_warning_parameters p, int number,\n png_const_charp string)\n{\n if (number > 0 && number <= PNG_WARNING_PARAMETER_COUNT)\n (void)png_safecat(p[number-1], (sizeof p[number-1]), 0, string);\n}\n\nvoid\npng_warning_parameter_unsigned(png_warning_parameters p, int number, int format,\n png_alloc_size_t value)\n{\n char buffer[PNG_NUMBER_BUFFER_SIZE];\n png_warning_parameter(p, number, PNG_FORMAT_NUMBER(buffer, format, value));\n}\n\nvoid\npng_warning_parameter_signed(png_warning_parameters p, int number, int format,\n png_int_32 value)\n{\n png_alloc_size_t u;\n png_charp str;\n char buffer[PNG_NUMBER_BUFFER_SIZE];\n\n /* Avoid overflow by doing the negate in a png_alloc_size_t: */\n u = (png_alloc_size_t)value;\n if (value < 0)\n u = ~u + 1;\n\n str = PNG_FORMAT_NUMBER(buffer, format, u);\n\n if (value < 0 && str > buffer)\n *--str = '-';\n\n png_warning_parameter(p, number, str);\n}\n\nvoid\npng_formatted_warning(png_const_structrp png_ptr, png_warning_parameters p,\n png_const_charp message)\n{\n /* The internal buffer is just 192 bytes - enough for all our messages,\n * overflow doesn't happen because this code checks! If someone figures\n * out how to send us a message longer than 192 bytes, all that will\n * happen is that the message will be truncated appropriately.\n */\n size_t i = 0; /* Index in the msg[] buffer: */\n char msg[192];\n\n /* Each iteration through the following loop writes at most one character\n * to msg[i++] then returns here to validate that there is still space for\n * the trailing '\\0'. It may (in the case of a parameter) read more than\n * one character from message[]; it must check for '\\0' and continue to the\n * test if it finds the end of string.\n */\n while (i<(sizeof msg)-1 && *message != '\\0')\n {\n /* '@' at end of string is now just printed (previously it was skipped);\n * it is an error in the calling code to terminate the string with @.\n */\n if (p != NULL && *message == '@' && message[1] != '\\0')\n {\n int parameter_char = *++message; /* Consume the '@' */\n static const char valid_parameters[] = \"123456789\";\n int parameter = 0;\n\n /* Search for the parameter digit, the index in the string is the\n * parameter to use.\n */\n while (valid_parameters[parameter] != parameter_char &&\n valid_parameters[parameter] != '\\0')\n ++parameter;\n\n /* If the parameter digit is out of range it will just get printed. */\n if (parameter < PNG_WARNING_PARAMETER_COUNT)\n {\n /* Append this parameter */\n png_const_charp parm = p[parameter];\n png_const_charp pend = p[parameter] + (sizeof p[parameter]);\n\n /* No need to copy the trailing '\\0' here, but there is no guarantee\n * that parm[] has been initialized, so there is no guarantee of a\n * trailing '\\0':\n */\n while (i<(sizeof msg)-1 && *parm != '\\0' && parm < pend)\n msg[i++] = *parm++;\n\n /* Consume the parameter digit too: */\n ++message;\n continue;\n }\n\n /* else not a parameter and there is a character after the @ sign; just\n * copy that. This is known not to be '\\0' because of the test above.\n */\n }\n\n /* At this point *message can't be '\\0', even in the bad parameter case\n * above where there is a lone '@' at the end of the message string.\n */\n msg[i++] = *message++;\n }\n\n /* i is always less than (sizeof msg), so: */\n msg[i] = '\\0';\n\n /* And this is the formatted message. It may be larger than\n * PNG_MAX_ERROR_TEXT, but that is only used for 'chunk' errors and these\n * are not (currently) formatted.\n */\n png_warning(png_ptr, msg);\n}\n#endif /* WARNINGS */\n\n#ifdef PNG_BENIGN_ERRORS_SUPPORTED\nvoid PNGAPI\npng_benign_error(png_const_structrp png_ptr, png_const_charp error_message)\n{\n if ((png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) != 0)\n {\n# ifdef PNG_READ_SUPPORTED\n if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&\n png_ptr->chunk_name != 0)\n png_chunk_warning(png_ptr, error_message);\n else\n# endif\n png_warning(png_ptr, error_message);\n }\n\n else\n {\n# ifdef PNG_READ_SUPPORTED\n if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&\n png_ptr->chunk_name != 0)\n png_chunk_error(png_ptr, error_message);\n else\n# endif\n png_error(png_ptr, error_message);\n }\n\n# ifndef PNG_ERROR_TEXT_SUPPORTED\n PNG_UNUSED(error_message)\n# endif\n}\n\nvoid /* PRIVATE */\npng_app_warning(png_const_structrp png_ptr, png_const_charp error_message)\n{\n if ((png_ptr->flags & PNG_FLAG_APP_WARNINGS_WARN) != 0)\n png_warning(png_ptr, error_message);\n else\n png_error(png_ptr, error_message);\n\n# ifndef PNG_ERROR_TEXT_SUPPORTED\n PNG_UNUSED(error_message)\n# endif\n}\n\nvoid /* PRIVATE */\npng_app_error(png_const_structrp png_ptr, png_const_charp error_message)\n{\n if ((png_ptr->flags & PNG_FLAG_APP_ERRORS_WARN) != 0)\n png_warning(png_ptr, error_message);\n else\n png_error(png_ptr, error_message);\n\n# ifndef PNG_ERROR_TEXT_SUPPORTED\n PNG_UNUSED(error_message)\n# endif\n}\n#endif /* BENIGN_ERRORS */\n\n#define PNG_MAX_ERROR_TEXT 196 /* Currently limited by profile_error in png.c */\n#if defined(PNG_WARNINGS_SUPPORTED) || \\\n (defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED))\n/* These utilities are used internally to build an error message that relates\n * to the current chunk. The chunk name comes from png_ptr->chunk_name,\n * which is used to prefix the message. The message is limited in length\n * to 63 bytes. The name characters are output as hex digits wrapped in []\n * if the character is invalid.\n */\n#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97))\nstatic PNG_CONST char png_digit[16] = {\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n 'A', 'B', 'C', 'D', 'E', 'F'\n};\n\nstatic void /* PRIVATE */\npng_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp\n error_message)\n{\n png_uint_32 chunk_name = png_ptr->chunk_name;\n int iout = 0, ishift = 24;\n\n while (ishift >= 0)\n {\n int c = (int)(chunk_name >> ishift) & 0xff;\n\n ishift -= 8;\n if (isnonalpha(c) != 0)\n {\n buffer[iout++] = PNG_LITERAL_LEFT_SQUARE_BRACKET;\n buffer[iout++] = png_digit[(c & 0xf0) >> 4];\n buffer[iout++] = png_digit[c & 0x0f];\n buffer[iout++] = PNG_LITERAL_RIGHT_SQUARE_BRACKET;\n }\n\n else\n {\n buffer[iout++] = (char)c;\n }\n }\n\n if (error_message == NULL)\n buffer[iout] = '\\0';\n\n else\n {\n int iin = 0;\n\n buffer[iout++] = ':';\n buffer[iout++] = ' ';\n\n while (iin < PNG_MAX_ERROR_TEXT-1 && error_message[iin] != '\\0')\n buffer[iout++] = error_message[iin++];\n\n /* iin < PNG_MAX_ERROR_TEXT, so the following is safe: */\n buffer[iout] = '\\0';\n }\n}\n#endif /* WARNINGS || ERROR_TEXT */\n\n#if defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)\nPNG_FUNCTION(void,PNGAPI\npng_chunk_error,(png_const_structrp png_ptr, png_const_charp error_message),\n PNG_NORETURN)\n{\n char msg[18+PNG_MAX_ERROR_TEXT];\n if (png_ptr == NULL)\n png_error(png_ptr, error_message);\n\n else\n {\n png_format_buffer(png_ptr, msg, error_message);\n png_error(png_ptr, msg);\n }\n}\n#endif /* READ && ERROR_TEXT */\n\n#ifdef PNG_WARNINGS_SUPPORTED\nvoid PNGAPI\npng_chunk_warning(png_const_structrp png_ptr, png_const_charp warning_message)\n{\n char msg[18+PNG_MAX_ERROR_TEXT];\n if (png_ptr == NULL)\n png_warning(png_ptr, warning_message);\n\n else\n {\n png_format_buffer(png_ptr, msg, warning_message);\n png_warning(png_ptr, msg);\n }\n}\n#endif /* WARNINGS */\n\n#ifdef PNG_READ_SUPPORTED\n#ifdef PNG_BENIGN_ERRORS_SUPPORTED\nvoid PNGAPI\npng_chunk_benign_error(png_const_structrp png_ptr, png_const_charp\n error_message)\n{\n if ((png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) != 0)\n png_chunk_warning(png_ptr, error_message);\n\n else\n png_chunk_error(png_ptr, error_message);\n\n# ifndef PNG_ERROR_TEXT_SUPPORTED\n PNG_UNUSED(error_message)\n# endif\n}\n#endif\n#endif /* READ */\n\nvoid /* PRIVATE */\npng_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error)\n{\n# ifndef PNG_WARNINGS_SUPPORTED\n PNG_UNUSED(message)\n# endif\n\n /* This is always supported, but for just read or just write it\n * unconditionally does the right thing.\n */\n# if defined(PNG_READ_SUPPORTED) && defined(PNG_WRITE_SUPPORTED)\n if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0)\n# endif\n\n# ifdef PNG_READ_SUPPORTED\n {\n if (error < PNG_CHUNK_ERROR)\n png_chunk_warning(png_ptr, message);\n\n else\n png_chunk_benign_error(png_ptr, message);\n }\n# endif\n\n# if defined(PNG_READ_SUPPORTED) && defined(PNG_WRITE_SUPPORTED)\n else if ((png_ptr->mode & PNG_IS_READ_STRUCT) == 0)\n# endif\n\n# ifdef PNG_WRITE_SUPPORTED\n {\n if (error < PNG_CHUNK_WRITE_ERROR)\n png_app_warning(png_ptr, message);\n\n else\n png_app_error(png_ptr, message);\n }\n# endif\n}\n\n#ifdef PNG_ERROR_TEXT_SUPPORTED\n#ifdef PNG_FLOATING_POINT_SUPPORTED\nPNG_FUNCTION(void,\npng_fixed_error,(png_const_structrp png_ptr, png_const_charp name),PNG_NORETURN)\n{\n# define fixed_message \"fixed point overflow in \"\n# define fixed_message_ln ((sizeof fixed_message)-1)\n unsigned int iin;\n char msg[fixed_message_ln+PNG_MAX_ERROR_TEXT];\n memcpy(msg, fixed_message, fixed_message_ln);\n iin = 0;\n if (name != NULL)\n while (iin < (PNG_MAX_ERROR_TEXT-1) && name[iin] != 0)\n {\n msg[fixed_message_ln + iin] = name[iin];\n ++iin;\n }\n msg[fixed_message_ln + iin] = 0;\n png_error(png_ptr, msg);\n}\n#endif\n#endif\n\n#ifdef PNG_SETJMP_SUPPORTED\n/* This API only exists if ANSI-C style error handling is used,\n * otherwise it is necessary for png_default_error to be overridden.\n */\njmp_buf* PNGAPI\npng_set_longjmp_fn(png_structrp png_ptr, png_longjmp_ptr longjmp_fn,\n size_t jmp_buf_size)\n{\n /* From libpng 1.6.0 the app gets one chance to set a 'jmpbuf_size' value\n * and it must not change after that. Libpng doesn't care how big the\n * buffer is, just that it doesn't change.\n *\n * If the buffer size is no *larger* than the size of jmp_buf when libpng is\n * compiled a built in jmp_buf is returned; this preserves the pre-1.6.0\n * semantics that this call will not fail. If the size is larger, however,\n * the buffer is allocated and this may fail, causing the function to return\n * NULL.\n */\n if (png_ptr == NULL)\n return NULL;\n\n if (png_ptr->jmp_buf_ptr == NULL)\n {\n png_ptr->jmp_buf_size = 0; /* not allocated */\n\n if (jmp_buf_size <= (sizeof png_ptr->jmp_buf_local))\n png_ptr->jmp_buf_ptr = &png_ptr->jmp_buf_local;\n\n else\n {\n png_ptr->jmp_buf_ptr = png_voidcast(jmp_buf *,\n png_malloc_warn(png_ptr, jmp_buf_size));\n\n if (png_ptr->jmp_buf_ptr == NULL)\n return NULL; /* new NULL return on OOM */\n\n png_ptr->jmp_buf_size = jmp_buf_size;\n }\n }\n\n else /* Already allocated: check the size */\n {\n size_t size = png_ptr->jmp_buf_size;\n\n if (size == 0)\n {\n size = (sizeof png_ptr->jmp_buf_local);\n if (png_ptr->jmp_buf_ptr != &png_ptr->jmp_buf_local)\n {\n /* This is an internal error in libpng: somehow we have been left\n * with a stack allocated jmp_buf when the application regained\n * control. It's always possible to fix this up, but for the moment\n * this is a png_error because that makes it easy to detect.\n */\n png_error(png_ptr, \"Libpng jmp_buf still allocated\");\n /* png_ptr->jmp_buf_ptr = &png_ptr->jmp_buf_local; */\n }\n }\n\n if (size != jmp_buf_size)\n {\n png_warning(png_ptr, \"Application jmp_buf size changed\");\n return NULL; /* caller will probably crash: no choice here */\n }\n }\n\n /* Finally fill in the function, now we have a satisfactory buffer. It is\n * valid to change the function on every call.\n */\n png_ptr->longjmp_fn = longjmp_fn;\n return png_ptr->jmp_buf_ptr;\n}\n\nvoid /* PRIVATE */\npng_free_jmpbuf(png_structrp png_ptr)\n{\n if (png_ptr != NULL)\n {\n jmp_buf *jb = png_ptr->jmp_buf_ptr;\n\n /* A size of 0 is used to indicate a local, stack, allocation of the\n * pointer; used here and in png.c\n */\n if (jb != NULL && png_ptr->jmp_buf_size > 0)\n {\n\n /* This stuff is so that a failure to free the error control structure\n * does not leave libpng in a state with no valid error handling: the\n * free always succeeds, if there is an error it gets ignored.\n */\n if (jb != &png_ptr->jmp_buf_local)\n {\n /* Make an internal, libpng, jmp_buf to return here */\n jmp_buf free_jmp_buf;\n\n if (!setjmp(free_jmp_buf))\n {\n png_ptr->jmp_buf_ptr = &free_jmp_buf; /* come back here */\n png_ptr->jmp_buf_size = 0; /* stack allocation */\n png_ptr->longjmp_fn = longjmp;\n png_free(png_ptr, jb); /* Return to setjmp on error */\n }\n }\n }\n\n /* *Always* cancel everything out: */\n png_ptr->jmp_buf_size = 0;\n png_ptr->jmp_buf_ptr = NULL;\n png_ptr->longjmp_fn = 0;\n }\n}\n#endif\n\n/* This is the default error handling function. Note that replacements for\n * this function MUST NOT RETURN, or the program will likely crash. This\n * function is used by default, or if the program supplies NULL for the\n * error function pointer in png_set_error_fn().\n */\nstatic PNG_FUNCTION(void /* PRIVATE */,\npng_default_error,(png_const_structrp png_ptr, png_const_charp error_message),\n PNG_NORETURN)\n{\n#ifdef PNG_CONSOLE_IO_SUPPORTED\n#ifdef PNG_ERROR_NUMBERS_SUPPORTED\n /* Check on NULL only added in 1.5.4 */\n if (error_message != NULL && *error_message == PNG_LITERAL_SHARP)\n {\n /* Strip \"#nnnn \" from beginning of error message. */\n int offset;\n char error_number[16];\n for (offset = 0; offset<15; offset++)\n {\n error_number[offset] = error_message[offset + 1];\n if (error_message[offset] == ' ')\n break;\n }\n\n if ((offset > 1) && (offset < 15))\n {\n error_number[offset - 1] = '\\0';\n fprintf(stderr, \"libpng error no. %s: %s\",\n error_number, error_message + offset + 1);\n fprintf(stderr, PNG_STRING_NEWLINE);\n }\n\n else\n {\n fprintf(stderr, \"libpng error: %s, offset=%d\",\n error_message, offset);\n fprintf(stderr, PNG_STRING_NEWLINE);\n }\n }\n else\n#endif\n {\n fprintf(stderr, \"libpng error: %s\", error_message ? error_message :\n \"undefined\");\n fprintf(stderr, PNG_STRING_NEWLINE);\n }\n#else\n PNG_UNUSED(error_message) /* Make compiler happy */\n#endif\n png_longjmp(png_ptr, 1);\n}\n\nPNG_FUNCTION(void,PNGAPI\npng_longjmp,(png_const_structrp png_ptr, int val),PNG_NORETURN)\n{\n#ifdef PNG_SETJMP_SUPPORTED\n if (png_ptr != NULL && png_ptr->longjmp_fn != NULL &&\n png_ptr->jmp_buf_ptr != NULL)\n png_ptr->longjmp_fn(*png_ptr->jmp_buf_ptr, val);\n#else\n PNG_UNUSED(png_ptr)\n PNG_UNUSED(val)\n#endif\n\n /* If control reaches this point, png_longjmp() must not return. The only\n * choice is to terminate the whole process (or maybe the thread); to do\n * this the ANSI-C abort() function is used unless a different method is\n * implemented by overriding the default configuration setting for\n * PNG_ABORT().\n */\n PNG_ABORT();\n}\n\n#ifdef PNG_WARNINGS_SUPPORTED\n/* This function is called when there is a warning, but the library thinks\n * it can continue anyway. Replacement functions don't have to do anything\n * here if you don't want them to. In the default configuration, png_ptr is\n * not used, but it is passed in case it may be useful.\n */\nstatic void /* PRIVATE */\npng_default_warning(png_const_structrp png_ptr, png_const_charp warning_message)\n{\n#ifdef PNG_CONSOLE_IO_SUPPORTED\n# ifdef PNG_ERROR_NUMBERS_SUPPORTED\n if (*warning_message == PNG_LITERAL_SHARP)\n {\n int offset;\n char warning_number[16];\n for (offset = 0; offset < 15; offset++)\n {\n warning_number[offset] = warning_message[offset + 1];\n if (warning_message[offset] == ' ')\n break;\n }\n\n if ((offset > 1) && (offset < 15))\n {\n warning_number[offset + 1] = '\\0';\n fprintf(stderr, \"libpng warning no. %s: %s\",\n warning_number, warning_message + offset);\n fprintf(stderr, PNG_STRING_NEWLINE);\n }\n\n else\n {\n fprintf(stderr, \"libpng warning: %s\",\n warning_message);\n fprintf(stderr, PNG_STRING_NEWLINE);\n }\n }\n else\n# endif\n\n {\n fprintf(stderr, \"libpng warning: %s\", warning_message);\n fprintf(stderr, PNG_STRING_NEWLINE);\n }\n#else\n PNG_UNUSED(warning_message) /* Make compiler happy */\n#endif\n PNG_UNUSED(png_ptr) /* Make compiler happy */\n}\n#endif /* WARNINGS */\n\n/* This function is called when the application wants to use another method\n * of handling errors and warnings. Note that the error function MUST NOT\n * return to the calling routine or serious problems will occur. The return\n * method used in the default routine calls longjmp(png_ptr->jmp_buf_ptr, 1)\n */\nvoid PNGAPI\npng_set_error_fn(png_structrp png_ptr, png_voidp error_ptr,\n png_error_ptr error_fn, png_error_ptr warning_fn)\n{\n if (png_ptr == NULL)\n return;\n\n png_ptr->error_ptr = error_ptr;\n png_ptr->error_fn = error_fn;\n#ifdef PNG_WARNINGS_SUPPORTED\n png_ptr->warning_fn = warning_fn;\n#else\n PNG_UNUSED(warning_fn)\n#endif\n}\n\n\n/* This function returns a pointer to the error_ptr associated with the user\n * functions. The application should free any memory associated with this\n * pointer before png_write_destroy and png_read_destroy are called.\n */\npng_voidp PNGAPI\npng_get_error_ptr(png_const_structrp png_ptr)\n{\n if (png_ptr == NULL)\n return NULL;\n\n return ((png_voidp)png_ptr->error_ptr);\n}\n\n\n#ifdef PNG_ERROR_NUMBERS_SUPPORTED\nvoid PNGAPI\npng_set_strip_error_numbers(png_structrp png_ptr, png_uint_32 strip_mode)\n{\n if (png_ptr != NULL)\n {\n png_ptr->flags &=\n ((~(PNG_FLAG_STRIP_ERROR_NUMBERS |\n PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode);\n }\n}\n#endif\n\n#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\\\n defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)\n /* Currently the above both depend on SETJMP_SUPPORTED, however it would be\n * possible to implement without setjmp support just so long as there is some\n * way to handle the error return here:\n */\nPNG_FUNCTION(void /* PRIVATE */, (PNGCBAPI\npng_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message),\n PNG_NORETURN)\n{\n const png_const_structrp png_ptr = png_nonconst_ptr;\n png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr);\n\n /* An error is always logged here, overwriting anything (typically a warning)\n * that is already there:\n */\n if (image != NULL)\n {\n png_safecat(image->message, (sizeof image->message), 0, error_message);\n image->warning_or_error |= PNG_IMAGE_ERROR;\n\n /* Retrieve the jmp_buf from within the png_control, making this work for\n * C++ compilation too is pretty tricky: C++ wants a pointer to the first\n * element of a jmp_buf, but C doesn't tell us the type of that.\n */\n if (image->opaque != NULL && image->opaque->error_buf != NULL)\n longjmp(png_control_jmp_buf(image->opaque), 1);\n\n /* Missing longjmp buffer, the following is to help debugging: */\n {\n size_t pos = png_safecat(image->message, (sizeof image->message), 0,\n \"bad longjmp: \");\n png_safecat(image->message, (sizeof image->message), pos,\n error_message);\n }\n }\n\n /* Here on an internal programming error. */\n abort();\n}\n\n#ifdef PNG_WARNINGS_SUPPORTED\nvoid /* PRIVATE */ PNGCBAPI\npng_safe_warning(png_structp png_nonconst_ptr, png_const_charp warning_message)\n{\n const png_const_structrp png_ptr = png_nonconst_ptr;\n png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr);\n\n /* A warning is only logged if there is no prior warning or error. */\n if (image->warning_or_error == 0)\n {\n png_safecat(image->message, (sizeof image->message), 0, warning_message);\n image->warning_or_error |= PNG_IMAGE_WARNING;\n }\n}\n#endif\n\nint /* PRIVATE */\npng_safe_execute(png_imagep image_in, int (*function)(png_voidp), png_voidp arg)\n{\n volatile png_imagep image = image_in;\n volatile int result;\n volatile png_voidp saved_error_buf;\n jmp_buf safe_jmpbuf;\n\n /* Safely execute function(arg) with png_error returning to this function. */\n saved_error_buf = image->opaque->error_buf;\n result = setjmp(safe_jmpbuf) == 0;\n\n if (result != 0)\n {\n\n image->opaque->error_buf = safe_jmpbuf;\n result = function(arg);\n }\n\n image->opaque->error_buf = saved_error_buf;\n\n /* And do the cleanup prior to any failure return. */\n if (result == 0)\n png_image_free(image);\n\n return result;\n}\n#endif /* SIMPLIFIED READ || SIMPLIFIED_WRITE */\n#endif /* READ || WRITE */\n"} {"text": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport utils.tfrecord_imagenet_utils as imagenet_utils\n\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\nos.environ['CUDA_VISIBLE_DEVICES'] = '0'\n\ntfrecord = imagenet_utils.dataset2tfrecord('F:\\\\test\\\\',\n 'F:\\\\tfrecord\\\\', 'test', 5)\nprint(tfrecord)\n"} {"text": "#include \n#include \"locale_impl.h\"\n\nstatic const char msgs[] =\n\t\"Invalid flags\\0\"\n\t\"Name does not resolve\\0\"\n\t\"Try again\\0\"\n\t\"Non-recoverable error\\0\"\n\t\"Unknown error\\0\"\n\t\"Unrecognized address family or invalid length\\0\"\n\t\"Unrecognized socket type\\0\"\n\t\"Unrecognized service\\0\"\n\t\"Unknown error\\0\"\n\t\"Out of memory\\0\"\n\t\"System error\\0\"\n\t\"Overflow\\0\"\n\t\"\\0Unknown error\";\n\nconst char *gai_strerror(int ecode)\n{\n\tconst char *s;\n\tfor (s=msgs, ecode++; ecode && *s; ecode++, s++) for (; *s; s++);\n\tif (!*s) s++;\n\treturn LCTRANS_CUR(s);\n}\n"} {"text": "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \"../BaseTestCase.h\"\n#include \"../../user_tools/api/workload.h\"\n#include \"../../user_tools/api/actions.h\"\n\nusing fs_testing::tests::DataTestResult;\nusing fs_testing::user_tools::api::WriteData;\nusing fs_testing::user_tools::api::WriteDataMmap;\nusing fs_testing::user_tools::api::Checkpoint;\nusing std::string;\n\n#define TEST_FILE_PERMS ((mode_t) (S_IRWXU | S_IRWXG | S_IRWXO))\n\nnamespace fs_testing {\n namespace tests {\n \n \n class testName: public BaseTestCase {\n \n public:\n \n virtual int setup() override {\n \n\t\t\t\ttest_path = mnt_dir_ ;\n\t\t\t\tA_path = mnt_dir_ + \"/A\";\n\t\t\t\tAC_path = mnt_dir_ + \"/A/C\";\n\t\t\t\tB_path = mnt_dir_ + \"/B\";\n\t\t\t\tfoo_path = mnt_dir_ + \"/foo\";\n\t\t\t\tbar_path = mnt_dir_ + \"/bar\";\n\t\t\t\tAfoo_path = mnt_dir_ + \"/A/foo\";\n\t\t\t\tAbar_path = mnt_dir_ + \"/A/bar\";\n\t\t\t\tBfoo_path = mnt_dir_ + \"/B/foo\";\n\t\t\t\tBbar_path = mnt_dir_ + \"/B/bar\";\n\t\t\t\tACfoo_path = mnt_dir_ + \"/A/C/foo\";\n\t\t\t\tACbar_path = mnt_dir_ + \"/A/C/bar\";\n return 0;\n }\n \n virtual int run( int checkpoint ) override {\n \n\t\t\t\ttest_path = mnt_dir_ ;\n\t\t\t\tA_path = mnt_dir_ + \"/A\";\n\t\t\t\tAC_path = mnt_dir_ + \"/A/C\";\n\t\t\t\tB_path = mnt_dir_ + \"/B\";\n\t\t\t\tfoo_path = mnt_dir_ + \"/foo\";\n\t\t\t\tbar_path = mnt_dir_ + \"/bar\";\n\t\t\t\tAfoo_path = mnt_dir_ + \"/A/foo\";\n\t\t\t\tAbar_path = mnt_dir_ + \"/A/bar\";\n\t\t\t\tBfoo_path = mnt_dir_ + \"/B/foo\";\n\t\t\t\tBbar_path = mnt_dir_ + \"/B/bar\";\n\t\t\t\tACfoo_path = mnt_dir_ + \"/A/C/foo\";\n\t\t\t\tACbar_path = mnt_dir_ + \"/A/C/bar\";\n\t\t\t\tint local_checkpoint = 0 ;\n\n\t\t\t\tint fd_foo = cm_->CmOpen(foo_path.c_str() , O_RDWR|O_CREAT , 0777); \n\t\t\t\tif ( fd_foo < 0 ) { \n\t\t\t\t\tcm_->CmClose( fd_foo); \n\t\t\t\t\treturn errno;\n\t\t\t\t}\n\n\n\t\t\t\tif ( WriteData ( fd_foo, 0, 32768) < 0){ \n\t\t\t\t\tcm_->CmClose( fd_foo); \n\t\t\t\t\treturn errno;\n\t\t\t\t}\n\n\n\t\t\t\tif ( fallocate( fd_foo , 0 , 0 , 8192) < 0){ \n\t\t\t\t\tcm_->CmClose( fd_foo);\n\t\t\t\t\t return errno;\n\t\t\t\t}\n\t\t\t\tchar *filep_foo = (char *) cm_->CmMmap(NULL, 8192 + 0, PROT_WRITE|PROT_READ, MAP_SHARED, fd_foo, 0);\n\t\t\t\tif (filep_foo == MAP_FAILED) {\n\t\t\t\t\t return -1;\n\t\t\t\t}\n\n\t\t\t\tint moffset_foo = 0;\n\t\t\t\tint to_write_foo = 8192 ;\n\t\t\t\tconst char *mtext_foo = \"mmmmmmmmmmklmnopqrstuvwxyz123456\";\n\n\t\t\t\twhile (moffset_foo < 8192){\n\t\t\t\t\tif (to_write_foo < 32){\n\t\t\t\t\t\tmemcpy(filep_foo + 0 + moffset_foo, mtext_foo, to_write_foo);\n\t\t\t\t\t\tmoffset_foo += to_write_foo;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tmemcpy(filep_foo + 0 + moffset_foo,mtext_foo, 32);\n\t\t\t\t\t\tmoffset_foo += 32; \n\t\t\t\t\t} \n\t\t\t\t}\n\n\t\t\t\tif ( cm_->CmMsync ( filep_foo + 0, 8192 , MS_SYNC) < 0){\n\t\t\t\t\tcm_->CmMunmap( filep_foo,0 + 8192); \n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tcm_->CmMunmap( filep_foo , 0 + 8192);\n\n\n\t\t\t\tif ( cm_->CmCheckpoint() < 0){ \n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tlocal_checkpoint += 1; \n\t\t\t\tif (local_checkpoint == checkpoint) { \n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\n\t\t\t\tif ( cm_->CmClose ( fd_foo) < 0){ \n\t\t\t\t\treturn errno;\n\t\t\t\t}\n\n return 0;\n }\n \n virtual int check_test( unsigned int last_checkpoint, DataTestResult *test_result) override {\n \n\t\t\t\ttest_path = mnt_dir_ ;\n\t\t\t\tA_path = mnt_dir_ + \"/A\";\n\t\t\t\tAC_path = mnt_dir_ + \"/A/C\";\n\t\t\t\tB_path = mnt_dir_ + \"/B\";\n\t\t\t\tfoo_path = mnt_dir_ + \"/foo\";\n\t\t\t\tbar_path = mnt_dir_ + \"/bar\";\n\t\t\t\tAfoo_path = mnt_dir_ + \"/A/foo\";\n\t\t\t\tAbar_path = mnt_dir_ + \"/A/bar\";\n\t\t\t\tBfoo_path = mnt_dir_ + \"/B/foo\";\n\t\t\t\tBbar_path = mnt_dir_ + \"/B/bar\";\n\t\t\t\tACfoo_path = mnt_dir_ + \"/A/C/foo\";\n\t\t\t\tACbar_path = mnt_dir_ + \"/A/C/bar\";\n return 0;\n }\n \n private:\n \n\t\t\t string test_path; \n\t\t\t string A_path; \n\t\t\t string AC_path; \n\t\t\t string B_path; \n\t\t\t string foo_path; \n\t\t\t string bar_path; \n\t\t\t string Afoo_path; \n\t\t\t string Abar_path; \n\t\t\t string Bfoo_path; \n\t\t\t string Bbar_path; \n\t\t\t string ACfoo_path; \n\t\t\t string ACbar_path; \n \n };\n \n } // namespace tests\n } // namespace fs_testing\n \n extern \"C\" fs_testing::tests::BaseTestCase *test_case_get_instance() {\n return new fs_testing::tests::testName;\n }\n \n extern \"C\" void test_case_delete_instance(fs_testing::tests::BaseTestCase *tc) {\n delete tc;\n }\n"} {"text": "//===------------------------ memory.cpp ----------------------------------===//\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#include \"memory\"\n#ifndef _LIBCPP_HAS_NO_THREADS\n#include \"mutex\"\n#include \"thread\"\n#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)\n#pragma comment(lib, \"pthread\")\n#endif\n#endif\n#if !defined(_LIBCPP_HAS_NO_THREADS)\n#include \n#else\n#include \"include/atomic_support.h\"\n#endif\n\n_LIBCPP_BEGIN_NAMESPACE_STD\n\nconst allocator_arg_t allocator_arg = allocator_arg_t();\n\nbad_weak_ptr::~bad_weak_ptr() _NOEXCEPT {}\n\nconst char*\nbad_weak_ptr::what() const _NOEXCEPT\n{\n return \"bad_weak_ptr\";\n}\n\n__shared_count::~__shared_count()\n{\n}\n\n__shared_weak_count::~__shared_weak_count()\n{\n}\n\n#if defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)\nvoid\n__shared_count::__add_shared() _NOEXCEPT\n{\n#ifdef _LIBCPP_HAS_NO_THREADS\n __libcpp_atomic_refcount_increment(__shared_owners_);\n#else\n ++__shared_owners_;\n#endif\n}\n\nbool\n__shared_count::__release_shared() _NOEXCEPT\n{\n#ifdef _LIBCPP_HAS_NO_THREADS\n if (__libcpp_atomic_refcount_decrement(__shared_owners_) == -1)\n#else\n if (--__shared_owners_ == -1)\n#endif\n {\n __on_zero_shared();\n return true;\n }\n return false;\n}\n\nvoid\n__shared_weak_count::__add_shared() _NOEXCEPT\n{\n __shared_count::__add_shared();\n}\n\nvoid\n__shared_weak_count::__add_weak() _NOEXCEPT\n{\n#ifdef _LIBCPP_HAS_NO_THREADS\n __libcpp_atomic_refcount_increment(__shared_weak_owners_);\n#else\n ++__shared_weak_owners_;\n#endif\n}\n\nvoid\n__shared_weak_count::__release_shared() _NOEXCEPT\n{\n if (__shared_count::__release_shared())\n __release_weak();\n}\n\n#endif // _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS\n\nvoid\n__shared_weak_count::__release_weak() _NOEXCEPT\n{\n // NOTE: The acquire load here is an optimization of the very\n // common case where a shared pointer is being destructed while\n // having no other contended references.\n //\n // BENEFIT: We avoid expensive atomic stores like XADD and STREX\n // in a common case. Those instructions are slow and do nasty\n // things to caches.\n //\n // IS THIS SAFE? Yes. During weak destruction, if we see that we\n // are the last reference, we know that no-one else is accessing\n // us. If someone were accessing us, then they would be doing so\n // while the last shared / weak_ptr was being destructed, and\n // that's undefined anyway.\n //\n // If we see anything other than a 0, then we have possible\n // contention, and need to use an atomicrmw primitive.\n // The same arguments don't apply for increment, where it is legal\n // (though inadvisable) to share shared_ptr references between\n // threads, and have them all get copied at once. The argument\n // also doesn't apply for __release_shared, because an outstanding\n // weak_ptr::lock() could read / modify the shared count.\n#ifdef _LIBCPP_HAS_NO_THREADS\n if (__libcpp_atomic_load(&__shared_weak_owners_, _AO_Acquire) == 0)\n#else\n if (__shared_weak_owners_.load(memory_order_acquire) == 0)\n#endif\n {\n // no need to do this store, because we are about\n // to destroy everything.\n //__libcpp_atomic_store(&__shared_weak_owners_, -1, _AO_Release);\n __on_zero_shared_weak();\n }\n#ifdef _LIBCPP_HAS_NO_THREADS\n else if (__libcpp_atomic_refcount_decrement(__shared_weak_owners_) == -1)\n#else\n else if (--__shared_weak_owners_ == -1)\n#endif\n __on_zero_shared_weak();\n}\n\n__shared_weak_count*\n__shared_weak_count::lock() _NOEXCEPT\n{\n#ifdef _LIBCPP_HAS_NO_THREADS\n long object_owners = __libcpp_atomic_load(&__shared_owners_);\n#else\n long object_owners = __shared_owners_.load();\n#endif\n while (object_owners != -1)\n {\n#ifdef _LIBCPP_HAS_NO_THREADS\n if (__libcpp_atomic_compare_exchange(&__shared_owners_,\n &object_owners,\n object_owners+1))\n#else\n if (__shared_owners_.compare_exchange_weak(object_owners, object_owners+1))\n#endif\n return this;\n }\n return nullptr;\n}\n\n#if !defined(_LIBCPP_NO_RTTI) || !defined(_LIBCPP_BUILD_STATIC)\n\nconst void*\n__shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT\n{\n return nullptr;\n}\n\n#endif // _LIBCPP_NO_RTTI\n\n#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)\n\n_LIBCPP_SAFE_STATIC static const std::size_t __sp_mut_count = 16;\n_LIBCPP_SAFE_STATIC static __libcpp_mutex_t mut_back[__sp_mut_count] =\n{\n _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER,\n _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER,\n _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER,\n _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER\n};\n\n_LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) _NOEXCEPT\n : __lx(p)\n{\n}\n\nvoid\n__sp_mut::lock() _NOEXCEPT\n{\n auto m = static_cast<__libcpp_mutex_t*>(__lx);\n unsigned count = 0;\n while (!__libcpp_mutex_trylock(m))\n {\n if (++count > 16)\n {\n __libcpp_mutex_lock(m);\n break;\n }\n this_thread::yield();\n }\n}\n\nvoid\n__sp_mut::unlock() _NOEXCEPT\n{\n __libcpp_mutex_unlock(static_cast<__libcpp_mutex_t*>(__lx));\n}\n\n__sp_mut&\n__get_sp_mut(const void* p)\n{\n static __sp_mut muts[__sp_mut_count]\n {\n &mut_back[ 0], &mut_back[ 1], &mut_back[ 2], &mut_back[ 3],\n &mut_back[ 4], &mut_back[ 5], &mut_back[ 6], &mut_back[ 7],\n &mut_back[ 8], &mut_back[ 9], &mut_back[10], &mut_back[11],\n &mut_back[12], &mut_back[13], &mut_back[14], &mut_back[15]\n };\n return muts[hash()(p) & (__sp_mut_count-1)];\n}\n\n#endif // !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)\n\nvoid\ndeclare_reachable(void*)\n{\n}\n\nvoid\ndeclare_no_pointers(char*, size_t)\n{\n}\n\nvoid\nundeclare_no_pointers(char*, size_t)\n{\n}\n\n#if !defined(_LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE)\npointer_safety get_pointer_safety() _NOEXCEPT\n{\n return pointer_safety::relaxed;\n}\n#endif\n\nvoid*\n__undeclare_reachable(void* p)\n{\n return p;\n}\n\nvoid*\nalign(size_t alignment, size_t size, void*& ptr, size_t& space)\n{\n void* r = nullptr;\n if (size <= space)\n {\n char* p1 = static_cast(ptr);\n char* p2 = reinterpret_cast(reinterpret_cast(p1 + (alignment - 1)) & -alignment);\n size_t d = static_cast(p2 - p1);\n if (d <= space - size)\n {\n r = p2;\n ptr = r;\n space -= d;\n }\n }\n return r;\n}\n\n_LIBCPP_END_NAMESPACE_STD\n"} {"text": "// This file declares the IPersistFolder Interface and Gateway for Python.\n// Generated by makegw.py\n// ---------------------------------------------------\n//\n// Interface Declaration\n\n// The shlwapi.h included with MSVC6 does not have this interface.\n// A default Microsoft SDK does not provide an updated shlwapi.h file\n// (even though the SDK on mhammond's machine does!). Rather than\n// try and figure out these header versions, just copy the interface\n// definition here.\n// #include \"shlwapi.h\"\n\n// *** - start of shlwapi.h clone\nenum {\n ASSOCF_INIT_NOREMAPCLSID = 0x00000001, // do not remap clsids to progids\n ASSOCF_INIT_BYEXENAME = 0x00000002, // executable is being passed in\n ASSOCF_OPEN_BYEXENAME = 0x00000002, // executable is being passed in\n ASSOCF_INIT_DEFAULTTOSTAR = 0x00000004, // treat \"*\" as the BaseClass\n ASSOCF_INIT_DEFAULTTOFOLDER = 0x00000008, // treat \"Folder\" as the BaseClass\n ASSOCF_NOUSERSETTINGS = 0x00000010, // dont use HKCU\n ASSOCF_NOTRUNCATE = 0x00000020, // dont truncate the return string\n ASSOCF_VERIFY = 0x00000040, // verify data is accurate (DISK HITS)\n ASSOCF_REMAPRUNDLL = 0x00000080, // actually gets info about rundlls target if applicable\n ASSOCF_NOFIXUPS = 0x00000100, // attempt to fix errors if found\n ASSOCF_IGNOREBASECLASS = 0x00000200, // dont recurse into the baseclass\n};\ntypedef DWORD ASSOCF;\n#define LWSTDAPI STDAPI\ntypedef enum {} ASSOCSTR;\ntypedef enum {} ASSOCKEY;\ntypedef enum {} ASSOCDATA;\ntypedef enum {} ASSOCENUM;\n#undef INTERFACE\n#define INTERFACE IQueryAssociations\n\nDECLARE_INTERFACE_(IQueryAssociations, IUnknown)\n{\n // IUnknown methods\n STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;\n STDMETHOD_(ULONG, AddRef)(THIS) PURE;\n STDMETHOD_(ULONG, Release)(THIS) PURE;\n\n // IQueryAssociations methods\n STDMETHOD(Init)(THIS_ ASSOCF flags, LPCWSTR pszAssoc, HKEY hkProgid, HWND hwnd) PURE;\n STDMETHOD(GetString)(THIS_ ASSOCF flags, ASSOCSTR str, LPCWSTR pszExtra, LPWSTR pszOut, DWORD * pcchOut) PURE;\n STDMETHOD(GetKey)(THIS_ ASSOCF flags, ASSOCKEY key, LPCWSTR pszExtra, HKEY * phkeyOut) PURE;\n STDMETHOD(GetData)(THIS_ ASSOCF flags, ASSOCDATA data, LPCWSTR pszExtra, LPVOID pvOut, DWORD * pcbOut) PURE;\n STDMETHOD(GetEnum)(THIS_ ASSOCF flags, ASSOCENUM assocenum, LPCWSTR pszExtra, REFIID riid, LPVOID * ppvOut) PURE;\n};\n\nLWSTDAPI AssocCreate(CLSID clsid, REFIID riid, LPVOID *ppv);\n// *** - end of shlwapi.h clone\n\nclass PyIQueryAssociations : public PyIUnknown {\n public:\n MAKE_PYCOM_CTOR(PyIQueryAssociations);\n static IQueryAssociations *GetI(PyObject *self);\n static PyComTypeObject type;\n\n // The Python methods\n static PyObject *Init(PyObject *self, PyObject *args);\n static PyObject *GetKey(PyObject *self, PyObject *args);\n static PyObject *GetString(PyObject *self, PyObject *args);\n\n protected:\n PyIQueryAssociations(IUnknown *pdisp);\n ~PyIQueryAssociations();\n};\n"} {"text": "namespace weka.filters.unsupervised.attribute;\n\nclass AddCluster\n{\n isA UnsupervisedFilter,OptionHandler;\n isA Filter;\n depend java.io.File;\n depend java.io.FileInputStream;\n depend java.io.FileNotFoundException;\n depend java.io.ObjectInputStream;\n depend java.util.ArrayList;\n depend java.util.Enumeration;\n depend java.util.Vector;\n depend weka.clusterers.AbstractClusterer;\n depend weka.clusterers.Clusterer;\n depend weka.core.Attribute;\n depend weka.core.Capabilities;\n depend weka.core.DenseInstance;\n depend weka.core.Instance;\n depend weka.core.Instances;\n depend weka.core.Option;\n depend weka.core.OptionHandler;\n depend weka.core.Range;\n depend weka.core.RevisionUtils;\n depend weka.core.SparseInstance;\n depend weka.core.Utils;\n depend weka.core.WekaException;\n depend weka.filters.Filter;\n depend weka.filters.UnsupervisedFilter;\n/** \n * for serialization. \n */\nstatic final long serialVersionUID=7414280611943807337L;\n\r\n/** \n * The clusterer used to do the cleansing. \n */\nprotected Clusterer m_Clusterer=new weka.clusterers.SimpleKMeans();\n\r\n/** \n * The file from which to load a serialized clusterer. \n */\nprotected File m_SerializedClustererFile=new File(System.getProperty(\"user.dir\"));\n\r\n/** \n * The actual clusterer used to do the clustering. \n */\nprotected Clusterer m_ActualClusterer=null;\n\r\n/** \n * Range of attributes to ignore. \n */\nprotected Range m_IgnoreAttributesRange=null;\n\r\n/** \n * Filter for removing attributes. \n */\nprotected Filter m_removeAttributes=new Remove();\n\r\n/** \n * Returns the Capabilities of this filter, makes sure that the class is never set (for the clusterer).\n * @param data the data to use for customization\n * @return the capabilities of this object, based on the data\n * @see #getCapabilities()\n */\n@Override public Capabilities getCapabilities(Instances data){\n Instances newData;\n newData=new Instances(data,0);\n newData.setClassIndex(-1);\n return super.getCapabilities(newData);\n}\n\r\n/** \n * Returns the Capabilities of this filter.\n * @return the capabilities of this object\n * @see Capabilities\n */\n@Override public Capabilities getCapabilities(){\n Capabilities result=m_Clusterer.getCapabilities();\n result.enableAllClasses();\n result.setMinimumNumberInstances(0);\n return result;\n}\n\r\n/** \n * tests the data whether the filter can actually handle it.\n * @param instanceInfo the data to test\n * @throws Exception if the test fails\n */\n@Override protected void testInputFormat(Instances instanceInfo) throws Exception {\n getCapabilities(instanceInfo).testWithFail(removeIgnored(instanceInfo));\n}\n\r\n/** \n * Sets the format of the input instances.\n * @param instanceInfo an Instances object containing the input instancestructure (any instances contained in the object are ignored - only the structure is required).\n * @return true if the outputFormat may be collected immediately\n * @throws Exception if the inputFormat can't be set successfully\n */\n@Override public boolean setInputFormat(Instances instanceInfo) throws Exception {\n super.setInputFormat(instanceInfo);\n m_removeAttributes=null;\n return false;\n}\n\r\n/** \n * filters all attributes that should be ignored.\n * @param data the data to filter\n * @return the filtered data\n * @throws Exception if filtering fails\n */\nprotected Instances removeIgnored(Instances data) throws Exception {\n Instances result=data;\n if (m_IgnoreAttributesRange != null || data.classIndex() >= 0) {\n m_removeAttributes=new Remove();\n String rangeString=\"\";\n if (m_IgnoreAttributesRange != null) {\n rangeString+=m_IgnoreAttributesRange.getRanges();\n }\n if (data.classIndex() >= 0) {\n if (rangeString.length() > 0) {\n rangeString+=\",\" + (data.classIndex() + 1);\n }\n else {\n rangeString=\"\" + (data.classIndex() + 1);\n }\n }\n ((Remove)m_removeAttributes).setAttributeIndices(rangeString);\n ((Remove)m_removeAttributes).setInvertSelection(false);\n m_removeAttributes.setInputFormat(data);\n result=Filter.useFilter(data,m_removeAttributes);\n }\n return result;\n}\n\r\n/** \n * Signify that this batch of input to the filter is finished.\n * @return true if there are instances pending output\n * @throws IllegalStateException if no input structure has been defined\n */\n@Override public boolean batchFinished() throws Exception {\n if (getInputFormat() == null) {\n throw new IllegalStateException(\"No input instance format defined\");\n }\n Instances toFilter=getInputFormat();\n if (!isFirstBatchDone()) {\n Instances toFilterIgnoringAttributes=removeIgnored(toFilter);\n File file=getSerializedClustererFile();\n if (!file.isDirectory()) {\n ObjectInputStream ois=new ObjectInputStream(new FileInputStream(file));\n m_ActualClusterer=(Clusterer)ois.readObject();\n Instances header=null;\n try {\n header=(Instances)ois.readObject();\n }\n catch ( Exception e) {\n }\n ois.close();\n if ((header != null) && (!header.equalHeaders(toFilterIgnoringAttributes))) {\n throw new WekaException(\"Training header of clusterer and filter dataset don't match:\\n\" + header.equalHeadersMsg(toFilterIgnoringAttributes));\n }\n }\n else {\n m_ActualClusterer=AbstractClusterer.makeCopy(m_Clusterer);\n m_ActualClusterer.buildClusterer(toFilterIgnoringAttributes);\n }\n Instances filtered=new Instances(toFilter,0);\n ArrayList nominal_values=new ArrayList(m_ActualClusterer.numberOfClusters());\n for (int i=0; i < m_ActualClusterer.numberOfClusters(); i++) {\n nominal_values.add(\"cluster\" + (i + 1));\n }\n filtered.insertAttributeAt(new Attribute(\"cluster\",nominal_values),filtered.numAttributes());\n setOutputFormat(filtered);\n }\n for (int i=0; i < toFilter.numInstances(); i++) {\n convertInstance(toFilter.instance(i));\n }\n flushInput();\n m_NewBatch=true;\n m_FirstBatchDone=true;\n return (numPendingOutput() != 0);\n}\n\r\n/** \n * Input an instance for filtering. Ordinarily the instance is processed and made available for output immediately. Some filters require all instances be read before producing output.\n * @param instance the input instance\n * @return true if the filtered instance may now be collected with output().\n * @throws IllegalStateException if no input format has been defined.\n */\n@Override public boolean input(Instance instance) throws Exception {\n if (getInputFormat() == null) {\n throw new IllegalStateException(\"No input instance format defined\");\n }\n if (m_NewBatch) {\n resetQueue();\n m_NewBatch=false;\n }\n if (outputFormatPeek() != null) {\n convertInstance(instance);\n return true;\n }\n bufferInput(instance);\n return false;\n}\n\r\n/** \n * Convert a single instance over. The converted instance is added to the end of the output queue.\n * @param instance the instance to convert\n * @throws Exception if something goes wrong\n */\nprotected void convertInstance(Instance instance) throws Exception {\n Instance original, processed;\n original=instance;\n double[] instanceVals=new double[instance.numAttributes() + 1];\n for (int j=0; j < instance.numAttributes(); j++) {\n instanceVals[j]=original.value(j);\n }\n Instance filteredI=null;\n if (m_removeAttributes != null) {\n m_removeAttributes.input(instance);\n filteredI=m_removeAttributes.output();\n }\n else {\n filteredI=instance;\n }\n try {\n instanceVals[instance.numAttributes()]=m_ActualClusterer.clusterInstance(filteredI);\n }\n catch ( Exception e) {\n instanceVals[instance.numAttributes()]=Utils.missingValue();\n }\n if (original instanceof SparseInstance) {\n processed=new SparseInstance(original.weight(),instanceVals);\n }\n else {\n processed=new DenseInstance(original.weight(),instanceVals);\n }\n processed.setDataset(instance.dataset());\n copyValues(processed,false,instance.dataset(),getOutputFormat());\n processed.setDataset(getOutputFormat());\n push(processed);\n}\n\r\n/** \n * Returns an enumeration describing the available options.\n * @return an enumeration of all the available options.\n */\n@Override public Enumeration