diff --git "a/train/github-29-87204935.jsonl" "b/train/github-29-87204935.jsonl" new file mode 100644--- /dev/null +++ "b/train/github-29-87204935.jsonl" @@ -0,0 +1,725 @@ +{"text": "# List of the ChibiOS/RT Cortex-M0 LPC43xx port files.\r\nPORTSRC = $(CHIBIOS)/os/ports/GCC/ARMCMx/crt0.c \\\r\n $(CHIBIOS_PORTAPACK)/os/ports/GCC/ARMCMx/LPC43xx_M0/vectors.c \\\r\n ${CHIBIOS}/os/ports/GCC/ARMCMx/chcore.c \\\r\n ${CHIBIOS}/os/ports/GCC/ARMCMx/chcore_v6m.c \\\r\n ${CHIBIOS}/os/ports/common/ARMCMx/nvic.c\r\n\r\nPORTASM =\r\n\r\nPORTINC = ${CHIBIOS}/os/ports/common/ARMCMx/CMSIS/include \\\r\n ${CHIBIOS}/os/ports/common/ARMCMx \\\r\n ${CHIBIOS}/os/ports/GCC/ARMCMx \\\r\n ${CHIBIOS_PORTAPACK}/os/ports/GCC/ARMCMx/LPC43xx_M0\r\n\r\nPORTLD = ${CHIBIOS_PORTAPACK}/os/ports/GCC/ARMCMx/LPC43xx_M0/ld\r\n"} +{"text": "/**\n * Copyright (c) 2005-2013 by Appcelerator, Inc. All Rights Reserved.\n * Licensed under the terms of the Eclipse Public License (EPL).\n * Please see the license.txt included with this distribution for details.\n * Any modifications to this file must keep this entire header intact.\n */\npackage org.python.pydev.parser.fastparser;\n\nimport junit.framework.TestCase;\n\nimport org.eclipse.jface.text.Document;\nimport org.eclipse.jface.text.Region;\nimport org.python.pydev.shared_core.parsing.Scopes;\n\n/**\n * @author fabioz\n *\n */\npublic class ScopesParserTest extends TestCase {\n\n public static void main(String[] args) {\n try {\n ScopesParserTest test = new ScopesParserTest();\n test.setUp();\n test.testScopes4();\n test.tearDown();\n junit.textui.TestRunner.run(ScopesParserTest.class);\n\n } catch (Throwable e) {\n e.printStackTrace();\n }\n }\n\n public void testScopes() throws Exception {\n Document doc = new Document(\"\" +\n \"#comment\\n\" +\n \"class Foo(object):\\n\" +\n \" def method(self, a=(10,20)):\\n\"\n +\n \" '''\\n\" +\n \" multi string\\n\" +\n \" '''\\n\");\n Scopes scopes = new ScopesParser().createScopes(doc);\n assertEquals(\"\" +\n \"[1 [2 #comment 2]\\n\" +\n \"[4 class Foo([3 object 3]):\\n\"\n +\n \" [5 [8 def method([6 self, a=([7 10,20 7]) 6]):\\n\" +\n \" [9 [10 '''\\n\"\n +\n \" multi string\\n\" +\n \" ''' 10]\\n\" +\n \" 4] 5] 8] 9] 1]\" +\n \"\", scopes.debugString(doc)\n .toString());\n }\n\n public void testScopes2() throws Exception {\n Document doc = new Document(\"a().o\");\n Scopes scopes = new ScopesParser().createScopes(doc);\n assertEquals(new Region(0, 5), scopes.getScopeForSelection(2, 0));\n }\n\n public void testScopes4() throws Exception {\n Document doc = new Document(\"(1\\n\" +\n \"\\n\" +\n \"class Bar(object):\\n\" +\n \" call\" +\n \"\");\n Scopes scopes = new ScopesParser().createScopes(doc);\n assertEquals(\"\" +\n \"[1 (1\\n\" +\n \"\\n\" +\n \"[3 class Bar([2 object 2]):\\n\" +\n \" [4 call 3] 4] 1]\" +\n \"\", scopes\n .debugString(doc).toString());\n }\n\n public void testScopes3() throws Exception {\n Document doc = new Document(\"a(.o\");\n Scopes scopes = new ScopesParser().createScopes(doc);\n assertEquals(new Region(0, 4), scopes.getScopeForSelection(2, 0));\n }\n\n public void testScopes1() throws Exception {\n Document doc = new Document(\"\" +\n \"#comment\\n\" +\n \"class Foo(object):\\n\"\n +\n \" def method(self, a=(bb,(cc,dd))):\\n\" +\n \" '''\\n\" +\n \" multi string\\n\" +\n \" '''\\n\"\n +\n \"class Class2:\\n\" +\n \" if True:\\n\" +\n \" a = \\\\\\n\" +\n \"xx\\n\" +\n \" else:\\n\" +\n \" pass\");\n Scopes scopes = new ScopesParser().createScopes(doc);\n assertEquals(\"\" +\n \"[1 [2 #comment 2]\\n\" +\n \"[4 class Foo([3 object 3]):\\n\"\n +\n \" [5 [9 def method([6 self, a=([7 bb,([8 cc,dd 8]) 7]) 6]):\\n\" +\n \" [10 [11 '''\\n\"\n +\n \" multi string\\n\" +\n \" ''' 4] 5] 9] 10] 11]\\n\" +\n \"[12 class Class2:\\n\"\n +\n \" [13 [14 if True:\\n\" +\n \" [15 a = \\\\\\n\" +\n \"xx 14] 15]\\n\" +\n \" [16 else:\\n\"\n +\n \" [17 pass 12] 13] 16] 17] 1]\" +\n \"\", scopes.debugString(doc).toString());\n\n assertEquals(new Region(0, 8), scopes.getScopeForSelection(0, 2));\n assertEquals(new Region(19, 6), scopes.getScopeForSelection(20, 0));\n }\n}\n"} +{"text": "require('../../modules/es6.string.blink');\nmodule.exports = require('../../modules/_core').String.blink;\n"} +{"text": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport FormGroup from '../components/FormGroup';\nimport withUniqueId from '../hocs/withUniqueId';\nimport { fileRecordPropType } from '../types';\nimport prettyPrintBytes from '../utils/prettyPrintBytes';\n\nclass FileInput extends Component {\n static propTypes = {\n id: PropTypes.string.isRequired,\n label: PropTypes.node,\n name: PropTypes.string,\n value: fileRecordPropType,\n accept: PropTypes.string,\n defaultText: PropTypes.node,\n disabled: PropTypes.bool,\n buttonText: PropTypes.node,\n validator: PropTypes.func,\n onChange: PropTypes.func,\n onLoad: PropTypes.func,\n isValidFileType: PropTypes.func\n };\n\n static defaultProps = {\n label: 'File',\n defaultText: 'Select file...',\n disabled: false,\n buttonText: 'Browse...',\n validator: () => ({ valid: true }),\n onChange: () => {},\n onLoad: () => {},\n isValidFileType: () => true\n };\n\n constructor(props) {\n super(props);\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n handleChange(e) {\n if (!(window.File && window.FileReader)) {\n console.error(\n 'The File APIs are not fully supported in this browser.'\n );\n\n return;\n }\n\n const { name, onChange, onLoad, isValidFileType } = this.props;\n\n const file = e.target.files[0];\n\n if (!file) {\n console.error(\n 'No file was uploaded.'\n );\n\n return;\n }\n\n if (!isValidFileType(file.type)) {\n console.error(\n 'Invalid file type.'\n );\n\n return;\n }\n\n onChange(name, {\n url: '',\n file: file\n });\n\n const reader = new FileReader();\n\n reader.addEventListener('load', (e) => {\n onLoad(name, {\n url: e.target.result,\n file: file\n });\n });\n\n reader.readAsDataURL(file);\n }\n\n render () {\n const {\n id,\n label,\n name,\n value,\n accept,\n defaultText,\n disabled,\n buttonText,\n validator\n } = this.props;\n\n const { valid, feedback } = validator(value);\n const feedbackId = feedback ? `${id}-feedback` : null;\n\n const file = value && value.file || null;\n\n return (\n \n \n\n
\n \n\n
\n \n\n
\n {buttonText}\n
\n
\n
\n
\n );\n }\n}\n\nexport default withUniqueId(FileInput);\n"} +{"text": "#!/usr/bin/perl\n\nuse strict;\nuse Test::More tests => 1;\nuse FindBin qw($Bin);\nuse lib \"$Bin/lib\";\nuse MemcachedTest;\n\nmy $server = new_memcached('-B binary');\nmy $sock = $server->sock;\n\n$SIG{ALRM} = sub { die \"alarm\\n\" };\nalarm(2);\nprint $sock \"Here's a bunch of garbage that doesn't look like the bin prot.\";\nmy $rv = <$sock>;\nok(1, \"Either the above worked and quit, or hung forever.\");\n"} +{"text": "/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/**\n * @constructor\n */\nWebInspector.FileMapping = function()\n{\n this._mappingEntriesSetting = WebInspector.settings.createSetting(\"fileMappingEntries\", []);\n /** @type {Array.} */\n this._entries = [];\n this._loadFromSettings();\n}\n\nWebInspector.FileMapping.prototype = {\n /**\n * @param {string} url\n * @return {?WebInspector.FileMapping.Entry}\n */\n mappingEntryForURL: function(url)\n {\n for (var i = 0; i < this._entries.length; ++i) {\n var entry = this._entries[i];\n if (url.startsWith(entry.urlPrefix))\n return entry;\n }\n return null;\n },\n\n /**\n * @param {string} path\n * @return {?WebInspector.FileMapping.Entry}\n */\n mappingEntryForPath: function(path)\n {\n for (var i = 0; i < this._entries.length; ++i) {\n var entry = this._entries[i];\n if (path.startsWith(entry.pathPrefix))\n return entry;\n }\n return null;\n },\n\n /**\n * @return {Array.}\n */\n mappingEntries: function()\n {\n return this._entries.slice();\n },\n\n /**\n * @param {Array.} mappingEntries\n */\n setMappingEntries: function(mappingEntries)\n {\n this._entries = mappingEntries;\n this._mappingEntriesSetting.set(mappingEntries);\n },\n\n _loadFromSettings: function()\n {\n var savedEntries = this._mappingEntriesSetting.get();\n this._entries = [];\n for (var i = 0; i < savedEntries.length; ++i) {\n var entry = new WebInspector.FileMapping.Entry(savedEntries[i].urlPrefix, savedEntries[i].pathPrefix);\n this._entries.push(entry);\n }\n },\n\n __proto__: WebInspector.Object.prototype\n}\n\n/**\n * @constructor\n * @param {string} urlPrefix\n * @param {string} pathPrefix\n */\nWebInspector.FileMapping.Entry = function(urlPrefix, pathPrefix)\n{\n this.urlPrefix = urlPrefix;\n this.pathPrefix = pathPrefix;\n}\n\n/**\n * @type {?WebInspector.FileMapping}\n */\nWebInspector.fileMapping = null;\n"} +{"text": "\r\n\r\n\r\n \r\n B. wysoka jakość dźwięku\r\n Wysoka jakość dźwięku\r\n Oszczędność baterii\r\n \r\n \r\n Początkujący\r\n Standardowy\r\n Zaawansowany\r\n \r\n \r\n Normalny\r\n Kompatybilny\r\n \r\n \r\n Delikatna\r\n Poziom 1\r\n Poziom 2\r\n Poziom 3\r\n Poziom 4\r\n Poziom 5\r\n Poziom 6\r\n Poziom 7\r\n Mocna\r\n \r\n \r\n Delikatna\r\n Poziom 1\r\n Poziom 2\r\n Poziom 3\r\n Poziom 4\r\n Poziom 5\r\n Poziom 6\r\n Poziom 7\r\n Poziom 8\r\n Poziom 9\r\n Mocna\r\n \r\n \r\n 0 procent\r\n 5 procent\r\n 10 procent\r\n 15 procent\r\n 20 procent\r\n 25 procent\r\n 30 procent\r\n 35 procent\r\n 40 procent\r\n 45 procent\r\n 50 procent\r\n 55 procent\r\n 60 procent\r\n 70 procent\r\n 80 procent\r\n \r\n \r\n 25 m2\r\n 36 m2\r\n 49 m2\r\n 64 m2\r\n 81 m2\r\n 100 m2\r\n 121 m2\r\n 203 m2\r\n 347 m2\r\n 652 m2\r\n 1200 m2\r\n \r\n \r\n 5 m\r\n 6 m\r\n 7 m\r\n 8 m\r\n 9 m\r\n 10 m\r\n 11 m\r\n 14 m\r\n 19 m\r\n 26 m\r\n 36 m\r\n \r\n \r\n 0 procent\r\n 10 procent\r\n 20 procent\r\n 30 procent\r\n 40 procent\r\n 50 procent\r\n 60 procent\r\n 70 procent\r\n 80 procent\r\n 90 procent\r\n 100 procent\r\n \r\n \r\n Delikatny\r\n Umiarkowany\r\n Mocny\r\n \r\n \r\n Poziom 1\r\n Poziom 2\r\n Poziom 3\r\n Poziom 4\r\n Poziom 5\r\n \r\n \r\n Delikatna\r\n Umiarkowana\r\n Mocna\r\n \r\n \r\n Delikatna\r\n Umiarkowana\r\n Mocna\r\n \r\n \r\n 1x\r\n 2x\r\n 3x\r\n 4x\r\n 5x\r\n 6x\r\n 7x\r\n 8x\r\n 9x\r\n 10x\r\n Inf\r\n \r\n \r\n 0 dB\r\n 3.5 dB\r\n 6.0 dB\r\n 9.5 dB\r\n 12.0 dB\r\n 14.0 dB\r\n 18.0 dB\r\n 20.0 dB\r\n \r\n \r\n 0 dB\r\n -1.0 dB\r\n -1.9 dB\r\n -3.0 dB\r\n -6.0 dB\r\n -10.5 dB\r\n \r\n \r\n 6.0 dB\r\n 5.6 dB\r\n 5.1 dB\r\n 4.6 dB\r\n 4.1 dB\r\n 3.5 dB\r\n 2.9 dB\r\n 2.3 dB\r\n 1.6 dB\r\n 0.8 dB\r\n 0 dB\r\n -1.0 dB\r\n -1.9 dB\r\n -3.0 dB\r\n -4.4 dB\r\n -6.0 dB\r\n -8.0 dB\r\n -10.5 dB\r\n -14.0 dB\r\n -20.0 dB\r\n -26.0 dB\r\n -40.0 dB\r\n \r\n \r\n 0 procent\r\n 1 procent\r\n 2 procent\r\n 3 procent\r\n 4 procent\r\n 5 procent\r\n 6 procent\r\n 7 procent\r\n 8 procent\r\n 9 procent\r\n 10 procent\r\n 12 procent\r\n 14 procent\r\n 16 procent\r\n 18 procent\r\n 20 procent\r\n 22 procent\r\n 24 procent\r\n 26 procent\r\n 28 procent\r\n 30 procent\r\n 33 procent\r\n 36 procent\r\n 40 procent\r\n 45 procent\r\n 50 procent\r\n 55 procent\r\n 60 procent\r\n 70 procent\r\n 80 procent\r\n 90 procent\r\n 100 procent\r\n \r\n \r\n Nauszne z mocnym basem (v2)\r\n Nauszne wysokiej klasy (v2)\r\n Nauszne uniwersalne (v2)\r\n Nauszne niskiej klasy (v2)\r\n Douszne uniwersalne (v2)\r\n Nauszne z mocnym basem (v1)\r\n Nauszne wysokiej klasy (v1)\r\n Nauszne uniwersalne (v1)\r\n Douszne uniwersalne (v1)\r\n Douszne Apple\r\n Douszne Monster\r\n Douszne Motoroli\r\n Douszne Philips\r\n Philips SHP 2000\r\n Philips SHP 9000\r\n Nieznany typ I\r\n Nieznany typ II\r\n Nieznany typ III\r\n Nieznany typ IV\r\n \r\n \r\n Naturalny Bas\r\n Czysty Bas+\r\n Subwoofer\r\n \r\n \r\n 30 Hz\r\n 40 Hz\r\n 50 Hz\r\n 60 Hz\r\n 66 Hz\r\n 78 Hz\r\n 80 Hz\r\n 100 Hz\r\n \r\n \r\n 3.5 dB\r\n 6.0 dB\r\n 8.0 dB\r\n 10.0 dB\r\n 11.0 dB\r\n 12.0 dB\r\n 13.0 dB\r\n 14.0 dB\r\n 14.8 dB\r\n 15.6 dB\r\n 16.3 dB\r\n 17.0 dB\r\n \r\n \r\n Naturalna\r\n OZone+\r\n XHiFi\r\n \r\n \r\n Domyślnie\r\n 3.5 dB\r\n 6.0 dB\r\n 8.0 dB\r\n 10.0 dB\r\n 11.0 dB\r\n 12.0 dB\r\n 13.0 dB\r\n 14.0 dB\r\n 14.8 dB\r\n \r\n \r\n 100 Hz\r\n 140 Hz\r\n 180 Hz\r\n 200 Hz\r\n 220 Hz\r\n \r\n \r\n 3000 Hz\r\n 4000 Hz\r\n 5000 Hz\r\n 6000 Hz\r\n 7000 Hz\r\n 8000 Hz\r\n \r\n\r\n\r\n"} +{"text": "HTML.Doctype\nTYPE: string/null\nDEFAULT: NULL\n--DESCRIPTION--\nDoctype to use during filtering. Technically speaking this is not actually\na doctype (as it does not identify a corresponding DTD), but we are using\nthis name for sake of simplicity. When non-blank, this will override any\nolder directives like %HTML.XHTML or %HTML.Strict.\n--ALLOWED--\n'HTML 4.01 Transitional', 'HTML 4.01 Strict', 'XHTML 1.0 Transitional', 'XHTML 1.0 Strict', 'XHTML 1.1'\n--# vim: et sw=4 sts=4\n"} +{"text": "/*\n * Copyright 2013-2018 consulo.io\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage consulo.unity3d.packages;\n\nimport com.google.gson.Gson;\nimport com.intellij.openapi.project.Project;\nimport com.intellij.openapi.util.Comparing;\nimport com.intellij.psi.util.CachedValueProvider;\nimport com.intellij.psi.util.CachedValuesManager;\nimport com.intellij.psi.util.PsiModificationTracker;\nimport consulo.logging.Logger;\n\nimport javax.annotation.Nonnull;\nimport java.io.Reader;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\n\n/**\n * @author VISTALL\n * @since 2018-09-19\n */\npublic class Unity3dManifest\n{\n\tprivate static final Logger LOG = Logger.getInstance(Unity3dManifest.class);\n\n\tprivate static final Unity3dManifest EMPTY = new Unity3dManifest();\n\n\t@Nonnull\n\tpublic static Unity3dManifest parse(@Nonnull Project project)\n\t{\n\t\treturn CachedValuesManager.getManager(project).getCachedValue(project, () ->\n\t\t{\n\t\t\tPath projectPath = Paths.get(project.getBasePath());\n\t\t\tPath manifestJson = projectPath.resolve(Paths.get(\"Packages\", \"manifest.json\"));\n\t\t\tif(Files.exists(manifestJson))\n\t\t\t{\n\t\t\t\tGson gson = new Gson();\n\t\t\t\ttry (Reader reader = Files.newBufferedReader(manifestJson))\n\t\t\t\t{\n\t\t\t\t\treturn CachedValueProvider.Result.create(gson.fromJson(reader, Unity3dManifest.class), PsiModificationTracker.MODIFICATION_COUNT);\n\t\t\t\t}\n\t\t\t\tcatch(Exception e)\n\t\t\t\t{\n\t\t\t\t\tLOG.error(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn CachedValueProvider.Result.create(EMPTY, PsiModificationTracker.MODIFICATION_COUNT);\n\t\t});\n\t}\n\n\tprivate Map dependencies = Collections.emptyMap();\n\n\tpublic boolean isExcluded(@Nonnull String id)\n\t{\n\t\treturn Comparing.equal(dependencies.get(id), \"excluded\");\n\t}\n\n\t@Nonnull\n\tpublic Map getFilteredDependencies()\n\t{\n\t\tif(dependencies.isEmpty())\n\t\t{\n\t\t\treturn Collections.emptyMap();\n\t\t}\n\t\tMap map = new LinkedHashMap<>();\n\t\tfor(Map.Entry entry : dependencies.entrySet())\n\t\t{\n\t\t\tif(\"excluded\".equals(entry.getValue()))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tmap.put(entry.getKey(), entry.getValue());\n\t\t}\n\t\treturn map;\n\t}\n}\n"} +{"text": "package yaml\n\nconst (\n\t// The size of the input raw buffer.\n\tinput_raw_buffer_size = 512\n\n\t// The size of the input buffer.\n\t// It should be possible to decode the whole raw buffer.\n\tinput_buffer_size = input_raw_buffer_size * 3\n\n\t// The size of the output buffer.\n\toutput_buffer_size = 128\n\n\t// The size of the output raw buffer.\n\t// It should be possible to encode the whole output buffer.\n\toutput_raw_buffer_size = (output_buffer_size*2 + 2)\n\n\t// The size of other stacks and queues.\n\tinitial_stack_size = 16\n\tinitial_queue_size = 16\n\tinitial_string_size = 16\n)\n\n// Check if the character at the specified position is an alphabetical\n// character, a digit, '_', or '-'.\nfunc is_alpha(b []byte, i int) bool {\n\treturn b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'Z' || b[i] >= 'a' && b[i] <= 'z' || b[i] == '_' || b[i] == '-'\n}\n\n// Check if the character at the specified position is a digit.\nfunc is_digit(b []byte, i int) bool {\n\treturn b[i] >= '0' && b[i] <= '9'\n}\n\n// Get the value of a digit.\nfunc as_digit(b []byte, i int) int {\n\treturn int(b[i]) - '0'\n}\n\n// Check if the character at the specified position is a hex-digit.\nfunc is_hex(b []byte, i int) bool {\n\treturn b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'F' || b[i] >= 'a' && b[i] <= 'f'\n}\n\n// Get the value of a hex-digit.\nfunc as_hex(b []byte, i int) int {\n\tbi := b[i]\n\tif bi >= 'A' && bi <= 'F' {\n\t\treturn int(bi) - 'A' + 10\n\t}\n\tif bi >= 'a' && bi <= 'f' {\n\t\treturn int(bi) - 'a' + 10\n\t}\n\treturn int(bi) - '0'\n}\n\n// Check if the character is ASCII.\nfunc is_ascii(b []byte, i int) bool {\n\treturn b[i] <= 0x7F\n}\n\n// Check if the character at the start of the buffer can be printed unescaped.\nfunc is_printable(b []byte, i int) bool {\n\treturn ((b[i] == 0x0A) || // . == #x0A\n\t\t(b[i] >= 0x20 && b[i] <= 0x7E) || // #x20 <= . <= #x7E\n\t\t(b[i] == 0xC2 && b[i+1] >= 0xA0) || // #0xA0 <= . <= #xD7FF\n\t\t(b[i] > 0xC2 && b[i] < 0xED) ||\n\t\t(b[i] == 0xED && b[i+1] < 0xA0) ||\n\t\t(b[i] == 0xEE) ||\n\t\t(b[i] == 0xEF && // #xE000 <= . <= #xFFFD\n\t\t\t!(b[i+1] == 0xBB && b[i+2] == 0xBF) && // && . != #xFEFF\n\t\t\t!(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF))))\n}\n\n// Check if the character at the specified position is NUL.\nfunc is_z(b []byte, i int) bool {\n\treturn b[i] == 0x00\n}\n\n// Check if the beginning of the buffer is a BOM.\nfunc is_bom(b []byte, i int) bool {\n\treturn b[0] == 0xEF && b[1] == 0xBB && b[2] == 0xBF\n}\n\n// Check if the character at the specified position is space.\nfunc is_space(b []byte, i int) bool {\n\treturn b[i] == ' '\n}\n\n// Check if the character at the specified position is tab.\nfunc is_tab(b []byte, i int) bool {\n\treturn b[i] == '\\t'\n}\n\n// Check if the character at the specified position is blank (space or tab).\nfunc is_blank(b []byte, i int) bool {\n\t//return is_space(b, i) || is_tab(b, i)\n\treturn b[i] == ' ' || b[i] == '\\t'\n}\n\n// Check if the character at the specified position is a line break.\nfunc is_break(b []byte, i int) bool {\n\treturn (b[i] == '\\r' || // CR (#xD)\n\t\tb[i] == '\\n' || // LF (#xA)\n\t\tb[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9) // PS (#x2029)\n}\n\nfunc is_crlf(b []byte, i int) bool {\n\treturn b[i] == '\\r' && b[i+1] == '\\n'\n}\n\n// Check if the character is a line break or NUL.\nfunc is_breakz(b []byte, i int) bool {\n\t//return is_break(b, i) || is_z(b, i)\n\treturn ( // is_break:\n\tb[i] == '\\r' || // CR (#xD)\n\t\tb[i] == '\\n' || // LF (#xA)\n\t\tb[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)\n\t\t// is_z:\n\t\tb[i] == 0)\n}\n\n// Check if the character is a line break, space, or NUL.\nfunc is_spacez(b []byte, i int) bool {\n\t//return is_space(b, i) || is_breakz(b, i)\n\treturn ( // is_space:\n\tb[i] == ' ' ||\n\t\t// is_breakz:\n\t\tb[i] == '\\r' || // CR (#xD)\n\t\tb[i] == '\\n' || // LF (#xA)\n\t\tb[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)\n\t\tb[i] == 0)\n}\n\n// Check if the character is a line break, space, tab, or NUL.\nfunc is_blankz(b []byte, i int) bool {\n\t//return is_blank(b, i) || is_breakz(b, i)\n\treturn ( // is_blank:\n\tb[i] == ' ' || b[i] == '\\t' ||\n\t\t// is_breakz:\n\t\tb[i] == '\\r' || // CR (#xD)\n\t\tb[i] == '\\n' || // LF (#xA)\n\t\tb[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)\n\t\tb[i] == 0)\n}\n\n// Determine the width of the character.\nfunc width(b byte) int {\n\t// Don't replace these by a switch without first\n\t// confirming that it is being inlined.\n\tif b&0x80 == 0x00 {\n\t\treturn 1\n\t}\n\tif b&0xE0 == 0xC0 {\n\t\treturn 2\n\t}\n\tif b&0xF0 == 0xE0 {\n\t\treturn 3\n\t}\n\tif b&0xF8 == 0xF0 {\n\t\treturn 4\n\t}\n\treturn 0\n\n}\n"} +{"text": "\n\n\n\n
\n\t
\n\t\t

\n
\n \n \n

套餐{$comboTab.$key}

\n \n

套餐{$comboTab.$key}

\n \n \n
\n

\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{$goods.goods_name|truncate:28}
\n\t\t\t\t\t\t\t\t{$goods.shop_price}
套餐基本件
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{$goods_list.goods_name|truncate:28}
\n\t\t\t\t\t\t\t\t{$goods_list.fittings_price_ori}
搭配省{$goods_list.spare_price}
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\t\t套餐价:¥0.00元 × \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t立即购买\n\t\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t
\n
\n
\n\n\n"} +{"text": "/* global document */\n( function( document ) {\n \"use strict\";\n var root;\n var stepids = [];\n\n // Get stepids from the steps under impress root\n var getSteps = function() {\n stepids = [];\n var steps = root.querySelectorAll( \".step\" );\n for ( var i = 0; i < steps.length; i++ )\n {\n stepids[ i + 1 ] = steps[ i ].id;\n }\n };\n\n // Wait for impress.js to be initialized\n document.addEventListener( \"impress:init\", function( event ) {\n root = event.target;\n getSteps();\n var gc = event.detail.api.lib.gc;\n gc.pushCallback( function() {\n stepids = [];\n if ( progressbar ) {\n progressbar.style.width = \"\";\n }\n if ( progress ) {\n progress.innerHTML = \"\";\n }\n } );\n } );\n\n var progressbar = document.querySelector( \"div.impress-progressbar div\" );\n var progress = document.querySelector( \"div.impress-progress\" );\n\n if ( null !== progressbar || null !== progress ) {\n document.addEventListener( \"impress:stepleave\", function( event ) {\n updateProgressbar( event.detail.next.id );\n } );\n\n document.addEventListener( \"impress:steprefresh\", function( event ) {\n getSteps();\n updateProgressbar( event.target.id );\n } );\n\n }\n\n function updateProgressbar( slideId ) {\n var slideNumber = stepids.indexOf( slideId );\n if ( null !== progressbar ) {\n var width = 100 / ( stepids.length - 1 ) * ( slideNumber );\n progressbar.style.width = width.toFixed( 2 ) + \"%\";\n }\n if ( null !== progress ) {\n progress.innerHTML = slideNumber + \"/\" + ( stepids.length - 1 );\n }\n }\n} )( document );\n"} +{"text": "..\n **************************************************\n * *\n * Automatically generated file, do not edit! *\n * *\n **************************************************\n\n.. _amdgpu_synid9_data_smem_atomic64:\n\nsdata\n===========================\n\nInput data for an atomic instruction.\n\nOptionally may serve as an output data:\n\n* If :ref:`glc` is specified, gets the memory value before the operation.\n\n*Size:* 2 dwords.\n\n*Operands:* :ref:`s`, :ref:`flat_scratch`, :ref:`xnack`, :ref:`vcc`, :ref:`ttmp`\n"} +{"text": "authenticate:\n idp:\n provider: REPLACEME\n url: REPLACEME\n clientID: REPLACEME\n clientSecret: REPLACEME\n\nconfig:\n rootDomain: localhost.pomerium.io\n sharedSecret: R0+XRoGVpcoi4PfB8tMlvnrS5XUasO+D1frAEdYcYjs=\n cookieSecret: FLPCOQKigK5EQnyXlBhchl5fgzNKqi3ubtvOGt477Dg=\n generateTLS: true\n policy:\n - from: https://hello.localhost.pomerium.io\n to: http://hello-nginx\n allowed_domains:\n - gmail.com\ningress:\n annotations:\n traefik.ingress.kubernetes.io/router.tls: \"true\"\n secretName: wildcard-tls\nforwardAuth:\n enabled: true\n internal: true\n"} +{"text": "\"\"\"\nViewing Stanford 3D Scanning Repository dragon model\n\"\"\"\n# Copyright (c) 2014-2020, Enthought, Inc.\n# Standard library imports\nimport os\nfrom os.path import join\n\n# Enthought library imports\nfrom mayavi import mlab\n\n### Download the dragon data, if not already on disk ############################\nif not os.path.exists('dragon.tar.gz'):\n # Download the data\n try:\n from urllib import urlopen\n except ImportError:\n from urllib.request import urlopen\n print(\"Downloading dragon model, Please Wait (11MB)\")\n opener = urlopen(\n 'http://graphics.stanford.edu/pub/3Dscanrep/dragon/dragon_recon.tar.gz')\n open('dragon.tar.gz', 'wb').write(opener.read())\n\n# Extract the data\nimport tarfile\ndragon_tar_file = tarfile.open('dragon.tar.gz')\ntry:\n os.mkdir('dragon_data')\nexcept:\n pass\ndragon_tar_file.extractall('dragon_data')\ndragon_tar_file.close()\n\n# Path to the dragon ply file\ndragon_ply_file = join('dragon_data', 'dragon_recon', 'dragon_vrip.ply')\n\n# Render the dragon ply file\nmlab.pipeline.surface(mlab.pipeline.open(dragon_ply_file))\nmlab.show()\n\nimport shutil\nshutil.rmtree('dragon_data')\n"} +{"text": "# Copyright (C) 2018 The NeoVintageous Team (NeoVintageous).\n#\n# This file is part of NeoVintageous.\n#\n# NeoVintageous 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# NeoVintageous 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 NeoVintageous. If not, see .\n\nimport os\n\nfrom NeoVintageous.tests import unittest\n\nfrom NeoVintageous.nv.settings import get_cmdline_cwd\nfrom NeoVintageous.nv.settings import set_cmdline_cwd\n\n\nclass TestCmdlineCwd(unittest.ViewTestCase):\n\n @unittest.mock.patch('NeoVintageous.nv.settings.active_window')\n @unittest.mock.patch.dict('NeoVintageous.nv.session._session', clear=True)\n def test_returns_cwd(self, active_window, *args):\n active_window.return_value = None\n self.assertEqual(get_cmdline_cwd(), os.getcwd())\n\n @unittest.mock.patch('sublime.Window.extract_variables')\n @unittest.mock.patch.dict('NeoVintageous.nv.session._session', clear=True)\n def test_returns_cwd_when_no_folder_variable_found(self, extract_variables):\n extract_variables.return_value = {}\n self.assertEqual(get_cmdline_cwd(), os.getcwd())\n\n @unittest.mock.patch('sublime.Window.extract_variables')\n @unittest.mock.patch.dict('NeoVintageous.nv.session._session', clear=True)\n def test_returns_cwd_folder_variable(self, extract_variables):\n extract_variables.return_value = {'folder': '/tmp/folder'}\n self.assertEqual(get_cmdline_cwd(), '/tmp/folder')\n\n def test_returns_set_cwd(self):\n set_cmdline_cwd('/tmp/fizz')\n self.assertEqual(get_cmdline_cwd(), '/tmp/fizz')\n"} +{"text": "# OpenSesame help\n\n*This is the offline help page. If you are connected to the Internet,\nyou can find the online documentation at .*\n\n## Introduction\n\nOpenSesame is a graphical experiment builder for the social sciences. With OpenSesame you can easily create experiments using a point-and-click graphical interface. For complex tasks, OpenSesame supports [Python] scripting.\n\n## Getting started\n\nThe best way to get started is by walking through a tutorial. Tutorials, and much more, can be found online:\n\n- \n\n## Citation\n\nTo cite OpenSesame in your work, please use the following reference:\n\n- Mathôt, S., Schreij, D., & Theeuwes, J. (2012). OpenSesame: An open-source, graphical experiment builder for the social sciences. *Behavior Research Methods*, *44*(2), 314-324. doi:[10.3758/s13428-011-0168-7](http://dx.doi.org/10.3758/s13428-011-0168-7)\n\n## Interface\n\nThe graphical interface has the following components. You can get\ncontext-sensitive help by clicking on the help icons at the top-right of\neach tab.\n\n- The *menu* (at the top of the window) shows common options, such as opening and saving files, closing the program, and showing this help page.\n- The *main toolbar* (the big buttons below the menu) offers a selection of the most relevant options from the menu.\n- The *item toolbar* (the big buttons on the left of the window) shows available items. To add an item to your experiment, drag it from the item toolbar onto the overview area.\n- The *overview area* (Control + \\\\) shows a tree-like overview of your experiment.\n- The *tab area* contains the tabs for editing items. If you click on an item in the overview area, a corresponding tab opens in the tab area. Help is displayed in the tab area as well.\n- The [file pool](opensesame://help.pool) (Control + P) shows files that are bundled with your experiment.\n- The [variable inspector](opensesame://help.extension.variable_inspector) (Control + I) shows all detected variables.\n- The [debug window](opensesame://help.stdout). (Control + D) is an [IPython] terminal. Everything that your experiment prints to the standard output (i.e. using `print()`) is shown here.\n\n## Items\n\nItems are the building blocks of your experiment. Ten core items provide basic functionality for creating an experiment. To add items to your experiment, drag them from the item toolbar into the overview area.\n\n- The [loop](opensesame://help.loop) item runs another item multiple times. You can also define independent variables in the LOOP item.\n- The [sequence](opensesame://help.sequence) item runs multiple other items in sequence.\n- The [sketchpad](opensesame://help.sketchpad) item presents visual stimuli. Built-in drawing tools allow you to easily create stimulus displays.\n- The [feedback](opensesame://help.feedback) item is similar to the `sketchpad`, but is not prepared in advance. Therefore, FEEDBACK items can be used to provide feedback to participants.\n- The [sampler](opensesame://help.sampler) item plays a single sound file.\n- The [synth](opensesame://help.synth) item generates a single sound.\n- The [keyboard_response](opensesame://help.keyboard_response) item collects key-press responses.\n- The [mouse_response](opensesame://help.mouse_response) item collects mouse-click responses.\n- The [logger](opensesame://help.logger) item writes variables to the log file.\n- The [inline_script](opensesame://help.inline_script) embeds Python code in your experiment.\n\nIf installed, plug-in items provide additional functionality. Plug-ins appear alongside the core items in the item toolbar.\n\n## Running your experiment\n\nYou can run your experiment in:\n\n- Full-screen mode (*Control+R* or *Run -> Run fullscreen*)\n- Window mode (*Control+W* or *Run -> Run in window*)\n- Quick-run mode (*Control+Shift+W* or *Run -> Quick run*)\n\nIn quick-run mode, the experiments starts immediately in a window, using log file `quickrun.csv`, and subject number 999. This is useful during development.\n\n[python]: http://www.python.org/\n[ipython]: http://www.ipython.org/\n"} +{"text": "0.3.0\n"} +{"text": "/*\n # This file is part of libkd.\n # Licensed under a 3-clause BSD style license - see LICENSE\n */\n\n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \"cutest.h\"\n\n#include \"dualtree_nearestneighbour.h\"\n#include \"mathutil.h\"\n#include \"tic.h\"\n\nvoid test_nn_1(CuTest* tc) {\n //int NX = 5000;\n //int NY = 6000;\n //double maxr2 = 0.01;\n\n int NX = 8;\n int NY = 10;\n double maxr2 = 0.5;\n\n int D = 3;\n int Nleaf = 5;\n\n int i, j;\n\n kdtree_t* xkd;\n kdtree_t* ykd;\n\n double* xdata;\n double* ydata;\n\n double* nearest_d2 = NULL;\n int* nearest_ind = NULL;\n\n double* true_nearest_d2;\n int* true_nearest_ind;\n\n double t0;\n\n srand(0);\n\n xdata = malloc(NX * D * sizeof(double));\n ydata = malloc(NY * D * sizeof(double));\n\n for (i=0; i<(NX*D); i++)\n xdata[i] = rand() / (double)RAND_MAX;\n for (i=0; i<(NY*D); i++)\n ydata[i] = rand() / (double)RAND_MAX;\n\n true_nearest_d2 = malloc(NY * sizeof(double));\n true_nearest_ind = malloc(NY * sizeof(int));\n t0 = timenow();\n for (j=0; j(?[\\\\d.]+)-[\\\\d]+)\\\\.win32\",\r\n \"url\": \"https://sourceforge.net/projects/smartmontools/files/smartmontools/\"\r\n },\r\n \"autoupdate\": {\r\n \"url\": \"https://downloads.sourceforge.net/project/smartmontools/smartmontools/$matchShort/smartmontools-$version.win32-setup.exe\"\r\n }\r\n}\r\n"} +{"text": "/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n *\n * ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code, released\n * March 31, 1998.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either of the GNU General Public License Version 2 or later (the \"GPL\"),\n * or the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n#ifndef jsstr_h___\n#define jsstr_h___\n/*\n * JS string type implementation.\n *\n * A JS string is a counted array of unicode characters. To support handoff\n * of API client memory, the chars are allocated separately from the length,\n * necessitating a pointer after the count, to form a separately allocated\n * string descriptor. String descriptors are GC'ed, while their chars are\n * allocated from the malloc heap.\n */\n#include \n#include \"jspubtd.h\"\n#include \"jsprvtd.h\"\n\nJS_BEGIN_EXTERN_C\n\n/*\n * The GC-thing \"string\" type.\n *\n * When the JSSTRFLAG_DEPENDENT bit of the length field is unset, the u.chars\n * field points to a flat character array owned by its GC-thing descriptor.\n * The array is terminated at index length by a zero character and the size of\n * the array in bytes is (length + 1) * sizeof(jschar). The terminator is\n * purely a backstop, in case the chars pointer flows out to native code that\n * requires \\u0000 termination.\n *\n * A flat string with JSSTRFLAG_MUTABLE set means that the string is accessible\n * only from one thread and it is possible to turn it into a dependent string\n * of the same length to optimize js_ConcatStrings. It is also possible to grow\n * such a string, but extreme care must be taken to ensure that no other code\n * relies on the original length of the string.\n *\n * A flat string with JSSTRFLAG_ATOMIZED set means that the string is hashed as\n * an atom. This flag is used to avoid re-hashing the already-atomized string.\n *\n * When JSSTRFLAG_DEPENDENT is set, the string depends on characters of another\n * string strongly referenced by the u.base field. The base member may point to\n * another dependent string if JSSTRING_CHARS has not been called yet.\n *\n * JSSTRFLAG_PREFIX determines the kind of the dependent string. When the flag\n * is unset, the length field encodes both starting position relative to the\n * base string and the number of characters in the dependent string, see\n * JSSTRDEP_START_MASK and JSSTRDEP_LENGTH_MASK macros below for details.\n *\n * When JSSTRFLAG_PREFIX is set, the dependent string is a prefix of the base\n * string. The number of characters in the prefix is encoded using all non-flag\n * bits of the length field and spans the same 0 .. SIZE_T_MAX/4 range as the\n * length of the flat string.\n *\n * NB: Always use the JSSTRING_LENGTH and JSSTRING_CHARS accessor macros.\n */\nstruct JSString {\n size_t length;\n union {\n jschar *chars;\n JSString *base;\n } u;\n};\n\n/*\n * Definitions for flags stored in the high order bits of JSString.length.\n * JSSTRFLAG_PREFIX and JSSTRFLAG_MUTABLE are two aliases for the same value.\n * JSSTRFLAG_PREFIX should be used only if JSSTRFLAG_DEPENDENT is set and\n * JSSTRFLAG_MUTABLE should be used only if the string is flat.\n * JSSTRFLAG_ATOMIZED is used only with the flat immutable strings.\n */\n#define JSSTRFLAG_DEPENDENT JSSTRING_BIT(JS_BITS_PER_WORD - 1)\n#define JSSTRFLAG_PREFIX JSSTRING_BIT(JS_BITS_PER_WORD - 2)\n#define JSSTRFLAG_MUTABLE JSSTRFLAG_PREFIX\n#define JSSTRFLAG_ATOMIZED JSSTRING_BIT(JS_BITS_PER_WORD - 3)\n\n#define JSSTRING_LENGTH_BITS (JS_BITS_PER_WORD - 3)\n#define JSSTRING_LENGTH_MASK JSSTRING_BITMASK(JSSTRING_LENGTH_BITS)\n\n/* Universal JSString type inquiry and accessor macros. */\n#define JSSTRING_BIT(n) ((size_t)1 << (n))\n#define JSSTRING_BITMASK(n) (JSSTRING_BIT(n) - 1)\n#define JSSTRING_HAS_FLAG(str,flg) ((str)->length & (flg))\n#define JSSTRING_IS_DEPENDENT(str) JSSTRING_HAS_FLAG(str, JSSTRFLAG_DEPENDENT)\n#define JSSTRING_IS_FLAT(str) (!JSSTRING_IS_DEPENDENT(str))\n#define JSSTRING_IS_MUTABLE(str) (((str)->length & (JSSTRFLAG_DEPENDENT | \\\n JSSTRFLAG_MUTABLE)) == \\\n JSSTRFLAG_MUTABLE)\n#define JSSTRING_IS_ATOMIZED(str) (((str)->length & (JSSTRFLAG_DEPENDENT | \\\n JSSTRFLAG_ATOMIZED)) ==\\\n JSSTRFLAG_ATOMIZED)\n\n#define JSSTRING_CHARS(str) (JSSTRING_IS_DEPENDENT(str) \\\n ? JSSTRDEP_CHARS(str) \\\n : JSFLATSTR_CHARS(str))\n#define JSSTRING_LENGTH(str) (JSSTRING_IS_DEPENDENT(str) \\\n ? JSSTRDEP_LENGTH(str) \\\n : JSFLATSTR_LENGTH(str))\n\n#define JSSTRING_CHARS_AND_LENGTH(str, chars_, length_) \\\n ((void)(JSSTRING_IS_DEPENDENT(str) \\\n ? ((length_) = JSSTRDEP_LENGTH(str), \\\n (chars_) = JSSTRDEP_CHARS(str)) \\\n : ((length_) = JSFLATSTR_LENGTH(str), \\\n (chars_) = JSFLATSTR_CHARS(str))))\n\n#define JSSTRING_CHARS_AND_END(str, chars_, end) \\\n ((void)((end) = JSSTRING_IS_DEPENDENT(str) \\\n ? JSSTRDEP_LENGTH(str) + ((chars_) = JSSTRDEP_CHARS(str)) \\\n : JSFLATSTR_LENGTH(str) + ((chars_) = JSFLATSTR_CHARS(str))))\n\n/* Specific flat string initializer and accessor macros. */\n#define JSFLATSTR_INIT(str, chars_, length_) \\\n ((void)(JS_ASSERT(((length_) & ~JSSTRING_LENGTH_MASK) == 0), \\\n (str)->length = (length_), (str)->u.chars = (chars_)))\n\n#define JSFLATSTR_LENGTH(str) \\\n (JS_ASSERT(JSSTRING_IS_FLAT(str)), (str)->length & JSSTRING_LENGTH_MASK)\n\n#define JSFLATSTR_CHARS(str) \\\n (JS_ASSERT(JSSTRING_IS_FLAT(str)), (str)->u.chars)\n\n/*\n * Macros to manipulate atomized and mutable flags of flat strings. It is safe\n * to use these without extra locking due to the following properties:\n *\n * * We do not have a macro like JSFLATSTR_CLEAR_ATOMIZED as a string\n * remains atomized until the GC collects it.\n *\n * * A thread may call JSFLATSTR_SET_MUTABLE only when it is the only thread\n * accessing the string until a later call to JSFLATSTR_CLEAR_MUTABLE.\n *\n * * Multiple threads can call JSFLATSTR_CLEAR_MUTABLE but the macro\n * actually clears the mutable flag only when the flag is set -- in which\n * case only one thread can access the string (see previous property).\n *\n * Thus, when multiple threads access the string, JSFLATSTR_SET_ATOMIZED is\n * the only macro that can update the length field of the string by changing\n * the mutable bit from 0 to 1. We call the macro only after the string has\n * been hashed. When some threads in js_ValueToStringId see that the flag is\n * set, it knows that the string was atomized.\n *\n * On the other hand, if the thread sees that the flag is unset, it could be\n * seeing a stale value when another thread has just atomized the string and\n * set the flag. But this can lead only to an extra call to js_AtomizeString.\n * This function would find that the string was already hashed and return it\n * with the atomized bit set.\n */\n#define JSFLATSTR_SET_ATOMIZED(str) \\\n ((void)(JS_ASSERT(JSSTRING_IS_FLAT(str) && !JSSTRING_IS_MUTABLE(str)), \\\n (str)->length |= JSSTRFLAG_ATOMIZED))\n\n#define JSFLATSTR_SET_MUTABLE(str) \\\n ((void)(JS_ASSERT(JSSTRING_IS_FLAT(str) && !JSSTRING_IS_ATOMIZED(str)), \\\n (str)->length |= JSSTRFLAG_MUTABLE))\n\n#define JSFLATSTR_CLEAR_MUTABLE(str) \\\n ((void)(JS_ASSERT(JSSTRING_IS_FLAT(str)), \\\n JSSTRING_HAS_FLAG(str, JSSTRFLAG_MUTABLE) && \\\n ((str)->length &= ~JSSTRFLAG_MUTABLE)))\n\n/* Specific dependent string shift/mask accessor and mutator macros. */\n#define JSSTRDEP_START_BITS (JSSTRING_LENGTH_BITS-JSSTRDEP_LENGTH_BITS)\n#define JSSTRDEP_START_SHIFT JSSTRDEP_LENGTH_BITS\n#define JSSTRDEP_START_MASK JSSTRING_BITMASK(JSSTRDEP_START_BITS)\n#define JSSTRDEP_LENGTH_BITS (JSSTRING_LENGTH_BITS / 2)\n#define JSSTRDEP_LENGTH_MASK JSSTRING_BITMASK(JSSTRDEP_LENGTH_BITS)\n\n#define JSSTRDEP_IS_PREFIX(str) JSSTRING_HAS_FLAG(str, JSSTRFLAG_PREFIX)\n\n#define JSSTRDEP_START(str) (JSSTRDEP_IS_PREFIX(str) ? 0 \\\n : (((str)->length \\\n >> JSSTRDEP_START_SHIFT) \\\n & JSSTRDEP_START_MASK))\n#define JSSTRDEP_LENGTH(str) ((str)->length \\\n & (JSSTRDEP_IS_PREFIX(str) \\\n ? JSSTRING_LENGTH_MASK \\\n : JSSTRDEP_LENGTH_MASK))\n\n#define JSSTRDEP_INIT(str,bstr,off,len) \\\n ((str)->length = JSSTRFLAG_DEPENDENT \\\n | ((off) << JSSTRDEP_START_SHIFT) \\\n | (len), \\\n (str)->u.base = (bstr))\n\n#define JSPREFIX_INIT(str,bstr,len) \\\n ((str)->length = JSSTRFLAG_DEPENDENT | JSSTRFLAG_PREFIX | (len), \\\n (str)->u.base = (bstr))\n\n#define JSSTRDEP_BASE(str) ((str)->u.base)\n#define JSPREFIX_BASE(str) JSSTRDEP_BASE(str)\n#define JSPREFIX_SET_BASE(str,bstr) ((str)->u.base = (bstr))\n\n#define JSSTRDEP_CHARS(str) \\\n (JSSTRING_IS_DEPENDENT(JSSTRDEP_BASE(str)) \\\n ? js_GetDependentStringChars(str) \\\n : JSFLATSTR_CHARS(JSSTRDEP_BASE(str)) + JSSTRDEP_START(str))\n\nextern size_t\njs_MinimizeDependentStrings(JSString *str, int level, JSString **basep);\n\nextern jschar *\njs_GetDependentStringChars(JSString *str);\n\nextern const jschar *\njs_GetStringChars(JSContext *cx, JSString *str);\n\nextern JSString * JS_FASTCALL\njs_ConcatStrings(JSContext *cx, JSString *left, JSString *right);\n\nextern const jschar *\njs_UndependString(JSContext *cx, JSString *str);\n\nextern JSBool\njs_MakeStringImmutable(JSContext *cx, JSString *str);\n\nextern JSString* JS_FASTCALL\njs_toLowerCase(JSContext *cx, JSString *str);\n\nextern JSString* JS_FASTCALL\njs_toUpperCase(JSContext *cx, JSString *str);\n\ntypedef struct JSCharBuffer {\n size_t length;\n jschar *chars;\n} JSCharBuffer;\n\nstruct JSSubString {\n size_t length;\n const jschar *chars;\n};\n\nextern jschar js_empty_ucstr[];\nextern JSSubString js_EmptySubString;\n\n/* Unicode character attribute lookup tables. */\nextern const uint8 js_X[];\nextern const uint8 js_Y[];\nextern const uint32 js_A[];\n\n/* Enumerated Unicode general category types. */\ntypedef enum JSCharType {\n JSCT_UNASSIGNED = 0,\n JSCT_UPPERCASE_LETTER = 1,\n JSCT_LOWERCASE_LETTER = 2,\n JSCT_TITLECASE_LETTER = 3,\n JSCT_MODIFIER_LETTER = 4,\n JSCT_OTHER_LETTER = 5,\n JSCT_NON_SPACING_MARK = 6,\n JSCT_ENCLOSING_MARK = 7,\n JSCT_COMBINING_SPACING_MARK = 8,\n JSCT_DECIMAL_DIGIT_NUMBER = 9,\n JSCT_LETTER_NUMBER = 10,\n JSCT_OTHER_NUMBER = 11,\n JSCT_SPACE_SEPARATOR = 12,\n JSCT_LINE_SEPARATOR = 13,\n JSCT_PARAGRAPH_SEPARATOR = 14,\n JSCT_CONTROL = 15,\n JSCT_FORMAT = 16,\n JSCT_PRIVATE_USE = 18,\n JSCT_SURROGATE = 19,\n JSCT_DASH_PUNCTUATION = 20,\n JSCT_START_PUNCTUATION = 21,\n JSCT_END_PUNCTUATION = 22,\n JSCT_CONNECTOR_PUNCTUATION = 23,\n JSCT_OTHER_PUNCTUATION = 24,\n JSCT_MATH_SYMBOL = 25,\n JSCT_CURRENCY_SYMBOL = 26,\n JSCT_MODIFIER_SYMBOL = 27,\n JSCT_OTHER_SYMBOL = 28\n} JSCharType;\n\n/* Character classifying and mapping macros, based on java.lang.Character. */\n#define JS_CCODE(c) (js_A[js_Y[(js_X[(uint16)(c)>>6]<<6)|((c)&0x3F)]])\n#define JS_CTYPE(c) (JS_CCODE(c) & 0x1F)\n\n#define JS_ISALPHA(c) ((((1 << JSCT_UPPERCASE_LETTER) | \\\n (1 << JSCT_LOWERCASE_LETTER) | \\\n (1 << JSCT_TITLECASE_LETTER) | \\\n (1 << JSCT_MODIFIER_LETTER) | \\\n (1 << JSCT_OTHER_LETTER)) \\\n >> JS_CTYPE(c)) & 1)\n\n#define JS_ISALNUM(c) ((((1 << JSCT_UPPERCASE_LETTER) | \\\n (1 << JSCT_LOWERCASE_LETTER) | \\\n (1 << JSCT_TITLECASE_LETTER) | \\\n (1 << JSCT_MODIFIER_LETTER) | \\\n (1 << JSCT_OTHER_LETTER) | \\\n (1 << JSCT_DECIMAL_DIGIT_NUMBER)) \\\n >> JS_CTYPE(c)) & 1)\n\n/* A unicode letter, suitable for use in an identifier. */\n#define JS_ISLETTER(c) ((((1 << JSCT_UPPERCASE_LETTER) | \\\n (1 << JSCT_LOWERCASE_LETTER) | \\\n (1 << JSCT_TITLECASE_LETTER) | \\\n (1 << JSCT_MODIFIER_LETTER) | \\\n (1 << JSCT_OTHER_LETTER) | \\\n (1 << JSCT_LETTER_NUMBER)) \\\n >> JS_CTYPE(c)) & 1)\n\n/*\n * 'IdentifierPart' from ECMA grammar, is Unicode letter or combining mark or\n * digit or connector punctuation.\n */\n#define JS_ISIDPART(c) ((((1 << JSCT_UPPERCASE_LETTER) | \\\n (1 << JSCT_LOWERCASE_LETTER) | \\\n (1 << JSCT_TITLECASE_LETTER) | \\\n (1 << JSCT_MODIFIER_LETTER) | \\\n (1 << JSCT_OTHER_LETTER) | \\\n (1 << JSCT_LETTER_NUMBER) | \\\n (1 << JSCT_NON_SPACING_MARK) | \\\n (1 << JSCT_COMBINING_SPACING_MARK) | \\\n (1 << JSCT_DECIMAL_DIGIT_NUMBER) | \\\n (1 << JSCT_CONNECTOR_PUNCTUATION)) \\\n >> JS_CTYPE(c)) & 1)\n\n/* Unicode control-format characters, ignored in input */\n#define JS_ISFORMAT(c) (((1 << JSCT_FORMAT) >> JS_CTYPE(c)) & 1)\n\n/*\n * Per ECMA-262 15.10.2.6, these characters are the only ones that make up a\n * \"word\", as far as a RegExp is concerned. If we want a Unicode-friendlier\n * definition of \"word\", we should rename this macro to something regexp-y.\n */\n#define JS_ISWORD(c) ((c) < 128 && (isalnum(c) || (c) == '_'))\n\n#define JS_ISIDSTART(c) (JS_ISLETTER(c) || (c) == '_' || (c) == '$')\n#define JS_ISIDENT(c) (JS_ISIDPART(c) || (c) == '_' || (c) == '$')\n\n#define JS_ISXMLSPACE(c) ((c) == ' ' || (c) == '\\t' || (c) == '\\r' || \\\n (c) == '\\n')\n#define JS_ISXMLNSSTART(c) ((JS_CCODE(c) & 0x00000100) || (c) == '_')\n#define JS_ISXMLNS(c) ((JS_CCODE(c) & 0x00000080) || (c) == '.' || \\\n (c) == '-' || (c) == '_')\n#define JS_ISXMLNAMESTART(c) (JS_ISXMLNSSTART(c) || (c) == ':')\n#define JS_ISXMLNAME(c) (JS_ISXMLNS(c) || (c) == ':')\n\n#define JS_ISDIGIT(c) (JS_CTYPE(c) == JSCT_DECIMAL_DIGIT_NUMBER)\n\n/* XXXbe unify on A/X/Y tbls, avoid ctype.h? */\n/* XXXbe fs, etc. ? */\n#define JS_ISSPACE(c) ((JS_CCODE(c) & 0x00070000) == 0x00040000)\n#define JS_ISPRINT(c) ((c) < 128 && isprint(c))\n\n#define JS_ISUPPER(c) (JS_CTYPE(c) == JSCT_UPPERCASE_LETTER)\n#define JS_ISLOWER(c) (JS_CTYPE(c) == JSCT_LOWERCASE_LETTER)\n\n#define JS_TOUPPER(c) ((jschar) ((JS_CCODE(c) & 0x00100000) \\\n ? (c) - ((int32)JS_CCODE(c) >> 22) \\\n : (c)))\n#define JS_TOLOWER(c) ((jschar) ((JS_CCODE(c) & 0x00200000) \\\n ? (c) + ((int32)JS_CCODE(c) >> 22) \\\n : (c)))\n\n/*\n * Shorthands for ASCII (7-bit) decimal and hex conversion.\n * Manually inline isdigit for performance; MSVC doesn't do this for us.\n */\n#define JS7_ISDEC(c) ((((unsigned)(c)) - '0') <= 9)\n#define JS7_UNDEC(c) ((c) - '0')\n#define JS7_ISHEX(c) ((c) < 128 && isxdigit(c))\n#define JS7_UNHEX(c) (uintN)(JS7_ISDEC(c) ? (c) - '0' : 10 + tolower(c) - 'a')\n#define JS7_ISLET(c) ((c) < 128 && isalpha(c))\n\n/* Initialize per-runtime string state for the first context in the runtime. */\nextern JSBool\njs_InitRuntimeStringState(JSContext *cx);\n\nextern JSBool\njs_InitDeflatedStringCache(JSRuntime *rt);\n\n/*\n * Maximum character code for which we will create a pinned unit string on\n * demand -- see JSRuntime.unitStrings in jscntxt.h.\n */\n#define UNIT_STRING_LIMIT 256U\n\n/*\n * Get the independent string containing only character code at index in str\n * (backstopped with a zero character as usual for independent strings).\n */\nextern JSString *\njs_GetUnitString(JSContext *cx, JSString *str, size_t index);\n\n/*\n * Get the independent string containing only the character code c, which must\n * be less than UNIT_STRING_LIMIT.\n */\nextern JSString *\njs_GetUnitStringForChar(JSContext *cx, jschar c);\n\nextern void\njs_FinishUnitStrings(JSRuntime *rt);\n\nextern void\njs_FinishRuntimeStringState(JSContext *cx);\n\nextern void\njs_FinishDeflatedStringCache(JSRuntime *rt);\n\n/* Initialize the String class, returning its prototype object. */\nextern JSClass js_StringClass;\n\nextern JSObject *\njs_InitStringClass(JSContext *cx, JSObject *obj);\n\nextern const char js_escape_str[];\nextern const char js_unescape_str[];\nextern const char js_uneval_str[];\nextern const char js_decodeURI_str[];\nextern const char js_encodeURI_str[];\nextern const char js_decodeURIComponent_str[];\nextern const char js_encodeURIComponent_str[];\n\n/* GC-allocate a string descriptor for the given malloc-allocated chars. */\nextern JSString *\njs_NewString(JSContext *cx, jschar *chars, size_t length);\n\nextern JSString *\njs_NewDependentString(JSContext *cx, JSString *base, size_t start,\n size_t length);\n\n/* Copy a counted string and GC-allocate a descriptor for it. */\nextern JSString *\njs_NewStringCopyN(JSContext *cx, const jschar *s, size_t n);\n\n/* Copy a C string and GC-allocate a descriptor for it. */\nextern JSString *\njs_NewStringCopyZ(JSContext *cx, const jschar *s);\n\n/*\n * Free the chars held by str when it is finalized by the GC. When type is\n * less then zero, it denotes an internal string. Otherwise it denotes the\n * type of the external string allocated with JS_NewExternalString.\n *\n * This function always needs rt but can live with null cx.\n */\nextern void\njs_FinalizeStringRT(JSRuntime *rt, JSString *str, intN type, JSContext *cx);\n\n/*\n * Convert a value to a printable C string.\n */\ntypedef JSString *(*JSValueToStringFun)(JSContext *cx, jsval v);\n\nextern JS_FRIEND_API(const char *)\njs_ValueToPrintable(JSContext *cx, jsval v, JSValueToStringFun v2sfun);\n\n#define js_ValueToPrintableString(cx,v) \\\n js_ValueToPrintable(cx, v, js_ValueToString)\n\n#define js_ValueToPrintableSource(cx,v) \\\n js_ValueToPrintable(cx, v, js_ValueToSource)\n\n/*\n * Convert a value to a string, returning null after reporting an error,\n * otherwise returning a new string reference.\n */\nextern JS_FRIEND_API(JSString *)\njs_ValueToString(JSContext *cx, jsval v);\n\n/*\n * Convert a value to its source expression, returning null after reporting\n * an error, otherwise returning a new string reference.\n */\nextern JS_FRIEND_API(JSString *)\njs_ValueToSource(JSContext *cx, jsval v);\n\n/*\n * Compute a hash function from str. The caller can call this function even if\n * str is not a GC-allocated thing.\n */\nextern uint32\njs_HashString(JSString *str);\n\n/*\n * Test if strings are equal. The caller can call the function even if str1\n * or str2 are not GC-allocated things.\n */\nextern JSBool JS_FASTCALL\njs_EqualStrings(JSString *str1, JSString *str2);\n\n/*\n * Return less than, equal to, or greater than zero depending on whether\n * str1 is less than, equal to, or greater than str2.\n */\nextern int32 JS_FASTCALL\njs_CompareStrings(JSString *str1, JSString *str2);\n\n/*\n * Boyer-Moore-Horspool superlinear search for pat:patlen in text:textlen.\n * The patlen argument must be positive and no greater than BMH_PATLEN_MAX.\n * The start argument tells where in text to begin the search.\n *\n * Return the index of pat in text, or -1 if not found.\n */\n#define BMH_CHARSET_SIZE 256 /* ISO-Latin-1 */\n#define BMH_PATLEN_MAX 255 /* skip table element is uint8 */\n\n#define BMH_BAD_PATTERN (-2) /* return value if pat is not ISO-Latin-1 */\n\nextern jsint\njs_BoyerMooreHorspool(const jschar *text, jsint textlen,\n const jschar *pat, jsint patlen,\n jsint start);\n\nextern size_t\njs_strlen(const jschar *s);\n\nextern jschar *\njs_strchr(const jschar *s, jschar c);\n\nextern jschar *\njs_strchr_limit(const jschar *s, jschar c, const jschar *limit);\n\n#define js_strncpy(t, s, n) memcpy((t), (s), (n) * sizeof(jschar))\n\n/*\n * Return s advanced past any Unicode white space characters.\n */\nextern const jschar *\njs_SkipWhiteSpace(const jschar *s, const jschar *end);\n\n/*\n * Inflate bytes to JS chars and vice versa. Report out of memory via cx\n * and return null on error, otherwise return the jschar or byte vector that\n * was JS_malloc'ed. length is updated with the length of the new string in jschars.\n */\nextern jschar *\njs_InflateString(JSContext *cx, const char *bytes, size_t *length);\n\nextern char *\njs_DeflateString(JSContext *cx, const jschar *chars, size_t length);\n\n/*\n * Inflate bytes to JS chars into a buffer. 'chars' must be large enough for\n * 'length' jschars. The buffer is NOT null-terminated. The destination length\n * must be be initialized with the buffer size and will contain on return the\n * number of copied chars.\n */\nextern JSBool\njs_InflateStringToBuffer(JSContext* cx, const char *bytes, size_t length,\n jschar *chars, size_t* charsLength);\n\n/*\n * Get number of bytes in the deflated sequence of characters.\n */\nextern size_t\njs_GetDeflatedStringLength(JSContext *cx, const jschar *chars,\n size_t charsLength);\n\n/*\n * Deflate JS chars to bytes into a buffer. 'bytes' must be large enough for\n * 'length chars. The buffer is NOT null-terminated. The destination length\n * must to be initialized with the buffer size and will contain on return the\n * number of copied bytes.\n */\nextern JSBool\njs_DeflateStringToBuffer(JSContext* cx, const jschar *chars,\n size_t charsLength, char *bytes, size_t* length);\n\n/*\n * Associate bytes with str in the deflated string cache, returning true on\n * successful association, false on out of memory.\n */\nextern JSBool\njs_SetStringBytes(JSContext *cx, JSString *str, char *bytes, size_t length);\n\n/*\n * Find or create a deflated string cache entry for str that contains its\n * characters chopped from Unicode code points into bytes.\n */\nextern const char *\njs_GetStringBytes(JSContext *cx, JSString *str);\n\n/* Remove a deflated string cache entry associated with str if any. */\nextern void\njs_PurgeDeflatedStringCache(JSRuntime *rt, JSString *str);\n\n/* Export a few natives and a helper to other files in SpiderMonkey. */\nextern JSBool\njs_str_escape(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,\n jsval *rval);\n\nextern JSBool\njs_StringMatchHelper(JSContext *cx, uintN argc, jsval *vp, jsbytecode *pc);\n\nextern JSBool\njs_StringReplaceHelper(JSContext *cx, uintN argc, JSObject *lambda,\n JSString *repstr, jsval *vp);\n\n/*\n * Convert one UCS-4 char and write it into a UTF-8 buffer, which must be at\n * least 6 bytes long. Return the number of UTF-8 bytes of data written.\n */\nextern int\njs_OneUcs4ToUtf8Char(uint8 *utf8Buffer, uint32 ucs4Char);\n\n/*\n * Write str into buffer escaping any non-printable or non-ASCII character.\n * Guarantees that a NUL is at the end of the buffer. Returns the length of\n * the written output, NOT including the NUL. If buffer is null, just returns\n * the length of the output. If quote is not 0, it must be a single or double\n * quote character that will quote the output.\n *\n * The function is only defined for debug builds.\n*/\n#define js_PutEscapedString(buffer, bufferSize, str, quote) \\\n js_PutEscapedStringImpl(buffer, bufferSize, NULL, str, quote)\n\n/*\n * Write str into file escaping any non-printable or non-ASCII character.\n * Returns the number of bytes written to file. If quote is not 0, it must\n * be a single or double quote character that will quote the output.\n *\n * The function is only defined for debug builds.\n*/\n#define js_FileEscapedString(file, str, quote) \\\n (JS_ASSERT(file), js_PutEscapedStringImpl(NULL, 0, file, str, quote))\n\nextern JS_FRIEND_API(size_t)\njs_PutEscapedStringImpl(char *buffer, size_t bufferSize, FILE *fp,\n JSString *str, uint32 quote);\n\nJS_END_EXTERN_C\n\n#endif /* jsstr_h___ */\n"} +{"text": ",\n Tassilo Philipp \n\n Permission to use, copy, modify, and distribute this software for any\n purpose with or without fee is hereby granted, provided that the above\n copyright notice and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n*/\n\n#define d double\nvoid d40(\n d,d,d,d,\n d,d,d,d,\n d,d,d,d,\n d,d,d,d,\n d,d,d,d,\n d,d,d,d,\n d,d,d,d,\n d,d,d,d,\n d,d,d,d,\n d,d,d,d\n);\nvoid t()\n{\n\td40(\n\t0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,\n\t0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19\n\t);\t\n}\n"} +{"text": "// license:BSD-3-Clause\n// copyright-holders:Juergen Buchmueller\n/*****************************************************************************\n *\n * Xerox AltoII cursor task (CURT)\n *\n *****************************************************************************/\n#ifdef ALTO2_DEFINE_CONSTANTS\n\n#else // ALTO2_DEFINE_CONSTANTS\n#ifndef MAME_CPU_ALTO2_A2CURT_H\n#define MAME_CPU_ALTO2_A2CURT_H\n\n//! F2 functions for cursor task\nenum {\n\tf2_curt_load_xpreg = f2_task_10, //!< f2 10: load x position register\n\tf2_curt_load_csr = f2_task_11 //!< f2 11: load cursor shift register\n};\n\nvoid f1_early_curt_block(); //!< f1_curt_block early: disable the cursor task and set the curt_blocks flag\nvoid f2_late_load_xpreg(); //!< f2_load_xpreg late: load the x position register from BUS[6-15]\nvoid f2_late_load_csr(); //!< f2_load_csr late: load the cursor shift register from BUS[0-15]\nvoid activate_curt(); //!< curt_activate: called by the CPU when the cursor task becomes active\nvoid init_curt(int task = task_curt); //!< initialize cursor task\nvoid exit_curt(); //!< deinitialize cursor task\nvoid reset_curt(); //!< reset cursor task\n#endif // MAME_CPU_A2CURT_H\n#endif // ALTO2_DEFINE_CONSTANTS\n"} +{"text": "#!/usr/bin/env bash\n\nset -e\necho \"\" > coverage.txt\n\nfor d in $(go list ./... | grep -v vendor); do\n go test -coverprofile=profile.out -coverpkg=github.com/modern-go/concurrent $d\n if [ -f profile.out ]; then\n cat profile.out >> coverage.txt\n rm profile.out\n fi\ndone\n"} +{"text": "var baseInRange = require('./_baseInRange'),\n toFinite = require('./toFinite'),\n toNumber = require('./toNumber');\n\n/**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\nfunction inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n}\n\nmodule.exports = inRange;\n"} +{"text": "using System.Threading.Tasks;\r\nusing ICSharpCode.CodeConverter.Tests.TestRunners;\r\nusing ICSharpCode.CodeConverter.VB;\r\nusing Xunit;\r\nusing static ICSharpCode.CodeConverter.CommandLine.CodeConvProgram;\r\n\r\nnamespace ICSharpCode.CodeConverter.Tests.VB\r\n{\r\n /// \r\n /// for info on how these tests work.\r\n /// \r\n [Collection(MultiFileTestFixture.Collection)]\r\n public class MultiFileSolutionAndProjectTests\r\n {\r\n private readonly MultiFileTestFixture _multiFileTestFixture;\r\n\r\n public MultiFileSolutionAndProjectTests(MultiFileTestFixture multiFileTestFixture)\r\n {\r\n _multiFileTestFixture = multiFileTestFixture;\r\n }\r\n\r\n [Fact]\r\n public async Task ConvertWholeSolutionAsync()\r\n {\r\n await _multiFileTestFixture.ConvertProjectsWhereAsync(p => true, Language.VB);\r\n }\r\n\r\n [Fact]\r\n public async Task ConvertCSharpConsoleAppOnlyAsync()\r\n {\r\n await _multiFileTestFixture.ConvertProjectsWhereAsync(p => p.Name == \"CSharpConsoleApp\", Language.VB);\r\n }\r\n }\r\n}\r\n"} +{"text": "// -*- c++ -*-\n#ifndef LIBUSB_WRAPPERS_H\n#define LIBUSB_WRAPPERS_H\n\n#include \n#include \n\nclass LIBUSBError : public std::exception {\npublic:\n\tconst libusb_error rawError;\n\n\tLIBUSBError(libusb_error error)\n\t\t: rawError(error)\n\t{}\n\n\tvirtual const char *what() const throw() {\n\t\treturn libusb_error_name(rawError);\n\t}\n};\n\ninline void LIBUSBHandleError(int ret) throw (LIBUSBError) {\n\tlibusb_error rawError = (libusb_error) ret;\n\tthrow LIBUSBError(rawError);\n}\n\ntemplate \ninline T LIBUSBCheckResult(T value) throw (LIBUSBError) {\n\tif (value < 0)\n\t\tLIBUSBHandleError(value);\n\treturn value;\n}\n\nclass USBDevice {\n\tlibusb_device *mDevice;\n\npublic:\n\tUSBDevice()\n\t{\n\t}\n\n\tUSBDevice(libusb_device *dev)\n\t\t: mDevice(dev)\n\t{\n\t\tlibusb_ref_device(mDevice);\n\t}\n\n\tUSBDevice& operator=(const USBDevice& other) {\n\t\tif (other.mDevice == mDevice)\n\t\t\treturn *this;\n\n\t\tif (mDevice)\n\t\t\tlibusb_unref_device(mDevice);\n\n\t\tmDevice = libusb_ref_device(other.mDevice);\n\t\treturn *this;\n\t}\n\n\tvirtual ~USBDevice() {\n\t\tif (mDevice)\n\t\t\tlibusb_unref_device(mDevice);\n\t}\n\n\tUSBDevice(const USBDevice& other)\n\t\t: mDevice(libusb_ref_device(other.mDevice))\n\t{}\n\n\toperator libusb_device*() const {\n\t\treturn mDevice;\n\t}\n};\n\nclass USBDeviceHandle {\n\tlibusb_device_handle *mDeviceHandle;\n\n\tUSBDeviceHandle(libusb_device_handle *handle);\n\npublic:\n\tUSBDeviceHandle(libusb_device *dev) throw (LIBUSBError)\n\t{\n\t\tLIBUSBCheckResult(libusb_open(dev, &mDeviceHandle));\n\t}\n\n\tvirtual ~USBDeviceHandle() {\n\t\tlibusb_close(mDeviceHandle);\n\t}\n\n\toperator libusb_device_handle*() {\n\t\treturn mDeviceHandle;\n\t}\n};\n\n#endif\n"} +{"text": "import torch\nimport torch.nn as nn\n\n\nclass BalanceCrossEntropyLoss(nn.Module):\n '''\n Balanced cross entropy loss.\n Shape:\n - Input: :math:`(N, 1, H, W)`\n - GT: :math:`(N, 1, H, W)`, same shape as the input\n - Mask: :math:`(N, H, W)`, same spatial shape as the input\n - Output: scalar.\n\n Examples::\n\n >>> m = nn.Sigmoid()\n >>> loss = nn.BCELoss()\n >>> input = torch.randn(3, requires_grad=True)\n >>> target = torch.empty(3).random_(2)\n >>> output = loss(m(input), target)\n >>> output.backward()\n '''\n\n def __init__(self, negative_ratio=3.0, eps=1e-6):\n super(BalanceCrossEntropyLoss, self).__init__()\n self.negative_ratio = negative_ratio\n self.eps = eps\n\n def forward(self,\n pred: torch.Tensor,\n gt: torch.Tensor,\n mask: torch.Tensor,\n return_origin=False):\n '''\n Args:\n pred: shape :math:`(N, 1, H, W)`, the prediction of network\n gt: shape :math:`(N, 1, H, W)`, the target\n mask: shape :math:`(N, H, W)`, the mask indicates positive regions\n '''\n positive = (gt * mask).byte()\n negative = ((1 - gt) * mask).byte()\n positive_count = int(positive.float().sum())\n negative_count = min(int(negative.float().sum()),\n int(positive_count * self.negative_ratio))\n loss = nn.functional.binary_cross_entropy(\n pred, gt, reduction='none')[:, 0, :, :]\n positive_loss = loss * positive.float()\n negative_loss = loss * negative.float()\n negative_loss, _ = torch.topk(negative_loss.view(-1), negative_count)\n\n balance_loss = (positive_loss.sum() + negative_loss.sum()) /\\\n (positive_count + negative_count + self.eps)\n\n if return_origin:\n return balance_loss, loss\n return balance_loss\n"} +{"text": "// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights\n// reserved. Use of this source code is governed by a BSD-style license that\n// can be found in the LICENSE file.\n//\n// ---------------------------------------------------------------------------\n//\n// This file was generated by the CEF translator tool. If making changes by\n// hand only do so within the body of existing method and function\n// implementations. See the translator.README.txt file in the tools directory\n// for more information.\n//\n\n#include \"libcef_dll/ctocpp/auth_callback_ctocpp.h\"\n\n\n// VIRTUAL METHODS - Body may be edited by hand.\n\nvoid CefAuthCallbackCToCpp::Continue(const CefString& username,\n const CefString& password) {\n cef_auth_callback_t* _struct = GetStruct();\n if (CEF_MEMBER_MISSING(_struct, cont))\n return;\n\n // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING\n\n // Verify param: username; type: string_byref_const\n DCHECK(!username.empty());\n if (username.empty())\n return;\n // Verify param: password; type: string_byref_const\n DCHECK(!password.empty());\n if (password.empty())\n return;\n\n // Execute\n _struct->cont(_struct,\n username.GetStruct(),\n password.GetStruct());\n}\n\nvoid CefAuthCallbackCToCpp::Cancel() {\n cef_auth_callback_t* _struct = GetStruct();\n if (CEF_MEMBER_MISSING(_struct, cancel))\n return;\n\n // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING\n\n // Execute\n _struct->cancel(_struct);\n}\n\n\n// CONSTRUCTOR - Do not edit by hand.\n\nCefAuthCallbackCToCpp::CefAuthCallbackCToCpp() {\n}\n\ntemplate<> cef_auth_callback_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,\n CefAuthCallback* c) {\n NOTREACHED() << \"Unexpected class type: \" << type;\n return NULL;\n}\n\n#if DCHECK_IS_ON()\ntemplate<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;\n#endif\n\ntemplate<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_AUTH_CALLBACK;\n"} +{"text": "42\nhello world\n5\n4\n3\n2\n1\nhello\nworld\n0\n"} +{"text": "19\n comment:c\nC 1.7711771 1.9985000 0.6137610\nC -1.4146240 1.1372570 -1.2290050\nC -1.3621570 -0.1783360 -1.0396900\nC 1.9153720 -1.0550430 0.3013840\nC 2.3186500 -0.1271630 -0.5674850\nC 1.9434890 1.2969980 -0.5093410\nH 2.2358899 -2.0890679 0.2130410\nH 2.9541740 -0.4216600 -1.4024709\nH -1.2646140 -0.8704770 -1.8708260\nH -1.3355780 1.5694309 -2.2223461\nH 1.2397890 -0.8231110 1.1220030\nH 1.9521750 1.5559500 1.5915630\nH 1.8173510 1.7989070 -1.4693830\nH 1.4881300 3.0475571 0.5894880\nH -1.5660650 1.8414670 -0.4130180\nC -1.5330120 -0.8416660 0.2877910\nO -1.1943340 -0.1112680 1.3777530\nH -0.6833450 0.6649400 1.0976650\nO -1.9665550 -1.9574890 0.4038710\n"} +{"text": "\n/* pngwutil.c - utilities to write a PNG file\n *\n * Last changed in libpng 1.2.9 April 14, 2006\n * For conditions of distribution and use, see copyright notice in png.h\n * Copyright (c) 1998-2006 Glenn Randers-Pehrson\n * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)\n * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)\n */\n\n#define PNG_INTERNAL\n#include \"png.h\"\n#ifdef PNG_WRITE_SUPPORTED\n\n/* Place a 32-bit number into a buffer in PNG byte order. We work\n * with unsigned numbers for convenience, although one supported\n * ancillary chunk uses signed (two's complement) numbers.\n */\nvoid PNGAPI\npng_save_uint_32(png_bytep buf, png_uint_32 i)\n{\n buf[0] = (png_byte)((i >> 24) & 0xff);\n buf[1] = (png_byte)((i >> 16) & 0xff);\n buf[2] = (png_byte)((i >> 8) & 0xff);\n buf[3] = (png_byte)(i & 0xff);\n}\n\n/* The png_save_int_32 function assumes integers are stored in two's\n * complement format. If this isn't the case, then this routine needs to\n * be modified to write data in two's complement format.\n */\nvoid PNGAPI\npng_save_int_32(png_bytep buf, png_int_32 i)\n{\n buf[0] = (png_byte)((i >> 24) & 0xff);\n buf[1] = (png_byte)((i >> 16) & 0xff);\n buf[2] = (png_byte)((i >> 8) & 0xff);\n buf[3] = (png_byte)(i & 0xff);\n}\n\n/* Place a 16-bit number into a buffer in PNG byte order.\n * The parameter is declared unsigned int, not png_uint_16,\n * just to avoid potential problems on pre-ANSI C compilers.\n */\nvoid PNGAPI\npng_save_uint_16(png_bytep buf, unsigned int i)\n{\n buf[0] = (png_byte)((i >> 8) & 0xff);\n buf[1] = (png_byte)(i & 0xff);\n}\n\n/* Write a PNG chunk all at once. The type is an array of ASCII characters\n * representing the chunk name. The array must be at least 4 bytes in\n * length, and does not need to be null terminated. To be safe, pass the\n * pre-defined chunk names here, and if you need a new one, define it\n * where the others are defined. The length is the length of the data.\n * All the data must be present. If that is not possible, use the\n * png_write_chunk_start(), png_write_chunk_data(), and png_write_chunk_end()\n * functions instead.\n */\nvoid PNGAPI\npng_write_chunk(png_structp png_ptr, png_bytep chunk_name,\n png_bytep data, png_size_t length)\n{\n png_write_chunk_start(png_ptr, chunk_name, (png_uint_32)length);\n png_write_chunk_data(png_ptr, data, length);\n png_write_chunk_end(png_ptr);\n}\n\n/* Write the start of a PNG chunk. The type is the chunk type.\n * The total_length is the sum of the lengths of all the data you will be\n * passing in png_write_chunk_data().\n */\nvoid PNGAPI\npng_write_chunk_start(png_structp png_ptr, png_bytep chunk_name,\n png_uint_32 length)\n{\n png_byte buf[4];\n png_debug2(0, \"Writing %s chunk (%lu bytes)\\n\", chunk_name, length);\n\n /* write the length */\n png_save_uint_32(buf, length);\n png_write_data(png_ptr, buf, (png_size_t)4);\n\n /* write the chunk name */\n png_write_data(png_ptr, chunk_name, (png_size_t)4);\n /* reset the crc and run it over the chunk name */\n png_reset_crc(png_ptr);\n png_calculate_crc(png_ptr, chunk_name, (png_size_t)4);\n}\n\n/* Write the data of a PNG chunk started with png_write_chunk_start().\n * Note that multiple calls to this function are allowed, and that the\n * sum of the lengths from these calls *must* add up to the total_length\n * given to png_write_chunk_start().\n */\nvoid PNGAPI\npng_write_chunk_data(png_structp png_ptr, png_bytep data, png_size_t length)\n{\n /* write the data, and run the CRC over it */\n if (data != NULL && length > 0)\n {\n png_calculate_crc(png_ptr, data, length);\n png_write_data(png_ptr, data, length);\n }\n}\n\n/* Finish a chunk started with png_write_chunk_start(). */\nvoid PNGAPI\npng_write_chunk_end(png_structp png_ptr)\n{\n png_byte buf[4];\n\n /* write the crc */\n png_save_uint_32(buf, png_ptr->crc);\n\n png_write_data(png_ptr, buf, (png_size_t)4);\n}\n\n/* Simple function to write the signature. If we have already written\n * the magic bytes of the signature, or more likely, the PNG stream is\n * being embedded into another stream and doesn't need its own signature,\n * we should call png_set_sig_bytes() to tell libpng how many of the\n * bytes have already been written.\n */\nvoid /* PRIVATE */\npng_write_sig(png_structp png_ptr)\n{\n png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};\n /* write the rest of the 8 byte signature */\n png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes],\n (png_size_t)8 - png_ptr->sig_bytes);\n if(png_ptr->sig_bytes < 3)\n png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;\n}\n\n#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_iCCP_SUPPORTED)\n/*\n * This pair of functions encapsulates the operation of (a) compressing a\n * text string, and (b) issuing it later as a series of chunk data writes.\n * The compression_state structure is shared context for these functions\n * set up by the caller in order to make the whole mess thread-safe.\n */\n\ntypedef struct\n{\n char *input; /* the uncompressed input data */\n int input_len; /* its length */\n int num_output_ptr; /* number of output pointers used */\n int max_output_ptr; /* size of output_ptr */\n png_charpp output_ptr; /* array of pointers to output */\n} compression_state;\n\n/* compress given text into storage in the png_ptr structure */\nstatic int /* PRIVATE */\npng_text_compress(png_structp png_ptr,\n png_charp text, png_size_t text_len, int compression,\n compression_state *comp)\n{\n int ret;\n\n comp->num_output_ptr = 0;\n comp->max_output_ptr = 0;\n comp->output_ptr = NULL;\n comp->input = NULL;\n comp->input_len = 0;\n\n /* we may just want to pass the text right through */\n if (compression == PNG_TEXT_COMPRESSION_NONE)\n {\n comp->input = text;\n comp->input_len = text_len;\n return((int)text_len);\n }\n\n if (compression >= PNG_TEXT_COMPRESSION_LAST)\n {\n#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)\n char msg[50];\n sprintf(msg, \"Unknown compression type %d\", compression);\n png_warning(png_ptr, msg);\n#else\n png_warning(png_ptr, \"Unknown compression type\");\n#endif\n }\n\n /* We can't write the chunk until we find out how much data we have,\n * which means we need to run the compressor first and save the\n * output. This shouldn't be a problem, as the vast majority of\n * comments should be reasonable, but we will set up an array of\n * malloc'd pointers to be sure.\n *\n * If we knew the application was well behaved, we could simplify this\n * greatly by assuming we can always malloc an output buffer large\n * enough to hold the compressed text ((1001 * text_len / 1000) + 12)\n * and malloc this directly. The only time this would be a bad idea is\n * if we can't malloc more than 64K and we have 64K of random input\n * data, or if the input string is incredibly large (although this\n * wouldn't cause a failure, just a slowdown due to swapping).\n */\n\n /* set up the compression buffers */\n png_ptr->zstream.avail_in = (uInt)text_len;\n png_ptr->zstream.next_in = (Bytef *)text;\n png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;\n png_ptr->zstream.next_out = (Bytef *)png_ptr->zbuf;\n\n /* this is the same compression loop as in png_write_row() */\n do\n {\n /* compress the data */\n ret = deflate(&png_ptr->zstream, Z_NO_FLUSH);\n if (ret != Z_OK)\n {\n /* error */\n if (png_ptr->zstream.msg != NULL)\n png_error(png_ptr, png_ptr->zstream.msg);\n else\n png_error(png_ptr, \"zlib error\");\n }\n /* check to see if we need more room */\n if (!(png_ptr->zstream.avail_out))\n {\n /* make sure the output array has room */\n if (comp->num_output_ptr >= comp->max_output_ptr)\n {\n int old_max;\n\n old_max = comp->max_output_ptr;\n comp->max_output_ptr = comp->num_output_ptr + 4;\n if (comp->output_ptr != NULL)\n {\n png_charpp old_ptr;\n\n old_ptr = comp->output_ptr;\n comp->output_ptr = (png_charpp)png_malloc(png_ptr,\n (png_uint_32)(comp->max_output_ptr *\n png_sizeof (png_charpp)));\n png_memcpy(comp->output_ptr, old_ptr, old_max\n * png_sizeof (png_charp));\n png_free(png_ptr, old_ptr);\n }\n else\n comp->output_ptr = (png_charpp)png_malloc(png_ptr,\n (png_uint_32)(comp->max_output_ptr *\n png_sizeof (png_charp)));\n }\n\n /* save the data */\n comp->output_ptr[comp->num_output_ptr] = (png_charp)png_malloc(png_ptr,\n (png_uint_32)png_ptr->zbuf_size);\n png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,\n png_ptr->zbuf_size);\n comp->num_output_ptr++;\n\n /* and reset the buffer */\n png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;\n png_ptr->zstream.next_out = png_ptr->zbuf;\n }\n /* continue until we don't have any more to compress */\n } while (png_ptr->zstream.avail_in);\n\n /* finish the compression */\n do\n {\n /* tell zlib we are finished */\n ret = deflate(&png_ptr->zstream, Z_FINISH);\n\n if (ret == Z_OK)\n {\n /* check to see if we need more room */\n if (!(png_ptr->zstream.avail_out))\n {\n /* check to make sure our output array has room */\n if (comp->num_output_ptr >= comp->max_output_ptr)\n {\n int old_max;\n\n old_max = comp->max_output_ptr;\n comp->max_output_ptr = comp->num_output_ptr + 4;\n if (comp->output_ptr != NULL)\n {\n png_charpp old_ptr;\n\n old_ptr = comp->output_ptr;\n /* This could be optimized to realloc() */\n comp->output_ptr = (png_charpp)png_malloc(png_ptr,\n (png_uint_32)(comp->max_output_ptr *\n png_sizeof (png_charpp)));\n png_memcpy(comp->output_ptr, old_ptr,\n old_max * png_sizeof (png_charp));\n png_free(png_ptr, old_ptr);\n }\n else\n comp->output_ptr = (png_charpp)png_malloc(png_ptr,\n (png_uint_32)(comp->max_output_ptr *\n png_sizeof (png_charp)));\n }\n\n /* save off the data */\n comp->output_ptr[comp->num_output_ptr] =\n (png_charp)png_malloc(png_ptr, (png_uint_32)png_ptr->zbuf_size);\n png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,\n png_ptr->zbuf_size);\n comp->num_output_ptr++;\n\n /* and reset the buffer pointers */\n png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;\n png_ptr->zstream.next_out = png_ptr->zbuf;\n }\n }\n else if (ret != Z_STREAM_END)\n {\n /* we got an error */\n if (png_ptr->zstream.msg != NULL)\n png_error(png_ptr, png_ptr->zstream.msg);\n else\n png_error(png_ptr, \"zlib error\");\n }\n } while (ret != Z_STREAM_END);\n\n /* text length is number of buffers plus last buffer */\n text_len = png_ptr->zbuf_size * comp->num_output_ptr;\n if (png_ptr->zstream.avail_out < png_ptr->zbuf_size)\n text_len += png_ptr->zbuf_size - (png_size_t)png_ptr->zstream.avail_out;\n\n return((int)text_len);\n}\n\n/* ship the compressed text out via chunk writes */\nstatic void /* PRIVATE */\npng_write_compressed_data_out(png_structp png_ptr, compression_state *comp)\n{\n int i;\n\n /* handle the no-compression case */\n if (comp->input)\n {\n png_write_chunk_data(png_ptr, (png_bytep)comp->input,\n (png_size_t)comp->input_len);\n return;\n }\n\n /* write saved output buffers, if any */\n for (i = 0; i < comp->num_output_ptr; i++)\n {\n png_write_chunk_data(png_ptr,(png_bytep)comp->output_ptr[i],\n png_ptr->zbuf_size);\n png_free(png_ptr, comp->output_ptr[i]);\n comp->output_ptr[i]=NULL;\n }\n if (comp->max_output_ptr != 0)\n png_free(png_ptr, comp->output_ptr);\n comp->output_ptr=NULL;\n /* write anything left in zbuf */\n if (png_ptr->zstream.avail_out < (png_uint_32)png_ptr->zbuf_size)\n png_write_chunk_data(png_ptr, png_ptr->zbuf,\n png_ptr->zbuf_size - png_ptr->zstream.avail_out);\n\n /* reset zlib for another zTXt/iTXt or image data */\n deflateReset(&png_ptr->zstream);\n png_ptr->zstream.data_type = Z_BINARY;\n}\n#endif\n\n/* Write the IHDR chunk, and update the png_struct with the necessary\n * information. Note that the rest of this code depends upon this\n * information being correct.\n */\nvoid /* PRIVATE */\npng_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,\n int bit_depth, int color_type, int compression_type, int filter_type,\n int interlace_type)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_IHDR;\n#endif\n png_byte buf[13]; /* buffer to store the IHDR info */\n\n png_debug(1, \"in png_write_IHDR\\n\");\n /* Check that we have valid input data from the application info */\n switch (color_type)\n {\n case PNG_COLOR_TYPE_GRAY:\n switch (bit_depth)\n {\n case 1:\n case 2:\n case 4:\n case 8:\n case 16: png_ptr->channels = 1; break;\n default: png_error(png_ptr,\"Invalid bit depth for grayscale image\");\n }\n break;\n case PNG_COLOR_TYPE_RGB:\n if (bit_depth != 8 && bit_depth != 16)\n png_error(png_ptr, \"Invalid bit depth for RGB image\");\n png_ptr->channels = 3;\n break;\n case PNG_COLOR_TYPE_PALETTE:\n switch (bit_depth)\n {\n case 1:\n case 2:\n case 4:\n case 8: png_ptr->channels = 1; break;\n default: png_error(png_ptr, \"Invalid bit depth for paletted image\");\n }\n break;\n case PNG_COLOR_TYPE_GRAY_ALPHA:\n if (bit_depth != 8 && bit_depth != 16)\n png_error(png_ptr, \"Invalid bit depth for grayscale+alpha image\");\n png_ptr->channels = 2;\n break;\n case PNG_COLOR_TYPE_RGB_ALPHA:\n if (bit_depth != 8 && bit_depth != 16)\n png_error(png_ptr, \"Invalid bit depth for RGBA image\");\n png_ptr->channels = 4;\n break;\n default:\n png_error(png_ptr, \"Invalid image color type specified\");\n }\n\n if (compression_type != PNG_COMPRESSION_TYPE_BASE)\n {\n png_warning(png_ptr, \"Invalid compression type specified\");\n compression_type = PNG_COMPRESSION_TYPE_BASE;\n }\n\n /* Write filter_method 64 (intrapixel differencing) only if\n * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and\n * 2. Libpng did not write a PNG signature (this filter_method is only\n * used in PNG datastreams that are embedded in MNG datastreams) and\n * 3. The application called png_permit_mng_features with a mask that\n * included PNG_FLAG_MNG_FILTER_64 and\n * 4. The filter_method is 64 and\n * 5. The color_type is RGB or RGBA\n */\n if (\n#if defined(PNG_MNG_FEATURES_SUPPORTED)\n !((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&\n ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) &&\n (color_type == PNG_COLOR_TYPE_RGB ||\n color_type == PNG_COLOR_TYPE_RGB_ALPHA) &&\n (filter_type == PNG_INTRAPIXEL_DIFFERENCING)) &&\n#endif\n filter_type != PNG_FILTER_TYPE_BASE)\n {\n png_warning(png_ptr, \"Invalid filter type specified\");\n filter_type = PNG_FILTER_TYPE_BASE;\n }\n\n#ifdef PNG_WRITE_INTERLACING_SUPPORTED\n if (interlace_type != PNG_INTERLACE_NONE &&\n interlace_type != PNG_INTERLACE_ADAM7)\n {\n png_warning(png_ptr, \"Invalid interlace type specified\");\n interlace_type = PNG_INTERLACE_ADAM7;\n }\n#else\n interlace_type=PNG_INTERLACE_NONE;\n#endif\n\n /* save off the relevent information */\n png_ptr->bit_depth = (png_byte)bit_depth;\n png_ptr->color_type = (png_byte)color_type;\n png_ptr->interlaced = (png_byte)interlace_type;\n#if defined(PNG_MNG_FEATURES_SUPPORTED)\n png_ptr->filter_type = (png_byte)filter_type;\n#endif\n png_ptr->compression_type = (png_byte)compression_type;\n png_ptr->width = width;\n png_ptr->height = height;\n\n png_ptr->pixel_depth = (png_byte)(bit_depth * png_ptr->channels);\n png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, width);\n /* set the usr info, so any transformations can modify it */\n png_ptr->usr_width = png_ptr->width;\n png_ptr->usr_bit_depth = png_ptr->bit_depth;\n png_ptr->usr_channels = png_ptr->channels;\n\n /* pack the header information into the buffer */\n png_save_uint_32(buf, width);\n png_save_uint_32(buf + 4, height);\n buf[8] = (png_byte)bit_depth;\n buf[9] = (png_byte)color_type;\n buf[10] = (png_byte)compression_type;\n buf[11] = (png_byte)filter_type;\n buf[12] = (png_byte)interlace_type;\n\n /* write the chunk */\n png_write_chunk(png_ptr, (png_bytep)png_IHDR, buf, (png_size_t)13);\n\n /* initialize zlib with PNG info */\n png_ptr->zstream.zalloc = png_zalloc;\n png_ptr->zstream.zfree = png_zfree;\n png_ptr->zstream.opaque = (voidpf)png_ptr;\n if (!(png_ptr->do_filter))\n {\n if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE ||\n png_ptr->bit_depth < 8)\n png_ptr->do_filter = PNG_FILTER_NONE;\n else\n png_ptr->do_filter = PNG_ALL_FILTERS;\n }\n if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_STRATEGY))\n {\n if (png_ptr->do_filter != PNG_FILTER_NONE)\n png_ptr->zlib_strategy = Z_FILTERED;\n else\n png_ptr->zlib_strategy = Z_DEFAULT_STRATEGY;\n }\n if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_LEVEL))\n png_ptr->zlib_level = Z_DEFAULT_COMPRESSION;\n if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL))\n png_ptr->zlib_mem_level = 8;\n if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS))\n png_ptr->zlib_window_bits = 15;\n if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_METHOD))\n png_ptr->zlib_method = 8;\n deflateInit2(&png_ptr->zstream, png_ptr->zlib_level,\n png_ptr->zlib_method, png_ptr->zlib_window_bits,\n png_ptr->zlib_mem_level, png_ptr->zlib_strategy);\n png_ptr->zstream.next_out = png_ptr->zbuf;\n png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;\n /* libpng is not interested in zstream.data_type */\n /* set it to a predefined value, to avoid its evaluation inside zlib */\n png_ptr->zstream.data_type = Z_BINARY;\n\n png_ptr->mode = PNG_HAVE_IHDR;\n}\n\n/* write the palette. We are careful not to trust png_color to be in the\n * correct order for PNG, so people can redefine it to any convenient\n * structure.\n */\nvoid /* PRIVATE */\npng_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_PLTE;\n#endif\n png_uint_32 i;\n png_colorp pal_ptr;\n png_byte buf[3];\n\n png_debug(1, \"in png_write_PLTE\\n\");\n if ((\n#if defined(PNG_MNG_FEATURES_SUPPORTED)\n !(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) &&\n#endif\n num_pal == 0) || num_pal > 256)\n {\n if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)\n {\n png_error(png_ptr, \"Invalid number of colors in palette\");\n }\n else\n {\n png_warning(png_ptr, \"Invalid number of colors in palette\");\n return;\n }\n }\n\n if (!(png_ptr->color_type&PNG_COLOR_MASK_COLOR))\n {\n png_warning(png_ptr,\n \"Ignoring request to write a PLTE chunk in grayscale PNG\");\n return;\n }\n\n png_ptr->num_palette = (png_uint_16)num_pal;\n png_debug1(3, \"num_palette = %d\\n\", png_ptr->num_palette);\n\n png_write_chunk_start(png_ptr, (png_bytep)png_PLTE, num_pal * 3);\n#ifndef PNG_NO_POINTER_INDEXING\n for (i = 0, pal_ptr = palette; i < num_pal; i++, pal_ptr++)\n {\n buf[0] = pal_ptr->red;\n buf[1] = pal_ptr->green;\n buf[2] = pal_ptr->blue;\n png_write_chunk_data(png_ptr, buf, (png_size_t)3);\n }\n#else\n /* This is a little slower but some buggy compilers need to do this instead */\n pal_ptr=palette;\n for (i = 0; i < num_pal; i++)\n {\n buf[0] = pal_ptr[i].red;\n buf[1] = pal_ptr[i].green;\n buf[2] = pal_ptr[i].blue;\n png_write_chunk_data(png_ptr, buf, (png_size_t)3);\n }\n#endif\n png_write_chunk_end(png_ptr);\n png_ptr->mode |= PNG_HAVE_PLTE;\n}\n\n/* write an IDAT chunk */\nvoid /* PRIVATE */\npng_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_IDAT;\n#endif\n png_debug(1, \"in png_write_IDAT\\n\");\n\n /* Optimize the CMF field in the zlib stream. */\n /* This hack of the zlib stream is compliant to the stream specification. */\n if (!(png_ptr->mode & PNG_HAVE_IDAT) &&\n png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE)\n {\n unsigned int z_cmf = data[0]; /* zlib compression method and flags */\n if ((z_cmf & 0x0f) == 8 && (z_cmf & 0xf0) <= 0x70)\n {\n /* Avoid memory underflows and multiplication overflows. */\n /* The conditions below are practically always satisfied;\n however, they still must be checked. */\n if (length >= 2 &&\n png_ptr->height < 16384 && png_ptr->width < 16384)\n {\n png_uint_32 uncompressed_idat_size = png_ptr->height *\n ((png_ptr->width *\n png_ptr->channels * png_ptr->bit_depth + 15) >> 3);\n unsigned int z_cinfo = z_cmf >> 4;\n unsigned int half_z_window_size = 1 << (z_cinfo + 7);\n while (uncompressed_idat_size <= half_z_window_size &&\n half_z_window_size >= 256)\n {\n z_cinfo--;\n half_z_window_size >>= 1;\n }\n z_cmf = (z_cmf & 0x0f) | (z_cinfo << 4);\n if (data[0] != (png_byte)z_cmf)\n {\n data[0] = (png_byte)z_cmf;\n data[1] &= 0xe0;\n data[1] += (png_byte)(0x1f - ((z_cmf << 8) + data[1]) % 0x1f);\n }\n }\n }\n else\n png_error(png_ptr,\n \"Invalid zlib compression method or flags in IDAT\");\n }\n\n png_write_chunk(png_ptr, (png_bytep)png_IDAT, data, length);\n png_ptr->mode |= PNG_HAVE_IDAT;\n}\n\n/* write an IEND chunk */\nvoid /* PRIVATE */\npng_write_IEND(png_structp png_ptr)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_IEND;\n#endif\n png_debug(1, \"in png_write_IEND\\n\");\n png_write_chunk(png_ptr, (png_bytep)png_IEND, png_bytep_NULL,\n (png_size_t)0);\n png_ptr->mode |= PNG_HAVE_IEND;\n}\n\n#if defined(PNG_WRITE_gAMA_SUPPORTED)\n/* write a gAMA chunk */\n#ifdef PNG_FLOATING_POINT_SUPPORTED\nvoid /* PRIVATE */\npng_write_gAMA(png_structp png_ptr, double file_gamma)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_gAMA;\n#endif\n png_uint_32 igamma;\n png_byte buf[4];\n\n png_debug(1, \"in png_write_gAMA\\n\");\n /* file_gamma is saved in 1/100,000ths */\n igamma = (png_uint_32)(file_gamma * 100000.0 + 0.5);\n png_save_uint_32(buf, igamma);\n png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4);\n}\n#endif\n#ifdef PNG_FIXED_POINT_SUPPORTED\nvoid /* PRIVATE */\npng_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_gAMA;\n#endif\n png_byte buf[4];\n\n png_debug(1, \"in png_write_gAMA\\n\");\n /* file_gamma is saved in 1/100,000ths */\n png_save_uint_32(buf, (png_uint_32)file_gamma);\n png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4);\n}\n#endif\n#endif\n\n#if defined(PNG_WRITE_sRGB_SUPPORTED)\n/* write a sRGB chunk */\nvoid /* PRIVATE */\npng_write_sRGB(png_structp png_ptr, int srgb_intent)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_sRGB;\n#endif\n png_byte buf[1];\n\n png_debug(1, \"in png_write_sRGB\\n\");\n if(srgb_intent >= PNG_sRGB_INTENT_LAST)\n png_warning(png_ptr,\n \"Invalid sRGB rendering intent specified\");\n buf[0]=(png_byte)srgb_intent;\n png_write_chunk(png_ptr, (png_bytep)png_sRGB, buf, (png_size_t)1);\n}\n#endif\n\n#if defined(PNG_WRITE_iCCP_SUPPORTED)\n/* write an iCCP chunk */\nvoid /* PRIVATE */\npng_write_iCCP(png_structp png_ptr, png_charp name, int compression_type,\n png_charp profile, int profile_len)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_iCCP;\n#endif\n png_size_t name_len;\n png_charp new_name;\n compression_state comp;\n\n png_debug(1, \"in png_write_iCCP\\n\");\n\n comp.num_output_ptr = 0;\n comp.max_output_ptr = 0;\n comp.output_ptr = NULL;\n comp.input = NULL;\n comp.input_len = 0;\n\n if (name == NULL || (name_len = png_check_keyword(png_ptr, name,\n &new_name)) == 0)\n {\n png_warning(png_ptr, \"Empty keyword in iCCP chunk\");\n return;\n }\n\n if (compression_type != PNG_COMPRESSION_TYPE_BASE)\n png_warning(png_ptr, \"Unknown compression type in iCCP chunk\");\n\n if (profile == NULL)\n profile_len = 0;\n\n if (profile_len)\n profile_len = png_text_compress(png_ptr, profile, (png_size_t)profile_len,\n PNG_COMPRESSION_TYPE_BASE, &comp);\n\n /* make sure we include the NULL after the name and the compression type */\n png_write_chunk_start(png_ptr, (png_bytep)png_iCCP,\n (png_uint_32)name_len+profile_len+2);\n new_name[name_len+1]=0x00;\n png_write_chunk_data(png_ptr, (png_bytep)new_name, name_len + 2);\n\n if (profile_len)\n png_write_compressed_data_out(png_ptr, &comp);\n\n png_write_chunk_end(png_ptr);\n png_free(png_ptr, new_name);\n}\n#endif\n\n#if defined(PNG_WRITE_sPLT_SUPPORTED)\n/* write a sPLT chunk */\nvoid /* PRIVATE */\npng_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_sPLT;\n#endif\n png_size_t name_len;\n png_charp new_name;\n png_byte entrybuf[10];\n int entry_size = (spalette->depth == 8 ? 6 : 10);\n int palette_size = entry_size * spalette->nentries;\n png_sPLT_entryp ep;\n#ifdef PNG_NO_POINTER_INDEXING\n int i;\n#endif\n\n png_debug(1, \"in png_write_sPLT\\n\");\n if (spalette->name == NULL || (name_len = png_check_keyword(png_ptr,\n spalette->name, &new_name))==0)\n {\n png_warning(png_ptr, \"Empty keyword in sPLT chunk\");\n return;\n }\n\n /* make sure we include the NULL after the name */\n png_write_chunk_start(png_ptr, (png_bytep)png_sPLT,\n (png_uint_32)(name_len + 2 + palette_size));\n png_write_chunk_data(png_ptr, (png_bytep)new_name, name_len + 1);\n png_write_chunk_data(png_ptr, (png_bytep)&spalette->depth, 1);\n\n /* loop through each palette entry, writing appropriately */\n#ifndef PNG_NO_POINTER_INDEXING\n for (ep = spalette->entries; epentries+spalette->nentries; ep++)\n {\n if (spalette->depth == 8)\n {\n entrybuf[0] = (png_byte)ep->red;\n entrybuf[1] = (png_byte)ep->green;\n entrybuf[2] = (png_byte)ep->blue;\n entrybuf[3] = (png_byte)ep->alpha;\n png_save_uint_16(entrybuf + 4, ep->frequency);\n }\n else\n {\n png_save_uint_16(entrybuf + 0, ep->red);\n png_save_uint_16(entrybuf + 2, ep->green);\n png_save_uint_16(entrybuf + 4, ep->blue);\n png_save_uint_16(entrybuf + 6, ep->alpha);\n png_save_uint_16(entrybuf + 8, ep->frequency);\n }\n png_write_chunk_data(png_ptr, entrybuf, (png_size_t)entry_size);\n }\n#else\n ep=spalette->entries;\n for (i=0; i>spalette->nentries; i++)\n {\n if (spalette->depth == 8)\n {\n entrybuf[0] = (png_byte)ep[i].red;\n entrybuf[1] = (png_byte)ep[i].green;\n entrybuf[2] = (png_byte)ep[i].blue;\n entrybuf[3] = (png_byte)ep[i].alpha;\n png_save_uint_16(entrybuf + 4, ep[i].frequency);\n }\n else\n {\n png_save_uint_16(entrybuf + 0, ep[i].red);\n png_save_uint_16(entrybuf + 2, ep[i].green);\n png_save_uint_16(entrybuf + 4, ep[i].blue);\n png_save_uint_16(entrybuf + 6, ep[i].alpha);\n png_save_uint_16(entrybuf + 8, ep[i].frequency);\n }\n png_write_chunk_data(png_ptr, entrybuf, entry_size);\n }\n#endif\n\n png_write_chunk_end(png_ptr);\n png_free(png_ptr, new_name);\n}\n#endif\n\n#if defined(PNG_WRITE_sBIT_SUPPORTED)\n/* write the sBIT chunk */\nvoid /* PRIVATE */\npng_write_sBIT(png_structp png_ptr, png_color_8p sbit, int color_type)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_sBIT;\n#endif\n png_byte buf[4];\n png_size_t size;\n\n png_debug(1, \"in png_write_sBIT\\n\");\n /* make sure we don't depend upon the order of PNG_COLOR_8 */\n if (color_type & PNG_COLOR_MASK_COLOR)\n {\n png_byte maxbits;\n\n maxbits = (png_byte)(color_type==PNG_COLOR_TYPE_PALETTE ? 8 :\n png_ptr->usr_bit_depth);\n if (sbit->red == 0 || sbit->red > maxbits ||\n sbit->green == 0 || sbit->green > maxbits ||\n sbit->blue == 0 || sbit->blue > maxbits)\n {\n png_warning(png_ptr, \"Invalid sBIT depth specified\");\n return;\n }\n buf[0] = sbit->red;\n buf[1] = sbit->green;\n buf[2] = sbit->blue;\n size = 3;\n }\n else\n {\n if (sbit->gray == 0 || sbit->gray > png_ptr->usr_bit_depth)\n {\n png_warning(png_ptr, \"Invalid sBIT depth specified\");\n return;\n }\n buf[0] = sbit->gray;\n size = 1;\n }\n\n if (color_type & PNG_COLOR_MASK_ALPHA)\n {\n if (sbit->alpha == 0 || sbit->alpha > png_ptr->usr_bit_depth)\n {\n png_warning(png_ptr, \"Invalid sBIT depth specified\");\n return;\n }\n buf[size++] = sbit->alpha;\n }\n\n png_write_chunk(png_ptr, (png_bytep)png_sBIT, buf, size);\n}\n#endif\n\n#if defined(PNG_WRITE_cHRM_SUPPORTED)\n/* write the cHRM chunk */\n#ifdef PNG_FLOATING_POINT_SUPPORTED\nvoid /* PRIVATE */\npng_write_cHRM(png_structp png_ptr, double white_x, double white_y,\n double red_x, double red_y, double green_x, double green_y,\n double blue_x, double blue_y)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_cHRM;\n#endif\n png_byte buf[32];\n png_uint_32 itemp;\n\n png_debug(1, \"in png_write_cHRM\\n\");\n /* each value is saved in 1/100,000ths */\n if (white_x < 0 || white_x > 0.8 || white_y < 0 || white_y > 0.8 ||\n white_x + white_y > 1.0)\n {\n png_warning(png_ptr, \"Invalid cHRM white point specified\");\n#if !defined(PNG_NO_CONSOLE_IO)\n fprintf(stderr,\"white_x=%f, white_y=%f\\n\",white_x, white_y);\n#endif\n return;\n }\n itemp = (png_uint_32)(white_x * 100000.0 + 0.5);\n png_save_uint_32(buf, itemp);\n itemp = (png_uint_32)(white_y * 100000.0 + 0.5);\n png_save_uint_32(buf + 4, itemp);\n\n if (red_x < 0 || red_y < 0 || red_x + red_y > 1.0)\n {\n png_warning(png_ptr, \"Invalid cHRM red point specified\");\n return;\n }\n itemp = (png_uint_32)(red_x * 100000.0 + 0.5);\n png_save_uint_32(buf + 8, itemp);\n itemp = (png_uint_32)(red_y * 100000.0 + 0.5);\n png_save_uint_32(buf + 12, itemp);\n\n if (green_x < 0 || green_y < 0 || green_x + green_y > 1.0)\n {\n png_warning(png_ptr, \"Invalid cHRM green point specified\");\n return;\n }\n itemp = (png_uint_32)(green_x * 100000.0 + 0.5);\n png_save_uint_32(buf + 16, itemp);\n itemp = (png_uint_32)(green_y * 100000.0 + 0.5);\n png_save_uint_32(buf + 20, itemp);\n\n if (blue_x < 0 || blue_y < 0 || blue_x + blue_y > 1.0)\n {\n png_warning(png_ptr, \"Invalid cHRM blue point specified\");\n return;\n }\n itemp = (png_uint_32)(blue_x * 100000.0 + 0.5);\n png_save_uint_32(buf + 24, itemp);\n itemp = (png_uint_32)(blue_y * 100000.0 + 0.5);\n png_save_uint_32(buf + 28, itemp);\n\n png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32);\n}\n#endif\n#ifdef PNG_FIXED_POINT_SUPPORTED\nvoid /* PRIVATE */\npng_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x,\n png_fixed_point white_y, png_fixed_point red_x, png_fixed_point red_y,\n png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x,\n png_fixed_point blue_y)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_cHRM;\n#endif\n png_byte buf[32];\n\n png_debug(1, \"in png_write_cHRM\\n\");\n /* each value is saved in 1/100,000ths */\n if (white_x > 80000L || white_y > 80000L || white_x + white_y > 100000L)\n {\n png_warning(png_ptr, \"Invalid fixed cHRM white point specified\");\n#if !defined(PNG_NO_CONSOLE_IO)\n fprintf(stderr,\"white_x=%ld, white_y=%ld\\n\",white_x, white_y);\n#endif\n return;\n }\n png_save_uint_32(buf, (png_uint_32)white_x);\n png_save_uint_32(buf + 4, (png_uint_32)white_y);\n\n if (red_x + red_y > 100000L)\n {\n png_warning(png_ptr, \"Invalid cHRM fixed red point specified\");\n return;\n }\n png_save_uint_32(buf + 8, (png_uint_32)red_x);\n png_save_uint_32(buf + 12, (png_uint_32)red_y);\n\n if (green_x + green_y > 100000L)\n {\n png_warning(png_ptr, \"Invalid fixed cHRM green point specified\");\n return;\n }\n png_save_uint_32(buf + 16, (png_uint_32)green_x);\n png_save_uint_32(buf + 20, (png_uint_32)green_y);\n\n if (blue_x + blue_y > 100000L)\n {\n png_warning(png_ptr, \"Invalid fixed cHRM blue point specified\");\n return;\n }\n png_save_uint_32(buf + 24, (png_uint_32)blue_x);\n png_save_uint_32(buf + 28, (png_uint_32)blue_y);\n\n png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32);\n}\n#endif\n#endif\n\n#if defined(PNG_WRITE_tRNS_SUPPORTED)\n/* write the tRNS chunk */\nvoid /* PRIVATE */\npng_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran,\n int num_trans, int color_type)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_tRNS;\n#endif\n png_byte buf[6];\n\n png_debug(1, \"in png_write_tRNS\\n\");\n if (color_type == PNG_COLOR_TYPE_PALETTE)\n {\n if (num_trans <= 0 || num_trans > (int)png_ptr->num_palette)\n {\n png_warning(png_ptr,\"Invalid number of transparent colors specified\");\n return;\n }\n /* write the chunk out as it is */\n png_write_chunk(png_ptr, (png_bytep)png_tRNS, trans, (png_size_t)num_trans);\n }\n else if (color_type == PNG_COLOR_TYPE_GRAY)\n {\n /* one 16 bit value */\n if(tran->gray >= (1 << png_ptr->bit_depth))\n {\n png_warning(png_ptr,\n \"Ignoring attempt to write tRNS chunk out-of-range for bit_depth\");\n return;\n }\n png_save_uint_16(buf, tran->gray);\n png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)2);\n }\n else if (color_type == PNG_COLOR_TYPE_RGB)\n {\n /* three 16 bit values */\n png_save_uint_16(buf, tran->red);\n png_save_uint_16(buf + 2, tran->green);\n png_save_uint_16(buf + 4, tran->blue);\n if(png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]))\n {\n png_warning(png_ptr,\n \"Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8\");\n return;\n }\n png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)6);\n }\n else\n {\n png_warning(png_ptr, \"Can't write tRNS with an alpha channel\");\n }\n}\n#endif\n\n#if defined(PNG_WRITE_bKGD_SUPPORTED)\n/* write the background chunk */\nvoid /* PRIVATE */\npng_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_bKGD;\n#endif\n png_byte buf[6];\n\n png_debug(1, \"in png_write_bKGD\\n\");\n if (color_type == PNG_COLOR_TYPE_PALETTE)\n {\n if (\n#if defined(PNG_MNG_FEATURES_SUPPORTED)\n (png_ptr->num_palette ||\n (!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE))) &&\n#endif\n back->index > png_ptr->num_palette)\n {\n png_warning(png_ptr, \"Invalid background palette index\");\n return;\n }\n buf[0] = back->index;\n png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)1);\n }\n else if (color_type & PNG_COLOR_MASK_COLOR)\n {\n png_save_uint_16(buf, back->red);\n png_save_uint_16(buf + 2, back->green);\n png_save_uint_16(buf + 4, back->blue);\n if(png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]))\n {\n png_warning(png_ptr,\n \"Ignoring attempt to write 16-bit bKGD chunk when bit_depth is 8\");\n return;\n }\n png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)6);\n }\n else\n {\n if(back->gray >= (1 << png_ptr->bit_depth))\n {\n png_warning(png_ptr,\n \"Ignoring attempt to write bKGD chunk out-of-range for bit_depth\");\n return;\n }\n png_save_uint_16(buf, back->gray);\n png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)2);\n }\n}\n#endif\n\n#if defined(PNG_WRITE_hIST_SUPPORTED)\n/* write the histogram */\nvoid /* PRIVATE */\npng_write_hIST(png_structp png_ptr, png_uint_16p hist, int num_hist)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_hIST;\n#endif\n int i;\n png_byte buf[3];\n\n png_debug(1, \"in png_write_hIST\\n\");\n if (num_hist > (int)png_ptr->num_palette)\n {\n png_debug2(3, \"num_hist = %d, num_palette = %d\\n\", num_hist,\n png_ptr->num_palette);\n png_warning(png_ptr, \"Invalid number of histogram entries specified\");\n return;\n }\n\n png_write_chunk_start(png_ptr, (png_bytep)png_hIST, (png_uint_32)(num_hist * 2));\n for (i = 0; i < num_hist; i++)\n {\n png_save_uint_16(buf, hist[i]);\n png_write_chunk_data(png_ptr, buf, (png_size_t)2);\n }\n png_write_chunk_end(png_ptr);\n}\n#endif\n\n#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \\\n defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)\n/* Check that the tEXt or zTXt keyword is valid per PNG 1.0 specification,\n * and if invalid, correct the keyword rather than discarding the entire\n * chunk. The PNG 1.0 specification requires keywords 1-79 characters in\n * length, forbids leading or trailing whitespace, multiple internal spaces,\n * and the non-break space (0x80) from ISO 8859-1. Returns keyword length.\n *\n * The new_key is allocated to hold the corrected keyword and must be freed\n * by the calling routine. This avoids problems with trying to write to\n * static keywords without having to have duplicate copies of the strings.\n */\npng_size_t /* PRIVATE */\npng_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)\n{\n png_size_t key_len;\n png_charp kp, dp;\n int kflag;\n int kwarn=0;\n\n png_debug(1, \"in png_check_keyword\\n\");\n *new_key = NULL;\n\n if (key == NULL || (key_len = png_strlen(key)) == 0)\n {\n png_warning(png_ptr, \"zero length keyword\");\n return ((png_size_t)0);\n }\n\n png_debug1(2, \"Keyword to be checked is '%s'\\n\", key);\n\n *new_key = (png_charp)png_malloc_warn(png_ptr, (png_uint_32)(key_len + 2));\n if (*new_key == NULL)\n {\n png_warning(png_ptr, \"Out of memory while procesing keyword\");\n return ((png_size_t)0);\n }\n\n /* Replace non-printing characters with a blank and print a warning */\n for (kp = key, dp = *new_key; *kp != '\\0'; kp++, dp++)\n {\n if (*kp < 0x20 || (*kp > 0x7E && (png_byte)*kp < 0xA1))\n {\n#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)\n char msg[40];\n\n sprintf(msg, \"invalid keyword character 0x%02X\", *kp);\n png_warning(png_ptr, msg);\n#else\n png_warning(png_ptr, \"invalid character in keyword\");\n#endif\n *dp = ' ';\n }\n else\n {\n *dp = *kp;\n }\n }\n *dp = '\\0';\n\n /* Remove any trailing white space. */\n kp = *new_key + key_len - 1;\n if (*kp == ' ')\n {\n png_warning(png_ptr, \"trailing spaces removed from keyword\");\n\n while (*kp == ' ')\n {\n *(kp--) = '\\0';\n key_len--;\n }\n }\n\n /* Remove any leading white space. */\n kp = *new_key;\n if (*kp == ' ')\n {\n png_warning(png_ptr, \"leading spaces removed from keyword\");\n\n while (*kp == ' ')\n {\n kp++;\n key_len--;\n }\n }\n\n png_debug1(2, \"Checking for multiple internal spaces in '%s'\\n\", kp);\n\n /* Remove multiple internal spaces. */\n for (kflag = 0, dp = *new_key; *kp != '\\0'; kp++)\n {\n if (*kp == ' ' && kflag == 0)\n {\n *(dp++) = *kp;\n kflag = 1;\n }\n else if (*kp == ' ')\n {\n key_len--;\n kwarn=1;\n }\n else\n {\n *(dp++) = *kp;\n kflag = 0;\n }\n }\n *dp = '\\0';\n if(kwarn)\n png_warning(png_ptr, \"extra interior spaces removed from keyword\");\n\n if (key_len == 0)\n {\n png_free(png_ptr, *new_key);\n *new_key=NULL;\n png_warning(png_ptr, \"Zero length keyword\");\n }\n\n if (key_len > 79)\n {\n png_warning(png_ptr, \"keyword length must be 1 - 79 characters\");\n new_key[79] = '\\0';\n key_len = 79;\n }\n\n return (key_len);\n}\n#endif\n\n#if defined(PNG_WRITE_tEXt_SUPPORTED)\n/* write a tEXt chunk */\nvoid /* PRIVATE */\npng_write_tEXt(png_structp png_ptr, png_charp key, png_charp text,\n png_size_t text_len)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_tEXt;\n#endif\n png_size_t key_len;\n png_charp new_key;\n\n png_debug(1, \"in png_write_tEXt\\n\");\n if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0)\n {\n png_warning(png_ptr, \"Empty keyword in tEXt chunk\");\n return;\n }\n\n if (text == NULL || *text == '\\0')\n text_len = 0;\n else\n text_len = png_strlen(text);\n\n /* make sure we include the 0 after the key */\n png_write_chunk_start(png_ptr, (png_bytep)png_tEXt, (png_uint_32)key_len+text_len+1);\n /*\n * We leave it to the application to meet PNG-1.0 requirements on the\n * contents of the text. PNG-1.0 through PNG-1.2 discourage the use of\n * any non-Latin-1 characters except for NEWLINE. ISO PNG will forbid them.\n * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG.\n */\n png_write_chunk_data(png_ptr, (png_bytep)new_key, key_len + 1);\n if (text_len)\n png_write_chunk_data(png_ptr, (png_bytep)text, text_len);\n\n png_write_chunk_end(png_ptr);\n png_free(png_ptr, new_key);\n}\n#endif\n\n#if defined(PNG_WRITE_zTXt_SUPPORTED)\n/* write a compressed text chunk */\nvoid /* PRIVATE */\npng_write_zTXt(png_structp png_ptr, png_charp key, png_charp text,\n png_size_t text_len, int compression)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_zTXt;\n#endif\n png_size_t key_len;\n char buf[1];\n png_charp new_key;\n compression_state comp;\n\n png_debug(1, \"in png_write_zTXt\\n\");\n\n comp.num_output_ptr = 0;\n comp.max_output_ptr = 0;\n comp.output_ptr = NULL;\n comp.input = NULL;\n comp.input_len = 0;\n\n if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0)\n {\n png_warning(png_ptr, \"Empty keyword in zTXt chunk\");\n return;\n }\n\n if (text == NULL || *text == '\\0' || compression==PNG_TEXT_COMPRESSION_NONE)\n {\n png_write_tEXt(png_ptr, new_key, text, (png_size_t)0);\n png_free(png_ptr, new_key);\n return;\n }\n\n text_len = png_strlen(text);\n\n png_free(png_ptr, new_key);\n\n /* compute the compressed data; do it now for the length */\n text_len = png_text_compress(png_ptr, text, text_len, compression,\n &comp);\n\n /* write start of chunk */\n png_write_chunk_start(png_ptr, (png_bytep)png_zTXt, (png_uint_32)\n (key_len+text_len+2));\n /* write key */\n png_write_chunk_data(png_ptr, (png_bytep)key, key_len + 1);\n buf[0] = (png_byte)compression;\n /* write compression */\n png_write_chunk_data(png_ptr, (png_bytep)buf, (png_size_t)1);\n /* write the compressed data */\n png_write_compressed_data_out(png_ptr, &comp);\n\n /* close the chunk */\n png_write_chunk_end(png_ptr);\n}\n#endif\n\n#if defined(PNG_WRITE_iTXt_SUPPORTED)\n/* write an iTXt chunk */\nvoid /* PRIVATE */\npng_write_iTXt(png_structp png_ptr, int compression, png_charp key,\n png_charp lang, png_charp lang_key, png_charp text)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_iTXt;\n#endif\n png_size_t lang_len, key_len, lang_key_len, text_len;\n png_charp new_lang, new_key;\n png_byte cbuf[2];\n compression_state comp;\n\n png_debug(1, \"in png_write_iTXt\\n\");\n\n comp.num_output_ptr = 0;\n comp.max_output_ptr = 0;\n comp.output_ptr = NULL;\n comp.input = NULL;\n\n if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0)\n {\n png_warning(png_ptr, \"Empty keyword in iTXt chunk\");\n return;\n }\n if (lang == NULL || (lang_len = png_check_keyword(png_ptr, lang, &new_lang))==0)\n {\n png_warning(png_ptr, \"Empty language field in iTXt chunk\");\n new_lang = NULL;\n lang_len = 0;\n }\n\n if (lang_key == NULL)\n lang_key_len = 0;\n else\n lang_key_len = png_strlen(lang_key);\n\n if (text == NULL)\n text_len = 0;\n else\n text_len = png_strlen(text);\n\n /* compute the compressed data; do it now for the length */\n text_len = png_text_compress(png_ptr, text, text_len, compression-2,\n &comp);\n\n\n /* make sure we include the compression flag, the compression byte,\n * and the NULs after the key, lang, and lang_key parts */\n\n png_write_chunk_start(png_ptr, (png_bytep)png_iTXt,\n (png_uint_32)(\n 5 /* comp byte, comp flag, terminators for key, lang and lang_key */\n + key_len\n + lang_len\n + lang_key_len\n + text_len));\n\n /*\n * We leave it to the application to meet PNG-1.0 requirements on the\n * contents of the text. PNG-1.0 through PNG-1.2 discourage the use of\n * any non-Latin-1 characters except for NEWLINE. ISO PNG will forbid them.\n * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG.\n */\n png_write_chunk_data(png_ptr, (png_bytep)new_key, key_len + 1);\n\n /* set the compression flag */\n if (compression == PNG_ITXT_COMPRESSION_NONE || \\\n compression == PNG_TEXT_COMPRESSION_NONE)\n cbuf[0] = 0;\n else /* compression == PNG_ITXT_COMPRESSION_zTXt */\n cbuf[0] = 1;\n /* set the compression method */\n cbuf[1] = 0;\n png_write_chunk_data(png_ptr, cbuf, 2);\n\n cbuf[0] = 0;\n png_write_chunk_data(png_ptr, (new_lang ? (png_bytep)new_lang : cbuf), lang_len + 1);\n png_write_chunk_data(png_ptr, (lang_key ? (png_bytep)lang_key : cbuf), lang_key_len + 1);\n png_write_compressed_data_out(png_ptr, &comp);\n\n png_write_chunk_end(png_ptr);\n png_free(png_ptr, new_key);\n if (new_lang)\n png_free(png_ptr, new_lang);\n}\n#endif\n\n#if defined(PNG_WRITE_oFFs_SUPPORTED)\n/* write the oFFs chunk */\nvoid /* PRIVATE */\npng_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset,\n int unit_type)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_oFFs;\n#endif\n png_byte buf[9];\n\n png_debug(1, \"in png_write_oFFs\\n\");\n if (unit_type >= PNG_OFFSET_LAST)\n png_warning(png_ptr, \"Unrecognized unit type for oFFs chunk\");\n\n png_save_int_32(buf, x_offset);\n png_save_int_32(buf + 4, y_offset);\n buf[8] = (png_byte)unit_type;\n\n png_write_chunk(png_ptr, (png_bytep)png_oFFs, buf, (png_size_t)9);\n}\n#endif\n\n#if defined(PNG_WRITE_pCAL_SUPPORTED)\n/* write the pCAL chunk (described in the PNG extensions document) */\nvoid /* PRIVATE */\npng_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,\n png_int_32 X1, int type, int nparams, png_charp units, png_charpp params)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_pCAL;\n#endif\n png_size_t purpose_len, units_len, total_len;\n png_uint_32p params_len;\n png_byte buf[10];\n png_charp new_purpose;\n int i;\n\n png_debug1(1, \"in png_write_pCAL (%d parameters)\\n\", nparams);\n if (type >= PNG_EQUATION_LAST)\n png_warning(png_ptr, \"Unrecognized equation type for pCAL chunk\");\n\n purpose_len = png_check_keyword(png_ptr, purpose, &new_purpose) + 1;\n png_debug1(3, \"pCAL purpose length = %d\\n\", (int)purpose_len);\n units_len = png_strlen(units) + (nparams == 0 ? 0 : 1);\n png_debug1(3, \"pCAL units length = %d\\n\", (int)units_len);\n total_len = purpose_len + units_len + 10;\n\n params_len = (png_uint_32p)png_malloc(png_ptr, (png_uint_32)(nparams\n *png_sizeof(png_uint_32)));\n\n /* Find the length of each parameter, making sure we don't count the\n null terminator for the last parameter. */\n for (i = 0; i < nparams; i++)\n {\n params_len[i] = png_strlen(params[i]) + (i == nparams - 1 ? 0 : 1);\n png_debug2(3, \"pCAL parameter %d length = %lu\\n\", i, params_len[i]);\n total_len += (png_size_t)params_len[i];\n }\n\n png_debug1(3, \"pCAL total length = %d\\n\", (int)total_len);\n png_write_chunk_start(png_ptr, (png_bytep)png_pCAL, (png_uint_32)total_len);\n png_write_chunk_data(png_ptr, (png_bytep)new_purpose, purpose_len);\n png_save_int_32(buf, X0);\n png_save_int_32(buf + 4, X1);\n buf[8] = (png_byte)type;\n buf[9] = (png_byte)nparams;\n png_write_chunk_data(png_ptr, buf, (png_size_t)10);\n png_write_chunk_data(png_ptr, (png_bytep)units, (png_size_t)units_len);\n\n png_free(png_ptr, new_purpose);\n\n for (i = 0; i < nparams; i++)\n {\n png_write_chunk_data(png_ptr, (png_bytep)params[i],\n (png_size_t)params_len[i]);\n }\n\n png_free(png_ptr, params_len);\n png_write_chunk_end(png_ptr);\n}\n#endif\n\n#if defined(PNG_WRITE_sCAL_SUPPORTED)\n/* write the sCAL chunk */\n#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO)\nvoid /* PRIVATE */\npng_write_sCAL(png_structp png_ptr, int unit, double width,double height)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_sCAL;\n#endif\n png_size_t total_len;\n char wbuf[32], hbuf[32];\n png_byte bunit = (png_byte)unit;\n\n png_debug(1, \"in png_write_sCAL\\n\");\n\n#if defined(_WIN32_WCE)\n/* sprintf() function is not supported on WindowsCE */\n {\n wchar_t wc_buf[32];\n swprintf(wc_buf, TEXT(\"%12.12e\"), width);\n WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, wbuf, 32, NULL, NULL);\n swprintf(wc_buf, TEXT(\"%12.12e\"), height);\n WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, hbuf, 32, NULL, NULL);\n }\n#else\n sprintf(wbuf, \"%12.12e\", width);\n sprintf(hbuf, \"%12.12e\", height);\n#endif\n total_len = 1 + png_strlen(wbuf)+1 + png_strlen(hbuf);\n\n png_debug1(3, \"sCAL total length = %d\\n\", (int)total_len);\n png_write_chunk_start(png_ptr, (png_bytep)png_sCAL, (png_uint_32)total_len);\n png_write_chunk_data(png_ptr, (png_bytep)&bunit, 1);\n png_write_chunk_data(png_ptr, (png_bytep)wbuf, png_strlen(wbuf)+1);\n png_write_chunk_data(png_ptr, (png_bytep)hbuf, png_strlen(hbuf));\n\n png_write_chunk_end(png_ptr);\n}\n#else\n#ifdef PNG_FIXED_POINT_SUPPORTED\nvoid /* PRIVATE */\npng_write_sCAL_s(png_structp png_ptr, int unit, png_charp width,\n png_charp height)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_sCAL;\n#endif\n png_size_t total_len;\n char wbuf[32], hbuf[32];\n png_byte bunit = unit;\n\n png_debug(1, \"in png_write_sCAL_s\\n\");\n\n png_strcpy(wbuf,(const char *)width);\n png_strcpy(hbuf,(const char *)height);\n total_len = 1 + png_strlen(wbuf)+1 + png_strlen(hbuf);\n\n png_debug1(3, \"sCAL total length = %d\\n\", total_len);\n png_write_chunk_start(png_ptr, (png_bytep)png_sCAL, (png_uint_32)total_len);\n png_write_chunk_data(png_ptr, (png_bytep)&bunit, 1);\n png_write_chunk_data(png_ptr, (png_bytep)wbuf, png_strlen(wbuf)+1);\n png_write_chunk_data(png_ptr, (png_bytep)hbuf, png_strlen(hbuf));\n\n png_write_chunk_end(png_ptr);\n}\n#endif\n#endif\n#endif\n\n#if defined(PNG_WRITE_pHYs_SUPPORTED)\n/* write the pHYs chunk */\nvoid /* PRIVATE */\npng_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit,\n png_uint_32 y_pixels_per_unit,\n int unit_type)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_pHYs;\n#endif\n png_byte buf[9];\n\n png_debug(1, \"in png_write_pHYs\\n\");\n if (unit_type >= PNG_RESOLUTION_LAST)\n png_warning(png_ptr, \"Unrecognized unit type for pHYs chunk\");\n\n png_save_uint_32(buf, x_pixels_per_unit);\n png_save_uint_32(buf + 4, y_pixels_per_unit);\n buf[8] = (png_byte)unit_type;\n\n png_write_chunk(png_ptr, (png_bytep)png_pHYs, buf, (png_size_t)9);\n}\n#endif\n\n#if defined(PNG_WRITE_tIME_SUPPORTED)\n/* Write the tIME chunk. Use either png_convert_from_struct_tm()\n * or png_convert_from_time_t(), or fill in the structure yourself.\n */\nvoid /* PRIVATE */\npng_write_tIME(png_structp png_ptr, png_timep mod_time)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n PNG_tIME;\n#endif\n png_byte buf[7];\n\n png_debug(1, \"in png_write_tIME\\n\");\n if (mod_time->month > 12 || mod_time->month < 1 ||\n mod_time->day > 31 || mod_time->day < 1 ||\n mod_time->hour > 23 || mod_time->second > 60)\n {\n png_warning(png_ptr, \"Invalid time specified for tIME chunk\");\n return;\n }\n\n png_save_uint_16(buf, mod_time->year);\n buf[2] = mod_time->month;\n buf[3] = mod_time->day;\n buf[4] = mod_time->hour;\n buf[5] = mod_time->minute;\n buf[6] = mod_time->second;\n\n png_write_chunk(png_ptr, (png_bytep)png_tIME, buf, (png_size_t)7);\n}\n#endif\n\n/* initializes the row writing capability of libpng */\nvoid /* PRIVATE */\npng_write_start_row(png_structp png_ptr)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */\n\n /* start of interlace block */\n int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};\n\n /* offset to next interlace block */\n int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};\n\n /* start of interlace block in the y direction */\n int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};\n\n /* offset to next interlace block in the y direction */\n int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};\n#endif\n\n png_size_t buf_size;\n\n png_debug(1, \"in png_write_start_row\\n\");\n buf_size = (png_size_t)(PNG_ROWBYTES(\n png_ptr->usr_channels*png_ptr->usr_bit_depth,png_ptr->width)+1);\n\n /* set up row buffer */\n png_ptr->row_buf = (png_bytep)png_malloc(png_ptr, (png_uint_32)buf_size);\n png_ptr->row_buf[0] = PNG_FILTER_VALUE_NONE;\n\n /* set up filtering buffer, if using this filter */\n if (png_ptr->do_filter & PNG_FILTER_SUB)\n {\n png_ptr->sub_row = (png_bytep)png_malloc(png_ptr,\n (png_ptr->rowbytes + 1));\n png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB;\n }\n\n /* We only need to keep the previous row if we are using one of these. */\n if (png_ptr->do_filter & (PNG_FILTER_AVG | PNG_FILTER_UP | PNG_FILTER_PAETH))\n {\n /* set up previous row buffer */\n png_ptr->prev_row = (png_bytep)png_malloc(png_ptr, (png_uint_32)buf_size);\n png_memset(png_ptr->prev_row, 0, buf_size);\n\n if (png_ptr->do_filter & PNG_FILTER_UP)\n {\n png_ptr->up_row = (png_bytep )png_malloc(png_ptr,\n (png_ptr->rowbytes + 1));\n png_ptr->up_row[0] = PNG_FILTER_VALUE_UP;\n }\n\n if (png_ptr->do_filter & PNG_FILTER_AVG)\n {\n png_ptr->avg_row = (png_bytep)png_malloc(png_ptr,\n (png_ptr->rowbytes + 1));\n png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG;\n }\n\n if (png_ptr->do_filter & PNG_FILTER_PAETH)\n {\n png_ptr->paeth_row = (png_bytep )png_malloc(png_ptr,\n (png_ptr->rowbytes + 1));\n png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH;\n }\n }\n\n#ifdef PNG_WRITE_INTERLACING_SUPPORTED\n /* if interlaced, we need to set up width and height of pass */\n if (png_ptr->interlaced)\n {\n if (!(png_ptr->transformations & PNG_INTERLACE))\n {\n png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 -\n png_pass_ystart[0]) / png_pass_yinc[0];\n png_ptr->usr_width = (png_ptr->width + png_pass_inc[0] - 1 -\n png_pass_start[0]) / png_pass_inc[0];\n }\n else\n {\n png_ptr->num_rows = png_ptr->height;\n png_ptr->usr_width = png_ptr->width;\n }\n }\n else\n#endif\n {\n png_ptr->num_rows = png_ptr->height;\n png_ptr->usr_width = png_ptr->width;\n }\n png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;\n png_ptr->zstream.next_out = png_ptr->zbuf;\n}\n\n/* Internal use only. Called when finished processing a row of data. */\nvoid /* PRIVATE */\npng_write_finish_row(png_structp png_ptr)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */\n\n /* start of interlace block */\n int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};\n\n /* offset to next interlace block */\n int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};\n\n /* start of interlace block in the y direction */\n int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};\n\n /* offset to next interlace block in the y direction */\n int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};\n#endif\n\n int ret;\n\n png_debug(1, \"in png_write_finish_row\\n\");\n /* next row */\n png_ptr->row_number++;\n\n /* see if we are done */\n if (png_ptr->row_number < png_ptr->num_rows)\n return;\n\n#ifdef PNG_WRITE_INTERLACING_SUPPORTED\n /* if interlaced, go to next pass */\n if (png_ptr->interlaced)\n {\n png_ptr->row_number = 0;\n if (png_ptr->transformations & PNG_INTERLACE)\n {\n png_ptr->pass++;\n }\n else\n {\n /* loop until we find a non-zero width or height pass */\n do\n {\n png_ptr->pass++;\n if (png_ptr->pass >= 7)\n break;\n png_ptr->usr_width = (png_ptr->width +\n png_pass_inc[png_ptr->pass] - 1 -\n png_pass_start[png_ptr->pass]) /\n png_pass_inc[png_ptr->pass];\n png_ptr->num_rows = (png_ptr->height +\n png_pass_yinc[png_ptr->pass] - 1 -\n png_pass_ystart[png_ptr->pass]) /\n png_pass_yinc[png_ptr->pass];\n if (png_ptr->transformations & PNG_INTERLACE)\n break;\n } while (png_ptr->usr_width == 0 || png_ptr->num_rows == 0);\n\n }\n\n /* reset the row above the image for the next pass */\n if (png_ptr->pass < 7)\n {\n if (png_ptr->prev_row != NULL)\n png_memset(png_ptr->prev_row, 0,\n (png_size_t)(PNG_ROWBYTES(png_ptr->usr_channels*\n png_ptr->usr_bit_depth,png_ptr->width))+1);\n return;\n }\n }\n#endif\n\n /* if we get here, we've just written the last row, so we need\n to flush the compressor */\n do\n {\n /* tell the compressor we are done */\n ret = deflate(&png_ptr->zstream, Z_FINISH);\n /* check for an error */\n if (ret == Z_OK)\n {\n /* check to see if we need more room */\n if (!(png_ptr->zstream.avail_out))\n {\n png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);\n png_ptr->zstream.next_out = png_ptr->zbuf;\n png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;\n }\n }\n else if (ret != Z_STREAM_END)\n {\n if (png_ptr->zstream.msg != NULL)\n png_error(png_ptr, png_ptr->zstream.msg);\n else\n png_error(png_ptr, \"zlib error\");\n }\n } while (ret != Z_STREAM_END);\n\n /* write any extra space */\n if (png_ptr->zstream.avail_out < png_ptr->zbuf_size)\n {\n png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size -\n png_ptr->zstream.avail_out);\n }\n\n deflateReset(&png_ptr->zstream);\n png_ptr->zstream.data_type = Z_BINARY;\n}\n\n#if defined(PNG_WRITE_INTERLACING_SUPPORTED)\n/* Pick out the correct pixels for the interlace pass.\n * The basic idea here is to go through the row with a source\n * pointer and a destination pointer (sp and dp), and copy the\n * correct pixels for the pass. As the row gets compacted,\n * sp will always be >= dp, so we should never overwrite anything.\n * See the default: case for the easiest code to understand.\n */\nvoid /* PRIVATE */\npng_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)\n{\n#ifdef PNG_USE_LOCAL_ARRAYS\n /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */\n\n /* start of interlace block */\n int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};\n\n /* offset to next interlace block */\n int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};\n#endif\n\n png_debug(1, \"in png_do_write_interlace\\n\");\n /* we don't have to do anything on the last pass (6) */\n#if defined(PNG_USELESS_TESTS_SUPPORTED)\n if (row != NULL && row_info != NULL && pass < 6)\n#else\n if (pass < 6)\n#endif\n {\n /* each pixel depth is handled separately */\n switch (row_info->pixel_depth)\n {\n case 1:\n {\n png_bytep sp;\n png_bytep dp;\n int shift;\n int d;\n int value;\n png_uint_32 i;\n png_uint_32 row_width = row_info->width;\n\n dp = row;\n d = 0;\n shift = 7;\n for (i = png_pass_start[pass]; i < row_width;\n i += png_pass_inc[pass])\n {\n sp = row + (png_size_t)(i >> 3);\n value = (int)(*sp >> (7 - (int)(i & 0x07))) & 0x01;\n d |= (value << shift);\n\n if (shift == 0)\n {\n shift = 7;\n *dp++ = (png_byte)d;\n d = 0;\n }\n else\n shift--;\n\n }\n if (shift != 7)\n *dp = (png_byte)d;\n break;\n }\n case 2:\n {\n png_bytep sp;\n png_bytep dp;\n int shift;\n int d;\n int value;\n png_uint_32 i;\n png_uint_32 row_width = row_info->width;\n\n dp = row;\n shift = 6;\n d = 0;\n for (i = png_pass_start[pass]; i < row_width;\n i += png_pass_inc[pass])\n {\n sp = row + (png_size_t)(i >> 2);\n value = (*sp >> ((3 - (int)(i & 0x03)) << 1)) & 0x03;\n d |= (value << shift);\n\n if (shift == 0)\n {\n shift = 6;\n *dp++ = (png_byte)d;\n d = 0;\n }\n else\n shift -= 2;\n }\n if (shift != 6)\n *dp = (png_byte)d;\n break;\n }\n case 4:\n {\n png_bytep sp;\n png_bytep dp;\n int shift;\n int d;\n int value;\n png_uint_32 i;\n png_uint_32 row_width = row_info->width;\n\n dp = row;\n shift = 4;\n d = 0;\n for (i = png_pass_start[pass]; i < row_width;\n i += png_pass_inc[pass])\n {\n sp = row + (png_size_t)(i >> 1);\n value = (*sp >> ((1 - (int)(i & 0x01)) << 2)) & 0x0f;\n d |= (value << shift);\n\n if (shift == 0)\n {\n shift = 4;\n *dp++ = (png_byte)d;\n d = 0;\n }\n else\n shift -= 4;\n }\n if (shift != 4)\n *dp = (png_byte)d;\n break;\n }\n default:\n {\n png_bytep sp;\n png_bytep dp;\n png_uint_32 i;\n png_uint_32 row_width = row_info->width;\n png_size_t pixel_bytes;\n\n /* start at the beginning */\n dp = row;\n /* find out how many bytes each pixel takes up */\n pixel_bytes = (row_info->pixel_depth >> 3);\n /* loop through the row, only looking at the pixels that\n matter */\n for (i = png_pass_start[pass]; i < row_width;\n i += png_pass_inc[pass])\n {\n /* find out where the original pixel is */\n sp = row + (png_size_t)i * pixel_bytes;\n /* move the pixel */\n if (dp != sp)\n png_memcpy(dp, sp, pixel_bytes);\n /* next pixel */\n dp += pixel_bytes;\n }\n break;\n }\n }\n /* set new row width */\n row_info->width = (row_info->width +\n png_pass_inc[pass] - 1 -\n png_pass_start[pass]) /\n png_pass_inc[pass];\n row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,\n row_info->width);\n }\n}\n#endif\n\n/* This filters the row, chooses which filter to use, if it has not already\n * been specified by the application, and then writes the row out with the\n * chosen filter.\n */\n#define PNG_MAXSUM (((png_uint_32)(-1)) >> 1)\n#define PNG_HISHIFT 10\n#define PNG_LOMASK ((png_uint_32)0xffffL)\n#define PNG_HIMASK ((png_uint_32)(~PNG_LOMASK >> PNG_HISHIFT))\nvoid /* PRIVATE */\npng_write_find_filter(png_structp png_ptr, png_row_infop row_info)\n{\n png_bytep prev_row, best_row, row_buf;\n png_uint_32 mins, bpp;\n png_byte filter_to_do = png_ptr->do_filter;\n png_uint_32 row_bytes = row_info->rowbytes;\n#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)\n int num_p_filters = (int)png_ptr->num_prev_filters;\n#endif\n\n png_debug(1, \"in png_write_find_filter\\n\");\n /* find out how many bytes offset each pixel is */\n bpp = (row_info->pixel_depth + 7) >> 3;\n\n prev_row = png_ptr->prev_row;\n best_row = row_buf = png_ptr->row_buf;\n mins = PNG_MAXSUM;\n\n /* The prediction method we use is to find which method provides the\n * smallest value when summing the absolute values of the distances\n * from zero, using anything >= 128 as negative numbers. This is known\n * as the \"minimum sum of absolute differences\" heuristic. Other\n * heuristics are the \"weighted minimum sum of absolute differences\"\n * (experimental and can in theory improve compression), and the \"zlib\n * predictive\" method (not implemented yet), which does test compressions\n * of lines using different filter methods, and then chooses the\n * (series of) filter(s) that give minimum compressed data size (VERY\n * computationally expensive).\n *\n * GRR 980525: consider also\n * (1) minimum sum of absolute differences from running average (i.e.,\n * keep running sum of non-absolute differences & count of bytes)\n * [track dispersion, too? restart average if dispersion too large?]\n * (1b) minimum sum of absolute differences from sliding average, probably\n * with window size <= deflate window (usually 32K)\n * (2) minimum sum of squared differences from zero or running average\n * (i.e., ~ root-mean-square approach)\n */\n\n\n /* We don't need to test the 'no filter' case if this is the only filter\n * that has been chosen, as it doesn't actually do anything to the data.\n */\n if ((filter_to_do & PNG_FILTER_NONE) &&\n filter_to_do != PNG_FILTER_NONE)\n {\n png_bytep rp;\n png_uint_32 sum = 0;\n png_uint_32 i;\n int v;\n\n for (i = 0, rp = row_buf + 1; i < row_bytes; i++, rp++)\n {\n v = *rp;\n sum += (v < 128) ? v : 256 - v;\n }\n\n#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)\n if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)\n {\n png_uint_32 sumhi, sumlo;\n int j;\n sumlo = sum & PNG_LOMASK;\n sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; /* Gives us some footroom */\n\n /* Reduce the sum if we match any of the previous rows */\n for (j = 0; j < num_p_filters; j++)\n {\n if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE)\n {\n sumlo = (sumlo * png_ptr->filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n sumhi = (sumhi * png_ptr->filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n }\n }\n\n /* Factor in the cost of this filter (this is here for completeness,\n * but it makes no sense to have a \"cost\" for the NONE filter, as\n * it has the minimum possible computational cost - none).\n */\n sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >>\n PNG_COST_SHIFT;\n sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >>\n PNG_COST_SHIFT;\n\n if (sumhi > PNG_HIMASK)\n sum = PNG_MAXSUM;\n else\n sum = (sumhi << PNG_HISHIFT) + sumlo;\n }\n#endif\n mins = sum;\n }\n\n /* sub filter */\n if (filter_to_do == PNG_FILTER_SUB)\n /* it's the only filter so no testing is needed */\n {\n png_bytep rp, lp, dp;\n png_uint_32 i;\n for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp;\n i++, rp++, dp++)\n {\n *dp = *rp;\n }\n for (lp = row_buf + 1; i < row_bytes;\n i++, rp++, lp++, dp++)\n {\n *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff);\n }\n best_row = png_ptr->sub_row;\n }\n\n else if (filter_to_do & PNG_FILTER_SUB)\n {\n png_bytep rp, dp, lp;\n png_uint_32 sum = 0, lmins = mins;\n png_uint_32 i;\n int v;\n\n#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)\n /* We temporarily increase the \"minimum sum\" by the factor we\n * would reduce the sum of this filter, so that we can do the\n * early exit comparison without scaling the sum each time.\n */\n if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)\n {\n int j;\n png_uint_32 lmhi, lmlo;\n lmlo = lmins & PNG_LOMASK;\n lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;\n\n for (j = 0; j < num_p_filters; j++)\n {\n if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB)\n {\n lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n }\n }\n\n lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>\n PNG_COST_SHIFT;\n lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>\n PNG_COST_SHIFT;\n\n if (lmhi > PNG_HIMASK)\n lmins = PNG_MAXSUM;\n else\n lmins = (lmhi << PNG_HISHIFT) + lmlo;\n }\n#endif\n\n for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp;\n i++, rp++, dp++)\n {\n v = *dp = *rp;\n\n sum += (v < 128) ? v : 256 - v;\n }\n for (lp = row_buf + 1; i < row_bytes;\n i++, rp++, lp++, dp++)\n {\n v = *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff);\n\n sum += (v < 128) ? v : 256 - v;\n\n if (sum > lmins) /* We are already worse, don't continue. */\n break;\n }\n\n#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)\n if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)\n {\n int j;\n png_uint_32 sumhi, sumlo;\n sumlo = sum & PNG_LOMASK;\n sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;\n\n for (j = 0; j < num_p_filters; j++)\n {\n if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB)\n {\n sumlo = (sumlo * png_ptr->inv_filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n sumhi = (sumhi * png_ptr->inv_filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n }\n }\n\n sumlo = (sumlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>\n PNG_COST_SHIFT;\n sumhi = (sumhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>\n PNG_COST_SHIFT;\n\n if (sumhi > PNG_HIMASK)\n sum = PNG_MAXSUM;\n else\n sum = (sumhi << PNG_HISHIFT) + sumlo;\n }\n#endif\n\n if (sum < mins)\n {\n mins = sum;\n best_row = png_ptr->sub_row;\n }\n }\n\n /* up filter */\n if (filter_to_do == PNG_FILTER_UP)\n {\n png_bytep rp, dp, pp;\n png_uint_32 i;\n\n for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1,\n pp = prev_row + 1; i < row_bytes;\n i++, rp++, pp++, dp++)\n {\n *dp = (png_byte)(((int)*rp - (int)*pp) & 0xff);\n }\n best_row = png_ptr->up_row;\n }\n\n else if (filter_to_do & PNG_FILTER_UP)\n {\n png_bytep rp, dp, pp;\n png_uint_32 sum = 0, lmins = mins;\n png_uint_32 i;\n int v;\n\n\n#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)\n if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)\n {\n int j;\n png_uint_32 lmhi, lmlo;\n lmlo = lmins & PNG_LOMASK;\n lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;\n\n for (j = 0; j < num_p_filters; j++)\n {\n if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP)\n {\n lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n }\n }\n\n lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >>\n PNG_COST_SHIFT;\n lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >>\n PNG_COST_SHIFT;\n\n if (lmhi > PNG_HIMASK)\n lmins = PNG_MAXSUM;\n else\n lmins = (lmhi << PNG_HISHIFT) + lmlo;\n }\n#endif\n\n for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1,\n pp = prev_row + 1; i < row_bytes; i++)\n {\n v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff);\n\n sum += (v < 128) ? v : 256 - v;\n\n if (sum > lmins) /* We are already worse, don't continue. */\n break;\n }\n\n#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)\n if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)\n {\n int j;\n png_uint_32 sumhi, sumlo;\n sumlo = sum & PNG_LOMASK;\n sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;\n\n for (j = 0; j < num_p_filters; j++)\n {\n if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP)\n {\n sumlo = (sumlo * png_ptr->filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n sumhi = (sumhi * png_ptr->filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n }\n }\n\n sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >>\n PNG_COST_SHIFT;\n sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >>\n PNG_COST_SHIFT;\n\n if (sumhi > PNG_HIMASK)\n sum = PNG_MAXSUM;\n else\n sum = (sumhi << PNG_HISHIFT) + sumlo;\n }\n#endif\n\n if (sum < mins)\n {\n mins = sum;\n best_row = png_ptr->up_row;\n }\n }\n\n /* avg filter */\n if (filter_to_do == PNG_FILTER_AVG)\n {\n png_bytep rp, dp, pp, lp;\n png_uint_32 i;\n for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1,\n pp = prev_row + 1; i < bpp; i++)\n {\n *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff);\n }\n for (lp = row_buf + 1; i < row_bytes; i++)\n {\n *dp++ = (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2))\n & 0xff);\n }\n best_row = png_ptr->avg_row;\n }\n\n else if (filter_to_do & PNG_FILTER_AVG)\n {\n png_bytep rp, dp, pp, lp;\n png_uint_32 sum = 0, lmins = mins;\n png_uint_32 i;\n int v;\n\n#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)\n if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)\n {\n int j;\n png_uint_32 lmhi, lmlo;\n lmlo = lmins & PNG_LOMASK;\n lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;\n\n for (j = 0; j < num_p_filters; j++)\n {\n if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_AVG)\n {\n lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n }\n }\n\n lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >>\n PNG_COST_SHIFT;\n lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >>\n PNG_COST_SHIFT;\n\n if (lmhi > PNG_HIMASK)\n lmins = PNG_MAXSUM;\n else\n lmins = (lmhi << PNG_HISHIFT) + lmlo;\n }\n#endif\n\n for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1,\n pp = prev_row + 1; i < bpp; i++)\n {\n v = *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff);\n\n sum += (v < 128) ? v : 256 - v;\n }\n for (lp = row_buf + 1; i < row_bytes; i++)\n {\n v = *dp++ =\n (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) & 0xff);\n\n sum += (v < 128) ? v : 256 - v;\n\n if (sum > lmins) /* We are already worse, don't continue. */\n break;\n }\n\n#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)\n if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)\n {\n int j;\n png_uint_32 sumhi, sumlo;\n sumlo = sum & PNG_LOMASK;\n sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;\n\n for (j = 0; j < num_p_filters; j++)\n {\n if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE)\n {\n sumlo = (sumlo * png_ptr->filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n sumhi = (sumhi * png_ptr->filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n }\n }\n\n sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >>\n PNG_COST_SHIFT;\n sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >>\n PNG_COST_SHIFT;\n\n if (sumhi > PNG_HIMASK)\n sum = PNG_MAXSUM;\n else\n sum = (sumhi << PNG_HISHIFT) + sumlo;\n }\n#endif\n\n if (sum < mins)\n {\n mins = sum;\n best_row = png_ptr->avg_row;\n }\n }\n\n /* Paeth filter */\n if (filter_to_do == PNG_FILTER_PAETH)\n {\n png_bytep rp, dp, pp, cp, lp;\n png_uint_32 i;\n for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1,\n pp = prev_row + 1; i < bpp; i++)\n {\n *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff);\n }\n\n for (lp = row_buf + 1, cp = prev_row + 1; i < row_bytes; i++)\n {\n int a, b, c, pa, pb, pc, p;\n\n b = *pp++;\n c = *cp++;\n a = *lp++;\n\n p = b - c;\n pc = a - c;\n\n#ifdef PNG_USE_ABS\n pa = abs(p);\n pb = abs(pc);\n pc = abs(p + pc);\n#else\n pa = p < 0 ? -p : p;\n pb = pc < 0 ? -pc : pc;\n pc = (p + pc) < 0 ? -(p + pc) : p + pc;\n#endif\n\n p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c;\n\n *dp++ = (png_byte)(((int)*rp++ - p) & 0xff);\n }\n best_row = png_ptr->paeth_row;\n }\n\n else if (filter_to_do & PNG_FILTER_PAETH)\n {\n png_bytep rp, dp, pp, cp, lp;\n png_uint_32 sum = 0, lmins = mins;\n png_uint_32 i;\n int v;\n\n#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)\n if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)\n {\n int j;\n png_uint_32 lmhi, lmlo;\n lmlo = lmins & PNG_LOMASK;\n lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;\n\n for (j = 0; j < num_p_filters; j++)\n {\n if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH)\n {\n lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n }\n }\n\n lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >>\n PNG_COST_SHIFT;\n lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >>\n PNG_COST_SHIFT;\n\n if (lmhi > PNG_HIMASK)\n lmins = PNG_MAXSUM;\n else\n lmins = (lmhi << PNG_HISHIFT) + lmlo;\n }\n#endif\n\n for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1,\n pp = prev_row + 1; i < bpp; i++)\n {\n v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff);\n\n sum += (v < 128) ? v : 256 - v;\n }\n\n for (lp = row_buf + 1, cp = prev_row + 1; i < row_bytes; i++)\n {\n int a, b, c, pa, pb, pc, p;\n\n b = *pp++;\n c = *cp++;\n a = *lp++;\n\n#ifndef PNG_SLOW_PAETH\n p = b - c;\n pc = a - c;\n#ifdef PNG_USE_ABS\n pa = abs(p);\n pb = abs(pc);\n pc = abs(p + pc);\n#else\n pa = p < 0 ? -p : p;\n pb = pc < 0 ? -pc : pc;\n pc = (p + pc) < 0 ? -(p + pc) : p + pc;\n#endif\n p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c;\n#else /* PNG_SLOW_PAETH */\n p = a + b - c;\n pa = abs(p - a);\n pb = abs(p - b);\n pc = abs(p - c);\n if (pa <= pb && pa <= pc)\n p = a;\n else if (pb <= pc)\n p = b;\n else\n p = c;\n#endif /* PNG_SLOW_PAETH */\n\n v = *dp++ = (png_byte)(((int)*rp++ - p) & 0xff);\n\n sum += (v < 128) ? v : 256 - v;\n\n if (sum > lmins) /* We are already worse, don't continue. */\n break;\n }\n\n#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)\n if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)\n {\n int j;\n png_uint_32 sumhi, sumlo;\n sumlo = sum & PNG_LOMASK;\n sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;\n\n for (j = 0; j < num_p_filters; j++)\n {\n if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH)\n {\n sumlo = (sumlo * png_ptr->filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n sumhi = (sumhi * png_ptr->filter_weights[j]) >>\n PNG_WEIGHT_SHIFT;\n }\n }\n\n sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >>\n PNG_COST_SHIFT;\n sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >>\n PNG_COST_SHIFT;\n\n if (sumhi > PNG_HIMASK)\n sum = PNG_MAXSUM;\n else\n sum = (sumhi << PNG_HISHIFT) + sumlo;\n }\n#endif\n\n if (sum < mins)\n {\n best_row = png_ptr->paeth_row;\n }\n }\n\n /* Do the actual writing of the filtered row data from the chosen filter. */\n\n png_write_filtered_row(png_ptr, best_row);\n\n#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)\n /* Save the type of filter we picked this time for future calculations */\n if (png_ptr->num_prev_filters > 0)\n {\n int j;\n for (j = 1; j < num_p_filters; j++)\n {\n png_ptr->prev_filters[j] = png_ptr->prev_filters[j - 1];\n }\n png_ptr->prev_filters[j] = best_row[0];\n }\n#endif\n}\n\n\n/* Do the actual writing of a previously filtered row. */\nvoid /* PRIVATE */\npng_write_filtered_row(png_structp png_ptr, png_bytep filtered_row)\n{\n png_debug(1, \"in png_write_filtered_row\\n\");\n png_debug1(2, \"filter = %d\\n\", filtered_row[0]);\n /* set up the zlib input buffer */\n\n png_ptr->zstream.next_in = filtered_row;\n png_ptr->zstream.avail_in = (uInt)png_ptr->row_info.rowbytes + 1;\n /* repeat until we have compressed all the data */\n do\n {\n int ret; /* return of zlib */\n\n /* compress the data */\n ret = deflate(&png_ptr->zstream, Z_NO_FLUSH);\n /* check for compression errors */\n if (ret != Z_OK)\n {\n if (png_ptr->zstream.msg != NULL)\n png_error(png_ptr, png_ptr->zstream.msg);\n else\n png_error(png_ptr, \"zlib error\");\n }\n\n /* see if it is time to write another IDAT */\n if (!(png_ptr->zstream.avail_out))\n {\n /* write the IDAT and reset the zlib output buffer */\n png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);\n png_ptr->zstream.next_out = png_ptr->zbuf;\n png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;\n }\n /* repeat until all data has been compressed */\n } while (png_ptr->zstream.avail_in);\n\n /* swap the current and previous rows */\n if (png_ptr->prev_row != NULL)\n {\n png_bytep tptr;\n\n tptr = png_ptr->prev_row;\n png_ptr->prev_row = png_ptr->row_buf;\n png_ptr->row_buf = tptr;\n }\n\n /* finish row - updates counters and flushes zlib if last row */\n png_write_finish_row(png_ptr);\n\n#if defined(PNG_WRITE_FLUSH_SUPPORTED)\n png_ptr->flush_rows++;\n\n if (png_ptr->flush_dist > 0 &&\n png_ptr->flush_rows >= png_ptr->flush_dist)\n {\n png_write_flush(png_ptr);\n }\n#endif\n}\n#endif /* PNG_WRITE_SUPPORTED */\n"} +{"text": "simulateModel(\"Buildings.Fluid.MixingVolumes.Examples.MixingVolumePrescribedHeatFlowRate\", tolerance=1E-6, method=\"CVode\", stopTime=1.0, resultFile=\"MixingVolumePrescribedHeatFlowRate\");\nremovePlots();\ncreatePlot(id = 5,\n position = {27, 22, 400, 440},\n y = {\"vol.ports[1].m_flow\"},\n filename = \"MixingVolumePrescribedHeatFlowRate.mat\",\n range = {0.0, 1.0, 0.02, -0.02},\n autoscale = true,\n autoerase = true,\n autoreplot = true,\n grid = true,\n color = true,\n leftTitleType = 1,\n bottomTitleType = 1);\ncreatePlot(id = 5,\n position = {27, 22, 400, 143},\n y = {\"vol.heatPort.Q_flow\"},\n range = {0.0, 1.0, 100.0, -200.0},\n autoscale = true,\n autoerase = true,\n autoreplot = true,\n grid = true,\n color = true,\n subPlot = 3,\n leftTitleType = 1,\n bottomTitleType = 1);\ncreatePlot(id = 5,\n position = {27, 22, 400, 144},\n y = {\"vol.heatPort.T\"},\n range = {0.0, 1.0, 40.0, 10.0},\n autoscale = true,\n autoerase = true,\n autoreplot = true,\n grid = true,\n color = true,\n subPlot = 2,\n leftTitleType = 1,\n bottomTitleType = 1);\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 <script type=\"text/javascript\">\n\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', 'UA-7064407-3']);\n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n\n</script>\n"} +{"text": "/*\n * Wire\n * Copyright (C) 2019 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\nconst {createLogger} = require('redux-logger');\nimport {APIClient} from '@wireapp/api-client';\nimport type {TypeUtil} from '@wireapp/commons';\nimport {Account} from '@wireapp/core';\nimport Cookies, {CookiesStatic} from 'js-cookie';\nimport configureStore from 'redux-mock-store';\nimport thunk from 'redux-thunk';\n\nimport type {RootState, ThunkDispatch} from '../..//module/reducer';\nimport {ActionRoot, actionRoot} from '../../module/action/';\n\nexport interface MockStoreParameters {\n actions?: TypeUtil.RecursivePartial;\n apiClient?: TypeUtil.RecursivePartial;\n cookieStore?: CookiesStatic;\n core?: TypeUtil.RecursivePartial;\n getConfig?: () => any;\n localStorage?: Storage;\n}\n\nconst defaultActions = actionRoot;\nconst defaultClient = new APIClient({urls: APIClient.BACKEND.STAGING});\nconst defaultCore = new Account(defaultClient);\nconst defaultLocalStorage = window.localStorage;\nconst defaultCookieStore = Cookies;\nconst defaultGetConfig = () => ({\n APP_INSTANCE_ID: 'app-id',\n FEATURE: {\n CHECK_CONSENT: true,\n DEFAULT_LOGIN_TEMPORARY_CLIENT: false,\n ENABLE_ACCOUNT_REGISTRATION: true,\n ENABLE_DEBUG: true,\n ENABLE_PHONE_LOGIN: true,\n ENABLE_SSO: true,\n PERSIST_TEMPORARY_CLIENTS: true,\n },\n});\n\nexport const mockStoreFactory = (\n parameters: MockStoreParameters = {\n actions: defaultActions,\n apiClient: defaultClient,\n cookieStore: defaultCookieStore,\n core: defaultCore,\n getConfig: defaultGetConfig,\n localStorage: defaultLocalStorage,\n },\n) => {\n const {actions, apiClient, cookieStore, core, getConfig, localStorage} = parameters;\n if (core) {\n (core as any).apiClient = apiClient;\n }\n return configureStore, ThunkDispatch>([\n thunk.withExtraArgument({\n actions,\n apiClient,\n cookieStore,\n core,\n getConfig: getConfig || defaultGetConfig,\n localStorage,\n }),\n createLogger({\n actionTransformer(action: any): string {\n return JSON.stringify(action);\n },\n colors: {\n action: false,\n error: false,\n nextState: false,\n prevState: false,\n title: false,\n },\n level: {\n action: 'info',\n nextState: false,\n prevState: false,\n },\n }),\n ]);\n};\n"} +{"text": "# 王尔德\n\n王尔德(Oscar Wilde)是19世纪末英国著名作家,词典里把他称为wit(机智的人),我还没有见过第二个用这个词形容的作家呢。\n\n他活着的时候就很出名,主要原因不是因为他的作品,而是因为他总是做一些吸引眼球的事情。比如,穿一身华丽而古怪的装束招摇过市,搞搞同性恋什么的。最后还因此惹上了官司,被关进了牢里。这个人要是活在现在,估计也是轰动一时的人物,三天两头可以上报纸的娱乐版。\n\n他确实有才华,但是崇尚浮华,有些玩世不恭,不踏实。他的作品有些地方写得很出彩,但整体上不算第一流。他的人生也是悲剧性的,50岁出头就一文不名地死了。\n\n看看他的引语,我有时会被逗乐,但是更多的时候,还是提醒自己,要脚踏实地的做人和求学。\n\n1.\n\n活着是世上最稀有的事情。大多数人只是存在而已。\n\n2.\n\n第一次结婚是幻想战胜了理智,第二次结婚是期盼战胜了经验。\n\n3.\n\n时尚的东西就是丑陋的东西,丑到令人无法容忍,每六个月就非得换掉不可。\n\n4.\n\n单身汉应该被课以重税。某些人比其他人更快乐是很不公平的。\n\n5.\n\n人生就是一件蠢事追着另一件蠢事而来,而爱情则是两个蠢东西追来追去。\n\n6.\n\n就像亲爱的圣芳济一样,我也和贫穷联姻,但我的婚姻并不成功。\n\n7.\n\n音乐让人感觉非常浪漫,至少让人感觉不安,如今两者是一回事。\n\n8.\n\n没有女人应该对她的年龄十分准确。这显得有些精于算计。\n\n9.\n\n一个人决不应该相信说出自己真实年龄的女人。如果她把这都说出来了,那她什么都会说。\n\n10.\n\n请别开枪打死那个钢琴师,他已经尽力了。\n\n11.\n\n科学是死去的宗教的记录。\n\n12.\n\n《生命之书》始于一座花园里的一男一女......它最后以《启示录》告终。\n\n13.\n\n报纸和文学的区别是,报纸没法读,而文学则没人读。\n\n14.\n\n圣人和罪人的唯一区别是,每一个圣人都有过去,而每一个罪人都有未来。\n\n15.\n\n对于忠告,你所能做的,就是把它奉送给别人,忠告从来就不是给自己准备的。\n\n16.\n\n摆脱诱惑的唯一方法是屈服于它。\n\n17.\n\n演出相当成功,但观众则是一场灾难。\n\n18.\n\n公众极其宽容,他们可以宽容一切,天才除外。\n\n19.\n\n世界上只有一件比被人谈论更糟糕的事,那就是没人谈论你。\n\n20.\n\n三十五岁是一个非常有吸引力的年龄;伦敦社交圈内满是这样好多年一直保持三十五岁的女人,她们可以自由地挑来选去。\n\n21.\n\n悬念是可怕的。我希望它一直延续下去。\n\n22.\n\n时间是一种对金钱的浪费。\n\n23.\n\n爱自己就是开始一场延续一生的罗曼史。\n\n24.\n\n当我年轻时,我以为金钱是人生中最重要的东西。现在我老了,我知道这是真的。\n\n25.\n\n每当人们赞同我时,我总希望自己一定是错了。\n\n26.\n\n年轻人想要有信仰,但他们却没有;老年人不想要有信仰,但却办不到。\n\n2006年12月15日\n"} +{"text": "partial_header}}\n/**\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen\n * Do not edit the class manually.\n */\n\nnamespace {{invokerPackage}}\\DependencyInjection;\n\nuse Symfony\\Component\\Config\\FileLocator;\nuse Symfony\\Component\\DependencyInjection\\ContainerBuilder;\nuse Symfony\\Component\\DependencyInjection\\Extension\\Extension;\nuse Symfony\\Component\\DependencyInjection\\Loader\\YamlFileLoader;\n\n/**\n * {{bundleExtensionName}} Class Doc Comment\n *\n * @category Class\n * @package {{invokerPackage}}\\DependencyInjection\n * @author Swagger Codegen team\n * @link https://github.com/swagger-api/swagger-codegen\n */\nclass {{bundleExtensionName}} extends Extension\n{\n public function load(array $configs, ContainerBuilder $container)\n {\n $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));\n $loader->load('services.yml');\n }\n\n public function getAlias()\n {\n return '{{bundleAlias}}';\n }\n}\n"} +{"text": "getTreeNodeTypeHandle() == 'file_folder') {\n return '';\n }\n if ($node->getTreeNodeTypeHandle() == 'file') {\n $file = $node->getTreeNodeFileObject();\n if (is_object($file)) {\n return $file->getAuthorName();\n }\n }\n }\n\n public static function getType($node)\n {\n switch ($node->getTreeNodeTypeHandle()) {\n case 'file_folder':\n return t('Folder');\n case 'search_preset':\n return t('Saved Search');\n case 'file':\n $file = $node->getTreeNodeFileObject();\n if (is_object($file)) {\n $type = $file->getTypeObject();\n if (is_object($type)) {\n return $type->getGenericDisplayType();\n } else {\n return t('Unknown');\n }\n }\n break;\n }\n }\n\n public static function getDateModified($node)\n {\n $app = Application::getFacadeApplication();\n return $app->make('date')->formatDateTime($node->getDateLastModified());\n }\n\n public static function getName($node)\n {\n return $node->getTreeNodeDisplayName();\n }\n\n public static function getSize($node)\n {\n if ($node->getTreeNodeTypeHandle() == 'file_folder') {\n return '';\n }\n if ($node->getTreeNodeTypeHandle() == 'file') {\n $file = $node->getTreeNodeFileObject();\n if (is_object($file)) {\n return $file->getSize();\n }\n }\n }\n\n public static function getFileDateActivated($f)\n {\n $fv = $f->getVersion();\n $app = Application::getFacadeApplication();\n return $app->make('date')->formatDateTime($f->getDateAdded()->getTimestamp());\n }\n\n public function __construct()\n {\n parent::__construct();\n $this->addColumn(new Column('authorName', t('Author'),\n [self::class, 'getAuthorName'], false));\n $this->addColumn(new FileIDColumn());\n $this->addColumn(new FileVersionFilenameColumn());\n }\n}\n"} +{"text": "# to-readable-stream [![Build Status](https://travis-ci.org/sindresorhus/to-readable-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/to-readable-stream)\n\n> Convert a string/Buffer/Uint8Array to a [readable stream](https://nodejs.org/api/stream.html#stream_readable_streams)\n\n\n## Install\n\n```\n$ npm install to-readable-stream\n```\n\n\n## Usage\n\n```js\nconst toReadableStream = require('to-readable-stream');\n\ntoReadableStream('🦄🌈').pipe(process.stdout);\n```\n\n\n## API\n\n### toReadableStream(input)\n\nReturns a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_readable_streams).\n\n#### input\n\nType: `string` `Buffer` `Uint8Array`\n\nValue to convert to a stream.\n\n\n## Related\n\n- [into-stream](https://github.com/sindresorhus/into-stream) - More advanced version of this module\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n"} +{"text": "/*\n tdogl::Bitmap\n \n Copyright 2012 Thomas Dalling - http://tomdalling.com/\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n#pragma once\n\n#include \n\nnamespace tdogl {\n \n /**\n A bitmap image (i.e. a grid of pixels).\n \n This is not really related to OpenGL, but can be used to make OpenGL textures using\n tdogl::Texture.\n */\n class Bitmap {\n public:\n /**\n Represents the number of channels per pixel, and the order of the channels.\n \n Each channel is one byte (unsigned char).\n */\n enum Format {\n Format_Grayscale = 1, /**< one channel: grayscale */\n Format_GrayscaleAlpha = 2, /**< two channels: grayscale and alpha */\n Format_RGB = 3, /**< three channels: red, green, blue */\n Format_RGBA = 4 /**< four channels: red, green, blue, alpha */\n };\n \n /**\n Creates a new image with the specified width, height and format.\n \n Width and height are in pixels. Image will contain random garbage if\n pixels = NULL.\n */\n Bitmap(unsigned width, \n unsigned height, \n Format format,\n const unsigned char* pixels = NULL);\n ~Bitmap();\n \n /**\n Tries to load the given file into a tdogl::Bitmap.\n */\n static Bitmap bitmapFromFile(std::string filePath);\n \n /** width in pixels */\n unsigned width() const;\n \n /** height in pixels */\n unsigned height() const;\n \n /** the pixel format of the bitmap */\n Format format() const;\n \n /**\n Pointer to the raw pixel data of the bitmap.\n \n Each channel is 1 byte. The number and meaning of channels per pixel is specified\n by the `Format` of the image. The pointer points to all the columns of\n the top row of the image, followed by each remaining row down to the bottom.\n i.e. c0r0, c1r0, c2r0, ..., c0r1, c1r1, c2r1, etc\n */\n unsigned char* pixelBuffer() const;\n \n /**\n Returns a pointer to the start of the pixel at the given coordinates. \n \n The size of the pixel depends on the `Format` of the image.\n */\n unsigned char* getPixel(unsigned int column, unsigned int row) const;\n \n /**\n Sets the raw pixel data at the given coordinates.\n \n The size of the pixel depends on the `Format` of the bitmap.\n */\n void setPixel(unsigned int column, unsigned int row, const unsigned char* pixel);\n \n /**\n Reverses the row order of the pixels, so the bitmap will be upside down.\n */\n void flipVertically();\n \n /**\n Rotates the image 90 degrees counter clockwise.\n */\n void rotate90CounterClockwise();\n \n /**\n Copies a rectangular area from the given source bitmap into this bitmap.\n \n If srcCol, srcRow, width, and height are all zero, the entire source\n bitmap will be copied (full width and height).\n \n If the source bitmap has a different format to the destination bitmap, \n the pixels will be converted to match the destination format.\n \n Will throw and exception if the source and destination bitmaps are the \n same, and the source and destination rectangles overlap. If you want to\n copy a bitmap onto itself, then make a copy of the bitmap first.\n */\n void copyRectFromBitmap(const Bitmap& src, \n unsigned srcCol, \n unsigned srcRow, \n unsigned destCol, \n unsigned destRow,\n unsigned width,\n unsigned height);\n \n /** Copy constructor */\n Bitmap(const Bitmap& other);\n \n /** Assignment operator */\n Bitmap& operator = (const Bitmap& other);\n \n private:\n Format _format;\n unsigned _width;\n unsigned _height;\n unsigned char* _pixels;\n \n void _set(unsigned width, unsigned height, Format format, const unsigned char* pixels);\n static void _getPixelOffset(unsigned col, unsigned row, unsigned width, unsigned height, Format format);\n };\n \n}\n"} +{"text": "\n\n #FFFFFF\n Diagonal\n #FFFFFF\n SpecifiedUser\n false\n \n Medium\n \n true\n Auto\n Column\n Auto\n false\n false\n false\n false\n \n Bottom\n Milestone_Project_Management/Snapshot_Project_Date_Open_Tasks_DB\n false\n false\n RowLabelAscending\n Snapshot: Open Task Count\n false\n \n \n \n Medium\n \n true\n Auto\n Column\n Auto\n false\n false\n false\n false\n \n Bottom\n Milestone_Project_Management/Snapshots_Active_Project_Count_DB\n false\n false\n RowLabelAscending\n Snapshot: Active Project Count\n false\n \n \n \n Medium\n \n true\n Auto\n Column\n Auto\n false\n false\n false\n false\n \n Bottom\n Milestone_Project_Management/Snapshots_Total_Estimated_Task_Hours\n false\n false\n RowLabelAscending\n Snapshot: Total Est Project Hrs\n false\n \n \n bmariani@milestonespm.com\n #000000\n Milestones PM Project Snapshots\n #000000\n 12\n\n"} +{"text": "\n\n\n \n\n \n \n \n \n \n \n \n \n\n \n\n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n\n \n\n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n\n"} +{"text": "package com.conversantmedia.util.concurrent;\n\n/*\n * #%L\n * Conversant Disruptor\n * ~~\n * Conversantmedia.com © 2016, Conversant, Inc. Conversant® is a trademark of Conversant, Inc.\n * ~~\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * #L%\n */\n\nimport java.util.concurrent.locks.ReentrantLock;\n\n/**\n * Created by jcairns on 12/11/14.\n */\n\n// use java sync to signal\nabstract class AbstractCondition implements Condition {\n\n private final ReentrantLock queueLock = new ReentrantLock();\n\n private final java.util.concurrent.locks.Condition condition = queueLock.newCondition();\n\n // wake me when the condition is satisfied, or timeout\n @Override\n public void awaitNanos(final long timeout) throws InterruptedException {\n long remaining = timeout;\n queueLock.lock();\n try {\n while(test() && remaining > 0) {\n remaining = condition.awaitNanos(remaining);\n }\n }\n finally {\n queueLock.unlock();\n }\n }\n\n // wake if signal is called, or wait indefinitely\n @Override\n public void await() throws InterruptedException {\n queueLock.lock();\n try {\n while(test()) {\n condition.await();\n }\n }\n finally {\n queueLock.unlock();\n }\n }\n\n // tell threads waiting on condition to wake up\n @Override\n public void signal() {\n queueLock.lock();\n try {\n condition.signalAll();\n }\n finally {\n queueLock.unlock();\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) 2014 Benoit Steiner \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#include \"main.h\"\n\n#include \n\nusing Eigen::Tensor;\n\n\nstatic void test_dynamic_size()\n{\n Eigen::DSizes dimensions(2,3,7);\n\n VERIFY_IS_EQUAL((int)Eigen::internal::array_get<0>(dimensions), 2);\n VERIFY_IS_EQUAL((int)Eigen::internal::array_get<1>(dimensions), 3);\n VERIFY_IS_EQUAL((int)Eigen::internal::array_get<2>(dimensions), 7);\n VERIFY_IS_EQUAL((int)dimensions.TotalSize(), 2*3*7);\n VERIFY_IS_EQUAL((int)dimensions[0], 2);\n VERIFY_IS_EQUAL((int)dimensions[1], 3);\n VERIFY_IS_EQUAL((int)dimensions[2], 7);\n}\n\nstatic void test_fixed_size()\n{\n Eigen::Sizes<2,3,7> dimensions;\n\n VERIFY_IS_EQUAL((int)Eigen::internal::array_get<0>(dimensions), 2);\n VERIFY_IS_EQUAL((int)Eigen::internal::array_get<1>(dimensions), 3);\n VERIFY_IS_EQUAL((int)Eigen::internal::array_get<2>(dimensions), 7);\n VERIFY_IS_EQUAL((int)dimensions.TotalSize(), 2*3*7);\n}\n\nstatic void test_match()\n{\n Eigen::DSizes dyn((unsigned int)2,(unsigned int)3,(unsigned int)7);\n Eigen::Sizes<2,3,7> stat;\n VERIFY_IS_EQUAL(Eigen::dimensions_match(dyn, stat), true);\n\n Eigen::DSizes dyn1(2,3,7);\n Eigen::DSizes dyn2(2,3);\n VERIFY_IS_EQUAL(Eigen::dimensions_match(dyn1, dyn2), false);\n}\n\nstatic void test_rank_zero()\n{\n Eigen::Sizes<> scalar;\n VERIFY_IS_EQUAL((int)scalar.TotalSize(), 1);\n VERIFY_IS_EQUAL((int)scalar.rank(), 0);\n VERIFY_IS_EQUAL((int)internal::array_prod(scalar), 1);\n\n Eigen::DSizes dscalar;\n VERIFY_IS_EQUAL((int)dscalar.TotalSize(), 1);\n VERIFY_IS_EQUAL((int)dscalar.rank(), 0);\n}\n\nvoid test_cxx11_tensor_dimension()\n{\n CALL_SUBTEST(test_dynamic_size());\n CALL_SUBTEST(test_fixed_size());\n CALL_SUBTEST(test_match());\n CALL_SUBTEST(test_rank_zero());\n}\n"} +{"text": "gcr.io/google_containers/github-transform:v20170322-164858\n"} +{"text": "#\n# SPDX-License-Identifier:\tGPL-2.0+\n#\n\nobj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o\nobj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o\nobj-y += boot-mode.o\nobj-$(CONFIG_DEBUG_LL) += lowlevel_debug.o\nobj-$(CONFIG_SOC_INIT) += bcu_init.o sbc_init.o sg_init.o pll_init.o \\\n\t\t\t\t\t\t\t\tclkrst_init.o\nobj-$(CONFIG_BOARD_POSTCLK_INIT) += pinctrl.o\nobj-$(CONFIG_DRAM_INIT) += pll_spectrum.o umc_init.o ddrphy_init.o\n"} +{"text": "import unittest\n\nimport mock\n\nfrom kalliope.core.NeuronModule import MissingParameterException\nfrom kalliope.neurons.brain.brain import Brain\n\n\nclass TestBrain(unittest.TestCase):\n\n def test_is_parameters_ok(self):\n # valid neuron with boolean\n synapse_name = \"synapse_name\"\n enabled = True\n with mock.patch(\"kalliope.neurons.brain.brain.Brain._update_brain\"):\n brain_neuron = Brain(synapse_name=synapse_name, enabled=enabled)\n self.assertTrue(brain_neuron._is_parameters_ok())\n self.assertTrue(brain_neuron.enabled)\n\n # valid neuron with boolean as string\n synapse_name = \"synapse_name\"\n enabled = \"True\"\n with mock.patch(\"kalliope.neurons.brain.brain.Brain._update_brain\"):\n brain_neuron = Brain(synapse_name=synapse_name, enabled=enabled)\n self.assertTrue(brain_neuron._is_parameters_ok())\n self.assertTrue(brain_neuron.enabled)\n\n # valid neuron with boolean as string\n synapse_name = \"synapse_name\"\n enabled = \"true\"\n with mock.patch(\"kalliope.neurons.brain.brain.Brain._update_brain\"):\n brain_neuron = Brain(synapse_name=synapse_name, enabled=enabled)\n self.assertTrue(brain_neuron._is_parameters_ok())\n self.assertTrue(brain_neuron.enabled)\n\n # invalid neuron with no synapse name\n synapse_name = \"\"\n enabled = \"true\"\n with mock.patch(\"kalliope.neurons.brain.brain.Brain._update_brain\"):\n with self.assertRaises(MissingParameterException):\n Brain(synapse_name=synapse_name, enabled=enabled)\n\n # invalid neuron with no synapse name\n synapse_name = \"test\"\n enabled = \"\"\n with mock.patch(\"kalliope.neurons.brain.brain.Brain._update_brain\"):\n with self.assertRaises(MissingParameterException):\n Brain(synapse_name=synapse_name, enabled=enabled)\n\n # valid neuron but enabled bool automatically converted to False\n synapse_name = \"test\"\n enabled = \"no a bool\"\n with mock.patch(\"kalliope.neurons.brain.brain.Brain._update_brain\"):\n brain_neuron = Brain(synapse_name=synapse_name, enabled=enabled)\n self.assertTrue(brain_neuron._is_parameters_ok())\n self.assertFalse(brain_neuron.enabled)\n\n\nif __name__ == '__main__':\n unittest.main()\n"} +{"text": "{\n \"kinds\": [\n \"COMPILATION_UNIT\"\n ],\n \"nativeNode\": \"COMPILATION_UNIT\",\n \"children\": [\n {\n \"kinds\": [\n \"CLASS\",\n \"STATEMENT\",\n \"TYPE\"\n ],\n \"nativeNode\": \"CLASS\",\n \"children\": [\n {\n \"kinds\": [\n \"KEYWORD\"\n ],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"class\",\n \"line\": 1,\n \"endLine\": 1,\n \"column\": 1,\n \"endColumn\": 5\n },\n \"children\": []\n },\n {\n \"kinds\": [\n \"EXPRESSION\",\n \"IDENTIFIER\"\n ],\n \"nativeNode\": \"IDENTIFIER\",\n \"children\": [\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"A\",\n \"line\": 1,\n \"endLine\": 1,\n \"column\": 7,\n \"endColumn\": 7\n },\n \"children\": []\n }\n ]\n },\n {\n \"kinds\": [\n \"TYPE_PARAMETERS\"\n ],\n \"nativeNode\": \"TYPE_PARAMETERS\",\n \"children\": [\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"\\u003c\",\n \"line\": 1,\n \"endLine\": 1,\n \"column\": 8,\n \"endColumn\": 8\n },\n \"children\": []\n },\n {\n \"kinds\": [\n \"TYPE_PARAMETER\"\n ],\n \"nativeNode\": \"TYPE_PARAMETER\",\n \"children\": [\n {\n \"kinds\": [\n \"EXPRESSION\",\n \"IDENTIFIER\"\n ],\n \"nativeNode\": \"IDENTIFIER\",\n \"children\": [\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"T\",\n \"line\": 1,\n \"endLine\": 1,\n \"column\": 9,\n \"endColumn\": 9\n },\n \"children\": []\n }\n ]\n }\n ]\n },\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"\\u003e\",\n \"line\": 1,\n \"endLine\": 1,\n \"column\": 10,\n \"endColumn\": 10\n },\n \"children\": []\n }\n ]\n },\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"{\",\n \"line\": 1,\n \"endLine\": 1,\n \"column\": 12,\n \"endColumn\": 12\n },\n \"children\": []\n },\n {\n \"kinds\": [\n \"STATEMENT\",\n \"VARIABLE_DECLARATION\"\n ],\n \"nativeNode\": \"VARIABLE\",\n \"children\": [\n {\n \"kinds\": [\n \"EXPRESSION\",\n \"IDENTIFIER\",\n \"TYPE\"\n ],\n \"nativeNode\": \"IDENTIFIER\",\n \"children\": [\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"T\",\n \"line\": 2,\n \"endLine\": 2,\n \"column\": 3,\n \"endColumn\": 3\n },\n \"children\": []\n }\n ]\n },\n {\n \"kinds\": [\n \"EXPRESSION\",\n \"IDENTIFIER\",\n \"VARIABLE_NAME\"\n ],\n \"nativeNode\": \"IDENTIFIER\",\n \"children\": [\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"x\",\n \"line\": 2,\n \"endLine\": 2,\n \"column\": 5,\n \"endColumn\": 5\n },\n \"children\": []\n }\n ]\n },\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \";\",\n \"line\": 2,\n \"endLine\": 2,\n \"column\": 6,\n \"endColumn\": 6\n },\n \"children\": []\n }\n ]\n },\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"}\",\n \"line\": 3,\n \"endLine\": 3,\n \"column\": 1,\n \"endColumn\": 1\n },\n \"children\": []\n }\n ]\n },\n {\n \"kinds\": [\n \"CLASS\",\n \"STATEMENT\",\n \"TYPE\"\n ],\n \"nativeNode\": \"CLASS\",\n \"children\": [\n {\n \"kinds\": [\n \"KEYWORD\"\n ],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"class\",\n \"line\": 5,\n \"endLine\": 5,\n \"column\": 1,\n \"endColumn\": 5\n },\n \"children\": []\n },\n {\n \"kinds\": [\n \"EXPRESSION\",\n \"IDENTIFIER\"\n ],\n \"nativeNode\": \"IDENTIFIER\",\n \"children\": [\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"B\",\n \"line\": 5,\n \"endLine\": 5,\n \"column\": 7,\n \"endColumn\": 7\n },\n \"children\": []\n }\n ]\n },\n {\n \"kinds\": [\n \"KEYWORD\"\n ],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"extends\",\n \"line\": 5,\n \"endLine\": 5,\n \"column\": 9,\n \"endColumn\": 15\n },\n \"children\": []\n },\n {\n \"kinds\": [\n \"EXPRESSION\",\n \"TYPE\"\n ],\n \"nativeNode\": \"PARAMETERIZED_TYPE\",\n \"children\": [\n {\n \"kinds\": [\n \"EXPRESSION\",\n \"IDENTIFIER\"\n ],\n \"nativeNode\": \"IDENTIFIER\",\n \"children\": [\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"A\",\n \"line\": 5,\n \"endLine\": 5,\n \"column\": 17,\n \"endColumn\": 17\n },\n \"children\": []\n }\n ]\n },\n {\n \"kinds\": [\n \"TYPE_ARGUMENTS\"\n ],\n \"nativeNode\": \"TYPE_ARGUMENTS\",\n \"children\": [\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"\\u003c\",\n \"line\": 5,\n \"endLine\": 5,\n \"column\": 18,\n \"endColumn\": 18\n },\n \"children\": []\n },\n {\n \"kinds\": [\n \"EXPRESSION\",\n \"IDENTIFIER\",\n \"TYPE_ARGUMENT\"\n ],\n \"nativeNode\": \"IDENTIFIER\",\n \"children\": [\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"Integer\",\n \"line\": 5,\n \"endLine\": 5,\n \"column\": 19,\n \"endColumn\": 25\n },\n \"children\": []\n }\n ]\n },\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"\\u003e\",\n \"line\": 5,\n \"endLine\": 5,\n \"column\": 26,\n \"endColumn\": 26\n },\n \"children\": []\n }\n ]\n }\n ]\n },\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"{\",\n \"line\": 5,\n \"endLine\": 5,\n \"column\": 28,\n \"endColumn\": 28\n },\n \"children\": []\n },\n {\n \"kinds\": [],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"}\",\n \"line\": 7,\n \"endLine\": 7,\n \"column\": 1,\n \"endColumn\": 1\n },\n \"children\": []\n }\n ]\n },\n {\n \"kinds\": [\n \"EOF\"\n ],\n \"nativeNode\": \"TOKEN\",\n \"token\": {\n \"value\": \"\",\n \"line\": 8,\n \"endLine\": 8,\n \"column\": 1,\n \"endColumn\": 0\n },\n \"children\": []\n }\n ]\n}"} +{"text": "}))}(document, Math));\n"} +{"text": "\r\n\r\n\r\n \r\n \r\n\t\r\n\t\r\n\r\n \r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
Join an online session
\r\n\t\t\t
Please enter the session code.
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\r\n \r\n\r\n"} +{"text": "/*\n * This class is distributed as part of the Psi Mod.\n * Get the Source Code in github:\n * https://github.com/Vazkii/Psi\n *\n * Psi is Open Source and distributed under the\n * Psi License: https://psi.vazkii.net/license.php\n */\npackage vazkii.psi.client.core.handler;\n\nimport net.minecraft.item.ItemStack;\nimport net.minecraft.util.DefaultUncaughtExceptionHandler;\nimport net.minecraftforge.event.entity.player.PlayerEvent;\nimport net.minecraftforge.eventbus.api.SubscribeEvent;\nimport net.minecraftforge.fml.common.Mod;\n\nimport org.apache.logging.log4j.Level;\n\nimport vazkii.psi.api.cad.CADTakeEvent;\nimport vazkii.psi.api.cad.EnumCADComponent;\nimport vazkii.psi.api.cad.ICAD;\nimport vazkii.psi.api.cad.ICADColorizer;\nimport vazkii.psi.common.Psi;\nimport vazkii.psi.common.item.ItemCAD;\nimport vazkii.psi.common.lib.LibMisc;\n\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.net.URL;\nimport java.nio.charset.StandardCharsets;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Properties;\nimport java.util.stream.Stream;\n\n@Mod.EventBusSubscriber(modid = LibMisc.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE)\npublic final class ContributorSpellCircleHandler {\n\n\tprivate static volatile Map colormap = Collections.emptyMap();\n\tprivate static boolean startedLoading = false;\n\n\tpublic static void load(Properties props) {\n\t\tMap m = new HashMap<>();\n\t\tfor (String key : props.stringPropertyNames()) {\n\t\t\tString value = props.getProperty(key).replace(\"#\", \"0x\");\n\t\t\ttry {\n\t\t\t\tint[] values = Stream.of(value.split(\",\")).mapToInt(el -> Integer.parseInt(el.substring(2), 16)).toArray();\n\t\t\t\tm.put(key, values);\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tPsi.logger.log(Level.ERROR, \"Contributor \" + key + \" has an invalid hexcode!\");\n\t\t\t}\n\t\t}\n\t\tcolormap = m;\n\t}\n\n\tpublic static void firstStart() {\n\t\tif (!startedLoading) {\n\t\t\tnew ThreadContributorListLoader();\n\t\t\tstartedLoading = true;\n\t\t}\n\t}\n\n\tpublic static int[] getColors(String name) {\n\t\treturn colormap.getOrDefault(name, new int[] { ICADColorizer.DEFAULT_SPELL_COLOR });\n\t}\n\n\tpublic static boolean isContributor(String name) {\n\t\treturn colormap.containsKey(name);\n\t}\n\n\t@SubscribeEvent\n\tpublic static void onCadTake(CADTakeEvent event) {\n\t\tif (ContributorSpellCircleHandler.isContributor(event.getPlayer().getName().getString().toLowerCase()) && !((ICAD) event.getCad().getItem()).getComponentInSlot(event.getCad(), EnumCADComponent.DYE).isEmpty()) {\n\t\t\tItemStack dyeStack = ((ICAD) event.getCad().getItem()).getComponentInSlot(event.getCad(), EnumCADComponent.DYE);\n\t\t\t((ICADColorizer) dyeStack.getItem()).setContributorName(dyeStack, event.getPlayer().getName().getString());\n\t\t\tItemCAD.setComponent(event.getCad(), dyeStack);\n\t\t}\n\t}\n\n\t@SubscribeEvent\n\tpublic static void craftColorizer(PlayerEvent.ItemCraftedEvent event) {\n\t\tif (ContributorSpellCircleHandler.isContributor(event.getPlayer().getName().getString().toLowerCase()) && event.getCrafting().getItem() instanceof ICADColorizer) {\n\t\t\t((ICADColorizer) event.getCrafting().getItem()).setContributorName(event.getCrafting(), event.getPlayer().getName().getString());\n\t\t}\n\t}\n\n\tprivate static class ThreadContributorListLoader extends Thread {\n\n\t\tpublic ThreadContributorListLoader() {\n\t\t\tsetName(\"Psi Contributor Spell Circle Loader Thread\");\n\t\t\tsetDaemon(true);\n\t\t\tsetUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(Psi.logger));\n\t\t\tstart();\n\t\t}\n\n\t\t@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tURL url = new URL(\"https://raw.githubusercontent.com/Vazkii/Psi/master/contributors.properties\");\n\t\t\t\tProperties props = new Properties();\n\t\t\t\ttry (InputStreamReader reader = new InputStreamReader(url.openStream(), StandardCharsets.UTF_8)) {\n\t\t\t\t\tprops.load(reader);\n\t\t\t\t\tload(props);\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\tPsi.logger.info(\"Could not load contributors list. Either you're offline or github is down. Nothing to worry about, carry on~\");\n\t\t\t}\n\t\t}\n\n\t}\n}\n"} +{"text": "/**\n * @private\n */\nExt.define('Ext.ux.device.twitter.Cordova', {\n compose: function(config) {\n \twindows.plugins.twitter.composeTweet(\n\t\t\tconfig.success,\n\t\t\tconfig.failure,\n\t\t\tconfig.tweet,\n\t\t\t{\n\t\t\t\turlAttach: config.url,\n\t\t\t\timageAttach: config.image\n\t\t\t}\n\t\t);\n },\n\n getPublicTimeline: function(config) {\n \twindow.plugins.twitter.getPublicTimeline(\n \t\tconfig.success,\n \t\tconfig.failure\n \t);\n },\n\n getMentions: function(config) {\n \twindow.plugins.twitter.getMentions(\n \t\tconfig.success,\n \t\tconfig.failure\n \t);\n },\n \n getTwitterUsername: function(config) {\n \twindow.plugins.twitter.getTwitterUsername(\n \t\tconfig.success,\n \t\tconfig.failure\n \t);\n },\n\n getTwitterRequest: function(config) {\n \twindow.plugins.twitter.getTWRequest(\n \t\tconfig.url,\n \t\tconfig.params,\n \t\tconfig.success,\n \t\tconfig.failure,\n \t\tconfig.options\n \t);\n }\n});\n"} +{"text": "//\n// HSGrowingTextField.m\n// Hammerspoon\n//\n// Created by Chris Jones on 11/06/2015.\n// Copyright (c) 2015 Hammerspoon. All rights reserved.\n//\n\n#import \"HSGrowingTextField.h\"\n\n@implementation HSGrowingTextField\n\n- (void)textDidBeginEditing:(NSNotification *)notification {\n [super textDidBeginEditing:notification];\n _isEditing = YES;\n}\n\n- (void)textDidEndEditing:(NSNotification *)notification {\n [super textDidEndEditing:notification];\n _isEditing = NO;\n}\n\n- (void)textDidChange:(NSNotification *)notification {\n [super textDidChange:notification];\n [self invalidateIntrinsicContentSize];\n}\n\n- (void)resetGrowth {\n _hasLastIntrinsicSize = NO;\n [self invalidateIntrinsicContentSize];\n}\n\n-(NSSize)intrinsicContentSize {\n NSSize intrinsicSize = _lastIntrinsicSize;\n\n // Only update the size if we’re editing the text, or if we’ve not set it yet\n // If we try and update it while another text field is selected, it may shrink back down to only the size of one line (for some reason?)\n if(_isEditing || !_hasLastIntrinsicSize) {\n intrinsicSize = [super intrinsicContentSize];\n\n // If we’re being edited, get the shared NSTextView field editor, so we can get more info\n NSText *fieldEditor = [self.window fieldEditor:NO forObject:self];\n if([fieldEditor isKindOfClass:[NSTextView class]]) {\n NSTextView *textView = (NSTextView *)fieldEditor;\n [textView.textContainer.layoutManager ensureLayoutForTextContainer:textView.textContainer] ;\n NSRect usedRect = [textView.textContainer.layoutManager usedRectForTextContainer:textView.textContainer];\n\n usedRect.size.height += 5.0; // magic number! (the field editor TextView is offset within the NSTextField. It’s easy to get the space above (it’s origin), but it’s difficult to get the default spacing for the bottom, as we may be changing the height\n\n intrinsicSize.height = usedRect.size.height;\n }\n\n if (intrinsicSize.height > 100) {\n intrinsicSize.height = 100;\n } else {\n _lastIntrinsicSize = intrinsicSize;\n _hasLastIntrinsicSize = YES;\n }\n }\n\n return intrinsicSize;\n}\n\n@end\n"} +{"text": "// Code generated by solo-kit. DO NOT EDIT.\n\npackage kubernetes\n\nimport (\n\t\"github.com/solo-io/solo-kit/pkg/api/v1/clients\"\n\t\"github.com/solo-io/solo-kit/pkg/api/v1/clients/factory\"\n\t\"github.com/solo-io/solo-kit/pkg/api/v1/resources\"\n\t\"github.com/solo-io/solo-kit/pkg/errors\"\n)\n\ntype ServiceWatcher interface {\n\t// watch namespace-scoped services\n\tWatch(namespace string, opts clients.WatchOpts) (<-chan ServiceList, <-chan error, error)\n}\n\ntype ServiceClient interface {\n\tBaseClient() clients.ResourceClient\n\tRegister() error\n\tRead(namespace, name string, opts clients.ReadOpts) (*Service, error)\n\tWrite(resource *Service, opts clients.WriteOpts) (*Service, error)\n\tDelete(namespace, name string, opts clients.DeleteOpts) error\n\tList(namespace string, opts clients.ListOpts) (ServiceList, error)\n\tServiceWatcher\n}\n\ntype serviceClient struct {\n\trc clients.ResourceClient\n}\n\nfunc NewServiceClient(rcFactory factory.ResourceClientFactory) (ServiceClient, error) {\n\treturn NewServiceClientWithToken(rcFactory, \"\")\n}\n\nfunc NewServiceClientWithToken(rcFactory factory.ResourceClientFactory, token string) (ServiceClient, error) {\n\trc, err := rcFactory.NewResourceClient(factory.NewResourceClientParams{\n\t\tResourceType: &Service{},\n\t\tToken: token,\n\t})\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"creating base Service resource client\")\n\t}\n\treturn NewServiceClientWithBase(rc), nil\n}\n\nfunc NewServiceClientWithBase(rc clients.ResourceClient) ServiceClient {\n\treturn &serviceClient{\n\t\trc: rc,\n\t}\n}\n\nfunc (client *serviceClient) BaseClient() clients.ResourceClient {\n\treturn client.rc\n}\n\nfunc (client *serviceClient) Register() error {\n\treturn client.rc.Register()\n}\n\nfunc (client *serviceClient) Read(namespace, name string, opts clients.ReadOpts) (*Service, error) {\n\topts = opts.WithDefaults()\n\n\tresource, err := client.rc.Read(namespace, name, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn resource.(*Service), nil\n}\n\nfunc (client *serviceClient) Write(service *Service, opts clients.WriteOpts) (*Service, error) {\n\topts = opts.WithDefaults()\n\tresource, err := client.rc.Write(service, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn resource.(*Service), nil\n}\n\nfunc (client *serviceClient) Delete(namespace, name string, opts clients.DeleteOpts) error {\n\topts = opts.WithDefaults()\n\n\treturn client.rc.Delete(namespace, name, opts)\n}\n\nfunc (client *serviceClient) List(namespace string, opts clients.ListOpts) (ServiceList, error) {\n\topts = opts.WithDefaults()\n\n\tresourceList, err := client.rc.List(namespace, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn convertToService(resourceList), nil\n}\n\nfunc (client *serviceClient) Watch(namespace string, opts clients.WatchOpts) (<-chan ServiceList, <-chan error, error) {\n\topts = opts.WithDefaults()\n\n\tresourcesChan, errs, initErr := client.rc.Watch(namespace, opts)\n\tif initErr != nil {\n\t\treturn nil, nil, initErr\n\t}\n\tservicesChan := make(chan ServiceList)\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase resourceList := <-resourcesChan:\n\t\t\t\tservicesChan <- convertToService(resourceList)\n\t\t\tcase <-opts.Ctx.Done():\n\t\t\t\tclose(servicesChan)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\treturn servicesChan, errs, nil\n}\n\nfunc convertToService(resources resources.ResourceList) ServiceList {\n\tvar serviceList ServiceList\n\tfor _, resource := range resources {\n\t\tserviceList = append(serviceList, resource.(*Service))\n\t}\n\treturn serviceList\n}\n"} +{"text": "\n\n\n\n\tCFBundleDevelopmentRegion\n\ten\n\tCFBundleExecutable\n\t$(EXECUTABLE_NAME)\n\tCFBundleIdentifier\n\t$(PRODUCT_BUNDLE_IDENTIFIER)\n\tCFBundleInfoDictionaryVersion\n\t6.0\n\tCFBundleName\n\t$(PRODUCT_NAME)\n\tCFBundlePackageType\n\tBNDL\n\tCFBundleShortVersionString\n\t1.0\n\tCFBundleSignature\n\t????\n\tCFBundleVersion\n\t1\n\n\n"} +{"text": "/*eslint no-unused-vars: [\"error\", {\"args\": \"none\"}]*/\n\nexport {\n\ttableLayouts,\n\tdefaultTableLayout\n};\n\nconst tableLayouts = {\n\tnoBorders: {\n\t\thLineWidth(i) {\n\t\t\treturn 0;\n\t\t},\n\t\tvLineWidth(i) {\n\t\t\treturn 0;\n\t\t},\n\t\tpaddingLeft(i) {\n\t\t\treturn i && 4 || 0;\n\t\t},\n\t\tpaddingRight(i, node) {\n\t\t\treturn (i < node.table.widths.length - 1) ? 4 : 0;\n\t\t}\n\t},\n\theaderLineOnly: {\n\t\thLineWidth(i, node) {\n\t\t\tif (i === 0 || i === node.table.body.length) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn (i === node.table.headerRows) ? 2 : 0;\n\t\t},\n\t\tvLineWidth(i) {\n\t\t\treturn 0;\n\t\t},\n\t\tpaddingLeft(i) {\n\t\t\treturn i === 0 ? 0 : 8;\n\t\t},\n\t\tpaddingRight(i, node) {\n\t\t\treturn (i === node.table.widths.length - 1) ? 0 : 8;\n\t\t}\n\t},\n\tlightHorizontalLines: {\n\t\thLineWidth(i, node) {\n\t\t\tif (i === 0 || i === node.table.body.length) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn (i === node.table.headerRows) ? 2 : 1;\n\t\t},\n\t\tvLineWidth(i) {\n\t\t\treturn 0;\n\t\t},\n\t\thLineColor(i) {\n\t\t\treturn i === 1 ? 'black' : '#aaa';\n\t\t},\n\t\tpaddingLeft(i) {\n\t\t\treturn i === 0 ? 0 : 8;\n\t\t},\n\t\tpaddingRight(i, node) {\n\t\t\treturn (i === node.table.widths.length - 1) ? 0 : 8;\n\t\t}\n\t}\n};\n\nconst defaultTableLayout = {\n\thLineWidth(i, node) {\n\t\treturn 1;\n\t},\n\tvLineWidth(i, node) {\n\t\treturn 1;\n\t},\n\thLineColor(i, node) {\n\t\treturn 'black';\n\t},\n\tvLineColor(i, node) {\n\t\treturn 'black';\n\t},\n\thLineStyle(i, node) {\n\t\treturn null;\n\t},\n\tvLineStyle(i, node) {\n\t\treturn null;\n\t},\n\tpaddingLeft(i, node) {\n\t\treturn 4;\n\t},\n\tpaddingRight(i, node) {\n\t\treturn 4;\n\t},\n\tpaddingTop(i, node) {\n\t\treturn 2;\n\t},\n\tpaddingBottom(i, node) {\n\t\treturn 2;\n\t},\n\tfillColor(i, node) {\n\t\treturn null;\n\t},\n\tfillOpacity(i, node) {\n\t\treturn 1;\n\t},\n\tdefaultBorder: true\n};\n"} +{"text": ">dede>>\r\n子栏目标签\r\n全局标记\r\nV55,V56,V57\r\n子栏目调用标签\r\n\r\n{dede:sonchannel}\r\n[field:typename/]\r\n{/dede:sonchannel}\r\n\r\n\r\n row:返回数目 \r\n col:默认单列显示\r\n nosonmsg:没有指定ID子栏目显示的信息内容\r\n \r\n>>dede>>*/\r\n \r\nfunction lib_sonchannel(&$ctag,&$refObj)\r\n{\r\n global $_sys_globals,$dsql;\r\n\r\n $attlist = \"row|100,nosonmsg|,col|1\";\r\n FillAttsDefault($ctag->CAttribute->Items,$attlist);\r\n extract($ctag->CAttribute->Items, EXTR_SKIP);\r\n $innertext = $ctag->GetInnerText();\r\n\r\n $typeid = $_sys_globals['typeid'];\r\n if(empty($typeid))\r\n {\r\n return $ctag->GetAtt('nosonmsg');\r\n }\r\n\r\n $sql = \"SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n FROM `#@__arctype` WHERE reid='$typeid' AND ishidden<>1 ORDER BY sortrank ASC LIMIT 0,$row\";\r\n\r\n //And id<>'$typeid'\r\n $dtp2 = new DedeTagParse();\r\n $dtp2->SetNameSpace(\"field\",\"[\",\"]\");\r\n $dtp2->LoadSource($innertext);\r\n $dsql->SetQuery($sql);\r\n $dsql->Execute();\r\n $line = $row;\r\n $GLOBALS['autoindex'] = 0;\r\n $likeType = '';\r\n for($i=0;$i < $line;$i++)\r\n {\r\n if($col>1) $likeType .= \"
\\r\\n\";\r\n for($j=0;$j<$col;$j++)\r\n {\r\n if($col>1) $likeType .= \"
\\r\\n\";\r\n if($row=$dsql->GetArray())\r\n {\r\n $row['typelink'] = $row['typeurl'] = GetOneTypeUrlA($row);\r\n if(is_array($dtp2->CTags))\r\n {\r\n foreach($dtp2->CTags as $tagid=>$ctag){\r\n if(isset($row[$ctag->GetName()])) $dtp2->Assign($tagid,$row[$ctag->GetName()]);\r\n }\r\n }\r\n $likeType .= $dtp2->GetResult();\r\n }\r\n if($col>1) $likeType .= \"
\\r\\n\";\r\n $GLOBALS['autoindex']++;\r\n }//Loop Col\r\n if($col>1)\r\n {\r\n $i += $col - 1;\r\n $likeType .= \"
\\r\\n\";\r\n }\r\n }//Loop for $i\r\n $dsql->FreeResult();\r\n return $likeType;\r\n}"} +{"text": "var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n"} +{"text": ";/**************************************************************************//**\n; * @file startup_ARMCM4.s\n; * @brief CMSIS Core Device Startup File for\n; * ARMCM4 Device Series\n; * @version V5.00\n; * @date 02. March 2016\n; ******************************************************************************/\n;/*\n; * Copyright (c) 2009-2016 ARM Limited. All rights reserved.\n; *\n; * SPDX-License-Identifier: Apache-2.0\n; *\n; * Licensed under the Apache License, Version 2.0 (the License); you may\n; * not use this file except in compliance with the License.\n; * You may obtain a copy of the License at\n; *\n; * www.apache.org/licenses/LICENSE-2.0\n; *\n; * Unless required by applicable law or agreed to in writing, software\n; * distributed under the License is distributed on an AS IS BASIS, WITHOUT\n; * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n; * See the License for the specific language governing permissions and\n; * limitations under the License.\n; */\n\n;/*\n;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------\n;*/\n\n\n; Stack Configuration\n; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>\n; \n\nStack_Size EQU 0x00001800\n\n AREA STACK, NOINIT, READWRITE, ALIGN=3\nStack_Mem SPACE Stack_Size\n__initial_sp\n\n\n; Heap Configuration\n; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>\n; \n\nHeap_Size EQU 0x00000000\n\n AREA HEAP, NOINIT, READWRITE, ALIGN=3\n__heap_base\nHeap_Mem SPACE Heap_Size\n__heap_limit\n\n\n PRESERVE8\n THUMB\n\n\n; Vector Table Mapped to Address 0 at Reset\n\n AREA RESET, DATA, READONLY\n EXPORT __Vectors\n EXPORT __Vectors_End\n EXPORT __Vectors_Size\n\n__Vectors DCD __initial_sp ;(0x00)Top of Stack\n DCD Reset_Handler ;(0x04)IRQ -15 Reset Handler\n DCD NMI_Handler ;(0x08)IRQ -14 NMI Handler\n DCD HardFault_Handler ;(0x0C)IRQ -13 Hard Fault Handler\n DCD MemManage_Handler ;(0x10)IRQ -12 MPU Fault Handler\n DCD BusFault_Handler ;(0x14)IRQ -11 Bus Fault Handler\n DCD UsageFault_Handler ;(0x18)IRQ -10 Usage Fault Handler\n DCD 0 ;(0x1C)IRQ -9 Reserved\n DCD 0 ;(0x20)IRQ -8 Reserved\n DCD 0 ;(0x24)IRQ -7 Reserved\n DCD 0 ;(0x28)IRQ -6 Reserved\n DCD SVC_Handler ;(0x2C)IRQ -5 SVCall Handler\n DCD DebugMon_Handler ;(0x30)IRQ -4 Debug Monitor Handler\n DCD 0 ;(0x34)IRQ -3 Reserved\n DCD PendSV_Handler ;(0x38)IRQ -2 PendSV Handler\n DCD SysTick_Handler ;(0x3C)IRQ -1 SysTick Handler\n\n ; External Interrupts\n DCD WDT_IRQHandler ;(0x40)IRQ0\n DCD EXTERNAL_IRQHandler ;(0x44)IRQ1\n DCD RTC_IRQHandler ;(0x48)IRQ2\n DCD\t SLEEP_IRQHandler ;(0x4C)IRQ3\n DCD MAC_IRQHandler ;(0x50)IRQ4\n DCD DMA_IRQHandler ;(0x54)IRQ5\n DCD QSPI_IRQHandler ;(0x58)IRQ6\n DCD SDIO_FUN1_IRQHandler ;(0x5C)IRQ7\n DCD SDIO_FUN2_IRQHandler ;(0x60)IRQ8\n DCD SDIO_FUN3_IRQHandler ;(0x64)IRQ9\n DCD SDIO_FUN4_IRQHandler ;(0x68)IRQ10\n DCD SDIO_FUN5_IRQHandler ;(0x6C)IRQ11\n DCD SDIO_FUN6_IRQHandler ;(0x70)IRQ12\n DCD SDIO_FUN7_IRQHandler ;(0x74)IRQ13\n DCD SDIO_ASYNC_HOST_IRQHandler ;(0x78)IRQ14\n DCD SDIO_M2S_IRQHandler ;(0x7C)IRQ15\n DCD CM4_INTR0_IRQHandler ;(0x80)IRQ16\n DCD CM4_INTR1_IRQHandler ;(0x84)IRQ17\n DCD CM4_INTR2_IRQHandler ;(0x88)IRQ18\n DCD CM4_INTR3_IRQHandler ;(0x8C)IRQ19\n DCD CM4_INTR4_IRQHandler ;(0x90)IRQ20\n DCD CM4_INTR5_IRQHandler ;(0x94)IRQ21\n DCD ADC_IRQHandler ;(0x98)IRQ22\n DCD TIMER_IRQHandler ;(0x9C)IRQ23\n DCD I2C0_IRQHandler ;(0xA0)IRQ24\n DCD I2C1_IRQHandler ;(0xA4)IRQ25\n DCD SPI0_IRQHandler ;(0xA8)IRQ26\n DCD SPI2_IRQHandler ;(0xAC)IRQ27\n DCD UART0_IRQHandler ;(0xB0)IRQ28\n DCD UART1_IRQHandler ;(0xB4)IRQ29\n DCD SPI1_IRQHandler ;(0xB8)IRQ30\n DCD GPIO_IRQHandler ;(0xBC)IRQ31\n DCD I2S_IRQHandler ;(0xC0)IRQ32\n DCD PAOTD_IRQHandler ;(0xC4)IRQ33\n DCD PWM_IRQHandler ;(0xC8)IRQ34\n DCD TRNG_IRQHandler ;(0xCC)IRQ35\n DCD AES_IRQHandler ;(0xD0)IRQ36\n__Vectors_End\n\n__Vectors_Size EQU __Vectors_End - __Vectors\n\n AREA |.text|, CODE, READONLY\n\n\n; Reset Handler\n\nReset_Handler PROC\n EXPORT Reset_Handler [WEAK]\n IMPORT SystemInit\n IMPORT __main\n LDR R4, =SystemInit\n BLX R4\n LDR R4, =__main\n BX R4\n ENDP\n\n; Dummy Exception Handlers (infinite loops which can be modified)\n\nNMI_Handler PROC\n EXPORT NMI_Handler [WEAK]\n B .\n ENDP\nHardFault_Handler\\\n PROC\n EXPORT HardFault_Handler [WEAK]\n B .\n ENDP\nMemManage_Handler\\\n PROC\n EXPORT MemManage_Handler [WEAK]\n B .\n ENDP\nBusFault_Handler\\\n PROC\n EXPORT BusFault_Handler [WEAK]\n B .\n ENDP\nUsageFault_Handler\\\n PROC\n EXPORT UsageFault_Handler [WEAK]\n B .\n ENDP\nSVC_Handler PROC\n EXPORT SVC_Handler [WEAK]\n B .\n ENDP\nDebugMon_Handler\\\n PROC\n EXPORT DebugMon_Handler [WEAK]\n B .\n ENDP\nPendSV_Handler PROC\n EXPORT PendSV_Handler [WEAK]\n B .\n ENDP\nSysTick_Handler PROC\n EXPORT SysTick_Handler [WEAK]\n B .\n ENDP\n\nDefault_Handler PROC\n\n EXPORT WDT_IRQHandler [WEAK]\n EXPORT EXTERNAL_IRQHandler [WEAK]\n EXPORT RTC_IRQHandler [WEAK]\n EXPORT SLEEP_IRQHandler [WEAK]\n EXPORT MAC_IRQHandler [WEAK]\n EXPORT DMA_IRQHandler [WEAK]\n EXPORT QSPI_IRQHandler [WEAK]\n EXPORT SDIO_FUN1_IRQHandler [WEAK]\n EXPORT SDIO_FUN2_IRQHandler [WEAK]\n EXPORT SDIO_FUN3_IRQHandler [WEAK]\n EXPORT SDIO_FUN4_IRQHandler [WEAK]\n EXPORT SDIO_FUN5_IRQHandler [WEAK]\n EXPORT SDIO_FUN6_IRQHandler [WEAK]\n EXPORT SDIO_FUN7_IRQHandler [WEAK]\n EXPORT SDIO_ASYNC_HOST_IRQHandler [WEAK]\n EXPORT SDIO_M2S_IRQHandler [WEAK]\n EXPORT CM4_INTR0_IRQHandler [WEAK]\n EXPORT CM4_INTR1_IRQHandler [WEAK]\n EXPORT CM4_INTR2_IRQHandler [WEAK]\n EXPORT CM4_INTR3_IRQHandler [WEAK]\n EXPORT CM4_INTR4_IRQHandler [WEAK]\n EXPORT CM4_INTR5_IRQHandler [WEAK]\n EXPORT ADC_IRQHandler [WEAK]\n EXPORT TIMER_IRQHandler [WEAK]\n EXPORT I2C0_IRQHandler [WEAK]\n EXPORT I2C1_IRQHandler [WEAK]\n EXPORT SPI0_IRQHandler [WEAK]\n EXPORT SPI2_IRQHandler [WEAK]\n EXPORT UART0_IRQHandler [WEAK]\n EXPORT UART1_IRQHandler [WEAK]\n EXPORT SPI1_IRQHandler [WEAK]\n EXPORT GPIO_IRQHandler [WEAK]\n EXPORT I2S_IRQHandler [WEAK]\n EXPORT PAOTD_IRQHandler [WEAK]\n EXPORT PWM_IRQHandler [WEAK]\n EXPORT TRNG_IRQHandler [WEAK]\n EXPORT AES_IRQHandler [WEAK]\nWDT_IRQHandler\nEXTERNAL_IRQHandler\nRTC_IRQHandler\nSLEEP_IRQHandler\nMAC_IRQHandler\nDMA_IRQHandler\nQSPI_IRQHandler\nSDIO_FUN1_IRQHandler\nSDIO_FUN2_IRQHandler\nSDIO_FUN3_IRQHandler\nSDIO_FUN4_IRQHandler\nSDIO_FUN5_IRQHandler\nSDIO_FUN6_IRQHandler\nSDIO_FUN7_IRQHandler\nSDIO_ASYNC_HOST_IRQHandler\nSDIO_M2S_IRQHandler\nCM4_INTR0_IRQHandler\nCM4_INTR1_IRQHandler\nCM4_INTR2_IRQHandler\nCM4_INTR3_IRQHandler\nCM4_INTR4_IRQHandler\nCM4_INTR5_IRQHandler\nADC_IRQHandler\nTIMER_IRQHandler\nI2C0_IRQHandler\nI2C1_IRQHandler\nSPI0_IRQHandler\nSPI2_IRQHandler\nUART0_IRQHandler\nUART1_IRQHandler\nSPI1_IRQHandler\nGPIO_IRQHandler\nI2S_IRQHandler\nPAOTD_IRQHandler\nPWM_IRQHandler\nTRNG_IRQHandler\nAES_IRQHandler\n B .\n ENDP\n ALIGN\n\n\n; User Initial Stack & Heap\n\n IF :DEF:__MICROLIB\n\n EXPORT __initial_sp\n EXPORT __heap_base\n EXPORT __heap_limit\n\n ELSE\n\n IMPORT __use_two_region_memory\n EXPORT __user_initial_stackheap\n\n__user_initial_stackheap PROC\n LDR R0, = Heap_Mem\n LDR R1, =(Stack_Mem + Stack_Size)\n LDR R2, = (Heap_Mem + Heap_Size)\n LDR R3, = Stack_Mem\n BX LR\n ENDP\n\n ALIGN\n\n ENDIF\n\n\n END\n"} +{"text": " texture { pigment{ color rgb< 0.0, 0.0, 1.0> } // color Blue \n // normal { bumps 0.5 scale 0.05 }\n finish { phong 1 reflection 0.00}\n } // end of texture \n"} +{"text": "\n\n\n\n \n \n\n"} +{"text": "/* Return classification value corresponding to argument.\n Copyright (C) 1997, 2002 Free Software Foundation, Inc.\n This file is part of the GNU C Library.\n Contributed by Ulrich Drepper , 1997.\n Fixed by Andreas Schwab .\n\n The GNU C Library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n The GNU C Library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with the GNU C Library; if not, write to the Free\n Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n 02111-1307 USA. */\n\n#include \n\n#include \"math_private.h\"\n\n\nint\n__fpclassifyl (long double x)\n{\n u_int32_t ex, hx, lx, m;\n int retval = FP_NORMAL;\n\n GET_LDOUBLE_WORDS (ex, hx, lx, x);\n m = (hx & 0x7fffffff) | lx;\n ex &= 0x7fff;\n if ((ex | m) == 0)\n retval = FP_ZERO;\n else if (ex == 0 && (hx & 0x80000000) == 0)\n retval = FP_SUBNORMAL;\n else if (ex == 0x7fff)\n retval = m != 0 ? FP_NAN : FP_INFINITE;\n\n return retval;\n}\nlibm_hidden_def (__fpclassifyl)\n"} +{"text": "# Introduction\n\nThroughout the book, we had been using primarily two templates to work with Fable front-end projects: [fable-getting-started](https://github.com/Zaid-Ajaj/fable-getting-started) and [elmish-getting-started](https://github.com/Zaid-Ajaj/elmish-getting-started). The former scaffolds a simple plain Fable project to work in the browser and the latter is the basic Elmish template that we have been using in chapters 2, 3 and 4.\n\nWhen I introduced these templates, I mentioned that both of them are made for the purpose of *learning* and that they shouldn't be used for production environments. The primary reason was to keep the build configuration at a minimum so that we don't get too distracted with these aspects of the front-end development. However, the bigger our applications get, more advanced and fine-tuned build configuration are required both for development and production environments. The template as it is now suffers from many problems, let us go through a couple of them.\n\n### Running Environment Specific Code\nIn many scenarios, we want the ability to execute different pieces of the code when running the environment in different environments: primarily development and production. For example, we want to introduce logging state changes of Elmish application to the console while in development but disable it in production.\n\n### Large bundle size\n\nWhen we compile the project using `npm run build`, the size of the generated JavaScript is too big because it includes code that might not have been used. When you pull packages in, you might use a function or two from that package, the rest of the code from said package shouldn't be included in the final output if it isn't used.\n\n### Hot module replacement\n\nAlso known as HMR for short, is one of the most important features required during development: it is the ability to see the changes you make to the code live **without** fully refreshing the page you are working on! This means if you are tuning the user interface on a page that required you to login first, then you wouldn't need to login again to see your changes whenever you update the UI. Instead, the state of the application is preserved and only the pieces of code are reloaded that were changed. This allows for really short feedback cycles and makes prototyping easier so that you can quickly see the results of your code.\n\n### Using Static Assets\n\nCurrently with the templates, whenever we want to use static files like images or CSS files, we would have to include them either in the `index.html` page or reference them via absolute URLs in the `src` attribute of `img` tags. However, in modern front-end projects, it is common to reference static assets like you reference code modules and use them directly in the application.\n\nIn this short chapter, we will tackle the shortcomings of the [elmish-getting-started](https://github.com/Zaid-Ajaj/elmish-getting-started) template and turn it into a production-ready template as well as make it nicer to work with during development. We will not focus on the application point of view but we will be focusing more on the build configuration side of things.\n\nBuild time configuration and fine-tuning is one of those domains of building front-end applications that is very important when working with real-world applications but is usually glanced over when learning front-end development and you have to learn it on your own as you go. That is why I am dedicating this small chapter to it.\n"} +{"text": "Title: knuerr_sensors: no longer creates a service for unnamed sensor\nLevel: 1\nComponent: checks\nCompatible: compat\nVersion: 1.2.7i3\nDate: 1442822660\nClass: fix\n\nThe device seems to send readings for unconnected sensor slots. A missing name seems to be the only\nindication that no sensor is connected.\n"} +{"text": "// +build !appengine\n\n/*\n *\n * Copyright 2018 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\npackage channelz\n\nimport (\n\t\"syscall\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n// SocketOptionData defines the struct to hold socket option data, and related\n// getter function to obtain info from fd.\ntype SocketOptionData struct {\n\tLinger *unix.Linger\n\tRecvTimeout *unix.Timeval\n\tSendTimeout *unix.Timeval\n\tTCPInfo *unix.TCPInfo\n}\n\n// Getsockopt defines the function to get socket options requested by channelz.\n// It is to be passed to syscall.RawConn.Control().\nfunc (s *SocketOptionData) Getsockopt(fd uintptr) {\n\tif v, err := unix.GetsockoptLinger(int(fd), syscall.SOL_SOCKET, syscall.SO_LINGER); err == nil {\n\t\ts.Linger = v\n\t}\n\tif v, err := unix.GetsockoptTimeval(int(fd), syscall.SOL_SOCKET, syscall.SO_RCVTIMEO); err == nil {\n\t\ts.RecvTimeout = v\n\t}\n\tif v, err := unix.GetsockoptTimeval(int(fd), syscall.SOL_SOCKET, syscall.SO_SNDTIMEO); err == nil {\n\t\ts.SendTimeout = v\n\t}\n\tif v, err := unix.GetsockoptTCPInfo(int(fd), syscall.SOL_TCP, syscall.TCP_INFO); err == nil {\n\t\ts.TCPInfo = v\n\t}\n}\n"} +{"text": "//\n// TableViewCellTemplate.m\n// SQTemplate\n//\n// Created by 双泉 朱 on 17/5/11.\n// Copyright © 2017年 Doubles_Z. All rights reserved.\n//\n\n#import \"<#Unit#>Cell.h\"\n<#ViewImport#>\n@interface <#Unit#>Cell ()\n\n<#ViewProperty#>\n@end\n\n@implementation <#Unit#>Cell\n\n- (void)dealloc {\n NSLog(@\"%@ - execute %s\",NSStringFromClass([self class]),__func__);\n}\n\n+ (instancetype)cellWithTableView:(UITableView *)tableView {\n \n NSString * identifier = NSStringFromClass([<#Unit#>Cell class]);\n <#Unit#>Cell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];\n if (!cell) {\n cell = [[<#Unit#>Cell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];\n }\n return cell;\n}\n\n- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {\n \n self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];\n if (self) {\n [self setupSubviews];\n }\n return self;\n}\n\n<#ViewLazyLoad#>\n\n- (void)setupSubviews {\n<#ViewSetup#>\n}\n\n- (void)setAdapter:(id<<#Unit#>CellAdapter>)adapter {\n _adapter = adapter;\n}\n\n- (void)layoutSubviews {\n [super layoutSubviews];\n \n<#ViewLayout#>\n}\n\n+ (CGFloat)cellHeight {\n return <#cellHeight#>;\n}\n\n@end\n"} +{"text": "/**\n * MegaMek - Copyright (C) 2005 Ben Mazur (bmazur@sev.org)\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License as published by the Free\n * Software Foundation; either version 2 of the License, or (at your option)\n * 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 */\npackage megamek.common.weapons;\n\nimport java.util.ArrayList;\nimport java.util.Enumeration;\nimport java.util.Vector;\n\nimport megamek.common.AmmoType;\nimport megamek.common.BattleArmor;\nimport megamek.common.Building;\nimport megamek.common.Compute;\nimport megamek.common.ComputeECM;\nimport megamek.common.Entity;\nimport megamek.common.HitData;\nimport megamek.common.IGame;\nimport megamek.common.Infantry;\nimport megamek.common.Mech;\nimport megamek.common.MiscType;\nimport megamek.common.Mounted;\nimport megamek.common.RangeType;\nimport megamek.common.Report;\nimport megamek.common.Tank;\nimport megamek.common.TargetRoll;\nimport megamek.common.Targetable;\nimport megamek.common.ToHitData;\nimport megamek.common.WeaponType;\nimport megamek.common.actions.WeaponAttackAction;\nimport megamek.common.options.OptionsConstants;\nimport megamek.server.Server;\n\n/**\n * @author Sebastian Brocks\n */\npublic class MissileWeaponHandler extends AmmoWeaponHandler {\n\n /**\n *\n */\n private static final long serialVersionUID = -4801130911083653548L;\n boolean advancedAMS = false;\n boolean advancedPD = false;\n boolean multiAMS = false;\n\n\n /**\n * @param t\n * @param w\n * @param g\n * @param s\n */\n public MissileWeaponHandler(ToHitData t, WeaponAttackAction w, IGame g,\n Server s) {\n super(t, w, g, s);\n generalDamageType = HitData.DAMAGE_MISSILE;\n advancedAMS = g.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_AMS);\n advancedPD = g.getOptions().booleanOption(OptionsConstants.ADVAERORULES_STRATOPS_ADV_POINTDEF);\n multiAMS = g.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_MULTI_USE_AMS);\n sSalvoType = \" missile(s) \";\n }\n \n /*\n * (non-Javadoc)\n *\n * @see megamek.common.weapons.WeaponHandler#calcHits(java.util.Vector)\n */\n @Override\n protected int calcHits(Vector vPhaseReport) {\n // conventional infantry gets hit in one lump\n // BAs do one lump of damage per BA suit\n if ((target instanceof Infantry) && !(target instanceof BattleArmor)) {\n if (ae instanceof BattleArmor) {\n bSalvo = true;\n Report r = new Report(3325);\n r.subject = subjectId;\n int shootingStrength = 1;\n if ((weapon.getLocation() == BattleArmor.LOC_SQUAD)\n && !(weapon.isSquadSupportWeapon())){\n shootingStrength = ((BattleArmor) ae).getShootingStrength();\n }\n r.add(wtype.getRackSize() * shootingStrength);\n r.add(sSalvoType);\n r.add(\" \");\n vPhaseReport.add(r);\n return shootingStrength;\n }\n Report r = new Report(3325);\n r.subject = subjectId;\n r.add(wtype.getRackSize());\n r.add(sSalvoType);\n r.add(\" \");\n vPhaseReport.add(r);\n return 1;\n }\n Entity entityTarget = (target.getTargetType() == Targetable.TYPE_ENTITY) ? (Entity) target\n : null;\n int missilesHit;\n int nMissilesModifier = getClusterModifiers(true);\n\n boolean bMekTankStealthActive = false;\n if ((ae instanceof Mech) || (ae instanceof Tank)) {\n bMekTankStealthActive = ae.isStealthActive();\n }\n Mounted mLinker = weapon.getLinkedBy();\n AmmoType atype = (AmmoType) ammo.getType();\n \n // is any hex in the flight path of the missile ECM affected?\n boolean bECMAffected = false;\n // if the attacker is affected by ECM or the target is protected by ECM\n // then act as if affected.\n if (ComputeECM.isAffectedByECM(ae, ae.getPosition(), target.getPosition())) {\n bECMAffected = true;\n }\n\n if (((mLinker != null) && (mLinker.getType() instanceof MiscType)\n && !mLinker.isDestroyed() && !mLinker.isMissing()\n && !mLinker.isBreached() && mLinker.getType().hasFlag(\n MiscType.F_ARTEMIS))\n && (atype.getMunitionType() == AmmoType.M_ARTEMIS_CAPABLE)) {\n if (bECMAffected) {\n // ECM prevents bonus\n Report r = new Report(3330);\n r.subject = subjectId;\n r.newlines = 0;\n vPhaseReport.addElement(r);\n } else if (bMekTankStealthActive) {\n // stealth prevents bonus\n Report r = new Report(3335);\n r.subject = subjectId;\n r.newlines = 0;\n vPhaseReport.addElement(r);\n } else {\n nMissilesModifier += 2;\n }\n \n } else if (((mLinker != null)\n && (mLinker.getType() instanceof MiscType)\n && !mLinker.isDestroyed() && !mLinker.isMissing()\n && !mLinker.isBreached() && mLinker.getType().hasFlag(\n MiscType.F_ARTEMIS_PROTO))\n && (atype.getMunitionType() == AmmoType.M_ARTEMIS_CAPABLE)) {\n if (bECMAffected) {\n // ECM prevents bonus\n Report r = new Report(3330);\n r.subject = subjectId;\n r.newlines = 0;\n vPhaseReport.addElement(r);\n } else if (bMekTankStealthActive) {\n // stealth prevents bonus\n Report r = new Report(3335);\n r.subject = subjectId;\n r.newlines = 0;\n vPhaseReport.addElement(r);\n } else {\n nMissilesModifier += 1;\n }\n } else if (((mLinker != null)\n && (mLinker.getType() instanceof MiscType)\n && !mLinker.isDestroyed() && !mLinker.isMissing()\n && !mLinker.isBreached() && mLinker.getType().hasFlag(\n MiscType.F_ARTEMIS_V))\n && (atype.getMunitionType() == AmmoType.M_ARTEMIS_V_CAPABLE)) {\n if (bECMAffected) {\n // ECM prevents bonus\n Report r = new Report(3330);\n r.subject = subjectId;\n r.newlines = 0;\n vPhaseReport.addElement(r);\n } else if (bMekTankStealthActive) {\n // stealth prevents bonus\n Report r = new Report(3335);\n r.subject = subjectId;\n r.newlines = 0;\n vPhaseReport.addElement(r);\n } else {\n nMissilesModifier += 3;\n }\n } else if (((mLinker != null)\n && (mLinker.getType() instanceof MiscType)\n && !mLinker.isDestroyed() && !mLinker.isMissing()\n && !mLinker.isBreached() && mLinker.getType().hasFlag(\n MiscType.F_APOLLO))\n && (atype.getAmmoType() == AmmoType.T_MRM)) {\n nMissilesModifier -= 1;\n } else if (atype.getAmmoType() == AmmoType.T_ATM) {\n if (bECMAffected) {\n // ECM prevents bonus\n Report r = new Report(3330);\n r.subject = subjectId;\n r.newlines = 0;\n vPhaseReport.addElement(r);\n } else if (bMekTankStealthActive) {\n // stealth prevents bonus\n Report r = new Report(3335);\n r.subject = subjectId;\n r.newlines = 0;\n vPhaseReport.addElement(r);\n } else {\n nMissilesModifier += 2;\n }\n } else if ((entityTarget != null)\n && (entityTarget.isNarcedBy(ae.getOwner().getTeam()) || entityTarget\n .isINarcedBy(ae.getOwner().getTeam()))) {\n // only apply Narc bonus if we're not suffering ECM effect\n // and we are using narc ammo, and we're not firing indirectly.\n // narc capable missiles are only affected if the narc pod, which\n // sits on the target, is ECM affected\n boolean bTargetECMAffected = false;\n bTargetECMAffected = ComputeECM.isAffectedByECM(ae,\n target.getPosition(), target.getPosition());\n if (((atype.getAmmoType() == AmmoType.T_LRM)\n || (atype.getAmmoType() == AmmoType.T_LRM_IMP)\n || (atype.getAmmoType() == AmmoType.T_SRM)\n || (atype.getAmmoType() == AmmoType.T_SRM_IMP)\n || (atype.getAmmoType() == AmmoType.T_MML)\n || (atype.getAmmoType() == AmmoType.T_NLRM))\n && (atype.getMunitionType() == AmmoType.M_NARC_CAPABLE)\n && ((weapon.curMode() == null) || !weapon.curMode().equals(\n \"Indirect\"))) {\n if (bTargetECMAffected) {\n // ECM prevents bonus\n Report r = new Report(3330);\n r.subject = subjectId;\n r.newlines = 0;\n vPhaseReport.addElement(r);\n } else {\n nMissilesModifier += 2;\n }\n }\n }\n\n // add AMS mods\n nMissilesModifier += getAMSHitsMod(vPhaseReport);\n \n if (game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_AERO_SANITY)\n && entityTarget != null && entityTarget.isLargeCraft()) {\n nMissilesModifier -= getAeroSanityAMSHitsMod();\n }\n\n if (allShotsHit()) {\n // We want buildings and large craft to be able to affect this number with AMS\n // treat as a Streak launcher (cluster roll 11) to make this happen\n missilesHit = Compute.missilesHit(wtype.getRackSize(),\n nMissilesModifier, weapon.isHotLoaded(), true,\n isAdvancedAMS());\n } else {\n if (ae instanceof BattleArmor) {\n int shootingStrength = 1;\n if ((weapon.getLocation() == BattleArmor.LOC_SQUAD)\n && !(weapon.isSquadSupportWeapon())){\n shootingStrength = ((BattleArmor) ae).getShootingStrength();\n }\n missilesHit = Compute.missilesHit(wtype.getRackSize()\n * shootingStrength,\n nMissilesModifier, weapon.isHotLoaded(), false,\n isAdvancedAMS());\n } else {\n missilesHit = Compute.missilesHit(wtype.getRackSize(),\n nMissilesModifier, weapon.isHotLoaded(), false,\n isAdvancedAMS());\n }\n }\n\n if (missilesHit > 0) {\n Report r = new Report(3325);\n r.subject = subjectId;\n r.add(missilesHit);\n r.add(sSalvoType);\n r.add(toHit.getTableDesc());\n r.newlines = 0;\n vPhaseReport.addElement(r);\n if (nMissilesModifier != 0) {\n if (nMissilesModifier > 0) {\n r = new Report(3340);\n } else {\n r = new Report(3341);\n }\n r.subject = subjectId;\n r.add(nMissilesModifier);\n r.newlines = 0;\n vPhaseReport.addElement(r);\n }\n }\n Report r = new Report(3345);\n r.subject = subjectId;\n vPhaseReport.addElement(r);\n bSalvo = true;\n return missilesHit;\n }\n \n /*\n * (non-Javadoc)\n *\n * @see megamek.common.weapons.WeaponHandler#calcnCluster()\n */\n @Override\n protected int calcnCluster() {\n return 5;\n }\n\n /*\n * (non-Javadoc)\n *\n * @see megamek.common.weapons.WeaponHandler#calcDamagePerHit()\n */\n @Override\n protected int calcDamagePerHit() {\n if ((target instanceof Infantry) && !(target instanceof BattleArmor)) {\n double toReturn = Compute.directBlowInfantryDamage(\n wtype.getRackSize(), bDirect ? toHit.getMoS() / 3 : 0,\n wtype.getInfantryDamageClass(),\n ((Infantry) target).isMechanized(),\n toHit.getThruBldg() != null, ae.getId(), calcDmgPerHitReport);\n toReturn = applyGlancingBlowModifier(toReturn, false);\n return (int) toReturn;\n }\n return 1;\n }\n\n /**\n * Calculate the attack value based on range\n *\n * @return an int representing the attack value at that range.\n */\n @Override\n protected int calcAttackValue() {\n int av = 0;\n int range = RangeType.rangeBracket(nRange, wtype.getATRanges(), true, false);\n if (range == WeaponType.RANGE_SHORT) {\n av = wtype.getRoundShortAV();\n } else if (range == WeaponType.RANGE_MED) {\n av = wtype.getRoundMedAV();\n } else if (range == WeaponType.RANGE_LONG) {\n av = wtype.getRoundLongAV();\n } else if (range == WeaponType.RANGE_EXT) {\n av = wtype.getRoundExtAV();\n }\n Mounted mLinker = weapon.getLinkedBy();\n AmmoType atype = (AmmoType) ammo.getType();\n int bonus = 0;\n if (((mLinker != null) && (mLinker.getType() instanceof MiscType)\n && !mLinker.isDestroyed() && !mLinker.isMissing()\n && !mLinker.isBreached() && mLinker.getType().hasFlag(\n MiscType.F_ARTEMIS))\n && (atype.getMunitionType() == AmmoType.M_ARTEMIS_CAPABLE)) {\n // MML3 gets no bonus from Artemis IV (how sad)\n if (atype.getRackSize() > 3) {\n bonus = (int) Math.ceil(atype.getRackSize() / 5.0);\n if ((atype.getAmmoType() == AmmoType.T_SRM) || (atype.getAmmoType() == AmmoType.T_SRM_IMP)) {\n bonus = 2;\n }\n }\n }\n if (((mLinker != null) && (mLinker.getType() instanceof MiscType)\n && !mLinker.isDestroyed() && !mLinker.isMissing()\n && !mLinker.isBreached() && mLinker.getType().hasFlag(\n MiscType.F_ARTEMIS_PROTO))\n && (atype.getMunitionType() == AmmoType.M_ARTEMIS_CAPABLE)) {\n // MML3 gets no bonus from Artemis IV (how sad)\n if (atype.getRackSize() > 3) {\n bonus = (int) Math.ceil(atype.getRackSize() / 5.0);\n if ((atype.getAmmoType() == AmmoType.T_SRM) || (atype.getAmmoType() == AmmoType.T_SRM_IMP)) {\n bonus = 1;\n }\n }\n }\n if (((mLinker != null) && (mLinker.getType() instanceof MiscType)\n && !mLinker.isDestroyed() && !mLinker.isMissing()\n && !mLinker.isBreached() && mLinker.getType().hasFlag(\n MiscType.F_ARTEMIS_V))\n && (atype.getMunitionType() == AmmoType.M_ARTEMIS_V_CAPABLE)) {\n // MML3 WOULD get a bonus from Artemis V, if you were crazy enough\n // to cross-tech it\n bonus = (int) Math.ceil(atype.getRackSize() / 5.0);\n if ((atype.getAmmoType() == AmmoType.T_SRM) || (atype.getAmmoType() == AmmoType.T_SRM_IMP)) {\n bonus = 2;\n }\n }\n av = av + bonus;\n if ((atype.getAmmoType() == AmmoType.T_MML)\n && !atype.hasFlag(AmmoType.F_MML_LRM)) {\n av = av * 2;\n }\n //Set the Capital Fighter AV here. We'll apply counterAV to this later\n originalAV = av;\n \n //Point Defenses engage the missiles still aimed at us\n if (ae.usesWeaponBays() || ae.isCapitalFighter()) {\n av = av - calcCounterAV();\n }\n \n if (bDirect) {\n av = Math.min(av + (toHit.getMoS() / 3), av * 2);\n }\n \n av = applyGlancingBlowModifier(av, false);\n \n av = (int) Math.floor(getBracketingMultiplier() * av);\n return (av);\n }\n \n /**\n * Sets the appropriate AMS Bay reporting flag depending on what type of missile this is\n */\n @Override\n protected void setAMSBayReportingFlag() {\n amsBayEngaged = true;\n }\n \n /**\n * Sets the appropriate PD Bay reporting flag depending on what type of missile this is\n */\n @Override\n protected void setPDBayReportingFlag() {\n pdBayEngaged = true;\n }\n \n /*\n * (non-Javadoc)\n *\n * @see\n * megamek.common.weapons.WeaponHandler#handleSpecialMiss(megamek.common\n * .Entity, boolean, megamek.common.Building)\n */\n @Override\n protected boolean handleSpecialMiss(Entity entityTarget,\n boolean bldgDamagedOnMiss, Building bldg,\n Vector vPhaseReport) {\n // Shots that miss an entity can set fires.\n // Buildings can't be accidentally ignited,\n // and some weapons can't ignite fires.\n if ((entityTarget != null)\n && !entityTarget.isAirborne()\n && !entityTarget.isAirborneVTOLorWIGE()\n && ((bldg == null) && (wtype.getFireTN() != TargetRoll.IMPOSSIBLE))) {\n server.tryIgniteHex(target.getPosition(), subjectId, false, false,\n new TargetRoll(wtype.getFireTN(), wtype.getName()), 3,\n vPhaseReport);\n }\n\n // shots that miss an entity can also potential cause explosions in a\n // heavy industrial hex\n server.checkExplodeIndustrialZone(target.getPosition(), vPhaseReport);\n\n // Report any AMS action.\n if (amsEngaged) {\n Report r = new Report(3230);\n r.indent();\n r.subject = subjectId;\n vPhaseReport.addElement(r);\n }\n\n // Report any APDS action.\n if (apdsEngaged) {\n Report r = new Report(3231);\n r.indent();\n r.subject = subjectId;\n vPhaseReport.addElement(r);\n }\n\n // TW, pg. 171 - shots that miss a target in a building don't damage the\n // building, unless the attacker is adjacent\n if (!bldgDamagedOnMiss\n || (toHit.getValue() == TargetRoll.AUTOMATIC_FAIL)) {\n return false;\n }\n return true;\n }\n \n // Aero sanity reduces effectiveness of AMS bays with default cluster mods.\n // This attempts to account for that, but might need some balancing...\n protected double getAeroSanityAMSHitsMod() {\n if (getParentBayHandler() != null) {\n WeaponHandler bayHandler = getParentBayHandler();\n double counterAVMod = (bayHandler.getCounterAV() / bayHandler.weapon.getBayWeapons().size());\n //use this if point defenses engage the missiles\n if (bayHandler.pdOverheated) {\n //Halve the effectiveness\n counterAVMod /= 2.0;\n }\n //Now report and apply the effect, if any\n if (bayHandler.amsBayEngaged || bayHandler.pdBayEngaged) {\n // Let's try to mimic reduced AMS effectiveness against higher munition attack values\n // Set a minimum -4 (default AMS mod)\n return Math.max((counterAVMod / calcDamagePerHit()),2);\n }\n } else if (getCounterAV() > 0) {\n // Good for squadron missile fire. This may get divided up against too many missile racks to produce a result.\n // Set a minimum -4 (default AMS mod)\n return Math.max((getCounterAV() / nweaponsHit),4);\n }\n return 0;\n }\n\n protected int getAMSHitsMod(Vector vPhaseReport) {\n if ((target == null)\n || (target.getTargetType() != Targetable.TYPE_ENTITY)\n || CounterAV > 0) {\n return 0;\n }\n int apdsMod = 0;\n int amsMod = 0;\n Entity entityTarget = (Entity) target;\n // any AMS attacks by the target?\n ArrayList lCounters = waa.getCounterEquipment();\n if (null != lCounters) {\n // resolve AMS counter-fire\n for (Mounted counter : lCounters) {\n //Set up differences between different types of AMS\n boolean isAMS = counter.getType().hasFlag(WeaponType.F_AMS);\n boolean isAMSBay = counter.getType().hasFlag(WeaponType.F_AMSBAY);\n boolean isAPDS = counter.isAPDS();\n \n //Only one AMS and one APDS can engage each missile attack\n if (isAMS && amsEngaged) {\n continue;\n }\n if (isAPDS && apdsEngaged) {\n continue;\n }\n \n //Check the firing arc, even though this was done when the AMS was assigned\n Entity pdEnt = counter.getEntity();\n boolean isInArc;\n // If the defending unit is the target, use attacker for arc\n if (entityTarget.equals(pdEnt)) {\n isInArc = Compute.isInArc(game, entityTarget.getId(),\n entityTarget.getEquipmentNum(counter),\n ae);\n } else { // Otherwise, the attack target must be in arc\n isInArc = Compute.isInArc(game, pdEnt.getId(),\n pdEnt.getEquipmentNum(counter),\n entityTarget);\n }\n \n if (!isInArc) {\n continue;\n }\n \n // Point defenses can't fire if they're not ready for any other reason\n if (!(counter.getType() instanceof WeaponType)\n || !counter.isReady() || counter.isMissing()\n // no AMS when a shield in the AMS location\n || (pdEnt.hasShield() && pdEnt.hasActiveShield(\n counter.getLocation(), false))\n // shutdown means no AMS\n || pdEnt.isShutDown()) {\n continue;\n }\n \n //If we're an AMSBay, heat and ammo must be calculated differently\n if (isAMSBay) {\n for (int wId : counter.getBayWeapons()) {\n Mounted bayW = entityTarget.getEquipment(wId);\n Mounted bayWAmmo = bayW.getLinked();\n //For AMS bays, stop the loop if an AMS in the bay has engaged this attack\n if (amsEngaged) {\n break;\n }\n //For AMS bays, continue until we find an individual AMS that hasn't shot yet\n if (bayW.isUsedThisRound()) {\n continue;\n }\n\n // build up some heat (assume target is ams owner)\n if (bayW.getType().hasFlag(WeaponType.F_HEATASDICE)) {\n pdEnt.heatBuildup += Compute.d6(bayW\n .getCurrentHeat());\n } else {\n pdEnt.heatBuildup += bayW.getCurrentHeat();\n }\n\n // decrement the ammo\n if (bayWAmmo != null) {\n bayWAmmo.setShotsLeft(Math.max(0,\n bayWAmmo.getBaseShotsLeft() - 1));\n }\n \n //Optional rule to allow multiple AMS shots per round\n if (!multiAMS) {\n // set the ams as having fired, which is checked by isReady()\n bayW.setUsedThisRound(true); \n }\n amsEngaged = true;\n }\n } else {\n // build up some heat\n if (counter.getType().hasFlag(WeaponType.F_HEATASDICE)) {\n pdEnt.heatBuildup += Compute.d6(counter\n .getCurrentHeat());\n } else {\n pdEnt.heatBuildup += counter.getCurrentHeat();\n }\n \n // decrement the ammo\n Mounted mAmmo = counter.getLinked();\n if (mAmmo != null) {\n mAmmo.setShotsLeft(Math.max(0,\n mAmmo.getBaseShotsLeft() - 1));\n }\n \n //Optional rule to allow multiple AMS shots per round\n if (!multiAMS) {\n // set the ams as having fired\n counter.setUsedThisRound(true);\n }\n \n if (isAMS) {\n amsEngaged = true;\n }\n if (isAPDS) {\n apdsEngaged = true;\n }\n }\n //Determine APDS mod\n if (apdsEngaged) {\n int dist = target.getPosition().distance(\n pdEnt.getPosition());\n int minApdsMod = -4;\n if (pdEnt instanceof BattleArmor) {\n int numTroopers = ((BattleArmor) pdEnt)\n .getNumberActiverTroopers();\n switch (numTroopers) {\n case 1:\n minApdsMod = -2;\n break;\n case 2:\n case 3:\n minApdsMod = -3;\n break;\n default: // 4+\n minApdsMod = -4;\n }\n }\n apdsMod = Math.min(minApdsMod + dist, 0);\n }\n }\n // Determine AMS modifier and report\n if (amsEngaged) {\n Report r = new Report(3350);\n r.subject = entityTarget.getId();\n r.newlines = 0;\n vPhaseReport.add(r);\n amsMod = -4;\n }\n \n //Report APDS fire. Effect relies on internal variables and must be separated above\n if (apdsEngaged) {\n Report r = new Report(3351);\n r.subject = entityTarget.getId();\n r.add(apdsMod);\n r.newlines = 0;\n vPhaseReport.add(r);\n }\n }\n return apdsMod + amsMod;\n }\n\n /*\n * (non-Javadoc)\n *\n * @see megamek.common.weapons.AttackHandler#handle(int, java.util.Vector)\n */\n @Override\n public boolean handle(IGame.Phase phase, Vector vPhaseReport) {\n if (!cares(phase)) {\n return true;\n }\n Entity entityTarget = (target.getTargetType() == Targetable.TYPE_ENTITY) ? (Entity) target\n : null;\n final boolean targetInBuilding = Compute.isInBuilding(game,\n entityTarget);\n final boolean bldgDamagedOnMiss = targetInBuilding\n && !(target instanceof Infantry)\n && ae.getPosition().distance(target.getPosition()) <= 1;\n boolean bNemesisConfusable = isNemesisConfusable();\n\n if (entityTarget != null) {\n ae.setLastTarget(entityTarget.getId());\n ae.setLastTargetDisplayName(entityTarget.getDisplayName());\n }\n\n // Which building takes the damage?\n Building bldg = game.getBoard().getBuildingAt(target.getPosition());\n String number = nweapons > 1 ? \" (\" + nweapons + \")\" : \"\";\n // Report weapon attack and its to-hit value.\n Report r = new Report(3115);\n r.indent();\n r.newlines = 0;\n r.subject = subjectId;\n r.add(wtype.getName() + number);\n if (entityTarget != null) {\n if (wtype.getAmmoType() != AmmoType.T_NA){\n AmmoType atype = (AmmoType) ammo.getType();\n if (atype.getMunitionType() != AmmoType.M_STANDARD){\n r.messageId = 3116;\n r.add(atype.getSubMunitionName());\n }\n }\n r.addDesc(entityTarget);\n } else {\n r.messageId = 3120;\n r.add(target.getDisplayName(), true);\n }\n vPhaseReport.addElement(r);\n // check for nemesis\n boolean shotAtNemesisTarget = false;\n if (bNemesisConfusable && !waa.isNemesisConfused()) {\n // loop through nemesis targets\n for (Enumeration e = game.getNemesisTargets(ae,\n target.getPosition()); e.hasMoreElements();) {\n Entity entity = e.nextElement();\n // friendly unit with attached iNarc Nemesis pod standing in the\n // way\n r = new Report(3125);\n r.subject = subjectId;\n vPhaseReport.addElement(r);\n weapon.setUsedThisRound(false);\n WeaponAttackAction newWaa = new WeaponAttackAction(ae.getId(),\n entity.getTargetId(), waa.getWeaponId());\n newWaa.setNemesisConfused(true);\n Mounted m = ae.getEquipment(waa.getWeaponId());\n Weapon w = (Weapon) m.getType();\n AttackHandler ah = w.fire(newWaa, game, server);\n // increase ammo by one, becaues we just incorrectly used one up\n weapon.getLinked().setShotsLeft(\n weapon.getLinked().getBaseShotsLeft() + 1);\n // if the new attack has an impossible to-hit, go on to next\n // entity\n if (ah == null) {\n continue;\n }\n WeaponHandler wh = (WeaponHandler) ah;\n // attack the new target, and if we hit it, return;\n wh.handle(phase, vPhaseReport);\n // if the new attack hit, we are finished.\n if (!wh.bMissed) {\n return false;\n }\n shotAtNemesisTarget = true;\n }\n if (shotAtNemesisTarget) {\n // back to original target\n r = new Report(3130);\n r.subject = subjectId;\n r.newlines = 0;\n r.indent();\n vPhaseReport.addElement(r);\n }\n }\n \n attackValue = calcAttackValue();\n CounterAV = getCounterAV();\n \n //CalcAttackValue triggers counterfire, so now we can safely get this\n CapMissileAMSMod = getCapMissileAMSMod();\n \n //Only do this if a flight of large missiles wasn't destroyed\n if (CapMissileAMSMod > 0 && CapMissileArmor > 0) {\n toHit.addModifier(CapMissileAMSMod, \"Damage from Point Defenses\");\n if (roll < toHit.getValue()) {\n CapMissileMissed = true;\n }\n }\n \n // Report any AMS bay action against Large missiles that doesn't destroy them all.\n if (amsBayEngagedCap && CapMissileArmor > 0) {\n r = new Report(3358);\n r.add(CapMissileAMSMod);\n r.subject = subjectId;\n vPhaseReport.addElement(r);\n \n // Report any PD bay action against Large missiles that doesn't destroy them all.\n } else if (pdBayEngagedCap && CapMissileArmor > 0) {\n r = new Report(3357);\n r.add(CapMissileAMSMod);\n r.subject = subjectId;\n vPhaseReport.addElement(r);\n }\n \n if (toHit.getValue() == TargetRoll.IMPOSSIBLE) {\n r = new Report(3135);\n r.subject = subjectId;\n r.add(toHit.getDesc());\n vPhaseReport.addElement(r);\n return false;\n } else if (toHit.getValue() == TargetRoll.AUTOMATIC_FAIL) {\n r = new Report(3140);\n r.newlines = 0;\n r.subject = subjectId;\n r.add(toHit.getDesc());\n vPhaseReport.addElement(r);\n } else if (toHit.getValue() == TargetRoll.AUTOMATIC_SUCCESS) {\n r = new Report(3145);\n r.newlines = 0;\n r.subject = subjectId;\n r.add(toHit.getDesc());\n vPhaseReport.addElement(r);\n } else {\n // roll to hit\n r = new Report(3150);\n r.newlines = 0;\n r.subject = subjectId;\n r.add(toHit.getValue());\n vPhaseReport.addElement(r);\n }\n\n // dice have been rolled, thanks\n r = new Report(3155);\n r.newlines = 0;\n r.subject = subjectId;\n r.add(roll);\n vPhaseReport.addElement(r);\n\n // do we hit?\n bMissed = roll < toHit.getValue();\n\n // are we a glancing hit?\n setGlancingBlowFlags(entityTarget);\n addGlancingBlowReports(vPhaseReport);\n\n // Set Margin of Success/Failure.\n toHit.setMoS(roll - Math.max(2, toHit.getValue()));\n bDirect = game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_DIRECT_BLOW)\n && ((toHit.getMoS() / 3) >= 1) && (entityTarget != null);\n if (bDirect) {\n r = new Report(3189);\n r.subject = ae.getId();\n r.newlines = 0;\n vPhaseReport.addElement(r);\n }\n\n // Do this stuff first, because some weapon's miss report reference the\n // amount of shots fired and stuff.\n if (!shotAtNemesisTarget) {\n addHeat();\n }\n \n // Any necessary PSRs, jam checks, etc.\n // If this boolean is true, don't report\n // the miss later, as we already reported\n // it in doChecks\n boolean missReported = doChecks(vPhaseReport);\n \n //This is for firing ATM/LRM/MML/MRM/SRMs at a dropship, but is ignored for ground-to-air fire\n //It's also rare but possible for two hostile grounded dropships to shoot at each other with individual weapons\n //with this handler. They'll use the cluster table too.\n //Don't use this if Aero Sanity is on...\n if (entityTarget != null \n && entityTarget.hasETypeFlag(Entity.ETYPE_DROPSHIP)\n && !game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_AERO_SANITY)\n && (waa.isAirToAir(game) || (waa.isAirToGround(game) && !ae.usesWeaponBays()))) {\n nDamPerHit = attackValue;\n } else {\n //This is for all other targets in atmosphere\n nDamPerHit = calcDamagePerHit();\n } \n \n // Do we need some sort of special resolution (minefields, artillery,\n if (specialResolution(vPhaseReport, entityTarget)) {\n return false;\n }\n\n if (bMissed && !missReported) {\n reportMiss(vPhaseReport);\n\n // Works out fire setting, AMS shots, and whether continuation is\n // necessary.\n if (!handleSpecialMiss(entityTarget, bldgDamagedOnMiss, bldg,\n vPhaseReport)) {\n return false;\n }\n }\n\n // yeech. handle damage. . different weapons do this in very different\n // ways\n int nCluster = calcnCluster();\n int id = vPhaseReport.size();\n int hits;\n if (game.getBoard().inSpace() \n || waa.isAirToAir(game)\n || waa.isAirToGround(game)) {\n // Ensures single AMS state is properly updated\n getAMSHitsMod(new Vector());\n int[] aeroResults = calcAeroDamage(entityTarget, vPhaseReport);\n hits = aeroResults[0];\n nCluster = aeroResults[1];\n // Report AMS/Pointdefense failure due to Overheating.\n if (pdOverheated \n && (!(amsBayEngaged\n || amsBayEngagedCap\n || amsBayEngagedMissile\n || pdBayEngaged\n || pdBayEngagedCap\n || pdBayEngagedMissile))) {\n r = new Report (3359);\n r.subject = subjectId;\n r.indent();\n vPhaseReport.addElement(r);\n } else if (pdOverheated) {\n //Report a partial failure\n r = new Report (3361);\n r.subject = subjectId;\n r.indent();\n vPhaseReport.addElement(r); \n }\n if (!bMissed && amsEngaged && isTbolt() && !ae.isCapitalFighter()) {\n // Thunderbolts are destroyed by AMS 50% of the time whether Aero Sanity is on or not\n hits = calcHits(vPhaseReport);\n } else if (!bMissed && nweaponsHit == 1) {\n r = new Report(3390);\n r.subject = subjectId;\n vPhaseReport.addElement(r);\n }\n // This is for aero attacks as attack value. Does not apply if Aero Sanity is on\n if (!game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_AERO_SANITY)) {\n if (!bMissed && amsEngaged && !isTbolt() && !ae.isCapitalFighter()) {\n // handle single AMS action against standard missiles\n int amsRoll = Compute.d6();\n r = new Report(3352);\n r.subject = subjectId;\n r.add(amsRoll);\n vPhaseReport.add(r);\n hits = Math.max(0, hits - amsRoll);\n }\n // Report any AMS bay action against standard missiles.\n if (amsBayEngaged && (originalAV <= 0)) {\n //use this if AMS counterfire destroys all the missiles\n r = new Report(3356);\n r.indent();\n r.subject = subjectId;\n vPhaseReport.addElement(r);\n } else if (amsBayEngaged) {\n //use this if AMS counterfire destroys some of the missiles\n CounterAV = getCounterAV();\n r = new Report(3354);\n r.indent();\n r.add(CounterAV);\n r.subject = subjectId;\n vPhaseReport.addElement(r);\n \n // Report any Point Defense bay action against standard missiles.\n \n } else if (pdBayEngaged && (originalAV <= 0)) {\n //use this if PD counterfire destroys all the missiles\n r = new Report(3355);\n r.subject = subjectId;\n vPhaseReport.addElement(r);\n } else if (pdBayEngaged) {\n //use this if PD counterfire destroys some of the missiles\n r = new Report(3353);\n r.add(CounterAV);\n r.subject = subjectId;\n vPhaseReport.addElement(r);\n } else if (amsBayEngagedCap || pdBayEngagedCap) {\n //This is reported elsewhere. Don't do anything else. \n }\n } \n } else {\n //If none of the above apply\n hits = calcHits(vPhaseReport);\n }\n\n // We have to adjust the reports on a miss, so they line up\n if (bMissed && (id != vPhaseReport.size())){\n vPhaseReport.get(id-1).newlines--;\n vPhaseReport.get(id).indent(2);\n vPhaseReport.get(vPhaseReport.size()-1).newlines++;\n }\n\n if (!bMissed){\n // Buildings shield all units from a certain amount of damage.\n // Amount is based upon the building's CF at the phase's start.\n int bldgAbsorbs = 0;\n if (targetInBuilding && (bldg != null)\n && (toHit.getThruBldg() == null)) {\n bldgAbsorbs = bldg.getAbsorbtion(target.getPosition());\n }\n \n // Attacking infantry in buildings from same building\n if (targetInBuilding && (bldg != null)\n && (toHit.getThruBldg() != null)\n && (entityTarget instanceof Infantry)) {\n // If elevation is the same, building doesn't absorb\n if (ae.getElevation() != entityTarget.getElevation()) {\n int dmgClass = wtype.getInfantryDamageClass();\n int nDamage;\n if (dmgClass < WeaponType.WEAPON_BURST_1D6) {\n nDamage = nDamPerHit * Math.min(nCluster, hits);\n } else {\n // Need to indicate to handleEntityDamage that the\n // absorbed damage shouldn't reduce incoming damage,\n // since the incoming damage was reduced in\n // Compute.directBlowInfantryDamage\n nDamage = -wtype.getDamage(nRange)\n * Math.min(nCluster, hits);\n }\n bldgAbsorbs = (int) Math.round(nDamage\n * bldg.getInfDmgFromInside());\n } else {\n // Used later to indicate a special report\n bldgAbsorbs = Integer.MIN_VALUE;\n }\n }\n\n // Make sure the player knows when his attack causes no damage.\n if (hits == 0) {\n r = new Report(3365);\n r.subject = subjectId;\n if (target.isAirborne() || game.getBoard().inSpace()) {\n r.indent(2);\n }\n vPhaseReport.addElement(r);\n }\n\n // for each cluster of hits, do a chunk of damage\n while (hits > 0) {\n int nDamage;\n // targeting a hex for igniting\n if ((target.getTargetType() == Targetable.TYPE_HEX_IGNITE)\n || (target.getTargetType() == Targetable.TYPE_BLDG_IGNITE)) {\n handleIgnitionDamage(vPhaseReport, bldg, hits);\n return false;\n }\n // targeting a hex for clearing\n if (target.getTargetType() == Targetable.TYPE_HEX_CLEAR) {\n nDamage = nDamPerHit * hits;\n handleClearDamage(vPhaseReport, bldg, nDamage);\n return false;\n }\n // Targeting a building.\n if (target.getTargetType() == Targetable.TYPE_BUILDING) {\n // The building takes the full brunt of the attack.\n nDamage = nDamPerHit * hits;\n handleBuildingDamage(vPhaseReport, bldg, nDamage,\n target.getPosition());\n // And we're done!\n return false;\n }\n if (entityTarget != null) {\n handleEntityDamage(entityTarget, vPhaseReport, bldg, hits,\n nCluster, bldgAbsorbs);\n server.creditKill(entityTarget, ae);\n hits -= nCluster;\n firstHit = false;\n }\n } // Handle the next cluster.\n } else { // We missed, but need to handle special miss cases\n\n // When shooting at a non-infantry unit in a building and the\n // shot misses, the building is damaged instead, TW pg 171\n if (bldgDamagedOnMiss){\n r = new Report(6429);\n r.indent(2);\n r.subject = ae.getId();\n r.newlines--;\n vPhaseReport.add(r);\n int nDamage = nDamPerHit * hits;\n // We want to set bSalvo to true to prevent\n // handleBuildingDamage from reporting a hit\n boolean savedSalvo = bSalvo;\n bSalvo = true;\n handleBuildingDamage(vPhaseReport, bldg, nDamage,\n target.getPosition());\n bSalvo = savedSalvo;\n hits = 0;\n }\n }\n Report.addNewline(vPhaseReport);\n return false;\n }\n\n protected boolean isNemesisConfusable() {\n // Are we iNarc Nemesis Confusable?\n boolean isNemesisConfusable = false;\n AmmoType atype = (AmmoType) ammo.getType();\n Mounted mLinker = weapon.getLinkedBy();\n if ((wtype.getAmmoType() == AmmoType.T_ATM)\n || ((mLinker != null)\n && (mLinker.getType() instanceof MiscType)\n && !mLinker.isDestroyed() && !mLinker.isMissing()\n && !mLinker.isBreached() && (mLinker.getType().hasFlag(\n MiscType.F_ARTEMIS) || mLinker.getType().hasFlag(\n MiscType.F_ARTEMIS_V) || mLinker.getType().hasFlag(\n MiscType.F_ARTEMIS_PROTO)))) {\n if ((!weapon.getType().hasModes() || !weapon.curMode().equals(\"Indirect\"))\n && (((atype.getAmmoType() == AmmoType.T_ATM) && \n ((atype.getMunitionType() == AmmoType.M_STANDARD)\n || (atype.getMunitionType() == AmmoType.M_EXTENDED_RANGE) \n || (atype.getMunitionType() == AmmoType.M_HIGH_EXPLOSIVE))) \n || ((((atype.getAmmoType() == AmmoType.T_LRM)\n || (atype.getAmmoType() == AmmoType.T_LRM_IMP) \n || (atype.getAmmoType() == AmmoType.T_SRM)\n || (atype.getAmmoType() == AmmoType.T_SRM_IMP)) && \n (atype.getMunitionType() == AmmoType.M_ARTEMIS_CAPABLE)) \n || (atype.getMunitionType() == AmmoType.M_ARTEMIS_V_CAPABLE)))) {\n isNemesisConfusable = true;\n }\n } else if ((wtype.getAmmoType() == AmmoType.T_LRM)\n || (wtype.getAmmoType() == AmmoType.T_LRM_IMP)\n || (wtype.getAmmoType() == AmmoType.T_SRM)\n || (wtype.getAmmoType() == AmmoType.T_SRM_IMP)) {\n if ((atype.getMunitionType() == AmmoType.M_NARC_CAPABLE)\n || (atype.getMunitionType() == AmmoType.M_LISTEN_KILL)) {\n isNemesisConfusable = true;\n }\n }\n return isNemesisConfusable;\n }\n\n @Override\n protected boolean usesClusterTable() {\n return true;\n }\n\n @Override\n protected boolean canDoDirectBlowDamage() {\n return false;\n }\n \n /**\n *\n * @return\n */\n protected boolean isAdvancedAMS() {\n //Cluster hits calculation in Compute needs this to be on\n if (game.getOptions().booleanOption(OptionsConstants.ADVAERORULES_AERO_SANITY)\n && getParentBayHandler() != null) {\n WeaponHandler bayHandler = getParentBayHandler();\n return advancedPD && (bayHandler.amsBayEngaged || bayHandler.pdBayEngaged);\n }\n return advancedAMS && (amsEngaged || apdsEngaged);\n }\n \n //Check for Thunderbolt. We'll use this for single AMS resolution\n @Override\n protected boolean isTbolt() {\n return wtype.hasFlag(WeaponType.F_LARGEMISSILE);\n }\n}\n"} +{"text": "Shahed University\n"} +{"text": "# urdf 机器人描述文件 xacro 增强描述语言\n"} +{"text": "/*\n * Copyright (C) 2019 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.android.tools.idea.run.activity;\n\nimport static com.google.common.truth.Truth.assertThat;\n\nimport com.google.common.collect.ImmutableList;\nimport junit.framework.TestCase;\nimport org.jetbrains.android.util.AndroidUtils;\nimport org.jetbrains.annotations.NotNull;\nimport org.jetbrains.annotations.Nullable;\n\n/**\n * Unit tests for {@link DefaultActivityLocatorUnitTest}\n */\npublic class DefaultActivityLocatorUnitTest extends TestCase {\n public void testComputeDefaultActivity_emptyActivitiesList() {\n String defaultActivity = DefaultActivityLocator.computeDefaultActivity(ImmutableList.of());\n assertThat(defaultActivity).isNull();\n }\n\n public void testComputeDefaultActivity_singleNotLaunchableActivity() {\n String defaultActivity =\n DefaultActivityLocator.computeDefaultActivity(ImmutableList.of(new StubActivityWrapper(\"activity.name\", false, false)));\n assertThat(defaultActivity).isNull();\n }\n\n public void testComputeDefaultActivity_singleLaunchableActivity() {\n String defaultActivity =\n DefaultActivityLocator.computeDefaultActivity(ImmutableList.of(new StubActivityWrapper(\"activity.name\", true, false)));\n assertThat(defaultActivity).isEqualTo(\"activity.name\");\n }\n\n public void testComputeDefaultActivity_prefersDefaultActivity() {\n String defaultActivity =\n DefaultActivityLocator.computeDefaultActivity(ImmutableList.of(\n new StubActivityWrapper(\"activity.name\", true, false),\n new StubActivityWrapper(\"default.activity.name\", true, true)\n ));\n assertThat(defaultActivity).isEqualTo(\"default.activity.name\");\n }\n\n public void testComputeDefaultActivity_noDefaultActivityReturnFirstOne() {\n String defaultActivity =\n DefaultActivityLocator.computeDefaultActivity(ImmutableList.of(\n new StubActivityWrapper(\"activity.name.1\", true, false),\n new StubActivityWrapper(\"activity.name.2\", true, false)\n ));\n assertThat(defaultActivity).isEqualTo(\"activity.name.1\");\n }\n\n\n static class StubActivityWrapper extends DefaultActivityLocator.ActivityWrapper {\n @NotNull final String qualifiedName;\n final boolean launchable;\n final boolean isDefaultActivity;\n\n StubActivityWrapper(@NotNull String qualifiedName, boolean launchable, boolean isDefaultActivity) {\n this.qualifiedName = qualifiedName;\n this.launchable = launchable;\n this.isDefaultActivity = isDefaultActivity;\n }\n\n @Override\n public boolean hasCategory(@NotNull String name) {\n if (launchable && (name.equals(AndroidUtils.LAUNCH_CATEGORY_NAME) || name.equals(AndroidUtils.LEANBACK_LAUNCH_CATEGORY_NAME))) {\n return true;\n }\n if (isDefaultActivity && name.equals(AndroidUtils.DEFAULT_CATEGORY_NAME)) {\n return true;\n }\n return false;\n }\n\n @Override\n public boolean hasAction(@NotNull String name) {\n if (launchable && name.equals(AndroidUtils.LAUNCH_ACTION_NAME)) {\n return true;\n }\n return false;\n }\n\n @Override\n public boolean isEnabled() {\n return true;\n }\n\n @Nullable\n @Override\n public String getQualifiedName() {\n return qualifiedName;\n }\n\n @Nullable\n @Override\n public Boolean getExported() { return null; }\n\n @Override\n public boolean hasIntentFilter() { return false; }\n }\n}\n"} +{"text": "# Skip comment\nabcd Vendor One\n\t0123 Product One\n\t0124 Product Two\nefef Vendor Two\n\t0aba Product\n\t\t12 Interface One\n\t\t24 Interface Two\n\t0abb Product\n\t\t12 Interface\n\nC 00 (Defined at Interface level)\nC 01 Audio\n\t01 Control Device\n\t02 Streaming\n\t03 MIDI Streaming\nC 02 Communications\n\t01 Direct Line\n\t02 Abstract (modem)\n\t\t00 None\n\t\t01 AT-commands (v.25ter)\n\t\t02 AT-commands (PCCA101)\n\t\t03 AT-commands (PCCA101 + wakeup)\n\t\t04 AT-commands (GSM)\n\t\t05 AT-commands (3G)\n\t\t06 AT-commands (CDMA)\n\t\tfe Defined by command set descriptor\n\t\tff Vendor Specific (MSFT RNDIS?)\n"} +{"text": "// Alerts\n\n.alert-variant(@background; @border; @text-color) {\n color: @text-color;\n background-color: @background;\n border-color: @border;\n\n hr {\n border-top-color: darken(@border, 5%);\n }\n\n .alert-link {\n color: darken(@text-color, 10%);\n }\n}\n"} +{"text": "// RUN: %clang_cc1 -std=c++1z -verify %s\n\nstruct X {\n static struct A a;\n static inline struct B b; // expected-error {{incomplete type}} expected-note {{forward decl}}\n static inline struct C c = {}; // expected-error {{incomplete type}} expected-note {{forward decl}}\n};\n"} +{"text": "/*==============================================================================\r\n Copyright (c) 2005-2010 Joel de Guzman\r\n Copyright (c) 2010-2011 Thomas Heller\r\n\r\n Distributed under the Boost Software License, Version 1.0. (See accompanying\r\n file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r\n==============================================================================*/\r\n#ifndef BOOST_PHOENIX_CORE_ENVIRONMENT_HPP\r\n#define BOOST_PHOENIX_CORE_ENVIRONMENT_HPP\r\n\r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n\r\n#include \r\n\r\nnamespace boost { namespace phoenix \r\n{\r\n struct unused {};\r\n\r\n namespace result_of\r\n {\r\n template \r\n struct context\r\n {\r\n typedef vector2 type;\r\n };\r\n \r\n template \r\n struct make_context\r\n : context\r\n {};\r\n\r\n template \r\n struct env\r\n {\r\n typedef\r\n typename fusion::result_of::at_c<\r\n typename boost::remove_reference::type\r\n , 0\r\n >::type\r\n type;\r\n };\r\n \r\n template \r\n struct actions\r\n {\r\n typedef\r\n typename fusion::result_of::at_c<\r\n typename boost::remove_reference::type\r\n , 1\r\n >::type\r\n type;\r\n };\r\n }\r\n\r\n namespace functional\r\n {\r\n struct context\r\n {\r\n BOOST_PROTO_CALLABLE()\r\n\r\n template \r\n struct result;\r\n\r\n template \r\n struct result\r\n : result\r\n {};\r\n\r\n template \r\n struct result\r\n : result\r\n {};\r\n\r\n template \r\n struct result\r\n : result\r\n {};\r\n\r\n template \r\n struct result\r\n : result_of::context\r\n {};\r\n\r\n template \r\n typename result_of::context::type\r\n operator()(Env & env, Actions & actions) const\r\n {\r\n vector2 e = {env, actions};\r\n return e;\r\n }\r\n\r\n template \r\n typename result_of::context::type\r\n operator()(Env const & env, Actions & actions) const\r\n {\r\n vector2 e = {env, actions};\r\n return e;\r\n }\r\n\r\n template \r\n typename result_of::context::type\r\n operator()(Env & env, Actions const & actions) const\r\n {\r\n vector2 e = {env, actions};\r\n return e;\r\n }\r\n\r\n template \r\n typename result_of::context::type\r\n operator()(Env const & env, Actions const & actions) const\r\n {\r\n vector2 e = {env, actions};\r\n return e;\r\n }\r\n };\r\n\r\n struct make_context\r\n : context\r\n {};\r\n\r\n struct env\r\n {\r\n BOOST_PROTO_CALLABLE()\r\n\r\n template \r\n struct result;\r\n\r\n template \r\n struct result\r\n : result\r\n {};\r\n\r\n template \r\n struct result\r\n : result_of::env\r\n {};\r\n\r\n template \r\n typename result_of::env::type\r\n operator()(Context const & ctx) const\r\n {\r\n return fusion::at_c<0>(ctx);\r\n }\r\n\r\n template \r\n typename result_of::env::type\r\n operator()(Context & ctx) const\r\n {\r\n return fusion::at_c<0>(ctx);\r\n }\r\n };\r\n \r\n struct actions\r\n {\r\n BOOST_PROTO_CALLABLE()\r\n\r\n template \r\n struct result;\r\n\r\n template \r\n struct result\r\n : result\r\n {};\r\n\r\n template \r\n struct result\r\n : result_of::actions\r\n {};\r\n\r\n template \r\n typename result_of::actions::type\r\n operator()(Context const & ctx) const\r\n {\r\n return fusion::at_c<1>(ctx);\r\n }\r\n\r\n template \r\n typename result_of::actions::type\r\n operator()(Context & ctx) const\r\n {\r\n return fusion::at_c<1>(ctx);\r\n }\r\n };\r\n\r\n }\r\n\r\n struct _context\r\n : proto::transform<_context>\r\n {\r\n template \r\n struct impl\r\n : proto::transform_impl\r\n {\r\n typedef vector2 result_type;\r\n\r\n result_type operator()(\r\n typename impl::expr_param\r\n , typename impl::state_param s\r\n , typename impl::data_param d\r\n ) const\r\n {\r\n vector2 e = {s, d};\r\n return e;\r\n }\r\n };\r\n };\r\n\r\n template \r\n inline\r\n typename result_of::context::type const\r\n context(Env const& env, Actions const& actions)\r\n {\r\n vector2 e = {env, actions};\r\n return e;\r\n }\r\n\r\n template \r\n inline\r\n typename result_of::context::type const\r\n make_context(Env const& env, Actions const& actions)\r\n {\r\n return context(env, actions);\r\n }\r\n\r\n template \r\n inline\r\n typename result_of::context::type const\r\n context(Env & env, Actions const& actions)\r\n {\r\n vector2 e = {env, actions};\r\n return e;\r\n }\r\n \r\n template \r\n inline\r\n typename result_of::context::type const\r\n make_context(Env & env, Actions const& actions)\r\n {\r\n return context(env, actions);\r\n }\r\n\r\n template \r\n inline\r\n typename result_of::context::type const\r\n context(Env const& env, Actions & actions)\r\n {\r\n vector2 e = {env, actions};\r\n return e;\r\n }\r\n \r\n template \r\n inline\r\n typename result_of::context::type const\r\n make_context(Env const& env, Actions & actions)\r\n {\r\n return context(env, actions);\r\n }\r\n \r\n template \r\n inline\r\n typename result_of::context::type const\r\n context(Env & env, Actions & actions)\r\n {\r\n vector2 e = {env, actions};\r\n return e;\r\n }\r\n \r\n template \r\n inline\r\n typename result_of::context::type const\r\n make_context(Env & env, Actions & actions)\r\n {\r\n return context(env, actions);\r\n }\r\n\r\n struct _env\r\n : proto::transform<_env>\r\n {\r\n template \r\n struct impl\r\n : proto::transform_impl\r\n {\r\n typedef State result_type;\r\n\r\n result_type operator()(\r\n typename impl::expr_param\r\n , typename impl::state_param s\r\n , typename impl::data_param\r\n ) const\r\n {\r\n return s;\r\n }\r\n };\r\n };\r\n\r\n template \r\n struct _env::impl\r\n : proto::transform_impl\r\n {\r\n typedef\r\n typename fusion::result_of::at_c<\r\n typename boost::remove_reference::type\r\n , 0\r\n >::type\r\n result_type;\r\n\r\n result_type operator()(\r\n typename impl::expr_param\r\n , typename impl::state_param s\r\n , typename impl::data_param\r\n ) const\r\n {\r\n return fusion::at_c<0>(s);\r\n }\r\n };\r\n\r\n template \r\n struct _env::impl\r\n : _env::impl\r\n {};\r\n\r\n template \r\n inline\r\n typename fusion::result_of::at_c::type\r\n env(Context & ctx)\r\n {\r\n return fusion::at_c<0>(ctx);\r\n }\r\n\r\n template \r\n inline\r\n typename fusion::result_of::at_c::type\r\n env(Context const & ctx)\r\n {\r\n return fusion::at_c<0>(ctx);\r\n }\r\n\r\n struct _actions\r\n : proto::transform<_actions>\r\n {\r\n template \r\n struct impl\r\n : proto::transform_impl\r\n {\r\n typedef Data result_type;\r\n\r\n result_type operator()(\r\n typename impl::expr_param\r\n , typename impl::state_param\r\n , typename impl::data_param d\r\n ) const\r\n {\r\n return d;\r\n }\r\n };\r\n };\r\n\r\n template \r\n struct _actions::impl\r\n : proto::transform_impl\r\n {\r\n typedef\r\n typename fusion::result_of::at_c<\r\n typename boost::remove_reference::type\r\n , 1\r\n >::type\r\n result_type;\r\n\r\n result_type operator()(\r\n typename impl::expr_param\r\n , typename impl::state_param s\r\n , typename impl::data_param\r\n ) const\r\n {\r\n return fusion::at_c<1>(s);\r\n }\r\n };\r\n\r\n template \r\n struct _actions::impl\r\n : _actions::impl\r\n {};\r\n\r\n template \r\n inline\r\n typename fusion::result_of::at_c::type\r\n actions(Context & ctx)\r\n {\r\n return fusion::at_c<1>(ctx);\r\n }\r\n\r\n template \r\n inline\r\n typename fusion::result_of::at_c::type\r\n actions(Context const & ctx)\r\n {\r\n return fusion::at_c<1>(ctx);\r\n }\r\n\r\n namespace result_of\r\n {\r\n template <\r\n BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(\r\n BOOST_PHOENIX_LIMIT\r\n , typename A\r\n , mpl::void_\r\n )\r\n , typename Dummy = void\r\n >\r\n struct make_env;\r\n \r\n #define M0(Z, N, D) \\\r\n template \\\r\n struct make_env \\\r\n { \\\r\n typedef BOOST_PP_CAT(vector, N) type; \\\r\n }; \\\r\n /**/\r\n BOOST_PP_REPEAT_FROM_TO(1, BOOST_PHOENIX_LIMIT, M0, _)\r\n #undef M0\r\n }\r\n\r\n inline\r\n result_of::make_env<>::type\r\n make_env()\r\n {\r\n return result_of::make_env<>::type();\r\n }\r\n#define M0(Z, N, D) \\\r\n template \\\r\n inline \\\r\n typename result_of::make_env::type \\\r\n make_env(BOOST_PHOENIX_A_ref_a(N)) \\\r\n { \\\r\n typename result_of::make_env::type \\\r\n env = \\\r\n { \\\r\n BOOST_PHOENIX_a(N) \\\r\n }; \\\r\n return env; \\\r\n } \\\r\n template \\\r\n inline \\\r\n typename result_of::make_env::type \\\r\n make_env(BOOST_PHOENIX_A_const_ref_a(N)) \\\r\n { \\\r\n typename result_of::make_env::type \\\r\n env = \\\r\n { \\\r\n BOOST_PHOENIX_a(N) \\\r\n }; \\\r\n return env; \\\r\n } \\\r\n /**/\r\n BOOST_PP_REPEAT_FROM_TO(1, BOOST_PHOENIX_LIMIT, M0, _)\r\n #undef M0\r\n\r\n template \r\n struct is_environment : fusion::traits::is_sequence {};\r\n}}\r\n\r\n#endif\r\n\r\n"} +{"text": "To Whom It May Concern,\n\nI have read and understand GitHub's Guide to Filing a DMCA Notice.\n\nI am writing on behalf of NewsCred Inc. \n\nWe noticed that the code published in Github public repository 'https://github.com/shuvzzy/cms_newscred' by Github user 'shuvzzy\n' is a version of our source code published in\nour private repository '[PRIVATE]'.\n\nWe ask that you remove the infringing materials as soon as possible.\n\nYou can contact me at:\n\n[PRIVATE]\n\nOur Organization account is: https://github.com/newscred\n\n\n\nI have a good faith belief that use of the copyrighted materials described\nabove on the infringing web pages is not authorized by the copyright owner,\nor its agent, or the law.\n\nI swear, under penalty of perjury, that the information in this\nnotification is accurate and that I am the copyright owner, or am\nauthorized to act on behalf of the owner, of an exclusive right that is\nallegedly infringed.\n\nSigned;\n\n[PRIVATE]\n\nNewsCred Inc.\n"} +{"text": "---\ntitle: Configuring Single-Hop Client Access to Server-Partitioned Regions\n---\n\n\n\nSingle-hop data access enables the client pool to track where a partitioned region’s data is hosted in the servers. To access a single entry, the client directly contacts the server that hosts the key, in a single hop.\n\n- **[Understanding Client Single-Hop Access to Server-Partitioned Regions](how_pr_single_hop_works.html)**\n\n With single-hop access the client connects to every server, so more connections are generally used. This works fine for smaller installations, but is a barrier to scaling.\n\n- **[Configure Client Single-Hop Access to Server-Partitioned Regions](configure_pr_single_hop.html)**\n\n Configure your client/server system for direct, single-hop access to partitioned region data in the servers.\n\n\n"} +{"text": "package sharpen.core;\n\nimport sharpen.core.csharp.ast.*;\n\npublic final class FlowAnalysis {\n\n\tprivate FlowAnalysis() {\n\t\t;\n\t}\n\n\tpublic static boolean isReachable(CSBlock block) {\n\t\treturn Visitor.run(block);\n\t}\n\n\tpublic static class Visitor extends CSVisitor {\n\n\t\tprivate boolean _reachable = true;\n\n\t\tpublic static boolean run(CSStatement node) {\n\t\t\tVisitor visitor = new Visitor();\n\t\t\tnode.accept(visitor);\n\t\t\treturn visitor._reachable;\n\t\t}\n\n\t\tprivate void setUnreachable() {\n\t\t\t_reachable = false;\n\t\t}\n\n\t\tprivate boolean isUnreachable() {\n\t\t\treturn !_reachable;\n\t\t}\n\n\t\t@Override\n\t\tpublic void visit(CSBlock node) {\n\t\t\tfor (CSStatement statement : node.statements()) {\n\t\t\t\tif (!run(statement)) {\n\t\t\t\t\tsetUnreachable();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void visit(CSBreakStatement node) {\n\t\t\tsetUnreachable();\n\t\t}\n\n\t\t@Override\n\t\tpublic void visit(CSContinueStatement node) {\n\t\t\tsetUnreachable();\n\t\t}\n\n\t\t@Override\n\t\tpublic void visit(CSReturnStatement node) {\n\t\t\tsetUnreachable();\n\t\t}\n\n\t\t@Override\n\t\tpublic void visit(CSThrowStatement node) {\n\t\t\tsetUnreachable();\n\t\t}\n\n\t\t@Override\n\t\tpublic void visit(CSIfStatement node) {\n\t\t\tboolean reachable = false;\n\t\t\tif (node.trueBlock() != null)\n\t\t\t\treachable |= run(node.trueBlock());\n\t\t\tif (node.falseBlock() != null)\n\t\t\t\treachable |= run(node.falseBlock());\n\t\t\tif (!reachable)\n\t\t\t\tsetUnreachable();\n\t\t}\n\n\t\t@Override\n\t\tpublic void visit(CSSwitchStatement node) {\n\t\t\tif (isUnreachable())\n\t\t\t\treturn;\n\t\t\tboolean hasDefault = false;\n\t\t\tboolean reachable = false;\n\t\t\tfor (CSCaseClause clause : node.caseClauses()) {\n\t\t\t\tif (clause.isDefault())\n\t\t\t\t\thasDefault = true;\n\t\t\t\treachable |= run(clause.body());\n\t\t\t}\n\t\t\tif (!reachable && hasDefault)\n\t\t\t\tsetUnreachable();\n\t\t}\n\n\t}\n\n}\n"} +{"text": "---\ngroup: frontend-developer-guide\ntitle: Customizing styles illustration\nfunctional_areas:\n - Frontend\n---\n\n## What is in this topic {#practice_over}\n\nThis topic features a step-by-step illustration of how to change a theme's color scheme using Magento UI library.\n\n## Changing theme color scheme\n\nOrangeCo created a custom theme that inherits from the Magento basic Blank theme.\nThe following image illustrates how store pages look when the Blank theme is applied:\n\n![product page when Blank applied]\n\nIn their Grey theme, OrangeCo wants to change the color scheme from white to grey.\n\nThe Grey theme directory is `app/design/frontend/OrangeCo/grey`.\n\nOrangeCo decided to use the Magento UI library, so to change the color scheme, they need to define new values for certain default Less variables.\nTo do this, they added an overriding `_theme.less` file in the `app/design/frontend/OrangeCo/grey/web/css/source` directory, with the following content:\n\n```less\n// Color nesting\n@page__background-color: @color-gray20;\n@sidebar__background-color: @color-gray40;\n@primary__color: @color-gray80;\n@border-color__base: @color-gray76;\n\n@link__color: @color-gray56;\n@link__hover__color: @color-gray60;\n\n// Buttons\n@button__color: @color-gray20;\n@button__background: @color-gray80;\n@button__border: 1px solid @border-color__base;\n\n// Primary button\n@button-primary__background: @color-orange-red1;\n@button-primary__border: 1px solid @color-orange-red2;\n@button-primary__color: @color-white;\n@button-primary__hover__background: darken(@color-orange-red1, 5%);\n@button-primary__hover__border: 1px solid @color-orange-red2;\n@button-primary__hover__color: @color-white;\n\n// Navigation\n@navigation-level0-item__color: @color-gray80;\n@submenu-item__color: @color-gray80;\n\n@navigation__background: @color-gray40;\n@navigation-desktop-level0-item__color: @color-gray80;\n@navigation-desktop-level0-item__hover__color: @color-gray34;\n@navigation-desktop-level0-item__active__color: @navigation-desktop-level0-item__color;\n\n// Tabs\n@tab-control__background-color: @page__background-color;\n\n// Forms\n@form-element-input__background: @color-gray89;\n@form-element-input-placeholder__color: @color-gray60;\n\n// Header icons\n@header-icons-color: @color-gray89;\n@header-icons-color-hover: @color-gray60;\n```\n\nAfter the Grey theme is applied (and [static files cache cleared]), store pages will look like following:\n\n![product page when Grey applied]\n\n[product page when Blank applied]: {{site.baseurl}}/common/images/practice_blank.png\n[product page when Grey applied]: {{site.baseurl}}/common/images/css_practice.png\n[static files cache cleared]: {{page.baseurl}}/frontend-dev-guide/cache_for_frontdevs.html#clean_static_cache\n"} +{"text": "{\n \"name\": \"rowgrid.js\",\n \"version\": \"1.1.0\",\n \"description\": \"A small, lightweight JavaScript plugin for placing items in straight rows\",\n \"main\": \"jquery.row-grid.js\",\n \"directories\": {\n \"example\": \"example\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/brunjo/rowGrid.js.git\"\n },\n \"keywords\": [\n \"jQuery\",\n \"grid\",\n \"layout\",\n \"images\"\n ],\n \"author\": \"Bruno Joseph (http://www.brunojoseph.com/)\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/brunjo/rowGrid.js/issues\"\n },\n \"homepage\": \"https://github.com/brunjo/rowGrid.js\",\n \"dependencies\" : {\n \"jquery\": \">=1.7.0\"\n }\n}\n"} +{"text": "var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n"} +{"text": "Car -1 -1 -10 247 189 364 252 1.46 1.63 4.03 -8.32 1.98 20.02 1.54 1.00\nCar -1 -1 -10 566 180 610 224 1.66 1.69 4.43 -0.89 1.98 29.85 -1.59 1.00\nCar -1 -1 -10 355 187 428 229 1.47 1.63 4.12 -8.68 2.11 28.93 1.59 1.00\nCar -1 -1 -10 419 186 473 216 1.48 1.66 3.54 -8.83 2.23 39.15 1.74 0.97\nCar -1 -1 -10 -229 198 144 345 1.46 1.61 3.81 -8.34 1.87 9.71 1.56 0.63\nCar -1 -1 -10 453 185 486 210 1.48 1.60 3.91 -9.32 2.38 48.13 1.52 0.22\nCar -1 -1 -10 1157 168 1236 217 1.51 1.50 3.60 19.38 1.37 23.83 -0.74 0.01\n"} +{"text": "/*=============================================================================\n Copyright (c) 2001-2008 Joel de Guzman\n Copyright (c) 2001-2008 Hartmut Kaiser\n http://spirit.sourceforge.net/\n\n Distributed under the Boost Software License, Version 1.0. (See accompanying\n file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n=============================================================================*/\n#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_DISTINCT_FWD\n#define BOOST_SPIRIT_INCLUDE_CLASSIC_DISTINCT_FWD\n#include \n#endif\n"} +{"text": "/* linux/drivers/spi/spi_s3c24xx_fiq.S\n *\n * Copyright 2009 Simtec Electronics\n *\tBen Dooks \n *\n * S3C24XX SPI - FIQ pseudo-DMA transfer code\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License version 2 as\n * published by the Free Software Foundation.\n*/\n\n#include \n#include \n\n#include \n#include \n#include \n\n#include \"spi-s3c24xx-fiq.h\"\n\n\t.text\n\n\t@ entry to these routines is as follows, with the register names\n\t@ defined in fiq.h so that they can be shared with the C files which\n\t@ setup the calling registers.\n\t@\n\t@ fiq_rirq\tThe base of the IRQ registers to find S3C2410_SRCPND\n\t@ fiq_rtmp\tTemporary register to hold tx/rx data\n\t@ fiq_rspi\tThe base of the SPI register block\n\t@ fiq_rtx\tThe tx buffer pointer\n\t@ fiq_rrx\tThe rx buffer pointer\n\t@ fiq_rcount\tThe number of bytes to move\n\n\t@ each entry starts with a word entry of how long it is\n\t@ and an offset to the irq acknowledgment word\n\nENTRY(s3c24xx_spi_fiq_rx)\ns3c24xx_spi_fix_rx:\n\t.word\tfiq_rx_end - fiq_rx_start\n\t.word\tfiq_rx_irq_ack - fiq_rx_start\nfiq_rx_start:\n\tldr\tfiq_rtmp, fiq_rx_irq_ack\n\tstr\tfiq_rtmp, [ fiq_rirq, # S3C2410_SRCPND - S3C24XX_VA_IRQ ]\n\n\tldrb\tfiq_rtmp, [ fiq_rspi, # S3C2410_SPRDAT ]\n\tstrb\tfiq_rtmp, [ fiq_rrx ], #1\n\n\tmov\tfiq_rtmp, #0xff\n\tstrb\tfiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]\n\n\tsubs\tfiq_rcount, fiq_rcount, #1\n\tsubnes\tpc, lr, #4\t\t@@ return, still have work to do\n\n\t@@ set IRQ controller so that next op will trigger IRQ\n\tmov\tfiq_rtmp, #0\n\tstr\tfiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD - S3C24XX_VA_IRQ ]\n\tsubs\tpc, lr, #4\n\nfiq_rx_irq_ack:\n\t.word\t0\nfiq_rx_end:\n\nENTRY(s3c24xx_spi_fiq_txrx)\ns3c24xx_spi_fiq_txrx:\n\t.word\tfiq_txrx_end - fiq_txrx_start\n\t.word\tfiq_txrx_irq_ack - fiq_txrx_start\nfiq_txrx_start:\n\n\tldrb\tfiq_rtmp, [ fiq_rspi, # S3C2410_SPRDAT ]\n\tstrb\tfiq_rtmp, [ fiq_rrx ], #1\n\n\tldr\tfiq_rtmp, fiq_txrx_irq_ack\n\tstr\tfiq_rtmp, [ fiq_rirq, # S3C2410_SRCPND - S3C24XX_VA_IRQ ]\n\n\tldrb\tfiq_rtmp, [ fiq_rtx ], #1\n\tstrb\tfiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]\n\n\tsubs\tfiq_rcount, fiq_rcount, #1\n\tsubnes\tpc, lr, #4\t\t@@ return, still have work to do\n\n\tmov\tfiq_rtmp, #0\n\tstr\tfiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD - S3C24XX_VA_IRQ ]\n\tsubs\tpc, lr, #4\n\nfiq_txrx_irq_ack:\n\t.word\t0\n\nfiq_txrx_end:\n\nENTRY(s3c24xx_spi_fiq_tx)\ns3c24xx_spi_fix_tx:\n\t.word\tfiq_tx_end - fiq_tx_start\n\t.word\tfiq_tx_irq_ack - fiq_tx_start\nfiq_tx_start:\n\tldrb\tfiq_rtmp, [ fiq_rspi, # S3C2410_SPRDAT ]\n\n\tldr\tfiq_rtmp, fiq_tx_irq_ack\n\tstr\tfiq_rtmp, [ fiq_rirq, # S3C2410_SRCPND - S3C24XX_VA_IRQ ]\n\n\tldrb\tfiq_rtmp, [ fiq_rtx ], #1\n\tstrb\tfiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]\n\n\tsubs\tfiq_rcount, fiq_rcount, #1\n\tsubnes\tpc, lr, #4\t\t@@ return, still have work to do\n\n\tmov\tfiq_rtmp, #0\n\tstr\tfiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD - S3C24XX_VA_IRQ ]\n\tsubs\tpc, lr, #4\n\nfiq_tx_irq_ack:\n\t.word\t0\n\nfiq_tx_end:\n\n\t.end\n"} +{"text": "package com.iota.iri.service.milestone.impl;\n\nimport com.iota.iri.controllers.MilestoneViewModel;\nimport com.iota.iri.service.milestone.MilestoneException;\nimport com.iota.iri.service.milestone.MilestoneRepairer;\nimport com.iota.iri.service.milestone.MilestoneService;\n\n/**\n * Creates a {@link MilestoneRepairer} service to fix corrupted milestone objects.\n */\npublic class MilestoneRepairerImpl implements MilestoneRepairer {\n\n /**\n * A {@link MilestoneService} instance for repairing corrupted milestones\n */\n private MilestoneService milestoneService;\n\n /**\n * Holds the milestone index of the milestone that caused the repair logic to get started.\n */\n private int errorCausingMilestoneIndex = Integer.MAX_VALUE;\n\n /**\n * Counter for the backoff repair strategy (see {@link #repairCorruptedMilestone(MilestoneViewModel)}.\n */\n private int repairBackoffCounter = 0;\n\n /**\n * Constructor for a {@link MilestoneRepairer} to be used for resetting corrupted milestone objects\n * @param milestoneService A {@link MilestoneService} instance to reset corrupted mielstones\n */\n public MilestoneRepairerImpl(MilestoneService milestoneService) {\n this.milestoneService = milestoneService;\n }\n\n /**\n * {@inheritDoc}\n *\n *

\n * We simply use the {@link #repairBackoffCounter} as an indicator if a repair routine is running.\n *

\n */\n @Override\n public boolean isRepairRunning() {\n return repairBackoffCounter != 0;\n }\n\n /**\n * {@inheritDoc}\n */\n @Override\n public boolean isRepairSuccessful(MilestoneViewModel processedMilestone) {\n return processedMilestone.index() > errorCausingMilestoneIndex;\n }\n\n /**\n * {@inheritDoc}\n */\n @Override\n public void stopRepair() {\n repairBackoffCounter = 0;\n errorCausingMilestoneIndex = Integer.MAX_VALUE;\n }\n\n /**\n * {@inheritDoc}\n */\n public void repairCorruptedMilestone(MilestoneViewModel errorCausingMilestone) throws MilestoneException {\n if (repairBackoffCounter++ == 0) {\n errorCausingMilestoneIndex = errorCausingMilestone.index();\n }\n for (int i = errorCausingMilestone.index(); i > errorCausingMilestone.index() - repairBackoffCounter; i--) {\n milestoneService.resetCorruptedMilestone(i);\n }\n }\n}\n"} +{"text": "# -------------------------------------------------------------\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n# -------------------------------------------------------------\n\nfrom typing import Union\n\nMODULE_NAME = 'systemds'\nVALID_INPUT_TYPES = Union['DAGNode', str, int, float, bool]\nBINARY_OPERATIONS = ['+', '-', '/', '//', '*', '<', '<=', '>', '>=', '==', '!=', '%*%']\n# TODO add numpy array and implement for numpy array\nVALID_ARITHMETIC_TYPES = Union['DAGNode', int, float]\n"} +{"text": "# 2007 March 28\n#\n# The author disclaims copyright to this source code.\n#\n#*************************************************************************\n# This file implements regression tests for SQLite library. The focus\n# of this script is testing isspace/isalnum/tolower problems with the\n# FTS1 module. Unfortunately, this code isn't a really principled set\n# of tests, because it is impossible to know where new uses of these\n# functions might appear.\n#\n# $Id: fts1k.test,v 1.2 2007/12/13 21:54:11 drh Exp $\n#\n\nset testdir [file dirname $argv0]\nsource $testdir/tester.tcl\n\n# If SQLITE_ENABLE_FTS1 is defined, omit this file.\nifcapable !fts1 {\n finish_test\n return\n}\n\n# Tests that startsWith() (calls isspace, tolower, isalnum) can handle\n# hi-bit chars. parseSpec() also calls isalnum here.\ndo_test fts1k-1.1 {\n execsql \"CREATE VIRTUAL TABLE t1 USING fts1(content, \\x80)\"\n} {}\n\n# Additionally tests isspace() call in getToken(), and isalnum() call\n# in tokenListToIdList().\ndo_test fts1k-1.2 {\n catch {\n execsql \"CREATE VIRTUAL TABLE t2 USING fts1(content, tokenize \\x80)\"\n }\n sqlite3_errmsg $DB\n} \"unknown tokenizer: \\x80\"\n\n# Additionally test final isalnum() in startsWith().\ndo_test fts1k-1.3 {\n execsql \"CREATE VIRTUAL TABLE t3 USING fts1(content, tokenize\\x80)\"\n} {}\n\n# The snippet-generation code has calls to isspace() which are sort of\n# hard to get to. It finds convenient breakpoints by starting ~40\n# chars before and after the matched term, and scanning ~10 chars\n# around that position for isspace() characters. The long word with\n# embedded hi-bit chars causes one of these isspace() calls to be\n# exercised. The version with a couple extra spaces should cause the\n# other isspace() call to be exercised. [Both cases have been tested\n# in the debugger, but I'm hoping to continue to catch it if simple\n# constant changes change things slightly.\n#\n# The trailing and leading hi-bit chars help with code which tests for\n# isspace() to coalesce multiple spaces.\n\nset word \"\\x80xxxxx\\x80xxxxx\\x80xxxxx\\x80xxxxx\\x80xxxxx\\x80xxxxx\\x80\"\nset phrase1 \"$word $word $word target $word $word $word\"\nset phrase2 \"$word $word $word target $word $word $word\"\n\ndb eval {CREATE VIRTUAL TABLE t4 USING fts1(content)}\ndb eval \"INSERT INTO t4 (content) VALUES ('$phrase1')\"\ndb eval \"INSERT INTO t4 (content) VALUES ('$phrase2')\"\n\ndo_test fts1k-1.4 {\n execsql {SELECT rowid, length(snippet(t4)) FROM t4 WHERE t4 MATCH 'target'}\n} {1 111 2 117}\n\nfinish_test\n"} +{"text": "/*\n * DO NOT EDIT. THIS FILE IS GENERATED FROM nsIFileURL.idl\n */\n\n#ifndef __gen_nsIFileURL_h__\n#define __gen_nsIFileURL_h__\n\n\n#ifndef __gen_nsIURL_h__\n#include \"nsIURL.h\"\n#endif\n\n/* For IDL files that don't want to include root IDL files. */\n#ifndef NS_NO_VTABLE\n#define NS_NO_VTABLE\n#endif\nclass nsIFile; /* forward declaration */\n\n\n/* starting interface: nsIFileURL */\n#define NS_IFILEURL_IID_STR \"d26b2e2e-1dd1-11b2-88f3-8545a7ba7949\"\n\n#define NS_IFILEURL_IID \\\n {0xd26b2e2e, 0x1dd1, 0x11b2, \\\n { 0x88, 0xf3, 0x85, 0x45, 0xa7, 0xba, 0x79, 0x49 }}\n\n/**\n * nsIFileURL provides access to the underlying nsIFile object corresponding to\n * an URL. The URL scheme need not be file:, since other local protocols may\n * map URLs to files (e.g., resource:).\n *\n * @status FROZEN\n */\nclass NS_NO_VTABLE nsIFileURL : public nsIURL {\n public: \n\n NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFILEURL_IID)\n\n /**\n * Get/Set nsIFile corresponding to this URL.\n *\n * - Getter returns a reference to an immutable object. Callers must clone\n * before attempting to modify the returned nsIFile object. NOTE: this\n * constraint might not be enforced at runtime, so beware!!\n *\n * - Setter clones the nsIFile object (allowing the caller to safely modify\n * the nsIFile object after setting it on this interface).\n */\n /* attribute nsIFile file; */\n NS_IMETHOD GetFile(nsIFile * *aFile) = 0;\n NS_IMETHOD SetFile(nsIFile * aFile) = 0;\n\n};\n\n/* Use this macro when declaring classes that implement this interface. */\n#define NS_DECL_NSIFILEURL \\\n NS_IMETHOD GetFile(nsIFile * *aFile); \\\n NS_IMETHOD SetFile(nsIFile * aFile); \n\n/* Use this macro to declare functions that forward the behavior of this interface to another object. */\n#define NS_FORWARD_NSIFILEURL(_to) \\\n NS_IMETHOD GetFile(nsIFile * *aFile) { return _to GetFile(aFile); } \\\n NS_IMETHOD SetFile(nsIFile * aFile) { return _to SetFile(aFile); } \n\n/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */\n#define NS_FORWARD_SAFE_NSIFILEURL(_to) \\\n NS_IMETHOD GetFile(nsIFile * *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFile(aFile); } \\\n NS_IMETHOD SetFile(nsIFile * aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFile(aFile); } \n\n#if 0\n/* Use the code below as a template for the implementation class for this interface. */\n\n/* Header file */\nclass nsFileURL : public nsIFileURL\n{\npublic:\n NS_DECL_ISUPPORTS\n NS_DECL_NSIFILEURL\n\n nsFileURL();\n\nprivate:\n ~nsFileURL();\n\nprotected:\n /* additional members */\n};\n\n/* Implementation file */\nNS_IMPL_ISUPPORTS1(nsFileURL, nsIFileURL)\n\nnsFileURL::nsFileURL()\n{\n /* member initializers and constructor code */\n}\n\nnsFileURL::~nsFileURL()\n{\n /* destructor code */\n}\n\n/* attribute nsIFile file; */\nNS_IMETHODIMP nsFileURL::GetFile(nsIFile * *aFile)\n{\n return NS_ERROR_NOT_IMPLEMENTED;\n}\nNS_IMETHODIMP nsFileURL::SetFile(nsIFile * aFile)\n{\n return NS_ERROR_NOT_IMPLEMENTED;\n}\n\n/* End of implementation class template. */\n#endif\n\n\n#endif /* __gen_nsIFileURL_h__ */\n"} +{"text": "import Tree from '..';\nimport { TreeNode } from '../treeNode';\n\nconst tree = new Tree('one');\ntree._root.children.push(new TreeNode('two'));\ntree._root.children[0].parent = tree;\n\ntree._root.children.push(new TreeNode('three'));\ntree._root.children[1].parent = tree;\n\ntree._root.children.push(new TreeNode('four'));\ntree._root.children[2].parent = tree;\n\ntree._root.children[0].children.push(new TreeNode('five'));\ntree._root.children[0].children[0].parent = tree._root.children[0];\n\ntree._root.children[0].children.push(new TreeNode('six'));\ntree._root.children[0].children[1].parent = tree._root.children[0];\n\ntree._root.children[1].children.push(new TreeNode('seven'));\ntree._root.children[1].children[0].parent = tree._root.children[1];\n\ntest('tree-initial', () => {\n expect(tree._root.val).toBe('one');\n expect(tree._root.children[0].val).toBe('two');\n expect(tree._root.children[1].val).toBe('three');\n expect(tree._root.children[2].val).toBe('four');\n expect(tree._root.children[0].children[0].val).toBe('five');\n expect(tree._root.children[0].children[1].val).toBe('six');\n expect(tree._root.children[1].children[0].val).toBe('seven');\n expect(tree._root.parent).toBe(null);\n});\n\ntest('tree-df', () => {\n const df = [];\n tree.traverseDF(treeNode => df.push(treeNode.val));\n expect(df).toEqual(['five', 'six', 'two', 'seven', 'three', 'four', 'one']);\n});\n\ntest('tree-bf', () => {\n const bf = [];\n tree.traverseBF(treeNode => bf.push(treeNode.val));\n expect(bf).toEqual(['one', 'two', 'three', 'four', 'five', 'six', 'seven']);\n});\n\ntest('tree-contains', () => {\n expect(tree.contains('four')).toBe(true);\n expect(tree.contains('zero')).toBe(false);\n});\n\ntest('tree-add', () => {\n tree.add('child-of-one', 'one');\n tree.add('child-of-seven', 'seven');\n expect(tree._root.children[3].val).toBe('child-of-one');\n expect(tree._root.children[1].children[0].children[0].val).toBe(\n 'child-of-seven',\n );\n});\n\ntest('tree-remove', () => {\n tree.remove('child-of-one', 'one');\n tree.remove('child-of-seven', 'seven');\n expect(tree._root.children[3]).toBe(undefined);\n expect(tree._root.children[1].children[0].children[0]).toBe(undefined);\n});\n"} +{"text": "\n\n\n \n \n \n \n \n ECharts · Example\n\n \n\n \n \n \n \n \n \n\n \n \n \n\n \n \n\n\n\n \n
\n\n\n
\n
\n
\n
\n
option
\n \n
\n
\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 * * Copyright 2015 See AUTHORS file.\n * *\n * * Licensed under the Apache License, Version 2.0 (the \"License\");\n * * you may not use this file except in compliance with the License.\n * * You may obtain a copy of the License at\n * *\n * * http://www.apache.org/licenses/LICENSE-2.0\n * *\n * * Unless required by applicable law or agreed to in writing, software\n * * distributed under the License is distributed on an \"AS IS\" BASIS,\n * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * * See the License for the specific language governing permissions and\n * * limitations under the License.\n * *****************************************************************************\n */\n\npackage com.uwsoft.editor.view.ui.properties.panels;\n\nimport com.commons.color.ColorPickerAdapter;\nimport com.commons.color.CustomColorPicker;\nimport org.apache.commons.lang3.ArrayUtils;\nimport org.apache.commons.lang3.math.NumberUtils;\n\nimport com.badlogic.gdx.graphics.Color;\nimport com.puremvc.patterns.observer.Notification;\nimport com.uwsoft.editor.view.stage.Sandbox;\nimport com.uwsoft.editor.view.ui.properties.UIAbstractPropertiesMediator;\nimport com.uwsoft.editor.renderer.data.PhysicsPropertiesVO;\nimport com.uwsoft.editor.renderer.data.SceneVO;\n\n/**\n * Created by azakhary on 4/16/2015.\n */\npublic class UIScenePropertiesMediator extends UIAbstractPropertiesMediator {\n private static final String TAG = UIScenePropertiesMediator.class.getCanonicalName();\n public static final String NAME = TAG;\n\n public UIScenePropertiesMediator() {\n super(NAME, new UISceneProperties());\n }\n\n @Override\n public String[] listNotificationInterests() {\n String[] defaultNotifications = super.listNotificationInterests();\n String[] notificationInterests = new String[]{\n UISceneProperties.AMBIENT_COLOR_BUTTON_CLICKED\n };\n\n return ArrayUtils.addAll(defaultNotifications, notificationInterests);\n }\n\n @Override\n public void handleNotification(Notification notification) {\n super.handleNotification(notification);\n\n switch (notification.getName()) {\n case UISceneProperties.AMBIENT_COLOR_BUTTON_CLICKED:\n CustomColorPicker picker = new CustomColorPicker(new ColorPickerAdapter() {\n @Override\n public void finished(Color newColor) {\n viewComponent.setAmbientColor(newColor);\n facade.sendNotification(viewComponent.getUpdateEventName());\n }\n @Override\n public void changed(Color newColor) {\n viewComponent.setAmbientColor(newColor);\n facade.sendNotification(viewComponent.getUpdateEventName());\n }\n });\n\n picker.setColor(viewComponent.getAmbientColor());\n Sandbox.getInstance().getUIStage().addActor(picker.fadeIn());\n\n break;\n default:\n break;\n }\n }\n\n protected void translateObservableDataToView(SceneVO item) {\n PhysicsPropertiesVO physicsVO = item.physicsPropertiesVO;\n\n viewComponent.setPixelsPerWorldUnit(Sandbox.getInstance().getPixelPerWU());\n\n viewComponent.setGravityXValue(physicsVO.gravityX + \"\");\n viewComponent.setGravityYValue(physicsVO.gravityY + \"\");\n viewComponent.setPhysicsEnable(physicsVO.enabled);\n viewComponent.setSleepVelocityValue(physicsVO.sleepVelocity + \"\");\n viewComponent.setAmbientColor(new Color(item.ambientColor[0], item.ambientColor[1], item.ambientColor[2], item.ambientColor[3]));\n\n viewComponent.setLightsEnabled(item.lightSystemEnabled);\n viewComponent.setDiffuse(Sandbox.getInstance().sceneControl.isDiffuse());\n }\n\n @Override\n protected void translateViewToItemData() {\n PhysicsPropertiesVO physicsVO = observableReference.physicsPropertiesVO;\n physicsVO.gravityX = NumberUtils.toFloat(viewComponent.getGravityXValue(), physicsVO.gravityX);\n physicsVO.gravityY = NumberUtils.toFloat(viewComponent.getGravityYValue(), physicsVO.gravityY);\n physicsVO.sleepVelocity = NumberUtils.toFloat(viewComponent.getSleepVelocityValue(), physicsVO.sleepVelocity);\n physicsVO.enabled = viewComponent.isPhysicsEnabled();\n Color color = viewComponent.getAmbientColor();\n observableReference.ambientColor[0] = color.r;\n observableReference.ambientColor[1] = color.g;\n observableReference.ambientColor[2] = color.b;\n observableReference.ambientColor[3] = color.a;\n\n observableReference.lightSystemEnabled = viewComponent.isLightsEnabled();\n\n Sandbox.getInstance().setSceneAmbientColor(color, viewComponent.isLightsEnabled());\n\n Sandbox.getInstance().sceneControl.disableLights(!observableReference.lightSystemEnabled);\n Sandbox.getInstance().sceneControl.disableAmbience(!observableReference.lightSystemEnabled);\n\n Sandbox.getInstance().sceneControl.setDiffuse(viewComponent.isDiffuse());\n }\n}\n"} +{"text": "//Core code comes from https://github.com/davidshimjs/qrcodejs\n\nvar QRCode;\n\n(function () {\n /**\n * Get the type by string length\n * \n * @private\n * @param {String} sText\n * @param {Number} nCorrectLevel\n * @return {Number} type\n */\n function _getTypeNumber(sText, nCorrectLevel) {\n var nType = 1;\n var length = _getUTF8Length(sText);\n\n for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) {\n var nLimit = 0;\n\n switch (nCorrectLevel) {\n case QRErrorCorrectLevel.L:\n nLimit = QRCodeLimitLength[i][0];\n break;\n case QRErrorCorrectLevel.M:\n nLimit = QRCodeLimitLength[i][1];\n break;\n case QRErrorCorrectLevel.Q:\n nLimit = QRCodeLimitLength[i][2];\n break;\n case QRErrorCorrectLevel.H:\n nLimit = QRCodeLimitLength[i][3];\n break;\n }\n\n if (length <= nLimit) {\n break;\n } else {\n nType++;\n }\n }\n\n if (nType > QRCodeLimitLength.length) {\n throw new Error(\"Too long data\");\n }\n\n return nType;\n }\n\n function _getUTF8Length(sText) {\n var replacedText = encodeURI(sText).toString().replace(/\\%[0-9a-fA-F]{2}/g, 'a');\n return replacedText.length + (replacedText.length != sText ? 3 : 0);\n }\n\n function QR8bitByte(data) {\n this.mode = QRMode.MODE_8BIT_BYTE;\n this.data = data;\n this.parsedData = [];\n\n // Added to support UTF-8 Characters\n for (var i = 0, l = this.data.length; i < l; i++) {\n var byteArray = [];\n var code = this.data.charCodeAt(i);\n\n if (code > 0x10000) {\n byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18);\n byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12);\n byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6);\n byteArray[3] = 0x80 | (code & 0x3F);\n } else if (code > 0x800) {\n byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12);\n byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6);\n byteArray[2] = 0x80 | (code & 0x3F);\n } else if (code > 0x80) {\n byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6);\n byteArray[1] = 0x80 | (code & 0x3F);\n } else {\n byteArray[0] = code;\n }\n\n this.parsedData.push(byteArray);\n }\n\n this.parsedData = Array.prototype.concat.apply([], this.parsedData);\n\n if (this.parsedData.length != this.data.length) {\n this.parsedData.unshift(191);\n this.parsedData.unshift(187);\n this.parsedData.unshift(239);\n }\n }\n\n QR8bitByte.prototype = {\n getLength: function (buffer) {\n return this.parsedData.length;\n },\n write: function (buffer) {\n for (var i = 0, l = this.parsedData.length; i < l; i++) {\n buffer.put(this.parsedData[i], 8);\n }\n }\n };\n\n\n // QRCodeModel\n function QRCodeModel(typeNumber, errorCorrectLevel) {\n this.typeNumber = typeNumber;\n this.errorCorrectLevel = errorCorrectLevel;\n this.modules = null;\n this.moduleCount = 0;\n this.dataCache = null;\n this.dataList = [];\n }\n QRCodeModel.prototype = {\n addData: function (data) { var newData = new QR8bitByte(data); this.dataList.push(newData); this.dataCache = null; }, isDark: function (row, col) {\n if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) { throw new Error(row + \",\" + col); }\n return this.modules[row][col];\n }, getModuleCount: function () { return this.moduleCount; }, make: function () { this.makeImpl(false, this.getBestMaskPattern()); }, makeImpl: function (test, maskPattern) {\n this.moduleCount = this.typeNumber * 4 + 17; this.modules = new Array(this.moduleCount); for (var row = 0; row < this.moduleCount; row++) { this.modules[row] = new Array(this.moduleCount); for (var col = 0; col < this.moduleCount; col++) { this.modules[row][col] = null; } }\n this.setupPositionProbePattern(0, 0); this.setupPositionProbePattern(this.moduleCount - 7, 0); this.setupPositionProbePattern(0, this.moduleCount - 7); this.setupPositionAdjustPattern(); this.setupTimingPattern(); this.setupTypeInfo(test, maskPattern); if (this.typeNumber >= 7) { this.setupTypeNumber(test); }\n if (this.dataCache == null) { this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList); }\n this.mapData(this.dataCache, maskPattern);\n }, setupPositionProbePattern: function (row, col) { for (var r = -1; r <= 7; r++) { if (row + r <= -1 || this.moduleCount <= row + r) continue; for (var c = -1; c <= 7; c++) { if (col + c <= -1 || this.moduleCount <= col + c) continue; if ((0 <= r && r <= 6 && (c == 0 || c == 6)) || (0 <= c && c <= 6 && (r == 0 || r == 6)) || (2 <= r && r <= 4 && 2 <= c && c <= 4)) { this.modules[row + r][col + c] = true; } else { this.modules[row + r][col + c] = false; } } } }, getBestMaskPattern: function () {\n var minLostPoint = 0; var pattern = 0; for (var i = 0; i < 8; i++) { this.makeImpl(true, i); var lostPoint = QRUtil.getLostPoint(this); if (i == 0 || minLostPoint > lostPoint) { minLostPoint = lostPoint; pattern = i; } }\n return pattern;\n }, createMovieClip: function (target_mc, instance_name, depth) {\n var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth); var cs = 1; this.make(); for (var row = 0; row < this.modules.length; row++) { var y = row * cs; for (var col = 0; col < this.modules[row].length; col++) { var x = col * cs; var dark = this.modules[row][col]; if (dark) { qr_mc.beginFill(0, 100); qr_mc.moveTo(x, y); qr_mc.lineTo(x + cs, y); qr_mc.lineTo(x + cs, y + cs); qr_mc.lineTo(x, y + cs); qr_mc.endFill(); } } }\n return qr_mc;\n }, setupTimingPattern: function () {\n for (var r = 8; r < this.moduleCount - 8; r++) {\n if (this.modules[r][6] != null) { continue; }\n this.modules[r][6] = (r % 2 == 0);\n }\n for (var c = 8; c < this.moduleCount - 8; c++) {\n if (this.modules[6][c] != null) { continue; }\n this.modules[6][c] = (c % 2 == 0);\n }\n }, setupPositionAdjustPattern: function () {\n var pos = QRUtil.getPatternPosition(this.typeNumber); for (var i = 0; i < pos.length; i++) {\n for (var j = 0; j < pos.length; j++) {\n var row = pos[i]; var col = pos[j]; if (this.modules[row][col] != null) { continue; }\n for (var r = -2; r <= 2; r++) { for (var c = -2; c <= 2; c++) { if (r == -2 || r == 2 || c == -2 || c == 2 || (r == 0 && c == 0)) { this.modules[row + r][col + c] = true; } else { this.modules[row + r][col + c] = false; } } }\n }\n }\n }, setupTypeNumber: function (test) {\n var bits = QRUtil.getBCHTypeNumber(this.typeNumber); for (var i = 0; i < 18; i++) { var mod = (!test && ((bits >> i) & 1) == 1); this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod; }\n for (var i = 0; i < 18; i++) { var mod = (!test && ((bits >> i) & 1) == 1); this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod; }\n }, setupTypeInfo: function (test, maskPattern) {\n var data = (this.errorCorrectLevel << 3) | maskPattern; var bits = QRUtil.getBCHTypeInfo(data); for (var i = 0; i < 15; i++) { var mod = (!test && ((bits >> i) & 1) == 1); if (i < 6) { this.modules[i][8] = mod; } else if (i < 8) { this.modules[i + 1][8] = mod; } else { this.modules[this.moduleCount - 15 + i][8] = mod; } }\n for (var i = 0; i < 15; i++) { var mod = (!test && ((bits >> i) & 1) == 1); if (i < 8) { this.modules[8][this.moduleCount - i - 1] = mod; } else if (i < 9) { this.modules[8][15 - i - 1 + 1] = mod; } else { this.modules[8][15 - i - 1] = mod; } }\n this.modules[this.moduleCount - 8][8] = (!test);\n }, mapData: function (data, maskPattern) {\n var inc = -1; var row = this.moduleCount - 1; var bitIndex = 7; var byteIndex = 0; for (var col = this.moduleCount - 1; col > 0; col -= 2) {\n if (col == 6) col--; while (true) {\n for (var c = 0; c < 2; c++) {\n if (this.modules[row][col - c] == null) {\n var dark = false; if (byteIndex < data.length) { dark = (((data[byteIndex] >>> bitIndex) & 1) == 1); }\n var mask = QRUtil.getMask(maskPattern, row, col - c); if (mask) { dark = !dark; }\n this.modules[row][col - c] = dark; bitIndex--; if (bitIndex == -1) { byteIndex++; bitIndex = 7; }\n }\n }\n row += inc; if (row < 0 || this.moduleCount <= row) { row -= inc; inc = -inc; break; }\n }\n }\n }\n };\n QRCodeModel.PAD0 = 0xEC;\n QRCodeModel.PAD1 = 0x11;\n QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {\n var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel); var buffer = new QRBitBuffer(); for (var i = 0; i < dataList.length; i++) { var data = dataList[i]; buffer.put(data.mode, 4); buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber)); data.write(buffer); }\n var totalDataCount = 0; for (var i = 0; i < rsBlocks.length; i++) { totalDataCount += rsBlocks[i].dataCount; }\n if (buffer.getLengthInBits() > totalDataCount * 8) {\n throw new Error(\"code length overflow. (\"\n + buffer.getLengthInBits()\n + \">\"\n + totalDataCount * 8\n + \")\");\n }\n if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) { buffer.put(0, 4); }\n while (buffer.getLengthInBits() % 8 != 0) { buffer.putBit(false); }\n while (true) {\n if (buffer.getLengthInBits() >= totalDataCount * 8) { break; }\n buffer.put(QRCodeModel.PAD0, 8); if (buffer.getLengthInBits() >= totalDataCount * 8) { break; }\n buffer.put(QRCodeModel.PAD1, 8);\n }\n return QRCodeModel.createBytes(buffer, rsBlocks);\n };\n QRCodeModel.createBytes = function (buffer, rsBlocks) {\n var offset = 0; var maxDcCount = 0; var maxEcCount = 0; var dcdata = new Array(rsBlocks.length); var ecdata = new Array(rsBlocks.length); for (var r = 0; r < rsBlocks.length; r++) {\n var dcCount = rsBlocks[r].dataCount; var ecCount = rsBlocks[r].totalCount - dcCount; maxDcCount = Math.max(maxDcCount, dcCount); maxEcCount = Math.max(maxEcCount, ecCount); dcdata[r] = new Array(dcCount); for (var i = 0; i < dcdata[r].length; i++) { dcdata[r][i] = 0xff & buffer.buffer[i + offset]; }\n offset += dcCount; var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount); var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1); var modPoly = rawPoly.mod(rsPoly); ecdata[r] = new Array(rsPoly.getLength() - 1); for (var i = 0; i < ecdata[r].length; i++) { var modIndex = i + modPoly.getLength() - ecdata[r].length; ecdata[r][i] = (modIndex >= 0) ? modPoly.get(modIndex) : 0; }\n }\n var totalCodeCount = 0; for (var i = 0; i < rsBlocks.length; i++) { totalCodeCount += rsBlocks[i].totalCount; }\n var data = new Array(totalCodeCount); var index = 0; for (var i = 0; i < maxDcCount; i++) { for (var r = 0; r < rsBlocks.length; r++) { if (i < dcdata[r].length) { data[index++] = dcdata[r][i]; } } }\n for (var i = 0; i < maxEcCount; i++) { for (var r = 0; r < rsBlocks.length; r++) { if (i < ecdata[r].length) { data[index++] = ecdata[r][i]; } } }\n return data;\n };\n var QRMode = { MODE_NUMBER: 1 << 0, MODE_ALPHA_NUM: 1 << 1, MODE_8BIT_BYTE: 1 << 2, MODE_KANJI: 1 << 3 };\n var QRErrorCorrectLevel = { L: 1, M: 0, Q: 3, H: 2 };\n var QRMaskPattern = { PATTERN000: 0, PATTERN001: 1, PATTERN010: 2, PATTERN011: 3, PATTERN100: 4, PATTERN101: 5, PATTERN110: 6, PATTERN111: 7 };\n var QRUtil = {\n PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]], G15: (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0), G18: (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0), G15_MASK: (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1), getBCHTypeInfo: function (data) {\n var d = data << 10; while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) { d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15))); }\n return ((data << 10) | d) ^ QRUtil.G15_MASK;\n }, getBCHTypeNumber: function (data) {\n var d = data << 12; while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) { d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18))); }\n return (data << 12) | d;\n }, getBCHDigit: function (data) {\n var digit = 0; while (data != 0) { digit++; data >>>= 1; }\n return digit;\n }, getPatternPosition: function (typeNumber) { return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1]; }, getMask: function (maskPattern, i, j) { switch (maskPattern) { case QRMaskPattern.PATTERN000: return (i + j) % 2 == 0; case QRMaskPattern.PATTERN001: return i % 2 == 0; case QRMaskPattern.PATTERN010: return j % 3 == 0; case QRMaskPattern.PATTERN011: return (i + j) % 3 == 0; case QRMaskPattern.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0; case QRMaskPattern.PATTERN101: return (i * j) % 2 + (i * j) % 3 == 0; case QRMaskPattern.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 == 0; case QRMaskPattern.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 == 0; default: throw new Error(\"bad maskPattern:\" + maskPattern); } }, getErrorCorrectPolynomial: function (errorCorrectLength) {\n var a = new QRPolynomial([1], 0); for (var i = 0; i < errorCorrectLength; i++) { a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0)); }\n return a;\n }, getLengthInBits: function (mode, type) { if (1 <= type && type < 10) { switch (mode) { case QRMode.MODE_NUMBER: return 10; case QRMode.MODE_ALPHA_NUM: return 9; case QRMode.MODE_8BIT_BYTE: return 8; case QRMode.MODE_KANJI: return 8; default: throw new Error(\"mode:\" + mode); } } else if (type < 27) { switch (mode) { case QRMode.MODE_NUMBER: return 12; case QRMode.MODE_ALPHA_NUM: return 11; case QRMode.MODE_8BIT_BYTE: return 16; case QRMode.MODE_KANJI: return 10; default: throw new Error(\"mode:\" + mode); } } else if (type < 41) { switch (mode) { case QRMode.MODE_NUMBER: return 14; case QRMode.MODE_ALPHA_NUM: return 13; case QRMode.MODE_8BIT_BYTE: return 16; case QRMode.MODE_KANJI: return 12; default: throw new Error(\"mode:\" + mode); } } else { throw new Error(\"type:\" + type); } }, getLostPoint: function (qrCode) {\n var moduleCount = qrCode.getModuleCount(); var lostPoint = 0; for (var row = 0; row < moduleCount; row++) {\n for (var col = 0; col < moduleCount; col++) {\n var sameCount = 0; var dark = qrCode.isDark(row, col); for (var r = -1; r <= 1; r++) {\n if (row + r < 0 || moduleCount <= row + r) { continue; }\n for (var c = -1; c <= 1; c++) {\n if (col + c < 0 || moduleCount <= col + c) { continue; }\n if (r == 0 && c == 0) { continue; }\n if (dark == qrCode.isDark(row + r, col + c)) { sameCount++; }\n }\n }\n if (sameCount > 5) { lostPoint += (3 + sameCount - 5); }\n }\n }\n for (var row = 0; row < moduleCount - 1; row++) { for (var col = 0; col < moduleCount - 1; col++) { var count = 0; if (qrCode.isDark(row, col)) count++; if (qrCode.isDark(row + 1, col)) count++; if (qrCode.isDark(row, col + 1)) count++; if (qrCode.isDark(row + 1, col + 1)) count++; if (count == 0 || count == 4) { lostPoint += 3; } } }\n for (var row = 0; row < moduleCount; row++) { for (var col = 0; col < moduleCount - 6; col++) { if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) && qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col + 5) && qrCode.isDark(row, col + 6)) { lostPoint += 40; } } }\n for (var col = 0; col < moduleCount; col++) { for (var row = 0; row < moduleCount - 6; row++) { if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) && qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5, col) && qrCode.isDark(row + 6, col)) { lostPoint += 40; } } }\n var darkCount = 0; for (var col = 0; col < moduleCount; col++) { for (var row = 0; row < moduleCount; row++) { if (qrCode.isDark(row, col)) { darkCount++; } } }\n var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5; lostPoint += ratio * 10; return lostPoint;\n }\n };\n var QRMath = {\n glog: function (n) {\n if (n < 1) { throw new Error(\"glog(\" + n + \")\"); }\n return QRMath.LOG_TABLE[n];\n }, gexp: function (n) {\n while (n < 0) { n += 255; }\n while (n >= 256) { n -= 255; }\n return QRMath.EXP_TABLE[n];\n }, EXP_TABLE: new Array(256), LOG_TABLE: new Array(256)\n }; for (var i = 0; i < 8; i++) { QRMath.EXP_TABLE[i] = 1 << i; }\n for (var i = 8; i < 256; i++) { QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8]; }\n for (var i = 0; i < 255; i++) { QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i; }\n function QRPolynomial(num, shift) {\n if (num.length == undefined) { throw new Error(num.length + \"/\" + shift); }\n var offset = 0; while (offset < num.length && num[offset] == 0) { offset++; }\n this.num = new Array(num.length - offset + shift); for (var i = 0; i < num.length - offset; i++) { this.num[i] = num[i + offset]; }\n }\n QRPolynomial.prototype = {\n get: function (index) { return this.num[index]; }, getLength: function () { return this.num.length; }, multiply: function (e) {\n var num = new Array(this.getLength() + e.getLength() - 1); for (var i = 0; i < this.getLength(); i++) { for (var j = 0; j < e.getLength(); j++) { num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j))); } }\n return new QRPolynomial(num, 0);\n }, mod: function (e) {\n if (this.getLength() - e.getLength() < 0) { return this; }\n var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)); var num = new Array(this.getLength()); for (var i = 0; i < this.getLength(); i++) { num[i] = this.get(i); }\n for (var i = 0; i < e.getLength(); i++) { num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio); }\n return new QRPolynomial(num, 0).mod(e);\n }\n };\n function QRRSBlock(totalCount, dataCount) { this.totalCount = totalCount; this.dataCount = dataCount; }\n QRRSBlock.RS_BLOCK_TABLE = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]];\n QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {\n var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel); if (rsBlock == undefined) { throw new Error(\"bad rs block @ typeNumber:\" + typeNumber + \"/errorCorrectLevel:\" + errorCorrectLevel); }\n var length = rsBlock.length / 3; var list = []; for (var i = 0; i < length; i++) { var count = rsBlock[i * 3 + 0]; var totalCount = rsBlock[i * 3 + 1]; var dataCount = rsBlock[i * 3 + 2]; for (var j = 0; j < count; j++) { list.push(new QRRSBlock(totalCount, dataCount)); } }\n return list;\n };\n QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) { switch (errorCorrectLevel) { case QRErrorCorrectLevel.L: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; case QRErrorCorrectLevel.M: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; case QRErrorCorrectLevel.Q: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; case QRErrorCorrectLevel.H: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; default: return undefined; } };\n function QRBitBuffer() { this.buffer = []; this.length = 0; }\n QRBitBuffer.prototype = {\n get: function (index) { var bufIndex = Math.floor(index / 8); return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) == 1; }, put: function (num, length) { for (var i = 0; i < length; i++) { this.putBit(((num >>> (length - i - 1)) & 1) == 1); } }, getLengthInBits: function () { return this.length; }, putBit: function (bit) {\n var bufIndex = Math.floor(this.length / 8); if (this.buffer.length <= bufIndex) { this.buffer.push(0); }\n if (bit) { this.buffer[bufIndex] |= (0x80 >>> (this.length % 8)); }\n this.length++;\n }\n };\n var QRCodeLimitLength = [[17, 14, 11, 7], [32, 26, 20, 14], [53, 42, 32, 24], [78, 62, 46, 34], [106, 84, 60, 44], [134, 106, 74, 58], [154, 122, 86, 64], [192, 152, 108, 84], [230, 180, 130, 98], [271, 213, 151, 119], [321, 251, 177, 137], [367, 287, 203, 155], [425, 331, 241, 177], [458, 362, 258, 194], [520, 412, 292, 220], [586, 450, 322, 250], [644, 504, 364, 280], [718, 560, 394, 310], [792, 624, 442, 338], [858, 666, 482, 382], [929, 711, 509, 403], [1003, 779, 565, 439], [1091, 857, 611, 461], [1171, 911, 661, 511], [1273, 997, 715, 535], [1367, 1059, 751, 593], [1465, 1125, 805, 625], [1528, 1190, 868, 658], [1628, 1264, 908, 698], [1732, 1370, 982, 742], [1840, 1452, 1030, 790], [1952, 1538, 1112, 842], [2068, 1628, 1168, 898], [2188, 1722, 1228, 958], [2303, 1809, 1283, 983], [2431, 1911, 1351, 1051], [2563, 1989, 1423, 1093], [2699, 2099, 1499, 1139], [2809, 2213, 1579, 1219], [2953, 2331, 1663, 1273]];\n\n // QRCode object\n QRCode = function (canvasId, vOption) {\n this._htOption = {\n width: 256,\n height: 256,\n typeNumber: 4,\n colorDark: \"#000000\",\n colorLight: \"#ffffff\",\n correctLevel: QRErrorCorrectLevel.H\n };\n\n if (typeof vOption === 'string') {\n vOption = {\n text: vOption\n };\n }\n\n // Overwrites options\n if (vOption) {\n for (var i in vOption) {\n this._htOption[i] = vOption[i];\n }\n }\n\n this._oQRCode = null;\n this.canvasId = canvasId\n\n if (this._htOption.text && this.canvasId) {\n this.makeCode(this._htOption.text);\n }\n };\n\n QRCode.prototype.makeCode = function (sText, callback) {\n this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel);\n this._oQRCode.addData(sText);\n this._oQRCode.make();\n this.makeImage(callback);\n };\n\n QRCode.prototype.makeImage = function (callback) {\n var _oContext\n if (this._htOption.usingIn) {\n _oContext = wx.createCanvasContext(this.canvasId, this._htOption.usingIn)\n }\n else {\n _oContext = wx.createCanvasContext(this.canvasId)\n }\n var _htOption = this._htOption;\n var oQRCode = this._oQRCode\n\n var nCount = oQRCode.getModuleCount();\n var nWidth = _htOption.width / nCount;\n var nHeight = _htOption.height / nCount;\n var nRoundedWidth = Math.round(nWidth);\n var nRoundedHeight = Math.round(nHeight);\n\n if (_htOption.image && _htOption.image != '') {\n _oContext.drawImage(_htOption.image, 0, 0, _htOption.width, _htOption.height)\n }\n\n for (var row = 0; row < nCount; row++) {\n for (var col = 0; col < nCount; col++) {\n var bIsDark = oQRCode.isDark(row, col);\n var nLeft = col * nWidth;\n var nTop = row * nHeight;\n _oContext.setStrokeStyle(bIsDark ? _htOption.colorDark : _htOption.colorLight)\n // _oContext.setStrokeStyle('yellow')\n _oContext.setLineWidth(1)\n _oContext.setFillStyle(bIsDark ? _htOption.colorDark : _htOption.colorLight)\n // _oContext.setFillStyle('red')\n // if (bIsDark) {\n _oContext.fillRect(nLeft, nTop, nWidth, nHeight);\n // }\n\n // 안티 앨리어싱 방지 처리\n // if (bIsDark) {\n _oContext.strokeRect(\n Math.floor(nLeft) + 0.5,\n Math.floor(nTop) + 0.5,\n nRoundedWidth,\n nRoundedHeight\n );\n\n _oContext.strokeRect(\n Math.ceil(nLeft) - 0.5,\n Math.ceil(nTop) - 0.5,\n nRoundedWidth,\n nRoundedHeight\n );\n // }\n // _oContext.fillRect(\n // Math.floor(nLeft) + 0.5,\n // Math.floor(nTop) + 0.5,\n // nRoundedWidth,\n // nRoundedHeight\n // );\n // _oContext.fillRect(\n // Math.ceil(nLeft) - 0.5,\n // Math.ceil(nTop) - 0.5,\n // nRoundedWidth,\n // nRoundedHeight\n // );\n // _oContext.clearRect(\n // Math.floor(nLeft) + 0.5,\n // Math.floor(nTop) + 0.5,\n // nRoundedWidth,\n // nRoundedHeight\n // );\n // _oContext.clearRect(\n // Math.ceil(nLeft) - 0.5,\n // Math.ceil(nTop) - 0.5,\n // nRoundedWidth,\n // nRoundedHeight\n // );\n }\n }\n\n _oContext.draw(false, callback)\n };\n\n // 保存为图片,将临时路径传给回调\n QRCode.prototype.exportImage = function (callback) {\n if (!callback) {\n return\n }\n wx.canvasToTempFilePath({\n x: 0,\n y: 0,\n width: this._htOption.width,\n height: this._htOption.height,\n destWidth: this._htOption.width,\n destHeight: this._htOption.height,\n canvasId: this.canvasId,\n success: function (res) {\n callback(res.tempFilePath)\n },\n fail:res=>{\n console.log(res)\n }\n })\n }\n\n QRCode.CorrectLevel = QRErrorCorrectLevel;\n})();\n\nmodule.exports = QRCode"} +{"text": "// Copyright 2016 The Bazel Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\npackage com.google.devtools.build.android.desugar;\n\nimport static com.google.common.truth.Truth.assertThat;\nimport static com.google.common.truth.Truth.assertWithMessage;\nimport static java.lang.reflect.Modifier.isFinal;\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static org.junit.Assert.assertThrows;\nimport static org.junit.Assert.fail;\n\nimport com.google.common.collect.ImmutableList;\nimport com.google.common.io.ByteStreams;\nimport com.google.devtools.build.android.desugar.testdata.CaptureLambda;\nimport com.google.devtools.build.android.desugar.testdata.ConcreteFunction;\nimport com.google.devtools.build.android.desugar.testdata.ConstructorReference;\nimport com.google.devtools.build.android.desugar.testdata.GuavaLambda;\nimport com.google.devtools.build.android.desugar.testdata.InnerClassLambda;\nimport com.google.devtools.build.android.desugar.testdata.InterfaceWithLambda;\nimport com.google.devtools.build.android.desugar.testdata.Lambda;\nimport com.google.devtools.build.android.desugar.testdata.LambdaInOverride;\nimport com.google.devtools.build.android.desugar.testdata.MethodReference;\nimport com.google.devtools.build.android.desugar.testdata.MethodReferenceInSubclass;\nimport com.google.devtools.build.android.desugar.testdata.MethodReferenceSuperclass;\nimport com.google.devtools.build.android.desugar.testdata.OuterReferenceLambda;\nimport com.google.devtools.build.android.desugar.testdata.SpecializedFunction;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.lang.reflect.InvocationTargetException;\nimport java.lang.reflect.Method;\nimport java.util.concurrent.Callable;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.junit.runners.JUnit4;\n\n/**\n * Test that exercises classes in the {@code testdata} package. This is meant to be run against a\n * desugared version of those classes, which in turn exercise various desugaring features.\n */\n@RunWith(JUnit4.class)\npublic class DesugarFunctionalTest {\n\n private final int expectedBridgesFromSameTarget;\n private final int expectedBridgesFromSeparateTarget;\n private final boolean expectLambdaMethodsInInterfaces;\n\n public DesugarFunctionalTest() {\n this(3, 1, false);\n }\n\n /** Constructor for testing desugar while allowing default and static interface methods. */\n protected DesugarFunctionalTest(\n boolean expectBridgesFromSeparateTarget, boolean expectDefaultMethods) {\n this(\n expectDefaultMethods ? 0 : 3,\n expectBridgesFromSeparateTarget ? 1 : 0,\n expectDefaultMethods);\n }\n\n private DesugarFunctionalTest(\n int bridgesFromSameTarget, int bridgesFromSeparateTarget, boolean lambdaMethodsInInterfaces) {\n this.expectedBridgesFromSameTarget = bridgesFromSameTarget;\n this.expectedBridgesFromSeparateTarget = bridgesFromSeparateTarget;\n this.expectLambdaMethodsInInterfaces = lambdaMethodsInInterfaces;\n }\n\n @Test\n public void testGuavaLambda() {\n GuavaLambda lambdaUse = new GuavaLambda(ImmutableList.of(\"Sergey\", \"Larry\", \"Alex\"));\n assertThat(lambdaUse.as()).containsExactly(\"Alex\");\n }\n\n @Test\n public void testJavaLambda() {\n Lambda lambdaUse = new Lambda(ImmutableList.of(\"Sergey\", \"Larry\", \"Alex\"));\n assertThat(lambdaUse.as()).containsExactly(\"Alex\");\n }\n\n @Test\n public void testLambdaForIntersectionType() throws Exception {\n assertThat(Lambda.hello().call()).isEqualTo(\"hello\");\n }\n\n @Test\n public void testCapturingLambda() {\n CaptureLambda lambdaUse = new CaptureLambda(ImmutableList.of(\"Sergey\", \"Larry\", \"Alex\"));\n assertThat(lambdaUse.prefixed(\"L\")).containsExactly(\"Larry\");\n }\n\n @Test\n public void testOuterReferenceLambda() throws Exception {\n OuterReferenceLambda lambdaUse = new OuterReferenceLambda(ImmutableList.of(\"Sergey\", \"Larry\"));\n assertThat(lambdaUse.filter(ImmutableList.of(\"Larry\", \"Alex\"))).containsExactly(\"Larry\");\n assertThat(\n isFinal(\n OuterReferenceLambda.class\n .getDeclaredMethod(\"lambda$filter$0$OuterReferenceLambda\", String.class)\n .getModifiers()))\n .isTrue();\n }\n\n /**\n * Tests a lambda in a subclass whose generated lambda$ method has the same name and signature as\n * a lambda$ method generated by Javac in a superclass and both of these methods are used in the\n * implementation of the subclass (by calling super). Naively this leads to wrong behavior (in\n * this case, return a non-empty list) because the lambda$ in the superclass is never used once\n * its made non-private during desugaring.\n */\n @Test\n public void testOuterReferenceLambdaInOverride() throws Exception {\n OuterReferenceLambda lambdaUse = new LambdaInOverride(ImmutableList.of(\"Sergey\", \"Larry\"));\n assertThat(lambdaUse.filter(ImmutableList.of(\"Larry\", \"Alex\"))).isEmpty();\n assertThat(\n isFinal(\n LambdaInOverride.class\n .getDeclaredMethod(\"lambda$filter$0$LambdaInOverride\", String.class)\n .getModifiers()))\n .isTrue();\n }\n\n @Test\n public void testLambdaInAnonymousClassReferencesSurroundingMethodParameter() throws Exception {\n assertThat(Lambda.mult(21).apply(2).call()).isEqualTo(42);\n }\n\n /** Tests a lambda that accesses a method parameter across 2 nested anonymous classes. */\n @Test\n public void testLambdaInNestedAnonymousClass() throws Exception {\n InnerClassLambda lambdaUse = new InnerClassLambda(ImmutableList.of(\"Sergey\", \"Larry\"));\n assertThat(lambdaUse.prefixFilter(\"L\").apply(ImmutableList.of(\"Lois\", \"Larry\")).call())\n .containsExactly(\"Larry\");\n }\n\n @Test\n public void testClassMethodReference() {\n MethodReference methodrefUse = new MethodReference(ImmutableList.of(\"Sergey\", \"Larry\", \"Alex\"));\n StringBuilder dest = new StringBuilder();\n methodrefUse.appendAll(dest);\n assertThat(dest.toString()).isEqualTo(\"SergeyLarryAlex\");\n }\n\n // Regression test for b/33378312\n @Test\n public void testHiddenMethodReference() {\n MethodReference methodrefUse = new MethodReference(ImmutableList.of(\"Sergey\", \"Larry\", \"Alex\"));\n assertThat(methodrefUse.intersect(ImmutableList.of(\"Alex\", \"Sundar\"))).containsExactly(\"Alex\");\n }\n\n // Regression test for b/33378312\n @Test\n public void testHiddenStaticMethodReference() {\n MethodReference methodrefUse =\n new MethodReference(ImmutableList.of(\"Sergey\", \"Larry\", \"Sundar\"));\n assertThat(methodrefUse.some()).containsExactly(\"Sergey\", \"Sundar\");\n }\n\n @Test\n public void testDuplicateHiddenMethodReference() {\n MethodReference methodrefUse = new MethodReference(ImmutableList.of(\"Sergey\", \"Larry\", \"Alex\"));\n assertThat(methodrefUse.onlyIn(ImmutableList.of(\"Alex\", \"Sundar\"))).containsExactly(\"Sundar\");\n }\n\n // Regression test for b/36201257\n @Test\n public void testMethodReferenceThatNeedsBridgeInSubclass() {\n MethodReferenceInSubclass methodrefUse =\n new MethodReferenceInSubclass(ImmutableList.of(\"Sergey\", \"Larry\", \"Alex\"));\n assertThat(methodrefUse.containsE()).containsExactly(\"Sergey\", \"Alex\");\n assertThat(methodrefUse.startsWithL()).containsExactly(\"Larry\");\n // Test sanity: make sure sub- and superclass have bridge methods with matching descriptors but\n // different names\n Method superclassBridge = findOnlyBridge(MethodReferenceSuperclass.class);\n Method subclassBridge = findOnlyBridge(MethodReferenceInSubclass.class);\n assertThat(superclassBridge.getName()).isNotEqualTo(subclassBridge.getName());\n assertThat(superclassBridge.getParameterTypes()).isEqualTo(subclassBridge.getParameterTypes());\n }\n\n private Method findOnlyBridge(Class clazz) {\n Method result = null;\n for (Method m : clazz.getDeclaredMethods()) {\n if (m.getName().startsWith(\"bridge$\")) {\n assertWithMessage(m.getName()).that(result).isNull();\n result = m;\n }\n }\n assertWithMessage(clazz.getSimpleName()).that(result).isNotNull();\n return result;\n }\n\n // Regression test for b/33378312\n @Test\n public void testThrowingPrivateMethodReference() throws Exception {\n MethodReference methodrefUse = new MethodReference(ImmutableList.of(\"Sergey\", \"Larry\"));\n Callable stringer = methodrefUse.stringer();\n try {\n stringer.call();\n fail(\"IOException expected\");\n } catch (IOException expected) {\n assertThat(expected).hasMessageThat().isEqualTo(\"SergeyLarry\");\n } catch (Exception e) {\n throw e;\n }\n }\n\n // Regression test for b/33304582\n @Test\n public void testInterfaceMethodReference() {\n MethodReference methodrefUse = new MethodReference(ImmutableList.of(\"Sergey\", \"Larry\", \"Alex\"));\n MethodReference.Transformer transform =\n new MethodReference.Transformer() {\n @Override\n public String transform(String input) {\n return input.substring(1);\n }\n };\n assertThat(methodrefUse.transform(transform)).containsExactly(\"ergey\", \"arry\", \"lex\");\n }\n\n @Test\n public void testConstructorReference() {\n ConstructorReference initRefUse = new ConstructorReference(ImmutableList.of(\"1\", \"2\", \"42\"));\n assertThat(initRefUse.toInt()).containsExactly(1, 2, 42);\n }\n\n // Regression test for b/33304582\n @Test\n public void testPrivateConstructorReference() {\n ConstructorReference initRefUse = ConstructorReference.singleton().apply(\"17\");\n assertThat(initRefUse.toInt()).containsExactly(17);\n }\n\n // This test is similar to testPrivateConstructorReference but the private constructor of an inner\n // class is used as a method reference. That causes Javac to generate a bridge constructor and\n // a lambda body method that calls it, so the desugaring step doesn't need to do anything to make\n // the private constructor visible. This is mostly to double-check that we don't interfere with\n // this \"already-working\" scenario.\n @Test\n public void testPrivateConstructorAccessedThroughJavacGeneratedBridge() {\n @SuppressWarnings(\"ReturnValueIgnored\")\n RuntimeException expected =\n assertThrows(\n RuntimeException.class,\n () -> ConstructorReference.emptyThroughJavacGeneratedBridge().get());\n assertThat(expected).hasMessageThat().isEqualTo(\"got it!\");\n }\n\n @Test\n public void testExpressionMethodReference() {\n assertThat(\n MethodReference.stringChars(new StringBuilder().append(\"Larry\").append(\"Sergey\"))\n .apply(5))\n .isEqualTo('S');\n }\n\n @Test\n public void testFieldMethodReference() {\n MethodReference methodrefUse = new MethodReference(ImmutableList.of(\"Sergey\", \"Larry\", \"Alex\"));\n assertThat(methodrefUse.toPredicate().test(\"Larry\")).isTrue();\n assertThat(methodrefUse.toPredicate().test(\"Sundar\")).isFalse();\n }\n\n @Test\n public void testConcreteFunctionWithInheritedBridgeMethods() {\n assertThat(new ConcreteFunction().apply(\"1234567890987654321\")).isEqualTo(1234567890987654321L);\n assertThat(ConcreteFunction.parseAll(ImmutableList.of(\"5\", \"17\"), new ConcreteFunction()))\n .containsExactly(5L, 17L);\n }\n\n @Test\n public void testLambdaWithInheritedBridgeMethods() throws Exception {\n assertThat(ConcreteFunction.toInt().apply(\"123456789\")).isEqualTo(123456789);\n assertThat(ConcreteFunction.parseAll(ImmutableList.of(\"5\", \"17\"), ConcreteFunction.toInt()))\n .containsExactly(5, 17);\n // Expect String apply(Number) and any expected bridges\n assertThat(ConcreteFunction.toInt().getClass().getDeclaredMethods())\n .hasLength(expectedBridgesFromSameTarget + 1);\n // Sanity check that we only copied over methods, no fields, from the functional interface\n assertThrows(\n NoSuchFieldException.class,\n () ->\n ConcreteFunction.toInt()\n .getClass()\n .getDeclaredField(\"DO_NOT_COPY_INTO_LAMBDA_CLASSES\"));\n assertThat(SpecializedFunction.class.getDeclaredField(\"DO_NOT_COPY_INTO_LAMBDA_CLASSES\"))\n .isNotNull(); // test sanity\n }\n\n /** Tests lambdas with bridge methods when the implemented interface is in a separate target. */\n @Test\n public void testLambdaWithBridgeMethodsForInterfaceInSeparateTarget() {\n assertThat(ConcreteFunction.isInt().test(123456789L)).isTrue();\n assertThat(\n ConcreteFunction.doFilter(\n ImmutableList.of(123456789L, 1234567890987654321L), ConcreteFunction.isInt()))\n .containsExactly(123456789L);\n // Expect test(Number) and any expected bridges\n assertThat(ConcreteFunction.isInt().getClass().getDeclaredMethods())\n .hasLength(expectedBridgesFromSeparateTarget + 1);\n }\n\n @Test\n public void testLambdaInInterfaceStaticInitializer() {\n assertThat(InterfaceWithLambda.DIGITS).containsExactly(\"0\", \"1\").inOrder();\n // doesn't count but if there's a lambda method then Jacoco adds more methods\n assertThat(InterfaceWithLambda.class.getDeclaredMethods().length != 0)\n .isEqualTo(expectLambdaMethodsInInterfaces);\n }\n\n /** Sanity-checks that the resource file included in the original Jar is still there unchanged. */\n @Test\n public void testResourcePreserved() throws Exception {\n try (InputStream content = Lambda.class.getResource(\"testresource.txt\").openStream()) {\n assertThat(new String(ByteStreams.toByteArray(content), UTF_8)).isEqualTo(\"test\");\n }\n }\n\n /**\n * Test for b/62456849. After desugar, the method {@code lambda$mult$0} should still be in the\n * class.\n */\n @Test\n public void testCallMethodWithLambdaNamingConvention()\n throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {\n Method method = Lambda.class.getDeclaredMethod(\"lambda$mult$0\");\n Object value = method.invoke(null);\n assertThat(value).isInstanceOf(Integer.class);\n assertThat((Integer) value).isEqualTo(0);\n }\n}\n"} +{"text": "chr1 1 100\nchr2 2 200\n"} +{"text": "/** \\file cmr_t2_mapping.h\n \\brief Implement cardiac MR t2 mapping for 2D applications\n The input has dimension [RO E1 N S SLC]\n Temporal dimension is N\n \\author Hui Xue\n*/\n\n#pragma once\n\n#include \"cmr_parametric_mapping.h\"\n\nnamespace Gadgetron { \n\n// ======================================================================================\n// T2 decay\n// y = A * exp(-te/T2)\n\ntemplate \nclass EXPORTCMR CmrT2Mapping : public CmrParametricMapping\n{\npublic:\n\n typedef CmrParametricMapping BaseClass;\n typedef CmrT2Mapping Self;\n\n typedef typename BaseClass::ArrayType ArrayType;\n typedef typename BaseClass::ImageType ImageType;\n typedef typename BaseClass::ImageContinerType ImageContinerType;\n typedef typename BaseClass::VectorType VectorType;\n\n CmrT2Mapping();\n virtual ~CmrT2Mapping();\n\n // ======================================================================================\n /// parameter for t2 mapping\n // ======================================================================================\n\n\n // ======================================================================================\n // perform every steps\n // ======================================================================================\n\n /// provide initial guess for the mapping\n virtual void get_initial_guess(const VectorType& ti, const VectorType& yi, VectorType& guess);\n\n /// compute map values for every parameters in bi\n virtual void compute_map(const VectorType& ti, const VectorType& yi, const VectorType& guess, VectorType& bi, T& map_v);\n\n /// compute SD values for every parameters in bi\n virtual void compute_sd(const VectorType& ti, const VectorType& yi, const VectorType& bi, VectorType& sd, T& map_sd);\n\n /// two parameters, A, T1\n virtual size_t get_num_of_paras() const;\n\n // ======================================================================================\n /// parameter from BaseClass\n // ======================================================================================\n\n using BaseClass::fill_holes_in_maps_;\n using BaseClass::max_size_of_holes_;\n using BaseClass::hole_marking_value_;\n using BaseClass::compute_SD_maps_;\n using BaseClass::mask_for_mapping_;\n using BaseClass::ti_;\n using BaseClass::data_;\n using BaseClass::map_;\n using BaseClass::para_;\n using BaseClass::sd_map_;\n using BaseClass::sd_para_;\n using BaseClass::max_iter_;\n using BaseClass::max_fun_eval_;\n using BaseClass::thres_fun_;\n using BaseClass::max_map_value_;\n using BaseClass::min_map_value_;\n\n using BaseClass::verbose_;\n using BaseClass::debug_folder_;\n using BaseClass::perform_timing_;\n using BaseClass::gt_timer_local_;\n using BaseClass::gt_timer_;\n using BaseClass::gt_exporter_;\n};\n\n}\n"} +{"text": "# -*- coding: utf-8 -*-\n\n# Define your item pipelines here\n#\n# Don't forget to add your pipeline to the ITEM_PIPELINES setting\n# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html\nimport json\nimport pymongo\nfrom weiboZ import DateUtil\nimport pickle\nimport logging\nimport os\nimport datetime\n\n\nclass JsonPipeline(object):\n def open_spider(self, spider):\n self.file = open('items.json', 'w')\n\n def close_spider(self, spider):\n logging.warning('生成文件:items.json')\n self.file.close()\n\n def process_item(self, item, spider):\n try:\n line = json.dumps(dict(item), ensure_ascii=False, indent=2) + ',\\n'\n logging.warning(line)\n self.file.write(line)\n return item\n except Exception:\n logging.warning('写json出错')\n self.file.close()\n\n\nclass weiboMongoPipeline(object):\n def __init__(self, mongo_uri, mongo_db, mongo_col):\n self.mongo_uri = mongo_uri\n self.mongo_db = mongo_db\n self.mongo_col = mongo_col\n cwd = os.getcwd()\n with open(os.path.join(cwd, 'weiboZ/data.pl'), 'rb') as f:\n data = pickle.load(f)\n self.tAdmin = data['admin']\n self.tPrice = data['price']\n self.tTag = data['tag']\n self.recent = datetime.datetime(2006, 1, 1, 0, 0) # 最老数据\n\n @classmethod\n def from_crawler(cls, crawler):\n logging.warning('生成MongoPipeline对象')\n return cls(\n crawler.settings.get('MONGO_URI'),\n crawler.settings.get('MONGO_DATABASE')['db'],\n crawler.settings.get('MONGO_DATABASE')['col']\n )\n\n def open_spider(self, spider):\n logging.warning('开始spider')\n try:\n self.client = pymongo.MongoClient(self.mongo_uri)\n self.db = self.client[self.mongo_db]\n except ValueError:\n logging.error('数据库连接错误')\n # 表是否存在,若不存在建立对应的索引\n if self.mongo_col not in self.db.collection_names():\n self.db[self.mongo_col].create_index(\n [('created_at', pymongo.DESCENDING)])\n self.db[self.mongo_col].create_index(\n [('admin', pymongo.ASCENDING)], sparse=True)\n self.db[self.mongo_col].create_index(\n [('price', pymongo.ASCENDING)], sparse=True)\n self.db[self.mongo_col].create_index(\n [('mblogid', pymongo.ASCENDING)], unique=True)\n else:\n # 找到当前表中微博最新插入的数据,方便过滤\n recent_row = list(self.db[self.mongo_col].find({'title': {'$eq': None}}, projection=['created_at'],\n limit=1, sort=[('created_at', pymongo.DESCENDING)]))\n if recent_row:\n self.recent = recent_row[0]['created_at'] # 最新时间\n logging.warning(\"允许插入数据的时间大于%s\" % (\n self.recent + datetime.timedelta(hours=8)).__str__())\n\n def close_spider(self, spider):\n logging.warning('结束spider')\n self.client.close()\n\n def process_item(self, item, spider):\n #collection_name = item.__class__.__name__\n # logging.warning('开始插入表%s'%self.mongo_col)\n try:\n dt = DateUtil.convert(item[\"created_at\"]) # 时间格式化\n if dt <= self.recent: # 数据库中已经有或者太老,不再插入\n return item\n item[\"created_at\"] = dt\n admin, price, tag = self.extract(\n item['text'], self.tAdmin, self.tPrice, self.tTag)\n item[\"admin\"] = admin\n item[\"price\"] = price\n item[\"tag\"] = tag\n\n self.db[self.mongo_col].insert(dict(item))\n return item\n except Exception:\n logging.error('编号为:%s的数据插入异常' % item['mblogid'])\n # logging.error(item['text'])\n\n def extract(self, text, tAdmin, tPrice, tTag):\n i = 0\n location = set() # 存储行政区\n price = set() # 存储价格\n rent = True # 默认为出租信息\n while i < len(text):\n if tPrice.has_keys_with_prefix(text[i]): # 优先匹配价格\n j = i\n i += 1\n # 正向最大匹配\n while i < len(text) and tPrice.has_keys_with_prefix(text[j:i + 1]):\n i += 1\n if text[j:i] in tPrice.keys(text[j:i]): # 价格转换成数字\n if ord(text[j]) > 60:\n price.add(tPrice[text[j:i]])\n else:\n price.add(int(text[j:i]))\n continue\n else: # 未匹配,去尝试匹配地点\n i = j\n if tAdmin.has_keys_with_prefix(text[i]): # 匹配地点\n j = i\n i += 1\n # 正向最大匹配\n while i < len(text) and tAdmin.has_keys_with_prefix(text[j:i + 1]):\n i += 1\n if text[j:i] in tAdmin.keys(text[j:i]):\n location.add(text[j:i])\n continue\n else: # 未匹配,去尝试匹配租房还是求房\n i = j\n if rent and tTag.has_keys_with_prefix(text[i]): # 未匹配过的情况下匹配租房还是求房\n j = i\n i += 1\n # 正向最大匹配\n while i < len(text) and tTag.has_keys_with_prefix(text[j:i + 1]):\n i += 1\n if text[j:i] in tTag.keys(text[j:i]):\n rent = False\n else: # 未匹配,去尝试匹配租房还是求房\n i = j + 1\n else:\n i += 1\n return list(location), list(price), rent\n\n\nclass dbMongoPipeline(weiboMongoPipeline,):\n def __init__(self, mongo_uri, mongo_db, mongo_col):\n super(dbMongoPipeline, self).__init__(mongo_uri, mongo_db, mongo_col)\n\n @classmethod\n def from_crawler(cls, crawler):\n logging.warning('生成MongoPipeline对象')\n return cls(\n crawler.settings.get('MONGO_URI'),\n crawler.settings.get('MONGO_DATABASE')['db'],\n crawler.settings.get('MONGO_DATABASE')['col']\n )\n\n def open_spider(self, spider):\n logging.warning('开始spider')\n try:\n self.client = pymongo.MongoClient(self.mongo_uri)\n self.db = self.client[self.mongo_db]\n except ValueError:\n logging.error('数据库连接错误')\n # 表是否存在,若不存在建立对应的索引\n if self.mongo_col not in self.db.collection_names():\n self.db[self.mongo_col].create_index(\n [('created_at', pymongo.DESCENDING)])\n self.db[self.mongo_col].create_index(\n [('admin', pymongo.ASCENDING)], sparse=True)\n self.db[self.mongo_col].create_index(\n [('price', pymongo.ASCENDING)], sparse=True)\n self.db[self.mongo_col].create_index(\n [('mblogid', pymongo.ASCENDING)], unique=True)\n else:\n # 找到当前表中豆瓣最新插入的数据,方便过滤\n recent_row = list(self.db[self.mongo_col].find({'title': {'$ne': None}}, projection=['created_at'],\n limit=1, sort=[('created_at', pymongo.DESCENDING)]))\n if recent_row:\n self.recent = recent_row[0]['created_at'] # 最新时间\n logging.warning(\"允许插入数据的时间大于%s\" % (\n self.recent + datetime.timedelta(hours=8)).__str__())\n\n def process_item(self, item, spider):\n #collection_name = item.__class__.__name__\n logging.warning('开始插入表%s' % self.mongo_col)\n try:\n dt = DateUtil.convert(item[\"created_at\"]) # 时间格式化\n if dt <= self.recent: # 数据库中已经有或者太老,不再插入\n return item\n # 以标题作为唯一性依据\n item[\"mblogid\"] = DateUtil.calc_md5(item['title'] + item['user'])\n item[\"created_at\"] = dt\n admin, price, tag = self.extract(\n item['text'] + item['title'], self.tAdmin, self.tPrice, self.tTag)\n item[\"admin\"] = admin\n item[\"price\"] = price\n item[\"tag\"] = tag\n\n self.db[self.mongo_col].insert(dict(item))\n return item\n except Exception:\n logging.error('编号为:%s的数据插入异常' % item['mblogid'])\n"} +{"text": "package process\n\ntype Options struct{}\n\ntype Option func(o *Options)\n"} +{"text": "package xyz.klinker.messenger.shared.view\n\nimport android.app.Activity\nimport android.content.Context\nimport android.os.Bundle\nimport android.os.Handler\nimport android.text.Editable\nimport android.text.TextWatcher\nimport android.widget.EditText\nimport xyz.klinker.messenger.shared.R\n\nclass HexColorPicker(context: Context) : ColorPicker(context as Activity) {\n\n override fun onCreate(savedInstanceState: Bundle?) {\n super.onCreate(savedInstanceState)\n\n val hexCode = findViewById(R.id.hexCode)\n hexCode.addTextChangedListener(object : TextWatcher {\n override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { }\n override fun afterTextChanged(p0: Editable?) { }\n override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {\n if (hexCode.text.length == 6) {\n ignoreSetText = true\n Handler().postDelayed({ ignoreSetText = false }, 250)\n\n updateColorView(hexCode.text.toString())\n }\n }\n })\n }\n}"} +{"text": "/* This source file is part of the Tomviz project, https://tomviz.org/.\n It is released under the 3-Clause BSD License, see \"LICENSE\". */\n\n#ifndef tomvizDuplicateModuleReaction_h\n#define tomvizDuplicateModuleReaction_h\n\n#include \n\nnamespace tomviz {\n\n/// SaveDataReaction handles the \"Save Data\" action in tomviz. On trigger,\n/// this will save the data file.\nclass DuplicateModuleReaction : public pqReaction\n{\n Q_OBJECT\n\npublic:\n DuplicateModuleReaction(QAction* parentAction);\n\nprotected:\n /// Called when the data changes to enable/disable the menu item\n void updateEnableState() override;\n\n /// Called when the action is triggered.\n void onTriggered() override;\n};\n\n} // namespace tomviz\n\n#endif\n"} +{"text": "\n\n\n\n\nNameAndTypeCPInfo (Apache Ant API)\n\n\n\n\n\n\n\n\n
\n\n\n\n
\n\n
\n
\n\n\n
\n\n\n
\n\n\n
\n
org.apache.tools.ant.taskdefs.optional.depend.constantpool
\n

Class NameAndTypeCPInfo

\n
\n
\n\n
\n
    \n
  • \n
    \n
    \n
    public class NameAndTypeCPInfo\nextends ConstantPoolEntry
    \n
    A NameAndType CP Info
    \n
  • \n
\n
\n
\n\n
\n
\n
    \n
  • \n\n
      \n
    • \n\n\n

      Constructor Detail

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

        NameAndTypeCPInfo

        \n
        public NameAndTypeCPInfo()
        \n
        Constructor.
        \n
      • \n
      \n
    • \n
    \n\n
      \n
    • \n\n\n

      Method Detail

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

        read

        \n
        public void read(java.io.DataInputStream cpStream)\n          throws java.io.IOException
        \n
        read a constant pool entry from a class stream.
        \n
        \n
        Specified by:
        \n
        read in class ConstantPoolEntry
        \n
        Parameters:
        cpStream - the DataInputStream which contains the constant pool\n entry to be read.
        \n
        Throws:
        \n
        java.io.IOException - if there is a problem reading the entry from\n the stream.
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        toString

        \n
        public java.lang.String toString()
        \n
        Print a readable version of the constant pool entry.
        \n
        \n
        Overrides:
        \n
        toString in class java.lang.Object
        \n
        Returns:
        the string representation of this constant pool entry.
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        resolve

        \n
        public void resolve(ConstantPool constantPool)
        \n
        Resolve this constant pool entry with respect to its dependents in\n the constant pool.
        \n
        \n
        Overrides:
        \n
        resolve in class ConstantPoolEntry
        \n
        Parameters:
        constantPool - the constant pool of which this entry is a member\n and against which this entry is to be resolved.
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        getName

        \n
        public java.lang.String getName()
        \n
        Get the name component of this entry
        \n
        Returns:
        the name of this name and type entry
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        getType

        \n
        public java.lang.String getType()
        \n
        Get the type signature of this entry
        \n
        Returns:
        the type signature of this entry
        \n
      • \n
      \n
    • \n
    \n
  • \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": ";;; image-mode.el --- support for visiting image files -*- lexical-binding: t -*-\n;;\n;; Copyright (C) 2005-2017 Free Software Foundation, Inc.\n;;\n;; Author: Richard Stallman \n;; Keywords: multimedia\n;; Package: emacs\n\n;; This file is part of GNU Emacs.\n\n;; GNU Emacs 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;; GNU Emacs 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 GNU Emacs. If not, see .\n\n;;; Commentary:\n\n;; Defines a major mode for visiting image files\n;; that allows conversion between viewing the text of the file\n;; and viewing the file as an image. Viewing the image\n;; works by putting a `display' text-property on the\n;; image data, with the image-data still present underneath; if the\n;; resulting buffer file is saved to another name it will correctly save\n;; the image data to the new file.\n\n;; Todo:\n\n;; Consolidate with doc-view to make them work on directories of images or on\n;; image files containing various \"pages\".\n\n;;; Code:\n\n(require 'image)\n(eval-when-compile (require 'cl-lib))\n\n;;; Image mode window-info management.\n\n(defvar-local image-mode-winprops-alist t)\n\n(defvar image-mode-new-window-functions nil\n \"Special hook run when image data is requested in a new window.\nIt is called with one argument, the initial WINPROPS.\")\n\n;; FIXME this doesn't seem mature yet. Document in manual when it is.\n(defvar image-transform-resize nil\n \"The image resize operation.\nIts value should be one of the following:\n - nil, meaning no resizing.\n - `fit-height', meaning to fit the image to the window height.\n - `fit-width', meaning to fit the image to the window width.\n - A number, which is a scale factor (the default size is 1).\")\n\n(defvar image-transform-scale 1.0\n \"The scale factor of the image being displayed.\")\n\n(defvar image-transform-rotation 0.0\n \"Rotation angle for the image in the current Image mode buffer.\")\n\n(defvar image-transform-right-angle-fudge 0.0001\n \"Snap distance to a multiple of a right angle.\nThere's no deep theory behind the default value, it should just\nbe somewhat larger than ImageMagick's MagickEpsilon.\")\n\n(defun image-mode-winprops (&optional window cleanup)\n \"Return winprops of WINDOW.\nA winprops object has the shape (WINDOW . ALIST).\nWINDOW defaults to `selected-window' if it displays the current buffer, and\notherwise it defaults to t, used for times when the buffer is not displayed.\"\n (cond ((null window)\n (setq window\n (if (eq (current-buffer) (window-buffer)) (selected-window) t)))\n ((eq window t))\n\t((not (windowp window))\n\t (error \"Not a window: %s\" window)))\n (when cleanup\n (setq image-mode-winprops-alist\n \t (delq nil (mapcar (lambda (winprop)\n\t\t\t (let ((w (car-safe winprop)))\n\t\t\t\t(if (or (not (windowp w)) (window-live-p w))\n\t\t\t\t winprop)))\n \t\t\t image-mode-winprops-alist))))\n (let ((winprops (assq window image-mode-winprops-alist)))\n ;; For new windows, set defaults from the latest.\n (if winprops\n ;; Move window to front.\n (setq image-mode-winprops-alist\n (cons winprops (delq winprops image-mode-winprops-alist)))\n (setq winprops (cons window\n (copy-alist (cdar image-mode-winprops-alist))))\n ;; Add winprops before running the hook, to avoid inf-loops if the hook\n ;; triggers window-configuration-change-hook.\n (setq image-mode-winprops-alist\n (cons winprops image-mode-winprops-alist))\n (run-hook-with-args 'image-mode-new-window-functions winprops))\n winprops))\n\n(defun image-mode-window-get (prop &optional winprops)\n (declare (gv-setter (lambda (val)\n `(image-mode-window-put ,prop ,val ,winprops))))\n (unless (consp winprops) (setq winprops (image-mode-winprops winprops)))\n (cdr (assq prop (cdr winprops))))\n\n(defun image-mode-window-put (prop val &optional winprops)\n (unless (consp winprops) (setq winprops (image-mode-winprops winprops)))\n (unless (eq t (car winprops))\n (image-mode-window-put prop val t))\n (setcdr winprops (cons (cons prop val)\n (delq (assq prop (cdr winprops)) (cdr winprops)))))\n\n(defun image-set-window-vscroll (vscroll)\n (setf (image-mode-window-get 'vscroll) vscroll)\n (set-window-vscroll (selected-window) vscroll))\n\n(defun image-set-window-hscroll (ncol)\n (setf (image-mode-window-get 'hscroll) ncol)\n (set-window-hscroll (selected-window) ncol))\n\n(defun image-mode-reapply-winprops ()\n ;; When set-window-buffer, set hscroll and vscroll to what they were\n ;; last time the image was displayed in this window.\n (when (listp image-mode-winprops-alist)\n ;; Beware: this call to image-mode-winprops can't be optimized away,\n ;; because it not only gets the winprops data but sets it up if needed\n ;; (e.g. it's used by doc-view to display the image in a new window).\n (let* ((winprops (image-mode-winprops nil t))\n (hscroll (image-mode-window-get 'hscroll winprops))\n (vscroll (image-mode-window-get 'vscroll winprops)))\n (when (image-get-display-property) ;Only do it if we display an image!\n\t(if hscroll (set-window-hscroll (selected-window) hscroll))\n\t(if vscroll (set-window-vscroll (selected-window) vscroll))))))\n\n(defun image-mode-setup-winprops ()\n ;; Record current scroll settings.\n (unless (listp image-mode-winprops-alist)\n (setq image-mode-winprops-alist nil))\n (add-hook 'window-configuration-change-hook\n \t 'image-mode-reapply-winprops nil t))\n\n;;; Image scrolling functions\n\n(defun image-get-display-property ()\n (get-char-property (point-min) 'display\n ;; There might be different images for different displays.\n (if (eq (window-buffer) (current-buffer))\n (selected-window))))\n\n(declare-function image-size \"image.c\" (spec &optional pixels frame))\n(declare-function xwidget-info \"xwidget.c\" (xwidget))\n(declare-function xwidget-at \"xwidget.el\" (pos))\n\n(defun image-display-size (spec &optional pixels frame)\n \"Wrapper around `image-size', handling slice display properties.\nLike `image-size', the return value is (WIDTH . HEIGHT).\nWIDTH and HEIGHT are in canonical character units if PIXELS is\nnil, and in pixel units if PIXELS is non-nil.\n\nIf SPEC is an image display property, this function is equivalent to\n`image-size'. If SPEC represents an xwidget object, defer to `xwidget-info'.\nIf SPEC is a list of properties containing `image' and `slice' properties,\nreturn the display size taking the slice property into account. If the list\ncontains `image' but not `slice', return the `image-size' of the specified\nimage.\"\n (cond ((eq (car spec) 'xwidget)\n (let ((xwi (xwidget-info (xwidget-at (point-min)))))\n (cons (aref xwi 2) (aref xwi 3))))\n ((eq (car spec) 'image)\n (image-size spec pixels frame))\n (t (let ((image (assoc 'image spec))\n (slice (assoc 'slice spec)))\n (cond ((and image slice)\n (if pixels\n (cons (nth 3 slice) (nth 4 slice))\n (cons (/ (float (nth 3 slice)) (frame-char-width frame))\n (/ (float (nth 4 slice))\n (frame-char-height frame)))))\n (image\n (image-size image pixels frame))\n (t\n (error \"Invalid image specification: %s\" spec)))))))\n\n(defun image-forward-hscroll (&optional n)\n \"Scroll image in current window to the left by N character widths.\nStop if the right edge of the image is reached.\"\n (interactive \"p\")\n (cond ((= n 0) nil)\n\t((< n 0)\n\t (image-set-window-hscroll (max 0 (+ (window-hscroll) n))))\n\t(t\n\t (let* ((image (image-get-display-property))\n\t\t(edges (window-inside-edges))\n\t\t(win-width (- (nth 2 edges) (nth 0 edges)))\n\t\t(img-width (ceiling (car (image-display-size image)))))\n\t (image-set-window-hscroll (min (max 0 (- img-width win-width))\n\t\t\t\t\t (+ n (window-hscroll))))))))\n\n(defun image-backward-hscroll (&optional n)\n \"Scroll image in current window to the right by N character widths.\nStop if the left edge of the image is reached.\"\n (interactive \"p\")\n (image-forward-hscroll (- n)))\n\n(defun image-next-line (n)\n \"Scroll image in current window upward by N lines.\nStop if the bottom edge of the image is reached.\"\n (interactive \"p\")\n (cond ((= n 0) nil)\n\t((< n 0)\n\t (image-set-window-vscroll (max 0 (+ (window-vscroll) n))))\n\t(t\n\t (let* ((image (image-get-display-property))\n\t\t(edges (window-inside-edges))\n\t\t(win-height (- (nth 3 edges) (nth 1 edges)))\n\t\t(img-height (ceiling (cdr (image-display-size image)))))\n\t (image-set-window-vscroll (min (max 0 (- img-height win-height))\n\t\t\t\t\t (+ n (window-vscroll))))))))\n\n(defun image-previous-line (&optional n)\n \"Scroll image in current window downward by N lines.\nStop if the top edge of the image is reached.\"\n (interactive \"p\")\n (image-next-line (- n)))\n\n(defun image-scroll-up (&optional n)\n \"Scroll image in current window upward by N lines.\nStop if the bottom edge of the image is reached.\nIf ARG is omitted or nil, scroll upward by a near full screen.\nA near full screen is `next-screen-context-lines' less than a full screen.\nNegative ARG means scroll downward.\nIf ARG is the atom `-', scroll downward by nearly full screen.\nWhen calling from a program, supply as argument a number, nil, or `-'.\"\n (interactive \"P\")\n (cond ((null n)\n\t (let* ((edges (window-inside-edges))\n\t\t(win-height (- (nth 3 edges) (nth 1 edges))))\n\t (image-next-line\n\t (max 0 (- win-height next-screen-context-lines)))))\n\t((eq n '-)\n\t (let* ((edges (window-inside-edges))\n\t\t(win-height (- (nth 3 edges) (nth 1 edges))))\n\t (image-next-line\n\t (min 0 (- next-screen-context-lines win-height)))))\n\t(t (image-next-line (prefix-numeric-value n)))))\n\n(defun image-scroll-down (&optional n)\n \"Scroll image in current window downward by N lines.\nStop if the top edge of the image is reached.\nIf ARG is omitted or nil, scroll downward by a near full screen.\nA near full screen is `next-screen-context-lines' less than a full screen.\nNegative ARG means scroll upward.\nIf ARG is the atom `-', scroll upward by nearly full screen.\nWhen calling from a program, supply as argument a number, nil, or `-'.\"\n (interactive \"P\")\n (cond ((null n)\n\t (let* ((edges (window-inside-edges))\n\t\t(win-height (- (nth 3 edges) (nth 1 edges))))\n\t (image-next-line\n\t (min 0 (- next-screen-context-lines win-height)))))\n\t((eq n '-)\n\t (let* ((edges (window-inside-edges))\n\t\t(win-height (- (nth 3 edges) (nth 1 edges))))\n\t (image-next-line\n\t (max 0 (- win-height next-screen-context-lines)))))\n\t(t (image-next-line (- (prefix-numeric-value n))))))\n\n(defun image-bol (arg)\n \"Scroll horizontally to the left edge of the image in the current window.\nWith argument ARG not nil or 1, move forward ARG - 1 lines first,\nstopping if the top or bottom edge of the image is reached.\"\n (interactive \"p\")\n (and arg\n (/= (setq arg (prefix-numeric-value arg)) 1)\n (image-next-line (- arg 1)))\n (image-set-window-hscroll 0))\n\n(defun image-eol (arg)\n \"Scroll horizontally to the right edge of the image in the current window.\nWith argument ARG not nil or 1, move forward ARG - 1 lines first,\nstopping if the top or bottom edge of the image is reached.\"\n (interactive \"p\")\n (and arg\n (/= (setq arg (prefix-numeric-value arg)) 1)\n (image-next-line (- arg 1)))\n (let* ((image (image-get-display-property))\n\t (edges (window-inside-edges))\n\t (win-width (- (nth 2 edges) (nth 0 edges)))\n\t (img-width (ceiling (car (image-display-size image)))))\n (image-set-window-hscroll (max 0 (- img-width win-width)))))\n\n(defun image-bob ()\n \"Scroll to the top-left corner of the image in the current window.\"\n (interactive)\n (image-set-window-hscroll 0)\n (image-set-window-vscroll 0))\n\n(defun image-eob ()\n \"Scroll to the bottom-right corner of the image in the current window.\"\n (interactive)\n (let* ((image (image-get-display-property))\n\t (edges (window-inside-edges))\n\t (win-width (- (nth 2 edges) (nth 0 edges)))\n\t (img-width (ceiling (car (image-display-size image))))\n\t (win-height (- (nth 3 edges) (nth 1 edges)))\n\t (img-height (ceiling (cdr (image-display-size image)))))\n (image-set-window-hscroll (max 0 (- img-width win-width)))\n (image-set-window-vscroll (max 0 (- img-height win-height)))))\n\n;; Adjust frame and image size.\n\n(defun image-mode-fit-frame (&optional frame toggle)\n \"Fit FRAME to the current image.\nIf FRAME is omitted or nil, it defaults to the selected frame.\nAll other windows on the frame are deleted.\n\nIf called interactively, or if TOGGLE is non-nil, toggle between\nfitting FRAME to the current image and restoring the size and\nwindow configuration prior to the last `image-mode-fit-frame'\ncall.\"\n (interactive (list nil t))\n (let* ((buffer (current-buffer))\n (display (image-get-display-property))\n (size (image-display-size display))\n\t (saved (frame-parameter frame 'image-mode-saved-params))\n\t (window-configuration (current-window-configuration frame))\n\t (width (frame-width frame))\n\t (height (frame-height frame)))\n (with-selected-frame (or frame (selected-frame))\n (if (and toggle saved\n\t (= (caar saved) width)\n\t (= (cdar saved) height))\n\t (progn\n\t (set-frame-width frame (car (nth 1 saved)))\n\t (set-frame-height frame (cdr (nth 1 saved)))\n\t (set-window-configuration (nth 2 saved))\n\t (set-frame-parameter frame 'image-mode-saved-params nil))\n\t(delete-other-windows)\n\t(switch-to-buffer buffer t t)\n\t(let* ((edges (window-inside-edges))\n\t (inner-width (- (nth 2 edges) (nth 0 edges)))\n\t (inner-height (- (nth 3 edges) (nth 1 edges))))\n\t (set-frame-width frame (+ (ceiling (car size))\n\t\t\t\t width (- inner-width)))\n\t (set-frame-height frame (+ (ceiling (cdr size))\n\t\t\t\t height (- inner-height)))\n\t ;; The frame size after the above `set-frame-*' calls may\n\t ;; differ from what we specified, due to window manager\n\t ;; interference. We have to call `frame-width' and\n\t ;; `frame-height' to get the actual results.\n\t (set-frame-parameter frame 'image-mode-saved-params\n\t\t\t (list (cons (frame-width)\n\t\t\t\t\t (frame-height))\n\t\t\t\t (cons width height)\n\t\t\t\t window-configuration)))))))\n\n;;; Image Mode setup\n\n(defvar-local image-type nil\n \"The image type for the current Image mode buffer.\")\n\n(defvar-local image-multi-frame nil\n \"Non-nil if image for the current Image mode buffer has multiple frames.\")\n\n(defvar image-mode-previous-major-mode nil\n \"Internal variable to keep the previous non-image major mode.\")\n\n(defvar image-mode-map\n (let ((map (make-sparse-keymap)))\n (set-keymap-parent map special-mode-map)\n (define-key map \"\\C-c\\C-c\" 'image-toggle-display)\n (define-key map (kbd \"SPC\") 'image-scroll-up)\n (define-key map (kbd \"S-SPC\") 'image-scroll-down)\n (define-key map (kbd \"DEL\") 'image-scroll-down)\n (define-key map (kbd \"RET\") 'image-toggle-animation)\n (define-key map \"F\" 'image-goto-frame)\n (define-key map \"f\" 'image-next-frame)\n (define-key map \"b\" 'image-previous-frame)\n (define-key map \"n\" 'image-next-file)\n (define-key map \"p\" 'image-previous-file)\n (define-key map \"a+\" 'image-increase-speed)\n (define-key map \"a-\" 'image-decrease-speed)\n (define-key map \"a0\" 'image-reset-speed)\n (define-key map \"ar\" 'image-reverse-speed)\n (define-key map \"k\" 'image-kill-buffer)\n (define-key map [remap forward-char] 'image-forward-hscroll)\n (define-key map [remap backward-char] 'image-backward-hscroll)\n (define-key map [remap right-char] 'image-forward-hscroll)\n (define-key map [remap left-char] 'image-backward-hscroll)\n (define-key map [remap previous-line] 'image-previous-line)\n (define-key map [remap next-line] 'image-next-line)\n (define-key map [remap scroll-up] 'image-scroll-up)\n (define-key map [remap scroll-down] 'image-scroll-down)\n (define-key map [remap scroll-up-command] 'image-scroll-up)\n (define-key map [remap scroll-down-command] 'image-scroll-down)\n (define-key map [remap move-beginning-of-line] 'image-bol)\n (define-key map [remap move-end-of-line] 'image-eol)\n (define-key map [remap beginning-of-buffer] 'image-bob)\n (define-key map [remap end-of-buffer] 'image-eob)\n (easy-menu-define image-mode-menu map \"Menu for Image mode.\"\n '(\"Image\"\n\t[\"Show as Text\" image-toggle-display :active t\n\t :help \"Show image as text\"]\n\t\"--\"\n\t[\"Fit to Window Height\" image-transform-fit-to-height\n\t :visible (eq image-type 'imagemagick)\n\t :help \"Resize image to match the window height\"]\n\t[\"Fit to Window Width\" image-transform-fit-to-width\n\t :visible (eq image-type 'imagemagick)\n\t :help \"Resize image to match the window width\"]\n\t[\"Rotate Image...\" image-transform-set-rotation\n\t :visible (eq image-type 'imagemagick)\n\t :help \"Rotate the image\"]\n\t[\"Reset Transformations\" image-transform-reset\n\t :visible (eq image-type 'imagemagick)\n\t :help \"Reset all image transformations\"]\n\t\"--\"\n\t[\"Show Thumbnails\"\n\t (lambda ()\n\t (interactive)\n\t (image-dired default-directory))\n\t :active default-directory\n\t :help \"Show thumbnails for all images in this directory\"]\n\t[\"Next Image\" image-next-file :active buffer-file-name\n :help \"Move to next image in this directory\"]\n\t[\"Previous Image\" image-previous-file :active buffer-file-name\n :help \"Move to previous image in this directory\"]\n\t\"--\"\n\t[\"Fit Frame to Image\" image-mode-fit-frame :active t\n\t :help \"Resize frame to match image\"]\n\t\"--\"\n\t[\"Animate Image\" image-toggle-animation :style toggle\n\t :selected (let ((image (image-get-display-property)))\n\t\t (and image (image-animate-timer image)))\n\t :active image-multi-frame\n :help \"Toggle image animation\"]\n\t[\"Loop Animation\"\n\t (lambda () (interactive)\n\t (setq image-animate-loop (not image-animate-loop))\n\t ;; FIXME this is a hacky way to make it affect a currently\n\t ;; animating image.\n\t (when (let ((image (image-get-display-property)))\n\t\t (and image (image-animate-timer image)))\n\t (image-toggle-animation)\n\t (image-toggle-animation)))\n\t :style toggle :selected image-animate-loop\n\t :active image-multi-frame\n\t :help \"Animate images once, or forever?\"]\n\t[\"Reverse Animation\" image-reverse-speed\n\t :style toggle :selected (let ((image (image-get-display-property)))\n\t\t\t\t (and image (<\n\t\t\t\t\t (image-animate-get-speed image)\n\t\t\t\t\t 0)))\n\t :active image-multi-frame\n\t :help \"Reverse direction of this image's animation?\"]\n\t[\"Speed Up Animation\" image-increase-speed\n\t :active image-multi-frame\n\t :help \"Speed up this image's animation\"]\n\t[\"Slow Down Animation\" image-decrease-speed\n\t :active image-multi-frame\n\t :help \"Slow down this image's animation\"]\n\t[\"Reset Animation Speed\" image-reset-speed\n\t :active image-multi-frame\n\t :help \"Reset the speed of this image's animation\"]\n\t[\"Next Frame\" image-next-frame :active image-multi-frame\n\t :help \"Show the next frame of this image\"]\n\t[\"Previous Frame\" image-previous-frame :active image-multi-frame\n\t :help \"Show the previous frame of this image\"]\n\t[\"Goto Frame...\" image-goto-frame :active image-multi-frame\n\t :help \"Show a specific frame of this image\"]\n\t))\n map)\n \"Mode keymap for `image-mode'.\")\n\n(defvar image-minor-mode-map\n (let ((map (make-sparse-keymap)))\n (define-key map \"\\C-c\\C-c\" 'image-toggle-display)\n map)\n \"Mode keymap for `image-minor-mode'.\")\n\n(defvar bookmark-make-record-function)\n\n(put 'image-mode 'mode-class 'special)\n\n;;;###autoload\n(defun image-mode ()\n \"Major mode for image files.\nYou can use \\\\\\\\[image-toggle-display]\nto toggle between display as an image and display as text.\n\nKey bindings:\n\\\\{image-mode-map}\"\n (interactive)\n (condition-case err\n (progn\n\t(unless (display-images-p)\n\t (error \"Display does not support images\"))\n\n\t(kill-all-local-variables)\n\t(setq major-mode 'image-mode)\n\n\t(if (not (image-get-display-property))\n\t (progn\n\t (image-toggle-display-image)\n\t ;; If attempt to display the image fails.\n\t (if (not (image-get-display-property))\n\t\t (error \"Invalid image\")))\n\t ;; Set next vars when image is already displayed but local\n\t ;; variables were cleared by kill-all-local-variables\n\t (setq cursor-type nil truncate-lines t\n\t\timage-type (plist-get (cdr (image-get-display-property)) :type)))\n\n\t(setq mode-name (if image-type (format \"Image[%s]\" image-type) \"Image\"))\n\t(use-local-map image-mode-map)\n\n\t;; Use our own bookmarking function for images.\n\t(setq-local bookmark-make-record-function\n #'image-bookmark-make-record)\n\n\t;; Keep track of [vh]scroll when switching buffers\n\t(image-mode-setup-winprops)\n\n\t(add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)\n\t(add-hook 'after-revert-hook 'image-after-revert-hook nil t)\n\t(run-mode-hooks 'image-mode-hook)\n\t(let ((image (image-get-display-property))\n\t (msg1 (substitute-command-keys\n\t\t \"Type \\\\[image-toggle-display] to view the image as \"))\n\t animated)\n\t (cond\n\t ((null image)\n\t (message \"%s\" (concat msg1 \"an image.\")))\n\t ((setq animated (image-multi-frame-p image))\n\t (setq image-multi-frame t\n\t\t mode-line-process\n\t\t `(:eval\n\t\t (concat \" \"\n\t\t\t (propertize\n\t\t\t (format \"[%s/%s]\"\n\t\t\t\t (1+ (image-current-frame ',image))\n\t\t\t\t ,(car animated))\n\t\t\t 'help-echo \"Frames\nmouse-1: Next frame\nmouse-3: Previous frame\"\n\t\t\t 'mouse-face 'mode-line-highlight\n\t\t\t 'local-map\n\t\t\t '(keymap\n\t\t\t (mode-line\n\t\t\t\tkeymap\n\t\t\t\t(down-mouse-1 . image-next-frame)\n\t\t\t\t(down-mouse-3 . image-previous-frame)))))))\n\t (message \"%s\"\n\t\t (concat msg1 \"text. This image has multiple frames.\")))\n;;;\t\t\t (substitute-command-keys\n;;;\t\t\t \"\\\\[image-toggle-animation] to animate.\"))))\n\t (t\n\t (message \"%s\" (concat msg1 \"text.\"))))))\n\n (error\n (image-mode-as-text)\n (funcall\n (if (called-interactively-p 'any) 'error 'message)\n \"Cannot display image: %s\" (cdr err)))))\n\n;;;###autoload\n(define-minor-mode image-minor-mode\n \"Toggle Image minor mode in this buffer.\nWith a prefix argument ARG, enable Image minor mode if ARG is\npositive, and disable it otherwise. If called from Lisp, enable\nthe mode if ARG is omitted or nil.\n\nImage minor mode provides the key \\\\\\\\[image-toggle-display],\nto switch back to `image-mode' and display an image file as the\nactual image.\"\n nil (:eval (if image-type (format \" Image[%s]\" image-type) \" Image\"))\n image-minor-mode-map\n :group 'image\n :version \"22.1\"\n (if image-minor-mode\n (add-hook 'change-major-mode-hook (lambda () (image-minor-mode -1)) nil t)))\n\n;;;###autoload\n(defun image-mode-as-text ()\n \"Set a non-image mode as major mode in combination with image minor mode.\nA non-image major mode found from `auto-mode-alist' or Fundamental mode\ndisplays an image file as text. `image-minor-mode' provides the key\n\\\\\\\\[image-toggle-display] to switch back to `image-mode'\nto display an image file as the actual image.\n\nYou can use `image-mode-as-text' in `auto-mode-alist' when you want\nto display an image file as text initially.\n\nSee commands `image-mode' and `image-minor-mode' for more information\non these modes.\"\n (interactive)\n ;; image-mode-as-text = normal-mode + image-minor-mode\n (let ((previous-image-type image-type)) ; preserve `image-type'\n (if image-mode-previous-major-mode\n\t;; Restore previous major mode that was already found by this\n\t;; function and cached in `image-mode-previous-major-mode'\n\t(funcall image-mode-previous-major-mode)\n (let ((auto-mode-alist\n\t (delq nil (mapcar\n\t\t\t(lambda (elt)\n\t\t\t (unless (memq (or (car-safe (cdr elt)) (cdr elt))\n\t\t\t\t\t'(image-mode image-mode-maybe image-mode-as-text))\n\t\t\t elt))\n\t\t\tauto-mode-alist)))\n\t (magic-fallback-mode-alist\n\t (delq nil (mapcar\n\t\t\t(lambda (elt)\n\t\t\t (unless (memq (or (car-safe (cdr elt)) (cdr elt))\n\t\t\t\t\t'(image-mode image-mode-maybe image-mode-as-text))\n\t\t\t elt))\n\t\t\tmagic-fallback-mode-alist))))\n\t(normal-mode)\n\t(setq-local image-mode-previous-major-mode major-mode)))\n ;; Restore `image-type' after `kill-all-local-variables' in `normal-mode'.\n (setq image-type previous-image-type)\n ;; Enable image minor mode with `C-c C-c'.\n (image-minor-mode 1)\n ;; Show the image file as text.\n (image-toggle-display-text)\n (message \"%s\" (concat\n\t\t (substitute-command-keys\n\t\t \"Type \\\\[image-toggle-display] to view the image as \")\n\t\t (if (image-get-display-property)\n\t\t \"text\" \"an image\") \".\"))))\n\n(define-obsolete-function-alias 'image-mode-maybe 'image-mode \"23.2\")\n\n(defun image-toggle-display-text ()\n \"Show the image file as text.\nRemove text properties that display the image.\"\n (let ((inhibit-read-only t)\n\t(buffer-undo-list t)\n\t(modified (buffer-modified-p)))\n (remove-list-of-text-properties (point-min) (point-max)\n\t\t\t\t '(display read-nonsticky ;; intangible\n\t\t\t\t\t read-only front-sticky))\n (set-buffer-modified-p modified)\n (if (called-interactively-p 'any)\n\t(message \"Repeat this command to go back to displaying the image\"))))\n\n(defvar archive-superior-buffer)\n(defvar tar-superior-buffer)\n(declare-function image-flush \"image.c\" (spec &optional frame))\n\n(defun image-toggle-display-image ()\n \"Show the image of the image file.\nTurn the image data into a real image, but only if the whole file\nwas inserted.\"\n (unless (derived-mode-p 'image-mode)\n (error \"The buffer is not in Image mode\"))\n (let* ((filename (buffer-file-name))\n\t (data-p (not (and filename\n\t\t\t (file-readable-p filename)\n\t\t\t (not (file-remote-p filename))\n\t\t\t (not (buffer-modified-p))\n\t\t\t (not (and (boundp 'archive-superior-buffer)\n\t\t\t\t archive-superior-buffer))\n\t\t\t (not (and (boundp 'tar-superior-buffer)\n\t\t\t\t tar-superior-buffer))\n ;; This means the buffer holds the\n ;; decrypted content (bug#21870).\n (not (and (boundp 'epa-file-encrypt-to)\n (local-variable-p\n 'epa-file-encrypt-to))))))\n\t (file-or-data (if data-p\n\t\t\t (string-make-unibyte\n\t\t\t (buffer-substring-no-properties (point-min) (point-max)))\n\t\t\t filename))\n\t ;; If we have a `fit-width' or a `fit-height', don't limit\n\t ;; the size of the image to the window size.\n\t (edges (and (null image-transform-resize)\n\t\t (window-inside-pixel-edges\n\t\t (get-buffer-window (current-buffer)))))\n\t (type (if (fboundp 'imagemagick-types)\n\t\t 'imagemagick\n\t\t (image-type file-or-data nil data-p)))\n\t (image (if (not edges)\n\t\t (create-image file-or-data type data-p)\n\t\t (create-image file-or-data type data-p\n\t\t\t\t:max-width (- (nth 2 edges) (nth 0 edges))\n\t\t\t\t:max-height (- (nth 3 edges) (nth 1 edges)))))\n\t (inhibit-read-only t)\n\t (buffer-undo-list t)\n\t (modified (buffer-modified-p))\n\t props)\n\n ;; Discard any stale image data before looking it up again.\n (image-flush image)\n (setq image (append image (image-transform-properties image)))\n (setq props\n\t `(display ,image\n\t\t ;; intangible ,image\n\t\t rear-nonsticky (display) ;; intangible\n\t\t read-only t front-sticky (read-only)))\n\n (let ((buffer-file-truename nil)) ; avoid changing dir mtime by lock_file\n (add-text-properties (point-min) (point-max) props)\n (restore-buffer-modified-p modified))\n ;; Inhibit the cursor when the buffer contains only an image,\n ;; because cursors look very strange on top of images.\n (setq cursor-type nil)\n ;; This just makes the arrow displayed in the right fringe\n ;; area look correct when the image is wider than the window.\n (setq truncate-lines t)\n ;; Disable adding a newline at the end of the image file when it\n ;; is written with, e.g., C-x C-w.\n (if (coding-system-equal (coding-system-base buffer-file-coding-system)\n\t\t\t 'no-conversion)\n\t(setq-local find-file-literally t))\n ;; Allow navigation of large images.\n (setq-local auto-hscroll-mode nil)\n (setq image-type type)\n (if (eq major-mode 'image-mode)\n\t(setq mode-name (format \"Image[%s]\" type)))\n (image-transform-check-size)\n (if (called-interactively-p 'any)\n\t(message \"Repeat this command to go back to displaying the file as text\"))))\n\n(defun image-toggle-display ()\n \"Toggle between image and text display.\nIf the current buffer is displaying an image file as an image,\ncall `image-mode-as-text' to switch to text. Otherwise, display\nthe image by calling `image-mode'.\"\n (interactive)\n (if (image-get-display-property)\n (image-mode-as-text)\n (image-mode)))\n\n(defun image-kill-buffer ()\n \"Kill the current buffer.\"\n (interactive)\n (kill-buffer (current-buffer)))\n\n(defun image-after-revert-hook ()\n (when (image-get-display-property)\n (image-toggle-display-text)\n ;; Update image display.\n (mapc (lambda (window) (redraw-frame (window-frame window)))\n (get-buffer-window-list (current-buffer) 'nomini 'visible))\n (image-toggle-display-image)))\n\n\f\n;;; Animated images\n\n(defcustom image-animate-loop nil\n \"Non-nil means animated images loop forever, rather than playing once.\"\n :type 'boolean\n :version \"24.1\"\n :group 'image)\n\n(defun image-toggle-animation ()\n \"Start or stop animating the current image.\nIf `image-animate-loop' is non-nil, animation loops forever.\nOtherwise it plays once, then stops.\"\n (interactive)\n (let ((image (image-get-display-property))\n\tanimation)\n (cond\n ((null image)\n (error \"No image is present\"))\n ((null (setq animation (image-multi-frame-p image)))\n (message \"No image animation.\"))\n (t\n (let ((timer (image-animate-timer image)))\n\t(if timer\n\t (cancel-timer timer)\n\t (let ((index (plist-get (cdr image) :index)))\n\t ;; If we're at the end, restart.\n\t (and index\n\t\t (>= index (1- (car animation)))\n\t\t (setq index nil))\n\t (image-animate image index\n\t\t\t (if image-animate-loop t)))))))))\n\n(defun image--set-speed (speed &optional multiply)\n \"Set speed of an animated image to SPEED.\nIf MULTIPLY is non-nil, treat SPEED as a multiplication factor.\nIf SPEED is `reset', reset the magnitude of the speed to 1.\"\n (let ((image (image-get-display-property)))\n (cond\n ((null image)\n (error \"No image is present\"))\n ((null image-multi-frame)\n (message \"No image animation.\"))\n (t\n (if (eq speed 'reset)\n\t (setq speed (if (< (image-animate-get-speed image) 0)\n\t\t\t -1 1)\n\t\tmultiply nil))\n (image-animate-set-speed image speed multiply)\n ;; FIXME Hack to refresh an active image.\n (when (image-animate-timer image)\n\t(image-toggle-animation)\n\t(image-toggle-animation))\n (message \"Image speed is now %s\" (image-animate-get-speed image))))))\n\n(defun image-increase-speed ()\n \"Increase the speed of current animated image by a factor of 2.\"\n (interactive)\n (image--set-speed 2 t))\n\n(defun image-decrease-speed ()\n \"Decrease the speed of current animated image by a factor of 2.\"\n (interactive)\n (image--set-speed 0.5 t))\n\n(defun image-reverse-speed ()\n \"Reverse the animation of the current image.\"\n (interactive)\n (image--set-speed -1 t))\n\n(defun image-reset-speed ()\n \"Reset the animation speed of the current image.\"\n (interactive)\n (image--set-speed 'reset))\n\n(defun image-goto-frame (n &optional relative)\n \"Show frame N of a multi-frame image.\nOptional argument OFFSET non-nil means interpret N as relative to the\ncurrent frame. Frames are indexed from 1.\"\n (interactive\n (list (or current-prefix-arg\n\t (read-number \"Show frame number: \"))))\n (let ((image (image-get-display-property)))\n (cond\n ((null image)\n (error \"No image is present\"))\n ((null image-multi-frame)\n (message \"No image animation.\"))\n (t\n (image-show-frame image\n\t\t\t(if relative\n\t\t\t (+ n (image-current-frame image))\n\t\t\t (1- n)))))))\n\n(defun image-next-frame (&optional n)\n \"Switch to the next frame of a multi-frame image.\nWith optional argument N, switch to the Nth frame after the current one.\nIf N is negative, switch to the Nth frame before the current one.\"\n (interactive \"p\")\n (image-goto-frame n t))\n\n(defun image-previous-frame (&optional n)\n \"Switch to the previous frame of a multi-frame image.\nWith optional argument N, switch to the Nth frame before the current one.\nIf N is negative, switch to the Nth frame after the current one.\"\n (interactive \"p\")\n (image-next-frame (- n)))\n\n\f\n;;; Switching to the next/previous image\n\n(defun image-next-file (&optional n)\n \"Visit the next image in the same directory as the current image file.\nWith optional argument N, visit the Nth image file after the\ncurrent one, in cyclic alphabetical order.\n\nThis command visits the specified file via `find-alternate-file',\nreplacing the current Image mode buffer.\"\n (interactive \"p\")\n (unless (derived-mode-p 'image-mode)\n (error \"The buffer is not in Image mode\"))\n (unless buffer-file-name\n (error \"The current image is not associated with a file\"))\n (let* ((file (file-name-nondirectory buffer-file-name))\n\t (images (image-mode--images-in-directory file))\n\t (idx 0))\n (catch 'image-visit-next-file\n (dolist (f images)\n\t(if (string= f file)\n\t (throw 'image-visit-next-file (1+ idx)))\n\t(setq idx (1+ idx))))\n (setq idx (mod (+ idx (or n 1)) (length images)))\n (find-alternate-file (nth idx images))))\n\n(defun image-previous-file (&optional n)\n \"Visit the preceding image in the same directory as the current file.\nWith optional argument N, visit the Nth image file preceding the\ncurrent one, in cyclic alphabetical order.\n\nThis command visits the specified file via `find-alternate-file',\nreplacing the current Image mode buffer.\"\n (interactive \"p\")\n (image-next-file (- n)))\n\n(defun image-mode--images-in-directory (file)\n (let* ((dir (file-name-directory buffer-file-name))\n\t (files (directory-files dir nil\n\t\t\t\t (image-file-name-regexp) t)))\n ;; Add the current file to the list of images if necessary, in\n ;; case it does not match `image-file-name-regexp'.\n (unless (member file files)\n (push file files))\n (sort files 'string-lessp)))\n\n\f\n;;; Support for bookmark.el\n(declare-function bookmark-make-record-default\n \"bookmark\" (&optional no-file no-context posn))\n(declare-function bookmark-prop-get \"bookmark\" (bookmark prop))\n(declare-function bookmark-default-handler \"bookmark\" (bmk))\n\n(defun image-bookmark-make-record ()\n `(,@(bookmark-make-record-default nil 'no-context 0)\n (image-type . ,image-type)\n (handler . image-bookmark-jump)))\n\n;;;###autoload\n(defun image-bookmark-jump (bmk)\n ;; This implements the `handler' function interface for record type\n ;; returned by `bookmark-make-record-function', which see.\n (prog1 (bookmark-default-handler bmk)\n (when (not (string= image-type (bookmark-prop-get bmk 'image-type)))\n (image-toggle-display))))\n\f\n\n;; Not yet implemented.\n;; (defvar image-transform-minor-mode-map\n;; (let ((map (make-sparse-keymap)))\n;; ;; (define-key map [(control ?+)] 'image-scale-in)\n;; ;; (define-key map [(control ?-)] 'image-scale-out)\n;; ;; (define-key map [(control ?=)] 'image-scale-none)\n;; ;; (define-key map \"c f h\" 'image-scale-fit-height)\n;; ;; (define-key map \"c ]\" 'image-rotate-right)\n;; map)\n;; \"Minor mode keymap `image-transform-mode'.\")\n;;\n;; (define-minor-mode image-transform-mode\n;; \"Minor mode for scaling and rotating images.\n;; With a prefix argument ARG, enable the mode if ARG is positive,\n;; and disable it otherwise. If called from Lisp, enable the mode\n;; if ARG is omitted or nil. This minor mode requires Emacs to have\n;; been compiled with ImageMagick support.\"\n;; nil \"image-transform\" image-transform-minor-mode-map)\n\n\n(defsubst image-transform-width (width height)\n \"Return the bounding box width of a rotated WIDTH x HEIGHT rectangle.\nThe rotation angle is the value of `image-transform-rotation' in degrees.\"\n (let ((angle (degrees-to-radians image-transform-rotation)))\n ;; Assume, w.l.o.g., that the vertices of the rectangle have the\n ;; coordinates (+-w/2, +-h/2) and that (0, 0) is the center of the\n ;; rotation by the angle A. The projections onto the first axis\n ;; of the vertices of the rotated rectangle are +- (w/2) cos A +-\n ;; (h/2) sin A, and the difference between the largest and the\n ;; smallest of the four values is the expression below.\n (+ (* width (abs (cos angle))) (* height (abs (sin angle))))))\n\n;; The following comment and code snippet are from\n;; ImageMagick-6.7.4-4/magick/distort.c\n\n;; /* Set the output image geometry to calculated 'best fit'.\n;; Yes this tends to 'over do' the file image size, ON PURPOSE!\n;; Do not do this for DePolar which needs to be exact for virtual tiling.\n;; */\n;; if ( fix_bounds ) {\n;; geometry.x = (ssize_t) floor(min.x-0.5);\n;; geometry.y = (ssize_t) floor(min.y-0.5);\n;; geometry.width=(size_t) ceil(max.x-geometry.x+0.5);\n;; geometry.height=(size_t) ceil(max.y-geometry.y+0.5);\n;; }\n\n;; Other parts of the same file show that here the origin is in the\n;; left lower corner of the image rectangle, the center of the\n;; rotation is the center of the rectangle and min.x and max.x\n;; (resp. min.y and max.y) are the smallest and the largest of the\n;; projections of the vertices onto the first (resp. second) axis.\n\n(defun image-transform-fit-width (width height length)\n \"Return (w . h) so that a rotated w x h image has exactly width LENGTH.\nThe rotation angle is the value of `image-transform-rotation'.\nWrite W for WIDTH and H for HEIGHT. Then the w x h rectangle is\nan \\\"approximately uniformly\\\" scaled W x H rectangle, which\ncurrently means that w is one of floor(s W) + {0, 1, -1} and h is\nfloor(s H), where s can be recovered as the value of `image-transform-scale'.\nThe value of `image-transform-rotation' may be replaced by\na slightly different angle. Currently this is done for values\nclose to a multiple of 90, see `image-transform-right-angle-fudge'.\"\n (cond ((< (abs (- (mod (+ image-transform-rotation 90) 180) 90))\n\t image-transform-right-angle-fudge)\n\t (cl-assert (not (zerop width)) t)\n\t (setq image-transform-rotation\n\t (float (round image-transform-rotation))\n\t image-transform-scale (/ (float length) width))\n\t (cons length nil))\n\t((< (abs (- (mod (+ image-transform-rotation 45) 90) 45))\n\t image-transform-right-angle-fudge)\n\t (cl-assert (not (zerop height)) t)\n\t (setq image-transform-rotation\n\t (float (round image-transform-rotation))\n\t image-transform-scale (/ (float length) height))\n\t (cons nil length))\n\t(t\n\t (cl-assert (not (and (zerop width) (zerop height))) t)\n\t (setq image-transform-scale\n\t (/ (float (1- length)) (image-transform-width width height)))\n\t ;; Assume we have a w x h image and an angle A, and let l =\n\t ;; l(w, h) = w |cos A| + h |sin A|, which is the actual width\n\t ;; of the bounding box of the rotated image, as calculated by\n\t ;; `image-transform-width'. The code snippet quoted above\n\t ;; means that ImageMagick puts the rotated image in\n\t ;; a bounding box of width L = 2 ceil((w+l+1)/2) - w.\n\t ;; Elementary considerations show that this is equivalent to\n\t ;; L - w being even and L-3 < l(w, h) <= L-1. In our case, L is\n\t ;; the given `length' parameter and our job is to determine\n\t ;; reasonable values for w and h which satisfy these\n\t ;; conditions.\n\t (let ((w (floor (* image-transform-scale width)))\n\t (h (floor (* image-transform-scale height))))\n\t ;; Let w and h as bound above. Then l(w, h) <= l(s W, s H)\n\t ;; = L-1 < l(w+1, h+1) = l(w, h) + l(1, 1) <= l(w, h) + 2,\n\t ;; hence l(w, h) > (L-1) - 2 = L-3.\n\t (cons\n\t (cond ((= (mod w 2) (mod length 2))\n\t\t w)\n\t\t ;; l(w+1, h) >= l(w, h) > L-3, but does l(w+1, h) <=\n\t\t ;; L-1 hold?\n\t\t ((<= (image-transform-width (1+ w) h) (1- length))\n\t\t (1+ w))\n\t\t ;; No, it doesn't, but this implies that l(w-1, h) =\n\t\t ;; l(w+1, h) - l(2, 0) >= l(w+1, h) - 2 > (L-1) -\n\t\t ;; 2 = L-3. Clearly, l(w-1, h) <= l(w, h) <= L-1.\n\t\t (t\n\t\t (1- w)))\n\t h)))))\n\n(defun image-transform-check-size ()\n \"Check that the image exactly fits the width/height of the window.\n\nDo this for an image of type `imagemagick' to make sure that the\nelisp code matches the way ImageMagick computes the bounding box\nof a rotated image.\"\n (when (and (not (numberp image-transform-resize))\n\t (boundp 'image-type)\n\t (eq image-type 'imagemagick))\n (let ((size (image-display-size (image-get-display-property) t)))\n (cond ((eq image-transform-resize 'fit-width)\n\t (cl-assert (= (car size)\n\t\t\t(- (nth 2 (window-inside-pixel-edges))\n\t\t\t (nth 0 (window-inside-pixel-edges))))\n\t\t t))\n\t ((eq image-transform-resize 'fit-height)\n\t (cl-assert (= (cdr size)\n\t\t\t(- (nth 3 (window-inside-pixel-edges))\n\t\t\t (nth 1 (window-inside-pixel-edges))))\n\t\t t))))))\n\n(defun image-transform-properties (spec)\n \"Return rescaling/rotation properties for image SPEC.\nThese properties are determined by the Image mode variables\n`image-transform-resize' and `image-transform-rotation'. The\nreturn value is suitable for appending to an image spec.\n\nRescaling and rotation properties only take effect if Emacs is\ncompiled with ImageMagick support.\"\n (setq image-transform-scale 1.0)\n (when (or image-transform-resize\n\t (/= image-transform-rotation 0.0))\n ;; Note: `image-size' looks up and thus caches the untransformed\n ;; image. There's no easy way to prevent that.\n (let* ((size (image-size spec t))\n\t (resized\n\t (cond\n\t ((numberp image-transform-resize)\n\t (unless (= image-transform-resize 1)\n\t\t(setq image-transform-scale image-transform-resize)\n\t\t(cons nil (floor (* image-transform-resize (cdr size))))))\n\t ((eq image-transform-resize 'fit-width)\n\t (image-transform-fit-width\n\t (car size) (cdr size)\n\t (- (nth 2 (window-inside-pixel-edges))\n\t\t (nth 0 (window-inside-pixel-edges)))))\n\t ((eq image-transform-resize 'fit-height)\n\t (let ((res (image-transform-fit-width\n\t\t\t (cdr size) (car size)\n\t\t\t (- (nth 3 (window-inside-pixel-edges))\n\t\t\t (nth 1 (window-inside-pixel-edges))))))\n\t\t(cons (cdr res) (car res)))))))\n `(,@(when (car resized)\n\t (list :width (car resized)))\n\t,@(when (cdr resized)\n\t (list :height (cdr resized)))\n\t,@(unless (= 0.0 image-transform-rotation)\n\t (list :rotation image-transform-rotation))))))\n\n(defun image-transform-set-scale (scale)\n \"Prompt for a number, and resize the current image by that amount.\nThis command has no effect unless Emacs is compiled with\nImageMagick support.\"\n (interactive \"nScale: \")\n (setq image-transform-resize scale)\n (image-toggle-display-image))\n\n(defun image-transform-fit-to-height ()\n \"Fit the current image to the height of the current window.\nThis command has no effect unless Emacs is compiled with\nImageMagick support.\"\n (interactive)\n (setq image-transform-resize 'fit-height)\n (image-toggle-display-image))\n\n(defun image-transform-fit-to-width ()\n \"Fit the current image to the width of the current window.\nThis command has no effect unless Emacs is compiled with\nImageMagick support.\"\n (interactive)\n (setq image-transform-resize 'fit-width)\n (image-toggle-display-image))\n\n(defun image-transform-set-rotation (rotation)\n \"Prompt for an angle ROTATION, and rotate the image by that amount.\nROTATION should be in degrees. This command has no effect unless\nEmacs is compiled with ImageMagick support.\"\n (interactive \"nRotation angle (in degrees): \")\n (setq image-transform-rotation (float (mod rotation 360)))\n (image-toggle-display-image))\n\n(defun image-transform-reset ()\n \"Display the current image with the default size and rotation.\nThis command has no effect unless Emacs is compiled with\nImageMagick support.\"\n (interactive)\n (setq image-transform-resize nil\n\timage-transform-rotation 0.0\n\timage-transform-scale 1)\n (image-toggle-display-image))\n\n(provide 'image-mode)\n\n;;; image-mode.el ends here\n"} +{"text": "import React, { Component } from 'react'\n\nimport { Redirect } from 'react-router-dom'\nimport { AuthManager } from 'react-saasify'\n\nexport class LogoutPage extends Component {\n componentDidMount() {\n AuthManager.signout()\n }\n\n render() {\n return \n }\n}\n"} +{"text": "# MHz S RI R 50\n28.000000 0.0 0.0\n"} +{"text": "{\n \"recordings\": [\n {\n \"method\": \"PUT\",\n \"url\": \"https://fakestorageaccount.blob.core.windows.net/container156996521681206653\",\n \"query\": {\n \"restype\": \"container\"\n },\n \"requestBody\": null,\n \"status\": 201,\n \"response\": \"\",\n \"responseHeaders\": {\n \"date\": \"Tue, 01 Oct 2019 21:26:56 GMT\",\n \"last-modified\": \"Tue, 01 Oct 2019 21:26:56 GMT\",\n \"server\": \"Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0\",\n \"etag\": \"\\\"0x8D746B6162C9865\\\"\",\n \"x-ms-request-id\": \"89cc98cb-201e-0065-459e-78812b000000\",\n \"x-ms-version\": \"2019-02-02\",\n \"x-ms-client-request-id\": \"56f1810b-b0f6-4232-8f7f-ccc242430e72\",\n \"content-length\": \"0\"\n }\n },\n {\n \"method\": \"PUT\",\n \"url\": \"https://fakestorageaccount.blob.core.windows.net/container156996521681206653/blob156996521694904200\",\n \"query\": {},\n \"requestBody\": \"Hello World\",\n \"status\": 201,\n \"response\": \"\",\n \"responseHeaders\": {\n \"x-ms-content-crc64\": \"YeJLfssylmU=\",\n \"date\": \"Tue, 01 Oct 2019 21:26:56 GMT\",\n \"last-modified\": \"Tue, 01 Oct 2019 21:26:56 GMT\",\n \"server\": \"Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0\",\n \"content-md5\": \"sQqNsWTgdUEFt6mb5y4/5Q==\",\n \"etag\": \"\\\"0x8D746B61637C78E\\\"\",\n \"x-ms-request-id\": \"89cc990f-201e-0065-779e-78812b000000\",\n \"x-ms-version\": \"2019-02-02\",\n \"x-ms-client-request-id\": \"f9977cca-4579-4ef6-bfbd-b6209a8ad1c1\",\n \"x-ms-request-server-encrypted\": \"true\",\n \"content-length\": \"0\"\n }\n },\n {\n \"method\": \"HEAD\",\n \"url\": \"https://fakestorageaccount.blob.core.windows.net/container156996521681206653/newblob156996521702202093\",\n \"query\": {},\n \"requestBody\": null,\n \"status\": 404,\n \"response\": \"\",\n \"responseHeaders\": {\n \"date\": \"Tue, 01 Oct 2019 21:26:56 GMT\",\n \"server\": \"Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0\",\n \"x-ms-error-code\": \"BlobNotFound\",\n \"transfer-encoding\": \"chunked\",\n \"x-ms-request-id\": \"89cc9937-201e-0065-189e-78812b000000\",\n \"x-ms-version\": \"2019-02-02\",\n \"x-ms-client-request-id\": \"89ac63da-951a-4735-afe7-aa563686691a\"\n }\n },\n {\n \"method\": \"DELETE\",\n \"url\": \"https://fakestorageaccount.blob.core.windows.net/container156996521681206653\",\n \"query\": {\n \"restype\": \"container\"\n },\n \"requestBody\": null,\n \"status\": 202,\n \"response\": \"\",\n \"responseHeaders\": {\n \"date\": \"Tue, 01 Oct 2019 21:26:56 GMT\",\n \"server\": \"Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0\",\n \"x-ms-request-id\": \"89cc996f-201e-0065-439e-78812b000000\",\n \"x-ms-version\": \"2019-02-02\",\n \"x-ms-client-request-id\": \"5a208e99-196e-4a67-8679-0009d219d7d0\",\n \"content-length\": \"0\"\n }\n }\n ],\n \"uniqueTestInfo\": {\n \"container\": \"container156996521681206653\",\n \"blob\": \"blob156996521694904200\",\n \"newblob\": \"newblob156996521702202093\"\n }\n}"} +{"text": "// Package defaults is a collection of helpers to retrieve the SDK's default\n// configuration and handlers.\n//\n// Generally this package shouldn't be used directly, but session.Session\n// instead. This package is useful when you need to reset the defaults\n// of a session or service client to the SDK defaults before setting\n// additional parameters.\npackage defaults\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/corehandlers\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials/endpointcreds\"\n\t\"github.com/aws/aws-sdk-go/aws/ec2metadata\"\n\t\"github.com/aws/aws-sdk-go/aws/endpoints\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n\t\"github.com/aws/aws-sdk-go/internal/shareddefaults\"\n)\n\n// A Defaults provides a collection of default values for SDK clients.\ntype Defaults struct {\n\tConfig *aws.Config\n\tHandlers request.Handlers\n}\n\n// Get returns the SDK's default values with Config and handlers pre-configured.\nfunc Get() Defaults {\n\tcfg := Config()\n\thandlers := Handlers()\n\tcfg.Credentials = CredChain(cfg, handlers)\n\n\treturn Defaults{\n\t\tConfig: cfg,\n\t\tHandlers: handlers,\n\t}\n}\n\n// Config returns the default configuration without credentials.\n// To retrieve a config with credentials also included use\n// `defaults.Get().Config` instead.\n//\n// Generally you shouldn't need to use this method directly, but\n// is available if you need to reset the configuration of an\n// existing service client or session.\nfunc Config() *aws.Config {\n\treturn aws.NewConfig().\n\t\tWithCredentials(credentials.AnonymousCredentials).\n\t\tWithRegion(os.Getenv(\"AWS_REGION\")).\n\t\tWithHTTPClient(http.DefaultClient).\n\t\tWithMaxRetries(aws.UseServiceDefaultRetries).\n\t\tWithLogger(aws.NewDefaultLogger()).\n\t\tWithLogLevel(aws.LogOff).\n\t\tWithEndpointResolver(endpoints.DefaultResolver())\n}\n\n// Handlers returns the default request handlers.\n//\n// Generally you shouldn't need to use this method directly, but\n// is available if you need to reset the request handlers of an\n// existing service client or session.\nfunc Handlers() request.Handlers {\n\tvar handlers request.Handlers\n\n\thandlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)\n\thandlers.Validate.AfterEachFn = request.HandlerListStopOnError\n\thandlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler)\n\thandlers.Build.PushBackNamed(corehandlers.AddHostExecEnvUserAgentHander)\n\thandlers.Build.AfterEachFn = request.HandlerListStopOnError\n\thandlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler)\n\thandlers.Send.PushBackNamed(corehandlers.ValidateReqSigHandler)\n\thandlers.Send.PushBackNamed(corehandlers.SendHandler)\n\thandlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler)\n\thandlers.ValidateResponse.PushBackNamed(corehandlers.ValidateResponseHandler)\n\n\treturn handlers\n}\n\n// CredChain returns the default credential chain.\n//\n// Generally you shouldn't need to use this method directly, but\n// is available if you need to reset the credentials of an\n// existing service client or session's Config.\nfunc CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credentials {\n\treturn credentials.NewCredentials(&credentials.ChainProvider{\n\t\tVerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors),\n\t\tProviders: CredProviders(cfg, handlers),\n\t})\n}\n\n// CredProviders returns the slice of providers used in\n// the default credential chain.\n//\n// For applications that need to use some other provider (for example use\n// different environment variables for legacy reasons) but still fall back\n// on the default chain of providers. This allows that default chaint to be\n// automatically updated\nfunc CredProviders(cfg *aws.Config, handlers request.Handlers) []credentials.Provider {\n\treturn []credentials.Provider{\n\t\t&credentials.EnvProvider{},\n\t\t&credentials.SharedCredentialsProvider{Filename: \"\", Profile: \"\"},\n\t\tRemoteCredProvider(*cfg, handlers),\n\t}\n}\n\nconst (\n\thttpProviderAuthorizationEnvVar = \"AWS_CONTAINER_AUTHORIZATION_TOKEN\"\n\thttpProviderEnvVar = \"AWS_CONTAINER_CREDENTIALS_FULL_URI\"\n)\n\n// RemoteCredProvider returns a credentials provider for the default remote\n// endpoints such as EC2 or ECS Roles.\nfunc RemoteCredProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider {\n\tif u := os.Getenv(httpProviderEnvVar); len(u) > 0 {\n\t\treturn localHTTPCredProvider(cfg, handlers, u)\n\t}\n\n\tif uri := os.Getenv(shareddefaults.ECSCredsProviderEnvVar); len(uri) > 0 {\n\t\tu := fmt.Sprintf(\"%s%s\", shareddefaults.ECSContainerCredentialsURI, uri)\n\t\treturn httpCredProvider(cfg, handlers, u)\n\t}\n\n\treturn ec2RoleProvider(cfg, handlers)\n}\n\nvar lookupHostFn = net.LookupHost\n\nfunc isLoopbackHost(host string) (bool, error) {\n\tip := net.ParseIP(host)\n\tif ip != nil {\n\t\treturn ip.IsLoopback(), nil\n\t}\n\n\t// Host is not an ip, perform lookup\n\taddrs, err := lookupHostFn(host)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tfor _, addr := range addrs {\n\t\tif !net.ParseIP(addr).IsLoopback() {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\n\treturn true, nil\n}\n\nfunc localHTTPCredProvider(cfg aws.Config, handlers request.Handlers, u string) credentials.Provider {\n\tvar errMsg string\n\n\tparsed, err := url.Parse(u)\n\tif err != nil {\n\t\terrMsg = fmt.Sprintf(\"invalid URL, %v\", err)\n\t} else {\n\t\thost := aws.URLHostname(parsed)\n\t\tif len(host) == 0 {\n\t\t\terrMsg = \"unable to parse host from local HTTP cred provider URL\"\n\t\t} else if isLoopback, loopbackErr := isLoopbackHost(host); loopbackErr != nil {\n\t\t\terrMsg = fmt.Sprintf(\"failed to resolve host %q, %v\", host, loopbackErr)\n\t\t} else if !isLoopback {\n\t\t\terrMsg = fmt.Sprintf(\"invalid endpoint host, %q, only loopback hosts are allowed.\", host)\n\t\t}\n\t}\n\n\tif len(errMsg) > 0 {\n\t\tif cfg.Logger != nil {\n\t\t\tcfg.Logger.Log(\"Ignoring, HTTP credential provider\", errMsg, err)\n\t\t}\n\t\treturn credentials.ErrorProvider{\n\t\t\tErr: awserr.New(\"CredentialsEndpointError\", errMsg, err),\n\t\t\tProviderName: endpointcreds.ProviderName,\n\t\t}\n\t}\n\n\treturn httpCredProvider(cfg, handlers, u)\n}\n\nfunc httpCredProvider(cfg aws.Config, handlers request.Handlers, u string) credentials.Provider {\n\treturn endpointcreds.NewProviderClient(cfg, handlers, u,\n\t\tfunc(p *endpointcreds.Provider) {\n\t\t\tp.ExpiryWindow = 5 * time.Minute\n\t\t\tp.AuthorizationToken = os.Getenv(httpProviderAuthorizationEnvVar)\n\t\t},\n\t)\n}\n\nfunc ec2RoleProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider {\n\tresolver := cfg.EndpointResolver\n\tif resolver == nil {\n\t\tresolver = endpoints.DefaultResolver()\n\t}\n\n\te, _ := resolver.EndpointFor(endpoints.Ec2metadataServiceID, \"\")\n\treturn &ec2rolecreds.EC2RoleProvider{\n\t\tClient: ec2metadata.NewClient(cfg, handlers, e.URL, e.SigningRegion),\n\t\tExpiryWindow: 5 * time.Minute,\n\t}\n}\n"} +{"text": "// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.\n// OffscreenCanvas test in a worker:size.attributes.default\n// Description:Default width/height when attributes are missing\n// Note:\n\nimportScripts(\"/resources/testharness.js\");\nimportScripts(\"/html/canvas/resources/canvas-tests.js\");\n\nvar t = async_test(\"Default width/height when attributes are missing\");\nvar t_pass = t.done.bind(t);\nvar t_fail = t.step_func(function(reason) {\n throw reason;\n});\nt.step(function() {\n\nvar offscreenCanvas = new OffscreenCanvas(100, 50);\nvar ctx = offscreenCanvas.getContext('2d');\n\n_assertSame(offscreenCanvas.width, 100, \"offscreenCanvas.width\", \"100\");\n_assertSame(offscreenCanvas.height, 50, \"offscreenCanvas.height\", \"50\");\nt.done();\n\n});\ndone();\n"} +{"text": "// Copyright 2018 The Beam Team\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#include \"utility/message_queue.h\"\n#include \n#include \n#include \n\nusing namespace std;\nusing namespace beam;\n\nstatic const string testStr(\"some moveble data\");\n\nstruct Message {\n int n=0;\n unique_ptr d;\n};\n\nstruct SomeAsyncObject {\n io::Reactor::Ptr reactor;\n std::future f;\n\n SomeAsyncObject() :\n reactor(io::Reactor::create())\n {}\n\n void run() {\n f = std::async(\n std::launch::async,\n [this]() {\n reactor->run();\n }\n );\n }\n\n void wait() { f.get(); }\n};\n\nstruct RXThread : SomeAsyncObject {\n RX rx;\n std::vector received;\n\n RXThread() :\n rx(\n *reactor,\n [this](Message&& msg) {\n if (msg.n == 0) {\n reactor->stop();\n return;\n }\n if (*msg.d != testStr) {\n received.push_back(0);\n } else {\n received.push_back(msg.n);\n }\n }\n )\n {}\n};\n\nvoid simplex_channel_test() {\n RXThread remote;\n TX tx = remote.rx.get_tx();\n std::vector sent;\n\n remote.run();\n\n for (int i=1; i<=100500; ++i) {\n tx.send(Message { i, make_unique(testStr) } );\n sent.push_back(i);\n }\n\n tx.send(Message { 0, make_unique(testStr) } );\n\n remote.wait();\n\n assert(remote.received == sent);\n}\n\nint main() {\n simplex_channel_test();\n}\n\n"} +{"text": "//\n// CLSpotEffect.m\n//\n// Created by sho yakushiji on 2013/10/23.\n// Copyright (c) 2013年 CALACULU. All rights reserved.\n//\n\n#import \"CLSpotEffect.h\"\n\n#import \"UIView+Frame.h\"\n\n\n\n@interface CLSpotCircle : UIView\n@property (nonatomic, strong) UIColor *color;\n@end\n\n@interface CLSpotEffect()\n\n@end\n\n\n@implementation CLSpotEffect\n{\n UIView *_containerView;\n CLSpotCircle *_circleView;\n \n CGFloat _X;\n CGFloat _Y;\n CGFloat _R;\n}\n\n#pragma mark-\n\n+ (NSString*)defaultTitle\n{\n return [CLImageEditorTheme localizedString:@\"CLSpotEffect_DefaultTitle\" withDefault:@\"Spot\"];\n}\n\n+ (BOOL)isAvailable\n{\n return ([UIDevice iosVersion] >= 7.0);\n}\n\n- (id)initWithSuperView:(UIView*)superview imageViewFrame:(CGRect)frame toolInfo:(CLImageToolInfo *)info\n{\n self = [super initWithSuperView:superview imageViewFrame:frame toolInfo:info];\n if(self){\n _containerView = [[UIView alloc] initWithFrame:frame];\n [superview addSubview:_containerView];\n \n _X = 0.5;\n _Y = 0.5;\n _R = 0.5;\n \n [self setUserInterface];\n }\n return self;\n}\n\n- (void)cleanup\n{\n [_containerView removeFromSuperview];\n}\n\n- (UIImage*)applyEffect:(UIImage*)image\n{\n CIImage *ciImage = [[CIImage alloc] initWithImage:image];\n CIFilter *filter = [CIFilter filterWithName:@\"CIVignetteEffect\" keysAndValues:kCIInputImageKey, ciImage, nil];\n \n [filter setDefaults];\n \n CGFloat R = MIN(image.size.width, image.size.height) * image.scale * 0.5 * (_R + 0.1);\n CIVector *vct = [[CIVector alloc] initWithX:image.size.width * image.scale * _X Y:image.size.height * image.scale * (1 - _Y)];\n [filter setValue:vct forKey:@\"inputCenter\"];\n [filter setValue:[NSNumber numberWithFloat:R] forKey:@\"inputRadius\"];\n \n CIContext *context = [CIContext contextWithOptions:@{kCIContextUseSoftwareRenderer : @(NO)}];\n CIImage *outputImage = [filter outputImage];\n CGImageRef cgImage = [context createCGImage:outputImage fromRect:[outputImage extent]];\n \n UIImage *result = [UIImage imageWithCGImage:cgImage];\n \n CGImageRelease(cgImage);\n \n return result;\n}\n\n#pragma mark- \n\n- (void)setUserInterface\n{\n UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapContainerView:)];\n UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panContainerView:)];\n UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchContainerView:)];\n \n pan.maximumNumberOfTouches = 1;\n \n tap.delegate = self;\n //pan.delegate = self;\n pinch.delegate = self;\n \n [_containerView addGestureRecognizer:tap];\n [_containerView addGestureRecognizer:pan];\n [_containerView addGestureRecognizer:pinch];\n \n _circleView = [[CLSpotCircle alloc] init];\n _circleView.backgroundColor = [UIColor clearColor];\n _circleView.color = [UIColor whiteColor];\n [_containerView addSubview:_circleView];\n \n [self drawCircleView];\n}\n\n- (void)drawCircleView\n{\n CGFloat R = MIN(_containerView.width, _containerView.height) * (_R + 0.1) * 1.2;\n \n _circleView.width = R;\n _circleView.height = R;\n _circleView.center = CGPointMake(_containerView.width * _X, _containerView.height * _Y);\n \n [_circleView setNeedsDisplay];\n}\n\n- (void)tapContainerView:(UITapGestureRecognizer*)sender\n{\n CGPoint point = [sender locationInView:_containerView];\n _X = MIN(1.0, MAX(0.0, point.x / _containerView.width));\n _Y = MIN(1.0, MAX(0.0, point.y / _containerView.height));\n \n [self drawCircleView];\n \n if (sender.state == UIGestureRecognizerStateEnded){\n [self.delegate effectParameterDidChange:self];\n }\n}\n\n- (void)panContainerView:(UIPanGestureRecognizer*)sender\n{\n CGPoint point = [sender locationInView:_containerView];\n _X = MIN(1.0, MAX(0.0, point.x / _containerView.width));\n _Y = MIN(1.0, MAX(0.0, point.y / _containerView.height));\n \n [self drawCircleView];\n \n if (sender.state == UIGestureRecognizerStateEnded){\n [self.delegate effectParameterDidChange:self];\n }\n}\n\n- (void)pinchContainerView:(UIPinchGestureRecognizer*)sender\n{\n static CGFloat initialScale;\n if (sender.state == UIGestureRecognizerStateBegan) {\n initialScale = (_R + 0.1);\n }\n \n _R = MIN(1.1, MAX(0.1, initialScale * sender.scale)) - 0.1;\n \n [self drawCircleView];\n \n if (sender.state == UIGestureRecognizerStateEnded){\n [self.delegate effectParameterDidChange:self];\n }\n}\n\n@end\n\n\n\n\n#pragma mark- UI components\n\n@implementation CLSpotCircle\n\n- (void)setFrame:(CGRect)frame\n{\n [super setFrame:frame];\n [self setNeedsDisplay];\n}\n\n- (void)setCenter:(CGPoint)center\n{\n [super setCenter:center];\n [self setNeedsDisplay];\n}\n\n- (void)drawRect:(CGRect)rect\n{\n CGContextRef context = UIGraphicsGetCurrentContext();\n \n CGRect rct = self.bounds;\n rct.origin.x += 1;\n rct.origin.y += 1;\n rct.size.width -= 2;\n rct.size.height -= 2;\n \n CGContextSetStrokeColorWithColor(context, self.color.CGColor);\n CGContextStrokeEllipseInRect(context, rct);\n \n self.alpha = 1;\n [UIView animateWithDuration:kCLEffectToolAnimationDuration\n delay:1\n options:UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionAllowUserInteraction\n animations:^{\n self.alpha = 0;\n }\n completion:^(BOOL finished) {\n \n }\n ];\n}\n\n@end\n\n"} +{"text": "# Tectonic Installer Tests\n\n\n## Running basic tests on PRs\n\nOur basic set of tests includes:\n- Code linting\n- UI tests\n- Backend unit tests\n\nThey are run on **every** PR by default. Successful basic tests are required in\norder to merge any PRs.\n\n### Actions required\n- **none**\n\n### FAQ\n- *I am not part of the `coreos` or `coreos-inc` GitHub organization. Why are\n the tests not being executed on my changes?*\n\n Pull requests by external contributors need to be checked before they are\n tested by our Jenkins setup. Please ask a [maintainer](../MAINTAINERS) to mark\n your PR via commenting `ok to test`.\n\n- *How do I retrigger the tests?*\n\n Comment with `ok to test` on the PR.\n\n\n## Running GUI tests on PRs\n\nThe GUI tests include integration tests for the AWS and the Baremetal GUI\ninstaller.\n\n### Actions required\n- Add the `run-gui-tests` GitHub label\n\n### FAQ\n- *I am not able to add labels, what should I do?*\n\n Please ask one of the repository [maintainers](../MAINTAINERS) to add the\n labels.\n\n- *How do I retrigger the tests?*\n\n Comment with `ok to test` on the PR.\n\n- *I forgot to add the GitHub labels. Can I add them after creating the PR?*\n\n Yes, just add the GitHub labels and comment `ok to test` on the PR.\n\n\n## Running smoke / k8s-conformance tests on PRs\n\nIn addition to our basic set of tests we have smoke tests and the k8s upstream\nconformance tests. These test the Tectonic installer on our supported platforms:\n- AWS\n- Azure\n- Bare metal\n- GCP\n\n### Actions required\n- Add the `run-smoke-tests` or/and the `run-conformance-tests` GitHub label\n- Add the `platform/` GitHub label for **each** platform you want to run\n tests against\n \n### FAQ\n- *I am not able to add labels, what should I do?*\n\n Please ask one of the repository [maintainers](../MAINTAINERS) to add the\n labels.\n\n- *How do I retrigger the tests?*\n\n comment with `ok to test` on the PR.\n\n- *I forgot to add the GitHub labels. Can I add them after creating the PR?*\n\n Yes, just add the GitHub labels and comment `ok to test` on the PR.\n\n- *What if I only add the `run-smoke-tests`/`run-conformance-tests` GitHub\n label, but no `platform/` label?*\n\n No smoke / conformance tests will be executed.\n \n- *What if I trigger the tests twice in a small time frame?*\n\n Triggering the tests twice in a small time frame results in two test\n executions. The result of the most recent execution will be reported as a PR\n status in GitHub.\n\n- *What can I do in case I run into test flakes continually?*\n\n 1. Make sure the test failure is in **no** way related to your PR changes.\n Test your changes locally thoroughly.\n 2. Document the flake in Jira in the `INST` project as *issue type* \"bug\" with the\n `flake` label.\n 3. Get the approval of another person.\n 4. Merge the PR.\n\n\n## Running smoke tests / k8s-conformance tests locally\n\n### 1. Expose environment variables\n\nTo run the smoke tests / conformance tests locally you need to set the following\nenvironment variables:\n``` bash\nCLUSTER\nTF_VAR_tectonic_license_path\nTF_VAR_tectonic_pull_secret_path\nTF_VAR_tectonic_base_domain\nTF_VAR_tectonic_admin_email\nTF_VAR_tectonic_admin_password\nTECTONIC_TESTS_DONT_CLEAN_UP // If you want to keep the cluster alive after the tests\nRUN_SMOKE_TESTS=true\nRUN_CONFORMANCE_TESTS=true\nKUBE_CONFORMANCE_IMAGE=quay.io/coreos/kube-conformance:v1.7.5_coreos.0_golang1.9.1\n```\n\nAnd depending on your platform:\n\n#### AWS\n``` bash\nAWS_ACCESS_KEY_ID\nAWS_SECRET_ACCESS_KEY\nTF_VAR_tectonic_aws_ssh_key\nTF_VAR_tectonic_aws_region\n```\n\n#### Azure\n``` bash\nARM_CLIENT_ID\nARM_CLIENT_SECRET\nARM_ENVIRONMENT\nARM_SUBSCRIPTION_ID\nARM_TENANT_ID\nTF_VAR_tectonic_azure_location\n```\n\n#### GCP\n``` bash\nGOOGLE_APPLICATION_CREDENTIALS\nGOOGLE_CREDENTIALS\nGOOGLE_CLOUD_KEYFILE_JSON\nGCLOUD_KEYFILE_JSON\nGOOGLE_PROJECT\nTF_VAR_tectonic_gcp_ssh_key\n```\n\n### 2. Launch the tests\nOnce the environment variables are set, run `make tests/smoke\nTEST=aws/basic_spec.rb`, where `TEST=` represents the test spec you want to\nrun.\n"} +{"text": "require_relative '../spec_helper'\nrequire_relative '../fixtures/classes'\n\ndescribe 'TCPSocket#recv' do\n SocketSpecs.each_ip_protocol do |family, ip_address|\n before do\n @server = TCPServer.new(ip_address, 0)\n @client = TCPSocket.new(ip_address, @server.connect_address.ip_port)\n end\n\n after do\n @client.close\n @server.close\n end\n\n it 'returns the message data' do\n @client.write('hello')\n\n socket = @server.accept\n\n begin\n socket.recv(5).should == 'hello'\n ensure\n socket.close\n end\n end\n end\nend\n"} +{"text": "---\ntitle: \"ISymUnmanagedAsyncMethod::IsAsyncMethod Method\"\nms.date: \"03/30/2017\"\nms.assetid: 670a7653-dac6-4171-98ee-d669e3adf4b2\n---\n# ISymUnmanagedAsyncMethod::IsAsyncMethod Method\nChecks if the method has async information or not. \n \n If this method returns `FALSE` then it is invalid to call any other methods in this interface. They will all return `E_UNEXPECTED` in this case. \n \n## Syntax \n \n```idl \nHRESULT IsAsyncMethod( [out, retval] BOOL* pRetVal); \n``` \n \n## Parameters \n \n|Parameter|Description| \n|---------------|-----------------| \n|`pRetVal`|| \n \n## Return Value \n Returns `HRESULT`. \n \n## Requirements \n **Header:** CorSym.idl, CorSym.h \n \n## See also\n\n- [ISymUnmanagedAsyncMethod Interface](isymunmanagedasyncmethod-interface.md)\n"} +{"text": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n; Copyright(c) 2011-2016 Intel Corporation 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; * Redistributions of source code must retain the above copyright\n; notice, this list of conditions and the following disclaimer.\n; * Redistributions in binary form must reproduce the above copyright\n; notice, this list of conditions and the following disclaimer in\n; the documentation and/or other materials provided with the\n; distribution.\n; * Neither the name of Intel Corporation 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\n; routine to do AES cbc decrypt on 16n bytes doing AES by 4\n; XMM registers are clobbered. Saving/restoring must be done at a higher level\n\n; void aes_cbc_dec_128_sse(void *in,\n; uint8_t *IV,\n; uint8_t keys,\n; void *out,\n; uint64_t len_bytes);\n;\n; arg 1: IN: pointer to input (cipher text)\n; arg 2: IV: pointer to IV\n; arg 3: KEYS: pointer to keys\n; arg 4: OUT: pointer to output (plain text)\n; arg 5: LEN: length in bytes (multiple of 16)\n;\n%include \"reg_sizes.asm\"\n\n%ifidn __OUTPUT_FORMAT__, elf64\n%define IN\t\trdi\n%define IV\t\trsi\n%define KEYS\t\trdx\n%define OUT\t\trcx\n%define LEN\t\tr8\n%define func(x) x:\n%define FUNC_SAVE\n%define FUNC_RESTORE\n%endif\n\n%ifidn __OUTPUT_FORMAT__, win64\n%define IN\t\trcx\n%define IV\t\trdx\n%define KEYS\t\tr8\n%define OUT\t\tr9\n%define LEN\t\tr10\n%define PS\t\t8\n%define stack_size\t10*16 + 1*8\t; must be an odd multiple of 8\n%define arg(x)\t\t[rsp + stack_size + PS + PS*x]\n\n%define func(x) proc_frame x\n%macro FUNC_SAVE 0\n\talloc_stack\tstack_size\n\tsave_xmm128\txmm6, 0*16\n\tsave_xmm128\txmm7, 1*16\n\tsave_xmm128\txmm8, 2*16\n\tsave_xmm128\txmm9, 3*16\n\tsave_xmm128\txmm10, 4*16\n\tsave_xmm128\txmm11, 5*16\n\tsave_xmm128\txmm12, 6*16\n\tsave_xmm128\txmm13, 7*16\n\tsave_xmm128\txmm14, 8*16\n\tsave_xmm128\txmm15, 9*16\n\tend_prolog\n\tmov\tLEN, arg(4)\n%endmacro\n\n%macro FUNC_RESTORE 0\n\tmovdqa\txmm6, [rsp + 0*16]\n\tmovdqa\txmm7, [rsp + 1*16]\n\tmovdqa\txmm8, [rsp + 2*16]\n\tmovdqa\txmm9, [rsp + 3*16]\n\tmovdqa\txmm10, [rsp + 4*16]\n\tmovdqa\txmm11, [rsp + 5*16]\n\tmovdqa\txmm12, [rsp + 6*16]\n\tmovdqa\txmm13, [rsp + 7*16]\n\tmovdqa\txmm14, [rsp + 8*16]\n\tmovdqa\txmm15, [rsp + 9*16]\n\tadd\trsp, stack_size\n%endmacro\n\n%endif\n\n; configuration paramaters for AES-CBC macros\n%define KEY_ROUNDS 11\n%define XMM_USAGE (16)\n%define EARLY_BLOCKS (2)\n%define PARALLEL_BLOCKS (8)\n%define IV_CNT (1)\n\n; instruction set specific operation definitions\n%define MOVDQ movdqu\n%define PXOR pxor\n%define AES_DEC aesdec\n%define AES_DEC_LAST aesdeclast\n%include \"cbc_common.asm\"\n\nsection .text\n\nalign 16\nglobal aes_cbc_dec_128_sse:function\nfunc(aes_cbc_dec_128_sse)\n\tFUNC_SAVE\n\n FILL_KEY_CACHE CKEY_CNT, FIRST_CKEY, KEYS, MOVDQ\n\n MOVDQ reg(IV_IDX), [IV] ; Load IV for next round of block decrypt\n mov IDX, 0\n \tcmp\tLEN, PARALLEL_BLOCKS*16\n\tjge\tmain_loop ; if enough data blocks remain enter main_loop\n\tjmp partials\n\nmain_loop:\n CBC_DECRYPT_BLOCKS KEY_ROUNDS, PARALLEL_BLOCKS, EARLY_BLOCKS, MOVDQ, PXOR, AES_DEC, AES_DEC_LAST, CKEY_CNT, TMP, TMP_CNT, FIRST_CKEY, KEYS, FIRST_XDATA, IN, OUT, IDX, LEN\n\tcmp\tLEN, PARALLEL_BLOCKS*16\n\tjge\tmain_loop ; enough blocks to do another full parallel set\n\tjz done\n\npartials: ; fewer than 'PARALLEL_BLOCKS' left do in groups of 4, 2 or 1\n\tcmp\tLEN, 0\n\tje\tdone\n\tcmp\tLEN, 4*16\n\tjge\tinitial_4\n\tcmp\tLEN, 2*16\n\tjge\tinitial_2\n\ninitial_1:\n CBC_DECRYPT_BLOCKS KEY_ROUNDS, 1, EARLY_BLOCKS, MOVDQ, PXOR, AES_DEC, AES_DEC_LAST, CKEY_CNT, TMP, TMP_CNT, FIRST_CKEY, KEYS, FIRST_XDATA, IN, OUT, IDX, LEN\n\tjmp\tdone\n\ninitial_2:\n CBC_DECRYPT_BLOCKS KEY_ROUNDS, 2, EARLY_BLOCKS, MOVDQ, PXOR, AES_DEC, AES_DEC_LAST, CKEY_CNT, TMP, TMP_CNT, FIRST_CKEY, KEYS, FIRST_XDATA, IN, OUT, IDX, LEN\n\tjz done\n\tjmp\tpartials\n\ninitial_4:\n CBC_DECRYPT_BLOCKS KEY_ROUNDS, 4, EARLY_BLOCKS, MOVDQ, PXOR, AES_DEC, AES_DEC_LAST, CKEY_CNT, TMP, TMP_CNT, FIRST_CKEY, KEYS, FIRST_XDATA, IN, OUT, IDX, LEN\n\tjnz\tpartials\n\ndone:\n\tFUNC_RESTORE\n\tret\n\nendproc_frame\n"} +{"text": "\n \n \n \n \n \n \n \n \n \n \n \n"} +{"text": "package task\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"runtime\"\n)\n\n// Function is a pointer to the callback function\ntype Function interface{}\n\n// Param represents a single function parameter\ntype Param interface{}\n\n// FunctionMeta holds information about function such as name and parameters.\ntype FunctionMeta struct {\n\tName string\n\tfunction Function\n\tparams map[string]reflect.Type\n}\n\n// FuncRegistry holds the list of all registered task functions.\ntype FuncRegistry struct {\n\tfuncs map[string]FunctionMeta\n}\n\n// NewFuncRegistry will return an instance of the FuncRegistry.\nfunc NewFuncRegistry() *FuncRegistry {\n\treturn &FuncRegistry{\n\t\tfuncs: make(map[string]FunctionMeta),\n\t}\n}\n\n// Add appends the function to the registry after resolving specific information about this function.\nfunc (reg *FuncRegistry) Add(function Function) (FunctionMeta, error) {\n\tfuncValue := reflect.ValueOf(function)\n\tif funcValue.Kind() != reflect.Func {\n\t\treturn FunctionMeta{}, fmt.Errorf(\"Provided function value is not an actual function\")\n\t}\n\n\tname := runtime.FuncForPC(funcValue.Pointer()).Name()\n\tfuncInstance, err := reg.Get(name)\n\tif err == nil {\n\t\treturn funcInstance, nil\n\t}\n\treg.funcs[name] = FunctionMeta{\n\t\tName: name,\n\t\tfunction: function,\n\t\tparams: reg.resolveParamTypes(function),\n\t}\n\treturn reg.funcs[name], nil\n}\n\n// Get returns the FunctionMeta instance which holds all information about any single registered task function.\nfunc (reg *FuncRegistry) Get(name string) (FunctionMeta, error) {\n\tfunction, ok := reg.funcs[name]\n\tif ok {\n\t\treturn function, nil\n\t}\n\treturn FunctionMeta{}, fmt.Errorf(\"Function %s not found\", name)\n}\n\n// Exists checks if a function with provided name exists.\nfunc (reg *FuncRegistry) Exists(name string) bool {\n\t_, ok := reg.funcs[name]\n\tif ok {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Params returns the list of parameter types\nfunc (meta *FunctionMeta) Params() []reflect.Type {\n\tfuncType := reflect.TypeOf(meta.function)\n\tparamTypes := make([]reflect.Type, funcType.NumIn())\n\tfor idx := 0; idx < funcType.NumIn(); idx++ {\n\t\tin := funcType.In(idx)\n\t\tparamTypes[idx] = in\n\t}\n\treturn paramTypes\n}\n\nfunc (reg *FuncRegistry) resolveParamTypes(function Function) map[string]reflect.Type {\n\tparamTypes := make(map[string]reflect.Type)\n\tfuncType := reflect.TypeOf(function)\n\tfor idx := 0; idx < funcType.NumIn(); idx++ {\n\t\tin := funcType.In(idx)\n\t\tparamTypes[in.Name()] = in\n\t}\n\treturn paramTypes\n}\n"} +{"text": "{\n \"word\": \"Secretariat\",\n \"definitions\": [\n \"A permanent administrative office or department, especially a governmental one.\",\n \"The staff working in a secretariat.\"\n ],\n \"parts-of-speech\": \"Noun\"\n}"} +{"text": "//=======================================================================\n// Copyright 2001 Indiana University\n// Author: Jeremy G. Siek\n//\n// Distributed under the Boost Software License, Version 1.0. (See\n// accompanying file LICENSE_1_0.txt or copy at\n// http://www.boost.org/LICENSE_1_0.txt)\n//=======================================================================\n\n#ifndef BOOST_GRAPH_ITERATION_MACROS_HPP\n#define BOOST_GRAPH_ITERATION_MACROS_HPP\n\n#include \n\n#define BGL_CAT(x,y) x ## y\n#define BGL_RANGE(linenum) BGL_CAT(bgl_range_,linenum)\n#define BGL_FIRST(linenum) (BGL_RANGE(linenum).first)\n#define BGL_LAST(linenum) (BGL_RANGE(linenum).second)\n\n/*\n BGL_FORALL_VERTICES_T(v, g, graph_t) // This is on line 9\n expands to the following, but all on the same line\n\n for (typename boost::graph_traits::vertex_iterator \n bgl_first_9 = vertices(g).first, bgl_last_9 = vertices(g).second;\n bgl_first_9 != bgl_last_9; bgl_first_9 = bgl_last_9)\n for (typename boost::graph_traits::vertex_descriptor v;\n bgl_first_9 != bgl_last_9 ? (v = *bgl_first_9, true) : false;\n ++bgl_first_9)\n\n The purpose of having two for-loops is just to provide a place to\n declare both the iterator and value variables. There is really only\n one loop. The stopping condition gets executed two more times than it\n usually would be, oh well. The reason for the bgl_first_9 = bgl_last_9\n in the outer for-loop is in case the user puts a break statement\n in the inner for-loop.\n\n The other macros work in a similar fashion.\n\n Use the _T versions when the graph type is a template parameter or\n dependent on a template parameter. Otherwise use the non _T versions.\n \n -----------------------\n 6/9/09 THK\n \n The above contains two calls to the vertices function. I modified these\n macros to expand to\n \n for (std::pair::vertex_iterator,\n typename boost::graph_traits::vertex_iterator> bgl_range_9 = vertices(g);\n bgl_range_9.first != bgl_range_9.second;\n bgl_range_9.first = bgl_range_9.second)\n for (typename boost::graph_traits::vertex_descriptor v;\n bgl_range_9.first != bgl_range_9.second ? (v = *bgl_range_9.first, true) : false;\n ++bgl_range_9.first)\n \n */\n\n\n#define BGL_FORALL_VERTICES_T(VNAME, GNAME, GraphType) \\\nfor (std::pair::vertex_iterator, \\\n typename boost::graph_traits::vertex_iterator> BGL_RANGE(__LINE__) = vertices(GNAME); \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__); BGL_FIRST(__LINE__) = BGL_LAST(__LINE__)) \\\n for (typename boost::graph_traits::vertex_descriptor VNAME; \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__) ? (VNAME = *BGL_FIRST(__LINE__), true):false; \\\n ++BGL_FIRST(__LINE__))\n\n#define BGL_FORALL_VERTICES(VNAME, GNAME, GraphType) \\\nfor (std::pair::vertex_iterator, \\\n boost::graph_traits::vertex_iterator> BGL_RANGE(__LINE__) = vertices(GNAME); \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__); BGL_FIRST(__LINE__) = BGL_LAST(__LINE__)) \\\n for (boost::graph_traits::vertex_descriptor VNAME; \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__) ? (VNAME = *BGL_FIRST(__LINE__), true):false; \\\n ++BGL_FIRST(__LINE__))\n\n#define BGL_FORALL_EDGES_T(ENAME, GNAME, GraphType) \\\nfor (std::pair::edge_iterator, \\\n typename boost::graph_traits::edge_iterator> BGL_RANGE(__LINE__) = edges(GNAME); \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__); BGL_FIRST(__LINE__) = BGL_LAST(__LINE__)) \\\n for (typename boost::graph_traits::edge_descriptor ENAME; \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__) ? (ENAME = *BGL_FIRST(__LINE__), true):false; \\\n ++BGL_FIRST(__LINE__))\n\n#define BGL_FORALL_EDGES(ENAME, GNAME, GraphType) \\\nfor (std::pair::edge_iterator, \\\n boost::graph_traits::edge_iterator> BGL_RANGE(__LINE__) = edges(GNAME); \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__); BGL_FIRST(__LINE__) = BGL_LAST(__LINE__)) \\\n for (boost::graph_traits::edge_descriptor ENAME; \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__) ? (ENAME = *BGL_FIRST(__LINE__), true):false; \\\n ++BGL_FIRST(__LINE__))\n\n#define BGL_FORALL_ADJ_T(UNAME, VNAME, GNAME, GraphType) \\\nfor (std::pair::adjacency_iterator, \\\n typename boost::graph_traits::adjacency_iterator> BGL_RANGE(__LINE__) = adjacent_vertices(UNAME, GNAME); \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__); BGL_FIRST(__LINE__) = BGL_LAST(__LINE__)) \\\nfor (typename boost::graph_traits::vertex_descriptor VNAME; \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__) ? (VNAME = *BGL_FIRST(__LINE__), true) : false; \\\n ++BGL_FIRST(__LINE__))\n\n#define BGL_FORALL_ADJ(UNAME, VNAME, GNAME, GraphType) \\\nfor (std::pair::adjacency_iterator, \\\n boost::graph_traits::adjacency_iterator> BGL_RANGE(__LINE__) = adjacent_vertices(UNAME, GNAME); \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__); BGL_FIRST(__LINE__) = BGL_LAST(__LINE__)) \\\nfor (boost::graph_traits::vertex_descriptor VNAME; \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__) ? (VNAME = *BGL_FIRST(__LINE__), true) : false; \\\n ++BGL_FIRST(__LINE__))\n\n#define BGL_FORALL_OUTEDGES_T(UNAME, ENAME, GNAME, GraphType) \\\nfor (std::pair::out_edge_iterator, \\\n typename boost::graph_traits::out_edge_iterator> BGL_RANGE(__LINE__) = out_edges(UNAME, GNAME); \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__); BGL_FIRST(__LINE__) = BGL_LAST(__LINE__)) \\\nfor (typename boost::graph_traits::edge_descriptor ENAME; \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__) ? (ENAME = *BGL_FIRST(__LINE__), true) : false; \\\n ++BGL_FIRST(__LINE__))\n\n#define BGL_FORALL_OUTEDGES(UNAME, ENAME, GNAME, GraphType) \\\nfor (std::pair::out_edge_iterator, \\\n boost::graph_traits::out_edge_iterator> BGL_RANGE(__LINE__) = out_edges(UNAME, GNAME); \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__); BGL_FIRST(__LINE__) = BGL_LAST(__LINE__)) \\\nfor (boost::graph_traits::edge_descriptor ENAME; \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__) ? (ENAME = *BGL_FIRST(__LINE__), true) : false; \\\n ++BGL_FIRST(__LINE__))\n\n#define BGL_FORALL_INEDGES_T(UNAME, ENAME, GNAME, GraphType) \\\nfor (std::pair::in_edge_iterator, \\\n typename boost::graph_traits::in_edge_iterator> BGL_RANGE(__LINE__) = in_edges(UNAME, GNAME); \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__); BGL_FIRST(__LINE__) = BGL_LAST(__LINE__)) \\\nfor (typename boost::graph_traits::edge_descriptor ENAME; \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__) ? (ENAME = *BGL_FIRST(__LINE__), true) : false; \\\n ++BGL_FIRST(__LINE__))\n\n#define BGL_FORALL_INEDGES(UNAME, ENAME, GNAME, GraphType) \\\nfor (std::pair::in_edge_iterator, \\\n boost::graph_traits::in_edge_iterator> BGL_RANGE(__LINE__) = in_edges(UNAME, GNAME); \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__); BGL_FIRST(__LINE__) = BGL_LAST(__LINE__)) \\\nfor (boost::graph_traits::edge_descriptor ENAME; \\\n BGL_FIRST(__LINE__) != BGL_LAST(__LINE__) ? (ENAME = *BGL_FIRST(__LINE__), true) : false; \\\n ++BGL_FIRST(__LINE__))\n\n#endif // BOOST_GRAPH_ITERATION_MACROS_HPP\n"} +{"text": "/*\n * Copyright 2014 Stormpath, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.stormpath.sdk.idsite;\n\n/**\n * Enumeration identifying the possible results of an Id Site invocation.\n *\n * @since 1.1.0\n */\npublic enum IdSiteResultStatus {\n\n REGISTERED, AUTHENTICATED, LOGOUT;\n\n}\n"} +{"text": " CreateASTConsumer(CompilerInstance &CI,\n StringRef InFile) override;\n};\n\n/// \\brief Frontend action to parse model files.\n///\n/// This frontend action is responsible for parsing model files. Model files can\n/// not be parsed on their own, they rely on type information that is available\n/// in another translation unit. The parsing of model files is done by a\n/// separate compiler instance that reuses the ASTContext and othen information\n/// from the main translation unit that is being compiled. After a model file is\n/// parsed, the function definitions will be collected into a StringMap.\nclass ParseModelFileAction : public ASTFrontendAction {\npublic:\n ParseModelFileAction(llvm::StringMap &Bodies);\n bool isModelParsingAction() const override { return true; }\n\nprotected:\n std::unique_ptr CreateASTConsumer(CompilerInstance &CI,\n StringRef InFile) override;\n\nprivate:\n llvm::StringMap &Bodies;\n};\n\nvoid printCheckerHelp(raw_ostream &OS, ArrayRef plugins);\n\n} // end GR namespace\n\n} // end namespace clang\n\n#endif\n"} +{"text": "{\n \"CVE_data_meta\": {\n \"ASSIGNER\": \"cve@mitre.org\",\n \"ID\": \"CVE-2008-6259\",\n \"STATE\": \"PUBLIC\"\n },\n \"affects\": {\n \"vendor\": {\n \"vendor_data\": [\n {\n \"product\": {\n \"product_data\": [\n {\n \"product_name\": \"n/a\",\n \"version\": {\n \"version_data\": [\n {\n \"version_value\": \"n/a\"\n }\n ]\n }\n }\n ]\n },\n \"vendor_name\": \"n/a\"\n }\n ]\n }\n },\n \"data_format\": \"MITRE\",\n \"data_type\": \"CVE\",\n \"data_version\": \"4.0\",\n \"description\": {\n \"description_data\": [\n {\n \"lang\": \"eng\",\n \"value\": \"Cross-site scripting (XSS) vulnerability in search.asp in QuadComm Q-Shop 3.0, and possibly earlier, allows remote attackers to inject arbitrary web script or HTML via the srkeys parameter.\"\n }\n ]\n },\n \"problemtype\": {\n \"problemtype_data\": [\n {\n \"description\": [\n {\n \"lang\": \"eng\",\n \"value\": \"n/a\"\n }\n ]\n }\n ]\n },\n \"references\": {\n \"reference_data\": [\n {\n \"name\": \"qshop-search-xss(46650)\",\n \"refsource\": \"XF\",\n \"url\": \"https://exchange.xforce.ibmcloud.com/vulnerabilities/46650\"\n },\n {\n \"name\": \"7141\",\n \"refsource\": \"EXPLOIT-DB\",\n \"url\": \"https://www.exploit-db.com/exploits/7141\"\n },\n {\n \"name\": \"32329\",\n \"refsource\": \"BID\",\n \"url\": \"http://www.securityfocus.com/bid/32329\"\n },\n {\n \"name\": \"32742\",\n \"refsource\": \"SECUNIA\",\n \"url\": \"http://secunia.com/advisories/32742\"\n }\n ]\n }\n}"} +{"text": "package report\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/user\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n)\n\nvar (\n\texpectedItems = make(map[string]interface{})\n)\n\n// TestStart validates that a properly formated `Items` object\n// is created with the expected starting data\nfunc TestStart(t *testing.T) {\n\n\t// Set our expectations\n\tfakeTime = time.Now().UTC()\n\texpectedTime := fakeTime.Format(\"2006-01-02 15:04:05 -0700\")\n\n\texpectedUser, userErr := user.Current()\n\tif userErr != nil {\n\t\tfmt.Println(\"Unable to determine expected user\", userErr)\n\t}\n\n\texpectedHostname, hostErr := os.Hostname()\n\tif hostErr != nil {\n\t\tfmt.Println(\"Unable to determine current time\", hostErr)\n\t}\n\n\t// Put our expectations in a map for comparison\n\texpectedItems[\"StartTime\"] = fmt.Sprint(expectedTime)\n\n\texpectedItems[\"CurrentUser\"] = fmt.Sprint(expectedUser.Username)\n\n\texpectedItems[\"HostName\"] = fmt.Sprint(expectedHostname)\n\n\t// Run the `Start` function\n\tStart()\n\n\t// Compare the actual struct of items to what we expected\n\tmapsMatch := reflect.DeepEqual(expectedItems, Items)\n\n\tif !mapsMatch {\n\t\tt.Errorf(\"\\n\\nExpected:\\n\\n%#v\\n\\nReceived:\\n\\n %#v\", expectedItems, Items)\n\t}\n}\n\n// TestEnd validates that a properly formated `Items` object\n// is updated with the correct items and\nfunc TestEnd(t *testing.T) {\n\n\t// Set our expectations\n\tfakeTime = time.Now().UTC()\n\texpectedTime := fakeTime.Format(\"2006-01-02 15:04:05 -0700\")\n\texpectedInstalls := []interface{}{\"test Installs 1\", \"test Installs 2\", \"test Installs 3\", \"test Installs 4\"}\n\texpectedUninstalls := []interface{}{\"test Uninstalls 1\", \"test Uninstalls 2\", \"test Uninstalls 3\", \"test Uninstalls 4\"}\n\n\t// Apend everything tp the correct lists\n\tInstalledItems = append(InstalledItems, expectedInstalls...)\n\tUninstalledItems = append(UninstalledItems, expectedUninstalls...)\n\n\t// Update the existing map for comparison\n\texpectedItems[\"EndTime\"] = fmt.Sprint(expectedTime)\n\texpectedItems[\"InstalledItems\"] = InstalledItems\n\texpectedItems[\"UninstalledItems\"] = UninstalledItems\n\n\t// Run the `End` function\n\tEnd()\n\n\t// Compare the actual results\n\tmapsMatch := reflect.DeepEqual(expectedItems, Items)\n\n\tif !mapsMatch {\n\t\tt.Errorf(\"\\n\\nExpected:\\n\\n%#v\\n\\nReceived:\\n\\n %#v\", expectedItems, Items)\n\t}\n}\n"} +{"text": "\n\n\n\t\n\t\t\n\n\t\t\n\t\n\n\t\n\n\t\t\n\n\t\n"} +{"text": "zap = $zap;\n\t}\n\n\tpublic function usersList($contextid=NULL) {\n\t\t$params = array();\n\t\tif ($contextid !== NULL) {\n\t\t\t$params['contextId'] = $contextid;\n\t\t}\n\t\treturn $this->zap->request($this->zap->base . 'users/view/usersList/', $params)->{'usersList'};\n\t}\n\n\tpublic function getUserById($contextid=NULL, $userid=NULL) {\n\t\t$params = array();\n\t\tif ($contextid !== NULL) {\n\t\t\t$params['contextId'] = $contextid;\n\t\t}\n\t\tif ($userid !== NULL) {\n\t\t\t$params['userId'] = $userid;\n\t\t}\n\t\treturn $this->zap->request($this->zap->base . 'users/view/getUserById/', $params)->{'getUserById'};\n\t}\n\n\tpublic function getAuthenticationCredentialsConfigParams($contextid) {\n\t\treturn $this->zap->request($this->zap->base . 'users/view/getAuthenticationCredentialsConfigParams/', array('contextId' => $contextid))->{'getAuthenticationCredentialsConfigParams'};\n\t}\n\n\tpublic function getAuthenticationCredentials($contextid, $userid) {\n\t\treturn $this->zap->request($this->zap->base . 'users/view/getAuthenticationCredentials/', array('contextId' => $contextid, 'userId' => $userid))->{'getAuthenticationCredentials'};\n\t}\n\n\tpublic function newUser($contextid, $name, $apikey='') {\n\t\treturn $this->zap->request($this->zap->base . 'users/action/newUser/', array('contextId' => $contextid, 'name' => $name, 'apikey' => $apikey));\n\t}\n\n\tpublic function removeUser($contextid, $userid, $apikey='') {\n\t\treturn $this->zap->request($this->zap->base . 'users/action/removeUser/', array('contextId' => $contextid, 'userId' => $userid, 'apikey' => $apikey));\n\t}\n\n\tpublic function setUserEnabled($contextid, $userid, $enabled, $apikey='') {\n\t\treturn $this->zap->request($this->zap->base . 'users/action/setUserEnabled/', array('contextId' => $contextid, 'userId' => $userid, 'enabled' => $enabled, 'apikey' => $apikey));\n\t}\n\n\tpublic function setUserName($contextid, $userid, $name, $apikey='') {\n\t\treturn $this->zap->request($this->zap->base . 'users/action/setUserName/', array('contextId' => $contextid, 'userId' => $userid, 'name' => $name, 'apikey' => $apikey));\n\t}\n\n\tpublic function setAuthenticationCredentials($contextid, $userid, $authcredentialsconfigparams=NULL, $apikey='') {\n\t\t$params = array('contextId' => $contextid, 'userId' => $userid, 'apikey' => $apikey);\n\t\tif ($authcredentialsconfigparams !== NULL) {\n\t\t\t$params['authCredentialsConfigParams'] = $authcredentialsconfigparams;\n\t\t}\n\t\treturn $this->zap->request($this->zap->base . 'users/action/setAuthenticationCredentials/', $params);\n\t}\n\n}\n"} +{"text": "# NiceHash Miner\n## Testing build flags:\n\nDefine **SWITCH_TESTING** in Properties/Build/Conditional compilation symbols to enable miner switch testing. Aditional options are in **SwitchTesting.cs**.\n\n## Aditional build steps:\nMake sure to copy OpenCLDeviceDetection.exe, CudaDeviceDetection.exe and nvml.dll to NHM.exe folder.\n\n## Bins Paths codegen\nUse /codegen/genBins.py ('python genBins.py > BINS_CODEGEN.cs') to generate miner bins BINS_CODEGEN.cs file. Copy BINS_CODEGEN.cs to NiceHashMiner/Utils folder."} +{"text": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors. All rights reserved.\n// https://github.com/golang/protobuf\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\npackage proto\n\n/*\n * Types and routines for supporting protocol buffer extensions.\n */\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"sync\"\n)\n\n// ErrMissingExtension is the error returned by GetExtension if the named extension is not in the message.\nvar ErrMissingExtension = errors.New(\"proto: missing extension\")\n\n// ExtensionRange represents a range of message extensions for a protocol buffer.\n// Used in code generated by the protocol compiler.\ntype ExtensionRange struct {\n\tStart, End int32 // both inclusive\n}\n\n// extendableProto is an interface implemented by any protocol buffer generated by the current\n// proto compiler that may be extended.\ntype extendableProto interface {\n\tMessage\n\tExtensionRangeArray() []ExtensionRange\n\textensionsWrite() map[int32]Extension\n\textensionsRead() (map[int32]Extension, sync.Locker)\n}\n\n// extendableProtoV1 is an interface implemented by a protocol buffer generated by the previous\n// version of the proto compiler that may be extended.\ntype extendableProtoV1 interface {\n\tMessage\n\tExtensionRangeArray() []ExtensionRange\n\tExtensionMap() map[int32]Extension\n}\n\n// extensionAdapter is a wrapper around extendableProtoV1 that implements extendableProto.\ntype extensionAdapter struct {\n\textendableProtoV1\n}\n\nfunc (e extensionAdapter) extensionsWrite() map[int32]Extension {\n\treturn e.ExtensionMap()\n}\n\nfunc (e extensionAdapter) extensionsRead() (map[int32]Extension, sync.Locker) {\n\treturn e.ExtensionMap(), notLocker{}\n}\n\n// notLocker is a sync.Locker whose Lock and Unlock methods are nops.\ntype notLocker struct{}\n\nfunc (n notLocker) Lock() {}\nfunc (n notLocker) Unlock() {}\n\n// extendable returns the extendableProto interface for the given generated proto message.\n// If the proto message has the old extension format, it returns a wrapper that implements\n// the extendableProto interface.\nfunc extendable(p interface{}) (extendableProto, bool) {\n\tif ep, ok := p.(extendableProto); ok {\n\t\treturn ep, ok\n\t}\n\tif ep, ok := p.(extendableProtoV1); ok {\n\t\treturn extensionAdapter{ep}, ok\n\t}\n\treturn nil, false\n}\n\n// XXX_InternalExtensions is an internal representation of proto extensions.\n//\n// Each generated message struct type embeds an anonymous XXX_InternalExtensions field,\n// thus gaining the unexported 'extensions' method, which can be called only from the proto package.\n//\n// The methods of XXX_InternalExtensions are not concurrency safe in general,\n// but calls to logically read-only methods such as has and get may be executed concurrently.\ntype XXX_InternalExtensions struct {\n\t// The struct must be indirect so that if a user inadvertently copies a\n\t// generated message and its embedded XXX_InternalExtensions, they\n\t// avoid the mayhem of a copied mutex.\n\t//\n\t// The mutex serializes all logically read-only operations to p.extensionMap.\n\t// It is up to the client to ensure that write operations to p.extensionMap are\n\t// mutually exclusive with other accesses.\n\tp *struct {\n\t\tmu sync.Mutex\n\t\textensionMap map[int32]Extension\n\t}\n}\n\n// extensionsWrite returns the extension map, creating it on first use.\nfunc (e *XXX_InternalExtensions) extensionsWrite() map[int32]Extension {\n\tif e.p == nil {\n\t\te.p = new(struct {\n\t\t\tmu sync.Mutex\n\t\t\textensionMap map[int32]Extension\n\t\t})\n\t\te.p.extensionMap = make(map[int32]Extension)\n\t}\n\treturn e.p.extensionMap\n}\n\n// extensionsRead returns the extensions map for read-only use. It may be nil.\n// The caller must hold the returned mutex's lock when accessing Elements within the map.\nfunc (e *XXX_InternalExtensions) extensionsRead() (map[int32]Extension, sync.Locker) {\n\tif e.p == nil {\n\t\treturn nil, nil\n\t}\n\treturn e.p.extensionMap, &e.p.mu\n}\n\nvar extendableProtoType = reflect.TypeOf((*extendableProto)(nil)).Elem()\nvar extendableProtoV1Type = reflect.TypeOf((*extendableProtoV1)(nil)).Elem()\n\n// ExtensionDesc represents an extension specification.\n// Used in generated code from the protocol compiler.\ntype ExtensionDesc struct {\n\tExtendedType Message // nil pointer to the type that is being extended\n\tExtensionType interface{} // nil pointer to the extension type\n\tField int32 // field number\n\tName string // fully-qualified name of extension, for text formatting\n\tTag string // protobuf tag style\n\tFilename string // name of the file in which the extension is defined\n}\n\nfunc (ed *ExtensionDesc) repeated() bool {\n\tt := reflect.TypeOf(ed.ExtensionType)\n\treturn t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8\n}\n\n// Extension represents an extension in a message.\ntype Extension struct {\n\t// When an extension is stored in a message using SetExtension\n\t// only desc and value are set. When the message is marshaled\n\t// enc will be set to the encoded form of the message.\n\t//\n\t// When a message is unmarshaled and contains extensions, each\n\t// extension will have only enc set. When such an extension is\n\t// accessed using GetExtension (or GetExtensions) desc and value\n\t// will be set.\n\tdesc *ExtensionDesc\n\tvalue interface{}\n\tenc []byte\n}\n\n// SetRawExtension is for testing only.\nfunc SetRawExtension(base Message, id int32, b []byte) {\n\tepb, ok := extendable(base)\n\tif !ok {\n\t\treturn\n\t}\n\textmap := epb.extensionsWrite()\n\textmap[id] = Extension{enc: b}\n}\n\n// isExtensionField returns true iff the given field number is in an extension range.\nfunc isExtensionField(pb extendableProto, field int32) bool {\n\tfor _, er := range pb.ExtensionRangeArray() {\n\t\tif er.Start <= field && field <= er.End {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// checkExtensionTypes checks that the given extension is valid for pb.\nfunc checkExtensionTypes(pb extendableProto, extension *ExtensionDesc) error {\n\tvar pbi interface{} = pb\n\t// Check the extended type.\n\tif ea, ok := pbi.(extensionAdapter); ok {\n\t\tpbi = ea.extendableProtoV1\n\t}\n\tif a, b := reflect.TypeOf(pbi), reflect.TypeOf(extension.ExtendedType); a != b {\n\t\treturn errors.New(\"proto: bad extended type; \" + b.String() + \" does not extend \" + a.String())\n\t}\n\t// Check the range.\n\tif !isExtensionField(pb, extension.Field) {\n\t\treturn errors.New(\"proto: bad extension number; not in declared ranges\")\n\t}\n\treturn nil\n}\n\n// extPropKey is sufficient to uniquely identify an extension.\ntype extPropKey struct {\n\tbase reflect.Type\n\tfield int32\n}\n\nvar extProp = struct {\n\tsync.RWMutex\n\tm map[extPropKey]*Properties\n}{\n\tm: make(map[extPropKey]*Properties),\n}\n\nfunc extensionProperties(ed *ExtensionDesc) *Properties {\n\tkey := extPropKey{base: reflect.TypeOf(ed.ExtendedType), field: ed.Field}\n\n\textProp.RLock()\n\tif prop, ok := extProp.m[key]; ok {\n\t\textProp.RUnlock()\n\t\treturn prop\n\t}\n\textProp.RUnlock()\n\n\textProp.Lock()\n\tdefer extProp.Unlock()\n\t// Check again.\n\tif prop, ok := extProp.m[key]; ok {\n\t\treturn prop\n\t}\n\n\tprop := new(Properties)\n\tprop.Init(reflect.TypeOf(ed.ExtensionType), \"unknown_name\", ed.Tag, nil)\n\textProp.m[key] = prop\n\treturn prop\n}\n\n// encode encodes any unmarshaled (unencoded) extensions in e.\nfunc encodeExtensions(e *XXX_InternalExtensions) error {\n\tm, mu := e.extensionsRead()\n\tif m == nil {\n\t\treturn nil // fast path\n\t}\n\tmu.Lock()\n\tdefer mu.Unlock()\n\treturn encodeExtensionsMap(m)\n}\n\n// encode encodes any unmarshaled (unencoded) extensions in e.\nfunc encodeExtensionsMap(m map[int32]Extension) error {\n\tfor k, e := range m {\n\t\tif e.value == nil || e.desc == nil {\n\t\t\t// Extension is only in its encoded form.\n\t\t\tcontinue\n\t\t}\n\n\t\t// We don't skip extensions that have an encoded form set,\n\t\t// because the extension value may have been mutated after\n\t\t// the last time this function was called.\n\n\t\tet := reflect.TypeOf(e.desc.ExtensionType)\n\t\tprops := extensionProperties(e.desc)\n\n\t\tp := NewBuffer(nil)\n\t\t// If e.value has type T, the encoder expects a *struct{ X T }.\n\t\t// Pass a *T with a zero field and hope it all works out.\n\t\tx := reflect.New(et)\n\t\tx.Elem().Set(reflect.ValueOf(e.value))\n\t\tif err := props.enc(p, props, toStructPointer(x)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\te.enc = p.buf\n\t\tm[k] = e\n\t}\n\treturn nil\n}\n\nfunc extensionsSize(e *XXX_InternalExtensions) (n int) {\n\tm, mu := e.extensionsRead()\n\tif m == nil {\n\t\treturn 0\n\t}\n\tmu.Lock()\n\tdefer mu.Unlock()\n\treturn extensionsMapSize(m)\n}\n\nfunc extensionsMapSize(m map[int32]Extension) (n int) {\n\tfor _, e := range m {\n\t\tif e.value == nil || e.desc == nil {\n\t\t\t// Extension is only in its encoded form.\n\t\t\tn += len(e.enc)\n\t\t\tcontinue\n\t\t}\n\n\t\t// We don't skip extensions that have an encoded form set,\n\t\t// because the extension value may have been mutated after\n\t\t// the last time this function was called.\n\n\t\tet := reflect.TypeOf(e.desc.ExtensionType)\n\t\tprops := extensionProperties(e.desc)\n\n\t\t// If e.value has type T, the encoder expects a *struct{ X T }.\n\t\t// Pass a *T with a zero field and hope it all works out.\n\t\tx := reflect.New(et)\n\t\tx.Elem().Set(reflect.ValueOf(e.value))\n\t\tn += props.size(props, toStructPointer(x))\n\t}\n\treturn\n}\n\n// HasExtension returns whether the given extension is present in pb.\nfunc HasExtension(pb Message, extension *ExtensionDesc) bool {\n\t// TODO: Check types, field numbers, etc.?\n\tepb, ok := extendable(pb)\n\tif !ok {\n\t\treturn false\n\t}\n\textmap, mu := epb.extensionsRead()\n\tif extmap == nil {\n\t\treturn false\n\t}\n\tmu.Lock()\n\t_, ok = extmap[extension.Field]\n\tmu.Unlock()\n\treturn ok\n}\n\n// ClearExtension removes the given extension from pb.\nfunc ClearExtension(pb Message, extension *ExtensionDesc) {\n\tepb, ok := extendable(pb)\n\tif !ok {\n\t\treturn\n\t}\n\t// TODO: Check types, field numbers, etc.?\n\textmap := epb.extensionsWrite()\n\tdelete(extmap, extension.Field)\n}\n\n// GetExtension parses and returns the given extension of pb.\n// If the extension is not present and has no default value it returns ErrMissingExtension.\nfunc GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {\n\tepb, ok := extendable(pb)\n\tif !ok {\n\t\treturn nil, errors.New(\"proto: not an extendable proto\")\n\t}\n\n\tif err := checkExtensionTypes(epb, extension); err != nil {\n\t\treturn nil, err\n\t}\n\n\temap, mu := epb.extensionsRead()\n\tif emap == nil {\n\t\treturn defaultExtensionValue(extension)\n\t}\n\tmu.Lock()\n\tdefer mu.Unlock()\n\te, ok := emap[extension.Field]\n\tif !ok {\n\t\t// defaultExtensionValue returns the default value or\n\t\t// ErrMissingExtension if there is no default.\n\t\treturn defaultExtensionValue(extension)\n\t}\n\n\tif e.value != nil {\n\t\t// Already decoded. Check the descriptor, though.\n\t\tif e.desc != extension {\n\t\t\t// This shouldn't happen. If it does, it means that\n\t\t\t// GetExtension was called twice with two different\n\t\t\t// descriptors with the same field number.\n\t\t\treturn nil, errors.New(\"proto: descriptor conflict\")\n\t\t}\n\t\treturn e.value, nil\n\t}\n\n\tv, err := decodeExtension(e.enc, extension)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Remember the decoded version and drop the encoded version.\n\t// That way it is safe to mutate what we return.\n\te.value = v\n\te.desc = extension\n\te.enc = nil\n\temap[extension.Field] = e\n\treturn e.value, nil\n}\n\n// defaultExtensionValue returns the default value for extension.\n// If no default for an extension is defined ErrMissingExtension is returned.\nfunc defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) {\n\tt := reflect.TypeOf(extension.ExtensionType)\n\tprops := extensionProperties(extension)\n\n\tsf, _, err := fieldDefault(t, props)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif sf == nil || sf.value == nil {\n\t\t// There is no default value.\n\t\treturn nil, ErrMissingExtension\n\t}\n\n\tif t.Kind() != reflect.Ptr {\n\t\t// We do not need to return a Ptr, we can directly return sf.value.\n\t\treturn sf.value, nil\n\t}\n\n\t// We need to return an interface{} that is a pointer to sf.value.\n\tvalue := reflect.New(t).Elem()\n\tvalue.Set(reflect.New(value.Type().Elem()))\n\tif sf.kind == reflect.Int32 {\n\t\t// We may have an int32 or an enum, but the underlying data is int32.\n\t\t// Since we can't set an int32 into a non int32 reflect.value directly\n\t\t// set it as a int32.\n\t\tvalue.Elem().SetInt(int64(sf.value.(int32)))\n\t} else {\n\t\tvalue.Elem().Set(reflect.ValueOf(sf.value))\n\t}\n\treturn value.Interface(), nil\n}\n\n// decodeExtension decodes an extension encoded in b.\nfunc decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) {\n\to := NewBuffer(b)\n\n\tt := reflect.TypeOf(extension.ExtensionType)\n\n\tprops := extensionProperties(extension)\n\n\t// t is a pointer to a struct, pointer to basic type or a slice.\n\t// Allocate a \"field\" to store the pointer/slice itself; the\n\t// pointer/slice will be stored here. We pass\n\t// the address of this field to props.dec.\n\t// This passes a zero field and a *t and lets props.dec\n\t// interpret it as a *struct{ x t }.\n\tvalue := reflect.New(t).Elem()\n\n\tfor {\n\t\t// Discard wire type and field number varint. It isn't needed.\n\t\tif _, err := o.DecodeVarint(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif err := props.dec(o, props, toStructPointer(value.Addr())); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif o.index >= len(o.buf) {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn value.Interface(), nil\n}\n\n// GetExtensions returns a slice of the extensions present in pb that are also listed in es.\n// The returned slice has the same length as es; missing extensions will appear as nil elements.\nfunc GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interface{}, err error) {\n\tepb, ok := extendable(pb)\n\tif !ok {\n\t\treturn nil, errors.New(\"proto: not an extendable proto\")\n\t}\n\textensions = make([]interface{}, len(es))\n\tfor i, e := range es {\n\t\textensions[i], err = GetExtension(epb, e)\n\t\tif err == ErrMissingExtension {\n\t\t\terr = nil\n\t\t}\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}\n\n// ExtensionDescs returns a new slice containing pb's extension descriptors, in undefined order.\n// For non-registered extensions, ExtensionDescs returns an incomplete descriptor containing\n// just the Field field, which defines the extension's field number.\nfunc ExtensionDescs(pb Message) ([]*ExtensionDesc, error) {\n\tepb, ok := extendable(pb)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"proto: %T is not an extendable proto.Message\", pb)\n\t}\n\tregisteredExtensions := RegisteredExtensions(pb)\n\n\temap, mu := epb.extensionsRead()\n\tif emap == nil {\n\t\treturn nil, nil\n\t}\n\tmu.Lock()\n\tdefer mu.Unlock()\n\textensions := make([]*ExtensionDesc, 0, len(emap))\n\tfor extid, e := range emap {\n\t\tdesc := e.desc\n\t\tif desc == nil {\n\t\t\tdesc = registeredExtensions[extid]\n\t\t\tif desc == nil {\n\t\t\t\tdesc = &ExtensionDesc{Field: extid}\n\t\t\t}\n\t\t}\n\n\t\textensions = append(extensions, desc)\n\t}\n\treturn extensions, nil\n}\n\n// SetExtension sets the specified extension of pb to the specified value.\nfunc SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error {\n\tepb, ok := extendable(pb)\n\tif !ok {\n\t\treturn errors.New(\"proto: not an extendable proto\")\n\t}\n\tif err := checkExtensionTypes(epb, extension); err != nil {\n\t\treturn err\n\t}\n\ttyp := reflect.TypeOf(extension.ExtensionType)\n\tif typ != reflect.TypeOf(value) {\n\t\treturn errors.New(\"proto: bad extension value type\")\n\t}\n\t// nil extension values need to be caught early, because the\n\t// encoder can't distinguish an ErrNil due to a nil extension\n\t// from an ErrNil due to a missing field. Extensions are\n\t// always optional, so the encoder would just swallow the error\n\t// and drop all the extensions from the encoded message.\n\tif reflect.ValueOf(value).IsNil() {\n\t\treturn fmt.Errorf(\"proto: SetExtension called with nil value of type %T\", value)\n\t}\n\n\textmap := epb.extensionsWrite()\n\textmap[extension.Field] = Extension{desc: extension, value: value}\n\treturn nil\n}\n\n// ClearAllExtensions clears all extensions from pb.\nfunc ClearAllExtensions(pb Message) {\n\tepb, ok := extendable(pb)\n\tif !ok {\n\t\treturn\n\t}\n\tm := epb.extensionsWrite()\n\tfor k := range m {\n\t\tdelete(m, k)\n\t}\n}\n\n// A global registry of extensions.\n// The generated code will register the generated descriptors by calling RegisterExtension.\n\nvar extensionMaps = make(map[reflect.Type]map[int32]*ExtensionDesc)\n\n// RegisterExtension is called from the generated code.\nfunc RegisterExtension(desc *ExtensionDesc) {\n\tst := reflect.TypeOf(desc.ExtendedType).Elem()\n\tm := extensionMaps[st]\n\tif m == nil {\n\t\tm = make(map[int32]*ExtensionDesc)\n\t\textensionMaps[st] = m\n\t}\n\tif _, ok := m[desc.Field]; ok {\n\t\tpanic(\"proto: duplicate extension registered: \" + st.String() + \" \" + strconv.Itoa(int(desc.Field)))\n\t}\n\tm[desc.Field] = desc\n}\n\n// RegisteredExtensions returns a map of the registered extensions of a\n// protocol buffer struct, indexed by the extension number.\n// The argument pb should be a nil pointer to the struct type.\nfunc RegisteredExtensions(pb Message) map[int32]*ExtensionDesc {\n\treturn extensionMaps[reflect.TypeOf(pb).Elem()]\n}\n"} +{"text": "# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4\n\nPortSystem 1.0\nPortGroup perl5 1.0\n\nperl5.branches 5.26 5.28 5.30\nperl5.setup Text-Aligner 0.16\n\nplatforms darwin\nmaintainers nomaintainer\nlicense ISC\n\ndescription A module to align text\nlong_description Exports a single function, align(), which is used to justify strings to various alignment styles\n\nchecksums rmd160 7d1fa36d6a0a83573406868c786c0d3d647f2827 \\\n sha256 5c857dbce586f57fa3d7c4ebd320023ab3b2963b2049428ae01bd3bc4f215725 \\\n size 15911\n\nif {${perl5.major} != \"\"} {\n depends_lib-append \\\n port:p${perl5.major}-term-ansicolor\n \n supported_archs noarch\n perl5.use_module_build\n}\n"} +{"text": "\nvar assert = require('assert');\nvar delegate = require('..');\n\ndescribe('.method(name)', function(){\n it('should delegate methods', function(){\n var obj = {};\n\n obj.request = {\n foo: function(bar){\n assert(this == obj.request);\n return bar;\n }\n };\n\n delegate(obj, 'request').method('foo');\n\n obj.foo('something').should.equal('something');\n })\n})\n\ndescribe('.getter(name)', function(){\n it('should delegate getters', function(){\n var obj = {};\n\n obj.request = {\n get type() {\n return 'text/html';\n }\n }\n\n delegate(obj, 'request').getter('type');\n\n obj.type.should.equal('text/html');\n })\n})\n\ndescribe('.setter(name)', function(){\n it('should delegate setters', function(){\n var obj = {};\n\n obj.request = {\n get type() {\n return this._type.toUpperCase();\n },\n\n set type(val) {\n this._type = val;\n }\n }\n\n delegate(obj, 'request').setter('type');\n\n obj.type = 'hey';\n obj.request.type.should.equal('HEY');\n })\n})\n\ndescribe('.access(name)', function(){\n it('should delegate getters and setters', function(){\n var obj = {};\n\n obj.request = {\n get type() {\n return this._type.toUpperCase();\n },\n\n set type(val) {\n this._type = val;\n }\n }\n\n delegate(obj, 'request').access('type');\n\n obj.type = 'hey';\n obj.type.should.equal('HEY');\n })\n})\n\ndescribe('.fluent(name)', function () {\n it('should delegate in a fluent fashion', function () {\n var obj = {\n settings: {\n env: 'development'\n }\n };\n\n delegate(obj, 'settings').fluent('env');\n\n obj.env().should.equal('development');\n obj.env('production').should.equal(obj);\n obj.settings.env.should.equal('production');\n })\n})\n"} +{"text": "/* -----------------------------------------------------------------------------\n * swig.swg\n *\n * Common macro definitions for various SWIG directives. This file is always \n * included at the top of each input file.\n * ----------------------------------------------------------------------------- */\n\n/* -----------------------------------------------------------------------------\n * User Directives \n * ----------------------------------------------------------------------------- */\n\n/* Deprecated SWIG-1.1 directives */\n\n#define %disabledoc %warn \"104:%disabledoc is deprecated\"\n#define %enabledoc %warn \"105:%enabledoc is deprecated\"\n#define %doconly %warn \"106:%doconly is deprecated\"\n#define %style %warn \"107:%style is deprecated\" /##/\n#define %localstyle %warn \"108:%localstyle is deprecated\" /##/\n#define %title %warn \"109:%title is deprecated\" /##/\n#define %section %warn \"110:%section is deprecated\" /##/\n#define %subsection %warn \"111:%subsection is deprecated\" /##/\n#define %subsubsection %warn \"112:%subsubsection is deprecated\" /##/\n#define %new %warn \"117:%new is deprecated. Use %newobject\"\n#define %text %insert(\"null\")\n\n/* Code insertion directives such as %wrapper %{ ... %} */\n\n#define %begin %insert(\"begin\")\n#define %runtime %insert(\"runtime\")\n#define %header %insert(\"header\")\n#define %wrapper %insert(\"wrapper\")\n#define %init %insert(\"init\")\n\n/* Class extension */\n\n#define %addmethods %warn \"113:%addmethods is now %extend\" %extend\n\n/* %ignore directive */\n\n#define %ignore %rename($ignore)\n#define %ignorewarn(x) %rename(\"$ignore:\" x)\n\n/* Access control directives */\n\n#define %readonly %warn \"114:%readonly is deprecated. Use %immutable; \" %feature(\"immutable\");\n#define %readwrite %warn \"115:%readwrite is deprecated. Use %mutable; \" %feature(\"immutable\",\"\");\n\n#define %immutable %feature(\"immutable\")\n#define %noimmutable %feature(\"immutable\",\"0\")\n#define %clearimmutable %feature(\"immutable\",\"\")\n#define %mutable %clearimmutable\n\n/* Generation of default constructors/destructors (old form, don't use) */\n#define %nodefault %feature(\"nodefault\",\"1\")\n#define %default %feature(\"nodefault\",\"0\")\n#define %clearnodefault %feature(\"nodefault\",\"\")\n#define %makedefault %clearnodefault\n\n/* Disable the generation of implicit default constructor */\n#define %nodefaultctor %feature(\"nodefaultctor\",\"1\")\n#define %defaultctor %feature(\"nodefaultctor\",\"0\")\n#define %clearnodefaultctor %feature(\"nodefaultctor\",\"\")\n\n/* Disable the generation of implicit default destructor (dangerous) */\n#define %nodefaultdtor %feature(\"nodefaultdtor\",\"1\")\n#define %defaultdtor %feature(\"nodefaultdtor\",\"0\")\n#define %clearnodefaultdtor %feature(\"nodefaultdtor\",\"\")\n\n/* Enable the generation of copy constructor */\n#define %copyctor %feature(\"copyctor\",\"1\")\n#define %nocopyctor %feature(\"copyctor\",\"0\")\n#define %clearcopyctor %feature(\"copyctor\",\"\")\n\n/* Force the old nodefault behavior, ie disable both constructor and destructor */\n#define %oldnodefault %feature(\"oldnodefault\",\"1\")\n#define %nooldnodefault %feature(\"oldnodefault\",\"0\")\n#define %clearoldnodefault %feature(\"oldnodefault\",\"\")\n\n/* the %exception directive */\n#if defined(SWIGCSHARP) || defined(SWIGD)\n#define %exception %feature(\"except\", canthrow=1)\n#else\n#define %exception %feature(\"except\")\n#endif\n#define %noexception %feature(\"except\",\"0\")\n#define %clearexception %feature(\"except\",\"\")\n\n/* the %allowexception directive allows the %exception feature to\n be applied to set/get variable methods */\n#define %allowexception %feature(\"allowexcept\")\n#define %noallowexception %feature(\"allowexcept\",\"0\")\n#define %clearallowexception %feature(\"allowexcept\",\"\")\n\n/* the %exceptionvar directive, as %exception but it is only applied\n to set/get variable methods. You don't need to use the\n %allowexception directive when using %exceptionvar.\n*/\n#if defined(SWIGCSHARP) || defined(SWIGD)\n#define %exceptionvar %feature(\"exceptvar\", canthrow=1)\n#else\n#define %exceptionvar %feature(\"exceptvar\")\n#endif\n#define %noexceptionvar %feature(\"exceptvar\",\"0\")\n#define %clearexceptionvar %feature(\"exceptvar\",\"\")\n\n/* the %catches directive */\n#define %catches(tlist...) %feature(\"catches\",\"(\"`tlist`\")\")\n#define %clearcatches %feature(\"catches\",\"\")\n\n/* the %exceptionclass directive */\n#define %exceptionclass %feature(\"exceptionclass\")\n#define %noexceptionclass %feature(\"exceptionclass\",\"0\")\n#define %clearexceptionclass %feature(\"exceptionclass\",\"\")\n\n/* the %newobject directive */\n#define %newobject %feature(\"new\")\n#define %nonewobject %feature(\"new\",\"0\")\n#define %clearnewobject %feature(\"new\",\"\")\n\n/* the %delobject directive */\n#define %delobject %feature(\"del\")\n#define %nodelobject %feature(\"del\",\"0\")\n#define %cleardelobject %feature(\"del\",\"\")\n\n/* the %refobject/%unrefobject directives */\n#define %refobject %feature(\"ref\")\n#define %norefobject %feature(\"ref\",\"0\")\n#define %clearrefobject %feature(\"ref\",\"\")\n\n#define %unrefobject %feature(\"unref\")\n#define %nounrefobject %feature(\"unref\",\"0\")\n#define %clearunrefobject %feature(\"unref\",\"\")\n\n/* Directives for callback functions (experimental) */\n#define %callback(x) %feature(\"callback\",`x`)\n#define %nocallback %feature(\"callback\",\"0\")\n#define %clearcallback %feature(\"callback\",\"\")\n\n/* the %nestedworkaround directive (deprecated) */\n#define %nestedworkaround %feature(\"nestedworkaround\")\n#define %nonestedworkaround %feature(\"nestedworkaround\",\"0\")\n#define %clearnestedworkaround %feature(\"nestedworkaround\",\"\")\n\n/* the %flatnested directive */\n#define %flatnested %feature(\"flatnested\")\n#define %noflatnested %feature(\"flatnested\",\"0\")\n#define %clearflatnested %feature(\"flatnested\",\"\")\n\n/* the %fastdispatch directive */\n#define %fastdispatch %feature(\"fastdispatch\")\n#define %nofastdispatch %feature(\"fastdispatch\",\"0\")\n#define %clearfastdispatch %feature(\"fastdispatch\",\"\")\n\n/* directors directives */\n#define %director %feature(\"director\")\n#define %nodirector %feature(\"director\",\"0\")\n#define %cleardirector %feature(\"director\",\"\")\n\n/* naturalvar directives */\n#define %naturalvar %feature(\"naturalvar\")\n#define %nonaturalvar %feature(\"naturalvar\",\"0\")\n#define %clearnaturalvar %feature(\"naturalvar\",\"\")\n\n/* nspace directives */\n#define %nspace %feature(\"nspace\")\n#define %nonspace %feature(\"nspace\",\"0\")\n#define %clearnspace %feature(\"nspace\",\"\")\n\n/* valuewrapper directives */\n#define %valuewrapper %feature(\"valuewrapper\")\n#define %clearvaluewrapper %feature(\"valuewrapper\",\"\")\n#define %novaluewrapper %feature(\"novaluewrapper\")\n#define %clearnovaluewrapper %feature(\"novaluewrapper\",\"\")\n\n/* Contract support - Experimental and undocumented */\n#define %contract %feature(\"contract\")\n#define %nocontract %feature(\"contract\",\"0\")\n#define %clearcontract %feature(\"contract\",\"\")\n\n/* Macro for setting a dynamic cast function */\n%define DYNAMIC_CAST(mangle,func)\n%init %{\n mangle->dcast = (swig_dycast_func) func;\n%}\n%enddef\n\n/* aggregation support */\n/*\n This macro performs constant aggregation. Basically the idea of\n constant aggregation is that you can group a collection of constants\n together. For example, suppose you have some code like this:\n\n #define UP 1\n #define DOWN 2\n #define LEFT 3\n #define RIGHT 4\n\n Now, suppose you had a function like this:\n\n int move(int direction)\n\n In this case, you might want to restrict the direction argument to\n one of the supplied constant names. To do this, you could write some\n typemap code by hand. Alternatively, you can use the\n %aggregate_check macro defined here to create a simple check\n function for you. Here is an example:\n\n %aggregate_check(int, check_direction, UP, DOWN, LEFT, RIGHT);\n\n Now, using a typemap\n\n %typemap(check) int direction {\n if (!check_direction($1)) SWIG_exception(SWIG_ValueError,\"Bad direction.\");\n }\n\n or a contract (better)\n\n %contract move(int x) {\n require:\n check_direction(x);\n }\n\n*/\n \n%define %aggregate_check(TYPE, NAME, FIRST, ...)\n%wrapper %{\nstatic int NAME(TYPE x) {\n static TYPE values[] = { FIRST, ##__VA_ARGS__ };\n static int size = sizeof(values);\n int i,j;\n for (i = 0, j = 0; i < size; i+=sizeof(TYPE),j++) {\n if (x == values[j]) return 1; \n }\n return 0;\n}\n%}\n%enddef\n\n\n/* -----------------------------------------------------------------------------\n * %rename predicates\n * ----------------------------------------------------------------------------- */\n/* \n Predicates to be used with %rename, for example:\n\n - to rename all the functions:\n\n %rename(\"%(utitle)s\", %$isfunction) \"\";\n\n - to rename only the member methods:\n\n %rename(\"m_%(utitle)s\", %$isfunction, %$ismember) \"\";\n\n - to rename only the global functions:\n\n %rename(\"m_%(utitle)s\", %$isfunction, %$not %$ismember) \"\";\n\n or\n\n %rename(\"g_%(utitle)s\", %$isfunction, %$isglobal) \"\";\n\n - to ignore the enumitems in a given class:\n\n %rename(\"$ignore\", %$isenumitem, %$classname=\"MyClass\") \"\";\n\n we use the prefix '%$' to avoid clashes with other swig\n macros/directives.\n\n*/\n\n%define %$not \"not\" %enddef \n%define %$isenum \"match\"=\"enum\" %enddef\n%define %$isenumitem \"match\"=\"enumitem\" %enddef\n%define %$isaccess \"match\"=\"access\" %enddef\n%define %$isclass \"match\"=\"class\",\"notmatch$template$templatetype\"=\"class\" %enddef\n%define %$isextend \"match\"=\"extend\" %enddef\n%define %$isconstructor \"match\"=\"constructor\" %enddef\n%define %$isdestructor \"match\"=\"destructor\" %enddef\n%define %$isnamespace \"match\"=\"namespace\" %enddef\n%define %$istemplate \"match\"=\"template\" %enddef\n%define %$isconstant \"match\"=\"constant\" %enddef /* %constant definition */\n\n%define %$isunion \"match$kind\"=\"union\" %enddef\n%define %$isfunction \"match$kind\"=\"function\" %enddef\n%define %$isvariable \"match$kind\"=\"variable\" %enddef\n%define %$isimmutable \"match$feature:immutable\"=\"1\" %enddef\n%define %$hasconsttype \"match$hasconsttype\"=\"1\" %enddef\n%define %$hasvalue \"match$hasvalue\"=\"1\" %enddef\n%define %$isextension \"match$isextension\"=\"1\" %enddef\n\n%define %$isstatic \"match$storage\"=\"static\" %enddef\n%define %$isfriend \"match$storage\"=\"friend\" %enddef\n%define %$istypedef \"match$storage\"=\"typedef\" %enddef\n%define %$isvirtual \"match$storage\"=\"virtual\" %enddef\n%define %$isexplicit \"match$storage\"=\"explicit\" %enddef\n%define %$isextern \"match$storage\"=\"extern\" %enddef\n\n%define %$ismember \"match$ismember\"=\"1\" %enddef\n%define %$isglobal %$not %$ismember %enddef\n%define %$isextendmember \"match$isextendmember\"=\"1\" %enddef\n%define %$innamespace \"match$parentNode$nodeType\"=\"namespace\" %enddef\n\n%define %$ispublic \"match$access\"=\"public\" %enddef\n%define %$isprotected \"match$access\"=\"protected\" %enddef\n%define %$isprivate \"match$access\"=\"private\" %enddef\n\n%define %$ismemberget \"match$memberget\"=\"1\" %enddef\n%define %$ismemberset \"match$memberset\"=\"1\" %enddef\n\n%define %$classname %$ismember,\"match$parentNode$name\" %enddef\n%define %$isnested \"match$nested\"=\"1\" %enddef\n/* -----------------------------------------------------------------------------\n * Include all the warnings labels and macros \n * ----------------------------------------------------------------------------- */\n\n%include \n\n/* -----------------------------------------------------------------------------\n * Overloading support\n * ----------------------------------------------------------------------------- */\n\n/*\n * Function/method overloading support. This is done through typemaps,\n * but also involves a precedence level.\n */\n\n/* Macro for overload resolution */\n\n%define %typecheck(_x...) %typemap(typecheck, precedence=_x) %enddef\n\n/* Macros for precedence levels */\n\n%define SWIG_TYPECHECK_POINTER 0 %enddef\n%define SWIG_TYPECHECK_ITERATOR 5 %enddef\n%define SWIG_TYPECHECK_VOIDPTR 10 %enddef\n%define SWIG_TYPECHECK_BOOL 15 %enddef\n%define SWIG_TYPECHECK_UINT8 20 %enddef\n%define SWIG_TYPECHECK_INT8 25 %enddef\n%define SWIG_TYPECHECK_UINT16 30 %enddef\n%define SWIG_TYPECHECK_INT16 35 %enddef\n%define SWIG_TYPECHECK_UINT32 40 %enddef\n%define SWIG_TYPECHECK_INT32 45 %enddef\n%define SWIG_TYPECHECK_SIZE 47 %enddef\n%define SWIG_TYPECHECK_PTRDIFF 48 %enddef\n%define SWIG_TYPECHECK_UINT64 50 %enddef\n%define SWIG_TYPECHECK_INT64 55 %enddef\n%define SWIG_TYPECHECK_UINT128 60 %enddef\n%define SWIG_TYPECHECK_INT128 65 %enddef\n%define SWIG_TYPECHECK_INTEGER 70 %enddef\n%define SWIG_TYPECHECK_FLOAT 80 %enddef\n%define SWIG_TYPECHECK_DOUBLE 90 %enddef\n%define SWIG_TYPECHECK_CPLXFLT 95 %enddef\n%define SWIG_TYPECHECK_CPLXDBL 100 %enddef\n%define SWIG_TYPECHECK_COMPLEX 105 %enddef\n%define SWIG_TYPECHECK_UNICHAR 110 %enddef\n%define SWIG_TYPECHECK_STDUNISTRING 115 %enddef\n%define SWIG_TYPECHECK_UNISTRING 120 %enddef\n%define SWIG_TYPECHECK_CHAR 130 %enddef\n%define SWIG_TYPECHECK_STDSTRING 135 %enddef\n%define SWIG_TYPECHECK_STRING 140 %enddef\n%define SWIG_TYPECHECK_PAIR 150 %enddef\n%define SWIG_TYPECHECK_STDARRAY 155 %enddef\n%define SWIG_TYPECHECK_VECTOR 160 %enddef\n%define SWIG_TYPECHECK_DEQUE 170 %enddef\n%define SWIG_TYPECHECK_LIST 180 %enddef\n%define SWIG_TYPECHECK_SET 190 %enddef\n%define SWIG_TYPECHECK_MULTISET 200 %enddef\n%define SWIG_TYPECHECK_MAP 210 %enddef\n%define SWIG_TYPECHECK_MULTIMAP 220 %enddef\n%define SWIG_TYPECHECK_STACK 230 %enddef\n%define SWIG_TYPECHECK_QUEUE 240 %enddef\n\n%define SWIG_TYPECHECK_BOOL_ARRAY 1015 %enddef\n%define SWIG_TYPECHECK_INT8_ARRAY 1025 %enddef\n%define SWIG_TYPECHECK_INT16_ARRAY 1035 %enddef\n%define SWIG_TYPECHECK_INT32_ARRAY 1045 %enddef\n%define SWIG_TYPECHECK_INT64_ARRAY 1055 %enddef\n%define SWIG_TYPECHECK_INT128_ARRAY 1065 %enddef\n%define SWIG_TYPECHECK_FLOAT_ARRAY 1080 %enddef\n%define SWIG_TYPECHECK_DOUBLE_ARRAY 1090 %enddef\n%define SWIG_TYPECHECK_CHAR_ARRAY 1130 %enddef\n%define SWIG_TYPECHECK_STRING_ARRAY 1140 %enddef\n%define SWIG_TYPECHECK_OBJECT_ARRAY 1150 %enddef\n\n%define SWIG_TYPECHECK_BOOL_PTR 2015 %enddef\n%define SWIG_TYPECHECK_UINT8_PTR 2020 %enddef\n%define SWIG_TYPECHECK_INT8_PTR 2025 %enddef\n%define SWIG_TYPECHECK_UINT16_PTR 2030 %enddef\n%define SWIG_TYPECHECK_INT16_PTR 2035 %enddef\n%define SWIG_TYPECHECK_UINT32_PTR 2040 %enddef\n%define SWIG_TYPECHECK_INT32_PTR 2045 %enddef\n%define SWIG_TYPECHECK_UINT64_PTR 2050 %enddef\n%define SWIG_TYPECHECK_INT64_PTR 2055 %enddef\n%define SWIG_TYPECHECK_FLOAT_PTR 2080 %enddef\n%define SWIG_TYPECHECK_DOUBLE_PTR 2090 %enddef\n%define SWIG_TYPECHECK_CHAR_PTR 2130 %enddef\n\n%define SWIG_TYPECHECK_SWIGOBJECT 5000 %enddef\n\n\n/* -----------------------------------------------------------------------------\n * Default handling of certain overloaded operators \n * ----------------------------------------------------------------------------- */\n\n#ifdef __cplusplus\n%ignoreoperator(NEW) operator new;\n%ignoreoperator(DELETE) operator delete;\n%ignoreoperator(NEWARR) operator new[];\n%ignoreoperator(DELARR) operator delete[];\n\n/* add C++ operator aliases */\n%rename(\"operator &&\") operator and; // `and' `&&'\n%rename(\"operator ||\") operator or; // `or' `||'\n%rename(\"operator !\") operator not; // `not' `!'\n%rename(\"operator &=\") operator and_eq; // `and_eq' `&='\n%rename(\"operator &\") operator bitand; // `bitand' `&'\n%rename(\"operator |\") operator bitor; // `bitor' `|'\n%rename(\"operator ~\") operator compl; // `compl' `~'\n%rename(\"operator !=\") operator not_eq; // `not_eq' `!='\n%rename(\"operator |=\") operator or_eq; // `or_eq' `|='\n%rename(\"operator ^\") operator xor; // `xor' `^'\n%rename(\"operator ^=\") operator xor_eq; // `xor_eq' `^='\n\n/* Smart pointer handling */\n\n%rename(__deref__) *::operator->;\n%rename(__ref__) *::operator*();\n%rename(__ref__) *::operator*() const;\n\n/* Define std namespace */\nnamespace std {\n /* Warn about std::initializer_list usage. The constructor/method where used should probably be ignored. See docs. */\n template class initializer_list {};\n %typemap(in, warning=SWIGWARN_TYPEMAP_INITIALIZER_LIST_MSG) initializer_list \"\"\n %typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER) initializer_list \"\"\n}\n#endif\n\n/* -----------------------------------------------------------------------------\n * Default char * and C array typemaps\n * ----------------------------------------------------------------------------- */\n\n/* Set up the typemap for handling new return strings */\n\n#ifdef __cplusplus\n%typemap(newfree) char * \"delete [] $1;\";\n#else\n%typemap(newfree) char * \"free($1);\";\n#endif\n\n/* Default typemap for handling char * members */\n\n#ifdef __cplusplus\n%typemap(memberin) char * {\n delete [] $1;\n if ($input) {\n $1 = ($1_type) (new char[strlen((const char *)$input)+1]);\n strcpy((char *)$1, (const char *)$input);\n } else {\n $1 = 0;\n }\n}\n%typemap(memberin,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const char * {\n if ($input) {\n $1 = ($1_type) (new char[strlen((const char *)$input)+1]);\n strcpy((char *)$1, (const char *)$input);\n } else {\n $1 = 0;\n }\n}\n%typemap(globalin) char * {\n delete [] $1;\n if ($input) {\n $1 = ($1_type) (new char[strlen((const char *)$input)+1]);\n strcpy((char *)$1, (const char *)$input);\n } else {\n $1 = 0;\n }\n}\n%typemap(globalin,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const char * {\n if ($input) {\n $1 = ($1_type) (new char[strlen((const char *)$input)+1]);\n strcpy((char *)$1, (const char *)$input);\n } else {\n $1 = 0;\n }\n}\n#else\n%typemap(memberin) char * {\n free($1);\n if ($input) {\n $1 = ($1_type) malloc(strlen((const char *)$input)+1);\n strcpy((char *)$1, (const char *)$input);\n } else {\n $1 = 0;\n }\n}\n%typemap(memberin,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const char * {\n if ($input) {\n $1 = ($1_type) malloc(strlen((const char *)$input)+1);\n strcpy((char *)$1, (const char *)$input);\n } else {\n $1 = 0;\n }\n}\n%typemap(globalin) char * {\n free($1);\n if ($input) {\n $1 = ($1_type) malloc(strlen((const char *)$input)+1);\n strcpy((char *)$1, (const char *)$input);\n } else {\n $1 = 0;\n }\n}\n%typemap(globalin,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const char * {\n if ($input) {\n $1 = ($1_type) malloc(strlen((const char *)$input)+1);\n strcpy((char *)$1, (const char *)$input);\n } else {\n $1 = 0;\n }\n}\n\n#endif\n\n/* Character array handling */\n\n%typemap(memberin) char [ANY] {\n if($input) {\n strncpy((char*)$1, (const char *)$input, $1_dim0-1);\n $1[$1_dim0-1] = 0;\n } else {\n $1[0] = 0;\n }\n}\n\n%typemap(globalin) char [ANY] {\n if($input) {\n strncpy((char*)$1, (const char *)$input, $1_dim0-1);\n $1[$1_dim0-1] = 0;\n } else {\n $1[0] = 0;\n }\n}\n\n%typemap(memberin) char [] {\n if ($input) strcpy((char *)$1, (const char *)$input);\n else $1[0] = 0;\n}\n\n%typemap(globalin) char [] {\n if ($input) strcpy((char *)$1, (const char *)$input);\n else $1[0] = 0;\n}\n\n/* memberin/globalin typemap for arrays. */\n\n%typemap(memberin) SWIGTYPE [ANY] {\n size_t ii;\n $1_basetype *b = ($1_basetype *) $1;\n for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii);\n}\n\n%typemap(globalin) SWIGTYPE [ANY] {\n size_t ii;\n $1_basetype *b = ($1_basetype *) $1;\n for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii);\n}\n\n/* memberin/globalin typemap for double arrays. */\n\n%typemap(memberin) SWIGTYPE [ANY][ANY] {\n $basetype (*inp)[$1_dim1] = ($basetype (*)[$1_dim1])($input);\n $basetype (*dest)[$1_dim1] = ($basetype (*)[$1_dim1])($1);\n size_t ii = 0;\n for (; ii < $1_dim0; ++ii) {\n $basetype *ip = inp[ii];\n $basetype *dp = dest[ii];\n size_t jj = 0;\n for (; jj < $1_dim1; ++jj) dp[jj] = ip[jj];\n }\n}\n\n%typemap(globalin) SWIGTYPE [ANY][ANY] {\n $basetype (*inp)[$1_dim1] = ($basetype (*)[$1_dim1])($input);\n $basetype (*dest)[$1_dim1] = ($basetype (*)[$1_dim1])($1);\n size_t ii = 0;\n for (; ii < $1_dim0; ++ii) {\n $basetype *ip = inp[ii];\n $basetype *dp = dest[ii];\n size_t jj = 0;\n for (; jj < $1_dim1; ++jj) dp[jj] = ip[jj];\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Runtime code\n * ----------------------------------------------------------------------------- */\n\n/* The SwigValueWrapper class */\n\n/* \n * This template wrapper is used to handle C++ objects that are passed or \n * returned by value. This is necessary to handle objects that define\n * no default-constructor (making it difficult for SWIG to properly declare\n * local variables).\n *\n * The wrapper is used as follows. First consider a function like this:\n *\n * Vector cross_product(Vector a, Vector b)\n *\n * Now, if Vector is defined as a C++ class with no default constructor, \n * code is generated as follows:\n *\n * Vector *wrap_cross_product(Vector *inarg1, Vector *inarg2) {\n * SwigValueWrapper arg1;\n * SwigValueWrapper arg2;\n * SwigValueWrapper result;\n *\n * arg1 = *inarg1;\n * arg2 = *inarg2;\n * ... \n * result = cross_product(arg1,arg2);\n * ...\n * return new Vector(result);\n * }\n * \n * In the wrappers, the template SwigValueWrapper simply provides a thin\n * layer around a Vector *. However, it does this in a way that allows\n * the object to be bound after the variable declaration (which is not possible\n * with the bare object when it lacks a default constructor). \n *\n * An observant reader will notice that the code after the variable declarations\n * is *identical* to the code used for classes that do define default constructors.\n * Thus, this neat trick allows us to fix this special case without having to\n * make massive changes to typemaps and other parts of the SWIG code generator.\n *\n * Note: this code is not included when SWIG runs in C-mode, when classes\n * define default constructors, or when pointers and references are used.\n * SWIG tries to avoid doing this except in very special circumstances.\n *\n * Note: This solution suffers from making a large number of copies\n * of the underlying object. However, this is needed in the interest of\n * safety and in order to cover all of the possible ways in which a value\n * might be assigned. For example:\n *\n * arg1 = *inarg1; // Assignment from a pointer\n * arg1 = Vector(1,2,3); // Assignment from a value \n *\n * The class offers a strong guarantee of exception safety.\n * With regards to the implementation, the private SwigMovePointer nested class is \n * a simple smart pointer with move semantics, much like std::auto_ptr.\n *\n * This wrapping technique was suggested by William Fulton and is henceforth\n * known as the \"Fulton Transform\" :-).\n */\n\n#ifdef __cplusplus\n%insert(\"runtime\") %{\n#ifdef __cplusplus\n/* SwigValueWrapper is described in swig.swg */\ntemplate class SwigValueWrapper {\n struct SwigMovePointer {\n T *ptr;\n SwigMovePointer(T *p) : ptr(p) { }\n ~SwigMovePointer() { delete ptr; }\n SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }\n } pointer;\n SwigValueWrapper& operator=(const SwigValueWrapper& rhs);\n SwigValueWrapper(const SwigValueWrapper& rhs);\npublic:\n SwigValueWrapper() : pointer(0) { }\n SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }\n operator T&() const { return *pointer.ptr; }\n T *operator&() { return pointer.ptr; }\n};%}\n\n/*\n * SwigValueInit() is a generic initialisation solution as the following approach:\n * \n * T c_result = T();\n * \n * doesn't compile for all types for example:\n * \n * unsigned int c_result = unsigned int();\n */\n%insert(\"runtime\") %{\ntemplate T SwigValueInit() {\n return T();\n}\n#endif\n%}\n#endif\n\n/* The swiglabels */\n\n%insert(\"runtime\") \"swiglabels.swg\"\n\n\n"} +{"text": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors. All rights reserved.\n# https://github.com/golang/protobuf\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n# * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n# * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following disclaimer\n# in the documentation and/or other materials provided with the\n# distribution.\n# * Neither the name of Google Inc. nor the names of its\n# contributors may be used to endorse or promote products derived from\n# this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\ninstall:\n\tgo install\n\ntest: install generate-test-pbs\n\tgo test\n\n\ngenerate-test-pbs:\n\tmake install\n\tmake -C test_proto\n\tmake -C proto3_proto\n\tmake\n"} +{"text": "@title = 'Novembro'\n\n## Sem novas listas por um tempo\n\nTodas as listas atuais irão continuar funcionando normalmente, mas a partir de 15 de outubro, estamos suspendendo todas as aprovações para novas listas enquanto estamos trabalhando para atualizar nossas caixas e desenvolvendo melhor nosso sistema para manter todos vocês e o tremendo trabalho que vocês fazem. Vocês são bem vindos para requisitar listas, mas elas não serão ativadas até nossos novos sistemas estiverem organizados. Isso poderia durar até o ano que vem - não temos uma data exata, e iremos processar novos pedidos de lista logo que pudermos. Caso você estiver em uma circunstância especial onde precise muito, muito de uma nova lista, mande uma mensagem para pigeon@riseup.net e ela irá tentar ajudar-te. Estamos contatando pássaros de coletivos tech (tecnológicos) radicais pelo globo afora, e iremos postar uma lista de outros lugares que podem hospedar novas listas de mensagens.\n\n## O que acontece se você esqueceu sua senha?\n\nO Riseup sempre tem que encontrar um equilíbrio entre segurança e conveniência. No caso de senhas perdidas, nós autorizamos os usuários a resetar sua senha caso eles tenham nos dado outras informações, como uma pergunta secreta ou um outro endereço eletrônico. Se você pensa que é provável que esqueça sua senha, pode ser uma boa idéia que estabeleça uma pergunta secreta (para fazer isso, visite http://user.riseup.net). Porém mantenha em mente que fornecer esse tipo de informação é um um risco de segurança. Alguém que conheça muito sobre você poderia possivelmente reseta-la, e qualquer informação que armazenamos em você é mais informação do que podemos ter confortavelmente.\nSe você está absolutamente, positivamente seguro que não irá esquecer sua senha nunca, então considere a possibilidade de remover essa informação de nosso sistema. Porém, tenha certeza de você entendeu o seguinte: se você não tiver suas informações adicionais, e você esquecer sua senha, você será bloqueado para sua conta! Nós *não podemos* abrir nenhuma exceção para essa regra no sentido de assegurar o não fornecimento de informações de contas para impostores. <---- super importante, leia de novo!\nPara protege-lo do esquecimento, não há nada de errado em escrever a senha e mante-la segura (mas não perca!). Em geral é muito melhor usar uma senha complicada e escreve-la ao invés de usar uma senha simples e mante-la apenas na sua memória.\n\n## ÊÊ!\n\nEstamos satisfeitos e orgulhosos em notificar que o primeiríssimo pintinho nasceu no bando do Riseup. Roadrunner e seu benzinho tiveram um saltitante bebê nascido em casa que veio ao mundo em setembro. Seus pais têm estado no ninho em casa, e nós desejamos o recém nascido uma vida de beleza, esperança e transformação.\n\n## $\n\nTalvez o capitalismo global esteja entrando em ruínas eternamente. Procurando por algum lugar para colocar dinheiro que vai durar por muito tempo depois de desmoronar? Por favor considere dar para o seu amigável coletivo Riseup. Vamos começar a fazer o mundo que queremos hoje. Visite http://riseup.net/donate\n\n## Lembrete\n\nExistem pessoas que se fazem passar por administradores do Riseup e que estão tentando te bagunçar. Nós nunca vamos nos chamar de “staff” ( quadro de funcionários) e nós jamais vamos pedir pela sua senha, nem em um trilhão de anos. Muitos de vocês estão recebendo mensagens perguntando pela sua senha de seu endereço eletrônico, não responda a essas mensagens e tenha certeza que seus amigos do Riseup saibam que não devam faze-lo também.\n"} +{"text": "comp = loadComp mixins: [require \"../src/fragToString.coffee\"]\ndescribe \"fragToString\", ->\n it \"should resolve a frag to string\", ->\n frag = document.createDocumentFragment()\n p = document.createElement('p')\n p.textContent = 'test'\n frag.appendChild p\n comp.fragToString(frag).should.equal(\"

test

\")\n"} +{"text": "# $NetBSD: Makefile,v 1.12 2020/06/02 08:24:15 adam Exp $\n\nR_PKGNAME=\tXML\nR_PKGVER=\t3.98-1.20\nPKGREVISION=\t1\nCATEGORIES=\tmath\n\nMAINTAINER=\tpkgsrc-users@NetBSD.org\nCOMMENT=\tTools for parsing and generating XML within R\nLICENSE=\t2-clause-bsd\n\nUSE_LANGUAGES=\tc\n\n.include \"../../math/R/Makefile.extension\"\n.include \"../../textproc/libxml2/buildlink3.mk\"\n.include \"../../mk/bsd.pkg.mk\"\n"} +{"text": "#include \n\nint main(int argc, char **argv)\n{\n\tprintf(\"Hello, %s\\n\", \"world\");\n}\n"} +{"text": "// +build integration\n\n/*\nReal-time Online/Offline Charging System (OCS) for Telecom & ISP environments\nCopyright (C) ITsysCOM GmbH\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see \n*/\npackage v1\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/rpc\"\n\t\"net/url\"\n\t\"os\"\n\t\"path\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/cgrates/cgrates/config\"\n\t\"github.com/cgrates/cgrates/dispatchers\"\n\t\"github.com/cgrates/cgrates/engine\"\n\t\"github.com/cgrates/cgrates/scheduler\"\n\t\"github.com/cgrates/cgrates/servmanager\"\n\t\"github.com/cgrates/cgrates/utils\"\n\t\"github.com/cgrates/ltcache\"\n\t\"github.com/streadway/amqp\"\n)\n\n// ToDo: Replace rpc.Client with internal rpc server and Apier using internal map as both data and stor so we can run the tests non-local\n\n/*\nREADME:\n\n Enable local tests by passing '-local' to the go test command\n It is expected that the data folder of CGRateS exists at path /usr/share/cgrates/data or passed via command arguments.\n Prior running the tests, create database and users by running:\n mysql -pyourrootpwd < /usr/share/cgrates/data/storage/mysql/create_db_with_users.sql\n What these tests do:\n * Flush tables in storDb to start clean.\n * Start engine with default configuration and give it some time to listen (here caching can slow down, hence the command argument parameter).\n * Connect rpc client depending on encoding defined in configuration.\n * Execute remote Apis and test their replies(follow testtp scenario so we can test load in dataDb also).\n*/\nvar (\n\tcfgPath string\n\tcfg *config.CGRConfig\n\trater *rpc.Client\n\tAPIerSv1ConfigDIR string\n\n\tapierTests = []func(t *testing.T){\n\t\ttestApierLoadConfig,\n\t\ttestApierCreateDirs,\n\t\ttestApierInitDataDb,\n\t\ttestApierInitStorDb,\n\t\ttestApierStartEngine,\n\t\ttestApierRpcConn,\n\t\ttestApierTPTiming,\n\t\ttestApierTPDestination,\n\t\ttestApierTPRate,\n\t\ttestApierTPDestinationRate,\n\t\ttestApierTPRatingPlan,\n\t\ttestApierTPRatingProfile,\n\t\ttestApierTPActions,\n\t\ttestApierTPActionPlan,\n\t\ttestApierTPActionTriggers,\n\t\ttestApierTPAccountActions,\n\t\ttestApierLoadRatingPlan,\n\t\ttestApierLoadRatingProfile,\n\t\ttestApierLoadAccountActions,\n\t\ttestApierReloadScheduler,\n\t\ttestApierSetRatingProfile,\n\t\ttestAPIerSv1GetRatingProfile,\n\t\ttestApierReloadCache,\n\t\ttestApierGetDestination,\n\t\ttestApierGetRatingPlan,\n\t\ttestApierRemoveRatingPlan,\n\t\ttestApierAddBalance,\n\t\ttestApierExecuteAction,\n\t\ttestApierSetActions,\n\t\ttestApierGetActions,\n\t\ttestApierSetActionPlan,\n\t\ttestApierAddTriggeredAction,\n\t\ttestApierGetAccountActionTriggers,\n\t\ttestApierAddTriggeredAction2,\n\t\ttestApierGetAccountActionTriggers2,\n\t\ttestApierSetAccountActionTriggers,\n\t\ttestApierRemAccountActionTriggers,\n\t\ttestApierSetAccount,\n\t\ttestApierGetAccountActionPlan,\n\t\ttestApierITGetScheduledActionsForAccount,\n\t\ttestApierRemUniqueIDActionTiming,\n\t\ttestApierGetAccount,\n\t\ttestApierTriggersExecute,\n\t\ttestApierResetDataBeforeLoadFromFolder,\n\t\ttestApierLoadTariffPlanFromFolder,\n\t\ttestApierComputeReverse,\n\t\ttestApierResetDataAfterLoadFromFolder,\n\t\ttestApierSetChargerS,\n\t\ttestApierGetAccountAfterLoad,\n\t\ttestApierResponderGetCost,\n\t\ttestApierMaxDebitInexistentAcnt,\n\t\ttestApierCdrServer,\n\t\ttestApierITGetCdrs,\n\t\ttestApierITProcessCdr,\n\t\ttestApierGetCallCostLog,\n\t\ttestApierITSetDestination,\n\t\ttestApierITGetScheduledActions,\n\t\ttestApierITGetDataCost,\n\t\ttestApierITGetCost,\n\t\ttestApierInitDataDb2,\n\t\ttestApierInitStorDb2,\n\t\ttestApierReloadCache2,\n\t\ttestApierReloadScheduler2,\n\t\ttestApierImportTPFromFolderPath,\n\t\ttestApierLoadTariffPlanFromStorDbDryRun,\n\t\ttestApierGetCacheStats2,\n\t\ttestApierLoadTariffPlanFromStorDb,\n\t\ttestApierStartStopServiceStatus,\n\t\ttestApierReplayFldPosts,\n\t\ttestApierGetDataDBVesions,\n\t\ttestApierGetStorDBVesions,\n\t\ttestApierBackwardsCompatible,\n\t\ttestApierStopEngine,\n\t}\n)\n\nfunc TestApierIT(t *testing.T) {\n\tswitch *dbType {\n\tcase utils.MetaInternal:\n\t\tt.SkipNow() // need tests redesign\n\tcase utils.MetaMySQL:\n\t\tAPIerSv1ConfigDIR = \"apier_mysql\"\n\tcase utils.MetaMongo:\n\t\tAPIerSv1ConfigDIR = \"apier_mongo\"\n\tcase utils.MetaPostgres:\n\t\tt.SkipNow()\n\tdefault:\n\t\tt.Fatal(\"Unknown Database type\")\n\t}\n\n\tfor _, stest := range apierTests {\n\t\tt.Run(APIerSv1ConfigDIR, stest)\n\t}\n}\n\nfunc testApierLoadConfig(t *testing.T) {\n\tvar err error\n\tcfgPath = path.Join(*dataDir, \"conf\", \"samples\", APIerSv1ConfigDIR) // no need for a new config with *gob transport in this case\n\tif cfg, err = config.NewCGRConfigFromPath(cfgPath); err != nil {\n\t\tt.Error(err)\n\t}\n}\n\nfunc testApierCreateDirs(t *testing.T) {\n\tfor _, pathDir := range []string{\"/var/log/cgrates/ers/in\", \"/var/log/cgrates/ers/out\"} {\n\t\tif err := os.RemoveAll(pathDir); err != nil {\n\t\t\tt.Fatal(\"Error removing folder: \", pathDir, err)\n\t\t}\n\t\tif err := os.MkdirAll(pathDir, 0755); err != nil {\n\t\t\tt.Fatal(\"Error creating folder: \", pathDir, err)\n\t\t}\n\t}\n}\n\nfunc testApierInitDataDb(t *testing.T) {\n\tif err := engine.InitDataDb(cfg); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// Empty tables before using them\nfunc testApierInitStorDb(t *testing.T) {\n\tif err := engine.InitStorDb(cfg); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// Start engine\nfunc testApierStartEngine(t *testing.T) {\n\tif _, err := engine.StopStartEngine(cfgPath, *waitRater); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// Connect rpc client to rater\nfunc testApierRpcConn(t *testing.T) {\n\tvar err error\n\trater, err = newRPCClient(cfg.ListenCfg()) // We connect over JSON so we can also troubleshoot if needed\n\tif err != nil {\n\t\tt.Fatal(\"Could not connect to rater: \", err.Error())\n\t}\n}\n\n// Test here TPTiming APIs\nfunc testApierTPTiming(t *testing.T) {\n\t// ALWAYS,*any,*any,*any,*any,00:00:00\n\ttmAlways := &utils.ApierTPTiming{TPid: utils.TEST_SQL,\n\t\tID: \"ALWAYS\",\n\t\tYears: utils.META_ANY,\n\t\tMonths: utils.META_ANY,\n\t\tMonthDays: utils.META_ANY,\n\t\tWeekDays: utils.META_ANY,\n\t\tTime: \"00:00:00\",\n\t}\n\ttmAlways2 := new(utils.ApierTPTiming)\n\t*tmAlways2 = *tmAlways\n\ttmAlways2.ID = \"ALWAYS2\"\n\ttmAsap := &utils.ApierTPTiming{\n\t\tTPid: utils.TEST_SQL,\n\t\tID: \"ASAP\",\n\t\tYears: utils.META_ANY,\n\t\tMonths: utils.META_ANY,\n\t\tMonthDays: utils.META_ANY,\n\t\tWeekDays: utils.META_ANY,\n\t\tTime: \"*asap\",\n\t}\n\tvar reply string\n\tfor _, tm := range []*utils.ApierTPTiming{tmAlways, tmAsap, tmAlways2} {\n\t\tif err := rater.Call(utils.APIerSv1SetTPTiming, &tm, &reply); err != nil {\n\t\t\tt.Error(\"Got error on APIerSv1.SetTPTiming: \", err.Error())\n\t\t} else if reply != utils.OK {\n\t\t\tt.Error(\"Unexpected reply received when calling APIerSv1.SetTPTiming: \", reply)\n\t\t}\n\t}\n\t// Check second set\n\tif err := rater.Call(utils.APIerSv1SetTPTiming, &tmAlways, &reply); err != nil {\n\t\tt.Error(\"Got error on second APIerSv1.SetTPTiming: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.SetTPTiming got reply: \", reply)\n\t}\n\t// Check missing params\n\tif err := rater.Call(utils.APIerSv1SetTPTiming, new(utils.ApierTPTiming), &reply); err == nil {\n\t\tt.Error(\"Calling APIerSv1.SetTPTiming, expected error, received: \", reply)\n\t} else if err.Error() != \"MANDATORY_IE_MISSING: [TPid ID Years Months MonthDays WeekDays Time]\" {\n\t\tt.Error(\"Calling APIerSv1.SetTPTiming got unexpected error: \", err.Error())\n\t}\n\t// Test get\n\tvar rplyTmAlways2 *utils.ApierTPTiming\n\tif err := rater.Call(utils.APIerSv1GetTPTiming, &AttrGetTPTiming{tmAlways2.TPid, tmAlways2.ID}, &rplyTmAlways2); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPTiming, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(tmAlways2, rplyTmAlways2) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPTiming expected: %v, received: %v\", tmAlways, rplyTmAlways2)\n\t}\n\t// Test remove\n\tif err := rater.Call(utils.APIerSv1RemoveTPTiming, AttrGetTPTiming{tmAlways2.TPid, tmAlways2.ID}, &reply); err != nil {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPTiming, got error: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPTiming received: \", reply)\n\t}\n\t// Test getIds\n\tvar rplyTmIds []string\n\texpectedTmIds := []string{\"ALWAYS\", \"ASAP\"}\n\tif err := rater.Call(utils.APIerSv1GetTPTimingIds, &AttrGetTPTimingIds{tmAlways.TPid, utils.PaginatorWithSearch{}}, &rplyTmIds); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPTimingIds, got error: \", err.Error())\n\t}\n\tsort.Strings(expectedTmIds)\n\tsort.Strings(rplyTmIds)\n\tif !reflect.DeepEqual(expectedTmIds, rplyTmIds) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPTimingIds expected: %v, received: %v\", expectedTmIds, rplyTmIds)\n\t}\n}\n\n// Test here TPTiming APIs\nfunc testApierTPDestination(t *testing.T) {\n\tvar reply string\n\tdstDe := &utils.TPDestination{TPid: utils.TEST_SQL, ID: \"GERMANY\", Prefixes: []string{\"+49\"}}\n\tdstDeMobile := &utils.TPDestination{TPid: utils.TEST_SQL, ID: \"GERMANY_MOBILE\", Prefixes: []string{\"+4915\", \"+4916\", \"+4917\"}}\n\tdstFs := &utils.TPDestination{TPid: utils.TEST_SQL, ID: \"FS_USERS\", Prefixes: []string{\"10\"}}\n\tdstDe2 := new(utils.TPDestination)\n\t*dstDe2 = *dstDe // Data which we use for remove, still keeping the sample data to check proper loading\n\tdstDe2.ID = \"GERMANY2\"\n\tfor _, dst := range []*utils.TPDestination{dstDe, dstDeMobile, dstFs, dstDe2} {\n\t\tif err := rater.Call(utils.APIerSv1SetTPDestination, dst, &reply); err != nil {\n\t\t\tt.Error(\"Got error on APIerSv1.SetTPDestination: \", err.Error())\n\t\t} else if reply != utils.OK {\n\t\t\tt.Error(\"Unexpected reply received when calling APIerSv1.SetTPDestination: \", reply)\n\t\t}\n\t}\n\t// Check second set\n\tif err := rater.Call(utils.APIerSv1SetTPDestination, dstDe2, &reply); err != nil {\n\t\tt.Error(\"Got error on second APIerSv1.SetTPDestination: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.SetTPDestination got reply: \", reply)\n\t}\n\t// Check missing params\n\tif err := rater.Call(utils.APIerSv1SetTPDestination, new(utils.TPDestination), &reply); err == nil {\n\t\tt.Error(\"Calling APIerSv1.SetTPDestination, expected error, received: \", reply)\n\t} else if err.Error() != \"MANDATORY_IE_MISSING: [TPid ID Prefixes]\" {\n\t\tt.Error(\"Calling APIerSv1.SetTPDestination got unexpected error: \", err.Error())\n\t}\n\t// Test get\n\tvar rplyDstDe2 *utils.TPDestination\n\tif err := rater.Call(utils.APIerSv1GetTPDestination, &AttrGetTPDestination{dstDe2.TPid, dstDe2.ID}, &rplyDstDe2); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPDestination, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(dstDe2, rplyDstDe2) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPDestination expected: %v, received: %v\", dstDe2, rplyDstDe2)\n\t}\n\t// Test remove\n\tif err := rater.Call(utils.APIerSv1RemoveTPDestination, &AttrGetTPDestination{dstDe2.TPid, dstDe2.ID}, &reply); err != nil {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPTiming, got error: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPTiming received: \", reply)\n\t}\n\t// Test getIds\n\tvar rplyDstIds []string\n\texpectedDstIds := []string{\"FS_USERS\", \"GERMANY\", \"GERMANY_MOBILE\"}\n\tif err := rater.Call(utils.APIerSv1GetTPDestinationIDs, &AttrGetTPDestinationIds{TPid: dstDe.TPid}, &rplyDstIds); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPDestinationIDs, got error: \", err.Error())\n\t}\n\tsort.Strings(expectedDstIds)\n\tsort.Strings(rplyDstIds)\n\tif !reflect.DeepEqual(expectedDstIds, rplyDstIds) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPDestinationIDs expected: %v, received: %v\", expectedDstIds, rplyDstIds)\n\t}\n}\n\n// Test here TPRateRALs APIs\nfunc testApierTPRate(t *testing.T) {\n\tvar reply string\n\trt := &utils.TPRateRALs{TPid: utils.TEST_SQL, ID: \"RT_FS_USERS\", RateSlots: []*utils.RateSlot{\n\t\t{ConnectFee: 0, Rate: 0, RateUnit: \"60s\", RateIncrement: \"60s\", GroupIntervalStart: \"0s\"},\n\t}}\n\trt2 := new(utils.TPRateRALs)\n\t*rt2 = *rt\n\trt2.ID = \"RT_FS_USERS2\"\n\tfor _, r := range []*utils.TPRateRALs{rt, rt2} {\n\t\tif err := rater.Call(utils.APIerSv1SetTPRate, r, &reply); err != nil {\n\t\t\tt.Error(\"Got error on APIerSv1.SetTPRate: \", err.Error())\n\t\t} else if reply != utils.OK {\n\t\t\tt.Error(\"Unexpected reply received when calling APIerSv1.SetTPRate: \", reply)\n\t\t}\n\t}\n\t// Check second set\n\tif err := rater.Call(utils.APIerSv1SetTPRate, rt2, &reply); err != nil {\n\t\tt.Error(\"Got error on second APIerSv1.SetTPRate: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.SetTPRate got reply: \", reply)\n\t}\n\t// Check missing params\n\tif err := rater.Call(utils.APIerSv1SetTPRate, new(utils.TPRateRALs), &reply); err == nil {\n\t\tt.Error(\"Calling APIerSv1.SetTPDestination, expected error, received: \", reply)\n\t} else if err.Error() != \"MANDATORY_IE_MISSING: [TPid ID RateSlots]\" {\n\t\tt.Error(\"Calling APIerSv1.SetTPRate got unexpected error: \", err.Error())\n\t}\n\t// Test get\n\tvar rplyRt2 *utils.TPRateRALs\n\tif err := rater.Call(utils.APIerSv1GetTPRate, &AttrGetTPRate{rt2.TPid, rt2.ID}, &rplyRt2); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPRate, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(rt2, rplyRt2) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPRate expected: %+v, received: %+v\", rt2, rplyRt2)\n\t}\n\t// Test remove\n\tif err := rater.Call(utils.APIerSv1RemoveTPRate, &AttrGetTPRate{rt2.TPid, rt2.ID}, &reply); err != nil {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPRate, got error: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPRate received: \", reply)\n\t}\n\t// Test getIds\n\tvar rplyRtIds []string\n\texpectedRtIds := []string{\"RT_FS_USERS\"}\n\tif err := rater.Call(utils.APIerSv1GetTPRateIds, &AttrGetTPRateIds{rt.TPid, utils.PaginatorWithSearch{}}, &rplyRtIds); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPRateIds, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedRtIds, rplyRtIds) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPDestinationIDs expected: %v, received: %v\", expectedRtIds, rplyRtIds)\n\t}\n}\n\n// Test here TPDestinationRate APIs\nfunc testApierTPDestinationRate(t *testing.T) {\n\tvar reply string\n\tdr := &utils.TPDestinationRate{TPid: utils.TEST_SQL, ID: \"DR_FREESWITCH_USERS\", DestinationRates: []*utils.DestinationRate{\n\t\t{DestinationId: \"FS_USERS\", RateId: \"RT_FS_USERS\", RoundingMethod: \"*up\", RoundingDecimals: 2},\n\t}}\n\tdrDe := &utils.TPDestinationRate{TPid: utils.TEST_SQL, ID: \"DR_FREESWITCH_USERS\", DestinationRates: []*utils.DestinationRate{\n\t\t{DestinationId: \"GERMANY_MOBILE\", RateId: \"RT_FS_USERS\", RoundingMethod: \"*up\", RoundingDecimals: 2},\n\t}}\n\tdr2 := new(utils.TPDestinationRate)\n\t*dr2 = *dr\n\tdr2.ID = utils.TEST_SQL\n\tfor _, d := range []*utils.TPDestinationRate{dr, dr2, drDe} {\n\t\tif err := rater.Call(utils.APIerSv1SetTPDestinationRate, d, &reply); err != nil {\n\t\t\tt.Error(\"Got error on APIerSv1.SetTPDestinationRate: \", err.Error())\n\t\t} else if reply != utils.OK {\n\t\t\tt.Error(\"Unexpected reply received when calling APIerSv1.SetTPDestinationRate: \", reply)\n\t\t}\n\t}\n\t// Check second set\n\tif err := rater.Call(utils.APIerSv1SetTPDestinationRate, dr2, &reply); err != nil {\n\t\tt.Error(\"Got error on second APIerSv1.SetTPDestinationRate: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.SetTPDestinationRate got reply: \", reply)\n\t}\n\t// Check missing params\n\tif err := rater.Call(utils.APIerSv1SetTPDestinationRate, new(utils.TPDestinationRate), &reply); err == nil {\n\t\tt.Error(\"Calling APIerSv1.SetTPDestination, expected error, received: \", reply)\n\t} else if err.Error() != \"MANDATORY_IE_MISSING: [TPid ID DestinationRates]\" {\n\t\tt.Error(\"Calling APIerSv1.SetTPDestinationRate got unexpected error: \", err.Error())\n\t}\n\t// Test get\n\tvar rplyDr2 *utils.TPDestinationRate\n\tif err := rater.Call(utils.APIerSv1GetTPDestinationRate, &AttrGetTPDestinationRate{dr2.TPid, dr2.ID, utils.Paginator{}}, &rplyDr2); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPDestinationRate, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(dr2, rplyDr2) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPDestinationRate expected: %v, received: %v\", dr2, rplyDr2)\n\t}\n\t// Test remove\n\tif err := rater.Call(utils.APIerSv1RemoveTPDestinationRate, &AttrGetTPDestinationRate{dr2.TPid, dr2.ID, utils.Paginator{}}, &reply); err != nil {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPRate, got error: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPRate received: \", reply)\n\t}\n\t// Test getIds\n\tvar rplyDrIds []string\n\texpectedDrIds := []string{\"DR_FREESWITCH_USERS\"}\n\tif err := rater.Call(utils.APIerSv1GetTPDestinationRateIds, &AttrTPDestinationRateIds{dr.TPid, utils.PaginatorWithSearch{}}, &rplyDrIds); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPDestinationRateIds, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedDrIds, rplyDrIds) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPDestinationRateIds expected: %v, received: %v\", expectedDrIds, rplyDrIds)\n\t}\n}\n\n// Test here TPRatingPlan APIs\nfunc testApierTPRatingPlan(t *testing.T) {\n\tvar reply string\n\trp := &utils.TPRatingPlan{TPid: utils.TEST_SQL, ID: \"RETAIL1\", RatingPlanBindings: []*utils.TPRatingPlanBinding{\n\t\t{DestinationRatesId: \"DR_FREESWITCH_USERS\", TimingId: \"ALWAYS\", Weight: 10},\n\t}}\n\trpTst := new(utils.TPRatingPlan)\n\t*rpTst = *rp\n\trpTst.ID = utils.TEST_SQL\n\tfor _, rpl := range []*utils.TPRatingPlan{rp, rpTst} {\n\t\tif err := rater.Call(utils.APIerSv1SetTPRatingPlan, rpl, &reply); err != nil {\n\t\t\tt.Error(\"Got error on APIerSv1.SetTPRatingPlan: \", err.Error())\n\t\t} else if reply != utils.OK {\n\t\t\tt.Error(\"Unexpected reply received when calling APIerSv1.SetTPRatingPlan: \", reply)\n\t\t}\n\t}\n\t// Check second set\n\tif err := rater.Call(utils.APIerSv1SetTPRatingPlan, rpTst, &reply); err != nil {\n\t\tt.Error(\"Got error on second APIerSv1.SetTPRatingPlan: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.SetTPRatingPlan got reply: \", reply)\n\t}\n\t// Check missing params\n\tif err := rater.Call(utils.APIerSv1SetTPRatingPlan, new(utils.TPRatingPlan), &reply); err == nil {\n\t\tt.Error(\"Calling APIerSv1.SetTPRatingPlan, expected error, received: \", reply)\n\t} else if err.Error() != \"MANDATORY_IE_MISSING: [TPid ID RatingPlanBindings]\" {\n\t\tt.Error(\"Calling APIerSv1.SetTPRatingPlan got unexpected error: \", err.Error())\n\t}\n\t// Test get\n\tvar rplyRpTst *utils.TPRatingPlan\n\tif err := rater.Call(utils.APIerSv1GetTPRatingPlan, &AttrGetTPRatingPlan{TPid: rpTst.TPid, ID: rpTst.ID}, &rplyRpTst); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPRatingPlan, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(rpTst, rplyRpTst) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPRatingPlan expected: %v, received: %v\", rpTst, rplyRpTst)\n\t}\n\t// Test remove\n\tif err := rater.Call(utils.APIerSv1RemoveTPRatingPlan, &AttrGetTPRatingPlan{TPid: rpTst.TPid, ID: rpTst.ID}, &reply); err != nil {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPRatingPlan, got error: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPRatingPlan received: \", reply)\n\t}\n\t// Test getIds\n\tvar rplyRpIds []string\n\texpectedRpIds := []string{\"RETAIL1\"}\n\tif err := rater.Call(utils.APIerSv1GetTPRatingPlanIds, &AttrGetTPRatingPlanIds{rp.TPid, utils.PaginatorWithSearch{}}, &rplyRpIds); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPRatingPlanIds, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedRpIds, rplyRpIds) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPRatingPlanIds expected: %v, received: %v\", expectedRpIds, rplyRpIds)\n\t}\n}\n\n// Test here TPRatingPlan APIs\nfunc testApierTPRatingProfile(t *testing.T) {\n\tvar reply string\n\trpf := &utils.TPRatingProfile{\n\t\tTPid: utils.TEST_SQL,\n\t\tLoadId: utils.TEST_SQL,\n\t\tTenant: \"cgrates.org\",\n\t\tCategory: \"call\",\n\t\tSubject: utils.META_ANY,\n\t\tRatingPlanActivations: []*utils.TPRatingActivation{{\n\t\t\tActivationTime: \"2012-01-01T00:00:00Z\",\n\t\t\tRatingPlanId: \"RETAIL1\",\n\t\t\tFallbackSubjects: utils.EmptyString,\n\t\t}},\n\t}\n\trpfTst := new(utils.TPRatingProfile)\n\t*rpfTst = *rpf\n\trpfTst.Subject = utils.TEST_SQL\n\tfor _, rp := range []*utils.TPRatingProfile{rpf, rpfTst} {\n\t\tif err := rater.Call(utils.APIerSv1SetTPRatingProfile, rp, &reply); err != nil {\n\t\t\tt.Error(\"Got error on APIerSv1.SetTPRatingProfile: \", err.Error())\n\t\t} else if reply != utils.OK {\n\t\t\tt.Error(\"Unexpected reply received when calling APIerSv1.SetTPRatingProfile: \", reply)\n\t\t}\n\t}\n\t// Check second set\n\tif err := rater.Call(utils.APIerSv1SetTPRatingProfile, rpfTst, &reply); err != nil {\n\t\tt.Error(\"Got error on second APIerSv1.SetTPRatingProfile: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.SetTPRatingProfile got reply: \", reply)\n\t}\n\t// Check missing params\n\tif err := rater.Call(utils.APIerSv1SetTPRatingProfile, new(utils.TPRatingProfile), &reply); err == nil {\n\t\tt.Error(\"Calling APIerSv1.SetTPRatingProfile, expected error, received: \", reply)\n\t} else if err.Error() != \"MANDATORY_IE_MISSING: [TPid LoadId Tenant Category Subject RatingPlanActivations]\" {\n\t\tt.Error(\"Calling APIerSv1.SetTPRatingProfile got unexpected error: \", err.Error())\n\t}\n\t// Test get\n\tvar rplyRpf *utils.TPRatingProfile\n\tif err := rater.Call(utils.APIerSv1GetTPRatingProfile, &AttrGetTPRatingProfile{TPid: rpfTst.TPid, RatingProfileID: utils.ConcatenatedKey(rpfTst.LoadId, rpfTst.Tenant, rpfTst.Category, rpfTst.Subject)}, &rplyRpf); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPRatingProfiles, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(rpfTst, rplyRpf) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPRatingProfiles expected: %v, received: %v\", rpfTst, rplyRpf)\n\t}\n\t// Test remove\n\tif err := rater.Call(utils.APIerSv1RemoveTPRatingProfile, &AttrGetTPRatingProfile{TPid: rpfTst.TPid, RatingProfileID: utils.ConcatenatedKey(rpfTst.LoadId, rpfTst.Tenant, rpfTst.Category, rpfTst.Subject)}, &reply); err != nil {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPRatingProfile, got error: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPRatingProfile received: \", reply)\n\t}\n\t// Test getLoadIds\n\tvar rplyRpIds []string\n\texpectedRpIds := []string{utils.TEST_SQL}\n\tif err := rater.Call(utils.APIerSv1GetTPRatingProfileLoadIds, &utils.AttrTPRatingProfileIds{TPid: rpf.TPid}, &rplyRpIds); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPRatingProfileLoadIds, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedRpIds, rplyRpIds) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPRatingProfileLoadIds expected: %v, received: %v\", expectedRpIds, rplyRpIds)\n\t}\n}\n\nfunc testApierTPActions(t *testing.T) {\n\tvar reply string\n\tact := &utils.TPActions{TPid: utils.TEST_SQL,\n\t\tID: \"PREPAID_10\", Actions: []*utils.TPAction{\n\t\t\t{Identifier: \"*topup_reset\", BalanceType: utils.MONETARY,\n\t\t\t\tUnits: \"10\", ExpiryTime: \"*unlimited\",\n\t\t\t\tDestinationIds: utils.META_ANY, BalanceWeight: \"10\", Weight: 10},\n\t\t}}\n\tactWarn := &utils.TPActions{TPid: utils.TEST_SQL, ID: \"WARN_VIA_HTTP\", Actions: []*utils.TPAction{\n\t\t{Identifier: \"*http_post\", ExtraParameters: \"http://localhost:8000\", Weight: 10},\n\t}}\n\tactLog := &utils.TPActions{TPid: utils.TEST_SQL, ID: \"LOG_BALANCE\", Actions: []*utils.TPAction{\n\t\t{Identifier: \"*log\", Weight: 10},\n\t}}\n\tactTst := new(utils.TPActions)\n\t*actTst = *act\n\tactTst.ID = utils.TEST_SQL\n\tfor _, ac := range []*utils.TPActions{act, actWarn, actTst, actLog} {\n\t\tif err := rater.Call(utils.APIerSv1SetTPActions, ac, &reply); err != nil {\n\t\t\tt.Error(\"Got error on APIerSv1.SetTPActions: \", err.Error())\n\t\t} else if reply != utils.OK {\n\t\t\tt.Error(\"Unexpected reply received when calling APIerSv1.SetTPActions: \", reply)\n\t\t}\n\t}\n\t// Check second set\n\tif err := rater.Call(utils.APIerSv1SetTPActions, actTst, &reply); err != nil {\n\t\tt.Error(\"Got error on second APIerSv1.SetTPActions: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.SetTPActions got reply: \", reply)\n\t}\n\t// Check missing params\n\tif err := rater.Call(utils.APIerSv1SetTPActions, new(utils.TPActions), &reply); err == nil {\n\t\tt.Error(\"Calling APIerSv1.SetTPActions, expected error, received: \", reply)\n\t} else if err.Error() != \"MANDATORY_IE_MISSING: [TPid ID Actions]\" {\n\t\tt.Error(\"Calling APIerSv1.SetTPActions got unexpected error: \", err.Error())\n\t}\n\t// Test get\n\tvar rplyActs *utils.TPActions\n\tif err := rater.Call(utils.APIerSv1GetTPActions, &AttrGetTPActions{TPid: actTst.TPid, ID: actTst.ID}, &rplyActs); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPActions, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(actTst, rplyActs) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPActions expected: %v, received: %v\", actTst, rplyActs)\n\t}\n\t// Test remove\n\tif err := rater.Call(utils.APIerSv1RemoveTPActions, &AttrGetTPActions{TPid: actTst.TPid, ID: actTst.ID}, &reply); err != nil {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPActions, got error: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPActions received: \", reply)\n\t}\n\t// Test getIds\n\tvar rplyIds []string\n\texpectedIds := []string{\"LOG_BALANCE\", \"PREPAID_10\", \"WARN_VIA_HTTP\"}\n\tif err := rater.Call(utils.APIerSv1GetTPActionIds, &AttrGetTPActionIds{TPid: actTst.TPid}, &rplyIds); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPActionIds, got error: \", err.Error())\n\t}\n\tsort.Strings(expectedIds)\n\tsort.Strings(rplyIds)\n\tif !reflect.DeepEqual(expectedIds, rplyIds) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPActionIds expected: %v, received: %v\", expectedIds, rplyIds)\n\t}\n}\n\nfunc testApierTPActionPlan(t *testing.T) {\n\tvar reply string\n\tat := &utils.TPActionPlan{TPid: utils.TEST_SQL, ID: \"PREPAID_10\", ActionPlan: []*utils.TPActionTiming{\n\t\t{ActionsId: \"PREPAID_10\", TimingId: \"ASAP\", Weight: 10},\n\t}}\n\tatTst := new(utils.TPActionPlan)\n\t*atTst = *at\n\tatTst.ID = utils.TEST_SQL\n\tfor _, act := range []*utils.TPActionPlan{at, atTst} {\n\t\tif err := rater.Call(utils.APIerSv1SetTPActionPlan, act, &reply); err != nil {\n\t\t\tt.Error(\"Got error on APIerSv1.SetTPActionPlan: \", err.Error())\n\t\t} else if reply != utils.OK {\n\t\t\tt.Error(\"Unexpected reply received when calling APIerSv1.SetTPActionPlan: \", reply)\n\t\t}\n\t}\n\t// Check second set\n\tif err := rater.Call(utils.APIerSv1SetTPActionPlan, atTst, &reply); err != nil {\n\t\tt.Error(\"Got error on second APIerSv1.SetTPActionPlan: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.SetTPActionPlan got reply: \", reply)\n\t}\n\t// Check missing params\n\tif err := rater.Call(utils.APIerSv1SetTPActionPlan, new(utils.TPActionPlan), &reply); err == nil {\n\t\tt.Error(\"Calling APIerSv1.SetTPActionPlan, expected error, received: \", reply)\n\t} else if err.Error() != \"MANDATORY_IE_MISSING: [TPid ID ActionPlan]\" {\n\t\tt.Error(\"Calling APIerSv1.SetTPActionPlan got unexpected error: \", err.Error())\n\t}\n\t// Test get\n\tvar rplyActs *utils.TPActionPlan\n\tif err := rater.Call(utils.APIerSv1GetTPActionPlan, &AttrGetTPActionPlan{TPid: atTst.TPid, ID: atTst.ID}, &rplyActs); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPActionPlan, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(atTst, rplyActs) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPActionPlan expected: %v, received: %v\", atTst, rplyActs)\n\t}\n\t// Test remove\n\tif err := rater.Call(utils.APIerSv1RemoveTPActionPlan, &AttrGetTPActionPlan{TPid: atTst.TPid, ID: atTst.ID}, &reply); err != nil {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPActionPlan, got error: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPActionPlan received: \", reply)\n\t}\n\t// Test getIds\n\tvar rplyIds []string\n\texpectedIds := []string{\"PREPAID_10\"}\n\tif err := rater.Call(utils.APIerSv1GetTPActionPlanIds, &AttrGetTPActionPlanIds{TPid: atTst.TPid}, &rplyIds); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPActionPlanIds, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedIds, rplyIds) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPActionPlanIds expected: %v, received: %v\", expectedIds, rplyIds)\n\t}\n}\n\nfunc testApierTPActionTriggers(t *testing.T) {\n\tvar reply string\n\tat := &utils.TPActionTriggers{\n\t\tTPid: utils.TEST_SQL,\n\t\tID: \"STANDARD_TRIGGERS\",\n\t\tActionTriggers: []*utils.TPActionTrigger{{\n\t\t\tId: \"STANDARD_TRIGGERS\",\n\t\t\tUniqueID: \"MYFIRSTTRIGGER\",\n\t\t\tBalanceType: utils.MONETARY,\n\t\t\tThresholdType: \"*min_balance\",\n\t\t\tThresholdValue: 2,\n\t\t\tActionsId: \"LOG_BALANCE\",\n\t\t\tWeight: 10,\n\t\t}},\n\t}\n\tatTst := new(utils.TPActionTriggers)\n\t*atTst = *at\n\tatTst.ID = utils.TEST_SQL\n\tatTst.ActionTriggers[0].Id = utils.TEST_SQL\n\tfor _, act := range []*utils.TPActionTriggers{at, atTst} {\n\t\tif err := rater.Call(utils.APIerSv1SetTPActionTriggers, act, &reply); err != nil {\n\t\t\tt.Error(\"Got error on APIerSv1.SetTPActionTriggers: \", err.Error())\n\t\t} else if reply != utils.OK {\n\t\t\tt.Error(\"Unexpected reply received when calling APIerSv1.SetTPActionTriggers: \", reply)\n\t\t}\n\t}\n\t// Check second set\n\tif err := rater.Call(utils.APIerSv1SetTPActionTriggers, atTst, &reply); err != nil {\n\t\tt.Error(\"Got error on second APIerSv1.SetTPActionTriggers: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.SetTPActionTriggers got reply: \", reply)\n\t}\n\t// Check missing params\n\tif err := rater.Call(utils.APIerSv1SetTPActionTriggers, new(utils.TPActionTriggers), &reply); err == nil {\n\t\tt.Error(\"Calling APIerSv1.SetTPActionTriggers, expected error, received: \", reply)\n\t} else if err.Error() != \"MANDATORY_IE_MISSING: [TPid ID]\" {\n\t\tt.Error(\"Calling APIerSv1.SetTPActionTriggers got unexpected error: \", err.Error())\n\t}\n\t// Test get\n\tvar rplyActs *utils.TPActionTriggers\n\tif err := rater.Call(utils.APIerSv1GetTPActionTriggers, &AttrGetTPActionTriggers{TPid: atTst.TPid, ID: atTst.ID}, &rplyActs); err != nil {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPActionTriggers %s, got error: %s\", atTst.ID, err.Error())\n\t} else if !reflect.DeepEqual(atTst, rplyActs) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPActionTriggers expected: %+v, received: %+v\", utils.ToJSON(atTst), utils.ToJSON(rplyActs))\n\t}\n\t// Test remove\n\tif err := rater.Call(utils.APIerSv1RemoveTPActionTriggers, &AttrGetTPActionTriggers{TPid: atTst.TPid, ID: atTst.ID}, &reply); err != nil {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPActionTriggers, got error: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPActionTriggers received: \", reply)\n\t}\n\t// Test getIds\n\tvar rplyIds []string\n\texpectedIds := []string{\"STANDARD_TRIGGERS\"}\n\tif err := rater.Call(utils.APIerSv1GetTPActionTriggerIds, &AttrGetTPActionTriggerIds{TPid: atTst.TPid}, &rplyIds); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPActionTriggerIds, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedIds, rplyIds) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPActionTriggerIds expected: %v, received: %v\", expectedIds, rplyIds)\n\t}\n}\n\n// Test here TPAccountActions APIs\nfunc testApierTPAccountActions(t *testing.T) {\n\tvar reply string\n\taa1 := &utils.TPAccountActions{TPid: utils.TEST_SQL, LoadId: utils.TEST_SQL, Tenant: \"cgrates.org\",\n\t\tAccount: \"1001\", ActionPlanId: \"PREPAID_10\", ActionTriggersId: \"STANDARD_TRIGGERS\"}\n\taa2 := &utils.TPAccountActions{TPid: utils.TEST_SQL, LoadId: utils.TEST_SQL, Tenant: \"cgrates.org\",\n\t\tAccount: \"1002\", ActionPlanId: \"PREPAID_10\", ActionTriggersId: \"STANDARD_TRIGGERS\"}\n\taa3 := &utils.TPAccountActions{TPid: utils.TEST_SQL, LoadId: utils.TEST_SQL, Tenant: \"cgrates.org\",\n\t\tAccount: \"1003\", ActionPlanId: \"PREPAID_10\", ActionTriggersId: \"STANDARD_TRIGGERS\"}\n\taa4 := &utils.TPAccountActions{TPid: utils.TEST_SQL, LoadId: utils.TEST_SQL, Tenant: \"cgrates.org\",\n\t\tAccount: \"1004\", ActionPlanId: \"PREPAID_10\", ActionTriggersId: \"STANDARD_TRIGGERS\"}\n\taa5 := &utils.TPAccountActions{TPid: utils.TEST_SQL, LoadId: utils.TEST_SQL, Tenant: \"cgrates.org\",\n\t\tAccount: \"1005\", ActionPlanId: \"PREPAID_10\", ActionTriggersId: \"STANDARD_TRIGGERS\"}\n\taaTst := new(utils.TPAccountActions)\n\t*aaTst = *aa1\n\taaTst.Account = utils.TEST_SQL\n\tfor _, aact := range []*utils.TPAccountActions{aa1, aa2, aa3, aa4, aa5, aaTst} {\n\t\tif err := rater.Call(utils.APIerSv1SetTPAccountActions, aact, &reply); err != nil {\n\t\t\tt.Error(\"Got error on APIerSv1.SetTPAccountActions: \", err.Error())\n\t\t} else if reply != utils.OK {\n\t\t\tt.Error(\"Unexpected reply received when calling APIerSv1.SetTPAccountActions: \", reply)\n\t\t}\n\t}\n\t// Check second set\n\tif err := rater.Call(utils.APIerSv1SetTPAccountActions, aaTst, &reply); err != nil {\n\t\tt.Error(\"Got error on second APIerSv1.SetTPAccountActions: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.SetTPAccountActions got reply: \", reply)\n\t}\n\t// Check missing params\n\tif err := rater.Call(utils.APIerSv1SetTPAccountActions, new(utils.TPAccountActions), &reply); err == nil {\n\t\tt.Error(\"Calling APIerSv1.SetTPAccountActions, expected error, received: \", reply)\n\t} else if err.Error() != \"MANDATORY_IE_MISSING: [TPid LoadId Tenant Account ActionPlanId]\" {\n\t\tt.Error(\"Calling APIerSv1.SetTPAccountActions got unexpected error: \", err.Error())\n\t}\n\t// Test get\n\tvar rplyaa *utils.TPAccountActions\n\tif err := rater.Call(utils.APIerSv1GetTPAccountActions, &AttrGetTPAccountActions{TPid: aaTst.TPid, AccountActionsId: aaTst.GetId()}, &rplyaa); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPAccountActions, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(aaTst, rplyaa) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPAccountActions expected: %v, received: %v\", aaTst, rplyaa)\n\t}\n\t// Test remove\n\tif err := rater.Call(utils.APIerSv1RemoveTPAccountActions, &AttrGetTPAccountActions{TPid: aaTst.TPid, AccountActionsId: aaTst.GetId()}, &reply); err != nil {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPAccountActions, got error: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.RemoveTPAccountActions received: \", reply)\n\t}\n\t// Test getLoadIds\n\tvar rplyRpIds []string\n\texpectedRpIds := []string{utils.TEST_SQL}\n\tif err := rater.Call(utils.APIerSv1GetTPAccountActionLoadIds, &AttrGetTPAccountActionIds{TPid: aaTst.TPid}, &rplyRpIds); err != nil {\n\t\tt.Error(\"Calling APIerSv1.GetTPAccountActionLoadIds, got error: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedRpIds, rplyRpIds) {\n\t\tt.Errorf(\"Calling APIerSv1.GetTPAccountActionLoadIds expected: %v, received: %v\", expectedRpIds, rplyRpIds)\n\t}\n}\n\n// Test here LoadRatingPlan\nfunc testApierLoadRatingPlan(t *testing.T) {\n\tvar reply string\n\tif err := rater.Call(utils.APIerSv1LoadRatingPlan, &AttrLoadRatingPlan{TPid: utils.TEST_SQL, RatingPlanId: \"RETAIL1\"}, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.LoadRatingPlan: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.LoadRatingPlan got reply: \", reply)\n\t}\n}\n\n// Test here LoadRatingProfile\nfunc testApierLoadRatingProfile(t *testing.T) {\n\tvar reply string\n\trpf := &utils.TPRatingProfile{\n\t\tTPid: utils.TEST_SQL, LoadId: utils.TEST_SQL,\n\t\tTenant: \"cgrates.org\", Category: \"call\", Subject: \"*any\"}\n\tif err := rater.Call(utils.APIerSv1LoadRatingProfile, &rpf, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.LoadRatingProfile: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.LoadRatingProfile got reply: \", reply)\n\t}\n}\n\n// Test here LoadAccountActions\nfunc testApierLoadAccountActions(t *testing.T) {\n\tvar rcvStats map[string]*ltcache.CacheStats\n\texpectedStats := engine.GetDefaultEmptyCacheStats() // Make sure nothing in cache so far\n\tif err := rater.Call(utils.CacheSv1GetCacheStats, new(utils.AttrCacheIDsWithOpts), &rcvStats); err != nil {\n\t\tt.Error(\"Got error on CacheSv1.GetCacheStats: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedStats, rcvStats) {\n\t\tt.Errorf(\"Calling CacheSv1.GetCacheStats expected: %+v,\\n received: %+v\", utils.ToJSON(expectedStats), utils.ToJSON(rcvStats))\n\t}\n\tvar reply string\n\taa1 := &utils.TPAccountActions{TPid: utils.TEST_SQL, LoadId: utils.TEST_SQL, Tenant: \"cgrates.org\", Account: \"1001\"}\n\tif err := rater.Call(utils.APIerSv1LoadAccountActions, aa1, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.LoadAccountActions: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.LoadAccountActions got reply: \", reply)\n\t}\n\ttime.Sleep(10 * time.Millisecond)\n\texpectedStats[utils.CacheAccountActionPlans].Items = 1\n\texpectedStats[utils.CacheActionPlans].Items = 1\n\texpectedStats[utils.CacheActions].Items = 1\n\texpectedStats[utils.CacheLoadIDs].Items = 2\n\texpectedStats[utils.CacheRPCConnections].Items = 1\n\tif err := rater.Call(utils.CacheSv1GetCacheStats, new(utils.AttrCacheIDsWithOpts), &rcvStats); err != nil {\n\t\tt.Error(\"Got error on CacheSv1.GetCacheStats: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedStats, rcvStats) {\n\t\tt.Errorf(\"Calling CacheSv1.GetCacheStats expected: %+v, \\n received: %+v\", utils.ToJSON(expectedStats), utils.ToJSON(rcvStats))\n\t}\n}\n\n// Test here ReloadScheduler\nfunc testApierReloadScheduler(t *testing.T) {\n\tvar reply string\n\t// Simple test that command is executed without errors\n\tif err := rater.Call(utils.SchedulerSv1Reload, utils.StringWithOpts{}, &reply); err != nil {\n\t\tt.Error(\"Got error on SchedulerSv1.Reload: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling SchedulerSv1.Reload got reply: \", reply)\n\t}\n}\n\n// Test here SetRatingProfile\nfunc testApierSetRatingProfile(t *testing.T) {\n\tvar reply string\n\trpa := &utils.TPRatingActivation{ActivationTime: \"2012-01-01T00:00:00Z\", RatingPlanId: \"RETAIL1\", FallbackSubjects: \"dan2\"}\n\trpf := &utils.AttrSetRatingProfile{Tenant: \"cgrates.org\", Category: \"call\",\n\t\tSubject: \"dan\", RatingPlanActivations: []*utils.TPRatingActivation{rpa}}\n\tif err := rater.Call(utils.APIerSv1SetRatingProfile, &rpf, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.SetRatingProfile: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.SetRatingProfile got reply: \", reply)\n\t}\n\tvar rcvStats map[string]*ltcache.CacheStats\n\texpectedStats := engine.GetDefaultEmptyCacheStats()\n\texpectedStats[utils.CacheAccountActionPlans].Items = 1\n\texpectedStats[utils.CacheActionPlans].Items = 1\n\texpectedStats[utils.CacheActions].Items = 1\n\texpectedStats[utils.CacheRatingProfiles].Items = 1\n\texpectedStats[utils.CacheRPCConnections].Items = 1\n\texpectedStats[utils.CacheLoadIDs].Items = 2\n\tif err := rater.Call(utils.CacheSv1GetCacheStats, new(utils.AttrCacheIDsWithOpts), &rcvStats); err != nil {\n\t\tt.Error(\"Got error on CacheSv1.GetCacheStats: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedStats, rcvStats) {\n\t\tt.Errorf(\"Calling CacheSv1.GetCacheStats expected: %+v, received: %+v\", utils.ToJSON(expectedStats), utils.ToJSON(rcvStats))\n\t}\n\t// Calling the second time should not raise EXISTS\n\tif err := rater.Call(utils.APIerSv1SetRatingProfile, &rpf, &reply); err != nil {\n\t\tt.Error(\"Unexpected result on duplication: \", err.Error())\n\t}\n\t// Make sure rates were loaded for account dan\n\t// Test here ResponderGetCost\n\ttStart, _ := utils.ParseTimeDetectLayout(\"2013-08-07T17:30:00Z\", utils.EmptyString)\n\ttEnd, _ := utils.ParseTimeDetectLayout(\"2013-08-07T17:31:30Z\", utils.EmptyString)\n\tcd := &engine.CallDescriptorWithOpts{\n\t\tCallDescriptor: &engine.CallDescriptor{\n\t\t\tCategory: \"call\",\n\t\t\tTenant: \"cgrates.org\",\n\t\t\tSubject: \"dan\",\n\t\t\tAccount: \"dan\",\n\t\t\tDestination: \"+4917621621391\",\n\t\t\tDurationIndex: 90,\n\t\t\tTimeStart: tStart,\n\t\t\tTimeEnd: tEnd,\n\t\t},\n\t}\n\tvar cc engine.CallCost\n\t// Simple test that command is executed without errors\n\tif err := rater.Call(utils.ResponderGetCost, cd, &cc); err != nil {\n\t\tt.Error(\"Got error on Responder.GetCost: \", err.Error())\n\t} else if cc.Cost != 0 {\n\t\tt.Errorf(\"Calling Responder.GetCost got callcost: %v\", cc.Cost)\n\t}\n\texpectedStats[utils.CacheRatingPlans].Items = 1\n\texpectedStats[utils.CacheReverseDestinations].Items = 10\n\tif err := rater.Call(utils.CacheSv1GetCacheStats, new(utils.AttrCacheIDsWithOpts), &rcvStats); err != nil {\n\t\tt.Error(\"Got error on CacheSv1.GetCacheStats: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedStats, rcvStats) {\n\t\tt.Errorf(\"Calling CacheSv1.GetCacheStats expected: %+v, received: %+v\", utils.ToJSON(expectedStats), utils.ToJSON(rcvStats))\n\t}\n}\n\nfunc testAPIerSv1GetRatingProfile(t *testing.T) {\n\tvar rpl engine.RatingProfile\n\tattrGetRatingPlan := &utils.AttrGetRatingProfile{\n\t\tTenant: \"cgrates.org\", Category: \"call\", Subject: \"dan\"}\n\tactTime, err := utils.ParseTimeDetectLayout(\"2012-01-01T00:00:00Z\", utils.EmptyString)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\texpected := engine.RatingProfile{\n\t\tId: \"*out:cgrates.org:call:dan\",\n\t\tRatingPlanActivations: engine.RatingPlanActivations{\n\t\t\t{\n\t\t\t\tActivationTime: actTime,\n\t\t\t\tRatingPlanId: \"RETAIL1\",\n\t\t\t\tFallbackKeys: []string{\"*out:cgrates.org:call:dan2\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tActivationTime: actTime,\n\t\t\t\tRatingPlanId: \"RETAIL1\",\n\t\t\t\tFallbackKeys: []string{\"*out:cgrates.org:call:dan2\"},\n\t\t\t},\n\t\t},\n\t}\n\tif err := rater.Call(utils.APIerSv1GetRatingProfile, attrGetRatingPlan, &rpl); err != nil {\n\t\tt.Errorf(\"Got error on APIerSv1.GetRatingProfile: %+v\", err)\n\t} else if !reflect.DeepEqual(expected, rpl) {\n\t\tt.Errorf(\"Calling APIerSv1.GetRatingProfile expected: %+v, received: %+v\", utils.ToJSON(expected), utils.ToJSON(rpl))\n\t}\n\tattrGetRatingPlan.Subject = utils.EmptyString\n\tif err := rater.Call(utils.APIerSv1GetRatingProfile, attrGetRatingPlan, &rpl); err == nil {\n\t\tt.Errorf(\"Expected error on APIerSv1.GetRatingProfile, recived : %+v\", rpl)\n\t}\n\tattrGetRatingPlan.Subject = \"dan\"\n\tattrGetRatingPlan.Tenant = \"other_tenant\"\n\tif err := rater.Call(utils.APIerSv1GetRatingProfile, attrGetRatingPlan, &rpl); err.Error() != utils.ErrNotFound.Error() {\n\t\tt.Errorf(\"Expected error on APIerSv1.GetRatingProfile, recived : %+v\", err)\n\t}\n\n\texpectedIds := []string{\"call:dan\", \"call:*any\"}\n\tvar result []string\n\tif err := rater.Call(utils.APIerSv1GetRatingProfileIDs, &utils.PaginatorWithTenant{Tenant: \"cgrates.org\"}, &result); err != nil {\n\t\tt.Error(err)\n\t} else if len(expectedIds) != len(result) {\n\t\tt.Errorf(\"Expecting : %+v, received: %+v\", expected, result)\n\t}\n}\n\n// Test here ReloadCache\nfunc testApierReloadCache(t *testing.T) {\n\tvar reply string\n\tarc := new(utils.AttrReloadCacheWithOpts)\n\t// Simple test that command is executed without errors\n\tif err := rater.Call(utils.CacheSv1ReloadCache, arc, &reply); err != nil {\n\t\tt.Error(\"Got error on CacheSv1.ReloadCache: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling CacheSv1.ReloadCache got reply: \", reply)\n\t}\n\tvar rcvStats map[string]*ltcache.CacheStats\n\texpectedStats := engine.GetDefaultEmptyCacheStats()\n\texpectedStats[utils.CacheAccountActionPlans].Items = 1\n\texpectedStats[utils.CacheActionPlans].Items = 1\n\texpectedStats[utils.CacheActions].Items = 1\n\texpectedStats[utils.CacheRatingProfiles].Items = 2\n\texpectedStats[utils.CacheRatingPlans].Items = 1\n\texpectedStats[utils.CacheReverseDestinations].Items = 10\n\texpectedStats[utils.CacheLoadIDs].Items = 2\n\texpectedStats[utils.CacheRPCConnections].Items = 1\n\tif err := rater.Call(utils.CacheSv1GetCacheStats, new(utils.AttrCacheIDsWithOpts), &rcvStats); err != nil {\n\t\tt.Error(\"Got error on CacheSv1.GetCacheStats: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedStats, rcvStats) {\n\t\tt.Errorf(\"Calling CacheSv1.GetCacheStats expected: %+v, received: %+v\", utils.ToJSON(expectedStats), utils.ToJSON(rcvStats))\n\t}\n}\n\n// Test here GetDestination\nfunc testApierGetDestination(t *testing.T) {\n\treply := new(engine.Destination)\n\tdstId := \"GERMANY_MOBILE\"\n\texpectedReply := &engine.Destination{Id: dstId, Prefixes: []string{\"+4915\", \"+4916\", \"+4917\"}}\n\tif err := rater.Call(utils.APIerSv1GetDestination, &dstId, reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetDestination: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedReply, reply) {\n\t\tt.Errorf(\"Calling APIerSv1.GetDestination expected: %v, received: %v\", expectedReply, reply)\n\t}\n}\n\n// Test here GetRatingPlan\nfunc testApierGetRatingPlan(t *testing.T) {\n\treply := new(engine.RatingPlan)\n\trplnId := \"RETAIL1\"\n\tif err := rater.Call(utils.APIerSv1GetRatingPlan, &rplnId, reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetRatingPlan: \", err.Error())\n\t}\n\t// Check parts of info received since a full one is not possible due to unique map keys inside reply\n\tif reply.Id != rplnId {\n\t\tt.Error(\"Unexpected id received\", reply.Id)\n\t}\n\tif len(reply.Timings) != 1 || len(reply.Ratings) != 1 {\n\t\tt.Error(\"Unexpected number of items received\")\n\t}\n\triRate := &engine.RIRate{ConnectFee: 0, RoundingMethod: \"*up\", RoundingDecimals: 2, Rates: []*engine.RGRate{\n\t\t{GroupIntervalStart: 0, Value: 0, RateIncrement: time.Duration(60) * time.Second, RateUnit: time.Duration(60) * time.Second},\n\t}}\n\tfor _, rating := range reply.Ratings {\n\t\triRateJson, _ := json.Marshal(rating)\n\t\tif !reflect.DeepEqual(rating, riRate) {\n\t\t\tt.Errorf(\"Unexpected riRate received: %s\", riRateJson)\n\t\t\t// {\"Id\":\"RT_FS_USERS\",\"ConnectFee\":0,\"Rates\":[{\"GroupIntervalStart\":0,\"Value\":0,\"RateIncrement\":60000000000,\"RateUnit\":60000000000}],\"RoundingMethod\":\"*up\",\"RoundingDecimals\":0}\n\t\t}\n\t}\n}\n\nfunc testApierRemoveRatingPlan(t *testing.T) {\n\trplnId := \"RETAIL1\"\n\tvar reply string\n\n\terr := rater.Call(utils.APIerSv1RemoveRatingPlan, &rplnId, &reply)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif reply != utils.OK {\n\t\tt.Errorf(\"Expected %s, received %s\", utils.OK, reply)\n\t}\n\t//get rating plan (the one that was removed. should return 'err not found')\n\tvar ratingPlan *engine.RatingPlan\n\terr = rater.Call(utils.APIerSv1GetRatingPlan, &rplnId, ratingPlan)\n\tif err == nil || err.Error() != utils.ErrNotFound.Error() {\n\t\tt.Errorf(\"Expecting error: %s, received: %v\", utils.ErrNotFound, err)\n\t}\n}\n\n// Test here AddBalance\nfunc testApierAddBalance(t *testing.T) {\n\tvar reply string\n\tattrs := &AttrAddBalance{Tenant: \"cgrates.org\", Account: \"1001\", BalanceType: utils.MONETARY, Value: 1.5}\n\tif err := rater.Call(utils.APIerSv1AddBalance, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.AddBalance: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.AddBalance received: %s\", reply)\n\t}\n\tattrs = &AttrAddBalance{Tenant: \"cgrates.org\", Account: \"dan\", BalanceType: utils.MONETARY, Value: 1.5}\n\tif err := rater.Call(utils.APIerSv1AddBalance, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.AddBalance: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.AddBalance received: %s\", reply)\n\t}\n\tattrs = &AttrAddBalance{Tenant: \"cgrates.org\", Account: \"dan2\", BalanceType: utils.MONETARY, Value: 1.5}\n\tif err := rater.Call(utils.APIerSv1AddBalance, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.AddBalance: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.AddBalance received: %s\", reply)\n\t}\n\tattrs = &AttrAddBalance{Tenant: \"cgrates.org\", Account: \"dan3\", BalanceType: utils.MONETARY, Value: 1.5}\n\tif err := rater.Call(utils.APIerSv1AddBalance, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.AddBalance: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.AddBalance received: %s\", reply)\n\t}\n\tattrs = &AttrAddBalance{Tenant: \"cgrates.org\", Account: \"dan3\", BalanceType: utils.MONETARY, Value: 2.1}\n\tif err := rater.Call(utils.APIerSv1AddBalance, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.AddBalance: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.AddBalance received: %s\", reply)\n\t}\n\tattrs = &AttrAddBalance{Tenant: \"cgrates.org\", Account: \"dan6\", BalanceType: utils.MONETARY, Value: 2.1}\n\tif err := rater.Call(utils.APIerSv1AddBalance, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.AddBalance: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.AddBalance received: %s\", reply)\n\t}\n\tattrs = &AttrAddBalance{Tenant: \"cgrates.org\", Account: \"dan6\", BalanceType: utils.MONETARY, Value: 1, Overwrite: true}\n\tif err := rater.Call(utils.APIerSv1AddBalance, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.AddBalance: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.AddBalance received: %s\", reply)\n\t}\n\n}\n\n// Test here ExecuteAction\nfunc testApierExecuteAction(t *testing.T) {\n\tvar reply string\n\t// Add balance to a previously known account\n\tattrs := utils.AttrExecuteAction{Tenant: \"cgrates.org\", Account: \"dan2\", ActionsId: \"PREPAID_10\"}\n\tif err := rater.Call(utils.APIerSv1ExecuteAction, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.ExecuteAction: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.ExecuteAction received: %s\", reply)\n\t}\n\treply2 := utils.EmptyString\n\t// Add balance to an account which does n exist\n\tattrs = utils.AttrExecuteAction{Tenant: \"cgrates.org\", Account: \"dan2\", ActionsId: \"DUMMY_ACTION\"}\n\tif err := rater.Call(utils.APIerSv1ExecuteAction, attrs, &reply2); err == nil || reply2 == utils.OK {\n\t\tt.Error(\"Expecting error on APIerSv1.ExecuteAction.\", err, reply2)\n\t}\n}\n\nfunc testApierSetActions(t *testing.T) {\n\tact1 := &V1TPAction{Identifier: utils.TOPUP_RESET, BalanceType: utils.MONETARY, Units: 75.0, ExpiryTime: utils.UNLIMITED, Weight: 20.0}\n\tattrs1 := &V1AttrSetActions{ActionsId: \"ACTS_1\", Actions: []*V1TPAction{act1}}\n\treply1 := utils.EmptyString\n\tif err := rater.Call(utils.APIerSv1SetActions, &attrs1, &reply1); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.SetActions: \", err.Error())\n\t} else if reply1 != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.SetActions received: %s\", reply1)\n\t}\n\t// Calling the second time should raise EXISTS\n\tif err := rater.Call(utils.APIerSv1SetActions, &attrs1, &reply1); err == nil || err.Error() != \"EXISTS\" {\n\t\tt.Error(\"Unexpected result on duplication: \", err.Error())\n\t}\n}\n\nfunc testApierGetActions(t *testing.T) {\n\texpectActs := []*utils.TPAction{\n\t\t{Identifier: utils.TOPUP_RESET, BalanceType: utils.MONETARY,\n\t\t\tUnits: \"75\", BalanceWeight: \"0\", BalanceBlocker: \"false\",\n\t\t\tBalanceDisabled: \"false\", ExpiryTime: utils.UNLIMITED, Weight: 20.0}}\n\n\tvar reply []*utils.TPAction\n\tif err := rater.Call(utils.APIerSv1GetActions, utils.StringPointer(\"ACTS_1\"), &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetActions: \", err.Error())\n\t} else if !reflect.DeepEqual(expectActs, reply) {\n\t\tt.Errorf(\"Expected: %v, received: %v\", utils.ToJSON(expectActs), utils.ToJSON(reply))\n\t}\n}\n\nfunc testApierSetActionPlan(t *testing.T) {\n\tatm1 := &AttrActionPlan{ActionsId: \"ACTS_1\", MonthDays: \"1\", Time: \"00:00:00\", Weight: 20.0}\n\tatms1 := &AttrSetActionPlan{Id: \"ATMS_1\", ActionPlan: []*AttrActionPlan{atm1}}\n\treply1 := utils.EmptyString\n\tif err := rater.Call(utils.APIerSv1SetActionPlan, &atms1, &reply1); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.SetActionPlan: \", err.Error())\n\t} else if reply1 != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.SetActionPlan received: %s\", reply1)\n\t}\n\t// Calling the second time should raise EXISTS\n\tif err := rater.Call(utils.APIerSv1SetActionPlan, &atms1, &reply1); err == nil || err.Error() != \"EXISTS\" {\n\t\tt.Error(\"Unexpected result on duplication: \", err.Error())\n\t}\n}\n\n// Test here AddTriggeredAction\nfunc testApierAddTriggeredAction(t *testing.T) {\n\tvar reply string\n\tattrs := &AttrAddBalance{Tenant: \"cgrates.org\", Account: \"dan32\", BalanceType: utils.MONETARY, Value: 1.5}\n\tif err := rater.Call(utils.APIerSv1AddBalance, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.AddBalance: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.AddBalance received: %s\", reply)\n\t}\n\t// Add balance to a previously known account\n\tattrsAddTrigger := &AttrAddActionTrigger{Tenant: \"cgrates.org\", Account: \"dan32\", BalanceType: utils.MONETARY,\n\t\tThresholdType: \"*min_balance\", ThresholdValue: 2, BalanceDestinationIds: utils.META_ANY, Weight: 10, ActionsId: \"WARN_VIA_HTTP\"}\n\tif err := rater.Call(utils.APIerSv1AddTriggeredAction, attrsAddTrigger, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.AddTriggeredAction: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.AddTriggeredAction received: %s\", reply)\n\t}\n\treply2 := utils.EmptyString\n\tattrs2 := new(AttrAddActionTrigger)\n\t*attrs2 = *attrsAddTrigger\n\tattrs2.Account = \"dan10\" // Does not exist so it should error when adding triggers on it\n\t// Add trigger to an account which does n exist\n\tif err := rater.Call(utils.APIerSv1AddTriggeredAction, attrs2, &reply2); err == nil {\n\t\tt.Error(\"Expecting error on APIerSv1.AddTriggeredAction.\", err, reply2)\n\t}\n}\n\n// Test here GetAccountActionTriggers\nfunc testApierGetAccountActionTriggers(t *testing.T) {\n\tvar reply engine.ActionTriggers\n\treq := utils.TenantAccount{Tenant: \"cgrates.org\", Account: \"dan32\"}\n\tif err := rater.Call(utils.APIerSv1GetAccountActionTriggers, &req, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccountActionTimings: \", err.Error())\n\t} else if len(reply) != 1 || reply[0].ActionsID != \"WARN_VIA_HTTP\" {\n\t\tt.Errorf(\"Unexpected action triggers received %v\", reply)\n\t}\n}\n\nfunc testApierAddTriggeredAction2(t *testing.T) {\n\tvar reply string\n\t// Add balance to a previously known account\n\tattrs := &AttrAddAccountActionTriggers{ActionTriggerIDs: []string{\"STANDARD_TRIGGERS\"}, Tenant: \"cgrates.org\", Account: \"dan2\"}\n\tif err := rater.Call(utils.APIerSv1AddAccountActionTriggers, &attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.AddAccountActionTriggers: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.AddAccountActionTriggers received: %s\", reply)\n\t}\n\treply2 := utils.EmptyString\n\tattrs2 := new(AttrAddAccountActionTriggers)\n\t*attrs2 = *attrs\n\tattrs2.Account = \"dan10\" // Does not exist so it should error when adding triggers on it\n\t// Add trigger to an account which does n exist\n\tif err := rater.Call(utils.APIerSv1AddAccountActionTriggers, &attrs2, &reply2); err == nil || reply2 == utils.OK {\n\t\tt.Error(\"Expecting error on APIerSv1.AddAccountActionTriggers.\", err, reply2)\n\t}\n}\n\n// Test here GetAccountActionTriggers\nfunc testApierGetAccountActionTriggers2(t *testing.T) {\n\tvar reply engine.ActionTriggers\n\treq := utils.TenantAccount{Tenant: \"cgrates.org\", Account: \"dan2\"}\n\tif err := rater.Call(utils.APIerSv1GetAccountActionTriggers, &req, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccountActionTimings: \", err.Error())\n\t} else if len(reply) != 1 || reply[0].ActionsID != \"LOG_BALANCE\" {\n\t\tt.Errorf(\"Unexpected action triggers received %v\", reply)\n\t}\n}\n\n// Test here SetAccountActionTriggers\nfunc testApierSetAccountActionTriggers(t *testing.T) {\n\t// Test first get so we can steal the id which we need to remove\n\tvar reply engine.ActionTriggers\n\treq := utils.TenantAccount{Tenant: \"cgrates.org\", Account: \"dan2\"}\n\tif err := rater.Call(utils.APIerSv1GetAccountActionTriggers, &req, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccountActionTimings: \", err.Error())\n\t} else if len(reply) != 1 || reply[0].ActionsID != \"LOG_BALANCE\" {\n\t\tfor _, atr := range reply {\n\t\t\tt.Logf(\"ATR: %+v\", atr)\n\t\t}\n\t\tt.Errorf(\"Unexpected action triggers received %v\", reply)\n\t}\n\tvar setReply string\n\tsetReq := AttrSetAccountActionTriggers{\n\t\tTenant: \"cgrates.org\",\n\t\tAccount: \"dan2\",\n\t\tAttrSetActionTrigger: AttrSetActionTrigger{\n\t\t\tUniqueID: reply[0].UniqueID,\n\t\t\tActionTrigger: map[string]interface{}{\n\t\t\t\tutils.ActivationDate: \"2016-02-05T18:00:00Z\",\n\t\t\t},\n\t\t},\n\t}\n\tif err := rater.Call(utils.APIerSv1ResetAccountActionTriggers, setReq, &setReply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.ResetActionTiming: \", err.Error())\n\t} else if setReply != utils.OK {\n\t\tt.Error(\"Unexpected answer received\", setReply)\n\t}\n\tif err := rater.Call(utils.APIerSv1SetAccountActionTriggers, setReq, &setReply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.RemoveActionTiming: \", err.Error())\n\t} else if setReply != utils.OK {\n\t\tt.Error(\"Unexpected answer received\", setReply)\n\t}\n\tif err := rater.Call(utils.APIerSv1GetAccountActionTriggers, &req, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccountActionTriggers: \", err.Error())\n\t} else if len(reply) != 1 || reply[0].ActivationDate != time.Date(2016, 2, 5, 18, 0, 0, 0, time.UTC) {\n\t\tt.Errorf(\"Unexpected action triggers received %+v\", reply[0])\n\t}\n}\n\n// Test here RemAccountActionTriggers\nfunc testApierRemAccountActionTriggers(t *testing.T) {\n\t// Test first get so we can steal the id which we need to remove\n\tvar reply engine.ActionTriggers\n\treq := utils.TenantAccount{Tenant: \"cgrates.org\", Account: \"dan2\"}\n\tif err := rater.Call(utils.APIerSv1GetAccountActionTriggers, &req, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccountActionTimings: \", err.Error())\n\t} else if len(reply) != 1 || reply[0].ActionsID != \"LOG_BALANCE\" {\n\t\tfor _, atr := range reply {\n\t\t\tt.Logf(\"ATR: %+v\", atr)\n\t\t}\n\t\tt.Errorf(\"Unexpected action triggers received %v\", reply)\n\t}\n\tvar rmReply string\n\trmReq := AttrRemoveAccountActionTriggers{Tenant: \"cgrates.org\", Account: \"dan2\", UniqueID: reply[0].UniqueID}\n\tif err := rater.Call(utils.APIerSv1ResetAccountActionTriggers, rmReq, &rmReply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.ResetActionTiming: \", err.Error())\n\t} else if rmReply != utils.OK {\n\t\tt.Error(\"Unexpected answer received\", rmReply)\n\t}\n\tif err := rater.Call(utils.APIerSv1RemoveAccountActionTriggers, rmReq, &rmReply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.RemoveActionTiming: \", err.Error())\n\t} else if rmReply != utils.OK {\n\t\tt.Error(\"Unexpected answer received\", rmReply)\n\t}\n\tif err := rater.Call(utils.APIerSv1GetAccountActionTriggers, &req, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccountActionTriggers: \", err.Error())\n\t} else if len(reply) != 0 {\n\t\tt.Errorf(\"Unexpected action triggers received %+v\", reply[0])\n\t}\n}\n\n// Test here SetAccount\nfunc testApierSetAccount(t *testing.T) {\n\tvar reply string\n\tattrs := &utils.AttrSetAccount{Tenant: \"cgrates.org\", Account: \"dan7\", ActionPlanID: \"ATMS_1\", ReloadScheduler: true}\n\tif err := rater.Call(utils.APIerSv1SetAccount, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.SetAccount: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.SetAccount received: %s\", reply)\n\t}\n\treply2 := utils.EmptyString\n\tattrs2 := new(utils.AttrSetAccount)\n\t*attrs2 = *attrs\n\tattrs2.ActionPlanID = \"DUMMY_DATA\" // Does not exist so it should error when adding triggers on it\n\t// Add account with actions timing which does not exist\n\tif err := rater.Call(utils.APIerSv1SetAccount, attrs2, &reply2); err == nil || reply2 == utils.OK { // OK is not welcomed\n\t\tt.Error(\"Expecting error on APIerSv1.SetAccount.\", err, reply2)\n\t}\n}\n\n// Test here GetAccountActionTimings\nfunc testApierGetAccountActionPlan(t *testing.T) {\n\tvar reply []*AccountActionTiming\n\treq := utils.TenantAccount{Tenant: \"cgrates.org\", Account: \"dan7\"}\n\tif err := rater.Call(utils.APIerSv1GetAccountActionPlan, &req, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccountActionPlan: \", err.Error())\n\t} else if len(reply) != 1 {\n\t\tt.Error(\"Unexpected action plan received: \", utils.ToJSON(reply))\n\t} else {\n\t\tif reply[0].ActionPlanId != \"ATMS_1\" {\n\t\t\tt.Errorf(\"Unexpected ActionoveAccountPlanId received\")\n\t\t}\n\t}\n}\n\n// Make sure we have scheduled actions\nfunc testApierITGetScheduledActionsForAccount(t *testing.T) {\n\tvar rply []*scheduler.ScheduledAction\n\tif err := rater.Call(utils.APIerSv1GetScheduledActions,\n\t\tscheduler.ArgsGetScheduledActions{\n\t\t\tTenant: utils.StringPointer(\"cgrates.org\"),\n\t\t\tAccount: utils.StringPointer(\"dan7\")}, &rply); err != nil {\n\t\tt.Error(\"Unexpected error: \", err)\n\t} else if len(rply) == 0 {\n\t\tt.Errorf(\"ScheduledActions: %+v\", rply)\n\t}\n}\n\n// Test here RemoveActionTiming\nfunc testApierRemUniqueIDActionTiming(t *testing.T) {\n\tvar rmReply string\n\trmReq := AttrRemoveActionTiming{ActionPlanId: \"ATMS_1\", Tenant: \"cgrates.org\", Account: \"dan4\"}\n\tif err := rater.Call(utils.APIerSv1RemoveActionTiming, &rmReq, &rmReply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.RemoveActionTiming: \", err.Error())\n\t} else if rmReply != utils.OK {\n\t\tt.Error(\"Unexpected answer received\", rmReply)\n\t}\n\tvar reply []*AccountActionTiming\n\treq := utils.TenantAccount{Tenant: \"cgrates.org\", Account: \"dan4\"}\n\tif err := rater.Call(utils.APIerSv1GetAccountActionPlan, &req, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccountActionPlan: \", err.Error())\n\t} else if len(reply) != 0 {\n\t\tt.Error(\"Action timings was not removed\")\n\t}\n}\n\n// Test here GetAccount\nfunc testApierGetAccount(t *testing.T) {\n\tvar reply *engine.Account\n\tattrs := &utils.AttrGetAccount{Tenant: \"cgrates.org\", Account: \"1001\"}\n\tif err := rater.Call(utils.APIerSv2GetAccount, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccount: \", err.Error())\n\t} else if reply.BalanceMap[utils.MONETARY].GetTotalValue() != 11.5 { // We expect 11.5 since we have added in the previous test 1.5\n\t\tt.Errorf(\"Calling APIerSv1.GetBalance expected: 11.5, received: %f\", reply.BalanceMap[utils.MONETARY].GetTotalValue())\n\t}\n\tattrs = &utils.AttrGetAccount{Tenant: \"cgrates.org\", Account: \"dan\"}\n\tif err := rater.Call(utils.APIerSv2GetAccount, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccount: \", err.Error())\n\t} else if reply.BalanceMap[utils.MONETARY].GetTotalValue() != 1.5 {\n\t\tt.Errorf(\"Calling APIerSv1.GetAccount expected: 1.5, received: %f\", reply.BalanceMap[utils.MONETARY].GetTotalValue())\n\t}\n\t// The one we have topped up though executeAction\n\tattrs = &utils.AttrGetAccount{Tenant: \"cgrates.org\", Account: \"dan2\"}\n\tif err := rater.Call(utils.APIerSv2GetAccount, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccount: \", err.Error())\n\t} else if reply.BalanceMap[utils.MONETARY].GetTotalValue() != 11.5 {\n\t\tt.Errorf(\"Calling APIerSv1.GetAccount expected: 10, received: %f\", reply.BalanceMap[utils.MONETARY].GetTotalValue())\n\t}\n\tattrs = &utils.AttrGetAccount{Tenant: \"cgrates.org\", Account: \"dan3\"}\n\tif err := rater.Call(utils.APIerSv2GetAccount, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccount: \", err.Error())\n\t} else if reply.BalanceMap[utils.MONETARY].GetTotalValue() != 3.6 {\n\t\tt.Errorf(\"Calling APIerSv1.GetAccount expected: 3.6, received: %f\", reply.BalanceMap[utils.MONETARY].GetTotalValue())\n\t}\n\tattrs = &utils.AttrGetAccount{Tenant: \"cgrates.org\", Account: \"dan6\"}\n\tif err := rater.Call(utils.APIerSv2GetAccount, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccount: \", err.Error())\n\t} else if reply.BalanceMap[utils.MONETARY].GetTotalValue() != 1 {\n\t\tt.Errorf(\"Calling APIerSv1.GetAccount expected: 1, received: %f\", reply.BalanceMap[utils.MONETARY].GetTotalValue())\n\t}\n}\n\n// Start with initial balance, top-up to test max_balance\nfunc testApierTriggersExecute(t *testing.T) {\n\tvar reply string\n\tattrs := &utils.AttrSetAccount{Tenant: \"cgrates.org\", Account: \"dan8\", ReloadScheduler: true}\n\tif err := rater.Call(utils.APIerSv1SetAccount, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.SetAccount: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.SetAccount received: %s\", reply)\n\t}\n\tattrAddBlnc := &AttrAddBalance{Tenant: \"cgrates.org\", Account: \"1008\", BalanceType: utils.MONETARY, Value: 2}\n\tif err := rater.Call(utils.APIerSv1AddBalance, attrAddBlnc, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.AddBalance: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Calling APIerSv1.AddBalance received: %s\", reply)\n\t}\n}\n\n// Start fresh before loading from folder\nfunc testApierResetDataBeforeLoadFromFolder(t *testing.T) {\n\ttestApierInitDataDb(t)\n\tvar reply string\n\t// Simple test that command is executed without errors\n\tif err := rater.Call(utils.CacheSv1Clear, &utils.AttrCacheIDsWithOpts{\n\t\tCacheIDs: nil,\n\t}, &reply); err != nil {\n\t\tt.Error(err)\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Reply: \", reply)\n\t}\n\tvar rcvStats map[string]*ltcache.CacheStats\n\texpectedStats := engine.GetDefaultEmptyCacheStats()\n\terr := rater.Call(utils.CacheSv1GetCacheStats, new(utils.AttrCacheIDsWithOpts), &rcvStats)\n\tif err != nil {\n\t\tt.Error(\"Got error on CacheSv1.GetCacheStats: \", err.Error())\n\t} else if !reflect.DeepEqual(rcvStats, expectedStats) {\n\t\tt.Errorf(\"Calling CacheSv1.GetCacheStats expected: %v, received: %v\", utils.ToJSON(expectedStats), utils.ToJSON(rcvStats))\n\t}\n}\n\n// Test here LoadTariffPlanFromFolder\nfunc testApierLoadTariffPlanFromFolder(t *testing.T) {\n\tvar reply string\n\tattrs := &utils.AttrLoadTpFromFolder{FolderPath: utils.EmptyString}\n\tif err := rater.Call(utils.APIerSv1LoadTariffPlanFromFolder, attrs, &reply); err == nil || !strings.HasPrefix(err.Error(), utils.ErrMandatoryIeMissing.Error()) {\n\t\tt.Error(err)\n\t}\n\tattrs = &utils.AttrLoadTpFromFolder{FolderPath: \"/INVALID/\"}\n\tif err := rater.Call(utils.APIerSv1LoadTariffPlanFromFolder, attrs, &reply); err == nil || err.Error() != utils.ErrInvalidPath.Error() {\n\t\tt.Error(err)\n\t}\n\t// Simple test that command is executed without errors\n\tattrs = &utils.AttrLoadTpFromFolder{FolderPath: path.Join(*dataDir, \"tariffplans\", \"testtp\")}\n\tif err := rater.Call(utils.APIerSv1LoadTariffPlanFromFolder, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.LoadTariffPlanFromFolder: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.LoadTariffPlanFromFolder got reply: \", reply)\n\t}\n\ttime.Sleep(500 * time.Millisecond)\n}\n\n// For now just test that they execute without errors\nfunc testApierComputeReverse(t *testing.T) {\n\tvar reply string\n\tif err := rater.Call(utils.APIerSv1ComputeReverseDestinations, utils.EmptyString, &reply); err != nil {\n\t\tt.Error(err)\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Received: \", reply)\n\t}\n\tif err := rater.Call(utils.APIerSv1ComputeAccountActionPlans, utils.EmptyString, &reply); err != nil {\n\t\tt.Error(err)\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Received: \", reply)\n\t}\n}\n\nfunc testApierResetDataAfterLoadFromFolder(t *testing.T) {\n\ttime.Sleep(10 * time.Millisecond)\n\tvar rcvStats map[string]*ltcache.CacheStats\n\texpStats := engine.GetDefaultEmptyCacheStats()\n\texpStats[utils.CacheAccountActionPlans].Items = 13\n\texpStats[utils.CacheActionPlans].Items = 7\n\texpStats[utils.CacheActions].Items = 5\n\texpStats[utils.CacheDestinations].Items = 3\n\texpStats[utils.CacheLoadIDs].Items = 17\n\texpStats[utils.CacheRPCConnections].Items = 2\n\tif err := rater.Call(utils.CacheSv1GetCacheStats, new(utils.AttrCacheIDsWithOpts), &rcvStats); err != nil {\n\t\tt.Error(\"Got error on CacheSv1.GetCacheStats: \", err.Error())\n\t} else if !reflect.DeepEqual(expStats, rcvStats) {\n\t\tt.Errorf(\"Expecting: %+v,\\n received: %+v\", utils.ToJSON(expStats), utils.ToJSON(rcvStats))\n\t}\n\tvar reply string\n\t// Simple test that command is executed without errors\n\tif err := rater.Call(utils.CacheSv1LoadCache, utils.NewAttrReloadCacheWithOpts(), &reply); err != nil {\n\t\tt.Error(err)\n\t} else if reply != utils.OK {\n\t\tt.Error(reply)\n\t}\n\texpStats[utils.CacheActionTriggers].Items = 1\n\texpStats[utils.CacheActions].Items = 13\n\texpStats[utils.CacheAttributeProfiles].Items = 1\n\texpStats[utils.CacheFilters].Items = 15\n\texpStats[utils.CacheRatingPlans].Items = 5\n\texpStats[utils.CacheRatingProfiles].Items = 5\n\texpStats[utils.CacheResourceProfiles].Items = 3\n\texpStats[utils.CacheResources].Items = 3\n\texpStats[utils.CacheReverseDestinations].Items = 5\n\texpStats[utils.CacheStatQueueProfiles].Items = 1\n\texpStats[utils.CacheStatQueues].Items = 1\n\texpStats[utils.CacheRouteProfiles].Items = 2\n\texpStats[utils.CacheThresholdProfiles].Items = 1\n\texpStats[utils.CacheThresholds].Items = 1\n\texpStats[utils.CacheLoadIDs].Items = 33\n\texpStats[utils.CacheTimings].Items = 12\n\texpStats[utils.CacheThresholdFilterIndexes].Items = 5\n\texpStats[utils.CacheThresholdFilterIndexes].Groups = 1\n\texpStats[utils.CacheStatFilterIndexes].Items = 2\n\texpStats[utils.CacheStatFilterIndexes].Groups = 1\n\texpStats[utils.CacheRouteFilterIndexes].Items = 2\n\texpStats[utils.CacheRouteFilterIndexes].Groups = 1\n\texpStats[utils.CacheResourceFilterIndexes].Items = 5\n\texpStats[utils.CacheResourceFilterIndexes].Groups = 1\n\texpStats[utils.CacheAttributeFilterIndexes].Items = 4\n\texpStats[utils.CacheAttributeFilterIndexes].Groups = 1\n\texpStats[utils.CacheReverseFilterIndexes].Items = 10\n\texpStats[utils.CacheReverseFilterIndexes].Groups = 7\n\n\tif err := rater.Call(utils.CacheSv1GetCacheStats, new(utils.AttrCacheIDsWithOpts), &rcvStats); err != nil {\n\t\tt.Error(err)\n\t} else if !reflect.DeepEqual(expStats, rcvStats) {\n\t\tt.Errorf(\"Expecting: %+v, received: %+v\", utils.ToJSON(expStats), utils.ToJSON(rcvStats))\n\t}\n}\n\nfunc testApierSetChargerS(t *testing.T) {\n\t//add a default charger\n\tchargerProfile := &ChargerWithCache{\n\t\tChargerProfile: &engine.ChargerProfile{\n\t\t\tTenant: \"cgrates.org\",\n\t\t\tID: \"Default\",\n\t\t\tRunID: utils.MetaDefault,\n\t\t\tAttributeIDs: []string{\"*none\"},\n\t\t\tWeight: 20,\n\t\t},\n\t}\n\tvar result string\n\tif err := rater.Call(utils.APIerSv1SetChargerProfile, chargerProfile, &result); err != nil {\n\t\tt.Error(err)\n\t} else if result != utils.OK {\n\t\tt.Error(\"Unexpected reply returned\", result)\n\t}\n}\n\n// Make sure balance was topped-up\n// Bug reported by DigiDaz over IRC\nfunc testApierGetAccountAfterLoad(t *testing.T) {\n\tvar reply *engine.Account\n\tattrs := &utils.AttrGetAccount{Tenant: \"cgrates.org\", Account: \"1001\"}\n\tif err := rater.Call(utils.APIerSv2GetAccount, attrs, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.GetAccount: \", err.Error())\n\t} else if reply.BalanceMap[utils.MONETARY].GetTotalValue() != 13 {\n\t\tt.Errorf(\"Calling APIerSv1.GetBalance expected: 13, received: %v \\n\\n for:%s\", reply.BalanceMap[utils.MONETARY].GetTotalValue(), utils.ToJSON(reply))\n\t}\n}\n\n// Test here ResponderGetCost\nfunc testApierResponderGetCost(t *testing.T) {\n\ttStart, _ := utils.ParseTimeDetectLayout(\"2013-08-07T17:30:00Z\", utils.EmptyString)\n\ttEnd, _ := utils.ParseTimeDetectLayout(\"2013-08-07T17:31:30Z\", utils.EmptyString)\n\tcd := &engine.CallDescriptorWithOpts{\n\t\tCallDescriptor: &engine.CallDescriptor{\n\t\t\tCategory: \"call\",\n\t\t\tTenant: \"cgrates.org\",\n\t\t\tSubject: \"1001\",\n\t\t\tAccount: \"1001\",\n\t\t\tDestination: \"+4917621621391\",\n\t\t\tDurationIndex: 90,\n\t\t\tTimeStart: tStart,\n\t\t\tTimeEnd: tEnd,\n\t\t},\n\t}\n\tvar cc engine.CallCost\n\t// Simple test that command is executed without errors\n\tif err := rater.Call(utils.ResponderGetCost, cd, &cc); err != nil {\n\t\tt.Error(\"Got error on Responder.GetCost: \", err.Error())\n\t} else if cc.Cost != 90.0 {\n\t\tt.Errorf(\"Calling Responder.GetCost got callcost: %v\", cc)\n\t}\n}\n\nfunc testApierMaxDebitInexistentAcnt(t *testing.T) {\n\tcc := &engine.CallCost{}\n\tcd := &engine.CallDescriptorWithOpts{\n\t\tCallDescriptor: &engine.CallDescriptor{\n\t\t\tTenant: \"cgrates.org\",\n\t\t\tCategory: \"call\",\n\t\t\tSubject: \"INVALID\",\n\t\t\tAccount: \"INVALID\",\n\t\t\tDestination: \"1002\",\n\t\t\tTimeStart: time.Date(2014, 3, 27, 10, 42, 26, 0, time.UTC),\n\t\t\tTimeEnd: time.Date(2014, 3, 27, 10, 42, 26, 0, time.UTC).Add(time.Duration(10) * time.Second),\n\t\t},\n\t}\n\tif err := rater.Call(utils.ResponderMaxDebit, cd, cc); err == nil {\n\t\tt.Error(err.Error())\n\t}\n\tif err := rater.Call(utils.ResponderDebit, cd, cc); err == nil {\n\t\tt.Error(err.Error())\n\t}\n}\n\nfunc testApierCdrServer(t *testing.T) {\n\thttpClient := new(http.Client)\n\tcdrForm1 := url.Values{utils.OriginID: []string{\"dsafdsaf\"}, utils.OriginHost: []string{\"192.168.1.1\"}, utils.RequestType: []string{utils.META_RATED},\n\t\tutils.Tenant: []string{\"cgrates.org\"}, utils.Category: []string{\"call\"}, utils.Account: []string{\"1001\"}, utils.Subject: []string{\"1001\"}, utils.Destination: []string{\"1002\"},\n\t\tutils.SetupTime: []string{\"2013-11-07T08:42:22Z\"},\n\t\tutils.AnswerTime: []string{\"2013-11-07T08:42:26Z\"}, utils.Usage: []string{\"10\"}, \"field_extr1\": []string{\"val_extr1\"}, \"fieldextr2\": []string{\"valextr2\"}}\n\tcdrForm2 := url.Values{utils.OriginID: []string{\"adsafdsaf\"}, utils.OriginHost: []string{\"192.168.1.1\"}, utils.RequestType: []string{utils.META_RATED},\n\t\tutils.Tenant: []string{\"cgrates.org\"}, utils.Category: []string{\"call\"}, utils.Account: []string{\"1001\"}, utils.Subject: []string{\"1001\"}, utils.Destination: []string{\"1002\"},\n\t\tutils.SetupTime: []string{\"2013-11-07T08:42:23Z\"},\n\t\tutils.AnswerTime: []string{\"2013-11-07T08:42:26Z\"}, utils.Usage: []string{\"10\"}, \"field_extr1\": []string{\"val_extr1\"}, \"fieldextr2\": []string{\"valextr2\"}}\n\tfor _, cdrForm := range []url.Values{cdrForm1, cdrForm2} {\n\t\tcdrForm.Set(utils.Source, utils.TEST_SQL)\n\t\tif _, err := httpClient.PostForm(fmt.Sprintf(\"http://%s/cdr_http\", \"127.0.0.1:2080\"), cdrForm); err != nil {\n\t\t\tt.Error(err.Error())\n\t\t}\n\t}\n\ttime.Sleep(time.Duration(*waitRater) * time.Millisecond)\n}\n\nfunc testApierITGetCdrs(t *testing.T) {\n\tvar reply []*engine.ExternalCDR\n\treq := utils.AttrGetCdrs{MediationRunIds: []string{utils.MetaDefault}}\n\tif err := rater.Call(utils.APIerSv1GetCDRs, &req, &reply); err != nil {\n\t\tt.Error(\"Unexpected error: \", err.Error())\n\t} else if len(reply) != 2 {\n\t\tt.Error(\"Unexpected number of CDRs returned: \", len(reply))\n\t}\n}\n\nfunc testApierITProcessCdr(t *testing.T) {\n\tvar reply string\n\tcdr := &engine.CDRWithOpts{\n\t\tCDR: &engine.CDR{CGRID: utils.Sha1(\"dsafdsaf\", time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC).String()), OrderID: 123, ToR: utils.VOICE, OriginID: \"dsafdsaf\",\n\t\t\tOriginHost: \"192.168.1.1\", Source: \"test\", RequestType: utils.META_RATED, Tenant: \"cgrates.org\", Category: \"call\", Account: \"1001\", Subject: \"1001\",\n\t\t\tDestination: \"1002\",\n\t\t\tSetupTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC), AnswerTime: time.Date(2013, 11, 7, 8, 42, 26, 0, time.UTC), RunID: utils.MetaDefault,\n\t\t\tUsage: time.Duration(10) * time.Second, ExtraFields: map[string]string{\"field_extr1\": \"val_extr1\", \"fieldextr2\": \"valextr2\"}, Cost: 1.01,\n\t\t},\n\t}\n\tif err := rater.Call(utils.CDRsV1ProcessCDR, cdr, &reply); err != nil {\n\t\tt.Error(\"Unexpected error: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Unexpected reply received: \", reply)\n\t}\n\tvar cdrs []*engine.ExternalCDR\n\treq := utils.AttrGetCdrs{MediationRunIds: []string{utils.MetaDefault}}\n\tif err := rater.Call(utils.APIerSv1GetCDRs, &req, &cdrs); err != nil {\n\t\tt.Error(\"Unexpected error: \", err.Error())\n\t} else if len(cdrs) != 3 {\n\t\tt.Error(\"Unexpected number of CDRs returned: \", len(cdrs))\n\t}\n}\n\n// Test here ResponderGetCost\nfunc testApierGetCallCostLog(t *testing.T) {\n\tvar cc engine.EventCost\n\tvar attrs utils.AttrGetCallCost\n\t// Simple test that command is executed without errors\n\tif err := rater.Call(utils.APIerSv1GetEventCost, &attrs, &cc); err == nil {\n\t\tt.Error(\"Failed to detect missing fields in APIerSv1.GetCallCostLog\")\n\t}\n\tattrs.CgrId = \"dummyid\"\n\tattrs.RunId = \"default\"\n\tif err := rater.Call(utils.APIerSv1GetEventCost, &attrs, &cc); err == nil || err.Error() != utils.ErrNotFound.Error() {\n\t\tt.Error(\"APIerSv1.GetCallCostLog: should return NOT_FOUND, got:\", err)\n\t}\n\ttm := time.Now().Truncate(time.Millisecond).UTC()\n\tcdr := &engine.CDRWithOpts{\n\t\tCDR: &engine.CDR{\n\t\t\tCGRID: \"Cdr1\",\n\t\t\tOrderID: 123,\n\t\t\tToR: utils.VOICE,\n\t\t\tOriginID: \"OriginCDR1\",\n\t\t\tOriginHost: \"192.168.1.1\",\n\t\t\tSource: \"test\",\n\t\t\tRequestType: utils.META_RATED,\n\t\t\tTenant: \"cgrates.org\",\n\t\t\tCategory: \"call\",\n\t\t\tAccount: \"1001\",\n\t\t\tSubject: \"1001\",\n\t\t\tDestination: \"+4986517174963\",\n\t\t\tSetupTime: tm,\n\t\t\tAnswerTime: tm,\n\t\t\tRunID: utils.MetaDefault,\n\t\t\tUsage: time.Duration(0),\n\t\t\tExtraFields: map[string]string{\"field_extr1\": \"val_extr1\", \"fieldextr2\": \"valextr2\"},\n\t\t\tCost: 1.01,\n\t\t},\n\t}\n\tvar reply string\n\tif err := rater.Call(utils.CDRsV1ProcessCDR, cdr, &reply); err != nil {\n\t\tt.Error(\"Unexpected error: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Unexpected reply received: \", reply)\n\t}\n\ttime.Sleep(100 * time.Millisecond)\n\texpected := engine.EventCost{\n\t\tCGRID: \"Cdr1\",\n\t\tRunID: utils.MetaDefault,\n\t\tStartTime: tm,\n\t\tUsage: utils.DurationPointer(0),\n\t\tCost: utils.Float64Pointer(0),\n\t\tCharges: []*engine.ChargingInterval{{\n\t\t\tRatingID: utils.EmptyString,\n\t\t\tIncrements: nil,\n\t\t\tCompressFactor: 0,\n\t\t}},\n\t\tAccountSummary: nil,\n\t\tRating: engine.Rating{},\n\t\tAccounting: engine.Accounting{},\n\t\tRatingFilters: engine.RatingFilters{},\n\t\tRates: engine.ChargedRates{},\n\t\tTimings: engine.ChargedTimings{},\n\t}\n\tif *encoding == utils.MetaGOB {\n\t\texpected.Usage = nil // 0 value are encoded as nil in gob\n\t\texpected.Cost = nil\n\t}\n\tattrs.CgrId = \"Cdr1\"\n\tattrs.RunId = utils.EmptyString\n\tif err := rater.Call(utils.APIerSv1GetEventCost, &attrs, &cc); err != nil {\n\t\tt.Error(err)\n\t} else if !reflect.DeepEqual(expected, cc) {\n\t\tt.Errorf(\"Expecting %s ,recived %s\", utils.ToJSON(expected), utils.ToJSON(cc))\n\t}\n}\n\nfunc testApierITSetDestination(t *testing.T) {\n\tattrs := utils.AttrSetDestination{Id: \"TEST_SET_DESTINATION\", Prefixes: []string{\"+4986517174963\", \"+4986517174960\"}}\n\tvar reply string\n\tif err := rater.Call(utils.APIerSv1SetDestination, &attrs, &reply); err != nil {\n\t\tt.Error(\"Unexpected error\", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Unexpected reply returned\", reply)\n\t}\n\tif err := rater.Call(utils.APIerSv1SetDestination, &attrs, &reply); err == nil || err.Error() != \"EXISTS\" { // Second time without overwrite should generate error\n\t\tt.Error(\"Unexpected error\", err.Error())\n\t}\n\tattrs = utils.AttrSetDestination{Id: \"TEST_SET_DESTINATION\", Prefixes: []string{\"+4986517174963\", \"+4986517174964\"}, Overwrite: true}\n\tif err := rater.Call(utils.APIerSv1SetDestination, &attrs, &reply); err != nil {\n\t\tt.Error(\"Unexpected error\", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Unexpected reply returned\", reply)\n\t}\n\teDestination := engine.Destination{Id: attrs.Id, Prefixes: attrs.Prefixes}\n\tvar rcvDestination engine.Destination\n\tif err := rater.Call(utils.APIerSv1GetDestination, &attrs.Id, &rcvDestination); err != nil {\n\t\tt.Error(\"Unexpected error\", err.Error())\n\t} else if !reflect.DeepEqual(eDestination, rcvDestination) {\n\t\tt.Errorf(\"Expecting: %+v, received: %+v\", eDestination, rcvDestination)\n\t}\n\teRcvIDs := []string{attrs.Id}\n\tvar rcvIDs []string\n\tif err := rater.Call(utils.APIerSv1GetReverseDestination, &attrs.Prefixes[0], &rcvIDs); err != nil {\n\t\tt.Error(\"Unexpected error\", err.Error())\n\t} else if !reflect.DeepEqual(eRcvIDs, rcvIDs) {\n\t\tt.Errorf(\"Expecting: %+v, received: %+v\", eRcvIDs, rcvIDs)\n\t}\n}\n\nfunc testApierITGetScheduledActions(t *testing.T) {\n\tvar rply []*scheduler.ScheduledAction\n\tif err := rater.Call(utils.APIerSv1GetScheduledActions, scheduler.ArgsGetScheduledActions{}, &rply); err != nil {\n\t\tt.Error(\"Unexpected error: \", err)\n\t}\n}\n\nfunc testApierITGetDataCost(t *testing.T) {\n\tattrs := AttrGetDataCost{Category: \"data\", Tenant: \"cgrates.org\",\n\t\tSubject: \"1001\", AnswerTime: utils.MetaNow, Usage: 640113}\n\tvar rply *engine.DataCost\n\tif err := rater.Call(utils.APIerSv1GetDataCost, &attrs, &rply); err != nil {\n\t\tt.Error(\"Unexpected nil error received: \", err.Error())\n\t} else if rply.Cost != 128.0240 {\n\t\tt.Errorf(\"Unexpected cost received: %f\", rply.Cost)\n\t}\n}\n\nfunc testApierITGetCost(t *testing.T) {\n\tattrs := AttrGetCost{Category: \"data\", Tenant: \"cgrates.org\",\n\t\tSubject: \"1001\", AnswerTime: utils.MetaNow, Usage: \"640113\"}\n\tvar rply *engine.EventCost\n\tif err := rater.Call(utils.APIerSv1GetCost, &attrs, &rply); err != nil {\n\t\tt.Error(\"Unexpected nil error received: \", err.Error())\n\t} else if *rply.Cost != 128.0240 {\n\t\tt.Errorf(\"Unexpected cost received: %f\", *rply.Cost)\n\t}\n}\n\n// Test LoadTPFromStorDb\nfunc testApierInitDataDb2(t *testing.T) {\n\tif err := engine.InitDataDb(cfg); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc testApierInitStorDb2(t *testing.T) {\n\tif err := engine.InitStorDb(cfg); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc testApierReloadCache2(t *testing.T) {\n\tvar reply string\n\t// Simple test that command is executed without errors\n\tif err := rater.Call(utils.CacheSv1Clear, &utils.AttrCacheIDsWithOpts{\n\t\tCacheIDs: nil,\n\t}, &reply); err != nil {\n\t\tt.Error(\"Got error on CacheSv1.ReloadCache: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling CacheSv1.ReloadCache got reply: \", reply)\n\t}\n}\n\nfunc testApierReloadScheduler2(t *testing.T) {\n\tvar reply string\n\t// Simple test that command is executed without errors\n\tif err := rater.Call(utils.SchedulerSv1Reload, utils.StringWithOpts{}, &reply); err != nil {\n\t\tt.Error(\"Got error on SchedulerSv1.Reload: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling SchedulerSv1.Reload got reply: \", reply)\n\t}\n}\n\nfunc testApierImportTPFromFolderPath(t *testing.T) {\n\tvar reply string\n\tif err := rater.Call(utils.APIerSv1ImportTariffPlanFromFolder,\n\t\tutils.AttrImportTPFromFolder{TPid: \"TEST_TPID2\",\n\t\t\tFolderPath: \"/usr/share/cgrates/tariffplans/oldtutorial\"}, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.ImportTarrifPlanFromFolder: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.ImportTarrifPlanFromFolder got reply: \", reply)\n\t}\n\ttime.Sleep(500 * time.Millisecond)\n}\n\nfunc testApierLoadTariffPlanFromStorDbDryRun(t *testing.T) {\n\tvar reply string\n\tif err := rater.Call(utils.APIerSv1LoadTariffPlanFromStorDb,\n\t\t&AttrLoadTpFromStorDb{TPid: \"TEST_TPID2\", DryRun: true}, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.LoadTariffPlanFromStorDb: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.LoadTariffPlanFromStorDb got reply: \", reply)\n\t}\n}\n\nfunc testApierGetCacheStats2(t *testing.T) {\n\tvar rcvStats map[string]*ltcache.CacheStats\n\texpectedStats := engine.GetDefaultEmptyCacheStats()\n\terr := rater.Call(utils.CacheSv1GetCacheStats, new(utils.AttrCacheIDsWithOpts), &rcvStats)\n\tif err != nil {\n\t\tt.Error(\"Got error on CacheSv1.GetCacheStats: \", err.Error())\n\t} else if !reflect.DeepEqual(expectedStats, rcvStats) {\n\t\tt.Errorf(\"Calling CacheSv1.GetCacheStats expected: %v, received: %v\", expectedStats, rcvStats)\n\t}\n}\n\nfunc testApierLoadTariffPlanFromStorDb(t *testing.T) {\n\tvar reply string\n\tif err := rater.Call(utils.APIerSv1LoadTariffPlanFromStorDb,\n\t\t&AttrLoadTpFromStorDb{TPid: \"TEST_TPID2\"}, &reply); err != nil {\n\t\tt.Error(\"Got error on APIerSv1.LoadTariffPlanFromStorDb: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling APIerSv1.LoadTariffPlanFromStorDb got reply: \", reply)\n\t}\n}\n\nfunc testApierStartStopServiceStatus(t *testing.T) {\n\tvar reply string\n\tif err := rater.Call(utils.ServiceManagerV1ServiceStatus, dispatchers.ArgStartServiceWithOpts{ArgStartService: servmanager.ArgStartService{ServiceID: utils.MetaScheduler}},\n\t\t&reply); err != nil {\n\t\tt.Error(err)\n\t} else if reply != utils.RunningCaps {\n\t\tt.Errorf(\"Received: <%s>\", reply)\n\t}\n\tif err := rater.Call(utils.ServiceManagerV1StopService, dispatchers.ArgStartServiceWithOpts{ArgStartService: servmanager.ArgStartService{ServiceID: \"INVALID\"}},\n\t\t&reply); err == nil || err.Error() != utils.UnsupportedServiceIDCaps {\n\t\tt.Error(err)\n\t}\n\tif err := rater.Call(utils.ServiceManagerV1StopService, dispatchers.ArgStartServiceWithOpts{ArgStartService: servmanager.ArgStartService{ServiceID: utils.MetaScheduler}},\n\t\t&reply); err != nil {\n\t\tt.Error(err)\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Received: <%s>\", reply)\n\t}\n\tif err := rater.Call(utils.ServiceManagerV1ServiceStatus, dispatchers.ArgStartServiceWithOpts{ArgStartService: servmanager.ArgStartService{ServiceID: utils.MetaScheduler}},\n\t\t&reply); err != nil {\n\t\tt.Error(err)\n\t} else if reply != utils.StoppedCaps {\n\t\tt.Errorf(\"Received: <%s>\", reply)\n\t}\n\tif err := rater.Call(utils.ServiceManagerV1StartService, &dispatchers.ArgStartServiceWithOpts{ArgStartService: servmanager.ArgStartService{ServiceID: utils.MetaScheduler}},\n\t\t&reply); err != nil {\n\t\tt.Error(err)\n\t} else if reply != utils.OK {\n\t\tt.Errorf(\"Received: <%s>\", reply)\n\t}\n\tif err := rater.Call(utils.ServiceManagerV1ServiceStatus, dispatchers.ArgStartServiceWithOpts{ArgStartService: servmanager.ArgStartService{ServiceID: utils.MetaScheduler}},\n\t\t&reply); err != nil {\n\t\tt.Error(err)\n\t} else if reply != utils.RunningCaps {\n\t\tt.Errorf(\"Received: <%s>\", reply)\n\t}\n\tif err := rater.Call(utils.SchedulerSv1Reload, utils.StringWithOpts{}, &reply); err != nil {\n\t\tt.Error(\"Got error on SchedulerSv1.Reload: \", err.Error())\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Calling SchedulerSv1.Reload got reply: \", reply)\n\t}\n}\n\nfunc testApierReplayFldPosts(t *testing.T) {\n\tbev := []byte(`{\"ID\":\"cgrates.org:1007\",\"BalanceMap\":{\"*monetary\":[{\"Uuid\":\"367be35a-96ee-40a5-b609-9130661f5f12\",\"ID\":\"\",\"Value\":0,\"ExpirationDate\":\"0001-01-01T00:00:00Z\",\"Weight\":10,\"DestinationIDs\":{},\"RatingSubject\":\"\",\"Categories\":{},\"SharedGroups\":{\"SHARED_A\":true},\"Timings\":null,\"TimingIDs\":{},\"Disabled\":false,\"Factor\":null,\"Blocker\":false}]},\"UnitCounters\":{\"*monetary\":[{\"CounterType\":\"*event\",\"Counters\":[{\"Value\":0,\"Filter\":{\"Uuid\":null,\"ID\":\"b8531413-10d5-47ad-81ad-2bc272e8f0ca\",\"Type\":\"*monetary\",\"Value\":null,\"ExpirationDate\":null,\"Weight\":null,\"DestinationIDs\":{\"FS_USERS\":true},\"RatingSubject\":null,\"Categories\":null,\"SharedGroups\":null,\"TimingIDs\":null,\"Timings\":null,\"Disabled\":null,\"Factor\":null,\"Blocker\":null}}]}]},\"ActionTriggers\":[{\"ID\":\"STANDARD_TRIGGERS\",\"UniqueID\":\"46ac7b8c-685d-4555-bf73-fa6cfbc2fa21\",\"ThresholdType\":\"*min_balance\",\"ThresholdValue\":2,\"Recurrent\":false,\"MinSleep\":0,\"ExpirationDate\":\"0001-01-01T00:00:00Z\",\"ActivationDate\":\"0001-01-01T00:00:00Z\",\"Balance\":{\"Uuid\":null,\"ID\":null,\"Type\":\"*monetary\",\"Value\":null,\"ExpirationDate\":null,\"Weight\":null,\"DestinationIDs\":null,\"RatingSubject\":null,\"Categories\":null,\"SharedGroups\":null,\"TimingIDs\":null,\"Timings\":null,\"Disabled\":null,\"Factor\":null,\"Blocker\":null},\"Weight\":10,\"ActionsID\":\"LOG_WARNING\",\"MinQueuedItems\":0,\"Executed\":true,\"LastExecutionTime\":\"2017-01-31T14:03:57.961651647+01:00\"},{\"ID\":\"STANDARD_TRIGGERS\",\"UniqueID\":\"b8531413-10d5-47ad-81ad-2bc272e8f0ca\",\"ThresholdType\":\"*max_event_counter\",\"ThresholdValue\":5,\"Recurrent\":false,\"MinSleep\":0,\"ExpirationDate\":\"0001-01-01T00:00:00Z\",\"ActivationDate\":\"0001-01-01T00:00:00Z\",\"Balance\":{\"Uuid\":null,\"ID\":null,\"Type\":\"*monetary\",\"Value\":null,\"ExpirationDate\":null,\"Weight\":null,\"DestinationIDs\":{\"FS_USERS\":true},\"RatingSubject\":null,\"Categories\":null,\"SharedGroups\":null,\"TimingIDs\":null,\"Timings\":null,\"Disabled\":null,\"Factor\":null,\"Blocker\":null},\"Weight\":10,\"ActionsID\":\"LOG_WARNING\",\"MinQueuedItems\":0,\"Executed\":false,\"LastExecutionTime\":\"0001-01-01T00:00:00Z\"},{\"ID\":\"STANDARD_TRIGGERS\",\"UniqueID\":\"8b424186-7a31-4aef-99c5-35e12e6fed41\",\"ThresholdType\":\"*max_balance\",\"ThresholdValue\":20,\"Recurrent\":false,\"MinSleep\":0,\"ExpirationDate\":\"0001-01-01T00:00:00Z\",\"ActivationDate\":\"0001-01-01T00:00:00Z\",\"Balance\":{\"Uuid\":null,\"ID\":null,\"Type\":\"*monetary\",\"Value\":null,\"ExpirationDate\":null,\"Weight\":null,\"DestinationIDs\":null,\"RatingSubject\":null,\"Categories\":null,\"SharedGroups\":null,\"TimingIDs\":null,\"Timings\":null,\"Disabled\":null,\"Factor\":null,\"Blocker\":null},\"Weight\":10,\"ActionsID\":\"LOG_WARNING\",\"MinQueuedItems\":0,\"Executed\":false,\"LastExecutionTime\":\"0001-01-01T00:00:00Z\"},{\"ID\":\"STANDARD_TRIGGERS\",\"UniqueID\":\"28557f3b-139c-4a27-9d17-bda1f54b7c19\",\"ThresholdType\":\"*max_balance\",\"ThresholdValue\":100,\"Recurrent\":false,\"MinSleep\":0,\"ExpirationDate\":\"0001-01-01T00:00:00Z\",\"ActivationDate\":\"0001-01-01T00:00:00Z\",\"Balance\":{\"Uuid\":null,\"ID\":null,\"Type\":\"*monetary\",\"Value\":null,\"ExpirationDate\":null,\"Weight\":null,\"DestinationIDs\":null,\"RatingSubject\":null,\"Categories\":null,\"SharedGroups\":null,\"TimingIDs\":null,\"Timings\":null,\"Disabled\":null,\"Factor\":null,\"Blocker\":null},\"Weight\":10,\"ActionsID\":\"DISABLE_AND_LOG\",\"MinQueuedItems\":0,\"Executed\":false,\"LastExecutionTime\":\"0001-01-01T00:00:00Z\"}],\"AllowNegative\":false,\"Disabled\":false}\"`)\n\tev := &engine.ExportEvents{\n\t\tPath: \"http://localhost:2081\",\n\t\tFormat: utils.MetaHTTPjson,\n\t\tEvents: []interface{}{bev},\n\t}\n\tfileName := \"act>*http_post|63bed4ea-615e-4096-b1f4-499f64f29b28.json\"\n\n\targs := ArgsReplyFailedPosts{\n\t\tFailedRequestsInDir: utils.StringPointer(\"/tmp/TestsAPIerSv1/in\"),\n\t\tFailedRequestsOutDir: utils.StringPointer(\"/tmp/TestsAPIerSv1/out\"),\n\t}\n\tfor _, dir := range []string{*args.FailedRequestsInDir, *args.FailedRequestsOutDir} {\n\t\tif err := os.RemoveAll(dir); err != nil {\n\t\t\tt.Errorf(\"Error %s removing folder: %s\", err, dir)\n\t\t}\n\t\tif err := os.MkdirAll(dir, 0755); err != nil {\n\t\t\tt.Errorf(\"Error %s creating folder: %s\", err, dir)\n\t\t}\n\t}\n\terr := ev.WriteToFile(path.Join(*args.FailedRequestsInDir, fileName))\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tvar reply string\n\tif err := rater.Call(utils.APIerSv1ReplayFailedPosts, &args, &reply); err != nil {\n\t\tt.Error(err)\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Unexpected reply: \", reply)\n\t}\n\toutPath := path.Join(*args.FailedRequestsOutDir, fileName)\n\toutEv, err := engine.NewExportEventsFromFile(outPath)\n\tif err != nil {\n\t\tt.Error(err)\n\t} else if !reflect.DeepEqual(ev, outEv) {\n\t\tt.Errorf(\"Expecting: %q, received: %q\", utils.ToJSON(ev), utils.ToJSON(outEv))\n\t}\n\tfileName = \"cdr|ae8cc4b3-5e60-4396-b82a-64b96a72a03c.json\"\n\tbev = []byte(`{\"CGRID\":\"88ed9c38005f07576a1e1af293063833b60edcc6\"}`)\n\tfileInPath := path.Join(*args.FailedRequestsInDir, fileName)\n\tev = &engine.ExportEvents{\n\t\tPath: \"amqp://guest:guest@localhost:5672/\",\n\t\tOpts: map[string]interface{}{\n\t\t\t\"queueID\": \"cgrates_cdrs\",\n\t\t},\n\t\tFormat: utils.MetaAMQPjsonMap,\n\t\tEvents: []interface{}{bev},\n\t}\n\terr = ev.WriteToFile(path.Join(*args.FailedRequestsInDir, fileName))\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif err := rater.Call(utils.APIerSv1ReplayFailedPosts, &args, &reply); err != nil {\n\t\tt.Error(err)\n\t} else if reply != utils.OK {\n\t\tt.Error(\"Unexpected reply: \", reply)\n\t}\n\tif _, err := os.Stat(fileInPath); !os.IsNotExist(err) {\n\t\tt.Error(\"InFile still exists\")\n\t}\n\tif _, err := os.Stat(path.Join(*args.FailedRequestsOutDir, fileName)); !os.IsNotExist(err) {\n\t\tt.Error(\"OutFile created\")\n\t}\n\t// connect to RabbitMQ server and check if the content was posted there\n\tconn, err := amqp.Dial(\"amqp://guest:guest@localhost:5672/\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer conn.Close()\n\tch, err := conn.Channel()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer ch.Close()\n\tq, err := ch.QueueDeclare(\"cgrates_cdrs\", true, false, false, false, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tmsgs, err := ch.Consume(q.Name, utils.EmptyString, true, false, false, false, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tselect {\n\tcase d := <-msgs:\n\t\tvar rcvCDR map[string]string\n\t\tif err := json.Unmarshal(d.Body, &rcvCDR); err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif rcvCDR[utils.CGRID] != \"88ed9c38005f07576a1e1af293063833b60edcc6\" {\n\t\t\tt.Errorf(\"Unexpected CDR received: %+v\", rcvCDR)\n\t\t}\n\tcase <-time.After(time.Duration(100 * time.Millisecond)):\n\t\tt.Error(\"No message received from RabbitMQ\")\n\t}\n\tfor _, dir := range []string{*args.FailedRequestsInDir, *args.FailedRequestsOutDir} {\n\t\tif err := os.RemoveAll(dir); err != nil {\n\t\t\tt.Errorf(\"Error %s removing folder: %s\", err, dir)\n\t\t}\n\t}\n}\n\nfunc testApierGetDataDBVesions(t *testing.T) {\n\tvar reply *engine.Versions\n\tif err := rater.Call(utils.APIerSv1GetDataDBVersions, utils.StringPointer(utils.EmptyString), &reply); err != nil {\n\t\tt.Error(err)\n\t} else if !reflect.DeepEqual(engine.CurrentDataDBVersions(), *reply) {\n\t\tt.Errorf(\"Expecting : %+v, received: %+v\", engine.CurrentDataDBVersions(), *reply)\n\t}\n}\n\nfunc testApierGetStorDBVesions(t *testing.T) {\n\tvar reply *engine.Versions\n\tif err := rater.Call(utils.APIerSv1GetStorDBVersions, utils.StringPointer(utils.EmptyString), &reply); err != nil {\n\t\tt.Error(err)\n\t} else if !reflect.DeepEqual(engine.CurrentStorDBVersions(), *reply) {\n\t\tt.Errorf(\"Expecting : %+v, received: %+v\", engine.CurrentStorDBVersions(), *reply)\n\t}\n}\n\nfunc testApierBackwardsCompatible(t *testing.T) {\n\tvar reply string\n\tif err := rater.Call(\"ApierV1.Ping\", new(utils.CGREvent), &reply); err != nil {\n\t\tt.Error(err)\n\t} else if reply != utils.Pong {\n\t\tt.Errorf(\"Expecting : %+v, received: %+v\", utils.Pong, reply)\n\t}\n}\n\n// Simply kill the engine after we are done with tests within this file\nfunc testApierStopEngine(t *testing.T) {\n\tif err := engine.KillEngine(100); err != nil {\n\t\tt.Error(err)\n\t}\n}\n"} +{"text": "//===- SetTheory.cpp - Generate ordered sets from DAG expressions ---------===//\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 implements the SetTheory class that computes ordered sets of\n// Records from DAG expressions.\n//\n//===----------------------------------------------------------------------===//\n\n#include \"llvm/Support/Format.h\"\n#include \"llvm/TableGen/Error.h\"\n#include \"llvm/TableGen/Record.h\"\n#include \"llvm/TableGen/SetTheory.h\"\n\nusing namespace llvm;\n\n// Define the standard operators.\nnamespace {\n\ntypedef SetTheory::RecSet RecSet;\ntypedef SetTheory::RecVec RecVec;\n\n// (add a, b, ...) Evaluate and union all arguments.\nstruct AddOp : public SetTheory::Operator {\n void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts,\n ArrayRef Loc) override {\n ST.evaluate(Expr->arg_begin(), Expr->arg_end(), Elts, Loc);\n }\n};\n\n// (sub Add, Sub, ...) Set difference.\nstruct SubOp : public SetTheory::Operator {\n void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts,\n ArrayRef Loc) override {\n if (Expr->arg_size() < 2)\n PrintFatalError(Loc, \"Set difference needs at least two arguments: \" +\n Expr->getAsString());\n RecSet Add, Sub;\n ST.evaluate(*Expr->arg_begin(), Add, Loc);\n ST.evaluate(Expr->arg_begin() + 1, Expr->arg_end(), Sub, Loc);\n for (RecSet::iterator I = Add.begin(), E = Add.end(); I != E; ++I)\n if (!Sub.count(*I))\n Elts.insert(*I);\n }\n};\n\n// (and S1, S2) Set intersection.\nstruct AndOp : public SetTheory::Operator {\n void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts,\n ArrayRef Loc) override {\n if (Expr->arg_size() != 2)\n PrintFatalError(Loc, \"Set intersection requires two arguments: \" +\n Expr->getAsString());\n RecSet S1, S2;\n ST.evaluate(Expr->arg_begin()[0], S1, Loc);\n ST.evaluate(Expr->arg_begin()[1], S2, Loc);\n for (RecSet::iterator I = S1.begin(), E = S1.end(); I != E; ++I)\n if (S2.count(*I))\n Elts.insert(*I);\n }\n};\n\n// SetIntBinOp - Abstract base class for (Op S, N) operators.\nstruct SetIntBinOp : public SetTheory::Operator {\n virtual void apply2(SetTheory &ST, DagInit *Expr, RecSet &Set, int64_t N,\n RecSet &Elts, ArrayRef Loc) = 0;\n\n void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts,\n ArrayRef Loc) override {\n if (Expr->arg_size() != 2)\n PrintFatalError(Loc, \"Operator requires (Op Set, Int) arguments: \" +\n Expr->getAsString());\n RecSet Set;\n ST.evaluate(Expr->arg_begin()[0], Set, Loc);\n IntInit *II = dyn_cast(Expr->arg_begin()[1]);\n if (!II)\n PrintFatalError(Loc, \"Second argument must be an integer: \" +\n Expr->getAsString());\n apply2(ST, Expr, Set, II->getValue(), Elts, Loc);\n }\n};\n\n// (shl S, N) Shift left, remove the first N elements.\nstruct ShlOp : public SetIntBinOp {\n void apply2(SetTheory &ST, DagInit *Expr, RecSet &Set, int64_t N,\n RecSet &Elts, ArrayRef Loc) override {\n if (N < 0)\n PrintFatalError(Loc, \"Positive shift required: \" +\n Expr->getAsString());\n if (unsigned(N) < Set.size())\n Elts.insert(Set.begin() + N, Set.end());\n }\n};\n\n// (trunc S, N) Truncate after the first N elements.\nstruct TruncOp : public SetIntBinOp {\n void apply2(SetTheory &ST, DagInit *Expr, RecSet &Set, int64_t N,\n RecSet &Elts, ArrayRef Loc) override {\n if (N < 0)\n PrintFatalError(Loc, \"Positive length required: \" +\n Expr->getAsString());\n if (unsigned(N) > Set.size())\n N = Set.size();\n Elts.insert(Set.begin(), Set.begin() + N);\n }\n};\n\n// Left/right rotation.\nstruct RotOp : public SetIntBinOp {\n const bool Reverse;\n\n RotOp(bool Rev) : Reverse(Rev) {}\n\n void apply2(SetTheory &ST, DagInit *Expr, RecSet &Set, int64_t N,\n RecSet &Elts, ArrayRef Loc) override {\n if (Reverse)\n N = -N;\n // N > 0 -> rotate left, N < 0 -> rotate right.\n if (Set.empty())\n return;\n if (N < 0)\n N = Set.size() - (-N % Set.size());\n else\n N %= Set.size();\n Elts.insert(Set.begin() + N, Set.end());\n Elts.insert(Set.begin(), Set.begin() + N);\n }\n};\n\n// (decimate S, N) Pick every N'th element of S.\nstruct DecimateOp : public SetIntBinOp {\n void apply2(SetTheory &ST, DagInit *Expr, RecSet &Set, int64_t N,\n RecSet &Elts, ArrayRef Loc) override {\n if (N <= 0)\n PrintFatalError(Loc, \"Positive stride required: \" +\n Expr->getAsString());\n for (unsigned I = 0; I < Set.size(); I += N)\n Elts.insert(Set[I]);\n }\n};\n\n// (interleave S1, S2, ...) Interleave elements of the arguments.\nstruct InterleaveOp : public SetTheory::Operator {\n void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts,\n ArrayRef Loc) override {\n // Evaluate the arguments individually.\n SmallVector Args(Expr->getNumArgs());\n unsigned MaxSize = 0;\n for (unsigned i = 0, e = Expr->getNumArgs(); i != e; ++i) {\n ST.evaluate(Expr->getArg(i), Args[i], Loc);\n MaxSize = std::max(MaxSize, unsigned(Args[i].size()));\n }\n // Interleave arguments into Elts.\n for (unsigned n = 0; n != MaxSize; ++n)\n for (unsigned i = 0, e = Expr->getNumArgs(); i != e; ++i)\n if (n < Args[i].size())\n Elts.insert(Args[i][n]);\n }\n};\n\n// (sequence \"Format\", From, To) Generate a sequence of records by name.\nstruct SequenceOp : public SetTheory::Operator {\n void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts,\n ArrayRef Loc) override {\n int Step = 1;\n if (Expr->arg_size() > 4)\n PrintFatalError(Loc, \"Bad args to (sequence \\\"Format\\\", From, To): \" +\n Expr->getAsString());\n else if (Expr->arg_size() == 4) {\n if (IntInit *II = dyn_cast(Expr->arg_begin()[3])) {\n Step = II->getValue();\n } else\n PrintFatalError(Loc, \"Stride must be an integer: \" +\n Expr->getAsString());\n }\n\n std::string Format;\n if (StringInit *SI = dyn_cast(Expr->arg_begin()[0]))\n Format = SI->getValue();\n else\n PrintFatalError(Loc, \"Format must be a string: \" + Expr->getAsString());\n\n int64_t From, To;\n if (IntInit *II = dyn_cast(Expr->arg_begin()[1]))\n From = II->getValue();\n else\n PrintFatalError(Loc, \"From must be an integer: \" + Expr->getAsString());\n if (From < 0 || From >= (1 << 30))\n PrintFatalError(Loc, \"From out of range\");\n\n if (IntInit *II = dyn_cast(Expr->arg_begin()[2]))\n To = II->getValue();\n else\n PrintFatalError(Loc, \"From must be an integer: \" + Expr->getAsString());\n if (To < 0 || To >= (1 << 30))\n PrintFatalError(Loc, \"To out of range\");\n\n RecordKeeper &Records =\n cast(Expr->getOperator())->getDef()->getRecords();\n\n Step *= From <= To ? 1 : -1;\n while (true) {\n if (Step > 0 && From > To)\n break;\n else if (Step < 0 && From < To)\n break;\n std::string Name;\n raw_string_ostream OS(Name);\n OS << format(Format.c_str(), unsigned(From));\n Record *Rec = Records.getDef(OS.str());\n if (!Rec)\n PrintFatalError(Loc, \"No def named '\" + Name + \"': \" +\n Expr->getAsString());\n // Try to reevaluate Rec in case it is a set.\n if (const RecVec *Result = ST.expand(Rec))\n Elts.insert(Result->begin(), Result->end());\n else\n Elts.insert(Rec);\n\n From += Step;\n }\n }\n};\n\n// Expand a Def into a set by evaluating one of its fields.\nstruct FieldExpander : public SetTheory::Expander {\n StringRef FieldName;\n\n FieldExpander(StringRef fn) : FieldName(fn) {}\n\n void expand(SetTheory &ST, Record *Def, RecSet &Elts) override {\n ST.evaluate(Def->getValueInit(FieldName), Elts, Def->getLoc());\n }\n};\n} // end anonymous namespace\n\n// Pin the vtables to this file.\nvoid SetTheory::Operator::anchor() {}\nvoid SetTheory::Expander::anchor() {}\n\n\nSetTheory::SetTheory() {\n addOperator(\"add\", new AddOp);\n addOperator(\"sub\", new SubOp);\n addOperator(\"and\", new AndOp);\n addOperator(\"shl\", new ShlOp);\n addOperator(\"trunc\", new TruncOp);\n addOperator(\"rotl\", new RotOp(false));\n addOperator(\"rotr\", new RotOp(true));\n addOperator(\"decimate\", new DecimateOp);\n addOperator(\"interleave\", new InterleaveOp);\n addOperator(\"sequence\", new SequenceOp);\n}\n\nvoid SetTheory::addOperator(StringRef Name, Operator *Op) {\n Operators[Name] = Op;\n}\n\nvoid SetTheory::addExpander(StringRef ClassName, Expander *E) {\n Expanders[ClassName] = E;\n}\n\nvoid SetTheory::addFieldExpander(StringRef ClassName, StringRef FieldName) {\n addExpander(ClassName, new FieldExpander(FieldName));\n}\n\nvoid SetTheory::evaluate(Init *Expr, RecSet &Elts, ArrayRef Loc) {\n // A def in a list can be a just an element, or it may expand.\n if (DefInit *Def = dyn_cast(Expr)) {\n if (const RecVec *Result = expand(Def->getDef()))\n return Elts.insert(Result->begin(), Result->end());\n Elts.insert(Def->getDef());\n return;\n }\n\n // Lists simply expand.\n if (ListInit *LI = dyn_cast(Expr))\n return evaluate(LI->begin(), LI->end(), Elts, Loc);\n\n // Anything else must be a DAG.\n DagInit *DagExpr = dyn_cast(Expr);\n if (!DagExpr)\n PrintFatalError(Loc, \"Invalid set element: \" + Expr->getAsString());\n DefInit *OpInit = dyn_cast(DagExpr->getOperator());\n if (!OpInit)\n PrintFatalError(Loc, \"Bad set expression: \" + Expr->getAsString());\n Operator *Op = Operators.lookup(OpInit->getDef()->getName());\n if (!Op)\n PrintFatalError(Loc, \"Unknown set operator: \" + Expr->getAsString());\n Op->apply(*this, DagExpr, Elts, Loc);\n}\n\nconst RecVec *SetTheory::expand(Record *Set) {\n // Check existing entries for Set and return early.\n ExpandMap::iterator I = Expansions.find(Set);\n if (I != Expansions.end())\n return &I->second;\n\n // This is the first time we see Set. Find a suitable expander.\n const std::vector &SC = Set->getSuperClasses();\n for (unsigned i = 0, e = SC.size(); i != e; ++i) {\n // Skip unnamed superclasses.\n if (!dyn_cast(SC[i]->getNameInit()))\n continue;\n if (Expander *Exp = Expanders.lookup(SC[i]->getName())) {\n // This breaks recursive definitions.\n RecVec &EltVec = Expansions[Set];\n RecSet Elts;\n Exp->expand(*this, Set, Elts);\n EltVec.assign(Elts.begin(), Elts.end());\n return &EltVec;\n }\n }\n\n // Set is not expandable.\n return nullptr;\n}\n\n"} +{"text": "/*\n * Copyright (c) 1996,1997\n * Silicon Graphics Computer Systems, Inc.\n *\n * Copyright (c) 1999\n * Boris Fomitchev\n *\n * This material is provided \"as is\", with absolutely no warranty expressed\n * or implied. Any use is at your own risk.\n *\n * Permission to use or copy this software for any purpose is hereby granted\n * without fee, provided the above notices are retained on all copies.\n * Permission to modify the code and to distribute modified code is granted,\n * provided the above notices are retained, and a notice that the code was\n * modified is included with the above copyright notice.\n *\n */\n\n#ifndef _STLP_INTERNAL_STDEXCEPT\n#define _STLP_INTERNAL_STDEXCEPT\n\n#ifndef _STLP_INTERNAL_STDEXCEPT_BASE\n# include \n#endif\n\n#if !defined (_STLP_USE_NATIVE_STDEXCEPT) || defined (_STLP_USE_OWN_NAMESPACE)\n\n# if defined(_STLP_USE_EXCEPTIONS) || \\\n !(defined(_MIPS_SIM) && defined(_ABIO32) && (_MIPS_SIM == _ABIO32))\n\n_STLP_BEGIN_NAMESPACE\n\nclass _STLP_CLASS_DECLSPEC logic_error : public __Named_exception {\npublic:\n logic_error(const string& __s) : __Named_exception(__s) {}\n# ifndef _STLP_USE_NO_IOSTREAMS\n ~logic_error() _STLP_NOTHROW_INHERENTLY;\n# endif\n};\n\nclass _STLP_CLASS_DECLSPEC runtime_error : public __Named_exception {\npublic:\n runtime_error(const string& __s) : __Named_exception(__s) {}\n# ifndef _STLP_USE_NO_IOSTREAMS\n ~runtime_error() _STLP_NOTHROW_INHERENTLY;\n# endif\n};\n\nclass _STLP_CLASS_DECLSPEC domain_error : public logic_error {\npublic:\n domain_error(const string& __arg) : logic_error(__arg) {}\n# ifndef _STLP_USE_NO_IOSTREAMS\n ~domain_error() _STLP_NOTHROW_INHERENTLY;\n# endif\n};\n\nclass _STLP_CLASS_DECLSPEC invalid_argument : public logic_error {\npublic:\n invalid_argument(const string& __arg) : logic_error(__arg) {}\n# ifndef _STLP_USE_NO_IOSTREAMS\n ~invalid_argument() _STLP_NOTHROW_INHERENTLY;\n# endif\n};\n\nclass _STLP_CLASS_DECLSPEC length_error : public logic_error {\npublic:\n length_error(const string& __arg) : logic_error(__arg) {}\n# ifndef _STLP_USE_NO_IOSTREAMS\n ~length_error() _STLP_NOTHROW_INHERENTLY;\n# endif\n};\n\nclass _STLP_CLASS_DECLSPEC out_of_range : public logic_error {\npublic:\n out_of_range(const string& __arg) : logic_error(__arg) {}\n# ifndef _STLP_USE_NO_IOSTREAMS\n ~out_of_range() _STLP_NOTHROW_INHERENTLY;\n# endif\n};\n\nclass _STLP_CLASS_DECLSPEC range_error : public runtime_error {\npublic:\n range_error(const string& __arg) : runtime_error(__arg) {}\n# ifndef _STLP_USE_NO_IOSTREAMS\n ~range_error() _STLP_NOTHROW_INHERENTLY;\n# endif\n};\n\nclass _STLP_CLASS_DECLSPEC overflow_error : public runtime_error {\npublic:\n overflow_error(const string& __arg) : runtime_error(__arg) {}\n# ifndef _STLP_USE_NO_IOSTREAMS\n ~overflow_error() _STLP_NOTHROW_INHERENTLY;\n# endif\n};\n\nclass _STLP_CLASS_DECLSPEC underflow_error : public runtime_error {\npublic:\n underflow_error(const string& __arg) : runtime_error(__arg) {}\n# ifndef _STLP_USE_NO_IOSTREAMS\n ~underflow_error() _STLP_NOTHROW_INHERENTLY;\n# endif\n};\n\n_STLP_END_NAMESPACE\n\n# endif\n#endif\n\n#endif /* _STLP_INTERNAL_STDEXCEPT */\n"} +{"text": "/**\n * > Author: UncP\n * > Mail: 770778010@qq.com\n * > Github:\t https://www.github.com/UncP/Giraffe\n * > Description:\n *\n * > Created Time: 2016-09-20 22:58:36\n**/\n\n#ifndef _CYLINDER_HPP_\n#define _CYLINDER_HPP_\n\n#include \"../math/point.hpp\"\n#include \"../core/object.hpp\"\n\nnamespace Giraffe {\n\nclass Cylinder : public Object\n{\n\tpublic:\n\t\tCylinder(\tconst Point3d ¢er1, const Point3d ¢er2, const double radis,\n\t\t\t\t\t\t\tconst Material *material);\n\n\t\tbool intersect(const Ray &, Isect &) const override;\n\n\t\tvoid computeBox(std::vector &, std::vector &,\n\t\t\tconst Vector3d *) const override;\n\n\t\tbool hit(const Ray &ray, const double &distance) const override;\n\n\t\tstd::ostream& print(std::ostream &os) const override {\n\t\t\treturn os << \"cylinder\\n\" << center1_ << center2_ << radius_ << std::endl;\n\t\t}\n\n\tprivate:\n\t\tPoint3d center1_;\n\t\tPoint3d center2_;\n\t\tdouble radius_;\n\t\tdouble radius2_;\n\t\tdouble inv2radius_;\n\t\tdouble tmax_;\n\t\tVector3d axis_;\n\t\tconst Material *material_;\n};\n\n} // namespace Giraffe\n\n#endif /* _CYLINDER_HPP_ */"} +{"text": "\n\n \n netcoreapp2.0\n\n false\n\n 0.4.2.0\n\n 0.4.2.0\n\n 0.4.2-beta\n \n\n \n \n \n \n\n \n \n Never\n \n \n Never\n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n\n"} +{"text": "fa-panel{margin-bottom: 10px;display: block}\nfa-panel:last-child{margin-bottom: 160px}"} +{"text": "## Define configure options for lcdf-typetools. Extracted from configure.ac\n## for ease of building TeX Live.\nm4_define_default([kpse_indent_26], [26])[]dnl\nm4_define([kpse_lcdf_typetools_progs], [cfftot1 mmafm mmpfb otfinfo otftotfm t1dotlessj t1lint t1rawafm t1reencode t1testpage ttftotype42])[]dnl\nAC_FOREACH([Kpse_Prog], kpse_lcdf_typetools_progs,\n [AC_ARG_ENABLE(Kpse_Prog,\n AS_HELP_STRING([--disable-]Kpse_Prog,\n [do not build the ]Kpse_Prog[ program],\n kpse_indent_26))])\nm4_define([kpse_otftotfm_auto_opts], [cfftot1 t1dotlessj ttftotype42 updmap])[]dnl\nAC_FOREACH([Kpse_Opt], kpse_otftotfm_auto_opts,\n [AC_ARG_ENABLE(Kpse_Opt,\n AS_HELP_STRING([--disable-auto-]Kpse_Opt,\n [disable running ]Kpse_Opt[ from otftotfm],\n kpse_indent_26))])\n"} +{"text": "// SPDX-License-Identifier: GPL-2.0\n/*\n * Documentation/ABI/stable/sysfs-fs-orangefs:\n *\n * What:\t\t/sys/fs/orangefs/perf_counter_reset\n * Date:\t\tJune 2015\n * Contact:\t\tMike Marshall \n * Description:\n * \t\t\techo a 0 or a 1 into perf_counter_reset to\n * \t\t\treset all the counters in\n * \t\t\t/sys/fs/orangefs/perf_counters\n * \t\t\texcept ones with PINT_PERF_PRESERVE set.\n *\n *\n * What:\t\t/sys/fs/orangefs/perf_counters/...\n * Date:\t\tJun 2015\n * Contact:\t\tMike Marshall \n * Description:\n * \t\t\tCounters and settings for various caches.\n * \t\t\tRead only.\n *\n *\n * What:\t\t/sys/fs/orangefs/perf_time_interval_secs\n * Date:\t\tJun 2015\n * Contact:\t\tMike Marshall \n * Description:\n *\t\t\tLength of perf counter intervals in\n *\t\t\tseconds.\n *\n *\n * What:\t\t/sys/fs/orangefs/perf_history_size\n * Date:\t\tJun 2015\n * Contact:\t\tMike Marshall \n * Description:\n * \t\t\tThe perf_counters cache statistics have N, or\n * \t\t\tperf_history_size, samples. The default is\n * \t\t\tone.\n *\n *\t\t\tEvery perf_time_interval_secs the (first)\n *\t\t\tsamples are reset.\n *\n *\t\t\tIf N is greater than one, the \"current\" set\n *\t\t\tof samples is reset, and the samples from the\n *\t\t\tother N-1 intervals remain available.\n *\n *\n * What:\t\t/sys/fs/orangefs/op_timeout_secs\n * Date:\t\tJun 2015\n * Contact:\t\tMike Marshall \n * Description:\n *\t\t\tService operation timeout in seconds.\n *\n *\n * What:\t\t/sys/fs/orangefs/slot_timeout_secs\n * Date:\t\tJun 2015\n * Contact:\t\tMike Marshall \n * Description:\n *\t\t\t\"Slot\" timeout in seconds. A \"slot\"\n *\t\t\tis an indexed buffer in the shared\n *\t\t\tmemory segment used for communication\n *\t\t\tbetween the kernel module and userspace.\n *\t\t\tSlots are requested and waited for,\n *\t\t\tthe wait times out after slot_timeout_secs.\n *\n * What:\t\t/sys/fs/orangefs/dcache_timeout_msecs\n * Date:\t\tJul 2016\n * Contact:\t\tMartin Brandenburg \n * Description:\n *\t\t\tTime lookup is valid in milliseconds.\n *\n * What:\t\t/sys/fs/orangefs/getattr_timeout_msecs\n * Date:\t\tJul 2016\n * Contact:\t\tMartin Brandenburg \n * Description:\n *\t\t\tTime getattr is valid in milliseconds.\n *\n * What:\t\t/sys/fs/orangefs/readahead_count\n * Date:\t\tAug 2016\n * Contact:\t\tMartin Brandenburg \n * Description:\n *\t\t\tReadahead cache buffer count.\n *\n * What:\t\t/sys/fs/orangefs/readahead_size\n * Date:\t\tAug 2016\n * Contact:\t\tMartin Brandenburg \n * Description:\n *\t\t\tReadahead cache buffer size.\n *\n * What:\t\t/sys/fs/orangefs/readahead_count_size\n * Date:\t\tAug 2016\n * Contact:\t\tMartin Brandenburg \n * Description:\n *\t\t\tReadahead cache buffer count and size.\n *\n * What:\t\t/sys/fs/orangefs/readahead_readcnt\n * Date:\t\tJan 2017\n * Contact:\t\tMartin Brandenburg \n * Description:\n *\t\t\tNumber of buffers (in multiples of readahead_size)\n *\t\t\twhich can be read ahead for a single file at once.\n *\n * What:\t\t/sys/fs/orangefs/acache/...\n * Date:\t\tJun 2015\n * Contact:\t\tMartin Brandenburg \n * Description:\n * \t\t\tAttribute cache configurable settings.\n *\n *\n * What:\t\t/sys/fs/orangefs/ncache/...\n * Date:\t\tJun 2015\n * Contact:\t\tMike Marshall \n * Description:\n * \t\t\tName cache configurable settings.\n *\n *\n * What:\t\t/sys/fs/orangefs/capcache/...\n * Date:\t\tJun 2015\n * Contact:\t\tMike Marshall \n * Description:\n * \t\t\tCapability cache configurable settings.\n *\n *\n * What:\t\t/sys/fs/orangefs/ccache/...\n * Date:\t\tJun 2015\n * Contact:\t\tMike Marshall \n * Description:\n * \t\t\tCredential cache configurable settings.\n *\n */\n\n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \"protocol.h\"\n#include \"orangefs-kernel.h\"\n#include \"orangefs-sysfs.h\"\n\n#define ORANGEFS_KOBJ_ID \"orangefs\"\n#define ACACHE_KOBJ_ID \"acache\"\n#define CAPCACHE_KOBJ_ID \"capcache\"\n#define CCACHE_KOBJ_ID \"ccache\"\n#define NCACHE_KOBJ_ID \"ncache\"\n#define PC_KOBJ_ID \"pc\"\n#define STATS_KOBJ_ID \"stats\"\n\n/*\n * Every item calls orangefs_attr_show and orangefs_attr_store through\n * orangefs_sysfs_ops. They look at the orangefs_attributes further below to\n * call one of sysfs_int_show, sysfs_int_store, sysfs_service_op_show, or\n * sysfs_service_op_store.\n */\n\nstruct orangefs_attribute {\n\tstruct attribute attr;\n\tssize_t (*show)(struct kobject *kobj,\n\t\t\tstruct orangefs_attribute *attr,\n\t\t\tchar *buf);\n\tssize_t (*store)(struct kobject *kobj,\n\t\t\t struct orangefs_attribute *attr,\n\t\t\t const char *buf,\n\t\t\t size_t count);\n};\n\nstatic ssize_t orangefs_attr_show(struct kobject *kobj,\n\t\t\t\t struct attribute *attr,\n\t\t\t\t char *buf)\n{\n\tstruct orangefs_attribute *attribute;\n\n\tattribute = container_of(attr, struct orangefs_attribute, attr);\n\tif (!attribute->show)\n\t\treturn -EIO;\n\treturn attribute->show(kobj, attribute, buf);\n}\n\nstatic ssize_t orangefs_attr_store(struct kobject *kobj,\n\t\t\t\t struct attribute *attr,\n\t\t\t\t const char *buf,\n\t\t\t\t size_t len)\n{\n\tstruct orangefs_attribute *attribute;\n\n\tif (!strcmp(kobj->name, PC_KOBJ_ID) ||\n\t !strcmp(kobj->name, STATS_KOBJ_ID))\n\t\treturn -EPERM;\n\n\tattribute = container_of(attr, struct orangefs_attribute, attr);\n\tif (!attribute->store)\n\t\treturn -EIO;\n\treturn attribute->store(kobj, attribute, buf, len);\n}\n\nstatic const struct sysfs_ops orangefs_sysfs_ops = {\n\t.show = orangefs_attr_show,\n\t.store = orangefs_attr_store,\n};\n\nstatic ssize_t sysfs_int_show(struct kobject *kobj,\n struct orangefs_attribute *attr, char *buf)\n{\n\tint rc = -EIO;\n\n\tgossip_debug(GOSSIP_SYSFS_DEBUG, \"sysfs_int_show: id:%s:\\n\",\n\t kobj->name);\n\n\tif (!strcmp(kobj->name, ORANGEFS_KOBJ_ID)) {\n\t\tif (!strcmp(attr->attr.name, \"op_timeout_secs\")) {\n\t\t\trc = scnprintf(buf,\n\t\t\t\t PAGE_SIZE,\n\t\t\t\t \"%d\\n\",\n\t\t\t\t op_timeout_secs);\n\t\t\tgoto out;\n\t\t} else if (!strcmp(attr->attr.name,\n\t\t\t\t \"slot_timeout_secs\")) {\n\t\t\trc = scnprintf(buf,\n\t\t\t\t PAGE_SIZE,\n\t\t\t\t \"%d\\n\",\n\t\t\t\t slot_timeout_secs);\n\t\t\tgoto out;\n\t\t} else if (!strcmp(attr->attr.name,\n\t\t\t\t \"dcache_timeout_msecs\")) {\n\t\t\trc = scnprintf(buf,\n\t\t\t\t PAGE_SIZE,\n\t\t\t\t \"%d\\n\",\n\t\t\t\t orangefs_dcache_timeout_msecs);\n\t\t\tgoto out;\n\t\t} else if (!strcmp(attr->attr.name,\n\t\t\t\t \"getattr_timeout_msecs\")) {\n\t\t\trc = scnprintf(buf,\n\t\t\t\t PAGE_SIZE,\n\t\t\t\t \"%d\\n\",\n\t\t\t\t orangefs_getattr_timeout_msecs);\n\t\t\tgoto out;\n\t\t} else {\n\t\t\tgoto out;\n\t\t}\n\n\t} else if (!strcmp(kobj->name, STATS_KOBJ_ID)) {\n\t\tif (!strcmp(attr->attr.name, \"reads\")) {\n\t\t\trc = scnprintf(buf,\n\t\t\t\t PAGE_SIZE,\n\t\t\t\t \"%lu\\n\",\n\t\t\t\t orangefs_stats.reads);\n\t\t\tgoto out;\n\t\t} else if (!strcmp(attr->attr.name, \"writes\")) {\n\t\t\trc = scnprintf(buf,\n\t\t\t\t PAGE_SIZE,\n\t\t\t\t \"%lu\\n\",\n\t\t\t\t orangefs_stats.writes);\n\t\t\tgoto out;\n\t\t} else {\n\t\t\tgoto out;\n\t\t}\n\t}\n\nout:\n\n\treturn rc;\n}\n\nstatic ssize_t sysfs_int_store(struct kobject *kobj,\n struct orangefs_attribute *attr, const char *buf, size_t count)\n{\n\tint rc = 0;\n\n\tgossip_debug(GOSSIP_SYSFS_DEBUG,\n\t\t \"sysfs_int_store: start attr->attr.name:%s: buf:%s:\\n\",\n\t\t attr->attr.name, buf);\n\n\tif (!strcmp(attr->attr.name, \"op_timeout_secs\")) {\n\t\trc = kstrtoint(buf, 0, &op_timeout_secs);\n\t\tgoto out;\n\t} else if (!strcmp(attr->attr.name, \"slot_timeout_secs\")) {\n\t\trc = kstrtoint(buf, 0, &slot_timeout_secs);\n\t\tgoto out;\n\t} else if (!strcmp(attr->attr.name, \"dcache_timeout_msecs\")) {\n\t\trc = kstrtoint(buf, 0, &orangefs_dcache_timeout_msecs);\n\t\tgoto out;\n\t} else if (!strcmp(attr->attr.name, \"getattr_timeout_msecs\")) {\n\t\trc = kstrtoint(buf, 0, &orangefs_getattr_timeout_msecs);\n\t\tgoto out;\n\t} else {\n\t\tgoto out;\n\t}\n\nout:\n\tif (rc)\n\t\trc = -EINVAL;\n\telse\n\t\trc = count;\n\n\treturn rc;\n}\n\n/*\n * obtain attribute values from userspace with a service operation.\n */\nstatic ssize_t sysfs_service_op_show(struct kobject *kobj,\n struct orangefs_attribute *attr, char *buf)\n{\n\tstruct orangefs_kernel_op_s *new_op = NULL;\n\tint rc = 0;\n\tchar *ser_op_type = NULL;\n\t__u32 op_alloc_type;\n\n\tgossip_debug(GOSSIP_SYSFS_DEBUG,\n\t\t \"sysfs_service_op_show: id:%s:\\n\",\n\t\t kobj->name);\n\n\tif (strcmp(kobj->name, PC_KOBJ_ID))\n\t\top_alloc_type = ORANGEFS_VFS_OP_PARAM;\n\telse\n\t\top_alloc_type = ORANGEFS_VFS_OP_PERF_COUNT;\n\n\tnew_op = op_alloc(op_alloc_type);\n\tif (!new_op)\n\t\treturn -ENOMEM;\n\n\t/* Can't do a service_operation if the client is not running... */\n\trc = is_daemon_in_service();\n\tif (rc) {\n\t\tpr_info_ratelimited(\"%s: Client not running :%d:\\n\",\n\t\t\t__func__,\n\t\t\tis_daemon_in_service());\n\t\tgoto out;\n\t}\n\n\tif (strcmp(kobj->name, PC_KOBJ_ID))\n\t\tnew_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_GET;\n\n\tif (!strcmp(kobj->name, ORANGEFS_KOBJ_ID)) {\n\t\t/* Drop unsupported requests first. */\n\t\tif (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&\n\t\t (!strcmp(attr->attr.name, \"readahead_count\") ||\n\t\t !strcmp(attr->attr.name, \"readahead_size\") ||\n\t\t !strcmp(attr->attr.name, \"readahead_count_size\") ||\n\t\t !strcmp(attr->attr.name, \"readahead_readcnt\"))) {\n\t\t\trc = -EINVAL;\n\t\t\tgoto out;\n\t\t}\n\n\t\tif (!strcmp(attr->attr.name, \"perf_history_size\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE;\n\t\telse if (!strcmp(attr->attr.name,\n\t\t\t\t \"perf_time_interval_secs\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_PERF_TIME_INTERVAL_SECS;\n\t\telse if (!strcmp(attr->attr.name,\n\t\t\t\t \"perf_counter_reset\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_PERF_RESET;\n\n\t\telse if (!strcmp(attr->attr.name,\n\t\t\t\t \"readahead_count\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT;\n\n\t\telse if (!strcmp(attr->attr.name,\n\t\t\t\t \"readahead_size\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE;\n\n\t\telse if (!strcmp(attr->attr.name,\n\t\t\t\t \"readahead_count_size\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE;\n\n\t\telse if (!strcmp(attr->attr.name,\n\t\t\t\t \"readahead_readcnt\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT;\n\t} else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) {\n\t\tif (!strcmp(attr->attr.name, \"timeout_msecs\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_ACACHE_TIMEOUT_MSECS;\n\n\t\tif (!strcmp(attr->attr.name, \"hard_limit\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_ACACHE_HARD_LIMIT;\n\n\t\tif (!strcmp(attr->attr.name, \"soft_limit\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_ACACHE_SOFT_LIMIT;\n\n\t\tif (!strcmp(attr->attr.name, \"reclaim_percentage\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t ORANGEFS_PARAM_REQUEST_OP_ACACHE_RECLAIM_PERCENTAGE;\n\n\t} else if (!strcmp(kobj->name, CAPCACHE_KOBJ_ID)) {\n\t\tif (!strcmp(attr->attr.name, \"timeout_secs\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_CAPCACHE_TIMEOUT_SECS;\n\n\t\tif (!strcmp(attr->attr.name, \"hard_limit\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_CAPCACHE_HARD_LIMIT;\n\n\t\tif (!strcmp(attr->attr.name, \"soft_limit\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_CAPCACHE_SOFT_LIMIT;\n\n\t\tif (!strcmp(attr->attr.name, \"reclaim_percentage\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_RECLAIM_PERCENTAGE;\n\n\t} else if (!strcmp(kobj->name, CCACHE_KOBJ_ID)) {\n\t\tif (!strcmp(attr->attr.name, \"timeout_secs\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_CCACHE_TIMEOUT_SECS;\n\n\t\tif (!strcmp(attr->attr.name, \"hard_limit\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_CCACHE_HARD_LIMIT;\n\n\t\tif (!strcmp(attr->attr.name, \"soft_limit\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_CCACHE_SOFT_LIMIT;\n\n\t\tif (!strcmp(attr->attr.name, \"reclaim_percentage\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t ORANGEFS_PARAM_REQUEST_OP_CCACHE_RECLAIM_PERCENTAGE;\n\n\t} else if (!strcmp(kobj->name, NCACHE_KOBJ_ID)) {\n\t\tif (!strcmp(attr->attr.name, \"timeout_msecs\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_NCACHE_TIMEOUT_MSECS;\n\n\t\tif (!strcmp(attr->attr.name, \"hard_limit\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_NCACHE_HARD_LIMIT;\n\n\t\tif (!strcmp(attr->attr.name, \"soft_limit\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_NCACHE_SOFT_LIMIT;\n\n\t\tif (!strcmp(attr->attr.name, \"reclaim_percentage\"))\n\t\t\tnew_op->upcall.req.param.op =\n\t\t\t ORANGEFS_PARAM_REQUEST_OP_NCACHE_RECLAIM_PERCENTAGE;\n\n\t} else if (!strcmp(kobj->name, PC_KOBJ_ID)) {\n\t\tif (!strcmp(attr->attr.name, ACACHE_KOBJ_ID))\n\t\t\tnew_op->upcall.req.perf_count.type =\n\t\t\t\tORANGEFS_PERF_COUNT_REQUEST_ACACHE;\n\n\t\tif (!strcmp(attr->attr.name, CAPCACHE_KOBJ_ID))\n\t\t\tnew_op->upcall.req.perf_count.type =\n\t\t\t\tORANGEFS_PERF_COUNT_REQUEST_CAPCACHE;\n\n\t\tif (!strcmp(attr->attr.name, NCACHE_KOBJ_ID))\n\t\t\tnew_op->upcall.req.perf_count.type =\n\t\t\t\tORANGEFS_PERF_COUNT_REQUEST_NCACHE;\n\n\t} else {\n\t\tgossip_err(\"sysfs_service_op_show: unknown kobj_id:%s:\\n\",\n\t\t\t kobj->name);\n\t\trc = -EINVAL;\n\t\tgoto out;\n\t}\n\n\n\tif (strcmp(kobj->name, PC_KOBJ_ID))\n\t\tser_op_type = \"orangefs_param\";\n\telse\n\t\tser_op_type = \"orangefs_perf_count\";\n\n\t/*\n\t * The service_operation will return an errno return code on\n\t * error, and zero on success.\n\t */\n\trc = service_operation(new_op, ser_op_type, ORANGEFS_OP_INTERRUPTIBLE);\n\nout:\n\tif (!rc) {\n\t\tif (strcmp(kobj->name, PC_KOBJ_ID)) {\n\t\t\tif (new_op->upcall.req.param.op ==\n\t\t\t ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE) {\n\t\t\t\trc = scnprintf(buf, PAGE_SIZE, \"%d %d\\n\",\n\t\t\t\t (int)new_op->downcall.resp.param.u.\n\t\t\t\t value32[0],\n\t\t\t\t (int)new_op->downcall.resp.param.u.\n\t\t\t\t value32[1]);\n\t\t\t} else {\n\t\t\t\trc = scnprintf(buf, PAGE_SIZE, \"%d\\n\",\n\t\t\t\t (int)new_op->downcall.resp.param.u.value64);\n\t\t\t}\n\t\t} else {\n\t\t\trc = scnprintf(\n\t\t\t\tbuf,\n\t\t\t\tPAGE_SIZE,\n\t\t\t\t\"%s\",\n\t\t\t\tnew_op->downcall.resp.perf_count.buffer);\n\t\t}\n\t}\n\n\top_release(new_op);\n\n\treturn rc;\n\n}\n\n/*\n * pass attribute values back to userspace with a service operation.\n *\n * We have to do a memory allocation, an sscanf and a service operation.\n * And we have to evaluate what the user entered, to make sure the\n * value is within the range supported by the attribute. So, there's\n * a lot of return code checking and mapping going on here.\n *\n * We want to return 1 if we think everything went OK, and\n * EINVAL if not.\n */\nstatic ssize_t sysfs_service_op_store(struct kobject *kobj,\n struct orangefs_attribute *attr, const char *buf, size_t count)\n{\n\tstruct orangefs_kernel_op_s *new_op = NULL;\n\tint val = 0;\n\tint rc = 0;\n\n\tgossip_debug(GOSSIP_SYSFS_DEBUG,\n\t\t \"sysfs_service_op_store: id:%s:\\n\",\n\t\t kobj->name);\n\n\tnew_op = op_alloc(ORANGEFS_VFS_OP_PARAM);\n\tif (!new_op)\n\t\treturn -EINVAL; /* sic */\n\n\t/* Can't do a service_operation if the client is not running... */\n\trc = is_daemon_in_service();\n\tif (rc) {\n\t\tpr_info(\"%s: Client not running :%d:\\n\",\n\t\t\t__func__,\n\t\t\tis_daemon_in_service());\n\t\tgoto out;\n\t}\n\n\t/*\n\t * The value we want to send back to userspace is in buf, unless this\n\t * there are two parameters, which is specially handled below.\n\t */\n\tif (strcmp(kobj->name, ORANGEFS_KOBJ_ID) ||\n\t strcmp(attr->attr.name, \"readahead_count_size\")) {\n\t\trc = kstrtoint(buf, 0, &val);\n\t\tif (rc)\n\t\t\tgoto out;\n\t}\n\n\tnew_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_SET;\n\n\tif (!strcmp(kobj->name, ORANGEFS_KOBJ_ID)) {\n\t\t/* Drop unsupported requests first. */\n\t\tif (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&\n\t\t (!strcmp(attr->attr.name, \"readahead_count\") ||\n\t\t !strcmp(attr->attr.name, \"readahead_size\") ||\n\t\t !strcmp(attr->attr.name, \"readahead_count_size\") ||\n\t\t !strcmp(attr->attr.name, \"readahead_readcnt\"))) {\n\t\t\trc = -EINVAL;\n\t\t\tgoto out;\n\t\t}\n\n\t\tif (!strcmp(attr->attr.name, \"perf_history_size\")) {\n\t\t\tif (val > 0) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name,\n\t\t\t\t \"perf_time_interval_secs\")) {\n\t\t\tif (val > 0) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_PERF_TIME_INTERVAL_SECS;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name,\n\t\t\t\t \"perf_counter_reset\")) {\n\t\t\tif ((val == 0) || (val == 1)) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t\tORANGEFS_PARAM_REQUEST_OP_PERF_RESET;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name,\n\t\t\t\t \"readahead_count\")) {\n\t\t\tif ((val >= 0)) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name,\n\t\t\t\t \"readahead_size\")) {\n\t\t\tif ((val >= 0)) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name,\n\t\t\t\t \"readahead_count_size\")) {\n\t\t\tint val1, val2;\n\t\t\trc = sscanf(buf, \"%d %d\", &val1, &val2);\n\t\t\tif (rc < 2) {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tif ((val1 >= 0) && (val2 >= 0)) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tnew_op->upcall.req.param.u.value32[0] = val1;\n\t\t\tnew_op->upcall.req.param.u.value32[1] = val2;\n\t\t\tgoto value_set;\n\t\t} else if (!strcmp(attr->attr.name,\n\t\t\t\t \"readahead_readcnt\")) {\n\t\t\tif ((val >= 0)) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\tORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t}\n\n\t} else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) {\n\t\tif (!strcmp(attr->attr.name, \"hard_limit\")) {\n\t\t\tif (val > -1) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_ACACHE_HARD_LIMIT;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name, \"soft_limit\")) {\n\t\t\tif (val > -1) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_ACACHE_SOFT_LIMIT;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name,\n\t\t\t\t \"reclaim_percentage\")) {\n\t\t\tif ((val > -1) && (val < 101)) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_ACACHE_RECLAIM_PERCENTAGE;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name, \"timeout_msecs\")) {\n\t\t\tif (val > -1) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_ACACHE_TIMEOUT_MSECS;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t}\n\n\t} else if (!strcmp(kobj->name, CAPCACHE_KOBJ_ID)) {\n\t\tif (!strcmp(attr->attr.name, \"hard_limit\")) {\n\t\t\tif (val > -1) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_HARD_LIMIT;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name, \"soft_limit\")) {\n\t\t\tif (val > -1) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_SOFT_LIMIT;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name,\n\t\t\t\t \"reclaim_percentage\")) {\n\t\t\tif ((val > -1) && (val < 101)) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_RECLAIM_PERCENTAGE;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name, \"timeout_secs\")) {\n\t\t\tif (val > -1) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_TIMEOUT_SECS;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t}\n\n\t} else if (!strcmp(kobj->name, CCACHE_KOBJ_ID)) {\n\t\tif (!strcmp(attr->attr.name, \"hard_limit\")) {\n\t\t\tif (val > -1) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_CCACHE_HARD_LIMIT;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name, \"soft_limit\")) {\n\t\t\tif (val > -1) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_CCACHE_SOFT_LIMIT;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name,\n\t\t\t\t \"reclaim_percentage\")) {\n\t\t\tif ((val > -1) && (val < 101)) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_CCACHE_RECLAIM_PERCENTAGE;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name, \"timeout_secs\")) {\n\t\t\tif (val > -1) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_CCACHE_TIMEOUT_SECS;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t}\n\n\t} else if (!strcmp(kobj->name, NCACHE_KOBJ_ID)) {\n\t\tif (!strcmp(attr->attr.name, \"hard_limit\")) {\n\t\t\tif (val > -1) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_NCACHE_HARD_LIMIT;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name, \"soft_limit\")) {\n\t\t\tif (val > -1) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_NCACHE_SOFT_LIMIT;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name,\n\t\t\t\t \"reclaim_percentage\")) {\n\t\t\tif ((val > -1) && (val < 101)) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t\tORANGEFS_PARAM_REQUEST_OP_NCACHE_RECLAIM_PERCENTAGE;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (!strcmp(attr->attr.name, \"timeout_msecs\")) {\n\t\t\tif (val > -1) {\n\t\t\t\tnew_op->upcall.req.param.op =\n\t\t\t\t ORANGEFS_PARAM_REQUEST_OP_NCACHE_TIMEOUT_MSECS;\n\t\t\t} else {\n\t\t\t\trc = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\tgossip_err(\"sysfs_service_op_store: unknown kobj_id:%s:\\n\",\n\t\t\t kobj->name);\n\t\trc = -EINVAL;\n\t\tgoto out;\n\t}\n\n\tnew_op->upcall.req.param.u.value64 = val;\nvalue_set:\n\n\t/*\n\t * The service_operation will return a errno return code on\n\t * error, and zero on success.\n\t */\n\trc = service_operation(new_op, \"orangefs_param\", ORANGEFS_OP_INTERRUPTIBLE);\n\n\tif (rc < 0) {\n\t\tgossip_err(\"sysfs_service_op_store: service op returned:%d:\\n\",\n\t\t\trc);\n\t\trc = 0;\n\t} else {\n\t\trc = count;\n\t}\n\nout:\n\top_release(new_op);\n\n\tif (rc == -ENOMEM || rc == 0)\n\t\trc = -EINVAL;\n\n\treturn rc;\n}\n\nstatic struct orangefs_attribute op_timeout_secs_attribute =\n\t__ATTR(op_timeout_secs, 0664, sysfs_int_show, sysfs_int_store);\n\nstatic struct orangefs_attribute slot_timeout_secs_attribute =\n\t__ATTR(slot_timeout_secs, 0664, sysfs_int_show, sysfs_int_store);\n\nstatic struct orangefs_attribute dcache_timeout_msecs_attribute =\n\t__ATTR(dcache_timeout_msecs, 0664, sysfs_int_show, sysfs_int_store);\n\nstatic struct orangefs_attribute getattr_timeout_msecs_attribute =\n\t__ATTR(getattr_timeout_msecs, 0664, sysfs_int_show, sysfs_int_store);\n\nstatic struct orangefs_attribute readahead_count_attribute =\n\t__ATTR(readahead_count, 0664, sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute readahead_size_attribute =\n\t__ATTR(readahead_size, 0664, sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute readahead_count_size_attribute =\n\t__ATTR(readahead_count_size, 0664, sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute readahead_readcnt_attribute =\n\t__ATTR(readahead_readcnt, 0664, sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute perf_counter_reset_attribute =\n\t__ATTR(perf_counter_reset,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute perf_history_size_attribute =\n\t__ATTR(perf_history_size,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute perf_time_interval_secs_attribute =\n\t__ATTR(perf_time_interval_secs,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct attribute *orangefs_default_attrs[] = {\n\t&op_timeout_secs_attribute.attr,\n\t&slot_timeout_secs_attribute.attr,\n\t&dcache_timeout_msecs_attribute.attr,\n\t&getattr_timeout_msecs_attribute.attr,\n\t&readahead_count_attribute.attr,\n\t&readahead_size_attribute.attr,\n\t&readahead_count_size_attribute.attr,\n\t&readahead_readcnt_attribute.attr,\n\t&perf_counter_reset_attribute.attr,\n\t&perf_history_size_attribute.attr,\n\t&perf_time_interval_secs_attribute.attr,\n\tNULL,\n};\n\nstatic struct kobj_type orangefs_ktype = {\n\t.sysfs_ops = &orangefs_sysfs_ops,\n\t.default_attrs = orangefs_default_attrs,\n};\n\nstatic struct orangefs_attribute acache_hard_limit_attribute =\n\t__ATTR(hard_limit,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute acache_reclaim_percent_attribute =\n\t__ATTR(reclaim_percentage,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute acache_soft_limit_attribute =\n\t__ATTR(soft_limit,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute acache_timeout_msecs_attribute =\n\t__ATTR(timeout_msecs,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct attribute *acache_orangefs_default_attrs[] = {\n\t&acache_hard_limit_attribute.attr,\n\t&acache_reclaim_percent_attribute.attr,\n\t&acache_soft_limit_attribute.attr,\n\t&acache_timeout_msecs_attribute.attr,\n\tNULL,\n};\n\nstatic struct kobj_type acache_orangefs_ktype = {\n\t.sysfs_ops = &orangefs_sysfs_ops,\n\t.default_attrs = acache_orangefs_default_attrs,\n};\n\nstatic struct orangefs_attribute capcache_hard_limit_attribute =\n\t__ATTR(hard_limit,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute capcache_reclaim_percent_attribute =\n\t__ATTR(reclaim_percentage,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute capcache_soft_limit_attribute =\n\t__ATTR(soft_limit,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute capcache_timeout_secs_attribute =\n\t__ATTR(timeout_secs,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct attribute *capcache_orangefs_default_attrs[] = {\n\t&capcache_hard_limit_attribute.attr,\n\t&capcache_reclaim_percent_attribute.attr,\n\t&capcache_soft_limit_attribute.attr,\n\t&capcache_timeout_secs_attribute.attr,\n\tNULL,\n};\n\nstatic struct kobj_type capcache_orangefs_ktype = {\n\t.sysfs_ops = &orangefs_sysfs_ops,\n\t.default_attrs = capcache_orangefs_default_attrs,\n};\n\nstatic struct orangefs_attribute ccache_hard_limit_attribute =\n\t__ATTR(hard_limit,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute ccache_reclaim_percent_attribute =\n\t__ATTR(reclaim_percentage,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute ccache_soft_limit_attribute =\n\t__ATTR(soft_limit,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute ccache_timeout_secs_attribute =\n\t__ATTR(timeout_secs,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct attribute *ccache_orangefs_default_attrs[] = {\n\t&ccache_hard_limit_attribute.attr,\n\t&ccache_reclaim_percent_attribute.attr,\n\t&ccache_soft_limit_attribute.attr,\n\t&ccache_timeout_secs_attribute.attr,\n\tNULL,\n};\n\nstatic struct kobj_type ccache_orangefs_ktype = {\n\t.sysfs_ops = &orangefs_sysfs_ops,\n\t.default_attrs = ccache_orangefs_default_attrs,\n};\n\nstatic struct orangefs_attribute ncache_hard_limit_attribute =\n\t__ATTR(hard_limit,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute ncache_reclaim_percent_attribute =\n\t__ATTR(reclaim_percentage,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute ncache_soft_limit_attribute =\n\t__ATTR(soft_limit,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct orangefs_attribute ncache_timeout_msecs_attribute =\n\t__ATTR(timeout_msecs,\n\t 0664,\n\t sysfs_service_op_show,\n\t sysfs_service_op_store);\n\nstatic struct attribute *ncache_orangefs_default_attrs[] = {\n\t&ncache_hard_limit_attribute.attr,\n\t&ncache_reclaim_percent_attribute.attr,\n\t&ncache_soft_limit_attribute.attr,\n\t&ncache_timeout_msecs_attribute.attr,\n\tNULL,\n};\n\nstatic struct kobj_type ncache_orangefs_ktype = {\n\t.sysfs_ops = &orangefs_sysfs_ops,\n\t.default_attrs = ncache_orangefs_default_attrs,\n};\n\nstatic struct orangefs_attribute pc_acache_attribute =\n\t__ATTR(acache,\n\t 0664,\n\t sysfs_service_op_show,\n\t NULL);\n\nstatic struct orangefs_attribute pc_capcache_attribute =\n\t__ATTR(capcache,\n\t 0664,\n\t sysfs_service_op_show,\n\t NULL);\n\nstatic struct orangefs_attribute pc_ncache_attribute =\n\t__ATTR(ncache,\n\t 0664,\n\t sysfs_service_op_show,\n\t NULL);\n\nstatic struct attribute *pc_orangefs_default_attrs[] = {\n\t&pc_acache_attribute.attr,\n\t&pc_capcache_attribute.attr,\n\t&pc_ncache_attribute.attr,\n\tNULL,\n};\n\nstatic struct kobj_type pc_orangefs_ktype = {\n\t.sysfs_ops = &orangefs_sysfs_ops,\n\t.default_attrs = pc_orangefs_default_attrs,\n};\n\nstatic struct orangefs_attribute stats_reads_attribute =\n\t__ATTR(reads,\n\t 0664,\n\t sysfs_int_show,\n\t NULL);\n\nstatic struct orangefs_attribute stats_writes_attribute =\n\t__ATTR(writes,\n\t 0664,\n\t sysfs_int_show,\n\t NULL);\n\nstatic struct attribute *stats_orangefs_default_attrs[] = {\n\t&stats_reads_attribute.attr,\n\t&stats_writes_attribute.attr,\n\tNULL,\n};\n\nstatic struct kobj_type stats_orangefs_ktype = {\n\t.sysfs_ops = &orangefs_sysfs_ops,\n\t.default_attrs = stats_orangefs_default_attrs,\n};\n\nstatic struct kobject *orangefs_obj;\nstatic struct kobject *acache_orangefs_obj;\nstatic struct kobject *capcache_orangefs_obj;\nstatic struct kobject *ccache_orangefs_obj;\nstatic struct kobject *ncache_orangefs_obj;\nstatic struct kobject *pc_orangefs_obj;\nstatic struct kobject *stats_orangefs_obj;\n\nint orangefs_sysfs_init(void)\n{\n\tint rc = -EINVAL;\n\n\tgossip_debug(GOSSIP_SYSFS_DEBUG, \"orangefs_sysfs_init: start\\n\");\n\n\t/* create /sys/fs/orangefs. */\n\torangefs_obj = kzalloc(sizeof(*orangefs_obj), GFP_KERNEL);\n\tif (!orangefs_obj)\n\t\tgoto out;\n\n\trc = kobject_init_and_add(orangefs_obj,\n\t\t\t\t &orangefs_ktype,\n\t\t\t\t fs_kobj,\n\t\t\t\t ORANGEFS_KOBJ_ID);\n\n\tif (rc)\n\t\tgoto ofs_obj_bail;\n\n\tkobject_uevent(orangefs_obj, KOBJ_ADD);\n\n\t/* create /sys/fs/orangefs/acache. */\n\tacache_orangefs_obj = kzalloc(sizeof(*acache_orangefs_obj), GFP_KERNEL);\n\tif (!acache_orangefs_obj) {\n\t\trc = -EINVAL;\n\t\tgoto ofs_obj_bail;\n\t}\n\n\trc = kobject_init_and_add(acache_orangefs_obj,\n\t\t\t\t &acache_orangefs_ktype,\n\t\t\t\t orangefs_obj,\n\t\t\t\t ACACHE_KOBJ_ID);\n\n\tif (rc)\n\t\tgoto acache_obj_bail;\n\n\tkobject_uevent(acache_orangefs_obj, KOBJ_ADD);\n\n\t/* create /sys/fs/orangefs/capcache. */\n\tcapcache_orangefs_obj =\n\t\tkzalloc(sizeof(*capcache_orangefs_obj), GFP_KERNEL);\n\tif (!capcache_orangefs_obj) {\n\t\trc = -EINVAL;\n\t\tgoto acache_obj_bail;\n\t}\n\n\trc = kobject_init_and_add(capcache_orangefs_obj,\n\t\t\t\t &capcache_orangefs_ktype,\n\t\t\t\t orangefs_obj,\n\t\t\t\t CAPCACHE_KOBJ_ID);\n\tif (rc)\n\t\tgoto capcache_obj_bail;\n\n\tkobject_uevent(capcache_orangefs_obj, KOBJ_ADD);\n\n\t/* create /sys/fs/orangefs/ccache. */\n\tccache_orangefs_obj =\n\t\tkzalloc(sizeof(*ccache_orangefs_obj), GFP_KERNEL);\n\tif (!ccache_orangefs_obj) {\n\t\trc = -EINVAL;\n\t\tgoto capcache_obj_bail;\n\t}\n\n\trc = kobject_init_and_add(ccache_orangefs_obj,\n\t\t\t\t &ccache_orangefs_ktype,\n\t\t\t\t orangefs_obj,\n\t\t\t\t CCACHE_KOBJ_ID);\n\tif (rc)\n\t\tgoto ccache_obj_bail;\n\n\tkobject_uevent(ccache_orangefs_obj, KOBJ_ADD);\n\n\t/* create /sys/fs/orangefs/ncache. */\n\tncache_orangefs_obj = kzalloc(sizeof(*ncache_orangefs_obj), GFP_KERNEL);\n\tif (!ncache_orangefs_obj) {\n\t\trc = -EINVAL;\n\t\tgoto ccache_obj_bail;\n\t}\n\n\trc = kobject_init_and_add(ncache_orangefs_obj,\n\t\t\t\t &ncache_orangefs_ktype,\n\t\t\t\t orangefs_obj,\n\t\t\t\t NCACHE_KOBJ_ID);\n\n\tif (rc)\n\t\tgoto ncache_obj_bail;\n\n\tkobject_uevent(ncache_orangefs_obj, KOBJ_ADD);\n\n\t/* create /sys/fs/orangefs/perf_counters. */\n\tpc_orangefs_obj = kzalloc(sizeof(*pc_orangefs_obj), GFP_KERNEL);\n\tif (!pc_orangefs_obj) {\n\t\trc = -EINVAL;\n\t\tgoto ncache_obj_bail;\n\t}\n\n\trc = kobject_init_and_add(pc_orangefs_obj,\n\t\t\t\t &pc_orangefs_ktype,\n\t\t\t\t orangefs_obj,\n\t\t\t\t \"perf_counters\");\n\n\tif (rc)\n\t\tgoto pc_obj_bail;\n\n\tkobject_uevent(pc_orangefs_obj, KOBJ_ADD);\n\n\t/* create /sys/fs/orangefs/stats. */\n\tstats_orangefs_obj = kzalloc(sizeof(*stats_orangefs_obj), GFP_KERNEL);\n\tif (!stats_orangefs_obj) {\n\t\trc = -EINVAL;\n\t\tgoto pc_obj_bail;\n\t}\n\n\trc = kobject_init_and_add(stats_orangefs_obj,\n\t\t\t\t &stats_orangefs_ktype,\n\t\t\t\t orangefs_obj,\n\t\t\t\t STATS_KOBJ_ID);\n\n\tif (rc)\n\t\tgoto stats_obj_bail;\n\n\tkobject_uevent(stats_orangefs_obj, KOBJ_ADD);\n\tgoto out;\n\nstats_obj_bail:\n\t\tkobject_put(stats_orangefs_obj);\npc_obj_bail:\n\t\tkobject_put(pc_orangefs_obj);\nncache_obj_bail:\n\t\tkobject_put(ncache_orangefs_obj);\nccache_obj_bail:\n\t\tkobject_put(ccache_orangefs_obj);\ncapcache_obj_bail:\n\t\tkobject_put(capcache_orangefs_obj);\nacache_obj_bail:\n\t\tkobject_put(acache_orangefs_obj);\nofs_obj_bail:\n\t\tkobject_put(orangefs_obj);\nout:\n\treturn rc;\n}\n\nvoid orangefs_sysfs_exit(void)\n{\n\tgossip_debug(GOSSIP_SYSFS_DEBUG, \"orangefs_sysfs_exit: start\\n\");\n\tkobject_put(acache_orangefs_obj);\n\tkobject_put(capcache_orangefs_obj);\n\tkobject_put(ccache_orangefs_obj);\n\tkobject_put(ncache_orangefs_obj);\n\tkobject_put(pc_orangefs_obj);\n\tkobject_put(stats_orangefs_obj);\n\tkobject_put(orangefs_obj);\n}\n"} +{"text": "и\nв\nна\nсо"} +{"text": "---\ntitle: Installing Hyper-V Extensible Switch Extensions\ndescription: Installing Hyper-V Extensible Switch Extensions\nms.assetid: 6A240A73-C487-4001-8F60-7C7C2C7031F6\nms.date: 04/20/2017\nms.localizationpriority: medium\n---\n\n# Installing Hyper-V Extensible Switch Extensions\n\n\nThis section describes the installation of Hyper-V extensible switch extensions and includes the following topics:\n\n[INF Requirements for Hyper-V Extensible Switch Extensions](inf-requirements-for-hyper-v-extensions.md)\n\n[Extension Driver MSI Packaging Requirements](extension-driver-msi-packaging-requirements.md)\n\n[Managing Installed Hyper-V Extensible Switch Extensions](managing-installed-hyper-v-extensions.md)\n\n \n\n \n\n\n\n\n\n"} +{"text": "print(\"mod2 __name__:\", __name__)\nprint(\"in mod2\")\n\n\ndef foo():\n print(\"mod2.foo()\")\n"} +{"text": "# This file is just a pointer to the file\n#\n# Library/ASU-topics/setSets/ur_dis_11_4.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/ASU-topics/setSets/ur_dis_11_4.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": "// Code generated by smithy-go-codegen DO NOT EDIT.\n\npackage s3\n\nimport (\n\t\"context\"\n\tawsmiddleware \"github.com/aws/aws-sdk-go-v2/aws/middleware\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/retry\"\n\t\"github.com/aws/aws-sdk-go-v2/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go-v2/service/s3/types\"\n\tsmithy \"github.com/awslabs/smithy-go\"\n\t\"github.com/awslabs/smithy-go/middleware\"\n\tsmithyhttp \"github.com/awslabs/smithy-go/transport/http\"\n)\n\n// This operation lists in-progress multipart uploads. An in-progress multipart\n// upload is a multipart upload that has been initiated using the Initiate\n// Multipart Upload request, but has not yet been completed or aborted.

This\n// operation returns at most 1,000 multipart uploads in the response. 1,000\n// multipart uploads is the maximum number of uploads a response can include, which\n// is also the default value. You can further limit the number of uploads in a\n// response by specifying the max-uploads parameter in the response.\n// If additional multipart uploads satisfy the list criteria, the response will\n// contain an IsTruncated element with the value true. To list the\n// additional multipart uploads, use the key-marker and\n// upload-id-marker request parameters.

In the response, the\n// uploads are sorted by key. If your application has initiated more than one\n// multipart upload using the same object key, then uploads in the response are\n// first sorted by key. Additionally, uploads are sorted in ascending order within\n// each key by the upload initiation time.

For more information on multipart\n// uploads, see Uploading\n// Objects Using Multipart Upload.

For information on permissions\n// required to use the multipart upload API, see Multipart\n// Upload API and Permissions.

The following operations are related to\n// ListMultipartUploads:

\nfunc (c *Client) ListMultipartUploads(ctx context.Context, params *ListMultipartUploadsInput, optFns ...func(*Options)) (*ListMultipartUploadsOutput, error) {\n\tstack := middleware.NewStack(\"ListMultipartUploads\", smithyhttp.NewStackRequest)\n\toptions := c.options.Copy()\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\taddawsRestxml_serdeOpListMultipartUploadsMiddlewares(stack)\n\tawsmiddleware.AddRequestInvocationIDMiddleware(stack)\n\tsmithyhttp.AddContentLengthMiddleware(stack)\n\tAddResolveEndpointMiddleware(stack, options)\n\tv4.AddComputePayloadSHA256Middleware(stack)\n\tretry.AddRetryMiddlewares(stack, options)\n\taddHTTPSignerV4Middleware(stack, options)\n\tawsmiddleware.AddAttemptClockSkewMiddleware(stack)\n\taddClientUserAgent(stack)\n\tsmithyhttp.AddErrorCloseResponseBodyMiddleware(stack)\n\tsmithyhttp.AddCloseResponseBodyMiddleware(stack)\n\taddOpListMultipartUploadsValidationMiddleware(stack)\n\tstack.Initialize.Add(newServiceMetadataMiddleware_opListMultipartUploads(options.Region), middleware.Before)\n\taddUpdateEndpointMiddleware(stack, options)\n\taddResponseErrorMiddleware(stack)\n\taddMetadataRetrieverMiddleware(stack)\n\tv4.AddContentSHA256HeaderMiddleware(stack)\n\n\tfor _, fn := range options.APIOptions {\n\t\tif err := fn(stack); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\thandler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)\n\tresult, metadata, err := handler.Handle(ctx, params)\n\tif err != nil {\n\t\treturn nil, &smithy.OperationError{\n\t\t\tServiceID: ServiceID,\n\t\t\tOperationName: \"ListMultipartUploads\",\n\t\t\tErr: err,\n\t\t}\n\t}\n\tout := result.(*ListMultipartUploadsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}\n\ntype ListMultipartUploadsInput struct {\n\t// Character you use to group keys. All keys that contain the same string between\n\t// the prefix, if specified, and the first occurrence of the delimiter after the\n\t// prefix are grouped under a single result element, CommonPrefixes. If you don't\n\t// specify the prefix parameter, then the substring starts at the beginning of the\n\t// key. The keys that are grouped under CommonPrefixes result element are not\n\t// returned elsewhere in the response.\n\tDelimiter *string\n\t// Requests Amazon S3 to encode the object keys in the response and specifies the\n\t// encoding method to use. An object key may contain any Unicode character;\n\t// however, XML 1.0 parser cannot parse some characters, such as characters with an\n\t// ASCII value from 0 to 10. For characters that are not supported in XML 1.0, you\n\t// can add this parameter to request that Amazon S3 encode the keys in the\n\t// response.\n\tEncodingType types.EncodingType\n\t// Lists in-progress uploads only for those keys that begin with the specified\n\t// prefix. You can use prefixes to separate a bucket into different grouping of\n\t// keys. (You can think of using prefix to make groups in the same way you'd use a\n\t// folder in a file system.)\n\tPrefix *string\n\t// Together with upload-id-marker, this parameter specifies the multipart upload\n\t// after which listing should begin. If upload-id-marker is not specified, only the\n\t// keys lexicographically greater than the specified key-marker will be included in\n\t// the list.

If upload-id-marker is specified, any multipart\n\t// uploads for a key equal to the key-marker might also be included,\n\t// provided those multipart uploads have upload IDs lexicographically greater than\n\t// the specified upload-id-marker.

\n\tKeyMarker *string\n\t// Together with key-marker, specifies the multipart upload after which listing\n\t// should begin. If key-marker is not specified, the upload-id-marker parameter is\n\t// ignored. Otherwise, any multipart uploads for a key equal to the key-marker\n\t// might be included in the list only if they have an upload ID lexicographically\n\t// greater than the specified upload-id-marker.\n\tUploadIdMarker *string\n\t// Name of the bucket to which the multipart upload was initiated. When using this\n\t// API with an access point, you must direct requests to the access point hostname.\n\t// The access point hostname takes the form\n\t// AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this\n\t// operation using an access point through the AWS SDKs, you provide the access\n\t// point ARN in place of the bucket name. For more information about access point\n\t// ARNs, see Using Access Points\n\t// (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) in\n\t// the Amazon Simple Storage Service Developer Guide.\n\tBucket *string\n\t// Sets the maximum number of multipart uploads, from 1 to 1,000, to return in the\n\t// response body. 1,000 is the maximum number of uploads that can be returned in a\n\t// response.\n\tMaxUploads *int32\n}\n\ntype ListMultipartUploadsOutput struct {\n\t// When a prefix is provided in the request, this field contains the specified\n\t// prefix. The result contains only keys starting with the specified prefix.\n\tPrefix *string\n\t// Encoding type used by Amazon S3 to encode object keys in the response. If you\n\t// specify encoding-type request parameter, Amazon S3 includes this element in the\n\t// response, and returns encoded key name values in the following response\n\t// elements:

Delimiter, KeyMarker,\n\t// Prefix, NextKeyMarker, Key.

\n\tEncodingType types.EncodingType\n\t// Container for elements related to a particular multipart upload. A response can\n\t// contain zero or more Upload elements.\n\tUploads []*types.MultipartUpload\n\t// Name of the bucket to which the multipart upload was initiated.\n\tBucket *string\n\t// Maximum number of multipart uploads that could have been included in the\n\t// response.\n\tMaxUploads *int32\n\t// When a list is truncated, this element specifies the value that should be used\n\t// for the upload-id-marker request parameter in a subsequent request.\n\tNextUploadIdMarker *string\n\t// Indicates whether the returned list of multipart uploads is truncated. A value\n\t// of true indicates that the list was truncated. The list can be truncated if the\n\t// number of multipart uploads exceeds the limit allowed or specified by max\n\t// uploads.\n\tIsTruncated *bool\n\t// If you specify a delimiter in the request, then the result returns each distinct\n\t// key prefix containing the delimiter in a CommonPrefixes element. The distinct\n\t// key prefixes are returned in the Prefix child element.\n\tCommonPrefixes []*types.CommonPrefix\n\t// When a list is truncated, this element specifies the value that should be used\n\t// for the key-marker request parameter in a subsequent request.\n\tNextKeyMarker *string\n\t// The key at or after which the listing began.\n\tKeyMarker *string\n\t// Contains the delimiter you specified in the request. If you don't specify a\n\t// delimiter in your request, this element is absent from the response.\n\tDelimiter *string\n\t// Upload ID after which listing began.\n\tUploadIdMarker *string\n\n\t// Metadata pertaining to the operation's result.\n\tResultMetadata middleware.Metadata\n}\n\nfunc addawsRestxml_serdeOpListMultipartUploadsMiddlewares(stack *middleware.Stack) {\n\tstack.Serialize.Add(&awsRestxml_serializeOpListMultipartUploads{}, middleware.After)\n\tstack.Deserialize.Add(&awsRestxml_deserializeOpListMultipartUploads{}, middleware.After)\n}\n\nfunc newServiceMetadataMiddleware_opListMultipartUploads(region string) awsmiddleware.RegisterServiceMetadata {\n\treturn awsmiddleware.RegisterServiceMetadata{\n\t\tRegion: region,\n\t\tServiceID: ServiceID,\n\t\tSigningName: \"s3\",\n\t\tOperationName: \"ListMultipartUploads\",\n\t}\n}\n"} +{"text": "/*%FSM*/\n/*%FSM*/\n/*\nitem0[] = {\"init\",0,250,-62.908096,-391.651611,27.091887,-341.651672,0.000000,\"init\"};\nitem1[] = {\"true\",8,218,-62.976639,-315.185364,27.023363,-265.185364,0.000000,\"true\"};\nitem2[] = {\"Share__Work_load\",2,250,-64.183350,-224.681931,25.816656,-174.681931,0.000000,\"Share \" \\n \"Work-load\"};\nitem3[] = {\"Continue__\",4,4314,-220.591476,74.216980,-130.591476,124.216980,0.000000,\"\" \\n \"\" \\n \"Continue\" \\n \"\" \\n \"\"};\nitem4[] = {\"Time_Check\",4,218,-219.425827,-133.310532,-129.425964,-83.310455,0.000000,\"Time Check\"};\nitem5[] = {\"Delete_Dead_Cars\",2,250,-220.186951,-29.248400,-130.187195,20.751413,0.000000,\"Delete\" \\n \"Dead\" \\n \"Cars\"};\nitem6[] = {\"\",7,210,-312.538239,95.295059,-304.538239,103.295059,0.000000,\"\"};\nitem7[] = {\"\",7,210,-312.798218,-204.081940,-304.798218,-196.081940,0.000000,\"\"};\nitem8[] = {\"End_Cleanup_\",1,250,-64.828239,87.581070,25.171984,137.581238,0.000000,\"\" \\n \"End Cleanup\" \\n \"\"};\nitem9[] = {\"Check_for_HC_\",4,218,-65.059021,-30.047342,24.941008,19.952658,0.000000,\"\" \\n \"Check for HC\" \\n \"\"};\nlink0[] = {0,1};\nlink1[] = {1,2};\nlink2[] = {2,4};\nlink3[] = {3,6};\nlink4[] = {4,5};\nlink5[] = {5,3};\nlink6[] = {5,9};\nlink7[] = {6,7};\nlink8[] = {7,2};\nlink9[] = {9,8};\nglobals[] = {0.000000,0,0,0,0,640,480,1,53,6316128,1,-481.887177,425.726196,554.522583,-436.926575,857,816,1};\nwindow[] = {0,-1,-1,-32000,-32000,1120,545,1909,159,1,875};\n*//*%FSM*/\nclass FSM\n{\n fsmName = \"Server-Side Cleanup\";\n class States\n {\n /*%FSM*/\n class init\n {\n name = \"init\";\n itemno = 0;\n init = /*%FSM*/\"private [\"\"_impound\"\",\"\"_cars\"\",\"\"_objs\"\",\"\"_totCars\"\",\"\"_thread\"\"];\" \\n\n \"_impound = time;\" \\n\n \"_cars = time;\" \\n\n \"_objs = time;\" \\n\n \"cleanupFSM setFSMVariable [\"\"stopfsm\"\",false];\"/*%FSM*/;\n precondition = /*%FSM*/\"\"/*%FSM*/;\n class Links\n {\n /*%FSM*/\n class true\n {\n itemno = 1;\n priority = 0.000000;\n to=\"Share__Work_load\";\n precondition = /*%FSM*/\"\"/*%FSM*/;\n condition=/*%FSM*/\"true\"/*%FSM*/;\n action=/*%FSM*/\"\"/*%FSM*/;\n };\n /*%FSM*/\n };\n };\n /*%FSM*/\n /*%FSM*/\n class Share__Work_load\n {\n name = \"Share__Work_load\";\n itemno = 2;\n init = /*%FSM*/\"\"/*%FSM*/;\n precondition = /*%FSM*/\"\"/*%FSM*/;\n class Links\n {\n /*%FSM*/\n class Time_Check\n {\n itemno = 4;\n priority = 0.000000;\n to=\"Delete_Dead_Cars\";\n precondition = /*%FSM*/\"\"/*%FSM*/;\n condition=/*%FSM*/\"((time - _cars) > (3 * 60))\"/*%FSM*/;\n action=/*%FSM*/\"\"/*%FSM*/;\n };\n /*%FSM*/\n };\n };\n /*%FSM*/\n /*%FSM*/\n class Delete_Dead_Cars\n {\n name = \"Delete_Dead_Cars\";\n itemno = 5;\n init = /*%FSM*/\"{\" \\n\n \" if (!alive _x) then {\" \\n\n \" _dbInfo = _x getVariable [\"\"dbInfo\"\",[]];\" \\n\n \" if (count _dbInfo > 0) then {\" \\n\n \" _uid = _dbInfo select 0;\" \\n\n \" _plate = _dbInfo select 1;\" \\n\n \"\" \\n\n \" _query = format [\"\"UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'\"\",_uid,_plate];\" \\n\n \" _query spawn {\" \\n\n \" \" \\n\n \" _thread = [_this,1] call DB_fnc_asyncCall;\" \\n\n \" };\" \\n\n \" };\" \\n\n \" if (!isNil \"\"_x\"\" && {!isNull _x}) then {\" \\n\n \" deleteVehicle _x;\" \\n\n \" };\" \\n\n \" };\" \\n\n \"} forEach allMissionObjects \"\"LandVehicle\"\";\" \\n\n \"\" \\n\n \"{\" \\n\n \" if (!alive _x) then {\" \\n\n \" _dbInfo = _x getVariable [\"\"dbInfo\"\",[]];\" \\n\n \" if (count _dbInfo > 0) then {\" \\n\n \" _uid = _dbInfo select 0;\" \\n\n \" _plate = _dbInfo select 1;\" \\n\n \"\" \\n\n \" _query = format [\"\"UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'\"\",_uid,_plate];\" \\n\n \" _query spawn {\" \\n\n \" \" \\n\n \" _thread = [_this,1] call DB_fnc_asyncCall;\" \\n\n \" };\" \\n\n \" };\" \\n\n \" if (!isNil \"\"_x\"\" && {!isNull _x}) then {\" \\n\n \" deleteVehicle _x;\" \\n\n \" };\" \\n\n \" };\" \\n\n \"} forEach allMissionObjects \"\"Air\"\";\" \\n\n \"_cars = time;\" \\n\n \"\" \\n\n \"//Group cleanup.\" \\n\n \"{\" \\n\n \" if (units _x isEqualTo [] && local _x) then {\" \\n\n \" deleteGroup _x;\" \\n\n \" };\" \\n\n \"} forEach allGroups;\"/*%FSM*/;\n precondition = /*%FSM*/\"\"/*%FSM*/;\n class Links\n {\n /*%FSM*/\n class Check_for_HC_\n {\n itemno = 9;\n priority = 0.000000;\n to=\"End_Cleanup_\";\n precondition = /*%FSM*/\"\"/*%FSM*/;\n condition=/*%FSM*/\"cleanupFSM getFSMVariable \"\"stopfsm\"\"\"/*%FSM*/;\n action=/*%FSM*/\"\"/*%FSM*/;\n };\n /*%FSM*/\n /*%FSM*/\n class Continue__\n {\n itemno = 3;\n priority = 0.000000;\n to=\"Share__Work_load\";\n precondition = /*%FSM*/\"\"/*%FSM*/;\n condition=/*%FSM*/\"!(cleanupFSM getFSMVariable \"\"stopfsm\"\")\"/*%FSM*/;\n action=/*%FSM*/\"\"/*%FSM*/;\n };\n /*%FSM*/\n };\n };\n /*%FSM*/\n /*%FSM*/\n class End_Cleanup_\n {\n name = \"End_Cleanup_\";\n itemno = 8;\n init = /*%FSM*/\"\"/*%FSM*/;\n precondition = /*%FSM*/\"\"/*%FSM*/;\n class Links\n {\n };\n };\n /*%FSM*/\n };\n initState=\"init\";\n finalStates[] =\n {\n \"End_Cleanup_\",\n };\n};\n/*%FSM*/\n"} +{"text": "// Type definitions for gulp-ng-annotate\n// Project: https://github.com/Kagami/gulp-ng-annotate\n// Definitions by: Qubo \n// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\n\n/// \n\n\n\ndeclare namespace ngAnnotate {\n interface NgAnnotate {\n (option?: Option): NodeJS.ReadWriteStream;\n }\n\n //TODO: Should be on ng-annotate module\n interface Option {\n /**\n * Add annotations where non-existing\n */\n add?: boolean;\n /**\n * Remove all existing annotations\n */\n remove?: boolean;\n /**\n * List optional matchers\n */\n list?: boolean;\n /**\n * Restrict matching further or to expand matching\n */\n regexp?: string;\n /**\n * Enable optional matcher\n */\n enable?: boolean;\n /**\n * Output '$scope' instead of \"$scope\".\n */\n single_quotes?: boolean;\n /**\n * Rename providers (services, factories, controllers, etc.) with a new name when declared and referenced through annotation\n */\n rename?: RenameOption[];\n /**\n * Load a user plugin with the provided path\n */\n plugin?: any[];\n }\n\n interface RenameOption {\n from: string;\n to: string;\n }\n}\n\ndeclare var ngAnnotate: ngAnnotate.NgAnnotate;\n\nexport = ngAnnotate;\n"} +{"text": "[\n \"accordion\",\n \"acoustic_bass\",\n \"acoustic_grand_piano\",\n \"acoustic_guitar_nylon\",\n \"acoustic_guitar_steel\",\n \"agogo\",\n \"alto_sax\",\n \"applause\",\n \"bagpipe\",\n \"banjo\",\n \"baritone_sax\",\n \"bassoon\",\n \"bird_tweet\",\n \"blown_bottle\",\n \"brass_section\",\n \"breath_noise\",\n \"bright_acoustic_piano\",\n \"celesta\",\n \"cello\",\n \"choir_aahs\",\n \"church_organ\",\n \"clarinet\",\n \"clavinet\",\n \"contrabass\",\n \"distortion_guitar\",\n \"drawbar_organ\",\n \"dulcimer\",\n \"electric_bass_finger\",\n \"electric_bass_pick\",\n \"electric_grand_piano\",\n \"electric_guitar_clean\",\n \"electric_guitar_jazz\",\n \"electric_guitar_muted\",\n \"electric_piano_1\",\n \"electric_piano_2\",\n \"english_horn\",\n \"fiddle\",\n \"flute\",\n \"french_horn\",\n \"fretless_bass\",\n \"fx_1_rain\",\n \"fx_2_soundtrack\",\n \"fx_3_crystal\",\n \"fx_4_atmosphere\",\n \"fx_5_brightness\",\n \"fx_6_goblins\",\n \"fx_7_echoes\",\n \"fx_8_scifi\",\n \"glockenspiel\",\n \"guitar_fret_noise\",\n \"guitar_harmonics\",\n \"gunshot\",\n \"harmonica\",\n \"harpsichord\",\n \"helicopter\",\n \"honkytonk_piano\",\n \"kalimba\",\n \"koto\",\n \"lead_1_square\",\n \"lead_2_sawtooth\",\n \"lead_3_calliope\",\n \"lead_4_chiff\",\n \"lead_5_charang\",\n \"lead_6_voice\",\n \"lead_7_fifths\",\n \"lead_8_bass__lead\",\n \"marimba\",\n \"melodic_tom\",\n \"music_box\",\n \"muted_trumpet\",\n \"oboe\",\n \"ocarina\",\n \"orchestra_hit\",\n \"orchestral_harp\",\n \"overdriven_guitar\",\n \"pad_1_new_age\",\n \"pad_2_warm\",\n \"pad_3_polysynth\",\n \"pad_4_choir\",\n \"pad_5_bowed\",\n \"pad_6_metallic\",\n \"pad_7_halo\",\n \"pad_8_sweep\",\n \"pan_flute\",\n \"percussive_organ\",\n \"percussion\",\n \"piccolo\",\n \"pizzicato_strings\",\n \"recorder\",\n \"reed_organ\",\n \"reverse_cymbal\",\n \"rock_organ\",\n \"seashore\",\n \"shakuhachi\",\n \"shamisen\",\n \"shanai\",\n \"sitar\",\n \"slap_bass_1\",\n \"slap_bass_2\",\n \"soprano_sax\",\n \"steel_drums\",\n \"string_ensemble_1\",\n \"string_ensemble_2\",\n \"synth_bass_1\",\n \"synth_bass_2\",\n \"synth_brass_1\",\n \"synth_brass_2\",\n \"synth_choir\",\n \"synth_drum\",\n \"synth_strings_1\",\n \"synth_strings_2\",\n \"taiko_drum\",\n \"tango_accordion\",\n \"telephone_ring\",\n \"tenor_sax\",\n \"timpani\",\n \"tinkle_bell\",\n \"tremolo_strings\",\n \"trombone\",\n \"trumpet\",\n \"tuba\",\n \"tubular_bells\",\n \"vibraphone\",\n \"viola\",\n \"violin\",\n \"voice_oohs\",\n \"whistle\",\n \"woodblock\",\n \"xylophone\"\n]\n"} +{"text": "{\n \"type\": \"#ext-gen1136#\",\n \"description\": \"#ext-gen1137#\",\n \"configBasique\": {\n \"title\": \"#ext-gen1136#\",\n \"bType\": \"zendController\",\n \"flex\": 1,\n \"champsConfig\": {\n \"simple\": [\n {\n \"categorie\": \"#ext-gen1139#\",\n \"champs\": [\n {\n \"type\": \"Ext.form.field.Text\",\n \"config\": {\n \"fieldLabel\": \"#ext-gen1140#\",\n \"name\": \"module\"\n }\n },\n {\n \"type\": \"Ext.form.field.Text\",\n \"config\": {\n \"fieldLabel\": \"#ext-gen1141#\",\n \"name\": \"controller\"\n }\n },\n {\n \"type\": \"Ext.form.field.Text\",\n \"config\": {\n \"fieldLabel\": \"#ext-gen1142#\",\n \"name\": \"action\"\n }\n },\n {\n \"type\": \"Ext.form.field.TextArea\",\n \"config\": {\n \"fieldLabel\": \"#ext-gen1143#\",\n \"name\": \"options\"\n }\n }\n ]\n }\n ],\n \"avance\": []\n },\n \"configBloc\": []\n },\n \"category\": \"#ext-gen1135#\",\n \"bType\": \"zendController\",\n \"id\": \"50f694edc0e051280d000001\"\n}"} +{"text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.dubbo.samples.service.greeting;\n\nimport org.springframework.context.support.ClassPathXmlApplicationContext;\n\nimport java.util.concurrent.CountDownLatch;\n\npublic class Application {\n public static void main(String[] args) throws Exception {\n ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\"spring/greeting-service.xml\");\n context.start();\n\n System.out.println(\"dubbo service started\");\n new CountDownLatch(1).await();\n }\n}\n"} +{"text": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n//\n\n//\n// ===========================================================================\n// File: rpc.h\n// \n// =========================================================================== \n// dummy rpc.h for PAL\n\n#ifndef __RPC_H__\n#define __RPC_H__\n\n#include \"palrt.h\"\n\n#define __RPC_STUB\n#define __RPC_USER\n#define __RPC_FAR\n\n#define DECLSPEC_UUID(x) __declspec(uuid(x))\n#define MIDL_INTERFACE(x) struct DECLSPEC_UUID(x) DECLSPEC_NOVTABLE\n\n#define EXTERN_GUID(itf,l1,s1,s2,c1,c2,c3,c4,c5,c6,c7,c8) \\\n EXTERN_C const IID DECLSPEC_SELECTANY itf = {l1,s1,s2,{c1,c2,c3,c4,c5,c6,c7,c8}}\n\ninterface IRpcStubBuffer;\ninterface IRpcChannelBuffer;\n\ntypedef void* PRPC_MESSAGE;\ntypedef void* RPC_IF_HANDLE;\n\n#endif // __RPC_H__\n"} +{"text": "// Copyright 2018 The Cockroach Authors.\n//\n// Licensed as a CockroachDB Enterprise file under the Cockroach Community\n// License (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// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt\n\npackage changefeedccl\n\nimport (\n\t\"context\"\n\tgosql \"database/sql\"\n\tgojson \"encoding/json\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/cockroachdb/apd/v2\"\n\t\"github.com/cockroachdb/cockroach/pkg/base\"\n\t\"github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/cdctest\"\n\t\"github.com/cockroachdb/cockroach/pkg/security\"\n\t\"github.com/cockroachdb/cockroach/pkg/sql/execinfra\"\n\t\"github.com/cockroachdb/cockroach/pkg/sql/sem/tree\"\n\t\"github.com/cockroachdb/cockroach/pkg/testutils\"\n\t\"github.com/cockroachdb/cockroach/pkg/testutils/serverutils\"\n\t\"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils\"\n\t\"github.com/cockroachdb/cockroach/pkg/util/hlc\"\n\t\"github.com/cockroachdb/cockroach/pkg/util/log\"\n)\n\nfunc waitForSchemaChange(\n\tt testing.TB, sqlDB *sqlutils.SQLRunner, stmt string, arguments ...interface{},\n) {\n\tsqlDB.Exec(t, stmt, arguments...)\n\trow := sqlDB.QueryRow(t, \"SELECT job_id FROM [SHOW JOBS] ORDER BY created DESC LIMIT 1\")\n\tvar jobID string\n\trow.Scan(&jobID)\n\n\ttestutils.SucceedsSoon(t, func() error {\n\t\trow := sqlDB.QueryRow(t, \"SELECT status FROM [SHOW JOBS] WHERE job_id = $1\", jobID)\n\t\tvar status string\n\t\trow.Scan(&status)\n\t\tif status != \"succeeded\" {\n\t\t\treturn fmt.Errorf(\"Job %s had status %s, wanted 'succeeded'\", jobID, status)\n\t\t}\n\t\treturn nil\n\t})\n}\n\nfunc readNextMessages(t testing.TB, f cdctest.TestFeed, numMessages int, stripTs bool) []string {\n\tt.Helper()\n\n\tvar actual []string\n\tvar value []byte\n\tvar message map[string]interface{}\n\tfor len(actual) < numMessages {\n\t\tm, err := f.Next()\n\t\tif log.V(1) {\n\t\t\tlog.Infof(context.Background(), `%v %s: %s->%s`, err, m.Topic, m.Key, m.Value)\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t} else if m == nil {\n\t\t\tt.Fatal(`expected message`)\n\t\t} else if len(m.Key) > 0 || len(m.Value) > 0 {\n\t\t\tif stripTs {\n\t\t\t\tif err := gojson.Unmarshal(m.Value, &message); err != nil {\n\t\t\t\t\tt.Fatalf(`%s: %s`, m.Value, err)\n\t\t\t\t}\n\t\t\t\tdelete(message, \"updated\")\n\t\t\t\tvalue, err = cdctest.ReformatJSON(message)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatal(err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalue = m.Value\n\t\t\t}\n\t\t\tactual = append(actual, fmt.Sprintf(`%s: %s->%s`, m.Topic, m.Key, value))\n\t\t}\n\t}\n\treturn actual\n}\n\nfunc assertPayloadsBase(t testing.TB, f cdctest.TestFeed, expected []string, stripTs bool) {\n\tt.Helper()\n\tactual := readNextMessages(t, f, len(expected), stripTs)\n\tsort.Strings(expected)\n\tsort.Strings(actual)\n\tif !reflect.DeepEqual(expected, actual) {\n\t\tt.Fatalf(\"expected\\n %s\\ngot\\n %s\",\n\t\t\tstrings.Join(expected, \"\\n \"), strings.Join(actual, \"\\n \"))\n\t}\n}\n\nfunc assertPayloads(t testing.TB, f cdctest.TestFeed, expected []string) {\n\tt.Helper()\n\tassertPayloadsBase(t, f, expected, false)\n}\n\nfunc assertPayloadsStripTs(t testing.TB, f cdctest.TestFeed, expected []string) {\n\tt.Helper()\n\tassertPayloadsBase(t, f, expected, true)\n}\n\nfunc avroToJSON(t testing.TB, reg *testSchemaRegistry, avroBytes []byte) []byte {\n\tif len(avroBytes) == 0 {\n\t\treturn nil\n\t}\n\tnative, err := reg.encodedAvroToNative(avroBytes)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// The avro textual format is a more natural fit, but it's non-deterministic\n\t// because of go's randomized map ordering. Instead, we use gojson.Marshal,\n\t// which sorts its object keys and so is deterministic.\n\tjson, err := gojson.Marshal(native)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn json\n}\n\nfunc assertPayloadsAvro(\n\tt testing.TB, reg *testSchemaRegistry, f cdctest.TestFeed, expected []string,\n) {\n\tt.Helper()\n\n\tvar actual []string\n\tfor len(actual) < len(expected) {\n\t\tm, err := f.Next()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t} else if m == nil {\n\t\t\tt.Fatal(`expected message`)\n\t\t} else if m.Key != nil {\n\t\t\tkey, value := avroToJSON(t, reg, m.Key), avroToJSON(t, reg, m.Value)\n\t\t\tactual = append(actual, fmt.Sprintf(`%s: %s->%s`, m.Topic, key, value))\n\t\t}\n\t}\n\n\t// The tests that use this aren't concerned with order, just that these are\n\t// the next len(expected) messages.\n\tsort.Strings(expected)\n\tsort.Strings(actual)\n\tif !reflect.DeepEqual(expected, actual) {\n\t\tt.Fatalf(\"expected\\n %s\\ngot\\n %s\",\n\t\t\tstrings.Join(expected, \"\\n \"), strings.Join(actual, \"\\n \"))\n\t}\n}\n\nfunc parseTimeToHLC(t testing.TB, s string) hlc.Timestamp {\n\tt.Helper()\n\td, _, err := apd.NewFromString(s)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tts, err := tree.DecimalToHLC(d)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn ts\n}\n\nfunc expectResolvedTimestamp(t testing.TB, f cdctest.TestFeed) hlc.Timestamp {\n\tt.Helper()\n\tm, err := f.Next()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t} else if m == nil {\n\t\tt.Fatal(`expected message`)\n\t}\n\tif m.Key != nil {\n\t\tt.Fatalf(`unexpected row %s: %s -> %s`, m.Topic, m.Key, m.Value)\n\t}\n\tif m.Resolved == nil {\n\t\tt.Fatal(`expected a resolved timestamp notification`)\n\t}\n\n\tvar resolvedRaw struct {\n\t\tResolved string `json:\"resolved\"`\n\t}\n\tif err := gojson.Unmarshal(m.Resolved, &resolvedRaw); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\treturn parseTimeToHLC(t, resolvedRaw.Resolved)\n}\n\nfunc expectResolvedTimestampAvro(\n\tt testing.TB, reg *testSchemaRegistry, f cdctest.TestFeed,\n) hlc.Timestamp {\n\tt.Helper()\n\tm, err := f.Next()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t} else if m == nil {\n\t\tt.Fatal(`expected message`)\n\t}\n\tif m.Key != nil {\n\t\tkey, value := avroToJSON(t, reg, m.Key), avroToJSON(t, reg, m.Value)\n\t\tt.Fatalf(`unexpected row %s: %s -> %s`, m.Topic, key, value)\n\t}\n\tif m.Resolved == nil {\n\t\tt.Fatal(`expected a resolved timestamp notification`)\n\t}\n\tresolvedNative, err := reg.encodedAvroToNative(m.Resolved)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tresolved := resolvedNative.(map[string]interface{})[`resolved`]\n\treturn parseTimeToHLC(t, resolved.(map[string]interface{})[`string`].(string))\n}\n\nfunc sinklessTest(testFn func(*testing.T, *gosql.DB, cdctest.TestFeedFactory)) func(*testing.T) {\n\treturn func(t *testing.T) {\n\t\tctx := context.Background()\n\t\tknobs := base.TestingKnobs{DistSQL: &execinfra.TestingKnobs{Changefeed: &TestingKnobs{}}}\n\t\ts, db, _ := serverutils.StartServer(t, base.TestServerArgs{\n\t\t\tKnobs: knobs,\n\t\t\tUseDatabase: `d`,\n\t\t})\n\t\tdefer s.Stopper().Stop(ctx)\n\t\tsqlDB := sqlutils.MakeSQLRunner(db)\n\t\tsqlDB.Exec(t, `SET CLUSTER SETTING kv.rangefeed.enabled = true`)\n\t\t// TODO(dan): We currently have to set this to an extremely conservative\n\t\t// value because otherwise schema changes become flaky (they don't commit\n\t\t// their txn in time, get pushed by closed timestamps, and retry forever).\n\t\t// This is more likely when the tests run slower (race builds or inside\n\t\t// docker). The conservative value makes our tests take a lot longer,\n\t\t// though. Figure out some way to speed this up.\n\t\tsqlDB.Exec(t, `SET CLUSTER SETTING kv.closed_timestamp.target_duration = '1s'`)\n\t\t// TODO(dan): This is still needed to speed up table_history, that should be\n\t\t// moved to RangeFeed as well.\n\t\tsqlDB.Exec(t, `SET CLUSTER SETTING changefeed.experimental_poll_interval = '10ms'`)\n\t\tsqlDB.Exec(t, `CREATE DATABASE d`)\n\n\t\tsink, cleanup := sqlutils.PGUrl(t, s.ServingSQLAddr(), t.Name(), url.User(security.RootUser))\n\t\tdefer cleanup()\n\t\tf := cdctest.MakeSinklessFeedFactory(s, sink)\n\t\ttestFn(t, db, f)\n\t}\n}\n\nfunc enterpriseTest(testFn func(*testing.T, *gosql.DB, cdctest.TestFeedFactory)) func(*testing.T) {\n\treturn enterpriseTestWithServerArgs(nil, testFn)\n}\n\nfunc enterpriseTestWithServerArgs(\n\targsFn func(args *base.TestServerArgs),\n\ttestFn func(*testing.T, *gosql.DB, cdctest.TestFeedFactory),\n) func(*testing.T) {\n\treturn func(t *testing.T) {\n\t\tctx := context.Background()\n\n\t\tflushCh := make(chan struct{}, 1)\n\t\tdefer close(flushCh)\n\t\tknobs := base.TestingKnobs{DistSQL: &execinfra.TestingKnobs{Changefeed: &TestingKnobs{\n\t\t\tAfterSinkFlush: func() error {\n\t\t\t\tselect {\n\t\t\t\tcase flushCh <- struct{}{}:\n\t\t\t\tdefault:\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t},\n\t\t}}}\n\t\targs := base.TestServerArgs{\n\t\t\tUseDatabase: \"d\",\n\t\t\tKnobs: knobs,\n\t\t}\n\t\tif argsFn != nil {\n\t\t\targsFn(&args)\n\t\t}\n\t\ts, db, _ := serverutils.StartServer(t, args)\n\t\tdefer s.Stopper().Stop(ctx)\n\t\tsqlDB := sqlutils.MakeSQLRunner(db)\n\t\tsqlDB.Exec(t, `SET CLUSTER SETTING kv.rangefeed.enabled = true`)\n\t\tsqlDB.Exec(t, `SET CLUSTER SETTING kv.closed_timestamp.target_duration = '1s'`)\n\t\tsqlDB.Exec(t, `SET CLUSTER SETTING changefeed.experimental_poll_interval = '10ms'`)\n\t\tsqlDB.Exec(t, `CREATE DATABASE d`)\n\t\tsink, cleanup := sqlutils.PGUrl(t, s.ServingSQLAddr(), t.Name(), url.User(security.RootUser))\n\t\tdefer cleanup()\n\t\tf := cdctest.MakeTableFeedFactory(s, db, flushCh, sink)\n\n\t\ttestFn(t, db, f)\n\t}\n}\n\nfunc cloudStorageTest(\n\ttestFn func(*testing.T, *gosql.DB, cdctest.TestFeedFactory),\n) func(*testing.T) {\n\treturn func(t *testing.T) {\n\t\tctx := context.Background()\n\n\t\tdir, dirCleanupFn := testutils.TempDir(t)\n\t\tdefer dirCleanupFn()\n\n\t\tflushCh := make(chan struct{}, 1)\n\t\tdefer close(flushCh)\n\t\tknobs := base.TestingKnobs{DistSQL: &execinfra.TestingKnobs{Changefeed: &TestingKnobs{\n\t\t\tAfterSinkFlush: func() error {\n\t\t\t\tselect {\n\t\t\t\tcase flushCh <- struct{}{}:\n\t\t\t\tdefault:\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t},\n\t\t}}}\n\n\t\ts, db, _ := serverutils.StartServer(t, base.TestServerArgs{\n\t\t\tUseDatabase: \"d\",\n\t\t\tExternalIODir: dir,\n\t\t\tKnobs: knobs,\n\t\t})\n\t\tdefer s.Stopper().Stop(ctx)\n\t\tsqlDB := sqlutils.MakeSQLRunner(db)\n\t\tsqlDB.Exec(t, `SET CLUSTER SETTING kv.rangefeed.enabled = true`)\n\t\tsqlDB.Exec(t, `SET CLUSTER SETTING kv.closed_timestamp.target_duration = '1s'`)\n\t\tsqlDB.Exec(t, `SET CLUSTER SETTING changefeed.experimental_poll_interval = '10ms'`)\n\t\tsqlDB.Exec(t, `CREATE DATABASE d`)\n\n\t\tf := cdctest.MakeCloudFeedFactory(s, db, dir, flushCh)\n\t\ttestFn(t, db, f)\n\t}\n}\n\nfunc feed(\n\tt testing.TB, f cdctest.TestFeedFactory, create string, args ...interface{},\n) cdctest.TestFeed {\n\tt.Helper()\n\tfeed, err := f.Feed(create, args...)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn feed\n}\n\nfunc closeFeed(t testing.TB, f cdctest.TestFeed) {\n\tt.Helper()\n\tif err := f.Close(); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc forceTableGC(\n\tt testing.TB,\n\ttsi serverutils.TestServerInterface,\n\tsqlDB *sqlutils.SQLRunner,\n\tdatabase, table string,\n) {\n\tt.Helper()\n\tif err := tsi.ForceTableGC(context.Background(), database, table, tsi.Clock().Now()); err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n"} +{"text": "var castPath = require('./_castPath'),\n last = require('./last'),\n parent = require('./_parent'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n}\n\nmodule.exports = baseUnset;\n"} +{"text": "//\n// SKRenderer.h\n// SpriteKit\n//\n// Copyright (c) 2016 Apple Inc. All rights reserved\n//\n\n#import \n#import \n\n/* SKRenderer is not available for WatchKit apps and the iOS simulator */\n#if SKVIEW_AVAILABLE && !TARGET_IPHONE_SIMULATOR\n\n#import \n\nNS_ASSUME_NONNULL_BEGIN\n\n/**\n A renderer for displaying a SpriteKit scene in an existing Metal workflow.\n */\nNS_AVAILABLE(10_13, 11_0)\nSK_EXPORT @interface SKRenderer : NSObject\n\n/**\n Creates a renderer with the specified Metal device.\n \n @param device A Metal device.\n @return A new renderer object.\n */\n+ (SKRenderer *)rendererWithDevice:(id)device;\n\n/**\n Render the scene content in the specified Metal command buffer.\n \n @param viewport The pixel dimensions in which to render.\n @param commandBuffer The Metal command buffer in which SpriteKit should schedule rendering commands.\n @param renderPassDescriptor The Metal render pass descriptor describing the rendering target.\n */\n- (void)renderWithViewport:(CGRect)viewport\n commandBuffer:(id )commandBuffer\n renderPassDescriptor:(MTLRenderPassDescriptor *)renderPassDescriptor;\n\n/**\n Render the scene content using a specific Metal command encoder.\n \n @param viewport The pixel dimensions in which to render.\n @param renderCommandEncoder The Metal render command encoder that SpriteKit will use to encode rendering commands. This method will not call endEncoding.\n @param renderPassDescriptor The Metal render pass descriptor describing the rendering target.\n @param commandQueue The Metal command queue.\n */\n- (void)renderWithViewport:(CGRect)viewport\n renderCommandEncoder:(id )renderCommandEncoder\n renderPassDescriptor:(MTLRenderPassDescriptor *)renderPassDescriptor\n commandQueue:(id )commandQueue;\n\n/**\n Update the scene at the specified system time.\n \n @param currentTime The timestamp in seconds.\n */\n- (void)updateAtTime:(NSTimeInterval)currentTime;\n\n/**\n The currently presented scene, otherwise nil. If in a transition, the 'incoming' scene is returned.\n */\n@property (nonatomic, nullable) SKScene *scene;\n\n/**\n Ignores sibling and traversal order to sort the rendered contents of a scene into the most efficient batching possible.\n This will require zPosition to be used in the scenes to properly guarantee elements are in front or behind each other.\n\n This defaults to NO, meaning that sibling order overrides efficiency heuristics in the rendering of the scenes in the view.\n\n Setting this to YES for a complex scene may substantially increase performance, but care must be taken as only zPosition\n determines render order before the efficiency heuristics are used.\n */\n@property (nonatomic) BOOL ignoresSiblingOrder;\n\n/**\n A boolean that indicated whether non-visible nodes should be automatically culled when rendering.\n */\n@property (nonatomic) BOOL shouldCullNonVisibleNodes;\n\n/**\n Toggles display of performance stats when rendering. All default to false.\n */\n@property (nonatomic) BOOL showsDrawCount;\n@property (nonatomic) BOOL showsNodeCount;\n@property (nonatomic) BOOL showsQuadCount;\n@property (nonatomic) BOOL showsPhysics;\n@property (nonatomic) BOOL showsFields;\n\n@end\n\nNS_ASSUME_NONNULL_END\n\n#endif\n\n"} +{"text": "current: all\r\n\r\n.SUFFIXES: .d_ppc\n\nPD_INSTALL_PATH = \"/Applications/Pd.app/Contents/Resources\"\r\n\r\nINCLUDE = -I. -I$(PD_INSTALL_PATH)/src\r\n\r\nCFLAGS =-DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \\\n -Wno-unused -Wno-parentheses -Wno-switch\r\n\r\nLFLAGS = -bundle -undefined suppress -flat_namespace\r\n\r\n# the sources\r\n\nSRC = early_reflections_3d.c \\\n\tearly_reflections_2d.c \\\n\tcart2del_damp_2d.c \\\n\tcart2del_damp_3d.c \\\n\tiem_roomsim.c\n\nTARGET = iem_roomsim.d_ppc\n\n\nOBJ = $(SRC:.c=.o) \r\n\r\n#\r\n# ------------------ targets ------------------------------------\r\n#\r\n\r\nclean:\r\n\trm ../$(TARGET)\r\n\trm *.o\r\n\r\nall: $(OBJ)\r\n\t@echo :: $(OBJ)\r\n\t$(CC) $(LFLAGS) -o $(TARGET) *.o\n\tstrip -S -x $(TARGET)\r\n\tmv $(TARGET) ..\r\n\r\n$(OBJ) : %.o : %.c\r\n\ttouch $*.c\r\n\t$(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $*.c\n\n\n\n\n"} +{"text": "boot system flash this-is-an-arista-device.swi\n!\nhostname arista-ospf-redistribute-bgp\n!\nrouter ospf 1\n redistribute bgp\n redistribute bgp route-map MAP\n redistribute bgp 65100\n redistribute bgp 65100 route-map MAP\n redistribute bgp 65100 metric 10\n"} +{"text": "package session\n\nimport (\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/client\"\n\t\"github.com/aws/aws-sdk-go/aws/corehandlers\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials/stscreds\"\n\t\"github.com/aws/aws-sdk-go/aws/defaults\"\n\t\"github.com/aws/aws-sdk-go/aws/endpoints\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n)\n\n// A Session provides a central location to create service clients from and\n// store configurations and request handlers for those services.\n//\n// Sessions are safe to create service clients concurrently, but it is not safe\n// to mutate the Session concurrently.\n//\n// The Session satisfies the service client's client.ClientConfigProvider.\ntype Session struct {\n\tConfig *aws.Config\n\tHandlers request.Handlers\n}\n\n// New creates a new instance of the handlers merging in the provided configs\n// on top of the SDK's default configurations. Once the Session is created it\n// can be mutated to modify the Config or Handlers. The Session is safe to be\n// read concurrently, but it should not be written to concurrently.\n//\n// If the AWS_SDK_LOAD_CONFIG environment is set to a truthy value, the New\n// method could now encounter an error when loading the configuration. When\n// The environment variable is set, and an error occurs, New will return a\n// session that will fail all requests reporting the error that occurred while\n// loading the session. Use NewSession to get the error when creating the\n// session.\n//\n// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value\n// the shared config file (~/.aws/config) will also be loaded, in addition to\n// the shared credentials file (~/.aws/credentials). Values set in both the\n// shared config, and shared credentials will be taken from the shared\n// credentials file.\n//\n// Deprecated: Use NewSession functions to create sessions instead. NewSession\n// has the same functionality as New except an error can be returned when the\n// func is called instead of waiting to receive an error until a request is made.\nfunc New(cfgs ...*aws.Config) *Session {\n\t// load initial config from environment\n\tenvCfg := loadEnvConfig()\n\n\tif envCfg.EnableSharedConfig {\n\t\ts, err := newSession(Options{}, envCfg, cfgs...)\n\t\tif err != nil {\n\t\t\t// Old session.New expected all errors to be discovered when\n\t\t\t// a request is made, and would report the errors then. This\n\t\t\t// needs to be replicated if an error occurs while creating\n\t\t\t// the session.\n\t\t\tmsg := \"failed to create session with AWS_SDK_LOAD_CONFIG enabled. \" +\n\t\t\t\t\"Use session.NewSession to handle errors occurring during session creation.\"\n\n\t\t\t// Session creation failed, need to report the error and prevent\n\t\t\t// any requests from succeeding.\n\t\t\ts = &Session{Config: defaults.Config()}\n\t\t\ts.Config.MergeIn(cfgs...)\n\t\t\ts.Config.Logger.Log(\"ERROR:\", msg, \"Error:\", err)\n\t\t\ts.Handlers.Validate.PushBack(func(r *request.Request) {\n\t\t\t\tr.Error = err\n\t\t\t})\n\t\t}\n\t\treturn s\n\t}\n\n\treturn deprecatedNewSession(cfgs...)\n}\n\n// NewSession returns a new Session created from SDK defaults, config files,\n// environment, and user provided config files. Once the Session is created\n// it can be mutated to modify the Config or Handlers. The Session is safe to\n// be read concurrently, but it should not be written to concurrently.\n//\n// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value\n// the shared config file (~/.aws/config) will also be loaded in addition to\n// the shared credentials file (~/.aws/credentials). Values set in both the\n// shared config, and shared credentials will be taken from the shared\n// credentials file. Enabling the Shared Config will also allow the Session\n// to be built with retrieving credentials with AssumeRole set in the config.\n//\n// See the NewSessionWithOptions func for information on how to override or\n// control through code how the Session will be created. Such as specifying the\n// config profile, and controlling if shared config is enabled or not.\nfunc NewSession(cfgs ...*aws.Config) (*Session, error) {\n\topts := Options{}\n\topts.Config.MergeIn(cfgs...)\n\n\treturn NewSessionWithOptions(opts)\n}\n\n// SharedConfigState provides the ability to optionally override the state\n// of the session's creation based on the shared config being enabled or\n// disabled.\ntype SharedConfigState int\n\nconst (\n\t// SharedConfigStateFromEnv does not override any state of the\n\t// AWS_SDK_LOAD_CONFIG env var. It is the default value of the\n\t// SharedConfigState type.\n\tSharedConfigStateFromEnv SharedConfigState = iota\n\n\t// SharedConfigDisable overrides the AWS_SDK_LOAD_CONFIG env var value\n\t// and disables the shared config functionality.\n\tSharedConfigDisable\n\n\t// SharedConfigEnable overrides the AWS_SDK_LOAD_CONFIG env var value\n\t// and enables the shared config functionality.\n\tSharedConfigEnable\n)\n\n// Options provides the means to control how a Session is created and what\n// configuration values will be loaded.\n//\ntype Options struct {\n\t// Provides config values for the SDK to use when creating service clients\n\t// and making API requests to services. Any value set in with this field\n\t// will override the associated value provided by the SDK defaults,\n\t// environment or config files where relevant.\n\t//\n\t// If not set, configuration values from from SDK defaults, environment,\n\t// config will be used.\n\tConfig aws.Config\n\n\t// Overrides the config profile the Session should be created from. If not\n\t// set the value of the environment variable will be loaded (AWS_PROFILE,\n\t// or AWS_DEFAULT_PROFILE if the Shared Config is enabled).\n\t//\n\t// If not set and environment variables are not set the \"default\"\n\t// (DefaultSharedConfigProfile) will be used as the profile to load the\n\t// session config from.\n\tProfile string\n\n\t// Instructs how the Session will be created based on the AWS_SDK_LOAD_CONFIG\n\t// environment variable. By default a Session will be created using the\n\t// value provided by the AWS_SDK_LOAD_CONFIG environment variable.\n\t//\n\t// Setting this value to SharedConfigEnable or SharedConfigDisable\n\t// will allow you to override the AWS_SDK_LOAD_CONFIG environment variable\n\t// and enable or disable the shared config functionality.\n\tSharedConfigState SharedConfigState\n\n\t// Ordered list of files the session will load configuration from.\n\t// It will override environment variable AWS_SHARED_CREDENTIALS_FILE, AWS_CONFIG_FILE.\n\tSharedConfigFiles []string\n\n\t// When the SDK's shared config is configured to assume a role with MFA\n\t// this option is required in order to provide the mechanism that will\n\t// retrieve the MFA token. There is no default value for this field. If\n\t// it is not set an error will be returned when creating the session.\n\t//\n\t// This token provider will be called when ever the assumed role's\n\t// credentials need to be refreshed. Within the context of service clients\n\t// all sharing the same session the SDK will ensure calls to the token\n\t// provider are atomic. When sharing a token provider across multiple\n\t// sessions additional synchronization logic is needed to ensure the\n\t// token providers do not introduce race conditions. It is recommend to\n\t// share the session where possible.\n\t//\n\t// stscreds.StdinTokenProvider is a basic implementation that will prompt\n\t// from stdin for the MFA token code.\n\t//\n\t// This field is only used if the shared configuration is enabled, and\n\t// the config enables assume role wit MFA via the mfa_serial field.\n\tAssumeRoleTokenProvider func() (string, error)\n\n\t// Reader for a custom Credentials Authority (CA) bundle in PEM format that\n\t// the SDK will use instead of the default system's root CA bundle. Use this\n\t// only if you want to replace the CA bundle the SDK uses for TLS requests.\n\t//\n\t// Enabling this option will attempt to merge the Transport into the SDK's HTTP\n\t// client. If the client's Transport is not a http.Transport an error will be\n\t// returned. If the Transport's TLS config is set this option will cause the SDK\n\t// to overwrite the Transport's TLS config's RootCAs value. If the CA\n\t// bundle reader contains multiple certificates all of them will be loaded.\n\t//\n\t// The Session option CustomCABundle is also available when creating sessions\n\t// to also enable this feature. CustomCABundle session option field has priority\n\t// over the AWS_CA_BUNDLE environment variable, and will be used if both are set.\n\tCustomCABundle io.Reader\n}\n\n// NewSessionWithOptions returns a new Session created from SDK defaults, config files,\n// environment, and user provided config files. This func uses the Options\n// values to configure how the Session is created.\n//\n// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value\n// the shared config file (~/.aws/config) will also be loaded in addition to\n// the shared credentials file (~/.aws/credentials). Values set in both the\n// shared config, and shared credentials will be taken from the shared\n// credentials file. Enabling the Shared Config will also allow the Session\n// to be built with retrieving credentials with AssumeRole set in the config.\n//\n// // Equivalent to session.New\n// sess := session.Must(session.NewSessionWithOptions(session.Options{}))\n//\n// // Specify profile to load for the session's config\n// sess := session.Must(session.NewSessionWithOptions(session.Options{\n// Profile: \"profile_name\",\n// }))\n//\n// // Specify profile for config and region for requests\n// sess := session.Must(session.NewSessionWithOptions(session.Options{\n// Config: aws.Config{Region: aws.String(\"us-east-1\")},\n// Profile: \"profile_name\",\n// }))\n//\n// // Force enable Shared Config support\n// sess := session.Must(session.NewSessionWithOptions(session.Options{\n// SharedConfigState: session.SharedConfigEnable,\n// }))\nfunc NewSessionWithOptions(opts Options) (*Session, error) {\n\tvar envCfg envConfig\n\tif opts.SharedConfigState == SharedConfigEnable {\n\t\tenvCfg = loadSharedEnvConfig()\n\t} else {\n\t\tenvCfg = loadEnvConfig()\n\t}\n\n\tif len(opts.Profile) > 0 {\n\t\tenvCfg.Profile = opts.Profile\n\t}\n\n\tswitch opts.SharedConfigState {\n\tcase SharedConfigDisable:\n\t\tenvCfg.EnableSharedConfig = false\n\tcase SharedConfigEnable:\n\t\tenvCfg.EnableSharedConfig = true\n\t}\n\n\tif len(envCfg.SharedCredentialsFile) == 0 {\n\t\tenvCfg.SharedCredentialsFile = defaults.SharedCredentialsFilename()\n\t}\n\tif len(envCfg.SharedConfigFile) == 0 {\n\t\tenvCfg.SharedConfigFile = defaults.SharedConfigFilename()\n\t}\n\n\t// Only use AWS_CA_BUNDLE if session option is not provided.\n\tif len(envCfg.CustomCABundle) != 0 && opts.CustomCABundle == nil {\n\t\tf, err := os.Open(envCfg.CustomCABundle)\n\t\tif err != nil {\n\t\t\treturn nil, awserr.New(\"LoadCustomCABundleError\",\n\t\t\t\t\"failed to open custom CA bundle PEM file\", err)\n\t\t}\n\t\tdefer f.Close()\n\t\topts.CustomCABundle = f\n\t}\n\n\treturn newSession(opts, envCfg, &opts.Config)\n}\n\n// Must is a helper function to ensure the Session is valid and there was no\n// error when calling a NewSession function.\n//\n// This helper is intended to be used in variable initialization to load the\n// Session and configuration at startup. Such as:\n//\n// var sess = session.Must(session.NewSession())\nfunc Must(sess *Session, err error) *Session {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn sess\n}\n\nfunc deprecatedNewSession(cfgs ...*aws.Config) *Session {\n\tcfg := defaults.Config()\n\thandlers := defaults.Handlers()\n\n\t// Apply the passed in configs so the configuration can be applied to the\n\t// default credential chain\n\tcfg.MergeIn(cfgs...)\n\tif cfg.EndpointResolver == nil {\n\t\t// An endpoint resolver is required for a session to be able to provide\n\t\t// endpoints for service client configurations.\n\t\tcfg.EndpointResolver = endpoints.DefaultResolver()\n\t}\n\tcfg.Credentials = defaults.CredChain(cfg, handlers)\n\n\t// Reapply any passed in configs to override credentials if set\n\tcfg.MergeIn(cfgs...)\n\n\ts := &Session{\n\t\tConfig: cfg,\n\t\tHandlers: handlers,\n\t}\n\n\tinitHandlers(s)\n\n\treturn s\n}\n\nfunc newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {\n\tcfg := defaults.Config()\n\thandlers := defaults.Handlers()\n\n\t// Get a merged version of the user provided config to determine if\n\t// credentials were.\n\tuserCfg := &aws.Config{}\n\tuserCfg.MergeIn(cfgs...)\n\n\t// Ordered config files will be loaded in with later files overwriting\n\t// previous config file values.\n\tvar cfgFiles []string\n\tif opts.SharedConfigFiles != nil {\n\t\tcfgFiles = opts.SharedConfigFiles\n\t} else {\n\t\tcfgFiles = []string{envCfg.SharedConfigFile, envCfg.SharedCredentialsFile}\n\t\tif !envCfg.EnableSharedConfig {\n\t\t\t// The shared config file (~/.aws/config) is only loaded if instructed\n\t\t\t// to load via the envConfig.EnableSharedConfig (AWS_SDK_LOAD_CONFIG).\n\t\t\tcfgFiles = cfgFiles[1:]\n\t\t}\n\t}\n\n\t// Load additional config from file(s)\n\tsharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers, opts); err != nil {\n\t\treturn nil, err\n\t}\n\n\ts := &Session{\n\t\tConfig: cfg,\n\t\tHandlers: handlers,\n\t}\n\n\tinitHandlers(s)\n\n\t// Setup HTTP client with custom cert bundle if enabled\n\tif opts.CustomCABundle != nil {\n\t\tif err := loadCustomCABundle(s, opts.CustomCABundle); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn s, nil\n}\n\nfunc loadCustomCABundle(s *Session, bundle io.Reader) error {\n\tvar t *http.Transport\n\tswitch v := s.Config.HTTPClient.Transport.(type) {\n\tcase *http.Transport:\n\t\tt = v\n\tdefault:\n\t\tif s.Config.HTTPClient.Transport != nil {\n\t\t\treturn awserr.New(\"LoadCustomCABundleError\",\n\t\t\t\t\"unable to load custom CA bundle, HTTPClient's transport unsupported type\", nil)\n\t\t}\n\t}\n\tif t == nil {\n\t\tt = &http.Transport{}\n\t}\n\n\tp, err := loadCertPool(bundle)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif t.TLSClientConfig == nil {\n\t\tt.TLSClientConfig = &tls.Config{}\n\t}\n\tt.TLSClientConfig.RootCAs = p\n\n\ts.Config.HTTPClient.Transport = t\n\n\treturn nil\n}\n\nfunc loadCertPool(r io.Reader) (*x509.CertPool, error) {\n\tb, err := ioutil.ReadAll(r)\n\tif err != nil {\n\t\treturn nil, awserr.New(\"LoadCustomCABundleError\",\n\t\t\t\"failed to read custom CA bundle PEM file\", err)\n\t}\n\n\tp := x509.NewCertPool()\n\tif !p.AppendCertsFromPEM(b) {\n\t\treturn nil, awserr.New(\"LoadCustomCABundleError\",\n\t\t\t\"failed to load custom CA bundle PEM file\", err)\n\t}\n\n\treturn p, nil\n}\n\nfunc mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers, sessOpts Options) error {\n\t// Merge in user provided configuration\n\tcfg.MergeIn(userCfg)\n\n\t// Region if not already set by user\n\tif len(aws.StringValue(cfg.Region)) == 0 {\n\t\tif len(envCfg.Region) > 0 {\n\t\t\tcfg.WithRegion(envCfg.Region)\n\t\t} else if envCfg.EnableSharedConfig && len(sharedCfg.Region) > 0 {\n\t\t\tcfg.WithRegion(sharedCfg.Region)\n\t\t}\n\t}\n\n\t// Configure credentials if not already set\n\tif cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil {\n\t\tif len(envCfg.Creds.AccessKeyID) > 0 {\n\t\t\tcfg.Credentials = credentials.NewStaticCredentialsFromCreds(\n\t\t\t\tenvCfg.Creds,\n\t\t\t)\n\t\t} else if envCfg.EnableSharedConfig && len(sharedCfg.AssumeRole.RoleARN) > 0 && sharedCfg.AssumeRoleSource != nil {\n\t\t\tcfgCp := *cfg\n\t\t\tcfgCp.Credentials = credentials.NewStaticCredentialsFromCreds(\n\t\t\t\tsharedCfg.AssumeRoleSource.Creds,\n\t\t\t)\n\t\t\tif len(sharedCfg.AssumeRole.MFASerial) > 0 && sessOpts.AssumeRoleTokenProvider == nil {\n\t\t\t\t// AssumeRole Token provider is required if doing Assume Role\n\t\t\t\t// with MFA.\n\t\t\t\treturn AssumeRoleTokenProviderNotSetError{}\n\t\t\t}\n\t\t\tcfg.Credentials = stscreds.NewCredentials(\n\t\t\t\t&Session{\n\t\t\t\t\tConfig: &cfgCp,\n\t\t\t\t\tHandlers: handlers.Copy(),\n\t\t\t\t},\n\t\t\t\tsharedCfg.AssumeRole.RoleARN,\n\t\t\t\tfunc(opt *stscreds.AssumeRoleProvider) {\n\t\t\t\t\topt.RoleSessionName = sharedCfg.AssumeRole.RoleSessionName\n\n\t\t\t\t\t// Assume role with external ID\n\t\t\t\t\tif len(sharedCfg.AssumeRole.ExternalID) > 0 {\n\t\t\t\t\t\topt.ExternalID = aws.String(sharedCfg.AssumeRole.ExternalID)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Assume role with MFA\n\t\t\t\t\tif len(sharedCfg.AssumeRole.MFASerial) > 0 {\n\t\t\t\t\t\topt.SerialNumber = aws.String(sharedCfg.AssumeRole.MFASerial)\n\t\t\t\t\t\topt.TokenProvider = sessOpts.AssumeRoleTokenProvider\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t)\n\t\t} else if len(sharedCfg.Creds.AccessKeyID) > 0 {\n\t\t\tcfg.Credentials = credentials.NewStaticCredentialsFromCreds(\n\t\t\t\tsharedCfg.Creds,\n\t\t\t)\n\t\t} else {\n\t\t\t// Fallback to default credentials provider, include mock errors\n\t\t\t// for the credential chain so user can identify why credentials\n\t\t\t// failed to be retrieved.\n\t\t\tcfg.Credentials = credentials.NewCredentials(&credentials.ChainProvider{\n\t\t\t\tVerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors),\n\t\t\t\tProviders: []credentials.Provider{\n\t\t\t\t\t&credProviderError{Err: awserr.New(\"EnvAccessKeyNotFound\", \"failed to find credentials in the environment.\", nil)},\n\t\t\t\t\t&credProviderError{Err: awserr.New(\"SharedCredsLoad\", fmt.Sprintf(\"failed to load profile, %s.\", envCfg.Profile), nil)},\n\t\t\t\t\tdefaults.RemoteCredProvider(*cfg, handlers),\n\t\t\t\t},\n\t\t\t})\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// AssumeRoleTokenProviderNotSetError is an error returned when creating a session when the\n// MFAToken option is not set when shared config is configured load assume a\n// role with an MFA token.\ntype AssumeRoleTokenProviderNotSetError struct{}\n\n// Code is the short id of the error.\nfunc (e AssumeRoleTokenProviderNotSetError) Code() string {\n\treturn \"AssumeRoleTokenProviderNotSetError\"\n}\n\n// Message is the description of the error\nfunc (e AssumeRoleTokenProviderNotSetError) Message() string {\n\treturn fmt.Sprintf(\"assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.\")\n}\n\n// OrigErr is the underlying error that caused the failure.\nfunc (e AssumeRoleTokenProviderNotSetError) OrigErr() error {\n\treturn nil\n}\n\n// Error satisfies the error interface.\nfunc (e AssumeRoleTokenProviderNotSetError) Error() string {\n\treturn awserr.SprintError(e.Code(), e.Message(), \"\", nil)\n}\n\ntype credProviderError struct {\n\tErr error\n}\n\nvar emptyCreds = credentials.Value{}\n\nfunc (c credProviderError) Retrieve() (credentials.Value, error) {\n\treturn credentials.Value{}, c.Err\n}\nfunc (c credProviderError) IsExpired() bool {\n\treturn true\n}\n\nfunc initHandlers(s *Session) {\n\t// Add the Validate parameter handler if it is not disabled.\n\ts.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler)\n\tif !aws.BoolValue(s.Config.DisableParamValidation) {\n\t\ts.Handlers.Validate.PushBackNamed(corehandlers.ValidateParametersHandler)\n\t}\n}\n\n// Copy creates and returns a copy of the current Session, coping the config\n// and handlers. If any additional configs are provided they will be merged\n// on top of the Session's copied config.\n//\n// // Create a copy of the current Session, configured for the us-west-2 region.\n// sess.Copy(&aws.Config{Region: aws.String(\"us-west-2\")})\nfunc (s *Session) Copy(cfgs ...*aws.Config) *Session {\n\tnewSession := &Session{\n\t\tConfig: s.Config.Copy(cfgs...),\n\t\tHandlers: s.Handlers.Copy(),\n\t}\n\n\tinitHandlers(newSession)\n\n\treturn newSession\n}\n\n// ClientConfig satisfies the client.ConfigProvider interface and is used to\n// configure the service client instances. Passing the Session to the service\n// client's constructor (New) will use this method to configure the client.\nfunc (s *Session) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config {\n\t// Backwards compatibility, the error will be eaten if user calls ClientConfig\n\t// directly. All SDK services will use ClientconfigWithError.\n\tcfg, _ := s.clientConfigWithErr(serviceName, cfgs...)\n\n\treturn cfg\n}\n\nfunc (s *Session) clientConfigWithErr(serviceName string, cfgs ...*aws.Config) (client.Config, error) {\n\ts = s.Copy(cfgs...)\n\n\tvar resolved endpoints.ResolvedEndpoint\n\tvar err error\n\n\tregion := aws.StringValue(s.Config.Region)\n\n\tif endpoint := aws.StringValue(s.Config.Endpoint); len(endpoint) != 0 {\n\t\tresolved.URL = endpoints.AddScheme(endpoint, aws.BoolValue(s.Config.DisableSSL))\n\t\tresolved.SigningRegion = region\n\t} else {\n\t\tresolved, err = s.Config.EndpointResolver.EndpointFor(\n\t\t\tserviceName, region,\n\t\t\tfunc(opt *endpoints.Options) {\n\t\t\t\topt.DisableSSL = aws.BoolValue(s.Config.DisableSSL)\n\t\t\t\topt.UseDualStack = aws.BoolValue(s.Config.UseDualStack)\n\n\t\t\t\t// Support the condition where the service is modeled but its\n\t\t\t\t// endpoint metadata is not available.\n\t\t\t\topt.ResolveUnknownService = true\n\t\t\t},\n\t\t)\n\t}\n\n\treturn client.Config{\n\t\tConfig: s.Config,\n\t\tHandlers: s.Handlers,\n\t\tEndpoint: resolved.URL,\n\t\tSigningRegion: resolved.SigningRegion,\n\t\tSigningName: resolved.SigningName,\n\t}, err\n}\n\n// ClientConfigNoResolveEndpoint is the same as ClientConfig with the exception\n// that the EndpointResolver will not be used to resolve the endpoint. The only\n// endpoint set must come from the aws.Config.Endpoint field.\nfunc (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) client.Config {\n\ts = s.Copy(cfgs...)\n\n\tvar resolved endpoints.ResolvedEndpoint\n\n\tregion := aws.StringValue(s.Config.Region)\n\n\tif ep := aws.StringValue(s.Config.Endpoint); len(ep) > 0 {\n\t\tresolved.URL = endpoints.AddScheme(ep, aws.BoolValue(s.Config.DisableSSL))\n\t\tresolved.SigningRegion = region\n\t}\n\n\treturn client.Config{\n\t\tConfig: s.Config,\n\t\tHandlers: s.Handlers,\n\t\tEndpoint: resolved.URL,\n\t\tSigningRegion: resolved.SigningRegion,\n\t\tSigningName: resolved.SigningName,\n\t}\n}\n"} +{"text": "\"\"\"Copyright (c) 2010-2012 David Rio Vierra\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\"\"\"\nfrom OpenGL import GL\nimport numpy\nimport pygame\nfrom albow import Label, Button, Column\nfrom depths import DepthOffset\nfrom editortools.blockpicker import BlockPicker\nfrom editortools.blockview import BlockButton\nfrom editortools.editortool import EditorTool\nfrom editortools.tooloptions import ToolOptions\nfrom glbackground import Panel\nfrom glutils import Texture\nfrom mceutils import showProgress, CheckBoxLabel, alertException, setWindowCaption\nfrom operation import Operation\n\nimport config\nimport pymclevel\n\nFillSettings = config.Settings(\"Fill\")\nFillSettings.chooseBlockImmediately = FillSettings(\"Choose Block Immediately\", True)\n\n\nclass BlockFillOperation(Operation):\n def __init__(self, editor, destLevel, destBox, blockInfo, blocksToReplace):\n super(BlockFillOperation, self).__init__(editor, destLevel)\n self.destBox = destBox\n self.blockInfo = blockInfo\n self.blocksToReplace = blocksToReplace\n\n def name(self):\n return \"Fill with \" + self.blockInfo.name\n\n def perform(self, recordUndo=True):\n if recordUndo:\n self.undoLevel = self.extractUndo(self.level, self.destBox)\n\n destBox = self.destBox\n if self.level.bounds == self.destBox:\n destBox = None\n\n fill = self.level.fillBlocksIter(destBox, self.blockInfo, blocksToReplace=self.blocksToReplace)\n showProgress(\"Replacing blocks...\", fill, cancel=True)\n\n def bufferSize(self):\n return self.destBox.volume * 2\n\n def dirtyBox(self):\n return self.destBox\n\n\nclass FillToolPanel(Panel):\n\n def __init__(self, tool):\n Panel.__init__(self)\n self.tool = tool\n replacing = tool.replacing\n\n self.blockButton = BlockButton(tool.editor.level.materials)\n self.blockButton.blockInfo = tool.blockInfo\n self.blockButton.action = self.pickFillBlock\n\n self.fillWithLabel = Label(\"Fill with:\", width=self.blockButton.width, align=\"c\")\n self.fillButton = Button(\"Fill\", action=tool.confirm, width=self.blockButton.width)\n self.fillButton.tooltipText = \"Shortcut: ENTER\"\n\n rollkey = config.config.get(\"Keys\", \"Roll\").upper()\n\n self.replaceLabel = replaceLabel = Label(\"Replace\", width=self.blockButton.width)\n replaceLabel.mouse_down = lambda a: self.tool.toggleReplacing()\n replaceLabel.fg_color = (177, 177, 255, 255)\n # replaceLabelRow = Row( (Label(rollkey), replaceLabel) )\n replaceLabel.tooltipText = \"Shortcut: {0}\".format(rollkey)\n replaceLabel.align = \"c\"\n\n col = (self.fillWithLabel,\n self.blockButton,\n # swapRow,\n replaceLabel,\n # self.replaceBlockButton,\n self.fillButton)\n\n if replacing:\n self.fillWithLabel = Label(\"Find:\", width=self.blockButton.width, align=\"c\")\n\n self.replaceBlockButton = BlockButton(tool.editor.level.materials)\n self.replaceBlockButton.blockInfo = tool.replaceBlockInfo\n self.replaceBlockButton.action = self.pickReplaceBlock\n self.replaceLabel.text = \"Replace with:\"\n\n self.swapButton = Button(\"Swap\", action=self.swapBlockTypes, width=self.blockButton.width)\n self.swapButton.fg_color = (255, 255, 255, 255)\n self.swapButton.highlight_color = (60, 255, 60, 255)\n swapkey = config.config.get(\"Keys\", \"Swap\").upper()\n\n self.swapButton.tooltipText = \"Shortcut: {0}\".format(swapkey)\n\n self.fillButton = Button(\"Replace\", action=tool.confirm, width=self.blockButton.width)\n self.fillButton.tooltipText = \"Shortcut: ENTER\"\n\n col = (self.fillWithLabel,\n self.blockButton,\n replaceLabel,\n self.replaceBlockButton,\n self.swapButton,\n self.fillButton)\n\n col = Column(col)\n\n self.add(col)\n self.shrink_wrap()\n\n def swapBlockTypes(self):\n t = self.tool.replaceBlockInfo\n self.tool.replaceBlockInfo = self.tool.blockInfo\n self.tool.blockInfo = t\n\n self.replaceBlockButton.blockInfo = self.tool.replaceBlockInfo\n self.blockButton.blockInfo = self.tool.blockInfo # xxx put this in a property\n\n def pickReplaceBlock(self):\n blockPicker = BlockPicker(self.tool.replaceBlockInfo, self.tool.editor.level.materials)\n if blockPicker.present():\n self.replaceBlockButton.blockInfo = self.tool.replaceBlockInfo = blockPicker.blockInfo\n\n def pickFillBlock(self):\n blockPicker = BlockPicker(self.tool.blockInfo, self.tool.editor.level.materials, allowWildcards=True)\n if blockPicker.present():\n self.tool.blockInfo = blockPicker.blockInfo\n\n\nclass FillToolOptions(ToolOptions):\n def __init__(self, tool):\n Panel.__init__(self)\n self.tool = tool\n self.autoChooseCheckBox = CheckBoxLabel(\"Choose Block Immediately\",\n ref=FillSettings.chooseBlockImmediately.propertyRef(),\n tooltipText=\"When the fill tool is chosen, prompt for a block type.\")\n\n col = Column((Label(\"Fill Options\"), self.autoChooseCheckBox, Button(\"OK\", action=self.dismiss)))\n\n self.add(col)\n self.shrink_wrap()\n\n\nclass FillTool(EditorTool):\n toolIconName = \"fill\"\n _blockInfo = pymclevel.alphaMaterials.Stone\n replaceBlockInfo = pymclevel.alphaMaterials.Air\n tooltipText = \"Fill and Replace\\nRight-click for options\"\n replacing = False\n\n def __init__(self, *args, **kw):\n EditorTool.__init__(self, *args, **kw)\n self.optionsPanel = FillToolOptions(self)\n\n @property\n def blockInfo(self):\n return self._blockInfo\n\n @blockInfo.setter\n def blockInfo(self, bt):\n self._blockInfo = bt\n if self.panel:\n self.panel.blockButton.blockInfo = bt\n\n def levelChanged(self):\n self.initTextures()\n\n def showPanel(self):\n if self.panel:\n self.panel.parent.remove(self.panel)\n\n panel = FillToolPanel(self)\n panel.centery = self.editor.centery\n panel.left = self.editor.left\n panel.anchor = \"lwh\"\n\n self.panel = panel\n self.editor.add(panel)\n\n def toolEnabled(self):\n return not (self.selectionBox() is None)\n\n def toolSelected(self):\n box = self.selectionBox()\n if None is box:\n return\n\n self.replacing = False\n self.showPanel()\n\n if self.chooseBlockImmediately:\n blockPicker = BlockPicker(self.blockInfo, self.editor.level.materials, allowWildcards=True)\n\n if blockPicker.present():\n self.blockInfo = blockPicker.blockInfo\n self.showPanel()\n\n else:\n self.editor.toolbar.selectTool(-1)\n\n chooseBlockImmediately = FillSettings.chooseBlockImmediately.configProperty()\n\n def toolReselected(self):\n self.showPanel()\n self.panel.pickFillBlock()\n\n def cancel(self):\n self.hidePanel()\n\n @alertException\n def confirm(self):\n box = self.selectionBox()\n if None is box:\n return\n\n with setWindowCaption(\"REPLACING - \"):\n self.editor.freezeStatus(\"Replacing %0.1f million blocks\" % (float(box.volume) / 1048576.,))\n\n if self.replacing:\n if self.blockInfo.wildcard:\n print \"Wildcard replace\"\n blocksToReplace = []\n for i in range(16):\n blocksToReplace.append(self.editor.level.materials.blockWithID(self.blockInfo.ID, i))\n else:\n blocksToReplace = [self.blockInfo]\n\n op = BlockFillOperation(self.editor, self.editor.level, self.selectionBox(), self.replaceBlockInfo, blocksToReplace)\n\n else:\n blocksToReplace = []\n op = BlockFillOperation(self.editor, self.editor.level, self.selectionBox(), self.blockInfo, blocksToReplace)\n\n\n self.editor.addOperation(op)\n\n self.editor.addUnsavedEdit()\n self.editor.invalidateBox(box)\n self.editor.toolbar.selectTool(-1)\n\n def roll(self):\n self.toggleReplacing()\n\n def toggleReplacing(self):\n self.replacing = not self.replacing\n\n self.hidePanel()\n self.showPanel()\n if self.replacing:\n self.panel.pickReplaceBlock()\n\n @alertException\n def swap(self):\n if self.panel and self.replacing:\n self.panel.swapBlockTypes()\n\n def initTextures(self):\n\n terrainTexture = self.editor.level.materials.terrainTexture\n\n blockTextures = self.editor.level.materials.blockTextures[:, 0]\n\n if hasattr(self, 'blockTextures'):\n for tex in self.blockTextures.itervalues():\n tex.delete()\n\n self.blockTextures = {}\n\n pixelWidth = 512 if self.editor.level.materials.name in (\"Pocket\", \"Alpha\") else 256\n\n def blockTexFunc(type):\n def _func():\n s, t = blockTextures[type][0]\n if not hasattr(terrainTexture, \"data\"):\n return\n w, h = terrainTexture.data.shape[:2]\n s = s * w / pixelWidth\n t = t * h / pixelWidth\n texData = numpy.array(terrainTexture.data[t:t + h / 16, s:s + w / 16])\n GL.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, w / 16, h / 16, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, texData)\n return _func\n\n for type in range(256):\n self.blockTextures[type] = Texture(blockTexFunc(type))\n\n def drawToolReticle(self):\n if pygame.key.get_mods() & pygame.KMOD_ALT:\n # eyedropper mode\n self.editor.drawWireCubeReticle(color=(0.2, 0.6, 0.9, 1.0))\n\n def drawToolMarkers(self):\n if self.editor.currentTool != self:\n return\n\n if self.panel and self.replacing:\n blockInfo = self.replaceBlockInfo\n else:\n blockInfo = self.blockInfo\n\n color = 1.0, 1.0, 1.0, 0.35\n if blockInfo:\n tex = self.blockTextures.get(blockInfo.ID, self.blockTextures[255]) # xxx\n\n # color = (1.5 - alpha, 1.0, 1.5 - alpha, alpha - 0.35)\n GL.glMatrixMode(GL.GL_TEXTURE)\n GL.glPushMatrix()\n GL.glScale(16., 16., 16.)\n\n else:\n tex = None\n # color = (1.0, 0.3, 0.3, alpha - 0.35)\n\n GL.glPolygonOffset(DepthOffset.FillMarkers, DepthOffset.FillMarkers)\n self.editor.drawConstructionCube(self.selectionBox(),\n color,\n texture=tex)\n\n if blockInfo:\n GL.glMatrixMode(GL.GL_TEXTURE)\n GL.glPopMatrix()\n\n @property\n def statusText(self):\n return \"Press {hotkey} to choose a block. Press {R} to enter replace mode. Click Fill or press ENTER to confirm.\".format(hotkey=self.hotkey, R=config.config.get(\"Keys\", \"Roll\").upper())\n\n @property\n def worldTooltipText(self):\n if pygame.key.get_mods() & pygame.KMOD_ALT:\n try:\n if self.editor.blockFaceUnderCursor is None:\n return\n pos = self.editor.blockFaceUnderCursor[0]\n blockID = self.editor.level.blockAt(*pos)\n blockdata = self.editor.level.blockDataAt(*pos)\n return \"Click to use {0} ({1}:{2})\".format(self.editor.level.materials.blockWithID(blockID, blockdata).name, blockID, blockdata)\n\n except Exception, e:\n return repr(e)\n\n def mouseUp(self, *args):\n return self.editor.selectionTool.mouseUp(*args)\n\n @alertException\n def mouseDown(self, evt, pos, dir):\n if pygame.key.get_mods() & pygame.KMOD_ALT:\n id = self.editor.level.blockAt(*pos)\n data = self.editor.level.blockDataAt(*pos)\n\n self.blockInfo = self.editor.level.materials.blockWithID(id, data)\n else:\n return self.editor.selectionTool.mouseDown(evt, pos, dir)\n"} +{"text": "// This is a script to upgrade \"V0\" network prototxts to the new format.\n// Usage:\n// upgrade_net_proto_binary v0_net_proto_file_in net_proto_file_out\n\n#include \n#include // NOLINT(readability/streams)\n#include // NOLINT(readability/streams)\n#include \n\n#include \"caffe/caffe.hpp\"\n#include \"caffe/util/io.hpp\"\n#include \"caffe/util/upgrade_proto.hpp\"\n\nusing std::ofstream;\n\nusing namespace caffe; // NOLINT(build/namespaces)\n\nint main(int argc, char** argv) {\n FLAGS_alsologtostderr = 1; // Print output to stderr (while still logging)\n ::google::InitGoogleLogging(argv[0]);\n if (argc != 3) {\n LOG(ERROR) << \"Usage: \"\n << \"upgrade_net_proto_binary v0_net_proto_file_in net_proto_file_out\";\n return 1;\n }\n\n NetParameter net_param;\n string input_filename(argv[1]);\n if (!ReadProtoFromBinaryFile(input_filename, &net_param)) {\n LOG(ERROR) << \"Failed to parse input binary file as NetParameter: \"\n << input_filename;\n return 2;\n }\n bool need_upgrade = NetNeedsUpgrade(net_param);\n bool success = true;\n if (need_upgrade) {\n success = UpgradeNetAsNeeded(input_filename, &net_param);\n if (!success) {\n LOG(ERROR) << \"Encountered error(s) while upgrading prototxt; \"\n << \"see details above.\";\n }\n } else {\n LOG(ERROR) << \"File already in latest proto format: \" << input_filename;\n }\n\n WriteProtoToBinaryFile(net_param, argv[2]);\n\n LOG(INFO) << \"Wrote upgraded NetParameter binary proto to \" << argv[2];\n return !success;\n}\n"} +{"text": "/*\n * Mesa 3-D graphics library\n *\n * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n#ifndef QUERYOBJ_H\n#define QUERYOBJ_H\n\n\n#include \"main/mtypes.h\"\n#include \"main/hash.h\"\n\n\nstatic inline struct gl_query_object *\n_mesa_lookup_query_object(struct gl_context *ctx, GLuint id)\n{\n return (struct gl_query_object *)\n _mesa_HashLookupLocked(ctx->Query.QueryObjects, id);\n}\n\n\nextern void\n_mesa_init_query_object_functions(struct dd_function_table *driver);\n\nextern void\n_mesa_init_queryobj(struct gl_context *ctx);\n\nextern void\n_mesa_free_queryobj_data(struct gl_context *ctx);\n\nextern void\n_mesa_delete_query(struct gl_context *ctx, struct gl_query_object *q);\n\nvoid GLAPIENTRY\n_mesa_GenQueries(GLsizei n, GLuint *ids);\nvoid GLAPIENTRY\n_mesa_CreateQueries(GLenum target, GLsizei n, GLuint *ids);\nvoid GLAPIENTRY\n_mesa_DeleteQueries(GLsizei n, const GLuint *ids);\nGLboolean GLAPIENTRY\n_mesa_IsQuery(GLuint id);\nvoid GLAPIENTRY\n_mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id);\nvoid GLAPIENTRY\n_mesa_EndQueryIndexed(GLenum target, GLuint index);\nvoid GLAPIENTRY\n_mesa_BeginQuery(GLenum target, GLuint id);\nvoid GLAPIENTRY\n_mesa_EndQuery(GLenum target);\nvoid GLAPIENTRY\n_mesa_QueryCounter(GLuint id, GLenum target);\nvoid GLAPIENTRY\n_mesa_GetQueryIndexediv(GLenum target, GLuint index, GLenum pname,\n GLint *params);\nvoid GLAPIENTRY\n_mesa_GetQueryiv(GLenum target, GLenum pname, GLint *params);\nvoid GLAPIENTRY\n_mesa_GetQueryObjectiv(GLuint id, GLenum pname, GLint *params);\nvoid GLAPIENTRY\n_mesa_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params);\nvoid GLAPIENTRY\n_mesa_GetQueryObjecti64v(GLuint id, GLenum pname, GLint64EXT *params);\nvoid GLAPIENTRY\n_mesa_GetQueryObjectui64v(GLuint id, GLenum pname, GLuint64EXT *params);\nvoid GLAPIENTRY\n_mesa_GetQueryBufferObjectiv(GLuint id, GLuint buffer, GLenum pname,\n GLintptr offset);\nvoid GLAPIENTRY\n_mesa_GetQueryBufferObjectuiv(GLuint id, GLuint buffer, GLenum pname,\n GLintptr offset);\nvoid GLAPIENTRY\n_mesa_GetQueryBufferObjecti64v(GLuint id, GLuint buffer, GLenum pname,\n GLintptr offset);\nvoid GLAPIENTRY\n_mesa_GetQueryBufferObjectui64v(GLuint id, GLuint buffer, GLenum pname,\n GLintptr offset);\n\n#endif /* QUERYOBJ_H */\n"} +{"text": "/*\n * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.\n * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n *\n * This code is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License version 2 only, as\n * published by the Free Software Foundation. Oracle designates this\n * particular file as subject to the \"Classpath\" exception as provided\n * by Oracle in the LICENSE file that accompanied this code.\n *\n * This code is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n * version 2 for more details (a copy is included in the LICENSE file that\n * accompanied this code).\n *\n * You should have received a copy of the GNU General Public License version\n * 2 along with this work; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n *\n * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n * or visit www.oracle.com if you need additional information or have any\n * questions.\n */\n\n/*\n * COPYRIGHT AND PERMISSION NOTICE\n *\n * Copyright (C) 1991-2007 Unicode, Inc. All rights reserved.\n * Distributed under the Terms of Use in http://www.unicode.org/copyright.html.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of the Unicode data files and any associated documentation (the \"Data\n * Files\") or Unicode software and any associated documentation (the\n * \"Software\") to deal in the Data Files or Software without restriction,\n * including without limitation the rights to use, copy, modify, merge,\n * publish, distribute, and/or sell copies of the Data Files or Software, and\n * to permit persons to whom the Data Files or Software are furnished to do\n * so, provided that (a) the above copyright notice(s) and this permission\n * notice appear with all copies of the Data Files or Software, (b) both the\n * above copyright notice(s) and this permission notice appear in associated\n * documentation, and (c) there is clear notice in each modified Data File or\n * in the Software as well as in the documentation associated with the Data\n * File(s) or Software that the data or software has been modified.\n *\n * THE DATA FILES AND SOFTWARE ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS\n * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR\n * CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF\n * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THE DATA FILES OR SOFTWARE.\n *\n * Except as contained in this notice, the name of a copyright holder shall not\n * be used in advertising or otherwise to promote the sale, use or other\n * dealings in these Data Files or Software without prior written\n * authorization of the copyright holder.\n */\n\npackage sun.text.resources.en;\n\nimport sun.util.resources.ParallelListResourceBundle;\n\npublic class FormatData_en_PH extends ParallelListResourceBundle {\n protected final Object[][] getContents() {\n return new Object[][] {\n { \"NumberPatterns\",\n new String[] {\n \"#,##0.###\",\n \"\\u00a4#,##0.00;(\\u00a4#,##0.00)\",\n \"#,##0%\",\n }\n },\n { \"NumberElements\",\n new String[] {\n \".\",\n \",\",\n \";\",\n \"%\",\n \"0\",\n \"#\",\n \"-\",\n \"E\",\n \"\\u2030\",\n \"\\u221e\",\n \"NaN\",\n }\n },\n { \"TimePatterns\",\n new String[] {\n \"h:mm:ss a z\",\n \"h:mm:ss a z\",\n \"h:mm:ss a\",\n \"h:mm a\",\n }\n },\n { \"DatePatterns\",\n new String[] {\n \"EEEE, MMMM d, yyyy\",\n \"MMMM d, yyyy\",\n \"MM d, yy\",\n \"M/d/yy\",\n }\n },\n { \"DateTimePatterns\",\n new String[] {\n \"{1} {0}\",\n }\n },\n };\n }\n}\n"} +{"text": "module Main:\nwith \"Parse.rml\"\nwith \"Pam.rml\"\nend\n\nrelation main: () => () =\n\n rule Parse.parse() => program &\n Pam.eval_stmt([], program) => _\n --------------------\n main\n\nend (* main *)\n\n"} +{"text": "\n\n\n \n Example - example-example43\n \n\n \n \n \n\n \n\n\n
\n I can add: {{a}} + {{b}} = {{ a+b }}\n
\n\n"} +{"text": "# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# ==============================================================================\n\"\"\"tensorboard module containing volatile or experimental code.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\n# Add projects here, they will show up under tf.contrib.tensorboard.\nfrom tensorflow.contrib.tensorboard import plugins\n"} +{"text": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/CalculateGroupPath.R\n\\name{CalculateGroupPath}\n\\alias{CalculateGroupPath}\n\\title{Calculate Group Path}\n\\source{\nCode adapted from a solution posted by Tony M to \\url{http://stackoverflow.com/questions/9614433/creating-radar-chart-a-k-a-star-plot-spider-plot-using-ggplot2-in-r}.\n}\n\\usage{\nCalculateGroupPath(df)\n}\n\\arguments{\n\\item{df}{a dataframe with Col 1 is group ('unique' cluster / group ID of entity) and Col 2-n are v1.value to vn.value - values (e.g. group/cluser mean or median) of variables v1 to v.n}\n}\n\\value{\na dataframe of the calculated axis paths\n}\n\\description{\nConverts variable values into a set of radial x-y coordinates\n}\n"} +{"text": "/*\n Copyright (c) 2012-2015, Pierre-Olivier Latour\n All rights reserved.\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n * The name of Pierre-Olivier Latour may not be used to endorse\n or promote products derived from this software without specific\n prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL PIERRE-OLIVIER LATOUR BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#import \"GCDWebServerResponse.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\n/**\n * The GCDWebServerDataResponse subclass of GCDWebServerResponse reads the body\n * of the HTTP response from memory.\n */\n@interface GCDWebServerDataResponse : GCDWebServerResponse\n@property(nonatomic, copy) NSString* contentType; // Redeclare as non-null\n\n/**\n * Creates a response with data in memory and a given content type.\n */\n+ (instancetype)responseWithData:(NSData*)data contentType:(NSString*)type;\n\n/**\n * This method is the designated initializer for the class.\n */\n- (instancetype)initWithData:(NSData*)data contentType:(NSString*)type;\n\n@end\n\n@interface GCDWebServerDataResponse (Extensions)\n\n/**\n * Creates a data response from text encoded using UTF-8.\n */\n+ (nullable instancetype)responseWithText:(NSString*)text;\n\n/**\n * Creates a data response from HTML encoded using UTF-8.\n */\n+ (nullable instancetype)responseWithHTML:(NSString*)html;\n\n/**\n * Creates a data response from an HTML template encoded using UTF-8.\n * See -initWithHTMLTemplate:variables: for details.\n */\n+ (nullable instancetype)responseWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables;\n\n/**\n * Creates a data response from a serialized JSON object and the default\n * \"application/json\" content type.\n */\n+ (nullable instancetype)responseWithJSONObject:(id)object;\n\n/**\n * Creates a data response from a serialized JSON object and a custom\n * content type.\n */\n+ (nullable instancetype)responseWithJSONObject:(id)object contentType:(NSString*)type;\n\n/**\n * Initializes a data response from text encoded using UTF-8.\n */\n- (nullable instancetype)initWithText:(NSString*)text;\n\n/**\n * Initializes a data response from HTML encoded using UTF-8.\n */\n- (nullable instancetype)initWithHTML:(NSString*)html;\n\n/**\n * Initializes a data response from an HTML template encoded using UTF-8.\n *\n * All occurences of \"%variable%\" within the HTML template are replaced with\n * their corresponding values.\n */\n- (nullable instancetype)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables;\n\n/**\n * Initializes a data response from a serialized JSON object and the default\n * \"application/json\" content type.\n */\n- (nullable instancetype)initWithJSONObject:(id)object;\n\n/**\n * Initializes a data response from a serialized JSON object and a custom\n * content type.\n */\n- (nullable instancetype)initWithJSONObject:(id)object contentType:(NSString*)type;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"} +{"text": "[local]\nlocalhost ansible_connection=local ansible_python_interpreter=python3\n"} +{"text": ".class public Lcom/helpshift/conversation/activeconversation/d;\n.super Lcom/helpshift/common/domain/m;\n\n\n# instance fields\n.field final synthetic a:Ljava/util/List;\n\n.field final synthetic b:Lcom/helpshift/conversation/activeconversation/a;\n\n\n# direct methods\n.method public constructor (Lcom/helpshift/conversation/activeconversation/a;Ljava/util/List;)V\n .locals 0\n\n iput-object p1, p0, Lcom/helpshift/conversation/activeconversation/d;->b:Lcom/helpshift/conversation/activeconversation/a;\n\n iput-object p2, p0, Lcom/helpshift/conversation/activeconversation/d;->a:Ljava/util/List;\n\n invoke-direct {p0}, Lcom/helpshift/common/domain/m;->()V\n\n return-void\n.end method\n\n\n# virtual methods\n.method public final a()V\n .locals 5\n\n new-instance v2, Ljava/util/HashMap;\n\n invoke-direct {v2}, Ljava/util/HashMap;->()V\n\n iget-object v0, p0, Lcom/helpshift/conversation/activeconversation/d;->b:Lcom/helpshift/conversation/activeconversation/a;\n\n iget-object v0, v0, Lcom/helpshift/conversation/activeconversation/a;->g:Lcom/helpshift/common/util/HSObservableList;\n\n invoke-virtual {v0}, Lcom/helpshift/common/util/HSObservableList;->iterator()Ljava/util/Iterator;\n\n move-result-object v1\n\n :cond_0\n :goto_0\n invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z\n\n move-result v0\n\n if-eqz v0, :cond_1\n\n invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;\n\n move-result-object v0\n\n check-cast v0, Lcom/helpshift/conversation/activeconversation/message/m;\n\n iget-object v3, v0, Lcom/helpshift/conversation/activeconversation/message/m;->n:Ljava/lang/Long;\n\n if-eqz v3, :cond_0\n\n iget-object v3, v0, Lcom/helpshift/conversation/activeconversation/message/m;->n:Ljava/lang/Long;\n\n invoke-interface {v2, v3, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\n\n goto :goto_0\n\n :cond_1\n iget-object v0, p0, Lcom/helpshift/conversation/activeconversation/d;->a:Ljava/util/List;\n\n invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;\n\n move-result-object v3\n\n :cond_2\n :goto_1\n invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z\n\n move-result v0\n\n if-eqz v0, :cond_3\n\n invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;\n\n move-result-object v0\n\n check-cast v0, Lcom/helpshift/conversation/activeconversation/message/m;\n\n iget-object v1, v0, Lcom/helpshift/conversation/activeconversation/message/m;->n:Ljava/lang/Long;\n\n invoke-interface {v2, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;\n\n move-result-object v1\n\n check-cast v1, Lcom/helpshift/conversation/activeconversation/message/m;\n\n if-eqz v1, :cond_2\n\n iget-object v4, v0, Lcom/helpshift/conversation/activeconversation/message/m;->o:Ljava/lang/String;\n\n iput-object v4, v1, Lcom/helpshift/conversation/activeconversation/message/m;->o:Ljava/lang/String;\n\n const/4 v4, 0x1\n\n iput v4, v0, Lcom/helpshift/conversation/activeconversation/message/m;->r:I\n\n iget-object v4, v0, Lcom/helpshift/conversation/activeconversation/message/m;->p:Ljava/lang/String;\n\n iput-object v4, v1, Lcom/helpshift/conversation/activeconversation/message/m;->p:Ljava/lang/String;\n\n iget-object v0, v0, Lcom/helpshift/conversation/activeconversation/message/m;->q:Ljava/lang/String;\n\n iput-object v0, v1, Lcom/helpshift/conversation/activeconversation/message/m;->q:Ljava/lang/String;\n\n goto :goto_1\n\n :cond_3\n return-void\n.end method\n"} +{"text": "\n\n \n \n \n \n УИ_ФайловыйМенеджер\n \n ru\n Файловый менеджер [УИ]\n \n true\n DataProcessor.УИ_ФайловыйМенеджер.Form.Форма\n \n ru\n Файловый менеджер\n \n \n ru\n Обработка для удобной работы с файлами между клиентом и сервером. Передача, просмотр, удаление. На текущий момент содержит синхронные вызовы\n \n \n Форма\n \n ru\n Форма\n \n PersonalComputer\n MobileDevice\n \n\n"} +{"text": "changelog (for developer use only, include unreleased versions)\r\n\r\n0.5.60\r\n****** Embed the default snippet in Fingertext\r\n\r\n0.5.59\r\n****** The symbol \"-\" is allowed in triggertext.\r\n****** only () is used to wrap parameters\r\n\r\n\r\n0.5.58\r\n****** Added: Download Fingertext Sample Snippets\r\n- The last hotspot problem works for diaglog insertion too\r\n- The \"delete all snippet\" command backup snippets automatically without asking \r\n- default hotkey for insertion dialog changed to alt+/\r\n- Ask about overwriting option only when you have snippets in your database\r\n\r\n0.5.57.2\r\n- restrict the addition of $[0[]0] to snippet with no hotspot and it's inserted to a document with no hotspot following the insertion\r\n\r\n0.5.57.1\r\n- Try to fix the final hotspot problem without an extra $[0[]0]\r\n\r\n0.5.57\r\n- Fixed: error in finding previous hotspot when the hotspot is located at the beginning of the document\r\n- Fixed: error causing fingertext do not navigate to another hotspot after choice in (lis)\r\n- prefix global variable with g_\r\n\r\n0.5.56\r\n- Fixed: critical bug of crashing npp when triggering snippets\r\n- Fixed: More refined solution of hotspot navigation priority when the user trigger a snippet in the middle of another snippet\r\n\r\n0.5.55\r\n- Add $[0[]0] as the lowest priority hotspot\r\n- change the automatically added hotspot to $[0[]0]\r\n- navigate to next hotspot when (lis) hotspot is chosen.\r\n- Add (eva) and final caret location in snippet editor\r\n- Changed snippet editor hint text\r\n- Changed: hotspot will be inserted to the start of snippet if the caret is not at the snippet content but the insert button is clicked on the snippet dock\r\n\r\n0.5.54.3\r\n- Added: keyword hotspot LASTOPTION and LASTLISTITEM\r\n\r\n0.5.54.2\r\n- Fixed: undesirable moving of screen position when snippet trigger (caused by the $[![]!] added)\r\n\r\n0.5.54\r\n- Fixed: for snippet without a stopping hotspot, a $[![]!] is automatically added. It fixed the problem of default value in the last hotspot, or option hotspot not working properly.\r\n- improved performance in dealing with escape char\r\n- Fixed: bug caused by too many escape chars, now limited to 20\r\n****** Max sleeping time is 60 seconds\r\n- Added: keyword DIRECTORY, TEMPFILE and FILEFOCUS now takes delimiter as a parameter\r\n\r\n0.5.53\r\n- clean up subclassing\r\n- Added: previous snippet\r\n- Added: keyword TRIGGERTEXT\r\n\r\n\r\n0.5.52\r\n- Fixed gray bug (solution by jvdanlio)\r\n\r\n0.5.51\r\n- Fixed bug in (run)\r\n\r\n\r\n0.5.50\r\n- reset settings file\r\n\r\n0.5.47\r\n- Added: snippet count on snippetDock\r\n- Fixed: delete and edit doesn't scroll the snippet list\r\n- Added: association scope\r\n****** Added: Allow for multiple custom scope\r\n- Fixed: Fingertext hotspot will not interfere regular autocomplete\r\n- Changed: Auto hotspot navigation after list box seletion\r\n- Fixed: Messagebox wordings and typos\r\n- Changed: snippet dock show all snippet when there is a selection\r\n- Added: New Scope \"Ext:\"\r\n- Fixed: The bug of double clicking on Snippet dock will not edit the clicked snippet\r\n- Fixed: problem importing and exporting snippets to very long path name\r\n\r\n0.5.46\r\n- Added: Dynamic insertion hint\r\n- Added: New Scope \"Name:\" , which can cater multiple extensions\r\n- Added: more informative save snippet confirmation message\r\n- Changed: remove spaces in insertion dialog hint\r\n- Fixed: snippet editor not openning when live update show no snippet\r\n- Added: Insert and edit mode\r\n- Added: hotspot insertion combo box\r\n\r\n0.5.45.1\r\n- multiple scopes support\r\n\r\n0.5.45\r\n- Added: Editor Specific Dock\r\n- Fixed: use _ in Oldcopy and fixed the import error\r\n- Fixed: closing snippetdock and reopen cause bug in edit button\r\n- Changed: Disable Fingertext will disable all snippet trigger related functionalities\r\n- Changed: New stub text of new snippet.\r\n- Added: exporting a subset of snippets\r\n\r\n0.5.44\r\n- Fixed: problem of multiline tabbing\r\n- Added: Snippet dialog\r\n****** Added: SYSTEM snippets\r\n- Fixed: snippet editor not showing all snippets\r\n- Changed: The snippet dock is always putting GLOBAL snippets at the bottom\r\n- Fixed: nested hotspot not triggered correctly when an empty param is inserted\r\n- Performance improvement of hotspot navigation\r\n- Changed: Fallback_tab is not default to be on\r\n\r\n\r\n0.5.43.2\r\n- apply username39's patch on EOL conversion\r\n\r\n0.5.43.1\r\n- set sciFocus to 1 at launch\r\n\r\n0.5.43\r\n- Changed: prevent settings window to be saved in the session\r\n****** Added: fallback_tab in settings, when you use UNDO after a tab completion or a snippet triggering. Fingertext will restore the TAB action\r\n****** primitive implementation of snippet insertion dialog and SELECTION keyword\r\n****** Fixed: COPYLINE ....etc. will not cut the space before the triggertext\r\n- Fixed: shutdown autocomplete when undo\r\n- Fixed: Direct Insertion is now compatible with (opt) and (lis)\r\n- Fixed: Snippet preview will not show [>END<]\r\n\r\n0.5.42\r\n- Fixed: critical bug fix of the compatibility of (opt) and several lexer\r\n- Fixed: option hotspot UNDO bug\r\n- Changed: prevent the ftb window to be saved in the session\r\n\r\n0.5.41\r\n- Fixed: memory leakage problem of live update\r\n- Fixed: export snippet error due to live update problem\r\n- Fixed: export and import snippet speed largely improved by shutting down live update temporarily\r\n- Added: a dummy package column in database\r\n- Changed: improved snippet preview box\r\n- Fixed: inclusive triggertext complete not working\r\n- restructure plugin init functions\r\n- improve start up performance by removing redundant updateScintilla calls\r\n- update the settings hint\r\n- Changed: undo after a tab triggertext completetion will become a regular tab\r\n- Fixed: undo works properly after params insertion\r\n- Changed: smart split works in params insertion\r\n\r\n\r\n0.5.40\r\n- optionarray use vector of string instead of char**, the limit of option numbers is lifted\r\n****** (eva) and (opt) use smartsplit, which means hotspot can contain delimiters\r\n****** (eva) VERBOSE and TERNARY mode\r\n****** Added: SLEEP, REPLACE and REGEXREPLACE keyword\r\n- Changed: Faster loading up, esp for users who save previous session\r\n- Fixed: snippet dock not updating when previous session is loaded.\r\n- Fixed: Notepad++ not registering state of snippet dock\r\n- alert functions are moved to a separate file\r\n****** Changed: random seed generated within the evaluate.cpp file\r\n- Fixed: FILENAME EXTNAME keyword insert paths with Chinese characters properly under ANSI\r\n- Added: more instructions about params insertion method into the README. Try to trigger the snippet \"mit\" by typing \"mit(2010,John Smith)\" (without quote) and hit tab to see what it means.\r\n- Partially Fixed: memory leakage caused by snippet live update and export snippets\r\n\r\n0.5.39\r\n- Fixed: a bug causing npp to freeze when updating fingertext and shutdown npp afterwards\r\n- Fixed: keyword TEMP is not working\r\n****** Add back the keyword GET for temporary backward compatibility\r\n****** Add rounding, permutation and combination etc to (eva)\r\n- Performance improvement by using GETTEXTRANGE instead of SETSELECTION and GETSELTEXT\r\n\r\n0.5.38\r\n- Critical Fix of import error caused by changing the specification of file open type\r\n****** Added: hotspot (web)\r\n- Fixed: Params insertion is now compatible with chain snippet\r\n****** CUT'X' and COPY'X' (and alike) are changed to CUTLINE:X and COPYLINE:X for consistency\r\n****** default value of CUT: COPY: (and alike) changed to CUT and COPY for consistency\r\n****** Major rewrite in (eva), fixed bugs and a lot more features\r\n\r\n0.5.37\r\n****** Added: SETFILE, WRITE: and READ for writing and reading files\r\n****** Added: WRITETEMP READTEMP for reading and writing tempfile\r\n****** Added: FTCUT and FTCOPY series, which is a copy of the CUT and COPY series but utilitize fingertext custom clipboard instead of the reguler clipboard\r\n****** FTWRITETEMP for writing to the custom clipboard to the temp file\r\n****** Added: FTPASTE to retrieve text from fingertext custom clipboard\r\n****** Changed: FINDWIN and FINDCHILD are changed to SETWIN SETCHILD WINFOCUS \r\n- Changed: the old non-published GET series is axed\r\n- Fixed: import snippet character overflow problem\r\n\r\n0.5.36\r\n****** Changed: CUT and COPY keyword are referencing the start of hotspot instead of startingPos.\r\n- Fixed: Params insertion cause fingertext to freeze\r\n- Refactoring and clean the COPY and CUT keyword code\r\n\r\n0.5.35\r\n- Added: Customizable option delimiter of (opt), the default delimiter is set to be |\r\n- Changed: Increase the limit of total number of options to 50\r\n- Fixed: Pressing return key in the triggertext field of snippet editor cause annotation bug.\r\n- Added: dynamic hotspot (lis), which is a drop down box version of (opt)\r\n****** Added: keyword KEYHIT, which is essentially the same as KEYDOWN + KEYUP\r\n****** Total rewrite of CUT: COPY: CUTLINE COPYLINE CUTDOC COPYDOC CUT'X' and COPY'X'\r\n\r\n0.5.34\r\n- clean up redundant caret position record\r\n- Fixed: tab caused document to scroll in large documents\r\n\r\n0.5.33.4\r\n- Added: user customizable delimiter of parameter insertion, default value is set to ,\r\n\r\n0.5.33.3\r\n- Changed keywords in finding external window to FINDWIN\r\n- Add FINDCHILD\r\n\r\n0.5.33.2\r\n- Fixed: tag_tab_completion notworking\r\n****** Added: keyword to send keys to external window\r\n\r\n0.5.33.1\r\n****** Added: priority hotspots\r\n\r\n0.5.33\r\n- Fixed: a bug causing nested normal hotspot not triggering in correct sequence is fixed.\r\n- Improved performance by removing redundant check during parameter insertion\r\n- Hotspot that skipped by manually moving the caret will be pick up after all other hotspots are triggered\r\n- Add functions to prepare for future implementation of getting window focus and type in another window\r\n- (eva) can cater upper and lower case expression\r\n- fixed a critical bug of snippet not importing correctly\r\n\r\n0.5.31\r\n- Fixed: freeze when closing npp immediately after upgrade \r\n- Added: dynamic hotspot (eva)\r\n- Changed: Snippets can be triggered after period\r\n\r\n0.5.30\r\n- parameter insertion handle multi identical hotspots correctly\r\n- snippetdock states remember previous state\r\n\r\n0.5.29\r\n- restructure the project folder structure\r\n- add static dialog for debug purpose\r\n- hotspots can be instantly replaced by parameters passed to the triggertext\r\n\r\n0.5.28\r\n- Changed: change hotspot (cmd) to (run)\r\n- Fixed: the problem of appending cmd /c will break some commands\r\n- Fixed: Lang:PHP not working\r\n- upgrade to sqlite3.7.7.1\r\n\r\n0.5.27\r\n- Changed: merge in jvdanilo's implementation of executecommand\r\n\r\n0.5.26\r\n- upgrade to sqlite3.7.6.3\r\n\r\n0.5.25\r\n****** Added: private snippet available, any snippet with triggertext beginning with _ cannot be triggered and will not be shown in liveupdate. But you can still see them in editMode and they can be triggered by chain snippets\r\n- snippet triggertext completion are default to be non-inclusive\r\n- Big performance improvement by using direct scintilla method\r\n- Fixed: Buffer changed triggered events (like updateMode) not triggering when use attempt to close npp and cancel afterwards\r\n- turn off live update when selection is rectangle to prevent freeze when selecting multiple line and type\r\n- Change default snippet list length to 1000 to temporarily deal with the problem caused by snippetlistlength limit\r\n- Changed: conflict suffix is now added to the old snippet instead of new snippet\r\n- Added: option to force multipasting or not\r\n\r\n0.5.24\r\n- restructure the version text and about text\r\n- restructure initialization of plugin. Include not rewriting the whole settings file everytime fingertext is initialized for faster notepad++ loading\r\n- Fixed: Alert message show up when a tab key is restored\r\n\r\n0.5.23\r\n- bump version to fix the problem that I leave testing option open in 0.5.22\r\n\r\n0.5.22\r\n****** Added: Messagebox hotspot (msg)\r\n- Changed: default chain limit to 40\r\n\r\n0.5.21\r\n- Changed: New snippet editor\r\n- Added: Can go forward (right arrow) or backward(left arrow) when cycling through option hotspot, tab to choose option\r\n- Added: Import and export action will show waiting cursor\r\n- Fixed: potential memory leakage problem cause by the quick fix in 0.5.20\r\n- Fixed: Fingertext freeze if there are incomplete closing hotspot brankets\r\n- Fixed: better checking for the end of option hotspot\r\n\r\n0.5.20\r\n- Changed: All hotspots, normal or dynamic are triggered under the same rule, from inside to outside and from left to right.\r\n- Fixed: tab_tag_completion is not working\r\n\r\n0.5.18\r\n- generalize cleanupstring for future use\r\n\r\n0.5.17\r\n- slight performance increase in snippet live update\r\n- undo process will not cause snippet hint to update\r\n- do not turn off option when language change\r\n\r\n0.5.16\r\n- Primitive implementation of Option Dynamic Hotspot\r\n****** Added: keyword SCOPE:\r\n****** CUT: and GET: will get all when no parameter is passed or search fail\r\n****** CUTALL and GETALL is deleted\r\n- fixed a critical bug of snippetdock not showing snippets with ext and filename scope\r\n- fixed bug of not endundoaction in snippet editor mode\r\n- improve performance of hotspot checking, and snippet live update with long tag\r\n- snippethint not updating if the dock is invisible, and update everytime it's shown.\r\n- A little bit improvement in snippet live update memory leakage, but still a problem\r\n\r\n0.5.15\r\n****** Added GETALL , GETLINE, CUTALL, CUTLINE\r\n- Fixed: extra newline in tempfile. just open tempfile in binary so that it writes correctly\r\n \r\n0.5.14\r\n- New keyword DATE and TIME. Which makes the format of datetime output customizable, and substituted the old DATELONG DATESHORT TIMELONG TIMESHORT\r\n- change keyword CAP to UPPER, LOW to LOWER\r\n****** Change in behaviour of GET:, it gets all the text immediately after the script tag and one space before the triggertext\r\n****** Formally add CUT \r\n****** Added CUT:, GET: GET \r\n- Clean up code of generating time stamps\r\n- Correct typo in upgrade message\r\n\r\n0.5.13.1\r\n- Try to fix selectiontosnippet AGAIN\r\n\r\n0.5.13\r\n- Changed: Pop up option of whether to overwrite or keep copies in conflicting snippets\r\n- restructure the importsnippet function\r\n- Fixed: less memory leakage on liveupdate and snippet import\r\n- Fixed: nested normal hotspots not triggering correctly\r\n- Changed: update the setting hints\r\n- Added: export and delete all snippets\r\n- Added: new keyword CAP and LOW\r\n\r\n0.5.12\r\n- Added: Primitive implementation of Language based snippets\r\n- Update scintilla.h so that it's compatibile with notepad++ 5.9\r\n- Change the way dynamic snippet work. Now they nested corrected with the rule from left to right and inside to outside.\r\n\r\n\r\n0.5.11\r\n- Added: User customizable escape character\r\n- Performance improvement in snippet triggering\r\n- Fixed: Snippet export limited by list length\r\n- Added: snippet preview box live update\r\n- Fixed: critical bug when live update is on and a long chain of chinese characters are typed\r\n\r\n0.5.10\r\n- Added: Language based snippets (cannot be triggered yet. basic code in the background)\r\n- Added: Custom Scope, a user defined Global scope\r\n- rewriting the triggerTag, snippetComplete and findTagSQLite functions\r\n- edit mode detect full file name before changing mode\r\n- \"List of All Snippet\" is now on static text\r\n\r\n0.5.9\r\n- Added: Option to make triggertext completion less inclusive\r\n- Fixed: bug in importing snippets with different endline characters.\r\n- Fixed: unknown exception and bad allocation in import snippet function\r\n- Added: Close the temp file and Prompt to close the ftb file before import\r\n- Fixed: A temporary fix for cmd line error\r\n\r\n0.5.8\r\n- Added: generation of conflict copy instead of overwrite\r\n- Allow for underscore and period in triggertext\r\n- fixed: creating snippet with empty selection sometimes cause freeze\r\n- rearrange notification listening\r\n- Dynamically resize snippet list\r\n- Fixed: Extra space added to the end of snippet everytime a snippet is saved.\r\n- change the wording when no snippets are imported or exported\r\n\r\n0.5.7\r\n- performance improvement for live update snippet hint\r\n- fixed: Annotation not shown correctly in editmode\r\n- change keyword GET to GET:\r\n- update quick guide\r\n\r\n0.5.6\r\n- remove GETSCRIPT, add a more general keyword GET\r\n\r\n0.5.5\r\n- Add GETSCRIPT keyword\r\n- Fixed snippet editor annotation infinite loop bug\r\n- can trigger snippet in edit mode. (but hotspot navigation is not, as it disturb snippet editing, also live update would not be available in edit mode)\r\n- Experimental feature: warmspot\r\n- remove insert dynmaic hotspot menu command.\r\n\r\n0.5.4\r\n- combine createsnippet and selectiontosnippet\r\n- Fixed bug of snippetdock not updating when save a file with another extension name\r\n\r\n0.5.3.1\r\n- fixed bug of autoscrolling when switch between file\r\n- Multi pasting work for simultaneous hotspots\r\n\r\n0.5.3\r\n- Nested (normal) hotspots\r\n- fixed a bug causing hotspot with the same name not triggering correctly\r\n\r\n0.5.1\r\n- Fixed (Edit view not activate correctly when the screen is splitted)\r\n\r\n0.5.0\r\n- restructure config loading\r\n- Added command for inserting different kinds of hotspots\r\n- Added command to create snippet from selection\r\n- Added command to change settings in config.ini\r\n- SnippetDock items are lining up better\r\n- group files into FingerText folder under config folder\r\n\r\n0.4.16\r\n- Add (key)CUT dynamic hotspots\r\n- fixing bug of saving file in programfile folders without admin right\r\n- performance improvment in live search\r\n- fixed tag completion not updating snippetdock hint\r\n- fixed infinite recusion bug in keyword and command hotspot\r\n- the chain snippet is indicated by $[![(cha)]!] instead of $[![(chain)]!] so that different hotspots can line up better.\r\n\r\n0.4.15\r\n- add (cmd) dynamic hotpots\r\n\r\n0.4.14\r\n- fixed heap corruption bug in edit snippet, getcurrenttag and hotspotnavigation\r\n- fixed many things broken by live search \r\n- Make permissive tag triggering an option and move it to a cmd \"tag completion\"\r\n- Add basic (key) and (chain) hotspot\r\n\r\n0.4.13.1\r\n- Added indentation reference (very ugly implementation)\r\n- fixed snippetdock toggle bug\r\n\r\n0.4.12\r\n- Add live update snippetdock \r\n- preview showing instructions when no item is selected\r\n- permissive tag triggering\r\n- Order list by tagType (can be configured in ini file)\r\n\r\n\r\n0.4.11\r\n- important bug fix on snippet with no space\r\n- save button disabled in normal mode\r\n\r\n\r\n0.4.10\r\n- Case insensitive search. Now extension .c and .C are viewed as the same extension,\r\n- More instructions on the snippetdock\r\n- and TriggerText \"NpP\" is the same as \"nPp\"\r\n- Replace help page link by Quick Guide\r\n- Fixed problem of extra endline during repeated exporting and importing\r\n- more messages for snippet save problem\r\n\r\n0.4.9\r\n- Fixed problem of not opening the correct snippet in edit mode\r\n- Cmd to enable or disable fingertext\r\n- Better snippet save behaviour\r\n\r\n\r\n0.4.8\r\n- Snippet Preview Box working (chinese snippet text not supported)\r\n- edit mode and normal mode (all snippets show in the list in edit mode)\r\n\r\n0.4.7\r\n- centralize version number\r\n\r\n0.4.6\r\n- Use annotation in edit view.\r\n\r\n0.4.5\r\n- Use ini config file\r\n- remove the list length text box\r\n- change the list double click behaviour. it trigger edit instead of insert.\r\n- editor use SnippetEditor.ftb as buffer\r\n- can use ctrl-S to save snippet\r\n\r\n0.4.4\r\n- Better readme.rdoc\r\n\r\n0.4.3\r\n- Implement database export function\r\n\r\n0.4.2\r\n- Using the config folder to storage database (should solve the windows 7 admin problem)\r\n- Add import database function (export coming soon)\r\n- The whole plugin become a single dll for easy installation. The sample snippet database can be imported afterwards.\r\n\r\n0.4.1\r\n- Fixing the version number problem\r\n\r\n0.4.0\r\n- Disabling the debuging testing function.\r\n\r\n0.3.11\r\n- Edit instructions for the new sqlite based system\r\n\r\n0.3.10\r\n- Double Click insert snippet\r\n- Fixed Filename specific snippet problem\r\n\r\n0.3.9\r\n- Implemented Edit and Delete\r\n- Refine snippet CRUD implementation\r\n- Disable buttons when snippet list not in focus\r\n\r\n0.3.8\r\n- Add Snippet Dock, implemented snippet list.\r\n- Impletmented Create and save snippet.\r\n\r\n0.3.7\r\n- Resume Filename specific snippets under sqlite system.\r\n\r\n0.3.6\r\n- Using Sqlite to store snippets instead of using ecusive file system. Snippet CRUD inside notepad++ is not available yet. \r\n\r\n0.3.5:\r\n- Fixed problem after merging caused by incompatibility of two branches (tab key will scroll the page when tag is not found, triggering snippet not at the beginning of the document will clear characters before the tag)\r\n- Closing autocomplete window when snippet is triggered\r\n- Fixing problem of multiple identical hotspots sometimes not simultaneously selected\r\n- Fixed unicode convertion buffer size\r\n\r\n0.3.4\r\n- Fixing problem caused after merging (not preserving working folder, chinese snippet not working under UTF-8 document)\r\n- Add version resource file\r\n\r\n0.3.3\r\n- Merging the improvement by Dave Brotherstone.\r\n\r\n0.3.2\r\n- Fixed the problem of long Hotspot name\r\n\r\n0.3.1\r\n- Add more details in usage description.\r\n- edit some typo in sample template\r\n- refactor the tag path part\r\n- fixed possible bug of char array manipulation\r\n- allow for more hotspots\r\n \r\n0.3.0\r\n- Implemented Snippet set for specific file name.\r\n- The priority is FileName>Ext>Global\r\n- performance improvement to path search\r\n\r\n0.2.7\r\n- replace multiple identical hotspots in one undo steps\r\n\r\n0.2.6\r\n- Multiple hotspot selection and hotspot hint text replacement works simultaneously\r\n\r\n0.2.5\r\n- Add Multiple hotspot selection.\r\n- hotspot hint text replacement disabled temporarily.\r\n\r\n0.2.4\r\n- Change in tab navigation behaviour. The hotspot will be replaced by the hint text when using tab navigation\r\n\r\n\r\n0.2.3\r\n- Add support for chinese character tag name. Can be triggered from either ANSI or Utf-8 document (But chinese name mess up the word selection in the editor so it may not trigger correctly under ANSI document. So English tag names are encouraged.)\r\n\r\n\r\n0.2.2\r\n- Add Readme and License\r\n- fixed tag longer than snippet problem\r\n- fixed the limited row size problem\r\n- Turn on the undo step squash function which is accidentally turned off in previous version\r\n- Lots of performance improvement changes\r\n- Add basic c++ sample snippets\r\n\r\n0.2.0\r\n- Support utf-8 encoding. (All snippets are assumed to be in ANSI, and will be converted if current page is utf-8)\r\n- Fixed long tab problem\r\n- Fixed Spaces or tabspaces before tab problem\r\n- Fixed empty snippet problem\r\n\r\n0.1.2\r\n- Emulate tab behaviour when no tag match or selection is rectangle\r\n\r\n0.1.1\r\n- Snippet insertion recorded as one single undo step\r\n\r\n0.1.0 \r\n- First Alpha verison. Implemented basic tab trigger snippet and hotspot navigation"} +{"text": "\n\n\n\n\nDbKey.LinkKey\n\n\n\n\n\n\n\n\n\n
\n\n\n\n
\n\n
\n
\n
    \n
  • Summary: 
  • \n
  • Nested | 
  • \n
  • Field | 
  • \n
  • Constr | 
  • \n
  • Method
  • \n
\n
    \n
  • Detail: 
  • \n
  • Field | 
  • \n
  • Constr | 
  • \n
  • Method
  • \n
\n
\n\n\n
\n\n\n
\n
nxt.db
\n

Class DbKey.LinkKey

\n
\n
\n
    \n
  • java.lang.Object
  • \n
  • \n
      \n
    • nxt.db.DbKey.LinkKey
    • \n
    \n
  • \n
\n
\n
    \n
  • \n
    \n
    All Implemented Interfaces:
    \n
    DbKey
    \n
    \n
    \n
    Enclosing interface:
    \n
    DbKey
    \n
    \n
    \n
    \n
    public static final class DbKey.LinkKey\nextends java.lang.Object\nimplements DbKey
    \n
  • \n
\n
\n
\n\n
\n
\n
    \n
  • \n\n
      \n
    • \n\n\n

      Method Detail

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

        getId

        \n
        public long[] getId()
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        setPK

        \n
        public int setPK(java.sql.PreparedStatement pstmt)\n          throws java.sql.SQLException
        \n
        \n
        Specified by:
        \n
        setPK in interface DbKey
        \n
        Throws:
        \n
        java.sql.SQLException
        \n
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        setPK

        \n
        public int setPK(java.sql.PreparedStatement pstmt,\n                 int index)\n          throws java.sql.SQLException
        \n
        \n
        Specified by:
        \n
        setPK in interface DbKey
        \n
        Throws:
        \n
        java.sql.SQLException
        \n
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        equals

        \n
        public boolean equals(java.lang.Object o)
        \n
        \n
        Overrides:
        \n
        equals in class java.lang.Object
        \n
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        hashCode

        \n
        public int hashCode()
        \n
        \n
        Overrides:
        \n
        hashCode in class java.lang.Object
        \n
        \n
      • \n
      \n
    • \n
    \n
  • \n
\n
\n
\n\n\n\n
\n\n\n\n
\n\n
\n
\n
    \n
  • Summary: 
  • \n
  • Nested | 
  • \n
  • Field | 
  • \n
  • Constr | 
  • \n
  • Method
  • \n
\n
    \n
  • Detail: 
  • \n
  • Field | 
  • \n
  • Constr | 
  • \n
  • Method
  • \n
\n
\n\n\n
\n\n\n\n"} +{"text": "# Translation of Odoo Server.\n# This file contains the translation of the following modules:\n# * base_location\n#\n# Translators:\n# OCA Transbot , 2017\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Odoo Server 11.0\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2017-11-22 03:38+0000\\n\"\n\"PO-Revision-Date: 2017-11-22 03:38+0000\\n\"\n\"Last-Translator: OCA Transbot , 2017\\n\"\n\"Language-Team: Bulgarian (https://www.transifex.com/oca/teams/23907/bg/)\\n\"\n\"Language: bg\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: \\n\"\n\"Plural-Forms: nplurals=2; plural=(n != 1);\\n\"\n\n#. module: base_location\n#: model:res.city,name:base_location.demo_brussels_city\nmsgid \"Brussels\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model.fields,help:base_location.field_res_company__country_enforce_cities\nmsgid \"\"\n\"Check this box to ensure every address created in that country has a 'City' \"\n\"chosen in the list of the country's cities.\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.actions.act_window,name:base_location.action_res_city_full\n#: model:ir.ui.menu,name:base_location.locations_menu_cities\nmsgid \"Cities\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model,name:base_location.model_res_city\n#: model:ir.model.fields,field_description:base_location.field_res_city_zip__city_id\nmsgid \"City\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model.fields,field_description:base_location.field_res_company__city_id\nmsgid \"City ID\"\nmsgstr \"\"\n\n#. module: base_location\n#: model_terms:ir.ui.view,arch_db:base_location.view_company_form_city\n#: model_terms:ir.ui.view,arch_db:base_location.view_partner_form\nmsgid \"City completion\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model.fields,field_description:base_location.field_res_partner__city_id\n#: model:ir.model.fields,field_description:base_location.field_res_users__city_id\nmsgid \"City of Address\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model,name:base_location.model_res_city_zip\nmsgid \"City/locations completion object\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model,name:base_location.model_res_company\nmsgid \"Companies\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model,name:base_location.model_res_partner\nmsgid \"Contact\"\nmsgstr \"\"\n\n#. module: base_location\n#: model_terms:ir.ui.view,arch_db:base_location.view_country_search\nmsgid \"Country\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model.fields,field_description:base_location.field_res_city_zip__create_uid\nmsgid \"Created by\"\nmsgstr \"Създадено от\"\n\n#. module: base_location\n#: model:ir.model.fields,field_description:base_location.field_res_city_zip__create_date\nmsgid \"Created on\"\nmsgstr \"Създадено на\"\n\n#. module: base_location\n#: model:ir.model.fields,field_description:base_location.field_res_city_zip__display_name\nmsgid \"Display Name\"\nmsgstr \"Име за показване\"\n\n#. module: base_location\n#: model_terms:ir.actions.act_window,help:base_location.action_res_city_full\nmsgid \"\"\n\"Display and manage the list of all cities that can be assigned to\\n\"\n\" your partner records. Note that an option can be set on each \"\n\"country separately\\n\"\n\" to enforce any address of it to have a city in this list.\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model.fields,field_description:base_location.field_res_company__country_enforce_cities\nmsgid \"Enforce Cities\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model.fields,field_description:base_location.field_res_city_zip__id\nmsgid \"ID\"\nmsgstr \"ID\"\n\n#. module: base_location\n#: model:ir.model.fields,field_description:base_location.field_res_city_zip____last_update\nmsgid \"Last Modified on\"\nmsgstr \"Последно обновено на\"\n\n#. module: base_location\n#: model:ir.model.fields,field_description:base_location.field_res_city_zip__write_uid\nmsgid \"Last Updated by\"\nmsgstr \"Последно обновено от\"\n\n#. module: base_location\n#: model:ir.model.fields,field_description:base_location.field_res_city_zip__write_date\nmsgid \"Last Updated on\"\nmsgstr \"Последно обновено на\"\n\n#. module: base_location\n#: model_terms:ir.ui.view,arch_db:base_location.view_partner_form\nmsgid \"Location completion\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.actions.act_window,name:base_location.action_zip_tree\nmsgid \"Locations\"\nmsgstr \"\"\n\n#. module: base_location\n#: model_terms:ir.ui.view,arch_db:base_location.view_city_zip_filter\nmsgid \"Search zip\"\nmsgstr \"\"\n\n#. module: base_location\n#: code:addons/base_location/models/res_partner.py:0\n#, python-format\nmsgid \"The city of partner %s differs from that in location %s\"\nmsgstr \"\"\n\n#. module: base_location\n#: code:addons/base_location/models/res_partner.py:0\n#, python-format\nmsgid \"The country of the partner %s differs from that in location %s\"\nmsgstr \"\"\n\n#. module: base_location\n#: code:addons/base_location/models/res_partner.py:0\n#, python-format\nmsgid \"The state of the partner %s differs from that in location %s\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model.fields,help:base_location.field_res_company__zip_id\nmsgid \"Use the city name or the zip code to search the location\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model.constraint,message:base_location.constraint_res_city_name_state_country_uniq\nmsgid \"\"\n\"You already have a city with that name in the same state.The city must have \"\n\"a unique name within it's state and it's country\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model.constraint,message:base_location.constraint_res_city_zip_name_city_uniq\nmsgid \"\"\n\"You already have a zip with that code in the same city. The zip code must be \"\n\"unique within it's city\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model.fields,field_description:base_location.field_res_city_zip__name\nmsgid \"ZIP\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model.fields,field_description:base_location.field_res_company__zip_id\n#: model:ir.model.fields,field_description:base_location.field_res_partner__zip_id\n#: model:ir.model.fields,field_description:base_location.field_res_users__zip_id\nmsgid \"ZIP Location\"\nmsgstr \"\"\n\n#. module: base_location\n#: model_terms:ir.ui.view,arch_db:base_location.city_zip_form\nmsgid \"Zip\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.ui.menu,name:base_location.locations_menu_zips\n#: model_terms:ir.ui.view,arch_db:base_location.city_zip_tree\n#: model_terms:ir.ui.view,arch_db:base_location.view_city_form\n#: model_terms:ir.ui.view,arch_db:base_location.view_res_country_city_better_zip_form\nmsgid \"Zips\"\nmsgstr \"\"\n\n#. module: base_location\n#: model:ir.model.fields,field_description:base_location.field_res_city__zip_ids\nmsgid \"Zips in this city\"\nmsgstr \"\"\n\n#~ msgid \"Group By\"\n#~ msgstr \"Групиране по\"\n"} +{"text": "/*\n * Copyright 2000-2009 JetBrains s.r.o.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.intellij.ide.util.frameworkSupport;\n\nimport com.intellij.framework.library.FrameworkLibraryVersionFilter;\nimport com.intellij.openapi.Disposable;\nimport com.intellij.openapi.module.Module;\nimport com.intellij.openapi.roots.ModifiableRootModel;\nimport com.intellij.openapi.roots.libraries.Library;\nimport com.intellij.util.EventDispatcher;\nimport org.jetbrains.annotations.NotNull;\nimport org.jetbrains.annotations.Nullable;\n\nimport javax.swing.*;\nimport java.util.Collections;\nimport java.util.List;\n\npublic abstract class FrameworkSupportConfigurable implements Disposable {\n private final EventDispatcher myDispatcher = EventDispatcher.create(FrameworkSupportConfigurableListener.class);\n\n @Nullable\n public abstract JComponent getComponent();\n\n public abstract void addSupport(@NotNull Module module, @NotNull ModifiableRootModel model, final @Nullable Library library);\n\n public FrameworkVersion getSelectedVersion() {\n return null;\n }\n\n public List getVersions() {\n return Collections.emptyList();\n }\n\n public void onFrameworkSelectionChanged(boolean selected) {\n }\n\n @Nullable\n public FrameworkLibraryVersionFilter getVersionFilter() {\n return FrameworkLibraryVersionFilter.ALL;\n }\n\n public boolean isVisible() {\n return true;\n }\n\n public void addListener(@NotNull FrameworkSupportConfigurableListener listener) {\n myDispatcher.addListener(listener);\n }\n\n public void removeListener(@NotNull FrameworkSupportConfigurableListener listener) {\n myDispatcher.removeListener(listener);\n }\n\n protected void fireFrameworkVersionChanged() {\n myDispatcher.getMulticaster().frameworkVersionChanged();\n }\n\n @Override\n public void dispose() {\n }\n}\n"} +{"text": "/*\n\tFile: AVAudioEngine.h\n\tFramework: AVFoundation\n\t\n\tCopyright 2016 Apple Inc. All rights reserved.\n*/\n\n#import \n\n"} +{"text": "import ceylon.language.meta.model{...}\n\nclass Bug6902() {\n shared class MemberWithCtors {\n shared new () {}\n shared new create() {}\n shared new instance {}\n }\n}\nshared void bug6902() {\n assert (is MemberClassValueConstructor<> mcvc = `Bug6902.MemberWithCtors`.getConstructor<[]>(\"instance\"));\n ValueConstructor vc = mcvc(Bug6902());\n assert (vc.get() is Bug6902.MemberWithCtors);\n}"} +{"text": "\n\n\n\n\tCFBundleDevelopmentRegion\n\ten\n\tCFBundleExecutable\n\t${EXECUTABLE_NAME}\n\tCFBundleIdentifier\n\tAP.${PRODUCT_NAME:rfc1034identifier}\n\tCFBundleInfoDictionaryVersion\n\t6.0\n\tCFBundlePackageType\n\tBNDL\n\tCFBundleShortVersionString\n\t1.0\n\tCFBundleSignature\n\t????\n\tCFBundleVersion\n\t1\n\n\n"} +{"text": "/* $OpenBSD$ */\n\n/*\n * Copyright (c) 2009 Nicholas Marriott \n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER\n * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING\n * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#include \n\n#include \n#include \n#include \n\n#include \"array.h\"\n#include \"tmux.h\"\n\nstruct screen *window_choose_init(struct window_pane *);\nvoid\twindow_choose_free(struct window_pane *);\nvoid\twindow_choose_resize(struct window_pane *, u_int, u_int);\nvoid\twindow_choose_key(struct window_pane *, struct client *,\n\t struct session *, key_code, struct mouse_event *);\n\nvoid\twindow_choose_default_callback(struct window_choose_data *);\nstruct window_choose_mode_item *window_choose_get_item(struct window_pane *,\n\t key_code, struct mouse_event *);\n\nvoid\twindow_choose_fire_callback(struct window_pane *,\n\t struct window_choose_data *);\nvoid\twindow_choose_redraw_screen(struct window_pane *);\nvoid\twindow_choose_write_line(struct window_pane *,\n\t struct screen_write_ctx *, u_int);\n\nvoid\twindow_choose_scroll_up(struct window_pane *);\nvoid\twindow_choose_scroll_down(struct window_pane *);\n\nvoid\twindow_choose_collapse(struct window_pane *, struct session *, u_int);\nvoid\twindow_choose_expand(struct window_pane *, struct session *, u_int);\n\nenum window_choose_input_type {\n\tWINDOW_CHOOSE_NORMAL = -1,\n\tWINDOW_CHOOSE_GOTO_ITEM,\n};\n\nconst struct window_mode window_choose_mode = {\n\twindow_choose_init,\n\twindow_choose_free,\n\twindow_choose_resize,\n\twindow_choose_key,\n};\n\nstruct window_choose_mode_item {\n\tstruct window_choose_data\t*wcd;\n\tchar\t\t\t\t*name;\n\tint\t\t\t\t pos;\n\tint\t\t\t\t state;\n#define TREE_EXPANDED 0x1\n};\n\nstruct window_choose_mode_data {\n\tstruct screen\t screen;\n\n\tstruct mode_key_data\tmdata;\n\n\tARRAY_DECL(, struct window_choose_mode_item) list;\n\tARRAY_DECL(, struct window_choose_mode_item) old_list;\n\tint\t\t\twidth;\n\tu_int\t\t\ttop;\n\tu_int\t\t\tselected;\n\tenum window_choose_input_type input_type;\n\tconst char\t\t*input_prompt;\n\tchar\t\t\t*input_str;\n\n\tvoid \t\t\t(*callbackfn)(struct window_choose_data *);\n};\n\nvoid\twindow_choose_free1(struct window_choose_mode_data *);\nint window_choose_key_index(struct window_choose_mode_data *, u_int);\nint window_choose_index_key(struct window_choose_mode_data *, key_code);\nvoid\twindow_choose_prompt_input(enum window_choose_input_type,\n\t const char *, struct window_pane *, key_code);\nvoid\twindow_choose_reset_top(struct window_pane *, u_int);\n\nvoid\nwindow_choose_add(struct window_pane *wp, struct window_choose_data *wcd)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tstruct window_choose_mode_item\t*item;\n\tchar\t\t\t\t tmp[10];\n\n\tARRAY_EXPAND(&data->list, 1);\n\titem = &ARRAY_LAST(&data->list);\n\n\titem->name = format_expand(wcd->ft, wcd->ft_template);\n\titem->wcd = wcd;\n\titem->pos = ARRAY_LENGTH(&data->list) - 1;\n\titem->state = 0;\n\n\tdata->width = xsnprintf(tmp, sizeof tmp , \"%d\", item->pos);\n}\n\nvoid\nwindow_choose_set_current(struct window_pane *wp, u_int cur)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tstruct screen\t\t\t*s = &data->screen;\n\n\tdata->selected = cur;\n\twindow_choose_reset_top(wp, screen_size_y(s));\n}\n\nvoid\nwindow_choose_reset_top(struct window_pane *wp, u_int sy)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\n\tdata->top = 0;\n\tif (data->selected > sy - 1)\n\t\tdata->top = data->selected - (sy - 1);\n\n\twindow_choose_redraw_screen(wp);\n}\n\nvoid\nwindow_choose_ready(struct window_pane *wp, u_int cur,\n void (*callbackfn)(struct window_choose_data *))\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\n\tdata->callbackfn = callbackfn;\n\tif (data->callbackfn == NULL)\n\t\tdata->callbackfn = window_choose_default_callback;\n\n\tARRAY_CONCAT(&data->old_list, &data->list);\n\n\twindow_choose_set_current(wp, cur);\n\twindow_choose_collapse_all(wp);\n}\n\nstruct screen *\nwindow_choose_init(struct window_pane *wp)\n{\n\tstruct window_choose_mode_data\t*data;\n\tstruct screen\t\t\t*s;\n\tint\t\t\t\t keys;\n\n\twp->modedata = data = xmalloc(sizeof *data);\n\n\tdata->callbackfn = NULL;\n\tdata->input_type = WINDOW_CHOOSE_NORMAL;\n\tdata->input_str = xstrdup(\"\");\n\tdata->input_prompt = NULL;\n\n\tARRAY_INIT(&data->list);\n\tARRAY_INIT(&data->old_list);\n\tdata->top = 0;\n\n\ts = &data->screen;\n\tscreen_init(s, screen_size_x(&wp->base), screen_size_y(&wp->base), 0);\n\ts->mode &= ~MODE_CURSOR;\n\n\tkeys = options_get_number(wp->window->options, \"mode-keys\");\n\tif (keys == MODEKEY_EMACS)\n\t\tmode_key_init(&data->mdata, &mode_key_tree_emacs_choice);\n\telse\n\t\tmode_key_init(&data->mdata, &mode_key_tree_vi_choice);\n\n\treturn (s);\n}\n\nstruct window_choose_data *\nwindow_choose_data_create(int type, struct client *c, struct session *s)\n{\n\tstruct window_choose_data\t*wcd;\n\n\twcd = xmalloc(sizeof *wcd);\n\twcd->type = type;\n\n\twcd->ft = format_create(NULL, 0);\n\twcd->ft_template = NULL;\n\n\twcd->command = NULL;\n\n\twcd->wl = NULL;\n\twcd->pane_id = -1;\n\twcd->idx = -1;\n\n\twcd->tree_session = NULL;\n\n\twcd->start_client = c;\n\twcd->start_client->references++;\n\twcd->start_session = s;\n\twcd->start_session->references++;\n\n\treturn (wcd);\n}\n\nvoid\nwindow_choose_data_free(struct window_choose_data *wcd)\n{\n\tserver_client_unref(wcd->start_client);\n\tsession_unref(wcd->start_session);\n\n\tif (wcd->tree_session != NULL)\n\t\tsession_unref(wcd->tree_session);\n\n\tfree(wcd->ft_template);\n\tformat_free(wcd->ft);\n\n\tfree(wcd->command);\n\tfree(wcd);\n}\n\nvoid\nwindow_choose_data_run(struct window_choose_data *cdata)\n{\n\tstruct cmd_list\t*cmdlist;\n\tchar\t\t*cause;\n\n\t/*\n\t * The command template will have already been replaced. But if it's\n\t * NULL, bail here.\n\t */\n\tif (cdata->command == NULL)\n\t\treturn;\n\n\tif (cmd_string_parse(cdata->command, &cmdlist, NULL, 0, &cause) != 0) {\n\t\tif (cause != NULL) {\n\t\t\t*cause = toupper((u_char) *cause);\n\t\t\tstatus_message_set(cdata->start_client, \"%s\", cause);\n\t\t\tfree(cause);\n\t\t}\n\t\treturn;\n\t}\n\n\tcmdq_run(cdata->start_client->cmdq, cmdlist, NULL);\n\tcmd_list_free(cmdlist);\n}\n\nvoid\nwindow_choose_default_callback(struct window_choose_data *wcd)\n{\n\tif (wcd == NULL)\n\t\treturn;\n\tif (wcd->start_client->flags & CLIENT_DEAD)\n\t\treturn;\n\n\twindow_choose_data_run(wcd);\n}\n\nvoid\nwindow_choose_free(struct window_pane *wp)\n{\n\tif (wp->modedata != NULL)\n\t\twindow_choose_free1(wp->modedata);\n}\n\nvoid\nwindow_choose_free1(struct window_choose_mode_data *data)\n{\n\tstruct window_choose_mode_item\t*item;\n\tu_int\t\t\t\t i;\n\n\tif (data == NULL)\n\t\treturn;\n\n\tfor (i = 0; i < ARRAY_LENGTH(&data->old_list); i++) {\n\t\titem = &ARRAY_ITEM(&data->old_list, i);\n\t\twindow_choose_data_free(item->wcd);\n\t\tfree(item->name);\n\t}\n\tARRAY_FREE(&data->list);\n\tARRAY_FREE(&data->old_list);\n\tfree(data->input_str);\n\n\tscreen_free(&data->screen);\n\tfree(data);\n}\n\nvoid\nwindow_choose_resize(struct window_pane *wp, u_int sx, u_int sy)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tstruct screen\t\t\t*s = &data->screen;\n\n\twindow_choose_reset_top(wp, sy);\n\tscreen_resize(s, sx, sy, 0);\n\twindow_choose_redraw_screen(wp);\n}\n\nvoid\nwindow_choose_fire_callback(struct window_pane *wp,\n struct window_choose_data *wcd)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\n\twp->modedata = NULL;\n\twindow_pane_reset_mode(wp);\n\n\tdata->callbackfn(wcd);\n\n\twindow_choose_free1(data);\n}\n\nvoid\nwindow_choose_prompt_input(enum window_choose_input_type input_type,\n const char *prompt, struct window_pane *wp, key_code key)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tsize_t\t\t\t\t input_len;\n\n\tdata->input_type = input_type;\n\tdata->input_prompt = prompt;\n\tinput_len = strlen(data->input_str) + 2;\n\n\tdata->input_str = xrealloc(data->input_str, input_len);\n\tdata->input_str[input_len - 2] = key;\n\tdata->input_str[input_len - 1] = '\\0';\n\n\twindow_choose_redraw_screen(wp);\n}\n\nvoid\nwindow_choose_collapse(struct window_pane *wp, struct session *s, u_int pos)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tstruct window_choose_mode_item\t*item, *chosen;\n\tstruct window_choose_data\t*wcd;\n\tu_int\t\t\t\t i;\n\n\tARRAY_DECL(, struct window_choose_mode_item) list_copy;\n\tARRAY_INIT(&list_copy);\n\n\tchosen = &ARRAY_ITEM(&data->list, pos);\n\tchosen->state &= ~TREE_EXPANDED;\n\n\t/*\n\t * Trying to mangle the &data->list in-place has lots of problems, so\n\t * assign the actual result we want to render and copy the new one over\n\t * the top of it.\n\t */\n\tfor (i = 0; i < ARRAY_LENGTH(&data->list); i++) {\n\t\titem = &ARRAY_ITEM(&data->list, i);\n\t\twcd = item->wcd;\n\n\t\tif (s == wcd->tree_session) {\n\t\t\t/* We only show the session when collapsed. */\n\t\t\tif (wcd->type & TREE_SESSION) {\n\t\t\t\titem->state &= ~TREE_EXPANDED;\n\t\t\t\tARRAY_ADD(&list_copy, *item);\n\n\t\t\t\t/*\n\t\t\t\t * Update the selection to this session item so\n\t\t\t\t * we don't end up highlighting a non-existent\n\t\t\t\t * item.\n\t\t\t\t */\n\t\t\t\tdata->selected = i;\n\t\t\t}\n\t\t} else\n\t\t\tARRAY_ADD(&list_copy, ARRAY_ITEM(&data->list, i));\n\t}\n\n\tif (!ARRAY_EMPTY(&list_copy)) {\n\t\tARRAY_FREE(&data->list);\n\t\tARRAY_CONCAT(&data->list, &list_copy);\n\t\tARRAY_FREE(&list_copy);\n\t}\n}\n\nvoid\nwindow_choose_collapse_all(struct window_pane *wp)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tstruct window_choose_mode_item\t*item;\n\tstruct screen\t\t\t*scr = &data->screen;\n\tstruct session\t\t\t*s, *chosen;\n\tu_int\t\t\t\t i;\n\n\tchosen = ARRAY_ITEM(&data->list, data->selected).wcd->start_session;\n\n\tRB_FOREACH(s, sessions, &sessions)\n\t\twindow_choose_collapse(wp, s, data->selected);\n\n\t/* Reset the selection back to the starting session. */\n\tfor (i = 0; i < ARRAY_LENGTH(&data->list); i++) {\n\t\titem = &ARRAY_ITEM(&data->list, i);\n\n\t\tif (chosen != item->wcd->tree_session)\n\t\t\tcontinue;\n\n\t\tif (item->wcd->type & TREE_SESSION)\n\t\t\tdata->selected = i;\n\t}\n\twindow_choose_reset_top(wp, screen_size_y(scr));\n}\n\nvoid\nwindow_choose_expand_all(struct window_pane *wp)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tstruct window_choose_mode_item\t*item;\n\tstruct screen\t\t\t*scr = &data->screen;\n\tstruct session\t\t\t*s;\n\tu_int\t\t\t\t i;\n\n\tRB_FOREACH(s, sessions, &sessions) {\n\t\tfor (i = 0; i < ARRAY_LENGTH(&data->list); i++) {\n\t\t\titem = &ARRAY_ITEM(&data->list, i);\n\n\t\t\tif (s != item->wcd->tree_session)\n\t\t\t\tcontinue;\n\n\t\t\tif (item->wcd->type & TREE_SESSION)\n\t\t\t\twindow_choose_expand(wp, s, i);\n\t\t}\n\t}\n\n\twindow_choose_reset_top(wp, screen_size_y(scr));\n}\n\nvoid\nwindow_choose_expand(struct window_pane *wp, struct session *s, u_int pos)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tstruct window_choose_mode_item\t*item, *chosen;\n\tstruct window_choose_data\t*wcd;\n\tu_int\t\t\t\t i, items;\n\n\tchosen = &ARRAY_ITEM(&data->list, pos);\n\titems = ARRAY_LENGTH(&data->old_list) - 1;\n\n\t/* It's not possible to expand anything other than sessions. */\n\tif (!(chosen->wcd->type & TREE_SESSION))\n\t\treturn;\n\n\t/* Don't re-expand a session which is already expanded. */\n\tif (chosen->state & TREE_EXPANDED)\n\t\treturn;\n\n\t/* Mark the session entry as expanded. */\n\tchosen->state |= TREE_EXPANDED;\n\n\t/*\n\t * Go back through the original list of all sessions and windows, and\n\t * pull out the windows where the session matches the selection chosen\n\t * to expand.\n\t */\n\tfor (i = items; i > 0; i--) {\n\t\titem = &ARRAY_ITEM(&data->old_list, i);\n\t\titem->state |= TREE_EXPANDED;\n\t\twcd = item->wcd;\n\n\t\tif (s == wcd->tree_session) {\n\t\t\t/*\n\t\t\t * Since the session is already displayed, we only care\n\t\t\t * to add back in window for it.\n\t\t\t */\n\t\t\tif (wcd->type & TREE_WINDOW) {\n\t\t\t\t/*\n\t\t\t\t * If the insertion point for adding the\n\t\t\t\t * windows to the session falls inside the\n\t\t\t\t * range of the list, then we insert these\n\t\t\t\t * entries in order *AFTER* the selected\n\t\t\t\t * session.\n\t\t\t\t */\n\t\t\t\tif (pos < i ) {\n\t\t\t\t\tARRAY_INSERT(&data->list,\n\t\t\t\t\t pos + 1,\n\t\t\t\t\t ARRAY_ITEM(&data->old_list,\n\t\t\t\t\t i));\n\t\t\t\t} else {\n\t\t\t\t\t/* Ran out of room, add to the end. */\n\t\t\t\t\tARRAY_ADD(&data->list,\n\t\t\t\t\t ARRAY_ITEM(&data->old_list,\n\t\t\t\t\t i));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nstruct window_choose_mode_item *\nwindow_choose_get_item(struct window_pane *wp, key_code key,\n struct mouse_event *m)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tu_int\t\t\t\t x, y, idx;\n\n\tif (!KEYC_IS_MOUSE(key))\n\t\treturn (&ARRAY_ITEM(&data->list, data->selected));\n\n\tif (cmd_mouse_at(wp, m, &x, &y, 0) != 0)\n\t\treturn (NULL);\n\n\tidx = data->top + y;\n\tif (idx >= ARRAY_LENGTH(&data->list))\n\t\treturn (NULL);\n\treturn (&ARRAY_ITEM(&data->list, idx));\n}\n\nvoid\nwindow_choose_key(struct window_pane *wp, __unused struct client *c,\n __unused struct session *sess, key_code key, struct mouse_event *m)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tstruct screen\t\t\t*s = &data->screen;\n\tstruct screen_write_ctx\t\t ctx;\n\tstruct window_choose_mode_item\t*item;\n\tsize_t\t\t\t\t input_len;\n\tu_int\t\t\t\t items, n;\n\tint\t\t\t\t idx;\n\n\titems = ARRAY_LENGTH(&data->list);\n\n\tif (data->input_type == WINDOW_CHOOSE_GOTO_ITEM) {\n\t\tswitch (mode_key_lookup(&data->mdata, key, NULL)) {\n\t\tcase MODEKEYCHOICE_CANCEL:\n\t\t\tdata->input_type = WINDOW_CHOOSE_NORMAL;\n\t\t\twindow_choose_redraw_screen(wp);\n\t\t\tbreak;\n\t\tcase MODEKEYCHOICE_CHOOSE:\n\t\t\tn = strtonum(data->input_str, 0, INT_MAX, NULL);\n\t\t\tif (n > items - 1) {\n\t\t\t\tdata->input_type = WINDOW_CHOOSE_NORMAL;\n\t\t\t\twindow_choose_redraw_screen(wp);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\titem = &ARRAY_ITEM(&data->list, n);\n\t\t\twindow_choose_fire_callback(wp, item->wcd);\n\t\t\tbreak;\n\t\tcase MODEKEYCHOICE_BACKSPACE:\n\t\t\tinput_len = strlen(data->input_str);\n\t\t\tif (input_len > 0)\n\t\t\t\tdata->input_str[input_len - 1] = '\\0';\n\t\t\twindow_choose_redraw_screen(wp);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif (key < '0' || key > '9')\n\t\t\t\tbreak;\n\t\t\twindow_choose_prompt_input(WINDOW_CHOOSE_GOTO_ITEM,\n\t\t\t \"Goto Item\", wp, key);\n\t\t\tbreak;\n\t\t}\n\t\treturn;\n\t}\n\n\tswitch (mode_key_lookup(&data->mdata, key, NULL)) {\n\tcase MODEKEYCHOICE_CANCEL:\n\t\twindow_choose_fire_callback(wp, NULL);\n\t\tbreak;\n\tcase MODEKEYCHOICE_CHOOSE:\n\t\tif ((item = window_choose_get_item(wp, key, m)) == NULL)\n\t\t\tbreak;\n\t\twindow_choose_fire_callback(wp, item->wcd);\n\t\tbreak;\n\tcase MODEKEYCHOICE_TREE_TOGGLE:\n\t\tif ((item = window_choose_get_item(wp, key, m)) == NULL)\n\t\t\tbreak;\n\t\tif (item->state & TREE_EXPANDED) {\n\t\t\twindow_choose_collapse(wp, item->wcd->tree_session,\n\t\t\t data->selected);\n\t\t} else {\n\t\t\twindow_choose_expand(wp, item->wcd->tree_session,\n\t\t\t data->selected);\n\t\t}\n\t\twindow_choose_redraw_screen(wp);\n\t\tbreak;\n\tcase MODEKEYCHOICE_TREE_COLLAPSE:\n\t\tif ((item = window_choose_get_item(wp, key, m)) == NULL)\n\t\t\tbreak;\n\t\tif (item->state & TREE_EXPANDED) {\n\t\t\twindow_choose_collapse(wp, item->wcd->tree_session,\n\t\t\t data->selected);\n\t\t\twindow_choose_redraw_screen(wp);\n\t\t}\n\t\tbreak;\n\tcase MODEKEYCHOICE_TREE_COLLAPSE_ALL:\n\t\twindow_choose_collapse_all(wp);\n\t\tbreak;\n\tcase MODEKEYCHOICE_TREE_EXPAND:\n\t\tif ((item = window_choose_get_item(wp, key, m)) == NULL)\n\t\t\tbreak;\n\t\tif (!(item->state & TREE_EXPANDED)) {\n\t\t\twindow_choose_expand(wp, item->wcd->tree_session,\n\t\t\t data->selected);\n\t\t\twindow_choose_redraw_screen(wp);\n\t\t}\n\t\tbreak;\n\tcase MODEKEYCHOICE_TREE_EXPAND_ALL:\n\t\twindow_choose_expand_all(wp);\n\t\tbreak;\n\tcase MODEKEYCHOICE_UP:\n\t\tif (items == 0)\n\t\t\tbreak;\n\t\tif (data->selected == 0) {\n\t\t\tdata->selected = items - 1;\n\t\t\tif (data->selected > screen_size_y(s) - 1)\n\t\t\t\tdata->top = items - screen_size_y(s);\n\t\t\twindow_choose_redraw_screen(wp);\n\t\t\tbreak;\n\t\t}\n\t\tdata->selected--;\n\t\tif (data->selected < data->top)\n\t\t\twindow_choose_scroll_up(wp);\n\t\telse {\n\t\t\tscreen_write_start(&ctx, wp, NULL);\n\t\t\twindow_choose_write_line(wp, &ctx,\n\t\t\t data->selected - data->top);\n\t\t\twindow_choose_write_line(wp, &ctx,\n\t\t\t data->selected + 1 - data->top);\n\t\t\tscreen_write_stop(&ctx);\n\t\t}\n\t\tbreak;\n\tcase MODEKEYCHOICE_DOWN:\n\t\tif (items == 0)\n\t\t\tbreak;\n\t\tif (data->selected == items - 1) {\n\t\t\tdata->selected = 0;\n\t\t\tdata->top = 0;\n\t\t\twindow_choose_redraw_screen(wp);\n\t\t\tbreak;\n\t\t}\n\t\tdata->selected++;\n\n\t\tif (data->selected < data->top + screen_size_y(s)) {\n\t\t\tscreen_write_start(&ctx, wp, NULL);\n\t\t\twindow_choose_write_line(wp, &ctx,\n\t\t\t data->selected - data->top);\n\t\t\twindow_choose_write_line(wp, &ctx,\n\t\t\t data->selected - 1 - data->top);\n\t\t\tscreen_write_stop(&ctx);\n\t\t} else\n\t\t\twindow_choose_scroll_down(wp);\n\t\tbreak;\n\tcase MODEKEYCHOICE_SCROLLUP:\n\t\tif (items == 0 || data->top == 0)\n\t\t\tbreak;\n\t\tif (data->selected == data->top + screen_size_y(s) - 1) {\n\t\t\tdata->selected--;\n\t\t\twindow_choose_scroll_up(wp);\n\t\t\tscreen_write_start(&ctx, wp, NULL);\n\t\t\twindow_choose_write_line(wp, &ctx,\n\t\t\t screen_size_y(s) - 1);\n\t\t\tscreen_write_stop(&ctx);\n\t\t} else\n\t\t\twindow_choose_scroll_up(wp);\n\t\tbreak;\n\tcase MODEKEYCHOICE_SCROLLDOWN:\n\t\tif (items == 0 ||\n\t\t data->top + screen_size_y(&data->screen) >= items)\n\t\t\tbreak;\n\t\tif (data->selected == data->top) {\n\t\t\tdata->selected++;\n\t\t\twindow_choose_scroll_down(wp);\n\t\t\tscreen_write_start(&ctx, wp, NULL);\n\t\t\twindow_choose_write_line(wp, &ctx, 0);\n\t\t\tscreen_write_stop(&ctx);\n\t\t} else\n\t\t\twindow_choose_scroll_down(wp);\n\t\tbreak;\n\tcase MODEKEYCHOICE_PAGEUP:\n\t\tif (data->selected < screen_size_y(s)) {\n\t\t\tdata->selected = 0;\n\t\t\tdata->top = 0;\n\t\t} else {\n\t\t\tdata->selected -= screen_size_y(s);\n\t\t\tif (data->top < screen_size_y(s))\n\t\t\t\tdata->top = 0;\n\t\t\telse\n\t\t\t\tdata->top -= screen_size_y(s);\n\t\t}\n\t\twindow_choose_redraw_screen(wp);\n\t\tbreak;\n\tcase MODEKEYCHOICE_PAGEDOWN:\n\t\tdata->selected += screen_size_y(s);\n\t\tif (data->selected > items - 1)\n\t\t\tdata->selected = items - 1;\n\t\tdata->top += screen_size_y(s);\n\t\tif (screen_size_y(s) < items) {\n\t\t\tif (data->top + screen_size_y(s) > items)\n\t\t\t\tdata->top = items - screen_size_y(s);\n\t\t} else\n\t\t\tdata->top = 0;\n\t\tif (data->selected < data->top)\n\t\t\tdata->top = data->selected;\n\t\twindow_choose_redraw_screen(wp);\n\t\tbreak;\n\tcase MODEKEYCHOICE_BACKSPACE:\n\t\tinput_len = strlen(data->input_str);\n\t\tif (input_len > 0)\n\t\t\tdata->input_str[input_len - 1] = '\\0';\n\t\twindow_choose_redraw_screen(wp);\n\t\tbreak;\n\tcase MODEKEYCHOICE_STARTNUMBERPREFIX:\n\t\tkey &= KEYC_MASK_KEY;\n\t\tif (key < '0' || key > '9')\n\t\t\tbreak;\n\t\twindow_choose_prompt_input(WINDOW_CHOOSE_GOTO_ITEM,\n\t\t \"Goto Item\", wp, key);\n\t\tbreak;\n\tcase MODEKEYCHOICE_STARTOFLIST:\n\t\tdata->selected = 0;\n\t\tdata->top = 0;\n\t\twindow_choose_redraw_screen(wp);\n\t\tbreak;\n\tcase MODEKEYCHOICE_TOPLINE:\n\t\tdata->selected = data->top;\n\t\twindow_choose_redraw_screen(wp);\n\t\tbreak;\n\tcase MODEKEYCHOICE_BOTTOMLINE:\n\t\tdata->selected = data->top + screen_size_y(s) - 1;\n\t\tif (data->selected > items - 1)\n\t\t\tdata->selected = items - 1;\n\t\twindow_choose_redraw_screen(wp);\n\t\tbreak;\n\tcase MODEKEYCHOICE_ENDOFLIST:\n\t\tdata->selected = items - 1;\n\t\tif (screen_size_y(s) < items)\n\t\t\tdata->top = items - screen_size_y(s);\n\t\telse\n\t\t\tdata->top = 0;\n\t\twindow_choose_redraw_screen(wp);\n\t\tbreak;\n\tdefault:\n\t\tidx = window_choose_index_key(data, key);\n\t\tif (idx < 0 || (u_int) idx >= ARRAY_LENGTH(&data->list))\n\t\t\tbreak;\n\t\tdata->selected = idx;\n\n\t\titem = &ARRAY_ITEM(&data->list, data->selected);\n\t\twindow_choose_fire_callback(wp, item->wcd);\n\t\tbreak;\n\t}\n}\n\nvoid\nwindow_choose_write_line(struct window_pane *wp, struct screen_write_ctx *ctx,\n u_int py)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tstruct window_choose_mode_item\t*item;\n\tstruct options\t\t\t*oo = wp->window->options;\n\tstruct screen\t\t\t*s = &data->screen;\n\tstruct grid_cell\t\t gc;\n\tsize_t\t\t\t\t last, xoff = 0;\n\tchar\t\t\t\t hdr[32], label[32];\n\tint\t\t\t\t key;\n\n\tif (data->callbackfn == NULL)\n\t\tfatalx(\"called before callback assigned\");\n\n\tlast = screen_size_y(s) - 1;\n\tmemcpy(&gc, &grid_default_cell, sizeof gc);\n\tif (data->selected == data->top + py)\n\t\tstyle_apply(&gc, oo, \"mode-style\");\n\n\tscreen_write_cursormove(ctx, 0, py);\n\tif (data->top + py < ARRAY_LENGTH(&data->list)) {\n\t\titem = &ARRAY_ITEM(&data->list, data->top + py);\n\t\tif (item->wcd->wl != NULL &&\n\t\t item->wcd->wl->flags & WINLINK_ALERTFLAGS)\n\t\t\tgc.attr |= GRID_ATTR_BRIGHT;\n\n\t\tkey = window_choose_key_index(data, data->top + py);\n\t\tif (key != -1)\n\t\t\txsnprintf(label, sizeof label, \"(%c)\", key);\n\t\telse\n\t\t\txsnprintf(label, sizeof label, \"(%d)\", item->pos);\n\t\tscreen_write_nputs(ctx, screen_size_x(s) - 1, &gc,\n\t\t \"%*s %s %s\", data->width + 2, label,\n\t\t /*\n\t\t * Add indication to tree if necessary about whether it's\n\t\t * expanded or not.\n\t\t */\n\t\t (item->wcd->type & TREE_SESSION) ?\n\t\t (item->state & TREE_EXPANDED ? \"-\" : \"+\") : \"\", item->name);\n\t}\n\twhile (s->cx < screen_size_x(s) - 1)\n\t\tscreen_write_putc(ctx, &gc, ' ');\n\n\tif (data->input_type != WINDOW_CHOOSE_NORMAL) {\n\t\tstyle_apply(&gc, oo, \"mode-style\");\n\n\t\txoff = xsnprintf(hdr, sizeof hdr,\n\t\t\t\"%s: %s\", data->input_prompt, data->input_str);\n\t\tscreen_write_cursormove(ctx, 0, last);\n\t\tscreen_write_puts(ctx, &gc, \"%s\", hdr);\n\t\tscreen_write_cursormove(ctx, xoff, py);\n\t\tmemcpy(&gc, &grid_default_cell, sizeof gc);\n\t}\n\n}\n\nint\nwindow_choose_key_index(struct window_choose_mode_data *data, u_int idx)\n{\n\tstatic const char\tkeys[] = \"0123456789\"\n\t \"abcdefghijklmnopqrstuvwxyz\"\n\t \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\tconst char\t *ptr;\n\tint\t\t\tmkey;\n\n\tfor (ptr = keys; *ptr != '\\0'; ptr++) {\n\t\tmkey = mode_key_lookup(&data->mdata, *ptr, NULL);\n\t\tif (mkey != MODEKEY_NONE && mkey != MODEKEY_OTHER)\n\t\t\tcontinue;\n\t\tif (idx-- == 0)\n\t\t\treturn (*ptr);\n\t}\n\treturn (-1);\n}\n\nint\nwindow_choose_index_key(struct window_choose_mode_data *data, key_code key)\n{\n\tstatic const char\tkeys[] = \"0123456789\"\n\t \"abcdefghijklmnopqrstuvwxyz\"\n\t \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\tconst char\t *ptr;\n\tint\t\t\tmkey;\n\tu_int\t\t\tidx = 0;\n\n\tfor (ptr = keys; *ptr != '\\0'; ptr++) {\n\t\tmkey = mode_key_lookup(&data->mdata, *ptr, NULL);\n\t\tif (mkey != MODEKEY_NONE && mkey != MODEKEY_OTHER)\n\t\t\tcontinue;\n\t\tif (key == (key_code)*ptr)\n\t\t\treturn (idx);\n\t\tidx++;\n\t}\n\treturn (-1);\n}\n\nvoid\nwindow_choose_redraw_screen(struct window_pane *wp)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tstruct screen\t\t\t*s = &data->screen;\n\tstruct screen_write_ctx\t \t ctx;\n\tu_int\t\t\t\t i;\n\n\tscreen_write_start(&ctx, wp, NULL);\n\tfor (i = 0; i < screen_size_y(s); i++)\n\t\twindow_choose_write_line(wp, &ctx, i);\n\tscreen_write_stop(&ctx);\n}\n\nvoid\nwindow_choose_scroll_up(struct window_pane *wp)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tstruct screen_write_ctx\t\t ctx;\n\n\tif (data->top == 0)\n\t\treturn;\n\tdata->top--;\n\n\tscreen_write_start(&ctx, wp, NULL);\n\tscreen_write_cursormove(&ctx, 0, 0);\n\tscreen_write_insertline(&ctx, 1);\n\twindow_choose_write_line(wp, &ctx, 0);\n\tif (screen_size_y(&data->screen) > 1)\n\t\twindow_choose_write_line(wp, &ctx, 1);\n\tscreen_write_stop(&ctx);\n}\n\nvoid\nwindow_choose_scroll_down(struct window_pane *wp)\n{\n\tstruct window_choose_mode_data\t*data = wp->modedata;\n\tstruct screen\t\t\t*s = &data->screen;\n\tstruct screen_write_ctx\t\t ctx;\n\n\tif (data->top >= ARRAY_LENGTH(&data->list))\n\t\treturn;\n\tdata->top++;\n\n\tscreen_write_start(&ctx, wp, NULL);\n\tscreen_write_cursormove(&ctx, 0, 0);\n\tscreen_write_deleteline(&ctx, 1);\n\twindow_choose_write_line(wp, &ctx, screen_size_y(s) - 1);\n\tif (screen_size_y(&data->screen) > 1)\n\t\twindow_choose_write_line(wp, &ctx, screen_size_y(s) - 2);\n\tscreen_write_stop(&ctx);\n}\n\nstruct window_choose_data *\nwindow_choose_add_session(struct window_pane *wp, struct client *c,\n struct session *s, const char *template, const char *action, u_int idx)\n{\n\tstruct window_choose_data\t*wcd;\n\n\twcd = window_choose_data_create(TREE_SESSION, c, c->session);\n\twcd->idx = s->id;\n\n\twcd->tree_session = s;\n\twcd->tree_session->references++;\n\n\twcd->ft_template = xstrdup(template);\n\tformat_add(wcd->ft, \"line\", \"%u\", idx);\n\tformat_defaults(wcd->ft, NULL, s, NULL, NULL);\n\n\twcd->command = cmd_template_replace(action, s->name, 1);\n\n\twindow_choose_add(wp, wcd);\n\n\treturn (wcd);\n}\n\nstruct window_choose_data *\nwindow_choose_add_window(struct window_pane *wp, struct client *c,\n struct session *s, struct winlink *wl, const char *template,\n const char *action, u_int idx)\n{\n\tstruct window_choose_data\t*wcd;\n\tchar\t\t\t\t*expanded;\n\n\twcd = window_choose_data_create(TREE_WINDOW, c, c->session);\n\twcd->idx = wl->idx;\n\n\twcd->wl = wl;\n\n\twcd->tree_session = s;\n\twcd->tree_session->references++;\n\n\twcd->ft_template = xstrdup(template);\n\tformat_add(wcd->ft, \"line\", \"%u\", idx);\n\tformat_defaults(wcd->ft, NULL, s, wl, NULL);\n\n\txasprintf(&expanded, \"%s:%d\", s->name, wl->idx);\n\twcd->command = cmd_template_replace(action, expanded, 1);\n\tfree(expanded);\n\n\twindow_choose_add(wp, wcd);\n\n\treturn (wcd);\n}\n"} +{"text": "const AWS_APP_SYNC_ENDPOINT = \"YOUR ENDPOINT\"; // like https://xxx.appsync-api.eu-central-1.amazonaws.com/graphql\nconst AWS_APP_SYNC_KEY = \"YOUR API KEY\";"} +{"text": "// Libraries\nimport React, {FC} from 'react'\n\n// Types\nimport {StatusRow, NotificationRow} from 'src/types'\n\ninterface Props {\n row: StatusRow | NotificationRow\n}\n\nconst LevelTableField: FC = ({row: {level}}) => {\n return (\n \n {level}\n \n )\n}\n\nexport default LevelTableField\n"} +{"text": "/*\n * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.\n * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n *\n * This code is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License version 2 only, as\n * published by the Free Software Foundation. Oracle designates this\n * particular file as subject to the \"Classpath\" exception as provided\n * by Oracle in the LICENSE file that accompanied this code.\n *\n * This code is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n * version 2 for more details (a copy is included in the LICENSE file that\n * accompanied this code).\n *\n * You should have received a copy of the GNU General Public License version\n * 2 along with this work; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n *\n * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n * or visit www.oracle.com if you need additional information or have any\n * questions.\n */\npackage sun.applet.resources;\n\nimport java.util.ListResourceBundle;\n\npublic class MsgAppletViewer_es extends ListResourceBundle {\n\n public Object[][] getContents() {\n Object[][] temp = new Object[][] {\n {\"textframe.button.dismiss\", \"Descartar\"},\n {\"appletviewer.tool.title\", \"Visor de Applet: {0}\"},\n {\"appletviewer.menu.applet\", \"Applet\"},\n {\"appletviewer.menuitem.restart\", \"Reiniciar\"},\n {\"appletviewer.menuitem.reload\", \"Volver a Cargar\"},\n {\"appletviewer.menuitem.stop\", \"Parar\"},\n {\"appletviewer.menuitem.save\", \"Guardar...\"},\n {\"appletviewer.menuitem.start\", \"Iniciar\"},\n {\"appletviewer.menuitem.clone\", \"Clonar...\"},\n {\"appletviewer.menuitem.tag\", \"Etiqueta...\"},\n {\"appletviewer.menuitem.info\", \"Informaci\\u00F3n...\"},\n {\"appletviewer.menuitem.edit\", \"Editar\"},\n {\"appletviewer.menuitem.encoding\", \"Codificaci\\u00F3n de Caracteres\"},\n {\"appletviewer.menuitem.print\", \"Imprimir...\"},\n {\"appletviewer.menuitem.props\", \"Propiedades...\"},\n {\"appletviewer.menuitem.close\", \"Cerrar\"},\n {\"appletviewer.menuitem.quit\", \"Salir\"},\n {\"appletviewer.label.hello\", \"Hola...\"},\n {\"appletviewer.status.start\", \"iniciando applet...\"},\n {\"appletviewer.appletsave.filedialogtitle\",\"Serializar Applet en Archivo\"},\n {\"appletviewer.appletsave.err1\", \"serializando {0} en {1}\"},\n {\"appletviewer.appletsave.err2\", \"en appletSave: {0}\"},\n {\"appletviewer.applettag\", \"Etiqueta Mostrada\"},\n {\"appletviewer.applettag.textframe\", \"Etiqueta HTML de Applet\"},\n {\"appletviewer.appletinfo.applet\", \"-- ninguna informaci\\u00F3n de applet --\"},\n {\"appletviewer.appletinfo.param\", \"-- ninguna informaci\\u00F3n de par\\u00E1metros --\"},\n {\"appletviewer.appletinfo.textframe\", \"Informaci\\u00F3n del Applet\"},\n {\"appletviewer.appletprint.fail\", \"Fallo de impresi\\u00F3n.\"},\n {\"appletviewer.appletprint.finish\", \"Impresi\\u00F3n terminada.\"},\n {\"appletviewer.appletprint.cancel\", \"Impresi\\u00F3n cancelada.\"},\n {\"appletviewer.appletencoding\", \"Codificaci\\u00F3n de Caracteres: {0}\"},\n {\"appletviewer.parse.warning.requiresname\", \"Advertencia: la etiqueta requiere un atributo name.\"},\n {\"appletviewer.parse.warning.paramoutside\", \"Advertencia: la etiqueta est\\u00E1 fuera de ... .\"},\n {\"appletviewer.parse.warning.applet.requirescode\", \"Advertencia: la etiqueta requiere el atributo code.\"},\n {\"appletviewer.parse.warning.applet.requiresheight\", \"Advertencia: la etiqueta requiere el atributo height.\"},\n {\"appletviewer.parse.warning.applet.requireswidth\", \"Advertencia: la etiqueta requiere el atributo width.\"},\n {\"appletviewer.parse.warning.object.requirescode\", \"Advertencia: la etiqueta requiere el atributo code.\"},\n {\"appletviewer.parse.warning.object.requiresheight\", \"Advertencia: la etiqueta requiere el atributo height.\"},\n {\"appletviewer.parse.warning.object.requireswidth\", \"Advertencia: la etiqueta requiere el atributo width.\"},\n {\"appletviewer.parse.warning.embed.requirescode\", \"Advertencia: la etiqueta requiere el atributo code.\"},\n {\"appletviewer.parse.warning.embed.requiresheight\", \"Advertencia: la etiqueta requiere el atributo height.\"},\n {\"appletviewer.parse.warning.embed.requireswidth\", \"Advertencia: la etiqueta requiere el atributo width.\"},\n {\"appletviewer.parse.warning.appnotLongersupported\", \"Advertencia: la etiqueta ya no est\\u00E1 soportada, utilice en su lugar:\"},\n {\"appletviewer.usage\", \"Sintaxis: appletviewer url(s)\\n\\ndonde incluye:\\n -debug Iniciar el visor de applet en el depurador Java\\n -encoding Especificar la codificaci\\u00F3n de caracteres utilizada por los archivos HTML\\n -J Transferir argumento al int\\u00E9rprete de Java\\n\\nLa opci\\u00F3n -J es no est\\u00E1ndar y est\\u00E1 sujeta a cambios sin previo aviso.\"},\n {\"appletviewer.main.err.unsupportedopt\", \"Opci\\u00F3n no soportada: {0}\"},\n {\"appletviewer.main.err.unrecognizedarg\", \"Argumento no reconocido: {0}\"},\n {\"appletviewer.main.err.dupoption\", \"Uso duplicado de la opci\\u00F3n: {0}\"},\n {\"appletviewer.main.err.inputfile\", \"No se ha especificado ning\\u00FAn archivo de entrada.\"},\n {\"appletviewer.main.err.badurl\", \"URL Err\\u00F3nea: {0} ( {1} )\"},\n {\"appletviewer.main.err.io\", \"Excepci\\u00F3n de E/S durante la lectura: {0}\"},\n {\"appletviewer.main.err.readablefile\", \"Aseg\\u00FArese de que {0} es un archivo y que se puede leer.\"},\n {\"appletviewer.main.err.correcturl\", \"\\u00BFEs {0} la URL correcta?\"},\n {\"appletviewer.main.prop.store\", \"Propiedades Espec\\u00EDficas del Usuario para AppletViewer\"},\n {\"appletviewer.main.err.prop.cantread\", \"No se puede leer el archivo de propiedades del usuario: {0}\"},\n {\"appletviewer.main.err.prop.cantsave\", \"No se puede guardar el archivo de propiedades del usuario: {0}\"},\n {\"appletviewer.main.warn.nosecmgr\", \"Advertencia: desactivando seguridad.\"},\n {\"appletviewer.main.debug.cantfinddebug\", \"No se ha encontrado el depurador.\"},\n {\"appletviewer.main.debug.cantfindmain\", \"No se ha encontrado el m\\u00E9todo principal en el depurador.\"},\n {\"appletviewer.main.debug.exceptionindebug\", \"Excepci\\u00F3n en el depurador.\"},\n {\"appletviewer.main.debug.cantaccess\", \"No se puede acceder al depurador.\"},\n {\"appletviewer.main.nosecmgr\", \"Advertencia: no se ha instalado SecurityManager.\"},\n {\"appletviewer.main.warning\", \"Advertencia: no se ha iniciado ning\\u00FAn applet. Aseg\\u00FArese de que la entrada contiene una etiqueta .\"},\n {\"appletviewer.main.warn.prop.overwrite\", \"Advertencia: se sobrescribir\\u00E1 temporalmente la propiedad del sistema cuando lo solicite el usuario: clave: {0} valor anterior: {1} nuevo valor: {2}\"},\n {\"appletviewer.main.warn.cantreadprops\", \"Advertencia: no se puede leer el archivo de propiedades de AppletViewer: {0}. Utilizando valores por defecto.\"},\n {\"appletioexception.loadclass.throw.interrupted\", \"carga de clase interrumpida: {0}\"},\n {\"appletioexception.loadclass.throw.notloaded\", \"clase no cargada: {0}\"},\n {\"appletclassloader.loadcode.verbose\", \"Abriendo flujo a: {0} para obtener {1}\"},\n {\"appletclassloader.filenotfound\", \"No se ha encontrado el archivo al buscar: {0}\"},\n {\"appletclassloader.fileformat\", \"Excepci\\u00F3n de formato de archivo al cargar: {0}\"},\n {\"appletclassloader.fileioexception\", \"Excepci\\u00F3n de E/S al cargar: {0}\"},\n {\"appletclassloader.fileexception\", \"Excepci\\u00F3n de {0} al cargar: {1}\"},\n {\"appletclassloader.filedeath\", \"{0} interrumpido al cargar: {1}\"},\n {\"appletclassloader.fileerror\", \"error de {0} al cargar: {1}\"},\n {\"appletclassloader.findclass.verbose.openstream\", \"Abriendo flujo a: {0} para obtener {1}\"},\n {\"appletclassloader.getresource.verbose.forname\", \"AppletClassLoader.getResource para nombre: {0}\"},\n {\"appletclassloader.getresource.verbose.found\", \"Recurso encontrado: {0} como un recurso de sistema\"},\n {\"appletclassloader.getresourceasstream.verbose\", \"Recurso encontrado: {0} como un recurso de sistema\"},\n {\"appletpanel.runloader.err\", \"Par\\u00E1metro de c\\u00F3digo u objeto.\"},\n {\"appletpanel.runloader.exception\", \"excepci\\u00F3n al deserializar {0}\"},\n {\"appletpanel.destroyed\", \"Applet destruido.\"},\n {\"appletpanel.loaded\", \"Applet cargado.\"},\n {\"appletpanel.started\", \"Applet iniciado.\"},\n {\"appletpanel.inited\", \"Applet inicializado.\"},\n {\"appletpanel.stopped\", \"Applet parado.\"},\n {\"appletpanel.disposed\", \"Applet desechado.\"},\n {\"appletpanel.nocode\", \"Falta el par\\u00E1metro CODE en la etiqueta APPLET.\"},\n {\"appletpanel.notfound\", \"cargar: clase {0} no encontrada.\"},\n {\"appletpanel.nocreate\", \"cargar: {0} no se puede instanciar.\"},\n {\"appletpanel.noconstruct\", \"cargar: {0} no es p\\u00FAblico o no tiene un constructor p\\u00FAblico.\"},\n {\"appletpanel.death\", \"interrumpido\"},\n {\"appletpanel.exception\", \"excepci\\u00F3n: {0}.\"},\n {\"appletpanel.exception2\", \"excepci\\u00F3n: {0}: {1}.\"},\n {\"appletpanel.error\", \"error: {0}.\"},\n {\"appletpanel.error2\", \"error: {0}: {1}.\"},\n {\"appletpanel.notloaded\", \"Iniciaci\\u00F3n: applet no cargado.\"},\n {\"appletpanel.notinited\", \"Iniciar: applet no inicializado.\"},\n {\"appletpanel.notstarted\", \"Parar: applet no iniciado.\"},\n {\"appletpanel.notstopped\", \"Destruir: applet no parado.\"},\n {\"appletpanel.notdestroyed\", \"Desechar: applet no destruido.\"},\n {\"appletpanel.notdisposed\", \"Cargar: applet no desechado.\"},\n {\"appletpanel.bail\", \"Interrumpido: rescatando.\"},\n {\"appletpanel.filenotfound\", \"No se ha encontrado el archivo al buscar: {0}\"},\n {\"appletpanel.fileformat\", \"Excepci\\u00F3n de formato de archivo al cargar: {0}\"},\n {\"appletpanel.fileioexception\", \"Excepci\\u00F3n de E/S al cargar: {0}\"},\n {\"appletpanel.fileexception\", \"Excepci\\u00F3n de {0} al cargar: {1}\"},\n {\"appletpanel.filedeath\", \"{0} interrumpido al cargar: {1}\"},\n {\"appletpanel.fileerror\", \"error de {0} al cargar: {1}\"},\n {\"appletpanel.badattribute.exception\", \"An\\u00E1lisis HTML: valor incorrecto para el atributo width/height.\"},\n {\"appletillegalargumentexception.objectinputstream\", \"AppletObjectInputStream requiere un cargador no nulo\"},\n {\"appletprops.title\", \"Propiedades de AppletViewer\"},\n {\"appletprops.label.http.server\", \"Servidor Proxy HTTP:\"},\n {\"appletprops.label.http.proxy\", \"Puerto Proxy HTTP:\"},\n {\"appletprops.label.network\", \"Acceso de Red:\"},\n {\"appletprops.choice.network.item.none\", \"Ninguno\"},\n {\"appletprops.choice.network.item.applethost\", \"Host del Applet\"},\n {\"appletprops.choice.network.item.unrestricted\", \"No Restringido\"},\n {\"appletprops.label.class\", \"Acceso de Clase:\"},\n {\"appletprops.choice.class.item.restricted\", \"Restringido\"},\n {\"appletprops.choice.class.item.unrestricted\", \"No Restringido\"},\n {\"appletprops.label.unsignedapplet\", \"Permitir Applets no Firmados:\"},\n {\"appletprops.choice.unsignedapplet.no\", \"No\"},\n {\"appletprops.choice.unsignedapplet.yes\", \"S\\u00ED\"},\n {\"appletprops.button.apply\", \"Aplicar\"},\n {\"appletprops.button.cancel\", \"Cancelar\"},\n {\"appletprops.button.reset\", \"Restablecer\"},\n {\"appletprops.apply.exception\", \"Fallo al guardar las propiedades: {0}\"},\n /* 4066432 */\n {\"appletprops.title.invalidproxy\", \"Entrada no V\\u00E1lida\"},\n {\"appletprops.label.invalidproxy\", \"El puerto proxy debe ser un valor entero positivo.\"},\n {\"appletprops.button.ok\", \"Aceptar\"},\n /* end 4066432 */\n {\"appletprops.prop.store\", \"Propiedades espec\\u00EDficas del usuario para AppletViewer\"},\n {\"appletsecurityexception.checkcreateclassloader\", \"Excepci\\u00F3n de Seguridad: classloader\"},\n {\"appletsecurityexception.checkaccess.thread\", \"Excepci\\u00F3n de Seguridad: thread\"},\n {\"appletsecurityexception.checkaccess.threadgroup\", \"Excepci\\u00F3n de Seguridad: threadgroup: {0}\"},\n {\"appletsecurityexception.checkexit\", \"Excepci\\u00F3n de Seguridad: salir: {0}\"},\n {\"appletsecurityexception.checkexec\", \"Excepci\\u00F3n de Seguridad: ejecutar: {0}\"},\n {\"appletsecurityexception.checklink\", \"Excepci\\u00F3n de Seguridad: enlace: {0}\"},\n {\"appletsecurityexception.checkpropsaccess\", \"Excepci\\u00F3n de Seguridad: propiedades\"},\n {\"appletsecurityexception.checkpropsaccess.key\", \"Excepci\\u00F3n de Seguridad: acceso a propiedades {0}\"},\n {\"appletsecurityexception.checkread.exception1\", \"Excepci\\u00F3n de Seguridad: {0}, {1}\"},\n {\"appletsecurityexception.checkread.exception2\", \"Excepci\\u00F3n de Seguridad: file.read: {0}\"},\n {\"appletsecurityexception.checkread\", \"Excepci\\u00F3n de Seguridad: file.read: {0} == {1}\"},\n {\"appletsecurityexception.checkwrite.exception\", \"Excepci\\u00F3n de Seguridad: {0}, {1}\"},\n {\"appletsecurityexception.checkwrite\", \"Excepci\\u00F3n de Seguridad: file.write: {0} == {1}\"},\n {\"appletsecurityexception.checkread.fd\", \"Excepci\\u00F3n de Seguridad: fd.read\"},\n {\"appletsecurityexception.checkwrite.fd\", \"Excepci\\u00F3n de Seguridad: fd.write\"},\n {\"appletsecurityexception.checklisten\", \"Excepci\\u00F3n de Seguridad: socket.listen: {0}\"},\n {\"appletsecurityexception.checkaccept\", \"Excepci\\u00F3n de Seguridad: socket.accept: {0}:{1}\"},\n {\"appletsecurityexception.checkconnect.networknone\", \"Excepci\\u00F3n de Seguridad: socket.connect: {0}->{1}\"},\n {\"appletsecurityexception.checkconnect.networkhost1\", \"Excepci\\u00F3n de Seguridad: no se puede conectar a {0} con origen de {1}.\"},\n {\"appletsecurityexception.checkconnect.networkhost2\", \"Excepci\\u00F3n de Seguridad: no se puede resolver la IP para el host {0} o para {1}. \"},\n {\"appletsecurityexception.checkconnect.networkhost3\", \"Excepci\\u00F3n de Seguridad: no se puede resolver la IP para el host {0}. Consulte la propiedad trustProxy.\"},\n {\"appletsecurityexception.checkconnect\", \"Excepci\\u00F3n de Seguridad: conexi\\u00F3n: {0}->{1}\"},\n {\"appletsecurityexception.checkpackageaccess\", \"Excepci\\u00F3n de Seguridad: no se puede acceder al paquete: {0}\"},\n {\"appletsecurityexception.checkpackagedefinition\", \"Excepci\\u00F3n de Seguridad: no se puede definir el paquete: {0}\"},\n {\"appletsecurityexception.cannotsetfactory\", \"Excepci\\u00F3n de Seguridad: no se puede definir el valor de f\\u00E1brica\"},\n {\"appletsecurityexception.checkmemberaccess\", \"Excepci\\u00F3n de Seguridad: comprobar el acceso de miembro\"},\n {\"appletsecurityexception.checkgetprintjob\", \"Excepci\\u00F3n de Seguridad: getPrintJob\"},\n {\"appletsecurityexception.checksystemclipboardaccess\", \"Excepci\\u00F3n de Seguridad: getSystemClipboard\"},\n {\"appletsecurityexception.checkawteventqueueaccess\", \"Excepci\\u00F3n de Seguridad: getEventQueue\"},\n {\"appletsecurityexception.checksecurityaccess\", \"Excepci\\u00F3n de Seguridad: operaci\\u00F3n de seguridad: {0}\"},\n {\"appletsecurityexception.getsecuritycontext.unknown\", \"tipo de cargador de clase desconocido. no se puede comprobar para getContext\"},\n {\"appletsecurityexception.checkread.unknown\", \"tipo de cargador de clase desconocido. no se puede comprobar para lectura de comprobaci\\u00F3n {0}\"},\n {\"appletsecurityexception.checkconnect.unknown\", \"tipo de cargador de clase desconocido. no se puede comprobar para conexi\\u00F3n de comprobaci\\u00F3n\"},\n };\n\n return temp;\n }\n}\n"} +{"text": "$!\n$ olddir = f$environment(\"default\")\n$ on error then goto End\n$!\n$ gosub Init\n$!\n$ call WriteProductDescriptionFile\n$ call WriteProductTextFile\n$!\n$! backup tree\n$!\n$ backup [-...]*.*;0/excl=([]*.exe,*.obj,*.opt,*.hlp,*.hlb,*.bck,*.com,*.pcsi*) -\n libssh2-'versionname''datename'_src.bck/save\n$ purge libssh2-'versionname''datename'_src.bck\n$!\n$! backup examples\n$!\n$ backup [-.example]*.c;0 libssh2_examples-'versionname''datename'.bck/save\n$ dire libssh2_examples-'versionname''datename'.bck\n$ purge libssh2_examples-'versionname''datename'.bck\n$!\n$ set default [-]\n$!\n$ defdir = f$environment( \"default\" )\n$ thisdev = f$parse(defdir,,,\"device\",\"no_conceal\") \n$ thisdir = f$parse(defdir,,,\"directory\",\"no_conceal\") - \"][\" - \"][\" - \"][\" - \"][\"\n$!\n$ libssh2_kf = thisdev + thisdir \n$ libssh2_kf = libssh2_kf - \"]\" + \".]\"\n$!\n$ set default 'mdir'\n$!\n$ define/translation_attributes=concealed libssh2_kf 'libssh2_kf'\n$!\n$ product package libssh2 - \n /base='arch' - \n /producer=jcb -\n /source=[] - ! where to find PDF and PTF \n /destination=[] - ! where to put .PCSI file \n /material=libssh2_kf:[000000...] - ! where to find product material \n /version=\"''vms_majorv'.''minorv'-''patchv'''datename'\" -\n /format=sequential \n$!\n$End:\n$!\n$ set noon\n$ if f$search(\"*.pcsi$desc;*\") .nes. \"\" then delete *.pcsi$desc;*\n$ if f$search(\"*.pcsi$text;*\") .nes. \"\" then delete *.pcsi$text;*\n$ if f$search(\"libssh2-''versionname'''datename'_src.bck;*\") .nes. \"\" then delete libssh2-'versionname''datename'_src.bck;*\n$ if f$search(\"libssh2_examples-''versionname'''datename'.bck;*\") .nes. \"\" then delete libssh2_examples-'versionname''datename'.bck;*\n$!\n$ if f$trnlnm(\"libssh2_kf\") .nes. \"\" then deassign libssh2_kf\n$ set default 'olddir'\n$!\n$exit \n$!\n$!--------------------------------------------------------------------------------\n$!\n$Init:\n$ set process/parse=extended\n$!\n$ say = \"write sys$output\"\n$!\n$ mdir = f$environment(\"procedure\") \n$ mdir = mdir - f$parse(mdir,,,\"name\") - f$parse(mdir,,,\"type\") - f$parse(mdir,,,\"version\")\n$!\n$ set default 'mdir'\n$!\n$ pipe search [-.include]*.h libssh2_version_major/nohead | (read sys$input l ; l = f$element(2,\" \",f$edit(l,\"trim,compress\")) ; - \n define/job majorv &l )\n$ pipe search [-.include]*.h libssh2_version_minor/nohead | (read sys$input l ; l = f$element(2,\" \",f$edit(l,\"trim,compress\")) ; - \n define/job minorv &l )\n$ pipe search [-.include]*.h libssh2_version_patch/nohead | (read sys$input l ; l = f$element(2,\" \",f$edit(l,\"trim,compress\")) ; - \n define/job patchv &l )\n$!\n$ majorv = f$trnlnm(\"majorv\")\n$ minorv = f$integer(f$trnlnm(\"minorv\")) \n$ patchv = f$integer( f$trnlnm(\"patchv\"))\n$!\n$ deassign/job majorv\n$ deassign/job minorv\n$ deassign/job patchv\n$!\n$ vms_majorv = f$trnlnm(\"vms_majorv\")\n$ if vms_majorv .eqs. \"\" then vms_majorv = majorv\n$!\n$ arch = \"UNKNOWN\"\n$ if f$getsyi(\"arch_type\") .eq. 2 then arch = \"AXPVMS\"\n$ if f$getsyi(\"arch_type\") .eq. 3 then arch = \"I64VMS\"\n$!\n$ if arch .eqs. \"UNKNOWN\"\n$ then\n$ say \"Unsupported or unknown architecture, only works on Alpha and Itanium\"\n$ exit 2\n$ endif\n$!\n$! is this a proper release or a daily snapshot?\n$! crummy, but should work.\n$!\n$ daily = \"TRUE\"\n$ firstdash = f$locate(\"-\",mdir)\n$ restdir = f$extract( firstdash + 1, 80, mdir)\n$ seconddash = f$locate(\"-\", restdir)\n$ if seconddash .ge. f$length( restdir )\n$ then\n$ daily = \"FALSE\"\n$ datename = \"Final\"\n$ else\n$ datename = \"D\" + f$extract(seconddash+1,8,restdir) \n$ endif\n$!\n$ if daily \n$ then\n$ productname = \"JCB ''arch' LIBSSH2 V''vms_majorv'.''minorv'-''patchv'''datename'\"\n$ else\n$ productname = \"JCB ''arch' LIBSSH2 V''vms_majorv'.''minorv'-''patchv'''datename'\"\n$ endif\n$!\n$ productfilename = \"JCB-''arch'-LIBSSH2-\" + f$fao(\"V!2ZL!2ZL-!2ZL!AS-1\", f$integer(vms_majorv),minorv,patchv,datename)\n$!\n$ versionname = \"''vms_majorv'_''minorv'_''patchv'\"\n$!\n$return\n$!\n$!--------------------------------------------------------------------------------\n$!\n$WriteProductDescriptionFile: subroutine\n$!\n$ open/write pd 'productfilename'.PCSI$DESC\n$!\n$ write pd \"product ''productname' full ;\"\n$ write pd \" software DEC ''arch' VMS ;\"\n$ write pd \" if (not ) ;\n$ write pd \" error NEED_VMS83 ;\"\n$ write pd \" end if ;\"\n$ write pd \" software HP ''arch' SSL version minimum V1.3;\"\n$ write pd \" if (not ) ;\n$ write pd \" error NEED_SSL ;\"\n$ write pd \" end if ;\"\n$ write pd \" execute preconfigure (\"\"set process/parse_type=extended\"\");\"\n$ write pd \" execute postinstall (\"\"set process/parse_type=extended\"\",\"\n$ write pd \" \"\"rename pcsi$destination:[gnv]usr.dir usr.DIR\"\",\"\n$ write pd \" \"\"rename pcsi$destination:[gnv.usr]include.dir include.DIR\"\",\"\n$ write pd \" \"\"rename pcsi$destination:[gnv.usr.include]libssh2.dir libssh2.DIR\"\",\"\n$ write pd \" \"\"rename pcsi$destination:[gnv.usr.include.libssh2]libssh2.h libssh2.h\"\",\"\n$ write pd \" \"\"rename pcsi$destination:[gnv.usr.include.libssh2]libssh2_publickey.h libssh2_publickey.h\"\",\"\n$ write pd \" \"\"rename pcsi$destination:[gnv.usr.include.libssh2]libssh2_sftp.h libssh2_sftp.h\"\",\"\n$ write pd \" \"\"rename pcsi$destination:[gnv.usr.include.libssh2]libssh2_config.h libssh2_config.h\"\",\"\n$ write pd \" \"\"rename pcsi$destination:[gnv.usr]lib.dir lib.DIR\"\",\"\n$ write pd \" \"\"rename pcsi$destination:[gnv.usr.lib]gnv$libssh2_''versionname'.exe gnv$libssh2_''versionname'.exe\"\",\"\n$ write pd \" \"\"rename pcsi$destination:[gnv.usr.share.doc.libssh2]libssh2.hlb libssh2.hlb\"\");\"\n$ write pd \" information RELEASE_NOTES phase after ;\"\n$ write pd \" option EXAMPLE default 0 ;\"\n$ write pd \" directory \"\"[gnv.usr.share.doc.libssh2.examples]\"\" ;\"\n$ write pd \" file \"\"[gnv.usr.share.doc.libssh2.examples]libssh2_examples-''versionname'''datename'.bck\"\";\"\n$ write pd \" end option ;\"\n$ write pd \" option SOURCE default 0 ;\"\n$ write pd \" directory \"\"[gnv.common_src]\"\" ;\"\n$ write pd \" file \"\"[gnv.common_src]libssh2-''versionname'''datename'_src.bck\"\";\"\n$ write pd \" end option ;\"\n$ write pd \" directory \"\"[gnv]\"\" ;\"\n$ write pd \" directory \"\"[gnv.usr]\"\" ;\"\n$ write pd \" directory \"\"[gnv.usr.lib]\"\" ;\"\n$ write pd \" directory \"\"[gnv.usr.include]\"\" ;\"\n$ write pd \" directory \"\"[gnv.usr.include.libssh2]\"\" ;\"\n$ write pd \" directory \"\"[gnv.usr.share]\"\" ;\"\n$ write pd \" directory \"\"[gnv.usr.share.doc]\"\" ;\"\n$ write pd \" directory \"\"[gnv.usr.share.doc.libssh2]\"\" ;\"\n$ write pd \" file \"\"[gnv.usr.include.libssh2]libssh2.h\"\" source \"\"[include]libssh2.h\"\";\"\n$ write pd \" file \"\"[gnv.usr.include.libssh2]libssh2_publickey.h\"\" source \"\"[include]libssh2_publickey.h\"\";\"\n$ write pd \" file \"\"[gnv.usr.include.libssh2]libssh2_sftp.h\"\" source \"\"[include]libssh2_sftp.h\"\";\"\n$ write pd \" file \"\"[gnv.usr.include.libssh2]libssh2_config.h\"\" source \"\"[vms]libssh2_config.h\"\";\"\n$ write pd \" file \"\"[gnv.usr.share.doc.libssh2]libssh2.hlb\"\" source \"\"[vms]libssh2.hlb\"\";\"\n$ write pd \" file \"\"[gnv.usr.share.doc.libssh2]libssh2-''versionname'.news\"\" source \"\"[000000]NEWS.\"\";\"\n$ write pd \" file \"\"[gnv.usr.share.doc.libssh2]libssh2-''versionname'.release_notes\"\" source \"\"[vms]readme.vms\"\";\"\n$ write pd \" file \"\"[gnv.usr.lib]gnv$libssh2_''versionname'.exe\"\" source \"\"[vms]libssh2_''versionname'.exe\"\";\"\n$ write pd \"end product ;\"\n$ close pd\n$exit \n$endsubroutine\n$!\n$!--------------------------------------------------------------------------------\n$!\n$WriteProductTextFile: subroutine\n$!\n$ open/write pt 'productfilename'.PCSI$TEXT\n$ write pt \"=PRODUCT ''productname' Full\"\n$ write pt \"1 'PRODUCER\"\n$ write pt \"=prompt libssh2 is an open source product ported to VMS by Jose Baars\"\n$ write pt \"This software product is provided with no warranty.\"\n$ write pt \"For license information see the LIBSSH2 help library.\"\n$ write pt \"1 'PRODUCT\"\n$ write pt \"=prompt JCB LIBSSH2 for OpenVMS\"\n$ write pt \"\"\n$ write pt \"libssh2 is an open source client side library that aims to implement\"\n$ write pt \"the SSH protocol. This is the OpenVMS port of that library.\"\n$ write pt \"Further information at https://www.libssh2.org.\"\n$ write pt \"\"\n$ write pt \"1 NEED_VMS83\"\n$ write pt \"=prompt OpenVMS 8.3 or later is not installed on your system.\"\n$ write pt \"This product requires OpenVMS 8.3 or later to function.\"\n$ write pt \"\"\n$ write pt \"1 NEED_SSL\"\n$ write pt \"=prompt HP SSL 1.3 or later is not installed on your system.\"\n$ write pt \"This product requires HP SSL 1.3 or later to function.\"\n$ write pt \"\"\n$ write pt \"1 RELEASE_NOTES\"\n$ write pt \"=prompt Release notes and the libssh2 help library are available in [gnv.usr.share.doc.libssh2] directory.\"\n$ write pt \"\"\n$ write pt \"1 EXAMPLE\"\n$ write pt \"=prompt Do you want the libssh2 C programming examples ? \"\n$ write pt \"The libssh2 coding examples will be available in backup saveset \"\n$ write pt \"[gnv.usr.share.doc.libssh2.examples]libssh2_examples_''versionname'.bck\"\n$ write pt \"\"\n$ write pt \"1 SOURCE\"\n$ write pt \"=prompt Do you want the complete libssh2 source tree ? \"\n$ write pt \"The libssh2 source tree will be available in backup saveset \"\n$ write pt \"[gnv.common_src]libssh2_''versionname'''datename'_src.bck\"\n$close pt\n$exit\n$ endsubroutine\n\n"} +{"text": " True\n"} +{"text": "/*!\n * Copyright (c) 2016 by Contributors\n */\n#ifndef __DEEPWATER_IMAGE_PRED_H__\n#define __DEEPWATER_IMAGE_PRED_H__\n\n#include \n#include \n#include \n#include \n\n#include \"include/c_predict_api.h\"\n\nclass ImagePred {\n public:\n // channel = 3 means we have RGB value; 1 for grey-scale img\n explicit ImagePred(int w = 224, int h = 224, int c = 3);\n ~ImagePred();\n\n void setSeed(int seed);\n\n void setModelPath(char * path) {model_path_ = std::string(path);}\n\n void loadInception();\n void loadModel();\n\n // return the result with highest prob\n std::string predict(float * data);\n // return probs for each class\n std::vector predict_probs(float * data);\n\n private:\n // labels for imagenet\n std::vector synset;\n std::string model_path_;\n const mx_float * nd_data;\n\n PredictorHandle pred_hnd;\n NDListHandle nd_hnd;\n int image_size, width, height, channels;\n\n int dev_type, dev_id;\n};\n\n#endif\n"} +{"text": "listAq = new AQuery(this);\n\nArrayAdapter aa = new ArrayAdapter(this, R.layout.content_item_s, items){\n\t\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t\n\t\tViewHolder holder;\n\t\t\n\t\tif(convertView == null){\t\t\t\t\t\n\t\t\tconvertView = getLayoutInflater().inflate(R.layout.content_item_s, null);\n\t\t\tholder = new ViewHolder();\n\t\t\tholder.imageview = (ImageView) convertView.findViewById(R.id.tb);\n\t\t\tholder.progress = (ProgressBar) convertView.findViewById(R.id.progress);\n\t\t\tconvertView.setTag(holder);\n\t\t}else{\n\t\t\tholder = (ViewHolder) convertView.getTag();\n\t\t}\n\t\t\n\t\tJSONObject jo = getItem(position);\n\t\tString tb = jo.optJSONObject(\"image\").optString(\"tbUrl\");\n\t\t\n\t\tAQuery aq = listAq.recycle(convertView);\n\t\taq.id(holder.imageview).progress(holder.progress).image(tb, true, true, 0, 0, null, 0, 1.0f);\n\t\t\n\t\treturn convertView;\n\t}\n};"} +{"text": ";;; Set up the local quicklisp install if present else rely on asdf.\n(let ((quicklisp-init (merge-pathnames \"../quicklisp/setup.lisp\"\n *load-pathname*)))\n (when (probe-file quicklisp-init)\n (format *trace-output* \"Found local quicklisp install.~%\")\n (load quicklisp-init)))\n\n(require :asdf)\n\n(push (truename (merge-pathnames \"../\"\n (make-pathname :name nil :type nil\n :defaults *load-pathname*)))\n asdf:*central-registry*)\n\n(asdf:load-system :rumcajsz)\n"} +{"text": "/** @addtogroup exti_file EXTI peripheral API\n * @ingroup peripheral_apis\n *\n * @author @htmlonly © @endhtmlonly 2019 Guillaume Revaillot \n *\n * @date 10 January 2019\n *\n * LGPL License Terms @ref lgpl_license\n */\n/*\n * This file is part of the libopencm3 project.\n *\n * This library is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This 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 Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library. If not, see .\n */\n\n/**@{*/\n\n#include \n\n/* @brief Get the rising edge interrupt requestf flag of a given EXTI interrupt.\n *\n * @param[in] exti unsigned int32 Exti line.\n *\n * */\nuint32_t exti_get_rising_flag_status(uint32_t exti)\n{\n\treturn (EXTI_RPR1 & exti);\n}\n\n/* @brief Get the rising edge interrupt request flag of a given EXTI interrupt.\n *\n * @param[in] exti unsigned int32 Exti line.\n *\n * */\nuint32_t exti_get_falling_flag_status(uint32_t exti)\n{\n\treturn (EXTI_FPR1 & exti);\n}\n\n/* @brief Resets the rising edge interrupt request pending flag of a given EXTI interrupt.\n *\n * @param[in] exti unsigned int32 Exti line.\n *\n * */\nvoid exti_reset_rising_request(uint32_t extis)\n{\n\tEXTI_RPR1 = extis;\n}\n\n/* @brief Resets the falling edge interrupt request pending flag of a given EXTI interrupt.\n *\n * @param[in] exti unsigned int32 Exti line.\n *\n * */\nvoid exti_reset_falling_request(uint32_t extis)\n{\n\tEXTI_FPR1 = extis;\n}\n\n/**@}*/\n"} +{"text": "bigIncrements('id');\n\n $table->integer('start_id')->unsigned();\n $table->foreign('start_id')\n ->references('id')\n ->on('planets')\n ->onDelete('cascade');\n\n $table->integer('end_id')->unsigned();\n $table->foreign('end_id')\n ->references('id')\n ->on('planets')\n ->onDelete('cascade');\n\n $table->integer('user_id')->unsigned();\n $table->foreign('user_id')\n ->references('id')\n ->on('users')\n ->onDelete('cascade');\n\n $table->integer('type')->unsigned();\n $table->timestamp('ended_at');\n $table->timestamps();\n });\n }\n\n /**\n * Reverse the migrations.\n */\n public function down()\n {\n Schema::dropIfExists('movements');\n }\n}\n"} +{"text": "package cmd\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/fatih/color\"\n\tout \"github.com/plouc/go-gitlab-client/cli/output\"\n\t\"github.com/plouc/go-gitlab-client/gitlab\"\n\t\"github.com/spf13/cobra\"\n)\n\nfunc init() {\n\tlistCmd.AddCommand(listSshKeysCmd)\n}\n\nfunc fetchSshKeys() {\n\tcolor.Yellow(\"Fetching current user ssh keys…\")\n\n\to := &gitlab.PaginationOptions{}\n\to.Page = page\n\to.PerPage = perPage\n\n\tloader.Start()\n\tcollection, meta, err := client.CurrentUserSshKeys(o)\n\tloader.Stop()\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t\treturn\n\t}\n\n\tif len(collection.Items) == 0 {\n\t\tcolor.Red(\"No ssh key found\")\n\t} else {\n\t\tout.SshKeys(output, outputFormat, collection)\n\t}\n\n\tprintMeta(meta, true)\n\n\thandlePaginatedResult(meta, fetchSshKeys)\n}\n\nvar listSshKeysCmd = &cobra.Command{\n\tUse: \"ssh-keys\",\n\tAliases: []string{\"sk\"},\n\tShort: \"List current user ssh keys\",\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tfetchSshKeys()\n\t},\n}\n"} +{"text": "package errors\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"path\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Frame represents a program counter inside a stack frame.\n// For historical reasons if Frame is interpreted as a uintptr\n// its value represents the program counter + 1.\ntype Frame uintptr\n\n// pc returns the program counter for this frame;\n// multiple frames may have the same PC value.\nfunc (f Frame) pc() uintptr { return uintptr(f) - 1 }\n\n// file returns the full path to the file that contains the\n// function for this Frame's pc.\nfunc (f Frame) file() string {\n\tfn := runtime.FuncForPC(f.pc())\n\tif fn == nil {\n\t\treturn \"unknown\"\n\t}\n\tfile, _ := fn.FileLine(f.pc())\n\treturn file\n}\n\n// line returns the line number of source code of the\n// function for this Frame's pc.\nfunc (f Frame) line() int {\n\tfn := runtime.FuncForPC(f.pc())\n\tif fn == nil {\n\t\treturn 0\n\t}\n\t_, line := fn.FileLine(f.pc())\n\treturn line\n}\n\n// name returns the name of this function, if known.\nfunc (f Frame) name() string {\n\tfn := runtime.FuncForPC(f.pc())\n\tif fn == nil {\n\t\treturn \"unknown\"\n\t}\n\treturn fn.Name()\n}\n\n// Format formats the frame according to the fmt.Formatter interface.\n//\n// %s source file\n// %d source line\n// %n function name\n// %v equivalent to %s:%d\n//\n// Format accepts flags that alter the printing of some verbs, as follows:\n//\n// %+s function name and path of source file relative to the compile time\n// GOPATH separated by \\n\\t (\\n\\t)\n// %+v equivalent to %+s:%d\nfunc (f Frame) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\tswitch {\n\t\tcase s.Flag('+'):\n\t\t\tio.WriteString(s, f.name())\n\t\t\tio.WriteString(s, \"\\n\\t\")\n\t\t\tio.WriteString(s, f.file())\n\t\tdefault:\n\t\t\tio.WriteString(s, path.Base(f.file()))\n\t\t}\n\tcase 'd':\n\t\tio.WriteString(s, strconv.Itoa(f.line()))\n\tcase 'n':\n\t\tio.WriteString(s, funcname(f.name()))\n\tcase 'v':\n\t\tf.Format(s, 's')\n\t\tio.WriteString(s, \":\")\n\t\tf.Format(s, 'd')\n\t}\n}\n\n// MarshalText formats a stacktrace Frame as a text string. The output is the\n// same as that of fmt.Sprintf(\"%+v\", f), but without newlines or tabs.\nfunc (f Frame) MarshalText() ([]byte, error) {\n\tname := f.name()\n\tif name == \"unknown\" {\n\t\treturn []byte(name), nil\n\t}\n\treturn []byte(fmt.Sprintf(\"%s %s:%d\", name, f.file(), f.line())), nil\n}\n\n// StackTrace is stack of Frames from innermost (newest) to outermost (oldest).\ntype StackTrace []Frame\n\n// Format formats the stack of Frames according to the fmt.Formatter interface.\n//\n// %s\tlists source files for each Frame in the stack\n// %v\tlists the source file and line number for each Frame in the stack\n//\n// Format accepts flags that alter the printing of some verbs, as follows:\n//\n// %+v Prints filename, function, and line number for each Frame in the stack.\nfunc (st StackTrace) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tswitch {\n\t\tcase s.Flag('+'):\n\t\t\tfor _, f := range st {\n\t\t\t\tio.WriteString(s, \"\\n\")\n\t\t\t\tf.Format(s, verb)\n\t\t\t}\n\t\tcase s.Flag('#'):\n\t\t\tfmt.Fprintf(s, \"%#v\", []Frame(st))\n\t\tdefault:\n\t\t\tst.formatSlice(s, verb)\n\t\t}\n\tcase 's':\n\t\tst.formatSlice(s, verb)\n\t}\n}\n\n// formatSlice will format this StackTrace into the given buffer as a slice of\n// Frame, only valid when called with '%s' or '%v'.\nfunc (st StackTrace) formatSlice(s fmt.State, verb rune) {\n\tio.WriteString(s, \"[\")\n\tfor i, f := range st {\n\t\tif i > 0 {\n\t\t\tio.WriteString(s, \" \")\n\t\t}\n\t\tf.Format(s, verb)\n\t}\n\tio.WriteString(s, \"]\")\n}\n\n// stack represents a stack of program counters.\ntype stack []uintptr\n\nfunc (s *stack) Format(st fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tswitch {\n\t\tcase st.Flag('+'):\n\t\t\tfor _, pc := range *s {\n\t\t\t\tf := Frame(pc)\n\t\t\t\tfmt.Fprintf(st, \"\\n%+v\", f)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (s *stack) StackTrace() StackTrace {\n\tf := make([]Frame, len(*s))\n\tfor i := 0; i < len(f); i++ {\n\t\tf[i] = Frame((*s)[i])\n\t}\n\treturn f\n}\n\nfunc callers() *stack {\n\tconst depth = 32\n\tvar pcs [depth]uintptr\n\tn := runtime.Callers(3, pcs[:])\n\tvar st stack = pcs[0:n]\n\treturn &st\n}\n\n// funcname removes the path prefix component of a function's name reported by func.Name().\nfunc funcname(name string) string {\n\ti := strings.LastIndex(name, \"/\")\n\tname = name[i+1:]\n\ti = strings.Index(name, \".\")\n\treturn name[i+1:]\n}\n"} +{"text": "/*\n===========================================================================\n\nDoom 3 GPL Source Code\nCopyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. \n\nThis file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?). \n\nDoom 3 Source Code is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nDoom 3 Source Code is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with Doom 3 Source Code. If not, see .\n\nIn addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.\n\nIf you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.\n\n===========================================================================\n*/\n\n#include \"../precompiled.h\"\n#pragma hdrstop\n\n\n/*\n============\nidRotation::ToAngles\n============\n*/\nidAngles idRotation::ToAngles( void ) const {\n\treturn ToMat3().ToAngles();\n}\n\n/*\n============\nidRotation::ToQuat\n============\n*/\nidQuat idRotation::ToQuat( void ) const {\n\tfloat a, s, c;\n\n\ta = angle * ( idMath::M_DEG2RAD * 0.5f );\n\tidMath::SinCos( a, s, c );\n\treturn idQuat( vec.x * s, vec.y * s, vec.z * s, c );\n}\n\n/*\n============\nidRotation::toMat3\n============\n*/\nconst idMat3 &idRotation::ToMat3( void ) const {\n\tfloat wx, wy, wz;\n\tfloat xx, yy, yz;\n\tfloat xy, xz, zz;\n\tfloat x2, y2, z2;\n\tfloat a, c, s, x, y, z;\n\n\tif ( axisValid ) {\n\t\treturn axis;\n\t}\n\n\ta = angle * ( idMath::M_DEG2RAD * 0.5f );\n\tidMath::SinCos( a, s, c );\n\n\tx = vec[0] * s;\n\ty = vec[1] * s;\n\tz = vec[2] * s;\n\n\tx2 = x + x;\n\ty2 = y + y;\n\tz2 = z + z;\n\n\txx = x * x2;\n\txy = x * y2;\n\txz = x * z2;\n\n\tyy = y * y2;\n\tyz = y * z2;\n\tzz = z * z2;\n\n\twx = c * x2;\n\twy = c * y2;\n\twz = c * z2;\n\n\taxis[ 0 ][ 0 ] = 1.0f - ( yy + zz );\n\taxis[ 0 ][ 1 ] = xy - wz;\n\taxis[ 0 ][ 2 ] = xz + wy;\n\n\taxis[ 1 ][ 0 ] = xy + wz;\n\taxis[ 1 ][ 1 ] = 1.0f - ( xx + zz );\n\taxis[ 1 ][ 2 ] = yz - wx;\n\n\taxis[ 2 ][ 0 ] = xz - wy;\n\taxis[ 2 ][ 1 ] = yz + wx;\n\taxis[ 2 ][ 2 ] = 1.0f - ( xx + yy );\n\n\taxisValid = true;\n\n\treturn axis;\n}\n\n/*\n============\nidRotation::ToMat4\n============\n*/\nidMat4 idRotation::ToMat4( void ) const {\n\treturn ToMat3().ToMat4();\n}\n\n/*\n============\nidRotation::ToAngularVelocity\n============\n*/\nidVec3 idRotation::ToAngularVelocity( void ) const {\n\treturn vec * DEG2RAD( angle );\n}\n\n/*\n============\nidRotation::Normalize180\n============\n*/\nvoid idRotation::Normalize180( void ) {\n\tangle -= floor( angle / 360.0f ) * 360.0f;\n\tif ( angle > 180.0f ) {\n\t\tangle -= 360.0f;\n\t}\n\telse if ( angle < -180.0f ) {\n\t\tangle += 360.0f;\n\t}\n}\n\n/*\n============\nidRotation::Normalize360\n============\n*/\nvoid idRotation::Normalize360( void ) {\n\tangle -= floor( angle / 360.0f ) * 360.0f;\n\tif ( angle > 360.0f ) {\n\t\tangle -= 360.0f;\n\t}\n\telse if ( angle < 0.0f ) {\n\t\tangle += 360.0f;\n\t}\n}\n"} +{"text": "# Write up (N1CTF 2018 : patience)\n\nflag : `N1CTF{did_cmm_helped?1109ef6af4b2c6fc274ddc16ff8365d1}`\n\n## 一言Write up\n\n## Write up\n\n\n"} +{"text": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing ContentPatcher.Framework.Conditions;\nusing ContentPatcher.Framework.ConfigModels;\nusing ContentPatcher.Framework.Lexing.LexTokens;\nusing ContentPatcher.Framework.Patches;\nusing ContentPatcher.Framework.Tokens;\nusing Microsoft.Xna.Framework;\nusing Microsoft.Xna.Framework.Content;\nusing Microsoft.Xna.Framework.Graphics;\nusing Newtonsoft.Json;\nusing Pathoschild.Stardew.Common.Utilities;\nusing StardewModdingAPI;\nusing StardewModdingAPI.Utilities;\nusing StardewValley;\n\nnamespace ContentPatcher.Framework.Commands\n{\n /// Handles the 'patch' console command.\n internal class CommandHandler\n {\n /*********\n ** Fields\n *********/\n /// Encapsulates monitoring and logging.\n private readonly IMonitor Monitor;\n\n /// Manages loaded tokens.\n private readonly TokenManager TokenManager;\n\n /// Manages loaded patches.\n private readonly PatchManager PatchManager;\n\n /// Manages loading and unloading patches.\n private readonly PatchLoader PatchLoader;\n\n /// The loaded content packs.\n private readonly IList ContentPacks;\n\n /// Get the current token context for a given mod ID, or the global context if given a null mod ID.\n private readonly Func GetContext;\n\n /// A callback which immediately updates the current condition context.\n private readonly Action UpdateContext;\n\n /// A regex pattern matching asset names which incorrectly include the Content folder.\n private readonly Regex AssetNameWithContentPattern = new Regex(@\"^Content[/\\\\]\", RegexOptions.Compiled | RegexOptions.IgnoreCase);\n\n /// A regex pattern matching asset names which incorrectly include an extension.\n private readonly Regex AssetNameWithExtensionPattern = new Regex(@\"(\\.\\w+)$\", RegexOptions.Compiled | RegexOptions.IgnoreCase);\n\n /// A regex pattern matching asset names which incorrectly include the locale code.\n private readonly Regex AssetNameWithLocalePattern = new Regex(@\"^\\.(?:de-DE|es-ES|ja-JP|pt-BR|ru-RU|zh-CN)(?:\\.xnb)?$\", RegexOptions.Compiled | RegexOptions.IgnoreCase);\n\n\n /*********\n ** Accessors\n *********/\n /// The name of the root command.\n public string CommandName { get; } = \"patch\";\n\n\n /*********\n ** Public methods\n *********/\n /// Construct an instance.\n /// Manages loaded tokens.\n /// Manages loaded patches.\n /// Manages loading and unloading patches.\n /// Encapsulates monitoring and logging.\n /// The loaded content packs.\n /// Get the current token context.\n /// A callback which immediately updates the current condition context.\n public CommandHandler(TokenManager tokenManager, PatchManager patchManager, PatchLoader patchLoader, IMonitor monitor, IList contentPacks, Func getContext, Action updateContext)\n {\n this.TokenManager = tokenManager;\n this.PatchManager = patchManager;\n this.PatchLoader = patchLoader;\n this.Monitor = monitor;\n this.ContentPacks = contentPacks;\n this.GetContext = getContext;\n this.UpdateContext = updateContext;\n }\n\n /// Handle a console command.\n /// The command arguments.\n /// Returns whether the command was handled.\n public bool Handle(string[] args)\n {\n string subcommand = args.FirstOrDefault();\n string[] subcommandArgs = args.Skip(1).ToArray();\n\n switch (subcommand?.ToLower())\n {\n case null:\n case \"help\":\n return this.HandleHelp(subcommandArgs);\n\n case \"summary\":\n return this.HandleSummary();\n\n case \"update\":\n return this.HandleUpdate();\n\n case \"parse\":\n return this.HandleParse(subcommandArgs);\n\n case \"export\":\n return this.HandleExport(subcommandArgs);\n\n case \"reload\":\n return this.HandleReload(subcommandArgs);\n\n default:\n this.Monitor.Log($\"The '{this.CommandName} {args[0]}' command isn't valid. Type '{this.CommandName} help' for a list of valid commands.\", LogLevel.Debug);\n return false;\n }\n }\n\n\n /*********\n ** Private methods\n *********/\n /****\n ** Commands\n ****/\n /// Handle the 'patch help' command.\n /// The subcommand arguments.\n /// Returns whether the command was handled.\n private bool HandleHelp(string[] args)\n {\n // generate command info\n var helpEntries = new InvariantDictionary\n {\n [\"help\"] = $\"{this.CommandName} help\\n Usage: {this.CommandName} help\\n Lists all available {this.CommandName} commands.\\n\\n Usage: {this.CommandName} help \\n Provides information for a specific {this.CommandName} command.\\n - cmd: The {this.CommandName} command name.\",\n [\"summary\"] = $\"{this.CommandName} summary\\n Usage: {this.CommandName} summary\\n Shows a summary of the current conditions and loaded patches.\",\n [\"update\"] = $\"{this.CommandName} update\\n Usage: {this.CommandName} update\\n Immediately refreshes the condition context and rechecks all patches.\",\n [\"parse\"] = $\"{this.CommandName} parse\\n usage: {this.CommandName} parse \\\"value\\\"\\n Parses the given token string and shows the result. For example, `{this.CommandName} parse \\\"assets/{{{{Season}}}}.png\\\" will show a value like \\\"assets/Spring.png\\\".\\n\\n{this.CommandName} parse \\\"value\\\" \\\"content-pack.id\\\"\\n Parses the given token string and shows the result, using tokens available to the specified content pack (using the ID from the content pack's manifest.json). For example, `{this.CommandName} parse \\\"assets/{{{{CustomToken}}}}.png\\\" \\\"Pathoschild.ExampleContentPack\\\".\",\n [\"export\"] = $\"{this.CommandName} export\\n Usage: {this.CommandName} export \\\"\\\"\\n Saves a copy of an asset (including any changes from mods like Content Patcher) to the game folder. The asset name should be the target without the locale or extension, like \\\"Characters/Abigail\\\" if you want to export the value of 'Content/Characters/Abigail.xnb'.\",\n [\"reload\"] = $\"{this.CommandName} reload\\n Usage: {this.CommandName} reload \\\"\\\"\\n Reloads the patches of the content.json of a content pack. Config schema changes and dynamic token changes are unsupported.\"\n };\n\n // build output\n StringBuilder help = new StringBuilder();\n if (!args.Any())\n {\n help.AppendLine(\n $\"The '{this.CommandName}' command is the entry point for Content Patcher commands. These are \"\n + \"intended for troubleshooting and aren't intended for players. You use it by specifying a more \"\n + $\"specific command (like 'help' in '{this.CommandName} help'). Here are the available commands:\\n\\n\"\n );\n foreach (var entry in helpEntries.OrderByIgnoreCase(p => p.Key))\n {\n help.AppendLine(entry.Value);\n help.AppendLine();\n }\n }\n else if (helpEntries.TryGetValue(args[0], out string entry))\n help.AppendLine(entry);\n else\n help.AppendLine($\"Unknown command '{this.CommandName} {args[0]}'. Type '{this.CommandName} help' for available commands.\");\n\n // write output\n this.Monitor.Log(help.ToString(), LogLevel.Debug);\n\n return true;\n }\n\n /// Handle the 'patch summary' command.\n /// Returns whether the command was handled.\n private bool HandleSummary()\n {\n StringBuilder output = new StringBuilder();\n LogPathBuilder path = new LogPathBuilder(\"console command\");\n\n // add condition summary\n output.AppendLine();\n output.AppendLine(\"=====================\");\n output.AppendLine(\"== Global tokens ==\");\n output.AppendLine(\"=====================\");\n {\n // get data\n var tokensByProvider =\n (\n from token in this.TokenManager.GetTokens(enforceContext: false)\n let inputArgs = token.GetAllowedInputArguments().ToArray()\n let rootValues = !token.RequiresInput ? token.GetValues(InputArguments.Empty).ToArray() : new string[0]\n let isMultiValue =\n inputArgs.Length > 1\n || rootValues.Length > 1\n || (inputArgs.Length == 1 && token.GetValues(new InputArguments(new LiteralString(inputArgs[0], path.With(token.Name, \"input\")))).Count() > 1)\n orderby isMultiValue, token.Name // single-value tokens first, then alphabetically\n select token\n )\n .GroupBy(p => (p as ModProvidedToken)?.Mod.Name.Trim())\n .OrderBy(p => p.Key) // default tokens (key is null), then tokens added by other mods\n .ToArray();\n int labelWidth = Math.Max(tokensByProvider.Max(group => group.Max(p => p.Name.Length)), \"token name\".Length);\n\n // group by provider mod (if any)\n foreach (var tokenGroup in tokensByProvider)\n {\n // print mod name\n output.AppendLine($\" {tokenGroup.Key ?? \"Content Patcher\"}:\");\n output.AppendLine();\n\n // print table header\n output.AppendLine($\" {\"token name\".PadRight(labelWidth)} | value\");\n output.AppendLine($\" {\"\".PadRight(labelWidth, '-')} | -----\");\n\n // print tokens\n foreach (IToken token in tokenGroup)\n {\n output.Append($\" {token.Name.PadRight(labelWidth)} | \");\n\n if (!token.IsReady)\n output.AppendLine(\"[ ] n/a\");\n else if (token.RequiresInput)\n {\n InvariantHashSet allowedInputs = token.GetAllowedInputArguments();\n if (allowedInputs.Any())\n {\n bool isFirst = true;\n foreach (string input in allowedInputs.OrderByIgnoreCase(input => input))\n {\n if (isFirst)\n {\n output.Append(\"[X] \");\n isFirst = false;\n }\n else\n output.Append($\" {\"\".PadRight(labelWidth, ' ')} | \");\n output.AppendLine($\":{input}: {string.Join(\", \", token.GetValues(new InputArguments(new LiteralString(input, path.With(token.Name, \"input\")))))}\");\n }\n }\n else\n output.AppendLine(\"[X] (token returns a dynamic value)\");\n }\n else\n output.AppendLine(\"[X] \" + string.Join(\", \", token.GetValues(InputArguments.Empty).OrderByIgnoreCase(p => p)));\n }\n\n output.AppendLine();\n }\n }\n\n // add patch summary\n var patches = this.GetAllPatches()\n .GroupByIgnoreCase(p => p.ContentPack.Manifest.Name)\n .OrderByIgnoreCase(p => p.Key);\n\n output.AppendLine(\n \"=====================\\n\"\n + \"== Content patches ==\\n\"\n + \"=====================\\n\"\n + \"The following patches were loaded. For each patch:\\n\"\n + \" - 'loaded' shows whether the patch is loaded and enabled (see details for the reason if not).\\n\"\n + \" - 'conditions' shows whether the patch matches with the current conditions (see details for the reason if not). If this is unexpectedly false, check (a) the conditions above and (b) your Where field.\\n\"\n + \" - 'applied' shows whether the target asset was loaded and patched. If you expected it to be loaded by this point but it's false, double-check (a) that the game has actually loaded the asset yet, and (b) your Targets field is correct.\\n\"\n + \"\\n\"\n );\n foreach (IGrouping patchGroup in patches)\n {\n ModTokenContext tokenContext = this.TokenManager.TrackLocalTokens(patchGroup.First().ContentPack);\n output.AppendLine($\"{patchGroup.Key}:\");\n output.AppendLine(\"\".PadRight(patchGroup.Key.Length + 1, '-'));\n\n // print tokens\n {\n var tokens =\n (\n // get non-global tokens\n from IToken token in tokenContext.GetTokens(enforceContext: false)\n where token.Scope != null\n\n // get input arguments\n let validInputs = token.IsReady && token.RequiresInput\n ? token.GetAllowedInputArguments().Select(p => new LiteralString(p, path.With(patchGroup.Key, token.Name, $\"input '{p}'\"))).AsEnumerable()\n : new ITokenString[] { null }\n from ITokenString input in validInputs\n\n where !token.RequiresInput || validInputs.Any() // don't show tokens which can't be represented\n\n // select display data\n let result = new\n {\n Name = token.RequiresInput ? $\"{token.Name}:{input}\" : token.Name,\n Value = token.IsReady ? string.Join(\", \", token.GetValues(new InputArguments(input))) : \"\",\n IsReady = token.IsReady\n }\n orderby result.Name\n select result\n )\n .ToArray();\n if (tokens.Any())\n {\n int labelWidth = Math.Max(tokens.Max(p => p.Name.Length), \"token name\".Length);\n\n output.AppendLine();\n output.AppendLine(\" Local tokens:\");\n\n output.AppendLine($\" {\"token name\".PadRight(labelWidth)} | value\");\n output.AppendLine($\" {\"\".PadRight(labelWidth, '-')} | -----\");\n\n foreach (var token in tokens)\n output.AppendLine($\" {token.Name.PadRight(labelWidth)} | [{(token.IsReady ? \"X\" : \" \")}] {token.Value}\");\n }\n }\n\n // print patches\n output.AppendLine();\n output.AppendLine(\" Patches:\");\n output.AppendLine(\" loaded | conditions | applied | name + details\");\n output.AppendLine(\" ------- | ---------- | ------- | --------------\");\n foreach (PatchInfo patch in patchGroup.OrderBy(p => p, new PatchDisplaySortComparer()))\n {\n // log checkbox and patch name\n output.Append($\" [{(patch.IsLoaded ? \"X\" : \" \")}] | [{(patch.MatchesContext ? \"X\" : \" \")}] | [{(patch.IsApplied ? \"X\" : \" \")}] | {patch.PathWithoutContentPackPrefix}\");\n\n // log target value if different from name\n {\n // get patch values\n string rawIdentifyingPath = PathUtilities.NormalizePath(patch.ParsedType == PatchType.Include\n ? patch.RawFromAsset\n : patch.RawTargetAsset\n );\n var parsedIdentifyingPath = patch.ParsedType == PatchType.Include\n ? patch.ParsedFromAsset\n : patch.ParsedTargetAsset;\n\n // get raw name if different\n // (ignore differences in whitespace, capitalization, and path separators)\n string rawValue = !PathUtilities.NormalizePath(patch.PathWithoutContentPackPrefix.ToString().Replace(\" \", \"\")).ContainsIgnoreCase(rawIdentifyingPath?.Replace(\" \", \"\"))\n ? $\"{patch.ParsedType?.ToString() ?? patch.RawType} {rawIdentifyingPath}\"\n : null;\n\n // get parsed value\n string parsedValue = patch.MatchesContext && parsedIdentifyingPath?.HasAnyTokens == true\n ? PathUtilities.NormalizePath(parsedIdentifyingPath.Value)\n : null;\n\n // format\n if (rawValue != null || parsedValue != null)\n {\n output.Append(\" (\");\n if (rawValue != null)\n {\n output.Append(rawValue);\n if (parsedValue != null)\n output.Append(\" \");\n }\n if (parsedValue != null)\n output.Append($\"=> {parsedValue}\");\n output.Append(\")\");\n }\n }\n\n // log reason not applied\n string errorReason = this.GetReasonNotLoaded(patch);\n if (errorReason != null)\n output.Append($\" // {errorReason}\");\n\n // log common issues if not applied\n if (errorReason == null && patch.IsLoaded && !patch.IsApplied && patch.ParsedTargetAsset.IsMeaningful())\n {\n string assetName = patch.ParsedTargetAsset.Value;\n\n List issues = new List();\n if (this.AssetNameWithContentPattern.IsMatch(assetName))\n issues.Add(\"shouldn't include 'Content/' prefix\");\n if (this.AssetNameWithExtensionPattern.IsMatch(assetName))\n {\n var match = this.AssetNameWithExtensionPattern.Match(assetName);\n issues.Add($\"shouldn't include '{match.Captures[0]}' extension\");\n }\n if (this.AssetNameWithLocalePattern.IsMatch(assetName))\n issues.Add(\"shouldn't include language code (use conditions instead)\");\n\n if (issues.Any())\n output.Append($\" // hint: asset name may be incorrect ({string.Join(\"; \", issues)}).\");\n }\n\n // log possible token issues\n if (patch.Patch != null)\n {\n // location tokens used with daily patch\n if (patch.Patch.UpdateRate == UpdateRate.OnDayStart)\n {\n var tokensUsed = new InvariantHashSet(patch.Patch.GetTokensUsed());\n string[] locationTokensUsed = this.TokenManager.LocationTokens.Where(p => tokensUsed.Contains(p)).ToArray();\n if (locationTokensUsed.Any())\n output.Append($\" // hint: patch uses location tokens, but doesn't set \\\"{nameof(PatchConfig.Update)}\\\": \\\"{UpdateRate.OnLocationChange}\\\".\");\n }\n }\n\n // end line\n output.AppendLine();\n }\n\n // print patch effects\n {\n IDictionary effectsByPatch = new Dictionary(StringComparer.OrdinalIgnoreCase);\n foreach (PatchInfo patch in patchGroup)\n {\n if (!patch.IsApplied || patch.Patch == null)\n continue;\n\n string[] changeLabels = patch.GetChangeLabels().ToArray();\n if (!changeLabels.Any())\n continue;\n\n if (!effectsByPatch.TryGetValue(patch.ParsedTargetAsset.Value, out InvariantHashSet effects))\n effectsByPatch[patch.ParsedTargetAsset.Value] = effects = new InvariantHashSet();\n\n foreach (string effect in patch.GetChangeLabels())\n effects.Add(effect);\n }\n\n output.AppendLine();\n if (effectsByPatch.Any())\n {\n int maxAssetNameWidth = Math.Max(\"asset name\".Length, effectsByPatch.Max(p => p.Key.Length));\n\n output.AppendLine(\" Current changes:\");\n output.AppendLine($\" asset name{\"\".PadRight(maxAssetNameWidth - \"asset name\".Length)} | changes\");\n output.AppendLine($\" ----------{\"\".PadRight(maxAssetNameWidth - \"----------\".Length, '-')} | -------\");\n\n foreach (var pair in effectsByPatch.OrderBy(p => p.Key, StringComparer.OrdinalIgnoreCase))\n output.AppendLine($\" {pair.Key}{\"\".PadRight(maxAssetNameWidth - pair.Key.Length)} | {string.Join(\"; \", pair.Value.OrderBy(p => p, StringComparer.OrdinalIgnoreCase))}\");\n }\n else\n output.AppendLine(\" No current changes.\");\n }\n\n // add blank line between groups\n output.AppendLine();\n }\n\n this.Monitor.Log(output.ToString(), LogLevel.Debug);\n return true;\n }\n\n /// Handle the 'patch update' command.\n /// Returns whether the command was handled.\n private bool HandleUpdate()\n {\n this.UpdateContext();\n return true;\n }\n\n /// Handle the 'patch parse' command.\n /// Returns whether the command was handled.\n private bool HandleParse(string[] args)\n {\n // get token string\n if (args.Length < 1 || args.Length > 2)\n {\n this.Monitor.Log(\"The 'patch parse' command expects one to two arguments. See 'patch help parse' for more info.\", LogLevel.Error);\n return true;\n }\n string raw = args[0];\n string modID = args.Length >= 2 ? args[1] : null;\n\n // get context\n IContext context;\n try\n {\n context = this.GetContext(modID);\n }\n catch (KeyNotFoundException ex)\n {\n this.Monitor.Log(ex.Message, LogLevel.Error);\n return true;\n }\n catch (Exception ex)\n {\n this.Monitor.Log(ex.ToString(), LogLevel.Error);\n return true;\n }\n\n // parse value\n TokenString tokenStr;\n try\n {\n tokenStr = new TokenString(raw, context, new LogPathBuilder(\"console command\"));\n }\n catch (LexFormatException ex)\n {\n this.Monitor.Log($\"Can't parse that token value: {ex.Message}\", LogLevel.Error);\n return true;\n }\n catch (InvalidOperationException outerEx) when (outerEx.InnerException is LexFormatException ex)\n {\n this.Monitor.Log($\"Can't parse that token value: {ex.Message}\", LogLevel.Error);\n return true;\n }\n catch (Exception ex)\n {\n this.Monitor.Log($\"Can't parse that token value: {ex}\", LogLevel.Error);\n return true;\n }\n IContextualState state = tokenStr.GetDiagnosticState();\n\n // show result\n StringBuilder output = new StringBuilder();\n output.AppendLine();\n output.AppendLine(\"Metadata\");\n output.AppendLine(\"----------------\");\n output.AppendLine($\" raw value: {raw}\");\n output.AppendLine($\" ready: {tokenStr.IsReady}\");\n output.AppendLine($\" mutable: {tokenStr.IsMutable}\");\n output.AppendLine($\" has tokens: {tokenStr.HasAnyTokens}\");\n if (tokenStr.HasAnyTokens)\n output.AppendLine($\" tokens used: {string.Join(\", \", tokenStr.GetTokensUsed().Distinct().OrderBy(p => p, StringComparer.OrdinalIgnoreCase))}\");\n output.AppendLine();\n\n output.AppendLine(\"Diagnostic state\");\n output.AppendLine(\"----------------\");\n output.AppendLine($\" valid: {state.IsValid}\");\n output.AppendLine($\" in scope: {state.IsValid}\");\n output.AppendLine($\" ready: {state.IsReady}\");\n if (state.Errors.Any())\n output.AppendLine($\" errors: {string.Join(\", \", state.Errors)}\");\n if (state.InvalidTokens.Any())\n output.AppendLine($\" invalid tokens: {string.Join(\", \", state.InvalidTokens)}\");\n if (state.UnreadyTokens.Any())\n output.AppendLine($\" unready tokens: {string.Join(\", \", state.UnreadyTokens)}\");\n if (state.UnavailableModTokens.Any())\n output.AppendLine($\" unavailable mod tokens: {string.Join(\", \", state.UnavailableModTokens)}\");\n output.AppendLine();\n\n output.AppendLine(\"Result\");\n output.AppendLine(\"----------------\");\n output.AppendLine(!tokenStr.IsReady\n ? \"The token string is invalid or unready.\"\n : $\" The token string is valid and ready. Parsed value: \\\"{tokenStr}\\\"\"\n );\n\n this.Monitor.Log(output.ToString(), LogLevel.Debug);\n return true;\n }\n\n /// Handle the 'patch export' command.\n /// The subcommand arguments.\n /// Returns whether the command was handled.\n private bool HandleExport(string[] args)\n {\n // get asset name\n if (args.Length != 1)\n {\n this.Monitor.Log(\"The 'patch export' command expects a single argument containing the target asset name. See 'patch help' for more info.\", LogLevel.Error);\n return true;\n }\n string assetName = args[0];\n\n // load asset\n object asset;\n try\n {\n asset = Game1.content.Load(assetName);\n }\n catch (ContentLoadException ex)\n {\n this.Monitor.Log($\"Can't load asset '{assetName}': {ex.Message}\", LogLevel.Error);\n return true;\n }\n\n // init export path\n string fullTargetPath = Path.Combine(StardewModdingAPI.Constants.ExecutionPath, \"patch export\", string.Join(\"_\", assetName.Split(Path.GetInvalidFileNameChars())));\n Directory.CreateDirectory(Path.GetDirectoryName(fullTargetPath));\n\n // export\n if (asset is Texture2D texture)\n {\n fullTargetPath += \".png\";\n\n texture = this.UnpremultiplyTransparency(texture);\n using (Stream stream = File.Create(fullTargetPath))\n texture.SaveAsPng(stream, texture.Width, texture.Height);\n\n this.Monitor.Log($\"Exported asset '{assetName}' to '{fullTargetPath}'.\", LogLevel.Info);\n }\n else if (this.IsDataAsset(asset))\n {\n fullTargetPath += \".json\";\n\n File.WriteAllText(fullTargetPath, JsonConvert.SerializeObject(asset, Formatting.Indented));\n\n this.Monitor.Log($\"Exported asset '{assetName}' to '{fullTargetPath}'.\", LogLevel.Info);\n }\n else\n this.Monitor.Log($\"Can't export asset '{assetName}' of type {asset?.GetType().FullName ?? \"null\"}, expected image or data.\", LogLevel.Error);\n\n return true;\n }\n\n /// Handle the 'patch reload' command.\n /// The subcommand arguments.\n /// Returns whether the command was handled.\n private bool HandleReload(string[] args)\n {\n // get pack ID\n if (args.Length != 1)\n {\n this.Monitor.Log(\"The 'patch reload' command expects a single arguments containing the target content pack ID. See 'patch help' for more info.\", LogLevel.Error);\n return true;\n }\n string packId = args[0];\n\n // get pack\n RawContentPack pack = this.ContentPacks.SingleOrDefault(p => p.Manifest.UniqueID == packId);\n if (pack == null)\n {\n this.Monitor.Log($\"No Content Patcher content pack with the unique ID \\\"{packId}\\\".\", LogLevel.Error);\n return true;\n }\n\n // unload patches\n this.PatchLoader.UnloadPatchesLoadedBy(pack, false);\n\n // load pack patches\n var changes = pack.ContentPack.ReadJsonFile(\"content.json\").Changes;\n pack.Content.Changes = changes;\n\n // reload patches\n this.PatchLoader.LoadPatches(pack, pack.Content.Changes, new LogPathBuilder(pack.Manifest.Name), reindex: true, parentPatch: null);\n\n // make the changes apply\n this.UpdateContext();\n\n this.Monitor.Log(\"Content pack reloaded.\", LogLevel.Info);\n return true;\n }\n\n\n /****\n ** Helpers\n ****/\n /// Get basic info about all patches, including those which couldn't be loaded.\n public IEnumerable GetAllPatches()\n {\n foreach (IPatch patch in this.PatchManager.GetPatches())\n yield return new PatchInfo(patch);\n foreach (DisabledPatch patch in this.PatchManager.GetPermanentlyDisabledPatches())\n yield return new PatchInfo(patch);\n }\n\n /// Get a human-readable reason that the patch isn't applied.\n /// The patch to check.\n private string GetReasonNotLoaded(PatchInfo patch)\n {\n if (patch.IsApplied)\n return null;\n\n IContextualState state = patch.State;\n\n // state error\n if (state.InvalidTokens.Any())\n return $\"invalid tokens: {string.Join(\", \", state.InvalidTokens.OrderByIgnoreCase(p => p))}\";\n if (state.UnreadyTokens.Any())\n return $\"tokens not ready: {string.Join(\", \", state.UnreadyTokens.OrderByIgnoreCase(p => p))}\";\n if (state.Errors.Any())\n return string.Join(\"; \", state.Errors);\n\n // conditions not matched\n if (!patch.MatchesContext && patch.ParsedConditions != null)\n {\n string[] failedConditions = (\n from condition in patch.ParsedConditions\n let displayText = !condition.Is(ConditionType.HasFile) && !string.IsNullOrWhiteSpace(condition.Input.TokenString?.Raw)\n ? $\"{condition.Name}:{condition.Input.TokenString.Raw}\"\n : condition.Name\n orderby displayText\n where !condition.IsMatch\n select $\"{displayText}\"\n ).ToArray();\n\n if (failedConditions.Any())\n return $\"conditions don't match: {string.Join(\", \", failedConditions)}\";\n }\n\n // fallback to unavailable tokens (should never happen due to HasMod check)\n if (state.UnavailableModTokens.Any())\n return $\"tokens provided by an unavailable mod: {string.Join(\", \", state.UnavailableModTokens.OrderByIgnoreCase(p => p))}\";\n\n // non-matching for an unknown reason\n if (!patch.MatchesContext)\n return \"doesn't match context (unknown reason)\";\n\n // seems fine, just not applied yet\n return null;\n }\n\n /// Reverse premultiplication applied to an image asset by the XNA content pipeline.\n /// The texture to adjust.\n private Texture2D UnpremultiplyTransparency(Texture2D texture)\n {\n Color[] data = new Color[texture.Width * texture.Height];\n texture.GetData(data);\n\n for (int i = 0; i < data.Length; i++)\n {\n Color pixel = data[i];\n if (pixel.A == 0)\n continue;\n\n data[i] = new Color(\n (byte)((pixel.R * 255) / pixel.A),\n (byte)((pixel.G * 255) / pixel.A),\n (byte)((pixel.B * 255) / pixel.A),\n pixel.A\n ); // don't use named parameters, which are inconsistent between MonoGame (e.g. 'alpha') and XNA (e.g. 'a')\n }\n\n Texture2D result = new Texture2D(texture.GraphicsDevice, texture.Width, texture.Height);\n result.SetData(data);\n return result;\n }\n\n /// Get whether an asset can be saved to JSON.\n /// The asset to check.\n private bool IsDataAsset(object asset)\n {\n if (asset == null)\n return false;\n\n Type type = asset.GetType();\n type = type.IsGenericType ? type.GetGenericTypeDefinition() : type;\n\n return type == typeof(Dictionary<,>) || type == typeof(List<>);\n }\n }\n}\n"} +{"text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace OrmTest\n{\n public class TestTree\n {\n [SqlSugar.SugarColumn(ColumnDataType = \"hierarchyid\")]\n public string TreeId { get; set; }\n [SqlSugar.SugarColumn(ColumnDataType = \"Geography\")]\n public string GId { get; set; }\n public string Name { get; set; }\n }\n}\n"} +{"text": ".#{$eps-prefix}menu__title {\n\tmargin-top: spacing(44);\n\tmargin-bottom: spacing(16);\n}\n"} +{"text": "package tests\n\nobject NameAfterRename {\n val x = 0\n\n def qqq() = {}\n\n def apply() = {}\n\n def unapply(i: Int) = Some(i)\n}\n\ntrait NameAfterRename {\n def baz(): Int = 1\n}\n\nobject Test {\n def main(args: Array[String]) {\n NameAfterRename()\n 1 match {\n case NameAfterRename(i) =>\n }\n }\n}\n"} +{"text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.jena.atlas.io;\n\nimport static org.junit.Assert.assertEquals;\n\nimport java.io.ByteArrayOutputStream ;\nimport java.io.IOException ;\nimport java.io.OutputStreamWriter ;\nimport java.io.Writer ;\n\nimport org.junit.Test ;\n\npublic class TestPrintUtils\n{\n @Test public void hex1()\n {\n String s = test(0,4) ;\n assertEquals(\"0000\", s) ;\n }\n \n @Test public void hex2()\n {\n String s = test(1,8) ;\n assertEquals(\"00000001\", s) ;\n }\n\n @Test public void hex3()\n {\n String s = test(0xFF,2) ;\n assertEquals(\"FF\", s) ;\n }\n\n private static String test(int value, int width)\n {\n ByteArrayOutputStream x = new ByteArrayOutputStream() ;\n Writer out = new OutputStreamWriter(x) ;\n OutputUtils.printHex(out, value, width) ;\n try { out.flush() ; } catch (IOException ex) {}\n String s = x.toString() ;\n return s ;\n }\n}\n"} +{"text": "/**\n * @typedef {Object} drawRow~border\n * @property {string} bodyLeft\n * @property {string} bodyRight\n * @property {string} bodyJoin\n */\n\n/**\n * @param {number[]} columns\n * @param {drawRow~border} border\n * @returns {string}\n */\nexport default (columns, border) => {\n return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\\n';\n};\n"} +{"text": "/**\n * Copyright © 2002 Instituto Superior Técnico\n *\n * This file is part of FenixEdu Academic.\n *\n * FenixEdu Academic is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * FenixEdu Academic is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with FenixEdu Academic. If not, see .\n */\n/**\n * \n */\npackage org.fenixedu.academic.ui.struts.action.administrativeOffice.student;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\nimport org.apache.struts.action.ActionForm;\nimport org.apache.struts.action.ActionForward;\nimport org.apache.struts.action.ActionMapping;\nimport org.fenixedu.academic.domain.student.Registration;\nimport org.fenixedu.academic.service.factoryExecutors.ExternalRegistrationDataFactoryExecutor.ExternalRegistrationDataEditor;\nimport org.fenixedu.academic.service.services.exceptions.FenixServiceException;\nimport org.fenixedu.academic.ui.struts.action.base.FenixDispatchAction;\nimport org.fenixedu.bennu.struts.annotations.Forward;\nimport org.fenixedu.bennu.struts.annotations.Forwards;\nimport org.fenixedu.bennu.struts.annotations.Mapping;\n\n/**\n * @author - Shezad Anavarali (shezad@ist.utl.pt)\n * \n */\n@Mapping(path = \"/manageExternalRegistrationData\", module = \"academicAdministration\", functionality = SearchForStudentsDA.class)\n@Forwards({ @Forward(name = \"manageExternalRegistrationData\",\n path = \"/academicAdminOffice/student/registration/manageExternalRegistrationData.jsp\") })\npublic class ManageExternalRegistrationDataDA extends FenixDispatchAction {\n\n public ActionForward prepare(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,\n HttpServletResponse response) {\n\n final ExternalRegistrationDataEditor bean;\n if (getRenderedObject() != null) {\n bean = getRenderedObject();\n request.setAttribute(\"registration\", bean.getExternalRegistrationData().getRegistration());\n } else {\n bean = new ExternalRegistrationDataEditor(getAndTransportRegistration(request).getExternalRegistrationData());\n }\n request.setAttribute(\"externalRegistrationDataBean\", bean);\n\n return mapping.findForward(\"manageExternalRegistrationData\");\n }\n\n public ActionForward edit(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,\n HttpServletResponse response) throws FenixServiceException {\n executeFactoryMethod();\n return prepare(mapping, actionForm, request, response);\n }\n\n private Registration getAndTransportRegistration(final HttpServletRequest request) {\n final Registration registration = getDomainObject(request, \"registrationId\");\n request.setAttribute(\"registration\", registration);\n return registration;\n }\n\n}\n"} +{"text": "/*\nCopyright (C) 2016 Apple Inc. All Rights Reserved.\nSee LICENSE.txt for this sample’s licensing information\n\nAbstract:\nPart of Core Audio Public Utility Classes\n*/\n\n#include \"CADebugMacros.h\"\n#include \n#include \n#if TARGET_API_MAC_OSX\n\t#include \n#endif\n\n#if DEBUG\n#include \n\nvoid\tDebugPrint(const char *fmt, ...)\n{\n\tva_list args;\n\tva_start(args, fmt);\n\tvprintf(fmt, args);\n\tva_end(args);\n}\n#endif // DEBUG\n\nvoid\tLogError(const char *fmt, ...)\n{\n\tva_list args;\n\tva_start(args, fmt);\n#if DEBUG\n\tvprintf(fmt, args);\n#endif\n#if TARGET_API_MAC_OSX\n\tvsyslog(LOG_ERR, fmt, args);\n#endif\n\tva_end(args);\n}\n\nvoid\tLogWarning(const char *fmt, ...)\n{\n\tva_list args;\n\tva_start(args, fmt);\n#if DEBUG\n\tvprintf(fmt, args);\n#endif\n#if TARGET_API_MAC_OSX\n\tvsyslog(LOG_WARNING, fmt, args);\n#endif\n\tva_end(args);\n}\n"} +{"text": "\n## The open-source application container engine.\n\n########################################\n## \n##\tExecute docker in the docker domain.\n## \n## \n## \n##\tDomain allowed to transition.\n## \n## \n#\ninterface(`docker_domtrans',`\n\tgen_require(`\n\t\ttype docker_t, docker_exec_t;\n\t')\n\n\tcorecmd_search_bin($1)\n\tdomtrans_pattern($1, docker_exec_t, docker_t)\n')\n\n########################################\n## \n##\tExecute docker in the caller domain.\n## \n## \n## \n##\tDomain allowed to transition.\n## \n## \n#\ninterface(`docker_exec',`\n\tgen_require(`\n\t\ttype docker_exec_t;\n\t')\n\n\tcorecmd_search_bin($1)\n\tcan_exec($1, docker_exec_t)\n')\n\n########################################\n## \n##\tSearch docker lib directories.\n## \n## \n##\t\n##\tDomain allowed access.\n##\t\n## \n#\ninterface(`docker_search_lib',`\n\tgen_require(`\n\t\ttype docker_var_lib_t;\n\t')\n\n\tallow $1 docker_var_lib_t:dir search_dir_perms;\n\tfiles_search_var_lib($1)\n')\n\n########################################\n## \n##\tExecute docker lib directories.\n## \n## \n##\t\n##\tDomain allowed access.\n##\t\n## \n#\ninterface(`docker_exec_lib',`\n\tgen_require(`\n\t\ttype docker_var_lib_t;\n\t')\n\n\tallow $1 docker_var_lib_t:dir search_dir_perms;\n\tcan_exec($1, docker_var_lib_t)\n')\n\n########################################\n## \n##\tRead docker lib files.\n## \n## \n##\t\n##\tDomain allowed access.\n##\t\n## \n#\ninterface(`docker_read_lib_files',`\n\tgen_require(`\n\t\ttype docker_var_lib_t;\n\t')\n\n\tfiles_search_var_lib($1)\n\tread_files_pattern($1, docker_var_lib_t, docker_var_lib_t)\n')\n\n########################################\n## \n##\tRead docker share files.\n## \n## \n##\t\n##\tDomain allowed access.\n##\t\n## \n#\ninterface(`docker_read_share_files',`\n\tgen_require(`\n\t\ttype docker_share_t;\n\t')\n\n\tfiles_search_var_lib($1)\n\tread_files_pattern($1, docker_share_t, docker_share_t)\n')\n\n########################################\n## \n##\tManage docker lib files.\n## \n## \n##\t\n##\tDomain allowed access.\n##\t\n## \n#\ninterface(`docker_manage_lib_files',`\n\tgen_require(`\n\t\ttype docker_var_lib_t;\n\t')\n\n\tfiles_search_var_lib($1)\n\tmanage_files_pattern($1, docker_var_lib_t, docker_var_lib_t)\n\tmanage_lnk_files_pattern($1, docker_var_lib_t, docker_var_lib_t)\n')\n\n########################################\n## \n##\tManage docker lib directories.\n## \n## \n##\t\n##\tDomain allowed access.\n##\t\n## \n#\ninterface(`docker_manage_lib_dirs',`\n\tgen_require(`\n\t\ttype docker_var_lib_t;\n\t')\n\n\tfiles_search_var_lib($1)\n\tmanage_dirs_pattern($1, docker_var_lib_t, docker_var_lib_t)\n')\n\n########################################\n## \n##\tCreate objects in a docker var lib directory\n##\twith an automatic type transition to\n##\ta specified private type.\n## \n## \n##\t\n##\tDomain allowed access.\n##\t\n## \n## \n##\t\n##\tThe type of the object to create.\n##\t\n## \n## \n##\t\n##\tThe class of the object to be created.\n##\t\n## \n## \n##\t\n##\tThe name of the object being created.\n##\t\n## \n#\ninterface(`docker_lib_filetrans',`\n\tgen_require(`\n\t\ttype docker_var_lib_t;\n\t')\n\n\tfiletrans_pattern($1, docker_var_lib_t, $2, $3, $4)\n')\n\n########################################\n## \n##\tRead docker PID files.\n## \n## \n##\t\n##\tDomain allowed access.\n##\t\n## \n#\ninterface(`docker_read_pid_files',`\n\tgen_require(`\n\t\ttype docker_var_run_t;\n\t')\n\n\tfiles_search_pids($1)\n\tread_files_pattern($1, docker_var_run_t, docker_var_run_t)\n')\n\n########################################\n## \n##\tExecute docker server in the docker domain.\n## \n## \n##\t\n##\tDomain allowed to transition.\n##\t\n## \n#\ninterface(`docker_systemctl',`\n\tgen_require(`\n\t\ttype docker_t;\n\t\ttype docker_unit_file_t;\n\t')\n\n\tsystemd_exec_systemctl($1)\n\tinit_reload_services($1)\n systemd_read_fifo_file_passwd_run($1)\n\tallow $1 docker_unit_file_t:file read_file_perms;\n\tallow $1 docker_unit_file_t:service manage_service_perms;\n\n\tps_process_pattern($1, docker_t)\n')\n\n########################################\n## \n##\tRead and write docker shared memory.\n## \n## \n##\t\n##\tDomain allowed access.\n##\t\n## \n#\ninterface(`docker_rw_sem',`\n\tgen_require(`\n\t\ttype docker_t;\n\t')\n\n\tallow $1 docker_t:sem rw_sem_perms;\n')\n\n#######################################\n## \n## Read and write the docker pty type.\n## \n## \n## \n## Domain allowed access.\n## \n## \n#\ninterface(`docker_use_ptys',`\n gen_require(`\n type docker_devpts_t;\n ')\n\n allow $1 docker_devpts_t:chr_file rw_term_perms;\n')\n\n#######################################\n## \n## Allow domain to create docker content\n## \n## \n## \n## Domain allowed access.\n## \n## \n#\ninterface(`docker_filetrans_named_content',`\n\n gen_require(`\n type docker_var_lib_t;\n type docker_share_t;\n\ttype docker_log_t;\n\t type docker_var_run_t;\n type docker_home_t;\n ')\n\n files_pid_filetrans($1, docker_var_run_t, file, \"docker.pid\")\n files_pid_filetrans($1, docker_var_run_t, sock_file, \"docker.sock\")\n files_pid_filetrans($1, docker_var_run_t, dir, \"docker-client\")\n files_var_lib_filetrans($1, docker_var_lib_t, dir, \"docker\")\n filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, \"config.env\")\n filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, \"hosts\")\n filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, \"hostname\")\n filetrans_pattern($1, docker_var_lib_t, docker_share_t, file, \"resolv.conf\")\n filetrans_pattern($1, docker_var_lib_t, docker_share_t, dir, \"init\")\n userdom_admin_home_dir_filetrans($1, docker_home_t, dir, \".docker\")\n')\n\n########################################\n## \n##\tConnect to docker over a unix stream socket.\n## \n## \n##\t\n##\tDomain allowed access.\n##\t\n## \n#\ninterface(`docker_stream_connect',`\n\tgen_require(`\n\t\ttype docker_t, docker_var_run_t;\n\t')\n\n\tfiles_search_pids($1)\n\tstream_connect_pattern($1, docker_var_run_t, docker_var_run_t, docker_t)\n')\n\n########################################\n## \n##\tConnect to SPC containers over a unix stream socket.\n## \n## \n##\t\n##\tDomain allowed access.\n##\t\n## \n#\ninterface(`docker_spc_stream_connect',`\n\tgen_require(`\n\t\ttype spc_t, spc_var_run_t;\n\t')\n\n\tfiles_search_pids($1)\n\tfiles_write_all_pid_sockets($1)\n\tallow $1 spc_t:unix_stream_socket connectto;\n')\n\n\n########################################\n## \n##\tAll of the rules required to administrate\n##\tan docker environment\n## \n## \n##\t\n##\tDomain allowed access.\n##\t\n## \n#\ninterface(`docker_admin',`\n\tgen_require(`\n\t\ttype docker_t;\n\t\ttype docker_var_lib_t, docker_var_run_t;\n\t\ttype docker_unit_file_t;\n\t\ttype docker_lock_t;\n\t\ttype docker_log_t;\n\t\ttype docker_config_t;\n\t')\n\n\tallow $1 docker_t:process { ptrace signal_perms };\n\tps_process_pattern($1, docker_t)\n\n\tadmin_pattern($1, docker_config_t)\n\n\tfiles_search_var_lib($1)\n\tadmin_pattern($1, docker_var_lib_t)\n\n\tfiles_search_pids($1)\n\tadmin_pattern($1, docker_var_run_t)\n\n\tfiles_search_locks($1)\n\tadmin_pattern($1, docker_lock_t)\n\n\tlogging_search_logs($1)\n\tadmin_pattern($1, docker_log_t)\n\n\tdocker_systemctl($1)\n\tadmin_pattern($1, docker_unit_file_t)\n\tallow $1 docker_unit_file_t:service all_service_perms;\n\n\toptional_policy(`\n\t\tsystemd_passwd_agent_exec($1)\n\t\tsystemd_read_fifo_file_passwd_run($1)\n\t')\n')\n\ninterface(`domain_stub_named_filetrans_domain',`\n gen_require(`\n attribute named_filetrans_domain;\n ')\n')\n\ninterface(`lvm_stub',`\n gen_require(`\n type lvm_t;\n ')\n')\ninterface(`staff_stub',`\n gen_require(`\n type staff_t;\n ')\n')\ninterface(`virt_stub_svirt_sandbox_domain',`\n\tgen_require(`\n\t\tattribute svirt_sandbox_domain;\n\t')\n')\ninterface(`virt_stub_svirt_sandbox_file',`\n\tgen_require(`\n\t\ttype svirt_sandbox_file_t;\n\t')\n')\ninterface(`fs_dontaudit_remount_tmpfs',`\n\tgen_require(`\n\t\ttype tmpfs_t;\n\t')\n\n\tdontaudit $1 tmpfs_t:filesystem remount;\n')\ninterface(`dev_dontaudit_list_all_dev_nodes',`\n\tgen_require(`\n\t\ttype device_t;\n\t')\n\n\tdontaudit $1 device_t:dir list_dir_perms;\n')\ninterface(`kernel_unlabeled_entry_type',`\n\tgen_require(`\n\t\ttype unlabeled_t;\n\t')\n\n\tdomain_entry_file($1, unlabeled_t)\n')\ninterface(`kernel_unlabeled_domtrans',`\n\tgen_require(`\n\t\ttype unlabeled_t;\n\t')\n\n\tread_lnk_files_pattern($1, unlabeled_t, unlabeled_t)\n\tdomain_transition_pattern($1, unlabeled_t, $2)\n\ttype_transition $1 unlabeled_t:process $2;\n')\ninterface(`files_write_all_pid_sockets',`\n\tgen_require(`\n\t\tattribute pidfile;\n\t')\n\n\tallow $1 pidfile:sock_file write_sock_file_perms;\n')\ninterface(`dev_dontaudit_mounton_sysfs',`\n\tgen_require(`\n\t\ttype sysfs_t;\n\t')\n\n\tdontaudit $1 sysfs_t:dir mounton;\n')\n"} +{"text": "#pragma once\n\n#include \"base/timer.hpp\"\n\n#include \n\nnamespace gui\n{\nclass ScaleFpsHelper\n{\npublic:\n uint32_t GetFps() const\n {\n if (m_frameTime == 0.0)\n return 0;\n return static_cast(1.0 / m_frameTime);\n }\n\n bool IsPaused() const\n {\n return m_isPaused;\n }\n\n void SetFrameTime(double frameTime, bool isActiveFrame)\n {\n m_isPaused = !isActiveFrame;\n m_framesCounter++;\n m_aggregatedFrameTime += frameTime;\n\n double constexpr kAggregationPeriod = 0.5;\n if (m_isPaused || m_fpsAggregationTimer.ElapsedSeconds() >= kAggregationPeriod)\n {\n m_frameTime = m_aggregatedFrameTime / m_framesCounter;\n m_aggregatedFrameTime = 0.0;\n m_framesCounter = 0;\n m_fpsAggregationTimer.Reset();\n }\n }\n\n int GetScale() const { return m_scale; }\n void SetScale(int scale) { m_scale = scale; }\n\n void SetVisible(bool isVisible) { m_isVisible = isVisible; }\n bool IsVisible() const { return m_isVisible; }\n\nprivate:\n double m_frameTime = 0.0;\n int m_scale = 1;\n bool m_isVisible = false;\n\n base::Timer m_fpsAggregationTimer;\n double m_aggregatedFrameTime = 0.0;\n uint32_t m_framesCounter = 1;\n bool m_isPaused = false;\n};\n} // namespace gui\n"} +{"text": "\n\n\n \n\n\n

Redirecting to type.CFRunLoopObserverCallBack.html...

\n \n\n"} +{"text": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\npackage mozilla.components.feature.downloads.ui\n\nimport android.view.View\nimport android.widget.ImageView\nimport android.widget.TextView\nimport androidx.test.ext.junit.runners.AndroidJUnit4\nimport junit.framework.TestCase.assertEquals\nimport junit.framework.TestCase.assertTrue\nimport mozilla.components.support.test.mock\nimport mozilla.components.support.test.robolectric.testContext\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.mockito.ArgumentMatchers.any\nimport org.mockito.Mockito.spy\nimport org.mockito.Mockito.verify\nimport org.robolectric.annotation.Config\n\n@RunWith(AndroidJUnit4::class)\n@Config(application = TestApplication::class)\nclass DownloaderAppAdapterTest {\n\n @Test\n fun `bind apps`() {\n val nameLabel = spy(TextView(testContext))\n val iconImage = spy(ImageView(testContext))\n val ourApp = DownloaderApp(name = \"app\", packageName = \"thridparty.app\", resolver = mock(), activityName = \"\", url = \"\", contentType = null)\n val apps = listOf(ourApp)\n val view = View(testContext)\n var appSelected = false\n val viewHolder = DownloaderAppViewHolder(view, nameLabel, iconImage)\n\n val adapter = DownloaderAppAdapter(testContext, apps) {\n appSelected = true\n }\n\n adapter.onBindViewHolder(viewHolder, 0)\n view.performClick()\n\n verify(nameLabel).text = ourApp.name\n verify(iconImage).setImageDrawable(any())\n assertTrue(appSelected)\n assertEquals(ourApp, view.tag)\n }\n}\n"} +{"text": "{\n \"payload\": [],\n \"type\": \"snapshot\",\n \"channel\": \"afr\"\n}"} +{"text": "import * as React from 'react';\nimport createSvgIcon from './utils/createSvgIcon';\n\nexport default createSvgIcon(\n \n, 'BorderOuterTwoTone');\n"} +{"text": "/**\n * Copyright (C) 2010-2018 Gordon Fraser, Andrea Arcuri and EvoSuite\n * contributors\n *\n * This file is part of EvoSuite.\n *\n * EvoSuite is free software: you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published\n * by the Free Software Foundation, either version 3.0 of the License, or\n * (at your option) any later version.\n *\n * EvoSuite is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with EvoSuite. If not, see .\n */\npackage org.evosuite.assertion.stable;\n\nimport java.util.Map;\n\nimport org.evosuite.EvoSuite;\nimport org.evosuite.Properties;\nimport org.evosuite.SystemTestBase;\nimport org.evosuite.ga.metaheuristics.GeneticAlgorithm;\nimport org.evosuite.statistics.OutputVariable;\nimport org.evosuite.statistics.RuntimeVariable;\nimport org.evosuite.statistics.backend.DebugStatisticsBackend;\nimport org.evosuite.testsuite.TestSuiteChromosome;\nimport org.junit.After;\nimport org.junit.Assert;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport com.examples.with.different.packagename.stable.CanInitializeClass;\n\npublic class ExeceptionInInitializerSystemTest extends SystemTestBase {\n\n\tprivate final boolean DEFAULT_RESET_STATIC_FIELDS = Properties.RESET_STATIC_FIELDS;\n\tprivate final boolean DEFAULT_REPLACE_CALLS = Properties.REPLACE_CALLS;\n\tprivate final Properties.JUnitCheckValues DEFAULT_JUNIT_CHECK = Properties.JUNIT_CHECK;\n\tprivate final boolean DEFAULT_JUNIT_TESTS = Properties.JUNIT_TESTS;\n\tprivate final boolean DEFAULT_PURE_INSPECTORS = Properties.PURE_INSPECTORS;\n\tprivate final boolean DEFAULT_JUNIT_CHECK_ON_SEPARATE_PROCESS = Properties.JUNIT_CHECK_ON_SEPARATE_PROCESS;\n\tprivate final boolean DEFAULT_SANDBOX = Properties.SANDBOX;\n\n\t@Before\n\tpublic void before() {\n\t\tProperties.RESET_STATIC_FIELDS = true;\n\t\tProperties.SANDBOX = true;\n\t\tProperties.REPLACE_CALLS = true;\n\t\tProperties.JUNIT_CHECK = Properties.JUnitCheckValues.TRUE;\n\t\tProperties.JUNIT_TESTS = true;\n\t\tProperties.PURE_INSPECTORS = true;\n\t\tProperties.JUNIT_CHECK_ON_SEPARATE_PROCESS = false;\n\t}\n\n\t@After\n\tpublic void after() {\n\t\tProperties.RESET_STATIC_FIELDS = DEFAULT_RESET_STATIC_FIELDS;\n\t\tProperties.SANDBOX = DEFAULT_SANDBOX;\n\t\tProperties.REPLACE_CALLS = DEFAULT_REPLACE_CALLS;\n\t\tProperties.JUNIT_CHECK = DEFAULT_JUNIT_CHECK;\n\t\tProperties.JUNIT_TESTS = DEFAULT_JUNIT_TESTS;\n\t\tProperties.PURE_INSPECTORS = DEFAULT_PURE_INSPECTORS;\n\t\tProperties.JUNIT_CHECK_ON_SEPARATE_PROCESS = DEFAULT_JUNIT_CHECK_ON_SEPARATE_PROCESS;\n\t}\n\n\t@Test\n\tpublic void testCanInitializeClass() {\n\t\tEvoSuite evosuite = new EvoSuite();\n\n\t\tString targetClass = CanInitializeClass.class.getCanonicalName();\n\t\tProperties.TARGET_CLASS = targetClass;\n\t\tProperties.OUTPUT_VARIABLES=\"\"+RuntimeVariable.HadUnstableTests;\n\t\tString[] command = new String[] { \"-generateSuite\", \"-class\",\n\t\t\t\ttargetClass };\n\n\t\tObject result = evosuite.parseCommandLine(command);\n\n\t\tGeneticAlgorithm ga = getGAFromResult(result);\n\t\tTestSuiteChromosome best = (TestSuiteChromosome) ga.getBestIndividual();\n\t\tSystem.out.println(\"EvolvedTestSuite:\\n\" + best);\n\n\t\tMap> map = DebugStatisticsBackend.getLatestWritten();\n\t\tAssert.assertNotNull(map);\n\t\tOutputVariable unstable = map.get(RuntimeVariable.HadUnstableTests.toString());\n\t\tAssert.assertNotNull(unstable);\n\t\tAssert.assertEquals(Boolean.FALSE, unstable.getValue());\n\n\t}\n\n}\n"} +{"text": "#pragma once\n\n/* Monitor object */\ntypedef struct _MONITOR\n{\n HEAD head;\n struct _MONITOR* pMonitorNext;\n union\n {\n DWORD dwMONFlags;\n struct\n {\n DWORD IsVisible: 1;\n DWORD IsPalette: 1;\n DWORD IsPrimary: 1; /* Whether this is the primary monitor */\n };\n };\n RECT rcMonitor;\n RECT rcWork;\n HRGN hrgnMonitor;\n SHORT cFullScreen;\n SHORT cWndStack;\n HDEV hDev;\n} MONITOR, *PMONITOR;\n\nNTSTATUS NTAPI UserAttachMonitor(IN HDEV hDev);\nNTSTATUS NTAPI UserDetachMonitor(HDEV hDev);\nNTSTATUS NTAPI UserUpdateMonitorSize(IN HDEV hDev);\nPMONITOR NTAPI UserGetMonitorObject(IN HMONITOR);\nPMONITOR NTAPI UserGetPrimaryMonitor(VOID);\nPMONITOR NTAPI UserMonitorFromRect(PRECTL,DWORD);\nPMONITOR FASTCALL UserMonitorFromPoint(POINT,DWORD);\n\n/* EOF */\n"} +{"text": "---\ntitle: Apply tags to generated resources\ndescription: Learn how to stay organized with your Amplify-generated AWS resources by tagging them through the CLI\n---\n\nTags are labels consisting of key-value pairs that make it easier to manage, search for, and filter resources. Some popular use cases include:\n* Resource organization\n* Cost allocation\n* Operations support\n* Access control\n* Security risk management\n\nYou can learn more about how tags work [here](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html), as well as read about best practices for tagging [here](https://d1.awsstatic.com/whitepapers/aws-tagging-best-practices.pdf).\n\n## Setting up tags in a new project\n\nWhen running `amplify init`, a `tags.json` file is automatically generated in the `amplify/backend/` directory, containing predefined tags.\n\nThe structure of the file is the following:\n```json\n[\n {\n \"Key\": \"user:Stack\",\n \"Value\": \"{project-env}\"\n },\n {\n \"Key\": \"user:Application\",\n \"Value\": \"{project-name}\"\n }\n]\n```\n**Note:** For projects created before CLI version 4.28.0. Creating a `tags.json` file under `amplify/backend/` directory with the desired tags will ensure tags being applied to existing resources after invoking `amplify push`.\n\n## Using predefined variables\n\nThere are predefined tags that let you be more specific with information about the current project, while giving you the opportunity of structuring the tags according to what feels right to you.\n\nThe 2 predefined tags are the following:\n\n* {project-env} - Refers to the project environment (e.g. prod, env, etc)\n* {project-name} - Refers to the current project name (e.g mytestproject)\n\n\nThere are many different cases in which these tag variables can be used. This is an example of how they can be used together and what the output would be:\n\n```json\n[{\n \"Key\": \"myawesomekey\",\n \"Value\": \"myvalue-{project-name}-{project-env}\"\n}]\n```\n\nWhen getting pushed, the resources would transform into:\n```json\n[{\n \"Key\": \"myawesomekey\",\n \"Value\": \"myvalue-myamplifyproject-dev\"\n}]\n```\n\nTag values are not required, thus they can be empty.\n```json\n[{\n\t\"Key\": \"MY_TAG_KEY\",\n\t\"Value\": \"\"\n}]\n```\n\n## Adding and updating tags\n\nYou can update or add any additional tags in the `tags.json` file inside the `amplify/` folder by editing the file itself. The file must in a JSON format and should follow this structure:\n\n```json\n[{\n \"Key\": “MY_TAG_KEY”,\n \"Value\": “MY_TAG_VALUE\"\n}]\n```\n\nTo update the AWS resources from your Amplify project just run `amplify push`.\n\n## Restrictions\n\n* You can only add up to 50 tags to the `amplify/backend/tags.json` file.\n* Tag keys and values are case sensitive.\n* Duplicate tag keys are not allowed.\n\n\n\nFor more information on limits and restrictions with tagging conventions, please visit [this link](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html).\n\n\n"} +{"text": "require('../../modules/es6.object.prevent-extensions');\nmodule.exports = require('../../modules/_core').Object.preventExtensions;"} +{"text": "/*\n * This file is part of the GROMACS molecular simulation package.\n *\n * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by\n * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,\n * and including many others, as listed in the AUTHORS file in the\n * top-level source directory and at http://www.gromacs.org.\n *\n * GROMACS is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public License\n * as published by the Free Software Foundation; either version 2.1\n * of the License, or (at your option) any later version.\n *\n * GROMACS 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 GROMACS; if not, see\n * http://www.gnu.org/licenses, or write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n *\n * If you want to redistribute modifications to GROMACS, please\n * consider that scientific software is very special. Version\n * control is crucial - bugs must be traceable. We will be happy to\n * consider code for inclusion in the official distribution, but\n * derived work must not be called official GROMACS. Details are found\n * in the README & COPYING files - if they are missing, get the\n * official version at http://www.gromacs.org.\n *\n * To help us fund GROMACS development, we humbly ask that you cite\n * the research papers on the package. Check out http://www.gromacs.org.\n */\n\n#ifndef GMXAPI_SESSION_RESOURCES_H\n#define GMXAPI_SESSION_RESOURCES_H\n\n/*! \\file\n * \\brief Define interface to Session Resources for active (running) gmxapi operations.\n */\n\nnamespace gmxapi\n{\n\n/*!\n * \\brief Handle to Session-provided resources.\n *\n * Session handle for workflow elements requiring resources provided through the Session.\n *\n * Provided during launch through gmx::IRestraintPotential::bindSession()\n *\n * No public interface yet. Use accompanying free functions.\n * \\see gmxapi::getMdrunnerSignal()\n */\nclass SessionResources;\n\n} // end namespace gmxapi\n\n#endif // GMXAPI_SESSION_RESOURCES_H\n"} +{"text": " \r\n\r\n\r\n
\r\n\r\n\r\n\r\n"} +{"text": "# string_decoder\n\n***Node-core v7.0.0 string_decoder for userland***\n\n\n[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/)\n[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/)\n\n\n```bash\nnpm install --save string_decoder\n```\n\n***Node-core string_decoderstring_decoder for userland***\n\nThis package is a mirror of the string_decoder implementation in Node-core.\n\nFull documentation may be found on the [Node.js website](https://nodejs.org/dist/v7.8.0/docs/api/).\n\nAs of version 1.0.0 **string_decoder** uses semantic versioning.\n\n## Previous versions\n\nPrevious version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10.\n\n## Update\n\nThe *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version.\n"} +{"text": "//\n// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab\n// Copyright (C) DIGITEO - 2010-2012 - Allan CORNET\n//\n// Copyright (C) 2012 - 2016 - Scilab Enterprises\n//\n// This file is hereby licensed under the terms of the GNU GPL v2.0,\n// pursuant to article 5.3.4 of the CeCILL v.2.1.\n// This file was originally licensed under the terms of the CeCILL v2.1,\n// and continues to be available under such terms.\n// For more information, see the COPYING file which you should have received\n// along with this program.\n//\n//------------------------------------------------------------------------------\n// Inno Setup Script (5.3 and more) for Scilab (UNICODE version required)\n//\n//------------------------------------------------------------------------------\n\nfunction IsProcessorFeaturePresent(ProcessorFeature: DWORD): Boolean;\nexternal 'IsProcessorFeaturePresent@kernel32.dll stdcall';\n\nfunction GetModuleHandle(lpModuleName: LongInt): LongInt;\nexternal 'GetModuleHandleA@kernel32.dll stdcall';\n\nvar\n AboutModulesButton: TButton;\n OriginalOnTypesComboChange: TNotifyEvent;\n\n//------------------------------------------------------------------------------\nfunction isCLIType(): Boolean;\n begin\n Result := true;\n if (IsComponentSelected( ExpandConstant('{#COMPN_JVM_MODULE}'))) then\n begin\n Result := false;\n end;\n end;\n//------------------------------------------------------------------------------\nfunction getExecNameForDesktop(Param: String): String;\n begin\n if (isCLIType() = true) then\n begin\n Result := ExpandConstant('{app}') + '\\bin\\Scilex.exe';\n end\n else\n begin\n Result := ExpandConstant('{app}') + '\\bin\\WScilex.exe';\n end;\n end;\n//------------------------------------------------------------------------------\nfunction DoTasksJustAfterInstall: Boolean;\n begin\n Result := true;\n Result := CreateModulesFile();\n end;\n//------------------------------------------------------------------------------\nfunction GetJREVersion(): String;\nbegin\n Result := '';\n\n if Is64BitInstallMode() or not IsWin64() then\n begin\n //64 bits installation or 32 bits OS -> same registry path\n RegQueryStringValue( HKLM, 'SOFTWARE\\JavaSoft\\Java Runtime Environment', 'CurrentVersion', Result );\n end else begin\n // Scilab 32 bits sur Windows 64 bits\n RegQueryStringValue( HKLM, 'SOFTWARE\\Wow6432Node\\JavaSoft\\Java Runtime Environment', 'CurrentVersion', Result );\n end\nend;\n//------------------------------------------------------------------------------\n function CheckJREVersion(): Boolean;\n var\n jreVersion: String;\n minJREVersionRegistry: String;\n begin\n //\n // Initialize min java version constant\n //\n minJREVersionRegistry := ExpandConstant('{#javaSpecificationVersion}');\n //\n // now we check the version of the installed JRE\n //\n jreVersion := GetJREVersion();\n if ( jreVersion = '' ) then begin\n Result := false;\n end else if ( jreVersion < minJREVersionRegistry ) then begin\n Result := false;\n end else begin\n Result := true;\n end;\n end;\n//------------------------------------------------------------------------------\n function VerifyJREVersion() : Boolean;\n var\n bJREVersion: Boolean;\n begin\n bJREVersion := CheckJREVersion();\n\n if ( bJREVersion <> true ) then begin\n SuppressibleMsgBox( CustomMessage('MsgBoxJavaDetection1') + #13 +\n CustomMessage('MsgBoxJavaDetection2') + ExpandConstant('{#javaSpecificationVersion}') + '.',\n mbError, MB_OK, MB_OK );\n end;\n\n Result := bJREVersion;\n end;\n//------------------------------------------------------------------------------\nprocedure ButtonAboutModulesOnClick(Sender: TObject);\nvar\n ErrorCode: Integer;\n\nbegin\n if not ShellExec('', ExpandConstant('{#MODULES_LIST_WEB_PAGE}'),\n '', '', SW_SHOW, ewNoWait, ErrorCode) then\n begin\n // handle failure if necessary\n SuppressibleMsgBox( CustomMessage('MsgBoxWebOpen'),mbError, MB_OK, MB_OK );\n end;\nend;\n//------------------------------------------------------------------------------\n function BackButtonClick(CurPageID: Integer): Boolean;\n begin\n Result := true;\n if (CurPageId = wpSelectProgramGroup) then\n begin\n AboutModulesButton.Visible := true;\n end else begin\n AboutModulesButton.Visible := false;\n end;\n end;\n//------------------------------------------------------------------------------\nfunction NextButtonClick(CurPageID: Integer): Boolean;\n Var\n bRes : Boolean;\n\n begin\n Result := true;\n\n if (CurPageID = wpWelcome) then\n begin\n if (Is64BitInstallMode() = false) then\n begin\n if IsWin64() then\n begin\n SuppressibleMsgBox(CustomMessage('MsgBoxX64Ready'), mbInformation, MB_OK, MB_OK );\n end;\n end;\n\n if (IsProcessorFeaturePresent(10) = false) then\n begin\n bRes := false;\n SuppressibleMsgBox(CustomMessage('MsgBoxSSERequired'), mbError, MB_OK, MB_OK );\n Result := false;\n end;\n end;\n\n if (CurPageId = wpSelectDir) then\n begin\n AboutModulesButton.Visible := true;\n end else begin\n AboutModulesButton.Visible := false;\n end;\n\n if (CurPageId = wpSelectComponents) then\n begin\n if ( IsComponentSelected( ExpandConstant('{#COMPN_JRE}') ) = false ) then\n begin\n bRes := VerifyJREVersion();\n if ( bRes = false ) then\n begin\n Result := false;\n end;\n end;\n\n if ( (IsComponentSelected( ExpandConstant('{#COMPN_DEVTOOLS}') ) = false) and (IsComponentSelected( ExpandConstant('{#COMPN_TOOLBOX_SKELETON}') ) = true) ) then\n begin\n SuppressibleMsgBox( CustomMessage('MsgBoxDevToolsRequired1') + #13 +\n CustomMessage('MsgBoxDevToolsRequired2'),\n mbError, MB_OK, MB_OK );\n Result := false;\n end;\n\n if ( (IsComponentSelected( ExpandConstant('{#COMPN_DEVTOOLS}') ) = false) and (IsComponentSelected( ExpandConstant('{#COMPN_TESTS}') ) = true) ) then\n begin\n SuppressibleMsgBox( CustomMessage('MsgBoxDevToolsRequired3') + #13 +\n CustomMessage('MsgBoxDevToolsRequired2'),\n mbError, MB_OK, MB_OK );\n Result := false;\n end;\n\n end;\n end;\n//------------------------------------------------------------------------------\nprocedure DeinitializeUninstall;\nvar\n Names: TArrayOfString;\n iLen: Integer;\nbegin\n //read registry to find others scilab installation in the same arch\n if RegGetSubkeyNames(HKLM, 'Software\\Scilab', Names) then\n begin\n iLen := length(Names);\n if iLen > 0 then\n begin\n RegWriteStringValue(HKLM, 'Software\\Scilab', 'LASTINSTALL', Names[iLen - 1]);\n end else begin\n //no other install in the same arch\n //remove LASTINSTALL key and Scilab registry folder ( auto )\n RegDeleteValue(HKLM, 'Software\\Scilab', 'LASTINSTALL');\n end;\n end;\nend;\n//------------------------------------------------------------------------------\nfunction InitializeSetup: Boolean;\n Var\n Version: TWindowsVersion;\n#ifdef SCILAB_WITHOUT_JRE\n bRes : Boolean;\n#endif\n begin\n Result := True;\n GetWindowsVersionEx(Version);\n\n if Version.NTPlatform and (Version.Major > 4) then\n begin\n Result := True;\n end else begin\n SuppressibleMsgBox(CustomMessage('MsgBoxWinVer'), mbCriticalError, MB_OK, MB_OK);\n Result := False;\n Exit;\n end\n#ifdef SCILAB_WITHOUT_JRE\n bRes := CheckJREVersion();\n if ( bRes = false ) then\n begin\n SuppressibleMsgBox(CustomMessage('MsgBoxJRENotFound')+ '(' +ExpandConstant('{#javaSpecificationVersion}') + ')' + #13 +\n CustomMessage('MsgBoxJREURL')+ #13 +\n CustomMessage('MsgBoxJREReinstall')\n , mbCriticalError, MB_OK, MB_OK);\n Result := False;\n Exit;\n end else begin\n Result := True;\n end\n#endif\n end;\n//------------------------------------------------------------------------------\nprocedure OnTypesComboChange(Sender: TObject);\nvar\n ItemIndex: Integer;\n Res: Boolean;\nbegin\n OriginalOnTypesComboChange(Sender);\nend;\n//------------------------------------------------------------------------------\nprocedure CreateTheWizardPages;\nvar\n CancelButton: TButton;\nbegin\n CancelButton := WizardForm.CancelButton;\n\n AboutModulesButton := TButton.Create(WizardForm);\n AboutModulesButton.Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width;\n AboutModulesButton.Top := CancelButton.Top;\n AboutModulesButton.Width := CancelButton.Width * 2;\n\n AboutModulesButton.Caption := CustomMessage('ButtonAboutModules');\n\n AboutModulesButton.Height := CancelButton.Height;\n\n AboutModulesButton.OnClick := @ButtonAboutModulesOnClick;\n AboutModulesButton.Parent := CancelButton.Parent;\n AboutModulesButton.Visible := false;\n\n OriginalOnTypesComboChange := WizardForm.TypesCombo.OnChange;\n WizardForm.TypesCombo.OnChange := @OnTypesComboChange;\nend;\n//------------------------------------------------------------------------------\nprocedure InitializeWizard();\nbegin\n CreateTheWizardPages;\nend;\n//------------------------------------------------------------------------------\n//convert Boolean expresion in string ( debug function )\nfunction BoolToStr(Value : Boolean) : String;\nbegin\n if Value then\n result := 'true'\n else\n result := 'false';\nend;\n//------------------------------------------------------------------------------\n//check user rights\nfunction IsAdminUser(): Boolean;\nbegin\n Result := (IsAdminLoggedOn or IsPowerUserLoggedOn);\nend;\n//------------------------------------------------------------------------------\n//returns default install path ( take care of user rights )\nfunction DefDirRoot(Param: String): String;\nbegin\n if IsAdminUser then\n //program files path\n Result := ExpandConstant('{pf}')\n else\n //local app data path\n Result := ExpandConstant('{localappdata}')\nend;\n"} +{"text": ".\\\" generated with Ronn/v0.7.3\n.\\\" http://github.com/rtomayko/ronn/tree/0.7.3\n.\n.TH \"README\" \"\" \"August 2019\" \"\" \"\"\n.\n.SH \"Introduction\"\nThe tool \\fBqt\\-gui\\fR offers a graphical interface for users of Elektra\\. It allows users to create, manage, edit, and delete keys stored in the global key database (KDB)\\.\n.\n.SH \"Compiling and Installation\"\n.\n.SS \"Dependencies\"\nIn order to compile and use the new \\fBqt\\-gui\\fR there are a few dependencies which must be installed\\.\n.\n.IP \"\\(bu\" 4\nqt5\\.3 or greater\n.\n.IP \"\\(bu\" 4\nlibdrm\\-dev\n.\n.IP \"\\(bu\" 4\nlibdiscount (libmarkdown2\\-dev)\n.\n.IP \"\\(bu\" 4\nthe following qt5 modules: \\fBquickcontrols\\fR \\fBdeclarative\\fR (\\fBqtdeclarative5\\-dev\\fR)\n.\n.IP \"\\(bu\" 4\nAlternatively, you may need \\fBsudo apt\\-get install qml\\-module\\-qt\\-labs\\-folderlistmodel\\fR and \\fBsudo apt\\-get install qml\\-module\\-qt\\-labs\\-settings\\fR\n.\n.IP \"\" 0\n.\n.P\nOptional dependencies are (are automatically deactivated if dependencies are not found):\n.\n.IP \"\\(bu\" 4\n\\fBQt5Svg\\fR for SVG icon themes (\\fBsudo apt\\-get install libqt5svg5\\-dev\\fR)\n.\n.IP \"\\(bu\" 4\n\\fBQt5DBus\\fR so that \\fBqt\\-gui\\fR will be notified on changes\\.\n.\n.IP \"\" 0\n.\n.P\nI was able to install the correct dependencies on my system, running Kubuntu 14\\.10 using the command: \\fBsudo apt\\-get install qt5\\-default qml\\-module\\-qtquick\\-controls qml\\-module\\-qtquick\\-dialogs qml\\-module\\-qtquick\\-layouts qml\\-module\\-qtgraphicaleffects libdrm\\-dev libmarkdown2\\-dev libqt5svg5\\-dev\\fR\n.\n.SS \"Change Notification\"\nIt is recommended to use the viewer mode if DBus notifications are expected\\. Use \"Settings \\-> Viewermode\" to activate the viewermode\\.\n.\n.P\nTo publish changes to KDB via DBus use:\n.\n.P\n\\fBkdb global\\-mount dbus\\fR\n.\n.P\n\\fBqt\\-gui\\fR also subscribes to DBus notifications and automatically synchronizes the configuration when notified\\.\n.\n.P\nKnown Issue: On reload the current element in the tree view gets unselected, you need to click on the element of interest again\\.\n.\n.SS \"Compiling\"\nCompile Elektra as normal as per the COMPILE document \\fI/doc/COMPILE\\.md\\fR making sure to include the \\fBqt\\-gui\\fR tool using the \\fB\\-DTOOLS\\fR flag\\.\n.\n.P\nFor instance: \\fB\\-DTOOLS=ALL\\fR or \\fB\\-DTOOLS=qt\\-gui\\fR\n.\n.P\nNote: If you install qt5 manually, you must either:\n.\n.IP \"\\(bu\" 4\nmake sure the qt5 libraries are included in \\fBLD_LIBRARY_PATH\\fR\n.\n.IP \"\\(bu\" 4\nOR make sure to specify \\fB\\-DCMAKE_PREFIX_PATH=/opt/Qt5\\.3\\.0/5\\.3/gcc_64/lib/cmake\\fR\n.\n.IP \"\" 0\n.\n.SS \"Installing\"\nYou can now install Elektra as you normally would or as described in the install documentation \\fI/doc/INSTALL\\.md\\fR\\.\n.\n.SH \"To Run\"\nThe following command will launch the Qt\\-GUI:\n.\n.IP \"\" 4\n.\n.nf\n\nkdb qt\\-gui\n.\n.fi\n.\n.IP \"\" 0\n\n"} +{"text": "// ****************************************************************\r\n// Copyright 2011, Charlie Poole\r\n// This is free software licensed under the NUnit license. You may\r\n// obtain a copy of the license at http://nunit.org\r\n// ****************************************************************\r\n\r\nusing System;\r\nusing System.Windows.Forms;\r\n\r\nnamespace NUnit.UiKit\r\n{\r\n public interface IMessageDisplay\r\n {\r\n DialogResult Display(string message);\r\n DialogResult Display(string message, MessageBoxButtons buttons);\r\n\r\n DialogResult Error(string message);\r\n DialogResult Error(string message, MessageBoxButtons buttons);\r\n DialogResult Error(string message, Exception exception);\r\n DialogResult Error(string message, Exception exception, MessageBoxButtons buttons);\r\n\r\n DialogResult FatalError(string message, Exception exception);\r\n\r\n DialogResult Info(string message);\r\n DialogResult Info(string message, MessageBoxButtons buttons);\r\n\r\n DialogResult Ask(string message);\r\n DialogResult Ask(string message, MessageBoxButtons buttons);\r\n }\r\n}\r\n"} +{"text": "using Server.Engines.HuntsmasterChallenge;\nusing Server.Gumps;\nusing System.Collections.Generic;\n\nnamespace Server.Items\n{\n public class BestKillBoard : Item\n {\n public override string DefaultName => \"Top 10 Kill Board\";\n\n [Constructable]\n public BestKillBoard() : base(7775)\n {\n Movable = false;\n }\n\n public override void OnDoubleClick(Mobile from)\n {\n if (from.InRange(Location, 3) && HuntingSystem.Instance != null && HuntingSystem.Instance.Active)\n {\n from.CloseGump(typeof(BestKillGump));\n from.SendGump(new BestKillGump());\n }\n }\n\n public BestKillBoard(Serial serial) : base(serial)\n {\n }\n\n public override void Serialize(GenericWriter writer)\n {\n base.Serialize(writer);\n writer.Write(0);\n }\n\n public override void Deserialize(GenericReader reader)\n {\n base.Deserialize(reader);\n int v = reader.ReadInt();\n }\n\n private class BestKillGump : Gump\n {\n private int m_Filter;\n\n public BestKillGump() : this(-1) { }\n\n public BestKillGump(int filter) : base(20, 20)\n {\n if (HuntingSystem.Instance == null)\n return;\n\n m_Filter = filter;\n\n if (m_Filter < -1) m_Filter = 23;\n if (m_Filter > 23) m_Filter = -1;\n\n List useList = new List();\n\n if (m_Filter == -1)\n {\n foreach (KeyValuePair> kvp in HuntingSystem.Instance.Top10)\n {\n if (kvp.Value.Count > 0)\n useList.AddRange(kvp.Value);\n }\n }\n else if (HuntingSystem.Instance.Top10.ContainsKey((HuntType)m_Filter))\n {\n useList = HuntingSystem.Instance.Top10[(HuntType)m_Filter];\n }\n\n AddBackground(0, 0, 500, 400, 9250);\n\n AddHtml(0, 15, 500, 16, \"
Top 10 Kills
\", false, false);\n AddHtml(20, 40, 150, 16, \"Hunter\", false, false);\n AddHtml(170, 40, 120, 16, \"Species\", false, false);\n AddHtml(290, 40, 150, 16, \"Measurement\", false, false);\n AddHtml(390, 40, 110, 16, \"Date Killed\", false, false);\n\n useList.Sort();\n int y = 80;\n\n for (int i = 0; i < useList.Count && i < 10; i++)\n {\n HuntingKillEntry entry = useList[i];\n HuntingTrophyInfo info = HuntingTrophyInfo.Infos[entry.KillIndex];\n\n AddHtml(20, y, 150, 16, entry.Owner != null ? FormatFont(entry.Owner.Name, i) : FormatFont(\"Unknown\", i), false, false);\n AddHtml(170, y, 120, 16, FormatFont(GetHuntTypeString(info.HuntType), i), false, false);\n AddHtml(290, y, 100, 16, info.MeasuredBy == MeasuredBy.Weight ? FormatFont(entry.Measurement.ToString() + \" stones\", i) : FormatFont(entry.Measurement.ToString() + \" feet\", i), false, false);\n AddHtml(390, y, 150, 16, FormatFont(entry.DateKilled.ToShortDateString(), i), false, false);\n\n y += 20;\n }\n\n AddHtml(0, 365, 500, 16, string.Format(\"
{0}
\", GetHuntTypeString()), false, false);\n\n AddButton(150, 365, 4014, 4016, 1, GumpButtonType.Reply, 0);\n AddButton(328, 365, 4005, 4007, 2, GumpButtonType.Reply, 0);\n }\n\n private string FormatFont(string str, int index)\n {\n int hue = 080000 + (100000 * index);\n\n return string.Format(\"{1}\", hue.ToString(), str);\n }\n\n public override void OnResponse(Network.NetState state, RelayInfo info)\n {\n Mobile from = state.Mobile;\n\n if (info.ButtonID == 1)\n {\n m_Filter--;\n from.SendGump(new BestKillGump(m_Filter));\n }\n else if (info.ButtonID == 2)\n {\n m_Filter++;\n from.SendGump(new BestKillGump(m_Filter));\n }\n }\n\n private string GetHuntTypeString(HuntType type)\n {\n switch (type)\n {\n default:\n case HuntType.GrizzlyBear: return \"Grizzly Bear\";\n case HuntType.GrayWolf: return \"Grey Wolf\";\n case HuntType.Cougar: return \"Cougar\";\n case HuntType.Turkey: return \"Turkey\";\n case HuntType.Bull: return \"Bull\";\n case HuntType.Boar: return \"Boar\";\n case HuntType.Walrus: return \"Walrus\";\n case HuntType.Alligator: return \"Alligator\";\n case HuntType.Eagle: return \"Eagle\";\n //Publish 91 added:\n case HuntType.MyrmidexLarvae: return \"Myrmidex Larvae\";\n case HuntType.Najasaurus: return \"Najasaurus\";\n case HuntType.Anchisaur: return \"Anchisaur\";\n case HuntType.Allosaurus: return \"Allosaurus\";\n case HuntType.Dimetrosaur: return \"Dimetrosaur\";\n case HuntType.Saurosaurus: return \"Saurosaurus\";\n //Publish 95 added:\n case HuntType.Tiger: return \"Tiger\";\n case HuntType.MyrmidexDrone: return \"Myrmidex Drone\";\n case HuntType.Triceratops: return \"Triceratops\";\n case HuntType.Lion: return \"Lion\";\n case HuntType.WhiteTiger: return \"White Tiger\";\n case HuntType.BlackTiger: return \"Black Tiger\";\n //Publish 102 added:\n case HuntType.Raptor: return \"Raptor\";\n case HuntType.SeaSerpent: return \"Sea Serpent\";\n case HuntType.Scorpion: return \"Scorpion\";\n }\n }\n\n private string GetHuntTypeString()\n {\n switch (m_Filter)\n {\n default: return \"No Filter\";\n case (int)HuntType.GrizzlyBear: return \"Grizzly Bear\";\n case (int)HuntType.GrayWolf: return \"Grey Wolf\";\n case (int)HuntType.Cougar: return \"Cougar\";\n case (int)HuntType.Turkey: return \"Turkey\";\n case (int)HuntType.Bull: return \"Bull\";\n case (int)HuntType.Boar: return \"Boar\";\n case (int)HuntType.Walrus: return \"Walrus\";\n case (int)HuntType.Alligator: return \"Alligator\";\n case (int)HuntType.Eagle: return \"Eagle\";\n //Publish 91 added:\n case (int)HuntType.MyrmidexLarvae: return \"Myrmidex Larvae\";\n case (int)HuntType.Najasaurus: return \"Najasaurus\";\n case (int)HuntType.Anchisaur: return \"Anchisaur\";\n case (int)HuntType.Allosaurus: return \"Allosaurus\";\n case (int)HuntType.Dimetrosaur: return \"Dimetrosaur\";\n case (int)HuntType.Saurosaurus: return \"Saurosaurus\";\n //Publish 95 added:\n case (int)HuntType.Tiger: return \"Tiger\";\n case (int)HuntType.MyrmidexDrone: return \"Myrmidex Drone\";\n case (int)HuntType.Triceratops: return \"Triceratops\";\n case (int)HuntType.Lion: return \"Lion\";\n case (int)HuntType.WhiteTiger: return \"White Tiger\";\n case (int)HuntType.BlackTiger: return \"Black Tiger\";\n //Publish 102 added:\n case (int)HuntType.Raptor: return \"Raptor\";\n case (int)HuntType.SeaSerpent: return \"Sea Serpent\";\n case (int)HuntType.Scorpion: return \"Scorpion\";\n }\n }\n }\n }\n}\n"} +{"text": "--TEST--\nTracing guzzle\n--SKIPIF--\n\n--INI--\nmolten.enable=1\nmolten.tracing_cli=1\nmolten.sink_type=2\nmolten.output_type=2\nmolten.service_name=test\nmolten.sampling_rate=1\nmolten.span_format=zipkin\n--FILE--\n 3.0]);\n$res = $client->request('GET', $path); \n\n?>\n--EXPECTF--\n{\"traceId\":\"%s\",\"name\":\"php_curl\",\"version\":\"%s\",\"id\":\"%s\",\"parentId\":\"%s\",\"timestamp\":%d,\"duration\":%d,\"annotations\":[{\"value\":\"cs\",\"timestamp\":%d,\"endpoint\":{\"serviceName\":\"test\",\"ipv4\":\"%s\"}},{\"value\":\"cr\",\"timestamp\":%d,\"endpoint\":{\"serviceName\":\"test\",\"ipv4\":\"%s\"}}],\"binaryAnnotations\":[{\"key\":\"http.url\",\"value\":\"http:\\/\\/localhost:8964\\/\",\"endpoint\":{\"serviceName\":\"test\",\"ipv4\":\"%s\"}},{\"key\":\"http.status\",\"value\":\"200\",\"endpoint\":{\"serviceName\":\"test\",\"ipv4\":\"%s\"}}]}\n{\"traceId\":\"%s\",\"name\":\"request\",\"version\":\"%s\",\"id\":\"%s\",\"parentId\":\"%s\",\"timestamp\":%d,\"duration\":%d,\"annotations\":[{\"value\":\"cs\",\"timestamp\":%d,\"endpoint\":{\"serviceName\":\"test\",\"ipv4\":\"%s\"}},{\"value\":\"cr\",\"timestamp\":%d,\"endpoint\":{\"serviceName\":\"test\",\"ipv4\":\"%s\"}}],\"binaryAnnotations\":[{\"key\":\"http.method\",\"value\":\"GET\",\"endpoint\":{\"serviceName\":\"test\",\"ipv4\":\"%s\"}},{\"key\":\"http.uri\",\"value\":\"http:\\/\\/localhost:8964\",\"endpoint\":{\"serviceName\":\"test\",\"ipv4\":\"%s\"}},{\"key\":\"http.status\",\"value\":\"200\",\"endpoint\":{\"serviceName\":\"test\",\"ipv4\":\"%s\"}},{\"key\":\"componet\",\"value\":\"GuzzleHttp\\\\Client\",\"endpoint\":{\"serviceName\":\"test\",\"ipv4\":\"%s\"}}]}\n{\"traceId\":\"%s\",\"name\":\"cli\",\"version\":\"%s\",\"id\":\"%s\",\"timestamp\":%d,\"duration\":%d,\"annotations\":[{\"value\":\"sr\",\"timestamp\":%d,\"endpoint\":{\"serviceName\":\"test\",\"ipv4\":\"%s\"}},{\"value\":\"ss\",\"timestamp\":%d,\"endpoint\":{\"serviceName\":\"test\",\"ipv4\":\"%s\"}}],\"binaryAnnotations\":[{\"key\":\"path\",\"value\":\"%s\",\"endpoint\":{\"serviceName\":\"test\",\"ipv4\":\"%s\"}}]}\n"} +{"text": "/*\n * Copyright (C) 2010-2013 Bluecherry, LLC \n *\n * Original author:\n * Ben Collins \n *\n * Additional work by:\n * John Brooks \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\n#include \"solo6x10.h\"\n#include \"solo6x10-tw28.h\"\n\nMODULE_DESCRIPTION(\"Softlogic 6x10 MPEG4/H.264/G.723 CODEC V4L2/ALSA Driver\");\nMODULE_AUTHOR(\"Bluecherry \");\nMODULE_VERSION(SOLO6X10_VERSION);\nMODULE_LICENSE(\"GPL\");\n\nunsigned video_nr = -1;\nmodule_param(video_nr, uint, 0644);\nMODULE_PARM_DESC(video_nr, \"videoX start number, -1 is autodetect (default)\");\n\nstatic int full_eeprom; /* default is only top 64B */\nmodule_param(full_eeprom, uint, 0644);\nMODULE_PARM_DESC(full_eeprom, \"Allow access to full 128B EEPROM (dangerous)\");\n\n\nstatic void solo_set_time(struct solo_dev *solo_dev)\n{\n\tstruct timespec ts;\n\n\tktime_get_ts(&ts);\n\n\tsolo_reg_write(solo_dev, SOLO_TIMER_SEC, ts.tv_sec);\n\tsolo_reg_write(solo_dev, SOLO_TIMER_USEC, ts.tv_nsec / NSEC_PER_USEC);\n}\n\nstatic void solo_timer_sync(struct solo_dev *solo_dev)\n{\n\tu32 sec, usec;\n\tstruct timespec ts;\n\tlong diff;\n\n\tif (solo_dev->type != SOLO_DEV_6110)\n\t\treturn;\n\n\tif (++solo_dev->time_sync < 60)\n\t\treturn;\n\n\tsolo_dev->time_sync = 0;\n\n\tsec = solo_reg_read(solo_dev, SOLO_TIMER_SEC);\n\tusec = solo_reg_read(solo_dev, SOLO_TIMER_USEC);\n\n\tktime_get_ts(&ts);\n\n\tdiff = (long)ts.tv_sec - (long)sec;\n\tdiff = (diff * 1000000)\n\t\t+ ((long)(ts.tv_nsec / NSEC_PER_USEC) - (long)usec);\n\n\tif (diff > 1000 || diff < -1000) {\n\t\tsolo_set_time(solo_dev);\n\t} else if (diff) {\n\t\tlong usec_lsb = solo_dev->usec_lsb;\n\n\t\tusec_lsb -= diff / 4;\n\t\tif (usec_lsb < 0)\n\t\t\tusec_lsb = 0;\n\t\telse if (usec_lsb > 255)\n\t\t\tusec_lsb = 255;\n\n\t\tsolo_dev->usec_lsb = usec_lsb;\n\t\tsolo_reg_write(solo_dev, SOLO_TIMER_USEC_LSB,\n\t\t\t solo_dev->usec_lsb);\n\t}\n}\n\nstatic irqreturn_t solo_isr(int irq, void *data)\n{\n\tstruct solo_dev *solo_dev = data;\n\tu32 status;\n\tint i;\n\n\tstatus = solo_reg_read(solo_dev, SOLO_IRQ_STAT);\n\tif (!status)\n\t\treturn IRQ_NONE;\n\n\tif (status & ~solo_dev->irq_mask) {\n\t\tsolo_reg_write(solo_dev, SOLO_IRQ_STAT,\n\t\t\t status & ~solo_dev->irq_mask);\n\t\tstatus &= solo_dev->irq_mask;\n\t}\n\n\tif (status & SOLO_IRQ_PCI_ERR)\n\t\tsolo_p2m_error_isr(solo_dev);\n\n\tfor (i = 0; i < SOLO_NR_P2M; i++)\n\t\tif (status & SOLO_IRQ_P2M(i))\n\t\t\tsolo_p2m_isr(solo_dev, i);\n\n\tif (status & SOLO_IRQ_IIC)\n\t\tsolo_i2c_isr(solo_dev);\n\n\tif (status & SOLO_IRQ_VIDEO_IN) {\n\t\tsolo_video_in_isr(solo_dev);\n\t\tsolo_timer_sync(solo_dev);\n\t}\n\n\tif (status & SOLO_IRQ_ENCODER)\n\t\tsolo_enc_v4l2_isr(solo_dev);\n\n\tif (status & SOLO_IRQ_G723)\n\t\tsolo_g723_isr(solo_dev);\n\n\t/* Clear all interrupts handled */\n\tsolo_reg_write(solo_dev, SOLO_IRQ_STAT, status);\n\n\treturn IRQ_HANDLED;\n}\n\nstatic void free_solo_dev(struct solo_dev *solo_dev)\n{\n\tstruct pci_dev *pdev;\n\n\tif (!solo_dev)\n\t\treturn;\n\n\tif (solo_dev->dev.parent)\n\t\tdevice_unregister(&solo_dev->dev);\n\n\tpdev = solo_dev->pdev;\n\n\t/* If we never initialized the PCI device, then nothing else\n\t * below here needs cleanup */\n\tif (!pdev) {\n\t\tkfree(solo_dev);\n\t\treturn;\n\t}\n\n\tif (solo_dev->reg_base) {\n\t\t/* Bring down the sub-devices first */\n\t\tsolo_g723_exit(solo_dev);\n\t\tsolo_enc_v4l2_exit(solo_dev);\n\t\tsolo_enc_exit(solo_dev);\n\t\tsolo_v4l2_exit(solo_dev);\n\t\tsolo_disp_exit(solo_dev);\n\t\tsolo_gpio_exit(solo_dev);\n\t\tsolo_p2m_exit(solo_dev);\n\t\tsolo_i2c_exit(solo_dev);\n\n\t\t/* Now cleanup the PCI device */\n\t\tsolo_irq_off(solo_dev, ~0);\n\t\tpci_iounmap(pdev, solo_dev->reg_base);\n\t\tif (pdev->irq)\n\t\t\tfree_irq(pdev->irq, solo_dev);\n\t}\n\n\tpci_release_regions(pdev);\n\tpci_disable_device(pdev);\n\tv4l2_device_unregister(&solo_dev->v4l2_dev);\n\tpci_set_drvdata(pdev, NULL);\n\n\tkfree(solo_dev);\n}\n\nstatic ssize_t eeprom_store(struct device *dev, struct device_attribute *attr,\n\t\t\t const char *buf, size_t count)\n{\n\tstruct solo_dev *solo_dev =\n\t\tcontainer_of(dev, struct solo_dev, dev);\n\tunsigned short *p = (unsigned short *)buf;\n\tint i;\n\n\tif (count & 0x1)\n\t\tdev_warn(dev, \"EEPROM Write not aligned (truncating)\\n\");\n\n\tif (!full_eeprom && count > 64) {\n\t\tdev_warn(dev, \"EEPROM Write truncated to 64 bytes\\n\");\n\t\tcount = 64;\n\t} else if (full_eeprom && count > 128) {\n\t\tdev_warn(dev, \"EEPROM Write truncated to 128 bytes\\n\");\n\t\tcount = 128;\n\t}\n\n\tsolo_eeprom_ewen(solo_dev, 1);\n\n\tfor (i = full_eeprom ? 0 : 32; i < min((int)(full_eeprom ? 64 : 32),\n\t\t\t\t\t (int)(count / 2)); i++)\n\t\tsolo_eeprom_write(solo_dev, i, cpu_to_be16(p[i]));\n\n\tsolo_eeprom_ewen(solo_dev, 0);\n\n\treturn count;\n}\n\nstatic ssize_t eeprom_show(struct device *dev, struct device_attribute *attr,\n\t\t\t char *buf)\n{\n\tstruct solo_dev *solo_dev =\n\t\tcontainer_of(dev, struct solo_dev, dev);\n\tunsigned short *p = (unsigned short *)buf;\n\tint count = (full_eeprom ? 128 : 64);\n\tint i;\n\n\tfor (i = (full_eeprom ? 0 : 32); i < (count / 2); i++)\n\t\tp[i] = be16_to_cpu(solo_eeprom_read(solo_dev, i));\n\n\treturn count;\n}\n\nstatic ssize_t p2m_timeouts_show(struct device *dev,\n\t\t\t\t struct device_attribute *attr,\n\t\t\t\t char *buf)\n{\n\tstruct solo_dev *solo_dev =\n\t\tcontainer_of(dev, struct solo_dev, dev);\n\n\treturn sprintf(buf, \"%d\\n\", solo_dev->p2m_timeouts);\n}\n\nstatic ssize_t sdram_size_show(struct device *dev,\n\t\t\t struct device_attribute *attr,\n\t\t\t char *buf)\n{\n\tstruct solo_dev *solo_dev =\n\t\tcontainer_of(dev, struct solo_dev, dev);\n\n\treturn sprintf(buf, \"%dMegs\\n\", solo_dev->sdram_size >> 20);\n}\n\nstatic ssize_t tw28xx_show(struct device *dev,\n\t\t\t struct device_attribute *attr,\n\t\t\t char *buf)\n{\n\tstruct solo_dev *solo_dev =\n\t\tcontainer_of(dev, struct solo_dev, dev);\n\n\treturn sprintf(buf, \"tw2815[%d] tw2864[%d] tw2865[%d]\\n\",\n\t\t hweight32(solo_dev->tw2815),\n\t\t hweight32(solo_dev->tw2864),\n\t\t hweight32(solo_dev->tw2865));\n}\n\nstatic ssize_t input_map_show(struct device *dev,\n\t\t\t struct device_attribute *attr,\n\t\t\t char *buf)\n{\n\tstruct solo_dev *solo_dev =\n\t\tcontainer_of(dev, struct solo_dev, dev);\n\tunsigned int val;\n\tchar *out = buf;\n\n\tval = solo_reg_read(solo_dev, SOLO_VI_CH_SWITCH_0);\n\tout += sprintf(out, \"Channel 0 => Input %d\\n\", val & 0x1f);\n\tout += sprintf(out, \"Channel 1 => Input %d\\n\", (val >> 5) & 0x1f);\n\tout += sprintf(out, \"Channel 2 => Input %d\\n\", (val >> 10) & 0x1f);\n\tout += sprintf(out, \"Channel 3 => Input %d\\n\", (val >> 15) & 0x1f);\n\tout += sprintf(out, \"Channel 4 => Input %d\\n\", (val >> 20) & 0x1f);\n\tout += sprintf(out, \"Channel 5 => Input %d\\n\", (val >> 25) & 0x1f);\n\n\tval = solo_reg_read(solo_dev, SOLO_VI_CH_SWITCH_1);\n\tout += sprintf(out, \"Channel 6 => Input %d\\n\", val & 0x1f);\n\tout += sprintf(out, \"Channel 7 => Input %d\\n\", (val >> 5) & 0x1f);\n\tout += sprintf(out, \"Channel 8 => Input %d\\n\", (val >> 10) & 0x1f);\n\tout += sprintf(out, \"Channel 9 => Input %d\\n\", (val >> 15) & 0x1f);\n\tout += sprintf(out, \"Channel 10 => Input %d\\n\", (val >> 20) & 0x1f);\n\tout += sprintf(out, \"Channel 11 => Input %d\\n\", (val >> 25) & 0x1f);\n\n\tval = solo_reg_read(solo_dev, SOLO_VI_CH_SWITCH_2);\n\tout += sprintf(out, \"Channel 12 => Input %d\\n\", val & 0x1f);\n\tout += sprintf(out, \"Channel 13 => Input %d\\n\", (val >> 5) & 0x1f);\n\tout += sprintf(out, \"Channel 14 => Input %d\\n\", (val >> 10) & 0x1f);\n\tout += sprintf(out, \"Channel 15 => Input %d\\n\", (val >> 15) & 0x1f);\n\tout += sprintf(out, \"Spot Output => Input %d\\n\", (val >> 20) & 0x1f);\n\n\treturn out - buf;\n}\n\nstatic ssize_t p2m_timeout_store(struct device *dev,\n\t\t\t\t struct device_attribute *attr,\n\t\t\t\t const char *buf, size_t count)\n{\n\tstruct solo_dev *solo_dev =\n\t\tcontainer_of(dev, struct solo_dev, dev);\n\tunsigned long ms;\n\n\tint ret = kstrtoul(buf, 10, &ms);\n\tif (ret < 0 || ms > 200)\n\t\treturn -EINVAL;\n\tsolo_dev->p2m_jiffies = msecs_to_jiffies(ms);\n\n\treturn count;\n}\n\nstatic ssize_t p2m_timeout_show(struct device *dev,\n\t\t\t\tstruct device_attribute *attr,\n\t\t\t\tchar *buf)\n{\n\tstruct solo_dev *solo_dev =\n\t\tcontainer_of(dev, struct solo_dev, dev);\n\n\treturn sprintf(buf, \"%ums\\n\", jiffies_to_msecs(solo_dev->p2m_jiffies));\n}\n\nstatic ssize_t intervals_show(struct device *dev,\n\t\t\t struct device_attribute *attr,\n\t\t\t char *buf)\n{\n\tstruct solo_dev *solo_dev =\n\t\tcontainer_of(dev, struct solo_dev, dev);\n\tchar *out = buf;\n\tint fps = solo_dev->fps;\n\tint i;\n\n\tfor (i = 0; i < solo_dev->nr_chans; i++) {\n\t\tout += sprintf(out, \"Channel %d: %d/%d (0x%08x)\\n\",\n\t\t\t i, solo_dev->v4l2_enc[i]->interval, fps,\n\t\t\t solo_reg_read(solo_dev, SOLO_CAP_CH_INTV(i)));\n\t}\n\n\treturn out - buf;\n}\n\nstatic ssize_t sdram_offsets_show(struct device *dev,\n\t\t\t\t struct device_attribute *attr,\n\t\t\t\t char *buf)\n{\n\tstruct solo_dev *solo_dev =\n\t\tcontainer_of(dev, struct solo_dev, dev);\n\tchar *out = buf;\n\n\tout += sprintf(out, \"DISP: 0x%08x @ 0x%08x\\n\",\n\t\t SOLO_DISP_EXT_ADDR,\n\t\t SOLO_DISP_EXT_SIZE);\n\n\tout += sprintf(out, \"EOSD: 0x%08x @ 0x%08x (0x%08x * %d)\\n\",\n\t\t SOLO_EOSD_EXT_ADDR,\n\t\t SOLO_EOSD_EXT_AREA(solo_dev),\n\t\t SOLO_EOSD_EXT_SIZE(solo_dev),\n\t\t SOLO_EOSD_EXT_AREA(solo_dev) /\n\t\t SOLO_EOSD_EXT_SIZE(solo_dev));\n\n\tout += sprintf(out, \"MOTI: 0x%08x @ 0x%08x\\n\",\n\t\t SOLO_MOTION_EXT_ADDR(solo_dev),\n\t\t SOLO_MOTION_EXT_SIZE);\n\n\tout += sprintf(out, \"G723: 0x%08x @ 0x%08x\\n\",\n\t\t SOLO_G723_EXT_ADDR(solo_dev),\n\t\t SOLO_G723_EXT_SIZE);\n\n\tout += sprintf(out, \"CAPT: 0x%08x @ 0x%08x (0x%08x * %d)\\n\",\n\t\t SOLO_CAP_EXT_ADDR(solo_dev),\n\t\t SOLO_CAP_EXT_SIZE(solo_dev),\n\t\t SOLO_CAP_PAGE_SIZE,\n\t\t SOLO_CAP_EXT_SIZE(solo_dev) / SOLO_CAP_PAGE_SIZE);\n\n\tout += sprintf(out, \"EREF: 0x%08x @ 0x%08x (0x%08x * %d)\\n\",\n\t\t SOLO_EREF_EXT_ADDR(solo_dev),\n\t\t SOLO_EREF_EXT_AREA(solo_dev),\n\t\t SOLO_EREF_EXT_SIZE,\n\t\t SOLO_EREF_EXT_AREA(solo_dev) / SOLO_EREF_EXT_SIZE);\n\n\tout += sprintf(out, \"MPEG: 0x%08x @ 0x%08x\\n\",\n\t\t SOLO_MP4E_EXT_ADDR(solo_dev),\n\t\t SOLO_MP4E_EXT_SIZE(solo_dev));\n\n\tout += sprintf(out, \"JPEG: 0x%08x @ 0x%08x\\n\",\n\t\t SOLO_JPEG_EXT_ADDR(solo_dev),\n\t\t SOLO_JPEG_EXT_SIZE(solo_dev));\n\n\treturn out - buf;\n}\n\nstatic ssize_t sdram_show(struct file *file, struct kobject *kobj,\n\t\t\t struct bin_attribute *a, char *buf,\n\t\t\t loff_t off, size_t count)\n{\n\tstruct device *dev = container_of(kobj, struct device, kobj);\n\tstruct solo_dev *solo_dev =\n\t\tcontainer_of(dev, struct solo_dev, dev);\n\tconst int size = solo_dev->sdram_size;\n\n\tif (off >= size)\n\t\treturn 0;\n\n\tif (off + count > size)\n\t\tcount = size - off;\n\n\tif (solo_p2m_dma(solo_dev, 0, buf, off, count, 0, 0))\n\t\treturn -EIO;\n\n\treturn count;\n}\n\nstatic const struct device_attribute solo_dev_attrs[] = {\n\t__ATTR(eeprom, 0640, eeprom_show, eeprom_store),\n\t__ATTR(p2m_timeout, 0644, p2m_timeout_show, p2m_timeout_store),\n\t__ATTR_RO(p2m_timeouts),\n\t__ATTR_RO(sdram_size),\n\t__ATTR_RO(tw28xx),\n\t__ATTR_RO(input_map),\n\t__ATTR_RO(intervals),\n\t__ATTR_RO(sdram_offsets),\n};\n\nstatic void solo_device_release(struct device *dev)\n{\n\t/* Do nothing */\n}\n\nstatic int solo_sysfs_init(struct solo_dev *solo_dev)\n{\n\tstruct bin_attribute *sdram_attr = &solo_dev->sdram_attr;\n\tstruct device *dev = &solo_dev->dev;\n\tconst char *driver;\n\tint i;\n\n\tif (solo_dev->type == SOLO_DEV_6110)\n\t\tdriver = \"solo6110\";\n\telse\n\t\tdriver = \"solo6010\";\n\n\tdev->release = solo_device_release;\n\tdev->parent = &solo_dev->pdev->dev;\n\tset_dev_node(dev, dev_to_node(&solo_dev->pdev->dev));\n\tdev_set_name(dev, \"%s-%d-%d\", driver, solo_dev->vfd->num,\n\t\t solo_dev->nr_chans);\n\n\tif (device_register(dev)) {\n\t\tdev->parent = NULL;\n\t\treturn -ENOMEM;\n\t}\n\n\tfor (i = 0; i < ARRAY_SIZE(solo_dev_attrs); i++) {\n\t\tif (device_create_file(dev, &solo_dev_attrs[i])) {\n\t\t\tdevice_unregister(dev);\n\t\t\treturn -ENOMEM;\n\t\t}\n\t}\n\n\tsysfs_attr_init(&sdram_attr->attr);\n\tsdram_attr->attr.name = \"sdram\";\n\tsdram_attr->attr.mode = 0440;\n\tsdram_attr->read = sdram_show;\n\tsdram_attr->size = solo_dev->sdram_size;\n\n\tif (device_create_bin_file(dev, sdram_attr)) {\n\t\tdevice_unregister(dev);\n\t\treturn -ENOMEM;\n\t}\n\n\treturn 0;\n}\n\nstatic int solo_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)\n{\n\tstruct solo_dev *solo_dev;\n\tint ret;\n\tu8 chip_id;\n\n\tsolo_dev = kzalloc(sizeof(*solo_dev), GFP_KERNEL);\n\tif (solo_dev == NULL)\n\t\treturn -ENOMEM;\n\n\tif (id->driver_data == SOLO_DEV_6010)\n\t\tdev_info(&pdev->dev, \"Probing Softlogic 6010\\n\");\n\telse\n\t\tdev_info(&pdev->dev, \"Probing Softlogic 6110\\n\");\n\n\tsolo_dev->type = id->driver_data;\n\tsolo_dev->pdev = pdev;\n\tspin_lock_init(&solo_dev->reg_io_lock);\n\tret = v4l2_device_register(&pdev->dev, &solo_dev->v4l2_dev);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\t/* Only for during init */\n\tsolo_dev->p2m_jiffies = msecs_to_jiffies(100);\n\n\tret = pci_enable_device(pdev);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\tpci_set_master(pdev);\n\n\t/* RETRY/TRDY Timeout disabled */\n\tpci_write_config_byte(pdev, 0x40, 0x00);\n\tpci_write_config_byte(pdev, 0x41, 0x00);\n\n\tret = pci_request_regions(pdev, SOLO6X10_NAME);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\tsolo_dev->reg_base = pci_ioremap_bar(pdev, 0);\n\tif (solo_dev->reg_base == NULL) {\n\t\tret = -ENOMEM;\n\t\tgoto fail_probe;\n\t}\n\n\tchip_id = solo_reg_read(solo_dev, SOLO_CHIP_OPTION) &\n\t\t\t\tSOLO_CHIP_ID_MASK;\n\tswitch (chip_id) {\n\tcase 7:\n\t\tsolo_dev->nr_chans = 16;\n\t\tsolo_dev->nr_ext = 5;\n\t\tbreak;\n\tcase 6:\n\t\tsolo_dev->nr_chans = 8;\n\t\tsolo_dev->nr_ext = 2;\n\t\tbreak;\n\tdefault:\n\t\tdev_warn(&pdev->dev, \"Invalid chip_id 0x%02x, assuming 4 ch\\n\",\n\t\t\t chip_id);\n\tcase 5:\n\t\tsolo_dev->nr_chans = 4;\n\t\tsolo_dev->nr_ext = 1;\n\t}\n\n\t/* Disable all interrupts to start */\n\tsolo_irq_off(solo_dev, ~0);\n\n\t/* Initial global settings */\n\tif (solo_dev->type == SOLO_DEV_6010) {\n\t\tsolo_dev->clock_mhz = 108;\n\t\tsolo_dev->sys_config = SOLO_SYS_CFG_SDRAM64BIT\n\t\t\t| SOLO_SYS_CFG_INPUTDIV(25)\n\t\t\t| SOLO_SYS_CFG_FEEDBACKDIV(solo_dev->clock_mhz * 2 - 2)\n\t\t\t| SOLO_SYS_CFG_OUTDIV(3);\n\t\tsolo_reg_write(solo_dev, SOLO_SYS_CFG, solo_dev->sys_config);\n\t} else {\n\t\tu32 divq, divf;\n\n\t\tsolo_dev->clock_mhz = 135;\n\n\t\tif (solo_dev->clock_mhz < 125) {\n\t\t\tdivq = 3;\n\t\t\tdivf = (solo_dev->clock_mhz * 4) / 3 - 1;\n\t\t} else {\n\t\t\tdivq = 2;\n\t\t\tdivf = (solo_dev->clock_mhz * 2) / 3 - 1;\n\t\t}\n\n\t\tsolo_reg_write(solo_dev, SOLO_PLL_CONFIG,\n\t\t\t (1 << 20) | /* PLL_RANGE */\n\t\t\t (8 << 15) | /* PLL_DIVR */\n\t\t\t (divq << 12) |\n\t\t\t (divf << 4) |\n\t\t\t (1 << 1) /* PLL_FSEN */);\n\n\t\tsolo_dev->sys_config = SOLO_SYS_CFG_SDRAM64BIT;\n\t}\n\n\tsolo_reg_write(solo_dev, SOLO_SYS_CFG, solo_dev->sys_config);\n\tsolo_reg_write(solo_dev, SOLO_TIMER_CLOCK_NUM,\n\t\t solo_dev->clock_mhz - 1);\n\n\t/* PLL locking time of 1ms */\n\tmdelay(1);\n\n\tret = request_irq(pdev->irq, solo_isr, IRQF_SHARED, SOLO6X10_NAME,\n\t\t\t solo_dev);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\t/* Handle this from the start */\n\tsolo_irq_on(solo_dev, SOLO_IRQ_PCI_ERR);\n\n\tret = solo_i2c_init(solo_dev);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\t/* Setup the DMA engine */\n\tsolo_reg_write(solo_dev, SOLO_DMA_CTRL,\n\t\t SOLO_DMA_CTRL_REFRESH_CYCLE(1) |\n\t\t SOLO_DMA_CTRL_SDRAM_SIZE(2) |\n\t\t SOLO_DMA_CTRL_SDRAM_CLK_INVERT |\n\t\t SOLO_DMA_CTRL_READ_CLK_SELECT |\n\t\t SOLO_DMA_CTRL_LATENCY(1));\n\n\t/* Undocumented crap */\n\tsolo_reg_write(solo_dev, SOLO_DMA_CTRL1,\n\t\t solo_dev->type == SOLO_DEV_6010 ? 0x100 : 0x300);\n\n\tif (solo_dev->type != SOLO_DEV_6010) {\n\t\tsolo_dev->usec_lsb = 0x3f;\n\t\tsolo_set_time(solo_dev);\n\t}\n\n\t/* Disable watchdog */\n\tsolo_reg_write(solo_dev, SOLO_WATCHDOG, 0);\n\n\t/* Initialize sub components */\n\n\tret = solo_p2m_init(solo_dev);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\tret = solo_disp_init(solo_dev);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\tret = solo_gpio_init(solo_dev);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\tret = solo_tw28_init(solo_dev);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\tret = solo_v4l2_init(solo_dev, video_nr);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\tret = solo_enc_init(solo_dev);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\tret = solo_enc_v4l2_init(solo_dev, video_nr);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\tret = solo_g723_init(solo_dev);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\tret = solo_sysfs_init(solo_dev);\n\tif (ret)\n\t\tgoto fail_probe;\n\n\t/* Now that init is over, set this lower */\n\tsolo_dev->p2m_jiffies = msecs_to_jiffies(20);\n\n\treturn 0;\n\nfail_probe:\n\tfree_solo_dev(solo_dev);\n\treturn ret;\n}\n\nstatic void solo_pci_remove(struct pci_dev *pdev)\n{\n\tstruct v4l2_device *v4l2_dev = pci_get_drvdata(pdev);\n\tstruct solo_dev *solo_dev = container_of(v4l2_dev, struct solo_dev, v4l2_dev);\n\n\tfree_solo_dev(solo_dev);\n}\n\nstatic DEFINE_PCI_DEVICE_TABLE(solo_id_table) = {\n\t/* 6010 based cards */\n\t{ PCI_DEVICE(PCI_VENDOR_ID_SOFTLOGIC, PCI_DEVICE_ID_SOLO6010),\n\t .driver_data = SOLO_DEV_6010 },\n\t{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_NEUSOLO_4),\n\t .driver_data = SOLO_DEV_6010 },\n\t{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_NEUSOLO_9),\n\t .driver_data = SOLO_DEV_6010 },\n\t{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_NEUSOLO_16),\n\t .driver_data = SOLO_DEV_6010 },\n\t{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_BC_SOLO_4),\n\t .driver_data = SOLO_DEV_6010 },\n\t{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_BC_SOLO_9),\n\t .driver_data = SOLO_DEV_6010 },\n\t{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_BC_SOLO_16),\n\t .driver_data = SOLO_DEV_6010 },\n\t/* 6110 based cards */\n\t{ PCI_DEVICE(PCI_VENDOR_ID_SOFTLOGIC, PCI_DEVICE_ID_SOLO6110),\n\t .driver_data = SOLO_DEV_6110 },\n\t{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_BC_6110_4),\n\t .driver_data = SOLO_DEV_6110 },\n\t{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_BC_6110_8),\n\t .driver_data = SOLO_DEV_6110 },\n\t{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_BC_6110_16),\n\t .driver_data = SOLO_DEV_6110 },\n\t{0,}\n};\n\nMODULE_DEVICE_TABLE(pci, solo_id_table);\n\nstatic struct pci_driver solo_pci_driver = {\n\t.name = SOLO6X10_NAME,\n\t.id_table = solo_id_table,\n\t.probe = solo_pci_probe,\n\t.remove = solo_pci_remove,\n};\n\nmodule_pci_driver(solo_pci_driver);\n"} +{"text": "\n\n \n \n \n \n \n"} +{"text": "/*\n * Copyright © 2010-2012 Philipp Eichhorn\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\npackage lombok.javac.handlers;\n\nimport static lombok.core.util.ErrorMessages.*;\nimport static lombok.core.util.Names.*;\nimport static lombok.javac.handlers.JavacHandlerUtil.*;\n\nimport lombok.*;\nimport lombok.core.AnnotationValues;\nimport lombok.core.handlers.BuilderAndExtensionHandler;\nimport lombok.javac.JavacAnnotationHandler;\nimport lombok.javac.JavacNode;\nimport lombok.javac.handlers.ast.JavacField;\nimport lombok.javac.handlers.ast.JavacMethod;\nimport lombok.javac.handlers.ast.JavacType;\n\nimport com.sun.tools.javac.tree.JCTree.JCAnnotation;\nimport org.mangosdk.spi.ProviderFor;\n\npublic class HandleBuilderAndExtension {\n\n\t/**\n\t * Handles the {@code lombok.Builder} annotation for javac.\n\t */\n\t@ProviderFor(JavacAnnotationHandler.class)\n\tpublic static class HandleBuilder extends JavacAnnotationHandler {\n\n\t\t@Override\n\t\tpublic void handle(final AnnotationValues annotation, final JCAnnotation source, final JavacNode annotationNode) {\n\t\t\tdeleteAnnotationIfNeccessary(annotationNode, Builder.class);\n\t\t\tfinal JavacType type = JavacType.typeOf(annotationNode, source);\n\n\t\t\tif (type.isInterface() || type.isEnum() || type.isAnnotation()) {\n\t\t\t\tannotationNode.addError(canBeUsedOnClassOnly(Builder.class));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tswitch (methodExists(decapitalize(type.name()), type.node(), false, 0)) {\n\t\t\tcase EXISTS_BY_LOMBOK:\n\t\t\t\treturn;\n\t\t\tcase EXISTS_BY_USER:\n\t\t\t\tfinal String message = \"Not generating 'public static %s %s()' A method with that name already exists\";\n\t\t\t\tannotationNode.addWarning(String.format(message, BuilderAndExtensionHandler.BUILDER, decapitalize(type.name())));\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t\tcase NOT_EXISTS:\n\t\t\t\t// continue with creating the builder\n\t\t\t}\n\n\t\t\tnew BuilderAndExtensionHandler().handleBuilder(type, annotation.getInstance());\n\t\t}\n\t}\n\n\t/**\n\t * Handles the {@code lombok.Builder.Extension} annotation for javac.\n\t */\n\t@ProviderFor(JavacAnnotationHandler.class)\n\tpublic static class HandleBuilderExtension extends JavacAnnotationHandler {\n\n\t\t@Override\n\t\tpublic void handle(final AnnotationValues annotation, final JCAnnotation source, final JavacNode annotationNode) {\n\t\t\tif (inNetbeansEditor(annotationNode)) return;\n\t\t\tdeleteAnnotationIfNeccessary(annotationNode, Builder.Extension.class);\n\n\t\t\tfinal JavacMethod method = JavacMethod.methodOf(annotationNode, source);\n\n\t\t\tif (method == null) {\n\t\t\t\tannotationNode.addError(canBeUsedOnMethodOnly(Builder.Extension.class));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (method.isAbstract() || method.isEmpty()) {\n\t\t\t\tannotationNode.addError(canBeUsedOnConcreteMethodOnly(Builder.Extension.class));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tJavacType type = JavacType.typeOf(annotationNode, source);\n\t\t\tJavacNode builderNode = type.getAnnotation(Builder.class);\n\n\t\t\tif (builderNode == null) {\n\t\t\t\tannotationNode.addError(\"@Builder.Extension is only allowed in types annotated with @Builder\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tAnnotationValues builderAnnotation = createAnnotation(Builder.class, builderNode);\n\n\t\t\tif (!type.hasMethod(decapitalize(type.name()))) {\n\t\t\t\tnew HandleBuilder().handle(builderAnnotation, (JCAnnotation) builderNode.get(), builderNode);\n\t\t\t}\n\n\t\t\tnew BuilderAndExtensionHandler().handleExtension(type, method, new JavacParameterValidator(), new JavacParameterSanitizer(), builderAnnotation.getInstance(), annotation.getInstance());\n\t\t}\n\t}\n}\n"} +{"text": "\nvoid foobar()\n {\n int x;\n int* x_ptr;\n }\n"} +{"text": "// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF\n// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A\n// PARTICULAR PURPOSE.\n//\n// Copyright (c) Microsoft Corporation. All rights reserved\n\n//\n// Scenario1Input.xaml.cpp\n// Implementation of the Scenario1Input class\n//\n\n#include \"pch.h\"\n#include \"ScenarioInput1.xaml.h\"\n\nusing namespace RawNotificationsSampleCPP;\n\nusing namespace concurrency;\nusing namespace Platform;\nusing namespace Windows::ApplicationModel::Background;\nusing namespace Windows::Foundation;\nusing namespace Windows::Foundation::Collections;\nusing namespace Windows::Graphics::Display;\nusing namespace Windows::Networking::PushNotifications;\nusing namespace Windows::Storage;\nusing namespace Windows::UI::Core;\nusing namespace Windows::UI::ViewManagement;\nusing namespace Windows::UI::Xaml;\nusing namespace Windows::UI::Xaml::Controls;\nusing namespace Windows::UI::Xaml::Controls::Primitives;\nusing namespace Windows::UI::Xaml::Data;\nusing namespace Windows::UI::Xaml::Input;\nusing namespace Windows::UI::Xaml::Media;\nusing namespace Windows::UI::Xaml::Navigation;\n\nconst wchar_t* SAMPLE_TASK_NAME = L\"SampleBackgroundTask\";\nconst wchar_t* SAMPLE_TASK_ENTRY_POINT = L\"BackgroundTasks.SampleBackgroundTask\";\n\nScenarioInput1::ScenarioInput1()\n{\n\tInitializeComponent();\n _dispatcher = Window::Current->Dispatcher;\n}\n\nScenarioInput1::~ScenarioInput1()\n{\n}\n\nvoid ScenarioInput1::OnNavigatedTo(NavigationEventArgs^ e)\n{\n\t// Get a pointer to our main page.\n\trootPage = dynamic_cast(e->Parameter);\n\t_frameLoadedToken = rootPage->OutputFrameLoaded += ref new EventHandler(this, &ScenarioInput1::OutputFrameLoaded);\n}\n\nvoid ScenarioInput1::OutputFrameLoaded(Object^ sender, Object^ e)\n{\n\tif (rootPage->Channel != nullptr)\n\t{\n\t\tOutputToTextBox(rootPage->Channel->Uri);\n\t}\n}\n\nvoid ScenarioInput1::OnNavigatedFrom(NavigationEventArgs^ e)\n{\n\trootPage->OutputFrameLoaded -= _frameLoadedToken;\n}\n\nvoid ScenarioInput1::OutputToTextBox(String^ text)\n{\n // Find the output text box on the page\n auto outputFrame = dynamic_cast(rootPage->OutputFrame->Content);\n auto textBox = dynamic_cast(outputFrame->FindName(\"Scenario1ChannelOutput\"));\n\n // Write text\n textBox->Text = text;\n}\n\nvoid ScenarioInput1::Scenario1Open_Click(Object^ sender, RoutedEventArgs^ e)\n{\n // Applications must have lock screen privileges in order to receive raw notifications\n create_task(BackgroundExecutionManager::RequestAccessAsync()).then([this] (BackgroundAccessStatus backgroundStatus)\n\t{\n // Make sure the user allowed privileges\n if (backgroundStatus != BackgroundAccessStatus::Denied && backgroundStatus != BackgroundAccessStatus::Unspecified)\n {\n OpenChannelAndRegisterTask();\n }\n else\n {\n // This event comes back in a background thread, so we need to move to the UI thread to access any UI elements\n rootPage->NotifyUser(\"Lock screen access is denied.\", NotifyType::ErrorMessage);\n }\n });\n}\n\nvoid ScenarioInput1::Scenario1Unregister_Click(Object^ sender, RoutedEventArgs^ e)\n{\n\tif (UnregisterBackgroundTask())\n {\n rootPage->NotifyUser(\"Task unregistered\", NotifyType::StatusMessage);\n }\n else\n {\n rootPage->NotifyUser(\"No task is registered\", NotifyType::ErrorMessage);\n }\n}\n\nvoid ScenarioInput1::OpenChannelAndRegisterTask()\n{\n\t// Clear out the task just for the purpose of this sample\n\tUnregisterBackgroundTask();\n\n // Open the channel. See the \"Push and Polling Notifications\" sample for more detail\n\t\n\tif (rootPage->Channel == nullptr) {\n\t\tcreate_task(PushNotificationChannelManager::CreatePushNotificationChannelForApplicationAsync()).then([this] (task channelTask)\n\t\t{\n\t\t\tPushNotificationChannel^ newChannel;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tnewChannel = channelTask.get();\n\t\t\t}\n\t\t\tcatch (Exception^ ex)\n\t\t\t{\n\t\t\t\trootPage->NotifyUser(\"Could not create a channel. Error: \" + ex->Message, NotifyType::ErrorMessage);\n\t\t\t}\n\n\t\t\tif (newChannel != nullptr)\n\t\t\t{\n\t\t\t\t// This event comes back in a background thread, so we need to move to the UI thread to access any UI elements\n\t\t\t\tOutputToTextBox(newChannel->Uri);\n\t\t\t\trootPage->NotifyUser(\"Channel request succeeded!\", NotifyType::StatusMessage);\n \n\t\t\t\trootPage->Channel = newChannel;\n\n\t\t\t\tRegisterBackgroundTask();\n\t\t\t\trootPage->NotifyUser(\"Task registered\", NotifyType::StatusMessage);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tRegisterBackgroundTask();\n\t\trootPage->NotifyUser(\"Task registered\", NotifyType::StatusMessage);\n\t}\n}\n\nvoid ScenarioInput1::RegisterBackgroundTask()\n{\n auto taskBuilder = ref new BackgroundTaskBuilder();\n auto trigger = ref new PushNotificationTrigger();\n taskBuilder->SetTrigger(trigger);\n\n // Background tasks must live in separate DLL, and be included in the package manifest\n // Also, make sure that your main application project includes a reference to this DLL\n taskBuilder->TaskEntryPoint = ref new String(SAMPLE_TASK_ENTRY_POINT);\n taskBuilder->Name = ref new String(SAMPLE_TASK_NAME);\n \n\tBackgroundTaskRegistration^ task;\n\ttry\n\t{\n\t\ttask = taskBuilder->Register();\n\t}\n\tcatch (Exception^ ex)\n\t{\n\t\trootPage->NotifyUser(\"Registration error: \" + ex->Message, NotifyType::ErrorMessage);\n\t\tUnregisterBackgroundTask();\n\t}\n\n\tif (task != nullptr)\n\t{\n\t\ttask->Completed += ref new BackgroundTaskCompletedEventHandler(this, &ScenarioInput1::BackgroundTaskCompleted);\n\t}\n}\n\nbool ScenarioInput1::UnregisterBackgroundTask()\n{\n\tauto iter = BackgroundTaskRegistration::AllTasks->First();\n\twhile (iter->HasCurrent)\n\t{\n\t\tauto task = iter->Current->Value;\n\t\tif (task->Name == ref new String(SAMPLE_TASK_NAME))\n\t\t{\n\t\t\ttask->Unregister(true);\n\t\t\treturn true;\n\t\t}\n\t\titer->MoveNext();\n\t}\n\n\treturn false;\n}\n\nvoid ScenarioInput1::BackgroundTaskCompleted(BackgroundTaskRegistration^ sender, BackgroundTaskCompletedEventArgs^ args)\n{\n try\n {\n // This sample assumes the payload is a string, but it can be of any type.\n auto payload = dynamic_cast(ApplicationData::Current->LocalSettings->Values->Lookup(ref new String(SAMPLE_TASK_NAME)));\n _dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, payload] () {\n rootPage->NotifyUser(\"Background work item triggered by raw notification with payload = \" + payload + \" has completed!\", NotifyType::StatusMessage);\n }, CallbackContext::Any));\n } \n catch (Exception^ ex)\n {\n _dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this] () {\n rootPage->NotifyUser(\"Failed to retrieve background payload\", NotifyType::ErrorMessage);\n }, CallbackContext::Any));\n }\n}"} +{"text": "/*\n * Copyright 2013-2020 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.cloudfoundry.client.v2.serviceplanvisibilities;\n\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport org.cloudfoundry.client.v2.jobs.AbstractJobResource;\nimport org.immutables.value.Value;\n\n/**\n * The response for Delete Service Plan Visibility oepration\n */\n@JsonDeserialize\n@Value.Immutable\nabstract class _DeleteServicePlanVisibilityResponse extends AbstractJobResource {\n\n}\n"} +{"text": "/* Copyright 2013-present Barefoot Networks, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Antonin Bas (antonin@barefootnetworks.com)\n *\n */\n\n#ifndef PI_CLI_TABLE_COMMON_H_\n#define PI_CLI_TABLE_COMMON_H_\n\n#include \"error_codes.h\"\n\n#include \"PI/pi.h\"\n\nextern const pi_p4info_t *p4info_curr;\nextern pi_dev_tgt_t dev_tgt;\nextern pi_session_handle_t sess;\n\npi_cli_status_t read_match_fields(char *in, pi_p4_id_t t_id,\n pi_match_key_t *mk);\n\npi_cli_status_t read_match_key_with_priority(char *in, pi_p4_id_t t_id,\n pi_match_key_t *mk,\n const char *end);\n\npi_cli_status_t read_action_data(char *in, pi_p4_id_t a_id,\n pi_action_data_t *adata);\n\nvoid print_action_data(const pi_action_data_t *action_data);\n\nchar *complete_table(const char *text, int state);\nchar *complete_table_and_action(const char *text, int state);\n\npi_cli_status_t get_entry_direct(pi_table_entry_t *t_entry);\npi_cli_status_t get_entry_indirect(pi_table_entry_t *t_entry);\nvoid cleanup_entry_direct(pi_table_entry_t *t_entry);\nvoid cleanup_entry_indirect(pi_table_entry_t *t_entry);\n\n// takes ownership of config\nvoid store_direct_resource_config(pi_p4_id_t res_id, void *config);\npi_direct_res_config_one_t *retrieve_direct_resource_configs(\n size_t *num_configs);\nvoid reset_direct_resource_configs();\n\n#endif // PI_CLI_TABLE_COMMON_H_\n"} +{"text": "{\n \"name\": \"Text outside tags\",\n \"options\": {},\n \"html\": \"Line one\\n
\\nline two\",\n \"expected\": [\n {\n \"data\": \"Line one\\n\",\n \"type\": \"text\",\n \"prev\": null,\n \"next\": {\n \"type\": \"tag\",\n \"name\": \"br\",\n \"attribs\": {}\n }\n },\n {\n \"type\": \"tag\",\n \"name\": \"br\",\n \"attribs\": {},\n \"prev\": {\n \"data\": \"Line one\\n\",\n \"type\": \"text\"\n },\n \"next\": {\n \"data\": \"\\nline two\",\n \"type\": \"text\"\n }\n },\n {\n \"data\": \"\\nline two\",\n \"type\": \"text\",\n \"prev\": {\n \"type\": \"tag\",\n \"name\": \"br\",\n \"attribs\": {}\n },\n \"next\": null\n }\n ]\n}"} +{"text": "\n\t\n\n"} +{"text": ".. Copyright 1998-2019 Lawrence Livermore National Security, LLC and other\n HYPRE Project Developers. See the top-level COPYRIGHT file for details.\n\n SPDX-License-Identifier: (Apache-2.0 OR MIT)\n\n\nLOBPCG Eigensolver\n==============================================================================\n\nLOBPCG (Locally Optimal Block Preconditioned Conjugate Gradient) is a simple,\nyet very efficient, algorithm suggested in [Knya2001]_, [KLAO2007]_, [BLOPEWeb]_\nfor computing several smallest eigenpairs of the symmetric generalized\neigenvalue problem :math:`Ax=\\lambda Bx` with large, possibly sparse, symmetric\nmatrix :math:`A` and symmetric positive definite matrix :math:`B`. The matrix\n:math:`A` is not assumed to be positive, which also allows one to use LOBPCG to\ncompute the largest eigenpairs of :math:`Ax=\\lambda Bx` simply by solving\n:math:`-Ax=\\mu Bx` for the smallest eigenvalues :math:`\\mu=-\\lambda`.\n\nLOBPCG simultaneously computes several eigenpairs together, which is controlled\nby the ``blockSize`` parameter, see example ``ex11.c``. The LOBCPG also allows\none to impose constraints on the eigenvectors of the form :math:`x^T B y_i=0`\nfor a set of vectors :math:`y_i` given to LOBPCG as input parameters. This makes\nit possible to compute, e.g., 50 eigenpairs by 5 subsequent calls to LOBPCG with\nthe ``blockSize=10``, using deflation. LOBPCG can use preconditioning in two\ndifferent ways: by running an inner preconditioned PCG linear solver, or by\napplying the preconditioner directly to the eigenvector residual (option\n``-pcgitr 0``). In all other respects, LOBPCG is similar to the PCG linear\nsolver.\n\nThe LOBPCG code is available for system interfaces: Struct, SStruct, and IJ. It\nis also used in the Auxiliary-space Maxwell Eigensolver (AME). The LOBPCG setup\nis similar to the setup for PCG.\n\n"} +{"text": "//\n// Generated by class-dump 3.5 (64 bit).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.\n//\n\n#import \"MMService.h\"\n\n#import \"MMKernelExt.h\"\n#import \"MMService.h\"\n#import \"PBMessageObserverDelegate.h\"\n\n@class NSString;\n\n@interface WASearchAdMgr : MMService \n{\n}\n\n- (void)MessageReturn:(id)arg1 Event:(unsigned int)arg2;\n- (void)handleWeAppSearchAdClickResp:(id)arg1;\n- (void)handleAdLogResp:(id)arg1;\n- (void)weAppSearchADClick:(id)arg1 statKeywordId:(id)arg2 searchId:(id)arg3 docId:(id)arg4 position:(long long)arg5 appUserName:(id)arg6 appVersion:(id)arg7 adBuffer:(id)arg8 clickExtInfo:(id)arg9;\n- (void)reportADLog:(unsigned int)arg1 logExt:(id)arg2;\n- (void)weAppClickStream:(id)arg1 keywordId:(id)arg2 clickType:(int)arg3;\n- (id)getKVLogHead;\n- (void)dealloc;\n- (void)onServiceInit;\n\n// Remaining properties\n@property(readonly, copy) NSString *debugDescription;\n@property(readonly, copy) NSString *description;\n@property(readonly) unsigned long long hash;\n@property(readonly) Class superclass;\n\n@end\n\n"} +{"text": "\" Vim filetype plugin file\n\" Language: setserial(8) configuration file\n\" Previous Maintainer: Nikolai Weibull \n\" Latest Revision: 2008-07-09\n\nif exists(\"b:did_ftplugin\")\n finish\nendif\nlet b:did_ftplugin = 1\n\nlet s:cpo_save = &cpo\nset cpo&vim\n\nlet b:undo_ftplugin = \"setl com< cms< fo<\"\n\nsetlocal comments=:# commentstring=#\\ %s formatoptions-=t formatoptions+=croql\n\nlet &cpo = s:cpo_save\nunlet s:cpo_save\n"} +{"text": "\n */\n\n$installer = $this;\n/* @var $installer Mage_Tax_Model_Mysql4_Setup */\n\n$installer->startSetup();\n\n$table = $installer->getTable('newsletter_queue_link');\n\n$installer->getConnection()->addKey($table, 'IDX_NEWSLETTER_QUEUE_LINK_SEND_AT', array('queue_id', 'letter_sent_at'));\n\n$installer->endSetup();\n"} +{"text": "#Author: your.email@your.domain.com\n#Keywords Summary :\n#Feature: List of scenarios.\n#Scenario: Business rule through list of steps with arguments.\n#Given: Some precondition step\n#When: Some key actions\n#Then: To observe outcomes or validation\n#And,But: To enumerate more Given,When,Then steps\n#Scenario Outline: List of steps for data-driven as an Examples and \n#Examples: Container for s table\n#Background: List of steps run before each of the scenarios\n#\"\"\" (Doc Strings)\n#| (Data Tables)\n#@ (Tags/Labels):To group Scenarios\n#<> (placeholder)\n#\"\"\n## (Comments)\n#Sample Feature Definition Template\n@tag\nFeature: Title of your feature\n I want to use this template for my feature file\n\n @tag1\n Scenario: Title of your scenario\n Given I want to write a step with precondition\n And some other precondition\n When I complete action\n And some other action\n And yet another action\n Then I validate the outcomes\n And check more outcomes\n\n @tag2\n Scenario Outline: Title of your scenario outline\n Given I want to write a step with \n When I check for the in step\n Then I verify the in step\n\n Examples: \n | name | value | status |\n | name1 | 5 | success |\n | name2 | 7 | Fail |\n"} +{"text": "// LimeChat is copyrighted free software by Satoshi Nakagawa .\n// You can redistribute it and/or modify it under the terms of the GPL version 2 (see the file GPL.txt).\n\n#import \"InputHistory.h\"\n\n\n#define INPUT_HISTORY_MAX 50\n\n\n@implementation InputHistory\n{\n NSMutableArray* _buf;\n int _pos;\n}\n\n- (id)init\n{\n self = [super init];\n if (self) {\n _buf = [NSMutableArray new];\n }\n return self;\n}\n\n- (void)add:(NSString*)s\n{\n _pos = _buf.count;\n if (s.length == 0) return;\n if ([[_buf lastObject] isEqualToString:s]) return;\n\n [_buf addObject:s];\n\n if (_buf.count > INPUT_HISTORY_MAX) {\n [_buf removeObjectAtIndex:0];\n }\n _pos = _buf.count;\n}\n\n- (NSString*)up:(NSString*)s\n{\n if (s && s.length > 0) {\n NSString* cur = nil;\n if (0 <= _pos && _pos < _buf.count) {\n cur = [_buf objectAtIndex:_pos];\n }\n\n if (!cur || ![cur isEqualToString:s]) {\n // if the text was modified, add it\n [_buf addObject:s];\n if (_buf.count > INPUT_HISTORY_MAX) {\n [_buf removeObjectAtIndex:0];\n --_pos;\n }\n }\n }\n\n --_pos;\n if (_pos < 0) {\n _pos = 0;\n return nil;\n }\n else if (0 <= _pos && _pos < _buf.count) {\n return [_buf objectAtIndex:_pos];\n }\n else {\n return @\"\";\n }\n}\n\n- (NSString*)down:(NSString*)s\n{\n if (!s || s.length == 0) {\n _pos = _buf.count;\n return nil;\n }\n\n NSString* cur = nil;\n if (0 <= _pos && _pos < _buf.count) {\n cur = [_buf objectAtIndex:_pos];\n }\n\n if (!cur || ![cur isEqualToString:s]) {\n // if the text was modified, add it\n [self add:s];\n return @\"\";\n }\n else {\n ++_pos;\n if (0 <= _pos && _pos < _buf.count) {\n return [_buf objectAtIndex:_pos];\n }\n return @\"\";\n }\n}\n\n@end\n"} +{"text": "=============================================\nGoogle Serial Graphics Adapter BIOS (SGABIOS)\n\nCopyright 2007 Google Inc.\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=============================================\nStatus: Implemented (as of 2007-08-08)\n\nNathan Laredo \nModified: 2008-02-14 13:45 PDT\n\n\nObjective\n---------\n\nThe Google Serial Graphics Adapter BIOS or SGABIOS provides a means\nfor legacy pc software to communicate with an attached serial console\nas if a vga card is attached.\n\nBackground\n----------\n\nThe headless server problem\n\nWhen building a lot of systems for data center use, it makes\nno sense to install hardware that will rarely if ever be used.\nGraphics adapters are not very useful even if they are installed\nin a data center environment since often the person interested in\nseeing the output is separated from the device by tens to thousands\nof miles.\n\nWhile it's possible to use remote management hardware that provides\na remotely accessible display and keyboard, this hardware is much\nmore expensive than the hardware that it replaces, and often this\nhardware sends only images of the display rather than something\nsuitable for logging.\n\nSince most systems already have a serial port, it's an obvious\ntarget as a replacement for the primary display and keyboard.\nThe problem is that while an operating system like Linux can\nsupport this arrangement, all of the output that would normally\nappear on a graphics adapter before Linux boots is lost on modern\nx86 hardware without modifications to the system firmware.\n\nWhile some vendors provide firmware that enables the serial port to\nbe used as the primary display, this is usually a \"premium\" option\nand isn't universally available for all x86 platforms. Often such\nservices aren't implemented in a way that is friendly to saving logs\nof boot activity. One particularly ugly implementation might send\nthe same text hundreds of times as it tries to refresh the entire\ndisplay each timer tick. Others have ansi control sequences\nbetween every single character output which, while readable in a\nterminal, is almost unusable when referring to serial log files.\nBehavior like this slows down the serial output by up to fifteen\ntimes in some cases, using sometimes that many extra characters\nof control sequences for each character output.\n\nThe need for detailed system logs\n\nNone of the vendor-supplied serial redirection implementations\ninclude facilities for logging boot message for later capture by\nan operating system. Being able to refer to the boot messages\nafter an operating system has loaded, or having a history of such\nmessages can be a useful debug, analysis, and management feature.\n\nEven on systems with graphics adapters attached, once the display\nis scrolled or refreshed with enough new text, the old messages\nare only available in the user's own brain, which often isn't\nvery good at accurately recalling more than two or three items\nthat aren't grammatically meaningful in the user's native language.\n\nOverview\n---------\nSGABIOS is designed to be inserted into a bios as an option rom\nto provide over a serial port the display and input capabilites\nnormally handled by a VGA adapter and a keyboard, and additionally\nprovide hooks for logging displayed characters for later collection\nafter an operating system boots.\n\nIt is designed to handle all text mode output sent to the legacy\nbios int 10h service routine. Int 10h is the most common method\nfor displaying characters in 16-bit legacy x86 code.\n\nOccasionally some code may write directly to the vga memory in\nthe interest of \"speed,\" and this output will be missed, but\nit's rather uncommon for any code involved in booting a system\nto be concerned with the speed of display output. SGABIOS is not\ndesigned to handle these cases since those applications that make\nsuch assumptions generally write to an area of memory that typically\nalready in use for system management mode and unusable outside of\nthat mode. Paging tricks could be used to capture such output,\nbut enabling paging requires protected mode to be enabled which\ninstantly breaks all segment loads in legacy 16-bit real- mode code\n(which is the traditional boot environment).\n\nDetailed Design\n----------------\n\nVGA BIOS int 10h is hooked and chained to any existing handler or\nthe default handler that the BIOS previously setup.\n\nDuring initialization, the option rom also probes the serial port\nfor reply from an attached terminal. If the terminal replies to\na specific sequence, the terminal size is recorded and used for\nall future display calculations. If a VGA card is attached at\nthe same time, the width of the terminal is limited to 80 columns\nin order to have sensible output on both the VGA card and on the\nserial console. If no reply comes from the serial terminal within\na very short timeout of about 8 milliseconds (or more accurately,\n65536 reads of the serial status port), a default size of 80x24\nis used. The detected size is displayed at the end of option rom\ninit to the serial console.\n\nBecause of the way the cursor is updated, if the cursor is never\nmoved upwards or more than one line down by int 10h calls, output\nwill still be appear completely appropriate for whatever sized\nterminal is attached but failed to get detected.\n\nWhenever int 10h is invoked, SGABIOS gets control first and decides\nwhether to act based on register state. With the exception of\nfunctions for getting current mode info or the current cursor\nposition, whether it acts or not, register state is ultimately\nrestored to the state on entry and a far jump is made to the\noriginal handler.\n\nSGABIOS maintains two active cursor positions. One contains the\ntraditional VGA cursor position at the traditional location in\nthe BIOS Data Area, while the other maintains the position the\nserial console's cursor is located. The serial cursor position\nis located in a BDA location that traditionally contains the\nbase io port address for LPT3, but since builtin printer ports are\ndisappearing over time, this location is reused. These two values\nwill often differ since serial terminal output will always move\nthe cursor to the next position on the screen while many VGA\noperations don't update the cursor position at all, or some only\nat the start of the string, but leave the old value at the end.\nKeeping track of two active cursor positions means that SGABIOS\ncan collapse a string of \"set cursor\" calls into perhaps a single\none or none if the serial console cursor already happens to be at\nthe target location. Cursor movements are further optimized\nby sending newline characters to move the cursor down one row,\ncarriage return characters to move the cursor back to column 0,\nand backspace characters to send the cursor back one or two spaces.\n\nTo avoid problems when a video card is connected, any Bios Data\nArea location that would be updated by a VGA card is left alone\nto be updated by the VGA card. SGABIOS will update the cursor\nposition as usual, but just before chaining to an existing vga\ncard's handler, it will restore the values to those on entry,\nand for those functions that return data, it will defer completely\nto the chained routines rather than taking those over as it does\nwhen no video card is detected.\n\nCursor position updates to serial console are deferred until the\nnext character of terminal output is available. This collapses\nthe cases where the cursor is updated more than one time between\neach character output (this is surprisingly common).\n\nThe goal of tracking the cursor so closely and minimizing the number\nof characters required to update the cursor position is to both to\nmake the display of output as efficient and fast as possible and\nto allow one to grep a raw log of serial console output for text\n(which without such optimization may be impossible or extremely\ndifficult with movement escape sequences between every character).\n\nIn the same way cursor position is tracked, vga character attributes\nare tracked so that it's possible to minimize the number of times\nan attribute change escape sequence is sent to the serial console.\n\nA BIOS Data Area location traditionally used for storing the\ncurrent palette value is used to store the last attribute sent to\nthe serial console. As SGABIOS processes new calls, if the value\nis the same, after masking off bright background colors which\naren't supported in ansi escape codes, then no attribute update\nis sent to the serial console, else an escape sequence is sent\nthat gives the new background and foreground colors and whether\nthe foreground is bold or not.\n\nData communication\n\nWhenever the call is made to output text, SGABIOS first updates\nthe serial terminal cursor to match the current position of\nthe vga cursor (if necessary), outputs any attribute change if\napplicable to the particular int 10h call made, and finally sends\nthe text character (or characters) out to the serial port, and then\nupdates its own view of where the serial console cursor is located.\nAfter the text is sent, a logging routine is called to store that\ntext in a private area of memory allocated at option rom init.\n\nFor keyboard/terminal input, SGABIOS hooks bios int 16h which is\ntypically called to poll for a keypress. Before passing the call\nalong, SGABIOS looks for any pending input on the serial port and\nstuffs the keyboard buffer with any pending byte after translating\nit to a compatible keyboard scancode. If the character received\nis an escape, SGABIOS will continue to poll for up to four extra\ncharacters of input for several milliseconds in order to detect\nANSI/VT100/xterm/etc cursor keys and function keys, looking up\nappropriate scancodes in a table of escape sequences for all\nknown non-conflicting terminal types.\n\nSGABIOS also hooks the serial port interrupts, and on receiving\nan interrupt blocks out interrupts, calls the same polling\nroutines as above, following the same processing of multi-byte\ninput as well, stuffing the keyboard buffer as appropriate,\nand finally acknowledging the interrupt and returning from the\nhandler. [ serial port interrupts are now DISABLED ]\n\nOptionally the serial port input/output can be replaced with\na SMI trigger that calls into an EFI BIOS in order to tie into\nits own console input and output routines rather than directly\nhitting the serial port. In this particular case it's assumed\nthat all logging is handled in the EFI module that will be called.\nBIOS int 15h, ax = 0d042h is used to trigger SMI. The parameters\npassed will need to be changed to be specific to the EFI or SMI\nhandler put in place. In the example in SMBIOS, for output,\nebx = 0xf00d0000 | (char << 8), and for input, ebx = 0xfeed0000,\nwith the character, if any, returned in the eax register with ZF\nset and eax=0 if no character was available.\n\nSummary of new enhancements\n---------------------------\nSGABIOS now keeps a log of the last 256 characters written to\nthe screen and where they were written in the event an application\nlike lilo asks for the current character under the cursor. These\nare currently stored in a 1KB EBDA allocation which can be expanded\nas needed. This method avoids having to store a 64KB buffer for\nthe largest possible serial terminal supported (255x255).\n\nWhen lilo 22.6 is detected, SGABIOS now knows how to disable\nlilo's serial output in favor of its own. This avoids having\ndouble character output from both serial and VGABIOS interleaved.\n\nPossible future enhancements\n----------------------------\nPrevious future ideas have now been implemented.\n\nKnown Bugs\n----------\nWith some versions of DOS, only the last character of every line\nis displayed once dos boots since DOS will use direct access to\nthe VGA framebuffer until the end of line is reached, at which\npoint it will start using int 10h. Dual cursor tracking might\nfix this issue by maintaining positions for dos that look like\nthe end of line and another for internal use to know where to\noutput next.\n\nCaveats\n-------\nIt may be possible for someone to construct a terminal reply for\nthe terminal sizing code that is completely invalid and attempts\nto either setup variables to overrun buffers or else overruns\nthe input buffer itself. This situation is currently handled\nby limiting the reply to between eight and fourteen characters\nand ignoring any values outside the range from ten to two hundred\nfifty-five for both the number of rows and the number of columns.\nIn these situations a default size of 80x24 is used (unless a\nvideo card is present, in which case its size is used). If the\nresize code detects several unexpected characters during the\nterminal size detection, it currently assumes that someone has\nleft a loopback device plugged into the serial port and redirects\nthe serial input and output to the fourth serial port at 0x2e8.\n\n\nSecurity considerations\n-----------------------\nNone. This is already 16-bit real-mode x86 code. The entire\nsystem may be crashed or bent to do anyone's bidding at any time\nby any other running code outside of SGABIOS.\n\n\nOpensource Plan\n---------------\nThis source code was approved for release to the public for use under\nthe Apache License, Version 2.0 on http://code.google.com/p/sgabios\n\n\nDocument History\n----------------\nDate\t\tAuthor\tDescription\n2008-02-14\tnil\tfix for release\n2007-10-04\tnil\tnew features\n2007-08-31\tnil\tsga+vga fixes\n2007-08-08\tnil\tInitial version\n\n$Id$\n"} +{"text": "/*\n * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.\n * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n *\n * This code is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License version 2 only, as\n * published by the Free Software Foundation. Oracle designates this\n * particular file as subject to the \"Classpath\" exception as provided\n * by Oracle in the LICENSE file that accompanied this code.\n *\n * This code is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n * version 2 for more details (a copy is included in the LICENSE file that\n * accompanied this code).\n *\n * You should have received a copy of the GNU General Public License version\n * 2 along with this work; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n *\n * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n * or visit www.oracle.com if you need additional information or have any\n * questions.\n */\n\npackage jdk.nashorn.internal.codegen;\n\nimport static jdk.internal.org.objectweb.asm.Opcodes.ACC_FINAL;\nimport static jdk.internal.org.objectweb.asm.Opcodes.ACC_PRIVATE;\nimport static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;\nimport static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC;\nimport static jdk.internal.org.objectweb.asm.Opcodes.ACC_SUPER;\nimport static jdk.internal.org.objectweb.asm.Opcodes.ACC_VARARGS;\nimport static jdk.internal.org.objectweb.asm.Opcodes.H_INVOKEINTERFACE;\nimport static jdk.internal.org.objectweb.asm.Opcodes.H_INVOKESPECIAL;\nimport static jdk.internal.org.objectweb.asm.Opcodes.H_INVOKESTATIC;\nimport static jdk.internal.org.objectweb.asm.Opcodes.H_INVOKEVIRTUAL;\nimport static jdk.internal.org.objectweb.asm.Opcodes.H_NEWINVOKESPECIAL;\nimport static jdk.internal.org.objectweb.asm.Opcodes.V1_7;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.CLINIT;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.CONSTANTS;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.GET_ARRAY_PREFIX;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.GET_ARRAY_SUFFIX;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.GET_MAP;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.GET_STRING;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.INIT;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.SET_MAP;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.SOURCE;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.STRICT_MODE;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.className;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.methodDescriptor;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.typeDescriptor;\nimport static jdk.nashorn.internal.codegen.CompilerConstants.virtualCallNoLookup;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.PrintWriter;\nimport java.security.AccessController;\nimport java.security.PrivilegedAction;\nimport java.util.Collections;\nimport java.util.EnumSet;\nimport java.util.HashSet;\nimport java.util.Set;\nimport jdk.internal.org.objectweb.asm.ClassWriter;\nimport jdk.internal.org.objectweb.asm.MethodVisitor;\nimport jdk.internal.org.objectweb.asm.util.TraceClassVisitor;\nimport jdk.nashorn.internal.codegen.types.Type;\nimport jdk.nashorn.internal.ir.FunctionNode;\nimport jdk.nashorn.internal.ir.debug.NashornClassReader;\nimport jdk.nashorn.internal.ir.debug.NashornTextifier;\nimport jdk.nashorn.internal.runtime.Context;\nimport jdk.nashorn.internal.runtime.PropertyMap;\nimport jdk.nashorn.internal.runtime.RewriteException;\nimport jdk.nashorn.internal.runtime.ScriptObject;\nimport jdk.nashorn.internal.runtime.Source;\n\n/**\n * The interface responsible for speaking to ASM, emitting classes,\n * fields and methods.\n *

\n * This file contains the ClassEmitter, which is the master object\n * responsible for writing byte codes. It utilizes a MethodEmitter\n * for method generation, which also the NodeVisitors own, to keep\n * track of the current code generator and what it is doing.\n *

\n * There is, however, nothing stopping you from using this in a\n * completely self contained environment, for example in ObjectGenerator\n * where there are no visitors or external hooks.\n *

\n * MethodEmitter makes it simple to generate code for methods without\n * having to do arduous type checking. It maintains a type stack\n * and will pick the appropriate operation for all operations sent to it\n * We also allow chained called to a MethodEmitter for brevity, e.g.\n * it is legal to write _new(className).dup() or\n * load(slot).load(slot2).xor().store(slot3);\n *

\n * If running with assertions enabled, any type conflict, such as different\n * bytecode stack sizes or operating on the wrong type will be detected\n * and an error thrown.\n *

\n * There is also a very nice debug interface that can emit formatted\n * bytecodes that have been written. This is enabled by setting the\n * environment \"nashorn.codegen.debug\" to true, or --log=codegen:{@literal }\n *\n * @see Compiler\n */\npublic class ClassEmitter {\n /** Default flags for class generation - public class */\n private static final EnumSet DEFAULT_METHOD_FLAGS = EnumSet.of(Flag.PUBLIC);\n\n /** Sanity check flag - have we started on a class? */\n private boolean classStarted;\n\n /** Sanity check flag - have we ended this emission? */\n private boolean classEnded;\n\n /**\n * Sanity checks - which methods have we currently\n * started for generation in this class?\n */\n private final HashSet methodsStarted;\n\n /** The ASM classwriter that we use for all bytecode operations */\n protected final ClassWriter cw;\n\n /** The script environment */\n protected final Context context;\n\n /** Compile unit class name. */\n private String unitClassName;\n\n /** Set of constants access methods required. */\n private Set> constantMethodNeeded;\n\n private int methodCount;\n\n private int initCount;\n\n private int clinitCount;\n\n private int fieldCount;\n\n private final Set methodNames;\n\n /**\n * Constructor - only used internally in this class as it breaks\n * abstraction towards ASM or other code generator below.\n *\n * @param env script environment\n * @param cw ASM classwriter\n */\n private ClassEmitter(final Context context, final ClassWriter cw) {\n this.context = context;\n this.cw = cw;\n this.methodsStarted = new HashSet<>();\n this.methodNames = new HashSet<>();\n }\n\n /**\n * Return the method names encountered.\n *\n * @return method names\n */\n public Set getMethodNames() {\n return Collections.unmodifiableSet(methodNames);\n }\n\n /**\n * Constructor.\n *\n * @param env script environment\n * @param className name of class to weave\n * @param superClassName super class name for class\n * @param interfaceNames names of interfaces implemented by this class, or\n * {@code null} if none\n */\n ClassEmitter(final Context context, final String className, final String superClassName, final String... interfaceNames) {\n this(context, new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS));\n cw.visit(V1_7, ACC_PUBLIC | ACC_SUPER, className, null, superClassName, interfaceNames);\n }\n\n /**\n * Constructor from the compiler.\n *\n * @param env Script environment\n * @param sourceName Source name\n * @param unitClassName Compile unit class name.\n * @param strictMode Should we generate this method in strict mode\n */\n ClassEmitter(final Context context, final String sourceName, final String unitClassName, final boolean strictMode) {\n this(context,\n new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS) {\n private static final String OBJECT_CLASS = \"java/lang/Object\";\n\n @Override\n protected String getCommonSuperClass(final String type1, final String type2) {\n try {\n return super.getCommonSuperClass(type1, type2);\n } catch (final RuntimeException e) {\n if (isScriptObject(Compiler.SCRIPTS_PACKAGE, type1) && isScriptObject(Compiler.SCRIPTS_PACKAGE, type2)) {\n return className(ScriptObject.class);\n }\n return OBJECT_CLASS;\n }\n }\n });\n\n this.unitClassName = unitClassName;\n this.constantMethodNeeded = new HashSet<>();\n\n cw.visit(V1_7, ACC_PUBLIC | ACC_SUPER, unitClassName, null, pathName(jdk.nashorn.internal.scripts.JS.class.getName()), null);\n cw.visitSource(sourceName, null);\n\n defineCommonStatics(strictMode);\n }\n\n Context getContext() {\n return context;\n }\n\n /**\n * @return the name of the compile unit class name.\n */\n String getUnitClassName() {\n return unitClassName;\n }\n\n /**\n * Get the method count, including init and clinit methods.\n *\n * @return method count\n */\n public int getMethodCount() {\n return methodCount;\n }\n\n /**\n * Get the clinit count.\n *\n * @return clinit count\n */\n public int getClinitCount() {\n return clinitCount;\n }\n\n /**\n * Get the init count.\n *\n * @return init count\n */\n public int getInitCount() {\n return initCount;\n }\n\n /**\n * Get the field count.\n *\n * @return field count\n */\n public int getFieldCount() {\n return fieldCount;\n }\n\n /**\n * Convert a binary name to a package/class name.\n *\n * @param name Binary name.\n *\n * @return Package/class name.\n */\n private static String pathName(final String name) {\n return name.replace('.', '/');\n }\n\n /**\n * Define the static fields common in all scripts.\n *\n * @param strictMode Should we generate this method in strict mode\n */\n private void defineCommonStatics(final boolean strictMode) {\n // source - used to store the source data (text) for this script. Shared across\n // compile units. Set externally by the compiler.\n field(EnumSet.of(Flag.PRIVATE, Flag.STATIC), SOURCE.symbolName(), Source.class);\n\n // constants - used to the constants array for this script. Shared across\n // compile units. Set externally by the compiler.\n field(EnumSet.of(Flag.PRIVATE, Flag.STATIC), CONSTANTS.symbolName(), Object[].class);\n\n // strictMode - was this script compiled in strict mode. Set externally by the compiler.\n field(EnumSet.of(Flag.PUBLIC, Flag.STATIC, Flag.FINAL), STRICT_MODE.symbolName(), boolean.class, strictMode);\n }\n\n /**\n * Define static utilities common needed in scripts. These are per compile\n * unit and therefore have to be defined here and not in code gen.\n */\n private void defineCommonUtilities() {\n assert unitClassName != null;\n\n if (constantMethodNeeded.contains(String.class)) {\n // $getString - get the ith entry from the constants table and cast to String.\n final MethodEmitter getStringMethod = method(EnumSet.of(Flag.PRIVATE, Flag.STATIC), GET_STRING.symbolName(), String.class, int.class);\n getStringMethod.begin();\n getStringMethod.getStatic(unitClassName, CONSTANTS.symbolName(), CONSTANTS.descriptor())\n .load(Type.INT, 0)\n .arrayload()\n .checkcast(String.class)\n ._return();\n getStringMethod.end();\n }\n\n if (constantMethodNeeded.contains(PropertyMap.class)) {\n // $getMap - get the ith entry from the constants table and cast to PropertyMap.\n final MethodEmitter getMapMethod = method(EnumSet.of(Flag.PUBLIC, Flag.STATIC), GET_MAP.symbolName(), PropertyMap.class, int.class);\n getMapMethod.begin();\n getMapMethod.loadConstants()\n .load(Type.INT, 0)\n .arrayload()\n .checkcast(PropertyMap.class)\n ._return();\n getMapMethod.end();\n\n // $setMap - overwrite an existing map.\n final MethodEmitter setMapMethod = method(EnumSet.of(Flag.PUBLIC, Flag.STATIC), SET_MAP.symbolName(), void.class, int.class, PropertyMap.class);\n setMapMethod.begin();\n setMapMethod.loadConstants()\n .load(Type.INT, 0)\n .load(Type.OBJECT, 1)\n .arraystore();\n setMapMethod.returnVoid();\n setMapMethod.end();\n }\n\n // $getXXXX$array - get the ith entry from the constants table and cast to XXXX[].\n for (final Class clazz : constantMethodNeeded) {\n if (clazz.isArray()) {\n defineGetArrayMethod(clazz);\n }\n }\n }\n\n /**\n * Constructs a primitive specific method for getting the ith entry from the\n * constants table as an array.\n *\n * @param clazz Array class.\n */\n private void defineGetArrayMethod(final Class clazz) {\n assert unitClassName != null;\n\n final String methodName = getArrayMethodName(clazz);\n final MethodEmitter getArrayMethod = method(EnumSet.of(Flag.PRIVATE, Flag.STATIC), methodName, clazz, int.class);\n\n getArrayMethod.begin();\n getArrayMethod.getStatic(unitClassName, CONSTANTS.symbolName(), CONSTANTS.descriptor())\n .load(Type.INT, 0)\n .arrayload()\n .checkcast(clazz)\n .invoke(virtualCallNoLookup(clazz, \"clone\", Object.class))\n .checkcast(clazz)\n ._return();\n getArrayMethod.end();\n }\n\n\n /**\n * Generate the name of a get array from constant pool method.\n *\n * @param clazz Name of array class.\n *\n * @return Method name.\n */\n static String getArrayMethodName(final Class clazz) {\n assert clazz.isArray();\n return GET_ARRAY_PREFIX.symbolName() + clazz.getComponentType().getSimpleName() + GET_ARRAY_SUFFIX.symbolName();\n }\n\n /**\n * Ensure a get constant method is issued for the class.\n *\n * @param clazz Class of constant.\n */\n void needGetConstantMethod(final Class clazz) {\n constantMethodNeeded.add(clazz);\n }\n\n /**\n * Inspect class name and decide whether we are generating a ScriptObject class.\n *\n * @param scriptPrefix the script class prefix for the current script\n * @param type the type to check\n *\n * @return {@code true} if type is ScriptObject\n */\n private static boolean isScriptObject(final String scriptPrefix, final String type) {\n if (type.startsWith(scriptPrefix)) {\n return true;\n } else if (type.equals(CompilerConstants.className(ScriptObject.class))) {\n return true;\n } else if (type.startsWith(Compiler.OBJECTS_PACKAGE)) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Call at beginning of class emission.\n */\n public void begin() {\n classStarted = true;\n }\n\n /**\n * Call at end of class emission.\n */\n public void end() {\n assert classStarted : \"class not started for \" + unitClassName;\n\n if (unitClassName != null) {\n final MethodEmitter initMethod = init(EnumSet.of(Flag.PRIVATE));\n initMethod.begin();\n initMethod.load(Type.OBJECT, 0);\n initMethod.newInstance(jdk.nashorn.internal.scripts.JS.class);\n initMethod.returnVoid();\n initMethod.end();\n\n defineCommonUtilities();\n }\n\n cw.visitEnd();\n classStarted = false;\n classEnded = true;\n assert methodsStarted.isEmpty() : \"methodsStarted not empty \" + methodsStarted;\n }\n\n /**\n * Disassemble an array of byte code.\n *\n * @param bytecode byte array representing bytecode\n *\n * @return disassembly as human readable string\n */\n static String disassemble(final byte[] bytecode) {\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\n try (final PrintWriter pw = new PrintWriter(baos)) {\n final NashornClassReader cr = new NashornClassReader(bytecode);\n final Context ctx = AccessController.doPrivileged(new PrivilegedAction() {\n @Override\n public Context run() {\n return Context.getContext();\n }\n });\n final TraceClassVisitor tcv = new TraceClassVisitor(null, new NashornTextifier(ctx.getEnv(), cr), pw);\n cr.accept(tcv, 0);\n }\n\n final String str = new String(baos.toByteArray());\n return str;\n }\n\n /**\n * Call back from MethodEmitter for method start.\n *\n * @see MethodEmitter\n *\n * @param method method emitter.\n */\n void beginMethod(final MethodEmitter method) {\n assert !methodsStarted.contains(method);\n methodsStarted.add(method);\n }\n\n /**\n * Call back from MethodEmitter for method end.\n *\n * @see MethodEmitter\n *\n * @param method\n */\n void endMethod(final MethodEmitter method) {\n assert methodsStarted.contains(method);\n methodsStarted.remove(method);\n }\n\n /**\n * Add a new method to the class - defaults to public method.\n *\n * @param methodName name of method\n * @param rtype return type of the method\n * @param ptypes parameter types the method\n *\n * @return method emitter to use for weaving this method\n */\n MethodEmitter method(final String methodName, final Class rtype, final Class... ptypes) {\n return method(DEFAULT_METHOD_FLAGS, methodName, rtype, ptypes); //TODO why public default ?\n }\n\n /**\n * Add a new method to the class - defaults to public method.\n *\n * @param methodFlags access flags for the method\n * @param methodName name of method\n * @param rtype return type of the method\n * @param ptypes parameter types the method\n *\n * @return method emitter to use for weaving this method\n */\n MethodEmitter method(final EnumSet methodFlags, final String methodName, final Class rtype, final Class... ptypes) {\n methodCount++;\n methodNames.add(methodName);\n return new MethodEmitter(this, methodVisitor(methodFlags, methodName, rtype, ptypes));\n }\n\n /**\n * Add a new method to the class - defaults to public method.\n *\n * @param methodName name of method\n * @param descriptor descriptor of method\n *\n * @return method emitter to use for weaving this method\n */\n MethodEmitter method(final String methodName, final String descriptor) {\n return method(DEFAULT_METHOD_FLAGS, methodName, descriptor);\n }\n\n /**\n * Add a new method to the class - defaults to public method.\n *\n * @param methodFlags access flags for the method\n * @param methodName name of method\n * @param descriptor descriptor of method\n *\n * @return method emitter to use for weaving this method\n */\n MethodEmitter method(final EnumSet methodFlags, final String methodName, final String descriptor) {\n methodCount++;\n methodNames.add(methodName);\n return new MethodEmitter(this, cw.visitMethod(Flag.getValue(methodFlags), methodName, descriptor, null, null));\n }\n\n /**\n * Add a new method to the class, representing a function node.\n *\n * @param functionNode the function node to generate a method for\n *\n * @return method emitter to use for weaving this method\n */\n MethodEmitter method(final FunctionNode functionNode) {\n methodCount++;\n methodNames.add(functionNode.getName());\n final FunctionSignature signature = new FunctionSignature(functionNode);\n final MethodVisitor mv = cw.visitMethod(\n ACC_PUBLIC | ACC_STATIC | (functionNode.isVarArg() ? ACC_VARARGS : 0),\n functionNode.getName(),\n signature.toString(),\n null,\n null);\n\n return new MethodEmitter(this, mv, functionNode);\n }\n\n /**\n * Add a new method to the class, representing a rest-of version of the\n * function node.\n *\n * @param functionNode the function node to generate a method for\n *\n * @return method emitter to use for weaving this method\n */\n MethodEmitter restOfMethod(final FunctionNode functionNode) {\n methodCount++;\n methodNames.add(functionNode.getName());\n final MethodVisitor mv = cw.visitMethod(\n ACC_PUBLIC | ACC_STATIC,\n functionNode.getName(),\n Type.getMethodDescriptor(functionNode.getReturnType().getTypeClass(), RewriteException.class),\n null,\n null);\n\n return new MethodEmitter(this, mv, functionNode);\n }\n\n\n /**\n * Start generating the method in the class.\n *\n * @return method emitter to use for weaving \n */\n MethodEmitter clinit() {\n clinitCount++;\n return method(EnumSet.of(Flag.STATIC), CLINIT.symbolName(), void.class);\n }\n\n /**\n * Start generating an ()V method in the class.\n *\n * @return method emitter to use for weaving ()V\n */\n MethodEmitter init() {\n initCount++;\n return method(INIT.symbolName(), void.class);\n }\n\n /**\n * Start generating an ()V method in the class.\n *\n * @param ptypes parameter types for constructor\n * @return method emitter to use for weaving ()V\n */\n MethodEmitter init(final Class... ptypes) {\n initCount++;\n return method(INIT.symbolName(), void.class, ptypes);\n }\n\n /**\n * Start generating an (...)V method in the class.\n *\n * @param flags access flags for the constructor\n * @param ptypes parameter types for the constructor\n *\n * @return method emitter to use for weaving (...)V\n */\n MethodEmitter init(final EnumSet flags, final Class... ptypes) {\n initCount++;\n return method(flags, INIT.symbolName(), void.class, ptypes);\n }\n\n /**\n * Add a field to the class, initialized to a value.\n *\n * @param fieldFlags flags, e.g. should it be static or public etc\n * @param fieldName name of field\n * @param fieldType the type of the field\n * @param value the value\n *\n * @see ClassEmitter.Flag\n */\n final void field(final EnumSet fieldFlags, final String fieldName, final Class fieldType, final Object value) {\n fieldCount++;\n cw.visitField(Flag.getValue(fieldFlags), fieldName, typeDescriptor(fieldType), null, value).visitEnd();\n }\n\n /**\n * Add a field to the class.\n *\n * @param fieldFlags access flags for the field\n * @param fieldName name of field\n * @param fieldType type of the field\n *\n * @see ClassEmitter.Flag\n */\n final void field(final EnumSet fieldFlags, final String fieldName, final Class fieldType) {\n field(fieldFlags, fieldName, fieldType, null);\n }\n\n /**\n * Add a field to the class - defaults to public.\n *\n * @param fieldName name of field\n * @param fieldType type of field\n */\n final void field(final String fieldName, final Class fieldType) {\n field(EnumSet.of(Flag.PUBLIC), fieldName, fieldType, null);\n }\n\n /**\n * Return a bytecode array from this ClassEmitter. The ClassEmitter must\n * have been ended (having its end function called) for this to work.\n *\n * @return byte code array for generated class, {@code null} if class\n * generation hasn't been ended with {@link ClassEmitter#end()}.\n */\n byte[] toByteArray() {\n assert classEnded;\n if (!classEnded) {\n return null;\n }\n\n return cw.toByteArray();\n }\n\n /**\n * Abstraction for flags used in class emission. We provide abstraction\n * separating these from the underlying bytecode emitter. Flags are provided\n * for method handles, protection levels, static/virtual fields/methods.\n */\n static enum Flag {\n /** method handle with static access */\n HANDLE_STATIC(H_INVOKESTATIC),\n /** method handle with new invoke special access */\n HANDLE_NEWSPECIAL(H_NEWINVOKESPECIAL),\n /** method handle with invoke special access */\n HANDLE_SPECIAL(H_INVOKESPECIAL),\n /** method handle with invoke virtual access */\n HANDLE_VIRTUAL(H_INVOKEVIRTUAL),\n /** method handle with invoke interface access */\n HANDLE_INTERFACE(H_INVOKEINTERFACE),\n\n /** final access */\n FINAL(ACC_FINAL),\n /** static access */\n STATIC(ACC_STATIC),\n /** public access */\n PUBLIC(ACC_PUBLIC),\n /** private access */\n PRIVATE(ACC_PRIVATE);\n\n private final int value;\n\n private Flag(final int value) {\n this.value = value;\n }\n\n /**\n * Get the value of this flag\n * @return the int value\n */\n int getValue() {\n return value;\n }\n\n /**\n * Return the corresponding ASM flag value for an enum set of flags.\n *\n * @param flags enum set of flags\n *\n * @return an integer value representing the flags intrinsic values\n * or:ed together\n */\n static int getValue(final EnumSet flags) {\n int v = 0;\n for (final Flag flag : flags) {\n v |= flag.getValue();\n }\n return v;\n }\n }\n\n private MethodVisitor methodVisitor(final EnumSet flags, final String methodName, final Class rtype, final Class... ptypes) {\n return cw.visitMethod(Flag.getValue(flags), methodName, methodDescriptor(rtype, ptypes), null, null);\n }\n\n}\n"} +{"text": "$NetBSD: distinfo,v 1.55 2020/01/20 21:25:24 adam Exp $\n\nSHA1 (gmp-6.2.0.tar.bz2) = 5e9341d3807bc7505376f9ed9f5c1c6c57050aa6\nRMD160 (gmp-6.2.0.tar.bz2) = 9e0c387608c7dd3eb339afcd989ef5037d7cacbd\nSHA512 (gmp-6.2.0.tar.bz2) = ff22ed47fff176ed56301ecab0213316150a3abb370fed031635804f829c878296d7c65597b1f687f394479eef04fae6eba771162f7d363dc4c94c7334fc1fc0\nSize (gmp-6.2.0.tar.bz2) = 2453458 bytes\nSHA1 (patch-acinclude.m4) = 3f76c0aa8d29ec815a93448f9c4bc976ebdf7a2a\n"} +{"text": "/*\n * Copyright 2015 Red Hat Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"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 COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR\n * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n *\n * Authors: Ben Skeggs \n */\n#include \"ctxgf100.h\"\n\n/*******************************************************************************\n * PGRAPH context implementation\n ******************************************************************************/\n\nvoid\ngm200_grctx_generate_r419a3c(struct gf100_gr *gr)\n{\n\tstruct nvkm_device *device = gr->base.engine.subdev.device;\n\tnvkm_mask(device, 0x419a3c, 0x00000014, 0x00000000);\n}\n\nstatic void\ngm200_grctx_generate_r418e94(struct gf100_gr *gr)\n{\n\tstruct nvkm_device *device = gr->base.engine.subdev.device;\n\tnvkm_mask(device, 0x418e94, 0xffffffff, 0xc4230000);\n\tnvkm_mask(device, 0x418e4c, 0xffffffff, 0x70000000);\n}\n\nvoid\ngm200_grctx_generate_smid_config(struct gf100_gr *gr)\n{\n\tstruct nvkm_device *device = gr->base.engine.subdev.device;\n\tconst u32 dist_nr = DIV_ROUND_UP(gr->tpc_total, 4);\n\tu32 dist[TPC_MAX / 4] = {};\n\tu32 gpcs[GPC_MAX] = {};\n\tu8 sm, i;\n\n\tfor (sm = 0; sm < gr->sm_nr; sm++) {\n\t\tconst u8 gpc = gr->sm[sm].gpc;\n\t\tconst u8 tpc = gr->sm[sm].tpc;\n\t\tdist[sm / 4] |= ((gpc << 4) | tpc) << ((sm % 4) * 8);\n\t\tgpcs[gpc] |= sm << (tpc * 8);\n\t}\n\n\tfor (i = 0; i < dist_nr; i++)\n\t\tnvkm_wr32(device, 0x405b60 + (i * 4), dist[i]);\n\tfor (i = 0; i < gr->gpc_nr; i++)\n\t\tnvkm_wr32(device, 0x405ba0 + (i * 4), gpcs[i]);\n}\n\nvoid\ngm200_grctx_generate_tpc_mask(struct gf100_gr *gr)\n{\n\tu32 tmp, i;\n\tfor (tmp = 0, i = 0; i < gr->gpc_nr; i++)\n\t\ttmp |= ((1 << gr->tpc_nr[i]) - 1) << (i * gr->func->tpc_nr);\n\tnvkm_wr32(gr->base.engine.subdev.device, 0x4041c4, tmp);\n}\n\nvoid\ngm200_grctx_generate_r406500(struct gf100_gr *gr)\n{\n\tnvkm_wr32(gr->base.engine.subdev.device, 0x406500, 0x00000000);\n}\n\nvoid\ngm200_grctx_generate_dist_skip_table(struct gf100_gr *gr)\n{\n\tstruct nvkm_device *device = gr->base.engine.subdev.device;\n\tu32 data[8] = {};\n\tint gpc, ppc, i;\n\n\tfor (gpc = 0; gpc < gr->gpc_nr; gpc++) {\n\t\tfor (ppc = 0; ppc < gr->ppc_nr[gpc]; ppc++) {\n\t\t\tu8 ppc_tpcs = gr->ppc_tpc_nr[gpc][ppc];\n\t\t\tu8 ppc_tpcm = gr->ppc_tpc_mask[gpc][ppc];\n\t\t\twhile (ppc_tpcs-- > gr->ppc_tpc_min)\n\t\t\t\tppc_tpcm &= ppc_tpcm - 1;\n\t\t\tppc_tpcm ^= gr->ppc_tpc_mask[gpc][ppc];\n\t\t\t((u8 *)data)[gpc] |= ppc_tpcm;\n\t\t}\n\t}\n\n\tfor (i = 0; i < ARRAY_SIZE(data); i++)\n\t\tnvkm_wr32(device, 0x4064d0 + (i * 0x04), data[i]);\n}\n\nconst struct gf100_grctx_func\ngm200_grctx = {\n\t.main = gf100_grctx_generate_main,\n\t.unkn = gk104_grctx_generate_unkn,\n\t.bundle = gm107_grctx_generate_bundle,\n\t.bundle_size = 0x3000,\n\t.bundle_min_gpm_fifo_depth = 0x180,\n\t.bundle_token_limit = 0x780,\n\t.pagepool = gm107_grctx_generate_pagepool,\n\t.pagepool_size = 0x20000,\n\t.attrib = gm107_grctx_generate_attrib,\n\t.attrib_nr_max = 0x600,\n\t.attrib_nr = 0x400,\n\t.alpha_nr_max = 0x1800,\n\t.alpha_nr = 0x1000,\n\t.sm_id = gm107_grctx_generate_sm_id,\n\t.rop_mapping = gf117_grctx_generate_rop_mapping,\n\t.dist_skip_table = gm200_grctx_generate_dist_skip_table,\n\t.r406500 = gm200_grctx_generate_r406500,\n\t.gpc_tpc_nr = gk104_grctx_generate_gpc_tpc_nr,\n\t.tpc_mask = gm200_grctx_generate_tpc_mask,\n\t.smid_config = gm200_grctx_generate_smid_config,\n\t.r418e94 = gm200_grctx_generate_r418e94,\n\t.r419a3c = gm200_grctx_generate_r419a3c,\n};\n"} +{"text": "/*\n * Copyright 2014 Attila Szegedi, Daniel Dekany, Jonathan Revusky\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage freemarker.debug.impl;\n\nimport java.rmi.RemoteException;\nimport java.util.Collections;\nimport java.util.List;\n\nimport freemarker.core.Environment;\nimport freemarker.template.Template;\nimport freemarker.template.utility.SecurityUtilities;\n\n/**\n * This class provides debugging hooks for the core FreeMarker engine. It is\n * not usable for anyone outside the FreeMarker core classes. It is public only\n * as an implementation detail.\n */\npublic abstract class DebuggerService {\n private static final DebuggerService instance = createInstance();\n \n private static DebuggerService createInstance() {\n // Creates the appropriate service class. If the debugging is turned\n // off, this is a fast no-op service, otherwise it's the real-thing\n // RMI service.\n return \n SecurityUtilities.getSystemProperty(\"freemarker.debug.password\", null) == null\n ? (DebuggerService) new NoOpDebuggerService()\n : (DebuggerService) new RmiDebuggerService();\n }\n\n public static List getBreakpoints(String templateName) {\n return instance.getBreakpointsSpi(templateName);\n }\n \n abstract List getBreakpointsSpi(String templateName);\n\n public static void registerTemplate(Template template) {\n instance.registerTemplateSpi(template);\n }\n \n abstract void registerTemplateSpi(Template template);\n \n public static boolean suspendEnvironment(Environment env, String templateName, int line)\n throws RemoteException {\n return instance.suspendEnvironmentSpi(env, templateName, line);\n }\n \n abstract boolean suspendEnvironmentSpi(Environment env, String templateName, int line)\n throws RemoteException;\n\n abstract void shutdownSpi();\n\n public static void shutdown() {\n instance.shutdownSpi();\n }\n\n private static class NoOpDebuggerService extends DebuggerService {\n @Override\n List getBreakpointsSpi(String templateName) {\n return Collections.EMPTY_LIST;\n }\n \n @Override\n boolean suspendEnvironmentSpi(Environment env, String templateName, int line) {\n throw new UnsupportedOperationException();\n }\n \n @Override\n void registerTemplateSpi(Template template) {\n }\n\n @Override\n void shutdownSpi() {\n }\n }\n}"} +{"text": "package zielu.gittoolbox.ui.projectview\n\nimport com.intellij.openapi.project.Project\nimport git4idea.repo.GitRepository\nimport zielu.gittoolbox.cache.PerRepoStatusCacheListener\nimport zielu.gittoolbox.cache.RepoInfo\nimport zielu.gittoolbox.cache.VirtualFileRepoCacheListener\nimport zielu.gittoolbox.changes.ChangesTrackerListener\nimport zielu.gittoolbox.config.AppConfigNotifier\nimport zielu.gittoolbox.config.GitToolBoxConfig2\n\ninternal class ProjectViewSubscriberChangesTrackerListener(private val project: Project) : ChangesTrackerListener {\n override fun changeCountsUpdated() {\n ProjectViewSubscriber.getInstance(project).refreshProjectView()\n }\n}\n\ninternal class ProjectViewSubscriberConfigListener(private val project: Project) : AppConfigNotifier {\n override fun configChanged(previous: GitToolBoxConfig2, current: GitToolBoxConfig2) {\n ProjectViewSubscriber.getInstance(project).refreshProjectView()\n }\n}\n\ninternal class ProjectViewSubscriberInfoCacheListener(private val project: Project) : PerRepoStatusCacheListener {\n override fun stateChanged(info: RepoInfo, repository: GitRepository) {\n ProjectViewSubscriber.getInstance(project).refreshProjectView()\n }\n\n override fun evicted(repositories: Collection) {\n ProjectViewSubscriber.getInstance(project).refreshProjectView()\n }\n}\n\ninternal class ProjectViewSubscriberVfCacheListener(private val project: Project) : VirtualFileRepoCacheListener {\n override fun updated() {\n ProjectViewSubscriber.getInstance(project).refreshProjectView()\n }\n}\n"} +{"text": "call(UsersTableSeeder::class);\n }\n}\n"} +{"text": "require('../../modules/es6.typed.uint8-clamped-array');\nmodule.exports = require('../../modules/_core').Uint8ClampedArray;"} +{"text": "# created by tools/tclZIC.tcl - do not edit\nif {![info exists TZData(Asia/Dhaka)]} {\n LoadTimeZoneFile Asia/Dhaka\n}\nset TZData(:Asia/Dacca) $TZData(:Asia/Dhaka)\n"} +{"text": " res M ); while not isReady t do if M.cache.?res then print M.cache.res\n\n 1 26\nS <-- S <-- 0\n \n0 1 2\n\n\n\n...\n\n\n\ni20 : M.cache.res\n\n 1 26\no20 = S <-- S <-- 0\n \n 0 1 2\n\no20 : ChainComplex\n\ni21 : betti oo\n\n 0 1 2 3 4 5 6 7 8 9 10\no21 = total: 1 35 140 301 735 1080 735 301 140 35 1\n 0: 1 . . . . . . . . . .\n 1: . 35 140 189 . . . . . . .\n 2: . . . 112 735 1080 735 112 . . .\n 3: . . . . . . . 189 140 35 .\n 4: . . . . . . . . . . 1\n\no21 : BettiTally\n"} +{"text": "@use \"../sizes\" as *;\n\n// adduse\n\n"} +{"text": "\n\n \n AvoidManuallyCreateThreadRule\n 3\n 16,19,23\n \n \n \n right\n 0\n {\n Thread thread1 = new Thread(r);\n thread1.setName(\"kdsljf\");\n return thread1;\n };\n\n private ThreadFactory threadFactory1 = new ThreadFactory() {\n @Override\n public Thread newThread(Runnable r) {\n Thread thread = new Thread();\n thread.setName(\"xxx\");\n return thread;\n }\n };\n\n private ThreadFactory threadFactory2 = new ThreadFactory() {\n @Override\n public Thread newThread(Runnable r) {\n return new ThreadFactory() {\n @Override\n public Thread newThread(Runnable r) {\n Thread thread = new Thread();\n return thread;\n }\n }.newThread(r);\n }\n };\n\n public void testNewThread(){\n new ThreadFactory(){\n\n @Override\n public Thread newThread(Runnable r) {\n return new Thread();\n }\n }.newThread(new Runnable() {\n @Override\n public void run() {\n\n }\n });\n }\n\n public void testParamter(){\n ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(10, 10, 100, TimeUnit.MILLISECONDS, new SynchronousQueue(),\n r -> {\n Thread thread1 = new Thread(r);\n thread1.setName(\"xxx\");\n return thread1;\n });\n new ThreadPoolExecutor(10, 10, 100, TimeUnit.MILLISECONDS, new SynchronousQueue(),\n r -> {\n Thread thread1 = new Thread(r);\n thread1.setName(\"xxx\");\n return thread1;\n });\n new ThreadPoolExecutor(10, 10, 100, TimeUnit.MILLISECONDS, new SynchronousQueue(),\n new ThreadFactory() {\n @Override\n public Thread newThread(Runnable r) {\n return new Thread();\n }\n });\n }\n\n class MyThreadFactory implements ThreadFactory {\n /**\n * Constructs a new {@code Thread}. Implementations may also initialize\n * priority, name, daemon status, {@code ThreadGroup}, etc.\n *\n * @param r a runnable to be executed by new thread instance\n * @return constructed thread, or {@code null} if the request to create a thread is rejected\n */\n @Override\n public Thread newThread(Runnable r) {\n return new Thread();\n }\n }\n}\n\n\n ]]>\n \n\n"} +{"text": "# -*-perl-*-\n\n$description = 'Test the $(file ...) function.';\n\n# Test > and >>\nrun_make_test(q!\ndefine A\na\nb\nendef\nB = c d\n$(file >file.out,$(A))\n$(foreach L,$(B),$(file >> file.out,$L))\nx:;@echo hi; cat file.out\n!,\n '', \"hi\\na\\nb\\nc\\nd\");\n\nunlink('file.out');\n\n# Test >> to a non-existent file\nrun_make_test(q!\ndefine A\na\nb\nendef\n$(file >> file.out,$(A))\nx:;@cat file.out\n!,\n '', \"a\\nb\");\n\nunlink('file.out');\n\n# Test > with no content\nrun_make_test(q!\n$(file >4touch)\n.PHONY:x\nx:;@cat 4touch\n!,\n '', '');\n\n# Test >> with no content\nrun_make_test(q!\n$(file >>4touch)\n.PHONY:x\nx:;@cat 4touch\n!,\n '', '');\nunlink('4touch');\n\n# Test > to a read-only file\nif (defined $ERR_read_only_file) {\n touch('file.out');\n chmod(0444, 'file.out');\n\n run_make_test(q!\ndefine A\na\nb\nendef\n$(file > file.out,$(A))\nx:;@cat file.out\n!,\n '', \"#MAKEFILE#:6: *** open: file.out: $ERR_read_only_file. Stop.\",\n 512);\n\n unlink('file.out');\n}\n\n# Use variables for operator and filename\nrun_make_test(q!\ndefine A\na\nb\nendef\nOP = >\nFN = file.out\n$(file $(OP) $(FN),$(A))\nx:;@cat file.out\n!,\n '', \"a\\nb\");\n\nunlink('file.out');\n\n# Don't add newlines if one already exists\nrun_make_test(q!\ndefine A\na\nb\n\nendef\n$(file >file.out,$(A))\nx:;@cat file.out\n!,\n '', \"a\\nb\");\n\nunlink('file.out');\n\n# Empty text\nrun_make_test(q!\n$(file >file.out,)\n$(file >>file.out,)\nx:;@cat file.out\n!,\n '', \"\\n\\n\");\n\nunlink('file.out');\n\n# Reading files\nrun_make_test(q!\n$(file >file.out,A = foo)\nX1 := $(file >file.out,B = bar)\n$(eval $(file )', '',\n \"#MAKEFILE#:1: *** file: missing filename. Stop.\\n\", 512);\n\nrun_make_test('$(file >>)', '',\n \"#MAKEFILE#:1: *** file: missing filename. Stop.\\n\", 512);\n\nrun_make_test('$(file <)', '',\n \"#MAKEFILE#:1: *** file: missing filename. Stop.\\n\", 512);\n\n# Bad call\n\nrun_make_test('$(file foo)', '',\n \"#MAKEFILE#:1: *** file: invalid file operation: foo. Stop.\\n\", 512);\n\n1;\n"} +{"text": "/*\n * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n *\n * This code is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License version 2 only, as\n * published by the Free Software Foundation. Oracle designates this\n * particular file as subject to the \"Classpath\" exception as provided\n * by Oracle in the LICENSE file that accompanied this code.\n *\n * This code is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n * version 2 for more details (a copy is included in the LICENSE file that\n * accompanied this code).\n *\n * You should have received a copy of the GNU General Public License version\n * 2 along with this work; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n *\n * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n * or visit www.oracle.com if you need additional information or have any\n * questions.\n *\n */\n\n/*\n * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved\n *\n */\n\n#ifndef __GLYPHPOSITIONINGLOOKUPPROCESSOR_H\n#define __GLYPHPOSITIONINGLOOKUPPROCESSOR_H\n\n/**\n * \\file\n * \\internal\n */\n\n#include \"LETypes.h\"\n#include \"LEFontInstance.h\"\n#include \"OpenTypeTables.h\"\n#include \"Lookups.h\"\n#include \"ICUFeatures.h\"\n#include \"GlyphDefinitionTables.h\"\n#include \"GlyphPositioningTables.h\"\n#include \"GlyphIterator.h\"\n#include \"LookupProcessor.h\"\n\nU_NAMESPACE_BEGIN\n\nclass GlyphPositioningLookupProcessor : public LookupProcessor\n{\npublic:\n GlyphPositioningLookupProcessor(const LEReferenceTo &glyphPositioningTableHeader,\n LETag scriptTag,\n LETag languageTag,\n const FeatureMap *featureMap,\n le_int32 featureMapCount,\n le_bool featureOrder,\n LEErrorCode& success);\n\n virtual ~GlyphPositioningLookupProcessor();\n\n virtual le_uint32 applySubtable(const LEReferenceTo &lookupSubtable, le_uint16 lookupType, GlyphIterator *glyphIterator,\n const LEFontInstance *fontInstance, LEErrorCode& success) const;\n\nprotected:\n GlyphPositioningLookupProcessor();\n\nprivate:\n\n GlyphPositioningLookupProcessor(const GlyphPositioningLookupProcessor &other); // forbid copying of this class\n GlyphPositioningLookupProcessor &operator=(const GlyphPositioningLookupProcessor &other); // forbid copying of this class\n};\n\nU_NAMESPACE_END\n#endif\n"} +{"text": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport json\n\nfrom alipay.aop.api.FileItem import FileItem\nfrom alipay.aop.api.constant.ParamConstants import *\n\nfrom alipay.aop.api.domain.KoubeiMerchantOperatorRoleDeleteModel import KoubeiMerchantOperatorRoleDeleteModel\n\n\n\nclass KoubeiMerchantOperatorRoleDeleteRequest(object):\n\n def __init__(self, biz_model=None):\n self._biz_model = biz_model\n self._biz_content = None\n self._version = \"1.0\"\n self._terminal_type = None\n self._terminal_info = None\n self._prod_code = None\n self._notify_url = None\n self._return_url = None\n self._udf_params = None\n self._need_encrypt = False\n\n @property\n def biz_model(self):\n return self._biz_model\n\n @biz_model.setter\n def biz_model(self, value):\n self._biz_model = value\n\n @property\n def biz_content(self):\n return self._biz_content\n\n @biz_content.setter\n def biz_content(self, value):\n if isinstance(value, KoubeiMerchantOperatorRoleDeleteModel):\n self._biz_content = value\n else:\n self._biz_content = KoubeiMerchantOperatorRoleDeleteModel.from_alipay_dict(value)\n\n\n @property\n def version(self):\n return self._version\n\n @version.setter\n def version(self, value):\n self._version = value\n\n @property\n def terminal_type(self):\n return self._terminal_type\n\n @terminal_type.setter\n def terminal_type(self, value):\n self._terminal_type = value\n\n @property\n def terminal_info(self):\n return self._terminal_info\n\n @terminal_info.setter\n def terminal_info(self, value):\n self._terminal_info = value\n\n @property\n def prod_code(self):\n return self._prod_code\n\n @prod_code.setter\n def prod_code(self, value):\n self._prod_code = value\n\n @property\n def notify_url(self):\n return self._notify_url\n\n @notify_url.setter\n def notify_url(self, value):\n self._notify_url = value\n\n @property\n def return_url(self):\n return self._return_url\n\n @return_url.setter\n def return_url(self, value):\n self._return_url = value\n\n @property\n def udf_params(self):\n return self._udf_params\n\n @udf_params.setter\n def udf_params(self, value):\n if not isinstance(value, dict):\n return\n self._udf_params = value\n\n @property\n def need_encrypt(self):\n return self._need_encrypt\n\n @need_encrypt.setter\n def need_encrypt(self, value):\n self._need_encrypt = value\n\n def add_other_text_param(self, key, value):\n if not self.udf_params:\n self.udf_params = dict()\n self.udf_params[key] = value\n\n def get_params(self):\n params = dict()\n params[P_METHOD] = 'koubei.merchant.operator.role.delete'\n params[P_VERSION] = self.version\n if self.biz_model:\n params[P_BIZ_CONTENT] = json.dumps(obj=self.biz_model.to_alipay_dict(), ensure_ascii=False, sort_keys=True, separators=(',', ':'))\n if self.biz_content:\n if hasattr(self.biz_content, 'to_alipay_dict'):\n params['biz_content'] = json.dumps(obj=self.biz_content.to_alipay_dict(), ensure_ascii=False, sort_keys=True, separators=(',', ':'))\n else:\n params['biz_content'] = self.biz_content\n if self.terminal_type:\n params['terminal_type'] = self.terminal_type\n if self.terminal_info:\n params['terminal_info'] = self.terminal_info\n if self.prod_code:\n params['prod_code'] = self.prod_code\n if self.notify_url:\n params['notify_url'] = self.notify_url\n if self.return_url:\n params['return_url'] = self.return_url\n if self.udf_params:\n params.update(self.udf_params)\n return params\n\n def get_multipart_params(self):\n multipart_params = dict()\n return multipart_params\n"} +{"text": "\n\n\t\n\t\t\n\t\n\n\t\n\t\n\n\t\n\t\t\n\t\t\n\t\n\n\t\n\t\t\n\t\t\n\t\n\n\t\n\t\n\t\n\t\t\n\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n \n \n \n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\n\t\t\n\t\t\trf tagger version 2013-04-30\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t \n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\n\t\t\n\t\t\trf tagger version 2013-04-30\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\n\t\t\n\t\t\trf tagger version 2013-04-30\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\n\t\t\n\t\t\trf tagger version 2013-04-30\n\t\t\n\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\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\n \n \n \n \n \n \n \n \n \n \n \t \n \n \n\t\n\t\n \n \n \n\n \n \n \n \n \n \n \t\n \n \n \t\n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \t\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \t\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \t\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \t\n \n \n \n \n \n \n\n\t\n"} +{"text": "package {{package}};\n\n{{#imports}}import {{import}};\n{{/imports}}\n\nimport io.vertx.core.AsyncResult;\nimport io.vertx.core.Handler;\nimport io.vertx.core.MultiMap;\nimport io.vertx.core.json.JsonObject;\n\nimport com.fasterxml.jackson.core.type.TypeReference;\n\nimport java.util.*;\n\nimport {{invokerPackage}}.ApiClient;\nimport {{invokerPackage}}.ApiException;\nimport {{invokerPackage}}.Configuration;\nimport {{invokerPackage}}.Pair;\n\n{{>generatedAnnotation}}\n{{#operations}}\npublic class {{classname}}Impl implements {{classname}} {\n\n private ApiClient {{localVariablePrefix}}apiClient;\n\n public {{classname}}Impl() {\n this(null);\n }\n\n public {{classname}}Impl(ApiClient apiClient) {\n this.{{localVariablePrefix}}apiClient = apiClient != null ? apiClient : Configuration.getDefaultApiClient();\n }\n\n public ApiClient getApiClient() {\n return {{localVariablePrefix}}apiClient;\n }\n\n public void setApiClient(ApiClient apiClient) {\n this.{{localVariablePrefix}}apiClient = apiClient;\n }\n\n {{#operation}}\n /**\n * {{summary}}\n * {{notes}}\n {{#allParams}}\n * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}\n {{/allParams}}\n * @param resultHandler Asynchronous result handler\n */\n public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> resultHandler) {\n Object {{localVariablePrefix}}localVarBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};\n {{#allParams}}{{#required}}\n // verify the required parameter '{{paramName}}' is set\n if ({{paramName}} == null) {\n resultHandler.handle(ApiException.fail(400, \"Missing the required parameter '{{paramName}}' when calling {{operationId}}\"));\n return;\n }\n {{/required}}{{/allParams}}\n // create path and map variables\n String {{localVariablePrefix}}localVarPath = \"{{{path}}}\"{{#pathParams}}.replaceAll(\"\\\\{\" + \"{{baseName}}\" + \"\\\\}\", {{{paramName}}}.toString()){{/pathParams}};\n\n // query params\n List {{localVariablePrefix}}localVarQueryParams = new ArrayList<>();\n {{#queryParams}}\n {{localVariablePrefix}}localVarQueryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs(\"{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}\", \"{{baseName}}\", {{paramName}}));\n {{/queryParams}}\n\n // header params\n MultiMap {{localVariablePrefix}}localVarHeaderParams = MultiMap.caseInsensitiveMultiMap();\n {{#headerParams}}if ({{paramName}} != null)\n {{localVariablePrefix}}localVarHeaderParams.add(\"{{baseName}}\", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));\n {{/headerParams}}\n\n // form params\n // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client)\n Map {{localVariablePrefix}}localVarFormParams = new HashMap<>();\n {{#formParams}}if ({{paramName}} != null) {{localVariablePrefix}}localVarFormParams.put(\"{{baseName}}\", {{paramName}});\n {{/formParams}}\n\n String[] {{localVariablePrefix}}localVarAccepts = { {{#produces}}\"{{{mediaType}}}\"{{#hasMore}}, {{/hasMore}}{{/produces}} };\n String[] {{localVariablePrefix}}localVarContentTypes = { {{#consumes}}\"{{{mediaType}}}\"{{#hasMore}}, {{/hasMore}}{{/consumes}} };\n String[] {{localVariablePrefix}}localVarAuthNames = new String[] { {{#authMethods}}\"{{name}}\"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };\n {{#returnType}}\n TypeReference<{{{returnType}}}> {{localVariablePrefix}}localVarReturnType = new TypeReference<{{{returnType}}}>() {};\n {{localVariablePrefix}}apiClient.invokeAPI({{localVariablePrefix}}localVarPath, \"{{httpMethod}}\", {{localVariablePrefix}}localVarQueryParams, {{localVariablePrefix}}localVarBody, {{localVariablePrefix}}localVarHeaderParams, {{localVariablePrefix}}localVarFormParams, {{localVariablePrefix}}localVarAccepts, {{localVariablePrefix}}localVarContentTypes, {{localVariablePrefix}}localVarAuthNames, {{localVariablePrefix}}localVarReturnType, resultHandler);{{/returnType}}{{^returnType}}\n {{localVariablePrefix}}apiClient.invokeAPI({{localVariablePrefix}}localVarPath, \"{{httpMethod}}\", {{localVariablePrefix}}localVarQueryParams, {{localVariablePrefix}}localVarBody, {{localVariablePrefix}}localVarHeaderParams, {{localVariablePrefix}}localVarFormParams, {{localVariablePrefix}}localVarAccepts, {{localVariablePrefix}}localVarContentTypes, {{localVariablePrefix}}localVarAuthNames, null, resultHandler);{{/returnType}}\n }\n {{/operation}}\n}\n{{/operations}}\n"} +{"text": "usr/bin/calico-felix usr/bin\nusr/lib/calico/bpf/* usr/lib/calico/bpf\nusr/etc/calico/felix.cfg.example etc/calico\n"} +{"text": "{- Andrew Tolmach and Thomas Nordin's contraint solver\n\n See Proceedings of WAAAPL '99\n-}\n\nimport Prelude hiding (Maybe(Just,Nothing))\nimport Data.List\nimport System.Environment\n\n-----------------------------\n-- The main program\n-----------------------------\n\nmain = do\n [arg] <- getArgs\n let\n n = read arg :: Int\n try algorithm = print (length (search algorithm (queens n)))\n sequence_ (map try [bt, bm, bjbt, bjbt', fc])\n\n-----------------------------\n-- Figure 1. CSPs in Haskell.\n-----------------------------\n\ntype Var = Int\ntype Value = Int\n\ndata Assign = Var := Value deriving (Eq, Ord, Show)\n\ntype Relation = Assign -> Assign -> Bool\n\ndata CSP = CSP { vars, vals :: Int, rel :: Relation }\n\ntype State = [Assign]\n\nlevel :: Assign -> Var\nlevel (var := val) = var\n\nvalue :: Assign -> Value\nvalue (var := val) = val\n\nmaxLevel :: State -> Var\nmaxLevel [] = 0\nmaxLevel ((var := val):_) = var\n\ncomplete :: CSP -> State -> Bool\ncomplete CSP{vars=vars} s = maxLevel s == vars\n\ngenerate :: CSP -> [State]\ngenerate CSP{vals=vals,vars=vars} = g vars\n where g 0 = [[]]\n g var = [ (var := val):st | val <- [1..vals], st <- g (var-1) ]\n\ninconsistencies :: CSP -> State -> [(Var,Var)]\ninconsistencies CSP{rel=rel} as = [ (level a, level b) | a <- as, b <- reverse as, a > b, not (rel a b) ]\n\nconsistent :: CSP -> State -> Bool\nconsistent csp = null . (inconsistencies csp)\n\ntest :: CSP -> [State] -> [State]\ntest csp = filter (consistent csp)\n\nsolver :: CSP -> [State]\nsolver csp = test csp candidates\n where candidates = generate csp\n\nqueens :: Int -> CSP\nqueens n = CSP {vars = n, vals = n, rel = safe}\n where safe (i := m) (j := n) = (m /= n) && abs (i - j) /= abs (m - n)\n\n-------------------------------\n-- Figure 2. Trees in Haskell.\n-------------------------------\n\ndata Tree a = Node a [Tree a]\n\nlabel :: Tree a -> a\nlabel (Node lab _) = lab\n\ntype Transform a b = Tree a -> Tree b\n\nmapTree :: (a -> b) -> Transform a b\nmapTree f (Node a cs) = Node (f a) (map (mapTree f) cs)\n\nfoldTree :: (a -> [b] -> b) -> Tree a -> b\nfoldTree f (Node a cs) = f a (map (foldTree f) cs)\n\nfilterTree :: (a -> Bool) -> Transform a a\nfilterTree p = foldTree f\n where f a cs = Node a (filter (p . label) cs)\n\nprune :: (a -> Bool) -> Transform a a\nprune p = filterTree (not . p)\n\nleaves :: Tree a -> [a]\nleaves (Node leaf []) = [leaf]\nleaves (Node _ cs) = concat (map leaves cs)\n\ninitTree :: (a -> [a]) -> a -> Tree a\ninitTree f a = Node a (map (initTree f) (f a))\n\n--------------------------------------------------\n-- Figure 3. Simple backtracking solver for CSPs.\n--------------------------------------------------\n\nmkTree :: CSP -> Tree State\nmkTree CSP{vars=vars,vals=vals} = initTree next []\n where next ss = [ ((maxLevel ss + 1) := j):ss | maxLevel ss < vars, j <- [1..vals] ]\n\ndata Maybe a = Just a | Nothing deriving Eq\n\nearliestInconsistency :: CSP -> State -> Maybe (Var,Var)\nearliestInconsistency CSP{rel=rel} [] = Nothing\nearliestInconsistency CSP{rel=rel} (a:as) =\n case filter (not . rel a) (reverse as) of\n [] -> Nothing\n (b:_) -> Just (level a, level b)\n\nlabelInconsistencies :: CSP -> Transform State (State,Maybe (Var,Var))\nlabelInconsistencies csp = mapTree f\n where f s = (s,earliestInconsistency csp s)\n\nbtsolver0 :: CSP -> [State]\nbtsolver0 csp =\n (filter (complete csp) . leaves . (mapTree fst) . prune ((/= Nothing) . snd)\n . (labelInconsistencies csp) . mkTree) csp\n\n-----------------------------------------------\n-- Figure 6. Conflict-directed solving of CSPs.\n-----------------------------------------------\n\ndata ConflictSet = Known [Var] | Unknown deriving Eq\n\nknownConflict :: ConflictSet -> Bool\nknownConflict (Known (a:as)) = True\nknownConflict _ = False\n\nknownSolution :: ConflictSet -> Bool\nknownSolution (Known []) = True\nknownSolution _ = False\n\ncheckComplete :: CSP -> State -> ConflictSet\ncheckComplete csp s = if complete csp s then Known [] else Unknown\n\ntype Labeler = CSP -> Transform State (State, ConflictSet)\n\nsearch :: Labeler -> CSP -> [State]\nsearch labeler csp =\n (map fst . filter (knownSolution . snd) . leaves . prune (knownConflict . snd) . labeler csp . mkTree) csp\n\nbt :: Labeler\nbt csp = mapTree f\n where f s = (s,\n case earliestInconsistency csp s of\n Nothing -> checkComplete csp s\n Just (a,b) -> Known [a,b])\n\nbtsolver :: CSP -> [State]\nbtsolver = search bt\n\n-------------------------------------\n-- Figure 7. Randomization heuristic.\n-------------------------------------\n\nhrandom :: Int -> Transform a a\nhrandom seed (Node a cs) = Node a (randomList seed' (zipWith hrandom (randoms seed') cs))\n where seed' = random seed\n\nbtr :: Int -> Labeler\nbtr seed csp = bt csp . hrandom seed\n\n---------------------------------------------\n-- Support for random numbers (not in paper).\n---------------------------------------------\n\nrandom2 :: Int -> Int\nrandom2 n = if test > 0 then test else test + 2147483647\n where test = 16807 * lo - 2836 * hi\n hi = n `div` 127773\n lo = n `rem` 127773\n\nrandoms :: Int -> [Int]\nrandoms = iterate random2\n\nrandom :: Int -> Int\nrandom n = (a * n + c) -- mod m\n where a = 994108973\n c = a\n\nrandomList :: Int -> [a] -> [a]\nrandomList i as = map snd (sortBy (\\(a,b) (c,d) -> compare a c) (zip (randoms i) as))\n\n-------------------------\n-- Figure 8. Backmarking.\n-------------------------\n\ntype Table = [Row] -- indexed by Var\ntype Row = [ConflictSet] -- indexed by Value\n\nbm :: Labeler\nbm csp = mapTree fst . lookupCache csp . cacheChecks csp (emptyTable csp)\n\nemptyTable :: CSP -> Table\nemptyTable CSP{vars=vars,vals=vals} = []:[[Unknown | m <- [1..vals]] | n <- [1..vars]]\n\ncacheChecks :: CSP -> Table -> Transform State (State, Table)\ncacheChecks csp tbl (Node s cs) =\n Node (s, tbl) (map (cacheChecks csp (fillTable s csp (tail tbl))) cs)\n\nfillTable :: State -> CSP -> Table -> Table\nfillTable [] csp tbl = tbl\nfillTable ((var' := val'):as) CSP{vars=vars,vals=vals,rel=rel} tbl =\n zipWith (zipWith f) tbl [[(var,val) | val <- [1..vals]] | var <- [var'+1..vars]]\n where f cs (var,val) = if cs == Unknown && not (rel (var' := val') (var := val)) then\n Known [var',var]\n else cs\n\nlookupCache :: CSP -> Transform (State, Table) ((State, ConflictSet), Table)\nlookupCache csp t = mapTree f t\n where f ([], tbl) = (([], Unknown), tbl)\n f (s@(a:_), tbl) = ((s, cs), tbl)\n where cs = if tableEntry == Unknown then checkComplete csp s else tableEntry\n tableEntry = (head tbl)!!(value a-1)\n\n--------------------------------------------\n-- Figure 10. Conflict-directed backjumping.\n--------------------------------------------\n\nbjbt :: Labeler\nbjbt csp = bj csp . bt csp\n\nbjbt' :: Labeler\nbjbt' csp = bj' csp . bt csp\n\nbj :: CSP -> Transform (State, ConflictSet) (State, ConflictSet)\nbj csp = foldTree f\n where f (a, Known cs) chs = Node (a,Known cs) chs\n f (a, Unknown) chs = Node (a,Known cs') chs\n where cs' = combine (map label chs) []\n\ncombine :: [(State, ConflictSet)] -> [Var] -> [Var]\ncombine [] acc = acc\ncombine ((s, Known cs):css) acc =\n if maxLevel s `notElem` cs then cs else combine css (cs `union` acc)\n\nbj' :: CSP -> Transform (State, ConflictSet) (State, ConflictSet)\nbj' csp = foldTree f\n where f (a, Known cs) chs = Node (a,Known cs) chs\n f (a, Unknown) chs = if knownConflict cs' then Node (a,cs') [] else Node (a,cs') chs\n where cs' = Known (combine (map label chs) [])\n\n-------------------------------\n-- Figure 11. Forward checking.\n-------------------------------\n\nfc :: Labeler\nfc csp = domainWipeOut csp . lookupCache csp . cacheChecks csp (emptyTable csp)\n\ncollect :: [ConflictSet] -> [Var]\ncollect [] = []\ncollect (Known cs:css) = cs `union` (collect css)\n\ndomainWipeOut :: CSP -> Transform ((State, ConflictSet), Table) (State, ConflictSet)\ndomainWipeOut CSP{vars=vars} t = mapTree f t\n where f ((as, cs), tbl) = (as, cs')\n where wipedDomains = ([vs | vs <- tbl, all (knownConflict) vs])\n cs' = if null wipedDomains then cs else Known (collect (head wipedDomains))\n\n\n\n\n"} +{"text": "/** @file\r\n\r\n Definitions for the VirtIo MMIO Device Library\r\n\r\n Copyright (C) 2013, ARM Ltd\r\n\r\n This program and the accompanying materials are licensed and made available\r\n under the terms and conditions of the BSD License which accompanies this\r\n distribution. The full text of the license may be found at\r\n http://opensource.org/licenses/bsd-license.php\r\n\r\n THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN \"AS IS\" BASIS, WITHOUT\r\n WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r\n\r\n**/\r\n\r\n#ifndef _VIRTIO_MMIO_DEVICE_LIB_H_\r\n#define _VIRTIO_MMIO_DEVICE_LIB_H_\r\n\r\n/**\r\n\r\n Initialize VirtIo Device and Install VIRTIO_DEVICE_PROTOCOL protocol\r\n\r\n @param[in] BaseAddress Base Address of the VirtIo MMIO Device\r\n\r\n @param[in] Handle Handle of the device the driver should be attached\r\n to.\r\n\r\n @retval EFI_SUCCESS The VirtIo Device has been installed\r\n successfully.\r\n\r\n @retval EFI_OUT_OF_RESOURCES The function failed to allocate memory required\r\n by the Virtio MMIO device initialization.\r\n\r\n @retval EFI_UNSUPPORTED BaseAddress does not point to a VirtIo MMIO\r\n device.\r\n\r\n @return Status code returned by InstallProtocolInterface\r\n Boot Service function.\r\n\r\n**/\r\nEFI_STATUS\r\nVirtioMmioInstallDevice (\r\n IN PHYSICAL_ADDRESS BaseAddress,\r\n IN EFI_HANDLE Handle\r\n );\r\n\r\n/**\r\n\r\n Uninstall the VirtIo Device\r\n\r\n @param[in] Handle Handle of the device where the VirtIo Device protocol\r\n should have been installed.\r\n\r\n @retval EFI_SUCCESS The device has been un-initialized successfully.\r\n\r\n @return Status code returned by UninstallProtocolInterface\r\n Boot Service function.\r\n\r\n**/\r\nEFI_STATUS\r\nVirtioMmioUninstallDevice (\r\n IN EFI_HANDLE Handle\r\n );\r\n\r\n#endif // _VIRTIO_MMIO_DEVICE_LIB_H_\r\n"} +{"text": "\n\n\n\n\n\n\n\n \n TaskState (Gradle API 2.0)\n \n \n \n \n \n\n\n\n

JavaScript is disabled on your browser.
\n\n\n
\n \n\n \n\n \n
\n\n
\n
\n \n
\n
\n
    \n
  • Summary: 
  • \n Nested   Field      
  • Method
  •    \n
\n
    \n
  •  | Detail: 
  • \n Field      
  • Method
  •    \n
\n
\n \n \n
\n\n\n\n
\n\n
Package: org.gradle.api.tasks
\n\n

[Java] Interface TaskState

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

    TaskState provides information about the execution state of a Task. You can obtain a\n TaskState instance by calling Task.getState.\n

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

      Methods Summary

      \n
        \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
        Methods 
        TypeName and description
        booleangetDidWork()
        booleangetExecuted()
        ThrowablegetFailure()
        Returns the exception describing the task failure, if any.
        StringgetSkipMessage()
        Returns a message describing why the task was skipped.
        booleangetSkipped()
        Returns true if the execution of this task was skipped for some reason.
        voidrethrowFailure()
        Throws the task failure, if any.
        \n
      \n
    • \n \n
    \n \n
  • \n
\n
\n\n
\n
    \n
  • \n \n\n \n\n \n\n \n\n \n\n\n \n \n
      \n
    • \n \n \n

      Method Detail

      \n \n \n
        \n
      • \n

        public boolean getDidWork()

        \n

        Checks if the task actually did any work. Even if a task executes, it may determine that it has nothing to\n do. For example, a compilation task may determine that source files have not changed since the last time a the\n task was run.

        \n
        Returns:
        true if this task has been executed and did any work.

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

        public boolean getExecuted()

        \n

        Returns true if this task has been executed.

        \n
        Returns:
        true if this task has been executed.

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

        @Nullable\npublic Throwable getFailure()

        \n

        Returns the exception describing the task failure, if any.\n

        Returns:
        The exception, or null if the task did not fail.

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

        @Nullable\npublic String getSkipMessage()

        \n

        Returns a message describing why the task was skipped.\n

        Returns:
        the message. returns null if the task was not skipped.

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

        public boolean getSkipped()

        \n

        Returns true if the execution of this task was skipped for some reason.\n

        Returns:
        true if this task has been executed and skipped.

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

        public void rethrowFailure()

        \n

        Throws the task failure, if any. Does nothing if the task did not fail.\n

        \n
      • \n
      \n \n
    • \n
    \n \n
  • \n
\n
\n\n\n\n
\n \n\n \n\n \n
\n\n
\n
\n \n
\n
\n
    \n
  • Summary: 
  • \n Nested   Field      
  • Method
  •    \n
\n
    \n
  •  | Detail: 
  • \n Field      
  • Method
  •    \n
\n
\n

Gradle API 2.0

\n \n \n \n
\n
\n\n\n\n"} +{"text": "easyblock = 'CMakeMake'\n\nname = 'openkim-models'\nversion = '20190725'\n\nhomepage = 'https://openkim.org/'\ndescription = \"\"\"Open Knowledgebase of Interatomic Models.\n\nOpenKIM is an API and a collection of interatomic models (potentials) for\natomistic simulations. It is a library that can be used by simulation programs\nto get access to the models in the OpenKIM database.\n\nThis EasyBuild installs the models. The API itself is in the kim-api\npackage.\n \"\"\"\n\ntoolchain = {'name': 'intel', 'version': '2019a'}\n\nbuilddependencies = [\n ('pkgconfig', '1.5.1', '-python'),\n]\n\ndependencies = [\n ('kim-api', '2.1.2'),\n]\n\nsource_urls = ['https://s3.openkim.org/archives/collection/']\nsources = ['openkim-models-2019-07-25.txz']\nchecksums = ['50338084ece92ec0fb13b0bbdf357b5d7450e26068ba501f23c315f814befc26']\n\nseparate_build_dir = True\nabs_path_compilers = True # Otherwise some KIM-API magic breaks cmake.\nconfigopts = '-DKIM_API_INSTALL_COLLECTION=SYSTEM '\nconfigopts += '-DKIM_API_PORTABLE_MODEL_INSTALL_PREFIX=%(installdir)s/lib/kim-api/portable-models '\nconfigopts += '-DKIM_API_SIMULATOR_MODEL_INSTALL_PREFIX=%(installdir)s/lib/kim-api/simulator-models '\nconfigopts += '-DKIM_API_MODEL_DRIVER_INSTALL_PREFIX=%(installdir)s/lib/kim-api/model-drivers '\n\nsanity_check_paths = {\n 'files': [],\n 'dirs': ['lib/kim-api/model-drivers', 'lib/kim-api/portable-models', 'lib/kim-api/simulator-models']\n}\n\nmodextravars = {\n 'KIM_API_MODEL_DRIVERS_DIR': '%(installdir)s/lib/kim-api/model-drivers',\n 'KIM_API_PORTABLE_MODELS_DIR': '%(installdir)s/lib/kim-api/portable-models',\n 'KIM_API_SIMULATOR_MODELS_DIR': '%(installdir)s/lib/kim-api/simulator-models',\n}\n\n\nmoduleclass = 'chem'\n"} +{"text": "\\begin{verbatim}\n CARDS CM_$DYNVMLC\n ********************\n -1 Dummy line to indicate start of CM\n\n 0 RMAX_CM(ICM_$DYNVMLC) (F10.5): Half-width of CM boundary (cm).\n\n 1 TITLE_$DYNVMLC (60A1): Title of CM.\n\n 2 ORIENT_$DYNVMLC, NGROUP_$DYNVMLC, MODE_$DYNVMLC (3I5)\n\n ORIENT_$DYNVMLC = 0 for leaves parallel to Y direction\n = 1 for leaves parallel to X direction\n NGROUP_$DYNVMLC = number of groups of adjacent leaves where\n all leaves in a group are:\n 1. FULL leaves\n 2. TARGET/ISOCENTER pairs with TARGET leaf\n on the -X (ORIENT=0) or -Y (ORIENT=1) side\n NGROUP_$DYNVMLC defaults to 3 if set <=0\n MODE_$DYNVMLC = 0 for single setting of leaf openings (static\n field)\n = 1 for dynamic mlc delivery--simulated leaf\n movement while beam is on\n = 2 for step-and-shoot delivery--beam off while\n leaf positions change\n\n 3 ZMIN_$DYNVMLC (F15.0): Z of top of MLC (excluding airgap)\n\n 4 ZTHICK_$DYNVMLC (F15.0): Thickness of the leaves ( z-axis (cm))\n\n 5 LEAFWIDTH_$DYNVMLC(1), WTONGUE_$DYNVMLC(1), WGROOVE_$DYNVMLC(1),\n WTIP_$DYNVMLC(1), WRAILTOP_$DYNVMLC(1), WRAILBOT_$DYNVMLC(1),\n ZTIP_$DYNVMLC(1), ZLEAF_$DYNVMLC(1), ZTONGUE_$DYNVMLC(1),\n ZGROOVE_$DYNVMLC(1), ZHOLETOP_$DYNVMLC(1), ZHOLEBOT_$DYNVMLC(1),\n HOLEPOS_FULL_$DYNVMLC, ZRAILTOP_$DYNVMLC(1), ZRAILBOT_$DYNVMLC(1)\n (15F15.0)\n\n For a FULL type leaf (all dimensions in cm--all widths are\n projected back to ZMIN_$DYNVMLC):\n\n LEAFWIDTH_$DYNVMLC(1): Width of leaf (not including tongue)\n WTONGUE_$DYNVMLC(1): Width of tongue\n WGROOVE_$DYNVMLC(1): Width of groove\n WTIP_$DYNVMLC(1): Width of tip at top of leaf\n WRAILTOP_$DYNVMLC(1): Width of top of support rail\n WRAILBOT_$DYNVMLC(1): Width of bottom of support rail\n ZTIP_$DYNVMLC(1): Z at which tip at top of leaf begins\n ZLEAF_$DYNVMLC(1): Z of top of leaf\n ZTONGUE_$DYNVMLC(1): Z of bottom of tongue\n ZGROOVE_$DYNVMLC(1): Z of bottom of groove\n ZHOLETOP_$DYNVMLC(1): Z of top of driving screw hole\n ZHOLEBOT_$DYNVMLC(1): Z of bottom of driving screw hole\n HOLEPOS_FULL_$DYNVMLC: Distance of hole from leaf tip\n ZRAILTOP_$DYNVMLC(1): Z of top of support rail\n ZRAILBOT_$DYNVMLC(1): Z of bottom of support rail\n\n Note: Z positions are input in order of increasing Z. Thus\n ZLEAF_$DYNVMLC(1)>=ZTIP_$DYNVMLC(1), etc. See the BEAM\n manual or GUI help for restrictions on widths.\n\n\n 6 LEAFWIDTH_$DYNVMLC(2), WTONGUE_$DYNVMLC(2), WGROOVE_$DYNVMLC(2),\n WTIP_$DYNVMLC(2), WRAILTOP_$DYNVMLC(2), WRAILBOT_$DYNVMLC(2),\n ZRAILTOP_$DYNVMLC(2), ZRAILBOT_$DYNVMLC(2), ZHOLETOP_$DYNVMLC(2),\n ZHOLEBOT_$DYNVMLC(2), HOLEPOS_TAR_$DYNVMLC, ZTONGUE_$DYNVMLC(2),\n ZGROOVE_$DYNVMLC(2), ZLEAF_$DYNVMLC(2), ZTIP_$DYNVMLC(2) (15F15.0)\n\n For a TARGET type leaf (all dimensions in cm--all widths are\n projected back to ZMIN_$DYNVMLC):\n\n LEAFWIDTH_$DYNVMLC(2): Width of leaf (not including tongue)\n WTONGUE_$DYNVMLC(2): Width of tongue\n WGROOVE_$DYNVMLC(2): Width of groove\n WTIP_$DYNVMLC(2): Width of tip at bottom of leaf\n WRAILTOP_$DYNVMLC(2): Width of top of support rail\n WRAILBOT_$DYNVMLC(2): Width of bottom of support rail\n ZRAILTOP_$DYNVMLC(2): Z of top of support rail\n ZRAILBOT_$DYNVMLC(2): Z of bottom of support rail\n ZHOLETOP_$DYNVMLC(2): Z of top of driving screw hole\n ZHOLEBOT_$DYNVMLC(2): Z of bottom of driving screw hole\n HOLEPOS_TAR_$DYNVMLC: Distance of hole from leaf tip\n ZTONGUE_$DYNVMLC(2): Z of bottom of tongue\n ZGROOVE_$DYNVMLC(2): Z of top of groove\n ZLEAF_$DYNVMLC(2): Z of bottom of leaf\n ZTIP_$DYNVMLC(2): Z of bottom of tip at bottom of leaf\n\n Note: Z positions are input in order of increasing Z. Thus\n ZLEAF_$DYNVMLC(1)>=ZTIP_$DYNVMLC(1), etc. See the BEAM\n manual or GUI help for restrictions on widths.\n\n\n 7 LEAFWIDTH_$DYNVMLC(3), WTONGUE_$DYNVMLC(3), WGROOVE_$DYNVMLC(3),\n WTIP_$DYNVMLC(3), WRAILTOP_$DYNVMLC(3), WRAILBOT_$DYNVMLC(3),\n ZTIP_$DYNVMLC(3), ZLEAF_$DYNVMLC(3), ZTONGUE_$DYNVMLC(3),\n ZGROOVE_$DYNVMLC(3), ZHOLETOP_$DYNVMLC(3), ZHOLEBOT_$DYNVMLC(3),\n HOLEPOS_ISO_$DYNVMLC, ZRAILTOP_$DYNVMLC(3), ZRAILBOT_$DYNVMLC(3)\n (15F15.0)\n\n For a ISOCENTER type leaf (all dimensions in cm--all widths are\n projected back to ZMIN_$DYNVMLC):\n\n LEAFWIDTH_$DYNVMLC(3): Width of leaf (not including tongue)\n WTONGUE_$DYNVMLC(3): Width of tongue\n WGROOVE_$DYNVMLC(3): Width of groove\n WTIP_$DYNVMLC(3): Width of tip at top of leaf\n WRAILTOP_$DYNVMLC(3): Width of top of support rail\n WRAILBOT_$DYNVMLC(3): Width of bottom of support rail\n ZTIP_$DYNVMLC(3): Z at which tip at top of leaf begins\n ZLEAF_$DYNVMLC(3): Z of top of leaf\n ZTONGUE_$DYNVMLC(3): Z of top of tongue\n ZGROOVE_$DYNVMLC(3): Z of bottom of groove\n ZHOLETOP_$DYNVMLC(3): Z of top of driving screw hole\n ZHOLEBOT_$DYNVMLC(3): Z of bottom of driving screw hole\n HOLEPOS_ISO_$DYNVMLC: Distance of hole from leaf tip\n ZRAILTOP_$DYNVMLC(3): Z of top of support rail\n ZRAILBOT_$DYNVMLC(3): Z of bottom of support rail\n\n Note: Z positions are input in order of increasing Z. Thus\n ZLEAF_$DYNVMLC(1)>=ZTIP_$DYNVMLC(1), etc. See the BEAM\n manual or GUI help for restrictions on widths.\n\n Note: 1. For TARGET and ISOCENTER leaves to fit together,\n ZTONGUE_$DYNVMLC(3)>=ZGROOVE_$DYNVMLC(2) and\n ZTONGUE_$DYNVMLC(2)<=ZGROOVE_$DYNVMLC(3).\n 2. For TARGET and FULL leaves to fit together (FULL\n leaf on -X [ORIENT=0] or -Y [ORIENT=1] side of TARGET\n leaf only) ZTONGUE_$DYNVMLC(2)<=ZGROOVE_$DYNVMLC(1)\n 3. For ISOCENTER and FULL leaves to fit together (FULL\n leaf on +X [ORIENT=0] or +Y [ORIENT=1] side of ISOCENTER\n leaf only) ZTONGUE_$DYNVMLC(1)<=ZGROOVE_$DYNVMLC(3)\n\n\n Repeat 8 NGROUP_$DYNVMLC times\n\n 8 NUM_LEAF_$DYNVMLC(I), LEAFTYPE (2I5)\n\n NUM_LEAF_$DYNVMLC(I): Number of adjacent leaves in group I\n LEAFTYPE: Type of leaf in group I.\n Set to: 1 for FULL leaves\n 2 for TARGET/ISOCENTER pair with\n TARGET leaf on the -X (ORIENT=0)\n or -Y (ORIENT=1) side\n\n Note: If LEAFTYPE is 2, then you must have an even number\n of leaves in the group.\n\n 9 START_$DYNVMLC (F15.0) : the start position (cm) wrt the CAX of\n leaf 1 as projected to ZMIN_$DYNVMLC.\n\n 10 LEAFGAP_$DYNVMLC (F15.5) : The width of the interleaf air gap\n at ZMIN_$DYNVMLC.\n\n Note restriction: LEAFGAP_$DYNVMLC<=WTONGUE_$DYNVMLC(1,2,3),\n\n 11 ENDTYPE_$DYNVMLC (I5) : The type of leaf end :\n 0 -- rounded leaf end and\n 1 -- focused divergent leaf end.\n\n 12 ZFOCUS_$DYNVMLC (F15.5) : Focal point on Z-axis of leaf ends\n (i.e. imaginary lines drawn extending the slopes\n of leaf ends will all intersect the Z-axis\n at this point) - chosen if ENDTYPE_$DYNVMLC = 1.\n\n Note restriction: ZFOCUS_$DYNVMLC(1) < ZMIN_$DYNVMLC or\n > ZMIN_$DYNVMLC + ZTHICK_$DYNVMLC\n\n LEAFRADIUS_$DYNVMLC (F15.5) : Radius of the leaf end if\n ENDTYPE_$DYNVMLC = 0. This must be greater\n than or equal to half the leaf thickness.\n\n 13 ZFOCUS_$DYNVMLC(1) (F15.5): Focal point on Z-axis of leaf sides\n imaginary lines drawn extending the slopes of\n the leaf sides will all intersect the Z-axis\n at this point)\n\n Note restriction: ZFOCUS_$DYNVMLC(1) < ZMIN_$DYNVMLC or\n > ZMIN_$DYNVMLC + ZTHICK_$DYNVMLC\n\n For focused ends the leaf position is defined\n at ZMIN_$DYNVMLC; for rounded at ZMIN_$DYNVMLC +\n 0.5*ZTHICK_$DYNVMLC (ie center of the leaf in z)\n\n If MODE_$DYNVMLC=0 (static field):\n\n Repeat 14a until opening coordinates of all leaves are defined once.\n Leaves are numbered 1,2,...TOT_LEAF_$DYNVMLC, where numbering goes from\n leaf 1 to leaf TOT_LEAF_$DYNVMLC. Convention is lower to upper or\n left to right depending on ORIENT_$DYNVMLC i.e from negative to\n positive. Note that for dynamic or step-and-shoot simulations, these\n are the default coordinates, used unless specified otherwise in the\n file of leaf opening data input in line 14a (see below).\n\n 14a NEG_$DYNVMLC, POS_$DYNVMLC, NUM_$DYNVMLC (2F15.5,I5)\n\n NEG_$DYNVMLC: Min. Y (ORIENT_$DYNVMLC=0) or X (ORIENT_$DYNVMLC=1)\n of front opening in leaf I (ie the opening at\n ZMIN_$DYNVMLC) if ENDTYPE=1, or of rounded end\n of leaf I if ENDTYPE=0.\n POS_$DYNVMLC: Max. Y (ORIENT_$DYNVMLC=0) or X (ORIENT_$DYNVMLC=1)\n of front opening in leaf I if ENDTYPE=1, or of\n rounded end of leaf I if ENDTYPE=0.\n NUM_$DYNVMLC: Apply NEG_$DYNVMLC and POS_$DYNVMLC to leaves\n I,...,I+NUM_$DYNVMLC-1. Defaults to 1 if set <=0.\n Defaults to TOT_LEAF_$DYNVMLC-I+1 if set >\n TOT_LEAF_$DYNVMLC-I+1.\n\n If MODE_$DYNVMLC=1 or 2 (dynamic delivery or step-and-shoot delivery):\n\n 14b mlc_file (A256)\n\n mlc_file: The full name of the file containing leaf opening\n data. The format of the file contents is as follows:\n\n MLC_TITLE (A80)\n NFIELDS_$DYNVMLC (I10)\n FOR I=1,NFIELDS_$DYNVMLC[\n INDEX_$DYNVMLC(I) (F15.0)\n NEG_$DYNVMLC, POS_$DYNVMLC, NUM_$DYNVMLC (2F15.0,I5) -- repeat this\n line until\n coordinates\n for all leaves\n have been\n defined for\n field I.\n ]\n\n where:\n\n MLC_TITLE: A title line\n NFIELDS_$DYNVMLC: Total number of fields\n INDEX_$DYNVMLC(I): Index of field I. 0 <= INDEX_$DYNVMLC(I) <= 1 and\n INDEX_$DYNVMLC(I) > INDEX_$DYNVMLC(I-1). This\n number is compared to a random number on (0,1) at\n the start of each history; if the random number is\n <= INDEX_$DYNVMLC(I), then field I is used.\n NEG_$DYNVMLC: Min. Y (ORIENT_$DYNVMLC=0) or X (ORIENT_$DYNVMLC=1)\n of front opening in leaf (ie the opening at\n ZMIN_$DYNVMLC) if ENDTYPE=1, or of rounded end\n of leaf if ENDTYPE=0 for leaf J in field I.\n POS_$DYNVMLC: Max. Y (ORIENT_$DYNVMLC=0) or X (ORIENT_$DYNVMLC=1)\n of front opening in leaf if ENDTYPE=1, or of\n rounded end of leaf if ENDTYPE=0 for leaf J in\n field I.\n NUM_$DYNVMLC: Apply NEG_$DYNVMLC and POS_$DYNVMLC to leaves\n J,...,J+NUM_$DYNVMLC-1. Defaults to 1 if set <=0.\n Defaults to TOT_LEAF_$DYNVMLC-J+1 if set >\n TOT_LEAF_$DYNVMLC-J+1.\n\n Note that the inputs NEG_$DYNVMLC, POS_$DYNVMLC and NUM_$DYNVMLC have\n the same meanings as in 14a (static field inputs) but that they must\n now be repeated for every field I.\n\n 15 ECUT, PCUT, DOSE_ZONE, IREGION_TO_BIT in opening(s) and\n air gaps (2F15.5,2I5)\n\n ECUT, PCUT: Cutoff energies for electrons and photons.\n DOSE_ZONE: Dose scoring flag, 0 to not score dose\n IREGION_TO_BIT: Bit number associated with this region\n\n 16 MED_IN (24A1): Medium in opening(s) and air gaps\n used to set MED_INDEX.\n\n 17 ECUT, PCUT, DOSE_ZONE, IREGION_TO_BIT in leaves, IGNOREGAPS_$DYNVMLC\n (2F15.0,3I5):\n\n ECUT, PCUT: Cutoff energies for electrons and photons.\n DOSE_ZONE: Dose scoring flag, 0 to note score dose\n IREGION_TO_BIT: Bit number associated with this region\n IGNOREGAPS: If set to 1, ignore all air gaps and driving screw\n holes when doing range\n rejection in leaf material when the particle X position\n is < min X of all leaf openings (not including leaf\n ends) or > max X of leaf openings (not including ends)\n (ORIENT_$DYNVMLC=1) or if the particle Y position\n is < min Y of all leaf openings (not including leaf\n ends) or > max Y of leaf openings (not including ends)\n (ORIENT_$DYNVMLC=0). This approximation is designed\n to make range rejection more efficient deep in the\n leaves, while still preserving accurate transport\n in the leaf ends. Note that if you have significant\n air gaps between leaves or are concerned with the\n effects of the driving screw holes it is recommended\n that you not use this option (ie run with the default\n setting of 0).\n\n 18 MED_IN (24A1): Medium of leaves,\n used to set MED_INDEX.\n\n 19 ECUT, PCUT, DOSE_ZONE, IREGION_TO_BIT in driving screw holes\n (2F15.5,2I5):\n\n ECUT, PCUT: Cutoff energies for electrons and photons.\n DOSE_ZONE: Dose scoring flag, 0 to note score dose\n IREGION_TO_BIT: Bit number associated with this region\n\n 20 MED_IN (24A1): Medium in driving screw holes,\n used to set MED_INDEX.\n\n Example\n *******\n\n The following example defines a multi-leaf tungsten collimator design\n based loosely on that used with the Varian Millenium MLC.\n Actual parameters are DIFFERENT - this serves just as a template.\n Do not attempt to use these parameters for a simulation of the real\n machine.\n\n The collimator starts at Z=48.25 cm and has 60 tungsten leaves opening\n in the X direction. Leaves 1-10 and 51-60 are FULL and leaves 11-50 are\n TARGET/ISOCENTER pairs. The Z focus of the leaf sides is at Z=0 cm\n which is the position of the source. The leaf ends are rounded with a\n radius of 8 cm. In this example, leaf opening coordinates are chosen to\n create a square of width ~ 2cm centred on the beam axis.\n\n Electrons and photons in both the collimator and the opening regions\n will be followed down to kinetic energies of 189 keV (ECUT=0.7,\n PCUT=0.01). Dose deposited in the tungsten leaves will be stored\n in dose zone 2, and dose deposited in the opening will be stored\n in dose zone 1.\n\n 20.5, RMAX\n CL21X - Millenium MLC\n 1, 3, ORIENT, NGROUP\n 48.25, ZMIN\n 6.7, ZTHICK\n 0.5, 0.04, 0.04, 0.1354, 0.3252, 0.1227, 48.25, 48.533, 51.524, 51.732,\n 52.98, 53.28, 2, 54.5474, 54.812, FULL leaf\n 0.25, 0.04, 0.04, 0.0929, 0.132, 0.132, 48.345, 48.6096, 49.5277,\n 49.8277, 2, 51.625, 51.627, 54.7, 54.746, TARGET leaf\n 0.25, 0.04, 0.04, 0.0354, 0.1285, 0.1235, 48.412, 48.531, 51.631, 51.732,\n 53.3293, 53.6293, 2, 54.5474, 54.812, ISOCENTER leaf\n 10, 1, FULL leaves\n 40, 2, TARGET/ISOCENTER pairs\n 10, 1, FULL leaves\n -10.2, START\n 0.006, LEAFGAP\n 0, ENDTYPE\n 8, ZFOCUS or RADIUS of leaf ends\n 0, ZFOCUS of leaf sides\n 0, 0, 26\n -1.0, 1.0, 8\n 0,0,26\n 0.7, 0.01, 1, 0,\n AIR521ICRU\n 0.7, 0.01, 2, 0, 0,\n W521ICRU\n 0.7, 0.01, 3, 0,\n AIR521ICRU\n\\end{verbatim}\n"} +{"text": "// this is here for webpack to expose removeComponents as window.removeComponents\nimport getComponentFromElement from '../src/getComponentFromElement.js';\nmodule.exports = getComponentFromElement;"} +{"text": "# Copyright 2019 Gentoo Authors\n# Distributed under the terms of the GNU General Public License v2\n\nEAPI=7\nMY_PN=${PN%-bin}\n\ninherit user\n\nDESCRIPTION=\"Alerts dashboard for Prometheus Alertmanager\"\nHOMEPAGE=\"https://github.com/prymitive/karma\"\nSRC_URI=\"https://github.com/prymitive/${MY_PN}/releases/download/v${PV}/${MY_PN}-linux-amd64.tar.gz -> ${P}-amd64.tar.gz\"\n\nLICENSE=\"Apache-2.0\"\nSLOT=\"0\"\nKEYWORDS=\"~amd64\"\n\nQA_PREBUILT=\"usr/bin/*\"\nRESTRICT=\"strip\"\nS=\"${WORKDIR}\"\n\npkg_setup() {\n\tenewgroup ${MY_PN}\n\tenewuser ${MY_PN} -1 -1 -1 ${MY_PN}\n}\n\nsrc_install() {\n\tdobin karma-linux-amd64\n\tdosym karma-linux-amd64 /usr/bin/karma\n\tinsinto /etc/${MY_PN}\n\tnewins \"${FILESDIR}\"/${MY_PN}-0.24.yaml ${MY_PN}.yaml\n\tnewinitd \"${FILESDIR}\"/${MY_PN}.initd ${MY_PN}\nkeepdir /var/log/${MY_PN}\nfowners ${MY_PN}:${MY_PN} /var/log/${MY_PN}\n}\n\npkg_postinst() {\n\tif [[ -z \"${REPLACING_VERSIONS}\" ]]; then\n\t\telog \"Please edit ${EROOT}/etc/karma/karma.yaml to match your system.\"\n\tfi\n}\n"} +{"text": "/*\n * This file is part of ELKI:\n * Environment for Developing KDD-Applications Supported by Index-Structures\n *\n * Copyright (C) 2019\n * ELKI Development Team\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\npackage elki.visualization.parallel3d.util;\n\nimport java.awt.Font;\nimport java.awt.event.MouseEvent;\nimport java.awt.event.MouseListener;\nimport java.awt.geom.Rectangle2D;\nimport java.util.ArrayList;\n\nimport javax.media.opengl.GL2;\n\nimport com.jogamp.opengl.util.awt.TextRenderer;\n\n/**\n * Simple menu overlay.\n * \n * TODO: Hover effects?\n * \n * @author Erich Schubert\n * @since 0.6.0\n */\npublic abstract class SimpleMenuOverlay extends AbstractSimpleOverlay implements MouseListener {\n /**\n * Text renderer\n */\n TextRenderer renderer;\n\n /**\n * Options to display.\n */\n private ArrayList options = new ArrayList<>();\n\n /**\n * Font size.\n */\n int fontsize;\n\n /**\n * Constructor.\n */\n public SimpleMenuOverlay() {\n super();\n fontsize = 18;\n renderer = new TextRenderer(new Font(Font.SANS_SERIF, Font.PLAIN, fontsize));\n }\n\n @Override\n void renderContents(GL2 gl) {\n final int numopt = getOptions().size();\n\n double maxwidth = 0.;\n Rectangle2D[] bounds = new Rectangle2D[numopt];\n for (int i = 0; i < numopt; i++) {\n final String string = getOptions().get(i);\n if (string != null) {\n bounds[i] = renderer.getBounds(string);\n maxwidth = Math.max(bounds[i].getWidth(), maxwidth);\n }\n }\n final double padding = .5 * fontsize;\n final double margin = padding * .3;\n final float bx1 = (float) (.5 * (width - maxwidth - padding));\n final float bx2 = (float) (.5 * (width + maxwidth + padding));\n double totalheight = numopt * fontsize + (numopt - 1) * padding;\n\n // Render background buttons:\n gl.glBegin(GL2.GL_QUADS);\n gl.glColor4f(0f, 0f, 0f, .75f);\n for (int i = 0; i < numopt; i++) {\n if (bounds[numopt - i - 1] == null) {\n continue;\n }\n final double pos = (height - totalheight) * .5 + fontsize * i + padding * i;\n\n // Render a background button:\n gl.glVertex2f(bx1, (float) (pos - margin));\n gl.glVertex2f(bx1, (float) (pos + fontsize + margin));\n gl.glVertex2f(bx2, (float) (pos + fontsize + margin));\n gl.glVertex2f(bx2, (float) (pos - margin));\n }\n gl.glEnd();\n\n // Render text labels:\n renderer.beginRendering(width, height);\n renderer.setColor(1f, 1f, 1f, 1f);\n // NOTE: renderer uses (0,0) as BOTTOM left!\n for (int j = 0; j < numopt; j++) {\n if (bounds[j] == null) {\n continue;\n }\n final int i = numopt - j - 1;\n // Extra offset .17 * fontsize because of text baseline!\n final double pos = (height - totalheight) * .5 + fontsize * i + padding * i + .17 * fontsize;\n renderer.setColor(1f, 1f, 1f, 1f);\n renderer.draw(getOptions().get(j), (width - (int) bounds[j].getWidth()) >> 1, (int) pos);\n }\n renderer.endRendering();\n }\n\n @Override\n public void mouseClicked(MouseEvent e) {\n // close with right mouse button:\n if (e.getButton() == MouseEvent.BUTTON3) {\n menuItemClicked(-1);\n }\n if (e.getButton() != MouseEvent.BUTTON1) {\n return;\n }\n final int mx = e.getX(), my = e.getY();\n\n final int numopt = getOptions().size();\n double maxwidth = 0.;\n for (int i = 0; i < numopt; i++) {\n final String string = getOptions().get(i);\n if (string != null) {\n Rectangle2D bounds = renderer.getBounds(string);\n maxwidth = Math.max(bounds.getWidth(), maxwidth);\n }\n }\n final double padding = .5 * fontsize;\n final double margin = padding * .3;\n final float bx1 = (float) (.5 * (width - maxwidth - padding));\n final float bx2 = (float) (.5 * (width + maxwidth + padding));\n if (mx < bx1 || mx > bx2) {\n menuItemClicked(-1);\n return;\n }\n\n double totalheight = numopt * fontsize + (numopt - 1) * padding;\n for (int i = 0; i < numopt; i++) {\n final double pos = (height - totalheight) * .5 + fontsize * i + padding * i;\n if (my < pos - margin) {\n menuItemClicked(-1);\n return;\n }\n if (my < pos + fontsize + margin) {\n menuItemClicked(i);\n return;\n }\n }\n // Otherwise, close.\n menuItemClicked(-1);\n }\n\n /**\n * Callback when a menu item was clicked.\n * \n * @param item Item number that was clicked.\n */\n public abstract void menuItemClicked(int item);\n\n @Override\n public void mousePressed(MouseEvent e) {\n // Ignore\n }\n\n @Override\n public void mouseReleased(MouseEvent e) {\n // Ignore\n }\n\n @Override\n public void mouseEntered(MouseEvent e) {\n // Ignore\n }\n\n @Override\n public void mouseExited(MouseEvent e) {\n // Ignore\n }\n\n /**\n * @return the options\n */\n public ArrayList getOptions() {\n return options;\n }\n\n /**\n * @param options the options to set\n */\n public void setOptions(ArrayList options) {\n this.options = options;\n }\n}\n"} +{"text": "'use strict';\n\n// Modules\nconst _ = require('lodash');\n\n// Builder\nmodule.exports = {\n name: 'lagoon-php',\n config: {\n version: 'custom',\n path: [\n '/app/vendor/bin',\n '/usr/local/sbin',\n '/usr/local/bin',\n '/usr/sbin',\n '/usr/bin',\n '/sbin',\n '/bin',\n '/var/www/.composer/vendor/bin',\n ],\n confSrc: __dirname,\n command: '/sbin/tini -- /lagoon/entrypoints.sh /usr/local/sbin/php-fpm -F -R',\n volumes: ['/usr/local/bin'],\n },\n parent: '_lagoon',\n builder: (parent, config) => class LandoLagoonPhp extends parent {\n constructor(id, options = {}, factory) {\n options = _.merge({}, config, options);\n\n // Build the php\n const php = {\n environment: _.merge({}, options.environment, {\n PATH: options.path.join(':'),\n }),\n volumes: options.volumes,\n command: options.command,\n };\n\n // Add in the php service and push downstream\n super(id, options, {services: _.set({}, options.name, php)});\n };\n },\n};\n"} +{"text": "/*\n * Copyright (C) Lightbend Inc. \n */\n\npackage docs.home.persistence;\n\nimport docs.home.persistence.BlogCommand.*;\nimport docs.home.persistence.BlogEvent.*;\n\nimport akka.Done;\n\nimport javax.inject.Inject;\nimport com.lightbend.lagom.javadsl.pubsub.PubSubRef;\nimport com.lightbend.lagom.javadsl.pubsub.TopicId;\nimport com.lightbend.lagom.javadsl.pubsub.PubSubRegistry;\nimport com.lightbend.lagom.javadsl.persistence.PersistentEntity;\nimport java.util.Optional;\n\npublic class Post4 extends PersistentEntity {\n\n // #inject\n private final PubSubRef publishedTopic;\n\n @Inject\n public Post4(PubSubRegistry pubSub) {\n publishedTopic = pubSub.refFor(TopicId.of(PostPublished.class, \"\"));\n }\n // #inject\n\n @Override\n public Behavior initialBehavior(Optional snapshotState) {\n if (snapshotState.isPresent() && !snapshotState.get().isEmpty()) {\n // behavior after snapshot must be restored by initialBehavior\n return becomePostAdded(snapshotState.get());\n } else {\n // Behavior consist of a State and defined event handlers and command handlers.\n BehaviorBuilder b = newBehaviorBuilder(BlogState.EMPTY);\n\n // Command handlers are invoked for incoming messages (commands).\n // A command handler must \"return\" the events to be persisted (if any).\n b.setCommandHandler(\n AddPost.class,\n (AddPost cmd, CommandContext ctx) -> {\n if (cmd.getContent().getTitle() == null || cmd.getContent().getTitle().equals(\"\")) {\n ctx.invalidCommand(\"Title must be defined\");\n return ctx.done();\n }\n\n final PostAdded postAdded = new PostAdded(entityId(), cmd.getContent());\n return ctx.thenPersist(\n postAdded,\n (PostAdded evt) ->\n // After persist is done additional side effects can be performed\n ctx.reply(new AddPostDone(entityId())));\n });\n\n // Event handlers are used both when when persisting new events and when replaying\n // events.\n b.setEventHandlerChangingBehavior(\n PostAdded.class,\n evt -> becomePostAdded(new BlogState(Optional.of(evt.getContent()), false)));\n\n return b.build();\n }\n }\n\n // Behavior can be changed in the event handlers.\n private Behavior becomePostAdded(BlogState newState) {\n BehaviorBuilder b = newBehaviorBuilder(newState);\n\n b.setCommandHandler(\n ChangeBody.class,\n (cmd, ctx) ->\n ctx.thenPersist(\n new BodyChanged(entityId(), cmd.getBody()), evt -> ctx.reply(Done.getInstance())));\n\n b.setEventHandler(BodyChanged.class, evt -> state().withBody(evt.getBody()));\n\n // #publish\n b.setCommandHandler(\n Publish.class,\n (cmd, ctx) ->\n ctx.thenPersist(\n new PostPublished(entityId()),\n evt -> {\n ctx.reply(Done.getInstance());\n publishedTopic.publish(evt);\n }));\n // #publish\n\n b.setEventHandler(PostPublished.class, evt -> new BlogState(state().getContent(), true));\n\n return b.build();\n }\n}\n"} +{"text": "import numpy as np\nfrom numpy.testing import *\n\nfrom supreme.io import imread\nfrom supreme.register.parzen import joint_hist, mutual_info\n\nh1 = (np.random.random((100, 100)) * 255).astype(np.uint8)\n\ndef test_basic():\n H = joint_hist(h1, h1, std=1)\n\n D = np.zeros((255, 255), dtype=np.bool)\n for i in range(-3, 3):\n m = np.diag(np.ones(255 - abs(i)), k=i).astype(np.bool)\n D[m] = 1\n\n assert_almost_equal(np.sum(H[D]), 0.97, decimal=1)\n assert_almost_equal(np.sum(H[~D]), 0.03, decimal=1)\n\ndef test_mutual_info():\n H = joint_hist(h1, h1)\n S = mutual_info(H)\n\n assert(S > 5)\n\nif __name__ == \"__main__\":\n run_module_suite()\n"} +{"text": "'use strict';\n\nvar SharedArrayBufferCPRepoUtils$Wonderjs = require(\"../../utils/SharedArrayBufferCPRepoUtils.bs.js\");\n\nfunction getColorsSize(param) {\n return 3;\n}\n\nfunction getIntensitiesSize(param) {\n return 1;\n}\n\nfunction getColorIndex(index) {\n return Math.imul(index, 3);\n}\n\nfunction getIntensityIndex(index) {\n return (index << 0);\n}\n\nfunction getColorsOffset(count) {\n return 0;\n}\n\nfunction getColorsLength(count) {\n return Math.imul(count, 3);\n}\n\nfunction getIntensitiesOffset(count) {\n return 0 + Math.imul(Math.imul(count, 3), Float32Array.BYTES_PER_ELEMENT) | 0;\n}\n\nfunction getIntensitiesLength(count) {\n return (count << 0);\n}\n\nfunction getTotalByteLength(count) {\n return (Math.imul(count, Float32Array.BYTES_PER_ELEMENT) << 2);\n}\n\nfunction createBuffer(count) {\n return SharedArrayBufferCPRepoUtils$Wonderjs.newSharedArrayBuffer(getTotalByteLength(count));\n}\n\nexports.getColorsSize = getColorsSize;\nexports.getIntensitiesSize = getIntensitiesSize;\nexports.getColorIndex = getColorIndex;\nexports.getIntensityIndex = getIntensityIndex;\nexports.getColorsOffset = getColorsOffset;\nexports.getColorsLength = getColorsLength;\nexports.getIntensitiesOffset = getIntensitiesOffset;\nexports.getIntensitiesLength = getIntensitiesLength;\nexports.getTotalByteLength = getTotalByteLength;\nexports.createBuffer = createBuffer;\n/* No side effect */\n"} +{"text": "# www.robotstxt.org/\n# http://code.google.com/web/controlcrawlindex/\n\nUser-agent: *\n"} +{"text": "diff -ruN old/Makefile new/Makefile\n--- old/Makefile\t2015-04-13 16:53:03.000000000 +0200\n+++ new/Makefile\t2015-07-31 15:52:08.920097812 +0200\n@@ -346,7 +346,7 @@\n AWK\t\t= awk\n PERL\t\t= perl\n PYTHON\t\t= python\n-DTC\t\t= dtc\n+DTC\t\t= $(DTCDIR)dtc\n CHECK\t\t= sparse\n \n CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \\\n"} +{"text": "package toml\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"math/big\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\ntype valueComplexity int\n\nconst (\n\tvalueSimple valueComplexity = iota + 1\n\tvalueComplex\n)\n\ntype sortNode struct {\n\tkey string\n\tcomplexity valueComplexity\n}\n\n// Encodes a string to a TOML-compliant multi-line string value\n// This function is a clone of the existing encodeTomlString function, except that whitespace characters\n// are preserved. Quotation marks and backslashes are also not escaped.\nfunc encodeMultilineTomlString(value string, commented string) string {\n\tvar b bytes.Buffer\n\tadjacentQuoteCount := 0\n\n\tb.WriteString(commented)\n\tfor i, rr := range value {\n\t\tif rr != '\"' {\n\t\t\tadjacentQuoteCount = 0\n\t\t} else {\n\t\t\tadjacentQuoteCount++\n\t\t}\n\t\tswitch rr {\n\t\tcase '\\b':\n\t\t\tb.WriteString(`\\b`)\n\t\tcase '\\t':\n\t\t\tb.WriteString(\"\\t\")\n\t\tcase '\\n':\n\t\t\tb.WriteString(\"\\n\" + commented)\n\t\tcase '\\f':\n\t\t\tb.WriteString(`\\f`)\n\t\tcase '\\r':\n\t\t\tb.WriteString(\"\\r\")\n\t\tcase '\"':\n\t\t\tif adjacentQuoteCount >= 3 || i == len(value)-1 {\n\t\t\t\tadjacentQuoteCount = 0\n\t\t\t\tb.WriteString(`\\\"`)\n\t\t\t} else {\n\t\t\t\tb.WriteString(`\"`)\n\t\t\t}\n\t\tcase '\\\\':\n\t\t\tb.WriteString(`\\`)\n\t\tdefault:\n\t\t\tintRr := uint16(rr)\n\t\t\tif intRr < 0x001F {\n\t\t\t\tb.WriteString(fmt.Sprintf(\"\\\\u%0.4X\", intRr))\n\t\t\t} else {\n\t\t\t\tb.WriteRune(rr)\n\t\t\t}\n\t\t}\n\t}\n\treturn b.String()\n}\n\n// Encodes a string to a TOML-compliant string value\nfunc encodeTomlString(value string) string {\n\tvar b bytes.Buffer\n\n\tfor _, rr := range value {\n\t\tswitch rr {\n\t\tcase '\\b':\n\t\t\tb.WriteString(`\\b`)\n\t\tcase '\\t':\n\t\t\tb.WriteString(`\\t`)\n\t\tcase '\\n':\n\t\t\tb.WriteString(`\\n`)\n\t\tcase '\\f':\n\t\t\tb.WriteString(`\\f`)\n\t\tcase '\\r':\n\t\t\tb.WriteString(`\\r`)\n\t\tcase '\"':\n\t\t\tb.WriteString(`\\\"`)\n\t\tcase '\\\\':\n\t\t\tb.WriteString(`\\\\`)\n\t\tdefault:\n\t\t\tintRr := uint16(rr)\n\t\t\tif intRr < 0x001F {\n\t\t\t\tb.WriteString(fmt.Sprintf(\"\\\\u%0.4X\", intRr))\n\t\t\t} else {\n\t\t\t\tb.WriteRune(rr)\n\t\t\t}\n\t\t}\n\t}\n\treturn b.String()\n}\n\nfunc tomlTreeStringRepresentation(t *Tree, ord marshalOrder) (string, error) {\n\tvar orderedVals []sortNode\n\tswitch ord {\n\tcase OrderPreserve:\n\t\torderedVals = sortByLines(t)\n\tdefault:\n\t\torderedVals = sortAlphabetical(t)\n\t}\n\n\tvar values []string\n\tfor _, node := range orderedVals {\n\t\tk := node.key\n\t\tv := t.values[k]\n\n\t\trepr, err := tomlValueStringRepresentation(v, \"\", \"\", ord, false)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tvalues = append(values, quoteKeyIfNeeded(k)+\" = \"+repr)\n\t}\n\treturn \"{ \" + strings.Join(values, \", \") + \" }\", nil\n}\n\nfunc tomlValueStringRepresentation(v interface{}, commented string, indent string, ord marshalOrder, arraysOneElementPerLine bool) (string, error) {\n\t// this interface check is added to dereference the change made in the writeTo function.\n\t// That change was made to allow this function to see formatting options.\n\ttv, ok := v.(*tomlValue)\n\tif ok {\n\t\tv = tv.value\n\t} else {\n\t\ttv = &tomlValue{}\n\t}\n\n\tswitch value := v.(type) {\n\tcase uint64:\n\t\treturn strconv.FormatUint(value, 10), nil\n\tcase int64:\n\t\treturn strconv.FormatInt(value, 10), nil\n\tcase float64:\n\t\t// Default bit length is full 64\n\t\tbits := 64\n\t\t// Float panics if nan is used\n\t\tif !math.IsNaN(value) {\n\t\t\t// if 32 bit accuracy is enough to exactly show, use 32\n\t\t\t_, acc := big.NewFloat(value).Float32()\n\t\t\tif acc == big.Exact {\n\t\t\t\tbits = 32\n\t\t\t}\n\t\t}\n\t\tif math.Trunc(value) == value {\n\t\t\treturn strings.ToLower(strconv.FormatFloat(value, 'f', 1, bits)), nil\n\t\t}\n\t\treturn strings.ToLower(strconv.FormatFloat(value, 'f', -1, bits)), nil\n\tcase string:\n\t\tif tv.multiline {\n\t\t\treturn \"\\\"\\\"\\\"\\n\" + encodeMultilineTomlString(value, commented) + \"\\\"\\\"\\\"\", nil\n\t\t}\n\t\treturn \"\\\"\" + encodeTomlString(value) + \"\\\"\", nil\n\tcase []byte:\n\t\tb, _ := v.([]byte)\n\t\treturn string(b), nil\n\tcase bool:\n\t\tif value {\n\t\t\treturn \"true\", nil\n\t\t}\n\t\treturn \"false\", nil\n\tcase time.Time:\n\t\treturn value.Format(time.RFC3339), nil\n\tcase LocalDate:\n\t\treturn value.String(), nil\n\tcase LocalDateTime:\n\t\treturn value.String(), nil\n\tcase LocalTime:\n\t\treturn value.String(), nil\n\tcase *Tree:\n\t\treturn tomlTreeStringRepresentation(value, ord)\n\tcase nil:\n\t\treturn \"\", nil\n\t}\n\n\trv := reflect.ValueOf(v)\n\n\tif rv.Kind() == reflect.Slice {\n\t\tvar values []string\n\t\tfor i := 0; i < rv.Len(); i++ {\n\t\t\titem := rv.Index(i).Interface()\n\t\t\titemRepr, err := tomlValueStringRepresentation(item, commented, indent, ord, arraysOneElementPerLine)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tvalues = append(values, itemRepr)\n\t\t}\n\t\tif arraysOneElementPerLine && len(values) > 1 {\n\t\t\tstringBuffer := bytes.Buffer{}\n\t\t\tvalueIndent := indent + ` ` // TODO: move that to a shared encoder state\n\n\t\t\tstringBuffer.WriteString(\"[\\n\")\n\n\t\t\tfor _, value := range values {\n\t\t\t\tstringBuffer.WriteString(valueIndent)\n\t\t\t\tstringBuffer.WriteString(commented + value)\n\t\t\t\tstringBuffer.WriteString(`,`)\n\t\t\t\tstringBuffer.WriteString(\"\\n\")\n\t\t\t}\n\n\t\t\tstringBuffer.WriteString(indent + commented + \"]\")\n\n\t\t\treturn stringBuffer.String(), nil\n\t\t}\n\t\treturn \"[\" + strings.Join(values, \", \") + \"]\", nil\n\t}\n\treturn \"\", fmt.Errorf(\"unsupported value type %T: %v\", v, v)\n}\n\nfunc getTreeArrayLine(trees []*Tree) (line int) {\n\t// get lowest line number that is not 0\n\tfor _, tv := range trees {\n\t\tif tv.position.Line < line || line == 0 {\n\t\t\tline = tv.position.Line\n\t\t}\n\t}\n\treturn\n}\n\nfunc sortByLines(t *Tree) (vals []sortNode) {\n\tvar (\n\t\tline int\n\t\tlines []int\n\t\ttv *Tree\n\t\ttom *tomlValue\n\t\tnode sortNode\n\t)\n\tvals = make([]sortNode, 0)\n\tm := make(map[int]sortNode)\n\n\tfor k := range t.values {\n\t\tv := t.values[k]\n\t\tswitch v.(type) {\n\t\tcase *Tree:\n\t\t\ttv = v.(*Tree)\n\t\t\tline = tv.position.Line\n\t\t\tnode = sortNode{key: k, complexity: valueComplex}\n\t\tcase []*Tree:\n\t\t\tline = getTreeArrayLine(v.([]*Tree))\n\t\t\tnode = sortNode{key: k, complexity: valueComplex}\n\t\tdefault:\n\t\t\ttom = v.(*tomlValue)\n\t\t\tline = tom.position.Line\n\t\t\tnode = sortNode{key: k, complexity: valueSimple}\n\t\t}\n\t\tlines = append(lines, line)\n\t\tvals = append(vals, node)\n\t\tm[line] = node\n\t}\n\tsort.Ints(lines)\n\n\tfor i, line := range lines {\n\t\tvals[i] = m[line]\n\t}\n\n\treturn vals\n}\n\nfunc sortAlphabetical(t *Tree) (vals []sortNode) {\n\tvar (\n\t\tnode sortNode\n\t\tsimpVals []string\n\t\tcompVals []string\n\t)\n\tvals = make([]sortNode, 0)\n\tm := make(map[string]sortNode)\n\n\tfor k := range t.values {\n\t\tv := t.values[k]\n\t\tswitch v.(type) {\n\t\tcase *Tree, []*Tree:\n\t\t\tnode = sortNode{key: k, complexity: valueComplex}\n\t\t\tcompVals = append(compVals, node.key)\n\t\tdefault:\n\t\t\tnode = sortNode{key: k, complexity: valueSimple}\n\t\t\tsimpVals = append(simpVals, node.key)\n\t\t}\n\t\tvals = append(vals, node)\n\t\tm[node.key] = node\n\t}\n\n\t// Simples first to match previous implementation\n\tsort.Strings(simpVals)\n\ti := 0\n\tfor _, key := range simpVals {\n\t\tvals[i] = m[key]\n\t\ti++\n\t}\n\n\tsort.Strings(compVals)\n\tfor _, key := range compVals {\n\t\tvals[i] = m[key]\n\t\ti++\n\t}\n\n\treturn vals\n}\n\nfunc (t *Tree) writeTo(w io.Writer, indent, keyspace string, bytesCount int64, arraysOneElementPerLine bool) (int64, error) {\n\treturn t.writeToOrdered(w, indent, keyspace, bytesCount, arraysOneElementPerLine, OrderAlphabetical, \" \", false)\n}\n\nfunc (t *Tree) writeToOrdered(w io.Writer, indent, keyspace string, bytesCount int64, arraysOneElementPerLine bool, ord marshalOrder, indentString string, parentCommented bool) (int64, error) {\n\tvar orderedVals []sortNode\n\n\tswitch ord {\n\tcase OrderPreserve:\n\t\torderedVals = sortByLines(t)\n\tdefault:\n\t\torderedVals = sortAlphabetical(t)\n\t}\n\n\tfor _, node := range orderedVals {\n\t\tswitch node.complexity {\n\t\tcase valueComplex:\n\t\t\tk := node.key\n\t\t\tv := t.values[k]\n\n\t\t\tcombinedKey := quoteKeyIfNeeded(k)\n\t\t\tif keyspace != \"\" {\n\t\t\t\tcombinedKey = keyspace + \".\" + combinedKey\n\t\t\t}\n\n\t\t\tswitch node := v.(type) {\n\t\t\t// node has to be of those two types given how keys are sorted above\n\t\t\tcase *Tree:\n\t\t\t\ttv, ok := t.values[k].(*Tree)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn bytesCount, fmt.Errorf(\"invalid value type at %s: %T\", k, t.values[k])\n\t\t\t\t}\n\t\t\t\tif tv.comment != \"\" {\n\t\t\t\t\tcomment := strings.Replace(tv.comment, \"\\n\", \"\\n\"+indent+\"#\", -1)\n\t\t\t\t\tstart := \"# \"\n\t\t\t\t\tif strings.HasPrefix(comment, \"#\") {\n\t\t\t\t\t\tstart = \"\"\n\t\t\t\t\t}\n\t\t\t\t\twrittenBytesCountComment, errc := writeStrings(w, \"\\n\", indent, start, comment)\n\t\t\t\t\tbytesCount += int64(writtenBytesCountComment)\n\t\t\t\t\tif errc != nil {\n\t\t\t\t\t\treturn bytesCount, errc\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar commented string\n\t\t\t\tif parentCommented || t.commented || tv.commented {\n\t\t\t\t\tcommented = \"# \"\n\t\t\t\t}\n\t\t\t\twrittenBytesCount, err := writeStrings(w, \"\\n\", indent, commented, \"[\", combinedKey, \"]\\n\")\n\t\t\t\tbytesCount += int64(writtenBytesCount)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn bytesCount, err\n\t\t\t\t}\n\t\t\t\tbytesCount, err = node.writeToOrdered(w, indent+indentString, combinedKey, bytesCount, arraysOneElementPerLine, ord, indentString, parentCommented || t.commented || tv.commented)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn bytesCount, err\n\t\t\t\t}\n\t\t\tcase []*Tree:\n\t\t\t\tfor _, subTree := range node {\n\t\t\t\t\tvar commented string\n\t\t\t\t\tif parentCommented || t.commented || subTree.commented {\n\t\t\t\t\t\tcommented = \"# \"\n\t\t\t\t\t}\n\t\t\t\t\twrittenBytesCount, err := writeStrings(w, \"\\n\", indent, commented, \"[[\", combinedKey, \"]]\\n\")\n\t\t\t\t\tbytesCount += int64(writtenBytesCount)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn bytesCount, err\n\t\t\t\t\t}\n\n\t\t\t\t\tbytesCount, err = subTree.writeToOrdered(w, indent+indentString, combinedKey, bytesCount, arraysOneElementPerLine, ord, indentString, parentCommented || t.commented || subTree.commented)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn bytesCount, err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tdefault: // Simple\n\t\t\tk := node.key\n\t\t\tv, ok := t.values[k].(*tomlValue)\n\t\t\tif !ok {\n\t\t\t\treturn bytesCount, fmt.Errorf(\"invalid value type at %s: %T\", k, t.values[k])\n\t\t\t}\n\n\t\t\tvar commented string\n\t\t\tif parentCommented || t.commented || v.commented {\n\t\t\t\tcommented = \"# \"\n\t\t\t}\n\t\t\trepr, err := tomlValueStringRepresentation(v, commented, indent, ord, arraysOneElementPerLine)\n\t\t\tif err != nil {\n\t\t\t\treturn bytesCount, err\n\t\t\t}\n\n\t\t\tif v.comment != \"\" {\n\t\t\t\tcomment := strings.Replace(v.comment, \"\\n\", \"\\n\"+indent+\"#\", -1)\n\t\t\t\tstart := \"# \"\n\t\t\t\tif strings.HasPrefix(comment, \"#\") {\n\t\t\t\t\tstart = \"\"\n\t\t\t\t}\n\t\t\t\twrittenBytesCountComment, errc := writeStrings(w, \"\\n\", indent, start, comment, \"\\n\")\n\t\t\t\tbytesCount += int64(writtenBytesCountComment)\n\t\t\t\tif errc != nil {\n\t\t\t\t\treturn bytesCount, errc\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tquotedKey := quoteKeyIfNeeded(k)\n\t\t\twrittenBytesCount, err := writeStrings(w, indent, commented, quotedKey, \" = \", repr, \"\\n\")\n\t\t\tbytesCount += int64(writtenBytesCount)\n\t\t\tif err != nil {\n\t\t\t\treturn bytesCount, err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn bytesCount, nil\n}\n\n// quote a key if it does not fit the bare key format (A-Za-z0-9_-)\n// quoted keys use the same rules as strings\nfunc quoteKeyIfNeeded(k string) string {\n\t// when encoding a map with the 'quoteMapKeys' option enabled, the tree will contain\n\t// keys that have already been quoted.\n\t// not an ideal situation, but good enough of a stop gap.\n\tif len(k) >= 2 && k[0] == '\"' && k[len(k)-1] == '\"' {\n\t\treturn k\n\t}\n\tisBare := true\n\tfor _, r := range k {\n\t\tif !isValidBareChar(r) {\n\t\t\tisBare = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif isBare {\n\t\treturn k\n\t}\n\treturn quoteKey(k)\n}\n\nfunc quoteKey(k string) string {\n\treturn \"\\\"\" + encodeTomlString(k) + \"\\\"\"\n}\n\nfunc writeStrings(w io.Writer, s ...string) (int, error) {\n\tvar n int\n\tfor i := range s {\n\t\tb, err := io.WriteString(w, s[i])\n\t\tn += b\n\t\tif err != nil {\n\t\t\treturn n, err\n\t\t}\n\t}\n\treturn n, nil\n}\n\n// WriteTo encode the Tree as Toml and writes it to the writer w.\n// Returns the number of bytes written in case of success, or an error if anything happened.\nfunc (t *Tree) WriteTo(w io.Writer) (int64, error) {\n\treturn t.writeTo(w, \"\", \"\", 0, false)\n}\n\n// ToTomlString generates a human-readable representation of the current tree.\n// Output spans multiple lines, and is suitable for ingest by a TOML parser.\n// If the conversion cannot be performed, ToString returns a non-nil error.\nfunc (t *Tree) ToTomlString() (string, error) {\n\tb, err := t.Marshal()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(b), nil\n}\n\n// String generates a human-readable representation of the current tree.\n// Alias of ToString. Present to implement the fmt.Stringer interface.\nfunc (t *Tree) String() string {\n\tresult, _ := t.ToTomlString()\n\treturn result\n}\n\n// ToMap recursively generates a representation of the tree using Go built-in structures.\n// The following types are used:\n//\n//\t* bool\n//\t* float64\n//\t* int64\n//\t* string\n//\t* uint64\n//\t* time.Time\n//\t* map[string]interface{} (where interface{} is any of this list)\n//\t* []interface{} (where interface{} is any of this list)\nfunc (t *Tree) ToMap() map[string]interface{} {\n\tresult := map[string]interface{}{}\n\n\tfor k, v := range t.values {\n\t\tswitch node := v.(type) {\n\t\tcase []*Tree:\n\t\t\tvar array []interface{}\n\t\t\tfor _, item := range node {\n\t\t\t\tarray = append(array, item.ToMap())\n\t\t\t}\n\t\t\tresult[k] = array\n\t\tcase *Tree:\n\t\t\tresult[k] = node.ToMap()\n\t\tcase *tomlValue:\n\t\t\tresult[k] = node.value\n\t\t}\n\t}\n\treturn result\n}\n"} +{"text": ";* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\r\n;* *\r\n;* Ghost, a micro-kernel based operating system for the x86 architecture *\r\n;* Copyright (C) 2015, Max Schlüssel *\r\n;* *\r\n;* This program is free software: you can redistribute it and/or modify *\r\n;* it under the terms of the GNU General Public License as published by *\r\n;* the Free Software Foundation, either version 3 of the License, or *\r\n;* (at your option) any later version. *\r\n;* *\r\n;* This program is distributed in the hope that it will be useful, *\r\n;* but WITHOUT ANY WARRANTY; without even the implied warranty of *\r\n;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\r\n;* GNU General Public License for more details. *\r\n;* *\r\n;* You should have received a copy of the GNU General Public License *\r\n;* along with this program. If not, see . *\r\n;* *\r\n;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\r\n\r\n\r\nBITS 32\r\n\r\n; # MULTIBOOT\r\nsection .multiboot\r\n\tMODULEALIGN\t\tequ\t\t1 << 0\r\n\tMEMINFO\t\t\tequ \t1 << 1\r\n\tFLAGS\t\t\tequ\t\tMODULEALIGN | MEMINFO\r\n\tMAGIC\t\t\tequ\t\t0x1BADB002\r\n\tCHECKSUM\t\tequ\t\t-(MAGIC + FLAGS)\r\n\r\n\t; Fill constants into memory (dwords)\r\n\talign 4\r\n\tdd MAGIC\r\n\tdd FLAGS\r\n\tdd CHECKSUM\r\n\r\n\r\n\r\n; # CODE\r\nsection .text\r\n\r\n\t; Entry point for GRUB\r\n\tglobal loaderEntry\r\n\r\n\t; Initialization method\r\n\textern loaderMain\r\n\r\n\t; Create the initial loader stack\r\n\tSTACKSIZE equ 0x1000\r\n\r\n\t; Calls the initialization routines\r\n\tloaderEntry:\r\n\t\t; Set the stack\r\n\t\tmov esp, stack + STACKSIZE\r\n\t\tmov ebp, esp\r\n\r\n\t\t; We don't want interrupts until the kernel is ready\r\n\t\tcli\r\n\r\n\t\t; Call the loader\r\n\t\tpush eax ; Magic number\r\n\t\tpush ebx ; Multiboot information pointer\r\n\t call loaderMain\r\n\r\n\t\t; Hang the system after execution\r\n\t\tcli\r\n\t\thlt\r\n\r\n\r\n; # DATA\r\nsection .bss\r\n\r\n\t; Align the location of the following res-commands\r\n\talign 4\r\n\r\n\t; Reserves space for the initial kernel stack\r\n\tstack:\r\n\t\tresb STACKSIZE\r\n\r\n\r\n"} +{"text": "// -*- C++ -*-\n\n// Copyright (C) 2005-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 terms\n// of the GNU General Public License as published by the Free Software\n// Foundation; either version 3, or (at your option) any later\n// version.\n\n// This library is distributed in the hope that it will be useful, but\n// WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n// General Public License for more details.\n\n// Under Section 7 of GPL version 3, you are granted additional\n// permissions described in the GCC Runtime Library Exception, version\n// 3.1, as published by the Free Software Foundation.\n\n// You should have received a copy of the GNU General Public License and\n// a copy of the GCC Runtime Library Exception along with this program;\n// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see\n// .\n\n// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.\n\n// Permission to use, copy, modify, sell, and distribute this software\n// is hereby granted without fee, provided that the above copyright\n// notice appears in all copies, and that both that copyright notice\n// and this permission notice appear in supporting documentation. None\n// of the above authors, nor IBM Haifa Research Laboratories, make any\n// representation about the suitability of this software for any\n// purpose. It is provided \"as is\" without express or implied\n// warranty.\n\n/**\n * @file bin_search_tree_/debug_fn_imps.hpp\n * Contains an implementation class for bin_search_tree_.\n */\n\n#ifdef _GLIBCXX_DEBUG\n\nPB_DS_CLASS_T_DEC\nvoid\nPB_DS_CLASS_C_DEC::\nassert_valid(const char* __file, int __line) const\n{\n structure_only_assert_valid(__file, __line);\n assert_consistent_with_debug_base(__file, __line);\n assert_size(__file, __line);\n assert_iterators(__file, __line);\n if (m_p_head->m_p_parent == 0)\n {\n PB_DS_DEBUG_VERIFY(m_size == 0);\n }\n else\n {\n PB_DS_DEBUG_VERIFY(m_size > 0);\n }\n}\n\nPB_DS_CLASS_T_DEC\nvoid\nPB_DS_CLASS_C_DEC::\nstructure_only_assert_valid(const char* __file, int __line) const\n{\n PB_DS_DEBUG_VERIFY(m_p_head != 0);\n if (m_p_head->m_p_parent == 0)\n {\n PB_DS_DEBUG_VERIFY(m_p_head->m_p_left == m_p_head);\n PB_DS_DEBUG_VERIFY(m_p_head->m_p_right == m_p_head);\n }\n else\n {\n PB_DS_DEBUG_VERIFY(m_p_head->m_p_parent->m_p_parent == m_p_head);\n PB_DS_DEBUG_VERIFY(m_p_head->m_p_left != m_p_head);\n PB_DS_DEBUG_VERIFY(m_p_head->m_p_right != m_p_head);\n }\n\n if (m_p_head->m_p_parent != 0)\n assert_node_consistent(m_p_head->m_p_parent, __file, __line);\n assert_min(__file, __line);\n assert_max(__file, __line);\n}\n\nPB_DS_CLASS_T_DEC\nvoid\nPB_DS_CLASS_C_DEC::\nassert_node_consistent(const node_pointer p_nd,\n\t\t const char* __file, int __line) const\n{\n assert_node_consistent_(p_nd, __file, __line);\n}\n\nPB_DS_CLASS_T_DEC\ntypename PB_DS_CLASS_C_DEC::node_consistent_t\nPB_DS_CLASS_C_DEC::\nassert_node_consistent_(const node_pointer p_nd,\n\t\t\tconst char* __file, int __line) const\n{\n if (p_nd == 0)\n return (std::make_pair((const_pointer)0,(const_pointer)0));\n\n assert_node_consistent_with_left(p_nd, __file, __line);\n assert_node_consistent_with_right(p_nd, __file, __line);\n\n const std::pair\n l_range = assert_node_consistent_(p_nd->m_p_left, __file, __line);\n\n if (l_range.second != 0)\n PB_DS_DEBUG_VERIFY(Cmp_Fn::operator()(PB_DS_V2F(*l_range.second),\n\t\t\t\t\t PB_DS_V2F(p_nd->m_value)));\n\n const std::pair\n r_range = assert_node_consistent_(p_nd->m_p_right, __file, __line);\n\n if (r_range.first != 0)\n PB_DS_DEBUG_VERIFY(Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value),\n\t\t\t\t\t PB_DS_V2F(*r_range.first)));\n\n return std::make_pair((l_range.first != 0) ? l_range.first : &p_nd->m_value,\n\t\t\t(r_range.second != 0)? r_range.second : &p_nd->m_value);\n}\n\nPB_DS_CLASS_T_DEC\nvoid\nPB_DS_CLASS_C_DEC::\nassert_node_consistent_with_left(const node_pointer p_nd,\n\t\t\t\t const char* __file, int __line) const\n{\n if (p_nd->m_p_left == 0)\n return;\n PB_DS_DEBUG_VERIFY(p_nd->m_p_left->m_p_parent == p_nd);\n PB_DS_DEBUG_VERIFY(!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value),\n\t\t\t\t\t PB_DS_V2F(p_nd->m_p_left->m_value)));\n}\n\nPB_DS_CLASS_T_DEC\nvoid\nPB_DS_CLASS_C_DEC::\nassert_node_consistent_with_right(const node_pointer p_nd,\n\t\t\t\t const char* __file, int __line) const\n{\n if (p_nd->m_p_right == 0)\n return;\n PB_DS_DEBUG_VERIFY(p_nd->m_p_right->m_p_parent == p_nd);\n PB_DS_DEBUG_VERIFY(!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_p_right->m_value),\n\t\t\t\t\t PB_DS_V2F(p_nd->m_value)));\n}\n\nPB_DS_CLASS_T_DEC\nvoid\nPB_DS_CLASS_C_DEC::\nassert_min(const char* __file, int __line) const\n{\n assert_min_imp(m_p_head->m_p_parent, __file, __line);\n}\n\nPB_DS_CLASS_T_DEC\nvoid\nPB_DS_CLASS_C_DEC::\nassert_min_imp(const node_pointer p_nd, const char* __file, int __line) const\n{\n if (p_nd == 0)\n {\n PB_DS_DEBUG_VERIFY(m_p_head->m_p_left == m_p_head);\n return;\n }\n\n if (p_nd->m_p_left == 0)\n {\n PB_DS_DEBUG_VERIFY(p_nd == m_p_head->m_p_left);\n return;\n }\n assert_min_imp(p_nd->m_p_left, __file, __line);\n}\n\nPB_DS_CLASS_T_DEC\nvoid\nPB_DS_CLASS_C_DEC::\nassert_max(const char* __file, int __line) const\n{\n assert_max_imp(m_p_head->m_p_parent, __file, __line);\n}\n\nPB_DS_CLASS_T_DEC\nvoid\nPB_DS_CLASS_C_DEC::\nassert_max_imp(const node_pointer p_nd,\n\t const char* __file, int __line) const\n{\n if (p_nd == 0)\n {\n PB_DS_DEBUG_VERIFY(m_p_head->m_p_right == m_p_head);\n return;\n }\n\n if (p_nd->m_p_right == 0)\n {\n PB_DS_DEBUG_VERIFY(p_nd == m_p_head->m_p_right);\n return;\n }\n\n assert_max_imp(p_nd->m_p_right, __file, __line);\n}\n\nPB_DS_CLASS_T_DEC\nvoid\nPB_DS_CLASS_C_DEC::\nassert_iterators(const char* __file, int __line) const\n{\n size_type iterated_num = 0;\n const_iterator prev_it = end();\n for (const_iterator it = begin(); it != end(); ++it)\n {\n ++iterated_num;\n PB_DS_DEBUG_VERIFY(lower_bound(PB_DS_V2F(*it)).m_p_nd == it.m_p_nd);\n const_iterator upper_bound_it = upper_bound(PB_DS_V2F(*it));\n --upper_bound_it;\n PB_DS_DEBUG_VERIFY(upper_bound_it.m_p_nd == it.m_p_nd);\n\n if (prev_it != end())\n\tPB_DS_DEBUG_VERIFY(Cmp_Fn::operator()(PB_DS_V2F(*prev_it),\n\t\t\t\t\t PB_DS_V2F(*it)));\n prev_it = it;\n }\n\n PB_DS_DEBUG_VERIFY(iterated_num == m_size);\n size_type reverse_iterated_num = 0;\n const_reverse_iterator reverse_prev_it = rend();\n for (const_reverse_iterator reverse_it = rbegin(); reverse_it != rend();\n ++reverse_it)\n {\n ++reverse_iterated_num;\n PB_DS_DEBUG_VERIFY(lower_bound(\n\t\t\t\t PB_DS_V2F(*reverse_it)).m_p_nd == reverse_it.m_p_nd);\n\n const_iterator upper_bound_it = upper_bound(PB_DS_V2F(*reverse_it));\n --upper_bound_it;\n PB_DS_DEBUG_VERIFY(upper_bound_it.m_p_nd == reverse_it.m_p_nd);\n if (reverse_prev_it != rend())\n\tPB_DS_DEBUG_VERIFY(!Cmp_Fn::operator()(PB_DS_V2F(*reverse_prev_it),\n\t\t\t\t\t PB_DS_V2F(*reverse_it)));\n reverse_prev_it = reverse_it;\n }\n PB_DS_DEBUG_VERIFY(reverse_iterated_num == m_size);\n}\n\nPB_DS_CLASS_T_DEC\nvoid\nPB_DS_CLASS_C_DEC::\nassert_consistent_with_debug_base(const char* __file, int __line) const\n{\n debug_base::check_size(m_size, __file, __line);\n assert_consistent_with_debug_base(m_p_head->m_p_parent, __file, __line);\n}\n\nPB_DS_CLASS_T_DEC\nvoid\nPB_DS_CLASS_C_DEC::\nassert_consistent_with_debug_base(const node_pointer p_nd,\n\t\t\t\t const char* __file, int __line) const\n{\n if (p_nd == 0)\n return;\n debug_base::check_key_exists(PB_DS_V2F(p_nd->m_value), __file, __line);\n assert_consistent_with_debug_base(p_nd->m_p_left, __file, __line);\n assert_consistent_with_debug_base(p_nd->m_p_right, __file, __line);\n}\n\nPB_DS_CLASS_T_DEC\nvoid\nPB_DS_CLASS_C_DEC::\nassert_size(const char* __file, int __line) const\n{ PB_DS_DEBUG_VERIFY(recursive_count(m_p_head->m_p_parent) == m_size); }\n\n#endif\n"} +{"text": "increments('id');\n $table->string('name');\n $table->timestamps();\n $table->engine = 'InnoDB';\n });\n }\n\n /**\n * Reverse the migrations.\n *\n * @return void\n */\n public function down()\n {\n Schema::drop('manufacturers');\n }\n\n}\n"} +{"text": "package sl\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n)\n\n// NotFoundError is specialised type of error, which is returned when\n// requested resource is not found.\ntype NotFoundError struct {\n\tResource string // resource type that was requested\n\tErr error // underlying reason that caused the error\n}\n\nfunc newNotFoundError(res string, err error) error {\n\treturn &NotFoundError{\n\t\tResource: res,\n\t\tErr: err,\n\t}\n}\n\n// Error implements the builtin error interface.\nfunc (err *NotFoundError) Error() string {\n\treturn fmt.Sprintf(\"%s not found: %s\", err.Resource, err.Err)\n}\n\n// IsNotFound returns true if the error is *NotFoundError.\nfunc IsNotFound(err error) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\tif err.Error() == \"not found\" {\n\t\treturn true\n\t}\n\t_, ok := err.(*NotFoundError)\n\treturn ok\n}\n\n// Error represents and error object response payload.\ntype Error struct {\n\tMessage string `json:\"error,omitepty\"`\n\tCode string `json:\"code,omitempty\"`\n}\n\n// Error implements the builtin error interface.\nfunc (err *Error) Error() string {\n\treturn fmt.Sprintf(\"Softlayer API error: message=%q, code=%q\", err.Message, err.Code)\n}\n\nfunc checkError(p []byte) error {\n\tvar e Error\n\terr := json.Unmarshal(p, &e)\n\tif err == nil && e.Message != \"\" && e.Code != \"\" {\n\t\treturn &e\n\t}\n\treturn nil\n}\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 \"NSArray.h\"\n\n@interface NSArray (MSArrayUtilities)\n- (id)MSDeepCopy;\n- (id)MSDeepCopyWithZone:(struct _NSZone *)arg1;\n- (id)MSMutableDeepCopy;\n- (id)MSMutableDeepCopyWithZone:(struct _NSZone *)arg1;\n@end\n\n"} +{"text": "import os\nimport numpy as np\nimport logging\n\nfrom minerl.env.core import MineRLEnv\n\nJ = os.path.join\nE = os.path.exists\n\n\nMINERL_RECORDING_PATH = os.environ.get('MINERL_RECORDING_PATH', None)\n\nlogger = logging.getLogger(__name__)\n\n\nclass MineRLRecorder(MineRLEnv):\n def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n\n self.num_resets = 0\n self.reset_recording()\n\n\n def reset_recording(self):\n self.states = []\n self.next_states = []\n self.actions = []\n self.rewards = []\n\n\n def reset(self):\n obs_0 = super().reset()\n\n # handle recording\n # save out the recording if necessary.\n if self.rewards:\n # We have recorded something, and hence should save this out.\n self.save_recording()\n\n # Reset the recording at the end of the loop.\n self.num_resets += 1\n self.reset_recording()\n\n self.states.append(obs_0)\n return obs_0\n \n def step(self, action):\n next_state, reward, done, info = super().step(action)\n \n self.actions.append(action)\n self.rewards.append(reward)\n self.next_states.append(next_state)\n\n # For the next iteration.\n if not done:\n self.states.append(self.next_states[-1])\n\n return next_state, reward, done, info\n\n def save_recording(self):\n assert len(self.rewards) > 0 \n env_rec_dir = os.path.join(MINERL_RECORDING_PATH, self.spec.id)\n episode_dir = J(env_rec_dir, \n \"ep_{}\".format(self.num_resets))\n\n if not E(episode_dir): os.makedirs(episode_dir)\n\n logger.debug(\"Saving recording to {}\".format(episode_dir))\n\n np.save(J(episode_dir, 'states'), self.states)\n np.save(J(episode_dir, 'rewards'), self.rewards)\n np.save(J(episode_dir, 'next_states'), self.next_states)\n np.save(J(episode_dir, 'actions'), self.actions)\n\n logger.debug(\"Saved recording\")\n \n\n \n\n\n \n\n \n\n\n"} +{"text": ">>> Flow 1 (client to server)\n00000000 16 03 01 00 cb 01 00 00 c7 03 03 27 8a e9 f3 58 |...........'...X|\n00000010 5a 08 90 d6 d4 97 23 b6 a7 92 73 3a a3 3c c1 a1 |Z.....#...s:.<..|\n00000020 ca 06 23 c8 ed 4a 19 26 73 c9 62 00 00 38 c0 2c |..#..J.&s.b..8.,|\n00000030 c0 30 00 9f cc a9 cc a8 cc aa c0 2b c0 2f 00 9e |.0.........+./..|\n00000040 c0 24 c0 28 00 6b c0 23 c0 27 00 67 c0 0a c0 14 |.$.(.k.#.'.g....|\n00000050 00 39 c0 09 c0 13 00 33 00 9d 00 9c 00 3d 00 3c |.9.....3.....=.<|\n00000060 00 35 00 2f 00 ff 01 00 00 66 00 00 00 0e 00 0c |.5./.....f......|\n00000070 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|\n00000080 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|\n00000090 00 19 00 18 00 16 00 00 00 17 00 00 00 0d 00 30 |...............0|\n000000a0 00 2e 04 03 05 03 06 03 08 07 08 08 08 09 08 0a |................|\n000000b0 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 03 03 |................|\n000000c0 02 03 03 01 02 01 03 02 02 02 04 02 05 02 06 02 |................|\n>>> Flow 2 (server to client)\n00000000 16 03 03 00 37 02 00 00 33 03 03 00 00 00 00 00 |....7...3.......|\n00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|\n00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 c0 14 00 00 |...DOWNGRD......|\n00000030 0b ff 01 00 01 00 00 0b 00 02 01 00 16 03 03 02 |................|\n00000040 59 0b 00 02 55 00 02 52 00 02 4f 30 82 02 4b 30 |Y...U..R..O0..K0|\n00000050 82 01 b4 a0 03 02 01 02 02 09 00 e8 f0 9d 3f e2 |..............?.|\n00000060 5b ea a6 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b |[..0...*.H......|\n00000070 05 00 30 1f 31 0b 30 09 06 03 55 04 0a 13 02 47 |..0.1.0...U....G|\n00000080 6f 31 10 30 0e 06 03 55 04 03 13 07 47 6f 20 52 |o1.0...U....Go R|\n00000090 6f 6f 74 30 1e 17 0d 31 36 30 31 30 31 30 30 30 |oot0...160101000|\n000000a0 30 30 30 5a 17 0d 32 35 30 31 30 31 30 30 30 30 |000Z..2501010000|\n000000b0 30 30 5a 30 1a 31 0b 30 09 06 03 55 04 0a 13 02 |00Z0.1.0...U....|\n000000c0 47 6f 31 0b 30 09 06 03 55 04 03 13 02 47 6f 30 |Go1.0...U....Go0|\n000000d0 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 |..0...*.H.......|\n000000e0 00 03 81 8d 00 30 81 89 02 81 81 00 db 46 7d 93 |.....0.......F}.|\n000000f0 2e 12 27 06 48 bc 06 28 21 ab 7e c4 b6 a2 5d fe |..'.H..(!.~...].|\n00000100 1e 52 45 88 7a 36 47 a5 08 0d 92 42 5b c2 81 c0 |.RE.z6G....B[...|\n00000110 be 97 79 98 40 fb 4f 6d 14 fd 2b 13 8b c2 a5 2e |..y.@.Om..+.....|\n00000120 67 d8 d4 09 9e d6 22 38 b7 4a 0b 74 73 2b c2 34 |g.....\"8.J.ts+.4|\n00000130 f1 d1 93 e5 96 d9 74 7b f3 58 9f 6c 61 3c c0 b0 |......t{.X.la<..|\n00000140 41 d4 d9 2b 2b 24 23 77 5b 1c 3b bd 75 5d ce 20 |A..++$#w[.;.u]. |\n00000150 54 cf a1 63 87 1d 1e 24 c4 f3 1d 1a 50 8b aa b6 |T..c...$....P...|\n00000160 14 43 ed 97 a7 75 62 f4 14 c8 52 d7 02 03 01 00 |.C...ub...R.....|\n00000170 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f 01 01 |....0..0...U....|\n00000180 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 04 16 |.......0...U.%..|\n00000190 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 2b 06 |0...+.........+.|\n000001a0 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 01 ff |......0...U.....|\n000001b0 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 10 9f |..0.0...U.......|\n000001c0 91 16 1f 43 43 3e 49 a6 de 6d b6 80 d7 9f 60 30 |...CC>I..m....`0|\n000001d0 1b 06 03 55 1d 23 04 14 30 12 80 10 48 13 49 4d |...U.#..0...H.IM|\n000001e0 13 7e 16 31 bb a3 01 d5 ac ab 6e 7b 30 19 06 03 |.~.1......n{0...|\n000001f0 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 6c 65 |U....0...example|\n00000200 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 86 f7 |.golang0...*.H..|\n00000210 0d 01 01 0b 05 00 03 81 81 00 9d 30 cc 40 2b 5b |...........0.@+[|\n00000220 50 a0 61 cb ba e5 53 58 e1 ed 83 28 a9 58 1a a9 |P.a...SX...(.X..|\n00000230 38 a4 95 a1 ac 31 5a 1a 84 66 3d 43 d3 2d d9 0b |8....1Z..f=C.-..|\n00000240 f2 97 df d3 20 64 38 92 24 3a 00 bc cf 9c 7d b7 |.... d8.$:....}.|\n00000250 40 20 01 5f aa d3 16 61 09 a2 76 fd 13 c3 cc e1 |@ ._...a..v.....|\n00000260 0c 5c ee b1 87 82 f1 6c 04 ed 73 bb b3 43 77 8d |.\\.....l..s..Cw.|\n00000270 0c 1c f1 0f a1 d8 40 83 61 c9 4c 72 2b 9d ae db |......@.a.Lr+...|\n00000280 46 06 06 4d f4 c1 b3 3e c0 d1 bd 42 d4 db fe 3d |F..M...>...B...=|\n00000290 13 60 84 5c 21 d3 3b e9 fa e7 16 03 03 00 ac 0c |.`.\\!.;.........|\n000002a0 00 00 a8 03 00 1d 20 2f e5 7d a3 47 cd 62 43 15 |...... /.}.G.bC.|\n000002b0 28 da ac 5f bb 29 07 30 ff f6 84 af c4 cf c2 ed |(.._.).0........|\n000002c0 90 99 5f 58 cb 3b 74 08 04 00 80 42 86 d0 0a 5b |.._X.;t....B...[|\n000002d0 d7 97 20 4d be 16 b8 eb 51 66 28 3b f9 45 35 f5 |.. M....Qf(;.E5.|\n000002e0 de 1d 28 c9 36 63 5b 7b f6 a7 64 79 fb 39 20 c3 |..(.6c[{..dy.9 .|\n000002f0 dd db 38 3e af 89 ce 91 f7 bd 51 b4 5e 01 d8 9b |..8>......Q.^...|\n00000300 54 62 58 24 3b c2 43 59 a4 11 1a 2b 67 c5 5f 79 |TbX$;.CY...+g._y|\n00000310 fe 68 9d c7 e6 8b 36 8b f9 cb 00 b0 b3 0f 52 fb |.h....6.......R.|\n00000320 fe a5 e6 c6 26 9b d1 a2 17 4e e2 58 7f b2 80 78 |....&....N.X...x|\n00000330 10 b4 0a 47 e1 18 92 d4 a5 5a 86 06 36 ca f7 b6 |...G.....Z..6...|\n00000340 1c 83 81 0e eb 32 7d fe 06 c5 03 16 03 03 00 04 |.....2}.........|\n00000350 0e 00 00 00 |....|\n>>> Flow 3 (client to server)\n00000000 16 03 03 00 25 10 00 00 21 20 14 7f fb 7d 0c ef |....%...! ...}..|\n00000010 48 c4 8f 75 24 19 5f ee 5f 51 08 35 74 cf c3 ea |H..u$._._Q.5t...|\n00000020 67 20 c4 f9 49 b2 cf 69 5a 77 14 03 03 00 01 01 |g ..I..iZw......|\n00000030 16 03 03 00 40 2b d2 f4 dc 36 98 ef 1d 43 f9 3e |....@+...6...C.>|\n00000040 83 33 c0 71 a6 e3 ac f1 3c cc 94 e4 d0 fe 81 bc |.3.q....<.......|\n00000050 94 56 15 eb 6a 7b 17 33 e1 a0 ef d5 7a 86 af ea |.V..j{.3....z...|\n00000060 1f bb d5 8c 80 56 d5 e4 08 cd 68 bf c0 53 c2 56 |.....V....h..S.V|\n00000070 aa b3 38 1e 4e |..8.N|\n>>> Flow 4 (server to client)\n00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|\n00000010 00 00 00 00 00 00 00 00 00 00 00 45 07 c3 ba 8c |...........E....|\n00000020 d8 9f b6 f1 6a 14 bb b1 4e 84 3f 25 6a 3d ef f6 |....j...N.?%j=..|\n00000030 88 89 1a 91 22 ef e3 ed ba 2a a3 7c 5b db e0 1d |....\"....*.|[...|\n00000040 b5 8d 7a ed e7 ad e1 31 b2 12 f5 17 03 03 00 40 |..z....1.......@|\n00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|\n00000060 a6 f3 0b 33 f7 7a 7c fb fb b5 e6 eb 6e 0a 26 aa |...3.z|.....n.&.|\n00000070 06 3b a6 bc 08 e5 3a b6 c9 a3 f3 77 28 93 45 08 |.;....:....w(.E.|\n00000080 1d 54 5e a3 92 cd 89 a3 e6 34 ec 52 70 c0 97 3c |.T^......4.Rp..<|\n00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|\n000000a0 00 00 00 00 00 2d 0d 96 57 b8 6f 90 1e 84 4d 35 |.....-..W.o...M5|\n000000b0 91 52 42 6b 8d a3 6b 21 22 60 1a c9 38 7f 5a ef |.RBk..k!\"`..8.Z.|\n000000c0 6e dd 84 06 79 |n...y|\n"} +{"text": "//\n// $Id: sphinxrt.h 4885 2015-01-20 07:02:07Z deogar $\n//\n\n//\n// Copyright (c) 2001-2015, Andrew Aksyonoff\n// Copyright (c) 2008-2015, Sphinx Technologies Inc\n// All rights reserved\n//\n// This program is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License. You should have\n// received a copy of the GPL license along with this program; if you\n// did not, you can find it at http://www.gnu.org/\n//\n\n#ifndef _sphinxrt_\n#define _sphinxrt_\n\n#include \"sphinx.h\"\n#include \"sphinxutils.h\"\n#include \"sphinxstem.h\"\n\nstruct CSphReconfigureSettings;\nstruct CSphReconfigureSetup;\n\n/// RAM based updateable backend interface\nclass ISphRtIndex : public CSphIndex\n{\npublic:\n\texplicit ISphRtIndex ( const char * sIndexName, const char * sFileName ) : CSphIndex ( sIndexName, sFileName ) {}\n\n\t/// get internal schema (to use for Add calls)\n\tvirtual const CSphSchema & GetInternalSchema () const { return m_tSchema; }\n\n\t/// insert/update document in current txn\n\t/// fails in case of two open txns to different indexes\n\tvirtual bool AddDocument ( int iFields, const char ** ppFields, const CSphMatch & tDoc, bool bReplace, const CSphString & sTokenFilterOptions, const char ** ppStr, const CSphVector & dMvas, CSphString & sError, CSphString & sWarning ) = 0;\n\n\t/// insert/update document in current txn\n\t/// fails in case of two open txns to different indexes\n\tvirtual bool AddDocument ( ISphHits * pHits, const CSphMatch & tDoc, const char ** ppStr, const CSphVector & dMvas, CSphString & sError, CSphString & sWarning ) = 0;\n\n\t/// delete document in current txn\n\t/// fails in case of two open txns to different indexes\n\tvirtual bool DeleteDocument ( const SphDocID_t * pDocs, int iDocs, CSphString & sError ) = 0;\n\n\t/// commit pending changes\n\tvirtual void Commit ( int * pDeleted=NULL ) = 0;\n\n\t/// undo pending changes\n\tvirtual void RollBack () = 0;\n\n\t/// check and periodically flush RAM chunk to disk\n\tvirtual void CheckRamFlush () = 0;\n\n\t/// forcibly flush RAM chunk to disk\n\tvirtual void ForceRamFlush ( bool bPeriodic=false ) = 0;\n\n\t/// forcibly save RAM chunk as a new disk chunk\n\tvirtual void ForceDiskChunk () = 0;\n\n\t/// attach a disk chunk to current index\n\tvirtual bool AttachDiskIndex ( CSphIndex * pIndex, CSphString & sError ) = 0;\n\n\t/// truncate index (that is, kill all data)\n\tvirtual bool Truncate ( CSphString & sError ) = 0;\n\n\tvirtual void Optimize ( volatile bool * pForceTerminate, ThrottleState_t * pThrottle ) = 0;\n\n\t/// check settings vs current and return back tokenizer and dictionary in case of difference\n\tvirtual bool IsSameSettings ( CSphReconfigureSettings & tSettings, CSphReconfigureSetup & tSetup, CSphString & sError ) const = 0;\n\n\t/// reconfigure index by using new tokenizer, dictionary and index settings\n\t/// current data got saved with current settings\n\tvirtual void Reconfigure ( CSphReconfigureSetup & tSetup ) = 0;\n\n\t/// get disk chunk\n\tvirtual CSphIndex * GetDiskChunk ( int iChunk ) = 0;\n};\n\n/// initialize subsystem\nclass CSphConfigSection;\nvoid sphRTInit ( const CSphConfigSection & hSearchd, bool bTestMode );\nvoid sphRTConfigure ( const CSphConfigSection & hSearchd, bool bTestMode );\nbool sphRTSchemaConfigure ( const CSphConfigSection & hIndex, CSphSchema * pSchema, CSphString * pError );\n\n/// deinitialize subsystem\nvoid sphRTDone ();\n\n/// RT index factory\nISphRtIndex * sphCreateIndexRT ( const CSphSchema & tSchema, const char * sIndexName, int64_t iRamSize, const char * sPath, bool bKeywordDict );\n\n/// Get current txn index\nISphRtIndex * sphGetCurrentIndexRT();\n\ntypedef void ProgressCallbackSimple_t ();\n\n//////////////////////////////////////////////////////////////////////////\n\nenum ESphBinlogReplayFlags\n{\n\tSPH_REPLAY_ACCEPT_DESC_TIMESTAMP = 1\n};\n\n/// replay stored binlog\nvoid sphReplayBinlog ( const SmallStringHash_T & hIndexes, DWORD uReplayFlags, ProgressCallbackSimple_t * pfnProgressCallback=NULL );\n\n#endif // _sphinxrt_\n\n//\n// $Id: sphinxrt.h 4885 2015-01-20 07:02:07Z deogar $\n//\n"} +{"text": "!{\\src2tex{textfont=tt}}\n!!****f* ABINIT/xmpi_isend\n!! NAME\n!! xmpi_isend\n!!\n!! FUNCTION\n!! This module contains functions that calls MPI routine MPI_ISEND,\n!! to send data from one processor to another,\n!! if we compile the code using the MPI CPP flags.\n!! xmpi_isend is the generic function.\n!!\n!! COPYRIGHT\n!! Copyright (C) 2001-2020 ABINIT group\n!! This file is distributed under the terms of the\n!! GNU General Public License, see ~ABINIT/COPYING\n!! or http://www.gnu.org/copyleft/gpl.txt .\n!!\n!! TODO\n!!\n!! SOURCE\n!!***\n\n!!****f* ABINIT/xmpi_isend_int1d\n!! NAME\n!! xmpi_isend_int1d\n!!\n!! FUNCTION\n!! Sends data from one processor to another.\n!! Target: integer one-dimensional arrays.\n!!\n!! INPUTS\n!! dest :: rank of destination process\n!! tag :: integer message tag\n!! spaceComm :: MPI communicator\n!!\n!! OUTPUT\n!! ierr= exit status, a non-zero value meaning there is an error\n!!\n!! SIDE EFFECTS\n!! xval= buffer array\n!!\n!! SOURCE\n\nsubroutine xmpi_isend_int1d(xval,dest,tag,spaceComm,request,ierr)\n\n!Arguments-------------------------\n integer ABI_ASYNC, intent(inout) :: xval(:)\n integer, intent(in) :: dest,tag,spaceComm\n integer, intent(out) :: ierr\n integer, intent(out) :: request\n\n!Local variables-------------------\n#if defined HAVE_MPI\n integer :: ier,my_tag,n1\n#endif\n\n! *************************************************************************\n\n ierr=0\n#if defined HAVE_MPI\n if (spaceComm /= MPI_COMM_SELF .and. spaceComm /= MPI_COMM_NULL) then\n n1=size(xval,dim=1)\n my_tag = MOD(tag,xmpi_tag_ub)\n call MPI_ISEND(xval,n1,MPI_INTEGER,dest,my_tag,spaceComm,request,ier)\n xmpi_count_requests = xmpi_count_requests + 1\n ierr=ier\n end if\n#endif\n\n end subroutine xmpi_isend_int1d\n!!***\n\n!!****f* ABINIT/xmpi_isend_dp1d\n!! NAME\n!! xmpi_isend_dp1d\n!!\n!! FUNCTION\n!! Sends data from one proc to another.\n!! Target: double precision two-dimensional arrays.\n!!\n!! INPUTS\n!! dest :: rank of destination process\n!! tag :: integer message tag\n!! spaceComm :: MPI communicator\n!!\n!! OUTPUT\n!! ierr= exit status, a non-zero value meaning there is an error\n!!\n!! SIDE EFFECTS\n!! xval= buffer array\n!!\n!! SOURCE\n\nsubroutine xmpi_isend_dp1d(xval,dest,tag,spaceComm,request,ierr)\n\n!Arguments-------------------------\n real(dp) ABI_ASYNC, intent(inout) :: xval(:)\n integer, intent(in) :: dest,tag,spaceComm\n integer, intent(out) :: ierr\n integer, intent(out) :: request\n\n!Local variables-------------------\n#if defined HAVE_MPI\n integer :: ier,my_tag,n1\n#endif\n\n! *************************************************************************\n\n ierr=0\n#if defined HAVE_MPI\n if (spaceComm /= MPI_COMM_SELF .and. spaceComm /= MPI_COMM_NULL) then\n n1=size(xval)\n my_tag = MOD(tag,xmpi_tag_ub)\n call MPI_ISEND(xval,n1,MPI_DOUBLE_PRECISION,dest,my_tag,spaceComm,request,ier)\n xmpi_count_requests = xmpi_count_requests + 1\n ierr=ier\n end if\n#endif\n\nend subroutine xmpi_isend_dp1d\n!!***\n\n!!****f* ABINIT/xmpi_isend_dp2d\n!! NAME\n!! xmpi_isend_dp2d\n!!\n!! FUNCTION\n!! Sends data from one proc to another.\n!! Target: double precision two-dimensional arrays.\n!!\n!! INPUTS\n!! dest :: rank of destination process\n!! tag :: integer message tag\n!! spaceComm :: MPI communicator\n!!\n!! OUTPUT\n!! ierr= exit status, a non-zero value meaning there is an error\n!!\n!! SIDE EFFECTS\n!! xval= buffer array\n!!\n!! SOURCE\n\nsubroutine xmpi_isend_dp2d(xval,dest,tag,spaceComm,request,ierr)\n\n!Arguments-------------------------\n real(dp) ABI_ASYNC, intent(inout) :: xval(:,:)\n integer, intent(in) :: dest,tag,spaceComm\n integer, intent(out) :: ierr\n integer, intent(out) :: request\n\n!Local variables-------------------\n#if defined HAVE_MPI\n integer :: ier,my_dt,my_op,my_tag,n1,n2\n integer(kind=int64) :: ntot\n#endif\n\n! *************************************************************************\n\n ierr=0\n#if defined HAVE_MPI\n if (spaceComm /= MPI_COMM_SELF .and. spaceComm /= MPI_COMM_NULL) then\n n1=size(xval,dim=1)\n n2=size(xval,dim=2)\n my_tag = MOD(tag,xmpi_tag_ub)\n\n !This product of dimensions can be greater than a 32bit integer\n !We use a INT64 to store it. If it is too large, we switch to an\n !alternate routine because MPI<4 doesnt handle 64 bit counts.\n ntot=int(n1*n2,kind=int64)\n\n if (ntot<=xmpi_maxint32_64) then\n call MPI_ISEND(xval,n1*n2,MPI_DOUBLE_PRECISION,dest,my_tag,spaceComm,request,ier)\n else\n call xmpi_largetype_create(ntot,MPI_DOUBLE_PRECISION,my_dt,my_op,MPI_OP_NULL)\n call MPI_ISEND(xval,1,my_dt,dest,my_tag,spaceComm,request,ier)\n call xmpi_largetype_free(my_dt,my_op)\n end if\n\n xmpi_count_requests = xmpi_count_requests + 1\n ierr=ier\n end if\n#endif\n\nend subroutine xmpi_isend_dp2d\n!!***\n"} +{"text": "/*\n * Copyright (C) Narf Industries \n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#include \"cgc_libc.h\"\n\n\n// libc libs borrowed from EAGLE_00004\n\n\n// I/O functions\nint cgc_send(const char *buf, const cgc_size_t size) {\n if(cgc_transmit_all(STDOUT, buf, size)) {\n cgc__terminate(111);\n }\n\n return 0;\n}\n\nint cgc_transmit_all(int fd, const char *buf, const cgc_size_t size) {\n cgc_size_t sent = 0;\n cgc_size_t sent_now = 0;\n int ret;\n\n if (!buf)\n return 1;\n\n if (!size)\n return 2;\n\n while (sent < size) {\n ret = cgc_transmit(fd, buf + sent, size - sent, &sent_now);\n if (ret != 0) {\n return 3;\n }\n sent += sent_now;\n }\n\n return 0;\n}\n\n// returns number of bytes received\nunsigned int cgc_recv_all(char *res_buf, cgc_size_t res_buf_size) {\n return cgc_read_all(STDIN, res_buf, res_buf_size);\n}\n\nunsigned int cgc_read_all(int fd, char *buf, unsigned int size) {\n char ch;\n unsigned int total = 0;\n cgc_size_t nbytes;\n while (size) {\n if (cgc_receive(fd, &ch, 1, &nbytes) != 0 || nbytes == 0) {\n break;\n }\n buf[total++] = ch;\n size--;\n }\n return total;\n}\n\n// stdlib functions\n\n// overwrites the first n chars of dst with char c.\nvoid *cgc_memset(void *dst, int c, unsigned int n) {\n char *d = (char*)dst;\n while (n--) {*d++ = (char)c;}\n return dst;\n}\n\n"} +{"text": ".video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline {\n width: 10em\n}\n\n.video-js .vjs-controls-disabled .vjs-big-play-button {\n display: none!important\n}\n\n.video-js .vjs-control {\n width: 3em\n}\n\n.video-js .vjs-menu-button-inline:before {\n width: 1.5em\n}\n\n.vjs-menu-button-inline .vjs-menu {\n left: 3em\n}\n\n.vjs-paused.vjs-has-started.video-js .vjs-big-play-button,.video-js.vjs-ended .vjs-big-play-button,.video-js.vjs-paused .vjs-big-play-button {\n display: block\n}\n\n.video-js .vjs-load-progress div,.vjs-seeking .vjs-big-play-button,.vjs-waiting .vjs-big-play-button {\n display: none!important\n}\n\n.video-js .vjs-mouse-display:after,.video-js .vjs-play-progress:after {\n padding: 0 .4em .3em\n}\n\n.video-js.vjs-ended .vjs-loading-spinner {\n display: none;\n}\n\n.video-js.vjs-ended .vjs-big-play-button {\n display: block !important;\n}\n\nvideo-js.vjs-ended .vjs-big-play-button,.video-js.vjs-paused .vjs-big-play-button,.vjs-paused.vjs-has-started.video-js .vjs-big-play-button {\n display: block\n}\n\n.video-js .vjs-big-play-button {\n top: 50%;\n left: 50%;\n margin-left: -1.5em;\n margin-top: -1em\n}\n\n.video-js .vjs-big-play-button {\n background-color: rgba(58,148,37,0.7);\n font-size: 3em;\n border-radius: 15%;\n height: 1.8em !important;\n line-height: 1.8em !important;\n margin-top: -0.9em !important\n}\n\n.video-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus,.video-js .vjs-big-play-button:active {\n background-color: #3a9425\n}\n\n.video-js .vjs-loading-spinner {\n border-color: #3a9425\n}\n\n.video-js .vjs-control-bar2 {\n background-color: #3a9425\n}\n\n.video-js .vjs-control-bar {\n background-color: #3a9425 !important;\n color: #ffffff;\n font-size: 11px\n}\n\n.video-js .vjs-play-progress,.video-js .vjs-volume-level {\n background-color: #f3ec1a\n}\n\n.video-js .vjs-slider {\n background-color: #3b3d41\n}\n\n.video-js .vjs-load-progress {\n background: rgba(252,249,133,0.7);\n}\n\n.video-js .vjs-big-play-button {\n color: #f3ec1a;\n border-color: #f3ec1a;\n}"} +{"text": "package com.huawei.android.hardware.fmradio;\n\npublic class FmRxRdsData {\n}\n"} +{"text": "package kingpin\n\n//go:generate go run ./cmd/genvalues/main.go\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\t\"os\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/alecthomas/units\"\n)\n\n// NOTE: Most of the base type values were lifted from:\n// http://golang.org/src/pkg/flag/flag.go?s=20146:20222\n\n// Value is the interface to the dynamic value stored in a flag.\n// (The default value is represented as a string.)\n//\n// If a Value has an IsBoolFlag() bool method returning true, the command-line\n// parser makes --name equivalent to -name=true rather than using the next\n// command-line argument, and adds a --no-name counterpart for negating the\n// flag.\ntype Value interface {\n\tString() string\n\tSet(string) error\n}\n\n// Getter is an interface that allows the contents of a Value to be retrieved.\n// It wraps the Value interface, rather than being part of it, because it\n// appeared after Go 1 and its compatibility rules. All Value types provided\n// by this package satisfy the Getter interface.\ntype Getter interface {\n\tValue\n\tGet() interface{}\n}\n\n// Optional interface to indicate boolean flags that don't accept a value, and\n// implicitly have a --no- negation counterpart.\ntype boolFlag interface {\n\tValue\n\tIsBoolFlag() bool\n}\n\n// Optional interface for values that cumulatively consume all remaining\n// input.\ntype cumulativeValue interface {\n\tValue\n\tReset()\n\tIsCumulative() bool\n}\n\ntype accumulator struct {\n\telement func(value interface{}) Value\n\ttyp reflect.Type\n\tslice reflect.Value\n}\n\n// Use reflection to accumulate values into a slice.\n//\n// target := []string{}\n// newAccumulator(&target, func (value interface{}) Value {\n// return newStringValue(value.(*string))\n// })\nfunc newAccumulator(slice interface{}, element func(value interface{}) Value) *accumulator {\n\ttyp := reflect.TypeOf(slice)\n\tif typ.Kind() != reflect.Ptr || typ.Elem().Kind() != reflect.Slice {\n\t\tpanic(T(\"expected a pointer to a slice\"))\n\t}\n\treturn &accumulator{\n\t\telement: element,\n\t\ttyp: typ.Elem().Elem(),\n\t\tslice: reflect.ValueOf(slice),\n\t}\n}\n\nfunc (a *accumulator) String() string {\n\tout := []string{}\n\ts := a.slice.Elem()\n\tfor i := 0; i < s.Len(); i++ {\n\t\tout = append(out, a.element(s.Index(i).Addr().Interface()).String())\n\t}\n\treturn strings.Join(out, \",\")\n}\n\nfunc (a *accumulator) Set(value string) error {\n\te := reflect.New(a.typ)\n\tif err := a.element(e.Interface()).Set(value); err != nil {\n\t\treturn err\n\t}\n\tslice := reflect.Append(a.slice.Elem(), e.Elem())\n\ta.slice.Elem().Set(slice)\n\treturn nil\n}\n\nfunc (a *accumulator) Get() interface{} {\n\treturn a.slice.Interface()\n}\n\nfunc (a *accumulator) IsCumulative() bool {\n\treturn true\n}\n\nfunc (a *accumulator) Reset() {\n\tif a.slice.Kind() == reflect.Ptr {\n\t\ta.slice.Elem().Set(reflect.MakeSlice(a.slice.Type().Elem(), 0, 0))\n\t} else {\n\t\ta.slice.Set(reflect.MakeSlice(a.slice.Type(), 0, 0))\n\t}\n}\n\nfunc (b *boolValue) IsBoolFlag() bool { return true }\n\n// -- map[string]string Value\ntype stringMapValue map[string]string\n\nfunc newStringMapValue(p *map[string]string) *stringMapValue {\n\treturn (*stringMapValue)(p)\n}\n\nvar stringMapRegex = regexp.MustCompile(\"[:=]\")\n\nfunc (s *stringMapValue) Set(value string) error {\n\tparts := stringMapRegex.Split(value, 2)\n\tif len(parts) != 2 {\n\t\treturn TError(\"expected KEY=VALUE got '{{.Arg0}}'\", V{\"Arg0\": value})\n\t}\n\t(*s)[parts[0]] = parts[1]\n\treturn nil\n}\n\nfunc (s *stringMapValue) Get() interface{} {\n\treturn (map[string]string)(*s)\n}\n\nfunc (s *stringMapValue) String() string {\n\treturn fmt.Sprintf(\"%s\", map[string]string(*s))\n}\n\nfunc (s *stringMapValue) IsCumulative() bool {\n\treturn true\n}\n\nfunc (s *stringMapValue) Reset() {\n\t*s = map[string]string{}\n}\n\n// -- existingFile Value\n\ntype fileStatValue struct {\n\tpath *string\n\tpredicate func(os.FileInfo) error\n}\n\nfunc newFileStatValue(p *string, predicate func(os.FileInfo) error) *fileStatValue {\n\treturn &fileStatValue{\n\t\tpath: p,\n\t\tpredicate: predicate,\n\t}\n}\n\nfunc (f *fileStatValue) Set(value string) error {\n\tif s, err := os.Stat(value); os.IsNotExist(err) {\n\t\treturn TError(\"path '{{.Arg0}}' does not exist\", V{\"Arg0\": value})\n\t} else if err != nil {\n\t\treturn err\n\t} else if err := f.predicate(s); err != nil {\n\t\treturn err\n\t}\n\t*f.path = value\n\treturn nil\n}\n\nfunc (f *fileStatValue) Get() interface{} {\n\treturn (string)(*f.path)\n}\n\nfunc (f *fileStatValue) String() string {\n\treturn *f.path\n}\n\n// -- url.URL Value\ntype urlValue struct {\n\tu **url.URL\n}\n\nfunc newURLValue(p **url.URL) *urlValue {\n\treturn &urlValue{p}\n}\n\nfunc (u *urlValue) Set(value string) error {\n\turl, err := url.Parse(value)\n\tif err != nil {\n\t\treturn TError(\"invalid URL: {{.Arg0}}\", V{\"Arg0\": err})\n\t}\n\t*u.u = url\n\treturn nil\n}\n\nfunc (u *urlValue) Get() interface{} {\n\treturn (*url.URL)(*u.u)\n}\n\nfunc (u *urlValue) String() string {\n\tif *u.u == nil {\n\t\treturn T(\"\")\n\t}\n\treturn (*u.u).String()\n}\n\n// -- []*url.URL Value\ntype urlListValue []*url.URL\n\nfunc newURLListValue(p *[]*url.URL) *urlListValue {\n\treturn (*urlListValue)(p)\n}\n\nfunc (u *urlListValue) Set(value string) error {\n\turl, err := url.Parse(value)\n\tif err != nil {\n\t\treturn TError(\"invalid URL: {{.Arg0}}\", V{\"Arg0\": err})\n\t}\n\t*u = append(*u, url)\n\treturn nil\n}\n\nfunc (u *urlListValue) Get() interface{} {\n\treturn ([]*url.URL)(*u)\n}\n\nfunc (u *urlListValue) String() string {\n\tout := []string{}\n\tfor _, url := range *u {\n\t\tout = append(out, url.String())\n\t}\n\treturn strings.Join(out, \",\")\n}\n\n// A flag whose value must be in a set of options.\ntype enumValue struct {\n\tvalue *string\n\toptions []string\n}\n\nfunc newEnumFlag(target *string, options ...string) *enumValue {\n\treturn &enumValue{\n\t\tvalue: target,\n\t\toptions: options,\n\t}\n}\n\nfunc (e *enumValue) String() string {\n\treturn *e.value\n}\n\nfunc (e *enumValue) Set(value string) error {\n\tfor _, v := range e.options {\n\t\tif v == value {\n\t\t\t*e.value = value\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn TError(\"enum value must be one of {{.Arg0}}, got '{{.Arg1}}'\", V{\"Arg0\": strings.Join(e.options, T(\",\")), \"Arg1\": value})\n}\n\nfunc (e *enumValue) Get() interface{} {\n\treturn (string)(*e.value)\n}\n\n// -- []string Enum Value\ntype enumsValue struct {\n\tvalue *[]string\n\toptions []string\n}\n\nfunc newEnumsFlag(target *[]string, options ...string) *enumsValue {\n\treturn &enumsValue{\n\t\tvalue: target,\n\t\toptions: options,\n\t}\n}\n\nfunc (e *enumsValue) Set(value string) error {\n\tfor _, v := range e.options {\n\t\tif v == value {\n\t\t\t*e.value = append(*e.value, value)\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn TError(\"enum value must be one of {{.Arg0}}, got '{{.Arg1}}'\", V{\"Arg0\": strings.Join(e.options, T(\",\")), \"Arg1\": value})\n}\n\nfunc (e *enumsValue) Get() interface{} {\n\treturn ([]string)(*e.value)\n}\n\nfunc (e *enumsValue) String() string {\n\treturn strings.Join(*e.value, \",\")\n}\n\nfunc (e *enumsValue) IsCumulative() bool {\n\treturn true\n}\n\nfunc (e *enumsValue) Reset() {\n\t*e.value = []string{}\n}\n\n// -- units.Base2Bytes Value\ntype bytesValue units.Base2Bytes\n\nfunc newBytesValue(p *units.Base2Bytes) *bytesValue {\n\treturn (*bytesValue)(p)\n}\n\nfunc (d *bytesValue) Set(s string) error {\n\tv, err := units.ParseBase2Bytes(s)\n\t*d = bytesValue(v)\n\treturn err\n}\n\nfunc (d *bytesValue) Get() interface{} { return units.Base2Bytes(*d) }\n\nfunc (d *bytesValue) String() string { return (*units.Base2Bytes)(d).String() }\n\nfunc newExistingFileValue(target *string) *fileStatValue {\n\treturn newFileStatValue(target, func(s os.FileInfo) error {\n\t\tif s.IsDir() {\n\t\t\treturn TError(\"'{{.Arg0}}' is a directory\", V{\"Arg0\": s.Name()})\n\t\t}\n\t\treturn nil\n\t})\n}\n\nfunc newExistingDirValue(target *string) *fileStatValue {\n\treturn newFileStatValue(target, func(s os.FileInfo) error {\n\t\tif !s.IsDir() {\n\t\t\treturn TError(\"'{{.Arg0}}' is a file\", V{\"Arg0\": s.Name()})\n\t\t}\n\t\treturn nil\n\t})\n}\n\nfunc newExistingFileOrDirValue(target *string) *fileStatValue {\n\treturn newFileStatValue(target, func(s os.FileInfo) error { return nil })\n}\n\ntype counterValue int\n\nfunc newCounterValue(n *int) *counterValue {\n\treturn (*counterValue)(n)\n}\n\nfunc (c *counterValue) Set(s string) error {\n\t*c++\n\treturn nil\n}\n\nfunc (c *counterValue) Get() interface{} { return (int)(*c) }\nfunc (c *counterValue) IsBoolFlag() bool { return true }\nfunc (c *counterValue) String() string { return fmt.Sprintf(\"%d\", *c) }\nfunc (c *counterValue) IsCumulative() bool { return true }\nfunc (c *counterValue) Reset() { *c = 0 }\n"} +{"text": "\nCopyright (c): 1999-2008 New Digital Group, all rights reserved\nVersion: 1.2.4\n\n* This library is free software; you can redistribute it and/or\n* modify it under the terms of the GNU Lesser General Public\n* License as published by the Free Software Foundation; either\n* version 2.1 of the License, or (at your option) any later version.\n*\n* This library is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n* Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public\n* License along with this library; if not, write to the Free Software\n* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\nYou may contact the author of Snoopy by e-mail at:\nmonte@ohrt.com\n\nThe latest version of Snoopy can be obtained from:\nhttp://snoopy.sourceforge.net/\n\n*************************************************/\n\nclass Snoopy\n{\n\t/**** Public variables ****/\n\n\t/* user definable vars */\n\n\tvar $host\t\t\t=\t\"www.php.net\";\t\t// host name we are connecting to\n\tvar $port\t\t\t=\t80;\t\t\t\t\t// port we are connecting to\n\tvar $proxy_host\t\t=\t\"\";\t\t\t\t\t// proxy host to use\n\tvar $proxy_port\t\t=\t\"\";\t\t\t\t\t// proxy port to use\n\tvar $proxy_user\t\t=\t\"\";\t\t\t\t\t// proxy user to use\n\tvar $proxy_pass\t\t=\t\"\";\t\t\t\t\t// proxy password to use\n\n\tvar $agent\t\t\t=\t\"Mozilla/5.0\";\t// agent we masquerade as\n\tvar\t$referer\t\t=\t\"\";\t\t\t\t\t// referer info to pass\n\tvar $cookies\t\t=\tarray();\t\t\t// array of cookies to pass\n\t// $cookies[\"username\"]=\"joe\";\n\tvar\t$rawheaders\t\t=\tarray();\t\t\t// array of raw headers to send\n\t// $rawheaders[\"Content-type\"]=\"text/html\";\n\n\tvar $maxredirs\t\t=\t5;\t\t\t\t\t// http redirection depth maximum. 0 = disallow\n\tvar $lastredirectaddr\t=\t\"\";\t\t\t\t// contains address of last redirected address\n\tvar\t$offsiteok\t\t=\ttrue;\t\t\t\t// allows redirection off-site\n\tvar $maxframes\t\t=\t0;\t\t\t\t\t// frame content depth maximum. 0 = disallow\n\tvar $expandlinks\t=\ttrue;\t\t\t\t// expand links to fully qualified URLs.\n\t// this only applies to fetchlinks()\n\t// submitlinks(), and submittext()\n\tvar $passcookies\t=\ttrue;\t\t\t\t// pass set cookies back through redirects\n\t// NOTE: this currently does not respect\n\t// dates, domains or paths.\n\n\tvar\t$user\t\t\t=\t\"\";\t\t\t\t\t// user for http authentication\n\tvar\t$pass\t\t\t=\t\"\";\t\t\t\t\t// password for http authentication\n\n\t// http accept types\n\tvar $accept\t\t\t=\t\"application/json, text/javascript, */*; q=0.01\";\n\n\tvar $results\t\t=\t\"\";\t\t\t\t\t// where the content is put\n\n\tvar $error\t\t\t=\t\"\";\t\t\t\t\t// error messages sent here\n\tvar\t$response_code\t=\t\"\";\t\t\t\t\t// response code returned from server\n\tvar\t$headers\t\t=\tarray();\t\t\t// headers returned from server sent here\n\tvar\t$maxlength\t\t=\t500000;\t\t\t\t// max return data length (body)\n\tvar $read_timeout\t=\t0;\t\t\t\t\t// timeout on read operations, in seconds\n\t// supported only since PHP 4 Beta 4\n\t// set to 0 to disallow timeouts\n\tvar $timed_out\t\t=\tfalse;\t\t\t\t// if a read operation timed out\n\tvar\t$status\t\t\t=\t0;\t\t\t\t\t// http request status\n\n\tvar $temp_dir\t\t=\t\"/tmp\";\t\t\t\t// temporary directory that the webserver\n\t// has permission to write to.\n\t// under Windows, this should be C:\\temp\n\n\tvar\t$curl_path\t\t=\t\"/usr/local/bin/curl\";\n\t// Snoopy will use cURL for fetching\n\t// SSL content if a full system path to\n\t// the cURL binary is supplied here.\n\t// set to false if you do not have\n\t// cURL installed. See http://curl.haxx.se\n\t// for details on installing cURL.\n\t// Snoopy does *not* use the cURL\n\t// library functions built into php,\n\t// as these functions are not stable\n\t// as of this Snoopy release.\n\n\t/**** Private variables ****/\n\n\tvar\t$_maxlinelen\t=\t4096;\t\t\t\t// max line length (headers)\n\n\tvar $_httpmethod\t=\t\"GET\";\t\t\t\t// default http request method\n\tvar $_httpversion\t=\t\"HTTP/1.0\";\t\t\t// default http request version\n\tvar $_submit_method\t=\t\"POST\";\t\t\t\t// default submit method\n\tvar $_submit_type\t=\t\"application/x-www-form-urlencoded\";\t// default submit type\n\tvar $_mime_boundary\t= \"\";\t\t\t\t\t// MIME boundary for multipart/form-data submit type\n\tvar $_redirectaddr\t=\tfalse;\t\t\t\t// will be set if page fetched is a redirect\n\tvar $_redirectdepth\t=\t0;\t\t\t\t\t// increments on an http redirect\n\tvar $_frameurls\t\t= \tarray();\t\t\t// frame src urls\n\tvar $_framedepth\t=\t0;\t\t\t\t\t// increments on frame depth\n\n\tvar $_isproxy\t\t=\tfalse;\t\t\t\t// set if using a proxy server\n\tvar $_fp_timeout\t=\t30;\t\t\t\t\t// timeout for socket connection\n\n\t/*======================================================================*\\\n\t Function:\tfetch\n\tPurpose:\tfetch the contents of a web page\n\t(and possibly other protocols in the\n\t\t\tfuture like ftp, nntp, gopher, etc.)\n\tInput:\t\t$URI\tthe location of the page to fetch\n\tOutput:\t\t$this->results\tthe output text from the fetch\n\t\\*======================================================================*/\n\n\tfunction fetch($URI)\n\t{\n\n\t\t//preg_match(\"|^([^:]+)://([^:/]+)(:[\\d]+)*(.*)|\",$URI,$URI_PARTS);\n\t\t$URI_PARTS = parse_url($URI);\n\t\tif (!empty($URI_PARTS[\"user\"]))\n\t\t\t$this->user = $URI_PARTS[\"user\"];\n\t\tif (!empty($URI_PARTS[\"pass\"]))\n\t\t\t$this->pass = $URI_PARTS[\"pass\"];\n\t\tif (empty($URI_PARTS[\"query\"]))\n\t\t\t$URI_PARTS[\"query\"] = '';\n\t\tif (empty($URI_PARTS[\"path\"]))\n\t\t\t$URI_PARTS[\"path\"] = '';\n\n\t\tswitch(strtolower($URI_PARTS[\"scheme\"]))\n\t\t{\n\t\t\tcase \"http\":\n\t\t\t\t$this->host = $URI_PARTS[\"host\"];\n\t\t\t\tif(!empty($URI_PARTS[\"port\"]))\n\t\t\t\t\t$this->port = $URI_PARTS[\"port\"];\n\t\t\t\tif($this->_connect($fp))\n\t\t\t\t{\n\t\t\t\t\tif($this->_isproxy)\n\t\t\t\t\t{\n\t\t\t\t\t\t// using proxy, send entire URI\n\t\t\t\t\t\t$this->_httprequest($URI,$fp,$URI,$this->_httpmethod);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$path = $URI_PARTS[\"path\"].($URI_PARTS[\"query\"] ? \"?\".$URI_PARTS[\"query\"] : \"\");\n\t\t\t\t\t\t// no proxy, send only the path\n\t\t\t\t\t\t$this->_httprequest($path, $fp, $URI, $this->_httpmethod);\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t$this->_disconnect($fp);\n\n\t\t\t\t\tif($this->_redirectaddr)\n\t\t\t\t\t{\n\t\t\t\t\t\t/* url was redirected, check if we've hit the max depth */\n\t\t\t\t\t\tif($this->maxredirs > $this->_redirectdepth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// only follow redirect if it's on this site, or offsiteok is true\n\t\t\t\t\t\t\tif(preg_match(\"|^http://\".preg_quote($this->host).\"|i\",$this->_redirectaddr) || $this->offsiteok)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* follow the redirect */\n\t\t\t\t\t\t\t\t$this->_redirectdepth++;\n\t\t\t\t\t\t\t\t$this->lastredirectaddr=$this->_redirectaddr;\n\t\t\t\t\t\t\t\t$this->fetch($this->_redirectaddr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$frameurls = $this->_frameurls;\n\t\t\t\t\t\t$this->_frameurls = array();\n\n\t\t\t\t\t\twhile(list(,$frameurl) = each($frameurls))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->_framedepth < $this->maxframes)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->fetch($frameurl);\n\t\t\t\t\t\t\t\t$this->_framedepth++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\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}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase \"https\":\n\t\t\t\tif (!function_exists('curl_init')) {\n\t\t\t\t\tif(!$this->curl_path)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tif(function_exists(\"is_executable\"))\n\t\t\t\t\t\tif (!is_executable($this->curl_path))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$this->host = $URI_PARTS[\"host\"];\n\t\t\t\tif(!empty($URI_PARTS[\"port\"]))\n\t\t\t\t\t$this->port = $URI_PARTS[\"port\"];\n\t\t\t\tif($this->_isproxy)\n\t\t\t\t{\n\t\t\t\t\t// using proxy, send entire URI\n\t\t\t\t\t$this->_httpsrequest($URI,$URI,$this->_httpmethod);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$path = $URI_PARTS[\"path\"].($URI_PARTS[\"query\"] ? \"?\".$URI_PARTS[\"query\"] : \"\");\n\t\t\t\t\t// no proxy, send only the path\n\t\t\t\t\t$this->_httpsrequest($path, $URI, $this->_httpmethod);\n\t\t\t\t}\n\n\t\t\t\tif($this->_redirectaddr)\n\t\t\t\t{\n\t\t\t\t\t/* url was redirected, check if we've hit the max depth */\n\t\t\t\t\tif($this->maxredirs > $this->_redirectdepth)\n\t\t\t\t\t{\n\t\t\t\t\t\t// only follow redirect if it's on this site, or offsiteok is true\n\t\t\t\t\t\tif(preg_match(\"|^https://\".preg_quote($this->host).\"|i\",$this->_redirectaddr) || $this->offsiteok)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* follow the redirect */\n\t\t\t\t\t\t\t$this->_redirectdepth++;\n\t\t\t\t\t\t\t$this->lastredirectaddr=$this->_redirectaddr;\n\t\t\t\t\t\t\t$this->fetch($this->_redirectaddr);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)\n\t\t\t\t{\n\t\t\t\t\t$frameurls = $this->_frameurls;\n\t\t\t\t\t$this->_frameurls = array();\n\n\t\t\t\t\twhile(list(,$frameurl) = each($frameurls))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->_framedepth < $this->maxframes)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->fetch($frameurl);\n\t\t\t\t\t\t\t$this->_framedepth++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// not a valid protocol\n\t\t\t\t$this->error\t=\t'Invalid protocol \"'.$URI_PARTS[\"scheme\"].'\"\\n';\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/*======================================================================*\\\n\t Function:\tsubmit\n\tPurpose:\tsubmit an http form\n\tInput:\t\t$URI\tthe location to post the data\n\t$formvars\tthe formvars to use.\n\tformat: $formvars[\"var\"] = \"val\";\n\t$formfiles an array of files to submit\n\tformat: $formfiles[\"var\"] = \"/dir/filename.ext\";\n\tOutput:\t\t$this->results\tthe text output from the post\n\t\\*======================================================================*/\n\n\tfunction submit($URI, $formvars=\"\", $formfiles=\"\")\n\t{\n\t\tunset($postdata);\n\n\t\t$postdata = $this->_prepare_post_body($formvars, $formfiles);\n\t\t$URI_PARTS = parse_url($URI);\n\t\tif (!empty($URI_PARTS[\"user\"]))\n\t\t\t$this->user = $URI_PARTS[\"user\"];\n\t\tif (!empty($URI_PARTS[\"pass\"]))\n\t\t\t$this->pass = $URI_PARTS[\"pass\"];\n\t\tif (empty($URI_PARTS[\"query\"]))\n\t\t\t$URI_PARTS[\"query\"] = '';\n\t\tif (empty($URI_PARTS[\"path\"]))\n\t\t\t$URI_PARTS[\"path\"] = '';\n\n\t\tswitch(strtolower($URI_PARTS[\"scheme\"]))\n\t\t{\n\t\t\tcase \"http\":\n\t\t\t\t$this->host = $URI_PARTS[\"host\"];\n\t\t\t\tif(!empty($URI_PARTS[\"port\"]))\n\t\t\t\t\t$this->port = $URI_PARTS[\"port\"];\n\t\t\t\tif($this->_connect($fp))\n\t\t\t\t{\n\t\t\t\t\tif($this->_isproxy)\n\t\t\t\t\t{\n\t\t\t\t\t\t// using proxy, send entire URI\n\t\t\t\t\t\t$this->_httprequest($URI,$fp,$URI,$this->_submit_method,$this->_submit_type,$postdata);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$path = $URI_PARTS[\"path\"].($URI_PARTS[\"query\"] ? \"?\".$URI_PARTS[\"query\"] : \"\");\n\t\t\t\t\t\t// no proxy, send only the path\n\t\t\t\t\t\t$this->_httprequest($path, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata);\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t$this->_disconnect($fp);\n\n\t\t\t\t\tif($this->_redirectaddr)\n\t\t\t\t\t{\n\t\t\t\t\t\t/* url was redirected, check if we've hit the max depth */\n\t\t\t\t\t\tif($this->maxredirs > $this->_redirectdepth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(!preg_match(\"|^\".$URI_PARTS[\"scheme\"].\"://|\", $this->_redirectaddr))\n\t\t\t\t\t\t\t\t$this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS[\"scheme\"].\"://\".$URI_PARTS[\"host\"]);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// only follow redirect if it's on this site, or offsiteok is true\n\t\t\t\t\t\t\tif(preg_match(\"|^http://\".preg_quote($this->host).\"|i\",$this->_redirectaddr) || $this->offsiteok)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* follow the redirect */\n\t\t\t\t\t\t\t\t$this->_redirectdepth++;\n\t\t\t\t\t\t\t\t$this->lastredirectaddr=$this->_redirectaddr;\n\t\t\t\t\t\t\t\tif( strpos( $this->_redirectaddr, \"?\" ) > 0 )\n\t\t\t\t\t\t\t\t\t$this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$this->submit($this->_redirectaddr,$formvars, $formfiles);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$frameurls = $this->_frameurls;\n\t\t\t\t\t\t$this->_frameurls = array();\n\n\t\t\t\t\t\twhile(list(,$frameurl) = each($frameurls))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->_framedepth < $this->maxframes)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->fetch($frameurl);\n\t\t\t\t\t\t\t\t$this->_framedepth++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\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\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase \"https\":\n\t\t\t\tif (!function_exists('curl_init')) {\n\t\t\t\tif(!$this->curl_path)\n\t\t\t\t\treturn false;\n\t\t\t\tif(function_exists(\"is_executable\"))\n\t\t\t\t\tif (!is_executable($this->curl_path))\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$this->host = $URI_PARTS[\"host\"];\n\t\t\t\tif(!empty($URI_PARTS[\"port\"]))\n\t\t\t\t\t$this->port = $URI_PARTS[\"port\"];\n\t\t\t\tif($this->_isproxy)\n\t\t\t\t{\n\t\t\t\t\t// using proxy, send entire URI\n\t\t\t\t\t$this->_httpsrequest($URI, $URI, $this->_submit_method, $this->_submit_type, $postdata);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$path = $URI_PARTS[\"path\"].($URI_PARTS[\"query\"] ? \"?\".$URI_PARTS[\"query\"] : \"\");\n\t\t\t\t\t// no proxy, send only the path\n\t\t\t\t\t$this->_httpsrequest($path, $URI, $this->_submit_method, $this->_submit_type, $postdata);\n\t\t\t\t}\n\n\t\t\t\tif($this->_redirectaddr)\n\t\t\t\t{\n\t\t\t\t\t/* url was redirected, check if we've hit the max depth */\n\t\t\t\t\tif($this->maxredirs > $this->_redirectdepth)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!preg_match(\"|^\".$URI_PARTS[\"scheme\"].\"://|\", $this->_redirectaddr))\n\t\t\t\t\t\t\t$this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS[\"scheme\"].\"://\".$URI_PARTS[\"host\"]);\n\n\t\t\t\t\t\t// only follow redirect if it's on this site, or offsiteok is true\n\t\t\t\t\t\tif(preg_match(\"|^https://\".preg_quote($this->host).\"|i\",$this->_redirectaddr) || $this->offsiteok)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* follow the redirect */\n\t\t\t\t\t\t\t$this->_redirectdepth++;\n\t\t\t\t\t\t\t$this->lastredirectaddr=$this->_redirectaddr;\n\t\t\t\t\t\t\tif( strpos( $this->_redirectaddr, \"?\" ) > 0 )\n\t\t\t\t\t\t\t\t$this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$this->submit($this->_redirectaddr,$formvars, $formfiles);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)\n\t\t\t\t{\n\t\t\t\t\t$frameurls = $this->_frameurls;\n\t\t\t\t\t$this->_frameurls = array();\n\n\t\t\t\t\twhile(list(,$frameurl) = each($frameurls))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->_framedepth < $this->maxframes)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->fetch($frameurl);\n\t\t\t\t\t\t\t$this->_framedepth++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// not a valid protocol\n\t\t\t\t$this->error\t=\t'Invalid protocol \"'.$URI_PARTS[\"scheme\"].'\"\\n';\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/*======================================================================*\\\n\t Function:\tfetchlinks\n\tPurpose:\tfetch the links from a web page\n\tInput:\t\t$URI\twhere you are fetching from\n\tOutput:\t\t$this->results\tan array of the URLs\n\t\\*======================================================================*/\n\n\tfunction fetchlinks($URI)\n\t{\n\t\tif ($this->fetch($URI))\n\t\t{\n\t\t\tif($this->lastredirectaddr)\n\t\t\t\t$URI = $this->lastredirectaddr;\n\t\t\tif(is_array($this->results))\n\t\t\t{\n\t\t\t\tfor($x=0;$xresults);$x++)\n\t\t\t\t\t$this->results[$x] = $this->_striplinks($this->results[$x]);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$this->results = $this->_striplinks($this->results);\n\n\t\t\tif($this->expandlinks)\n\t\t\t\t$this->results = $this->_expandlinks($this->results, $URI);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n\n\t/*======================================================================*\\\n\t Function:\tfetchform\n\tPurpose:\tfetch the form elements from a web page\n\tInput:\t\t$URI\twhere you are fetching from\n\tOutput:\t\t$this->results\tthe resulting html form\n\t\\*======================================================================*/\n\n\tfunction fetchform($URI)\n\t{\n\n\t\tif ($this->fetch($URI))\n\t\t{\n\n\t\t\tif(is_array($this->results))\n\t\t\t{\n\t\t\t\tfor($x=0;$xresults);$x++)\n\t\t\t\t\t$this->results[$x] = $this->_stripform($this->results[$x]);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$this->results = $this->_stripform($this->results);\n\t\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n\n\n\t/*======================================================================*\\\n\t Function:\tfetchtext\n\tPurpose:\tfetch the text from a web page, stripping the links\n\tInput:\t\t$URI\twhere you are fetching from\n\tOutput:\t\t$this->results\tthe text from the web page\n\t\\*======================================================================*/\n\n\tfunction fetchtext($URI)\n\t{\n\t\tif($this->fetch($URI))\n\t\t{\n\t\t\tif(is_array($this->results))\n\t\t\t{\n\t\t\t\tfor($x=0;$xresults);$x++)\n\t\t\t\t\t$this->results[$x] = $this->_striptext($this->results[$x]);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$this->results = $this->_striptext($this->results);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n\n\t/*======================================================================*\\\n\t Function:\tsubmitlinks\n\tPurpose:\tgrab links from a form submission\n\tInput:\t\t$URI\twhere you are submitting from\n\tOutput:\t\t$this->results\tan array of the links from the post\n\t\\*======================================================================*/\n\n\tfunction submitlinks($URI, $formvars=\"\", $formfiles=\"\")\n\t{\n\t\tif($this->submit($URI,$formvars, $formfiles))\n\t\t{\n\t\t\tif($this->lastredirectaddr)\n\t\t\t\t$URI = $this->lastredirectaddr;\n\t\t\tif(is_array($this->results))\n\t\t\t{\n\t\t\t\tfor($x=0;$xresults);$x++)\n\t\t\t\t{\n\t\t\t\t\t$this->results[$x] = $this->_striplinks($this->results[$x]);\n\t\t\t\t\tif($this->expandlinks)\n\t\t\t\t\t\t$this->results[$x] = $this->_expandlinks($this->results[$x],$URI);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->results = $this->_striplinks($this->results);\n\t\t\t\tif($this->expandlinks)\n\t\t\t\t\t$this->results = $this->_expandlinks($this->results,$URI);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n\n\t/*======================================================================*\\\n\t Function:\tsubmittext\n\tPurpose:\tgrab text from a form submission\n\tInput:\t\t$URI\twhere you are submitting from\n\tOutput:\t\t$this->results\tthe text from the web page\n\t\\*======================================================================*/\n\n\tfunction submittext($URI, $formvars = \"\", $formfiles = \"\")\n\t{\n\t\tif($this->submit($URI,$formvars, $formfiles))\n\t\t{\n\t\t\tif($this->lastredirectaddr)\n\t\t\t\t$URI = $this->lastredirectaddr;\n\t\t\tif(is_array($this->results))\n\t\t\t{\n\t\t\t\tfor($x=0;$xresults);$x++)\n\t\t\t\t{\n\t\t\t\t\t$this->results[$x] = $this->_striptext($this->results[$x]);\n\t\t\t\t\tif($this->expandlinks)\n\t\t\t\t\t\t$this->results[$x] = $this->_expandlinks($this->results[$x],$URI);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->results = $this->_striptext($this->results);\n\t\t\t\tif($this->expandlinks)\n\t\t\t\t\t$this->results = $this->_expandlinks($this->results,$URI);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n\n\n\n\t/*======================================================================*\\\n\t Function:\tset_submit_multipart\n\tPurpose:\tSet the form submission content type to\n\tmultipart/form-data\n\t\\*======================================================================*/\n\tfunction set_submit_multipart()\n\t{\n\t\t$this->_submit_type = \"multipart/form-data\";\n\t}\n\n\n\t/*======================================================================*\\\n\t Function:\tset_submit_normal\n\tPurpose:\tSet the form submission content type to\n\tapplication/x-www-form-urlencoded\n\t\\*======================================================================*/\n\tfunction set_submit_normal()\n\t{\n\t\t$this->_submit_type = \"application/x-www-form-urlencoded\";\n\t}\n\n\n\n\n\t/*======================================================================*\\\n\t Private functions\n\t\\*======================================================================*/\n\n\n\t/*======================================================================*\\\n\t Function:\t_striplinks\n\tPurpose:\tstrip the hyperlinks from an html document\n\tInput:\t\t$document\tdocument to strip.\n\tOutput:\t\t$match\t\tan array of the links\n\t\\*======================================================================*/\n\n\tfunction _striplinks($document)\n\t{\n\t\tpreg_match_all(\"'<\\s*a\\s.*?href\\s*=\\s*\t\t\t# find ]+))\t\t# if quote found, match up to next matching\n\t\t\t\t\t\t\t\t\t\t\t\t\t# quote, otherwise match up to next space\n\t\t\t\t\t\t'isx\",$document,$links);\n\n\n\t\t// catenate the non-empty matches from the conditional subpattern\n\n\t\twhile(list($key,$val) = each($links[2]))\n\t\t{\n\t\t\tif(!empty($val))\n\t\t\t\t$match[] = $val;\n\t\t}\n\n\t\twhile(list($key,$val) = each($links[3]))\n\t\t{\n\t\t\tif(!empty($val))\n\t\t\t\t$match[] = $val;\n\t\t}\n\n\t\t// return the links\n\t\treturn $match;\n\t}\n\n\t/*======================================================================*\\\n\t Function:\t_stripform\n\tPurpose:\tstrip the form elements from an html document\n\tInput:\t\t$document\tdocument to strip.\n\tOutput:\t\t$match\t\tan array of the links\n\t\\*======================================================================*/\n\n\tfunction _stripform($document)\n\t{\n\t\tpreg_match_all(\"'<\\/?(FORM|INPUT|SELECT|TEXTAREA|(OPTION))[^<>]*>(?(2)(.*(?=<\\/?(option|select)[^<>]*>[\\r\\n]*)|(?=[\\r\\n]*))|(?=[\\r\\n]*))'Usi\",$document,$elements);\n\n\t\t// catenate the matches\n\t\t$match = implode(\"\\r\\n\",$elements[0]);\n\n\t\t// return the links\n\t\treturn $match;\n\t}\n\n\n\n\t/*======================================================================*\\\n\t Function:\t_striptext\n\tPurpose:\tstrip the text from an html document\n\tInput:\t\t$document\tdocument to strip.\n\tOutput:\t\t$text\t\tthe resulting text\n\t\\*======================================================================*/\n\n\tfunction _striptext($document)\n\t{\n\n\t\t// I didn't use preg eval (//e) since that is only available in PHP 4.0.\n\t\t// so, list your entities one by one here. I included some of the\n\t\t// more common ones.\n\n\t\t$search = array(\"']*?>.*?'si\",\t// strip out javascript\n\t\t\t\t\"'<[\\/\\!]*?[^<>]*?>'si\",\t\t\t// strip out html tags\n\t\t\t\t\"'([\\r\\n])[\\s]+'\",\t\t\t\t\t// strip out white space\n\t\t\t\t\"'&(quot|#34|#034|#x22);'i\",\t\t// replace html entities\n\t\t\t\t\"'&(amp|#38|#038|#x26);'i\",\t\t\t// added hexadecimal values\n\t\t\t\t\"'&(lt|#60|#060|#x3c);'i\",\n\t\t\t\t\"'&(gt|#62|#062|#x3e);'i\",\n\t\t\t\t\"'&(nbsp|#160|#xa0);'i\",\n\t\t\t\t\"'&(iexcl|#161);'i\",\n\t\t\t\t\"'&(cent|#162);'i\",\n\t\t\t\t\"'&(pound|#163);'i\",\n\t\t\t\t\"'&(copy|#169);'i\",\n\t\t\t\t\"'&(reg|#174);'i\",\n\t\t\t\t\"'&(deg|#176);'i\",\n\t\t\t\t\"'&(#39|#039|#x27);'\",\n\t\t\t\t\"'&(euro|#8364);'i\",\t\t\t\t// europe\n\t\t\t\t\"'&a(uml|UML);'\",\t\t\t\t\t// german\n\t\t\t\t\"'&o(uml|UML);'\",\n\t\t\t\t\"'&u(uml|UML);'\",\n\t\t\t\t\"'&A(uml|UML);'\",\n\t\t\t\t\"'&O(uml|UML);'\",\n\t\t\t\t\"'&U(uml|UML);'\",\n\t\t\t\t\"'ß'i\",\n\t\t);\n\t\t$replace = array(\t\"\",\n\t\t\t\t\"\",\n\t\t\t\t\"\\\\1\",\n\t\t\t\t\"\\\"\",\n\t\t\t\t\"&\",\n\t\t\t\t\"<\",\n\t\t\t\t\">\",\n\t\t\t\t\" \",\n\t\t\t\tchr(161),\n\t\t\t\tchr(162),\n\t\t\t\tchr(163),\n\t\t\t\tchr(169),\n\t\t\t\tchr(174),\n\t\t\t\tchr(176),\n\t\t\t\tchr(39),\n\t\t\t\tchr(128),\n\t\t\t\t\"�\",\n\t\t\t\t\"�\",\n\t\t\t\t\"�\",\n\t\t\t\t\"�\",\n\t\t\t\t\"�\",\n\t\t\t\t\"�\",\n\t\t\t\t\"�\",\n\t\t);\n\t\t\t\n\t\t$text = preg_replace($search,$replace,$document);\n\n\t\treturn $text;\n\t}\n\n\t/*======================================================================*\\\n\t Function:\t_expandlinks\n\tPurpose:\texpand each link into a fully qualified URL\n\tInput:\t\t$links\t\t\tthe links to qualify\n\t$URI\t\t\tthe full URI to get the base from\n\tOutput:\t\t$expandedLinks\tthe expanded links\n\t\\*======================================================================*/\n\n\tfunction _expandlinks($links,$URI)\n\t{\n\n\t\tpreg_match(\"/^[^\\?]+/\",$URI,$match);\n\n\t\t$match = preg_replace(\"|/[^\\/\\.]+\\.[^\\/\\.]+$|\",\"\",$match[0]);\n\t\t$match = preg_replace(\"|/$|\",\"\",$match);\n\t\t$match_part = parse_url($match);\n\t\t$match_root =\n\t\t$match_part[\"scheme\"].\"://\".$match_part[\"host\"];\n\n\t\t$search = array( \t\"|^http://\".preg_quote($this->host).\"|i\",\n\t\t\t\t\"|^(\\/)|i\",\n\t\t\t\t\"|^(?!http://)(?!mailto:)|i\",\n\t\t\t\t\"|/\\./|\",\n\t\t\t\t\"|/[^\\/]+/\\.\\./|\"\n\t\t);\n\n\t\t$replace = array(\t\"\",\n\t\t\t\t$match_root.\"/\",\n\t\t\t\t$match.\"/\",\n\t\t\t\t\"/\",\n\t\t\t\t\"/\"\n\t\t);\n\n\t\t$expandedLinks = preg_replace($search,$replace,$links);\n\n\t\treturn $expandedLinks;\n\t}\n\n\t/*======================================================================*\\\n\t Function:\t_httprequest\n\tPurpose:\tgo get the http data from the server\n\tInput:\t\t$url\t\tthe url to fetch\n\t$fp\t\t\tthe current open file pointer\n\t$URI\t\tthe full URI\n\t$body\t\tbody contents to send if any (POST)\n\tOutput:\n\t\\*======================================================================*/\n\n\tfunction _httprequest($url,$fp,$URI,$http_method,$content_type=\"\",$body=\"\")\n\t{\n\t\t$cookie_headers = '';\n\t\tif($this->passcookies && $this->_redirectaddr)\n\t\t\t$this->setcookies();\n\t\t\t\n\t\t$URI_PARTS = parse_url($URI);\n\t\tif(empty($url))\n\t\t\t$url = \"/\";\n\t\t$headers = $http_method.\" \".$url.\" \".$this->_httpversion.\"\\r\\n\";\n\t\tif(!empty($this->agent))\n\t\t\t$headers .= \"User-Agent: \".$this->agent.\"\\r\\n\";\n\t\tif(!empty($this->host) && !isset($this->rawheaders['Host'])) {\n\t\t\t$headers .= \"Host: \".$this->host;\n\t\t\tif(!empty($this->port) && $this->port!=80)\n\t\t\t\t$headers .= \":\".$this->port;\n\t\t\t$headers .= \"\\r\\n\";\n\t\t}\n\t\tif(!empty($this->accept))\n\t\t\t$headers .= \"Accept: \".$this->accept.\"\\r\\n\";\n\t\tif(!empty($this->referer))\n\t\t\t$headers .= \"Referer: \".$this->referer.\"\\r\\n\";\n\t\tif(!empty($this->cookies))\n\t\t{\n\t\t\tif(!is_array($this->cookies))\n\t\t\t\t$this->cookies = (array)$this->cookies;\n\n\t\t\treset($this->cookies);\n\t\t\tif ( count($this->cookies) > 0 ) {\n\t\t\t\t$cookie_headers .= 'Cookie: ';\n\t\t\t\tforeach ( $this->cookies as $cookieKey => $cookieVal ) {\n\t\t\t\t\t$cookie_headers .= $cookieKey.\"=\".urlencode($cookieVal).\"; \";\n\t\t\t\t}\n\t\t\t\t$headers .= substr($cookie_headers,0,-2) . \"\\r\\n\";\n\t\t\t}\n\t\t}\n\t\tif(!empty($this->rawheaders))\n\t\t{\n\t\t\tif(!is_array($this->rawheaders))\n\t\t\t\t$this->rawheaders = (array)$this->rawheaders;\n\t\t\twhile(list($headerKey,$headerVal) = each($this->rawheaders))\n\t\t\t\t$headers .= $headerKey.\": \".$headerVal.\"\\r\\n\";\n\t\t}\n\t\tif(!empty($content_type)) {\n\t\t\t$headers .= \"Content-type: $content_type\";\n\t\t\tif ($content_type == \"multipart/form-data\")\n\t\t\t\t$headers .= \"; boundary=\".$this->_mime_boundary;\n\t\t\t$headers .= \"\\r\\n\";\n\t\t}\n\t\tif(!empty($body))\n\t\t\t$headers .= \"Content-length: \".strlen($body).\"\\r\\n\";\n\t\tif(!empty($this->user) || !empty($this->pass))\n\t\t\t$headers .= \"Authorization: Basic \".base64_encode($this->user.\":\".$this->pass).\"\\r\\n\";\n\n\t\t//add proxy auth headers\n\t\tif(!empty($this->proxy_user))\n\t\t\t$headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass).\"\\r\\n\";\n\n\n\t\t$headers .= \"\\r\\n\";\n\n\t\t// set the read timeout if needed\n\t\tif ($this->read_timeout > 0)\n\t\t\tsocket_set_timeout($fp, $this->read_timeout);\n\t\t$this->timed_out = false;\n\n\t\tfwrite($fp,$headers.$body,strlen($headers.$body));\n\n\t\t$this->_redirectaddr = false;\n\t\tunset($this->headers);\n\n\t\twhile($currentHeader = fgets($fp,$this->_maxlinelen))\n\t\t{\n\t\t\tif ($this->read_timeout > 0 && $this->_check_timeout($fp))\n\t\t\t{\n\t\t\t\t$this->status=-100;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif($currentHeader == \"\\r\\n\")\n\t\t\t\tbreak;\n\n\t\t\t// if a header begins with Location: or URI:, set the redirect\n\t\t\tif(preg_match(\"/^(Location:|URI:)/i\",$currentHeader))\n\t\t\t{\n\t\t\t\t// get URL portion of the redirect\n\t\t\t\tpreg_match(\"/^(Location:|URI:)[ ]+(.*)/i\",chop($currentHeader),$matches);\n\t\t\t\t// look for :// in the Location header to see if hostname is included\n\t\t\t\tif (!empty($matches)) {\n\t\t\t\t\tif(!preg_match(\"|\\:\\/\\/|\",$matches[2]))\n\t\t\t\t\t{\n\t\t\t\t\t\t// no host in the path, so prepend\n\t\t\t\t\t\t$this->_redirectaddr = $URI_PARTS[\"scheme\"].\"://\".$this->host.\":\".$this->port;\n\t\t\t\t\t\t// eliminate double slash\n\t\t\t\t\t\tif(!preg_match(\"|^/|\",$matches[2]))\n\t\t\t\t\t\t\t$this->_redirectaddr .= \"/\".$matches[2];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$this->_redirectaddr .= $matches[2];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$this->_redirectaddr = $matches[2];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(preg_match(\"|^HTTP/|\",$currentHeader))\n\t\t\t{\n\t\t\t\tif(preg_match(\"|^HTTP/[^\\s]*\\s(.*?)\\s|\",$currentHeader, $status))\n\t\t\t\t{\n\t\t\t\t\t$this->status= $status[1];\n\t\t\t\t}\n\t\t\t\t$this->response_code = $currentHeader;\n\t\t\t}\n\n\t\t\t$this->headers[] = $currentHeader;\n\t\t}\n\n\t\t$results = '';\n\t\tdo {\n\t\t\t$_data = fread($fp, $this->maxlength);\n\t\t\tif (strlen($_data) == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$results .= $_data;\n\t\t} while(true);\n\n\t\tif ($this->read_timeout > 0 && $this->_check_timeout($fp))\n\t\t{\n\t\t\t$this->status=-100;\n\t\t\treturn false;\n\t\t}\n\n\t\t// check if there is a a redirect meta tag\n\n\t\tif(preg_match(\"']*?content[\\s]*=[\\s]*[\\\"\\']?\\d+;[\\s]*URL[\\s]*=[\\s]*([^\\\"\\']*?)[\\\"\\']?>'i\",$results,$match))\n\n\t\t{\n\t\t\t$this->_redirectaddr = $this->_expandlinks($match[1],$URI);\n\t\t}\n\n\t\t// have we hit our frame depth and is there frame src to fetch?\n\t\tif(($this->_framedepth < $this->maxframes) && preg_match_all(\"']+)'i\",$results,$match))\n\t\t{\n\t\t\t$this->results[] = $results;\n\t\t\tfor($x=0; $x_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS[\"scheme\"].\"://\".$this->host);\n\t\t}\n\t\t// have we already fetched framed content?\n\t\telseif(is_array($this->results))\n\t\t$this->results[] = $results;\n\t\t// no framed content\n\t\telse\n\t\t\t$this->results = $results;\n\n\t\treturn true;\n\t}\n\n\t/*======================================================================*\\\n\t Function:\t_httpsrequest\n\tPurpose:\tgo get the https data from the server using curl\n\tInput:\t\t$url\t\tthe url to fetch\n\t$URI\t\tthe full URI\n\t$body\t\tbody contents to send if any (POST)\n\tOutput:\n\t\\*======================================================================*/\n\n\tfunction _httpsrequest($url,$URI,$http_method,$content_type=\"\",$body=\"\")\n\t{\n\t\tif($this->passcookies && $this->_redirectaddr)\n\t\t\t$this->setcookies();\n\n\t\t$headers = array();\n\t\t\t\n\t\t$URI_PARTS = parse_url($URI);\n\t\tif(empty($url))\n\t\t\t$url = \"/\";\n\t\t// GET ... header not needed for curl\n\t\t//$headers[] = $http_method.\" \".$url.\" \".$this->_httpversion;\n\t\tif(!empty($this->agent))\n\t\t\t$headers[] = \"User-Agent: \".$this->agent;\n\t\tif(!empty($this->host))\n\t\t\tif(!empty($this->port) && $this->port!=80)\n\t\t\t$headers[] = \"Host: \".$this->host.\":\".$this->port;\n\t\telse\n\t\t\t$headers[] = \"Host: \".$this->host;\n\t\tif(!empty($this->accept))\n\t\t\t$headers[] = \"Accept: \".$this->accept;\n\t\tif(!empty($this->referer))\n\t\t\t$headers[] = \"Referer: \".$this->referer;\n\t\tif(!empty($this->cookies))\n\t\t{\n\t\t\tif(!is_array($this->cookies))\n\t\t\t\t$this->cookies = (array)$this->cookies;\n\n\t\t\treset($this->cookies);\n\t\t\tif ( count($this->cookies) > 0 ) {\n\t\t\t\t$cookie_str = 'Cookie: ';\n\t\t\t\tforeach ( $this->cookies as $cookieKey => $cookieVal ) {\n\t\t\t\t\t$cookie_str .= $cookieKey.\"=\".urlencode($cookieVal).\"; \";\n\t\t\t\t}\n\t\t\t\t$headers[] = substr($cookie_str,0,-2);\n\t\t\t}\n\t\t}\n\t\tif(!empty($this->rawheaders))\n\t\t{\n\t\t\tif(!is_array($this->rawheaders))\n\t\t\t\t$this->rawheaders = (array)$this->rawheaders;\n\t\t\twhile(list($headerKey,$headerVal) = each($this->rawheaders))\n\t\t\t\t$headers[] = $headerKey.\": \".$headerVal;\n\t\t}\n\t\tif(!empty($content_type)) {\n\t\t\tif ($content_type == \"multipart/form-data\")\n\t\t\t\t$headers[] = \"Content-type: $content_type; boundary=\".$this->_mime_boundary;\n\t\t\telse\n\t\t\t\t$headers[] = \"Content-type: $content_type\";\n\t\t}\n\t\tif(!empty($body))\n\t\t\t$headers[] = \"Content-length: \".strlen($body);\n\t\tif(!empty($this->user) || !empty($this->pass))\n\t\t\t$headers[] = \"Authorization: BASIC \".base64_encode($this->user.\":\".$this->pass);\n\t\tif (function_exists('curl_init')) {\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $URI);\n\t\t\tcurl_setopt($ch, CURLOPT_HEADER, true); \n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers); \n\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, $this->read_timeout);\n\t\t\tif(!empty($body)) {\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $body);\n\t\t\t}\n\t\t\t$data = curl_exec($ch);\n\t\t\tif ($data === false) {\n\t\t\t\t$this->error = \"Error: Curl error \".curl_error($ch);\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$parts = explode(\"\\r\\n\\r\\n\",$data,2);\n\t\t\t$result_headers = explode(\"\\r\\n\",$parts[0]);\n\t\t\t$results = $parts[1];\n\t\t\tunset($parts);\n\t\t} else {\n\t\t\t\tfor($curr_header = 0; $curr_header < count($headers); $curr_header++) {\n\t\t\t\t\t$safer_header = strtr( $headers[$curr_header], \"\\\"\", \" \" );\n\t\t\t\t\t$cmdline_params .= \" -H \\\"\".$safer_header.\"\\\"\";\n\t\t\t\t}\n\t\t\n\t\t\t\tif(!empty($body))\n\t\t\t\t\t$cmdline_params .= \" -d \\\"$body\\\"\";\n\t\t\n\t\t\t\tif($this->read_timeout > 0)\n\t\t\t\t\t$cmdline_params .= \" -m \".$this->read_timeout;\n\t\t\n\t\t\t\t$headerfile = tempnam($temp_dir, \"sno\");\n\t\t\n\t\t\t\texec($this->curl_path.\" -k -D \\\"$headerfile\\\"\".$cmdline_params.\" \\\"\".escapeshellcmd($URI).\"\\\"\",$results,$return);\n\t\t\n\t\t\t\tif($return)\n\t\t\t\t{\n\t\t\t\t\t$this->error = \"Error: cURL could not retrieve the document, error $return.\";\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t$results = implode(\"\\r\\n\",$results);\n\t\n\t\t\t$result_headers = file(\"$headerfile\");\n\t\t}\n\t\t$this->_redirectaddr = false;\n\t\tunset($this->headers);\n\n\t\tfor($currentHeader = 0; $currentHeader < count($result_headers); $currentHeader++)\n\t\t{\n\t\t\t\t\n\t\t\t// if a header begins with Location: or URI:, set the redirect\n\t\t\tif(preg_match(\"/^(Location: |URI: )/i\",$result_headers[$currentHeader]))\n\t\t\t{\n\t\t\t\t// get URL portion of the redirect\n\t\t\t\tpreg_match(\"/^(Location: |URI:)\\s+(.*)/\",chop($result_headers[$currentHeader]),$matches);\n\t\t\t\t// look for :// in the Location header to see if hostname is included\n\t\t\t\tif (!empty($matches)) {\n\t\t\t\t\tif(!preg_match(\"|\\:\\/\\/|\",$matches[2]))\n\t\t\t\t\t{\n\t\t\t\t\t\t// no host in the path, so prepend\n\t\t\t\t\t\t$this->_redirectaddr = $URI_PARTS[\"scheme\"].\"://\".$this->host;\n\t\t\t\t\t\t// eliminate double slash\n\t\t\t\t\t\tif(!preg_match(\"|^/|\",$matches[2]))\n\t\t\t\t\t\t\t$this->_redirectaddr .= \"/\".$matches[2];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$this->_redirectaddr .= $matches[2];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$this->_redirectaddr = $matches[2];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(preg_match(\"|^HTTP/|\",$result_headers[$currentHeader]))\n\t\t\t\t$this->response_code = $result_headers[$currentHeader];\n\n\t\t\t$this->headers[] = $result_headers[$currentHeader];\n\t\t}\n\n\t\t// check if there is a a redirect meta tag\n\n\t\tif(preg_match(\"']*?content[\\s]*=[\\s]*[\\\"\\']?\\d+;[\\s]*URL[\\s]*=[\\s]*([^\\\"\\']*?)[\\\"\\']?>'i\",$results,$match))\n\t\t{\n\t\t\t$this->_redirectaddr = $this->_expandlinks($match[1],$URI);\n\t\t}\n\n\t\t// have we hit our frame depth and is there frame src to fetch?\n\t\tif(($this->_framedepth < $this->maxframes) && preg_match_all(\"']+)'i\",$results,$match))\n\t\t{\n\t\t\t$this->results[] = $results;\n\t\t\tfor($x=0; $x_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS[\"scheme\"].\"://\".$this->host);\n\t\t}\n\t\t// have we already fetched framed content?\n\t\telseif(is_array($this->results))\n\t\t\t$this->results[] = $results;\n\t\t// no framed content\n\t\telse\n\t\t\t$this->results = $results;\n\t\tif ($headerfile)\n\t\t\tunlink(\"$headerfile\");\n\n\t\treturn true;\n\t}\n\n\t/*======================================================================*\\\n\t Function:\tsetcookies()\n\tPurpose:\tset cookies for a redirection\n\t\\*======================================================================*/\n\n\tfunction setcookies()\n\t{\n\t\tfor($x=0; $xheaders); $x++)\n\t\t{\n\t\t\tif(preg_match('/^set-cookie:[\\s]+([^=]+)=([^;]+)/i', $this->headers[$x],$match))\n\t\t\t\t$this->cookies[$match[1]] = urldecode($match[2]);\n\t\t}\n\t}\n\n\n\t/*======================================================================*\\\n\t Function:\t_check_timeout\n\tPurpose:\tchecks whether timeout has occurred\n\tInput:\t\t$fp\tfile pointer\n\t\\*======================================================================*/\n\n\tfunction _check_timeout($fp)\n\t{\n\t\tif ($this->read_timeout > 0) {\n\t\t\t$fp_status = socket_get_status($fp);\n\t\t\tif ($fp_status[\"timed_out\"]) {\n\t\t\t\t$this->timed_out = true;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/*======================================================================*\\\n\t Function:\t_connect\n\tPurpose:\tmake a socket connection\n\tInput:\t\t$fp\tfile pointer\n\t\\*======================================================================*/\n\n\tfunction _connect(&$fp)\n\t{\n\t\tif(!empty($this->proxy_host) && !empty($this->proxy_port))\n\t\t{\n\t\t\t$this->_isproxy = true;\n\n\t\t\t$host = $this->proxy_host;\n\t\t\t$port = $this->proxy_port;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$host = $this->host;\n\t\t\t$port = $this->port;\n\t\t}\n\n\t\t$this->status = 0;\n\n\t\tif($fp = fsockopen(\n\t\t\t\t$host,\n\t\t\t\t$port,\n\t\t\t\t$errno,\n\t\t\t\t$errstr,\n\t\t\t\t$this->_fp_timeout\n\t\t))\n\t\t{\n\t\t\t// socket connection succeeded\n\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// socket connection failed\n\t\t\t$this->status = $errno;\n\t\t\tswitch($errno)\n\t\t\t{\n\t\t\t\tcase -3:\n\t\t\t\t\t$this->error=\"socket creation failed (-3)\";\n\t\t\t\tcase -4:\n\t\t\t\t\t$this->error=\"dns lookup failure (-4)\";\n\t\t\t\tcase -5:\n\t\t\t\t\t$this->error=\"connection refused or timed out (-5)\";\n\t\t\t\tdefault:\n\t\t\t\t\t$this->error=\"connection failed (\".$errno.\")\";\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\t/*======================================================================*\\\n\t Function:\t_disconnect\n\tPurpose:\tdisconnect a socket connection\n\tInput:\t\t$fp\tfile pointer\n\t\\*======================================================================*/\n\n\tfunction _disconnect($fp)\n\t{\n\t\treturn(fclose($fp));\n\t}\n\n\n\t/*======================================================================*\\\n\t Function:\t_prepare_post_body\n\tPurpose:\tPrepare post body according to encoding type\n\tInput:\t\t$formvars - form variables\n\t$formfiles - form upload files\n\tOutput:\t\tpost body\n\t\\*======================================================================*/\n\n\tfunction _prepare_post_body($formvars, $formfiles)\n\t{\n\t\tsettype($formvars, \"array\");\n\t\tsettype($formfiles, \"array\");\n\t\t$postdata = '';\n\n\t\tif (count($formvars) == 0 && count($formfiles) == 0)\n\t\t\treturn;\n\t\tif (is_string($formvars)) return $formvars;\n\t\tif(count($formvars) == 1) return $formvars[0];\n\t\tswitch ($this->_submit_type) {\n\t\t\tcase \"application/x-www-form-urlencoded\":\n\t\t\t\treset($formvars);\n\t\t\t\twhile(list($key,$val) = each($formvars)) {\n\t\t\t\t\tif (is_array($val) || is_object($val)) {\n\t\t\t\t\t\twhile (list($cur_key, $cur_val) = each($val)) {\n\t\t\t\t\t\t\t$postdata .= urlencode($key).\"[]=\".urlencode($cur_val).\"&\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\t$postdata .= urlencode($key).\"=\".urlencode($val).\"&\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"multipart/form-data\":\n\t\t\t\t$this->_mime_boundary = \"--------\".md5(uniqid(microtime()));\n\n\t\t\t\treset($formvars);\n\t\t\t\twhile(list($key,$val) = each($formvars)) {\n\t\t\t\t\tif (is_array($val) || is_object($val)) {\n\t\t\t\t\t\twhile (list($cur_key, $cur_val) = each($val)) {\n\t\t\t\t\t\t\t$postdata .= \"--\".$this->_mime_boundary.\"\\r\\n\";\n\t\t\t\t\t\t\t$postdata .= \"Content-Disposition: form-data; name=\\\"$key\\[\\]\\\"\\r\\n\\r\\n\";\n\t\t\t\t\t\t\t$postdata .= \"$cur_val\\r\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$postdata .= \"--\".$this->_mime_boundary.\"\\r\\n\";\n\t\t\t\t\t\t$postdata .= \"Content-Disposition: form-data; name=\\\"$key\\\"\\r\\n\\r\\n\";\n\t\t\t\t\t\t$postdata .= \"$val\\r\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treset($formfiles);\n\t\t\t\twhile (list($field_name, $file_names) = each($formfiles)) {\n\t\t\t\t\tsettype($file_names, \"array\");\n\t\t\t\t\twhile (list(, $file_name) = each($file_names)) {\n\t\t\t\t\t\t$file_content = file_get_contents($file_name);\n\t\t\t\t\t\tif (!$file_content) continue;\n\n\t\t\t\t\t\t$base_name = basename($file_name);\n\n\t\t\t\t\t\t$postdata .= \"--\".$this->_mime_boundary.\"\\r\\n\";\n\t\t\t\t\t\t$postdata .= \"Content-Disposition: form-data; name=\\\"$field_name\\\"; filename=\\\"$base_name\\\"\\r\\nContent-Type: image/jpeg\\r\\n\\r\\n\";\n\t\t\t\t\t\t$postdata .= \"$file_content\\r\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$postdata .= \"--\".$this->_mime_boundary.\"--\\r\\n\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $postdata;\n\t}\n}"} +{"text": "# What do we call the new general purpose ack?\n\nAck is too surprising to non-programmers. There will be a less\nsurprising, more greplike tool that takes goodness from ack. But\nwhat do we call it?\n\nMust be\n\n* pronouncable\n * and monosyllabic\n* easy to type\n* three characters\n * four maaaaybe if it's super easy to type, say, like \"akjf\"\n* relatively low Googling conflict\n * not already a word\n* No conflict with existing [BSD ports](http://www.freebsd.org/ports/),\n[Ubuntu packages](http://packages.ubuntu.com/) or [Fedora RPMs](http://rpm.pbone.net/).\n\n* [acronymfinder.com](http://www.acronymfinder.com/) is handy for overloaded name conflicts.\n\n# Favorites\n\nkap -- easy type, same short A sound as ack, direct and unambiguous\n\nkel -- another good K name\n\nwij -- easy type, abbreviates to \"Where In Jesus' name did I put...\"\n\ngus -- general unified search, don't like the name so much, though\n\nglo -- Kinda grep-like, easy type, very pronouncable, could get confused with \"glow\"?\n\n# Ideas\n\nerg -- Relates to doing work. Downside is that it's all left-hand.\n\nrst -- follows the standard of TCP flags like ack, pronounceable as \"rist\", easy to type, I don't like the lack of vowel.\n\nxoa -- singularly mine, no conflicts, but not pronouncable. \"zoe-uh\"?\n\nbix -- easy to type, but always refers to Bix Beiderbecke, or Byte Information Exchange\n\nbax -- easy type, my first dog, sounds ack-like, could sound like \"backs\" like \"backups\"\n\ndij\n\ngim\n\nhap\n\nkel\n\nkif\n\nmug\n\nnak -- easy to type, but implies negative of ack.\n\nnif\n\norp\n\n\n# Won't work\n\nlak -- could be confused with \"ack\" or worse, \"lack\"\n\npuf -- parallel URL fetcher\n\ndit -- overloaded meaning\n\njix -- Joomla Import/Export\n\njak -- video game character\n\nfid -- too close to \"find\"\n\npof -- points to dating site plentyoffish.com\n\ndif -- Too close to \"diff\"\n\n"} +{"text": "from hashlib import md5\n\n\ndef tuple_to_hash(tuple_):\n return md5(str(tuple_).encode(\"utf-8\")).hexdigest()\n\n\ndef kwargs_to_tuple(d):\n \"\"\"Convert expectation configuration kwargs to a canonical tuple.\"\"\"\n if isinstance(d, list):\n return tuple([kwargs_to_tuple(v) for v in sorted(d)])\n elif isinstance(d, dict):\n return tuple(\n [\n (k, kwargs_to_tuple(v))\n for k, v in sorted(d.items())\n if k\n not in [\"result_format\", \"include_config\", \"catch_exceptions\", \"meta\"]\n ]\n )\n return d\n"} +{"text": "#----------------------------------------------------------------\n# Generated CMake target import file for configuration \"Release\".\n#----------------------------------------------------------------\n\n# Commands may need to know the format version.\nset(CMAKE_IMPORT_FILE_VERSION 1)\n\n# Import target \"glslang\" for configuration \"Release\"\nset_property(TARGET glslang APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(glslang PROPERTIES\n IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE \"CXX\"\n IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib/libglslang.a\"\n )\n\nlist(APPEND _IMPORT_CHECK_TARGETS glslang )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_glslang \"${_IMPORT_PREFIX}/lib/libglslang.a\" )\n\n# Commands beyond this point should not need to know the version.\nset(CMAKE_IMPORT_FILE_VERSION)\n"} +{"text": "#!/usr/bin/env bash\n# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# ==============================================================================\n\n# This script runs integration tests on the TensorFlow source code\n# using a pip installation.\n#\n# Usage: integration_tests.sh [--virtualenv]\n#\n# If the flag --virtualenv is set, the script will use \"python\" as the Python\n# binary path. Otherwise, it will use tools/python_bin_path.sh to determine\n# the Python binary path.\n#\n# This script obeys the following environment variables (if exists):\n# TF_BUILD_INTEG_TEST_BLACKLIST: Force skipping of specified integration tests\n# listed in INTEG_TESTS below.\n#\n\n# List of all integration tests to run, separated by spaces\nINTEG_TESTS=\"ffmpeg_lib\"\n\nif [[ -z \"${TF_BUILD_INTEG_TEST_BLACKLIST}\" ]]; then\n TF_BUILD_INTEG_TEST_BLACKLIST=\"\"\nfi\necho \"\"\necho \"=== Integration Tests ===\"\necho \"TF_BUILD_INTEG_TEST_BLACKLIST = \\\"${TF_BUILD_INTEG_TEST_BLACKLIST}\\\"\"\n\n# Timeout (in seconds) for each integration test\nTIMEOUT=1800\n\nINTEG_TEST_ROOT=\"$(mktemp -d)\"\nLOGS_DIR=pip_test/integration_tests/logs\n\n# Current script directory\nSCRIPT_DIR=$( cd ${0%/*} && pwd -P )\nsource \"${SCRIPT_DIR}/builds_common.sh\"\n\n# Helper functions\ncleanup() {\n rm -rf $INTEG_TEST_ROOT\n}\n\n\ndie() {\n echo $@\n cleanup\n exit 1\n}\n\n\n# Determine the binary path for \"timeout\"\nTIMEOUT_BIN=\"timeout\"\nif [[ -z \"$(which ${TIMEOUT_BIN})\" ]]; then\n TIMEOUT_BIN=\"gtimeout\"\n if [[ -z \"$(which ${TIMEOUT_BIN})\" ]]; then\n die \"Unable to locate binary path for timeout command\"\n fi\nfi\necho \"Binary path for timeout: \\\"$(which ${TIMEOUT_BIN})\\\"\"\n\n# Avoid permission issues outside Docker containers\numask 000\n\nmkdir -p \"${LOGS_DIR}\" || die \"Failed to create logs directory\"\nmkdir -p \"${INTEG_TEST_ROOT}\" || die \"Failed to create test directory\"\n\nif [[ \"$1\" == \"--virtualenv\" ]]; then\n PYTHON_BIN_PATH=\"$(which python)\"\nelse\n source tools/python_bin_path.sh\nfi\n\nif [[ -z \"${PYTHON_BIN_PATH}\" ]]; then\n die \"PYTHON_BIN_PATH was not provided. If this is not virtualenv, \"\\\n\"did you run configure?\"\nelse\n echo \"Binary path for python: \\\"$PYTHON_BIN_PATH\\\"\"\nfi\n\n# Determine the TensorFlow installation path\n# pushd/popd avoids importing TensorFlow from the source directory.\npushd /tmp > /dev/null\nTF_INSTALL_PATH=$(dirname \\\n $(\"${PYTHON_BIN_PATH}\" -c \"import tensorflow as tf; print(tf.__file__)\"))\npopd > /dev/null\n\necho \"Detected TensorFlow installation path: ${TF_INSTALL_PATH}\"\n\nTEST_DIR=\"pip_test/integration\"\nmkdir -p \"${TEST_DIR}\" || \\\n die \"Failed to create test directory: ${TEST_DIR}\"\n\n# -----------------------------------------------------------\n# ffmpeg_lib_test\ntest_ffmpeg_lib() {\n # If FFmpeg is not installed then run a test that assumes it is not installed.\n if [[ -z \"$(which ffmpeg)\" ]]; then\n bazel test tensorflow/contrib/ffmpeg/default:ffmpeg_lib_uninstalled_test\n return $?\n else\n bazel test tensorflow/contrib/ffmpeg/default:ffmpeg_lib_installed_test \\\n tensorflow/contrib/ffmpeg:decode_audio_op_test \\\n tensorflow/contrib/ffmpeg:encode_audio_op_test\n return $?\n fi\n}\n\n\n# Run the integration tests\ntest_runner \"integration test-on-install\" \\\n \"${INTEG_TESTS}\" \"${TF_BUILD_INTEG_TEST_BLACKLIST}\" \"${LOGS_DIR}\"\n"} +{"text": "def foo():\n #ERROR: match, but it should report a range that stops after bar\n foo()\n foobar()\n bar()\n # this below should not be reported in the match\n stuff()\n morestuff()\n\n"} +{"text": "[assembly: System.Reflection.AssemblyVersion(\"5.0.0.0\")]\r\n"} +{"text": "{\n \"auth\": {\n \"oauth2\": {\n \"scopes\": {\n \"https://www.googleapis.com/auth/cloud-platform\": {\n \"description\": \"View and manage your data across Google Cloud Platform services\"\n }\n }\n }\n },\n \"basePath\": \"\",\n \"baseUrl\": \"https://storagetransfer.googleapis.com/\",\n \"batchPath\": \"batch\",\n \"description\": \"Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets.\",\n \"discoveryVersion\": \"v1\",\n \"documentationLink\": \"https://cloud.google.com/storage-transfer/docs\",\n \"fullyEncodeReservedExpansion\": true,\n \"icons\": {\n \"x16\": \"http://www.google.com/images/icons/product/search-16.gif\",\n \"x32\": \"http://www.google.com/images/icons/product/search-32.gif\"\n },\n \"id\": \"storagetransfer:v1\",\n \"kind\": \"discovery#restDescription\",\n \"mtlsRootUrl\": \"https://storagetransfer.mtls.googleapis.com/\",\n \"name\": \"storagetransfer\",\n \"ownerDomain\": \"google.com\",\n \"ownerName\": \"Google\",\n \"parameters\": {\n \"$.xgafv\": {\n \"description\": \"V1 error format.\",\n \"enum\": [\n \"1\",\n \"2\"\n ],\n \"enumDescriptions\": [\n \"v1 error format\",\n \"v2 error format\"\n ],\n \"location\": \"query\",\n \"type\": \"string\"\n },\n \"access_token\": {\n \"description\": \"OAuth access token.\",\n \"location\": \"query\",\n \"type\": \"string\"\n },\n \"alt\": {\n \"default\": \"json\",\n \"description\": \"Data format for response.\",\n \"enum\": [\n \"json\",\n \"media\",\n \"proto\"\n ],\n \"enumDescriptions\": [\n \"Responses with Content-Type of application/json\",\n \"Media download with context-dependent Content-Type\",\n \"Responses with Content-Type of application/x-protobuf\"\n ],\n \"location\": \"query\",\n \"type\": \"string\"\n },\n \"callback\": {\n \"description\": \"JSONP\",\n \"location\": \"query\",\n \"type\": \"string\"\n },\n \"fields\": {\n \"description\": \"Selector specifying which fields to include in a partial response.\",\n \"location\": \"query\",\n \"type\": \"string\"\n },\n \"key\": {\n \"description\": \"API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.\",\n \"location\": \"query\",\n \"type\": \"string\"\n },\n \"oauth_token\": {\n \"description\": \"OAuth 2.0 token for the current user.\",\n \"location\": \"query\",\n \"type\": \"string\"\n },\n \"prettyPrint\": {\n \"default\": \"true\",\n \"description\": \"Returns response with indentations and line breaks.\",\n \"location\": \"query\",\n \"type\": \"boolean\"\n },\n \"quotaUser\": {\n \"description\": \"Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.\",\n \"location\": \"query\",\n \"type\": \"string\"\n },\n \"uploadType\": {\n \"description\": \"Legacy upload protocol for media (e.g. \\\"media\\\", \\\"multipart\\\").\",\n \"location\": \"query\",\n \"type\": \"string\"\n },\n \"upload_protocol\": {\n \"description\": \"Upload protocol for media (e.g. \\\"raw\\\", \\\"multipart\\\").\",\n \"location\": \"query\",\n \"type\": \"string\"\n }\n },\n \"protocol\": \"rest\",\n \"resources\": {\n \"googleServiceAccounts\": {\n \"methods\": {\n \"get\": {\n \"description\": \"Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud Platform Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.\",\n \"flatPath\": \"v1/googleServiceAccounts/{projectId}\",\n \"httpMethod\": \"GET\",\n \"id\": \"storagetransfer.googleServiceAccounts.get\",\n \"parameterOrder\": [\n \"projectId\"\n ],\n \"parameters\": {\n \"projectId\": {\n \"description\": \"Required. The ID of the Google Cloud Platform Console project that the Google service account is associated with.\",\n \"location\": \"path\",\n \"required\": true,\n \"type\": \"string\"\n }\n },\n \"path\": \"v1/googleServiceAccounts/{projectId}\",\n \"response\": {\n \"$ref\": \"GoogleServiceAccount\"\n },\n \"scopes\": [\n \"https://www.googleapis.com/auth/cloud-platform\"\n ]\n }\n }\n },\n \"transferJobs\": {\n \"methods\": {\n \"create\": {\n \"description\": \"Creates a transfer job that runs periodically.\",\n \"flatPath\": \"v1/transferJobs\",\n \"httpMethod\": \"POST\",\n \"id\": \"storagetransfer.transferJobs.create\",\n \"parameterOrder\": [],\n \"parameters\": {},\n \"path\": \"v1/transferJobs\",\n \"request\": {\n \"$ref\": \"TransferJob\"\n },\n \"response\": {\n \"$ref\": \"TransferJob\"\n },\n \"scopes\": [\n \"https://www.googleapis.com/auth/cloud-platform\"\n ]\n },\n \"get\": {\n \"description\": \"Gets a transfer job.\",\n \"flatPath\": \"v1/transferJobs/{transferJobsId}\",\n \"httpMethod\": \"GET\",\n \"id\": \"storagetransfer.transferJobs.get\",\n \"parameterOrder\": [\n \"jobName\"\n ],\n \"parameters\": {\n \"jobName\": {\n \"description\": \"Required. The job to get.\",\n \"location\": \"path\",\n \"pattern\": \"^transferJobs/.*$\",\n \"required\": true,\n \"type\": \"string\"\n },\n \"projectId\": {\n \"description\": \"Required. The ID of the Google Cloud Platform Console project that owns the job.\",\n \"location\": \"query\",\n \"type\": \"string\"\n }\n },\n \"path\": \"v1/{+jobName}\",\n \"response\": {\n \"$ref\": \"TransferJob\"\n },\n \"scopes\": [\n \"https://www.googleapis.com/auth/cloud-platform\"\n ]\n },\n \"list\": {\n \"description\": \"Lists transfer jobs.\",\n \"flatPath\": \"v1/transferJobs\",\n \"httpMethod\": \"GET\",\n \"id\": \"storagetransfer.transferJobs.list\",\n \"parameterOrder\": [],\n \"parameters\": {\n \"filter\": {\n \"description\": \"Required. A list of query parameters specified as JSON text in the form of: {\\\"project_id\\\":\\\"my_project_id\\\", \\\"job_names\\\":[\\\"jobid1\\\",\\\"jobid2\\\",...], \\\"job_statuses\\\":[\\\"status1\\\",\\\"status2\\\",...]}. Since `job_names` and `job_statuses` support multiple values, their values must be specified with array notation. `project``_``id` is required. `job_names` and `job_statuses` are optional. The valid values for `job_statuses` are case-insensitive: ENABLED, DISABLED, and DELETED.\",\n \"location\": \"query\",\n \"type\": \"string\"\n },\n \"pageSize\": {\n \"description\": \"The list page size. The max allowed value is 256.\",\n \"format\": \"int32\",\n \"location\": \"query\",\n \"type\": \"integer\"\n },\n \"pageToken\": {\n \"description\": \"The list page token.\",\n \"location\": \"query\",\n \"type\": \"string\"\n }\n },\n \"path\": \"v1/transferJobs\",\n \"response\": {\n \"$ref\": \"ListTransferJobsResponse\"\n },\n \"scopes\": [\n \"https://www.googleapis.com/auth/cloud-platform\"\n ]\n },\n \"patch\": {\n \"description\": \"Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already. Updating a job's schedule is not allowed. **Note:** The job's status field can be modified using this RPC (for example, to set a job's status to DELETED, DISABLED, or ENABLED).\",\n \"flatPath\": \"v1/transferJobs/{transferJobsId}\",\n \"httpMethod\": \"PATCH\",\n \"id\": \"storagetransfer.transferJobs.patch\",\n \"parameterOrder\": [\n \"jobName\"\n ],\n \"parameters\": {\n \"jobName\": {\n \"description\": \"Required. The name of job to update.\",\n \"location\": \"path\",\n \"pattern\": \"^transferJobs/.*$\",\n \"required\": true,\n \"type\": \"string\"\n }\n },\n \"path\": \"v1/{+jobName}\",\n \"request\": {\n \"$ref\": \"UpdateTransferJobRequest\"\n },\n \"response\": {\n \"$ref\": \"TransferJob\"\n },\n \"scopes\": [\n \"https://www.googleapis.com/auth/cloud-platform\"\n ]\n }\n }\n },\n \"transferOperations\": {\n \"methods\": {\n \"cancel\": {\n \"description\": \"Cancels a transfer. Use the transferOperations.get method to check if the cancellation succeeded or if the operation completed despite the `cancel` request. When you cancel an operation, the currently running transfer is interrupted. For recurring transfer jobs, the next instance of the transfer job will still run. For example, if your job is configured to run every day at 1pm and you cancel Monday's operation at 1:05pm, Monday's transfer will stop. However, a transfer job will still be attempted on Tuesday. This applies only to currently running operations. If an operation is not currently running, `cancel` does nothing. *Caution:* Canceling a transfer job can leave your data in an unknown state. We recommend that you restore the state at both the destination and the source after the `cancel` request completes so that your data is in a consistent state. When you cancel a job, the next job computes a delta of files and may repair any inconsistent state. For instance, if you run a job every day, and today's job found 10 new files and transferred five files before you canceled the job, tomorrow's transfer operation will compute a new delta with the five files that were not copied today plus any new files discovered tomorrow.\",\n \"flatPath\": \"v1/transferOperations/{transferOperationsId}:cancel\",\n \"httpMethod\": \"POST\",\n \"id\": \"storagetransfer.transferOperations.cancel\",\n \"parameterOrder\": [\n \"name\"\n ],\n \"parameters\": {\n \"name\": {\n \"description\": \"The name of the operation resource to be cancelled.\",\n \"location\": \"path\",\n \"pattern\": \"^transferOperations/.*$\",\n \"required\": true,\n \"type\": \"string\"\n }\n },\n \"path\": \"v1/{+name}:cancel\",\n \"response\": {\n \"$ref\": \"Empty\"\n },\n \"scopes\": [\n \"https://www.googleapis.com/auth/cloud-platform\"\n ]\n },\n \"get\": {\n \"description\": \"Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.\",\n \"flatPath\": \"v1/transferOperations/{transferOperationsId}\",\n \"httpMethod\": \"GET\",\n \"id\": \"storagetransfer.transferOperations.get\",\n \"parameterOrder\": [\n \"name\"\n ],\n \"parameters\": {\n \"name\": {\n \"description\": \"The name of the operation resource.\",\n \"location\": \"path\",\n \"pattern\": \"^transferOperations/.*$\",\n \"required\": true,\n \"type\": \"string\"\n }\n },\n \"path\": \"v1/{+name}\",\n \"response\": {\n \"$ref\": \"Operation\"\n },\n \"scopes\": [\n \"https://www.googleapis.com/auth/cloud-platform\"\n ]\n },\n \"list\": {\n \"description\": \"Lists transfer operations.\",\n \"flatPath\": \"v1/transferOperations\",\n \"httpMethod\": \"GET\",\n \"id\": \"storagetransfer.transferOperations.list\",\n \"parameterOrder\": [\n \"name\"\n ],\n \"parameters\": {\n \"filter\": {\n \"description\": \"Required. A list of query parameters specified as JSON text in the form of: {\\\"project_id\\\":\\\"my_project_id\\\", \\\"job_names\\\":[\\\"jobid1\\\",\\\"jobid2\\\",...], \\\"operation_names\\\":[\\\"opid1\\\",\\\"opid2\\\",...], \\\"transfer_statuses\\\":[\\\"status1\\\",\\\"status2\\\",...]}. Since `job_names`, `operation_names`, and `transfer_statuses` support multiple values, they must be specified with array notation. `project``_``id` is required. `job_names`, `operation_names`, and `transfer_statuses` are optional. The valid values for `transfer_statuses` are case-insensitive: IN_PROGRESS, PAUSED, SUCCESS, FAILED, and ABORTED.\",\n \"location\": \"query\",\n \"type\": \"string\"\n },\n \"name\": {\n \"description\": \"Required. The value `transferOperations`.\",\n \"location\": \"path\",\n \"pattern\": \"^transferOperations$\",\n \"required\": true,\n \"type\": \"string\"\n },\n \"pageSize\": {\n \"description\": \"The list page size. The max allowed value is 256.\",\n \"format\": \"int32\",\n \"location\": \"query\",\n \"type\": \"integer\"\n },\n \"pageToken\": {\n \"description\": \"The list page token.\",\n \"location\": \"query\",\n \"type\": \"string\"\n }\n },\n \"path\": \"v1/{+name}\",\n \"response\": {\n \"$ref\": \"ListOperationsResponse\"\n },\n \"scopes\": [\n \"https://www.googleapis.com/auth/cloud-platform\"\n ]\n },\n \"pause\": {\n \"description\": \"Pauses a transfer operation.\",\n \"flatPath\": \"v1/transferOperations/{transferOperationsId}:pause\",\n \"httpMethod\": \"POST\",\n \"id\": \"storagetransfer.transferOperations.pause\",\n \"parameterOrder\": [\n \"name\"\n ],\n \"parameters\": {\n \"name\": {\n \"description\": \"Required. The name of the transfer operation.\",\n \"location\": \"path\",\n \"pattern\": \"^transferOperations/.*$\",\n \"required\": true,\n \"type\": \"string\"\n }\n },\n \"path\": \"v1/{+name}:pause\",\n \"request\": {\n \"$ref\": \"PauseTransferOperationRequest\"\n },\n \"response\": {\n \"$ref\": \"Empty\"\n },\n \"scopes\": [\n \"https://www.googleapis.com/auth/cloud-platform\"\n ]\n },\n \"resume\": {\n \"description\": \"Resumes a transfer operation that is paused.\",\n \"flatPath\": \"v1/transferOperations/{transferOperationsId}:resume\",\n \"httpMethod\": \"POST\",\n \"id\": \"storagetransfer.transferOperations.resume\",\n \"parameterOrder\": [\n \"name\"\n ],\n \"parameters\": {\n \"name\": {\n \"description\": \"Required. The name of the transfer operation.\",\n \"location\": \"path\",\n \"pattern\": \"^transferOperations/.*$\",\n \"required\": true,\n \"type\": \"string\"\n }\n },\n \"path\": \"v1/{+name}:resume\",\n \"request\": {\n \"$ref\": \"ResumeTransferOperationRequest\"\n },\n \"response\": {\n \"$ref\": \"Empty\"\n },\n \"scopes\": [\n \"https://www.googleapis.com/auth/cloud-platform\"\n ]\n }\n }\n }\n },\n \"revision\": \"20200903\",\n \"rootUrl\": \"https://storagetransfer.googleapis.com/\",\n \"schemas\": {\n \"AwsAccessKey\": {\n \"description\": \"AWS access key (see [AWS Security Credentials](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)).\",\n \"id\": \"AwsAccessKey\",\n \"properties\": {\n \"accessKeyId\": {\n \"description\": \"Required. AWS access key ID.\",\n \"type\": \"string\"\n },\n \"secretAccessKey\": {\n \"description\": \"Required. AWS secret access key. This field is not returned in RPC responses.\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"AwsS3Data\": {\n \"description\": \"An AwsS3Data resource can be a data source, but not a data sink. In an AwsS3Data resource, an object's name is the S3 object's key name.\",\n \"id\": \"AwsS3Data\",\n \"properties\": {\n \"awsAccessKey\": {\n \"$ref\": \"AwsAccessKey\",\n \"description\": \"Required. AWS access key used to sign the API requests to the AWS S3 bucket. Permissions on the bucket must be granted to the access ID of the AWS access key.\"\n },\n \"bucketName\": {\n \"description\": \"Required. S3 Bucket name (see [Creating a bucket](https://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)).\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"AzureBlobStorageData\": {\n \"description\": \"An AzureBlobStorageData resource can be a data source, but not a data sink. An AzureBlobStorageData resource represents one Azure container. The storage account determines the [Azure endpoint](https://docs.microsoft.com/en-us/azure/storage/common/storage-create-storage-account#storage-account-endpoints). In an AzureBlobStorageData resource, a blobs's name is the [Azure Blob Storage blob's key name](https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata#blob-names).\",\n \"id\": \"AzureBlobStorageData\",\n \"properties\": {\n \"azureCredentials\": {\n \"$ref\": \"AzureCredentials\",\n \"description\": \"Required. Credentials used to authenticate API requests to Azure.\"\n },\n \"container\": {\n \"description\": \"Required. The container to transfer from the Azure Storage account.\",\n \"type\": \"string\"\n },\n \"storageAccount\": {\n \"description\": \"Required. The name of the Azure Storage account.\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"AzureCredentials\": {\n \"description\": \"Azure credentials\",\n \"id\": \"AzureCredentials\",\n \"properties\": {\n \"sasToken\": {\n \"description\": \"Required. Azure shared access signature. (see [Grant limited access to Azure Storage resources using shared access signatures (SAS)](https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview)).\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"Date\": {\n \"description\": \"Represents a whole or partial calendar date, e.g. a birthday. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the Proleptic Gregorian Calendar. This can represent: * A full date, with non-zero year, month and day values * A month and day value, with a zero year, e.g. an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, e.g. a credit card expiration date Related types are google.type.TimeOfDay and `google.protobuf.Timestamp`.\",\n \"id\": \"Date\",\n \"properties\": {\n \"day\": {\n \"description\": \"Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year by itself or a year and month where the day is not significant.\",\n \"format\": \"int32\",\n \"type\": \"integer\"\n },\n \"month\": {\n \"description\": \"Month of year. Must be from 1 to 12, or 0 if specifying a year without a month and day.\",\n \"format\": \"int32\",\n \"type\": \"integer\"\n },\n \"year\": {\n \"description\": \"Year of date. Must be from 1 to 9999, or 0 if specifying a date without a year.\",\n \"format\": \"int32\",\n \"type\": \"integer\"\n }\n },\n \"type\": \"object\"\n },\n \"Empty\": {\n \"description\": \"A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.\",\n \"id\": \"Empty\",\n \"properties\": {},\n \"type\": \"object\"\n },\n \"ErrorLogEntry\": {\n \"description\": \"An entry describing an error that has occurred.\",\n \"id\": \"ErrorLogEntry\",\n \"properties\": {\n \"errorDetails\": {\n \"description\": \"A list of messages that carry the error details.\",\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"url\": {\n \"description\": \"Required. A URL that refers to the target (a data source, a data sink, or an object) with which the error is associated.\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"ErrorSummary\": {\n \"description\": \"A summary of errors by error code, plus a count and sample error log entries.\",\n \"id\": \"ErrorSummary\",\n \"properties\": {\n \"errorCode\": {\n \"description\": \"Required.\",\n \"enum\": [\n \"OK\",\n \"CANCELLED\",\n \"UNKNOWN\",\n \"INVALID_ARGUMENT\",\n \"DEADLINE_EXCEEDED\",\n \"NOT_FOUND\",\n \"ALREADY_EXISTS\",\n \"PERMISSION_DENIED\",\n \"UNAUTHENTICATED\",\n \"RESOURCE_EXHAUSTED\",\n \"FAILED_PRECONDITION\",\n \"ABORTED\",\n \"OUT_OF_RANGE\",\n \"UNIMPLEMENTED\",\n \"INTERNAL\",\n \"UNAVAILABLE\",\n \"DATA_LOSS\"\n ],\n \"enumDescriptions\": [\n \"Not an error; returned on success HTTP Mapping: 200 OK\",\n \"The operation was cancelled, typically by the caller. HTTP Mapping: 499 Client Closed Request\",\n \"Unknown error. For example, this error may be returned when a `Status` value received from another address space belongs to an error space that is not known in this address space. Also errors raised by APIs that do not return enough error information may be converted to this error. HTTP Mapping: 500 Internal Server Error\",\n \"The client specified an invalid argument. Note that this differs from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments that are problematic regardless of the state of the system (e.g., a malformed file name). HTTP Mapping: 400 Bad Request\",\n \"The deadline expired before the operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. HTTP Mapping: 504 Gateway Timeout\",\n \"Some requested entity (e.g., file or directory) was not found. Note to server developers: if a request is denied for an entire class of users, such as gradual feature rollout or undocumented allowlist, `NOT_FOUND` may be used. If a request is denied for some users within a class of users, such as user-based access control, `PERMISSION_DENIED` must be used. HTTP Mapping: 404 Not Found\",\n \"The entity that a client attempted to create (e.g., file or directory) already exists. HTTP Mapping: 409 Conflict\",\n \"The caller does not have permission to execute the specified operation. `PERMISSION_DENIED` must not be used for rejections caused by exhausting some resource (use `RESOURCE_EXHAUSTED` instead for those errors). `PERMISSION_DENIED` must not be used if the caller can not be identified (use `UNAUTHENTICATED` instead for those errors). This error code does not imply the request is valid or the requested entity exists or satisfies other pre-conditions. HTTP Mapping: 403 Forbidden\",\n \"The request does not have valid authentication credentials for the operation. HTTP Mapping: 401 Unauthorized\",\n \"Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. HTTP Mapping: 429 Too Many Requests\",\n \"The operation was rejected because the system is not in a state required for the operation's execution. For example, the directory to be deleted is non-empty, an rmdir operation is applied to a non-directory, etc. Service implementors can use the following guidelines to decide between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: (a) Use `UNAVAILABLE` if the client can retry just the failing call. (b) Use `ABORTED` if the client should retry at a higher level (e.g., when a client-specified test-and-set fails, indicating the client should restart a read-modify-write sequence). (c) Use `FAILED_PRECONDITION` if the client should not retry until the system state has been explicitly fixed. E.g., if an \\\"rmdir\\\" fails because the directory is non-empty, `FAILED_PRECONDITION` should be returned since the client should not retry unless the files are deleted from the directory. HTTP Mapping: 400 Bad Request\",\n \"The operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort. See the guidelines above for deciding between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`. HTTP Mapping: 409 Conflict\",\n \"The operation was attempted past the valid range. E.g., seeking or reading past end-of-file. Unlike `INVALID_ARGUMENT`, this error indicates a problem that may be fixed if the system state changes. For example, a 32-bit file system will generate `INVALID_ARGUMENT` if asked to read at an offset that is not in the range [0,2^32-1], but it will generate `OUT_OF_RANGE` if asked to read from an offset past the current file size. There is a fair bit of overlap between `FAILED_PRECONDITION` and `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific error) when it applies so that callers who are iterating through a space can easily look for an `OUT_OF_RANGE` error to detect when they are done. HTTP Mapping: 400 Bad Request\",\n \"The operation is not implemented or is not supported/enabled in this service. HTTP Mapping: 501 Not Implemented\",\n \"Internal errors. This means that some invariants expected by the underlying system have been broken. This error code is reserved for serious errors. HTTP Mapping: 500 Internal Server Error\",\n \"The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent operations. See the guidelines above for deciding between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`. HTTP Mapping: 503 Service Unavailable\",\n \"Unrecoverable data loss or corruption. HTTP Mapping: 500 Internal Server Error\"\n ],\n \"type\": \"string\"\n },\n \"errorCount\": {\n \"description\": \"Required. Count of this type of error.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"errorLogEntries\": {\n \"description\": \"Error samples. At most 5 error log entries will be recorded for a given error code for a single transfer operation.\",\n \"items\": {\n \"$ref\": \"ErrorLogEntry\"\n },\n \"type\": \"array\"\n }\n },\n \"type\": \"object\"\n },\n \"GcsData\": {\n \"description\": \"In a GcsData resource, an object's name is the Cloud Storage object's name and its \\\"last modification time\\\" refers to the object's `updated` property of Cloud Storage objects, which changes when the content or the metadata of the object is updated.\",\n \"id\": \"GcsData\",\n \"properties\": {\n \"bucketName\": {\n \"description\": \"Required. Cloud Storage bucket name (see [Bucket Name Requirements](https://cloud.google.com/storage/docs/naming#requirements)).\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"GoogleServiceAccount\": {\n \"description\": \"Google service account\",\n \"id\": \"GoogleServiceAccount\",\n \"properties\": {\n \"accountEmail\": {\n \"description\": \"Email address of the service account.\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"HttpData\": {\n \"description\": \"An HttpData resource specifies a list of objects on the web to be transferred over HTTP. The information of the objects to be transferred is contained in a file referenced by a URL. The first line in the file must be `\\\"TsvHttpData-1.0\\\"`, which specifies the format of the file. Subsequent lines specify the information of the list of objects, one object per list entry. Each entry has the following tab-delimited fields: * **HTTP URL** — The location of the object. * **Length** — The size of the object in bytes. * **MD5** — The base64-encoded MD5 hash of the object. For an example of a valid TSV file, see [Transferring data from URLs](https://cloud.google.com/storage-transfer/docs/create-url-list). When transferring data based on a URL list, keep the following in mind: * When an object located at `http(s)://hostname:port/` is transferred to a data sink, the name of the object at the data sink is `/`. * If the specified size of an object does not match the actual size of the object fetched, the object will not be transferred. * If the specified MD5 does not match the MD5 computed from the transferred bytes, the object transfer will fail. For more information, see [Generating MD5 hashes](https://cloud.google.com/storage-transfer/docs/create-url-list#md5) * Ensure that each URL you specify is publicly accessible. For example, in Cloud Storage you can [share an object publicly] (https://cloud.google.com/storage/docs/cloud-console#_sharingdata) and get a link to it. * Storage Transfer Service obeys `robots.txt` rules and requires the source HTTP server to support `Range` requests and to return a `Content-Length` header in each response. * ObjectConditions have no effect when filtering objects to transfer.\",\n \"id\": \"HttpData\",\n \"properties\": {\n \"listUrl\": {\n \"description\": \"Required. The URL that points to the file that stores the object list entries. This file must allow public access. Currently, only URLs with HTTP and HTTPS schemes are supported.\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"ListOperationsResponse\": {\n \"description\": \"The response message for Operations.ListOperations.\",\n \"id\": \"ListOperationsResponse\",\n \"properties\": {\n \"nextPageToken\": {\n \"description\": \"The standard List next-page token.\",\n \"type\": \"string\"\n },\n \"operations\": {\n \"description\": \"A list of operations that matches the specified filter in the request.\",\n \"items\": {\n \"$ref\": \"Operation\"\n },\n \"type\": \"array\"\n }\n },\n \"type\": \"object\"\n },\n \"ListTransferJobsResponse\": {\n \"description\": \"Response from ListTransferJobs.\",\n \"id\": \"ListTransferJobsResponse\",\n \"properties\": {\n \"nextPageToken\": {\n \"description\": \"The list next page token.\",\n \"type\": \"string\"\n },\n \"transferJobs\": {\n \"description\": \"A list of transfer jobs.\",\n \"items\": {\n \"$ref\": \"TransferJob\"\n },\n \"type\": \"array\"\n }\n },\n \"type\": \"object\"\n },\n \"NotificationConfig\": {\n \"description\": \"Specification to configure notifications published to Cloud Pub/Sub. Notifications will be published to the customer-provided topic using the following `PubsubMessage.attributes`: * `\\\"eventType\\\"`: one of the EventType values * `\\\"payloadFormat\\\"`: one of the PayloadFormat values * `\\\"projectId\\\"`: the project_id of the `TransferOperation` * `\\\"transferJobName\\\"`: the transfer_job_name of the `TransferOperation` * `\\\"transferOperationName\\\"`: the name of the `TransferOperation` The `PubsubMessage.data` will contain a TransferOperation resource formatted according to the specified `PayloadFormat`.\",\n \"id\": \"NotificationConfig\",\n \"properties\": {\n \"eventTypes\": {\n \"description\": \"Event types for which a notification is desired. If empty, send notifications for all event types.\",\n \"items\": {\n \"enum\": [\n \"EVENT_TYPE_UNSPECIFIED\",\n \"TRANSFER_OPERATION_SUCCESS\",\n \"TRANSFER_OPERATION_FAILED\",\n \"TRANSFER_OPERATION_ABORTED\"\n ],\n \"enumDescriptions\": [\n \"Illegal value, to avoid allowing a default.\",\n \"`TransferOperation` completed with status SUCCESS.\",\n \"`TransferOperation` completed with status FAILED.\",\n \"`TransferOperation` completed with status ABORTED.\"\n ],\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"payloadFormat\": {\n \"description\": \"Required. The desired format of the notification message payloads.\",\n \"enum\": [\n \"PAYLOAD_FORMAT_UNSPECIFIED\",\n \"NONE\",\n \"JSON\"\n ],\n \"enumDescriptions\": [\n \"Illegal value, to avoid allowing a default.\",\n \"No payload is included with the notification.\",\n \"`TransferOperation` is [formatted as a JSON response](https://developers.google.com/protocol-buffers/docs/proto3#json), in application/json.\"\n ],\n \"type\": \"string\"\n },\n \"pubsubTopic\": {\n \"description\": \"Required. The `Topic.name` of the Cloud Pub/Sub topic to which to publish notifications. Must be of the format: `projects/{project}/topics/{topic}`. Not matching this format will result in an INVALID_ARGUMENT error.\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"ObjectConditions\": {\n \"description\": \"Conditions that determine which objects will be transferred. Applies only to Cloud Data Sources such as S3, Azure, and Cloud Storage. The \\\"last modification time\\\" refers to the time of the last change to the object's content or metadata — specifically, this is the `updated` property of Cloud Storage objects, the `LastModified` field of S3 objects, and the `Last-Modified` header of Azure blobs.\",\n \"id\": \"ObjectConditions\",\n \"properties\": {\n \"excludePrefixes\": {\n \"description\": \"`exclude_prefixes` must follow the requirements described for include_prefixes. The max size of `exclude_prefixes` is 1000.\",\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"includePrefixes\": {\n \"description\": \"If `include_prefixes` is specified, objects that satisfy the object conditions must have names that start with one of the `include_prefixes` and that do not start with any of the exclude_prefixes. If `include_prefixes` is not specified, all objects except those that have names starting with one of the `exclude_prefixes` must satisfy the object conditions. Requirements: * Each include-prefix and exclude-prefix can contain any sequence of Unicode characters, to a max length of 1024 bytes when UTF8-encoded, and must not contain Carriage Return or Line Feed characters. Wildcard matching and regular expression matching are not supported. * Each include-prefix and exclude-prefix must omit the leading slash. For example, to include the `requests.gz` object in a transfer from `s3://my-aws-bucket/logs/y=2015/requests.gz`, specify the include prefix as `logs/y=2015/requests.gz`. * None of the include-prefix or the exclude-prefix values can be empty, if specified. * Each include-prefix must include a distinct portion of the object namespace. No include-prefix may be a prefix of another include-prefix. * Each exclude-prefix must exclude a distinct portion of the object namespace. No exclude-prefix may be a prefix of another exclude-prefix. * If `include_prefixes` is specified, then each exclude-prefix must start with the value of a path explicitly included by `include_prefixes`. The max size of `include_prefixes` is 1000.\",\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"lastModifiedBefore\": {\n \"description\": \"If specified, only objects with a \\\"last modification time\\\" before this timestamp and objects that don't have a \\\"last modification time\\\" will be transferred.\",\n \"format\": \"google-datetime\",\n \"type\": \"string\"\n },\n \"lastModifiedSince\": {\n \"description\": \"If specified, only objects with a \\\"last modification time\\\" on or after this timestamp and objects that don't have a \\\"last modification time\\\" are transferred. The `last_modified_since` and `last_modified_before` fields can be used together for chunked data processing. For example, consider a script that processes each day's worth of data at a time. For that you'd set each of the fields as follows: * `last_modified_since` to the start of the day * `last_modified_before` to the end of the day\",\n \"format\": \"google-datetime\",\n \"type\": \"string\"\n },\n \"maxTimeElapsedSinceLastModification\": {\n \"description\": \"If specified, only objects with a \\\"last modification time\\\" on or after `NOW` - `max_time_elapsed_since_last_modification` and objects that don't have a \\\"last modification time\\\" are transferred. For each TransferOperation started by this TransferJob, `NOW` refers to the start_time of the `TransferOperation`.\",\n \"format\": \"google-duration\",\n \"type\": \"string\"\n },\n \"minTimeElapsedSinceLastModification\": {\n \"description\": \"If specified, only objects with a \\\"last modification time\\\" before `NOW` - `min_time_elapsed_since_last_modification` and objects that don't have a \\\"last modification time\\\" are transferred. For each TransferOperation started by this TransferJob, `NOW` refers to the start_time of the `TransferOperation`.\",\n \"format\": \"google-duration\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"Operation\": {\n \"description\": \"This resource represents a long-running operation that is the result of a network API call.\",\n \"id\": \"Operation\",\n \"properties\": {\n \"done\": {\n \"description\": \"If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.\",\n \"type\": \"boolean\"\n },\n \"error\": {\n \"$ref\": \"Status\",\n \"description\": \"The error result of the operation in case of failure or cancellation.\"\n },\n \"metadata\": {\n \"additionalProperties\": {\n \"description\": \"Properties of the object. Contains field @type with type URL.\",\n \"type\": \"any\"\n },\n \"description\": \"Represents the transfer operation object. To request a TransferOperation object, use transferOperations.get.\",\n \"type\": \"object\"\n },\n \"name\": {\n \"description\": \"The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should have the format of `transferOperations/some/unique/name`.\",\n \"type\": \"string\"\n },\n \"response\": {\n \"additionalProperties\": {\n \"description\": \"Properties of the object. Contains field @type with type URL.\",\n \"type\": \"any\"\n },\n \"description\": \"The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.\",\n \"type\": \"object\"\n }\n },\n \"type\": \"object\"\n },\n \"PauseTransferOperationRequest\": {\n \"description\": \"Request passed to PauseTransferOperation.\",\n \"id\": \"PauseTransferOperationRequest\",\n \"properties\": {},\n \"type\": \"object\"\n },\n \"ResumeTransferOperationRequest\": {\n \"description\": \"Request passed to ResumeTransferOperation.\",\n \"id\": \"ResumeTransferOperationRequest\",\n \"properties\": {},\n \"type\": \"object\"\n },\n \"Schedule\": {\n \"description\": \"Transfers can be scheduled to recur or to run just once.\",\n \"id\": \"Schedule\",\n \"properties\": {\n \"scheduleEndDate\": {\n \"$ref\": \"Date\",\n \"description\": \"The last day a transfer runs. Date boundaries are determined relative to UTC time. A job will run once per 24 hours within the following guidelines: * If `schedule_end_date` and schedule_start_date are the same and in the future relative to UTC, the transfer is executed only one time. * If `schedule_end_date` is later than `schedule_start_date` and `schedule_end_date` is in the future relative to UTC, the job will run each day at start_time_of_day through `schedule_end_date`.\"\n },\n \"scheduleStartDate\": {\n \"$ref\": \"Date\",\n \"description\": \"Required. The start date of a transfer. Date boundaries are determined relative to UTC time. If `schedule_start_date` and start_time_of_day are in the past relative to the job's creation time, the transfer starts the day after you schedule the transfer request. **Note:** When starting jobs at or near midnight UTC it is possible that a job will start later than expected. For example, if you send an outbound request on June 1 one millisecond prior to midnight UTC and the Storage Transfer Service server receives the request on June 2, then it will create a TransferJob with `schedule_start_date` set to June 2 and a `start_time_of_day` set to midnight UTC. The first scheduled TransferOperation will take place on June 3 at midnight UTC.\"\n },\n \"startTimeOfDay\": {\n \"$ref\": \"TimeOfDay\",\n \"description\": \"The time in UTC that a transfer job is scheduled to run. Transfers may start later than this time. If `start_time_of_day` is not specified: * One-time transfers run immediately. * Recurring transfers run immediately, and each day at midnight UTC, through schedule_end_date. If `start_time_of_day` is specified: * One-time transfers run at the specified time. * Recurring transfers run at the specified time each day, through `schedule_end_date`.\"\n }\n },\n \"type\": \"object\"\n },\n \"Status\": {\n \"description\": \"The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).\",\n \"id\": \"Status\",\n \"properties\": {\n \"code\": {\n \"description\": \"The status code, which should be an enum value of google.rpc.Code.\",\n \"format\": \"int32\",\n \"type\": \"integer\"\n },\n \"details\": {\n \"description\": \"A list of messages that carry the error details. There is a common set of message types for APIs to use.\",\n \"items\": {\n \"additionalProperties\": {\n \"description\": \"Properties of the object. Contains field @type with type URL.\",\n \"type\": \"any\"\n },\n \"type\": \"object\"\n },\n \"type\": \"array\"\n },\n \"message\": {\n \"description\": \"A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"TimeOfDay\": {\n \"description\": \"Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and `google.protobuf.Timestamp`.\",\n \"id\": \"TimeOfDay\",\n \"properties\": {\n \"hours\": {\n \"description\": \"Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value \\\"24:00:00\\\" for scenarios like business closing time.\",\n \"format\": \"int32\",\n \"type\": \"integer\"\n },\n \"minutes\": {\n \"description\": \"Minutes of hour of day. Must be from 0 to 59.\",\n \"format\": \"int32\",\n \"type\": \"integer\"\n },\n \"nanos\": {\n \"description\": \"Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.\",\n \"format\": \"int32\",\n \"type\": \"integer\"\n },\n \"seconds\": {\n \"description\": \"Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.\",\n \"format\": \"int32\",\n \"type\": \"integer\"\n }\n },\n \"type\": \"object\"\n },\n \"TransferCounters\": {\n \"description\": \"A collection of counters that report the progress of a transfer operation.\",\n \"id\": \"TransferCounters\",\n \"properties\": {\n \"bytesCopiedToSink\": {\n \"description\": \"Bytes that are copied to the data sink.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"bytesDeletedFromSink\": {\n \"description\": \"Bytes that are deleted from the data sink.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"bytesDeletedFromSource\": {\n \"description\": \"Bytes that are deleted from the data source.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"bytesFailedToDeleteFromSink\": {\n \"description\": \"Bytes that failed to be deleted from the data sink.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"bytesFoundFromSource\": {\n \"description\": \"Bytes found in the data source that are scheduled to be transferred, excluding any that are filtered based on object conditions or skipped due to sync.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"bytesFoundOnlyFromSink\": {\n \"description\": \"Bytes found only in the data sink that are scheduled to be deleted.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"bytesFromSourceFailed\": {\n \"description\": \"Bytes in the data source that failed to be transferred or that failed to be deleted after being transferred.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"bytesFromSourceSkippedBySync\": {\n \"description\": \"Bytes in the data source that are not transferred because they already exist in the data sink.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"objectsCopiedToSink\": {\n \"description\": \"Objects that are copied to the data sink.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"objectsDeletedFromSink\": {\n \"description\": \"Objects that are deleted from the data sink.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"objectsDeletedFromSource\": {\n \"description\": \"Objects that are deleted from the data source.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"objectsFailedToDeleteFromSink\": {\n \"description\": \"Objects that failed to be deleted from the data sink.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"objectsFoundFromSource\": {\n \"description\": \"Objects found in the data source that are scheduled to be transferred, excluding any that are filtered based on object conditions or skipped due to sync.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"objectsFoundOnlyFromSink\": {\n \"description\": \"Objects found only in the data sink that are scheduled to be deleted.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"objectsFromSourceFailed\": {\n \"description\": \"Objects in the data source that failed to be transferred or that failed to be deleted after being transferred.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n },\n \"objectsFromSourceSkippedBySync\": {\n \"description\": \"Objects in the data source that are not transferred because they already exist in the data sink.\",\n \"format\": \"int64\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"TransferJob\": {\n \"description\": \"This resource represents the configuration of a transfer job that runs periodically.\",\n \"id\": \"TransferJob\",\n \"properties\": {\n \"creationTime\": {\n \"description\": \"Output only. The time that the transfer job was created.\",\n \"format\": \"google-datetime\",\n \"type\": \"string\"\n },\n \"deletionTime\": {\n \"description\": \"Output only. The time that the transfer job was deleted.\",\n \"format\": \"google-datetime\",\n \"type\": \"string\"\n },\n \"description\": {\n \"description\": \"A description provided by the user for the job. Its max length is 1024 bytes when Unicode-encoded.\",\n \"type\": \"string\"\n },\n \"lastModificationTime\": {\n \"description\": \"Output only. The time that the transfer job was last modified.\",\n \"format\": \"google-datetime\",\n \"type\": \"string\"\n },\n \"name\": {\n \"description\": \"A unique name (within the transfer project) assigned when the job is created. If this field is empty in a CreateTransferJobRequest, Storage Transfer Service will assign a unique name. Otherwise, the specified name is used as the unique name for this job. If the specified name is in use by a job, the creation request fails with an ALREADY_EXISTS error. This name must start with `\\\"transferJobs/\\\"` prefix and end with a letter or a number, and should be no more than 128 characters. Example: `\\\"transferJobs/[A-Za-z0-9-._~]*[A-Za-z0-9]$\\\"` Invalid job names will fail with an INVALID_ARGUMENT error.\",\n \"type\": \"string\"\n },\n \"notificationConfig\": {\n \"$ref\": \"NotificationConfig\",\n \"description\": \"Notification configuration.\"\n },\n \"projectId\": {\n \"description\": \"The ID of the Google Cloud Platform Project that owns the job.\",\n \"type\": \"string\"\n },\n \"schedule\": {\n \"$ref\": \"Schedule\",\n \"description\": \"Schedule specification.\"\n },\n \"status\": {\n \"description\": \"Status of the job. This value MUST be specified for `CreateTransferJobRequests`. **Note:** The effect of the new job status takes place during a subsequent job run. For example, if you change the job status from ENABLED to DISABLED, and an operation spawned by the transfer is running, the status change would not affect the current operation.\",\n \"enum\": [\n \"STATUS_UNSPECIFIED\",\n \"ENABLED\",\n \"DISABLED\",\n \"DELETED\"\n ],\n \"enumDescriptions\": [\n \"Zero is an illegal value.\",\n \"New transfers will be performed based on the schedule.\",\n \"New transfers will not be scheduled.\",\n \"This is a soft delete state. After a transfer job is set to this state, the job and all the transfer executions are subject to garbage collection. Transfer jobs become eligible for garbage collection 30 days after their status is set to `DELETED`.\"\n ],\n \"type\": \"string\"\n },\n \"transferSpec\": {\n \"$ref\": \"TransferSpec\",\n \"description\": \"Transfer specification.\"\n }\n },\n \"type\": \"object\"\n },\n \"TransferOperation\": {\n \"description\": \"A description of the execution of a transfer.\",\n \"id\": \"TransferOperation\",\n \"properties\": {\n \"counters\": {\n \"$ref\": \"TransferCounters\",\n \"description\": \"Information about the progress of the transfer operation.\"\n },\n \"endTime\": {\n \"description\": \"End time of this transfer execution.\",\n \"format\": \"google-datetime\",\n \"type\": \"string\"\n },\n \"errorBreakdowns\": {\n \"description\": \"Summarizes errors encountered with sample error log entries.\",\n \"items\": {\n \"$ref\": \"ErrorSummary\"\n },\n \"type\": \"array\"\n },\n \"name\": {\n \"description\": \"A globally unique ID assigned by the system.\",\n \"type\": \"string\"\n },\n \"notificationConfig\": {\n \"$ref\": \"NotificationConfig\",\n \"description\": \"Notification configuration.\"\n },\n \"projectId\": {\n \"description\": \"The ID of the Google Cloud Platform Project that owns the operation.\",\n \"type\": \"string\"\n },\n \"startTime\": {\n \"description\": \"Start time of this transfer execution.\",\n \"format\": \"google-datetime\",\n \"type\": \"string\"\n },\n \"status\": {\n \"description\": \"Status of the transfer operation.\",\n \"enum\": [\n \"STATUS_UNSPECIFIED\",\n \"IN_PROGRESS\",\n \"PAUSED\",\n \"SUCCESS\",\n \"FAILED\",\n \"ABORTED\",\n \"QUEUED\"\n ],\n \"enumDescriptions\": [\n \"Zero is an illegal value.\",\n \"In progress.\",\n \"Paused.\",\n \"Completed successfully.\",\n \"Terminated due to an unrecoverable failure.\",\n \"Aborted by the user.\",\n \"Temporarily delayed by the system. No user action is required.\"\n ],\n \"type\": \"string\"\n },\n \"transferJobName\": {\n \"description\": \"The name of the transfer job that triggers this transfer operation.\",\n \"type\": \"string\"\n },\n \"transferSpec\": {\n \"$ref\": \"TransferSpec\",\n \"description\": \"Transfer specification.\"\n }\n },\n \"type\": \"object\"\n },\n \"TransferOptions\": {\n \"description\": \"TransferOptions define the actions to be performed on objects in a transfer.\",\n \"id\": \"TransferOptions\",\n \"properties\": {\n \"deleteObjectsFromSourceAfterTransfer\": {\n \"description\": \"Whether objects should be deleted from the source after they are transferred to the sink. **Note:** This option and delete_objects_unique_in_sink are mutually exclusive.\",\n \"type\": \"boolean\"\n },\n \"deleteObjectsUniqueInSink\": {\n \"description\": \"Whether objects that exist only in the sink should be deleted. **Note:** This option and delete_objects_from_source_after_transfer are mutually exclusive.\",\n \"type\": \"boolean\"\n },\n \"overwriteObjectsAlreadyExistingInSink\": {\n \"description\": \"Whether overwriting objects that already exist in the sink is allowed.\",\n \"type\": \"boolean\"\n }\n },\n \"type\": \"object\"\n },\n \"TransferSpec\": {\n \"description\": \"Configuration for running a transfer.\",\n \"id\": \"TransferSpec\",\n \"properties\": {\n \"awsS3DataSource\": {\n \"$ref\": \"AwsS3Data\",\n \"description\": \"An AWS S3 data source.\"\n },\n \"azureBlobStorageDataSource\": {\n \"$ref\": \"AzureBlobStorageData\",\n \"description\": \"An Azure Blob Storage data source.\"\n },\n \"gcsDataSink\": {\n \"$ref\": \"GcsData\",\n \"description\": \"A Cloud Storage data sink.\"\n },\n \"gcsDataSource\": {\n \"$ref\": \"GcsData\",\n \"description\": \"A Cloud Storage data source.\"\n },\n \"httpDataSource\": {\n \"$ref\": \"HttpData\",\n \"description\": \"An HTTP URL data source.\"\n },\n \"objectConditions\": {\n \"$ref\": \"ObjectConditions\",\n \"description\": \"Only objects that satisfy these object conditions are included in the set of data source and data sink objects. Object conditions based on objects' \\\"last modification time\\\" do not exclude objects in a data sink.\"\n },\n \"transferOptions\": {\n \"$ref\": \"TransferOptions\",\n \"description\": \"If the option delete_objects_unique_in_sink is `true`, object conditions based on objects' \\\"last modification time\\\" are ignored and do not exclude objects in a data source or a data sink.\"\n }\n },\n \"type\": \"object\"\n },\n \"UpdateTransferJobRequest\": {\n \"description\": \"Request passed to UpdateTransferJob.\",\n \"id\": \"UpdateTransferJobRequest\",\n \"properties\": {\n \"projectId\": {\n \"description\": \"Required. The ID of the Google Cloud Platform Console project that owns the job.\",\n \"type\": \"string\"\n },\n \"transferJob\": {\n \"$ref\": \"TransferJob\",\n \"description\": \"Required. The job to update. `transferJob` is expected to specify only four fields: description, transfer_spec, notification_config, and status. An `UpdateTransferJobRequest` that specifies other fields will be rejected with the error INVALID_ARGUMENT.\"\n },\n \"updateTransferJobFieldMask\": {\n \"description\": \"The field mask of the fields in `transferJob` that are to be updated in this request. Fields in `transferJob` that can be updated are: description, transfer_spec, notification_config, and status. To update the `transfer_spec` of the job, a complete transfer specification must be provided. An incomplete specification missing any required fields will be rejected with the error INVALID_ARGUMENT.\",\n \"format\": \"google-fieldmask\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n }\n },\n \"servicePath\": \"\",\n \"title\": \"Storage Transfer API\",\n \"version\": \"v1\",\n \"version_module\": true\n}"} +{"text": "\n\nCodeMirror: Shell mode\n\n\n\n\n\n\n\n\n\n\n
\n

Shell mode

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

MIME types defined: text/x-sh.

\n
\n"} +{"text": "var delegate = require('dom-delegate')\nvar githubCurrentUser = require('github-current-user')\n\nfunction AuthenticationHelp (el) {\n delegate(el).on('click', 'button', window.close)\n\n githubCurrentUser.verify(function (err, verified, username) {\n if (err) {\n var errorWrapperEl = el.querySelector('#error-wrapper')\n var errorEl = el.querySelector('#error')\n\n errorWrapperEl.style.display = 'block'\n errorEl.innerHTML = err\n }\n\n var usernameEl = el.querySelector('#username')\n var validKeyEl = el.querySelector('#valid-key')\n\n usernameEl.innerHTML = username || 'unknown'\n\n if (typeof verified !== 'undefined') {\n validKeyEl.innerHTML = verified\n } else {\n validKeyEl.innerHTML = ''\n }\n })\n}\n\nmodule.exports = window.AuthenticationHelp = AuthenticationHelp\n"} +{"text": "#include \"license_pbs.h\" /* See here for the software license */\n#include \n#include \n\nbool socket_success = true;\nbool close_success = true;\nbool connect_success = true;\n\nstruct addrinfo * insert_addr_name_info(struct addrinfo *pAddrInfo,const char *host)\n\n {\n return(NULL);\n }\n\nchar *get_cached_fullhostname(\n\n char *hostname,\n struct sockaddr_in *sai)\n\n {\n return(NULL);\n }\n\nstruct sockaddr_in *get_cached_addrinfo_full(const char *hostname)\n {\n return(NULL);\n }\n\nstruct sockaddr_in *get_cached_addrinfo(const char *hostname)\n \n {\n return(NULL);\n }\n\n\ntime_t pbs_tcp_timeout;\n\nvoid log_record(int eventtype, int eventclass, const char *caller, const char *msg)\n {\n }\n\nssize_t read_ac_socket(int fd, void *buf, ssize_t count) \n {\n return(0);\n }\n\nint socket (int __domain, int __type, int __protocol) __THROW\n {\n if (socket_success == true)\n return(10); /* don't return a 0, 1, or 2 because we may end up closing them */\n else\n return(-1);\n }\n\nint close(\n\n int filedes)\n\n {\n if (close_success == true)\n return(0);\n else\n return(-1);\n }\n\nint connect(\n\n int socket,\n const struct sockaddr *address,\n socklen_t address_len)\n\n {\n if (connect_success == true)\n return(0);\n else\n return(-1);\n }\n\n\n"} +{"text": "/*\n * Copyright (c) 1995\n *\tTed Lemon (hereinafter referred to as the author)\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n/* elf2ecoff.c\n\n This program converts an elf executable to an ECOFF executable.\n No symbol table is retained. This is useful primarily in building\n net-bootable kernels for machines (e.g., DECstation and Alpha) which\n only support the ECOFF object file format. */\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \"ecoff.h\"\n\n/*\n * Some extra ELF definitions\n */\n#define PT_MIPS_REGINFO 0x70000000\t/* Register usage information */\n\n/* -------------------------------------------------------------------- */\n\nstruct sect {\n\tunsigned long vaddr;\n\tunsigned long len;\n};\n\nint *symTypeTable;\nint must_convert_endian;\nint format_bigendian;\n\nstatic void copy(int out, int in, off_t offset, off_t size)\n{\n\tchar ibuf[4096];\n\tint remaining, cur, count;\n\n\t/* Go to the start of the ELF symbol table... */\n\tif (lseek(in, offset, SEEK_SET) < 0) {\n\t\tperror(\"copy: lseek\");\n\t\texit(1);\n\t}\n\n\tremaining = size;\n\twhile (remaining) {\n\t\tcur = remaining;\n\t\tif (cur > sizeof ibuf)\n\t\t\tcur = sizeof ibuf;\n\t\tremaining -= cur;\n\t\tif ((count = read(in, ibuf, cur)) != cur) {\n\t\t\tfprintf(stderr, \"copy: read: %s\\n\",\n\t\t\t\tcount ? strerror(errno) :\n\t\t\t\t\"premature end of file\");\n\t\t\texit(1);\n\t\t}\n\t\tif ((count = write(out, ibuf, cur)) != cur) {\n\t\t\tperror(\"copy: write\");\n\t\t\texit(1);\n\t\t}\n\t}\n}\n\n/*\n * Combine two segments, which must be contiguous. If pad is true, it's\n * okay for there to be padding between.\n */\nstatic void combine(struct sect *base, struct sect *new, int pad)\n{\n\tif (!base->len)\n\t\t*base = *new;\n\telse if (new->len) {\n\t\tif (base->vaddr + base->len != new->vaddr) {\n\t\t\tif (pad)\n\t\t\t\tbase->len = new->vaddr - base->vaddr;\n\t\t\telse {\n\t\t\t\tfprintf(stderr,\n\t\t\t\t\t\"Non-contiguous data can't be converted.\\n\");\n\t\t\t\texit(1);\n\t\t\t}\n\t\t}\n\t\tbase->len += new->len;\n\t}\n}\n\nstatic int phcmp(const void *v1, const void *v2)\n{\n\tconst Elf32_Phdr *h1 = v1;\n\tconst Elf32_Phdr *h2 = v2;\n\n\tif (h1->p_vaddr > h2->p_vaddr)\n\t\treturn 1;\n\telse if (h1->p_vaddr < h2->p_vaddr)\n\t\treturn -1;\n\telse\n\t\treturn 0;\n}\n\nstatic char *saveRead(int file, off_t offset, off_t len, char *name)\n{\n\tchar *tmp;\n\tint count;\n\toff_t off;\n\tif ((off = lseek(file, offset, SEEK_SET)) < 0) {\n\t\tfprintf(stderr, \"%s: fseek: %s\\n\", name, strerror(errno));\n\t\texit(1);\n\t}\n\tif (!(tmp = (char *) malloc(len))) {\n\t\tfprintf(stderr, \"%s: Can't allocate %ld bytes.\\n\", name,\n\t\t\tlen);\n\t\texit(1);\n\t}\n\tcount = read(file, tmp, len);\n\tif (count != len) {\n\t\tfprintf(stderr, \"%s: read: %s.\\n\",\n\t\t\tname,\n\t\t\tcount ? strerror(errno) : \"End of file reached\");\n\t\texit(1);\n\t}\n\treturn tmp;\n}\n\n#define swab16(x) \\\n\t((unsigned short)( \\\n\t\t(((unsigned short)(x) & (unsigned short)0x00ffU) << 8) | \\\n\t\t(((unsigned short)(x) & (unsigned short)0xff00U) >> 8) ))\n\n#define swab32(x) \\\n\t((unsigned int)( \\\n\t\t(((unsigned int)(x) & (unsigned int)0x000000ffUL) << 24) | \\\n\t\t(((unsigned int)(x) & (unsigned int)0x0000ff00UL) << 8) | \\\n\t\t(((unsigned int)(x) & (unsigned int)0x00ff0000UL) >> 8) | \\\n\t\t(((unsigned int)(x) & (unsigned int)0xff000000UL) >> 24) ))\n\nstatic void convert_elf_hdr(Elf32_Ehdr * e)\n{\n\te->e_type = swab16(e->e_type);\n\te->e_machine = swab16(e->e_machine);\n\te->e_version = swab32(e->e_version);\n\te->e_entry = swab32(e->e_entry);\n\te->e_phoff = swab32(e->e_phoff);\n\te->e_shoff = swab32(e->e_shoff);\n\te->e_flags = swab32(e->e_flags);\n\te->e_ehsize = swab16(e->e_ehsize);\n\te->e_phentsize = swab16(e->e_phentsize);\n\te->e_phnum = swab16(e->e_phnum);\n\te->e_shentsize = swab16(e->e_shentsize);\n\te->e_shnum = swab16(e->e_shnum);\n\te->e_shstrndx = swab16(e->e_shstrndx);\n}\n\nstatic void convert_elf_phdrs(Elf32_Phdr * p, int num)\n{\n\tint i;\n\n\tfor (i = 0; i < num; i++, p++) {\n\t\tp->p_type = swab32(p->p_type);\n\t\tp->p_offset = swab32(p->p_offset);\n\t\tp->p_vaddr = swab32(p->p_vaddr);\n\t\tp->p_paddr = swab32(p->p_paddr);\n\t\tp->p_filesz = swab32(p->p_filesz);\n\t\tp->p_memsz = swab32(p->p_memsz);\n\t\tp->p_flags = swab32(p->p_flags);\n\t\tp->p_align = swab32(p->p_align);\n\t}\n\n}\n\nstatic void convert_elf_shdrs(Elf32_Shdr * s, int num)\n{\n\tint i;\n\n\tfor (i = 0; i < num; i++, s++) {\n\t\ts->sh_name = swab32(s->sh_name);\n\t\ts->sh_type = swab32(s->sh_type);\n\t\ts->sh_flags = swab32(s->sh_flags);\n\t\ts->sh_addr = swab32(s->sh_addr);\n\t\ts->sh_offset = swab32(s->sh_offset);\n\t\ts->sh_size = swab32(s->sh_size);\n\t\ts->sh_link = swab32(s->sh_link);\n\t\ts->sh_info = swab32(s->sh_info);\n\t\ts->sh_addralign = swab32(s->sh_addralign);\n\t\ts->sh_entsize = swab32(s->sh_entsize);\n\t}\n}\n\nstatic void convert_ecoff_filehdr(struct filehdr *f)\n{\n\tf->f_magic = swab16(f->f_magic);\n\tf->f_nscns = swab16(f->f_nscns);\n\tf->f_timdat = swab32(f->f_timdat);\n\tf->f_symptr = swab32(f->f_symptr);\n\tf->f_nsyms = swab32(f->f_nsyms);\n\tf->f_opthdr = swab16(f->f_opthdr);\n\tf->f_flags = swab16(f->f_flags);\n}\n\nstatic void convert_ecoff_aouthdr(struct aouthdr *a)\n{\n\ta->magic = swab16(a->magic);\n\ta->vstamp = swab16(a->vstamp);\n\ta->tsize = swab32(a->tsize);\n\ta->dsize = swab32(a->dsize);\n\ta->bsize = swab32(a->bsize);\n\ta->entry = swab32(a->entry);\n\ta->text_start = swab32(a->text_start);\n\ta->data_start = swab32(a->data_start);\n\ta->bss_start = swab32(a->bss_start);\n\ta->gprmask = swab32(a->gprmask);\n\ta->cprmask[0] = swab32(a->cprmask[0]);\n\ta->cprmask[1] = swab32(a->cprmask[1]);\n\ta->cprmask[2] = swab32(a->cprmask[2]);\n\ta->cprmask[3] = swab32(a->cprmask[3]);\n\ta->gp_value = swab32(a->gp_value);\n}\n\nstatic void convert_ecoff_esecs(struct scnhdr *s, int num)\n{\n\tint i;\n\n\tfor (i = 0; i < num; i++, s++) {\n\t\ts->s_paddr = swab32(s->s_paddr);\n\t\ts->s_vaddr = swab32(s->s_vaddr);\n\t\ts->s_size = swab32(s->s_size);\n\t\ts->s_scnptr = swab32(s->s_scnptr);\n\t\ts->s_relptr = swab32(s->s_relptr);\n\t\ts->s_lnnoptr = swab32(s->s_lnnoptr);\n\t\ts->s_nreloc = swab16(s->s_nreloc);\n\t\ts->s_nlnno = swab16(s->s_nlnno);\n\t\ts->s_flags = swab32(s->s_flags);\n\t}\n}\n\nint main(int argc, char *argv[])\n{\n\tElf32_Ehdr ex;\n\tElf32_Phdr *ph;\n\tElf32_Shdr *sh;\n\tchar *shstrtab;\n\tint i, pad;\n\tstruct sect text, data, bss;\n\tstruct filehdr efh;\n\tstruct aouthdr eah;\n\tstruct scnhdr esecs[6];\n\tint infile, outfile;\n\tunsigned long cur_vma = ULONG_MAX;\n\tint addflag = 0;\n\tint nosecs;\n\n\ttext.len = data.len = bss.len = 0;\n\ttext.vaddr = data.vaddr = bss.vaddr = 0;\n\n\t/* Check args... */\n\tif (argc < 3 || argc > 4) {\n\t usage:\n\t\tfprintf(stderr,\n\t\t\t\"usage: elf2ecoff [-a]\\n\");\n\t\texit(1);\n\t}\n\tif (argc == 4) {\n\t\tif (strcmp(argv[3], \"-a\"))\n\t\t\tgoto usage;\n\t\taddflag = 1;\n\t}\n\n\t/* Try the input file... */\n\tif ((infile = open(argv[1], O_RDONLY)) < 0) {\n\t\tfprintf(stderr, \"Can't open %s for read: %s\\n\",\n\t\t\targv[1], strerror(errno));\n\t\texit(1);\n\t}\n\n\t/* Read the header, which is at the beginning of the file... */\n\ti = read(infile, &ex, sizeof ex);\n\tif (i != sizeof ex) {\n\t\tfprintf(stderr, \"ex: %s: %s.\\n\",\n\t\t\targv[1],\n\t\t\ti ? strerror(errno) : \"End of file reached\");\n\t\texit(1);\n\t}\n\n\tif (ex.e_ident[EI_DATA] == ELFDATA2MSB)\n\t\tformat_bigendian = 1;\n\n\tif (ntohs(0xaa55) == 0xaa55) {\n\t\tif (!format_bigendian)\n\t\t\tmust_convert_endian = 1;\n\t} else {\n\t\tif (format_bigendian)\n\t\t\tmust_convert_endian = 1;\n\t}\n\tif (must_convert_endian)\n\t\tconvert_elf_hdr(&ex);\n\n\t/* Read the program headers... */\n\tph = (Elf32_Phdr *) saveRead(infile, ex.e_phoff,\n\t\t\t\t ex.e_phnum * sizeof(Elf32_Phdr),\n\t\t\t\t \"ph\");\n\tif (must_convert_endian)\n\t\tconvert_elf_phdrs(ph, ex.e_phnum);\n\t/* Read the section headers... */\n\tsh = (Elf32_Shdr *) saveRead(infile, ex.e_shoff,\n\t\t\t\t ex.e_shnum * sizeof(Elf32_Shdr),\n\t\t\t\t \"sh\");\n\tif (must_convert_endian)\n\t\tconvert_elf_shdrs(sh, ex.e_shnum);\n\t/* Read in the section string table. */\n\tshstrtab = saveRead(infile, sh[ex.e_shstrndx].sh_offset,\n\t\t\t sh[ex.e_shstrndx].sh_size, \"shstrtab\");\n\n\t/* Figure out if we can cram the program header into an ECOFF\n\t header... Basically, we can't handle anything but loadable\n\t segments, but we can ignore some kinds of segments. We can't\n\t handle holes in the address space. Segments may be out of order,\n\t so we sort them first. */\n\n\tqsort(ph, ex.e_phnum, sizeof(Elf32_Phdr), phcmp);\n\n\tfor (i = 0; i < ex.e_phnum; i++) {\n\t\t/* Section types we can ignore... */\n\t\tif (ph[i].p_type == PT_NULL || ph[i].p_type == PT_NOTE ||\n\t\t ph[i].p_type == PT_PHDR\n\t\t || ph[i].p_type == PT_MIPS_REGINFO)\n\t\t\tcontinue;\n\t\t/* Section types we can't handle... */\n\t\telse if (ph[i].p_type != PT_LOAD) {\n\t\t\tfprintf(stderr,\n\t\t\t\t\"Program header %d type %d can't be converted.\\n\",\n\t\t\t\tex.e_phnum, ph[i].p_type);\n\t\t\texit(1);\n\t\t}\n\t\t/* Writable (data) segment? */\n\t\tif (ph[i].p_flags & PF_W) {\n\t\t\tstruct sect ndata, nbss;\n\n\t\t\tndata.vaddr = ph[i].p_vaddr;\n\t\t\tndata.len = ph[i].p_filesz;\n\t\t\tnbss.vaddr = ph[i].p_vaddr + ph[i].p_filesz;\n\t\t\tnbss.len = ph[i].p_memsz - ph[i].p_filesz;\n\n\t\t\tcombine(&data, &ndata, 0);\n\t\t\tcombine(&bss, &nbss, 1);\n\t\t} else {\n\t\t\tstruct sect ntxt;\n\n\t\t\tntxt.vaddr = ph[i].p_vaddr;\n\t\t\tntxt.len = ph[i].p_filesz;\n\n\t\t\tcombine(&text, &ntxt, 0);\n\t\t}\n\t\t/* Remember the lowest segment start address. */\n\t\tif (ph[i].p_vaddr < cur_vma)\n\t\t\tcur_vma = ph[i].p_vaddr;\n\t}\n\n\t/* Sections must be in order to be converted... */\n\tif (text.vaddr > data.vaddr || data.vaddr > bss.vaddr ||\n\t text.vaddr + text.len > data.vaddr\n\t || data.vaddr + data.len > bss.vaddr) {\n\t\tfprintf(stderr,\n\t\t\t\"Sections ordering prevents a.out conversion.\\n\");\n\t\texit(1);\n\t}\n\n\t/* If there's a data section but no text section, then the loader\n\t combined everything into one section. That needs to be the\n\t text section, so just make the data section zero length following\n\t text. */\n\tif (data.len && !text.len) {\n\t\ttext = data;\n\t\tdata.vaddr = text.vaddr + text.len;\n\t\tdata.len = 0;\n\t}\n\n\t/* If there is a gap between text and data, we'll fill it when we copy\n\t the data, so update the length of the text segment as represented in\n\t a.out to reflect that, since a.out doesn't allow gaps in the program\n\t address space. */\n\tif (text.vaddr + text.len < data.vaddr)\n\t\ttext.len = data.vaddr - text.vaddr;\n\n\t/* We now have enough information to cons up an a.out header... */\n\teah.magic = OMAGIC;\n\teah.vstamp = 200;\n\teah.tsize = text.len;\n\teah.dsize = data.len;\n\teah.bsize = bss.len;\n\teah.entry = ex.e_entry;\n\teah.text_start = text.vaddr;\n\teah.data_start = data.vaddr;\n\teah.bss_start = bss.vaddr;\n\teah.gprmask = 0xf3fffffe;\n\tmemset(&eah.cprmask, '\\0', sizeof eah.cprmask);\n\teah.gp_value = 0;\t/* unused. */\n\n\tif (format_bigendian)\n\t\tefh.f_magic = MIPSEBMAGIC;\n\telse\n\t\tefh.f_magic = MIPSELMAGIC;\n\tif (addflag)\n\t\tnosecs = 6;\n\telse\n\t\tnosecs = 3;\n\tefh.f_nscns = nosecs;\n\tefh.f_timdat = 0;\t/* bogus */\n\tefh.f_symptr = 0;\n\tefh.f_nsyms = 0;\n\tefh.f_opthdr = sizeof eah;\n\tefh.f_flags = 0x100f;\t/* Stripped, not sharable. */\n\n\tmemset(esecs, 0, sizeof esecs);\n\tstrcpy(esecs[0].s_name, \".text\");\n\tstrcpy(esecs[1].s_name, \".data\");\n\tstrcpy(esecs[2].s_name, \".bss\");\n\tif (addflag) {\n\t\tstrcpy(esecs[3].s_name, \".rdata\");\n\t\tstrcpy(esecs[4].s_name, \".sdata\");\n\t\tstrcpy(esecs[5].s_name, \".sbss\");\n\t}\n\tesecs[0].s_paddr = esecs[0].s_vaddr = eah.text_start;\n\tesecs[1].s_paddr = esecs[1].s_vaddr = eah.data_start;\n\tesecs[2].s_paddr = esecs[2].s_vaddr = eah.bss_start;\n\tif (addflag) {\n\t\tesecs[3].s_paddr = esecs[3].s_vaddr = 0;\n\t\tesecs[4].s_paddr = esecs[4].s_vaddr = 0;\n\t\tesecs[5].s_paddr = esecs[5].s_vaddr = 0;\n\t}\n\tesecs[0].s_size = eah.tsize;\n\tesecs[1].s_size = eah.dsize;\n\tesecs[2].s_size = eah.bsize;\n\tif (addflag) {\n\t\tesecs[3].s_size = 0;\n\t\tesecs[4].s_size = 0;\n\t\tesecs[5].s_size = 0;\n\t}\n\tesecs[0].s_scnptr = N_TXTOFF(efh, eah);\n\tesecs[1].s_scnptr = N_DATOFF(efh, eah);\n#define ECOFF_SEGMENT_ALIGNMENT(a) 0x10\n#define ECOFF_ROUND(s, a) (((s)+(a)-1)&~((a)-1))\n\tesecs[2].s_scnptr = esecs[1].s_scnptr +\n\t ECOFF_ROUND(esecs[1].s_size, ECOFF_SEGMENT_ALIGNMENT(&eah));\n\tif (addflag) {\n\t\tesecs[3].s_scnptr = 0;\n\t\tesecs[4].s_scnptr = 0;\n\t\tesecs[5].s_scnptr = 0;\n\t}\n\tesecs[0].s_relptr = esecs[1].s_relptr = esecs[2].s_relptr = 0;\n\tesecs[0].s_lnnoptr = esecs[1].s_lnnoptr = esecs[2].s_lnnoptr = 0;\n\tesecs[0].s_nreloc = esecs[1].s_nreloc = esecs[2].s_nreloc = 0;\n\tesecs[0].s_nlnno = esecs[1].s_nlnno = esecs[2].s_nlnno = 0;\n\tif (addflag) {\n\t\tesecs[3].s_relptr = esecs[4].s_relptr\n\t\t = esecs[5].s_relptr = 0;\n\t\tesecs[3].s_lnnoptr = esecs[4].s_lnnoptr\n\t\t = esecs[5].s_lnnoptr = 0;\n\t\tesecs[3].s_nreloc = esecs[4].s_nreloc = esecs[5].s_nreloc =\n\t\t 0;\n\t\tesecs[3].s_nlnno = esecs[4].s_nlnno = esecs[5].s_nlnno = 0;\n\t}\n\tesecs[0].s_flags = 0x20;\n\tesecs[1].s_flags = 0x40;\n\tesecs[2].s_flags = 0x82;\n\tif (addflag) {\n\t\tesecs[3].s_flags = 0x100;\n\t\tesecs[4].s_flags = 0x200;\n\t\tesecs[5].s_flags = 0x400;\n\t}\n\n\t/* Make the output file... */\n\tif ((outfile = open(argv[2], O_WRONLY | O_CREAT, 0777)) < 0) {\n\t\tfprintf(stderr, \"Unable to create %s: %s\\n\", argv[2],\n\t\t\tstrerror(errno));\n\t\texit(1);\n\t}\n\n\tif (must_convert_endian)\n\t\tconvert_ecoff_filehdr(&efh);\n\t/* Write the headers... */\n\ti = write(outfile, &efh, sizeof efh);\n\tif (i != sizeof efh) {\n\t\tperror(\"efh: write\");\n\t\texit(1);\n\n\t\tfor (i = 0; i < nosecs; i++) {\n\t\t\tprintf\n\t\t\t (\"Section %d: %s phys %lx size %lx file offset %lx\\n\",\n\t\t\t i, esecs[i].s_name, esecs[i].s_paddr,\n\t\t\t esecs[i].s_size, esecs[i].s_scnptr);\n\t\t}\n\t}\n\tfprintf(stderr, \"wrote %d byte file header.\\n\", i);\n\n\tif (must_convert_endian)\n\t\tconvert_ecoff_aouthdr(&eah);\n\ti = write(outfile, &eah, sizeof eah);\n\tif (i != sizeof eah) {\n\t\tperror(\"eah: write\");\n\t\texit(1);\n\t}\n\tfprintf(stderr, \"wrote %d byte a.out header.\\n\", i);\n\n\tif (must_convert_endian)\n\t\tconvert_ecoff_esecs(&esecs[0], nosecs);\n\ti = write(outfile, &esecs, nosecs * sizeof(struct scnhdr));\n\tif (i != nosecs * sizeof(struct scnhdr)) {\n\t\tperror(\"esecs: write\");\n\t\texit(1);\n\t}\n\tfprintf(stderr, \"wrote %d bytes of section headers.\\n\", i);\n\n\tpad = (sizeof(efh) + sizeof(eah) + nosecs * sizeof(struct scnhdr)) & 15;\n\tif (pad) {\n\t\tpad = 16 - pad;\n\t\ti = write(outfile, \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\", pad);\n\t\tif (i < 0) {\n\t\t\tperror(\"ipad: write\");\n\t\t\texit(1);\n\t\t}\n\t\tfprintf(stderr, \"wrote %d byte pad.\\n\", i);\n\t}\n\n\t/*\n\t * Copy the loadable sections. Zero-fill any gaps less than 64k;\n\t * complain about any zero-filling, and die if we're asked to zero-fill\n\t * more than 64k.\n\t */\n\tfor (i = 0; i < ex.e_phnum; i++) {\n\t\t/* Unprocessable sections were handled above, so just verify that\n\t\t the section can be loaded before copying. */\n\t\tif (ph[i].p_type == PT_LOAD && ph[i].p_filesz) {\n\t\t\tif (cur_vma != ph[i].p_vaddr) {\n\t\t\t\tunsigned long gap =\n\t\t\t\t ph[i].p_vaddr - cur_vma;\n\t\t\t\tchar obuf[1024];\n\t\t\t\tif (gap > 65536) {\n\t\t\t\t\tfprintf(stderr,\n\t\t\t\t\t\t\"Intersegment gap (%ld bytes) too large.\\n\",\n\t\t\t\t\t\tgap);\n\t\t\t\t\texit(1);\n\t\t\t\t}\n\t\t\t\tfprintf(stderr,\n\t\t\t\t\t\"Warning: %ld byte intersegment gap.\\n\",\n\t\t\t\t\tgap);\n\t\t\t\tmemset(obuf, 0, sizeof obuf);\n\t\t\t\twhile (gap) {\n\t\t\t\t\tint count =\n\t\t\t\t\t write(outfile, obuf,\n\t\t\t\t\t\t (gap >\n\t\t\t\t\t\t sizeof obuf ? sizeof\n\t\t\t\t\t\t obuf : gap));\n\t\t\t\t\tif (count < 0) {\n\t\t\t\t\t\tfprintf(stderr,\n\t\t\t\t\t\t\t\"Error writing gap: %s\\n\",\n\t\t\t\t\t\t\tstrerror(errno));\n\t\t\t\t\t\texit(1);\n\t\t\t\t\t}\n\t\t\t\t\tgap -= count;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfprintf(stderr, \"writing %d bytes...\\n\",\n\t\t\t\tph[i].p_filesz);\n\t\t\tcopy(outfile, infile, ph[i].p_offset,\n\t\t\t ph[i].p_filesz);\n\t\t\tcur_vma = ph[i].p_vaddr + ph[i].p_filesz;\n\t\t}\n\t}\n\n\t/*\n\t * Write a page of padding for boot PROMS that read entire pages.\n\t * Without this, they may attempt to read past the end of the\n\t * data section, incur an error, and refuse to boot.\n\t */\n\t{\n\t\tchar obuf[4096];\n\t\tmemset(obuf, 0, sizeof obuf);\n\t\tif (write(outfile, obuf, sizeof(obuf)) != sizeof(obuf)) {\n\t\t\tfprintf(stderr, \"Error writing PROM padding: %s\\n\",\n\t\t\t\tstrerror(errno));\n\t\t\texit(1);\n\t\t}\n\t}\n\n\t/* Looks like we won... */\n\texit(0);\n}\n"} +{"text": "/*\n * Copyright 2017 LINE Corporation\n *\n * LINE Corporation licenses this file to you under the Apache License,\n * version 2.0 (the \"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 * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations\n * under the License.\n */\npackage com.linecorp.centraldogma.server.command;\n\nimport static java.util.Objects.requireNonNull;\n\nimport java.util.concurrent.CompletableFuture;\nimport java.util.concurrent.Executor;\nimport java.util.function.Consumer;\n\nimport javax.annotation.Nullable;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport com.linecorp.centraldogma.common.Revision;\nimport com.linecorp.centraldogma.server.auth.Session;\nimport com.linecorp.centraldogma.server.auth.SessionManager;\nimport com.linecorp.centraldogma.server.storage.project.ProjectManager;\nimport com.linecorp.centraldogma.server.storage.repository.Repository;\n\n/**\n * A {@link CommandExecutor} implementation which performs operations on the local storage.\n */\npublic class StandaloneCommandExecutor extends AbstractCommandExecutor {\n\n private static final Logger logger = LoggerFactory.getLogger(StandaloneCommandExecutor.class);\n\n private final ProjectManager projectManager;\n private final Executor repositoryWorker;\n @Nullable\n private final SessionManager sessionManager;\n\n /**\n * Creates a new instance.\n *\n * @param projectManager the project manager for accessing the storage\n * @param repositoryWorker the executor which is used for performing storage operations\n * @param sessionManager the session manager for creating/removing a session\n * @param onTakeLeadership the callback to be invoked after the replica has taken the leadership\n * @param onReleaseLeadership the callback to be invoked before the replica releases the leadership\n */\n public StandaloneCommandExecutor(ProjectManager projectManager,\n Executor repositoryWorker,\n @Nullable SessionManager sessionManager,\n @Nullable Consumer onTakeLeadership,\n @Nullable Consumer onReleaseLeadership) {\n super(onTakeLeadership, onReleaseLeadership);\n this.projectManager = requireNonNull(projectManager, \"projectManager\");\n this.repositoryWorker = requireNonNull(repositoryWorker, \"repositoryWorker\");\n this.sessionManager = sessionManager;\n }\n\n @Override\n public int replicaId() {\n return 0;\n }\n\n @Override\n protected void doStart(@Nullable Runnable onTakeLeadership,\n @Nullable Runnable onReleaseLeadership) {\n if (onTakeLeadership != null) {\n onTakeLeadership.run();\n }\n }\n\n @Override\n protected void doStop(@Nullable Runnable onReleaseLeadership) {\n if (onReleaseLeadership != null) {\n onReleaseLeadership.run();\n }\n }\n\n @Override\n @SuppressWarnings(\"unchecked\")\n protected CompletableFuture doExecute(Command command) throws Exception {\n if (command instanceof CreateProjectCommand) {\n return (CompletableFuture) createProject((CreateProjectCommand) command);\n }\n\n if (command instanceof RemoveProjectCommand) {\n return (CompletableFuture) removeProject((RemoveProjectCommand) command);\n }\n\n if (command instanceof UnremoveProjectCommand) {\n return (CompletableFuture) unremoveProject((UnremoveProjectCommand) command);\n }\n\n if (command instanceof PurgeProjectCommand) {\n return (CompletableFuture) purgeProject((PurgeProjectCommand) command);\n }\n\n if (command instanceof CreateRepositoryCommand) {\n return (CompletableFuture) createRepository((CreateRepositoryCommand) command);\n }\n\n if (command instanceof RemoveRepositoryCommand) {\n return (CompletableFuture) removeRepository((RemoveRepositoryCommand) command);\n }\n\n if (command instanceof UnremoveRepositoryCommand) {\n return (CompletableFuture) unremoveRepository((UnremoveRepositoryCommand) command);\n }\n\n if (command instanceof PurgeRepositoryCommand) {\n return (CompletableFuture) purgeRepository((PurgeRepositoryCommand) command);\n }\n\n if (command instanceof PushCommand) {\n return (CompletableFuture) push((PushCommand) command);\n }\n\n if (command instanceof CreateSessionCommand) {\n return (CompletableFuture) createSession((CreateSessionCommand) command);\n }\n\n if (command instanceof RemoveSessionCommand) {\n return (CompletableFuture) removeSession((RemoveSessionCommand) command);\n }\n\n throw new UnsupportedOperationException(command.toString());\n }\n\n // Project operations\n\n private CompletableFuture createProject(CreateProjectCommand c) {\n return CompletableFuture.supplyAsync(() -> {\n projectManager.create(c.projectName(), c.timestamp(), c.author());\n return null;\n }, repositoryWorker);\n }\n\n private CompletableFuture removeProject(RemoveProjectCommand c) {\n return CompletableFuture.supplyAsync(() -> {\n projectManager.remove(c.projectName());\n return null;\n }, repositoryWorker);\n }\n\n private CompletableFuture unremoveProject(UnremoveProjectCommand c) {\n return CompletableFuture.supplyAsync(() -> {\n projectManager.unremove(c.projectName());\n return null;\n }, repositoryWorker);\n }\n\n private CompletableFuture purgeProject(PurgeProjectCommand c) {\n return CompletableFuture.supplyAsync(() -> {\n projectManager.markForPurge(c.projectName());\n return null;\n }, repositoryWorker);\n }\n\n // Repository operations\n\n private CompletableFuture createRepository(CreateRepositoryCommand c) {\n return CompletableFuture.supplyAsync(() -> {\n projectManager.get(c.projectName()).repos().create(c.repositoryName(), c.timestamp(), c.author());\n return null;\n }, repositoryWorker);\n }\n\n private CompletableFuture removeRepository(RemoveRepositoryCommand c) {\n return CompletableFuture.supplyAsync(() -> {\n projectManager.get(c.projectName()).repos().remove(c.repositoryName());\n return null;\n }, repositoryWorker);\n }\n\n private CompletableFuture unremoveRepository(UnremoveRepositoryCommand c) {\n return CompletableFuture.supplyAsync(() -> {\n projectManager.get(c.projectName()).repos().unremove(c.repositoryName());\n return null;\n }, repositoryWorker);\n }\n\n private CompletableFuture purgeRepository(PurgeRepositoryCommand c) {\n return CompletableFuture.supplyAsync(() -> {\n projectManager.get(c.projectName()).repos().markForPurge(c.repositoryName());\n return null;\n }, repositoryWorker);\n }\n\n private CompletableFuture push(PushCommand c) {\n return repo(c).commit(c.baseRevision(), c.timestamp(),\n c.author(), c.summary(), c.detail(), c.markup(), c.changes());\n }\n\n private Repository repo(RepositoryCommand c) {\n return projectManager.get(c.projectName()).repos().get(c.repositoryName());\n }\n\n private CompletableFuture createSession(CreateSessionCommand c) {\n if (sessionManager == null) {\n // Security has been disabled for this replica.\n return CompletableFuture.completedFuture(null);\n }\n\n final Session session = c.session();\n return sessionManager.create(session).exceptionally(cause -> {\n logger.warn(\"Failed to replicate a session creation: {}\", session, cause);\n return null;\n });\n }\n\n private CompletableFuture removeSession(RemoveSessionCommand c) {\n if (sessionManager == null) {\n return CompletableFuture.completedFuture(null);\n }\n\n final String sessionId = c.sessionId();\n return sessionManager.delete(sessionId).exceptionally(cause -> {\n logger.warn(\"Failed to replicate a session removal: {}\", sessionId, cause);\n return null;\n });\n }\n}\n"} +{"text": "\n \n\n\n \n\n\n\n\n\n\n \n\n\n"} +{"text": "\n# HELP metric one\n# HELP metric two\n"} +{"text": "//===- STLExtrasTest.cpp - Unit tests for STL extras ----------------------===//\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#include \"llvm/ADT/STLExtras.h\"\n#include \"gtest/gtest.h\"\n\n#include \n#include \n\nusing namespace llvm;\n\nnamespace {\n\nint f(rank<0>) { return 0; }\nint f(rank<1>) { return 1; }\nint f(rank<2>) { return 2; }\nint f(rank<4>) { return 4; }\n\nTEST(STLExtrasTest, Rank) {\n // We shouldn't get ambiguities and should select the overload of the same\n // rank as the argument.\n EXPECT_EQ(0, f(rank<0>()));\n EXPECT_EQ(1, f(rank<1>()));\n EXPECT_EQ(2, f(rank<2>()));\n\n // This overload is missing so we end up back at 2.\n EXPECT_EQ(2, f(rank<3>()));\n\n // But going past 3 should work fine.\n EXPECT_EQ(4, f(rank<4>()));\n\n // And we can even go higher and just fall back to the last overload.\n EXPECT_EQ(4, f(rank<5>()));\n EXPECT_EQ(4, f(rank<6>()));\n}\n\nTEST(STLExtrasTest, EnumerateLValue) {\n // Test that a simple LValue can be enumerated and gives correct results with\n // multiple types, including the empty container.\n std::vector foo = {'a', 'b', 'c'};\n typedef std::pair CharPairType;\n std::vector CharResults;\n\n for (auto X : llvm::enumerate(foo)) {\n CharResults.emplace_back(X.Index, X.Value);\n }\n ASSERT_EQ(3u, CharResults.size());\n EXPECT_EQ(CharPairType(0u, 'a'), CharResults[0]);\n EXPECT_EQ(CharPairType(1u, 'b'), CharResults[1]);\n EXPECT_EQ(CharPairType(2u, 'c'), CharResults[2]);\n\n // Test a const range of a different type.\n typedef std::pair IntPairType;\n std::vector IntResults;\n const std::vector bar = {1, 2, 3};\n for (auto X : llvm::enumerate(bar)) {\n IntResults.emplace_back(X.Index, X.Value);\n }\n ASSERT_EQ(3u, IntResults.size());\n EXPECT_EQ(IntPairType(0u, 1), IntResults[0]);\n EXPECT_EQ(IntPairType(1u, 2), IntResults[1]);\n EXPECT_EQ(IntPairType(2u, 3), IntResults[2]);\n\n // Test an empty range.\n IntResults.clear();\n const std::vector baz;\n for (auto X : llvm::enumerate(baz)) {\n IntResults.emplace_back(X.Index, X.Value);\n }\n EXPECT_TRUE(IntResults.empty());\n}\n\nTEST(STLExtrasTest, EnumerateModifyLValue) {\n // Test that you can modify the underlying entries of an lvalue range through\n // the enumeration iterator.\n std::vector foo = {'a', 'b', 'c'};\n\n for (auto X : llvm::enumerate(foo)) {\n ++X.Value;\n }\n EXPECT_EQ('b', foo[0]);\n EXPECT_EQ('c', foo[1]);\n EXPECT_EQ('d', foo[2]);\n}\n\nTEST(STLExtrasTest, EnumerateRValueRef) {\n // Test that an rvalue can be enumerated.\n typedef std::pair PairType;\n std::vector Results;\n\n auto Enumerator = llvm::enumerate(std::vector{1, 2, 3});\n\n for (auto X : llvm::enumerate(std::vector{1, 2, 3})) {\n Results.emplace_back(X.Index, X.Value);\n }\n\n ASSERT_EQ(3u, Results.size());\n EXPECT_EQ(PairType(0u, 1), Results[0]);\n EXPECT_EQ(PairType(1u, 2), Results[1]);\n EXPECT_EQ(PairType(2u, 3), Results[2]);\n}\n\nTEST(STLExtrasTest, EnumerateModifyRValue) {\n // Test that when enumerating an rvalue, modification still works (even if\n // this isn't terribly useful, it at least shows that we haven't snuck an\n // extra const in there somewhere.\n typedef std::pair PairType;\n std::vector Results;\n\n for (auto X : llvm::enumerate(std::vector{'1', '2', '3'})) {\n ++X.Value;\n Results.emplace_back(X.Index, X.Value);\n }\n\n ASSERT_EQ(3u, Results.size());\n EXPECT_EQ(PairType(0u, '2'), Results[0]);\n EXPECT_EQ(PairType(1u, '3'), Results[1]);\n EXPECT_EQ(PairType(2u, '4'), Results[2]);\n}\n\ntemplate struct CanMove {};\ntemplate <> struct CanMove {\n CanMove(CanMove &&) = delete;\n\n CanMove() = default;\n CanMove(const CanMove &) = default;\n};\n\ntemplate struct CanCopy {};\ntemplate <> struct CanCopy {\n CanCopy(const CanCopy &) = delete;\n\n CanCopy() = default;\n CanCopy(CanCopy &&) = default;\n};\n\ntemplate \nstruct Range : CanMove, CanCopy {\n explicit Range(int &C, int &M, int &D) : C(C), M(M), D(D) {}\n Range(const Range &R) : CanCopy(R), C(R.C), M(R.M), D(R.D) { ++C; }\n Range(Range &&R) : CanMove(std::move(R)), C(R.C), M(R.M), D(R.D) {\n ++M;\n }\n ~Range() { ++D; }\n\n int &C;\n int &M;\n int &D;\n\n int *begin() { return nullptr; }\n int *end() { return nullptr; }\n};\n\nTEST(STLExtrasTest, EnumerateLifetimeSemantics) {\n // Test that when enumerating lvalues and rvalues, there are no surprise\n // copies or moves.\n\n // With an rvalue, it should not be destroyed until the end of the scope.\n int Copies = 0;\n int Moves = 0;\n int Destructors = 0;\n {\n auto E1 = enumerate(Range(Copies, Moves, Destructors));\n // Doesn't compile. rvalue ranges must be moveable.\n // auto E2 = enumerate(Range(Copies, Moves, Destructors));\n EXPECT_EQ(0, Copies);\n EXPECT_EQ(1, Moves);\n EXPECT_EQ(1, Destructors);\n }\n EXPECT_EQ(0, Copies);\n EXPECT_EQ(1, Moves);\n EXPECT_EQ(2, Destructors);\n\n Copies = Moves = Destructors = 0;\n // With an lvalue, it should not be destroyed even after the end of the scope.\n // lvalue ranges need be neither copyable nor moveable.\n Range R(Copies, Moves, Destructors);\n {\n auto Enumerator = enumerate(R);\n (void)Enumerator;\n EXPECT_EQ(0, Copies);\n EXPECT_EQ(0, Moves);\n EXPECT_EQ(0, Destructors);\n }\n EXPECT_EQ(0, Copies);\n EXPECT_EQ(0, Moves);\n EXPECT_EQ(0, Destructors);\n}\n\nTEST(STLExtrasTest, ApplyTuple) {\n auto T = std::make_tuple(1, 3, 7);\n auto U = llvm::apply_tuple(\n [](int A, int B, int C) { return std::make_tuple(A - B, B - C, C - A); },\n T);\n\n EXPECT_EQ(-2, std::get<0>(U));\n EXPECT_EQ(-4, std::get<1>(U));\n EXPECT_EQ(6, std::get<2>(U));\n\n auto V = llvm::apply_tuple(\n [](int A, int B, int C) {\n return std::make_tuple(std::make_pair(A, char('A' + A)),\n std::make_pair(B, char('A' + B)),\n std::make_pair(C, char('A' + C)));\n },\n T);\n\n EXPECT_EQ(std::make_pair(1, 'B'), std::get<0>(V));\n EXPECT_EQ(std::make_pair(3, 'D'), std::get<1>(V));\n EXPECT_EQ(std::make_pair(7, 'H'), std::get<2>(V));\n}\n\nclass apply_variadic {\n static int apply_one(int X) { return X + 1; }\n static char apply_one(char C) { return C + 1; }\n static StringRef apply_one(StringRef S) { return S.drop_back(); }\n\npublic:\n template \n auto operator()(Ts &&... Items)\n -> decltype(std::make_tuple(apply_one(Items)...)) {\n return std::make_tuple(apply_one(Items)...);\n }\n};\n\nTEST(STLExtrasTest, ApplyTupleVariadic) {\n auto Items = std::make_tuple(1, llvm::StringRef(\"Test\"), 'X');\n auto Values = apply_tuple(apply_variadic(), Items);\n\n EXPECT_EQ(2, std::get<0>(Values));\n EXPECT_EQ(\"Tes\", std::get<1>(Values));\n EXPECT_EQ('Y', std::get<2>(Values));\n}\n\nTEST(STLExtrasTest, CountAdaptor) {\n std::vector v;\n\n v.push_back(1);\n v.push_back(2);\n v.push_back(1);\n v.push_back(4);\n v.push_back(3);\n v.push_back(2);\n v.push_back(1);\n\n EXPECT_EQ(3, count(v, 1));\n EXPECT_EQ(2, count(v, 2));\n EXPECT_EQ(1, count(v, 3));\n EXPECT_EQ(1, count(v, 4));\n}\n\nTEST(STLExtrasTest, ConcatRange) {\n std::vector Expected = {1, 2, 3, 4, 5, 6, 7, 8};\n std::vector Test;\n\n std::vector V1234 = {1, 2, 3, 4};\n std::list L56 = {5, 6};\n SmallVector SV78 = {7, 8};\n\n // Use concat across different sized ranges of different types with different\n // iterators.\n for (int &i : concat(V1234, L56, SV78))\n Test.push_back(i);\n EXPECT_EQ(Expected, Test);\n\n // Use concat between a temporary, an L-value, and an R-value to make sure\n // complex lifetimes work well.\n Test.clear();\n for (int &i : concat(std::vector(V1234), L56, std::move(SV78)))\n Test.push_back(i);\n EXPECT_EQ(Expected, Test);\n}\n\nTEST(STLExtrasTest, PartitionAdaptor) {\n std::vector V = {1, 2, 3, 4, 5, 6, 7, 8};\n\n auto I = partition(V, [](int i) { return i % 2 == 0; });\n ASSERT_EQ(V.begin() + 4, I);\n\n // Sort the two halves as partition may have messed with the order.\n std::sort(V.begin(), I);\n std::sort(I, V.end());\n\n EXPECT_EQ(2, V[0]);\n EXPECT_EQ(4, V[1]);\n EXPECT_EQ(6, V[2]);\n EXPECT_EQ(8, V[3]);\n EXPECT_EQ(1, V[4]);\n EXPECT_EQ(3, V[5]);\n EXPECT_EQ(5, V[6]);\n EXPECT_EQ(7, V[7]);\n}\n\nTEST(STLExtrasTest, EraseIf) {\n std::vector V = {1, 2, 3, 4, 5, 6, 7, 8};\n\n erase_if(V, [](int i) { return i % 2 == 0; });\n EXPECT_EQ(4u, V.size());\n EXPECT_EQ(1, V[0]);\n EXPECT_EQ(3, V[1]);\n EXPECT_EQ(5, V[2]);\n EXPECT_EQ(7, V[3]);\n}\n\n}\n"} +{"text": "[gd_scene load_steps=40 format=1]\n\n[ext_resource path=\"res://main/gui.gd\" type=\"Script\" id=1]\n[ext_resource path=\"res://gfx/turn_icon.png\" type=\"Texture\" id=2]\n[ext_resource path=\"res://shared/theme.tres\" type=\"Theme\" id=3]\n[ext_resource path=\"res://gfx/bomb.png\" type=\"Texture\" id=4]\n[ext_resource path=\"res://gfx/radioactive.png\" type=\"Texture\" id=5]\n[ext_resource path=\"res://gfx/flower.png\" type=\"Texture\" id=6]\n[ext_resource path=\"res://gfx/artefact.png\" type=\"Texture\" id=7]\n[ext_resource path=\"res://gfx/btn_arrow.png\" type=\"Texture\" id=8]\n[ext_resource path=\"res://gfx/btn_bomb.png\" type=\"Texture\" id=9]\n[ext_resource path=\"res://gfx/arrowv_normal.png\" type=\"Texture\" id=10]\n[ext_resource path=\"res://gfx/arrowv_used.png\" type=\"Texture\" id=11]\n[ext_resource path=\"res://main/resize_to_parent.gd\" type=\"Script\" id=12]\n[ext_resource path=\"res://gfx/arrowh_normal.png\" type=\"Texture\" id=13]\n[ext_resource path=\"res://gfx/arrowh_used.png\" type=\"Texture\" id=14]\n[ext_resource path=\"res://main/lookaround.gd\" type=\"Script\" id=15]\n[ext_resource path=\"res://fonts/papercut.fnt\" type=\"BitmapFont\" id=16]\n[ext_resource path=\"res://gfx/btn_alpha.png\" type=\"Texture\" id=17]\n[ext_resource path=\"res://gfx/larger.png\" type=\"Texture\" id=18]\n[ext_resource path=\"res://gfx/smaller.png\" type=\"Texture\" id=19]\n[ext_resource path=\"res://gfx/return.png\" type=\"Texture\" id=20]\n[ext_resource path=\"res://gfx/menuGrid.png\" type=\"Texture\" id=21]\n[ext_resource path=\"res://gfx/top_left_gui_cover.png\" type=\"Texture\" id=22]\n[ext_resource path=\"res://main/popup.tscn\" type=\"PackedScene\" id=23]\n[ext_resource path=\"res://main/level_holder.gd\" type=\"Script\" id=24]\n[ext_resource path=\"res://entities/player.tscn\" type=\"PackedScene\" id=25]\n[ext_resource path=\"res://audio/samples.tres\" type=\"SampleLibrary\" id=26]\n[ext_resource path=\"res://main/music.gd\" type=\"Script\" id=27]\n[ext_resource path=\"res://audio/music_1.ogg\" type=\"AudioStream\" id=28]\n[ext_resource path=\"res://audio/music_2.ogg\" type=\"AudioStream\" id=29]\n[ext_resource path=\"res://audio/music_3.ogg\" type=\"AudioStream\" id=30]\n[ext_resource path=\"res://audio/music_4.ogg\" type=\"AudioStream\" id=31]\n[ext_resource path=\"res://audio/music_5.ogg\" type=\"AudioStream\" id=32]\n\n[sub_resource type=\"Animation\" id=1]\n\nresource/name = \"disabled\"\nlength = 0.4\nloop = false\nstep = 0.1\ntracks/0/type = \"value\"\ntracks/0/path = NodePath(\"label:visibility/opacity\")\ntracks/0/interp = 1\ntracks/0/imported = false\ntracks/0/keys = {\n\"times\": FloatArray( 0, 0.4 ),\n\"transitions\": FloatArray( 0.25, 1 ),\n\"update\": 0,\n\"values\": [ 1.0, 0.0 ]\n}\ntracks/1/type = \"value\"\ntracks/1/path = NodePath(\"backdrop:visibility/opacity\")\ntracks/1/interp = 1\ntracks/1/imported = false\ntracks/1/keys = {\n\"times\": FloatArray( 0, 0.4 ),\n\"transitions\": FloatArray( 0.25, 1 ),\n\"update\": 0,\n\"values\": [ 1.0, 0.0 ]\n}\n\n[sub_resource type=\"Animation\" id=2]\n\nlength = 0.4\nloop = false\nstep = 0.1\ntracks/0/type = \"value\"\ntracks/0/path = NodePath(\"label:visibility/opacity\")\ntracks/0/interp = 1\ntracks/0/imported = false\ntracks/0/keys = {\n\"times\": FloatArray( 0, 0.4 ),\n\"transitions\": FloatArray( 0.25, 1 ),\n\"update\": 0,\n\"values\": [ 0.0, 1.0 ]\n}\ntracks/1/type = \"value\"\ntracks/1/path = NodePath(\"backdrop:visibility/opacity\")\ntracks/1/interp = 1\ntracks/1/imported = false\ntracks/1/keys = {\n\"times\": FloatArray( 0, 0.4 ),\n\"transitions\": FloatArray( 0.25, 1 ),\n\"update\": 0,\n\"values\": [ 0.0, 1.0 ]\n}\n\n[sub_resource type=\"StyleBoxEmpty\" id=3]\n\ncontent_margin/left = -1.0\ncontent_margin/right = -1.0\ncontent_margin/top = -1.0\ncontent_margin/bottom = -1.0\n\n[sub_resource type=\"StyleBoxEmpty\" id=4]\n\ncontent_margin/left = -1.0\ncontent_margin/right = -1.0\ncontent_margin/top = -1.0\ncontent_margin/bottom = -1.0\n\n[sub_resource type=\"StyleBoxEmpty\" id=5]\n\ncontent_margin/left = -1.0\ncontent_margin/right = -1.0\ncontent_margin/top = -1.0\ncontent_margin/bottom = -1.0\n\n[sub_resource type=\"StyleBoxEmpty\" id=6]\n\ncontent_margin/left = -1.0\ncontent_margin/right = -1.0\ncontent_margin/top = -1.0\ncontent_margin/bottom = -1.0\n\n[sub_resource type=\"StyleBoxEmpty\" id=7]\n\ncontent_margin/left = -1.0\ncontent_margin/right = -1.0\ncontent_margin/top = -1.0\ncontent_margin/bottom = -1.0\n\n[node name=\"world\" type=\"Node2D\"]\n\n__meta__ = {\n\"__editor_plugin_screen__\": \"2D\"\n}\n\n[node name=\"gui\" type=\"CanvasLayer\" parent=\".\"]\n\nprocess/pause_mode = 2\nlayer = 0\noffset = Vector2( 0, 0 )\nrotation = 0.0\nscale = Vector2( 1, 1 )\nscript/script = ExtResource( 1 )\n\n[node name=\"counters\" type=\"Control\" parent=\"gui\"]\n\nanchor/right = 1\nfocus/ignore_mouse = false\nfocus/stop_mouse = false\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 8.0\nmargin/top = 8.0\nmargin/right = 8.0\nmargin/bottom = 76.0\n\n[node name=\"resources\" type=\"Control\" parent=\"gui/counters\"]\n\nrect/min_size = Vector2( 150, 220 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = false\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 270.0\nmargin/right = 150.0\nmargin/bottom = 490.0\n\n[node name=\"turns\" type=\"HBoxContainer\" parent=\"gui/counters/resources\"]\n\neditor/display_folded = true\nrect/min_size = Vector2( 120, 32 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 124.0\nmargin/bottom = 40.0\nalignment = 0\n\n[node name=\"texture\" type=\"TextureFrame\" parent=\"gui/counters/resources/turns\"]\n\nrect/min_size = Vector2( 40, 40 )\nfocus/ignore_mouse = true\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 1\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 40.0\nmargin/bottom = 40.0\ntexture = ExtResource( 2 )\nexpand = true\nstretch_mode = 0\n\n[node name=\"label\" type=\"Label\" parent=\"gui/counters/resources/turns\"]\n\nrect/min_size = Vector2( 80, 40 )\nfocus/ignore_mouse = true\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 1\ntheme/theme = ExtResource( 3 )\nmargin/left = 44.0\nmargin/top = 0.0\nmargin/right = 124.0\nmargin/bottom = 40.0\ntext = \"0\"\nalign = 1\nvalign = 1\npercent_visible = 1.0\nlines_skipped = 0\nmax_lines_visible = -1\n\n[node name=\"bomb\" type=\"HBoxContainer\" parent=\"gui/counters/resources\"]\n\neditor/display_folded = true\nrect/min_size = Vector2( 120, 40 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 45.0\nmargin/right = 124.0\nmargin/bottom = 85.0\nalignment = 0\n\n[node name=\"texture\" type=\"TextureFrame\" parent=\"gui/counters/resources/bomb\"]\n\nrect/min_size = Vector2( 40, 40 )\nfocus/ignore_mouse = true\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 1\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 40.0\nmargin/bottom = 40.0\ntexture = ExtResource( 4 )\nexpand = true\nstretch_mode = 0\n\n[node name=\"label\" type=\"Label\" parent=\"gui/counters/resources/bomb\"]\n\nrect/min_size = Vector2( 80, 40 )\nfocus/ignore_mouse = true\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 1\ntheme/theme = ExtResource( 3 )\nmargin/left = 44.0\nmargin/top = 0.0\nmargin/right = 124.0\nmargin/bottom = 40.0\ntext = \" x 0\"\nvalign = 1\npercent_visible = 1.0\nlines_skipped = 0\nmax_lines_visible = -1\n\n[node name=\"box\" type=\"HBoxContainer\" parent=\"gui/counters/resources\"]\n\neditor/display_folded = true\nrect/min_size = Vector2( 120, 32 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 90.0\nmargin/right = 124.0\nmargin/bottom = 130.0\nalignment = 0\n\n[node name=\"texture\" type=\"TextureFrame\" parent=\"gui/counters/resources/box\"]\n\nrect/min_size = Vector2( 40, 40 )\nfocus/ignore_mouse = true\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 1\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 40.0\nmargin/bottom = 40.0\ntexture = ExtResource( 5 )\nexpand = true\nstretch_mode = 0\n\n[node name=\"label\" type=\"Label\" parent=\"gui/counters/resources/box\"]\n\nrect/min_size = Vector2( 80, 40 )\nfocus/ignore_mouse = true\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 1\ntheme/theme = ExtResource( 3 )\nmargin/left = 44.0\nmargin/top = 0.0\nmargin/right = 124.0\nmargin/bottom = 40.0\ntext = \"1 / 2\"\nalign = 1\nvalign = 1\npercent_visible = 1.0\nlines_skipped = 0\nmax_lines_visible = -1\n\n[node name=\"flower\" type=\"HBoxContainer\" parent=\"gui/counters/resources\"]\n\neditor/display_folded = true\nrect/min_size = Vector2( 120, 32 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 135.0\nmargin/right = 124.0\nmargin/bottom = 175.0\nalignment = 0\n\n[node name=\"texture\" type=\"TextureFrame\" parent=\"gui/counters/resources/flower\"]\n\nrect/min_size = Vector2( 40, 40 )\nfocus/ignore_mouse = true\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 1\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 40.0\nmargin/bottom = 40.0\ntexture = ExtResource( 6 )\nexpand = true\nstretch_mode = 0\n\n[node name=\"label\" type=\"Label\" parent=\"gui/counters/resources/flower\"]\n\nrect/min_size = Vector2( 80, 40 )\nfocus/ignore_mouse = true\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 1\ntheme/theme = ExtResource( 3 )\nmargin/left = 44.0\nmargin/top = 0.0\nmargin/right = 124.0\nmargin/bottom = 40.0\ntext = \"1 / 2\"\nalign = 1\nvalign = 1\npercent_visible = 1.0\nlines_skipped = 0\nmax_lines_visible = -1\n\n[node name=\"artefact\" type=\"HBoxContainer\" parent=\"gui/counters/resources\"]\n\neditor/display_folded = true\nrect/min_size = Vector2( 120, 32 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 180.0\nmargin/right = 124.0\nmargin/bottom = 220.0\nalignment = 0\n\n[node name=\"texture\" type=\"TextureFrame\" parent=\"gui/counters/resources/artefact\"]\n\nrect/min_size = Vector2( 40, 40 )\nfocus/ignore_mouse = true\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 1\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 40.0\nmargin/bottom = 40.0\ntexture = ExtResource( 7 )\nexpand = true\nstretch_mode = 0\n\n[node name=\"label\" type=\"Label\" parent=\"gui/counters/resources/artefact\"]\n\nrect/min_size = Vector2( 80, 40 )\nfocus/ignore_mouse = true\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 1\ntheme/theme = ExtResource( 3 )\nmargin/left = 44.0\nmargin/top = 0.0\nmargin/right = 124.0\nmargin/bottom = 40.0\ntext = \"1 / 2\"\nalign = 1\nvalign = 1\npercent_visible = 1.0\nlines_skipped = 0\nmax_lines_visible = -1\n\n[node name=\"touch_controls\" type=\"Control\" parent=\"gui\"]\n\neditor/display_folded = true\nvisibility/visible = false\nanchor/right = 1\nanchor/bottom = 1\nfocus/ignore_mouse = true\nfocus/stop_mouse = false\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 0.0\nmargin/bottom = 0.0\n\n[node name=\"buttons\" type=\"GridContainer\" parent=\"gui/touch_controls\"]\n\neditor/display_folded = true\nanchor/left = 1\nanchor/top = 1\nanchor/right = 1\nanchor/bottom = 1\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 224.0\nmargin/top = 224.0\nmargin/right = 0.0\nmargin/bottom = 0.0\ncustom_constants/vseparation = 16\ncustom_constants/hseparation = 16\ncolumns = 3\n\n[node name=\"hole-up-left\" type=\"Control\" parent=\"gui/touch_controls/buttons\"]\n\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 64.0\nmargin/bottom = 64.0\n\n[node name=\"up\" type=\"Control\" parent=\"gui/touch_controls/buttons\"]\n\neditor/display_folded = true\nrect/min_size = Vector2( 64, 64 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 80.0\nmargin/top = 0.0\nmargin/right = 144.0\nmargin/bottom = 64.0\n\n[node name=\"button\" type=\"TouchScreenButton\" parent=\"gui/touch_controls/buttons/up\"]\n\nnormal = ExtResource( 8 )\npressed = null\nbitmask = null\nshape = null\nshape_centered = true\nshape_visible = true\npassby_press = false\naction = \"btn_up\"\nvisibility_mode = 1\n\n[node name=\"hole-up-right\" type=\"Control\" parent=\"gui/touch_controls/buttons\"]\n\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 160.0\nmargin/top = 0.0\nmargin/right = 224.0\nmargin/bottom = 64.0\n\n[node name=\"left\" type=\"Control\" parent=\"gui/touch_controls/buttons\"]\n\neditor/display_folded = true\nrect/min_size = Vector2( 64, 64 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 80.0\nmargin/right = 64.0\nmargin/bottom = 144.0\n\n[node name=\"button\" type=\"TouchScreenButton\" parent=\"gui/touch_controls/buttons/left\"]\n\ntransform/pos = Vector2( 0, 64 )\ntransform/rot = 90.0\nnormal = ExtResource( 8 )\npressed = null\nbitmask = null\nshape = null\nshape_centered = true\nshape_visible = true\npassby_press = false\naction = \"btn_left\"\nvisibility_mode = 1\n\n[node name=\"bomb\" type=\"Control\" parent=\"gui/touch_controls/buttons\"]\n\neditor/display_folded = true\nrect/min_size = Vector2( 64, 64 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 80.0\nmargin/top = 80.0\nmargin/right = 144.0\nmargin/bottom = 144.0\n\n[node name=\"button\" type=\"TouchScreenButton\" parent=\"gui/touch_controls/buttons/bomb\"]\n\nnormal = ExtResource( 9 )\npressed = null\nbitmask = null\nshape = null\nshape_centered = true\nshape_visible = true\npassby_press = false\naction = \"place_bomb\"\nvisibility_mode = 1\n\n[node name=\"right\" type=\"Control\" parent=\"gui/touch_controls/buttons\"]\n\neditor/display_folded = true\nrect/min_size = Vector2( 64, 64 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 160.0\nmargin/top = 80.0\nmargin/right = 224.0\nmargin/bottom = 144.0\n\n[node name=\"button\" type=\"TouchScreenButton\" parent=\"gui/touch_controls/buttons/right\"]\n\ntransform/pos = Vector2( 64, 0 )\ntransform/rot = 270.0\nnormal = ExtResource( 8 )\npressed = null\nbitmask = null\nshape = null\nshape_centered = true\nshape_visible = true\npassby_press = false\naction = \"btn_right\"\nvisibility_mode = 1\n\n[node name=\"hole-down-left\" type=\"Control\" parent=\"gui/touch_controls/buttons\"]\n\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 160.0\nmargin/right = 64.0\nmargin/bottom = 224.0\n\n[node name=\"down\" type=\"Control\" parent=\"gui/touch_controls/buttons\"]\n\neditor/display_folded = true\nrect/min_size = Vector2( 64, 64 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 80.0\nmargin/top = 160.0\nmargin/right = 144.0\nmargin/bottom = 224.0\n\n[node name=\"button\" type=\"TouchScreenButton\" parent=\"gui/touch_controls/buttons/down\"]\n\ntransform/pos = Vector2( 64, 64 )\ntransform/rot = 180.0\nnormal = ExtResource( 8 )\npressed = null\nbitmask = null\nshape = null\nshape_centered = true\nshape_visible = true\npassby_press = false\naction = \"btn_down\"\nvisibility_mode = 1\n\n[node name=\"hole-down-right\" type=\"Control\" parent=\"gui/touch_controls/buttons\"]\n\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 160.0\nmargin/top = 160.0\nmargin/right = 224.0\nmargin/bottom = 224.0\n\n[node name=\"areas\" type=\"Control\" parent=\"gui/touch_controls\"]\n\neditor/display_folded = true\nanchor/right = 1\nanchor/bottom = 1\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 0.0\nmargin/bottom = 0.0\n\n[node name=\"sides\" type=\"VBoxContainer\" parent=\"gui/touch_controls/areas\"]\n\neditor/display_folded = true\nanchor/right = 1\nanchor/bottom = 1\nfocus/ignore_mouse = false\nfocus/stop_mouse = false\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 0.0\nmargin/bottom = 0.0\ncustom_constants/separation = 0\nalignment = 0\n\n[node name=\"up\" type=\"HBoxContainer\" parent=\"gui/touch_controls/areas/sides\"]\n\neditor/display_folded = true\nfocus/ignore_mouse = false\nfocus/stop_mouse = false\nsize_flags/horizontal = 3\nsize_flags/vertical = 3\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 1024.0\nmargin/bottom = 128.0\ncustom_constants/separation = 0\nalignment = 0\n\n[node name=\"hole-up-left\" type=\"Control\" parent=\"gui/touch_controls/areas/sides/up\"]\n\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 3\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 170.0\nmargin/bottom = 128.0\n\n[node name=\"up\" type=\"Control\" parent=\"gui/touch_controls/areas/sides/up\"]\n\neditor/display_folded = true\nrect/min_size = Vector2( 64, 64 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 3\nsize_flags/stretch_ratio = 4.0\nmargin/left = 170.0\nmargin/top = 0.0\nmargin/right = 852.0\nmargin/bottom = 128.0\n\n[node name=\"button\" type=\"TouchScreenButton\" parent=\"gui/touch_controls/areas/sides/up/up\"]\n\nvisibility/opacity = 0.5\ntransform/pos = Vector2( 682, 0 )\ntransform/scale = Vector2( 0.994169, 1 )\nnormal = ExtResource( 10 )\npressed = ExtResource( 11 )\nbitmask = null\nshape = null\nshape_centered = true\nshape_visible = true\npassby_press = false\naction = \"btn_up\"\nvisibility_mode = 1\nscript/script = ExtResource( 12 )\noffset = 0\ncentered = false\n\n[node name=\"hole-up-right\" type=\"Control\" parent=\"gui/touch_controls/areas/sides/up\"]\n\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 3\nmargin/left = 852.0\nmargin/top = 0.0\nmargin/right = 1024.0\nmargin/bottom = 128.0\n\n[node name=\"center\" type=\"HBoxContainer\" parent=\"gui/touch_controls/areas/sides\"]\n\neditor/display_folded = true\nfocus/ignore_mouse = false\nfocus/stop_mouse = false\nsize_flags/horizontal = 3\nsize_flags/vertical = 3\nsize_flags/stretch_ratio = 4.0\nmargin/left = 0.0\nmargin/top = 128.0\nmargin/right = 1024.0\nmargin/bottom = 640.0\ncustom_constants/separation = 0\nalignment = 0\n\n[node name=\"left\" type=\"Control\" parent=\"gui/touch_controls/areas/sides/center\"]\n\nrect/min_size = Vector2( 64, 64 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 3\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 170.0\nmargin/bottom = 512.0\n\n[node name=\"button\" type=\"TouchScreenButton\" parent=\"gui/touch_controls/areas/sides/center/left\"]\n\nvisibility/opacity = 0.5\ntransform/pos = Vector2( 170, 0 )\ntransform/scale = Vector2( 1.32812, 1 )\nnormal = ExtResource( 13 )\npressed = ExtResource( 14 )\nbitmask = null\nshape = null\nshape_centered = true\nshape_visible = true\npassby_press = false\naction = \"btn_left\"\nvisibility_mode = 1\nscript/script = ExtResource( 12 )\noffset = 0\ncentered = false\n\n[node name=\"hole-center\" type=\"Control\" parent=\"gui/touch_controls/areas/sides/center\"]\n\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 3\nsize_flags/stretch_ratio = 4.0\nmargin/left = 170.0\nmargin/top = 0.0\nmargin/right = 852.0\nmargin/bottom = 512.0\n\n[node name=\"right\" type=\"Control\" parent=\"gui/touch_controls/areas/sides/center\"]\n\nrect/min_size = Vector2( 64, 64 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 3\nmargin/left = 852.0\nmargin/top = 0.0\nmargin/right = 1024.0\nmargin/bottom = 512.0\n\n[node name=\"button\" type=\"TouchScreenButton\" parent=\"gui/touch_controls/areas/sides/center/right\"]\n\nvisibility/opacity = 0.5\ntransform/pos = Vector2( 172, 0 )\ntransform/rot = 180.0\ntransform/scale = Vector2( 1.34375, 1 )\nnormal = ExtResource( 13 )\npressed = ExtResource( 14 )\nbitmask = null\nshape = null\nshape_centered = true\nshape_visible = true\npassby_press = false\naction = \"btn_right\"\nvisibility_mode = 1\nscript/script = ExtResource( 12 )\noffset = 0\ncentered = false\n\n[node name=\"down\" type=\"HBoxContainer\" parent=\"gui/touch_controls/areas/sides\"]\n\neditor/display_folded = true\nfocus/ignore_mouse = false\nfocus/stop_mouse = false\nsize_flags/horizontal = 3\nsize_flags/vertical = 3\nmargin/left = 0.0\nmargin/top = 640.0\nmargin/right = 1024.0\nmargin/bottom = 768.0\ncustom_constants/separation = 0\nalignment = 0\n\n[node name=\"hole-down-left\" type=\"Control\" parent=\"gui/touch_controls/areas/sides/down\"]\n\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 3\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 170.0\nmargin/bottom = 128.0\n\n[node name=\"down\" type=\"Control\" parent=\"gui/touch_controls/areas/sides/down\"]\n\neditor/display_folded = true\nrect/min_size = Vector2( 64, 64 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 3\nsize_flags/stretch_ratio = 4.0\nmargin/left = 170.0\nmargin/top = 0.0\nmargin/right = 852.0\nmargin/bottom = 128.0\n\n[node name=\"button\" type=\"TouchScreenButton\" parent=\"gui/touch_controls/areas/sides/down/down\"]\n\nvisibility/opacity = 0.5\ntransform/pos = Vector2( 682, 0 )\ntransform/rot = 180.0\ntransform/scale = Vector2( 0.994169, 1 )\nnormal = ExtResource( 10 )\npressed = ExtResource( 11 )\nbitmask = null\nshape = null\nshape_centered = true\nshape_visible = true\npassby_press = false\naction = \"btn_down\"\nvisibility_mode = 1\nscript/script = ExtResource( 12 )\noffset = 0\ncentered = false\n\n[node name=\"bomb\" type=\"Control\" parent=\"gui/touch_controls/areas/sides/down\"]\n\neditor/display_folded = true\nrect/min_size = Vector2( 70, 70 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 3\nmargin/left = 852.0\nmargin/top = 0.0\nmargin/right = 1024.0\nmargin/bottom = 128.0\n\n[node name=\"button\" type=\"TouchScreenButton\" parent=\"gui/touch_controls/areas/sides/down/bomb\"]\n\ntransform/pos = Vector2( 6, 6 )\nnormal = ExtResource( 9 )\npressed = null\nbitmask = null\nshape = null\nshape_centered = true\nshape_visible = true\npassby_press = false\naction = \"place_bomb\"\nvisibility_mode = 1\n\n[node name=\"lookaround\" type=\"Control\" parent=\"gui\"]\n\nprocess/pause_mode = 2\neditor/display_folded = true\nanchor/right = 1\nanchor/bottom = 1\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 0.0\nmargin/bottom = 0.0\nscript/script = ExtResource( 15 )\n\n[node name=\"label\" type=\"Label\" parent=\"gui/lookaround\"]\n\nvisibility/opacity = 0.0\nanchor/top = 1\nanchor/right = 1\nanchor/bottom = 1\nfocus/ignore_mouse = true\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 0\nmargin/left = 0.0\nmargin/top = 103.0\nmargin/right = 0.0\nmargin/bottom = 0.0\ncustom_fonts/font = ExtResource( 16 )\ncustom_colors/font_color = Color( 0, 0, 0, 1 )\ncustom_colors/font_color_shadow = Color( 1, 1, 1, 1 )\ncustom_constants/shadow_offset_x = 1\ncustom_constants/shadow_offset_y = 1\ncustom_constants/shadow_as_outline = 1\ntext = \"Drag to look around the level; press the zoom-out button again to reset.\"\nalign = 1\npercent_visible = 1.0\nlines_skipped = 0\nmax_lines_visible = -1\n\n[node name=\"backdrop\" type=\"Sprite\" parent=\"gui/lookaround\"]\n\nvisibility/opacity = 0.0\nvisibility/behind_parent = true\ntransform/pos = Vector2( 1024, 0 )\ntransform/scale = Vector2( 512, 384 )\ntexture = ExtResource( 17 )\ncentered = false\nscript/script = ExtResource( 12 )\noffset = 0\ncentered = false\n\n[node name=\"Tween\" type=\"Tween\" parent=\"gui/lookaround\"]\n\nplayback/process_mode = 1\nplayback/active = false\nplayback/repeat = false\nplayback/speed = 1.0\n\n[node name=\"AnimationPlayer\" type=\"AnimationPlayer\" parent=\"gui/lookaround\"]\n\nplayback/process_mode = 1\nplayback/default_blend_time = 0.0\nroot/root = NodePath(\"..\")\nanims/disabled = SubResource( 1 )\nanims/enabled = SubResource( 2 )\nplayback/active = true\nplayback/speed = 1.0\nblend_times = [ ]\nautoplay = \"\"\n\n[node name=\"top_left_buttons\" type=\"Control\" parent=\"gui\"]\n\nanchor/right = 1\nanchor/bottom = 1\nrect/min_size = Vector2( 1024, 100 )\nfocus/ignore_mouse = false\nfocus/stop_mouse = false\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 0.0\nmargin/bottom = 668.0\n\n[node name=\"look\" type=\"TextureButton\" parent=\"gui/top_left_buttons\"]\n\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 100.0\nmargin/bottom = 100.0\ntoggle_mode = true\nenabled_focus_mode = 2\nshortcut = null\ntextures/normal = ExtResource( 18 )\ntextures/pressed = ExtResource( 19 )\nparams/resize_mode = 0\nparams/stretch_mode = 0\n\n[node name=\"speed\" type=\"Button\" parent=\"gui/top_left_buttons\"]\n\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 100.0\nmargin/top = 0.0\nmargin/right = 200.0\nmargin/bottom = 100.0\ncustom_styles/hover = SubResource( 3 )\ncustom_styles/pressed = SubResource( 4 )\ncustom_styles/focus = SubResource( 5 )\ncustom_styles/disabled = SubResource( 6 )\ncustom_styles/normal = SubResource( 7 )\ntoggle_mode = false\nenabled_focus_mode = 2\nshortcut = null\nflat = true\nclip_text = true\n\n[node name=\"text\" type=\"Label\" parent=\"gui/top_left_buttons/speed\"]\n\nrect/min_size = Vector2( 40, 40 )\nrect/scale = Vector2( 2.5, 2.5 )\nfocus/ignore_mouse = true\nfocus/stop_mouse = true\nsize_flags/horizontal = 3\nsize_flags/vertical = 3\ntheme/theme = ExtResource( 3 )\nmargin/left = 0.0\nmargin/top = 0.0\nmargin/right = 40.0\nmargin/bottom = 40.0\ntext = \"x1\"\nalign = 1\nvalign = 1\npercent_visible = 1.0\nlines_skipped = 0\nmax_lines_visible = -1\n\n[node name=\"retry\" type=\"TextureButton\" parent=\"gui/top_left_buttons\"]\n\nfocus/ignore_mouse = false\nfocus/stop_mouse = false\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 854.0\nmargin/top = 0.0\nmargin/right = 954.0\nmargin/bottom = 100.0\ntoggle_mode = true\nenabled_focus_mode = 2\nshortcut = null\ntextures/normal = ExtResource( 20 )\nparams/resize_mode = 0\nparams/stretch_mode = 0\n\n[node name=\"menu\" type=\"TextureButton\" parent=\"gui/top_left_buttons\"]\n\nfocus/ignore_mouse = false\nfocus/stop_mouse = true\nsize_flags/horizontal = 2\nsize_flags/vertical = 2\nmargin/left = 954.0\nmargin/top = 0.0\nmargin/right = 1054.0\nmargin/bottom = 100.0\ntoggle_mode = false\nenabled_focus_mode = 2\nshortcut = null\ntextures/normal = ExtResource( 21 )\nparams/resize_mode = 0\nparams/stretch_mode = 0\n\n[node name=\"backdrop\" type=\"Sprite\" parent=\"gui/top_left_buttons\"]\n\nvisibility/behind_parent = true\ntransform/scale = Vector2( 100, 50 )\ntexture = ExtResource( 22 )\ncentered = false\nmodulate = Color( 0.5, 0.8, 1, 1 )\n\n[node name=\"popup\" parent=\"gui\" instance=ExtResource( 23 )]\n\nvisibility/visible = false\n\n[node name=\"timer\" type=\"Timer\" parent=\"gui\"]\n\nprocess_mode = 1\nwait_time = 1.0\none_shot = true\nautostart = false\n\n[node name=\"level_holder\" type=\"Node2D\" parent=\".\"]\n\nscript/script = ExtResource( 24 )\nacid_animation_time = 1.0\n\n[node name=\"player_holder\" type=\"Node2D\" parent=\".\"]\n\ntransform/pos = Vector2( 32, 32 )\n\n[node name=\"player\" parent=\"player_holder\" instance=ExtResource( 25 )]\n\ntransform/pos = Vector2( 228.814, 197.081 )\n\n[node name=\"sample_player\" type=\"SamplePlayer\" parent=\".\"]\n\nconfig/polyphony = 1\nconfig/samples = ExtResource( 26 )\ndefault/volume_db = -7.0\ndefault/pitch_scale = 1.0\ndefault/pan = 0.0\ndefault/depth = 0.0\ndefault/height = 0.0\ndefault/filter/type = 0\ndefault/filter/cutoff = 0.0\ndefault/filter/resonance = 0.0\ndefault/filter/gain = 0.0\ndefault/reverb_room = 2\ndefault/reverb_send = 0.0\ndefault/chorus_send = 0.0\n\n[node name=\"music\" type=\"Node\" parent=\".\"]\n\neditor/display_folded = true\nscript/script = ExtResource( 27 )\n\n[node name=\"1\" type=\"StreamPlayer\" parent=\"music\"]\n\nstream/stream = ExtResource( 28 )\nstream/play = false\nstream/loop = true\nstream/volume_db = -2.0\nstream/autoplay = false\nstream/paused = false\nstream/loop_restart_time = 0.0\nstream/buffering_ms = 500\n\n[node name=\"2\" type=\"StreamPlayer\" parent=\"music\"]\n\nstream/stream = ExtResource( 29 )\nstream/play = false\nstream/loop = true\nstream/volume_db = -9.0\nstream/autoplay = false\nstream/paused = false\nstream/loop_restart_time = 0.0\nstream/buffering_ms = 500\n\n[node name=\"3\" type=\"StreamPlayer\" parent=\"music\"]\n\nstream/stream = ExtResource( 30 )\nstream/play = false\nstream/loop = true\nstream/volume_db = -2.0\nstream/autoplay = false\nstream/paused = false\nstream/loop_restart_time = 0.0\nstream/buffering_ms = 500\n\n[node name=\"4\" type=\"StreamPlayer\" parent=\"music\"]\n\nstream/stream = ExtResource( 31 )\nstream/play = false\nstream/loop = true\nstream/volume_db = -6.0\nstream/autoplay = false\nstream/paused = false\nstream/loop_restart_time = 0.0\nstream/buffering_ms = 500\n\n[node name=\"5\" type=\"StreamPlayer\" parent=\"music\"]\n\nstream/stream = ExtResource( 32 )\nstream/play = false\nstream/loop = true\nstream/volume_db = 0.0\nstream/autoplay = false\nstream/paused = false\nstream/loop_restart_time = 0.0\nstream/buffering_ms = 500\n\n\n"} +{"text": "\n\n\n \n"} +{"text": "@REM ----------------------------------------------------------------------------\n@REM Licensed to the Apache Software Foundation (ASF) under one\n@REM or more contributor license agreements. See the NOTICE file\n@REM distributed with this work for additional information\n@REM regarding copyright ownership. The ASF licenses this file\n@REM to you under the Apache License, Version 2.0 (the\n@REM \"License\"); you may not use this file except in compliance\n@REM with the License. You may obtain a copy of the License at\n@REM\n@REM http://www.apache.org/licenses/LICENSE-2.0\n@REM\n@REM Unless required by applicable law or agreed to in writing,\n@REM software distributed under the License is distributed on an\n@REM \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n@REM KIND, either express or implied. See the License for the\n@REM specific language governing permissions and limitations\n@REM under the License.\n@REM ----------------------------------------------------------------------------\n\n@REM ----------------------------------------------------------------------------\n@REM Maven2 Start Up Batch script\n@REM\n@REM Required ENV vars:\n@REM JAVA_HOME - location of a JDK home dir\n@REM\n@REM Optional ENV vars\n@REM M2_HOME - location of maven2's installed home dir\n@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands\n@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending\n@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven\n@REM e.g. to debug Maven itself, use\n@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000\n@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files\n@REM ----------------------------------------------------------------------------\n\n@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'\n@echo off\n@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'\n@if \"%MAVEN_BATCH_ECHO%\" == \"on\" echo %MAVEN_BATCH_ECHO%\n\n@REM set %HOME% to equivalent of $HOME\nif \"%HOME%\" == \"\" (set \"HOME=%HOMEDRIVE%%HOMEPATH%\")\n\n@REM Execute a user defined script before this one\nif not \"%MAVEN_SKIP_RC%\" == \"\" goto skipRcPre\n@REM check for pre script, once with legacy .bat ending and once with .cmd ending\nif exist \"%HOME%\\mavenrc_pre.bat\" call \"%HOME%\\mavenrc_pre.bat\"\nif exist \"%HOME%\\mavenrc_pre.cmd\" call \"%HOME%\\mavenrc_pre.cmd\"\n:skipRcPre\n\n@setlocal\n\nset ERROR_CODE=0\n\n@REM To isolate internal variables from possible post scripts, we use another setlocal\n@setlocal\n\n@REM ==== START VALIDATION ====\nif not \"%JAVA_HOME%\" == \"\" goto OkJHome\n\necho.\necho Error: JAVA_HOME not found in your environment. >&2\necho Please set the JAVA_HOME variable in your environment to match the >&2\necho location of your Java installation. >&2\necho.\ngoto error\n\n:OkJHome\nif exist \"%JAVA_HOME%\\bin\\java.exe\" goto init\n\necho.\necho Error: JAVA_HOME is set to an invalid directory. >&2\necho JAVA_HOME = \"%JAVA_HOME%\" >&2\necho Please set the JAVA_HOME variable in your environment to match the >&2\necho location of your Java installation. >&2\necho.\ngoto error\n\n@REM ==== END VALIDATION ====\n\n:init\n\n@REM Find the project base dir, i.e. the directory that contains the folder \".mvn\".\n@REM Fallback to current working directory if not found.\n\nset MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%\nIF NOT \"%MAVEN_PROJECTBASEDIR%\"==\"\" goto endDetectBaseDir\n\nset EXEC_DIR=%CD%\nset WDIR=%EXEC_DIR%\n:findBaseDir\nIF EXIST \"%WDIR%\"\\.mvn goto baseDirFound\ncd ..\nIF \"%WDIR%\"==\"%CD%\" goto baseDirNotFound\nset WDIR=%CD%\ngoto findBaseDir\n\n:baseDirFound\nset MAVEN_PROJECTBASEDIR=%WDIR%\ncd \"%EXEC_DIR%\"\ngoto endDetectBaseDir\n\n:baseDirNotFound\nset MAVEN_PROJECTBASEDIR=%EXEC_DIR%\ncd \"%EXEC_DIR%\"\n\n:endDetectBaseDir\n\nIF NOT EXIST \"%MAVEN_PROJECTBASEDIR%\\.mvn\\jvm.config\" goto endReadAdditionalConfig\n\n@setlocal EnableExtensions EnableDelayedExpansion\nfor /F \"usebackq delims=\" %%a in (\"%MAVEN_PROJECTBASEDIR%\\.mvn\\jvm.config\") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a\n@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%\n\n:endReadAdditionalConfig\n\nSET MAVEN_JAVA_EXE=\"%JAVA_HOME%\\bin\\java.exe\"\n\nset WRAPPER_JAR=\"%MAVEN_PROJECTBASEDIR%\\.mvn\\wrapper\\maven-wrapper.jar\"\nset WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain\n\n%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% \"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%\" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*\nif ERRORLEVEL 1 goto error\ngoto end\n\n:error\nset ERROR_CODE=1\n\n:end\n@endlocal & set ERROR_CODE=%ERROR_CODE%\n\nif not \"%MAVEN_SKIP_RC%\" == \"\" goto skipRcPost\n@REM check for post script, once with legacy .bat ending and once with .cmd ending\nif exist \"%HOME%\\mavenrc_post.bat\" call \"%HOME%\\mavenrc_post.bat\"\nif exist \"%HOME%\\mavenrc_post.cmd\" call \"%HOME%\\mavenrc_post.cmd\"\n:skipRcPost\n\n@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'\nif \"%MAVEN_BATCH_PAUSE%\" == \"on\" pause\n\nif \"%MAVEN_TERMINATE_CMD%\" == \"on\" exit %ERROR_CODE%\n\nexit /B %ERROR_CODE%\n"} +{"text": "/* SPDX-License-Identifier: GPL-2.0 */\n#ifndef __USBMIXER_H\n#define __USBMIXER_H\n\n#include \n\nstruct media_mixer_ctl;\n\nstruct usbmix_connector_map {\n\tu8 id;\n\tu8 delegated_id;\n\tu8 control;\n\tu8 channel;\n};\n\nstruct usb_mixer_interface {\n\tstruct snd_usb_audio *chip;\n\tstruct usb_host_interface *hostif;\n\tstruct list_head list;\n\tunsigned int ignore_ctl_error;\n\tstruct urb *urb;\n\t/* array[MAX_ID_ELEMS], indexed by unit id */\n\tstruct usb_mixer_elem_list **id_elems;\n\n\t/* the usb audio specification version this interface complies to */\n\tint protocol;\n\n\t/* optional connector delegation map */\n\tconst struct usbmix_connector_map *connector_map;\n\n\t/* Sound Blaster remote control stuff */\n\tconst struct rc_config *rc_cfg;\n\tu32 rc_code;\n\twait_queue_head_t rc_waitq;\n\tstruct urb *rc_urb;\n\tstruct usb_ctrlrequest *rc_setup_packet;\n\tu8 rc_buffer[6];\n\tstruct media_mixer_ctl *media_mixer_ctl;\n\n\tbool disconnected;\n\n\tvoid *private_data;\n\tvoid (*private_free)(struct usb_mixer_interface *mixer);\n\tvoid (*private_suspend)(struct usb_mixer_interface *mixer);\n};\n\n#define MAX_CHANNELS\t16\t/* max logical channels */\n\nenum {\n\tUSB_MIXER_BOOLEAN,\n\tUSB_MIXER_INV_BOOLEAN,\n\tUSB_MIXER_S8,\n\tUSB_MIXER_U8,\n\tUSB_MIXER_S16,\n\tUSB_MIXER_U16,\n\tUSB_MIXER_S32,\n\tUSB_MIXER_U32,\n};\n\ntypedef void (*usb_mixer_elem_dump_func_t)(struct snd_info_buffer *buffer,\n\t\t\t\t\t struct usb_mixer_elem_list *list);\ntypedef int (*usb_mixer_elem_resume_func_t)(struct usb_mixer_elem_list *elem);\n\nstruct usb_mixer_elem_list {\n\tstruct usb_mixer_interface *mixer;\n\tstruct usb_mixer_elem_list *next_id_elem; /* list of controls with same id */\n\tstruct snd_kcontrol *kctl;\n\tunsigned int id;\n\tbool is_std_info;\n\tusb_mixer_elem_dump_func_t dump;\n\tusb_mixer_elem_resume_func_t resume;\n};\n\n/* iterate over mixer element list of the given unit id */\n#define for_each_mixer_elem(list, mixer, id)\t\\\n\tfor ((list) = (mixer)->id_elems[id]; (list); (list) = (list)->next_id_elem)\n#define mixer_elem_list_to_info(list) \\\n\tcontainer_of(list, struct usb_mixer_elem_info, head)\n\nstruct usb_mixer_elem_info {\n\tstruct usb_mixer_elem_list head;\n\tunsigned int control;\t/* CS or ICN (high byte) */\n\tunsigned int cmask; /* channel mask bitmap: 0 = master */\n\tunsigned int idx_off; /* Control index offset */\n\tunsigned int ch_readonly;\n\tunsigned int master_readonly;\n\tint channels;\n\tint val_type;\n\tint min, max, res;\n\tint dBmin, dBmax;\n\tint cached;\n\tint cache_val[MAX_CHANNELS];\n\tu8 initialized;\n\tu8 min_mute;\n\tvoid *private_data;\n};\n\nint snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,\n\t\t\t int ignore_error);\nvoid snd_usb_mixer_disconnect(struct usb_mixer_interface *mixer);\n\nvoid snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid);\n\nint snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,\n\t\t\t\tint request, int validx, int value_set);\n\nint snd_usb_mixer_add_list(struct usb_mixer_elem_list *list,\n\t\t\t struct snd_kcontrol *kctl,\n\t\t\t bool is_std_info);\n\n#define snd_usb_mixer_add_control(list, kctl) \\\n\tsnd_usb_mixer_add_list(list, kctl, true)\n\nvoid snd_usb_mixer_elem_init_std(struct usb_mixer_elem_list *list,\n\t\t\t\t struct usb_mixer_interface *mixer,\n\t\t\t\t int unitid);\n\nint snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag,\n\t\t\t unsigned int size, unsigned int __user *_tlv);\n\n#ifdef CONFIG_PM\nint snd_usb_mixer_suspend(struct usb_mixer_interface *mixer);\nint snd_usb_mixer_resume(struct usb_mixer_interface *mixer, bool reset_resume);\n#endif\n\nint snd_usb_set_cur_mix_value(struct usb_mixer_elem_info *cval, int channel,\n int index, int value);\n\nint snd_usb_get_cur_mix_value(struct usb_mixer_elem_info *cval,\n int channel, int index, int *value);\n\nextern void snd_usb_mixer_elem_free(struct snd_kcontrol *kctl);\n\nextern const struct snd_kcontrol_new *snd_usb_feature_unit_ctl;\n\n#endif /* __USBMIXER_H */\n"} +{"text": "/* -*- c++ -*- */\n/*\n * @file\n * @author (C) 2014-2016 by Piotr Krysik \n * @section LICENSE\n *\n * Gr-gsm 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, or (at your option)\n * any later version.\n *\n * Gr-gsm 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 gr-gsm; see the file COPYING. If not, write to\n * the Free Software Foundation, Inc., 51 Franklin Street,\n * Boston, MA 02110-1301, USA.\n */\n\n\n#ifndef INCLUDED_GSM_UNIVERSAL_CTRL_CHANS_DEMAPPER_H\n#define INCLUDED_GSM_UNIVERSAL_CTRL_CHANS_DEMAPPER_H\n\n#include \n#include \n#include \n\nnamespace gr {\n namespace gsm {\n\n /*!\n * \\brief <+description of block+>\n * \\ingroup gsm\n *\n */\n class GRGSM_API universal_ctrl_chans_demapper : virtual public gr::block\n {\n public:\n typedef boost::shared_ptr sptr;\n\n /*!\n * \\brief Return a shared_ptr to a new instance of gsm::universal_ctrl_chans_demapper.\n *\n * To avoid accidental use of raw pointers, gsm::universal_ctrl_chans_demapper's\n * constructor is in a private implementation\n * class. gsm::universal_ctrl_chans_demapper::make is the public interface for\n * creating new instances.\n */\n static sptr make(unsigned int timeslot_nr, const std::vector &downlink_starts_fn_mod51, const std::vector &downlink_channel_types, const std::vector &downlink_subslots, const std::vector &uplink_starts_fn_mod51=std::vector(), const std::vector &uplink_channel_types=std::vector(), const std::vector &uplink_subslots=std::vector());\n };\n\n } // namespace gsm\n} // namespace gr\n\n#endif /* INCLUDED_GSM_UNIVERSAL_CTRL_CHANS_DEMAPPER_H */\n\n"} +{"text": "/*\r\n * #%L\r\n * Service Activity Monitoring :: Agent\r\n * %%\r\n * Copyright (C) 2011-2019 Talend Inc.\r\n * %%\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * #L%\r\n */\r\n\r\npackage org.talend.esb.sam.agent.eventadmin.translator;\r\n\r\nimport java.util.Date;\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\nimport java.util.UUID;\r\n\r\nimport org.talend.esb.sam.agent.eventadmin.translator.subject.SamlTokenSubjectExtractor;\r\nimport org.talend.esb.sam.agent.eventadmin.translator.subject.SubjectExtractor;\r\nimport org.talend.esb.sam.agent.eventadmin.translator.subject.UsernameTokenSubjectExtractor;\r\nimport org.talend.esb.sam.common.event.Event;\r\nimport org.talend.esb.sam.common.event.EventTypeEnum;\r\n\r\npublic class SamEventTranslator {\r\n\r\n\tpublic static final String SAM_EVENT_TYPE = \"SAMEvent\";\r\n\r\n\tpublic static final String ID = \"id\";\r\n\r\n\tpublic static final String EVENT_UUID = \"eventUUID\";\r\n\r\n\tpublic static final String CORRELATION_ID = \"correlationId\";\r\n\r\n\tpublic static final String CATEGORY = \"category\";\r\n\r\n\tpublic static final String EVENT_TYPE = \"eventType\";\r\n\r\n\tpublic static final String SEVERITY = \"severity\";\r\n\r\n\tpublic static final String LOG_MESSAGE = \"logMessage\";\r\n\r\n\tpublic static final String LOG_SOURCE = \"logSource\";\r\n\r\n\tpublic static final String SIGNED_LOG_MESSAGE = \"signedLogMessage\";\r\n\r\n\tpublic static final String LOG_TIMESTAMP = \"logTimestamp\";\r\n\r\n\tpublic static final String AGENT_ID = \"agentId\";\r\n\r\n\tpublic static final String AGENT_TIMESTAMP = \"agentTimestamp\";\r\n\r\n\tpublic static final String SERVER_TIMESTAMP = \"serverTimestamp\";\r\n\r\n\tpublic static final String AUDIT = \"audit\";\r\n\r\n\tpublic static final String AUDIT_SEQUENCE_NO = \"auditSequenceNo\";\r\n\r\n\tpublic static final String PRINCIPAL = \"principal\";\r\n\r\n\tpublic static final String CUSTOM_INFO = \"customInfo\";\r\n\r\n\t/** Identifier for hostname within log source attribute */\r\n\tpublic static final String LS_HOSTNAME = \"host.name\";\r\n\t/** Identifier for processId within log source attribute */\r\n\tpublic static final String LS_PROCESS_ID = \"process.id\";\r\n\tpublic static final String LS_HOST_IP = \"host.ip\";\r\n\r\n\t/* Custom Info */\r\n\tpublic static final String PORT_TYPE = \"port.type\";\r\n\r\n\tpublic static final String TRANSPORT_TYPE = \"transport.type\";\r\n\r\n\tpublic static final String OPERATION_NAME = \"operation.name\";\r\n\r\n\tpublic static final String MESSAGE_ID = \"message.id\";\r\n\r\n\tpublic static final String FLOW_ID = \"flow.id\";\r\n\r\n\tpublic static final String EVENT_TYPE_CUSTOM = \"event.type\";\r\n\r\n\tpublic static final String CONTENT_CUT = \"content.cut\";\r\n\r\n\tpublic SamEventTranslator() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\tprotected static String getEventType() {\r\n\t\treturn \"SAMEvent\";\r\n\t}\r\n\r\n\tprotected static Boolean getAudit() {\r\n\t\t// not implemented\r\n\t\treturn Boolean.FALSE;\r\n\t}\r\n\r\n\tprotected static String getAuditSequenceNo() {\r\n\t\t// not implemented\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tprotected static String getCategory() {\r\n\t\t// not implemented\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tprotected static String getSignedLogMessage(Event samEvent) {\r\n\t\t// not implemented\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tprotected static String getAgentID(Event samEvent) {\r\n\t\t// not implemented\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tprotected static boolean isUsernameTokenMappingEnabled() {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tprotected static boolean isSamlTokenMappingEnabled() {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tprotected static Map getCustomInfo(Event samEvent) {\r\n\t\tMap customInfo = new HashMap();\r\n\t\tcustomInfo.put(MESSAGE_ID, samEvent.getMessageInfo().getMessageId());\r\n\t\tcustomInfo.put(FLOW_ID, samEvent.getMessageInfo().getFlowId());\r\n\t\tcustomInfo.put(OPERATION_NAME, samEvent.getMessageInfo().getOperationName());\r\n\t\tcustomInfo.put(TRANSPORT_TYPE, samEvent.getMessageInfo().getTransportType());\r\n\t\tcustomInfo.put(PORT_TYPE, samEvent.getMessageInfo().getPortType());\r\n\t\tcustomInfo.put(CONTENT_CUT, Boolean.toString(samEvent.isContentCut()));\r\n\t\tcustomInfo.put(EVENT_TYPE_CUSTOM, samEvent.getEventType().toString());\r\n\r\n\r\n\t\tMap samCustomInfo = samEvent.getCustomInfo();\r\n\t\tif (null != samCustomInfo) {\r\n\t\t\tcustomInfo.putAll(samCustomInfo);\r\n\t\t\tcustomInfo.remove(CORRELATION_ID);\r\n\t\t}\r\n\r\n\t\treturn customInfo;\r\n\t}\r\n\r\n\tprotected static String getEventUUID(Event samEvent) throws Exception {\r\n\t\treturn UUID.randomUUID().toString();\r\n\t}\r\n\r\n\tpublic static org.osgi.service.event.Event translate(Event samEvent, String topic) throws Exception {\r\n\r\n\t\tMap m = new HashMap();\r\n\t\tif (samEvent != null && samEvent.getMessageInfo() != null) {\r\n\t\t\tm.put(EVENT_UUID, getEventUUID(samEvent));\r\n\t\t\tm.put(CORRELATION_ID, getCorrelationID(samEvent));\r\n\t\t\tm.put(CATEGORY, getCategory());\r\n\t\t\tm.put(EVENT_TYPE, SAM_EVENT_TYPE);\r\n\t\t\tm.put(SEVERITY, getSeverity(samEvent.getEventType()));\r\n\t\t\tm.put(LOG_MESSAGE, getLogMessage(samEvent));\r\n\t\t\tm.put(LOG_SOURCE, getLogSource(samEvent));\r\n\t\t\tm.put(SIGNED_LOG_MESSAGE, getSignedLogMessage(samEvent));\r\n\t\t\tm.put(LOG_TIMESTAMP, getEventTimestamp(samEvent));\r\n\t\t\tm.put(AGENT_ID, getAgentID(samEvent));\r\n\t\t\tm.put(AGENT_TIMESTAMP, getEventTimestamp(samEvent));\r\n\t\t\tm.put(SERVER_TIMESTAMP, getEventTimestamp(samEvent));\r\n\t\t\tm.put(AUDIT, getAudit());\r\n\t\t\tm.put(AUDIT_SEQUENCE_NO, getAuditSequenceNo());\r\n\t\t\tm.put(PRINCIPAL, getSubject(samEvent));\r\n\t\t\tm.put(CUSTOM_INFO, getCustomInfo(samEvent));\r\n\t\t}\r\n\r\n\t\treturn new org.osgi.service.event.Event(topic, m);\r\n\r\n\t}\r\n\r\n\tprivate static String getSeverity(EventTypeEnum eventType) {\r\n\t\tString severity;\r\n\t\tswitch (eventType) {\r\n\t\tcase FAULT_IN:\r\n\t\tcase FAULT_OUT:\r\n\t\t\tseverity = \"ERROR\";\r\n\t\t\tbreak;\r\n\t\tcase UNKNOWN:\r\n\t\t\tseverity = \"WARN\";\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tseverity = \"INFO\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn severity;\r\n\t}\r\n\r\n\tprotected static Map getLogSource(Event inputEvent) throws Exception {\r\n\t\tMap source = new HashMap();\r\n\t\tif (inputEvent != null && inputEvent.getOriginator() != null) {\r\n\t\t\tsource.put(LS_HOSTNAME, inputEvent.getOriginator().getHostname());\r\n\t\t\tsource.put(LS_HOST_IP, inputEvent.getOriginator().getIp());\r\n\t\t\tsource.put(LS_PROCESS_ID, inputEvent.getOriginator().getProcessId());\r\n\t\t}\r\n\t\treturn source;\r\n\t}\r\n\r\n\tprotected static String getLogMessage(Event samEvent) throws Exception {\r\n\t\treturn samEvent.getContent();\r\n\t}\r\n\r\n\tprotected static String getCorrelationID(Event inputEvent) throws Exception {\r\n\t\tif (inputEvent == null || inputEvent.getCustomInfo() == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn inputEvent.getCustomInfo().get(CORRELATION_ID);\r\n\t}\r\n\r\n\tprotected static Long getEventTimestamp(Event inputEvent) throws Exception {\r\n\t\tif (inputEvent == null || inputEvent.getTimestamp() == null) {\r\n\t\t\treturn new Date().getTime();\r\n\t\t}\r\n\t\treturn inputEvent.getTimestamp().getTime();\r\n\t}\r\n\r\n\tprotected static String getSubject(Event samEvent) throws Exception {\r\n\t\tString msgContent = samEvent.getContent();\r\n\r\n\t\tSubjectExtractor subjectExtractor = new SubjectExtractor();\r\n\r\n\t\tString answer = null;\r\n\r\n\t\tif (answer == null && samEvent.getOriginator() != null) {\r\n\t\t\tanswer = samEvent.getOriginator().getPrincipal();\r\n\t\t}\r\n\r\n\t\tif (answer == null && isUsernameTokenMappingEnabled()) {\r\n\t\t\tanswer = subjectExtractor.getSubject(msgContent, new UsernameTokenSubjectExtractor());\r\n\t\t}\r\n\r\n\t\tif (answer == null && isSamlTokenMappingEnabled()) {\r\n\t\t\tanswer = subjectExtractor.getSubject(msgContent, new SamlTokenSubjectExtractor());\r\n\t\t}\r\n\r\n\t\treturn answer;\r\n\t}\r\n\r\n}"} +{"text": "// swiftlint:disable all\n// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen\n\n{% if files %}\n{% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %}\nimport Foundation\n\n// swiftlint:disable superfluous_disable_command\n// swiftlint:disable file_length\n\n// MARK: - JSON Files\n{% macro fileBlock file %}\n {% call documentBlock file file.document %}\n{% endmacro %}\n{% macro documentBlock file document %}\n {% set rootType %}{% call typeBlock document.metadata %}{% endset %}\n {% if document.metadata.type == \"Array\" %}\n {{accessModifier}} static let items: {{rootType}} = objectFromJSON(at: \"{% call transformPath file.path %}\")\n {% elif document.metadata.type == \"Dictionary\" %}\n private static let _document = JSONDocument(path: \"{% call transformPath file.path %}\")\n\n {% for key,value in document.metadata.properties %}\n {{accessModifier}} {% call propertyBlock key value %}\n {% endfor %}\n {% else %}\n {{accessModifier}} static let value: {{rootType}} = objectFromJSON(at: \"{% call transformPath file.path %}\")\n {% endif %}\n{% endmacro %}\n{% macro typeBlock metadata %}{% filter removeNewlines:\"leading\" %}\n {% if metadata.type == \"Array\" %}\n [{% call typeBlock metadata.element %}]\n {% elif metadata.type == \"Dictionary\" %}\n [String: Any]\n {% elif metadata.type == \"Optional\" %}\n Any?\n {% else %}\n {{metadata.type}}\n {% endif %}\n{% endfilter %}{% endmacro %}\n{% macro propertyBlock key metadata %}{% filter removeNewlines:\"leading\" %}\n {% set propertyName %}{{key|swiftIdentifier:\"pretty\"|lowerFirstWord|escapeReservedKeywords}}{% endset %}\n {% set propertyType %}{% call typeBlock metadata %}{% endset %}\n static let {{propertyName}}: {{propertyType}} = _document[\"{{key}}\"]\n{% endfilter %}{% endmacro %}\n{% macro transformPath path %}{% filter removeNewlines %}\n {% if param.preservePath %}\n {{path}}\n {% else %}\n {{path|basename}}\n {% endif %}\n{% endfilter %}{% endmacro %}\n\n// swiftlint:disable identifier_name line_length type_body_length\n{{accessModifier}} enum {{param.enumName|default:\"JSONFiles\"}} {\n {% if files.count > 1 or param.forceFileNameEnum %}\n {% for file in files %}\n {{accessModifier}} enum {{file.name|swiftIdentifier:\"pretty\"|escapeReservedKeywords}} {\n {% filter indent:2 %}{% call fileBlock file %}{% endfilter %}\n }\n {% endfor %}\n {% else %}\n {% call fileBlock files.first %}\n {% endif %}\n}\n// swiftlint:enable identifier_name line_length type_body_length\n\n// MARK: - Implementation Details\n\nprivate func objectFromJSON(at path: String) -> T {\n {% if param.lookupFunction %}\n guard let url = {{param.lookupFunction}}(path),\n {% else %}\n guard let url = {{param.bundle|default:\"BundleToken.bundle\"}}.url(forResource: path, withExtension: nil),\n {% endif %}\n let json = try? JSONSerialization.jsonObject(with: Data(contentsOf: url), options: []),\n let result = json as? T else {\n fatalError(\"Unable to load JSON at path: \\(path)\")\n }\n return result\n}\n\nprivate struct JSONDocument {\n let data: [String: Any]\n\n init(path: String) {\n self.data = objectFromJSON(at: path)\n }\n\n subscript(key: String) -> T {\n guard let result = data[key] as? T else {\n fatalError(\"Property '\\(key)' is not of type \\(T.self)\")\n }\n return result\n }\n}\n{% if not param.bundle and not param.lookupFunction %}\n\n// swiftlint:disable convenience_type\nprivate final class BundleToken {\n static let bundle: Bundle = {\n Bundle(for: BundleToken.self)\n }()\n}\n// swiftlint:enable convenience_type\n{% endif %}\n{% else %}\n// No files found\n{% endif %}\n"} +{"text": "[Unit]\nDescription=Set vmeta clock to %I\nConditionFileIsExecutable=/bin/sh\nConditionPathIsReadWrite=/sys/devices/platform/dove_clocks_sysfs.0/vmeta\n\n[Service]\nType=oneshot\nExecStart=/bin/sh -c \"echo %I000000 > /sys/devices/platform/dove_clocks_sysfs.0/vmeta\"\nExecStop=/bin/sh -c \"echo 500000000 > /sys/devices/platform/dove_clocks_sysfs.0/vmeta\"\nRemainAfterExit=yes\n\n[Install]\nWantedBy=multi-user.target\n"} +{"text": "SELECT * FROM USER_ROLE_RELATIONSHIP\n;\n"} +{"text": "import UIKit\n\nextension Component {\n\n func setupHorizontalCollectionView(_ collectionView: CollectionView, with size: CGSize) {\n guard let collectionViewLayout = collectionView.flowLayout else {\n return\n }\n\n collectionView.isScrollEnabled = true\n collectionViewLayout.scrollDirection = .horizontal\n configurePageControl()\n\n if collectionView.contentSize.height > 0 {\n collectionView.frame.size.height = collectionView.contentSize.height\n } else {\n let newCollectionViewHeight: CGFloat = model.items.sorted(by: { $0.size.height > $1.size.height }).first?.size.height ?? 0.0\n collectionView.frame.size.height = newCollectionViewHeight\n\n if collectionView.frame.size.height > 0 {\n collectionView.frame.size.height += collectionViewLayout.sectionInset.top + collectionViewLayout.sectionInset.bottom\n }\n }\n\n collectionView.frame.size.height += CGFloat(model.layout.inset.top + model.layout.inset.bottom)\n }\n\n func layoutHorizontalCollectionView(_ collectionView: CollectionView, with size: CGSize) {\n guard let collectionViewLayout = collectionView.flowLayout as? ComponentFlowLayout else {\n return\n }\n\n collectionViewLayout.computeContentSize(with: self)\n\n // This fixes a constraints warning when trying to prepare a collection view\n // before it has gotten its initial frame.\n if collectionViewLayout.contentSize.height < collectionView.frame.size.height {\n collectionView.frame.size.height = computedHeight\n }\n\n collectionView.frame.size.width = size.width\n collectionView.frame.size.height = collectionViewLayout.contentSize.height\n\n configurePageControl(collectionView: collectionView, collectionViewLayout: collectionViewLayout)\n }\n\n private func configurePageControl(collectionView: UICollectionView, collectionViewLayout: UICollectionViewFlowLayout) {\n guard let pageIndicatorPlacement = model.layout.pageIndicatorPlacement else {\n return\n }\n\n switch pageIndicatorPlacement {\n case .below:\n collectionViewLayout.sectionInset.bottom += pageControl.frame.height\n pageControl.frame.origin.y = collectionView.frame.height\n case .overlay:\n let verticalAdjustment = CGFloat(2)\n pageControl.frame.origin.y = collectionView.frame.height - pageControl.frame.height - verticalAdjustment\n }\n }\n}\n"} +{"text": "ardour {\n\t[\"type\"] = \"dsp\",\n\tname = \"Midi Passthru\",\n\tcategory = \"Example\",\n\tlicense = \"MIT\",\n\tauthor = \"Ardour Lua Task Force\",\n\tdescription = [[An Example Audio/MIDI Passthrough Plugin using Buffer Pointers]]\n}\n\n-- return possible audio i/o configurations\nfunction dsp_ioconfig ()\n\t-- -1, -1 = any number of channels as long as input and output count matches\n\t-- require 1 MIDI in, 1 MIDI out.\n\treturn { { midi_in = 1, midi_out = 1, audio_in = -1, audio_out = -1}, }\nend\n\nfunction dsp_configure (ins, outs)\n\tn_out = outs\nend\n\n-- \"dsp_runmap\" uses Ardour's internal processor API, eqivalent to\n-- 'connect_and_run()\". There is no overhead (mapping, translating buffers).\n-- The lua implementation is responsible to map all the buffers directly.\nfunction dsp_runmap (bufs, in_map, out_map, n_samples, offset)\n\n\t-- http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:ChanMapping\n\n\tlocal ib = in_map:get (ARDOUR.DataType (\"midi\"), 0) -- get index of the 1st mapped midi input buffer\n\n\tif ib ~= ARDOUR.ChanMapping.Invalid then\n\t\t-- http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:MidiBuffer\n\t\tlocal mb = bufs:get_midi (ib) -- get the mapped buffer\n\t\tlocal events = mb:table () -- copy event list into a lua table\n\n\t\t-- iterate over all MIDI events\n\t\tfor _, e in pairs (events) do\n\t\t\t-- e is-a http://manual.ardour.org/lua-scripting/class_reference/#Evoral:MidiEvent\n\n\t\t\t-- do something with the event e.g.\n\t\t\tprint (e:channel (), e:time (), e:size (), e:buffer ():array ()[1], e:buffer ():get_table (e:size ())[1])\n\t\tend\n\tend\n\n\t----\n\t-- The following code is needed with \"dsp_runmap\" to work for arbitrary pin connections\n\t-- this passes though all audio/midi data unprocessed.\n\n\tARDOUR.DSP.process_map (bufs, n_out, in_map, out_map, n_samples, offset)\n\n\t-- equivalent lua code.\n\t-- NOTE: the lua implementation below is intended for io-config [-1,-1].\n\t-- It only works for actually mapped channels due to in_map:count() out_map:count()\n\t-- being identical to the i/o pin count in this case.\n\t--\n\t-- Plugins that have multiple possible configurations will need to implement\n\t-- dsp_configure() and remember the actual channel count.\n\t--\n\t-- ARDOUR.DSP.process_map() does iterate over the mapping itself and works generally.\n\t-- Still the lua code below does lend itself as elaborate example.\n\t--\n\t--[[\n\n\tlocal audio_ins = in_map:count (): n_audio () -- number of mapped audio input buffers\n\tlocal audio_outs = out_map:count (): n_audio () -- number of mapped audio output buffers\n\tassert (audio_outs, audio_ins) -- ioconfig [-1, -1]: must match\n\n\t-- copy audio data if any\n\tfor c = 1, audio_ins do\n\t\tlocal ib = in_map:get (ARDOUR.DataType (\"audio\"), c - 1) -- get index of mapped input buffer\n\t\tlocal ob = out_map:get (ARDOUR.DataType (\"audio\"), c - 1) -- get index of mapped output buffer\n\t\tif ib ~= ARDOUR.ChanMapping.Invalid and ob ~= ARDOUR.ChanMapping.Invalid and ib ~= ob then\n\t\t\t-- http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:DSP\n\t\t\t-- http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:AudioBuffer\n\t\t\tARDOUR.DSP.copy_vector (bufs:get_audio (ob):data (offset), bufs:get_audio (ib):data (offset), n_samples)\n\t\tend\n\tend\n\t-- Clear unconnected output buffers.\n\t-- In case we're processing in-place some buffers may be identical,\n\t-- so this must be done *after* copying relvant data from that port.\n\tfor c = 1, audio_outs do\n\t\tlocal ib = in_map:get (ARDOUR.DataType (\"audio\"), c - 1)\n\t\tlocal ob = out_map:get (ARDOUR.DataType (\"audio\"), c - 1)\n\t\tif ib == ARDOUR.ChanMapping.Invalid and ob ~= ARDOUR.ChanMapping.Invalid then\n\t\t\tbufs:get_audio (ob):silence (n_samples, offset)\n\t\tend\n\tend\n\n\t-- copy midi data\n\tlocal midi_ins = in_map:count (): n_midi () -- number of midi input buffers\n\tlocal midi_outs = out_map:count (): n_midi () -- number of midi input buffers\n\n\t-- with midi_in=1, midi_out=1 in dsp_ioconfig\n\t-- the following will always be true\n\tassert (midi_ins == 1)\n\tassert (midi_outs == 1)\n\n\tfor c = 1, midi_ins do\n\t\tlocal ib = in_map:get (ARDOUR.DataType (\"midi\"), c - 1)\n\t\tlocal ob = out_map:get (ARDOUR.DataType (\"midi\"), c - 1)\n\t\tif ib ~= ARDOUR.ChanMapping.Invalid and ob ~= ARDOUR.ChanMapping.Invalid and ib ~= ob then\n\t\t\tbufs:get_midi (ob):copy (bufs:get_midi (ib))\n\t\tend\n\tend\n\t-- silence unused midi outputs\n\tfor c = 1, midi_outs do\n\t\tlocal ib = in_map:get (ARDOUR.DataType (\"midi\"), c - 1)\n\t\tlocal ob = out_map:get (ARDOUR.DataType (\"midi\"), c - 1)\n\t\tif ib == ARDOUR.ChanMapping.Invalid and ob ~= ARDOUR.ChanMapping.Invalid then\n\t\t\tbufs:get_midi (ob):silence (n_samples, offset)\n\t\tend\n\tend\n\t--]]\nend\n"} +{"text": "\r\n\r\n RunDialog\r\n \r\n \r\n \r\n 0\r\n 0\r\n 450\r\n 143\r\n \r\n \r\n \r\n \r\n 0\r\n 0\r\n \r\n \r\n \r\n \r\n 450\r\n 140\r\n \r\n \r\n \r\n \r\n 16777215\r\n 16777215\r\n \r\n \r\n \r\n Create Process\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Enter the command to start.\r\n \r\n \r\n \r\n \r\n \r\n \r\n Browse\r\n \r\n \r\n \r\n \r\n \r\n \r\n Create with administrative privileges\r\n \r\n \r\n \r\n \r\n \r\n \r\n true\r\n \r\n \r\n \r\n \r\n \r\n \r\n Program:\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 16\r\n 16\r\n \r\n \r\n \r\n \r\n \r\n \r\n :/Icons/Shield.png\r\n \r\n \r\n true\r\n \r\n \r\n \r\n \r\n \r\n \r\n Inject Dll\r\n \r\n \r\n \r\n \r\n \r\n \r\n Qt::Vertical\r\n \r\n \r\n \r\n 20\r\n 40\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n true\r\n \r\n \r\n \r\n \r\n \r\n \r\n Qt::Horizontal\r\n \r\n \r\n \r\n 40\r\n 20\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n QDialogButtonBox::Cancel|QDialogButtonBox::Ok\r\n \r\n \r\n \r\n \r\n \r\n \r\n Create suspended\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n"} +{"text": "from yosai.core import (\n RememberMeSettings,\n)\n\nimport pytest\n\nfrom .doubles import (\n MockRememberMeManager,\n)\n\n\n@pytest.fixture(scope='function')\ndef remember_me_settings(core_settings):\n return RememberMeSettings(core_settings)\n\n\n@pytest.fixture(scope='function')\ndef mock_remember_me_manager(core_settings, session_attributes):\n return MockRememberMeManager(core_settings, session_attributes)\n"} +{"text": "//\n// MLExpressionManager.h\n// Pods\n//\n// Created by molon on 15/6/18.\n//\n//\n\n#import \n\n@interface MLExpression : NSObject\n\n@property (readonly, nonatomic, copy) NSString *regex;\n@property (readonly, nonatomic, copy) NSString *plistName;\n@property (readonly, nonatomic, copy) NSString *bundleName;\n\n+ (instancetype)expressionWithRegex:(NSString*)regex plistName:(NSString*)plistName bundleName:(NSString*)bundleName;\n\n@end\n\n@interface MLExpressionManager : NSObject\n\n+ (instancetype)sharedInstance;\n\n//获取对应的表情attrStr\n+ (NSAttributedString*)expressionAttributedStringWithString:(id)string expression:(MLExpression*)expression;\n//给一个str数组,返回其对应的表情attrStr数组,顺序一致\n+ (NSArray *)expressionAttributedStringsWithStrings:(NSArray*)strings expression:(MLExpression*)expression;\n//同上,但是以回调方式返回\n+ (void)expressionAttributedStringsWithStrings:(NSArray*)strings expression:(MLExpression*)expression callback:(void(^)(NSArray *result))callback;\n\n@end\n"} +{"text": "#!/bin/sh\nsu-exec $UID:$GID php -d memory_limit= -f /nextcloud/occ \"$@\"\n"} +{"text": "--TEST--\nTest dirname() function : basic functionality \n--CREDITS--\nDave Kelsey \n--SKIPIF--\n\n--FILE--\n\n===DONE===\n--EXPECTF--\n*** Testing dirname() : basic functionality ***\nstring(0) \"\"\nstring(1) \".\"\nstring(1) \".\"\nstring(1) \".\"\nstring(1) \".\"\nstring(1) \".\"\nstring(1) \".\"\nstring(1) \".\"\nstring(8) \"c://test\"\nstring(1) \".\"\nstring(15) \"/usr/lib/locale\"\nstring(17) \"//usr/lib//locale\"\nstring(1) \".\"\nstring(1) \".\"\nstring(1) \"/\"\nstring(1) \"/\"\nstring(1) \"/\"\nstring(15) \"/usr/lib/locale\"\nstring(27) \"c:\\windows/system32\\drivers\"\nstring(8) \"/usr\\lib\"\nstring(1) \".\"\nstring(1) \".\"\nstring(1) \".\"\nstring(18) \" /usr/lib/locale\"\nstring(15) \"/usr/lib/locale\"\nstring(18) \" /usr/lib/locale\"\nstring(1) \".\"\nstring(1) \".\"\nstring(1) \"/\"\nstring(1) \"/\"\n===DONE===\n\n"} +{"text": "// Copyright (C) 2003 Davis E. King (davis@dlib.net)\n// License: Boost Software License See LICENSE.txt for the full license.\n#ifndef DLIB_TOKENIZER_KERNEl_C_\n#define DLIB_TOKENIZER_KERNEl_C_\n\n#include \"tokenizer_kernel_abstract.h\"\n#include \"../assert.h\"\n#include \n#include \n\nnamespace dlib\n{\n\n template <\n typename tokenizer\n >\n class tokenizer_kernel_c : public tokenizer\n {\n \n public:\n std::istream& get_stream (\n ) const;\n\n void get_token (\n int& type,\n std::string& token\n );\n\n void set_identifier_token (\n const std::string& head,\n const std::string& body\n );\n\n int peek_type (\n ) const;\n\n const std::string& peek_token (\n ) const;\n };\n\n template <\n typename tokenizer\n >\n inline void swap (\n tokenizer_kernel_c& a, \n tokenizer_kernel_c& b \n ) { a.swap(b); } \n\n// ----------------------------------------------------------------------------------------\n// ----------------------------------------------------------------------------------------\n // member function definitions\n// ----------------------------------------------------------------------------------------\n// ----------------------------------------------------------------------------------------\n\n template <\n typename tokenizer\n >\n void tokenizer_kernel_c::\n set_identifier_token (\n const std::string& head,\n const std::string& body\n ) \n {\n using namespace std;\n // make sure requires clause is not broken\n DLIB_CASSERT( head.find_first_of(\" \\r\\t\\n0123456789\") == string::npos &&\n body.find_first_of(\" \\r\\t\\n\") == string::npos ,\n \"\\tvoid tokenizer::set_identifier_token()\"\n << \"\\n\\tyou can't define the IDENTIFIER token this way.\"\n << \"\\n\\thead: \" << head\n << \"\\n\\tbody: \" << body\n << \"\\n\\tthis: \" << this\n );\n\n // call the real function\n tokenizer::set_identifier_token(head,body);\n }\n\n// ----------------------------------------------------------------------------------------\n\n template <\n typename tokenizer\n >\n std::istream& tokenizer_kernel_c::\n get_stream (\n ) const\n {\n // make sure requires clause is not broken\n DLIB_CASSERT( this->stream_is_set() == true,\n \"\\tstd::istream& tokenizer::get_stream()\"\n << \"\\n\\tyou must set a stream for this object before you can get it\"\n << \"\\n\\tthis: \" << this\n );\n\n // call the real function\n return tokenizer::get_stream();\n }\n\n// ----------------------------------------------------------------------------------------\n\n template <\n typename tokenizer\n >\n int tokenizer_kernel_c::\n peek_type (\n ) const\n {\n // make sure requires clause is not broken\n DLIB_CASSERT( this->stream_is_set() == true,\n \"\\tint tokenizer::peek_type()\"\n << \"\\n\\tyou must set a stream for this object before you peek at what it contains\"\n << \"\\n\\tthis: \" << this\n );\n\n // call the real function\n return tokenizer::peek_type();\n }\n\n// ----------------------------------------------------------------------------------------\n\n template <\n typename tokenizer\n >\n const std::string& tokenizer_kernel_c::\n peek_token (\n ) const\n {\n // make sure requires clause is not broken\n DLIB_CASSERT( this->stream_is_set() == true,\n \"\\tint tokenizer::peek_token()\"\n << \"\\n\\tyou must set a stream for this object before you peek at what it contains\"\n << \"\\n\\tthis: \" << this\n );\n\n // call the real function\n return tokenizer::peek_token();\n }\n\n// ----------------------------------------------------------------------------------------\n\n template <\n typename tokenizer\n >\n void tokenizer_kernel_c::\n get_token (\n int& type,\n std::string& token\n )\n {\n // make sure requires clause is not broken\n DLIB_CASSERT( this->stream_is_set() == true,\n \"\\tvoid tokenizer::get_token()\"\n << \"\\n\\tyou must set a stream for this object before you can get tokens from it.\"\n << \"\\n\\tthis: \" << this\n );\n\n // call the real function\n tokenizer::get_token(type,token);\n }\n\n// ----------------------------------------------------------------------------------------\n\n}\n\n#endif // DLIB_TOKENIZER_KERNEl_C_\n\n\n"} +{"text": "/// These iterators only exit normally when the loop cursor is NULL, so there\n/// is no point to call of_node_put on the final value.\n///\n// Confidence: High\n// Copyright: (C) 2010-2012 Nicolas Palix. GPLv2.\n// Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6. GPLv2.\n// Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6. GPLv2.\n// URL: http://coccinelle.lip6.fr/\n// Comments:\n// Options: --no-includes --include-headers\n\nvirtual patch\nvirtual context\nvirtual org\nvirtual report\n\n@depends on patch@\niterator name for_each_node_by_name;\nexpression np,E;\nidentifier l;\n@@\n\nfor_each_node_by_name(np,...) {\n ... when != break;\n when != goto l;\n}\n... when != np = E\n- of_node_put(np);\n\n@depends on patch@\niterator name for_each_node_by_type;\nexpression np,E;\nidentifier l;\n@@\n\nfor_each_node_by_type(np,...) {\n ... when != break;\n when != goto l;\n}\n... when != np = E\n- of_node_put(np);\n\n@depends on patch@\niterator name for_each_compatible_node;\nexpression np,E;\nidentifier l;\n@@\n\nfor_each_compatible_node(np,...) {\n ... when != break;\n when != goto l;\n}\n... when != np = E\n- of_node_put(np);\n\n@depends on patch@\niterator name for_each_matching_node;\nexpression np,E;\nidentifier l;\n@@\n\nfor_each_matching_node(np,...) {\n ... when != break;\n when != goto l;\n}\n... when != np = E\n- of_node_put(np);\n\n// ----------------------------------------------------------------------\n\n@r depends on !patch forall@\n//iterator name for_each_node_by_name;\n//iterator name for_each_node_by_type;\n//iterator name for_each_compatible_node;\n//iterator name for_each_matching_node;\nexpression np,E;\nidentifier l;\nposition p1,p2;\n@@\n\n(\n*for_each_node_by_name@p1(np,...)\n{\n ... when != break;\n when != goto l;\n}\n|\n*for_each_node_by_type@p1(np,...)\n{\n ... when != break;\n when != goto l;\n}\n|\n*for_each_compatible_node@p1(np,...)\n{\n ... when != break;\n when != goto l;\n}\n|\n*for_each_matching_node@p1(np,...)\n{\n ... when != break;\n when != goto l;\n}\n)\n... when != np = E\n* of_node_put@p2(np);\n\n@script:python depends on org@\np1 << r.p1;\np2 << r.p2;\n@@\n\ncocci.print_main(\"unneeded of_node_put\",p2)\ncocci.print_secs(\"iterator\",p1)\n\n@script:python depends on report@\np1 << r.p1;\np2 << r.p2;\n@@\n\nmsg = \"ERROR: of_node_put not needed after iterator on line %s\" % (p1[0].line)\ncoccilib.report.print_report(p2[0], msg)\n"} +{"text": "//\n// Grid system\n// --------------------------------------------------\n\n\n// Container widths\n//\n// Set the container width, and override it for fixed navbars in media queries.\n\n.container {\n @include container-fixed;\n\n @media (min-width: $screen-sm-min) {\n width: $container-sm;\n }\n @media (min-width: $screen-md-min) {\n width: $container-md;\n }\n @media (min-width: $screen-lg-min) {\n width: $container-lg;\n }\n}\n\n\n// Fluid container\n//\n// Utilizes the mixin meant for fixed width containers, but without any defined\n// width for fluid, full width layouts.\n\n.container-fluid {\n @include container-fixed;\n}\n\n\n// Row\n//\n// Rows contain and clear the floats of your columns.\n\n.row {\n @include make-row;\n}\n\n\n// Columns\n//\n// Common styles for small and large grid columns\n\n@include make-grid-columns;\n\n\n// Extra small grid\n//\n// Columns, offsets, pushes, and pulls for extra small devices like\n// smartphones.\n\n@include make-grid(xs);\n\n\n// Small grid\n//\n// Columns, offsets, pushes, and pulls for the small device range, from phones\n// to tablets.\n\n@media (min-width: $screen-sm-min) {\n @include make-grid(sm);\n}\n\n\n// Medium grid\n//\n// Columns, offsets, pushes, and pulls for the desktop device range.\n\n@media (min-width: $screen-md-min) {\n @include make-grid(md);\n}\n\n\n// Large grid\n//\n// Columns, offsets, pushes, and pulls for the large desktop device range.\n\n@media (min-width: $screen-lg-min) {\n @include make-grid(lg);\n}\n"} +{"text": "Some descriptive text, to help understand the output\n\n\n[0] = 0\n[1] = 1\n[2] = 2\n[3] = 3\n\n"} +{"text": "# Copyright 1999-2018 Gentoo Foundation\n# Distributed under the terms of the GNU General Public License v2\n\nEAPI=6\n\nPYTHON_COMPAT=( python2_7 python3_{3,4,5,6} )\n\ninherit python-r1 distutils-r1 eutils versionator\n\nDESCRIPTION=\"Library for numerical computation using data flow graphs\"\nHOMEPAGE=\"https://www.tensorflow.org\n\thttps://github.com/tensorflow/tensorflow\"\nSRC_URI=\"https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz\n\thttps://dev.gentoo.org/~gienah/snapshots/${P}-bazel-cache-repos.tar.xz\"\n\nLICENSE=\"Apache-2.0\"\nSLOT=\"0\"\nKEYWORDS=\"~amd64\"\nIUSE=\"cuda cxx mpi\"\n\n# To create the cache repo tar file, temporarilly remove the\n# ${P}-bazel-cache-repos.tar.xz from SRC_URI and src_upack. Then build\n# it so that bazel will download the files:\n# FEATURES=\"noclean -network-sandbox\" emerge -av sci-libs/tensorflow\n# cd /var/tmp/portage/sci-libs/${P}\n# tar --owner=portage --group=portage -cJvf \\\n# /usr/portage/distfiles/${P}-bazel-cache-repos.tar.xz \\\n# homedir/.cache/bazel/_bazel_portage/cache/repos/v1\n\n# TensorFlow 1.7 may be the last time we support Cuda versions below 8.0.\n# Starting with TensorFlow 1.8 release, 8.0 will be the minimum supported\n# version.\n# TensorFlow 1.7 may be the last time we support cuDNN versions below 6.0.\n# Starting with TensorFlow 1.8 release, 6.0 will be the minimum supported\n# version.\n# Possibly missing deps:\n# \tdev-python/gast\nDEPEND=\"\n\tcxx? ( dev-libs/protobuf )\n\tdev-python/absl-py[${PYTHON_USEDEP}]\n\tdev-python/astor[${PYTHON_USEDEP}]\n\tdev-python/numpy[${PYTHON_USEDEP}]\n\tdev-python/protobuf-python[${PYTHON_USEDEP}]\n\tdev-python/six[${PYTHON_USEDEP}]\n\tdev-python/termcolor[${PYTHON_USEDEP}]\n\tdev-python/wheel[${PYTHON_USEDEP}]\n\tdev-libs/jemalloc\n\tdev-libs/protobuf-c\n\tdev-util/bazel\n\tmedia-libs/giflib\n\tvirtual/jpeg:0\n\tcuda? ( >=dev-util/nvidia-cuda-toolkit-8.0[profiler] >=dev-libs/cudnn-6 )\n\tmpi? ( virtual/mpi )\"\n\t#opencl? ( virtual/opencl )\"\nRDEPEND=\"${DEPEND}\"\n\nsrc_unpack() {\n\tunpack ${P}.tar.gz\n\tpushd .. || die\n\tunpack distdir/${P}-bazel-cache-repos.tar.xz\n\tpopd || die\n}\n\n# TODO: seems it also supports some MPI implementations\nsrc_configure(){\n\t# there is no setup.py but there is configure\n\t# https://www.tensorflow.org/install/install_sources\n\t# https://www.tensorflow.org/install/install_linux#InstallingNativePip\n\t#\n\t# usage: configure.py [-h] [--workspace WORKSPACE]\n\tpython_configure() {\n\t\texport PYTHON_BIN_PATH=${PYTHON}\n\t\texport PYTHON_LIB_PATH=${PYTHON_SITEDIR}\n\t\texport TF_NEED_JEMALLOC=1\n\t\texport TF_NEED_GCP=0\n\t\texport TF_NEED_HDFS=0\n\t\texport TF_NEED_S3=0\n\t\texport TF_NEED_KAFKA=0\n\t\texport TF_ENABLE_XLA=0\n\t\texport TF_NEED_GDR=0\n\t\texport TF_NEED_VERBS=0\n\t\texport TF_NEED_OPENCL=0\n\t\tif use cuda; then\n\t\t\texport TF_NEED_CUDA=1\n\t\telse\n\t\t\texport TF_NEED_CUDA=0\n\t\tfi\n\t\tif use mpi; then\n\t\t\texport TF_NEED_MPI=1\n\t\telse\n\t\t\texport TF_NEED_MPI=0\n\t\tfi\n\t\texport TF_NEED_OPENCL_SYCL=0\n\t\texport CC_OPT_FLAGS=${CFLAGS}\n\t\texport JAVA_HOME=$(java-config -O)\n\t\t# TODO: protect by a USE flag test --config=mkl\n\t\t./configure || die\n\t}\n\tpython_foreach_impl python_configure\n}\n\nbazel-get-flags() {\n\tlocal fs=\"\"\n\tfor i in ${CXXFLAGS}; do\n\t\t[[ -n \"${fs}\" ]] && fs+=\" \"\n\t\tfs+=\"--cxxopt=${i}\"\n\tdone\n\tfor i in ${CPPFLAGS}; do\n\t\t[[ -n \"${fs}\" ]] && fs+=\" \"\n\t\tfs+=\"--copt=${i}\"\n\t\tfs+=\"--cxxopt=${i}\"\n\tdone\n\tfor i in ${LDFLAGS}; do\n\t\t[[ -n \"${fs}\" ]] && fs+=\" \"\n\t\tfs+=\"--linkopt=${i}\"\n\tdone\n\techo \"${fs}\"\n}\n\nsrc_compile() {\n\t# F: fopen_wr\n\t# S: deny\n\t# P: /proc/self/setgroups\n\t# A: /proc/self/setgroups\n\t# R: /proc/7712/setgroups\n\t# C: unable to read /proc/1/cmdline\n\taddpredict /proc\n\n\tlocal opt=$(usex cuda \"--config=cuda\" \"\")\n\teinfo \">>> Compiling ${PN} C\"$(usex cxx \" and C++\" \"\")\n\teinfo \"\tbazel build \\\\\"\n\teinfo \"\t --config=opt ${opt} \\\\\"\n\teinfo \"\t $(bazel-get-flags) \\\\\"\n\teinfo \"\t //tensorflow:libtensorflow.so \\\\\"\n\teinfo \" //tensorflow:libtensorflow_framework.so \\\\\"\n\teinfo \"\t \"$(usex cxx \"//tensorflow:libtensorflow_cc.so\" \"\")\n\tbazel build \\\n\t\t --config=opt ${opt} \\\n\t\t $(bazel-get-flags) \\\n\t\t //tensorflow:libtensorflow.so \\\n\t\t //tensorflow:libtensorflow_framework.so \\\n\t\t $(usex cxx \"//tensorflow:libtensorflow_cc.so\" \"\") || die\n\n\tpython_compile() {\n\t\teinfo \">>> Compiling ${PN} ${MULTIBUILD_VARIANT}\"\n\t\teinfo \"\tbazel build \\\\\"\n\t\teinfo \"\t --config=opt ${opt} \\\\\"\n\t\teinfo \"\t $(bazel-get-flags) \\\\\"\n\t\teinfo \" //tensorflow/tools/pip_package:build_pip_package\"\n\t\tbazel build \\\n\t\t\t --config=opt ${opt} \\\n\t\t\t $(bazel-get-flags) \\\n\t\t\t //tensorflow/tools/pip_package:build_pip_package || die\n\t\tbazel-bin/tensorflow/tools/pip_package/build_pip_package tensorflow_pkg || die\n\t\tunzip -o -d ${PN}_pkg_${MULTIBUILD_VARIANT} ${PN}_pkg/${P}-*.whl || die\n\t\trm -f ${PN}_pkg_${MULTIBUILD_VARIANT}/lib${PN}_framework.so || die\n\t}\n\tpython_foreach_impl python_compile\n\tbazel shutdown || die\n}\n\nsrc_test() {\n\tpython_foreach_impl python_test\n}\n\nsrc_install() {\n\tlocal SO1=$(get_major_version)\n\tlocal SOVER=$(version_format_string '$1.$2')\n\tlocal tl=\"${PN} ${PN}_framework\"\n\tdodir /usr/include/${PN}/${PN}/c\n\tinsinto /usr/include/${PN}/${PN}/c\n\tdoins ${PN}/c/c_api.h\n\tif use cxx; then\n\t\tfor i in $(find ${PN}/cc ${PN}/core third_party/eigen3 -type f \\\n\t\t\t\t\t\t\\( -name \\*.h -o \\\n\t\t\t\t\t\t-wholename third_party/eigen3/Eigen/\\* \\) -print); do\n\t\t\tdodir $(dirname /usr/include/${PN}/${i})\n\t\t\tinsinto $(dirname /usr/include/${PN}/${i})\n\t\t\tdoins ${i}\n\t\tdone\n\t\ttl+=\" ${PN}_cc\"\n\tfi\n\tfor i in ${tl}; do\n\t\tdolib.so bazel-bin/${PN}/lib${i}.so\n\t\tdosym \"lib${i}.so\" \\\n\t\t\t \"/usr/$(get_libdir)/lib${i}.so.${SO1}\" \\\n\t\t\t|| die \"Could not create /usr/$(get_libdir)/lib${i}.so.${SO1} symlink\"\n\t\tdosym \"lib${i}.so\" \\\n\t\t\t \"/usr/$(get_libdir)/lib${i}.so.${SOVER}\" \\\n\t\t\t|| die \"Could not create /usr/$(get_libdir)/lib${i}.so.${SOVER} symlink\"\n\tdone\n\tpython_install() {\n\t\tpython_domodule ${PN}_pkg_${MULTIBUILD_VARIANT}/${P}.data/purelib/${PN}\n\t\tdosym \"../../../lib${PN}_framework.so\" \\\n\t\t\t \"$(python_get_sitedir)/${PN}/lib${PN}_framework.so\" \\\n\t\t\t|| die \"Could not create $(python_get_sitedir)/lib${PN}_framework.so symlink for python module\"\n\t}\n\tpython_foreach_impl python_install\n\teinstalldocs\n}\n"} +{"text": "DELETE /organizations/Organization1/clients/Client1 admin/admin\n----\n409\nContent-Type: application/json\nX-Apiman-Error: true\n\n{\n \"type\": \"EntityStillActiveException\",\n \"errorCode\": 8002,\n \"moreInfoUrl\": null\n}\n"} +{"text": "/*\n * JBoss, Home of Professional Open Source\n * Copyright 2013, Red Hat Inc., and individual contributors as indicated\n * by the @authors tag. See the copyright.txt in the distribution for a\n * full listing of individual contributors.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\npackage org.jboss.as.test.integration.weld.configuration.requirebeandescriptor;\n\nimport javax.enterprise.context.RequestScoped;\n\n@RequestScoped\npublic class Foo {\n\n}\n"} +{"text": "@ParametersAreNonnullByDefault\n@FieldsAreNonnullByDefault\n@MethodsReturnNonnullByDefault\npackage forestry.database;\n\nimport javax.annotation.ParametersAreNonnullByDefault;\n\nimport mcp.MethodsReturnNonnullByDefault;\n\nimport forestry.core.utils.FieldsAreNonnullByDefault;"} +{"text": "/*\n * Copyright (C) 2004 - 2010 Vladislav Bolkhovitin \n * Copyright (C) 2004 - 2005 Leonid Stoljar\n * Copyright (C) 2006 Nathaniel Clark \n * Copyright (C) 2007 - 2010 ID7 Ltd.\n *\n * Forward port and refactoring to modern qla2xxx and target/configfs\n *\n * Copyright (C) 2010-2011 Nicholas A. Bellinger \n *\n * Additional file for the target driver support.\n *\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; either version 2\n * of the License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n */\n/*\n * This is the global def file that is useful for including from the\n * target portion.\n */\n\n#ifndef __QLA_TARGET_H\n#define __QLA_TARGET_H\n\n#include \"qla_def.h\"\n\n/*\n * Must be changed on any change in any initiator visible interfaces or\n * data in the target add-on\n */\n#define QLA2XXX_TARGET_MAGIC\t269\n\n/*\n * Must be changed on any change in any target visible interfaces or\n * data in the initiator\n */\n#define QLA2XXX_INITIATOR_MAGIC 57222\n\n#define QLA2XXX_INI_MODE_STR_EXCLUSIVE\t\"exclusive\"\n#define QLA2XXX_INI_MODE_STR_DISABLED\t\"disabled\"\n#define QLA2XXX_INI_MODE_STR_ENABLED\t\"enabled\"\n\n#define QLA2XXX_INI_MODE_EXCLUSIVE\t0\n#define QLA2XXX_INI_MODE_DISABLED\t1\n#define QLA2XXX_INI_MODE_ENABLED\t2\n\n#define QLA2XXX_COMMAND_COUNT_INIT\t250\n#define QLA2XXX_IMMED_NOTIFY_COUNT_INIT 250\n\n/*\n * Used to mark which completion handles (for RIO Status's) are for CTIO's\n * vs. regular (non-target) info. This is checked for in\n * qla2x00_process_response_queue() to see if a handle coming back in a\n * multi-complete should come to the tgt driver or be handled there by qla2xxx\n */\n#define CTIO_COMPLETION_HANDLE_MARK\tBIT_29\n#if (CTIO_COMPLETION_HANDLE_MARK <= DEFAULT_OUTSTANDING_COMMANDS)\n#error \"CTIO_COMPLETION_HANDLE_MARK not larger than \"\n\t\"DEFAULT_OUTSTANDING_COMMANDS\"\n#endif\n#define HANDLE_IS_CTIO_COMP(h) (h & CTIO_COMPLETION_HANDLE_MARK)\n\n/* Used to mark CTIO as intermediate */\n#define CTIO_INTERMEDIATE_HANDLE_MARK\tBIT_30\n\n#ifndef OF_SS_MODE_0\n/*\n * ISP target entries - Flags bit definitions.\n */\n#define OF_SS_MODE_0 0\n#define OF_SS_MODE_1 1\n#define OF_SS_MODE_2 2\n#define OF_SS_MODE_3 3\n\n#define OF_EXPL_CONF BIT_5 /* Explicit Confirmation Requested */\n#define OF_DATA_IN BIT_6 /* Data in to initiator */\n\t\t\t\t\t/* (data from target to initiator) */\n#define OF_DATA_OUT BIT_7 /* Data out from initiator */\n\t\t\t\t\t/* (data from initiator to target) */\n#define OF_NO_DATA (BIT_7 | BIT_6)\n#define OF_INC_RC BIT_8 /* Increment command resource count */\n#define OF_FAST_POST BIT_9 /* Enable mailbox fast posting. */\n#define OF_CONF_REQ BIT_13 /* Confirmation Requested */\n#define OF_TERM_EXCH BIT_14 /* Terminate exchange */\n#define OF_SSTS BIT_15 /* Send SCSI status */\n#endif\n\n#ifndef QLA_TGT_DATASEGS_PER_CMD32\n#define QLA_TGT_DATASEGS_PER_CMD32\t3\n#define QLA_TGT_DATASEGS_PER_CONT32\t7\n#define QLA_TGT_MAX_SG32(ql) \\\n\t(((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD32 + \\\n\t\tQLA_TGT_DATASEGS_PER_CONT32*((ql) - 1)) : 0)\n\n#define QLA_TGT_DATASEGS_PER_CMD64\t2\n#define QLA_TGT_DATASEGS_PER_CONT64\t5\n#define QLA_TGT_MAX_SG64(ql) \\\n\t(((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD64 + \\\n\t\tQLA_TGT_DATASEGS_PER_CONT64*((ql) - 1)) : 0)\n#endif\n\n#ifndef QLA_TGT_DATASEGS_PER_CMD_24XX\n#define QLA_TGT_DATASEGS_PER_CMD_24XX\t1\n#define QLA_TGT_DATASEGS_PER_CONT_24XX\t5\n#define QLA_TGT_MAX_SG_24XX(ql) \\\n\t(min(1270, ((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD_24XX + \\\n\t\tQLA_TGT_DATASEGS_PER_CONT_24XX*((ql) - 1)) : 0))\n#endif\n#endif\n\n#define GET_TARGET_ID(ha, iocb) ((HAS_EXTENDED_IDS(ha))\t\t\t\\\n\t\t\t ? le16_to_cpu((iocb)->u.isp2x.target.extended)\t\\\n\t\t\t : (uint16_t)(iocb)->u.isp2x.target.id.standard)\n\n#ifndef IMMED_NOTIFY_TYPE\n#define IMMED_NOTIFY_TYPE 0x0D\t\t/* Immediate notify entry. */\n/*\n * ISP queue -\timmediate notify entry structure definition.\n *\t\tThis is sent by the ISP to the Target driver.\n *\t\tThis IOCB would have report of events sent by the\n *\t\tinitiator, that needs to be handled by the target\n *\t\tdriver immediately.\n */\nstruct imm_ntfy_from_isp {\n\tuint8_t\t entry_type;\t\t /* Entry type. */\n\tuint8_t\t entry_count;\t\t /* Entry count. */\n\tuint8_t\t sys_define;\t\t /* System defined. */\n\tuint8_t\t entry_status;\t\t /* Entry Status. */\n\tunion {\n\t\tstruct {\n\t\t\tuint32_t sys_define_2; /* System defined. */\n\t\t\ttarget_id_t target;\n\t\t\tuint16_t lun;\n\t\t\tuint8_t target_id;\n\t\t\tuint8_t reserved_1;\n\t\t\tuint16_t status_modifier;\n\t\t\tuint16_t status;\n\t\t\tuint16_t task_flags;\n\t\t\tuint16_t seq_id;\n\t\t\tuint16_t srr_rx_id;\n\t\t\tuint32_t srr_rel_offs;\n\t\t\tuint16_t srr_ui;\n#define SRR_IU_DATA_IN\t0x1\n#define SRR_IU_DATA_OUT\t0x5\n#define SRR_IU_STATUS\t0x7\n\t\t\tuint16_t srr_ox_id;\n\t\t\tuint8_t reserved_2[28];\n\t\t} isp2x;\n\t\tstruct {\n\t\t\tuint32_t reserved;\n\t\t\tuint16_t nport_handle;\n\t\t\tuint16_t reserved_2;\n\t\t\tuint16_t flags;\n#define NOTIFY24XX_FLAGS_GLOBAL_TPRLO BIT_1\n#define NOTIFY24XX_FLAGS_PUREX_IOCB BIT_0\n\t\t\tuint16_t srr_rx_id;\n\t\t\tuint16_t status;\n\t\t\tuint8_t status_subcode;\n\t\t\tuint8_t fw_handle;\n\t\t\tuint32_t exchange_address;\n\t\t\tuint32_t srr_rel_offs;\n\t\t\tuint16_t srr_ui;\n\t\t\tuint16_t srr_ox_id;\n\t\t\tuint8_t reserved_4[19];\n\t\t\tuint8_t vp_index;\n\t\t\tuint32_t reserved_5;\n\t\t\tuint8_t port_id[3];\n\t\t\tuint8_t reserved_6;\n\t\t} isp24;\n\t} u;\n\tuint16_t reserved_7;\n\tuint16_t ox_id;\n} __packed;\n#endif\n\n#ifndef NOTIFY_ACK_TYPE\n#define NOTIFY_ACK_TYPE 0x0E\t /* Notify acknowledge entry. */\n/*\n * ISP queue -\tnotify acknowledge entry structure definition.\n *\t\tThis is sent to the ISP from the target driver.\n */\nstruct nack_to_isp {\n\tuint8_t\t entry_type;\t\t /* Entry type. */\n\tuint8_t\t entry_count;\t\t /* Entry count. */\n\tuint8_t\t sys_define;\t\t /* System defined. */\n\tuint8_t\t entry_status;\t\t /* Entry Status. */\n\tunion {\n\t\tstruct {\n\t\t\tuint32_t sys_define_2; /* System defined. */\n\t\t\ttarget_id_t target;\n\t\t\tuint8_t\t target_id;\n\t\t\tuint8_t\t reserved_1;\n\t\t\tuint16_t flags;\n\t\t\tuint16_t resp_code;\n\t\t\tuint16_t status;\n\t\t\tuint16_t task_flags;\n\t\t\tuint16_t seq_id;\n\t\t\tuint16_t srr_rx_id;\n\t\t\tuint32_t srr_rel_offs;\n\t\t\tuint16_t srr_ui;\n\t\t\tuint16_t srr_flags;\n\t\t\tuint16_t srr_reject_code;\n\t\t\tuint8_t srr_reject_vendor_uniq;\n\t\t\tuint8_t srr_reject_code_expl;\n\t\t\tuint8_t reserved_2[24];\n\t\t} isp2x;\n\t\tstruct {\n\t\t\tuint32_t handle;\n\t\t\tuint16_t nport_handle;\n\t\t\tuint16_t reserved_1;\n\t\t\tuint16_t flags;\n\t\t\tuint16_t srr_rx_id;\n\t\t\tuint16_t status;\n\t\t\tuint8_t status_subcode;\n\t\t\tuint8_t fw_handle;\n\t\t\tuint32_t exchange_address;\n\t\t\tuint32_t srr_rel_offs;\n\t\t\tuint16_t srr_ui;\n\t\t\tuint16_t srr_flags;\n\t\t\tuint8_t reserved_4[19];\n\t\t\tuint8_t vp_index;\n\t\t\tuint8_t srr_reject_vendor_uniq;\n\t\t\tuint8_t srr_reject_code_expl;\n\t\t\tuint8_t srr_reject_code;\n\t\t\tuint8_t reserved_5[5];\n\t\t} isp24;\n\t} u;\n\tuint8_t reserved[2];\n\tuint16_t ox_id;\n} __packed;\n#define NOTIFY_ACK_SRR_FLAGS_ACCEPT\t0\n#define NOTIFY_ACK_SRR_FLAGS_REJECT\t1\n\n#define NOTIFY_ACK_SRR_REJECT_REASON_UNABLE_TO_PERFORM\t0x9\n\n#define NOTIFY_ACK_SRR_FLAGS_REJECT_EXPL_NO_EXPL\t\t0\n#define NOTIFY_ACK_SRR_FLAGS_REJECT_EXPL_UNABLE_TO_SUPPLY_DATA\t0x2a\n\n#define NOTIFY_ACK_SUCCESS 0x01\n#endif\n\n#ifndef ACCEPT_TGT_IO_TYPE\n#define ACCEPT_TGT_IO_TYPE 0x16 /* Accept target I/O entry. */\n#endif\n\n#ifndef CONTINUE_TGT_IO_TYPE\n#define CONTINUE_TGT_IO_TYPE 0x17\n/*\n * ISP queue -\tContinue Target I/O (CTIO) entry for status mode 0 structure.\n *\t\tThis structure is sent to the ISP 2xxx from target driver.\n */\nstruct ctio_to_2xxx {\n\tuint8_t\t entry_type;\t\t/* Entry type. */\n\tuint8_t\t entry_count;\t\t/* Entry count. */\n\tuint8_t\t sys_define;\t\t/* System defined. */\n\tuint8_t\t entry_status;\t\t/* Entry Status. */\n\tuint32_t handle;\t\t/* System defined handle */\n\ttarget_id_t target;\n\tuint16_t rx_id;\n\tuint16_t flags;\n\tuint16_t status;\n\tuint16_t timeout;\t\t/* 0 = 30 seconds, 0xFFFF = disable */\n\tuint16_t dseg_count;\t\t/* Data segment count. */\n\tuint32_t relative_offset;\n\tuint32_t residual;\n\tuint16_t reserved_1[3];\n\tuint16_t scsi_status;\n\tuint32_t transfer_length;\n\tuint32_t dseg_0_address;\t/* Data segment 0 address. */\n\tuint32_t dseg_0_length;\t\t/* Data segment 0 length. */\n\tuint32_t dseg_1_address;\t/* Data segment 1 address. */\n\tuint32_t dseg_1_length;\t\t/* Data segment 1 length. */\n\tuint32_t dseg_2_address;\t/* Data segment 2 address. */\n\tuint32_t dseg_2_length;\t\t/* Data segment 2 length. */\n} __packed;\n#define ATIO_PATH_INVALID 0x07\n#define ATIO_CANT_PROV_CAP 0x16\n#define ATIO_CDB_VALID 0x3D\n\n#define ATIO_EXEC_READ BIT_1\n#define ATIO_EXEC_WRITE BIT_0\n#endif\n\n#ifndef CTIO_A64_TYPE\n#define CTIO_A64_TYPE 0x1F\n#define CTIO_SUCCESS\t\t\t0x01\n#define CTIO_ABORTED\t\t\t0x02\n#define CTIO_INVALID_RX_ID\t\t0x08\n#define CTIO_TIMEOUT\t\t\t0x0B\n#define CTIO_DIF_ERROR\t\t\t0x0C /* DIF error detected */\n#define CTIO_LIP_RESET\t\t\t0x0E\n#define CTIO_TARGET_RESET\t\t0x17\n#define CTIO_PORT_UNAVAILABLE\t\t0x28\n#define CTIO_PORT_LOGGED_OUT\t\t0x29\n#define CTIO_PORT_CONF_CHANGED\t\t0x2A\n#define CTIO_SRR_RECEIVED\t\t0x45\n#endif\n\n#ifndef CTIO_RET_TYPE\n#define CTIO_RET_TYPE\t0x17\t\t/* CTIO return entry */\n#define ATIO_TYPE7 0x06 /* Accept target I/O entry for 24xx */\n\nstruct fcp_hdr {\n\tuint8_t r_ctl;\n\tuint8_t d_id[3];\n\tuint8_t cs_ctl;\n\tuint8_t s_id[3];\n\tuint8_t type;\n\tuint8_t f_ctl[3];\n\tuint8_t seq_id;\n\tuint8_t df_ctl;\n\tuint16_t seq_cnt;\n\t__be16 ox_id;\n\tuint16_t rx_id;\n\tuint32_t parameter;\n} __packed;\n\nstruct fcp_hdr_le {\n\tuint8_t d_id[3];\n\tuint8_t r_ctl;\n\tuint8_t s_id[3];\n\tuint8_t cs_ctl;\n\tuint8_t f_ctl[3];\n\tuint8_t type;\n\tuint16_t seq_cnt;\n\tuint8_t df_ctl;\n\tuint8_t seq_id;\n\tuint16_t rx_id;\n\tuint16_t ox_id;\n\tuint32_t parameter;\n} __packed;\n\n#define F_CTL_EXCH_CONTEXT_RESP\tBIT_23\n#define F_CTL_SEQ_CONTEXT_RESIP\tBIT_22\n#define F_CTL_LAST_SEQ\t\tBIT_20\n#define F_CTL_END_SEQ\t\tBIT_19\n#define F_CTL_SEQ_INITIATIVE\tBIT_16\n\n#define R_CTL_BASIC_LINK_SERV\t0x80\n#define R_CTL_B_ACC\t\t0x4\n#define R_CTL_B_RJT\t\t0x5\n\nstruct atio7_fcp_cmnd {\n\tuint64_t lun;\n\tuint8_t cmnd_ref;\n\tuint8_t task_attr:3;\n\tuint8_t reserved:5;\n\tuint8_t task_mgmt_flags;\n#define FCP_CMND_TASK_MGMT_CLEAR_ACA\t\t6\n#define FCP_CMND_TASK_MGMT_TARGET_RESET\t\t5\n#define FCP_CMND_TASK_MGMT_LU_RESET\t\t4\n#define FCP_CMND_TASK_MGMT_CLEAR_TASK_SET\t2\n#define FCP_CMND_TASK_MGMT_ABORT_TASK_SET\t1\n\tuint8_t wrdata:1;\n\tuint8_t rddata:1;\n\tuint8_t add_cdb_len:6;\n\tuint8_t cdb[16];\n\t/*\n\t * add_cdb is optional and can absent from struct atio7_fcp_cmnd. Size 4\n\t * only to make sizeof(struct atio7_fcp_cmnd) be as expected by\n\t * BUILD_BUG_ON in qlt_init().\n\t */\n\tuint8_t add_cdb[4];\n\t/* uint32_t data_length; */\n} __packed;\n\n/*\n * ISP queue -\tAccept Target I/O (ATIO) type entry IOCB structure.\n *\t\tThis is sent from the ISP to the target driver.\n */\nstruct atio_from_isp {\n\tunion {\n\t\tstruct {\n\t\t\tuint16_t entry_hdr;\n\t\t\tuint8_t sys_define; /* System defined. */\n\t\t\tuint8_t entry_status; /* Entry Status. */\n\t\t\tuint32_t sys_define_2; /* System defined. */\n\t\t\ttarget_id_t target;\n\t\t\tuint16_t rx_id;\n\t\t\tuint16_t flags;\n\t\t\tuint16_t status;\n\t\t\tuint8_t command_ref;\n\t\t\tuint8_t task_codes;\n\t\t\tuint8_t task_flags;\n\t\t\tuint8_t execution_codes;\n\t\t\tuint8_t cdb[MAX_CMDSZ];\n\t\t\tuint32_t data_length;\n\t\t\tuint16_t lun;\n\t\t\tuint8_t initiator_port_name[WWN_SIZE]; /* on qla23xx */\n\t\t\tuint16_t reserved_32[6];\n\t\t\tuint16_t ox_id;\n\t\t} isp2x;\n\t\tstruct {\n\t\t\tuint16_t entry_hdr;\n\t\t\tuint8_t fcp_cmnd_len_low;\n\t\t\tuint8_t fcp_cmnd_len_high:4;\n\t\t\tuint8_t attr:4;\n\t\t\tuint32_t exchange_addr;\n#define ATIO_EXCHANGE_ADDRESS_UNKNOWN\t0xFFFFFFFF\n\t\t\tstruct fcp_hdr fcp_hdr;\n\t\t\tstruct atio7_fcp_cmnd fcp_cmnd;\n\t\t} isp24;\n\t\tstruct {\n\t\t\tuint8_t entry_type;\t/* Entry type. */\n\t\t\tuint8_t entry_count;\t/* Entry count. */\n\t\t\tuint8_t data[58];\n\t\t\tuint32_t signature;\n#define ATIO_PROCESSED 0xDEADDEAD\t\t/* Signature */\n\t\t} raw;\n\t} u;\n} __packed;\n\n#define CTIO_TYPE7 0x12 /* Continue target I/O entry (for 24xx) */\n\n/*\n * ISP queue -\tContinue Target I/O (ATIO) type 7 entry (for 24xx) structure.\n *\t\tThis structure is sent to the ISP 24xx from the target driver.\n */\n\nstruct ctio7_to_24xx {\n\tuint8_t\t entry_type;\t\t /* Entry type. */\n\tuint8_t\t entry_count;\t\t /* Entry count. */\n\tuint8_t\t sys_define;\t\t /* System defined. */\n\tuint8_t\t entry_status;\t\t /* Entry Status. */\n\tuint32_t handle;\t\t /* System defined handle */\n\tuint16_t nport_handle;\n#define CTIO7_NHANDLE_UNRECOGNIZED\t0xFFFF\n\tuint16_t timeout;\n\tuint16_t dseg_count;\t\t /* Data segment count. */\n\tuint8_t vp_index;\n\tuint8_t add_flags;\n\tuint8_t initiator_id[3];\n\tuint8_t reserved;\n\tuint32_t exchange_addr;\n\tunion {\n\t\tstruct {\n\t\t\tuint16_t reserved1;\n\t\t\t__le16 flags;\n\t\t\tuint32_t residual;\n\t\t\t__le16 ox_id;\n\t\t\tuint16_t scsi_status;\n\t\t\tuint32_t relative_offset;\n\t\t\tuint32_t reserved2;\n\t\t\tuint32_t transfer_length;\n\t\t\tuint32_t reserved3;\n\t\t\t/* Data segment 0 address. */\n\t\t\tuint32_t dseg_0_address[2];\n\t\t\t/* Data segment 0 length. */\n\t\t\tuint32_t dseg_0_length;\n\t\t} status0;\n\t\tstruct {\n\t\t\tuint16_t sense_length;\n\t\t\tuint16_t flags;\n\t\t\tuint32_t residual;\n\t\t\t__le16 ox_id;\n\t\t\tuint16_t scsi_status;\n\t\t\tuint16_t response_len;\n\t\t\tuint16_t reserved;\n\t\t\tuint8_t sense_data[24];\n\t\t} status1;\n\t} u;\n} __packed;\n\n/*\n * ISP queue - CTIO type 7 from ISP 24xx to target driver\n * returned entry structure.\n */\nstruct ctio7_from_24xx {\n\tuint8_t\t entry_type;\t\t /* Entry type. */\n\tuint8_t\t entry_count;\t\t /* Entry count. */\n\tuint8_t\t sys_define;\t\t /* System defined. */\n\tuint8_t\t entry_status;\t\t /* Entry Status. */\n\tuint32_t handle;\t\t /* System defined handle */\n\tuint16_t status;\n\tuint16_t timeout;\n\tuint16_t dseg_count;\t\t /* Data segment count. */\n\tuint8_t vp_index;\n\tuint8_t reserved1[5];\n\tuint32_t exchange_address;\n\tuint16_t reserved2;\n\tuint16_t flags;\n\tuint32_t residual;\n\tuint16_t ox_id;\n\tuint16_t reserved3;\n\tuint32_t relative_offset;\n\tuint8_t reserved4[24];\n} __packed;\n\n/* CTIO7 flags values */\n#define CTIO7_FLAGS_SEND_STATUS\t\tBIT_15\n#define CTIO7_FLAGS_TERMINATE\t\tBIT_14\n#define CTIO7_FLAGS_CONFORM_REQ\t\tBIT_13\n#define CTIO7_FLAGS_DONT_RET_CTIO\tBIT_8\n#define CTIO7_FLAGS_STATUS_MODE_0\t0\n#define CTIO7_FLAGS_STATUS_MODE_1\tBIT_6\n#define CTIO7_FLAGS_STATUS_MODE_2\tBIT_7\n#define CTIO7_FLAGS_EXPLICIT_CONFORM\tBIT_5\n#define CTIO7_FLAGS_CONFIRM_SATISF\tBIT_4\n#define CTIO7_FLAGS_DSD_PTR\t\tBIT_2\n#define CTIO7_FLAGS_DATA_IN\t\tBIT_1 /* data to initiator */\n#define CTIO7_FLAGS_DATA_OUT\t\tBIT_0 /* data from initiator */\n\n#define ELS_PLOGI\t\t\t0x3\n#define ELS_FLOGI\t\t\t0x4\n#define ELS_LOGO\t\t\t0x5\n#define ELS_PRLI\t\t\t0x20\n#define ELS_PRLO\t\t\t0x21\n#define ELS_TPRLO\t\t\t0x24\n#define ELS_PDISC\t\t\t0x50\n#define ELS_ADISC\t\t\t0x52\n\n/*\n *CTIO Type CRC_2 IOCB\n */\nstruct ctio_crc2_to_fw {\n\tuint8_t entry_type;\t\t/* Entry type. */\n#define CTIO_CRC2 0x7A\n\tuint8_t entry_count;\t\t/* Entry count. */\n\tuint8_t sys_define;\t\t/* System defined. */\n\tuint8_t entry_status;\t\t/* Entry Status. */\n\n\tuint32_t handle;\t\t/* System handle. */\n\tuint16_t nport_handle;\t\t/* N_PORT handle. */\n\t__le16 timeout;\t\t/* Command timeout. */\n\n\tuint16_t dseg_count;\t\t/* Data segment count. */\n\tuint8_t vp_index;\n\tuint8_t add_flags;\t\t/* additional flags */\n#define CTIO_CRC2_AF_DIF_DSD_ENA BIT_3\n\n\tuint8_t initiator_id[3];\t/* initiator ID */\n\tuint8_t reserved1;\n\tuint32_t exchange_addr;\t\t/* rcv exchange address */\n\tuint16_t reserved2;\n\t__le16 flags;\t\t\t/* refer to CTIO7 flags values */\n\tuint32_t residual;\n\t__le16 ox_id;\n\tuint16_t scsi_status;\n\t__le32 relative_offset;\n\tuint32_t reserved5;\n\t__le32 transfer_length;\t\t/* total fc transfer length */\n\tuint32_t reserved6;\n\t__le32 crc_context_address[2];/* Data segment address. */\n\tuint16_t crc_context_len;\t/* Data segment length. */\n\tuint16_t reserved_1;\t\t/* MUST be set to 0. */\n} __packed;\n\n/* CTIO Type CRC_x Status IOCB */\nstruct ctio_crc_from_fw {\n\tuint8_t entry_type;\t\t/* Entry type. */\n\tuint8_t entry_count;\t\t/* Entry count. */\n\tuint8_t sys_define;\t\t/* System defined. */\n\tuint8_t entry_status;\t\t/* Entry Status. */\n\n\tuint32_t handle;\t\t/* System handle. */\n\tuint16_t status;\n\tuint16_t timeout;\t\t/* Command timeout. */\n\tuint16_t dseg_count;\t\t/* Data segment count. */\n\tuint32_t reserved1;\n\tuint16_t state_flags;\n#define CTIO_CRC_SF_DIF_CHOPPED BIT_4\n\n\tuint32_t exchange_address;\t/* rcv exchange address */\n\tuint16_t reserved2;\n\tuint16_t flags;\n\tuint32_t resid_xfer_length;\n\tuint16_t ox_id;\n\tuint8_t reserved3[12];\n\tuint16_t runt_guard;\t\t/* reported runt blk guard */\n\tuint8_t actual_dif[8];\n\tuint8_t expected_dif[8];\n} __packed;\n\n/*\n * ISP queue - ABTS received/response entries structure definition for 24xx.\n */\n#define ABTS_RECV_24XX\t\t0x54 /* ABTS received (for 24xx) */\n#define ABTS_RESP_24XX\t\t0x55 /* ABTS responce (for 24xx) */\n\n/*\n * ISP queue -\tABTS received IOCB entry structure definition for 24xx.\n *\t\tThe ABTS BLS received from the wire is sent to the\n *\t\ttarget driver by the ISP 24xx.\n *\t\tThe IOCB is placed on the response queue.\n */\nstruct abts_recv_from_24xx {\n\tuint8_t\t entry_type;\t\t /* Entry type. */\n\tuint8_t\t entry_count;\t\t /* Entry count. */\n\tuint8_t\t sys_define;\t\t /* System defined. */\n\tuint8_t\t entry_status;\t\t /* Entry Status. */\n\tuint8_t reserved_1[6];\n\tuint16_t nport_handle;\n\tuint8_t reserved_2[2];\n\tuint8_t vp_index;\n\tuint8_t reserved_3:4;\n\tuint8_t sof_type:4;\n\tuint32_t exchange_address;\n\tstruct fcp_hdr_le fcp_hdr_le;\n\tuint8_t reserved_4[16];\n\tuint32_t exchange_addr_to_abort;\n} __packed;\n\n#define ABTS_PARAM_ABORT_SEQ\t\tBIT_0\n\nstruct ba_acc_le {\n\tuint16_t reserved;\n\tuint8_t seq_id_last;\n\tuint8_t seq_id_valid;\n#define SEQ_ID_VALID\t0x80\n#define SEQ_ID_INVALID\t0x00\n\tuint16_t rx_id;\n\tuint16_t ox_id;\n\tuint16_t high_seq_cnt;\n\tuint16_t low_seq_cnt;\n} __packed;\n\nstruct ba_rjt_le {\n\tuint8_t vendor_uniq;\n\tuint8_t reason_expl;\n\tuint8_t reason_code;\n#define BA_RJT_REASON_CODE_INVALID_COMMAND\t0x1\n#define BA_RJT_REASON_CODE_UNABLE_TO_PERFORM\t0x9\n\tuint8_t reserved;\n} __packed;\n\n/*\n * ISP queue -\tABTS Response IOCB entry structure definition for 24xx.\n *\t\tThe ABTS response to the ABTS received is sent by the\n *\t\ttarget driver to the ISP 24xx.\n *\t\tThe IOCB is placed on the request queue.\n */\nstruct abts_resp_to_24xx {\n\tuint8_t\t entry_type;\t\t /* Entry type. */\n\tuint8_t\t entry_count;\t\t /* Entry count. */\n\tuint8_t\t sys_define;\t\t /* System defined. */\n\tuint8_t\t entry_status;\t\t /* Entry Status. */\n\tuint32_t handle;\n\tuint16_t reserved_1;\n\tuint16_t nport_handle;\n\tuint16_t control_flags;\n#define ABTS_CONTR_FLG_TERM_EXCHG\tBIT_0\n\tuint8_t vp_index;\n\tuint8_t reserved_3:4;\n\tuint8_t sof_type:4;\n\tuint32_t exchange_address;\n\tstruct fcp_hdr_le fcp_hdr_le;\n\tunion {\n\t\tstruct ba_acc_le ba_acct;\n\t\tstruct ba_rjt_le ba_rjt;\n\t} __packed payload;\n\tuint32_t reserved_4;\n\tuint32_t exchange_addr_to_abort;\n} __packed;\n\n/*\n * ISP queue -\tABTS Response IOCB from ISP24xx Firmware entry structure.\n *\t\tThe ABTS response with completion status to the ABTS response\n *\t\t(sent by the target driver to the ISP 24xx) is sent by the\n *\t\tISP24xx firmware to the target driver.\n *\t\tThe IOCB is placed on the response queue.\n */\nstruct abts_resp_from_24xx_fw {\n\tuint8_t\t entry_type;\t\t /* Entry type. */\n\tuint8_t\t entry_count;\t\t /* Entry count. */\n\tuint8_t\t sys_define;\t\t /* System defined. */\n\tuint8_t\t entry_status;\t\t /* Entry Status. */\n\tuint32_t handle;\n\tuint16_t compl_status;\n#define ABTS_RESP_COMPL_SUCCESS\t\t0\n#define ABTS_RESP_COMPL_SUBCODE_ERROR\t0x31\n\tuint16_t nport_handle;\n\tuint16_t reserved_1;\n\tuint8_t reserved_2;\n\tuint8_t reserved_3:4;\n\tuint8_t sof_type:4;\n\tuint32_t exchange_address;\n\tstruct fcp_hdr_le fcp_hdr_le;\n\tuint8_t reserved_4[8];\n\tuint32_t error_subcode1;\n#define ABTS_RESP_SUBCODE_ERR_ABORTED_EXCH_NOT_TERM\t0x1E\n\tuint32_t error_subcode2;\n\tuint32_t exchange_addr_to_abort;\n} __packed;\n\n/********************************************************************\\\n * Type Definitions used by initiator & target halves\n\\********************************************************************/\n\nstruct qla_tgt_mgmt_cmd;\nstruct qla_tgt_sess;\n\n/*\n * This structure provides a template of function calls that the\n * target driver (from within qla_target.c) can issue to the\n * target module (tcm_qla2xxx).\n */\nstruct qla_tgt_func_tmpl {\n\n\tint (*handle_cmd)(struct scsi_qla_host *, struct qla_tgt_cmd *,\n\t\t\tunsigned char *, uint32_t, int, int, int);\n\tvoid (*handle_data)(struct qla_tgt_cmd *);\n\tvoid (*handle_dif_err)(struct qla_tgt_cmd *);\n\tint (*handle_tmr)(struct qla_tgt_mgmt_cmd *, uint32_t, uint8_t,\n\t\t\tuint32_t);\n\tvoid (*free_cmd)(struct qla_tgt_cmd *);\n\tvoid (*free_mcmd)(struct qla_tgt_mgmt_cmd *);\n\tvoid (*free_session)(struct qla_tgt_sess *);\n\n\tint (*check_initiator_node_acl)(struct scsi_qla_host *, unsigned char *,\n\t\t\t\t\tvoid *, uint8_t *, uint16_t);\n\tvoid (*update_sess)(struct qla_tgt_sess *, port_id_t, uint16_t, bool);\n\tstruct qla_tgt_sess *(*find_sess_by_loop_id)(struct scsi_qla_host *,\n\t\t\t\t\t\tconst uint16_t);\n\tstruct qla_tgt_sess *(*find_sess_by_s_id)(struct scsi_qla_host *,\n\t\t\t\t\t\tconst uint8_t *);\n\tvoid (*clear_nacl_from_fcport_map)(struct qla_tgt_sess *);\n\tvoid (*put_sess)(struct qla_tgt_sess *);\n\tvoid (*shutdown_sess)(struct qla_tgt_sess *);\n};\n\nint qla2x00_wait_for_hba_online(struct scsi_qla_host *);\n\n#include \n\n#define QLA_TGT_TIMEOUT\t\t\t10\t/* in seconds */\n\n#define QLA_TGT_MAX_HW_PENDING_TIME\t60 /* in seconds */\n\n/* Immediate notify status constants */\n#define IMM_NTFY_LIP_RESET 0x000E\n#define IMM_NTFY_LIP_LINK_REINIT 0x000F\n#define IMM_NTFY_IOCB_OVERFLOW 0x0016\n#define IMM_NTFY_ABORT_TASK 0x0020\n#define IMM_NTFY_PORT_LOGOUT 0x0029\n#define IMM_NTFY_PORT_CONFIG 0x002A\n#define IMM_NTFY_GLBL_TPRLO 0x002D\n#define IMM_NTFY_GLBL_LOGO 0x002E\n#define IMM_NTFY_RESOURCE 0x0034\n#define IMM_NTFY_MSG_RX 0x0036\n#define IMM_NTFY_SRR 0x0045\n#define IMM_NTFY_ELS 0x0046\n\n/* Immediate notify task flags */\n#define IMM_NTFY_TASK_MGMT_SHIFT 8\n\n#define QLA_TGT_CLEAR_ACA 0x40\n#define QLA_TGT_TARGET_RESET 0x20\n#define QLA_TGT_LUN_RESET 0x10\n#define QLA_TGT_CLEAR_TS 0x04\n#define QLA_TGT_ABORT_TS 0x02\n#define QLA_TGT_ABORT_ALL_SESS 0xFFFF\n#define QLA_TGT_ABORT_ALL 0xFFFE\n#define QLA_TGT_NEXUS_LOSS_SESS 0xFFFD\n#define QLA_TGT_NEXUS_LOSS 0xFFFC\n\n/* Notify Acknowledge flags */\n#define NOTIFY_ACK_RES_COUNT BIT_8\n#define NOTIFY_ACK_CLEAR_LIP_RESET BIT_5\n#define NOTIFY_ACK_TM_RESP_CODE_VALID BIT_4\n\n/* Command's states */\n#define QLA_TGT_STATE_NEW\t\t0 /* New command + target processing */\n#define QLA_TGT_STATE_NEED_DATA\t\t1 /* target needs data to continue */\n#define QLA_TGT_STATE_DATA_IN\t\t2 /* Data arrived + target processing */\n#define QLA_TGT_STATE_PROCESSED\t\t3 /* target done processing */\n#define QLA_TGT_STATE_ABORTED\t\t4 /* Command aborted */\n\n/* Special handles */\n#define QLA_TGT_NULL_HANDLE\t0\n#define QLA_TGT_SKIP_HANDLE\t(0xFFFFFFFF & ~CTIO_COMPLETION_HANDLE_MARK)\n\n/* ATIO task_codes field */\n#define ATIO_SIMPLE_QUEUE 0\n#define ATIO_HEAD_OF_QUEUE 1\n#define ATIO_ORDERED_QUEUE 2\n#define ATIO_ACA_QUEUE 4\n#define ATIO_UNTAGGED 5\n\n/* TM failed response codes, see FCP (9.4.11 FCP_RSP_INFO) */\n#define\tFC_TM_SUCCESS 0\n#define\tFC_TM_BAD_FCP_DATA 1\n#define\tFC_TM_BAD_CMD 2\n#define\tFC_TM_FCP_DATA_MISMATCH 3\n#define\tFC_TM_REJECT 4\n#define FC_TM_FAILED 5\n\n/*\n * Error code of qlt_pre_xmit_response() meaning that cmd's exchange was\n * terminated, so no more actions is needed and success should be returned\n * to target.\n */\n#define QLA_TGT_PRE_XMIT_RESP_CMD_ABORTED\t0x1717\n\n#if (BITS_PER_LONG > 32) || defined(CONFIG_HIGHMEM64G)\n#define pci_dma_lo32(a) (a & 0xffffffff)\n#define pci_dma_hi32(a) ((((a) >> 16)>>16) & 0xffffffff)\n#else\n#define pci_dma_lo32(a) (a & 0xffffffff)\n#define pci_dma_hi32(a) 0\n#endif\n\n#define QLA_TGT_SENSE_VALID(sense) ((sense != NULL) && \\\n\t\t\t\t(((const uint8_t *)(sense))[0] & 0x70) == 0x70)\n\nstruct qla_port_24xx_data {\n\tuint8_t port_name[WWN_SIZE];\n\tuint16_t loop_id;\n\tuint16_t reserved;\n};\n\nstruct qla_tgt {\n\tstruct scsi_qla_host *vha;\n\tstruct qla_hw_data *ha;\n\n\t/*\n\t * To sync between IRQ handlers and qlt_target_release(). Needed,\n\t * because req_pkt() can drop/reaquire HW lock inside. Protected by\n\t * HW lock.\n\t */\n\tint irq_cmd_count;\n\n\tint datasegs_per_cmd, datasegs_per_cont, sg_tablesize;\n\n\t/* Target's flags, serialized by pha->hardware_lock */\n\tunsigned int tgt_enable_64bit_addr:1; /* 64-bits PCI addr enabled */\n\tunsigned int link_reinit_iocb_pending:1;\n\n\t/*\n\t * Protected by tgt_mutex AND hardware_lock for writing and tgt_mutex\n\t * OR hardware_lock for reading.\n\t */\n\tint tgt_stop; /* the target mode driver is being stopped */\n\tint tgt_stopped; /* the target mode driver has been stopped */\n\n\t/* Count of sessions refering qla_tgt. Protected by hardware_lock. */\n\tint sess_count;\n\n\t/* Protected by hardware_lock. Addition also protected by tgt_mutex. */\n\tstruct list_head sess_list;\n\n\t/* Protected by hardware_lock */\n\tstruct list_head del_sess_list;\n\tstruct delayed_work sess_del_work;\n\n\tspinlock_t sess_work_lock;\n\tstruct list_head sess_works_list;\n\tstruct work_struct sess_work;\n\n\tstruct imm_ntfy_from_isp link_reinit_iocb;\n\twait_queue_head_t waitQ;\n\tint notify_ack_expected;\n\tint abts_resp_expected;\n\tint modify_lun_expected;\n\n\tint ctio_srr_id;\n\tint imm_srr_id;\n\tspinlock_t srr_lock;\n\tstruct list_head srr_ctio_list;\n\tstruct list_head srr_imm_list;\n\tstruct work_struct srr_work;\n\n\tatomic_t tgt_global_resets_count;\n\n\tstruct list_head tgt_list_entry;\n};\n\nstruct qla_tgt_sess_op {\n\tstruct scsi_qla_host *vha;\n\tstruct atio_from_isp atio;\n\tstruct work_struct work;\n};\n\n/*\n * Equivilant to IT Nexus (Initiator-Target)\n */\nstruct qla_tgt_sess {\n\tuint16_t loop_id;\n\tport_id_t s_id;\n\n\tunsigned int conf_compl_supported:1;\n\tunsigned int deleted:1;\n\tunsigned int local:1;\n\n\tstruct se_session *se_sess;\n\tstruct scsi_qla_host *vha;\n\tstruct qla_tgt *tgt;\n\n\tstruct list_head sess_list_entry;\n\tunsigned long expires;\n\tstruct list_head del_list_entry;\n\n\tuint8_t port_name[WWN_SIZE];\n\tstruct work_struct free_work;\n};\n\nstruct qla_tgt_cmd {\n\tstruct se_cmd se_cmd;\n\tstruct qla_tgt_sess *sess;\n\tint state;\n\tstruct work_struct free_work;\n\tstruct work_struct work;\n\t/* Sense buffer that will be mapped into outgoing status */\n\tunsigned char sense_buffer[TRANSPORT_SENSE_BUFFER];\n\n\t/* to save extra sess dereferences */\n\tunsigned int conf_compl_supported:1;\n\tunsigned int sg_mapped:1;\n\tunsigned int free_sg:1;\n\tunsigned int aborted:1; /* Needed in case of SRR */\n\tunsigned int write_data_transferred:1;\n\tunsigned int ctx_dsd_alloced:1;\n\tunsigned int q_full:1;\n\tunsigned int term_exchg:1;\n\tunsigned int cmd_sent_to_fw:1;\n\tunsigned int cmd_in_wq:1;\n\n\tstruct scatterlist *sg;\t/* cmd data buffer SG vector */\n\tint sg_cnt;\t\t/* SG segments count */\n\tint bufflen;\t\t/* cmd buffer length */\n\tint offset;\n\tuint32_t tag;\n\tuint32_t unpacked_lun;\n\tenum dma_data_direction dma_data_direction;\n\tuint32_t reset_count;\n\n\tuint16_t loop_id;\t/* to save extra sess dereferences */\n\tstruct qla_tgt *tgt;\t/* to save extra sess dereferences */\n\tstruct scsi_qla_host *vha;\n\tstruct list_head cmd_list;\n\n\tstruct atio_from_isp atio;\n\t/* t10dif */\n\tstruct scatterlist *prot_sg;\n\tuint32_t prot_sg_cnt;\n\tuint32_t blk_sz;\n\tstruct crc_context *ctx;\n\n\tuint64_t jiffies_at_alloc;\n\tuint64_t jiffies_at_free;\n\t/* BIT_0 - Atio Arrival / schedule to work\n\t * BIT_1 - qlt_do_work\n\t * BIT_2 - qlt_do work failed\n\t * BIT_3 - xfer rdy/tcm_qla2xxx_write_pending\n\t * BIT_4 - read respond/tcm_qla2xx_queue_data_in\n\t * BIT_5 - status respond / tcm_qla2xx_queue_status\n\t * BIT_6 - tcm request to abort/Term exchange.\n\t *\tpre_xmit_response->qlt_send_term_exchange\n\t * BIT_7 - SRR received (qlt_handle_srr->qlt_xmit_response)\n\t * BIT_8 - SRR received (qlt_handle_srr->qlt_rdy_to_xfer)\n\t * BIT_9 - SRR received (qla_handle_srr->qlt_send_term_exchange)\n\t * BIT_10 - Data in - hanlde_data->tcm_qla2xxx_handle_data\n\t * BIT_11 - Data actually going to TCM : tcm_qla2xx_handle_data_work\n\t * BIT_12 - good completion - qlt_ctio_do_completion -->free_cmd\n\t * BIT_13 - Bad completion -\n\t *\tqlt_ctio_do_completion --> qlt_term_ctio_exchange\n\t * BIT_14 - Back end data received/sent.\n\t * BIT_15 - SRR prepare ctio\n\t * BIT_16 - complete free\n\t */\n\tuint32_t cmd_flags;\n};\n\nstruct qla_tgt_sess_work_param {\n\tstruct list_head sess_works_list_entry;\n\n#define QLA_TGT_SESS_WORK_ABORT\t1\n#define QLA_TGT_SESS_WORK_TM\t2\n\tint type;\n\n\tunion {\n\t\tstruct abts_recv_from_24xx abts;\n\t\tstruct imm_ntfy_from_isp tm_iocb;\n\t\tstruct atio_from_isp tm_iocb2;\n\t};\n};\n\nstruct qla_tgt_mgmt_cmd {\n\tuint8_t tmr_func;\n\tuint8_t fc_tm_rsp;\n\tstruct qla_tgt_sess *sess;\n\tstruct se_cmd se_cmd;\n\tstruct work_struct free_work;\n\tunsigned int flags;\n\tuint32_t reset_count;\n#define QLA24XX_MGMT_SEND_NACK\t1\n\tunion {\n\t\tstruct atio_from_isp atio;\n\t\tstruct imm_ntfy_from_isp imm_ntfy;\n\t\tstruct abts_recv_from_24xx abts;\n\t} __packed orig_iocb;\n};\n\nstruct qla_tgt_prm {\n\tstruct qla_tgt_cmd *cmd;\n\tstruct qla_tgt *tgt;\n\tvoid *pkt;\n\tstruct scatterlist *sg;\t/* cmd data buffer SG vector */\n\tunsigned char *sense_buffer;\n\tint seg_cnt;\n\tint req_cnt;\n\tuint16_t rq_result;\n\tuint16_t scsi_status;\n\tint sense_buffer_len;\n\tint residual;\n\tint add_status_pkt;\n\t/* dif */\n\tstruct scatterlist *prot_sg;\n\tuint16_t prot_seg_cnt;\n\tuint16_t tot_dsds;\n};\n\nstruct qla_tgt_srr_imm {\n\tstruct list_head srr_list_entry;\n\tint srr_id;\n\tstruct imm_ntfy_from_isp imm_ntfy;\n};\n\nstruct qla_tgt_srr_ctio {\n\tstruct list_head srr_list_entry;\n\tint srr_id;\n\tstruct qla_tgt_cmd *cmd;\n};\n\n#define QLA_TGT_XMIT_DATA\t\t1\n#define QLA_TGT_XMIT_STATUS\t\t2\n#define QLA_TGT_XMIT_ALL\t\t(QLA_TGT_XMIT_STATUS|QLA_TGT_XMIT_DATA)\n\n\nextern struct qla_tgt_data qla_target;\n\n/*\n * Function prototypes for qla_target.c logic used by qla2xxx LLD code.\n */\nextern int qlt_add_target(struct qla_hw_data *, struct scsi_qla_host *);\nextern int qlt_remove_target(struct qla_hw_data *, struct scsi_qla_host *);\nextern int qlt_lport_register(void *, u64, u64, u64,\n\t\t\tint (*callback)(struct scsi_qla_host *, void *, u64, u64));\nextern void qlt_lport_deregister(struct scsi_qla_host *);\nextern void qlt_unreg_sess(struct qla_tgt_sess *);\nextern void qlt_fc_port_added(struct scsi_qla_host *, fc_port_t *);\nextern void qlt_fc_port_deleted(struct scsi_qla_host *, fc_port_t *);\nextern int __init qlt_init(void);\nextern void qlt_exit(void);\nextern void qlt_update_vp_map(struct scsi_qla_host *, int);\n\n/*\n * This macro is used during early initializations when host->active_mode\n * is not set. Right now, ha value is ignored.\n */\n#define QLA_TGT_MODE_ENABLED() (ql2x_ini_mode != QLA2XXX_INI_MODE_ENABLED)\nextern int ql2x_ini_mode;\n\nstatic inline bool qla_tgt_mode_enabled(struct scsi_qla_host *ha)\n{\n\treturn ha->host->active_mode & MODE_TARGET;\n}\n\nstatic inline bool qla_ini_mode_enabled(struct scsi_qla_host *ha)\n{\n\treturn ha->host->active_mode & MODE_INITIATOR;\n}\n\nstatic inline void qla_reverse_ini_mode(struct scsi_qla_host *ha)\n{\n\tif (ha->host->active_mode & MODE_INITIATOR)\n\t\tha->host->active_mode &= ~MODE_INITIATOR;\n\telse\n\t\tha->host->active_mode |= MODE_INITIATOR;\n}\n\n/*\n * Exported symbols from qla_target.c LLD logic used by qla2xxx code..\n */\nextern void qlt_response_pkt_all_vps(struct scsi_qla_host *, response_t *);\nextern int qlt_rdy_to_xfer(struct qla_tgt_cmd *);\nextern int qlt_xmit_response(struct qla_tgt_cmd *, int, uint8_t);\nextern void qlt_xmit_tm_rsp(struct qla_tgt_mgmt_cmd *);\nextern void qlt_free_mcmd(struct qla_tgt_mgmt_cmd *);\nextern void qlt_free_cmd(struct qla_tgt_cmd *cmd);\nextern void qlt_async_event(uint16_t, struct scsi_qla_host *, uint16_t *);\nextern void qlt_enable_vha(struct scsi_qla_host *);\nextern void qlt_vport_create(struct scsi_qla_host *, struct qla_hw_data *);\nextern void qlt_rff_id(struct scsi_qla_host *, struct ct_sns_req *);\nextern void qlt_init_atio_q_entries(struct scsi_qla_host *);\nextern void qlt_24xx_process_atio_queue(struct scsi_qla_host *);\nextern void qlt_24xx_config_rings(struct scsi_qla_host *);\nextern void qlt_24xx_config_nvram_stage1(struct scsi_qla_host *,\n\tstruct nvram_24xx *);\nextern void qlt_24xx_config_nvram_stage2(struct scsi_qla_host *,\n\tstruct init_cb_24xx *);\nextern void qlt_81xx_config_nvram_stage2(struct scsi_qla_host *,\n\tstruct init_cb_81xx *);\nextern void qlt_81xx_config_nvram_stage1(struct scsi_qla_host *,\n\tstruct nvram_81xx *);\nextern int qlt_24xx_process_response_error(struct scsi_qla_host *,\n\tstruct sts_entry_24xx *);\nextern void qlt_modify_vp_config(struct scsi_qla_host *,\n\tstruct vp_config_entry_24xx *);\nextern void qlt_probe_one_stage1(struct scsi_qla_host *, struct qla_hw_data *);\nextern int qlt_mem_alloc(struct qla_hw_data *);\nextern void qlt_mem_free(struct qla_hw_data *);\nextern int qlt_stop_phase1(struct qla_tgt *);\nextern void qlt_stop_phase2(struct qla_tgt *);\nextern irqreturn_t qla83xx_msix_atio_q(int, void *);\nextern void qlt_83xx_iospace_config(struct qla_hw_data *);\nextern int qlt_free_qfull_cmds(struct scsi_qla_host *);\n\n#endif /* __QLA_TARGET_H */\n"} +{"text": "/*\r\n * Copyright (c) Mirth Corporation. All rights reserved.\r\n * \r\n * http://www.mirthcorp.com\r\n * \r\n * The software in this package is published under the terms of the MPL license a copy of which has\r\n * been included with this distribution in the LICENSE.txt file.\r\n */\r\n\r\npackage com.mirth.connect.plugins.dashboardstatus;\r\n\r\nimport java.awt.Color;\r\nimport java.util.LinkedList;\r\nimport java.util.Map;\r\nimport java.util.Set;\r\n\r\nimport com.mirth.connect.donkey.model.event.ConnectionStatusEventType;\r\nimport com.mirth.connect.donkey.model.event.Event;\r\nimport com.mirth.connect.donkey.server.event.EventType;\r\nimport com.mirth.connect.server.event.EventListener;\r\n\r\npublic class DashboardConnectorEventListener extends EventListener {\r\n\r\n private ConnectionStatusLogController logController;\r\n\r\n public DashboardConnectorEventListener() {\r\n logController = ConnectionStatusLogController.getInstance();\r\n }\r\n\r\n @Override\r\n protected void onShutdown() {}\r\n\r\n @Override\r\n public Set getEventTypes() {\r\n return logController.getEventTypes();\r\n }\r\n\r\n @Override\r\n protected void processEvent(Event event) {\r\n logController.processEvent(event);\r\n }\r\n\r\n public Map getConnectorStateMap(String serverId) {\r\n return logController.getConnectorStateMap(serverId);\r\n }\r\n\r\n public synchronized LinkedList getChannelLog(String serverId, String channelId, int fetchSize, Long lastLogId) {\r\n return logController.getChannelLog(serverId, channelId, fetchSize, lastLogId);\r\n }\r\n\r\n public Color getColor(ConnectionStatusEventType type) {\r\n return logController.getColor(type);\r\n }\r\n\r\n}\r\n"} +{"text": "// Copyright 2012-present Oliver Eilhard. All rights reserved.\n// Use of this source code is governed by a MIT-license.\n// See http://olivere.mit-license.org/license.txt for details.\n\npackage elastic\n\n// RegexpQuery allows you to use regular expression term queries.\n//\n// For more details, see\n// https://www.elastic.co/guide/en/elasticsearch/reference/7.x/query-dsl-regexp-query.html\ntype RegexpQuery struct {\n\tname string\n\tregexp string\n\tflags string\n\tboost *float64\n\trewrite string\n\tqueryName string\n\tmaxDeterminizedStates *int\n}\n\n// NewRegexpQuery creates and initializes a new RegexpQuery.\nfunc NewRegexpQuery(name string, regexp string) *RegexpQuery {\n\treturn &RegexpQuery{name: name, regexp: regexp}\n}\n\n// Flags sets the regexp flags.\nfunc (q *RegexpQuery) Flags(flags string) *RegexpQuery {\n\tq.flags = flags\n\treturn q\n}\n\n// MaxDeterminizedStates protects against complex regular expressions.\nfunc (q *RegexpQuery) MaxDeterminizedStates(maxDeterminizedStates int) *RegexpQuery {\n\tq.maxDeterminizedStates = &maxDeterminizedStates\n\treturn q\n}\n\n// Boost sets the boost for this query.\nfunc (q *RegexpQuery) Boost(boost float64) *RegexpQuery {\n\tq.boost = &boost\n\treturn q\n}\n\nfunc (q *RegexpQuery) Rewrite(rewrite string) *RegexpQuery {\n\tq.rewrite = rewrite\n\treturn q\n}\n\n// QueryName sets the query name for the filter that can be used\n// when searching for matched_filters per hit\nfunc (q *RegexpQuery) QueryName(queryName string) *RegexpQuery {\n\tq.queryName = queryName\n\treturn q\n}\n\n// Source returns the JSON-serializable query data.\nfunc (q *RegexpQuery) Source() (interface{}, error) {\n\tsource := make(map[string]interface{})\n\tquery := make(map[string]interface{})\n\tsource[\"regexp\"] = query\n\n\tx := make(map[string]interface{})\n\tx[\"value\"] = q.regexp\n\tif q.flags != \"\" {\n\t\tx[\"flags\"] = q.flags\n\t}\n\tif q.maxDeterminizedStates != nil {\n\t\tx[\"max_determinized_states\"] = *q.maxDeterminizedStates\n\t}\n\tif q.boost != nil {\n\t\tx[\"boost\"] = *q.boost\n\t}\n\tif q.rewrite != \"\" {\n\t\tx[\"rewrite\"] = q.rewrite\n\t}\n\tif q.queryName != \"\" {\n\t\tx[\"name\"] = q.queryName\n\t}\n\tquery[q.name] = x\n\n\treturn source, nil\n}\n"} +{"text": "\n\n\n \n\n"} +{"text": "\n\n\n\n\tActivePerspectiveName\n\tProject\n\tAllowedModules\n\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\tn\n\t\t\tModule\n\t\t\tPBXSmartGroupTreeModule\n\t\t\tName\n\t\t\tGroups and Files Outline View\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\tn\n\t\t\tModule\n\t\t\tPBXNavigatorGroup\n\t\t\tName\n\t\t\tEditor\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\tn\n\t\t\tModule\n\t\t\tXCTaskListModule\n\t\t\tName\n\t\t\tTask List\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\tn\n\t\t\tModule\n\t\t\tXCDetailModule\n\t\t\tName\n\t\t\tFile and Smart Group Detail Viewer\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\t1\n\t\t\tModule\n\t\t\tPBXBuildResultsModule\n\t\t\tName\n\t\t\tDetailed Build Results Viewer\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\t1\n\t\t\tModule\n\t\t\tPBXProjectFindModule\n\t\t\tName\n\t\t\tProject Batch Find Tool\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\tn\n\t\t\tModule\n\t\t\tXCProjectFormatConflictsModule\n\t\t\tName\n\t\t\tProject Format Conflicts List\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\tn\n\t\t\tModule\n\t\t\tPBXBookmarksModule\n\t\t\tName\n\t\t\tBookmarks Tool\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\tn\n\t\t\tModule\n\t\t\tPBXClassBrowserModule\n\t\t\tName\n\t\t\tClass Browser\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\tn\n\t\t\tModule\n\t\t\tPBXCVSModule\n\t\t\tName\n\t\t\tSource Code Control Tool\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\tn\n\t\t\tModule\n\t\t\tPBXDebugBreakpointsModule\n\t\t\tName\n\t\t\tDebug Breakpoints Tool\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\tn\n\t\t\tModule\n\t\t\tXCDockableInspector\n\t\t\tName\n\t\t\tInspector\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\tn\n\t\t\tModule\n\t\t\tPBXOpenQuicklyModule\n\t\t\tName\n\t\t\tOpen Quickly Tool\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\t1\n\t\t\tModule\n\t\t\tPBXDebugSessionModule\n\t\t\tName\n\t\t\tDebugger\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\t1\n\t\t\tModule\n\t\t\tPBXDebugCLIModule\n\t\t\tName\n\t\t\tDebug Console\n\t\t\n\t\t\n\t\t\tBundleLoadPath\n\t\t\t\n\t\t\tMaxInstances\n\t\t\tn\n\t\t\tModule\n\t\t\tXCSnapshotModule\n\t\t\tName\n\t\t\tSnapshots Tool\n\t\t\n\t\n\tBundlePath\n\t/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources\n\tDescription\n\tAIODescriptionKey\n\tDockingSystemVisible\n\t\n\tExtension\n\tperspectivev3\n\tFavBarConfig\n\t\n\t\tPBXProjectModuleGUID\n\t\t8BD7274F1D46E5A5000176F0\n\t\tXCBarModuleItemNames\n\t\t\n\t\tXCBarModuleItems\n\t\t\n\t\n\tFirstTimeWindowDisplayed\n\t\n\tIdentifier\n\tcom.apple.perspectives.project.defaultV3\n\tMajorVersion\n\t34\n\tMinorVersion\n\t0\n\tName\n\tAll-In-One\n\tNotifications\n\t\n\t\t\n\t\t\tXCObserverAutoDisconnectKey\n\t\t\t\n\t\t\tXCObserverDefintionKey\n\t\t\t\n\t\t\t\tPBXStatusErrorsKey\n\t\t\t\t0\n\t\t\t\n\t\t\tXCObserverFactoryKey\n\t\t\tXCPerspectivesSpecificationIdentifier\n\t\t\tXCObserverGUIDKey\n\t\t\tXCObserverProjectIdentifier\n\t\t\tXCObserverNotificationKey\n\t\t\tPBXStatusBuildStateMessageNotification\n\t\t\tXCObserverTargetKey\n\t\t\tXCMainBuildResultsModuleGUID\n\t\t\tXCObserverTriggerKey\n\t\t\tawakenModuleWithObserver:\n\t\t\tXCObserverValidationKey\n\t\t\t\n\t\t\t\tPBXStatusErrorsKey\n\t\t\t\t2\n\t\t\t\n\t\t\n\t\n\tOpenEditors\n\t\n\tPerspectiveWidths\n\t\n\t\t841\n\t\t841\n\t\n\tPerspectives\n\t\n\t\t\n\t\t\tChosenToolbarItems\n\t\t\t\n\t\t\t\tXCToolbarPerspectiveControl\n\t\t\t\tNSToolbarSeparatorItem\n\t\t\t\tactive-combo-popup\n\t\t\t\taction\n\t\t\t\tNSToolbarFlexibleSpaceItem\n\t\t\t\tdebugger-enable-breakpoints\n\t\t\t\tbuild-and-go\n\t\t\t\tcom.apple.ide.PBXToolbarStopButton\n\t\t\t\tget-info\n\t\t\t\tNSToolbarFlexibleSpaceItem\n\t\t\t\tcom.apple.pbx.toolbar.searchfield\n\t\t\t\n\t\t\tControllerClassBaseName\n\t\t\t\n\t\t\tIconName\n\t\t\tWindowOfProject\n\t\t\tIdentifier\n\t\t\tperspective.project\n\t\t\tIsVertical\n\t\t\t\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\n\t\t\t\t\t\tPBXBottomSmartGroupGIDs\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t1C37FBAC04509CD000000102\n\t\t\t\t\t\t\t1C37FAAC04509CD000000102\n\t\t\t\t\t\t\t1C37FABC05509CD000000102\n\t\t\t\t\t\t\t1C37FABC05539CD112110102\n\t\t\t\t\t\t\tE2644B35053B69B200211256\n\t\t\t\t\t\t\t1C37FABC04509CD000100104\n\t\t\t\t\t\t\t1CC0EA4004350EF90044410B\n\t\t\t\t\t\t\t1CC0EA4004350EF90041110B\n\t\t\t\t\t\t\t1C77FABC04509CD000000102\n\t\t\t\t\t\t\n\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t1CA23ED40692098700951B8B\n\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\tFiles\n\t\t\t\t\t\tPBXProjectStructureProvided\n\t\t\t\t\t\tyes\n\t\t\t\t\t\tPBXSmartGroupTreeModuleColumnData\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tPBXSmartGroupTreeModuleColumnWidthsKey\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t288\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tPBXSmartGroupTreeModuleColumnsKey_v4\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tMainColumn\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tPBXSmartGroupTreeModuleOutlineStateKey_v7\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tPBXSmartGroupTreeModuleOutlineStateExpansionKey\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t089C166AFE841209C02AAC07\n\t\t\t\t\t\t\t\t08FB77ADFE841716C02AAC07\n\t\t\t\t\t\t\t\t8BA05A56072072A900365D66\n\t\t\t\t\t\t\t\t089C167CFE841241C02AAC07\n\t\t\t\t\t\t\t\t1C37FBAC04509CD000000102\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tPBXSmartGroupTreeModuleOutlineStateSelectionKey\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t4\n\t\t\t\t\t\t\t\t\t2\n\t\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tPBXSmartGroupTreeModuleOutlineStateVisibleRectKey\n\t\t\t\t\t\t\t{{0, 0}, {288, 595}}\n\t\t\t\t\t\t\n\t\t\t\t\t\tPBXTopSmartGroupGIDs\n\t\t\t\t\t\t\n\t\t\t\t\t\tXCIncludePerspectivesSwitch\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\n\t\t\t\t\t\tFrame\n\t\t\t\t\t\t{{0, 0}, {305, 613}}\n\t\t\t\t\t\tGroupTreeTableConfiguration\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tMainColumn\n\t\t\t\t\t\t\t288\n\t\t\t\t\t\t\n\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t400 207 841 654 0 0 1440 878 \n\t\t\t\t\t\n\t\t\t\t\tModule\n\t\t\t\t\tPBXSmartGroupTreeModule\n\t\t\t\t\tProportion\n\t\t\t\t\t305pt\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tDock\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t8BD7274A1D46E5A5000176F0\n\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\tTapeDelay.cpp\n\t\t\t\t\t\t\t\tPBXSplitModuleInNavigatorKey\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tSplit0\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t\t\t8BD7274B1D46E5A5000176F0\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\t\t\tTapeDelay.cpp\n\t\t\t\t\t\t\t\t\t\t_historyCapacity\n\t\t\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\t\t\tbookmark\n\t\t\t\t\t\t\t\t\t\t8B79313D21F4ADA2006E9731\n\t\t\t\t\t\t\t\t\t\thistory\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t8BBB310821B8995100825986\n\t\t\t\t\t\t\t\t\t\t\t8B79312721F4AD85006E9731\n\t\t\t\t\t\t\t\t\t\t\t8B79313821F4AD8C006E9731\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tSplitCount\n\t\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tStatusBarVisibility\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tXCSharingToken\n\t\t\t\t\t\t\t\tcom.apple.Xcode.CommonNavigatorGroupSharingToken\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t{{0, 0}, {531, 430}}\n\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t400 207 841 654 0 0 1440 878 \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tPBXNavigatorGroup\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t430pt\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t178pt\n\t\t\t\t\t\t\tTabs\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t\t\t1CA23EDF0692099D00951B8B\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\t\t\tDetail\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t\t\t{{10, 27}, {531, 151}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\t\t\tXCDetailModule\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t\t\t1CA23EE00692099D00951B8B\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\t\t\tProject Find\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t\t\t{{10, 31}, {603, 297}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\t\t\tPBXProjectFindModule\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tPBXCVSModuleFilterTypeKey\n\t\t\t\t\t\t\t\t\t\t1032\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t\t\t1CA23EE10692099D00951B8B\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\t\t\tSCM Results\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t\t\t{{10, 31}, {603, 297}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\t\t\tPBXCVSModule\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t\t\tXCMainBuildResultsModuleGUID\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\t\t\tBuild Results\n\t\t\t\t\t\t\t\t\t\tXCBuildResultsTrigger_Collapse\n\t\t\t\t\t\t\t\t\t\t1023\n\t\t\t\t\t\t\t\t\t\tXCBuildResultsTrigger_Open\n\t\t\t\t\t\t\t\t\t\t1012\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t\t\t{{10, 27}, {531, 151}}\n\t\t\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t\t\t400 207 841 654 0 0 1440 878 \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\t\t\tPBXBuildResultsModule\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tProportion\n\t\t\t\t\t531pt\n\t\t\t\t\n\t\t\t\n\t\t\tName\n\t\t\tProject\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tXCModuleDock\n\t\t\t\tPBXSmartGroupTreeModule\n\t\t\t\tXCModuleDock\n\t\t\t\tPBXNavigatorGroup\n\t\t\t\tXCDockableTabModule\n\t\t\t\tXCDetailModule\n\t\t\t\tPBXProjectFindModule\n\t\t\t\tPBXCVSModule\n\t\t\t\tPBXBuildResultsModule\n\t\t\t\n\t\t\tTableOfContents\n\t\t\t\n\t\t\t\t8B79313E21F4ADA2006E9731\n\t\t\t\t1CA23ED40692098700951B8B\n\t\t\t\t8B79313F21F4ADA2006E9731\n\t\t\t\t8BD7274A1D46E5A5000176F0\n\t\t\t\t8B79314021F4ADA2006E9731\n\t\t\t\t1CA23EDF0692099D00951B8B\n\t\t\t\t1CA23EE00692099D00951B8B\n\t\t\t\t1CA23EE10692099D00951B8B\n\t\t\t\tXCMainBuildResultsModuleGUID\n\t\t\t\n\t\t\tToolbarConfigUserDefaultsMinorVersion\n\t\t\t2\n\t\t\tToolbarConfiguration\n\t\t\txcode.toolbar.config.defaultV3\n\t\t\n\t\t\n\t\t\tChosenToolbarItems\n\t\t\t\n\t\t\t\tXCToolbarPerspectiveControl\n\t\t\t\tNSToolbarSeparatorItem\n\t\t\t\tactive-combo-popup\n\t\t\t\tNSToolbarFlexibleSpaceItem\n\t\t\t\tdebugger-enable-breakpoints\n\t\t\t\tbuild-and-go\n\t\t\t\tcom.apple.ide.PBXToolbarStopButton\n\t\t\t\tdebugger-restart-executable\n\t\t\t\tdebugger-pause\n\t\t\t\tdebugger-step-over\n\t\t\t\tdebugger-step-into\n\t\t\t\tdebugger-step-out\n\t\t\t\tNSToolbarFlexibleSpaceItem\n\t\t\t\tservicesModulebreakpoints\n\t\t\t\tdebugger-show-console-window\n\t\t\t\n\t\t\tControllerClassBaseName\n\t\t\tPBXDebugSessionModule\n\t\t\tIconName\n\t\t\tDebugTabIcon\n\t\t\tIdentifier\n\t\t\tperspective.debug\n\t\t\tIsVertical\n\t\t\t\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\n\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t1CCC7628064C1048000F2A68\n\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\tDebugger Console\n\t\t\t\t\t\n\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\n\t\t\t\t\t\tFrame\n\t\t\t\t\t\t{{0, 0}, {424, 270}}\n\t\t\t\t\t\n\t\t\t\t\tModule\n\t\t\t\t\tPBXDebugCLIModule\n\t\t\t\t\tProportion\n\t\t\t\t\t270pt\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\n\t\t\t\t\t\tDebugger\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tHorizontalSplitView\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t_collapsingFrameDimension\n\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\t_indexOfCollapsedView\n\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\t_percentageOfCollapsedView\n\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\tisCollapsed\n\t\t\t\t\t\t\t\tyes\n\t\t\t\t\t\t\t\tsizes\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{{0, 0}, {395, 214}}\n\t\t\t\t\t\t\t\t\t{{395, 0}, {415, 214}}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tVerticalSplitView\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t_collapsingFrameDimension\n\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\t_indexOfCollapsedView\n\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\t_percentageOfCollapsedView\n\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\tisCollapsed\n\t\t\t\t\t\t\t\tyes\n\t\t\t\t\t\t\t\tsizes\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{{0, 0}, {810, 214}}\n\t\t\t\t\t\t\t\t\t{{0, 214}, {810, 227}}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tLauncherConfigVersion\n\t\t\t\t\t\t8\n\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t1CCC7629064C1048000F2A68\n\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\tDebug\n\t\t\t\t\t\n\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\n\t\t\t\t\t\tDebugConsoleVisible\n\t\t\t\t\t\tNone\n\t\t\t\t\t\tDebugConsoleWindowFrame\n\t\t\t\t\t\t{{200, 200}, {500, 300}}\n\t\t\t\t\t\tDebugSTDIOWindowFrame\n\t\t\t\t\t\t{{200, 200}, {500, 300}}\n\t\t\t\t\t\tFrame\n\t\t\t\t\t\t{{0, 5}, {810, 441}}\n\t\t\t\t\t\tPBXDebugSessionStackFrameViewKey\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tDebugVariablesTableConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tName\n\t\t\t\t\t\t\t\t120\n\t\t\t\t\t\t\t\tValue\n\t\t\t\t\t\t\t\t85\n\t\t\t\t\t\t\t\tSummary\n\t\t\t\t\t\t\t\t185\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t{{395, 0}, {415, 214}}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tModule\n\t\t\t\t\tPBXDebugSessionModule\n\t\t\t\t\tProportion\n\t\t\t\t\t441pt\n\t\t\t\t\n\t\t\t\n\t\t\tName\n\t\t\tDebug\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tXCModuleDock\n\t\t\t\tPBXDebugCLIModule\n\t\t\t\tPBXDebugSessionModule\n\t\t\t\tPBXDebugProcessAndThreadModule\n\t\t\t\tPBXDebugProcessViewModule\n\t\t\t\tPBXDebugThreadViewModule\n\t\t\t\tPBXDebugStackFrameViewModule\n\t\t\t\tPBXNavigatorGroup\n\t\t\t\n\t\t\tTableOfContents\n\t\t\t\n\t\t\t\t8BBB30D521B8935300825986\n\t\t\t\t1CCC7628064C1048000F2A68\n\t\t\t\t1CCC7629064C1048000F2A68\n\t\t\t\t8BBB30D621B8935300825986\n\t\t\t\t8BBB30D721B8935300825986\n\t\t\t\t8BBB30D821B8935300825986\n\t\t\t\t8BBB30D921B8935300825986\n\t\t\t\t8BBB30DA21B8935300825986\n\t\t\t\n\t\t\tToolbarConfigUserDefaultsMinorVersion\n\t\t\t2\n\t\t\tToolbarConfiguration\n\t\t\txcode.toolbar.config.debugV3\n\t\t\n\t\n\tPerspectivesBarVisible\n\t\n\tShelfIsVisible\n\t\n\tSourceDescription\n\tfile at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecification.xcperspec'\n\tStatusbarIsVisible\n\t\n\tTimeStamp\n\t569683362.16233301\n\tToolbarConfigUserDefaultsMinorVersion\n\t2\n\tToolbarDisplayMode\n\t1\n\tToolbarIsVisible\n\t\n\tToolbarSizeMode\n\t2\n\tType\n\tPerspectives\n\tUpdateMessage\n\t\n\tWindowJustification\n\t5\n\tWindowOrderList\n\t\n\t\t/Users/christopherjohnson/Desktop/MacAU/TapeDelay/TapeDelay.xcodeproj\n\t\n\tWindowString\n\t400 207 841 654 0 0 1440 878 \n\tWindowToolsV3\n\t\n\t\t\n\t\t\tIdentifier\n\t\t\twindowTool.debugger\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tDock\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tDebugger\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tHorizontalSplitView\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t_collapsingFrameDimension\n\t\t\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\t\t\t_indexOfCollapsedView\n\t\t\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\t\t\t_percentageOfCollapsedView\n\t\t\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\t\t\tisCollapsed\n\t\t\t\t\t\t\t\t\t\tyes\n\t\t\t\t\t\t\t\t\t\tsizes\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{{0, 0}, {317, 164}}\n\t\t\t\t\t\t\t\t\t\t\t{{317, 0}, {377, 164}}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tVerticalSplitView\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t_collapsingFrameDimension\n\t\t\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\t\t\t_indexOfCollapsedView\n\t\t\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\t\t\t_percentageOfCollapsedView\n\t\t\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\t\t\tisCollapsed\n\t\t\t\t\t\t\t\t\t\tyes\n\t\t\t\t\t\t\t\t\t\tsizes\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{{0, 0}, {694, 164}}\n\t\t\t\t\t\t\t\t\t\t\t{{0, 164}, {694, 216}}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tLauncherConfigVersion\n\t\t\t\t\t\t\t\t8\n\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t1C162984064C10D400B95A72\n\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\tDebug - GLUTExamples (Underwater)\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tDebugConsoleDrawerSize\n\t\t\t\t\t\t\t\t{100, 120}\n\t\t\t\t\t\t\t\tDebugConsoleVisible\n\t\t\t\t\t\t\t\tNone\n\t\t\t\t\t\t\t\tDebugConsoleWindowFrame\n\t\t\t\t\t\t\t\t{{200, 200}, {500, 300}}\n\t\t\t\t\t\t\t\tDebugSTDIOWindowFrame\n\t\t\t\t\t\t\t\t{{200, 200}, {500, 300}}\n\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t{{0, 0}, {694, 380}}\n\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t321 238 694 422 0 0 1440 878 \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tPBXDebugSessionModule\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t100%\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tProportion\n\t\t\t\t\t100%\n\t\t\t\t\n\t\t\t\n\t\t\tName\n\t\t\tDebugger\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tPBXDebugSessionModule\n\t\t\t\n\t\t\tStatusbarIsVisible\n\t\t\t1\n\t\t\tTableOfContents\n\t\t\t\n\t\t\t\t1CD10A99069EF8BA00B06720\n\t\t\t\t1C0AD2AB069F1E9B00FABCE6\n\t\t\t\t1C162984064C10D400B95A72\n\t\t\t\t1C0AD2AC069F1E9B00FABCE6\n\t\t\t\n\t\t\tToolbarConfiguration\n\t\t\txcode.toolbar.config.debugV3\n\t\t\tWindowString\n\t\t\t321 238 694 422 0 0 1440 878 \n\t\t\tWindowToolGUID\n\t\t\t1CD10A99069EF8BA00B06720\n\t\t\tWindowToolIsVisible\n\t\t\t0\n\t\t\n\t\t\n\t\t\tIdentifier\n\t\t\twindowTool.build\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tDock\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t1CD0528F0623707200166675\n\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\t<No Editor>\n\t\t\t\t\t\t\t\tPBXSplitModuleInNavigatorKey\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tSplit0\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t\t\t1CD052900623707200166675\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tSplitCount\n\t\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tStatusBarVisibility\n\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t{{0, 0}, {500, 215}}\n\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t192 257 500 500 0 0 1280 1002 \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tPBXNavigatorGroup\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t218pt\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tBecomeActive\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\tXCMainBuildResultsModuleGUID\n\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\tBuild Results\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t{{0, 222}, {500, 236}}\n\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t192 257 500 500 0 0 1280 1002 \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tPBXBuildResultsModule\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t236pt\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tProportion\n\t\t\t\t\t458pt\n\t\t\t\t\n\t\t\t\n\t\t\tName\n\t\t\tBuild Results\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tPBXBuildResultsModule\n\t\t\t\n\t\t\tStatusbarIsVisible\n\t\t\t1\n\t\t\tTableOfContents\n\t\t\t\n\t\t\t\t1C78EAA5065D492600B07095\n\t\t\t\t1C78EAA6065D492600B07095\n\t\t\t\t1CD0528F0623707200166675\n\t\t\t\tXCMainBuildResultsModuleGUID\n\t\t\t\n\t\t\tToolbarConfiguration\n\t\t\txcode.toolbar.config.buildV3\n\t\t\tWindowString\n\t\t\t192 257 500 500 0 0 1280 1002 \n\t\t\n\t\t\n\t\t\tIdentifier\n\t\t\twindowTool.find\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tDock\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tDock\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t\t\t1CDD528C0622207200134675\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\t\t\t<No Editor>\n\t\t\t\t\t\t\t\t\t\tPBXSplitModuleInNavigatorKey\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tSplit0\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t\t\t\t\t1CD0528D0623707200166675\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tSplitCount\n\t\t\t\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tStatusBarVisibility\n\t\t\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t\t\t{{0, 0}, {781, 167}}\n\t\t\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t\t\t62 385 781 470 0 0 1440 878 \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\t\t\tPBXNavigatorGroup\n\t\t\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t\t\t781pt\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t50%\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tBecomeActive\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t1CD0528E0623707200166675\n\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\tProject Find\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t{{8, 0}, {773, 254}}\n\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t62 385 781 470 0 0 1440 878 \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tPBXProjectFindModule\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t50%\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tProportion\n\t\t\t\t\t428pt\n\t\t\t\t\n\t\t\t\n\t\t\tName\n\t\t\tProject Find\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tPBXProjectFindModule\n\t\t\t\n\t\t\tStatusbarIsVisible\n\t\t\t1\n\t\t\tTableOfContents\n\t\t\t\n\t\t\t\t1C530D57069F1CE1000CFCEE\n\t\t\t\t1C530D58069F1CE1000CFCEE\n\t\t\t\t1C530D59069F1CE1000CFCEE\n\t\t\t\t1CDD528C0622207200134675\n\t\t\t\t1C530D5A069F1CE1000CFCEE\n\t\t\t\t1CE0B1FE06471DED0097A5F4\n\t\t\t\t1CD0528E0623707200166675\n\t\t\t\n\t\t\tWindowString\n\t\t\t62 385 781 470 0 0 1440 878 \n\t\t\tWindowToolGUID\n\t\t\t1C530D57069F1CE1000CFCEE\n\t\t\tWindowToolIsVisible\n\t\t\t0\n\t\t\n\t\t\n\t\t\tIdentifier\n\t\t\twindowTool.snapshots\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tDock\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tXCSnapshotModule\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t100%\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tProportion\n\t\t\t\t\t100%\n\t\t\t\t\n\t\t\t\n\t\t\tName\n\t\t\tSnapshots\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tXCSnapshotModule\n\t\t\t\n\t\t\tStatusbarIsVisible\n\t\t\tYes\n\t\t\tToolbarConfiguration\n\t\t\txcode.toolbar.config.snapshots\n\t\t\tWindowString\n\t\t\t315 824 300 550 0 0 1440 878 \n\t\t\tWindowToolIsVisible\n\t\t\tYes\n\t\t\n\t\t\n\t\t\tIdentifier\n\t\t\twindowTool.debuggerConsole\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tDock\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tBecomeActive\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t1C78EAAC065D492600B07095\n\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\tDebugger Console\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t{{0, 0}, {700, 358}}\n\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t149 87 700 400 0 0 1440 878 \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tPBXDebugCLIModule\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t358pt\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tProportion\n\t\t\t\t\t358pt\n\t\t\t\t\n\t\t\t\n\t\t\tName\n\t\t\tDebugger Console\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tPBXDebugCLIModule\n\t\t\t\n\t\t\tStatusbarIsVisible\n\t\t\t1\n\t\t\tTableOfContents\n\t\t\t\n\t\t\t\t1C530D5B069F1CE1000CFCEE\n\t\t\t\t1C530D5C069F1CE1000CFCEE\n\t\t\t\t1C78EAAC065D492600B07095\n\t\t\t\n\t\t\tToolbarConfiguration\n\t\t\txcode.toolbar.config.consoleV3\n\t\t\tWindowString\n\t\t\t149 87 440 400 0 0 1440 878 \n\t\t\tWindowToolGUID\n\t\t\t1C530D5B069F1CE1000CFCEE\n\t\t\tWindowToolIsVisible\n\t\t\t0\n\t\t\n\t\t\n\t\t\tIdentifier\n\t\t\twindowTool.scm\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tDock\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t1C78EAB2065D492600B07095\n\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\t<No Editor>\n\t\t\t\t\t\t\t\tPBXSplitModuleInNavigatorKey\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tSplit0\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t\t\t1C78EAB3065D492600B07095\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tSplitCount\n\t\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tStatusBarVisibility\n\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t{{0, 0}, {452, 0}}\n\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t743 379 452 308 0 0 1280 1002 \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tPBXNavigatorGroup\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t0pt\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tBecomeActive\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t1CD052920623707200166675\n\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\tSCM\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tConsoleFrame\n\t\t\t\t\t\t\t\t{{0, 259}, {452, 0}}\n\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t{{0, 7}, {452, 259}}\n\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t743 379 452 308 0 0 1280 1002 \n\t\t\t\t\t\t\t\tTableConfiguration\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tStatus\n\t\t\t\t\t\t\t\t\t30\n\t\t\t\t\t\t\t\t\tFileName\n\t\t\t\t\t\t\t\t\t199\n\t\t\t\t\t\t\t\t\tPath\n\t\t\t\t\t\t\t\t\t197.09500122070312\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tTableFrame\n\t\t\t\t\t\t\t\t{{0, 0}, {452, 250}}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tPBXCVSModule\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t262pt\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tProportion\n\t\t\t\t\t266pt\n\t\t\t\t\n\t\t\t\n\t\t\tName\n\t\t\tSCM\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tPBXCVSModule\n\t\t\t\n\t\t\tStatusbarIsVisible\n\t\t\t1\n\t\t\tTableOfContents\n\t\t\t\n\t\t\t\t1C78EAB4065D492600B07095\n\t\t\t\t1C78EAB5065D492600B07095\n\t\t\t\t1C78EAB2065D492600B07095\n\t\t\t\t1CD052920623707200166675\n\t\t\t\n\t\t\tToolbarConfiguration\n\t\t\txcode.toolbar.config.scmV3\n\t\t\tWindowString\n\t\t\t743 379 452 308 0 0 1280 1002 \n\t\t\n\t\t\n\t\t\tIdentifier\n\t\t\twindowTool.breakpoints\n\t\t\tIsVertical\n\t\t\t0\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tDock\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tBecomeActive\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPBXBottomSmartGroupGIDs\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t1C77FABC04509CD000000102\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t1CE0B1FE06471DED0097A5F4\n\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\tFiles\n\t\t\t\t\t\t\t\tPBXProjectStructureProvided\n\t\t\t\t\t\t\t\tno\n\t\t\t\t\t\t\t\tPBXSmartGroupTreeModuleColumnData\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tPBXSmartGroupTreeModuleColumnWidthsKey\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t168\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tPBXSmartGroupTreeModuleColumnsKey_v4\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tMainColumn\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPBXSmartGroupTreeModuleOutlineStateKey_v7\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tPBXSmartGroupTreeModuleOutlineStateExpansionKey\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t1C77FABC04509CD000000102\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tPBXSmartGroupTreeModuleOutlineStateSelectionKey\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tPBXSmartGroupTreeModuleOutlineStateVisibleRectKey\n\t\t\t\t\t\t\t\t\t{{0, 0}, {168, 350}}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPBXTopSmartGroupGIDs\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tXCIncludePerspectivesSwitch\n\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t{{0, 0}, {185, 368}}\n\t\t\t\t\t\t\t\tGroupTreeTableConfiguration\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tMainColumn\n\t\t\t\t\t\t\t\t\t168\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t315 424 744 409 0 0 1440 878 \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tPBXSmartGroupTreeModule\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t185pt\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t1CA1AED706398EBD00589147\n\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\tDetail\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t{{190, 0}, {554, 368}}\n\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t315 424 744 409 0 0 1440 878 \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tXCDetailModule\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t554pt\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tProportion\n\t\t\t\t\t368pt\n\t\t\t\t\n\t\t\t\n\t\t\tMajorVersion\n\t\t\t3\n\t\t\tMinorVersion\n\t\t\t0\n\t\t\tName\n\t\t\tBreakpoints\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tPBXSmartGroupTreeModule\n\t\t\t\tXCDetailModule\n\t\t\t\n\t\t\tStatusbarIsVisible\n\t\t\t1\n\t\t\tTableOfContents\n\t\t\t\n\t\t\t\t1CDDB66807F98D9800BB5817\n\t\t\t\t1CDDB66907F98D9800BB5817\n\t\t\t\t1CE0B1FE06471DED0097A5F4\n\t\t\t\t1CA1AED706398EBD00589147\n\t\t\t\n\t\t\tToolbarConfiguration\n\t\t\txcode.toolbar.config.breakpointsV3\n\t\t\tWindowString\n\t\t\t315 424 744 409 0 0 1440 878 \n\t\t\tWindowToolGUID\n\t\t\t1CDDB66807F98D9800BB5817\n\t\t\tWindowToolIsVisible\n\t\t\t1\n\t\t\n\t\t\n\t\t\tIdentifier\n\t\t\twindowTool.debugAnimator\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tDock\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tPBXNavigatorGroup\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t100%\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tProportion\n\t\t\t\t\t100%\n\t\t\t\t\n\t\t\t\n\t\t\tName\n\t\t\tDebug Visualizer\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tPBXNavigatorGroup\n\t\t\t\n\t\t\tStatusbarIsVisible\n\t\t\t1\n\t\t\tToolbarConfiguration\n\t\t\txcode.toolbar.config.debugAnimatorV3\n\t\t\tWindowString\n\t\t\t100 100 700 500 0 0 1280 1002 \n\t\t\n\t\t\n\t\t\tIdentifier\n\t\t\twindowTool.bookmarks\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tDock\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tPBXBookmarksModule\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t166pt\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tProportion\n\t\t\t\t\t166pt\n\t\t\t\t\n\t\t\t\n\t\t\tName\n\t\t\tBookmarks\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tPBXBookmarksModule\n\t\t\t\n\t\t\tStatusbarIsVisible\n\t\t\t0\n\t\t\tWindowString\n\t\t\t538 42 401 187 0 0 1280 1002 \n\t\t\n\t\t\n\t\t\tIdentifier\n\t\t\twindowTool.projectFormatConflicts\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tDock\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tXCProjectFormatConflictsModule\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t100%\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tProportion\n\t\t\t\t\t100%\n\t\t\t\t\n\t\t\t\n\t\t\tName\n\t\t\tProject Format Conflicts\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tXCProjectFormatConflictsModule\n\t\t\t\n\t\t\tStatusbarIsVisible\n\t\t\t0\n\t\t\tWindowContentMinSize\n\t\t\t450 300\n\t\t\tWindowString\n\t\t\t50 850 472 307 0 0 1440 877\n\t\t\n\t\t\n\t\t\tIdentifier\n\t\t\twindowTool.classBrowser\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tDock\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tBecomeActive\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\tContentConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tOptionsSetName\n\t\t\t\t\t\t\t\tHierarchy, all classes\n\t\t\t\t\t\t\t\tPBXProjectModuleGUID\n\t\t\t\t\t\t\t\t1CA6456E063B45B4001379D8\n\t\t\t\t\t\t\t\tPBXProjectModuleLabel\n\t\t\t\t\t\t\t\tClass Browser - NSObject\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tClassesFrame\n\t\t\t\t\t\t\t\t{{0, 0}, {369, 96}}\n\t\t\t\t\t\t\t\tClassesTreeTableConfiguration\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tPBXClassNameColumnIdentifier\n\t\t\t\t\t\t\t\t\t208\n\t\t\t\t\t\t\t\t\tPBXClassBookColumnIdentifier\n\t\t\t\t\t\t\t\t\t22\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t{{0, 0}, {616, 353}}\n\t\t\t\t\t\t\t\tMembersFrame\n\t\t\t\t\t\t\t\t{{0, 105}, {369, 395}}\n\t\t\t\t\t\t\t\tMembersTreeTableConfiguration\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tPBXMemberTypeIconColumnIdentifier\n\t\t\t\t\t\t\t\t\t22\n\t\t\t\t\t\t\t\t\tPBXMemberNameColumnIdentifier\n\t\t\t\t\t\t\t\t\t216\n\t\t\t\t\t\t\t\t\tPBXMemberTypeColumnIdentifier\n\t\t\t\t\t\t\t\t\t94\n\t\t\t\t\t\t\t\t\tPBXMemberBookColumnIdentifier\n\t\t\t\t\t\t\t\t\t22\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPBXModuleWindowStatusBarHidden2\n\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t597 125 616 374 0 0 1280 1002 \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tPBXClassBrowserModule\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t354pt\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tProportion\n\t\t\t\t\t354pt\n\t\t\t\t\n\t\t\t\n\t\t\tName\n\t\t\tClass Browser\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tPBXClassBrowserModule\n\t\t\t\n\t\t\tStatusbarIsVisible\n\t\t\t0\n\t\t\tTableOfContents\n\t\t\t\n\t\t\t\t1C78EABA065D492600B07095\n\t\t\t\t1C78EABB065D492600B07095\n\t\t\t\t1CA6456E063B45B4001379D8\n\t\t\t\n\t\t\tToolbarConfiguration\n\t\t\txcode.toolbar.config.classbrowser\n\t\t\tWindowString\n\t\t\t597 125 616 374 0 0 1280 1002 \n\t\t\n\t\t\n\t\t\tIdentifier\n\t\t\twindowTool.refactoring\n\t\t\tIncludeInToolsMenu\n\t\t\t0\n\t\t\tLayout\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tDock\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tBecomeActive\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\tGeometryConfiguration\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tFrame\n\t\t\t\t\t\t\t\t{0, 0}, {500, 335}\n\t\t\t\t\t\t\t\tRubberWindowFrame\n\t\t\t\t\t\t\t\t{0, 0}, {500, 335}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tModule\n\t\t\t\t\t\t\tXCRefactoringModule\n\t\t\t\t\t\t\tProportion\n\t\t\t\t\t\t\t100%\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tProportion\n\t\t\t\t\t100%\n\t\t\t\t\n\t\t\t\n\t\t\tName\n\t\t\tRefactoring\n\t\t\tServiceClasses\n\t\t\t\n\t\t\t\tXCRefactoringModule\n\t\t\t\n\t\t\tWindowString\n\t\t\t200 200 500 356 0 0 1920 1200 \n\t\t\n\t\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"} +{"text": "TestFancyColours3_fail.scala:8: error: pattern type is incompatible with expected type;\n found : tastytest.FancyColours.Colour.Red.type\n required: deriving.Mirror.Singleton\n case Colour.Red => \"Colour.Red\"\n ^\nTestFancyColours3_fail.scala:9: error: pattern type is incompatible with expected type;\n found : tastytest.FancyColours.Colour.Pink.type\n required: deriving.Mirror.Singleton\n case Colour.Pink => \"Colour.Pink\"\n ^\nTestFancyColours3_fail.scala:10: error: pattern type is incompatible with expected type;\n found : tastytest.FancyColours.Colour.Violet.type\n required: deriving.Mirror.Singleton\n case Colour.Violet => \"Colour.Violet\"\n ^\nTestFancyColours3_fail.scala:13: error: type mismatch;\n found : tastytest.FancyColours.Colour.Pink.type\n required: deriving.Mirror.Singleton\n def test = describeSingleton(Colour.Pink)\n ^\n4 errors\n"} +{"text": "/**\n * (c) 2017-2018 Alexandro Sanchez Bach.\n * Released under MIT license. Read LICENSE for more details.\n *\n * Based in previous tools and research by: fail0verflow, flatz.\n */\n\n#ifndef SELF_DECRYPTER_H\n#define SELF_DECRYPTER_H\n\n#include \n#include \n\n// Format\ntypedef struct self_entry_t {\n uint32_t props;\n uint32_t reserved;\n uint64_t offset;\n uint64_t filesz;\n uint64_t memsz;\n} self_entry_t;\n\ntypedef struct self_header_t {\n uint32_t magic;\n uint8_t version;\n uint8_t mode;\n uint8_t endian;\n uint8_t attr;\n uint32_t key_type;\n uint16_t header_size;\n uint16_t meta_size;\n uint64_t file_size;\n uint16_t num_entries;\n uint16_t flags;\n uint32_t reserved;\n self_entry_t entries[0];\n} self_header_t;\n\n// Context\nstruct self_auth_info_t {\n uint8_t buf[0x88];\n};\n\ntypedef struct self_t {\n int fd;\n char *file_path;\n size_t file_size;\n size_t entries_size;\n size_t data_offset;\n size_t data_size;\n /* contents */\n struct self_header_t header;\n struct self_entry_t *entries;\n uint8_t *data;\n /* kernel */\n struct self_auth_info_t auth_info;\n struct self_context_t *ctx;\n int auth_ctx_id;\n int ctx_id;\n int svc_id;\n int verified;\n /* blobs */\n struct blob_t *blobs;\n} self_t;\n\n#endif /* SELF_DECRYPTER_H */"} +{"text": "// Copyright 2018 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\nnamespace array_foreach {\n transitioning javascript builtin\n ArrayForEachLoopEagerDeoptContinuation(implicit context: Context)(\n receiver: Object, callback: Object, thisArg: Object, initialK: Object,\n length: Object): Object {\n // All continuation points in the optimized forEach implemntation are\n // after the ToObject(O) call that ensures we are dealing with a\n // JSReceiver.\n const jsreceiver = Cast(receiver) otherwise unreachable;\n const callbackfn = Cast(callback) otherwise unreachable;\n const numberK = Cast(initialK) otherwise unreachable;\n const numberLength = Cast(length) otherwise unreachable;\n\n return ArrayForEachLoopContinuation(\n jsreceiver, callbackfn, thisArg, Undefined, jsreceiver, numberK,\n numberLength, Undefined);\n }\n\n transitioning javascript builtin\n ArrayForEachLoopLazyDeoptContinuation(implicit context: Context)(\n receiver: Object, callback: Object, thisArg: Object, initialK: Object,\n length: Object, result: Object): Object {\n // All continuation points in the optimized forEach implemntation are\n // after the ToObject(O) call that ensures we are dealing with a\n // JSReceiver.\n const jsreceiver = Cast(receiver) otherwise unreachable;\n const callbackfn = Cast(callback) otherwise unreachable;\n const numberK = Cast(initialK) otherwise unreachable;\n const numberLength = Cast(length) otherwise unreachable;\n\n return ArrayForEachLoopContinuation(\n jsreceiver, callbackfn, thisArg, Undefined, jsreceiver, numberK,\n numberLength, Undefined);\n }\n\n transitioning builtin ArrayForEachLoopContinuation(implicit context: Context)(\n receiver: JSReceiver, callbackfn: Callable, thisArg: Object,\n array: Object, o: JSReceiver, initialK: Number, len: Number,\n to: Object): Object {\n // variables {array} and {to} are ignored.\n\n // 5. Let k be 0.\n // 6. Repeat, while k < len\n for (let k: Number = initialK; k < len; k = k + 1) {\n // 6a. Let Pk be ! ToString(k).\n // k is guaranteed to be a positive integer, hence ToString is\n // side-effect free and HasProperty/GetProperty do the conversion inline.\n\n // 6b. Let kPresent be ? HasProperty(O, Pk).\n const kPresent: Boolean = HasProperty_Inline(o, k);\n\n // 6c. If kPresent is true, then\n if (kPresent == True) {\n // 6c. i. Let kValue be ? Get(O, Pk).\n const kValue: Object = GetProperty(o, k);\n\n // 6c. ii. Perform ? Call(callbackfn, T, ).\n Call(context, callbackfn, thisArg, kValue, k, o);\n }\n\n // 6d. Increase k by 1. (done by the loop).\n }\n return Undefined;\n }\n\n transitioning macro FastArrayForEach(implicit context: Context)(\n o: JSReceiver, len: Number, callbackfn: Callable, thisArg: Object): Object\n labels Bailout(Smi) {\n let k: Smi = 0;\n const smiLen = Cast(len) otherwise goto Bailout(k);\n let fastO = Cast(o) otherwise goto Bailout(k);\n let fastOW = NewFastJSArrayWitness(fastO);\n\n // Build a fast loop over the smi array.\n for (; k < smiLen; k++) {\n fastOW.Recheck() otherwise goto Bailout(k);\n\n // Ensure that we haven't walked beyond a possibly updated length.\n if (k >= fastOW.Get().length) goto Bailout(k);\n const value: Object = fastOW.LoadElementNoHole(k)\n otherwise continue;\n Call(context, callbackfn, thisArg, value, k, fastOW.Get());\n }\n return Undefined;\n }\n\n // https://tc39.github.io/ecma262/#sec-array.prototype.foreach\n transitioning javascript builtin\n ArrayForEach(context: Context, receiver: Object, ...arguments): Object {\n try {\n if (IsNullOrUndefined(receiver)) {\n goto NullOrUndefinedError;\n }\n\n // 1. Let O be ? ToObject(this value).\n const o: JSReceiver = ToObject_Inline(context, receiver);\n\n // 2. Let len be ? ToLength(? Get(O, \"length\")).\n const len: Number = GetLengthProperty(o);\n\n // 3. If IsCallable(callbackfn) is false, throw a TypeError exception.\n if (arguments.length == 0) {\n goto TypeError;\n }\n const callbackfn = Cast(arguments[0]) otherwise TypeError;\n\n // 4. If thisArg is present, let T be thisArg; else let T be undefined.\n const thisArg: Object = arguments.length > 1 ? arguments[1] : Undefined;\n\n // Special cases.\n let k: Number = 0;\n try {\n return FastArrayForEach(o, len, callbackfn, thisArg)\n otherwise Bailout;\n }\n label Bailout(kValue: Smi) deferred {\n k = kValue;\n }\n\n return ArrayForEachLoopContinuation(\n o, callbackfn, thisArg, Undefined, o, k, len, Undefined);\n }\n label TypeError deferred {\n ThrowTypeError(kCalledNonCallable, arguments[0]);\n }\n label NullOrUndefinedError deferred {\n ThrowTypeError(kCalledOnNullOrUndefined, 'Array.prototype.forEach');\n }\n }\n}\n"} +{"text": "\n\n \n \n\n\n"} +{"text": "\n\n 4.0.0\n \n pl.coi.gov.examples.springcleanarchitecture\n pets-pom\n 0.1.0-SNAPSHOT\n \n\n pets-presentation\n SCA :: Pets :: Presentation\n\n \n \n pl.coi.gov.examples.springcleanarchitecture\n pets-domain-contract\n ${project.version}\n \n \n pl.coi.gov.examples.springcleanarchitecture\n clean-architecture\n ${project.version}\n \n \n org.springframework.boot\n spring-boot-starter-web\n \n \n org.springframework.boot\n spring-boot-starter-thymeleaf\n \n \n org.springframework.boot\n spring-boot-devtools\n \n \n javax.inject\n javax.inject\n \n \n org.projectlombok\n lombok\n \n \n pl.wavesoftware\n eid-exceptions\n \n \n org.webjars\n modernizr\n \n \n org.webjars.npm\n material-design-lite\n \n \n org.webjars.npm\n getmdl-select\n \n \n org.webjars.npm\n material-design-icons\n \n\n \n junit\n junit\n \n \n org.assertj\n assertj-core\n \n \n\n"} +{"text": "///////////////////////////////////////////////////////////////////////////////////\n/// OpenGL Mathematics (glm.g-truc.net)\n///\n/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)\n/// Permission is hereby granted, free of charge, to any person obtaining a copy\n/// of this software and associated documentation files (the \"Software\"), to deal\n/// in the Software without restriction, including without limitation the rights\n/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n/// copies of the Software, and to permit persons to whom the Software is\n/// furnished to do so, subject to the following conditions:\n/// \n/// The above copyright notice and this permission notice shall be included in\n/// all copies or substantial portions of the Software.\n/// \n/// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n/// THE SOFTWARE.\n///////////////////////////////////////////////////////////////////////////////////\n\n#if(defined(GLM_MESSAGES))\n#\tpragma message(\"GLM: GLM_GTX_unsigned_int extension is deprecated, include GLM_GTX_integer instead\")\n#endif\n"} +{"text": "/*\n * Copyright (C) 2019 Qunar, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\n\npackage qunar.tc.bistoury.proxy.communicate;\n\nimport com.google.common.util.concurrent.ListenableFuture;\nimport qunar.tc.bistoury.proxy.communicate.agent.AgentConnection;\nimport qunar.tc.bistoury.remoting.protocol.RequestData;\nimport qunar.tc.bistoury.proxy.communicate.ui.UiConnection;\nimport qunar.tc.bistoury.remoting.protocol.Datagram;\n\n/**\n * @author zhenyu.nie created on 2019 2019/5/13 14:18\n */\npublic interface Session {\n\n enum State {\n finish, broken\n }\n\n void writeToUi(Datagram message);\n\n void writeToAgent(Datagram message);\n\n String getId();\n\n boolean isSupportPause();\n\n RequestData getRequestData();\n\n AgentConnection getAgentConnection();\n\n UiConnection getUiConnection();\n\n boolean finish();\n\n boolean broken();\n\n ListenableFuture getEndState();\n}\n"} +{"text": "//\n// Generated by class-dump 3.5 (64 bit) (Debug version compiled Jun 9 2015 22:53:21).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2014 by Steve Nygard.\n//\n\n#import \n\n@interface IWPhotoStreamEmailTokenFieldCell : IPKTokenFieldCell\n{\n}\n\n- (id)setUpFieldEditorAttributes:(id)arg1;\n\n@end\n\n"} +{"text": "import PackageDescription\n\n\nlet package = Package(\n name: \"Curassow\",\n targets: [\n Target(name: \"example\", dependencies: [\"Curassow\"]),\n ],\n dependencies: [\n .Package(url: \"https://github.com/nestproject/Nest.git\", majorVersion: 0, minor: 4),\n .Package(url: \"https://github.com/nestproject/Inquiline.git\", majorVersion: 0, minor: 4),\n .Package(url: \"https://github.com/kylef/Commander.git\", majorVersion: 0, minor: 6),\n .Package(url: \"https://github.com/kylef/fd.git\", majorVersion: 0, minor: 2),\n .Package(url: \"https://github.com/kylef/Spectre.git\", majorVersion: 0, minor: 7),\n ]\n)\n"} +{"text": "/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License;\n * you may not use this file except in compliance with the Elastic License.\n */\n\nimport { RGBAImage } from './image_utils';\n\nexport function removeOrphanedSourcesAndLayers(mbMap, layerList, spatialFilterLayer) {\n const mbStyle = mbMap.getStyle();\n\n const mbLayerIdsToRemove = [];\n mbStyle.layers.forEach((mbLayer) => {\n // ignore mapbox layers from spatial filter layer\n if (spatialFilterLayer.ownsMbLayerId(mbLayer.id)) {\n return;\n }\n\n const layer = layerList.find((layer) => {\n return layer.ownsMbLayerId(mbLayer.id);\n });\n if (!layer) {\n mbLayerIdsToRemove.push(mbLayer.id);\n }\n });\n mbLayerIdsToRemove.forEach((mbLayerId) => mbMap.removeLayer(mbLayerId));\n\n const mbSourcesToRemove = [];\n for (const mbSourceId in mbStyle.sources) {\n if (mbStyle.sources.hasOwnProperty(mbSourceId)) {\n // ignore mapbox sources from spatial filter layer\n if (spatialFilterLayer.ownsMbSourceId(mbSourceId)) {\n return;\n }\n\n const layer = layerList.find((layer) => {\n return layer.ownsMbSourceId(mbSourceId);\n });\n if (!layer) {\n mbSourcesToRemove.push(mbSourceId);\n }\n }\n }\n mbSourcesToRemove.forEach((mbSourceId) => mbMap.removeSource(mbSourceId));\n}\n\nexport async function addSpritesheetToMap(json, imgUrl, mbMap) {\n const imgData = await loadSpriteSheetImageData(imgUrl);\n addSpriteSheetToMapFromImageData(json, imgData, mbMap);\n}\n\nfunction getImageData(img) {\n const canvas = window.document.createElement('canvas');\n const context = canvas.getContext('2d');\n if (!context) {\n throw new Error('failed to create canvas 2d context');\n }\n canvas.width = img.width;\n canvas.height = img.height;\n context.drawImage(img, 0, 0, img.width, img.height);\n return context.getImageData(0, 0, img.width, img.height);\n}\n\nfunction isCrossOriginUrl(url) {\n const a = window.document.createElement('a');\n a.href = url;\n return (\n a.protocol !== window.document.location.protocol ||\n a.host !== window.document.location.host ||\n a.port !== window.document.location.port\n );\n}\n\nexport async function loadSpriteSheetImageData(imgUrl) {\n return new Promise((resolve, reject) => {\n const image = new Image();\n if (isCrossOriginUrl(imgUrl)) {\n image.crossOrigin = 'Anonymous';\n }\n image.onload = (el) => {\n const imgData = getImageData(el.currentTarget);\n resolve(imgData);\n };\n image.onerror = (e) => {\n reject(e);\n };\n image.src = imgUrl;\n });\n}\n\nexport function addSpriteSheetToMapFromImageData(json, imgData, mbMap) {\n for (const imageId in json) {\n if (!(json.hasOwnProperty(imageId) && !mbMap.hasImage(imageId))) {\n continue;\n }\n const { width, height, x, y, sdf, pixelRatio } = json[imageId];\n if (typeof width !== 'number' || typeof height !== 'number') {\n continue;\n }\n\n const data = new RGBAImage({ width, height });\n RGBAImage.copy(imgData, data, { x, y }, { x: 0, y: 0 }, { width, height });\n mbMap.addImage(imageId, data, { pixelRatio, sdf });\n }\n}\n"} +{"text": "Copyright (c) 2011 TypeSETit, LLC (typesetit@att.net),\nwith Reserved Font Name \"Ruthie\"\n\nThis Font Software is licensed under the SIL Open Font License, Version 1.1.\nThis license is copied below, and is also available with a FAQ at:\nhttp://scripts.sil.org/OFL\n\n\n-----------------------------------------------------------\nSIL OPEN FONT LICENSE Version 1.1 - 1 February 2007\n-----------------------------------------------------------\n\nPREAMBLE\nThe goals of the Open Font License (OFL) are to stimulate worldwide\ndevelopment of collaborative font projects, to support the font creation\nefforts of academic and linguistic communities, and to provide a free and\nopen framework in which fonts may be shared and improved in partnership\nwith others.\n\nThe OFL allows the licensed fonts to be used, studied, modified and\nredistributed freely as long as they are not sold by themselves. The\nfonts, including any derivative works, can be bundled, embedded, \nredistributed and/or sold with any software provided that the font\nnames of derivative works are changed. The fonts and derivatives,\nhowever, cannot be released under any other type of license. The\nrequirement for fonts to remain under this license does not apply\nto any document created using the fonts or their derivatives.\n\nDEFINITIONS\n\"Font Software\" refers to the set of files released by the Copyright\nHolder(s) under this license and clearly marked as such. This may\ninclude source files, build scripts and documentation.\n\n\"Reserved Font Name\" refers to any names specified as such after the\ncopyright statement(s).\n\n\"Original Version\" refers to the collection of Font Software components as\ndistributed by the Copyright Holder(s).\n\n\"Modified Version\" refers to any derivative made by adding to, deleting,\nor substituting -- in part or in whole -- any of the components of the\nOriginal Version, by changing formats or by porting the Font Software to a\nnew environment.\n\n\"Author\" refers to any designer, engineer, programmer, technical\nwriter or other person who contributed to the Font Software.\n\nPERMISSION & CONDITIONS\nPermission is hereby granted, free of charge, to any person obtaining\na copy of the Font Software, to use, study, copy, merge, embed, modify,\nredistribute, and sell modified and unmodified copies of the Font\nSoftware, subject to the following conditions:\n\n1) Neither the Font Software nor any of its individual components,\nin Original or Modified Versions, may be sold by itself.\n\n2) Original or Modified Versions of the Font Software may be bundled,\nredistributed and/or sold with any software, provided that each copy\ncontains the above copyright notice and this license. These can be\nincluded either as stand-alone text files, human-readable headers or\nin the appropriate machine-readable metadata fields within text or\nbinary files as long as those fields can be easily viewed by the user.\n\n3) No Modified Version of the Font Software may use the Reserved Font\nName(s) unless explicit written permission is granted by the corresponding\nCopyright Holder. This restriction only applies to the primary font name as\npresented to the users.\n\n4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font\nSoftware shall not be used to promote, endorse or advertise any\nModified Version, except to acknowledge the contribution(s) of the\nCopyright Holder(s) and the Author(s) or with their explicit written\npermission.\n\n5) The Font Software, modified or unmodified, in part or in whole,\nmust be distributed entirely under this license, and must not be\ndistributed under any other license. The requirement for fonts to\nremain under this license does not apply to any document created\nusing the Font Software.\n\nTERMINATION\nThis license becomes null and void if any of the above conditions are\nnot met.\n\nDISCLAIMER\nTHE FONT SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT\nOF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE\nCOPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nINCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL\nDAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM\nOTHER DEALINGS IN THE FONT SOFTWARE.\n"} +{"text": "\n\n\n\n\n \n We're sorry, but something went wrong (500)\n\t\n\n\n\n \n
\n

We're sorry, but something went wrong.

\n

We've been notified about this issue and we'll take a look at it shortly.

\n
\n\n\n"} +{"text": "package client\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/api/types/filters\"\n\t\"golang.org/x/net/context\"\n)\n\n// ImagesPrune requests the daemon to delete unused data\nfunc (cli *Client) ImagesPrune(ctx context.Context, pruneFilters filters.Args) (types.ImagesPruneReport, error) {\n\tvar report types.ImagesPruneReport\n\n\tif err := cli.NewVersionError(\"1.25\", \"image prune\"); err != nil {\n\t\treturn report, err\n\t}\n\n\tquery, err := getFiltersQuery(pruneFilters)\n\tif err != nil {\n\t\treturn report, err\n\t}\n\n\tserverResp, err := cli.post(ctx, \"/images/prune\", query, nil, nil)\n\tif err != nil {\n\t\treturn report, err\n\t}\n\tdefer ensureReaderClosed(serverResp)\n\n\tif err := json.NewDecoder(serverResp.body).Decode(&report); err != nil {\n\t\treturn report, fmt.Errorf(\"Error retrieving disk usage: %v\", err)\n\t}\n\n\treturn report, nil\n}\n"} +{"text": "/**\n * TLS-Attacker - A Modular Penetration Testing Framework for TLS\n *\n * Copyright 2014-2020 Ruhr University Bochum, Paderborn University,\n * and Hackmanit GmbH\n *\n * Licensed under Apache License 2.0\n * http://www.apache.org/licenses/LICENSE-2.0\n */\npackage de.rub.nds.tlsattacker.core.protocol.handler;\n\nimport de.rub.nds.tlsattacker.core.protocol.parser.ParserResult;\nimport de.rub.nds.tlsattacker.core.dtls.MessageFragmenter;\nimport de.rub.nds.tlsattacker.core.exceptions.AdjustmentException;\nimport de.rub.nds.tlsattacker.core.protocol.message.DtlsHandshakeMessageFragment;\nimport de.rub.nds.tlsattacker.core.protocol.message.HandshakeMessage;\nimport de.rub.nds.tlsattacker.core.protocol.message.ProtocolMessage;\nimport de.rub.nds.tlsattacker.core.protocol.parser.Parser;\nimport de.rub.nds.tlsattacker.core.protocol.parser.ProtocolMessageParser;\nimport de.rub.nds.tlsattacker.core.protocol.preparator.Preparator;\nimport de.rub.nds.tlsattacker.core.protocol.preparator.ProtocolMessagePreparator;\nimport de.rub.nds.tlsattacker.core.protocol.serializer.ProtocolMessageSerializer;\nimport de.rub.nds.tlsattacker.core.protocol.serializer.Serializer;\nimport de.rub.nds.tlsattacker.core.state.TlsContext;\nimport org.apache.logging.log4j.LogManager;\nimport org.apache.logging.log4j.Logger;\n\n/**\n * @param \n * The ProtocolMessage that should be handled\n */\npublic abstract class ProtocolMessageHandler extends Handler {\n\n private static final Logger LOGGER = LogManager.getLogger();\n\n /**\n * tls context\n */\n protected final TlsContext tlsContext;\n\n /**\n * @param tlsContext\n * The Context which should be Adjusted with this Handler\n */\n public ProtocolMessageHandler(TlsContext tlsContext) {\n this.tlsContext = tlsContext;\n }\n\n /**\n * Prepare message for sending. This method invokes before and after method\n * hooks.\n *\n * @param message\n * The Message that should be prepared\n * @return message in bytes\n */\n public byte[] prepareMessage(Message message) {\n return prepareMessage(message, true);\n }\n\n /**\n * Prepare message for sending. This method invokes before and after method\n * hooks.\n *\n * @param message\n * The message that should be prepared\n * @param withPrepare\n * if the prepare function should be called or only the rest\n * @return message in bytes\n */\n public byte[] prepareMessage(Message message, boolean withPrepare) {\n if (withPrepare) {\n Preparator preparator = getPreparator(message);\n preparator.prepare();\n preparator.afterPrepare();\n Serializer serializer = getSerializer(message);\n byte[] completeMessage = serializer.serialize();\n message.setCompleteResultingMessage(completeMessage);\n }\n try {\n if (message.getAdjustContext()) {\n if (tlsContext.getConfig().getDefaultSelectedProtocolVersion().isDTLS() && message.isHandshakeMessage()\n && !message.isDtlsHandshakeMessageFragment()) {\n tlsContext.increaseDtlsWriteHandshakeMessageSequence();\n }\n }\n updateDigest(message);\n if (message.getAdjustContext()) {\n\n adjustTLSContext(message);\n }\n } catch (AdjustmentException E) {\n LOGGER.warn(\"Could not adjust TLSContext\");\n LOGGER.debug(E);\n }\n\n return message.getCompleteResultingMessage().getValue();\n }\n\n /**\n * Parses a byteArray from a Position into a MessageObject and returns the\n * parsed MessageObjet and parser position in a parser result. The current\n * Chooser is adjusted as\n *\n * @param message\n * The byte[] messages which should be parsed\n * @param pointer\n * The pointer (startposition) into the message bytes\n * @return The Parser result\n */\n public ParserResult parseMessage(byte[] message, int pointer, boolean onlyParse) {\n Parser parser = getParser(message, pointer);\n Message parsedMessage = parser.parse();\n\n if (tlsContext.getChooser().getSelectedProtocolVersion().isDTLS() && parsedMessage instanceof HandshakeMessage\n && !(parsedMessage instanceof DtlsHandshakeMessageFragment)) {\n ((HandshakeMessage) parsedMessage).setMessageSequence(tlsContext.getDtlsReadHandshakeMessageSequence());\n }\n try {\n if (!onlyParse) {\n prepareAfterParse(parsedMessage);\n updateDigest(parsedMessage);\n adjustTLSContext(parsedMessage);\n }\n\n } catch (AdjustmentException | UnsupportedOperationException E) {\n LOGGER.warn(\"Could not adjust TLSContext\");\n LOGGER.debug(E);\n }\n return new ParserResult(parsedMessage, parser.getPointer());\n }\n\n private void updateDigest(ProtocolMessage message) {\n if (message.isHandshakeMessage() && ((HandshakeMessage) message).getIncludeInDigest()) {\n if (tlsContext.getChooser().getSelectedProtocolVersion().isDTLS()) {\n DtlsHandshakeMessageFragment fragment = new MessageFragmenter(tlsContext.getConfig()\n .getDtlsMaximumFragmentLength()).wrapInSingleFragment((HandshakeMessage) message, tlsContext);\n tlsContext.getDigest().append(fragment.getCompleteResultingMessage().getValue());\n } else {\n tlsContext.getDigest().append(message.getCompleteResultingMessage().getValue());\n }\n LOGGER.debug(\"Included in digest: \" + message.toCompactString());\n }\n }\n\n @Override\n public abstract ProtocolMessageParser getParser(byte[] message, int pointer);\n\n @Override\n public abstract ProtocolMessagePreparator getPreparator(Message message);\n\n @Override\n public abstract ProtocolMessageSerializer getSerializer(Message message);\n\n /**\n * Adjusts the TLS Context according to the received or sending\n * ProtocolMessage\n *\n * @param message\n * The Message for which this context should be adjusted\n */\n public abstract void adjustTLSContext(Message message);\n\n public void adjustTlsContextAfterSerialize(Message message) {\n }\n\n public void prepareAfterParse(Message message) {\n ProtocolMessagePreparator prep = getPreparator(message);\n prep.prepareAfterParse(tlsContext.isReversePrepareAfterParse());\n }\n\n @Override\n protected final void adjustContext(Message message) {\n adjustTLSContext(message);\n }\n}\n"} +{"text": "using System;\nusing RuntimeUnitTestToolkit;\n\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing System.Linq;\nusing ZeroFormatter.Segments;\n\n\n\nnamespace ZeroFormatter.Tests\n{\n [TestClass]\n public class LookupSegmentTest\n {\n \n [TestMethod]\n public void LookupSegment()\n {\n ILazyLookup lookup = Enumerable.Range(1, 10).ToLookup(x => x % 2 == 0).AsLazyLookup();\n var segment = ZeroFormatterSerializer.Convert(lookup);\n\n segment[true].IsCollection(2, 4, 6, 8, 10);\n segment[false].IsCollection(1, 3, 5, 7, 9);\n\n bool isFirst = true;\n foreach (var g in segment.OrderByDescending(x => x.Key))\n {\n if (isFirst)\n {\n isFirst = false;\n g.Key.IsTrue();\n g.AsEnumerable().IsCollection(2, 4, 6, 8, 10);\n }\n else\n {\n g.Key.IsFalse();\n g.AsEnumerable().IsCollection(1, 3, 5, 7, 9);\n }\n }\n }\n\n\n\n [TestMethod]\n public void Immediate()\n {\n {\n ILookup lookup = Enumerable.Range(1, 10).ToLookup(x => x % 2 == 0);\n var hugahuga = ZeroFormatterSerializer.Convert(lookup, true);\n hugahuga[true].IsCollection(2, 4, 6, 8, 10);\n hugahuga[false].IsCollection(1, 3, 5, 7, 9);\n\n var onemore = ZeroFormatterSerializer.Convert(hugahuga, true);\n onemore[true].IsCollection(2, 4, 6, 8, 10);\n onemore[false].IsCollection(1, 3, 5, 7, 9);\n }\n {\n ILazyLookup lookup = Enumerable.Range(1, 10).ToLookup(x => x % 2 == 0).AsLazyLookup();\n var hugahuga = ZeroFormatterSerializer.Convert(lookup, true);\n hugahuga[true].IsCollection(2, 4, 6, 8, 10);\n hugahuga[false].IsCollection(1, 3, 5, 7, 9);\n\n var onemore = ZeroFormatterSerializer.Convert(hugahuga, true);\n onemore[true].IsCollection(2, 4, 6, 8, 10);\n onemore[false].IsCollection(1, 3, 5, 7, 9);\n }\n }\n }\n\n\n}\n"} +{"text": "\nSTRAWBERRY ICE\n\n(Gelato di fragola)\n\n Ripe strawberries, 3/4 lb.\n Granulated sugar, 3/4 lb.\n Water, one pint.\n A big lemon.\n An orange.\n\nBoil the sugar in the water for ten minutes in an uncovered kettle. Rub\nthrough a sieve the strawberries and the juice of the lemon and the\norange: add the syrup after straining, mix everything and pour the\nmixture in the freezer.\n\n\n"} +{"text": "\n\n**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*\n\n- [Commandline usage](#commandline-usage)\n - [Additional net-def options](#additional-net-def-options)\n - [Repeated layers](#repeated-layers)\n - [Additional layer types](#additional-layer-types)\n - [Random patches](#random-patches)\n - [Random translations](#random-translations)\n - [Multi-column deep neural network \"MultiNet\"](#multi-column-deep-neural-network-multinet)\n - [Pre-processing](#pre-processing)\n - [File types](#file-types)\n - [Weight persistence](#weight-persistence)\n - [Command-line options](#command-line-options)\n\n\n\n# Commandline usage\n\n## Training\n\nUse `train` to run training (`deepclrun` in v5.8.3 and below).\n\n* Syntax is based on that specified in Ciresan et al's [Multi-column Deep Neural Networks for Image Classification](http://arxiv.org/pdf/1202.2745.pdf), section 3, first paragraph:\n * network is defined by a string like: `100C5-MP2-100C5-MP2-100C4-MP2-300N-100N-6N`\n * `100c5` means: a convolutional layer, with 100 filters, each 5x5\n * adding `z` to a convolutional layer makes it zero-padded, eg `8c5z` is: a convolutional layer, with 8 filters, each 5x5, zero-padded\n * `mp2` means a max-pooling layer, over non-overlapping regions of 2x2\n * `300n` means a fully connected layer with 300 hidden units\n * `relu` means a relu layer\n * `tanh` means a tanh layer\n* Thus, you can do, for example:\n```bash\ndeepcl_train netdef=8c5z-relu-mp2-16c5z-relu-mp3-150n-tanh-10n learningrate=0.002 dataset=mnist\n```\n... in order to learn mnist, using the same neural net architecture as used in the [convnetjs mnist demo](http://cs.stanford.edu/people/karpathy/convnetjs/demo/mnist.html)\n* Similarly, you can learn NORB, using approximately the architecture specified in [lecun-04](http://yann.lecun.com/exdb/publis/pdf/lecun-04.pdf), by doing:\n```bash\ndeepcl_train netdef=8c5-relu-mp4-24c6-relu-mp3-80c6-relu-5n learningrate=0.0001 dataset=norb\n```\n* Or, you can train NORB using the very deep, broad architecture specified by Ciresan et al in [Flexible, High Performance Convolutional Neural Networks for Image Classification](http://ijcai.org/papers11/Papers/IJCAI11-210.pdf):\n```bash\ndeepcl_train netdef=MP3-300C6-RELU-MP2-500C4-RELU-MP4-500N-TANH-5N learningrate=0.0001 dataset=norb\n```\n\n### Convolutional\n\n* eg `-32c5` is a convolutional layer with 32 filters of 5x5\n* `-32c5z` is a convolutional layer with zero-padding, of 32 filters of 5x5\n\n### Fully-connected\n\n* eg `-150n` is a fully connected layer, with 150 neurons.\n\n### Max-pooling\n\n* Eg `-mp3` will add a max-pooling layer, over 3x3 non-overlapping regions. The number is the size of the regions, and can be modified\n\n### Dropout layers\n\n* Simply add `-drop` into the netdef string\n * this will use a dropout ratio of 0.5\n\n### Activation layers\n\n* Simply add any of the following into the netdef string:\n * `-tanh`\n * `-sigmoid`\n * `-relu`\n * `-elu`\n\n#### Random patches\n\n* `RP24` means a random patch layer, which will cut a 24x24 patch from a random position in each incoming image, and send that to its output\n* during testing, the patch will be cut from the centre of each image\n\n#### Random translations\n\n* `RT2` means a random translations layer, which will translate the image randomly during training, up to 2 pixels, in either direction, along both axes\n* Can specify any non-negative integer, less than the image size\n* During testing, no translation is done\n\n### Multi-column deep neural network \"MultiNet\"\n\n* You can train several neural networks at the same time, and predict using the average output across all of them using the `multinet` option\n* Simply add eg `multinet=3` in the commandline, to train across 3 nets in parallel, or put a number of your choice\n\n### Repeated layers\n\n* simply prefix a layer with eg `3*` to repeat it. `3*` will repeat the layer 3 times, and similar for other numbers, eg:\n```\ndeepcl_train netdef=6*(32c5z-relu)-500n-361n learningrate=0.0001 dataset=kgsgoall\n```\n... will create 6 convolutional layers of 32 5x5 filters each.\n* you can also use parentheses `(...)` to repeat multiple layers, eg:\n```\ndeepcl_train netdef=3*(32c5z-relu-mp2)-150n-10n\n```\n... will be expanded to:\n```\ndeepcl_train netdef=32c5z-relu-mp2-32c5z-relu-mp2-32c5z-relu-mp2-150n-10n\n```\n\n### File types\n\n* Simply pass in the filename of the data file with the images in\n* Filetype will be detected automatically\n* See [Loaders](Loaders.md) for information on available loaders\n\n### Weight persistence\n\n* By default, weights will be written to `weights.dat`, after each epoch\n * You can add option `writeweightsinterval=5` to write weights every 5 minutes, even if the epoch hasnt finished yet. Just replace `5` with the number of minutes between each write\n* If you specify option `loadweights=1`, the weights will be loadeded at the start\n* You can change the weights filepath with option eg `weightsfile=somefilename.dat`\n* If you specify option `loadweights=1`, the `netdef` will be compared to that used to generate the current weights file: if it is different, then DeepCL will ask you if you're sure you want to continue, to avoid corrupting the weights file\n* Epoch number, batch number, batch loss, and batch numcorrect will all be loaded from where they left off, from the weights file, so you can freely stop and start training, without losing the training\n * be sure to use the `writeweightsinterval=5` option if you are going to stop/start often, with long epochs, to avoid losing hours/days of training!\n\n### Command-line options\n\n| Option | Description |\n|----|----|\n| gpuindex=1 | choose which gpu device to use. Default -1 means first gpu, or else cpu. Otherwise, gpu index from 0 |\n| dataset=norb | sets datadir, trainfile and validatefile according to one of several dataset profiles. Current choices: mnist, norb, cifar10, kgsgo, kgsgoall |\n| datadir=../data/mnist | path to data files |\n| trainfile=train-dat.mat | name of training data file, the one with the images in. Note that the labels file will be determined automatically, based on the data filename and type, eg in this case `train-cat.mat` |\n| validationfile=validate-dat.mat | name of the validation data file, the one with the images in. Note that the labels file will be determined automatically, based on the data filename and type, eg in this case `validate-cat.mat` |\n| numtrain=1000 | only uses the first 1000 training samples |\n| numtest=1000 | only uses the first 1000 testing samples |\n| netdef=100c5-10n | provide the network definition, as documented in [Commandline usage](#commandline-usage]) above |\n| weightsinitializer=uniform | choose weight initializer. valid choices: original, uniform (default: original) |\n| initialweights=10 | set size of initial weights, sampled uniformally from range +/- initialweights divided by fanin. used by uniform initializer (default: 1.0) |\n| trainer=sgd | choose trainer. valid choices are sgd, anneal, nesterov, adagrad, or rmsprop. (default: sgd) |\n| learningrate=0.0001 | specify learning rate. works with any trainer, except adadelta |\n| momentum=0.1 | specify momentum (default: 0). works with sgd and nesterov trainers |\n| rho=0.9 | rho decay, from equation 1 of adadelta paper, http://arxiv.org/pdf/1212.5701v1.pdf (default: 0.9) |\n| weightdecay=0.001 | weight decay, 0 means no decay, 1 means complete decay (default:0). works with sgd trainer |\n| anneal=0.95 | anneal learning. 1 means no annealing. 0 means learningrate is 0 (default:1). works with anneal trainer |\n| numepochs=20 | train for this many epochs |\n| batchsize=128 | size of each mini-batch. Too big, and the learning rate will need to be reduced. Too small, and performance will decrease. 128 might be a reasonable compromise |\n| normalization=maxmin | can choose maxmin or stddev. Default is stddev |\n| normalizationnumstds=2 | how many standard deviations from mean should be +1/-1? Default is 2 |\n| normalizationexamples=50000 | how many examples to read, to determine normalization values |\n| multinet=3 | train 3 networks at the same time, and predict using average output from all 3, can put any integer greater than 1 |\n| loadondemand=1 | Load the file in chunks, as learning proceeds, to reduce memory requirements. Default 0 |\n| filebatchsize=50 | When loadondemand=1, load this many batches at a time. Numbers larger than 1 increase efficiency of disk reads, speeding up learning, but use up more memory |\n| weightsfile=weights.dat | file to store weights in, after each epoch. If blank, then weights not stored |\n| writeweightsinterval=5 | write the weights to file every 5 minutes of training, even if epoch hasnt finished yet. Default is 0, ie only write weights after each epoch |\n| loadweights=1 | load weights at start, from weightsfile. Current training config, ie netdef and trainingfile, should match that used to create the weightsfile. Note that epoch number will continue from file, so make sure to increase numepochs sufficiently |\n\n## Prediction\n\nUse `deepcl_predict` to run prediction (`deepclexec` in v5.8.3 and below)\n\n\n"} +{"text": "Filter 1: ON PK Fc 19 Hz Gain 6.5 dB Q 0.57\nFilter 2: ON PK Fc 220 Hz Gain -7.6 dB Q 0.35\nFilter 3: ON PK Fc 1113 Hz Gain 4.2 dB Q 0.35\nFilter 4: ON PK Fc 6087 Hz Gain 4.1 dB Q 3.47\nFilter 5: ON PK Fc 9115 Hz Gain 6.5 dB Q 3.19\nFilter 6: ON PK Fc 8505 Hz Gain 1.3 dB Q 0.65\nFilter 7: ON PK Fc 10794 Hz Gain 2.2 dB Q 3.74\nFilter 8: ON PK Fc 11461 Hz Gain 2.8 dB Q 1.94\nFilter 9: ON PK Fc 18764 Hz Gain -7.2 dB Q 0.31\nFilter 10: ON PK Fc 19767 Hz Gain -8.4 dB Q 0.51"} +{"text": "; Test that a prototype can be marked const, and the definition is allowed\n; to be nonconst.\n\n; RUN: echo \"@X = external constant i32\" | llvm-as > %t.2.bc\n; RUN: llvm-as < %s > %t.1.bc\n; RUN: llvm-link %t.1.bc %t.2.bc -S | FileCheck %s\n; CHECK: global i32 7\n\n@X = global i32 7\n"} +{"text": "// Copyright 2016 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 terminal provides support functions for dealing with terminals, as\n// commonly found on UNIX systems.\n//\n// Putting a terminal into raw mode is the most common requirement:\n//\n// \toldState, err := terminal.MakeRaw(0)\n// \tif err != nil {\n// \t panic(err)\n// \t}\n// \tdefer terminal.Restore(0, oldState)\npackage terminal\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n)\n\ntype State struct{}\n\n// IsTerminal returns whether the given file descriptor is a terminal.\nfunc IsTerminal(fd int) bool {\n\treturn false\n}\n\n// MakeRaw put the terminal connected to the given file descriptor into raw\n// mode and returns the previous state of the terminal so that it can be\n// restored.\nfunc MakeRaw(fd int) (*State, error) {\n\treturn nil, fmt.Errorf(\"terminal: MakeRaw not implemented on %s/%s\", runtime.GOOS, runtime.GOARCH)\n}\n\n// GetState returns the current state of a terminal which may be useful to\n// restore the terminal after a signal.\nfunc GetState(fd int) (*State, error) {\n\treturn nil, fmt.Errorf(\"terminal: GetState not implemented on %s/%s\", runtime.GOOS, runtime.GOARCH)\n}\n\n// Restore restores the terminal connected to the given file descriptor to a\n// previous state.\nfunc Restore(fd int, state *State) error {\n\treturn fmt.Errorf(\"terminal: Restore not implemented on %s/%s\", runtime.GOOS, runtime.GOARCH)\n}\n\n// GetSize returns the dimensions of the given terminal.\nfunc GetSize(fd int) (width, height int, err error) {\n\treturn 0, 0, fmt.Errorf(\"terminal: GetSize not implemented on %s/%s\", runtime.GOOS, runtime.GOARCH)\n}\n\n// ReadPassword reads a line of input from a terminal without local echo. This\n// is commonly used for inputting passwords and other sensitive data. The slice\n// returned does not include the \\n.\nfunc ReadPassword(fd int) ([]byte, error) {\n\treturn nil, fmt.Errorf(\"terminal: ReadPassword not implemented on %s/%s\", runtime.GOOS, runtime.GOARCH)\n}\n"} +{"text": "package cron\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestActivation(t *testing.T) {\n\ttests := []struct {\n\t\ttime, spec string\n\t\texpected bool\n\t}{\n\t\t// Every fifteen minutes.\n\t\t{\"Mon Jul 9 15:00 2012\", \"0 0/15 * * *\", true},\n\t\t{\"Mon Jul 9 15:45 2012\", \"0 0/15 * * *\", true},\n\t\t{\"Mon Jul 9 15:40 2012\", \"0 0/15 * * *\", false},\n\n\t\t// Every fifteen minutes, starting at 5 minutes.\n\t\t{\"Mon Jul 9 15:05 2012\", \"0 5/15 * * *\", true},\n\t\t{\"Mon Jul 9 15:20 2012\", \"0 5/15 * * *\", true},\n\t\t{\"Mon Jul 9 15:50 2012\", \"0 5/15 * * *\", true},\n\n\t\t// Named months\n\t\t{\"Sun Jul 15 15:00 2012\", \"0 0/15 * * Jul\", true},\n\t\t{\"Sun Jul 15 15:00 2012\", \"0 0/15 * * Jun\", false},\n\n\t\t// Everything set.\n\t\t{\"Sun Jul 15 08:30 2012\", \"0 30 08 ? Jul Sun\", true},\n\t\t{\"Sun Jul 15 08:30 2012\", \"0 30 08 15 Jul ?\", true},\n\t\t{\"Mon Jul 16 08:30 2012\", \"0 30 08 ? Jul Sun\", false},\n\t\t{\"Mon Jul 16 08:30 2012\", \"0 30 08 15 Jul ?\", false},\n\n\t\t// Predefined schedules\n\t\t{\"Mon Jul 9 15:00 2012\", \"@hourly\", true},\n\t\t{\"Mon Jul 9 15:04 2012\", \"@hourly\", false},\n\t\t{\"Mon Jul 9 15:00 2012\", \"@daily\", false},\n\t\t{\"Mon Jul 9 00:00 2012\", \"@daily\", true},\n\t\t{\"Mon Jul 9 00:00 2012\", \"@weekly\", false},\n\t\t{\"Sun Jul 8 00:00 2012\", \"@weekly\", true},\n\t\t{\"Sun Jul 8 01:00 2012\", \"@weekly\", false},\n\t\t{\"Sun Jul 8 00:00 2012\", \"@monthly\", false},\n\t\t{\"Sun Jul 1 00:00 2012\", \"@monthly\", true},\n\n\t\t// Test interaction of DOW and DOM.\n\t\t// If both are specified, then only one needs to match.\n\t\t{\"Sun Jul 15 00:00 2012\", \"0 * * 1,15 * Sun\", true},\n\t\t{\"Fri Jun 15 00:00 2012\", \"0 * * 1,15 * Sun\", true},\n\t\t{\"Wed Aug 1 00:00 2012\", \"0 * * 1,15 * Sun\", true},\n\n\t\t// However, if one has a star, then both need to match.\n\t\t{\"Sun Jul 15 00:00 2012\", \"0 * * * * Mon\", false},\n\t\t{\"Sun Jul 15 00:00 2012\", \"0 * * */10 * Sun\", false},\n\t\t{\"Mon Jul 9 00:00 2012\", \"0 * * 1,15 * *\", false},\n\t\t{\"Sun Jul 15 00:00 2012\", \"0 * * 1,15 * *\", true},\n\t\t{\"Sun Jul 15 00:00 2012\", \"0 * * */2 * Sun\", true},\n\t}\n\n\tfor _, test := range tests {\n\t\tactual := Parse(test.spec).Next(getTime(test.time).Add(-1 * time.Second))\n\t\texpected := getTime(test.time)\n\t\tif test.expected && expected != actual || !test.expected && expected == actual {\n\t\t\tt.Errorf(\"Fail evaluating %s on %s: (expected) %s != %s (actual)\",\n\t\t\t\ttest.spec, test.time, expected, actual)\n\t\t}\n\t}\n}\n\nfunc TestNext(t *testing.T) {\n\truns := []struct {\n\t\ttime, spec string\n\t\texpected string\n\t}{\n\t\t// Simple cases\n\t\t{\"Mon Jul 9 14:45 2012\", \"0 0/15 * * *\", \"Mon Jul 9 15:00 2012\"},\n\t\t{\"Mon Jul 9 14:59 2012\", \"0 0/15 * * *\", \"Mon Jul 9 15:00 2012\"},\n\t\t{\"Mon Jul 9 14:59:59 2012\", \"0 0/15 * * *\", \"Mon Jul 9 15:00 2012\"},\n\n\t\t// Wrap around hours\n\t\t{\"Mon Jul 9 15:45 2012\", \"0 20-35/15 * * *\", \"Mon Jul 9 16:20 2012\"},\n\n\t\t// Wrap around days\n\t\t{\"Mon Jul 9 23:46 2012\", \"0 */15 * * *\", \"Tue Jul 10 00:00 2012\"},\n\t\t{\"Mon Jul 9 23:45 2012\", \"0 20-35/15 * * *\", \"Tue Jul 10 00:20 2012\"},\n\t\t{\"Mon Jul 9 23:35:51 2012\", \"15/35 20-35/15 * * *\", \"Tue Jul 10 00:20:15 2012\"},\n\t\t{\"Mon Jul 9 23:35:51 2012\", \"15/35 20-35/15 1/2 * *\", \"Tue Jul 10 01:20:15 2012\"},\n\t\t{\"Mon Jul 9 23:35:51 2012\", \"15/35 20-35/15 10-12 * *\", \"Tue Jul 10 10:20:15 2012\"},\n\n\t\t{\"Mon Jul 9 23:35:51 2012\", \"15/35 20-35/15 1/2 */2 * *\", \"Thu Jul 11 01:20:15 2012\"},\n\t\t{\"Mon Jul 9 23:35:51 2012\", \"15/35 20-35/15 * 9-20 * *\", \"Wed Jul 10 00:20:15 2012\"},\n\t\t{\"Mon Jul 9 23:35:51 2012\", \"15/35 20-35/15 * 9-20 Jul *\", \"Wed Jul 10 00:20:15 2012\"},\n\n\t\t// Wrap around months\n\t\t{\"Mon Jul 9 23:35 2012\", \"0 0 0 9 Apr-Oct ?\", \"Thu Aug 9 00:00 2012\"},\n\t\t{\"Mon Jul 9 23:35 2012\", \"0 0 0 */5 Apr,Aug,Oct Mon\", \"Mon Aug 6 00:00 2012\"},\n\t\t{\"Mon Jul 9 23:35 2012\", \"0 0 0 */5 Oct Mon\", \"Mon Oct 1 00:00 2012\"},\n\n\t\t// Wrap around years\n\t\t{\"Mon Jul 9 23:35 2012\", \"0 0 0 * Feb Mon\", \"Mon Feb 4 00:00 2013\"},\n\t\t{\"Mon Jul 9 23:35 2012\", \"0 0 0 * Feb Mon/2\", \"Fri Feb 1 00:00 2013\"},\n\n\t\t// Wrap around minute, hour, day, month, and year\n\t\t{\"Mon Dec 31 23:59:45 2012\", \"0 * * * * *\", \"Tue Jan 1 00:00:00 2013\"},\n\n\t\t// Leap year\n\t\t{\"Mon Jul 9 23:35 2012\", \"0 0 0 29 Feb ?\", \"Mon Feb 29 00:00 2016\"},\n\n\t\t// Daylight savings time EST -> EDT\n\t\t{\"2012-03-11T00:00:00-0500\", \"0 30 2 11 Mar ?\", \"2013-03-11T02:30:00-0400\"},\n\n\t\t// Daylight savings time EDT -> EST\n\t\t{\"2012-11-04T00:00:00-0400\", \"0 30 2 04 Nov ?\", \"2012-11-04T02:30:00-0500\"},\n\t\t{\"2012-11-04T01:45:00-0400\", \"0 30 1 04 Nov ?\", \"2012-11-04T01:30:00-0500\"},\n\n\t\t// Unsatisfiable\n\t\t{\"Mon Jul 9 23:35 2012\", \"0 0 0 30 Feb ?\", \"\"},\n\t\t{\"Mon Jul 9 23:35 2012\", \"0 0 0 31 Apr ?\", \"\"},\n\t}\n\n\tfor _, c := range runs {\n\t\tactual := Parse(c.spec).Next(getTime(c.time))\n\t\texpected := getTime(c.expected)\n\t\tif !actual.Equal(expected) {\n\t\t\tt.Errorf(\"%s, \\\"%s\\\": (expected) %v != %v (actual)\", c.time, c.spec, expected, actual)\n\t\t}\n\t}\n}\n\nfunc getTime(value string) time.Time {\n\tif value == \"\" {\n\t\treturn time.Time{}\n\t}\n\tt, err := time.Parse(\"Mon Jan 2 15:04 2006\", value)\n\tif err != nil {\n\t\tt, err = time.Parse(\"Mon Jan 2 15:04:05 2006\", value)\n\t\tif err != nil {\n\t\t\tt, err = time.Parse(\"2006-01-02T15:04:05-0700\", value)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\t// Daylight savings time tests require location\n\t\t\tif ny, err := time.LoadLocation(\"America/New_York\"); err == nil {\n\t\t\t\tt = t.In(ny)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn t\n}\n"} +{"text": "{\n \"dataset_reader\": {\n \"type\": \"constituency_ancestor_prediction\",\n \"ancestor\": \"parent\"\n },\n \"train_data_path\": \"data/syntactic_constituency/wsj.train.trees\",\n \"validation_data_path\": \"data/syntactic_constituency/wsj.dev.trees\",\n \"test_data_path\": \"data/syntactic_constituency/wsj.test.trees\",\n \"evaluate_on_test\" : true,\n \"model\": {\n \"type\": \"tagger\",\n \"contextualizer\": {\n \"type\": \"elmo_contextualizer\",\n \"batch_size\": 80,\n \"elmo\": {\n \"weight_file\": \"contextualizers/elmo_original_randomly_initialized/elmo_original_randomly_initialized_weights.hdf5\",\n \"options_file\": \"contextualizers/elmo_original_randomly_initialized/elmo_original_randomly_initialized_options.json\",\n \"requires_grad\": true,\n \"num_output_representations\": 1,\n \"dropout\": 0.0\n }\n },\n \"token_representation_dim\": 1024\n },\n \"iterator\": {\n \"type\": \"basic\",\n \"batch_size\" : 80\n },\n \"trainer\": {\n \"num_epochs\": 50,\n \"patience\": 3,\n \"cuda_device\": 0,\n \"validation_metric\": \"+accuracy\",\n \"optimizer\": {\n \"type\": \"adam\",\n \"lr\": 0.001\n }\n }\n}\n"} +{"text": "name = $name;\n }\n\n /**\n * Sets the data formater instance used by this collector\n *\n * @param DataFormatterInterface $formater\n * @return $this\n */\n public function setDataFormatter(DataFormatterInterface $formater)\n {\n $this->dataFormater = $formater;\n return $this;\n }\n\n /**\n * @return DataFormatterInterface\n */\n public function getDataFormatter()\n {\n if ($this->dataFormater === null) {\n $this->dataFormater = DataCollector::getDefaultDataFormatter();\n }\n return $this->dataFormater;\n }\n\n /**\n * Sets the variable dumper instance used by this collector\n *\n * @param DebugBarVarDumper $varDumper\n * @return $this\n */\n public function setVarDumper(DebugBarVarDumper $varDumper)\n {\n $this->varDumper = $varDumper;\n return $this;\n }\n\n /**\n * Gets the variable dumper instance used by this collector\n *\n * @return DebugBarVarDumper\n */\n public function getVarDumper()\n {\n if ($this->varDumper === null) {\n $this->varDumper = DataCollector::getDefaultVarDumper();\n }\n return $this->varDumper;\n }\n\n /**\n * Sets a flag indicating whether the Symfony HtmlDumper will be used to dump variables for\n * rich variable rendering. Be sure to set this flag before logging any messages for the\n * first time.\n *\n * @param bool $value\n * @return $this\n */\n public function useHtmlVarDumper($value = true)\n {\n $this->useHtmlVarDumper = $value;\n return $this;\n }\n\n /**\n * Indicates whether the Symfony HtmlDumper will be used to dump variables for rich variable\n * rendering.\n *\n * @return mixed\n */\n public function isHtmlVarDumperUsed()\n {\n return $this->useHtmlVarDumper;\n }\n\n /**\n * Adds a message\n *\n * A message can be anything from an object to a string\n *\n * @param mixed $message\n * @param string $label\n */\n public function addMessage($message, $label = 'info', $isString = true)\n {\n $messageText = $message;\n $messageHtml = null;\n if (!is_string($message)) {\n // Send both text and HTML representations; the text version is used for searches\n $messageText = $this->getDataFormatter()->formatVar($message);\n if ($this->isHtmlVarDumperUsed()) {\n $messageHtml = $this->getVarDumper()->renderVar($message);\n }\n $isString = false;\n }\n $this->messages[] = array(\n 'message' => $messageText,\n 'message_html' => $messageHtml,\n 'is_string' => $isString,\n 'label' => $label,\n 'time' => microtime(true)\n );\n }\n\n /**\n * Aggregates messages from other collectors\n *\n * @param MessagesAggregateInterface $messages\n */\n public function aggregate(MessagesAggregateInterface $messages)\n {\n $this->aggregates[] = $messages;\n }\n\n /**\n * @return array\n */\n public function getMessages()\n {\n $messages = $this->messages;\n foreach ($this->aggregates as $collector) {\n $msgs = array_map(function ($m) use ($collector) {\n $m['collector'] = $collector->getName();\n return $m;\n }, $collector->getMessages());\n $messages = array_merge($messages, $msgs);\n }\n\n // sort messages by their timestamp\n usort($messages, function ($a, $b) {\n if ($a['time'] === $b['time']) {\n return 0;\n }\n return $a['time'] < $b['time'] ? -1 : 1;\n });\n\n return $messages;\n }\n\n /**\n * @param $level\n * @param $message\n * @param array $context\n */\n public function log($level, $message, array $context = array())\n {\n $this->addMessage($message, $level);\n }\n\n /**\n * Deletes all messages\n */\n public function clear()\n {\n $this->messages = array();\n }\n\n /**\n * @return array\n */\n public function collect()\n {\n $messages = $this->getMessages();\n return array(\n 'count' => count($messages),\n 'messages' => $messages\n );\n }\n\n /**\n * @return string\n */\n public function getName()\n {\n return $this->name;\n }\n\n /**\n * @return array\n */\n public function getAssets() {\n return $this->isHtmlVarDumperUsed() ? $this->getVarDumper()->getAssets() : array();\n }\n\n /**\n * @return array\n */\n public function getWidgets()\n {\n $name = $this->getName();\n return array(\n \"$name\" => array(\n 'icon' => 'list-alt',\n \"widget\" => \"PhpDebugBar.Widgets.MessagesWidget\",\n \"map\" => \"$name.messages\",\n \"default\" => \"[]\"\n ),\n \"$name:badge\" => array(\n \"map\" => \"$name.count\",\n \"default\" => \"null\"\n )\n );\n }\n}\n"} +{"text": "{% extends \"simple-centered-wide.html\" %}\n{% load i18n %}\n\n{% block title %}{% trans \"Delete portal\" %}{% endblock %}\n\n{% block content %}\n

\n {% blocktrans %}\n Are you sure you want to delete your portal?\n All its pages will be deleted too. This cannot be undone.\n {% endblocktrans %}\n

\n
\n {% csrf_token %}\n \n \n
\n{% endblock %}\n"} +{"text": "# THIS PAGE IS DEPRECATED AND NO LONGER USED AS OF OPENEMR VERSION 4.1.2\n# (It is being kept indefinitely for upgrading purposes)\n# (This file should never be deleted)\n#\n# CLICKOPTIONS by Mark Leeds\n# This is a new addition to OpenEMR written in April of 2005.\n# The purpose is to minimize typing in places where a select box or drop down menu\n# would be helpful. For now it is implemented in the medical history section that\n# is reached if you are looking at a patient chart and click 'Summary' at the top\n# of the screen and then click 'more' next to 'Medical Problems' below. You will see\n# five sets of boxes where you can edit medical problems, medications, allergies, surgeries,\n# and immunizations. If this file that you are reading now is set up properly, you will see\n# below each category heading a select box that allows you to click and select from a few\n# text options that will immediately appear in the box below (javascript must be active of course).\n# The format for this file is that any line starting with a '#' is a comment.\n# Categories and choices for the select boxes are entered with a '::' separating them. see\n# below for example. You may add more choices, change them or do away with them alltogether.\n# If a category has no choices assigned in this file, the select box will not appear.\n# The files that had to be altered for this feature to work are in openemr/interface/patient_file/summary.\n# Three statements were added to 5 files marked with a clickoptions comment and two files were added\n# to the directory, 'clickoptions1.php' and 'clickoptions2.php'.\nmedical_problem::HTN\nmedical_problem::asthma\nmedical_problem::diabetes\nmedical_problem::hyperlipidemia\nmedication::Norvasc\nmedication::Lipitor\nmedication::Metformin\nallergy::penicillin\nallergy::sulfa\nallergy::iodine\nallergy::codeine\nsurgery::tonsillectomy\nsurgery::appendectomy\nsurgery::cholecystectomy\nimmunizations::Gardasil #1\nimmunizations::Gardasil #2\nimmunizations::Gardasil #3\nimmunizations::MMR\nimmunizations::tetanus\nimmunizations::varicella\nimmunizations::Zostavax\ngeneral::Osteopathy\ngeneral::Chiropractic\ngeneral::Prevention Rehab\ngeneral::Podiatry\ngeneral::Strength and Conditioning\ngeneral::Nutritional\ngeneral::Fitness Testing\ngeneral::Pre Participation Assessment\ngeneral::Screening / Testing\n"} +{"text": "#!/usr/bin/env python\n#\n# Copyright 2008-2009 Jose Fonseca\n#\n# This program is free software: you can redistribute it and/or modify it\n# under the terms of the GNU Lesser General Public License as published\n# by 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 Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public License\n# along with this program. If not, see .\n#\n\npass\n"} +{"text": "//\n// Progress bars\n// --------------------------------------------------\n\n\n// Bar animations\n// -------------------------\n\n// WebKit\n@-webkit-keyframes progress-bar-stripes {\n from { background-position: 40px 0; }\n to { background-position: 0 0; }\n}\n\n// Spec and IE10+\n@keyframes progress-bar-stripes {\n from { background-position: 40px 0; }\n to { background-position: 0 0; }\n}\n\n\n// Bar itself\n// -------------------------\n\n// Outer container\n.progress {\n overflow: hidden;\n height: @line-height-computed;\n margin-bottom: @line-height-computed;\n background-color: @progress-bg;\n border-radius: @progress-border-radius;\n .box-shadow(inset 0 1px 2px rgba(0,0,0,.1));\n}\n\n// Bar of progress\n.progress-bar {\n float: left;\n width: 0%;\n height: 100%;\n font-size: @font-size-small;\n line-height: @line-height-computed;\n color: @progress-bar-color;\n text-align: center;\n background-color: @progress-bar-bg;\n .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15));\n .transition(width .6s ease);\n}\n\n// Striped bars\n//\n// `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the\n// `.progress-bar-striped` class, which you just add to an existing\n// `.progress-bar`.\n.progress-striped .progress-bar,\n.progress-bar-striped {\n #gradient > .striped();\n background-size: 40px 40px;\n}\n\n// Call animation for the active one\n//\n// `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the\n// `.progress-bar.active` approach.\n.progress.active .progress-bar,\n.progress-bar.active {\n .animation(progress-bar-stripes 2s linear infinite);\n}\n\n\n// Variations\n// -------------------------\n\n.progress-bar-success {\n .progress-bar-variant(@progress-bar-success-bg);\n}\n\n.progress-bar-info {\n .progress-bar-variant(@progress-bar-info-bg);\n}\n\n.progress-bar-warning {\n .progress-bar-variant(@progress-bar-warning-bg);\n}\n\n.progress-bar-danger {\n .progress-bar-variant(@progress-bar-danger-bg);\n}\n"} +{"text": "import { takeEvery, apply, put } from 'redux-saga/effects';\nimport {\n fetchNovelTextSuccess,\n fetchNovelTextFailure,\n} from '../actions/novelText';\nimport { addError } from '../actions/error';\nimport pixiv from '../helpers/apiClient';\nimport { NOVEL_TEXT } from '../constants/actionTypes';\n\nexport function* handleFetchNovelText(action) {\n const { novelId } = action.payload;\n try {\n const response = yield apply(pixiv, pixiv.novelText, [novelId]);\n yield put(fetchNovelTextSuccess(response.novel_text, novelId));\n } catch (err) {\n yield put(fetchNovelTextFailure(novelId));\n yield put(addError(err));\n }\n}\n\nexport function* watchFetchNovelText() {\n yield takeEvery(NOVEL_TEXT.REQUEST, handleFetchNovelText);\n}\n"} +{"text": "/*\n * MoppyUDP.h\n *\n */\n#ifdef ARDUINO_ARCH_ESP8266 // For now, this will only work with ESP8266\n#ifndef SRC_MOPPYNETWORKS_MOPPYUDP_H_\n#define SRC_MOPPYNETWORKS_MOPPYUDP_H_\n\n#include \"../MoppyConfig.h\"\n#include \"../MoppyMessageConsumer.h\"\n#include \"Arduino.h\"\n#include \"MoppyNetwork.h\"\n#include \n#include \n#include //Local WebServer used to serve the configuration portal\n#include // https://github.com/alanswx/ESPAsyncWiFiManager WiFi Configuration Magic\n#include \n#include \n\n#define MOPPY_UDP_PORT 30994\n#define MOPPY_MAX_PACKET_LENGTH 259\n\nclass MoppyUDP {\npublic:\n MoppyUDP(MoppyMessageConsumer *messageConsumer);\n void begin();\n void readMessages();\n\nprivate:\n MoppyMessageConsumer *targetConsumer;\n uint8_t messagePos = 0; // Track current message read position\n uint8_t messageBuffer[MOPPY_MAX_PACKET_LENGTH]; // Max message length for Moppy messages is 259\n const uint8_t pongBytes[8] = {START_BYTE, 0x00, 0x00, 0x04, 0x81, DEVICE_ADDRESS, MIN_SUB_ADDRESS, MAX_SUB_ADDRESS};\n void startOTA();\n bool startUDP();\n void parseMessage(uint8_t message[], int length);\n void sendPong();\n};\n\n#endif /* SRC_MOPPYNETWORKS_MOPPYUDP_H_ */\n#endif /* ARDUINO_ARCH_ESP8266 */\n"} +{"text": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# S3 Bucket Notification to SQS/SNS on Object Creation\n\nimport boto3, json\n\nREGION_NAME = \"ap-south-1\"\ns3BucketName=\"trawler-urls-bucket\"\n\nami_id=\"\"\n\nEC2_URL = \"https://\" + REGION_NAME + \".ec2.amazonaws.com\"\nAWS_AUTO_SCALING_URL = \"https://autoscaling.\" + REGION_NAME +\".amazonaws.com\"\n\n\n# email_address = user@example.com\nsns_topic_name = \"s3-object-created-\" + s3BucketName.replace (\" \", \"_\")\nsqs_queue_name = \"trawlerDataProcessor\"\n\n## Create the `S3` bucket\ns3_client = boto3.client('s3',REGION_NAME)\ns3_client.create_bucket(Bucket= s3BucketName , CreateBucketConfiguration = { 'LocationConstraint': REGION_NAME })\n\n## Lets create the SNS Topic\nsns_client = boto3.client('sns', REGION_NAME)\nsns_topic_arn = sns_client.create_topic( Name = sns_topic_name)['TopicArn']\n\n\n\n### Allow S3 to publish to the SNS topic for activity in the specific S3 bucket.\n\n#### Policy to allow S3 to publish to SNS Topic\ns3PubToSnsPolicy = { \"Version\": \"2008-10-17\",\n \"Id\": \"Policy-S3-publish-to-sns\",\n \"Statement\": [{\n \"Effect\": \"Allow\",\n \"Principal\": { \"AWS\" : \"*\" },\n \"Action\": [ \"sns:Publish\" ],\n \"Resource\": sns_topic_arn,\n \"Condition\": {\n \"ArnLike\": {\n \"aws:SourceArn\": \"arn:aws:s3:*:*:\"+ s3BucketName + \"\"\n }\n }\n }]\n}\n\n\nsns_client.set_topic_attributes( TopicArn = sns_topic_arn , \n AttributeName = \"Policy\" , \n AttributeValue = json.dumps(s3PubToSnsPolicy)\n )\n\n\n### Set a nice little diplay name for the topic\nsns_client.set_topic_attributes( TopicArn = sns_topic_arn , \n AttributeName = \"DisplayName\" , \n AttributeValue = 'Urls2Crawl' \n )\n\n\n#### Add a notification to the S3 bucket so that it sends messages to the SNS topic when objects are created (or updated)\n\nbucket_notifications_configuration = { \n \"TopicConfiguration\" : { \n \"Events\" : [ \"s3:ObjectCreated:*\" ], \n \"Topic\" : sns_topic_arn \n }\n }\n\ns3_client.put_bucket_notification( Bucket= s3BucketName,\n NotificationConfiguration = bucket_notifications_configuration \n )\n\n\n\n### Subscribe to the SNS Topic for EMail Notification\nsns_client.subscribe( TopicArn = sns_topic_arn , Protocol = \"email\", Endpoint=\"SOMEUSER@gmail.com\" )\n\naws sns subscribe \\\n --topic-arn \"$sns_topic_arn\" \\\n --protocol email \\\n --notification-endpoint \"$email_address\"\n\n##### The above example connects an SNS topic to the S3 bucket notification configuration. Amazon also supports having the bucket notifications go directly to an SQS queue, but I do not recommend it.\n\n##### Instead, send the S3 bucket notification to SNS and have SNS forward it to SQS. \n##### This way, you can easily add other listeners to the SNS topic as desired. You can even have multiple SQS queues subscribed, which is not possible when using a direct notification configuration.\n\n### Create the SQS queue \nsqs_client = boto3.client('sqs', REGION_NAME)\n\n\n#### Set permissions to allow SNS topic to post to the SQS queue\nsqs_policy = {\n \"Version\":\"2012-10-17\",\n \"Statement\":[\n {\n \"Effect\" : \"Allow\",\n \"Principal\" : { \"AWS\": \"*\" },\n \"Action\" : \"sqs:SendMessage\",\n \"Resource\" : sqs_queue_arn,\n \"Condition\" : {\n \"ArnEquals\" : {\n \"aws:SourceArn\" : sns_topic_arn\n }\n }\n }\n ]\n}\n\n\nsqs_attributes = { 'DelaySeconds':'3',\n 'ReceiveMessageWaitTimeSeconds' : '20',\n 'VisibilityTimeout' : '300',\n 'MessageRetentionPeriod':'86400',\n 'Policy' : json.dumps(sqs_policy)\n }\n\nresp = sqs_client.create_queue( QueueName = sqs_queue_name, Attributes = sqs_attributes )\nsqs_queue_url = resp['QueueUrl']\n\n#### Get SQS Queue Attributes\nresp = sqs_client.get_queue_attributes( QueueUrl = sqs_queue_url, AttributeNames=[ 'QueueArn' ] )\nsqs_queue_arn = resp['Attributes']['QueueArn']\n\n\n## Subscribe the SQS queue to the SNS topic.\nsns_client.subscribe(\n TopicArn = sns_topic_arn,\n Protocol = \"sqs\",\n Endpoint = sqs_queue_arn\n)\n\n### Test SNS publishing to SQS\n##### Upload test file to the S3 bucket, which will now generate both the email and a message to the SQS queue.\n# aws s3 cp [SOMEFILE] s3://$s3_bucket_name/testfile-02\ns3Up = boto3.resource('s3')\ns3Up.meta.client.upload_file('SOME_FILE.TXT', s3BucketName, 'hello.txt')\n\n\n \"\"\"\n Function to clean up all the resources\n \"\"\"\n def cleanAll(resourcesDict=None):\n\n # Delete S3 Bucket \n ### All of the keys in a bucket must be deleted before the bucket itself can be deleted:\n \n bucket = s3.Bucket( s3BucketName )\n \n for key in bucket.objects.all():\n key.delete()\n bucket.delete()\n \n # Delete SNS Topic\n sns_client.delete_topic( TopicArn = sns_topic_arn)\n\n # Delete SQS Topic\n sqs_client.delete_queue( QueueUrl = sqs_queue_url)\n\n#### Ref [1] : https://alestic.com/2014/12/s3-bucket-notification-to-sqssns-on-object-creation/"} +{"text": "//\n// ********************************************************************\n// * License and Disclaimer *\n// * *\n// * The Geant4 software is copyright of the Copyright Holders of *\n// * the Geant4 Collaboration. It is provided under the terms and *\n// * conditions of the Geant4 Software License, included in the file *\n// * LICENSE and available at http://cern.ch/geant4/license . These *\n// * include a list of copyright holders. *\n// * *\n// * Neither the authors of this software system, nor their employing *\n// * institutes,nor the agencies providing financial support for this *\n// * work make any representation or warranty, express or implied, *\n// * regarding this software system or assume any liability for its *\n// * use. Please see the license in the file LICENSE and URL above *\n// * for the full disclaimer and the limitation of liability. *\n// * *\n// * This code implementation is the result of the scientific and *\n// * technical work of the GEANT4 collaboration. *\n// * By using, copying, modifying or distributing the software (or *\n// * any work based on the software) you agree to acknowledge its *\n// * use in resulting scientific publications, and indicate your *\n// * acceptance of all terms of the Geant4 Software license. *\n// ********************************************************************\n//\n//\n/// \\file GunPrimaryGeneratorAction.hh\n/// \\brief Definition of the GunPrimaryGeneratorAction class\n\n#ifndef GunPrimaryGeneratorAction_h\n#define GunPrimaryGeneratorAction_h 1\n\n#include \"G4VUserPrimaryGeneratorAction.hh\"\n#include \"G4ThreeVector.hh\"\n#include \"globals.hh\"\n\n#include \"CLHEP/Units/SystemOfUnits.h\"\n\nclass G4ParticleGun;\nclass G4Event;\n\n/// \\ingroup primary_generator\n/// \\brief The primary generator class with particle gun\n///\n/// \\author I. Hrivnacova; IPN Orsay\n\nclass GunPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction\n{\n public:\n GunPrimaryGeneratorAction(\n const G4String& particleName = \"geantino\",\n G4double energy = 1.*CLHEP::MeV,\n G4ThreeVector position= G4ThreeVector(0,0,0),\n G4ThreeVector momentumDirection = G4ThreeVector(0,0,1)); \n ~GunPrimaryGeneratorAction();\n\n // methods\n virtual void GeneratePrimaries(G4Event*);\n\n private:\n // data members\n G4ParticleGun* fParticleGun;\n};\n\n#endif\n"} +{"text": "\n\n \n \n \n \n \n \n \n __name__ \n locale_el.js.map \n \n \n _vars \n \n \n \n \n \n globals \n \n \n \n \n \n \n \n\n"} +{"text": "/*\nCopyright 2019 The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage v1alpha3\n\nimport (\n\t\"sigs.k8s.io/kind/pkg/apis/config/defaults\"\n)\n\n// SetDefaultsCluster sets uninitialized fields to their default value.\nfunc SetDefaultsCluster(obj *Cluster) {\n\t// default to a one node cluster\n\tif len(obj.Nodes) == 0 {\n\t\tobj.Nodes = []Node{\n\t\t\t{\n\t\t\t\tImage: defaults.Image,\n\t\t\t\tRole: ControlPlaneRole,\n\t\t\t},\n\t\t}\n\t}\n\t// default the nodes\n\tfor i := range obj.Nodes {\n\t\ta := &obj.Nodes[i]\n\t\tSetDefaultsNode(a)\n\t}\n\tif obj.Networking.IPFamily == \"\" {\n\t\tobj.Networking.IPFamily = \"ipv4\"\n\t}\n\t// default to listening on 127.0.0.1:randomPort on ipv4\n\t// and [::1]:randomPort on ipv6\n\tif obj.Networking.APIServerAddress == \"\" {\n\t\tobj.Networking.APIServerAddress = \"127.0.0.1\"\n\t\tif obj.Networking.IPFamily == \"ipv6\" {\n\t\t\tobj.Networking.APIServerAddress = \"::1\"\n\t\t}\n\t}\n\t// default the pod CIDR\n\tif obj.Networking.PodSubnet == \"\" {\n\t\tobj.Networking.PodSubnet = \"10.244.0.0/16\"\n\t\tif obj.Networking.IPFamily == \"ipv6\" {\n\t\t\tobj.Networking.PodSubnet = \"fd00:10:244::/64\"\n\t\t}\n\t}\n\t// default the service CIDR using the kubeadm default\n\t// https://github.com/kubernetes/kubernetes/blob/746404f82a28e55e0b76ffa7e40306fb88eb3317/cmd/kubeadm/app/apis/kubeadm/v1beta2/defaults.go#L32\n\t// Note: kubeadm is doing it already but this simplifies kind's logic\n\tif obj.Networking.ServiceSubnet == \"\" {\n\t\tobj.Networking.ServiceSubnet = \"10.96.0.0/12\"\n\t\tif obj.Networking.IPFamily == \"ipv6\" {\n\t\t\tobj.Networking.ServiceSubnet = \"fd00:10:96::/112\"\n\t\t}\n\t}\n}\n\n// SetDefaultsNode sets uninitialized fields to their default value.\nfunc SetDefaultsNode(obj *Node) {\n\tif obj.Image == \"\" {\n\t\tobj.Image = defaults.Image\n\t}\n\n\tif obj.Role == \"\" {\n\t\tobj.Role = ControlPlaneRole\n\t}\n}\n"} +{"text": "\n\n\n\n\n\n\n\n\n
\n
Loading...
\n
\n\n
Searching...
\n
No Matches
\n\n
\n \n \n\n\n"} +{"text": "//\n// YYGestureRecognizer.m\n// YYKit \n//\n// Created by ibireme on 14/10/26.\n// Copyright (c) 2015 ibireme.\n//\n// This source code is licensed under the MIT-style license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n#import \"YYGestureRecognizer.h\"\n#import \n\n@implementation YYGestureRecognizer\n\n- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {\n self.state = UIGestureRecognizerStateBegan;\n _startPoint = [(UITouch *)[touches anyObject] locationInView:self.view];\n _lastPoint = _currentPoint;\n _currentPoint = _startPoint;\n if (_action) _action(self, YYGestureRecognizerStateBegan);\n}\n\n- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {\n UITouch *touch = (UITouch *)[touches anyObject];\n CGPoint currentPoint = [touch locationInView:self.view];\n self.state = UIGestureRecognizerStateChanged;\n _currentPoint = currentPoint;\n if (_action) _action(self, YYGestureRecognizerStateMoved);\n _lastPoint = _currentPoint;\n}\n\n- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {\n self.state = UIGestureRecognizerStateEnded;\n if (_action) _action(self, YYGestureRecognizerStateEnded);\n}\n\n- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {\n self.state = UIGestureRecognizerStateCancelled;\n if (_action) _action(self, YYGestureRecognizerStateCancelled);\n}\n\n- (void)reset {\n self.state = UIGestureRecognizerStatePossible;\n}\n\n- (void)cancel {\n if (self.state == UIGestureRecognizerStateBegan || self.state == UIGestureRecognizerStateChanged) {\n self.state = UIGestureRecognizerStateCancelled;\n if (_action) _action(self, YYGestureRecognizerStateCancelled);\n }\n}\n\n@end\n"} +{"text": "{\n \"status\": \"RESPONSE\"\n}\n"} +{"text": "// Copyright (c) 2016, Baidu.com, Inc. 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#pragma once\n#include \"subsystem.h\"\n\nnamespace baidu {\nnamespace galaxy {\nnamespace cgroup {\n\nclass FreezerSubsystem : public Subsystem {\npublic:\n FreezerSubsystem();\n ~FreezerSubsystem();\n\n baidu::galaxy::util::ErrorCode Freeze();\n baidu::galaxy::util::ErrorCode Thaw();\n bool Empty();\n\n baidu::galaxy::util::ErrorCode Collect(std::map& stat);\n boost::shared_ptr Clone();\n std::string Name();\n baidu::galaxy::util::ErrorCode Construct();\n\n};\n}\n}\n}\n"} +{"text": "The WiFi settings are configured in the file \\texttt{/etc/config/wireless}\n(currently supported on Broadcom, Atheros and mac80211). When booting the router for the first time\nit should detect your card and create a sample configuration file. By default '\\texttt{option network lan}' is\ncommented. This prevents unsecured sharing of the network over the wireless interface.\n\nEach wireless driver has its own configuration script in \\texttt{/lib/wifi/driver\\_name.sh} which handles\ndriver specific options and configurations. This script is also calling driver specific binaries like wlc for\nBroadcom, or hostapd and wpa\\_supplicant for atheros and mac80211.\n\nThe reason for using such architecture, is that it abstracts the driver configuration. \n\n\\paragraph{Generic Broadcom wireless config:}\n\n\\begin{Verbatim}\nconfig wifi-device \"wl0\"\n option type \"broadcom\"\n option channel \"5\"\n\nconfig wifi-iface\n option device \"wl0\"\n# option network lan\n option mode \"ap\"\n option ssid \"OpenWrt\"\n option hidden \"0\"\n option encryption \"none\"\n\\end{Verbatim}\n\n\\paragraph{Generic Atheros wireless config:}\n\n\\begin{Verbatim}\nconfig wifi-device \"wifi0\"\n option type \"atheros\"\n option channel \"5\"\n option hwmode\t\"11g\"\n\nconfig wifi-iface\n option device \"wifi0\"\n# option network lan\n option mode \"ap\"\n option ssid \"OpenWrt\"\n option hidden \"0\"\n option encryption \"none\"\n\\end{Verbatim}\n\n\\paragraph{Generic mac80211 wireless config:}\n\n\\begin{Verbatim}\nconfig wifi-device \"wifi0\"\n option type \"mac80211\"\n option channel \"5\"\n\nconfig wifi-iface\n option device \"wlan0\"\n# option network lan\n option mode \"ap\"\n option ssid \"OpenWrt\"\n option hidden \"0\"\n option encryption \"none\"\n\\end{Verbatim}\n\n\\paragraph{Generic multi-radio Atheros wireless config:}\n\n\\begin{Verbatim}\nconfig wifi-device wifi0\n option type atheros\n option channel 1\n\nconfig wifi-iface\n option device wifi0\n# option network lan\n option mode ap\n option ssid OpenWrt_private\n option hidden 0\n option encryption none\n\nconfig wifi-device wifi1\n option type atheros\n option channel 11\n\nconfig wifi-iface\n option device wifi1\n# option network lan\n option mode ap\n option ssid OpenWrt_public\n option hidden 1\n option encryption none\n\\end{Verbatim}\n\nThere are two types of config sections in this file. The '\\texttt{wifi-device}' refers to\nthe physical wifi interface and '\\texttt{wifi-iface}' configures a virtual interface on top\nof that (if supported by the driver).\n\nA full outline of the wireless configuration file with description of each field:\n\n\\begin{Verbatim}\nconfig wifi-device wifi device name\n option type broadcom, atheros, mac80211\n option country us, uk, fr, de, etc.\n option channel 1-14\n option maxassoc 1-128 (broadcom only)\n option distance 1-n (meters)\n option hwmode 11b, 11g, 11a, 11bg (atheros, mac80211)\n option rxantenna 0,1,2 (atheros, broadcom)\n option txantenna 0,1,2 (atheros, broadcom)\n option txpower transmission power in dBm\n\nconfig wifi-iface\n option network the interface you want wifi to bridge with\n option device wifi0, wifi1, wifi2, wifiN\n option mode ap, sta, adhoc, monitor, mesh, or wds\n option txpower (deprecated) transmission power in dBm\n option ssid ssid name\n option bssid bssid address\n option encryption none, wep, psk, psk2, wpa, wpa2\n option key encryption key\n option key1 key 1\n option key2 key 2\n option key3 key 3\n option key4 key 4\n option passphrase 0,1\n option server ip address\n option port port\n option hidden 0,1\n option isolate 0,1\t(broadcom)\n option doth 0,1\t(atheros, broadcom)\n option wmm 0,1\t(atheros, broadcom)\n\\end{Verbatim}\n\n\\paragraph{Options for the \\texttt{wifi-device}:}\n\n\\begin{itemize}\n \\item \\texttt{type} \\\\\n The driver to use for this interface.\n\t\n \\item \\texttt{country} \\\\\n The country code used to determine the regulatory settings.\n\n \\item \\texttt{channel} \\\\\n The wifi channel (e.g. 1-14, depending on your country setting).\n\n \\item \\texttt{maxassoc} \\\\\n Optional: Maximum number of associated clients. This feature is supported only on the Broadcom chipsets.\n\n \\item \\texttt{distance} \\\\\n\tOptional: Distance between the ap and the furthest client in meters. This feature is supported only on the Atheros chipsets.\n\n\t\\item \\texttt{mode} \\\\\n\t\tThe frequency band (\\texttt{b}, \\texttt{g}, \\texttt{bg}, \\texttt{a}). This feature is only supported on the Atheros chipsets.\n\n \\item \\texttt{diversity} \\\\\n\tOptional: Enable diversity for the Wi-Fi device. This feature is supported only on the Atheros chipsets.\n\n \\item \\texttt{rxantenna} \\\\\n\tOptional: Antenna identifier (0, 1 or 2) for reception. This feature is supported by Atheros and some Broadcom chipsets.\n\n \\item \\texttt{txantenna} \\\\\n\tOptional: Antenna identifier (0, 1 or 2) for emission. This feature is supported by Atheros and some Broadcom chipsets.\n\n \\item \\texttt{txpower}\n\tSet the transmission power to be used. The amount is specified in dBm.\n\n\\end{itemize}\n\n\\paragraph{Options for the \\texttt{wifi-iface}:}\n\n\\begin{itemize}\n \\item \\texttt{network} \\\\\n Selects the interface section from \\texttt{/etc/config/network} to be\n used with this interface\n\n \\item \\texttt{device} \\\\\n\tSet the wifi device name.\n\n \\item \\texttt{mode} \\\\\n Operating mode:\n\n \\begin{itemize}\n \\item \\texttt{ap} \\\\\n Access point mode\n\n \\item \\texttt{sta} \\\\\n Client mode\n\n \\item \\texttt{adhoc} \\\\\n Ad-Hoc mode\n\n \\item \\texttt{monitor} \\\\\n Monitor mode\n\n\t \\item \\texttt{mesh} \\\\\n\t\tMesh Point mode (802.11s)\n\n \\item \\texttt{wds} \\\\\n WDS point-to-point link\n\n \\end{itemize}\n\n \\item \\texttt{ssid}\n\tSet the SSID to be used on the wifi device.\n\n \\item \\texttt{bssid}\n\tSet the BSSID address to be used for wds to set the mac address of the other wds unit.\n\n \\item \\texttt{txpower}\n\t(Deprecated, set in wifi-device) Set the transmission power to be used. The amount is specified in dBm.\n\n \\item \\texttt{encryption} \\\\\n Encryption setting. Accepts the following values:\n\n \\begin{itemize}\n\t \\item \\texttt{none}\n\t \\item \\texttt{wep}\n \\item \\texttt{psk}, \\texttt{psk2} \\\\\n WPA(2) Pre-shared Key\n\n \\item \\texttt{wpa}, \\texttt{wpa2} \\\\\n WPA(2) RADIUS\n \\end{itemize}\n\n \\item \\texttt{key, key1, key2, key3, key4} (wep, wpa and psk) \\\\\n WEP key, WPA key (PSK mode) or the RADIUS shared secret (WPA RADIUS mode)\n\n \\item \\texttt{passphrase} (wpa) \\\\\n 0 treats the wpa psk as a text passphrase; 1 treats wpa psk as\n encoded passphrase. You can generate an encoded passphrase with\n the wpa\\_passphrase utility. This is especially useful if your\n passphrase contains special characters. This option only works\n when using mac80211 or atheros type devices.\n\n \\item \\texttt{server} (wpa) \\\\\n The RADIUS server ip address\n\n \\item \\texttt{port} (wpa) \\\\\n The RADIUS server port (defaults to 1812)\n\n \\item \\texttt{hidden} \\\\\n 0 broadcasts the ssid; 1 disables broadcasting of the ssid\n\n \\item \\texttt{isolate} \\\\\n Optional: Isolation is a mode usually set on hotspots that limits the clients to communicate only with the AP and not with other wireless clients.\n 0 disables ap isolation (default); 1 enables ap isolation.\n\n \\item \\texttt{doth} \\\\\n Optional: Toggle 802.11h mode.\n 0 disables 802.11h (default); 1 enables it.\n\n \\item \\texttt{wmm} \\\\\n Optional: Toggle 802.11e mode.\n 0 disables 802.11e (default); 1 enables it.\n\n\\end{itemize}\n\n\\paragraph{Mesh Point}\n\nMesh Point (802.11s) is only supported by some mac80211 drivers. It requires the iw package\nto be installed to setup mesh links. OpenWrt creates mshN mesh point interfaces. A sample\nconfiguration looks like this:\n\n\\begin{Verbatim}\nconfig wifi-device \"wlan0\"\n option type\t\t\"mac80211\"\n option channel \"5\"\n\nconfig wifi-iface\n option device \"wlan0\"\n option network \tlan\n option mode \"mesh\"\n option mesh_id \"OpenWrt\"\n\\end{Verbatim}\n\n\\paragraph{Wireless Distribution System}\n\nWDS is a non-standard mode which will be working between two Broadcom devices for instance\nbut not between a Broadcom and Atheros device.\n\n\\subparagraph{Unencrypted WDS connections}\n\nThis configuration example shows you how to setup unencrypted WDS connections.\nWe assume that the peer configured as below as the BSSID ca:fe:ba:be:00:01\nand the remote WDS endpoint ca:fe:ba:be:00:02 (option bssid field).\n\n\\begin{Verbatim}\nconfig wifi-device \"wl0\"\n option type\t\t\"broadcom\"\n option channel \"5\"\n\nconfig wifi-iface\n option device \"wl0\"\n option network \tlan\n option mode \"ap\"\n option ssid \"OpenWrt\"\n option hidden \"0\"\n option encryption \"none\"\n\nconfig wifi-iface\n option device \"wl0\"\n option network lan\n option mode wds\n option ssid \"OpenWrt WDS\"\n option bssid \"ca:fe:ba:be:00:02\"\n\\end{Verbatim}\n\n\\subparagraph{Encrypted WDS connections}\n\nIt is also possible to encrypt WDS connections. \\texttt{psk}, \\texttt{psk2} and\n\\texttt{psk+psk2} modes are supported. Configuration below is an example\nconfiguration using Pre-Shared-Keys with AES algorithm.\n\n\\begin{Verbatim}\nconfig wifi-device wl0\n option type broadcom\n option channel 5\n\nconfig wifi-iface\n option device \"wl0\"\n option network lan\n option mode ap\n option ssid \"OpenWrt\"\n option encryption psk2\n option key \"\"\n\nconfig wifi-iface\n option device \"wl0\"\n option network lan\n option mode wds\n option bssid ca:fe:ba:be:00:02\n option ssid \"OpenWrt WDS\"\n option encryption\tpsk2\n option key \"\"\n\\end{Verbatim}\n\n\\paragraph{802.1x configurations}\n\nOpenWrt supports both 802.1x client and Access Point\nconfigurations. 802.1x client is only working with\ndrivers supported by wpa-supplicant. Configuration\nonly supports EAP types TLS, TTLS or PEAP.\n\n\\subparagraph{EAP-TLS}\n\n\\begin{Verbatim}\nconfig wifi-iface\n option device \"ath0\"\n option network lan\n option ssid OpenWrt\n option eap_type tls\n option ca_cert \"/etc/config/certs/ca.crt\"\n option priv_key \"/etc/config/certs/priv.crt\"\n option priv_key_pwd \"PKCS#12 passphrase\"\n\\end{Verbatim}\n\n\\subparagraph{EAP-PEAP}\n\n\\begin{Verbatim}\nconfig wifi-iface\n option device \"ath0\"\n option network lan\n option ssid OpenWrt\n option eap_type peap\n option ca_cert \"/etc/config/certs/ca.crt\"\n option auth MSCHAPV2\n option identity username\n option password password\n\\end{Verbatim}\n\n\\paragraph{Limitations:}\n\nThere are certain limitations when combining modes.\nOnly the following mode combinations are supported:\n\n\\begin{itemize}\n \\item \\textbf{Broadcom}: \\\\\n \\begin{itemize}\n \\item 1x \\texttt{sta}, 0-3x \\texttt{ap}\n \\item 1-4x \\texttt{ap}\n \\item 1x \\texttt{adhoc}\n \\item 1x \\texttt{monitor}\n \\end{itemize}\n\n WDS links can only be used in pure AP mode and cannot use WEP (except when sharing the\n settings with the master interface, which is done automatically).\n\n \\item \\textbf{Atheros}: \\\\\n \\begin{itemize}\n \\item 1x \\texttt{sta}, 0-Nx \\texttt{ap}\n \\item 1-Nx \\texttt{ap}\n \\item 1x \\texttt{adhoc}\n \\end{itemize}\n\n\tN is the maximum number of VAPs that the module allows, it defaults to 4, but can be\n\tchanged by loading the module with the maxvaps=N parameter.\n\\end{itemize}\n\n\\paragraph{Adding a new driver configuration}\n\nSince we currently only support thread different wireless drivers : Broadcom, Atheros and mac80211,\nyou might be interested in adding support for another driver like Ralink RT2x00, \nTexas Instruments ACX100/111.\n\nThe driver specific script should be placed in \\texttt{/lib/wifi/.sh} and has to\ninclude several functions providing :\n\n\\begin{itemize}\n\t\\item detection of the driver presence\n\t\\item enabling/disabling the wifi interface(s)\n\t\\item configuration reading and setting\n\t\\item third-party programs calling (nas, supplicant)\n\\end{itemize}\n\nEach driver script should append the driver to a global DRIVERS variable :\n\n\\begin{Verbatim}\nappend DRIVERS \"driver name\"\n\\end{Verbatim}\n\n\\subparagraph{\\texttt{scan\\_}}\n\nThis function will parse the \\texttt{/etc/config/wireless} and make sure there\nare no configuration incompatibilities, like enabling hidden SSIDS with ad-hoc mode\nfor instance. This can be more complex if your driver supports a lof of configuration\noptions. It does not change the state of the interface.\n\nExample:\n\\begin{Verbatim}\nscan_dummy() {\n\tlocal device=\"$1\"\n\n\tconfig_get vifs \"$device\" vifs\n\tfor vif in $vifs; do\n\t\t# check config consistency for wifi-iface sections\n\tdone\n\t# check mode combination\n}\n\\end{Verbatim}\n\n\\subparagraph{\\texttt{enable\\_}}\n\nThis function will bring up the wifi device and optionally create application specific\nconfiguration files, e.g. for the WPA authenticator or supplicant.\n\nExample:\n\\begin{Verbatim}\nenable_dummy() {\n\tlocal device=\"$1\"\n\n\tconfig_get vifs \"$device\" vifs\n\tfor vif in $vifs; do\n\t\t# bring up virtual interface belonging to\n\t\t# the wifi-device \"$device\"\n\tdone\n}\n\\end{Verbatim}\n\n\\subparagraph{\\texttt{disable\\_}}\n\nThis function will bring down the wifi device and all its virtual interfaces (if supported).\n\nExample:\n\\begin{Verbatim}\ndisable_dummy() {\n\tlocal device=\"$1\"\n\n\t# bring down virtual interfaces belonging to\n\t# \"$device\" regardless of whether they are\n\t# configured or not. Don't rely on the vifs\n\t# variable at this point\n}\n\\end{Verbatim}\n\n\\subparagraph{\\texttt{detect\\_}}\n\nThis function looks for interfaces that are usable with the driver. Template config sections\nfor new devices should be written to stdout. Must check for already existing config sections\nbelonging to the interfaces before creating new templates.\n\nExample:\n\\begin{Verbatim}\ndetect_dummy() {\n\t[ wifi-device = \"$(config_get dummydev type)\" ] && return 0\n\tcat <\n\nnamespace arangodb {\nnamespace velocypack {\nclass Slice;\n}\n\nnamespace fuerte { inline namespace v1 { namespace jwt {\n\n/// Generate JWT token as used by internal arangodb communication\nstd::string generateInternalToken(std::string const& secret,\n std::string const& id);\n\n/// Generate JWT token as used for 'users' in arangodb\nstd::string generateUserToken(std::string const& secret,\n std::string const& username,\n std::chrono::seconds validFor = std::chrono::seconds{0});\n\nstd::string generateRawJwt(std::string const& secret,\n arangodb::velocypack::Slice const& body);\n\n//////////////////////////////////////////////////////////////////////////\n/// @brief Internals\n//////////////////////////////////////////////////////////////////////////\n\nenum Algorithm {\n ALGORITHM_SHA256 = 0,\n ALGORITHM_SHA1 = 1,\n ALGORITHM_MD5 = 2,\n ALGORITHM_SHA224 = 3,\n ALGORITHM_SHA384 = 4,\n ALGORITHM_SHA512 = 5\n};\n\n//////////////////////////////////////////////////////////////////////////\n/// @brief HMAC\n//////////////////////////////////////////////////////////////////////////\n\nstd::string sslHMAC(char const* key, size_t keyLength, char const* message,\n size_t messageLen, Algorithm algorithm);\n\n//////////////////////////////////////////////////////////////////////////\n/// @brief HMAC\n//////////////////////////////////////////////////////////////////////////\n\nbool verifyHMAC(char const* challenge, size_t challengeLength,\n char const* secret, size_t secretLen, char const* response,\n size_t responseLen, Algorithm algorithm);\n}}} // namespace fuerte::v1::jwt\n} // namespace arangodb\n#endif\n"} +{"text": "{% extends \"base.html\" %}\n\n\n{% block content %}\n \n{% endblock content %}"} +{"text": "# Any copyright is dedicated to the Public Domain.\n# http://creativecommons.org/publicdomain/zero/1.0/\n\nfrom nagini_contracts.contracts import *\nfrom typing import List\n\ndef test_list_3(r: List[int]) -> None:\n #:: ExpectedOutput(not.wellformed:insufficient.permission)|ExpectedOutput(carbon)(not.wellformed:insufficient.permission)\n Requires(Forall(r, lambda i: (i > 0, [])))\n\n a = 3\n"} +{"text": "fileFormatVersion: 2\nguid: d291658cb55e14f468a243d74591cca0\ntimeCreated: 1456835515\nlicenseType: Free\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []\n executionOrder: 0\n icon: {instanceID: 0}\n userData: \n assetBundleName: \n assetBundleVariant: \n"} +{"text": "package org.zstack.header.vm;\n\nimport org.zstack.header.message.MessageReply;\n\n/**\n */\npublic class VmAttachNicOnHypervisorReply extends MessageReply {\n}\n"} +{"text": "\n\n\n\nAPE Tags\n\n\n\n

APE Tags

\n

Tags found in Monkey's Audio (APE) information. Only a few common tags are\nlisted below, but ExifTool will extract any tag found. ExifTool supports\nAPEv1 and APEv2 tags, as well as ID3 information in APE files, and will also\nread APE metadata from MP3 and MPC files.

\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Tag IDTag NameWritableValues / Notes
'Album'Albumno 
'Artist'Artistno 
'DURATION'Durationno 
'Genre'Genreno 
'Title'Titleno 
'Tool Name'ToolNameno 
'Tool Version'ToolVersionno 
'Track'Trackno 
'Year'Yearno 
\n\n

APE NewHeader Tags

\n

APE MAC audio header for version 3.98 or later.

\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Index2Tag NameWritableValues / Notes
0CompressionLevelno 
2BlocksPerFrameno 
4FinalFrameBlocksno 
6TotalFramesno 
8BitsPerSampleno 
9Channelsno 
10SampleRateno 
\n\n

APE OldHeader Tags

\n

APE MAC audio header for version 3.97 or earlier.

\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Index2Tag NameWritableValues / Notes
0APEVersionno 
1CompressionLevelno 
3Channelsno 
4SampleRateno 
10TotalFramesno 
12FinalFrameBlocksno 
\n\n
\n(This document generated automatically by Image::ExifTool::BuildTagLookup)\n
Last revised Jul 7, 2017\n

<-- ExifTool Tag Names

\n\n\n"} +{"text": "\n\n \n \n \n \n\n \n \n This XML Schema defines and documents BPMN 2.0 extension elements and\n attributes introduced by Activiti.\n \n \n \n \n \n \n Attribute on a start event.\n Denotes a process variable in which the process initiator set in the \n identityService.setAuthenticatedUserId(userId) is captured.\n \n \n \n \n \n \n \n Attribute on the process element. \n Allows to set the history level for this specific process definition\n differently from the history level set in the process engine configuration.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Attribute used on a startEvent or a userTask. \n The value can be anything. The default form support in Activiti\n assumes that this is a reference to a form html file insed the deployment\n of the process definition. But this key can also be something completely different,\n in case of external form resolving.\n \n \n \n \n \n \n \n Attribute on a startEvent or userTask.\n Allows to specify a custom class that will be called during the parsing \n of the form information. Thus way, it is possible to use custom forms and form handling.\n This class must implement the \n org.activiti.engine.inpl.form.FormHamdler/StartFormHandler/taskFormHandler interface\n (specific interface depending on the activity). \n \n \n \n \n \n \n \n \n \n \n \n \n \n Subelement of the extensionsElement of activities that support forms.\n Allows to specifies properties (!= process variables) for a form. See documentation chapter on\n form properties.\n \n \n \n \n \n \n \n The key used to submit the property through the API.\n \n \n \n \n \n \n The display label of the property.\n \n \n \n \n \n \n The type of the property (see documentation for supported types). \n Default is 'string'.\n \n \n \n \n \n \n Specifies if the property can be read and displayed in the form.\n \n \n \n \n \n \n Specifies if the property is expected when the form is submitted.\n \n \n \n \n \n \n Specifies if the property is a required field.\n \n \n \n \n \n \n Specifies the process variable on which the variable is mapped.\n \n \n \n \n \n \n Specifies an expression that maps the property, eg. ${street.address}\n \n \n \n \n \n \n \n \n \n Service Task attribute for specifying a fully qualified Java class\n name. The Java class must implement either\n org.activiti.engine.delegate.JavaDelegate or\n org.activiti.engine.impl.pvm.delegate.ActivityBehavior\n \n \n \n \n \n \n \n \n \n \n \n \n \n Service Task attribute specifying a built-in service task implementation.\n \n \n \n \n \n \n \n \n \n \n \n \n Attribute on Service and Script Task corresponding with a process variable name.\n The result of executing the service task logic or the script will be stored \n in this process variable.\n \n \n \n \n \n \n \n Allows to specify an expression that is evaluated at runtime. \n \n \n \n \n \n \n \n Allows to specify an expression on a service task, taskListener or executionListener\n that at runtime must resolve to an object that implements the corresponsing\n interface (JavaDelegate, ActivityBehavior, TaskListener, ExecutionListener, etc.)\n \n \n \n\n \n \n \n Extension Element for Service Tasks to inject values into the fields of\n delegate classes.\n \n \n \n \n \t\n \t\n \n \n \n \n \n \n \n \n \n \n Expression using the language declared in the expressionLanguage\n attribute of BPMN's definitions element.\n \n \n \n \n \n \n \n \n \n User Task attribute to set the human performer of a user task.\n Also supports expressions that evaluate to a String.\n \n \n \n \n \n \n \n User Task attribute to set the task due date.\n The expression should resolve to a value of typejava.util.Date.\n \n \n \n \n \n \n \n User Task attribute to set the potential owners of a user task.\n The provided user(s) will be candidate for performing the user task.\n In case of multiple user ids, a comma-separated list must be provided.\n Also supports expressions that evaluate to a String or Collection<String>.\n \n \n \n \n \n \n \n User Task attribute to set the potential owners of a user task.\n The provided group(s) will be candidate for performing the user task.\n In case of multiple group ids, a comma-separated list must be provided.\n Also supports expressions that evaluate to a String or Collection<String>.\n \n \n \n\n \n \n \n Process attribute to set the potential starts of a process.\n Provided user(s) will be able to start the process. \n In case of multiple user ids, a comma-separated list must be provided.\n Also supports expressions that evaluate to a String or Collection<String>.\n \n \n \n \n \n \n \n Process attribute to set the potential starts of a process.\n Provided group(s) will be able to start the process. \n In case of multiple group ids, a comma-separated list must be provided.\n Also supports expressions that evaluate to a String or Collection<String>.\n \n \n \n \n \n\t\n\t\t\n\t\n \n \n \n \n \n \n \n Extension element for User Tasks used to execute custom Java logic or an \n expression upon the occurrence of a certain event. \n \n \n \n \n \n \n \n \n \n An implementation of the org.activiti.engine.impl.pvm.delegate.TaskListener interface\n that will be called when the task event occurs.\n \n \n \n \n \n \n Expression that will be evaluated when the task event occurs.\n \n \n \n \n \n \n Expression that must resolve to an object implementing a compatible interface\n for a taskListener. Evaluation and delegation to the resulting object is done\n when the task event occurs.\n \n \n \n \n \n \n The event on which the delegation class or expression will be executed.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Extension element for any activities and sequenceflow, used to execute custom Java logic or an \n expression upon the occurrence of a certain event. \n \n \n \n \n \n \n \n \n \n An implementation of the org.activiti.engine.impl.pvm.delegate.ExecutionListener interface\n that will be called when the event occurs.\n \n \n \n \n \n \n Expression that will be evaluated when the event occurs.\n \n \n \n \n \n \n Expression that must resolve to an object implementing a compatible interface\n for an executionListener. Evaluation and delegation to the resulting object is done\n when the task event occurs.\n \n \n \n \n \n \n The event on which the delegation class or expression will be executed.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Element to specify Data Input in Activiti Shortcuts\n (compare to DataInputAssociation in BPMN)\n \n \n \n \n \n \n \n \n \n \n \n Element to specify Data Output in Activiti Shortcuts\n (compare to DataOutputAssociation in BPMN)\n \n \n \n \n \n \n \n \n \n \n \n \n To be used on the multiInstanceLoopCharacteristics element, referencing a collection.\n For each element in the collection, an instance will be created. Can be an expression \n or reference to a process variable.\n \n \n \n \n \n \n \n To be used on the multiInstanceLoopCharacteristics element, used in conjunction with\n the activiti:collection attribute. Denotes the name of the process variable that\n will be set on each created instance, containing an element of the specified collection.\n \n \n \n \n\n"} +{"text": "#include \"UI.h\"\n#include \"DISPLAY.h\"\n#include \"SYSTEM.h\"\n#include \n\nstatic unsigned int missed_irq_counter;\nbutton_cbk_t button_cbk;\n\n\nvoid UI_init()\n{\n DISPLAY_init();\n SYSTEM_register_irq(UI_button_irq_handler, IRQ_GPIO_2);\n button_cbk = 0;\n missed_irq_counter = 0;\n}\n\nunsigned int UI_get_missed_irqs()\n{\n\treturn missed_irq_counter;\n}\n\nvoid UI_button_irq_handler()\n{\n\tif(button_cbk)\n\t{\n\t\tbutton_cbk();\n\t}\n\telse\n\t{\n\t\tmissed_irq_counter++;\n\t}\n}\n\nvoid UI_register_button_cbk(button_cbk_t cbk)\n{\n\tbutton_cbk = cbk;\n}\n\nvoid UI_write_line(char *line)\n{\n\tstatic char out[27];\n\tstrncpy(out, line, 26);\n\tout[26] = '\\0';\n\tif(DISPLAY_get_line_capacity() == DISPLAY_get_line_insert_index())\n\t\tDISPLAY_clear();\n\tDISPLAY_output(out);\n}\n"} +{"text": "{\n \"label-key-1\":\"label-value-1\",\n \"label-key-2\":\"label-value-2\",\n \"only-key\": \"\",\n \"fc-id\": \"0123-abcd-4567-efgh\"\n}\n"} +{"text": "\n \n 小程序接口\n 这里就当前已支持的接口能力进行演示\n \n\n \n \n \n \n {{menuItem.name}}\n \n \n \n \n \n \n \n \n {{APIItem.zhName}}\n {{APIItem.enName}}\n \n \n \n \n \n \n \n \n \n\n"} +{"text": "/*\n * Copyright © 2014 Mozilla Foundation\n *\n * This program is made available under an ISC-style license. See the\n * accompanying file LICENSE for details.\n */\n#ifndef NOMINMAX\n#define NOMINMAX\n#endif // NOMINMAX\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \"cubeb_resampler.h\"\n#include \"cubeb-speex-resampler.h\"\n#include \"cubeb_resampler_internal.h\"\n#include \"cubeb_utils.h\"\n\nint\nto_speex_quality(cubeb_resampler_quality q)\n{\n switch(q) {\n case CUBEB_RESAMPLER_QUALITY_VOIP:\n return SPEEX_RESAMPLER_QUALITY_VOIP;\n case CUBEB_RESAMPLER_QUALITY_DEFAULT:\n return SPEEX_RESAMPLER_QUALITY_DEFAULT;\n case CUBEB_RESAMPLER_QUALITY_DESKTOP:\n return SPEEX_RESAMPLER_QUALITY_DESKTOP;\n default:\n assert(false);\n return 0XFFFFFFFF;\n }\n}\n\nuint32_t min_buffered_audio_frame(uint32_t sample_rate)\n{\n return sample_rate / 20;\n}\n\ntemplate\npassthrough_resampler::passthrough_resampler(cubeb_stream * s,\n cubeb_data_callback cb,\n void * ptr,\n uint32_t input_channels,\n uint32_t sample_rate)\n : processor(input_channels)\n , stream(s)\n , data_callback(cb)\n , user_ptr(ptr)\n , sample_rate(sample_rate)\n{\n}\n\ntemplate\nlong passthrough_resampler::fill(void * input_buffer, long * input_frames_count,\n void * output_buffer, long output_frames)\n{\n if (input_buffer) {\n assert(input_frames_count);\n }\n assert((input_buffer && output_buffer) ||\n (output_buffer && !input_buffer && (!input_frames_count || *input_frames_count == 0)) ||\n (input_buffer && !output_buffer && output_frames == 0));\n\n // When we have no pending input data and exactly as much input\n // as output data, we don't need to copy it into the internal buffer\n // and can directly forward it to the callback.\n void * in_buf = input_buffer;\n unsigned long pop_input_count = 0u;\n if (input_buffer && !output_buffer) {\n output_frames = *input_frames_count;\n } else if(input_buffer) {\n if (internal_input_buffer.length() != 0 ||\n *input_frames_count < output_frames) {\n // If we have pending input data left and have to first append the input\n // so we can pass it as one pointer to the callback. Or this is a glitch.\n // It can happen when system's performance is poor. Audible silence is\n // being pushed at the end of the short input buffer. An improvement for\n // the future is to resample to the output number of frames, when that happens.\n internal_input_buffer.push(static_cast(input_buffer),\n frames_to_samples(*input_frames_count));\n if (internal_input_buffer.length() < frames_to_samples(output_frames)) {\n // This is unxpected but it can happen when a glitch occurs. Fill the\n // buffer with silence. First keep the actual number of input samples\n // used without the silence.\n pop_input_count = internal_input_buffer.length();\n internal_input_buffer.push_silence(\n frames_to_samples(output_frames) - internal_input_buffer.length());\n } else {\n pop_input_count = frames_to_samples(output_frames);\n }\n in_buf = internal_input_buffer.data();\n } else if(*input_frames_count > output_frames) {\n // In this case we have more input that we need output and\n // fill the overflowing input into internal_input_buffer\n // Since we have no other pending data, we can nonetheless\n // pass the current input data directly to the callback\n assert(pop_input_count == 0);\n unsigned long samples_off = frames_to_samples(output_frames);\n internal_input_buffer.push(static_cast(input_buffer) + samples_off,\n frames_to_samples(*input_frames_count - output_frames));\n }\n }\n\n long rv = data_callback(stream, user_ptr, in_buf, output_buffer, output_frames);\n\n if (input_buffer) {\n if (pop_input_count) {\n internal_input_buffer.pop(nullptr, pop_input_count);\n *input_frames_count = samples_to_frames(pop_input_count);\n } else {\n *input_frames_count = output_frames;\n }\n drop_audio_if_needed();\n }\n\n return rv;\n}\n\n// Explicit instantiation of template class.\ntemplate class passthrough_resampler;\ntemplate class passthrough_resampler;\n\ntemplate\ncubeb_resampler_speex\n ::cubeb_resampler_speex(InputProcessor * input_processor,\n OutputProcessor * output_processor,\n cubeb_stream * s,\n cubeb_data_callback cb,\n void * ptr)\n : input_processor(input_processor)\n , output_processor(output_processor)\n , stream(s)\n , data_callback(cb)\n , user_ptr(ptr)\n{\n if (input_processor && output_processor) {\n // Add some delay on the processor that has the lowest delay so that the\n // streams are synchronized.\n uint32_t in_latency = input_processor->latency();\n uint32_t out_latency = output_processor->latency();\n if (in_latency > out_latency) {\n uint32_t latency_diff = in_latency - out_latency;\n output_processor->add_latency(latency_diff);\n } else if (in_latency < out_latency) {\n uint32_t latency_diff = out_latency - in_latency;\n input_processor->add_latency(latency_diff);\n }\n fill_internal = &cubeb_resampler_speex::fill_internal_duplex;\n } else if (input_processor) {\n fill_internal = &cubeb_resampler_speex::fill_internal_input;\n } else if (output_processor) {\n fill_internal = &cubeb_resampler_speex::fill_internal_output;\n }\n}\n\ntemplate\ncubeb_resampler_speex\n ::~cubeb_resampler_speex()\n{ }\n\ntemplate\nlong\ncubeb_resampler_speex\n::fill(void * input_buffer, long * input_frames_count,\n void * output_buffer, long output_frames_needed)\n{\n /* Input and output buffers, typed */\n T * in_buffer = reinterpret_cast(input_buffer);\n T * out_buffer = reinterpret_cast(output_buffer);\n return (this->*fill_internal)(in_buffer, input_frames_count,\n out_buffer, output_frames_needed);\n}\n\ntemplate\nlong\ncubeb_resampler_speex\n::fill_internal_output(T * input_buffer, long * input_frames_count,\n T * output_buffer, long output_frames_needed)\n{\n assert(!input_buffer && (!input_frames_count || *input_frames_count == 0) &&\n output_buffer && output_frames_needed);\n\n if (!draining) {\n long got = 0;\n T * out_unprocessed = nullptr;\n long output_frames_before_processing = 0;\n\n /* fill directly the input buffer of the output processor to save a copy */\n output_frames_before_processing =\n output_processor->input_needed_for_output(output_frames_needed);\n\n out_unprocessed =\n output_processor->input_buffer(output_frames_before_processing);\n\n got = data_callback(stream, user_ptr,\n nullptr, out_unprocessed,\n output_frames_before_processing);\n\n if (got < output_frames_before_processing) {\n draining = true;\n\n if (got < 0) {\n return got;\n }\n }\n\n output_processor->written(got);\n }\n\n /* Process the output. If not enough frames have been returned from the\n * callback, drain the processors. */\n return output_processor->output(output_buffer, output_frames_needed);\n}\n\ntemplate\nlong\ncubeb_resampler_speex\n::fill_internal_input(T * input_buffer, long * input_frames_count,\n T * output_buffer, long /*output_frames_needed*/)\n{\n assert(input_buffer && input_frames_count && *input_frames_count &&\n !output_buffer);\n\n /* The input data, after eventual resampling. This is passed to the callback. */\n T * resampled_input = nullptr;\n uint32_t resampled_frame_count = input_processor->output_for_input(*input_frames_count);\n\n /* process the input, and present exactly `output_frames_needed` in the\n * callback. */\n input_processor->input(input_buffer, *input_frames_count);\n\n size_t frames_resampled = 0;\n resampled_input = input_processor->output(resampled_frame_count, &frames_resampled);\n *input_frames_count = frames_resampled;\n\n long got = data_callback(stream, user_ptr,\n resampled_input, nullptr, resampled_frame_count);\n\n /* Return the number of initial input frames or part of it.\n * Since output_frames_needed == 0 in input scenario, the only\n * available number outside resampler is the initial number of frames. */\n return (*input_frames_count) * (got / resampled_frame_count);\n}\n\ntemplate\nlong\ncubeb_resampler_speex\n::fill_internal_duplex(T * in_buffer, long * input_frames_count,\n T * out_buffer, long output_frames_needed)\n{\n if (draining) {\n // discard input and drain any signal remaining in the resampler.\n return output_processor->output(out_buffer, output_frames_needed);\n }\n\n /* The input data, after eventual resampling. This is passed to the callback. */\n T * resampled_input = nullptr;\n /* The output buffer passed down in the callback, that might be resampled. */\n T * out_unprocessed = nullptr;\n long output_frames_before_processing = 0;\n /* The number of frames returned from the callback. */\n long got = 0;\n\n /* We need to determine how much frames to present to the consumer.\n * - If we have a two way stream, but we're only resampling input, we resample\n * the input to the number of output frames.\n * - If we have a two way stream, but we're only resampling the output, we\n * resize the input buffer of the output resampler to the number of input\n * frames, and we resample it afterwards.\n * - If we resample both ways, we resample the input to the number of frames\n * we would need to pass down to the consumer (before resampling the output),\n * get the output data, and resample it to the number of frames needed by the\n * caller. */\n\n output_frames_before_processing =\n output_processor->input_needed_for_output(output_frames_needed);\n /* fill directly the input buffer of the output processor to save a copy */\n out_unprocessed =\n output_processor->input_buffer(output_frames_before_processing);\n\n if (in_buffer) {\n /* process the input, and present exactly `output_frames_needed` in the\n * callback. */\n input_processor->input(in_buffer, *input_frames_count);\n\n size_t frames_resampled = 0;\n resampled_input =\n input_processor->output(output_frames_before_processing, &frames_resampled);\n *input_frames_count = frames_resampled;\n } else {\n resampled_input = nullptr;\n }\n\n got = data_callback(stream, user_ptr,\n resampled_input, out_unprocessed,\n output_frames_before_processing);\n\n if (got < output_frames_before_processing) {\n draining = true;\n\n if (got < 0) {\n return got;\n }\n }\n\n output_processor->written(got);\n\n input_processor->drop_audio_if_needed();\n\n /* Process the output. If not enough frames have been returned from the\n * callback, drain the processors. */\n got = output_processor->output(out_buffer, output_frames_needed);\n\n output_processor->drop_audio_if_needed();\n\n return got;\n}\n\n/* Resampler C API */\n\ncubeb_resampler *\ncubeb_resampler_create(cubeb_stream * stream,\n cubeb_stream_params * input_params,\n cubeb_stream_params * output_params,\n unsigned int target_rate,\n cubeb_data_callback callback,\n void * user_ptr,\n cubeb_resampler_quality quality)\n{\n cubeb_sample_format format;\n\n assert(input_params || output_params);\n\n if (input_params) {\n format = input_params->format;\n } else {\n format = output_params->format;\n }\n\n switch(format) {\n case CUBEB_SAMPLE_S16NE:\n return cubeb_resampler_create_internal(stream,\n input_params,\n output_params,\n target_rate,\n callback,\n user_ptr,\n quality);\n case CUBEB_SAMPLE_FLOAT32NE:\n return cubeb_resampler_create_internal(stream,\n input_params,\n output_params,\n target_rate,\n callback,\n user_ptr,\n quality);\n default:\n assert(false);\n return nullptr;\n }\n}\n\nlong\ncubeb_resampler_fill(cubeb_resampler * resampler,\n void * input_buffer,\n long * input_frames_count,\n void * output_buffer,\n long output_frames_needed)\n{\n return resampler->fill(input_buffer, input_frames_count,\n output_buffer, output_frames_needed);\n}\n\nvoid\ncubeb_resampler_destroy(cubeb_resampler * resampler)\n{\n delete resampler;\n}\n\nlong\ncubeb_resampler_latency(cubeb_resampler * resampler)\n{\n return resampler->latency();\n}\n"} +{"text": "DEFINED_PHASES=compile configure install prepare test\nDEPEND=>=sys-apps/systemd-217:= app-arch/xz-utils:0 dev-util/gperf >=dev-util/intltool-0.50 >=sys-apps/coreutils-8.16 >=sys-devel/binutils-2.23.1 >=sys-kernel/linux-headers-3.8 virtual/pkgconfig virtual/pkgconfig virtual/pkgconfig\nDESCRIPTION=Split of readahead systemd implementation\nEAPI=6\nHOMEPAGE=https://dev.gentoo.org/~pacho/systemd-readahead.html\nKEYWORDS=~alpha amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc x86\nLICENSE=LGPL-2.1 MIT\nRDEPEND=>=sys-apps/systemd-217:=\nSLOT=0\nSRC_URI=https://www.freedesktop.org/software/systemd/systemd-216.tar.xz\n_eclasses_=multilib\t98584e405e2b0264d37e8f728327fed1\tsystemd\t69be00334d73f9f50261554b94be0879\ttoolchain-funcs\t605c126bed8d87e4378d5ff1645330cb\tudev\t452708c3f55cf6e918b045adb949a9e6\n_md5_=7da07563028e821778c5f86f5cae9631\n"} +{"text": "package yamux\n\nimport (\n\t\"fmt\"\n\t\"net\"\n)\n\n// hasAddr is used to get the address from the underlying connection\ntype hasAddr interface {\n\tLocalAddr() net.Addr\n\tRemoteAddr() net.Addr\n}\n\n// yamuxAddr is used when we cannot get the underlying address\ntype yamuxAddr struct {\n\tAddr string\n}\n\nfunc (*yamuxAddr) Network() string {\n\treturn \"yamux\"\n}\n\nfunc (y *yamuxAddr) String() string {\n\treturn fmt.Sprintf(\"yamux:%s\", y.Addr)\n}\n\n// Addr is used to get the address of the listener.\nfunc (s *Session) Addr() net.Addr {\n\treturn s.LocalAddr()\n}\n\n// LocalAddr is used to get the local address of the\n// underlying connection.\nfunc (s *Session) LocalAddr() net.Addr {\n\taddr, ok := s.conn.(hasAddr)\n\tif !ok {\n\t\treturn &yamuxAddr{\"local\"}\n\t}\n\treturn addr.LocalAddr()\n}\n\n// RemoteAddr is used to get the address of remote end\n// of the underlying connection\nfunc (s *Session) RemoteAddr() net.Addr {\n\taddr, ok := s.conn.(hasAddr)\n\tif !ok {\n\t\treturn &yamuxAddr{\"remote\"}\n\t}\n\treturn addr.RemoteAddr()\n}\n\n// LocalAddr returns the local address\nfunc (s *Stream) LocalAddr() net.Addr {\n\treturn s.session.LocalAddr()\n}\n\n// LocalAddr returns the remote address\nfunc (s *Stream) RemoteAddr() net.Addr {\n\treturn s.session.RemoteAddr()\n}\n"} +{"text": "\n\n\n \n\n \n\n \n\n \n \n\n \n\n controller.showQuestion(question)}\"\n android:onTouch=\"@{(v,event)->controller.onTouch(v,event)}\"\n android:orientation=\"horizontal\">\n\n \n\n \n\n \n\n \n \n\n"} +{"text": "class good \n{\n public:\n good(){}\n}; //class good\n\nclass bad\n{\n public:\n ~bad(){}\n}; //class bad\n"} +{"text": "/*\n * Zed Attack Proxy (ZAP) and its related class files.\n *\n * ZAP is an HTTP/HTTPS proxy for assessing web application security.\n *\n * Copyright 2012 The ZAP Development Team\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.zaproxy.zap.extension.httppanel.component.split.response;\n\nimport java.util.List;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport org.zaproxy.zap.extension.httppanel.view.impl.models.http.response.ResponseHeaderStringHttpPanelViewModel;\nimport org.zaproxy.zap.extension.httppanel.view.text.HttpPanelTextArea;\nimport org.zaproxy.zap.extension.httppanel.view.text.HttpPanelTextView;\nimport org.zaproxy.zap.extension.httppanel.view.util.HttpTextViewUtils;\nimport org.zaproxy.zap.extension.search.SearchMatch;\n\npublic class HttpResponseHeaderPanelTextView extends HttpPanelTextView {\n\n public HttpResponseHeaderPanelTextView(ResponseHeaderStringHttpPanelViewModel model) {\n super(model);\n }\n\n @Override\n protected HttpPanelTextArea createHttpPanelTextArea() {\n return new HttpResponseHeaderPanelTextArea();\n }\n\n private static class HttpResponseHeaderPanelTextArea extends HttpPanelTextArea {\n\n private static final long serialVersionUID = -787753390999658000L;\n\n @Override\n public void search(Pattern p, List matches) {\n Matcher m = p.matcher(getText());\n while (m.find()) {\n\n int[] position =\n HttpTextViewUtils.getViewToHeaderPosition(this, m.start(), m.end());\n if (position.length == 0) {\n return;\n }\n\n matches.add(\n new SearchMatch(\n SearchMatch.Location.RESPONSE_HEAD, position[0], position[1]));\n }\n }\n\n @Override\n public void highlight(SearchMatch sm) {\n if (!SearchMatch.Location.RESPONSE_HEAD.equals(sm.getLocation())) {\n return;\n }\n\n int[] pos =\n HttpTextViewUtils.getHeaderToViewPosition(\n this,\n sm.getMessage().getResponseHeader().toString(),\n sm.getStart(),\n sm.getEnd());\n if (pos.length == 0) {\n return;\n }\n highlight(pos[0], pos[1]);\n }\n }\n}\n"} +{"text": "package utils.array\n{\n\t/**\n\t Adds all items in inArray and returns the value.\n\n\t @param inArray: Array composed only of numbers.\n\t @return The total of all numbers in inArray added.\n\t @example\n\t \n\t var numberArray:Array = new Array(2, 3);\n\t trace(\"Total is: \" + ArrayUtil.sum(numberArray));\n\t \n\t */\n\tpublic function sum(inArray:Array):Number\n\t{\n\t\tvar t:Number = 0;\n\t\tvar l:uint = inArray.length;\n\n\t\twhile (l--)\n\t\t\tt += inArray[l];\n\n\t\treturn t;\n\t}\n}"} +{"text": "alter table ACT_RE_PROCDEF add column ENGINE_VERSION_ varchar(255);\nupdate ACT_RE_PROCDEF set ENGINE_VERSION_ = 'v5';\n\nalter table ACT_RE_DEPLOYMENT add column ENGINE_VERSION_ varchar(255);\nupdate ACT_RE_DEPLOYMENT set ENGINE_VERSION_ = 'v5';\n\nalter table ACT_RU_EXECUTION add column ROOT_PROC_INST_ID_ varchar(64);\ncreate index ACT_IDX_EXEC_ROOT on ACT_RU_EXECUTION(ROOT_PROC_INST_ID_);\n\nalter table ACT_RU_EXECUTION drop foreign key ACT_FK_EXE_PARENT;\nalter table ACT_RU_EXECUTION add constraint ACT_FK_EXE_PARENT foreign key (PARENT_ID_) references ACT_RU_EXECUTION (ID_) on delete cascade; \n\nalter table ACT_RU_EXECUTION drop foreign key ACT_FK_EXE_SUPER;\nalter table ACT_RU_EXECUTION add constraint ACT_FK_EXE_SUPER foreign key (SUPER_EXEC_) references ACT_RU_EXECUTION (ID_) on delete cascade;\n\nupdate ACT_GE_PROPERTY set VALUE_ = '6.0.0.0' where NAME_ = 'schema.version';\n"} +{"text": "#!/usr/bin/python\nfrom __future__ import print_function\n\nfrom irods.test.test_resource_tree import make_resource_tree\n\nif len(sys.argv) != 3:\n print('Usage: make_resource_tree.py ')\n sys.exit(1)\n\nsys.exit(make_resource_tree(int(sys.argv[1]), int(sys.argv[2])))\n"} +{"text": "# /* **************************************************************************\n# * *\n# * (C) Copyright Paul Mensonides 2002.\n# * Distributed under the Boost Software License, Version 1.0. (See\n# * accompanying file LICENSE_1_0.txt or copy at\n# * http://www.boost.org/LICENSE_1_0.txt)\n# * *\n# ************************************************************************** */\n#\n# /* See http://www.boost.org for most recent version. */\n#\n# ifndef MSGPACK_PREPROCESSOR_REPEAT_FROM_TO_3RD_HPP\n# define MSGPACK_PREPROCESSOR_REPEAT_FROM_TO_3RD_HPP\n#\n# include \n#\n# endif\n"} +{"text": "///////////////////////////////////////////////////////////////////////////////\n/// \\file literal.hpp\n/// The literal\\<\\> terminal wrapper, and the proto::lit() function for\n/// creating literal\\<\\> wrappers.\n//\n// Copyright 2008 Eric Niebler. Distributed under the Boost\n// Software License, Version 1.0. (See accompanying file\n// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n\n#ifndef BOOST_PROTO_LITERAL_HPP_EAN_01_03_2007\n#define BOOST_PROTO_LITERAL_HPP_EAN_01_03_2007\n\n#include \n#include \n#include \n#include \n#include \n\nnamespace boost { namespace proto\n{\n namespace utility\n {\n /// \\brief A simple wrapper for a terminal, provided for\n /// ease of use.\n ///\n /// A simple wrapper for a terminal, provided for\n /// ease of use. In all cases, literal\\ l(x);\n /// is equivalent to terminal\\::type l = {x};.\n ///\n /// The \\c Domain template parameter defaults to\n /// \\c proto::default_domain.\n template<\n typename T\n , typename Domain // = default_domain\n >\n struct literal\n : extends, 0>, literal, Domain>\n {\n private:\n typedef basic_expr, 0> terminal_type;\n typedef extends, Domain> base_type;\n typedef literal literal_t;\n\n public:\n typedef typename detail::term_traits::value_type value_type;\n typedef typename detail::term_traits::reference reference;\n typedef typename detail::term_traits::const_reference const_reference;\n\n literal()\n : base_type(terminal_type::make(T()))\n {}\n\n template\n literal(U &u)\n : base_type(terminal_type::make(u))\n {}\n\n template\n literal(U const &u)\n : base_type(terminal_type::make(u))\n {}\n\n template\n literal(literal const &u)\n : base_type(terminal_type::make(u.get()))\n {}\n\n BOOST_PROTO_EXTENDS_USING_ASSIGN(literal_t)\n\n reference get()\n {\n return proto::value(*this);\n }\n\n const_reference get() const\n {\n return proto::value(*this);\n }\n };\n }\n\n /// \\brief A helper function for creating a \\c literal\\<\\> wrapper.\n /// \\param t The object to wrap.\n /// \\return literal\\(t)\n /// \\attention The returned value holds the argument by reference.\n /// \\throw nothrow\n template\n inline literal const lit(T &t)\n {\n return literal(t);\n }\n\n /// \\overload\n ///\n template\n inline literal const lit(T const &t)\n {\n #ifdef BOOST_MSVC\n #pragma warning(push)\n #pragma warning(disable: 4180) // warning C4180: qualifier applied to function type has no meaning; ignored\n #endif\n\n return literal(t);\n\n #ifdef BOOST_MSVC\n #pragma warning(pop)\n #endif\n }\n\n}}\n\n#endif\n"} +{"text": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// -- int32Slice Value\ntype int32SliceValue struct {\n\tvalue *[]int32\n\tchanged bool\n}\n\nfunc newInt32SliceValue(val []int32, p *[]int32) *int32SliceValue {\n\tisv := new(int32SliceValue)\n\tisv.value = p\n\t*isv.value = val\n\treturn isv\n}\n\nfunc (s *int32SliceValue) Set(val string) error {\n\tss := strings.Split(val, \",\")\n\tout := make([]int32, len(ss))\n\tfor i, d := range ss {\n\t\tvar err error\n\t\tvar temp64 int64\n\t\ttemp64, err = strconv.ParseInt(d, 0, 32)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tout[i] = int32(temp64)\n\n\t}\n\tif !s.changed {\n\t\t*s.value = out\n\t} else {\n\t\t*s.value = append(*s.value, out...)\n\t}\n\ts.changed = true\n\treturn nil\n}\n\nfunc (s *int32SliceValue) Type() string {\n\treturn \"int32Slice\"\n}\n\nfunc (s *int32SliceValue) String() string {\n\tout := make([]string, len(*s.value))\n\tfor i, d := range *s.value {\n\t\tout[i] = fmt.Sprintf(\"%d\", d)\n\t}\n\treturn \"[\" + strings.Join(out, \",\") + \"]\"\n}\n\nfunc (s *int32SliceValue) fromString(val string) (int32, error) {\n\tt64, err := strconv.ParseInt(val, 0, 32)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn int32(t64), nil\n}\n\nfunc (s *int32SliceValue) toString(val int32) string {\n\treturn fmt.Sprintf(\"%d\", val)\n}\n\nfunc (s *int32SliceValue) Append(val string) error {\n\ti, err := s.fromString(val)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*s.value = append(*s.value, i)\n\treturn nil\n}\n\nfunc (s *int32SliceValue) Replace(val []string) error {\n\tout := make([]int32, len(val))\n\tfor i, d := range val {\n\t\tvar err error\n\t\tout[i], err = s.fromString(d)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t*s.value = out\n\treturn nil\n}\n\nfunc (s *int32SliceValue) GetSlice() []string {\n\tout := make([]string, len(*s.value))\n\tfor i, d := range *s.value {\n\t\tout[i] = s.toString(d)\n\t}\n\treturn out\n}\n\nfunc int32SliceConv(val string) (interface{}, error) {\n\tval = strings.Trim(val, \"[]\")\n\t// Empty string would cause a slice with one (empty) entry\n\tif len(val) == 0 {\n\t\treturn []int32{}, nil\n\t}\n\tss := strings.Split(val, \",\")\n\tout := make([]int32, len(ss))\n\tfor i, d := range ss {\n\t\tvar err error\n\t\tvar temp64 int64\n\t\ttemp64, err = strconv.ParseInt(d, 0, 32)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tout[i] = int32(temp64)\n\n\t}\n\treturn out, nil\n}\n\n// GetInt32Slice return the []int32 value of a flag with the given name\nfunc (f *FlagSet) GetInt32Slice(name string) ([]int32, error) {\n\tval, err := f.getFlagType(name, \"int32Slice\", int32SliceConv)\n\tif err != nil {\n\t\treturn []int32{}, err\n\t}\n\treturn val.([]int32), nil\n}\n\n// Int32SliceVar defines a int32Slice flag with specified name, default value, and usage string.\n// The argument p points to a []int32 variable in which to store the value of the flag.\nfunc (f *FlagSet) Int32SliceVar(p *[]int32, name string, value []int32, usage string) {\n\tf.VarP(newInt32SliceValue(value, p), name, \"\", usage)\n}\n\n// Int32SliceVarP is like Int32SliceVar, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Int32SliceVarP(p *[]int32, name, shorthand string, value []int32, usage string) {\n\tf.VarP(newInt32SliceValue(value, p), name, shorthand, usage)\n}\n\n// Int32SliceVar defines a int32[] flag with specified name, default value, and usage string.\n// The argument p points to a int32[] variable in which to store the value of the flag.\nfunc Int32SliceVar(p *[]int32, name string, value []int32, usage string) {\n\tCommandLine.VarP(newInt32SliceValue(value, p), name, \"\", usage)\n}\n\n// Int32SliceVarP is like Int32SliceVar, but accepts a shorthand letter that can be used after a single dash.\nfunc Int32SliceVarP(p *[]int32, name, shorthand string, value []int32, usage string) {\n\tCommandLine.VarP(newInt32SliceValue(value, p), name, shorthand, usage)\n}\n\n// Int32Slice defines a []int32 flag with specified name, default value, and usage string.\n// The return value is the address of a []int32 variable that stores the value of the flag.\nfunc (f *FlagSet) Int32Slice(name string, value []int32, usage string) *[]int32 {\n\tp := []int32{}\n\tf.Int32SliceVarP(&p, name, \"\", value, usage)\n\treturn &p\n}\n\n// Int32SliceP is like Int32Slice, but accepts a shorthand letter that can be used after a single dash.\nfunc (f *FlagSet) Int32SliceP(name, shorthand string, value []int32, usage string) *[]int32 {\n\tp := []int32{}\n\tf.Int32SliceVarP(&p, name, shorthand, value, usage)\n\treturn &p\n}\n\n// Int32Slice defines a []int32 flag with specified name, default value, and usage string.\n// The return value is the address of a []int32 variable that stores the value of the flag.\nfunc Int32Slice(name string, value []int32, usage string) *[]int32 {\n\treturn CommandLine.Int32SliceP(name, \"\", value, usage)\n}\n\n// Int32SliceP is like Int32Slice, but accepts a shorthand letter that can be used after a single dash.\nfunc Int32SliceP(name, shorthand string, value []int32, usage string) *[]int32 {\n\treturn CommandLine.Int32SliceP(name, shorthand, value, usage)\n}\n"} +{"text": "/*\n * Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com\n * Written by Alex Tomas \n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License version 2 as\n * published by the Free Software Foundation.\n *\n * This program is distributed in the hope that it will be useful,\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-\n */\n\n#ifndef _EXT4_EXTENTS\n#define _EXT4_EXTENTS\n\n#include \"ext4.h\"\n\n/*\n * With AGGRESSIVE_TEST defined, the capacity of index/leaf blocks\n * becomes very small, so index split, in-depth growing and\n * other hard changes happen much more often.\n * This is for debug purposes only.\n */\n#define AGGRESSIVE_TEST_\n\n/*\n * With EXTENTS_STATS defined, the number of blocks and extents\n * are collected in the truncate path. They'll be shown at\n * umount time.\n */\n#define EXTENTS_STATS__\n\n/*\n * If CHECK_BINSEARCH is defined, then the results of the binary search\n * will also be checked by linear search.\n */\n#define CHECK_BINSEARCH__\n\n/*\n * If EXT_STATS is defined then stats numbers are collected.\n * These number will be displayed at umount time.\n */\n#define EXT_STATS_\n\n\n/*\n * ext4_inode has i_block array (60 bytes total).\n * The first 12 bytes store ext4_extent_header;\n * the remainder stores an array of ext4_extent.\n * For non-inode extent blocks, ext4_extent_tail\n * follows the array.\n */\n\n/*\n * This is the extent tail on-disk structure.\n * All other extent structures are 12 bytes long. It turns out that\n * block_size % 12 >= 4 for at least all powers of 2 greater than 512, which\n * covers all valid ext4 block sizes. Therefore, this tail structure can be\n * crammed into the end of the block without having to rebalance the tree.\n */\nstruct ext4_extent_tail {\n\t__le32\tet_checksum;\t/* crc32c(uuid+inum+extent_block) */\n};\n\n/*\n * This is the extent on-disk structure.\n * It's used at the bottom of the tree.\n */\nstruct ext4_extent {\n\t__le32\tee_block;\t/* first logical block extent covers */\n\t__le16\tee_len;\t\t/* number of blocks covered by extent */\n\t__le16\tee_start_hi;\t/* high 16 bits of physical block */\n\t__le32\tee_start_lo;\t/* low 32 bits of physical block */\n};\n\n/*\n * This is index on-disk structure.\n * It's used at all the levels except the bottom.\n */\nstruct ext4_extent_idx {\n\t__le32\tei_block;\t/* index covers logical blocks from 'block' */\n\t__le32\tei_leaf_lo;\t/* pointer to the physical block of the next *\n\t\t\t\t * level. leaf or next index could be there */\n\t__le16\tei_leaf_hi;\t/* high 16 bits of physical block */\n\t__u16\tei_unused;\n};\n\n/*\n * Each block (leaves and indexes), even inode-stored has header.\n */\nstruct ext4_extent_header {\n\t__le16\teh_magic;\t/* probably will support different formats */\n\t__le16\teh_entries;\t/* number of valid entries */\n\t__le16\teh_max;\t\t/* capacity of store in entries */\n\t__le16\teh_depth;\t/* has tree real underlying blocks? */\n\t__le32\teh_generation;\t/* generation of the tree */\n};\n\n#define EXT4_EXT_MAGIC\t\tcpu_to_le16(0xf30a)\n#define EXT4_MAX_EXTENT_DEPTH 5\n\n#define EXT4_EXTENT_TAIL_OFFSET(hdr) \\\n\t(sizeof(struct ext4_extent_header) + \\\n\t (sizeof(struct ext4_extent) * le16_to_cpu((hdr)->eh_max)))\n\nstatic inline struct ext4_extent_tail *\nfind_ext4_extent_tail(struct ext4_extent_header *eh)\n{\n\treturn (struct ext4_extent_tail *)(((void *)eh) +\n\t\t\t\t\t EXT4_EXTENT_TAIL_OFFSET(eh));\n}\n\n/*\n * Array of ext4_ext_path contains path to some extent.\n * Creation/lookup routines use it for traversal/splitting/etc.\n * Truncate uses it to simulate recursive walking.\n */\nstruct ext4_ext_path {\n\text4_fsblk_t\t\t\tp_block;\n\t__u16\t\t\t\tp_depth;\n\t__u16\t\t\t\tp_maxdepth;\n\tstruct ext4_extent\t\t*p_ext;\n\tstruct ext4_extent_idx\t\t*p_idx;\n\tstruct ext4_extent_header\t*p_hdr;\n\tstruct buffer_head\t\t*p_bh;\n};\n\n/*\n * structure for external API\n */\n\n/*\n * EXT_INIT_MAX_LEN is the maximum number of blocks we can have in an\n * initialized extent. This is 2^15 and not (2^16 - 1), since we use the\n * MSB of ee_len field in the extent datastructure to signify if this\n * particular extent is an initialized extent or an unwritten (i.e.\n * preallocated).\n * EXT_UNWRITTEN_MAX_LEN is the maximum number of blocks we can have in an\n * unwritten extent.\n * If ee_len is <= 0x8000, it is an initialized extent. Otherwise, it is an\n * unwritten one. In other words, if MSB of ee_len is set, it is an\n * unwritten extent with only one special scenario when ee_len = 0x8000.\n * In this case we can not have an unwritten extent of zero length and\n * thus we make it as a special case of initialized extent with 0x8000 length.\n * This way we get better extent-to-group alignment for initialized extents.\n * Hence, the maximum number of blocks we can have in an *initialized*\n * extent is 2^15 (32768) and in an *unwritten* extent is 2^15-1 (32767).\n */\n#define EXT_INIT_MAX_LEN\t(1UL << 15)\n#define EXT_UNWRITTEN_MAX_LEN\t(EXT_INIT_MAX_LEN - 1)\n\n\n#define EXT_FIRST_EXTENT(__hdr__) \\\n\t((struct ext4_extent *) (((char *) (__hdr__)) +\t\t\\\n\t\t\t\t sizeof(struct ext4_extent_header)))\n#define EXT_FIRST_INDEX(__hdr__) \\\n\t((struct ext4_extent_idx *) (((char *) (__hdr__)) +\t\\\n\t\t\t\t sizeof(struct ext4_extent_header)))\n#define EXT_HAS_FREE_INDEX(__path__) \\\n\t(le16_to_cpu((__path__)->p_hdr->eh_entries) \\\n\t\t\t\t < le16_to_cpu((__path__)->p_hdr->eh_max))\n#define EXT_LAST_EXTENT(__hdr__) \\\n\t(EXT_FIRST_EXTENT((__hdr__)) + le16_to_cpu((__hdr__)->eh_entries) - 1)\n#define EXT_LAST_INDEX(__hdr__) \\\n\t(EXT_FIRST_INDEX((__hdr__)) + le16_to_cpu((__hdr__)->eh_entries) - 1)\n#define EXT_MAX_EXTENT(__hdr__)\t\\\n\t((le16_to_cpu((__hdr__)->eh_max)) ? \\\n\t((EXT_FIRST_EXTENT((__hdr__)) + le16_to_cpu((__hdr__)->eh_max) - 1)) \\\n\t\t\t\t\t: 0)\n#define EXT_MAX_INDEX(__hdr__) \\\n\t((le16_to_cpu((__hdr__)->eh_max)) ? \\\n\t((EXT_FIRST_INDEX((__hdr__)) + le16_to_cpu((__hdr__)->eh_max) - 1)) : 0)\n\nstatic inline struct ext4_extent_header *ext_inode_hdr(struct inode *inode)\n{\n\treturn (struct ext4_extent_header *) EXT4_I(inode)->i_data;\n}\n\nstatic inline struct ext4_extent_header *ext_block_hdr(struct buffer_head *bh)\n{\n\treturn (struct ext4_extent_header *) bh->b_data;\n}\n\nstatic inline unsigned short ext_depth(struct inode *inode)\n{\n\treturn le16_to_cpu(ext_inode_hdr(inode)->eh_depth);\n}\n\nstatic inline void ext4_ext_mark_unwritten(struct ext4_extent *ext)\n{\n\t/* We can not have an unwritten extent of zero length! */\n\tBUG_ON((le16_to_cpu(ext->ee_len) & ~EXT_INIT_MAX_LEN) == 0);\n\text->ee_len |= cpu_to_le16(EXT_INIT_MAX_LEN);\n}\n\nstatic inline int ext4_ext_is_unwritten(struct ext4_extent *ext)\n{\n\t/* Extent with ee_len of 0x8000 is treated as an initialized extent */\n\treturn (le16_to_cpu(ext->ee_len) > EXT_INIT_MAX_LEN);\n}\n\nstatic inline int ext4_ext_get_actual_len(struct ext4_extent *ext)\n{\n\treturn (le16_to_cpu(ext->ee_len) <= EXT_INIT_MAX_LEN ?\n\t\tle16_to_cpu(ext->ee_len) :\n\t\t(le16_to_cpu(ext->ee_len) - EXT_INIT_MAX_LEN));\n}\n\nstatic inline void ext4_ext_mark_initialized(struct ext4_extent *ext)\n{\n\text->ee_len = cpu_to_le16(ext4_ext_get_actual_len(ext));\n}\n\n/*\n * ext4_ext_pblock:\n * combine low and high parts of physical block number into ext4_fsblk_t\n */\nstatic inline ext4_fsblk_t ext4_ext_pblock(struct ext4_extent *ex)\n{\n\text4_fsblk_t block;\n\n\tblock = le32_to_cpu(ex->ee_start_lo);\n\tblock |= ((ext4_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1;\n\treturn block;\n}\n\n/*\n * ext4_idx_pblock:\n * combine low and high parts of a leaf physical block number into ext4_fsblk_t\n */\nstatic inline ext4_fsblk_t ext4_idx_pblock(struct ext4_extent_idx *ix)\n{\n\text4_fsblk_t block;\n\n\tblock = le32_to_cpu(ix->ei_leaf_lo);\n\tblock |= ((ext4_fsblk_t) le16_to_cpu(ix->ei_leaf_hi) << 31) << 1;\n\treturn block;\n}\n\n/*\n * ext4_ext_store_pblock:\n * stores a large physical block number into an extent struct,\n * breaking it into parts\n */\nstatic inline void ext4_ext_store_pblock(struct ext4_extent *ex,\n\t\t\t\t\t ext4_fsblk_t pb)\n{\n\tex->ee_start_lo = cpu_to_le32((unsigned long) (pb & 0xffffffff));\n\tex->ee_start_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) &\n\t\t\t\t 0xffff);\n}\n\n/*\n * ext4_idx_store_pblock:\n * stores a large physical block number into an index struct,\n * breaking it into parts\n */\nstatic inline void ext4_idx_store_pblock(struct ext4_extent_idx *ix,\n\t\t\t\t\t ext4_fsblk_t pb)\n{\n\tix->ei_leaf_lo = cpu_to_le32((unsigned long) (pb & 0xffffffff));\n\tix->ei_leaf_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) &\n\t\t\t\t 0xffff);\n}\n\n#define ext4_ext_dirty(handle, inode, path) \\\n\t\t__ext4_ext_dirty(__func__, __LINE__, (handle), (inode), (path))\nint __ext4_ext_dirty(const char *where, unsigned int line, handle_t *handle,\n\t\t struct inode *inode, struct ext4_ext_path *path);\n\n#endif /* _EXT4_EXTENTS */\n\n"} +{"text": "_cache = new Swift_KeyCache_ArrayKeyCache(\n new Swift_KeyCache_SimpleKeyCacheInputStream()\n );\n $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory();\n $this->_contentEncoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder();\n\n $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder(\n new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8')\n );\n $paramEncoder = new Swift_Encoder_Rfc2231Encoder(\n new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8')\n );\n $this->_grammar = new Swift_Mime_Grammar();\n $this->_headers = new Swift_Mime_SimpleHeaderSet(\n new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $this->_grammar)\n );\n }\n\n public function testContentIdIsSetInHeader()\n {\n $file = $this->_createEmbeddedFile();\n $file->setContentType('application/pdf');\n $file->setId('foo@bar');\n $this->assertEquals(\n 'Content-Type: application/pdf'.\"\\r\\n\".\n 'Content-Transfer-Encoding: base64'.\"\\r\\n\".\n 'Content-ID: '.\"\\r\\n\".\n 'Content-Disposition: inline'.\"\\r\\n\",\n $file->toString()\n );\n }\n\n public function testDispositionIsSetInHeader()\n {\n $file = $this->_createEmbeddedFile();\n $id = $file->getId();\n $file->setContentType('application/pdf');\n $file->setDisposition('attachment');\n $this->assertEquals(\n 'Content-Type: application/pdf'.\"\\r\\n\".\n 'Content-Transfer-Encoding: base64'.\"\\r\\n\".\n 'Content-ID: <'.$id.'>'.\"\\r\\n\".\n 'Content-Disposition: attachment'.\"\\r\\n\",\n $file->toString()\n );\n }\n\n public function testFilenameIsSetInHeader()\n {\n $file = $this->_createEmbeddedFile();\n $id = $file->getId();\n $file->setContentType('application/pdf');\n $file->setFilename('foo.pdf');\n $this->assertEquals(\n 'Content-Type: application/pdf; name=foo.pdf'.\"\\r\\n\".\n 'Content-Transfer-Encoding: base64'.\"\\r\\n\".\n 'Content-ID: <'.$id.'>'.\"\\r\\n\".\n 'Content-Disposition: inline; filename=foo.pdf'.\"\\r\\n\",\n $file->toString()\n );\n }\n\n public function testSizeIsSetInHeader()\n {\n $file = $this->_createEmbeddedFile();\n $id = $file->getId();\n $file->setContentType('application/pdf');\n $file->setSize(12340);\n $this->assertEquals(\n 'Content-Type: application/pdf'.\"\\r\\n\".\n 'Content-Transfer-Encoding: base64'.\"\\r\\n\".\n 'Content-ID: <'.$id.'>'.\"\\r\\n\".\n 'Content-Disposition: inline; size=12340'.\"\\r\\n\",\n $file->toString()\n );\n }\n\n public function testMultipleParametersInHeader()\n {\n $file = $this->_createEmbeddedFile();\n $id = $file->getId();\n $file->setContentType('application/pdf');\n $file->setFilename('foo.pdf');\n $file->setSize(12340);\n\n $this->assertEquals(\n 'Content-Type: application/pdf; name=foo.pdf'.\"\\r\\n\".\n 'Content-Transfer-Encoding: base64'.\"\\r\\n\".\n 'Content-ID: <'.$id.'>'.\"\\r\\n\".\n 'Content-Disposition: inline; filename=foo.pdf; size=12340'.\"\\r\\n\",\n $file->toString()\n );\n }\n\n public function testEndToEnd()\n {\n $file = $this->_createEmbeddedFile();\n $id = $file->getId();\n $file->setContentType('application/pdf');\n $file->setFilename('foo.pdf');\n $file->setSize(12340);\n $file->setBody('abcd');\n $this->assertEquals(\n 'Content-Type: application/pdf; name=foo.pdf'.\"\\r\\n\".\n 'Content-Transfer-Encoding: base64'.\"\\r\\n\".\n 'Content-ID: <'.$id.'>'.\"\\r\\n\".\n 'Content-Disposition: inline; filename=foo.pdf; size=12340'.\"\\r\\n\".\n \"\\r\\n\".\n base64_encode('abcd'),\n $file->toString()\n );\n }\n\n protected function _createEmbeddedFile()\n {\n $entity = new Swift_Mime_EmbeddedFile(\n $this->_headers,\n $this->_contentEncoder,\n $this->_cache,\n $this->_grammar\n );\n\n return $entity;\n }\n}\n"} +{"text": "Aalsburg\nAalst\nAarle\nAchteren\nAchthoven\nAdrichem\nAggelen\nAgteren\nAgthoven\nAkkeren\nAller\nAlphen\nAlst\nAltena\nAlthuis\nAmelsvoort\nAmersvoort\nAmstel\nAndel\nAndringa\nAnkeren\nAntwerp\nAntwerpen\nApeldoorn\nArendonk\nAsch\nAssen\nBaarle\nBokhoven\nBreda\nBueren\nBuggenum\nBuiren\nBuren\nCan\nCann\nCanne\nDaal\nDaalen\nDael\nDaele\nDale\nDalen\nLaar\nVliert\nAkker\nAndel\nDenend\nAart\nBeek\nBerg\nHout\nLaar\nSee\nStoep\nVeen\nVen\nVenn\nVenne\nVennen\nZee\nDonk\nHaanraads\nHaanraats\nHaanrade\nHaanrath\nHaenraats\nHaenraets\nHanraets\nHassel\nHautem\nHautum\nHeel\nHerten\nHofwegen\nHorn\nHout\nHoute\nHoutem\nHouten\nHouttum\nHoutum\nKan\nKann\nKanne\nKappel\nKarl\nKikkert\nKlein\nKlerk\nKlerken\nKlerks\nKlerkse\nKlerkx\nKlerx\nKloet\nKloeten\nKloeter\nKoeman\nKoemans\nKolen\nKolijn\nKollen\nKoning\nKool\nKoole\nKoolen\nKools\nKouman\nKoumans\nKrantz\nKranz\nKrusen\nKuijpers\nKuiper\nKuipers\nLaar\nLangbroek\nLaren\nLauwens\nLauwers\nLeeuwenhoeck\nLeeuwenhoek\nLeeuwenhoek\nLucas\nLucassen\nLyon\nMaas\nMaes\nMaessen\nMarquering\nMarqueringh\nMarquerink\nMas\nMeeuwe\nMeeuwes\nMeeuwessen\nMeeuweszen\nMeeuwis\nMeeuwissen\nMeeuwsen\nMeisner\nMerckx\nMertens\nMichel\nMiddelburg\nMiddlesworth\nMohren\nMooren\nMulder\nMuyskens\nNagel\nNelissen\nNifterick\nNifterick\nNifterik\nNifterik\nNiftrik\nNiftrik\nOffermans\nOgterop\nOgtrop\nOirschot\nOirschotten\nOomen\nOorschot\nOorschot\nOphoven\nOtten\nPander\nPanders\nPaulis\nPaulissen\nPeerenboom\nPeeters\nPeij\nPender\nPenders\nPennders\nPenner\nPenners\nPeter\nPeusen\nPey\nPhilips\nPrinsen\nRademaker\nRademakers\nRamaaker\nRamaker\nRamakers\nRamecker\nRameckers\nRaske\nReijnder\nReijnders\nReinder\nReinders\nReynder\nReynders\nRichard\nRietveld\nRijnder\nRijnders\nRobert\nRoggeveen\nRoijacker\nRoijackers\nRoijakker\nRoijakkers\nRomeijn\nRomeijnders\nRomeijnsen\nRomijn\nRomijnders\nRomijnsen\nRompa\nRompa\nRompaeij\nRompaey\nRompaij\nRompay\nRompaye\nRompu\nRompuy\nRooiakker\nRooiakkers\nRooijakker\nRooijakkers\nRoosa\nRoosevelt\nRossem\nRossum\nRumpade\nRutten\nRyskamp\nSamson\nSanna\nSchenck\nSchermer\nSchneider\nSchneiders\nSchneijder\nSchneijders\nSchoonenburg\nSchoonraad\nSchoorel\nSchoorel\nSchoorl\nSchorel\nSchrijnemakers\nSchuyler\nSchwarzenberg\nSeeger\nSeegers\nSeelen\nSegers\nSegher\nSeghers\nSeverijns\nSeverins\nSevriens\nSilje\nSimon\nSimonis\nSlootmaekers\nSmeets\nSmets\nSmit\nSmits\nSnaaijer\nSnaijer\nSneiders\nSneijder\nSneijders\nSneijer\nSneijers\nSnell\nSnider\nSniders\nSnijder\nSnijders\nSnyder\nSnyders\nSpecht\nSpijker\nSpiker\nTer Avest\nTeunissen\nTheunissen\nTholberg\nTillens\nTunison\nTunneson\nVandale\nVandroogenbroeck\nVann\n"} +{"text": "/*\n * This file is part of the SDWebImage package.\n * (c) Olivier Poitrey \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n#import \"SDWebImageCompat.h\"\n\n#if SD_MAC\n\n/**\n A subclass of `NSBitmapImageRep` to fix that GIF duration issue because `NSBitmapImageRep` will reset `NSImageCurrentFrameDuration` by using `kCGImagePropertyGIFDelayTime` but not `kCGImagePropertyGIFUnclampedDelayTime`.\n This also fix the GIF loop count issue, which will use the Netscape standard (See http://www6.uniovi.es/gifanim/gifabout.htm) to only place once when the `kCGImagePropertyGIFLoopCount` is nil. This is what modern browser's behavior.\n Built in GIF coder use this instead of `NSBitmapImageRep` for better GIF rendering. If you do not want this, only enable `SDImageIOCoder`, which just call `NSImage` API and actually use `NSBitmapImageRep` for GIF image.\n This also support APNG format using `SDImageAPNGCoder`. Which provide full alpha-channel support and the correct duration match the `kCGImagePropertyAPNGUnclampedDelayTime`.\n */\n@interface SDAnimatedImageRep : NSBitmapImageRep\n\n@end\n\n#endif\n"} +{"text": "// Copyright (c) 2011-2014 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include \"main.h\"\n#include \"txmempool.h\"\n#include \"util.h\"\n\n#include \"test/test_bitcoin.h\"\n\n#include \n#include \n\nBOOST_FIXTURE_TEST_SUITE(mempool_tests, TestingSetup)\n\nBOOST_AUTO_TEST_CASE(MempoolRemoveTest)\n{\n // Test CTxMemPool::remove functionality\n\n // Parent transaction with three children,\n // and three grand-children:\n CMutableTransaction txParent;\n txParent.vin.resize(1);\n txParent.vin[0].scriptSig = CScript() << OP_11;\n txParent.vout.resize(3);\n for (int i = 0; i < 3; i++)\n {\n txParent.vout[i].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n txParent.vout[i].nValue = 33000LL;\n }\n CMutableTransaction txChild[3];\n for (int i = 0; i < 3; i++)\n {\n txChild[i].vin.resize(1);\n txChild[i].vin[0].scriptSig = CScript() << OP_11;\n txChild[i].vin[0].prevout.hash = txParent.GetHash();\n txChild[i].vin[0].prevout.n = i;\n txChild[i].vout.resize(1);\n txChild[i].vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n txChild[i].vout[0].nValue = 11000LL;\n }\n CMutableTransaction txGrandChild[3];\n for (int i = 0; i < 3; i++)\n {\n txGrandChild[i].vin.resize(1);\n txGrandChild[i].vin[0].scriptSig = CScript() << OP_11;\n txGrandChild[i].vin[0].prevout.hash = txChild[i].GetHash();\n txGrandChild[i].vin[0].prevout.n = 0;\n txGrandChild[i].vout.resize(1);\n txGrandChild[i].vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n txGrandChild[i].vout[0].nValue = 11000LL;\n }\n\n\n CTxMemPool testPool(CFeeRate(0));\n std::list removed;\n\n // Nothing in pool, remove should do nothing:\n testPool.remove(txParent, removed, true);\n BOOST_CHECK_EQUAL(removed.size(), 0);\n\n // Just the parent:\n testPool.addUnchecked(txParent.GetHash(), CTxMemPoolEntry(txParent, 0, 0, 0.0, 1));\n testPool.remove(txParent, removed, true);\n BOOST_CHECK_EQUAL(removed.size(), 1);\n removed.clear();\n \n // Parent, children, grandchildren:\n testPool.addUnchecked(txParent.GetHash(), CTxMemPoolEntry(txParent, 0, 0, 0.0, 1));\n for (int i = 0; i < 3; i++)\n {\n testPool.addUnchecked(txChild[i].GetHash(), CTxMemPoolEntry(txChild[i], 0, 0, 0.0, 1));\n testPool.addUnchecked(txGrandChild[i].GetHash(), CTxMemPoolEntry(txGrandChild[i], 0, 0, 0.0, 1));\n }\n // Remove Child[0], GrandChild[0] should be removed:\n testPool.remove(txChild[0], removed, true);\n BOOST_CHECK_EQUAL(removed.size(), 2);\n removed.clear();\n // ... make sure grandchild and child are gone:\n testPool.remove(txGrandChild[0], removed, true);\n BOOST_CHECK_EQUAL(removed.size(), 0);\n testPool.remove(txChild[0], removed, true);\n BOOST_CHECK_EQUAL(removed.size(), 0);\n // Remove parent, all children/grandchildren should go:\n testPool.remove(txParent, removed, true);\n BOOST_CHECK_EQUAL(removed.size(), 5);\n BOOST_CHECK_EQUAL(testPool.size(), 0);\n removed.clear();\n\n // Add children and grandchildren, but NOT the parent (simulate the parent being in a block)\n for (int i = 0; i < 3; i++)\n {\n testPool.addUnchecked(txChild[i].GetHash(), CTxMemPoolEntry(txChild[i], 0, 0, 0.0, 1));\n testPool.addUnchecked(txGrandChild[i].GetHash(), CTxMemPoolEntry(txGrandChild[i], 0, 0, 0.0, 1));\n }\n // Now remove the parent, as might happen if a block-re-org occurs but the parent cannot be\n // put into the mempool (maybe because it is non-standard):\n testPool.remove(txParent, removed, true);\n BOOST_CHECK_EQUAL(removed.size(), 6);\n BOOST_CHECK_EQUAL(testPool.size(), 0);\n removed.clear();\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"} +{"text": "/*\n * This program source code file is part of KiCad, a free EDA CAD application.\n *\n * Copyright (C) 2004-2012 Jean-Pierre Charras\n * Copyright (C) 2004-2020 KiCad Developers, see AUTHORS.txt for contributors.\n *\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; either version 2\n * of the License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, you may find one here:\n * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html\n * or you may search the http://www.gnu.org website for the version 2 license,\n * or you may write to the Free Software Foundation, Inc.,\n * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\n */\n\n/**\n * @file class_treeprojectfiles.cpp\n * this is the wxTreeCtrl that shows a KiCad tree project files\n */\n\n\n#include \n\n#include \"treeproject_item.h\"\n#include \"tree_project_frame.h\"\n#include \"treeprojectfiles.h\"\n#include \"kicad_id.h\"\n\n\nIMPLEMENT_ABSTRACT_CLASS( TREEPROJECTFILES, wxTreeCtrl )\n\n\nTREEPROJECTFILES::TREEPROJECTFILES( TREE_PROJECT_FRAME* parent )\n : wxTreeCtrl( parent, ID_PROJECT_TREE, wxDefaultPosition, wxDefaultSize,\n wxTR_HAS_BUTTONS | wxTR_MULTIPLE, wxDefaultValidator, wxT( \"EDATreeCtrl\" ) )\n{\n m_Parent = parent;\n\n // icons size is not know (depending on they are built)\n // so get it:\n wxSize iconsize;\n wxBitmap dummy = KiBitmap( eeschema_xpm );\n iconsize.x = dummy.GetWidth();\n iconsize.y = dummy.GetHeight();\n\n // Make an image list containing small icons\n m_ImageList = new wxImageList( iconsize.x, iconsize.y, true, TREE_MAX );\n\n m_ImageList->Add( KiBitmap( new_project_xpm ) ); // TREE_LEGACY_PROJECT\n m_ImageList->Add( KiBitmap( new_project_xpm ) ); // TREE_JSON_PROJECT\n m_ImageList->Add( KiBitmap( eeschema_xpm ) ); // TREE_LEGACY_SCHEMATIC\n m_ImageList->Add( KiBitmap( eeschema_xpm ) ); // TREE_SEXPR_SCHEMATIC\n m_ImageList->Add( KiBitmap( pcbnew_xpm ) ); // TREE_LEGACY_PCB\n m_ImageList->Add( KiBitmap( pcbnew_xpm ) ); // TREE_SEXPR_PCB\n m_ImageList->Add( KiBitmap( icon_gerbview_small_xpm ) ); // TREE_GERBER\n m_ImageList->Add( KiBitmap( gerber_job_file_xpm ) ); // TREE_GERBER_JOB_FILE (.gbrjob)\n m_ImageList->Add( KiBitmap( html_xpm ) ); // TREE_HTML\n m_ImageList->Add( KiBitmap( datasheet_xpm ) ); // TREE_PDF\n m_ImageList->Add( KiBitmap( editor_xpm ) ); // TREE_TXT\n m_ImageList->Add( KiBitmap( netlist_xpm ) ); // TREE_NET\n m_ImageList->Add( KiBitmap( unknown_xpm ) ); // TREE_UNKNOWN\n m_ImageList->Add( KiBitmap( directory_xpm ) ); // TREE_DIRECTORY\n m_ImageList->Add( KiBitmap( icon_cvpcb_small_xpm ) ); // TREE_CMP_LINK\n m_ImageList->Add( KiBitmap( tools_xpm ) ); // TREE_REPORT\n m_ImageList->Add( KiBitmap( post_compo_xpm ) ); // TREE_POS\n m_ImageList->Add( KiBitmap( post_drill_xpm ) ); // TREE_DRILL\n m_ImageList->Add( KiBitmap( post_drill_xpm ) ); // TREE_DRILL_NC (similar TREE_DRILL)\n m_ImageList->Add( KiBitmap( post_drill_xpm ) ); // TREE_DRILL_XNC (similar TREE_DRILL)\n m_ImageList->Add( KiBitmap( svg_file_xpm ) ); // TREE_SVG\n m_ImageList->Add( KiBitmap( pagelayout_load_xpm ) ); // TREE_PAGE_LAYOUT_DESCR\n m_ImageList->Add( KiBitmap( module_xpm ) ); // TREE_FOOTPRINT_FILE\n m_ImageList->Add( KiBitmap( library_xpm ) ); // TREE_SCHEMATIC_LIBFILE\n m_ImageList->Add( KiBitmap( library_xpm ) ); // TREE_SEXPR_SYMBOL_LIB_FILE\n\n SetImageList( m_ImageList );\n}\n\n\nTREEPROJECTFILES::~TREEPROJECTFILES()\n{\n delete m_ImageList;\n}\n\n\nint TREEPROJECTFILES::OnCompareItems( const wxTreeItemId& item1, const wxTreeItemId& item2 )\n{\n TREEPROJECT_ITEM* myitem1 = (TREEPROJECT_ITEM*) GetItemData( item1 );\n TREEPROJECT_ITEM* myitem2 = (TREEPROJECT_ITEM*) GetItemData( item2 );\n\n if( !myitem1 || !myitem2 )\n return 0;\n\n if( myitem1->GetType() == TREE_DIRECTORY && myitem2->GetType() != TREE_DIRECTORY )\n return -1;\n\n if( myitem2->GetType() == TREE_DIRECTORY && myitem1->GetType() != TREE_DIRECTORY )\n return 1;\n\n if( myitem1->IsRootFile() && !myitem2->IsRootFile() )\n return -1;\n\n if( myitem2->IsRootFile() && !myitem1->IsRootFile() )\n return 1;\n\n return myitem1->GetFileName().CmpNoCase( myitem2->GetFileName() );\n}\n"} +{"text": "from mailpile.commands import Command\nfrom mailpile.i18n import gettext as _\nfrom mailpile.i18n import ngettext as _n\nfrom mailpile.plugins import PluginManager\nfrom mailpile.plugins.tags import AddTag, DeleteTag, Filter\nfrom mailpile.plugins.contacts import *\n\n\n_plugins = PluginManager(builtin=__file__)\n\n\n##[ Search terms ]############################################################\n\ndef search(config, idx, term, hits):\n group = config._vcards.get(term.split(':', 1)[1])\n rt, emails = [], []\n if group and group.kind == 'group':\n for email, attrs in group.get('EMAIL', []):\n group = config._vcards.get(email.lower(), None)\n if group:\n emails.extend([e[0].lower() for e in group.get('EMAIL', [])])\n else:\n emails.append(email.lower())\n fromto = term.startswith('group:') and 'from' or 'to'\n for email in set(emails):\n rt.extend(hits('%s:%s' % (email, fromto)))\n return rt\n\n_plugins.register_search_term('group', search)\n_plugins.register_search_term('togroup', search)\n\n\n##[ Commands ]################################################################\n\ndef GroupVCard(parent):\n \"\"\"A factory for generating group commands\"\"\"\n\n class GroupVCardCommand(parent):\n SYNOPSIS = tuple([(t and t.replace('vcard', 'group') or t)\n for t in parent.SYNOPSIS])\n KIND = 'group'\n ORDER = ('Tagging', 4)\n\n def _valid_vcard_handle(self, vc_handle):\n # If there is already a tag by this name, complain.\n return (vc_handle and\n ('-' != vc_handle[0]) and\n ('@' not in vc_handle) and\n (not self.session.config.get_tag_id(vc_handle)))\n\n def _prepare_new_vcard(self, vcard):\n session, handle = self.session, vcard.nickname\n return (AddTag(session, arg=[handle]).run() and\n Filter(session, arg=['add', 'group:%s' % handle,\n '+%s' % handle, vcard.fn]).run())\n\n def _add_from_messages(self):\n raise ValueError('Invalid group ids: %s' % self.args)\n\n def _pre_delete_vcard(self, vcard):\n session, handle = self.session, vcard.nickname\n return (Filter(session, arg=['delete',\n 'group:%s' % handle]).run() and\n DeleteTag(session, arg=[handle]).run())\n\n return GroupVCardCommand\n\n\nclass Group(GroupVCard(VCard)):\n \"\"\"View groups\"\"\"\n\n\nclass AddGroup(GroupVCard(AddVCard)):\n \"\"\"Add groups\"\"\"\n\n\nclass GroupAddLines(GroupVCard(VCardAddLines)):\n \"\"\"Add lines to a group VCard\"\"\"\n\n\nclass RemoveGroup(GroupVCard(RemoveVCard)):\n \"\"\"Remove groups\"\"\"\n\n\nclass ListGroups(GroupVCard(ListVCards)):\n \"\"\"Find groups\"\"\"\n\n\n_plugins.register_commands(Group, AddGroup, GroupAddLines,\n RemoveGroup, ListGroups)\n"} +{"text": "Content-Type: text/plain; charset=\"utf-8\"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nSubject: [v3, 03/13] clk: Avoid sending high rates to downstream clocks during\n\tset_rate\nFrom: Stephen Boyd \nX-Patchwork-Id: 6063271\nMessage-Id: <1426920332-9340-4-git-send-email-sboyd@codeaurora.org>\nTo: Mike Turquette , Stephen Boyd \nCc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,\n\tlinux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\tViresh Kumar \nDate: Fri, 20 Mar 2015 23:45:22 -0700\n\nIf a clock is on and we call clk_set_rate() on it we may get into\na situation where the clock temporarily increases in rate\ndramatically while we walk the tree and call .set_rate() ops. For\nexample, consider a case where a PLL feeds into a divider.\nInitially the divider is set to divide by 1 and the PLL is\nrunning fairly slow (100MHz). The downstream consumer of the\ndivider output can only handle rates =< 400 MHz, but the divider\ncan only choose between divisors of 1 and 4.\n\n +-----+ +----------------+\n | PLL |-->| div 1 or div 4 |---> consumer device\n +-----+ +----------------+\n\nTo achieve a rate of 400MHz on the output of the divider, we\nwould have to set the rate of the PLL to 1.6 GHz and then divide\nit by 4. The current code would set the PLL to 1.6GHz first while\nthe divider is still set to 1, thus causing the downstream\nconsumer of the clock to receive a few clock cycles of 1.6GHz\nclock (far beyond it's maximum acceptable rate). We should be\nchanging the divider first before increasing the PLL rate to\navoid this problem.\n\nTherefore, set the rate of any child clocks that are increasing\nin rate from their current rate so that they can increase their\ndividers if necessary. We assume that there isn't such a thing as\nminimum rate requirements.\n\nSigned-off-by: Stephen Boyd \n\n---\ndrivers/clk/clk.c | 34 ++++++++++++++++++++++------------\n 1 file changed, 22 insertions(+), 12 deletions(-)\n\n--- a/drivers/clk/clk.c\n+++ b/drivers/clk/clk.c\n@@ -1744,21 +1744,24 @@ static struct clk_core *clk_propagate_ra\n * walk down a subtree and set the new rates notifying the rate\n * change on the way\n */\n-static void clk_change_rate(struct clk_core *clk)\n+static void\n+clk_change_rate(struct clk_core *clk, unsigned long best_parent_rate)\n {\n \tstruct clk_core *child;\n \tstruct hlist_node *tmp;\n \tunsigned long old_rate;\n-\tunsigned long best_parent_rate = 0;\n \tbool skip_set_rate = false;\n \tstruct clk_core *old_parent;\n \n-\told_rate = clk->rate;\n+\thlist_for_each_entry(child, &clk->children, child_node) {\n+\t\t/* Skip children who will be reparented to another clock */\n+\t\tif (child->new_parent && child->new_parent != clk)\n+\t\t\tcontinue;\n+\t\tif (child->new_rate > child->rate)\n+\t\t\tclk_change_rate(child, clk->new_rate);\n+\t}\n \n-\tif (clk->new_parent)\n-\t\tbest_parent_rate = clk->new_parent->rate;\n-\telse if (clk->parent)\n-\t\tbest_parent_rate = clk->parent->rate;\n+\told_rate = clk->rate;\n \n \tif (clk->new_parent && clk->new_parent != clk->parent) {\n \t\told_parent = __clk_set_parent_before(clk, clk->new_parent);\n@@ -1784,7 +1787,7 @@ static void clk_change_rate(struct clk_c\n \n \ttrace_clk_set_rate_complete(clk, clk->new_rate);\n \n-\tclk->rate = clk_recalc(clk, best_parent_rate);\n+\tclk->rate = clk->new_rate;\n \n \tif (clk->notifier_count && old_rate != clk->rate)\n \t\t__clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate);\n@@ -1797,12 +1800,13 @@ static void clk_change_rate(struct clk_c\n \t\t/* Skip children who will be reparented to another clock */\n \t\tif (child->new_parent && child->new_parent != clk)\n \t\t\tcontinue;\n-\t\tclk_change_rate(child);\n+\t\tif (child->new_rate != child->rate)\n+\t\t\tclk_change_rate(child, clk->new_rate);\n \t}\n \n \t/* handle the new child who might not be in clk->children yet */\n-\tif (clk->new_child)\n-\t\tclk_change_rate(clk->new_child);\n+\tif (clk->new_child && clk->new_child->new_rate != clk->new_child->rate)\n+\t\tclk_change_rate(clk->new_child, clk->new_rate);\n }\n \n static int clk_core_set_rate_nolock(struct clk_core *clk,\n@@ -1811,6 +1815,7 @@ static int clk_core_set_rate_nolock(stru\n \tstruct clk_core *top, *fail_clk;\n \tunsigned long rate = req_rate;\n \tint ret = 0;\n+\tunsigned long parent_rate;\n \n \tif (!clk)\n \t\treturn 0;\n@@ -1836,8 +1841,13 @@ static int clk_core_set_rate_nolock(stru\n \t\treturn -EBUSY;\n \t}\n \n+\tif (top->parent)\n+\t\tparent_rate = top->parent->rate;\n+\telse\n+\t\tparent_rate = 0;\n+\n \t/* change the rates */\n-\tclk_change_rate(top);\n+\tclk_change_rate(top, parent_rate);\n \n \tclk->req_rate = req_rate;\n \n"} +{"text": "// Code generated by mockery v1.0.0\npackage automock\n\nimport mock \"github.com/stretchr/testify/mock\"\n\n// removalProcessor is an autogenerated mock type for the removalProcessor type\ntype removalProcessor struct {\n\tmock.Mock\n}\n\n// processRemovalInNamespace provides a mock function with given fields: _a0\nfunc (_m *removalProcessor) ProcessRemovalInNamespace(_a0 string) error {\n\tret := _m.Called(_a0)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(string) error); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}\n"} +{"text": "#import \n#import \n\ntypedef enum {\n UILabelCountingMethodEaseInOut,\n UILabelCountingMethodEaseIn,\n UILabelCountingMethodEaseOut,\n UILabelCountingMethodLinear\n} UILabelCountingMethod;\n\ntypedef NSString* (^UICountingLabelFormatBlock)(float value);\ntypedef NSAttributedString* (^UICountingLabelAttributedFormatBlock)(float value);\n\n@interface UICountingLabel : UILabel\n\n@property (nonatomic, strong) NSString *format;\n@property (nonatomic, assign) UILabelCountingMethod method;\n@property (nonatomic, assign) NSTimeInterval animationDuration;\n\n@property (nonatomic, copy) UICountingLabelFormatBlock formatBlock;\n@property (nonatomic, copy) UICountingLabelAttributedFormatBlock attributedFormatBlock;\n@property (nonatomic, copy) void (^completionBlock)();\n\n-(void)countFrom:(float)startValue to:(float)endValue;\n-(void)countFrom:(float)startValue to:(float)endValue withDuration:(NSTimeInterval)duration;\n\n-(void)countFromCurrentValueTo:(float)endValue;\n-(void)countFromCurrentValueTo:(float)endValue withDuration:(NSTimeInterval)duration;\n\n-(void)countFromZeroTo:(float)endValue;\n-(void)countFromZeroTo:(float)endValue withDuration:(NSTimeInterval)duration;\n\n- (CGFloat)currentValue;\n\n@end\n\n"} +{"text": "// Copyright 2020 Workiva Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport 'dart:html';\n\nimport 'package:over_react/over_react.dart';\nimport 'package:over_react/components.dart' as v2;\nimport 'package:over_react/react_dom.dart' as react_dom;\n\nimport 'src/demos.dart';\n\nvoid main() {\n react_dom.render(\n buttonExamplesDemo(), querySelector('$demoMountNodeSelectorPrefix--button'));\n\n react_dom.render(\n listGroupBasicDemo(), querySelector('$demoMountNodeSelectorPrefix--list-group'));\n\n react_dom.render(\n progressBasicDemo(), querySelector('$demoMountNodeSelectorPrefix--progress'));\n\n react_dom.render(\n tagBasicDemo(), querySelector('$demoMountNodeSelectorPrefix--tag'));\n\n react_dom.render(\n checkboxToggleButtonDemo(), querySelector('$demoMountNodeSelectorPrefix--checkbox-toggle'));\n\n react_dom.render(\n radioToggleButtonDemo(), querySelector('$demoMountNodeSelectorPrefix--radio-toggle'));\n\n react_dom.render(\n (v2.ErrorBoundary()\n ..onComponentDidCatch = (error, info) {\n print('Consumer props.onComponentDidCatch($error, $info)');\n }\n )(Faulty()()),\n querySelector('$demoMountNodeSelectorPrefix--faulty-component'),\n );\n\n react_dom.render(\n (v2.ErrorBoundary()\n ..onComponentDidCatch = (error, info) {\n print('Consumer props.onComponentDidCatch($error, $info)');\n }\n )(FaultyOnMount()()),\n querySelector('$demoMountNodeSelectorPrefix--faulty-on-mount-component'),\n );\n\n react_dom.render(\n (v2.ErrorBoundary()\n ..onComponentDidCatch = (error, info) {\n print('Consumer props.onComponentDidCatch($error, $info)');\n }\n ..fallbackUIRenderer = (_, __) {\n return (Dom.div()..id = 'FallbackUi')('I am a fallback.');\n }\n )(FaultyOnMount()()),\n querySelector('$demoMountNodeSelectorPrefix--faulty-on-mount-fallback-component'),\n );\n\n react_dom.render(\n (CustomErrorBoundary()\n ..onComponentDidCatch = (error, info) {\n print('Consumer props.onComponentDidCatch($error, $info)');\n }\n )(Faulty()()),\n querySelector('$demoMountNodeSelectorPrefix--faulty-component-with-custom-error-boundary'),\n );\n\n react_dom.render(\n Faulty()(), querySelector('$demoMountNodeSelectorPrefix--faulty-component-without-error-boundary'));\n\n react_dom.render(PropTypesWrap()(), querySelector('$demoMountNodeSelectorPrefix--proptypes-component'));\n\n react_dom.render(FragmentExample()(), querySelector('$demoMountNodeSelectorPrefix--fragment-component'));\n react_dom.render(ListExample()(), querySelector('$demoMountNodeSelectorPrefix--list-component'));\n react_dom.render(NumExample()(), querySelector('$demoMountNodeSelectorPrefix--num-component'));\n react_dom.render(StringExample()(), querySelector('$demoMountNodeSelectorPrefix--string-component'));\n react_dom.render(\n (RefDemoContainer())(),\n querySelector('$demoMountNodeSelectorPrefix--forwardRef'),\n );\n}\n"} +{"text": "/****************************************************************************\r\n**\r\n** Copyright (C) 2016 The Qt Company Ltd.\r\n** Contact: https://www.qt.io/licensing/\r\n**\r\n** This file is part of Qt Creator.\r\n**\r\n** Commercial License Usage\r\n** Licensees holding valid commercial Qt 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 The Qt Company. For licensing terms\r\n** and conditions see https://www.qt.io/terms-conditions. For further\r\n** information use the contact form at https://www.qt.io/contact-us.\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 as published by the Free Software\r\n** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT\r\n** included in the packaging of this file. Please review the following\r\n** information to ensure the GNU General Public License requirements will\r\n** be met: https://www.gnu.org/licenses/gpl-3.0.html.\r\n**\r\n****************************************************************************/\r\n\r\n#pragma once\r\n\r\n#include \"../core_global.h\"\r\n\r\n#include \r\n\r\nQT_BEGIN_NAMESPACE\r\nclass QTreeView;\r\nclass QStandardItemModel;\r\nclass QStandardItem;\r\nclass QLabel;\r\nQT_END_NAMESPACE\r\n\r\nnamespace Core {\r\n\r\n// Documentation inside.\r\nclass CORE_EXPORT PromptOverwriteDialog : public QDialog\r\n{\r\n Q_OBJECT\r\npublic:\r\n explicit PromptOverwriteDialog(QWidget *parent = nullptr);\r\n\r\n void setFiles(const QStringList &);\r\n\r\n void setFileEnabled(const QString &f, bool e);\r\n bool isFileEnabled(const QString &f) const;\r\n\r\n void setFileChecked(const QString &f, bool e);\r\n bool isFileChecked(const QString &f) const;\r\n\r\n QStringList checkedFiles() const { return files(Qt::Checked); }\r\n QStringList uncheckedFiles() const { return files(Qt::Unchecked); }\r\n\r\nprivate:\r\n QStandardItem *itemForFile(const QString &f) const;\r\n QStringList files(Qt::CheckState cs) const;\r\n\r\n QLabel *m_label;\r\n QTreeView *m_view;\r\n QStandardItemModel *m_model;\r\n};\r\n\r\n} // namespace Core\r\n"} +{"text": "--\n-- vs2010.lua\n-- Add support for the Visual Studio 2010 project formats.\n-- Copyright (c) Jason Perkins and the Premake project\n--\n\n\tlocal p = premake\n\tp.vstudio.vs2010 = {}\n\n\tlocal vs2010 = p.vstudio.vs2010\n\tlocal vstudio = p.vstudio\n\tlocal project = p.project\n\tlocal tree = p.tree\n\n\n---\n-- Map Premake tokens to the corresponding Visual Studio variables.\n---\n\n\tvs2010.pathVars = {\n\t\t[\"cfg.objdir\"] = { absolute = true, token = \"$(IntDir)\" },\n\t\t[\"prj.location\"] = { absolute = true, token = \"$(ProjectDir)\" },\n\t\t[\"prj.name\"] = { absolute = false, token = \"$(ProjectName)\" },\n\t\t[\"sln.location\"] = { absolute = true, token = \"$(SolutionDir)\" },\n\t\t[\"sln.name\"] = { absolute = false, token = \"$(SolutionName)\" },\n\t\t[\"wks.location\"] = { absolute = true, token = \"$(SolutionDir)\" },\n\t\t[\"wks.name\"] = { absolute = false, token = \"$(SolutionName)\" },\n\t\t[\"cfg.buildtarget.directory\"] = { absolute = false, token = \"$(TargetDir)\" },\n\t\t[\"cfg.buildtarget.name\"] = { absolute = false, token = \"$(TargetFileName)\" },\n\t\t[\"cfg.buildtarget.basename\"] = { absolute = false, token = \"$(TargetName)\" },\n\t\t[\"file.basename\"] = { absolute = false, token = \"%(Filename)\" },\n\t\t[\"file.abspath\"] = { absolute = true, token = \"%(FullPath)\" },\n\t\t[\"file.relpath\"] = { absolute = false, token = \"%(Identity)\" },\n\t\t[\"file.path\"] = { absolute = false, token = \"%(Identity)\" },\n\t\t[\"file.directory\"] = { absolute = true, token = \"%(RootDir)%(Directory)\" },\n\t\t[\"file.reldirectory\"] = { absolute = false, token = \"%(RelativeDir)\" },\n\t\t[\"file.extension\"] = { absolute = false, token = \"%(Extension)\" },\n\t\t[\"file.name\"] = { absolute = false, token = \"%(Filename)%(Extension)\" },\n\t}\n\n\n\n---\n-- Identify the type of project being exported and hand it off\n-- the right generator.\n---\n\n\tfunction vs2010.generateProject(prj)\n\t\tp.eol(\"\\r\\n\")\n\t\tp.indent(\" \")\n\t\tp.escaper(vs2010.esc)\n\n\t\tif p.project.iscsharp(prj) then\n\t\t\tp.generate(prj, \".csproj\", vstudio.cs2005.generate)\n\n\t\t\t-- Skip generation of empty user files\n\t\t\tlocal user = p.capture(function() vstudio.cs2005.generateUser(prj) end)\n\t\t\tif #user > 0 then\n\t\t\t\tp.generate(prj, \".csproj.user\", function() p.outln(user) end)\n\t\t\tend\n\n\t\telseif p.project.isfsharp(prj) then\n\t\t\tp.generate(prj, \".fsproj\", vstudio.fs2005.generate)\n\n\t\t\t-- Skip generation of empty user files\n\t\t\tlocal user = p.capture(function() vstudio.fs2005.generateUser(prj) end)\n\t\t\tif #user > 0 then\n\t\t\t\tp.generate(prj, \".fsproj.user\", function() p.outln(user) end)\n\t\t\tend\n\n\t\telseif p.project.isc(prj) or p.project.iscpp(prj) then\n\t\t\tlocal projFileModified = p.generate(prj, \".vcxproj\", vstudio.vc2010.generate)\n\n\t\t\t-- Skip generation of empty user files\n\t\t\tlocal user = p.capture(function() vstudio.vc2010.generateUser(prj) end)\n\t\t\tif #user > 0 then\n\t\t\t\tp.generate(prj, \".vcxproj.user\", function() p.outln(user) end)\n\t\t\tend\n\n\t\t\t-- Only generate a filters file if the source tree actually has subfolders\n\t\t\tif tree.hasbranches(project.getsourcetree(prj)) then\n\t\t\t\tif p.generate(prj, \".vcxproj.filters\", vstudio.vc2010.generateFilters) == true and projFileModified == false then\n\t\t\t\t\t-- vs workaround for issue where if only the .filters file is modified, VS doesn't automaticly trigger a reload\n\t\t\t\t\tp.touch(prj, \".vcxproj\")\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\tif not vstudio.nuget2010.supportsPackageReferences(prj) then\n\t\t\t-- Skip generation of empty packages.config files\n\t\t\tlocal packages = p.capture(function() vstudio.nuget2010.generatePackagesConfig(prj) end)\n\t\t\tif #packages > 0 then\n\t\t\t\tp.generate(prj, \"packages.config\", function() p.outln(packages) end)\n\t\t\tend\n\n\t\t\t-- Skip generation of empty NuGet.Config files\n\t\t\tlocal config = p.capture(function() vstudio.nuget2010.generateNuGetConfig(prj) end)\n\t\t\tif #config > 0 then\n\t\t\t\tp.generate(prj, \"NuGet.Config\", function() p.outln(config) end)\n\t\t\tend\n\t\tend\n\tend\n\n\n\n---\n-- Generate the .props, .targets, and .xml files for custom rules.\n---\n\n\tfunction vs2010.generateRule(rule)\n\t\tp.eol(\"\\r\\n\")\n\t\tp.indent(\" \")\n\t\tp.escaper(vs2010.esc)\n\n\t\tp.generate(rule, \".props\", vs2010.rules.props.generate)\n\t\tp.generate(rule, \".targets\", vs2010.rules.targets.generate)\n\t\tp.generate(rule, \".xml\", vs2010.rules.xml.generate)\n\tend\n\n\n\n--\n-- The VS 2010 standard for XML escaping in generated project files.\n--\n\n\tfunction vs2010.esc(value)\n\t\tvalue = value:gsub('&', \"&\")\n\t\tvalue = value:gsub('<', \"<\")\n\t\tvalue = value:gsub('>', \">\")\n\t\treturn value\n\tend\n\n\n\n---\n-- Define the Visual Studio 2010 export action.\n---\n\n\tnewaction {\n\t\t-- Metadata for the command line and help system\n\n\t\ttrigger = \"vs2010\",\n\t\tshortname = \"Visual Studio 2010\",\n\t\tdescription = \"Generate Visual Studio 2010 project files\",\n\n\t\t-- Visual Studio always uses Windows path and naming conventions\n\n\t\ttargetos = \"windows\",\n\t\ttoolset = \"msc-v100\",\n\n\t\t-- The capabilities of this action\n\n\t\tvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Makefile\", \"None\", \"Utility\" },\n\t\tvalid_languages = { \"C\", \"C++\", \"C#\", \"F#\" },\n\t\tvalid_tools = {\n\t\t\tcc = { \"msc\" },\n\t\t\tdotnet = { \"msnet\" },\n\t\t},\n\n\t\t-- Workspace and project generation logic\n\n\t\tonWorkspace = function(wks)\n\t\t\tvstudio.vs2005.generateSolution(wks)\n\t\tend,\n\t\tonProject = function(prj)\n\t\t\tvstudio.vs2010.generateProject(prj)\n\t\tend,\n\t\tonRule = function(rule)\n\t\t\tvstudio.vs2010.generateRule(rule)\n\t\tend,\n\n\t\tonCleanWorkspace = function(wks)\n\t\t\tvstudio.cleanSolution(wks)\n\t\tend,\n\t\tonCleanProject = function(prj)\n\t\t\tvstudio.cleanProject(prj)\n\t\tend,\n\t\tonCleanTarget = function(prj)\n\t\t\tvstudio.cleanTarget(prj)\n\t\tend,\n\n\t\tpathVars = vs2010.pathVars,\n\n\t\t-- This stuff is specific to the Visual Studio exporters\n\n\t\tvstudio = {\n\t\t\tcsprojSchemaVersion = \"2.0\",\n\t\t\tproductVersion = \"8.0.30703\",\n\t\t\tsolutionVersion = \"11\",\n\t\t\tversionName = \"2010\",\n\t\t\ttargetFramework = \"4.0\",\n\t\t\ttoolsVersion = \"4.0\",\n\t\t}\n\t}\n"} +{"text": "-module(rooster_app).\n-behaviour(application).\n\n-export([start/2, stop/1]).\n\nstart(_Type, _StartArgs) ->\n Options = rooster_state:get(),\n rooster_sup:start_link(Options).\n\nstop(_State) ->\n ok."} +{"text": "/* Copyright (C) 2003 Epic Games (written by Jean-Marc Valin)\n Copyright (C) 2004-2006 Epic Games \n \n File: preprocess.c\n Preprocessor with denoising based on the algorithm by Ephraim and Malah\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 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n 3. The name of the author may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,\n INDIRECT, 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) ARISING IN\n ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGE.\n*/\n\n\n/*\n Recommended papers:\n \n Y. Ephraim and D. Malah, \"Speech enhancement using minimum mean-square error\n short-time spectral amplitude estimator\". IEEE Transactions on Acoustics, \n Speech and Signal Processing, vol. ASSP-32, no. 6, pp. 1109-1121, 1984.\n \n Y. Ephraim and D. Malah, \"Speech enhancement using minimum mean-square error\n log-spectral amplitude estimator\". IEEE Transactions on Acoustics, Speech and \n Signal Processing, vol. ASSP-33, no. 2, pp. 443-445, 1985.\n \n I. Cohen and B. Berdugo, \"Speech enhancement for non-stationary noise environments\".\n Signal Processing, vol. 81, no. 2, pp. 2403-2418, 2001.\n\n Stefan Gustafsson, Rainer Martin, Peter Jax, and Peter Vary. \"A psychoacoustic \n approach to combined acoustic echo cancellation and noise reduction\". IEEE \n Transactions on Speech and Audio Processing, 2002.\n \n J.-M. Valin, J. Rouat, and F. Michaud, \"Microphone array post-filter for separation\n of simultaneous non-stationary sources\". In Proceedings IEEE International \n Conference on Acoustics, Speech, and Signal Processing, 2004.\n*/\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n\n#include \n#include \"speex/speex_preprocess.h\"\n#include \"speex/speex_echo.h\"\n#include \"arch.h\"\n#include \"fftwrap.h\"\n#include \"filterbank.h\"\n#include \"math_approx.h\"\n#include \"os_support.h\"\n\n#ifndef M_PI\n#define M_PI 3.14159263\n#endif\n\n#define LOUDNESS_EXP 5.f\n#define AMP_SCALE .001f\n#define AMP_SCALE_1 1000.f\n \n#define NB_BANDS 24\n\n#define SPEECH_PROB_START_DEFAULT QCONST16(0.35f,15)\n#define SPEECH_PROB_CONTINUE_DEFAULT QCONST16(0.20f,15)\n#define NOISE_SUPPRESS_DEFAULT -15\n#define ECHO_SUPPRESS_DEFAULT -40\n#define ECHO_SUPPRESS_ACTIVE_DEFAULT -15\n\n#ifndef NULL\n#define NULL 0\n#endif\n\n#define SQR(x) ((x)*(x))\n#define SQR16(x) (MULT16_16((x),(x)))\n#define SQR16_Q15(x) (MULT16_16_Q15((x),(x)))\n\n#ifdef FIXED_POINT\nstatic inline spx_word16_t DIV32_16_Q8(spx_word32_t a, spx_word32_t b)\n{\n if (SHR32(a,7) >= b)\n {\n return 32767;\n } else {\n if (b>=QCONST32(1,23))\n {\n a = SHR32(a,8);\n b = SHR32(b,8);\n }\n if (b>=QCONST32(1,19))\n {\n a = SHR32(a,4);\n b = SHR32(b,4);\n }\n if (b>=QCONST32(1,15))\n {\n a = SHR32(a,4);\n b = SHR32(b,4);\n }\n a = SHL32(a,8);\n return PDIV32_16(a,b);\n }\n \n}\nstatic inline spx_word16_t DIV32_16_Q15(spx_word32_t a, spx_word32_t b)\n{\n if (SHR32(a,15) >= b)\n {\n return 32767;\n } else {\n if (b>=QCONST32(1,23))\n {\n a = SHR32(a,8);\n b = SHR32(b,8);\n }\n if (b>=QCONST32(1,19))\n {\n a = SHR32(a,4);\n b = SHR32(b,4);\n }\n if (b>=QCONST32(1,15))\n {\n a = SHR32(a,4);\n b = SHR32(b,4);\n }\n a = SHL32(a,15)-a;\n return DIV32_16(a,b);\n }\n}\n#define SNR_SCALING 256.f\n#define SNR_SCALING_1 0.0039062f\n#define SNR_SHIFT 8\n\n#define FRAC_SCALING 32767.f\n#define FRAC_SCALING_1 3.0518e-05\n#define FRAC_SHIFT 1\n\n#define EXPIN_SCALING 2048.f\n#define EXPIN_SCALING_1 0.00048828f\n#define EXPIN_SHIFT 11\n#define EXPOUT_SCALING_1 1.5259e-05\n\n#define NOISE_SHIFT 7\n\n#else\n\n#define DIV32_16_Q8(a,b) ((a)/(b))\n#define DIV32_16_Q15(a,b) ((a)/(b))\n#define SNR_SCALING 1.f\n#define SNR_SCALING_1 1.f\n#define SNR_SHIFT 0\n#define FRAC_SCALING 1.f\n#define FRAC_SCALING_1 1.f\n#define FRAC_SHIFT 0\n#define NOISE_SHIFT 0\n\n#define EXPIN_SCALING 1.f\n#define EXPIN_SCALING_1 1.f\n#define EXPOUT_SCALING_1 1.f\n\n#endif\n\n/** Speex pre-processor state. */\nstruct SpeexPreprocessState_ {\n /* Basic info */\n int frame_size; /**< Number of samples processed each time */\n int ps_size; /**< Number of points in the power spectrum */\n int sampling_rate; /**< Sampling rate of the input/output */\n int nbands;\n FilterBank *bank;\n \n /* Parameters */\n int denoise_enabled;\n int vad_enabled;\n int dereverb_enabled;\n spx_word16_t reverb_decay;\n spx_word16_t reverb_level;\n spx_word16_t speech_prob_start;\n spx_word16_t speech_prob_continue;\n int noise_suppress;\n int echo_suppress;\n int echo_suppress_active;\n SpeexEchoState *echo_state;\n \n spx_word16_t\tspeech_prob; /**< Probability last frame was speech */\n\n /* DSP-related arrays */\n spx_word16_t *frame; /**< Processing frame (2*ps_size) */\n spx_word16_t *ft; /**< Processing frame in freq domain (2*ps_size) */\n spx_word32_t *ps; /**< Current power spectrum */\n spx_word16_t *gain2; /**< Adjusted gains */\n spx_word16_t *gain_floor; /**< Minimum gain allowed */\n spx_word16_t *window; /**< Analysis/Synthesis window */\n spx_word32_t *noise; /**< Noise estimate */\n spx_word32_t *reverb_estimate; /**< Estimate of reverb energy */\n spx_word32_t *old_ps; /**< Power spectrum for last frame */\n spx_word16_t *gain; /**< Ephraim Malah gain */\n spx_word16_t *prior; /**< A-priori SNR */\n spx_word16_t *post; /**< A-posteriori SNR */\n\n spx_word32_t *S; /**< Smoothed power spectrum */\n spx_word32_t *Smin; /**< See Cohen paper */\n spx_word32_t *Stmp; /**< See Cohen paper */\n int *update_prob; /**< Probability of speech presence for noise update */\n\n spx_word16_t *zeta; /**< Smoothed a priori SNR */\n spx_word32_t *echo_noise;\n spx_word32_t *residual_echo;\n\n /* Misc */\n spx_word16_t *inbuf; /**< Input buffer (overlapped analysis) */\n spx_word16_t *outbuf; /**< Output buffer (for overlap and add) */\n\n /* AGC stuff, only for floating point for now */\n#ifndef FIXED_POINT\n int agc_enabled;\n float agc_level;\n float loudness_accum;\n float *loudness_weight; /**< Perceptual loudness curve */\n float loudness; /**< Loudness estimate */\n float agc_gain; /**< Current AGC gain */\n float max_gain; /**< Maximum gain allowed */\n float max_increase_step; /**< Maximum increase in gain from one frame to another */\n float max_decrease_step; /**< Maximum decrease in gain from one frame to another */\n float prev_loudness; /**< Loudness of previous frame */\n float init_max; /**< Current gain limit during initialisation */\n#endif\n int nb_adapt; /**< Number of frames used for adaptation so far */\n int was_speech;\n int min_count; /**< Number of frames processed so far */\n void *fft_lookup; /**< Lookup table for the FFT */\n#ifdef FIXED_POINT\n int frame_shift;\n#endif\n};\n\n\nstatic void conj_window(spx_word16_t *w, int len)\n{\n int i;\n for (i=0;i19)\n return ADD32(EXTEND32(Q15_ONE),EXTEND32(DIV32_16(QCONST32(.1296,23), SHR32(xx,EXPIN_SHIFT-SNR_SHIFT))));\n frac = SHL32(xx-SHL32(ind,10),5);\n return SHL32(DIV32_16(PSHR32(MULT16_16(Q15_ONE-frac,table[ind]) + MULT16_16(frac,table[ind+1]),7),(spx_sqrt(SHL32(xx,15)+6711))),7);\n}\n\nstatic inline spx_word16_t qcurve(spx_word16_t x)\n{\n x = MAX16(x, 1);\n return DIV32_16(SHL32(EXTEND32(32767),9),ADD16(512,MULT16_16_Q15(QCONST16(.60f,15),DIV32_16(32767,x))));\n}\n\n/* Compute the gain floor based on different floors for the background noise and residual echo */\nstatic void compute_gain_floor(int noise_suppress, int effective_echo_suppress, spx_word32_t *noise, spx_word32_t *echo, spx_word16_t *gain_floor, int len)\n{\n int i;\n \n if (noise_suppress > effective_echo_suppress)\n {\n spx_word16_t noise_gain, gain_ratio;\n noise_gain = EXTRACT16(MIN32(Q15_ONE,SHR32(spx_exp(MULT16_16(QCONST16(0.11513,11),noise_suppress)),1)));\n gain_ratio = EXTRACT16(MIN32(Q15_ONE,SHR32(spx_exp(MULT16_16(QCONST16(.2302585f,11),effective_echo_suppress-noise_suppress)),1)));\n\n /* gain_floor = sqrt [ (noise*noise_floor + echo*echo_floor) / (noise+echo) ] */\n for (i=0;i19)\n return FRAC_SCALING*(1+.1296/x);\n frac = 2*x-integer;\n return FRAC_SCALING*((1-frac)*table[ind] + frac*table[ind+1])/sqrt(x+.0001f);\n}\n\nstatic inline spx_word16_t qcurve(spx_word16_t x)\n{\n return 1.f/(1.f+.15f/(SNR_SCALING_1*x));\n}\n\nstatic void compute_gain_floor(int noise_suppress, int effective_echo_suppress, spx_word32_t *noise, spx_word32_t *echo, spx_word16_t *gain_floor, int len)\n{\n int i;\n float echo_floor;\n float noise_floor;\n\n noise_floor = exp(.2302585f*noise_suppress);\n echo_floor = exp(.2302585f*effective_echo_suppress);\n\n /* Compute the gain floor based on different floors for the background noise and residual echo */\n for (i=0;iframe_size = frame_size;\n\n /* Round ps_size down to the nearest power of two */\n#if 0\n i=1;\n st->ps_size = st->frame_size;\n while(1)\n {\n if (st->ps_size & ~i)\n {\n st->ps_size &= ~i;\n i<<=1;\n } else {\n break;\n }\n }\n \n \n if (st->ps_size < 3*st->frame_size/4)\n st->ps_size = st->ps_size * 3 / 2;\n#else\n st->ps_size = st->frame_size;\n#endif\n\n N = st->ps_size;\n N3 = 2*N - st->frame_size;\n N4 = st->frame_size - N3;\n \n st->sampling_rate = sampling_rate;\n st->denoise_enabled = 1;\n st->vad_enabled = 0;\n st->dereverb_enabled = 0;\n st->reverb_decay = 0;\n st->reverb_level = 0;\n st->noise_suppress = NOISE_SUPPRESS_DEFAULT;\n st->echo_suppress = ECHO_SUPPRESS_DEFAULT;\n st->echo_suppress_active = ECHO_SUPPRESS_ACTIVE_DEFAULT;\n\n st->speech_prob_start = SPEECH_PROB_START_DEFAULT;\n st->speech_prob_continue = SPEECH_PROB_CONTINUE_DEFAULT;\n\n st->echo_state = NULL;\n \n st->nbands = NB_BANDS;\n M = st->nbands;\n st->bank = filterbank_new(M, sampling_rate, N, 1);\n \n st->frame = (spx_word16_t*)speex_alloc(2*N*sizeof(spx_word16_t));\n st->window = (spx_word16_t*)speex_alloc(2*N*sizeof(spx_word16_t));\n st->ft = (spx_word16_t*)speex_alloc(2*N*sizeof(spx_word16_t));\n \n st->ps = (spx_word32_t*)speex_alloc((N+M)*sizeof(spx_word32_t));\n st->noise = (spx_word32_t*)speex_alloc((N+M)*sizeof(spx_word32_t));\n st->echo_noise = (spx_word32_t*)speex_alloc((N+M)*sizeof(spx_word32_t));\n st->residual_echo = (spx_word32_t*)speex_alloc((N+M)*sizeof(spx_word32_t));\n st->reverb_estimate = (spx_word32_t*)speex_alloc((N+M)*sizeof(spx_word32_t));\n st->old_ps = (spx_word32_t*)speex_alloc((N+M)*sizeof(spx_word32_t));\n st->prior = (spx_word16_t*)speex_alloc((N+M)*sizeof(spx_word16_t));\n st->post = (spx_word16_t*)speex_alloc((N+M)*sizeof(spx_word16_t));\n st->gain = (spx_word16_t*)speex_alloc((N+M)*sizeof(spx_word16_t));\n st->gain2 = (spx_word16_t*)speex_alloc((N+M)*sizeof(spx_word16_t));\n st->gain_floor = (spx_word16_t*)speex_alloc((N+M)*sizeof(spx_word16_t));\n st->zeta = (spx_word16_t*)speex_alloc((N+M)*sizeof(spx_word16_t));\n \n st->S = (spx_word32_t*)speex_alloc(N*sizeof(spx_word32_t));\n st->Smin = (spx_word32_t*)speex_alloc(N*sizeof(spx_word32_t));\n st->Stmp = (spx_word32_t*)speex_alloc(N*sizeof(spx_word32_t));\n st->update_prob = (int*)speex_alloc(N*sizeof(int));\n \n st->inbuf = (spx_word16_t*)speex_alloc(N3*sizeof(spx_word16_t));\n st->outbuf = (spx_word16_t*)speex_alloc(N3*sizeof(spx_word16_t));\n\n conj_window(st->window, 2*N3);\n for (i=2*N3;i<2*st->ps_size;i++)\n st->window[i]=Q15_ONE;\n \n if (N4>0)\n {\n for (i=N3-1;i>=0;i--)\n {\n st->window[i+N3+N4]=st->window[i+N3];\n st->window[i+N3]=1;\n }\n }\n for (i=0;inoise[i]=QCONST32(1.f,NOISE_SHIFT);\n st->reverb_estimate[i]=0;\n st->old_ps[i]=1;\n st->gain[i]=Q15_ONE;\n st->post[i]=SHL16(1, SNR_SHIFT);\n st->prior[i]=SHL16(1, SNR_SHIFT);\n }\n\n for (i=0;iupdate_prob[i] = 1;\n for (i=0;iinbuf[i]=0;\n st->outbuf[i]=0;\n }\n#ifndef FIXED_POINT\n st->agc_enabled = 0;\n st->agc_level = 8000;\n st->loudness_weight = (float*)speex_alloc(N*sizeof(float));\n for (i=0;iloudness_weight[i] = .5f*(1.f/(1.f+ff/8000.f))+1.f*exp(-.5f*(ff-3800.f)*(ff-3800.f)/9e5f);*/\n st->loudness_weight[i] = .35f-.35f*ff/16000.f+.73f*exp(-.5f*(ff-3800)*(ff-3800)/9e5f);\n if (st->loudness_weight[i]<.01f)\n st->loudness_weight[i]=.01f;\n st->loudness_weight[i] *= st->loudness_weight[i];\n }\n /*st->loudness = pow(AMP_SCALE*st->agc_level,LOUDNESS_EXP);*/\n st->loudness = 1e-15;\n st->agc_gain = 1;\n st->max_gain = 30;\n st->max_increase_step = exp(0.11513f * 12.*st->frame_size / st->sampling_rate);\n st->max_decrease_step = exp(-0.11513f * 40.*st->frame_size / st->sampling_rate);\n st->prev_loudness = 1;\n st->init_max = 1;\n#endif\n st->was_speech = 0;\n\n st->fft_lookup = spx_fft_init(2*N);\n\n st->nb_adapt=0;\n st->min_count=0;\n return st;\n}\n\nEXPORT void speex_preprocess_state_destroy(SpeexPreprocessState *st)\n{\n speex_free(st->frame);\n speex_free(st->ft);\n speex_free(st->ps);\n speex_free(st->gain2);\n speex_free(st->gain_floor);\n speex_free(st->window);\n speex_free(st->noise);\n speex_free(st->reverb_estimate);\n speex_free(st->old_ps);\n speex_free(st->gain);\n speex_free(st->prior);\n speex_free(st->post);\n#ifndef FIXED_POINT\n speex_free(st->loudness_weight);\n#endif\n speex_free(st->echo_noise);\n speex_free(st->residual_echo);\n\n speex_free(st->S);\n speex_free(st->Smin);\n speex_free(st->Stmp);\n speex_free(st->update_prob);\n speex_free(st->zeta);\n\n speex_free(st->inbuf);\n speex_free(st->outbuf);\n\n spx_fft_destroy(st->fft_lookup);\n filterbank_destroy(st->bank);\n speex_free(st);\n}\n\n/* FIXME: The AGC doesn't work yet with fixed-point*/\n#ifndef FIXED_POINT\nstatic void speex_compute_agc(SpeexPreprocessState *st, spx_word16_t Pframe, spx_word16_t *ft)\n{\n int i;\n int N = st->ps_size;\n float target_gain;\n float loudness=1.f;\n float rate;\n \n for (i=2;ips[i]* st->loudness_weight[i];\n }\n loudness=sqrt(loudness);\n /*if (loudness < 2*pow(st->loudness, 1.0/LOUDNESS_EXP) &&\n loudness*2 > pow(st->loudness, 1.0/LOUDNESS_EXP))*/\n if (Pframe>.3f)\n {\n /*rate=2.0f*Pframe*Pframe/(1+st->nb_loudness_adapt);*/\n rate = .03*Pframe*Pframe;\n st->loudness = (1-rate)*st->loudness + (rate)*pow(AMP_SCALE*loudness, LOUDNESS_EXP);\n st->loudness_accum = (1-rate)*st->loudness_accum + rate;\n if (st->init_max < st->max_gain && st->nb_adapt > 20)\n st->init_max *= 1.f + .1f*Pframe*Pframe;\n }\n /*printf (\"%f %f %f %f\\n\", Pframe, loudness, pow(st->loudness, 1.0f/LOUDNESS_EXP), st->loudness2);*/\n \n target_gain = AMP_SCALE*st->agc_level*pow(st->loudness/(1e-4+st->loudness_accum), -1.0f/LOUDNESS_EXP);\n\n if ((Pframe>.5 && st->nb_adapt > 20) || target_gain < st->agc_gain)\n {\n if (target_gain > st->max_increase_step*st->agc_gain)\n target_gain = st->max_increase_step*st->agc_gain;\n if (target_gain < st->max_decrease_step*st->agc_gain && loudness < 10*st->prev_loudness)\n target_gain = st->max_decrease_step*st->agc_gain;\n if (target_gain > st->max_gain)\n target_gain = st->max_gain;\n if (target_gain > st->init_max)\n target_gain = st->init_max;\n \n st->agc_gain = target_gain;\n }\n /*fprintf (stderr, \"%f %f %f\\n\", loudness, (float)AMP_SCALE_1*pow(st->loudness, 1.0f/LOUDNESS_EXP), st->agc_gain);*/\n \n for (i=0;i<2*N;i++)\n ft[i] *= st->agc_gain;\n st->prev_loudness = loudness;\n}\n#endif\n\nstatic void preprocess_analysis(SpeexPreprocessState *st, spx_int16_t *x)\n{\n int i;\n int N = st->ps_size;\n int N3 = 2*N - st->frame_size;\n int N4 = st->frame_size - N3;\n spx_word32_t *ps=st->ps;\n\n /* 'Build' input frame */\n for (i=0;iframe[i]=st->inbuf[i];\n for (i=0;iframe_size;i++)\n st->frame[N3+i]=x[i];\n \n /* Update inbuf */\n for (i=0;iinbuf[i]=x[N4+i];\n\n /* Windowing */\n for (i=0;i<2*N;i++)\n st->frame[i] = MULT16_16_Q15(st->frame[i], st->window[i]);\n\n#ifdef FIXED_POINT\n {\n spx_word16_t max_val=0;\n for (i=0;i<2*N;i++)\n max_val = MAX16(max_val, ABS16(st->frame[i]));\n st->frame_shift = 14-spx_ilog2(EXTEND32(max_val));\n for (i=0;i<2*N;i++)\n st->frame[i] = SHL16(st->frame[i], st->frame_shift);\n }\n#endif\n \n /* Perform FFT */\n spx_fft(st->fft_lookup, st->frame, st->ft);\n \n /* Power spectrum */\n ps[0]=MULT16_16(st->ft[0],st->ft[0]);\n for (i=1;ift[2*i-1],st->ft[2*i-1]) + MULT16_16(st->ft[2*i],st->ft[2*i]);\n for (i=0;ips[i] = PSHR32(st->ps[i], 2*st->frame_shift);\n\n filterbank_compute_bank32(st->bank, ps, ps+N);\n}\n\nstatic void update_noise_prob(SpeexPreprocessState *st)\n{\n int i;\n int min_range;\n int N = st->ps_size;\n\n for (i=1;iS[i] = MULT16_32_Q15(QCONST16(.8f,15),st->S[i]) + MULT16_32_Q15(QCONST16(.05f,15),st->ps[i-1]) \n + MULT16_32_Q15(QCONST16(.1f,15),st->ps[i]) + MULT16_32_Q15(QCONST16(.05f,15),st->ps[i+1]);\n st->S[0] = MULT16_32_Q15(QCONST16(.8f,15),st->S[0]) + MULT16_32_Q15(QCONST16(.2f,15),st->ps[0]);\n st->S[N-1] = MULT16_32_Q15(QCONST16(.8f,15),st->S[N-1]) + MULT16_32_Q15(QCONST16(.2f,15),st->ps[N-1]);\n \n if (st->nb_adapt==1)\n {\n for (i=0;iSmin[i] = st->Stmp[i] = 0;\n }\n\n if (st->nb_adapt < 100)\n min_range = 15;\n else if (st->nb_adapt < 1000)\n min_range = 50;\n else if (st->nb_adapt < 10000)\n min_range = 150;\n else\n min_range = 300;\n if (st->min_count > min_range)\n {\n st->min_count = 0;\n for (i=0;iSmin[i] = MIN32(st->Stmp[i], st->S[i]);\n st->Stmp[i] = st->S[i];\n }\n } else {\n for (i=0;iSmin[i] = MIN32(st->Smin[i], st->S[i]);\n st->Stmp[i] = MIN32(st->Stmp[i], st->S[i]); \n }\n }\n for (i=0;iS[i]) > st->Smin[i])\n st->update_prob[i] = 1;\n else\n st->update_prob[i] = 0;\n /*fprintf (stderr, \"%f \", st->S[i]/st->Smin[i]);*/\n /*fprintf (stderr, \"%f \", st->update_prob[i]);*/\n }\n\n}\n\n#define NOISE_OVERCOMPENS 1.\n\nvoid speex_echo_get_residual(SpeexEchoState *st, spx_word32_t *Yout, int len);\n\nEXPORT int speex_preprocess(SpeexPreprocessState *st, spx_int16_t *x, spx_int32_t *echo)\n{\n return speex_preprocess_run(st, x);\n}\n\nEXPORT int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)\n{\n int i;\n int M;\n int N = st->ps_size;\n int N3 = 2*N - st->frame_size;\n int N4 = st->frame_size - N3;\n spx_word32_t *ps=st->ps;\n spx_word32_t Zframe;\n spx_word16_t Pframe;\n spx_word16_t beta, beta_1;\n spx_word16_t effective_echo_suppress;\n \n st->nb_adapt++;\n if (st->nb_adapt>20000)\n st->nb_adapt = 20000;\n st->min_count++;\n \n beta = MAX16(QCONST16(.03,15),DIV32_16(Q15_ONE,st->nb_adapt));\n beta_1 = Q15_ONE-beta;\n M = st->nbands;\n /* Deal with residual echo if provided */\n if (st->echo_state)\n {\n speex_echo_get_residual(st->echo_state, st->residual_echo, N);\n#ifndef FIXED_POINT\n /* If there are NaNs or ridiculous values, it'll show up in the DC and we just reset everything to zero */\n if (!(st->residual_echo[0] >=0 && st->residual_echo[0]residual_echo[i] = 0;\n }\n#endif\n for (i=0;iecho_noise[i] = MAX32(MULT16_32_Q15(QCONST16(.6f,15),st->echo_noise[i]), st->residual_echo[i]);\n filterbank_compute_bank32(st->bank, st->echo_noise, st->echo_noise+N);\n } else {\n for (i=0;iecho_noise[i] = 0;\n }\n preprocess_analysis(st, x);\n\n update_noise_prob(st);\n\n /* Noise estimation always updated for the 10 first frames */\n /*if (st->nb_adapt<10)\n {\n for (i=1;iupdate_prob[i] = 0;\n }\n */\n \n /* Update the noise estimate for the frequencies where it can be */\n for (i=0;iupdate_prob[i] || st->ps[i] < PSHR32(st->noise[i], NOISE_SHIFT))\n st->noise[i] = MAX32(EXTEND32(0),MULT16_32_Q15(beta_1,st->noise[i]) + MULT16_32_Q15(beta,SHL32(st->ps[i],NOISE_SHIFT)));\n }\n filterbank_compute_bank32(st->bank, st->noise, st->noise+N);\n\n /* Special case for first frame */\n if (st->nb_adapt==1)\n for (i=0;iold_ps[i] = ps[i];\n\n /* Compute a posteriori SNR */\n for (i=0;inoise[i],NOISE_SHIFT)) , st->echo_noise[i]) , st->reverb_estimate[i]);\n \n /* A posteriori SNR = ps/noise - 1*/\n st->post[i] = SUB16(DIV32_16_Q8(ps[i],tot_noise), QCONST16(1.f,SNR_SHIFT));\n st->post[i]=MIN16(st->post[i], QCONST16(100.f,SNR_SHIFT));\n \n /* Computing update gamma = .1 + .9*(old/(old+noise))^2 */\n gamma = QCONST16(.1f,15)+MULT16_16_Q15(QCONST16(.89f,15),SQR16_Q15(DIV32_16_Q15(st->old_ps[i],ADD32(st->old_ps[i],tot_noise))));\n \n /* A priori SNR update = gamma*max(0,post) + (1-gamma)*old/noise */\n st->prior[i] = EXTRACT16(PSHR32(ADD32(MULT16_16(gamma,MAX16(0,st->post[i])), MULT16_16(Q15_ONE-gamma,DIV32_16_Q8(st->old_ps[i],tot_noise))), 15));\n st->prior[i]=MIN16(st->prior[i], QCONST16(100.f,SNR_SHIFT));\n }\n\n /*print_vec(st->post, N+M, \"\");*/\n\n /* Recursive average of the a priori SNR. A bit smoothed for the psd components */\n st->zeta[0] = PSHR32(ADD32(MULT16_16(QCONST16(.7f,15),st->zeta[0]), MULT16_16(QCONST16(.3f,15),st->prior[0])),15);\n for (i=1;izeta[i] = PSHR32(ADD32(ADD32(ADD32(MULT16_16(QCONST16(.7f,15),st->zeta[i]), MULT16_16(QCONST16(.15f,15),st->prior[i])),\n MULT16_16(QCONST16(.075f,15),st->prior[i-1])), MULT16_16(QCONST16(.075f,15),st->prior[i+1])),15);\n for (i=N-1;izeta[i] = PSHR32(ADD32(MULT16_16(QCONST16(.7f,15),st->zeta[i]), MULT16_16(QCONST16(.3f,15),st->prior[i])),15);\n\n /* Speech probability of presence for the entire frame is based on the average filterbank a priori SNR */\n Zframe = 0;\n for (i=N;izeta[i]));\n Pframe = QCONST16(.1f,15)+MULT16_16_Q15(QCONST16(.899f,15),qcurve(DIV32_16(Zframe,st->nbands)));\n \n effective_echo_suppress = EXTRACT16(PSHR32(ADD32(MULT16_16(SUB16(Q15_ONE,Pframe), st->echo_suppress), MULT16_16(Pframe, st->echo_suppress_active)),15));\n \n compute_gain_floor(st->noise_suppress, effective_echo_suppress, st->noise+N, st->echo_noise+N, st->gain_floor+N, M);\n \n /* Compute Ephraim & Malah gain speech probability of presence for each critical band (Bark scale) \n Technically this is actually wrong because the EM gaim assumes a slightly different probability \n distribution */\n for (i=N;iprior[i]), 15), ADD16(st->prior[i], SHL32(1,SNR_SHIFT)));\n theta = MULT16_32_P15(prior_ratio, QCONST32(1.f,EXPIN_SHIFT)+SHL32(EXTEND32(st->post[i]),EXPIN_SHIFT-SNR_SHIFT));\n\n MM = hypergeom_gain(theta);\n /* Gain with bound */\n st->gain[i] = EXTRACT16(MIN32(Q15_ONE, MULT16_32_Q15(prior_ratio, MM)));\n /* Save old Bark power spectrum */\n st->old_ps[i] = MULT16_32_P15(QCONST16(.2f,15),st->old_ps[i]) + MULT16_32_P15(MULT16_16_P15(QCONST16(.8f,15),SQR16_Q15(st->gain[i])),ps[i]);\n\n P1 = QCONST16(.199f,15)+MULT16_16_Q15(QCONST16(.8f,15),qcurve (st->zeta[i]));\n q = Q15_ONE-MULT16_16_Q15(Pframe,P1);\n#ifdef FIXED_POINT\n theta = MIN32(theta, EXTEND32(32767));\n/*Q8*/tmp = MULT16_16_Q15((SHL32(1,SNR_SHIFT)+st->prior[i]),EXTRACT16(MIN32(Q15ONE,SHR32(spx_exp(-EXTRACT16(theta)),1))));\n tmp = MIN16(QCONST16(3.,SNR_SHIFT), tmp); /* Prevent overflows in the next line*/\n/*Q8*/tmp = EXTRACT16(PSHR32(MULT16_16(PDIV32_16(SHL32(EXTEND32(q),8),(Q15_ONE-q)),tmp),8));\n st->gain2[i]=DIV32_16(SHL32(EXTEND32(32767),SNR_SHIFT), ADD16(256,tmp));\n#else\n st->gain2[i]=1/(1.f + (q/(1.f-q))*(1+st->prior[i])*exp(-theta));\n#endif\n }\n /* Convert the EM gains and speech prob to linear frequency */\n filterbank_compute_psd16(st->bank,st->gain2+N, st->gain2);\n filterbank_compute_psd16(st->bank,st->gain+N, st->gain);\n \n /* Use 1 for linear gain resolution (best) or 0 for Bark gain resolution (faster) */\n if (1)\n {\n filterbank_compute_psd16(st->bank,st->gain_floor+N, st->gain_floor);\n \n /* Compute gain according to the Ephraim-Malah algorithm -- linear frequency */\n for (i=0;iprior[i]), 15), ADD16(st->prior[i], SHL32(1,SNR_SHIFT)));\n theta = MULT16_32_P15(prior_ratio, QCONST32(1.f,EXPIN_SHIFT)+SHL32(EXTEND32(st->post[i]),EXPIN_SHIFT-SNR_SHIFT));\n\n /* Optimal estimator for loudness domain */\n MM = hypergeom_gain(theta);\n /* EM gain with bound */\n g = EXTRACT16(MIN32(Q15_ONE, MULT16_32_Q15(prior_ratio, MM)));\n /* Interpolated speech probability of presence */\n p = st->gain2[i];\n \n /* Constrain the gain to be close to the Bark scale gain */\n if (MULT16_16_Q15(QCONST16(.333f,15),g) > st->gain[i])\n g = MULT16_16(3,st->gain[i]);\n st->gain[i] = g;\n \n /* Save old power spectrum */\n st->old_ps[i] = MULT16_32_P15(QCONST16(.2f,15),st->old_ps[i]) + MULT16_32_P15(MULT16_16_P15(QCONST16(.8f,15),SQR16_Q15(st->gain[i])),ps[i]);\n \n /* Apply gain floor */\n if (st->gain[i] < st->gain_floor[i])\n st->gain[i] = st->gain_floor[i];\n\n /* Exponential decay model for reverberation (unused) */\n /*st->reverb_estimate[i] = st->reverb_decay*st->reverb_estimate[i] + st->reverb_decay*st->reverb_level*st->gain[i]*st->gain[i]*st->ps[i];*/\n \n /* Take into account speech probability of presence (loudness domain MMSE estimator) */\n /* gain2 = [p*sqrt(gain)+(1-p)*sqrt(gain _floor) ]^2 */\n tmp = MULT16_16_P15(p,spx_sqrt(SHL32(EXTEND32(st->gain[i]),15))) + MULT16_16_P15(SUB16(Q15_ONE,p),spx_sqrt(SHL32(EXTEND32(st->gain_floor[i]),15)));\n st->gain2[i]=SQR16_Q15(tmp);\n\n /* Use this if you want a log-domain MMSE estimator instead */\n /*st->gain2[i] = pow(st->gain[i], p) * pow(st->gain_floor[i],1.f-p);*/\n }\n } else {\n for (i=N;igain2[i];\n st->gain[i] = MAX16(st->gain[i], st->gain_floor[i]); \n tmp = MULT16_16_P15(p,spx_sqrt(SHL32(EXTEND32(st->gain[i]),15))) + MULT16_16_P15(SUB16(Q15_ONE,p),spx_sqrt(SHL32(EXTEND32(st->gain_floor[i]),15)));\n st->gain2[i]=SQR16_Q15(tmp);\n }\n filterbank_compute_psd16(st->bank,st->gain2+N, st->gain2);\n }\n \n /* If noise suppression is off, don't apply the gain (but then why call this in the first place!) */\n if (!st->denoise_enabled)\n {\n for (i=0;igain2[i]=Q15_ONE;\n }\n \n /* Apply computed gain */\n for (i=1;ift[2*i-1] = MULT16_16_P15(st->gain2[i],st->ft[2*i-1]);\n st->ft[2*i] = MULT16_16_P15(st->gain2[i],st->ft[2*i]);\n }\n st->ft[0] = MULT16_16_P15(st->gain2[0],st->ft[0]);\n st->ft[2*N-1] = MULT16_16_P15(st->gain2[N-1],st->ft[2*N-1]);\n \n /*FIXME: This *will* not work for fixed-point */\n#ifndef FIXED_POINT\n if (st->agc_enabled)\n speex_compute_agc(st, Pframe, st->ft);\n#endif\n\n /* Inverse FFT with 1/N scaling */\n spx_ifft(st->fft_lookup, st->ft, st->frame);\n /* Scale back to original (lower) amplitude */\n for (i=0;i<2*N;i++)\n st->frame[i] = PSHR16(st->frame[i], st->frame_shift);\n\n /*FIXME: This *will* not work for fixed-point */\n#ifndef FIXED_POINT\n if (st->agc_enabled)\n {\n float max_sample=0;\n for (i=0;i<2*N;i++)\n if (fabs(st->frame[i])>max_sample)\n max_sample = fabs(st->frame[i]);\n if (max_sample>28000.f)\n {\n float damp = 28000.f/max_sample;\n for (i=0;i<2*N;i++)\n st->frame[i] *= damp;\n }\n }\n#endif\n \n /* Synthesis window (for WOLA) */\n for (i=0;i<2*N;i++)\n st->frame[i] = MULT16_16_Q15(st->frame[i], st->window[i]);\n\n /* Perform overlap and add */\n for (i=0;ioutbuf[i] + st->frame[i];\n for (i=0;iframe[N3+i];\n \n /* Update outbuf */\n for (i=0;ioutbuf[i] = st->frame[st->frame_size+i];\n\n /* FIXME: This VAD is a kludge */\n st->speech_prob = Pframe;\n if (st->vad_enabled)\n {\n if (st->speech_prob > st->speech_prob_start || (st->was_speech && st->speech_prob > st->speech_prob_continue))\n {\n st->was_speech=1;\n return 1;\n } else\n {\n st->was_speech=0;\n return 0;\n }\n } else {\n return 1;\n }\n}\n\nEXPORT void speex_preprocess_estimate_update(SpeexPreprocessState *st, spx_int16_t *x)\n{\n int i;\n int N = st->ps_size;\n int N3 = 2*N - st->frame_size;\n int M;\n spx_word32_t *ps=st->ps;\n\n M = st->nbands;\n st->min_count++;\n \n preprocess_analysis(st, x);\n\n update_noise_prob(st);\n \n for (i=1;iupdate_prob[i] || st->ps[i] < PSHR32(st->noise[i],NOISE_SHIFT))\n {\n st->noise[i] = MULT16_32_Q15(QCONST16(.95f,15),st->noise[i]) + MULT16_32_Q15(QCONST16(.05f,15),SHL32(st->ps[i],NOISE_SHIFT));\n }\n }\n\n for (i=0;ioutbuf[i] = MULT16_16_Q15(x[st->frame_size-N3+i],st->window[st->frame_size+i]);\n\n /* Save old power spectrum */\n for (i=0;iold_ps[i] = ps[i];\n\n for (i=0;ireverb_estimate[i] = MULT16_32_Q15(st->reverb_decay, st->reverb_estimate[i]);\n}\n\n\nEXPORT int speex_preprocess_ctl(SpeexPreprocessState *state, int request, void *ptr)\n{\n int i;\n SpeexPreprocessState *st;\n st=(SpeexPreprocessState*)state;\n switch(request)\n {\n case SPEEX_PREPROCESS_SET_DENOISE:\n st->denoise_enabled = (*(spx_int32_t*)ptr);\n break;\n case SPEEX_PREPROCESS_GET_DENOISE:\n (*(spx_int32_t*)ptr) = st->denoise_enabled;\n break;\n#ifndef FIXED_POINT\n case SPEEX_PREPROCESS_SET_AGC:\n st->agc_enabled = (*(spx_int32_t*)ptr);\n break;\n case SPEEX_PREPROCESS_GET_AGC:\n (*(spx_int32_t*)ptr) = st->agc_enabled;\n break;\n#ifndef DISABLE_FLOAT_API\n case SPEEX_PREPROCESS_SET_AGC_LEVEL:\n st->agc_level = (*(float*)ptr);\n if (st->agc_level<1)\n st->agc_level=1;\n if (st->agc_level>32768)\n st->agc_level=32768;\n break;\n case SPEEX_PREPROCESS_GET_AGC_LEVEL:\n (*(float*)ptr) = st->agc_level;\n break;\n#endif /* #ifndef DISABLE_FLOAT_API */\n case SPEEX_PREPROCESS_SET_AGC_INCREMENT:\n st->max_increase_step = exp(0.11513f * (*(spx_int32_t*)ptr)*st->frame_size / st->sampling_rate);\n break;\n case SPEEX_PREPROCESS_GET_AGC_INCREMENT:\n (*(spx_int32_t*)ptr) = floor(.5+8.6858*log(st->max_increase_step)*st->sampling_rate/st->frame_size);\n break;\n case SPEEX_PREPROCESS_SET_AGC_DECREMENT:\n st->max_decrease_step = exp(0.11513f * (*(spx_int32_t*)ptr)*st->frame_size / st->sampling_rate);\n break;\n case SPEEX_PREPROCESS_GET_AGC_DECREMENT:\n (*(spx_int32_t*)ptr) = floor(.5+8.6858*log(st->max_decrease_step)*st->sampling_rate/st->frame_size);\n break;\n case SPEEX_PREPROCESS_SET_AGC_MAX_GAIN:\n st->max_gain = exp(0.11513f * (*(spx_int32_t*)ptr));\n break;\n case SPEEX_PREPROCESS_GET_AGC_MAX_GAIN:\n (*(spx_int32_t*)ptr) = floor(.5+8.6858*log(st->max_gain));\n break;\n#endif\n case SPEEX_PREPROCESS_SET_VAD:\n speex_warning(\"The VAD has been replaced by a hack pending a complete rewrite\");\n st->vad_enabled = (*(spx_int32_t*)ptr);\n break;\n case SPEEX_PREPROCESS_GET_VAD:\n (*(spx_int32_t*)ptr) = st->vad_enabled;\n break;\n \n case SPEEX_PREPROCESS_SET_DEREVERB:\n st->dereverb_enabled = (*(spx_int32_t*)ptr);\n for (i=0;ips_size;i++)\n st->reverb_estimate[i]=0;\n break;\n case SPEEX_PREPROCESS_GET_DEREVERB:\n (*(spx_int32_t*)ptr) = st->dereverb_enabled;\n break;\n\n case SPEEX_PREPROCESS_SET_DEREVERB_LEVEL:\n /* FIXME: Re-enable when de-reverberation is actually enabled again */\n /*st->reverb_level = (*(float*)ptr);*/\n break;\n case SPEEX_PREPROCESS_GET_DEREVERB_LEVEL:\n /* FIXME: Re-enable when de-reverberation is actually enabled again */\n /*(*(float*)ptr) = st->reverb_level;*/\n break;\n \n case SPEEX_PREPROCESS_SET_DEREVERB_DECAY:\n /* FIXME: Re-enable when de-reverberation is actually enabled again */\n /*st->reverb_decay = (*(float*)ptr);*/\n break;\n case SPEEX_PREPROCESS_GET_DEREVERB_DECAY:\n /* FIXME: Re-enable when de-reverberation is actually enabled again */\n /*(*(float*)ptr) = st->reverb_decay;*/\n break;\n\n case SPEEX_PREPROCESS_SET_PROB_START:\n *(spx_int32_t*)ptr = MIN32(100,MAX32(0, *(spx_int32_t*)ptr));\n st->speech_prob_start = DIV32_16(MULT16_16(Q15ONE,*(spx_int32_t*)ptr), 100);\n break;\n case SPEEX_PREPROCESS_GET_PROB_START:\n (*(spx_int32_t*)ptr) = MULT16_16_Q15(st->speech_prob_start, 100);\n break;\n\n case SPEEX_PREPROCESS_SET_PROB_CONTINUE:\n *(spx_int32_t*)ptr = MIN32(100,MAX32(0, *(spx_int32_t*)ptr));\n st->speech_prob_continue = DIV32_16(MULT16_16(Q15ONE,*(spx_int32_t*)ptr), 100);\n break;\n case SPEEX_PREPROCESS_GET_PROB_CONTINUE:\n (*(spx_int32_t*)ptr) = MULT16_16_Q15(st->speech_prob_continue, 100);\n break;\n\n case SPEEX_PREPROCESS_SET_NOISE_SUPPRESS:\n st->noise_suppress = -ABS(*(spx_int32_t*)ptr);\n break;\n case SPEEX_PREPROCESS_GET_NOISE_SUPPRESS:\n (*(spx_int32_t*)ptr) = st->noise_suppress;\n break;\n case SPEEX_PREPROCESS_SET_ECHO_SUPPRESS:\n st->echo_suppress = -ABS(*(spx_int32_t*)ptr);\n break;\n case SPEEX_PREPROCESS_GET_ECHO_SUPPRESS:\n (*(spx_int32_t*)ptr) = st->echo_suppress;\n break;\n case SPEEX_PREPROCESS_SET_ECHO_SUPPRESS_ACTIVE:\n st->echo_suppress_active = -ABS(*(spx_int32_t*)ptr);\n break;\n case SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE:\n (*(spx_int32_t*)ptr) = st->echo_suppress_active;\n break;\n case SPEEX_PREPROCESS_SET_ECHO_STATE:\n st->echo_state = (SpeexEchoState*)ptr;\n break;\n case SPEEX_PREPROCESS_GET_ECHO_STATE:\n (*(SpeexEchoState**)ptr) = (SpeexEchoState*)st->echo_state;\n break;\n#ifndef FIXED_POINT\n case SPEEX_PREPROCESS_GET_AGC_LOUDNESS:\n (*(spx_int32_t*)ptr) = pow(st->loudness, 1.0/LOUDNESS_EXP);\n break;\n case SPEEX_PREPROCESS_GET_AGC_GAIN:\n (*(spx_int32_t*)ptr) = floor(.5+8.6858*log(st->agc_gain));\n break;\n#endif\n case SPEEX_PREPROCESS_GET_PSD_SIZE:\n case SPEEX_PREPROCESS_GET_NOISE_PSD_SIZE:\n (*(spx_int32_t*)ptr) = st->ps_size;\n break;\n case SPEEX_PREPROCESS_GET_PSD:\n for(i=0;ips_size;i++)\n \t((spx_int32_t *)ptr)[i] = (spx_int32_t) st->ps[i];\n break;\n case SPEEX_PREPROCESS_GET_NOISE_PSD:\n for(i=0;ips_size;i++)\n \t((spx_int32_t *)ptr)[i] = (spx_int32_t) PSHR32(st->noise[i], NOISE_SHIFT);\n break;\n case SPEEX_PREPROCESS_GET_PROB:\n (*(spx_int32_t*)ptr) = MULT16_16_Q15(st->speech_prob, 100);\n break;\n#ifndef FIXED_POINT\n case SPEEX_PREPROCESS_SET_AGC_TARGET:\n st->agc_level = (*(spx_int32_t*)ptr);\n if (st->agc_level<1)\n st->agc_level=1;\n if (st->agc_level>32768)\n st->agc_level=32768;\n break;\n case SPEEX_PREPROCESS_GET_AGC_TARGET:\n (*(spx_int32_t*)ptr) = st->agc_level;\n break;\n#endif\n default:\n speex_warning_int(\"Unknown speex_preprocess_ctl request: \", request);\n return -1;\n }\n return 0;\n}\n\n#ifdef FIXED_DEBUG\nlong long spx_mips=0;\n#endif\n\n"} +{"text": "\n\n\n \n \n 4.15. Cultural and other non-algorithmic gismu\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n
Chapter 4. The Shape Of Words To Come: Lojban Morphology
\n \n \n \n \n \n
\n Prev: Section 4.14\n \n Next: Section 4.16\n
\n
\n \n \n
\n
\n
\n
\n
\n

4.15. Cultural and other non-algorithmic gismu

\n
\n
\n
\n

The following gismu were not made by the gismu creation algorithm. They are, in effect, coined words similar to fu'ivla. They are exceptions to the otherwise mandatory gismu creation algorithm where there was sufficient justification for such exceptions. Except for the small metric prefixes and the assignable predicates beginning with \n brod-, they all end in the letter \n o, which is otherwise a rare letter in Lojban gismu.

\n

The following gismu represent concepts that are sufficiently unique to Lojban that they were either coined from combining forms of other gismu, or else made up out of whole cloth. These gismu are thus conceptually similar to lujvo even though they are only five letters long; however, unlike lujvo, they have rafsi assigned to them for use in building more complex lujvo. Assigning gismu to these concepts helps to keep the resulting lujvo reasonably short.

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n broda\n \n \n \n \n

1st assignable predicate

\n
\n \n \n \n \n brode\n \n \n \n \n

2nd assignable predicate

\n
\n \n \n \n \n brodi\n \n \n \n \n

3rd assignable predicate

\n
\n \n \n \n \n brodo\n \n \n \n \n

4th assignable predicate

\n
\n \n \n \n \n brodu\n \n \n \n \n

5th assignable predicate

\n
\n \n \n \n \n cmavo\n \n \n \n \n

structure word (from cmalu valsi)

\n
\n \n \n \n \n lojbo\n \n \n \n \n

Lojbanic (from logji bangu)

\n
\n \n \n \n \n lujvo\n \n \n \n \n

compound word (from pluja valsi)

\n
\n \n \n \n \n mekso\n \n \n \n \n

Mathematical EXpression

\n
\n
\n

It is important to understand that even though \n cmavo, \n lojbo, and \n lujvo were made up from parts of other gismu, they are now full-fledged gismu used in exactly the same way as all other gismu, both in grammar and in word formation.

\n

The following three groups of gismu represent concepts drawn from the international language of science and mathematics. They are used for concepts that are represented in most languages by a root which is recognized internationally.

\n

Small metric prefixes (values less than 1):

\n

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n decti\n \n \n \n .1deci
\n \n \n \n \n centi\n \n \n \n .01centi
\n \n \n \n \n milti\n \n \n \n .001milli
\n \n \n \n \n mikri\n \n \n \n \n 10-6\n micro
\n \n \n \n \n nanvi\n \n \n \n \n 10-9\n nano
\n \n \n \n \n picti\n \n \n \n \n 10-12\n pico
\n \n \n \n \n femti\n \n \n \n \n 10-15\n femto
\n \n \n \n \n xatsi\n \n \n \n \n 10-18\n atto
\n \n \n \n \n zepti\n \n \n \n \n 10-21\n zepto
\n \n \n \n \n gocti\n \n \n \n \n 10-24\n yocto
\n
\n

Large metric prefixes (values greater than 1):

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n dekto\n \n \n \n 10deka
\n \n \n \n \n xecto\n \n \n \n 100hecto
\n \n \n \n \n kilto\n \n \n \n 1000kilo
\n \n \n \n \n megdo\n \n \n \n \n 106\n mega
\n \n \n \n \n gigdo\n \n \n \n \n 109\n giga
\n \n \n \n \n terto\n \n \n \n \n 1012\n tera
\n \n \n \n \n petso\n \n \n \n \n 1015\n peta
\n \n \n \n \n xexso\n \n \n \n \n 1018\n exa
\n \n \n \n \n zetro\n \n \n \n \n 1021\n zetta
\n \n \n \n \n gotro\n \n \n \n \n 1024\n yotta
\n
\n

Other scientific or mathematical terms:

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n delno\n \n \n \n \n

candela

\n
\n \n \n \n \n kelvo\n \n \n \n \n

kelvin

\n
\n \n \n \n \n molro\n \n \n \n \n

mole

\n
\n \n \n \n \n radno\n \n \n \n \n

radian

\n
\n \n \n \n \n sinso\n \n \n \n \n

sine

\n
\n \n \n \n \n stero\n \n \n \n \n

steradian

\n
\n \n \n \n \n tanjo\n \n \n \n \n

tangent

\n
\n \n \n \n \n xampo\n \n \n \n \n

ampere

\n
\n
\n

The gismu \n sinso and \n tanjo were only made non-algorithmically because they were identical (having been borrowed from a common source) in all the dictionaries that had translations. The other terms in this group are units in the international metric system; some metric units, however, were made by the ordinary process (usually because they are different in Chinese).

\n

Finally, there are the cultural gismu, which are also borrowed, but by modifying a word from one particular language, instead of using the multi-lingual gismu creation algorithm. Cultural gismu are used for words that have local importance to a particular culture; other cultures or languages may have no word for the concept at all, or may borrow the word from its home culture, just as Lojban does. In such a case, the gismu algorithm, which uses weighted averages, doesn't accurately represent the frequency of usage of the individual concept. Cultural gismu are not even required to be based on the six major languages.

\n

The six Lojban source languages:

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n jungo\n \n \n \n \n

Chinese (from Zhong 1 guo 2)

\n
\n \n \n \n \n glico\n \n \n \n \n

English

\n
\n \n \n \n \n xindo\n \n \n \n \n

Hindi

\n
\n \n \n \n \n spano\n \n \n \n \n

Spanish

\n
\n \n \n \n \n rusko\n \n \n \n \n

Russian

\n
\n \n \n \n \n xrabo\n \n \n \n \n

Arabic

\n
\n
\n

Seven other widely spoken languages that were on the list of candidates for gismu-making, but weren't used:

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n bengo\n \n \n \n \n

Bengali

\n
\n \n \n \n \n porto\n \n \n \n \n

Portuguese

\n
\n \n \n \n \n baxso\n \n \n \n \n

Bahasa Melayu/Bahasa Indonesia

\n
\n \n \n \n \n ponjo\n \n \n \n \n

Japanese (from Nippon)

\n
\n \n \n \n \n dotco\n \n \n \n \n

German (from Deutsch)

\n
\n \n \n \n \n fraso\n \n \n \n \n

French (from « Français »)

\n
\n \n \n \n \n xurdo\n \n \n \n \n

Urdu

\n
\n
\n

(Urdu and Hindi began as the same language with different writing systems, but have now become somewhat different, principally in borrowed vocabulary. Urdu-speakers were counted along with Hindi-speakers when weights were assigned for gismu-making purposes.)

\n

Countries with a large number of speakers of any of the above languages (where the meaning of large is dependent on the specific language):

\n

\n

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
English:
\n \n \n \n \n merko\n \n \n \n American
\n \n \n \n \n brito\n \n \n \n British
\n \n \n \n \n skoto\n \n \n \n Scottish
\n \n \n \n \n sralo\n \n \n \n Australian
\n \n \n \n \n kadno\n \n \n \n Canadian
\n
\n

\n

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
Spanish:
\n \n \n \n \n gento\n \n \n \n Argentinian
\n \n \n \n \n mexno\n \n \n \n Mexican
\n
\n

\n

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
Russian:
\n \n \n \n \n softo\n \n \n \n Soviet/USSR
\n \n \n \n \n vukro\n \n \n \n Ukrainian
\n
\n

\n

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Arabic:
\n \n \n \n \n filso\n \n \n \n Palestinian
\n \n \n \n \n jerxo\n \n \n \n Algerian
\n \n \n \n \n jordo\n \n \n \n Jordanian
\n \n \n \n \n libjo\n \n \n \n Libyan
\n \n \n \n \n lubno\n \n \n \n Lebanese
\n \n \n \n \n misro\n \n \n \n Egyptian (from Mizraim)
\n \n \n \n \n morko\n \n \n \n Moroccan
\n \n \n \n \n rakso\n \n \n \n Iraqi
\n \n \n \n \n sadjo\n \n \n \n Saudi
\n \n \n \n \n sirxo\n \n \n \n Syrian
\n
\n

\n

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
Bahasa Melayu/Bahasa Indonesia:
\n \n \n \n \n bindo\n \n \n \n Indonesian
\n \n \n \n \n meljo\n \n \n \n Malaysian
\n
\n

\n

\n
\n \n \n \n \n \n \n \n \n
Portuguese:
\n \n \n \n \n brazo\n \n \n \n Brazilian
\n
\n

\n

\n
\n \n \n \n \n \n \n \n \n
Urdu:
\n \n \n \n \n kisto\n \n \n \n Pakistani
\n
\n

\n

\n

The continents (and oceanic regions) of the Earth:

\n

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n bemro\n \n \n \n \n

North American (from berti merko)

\n
\n \n \n \n \n dzipo\n \n \n \n \n

Antarctican (from cadzu cipni)

\n
\n \n \n \n \n ketco\n \n \n \n \n

South American (from Quechua)

\n
\n \n \n \n \n friko\n \n \n \n \n

African

\n
\n \n \n \n \n polno\n \n \n \n \n

Polynesian/Oceanic

\n
\n \n \n \n \n ropno\n \n \n \n \n

European

\n
\n \n \n \n \n xazdo\n \n \n \n \n

Asiatic

\n
\n
\n

A few smaller but historically important cultures:

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n latmo\n \n \n \n \n

Latin/Roman

\n
\n \n \n \n \n srito\n \n \n \n \n

Sanskrit

\n
\n \n \n \n \n xebro\n \n \n \n \n

Hebrew/Israeli/Jewish

\n
\n \n \n \n \n xelso\n \n \n \n \n

Greek (from «Hellas»)

\n
\n
\n

Major world religions:

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n budjo\n \n \n \n \n

Buddhist

\n
\n \n \n \n \n dadjo\n \n \n \n \n

Taoist

\n
\n \n \n \n \n muslo\n \n \n \n \n

Islamic/Moslem

\n
\n \n \n \n \n xriso\n \n \n \n \n

Christian

\n
\n
\n

A few terms that cover multiple groups of the above:

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n jegvo\n \n \n \n \n

Jehovist (Judeo-Christian-Moslem)

\n
\n \n \n \n \n semto\n \n \n \n \n

Semitic

\n
\n \n \n \n \n slovo\n \n \n \n \n

Slavic

\n
\n \n \n \n \n xispo\n \n \n \n \n

Hispanic (New World Spanish)

\n
\n
\n
\n
\n
\n \n \n \n \n
Chapter 4. The Shape Of Words To Come: Lojban Morphology
\n \n \n \n \n \n
\n Prev: Section 4.14\n \n Next: Section 4.16\n
\n
\n \n \n \n\n"} +{"text": "/**\n * Copyright (C) 2018-present MongoDB, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\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 * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n *\n * As a special exception, the copyright holders give permission to link the\n * code of portions of this program with the OpenSSL library under certain\n * conditions as described in each individual source file and distribute\n * linked combinations including the program with the OpenSSL library. You\n * must comply with the Server Side Public License in all respects for\n * all of the code used other than as permitted herein. If you modify file(s)\n * with this exception, you may extend this exception to your version of the\n * file(s), but you are not obligated to do so. If you do not wish to do so,\n * delete this exception statement from your version. If you delete this\n * exception statement from all source files in the program, then also delete\n * it in the license file.\n */\n\n#include \"mongo/platform/basic.h\"\n\n#include \"mongo/bson/json.h\"\n#include \"mongo/db/matcher/matcher.h\"\n#include \"mongo/db/matcher/schema/expression_internal_schema_eq.h\"\n#include \"mongo/db/pipeline/expression_context_for_test.h\"\n#include \"mongo/unittest/unittest.h\"\n\nnamespace mongo {\nnamespace {\n\nTEST(InternalSchemaEqMatchExpression, CorrectlyMatchesScalarElements) {\n BSONObj numberOperand = BSON(\"a\" << 5);\n\n InternalSchemaEqMatchExpression eqNumberOperand(\"a\", numberOperand[\"a\"]);\n ASSERT_TRUE(eqNumberOperand.matchesBSON(BSON(\"a\" << 5.0)));\n ASSERT_FALSE(eqNumberOperand.matchesBSON(BSON(\"a\" << 6)));\n\n BSONObj stringOperand = BSON(\"a\"\n << \"str\");\n\n InternalSchemaEqMatchExpression eqStringOperand(\"a\", stringOperand[\"a\"]);\n ASSERT_TRUE(eqStringOperand.matchesBSON(BSON(\"a\"\n << \"str\")));\n ASSERT_FALSE(eqStringOperand.matchesBSON(BSON(\"a\"\n << \"string\")));\n}\n\nTEST(InternalSchemaEqMatchExpression, CorrectlyMatchesArrayElement) {\n BSONObj operand = BSON(\"a\" << BSON_ARRAY(\"b\" << 5));\n\n InternalSchemaEqMatchExpression eq(\"a\", operand[\"a\"]);\n ASSERT_TRUE(eq.matchesBSON(BSON(\"a\" << BSON_ARRAY(\"b\" << 5))));\n ASSERT_FALSE(eq.matchesBSON(BSON(\"a\" << BSON_ARRAY(5 << \"b\"))));\n ASSERT_FALSE(eq.matchesBSON(BSON(\"a\" << BSON_ARRAY(\"b\" << 5 << 5))));\n ASSERT_FALSE(eq.matchesBSON(BSON(\"a\" << BSON_ARRAY(\"b\" << 6))));\n}\n\nTEST(InternalSchemaEqMatchExpression, CorrectlyMatchesNullElement) {\n BSONObj operand = BSON(\"a\" << BSONNULL);\n\n InternalSchemaEqMatchExpression eq(\"a\", operand[\"a\"]);\n ASSERT_TRUE(eq.matchesBSON(BSON(\"a\" << BSONNULL)));\n ASSERT_FALSE(eq.matchesBSON(BSON(\"a\" << 4)));\n}\n\nTEST(InternalSchemaEqMatchExpression, NullElementDoesNotMatchMissing) {\n BSONObj operand = BSON(\"a\" << BSONNULL);\n\n InternalSchemaEqMatchExpression eq(\"a\", operand[\"a\"]);\n ASSERT_FALSE(eq.matchesBSON(BSONObj()));\n ASSERT_FALSE(eq.matchesBSON(BSON(\"b\" << 4)));\n}\n\nTEST(InternalSchemaEqMatchExpression, NullElementDoesNotMatchUndefinedOrMissing) {\n BSONObj operand = BSON(\"a\" << BSONNULL);\n\n InternalSchemaEqMatchExpression eq(\"a\", operand[\"a\"]);\n ASSERT_FALSE(eq.matchesBSON(BSONObj()));\n ASSERT_FALSE(eq.matchesBSON(fromjson(\"{a: undefined}\")));\n}\n\nTEST(InternalSchemaEqMatchExpression, DoesNotTraverseLeafArrays) {\n BSONObj operand = BSON(\"a\" << 5);\n InternalSchemaEqMatchExpression eq(\"a\", operand[\"a\"]);\n ASSERT_TRUE(eq.matchesBSON(BSON(\"a\" << 5.0)));\n ASSERT_FALSE(eq.matchesBSON(BSON(\"a\" << BSON_ARRAY(5))));\n}\n\nTEST(InternalSchemaEqMatchExpression, MatchesObjectsIndependentOfFieldOrder) {\n BSONObj operand = fromjson(\"{a: {b: 1, c: {d: 2, e: 3}}}\");\n\n InternalSchemaEqMatchExpression eq(\"a\", operand[\"a\"]);\n ASSERT_TRUE(eq.matchesBSON(fromjson(\"{a: {b: 1, c: {d: 2, e: 3}}}\")));\n ASSERT_TRUE(eq.matchesBSON(fromjson(\"{a: {c: {e: 3, d: 2}, b: 1}}\")));\n ASSERT_FALSE(eq.matchesBSON(fromjson(\"{a: {b: 1, c: {d: 2}, e: 3}}\")));\n ASSERT_FALSE(eq.matchesBSON(fromjson(\"{a: {b: 2, c: {d: 2}}}\")));\n ASSERT_FALSE(eq.matchesBSON(fromjson(\"{a: {b: 1}}\")));\n}\n\nTEST(InternalSchemaEqMatchExpression, EquivalentReturnsCorrectResults) {\n auto query = fromjson(R\"(\n {a: {$_internalSchemaEq: {\n b: {c: 1, d: 1}\n }}})\");\n boost::intrusive_ptr expCtx(new ExpressionContextForTest());\n Matcher eqExpr(query, expCtx);\n\n query = fromjson(R\"(\n {a: {$_internalSchemaEq: {\n b: {d: 1, c: 1}\n }}})\");\n Matcher eqExprEq(query, expCtx);\n ASSERT_TRUE(eqExpr.getMatchExpression()->equivalent(eqExprEq.getMatchExpression()));\n\n query = fromjson(R\"(\n {a: {$_internalSchemaEq: {\n b: {d: 1}\n }}})\");\n Matcher eqExprNotEq(query, expCtx);\n ASSERT_FALSE(eqExpr.getMatchExpression()->equivalent(eqExprNotEq.getMatchExpression()));\n}\n\nTEST(InternalSchemaEqMatchExpression, EquivalentToClone) {\n auto query = fromjson(\"{a: {$_internalSchemaEq: {a:1, b: {c: 1, d: [1]}}}}\");\n boost::intrusive_ptr expCtx(new ExpressionContextForTest());\n Matcher rootDocEq(query, expCtx);\n auto clone = rootDocEq.getMatchExpression()->shallowClone();\n ASSERT_TRUE(rootDocEq.getMatchExpression()->equivalent(clone.get()));\n}\n} // namespace\n} // namespace mongo\n"} +{"text": "#!/usr/bin/env python\n# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai\n\n\n__license__ = 'GPL v3'\n__copyright__ = '2010, Kovid Goyal '\n__docformat__ = 'restructuredtext en'\n\nimport os, weakref, shutil\n\nfrom PyQt5.Qt import (QDialog, QVBoxLayout, QHBoxLayout, QRadioButton, QFrame,\n QPushButton, QLabel, QGroupBox, QGridLayout, QIcon, QSize, QTimer)\n\nfrom calibre import as_unicode\nfrom calibre.constants import ismacos\nfrom calibre.gui2 import error_dialog, question_dialog, open_local_file, gprefs\nfrom calibre.gui2.actions import InterfaceAction\nfrom calibre.ptempfile import (PersistentTemporaryDirectory,\n PersistentTemporaryFile)\nfrom calibre.utils.config import prefs, tweaks\nfrom polyglot.builtins import unicode_type\n\n\nclass UnpackBook(QDialog):\n\n def __init__(self, parent, book_id, fmts, db):\n QDialog.__init__(self, parent)\n self.setWindowIcon(QIcon(I('unpack-book.png')))\n self.book_id, self.fmts, self.db_ref = book_id, fmts, weakref.ref(db)\n self._exploded = None\n self._cleanup_dirs = []\n self._cleanup_files = []\n\n self.setup_ui()\n self.setWindowTitle(_('Unpack book') + ' - ' + db.title(book_id,\n index_is_id=True))\n\n button = self.fmt_choice_buttons[0]\n button_map = {unicode_type(x.text()):x for x in self.fmt_choice_buttons}\n of = prefs['output_format'].upper()\n df = tweaks.get('default_tweak_format', None)\n lf = gprefs.get('last_tweak_format', None)\n if df and df.lower() == 'remember' and lf in button_map:\n button = button_map[lf]\n elif df and df.upper() in button_map:\n button = button_map[df.upper()]\n elif of in button_map:\n button = button_map[of]\n button.setChecked(True)\n\n self.init_state()\n for button in self.fmt_choice_buttons:\n button.toggled.connect(self.init_state)\n\n def init_state(self, *args):\n self._exploded = None\n self.preview_button.setEnabled(False)\n self.rebuild_button.setEnabled(False)\n self.explode_button.setEnabled(True)\n\n def setup_ui(self): # {{{\n self._g = g = QHBoxLayout(self)\n self.setLayout(g)\n self._l = l = QVBoxLayout()\n g.addLayout(l)\n\n fmts = sorted(x.upper() for x in self.fmts)\n self.fmt_choice_box = QGroupBox(_('Choose the format to unpack:'), self)\n self._fl = fl = QHBoxLayout()\n self.fmt_choice_box.setLayout(self._fl)\n self.fmt_choice_buttons = [QRadioButton(y, self) for y in fmts]\n for x in self.fmt_choice_buttons:\n fl.addWidget(x, stretch=10 if x is self.fmt_choice_buttons[-1] else\n 0)\n l.addWidget(self.fmt_choice_box)\n self.fmt_choice_box.setVisible(len(fmts) > 1)\n\n self.help_label = QLabel(_('''\\\n

About Unpack book

\n

Unpack book allows you to fine tune the appearance of an e-book by\n making small changes to its internals. In order to use Unpack book,\n you need to know a little bit about HTML and CSS, technologies that\n are used in e-books. Follow the steps:

\n
\n
    \n
  1. Click \"Explode book\": This will \"explode\" the book into its\n individual internal components.
  2. \n
  3. Right click on any individual file and select \"Open with...\" to\n edit it in your favorite text editor.
  4. \n
  5. When you are done: close the file browser window\n and the editor windows you used to make your tweaks. Then click\n the \"Rebuild book\" button, to update the book in your calibre\n library.
  6. \n
'''))\n self.help_label.setWordWrap(True)\n self._fr = QFrame()\n self._fr.setFrameShape(QFrame.VLine)\n g.addWidget(self._fr)\n g.addWidget(self.help_label)\n\n self._b = b = QGridLayout()\n left, top, right, bottom = b.getContentsMargins()\n top += top\n b.setContentsMargins(left, top, right, bottom)\n l.addLayout(b, stretch=10)\n\n self.explode_button = QPushButton(QIcon(I('wizard.png')), _('&Explode book'))\n self.preview_button = QPushButton(QIcon(I('view.png')), _('&Preview book'))\n self.cancel_button = QPushButton(QIcon(I('window-close.png')), _('&Cancel'))\n self.rebuild_button = QPushButton(QIcon(I('exec.png')), _('&Rebuild book'))\n\n self.explode_button.setToolTip(\n _('Explode the book to edit its components'))\n self.preview_button.setToolTip(\n _('Preview the result of your changes'))\n self.cancel_button.setToolTip(\n _('Abort without saving any changes'))\n self.rebuild_button.setToolTip(\n _('Save your changes and update the book in the calibre library'))\n\n a = b.addWidget\n a(self.explode_button, 0, 0, 1, 1)\n a(self.preview_button, 0, 1, 1, 1)\n a(self.cancel_button, 1, 0, 1, 1)\n a(self.rebuild_button, 1, 1, 1, 1)\n\n for x in ('explode', 'preview', 'cancel', 'rebuild'):\n getattr(self, x+'_button').clicked.connect(getattr(self, x))\n\n self.msg = QLabel('dummy', self)\n self.msg.setVisible(False)\n self.msg.setStyleSheet('''\n QLabel {\n text-align: center;\n background-color: white;\n color: black;\n border-width: 1px;\n border-style: solid;\n border-radius: 20px;\n font-size: x-large;\n font-weight: bold;\n }\n ''')\n\n self.resize(self.sizeHint() + QSize(40, 10))\n # }}}\n\n def show_msg(self, msg):\n self.msg.setText(msg)\n self.msg.resize(self.size() - QSize(50, 25))\n self.msg.move((self.width() - self.msg.width())//2,\n (self.height() - self.msg.height())//2)\n self.msg.setVisible(True)\n\n def hide_msg(self):\n self.msg.setVisible(False)\n\n def explode(self):\n self.show_msg(_('Exploding, please wait...'))\n if len(self.fmt_choice_buttons) > 1:\n gprefs.set('last_tweak_format', self.current_format.upper())\n QTimer.singleShot(5, self.do_explode)\n\n def ask_question(self, msg):\n return question_dialog(self, _('Are you sure?'), msg)\n\n def do_explode(self):\n from calibre.ebooks.tweak import get_tools, Error, WorkerError\n tdir = PersistentTemporaryDirectory('_tweak_explode')\n self._cleanup_dirs.append(tdir)\n det_msg = None\n try:\n src = self.db.format(self.book_id, self.current_format,\n index_is_id=True, as_path=True)\n self._cleanup_files.append(src)\n exploder = get_tools(self.current_format)[0]\n opf = exploder(src, tdir, question=self.ask_question)\n except WorkerError as e:\n det_msg = e.orig_tb\n except Error as e:\n return error_dialog(self, _('Failed to unpack'),\n (_('Could not explode the %s file.')%self.current_format) + ' ' + as_unicode(e), show=True)\n except:\n import traceback\n det_msg = traceback.format_exc()\n finally:\n self.hide_msg()\n\n if det_msg is not None:\n return error_dialog(self, _('Failed to unpack'),\n _('Could not explode the %s file. Click \"Show Details\" for '\n 'more information.')%self.current_format, det_msg=det_msg,\n show=True)\n\n if opf is None:\n # The question was answered with No\n return\n\n self._exploded = tdir\n self.explode_button.setEnabled(False)\n self.preview_button.setEnabled(True)\n self.rebuild_button.setEnabled(True)\n open_local_file(tdir)\n\n def rebuild_it(self):\n from calibre.ebooks.tweak import get_tools, WorkerError\n src_dir = self._exploded\n det_msg = None\n of = PersistentTemporaryFile('_tweak_rebuild.'+self.current_format.lower())\n of.close()\n of = of.name\n self._cleanup_files.append(of)\n try:\n rebuilder = get_tools(self.current_format)[1]\n rebuilder(src_dir, of)\n except WorkerError as e:\n det_msg = e.orig_tb\n except:\n import traceback\n det_msg = traceback.format_exc()\n finally:\n self.hide_msg()\n\n if det_msg is not None:\n error_dialog(self, _('Failed to rebuild file'),\n _('Failed to rebuild %s. For more information, click '\n '\"Show details\".')%self.current_format,\n det_msg=det_msg, show=True)\n return None\n\n return of\n\n def preview(self):\n self.show_msg(_('Rebuilding, please wait...'))\n QTimer.singleShot(5, self.do_preview)\n\n def do_preview(self):\n rebuilt = self.rebuild_it()\n if rebuilt is not None:\n self.parent().iactions['View']._view_file(rebuilt)\n\n def rebuild(self):\n self.show_msg(_('Rebuilding, please wait...'))\n QTimer.singleShot(5, self.do_rebuild)\n\n def do_rebuild(self):\n rebuilt = self.rebuild_it()\n if rebuilt is not None:\n fmt = os.path.splitext(rebuilt)[1][1:].upper()\n with open(rebuilt, 'rb') as f:\n self.db.add_format(self.book_id, fmt, f, index_is_id=True)\n self.accept()\n\n def cancel(self):\n self.reject()\n\n def cleanup(self):\n if ismacos and self._exploded:\n try:\n import appscript\n self.finder = appscript.app('Finder')\n self.finder.Finder_windows[os.path.basename(self._exploded)].close()\n except:\n pass\n\n for f in self._cleanup_files:\n try:\n os.remove(f)\n except:\n pass\n\n for d in self._cleanup_dirs:\n try:\n shutil.rmtree(d)\n except:\n pass\n\n @property\n def db(self):\n return self.db_ref()\n\n @property\n def current_format(self):\n for b in self.fmt_choice_buttons:\n if b.isChecked():\n return unicode_type(b.text())\n\n\nclass UnpackBookAction(InterfaceAction):\n\n name = 'Unpack Book'\n action_spec = (_('Unpack book'), 'unpack-book.png',\n _('Unpack books in the EPUB, AZW3, HTMLZ formats into their individual components'), 'U')\n dont_add_to = frozenset(['context-menu-device'])\n action_type = 'current'\n\n accepts_drops = True\n\n def accept_enter_event(self, event, mime_data):\n if mime_data.hasFormat(\"application/calibre+from_library\"):\n return True\n return False\n\n def accept_drag_move_event(self, event, mime_data):\n if mime_data.hasFormat(\"application/calibre+from_library\"):\n return True\n return False\n\n def drop_event(self, event, mime_data):\n mime = 'application/calibre+from_library'\n if mime_data.hasFormat(mime):\n self.dropped_ids = tuple(map(int, mime_data.data(mime).data().split()))\n QTimer.singleShot(1, self.do_drop)\n return True\n return False\n\n def do_drop(self):\n book_ids = self.dropped_ids\n del self.dropped_ids\n if book_ids:\n self.do_tweak(book_ids[0])\n\n def genesis(self):\n self.qaction.triggered.connect(self.tweak_book)\n\n def tweak_book(self):\n row = self.gui.library_view.currentIndex()\n if not row.isValid():\n return error_dialog(self.gui, _('Cannot unpack book'),\n _('No book selected'), show=True)\n\n book_id = self.gui.library_view.model().id(row)\n self.do_tweak(book_id)\n\n def do_tweak(self, book_id):\n db = self.gui.library_view.model().db\n fmts = db.formats(book_id, index_is_id=True) or ''\n fmts = [x.lower().strip() for x in fmts.split(',')]\n tweakable_fmts = set(fmts).intersection({'epub', 'htmlz', 'azw3',\n 'mobi', 'azw'})\n if not tweakable_fmts:\n return error_dialog(self.gui, _('Cannot unpack book'),\n _('The book must be in ePub, HTMLZ or AZW3 formats to unpack.'\n '\\n\\nFirst convert the book to one of these formats.'),\n show=True)\n dlg = UnpackBook(self.gui, book_id, tweakable_fmts, db)\n dlg.exec_()\n dlg.cleanup()\n"} +{"text": "// go-libtor - Self-contained Tor from Go\n// Copyright (c) 2018 Péter Szilágyi. All rights reserved.\n\npackage libtor\n\n/*\n#include \n#include <../bufferevent_pair.c>\n*/\nimport \"C\"\n"} +{"text": "0\t0.0\tval_0\n2\t2.0\tval_2\n4\t4.0\tval_4\n5\t15.0\tval_5\n8\t8.0\tval_8\n9\t9.0\tval_9\n10\t10.0\tval_10\n11\t11.0\tval_11\n12\t24.0\tval_12\n15\t30.0\tval_15\n17\t17.0\tval_17\n18\t36.0\tval_18\n19\t19.0\tval_19\n20\t20.0\tval_20\n24\t48.0\tval_24\n26\t52.0\tval_26\n27\t27.0\tval_27\n28\t28.0\tval_28\n30\t30.0\tval_30\n33\t33.0\tval_33\n34\t34.0\tval_34\n35\t105.0\tval_35\n37\t74.0\tval_37\n41\t41.0\tval_41\n42\t84.0\tval_42\n43\t43.0\tval_43\n44\t44.0\tval_44\n47\t47.0\tval_47\n51\t102.0\tval_51\n53\t53.0\tval_53\n54\t54.0\tval_54\n57\t57.0\tval_57\n58\t116.0\tval_58\n64\t64.0\tval_64\n65\t65.0\tval_65\n66\t66.0\tval_66\n67\t134.0\tval_67\n69\t69.0\tval_69\n70\t210.0\tval_70\n72\t144.0\tval_72\n74\t74.0\tval_74\n76\t152.0\tval_76\n77\t77.0\tval_77\n78\t78.0\tval_78\n80\t80.0\tval_80\n82\t82.0\tval_82\n83\t166.0\tval_83\n84\t168.0\tval_84\n85\t85.0\tval_85\n86\t86.0\tval_86\n87\t87.0\tval_87\n90\t270.0\tval_90\n92\t92.0\tval_92\n95\t190.0\tval_95\n96\t96.0\tval_96\n97\t194.0\tval_97\n98\t196.0\tval_98\n100\t200.0\tval_100\n103\t206.0\tval_103\n104\t208.0\tval_104\n105\t105.0\tval_105\n111\t111.0\tval_111\n113\t226.0\tval_113\n114\t114.0\tval_114\n116\t116.0\tval_116\n118\t236.0\tval_118\n119\t357.0\tval_119\n120\t240.0\tval_120\n125\t250.0\tval_125\n126\t126.0\tval_126\n128\t384.0\tval_128\n129\t258.0\tval_129\n131\t131.0\tval_131\n133\t133.0\tval_133\n134\t268.0\tval_134\n136\t136.0\tval_136\n137\t274.0\tval_137\n138\t552.0\tval_138\n143\t143.0\tval_143\n145\t145.0\tval_145\n146\t292.0\tval_146\n149\t298.0\tval_149\n150\t150.0\tval_150\n152\t304.0\tval_152\n153\t153.0\tval_153\n155\t155.0\tval_155\n156\t156.0\tval_156\n157\t157.0\tval_157\n158\t158.0\tval_158\n160\t160.0\tval_160\n162\t162.0\tval_162\n163\t163.0\tval_163\n164\t328.0\tval_164\n165\t330.0\tval_165\n166\t166.0\tval_166\n167\t501.0\tval_167\n168\t168.0\tval_168\n169\t676.0\tval_169\n170\t170.0\tval_170\n172\t344.0\tval_172\n174\t348.0\tval_174\n175\t350.0\tval_175\n176\t352.0\tval_176\n177\t177.0\tval_177\n178\t178.0\tval_178\n179\t358.0\tval_179\n180\t180.0\tval_180\n181\t181.0\tval_181\n183\t183.0\tval_183\n186\t186.0\tval_186\n187\t561.0\tval_187\n189\t189.0\tval_189\n190\t190.0\tval_190\n191\t382.0\tval_191\n192\t192.0\tval_192\n193\t579.0\tval_193\n194\t194.0\tval_194\n195\t390.0\tval_195\n196\t196.0\tval_196\n197\t394.0\tval_197\n199\t597.0\tval_199\n200\t400.0\tval_200\n201\t201.0\tval_201\n202\t202.0\tval_202\n203\t406.0\tval_203\n205\t410.0\tval_205\n207\t414.0\tval_207\n208\t624.0\tval_208\n209\t418.0\tval_209\n213\t426.0\tval_213\n214\t214.0\tval_214\n216\t432.0\tval_216\n217\t434.0\tval_217\n218\t218.0\tval_218\n219\t438.0\tval_219\n221\t442.0\tval_221\n222\t222.0\tval_222\n223\t446.0\tval_223\n224\t448.0\tval_224\n226\t226.0\tval_226\n228\t228.0\tval_228\n229\t458.0\tval_229\n230\t1150.0\tval_230\n233\t466.0\tval_233\n235\t235.0\tval_235\n237\t474.0\tval_237\n238\t476.0\tval_238\n239\t478.0\tval_239\n241\t241.0\tval_241\n242\t484.0\tval_242\n244\t244.0\tval_244\n247\t247.0\tval_247\n248\t248.0\tval_248\n249\t249.0\tval_249\n252\t252.0\tval_252\n255\t510.0\tval_255\n256\t512.0\tval_256\n257\t257.0\tval_257\n258\t258.0\tval_258\n260\t260.0\tval_260\n262\t262.0\tval_262\n263\t263.0\tval_263\n265\t530.0\tval_265\n266\t266.0\tval_266\n272\t544.0\tval_272\n273\t819.0\tval_273\n274\t274.0\tval_274\n275\t275.0\tval_275\n277\t1108.0\tval_277\n278\t556.0\tval_278\n280\t560.0\tval_280\n281\t562.0\tval_281\n282\t564.0\tval_282\n283\t283.0\tval_283\n284\t284.0\tval_284\n285\t285.0\tval_285\n286\t286.0\tval_286\n287\t287.0\tval_287\n288\t576.0\tval_288\n289\t289.0\tval_289\n291\t291.0\tval_291\n292\t292.0\tval_292\n296\t296.0\tval_296\n298\t894.0\tval_298\n302\t302.0\tval_302\n305\t305.0\tval_305\n306\t306.0\tval_306\n307\t614.0\tval_307\n308\t308.0\tval_308\n309\t618.0\tval_309\n310\t310.0\tval_310\n311\t933.0\tval_311\n315\t315.0\tval_315\n316\t948.0\tval_316\n317\t634.0\tval_317\n318\t954.0\tval_318\n321\t642.0\tval_321\n322\t644.0\tval_322\n323\t323.0\tval_323\n325\t650.0\tval_325\n327\t981.0\tval_327\n331\t662.0\tval_331\n332\t332.0\tval_332\n333\t666.0\tval_333\n335\t335.0\tval_335\n336\t336.0\tval_336\n338\t338.0\tval_338\n339\t339.0\tval_339\n341\t341.0\tval_341\n342\t684.0\tval_342\n344\t688.0\tval_344\n345\t345.0\tval_345\n348\t1740.0\tval_348\n351\t351.0\tval_351\n353\t706.0\tval_353\n356\t356.0\tval_356\n360\t360.0\tval_360\n362\t362.0\tval_362\n364\t364.0\tval_364\n365\t365.0\tval_365\n366\t366.0\tval_366\n367\t734.0\tval_367\n368\t368.0\tval_368\n369\t1107.0\tval_369\n373\t373.0\tval_373\n374\t374.0\tval_374\n375\t375.0\tval_375\n377\t377.0\tval_377\n378\t378.0\tval_378\n379\t379.0\tval_379\n382\t764.0\tval_382\n384\t1152.0\tval_384\n386\t386.0\tval_386\n389\t389.0\tval_389\n392\t392.0\tval_392\n393\t393.0\tval_393\n394\t394.0\tval_394\n395\t790.0\tval_395\n396\t1188.0\tval_396\n397\t794.0\tval_397\n399\t798.0\tval_399\n400\t400.0\tval_400\n401\t2005.0\tval_401\n402\t402.0\tval_402\n403\t1209.0\tval_403\n404\t808.0\tval_404\n406\t1624.0\tval_406\n407\t407.0\tval_407\n409\t1227.0\tval_409\n411\t411.0\tval_411\n413\t826.0\tval_413\n414\t828.0\tval_414\n417\t1251.0\tval_417\n418\t418.0\tval_418\n419\t419.0\tval_419\n421\t421.0\tval_421\n424\t848.0\tval_424\n427\t427.0\tval_427\n429\t858.0\tval_429\n430\t1290.0\tval_430\n431\t1293.0\tval_431\n432\t432.0\tval_432\n435\t435.0\tval_435\n436\t436.0\tval_436\n437\t437.0\tval_437\n438\t1314.0\tval_438\n439\t878.0\tval_439\n443\t443.0\tval_443\n444\t444.0\tval_444\n446\t446.0\tval_446\n448\t448.0\tval_448\n449\t449.0\tval_449\n452\t452.0\tval_452\n453\t453.0\tval_453\n454\t1362.0\tval_454\n455\t455.0\tval_455\n457\t457.0\tval_457\n458\t916.0\tval_458\n459\t918.0\tval_459\n460\t460.0\tval_460\n462\t924.0\tval_462\n463\t926.0\tval_463\n466\t1398.0\tval_466\n467\t467.0\tval_467\n468\t1872.0\tval_468\n469\t2345.0\tval_469\n470\t470.0\tval_470\n472\t472.0\tval_472\n475\t475.0\tval_475\n477\t477.0\tval_477\n478\t956.0\tval_478\n479\t479.0\tval_479\n480\t1440.0\tval_480\n481\t481.0\tval_481\n482\t482.0\tval_482\n483\t483.0\tval_483\n484\t484.0\tval_484\n485\t485.0\tval_485\n487\t487.0\tval_487\n489\t1956.0\tval_489\n490\t490.0\tval_490\n491\t491.0\tval_491\n492\t984.0\tval_492\n493\t493.0\tval_493\n494\t494.0\tval_494\n495\t495.0\tval_495\n496\t496.0\tval_496\n497\t497.0\tval_497\n498\t1494.0\tval_498"} +{"text": "\r\n \r\n \r\n \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\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"} +{"text": "\n */\nclass ScheduleTest extends AbstractTestCase\n{\n use ValidationTrait;\n\n public function testValidation()\n {\n $this->checkRules(new Schedule());\n }\n}\n"} +{"text": "#!/bin/sh\n\nset -e\n\ncd $(dirname $0)\n\n. ../../../common/config.sh\n. ../../../common/log.sh\n\n# TODO: maybe this is wrong\nlog_start \"$0\" \"gpasswd can remove an user to a group (don't touch administrative users)\"\n\nsave_config\n\n# restore the files on exit\ntrap 'log_status \"$0\" \"FAILURE\"; restore_config' 0\n\nchange_config\n\necho -n \"Remove user foo to group bin (gpasswd -d foo users)...\"\ngpasswd -d foo users\necho \"OK\"\n\necho -n \"Check the passwd file...\"\n../../../common/compare_file.pl config/etc/passwd /etc/passwd\necho \"OK\"\necho -n \"Check the group file...\"\n../../../common/compare_file.pl data/group /etc/group\necho \"OK\"\necho -n \"Check the shadow file...\"\n../../../common/compare_file.pl config/etc/shadow /etc/shadow\necho \"OK\"\necho -n \"Check the gshadow file...\"\n../../../common/compare_file.pl data/gshadow /etc/gshadow\necho \"OK\"\n\nlog_status \"$0\" \"SUCCESS\"\nrestore_config\ntrap '' 0\n\n"} +{"text": "// GENERATED CODE -- DO NOT EDIT!\n\n'use strict';\nvar keys_pb = require('./keys_pb.js');\nvar github_com_gogo_protobuf_gogoproto_gogo_pb = require('./github.com/gogo/protobuf/gogoproto/gogo_pb.js');\nvar crypto_pb = require('./crypto_pb.js');\n\nfunction serialize_keys_AddNameRequest(arg) {\n if (!(arg instanceof keys_pb.AddNameRequest)) {\n throw new Error('Expected argument of type keys.AddNameRequest');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_AddNameRequest(buffer_arg) {\n return keys_pb.AddNameRequest.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_AddNameResponse(arg) {\n if (!(arg instanceof keys_pb.AddNameResponse)) {\n throw new Error('Expected argument of type keys.AddNameResponse');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_AddNameResponse(buffer_arg) {\n return keys_pb.AddNameResponse.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_ExportRequest(arg) {\n if (!(arg instanceof keys_pb.ExportRequest)) {\n throw new Error('Expected argument of type keys.ExportRequest');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_ExportRequest(buffer_arg) {\n return keys_pb.ExportRequest.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_ExportResponse(arg) {\n if (!(arg instanceof keys_pb.ExportResponse)) {\n throw new Error('Expected argument of type keys.ExportResponse');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_ExportResponse(buffer_arg) {\n return keys_pb.ExportResponse.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_GenRequest(arg) {\n if (!(arg instanceof keys_pb.GenRequest)) {\n throw new Error('Expected argument of type keys.GenRequest');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_GenRequest(buffer_arg) {\n return keys_pb.GenRequest.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_GenResponse(arg) {\n if (!(arg instanceof keys_pb.GenResponse)) {\n throw new Error('Expected argument of type keys.GenResponse');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_GenResponse(buffer_arg) {\n return keys_pb.GenResponse.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_HashRequest(arg) {\n if (!(arg instanceof keys_pb.HashRequest)) {\n throw new Error('Expected argument of type keys.HashRequest');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_HashRequest(buffer_arg) {\n return keys_pb.HashRequest.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_HashResponse(arg) {\n if (!(arg instanceof keys_pb.HashResponse)) {\n throw new Error('Expected argument of type keys.HashResponse');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_HashResponse(buffer_arg) {\n return keys_pb.HashResponse.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_ImportJSONRequest(arg) {\n if (!(arg instanceof keys_pb.ImportJSONRequest)) {\n throw new Error('Expected argument of type keys.ImportJSONRequest');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_ImportJSONRequest(buffer_arg) {\n return keys_pb.ImportJSONRequest.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_ImportRequest(arg) {\n if (!(arg instanceof keys_pb.ImportRequest)) {\n throw new Error('Expected argument of type keys.ImportRequest');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_ImportRequest(buffer_arg) {\n return keys_pb.ImportRequest.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_ImportResponse(arg) {\n if (!(arg instanceof keys_pb.ImportResponse)) {\n throw new Error('Expected argument of type keys.ImportResponse');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_ImportResponse(buffer_arg) {\n return keys_pb.ImportResponse.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_ListRequest(arg) {\n if (!(arg instanceof keys_pb.ListRequest)) {\n throw new Error('Expected argument of type keys.ListRequest');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_ListRequest(buffer_arg) {\n return keys_pb.ListRequest.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_ListResponse(arg) {\n if (!(arg instanceof keys_pb.ListResponse)) {\n throw new Error('Expected argument of type keys.ListResponse');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_ListResponse(buffer_arg) {\n return keys_pb.ListResponse.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_PubRequest(arg) {\n if (!(arg instanceof keys_pb.PubRequest)) {\n throw new Error('Expected argument of type keys.PubRequest');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_PubRequest(buffer_arg) {\n return keys_pb.PubRequest.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_PubResponse(arg) {\n if (!(arg instanceof keys_pb.PubResponse)) {\n throw new Error('Expected argument of type keys.PubResponse');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_PubResponse(buffer_arg) {\n return keys_pb.PubResponse.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_RemoveNameRequest(arg) {\n if (!(arg instanceof keys_pb.RemoveNameRequest)) {\n throw new Error('Expected argument of type keys.RemoveNameRequest');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_RemoveNameRequest(buffer_arg) {\n return keys_pb.RemoveNameRequest.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_RemoveNameResponse(arg) {\n if (!(arg instanceof keys_pb.RemoveNameResponse)) {\n throw new Error('Expected argument of type keys.RemoveNameResponse');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_RemoveNameResponse(buffer_arg) {\n return keys_pb.RemoveNameResponse.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_SignRequest(arg) {\n if (!(arg instanceof keys_pb.SignRequest)) {\n throw new Error('Expected argument of type keys.SignRequest');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_SignRequest(buffer_arg) {\n return keys_pb.SignRequest.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_SignResponse(arg) {\n if (!(arg instanceof keys_pb.SignResponse)) {\n throw new Error('Expected argument of type keys.SignResponse');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_SignResponse(buffer_arg) {\n return keys_pb.SignResponse.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_VerifyRequest(arg) {\n if (!(arg instanceof keys_pb.VerifyRequest)) {\n throw new Error('Expected argument of type keys.VerifyRequest');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_VerifyRequest(buffer_arg) {\n return keys_pb.VerifyRequest.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\nfunction serialize_keys_VerifyResponse(arg) {\n if (!(arg instanceof keys_pb.VerifyResponse)) {\n throw new Error('Expected argument of type keys.VerifyResponse');\n }\n return Buffer.from(arg.serializeBinary());\n}\n\nfunction deserialize_keys_VerifyResponse(buffer_arg) {\n return keys_pb.VerifyResponse.deserializeBinary(new Uint8Array(buffer_arg));\n}\n\n\nvar KeysService = exports['keys.Keys'] = {\n generateKey: {\n path: '/keys.Keys/GenerateKey',\n requestStream: false,\n responseStream: false,\n requestType: keys_pb.GenRequest,\n responseType: keys_pb.GenResponse,\n requestSerialize: serialize_keys_GenRequest,\n requestDeserialize: deserialize_keys_GenRequest,\n responseSerialize: serialize_keys_GenResponse,\n responseDeserialize: deserialize_keys_GenResponse,\n },\n publicKey: {\n path: '/keys.Keys/PublicKey',\n requestStream: false,\n responseStream: false,\n requestType: keys_pb.PubRequest,\n responseType: keys_pb.PubResponse,\n requestSerialize: serialize_keys_PubRequest,\n requestDeserialize: deserialize_keys_PubRequest,\n responseSerialize: serialize_keys_PubResponse,\n responseDeserialize: deserialize_keys_PubResponse,\n },\n sign: {\n path: '/keys.Keys/Sign',\n requestStream: false,\n responseStream: false,\n requestType: keys_pb.SignRequest,\n responseType: keys_pb.SignResponse,\n requestSerialize: serialize_keys_SignRequest,\n requestDeserialize: deserialize_keys_SignRequest,\n responseSerialize: serialize_keys_SignResponse,\n responseDeserialize: deserialize_keys_SignResponse,\n },\n verify: {\n path: '/keys.Keys/Verify',\n requestStream: false,\n responseStream: false,\n requestType: keys_pb.VerifyRequest,\n responseType: keys_pb.VerifyResponse,\n requestSerialize: serialize_keys_VerifyRequest,\n requestDeserialize: deserialize_keys_VerifyRequest,\n responseSerialize: serialize_keys_VerifyResponse,\n responseDeserialize: deserialize_keys_VerifyResponse,\n },\n import: {\n path: '/keys.Keys/Import',\n requestStream: false,\n responseStream: false,\n requestType: keys_pb.ImportRequest,\n responseType: keys_pb.ImportResponse,\n requestSerialize: serialize_keys_ImportRequest,\n requestDeserialize: deserialize_keys_ImportRequest,\n responseSerialize: serialize_keys_ImportResponse,\n responseDeserialize: deserialize_keys_ImportResponse,\n },\n importJSON: {\n path: '/keys.Keys/ImportJSON',\n requestStream: false,\n responseStream: false,\n requestType: keys_pb.ImportJSONRequest,\n responseType: keys_pb.ImportResponse,\n requestSerialize: serialize_keys_ImportJSONRequest,\n requestDeserialize: deserialize_keys_ImportJSONRequest,\n responseSerialize: serialize_keys_ImportResponse,\n responseDeserialize: deserialize_keys_ImportResponse,\n },\n export: {\n path: '/keys.Keys/Export',\n requestStream: false,\n responseStream: false,\n requestType: keys_pb.ExportRequest,\n responseType: keys_pb.ExportResponse,\n requestSerialize: serialize_keys_ExportRequest,\n requestDeserialize: deserialize_keys_ExportRequest,\n responseSerialize: serialize_keys_ExportResponse,\n responseDeserialize: deserialize_keys_ExportResponse,\n },\n hash: {\n path: '/keys.Keys/Hash',\n requestStream: false,\n responseStream: false,\n requestType: keys_pb.HashRequest,\n responseType: keys_pb.HashResponse,\n requestSerialize: serialize_keys_HashRequest,\n requestDeserialize: deserialize_keys_HashRequest,\n responseSerialize: serialize_keys_HashResponse,\n responseDeserialize: deserialize_keys_HashResponse,\n },\n removeName: {\n path: '/keys.Keys/RemoveName',\n requestStream: false,\n responseStream: false,\n requestType: keys_pb.RemoveNameRequest,\n responseType: keys_pb.RemoveNameResponse,\n requestSerialize: serialize_keys_RemoveNameRequest,\n requestDeserialize: deserialize_keys_RemoveNameRequest,\n responseSerialize: serialize_keys_RemoveNameResponse,\n responseDeserialize: deserialize_keys_RemoveNameResponse,\n },\n list: {\n path: '/keys.Keys/List',\n requestStream: false,\n responseStream: false,\n requestType: keys_pb.ListRequest,\n responseType: keys_pb.ListResponse,\n requestSerialize: serialize_keys_ListRequest,\n requestDeserialize: deserialize_keys_ListRequest,\n responseSerialize: serialize_keys_ListResponse,\n responseDeserialize: deserialize_keys_ListResponse,\n },\n addName: {\n path: '/keys.Keys/AddName',\n requestStream: false,\n responseStream: false,\n requestType: keys_pb.AddNameRequest,\n responseType: keys_pb.AddNameResponse,\n requestSerialize: serialize_keys_AddNameRequest,\n requestDeserialize: deserialize_keys_AddNameRequest,\n responseSerialize: serialize_keys_AddNameResponse,\n responseDeserialize: deserialize_keys_AddNameResponse,\n },\n};\n\n"} +{"text": "import Vue, { WatchOptions, ComponentOptions as _ComponentOptions } from 'vue'\nimport { BG0, BM0, BA0 } from '../core/base'\nimport { Module, ModuleImpl } from '../core/module'\nimport { Store, StoreImpl, Subscriber } from '../core/store'\nimport { devtoolPlugin } from '../adapters/devtool-plugin'\nimport { assert } from '../utils'\n\nlet _Vue: typeof Vue\n\nexport type Plugin = (store: VueStore) => void\n\nexport interface VueStoreOptions {\n strict?: boolean\n plugins?: Plugin[]\n}\n\nexport interface VueStore extends Store {\n watch (\n getter: (state: S, getters: G) => R,\n cb: (newState: R, oldState: R) => void,\n options?: WatchOptions\n ): () => void\n}\n\nexport class VueStoreImpl implements VueStore<{}, BG0, BM0, BA0> {\n private innerStore: StoreImpl\n private vm!: Vue & { $data: { state: {} }}\n private watcher: Vue\n private gettersForComputed: Record any> = {}\n private strict: boolean\n\n constructor (module: ModuleImpl, options: VueStoreOptions<{}, BG0, BM0, BA0>) {\n if (process.env.NODE_ENV !== 'production') {\n assert(_Vue, 'Must install Sinai by Vue.use before instantiate a store')\n }\n\n this.strict = Boolean(options.strict)\n\n this.innerStore = new StoreImpl(module, {\n transformGetter: this.transformGetter.bind(this),\n transformMutation: this.transformMutation.bind(this)\n })\n\n this.setupStoreVM()\n this.watcher = new _Vue()\n\n // Override the innerStore's state to point to VueStore's state\n // The state can do not be reactive sometimes if not do this\n Object.defineProperty(this.innerStore, 'state', {\n get: () => this.state,\n set: (value: {}) => {\n this.vm.$data.state = value\n }\n })\n\n if (this.strict) {\n this.watch(\n state => state,\n () => {\n assert(\n !this.strict,\n 'Must not update state out of mutations when strict mode is enabled.'\n )\n },\n { deep: true, sync: true } as WatchOptions\n )\n }\n\n const plugins = options.plugins || []\n if (process.env.NODE_ENV !== 'production' && _Vue.config.devtools) {\n plugins.push(devtoolPlugin)\n }\n plugins.forEach(plugin => plugin(this))\n }\n\n get state () {\n return this.vm.$data.state\n }\n\n get getters () {\n return this.innerStore.getters\n }\n\n get mutations () {\n return this.innerStore.mutations\n }\n\n get actions () {\n return this.innerStore.actions\n }\n\n replaceState (state: {}): void {\n this.commit(() => {\n this.vm.$data.state = state\n })\n }\n\n subscribe (fn: Subscriber<{}>): () => void {\n return this.innerStore.subscribe(fn)\n }\n\n watch (\n getter: (state: {}, getters: BG0) => R,\n cb: (newState: R, oldState: R) => void,\n options?: WatchOptions\n ): () => void {\n return this.watcher.$watch(\n () => getter(this.state, this.getters),\n cb,\n options\n )\n }\n\n hotUpdate (module: ModuleImpl): void {\n this.gettersForComputed = {}\n this.innerStore.hotUpdate(module)\n this.setupStoreVM()\n }\n\n private transformGetter (desc: PropertyDescriptor, path: string[]): PropertyDescriptor {\n if (typeof desc.get !== 'function') return desc\n\n const name = path.join('.')\n this.gettersForComputed[name] = desc.get\n\n desc.get = () => this.vm[name]\n\n return desc\n }\n\n private transformMutation (desc: PropertyDescriptor): PropertyDescriptor {\n if (!this.strict) return desc\n\n const original = desc.value as Function\n desc.value = (...args: any[]) => {\n this.commit(() => original.apply(null, args))\n }\n return desc\n }\n\n private setupStoreVM (): void {\n const oldVM = this.vm\n\n this.vm = new _Vue({\n data: {\n state: this.innerStore.state\n },\n computed: this.gettersForComputed\n }) as Vue & { $data: { state: {} }}\n\n // Ensure to re-evaluate getters for hot update\n if (oldVM != null) {\n this.commit(() => {\n oldVM.$data.state = null as any\n })\n\n _Vue.nextTick(() => {\n oldVM.$destroy()\n })\n }\n }\n\n private commit (fn: () => void): void {\n const original = this.strict\n this.strict = false\n fn()\n this.strict = original\n }\n}\n\nexport function store (\n module: Module,\n options: VueStoreOptions = {}\n): VueStore {\n return new VueStoreImpl(\n module as ModuleImpl,\n options as VueStoreOptions<{}, BG0, BM0, BA0>\n ) as VueStore\n}\n\nexport function install (InjectedVue: typeof Vue): void {\n if (process.env.NODE_ENV !== 'production') {\n assert(!_Vue, 'Sinai is already installed')\n }\n _Vue = InjectedVue\n _Vue.mixin({\n beforeCreate: sinaiInit\n })\n}\n\nfunction sinaiInit (this: Vue): void {\n type Component = Vue & { $store: VueStore<{}, BG0, BM0, BA0>, $parent: Component }\n type ComponentOptions = _ComponentOptions & { store?: VueStore<{}, BG0, BM0, BA0> }\n\n const vm = this as Component\n const { store } = vm.$options as ComponentOptions\n\n if (store) {\n vm.$store = store\n return\n }\n\n if (vm.$parent && vm.$parent.$store) {\n vm.$store = vm.$parent.$store\n }\n}\n\ndeclare module 'vue/types/options' {\n interface ComponentOptions {\n store?: VueStore\n }\n}\n"} +{"text": "/* SPDX-License-Identifier: GPL-2.0-or-later */\n/*\n * Driver for Digigram VXpocket soundcards\n *\n * Copyright (c) 2002 by Takashi Iwai \n */\n\n#ifndef __VXPOCKET_H\n#define __VXPOCKET_H\n\n#include \n\n#include \n#include \n\nstruct snd_vxpocket {\n\n\tstruct vx_core core;\n\n\tunsigned long port;\n\n\tint mic_level;\t/* analog mic level (or boost) */\n\n\tunsigned int regCDSP;\t/* current CDSP register */\n\tunsigned int regDIALOG;\t/* current DIALOG register */\n\n\tint index;\t/* card index */\n\n\t/* pcmcia stuff */\n\tstruct pcmcia_device\t*p_dev;\n};\n\n#define to_vxpocket(x)\tcontainer_of(x, struct snd_vxpocket, core)\n\nextern struct snd_vx_ops snd_vxpocket_ops;\n\nvoid vx_set_mic_boost(struct vx_core *chip, int boost);\nvoid vx_set_mic_level(struct vx_core *chip, int level);\n\nint vxp_add_mic_controls(struct vx_core *chip);\n\n/* Constants used to access the CDSP register (0x08). */\n#define CDSP_MAGIC\t0xA7\t/* magic value (for read) */\n/* for write */\n#define VXP_CDSP_CLOCKIN_SEL_MASK\t0x80\t/* 0 (internal), 1 (AES/EBU) */\n#define VXP_CDSP_DATAIN_SEL_MASK\t0x40\t/* 0 (analog), 1 (UER) */\n#define VXP_CDSP_SMPTE_SEL_MASK\t\t0x20\n#define VXP_CDSP_RESERVED_MASK\t\t0x10\n#define VXP_CDSP_MIC_SEL_MASK\t\t0x08\n#define VXP_CDSP_VALID_IRQ_MASK\t\t0x04\n#define VXP_CDSP_CODEC_RESET_MASK\t0x02\n#define VXP_CDSP_DSP_RESET_MASK\t\t0x01\n/* VXPOCKET 240/440 */\n#define P24_CDSP_MICS_SEL_MASK\t\t0x18\n#define P24_CDSP_MIC20_SEL_MASK\t\t0x10\n#define P24_CDSP_MIC38_SEL_MASK\t\t0x08\n\n/* Constants used to access the MEMIRQ register (0x0C). */\n#define P44_MEMIRQ_MASTER_SLAVE_SEL_MASK 0x08\n#define P44_MEMIRQ_SYNCED_ALONE_SEL_MASK 0x04\n#define P44_MEMIRQ_WCLK_OUT_IN_SEL_MASK 0x02 /* Not used */\n#define P44_MEMIRQ_WCLK_UER_SEL_MASK 0x01 /* Not used */\n\n/* Micro levels (0x0C) */\n\n/* Constants used to access the DIALOG register (0x0D). */\n#define VXP_DLG_XILINX_REPROG_MASK\t0x80\t/* W */\n#define VXP_DLG_DATA_XICOR_MASK\t\t0x80\t/* R */\n#define VXP_DLG_RESERVED4_0_MASK\t0x40\n#define VXP_DLG_RESERVED2_0_MASK\t0x20\n#define VXP_DLG_RESERVED1_0_MASK\t0x10\n#define VXP_DLG_DMAWRITE_SEL_MASK\t0x08\t/* W */\n#define VXP_DLG_DMAREAD_SEL_MASK\t0x04\t/* W */\n#define VXP_DLG_MEMIRQ_MASK\t\t0x02\t/* R */\n#define VXP_DLG_DMA16_SEL_MASK\t\t0x02\t/* W */\n#define VXP_DLG_ACK_MEMIRQ_MASK\t\t0x01\t/* R/W */\n\n\n#endif /* __VXPOCKET_H */\n"} +{"text": "/* 4.x removed\n-- Pathing for Harrison Jones Entry: 24358\nSET @NPC := 86177;\nSET @PATH := @NPC * 10;\nDELETE FROM `waypoint_data` WHERE `id`IN (@PATH,@PATH+1,@PATH+2);\nINSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES\n(@PATH,1,131.8243,1644.853,42.0216,0,0,0,100,0),\n(@PATH+1,1,121.897,1639.106,42.19081,0,0,0,100,0),\n(@PATH+1,2,120.8522,1637.931,42.37172,0,0,0,100,0),\n(@PATH+1,3,120.7898,1609.063,43.49005,0,0,0,100,0),\n(@PATH+2,1,120.6967,1603.713,43.4503,0,0,0,100,0);\n*/\n"} +{"text": "--\n-- User: mike\n-- Date: 23.11.2017\n-- Time: 21:04\n-- This file is part of Remixed Pixel Dungeon.\n--\n\nlocal RPD = require \"scripts/lib/commonClasses\"\n\nlocal mob = require\"scripts/lib/mob\"\n\nreturn mob.init({\n die = function(self, cause)\n local level = RPD.Dungeon.level\n print(self, cause)\n\n for i = 1,2 do\n local mob = RPD.MobFactory:mobByName(self:getMobClassName())\n local pos = level:getEmptyCellNextTo(self:getPos())\n if (level:cellValid(pos)) then\n mob:setPos(pos)\n level:spawnMob(mob)\n end\n end\n end\n})\n\n\n"} +{"text": "ERROR \n"} +{"text": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\n## [0.3.4-beta.3](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.4-beta.2...v0.3.4-beta.3) (2020-09-22)\n\n### Features\n\n- beta ([159299e](https://github.com/birkir/prime/tree/master/packages/prime-field-select/commit/159299e))\n\n## [0.3.4-beta.2](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.4-beta.1...v0.3.4-beta.2) (2020-09-22)\n\n### Bug Fixes\n\n- **field-select:** [#354](https://github.com/birkir/prime/tree/master/packages/prime-field-select/issues/354) return iterable value ([#355](https://github.com/birkir/prime/tree/master/packages/prime-field-select/issues/355)) ([e40772d](https://github.com/birkir/prime/tree/master/packages/prime-field-select/commit/e40772d))\n- **field-select:** [#354](https://github.com/birkir/prime/tree/master/packages/prime-field-select/issues/354) return type is always GraphQLList ([#362](https://github.com/birkir/prime/tree/master/packages/prime-field-select/issues/362)) ([d7c1cd8](https://github.com/birkir/prime/tree/master/packages/prime-field-select/commit/d7c1cd8))\n- make dev environment run on windows ([#271](https://github.com/birkir/prime/tree/master/packages/prime-field-select/issues/271)) ([b560249](https://github.com/birkir/prime/tree/master/packages/prime-field-select/commit/b560249))\n\n### Features\n\n- circleci vs gh actions ([3b4017e](https://github.com/birkir/prime/tree/master/packages/prime-field-select/commit/3b4017e))\n\n## [0.3.4-beta.1](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.4-beta.0...v0.3.4-beta.1) (2019-06-10)\n\n### Bug Fixes\n\n- prime field default options not showing in ui ([#194](https://github.com/birkir/prime/tree/master/packages/prime-field-select/issues/194)) ([7a7b162](https://github.com/birkir/prime/tree/master/packages/prime-field-select/commit/7a7b162))\n- **deps:** update dependency antd to v3.19.2 ([#218](https://github.com/birkir/prime/tree/master/packages/prime-field-select/issues/218)) ([b027a53](https://github.com/birkir/prime/tree/master/packages/prime-field-select/commit/b027a53))\n\n## [0.3.4-beta.0](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.3-beta.9...v0.3.4-beta.0) (2019-04-09)\n\n**Note:** Version bump only for package @primecms/field-select\n\n## [0.3.3-beta.9](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.3-beta.8...v0.3.3-beta.9) (2019-04-07)\n\n**Note:** Version bump only for package @primecms/field-select\n\n## [0.3.3-beta.6](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.3-beta.5...v0.3.3-beta.6) (2019-03-03)\n\n**Note:** Version bump only for package @primecms/field-select\n\n## [0.3.3-beta.5](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.3-beta.4...v0.3.3-beta.5) (2019-03-03)\n\n### Bug Fixes\n\n- upgrade antd ([e9f5841](https://github.com/birkir/prime/tree/master/packages/prime-field-select/commit/e9f5841))\n\n## [0.3.3-beta.4](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.3-beta.3...v0.3.3-beta.4) (2019-03-01)\n\n**Note:** Version bump only for package @primecms/field-select\n\n## [0.3.3-beta.2](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.3-beta.1...v0.3.3-beta.2) (2019-02-18)\n\n**Note:** Version bump only for package @primecms/field-select\n\n## [0.3.3-beta.1](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.3-beta.0...v0.3.3-beta.1) (2019-02-15)\n\n**Note:** Version bump only for package @primecms/field-select\n\n## [0.3.3-beta.0](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.2-beta.9...v0.3.3-beta.0) (2019-02-12)\n\n**Note:** Version bump only for package @primecms/field-select\n\n## [0.3.2-beta.1](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.2-beta.0...v0.3.2-beta.1) (2019-02-10)\n\n### Bug Fixes\n\n- hashes ([8aa7370](https://github.com/birkir/prime/tree/master/packages/prime-field-select/commit/8aa7370))\n\n## [0.3.2-beta.0](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.1-alpha.0...v0.3.2-beta.0) (2019-02-10)\n\n### Bug Fixes\n\n- update hashes? ([4b70013](https://github.com/birkir/prime/tree/master/packages/prime-field-select/commit/4b70013))\n\n## [0.3.1-alpha.0](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.0-alpha.5...v0.3.1-alpha.0) (2019-02-08)\n\n**Note:** Version bump only for package @primecms/field-select\n\n# [0.3.0-alpha.1](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.3.0-alpha.0...v0.3.0-alpha.1) (2019-02-07)\n\n**Note:** Version bump only for package @primecms/field-select\n\n# [0.3.0-alpha.0](https://github.com/birkir/prime/tree/master/packages/prime-field-select/compare/v0.2.21...v0.3.0-alpha.0) (2019-01-20)\n\n**Note:** Version bump only for package @primecms/field-select\n"} +{"text": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t63AA03831ED809C3000AA1C6 /* AddingStatesTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63AA037C1ED809C3000AA1C6 /* AddingStatesTestCase.swift */; };\n\t\t63AA03841ED809C3000AA1C6 /* EnumTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63AA037D1ED809C3000AA1C6 /* EnumTestCase.swift */; };\n\t\t63AA03851ED809C3000AA1C6 /* EventTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63AA037E1ED809C3000AA1C6 /* EventTests.swift */; };\n\t\t63AA03861ED809C3000AA1C6 /* StateEventsTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63AA037F1ED809C3000AA1C6 /* StateEventsTestCase.swift */; };\n\t\t63AA03871ED809C3000AA1C6 /* StateMachineConstructorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63AA03801ED809C3000AA1C6 /* StateMachineConstructorsTests.swift */; };\n\t\t63AA03881ED809C3000AA1C6 /* StateMachineStateSwitchingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63AA03811ED809C3000AA1C6 /* StateMachineStateSwitchingTests.swift */; };\n\t\t63AA03891ED809C3000AA1C6 /* StateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63AA03821ED809C3000AA1C6 /* StateTests.swift */; };\n\t\t9A3442051C706CD500E3AC14 /* Transporter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AA3C8661A14F11600D68CC3 /* Transporter.framework */; };\n\t\t9AA3C8891A14FA0A00D68CC3 /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AFD84A919FF9D76001C2639 /* Event.swift */; };\n\t\t9AA3C88A1A14FA0A00D68CC3 /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AC8CA0F1969C668006F1EAC /* State.swift */; };\n\t\t9AA3C88B1A14FA0A00D68CC3 /* StateMachine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A31BD6D19ED55CB005BAE5A /* StateMachine.swift */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t9A3979CE1A150A7C00E65E9A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 9AC8C9E71969BBB5006F1EAC /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 9AA3C8651A14F11600D68CC3;\n\t\t\tremoteInfo = Transporter;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t63AA037C1ED809C3000AA1C6 /* AddingStatesTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddingStatesTestCase.swift; sourceTree = \"\"; };\n\t\t63AA037D1ED809C3000AA1C6 /* EnumTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EnumTestCase.swift; sourceTree = \"\"; };\n\t\t63AA037E1ED809C3000AA1C6 /* EventTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventTests.swift; sourceTree = \"\"; };\n\t\t63AA037F1ED809C3000AA1C6 /* StateEventsTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StateEventsTestCase.swift; sourceTree = \"\"; };\n\t\t63AA03801ED809C3000AA1C6 /* StateMachineConstructorsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StateMachineConstructorsTests.swift; sourceTree = \"\"; };\n\t\t63AA03811ED809C3000AA1C6 /* StateMachineStateSwitchingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StateMachineStateSwitchingTests.swift; sourceTree = \"\"; };\n\t\t63AA03821ED809C3000AA1C6 /* StateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StateTests.swift; sourceTree = \"\"; };\n\t\t9A03334C1C6FBDFC00065221 /* UniversalFramework_Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = UniversalFramework_Base.xcconfig; path = xcconfigs/UniversalFramework_Base.xcconfig; sourceTree = \"\"; };\n\t\t9A03334D1C6FBDFC00065221 /* UniversalFramework_Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = UniversalFramework_Framework.xcconfig; path = xcconfigs/UniversalFramework_Framework.xcconfig; sourceTree = \"\"; };\n\t\t9A03334E1C6FBDFC00065221 /* UniversalFramework_Test.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = UniversalFramework_Test.xcconfig; path = xcconfigs/UniversalFramework_Test.xcconfig; sourceTree = \"\"; };\n\t\t9A31BD6D19ED55CB005BAE5A /* StateMachine.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = StateMachine.swift; path = Sources/StateMachine.swift; sourceTree = SOURCE_ROOT; };\n\t\t9A3526FF1A1601050006AB0F /* MessagesState.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = MessagesState.playground; sourceTree = \"\"; };\n\t\t9A4F5FE91BF89C4800E731F4 /* Tests.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Tests.plist; path = Plists/Tests.plist; sourceTree = \"\"; };\n\t\t9A4F5FEA1BF89C4800E731F4 /* Transporter.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Transporter.plist; path = Plists/Transporter.plist; sourceTree = \"\"; };\n\t\t9AA3C8601A14F04300D68CC3 /* Turnstile.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = Turnstile.playground; sourceTree = \"\"; };\n\t\t9AA3C8661A14F11600D68CC3 /* Transporter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Transporter.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t9AC8C9FC1969BBB5006F1EAC /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t9AC8CA0F1969C668006F1EAC /* State.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = State.swift; path = Sources/State.swift; sourceTree = SOURCE_ROOT; };\n\t\t9AFD84A919FF9D76001C2639 /* Event.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Event.swift; path = Sources/Event.swift; sourceTree = SOURCE_ROOT; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t9AA3C8621A14F11600D68CC3 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t9AC8C9F91969BBB5006F1EAC /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t9A3442051C706CD500E3AC14 /* Transporter.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t63AA037B1ED809C3000AA1C6 /* TransporterTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t63AA037C1ED809C3000AA1C6 /* AddingStatesTestCase.swift */,\n\t\t\t\t63AA037D1ED809C3000AA1C6 /* EnumTestCase.swift */,\n\t\t\t\t63AA037E1ED809C3000AA1C6 /* EventTests.swift */,\n\t\t\t\t63AA037F1ED809C3000AA1C6 /* StateEventsTestCase.swift */,\n\t\t\t\t63AA03801ED809C3000AA1C6 /* StateMachineConstructorsTests.swift */,\n\t\t\t\t63AA03811ED809C3000AA1C6 /* StateMachineStateSwitchingTests.swift */,\n\t\t\t\t63AA03821ED809C3000AA1C6 /* StateTests.swift */,\n\t\t\t);\n\t\t\tname = TransporterTests;\n\t\t\tpath = Tests/TransporterTests;\n\t\t\tsourceTree = SOURCE_ROOT;\n\t\t};\n\t\t9A03334B1C6FBDDC00065221 /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t9A03334C1C6FBDFC00065221 /* UniversalFramework_Base.xcconfig */,\n\t\t\t\t9A03334D1C6FBDFC00065221 /* UniversalFramework_Framework.xcconfig */,\n\t\t\t\t9A03334E1C6FBDFC00065221 /* UniversalFramework_Test.xcconfig */,\n\t\t\t\t9A35272B1A1603C60006AB0F /* Plists */,\n\t\t\t\t9A4F5FE91BF89C4800E731F4 /* Tests.plist */,\n\t\t\t\t9A4F5FEA1BF89C4800E731F4 /* Transporter.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"\";\n\t\t};\n\t\t9A35272B1A1603C60006AB0F /* Plists */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tname = Plists;\n\t\t\tsourceTree = \"\";\n\t\t};\n\t\t9AC8C9E61969BBB5006F1EAC = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t9A03334B1C6FBDDC00065221 /* Supporting Files */,\n\t\t\t\t9A3526FF1A1601050006AB0F /* MessagesState.playground */,\n\t\t\t\t9AA3C8601A14F04300D68CC3 /* Turnstile.playground */,\n\t\t\t\t9AC8C9F11969BBB5006F1EAC /* Code */,\n\t\t\t\t9AC8C9FF1969BBB5006F1EAC /* Tests */,\n\t\t\t\t9AC8C9F01969BBB5006F1EAC /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"\";\n\t\t};\n\t\t9AC8C9F01969BBB5006F1EAC /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t9AC8C9FC1969BBB5006F1EAC /* Tests.xctest */,\n\t\t\t\t9AA3C8661A14F11600D68CC3 /* Transporter.framework */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"\";\n\t\t};\n\t\t9AC8C9F11969BBB5006F1EAC /* Code */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t9AFD84A919FF9D76001C2639 /* Event.swift */,\n\t\t\t\t9AC8CA0F1969C668006F1EAC /* State.swift */,\n\t\t\t\t9A31BD6D19ED55CB005BAE5A /* StateMachine.swift */,\n\t\t\t);\n\t\t\tname = Code;\n\t\t\tpath = Sources;\n\t\t\tsourceTree = \"\";\n\t\t};\n\t\t9AC8C9FF1969BBB5006F1EAC /* Tests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t63AA037B1ED809C3000AA1C6 /* TransporterTests */,\n\t\t\t);\n\t\t\tname = Tests;\n\t\t\tpath = StateMachineTests;\n\t\t\tsourceTree = \"\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t9AA3C8651A14F11600D68CC3 /* Transporter */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 9AA3C87F1A14F11700D68CC3 /* Build configuration list for PBXNativeTarget \"Transporter\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t9AA3C8611A14F11600D68CC3 /* Sources */,\n\t\t\t\t9AA3C8621A14F11600D68CC3 /* Frameworks */,\n\t\t\t\t9AA3C8641A14F11600D68CC3 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = Transporter;\n\t\t\tproductName = Transporter.framework;\n\t\t\tproductReference = 9AA3C8661A14F11600D68CC3 /* Transporter.framework */;\n\t\t\tproductType = \"com.apple.product-type.framework\";\n\t\t};\n\t\t9AC8C9FB1969BBB5006F1EAC /* Tests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 9AC8CA091969BBB5006F1EAC /* Build configuration list for PBXNativeTarget \"Tests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t9AC8C9F81969BBB5006F1EAC /* Sources */,\n\t\t\t\t9AC8C9F91969BBB5006F1EAC /* Frameworks */,\n\t\t\t\t9AC8C9FA1969BBB5006F1EAC /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t9A3979CF1A150A7C00E65E9A /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = Tests;\n\t\t\tproductName = StateMachineTests;\n\t\t\tproductReference = 9AC8C9FC1969BBB5006F1EAC /* Tests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t9AC8C9E71969BBB5006F1EAC /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastSwiftMigration = 0700;\n\t\t\t\tLastSwiftUpdateCheck = 0710;\n\t\t\t\tLastUpgradeCheck = 1020;\n\t\t\t\tORGANIZATIONNAME = \"Denys Telezhkin\";\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t9AA3C8651A14F11600D68CC3 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1;\n\t\t\t\t\t\tLastSwiftMigration = 1020;\n\t\t\t\t\t};\n\t\t\t\t\t9AC8C9FB1969BBB5006F1EAC = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.0;\n\t\t\t\t\t\tLastSwiftMigration = 1020;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 9AC8C9EA1969BBB5006F1EAC /* Build configuration list for PBXProject \"Transporter\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 9AC8C9E61969BBB5006F1EAC;\n\t\t\tproductRefGroup = 9AC8C9F01969BBB5006F1EAC /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t9AA3C8651A14F11600D68CC3 /* Transporter */,\n\t\t\t\t9AC8C9FB1969BBB5006F1EAC /* Tests */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t9AA3C8641A14F11600D68CC3 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t9AC8C9FA1969BBB5006F1EAC /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t9AA3C8611A14F11600D68CC3 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t9AA3C8891A14FA0A00D68CC3 /* Event.swift in Sources */,\n\t\t\t\t9AA3C88B1A14FA0A00D68CC3 /* StateMachine.swift in Sources */,\n\t\t\t\t9AA3C88A1A14FA0A00D68CC3 /* State.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t9AC8C9F81969BBB5006F1EAC /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t63AA03841ED809C3000AA1C6 /* EnumTestCase.swift in Sources */,\n\t\t\t\t63AA03891ED809C3000AA1C6 /* StateTests.swift in Sources */,\n\t\t\t\t63AA03851ED809C3000AA1C6 /* EventTests.swift in Sources */,\n\t\t\t\t63AA03881ED809C3000AA1C6 /* StateMachineStateSwitchingTests.swift in Sources */,\n\t\t\t\t63AA03861ED809C3000AA1C6 /* StateEventsTestCase.swift in Sources */,\n\t\t\t\t63AA03831ED809C3000AA1C6 /* AddingStatesTestCase.swift in Sources */,\n\t\t\t\t63AA03871ED809C3000AA1C6 /* StateMachineConstructorsTests.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t9A3979CF1A150A7C00E65E9A /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 9AA3C8651A14F11600D68CC3 /* Transporter */;\n\t\t\ttargetProxy = 9A3979CE1A150A7C00E65E9A /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin XCBuildConfiguration section */\n\t\t9AA3C8801A14F11700D68CC3 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 9A03334D1C6FBDFC00065221 /* UniversalFramework_Framework.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tAPPLICATION_EXTENSION_API_ONLY = YES;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tDEFINES_MODULE = YES;\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tINFOPLIST_FILE = Plists/Transporter.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.mlsdev.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = Transporter;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.0;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t9AA3C8811A14F11700D68CC3 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 9A03334D1C6FBDFC00065221 /* UniversalFramework_Framework.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tAPPLICATION_EXTENSION_API_ONLY = YES;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tDEFINES_MODULE = YES;\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tINFOPLIST_FILE = Plists/Transporter.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.mlsdev.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = Transporter;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Owholemodule\";\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 9.0;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t9AC8CA041969BBB5006F1EAC /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.9;\n\t\t\t\tMETAL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tSWIFT_SWIFT3_OBJC_INFERENCE = Off;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t9AC8CA051969BBB5006F1EAC /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.9;\n\t\t\t\tMETAL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSWIFT_SWIFT3_OBJC_INFERENCE = Off;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t9AC8CA0A1969BBB5006F1EAC /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 9A03334E1C6FBDFC00065221 /* UniversalFramework_Test.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tINFOPLIST_FILE = Plists/Tests.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.mlsdev.${PRODUCT_NAME:rfc1034identifier}\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t9AC8CA0B1969BBB5006F1EAC /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 9A03334E1C6FBDFC00065221 /* UniversalFramework_Test.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tINFOPLIST_FILE = Plists/Tests.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.mlsdev.${PRODUCT_NAME:rfc1034identifier}\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Owholemodule\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t9AA3C87F1A14F11700D68CC3 /* Build configuration list for PBXNativeTarget \"Transporter\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t9AA3C8801A14F11700D68CC3 /* Debug */,\n\t\t\t\t9AA3C8811A14F11700D68CC3 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t9AC8C9EA1969BBB5006F1EAC /* Build configuration list for PBXProject \"Transporter\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t9AC8CA041969BBB5006F1EAC /* Debug */,\n\t\t\t\t9AC8CA051969BBB5006F1EAC /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t9AC8CA091969BBB5006F1EAC /* Build configuration list for PBXNativeTarget \"Tests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t9AC8CA0A1969BBB5006F1EAC /* Debug */,\n\t\t\t\t9AC8CA0B1969BBB5006F1EAC /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 9AC8C9E71969BBB5006F1EAC /* Project object */;\n}\n"} +{"text": "/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./source-map/source-node').SourceNode;\n"} +{"text": "aliases:\n debug:container:\n - cod\n config:edit:\n - cdit\n cron:execute:\n - cre\n database:connect:\n - sqlc\n database:query:\n - sqlq\n debug:database:log:\n - ws\n debug:multisite:\n - msd\n debug:router:\n - rod\n debug:theme:\n - tde\n debug:update:\n - upd\n multisite:new:\n - sn\n router:rebuild:\n - ror\n site:status:\n - st\n user:login:clear:attempts:\n - uslca\n user:login:url:\n - usli\n - uli\n user:password:hash:\n - usph\n user:password:reset:\n - upsr\n views:disable:\n - vdi\n cache:rebuild:\n - cc\n update:execute:\n - updb\n server:\n - rs\n"} +{"text": "\n\n \n \n \n\n"} +{"text": "#\n# Combobox bindings.\n#\n# <>:\n#\n#\tNeed to set [wm transient] just before mapping the popdown\n#\tinstead of when it's created, in case a containing frame\n#\thas been reparented [#1818441].\n#\n#\tOn Windows: setting [wm transient] prevents the parent\n#\ttoplevel from becoming inactive when the popdown is posted\n#\t(Tk 8.4.8+)\n#\n#\tOn X11: WM_TRANSIENT_FOR on override-redirect windows\n#\tmay be used by compositing managers and by EWMH-aware\n#\twindow managers (even though the older ICCCM spec says\n#\tit's meaningless).\n#\n#\tOn OSX: [wm transient] does utterly the wrong thing.\n#\tInstead, we use [MacWindowStyle \"help\" \"noActivates hideOnSuspend\"].\n#\tThe \"noActivates\" attribute prevents the parent toplevel\n#\tfrom deactivating when the popdown is posted, and is also\n#\tnecessary for \"help\" windows to receive mouse events.\n#\t\"hideOnSuspend\" makes the popdown disappear (resp. reappear)\n#\twhen the parent toplevel is deactivated (resp. reactivated).\n#\t(see [#1814778]). Also set [wm resizable 0 0], to prevent\n#\tTkAqua from shrinking the scrollbar to make room for a grow box\n#\tthat isn't there.\n#\n#\tIn order to work around other platform quirks in TkAqua,\n#\t[grab] and [focus] are set in bindings instead of\n#\timmediately after deiconifying the window.\n#\n\nnamespace eval ttk::combobox {\n variable Values\t;# Values($cb) is -listvariable of listbox widget\n variable State\n set State(entryPress) 0\n}\n\n### Combobox bindings.\n#\n# Duplicate the Entry bindings, override if needed:\n#\n\nttk::copyBindings TEntry TCombobox\n\nbind TCombobox \t\t{ ttk::combobox::Post %W }\nbind TCombobox \t{ ttk::combobox::Unpost %W }\n\nbind TCombobox \t\t{ ttk::combobox::Press \"\" %W %x %y }\nbind TCombobox \t{ ttk::combobox::Press \"s\" %W %x %y }\nbind TCombobox \t{ ttk::combobox::Press \"2\" %W %x %y }\nbind TCombobox \t{ ttk::combobox::Press \"3\" %W %x %y }\nbind TCombobox \t\t{ ttk::combobox::Drag %W %x }\nbind TCombobox \t\t\t{ ttk::combobox::Motion %W %x %y }\n\nttk::bindMouseWheel TCombobox [list ttk::combobox::Scroll %W]\n\nbind TCombobox <> \t\t{ ttk::combobox::TraverseIn %W }\n\n### Combobox listbox bindings.\n#\nbind ComboboxListbox \t{ ttk::combobox::LBSelected %W }\nbind ComboboxListbox \t{ ttk::combobox::LBSelected %W }\nbind ComboboxListbox { ttk::combobox::LBCancel %W }\nbind ComboboxListbox \t{ ttk::combobox::LBTab %W next }\nbind ComboboxListbox <>\t{ ttk::combobox::LBTab %W prev }\nbind ComboboxListbox \t\t{ ttk::combobox::LBCleanup %W }\nbind ComboboxListbox \t\t{ ttk::combobox::LBHover %W %x %y }\nbind ComboboxListbox \t\t{ focus -force %W }\n\nswitch -- [tk windowingsystem] {\n win32 {\n\t# Dismiss listbox when user switches to a different application.\n\t# NB: *only* do this on Windows (see #1814778)\n\tbind ComboboxListbox \t\t{ ttk::combobox::LBCancel %W }\n }\n}\n\n### Combobox popdown window bindings.\n#\nbind ComboboxPopdown\t\t\t{ ttk::combobox::MapPopdown %W }\nbind ComboboxPopdown\t\t\t{ ttk::combobox::UnmapPopdown %W }\nbind ComboboxPopdown\t \\\n\t\t\t{ ttk::combobox::Unpost [winfo parent %W] }\n\n### Option database settings.\n#\n\noption add *TCombobox*Listbox.font TkTextFont\noption add *TCombobox*Listbox.relief flat\noption add *TCombobox*Listbox.highlightThickness 0\n\n## Platform-specific settings.\n#\nswitch -- [tk windowingsystem] {\n x11 {\n\toption add *TCombobox*Listbox.background white\n }\n aqua {\n\toption add *TCombobox*Listbox.borderWidth 0\n }\n}\n\n### Binding procedures.\n#\n\n## Press $mode $x $y -- ButtonPress binding for comboboxes.\n#\tEither post/unpost the listbox, or perform Entry widget binding,\n#\tdepending on widget state and location of button press.\n#\nproc ttk::combobox::Press {mode w x y} {\n variable State\n\n $w instate disabled { return }\n\n set State(entryPress) [expr {\n\t [$w instate !readonly]\n\t&& [string match *textarea [$w identify element $x $y]]\n }]\n\n focus $w\n if {$State(entryPress)} {\n\tswitch -- $mode {\n\t s \t{ ttk::entry::Shift-Press $w $x \t; # Shift }\n\t 2\t{ ttk::entry::Select $w $x word \t; # Double click}\n\t 3\t{ ttk::entry::Select $w $x line \t; # Triple click }\n\t \"\"\t-\n\t default { ttk::entry::Press $w $x }\n\t}\n } else {\n\tPost $w\n }\n}\n\n## Drag -- B1-Motion binding for comboboxes.\n#\tIf the initial ButtonPress event was handled by Entry binding,\n#\tperform Entry widget drag binding; otherwise nothing.\n#\nproc ttk::combobox::Drag {w x} {\n variable State\n if {$State(entryPress)} {\n\tttk::entry::Drag $w $x\n }\n}\n\n## Motion --\n#\tSet cursor.\n#\nproc ttk::combobox::Motion {w x y} {\n if { [$w identify $x $y] eq \"textarea\"\n && [$w instate {!readonly !disabled}]\n } {\n\tttk::setCursor $w text\n } else {\n\tttk::setCursor $w \"\"\n }\n}\n\n## TraverseIn -- receive focus due to keyboard navigation\n#\tFor editable comboboxes, set the selection and insert cursor.\n#\nproc ttk::combobox::TraverseIn {w} {\n $w instate {!readonly !disabled} {\n\t$w selection range 0 end\n\t$w icursor end\n }\n}\n\n## SelectEntry $cb $index --\n#\tSet the combobox selection in response to a user action.\n#\nproc ttk::combobox::SelectEntry {cb index} {\n $cb current $index\n $cb selection range 0 end\n $cb icursor end\n event generate $cb <> -when mark\n}\n\n## Scroll -- Mousewheel binding\n#\nproc ttk::combobox::Scroll {cb dir} {\n $cb instate disabled { return }\n set max [llength [$cb cget -values]]\n set current [$cb current]\n incr current $dir\n if {$max != 0 && $current == $current % $max} {\n\tSelectEntry $cb $current\n }\n}\n\n## LBSelected $lb -- Activation binding for listbox\n#\tSet the combobox value to the currently-selected listbox value\n#\tand unpost the listbox.\n#\nproc ttk::combobox::LBSelected {lb} {\n set cb [LBMaster $lb]\n LBSelect $lb\n Unpost $cb\n focus $cb\n}\n\n## LBCancel --\n#\tUnpost the listbox.\n#\nproc ttk::combobox::LBCancel {lb} {\n Unpost [LBMaster $lb]\n}\n\n## LBTab -- Tab key binding for combobox listbox.\n#\tSet the selection, and navigate to next/prev widget.\n#\nproc ttk::combobox::LBTab {lb dir} {\n set cb [LBMaster $lb]\n switch -- $dir {\n\tnext\t{ set newFocus [tk_focusNext $cb] }\n\tprev\t{ set newFocus [tk_focusPrev $cb] }\n }\n\n if {$newFocus ne \"\"} {\n\tLBSelect $lb\n\tUnpost $cb\n\t# The [grab release] call in [Unpost] queues events that later\n\t# re-set the focus (@@@ NOTE: this might not be true anymore).\n\t# Set new focus later:\n\tafter 0 [list ttk::traverseTo $newFocus]\n }\n}\n\n## LBHover -- binding for combobox listbox.\n#\tFollow selection on mouseover.\n#\nproc ttk::combobox::LBHover {w x y} {\n $w selection clear 0 end\n $w activate @$x,$y\n $w selection set @$x,$y\n}\n\n## MapPopdown -- binding for ComboboxPopdown\n#\nproc ttk::combobox::MapPopdown {w} {\n [winfo parent $w] state pressed\n ttk::globalGrab $w\n}\n\n## UnmapPopdown -- binding for ComboboxPopdown\n#\nproc ttk::combobox::UnmapPopdown {w} {\n [winfo parent $w] state !pressed\n ttk::releaseGrab $w\n}\n\n###\n#\n\nnamespace eval ::ttk::combobox {\n # @@@ Until we have a proper native scrollbar on Aqua, use\n # @@@ the regular Tk one. Use ttk::scrollbar on other platforms.\n variable scrollbar ttk::scrollbar\n if {[tk windowingsystem] eq \"aqua\"} {\n\tset scrollbar ::scrollbar\n }\n}\n\n## PopdownWindow --\n#\tReturns the popdown widget associated with a combobox,\n#\tcreating it if necessary.\n#\nproc ttk::combobox::PopdownWindow {cb} {\n variable scrollbar\n\n if {![winfo exists $cb.popdown]} {\n\tset poplevel [PopdownToplevel $cb.popdown]\n\tset popdown [ttk::frame $poplevel.f -style ComboboxPopdownFrame]\n\n\t$scrollbar $popdown.sb \\\n\t -orient vertical -command [list $popdown.l yview]\n\tlistbox $popdown.l \\\n\t -listvariable ttk::combobox::Values($cb) \\\n\t -yscrollcommand [list $popdown.sb set] \\\n\t -exportselection false \\\n\t -selectmode browse \\\n\t -activestyle none \\\n\t ;\n\n\tbindtags $popdown.l \\\n\t [list $popdown.l ComboboxListbox Listbox $popdown all]\n\n\tgrid $popdown.l -row 0 -column 0 -padx {1 0} -pady 1 -sticky nsew\n grid $popdown.sb -row 0 -column 1 -padx {0 1} -pady 1 -sticky ns\n\tgrid columnconfigure $popdown 0 -weight 1\n\tgrid rowconfigure $popdown 0 -weight 1\n\n grid $popdown -sticky news -padx 0 -pady 0\n grid rowconfigure $poplevel 0 -weight 1\n grid columnconfigure $poplevel 0 -weight 1\n }\n return $cb.popdown\n}\n\n## PopdownToplevel -- Create toplevel window for the combobox popdown\n#\n#\tSee also <>\n#\nproc ttk::combobox::PopdownToplevel {w} {\n toplevel $w -class ComboboxPopdown\n wm withdraw $w\n switch -- [tk windowingsystem] {\n\tdefault -\n\tx11 {\n\t $w configure -relief flat -borderwidth 0\n\t wm attributes $w -type combo\n\t wm overrideredirect $w true\n\t}\n\twin32 {\n\t $w configure -relief flat -borderwidth 0\n\t wm overrideredirect $w true\n\t wm attributes $w -topmost 1\n\t}\n\taqua {\n\t $w configure -relief solid -borderwidth 0\n\t tk::unsupported::MacWindowStyle style $w \\\n\t \thelp {noActivates hideOnSuspend}\n\t wm resizable $w 0 0\n\t}\n }\n return $w\n}\n\n## ConfigureListbox --\n#\tSet listbox values, selection, height, and scrollbar visibility\n#\tfrom current combobox values.\n#\nproc ttk::combobox::ConfigureListbox {cb} {\n variable Values\n\n set popdown [PopdownWindow $cb].f\n set values [$cb cget -values]\n set current [$cb current]\n if {$current < 0} {\n\tset current 0 \t\t;# no current entry, highlight first one\n }\n set Values($cb) $values\n $popdown.l selection clear 0 end\n $popdown.l selection set $current\n $popdown.l activate $current\n $popdown.l see $current\n set height [llength $values]\n if {$height > [$cb cget -height]} {\n\tset height [$cb cget -height]\n \tgrid $popdown.sb\n grid configure $popdown.l -padx {1 0}\n } else {\n\tgrid remove $popdown.sb\n grid configure $popdown.l -padx 1\n }\n $popdown.l configure -height $height\n}\n\n## PlacePopdown --\n#\tSet popdown window geometry.\n#\n# @@@TODO: factor with menubutton::PostPosition\n#\nproc ttk::combobox::PlacePopdown {cb popdown} {\n set x [winfo rootx $cb]\n set y [winfo rooty $cb]\n set w [winfo width $cb]\n set h [winfo height $cb]\n set postoffset [ttk::style lookup TCombobox -postoffset {} {0 0 0 0}]\n foreach var {x y w h} delta $postoffset {\n \tincr $var $delta\n }\n\n set H [winfo reqheight $popdown]\n if {$y + $h + $H > [winfo screenheight $popdown]} {\n\tset Y [expr {$y - $H}]\n } else {\n\tset Y [expr {$y + $h}]\n }\n wm geometry $popdown ${w}x${H}+${x}+${Y}\n}\n\n## Post $cb --\n#\tPop down the associated listbox.\n#\nproc ttk::combobox::Post {cb} {\n # Don't do anything if disabled:\n #\n $cb instate disabled { return }\n\n # ASSERT: ![$cb instate pressed]\n\n # Run -postcommand callback:\n #\n uplevel #0 [$cb cget -postcommand]\n\n set popdown [PopdownWindow $cb]\n ConfigureListbox $cb\n update idletasks\t;# needed for geometry propagation.\n PlacePopdown $cb $popdown\n # See <>\n switch -- [tk windowingsystem] {\n\tx11 - win32 { wm transient $popdown [winfo toplevel $cb] }\n }\n\n # Post the listbox:\n #\n wm attribute $popdown -topmost 1\n wm deiconify $popdown\n raise $popdown\n}\n\n## Unpost $cb --\n#\tUnpost the listbox.\n#\nproc ttk::combobox::Unpost {cb} {\n if {[winfo exists $cb.popdown]} {\n\twm withdraw $cb.popdown\n }\n grab release $cb.popdown ;# in case of stuck or unexpected grab [#1239190]\n}\n\n## LBMaster $lb --\n#\tReturn the combobox main widget that owns the listbox.\n#\nproc ttk::combobox::LBMaster {lb} {\n winfo parent [winfo parent [winfo parent $lb]]\n}\n\n## LBSelect $lb --\n#\tTransfer listbox selection to combobox value.\n#\nproc ttk::combobox::LBSelect {lb} {\n set cb [LBMaster $lb]\n set selection [$lb curselection]\n if {[llength $selection] == 1} {\n\tSelectEntry $cb [lindex $selection 0]\n }\n}\n\n## LBCleanup $lb --\n#\t binding for combobox listboxes.\n#\tCleans up by unsetting the linked textvariable.\n#\n#\tNote: we can't just use { unset [%W cget -listvariable] }\n#\tbecause the widget command is already gone when this binding fires).\n#\t[winfo parent] still works, fortunately.\n#\nproc ttk::combobox::LBCleanup {lb} {\n variable Values\n unset Values([LBMaster $lb])\n}\n\n#*EOF*\n"} +{"text": "package com.study.benchmarkorm.model;\r\n\r\nimport io.realm.RealmObject;\r\nimport io.realm.annotations.Ignore;\r\nimport io.realm.annotations.PrimaryKey;\r\n\r\npublic class Book extends RealmObject{\r\n\r\n private String author;\r\n private String title;\r\n private int pagesCount;\r\n private int bookId;\r\n private Library library;\r\n\r\n public Book() {\r\n }\r\n\r\n public Book(String author, String title, int pagesCount, int bookId, Library library) {\r\n this.author = author;\r\n this.title = title;\r\n this.pagesCount = pagesCount;\r\n this.bookId = bookId;\r\n this.library = library;\r\n }\r\n\r\n public String getAuthor() {\r\n return author;\r\n }\r\n\r\n public void setAuthor(String author) {\r\n this.author = author;\r\n }\r\n\r\n public String getTitle() {\r\n return title;\r\n }\r\n\r\n public void setTitle(String title) {\r\n this.title = title;\r\n }\r\n\r\n public int getPagesCount() {\r\n return pagesCount;\r\n }\r\n\r\n public void setPagesCount(int pagesCount) {\r\n this.pagesCount = pagesCount;\r\n }\r\n\r\n public int getBookId() {\r\n return bookId;\r\n }\r\n\r\n public void setBookId(int bookId) {\r\n this.bookId = bookId;\r\n }\r\n\r\n public Library getLibrary(){return library;}\r\n\r\n public void setLibrary(Library library) {\r\n this.library = library;\r\n }\r\n}\r\n"} +{"text": "\n\nCodeMirror: Properties files mode\n\n\n\n\n\n\n\n\n\n
\n

Properties files mode

\n
\n \n\n

MIME types defined: text/x-properties,\n text/x-ini.

\n\n
\n"} +{"text": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst UilDocumentLayoutRight = (props) => {\n const { color, size, ...otherProps } = props\n return React.createElement('svg', {\n xmlns: 'http://www.w3.org/2000/svg',\n width: size,\n height: size,\n viewBox: '0 0 24 24',\n fill: color,\n ...otherProps\n }, React.createElement('path', {\n d: 'M13,18H3a1,1,0,0,0,0,2H13a1,1,0,0,0,0-2ZM3,8h8a1,1,0,0,0,0-2H3A1,1,0,0,0,3,8Zm0,4h8a1,1,0,0,0,0-2H3a1,1,0,0,0,0,2Zm18,2H3a1,1,0,0,0,0,2H21a1,1,0,0,0,0-2ZM21,4H15a1,1,0,0,0-1,1v6a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V5A1,1,0,0,0,21,4Zm-1,6H16V6h4Z'\n }));\n};\n\nUilDocumentLayoutRight.propTypes = {\n color: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n};\n\nUilDocumentLayoutRight.defaultProps = {\n color: 'currentColor',\n size: '24',\n};\n\nexport default UilDocumentLayoutRight;"} +{"text": "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { windowOpenNoOpener } from 'vs/base/browser/dom';\nimport { Schemas } from 'vs/base/common/network';\nimport { URI } from 'vs/base/common/uri';\nimport { ICodeEditor } from 'vs/editor/browser/editorBrowser';\nimport { CodeEditorServiceImpl } from 'vs/editor/browser/services/codeEditorServiceImpl';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { ScrollType } from 'vs/editor/common/editorCommon';\nimport { ITextModel } from 'vs/editor/common/model';\nimport { IResourceEditorInput } from 'vs/platform/editor/common/editor';\n\nexport class StandaloneCodeEditorServiceImpl extends CodeEditorServiceImpl {\n\n\tpublic getActiveCodeEditor(): ICodeEditor | null {\n\t\treturn null; // not supported in the standalone case\n\t}\n\n\tpublic openCodeEditor(input: IResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise {\n\t\tif (!source) {\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\n\t\treturn Promise.resolve(this.doOpenEditor(source, input));\n\t}\n\n\tprivate doOpenEditor(editor: ICodeEditor, input: IResourceEditorInput): ICodeEditor | null {\n\t\tconst model = this.findModel(editor, input.resource);\n\t\tif (!model) {\n\t\t\tif (input.resource) {\n\n\t\t\t\tconst schema = input.resource.scheme;\n\t\t\t\tif (schema === Schemas.http || schema === Schemas.https) {\n\t\t\t\t\t// This is a fully qualified http or https URL\n\t\t\t\t\twindowOpenNoOpener(input.resource.toString());\n\t\t\t\t\treturn editor;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tconst selection = (input.options ? input.options.selection : null);\n\t\tif (selection) {\n\t\t\tif (typeof selection.endLineNumber === 'number' && typeof selection.endColumn === 'number') {\n\t\t\t\teditor.setSelection(selection);\n\t\t\t\teditor.revealRangeInCenter(selection, ScrollType.Immediate);\n\t\t\t} else {\n\t\t\t\tconst pos = {\n\t\t\t\t\tlineNumber: selection.startLineNumber,\n\t\t\t\t\tcolumn: selection.startColumn\n\t\t\t\t};\n\t\t\t\teditor.setPosition(pos);\n\t\t\t\teditor.revealPositionInCenter(pos, ScrollType.Immediate);\n\t\t\t}\n\t\t}\n\n\t\treturn editor;\n\t}\n\n\tprivate findModel(editor: ICodeEditor, resource: URI): ITextModel | null {\n\t\tconst model = editor.getModel();\n\t\tif (model && model.uri.toString() !== resource.toString()) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn model;\n\t}\n}\n"} +{"text": "const t = require('../test-lib/test.js');\nconst assert = require('assert');\nconst Promise = require('bluebird');\n\nlet apos;\n\ndescribe('Login', function() {\n\n this.timeout(20000);\n\n after(function(done) {\n return t.destroy(apos, done);\n });\n\n // EXISTENCE\n\n it('should initialize', function(done) {\n apos = require('../index.js')({\n root: module,\n shortName: 'test',\n modules: {\n 'apostrophe-express': {\n secret: 'xxx',\n port: 7901,\n csrf: false\n },\n 'apostrophe-users': {\n groups: [\n {\n title: 'guest',\n permissions: ['guest']\n },\n {\n title: 'admin',\n permissions: ['admin']\n }\n ],\n disableInactiveAccounts: {\n inactivityDuration: 0\n }\n },\n 'apostrophe-login': {\n throttle: {\n allowedAttempts: 3,\n perMinutes: 0.25,\n lockoutMinutes: 0.25\n }\n }\n },\n afterInit: function(callback) {\n assert(apos.modules['apostrophe-login']);\n apos.argv._ = [];\n assert(apos.users.safe.remove);\n return apos.users.safe.remove({}, callback);\n // return callback(null);\n },\n afterListen: function(err) {\n assert(!err);\n done();\n }\n });\n });\n\n it('should be able to insert test user', function(done) {\n assert(apos.users.newInstance);\n const user = apos.users.newInstance();\n assert(user);\n\n user.firstName = 'Lilith';\n user.lastName = 'Iyapo';\n user.title = 'Lilith Iyapo';\n user.username = 'LilithIyapo';\n user.password = 'nikanj';\n user.email = 'liyapo@example.com';\n user.groupIds = [ apos.users.options.groups[1]._id ];\n\n assert(user.type === 'apostrophe-user');\n assert(apos.users.insert);\n apos.users.insert(apos.tasks.getReq(), user, function(err) {\n assert(!err);\n done();\n });\n });\n\n it('should be able to verify a login', async function() {\n const req = apos.tasks.getReq();\n const user = await apos.users.find(req, {\n username: 'LilithIyapo'\n }).toObject();\n const verify = Promise.promisify(apos.login.verifyPassword);\n await verify(user, 'nikanj');\n });\n\n it('third failure in a row should cause a lockout', async function() {\n const req = apos.tasks.getReq();\n const user = await apos.users.find(req, {\n username: 'LilithIyapo'\n }).toObject();\n const verify = Promise.promisify(apos.login.verifyPassword);\n try {\n await verify(user, 'bad');\n assert(false);\n } catch (e) {\n assert(e);\n assert.notEqual(e.message, 'throttle');\n }\n try {\n await verify(user, 'bad');\n assert(false);\n } catch (e) {\n assert(e);\n assert.notEqual(e.message, 'throttle');\n }\n // third attempt triggers lockout\n try {\n await verify(user, 'bad');\n assert(false);\n } catch (e) {\n assert(e);\n assert.equal(e.message, 'throttle');\n }\n // fourth attempt is throttled (by lockout)\n try {\n await verify(user, 'bad');\n assert(false);\n } catch (e) {\n assert(e);\n assert.equal(e.message, 'throttle');\n }\n // still throttled even if the password is good\n try {\n await verify(user, 'nikanj');\n assert(false);\n } catch (e) {\n assert(e);\n assert.equal(e.message, 'throttle');\n }\n });\n\n it('should succeed after suitable pause', async function() {\n const req = apos.tasks.getReq();\n const user = await apos.users.find(req, {\n username: 'LilithIyapo'\n }).toObject();\n const verify = Promise.promisify(apos.login.verifyPassword);\n this.timeout(60000);\n await Promise.delay(16000);\n await verify(user, 'nikanj');\n });\n\n});\n"} +{"text": "package flaggy\n\n// setValueForParsers sets the value for a specified key in the\n// specified parsers (which normally include a Parser and Subcommand).\n// The return values represent the key being set, and any errors\n// returned when setting the key, such as failures to convert the string\n// into the appropriate flag value. We stop assigning values as soon\n// as we find a any parser that accepts it.\nfunc setValueForParsers(key string, value string, parsers ...ArgumentParser) (bool, error) {\n\n\tfor _, p := range parsers {\n\t\tvalueWasSet, err := p.SetValueForKey(key, value)\n\t\tif err != nil {\n\t\t\treturn valueWasSet, err\n\t\t}\n\t\tif valueWasSet {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\n\treturn false, nil\n}\n\n// ArgumentParser represents a parser or subcommand\ntype ArgumentParser interface {\n\tSetValueForKey(key string, value string) (bool, error)\n}\n"} +{"text": " \n\n\n\n\n\n \n sd_bus_add_object\n elogind\n \n\n \n sd_bus_add_object\n 3\n \n\n \n sd_bus_add_object\n sd_bus_add_fallback\n sd_bus_add_object_vtable\n sd_bus_add_fallback_vtable\n sd_bus_add_filter\n SD_BUS_VTABLE_START\n SD_BUS_VTABLE_END\n SD_BUS_METHOD_WITH_NAMES_OFFSET\n SD_BUS_METHOD_WITH_NAMES\n SD_BUS_METHOD_WITH_OFFSET\n SD_BUS_METHOD\n SD_BUS_SIGNAL_WITH_NAMES\n SD_BUS_SIGNAL\n SD_BUS_WRITABLE_PROPERTY\n SD_BUS_PROPERTY\n SD_BUS_PARAM\n\n Declare properties and methods for a D-Bus path\n \n\n \n \n #include <elogind/sd-bus-vtable.h>\n\n \n\n \n typedef int (*sd_bus_property_get_t)\n sd_bus *bus\n const char *path\n const char *interface\n const char *property\n sd_bus_message *reply\n void *userdata\n sd_bus_error *ret_error\n \n\n \n typedef int (*sd_bus_property_set_t)\n sd_bus *bus\n const char *path\n const char *interface\n const char *property\n sd_bus_message *value\n void *userdata\n sd_bus_error *ret_error\n \n\n \n typedef int (*sd_bus_object_find_t)\n const char *path\n const char *interface\n void *userdata\n void **ret_found\n sd_bus_error *ret_error\n \n\n \n int sd_bus_add_object\n sd_bus *bus\n sd_bus_slot **slot\n const char *path\n sd_bus_message_handler_t callback\n void *userdata\n \n\n \n int sd_bus_add_fallback\n sd_bus *bus\n sd_bus_slot **slot\n const char *path\n sd_bus_message_handler_t callback\n void *userdata\n \n\n \n int sd_bus_add_object_vtable\n sd_bus *bus\n sd_bus_slot **slot\n const char *path\n const char *interface\n const sd_bus_vtable *vtable\n void *userdata\n \n\n \n int sd_bus_add_fallback_vtable\n sd_bus *bus\n sd_bus_slot **slot\n const char *prefix\n const char *interface\n const sd_bus_vtable *vtable\n sd_bus_object_find_t find\n void *userdata\n \n\n \n int sd_bus_add_filter\n sd_bus *bus\n sd_bus_slot **slot\n sd_bus_message_handler_t callback\n void *userdata\n \n\n \n SD_BUS_VTABLE_START(flags)\n \n \n SD_BUS_VTABLE_END\n \n \n SD_BUS_METHOD_WITH_ARGS_OFFSET(\n member,\n args,\n result,\n handler,\n offset,\n flags)\n \n \n \n SD_BUS_METHOD_WITH_ARGS(\n member,\n args,\n result,\n handler,\n flags)\n \n \n \n SD_BUS_METHOD_WITH_NAMES_OFFSET(\n member,\n signature,\n in_names,\n result,\n out_names,\n handler,\n offset,\n flags)\n \n \n \n SD_BUS_METHOD_WITH_NAMES(\n member,\n signature,\n in_names,\n result,\n out_names,\n handler,\n flags)\n \n \n \n SD_BUS_METHOD_WITH_OFFSET(\n member,\n signature,\n result,\n handler,\n offset,\n flags)\n \n \n \n SD_BUS_METHOD(\n member,\n signature,\n result,\n handler,\n flags)\n \n \n \n SD_BUS_SIGNAL_WITH_ARGS(\n member,\n args,\n flags)\n \n \n \n SD_BUS_SIGNAL_WITH_NAMES(\n member,\n signature,\n names,\n flags)\n \n \n \n SD_BUS_SIGNAL(\n member,\n signature,\n flags)\n \n \n \n SD_BUS_WRITABLE_PROPERTY(\n member,\n signature,\n get,\n set,\n offset,\n flags)\n \n \n \n SD_BUS_PROPERTY(\n member,\n signature,\n get,\n offset,\n flags)\n \n \n \n SD_BUS_PARAM(name)\n SD_BUS_ARGS(...)\n SD_BUS_RESULT(...)\n SD_BUS_NO_ARGS\n SD_BUS_NO_RESULT\n \n \n \n\n \n Description\n\n sd_bus_add_object_vtable() is used to declare attributes for the\n object path path connected to the bus connection\n bus under the interface interface. The table\n vtable may contain property declarations using\n SD_BUS_PROPERTY() or SD_BUS_WRITABLE_PROPERTY(),\n method declarations using SD_BUS_METHOD(),\n SD_BUS_METHOD_WITH_NAMES(),\n SD_BUS_METHOD_WITH_OFFSET(), or\n SD_BUS_METHOD_WITH_NAMES_OFFSET(), and signal declarations using\n SD_BUS_SIGNAL_WITH_NAMES() or SD_BUS_SIGNAL(), see\n below. The userdata parameter contains a pointer that will be passed\n to various callback functions. It may be specified as NULL if no value is\n necessary. An interface can have any number of vtables attached to it.\n\n sd_bus_add_fallback_vtable() is similar to\n sd_bus_add_object_vtable(), but is used to register \"fallback\" attributes.\n When looking for an attribute declaration, bus object paths registered with\n sd_bus_add_object_vtable() are checked first. If no match is found, the\n fallback vtables are checked for each prefix of the bus object path, i.e. with the last\n slash-separated components successively removed. This allows the vtable to be used for an\n arbitrary number of dynamically created objects.\n\n Parameter find is a function which is used to locate the target\n object based on the bus object path path. It must return\n 1 and set the ret_found output parameter if the\n object is found, return 0 if the object was not found, and return a\n negative errno-style error code or initialize the error structure\n ret_error on error. The pointer passed in\n ret_found will be used as the userdata parameter\n for the callback functions (offset by the offset offsets as specified in\n the vtable entries).\n\n sd_bus_add_object() attaches a callback directly to the object path\n path. An object path can have any number of callbacks attached to it.\n Each callback is prepended to the list of callbacks which are always called in order.\n sd_bus_add_fallback() is similar to\n sd_bus_add_object() but applies to fallback paths instead.\n\n sd_bus_add_filter() installs a callback that is invoked for each\n incoming D-Bus message. Filters can be used to handle logic common to all messages received by\n a service (e.g. authentication or authorization).\n\n When a request is received, any associated callbacks are called sequentially until a\n callback returns a non-zero integer. Return zero from a callback to give other callbacks the\n chance to process the request. Callbacks are called in the following order: first, global\n callbacks installed with sd_bus_add_filter() are called. Second, callbacks\n attached directly to the request object path are called, followed by any D-Bus method callbacks\n attached to the request object path, interface and member. Finally, the property callbacks\n attached to the request object path, interface and member are called. If the final callback\n returns zero, an error reply is sent back to the caller indicating no matching object for the\n request was found. Note that you can return a positive integer from a callback without\n immediately sending a reply. This informs sd-bus this callback will take responsibility for\n replying to the request without forcing the callback to produce a reply immediately. This allows\n a callback to perform any number of asynchronous operations required to construct a reply. Note\n that if producing a reply takes too long, the method call will time out at the caller.\n\n If a callback was invoked to handle a request that expects a reply and the callback\n returns a negative value, the value is interpreted as a negative errno-style error code and sent\n back to the caller as a D-Bus error as if\n sd_bus_reply_method_errno3\n was called. Additionally, all callbacks take a sd_bus_error output\n parameter that can be used to provide more detailed error information. If\n ret_error is set when the callback finishes, the corresponding D-Bus\n error is sent back to the caller as if\n sd_bus_reply_method_error3\n was called. Any error stored in ret_error takes priority over any\n negative values returned by the same callback when determining which error to send back to\n the caller. Use\n sd_bus_error_set3\n or one of its variants to set ret_error and return a negative integer\n from a callback with a single function call. To send an error reply after a callback has already\n finished, use\n sd_bus_reply_method_errno3\n or one of its variants.\n\n For all functions, a match slot is created internally. If the output parameter\n slot is NULL, a \"floating\" slot object is\n created, see\n sd_bus_slot_set_floating3.\n Otherwise, a pointer to the slot object is returned. In that case, the reference to the slot\n object should be dropped when the vtable is not needed anymore, see\n sd_bus_slot_unref3.\n \n\n \n The <structname>sd_bus_vtable</structname> array\n\n The array consists of the structures of type sd_bus_vtable, but it\n should never be filled in manually, but through one of the following macros:\n\n \n \n SD_BUS_VTABLE_START()\n SD_BUS_VTABLE_END\n\n Those must always be the first and last element.\n \n\n \n SD_BUS_METHOD_WITH_ARGS_OFFSET()\n SD_BUS_METHOD_WITH_ARGS()\n\n Declare a D-Bus method with the name member,\n arguments args and result result.\n args expects a sequence of argument type/name pairs wrapped in the\n SD_BUS_ARGS() macro. The elements at even indices in this list describe the\n types of the method's arguments. The method's parameter signature is the concatenation of all the\n string literals at even indices in args. If a method has no parameters,\n pass SD_BUS_NO_ARGS to args. The elements at uneven\n indices describe the names of the method's arguments. result expects a\n sequence of type/name pairs wrapped in the SD_BUS_RESULT() macro in the same\n format as SD_BUS_ARGS(). The method's result signature is the concatenation of\n all the string literals at even indices in result. If a method has no\n result, pass SD_BUS_NO_RESULT to result. Note that\n argument types are expected to be quoted string literals and argument names are expected to be\n unquoted string literals. See below for a complete example.\n\n The handler function handler must be of type\n sd_bus_message_handler_t. It will be called to handle the incoming messages\n that call this method. It receives a pointer that is the userdata\n parameter passed to the registration function offset by offset bytes.\n This may be used to pass pointers to different fields in the same data structure to different\n methods in the same vtable. To send a reply from handler, call\n sd_bus_reply_method_return3\n with the message the callback was invoked with. Parameter flags is a\n combination of flags, see below.\n\n SD_BUS_METHOD_WITH_ARGS() is a shorthand for calling\n SD_BUS_METHOD_WITH_ARGS_OFFSET() with an offset of zero.\n \n \n\n \n SD_BUS_METHOD_WITH_NAMES_OFFSET()\n SD_BUS_METHOD_WITH_NAMES()\n SD_BUS_METHOD_WITH_OFFSET()\n SD_BUS_METHOD()\n\n Declare a D-Bus method with the name member,\n parameter signature signature, result signature\n result. Parameters in_names and\n out_names specify the argument names of the input and output\n arguments in the function signature. in_names and\n out_names should be created using the\n SD_BUS_PARAM() macro, see below. In all other regards, this macro behaves\n exactly the same as SD_BUS_METHOD_WITH_ARGS_OFFSET().\n\n SD_BUS_METHOD_WITH_NAMES(),\n SD_BUS_METHOD_WITH_OFFSET(), and SD_BUS_METHOD()\n are variants which specify zero offset (userdata parameter is\n passed with no change), leave the names unset (i.e. no parameter names), or both.\n\n Prefer using SD_BUS_METHOD_WITH_ARGS_OFFSET() and\n SD_BUS_METHOD_WITH_ARGS() over these macros as they allow specifying argument\n types and names next to each other which is less error-prone than first specifying all argument\n types followed by specifying all argument names.\n \n \n\n \n SD_BUS_SIGNAL_WITH_ARGS()\n\n >Declare a D-Bus signal with the name member and\n arguments args. args expects a sequence of\n argument type/name pairs wrapped in the SD_BUS_ARGS() macro. The elements at\n even indices in this list describe the types of the signal's arguments. The signal's parameter\n signature is the concatenation of all the string literals at even indices in\n args. If a signal has no parameters, pass\n SD_BUS_NO_ARGS to args. The elements at uneven\n indices describe the names of the signal's arguments. Parameter flags is\n a combination of flags. See below for a complete example.\n \n\n \n SD_BUS_SIGNAL_WITH_NAMES()\n SD_BUS_SIGNAL()\n\n Declare a D-Bus signal with the name member,\n parameter signature signature, and argument names\n names. names should be\n created using the SD_BUS_PARAM() macro, see below.\n Parameter flags is a combination of flags, see below.\n \n\n SD_BUS_SIGNAL() is equivalent to\n SD_BUS_SIGNAL_WITH_NAMES() with the names parameter\n unset (i.e. no parameter names).\n\n Prefer using SD_BUS_SIGNAL_WITH_ARGS() over these macros as it allows\n specifying argument types and names next to each other which is less error-prone than first\n specifying all argument types followed by specifying all argument names.\n \n \n\n \n SD_BUS_WRITABLE_PROPERTY()\n SD_BUS_PROPERTY()\n\n Declare a D-Bus property with the name member\n and value signature signature. Parameters\n get and set are the getter and\n setter methods. They are called with a pointer that is the\n userdata parameter passed to the registration function offset\n by offset bytes. This may be used pass pointers to different\n fields in the same data structure to different setters and getters in the same vtable.\n Parameter flags is a combination of flags, see below.\n\n The setter and getter methods may be omitted (specified as\n NULL), if the property is one of the basic types or\n as in case of read-only properties. In those cases, the\n userdata and offset parameters must\n together point to a valid variable of the corresponding type. A default setter and getter\n will be provided, which simply copy the argument between this variable and the message.\n \n\n SD_BUS_PROPERTY() is used to define a read-only property.\n \n \n\n \n SD_BUS_PARAM()\n Parameter names should be wrapped in this macro, see the example below.\n \n \n \n \n\n \n Flags\n\n The flags parameter is used to specify a combination of\n D-Bus annotations.\n \n\n \n \n SD_BUS_VTABLE_DEPRECATED\n\n Mark this vtable entry as deprecated using the\n org.freedesktop.DBus.Deprecated annotation in introspection data. If\n specified for SD_BUS_VTABLE_START(), the annotation is applied to the\n enclosing interface.\n \n\n \n SD_BUS_VTABLE_HIDDEN\n\n Make this vtable entry hidden. It will not be shown in introspection data.\n If specified for SD_BUS_VTABLE_START(), all entries in the array are\n hidden.\n \n\n \n SD_BUS_VTABLE_UNPRIVILEGED\n\n Mark this vtable entry as unprivileged. If not specified, the\n org.freedesktop.systemd1.Privileged annotation with value\n true will be shown in introspection data.\n \n\n \n SD_BUS_VTABLE_METHOD_NO_REPLY\n\n Mark his vtable entry as a method that will not return a reply using the\n org.freedesktop.DBus.Method.NoReply annotation in introspection data.\n \n \n\n \n SD_BUS_VTABLE_PROPERTY_CONST\n SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE\n SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION\n\n Those three flags correspond to different values of the\n org.freedesktop.DBus.Property.EmitsChangedSignal annotation, which\n specifies whether the\n org.freedesktop.DBus.Properties.PropertiesChanged signal is emitted\n whenever the property changes. SD_BUS_VTABLE_PROPERTY_CONST\n corresponds to const and means that the property never changes during\n the lifetime of the object it belongs to, so no signal needs to be emitted.\n SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE corresponds to\n true and means that the signal is emitted.\n SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION corresponds to\n invalidates and means that the signal is emitted, but the value is\n not included in the signal.\n \n\n \n SD_BUS_VTABLE_PROPERTY_EXPLICIT\n\n Mark this vtable property entry as requiring explicit request to for the\n value to be shown (generally because the value is large or slow to calculate). This entry\n cannot be combined with SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE, and will\n not be shown in property listings by default (e.g. busctl introspect).\n This corresponds to the org.freedesktop.systemd1.Explicit annotation\n in introspection data.\n \n\n \n SD_BUS_VTABLE_SENSITIVE\n\n Mark this vtable method entry as processing sensitive data. When set,\n incoming method call messages and their outgoing reply messages are marked as sensitive using\n sd_bus_message_sensitive3,\n so that they are erased from memory when freed.\n \n\n \n SD_BUS_VTABLE_ABSOLUTE_OFFSET\n\n Mark this vtable method or property entry so that the user data pointer passed to\n its associated handler functions is determined slightly differently: instead of adding the offset\n parameter of the entry to the user data pointer specified during vtable registration, the offset is\n passed directly, converted to a pointer, without taking the user data pointer specified during\n vtable registration into account.\n \n \n \n \n\n \n Examples\n\n \n Create a simple listener on the bus\n\n \n\n This creates a simple client on the bus (the user bus, when run as normal user). We may\n use the D-Bus org.freedesktop.DBus.Introspectable.Introspect call to\n acquire the XML description of the interface:\n\n \n \n \n\n \n Return Value\n\n On success, sd_bus_add_object_vtable() and\n sd_bus_add_fallback_vtable() return a non-negative integer. On\n failure, they return a negative errno-style error code.\n\n \n Errors\n\n Returned errors may indicate the following problems:\n\n \n \n -EINVAL\n\n One of the required parameters is NULL or invalid. A\n reserved D-Bus interface was passed as the interface parameter.\n \n \n\n \n -ENOPKG\n\n The bus cannot be resolved.\n \n\n \n -ECHILD\n\n The bus was created in a different process.\n \n\n \n -ENOMEM\n\n Memory allocation failed.\n \n\n \n -EPROTOTYPE\n\n sd_bus_add_object_vtable and\n sd_bus_add_fallback_vtable have been both called for the same bus\n object path, which is not allowed.\n \n\n \n -EEXIST\n\n This vtable has already been registered for this\n interface and path.\n \n \n \n \n \n\n \n\n \n See Also\n\n \n sd-bus3,\n busctl1,\n sd_bus_emit_properties_changed3,\n sd_bus_emit_object_added3\n \n \n\n"} +{"text": "#!/usr/bin/perl\n\n# Copyright (C) Intel, Inc.\n# (C) Sergey Kandaurov\n# (C) Nginx, Inc.\n\n# Tests for stream map module.\n\n###############################################################################\n\nuse warnings;\nuse strict;\n\nuse Test::More;\n\nBEGIN { use FindBin; chdir($FindBin::Bin); }\n\nuse lib 'lib';\nuse Test::Nginx;\nuse Test::Nginx::Stream qw/ stream /;\n\n###############################################################################\n\nselect STDERR; $| = 1;\nselect STDOUT; $| = 1;\n\nmy $t = Test::Nginx->new()->has(qw/stream stream_return stream_map/)\n ->has(qw/http rewrite/);\n\n$t->write_file_expand('nginx.conf', <<'EOF');\n\n%%TEST_GLOBALS%%\n\ndaemon off;\n\nevents {\n}\n\nstream {\n map $server_port $x {\n %%PORT_8080%% literal;\n default default;\n ~(%%PORT_8082%%) $1;\n ~(?P%%PORT_8083%%) $ncap;\n }\n\n server {\n listen 127.0.0.1:8080;\n listen 127.0.0.1:8081;\n listen 127.0.0.1:8082;\n listen 127.0.0.1:8083;\n return $x;\n }\n\n server {\n listen 127.0.0.1:8084;\n return $x:${x};\n }\n}\n\nEOF\n\n$t->run()->plan(5);\n\n###############################################################################\n\nis(stream('127.0.0.1:' . port(8080))->read(), 'literal', 'literal');\nis(stream('127.0.0.1:' . port(8081))->read(), 'default', 'default');\nis(stream('127.0.0.1:' . port(8082))->read(), port(8082), 'capture');\nis(stream('127.0.0.1:' . port(8083))->read(), port(8083), 'named capture');\nis(stream('127.0.0.1:' . port(8084))->read(), 'default:default', 'braces');\n\n###############################################################################\n"} +{"text": "import { module, test } from 'qunit';\nimport { setupRenderingTest } from 'ember-qunit';\nimport { render, find } from '@ember/test-helpers';\nimport hbs from 'htmlbars-inline-precompile';\n\nmodule('Integration | Component | lt spanned row', function(hooks) {\n setupRenderingTest(hooks);\n\n test('it renders', async function(assert) {\n await render(hbs`{{lt-spanned-row}}`);\n assert.equal(find('*').textContent.trim(), '');\n\n await render(hbs`\n {{#lt-spanned-row}}\n template block text\n {{/lt-spanned-row}}\n `);\n\n assert.equal(find('*').textContent.trim(), 'template block text');\n });\n\n test('visiblity', async function(assert) {\n this.set('visible', true);\n\n await render(hbs`\n {{#lt-spanned-row visible=visible}}\n template block text\n {{/lt-spanned-row}}\n `);\n assert.equal(find('*').textContent.trim(), 'template block text');\n\n this.set('visible', false);\n assert.equal(find('*').textContent.trim(), '');\n });\n\n test('colspan', async function(assert) {\n await render(hbs`\n {{#lt-spanned-row colspan=4}}\n template block text\n {{/lt-spanned-row}}\n `);\n assert.equal(find('*').textContent.trim(), 'template block text');\n assert.equal(find('td').getAttribute('colspan'), 4);\n });\n\n test('yield', async function(assert) {\n\n await render(hbs`\n {{#lt-spanned-row yield=(hash name=\"Offir\") as |row|}}\n {{row.name}}\n {{/lt-spanned-row}}\n `);\n assert.equal(find('*').textContent.trim(), 'Offir');\n });\n});"} +{"text": "---\r\n-api-id: M:Windows.ApplicationModel.LimitedAccessFeatures.TryUnlockFeature(System.String,System.String,System.String)\r\n-api-type: winrt method\r\nms.custom: RS5\r\n---\r\n\r\n\r\n\r\n# Windows.ApplicationModel.LimitedAccessFeatures.TryUnlockFeature\r\n\r\n## -description\r\n\r\nSubmits a request to Microsoft to authorize use of a specific Limited Access Feature. Users must have previously obtained a feature ID and a token from Microsoft in order to successfully call this API.\r\n\r\n## -parameters\r\n### -param featureId\r\n\r\nThe ID, provided by Microsoft. that identifies the feature being requested.\r\n\r\n### -param token\r\n\r\nThe string receieved from Microsoft upon agreeing to the requirements for use of the feature.\r\n\r\n### -param attestation\r\n\r\nA plain-english statement declaring that the publisher has permission to use the feature.\r\n\r\n## -returns\r\n\r\nA [LimitedAccessFeatureRequestResult](limitedaccessfeaturerequestresult.md) value indicating the response to the user request.\r\n\r\n## -remarks\r\n\r\n## -see-also\r\n\r\n## -examples\r\n\r\n"} +{"text": "fileFormatVersion: 2\nguid: 7e1f2653a43e42e4b8abb0daebc49987\ntimeCreated: 1512782108\nlicenseType: Free\nTextureImporter:\n fileIDToRecycleName: {}\n serializedVersion: 4\n mipmaps:\n mipMapMode: 0\n enableMipMap: 1\n sRGBTexture: 1\n linearTexture: 0\n fadeOut: 0\n borderMipMap: 0\n mipMapsPreserveCoverage: 0\n alphaTestReferenceValue: 0.5\n mipMapFadeDistanceStart: 1\n mipMapFadeDistanceEnd: 3\n bumpmap:\n convertToNormalMap: 0\n externalNormalMap: 0\n heightScale: 0.25\n normalMapFilter: 0\n isReadable: 0\n grayScaleToAlpha: 0\n generateCubemap: 6\n cubemapConvolution: 0\n seamlessCubemap: 0\n textureFormat: 1\n maxTextureSize: 2048\n textureSettings:\n serializedVersion: 2\n filterMode: -1\n aniso: -1\n mipBias: -1\n wrapU: -1\n wrapV: -1\n wrapW: -1\n nPOTScale: 1\n lightmap: 0\n compressionQuality: 50\n spriteMode: 0\n spriteExtrude: 1\n spriteMeshType: 1\n alignment: 0\n spritePivot: {x: 0.5, y: 0.5}\n spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n spritePixelsToUnits: 100\n alphaUsage: 1\n alphaIsTransparency: 0\n spriteTessellationDetail: -1\n textureType: 0\n textureShape: 1\n maxTextureSizeSet: 0\n compressionQualitySet: 0\n textureFormatSet: 0\n platformSettings:\n - buildTarget: DefaultTexturePlatform\n maxTextureSize: 2048\n textureFormat: -1\n textureCompression: 1\n compressionQuality: 50\n crunchedCompression: 0\n allowsAlphaSplitting: 0\n overridden: 0\n spriteSheet:\n serializedVersion: 2\n sprites: []\n outline: []\n physicsShape: []\n spritePackingTag: \n userData: \n assetBundleName: \n assetBundleVariant: \n"} +{"text": "#!/usr/bin/env perl\n##\n## Copyright (c) 2013 The WebM project authors. All Rights Reserved.\n##\n## Use of this source code is governed by a BSD-style license\n## that can be found in the LICENSE file in the root of the source\n## tree. An additional intellectual property rights grant can be found\n## in the file PATENTS. All contributing project authors may\n## be found in the AUTHORS file in the root of the source tree.\n##\n\npackage thumb;\n\nsub FixThumbInstructions($$)\n{\n my $short_branches = $_[1];\n my $branch_shift_offset = $short_branches ? 1 : 0;\n\n # Write additions with shifts, such as \"add r10, r11, lsl #8\",\n # in three operand form, \"add r10, r10, r11, lsl #8\".\n s/(add\\s+)(r\\d+),\\s*(r\\d+),\\s*(lsl #\\d+)/$1$2, $2, $3, $4/g;\n\n # Convert additions with a non-constant shift into a sequence\n # with left shift, addition and a right shift (to restore the\n # register to the original value). Currently the right shift\n # isn't necessary in the code base since the values in these\n # registers aren't used, but doing the shift for consistency.\n # This converts instructions such as \"add r12, r12, r5, lsl r4\"\n # into the sequence \"lsl r5, r4\", \"add r12, r12, r5\", \"lsr r5, r4\".\n s/^(\\s*)(add)(\\s+)(r\\d+),\\s*(r\\d+),\\s*(r\\d+),\\s*lsl (r\\d+)/$1lsl$3$6, $7\\n$1$2$3$4, $5, $6\\n$1lsr$3$6, $7/g;\n\n # Convert loads with right shifts in the indexing into a\n # sequence of an add, load and sub. This converts\n # \"ldrb r4, [r9, lr, asr #1]\" into \"add r9, r9, lr, asr #1\",\n # \"ldrb r9, [r9]\", \"sub r9, r9, lr, asr #1\".\n s/^(\\s*)(ldrb)(\\s+)(r\\d+),\\s*\\[(\\w+),\\s*(\\w+),\\s*(asr #\\d+)\\]/$1add $3$5, $5, $6, $7\\n$1$2$3$4, [$5]\\n$1sub $3$5, $5, $6, $7/g;\n\n # Convert register indexing with writeback into a separate add\n # instruction. This converts \"ldrb r12, [r1, r2]!\" into\n # \"ldrb r12, [r1, r2]\", \"add r1, r1, r2\".\n s/^(\\s*)(ldrb)(\\s+)(r\\d+),\\s*\\[(\\w+),\\s*(\\w+)\\]!/$1$2$3$4, [$5, $6]\\n$1add $3$5, $6/g;\n\n # Convert negative register indexing into separate sub/add instructions.\n # This converts \"ldrne r4, [src, -pstep, lsl #1]\" into\n # \"subne src, src, pstep, lsl #1\", \"ldrne r4, [src]\",\n # \"addne src, src, pstep, lsl #1\". In a couple of cases where\n # this is used, it's used for two subsequent load instructions,\n # where a hand-written version of it could merge two subsequent\n # add and sub instructions.\n s/^(\\s*)((ldr|str|pld)(ne)?)(\\s+)(r\\d+,\\s*)?\\[(\\w+), -([^\\]]+)\\]/$1sub$4$5$7, $7, $8\\n$1$2$5$6\\[$7\\]\\n$1add$4$5$7, $7, $8/g;\n\n # Convert register post indexing to a separate add instruction.\n # This converts \"ldrneb r9, [r0], r2\" into \"ldrneb r9, [r0]\",\n # \"addne r0, r0, r2\".\n s/^(\\s*)((ldr|str)(ne)?[bhd]?)(\\s+)(\\w+),(\\s*\\w+,)?\\s*\\[(\\w+)\\],\\s*(\\w+)/$1$2$5$6,$7 [$8]\\n$1add$4$5$8, $8, $9/g;\n\n # Convert \"mov pc, lr\" into \"bx lr\", since the former only works\n # for switching from arm to thumb (and only in armv7), but not\n # from thumb to arm.\n s/mov(\\s*)pc\\s*,\\s*lr/bx$1lr/g;\n}\n\n1;\n"} +{"text": "package clone\n\n// MapOfStringToSliceOfString deep copy a map[string][]string\nfunc MapOfStringToSliceOfString(source map[string][]string) map[string][]string {\n\tif source == nil {\n\t\treturn nil\n\t}\n\tres := make(map[string][]string, len(source))\n\tfor k, v := range source {\n\t\tres[k] = SliceOfString(v)\n\t}\n\treturn res\n}\n\n// MapOfStringToInt deep copy a map[string]int\nfunc MapOfStringToInt(source map[string]int) map[string]int {\n\tif source == nil {\n\t\treturn nil\n\t}\n\tres := make(map[string]int, len(source))\n\tfor k, v := range source {\n\t\tres[k] = v\n\t}\n\treturn res\n}\n"} +{"text": "import { getLogger } from './logger';\n\nlet queue: Array<{\n message: string;\n meta?: any[];\n}> = [];\n\nexport function debugLog(message: string, ...meta: any[]) {\n if (!process.env.GQL_CODEGEN_NODEBUG && process.env.DEBUG !== undefined) {\n queue.push({\n message,\n meta,\n });\n }\n}\n\nexport function printLogs() {\n if (!process.env.GQL_CODEGEN_NODEBUG && process.env.DEBUG !== undefined) {\n queue.forEach(log => {\n getLogger().info(log.message, ...log.meta);\n });\n resetLogs();\n }\n}\n\nexport function resetLogs() {\n queue = [];\n}\n"} +{"text": "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# ==============================================================================\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\n\nfrom tensorflow.python.ops import math_ops\nfrom tensorflow.python.platform import test\n\n\nclass TraceTest(test.TestCase):\n\n def setUp(self):\n x = np.random.seed(0)\n\n def compare(self, x):\n np_ans = np.trace(x, axis1=-2, axis2=-1)\n with self.test_session(use_gpu=True):\n tf_ans = math_ops.trace(x).eval()\n self.assertAllClose(tf_ans, np_ans)\n\n def testTrace(self):\n for dtype in [np.int32, np.float32, np.float64]:\n for shape in [[2, 2], [2, 3], [3, 2], [2, 3, 2], [2, 2, 2, 3]]:\n x = np.random.rand(np.prod(shape)).astype(dtype).reshape(shape)\n self.compare(x)\n\n\nif __name__ == \"__main__\":\n test.main()\n"} +{"text": "/*\n * Copyright (C) 2011 The Guava Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n */\n\npackage com.google.common.hash;\n\nimport com.google.common.annotations.Beta;\nimport com.google.common.base.Preconditions;\nimport java.io.OutputStream;\nimport java.io.Serializable;\nimport java.nio.charset.Charset;\nimport javax.annotation.Nullable;\n\n/**\n * Funnels for common types. All implementations are serializable.\n *\n * @author Dimitris Andreou\n * @since 11.0\n */\n\n\n@Beta\npublic final class Funnels {\n private Funnels() {}\n\n /**\n * Returns a funnel that extracts the bytes from a {@code byte} array.\n */\n\n\n public static Funnel byteArrayFunnel() {\n return ByteArrayFunnel.INSTANCE;\n }\n\n private enum ByteArrayFunnel implements Funnel {\n INSTANCE;\n\n public void funnel(byte[] from, PrimitiveSink into) {\n into.putBytes(from);\n }\n\n @Override\n public String toString() {\n return \"Funnels.byteArrayFunnel()\";\n }\n }\n\n /**\n * Returns a funnel that extracts the characters from a {@code CharSequence}, a character at a\n * time, without performing any encoding. If you need to use a specific encoding, use\n * {@link Funnels#stringFunnel(Charset)} instead.\n *\n * @since 15.0 (since 11.0 as {@code Funnels.stringFunnel()}.\n */\n\n\n public static Funnel unencodedCharsFunnel() {\n return UnencodedCharsFunnel.INSTANCE;\n }\n\n private enum UnencodedCharsFunnel implements Funnel {\n INSTANCE;\n\n public void funnel(CharSequence from, PrimitiveSink into) {\n into.putUnencodedChars(from);\n }\n\n @Override\n public String toString() {\n return \"Funnels.unencodedCharsFunnel()\";\n }\n }\n\n /**\n * Returns a funnel that encodes the characters of a {@code CharSequence} with the specified\n * {@code Charset}.\n *\n * @since 15.0\n */\n\n\n public static Funnel stringFunnel(Charset charset) {\n return new StringCharsetFunnel(charset);\n }\n\n private static class StringCharsetFunnel implements Funnel, Serializable {\n private final Charset charset;\n\n StringCharsetFunnel(Charset charset) {\n this.charset = Preconditions.checkNotNull(charset);\n }\n\n\n public void funnel(CharSequence from, PrimitiveSink into) {\n into.putString(from, charset);\n }\n\n @Override\n public String toString() {\n return \"Funnels.stringFunnel(\" + charset.name() + \")\";\n }\n\n @Override\n public boolean equals(@Nullable Object o) {\n if (o instanceof StringCharsetFunnel) {\n StringCharsetFunnel funnel = (StringCharsetFunnel) o;\n return this.charset.equals(funnel.charset);\n }\n return false;\n }\n\n @Override\n public int hashCode() {\n return StringCharsetFunnel.class.hashCode() ^ charset.hashCode();\n }\n\n Object writeReplace() {\n return new SerializedForm(charset);\n }\n\n private static class SerializedForm implements Serializable {\n private final String charsetCanonicalName;\n\n SerializedForm(Charset charset) {\n this.charsetCanonicalName = charset.name();\n }\n\n private Object readResolve() {\n return stringFunnel(Charset.forName(charsetCanonicalName));\n }\n\n private static final long serialVersionUID = 0;\n }\n }\n\n /**\n * Returns a funnel for integers.\n *\n * @since 13.0\n */\n\n\n public static Funnel integerFunnel() {\n return IntegerFunnel.INSTANCE;\n }\n\n private enum IntegerFunnel implements Funnel {\n INSTANCE;\n\n public void funnel(Integer from, PrimitiveSink into) {\n into.putInt(from);\n }\n\n @Override\n public String toString() {\n return \"Funnels.integerFunnel()\";\n }\n }\n\n /**\n * Returns a funnel that processes an {@code Iterable} by funneling its elements in iteration\n * order with the specified funnel. No separators are added between the elements.\n *\n * @since 15.0\n */\n\n\n public static Funnel> sequentialFunnel(Funnel elementFunnel) {\n return new SequentialFunnel(elementFunnel);\n }\n\n private static class SequentialFunnel implements Funnel>, Serializable {\n private final Funnel elementFunnel;\n\n SequentialFunnel(Funnel elementFunnel) {\n this.elementFunnel = Preconditions.checkNotNull(elementFunnel);\n }\n\n\n public void funnel(Iterable from, PrimitiveSink into) {\n for (E e : from) {\n elementFunnel.funnel(e, into);\n }\n }\n\n @Override\n public String toString() {\n return \"Funnels.sequentialFunnel(\" + elementFunnel + \")\";\n }\n\n @Override\n public boolean equals(@Nullable Object o) {\n if (o instanceof SequentialFunnel) {\n SequentialFunnel funnel = (SequentialFunnel) o;\n return elementFunnel.equals(funnel.elementFunnel);\n }\n return false;\n }\n\n @Override\n public int hashCode() {\n return SequentialFunnel.class.hashCode() ^ elementFunnel.hashCode();\n }\n }\n\n /**\n * Returns a funnel for longs.\n *\n * @since 13.0\n */\n\n\n public static Funnel longFunnel() {\n return LongFunnel.INSTANCE;\n }\n\n private enum LongFunnel implements Funnel {\n INSTANCE;\n\n public void funnel(Long from, PrimitiveSink into) {\n into.putLong(from);\n }\n\n @Override\n public String toString() {\n return \"Funnels.longFunnel()\";\n }\n }\n\n /**\n * Wraps a {@code PrimitiveSink} as an {@link OutputStream}, so it is easy to {@link Funnel#funnel\n * funnel} an object to a {@code PrimitiveSink} if there is already a way to write the contents of\n * the object to an {@code OutputStream}.\n *\n *

The {@code close} and {@code flush} methods of the returned {@code OutputStream} do nothing,\n * and no method throws {@code IOException}.\n *\n * @since 13.0\n */\n\n\n public static OutputStream asOutputStream(PrimitiveSink sink) {\n return new SinkAsStream(sink);\n }\n\n private static class SinkAsStream extends OutputStream {\n final PrimitiveSink sink;\n\n SinkAsStream(PrimitiveSink sink) {\n this.sink = Preconditions.checkNotNull(sink);\n }\n\n @Override\n public void write(int b) {\n sink.putByte((byte) b);\n }\n\n @Override\n public void write(byte[] bytes) {\n sink.putBytes(bytes);\n }\n\n @Override\n public void write(byte[] bytes, int off, int len) {\n sink.putBytes(bytes, off, len);\n }\n\n @Override\n public String toString() {\n return \"Funnels.asOutputStream(\" + sink + \")\";\n }\n }\n}"} +{"text": "Fabricator(:mention) do\n account\n status\nend\n"} +{"text": "\n(define-library (srfi 160 s32)\n (export\n make-s32vector\n s32?\n s32vector?\n s32vector-ref\n s32vector-set!\n s32vector-length\n (rename vector s32vector)\n (rename uvector-unfold s32vector-unfold)\n (rename uvector-unfold-right s32vector-unfold-right)\n (rename vector-copy s32vector-copy)\n (rename vector-reverse-copy s32vector-reverse-copy)\n (rename vector-append s32vector-append)\n (rename vector-concatenate s32vector-concatenate)\n (rename vector-append-subvectors s32vector-append-subvectors)\n (rename vector-empty? s32vector-empty?)\n (rename vector= s32vector=)\n (rename vector-take s32vector-take)\n (rename vector-take-right s32vector-take-right)\n (rename vector-drop s32vector-drop)\n (rename vector-drop-right s32vector-drop-right)\n (rename vector-segment s32vector-segment)\n (rename vector-fold s32vector-fold)\n (rename vector-fold-right s32vector-fold-right)\n (rename vector-map s32vector-map)\n (rename vector-map! s32vector-map!)\n (rename vector-for-each s32vector-for-each)\n (rename vector-count s32vector-count)\n (rename vector-cumulate s32vector-cumulate)\n (rename vector-take-while s32vector-take-while)\n (rename vector-take-while-right s32vector-take-while-right)\n (rename vector-drop-while s32vector-drop-while)\n (rename vector-drop-while-right s32vector-drop-while-right)\n (rename vector-index s32vector-index)\n (rename vector-index-right s32vector-index-right)\n (rename vector-skip s32vector-skip)\n (rename vector-skip-right s32vector-skip-right)\n (rename vector-binary-search s32vector-binary-search)\n (rename vector-any s32vector-any)\n (rename vector-every s32vector-every)\n (rename vector-partition s32vector-partition)\n (rename vector-filter s32vector-filter)\n (rename vector-remove s32vector-remove)\n (rename vector-swap! s32vector-swap!)\n (rename vector-fill! s32vector-fill!)\n (rename vector-reverse! s32vector-reverse!)\n (rename vector-copy! s32vector-copy!)\n (rename vector-reverse-copy! s32vector-reverse-copy!)\n (rename uvector->list s32vector->list)\n (rename reverse-vector->list reverse-s32vector->list)\n (rename list->uvector list->s32vector)\n (rename reverse-list->vector reverse-list->s32vector)\n (rename uvector->vector s32vector->vector)\n (rename vector->uvector vector->s32vector)\n (rename make-vector-generator make-s32vector-generator)\n (rename write-vector write-s32vector))\n (import (except (scheme base)\n vector-append vector-copy vector-copy!\n vector-map vector-for-each)\n (scheme write)\n (srfi 160 base))\n (begin\n (define uvector? s32vector?)\n (define make-uvector make-s32vector)\n (define uvector-length s32vector-length)\n (define uvector-ref s32vector-ref)\n (define uvector-set! s32vector-set!))\n (include \"uvector.scm\"))\n"} +{"text": "// This file was procedurally generated from the following sources:\n// - src/dstr-binding/ary-init-iter-close.case\n// - src/dstr-binding/default/async-gen-func-decl.template\n/*---\ndescription: Iterator is closed when not exhausted by pattern evaluation (async generator function declaration)\nesid: sec-asyncgenerator-definitions-instantiatefunctionobject\nfeatures: [Symbol.iterator, async-iteration]\nflags: [generated, async]\ninfo: |\n AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier\n ( FormalParameters ) { AsyncGeneratorBody }\n\n [...]\n 3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,\n scope, strict).\n [...]\n\n\n 13.3.3.5 Runtime Semantics: BindingInitialization\n\n BindingPattern : ArrayBindingPattern\n\n [...]\n 4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,\n result).\n [...]\n\n---*/\nvar doneCallCount = 0;\nvar iter = {};\niter[Symbol.iterator] = function() {\n return {\n next: function() {\n return { value: null, done: false };\n },\n return: function() {\n doneCallCount += 1;\n return {};\n }\n };\n};\n\n\nvar callCount = 0;\nasync function* f([x]) {\n assert.sameValue(doneCallCount, 1);\n callCount = callCount + 1;\n};\nf(iter).next().then(() => {\n assert.sameValue(callCount, 1, 'invoked exactly once');\n}).then($DONE, $DONE);\n"} +{"text": "//===-- include/flang/Common/template.h -------------------------*- C++ -*-===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef FORTRAN_COMMON_TEMPLATE_H_\n#define FORTRAN_COMMON_TEMPLATE_H_\n\n#include \"flang/Common/idioms.h\"\n#include \n#include \n#include \n#include \n#include \n#include \n\n// Utility templates for metaprogramming and for composing the\n// std::optional<>, std::tuple<>, and std::variant<> containers.\n\nnamespace Fortran::common {\n\n// SearchTypeList scans a list of types. The zero-based\n// index of the first type T in the list for which PREDICATE::value() is\n// true is returned, or -1 if the predicate is false for every type in the list.\n// This is a compile-time operation; see SearchTypes below for a run-time form.\ntemplate class PREDICATE, typename TUPLE>\nstruct SearchTypeListHelper {\n static constexpr int value() {\n if constexpr (N >= std::tuple_size_v) {\n return -1;\n } else if constexpr (PREDICATE>::value()) {\n return N;\n } else {\n return SearchTypeListHelper::value();\n }\n }\n};\n\ntemplate