diff --git "a/train/github-20-30396912.jsonl" "b/train/github-20-30396912.jsonl" new file mode 100644--- /dev/null +++ "b/train/github-20-30396912.jsonl" @@ -0,0 +1,515 @@ +{"text": "async function main() {\n\tconst foo = 1;\n\tconst ns = await import('./foo.js');\n\tconsole.log(ns.value + foo);\n}\n\nmain();\n"} +{"text": "[\n {\n \"description\": \"propertyNames validation\",\n \"schema\": {\n \"propertyNames\": {\"maxLength\": 3}\n },\n \"tests\": [\n {\n \"description\": \"all property names valid\",\n \"data\": {\n \"f\": {},\n \"foo\": {}\n },\n \"valid\": true\n },\n {\n \"description\": \"some property names invalid\",\n \"data\": {\n \"foo\": {},\n \"foobar\": {}\n },\n \"valid\": false\n },\n {\n \"description\": \"object without properties is valid\",\n \"data\": {},\n \"valid\": true\n },\n {\n \"description\": \"ignores arrays\",\n \"data\": [1, 2, 3, 4],\n \"valid\": true\n },\n {\n \"description\": \"ignores strings\",\n \"data\": \"foobar\",\n \"valid\": true\n },\n {\n \"description\": \"ignores other non-objects\",\n \"data\": 12,\n \"valid\": true\n }\n ]\n },\n {\n \"description\": \"propertyNames with boolean schema true\",\n \"schema\": {\"propertyNames\": true},\n \"tests\": [\n {\n \"description\": \"object with any properties is valid\",\n \"data\": {\"foo\": 1},\n \"valid\": true\n },\n {\n \"description\": \"empty object is valid\",\n \"data\": {},\n \"valid\": true\n }\n ]\n },\n {\n \"description\": \"propertyNames with boolean schema false\",\n \"schema\": {\"propertyNames\": false},\n \"tests\": [\n {\n \"description\": \"object with any properties is invalid\",\n \"data\": {\"foo\": 1},\n \"valid\": false\n },\n {\n \"description\": \"empty object is valid\",\n \"data\": {},\n \"valid\": true\n }\n ]\n }\n]\n"} +{"text": "/*\n * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.\n *\n * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.\n *\n * A copy of the MIT License is included in this file.\n *\n *\n * Terms of the MIT License:\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy,\n * modify, merge, publish, distribute, sublicense, 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 all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT\n * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, 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\npackage com.tencent.devops.dispatch.service.vm\n\nimport com.google.common.cache.CacheBuilder\nimport com.google.common.cache.CacheLoader\nimport com.tencent.devops.dispatch.dao.MachineDao\nimport com.tencent.devops.dispatch.dao.VMDao\nimport com.tencent.devops.dispatch.pojo.VM\nimport com.tencent.devops.dispatch.utils.VMUtils.getService\nimport com.tencent.devops.dispatch.utils.VMUtils.invalid\nimport com.vmware.vim25.mo.InventoryNavigator\nimport com.vmware.vim25.mo.VirtualMachine\nimport org.jooq.DSLContext\nimport org.slf4j.LoggerFactory\nimport org.springframework.beans.factory.annotation.Autowired\nimport org.springframework.stereotype.Component\nimport java.util.concurrent.ConcurrentHashMap\nimport java.util.concurrent.TimeUnit\n\nconst val VIRTUAL_MACHINE = \"VirtualMachine\"\n@Component\nclass VMCache @Autowired constructor(\n private val machineDao: MachineDao,\n private val vmDao: VMDao,\n private val dslContext: DSLContext\n) {\n\n private val cache = CacheBuilder.newBuilder()\n .maximumSize(3000)\n .expireAfterWrite(30, TimeUnit.MINUTES)\n .build(\n object : CacheLoader() {\n @Throws(Exception::class)\n override fun load(vmId: Long) = queryMachine(\n vmDao.parseVM(vmDao.findVMById(dslContext, vmId)))\n }\n )\n\n private val machine2VMMap = ConcurrentHashMap/*vmIds*/>()\n\n fun getVM(vmId: Long): VirtualMachine? {\n return cache.get(vmId)\n }\n\n fun expire(vmId: Long) {\n cache.invalidate(vmId)\n }\n\n fun expireByMachineId(machineId: Int) {\n val list = machine2VMMap.remove(machineId)\n list?.forEach(\n {\n expire(it)\n }\n )\n }\n\n private fun queryMachine(vm: VM?): VirtualMachine? {\n return if (vm == null) {\n null\n } else {\n val machine = machineDao.parseMachine(machineDao.findMachineById(dslContext, vm.machineId))\n\n return if (machine == null) {\n null\n } else {\n try {\n val si = getService(machine) ?: return null\n val rootFolder = si.rootFolder\n val virtualMachine = InventoryNavigator(\n rootFolder).searchManagedEntity(VIRTUAL_MACHINE, vm.name)\n if (virtualMachine != null) {\n val v = virtualMachine as VirtualMachine\n var list = machine2VMMap[vm.machineId]\n if (list == null) {\n list = ArrayList()\n machine2VMMap.put(vm.machineId, list)\n }\n\n list.add(vm.id)\n return v\n }\n\n null\n } catch (e: Exception) {\n logger.warn(\"Fail to get the vm service($machine)\", e)\n invalid(machine)\n null\n }\n }\n }\n }\n\n companion object {\n private val logger = LoggerFactory.getLogger(VMCache::class.java)\n }\n}"} +{"text": "__译注__:本模块用于设置iOS状态的显隐与样式。\n\n### 截图\n![statusbarios](img/api/statusbarios.png)\n\n### 方法\n\n\n
\n\t

static setStyle(style: StatusBarStyle, animated?: boolean) #

\n\t

static setHidden(hidden: boolean, animation?: StatusBarAnimation) #

\n\t

static setNetworkActivityIndicatorVisible(visible: boolean) #

\n
\n\n### 例子\n\n```javascript\n'use strict';\n\nvar React = require('react-native');\nvar {\n StyleSheet,\n View,\n Text,\n TouchableHighlight,\n StatusBarIOS,\n} = React;\n\nexports.framework = 'React';\nexports.title = 'StatusBarIOS';\nexports.description = 'Module for controlling iOS status bar';\nexports.examples = [{\n title: 'Status Bar Style',\n render() {\n return (\n \n {['default', 'light-content'].map((style) =>\n StatusBarIOS.setStyle(style)}>\n \n setStyle('{style}')\n \n \n )}\n \n );\n },\n}, {\n title: 'Status Bar Style Animated',\n render() {\n return (\n \n {['default', 'light-content'].map((style) =>\n StatusBarIOS.setStyle(style, true)}>\n \n setStyle('{style}', true)\n \n \n )}\n \n );\n },\n}, {\n title: 'Status Bar Hidden',\n render() {\n return (\n \n {['none', 'fade', 'slide'].map((animation) =>\n \n StatusBarIOS.setHidden(true, animation)}>\n \n setHidden(true, '{animation}')\n \n \n StatusBarIOS.setHidden(false, animation)}>\n \n setHidden(false, '{animation}')\n \n \n \n )}\n \n );\n },\n}, {\n title: 'Status Bar Network Activity Indicator',\n render() {\n return (\n \n StatusBarIOS.setNetworkActivityIndicatorVisible(true)}>\n \n setNetworkActivityIndicatorVisible(true)\n \n \n StatusBarIOS.setNetworkActivityIndicatorVisible(false)}>\n \n setNetworkActivityIndicatorVisible(false)\n \n \n \n );\n },\n}];\n\nvar styles = StyleSheet.create({\n wrapper: {\n borderRadius: 5,\n marginBottom: 5,\n },\n button: {\n backgroundColor: '#eeeeee',\n padding: 10,\n },\n});\n```"} +{"text": "local mType = Game.createMonsterType(\"Lizard Chosen\")\nlocal monster = {}\n\nmonster.description = \"a lizard chosen\"\nmonster.experience = 2200\nmonster.outfit = {\n\tlookType = 344,\n\tlookHead = 0,\n\tlookBody = 0,\n\tlookLegs = 0,\n\tlookFeet = 0,\n\tlookAddons = 0,\n\tlookMount = 0\n}\n\nmonster.health = 3050\nmonster.maxHealth = 3050\nmonster.race = \"blood\"\nmonster.corpse = 11288\nmonster.speed = 272\nmonster.summonCost = 0\nmonster.maxSummons = 0\n\nmonster.changeTarget = {\n\tinterval = 4000,\n\tchance = 10\n}\n\nmonster.strategiesTarget = {\n\tnearest = 100,\n}\n\nmonster.flags = {\n\tsummonable = false,\n\tattackable = true,\n\thostile = true,\n\tconvinceable = false,\n\tpushable = false,\n\trewardBoss = false,\n\tillusionable = true,\n\tcanPushItems = true,\n\tcanPushCreatures = false,\n\tstaticAttackChance = 80,\n\ttargetDistance = 1,\n\trunHealth = 50,\n\thealthHidden = false,\n\tcanWalkOnEnergy = false,\n\tcanWalkOnFire = false,\n\tcanWalkOnPoison = false\n}\n\nmonster.light = {\n\tlevel = 0,\n\tcolor = 0\n}\n\nmonster.voices = {\n\tinterval = 5000,\n\tchance = 10,\n\t{text = \"Grzzzzzzz!\", yell = false},\n\t{text = \"Garrrblarrrrzzzz!\", yell = false},\n\t{text = \"Kzzzzzzz!\", yell = false}\n}\n\nmonster.loot = {\n\t{id = \"small diamond\", chance = 2550, maxCount = 5},\n\t{id = \"gold coin\", chance = 33000, maxCount = 100},\n\t{id = \"gold coin\", chance = 32000, maxCount = 100},\n\t{id = \"gold coin\", chance = 32000, maxCount = 36},\n\t{id = \"platinum coin\", chance = 2920, maxCount = 5},\n\t{id = \"tower shield\", chance = 1100},\n\t{id = \"lizard leather\", chance = 2000},\n\t{id = \"lizard scale\", chance = 980, maxCount = 3},\n\t{id = \"great health potion\", chance = 5350, maxCount = 3},\n\t{id = \"Zaoan armor\", chance = 980},\n\t{id = \"Zaoan helmet\", chance = 140},\n\t{id = \"Zaoan shoes\", chance = 810},\n\t{id = \"Zaoan legs\", chance = 940},\n\t{id = \"spiked iron ball\", chance = 9890},\n\t{id = \"corrupted flag\", chance = 3350},\n\t{id = \"cursed shoulder spikes\", chance = 5800},\n\t{id = \"scale of corruption\", chance = 2870}\n}\n\nmonster.attacks = {\n\t{name =\"combat\", type = COMBAT_PHYSICALDAMAGE, interval = 2000, chance = 100, minDamage = 0, maxDamage = -360, effect = CONST_ME_DRAWBLOOD},\n\t-- poison\n\t{name =\"combat\", type = COMBAT_EARTHDAMAGE, interval = 2000, chance = 15, minDamage = -240, maxDamage = -320, length = 3, spread = 2, effect = CONST_ME_POISONAREA, target = false},\n\t{name =\"combat\", interval = 2000, chance = 15, minDamage = -190, maxDamage = -340, type = COMBAT_EARTHDAMAGE, effect = CONST_ME_HITBYPOISON, target = false},\n\t{name =\"combat\", interval = 2000, chance = 10, minDamage = -90, maxDamage = -180, type = COMBAT_EARTHDAMAGE, length = 8, spread = 3, effect = CONST_ME_GREEN_RINGS, target = false}\n}\n\nmonster.defenses = {\n\tdefense = 45,\n\tarmor = 28,\n\t{name =\"combat\", interval = 2000, chance = 10, minDamage = 75, maxDamage = 125, type = COMBAT_HEALING, effect = CONST_ME_MAGIC_GREEN, target = false}\n}\n\nmonster.elements = {\n\t{type = COMBAT_PHYSICALDAMAGE, percent = 0},\n\t{type = COMBAT_ENERGYDAMAGE, percent = 20},\n\t{type = COMBAT_EARTHDAMAGE, percent = 100},\n\t{type = COMBAT_FIREDAMAGE, percent = 10},\n\t{type = COMBAT_LIFEDRAIN, percent = 0},\n\t{type = COMBAT_MANADRAIN, percent = 0},\n\t{type = COMBAT_DROWNDAMAGE, percent = 0},\n\t{type = COMBAT_ICEDAMAGE, percent = 10},\n\t{type = COMBAT_HOLYDAMAGE , percent = 0},\n\t{type = COMBAT_DEATHDAMAGE , percent = 0}\n}\n\nmonster.immunities = {\n\t{type = \"paralyze\", condition = false},\n\t{type = \"outfit\", condition = false},\n\t{type = \"invisible\", condition = true},\n\t{type = \"bleed\", condition = false}\n}\n\nmType:register(monster)\n"} +{"text": "/*\n zip_stat_index.c -- get information about file by index\n Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner\n\n This file is part of libzip, a library to manipulate ZIP archives.\n The authors can be contacted at \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\n the documentation and/or other materials provided with the\n distribution.\n 3. The names of the authors may not be used to endorse or promote\n products derived from this software without specific prior\n written permission.\n \n THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS\n OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n\f\n\n#include \"zipint.h\"\n\n\f\n\nZIP_EXTERN int\nzip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st)\n{\n const char *name;\n \n if (index < 0 || index >= za->nentry) {\n\t_zip_error_set(&za->error, ZIP_ER_INVAL, 0);\n\treturn -1;\n }\n\n if ((name=zip_get_name(za, index, flags)) == NULL)\n\treturn -1;\n \n\n if ((flags & ZIP_FL_UNCHANGED) == 0\n\t&& ZIP_ENTRY_DATA_CHANGED(za->entry+index)) {\n\tif (za->entry[index].source->f(za->entry[index].source->ud,\n\t\t\t\t st, sizeof(*st), ZIP_SOURCE_STAT) < 0) {\n\t _zip_error_set(&za->error, ZIP_ER_CHANGED, 0);\n\t return -1;\n\t}\n }\n else {\n\tif (za->cdir == NULL || index >= za->cdir->nentry) {\n\t _zip_error_set(&za->error, ZIP_ER_INVAL, 0);\n\t return -1;\n\t}\n\t\n\tst->crc = za->cdir->entry[index].crc;\n\tst->size = za->cdir->entry[index].uncomp_size;\n\tst->mtime = za->cdir->entry[index].last_mod;\n\tst->comp_size = za->cdir->entry[index].comp_size;\n\tst->comp_method = za->cdir->entry[index].comp_method;\n\tif (za->cdir->entry[index].bitflags & ZIP_GPBF_ENCRYPTED) {\n\t if (za->cdir->entry[index].bitflags & ZIP_GPBF_STRONG_ENCRYPTION) {\n\t\t/* XXX */\n\t\tst->encryption_method = ZIP_EM_UNKNOWN;\n\t }\n\t else\n\t\tst->encryption_method = ZIP_EM_TRAD_PKWARE;\n\t}\n\telse\n\t st->encryption_method = ZIP_EM_NONE;\n\t/* st->bitflags = za->cdir->entry[index].bitflags; */\n }\n\n st->index = index;\n st->name = name;\n \n return 0;\n}\n"} +{"text": "---\ntitle: Shape.DropManyU Method (Visio)\nkeywords: vis_sdr.chm11251930\nf1_keywords:\n- vis_sdr.chm11251930\nms.prod: visio\napi_name:\n- Visio.Shape.DropManyU\nms.assetid: b3e18874-bb90-334f-e633-3e20133242a1\nms.date: 06/08/2017\n---\n\n\n# Shape.DropManyU Method (Visio)\n\nCreates one or more new **Shape** objects on a page, in a master, or in a group. It returns an array of the IDs of the **Shape** objects it produces.\n\n\n## Syntax\n\n _expression_ . **DropManyU**( **_ObjectsToInstance()_** , **_xyArray()_** , **_IDArray()_** )\n\n _expression_ A variable that represents a **Shape** object.\n\n\n### Parameters\n\n\n\n|**Name**|**Required/Optional**|**Data Type**|**Description**|\n|:-----|:-----|:-----|:-----|\n| _ObjectsToInstance()_|Required| **Variant**|Identifies masters or other objects from which to make shapes by their universal names.|\n| _xyArray()_|Required| **Double**|An array of alternating _x_ and _y_ values specifying the positions for the new shapes.|\n| _IDArray()_|Required| **Integer**|Out parameter. An array that returns the IDs of the created shapes.|\n\n### Return Value\n\nInteger\n\n\n## Remarks\n\nUsing the **DropManyU** method is like using the **Page** , **Master** , or **Shape** object's **Drop** method, except you can use the **DropManyU** method to create many new **Shape** objects at once, rather than one per method call. The **DropManyU** method creates new **Shape** objects on the page, in the master, or in the group shape to which it is applied (this shape is called the \"target object\" in the following discussion).\n\nYou can identify which master to drop by passing the **DropManyU** method a **Master** object or the master's index or the master's name. When you pass an object, **DropManyU** isn't constrained to just dropping a master from the document stencil of the document onto which it is being dropped. The object can be a master from another document or another type of object.\n\nPassing integers (master indices) or strings (master names) to **DropManyU** is faster than passing objects, but integers or strings can identify only masters in the document stencil of the document onto which it is being dropped. Hence your program has to somehow get the masters in question into the document stencil in the first place, provided they weren't there already.\n\n _ObjectsToInstance()_ should be a one-dimensional array of _n_ >= 1 variants. Its entries identify objects from which you want to make new **Shape** objects. An entry often refers to a Microsoft Visio application **Master** object. It might also refer to a Visio application **Shape** object, **Selection** object, or even an object from another application. The application doesn't care what the lower and upper array bounds of the _ObjectsToInstance()_ entries are. Call these _vlb_ and _vub_ , respectively.\n\n\n\n\n- If _ObjectsToInstance(i)_ is the integer _j_ , an instance of the **Master** object in the document stencil of the target object's document whose 1-based index is _j_ is made. The EventDrop cell in the Events section of the new shape is not triggered. Use the **Drop** method instead if you want the EventDrop cell to trigger.\n \n- If _ObjectsToInstance(i)_ is the string _s_ (or a reference to the string _s_ ), an instance of the **Master** object with name _s_ in the document stencil of the target object's document is made; _s_ can equal either the **Master** object's **UniqueID** or **NameU** property. The EventDrop cell in the Events section of the new shape is not triggered. Use the **Drop** method instead if you want the EventDrop cell to be triggered.\n \n- For _vlb_ < _i_ <= _vub_ , if _ObjectsToInstance(i)_ is empty ( **Nothing** or uninitialized in Microsoft Visual Basic), entry _i_ will cause _ObjectsToInstance(j)_ to be instanced again, where _j_ is the largest value < _i_ such that _ObjectsToInstance(j)_ isn't empty. If you want to make _n_ instances of the same thing, only _ObjectsToInstance(vlb)_ needs to be provided.\n \n\n\nThe _xyArray()_ argument should be a one-dimensional array of 2 _m_ doubles with lower bound _xylb_ and upper bound _xyub_ , where _m_ >= _n_ . The values in the array tell the **DropManyU** method where to position the **Shape** objects it produces. _ObjectsToInstance_( _vlb_ + ( _ i_ - 1)) is dropped at ( _xy_ [( _i_ - 1)2 + _xylb_ ], _xy_ [(i - 1)2 + _xylb_ + 1]) for 1 <= _i_ <= _n_ .\n\nNote that _m_ > _n_ is allowed. For _n_ < _i_ <= _m_ , the _i_ 'th thing instanced is the same thing as the _n_ 'th thing instanced. Thus to make _m_ >= 1 instances of the same thing, you can pass an _ObjectsToInstance()_ array with one entry and an _m_ entry _xyArray()_ array.\n\nIf the entity being instanced is a master, the pin of the new **Shape** object is positioned at the given _xy_ . Otherwise, the center of the **Shape** objects is positioned at the given _xy_ .\n\nThe **Integer** value returned by the **DropManyU** method is the number of _xy_ entries in _xyArray()_ that the **DropManyU** method successfully processed. If all entries were processed successfully, _m_ is returned. If some entries are successfully processed prior to an error occurring, the produced **Shape** objects are not deleted and this raises an exception but still returns a positive integer.\n\nPresuming all _m_ _xy_ entries are processed correctly, the number of new **Shape** objects produced by the **DropManyU** method is usually equal to _m_ . In rare cases (for example, if a **Selection** object gets instanced), more than _m_**Shape** objects may be produced. The caller can determine the number of produced **Shape** objects by comparing the number of shapes in the target object before and after the **DropManyU** method is executed. The caller can assert the new **Shape** objects are those with the highest indices in the target object's **Shapes** collection.\n\nIf the **DropManyU** method returns zero (0), _IDArray()_ returns null ( **Nothing** ). Otherwise, it returns a one-dimensional array of _m_ integers indexed from 0 to _m_ - 1. _IDArray()_ is an out parameter that is allocated by the **DropManyU** method and ownership is passed to the program that called the **DropManyU** method. The caller should eventually perform the **SafeArrayDestroy** procedure on the returned array. (Microsoft Visual Basic and Microsoft Visual Basic for Applications take care of this for you.)\n\nIf _IDArray()_ returns non-null (not **Nothing** ), _IDArray_( _i_ - 1), 1 <= _i_ <= _intReturned_ , returns the ID of the **Shape** object produced by the _i_ 'th _xyArray()_ entry, provided the _i_ 'th _xyArray()_ entry produced exactly one **Shape** object. If the _i_ 'th _xyArray()_ entry produced multiple **Shape** objects, -1 is returned in the entry. All entries _i_ , _intReturned_ <= _i_ < _m_ , return -1.\n\n\n\n\n **Note** Beginning with Microsoft Visio 2000, you can use both local and universal names to refer to Visio shapes, masters, documents, pages, rows, add-ons, cells, hyperlinks, styles, fonts, master shortcuts, UI objects, and layers. When a user names a shape, for example, the user is specifying a local name. Beginning with Microsoft Office Visio 2003, the ShapeSheet spreadsheet displays only universal names in cell formulas and values. (In prior versions, universal names were not visible in the user interface.) \n\nAs a developer, you can use universal names in a program when you don't want to change a name each time a solution is localized. Use the **DropMany** method to drop more than one shape when you are using local names to identify the shapes. Use the **DropManyU** method to drop more than one shape when you are using universal names to identify the shapes.\n\n\n## Example\n\nThe following example shows how to use the **DropManyU** method. It drops one instance of every master in the document stencil of the macro's **Document** object onto Page1 of the macro's **Document** object. Before running this macro, make sure there is at least one master in the document stencil.\n\n\n```vb\n \nPublic Sub DropManyU_Example() \n \n On Error GoTo HandleError \n \n Dim vsoMasters As Visio.Masters \n Dim intMasterCount As Integer \n Set vsoMasters = ThisDocument.Masters \n intMasterCount = vsoMasters.Count \n \n ReDim varObjectsToInstance(1 To intMasterCount) As Variant \n ReDim adblXYArray(1 To (intMasterCount * 2)) As Double \n Dim intCounter As Integer \n For intCounter = 1 To intMasterCount \n \n 'Pass universal name of object to drop to DropManyU. \n varObjectsToInstance(intCounter) = vsoMasters.ItemU(intCounter).NameU \n \n 'Set x components of where to drop to 2,4,6,2,4,6,2,4,6,... \n adblXYArray (intCounter * 2 - 1) = (((intCounter - 1) Mod 3) + 1) * 2 \n \n 'Set y components to 2,2,2,4,4,4,6,6,6,... \n adblXYArray (intCounter * 2) = Int((intCounter + 2) / 3) * 2 \n \n Next intCounter \n \n Dim aintIDArray() As Integer \n Dim intProcessed As Integer \n \n intProcessed = ThisDocument.Pages(1).DropManyU(varObjectsToInstance, _ \n adblXYArray, aintIDArray) \n Debug.Print intProcessed \n \n For intCounter = LBound(aintIDArray) To UBound(aintIDArray) \n Debug.Print intCounter; aintIDArray(intCounter) \n Next intCounter \n \n Exit Sub \n \n HandleError: \n MsgBox \"Error\" \n \n Exit Sub \n \nEnd Sub\n```\n\n\n"} +{"text": "Item(\n name: \"Ornimented Longsword\",\n description: \"An Ornimanted Double-Edged, Two-Hand LongSword\\n\\nPower: 2-10\\n\\n\",\n kind: Tool(\n (\n kind: Sword(LongOrn1), \n equip_time_millis: 500,\n )\n ),\n)\n"} +{"text": " Server::$url,\n 'adapter' => new StreamAdapter(new MessageFactory())\n ]);\n $response = $client->get('/', ['headers' => ['Foo' => 'Bar']]);\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals('OK', $response->getReasonPhrase());\n $this->assertEquals('Bar', $response->getHeader('Foo'));\n $this->assertEquals('2', $response->getHeader('Content-Length'));\n $this->assertEquals('hi', $response->getBody());\n $sent = Server::received(true)[0];\n $this->assertEquals('GET', $sent->getMethod());\n $this->assertEquals('/', $sent->getResource());\n $this->assertEquals('127.0.0.1:8125', $sent->getHeader('host'));\n $this->assertEquals('Bar', $sent->getHeader('foo'));\n $this->assertTrue($sent->hasHeader('user-agent'));\n }\n\n /**\n * @expectedException \\GuzzleHttp\\Exception\\RequestException\n * @expectedExceptionMessage Error creating resource. [url] http://localhost:123 [proxy] tcp://localhost:1234\n */\n public function testThrowsExceptionsCaughtDuringTransfer()\n {\n Server::flush();\n $client = new Client([\n 'adapter' => new StreamAdapter(new MessageFactory()),\n ]);\n $client->get('http://localhost:123', [\n 'timeout' => 0.01,\n 'proxy' => 'tcp://localhost:1234'\n ]);\n }\n\n /**\n * @expectedException \\GuzzleHttp\\Exception\\RequestException\n * @expectedExceptionMessage URL is invalid: ftp://localhost:123\n */\n public function testEnsuresTheHttpProtocol()\n {\n Server::flush();\n $client = new Client([\n 'adapter' => new StreamAdapter(new MessageFactory()),\n ]);\n $client->get('ftp://localhost:123');\n }\n\n public function testCanHandleExceptionsUsingEvents()\n {\n Server::flush();\n $client = new Client([\n 'adapter' => new StreamAdapter(new MessageFactory())\n ]);\n $request = $client->createRequest('GET', Server::$url);\n $mockResponse = new Response(200);\n $request->getEmitter()->on(\n 'error',\n function (ErrorEvent $e) use ($mockResponse) {\n $e->intercept($mockResponse);\n }\n );\n $this->assertSame($mockResponse, $client->send($request));\n }\n\n public function testEmitsAfterSendEvent()\n {\n $ee = null;\n Server::flush();\n Server::enqueue(\n \"HTTP/1.1 200 OK\\r\\nFoo: Bar\\r\\nContent-Length: 8\\r\\n\\r\\nhi there\"\n );\n $client = new Client(['adapter' => new StreamAdapter(new MessageFactory())]);\n $request = $client->createRequest('GET', Server::$url);\n $request->getEmitter()->on('complete', function ($e) use (&$ee) {\n $ee = $e;\n });\n $client->send($request);\n $this->assertInstanceOf('GuzzleHttp\\Event\\CompleteEvent', $ee);\n $this->assertSame($request, $ee->getRequest());\n $this->assertEquals(200, $ee->getResponse()->getStatusCode());\n }\n\n public function testStreamAttributeKeepsStreamOpen()\n {\n Server::flush();\n Server::enqueue(\n \"HTTP/1.1 200 OK\\r\\nFoo: Bar\\r\\nContent-Length: 8\\r\\n\\r\\nhi there\"\n );\n $client = new Client([\n 'base_url' => Server::$url,\n 'adapter' => new StreamAdapter(new MessageFactory())\n ]);\n $response = $client->put('/foo', [\n 'headers' => ['Foo' => 'Bar'],\n 'body' => 'test',\n 'stream' => true\n ]);\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals('OK', $response->getReasonPhrase());\n $this->assertEquals('8', $response->getHeader('Content-Length'));\n $body = $response->getBody();\n if (defined('HHVM_VERSION')) {\n $this->markTestIncomplete('HHVM has not implemented this?');\n }\n $this->assertEquals('http', $body->getMetadata()['wrapper_type']);\n $this->assertEquals(Server::$url . 'foo', $body->getMetadata()['uri']);\n $this->assertEquals('hi', $body->read(2));\n $body->close();\n\n $sent = Server::received(true)[0];\n $this->assertEquals('PUT', $sent->getMethod());\n $this->assertEquals('/foo', $sent->getResource());\n $this->assertEquals('127.0.0.1:8125', $sent->getHeader('host'));\n $this->assertEquals('Bar', $sent->getHeader('foo'));\n $this->assertTrue($sent->hasHeader('user-agent'));\n }\n\n public function testDrainsResponseIntoTempStream()\n {\n Server::flush();\n Server::enqueue(\"HTTP/1.1 200 OK\\r\\nFoo: Bar\\r\\nContent-Length: 8\\r\\n\\r\\nhi there\");\n $client = new Client([\n 'base_url' => Server::$url,\n 'adapter' => new StreamAdapter(new MessageFactory())\n ]);\n $response = $client->get('/');\n $body = $response->getBody();\n $this->assertEquals('php://temp', $body->getMetadata()['uri']);\n $this->assertEquals('hi', $body->read(2));\n $body->close();\n }\n\n public function testDrainsResponseIntoSaveToBody()\n {\n $r = fopen('php://temp', 'r+');\n Server::flush();\n Server::enqueue(\"HTTP/1.1 200 OK\\r\\nFoo: Bar\\r\\nContent-Length: 8\\r\\n\\r\\nhi there\");\n $client = new Client([\n 'base_url' => Server::$url,\n 'adapter' => new StreamAdapter(new MessageFactory())\n ]);\n $response = $client->get('/', ['save_to' => $r]);\n $body = $response->getBody();\n $this->assertEquals('php://temp', $body->getMetadata()['uri']);\n $this->assertEquals('hi', $body->read(2));\n $this->assertEquals(' there', stream_get_contents($r));\n $body->close();\n }\n\n public function testDrainsResponseIntoSaveToBodyAtPath()\n {\n $tmpfname = tempnam('/tmp', 'save_to_path');\n Server::flush();\n Server::enqueue(\"HTTP/1.1 200 OK\\r\\nFoo: Bar\\r\\nContent-Length: 8\\r\\n\\r\\nhi there\");\n $client = new Client([\n 'base_url' => Server::$url,\n 'adapter' => new StreamAdapter(new MessageFactory())\n ]);\n $response = $client->get('/', ['save_to' => $tmpfname]);\n $body = $response->getBody();\n $this->assertEquals($tmpfname, $body->getMetadata()['uri']);\n $this->assertEquals('hi', $body->read(2));\n $body->close();\n unlink($tmpfname);\n }\n\n public function testAutomaticallyDecompressGzip()\n {\n Server::flush();\n $content = gzencode('test');\n $message = \"HTTP/1.1 200 OK\\r\\n\"\n . \"Foo: Bar\\r\\n\"\n . \"Content-Encoding: gzip\\r\\n\"\n . \"Content-Length: \" . strlen($content) . \"\\r\\n\\r\\n\"\n . $content;\n Server::enqueue($message);\n $client = new Client([\n 'base_url' => Server::$url,\n 'adapter' => new StreamAdapter(new MessageFactory())\n ]);\n $response = $client->get('/', ['stream' => true]);\n $body = $response->getBody();\n $this->assertEquals('guzzle://stream', $body->getMetadata()['uri']);\n $this->assertEquals('test', (string) $body);\n }\n\n public function testDoesNotForceDecode()\n {\n Server::flush();\n $content = gzencode('test');\n $message = \"HTTP/1.1 200 OK\\r\\n\"\n . \"Foo: Bar\\r\\n\"\n . \"Content-Encoding: gzip\\r\\n\"\n . \"Content-Length: \" . strlen($content) . \"\\r\\n\\r\\n\"\n . $content;\n Server::enqueue($message);\n $client = new Client([\n 'base_url' => Server::$url,\n 'adapter' => new StreamAdapter(new MessageFactory())\n ]);\n $response = $client->get('/', [\n 'decode_content' => false,\n 'stream' => true\n ]);\n $body = $response->getBody();\n $this->assertSame($content, (string) $body);\n }\n\n protected function getStreamFromBody(Stream $body)\n {\n $r = new \\ReflectionProperty($body, 'stream');\n $r->setAccessible(true);\n\n return $r->getValue($body);\n }\n\n protected function getSendResult(array $opts)\n {\n Server::enqueue(\"HTTP/1.1 200 OK\\r\\nFoo: Bar\\r\\nContent-Length: 8\\r\\n\\r\\nhi there\");\n $client = new Client(['adapter' => new StreamAdapter(new MessageFactory())]);\n\n return $client->get(Server::$url, $opts);\n }\n\n public function testAddsProxy()\n {\n $body = $this->getSendResult(['stream' => true, 'proxy' => '127.0.0.1:8125'])->getBody();\n $opts = stream_context_get_options($this->getStreamFromBody($body));\n $this->assertEquals('127.0.0.1:8125', $opts['http']['proxy']);\n }\n\n public function testAddsTimeout()\n {\n $body = $this->getSendResult(['stream' => true, 'timeout' => 200])->getBody();\n $opts = stream_context_get_options($this->getStreamFromBody($body));\n $this->assertEquals(200, $opts['http']['timeout']);\n }\n\n /**\n * @expectedException \\RuntimeException\n * @expectedExceptionMessage SSL certificate authority file not found: /does/not/exist\n */\n public function testVerifiesVerifyIsValidIfPath()\n {\n (new Client([\n 'adapter' => new StreamAdapter(new MessageFactory()),\n 'base_url' => Server::$url,\n 'defaults' => ['verify' => '/does/not/exist']\n ]))->get('/');\n }\n\n public function testVerifyCanBeDisabled()\n {\n Server::enqueue(\"HTTP/1.1 200\\r\\nContent-Length: 0\\r\\n\\r\\n\");\n (new Client([\n 'adapter' => new StreamAdapter(new MessageFactory()),\n 'base_url' => Server::$url,\n 'defaults' => ['verify' => false]\n ]))->get('/');\n }\n\n public function testVerifyCanBeSetToPath()\n {\n $path = __DIR__ . '/../../src/cacert.pem';\n $this->assertFileExists($path);\n $body = $this->getSendResult(['stream' => true, 'verify' => $path])->getBody();\n $opts = stream_context_get_options($this->getStreamFromBody($body));\n $this->assertEquals(true, $opts['http']['verify_peer']);\n $this->assertEquals($path, $opts['http']['cafile']);\n $this->assertTrue(file_exists($opts['http']['cafile']));\n }\n\n /**\n * @expectedException \\RuntimeException\n * @expectedExceptionMessage SSL certificate not found: /does/not/exist\n */\n public function testVerifiesCertIfValidPath()\n {\n (new Client([\n 'adapter' => new StreamAdapter(new MessageFactory()),\n 'base_url' => Server::$url,\n 'defaults' => ['cert' => '/does/not/exist']\n ]))->get('/');\n }\n\n public function testCanSetPasswordWhenSettingCert()\n {\n $path = __DIR__ . '/../../src/cacert.pem';\n $body = $this->getSendResult(['stream' => true, 'cert' => [$path, 'foo']])->getBody();\n $opts = stream_context_get_options($this->getStreamFromBody($body));\n $this->assertEquals($path, $opts['http']['local_cert']);\n $this->assertEquals('foo', $opts['http']['passphrase']);\n }\n\n public function testDebugAttributeWritesStreamInfoToTempBufferByDefault()\n {\n if (defined('HHVM_VERSION')) {\n $this->markTestSkipped('HHVM has not implemented this?');\n return;\n }\n\n Server::flush();\n Server::enqueue(\"HTTP/1.1 200 OK\\r\\nFoo: Bar\\r\\nContent-Length: 8\\r\\n\\r\\nhi there\");\n $client = new Client([\n 'base_url' => Server::$url,\n 'adapter' => new StreamAdapter(new MessageFactory())\n ]);\n $fp = fopen('php://temp', 'w');\n $client->get('/', ['debug' => $fp]);\n fseek($fp, 0);\n $contents = stream_get_contents($fp);\n $this->assertContains(' [CONNECT]', $contents);\n $this->assertContains(' [FILE_SIZE_IS]', $contents);\n $this->assertContains(' [PROGRESS]', $contents);\n }\n\n public function testDebugAttributeWritesStreamInfoToBuffer()\n {\n if (defined('HHVM_VERSION')) {\n $this->markTestSkipped('HHVM has not implemented this?');\n return;\n }\n\n $buffer = fopen('php://temp', 'r+');\n Server::flush();\n Server::enqueue(\"HTTP/1.1 200 OK\\r\\nContent-Length: 8\\r\\nContent-Type: text/plain\\r\\n\\r\\nhi there\");\n $client = new Client([\n 'base_url' => Server::$url,\n 'adapter' => new StreamAdapter(new MessageFactory())\n ]);\n $client->get('/', ['debug' => $buffer]);\n fseek($buffer, 0);\n $contents = stream_get_contents($buffer);\n $this->assertContains(' [CONNECT]', $contents);\n $this->assertContains(' [FILE_SIZE_IS] message: \"Content-Length: 8\"', $contents);\n $this->assertContains(' [PROGRESS] bytes_max: \"8\"', $contents);\n $this->assertContains(' [MIME_TYPE_IS] message: \"text/plain\"', $contents);\n }\n\n public function testAddsProxyByProtocol()\n {\n $url = str_replace('http', 'tcp', Server::$url);\n $body = $this->getSendResult(['stream' => true, 'proxy' => ['http' => $url]])->getBody();\n $opts = stream_context_get_options($this->getStreamFromBody($body));\n $this->assertEquals($url, $opts['http']['proxy']);\n }\n\n public function testPerformsShallowMergeOfCustomContextOptions()\n {\n $body = $this->getSendResult([\n 'stream' => true,\n 'config' => [\n 'stream_context' => [\n 'http' => [\n 'request_fulluri' => true,\n 'method' => 'HEAD'\n ],\n 'socket' => [\n 'bindto' => '127.0.0.1:0'\n ],\n 'ssl' => [\n 'verify_peer' => false\n ]\n ]\n ]\n ])->getBody();\n\n $opts = stream_context_get_options($this->getStreamFromBody($body));\n $this->assertEquals('HEAD', $opts['http']['method']);\n $this->assertTrue($opts['http']['request_fulluri']);\n $this->assertFalse($opts['ssl']['verify_peer']);\n $this->assertEquals('127.0.0.1:0', $opts['socket']['bindto']);\n }\n\n /**\n * @expectedException \\GuzzleHttp\\Exception\\RequestException\n * @expectedExceptionMessage stream_context must be an array\n */\n public function testEnsuresThatStreamContextIsAnArray()\n {\n $this->getSendResult([\n 'stream' => true,\n 'config' => ['stream_context' => 'foo']\n ]);\n }\n\n /**\n * @ticket https://github.com/guzzle/guzzle/issues/725\n */\n public function testHandlesMultipleHeadersOfSameName()\n {\n $a = new StreamAdapter(new MessageFactory());\n $ref = new \\ReflectionMethod($a, 'headersFromLines');\n $ref->setAccessible(true);\n $this->assertEquals([\n 'foo' => ['bar', 'bam'],\n 'abc' => ['123']\n ], $ref->invoke($a, [\n 'foo: bar',\n 'foo: bam',\n 'abc: 123'\n ]));\n }\n\n public function testDoesNotAddContentTypeByDefault()\n {\n Server::flush();\n Server::enqueue(\"HTTP/1.1 200 OK\\r\\nContent-Length: 0\\r\\n\\r\\n\");\n $client = new Client([\n 'base_url' => Server::$url,\n 'adapter' => new StreamAdapter(new MessageFactory())\n ]);\n $client->put('/', ['body' => 'foo']);\n $requests = Server::received(true);\n $this->assertEquals('', $requests[0]->getHeader('Content-Type'));\n $this->assertEquals(3, $requests[0]->getHeader('Content-Length'));\n }\n}\n"} +{"text": "--\n-- Setting the major/minor/sub-minor version of the DB\n--\n\nSET @MAJOR_VERSION = 6;\nSET @MINOR_VERSION = 1;\nSET @SUBMINOR_VERSION = 0;\n\n--\n-- The VERSION_INT to ensure proper ordering of the version in queries\n--\n\nSET @VERSION_INT = @MAJOR_VERSION << 16 | @MINOR_VERSION << 8 | @SUBMINOR_VERSION;\n\n--\n-- Table structure for table `class`\n--\n\nCREATE TABLE class (\n vid int(11) NOT NULL,\n description varchar(255) NOT NULL default \"none\",\n auto_enable char(1) NOT NULL default \"Y\",\n max_enables int(11) NOT NULL default 0,\n grace_period int(11) NOT NULL,\n window varchar(255) NOT NULL default 0,\n vclose int(11),\n priority int(11) NOT NULL,\n template varchar(255),\n max_enable_url varchar(255),\n redirect_url varchar(255),\n button_text varchar(255),\n enabled char(1) NOT NULL default \"N\",\n vlan varchar(255),\n target_category varchar(255),\n delay_by int(11) NOT NULL default 0,\n external_command varchar(255) DEFAULT NULL,\n PRIMARY KEY (vid)\n) ENGINE=InnoDB;\n\n--\n-- Table structure for table `trigger`\n--\nCREATE TABLE `trigger` (\n vid int(11) default NULL,\n tid_start varchar(255) NOT NULL,\n tid_end varchar(255) NOT NULL,\n type varchar(255) default NULL,\n whitelisted_categories varchar(255) NOT NULL default '',\n PRIMARY KEY (vid,tid_start,tid_end,type),\n KEY `trigger` (tid_start,tid_end,type),\n CONSTRAINT `0_64` FOREIGN KEY (`vid`) REFERENCES `class` (`vid`) ON DELETE CASCADE ON UPDATE CASCADE\n) ENGINE=InnoDB;\n\n--\n-- Table structure for table `person`\n--\n\nCREATE TABLE person (\n pid varchar(255) NOT NULL,\n `firstname` varchar(255) default NULL,\n `lastname` varchar(255) default NULL,\n `email` varchar(255) default NULL,\n `telephone` varchar(255) default NULL,\n `company` varchar(255) default NULL,\n `address` varchar(255) default NULL,\n `notes` varchar(255),\n `sponsor` varchar(255) default NULL,\n `anniversary` varchar(255) default NULL,\n `birthday` varchar(255) default NULL,\n `gender` char(1) default NULL,\n `lang` varchar(255) default NULL,\n `nickname` varchar(255) default NULL,\n `cell_phone` varchar(255) default NULL,\n `work_phone` varchar(255) default NULL,\n `title` varchar(255) default NULL,\n `building_number` varchar(255) default NULL,\n `apartment_number` varchar(255) default NULL,\n `room_number` varchar(255) default NULL,\n `custom_field_1` varchar(255) default NULL,\n `custom_field_2` varchar(255) default NULL,\n `custom_field_3` varchar(255) default NULL,\n `custom_field_4` varchar(255) default NULL,\n `custom_field_5` varchar(255) default NULL,\n `custom_field_6` varchar(255) default NULL,\n `custom_field_7` varchar(255) default NULL,\n `custom_field_8` varchar(255) default NULL,\n `custom_field_9` varchar(255) default NULL,\n `portal` varchar(255) default NULL,\n `source` varchar(255) default NULL,\n PRIMARY KEY (pid)\n) ENGINE=InnoDB;\n\n\n--\n-- Table structure for table `node_category`\n--\n\nCREATE TABLE `node_category` (\n `category_id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(255) NOT NULL,\n `max_nodes_per_pid` int default 0,\n `notes` varchar(255) default NULL,\n PRIMARY KEY (`category_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\n--\n-- Insert 'default' category\n--\n\nINSERT INTO `node_category` (name,notes) VALUES (\"default\",\"Placeholder role/category, feel free to edit\");\n\n--\n-- Insert 'guest' category\n--\n\nINSERT INTO `node_category` (name,notes) VALUES (\"guest\",\"Guests\");\n\n--\n-- Insert 'gaming' category\n--\n\nINSERT INTO `node_category` (name,notes) VALUES (\"gaming\",\"Gaming devices\");\n\n--\n-- Insert 'voice' category\n--\n\nINSERT INTO `node_category` (name,notes) VALUES (\"voice\",\"VoIP devices\");\n\n--\n-- Insert 'REJECT' category\n--\n\nINSERT INTO `node_category` (name,notes) VALUES (\"REJECT\",\"Reject role (Used to block access)\");\n\n--\n-- Table structure for table `node`\n--\n\nCREATE TABLE node (\n mac varchar(17) NOT NULL,\n pid varchar(255) NOT NULL default \"default\",\n category_id int default NULL,\n detect_date datetime NOT NULL default \"0000-00-00 00:00:00\",\n regdate datetime NOT NULL default \"0000-00-00 00:00:00\",\n unregdate datetime NOT NULL default \"0000-00-00 00:00:00\",\n lastskip datetime NOT NULL default \"0000-00-00 00:00:00\",\n time_balance int(10) unsigned DEFAULT NULL,\n bandwidth_balance int(10) unsigned DEFAULT NULL,\n status varchar(15) NOT NULL default \"unreg\",\n user_agent varchar(255) default NULL,\n computername varchar(255) default NULL,\n notes varchar(255) default NULL,\n last_arp datetime NOT NULL default \"0000-00-00 00:00:00\",\n last_dhcp datetime NOT NULL default \"0000-00-00 00:00:00\",\n dhcp_fingerprint varchar(255) default NULL,\n dhcp6_fingerprint varchar(255) default NULL,\n dhcp_vendor varchar(255) default NULL,\n dhcp6_enterprise varchar(255) default NULL,\n device_type varchar(255) default NULL,\n device_class varchar(255) default NULL,\n bypass_vlan varchar(50) default NULL,\n voip enum('no','yes') NOT NULL DEFAULT 'no',\n autoreg enum('no','yes') NOT NULL DEFAULT 'no',\n sessionid varchar(30) default NULL,\n machine_account varchar(255) default NULL,\n bypass_role_id int default NULL,\n PRIMARY KEY (mac),\n KEY pid (pid),\n KEY category_id (category_id),\n KEY `node_status` (`status`, `unregdate`),\n KEY `node_dhcpfingerprint` (`dhcp_fingerprint`),\n CONSTRAINT `0_57` FOREIGN KEY (`pid`) REFERENCES `person` (`pid`) ON DELETE CASCADE ON UPDATE CASCADE,\n CONSTRAINT `node_category_key` FOREIGN KEY (`category_id`) REFERENCES `node_category` (`category_id`)\n) ENGINE=InnoDB;\n\n--\n-- Table structure for table `node_useragent`\n--\n\nCREATE TABLE `node_useragent` (\n mac varchar(17) NOT NULL,\n os varchar(255) DEFAULT NULL,\n browser varchar(255) DEFAULT NULL,\n device enum('no','yes') NOT NULL DEFAULT 'no',\n device_name varchar(255) DEFAULT NULL,\n mobile enum('no','yes') NOT NULL DEFAULT 'no',\n PRIMARY KEY (mac)\n) ENGINE=InnoDB;\n\n--\n-- Trigger to delete the node_useragent associated with a mac when deleting this mac from the node table\n--\n\nDROP TRIGGER IF EXISTS node_useragent_delete_trigger;\nDELIMITER /\nCREATE TRIGGER node_useragent_delete_trigger AFTER DELETE ON node\nFOR EACH ROW\nBEGIN\n DELETE FROM node_useragent WHERE mac = OLD.mac;\nEND /\nDELIMITER ;\n\n--\n-- Table structure for table `action`\n--\n\nCREATE TABLE action (\n vid int(11) NOT NULL,\n action varchar(255) NOT NULL,\n PRIMARY KEY (vid,action),\n CONSTRAINT `FOREIGN` FOREIGN KEY (`vid`) REFERENCES `class` (`vid`) ON DELETE CASCADE ON UPDATE CASCADE\n) ENGINE=InnoDB;\n\n--\n-- Table structure for table `violation`\n--\n\nCREATE TABLE violation (\n id int NOT NULL AUTO_INCREMENT,\n mac varchar(17) NOT NULL,\n vid int(11) NOT NULL,\n start_date datetime NOT NULL,\n release_date datetime default \"0000-00-00 00:00:00\",\n status varchar(10) default \"open\",\n ticket_ref varchar(255) default NULL,\n notes text,\n KEY mac (mac),\n KEY vid (vid),\n KEY status (status),\n KEY ind1 (mac,status,vid),\n KEY violation_release_date (release_date),\n CONSTRAINT `0_60` FOREIGN KEY (`mac`) REFERENCES `node` (`mac`) ON DELETE CASCADE ON UPDATE CASCADE,\n CONSTRAINT `0_61` FOREIGN KEY (`vid`) REFERENCES `class` (`vid`) ON DELETE CASCADE ON UPDATE CASCADE,\n PRIMARY KEY (id)\n) ENGINE=InnoDB;\n\n--\n-- Table structure for table `iplog`\n--\n\nCREATE TABLE iplog (\n mac varchar(17) NOT NULL,\n ip varchar(45) NOT NULL,\n start_time datetime NOT NULL,\n end_time datetime default \"0000-00-00 00:00:00\",\n PRIMARY KEY (ip),\n KEY iplog_mac_end_time (mac,end_time),\n KEY iplog_end_time (end_time)\n) ENGINE=InnoDB;\n\n--\n-- Trigger to insert old record from 'iplog' in 'iplog_history' before updating the current one\n--\n\nDROP TRIGGER IF EXISTS iplog_insert_in_iplog_history_before_update_trigger;\nDELIMITER /\nCREATE TRIGGER iplog_insert_in_iplog_history_before_update_trigger BEFORE UPDATE ON iplog\nFOR EACH ROW\nBEGIN\n INSERT INTO iplog_history SET ip = OLD.ip, mac = OLD.mac, start_time = OLD.start_time, end_time = CASE\n WHEN OLD.end_time = '0000-00-00 00:00:00' THEN NOW()\n WHEN OLD.end_time > NOW() THEN NOW()\n ELSE OLD.end_time\n END;\nEND /\nDELIMITER ;\n\n--\n-- Table structure for table `iplog_history`\n--\n\nCREATE TABLE iplog_history (\n mac varchar(17) NOT NULL,\n ip varchar(45) NOT NULL,\n start_time datetime NOT NULL,\n end_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n) ENGINE=InnoDB;\n\n--\n-- Table structure for table `iplog_archive`\n--\n\nCREATE TABLE iplog_archive (\n mac varchar(17) NOT NULL,\n ip varchar(45) NOT NULL,\n start_time datetime NOT NULL,\n end_time datetime NOT NULL\n) ENGINE=InnoDB;\n\nCREATE TABLE `locationlog` (\n `mac` varchar(17) default NULL,\n `switch` varchar(17) NOT NULL default '',\n `port` varchar(8) NOT NULL default '',\n `vlan` varchar(50) default NULL,\n `role` varchar(255) default NULL,\n `connection_type` varchar(50) NOT NULL default '',\n `connection_sub_type` varchar(50) default NULL,\n `dot1x_username` varchar(255) NOT NULL default '',\n `ssid` varchar(32) NOT NULL default '',\n `start_time` datetime NOT NULL default '0000-00-00 00:00:00',\n `end_time` datetime NOT NULL default '0000-00-00 00:00:00',\n `switch_ip` varchar(17) DEFAULT NULL,\n `switch_mac` varchar(17) DEFAULT NULL,\n `stripped_user_name` varchar (255) DEFAULT NULL,\n `realm` varchar (255) DEFAULT NULL,\n `session_id` VARCHAR(255) DEFAULT NULL,\n KEY `locationlog_view_mac` (`mac`, `end_time`),\n KEY `locationlog_end_time` ( `end_time`),\n KEY `locationlog_view_switchport` (`switch`,`port`,`end_time`,`vlan`)\n) ENGINE=InnoDB;\n\nCREATE TABLE `locationlog_archive` (\n `mac` varchar(17) default NULL,\n `switch` varchar(17) NOT NULL default '',\n `port` varchar(8) NOT NULL default '',\n `vlan` varchar(50) default NULL,\n `role` varchar(255) default NULL,\n `connection_type` varchar(50) NOT NULL default '',\n `connection_sub_type` varchar(50) default NULL,\n `dot1x_username` varchar(255) NOT NULL default '',\n `ssid` varchar(32) NOT NULL default '',\n `start_time` datetime NOT NULL default '0000-00-00 00:00:00',\n `end_time` datetime NOT NULL default '0000-00-00 00:00:00',\n `switch_ip` varchar(17) DEFAULT NULL,\n `switch_mac` varchar(17) DEFAULT NULL,\n `stripped_user_name` varchar (255) DEFAULT NULL,\n `realm` varchar (255) DEFAULT NULL,\n `session_id` VARCHAR(255) DEFAULT NULL,\n KEY `locationlog_archive_view_mac` (`mac`, `end_time`),\n KEY `locationlog_end_time` ( `end_time`),\n KEY `locationlog_view_switchport` (`switch`,`port`,`end_time`,`vlan`)\n) ENGINE=InnoDB;\n\nCREATE TABLE `userlog` (\n `mac` varchar(17) NOT NULL default '',\n `pid` varchar(255) default NULL,\n `start_time` datetime NOT NULL default '0000-00-00 00:00:00',\n `end_time` datetime default NULL,\n PRIMARY KEY (`mac`,`start_time`),\n KEY `pid` (`pid`),\n CONSTRAINT `userlog_ibfk_1` FOREIGN KEY (`mac`) REFERENCES `node` (`mac`) ON DELETE CASCADE\n) ENGINE=InnoDB;\n\nCREATE TABLE `ifoctetslog` (\n `switch` varchar(17) NOT NULL default '',\n `port` varchar(8) NOT NULL default '',\n `read_time` datetime NOT NULL default '0000-00-00 00:00:00',\n `mac` varchar(17) default NULL,\n `ifInOctets` bigint(20) unsigned NOT NULL default '0',\n `ifOutOctets` bigint(20) unsigned NOT NULL default '0',\n PRIMARY KEY (`switch`,`port`,`read_time`)\n) ENGINE=InnoDB;\n\nCREATE TABLE `traplog` (\n `switch` varchar(30) NOT NULL default '',\n `ifIndex` smallint(6) NOT NULL default '0',\n `parseTime` datetime NOT NULL default '0000-00-00 00:00:00',\n `type` varchar(30) NOT NULL default '',\n KEY `switch` (`switch`,`ifIndex`),\n KEY `parseTime` (`parseTime`)\n) ENGINE=InnoDB;\n\nCREATE TABLE `configfile` (\n `filename` varchar(255) NOT NULL,\n `filecontent` text NOT NULL,\n `lastmodified` datetime NOT NULL\n) ENGINE=InnoDB default CHARSET=latin1;\n\n--\n-- Table structure for table `password`\n--\n\nCREATE TABLE `password` (\n `pid` varchar(255) NOT NULL,\n `password` varchar(255) NOT NULL,\n `valid_from` datetime default NULL,\n `expiration` datetime NOT NULL,\n `access_duration` varchar(255) default NULL,\n `access_level` varchar(255) DEFAULT 'NONE',\n `category` int DEFAULT NULL,\n `sponsor` tinyint(1) NOT NULL default 0,\n `unregdate` datetime NOT NULL default \"0000-00-00 00:00:00\",\n `login_remaining` int DEFAULT NULL,\n PRIMARY KEY (pid)\n) ENGINE=InnoDB;\n\n--\n-- Insert default users\n--\n\nINSERT INTO `person` (pid,notes) VALUES (\"admin\",\"Default Admin User - do not delete\");\nINSERT INTO `person` (pid,notes) VALUES (\"default\",\"Default User - do not delete\");\nINSERT INTO password (pid, password, valid_from, expiration, access_duration, access_level, category) VALUES ('admin', 'admin', NOW(), '2038-01-01', NULL, 'ALL', NULL);\n\n--\n-- Trigger to delete the temp password from 'password' when deleting the pid associated with\n--\n\nDROP TRIGGER IF EXISTS password_delete_trigger;\nDELIMITER /\nCREATE TRIGGER password_delete_trigger AFTER DELETE ON person\nFOR EACH ROW\nBEGIN\n DELETE FROM `password` WHERE pid = OLD.pid;\nEND /\nDELIMITER ;\n\n--\n-- Table structure for table `sms_carrier`\n-- \n-- Source: StatusNet\n-- Schema fetched on 2010-10-15 from:\n-- http://gitorious.org/statusnet/mainline/blobs/raw/master/db/statusnet.sql\n--\n\nCREATE TABLE sms_carrier (\n id integer primary key comment 'primary key for SMS carrier',\n name varchar(64) unique key comment 'name of the carrier',\n email_pattern varchar(255) not null comment 'sprintf pattern for making an email address from a phone number',\n created datetime not null comment 'date this record was created',\n modified timestamp comment 'date this record was modified'\n) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;\n\n--\n-- Insert data for table `sms_carrier`\n--\n-- Source: StatusNet\n-- Data fetched on 2011-07-20 from:\n-- http://gitorious.org/statusnet/mainline/blobs/raw/master/db/sms_carrier.sql\n--\n\nINSERT INTO sms_carrier\n (id, name, email_pattern, created)\nVALUES\n (100056, '3 River Wireless', '%s@sms.3rivers.net', now()),\n (100057, '7-11 Speakout', '%s@cingularme.com', now()),\n (100058, 'Airtel (Karnataka, India)', '%s@airtelkk.com', now()),\n (100059, 'Alaska Communications Systems', '%s@msg.acsalaska.com', now()),\n (100060, 'Alltel Wireless', '%s@message.alltel.com', now()),\n (100061, 'AT&T Wireless', '%s@txt.att.net', now()),\n (100062, 'Bell Mobility (Canada)', '%s@txt.bell.ca', now()),\n (100063, 'Boost Mobile', '%s@myboostmobile.com', now()),\n (100064, 'Cellular One (Dobson)', '%s@mobile.celloneusa.com', now()),\n (100065, 'Cingular (Postpaid)', '%s@cingularme.com', now()),\n (100066, 'Centennial Wireless', '%s@cwemail.com', now()),\n (100067, 'Cingular (GoPhone prepaid)', '%s@cingularme.com', now()),\n (100068, 'Claro (Nicaragua)', '%s@ideasclaro-ca.com', now()),\n (100069, 'Comcel', '%s@comcel.com.co', now()),\n (100070, 'Cricket', '%s@sms.mycricket.com', now()),\n (100071, 'CTI', '%s@sms.ctimovil.com.ar', now()),\n (100072, 'Emtel (Mauritius)', '%s@emtelworld.net', now()),\n (100073, 'Fido (Canada)', '%s@fido.ca', now()),\n (100074, 'General Communications Inc.', '%s@msg.gci.net', now()),\n (100075, 'Globalstar', '%s@msg.globalstarusa.com', now()),\n (100076, 'Helio', '%s@myhelio.com', now()),\n (100077, 'Illinois Valley Cellular', '%s@ivctext.com', now()),\n (100078, 'i wireless', '%s.iws@iwspcs.net', now()),\n (100079, 'Meteor (Ireland)', '%s@sms.mymeteor.ie', now()),\n (100080, 'Mero Mobile (Nepal)', '%s@sms.spicenepal.com', now()),\n (100081, 'MetroPCS', '%s@mymetropcs.com', now()),\n (100082, 'Movicom', '%s@movimensaje.com.ar', now()),\n (100083, 'Mobitel (Sri Lanka)', '%s@sms.mobitel.lk', now()),\n (100084, 'Movistar (Colombia)', '%s@movistar.com.co', now()),\n (100085, 'MTN (South Africa)', '%s@sms.co.za', now()),\n (100086, 'MTS (Canada)', '%s@text.mtsmobility.com', now()),\n (100087, 'Nextel (Argentina)', '%s@nextel.net.ar', now()),\n (100088, 'Orange (Poland)', '%s@orange.pl', now()),\n (100089, 'Personal (Argentina)', '%s@personal-net.com.ar', now()),\n (100090, 'Plus GSM (Poland)', '%s@text.plusgsm.pl', now()),\n (100091, 'President\\'s Choice (Canada)', '%s@txt.bell.ca', now()),\n (100092, 'Qwest', '%s@qwestmp.com', now()),\n (100093, 'Rogers (Canada)', '%s@pcs.rogers.com', now()),\n (100094, 'Sasktel (Canada)', '%s@sms.sasktel.com', now()),\n (100095, 'Setar Mobile email (Aruba)', '%s@mas.aw', now()),\n (100096, 'Solo Mobile', '%s@txt.bell.ca', now()),\n (100097, 'Sprint (PCS)', '%s@messaging.sprintpcs.com', now()),\n (100098, 'Sprint (Nextel)', '%s@page.nextel.com', now()),\n (100099, 'Suncom', '%s@tms.suncom.com', now()),\n (100100, 'T-Mobile', '%s@tmomail.net', now()),\n (100101, 'T-Mobile (Austria)', '%s@sms.t-mobile.at', now()),\n (100102, 'Telus Mobility (Canada)', '%s@msg.telus.com', now()),\n (100103, 'Thumb Cellular', '%s@sms.thumbcellular.com', now()),\n (100104, 'Tigo (Formerly Ola)', '%s@sms.tigo.com.co', now()),\n (100105, 'Unicel', '%s@utext.com', now()),\n (100106, 'US Cellular', '%s@email.uscc.net', now()),\n (100107, 'Verizon', '%s@vtext.com', now()),\n (100108, 'Virgin Mobile (Canada)', '%s@vmobile.ca', now()),\n (100109, 'Virgin Mobile (USA)', '%s@vmobl.com', now()),\n (100110, 'YCC', '%s@sms.ycc.ru', now()),\n (100111, 'Orange (UK)', '%s@orange.net', now()),\n (100112, 'Cincinnati Bell Wireless', '%s@gocbw.com', now()),\n (100113, 'T-Mobile Germany', '%s@t-mobile-sms.de', now()),\n (100114, 'Vodafone Germany', '%s@vodafone-sms.de', now()),\n (100115, 'E-Plus', '%s@smsmail.eplus.de', now()),\n (100116, 'Cellular South', '%s@csouth1.com', now()),\n (100117, 'ChinaMobile (139)', '%s@139.com', now()),\n (100118, 'Dialog Axiata', '%s@dialog.lk', now()),\n (100119, 'Swisscom', '%s@sms.bluewin.ch', now()),\n (100120, 'Orange (CH)', '%s@orange.net', now()),\n (100121, 'Sunrise', '%s@gsm.sunrise.ch', now());\n\n-- Adding RADIUS nas client table\n\nCREATE TABLE radius_nas (\n id int(10) NOT NULL auto_increment,\n nasname varchar(128) NOT NULL,\n shortname varchar(32),\n type varchar(30) default 'other',\n ports int(5),\n secret varchar(60) default 'secret' NOT NULL,\n server varchar(64),\n community varchar(50),\n description varchar(200) default 'RADIUS Client',\n config_timestamp BIGINT,\n start_ip INT UNSIGNED DEFAULT 0,\n end_ip INT UNSIGNED DEFAULT 0,\n range_length INT DEFAULT 0,\n PRIMARY KEY nasname (nasname),\n KEY id (id)\n) ENGINE=InnoDB;\n\n-- Adding RADIUS accounting table\n\nCREATE TABLE radacct (\n radacctid bigint(21) NOT NULL auto_increment,\n acctsessionid varchar(64) NOT NULL default '',\n acctuniqueid varchar(32) NOT NULL default '',\n username varchar(64) NOT NULL default '',\n groupname varchar(64) NOT NULL default '',\n realm varchar(64) default '',\n nasipaddress varchar(15) NOT NULL default '',\n nasportid varchar(15) default NULL,\n nasporttype varchar(32) default NULL,\n acctstarttime datetime NULL default NULL,\n acctupdatetime datetime NULL default NULL,\n acctstoptime datetime NULL default NULL,\n acctinterval int(12) default NULL,\n acctsessiontime int(12) unsigned default NULL,\n acctauthentic varchar(32) default NULL,\n connectinfo_start varchar(50) default NULL,\n connectinfo_stop varchar(50) default NULL,\n acctinputoctets bigint(20) default NULL,\n acctoutputoctets bigint(20) default NULL,\n calledstationid varchar(50) NOT NULL default '',\n callingstationid varchar(50) NOT NULL default '',\n acctterminatecause varchar(32) NOT NULL default '',\n servicetype varchar(32) default NULL,\n framedprotocol varchar(32) default NULL,\n framedipaddress varchar(15) NOT NULL default '',\n PRIMARY KEY (radacctid),\n KEY acctuniqueid (acctuniqueid),\n KEY username (username),\n KEY framedipaddress (framedipaddress),\n KEY acctsessionid (acctsessionid),\n KEY acctsessiontime (acctsessiontime),\n KEY acctstarttime (acctstarttime),\n KEY acctinterval (acctinterval),\n KEY acctstoptime (acctstoptime),\n KEY nasipaddress (nasipaddress)\n) ENGINE = INNODB;\n\n-- Adding RADIUS update log table\n\nCREATE TABLE radacct_log (\n acctsessionid varchar(64) NOT NULL default '',\n username varchar(64) NOT NULL default '',\n nasipaddress varchar(15) NOT NULL default '',\n acctstatustype varchar(25) NOT NULL default '', \n timestamp datetime NULL default NULL,\n acctinputoctets bigint(20) default NULL,\n acctoutputoctets bigint(20) default NULL,\n acctsessiontime int(12) default NULL,\n KEY acctsessionid (acctsessionid),\n KEY username (username),\n KEY nasipaddress (nasipaddress),\n KEY timestamp (timestamp)\n) ENGINE=InnoDB;\n\n-- Adding RADIUS Updates Stored Procedure\n\nDROP PROCEDURE IF EXISTS acct_start;\nDELIMITER /\nCREATE PROCEDURE acct_start (\n IN p_acctsessionid varchar(64),\n IN p_acctuniqueid varchar(32),\n IN p_username varchar(64),\n IN p_realm varchar(64),\n IN p_nasipaddress varchar(15),\n IN p_nasportid varchar(15),\n IN p_nasporttype varchar(32),\n IN p_acctstarttime datetime,\n IN p_acctupdatetime datetime,\n IN p_acctstoptime datetime,\n IN p_acctsessiontime int(12) unsigned,\n IN p_acctauthentic varchar(32),\n IN p_connectinfo_start varchar(50),\n IN p_connectinfo_stop varchar(50),\n IN p_acctinputoctets bigint(20),\n IN p_acctoutputoctets bigint(20),\n IN p_calledstationid varchar(50),\n IN p_callingstationid varchar(50),\n IN p_acctterminatecause varchar(32),\n IN p_servicetype varchar(32),\n IN p_framedprotocol varchar(32),\n IN p_framedipaddress varchar(15),\n IN p_acctstatustype varchar(25)\n)\nBEGIN\n\n# We make sure there are no left over sessions for which we never received a \"stop\"\nDECLARE Previous_Session_Time int(12);\nSELECT acctsessiontime\nINTO Previous_Session_Time\nFROM radacct\nWHERE acctuniqueid = p_acctuniqueid\nAND (acctstoptime IS NULL OR acctstoptime = 0) LIMIT 1;\n\nIF (Previous_Session_Time IS NOT NULL) THEN\n UPDATE radacct SET\n acctstoptime = p_timestamp,\n acctterminatecause = 'UNKNOWN'\n WHERE acctuniqueid = p_acctuniqueid\n AND (acctstoptime IS NULL OR acctstoptime = 0);\nEND IF;\n\nINSERT INTO radacct \n (\n acctsessionid, acctuniqueid, username, \n realm, nasipaddress, nasportid, \n nasporttype, acctstarttime, acctupdatetime, \n acctstoptime, acctsessiontime, acctauthentic, \n connectinfo_start, connectinfo_stop, acctinputoctets, \n acctoutputoctets, calledstationid, callingstationid, \n acctterminatecause, servicetype, framedprotocol, \n framedipaddress\n ) \nVALUES \n (\n p_acctsessionid, p_acctuniqueid, p_username,\n p_realm, p_nasipaddress, p_nasportid,\n p_nasporttype, p_acctstarttime, p_acctupdatetime,\n p_acctstoptime, p_acctsessiontime, p_acctauthentic,\n p_connectinfo_start, p_connectinfo_stop, p_acctinputoctets,\n p_acctoutputoctets, p_calledstationid, p_callingstationid,\n p_acctterminatecause, p_servicetype, p_framedprotocol,\n p_framedipaddress\n );\n\n\n INSERT INTO radacct_log\n (acctsessionid, username, nasipaddress,\n timestamp, acctstatustype, acctinputoctets, acctoutputoctets, acctsessiontime)\n VALUES\n (p_acctsessionid, p_username, p_nasipaddress,\n p_acctstarttime, p_acctstatustype, p_acctinputoctets, p_acctoutputoctets, p_acctsessiontime);\nEND /\nDELIMITER ;\n\n-- Adding RADIUS Stop Stored Procedure\n\nDROP PROCEDURE IF EXISTS acct_stop;\nDELIMITER /\nCREATE PROCEDURE acct_stop (\n IN p_timestamp datetime,\n IN p_framedipaddress varchar(15),\n IN p_acctsessiontime int(12),\n IN p_acctinputoctets bigint(20),\n IN p_acctoutputoctets bigint(20),\n IN p_acctuniqueid varchar(64),\n IN p_acctsessionid varchar(64),\n IN p_username varchar(64),\n IN p_realm varchar(64),\n IN p_nasipaddress varchar(15),\n IN p_nasportid varchar(15),\n IN p_nasporttype varchar(32),\n IN p_acctauthentic varchar(32),\n IN p_connectinfo_stop varchar(50),\n IN p_calledstationid varchar(50),\n IN p_callingstationid varchar(50),\n IN p_servicetype varchar(32),\n IN p_framedprotocol varchar(32),\n IN p_acctterminatecause varchar(12),\n IN p_acctstatustype varchar(25)\n)\nBEGIN\n DECLARE Previous_Input_Octets bigint(20);\n DECLARE Previous_Output_Octets bigint(20);\n DECLARE Previous_Session_Time int(12);\n\n # Collect traffic previous values in the radacct table\n SELECT acctinputoctets, acctoutputoctets, acctsessiontime\n INTO Previous_Input_Octets, Previous_Output_Octets, Previous_Session_Time\n FROM radacct\n WHERE acctuniqueid = p_acctuniqueid\n AND (acctstoptime IS NULL OR acctstoptime = 0) LIMIT 1;\n\n # Set values to 0 when no previous records\n IF (Previous_Session_Time IS NULL) THEN\n SET Previous_Session_Time = 0;\n SET Previous_Input_Octets = 0;\n SET Previous_Output_Octets = 0;\n # If there is no open session for this, open one.\n INSERT INTO radacct \n (\n acctsessionid, acctuniqueid, username, \n realm, nasipaddress, nasportid, \n nasporttype, acctstoptime, acctstarttime,\n acctsessiontime, acctauthentic, \n connectinfo_stop, acctinputoctets, \n acctoutputoctets, calledstationid, callingstationid, \n servicetype, framedprotocol, acctterminatecause,\n framedipaddress\n ) \n VALUES \n (\n p_acctsessionid, p_acctuniqueid, p_username,\n p_realm, p_nasipaddress, p_nasportid,\n p_nasporttype, p_timestamp, date_sub(p_timestamp, INTERVAL p_acctsessiontime SECOND ), \n p_acctsessiontime, p_acctauthentic,\n p_connectinfo_stop, p_acctinputoctets,\n p_acctoutputoctets, p_calledstationid, p_callingstationid,\n p_servicetype, p_framedprotocol, p_acctterminatecause,\n p_framedipaddress\n );\n ELSE \n # Update record with new traffic\n UPDATE radacct SET\n acctstoptime = p_timestamp,\n acctsessiontime = p_acctsessiontime,\n acctinputoctets = p_acctinputoctets,\n acctoutputoctets = p_acctoutputoctets,\n acctterminatecause = p_acctterminatecause,\n connectinfo_stop = p_connectinfo_stop\n WHERE acctuniqueid = p_acctuniqueid\n AND (acctstoptime IS NULL OR acctstoptime = 0);\n END IF;\n\n # Create new record in the log table\n INSERT INTO radacct_log\n (acctsessionid, username, nasipaddress,\n timestamp, acctstatustype, acctinputoctets, acctoutputoctets, acctsessiontime)\n VALUES\n (p_acctsessionid, p_username, p_nasipaddress,\n p_timestamp, p_acctstatustype, (p_acctinputoctets - Previous_Input_Octets), (p_acctoutputoctets - Previous_Output_Octets),\n (p_acctsessiontime - Previous_Session_Time));\nEND /\nDELIMITER ;\n\n-- Adding RADIUS Updates Stored Procedure\n\nDROP PROCEDURE IF EXISTS acct_update;\nDELIMITER /\nCREATE PROCEDURE acct_update(\n IN p_timestamp datetime,\n IN p_framedipaddress varchar(15),\n IN p_acctsessiontime int(12),\n IN p_acctinputoctets bigint(20),\n IN p_acctoutputoctets bigint(20),\n IN p_acctuniqueid varchar(64),\n IN p_acctsessionid varchar(64),\n IN p_username varchar(64),\n IN p_realm varchar(64),\n IN p_nasipaddress varchar(15),\n IN p_nasportid varchar(15),\n IN p_nasporttype varchar(32),\n IN p_acctauthentic varchar(32),\n IN p_connectinfo_start varchar(50),\n IN p_calledstationid varchar(50),\n IN p_callingstationid varchar(50),\n IN p_servicetype varchar(32),\n IN p_framedprotocol varchar(32),\n IN p_acctstatustype varchar(25)\n)\nBEGIN\n DECLARE Previous_Input_Octets bigint(20);\n DECLARE Previous_Output_Octets bigint(20);\n DECLARE Previous_Session_Time int(12);\n DECLARE Previous_AcctUpdate_Time datetime;\n\n DECLARE Opened_Sessions int(12);\n DECLARE Latest_acctstarttime datetime;\n SELECT count(acctuniqueid), max(acctstarttime)\n INTO Opened_Sessions, Latest_acctstarttime\n FROM radacct\n WHERE acctuniqueid = p_acctuniqueid\n AND (acctstoptime IS NULL OR acctstoptime = 0);\n\n IF (Opened_Sessions > 1) THEN\n UPDATE radacct SET\n acctstoptime = NOW(),\n acctterminatecause = 'UNKNOWN'\n WHERE acctuniqueid = p_acctuniqueid\n AND acctstarttime < Latest_acctstarttime\n AND (acctstoptime IS NULL OR acctstoptime = 0);\n END IF;\n\n # Collect traffic previous values in the update table\n SELECT acctinputoctets, acctoutputoctets, acctsessiontime, acctupdatetime\n INTO Previous_Input_Octets, Previous_Output_Octets, Previous_Session_Time, Previous_AcctUpdate_Time\n FROM radacct\n WHERE acctuniqueid = p_acctuniqueid \n AND (acctstoptime IS NULL OR acctstoptime = 0) LIMIT 1;\n\n IF (Previous_Session_Time IS NULL) THEN\n # Set values to 0 when no previous records\n SET Previous_Session_Time = 0;\n SET Previous_Input_Octets = 0;\n SET Previous_Output_Octets = 0;\n SET Previous_AcctUpdate_Time = p_timestamp;\n # If there is no open session for this, open one.\n INSERT INTO radacct \n (\n acctsessionid, acctuniqueid, username, \n realm, nasipaddress, nasportid, \n nasporttype, acctstarttime, \n acctupdatetime, acctsessiontime, acctauthentic, \n connectinfo_start, acctinputoctets, \n acctoutputoctets, calledstationid, callingstationid, \n servicetype, framedprotocol, \n framedipaddress\n ) \n VALUES \n (\n p_acctsessionid, p_acctuniqueid, p_username,\n p_realm, p_nasipaddress, p_nasportid,\n p_nasporttype, date_sub(p_timestamp, INTERVAL p_acctsessiontime SECOND ), \n p_timestamp, p_acctsessiontime , p_acctauthentic,\n p_connectinfo_start, p_acctinputoctets,\n p_acctoutputoctets, p_calledstationid, p_callingstationid,\n p_servicetype, p_framedprotocol,\n p_framedipaddress\n );\n ELSE \n # Update record with new traffic\n UPDATE radacct SET\n framedipaddress = p_framedipaddress,\n acctsessiontime = p_acctsessiontime,\n acctinputoctets = p_acctinputoctets,\n acctoutputoctets = p_acctoutputoctets,\n acctupdatetime = p_timestamp,\n acctinterval = timestampdiff( second, Previous_AcctUpdate_Time, p_timestamp )\n WHERE acctuniqueid = p_acctuniqueid \n AND (acctstoptime IS NULL OR acctstoptime = 0);\n\n END IF;\n\n # Create new record in the log table\n INSERT INTO radacct_log\n (acctsessionid, username, nasipaddress,\n timestamp, acctstatustype, acctinputoctets, acctoutputoctets, acctsessiontime)\n VALUES\n (p_acctsessionid, p_username, p_nasipaddress,\n p_timestamp, p_acctstatustype, (p_acctinputoctets - Previous_Input_Octets), (p_acctoutputoctets - Previous_Output_Octets),\n (p_acctsessiontime - Previous_Session_Time));\nEND /\nDELIMITER ;\n\n--\n-- Statement of Health (SoH) related\n--\n-- The web interface allows you to create any number of named filters,\n-- which are a collection of rules. A rule is a specific condition that\n-- must be satisfied by the statement of health, e.g. \"anti-virus is not\n-- installed\". The rules in a filter are ANDed together to determine if\n-- the specified action is to be executed.\n\n--\n-- One entry per filter.\n--\n\nCREATE TABLE soh_filters (\n filter_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,\n name varchar(32) NOT NULL UNIQUE,\n\n -- If action is null, this filter won't do anything. Otherwise this\n -- column may have any value; \"accept\" and \"violation\" are currently\n -- recognised and acted upon.\n action varchar(32),\n\n -- If action = 'violation', then this column contains the vid of a\n -- violation to trigger. (I wish I could write a constraint to\n -- express this.)\n vid int\n) ENGINE=InnoDB;\n\nINSERT INTO soh_filters (name) VALUES ('Default');\n\n--\n-- One entry for each rule in a filter.\n--\n\nCREATE TABLE soh_filter_rules (\n rule_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,\n\n filter_id int NOT NULL,\n FOREIGN KEY (filter_id) REFERENCES soh_filters (filter_id)\n ON DELETE CASCADE,\n\n -- Any valid health class, e.g. \"antivirus\"\n class varchar(32) NOT NULL,\n\n -- Must be 'is' or 'is not'\n op varchar(16) NOT NULL,\n\n -- May be 'ok', 'installed', 'enabled', 'disabled', 'uptodate',\n -- 'microsoft' for now; more values may be used in future.\n status varchar(16) NOT NULL\n) ENGINE=InnoDB;\n\n--\n-- Table structure for table `scan`\n--\n\nCREATE TABLE scan (\n id varchar(20) NOT NULL,\n ip varchar(255) NOT NULL,\n mac varchar(17) NOT NULL,\n type varchar(255) NOT NULL,\n start_date datetime NOT NULL,\n update_date timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP,\n status varchar(255) NOT NULL,\n report_id varchar(255) NOT NULL,\n PRIMARY KEY (id)\n) ENGINE=InnoDB;\n\n--\n-- Table structure for table `billing`\n--\n\nCREATE TABLE billing (\n id varchar(20) NOT NULL,\n ip varchar(255) NOT NULL,\n mac varchar(17) NOT NULL,\n type varchar(255) NOT NULL,\n start_date datetime NOT NULL,\n update_date timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP,\n status varchar(255) NOT NULL,\n item varchar(255) NOT NULL,\n price varchar(255) NOT NULL,\n person varchar(255) NOT NULL,\n PRIMARY KEY (id)\n) ENGINE=InnoDB;\n\n--\n-- Table structure for table `savedsearch`\n--\n\nCREATE TABLE savedsearch (\n id int NOT NULL AUTO_INCREMENT,\n pid varchar(255) NOT NULL,\n namespace varchar(255) NOT NULL,\n name varchar(255) NOT NULL,\n query text,\n in_dashboard tinyint,\n PRIMARY KEY (id)\n) ENGINE=InnoDB;\n\n--\n-- Table structure for table \n--\n\nCREATE TABLE inline_accounting (\n outbytes bigint unsigned NOT NULL DEFAULT '0' COMMENT 'orig_raw_pktlen',\n inbytes bigint unsigned NOT NULL DEFAULT '0' COMMENT 'reply_raw_pktlen',\n ip varchar(16) NOT NULL,\n firstseen DATETIME NOT NULL,\n lastmodified DATETIME NOT NULL,\n status int unsigned NOT NULL default 0,\n PRIMARY KEY (ip, firstseen),\n INDEX (ip)\n ) ENGINE=InnoDB;\n\n--\n-- Table structure for wrix\n--\n\nCREATE TABLE wrix (\n id varchar(255) NOT NULL,\n `Provider_Identifier` varchar(255) NULL DEFAULT NULL,\n `Location_Identifier` varchar(255) NULL DEFAULT NULL,\n `Service_Provider_Brand` varchar(255) NULL DEFAULT NULL,\n `Location_Type` varchar(255) NULL DEFAULT NULL,\n `Sub_Location_Type` varchar(255) NULL DEFAULT NULL,\n `English_Location_Name` varchar(255) NULL DEFAULT NULL,\n `Location_Address1` varchar(255) NULL DEFAULT NULL,\n `Location_Address2` varchar(255) NULL DEFAULT NULL,\n `English_Location_City` varchar(255) NULL DEFAULT NULL,\n `Location_Zip_Postal_Code` varchar(255) NULL DEFAULT NULL,\n `Location_State_Province_Name` varchar(255) NULL DEFAULT NULL,\n `Location_Country_Name` varchar(255) NULL DEFAULT NULL,\n `Location_Phone_Number` varchar(255) NULL DEFAULT NULL,\n `SSID_Open_Auth` varchar(255) NULL DEFAULT NULL,\n `SSID_Broadcasted` varchar(255) NULL DEFAULT NULL,\n `WEP_Key` varchar(255) NULL DEFAULT NULL,\n `WEP_Key_Entry_Method` varchar(255) NULL DEFAULT NULL,\n `WEP_Key_Size` varchar(255) NULL DEFAULT NULL,\n `SSID_1X` varchar(255) NULL DEFAULT NULL,\n `SSID_1X_Broadcasted` varchar(255) NULL DEFAULT NULL,\n `Security_Protocol_1X` varchar(255) NULL DEFAULT NULL,\n `Client_Support` varchar(255) NULL DEFAULT NULL,\n `Restricted_Access` varchar(255) NULL DEFAULT NULL,\n `Location_URL` varchar(255) NULL DEFAULT NULL,\n `Coverage_Area` varchar(255) NULL DEFAULT NULL,\n `Open_Monday` varchar(255) NULL DEFAULT NULL,\n `Open_Tuesday` varchar(255) NULL DEFAULT NULL,\n `Open_Wednesday` varchar(255) NULL DEFAULT NULL,\n `Open_Thursday` varchar(255) NULL DEFAULT NULL,\n `Open_Friday` varchar(255) NULL DEFAULT NULL,\n `Open_Saturday` varchar(255) NULL DEFAULT NULL,\n `Open_Sunday` varchar(255) NULL DEFAULT NULL,\n `Longitude` varchar(255) NULL DEFAULT NULL,\n `Latitude` varchar(255) NULL DEFAULT NULL,\n `UTC_Timezone` varchar(255) NULL DEFAULT NULL,\n `MAC_Address` varchar(255) NULL DEFAULT NULL,\n PRIMARY KEY (id)\n) ENGINE=InnoDB;\n\n--\n-- Table structure for table `activation`\n--\n\nCREATE TABLE activation (\n `code_id` int NOT NULL AUTO_INCREMENT,\n `pid` varchar(255) default NULL,\n `mac` varchar(17) default NULL,\n `contact_info` varchar(255) NOT NULL, -- email or phone number were approbation request is sent \n `carrier_id` int(11) NULL,\n `activation_code` varchar(255) NOT NULL,\n `expiration` datetime NOT NULL,\n `unregdate` datetime default NULL,\n `status` varchar(60) default NULL,\n `type` varchar(60) NOT NULL,\n `portal` varchar(255) default NULL,\n PRIMARY KEY (code_id),\n KEY `mac` (mac),\n KEY `identifier` (pid, mac),\n KEY `activation` (activation_code, status)\n) ENGINE=InnoDB;\n\n\n--\n-- Table structure for table `keyed`\n--\n\nCREATE TABLE keyed (\n id VARCHAR(255),\n value LONGBLOB,\n PRIMARY KEY(id)\n) ENGINE=InnoDB;\n\n--\n-- Table structure for table 'pf_version'\n--\n\nCREATE TABLE pf_version ( `id` INT NOT NULL PRIMARY KEY, `version` VARCHAR(11) NOT NULL UNIQUE KEY);\n\n--\n-- Table structure for table 'radius_audit_log'\n--\n\nCREATE TABLE radius_audit_log (\n id int NOT NULL AUTO_INCREMENT,\n created_at TIMESTAMP NOT NULL,\n mac char(17) NOT NULL,\n ip varchar(255) NULL,\n computer_name varchar(255) NULL,\n user_name varchar(255) NULL,\n stripped_user_name varchar(255) NULL,\n realm varchar(255) NULL,\n event_type varchar(255) NULL,\n switch_id varchar(255) NULL,\n switch_mac varchar(255) NULL,\n switch_ip_address varchar(255) NULL,\n radius_source_ip_address varchar(255),\n called_station_id varchar(255) NULL,\n calling_station_id varchar(255) NULL,\n nas_port_type varchar(255) NULL,\n ssid varchar(255) NULL,\n nas_port_id varchar(255) NULL,\n ifindex varchar(255) NULL,\n nas_port varchar(255) NULL,\n connection_type varchar(255) NULL,\n nas_ip_address varchar(255) NULL,\n nas_identifier varchar(255) NULL,\n auth_status varchar(255) NULL,\n reason TEXT NULL,\n auth_type varchar(255) NULL,\n eap_type varchar(255) NULL,\n role varchar(255) NULL,\n node_status varchar(255) NULL,\n profile varchar(255) NULL,\n source varchar(255) NULL,\n auto_reg char(1) NULL,\n is_phone char(1) NULL,\n pf_domain varchar(255) NULL,\n uuid varchar(255) NULL,\n radius_request TEXT,\n radius_reply TEXT,\n request_time int(11) DEFAULT NULL,\n PRIMARY KEY (id),\n KEY `created_at` (created_at),\n KEY `mac` (mac),\n KEY `ip` (ip),\n KEY `user_name` (user_name)\n) ENGINE=InnoDB;\n\n--\n-- Updating to current version\n--\n\nINSERT INTO pf_version (id, version) VALUES (@VERSION_INT, CONCAT_WS('.', @MAJOR_VERSION, @MINOR_VERSION, @SUBMINOR_VERSION));\n\n--\n-- Creating auth_log table\n--\n\nCREATE TABLE auth_log (\n `id` int NOT NULL AUTO_INCREMENT,\n `process_name` varchar(255) NOT NULL,\n `mac` varchar(17) NOT NULL,\n `pid` varchar(255) NOT NULL default \"default\",\n `status` varchar(255) NOT NULL default \"incomplete\",\n `attempted_at` datetime NOT NULL,\n `completed_at` datetime,\n `source` varchar(255) NOT NULL,\n PRIMARY KEY (id),\n KEY pid (pid)\n) ENGINE=InnoDB;\n"} +{"text": "/*\n * Copyright 2019 Amazon.com, Inc. or its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at:\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific\n * language governing permissions and limitations under the License.\n */\n\nset_default_environment::{\n myList: [1, 1, 1, 1, 1, 1, 1, 2],\n}\n\ntest::{\n id: 'distinct value single table',\n statement: \"SELECT DISTINCT VALUE l FROM myList l\",\n expected: (success (bag 1 2))\n}\n\n"} +{"text": ".. ref-s3:\n\n====\nfile\n====\n\nboto.file.bucket\n----------------\n\n.. automodule:: boto.file.bucket\n :members: \n :undoc-members:\n\nboto.file.simpleresultset\n-------------------------\n\n.. automodule:: boto.file.simpleresultset\n :members: \n :undoc-members:\n\nboto.file.connection\n--------------------\n\n.. automodule:: boto.file.connection\n :members:\n :undoc-members:\n\nboto.file.key\n-------------\n\n.. automodule:: boto.file.key\n :members: \n :undoc-members:\n\n"} +{"text": "--event-scheduler=OFF\n"} +{"text": "/*\n * Copyright (C) 2006, 2007 Eric Seidel \n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PATH_TRAVERSAL_STATE_H_\n#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PATH_TRAVERSAL_STATE_H_\n\n#include \"base/macros.h\"\n#include \"third_party/blink/renderer/platform/geometry/float_point.h\"\n#include \"third_party/blink/renderer/platform/platform_export.h\"\n#include \"third_party/blink/renderer/platform/wtf/allocator/allocator.h\"\n\nnamespace blink {\n\nclass PLATFORM_EXPORT PathTraversalState final {\n STACK_ALLOCATED();\n DISALLOW_COPY_AND_ASSIGN(PathTraversalState);\n\n public:\n enum PathTraversalAction {\n kTraversalTotalLength,\n kTraversalPointAtLength,\n kTraversalNormalAngleAtLength\n };\n\n PathTraversalState(PathTraversalAction);\n\n float CloseSubpath();\n float MoveTo(const FloatPoint&);\n float LineTo(const FloatPoint&);\n float CubicBezierTo(const FloatPoint& new_control1,\n const FloatPoint& new_control2,\n const FloatPoint& new_end);\n\n void ProcessSegment();\n\n public:\n PathTraversalAction action_;\n bool success_;\n\n FloatPoint current_;\n FloatPoint start_;\n\n float total_length_;\n float desired_length_;\n\n // For normal calculations\n FloatPoint previous_;\n float normal_angle_; // degrees\n};\n\n} // namespace blink\n\n#endif\n"} +{"text": "\"\"\"The example shows you how to convert all Earth Engine Python scripts in a GitHub repo to Jupyter notebooks.\n\"\"\"\nimport subprocess\n\ntry:\n import geemap\nexcept ImportError:\n print('geemap package not installed. Installing ...')\n subprocess.check_call([\"python\", '-m', 'pip', 'install', 'geemap'])\n\nimport os\nfrom geemap.conversion import *\n\nimport subprocess\n\ntry:\n from git import Repo\nexcept ImportError:\n print('gitpython package is not installed. Installing ...')\n subprocess.check_call([\"python\", '-m', 'pip', 'install', 'gitpython'])\n from git import Repo\n\n\ngit_url = 'https://github.com/giswqs/qgis-earthengine-examples'\nout_repo_name = 'earthengine-py-notebooks'\n\n# Create a temporary working directory\nwork_dir = os.path.join(os.path.expanduser('~'), 'geemap')\nif not os.path.exists(work_dir):\n os.makedirs(work_dir)\n\nout_dir = os.path.join(work_dir, out_repo_name)\n\nrepo_name = git_url.split('/')[-1]\nrepo_dir = os.path.join(work_dir, repo_name)\n\nif not os.path.exists(repo_dir):\n Repo.clone_from(git_url, repo_dir)\n\n# # Convert all Earth Engine Python scripts in a folder recursively to Jupyter notebooks.\nnb_template = get_nb_template() # Get the notebook template from the package folder.\npy_to_ipynb_dir(repo_dir, nb_template, out_dir, github_username='giswqs', github_repo=out_repo_name)\n\n# execute_notebook_dir(out_dir)\n\n"} +{"text": ".theorem {\n display: block;\n margin: 12px 0;\n font-style: italic;\n}\n.theorem:before {\n counter-increment: theorem;\n content: \"Theorem \" counter(theorem) \".\";\n font-weight: bold;\n font-style: normal;\n}\nbody {\n counter-reset:section lemma theorem;\n}\n.paper_section:before {\n counter-increment: section;\n content:\"\";\n}\n.lemma {\n display: block;\n margin: 12px 0;\n font-style: italic;\n}\n.lemma:before {\n counter-increment: lemma;\n content: \"Lemma \" counter(lemma) \".\";\n font-weight: bold;\n font-style: normal;\n}\n.proof {\n display: block;\n margin: 12px 0;\n font-style: normal;\n}\n.proof:before {\n content: \"Proof.\";\n font-style: italic;\n}\n.proof:after {\n content: \"\\25FC\";\n float:right;\n}"} +{"text": "\n\n\n \n \n \n true\n false\n false\n false\n\n \n \n\n \n 30000\n\n \n \n false\n\n \n \n \n \n false\n\n admin\n axis2\n\n \n \n \n \n \n\n \n \n \n \n\n\n\n \n \n /\n\n \n \n \n services\n rest\n\n \n false\n\n \n \n\n \n \n\n \n \n \n\n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n 9017\n \n\n \n\n \n \n\n \n \n \n\n \n\n \n\n \n\n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \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": ";; Copyright 2015-2019 Workiva Inc.\n;; \n;; Licensed under the Eclipse Public License 1.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://opensource.org/licenses/eclipse-1.0.php\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(ns eva.v2.datastructures.bbtree.error\n (:require [eva.error :refer [deferror-group]])\n (:import (eva.error.v1 EvaErrorCode)))\n\n(deferror-group storage\n [:bbtree.storage [:method]]\n (failure \"A storage failure occurred in the btree\")\n (timeout \"A storage timeout occurred in the btree\" [:timeout-ms]))\n\n(deferror-group fressian-read-err\n [:fressian.unreadable [:handler-chain]]\n (vector \"Unable to deserialize vector\")\n (list \"Unable to deserialize list\")\n (set \"Unable to deserialize set\")\n (var \"Unable to resolve var\")\n (byte-string \"Unable to deserialize ByteString\"))\n\n(def overrides\n {:flowgraph/timeout EvaErrorCode/STORAGE_TIMEOUT})\n"} +{"text": "function render(container, data) {\n const template = document.querySelector('#template').innerHTML\n container.innerHTML = _.template(template)(data)\n container.style.setProperty('--avatar', `url(${data.avatar_url})`)\n}\n\nfunction getData(username) {\n username = username.replace(/[ ]/g, '')\n if (username == '') return;\n \n let apiUrl = `https://api.github.com/users/${username}`\n fetch(apiUrl)\n .then(function(response) {\n if(response.status != 200) {\n throw new Error(response.statusText)\n }\n return response.json()\n })\n .then(update)\n .catch(alert)\n}\n\nfunction update(data) {\n let current = document.getElementsByClassName('profile')[0]\n let isInitial = (current.innerHTML == '')\n\n if (isInitial) {\n render(current, data)\n return\n }\n\n // create a new card\n let next = document.createElement('div')\n next.className = 'profile'\n next.style.left = '100%'\n render(next, data)\n current.after(next)\n\n // define animation properties\n let animationOut = {\n keyframes: [\n {left: '0', opacity: 1, offset: 0},\n {left: '-100%', opacity: 0, offset: 1}\n ],\n options: {\n duration: 500,\n fill: 'forwards'\n }\n }\n\n let animationIn = {\n keyframes: [\n {left: '100%', opacity: 0, offset: 0},\n {left: '0', opacity: 1, offset: 1}\n ],\n options: {\n duration: 500,\n fill: 'forwards',\n delay: 500\n }\n }\n\n // animate the out animation first,\n // then animate the in animation\n let anime = current.animate(animationOut.keyframes, animationOut.options)\n anime.onfinish = () => {\n current.remove()\n next.animate(animationIn.keyframes, animationIn.options)\n }\n}\n\nfunction alert(error) {\n let keyframes = [\n {left: '100%', offset: 0},\n {left: '50%', offset: 0.2},\n {left: '50%', offset: 0.8},\n {left: '100%', offset: 1},\n ]\n\n let options = {\n duration: 2000,\n fill: 'forwards',\n }\n\n let element = document.getElementsByClassName('alert')[0]\n element.innerText = error.message\n element.animate(keyframes, options)\n}\n\nlet mockData = {\n \"avatar_url\": \"https://avatars3.githubusercontent.com/u/583231?v=4\",\n \"name\": \"The Octocat\",\n \"location\": \"San Francisco\",\n \"public_repos\": 111,\n \"followers\": 222,\n \"following\": 333,\n \"html_url\": \"https://github.com/octocat\",\n}\n\nwindow.onload = update(mockData)\n\ndocument.getElementById('search').addEventListener('click', () => {\n getData(document.getElementById('username').value)\n})\n\ndocument.getElementById('username').addEventListener('keypress', (e) => {\n if (e.charCode != 13) return;\n getData(document.getElementById('username').value)\n})\n"} +{"text": "//\n// TodayViewController.h\n// DemoToday\n//\n// Created by Tom Harrington on 11/13/14.\n// Copyright (c) 2014 Atomic Bird LLC. All rights reserved.\n//\n\n#import \n\n@interface TodayViewController : UITableViewController\n\n@end\n"} +{"text": "using System.Net.Http;\nusing static System.Console;\nusing System.Threading.Tasks;\nusing LaYumba.Functional;\n\nnamespace Examples.Chapter13\n{\n using Newtonsoft.Json.Linq;\n using static F;\n\n public class CurrencyLookup_Stateless\n {\n public static void _main()\n {\n WriteLine(\"Enter a currency pair like 'EURUSD' to get a quote, or 'q' to quit\");\n for (string input; (input = ReadLine().ToUpper()) != \"Q\";)\n WriteLine(FxApi.GetRate(input).Map(Decimal.ToString)\n .Recover(ex => ex.Message).Result); // what to do in case of failure\n }\n }\n\n static class FxApi_1\n {\n public static async Task GetRate(string ccyPair)\n {\n WriteLine($\"fetching rate...\");\n var s = await new HttpClient().GetStringAsync(QueryFor(ccyPair));\n return decimal.Parse(s.Trim());\n }\n\n static string QueryFor(string ccyPair)\n => $\"http://finance.yahoo.com/d/quotes.csv?f=l1&s={ccyPair}=X\";\n }\n\n static class FxApi_2\n {\n public static Task GetRate(string ccyPair) =>\n from s in new HttpClient().GetStringAsync(QueryFor(ccyPair))\n select decimal.Parse(s.Trim());\n\n static string QueryFor(string ccyPair)\n => $\"http://finance.yahoo.com/d/quotes.csv?f=l1&s={ccyPair}=X\";\n }\n\n\n\n static class FxApi\n {\n public static Task GetRate(string ccyPair) =>\n CurrencyLayer.GetRate(ccyPair)\n .OrElse(() => Yahoo.GetRate(ccyPair));\n }\n\n\n public static class Yahoo\n {\n public static Task GetRate(string ccyPair)\n {\n WriteLine($\"Fetching rate for {ccyPair} ...\");\n return from body in new HttpClient().GetStringAsync(QueryFor(ccyPair))\n select decimal.Parse(body.Trim());\n }\n\n static string QueryFor(string ccyPair)\n => $\"http://finance.yahoo.com/d/quotes.csv?f=l1&s={ccyPair}=X\";\n }\n\n\n /// \n /// Note that:\n /// 1. you need to get an API key from https://currencylayer.com/ (free, registration required)\n /// 2. the free plan only allows you to query rates with USD as base currency\n /// \n public static class CurrencyLayer\n {\n static string key = \"4772f4e46027c9047c9a2f7444c95c60\";\n\n public static Task GetRate(string ccyPair) =>\n from body in new HttpClient().GetStringAsync(QueryFor(ccyPair))\n select (decimal)JObject.Parse(body)[\"quotes\"][ccyPair];\n\n static string QueryFor(string pair)\n => $\"http://www.apilayer.net/api/live?access_key={key}\";\n }\n}\n"} +{"text": "\n *\n * This source file is subject to the MIT license that is bundled\n * with this source code in the file LICENSE.\n */\n\nnamespace Overtrue\\EasySms\\Gateways;\n\nuse Overtrue\\EasySms\\Contracts\\MessageInterface;\nuse Overtrue\\EasySms\\Contracts\\PhoneNumberInterface;\nuse Overtrue\\EasySms\\Exceptions\\GatewayErrorException;\nuse Overtrue\\EasySms\\Support\\Config;\nuse Overtrue\\EasySms\\Traits\\HasHttpRequest;\n\n/**\n * Class YuntongxunGateway.\n *\n * @see http://www.yuntongxun.com/doc/rest/sms/3_2_2_2.html\n */\nclass YuntongxunGateway extends Gateway\n{\n use HasHttpRequest;\n\n const ENDPOINT_TEMPLATE = 'https://%s:%s/%s/%s/%s/%s/%s?sig=%s';\n\n const SERVER_IP = 'app.cloopen.com';\n\n const DEBUG_SERVER_IP = 'sandboxapp.cloopen.com';\n\n const DEBUG_TEMPLATE_ID = 1;\n\n const SERVER_PORT = '8883';\n\n const SDK_VERSION = '2013-12-26';\n\n const SUCCESS_CODE = '000000';\n\n /**\n * @param \\Overtrue\\EasySms\\Contracts\\PhoneNumberInterface $to\n * @param \\Overtrue\\EasySms\\Contracts\\MessageInterface $message\n * @param \\Overtrue\\EasySms\\Support\\Config $config\n *\n * @return array\n *\n * @throws \\Overtrue\\EasySms\\Exceptions\\GatewayErrorException ;\n */\n public function send(PhoneNumberInterface $to, MessageInterface $message, Config $config)\n {\n $datetime = date('YmdHis');\n\n $endpoint = $this->buildEndpoint('SMS', 'TemplateSMS', $datetime, $config);\n\n $result = $this->request('post', $endpoint, [\n 'json' => [\n 'to' => $to,\n 'templateId' => (int) ($this->config->get('debug') ? self::DEBUG_TEMPLATE_ID : $message->getTemplate($this)),\n 'appId' => $config->get('app_id'),\n 'datas' => $message->getData($this),\n ],\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json;charset=utf-8',\n 'Authorization' => base64_encode($config->get('account_sid').':'.$datetime),\n ],\n ]);\n\n if (self::SUCCESS_CODE != $result['statusCode']) {\n throw new GatewayErrorException($result['statusCode'], $result['statusCode'], $result);\n }\n\n return $result;\n }\n\n /**\n * Build endpoint url.\n *\n * @param string $type\n * @param string $resource\n * @param string $datetime\n * @param \\Overtrue\\EasySms\\Support\\Config $config\n *\n * @return string\n */\n protected function buildEndpoint($type, $resource, $datetime, Config $config)\n {\n $serverIp = $this->config->get('debug') ? self::DEBUG_SERVER_IP : self::SERVER_IP;\n\n $accountType = $this->config->get('is_sub_account') ? 'SubAccounts' : 'Accounts';\n\n $sig = strtoupper(md5($config->get('account_sid').$config->get('account_token').$datetime));\n\n return sprintf(self::ENDPOINT_TEMPLATE, $serverIp, self::SERVER_PORT, self::SDK_VERSION, $accountType, $config->get('account_sid'), $type, $resource, $sig);\n }\n}\n"} +{"text": "[comment {-*- tcl -*- doctools manpage}]\n[manpage_begin doctools_lang_faq n 1.0]\n[see_also doctools_lang_cmdref]\n[see_also doctools_lang_intro]\n[see_also doctools_lang_syntax]\n[keywords {doctools commands}]\n[keywords {doctools language}]\n[keywords {doctools markup}]\n[keywords {doctools syntax}]\n[keywords examples]\n[keywords faq]\n[keywords markup]\n[keywords {semantic markup}]\n[copyright {2007 Andreas Kupries }]\n[moddesc {Documentation tools}]\n[titledesc {doctools language faq}]\n[category {Documentation tools}]\n[description]\n[vset theformat doctools]\n\n[section OVERVIEW]\n\n[include include/placeholder.inc]\n[include include/examples.inc]\n\n[vset CATEGORY doctools]\n[include ../doctools2base/include/feedback.inc]\n[manpage_end]\n"} +{"text": ".clearfix {\n @include clearfix();\n}\n"} +{"text": "\n\n \n \n \n \n \n \n \n _count \n \n AAAAAAAAAAI= \n \n \n \n _mt_index \n \n AAAAAAAAAAM= \n \n \n \n _tree \n \n AAAAAAAAAAQ= \n \n \n \n categories \n \n \n gap/fr/m14/7/73/732\n \n \n \n \n id \n 732 \n \n \n portal_type \n Category \n \n \n title \n Fiscalité reversée \n \n \n \n \n \n \n \n \n 0 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n"} +{"text": "package storage\n\nimport (\n\t\"bytes\"\n\t\"encoding/pem\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/theupdateframework/notary\"\n)\n\n// NewFileStore creates a fully configurable file store\nfunc NewFileStore(baseDir, fileExt string) (*FilesystemStore, error) {\n\tbaseDir = filepath.Clean(baseDir)\n\tif err := createDirectory(baseDir, notary.PrivExecPerms); err != nil {\n\t\treturn nil, err\n\t}\n\tif !strings.HasPrefix(fileExt, \".\") {\n\t\tfileExt = \".\" + fileExt\n\t}\n\n\treturn &FilesystemStore{\n\t\tbaseDir: baseDir,\n\t\text: fileExt,\n\t}, nil\n}\n\n// NewPrivateKeyFileStorage initializes a new filestore for private keys, appending\n// the notary.PrivDir to the baseDir.\nfunc NewPrivateKeyFileStorage(baseDir, fileExt string) (*FilesystemStore, error) {\n\tbaseDir = filepath.Join(baseDir, notary.PrivDir)\n\tmyStore, err := NewFileStore(baseDir, fileExt)\n\tmyStore.migrateTo0Dot4()\n\treturn myStore, err\n}\n\n// NewPrivateSimpleFileStore is a wrapper to create an owner readable/writeable\n// _only_ filestore\nfunc NewPrivateSimpleFileStore(baseDir, fileExt string) (*FilesystemStore, error) {\n\treturn NewFileStore(baseDir, fileExt)\n}\n\n// FilesystemStore is a store in a locally accessible directory\ntype FilesystemStore struct {\n\tbaseDir string\n\text string\n}\n\nfunc (f *FilesystemStore) moveKeyTo0Dot4Location(file string) {\n\tkeyID := filepath.Base(file)\n\tfileDir := filepath.Dir(file)\n\td, _ := f.Get(file)\n\tblock, _ := pem.Decode(d)\n\tif block == nil {\n\t\tlogrus.Warn(\"Key data for\", file, \"could not be decoded as a valid PEM block. The key will not been migrated and may not be available\")\n\t\treturn\n\t}\n\tfileDir = strings.TrimPrefix(fileDir, notary.RootKeysSubdir)\n\tfileDir = strings.TrimPrefix(fileDir, notary.NonRootKeysSubdir)\n\tif fileDir != \"\" {\n\t\tblock.Headers[\"gun\"] = filepath.ToSlash(fileDir[1:])\n\t}\n\tif strings.Contains(keyID, \"_\") {\n\t\trole := strings.Split(keyID, \"_\")[1]\n\t\tkeyID = strings.TrimSuffix(keyID, \"_\"+role)\n\t\tblock.Headers[\"role\"] = role\n\t}\n\tvar keyPEM bytes.Buffer\n\t// since block came from decoding the PEM bytes in the first place, and all we're doing is adding some headers we ignore the possibility of an error while encoding the block\n\tpem.Encode(&keyPEM, block)\n\tf.Set(keyID, keyPEM.Bytes())\n}\n\nfunc (f *FilesystemStore) migrateTo0Dot4() {\n\trootKeysSubDir := filepath.Clean(filepath.Join(f.Location(), notary.RootKeysSubdir))\n\tnonRootKeysSubDir := filepath.Clean(filepath.Join(f.Location(), notary.NonRootKeysSubdir))\n\tif _, err := os.Stat(rootKeysSubDir); !os.IsNotExist(err) && f.Location() != rootKeysSubDir {\n\t\tif rootKeysSubDir == \"\" || rootKeysSubDir == \"/\" {\n\t\t\t// making sure we don't remove a user's homedir\n\t\t\tlogrus.Warn(\"The directory for root keys is an unsafe value, we are not going to delete the directory. Please delete it manually\")\n\t\t} else {\n\t\t\t// root_keys exists, migrate things from it\n\t\t\tlistOnlyRootKeysDirStore, _ := NewFileStore(rootKeysSubDir, f.ext)\n\t\t\tfor _, file := range listOnlyRootKeysDirStore.ListFiles() {\n\t\t\t\tf.moveKeyTo0Dot4Location(filepath.Join(notary.RootKeysSubdir, file))\n\t\t\t}\n\t\t\t// delete the old directory\n\t\t\tos.RemoveAll(rootKeysSubDir)\n\t\t}\n\t}\n\n\tif _, err := os.Stat(nonRootKeysSubDir); !os.IsNotExist(err) && f.Location() != nonRootKeysSubDir {\n\t\tif nonRootKeysSubDir == \"\" || nonRootKeysSubDir == \"/\" {\n\t\t\t// making sure we don't remove a user's homedir\n\t\t\tlogrus.Warn(\"The directory for non root keys is an unsafe value, we are not going to delete the directory. Please delete it manually\")\n\t\t} else {\n\t\t\t// tuf_keys exists, migrate things from it\n\t\t\tlistOnlyNonRootKeysDirStore, _ := NewFileStore(nonRootKeysSubDir, f.ext)\n\t\t\tfor _, file := range listOnlyNonRootKeysDirStore.ListFiles() {\n\t\t\t\tf.moveKeyTo0Dot4Location(filepath.Join(notary.NonRootKeysSubdir, file))\n\t\t\t}\n\t\t\t// delete the old directory\n\t\t\tos.RemoveAll(nonRootKeysSubDir)\n\t\t}\n\t}\n\n\t// if we have a trusted_certificates folder, let's delete for a complete migration since it is unused by new clients\n\tcertsSubDir := filepath.Join(f.Location(), \"trusted_certificates\")\n\tif certsSubDir == \"\" || certsSubDir == \"/\" {\n\t\tlogrus.Warn(\"The directory for trusted certificate is an unsafe value, we are not going to delete the directory. Please delete it manually\")\n\t} else {\n\t\tos.RemoveAll(certsSubDir)\n\t}\n}\n\nfunc (f *FilesystemStore) getPath(name string) (string, error) {\n\tfileName := fmt.Sprintf(\"%s%s\", name, f.ext)\n\tfullPath := filepath.Join(f.baseDir, fileName)\n\n\tif !strings.HasPrefix(fullPath, f.baseDir) {\n\t\treturn \"\", ErrPathOutsideStore\n\t}\n\treturn fullPath, nil\n}\n\n// GetSized returns the meta for the given name (a role) up to size bytes\n// If size is \"NoSizeLimit\", this corresponds to \"infinite,\" but we cut off at a\n// predefined threshold \"notary.MaxDownloadSize\". If the file is larger than size\n// we return ErrMaliciousServer for consistency with the HTTPStore\nfunc (f *FilesystemStore) GetSized(name string, size int64) ([]byte, error) {\n\tp, err := f.getPath(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfile, err := os.OpenFile(p, os.O_RDONLY, notary.PrivNoExecPerms)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\terr = ErrMetaNotFound{Resource: name}\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\n\tif size == NoSizeLimit {\n\t\tsize = notary.MaxDownloadSize\n\t}\n\n\tstat, err := file.Stat()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif stat.Size() > size {\n\t\treturn nil, ErrMaliciousServer{}\n\t}\n\n\tl := io.LimitReader(file, size)\n\treturn ioutil.ReadAll(l)\n}\n\n// Get returns the meta for the given name.\nfunc (f *FilesystemStore) Get(name string) ([]byte, error) {\n\tp, err := f.getPath(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmeta, err := ioutil.ReadFile(p)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\terr = ErrMetaNotFound{Resource: name}\n\t\t}\n\t\treturn nil, err\n\t}\n\treturn meta, nil\n}\n\n// SetMulti sets the metadata for multiple roles in one operation\nfunc (f *FilesystemStore) SetMulti(metas map[string][]byte) error {\n\tfor role, blob := range metas {\n\t\terr := f.Set(role, blob)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// Set sets the meta for a single role\nfunc (f *FilesystemStore) Set(name string, meta []byte) error {\n\tfp, err := f.getPath(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Ensures the parent directories of the file we are about to write exist\n\terr = os.MkdirAll(filepath.Dir(fp), notary.PrivExecPerms)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// if something already exists, just delete it and re-write it\n\tos.RemoveAll(fp)\n\n\t// Write the file to disk\n\treturn ioutil.WriteFile(fp, meta, notary.PrivNoExecPerms)\n}\n\n// RemoveAll clears the existing filestore by removing its base directory\nfunc (f *FilesystemStore) RemoveAll() error {\n\treturn os.RemoveAll(f.baseDir)\n}\n\n// Remove removes the metadata for a single role - if the metadata doesn't\n// exist, no error is returned\nfunc (f *FilesystemStore) Remove(name string) error {\n\tp, err := f.getPath(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn os.RemoveAll(p) // RemoveAll succeeds if path doesn't exist\n}\n\n// Location returns a human readable name for the storage location\nfunc (f FilesystemStore) Location() string {\n\treturn f.baseDir\n}\n\n// ListFiles returns a list of all the filenames that can be used with Get*\n// to retrieve content from this filestore\nfunc (f FilesystemStore) ListFiles() []string {\n\tfiles := make([]string, 0, 0)\n\tfilepath.Walk(f.baseDir, func(fp string, fi os.FileInfo, err error) error {\n\t\t// If there are errors, ignore this particular file\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\t// Ignore if it is a directory\n\t\tif fi.IsDir() {\n\t\t\treturn nil\n\t\t}\n\n\t\t// If this is a symlink, ignore it\n\t\tif fi.Mode()&os.ModeSymlink == os.ModeSymlink {\n\t\t\treturn nil\n\t\t}\n\n\t\t// Only allow matches that end with our certificate extension (e.g. *.crt)\n\t\tmatched, _ := filepath.Match(\"*\"+f.ext, fi.Name())\n\n\t\tif matched {\n\t\t\t// Find the relative path for this file relative to the base path.\n\t\t\tfp, err = filepath.Rel(f.baseDir, fp)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\ttrimmed := strings.TrimSuffix(fp, f.ext)\n\t\t\tfiles = append(files, trimmed)\n\t\t}\n\t\treturn nil\n\t})\n\treturn files\n}\n\n// createDirectory receives a string of the path to a directory.\n// It does not support passing files, so the caller has to remove\n// the filename by doing filepath.Dir(full_path_to_file)\nfunc createDirectory(dir string, perms os.FileMode) error {\n\t// This prevents someone passing /path/to/dir and 'dir' not being created\n\t// If two '//' exist, MkdirAll deals it with correctly\n\tdir = dir + \"/\"\n\treturn os.MkdirAll(dir, perms)\n}\n"} +{"text": "FROM ubuntu:16.04\nMAINTAINER \"Aliasgar Ginwala\" \n\nARG OVS_BRANCH\nARG KERNEL_VERSION\nARG GITHUB_SRC\nARG DISTRO\n\ncopy $DISTRO/build-kernel-modules.sh /build-kernel-modules.sh\nRUN /build-kernel-modules.sh $KERNEL_VERSION $OVS_BRANCH $GITHUB_SRC\n\nCOPY create_ovs_db.sh /etc/openvswitch/create_ovs_db.sh\nRUN /etc/openvswitch/create_ovs_db.sh\n\nCOPY ovs-override.conf /etc/depmod.d/openvswitch.conf\n\nCOPY start-ovs /bin/start-ovs\nVOLUME [\"/var/log/openvswitch\", \"/var/lib/openvswitch\",\\\n \"/var/run/openvswitch\", \"/etc/openvswitch\"]\nENTRYPOINT [\"start-ovs\"]\n"} +{"text": "package com.example.senior;\n\nimport com.example.senior.adapter.SchedulePagerAdapter;\nimport com.example.senior.calendar.SpecialCalendar;\nimport com.example.senior.util.DateUtil;\n\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.IntentFilter;\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.support.v4.content.LocalBroadcastManager;\nimport android.support.v4.view.PagerTabStrip;\nimport android.support.v4.view.ViewPager;\nimport android.support.v4.view.ViewPager.OnPageChangeListener;\nimport android.support.v7.app.AppCompatActivity;\nimport android.util.Log;\nimport android.util.TypedValue;\nimport android.widget.LinearLayout;\nimport android.widget.TextView;\n\n/**\n * Created by ouyangshen on 2017/10/7.\n */\npublic class ScheduleActivity extends AppCompatActivity {\n private static final String TAG = \"ScheduleActivity\";\n // 声明一个碎片选中事件的标识串\n public static String ACTION_FRAGMENT_SELECTED = \"com.example.senior.ACTION_FRAGMENT_SELECTED\";\n // 声明一个选择星期参数的标识串\n public static String EXTRA_SELECTED_WEEK = \"selected_week\";\n // 声明一个显示节日事件的标识串\n public static String ACTION_SHOW_FESTIVAL = \"com.example.senior.ACTION_SHOW_FESTIVAL\";\n // 声明一个节日图片参数的标识串\n public static String EXTRA_FESTIVAL_RES = \"festival_res\";\n private LinearLayout ll_schedule; // 声明一个日程表区域的线性视图对象\n private ViewPager vp_schedule; // 声明一个翻页视图对象\n private int mSelectedWeek; // 当前选中的星期\n private int mFestivalResid = 0; // 节日图片的资源编号\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_schedule);\n // 从布局文件中获取名叫pts_schedule的翻页标题栏\n PagerTabStrip pts_schedule = findViewById(R.id.pts_schedule);\n pts_schedule.setTextSize(TypedValue.COMPLEX_UNIT_SP, 17);\n pts_schedule.setTextColor(Color.BLACK);\n ll_schedule = findViewById(R.id.ll_schedule);\n // 从布局文件中获取名叫vp_schedule的翻页视图\n vp_schedule = findViewById(R.id.vp_schedule);\n TextView tv_schedule = findViewById(R.id.tv_schedule);\n tv_schedule.setText(DateUtil.getNowYearCN() + \" 日程安排\");\n // 获取今天所处的星期在一年当中的序号\n mSelectedWeek = SpecialCalendar.getTodayWeek();\n // 构建一个日程表的翻页适配器\n SchedulePagerAdapter adapter = new SchedulePagerAdapter(getSupportFragmentManager());\n // 给vp_schedule设置日程表翻页适配器\n vp_schedule.setAdapter(adapter);\n // 设置vp_schedule默认显示当前周数的日程页\n vp_schedule.setCurrentItem(mSelectedWeek - 1);\n // 给vp_schedule添加页面变化监听器\n vp_schedule.addOnPageChangeListener(new SheduleChangeListener());\n // 延迟50毫秒再执行任务mFirst\n mHandler.postDelayed(mFirst, 50);\n }\n\n private Handler mHandler = new Handler(); // 声明一个处理器对象\n // 声明一个首次打开页面需要延迟执行的任务\n private Runnable mFirst = new Runnable() {\n @Override\n public void run() {\n sendBroadcast(mSelectedWeek); // 发送广播,表示当前是在第几个星期\n }\n };\n\n // 发送当前周数的广播\n private void sendBroadcast(int week) {\n // 创建一个广播事件的意图\n Intent intent = new Intent(ACTION_FRAGMENT_SELECTED);\n intent.putExtra(EXTRA_SELECTED_WEEK, week);\n // 通过本地的广播管理器来发送广播\n LocalBroadcastManager.getInstance(this).sendBroadcast(intent);\n }\n\n @Override\n public void onStart() {\n super.onStart();\n // 创建一个节日图片的广播接收器\n festivalReceiver = new FestivalControlReceiver();\n // 注册广播接收器,注册之后才能正常接收广播\n LocalBroadcastManager.getInstance(this)\n .registerReceiver(festivalReceiver, new IntentFilter(ACTION_SHOW_FESTIVAL));\n }\n\n @Override\n public void onStop() {\n super.onStop();\n // 注销广播接收器,注销之后就不再接收广播\n LocalBroadcastManager.getInstance(this).unregisterReceiver(festivalReceiver);\n }\n\n @Override\n protected void onResume() {\n super.onResume();\n if (mFestivalResid != 0) { // 在横屏和竖屏之间翻转时,不会重新onCreate,只会onResume\n ll_schedule.setBackgroundResource(mFestivalResid);\n }\n }\n\n // 声明一个节日图片的广播接收器\n private FestivalControlReceiver festivalReceiver;\n // 定义一个广播接收器,用于处理节日图片事件\n private class FestivalControlReceiver extends BroadcastReceiver {\n\n // 一旦接收到节日图片的广播,马上触发接收器的onReceive方法\n public void onReceive(Context context, Intent intent) {\n if (intent != null) {\n // 从广播消息中取出节日图片的资源编号\n mFestivalResid = intent.getIntExtra(EXTRA_FESTIVAL_RES, 1);\n // 把页面背景设置为广播发来的节日图片\n ll_schedule.setBackgroundResource(mFestivalResid);\n }\n }\n }\n\n // 定义一个页面变化监听器,用于处理翻页视图的翻页事件\n public class SheduleChangeListener implements OnPageChangeListener {\n\n // 在翻页结束后触发\n public void onPageSelected(int position) {\n Log.d(TAG, \"onPageSelected position=\" + position + \", mSelectedWeek=\" + mSelectedWeek);\n mSelectedWeek = position + 1;\n sendBroadcast(mSelectedWeek);\n }\n\n // 在翻页过程中触发\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {}\n\n // 翻页状态改变时触发\n public void onPageScrollStateChanged(int arg0) {}\n }\n}\n"} +{"text": "@charset \"UTF-8\";\n\n/* Tags */\n@import \"tags.css\";\n\n#top-github-link, #body #breadcrumbs {\n position: relative;\n top: 50%;\n -webkit-transform: translateY(-50%);\n -moz-transform: translateY(-50%);\n -o-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n}\n.button, .button-secondary {\n display: inline-block;\n padding: 7px 12px;\n}\n.button:active, .button-secondary:active {\n margin: 2px 0 -2px 0;\n}\n@font-face {\n font-family: 'Novacento Sans Wide';\n src: url(\"../fonts/Novecentosanswide-UltraLight-webfont.eot\");\n src: url(\"../fonts/Novecentosanswide-UltraLight-webfont.eot?#iefix\") format(\"embedded-opentype\"), url(\"../fonts/Novecentosanswide-UltraLight-webfont.woff2\") format(\"woff2\"), url(\"../fonts/Novecentosanswide-UltraLight-webfont.woff\") format(\"woff\"), url(\"../fonts/Novecentosanswide-UltraLight-webfont.ttf\") format(\"truetype\"), url(\"../fonts/Novecentosanswide-UltraLight-webfont.svg#novecento_sans_wideultralight\") format(\"svg\");\n font-style: normal;\n font-weight: 200;\n}\n@font-face {\n font-family: 'Work Sans';\n font-style: normal;\n font-weight: 300;\n src: url(\"../fonts/Work_Sans_300.eot?#iefix\") format(\"embedded-opentype\"), url(\"../fonts/Work_Sans_300.woff\") format(\"woff\"), url(\"../fonts/Work_Sans_300.woff2\") format(\"woff2\"), url(\"../fonts/Work_Sans_300.svg#WorkSans\") format(\"svg\"), url(\"../fonts/Work_Sans_300.ttf\") format(\"truetype\");\n}\n@font-face {\n font-family: 'Work Sans';\n font-style: normal;\n font-weight: 500;\n src: url(\"../fonts/Work_Sans_500.eot?#iefix\") format(\"embedded-opentype\"), url(\"../fonts/Work_Sans_500.woff\") format(\"woff\"), url(\"../fonts/Work_Sans_500.woff2\") format(\"woff2\"), url(\"../fonts/Work_Sans_500.svg#WorkSans\") format(\"svg\"), url(\"../fonts/Work_Sans_500.ttf\") format(\"truetype\");\n}\nbody {\n background: #fff;\n color: #777;\n}\nbody #chapter h1 {\n font-size: 3.5rem;\n}\n@media only all and (min-width: 48em) and (max-width: 59.938em) {\n body #chapter h1 {\n font-size: 3rem;\n }\n}\n@media only all and (max-width: 47.938em) {\n body #chapter h1 {\n font-size: 2rem;\n }\n}\na {\n color: #00bdf3;\n}\na:hover {\n color: #0082a7;\n}\npre {\n position: relative;\n color: #ffffff;\n}\n.bg {\n background: #fff;\n border: 1px solid #eaeaea;\n}\nb, strong, label, th {\n font-weight: 600;\n}\n.default-animation, #header #logo-svg, #header #logo-svg path, #sidebar, #sidebar ul, #body, #body .padding, #body .nav {\n -webkit-transition: all 0.5s ease;\n -moz-transition: all 0.5s ease;\n transition: all 0.5s ease;\n}\n#grav-logo {\n max-width: 60%;\n}\n#grav-logo path {\n fill: #fff !important;\n}\n#sidebar {\n font-weight: 300 !important;\n}\nfieldset {\n border: 1px solid #ddd;\n}\ntextarea, input[type=\"email\"], input[type=\"number\"], input[type=\"password\"], input[type=\"search\"], input[type=\"tel\"], input[type=\"text\"], input[type=\"url\"], input[type=\"color\"], input[type=\"date\"], input[type=\"datetime\"], input[type=\"datetime-local\"], input[type=\"month\"], input[type=\"time\"], input[type=\"week\"], select[multiple=multiple] {\n background-color: white;\n border: 1px solid #ddd;\n box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);\n}\ntextarea:hover, input[type=\"email\"]:hover, input[type=\"number\"]:hover, input[type=\"password\"]:hover, input[type=\"search\"]:hover, input[type=\"tel\"]:hover, input[type=\"text\"]:hover, input[type=\"url\"]:hover, input[type=\"color\"]:hover, input[type=\"date\"]:hover, input[type=\"datetime\"]:hover, input[type=\"datetime-local\"]:hover, input[type=\"month\"]:hover, input[type=\"time\"]:hover, input[type=\"week\"]:hover, select[multiple=multiple]:hover {\n border-color: #c4c4c4;\n}\ntextarea:focus, input[type=\"email\"]:focus, input[type=\"number\"]:focus, input[type=\"password\"]:focus, input[type=\"search\"]:focus, input[type=\"tel\"]:focus, input[type=\"text\"]:focus, input[type=\"url\"]:focus, input[type=\"color\"]:focus, input[type=\"date\"]:focus, input[type=\"datetime\"]:focus, input[type=\"datetime-local\"]:focus, input[type=\"month\"]:focus, input[type=\"time\"]:focus, input[type=\"week\"]:focus, select[multiple=multiple]:focus {\n border-color: #00bdf3;\n box-shadow: inset 0 1px 3px rgba(0,0,0,.06),0 0 5px rgba(0,169,218,.7)\n}\n#header-wrapper {\n background: #8451a1;\n color: #fff;\n text-align: center;\n border-bottom: 4px solid #9c6fb6;\n padding: 1rem;\n}\n#header a {\n display: inline-block;\n}\n#header #logo-svg {\n width: 8rem;\n height: 2rem;\n}\n#header #logo-svg path {\n fill: #fff;\n}\n.searchbox {\n margin-top: 1rem;\n position: relative;\n border: 1px solid #915eae;\n background: #764890;\n border-radius: 4px;\n}\n.searchbox label {\n color: rgba(255, 255, 255, 0.8);\n position: absolute;\n left: 10px;\n top: 3px;\n}\n.searchbox span {\n color: rgba(255, 255, 255, 0.6);\n position: absolute;\n right: 10px;\n top: 3px;\n cursor: pointer;\n}\n.searchbox span:hover {\n color: rgba(255, 255, 255, 0.9);\n}\n.searchbox input {\n display: inline-block;\n color: #fff;\n width: 100%;\n height: 30px;\n background: transparent;\n border: 0;\n padding: 0 25px 0 30px;\n margin: 0;\n font-weight: 300;\n}\n.searchbox input::-webkit-input-placeholder {\n color: rgba(255, 255, 255, 0.6);\n}\n.searchbox input::-moz-placeholder {\n color: rgba(255, 255, 255, 0.6);\n}\n.searchbox input:-moz-placeholder {\n color: rgba(255, 255, 255, 0.6);\n}\n.searchbox input:-ms-input-placeholder {\n color: rgba(255, 255, 255, 0.6);\n}\n#sidebar-toggle-span {\n display: none;\n}\n@media only all and (max-width: 47.938em) {\n #sidebar-toggle-span {\n display: inline;\n }\n}\n#sidebar {\n background-color: #322A38;\n position: fixed;\n top: 0;\n width: 300px;\n bottom: 0;\n left: 0;\n font-weight: 400;\n font-size: 15px;\n}\n#sidebar a {\n color: #ccc;\n}\n#sidebar a:hover {\n color: #e6e6e6;\n}\n#sidebar a.subtitle {\n color: rgba(204, 204, 204, 0.6);\n}\n#sidebar hr {\n border-bottom: 1px solid #2a232f;\n}\n#sidebar a.padding {\n padding: 0 1rem;\n}\n#sidebar h5 {\n margin: 2rem 0 0;\n position: relative;\n line-height: 2;\n}\n#sidebar h5 a {\n display: block;\n margin-left: 0;\n margin-right: 0;\n padding-left: 1rem;\n padding-right: 1rem;\n}\n#sidebar h5 i {\n color: rgba(204, 204, 204, 0.6);\n position: absolute;\n right: 0.6rem;\n top: 0.7rem;\n font-size: 80%;\n}\n#sidebar h5.parent a {\n background: #201b24;\n color: #d9d9d9 !important;\n}\n#sidebar h5.active a {\n background: #fff;\n color: #777 !important;\n}\n#sidebar h5.active i {\n color: #777 !important;\n}\n#sidebar h5 + ul.topics {\n display: none;\n margin-top: 0;\n}\n#sidebar h5.parent + ul.topics, #sidebar h5.active + ul.topics {\n display: block;\n}\n#sidebar ul {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n#sidebar ul.searched a {\n color: #999999;\n}\n#sidebar ul.searched .search-match a {\n color: #e6e6e6;\n}\n#sidebar ul.searched .search-match a:hover {\n color: white;\n}\n#sidebar ul.topics {\n margin: 0 1rem;\n}\n#sidebar ul.topics.searched ul {\n display: block;\n}\n#sidebar ul.topics ul {\n display: none;\n padding-bottom: 1rem;\n}\n#sidebar ul.topics ul ul {\n padding-bottom: 0;\n}\n#sidebar ul.topics li.parent ul, #sidebar ul.topics > li.active ul {\n display: block;\n}\n#sidebar ul.topics > li > a {\n line-height: 2rem;\n font-size: 1.1rem;\n}\n#sidebar ul.topics > li > a b {\n opacity: 0.5;\n font-weight: normal;\n}\n#sidebar ul.topics > li > a .fa {\n margin-top: 9px;\n}\n#sidebar ul.topics > li.parent, #sidebar ul.topics > li.active {\n background: #251f29;\n margin-left: -1rem;\n margin-right: -1rem;\n padding-left: 1rem;\n padding-right: 1rem;\n}\n#sidebar ul li.active > a {\n background: #fff;\n color: #777 !important;\n margin-left: -1rem;\n margin-right: -1rem;\n padding-left: 1rem;\n padding-right: 1rem;\n}\n#sidebar ul li {\n padding: 0;\n}\n#sidebar ul li.visited + span {\n margin-right: 16px;\n}\n#sidebar ul li a {\n display: block;\n padding: 2px 0;\n}\n#sidebar ul li a span {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n display: block;\n}\n#sidebar ul li > a {\n padding: 4px 0;\n}\n#sidebar ul li.visited > a .read-icon {\n color: #9c6fb6;\n display: inline;\n}\n#sidebar ul li li {\n padding-left: 1rem;\n text-indent: 0.2rem;\n}\n#main {\n background: #f7f7f7;\n margin: 0 0 1.563rem 0;\n}\n#body {\n position: relative;\n margin-left: 300px;\n min-height: 100%;\n}\n#body img, #body .video-container {\n margin: 3rem auto;\n display: block;\n text-align: center;\n}\n#body img.border, #body .video-container.border {\n border: 2px solid #e6e6e6 !important;\n padding: 2px;\n}\n#body img.shadow, #body .video-container.shadow {\n box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);\n}\n#body img.inline {\n display: inline !important;\n margin: 0 !important;\n vertical-align: bottom;\n}\n#body .bordered {\n border: 1px solid #ccc;\n}\n#body .padding {\n padding: 3rem 6rem;\n}\n@media only all and (max-width: 79.938em) {\n #body .padding {\n position: static;\n padding: 15px 3rem;\n }\n}\n\n@media only all and (max-width: 59.938em) {\n #body .padding {\n position: static;\n padding: 15px 1rem;\n }\n}\n@media only all and (max-width: 47.938em) {\n #body .padding {\n padding: 5px 1rem;\n }\n}\n#body h1 + hr {\n margin-top: -1.7rem;\n margin-bottom: 3rem;\n}\n@media only all and (max-width: 59.938em) {\n #body #navigation {\n position: static;\n margin-right: 0 !important;\n width: 100%;\n display: table;\n }\n}\n#body .nav {\n position: fixed;\n top: 0;\n bottom: 0;\n width: 4rem;\n font-size: 50px;\n height: 100%;\n cursor: pointer;\n display: table;\n text-align: center;\n}\n#body .nav > i {\n display: table-cell;\n vertical-align: middle;\n text-align: center;\n}\n@media only all and (max-width: 59.938em) {\n #body .nav {\n display: table-cell;\n position: static;\n top: auto;\n width: 50%;\n text-align: center;\n height: 100px;\n line-height: 100px;\n padding-top: 0;\n }\n #body .nav > i {\n display: inline-block;\n }\n}\n#body .nav:hover {\n background: #F6F6F6;\n}\n#body .nav.nav-pref {\n left: 0;\n}\n#body .nav.nav-next {\n right: 0;\n}\n#body-inner {\n margin-bottom: 5rem;\n}\n#chapter {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: 2rem 0;\n}\n#chapter #body-inner {\n padding-bottom: 3rem;\n max-width: 80%;\n}\n#chapter h3 {\n font-family: \"Work Sans\", \"Helvetica\", \"Tahoma\", \"Geneva\", \"Arial\", sans-serif;\n font-weight: 300;\n text-align: center;\n}\n#chapter h1 {\n font-size: 5rem;\n border-bottom: 4px solid #F0F2F4;\n}\n#chapter p {\n text-align: center;\n font-size: 1.2rem;\n}\n#footer {\n padding: 3rem 1rem;\n color: #b3b3b3;\n font-size: 13px;\n}\n#footer p {\n margin: 0;\n}\nbody {\n font-family: \"Work Sans\", \"Helvetica\", \"Tahoma\", \"Geneva\", \"Arial\", sans-serif;\n font-weight: 300;\n line-height: 1.6;\n font-size: 18px !important;\n}\nh2, h3, h4, h5, h6 {\n font-family: \"Work Sans\", \"Helvetica\", \"Tahoma\", \"Geneva\", \"Arial\", sans-serif;\n text-rendering: optimizeLegibility;\n color: #5e5e5e;\n font-weight: 400;\n letter-spacing: -1px;\n}\nh1 {\n font-family: \"Novacento Sans Wide\", \"Helvetica\", \"Tahoma\", \"Geneva\", \"Arial\", sans-serif;\n text-align: center;\n text-transform: uppercase;\n color: #222;\n font-weight: 200;\n}\nblockquote {\n border-left: 10px solid #F0F2F4;\n}\nblockquote p {\n font-size: 1.1rem;\n color: #999;\n}\nblockquote cite {\n display: block;\n text-align: right;\n color: #666;\n font-size: 1.2rem;\n}\ndiv.notices {\n margin: 2rem 0;\n position: relative;\n}\ndiv.notices p {\n padding: 15px;\n display: block;\n font-size: 1rem;\n margin-top: 0rem;\n margin-bottom: 0rem;\n color: #666;\n}\ndiv.notices p:first-child:before {\n position: absolute;\n top: 2px;\n color: #fff;\n font-family: \"Font Awesome 5 Free\";\n font-weight: 900;\n content: \"\\f06a\";\n left: 10px;\n}\ndiv.notices p:first-child:after {\n position: absolute;\n top: 2px;\n color: #fff;\n left: 2rem;\n}\ndiv.notices.info p {\n border-top: 30px solid #F0B37E;\n background: #FFF2DB;\n}\ndiv.notices.info p:first-child:after {\n content: 'Info';\n}\ndiv.notices.warning p {\n border-top: 30px solid rgba(217, 83, 79, 0.8);\n background: #FAE2E2;\n}\ndiv.notices.warning p:first-child:after {\n content: 'Warning';\n}\ndiv.notices.note p {\n border-top: 30px solid #6AB0DE;\n background: #E7F2FA;\n}\ndiv.notices.note p:first-child:after {\n content: 'Note';\n}\ndiv.notices.tip p {\n border-top: 30px solid rgba(92, 184, 92, 0.8);\n background: #E6F9E6;\n}\ndiv.notices.tip p:first-child:after {\n content: 'Tip';\n}\n\n/* attachments shortcode */\n\nsection.attachments {\n margin: 2rem 0;\n position: relative;\n}\n\nsection.attachments label {\n font-weight: 400;\n padding-left: 0.5em;\n padding-top: 0.2em;\n padding-bottom: 0.2em;\n margin: 0;\n}\n\nsection.attachments .attachments-files {\n padding: 15px;\n display: block;\n font-size: 1rem;\n margin-top: 0rem;\n margin-bottom: 0rem;\n color: #666;\n}\n\nsection.attachments.orange label {\n color: #fff;\n background: #F0B37E;\n}\n\nsection.attachments.orange .attachments-files {\n background: #FFF2DB;\n}\n\nsection.attachments.green label {\n color: #fff;\n background: rgba(92, 184, 92, 0.8);\n}\n\nsection.attachments.green .attachments-files {\n background: #E6F9E6;\n}\n\nsection.attachments.blue label {\n color: #fff;\n background: #6AB0DE;\n}\n\nsection.attachments.blue .attachments-files {\n background: #E7F2FA;\n}\n\nsection.attachments.grey label {\n color: #fff;\n background: #505d65;\n}\n\nsection.attachments.grey .attachments-files {\n background: #f4f4f4;\n}\n\n/* Children shortcode */\n\n/* Children shortcode */\n.children p {\n font-size: small;\n margin-top: 0px;\n padding-top: 0px;\n margin-bottom: 0px;\n padding-bottom: 0px;\n}\n.children-li p {\n font-size: small;\n font-style: italic;\n\n}\n.children-h2 p, .children-h3 p {\n font-size: small;\n margin-top: 0px;\n padding-top: 0px;\n margin-bottom: 0px;\n padding-bottom: 0px;\n}\n.children h3,.children h2 {\n margin-bottom: 0px;\n margin-top: 5px;\n}\n\ncode, kbd, pre, samp {\n font-family: \"Consolas\", menlo, monospace;\n font-size: 92%;\n}\ncode {\n border-radius: 2px;\n white-space: nowrap;\n color: #5e5e5e;\n background: #FFF7DD;\n border: 1px solid #fbf0cb;\n padding: 0px 2px;\n}\ncode + .copy-to-clipboard {\n margin-left: -1px;\n border-left: 0 !important;\n font-size: inherit !important;\n vertical-align: middle;\n height: 21px;\n top: 0;\n}\npre {\n padding: 1rem;\n margin: 2rem 0;\n background: #282c34;\n border: 0;\n border-radius: 2px;\n line-height: 1.15;\n}\npre code {\n color: whitesmoke;\n background: inherit;\n white-space: inherit;\n border: 0;\n padding: 0;\n margin: 0;\n font-size: 15px;\n}\nhr {\n border-bottom: 4px solid #F0F2F4;\n}\n.page-title {\n margin-top: -25px;\n padding: 25px;\n float: left;\n clear: both;\n background: #9c6fb6;\n color: #fff;\n}\n#body a.anchor-link {\n color: #ccc;\n}\n#body a.anchor-link:hover {\n color: #9c6fb6;\n}\n#body-inner .tabs-wrapper.ui-theme-badges {\n background: #1d1f21;\n}\n#body-inner .tabs-wrapper.ui-theme-badges .tabs-nav li {\n font-size: 0.9rem;\n text-transform: uppercase;\n}\n#body-inner .tabs-wrapper.ui-theme-badges .tabs-nav li a {\n background: #35393c;\n}\n#body-inner .tabs-wrapper.ui-theme-badges .tabs-nav li.current a {\n background: #4d5257;\n}\n#body-inner pre {\n white-space: pre-wrap;\n}\n.tabs-wrapper pre {\n margin: 1rem 0;\n border: 0;\n padding: 0;\n background: inherit;\n}\ntable {\n border: 1px solid #eaeaea;\n table-layout: auto;\n}\nth {\n background: #f7f7f7;\n padding: 0.5rem;\n}\ntd {\n padding: 0.5rem;\n border: 1px solid #eaeaea;\n}\n.button {\n background: #9c6fb6;\n color: #fff;\n box-shadow: 0 3px 0 #00a5d4;\n}\n.button:hover {\n background: #00a5d4;\n box-shadow: 0 3px 0 #008db6;\n color: #fff;\n}\n.button:active {\n box-shadow: 0 1px 0 #008db6;\n}\n.button-secondary {\n background: #F8B450;\n color: #fff;\n box-shadow: 0 3px 0 #f7a733;\n}\n.button-secondary:hover {\n background: #f7a733;\n box-shadow: 0 3px 0 #f69b15;\n color: #fff;\n}\n.button-secondary:active {\n box-shadow: 0 1px 0 #f69b15;\n}\n.bullets {\n margin: 1.7rem 0;\n margin-left: -0.85rem;\n margin-right: -0.85rem;\n overflow: auto;\n}\n.bullet {\n float: left;\n padding: 0 0.85rem;\n}\n.two-column-bullet {\n width: 50%;\n}\n@media only all and (max-width: 47.938em) {\n .two-column-bullet {\n width: 100%;\n }\n}\n.three-column-bullet {\n width: 33.33333%;\n}\n@media only all and (max-width: 47.938em) {\n .three-column-bullet {\n width: 100%;\n }\n}\n.four-column-bullet {\n width: 25%;\n}\n@media only all and (max-width: 47.938em) {\n .four-column-bullet {\n width: 100%;\n }\n}\n.bullet-icon {\n float: left;\n background: #9c6fb6;\n padding: 0.875rem;\n width: 3.5rem;\n height: 3.5rem;\n border-radius: 50%;\n color: #fff;\n font-size: 1.75rem;\n text-align: center;\n}\n.bullet-icon-1 {\n background: #9c6fb6;\n}\n.bullet-icon-2 {\n background: #00f3d8;\n}\n.bullet-icon-3 {\n background: #e6f300;\n}\n.bullet-content {\n margin-left: 4.55rem;\n}\n.tooltipped {\n position: relative;\n}\n.tooltipped:after {\n position: absolute;\n z-index: 1000000;\n display: none;\n padding: 5px 8px;\n font: normal normal 11px/1.5 \"Work Sans\", \"Helvetica\", \"Tahoma\", \"Geneva\", \"Arial\", sans-serif;\n color: #fff;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n pointer-events: none;\n content: attr(aria-label);\n background: rgba(0, 0, 0, 0.8);\n border-radius: 3px;\n -webkit-font-smoothing: subpixel-antialiased;\n}\n.tooltipped:before {\n position: absolute;\n z-index: 1000001;\n display: none;\n width: 0;\n height: 0;\n color: rgba(0, 0, 0, 0.8);\n pointer-events: none;\n content: \"\";\n border: 5px solid transparent;\n}\n.tooltipped:hover:before, .tooltipped:hover:after, .tooltipped:active:before, .tooltipped:active:after, .tooltipped:focus:before, .tooltipped:focus:after {\n display: inline-block;\n text-decoration: none;\n}\n.tooltipped-s:after, .tooltipped-se:after, .tooltipped-sw:after {\n top: 100%;\n right: 50%;\n margin-top: 5px;\n}\n.tooltipped-s:before, .tooltipped-se:before, .tooltipped-sw:before {\n top: auto;\n right: 50%;\n bottom: -5px;\n margin-right: -5px;\n border-bottom-color: rgba(0, 0, 0, 0.8);\n}\n.tooltipped-se:after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.tooltipped-sw:after {\n margin-right: -15px;\n}\n.tooltipped-n:after, .tooltipped-ne:after, .tooltipped-nw:after {\n right: 50%;\n bottom: 100%;\n margin-bottom: 5px;\n}\n.tooltipped-n:before, .tooltipped-ne:before, .tooltipped-nw:before {\n top: -5px;\n right: 50%;\n bottom: auto;\n margin-right: -5px;\n border-top-color: rgba(0, 0, 0, 0.8);\n}\n.tooltipped-ne:after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.tooltipped-nw:after {\n margin-right: -15px;\n}\n.tooltipped-s:after, .tooltipped-n:after {\n transform: translateX(50%);\n}\n.tooltipped-w:after {\n right: 100%;\n bottom: 50%;\n margin-right: 5px;\n transform: translateY(50%);\n}\n.tooltipped-w:before {\n top: 50%;\n bottom: 50%;\n left: -5px;\n margin-top: -5px;\n border-left-color: rgba(0, 0, 0, 0.8);\n}\n.tooltipped-e:after {\n bottom: 50%;\n left: 100%;\n margin-left: 5px;\n transform: translateY(50%);\n}\n.tooltipped-e:before {\n top: 50%;\n right: -5px;\n bottom: 50%;\n margin-top: -5px;\n border-right-color: rgba(0, 0, 0, 0.8);\n}\n.highlightable {\n padding: 1rem 0 1rem;\n overflow: auto;\n position: relative;\n}\n.hljs::selection, .hljs span::selection {\n background: #b7b7b7;\n}\n.lightbox-active #body {\n overflow: visible;\n}\n.lightbox-active #body .padding {\n overflow: visible;\n}\n#github-contrib i {\n vertical-align: middle;\n}\n.featherlight img {\n margin: 0 !important;\n}\n.lifecycle #body-inner ul {\n list-style: none;\n margin: 0;\n padding: 2rem 0 0;\n position: relative;\n}\n.lifecycle #body-inner ol {\n margin: 1rem 0 1rem 0;\n padding: 2rem;\n position: relative;\n}\n.lifecycle #body-inner ol li {\n margin-left: 1rem;\n}\n.lifecycle #body-inner ol strong, .lifecycle #body-inner ol label, .lifecycle #body-inner ol th {\n text-decoration: underline;\n}\n.lifecycle #body-inner ol ol {\n margin-left: -1rem;\n}\n.lifecycle #body-inner h3[class*='level'] {\n font-size: 20px;\n position: absolute;\n margin: 0;\n padding: 4px 10px;\n right: 0;\n z-index: 1000;\n color: #fff;\n background: #1ABC9C;\n}\n.lifecycle #body-inner ol h3 {\n margin-top: 1rem !important;\n right: 2rem !important;\n}\n.lifecycle #body-inner .level-1 + ol {\n background: #f6fefc;\n border: 4px solid #1ABC9C;\n color: #16A085;\n}\n.lifecycle #body-inner .level-1 + ol h3 {\n background: #2ECC71;\n}\n.lifecycle #body-inner .level-2 + ol {\n background: #f7fdf9;\n border: 4px solid #2ECC71;\n color: #27AE60;\n}\n.lifecycle #body-inner .level-2 + ol h3 {\n background: #3498DB;\n}\n.lifecycle #body-inner .level-3 + ol {\n background: #f3f9fd;\n border: 4px solid #3498DB;\n color: #2980B9;\n}\n.lifecycle #body-inner .level-3 + ol h3 {\n background: #34495E;\n}\n.lifecycle #body-inner .level-4 + ol {\n background: #e4eaf0;\n border: 4px solid #34495E;\n color: #2C3E50;\n}\n.lifecycle #body-inner .level-4 + ol h3 {\n background: #34495E;\n}\n#top-bar {\n background: #F6F6F6;\n border-radius: 2px;\n padding: 0 1rem;\n height: 0;\n min-height: 3rem;\n}\n#top-github-link {\n position: relative;\n z-index: 1;\n float: right;\n display: block;\n}\n#body #breadcrumbs {\n height: auto;\n margin-bottom: 0;\n padding-left: 0;\n line-height: 1.4;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n width: 70%;\n display: inline-block;\n float: left;\n}\n#body #breadcrumbs span {\n padding: 0 0.1rem;\n}\n@media only all and (max-width: 59.938em) {\n #sidebar {\n width: 230px;\n }\n #body {\n margin-left: 230px;\n }\n}\n@media only all and (max-width: 47.938em) {\n #sidebar {\n width: 230px;\n left: -230px;\n }\n #body {\n margin-left: 0;\n width: 100%;\n }\n .sidebar-hidden {\n overflow: hidden;\n }\n .sidebar-hidden #sidebar {\n left: 0;\n }\n .sidebar-hidden #body {\n margin-left: 230px;\n overflow: hidden;\n }\n .sidebar-hidden #overlay {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 10;\n background: rgba(255, 255, 255, 0.5);\n cursor: pointer;\n }\n}\n.copy-to-clipboard {\n background-image: url(../images/clippy.svg);\n background-position: 50% 50%;\n background-size: 16px 16px;\n background-repeat: no-repeat;\n width: 27px;\n height: 1.45rem;\n top: -1px;\n display: inline-block;\n vertical-align: middle;\n position: relative;\n color: #5e5e5e;\n background-color: #FFF7DD;\n margin-left: -.2rem;\n cursor: pointer;\n border-radius: 0 2px 2px 0;\n margin-bottom: 1px;\n}\n.copy-to-clipboard:hover {\n background-color: #E8E2CD;\n}\npre .copy-to-clipboard {\n position: absolute;\n right: 4px;\n top: 4px;\n background-color: #949bab;\n color: #ccc;\n border-radius: 2px;\n}\npre .copy-to-clipboard:hover {\n background-color: #656c72;\n color: #fff;\n}\n.parent-element {\n -webkit-transform-style: preserve-3d;\n -moz-transform-style: preserve-3d;\n transform-style: preserve-3d;\n}\n\n#sidebar ul.topics > li > a .read-icon {\n margin-top: 9px;\n}\n\n#sidebar ul {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n\n#sidebar #shortcuts li {\n padding: 2px 0;\n list-style: none;\n}\n\n#sidebar ul li .read-icon {\n display: none;\n float: right;\n font-size: 13px;\n min-width: 16px;\n margin: 4px 0 0 0;\n text-align: right;\n}\n#sidebar ul li.visited > a .read-icon {\n color: #00bdf3;\n display: inline;\n}\n\n#sidebar #shortcuts h3 {\n font-family: \"Novacento Sans Wide\", \"Helvetica\", \"Tahoma\", \"Geneva\", \"Arial\", sans-serif;\n color: white ;\n margin-top:1rem;\n padding-left: 1rem;\n}\n\n#searchResults {\n text-align: left;\n}\n\noption {\n color: initial;\n}\n\n#logo {\n font-family: \"Novacento Sans Wide\", \"Helvetica\", \"Tahoma\", \"Geneva\", \"Arial\", sans-serif !important;\n color: white !important;\n margin-bottom: 0;\n text-transform: uppercase;\n}\n\n.searchbox i {\n margin-top: 5px;\n}\n\n.summary {\n margin-top: 0;\n margin-bottom: 0;\n}\n\n.api-page table{\n margin-top: 20px;\n}\n\n.highlight {\n display: inline-block !important;\n}\n\n.gif {\n max-height: 500px;\n}\n\n.sponsor {\n height: 70px !important;\n margin-top: 25px !important;\n display: inline-block !important;\n }\n\n#logo-pic {\n height: 60px !important;\n}\n\n.submenu {\n margin-top: 30px !important;\n padding-left: 13px !important;\n display: none;\n}\n\n.submenu-active {\n display: block;\n}\n\n.active-link {\n text-decoration: underline;\n}\n\n.menu-group-link a{\n padding-left: 10px !important;\n border-left: 3px solid transparent;\n text-transform: uppercase;\n cursor: pointer;\n}\n\n.menu-group-link a:hover{\n border-left: 3px solid #0082a7;\n}\n\n.menu-group-link-active {\n border-left: 3px solid #0082a7;\n}\n\n\n#body-inner p {\n margin: 0.8rem 0;\n}\n\n#body-inner pre {\n margin: 1.2rem 0;\n}\n\n\n#sidebar #languages li {\n padding: 2px 0;\n list-style: none;\n}\n\n\n#sidebar #languages h3 {\n font-family: \"Novacento Sans Wide\", \"Helvetica\", \"Tahoma\", \"Geneva\", \"Arial\", sans-serif;\n color: white ;\n margin-top:1rem;\n padding-left: 1rem;\n}"} +{"text": "/**\n ******************************************************************************\n * @file stm32f4xx_hal_rng.c\n * @author MCD Application Team\n * @brief RNG HAL module driver.\n * This file provides firmware functions to manage the following\n * functionalities of the Random Number Generator (RNG) peripheral:\n * + Initialization and configuration functions\n * + Peripheral Control functions\n * + Peripheral State functions\n *\n @verbatim\n ==============================================================================\n ##### How to use this driver #####\n ==============================================================================\n [..]\n The RNG HAL driver can be used as follows:\n\n (#) Enable the RNG controller clock using __HAL_RCC_RNG_CLK_ENABLE() macro\n in HAL_RNG_MspInit().\n (#) Activate the RNG peripheral using HAL_RNG_Init() function.\n (#) Wait until the 32 bit Random Number Generator contains a valid\n random data using (polling/interrupt) mode.\n (#) Get the 32 bit random number using HAL_RNG_GenerateRandomNumber() function.\n\n ##### Callback registration #####\n ==================================\n\n [..]\n The compilation define USE_HAL_RNG_REGISTER_CALLBACKS when set to 1\n allows the user to configure dynamically the driver callbacks.\n\n [..]\n Use Function @ref HAL_RNG_RegisterCallback() to register a user callback.\n Function @ref HAL_RNG_RegisterCallback() allows to register following callbacks:\n (+) ErrorCallback : RNG Error Callback.\n (+) MspInitCallback : RNG MspInit.\n (+) MspDeInitCallback : RNG MspDeInit.\n This function takes as parameters the HAL peripheral handle, the Callback ID\n and a pointer to the user callback function.\n\n [..]\n Use function @ref HAL_RNG_UnRegisterCallback() to reset a callback to the default\n weak (surcharged) function.\n @ref HAL_RNG_UnRegisterCallback() takes as parameters the HAL peripheral handle,\n and the Callback ID.\n This function allows to reset following callbacks:\n (+) ErrorCallback : RNG Error Callback.\n (+) MspInitCallback : RNG MspInit.\n (+) MspDeInitCallback : RNG MspDeInit.\n\n [..]\n For specific callback ReadyDataCallback, use dedicated register callbacks:\n respectively @ref HAL_RNG_RegisterReadyDataCallback() , @ref HAL_RNG_UnRegisterReadyDataCallback().\n\n [..]\n By default, after the @ref HAL_RNG_Init() and when the state is HAL_RNG_STATE_RESET\n all callbacks are set to the corresponding weak (surcharged) functions:\n example @ref HAL_RNG_ErrorCallback().\n Exception done for MspInit and MspDeInit functions that are respectively\n reset to the legacy weak (surcharged) functions in the @ref HAL_RNG_Init()\n and @ref HAL_RNG_DeInit() only when these callbacks are null (not registered beforehand).\n If not, MspInit or MspDeInit are not null, the @ref HAL_RNG_Init() and @ref HAL_RNG_DeInit()\n keep and use the user MspInit/MspDeInit callbacks (registered beforehand).\n\n [..]\n Callbacks can be registered/unregistered in HAL_RNG_STATE_READY state only.\n Exception done MspInit/MspDeInit that can be registered/unregistered\n in HAL_RNG_STATE_READY or HAL_RNG_STATE_RESET state, thus registered (user)\n MspInit/DeInit callbacks can be used during the Init/DeInit.\n In that case first register the MspInit/MspDeInit user callbacks\n using @ref HAL_RNG_RegisterCallback() before calling @ref HAL_RNG_DeInit()\n or @ref HAL_RNG_Init() function.\n\n [..]\n When The compilation define USE_HAL_RNG_REGISTER_CALLBACKS is set to 0 or\n not defined, the callback registration feature is not available\n and weak (surcharged) callbacks are used.\n\n @endverbatim\n ******************************************************************************\n * @attention\n *\n *

© Copyright (c) 2016 STMicroelectronics.\n * All rights reserved.

\n *\n * This software component is licensed by ST under BSD 3-Clause license,\n * the \"License\"; You may not use this file except in compliance with the\n * License. You may obtain a copy of the License at:\n * opensource.org/licenses/BSD-3-Clause\n *\n ******************************************************************************\n */\n\n/* Includes ------------------------------------------------------------------*/\n#include \"stm32f4xx_hal.h\"\n\n/** @addtogroup STM32F4xx_HAL_Driver\n * @{\n */\n\n#if defined (RNG)\n\n/** @addtogroup RNG\n * @brief RNG HAL module driver.\n * @{\n */\n\n#ifdef HAL_RNG_MODULE_ENABLED\n\n/* Private types -------------------------------------------------------------*/\n/* Private defines -----------------------------------------------------------*/\n/* Private variables ---------------------------------------------------------*/\n/* Private constants ---------------------------------------------------------*/\n/** @defgroup RNG_Private_Constants RNG Private Constants\n * @{\n */\n#define RNG_TIMEOUT_VALUE 2U\n/**\n * @}\n */\n/* Private macros ------------------------------------------------------------*/\n/* Private functions prototypes ----------------------------------------------*/\n/* Private functions ---------------------------------------------------------*/\n/* Exported functions --------------------------------------------------------*/\n\n/** @addtogroup RNG_Exported_Functions\n * @{\n */\n\n/** @addtogroup RNG_Exported_Functions_Group1\n * @brief Initialization and configuration functions\n *\n@verbatim\n ===============================================================================\n ##### Initialization and configuration functions #####\n ===============================================================================\n [..] This section provides functions allowing to:\n (+) Initialize the RNG according to the specified parameters\n in the RNG_InitTypeDef and create the associated handle\n (+) DeInitialize the RNG peripheral\n (+) Initialize the RNG MSP\n (+) DeInitialize RNG MSP\n\n@endverbatim\n * @{\n */\n\n/**\n * @brief Initializes the RNG peripheral and creates the associated handle.\n * @param hrng pointer to a RNG_HandleTypeDef structure that contains\n * the configuration information for RNG.\n * @retval HAL status\n */\nHAL_StatusTypeDef HAL_RNG_Init(RNG_HandleTypeDef *hrng)\n{\n /* Check the RNG handle allocation */\n if (hrng == NULL)\n {\n return HAL_ERROR;\n }\n /* Check the parameters */\n assert_param(IS_RNG_ALL_INSTANCE(hrng->Instance));\n\n#if (USE_HAL_RNG_REGISTER_CALLBACKS == 1)\n if (hrng->State == HAL_RNG_STATE_RESET)\n {\n /* Allocate lock resource and initialize it */\n hrng->Lock = HAL_UNLOCKED;\n\n hrng->ReadyDataCallback = HAL_RNG_ReadyDataCallback; /* Legacy weak ReadyDataCallback */\n hrng->ErrorCallback = HAL_RNG_ErrorCallback; /* Legacy weak ErrorCallback */\n\n if (hrng->MspInitCallback == NULL)\n {\n hrng->MspInitCallback = HAL_RNG_MspInit; /* Legacy weak MspInit */\n }\n\n /* Init the low level hardware */\n hrng->MspInitCallback(hrng);\n }\n#else\n if (hrng->State == HAL_RNG_STATE_RESET)\n {\n /* Allocate lock resource and initialize it */\n hrng->Lock = HAL_UNLOCKED;\n\n /* Init the low level hardware */\n HAL_RNG_MspInit(hrng);\n }\n#endif /* USE_HAL_RNG_REGISTER_CALLBACKS */\n\n /* Change RNG peripheral state */\n hrng->State = HAL_RNG_STATE_BUSY;\n\n\n /* Enable the RNG Peripheral */\n __HAL_RNG_ENABLE(hrng);\n\n /* Initialize the RNG state */\n hrng->State = HAL_RNG_STATE_READY;\n\n /* Initialise the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_NONE;\n\n /* Return function status */\n return HAL_OK;\n}\n\n/**\n * @brief DeInitializes the RNG peripheral.\n * @param hrng pointer to a RNG_HandleTypeDef structure that contains\n * the configuration information for RNG.\n * @retval HAL status\n */\nHAL_StatusTypeDef HAL_RNG_DeInit(RNG_HandleTypeDef *hrng)\n{\n /* Check the RNG handle allocation */\n if (hrng == NULL)\n {\n return HAL_ERROR;\n }\n\n /* Disable the RNG Peripheral */\n CLEAR_BIT(hrng->Instance->CR, RNG_CR_IE | RNG_CR_RNGEN);\n\n /* Clear RNG interrupt status flags */\n CLEAR_BIT(hrng->Instance->SR, RNG_SR_CEIS | RNG_SR_SEIS);\n\n#if (USE_HAL_RNG_REGISTER_CALLBACKS == 1)\n if (hrng->MspDeInitCallback == NULL)\n {\n hrng->MspDeInitCallback = HAL_RNG_MspDeInit; /* Legacy weak MspDeInit */\n }\n\n /* DeInit the low level hardware */\n hrng->MspDeInitCallback(hrng);\n#else\n /* DeInit the low level hardware */\n HAL_RNG_MspDeInit(hrng);\n#endif /* USE_HAL_RNG_REGISTER_CALLBACKS */\n\n /* Update the RNG state */\n hrng->State = HAL_RNG_STATE_RESET;\n\n /* Initialise the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_NONE;\n\n /* Release Lock */\n __HAL_UNLOCK(hrng);\n\n /* Return the function status */\n return HAL_OK;\n}\n\n/**\n * @brief Initializes the RNG MSP.\n * @param hrng pointer to a RNG_HandleTypeDef structure that contains\n * the configuration information for RNG.\n * @retval None\n */\n__weak void HAL_RNG_MspInit(RNG_HandleTypeDef *hrng)\n{\n /* Prevent unused argument(s) compilation warning */\n UNUSED(hrng);\n /* NOTE : This function should not be modified. When the callback is needed,\n function HAL_RNG_MspInit must be implemented in the user file.\n */\n}\n\n/**\n * @brief DeInitializes the RNG MSP.\n * @param hrng pointer to a RNG_HandleTypeDef structure that contains\n * the configuration information for RNG.\n * @retval None\n */\n__weak void HAL_RNG_MspDeInit(RNG_HandleTypeDef *hrng)\n{\n /* Prevent unused argument(s) compilation warning */\n UNUSED(hrng);\n /* NOTE : This function should not be modified. When the callback is needed,\n function HAL_RNG_MspDeInit must be implemented in the user file.\n */\n}\n\n#if (USE_HAL_RNG_REGISTER_CALLBACKS == 1)\n/**\n * @brief Register a User RNG Callback\n * To be used instead of the weak predefined callback\n * @param hrng RNG handle\n * @param CallbackID ID of the callback to be registered\n * This parameter can be one of the following values:\n * @arg @ref HAL_RNG_ERROR_CB_ID Error callback ID\n * @arg @ref HAL_RNG_MSPINIT_CB_ID MspInit callback ID\n * @arg @ref HAL_RNG_MSPDEINIT_CB_ID MspDeInit callback ID\n * @param pCallback pointer to the Callback function\n * @retval HAL status\n */\nHAL_StatusTypeDef HAL_RNG_RegisterCallback(RNG_HandleTypeDef *hrng, HAL_RNG_CallbackIDTypeDef CallbackID, pRNG_CallbackTypeDef pCallback)\n{\n HAL_StatusTypeDef status = HAL_OK;\n\n if (pCallback == NULL)\n {\n /* Update the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_INVALID_CALLBACK;\n return HAL_ERROR;\n }\n /* Process locked */\n __HAL_LOCK(hrng);\n\n if (HAL_RNG_STATE_READY == hrng->State)\n {\n switch (CallbackID)\n {\n case HAL_RNG_ERROR_CB_ID :\n hrng->ErrorCallback = pCallback;\n break;\n\n case HAL_RNG_MSPINIT_CB_ID :\n hrng->MspInitCallback = pCallback;\n break;\n\n case HAL_RNG_MSPDEINIT_CB_ID :\n hrng->MspDeInitCallback = pCallback;\n break;\n\n default :\n /* Update the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_INVALID_CALLBACK;\n /* Return error status */\n status = HAL_ERROR;\n break;\n }\n }\n else if (HAL_RNG_STATE_RESET == hrng->State)\n {\n switch (CallbackID)\n {\n case HAL_RNG_MSPINIT_CB_ID :\n hrng->MspInitCallback = pCallback;\n break;\n\n case HAL_RNG_MSPDEINIT_CB_ID :\n hrng->MspDeInitCallback = pCallback;\n break;\n\n default :\n /* Update the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_INVALID_CALLBACK;\n /* Return error status */\n status = HAL_ERROR;\n break;\n }\n }\n else\n {\n /* Update the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_INVALID_CALLBACK;\n /* Return error status */\n status = HAL_ERROR;\n }\n\n /* Release Lock */\n __HAL_UNLOCK(hrng);\n return status;\n}\n\n/**\n * @brief Unregister an RNG Callback\n * RNG callabck is redirected to the weak predefined callback\n * @param hrng RNG handle\n * @param CallbackID ID of the callback to be unregistered\n * This parameter can be one of the following values:\n * @arg @ref HAL_RNG_ERROR_CB_ID Error callback ID\n * @arg @ref HAL_RNG_MSPINIT_CB_ID MspInit callback ID\n * @arg @ref HAL_RNG_MSPDEINIT_CB_ID MspDeInit callback ID\n * @retval HAL status\n */\nHAL_StatusTypeDef HAL_RNG_UnRegisterCallback(RNG_HandleTypeDef *hrng, HAL_RNG_CallbackIDTypeDef CallbackID)\n{\n HAL_StatusTypeDef status = HAL_OK;\n\n /* Process locked */\n __HAL_LOCK(hrng);\n\n if (HAL_RNG_STATE_READY == hrng->State)\n {\n switch (CallbackID)\n {\n case HAL_RNG_ERROR_CB_ID :\n hrng->ErrorCallback = HAL_RNG_ErrorCallback; /* Legacy weak ErrorCallback */\n break;\n\n case HAL_RNG_MSPINIT_CB_ID :\n hrng->MspInitCallback = HAL_RNG_MspInit; /* Legacy weak MspInit */\n break;\n\n case HAL_RNG_MSPDEINIT_CB_ID :\n hrng->MspDeInitCallback = HAL_RNG_MspDeInit; /* Legacy weak MspDeInit */\n break;\n\n default :\n /* Update the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_INVALID_CALLBACK;\n /* Return error status */\n status = HAL_ERROR;\n break;\n }\n }\n else if (HAL_RNG_STATE_RESET == hrng->State)\n {\n switch (CallbackID)\n {\n case HAL_RNG_MSPINIT_CB_ID :\n hrng->MspInitCallback = HAL_RNG_MspInit; /* Legacy weak MspInit */\n break;\n\n case HAL_RNG_MSPDEINIT_CB_ID :\n hrng->MspDeInitCallback = HAL_RNG_MspDeInit; /* Legacy weak MspInit */\n break;\n\n default :\n /* Update the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_INVALID_CALLBACK;\n /* Return error status */\n status = HAL_ERROR;\n break;\n }\n }\n else\n {\n /* Update the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_INVALID_CALLBACK;\n /* Return error status */\n status = HAL_ERROR;\n }\n\n /* Release Lock */\n __HAL_UNLOCK(hrng);\n return status;\n}\n\n/**\n * @brief Register Data Ready RNG Callback\n * To be used instead of the weak HAL_RNG_ReadyDataCallback() predefined callback\n * @param hrng RNG handle\n * @param pCallback pointer to the Data Ready Callback function\n * @retval HAL status\n */\nHAL_StatusTypeDef HAL_RNG_RegisterReadyDataCallback(RNG_HandleTypeDef *hrng, pRNG_ReadyDataCallbackTypeDef pCallback)\n{\n HAL_StatusTypeDef status = HAL_OK;\n\n if (pCallback == NULL)\n {\n /* Update the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_INVALID_CALLBACK;\n return HAL_ERROR;\n }\n /* Process locked */\n __HAL_LOCK(hrng);\n\n if (HAL_RNG_STATE_READY == hrng->State)\n {\n hrng->ReadyDataCallback = pCallback;\n }\n else\n {\n /* Update the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_INVALID_CALLBACK;\n /* Return error status */\n status = HAL_ERROR;\n }\n\n /* Release Lock */\n __HAL_UNLOCK(hrng);\n return status;\n}\n\n/**\n * @brief UnRegister the Data Ready RNG Callback\n * Data Ready RNG Callback is redirected to the weak HAL_RNG_ReadyDataCallback() predefined callback\n * @param hrng RNG handle\n * @retval HAL status\n */\nHAL_StatusTypeDef HAL_RNG_UnRegisterReadyDataCallback(RNG_HandleTypeDef *hrng)\n{\n HAL_StatusTypeDef status = HAL_OK;\n\n /* Process locked */\n __HAL_LOCK(hrng);\n\n if (HAL_RNG_STATE_READY == hrng->State)\n {\n hrng->ReadyDataCallback = HAL_RNG_ReadyDataCallback; /* Legacy weak ReadyDataCallback */\n }\n else\n {\n /* Update the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_INVALID_CALLBACK;\n /* Return error status */\n status = HAL_ERROR;\n }\n\n /* Release Lock */\n __HAL_UNLOCK(hrng);\n return status;\n}\n\n#endif /* USE_HAL_RNG_REGISTER_CALLBACKS */\n\n/**\n * @}\n */\n\n/** @addtogroup RNG_Exported_Functions_Group2\n * @brief Peripheral Control functions\n *\n@verbatim\n ===============================================================================\n ##### Peripheral Control functions #####\n ===============================================================================\n [..] This section provides functions allowing to:\n (+) Get the 32 bit Random number\n (+) Get the 32 bit Random number with interrupt enabled\n (+) Handle RNG interrupt request\n\n@endverbatim\n * @{\n */\n\n/**\n * @brief Generates a 32-bit random number.\n * @note Each time the random number data is read the RNG_FLAG_DRDY flag\n * is automatically cleared.\n * @param hrng pointer to a RNG_HandleTypeDef structure that contains\n * the configuration information for RNG.\n * @param random32bit pointer to generated random number variable if successful.\n * @retval HAL status\n */\n\nHAL_StatusTypeDef HAL_RNG_GenerateRandomNumber(RNG_HandleTypeDef *hrng, uint32_t *random32bit)\n{\n uint32_t tickstart;\n HAL_StatusTypeDef status = HAL_OK;\n\n /* Process Locked */\n __HAL_LOCK(hrng);\n\n /* Check RNG peripheral state */\n if (hrng->State == HAL_RNG_STATE_READY)\n {\n /* Change RNG peripheral state */\n hrng->State = HAL_RNG_STATE_BUSY;\n\n /* Get tick */\n tickstart = HAL_GetTick();\n\n /* Check if data register contains valid random data */\n while (__HAL_RNG_GET_FLAG(hrng, RNG_FLAG_DRDY) == RESET)\n {\n if ((HAL_GetTick() - tickstart) > RNG_TIMEOUT_VALUE)\n {\n hrng->State = HAL_RNG_STATE_READY;\n hrng->ErrorCode = HAL_RNG_ERROR_TIMEOUT;\n /* Process Unlocked */\n __HAL_UNLOCK(hrng);\n return HAL_ERROR;\n }\n }\n\n /* Get a 32bit Random number */\n hrng->RandomNumber = hrng->Instance->DR;\n *random32bit = hrng->RandomNumber;\n\n hrng->State = HAL_RNG_STATE_READY;\n }\n else\n {\n hrng->ErrorCode = HAL_RNG_ERROR_BUSY;\n status = HAL_ERROR;\n }\n\n /* Process Unlocked */\n __HAL_UNLOCK(hrng);\n\n return status;\n}\n\n/**\n * @brief Generates a 32-bit random number in interrupt mode.\n * @param hrng pointer to a RNG_HandleTypeDef structure that contains\n * the configuration information for RNG.\n * @retval HAL status\n */\nHAL_StatusTypeDef HAL_RNG_GenerateRandomNumber_IT(RNG_HandleTypeDef *hrng)\n{\n HAL_StatusTypeDef status = HAL_OK;\n\n /* Process Locked */\n __HAL_LOCK(hrng);\n\n /* Check RNG peripheral state */\n if (hrng->State == HAL_RNG_STATE_READY)\n {\n /* Change RNG peripheral state */\n hrng->State = HAL_RNG_STATE_BUSY;\n\n /* Enable the RNG Interrupts: Data Ready, Clock error, Seed error */\n __HAL_RNG_ENABLE_IT(hrng);\n }\n else\n {\n /* Process Unlocked */\n __HAL_UNLOCK(hrng);\n\n hrng->ErrorCode = HAL_RNG_ERROR_BUSY;\n status = HAL_ERROR;\n }\n\n return status;\n}\n\n/**\n * @brief Returns generated random number in polling mode (Obsolete)\n * Use HAL_RNG_GenerateRandomNumber() API instead.\n * @param hrng pointer to a RNG_HandleTypeDef structure that contains\n * the configuration information for RNG.\n * @retval Random value\n */\nuint32_t HAL_RNG_GetRandomNumber(RNG_HandleTypeDef *hrng)\n{\n if(HAL_RNG_GenerateRandomNumber(hrng, &(hrng->RandomNumber)) == HAL_OK)\n {\n return hrng->RandomNumber;\n }\n else\n {\n return 0U;\n }\n}\n\n/**\n * @brief Returns a 32-bit random number with interrupt enabled (Obsolete),\n * Use HAL_RNG_GenerateRandomNumber_IT() API instead.\n * @param hrng pointer to a RNG_HandleTypeDef structure that contains\n * the configuration information for RNG.\n * @retval 32-bit random number\n */\nuint32_t HAL_RNG_GetRandomNumber_IT(RNG_HandleTypeDef *hrng)\n{\n uint32_t random32bit = 0U;\n\n /* Process locked */\n __HAL_LOCK(hrng);\n\n /* Change RNG peripheral state */\n hrng->State = HAL_RNG_STATE_BUSY;\n\n /* Get a 32bit Random number */\n random32bit = hrng->Instance->DR;\n\n /* Enable the RNG Interrupts: Data Ready, Clock error, Seed error */\n __HAL_RNG_ENABLE_IT(hrng);\n\n /* Return the 32 bit random number */\n return random32bit;\n}\n\n/**\n * @brief Handles RNG interrupt request.\n * @note In the case of a clock error, the RNG is no more able to generate\n * random numbers because the PLL48CLK clock is not correct. User has\n * to check that the clock controller is correctly configured to provide\n * the RNG clock and clear the CEIS bit using __HAL_RNG_CLEAR_IT().\n * The clock error has no impact on the previously generated\n * random numbers, and the RNG_DR register contents can be used.\n * @note In the case of a seed error, the generation of random numbers is\n * interrupted as long as the SECS bit is '1'. If a number is\n * available in the RNG_DR register, it must not be used because it may\n * not have enough entropy. In this case, it is recommended to clear the\n * SEIS bit using __HAL_RNG_CLEAR_IT(), then disable and enable\n * the RNG peripheral to reinitialize and restart the RNG.\n * @note User-written HAL_RNG_ErrorCallback() API is called once whether SEIS\n * or CEIS are set.\n * @param hrng pointer to a RNG_HandleTypeDef structure that contains\n * the configuration information for RNG.\n * @retval None\n\n */\nvoid HAL_RNG_IRQHandler(RNG_HandleTypeDef *hrng)\n{\n uint32_t rngclockerror = 0U;\n\n /* RNG clock error interrupt occurred */\n if (__HAL_RNG_GET_IT(hrng, RNG_IT_CEI) != RESET)\n {\n /* Update the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_SEED;\n rngclockerror = 1U;\n }\n else if (__HAL_RNG_GET_IT(hrng, RNG_IT_SEI) != RESET)\n {\n /* Update the error code */\n hrng->ErrorCode = HAL_RNG_ERROR_CLOCK;\n rngclockerror = 1U;\n }\n else\n {\n /* Nothing to do */\n }\n\n if (rngclockerror == 1U)\n {\n /* Change RNG peripheral state */\n hrng->State = HAL_RNG_STATE_ERROR;\n\n#if (USE_HAL_RNG_REGISTER_CALLBACKS == 1)\n /* Call registered Error callback */\n hrng->ErrorCallback(hrng);\n#else\n /* Call legacy weak Error callback */\n HAL_RNG_ErrorCallback(hrng);\n#endif /* USE_HAL_RNG_REGISTER_CALLBACKS */\n\n /* Clear the clock error flag */\n __HAL_RNG_CLEAR_IT(hrng, RNG_IT_CEI | RNG_IT_SEI);\n }\n\n /* Check RNG data ready interrupt occurred */\n if (__HAL_RNG_GET_IT(hrng, RNG_IT_DRDY) != RESET)\n {\n /* Generate random number once, so disable the IT */\n __HAL_RNG_DISABLE_IT(hrng);\n\n /* Get the 32bit Random number (DRDY flag automatically cleared) */\n hrng->RandomNumber = hrng->Instance->DR;\n\n if (hrng->State != HAL_RNG_STATE_ERROR)\n {\n /* Change RNG peripheral state */\n hrng->State = HAL_RNG_STATE_READY;\n /* Process Unlocked */\n __HAL_UNLOCK(hrng);\n\n#if (USE_HAL_RNG_REGISTER_CALLBACKS == 1)\n /* Call registered Data Ready callback */\n hrng->ReadyDataCallback(hrng, hrng->RandomNumber);\n#else\n /* Call legacy weak Data Ready callback */\n HAL_RNG_ReadyDataCallback(hrng, hrng->RandomNumber);\n#endif /* USE_HAL_RNG_REGISTER_CALLBACKS */\n }\n }\n}\n\n/**\n * @brief Read latest generated random number.\n * @param hrng pointer to a RNG_HandleTypeDef structure that contains\n * the configuration information for RNG.\n * @retval random value\n */\nuint32_t HAL_RNG_ReadLastRandomNumber(RNG_HandleTypeDef *hrng)\n{\n return (hrng->RandomNumber);\n}\n\n/**\n * @brief Data Ready callback in non-blocking mode.\n * @param hrng pointer to a RNG_HandleTypeDef structure that contains\n * the configuration information for RNG.\n * @param random32bit generated random number.\n * @retval None\n */\n__weak void HAL_RNG_ReadyDataCallback(RNG_HandleTypeDef *hrng, uint32_t random32bit)\n{\n /* Prevent unused argument(s) compilation warning */\n UNUSED(hrng);\n UNUSED(random32bit);\n /* NOTE : This function should not be modified. When the callback is needed,\n function HAL_RNG_ReadyDataCallback must be implemented in the user file.\n */\n}\n\n/**\n * @brief RNG error callbacks.\n * @param hrng pointer to a RNG_HandleTypeDef structure that contains\n * the configuration information for RNG.\n * @retval None\n */\n__weak void HAL_RNG_ErrorCallback(RNG_HandleTypeDef *hrng)\n{\n /* Prevent unused argument(s) compilation warning */\n UNUSED(hrng);\n /* NOTE : This function should not be modified. When the callback is needed,\n function HAL_RNG_ErrorCallback must be implemented in the user file.\n */\n}\n/**\n * @}\n */\n\n\n/** @addtogroup RNG_Exported_Functions_Group3\n * @brief Peripheral State functions\n *\n@verbatim\n ===============================================================================\n ##### Peripheral State functions #####\n ===============================================================================\n [..]\n This subsection permits to get in run-time the status of the peripheral\n and the data flow.\n\n@endverbatim\n * @{\n */\n\n/**\n * @brief Returns the RNG state.\n * @param hrng pointer to a RNG_HandleTypeDef structure that contains\n * the configuration information for RNG.\n * @retval HAL state\n */\nHAL_RNG_StateTypeDef HAL_RNG_GetState(RNG_HandleTypeDef *hrng)\n{\n return hrng->State;\n}\n\n/**\n * @brief Return the RNG handle error code.\n * @param hrng: pointer to a RNG_HandleTypeDef structure.\n * @retval RNG Error Code\n*/\nuint32_t HAL_RNG_GetError(RNG_HandleTypeDef *hrng)\n{\n /* Return RNG Error Code */\n return hrng->ErrorCode;\n}\n/**\n * @}\n */\n\n/**\n * @}\n */\n\n\n#endif /* HAL_RNG_MODULE_ENABLED */\n/**\n * @}\n */\n\n#endif /* RNG */\n\n/**\n * @}\n */\n\n/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\n"} +{"text": "19400:\n19401:\n19402:\n19403:\n19404:\n19405:\n19406:\n19407:\n19408:\n19409:\n1940A:\n1940B:\n1940C:\n1940D:\n1940E:\n1940F:\n19410:\n19411:\n19412:\n19413:\n19414:\n19415:\n19416:\n19417:\n19418:\n19419:\n1941A:\n1941B:\n1941C:\n1941D:\n1941E:\n1941F:\n19420:\n19421:\n19422:\n19423:\n19424:\n19425:\n19426:\n19427:\n19428:\n19429:\n1942A:\n1942B:\n1942C:\n1942D:\n1942E:\n1942F:\n19430:\n19431:\n19432:\n19433:\n19434:\n19435:\n19436:\n19437:\n19438:\n19439:\n1943A:\n1943B:\n1943C:\n1943D:\n1943E:\n1943F:\n19440:\n19441:\n19442:\n19443:\n19444:\n19445:\n19446:\n19447:\n19448:\n19449:\n1944A:\n1944B:\n1944C:\n1944D:\n1944E:\n1944F:\n19450:\n19451:\n19452:\n19453:\n19454:\n19455:\n19456:\n19457:\n19458:\n19459:\n1945A:\n1945B:\n1945C:\n1945D:\n1945E:\n1945F:\n19460:\n19461:\n19462:\n19463:\n19464:\n19465:\n19466:\n19467:\n19468:\n19469:\n1946A:\n1946B:\n1946C:\n1946D:\n1946E:\n1946F:\n19470:\n19471:\n19472:\n19473:\n19474:\n19475:\n19476:\n19477:\n19478:\n19479:\n1947A:\n1947B:\n1947C:\n1947D:\n1947E:\n1947F:\n19480:\n19481:\n19482:\n19483:\n19484:\n19485:\n19486:\n19487:\n19488:\n19489:\n1948A:\n1948B:\n1948C:\n1948D:\n1948E:\n1948F:\n19490:\n19491:\n19492:\n19493:\n19494:\n19495:\n19496:\n19497:\n19498:\n19499:\n1949A:\n1949B:\n1949C:\n1949D:\n1949E:\n1949F:\n194A0:\n194A1:\n194A2:\n194A3:\n194A4:\n194A5:\n194A6:\n194A7:\n194A8:\n194A9:\n194AA:\n194AB:\n194AC:\n194AD:\n194AE:\n194AF:\n194B0:\n194B1:\n194B2:\n194B3:\n194B4:\n194B5:\n194B6:\n194B7:\n194B8:\n194B9:\n194BA:\n194BB:\n194BC:\n194BD:\n194BE:\n194BF:\n194C0:\n194C1:\n194C2:\n194C3:\n194C4:\n194C5:\n194C6:\n194C7:\n194C8:\n194C9:\n194CA:\n194CB:\n194CC:\n194CD:\n194CE:\n194CF:\n194D0:\n194D1:\n194D2:\n194D3:\n194D4:\n194D5:\n194D6:\n194D7:\n194D8:\n194D9:\n194DA:\n194DB:\n194DC:\n194DD:\n194DE:\n194DF:\n194E0:\n194E1:\n194E2:\n194E3:\n194E4:\n194E5:\n194E6:\n194E7:\n194E8:\n194E9:\n194EA:\n194EB:\n194EC:\n194ED:\n194EE:\n194EF:\n194F0:\n194F1:\n194F2:\n194F3:\n194F4:\n194F5:\n194F6:\n194F7:\n194F8:\n194F9:\n194FA:\n194FB:\n194FC:\n194FD:\n194FE:\n194FF:\n"} +{"text": "libtraceevent(3)\n================\n\nNAME\n----\ntep_filter_alloc, tep_filter_free, tep_filter_reset, tep_filter_make_string,\ntep_filter_copy, tep_filter_compare, tep_filter_match, tep_event_filtered,\ntep_filter_remove_event, tep_filter_strerror, tep_filter_add_filter_str -\nEvent filter related APIs.\n\nSYNOPSIS\n--------\n[verse]\n--\n*#include *\n\nstruct tep_event_filter pass:[*]*tep_filter_alloc*(struct tep_handle pass:[*]_tep_);\nvoid *tep_filter_free*(struct tep_event_filter pass:[*]_filter_);\nvoid *tep_filter_reset*(struct tep_event_filter pass:[*]_filter_);\nenum tep_errno *tep_filter_add_filter_str*(struct tep_event_filter pass:[*]_filter_, const char pass:[*]_filter_str_);\nint *tep_event_filtered*(struct tep_event_filter pass:[*]_filter_, int _event_id_);\nint *tep_filter_remove_event*(struct tep_event_filter pass:[*]_filter_, int _event_id_);\nenum tep_errno *tep_filter_match*(struct tep_event_filter pass:[*]_filter_, struct tep_record pass:[*]_record_);\nint *tep_filter_copy*(struct tep_event_filter pass:[*]_dest_, struct tep_event_filter pass:[*]_source_);\nint *tep_filter_compare*(struct tep_event_filter pass:[*]_filter1_, struct tep_event_filter pass:[*]_filter2_);\nchar pass:[*]*tep_filter_make_string*(struct tep_event_filter pass:[*]_filter_, int _event_id_);\nint *tep_filter_strerror*(struct tep_event_filter pass:[*]_filter_, enum tep_errno _err_, char pass:[*]buf, size_t _buflen_);\n--\n\nDESCRIPTION\n-----------\nFilters can be attached to traced events. They can be used to filter out various\nevents when outputting them. Each event can be filtered based on its parameters,\ndescribed in the event's format file. This set of functions can be used to\ncreate, delete, modify and attach event filters.\n\nThe _tep_filter_alloc()_ function creates a new event filter. The _tep_ argument\nis the trace event parser context.\n\nThe _tep_filter_free()_ function frees an event filter and all resources that it\nhad used.\n\nThe _tep_filter_reset()_ function removes all rules from an event filter and\nresets it.\n\nThe _tep_filter_add_filter_str()_ function adds a new rule to the _filter_. The\n_filter_str_ argument is the filter string, that contains the rule.\n\nThe _tep_event_filtered()_ function checks if the event with _event_id_ has\n_filter_.\n\nThe _tep_filter_remove_event()_ function removes a _filter_ for an event with\n_event_id_.\n\nThe _tep_filter_match()_ function tests if a _record_ matches given _filter_.\n\nThe _tep_filter_copy()_ function copies a _source_ filter into a _dest_ filter.\n\nThe _tep_filter_compare()_ function compares two filers - _filter1_ and _filter2_.\n\nThe _tep_filter_make_string()_ function constructs a string, displaying\nthe _filter_ contents for given _event_id_.\n\nThe _tep_filter_strerror()_ function copies the _filter_ error buffer into the\ngiven _buf_ with the size _buflen_. If the error buffer is empty, in the _buf_\nis copied a string, describing the error _err_.\n\nRETURN VALUE\n------------\nThe _tep_filter_alloc()_ function returns a pointer to the newly created event\nfilter, or NULL in case of an error.\n\nThe _tep_filter_add_filter_str()_ function returns 0 if the rule was\nsuccessfully added or a negative error code. Use _tep_filter_strerror()_ to see\nactual error message in case of an error.\n\nThe _tep_event_filtered()_ function returns 1 if the filter is found for given\nevent, or 0 otherwise.\n\nThe _tep_filter_remove_event()_ function returns 1 if the vent was removed, or\n0 if the event was not found.\n\nThe _tep_filter_match()_ function returns _tep_errno_, according to the result:\n[verse]\n--\n_pass:[TEP_ERRNO__FILTER_MATCH]_\t- filter found for event, the record matches.\n_pass:[TEP_ERRNO__FILTER_MISS]_\t\t- filter found for event, the record does not match.\n_pass:[TEP_ERRNO__FILTER_NOT_FOUND]_\t- no filter found for record's event.\n_pass:[TEP_ERRNO__NO_FILTER]_\t\t- no rules in the filter.\n--\nor any other _tep_errno_, if an error occurred during the test.\n\nThe _tep_filter_copy()_ function returns 0 on success or -1 if not all rules\n were copied.\n\nThe _tep_filter_compare()_ function returns 1 if the two filters hold the same\ncontent, or 0 if they do not.\n\nThe _tep_filter_make_string()_ function returns a string, which must be freed\nwith free(), or NULL in case of an error.\n\nThe _tep_filter_strerror()_ function returns 0 if message was filled\nsuccessfully, or -1 in case of an error.\n\nEXAMPLE\n-------\n[source,c]\n--\n#include \n...\nstruct tep_handle *tep = tep_alloc();\n...\nchar errstr[200];\nint ret;\n\nstruct tep_event_filter *filter = tep_filter_alloc(tep);\nstruct tep_event_filter *filter1 = tep_filter_alloc(tep);\nret = tep_filter_add_filter_str(filter, \"sched/sched_wakeup:target_cpu==1\");\nif(ret < 0) {\n\ttep_filter_strerror(filter, ret, errstr, sizeof(errstr));\n\t/* Failed to add a new rule to the filter, the error string is in errstr */\n}\nif (tep_filter_copy(filter1, filter) != 0) {\n\t/* Failed to copy filter in filter1 */\n}\n...\nif (tep_filter_compare(filter, filter1) != 1) {\n\t/* Both filters are different */\n}\n...\nvoid process_record(struct tep_handle *tep, struct tep_record *record)\n{\n\tstruct tep_event *event;\n\tchar *fstring;\n\n\tevent = tep_find_event_by_record(tep, record);\n\n\tif (tep_event_filtered(filter, event->id) == 1) {\n\t\t/* The event has filter */\n\t\tfstring = tep_filter_make_string(filter, event->id);\n\t\tif (fstring != NULL) {\n\t\t\t/* The filter for the event is in fstring */\n\t\t\tfree(fstring);\n\t\t}\n\t}\n\n\tswitch (tep_filter_match(filter, record)) {\n\tcase TEP_ERRNO__FILTER_MATCH:\n\t\t/* The filter matches the record */\n\t\tbreak;\n\tcase TEP_ERRNO__FILTER_MISS:\n\t\t/* The filter does not match the record */\n\t\tbreak;\n\tcase TEP_ERRNO__FILTER_NOT_FOUND:\n\t\t/* No filter found for record's event */\n\t\tbreak;\n\tcase TEP_ERRNO__NO_FILTER:\n\t\t/* There are no rules in the filter */\n\t\tbreak\n\tdefault:\n\t\t/* An error occurred during the test */\n\t\tbreak;\n\t}\n\n\tif (tep_filter_remove_event(filter, event->id) == 1) {\n\t\t/* The event was removed from the filter */\n\t}\n}\n\n...\ntep_filter_reset(filter);\n...\ntep_filter_free(filter);\ntep_filter_free(filter1);\n...\n--\n\nFILES\n-----\n[verse]\n--\n*event-parse.h*\n\tHeader file to include in order to have access to the library APIs.\n*-ltraceevent*\n\tLinker switch to add when building a program that uses the library.\n--\n\nSEE ALSO\n--------\n_libtraceevent(3)_, _trace-cmd(1)_\n\nAUTHOR\n------\n[verse]\n--\n*Steven Rostedt* , author of *libtraceevent*.\n*Tzvetomir Stoyanov* , author of this man page.\n--\nREPORTING BUGS\n--------------\nReport bugs to \n\nLICENSE\n-------\nlibtraceevent is Free Software licensed under the GNU LGPL 2.1\n\nRESOURCES\n---------\nhttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\n"} +{"text": "\r\n\r\n 4.0.0\r\n\r\n WS-Attacker-Libraries\r\n wsattacker.library\r\n wsattacker-libraries\r\n pom\r\n\r\n \r\n wsattacker.basis\r\n wsattacker-basis\r\n 1.9-SNAPSHOT\r\n \r\n\r\n \r\n XML_Utilities\r\n Schema_Analyzer_Library\r\n Signature_Wrapping_Library\r\n Signature_Faking_Library\r\n Intelligent_Denial_of_Service_Library\r\n XML_Encryption_Attack_Library\r\n SoapHttpClient\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n org.apache.maven.plugins\r\n maven-jar-plugin\r\n \r\n ${highest-basedir}/runnable/lib/\r\n \r\n \r\n \r\n \r\n org.apache.maven.plugins\r\n maven-dependency-plugin\r\n \r\n \r\n copy-dependencies\r\n prepare-package\r\n \r\n copy-dependencies\r\n \r\n \r\n ${highest-basedir}/runnable/lib\r\n false\r\n false\r\n true\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n"} +{"text": "package com.example.android_test\n\nimport android.app.Activity\nimport android.os.Bundle\nimport org.jetbrains.anko.linearLayout\nimport org.jetbrains.anko.vibrator\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.robolectric.Robolectric\nimport org.robolectric.RobolectricTestRunner\nimport org.robolectric.annotation.Config\n\nopen class ServiceTestActivity : Activity() {\n public override fun onCreate(savedInstanceState: Bundle?): Unit {\n super.onCreate(savedInstanceState)\n linearLayout {}\n }\n}\n\n@RunWith(RobolectricTestRunner::class)\n@Config(constants = BuildConfig::class) class ServiceTest {\n\n @Test fun test() {\n val activity = Robolectric.buildActivity(ServiceTestActivity::class.java).create().get()\n\n val vibrator = activity.vibrator\n vibrator.vibrate(100)\n\n println(\"[COMPLETE]\")\n }\n\n}\n"} +{"text": "// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpbcgr;\nusing Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpeudp;\nusing System.Security.Cryptography.X509Certificates;\n\nnamespace Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpemt\n{\n public class RdpemtServer : RdpemtTransport\n {\n\n #region Constructor\n\n /// \n /// Constructor\n /// \n /// secure channel\n /// Whether it is an auto handle connection\n public RdpemtServer(ISecureChannel secChannel, bool autoHandle = true)\n :base(secChannel, autoHandle)\n {\n }\n\n /// \n /// Constructor\n /// \n /// \n /// \n /// \n public RdpemtServer(RdpeudpSocket socket, X509Certificate2 cert, bool autoHandle = true)\n :base(autoHandle)\n {\n if (!socket.AutoHandle)\n {\n throw new NotSupportedException(\"To Create RDPEMT Server, RDPEUDP Socket must be auto handle.\");\n }\n\n if (socket.TransMode == TransportMode.Reliable)\n {\n RdpeudpTLSChannel secChannel = new RdpeudpTLSChannel(socket);\n secChannel.Received += ReceiveBytes;\n secChannel.AuthenticateAsServer(cert);\n this.secureChannel = secChannel;\n }\n else\n {\n RdpeudpDTLSChannel secChannel = new RdpeudpDTLSChannel(socket);\n secChannel.Received += ReceiveBytes;\n secChannel.AuthenticateAsServer(cert);\n this.secureChannel = secChannel;\n }\n\n }\n\n #endregion Constructor\n\n #region Public Methods\n\n /// \n /// Expect a connection request from client.\n /// \n /// Timeout.\n /// The requestID should be set in Tunnel Create Request.\n /// The SecurityCookie should be set in Tunnel Create Request.\n public bool ExpectConnect(TimeSpan timeout, out uint requestId, out byte[] securityCooke)\n {\n // Expect a Tunnel Create Request.\n RDP_TUNNEL_CREATEREQUEST createReq = this.ExpectTunnelCreateRequest(timeout);\n if (createReq == null)\n {\n requestId = 0;\n securityCooke = null;\n return false;\n }\n requestId = createReq.RequestID;\n securityCooke = createReq.SecurityCookie;\n\n // Respond a Tunnel Create Response. \n RDP_TUNNEL_CREATERESPONSE createRes = this.CreateTunnelCreateResponse(HrResponse_S_OK);\n this.SendRdpemtPacket(createRes);\n connected = true;\n\n return true;\n }\n\n /// \n /// Create a RDP_TUNNEL_CREATERESPONSE pdu\n /// \n /// \n /// \n public RDP_TUNNEL_CREATERESPONSE CreateTunnelCreateResponse(uint hrRes)\n {\n RDP_TUNNEL_CREATERESPONSE createRes = new RDP_TUNNEL_CREATERESPONSE();\n createRes.TunnelHeader = new RDP_TUNNEL_HEADER();\n createRes.TunnelHeader.Action = RDP_TUNNEL_ACTION_Values.RDPTUNNEL_ACTION_CREATERESPONSE;\n createRes.TunnelHeader.Flags = 0;\n createRes.TunnelHeader.PayloadLength = 4;\n createRes.TunnelHeader.HeaderLength = 4;\n createRes.TunnelHeader.SubHeaders = null;\n createRes.HrResponse = hrRes;\n return createRes;\n }\n\n /// \n /// Expect to receive a RDP_TUNNEL_CREATEREQUEST\n /// \n /// \n /// \n public RDP_TUNNEL_CREATEREQUEST ExpectTunnelCreateRequest(TimeSpan timeout)\n {\n if (Connected)\n {\n return null;\n }\n\n DateTime endTime = DateTime.Now + timeout;\n RDP_TUNNEL_CREATEREQUEST createReq = null;\n while (DateTime.Now < endTime)\n {\n if (receiveBuffer.Count > 0)\n {\n lock (receiveBuffer)\n {\n if (receiveBuffer.Count > 0)\n {\n for (int i = 0; i < receiveBuffer.Count; i++)\n {\n if (receiveBuffer[i] is RDP_TUNNEL_CREATEREQUEST)\n {\n createReq = receiveBuffer[i] as RDP_TUNNEL_CREATEREQUEST;\n receiveBuffer.RemoveAt(i);\n return createReq;\n }\n }\n }\n }\n }\n Thread.Sleep(waitInterval);\n }\n\n return null;\n }\n \n /// \n /// Process Auto Detect feature\n /// \n /// \n public override void ProcessSubHeaders(RdpemtBasePDU pdu)\n {\n RDP_TUNNEL_SUBHEADER[] RDPTunnelSubHeaders = pdu.TunnelHeader.SubHeaders;\n if (RDPTunnelSubHeaders != null)\n {\n foreach (RDP_TUNNEL_SUBHEADER RDPTunnelSubHeader in RDPTunnelSubHeaders)\n {\n if (RDPTunnelSubHeader.SubHeaderType == RDP_TUNNEL_SUBHEADER_TYPE_Values.TYPE_ID_AUTODETECT_RESPONSE)\n {\n uint responseType = (uint)(RDPTunnelSubHeader.SubHeaderData[3] << 8) + RDPTunnelSubHeader.SubHeaderData[2];\n if (responseType == (uint)AUTO_DETECT_RESPONSE_TYPE.RDP_BW_RESULTS_AFTER_CONNECT)\n {\n RDP_BW_RESULTS bwRes = RdpemtUtility.ParseRdpBWResults(RDPTunnelSubHeader.SubHeaderData);\n this.bandwidth = (bwRes.byteCount * 8) / bwRes.timeDelta;\n }\n }\n }\n }\n \n }\n\n #endregion Public Methods\n }\n}\n"} +{"text": "#!/bin/bash\n\nif [ \"$#\" -lt 2 ]; then\n echo\n echo \"Create a detached screen for a BDS script and redirect stdout/stderr to a log file.\"\n echo \"If you skip [LOG_FILE_NAME], a log file [SCR_NAME].log will be generated on the working directory.\"\n echo \"If a log file already exists, stdout/stderr will be appended to it.\"\n echo \"Monitor a log file with 'tail -f [LOG_FILE_NAME]'\"\n echo\n echo \"Usage: bds_scr [SCR_NAME] [LOG_FILE_NAME] [BDS_PARAM]\"\n echo \" Example: bds_scr TEST ~/TEST.log -s sge chipseq.bds -fastq1 ...\"\n echo\n exit 0\nfi\n\nSCR_NAME=\"$1\".BDS\n\n#if [ $(screen -ls $SCR_NAME | grep 'No Sockets' | wc -l) != \"1\" ]; then\nif [ $(screen -ls | grep -P \"[\\t ]\\d+.$SCR_NAME\" | wc -l) != \"0\" ]; then\n echo \"error: A screen named $SCR_NAME already exists.\"\n exit 1\nelse\n echo \"[SCR_NAME] : $SCR_NAME\"\nfi\n\nif [[ $2 == -* || $2 == *.bds ]]; then # LOG_FILE_NAME skipped\n LOG_FILE_NAME=\"$PWD/$SCR_NAME.log\"\n PARAM_START_IDX=2\nelif [[ $3 == -* || $3 == *.bds ]]; then\n LOG_FILE_NAME=$2\n PARAM_START_IDX=3\nelse\n echo \"error: [BDS_PARAM] is wrong.\"\n exit 1\nfi\n\nPARAM=\n\nif [ $(find $LOG_FILE_NAME -mmin -2 2> /dev/null | wc -l) != \"0\" ]; then\n echo \"error: log file handle is open or very fresh (modified in past 2 minutes).\"\n exit 3\nfi\n\nfor ((i=$PARAM_START_IDX;i<=$#;i++)); do\n PARAM=\"$PARAM ${!i}\"\ndone\n\necho \"[HOST] : $(hostname -f)\"\necho \"[LOG_FILE_NAME] : $LOG_FILE_NAME\"\necho \"[BDS_PARAM] : $PARAM\"\n\nmkdir -p $(dirname $LOG_FILE_NAME)\n\necho \"\"\necho \"===== Created a new screen ====\" >> $LOG_FILE_NAME\necho \"[DATE] : $(date)\" >> $LOG_FILE_NAME\necho \"[HOST] : $(hostname -f)\" >> $LOG_FILE_NAME\necho \"[SCR_NAME] : $SCR_NAME\" >> $LOG_FILE_NAME\necho \"[BDS_PARAM] : $PARAM\" >> $LOG_FILE_NAME\necho \"\" >> $LOG_FILE_NAME\n\nscreen -Sdm $SCR_NAME bash -c \"bds &>>$LOG_FILE_NAME $PARAM $>>$LOG_FILE_NAME\"\n\n"} +{"text": "using NHapi.Base.Parser;\r\nusing NHapi.Base;\r\nusing NHapi.Base.Log;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing NHapi.Model.V24.Segment;\r\nusing NHapi.Model.V24.Datatype;\r\nusing NHapi.Base.Model;\r\n\r\nnamespace NHapi.Model.V24.Group\n{\r\n///\r\n///Represents the ORD_O04_RESPONSE Group. A Group is an ordered collection of message \r\n/// segments that can repeat together or be optionally in/excluded together.\r\n/// This Group contains the following elements: \r\n///
    \r\n///
  1. 0: ORD_O04_PATIENT (a Group object) optional
  2. \r\n///
  3. 1: ORD_O04_ORDER_DIET (a Group object) repeating
  4. \r\n///
  5. 2: ORD_O04_ORDER_TRAY (a Group object) optional repeating
  6. \r\n///
\r\n///
\r\n[Serializable]\r\npublic class ORD_O04_RESPONSE : AbstractGroup {\r\n\r\n\t/// \r\n\t/// Creates a new ORD_O04_RESPONSE Group.\r\n\t///\r\n\tpublic ORD_O04_RESPONSE(IGroup parent, IModelClassFactory factory) : base(parent, factory){\r\n\t try {\r\n\t this.add(typeof(ORD_O04_PATIENT), false, false);\r\n\t this.add(typeof(ORD_O04_ORDER_DIET), true, true);\r\n\t this.add(typeof(ORD_O04_ORDER_TRAY), false, true);\r\n\t } catch(HL7Exception e) {\r\n\t HapiLogFactory.GetHapiLog(GetType()).Error(\"Unexpected error creating ORD_O04_RESPONSE - this is probably a bug in the source code generator.\", e);\r\n\t }\r\n\t}\r\n\r\n\t///\r\n\t/// Returns ORD_O04_PATIENT (a Group object) - creates it if necessary\r\n\t///\r\n\tpublic ORD_O04_PATIENT PATIENT { \r\nget{\r\n\t ORD_O04_PATIENT ret = null;\r\n\t try {\r\n\t ret = (ORD_O04_PATIENT)this.GetStructure(\"PATIENT\");\r\n\t } catch(HL7Exception e) {\r\n\t HapiLogFactory.GetHapiLog(GetType()).Error(\"Unexpected error accessing data - this is probably a bug in the source code generator.\", e);\r\n\t throw new System.Exception(\"An unexpected error ocurred\",e);\r\n\t }\r\n\t return ret;\r\n\t}\r\n\t}\r\n\r\n\t///\r\n\t/// Returns first repetition of ORD_O04_ORDER_DIET (a Group object) - creates it if necessary\r\n\t///\r\n\tpublic ORD_O04_ORDER_DIET GetORDER_DIET() {\r\n\t ORD_O04_ORDER_DIET ret = null;\r\n\t try {\r\n\t ret = (ORD_O04_ORDER_DIET)this.GetStructure(\"ORDER_DIET\");\r\n\t } catch(HL7Exception e) {\r\n\t HapiLogFactory.GetHapiLog(GetType()).Error(\"Unexpected error accessing data - this is probably a bug in the source code generator.\", e);\r\n\t throw new System.Exception(\"An unexpected error ocurred\",e);\r\n\t }\r\n\t return ret;\r\n\t}\r\n\r\n\t///\r\n\t///Returns a specific repetition of ORD_O04_ORDER_DIET\r\n\t/// * (a Group object) - creates it if necessary\r\n\t/// throws HL7Exception if the repetition requested is more than one \r\n\t/// greater than the number of existing repetitions.\r\n\t///\r\n\tpublic ORD_O04_ORDER_DIET GetORDER_DIET(int rep) { \r\n\t return (ORD_O04_ORDER_DIET)this.GetStructure(\"ORDER_DIET\", rep);\r\n\t}\r\n\r\n\t/** \r\n\t * Returns the number of existing repetitions of ORD_O04_ORDER_DIET \r\n\t */ \r\n\tpublic int ORDER_DIETRepetitionsUsed { \r\nget{\r\n\t int reps = -1; \r\n\t try { \r\n\t reps = this.GetAll(\"ORDER_DIET\").Length; \r\n\t } catch (HL7Exception e) { \r\n\t string message = \"Unexpected error accessing data - this is probably a bug in the source code generator.\"; \r\n\t HapiLogFactory.GetHapiLog(GetType()).Error(message, e); \r\n\t throw new System.Exception(message);\r\n\t } \r\n\t return reps; \r\n\t}\r\n\t} \r\n\r\n\t/** \r\n\t * Enumerate over the ORD_O04_ORDER_DIET results \r\n\t */ \r\n\tpublic IEnumerable ORDER_DIETs \r\n\t{ \r\n\t\tget\r\n\t\t{\r\n\t\t\tfor (int rep = 0; rep < ORDER_DIETRepetitionsUsed; rep++)\r\n\t\t\t{\r\n\t\t\t\tyield return (ORD_O04_ORDER_DIET)this.GetStructure(\"ORDER_DIET\", rep);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t///\r\n\t///Adds a new ORD_O04_ORDER_DIET\r\n\t///\r\n\tpublic ORD_O04_ORDER_DIET AddORDER_DIET()\r\n\t{\r\n\t\treturn this.AddStructure(\"ORDER_DIET\") as ORD_O04_ORDER_DIET;\r\n\t}\r\n\r\n\t///\r\n\t///Removes the given ORD_O04_ORDER_DIET\r\n\t///\r\n\tpublic void RemoveORDER_DIET(ORD_O04_ORDER_DIET toRemove)\r\n\t{\r\n\t\tthis.RemoveStructure(\"ORDER_DIET\", toRemove);\r\n\t}\r\n\r\n\t///\r\n\t///Removes the ORD_O04_ORDER_DIET at the given index\r\n\t///\r\n\tpublic void RemoveORDER_DIETAt(int index)\r\n\t{\r\n\t\tthis.RemoveRepetition(\"ORDER_DIET\", index);\r\n\t}\r\n\r\n\t///\r\n\t/// Returns first repetition of ORD_O04_ORDER_TRAY (a Group object) - creates it if necessary\r\n\t///\r\n\tpublic ORD_O04_ORDER_TRAY GetORDER_TRAY() {\r\n\t ORD_O04_ORDER_TRAY ret = null;\r\n\t try {\r\n\t ret = (ORD_O04_ORDER_TRAY)this.GetStructure(\"ORDER_TRAY\");\r\n\t } catch(HL7Exception e) {\r\n\t HapiLogFactory.GetHapiLog(GetType()).Error(\"Unexpected error accessing data - this is probably a bug in the source code generator.\", e);\r\n\t throw new System.Exception(\"An unexpected error ocurred\",e);\r\n\t }\r\n\t return ret;\r\n\t}\r\n\r\n\t///\r\n\t///Returns a specific repetition of ORD_O04_ORDER_TRAY\r\n\t/// * (a Group object) - creates it if necessary\r\n\t/// throws HL7Exception if the repetition requested is more than one \r\n\t/// greater than the number of existing repetitions.\r\n\t///\r\n\tpublic ORD_O04_ORDER_TRAY GetORDER_TRAY(int rep) { \r\n\t return (ORD_O04_ORDER_TRAY)this.GetStructure(\"ORDER_TRAY\", rep);\r\n\t}\r\n\r\n\t/** \r\n\t * Returns the number of existing repetitions of ORD_O04_ORDER_TRAY \r\n\t */ \r\n\tpublic int ORDER_TRAYRepetitionsUsed { \r\nget{\r\n\t int reps = -1; \r\n\t try { \r\n\t reps = this.GetAll(\"ORDER_TRAY\").Length; \r\n\t } catch (HL7Exception e) { \r\n\t string message = \"Unexpected error accessing data - this is probably a bug in the source code generator.\"; \r\n\t HapiLogFactory.GetHapiLog(GetType()).Error(message, e); \r\n\t throw new System.Exception(message);\r\n\t } \r\n\t return reps; \r\n\t}\r\n\t} \r\n\r\n\t/** \r\n\t * Enumerate over the ORD_O04_ORDER_TRAY results \r\n\t */ \r\n\tpublic IEnumerable ORDER_TRAYs \r\n\t{ \r\n\t\tget\r\n\t\t{\r\n\t\t\tfor (int rep = 0; rep < ORDER_TRAYRepetitionsUsed; rep++)\r\n\t\t\t{\r\n\t\t\t\tyield return (ORD_O04_ORDER_TRAY)this.GetStructure(\"ORDER_TRAY\", rep);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t///\r\n\t///Adds a new ORD_O04_ORDER_TRAY\r\n\t///\r\n\tpublic ORD_O04_ORDER_TRAY AddORDER_TRAY()\r\n\t{\r\n\t\treturn this.AddStructure(\"ORDER_TRAY\") as ORD_O04_ORDER_TRAY;\r\n\t}\r\n\r\n\t///\r\n\t///Removes the given ORD_O04_ORDER_TRAY\r\n\t///\r\n\tpublic void RemoveORDER_TRAY(ORD_O04_ORDER_TRAY toRemove)\r\n\t{\r\n\t\tthis.RemoveStructure(\"ORDER_TRAY\", toRemove);\r\n\t}\r\n\r\n\t///\r\n\t///Removes the ORD_O04_ORDER_TRAY at the given index\r\n\t///\r\n\tpublic void RemoveORDER_TRAYAt(int index)\r\n\t{\r\n\t\tthis.RemoveRepetition(\"ORDER_TRAY\", index);\r\n\t}\r\n\r\n}\r\n}\r\n"} +{"text": "//\n// DDRecordingView.h\n// IOSDuoduo\n//\n// Created by 独嘉 on 14-6-6.\n// Copyright (c) 2014年 dujia. All rights reserved.\n//\n\n#import \n\ntypedef NS_ENUM(NSUInteger, DDRecordingState)\n{\n DDShowVolumnState,\n DDShowCancelSendState,\n DDShowRecordTimeTooShort\n};\n\n@interface RecordingView : UIView\n@property (nonatomic,assign)DDRecordingState recordingState;\n\n- (instancetype)initWithState:(DDRecordingState)state;\n- (void)setVolume:(float)volume;\n\n@end\n"} +{"text": "using NHapi.Base.Parser;\nusing NHapi.Base;\nusing NHapi.Base.Log;\nusing System;\nusing System.Collections.Generic;\nusing NHapi.Model.V27.Segment;\nusing NHapi.Model.V27.Datatype;\nusing NHapi.Base.Model;\n\nnamespace NHapi.Model.V27.Group\n{\n///\n///Represents the ORL_O22_RESPONSE Group. A Group is an ordered collection of message \n/// segments that can repeat together or be optionally in/excluded together.\n/// This Group contains the following elements: \n///
    \n///
  1. 0: PID (Patient Identification)
  2. \n///
  3. 1: PRT (Participation Information) optional repeating
  4. \n///
  5. 2: ORL_O22_ORDER (a Group object) optional repeating
  6. \n///
\n///
\n[Serializable]\npublic class ORL_O22_RESPONSE : AbstractGroup {\n\n\t/// \n\t/// Creates a new ORL_O22_RESPONSE Group.\n\t///\n\tpublic ORL_O22_RESPONSE(IGroup parent, IModelClassFactory factory) : base(parent, factory){\n\t try {\n\t this.add(typeof(PID), true, false);\n\t this.add(typeof(PRT), false, true);\n\t this.add(typeof(ORL_O22_ORDER), false, true);\n\t } catch(HL7Exception e) {\n\t HapiLogFactory.GetHapiLog(GetType()).Error(\"Unexpected error creating ORL_O22_RESPONSE - this is probably a bug in the source code generator.\", e);\n\t }\n\t}\n\n\t///\n\t/// Returns PID (Patient Identification) - creates it if necessary\n\t///\n\tpublic PID PID { \nget{\n\t PID ret = null;\n\t try {\n\t ret = (PID)this.GetStructure(\"PID\");\n\t } catch(HL7Exception e) {\n\t HapiLogFactory.GetHapiLog(GetType()).Error(\"Unexpected error accessing data - this is probably a bug in the source code generator.\", e);\n\t throw new System.Exception(\"An unexpected error ocurred\",e);\n\t }\n\t return ret;\n\t}\n\t}\n\n\t///\n\t/// Returns first repetition of PRT (Participation Information) - creates it if necessary\n\t///\n\tpublic PRT GetPRT() {\n\t PRT ret = null;\n\t try {\n\t ret = (PRT)this.GetStructure(\"PRT\");\n\t } catch(HL7Exception e) {\n\t HapiLogFactory.GetHapiLog(GetType()).Error(\"Unexpected error accessing data - this is probably a bug in the source code generator.\", e);\n\t throw new System.Exception(\"An unexpected error ocurred\",e);\n\t }\n\t return ret;\n\t}\n\n\t///\n\t///Returns a specific repetition of PRT\n\t/// * (Participation Information) - creates it if necessary\n\t/// throws HL7Exception if the repetition requested is more than one \n\t/// greater than the number of existing repetitions.\n\t///\n\tpublic PRT GetPRT(int rep) { \n\t return (PRT)this.GetStructure(\"PRT\", rep);\n\t}\n\n\t/** \n\t * Returns the number of existing repetitions of PRT \n\t */ \n\tpublic int PRTRepetitionsUsed { \nget{\n\t int reps = -1; \n\t try { \n\t reps = this.GetAll(\"PRT\").Length; \n\t } catch (HL7Exception e) { \n\t string message = \"Unexpected error accessing data - this is probably a bug in the source code generator.\"; \n\t HapiLogFactory.GetHapiLog(GetType()).Error(message, e); \n\t throw new System.Exception(message);\n\t } \n\t return reps; \n\t}\n\t} \n\n\t/** \n\t * Enumerate over the PRT results \n\t */ \n\tpublic IEnumerable PRTs \n\t{ \n\t\tget\n\t\t{\n\t\t\tfor (int rep = 0; rep < PRTRepetitionsUsed; rep++)\n\t\t\t{\n\t\t\t\tyield return (PRT)this.GetStructure(\"PRT\", rep);\n\t\t\t}\n\t\t}\n\t}\n\n\t///\n\t///Adds a new PRT\n\t///\n\tpublic PRT AddPRT()\n\t{\n\t\treturn this.AddStructure(\"PRT\") as PRT;\n\t}\n\n\t///\n\t///Removes the given PRT\n\t///\n\tpublic void RemovePRT(PRT toRemove)\n\t{\n\t\tthis.RemoveStructure(\"PRT\", toRemove);\n\t}\n\n\t///\n\t///Removes the PRT at the given index\n\t///\n\tpublic void RemovePRTAt(int index)\n\t{\n\t\tthis.RemoveRepetition(\"PRT\", index);\n\t}\n\n\t///\n\t/// Returns first repetition of ORL_O22_ORDER (a Group object) - creates it if necessary\n\t///\n\tpublic ORL_O22_ORDER GetORDER() {\n\t ORL_O22_ORDER ret = null;\n\t try {\n\t ret = (ORL_O22_ORDER)this.GetStructure(\"ORDER\");\n\t } catch(HL7Exception e) {\n\t HapiLogFactory.GetHapiLog(GetType()).Error(\"Unexpected error accessing data - this is probably a bug in the source code generator.\", e);\n\t throw new System.Exception(\"An unexpected error ocurred\",e);\n\t }\n\t return ret;\n\t}\n\n\t///\n\t///Returns a specific repetition of ORL_O22_ORDER\n\t/// * (a Group object) - creates it if necessary\n\t/// throws HL7Exception if the repetition requested is more than one \n\t/// greater than the number of existing repetitions.\n\t///\n\tpublic ORL_O22_ORDER GetORDER(int rep) { \n\t return (ORL_O22_ORDER)this.GetStructure(\"ORDER\", rep);\n\t}\n\n\t/** \n\t * Returns the number of existing repetitions of ORL_O22_ORDER \n\t */ \n\tpublic int ORDERRepetitionsUsed { \nget{\n\t int reps = -1; \n\t try { \n\t reps = this.GetAll(\"ORDER\").Length; \n\t } catch (HL7Exception e) { \n\t string message = \"Unexpected error accessing data - this is probably a bug in the source code generator.\"; \n\t HapiLogFactory.GetHapiLog(GetType()).Error(message, e); \n\t throw new System.Exception(message);\n\t } \n\t return reps; \n\t}\n\t} \n\n\t/** \n\t * Enumerate over the ORL_O22_ORDER results \n\t */ \n\tpublic IEnumerable ORDERs \n\t{ \n\t\tget\n\t\t{\n\t\t\tfor (int rep = 0; rep < ORDERRepetitionsUsed; rep++)\n\t\t\t{\n\t\t\t\tyield return (ORL_O22_ORDER)this.GetStructure(\"ORDER\", rep);\n\t\t\t}\n\t\t}\n\t}\n\n\t///\n\t///Adds a new ORL_O22_ORDER\n\t///\n\tpublic ORL_O22_ORDER AddORDER()\n\t{\n\t\treturn this.AddStructure(\"ORDER\") as ORL_O22_ORDER;\n\t}\n\n\t///\n\t///Removes the given ORL_O22_ORDER\n\t///\n\tpublic void RemoveORDER(ORL_O22_ORDER toRemove)\n\t{\n\t\tthis.RemoveStructure(\"ORDER\", toRemove);\n\t}\n\n\t///\n\t///Removes the ORL_O22_ORDER at the given index\n\t///\n\tpublic void RemoveORDERAt(int index)\n\t{\n\t\tthis.RemoveRepetition(\"ORDER\", index);\n\t}\n\n}\n}\n"} +{"text": "/*\n * Piwigo for Android\n * Copyright (C) 2016-2017 Piwigo Team http://piwigo.org\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 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 org.piwigo.io.restmodel;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.io.Serializable;\n\npublic class Derivatives implements Serializable {\n\n @SerializedName(\"thumb\") public Derivative thumb;\n\n @SerializedName(\"square\") public Derivative square;\n\n @SerializedName(\"xsmall\") public Derivative xsmall;\n\n @SerializedName(\"small\") public Derivative small;\n\n @SerializedName(\"medium\") public Derivative medium;\n\n @SerializedName(\"large\") public Derivative large;\n\n @SerializedName(\"xlarge\") public Derivative xlarge;\n\n @SerializedName(\"xxlarge\") public Derivative xxlarge;\n\n}"} +{"text": "#include \n#pragma hdrstop\n#include \n#pragma hdrstop\n#if defined(__MYPACKAGE__)\n#pragma package(smart_init)\n#endif\n\n#include \n#include \n\n#if 1\n #define PROC( v )\n #define Log( v )\n#else\n #define PROC( v ) INProc __proc v ;\n #define Log( v ) INProc::Say v\n#endif\n\n/********************************************************************\n MemDB\n HDB_DBTYPE_MEMORY\n\n Implementation of HDB for in-memory databases.\n ********************************************************************/\nLOCALCLASSBASE( IMemArray, public BaseArray )\n public:\n MYRTLEXP IMemArray( void ) : BaseArray( 0,0,0 ) {}\n\n void MYRTLEXP DeleteAll( void ) { DeleteAllINT(); }\n LPVOID MYRTLEXP AddNew( void ) { return AddINT(NULL); }\n void MYRTLEXP DeleteNum( DWORD num ) { DeleteNumINT( (int)num ); }\n LPVOID MYRTLEXP Item( DWORD num ) { return ItemINT( (int)num ); }\n void MYRTLEXP Init( UINT sz,UINT cn ) { Initialize( sz,cn,cn ); }\n void MYRTLEXP Sort( BaseArray::SortProc sp ) { SortINT( sp,-1,-1 ); }\n int Search( LPVOID key,BaseArray::SortProc sp ) const { return SearchINT(key,sp,NULL); }\n int LSearch( LPVOID key,BaseArray::SortProc sp ) const { return LSearchINT(key,0,sp); }\n};\n\nLOCALSTRUCTBASE( IMemTable, public ITable )\n public:\n PIMemArray Records;\n public:\n IMemTable( void );\n\n virtual BOOL Assign( PHDBTableInfo p,DWORD Flags );\n\n virtual void Clear( void ) { Records->DeleteAll(); }\n virtual LPVOID NewRecord( void ) { return Records->AddNew(); }\n virtual void DeleteRecord( DWORD num ) { Records->DeleteNum( num ); }\n virtual LPVOID Record( DWORD num ) { return Records->Item( num ); }\n virtual DWORD RecCount( void ) { return (DWORD)Records->Count(); }\n\n virtual void Sort( WORD cNum );\n virtual DWORD QSearch( WORD cNum, LPVOID Key );\n virtual DWORD LSearch( WORD cNum, LPVOID Key );\n virtual void Closeup( void );\n};\n\nIMemTable::IMemTable( void )\n {\n Records = new IMemArray;\n}\n\nBOOL IMemTable::Assign( PHDBTableInfo p,DWORD Flags )\n {\n if ( !ITable::Assign(p,Flags) )\n return FALSE;\n\n if ( !RecIncrement ) {\n FIO_SETERRORN( ERROR_INVALID_PARAMETER );\n return FALSE;\n }\n\n Records->Init( RecSize,RecIncrement );\n\n return TRUE;\n}\n\nvoid IMemTable::Closeup( void )\n {\n delete Records;\n ITable::Closeup();\n}\n\nstatic DWORD idxOffset,\n idxSize;\n\n#define TO_TYPE( tp,ptr ) ((tp*)(((LPBYTE)ptr) + idxOffset))\n#define D_SORT( nm ) static int RTL_CALLBACK nm( const void *left, const void *right )\n\nD_SORT( idDTSort ) { return TO_TYPE(PRTime,left)->Cmp( *TO_TYPE(PRTime,right) ); }\nD_SORT( idDSort ) { return TO_TYPE(PRDateOnly,left)->Cmp( *TO_TYPE(PRDateOnly,right) ); }\nD_SORT( idTSort ) { return TO_TYPE(PRTimeOnly,left)->Cmp( *TO_TYPE(PRTimeOnly,right) ); }\nD_SORT( idSSort ) { return StrCmp( TO_TYPE(const char,left),TO_TYPE(const char,right) ); }\nD_SORT( idDWSort ) { return (int)(*TO_TYPE(DWORD,left)) - (int)(*TO_TYPE(DWORD,right)); }\nD_SORT( idWSort ) { return (int)(*TO_TYPE(WORD,left)) - (int)(*TO_TYPE(WORD,right)); }\nD_SORT( idDBSort ) { return (*TO_TYPE(double,left) > *TO_TYPE(double,right)) ? (1) : (-1); }\nD_SORT( idBinSort ) { return memcmp( left,right,idxSize ); }\n\nvoid IMemTable::Sort( WORD cNum )\n {\n if ( cNum >= cCount )\n return;\n\n PHDBValue p = &Values[ cNum ];\n idxOffset = p->Offset;\n\n switch( p->Type ) {\n case HDB_TP_DATETIME: Records->Sort( idDTSort ); break;\n case HDB_TP_DATE: Records->Sort( idDSort ); break;\n case HDB_TP_TIME: Records->Sort( idTSort ); break;\n case HDB_TP_STRING: Records->Sort( idSSort ); break;\n case HDB_TP_WORD: Records->Sort( idWSort ); break;\n case HDB_TP_DWORD: Records->Sort( idDWSort ); break;\n case HDB_TP_DOUBLE: Records->Sort( idDBSort ); break;\n case HDB_TP_BINARY: Records->Sort( idBinSort ); break;\n default: break;\n }\n}\n\nDWORD IMemTable::QSearch( WORD num, LPVOID Key )\n {\n if ( !Key || num >= cCount )\n return MAX_DWORD;\n\n PHDBValue p = Values+num;\n int rc;\n idxOffset = p->Offset;\n idxSize = p->Size;\n\n switch( p->Type ) {\n case HDB_TP_DATETIME: rc = Records->Search( Key, idDTSort ); break;\n case HDB_TP_DATE: rc = Records->Search( Key, idDSort ); break;\n case HDB_TP_TIME: rc = Records->Search( Key, idTSort ); break;\n case HDB_TP_STRING: rc = Records->Search( Key, idSSort ); break;\n case HDB_TP_WORD: rc = Records->Search( Key, idWSort ); break;\n case HDB_TP_DWORD: rc = Records->Search( Key, idDWSort ); break;\n case HDB_TP_DOUBLE: rc = Records->Search( Key, idDBSort ); break;\n case HDB_TP_BINARY: rc = Records->Search( Key, idBinSort ); break;\n default: return MAX_DWORD;\n }\n\n return rc == -1 ? MAX_DWORD : ((DWORD)rc);\n}\n\nDWORD IMemTable::LSearch( WORD num, LPVOID Key )\n {\n if ( !Key || num >= cCount )\n return MAX_DWORD;\n\n PHDBValue p = Values+num;\n int rc;\n idxOffset = p->Offset;\n idxSize = p->Size;\n\n switch( p->Type ) {\n case HDB_TP_DATETIME: rc = Records->LSearch( Key, idDTSort ); break;\n case HDB_TP_DATE: rc = Records->LSearch( Key, idDSort ); break;\n case HDB_TP_TIME: rc = Records->LSearch( Key, idTSort ); break;\n case HDB_TP_STRING: rc = Records->LSearch( Key, idSSort ); break;\n case HDB_TP_WORD: rc = Records->LSearch( Key, idWSort ); break;\n case HDB_TP_DWORD: rc = Records->LSearch( Key, idDWSort ); break;\n case HDB_TP_DOUBLE: rc = Records->LSearch( Key, idDBSort ); break;\n case HDB_TP_BINARY: rc = Records->LSearch( Key, idBinSort ); break;\n default: return MAX_DWORD;\n }\n\n return rc == -1 ? MAX_DWORD : ((DWORD)rc);\n}\n\nLOCALSTRUCTBASE( IMemDatabase, public IDatabase )\n protected:\n virtual PITable NewTable( PHDBTableInfo p ) { return new IMemTable; }\n\n public:\n IMemDatabase( void ) {}\n};\n\n/********************************************************************\n Interface\n ********************************************************************/\nPIDatabase MYRTLEXP hdbCreate_MemDB( PHDBTableInfo dbInfo,DWORD Flags )\n {\n USEARG( Flags )\n USEARG( dbInfo )\n return new IMemDatabase;\n}\n"} +{"text": "/*\n * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.\n * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n *\n * This code is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License version 2 only, as\n * published by the Free Software Foundation. Oracle designates this\n * particular file as subject to the \"Classpath\" exception as provided\n * by Oracle in the LICENSE file that accompanied this code.\n *\n * This code is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n * version 2 for more details (a copy is included in the LICENSE file that\n * accompanied this code).\n *\n * You should have received a copy of the GNU General Public License version\n * 2 along with this work; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n *\n * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n * or visit www.oracle.com if you need additional information or have any\n * questions.\n */\n\npackage javax.naming.ldap;\n\nimport javax.naming.ReferralException;\nimport javax.naming.Context;\nimport javax.naming.NamingException;\nimport java.util.Hashtable;\n\n/**\n * This abstract class is used to represent an LDAP referral exception.\n * It extends the base ReferralException by providing a\n * getReferralContext() method that accepts request controls.\n * LdapReferralException is an abstract class. Concrete implementations of it\n * determine its synchronization and serialization properties.\n *

\n * A Control[] array passed as a parameter to\n * the getReferralContext() method is owned by the caller.\n * The service provider will not modify the array or keep a reference to it,\n * although it may keep references to the individual Control objects\n * in the array.\n *\n * @author Rosanna Lee\n * @author Scott Seligman\n * @author Vincent Ryan\n * @since 1.3\n */\n\npublic abstract class LdapReferralException extends ReferralException {\n /**\n * Constructs a new instance of LdapReferralException using the\n * explanation supplied. All other fields are set to null.\n *\n * @param explanation Additional detail about this exception. Can be null.\n * @see java.lang.Throwable#getMessage\n */\n protected LdapReferralException(String explanation) {\n super(explanation);\n }\n\n /**\n * Constructs a new instance of LdapReferralException.\n * All fields are set to null.\n */\n protected LdapReferralException() {\n super();\n }\n\n /**\n * Retrieves the context at which to continue the method using the\n * context's environment and no controls.\n * The referral context is created using the environment properties of\n * the context that threw the ReferralException and no controls.\n *

\n * This method is equivalent to\n *

\n     * getReferralContext(ctx.getEnvironment(), null);\n     *
\n * where ctx is the context that threw the ReferralException.\n *

\n * It is overridden in this class for documentation purposes only.\n * See ReferralException for how to use this method.\n *\n * @return The non-null context at which to continue the method.\n * @exception NamingException If a naming exception was encountered.\n * Call either retryReferral() or skipReferral()\n * to continue processing referrals.\n */\n public abstract Context getReferralContext() throws NamingException;\n\n /**\n * Retrieves the context at which to continue the method using\n * environment properties and no controls.\n * The referral context is created using env as its environment\n * properties and no controls.\n *

\n * This method is equivalent to\n *

\n     * getReferralContext(env, null);\n     *
\n *

\n * It is overridden in this class for documentation purposes only.\n * See ReferralException for how to use this method.\n *\n * @param env The possibly null environment to use when retrieving the\n * referral context. If null, no environment properties will be used.\n *\n * @return The non-null context at which to continue the method.\n * @exception NamingException If a naming exception was encountered.\n * Call either retryReferral() or skipReferral()\n * to continue processing referrals.\n */\n public abstract Context\n getReferralContext(Hashtable env)\n throws NamingException;\n\n /**\n * Retrieves the context at which to continue the method using\n * request controls and environment properties.\n * Regardless of whether a referral is encountered directly during a\n * context operation, or indirectly, for example, during a search\n * enumeration, the referral exception should provide a context\n * at which to continue the operation.\n * To continue the operation, the client program should re-invoke\n * the method using the same arguments as the original invocation.\n *

\n * reqCtls is used when creating the connection to the referred\n * server. These controls will be used as the connection request controls for\n * the context and context instances\n * derived from the context.\n * reqCtls will also be the context's request controls for\n * subsequent context operations. See the LdapContext class\n * description for details.\n *

\n * This method should be used instead of the other two overloaded forms\n * when the caller needs to supply request controls for creating\n * the referral context. It might need to do this, for example, when\n * it needs to supply special controls relating to authentication.\n *

\n * Service provider implementors should read the \"Service Provider\" section\n * in the LdapContext class description for implementation details.\n *\n * @param reqCtls The possibly null request controls to use for the new context.\n * If null or the empty array means use no request controls.\n * @param env The possibly null environment properties to use when\n * for the new context. If null, the context is initialized with no environment\n * properties.\n * @return The non-null context at which to continue the method.\n * @exception NamingException If a naming exception was encountered.\n * Call either retryReferral() or skipReferral()\n * to continue processing referrals.\n */\n public abstract Context\n getReferralContext(Hashtable env,\n Control[] reqCtls)\n throws NamingException;\n\n private static final long serialVersionUID = -1668992791764950804L;\n}\n"} +{"text": "package jsc.kit.component.guide;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.os.Build;\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\nimport android.util.AttributeSet;\nimport android.view.View;\n\nimport jsc.kit.component.IViewAttrDelegate;\n\n/**\n *
Email:1006368252@qq.com\n *
QQ:1006368252\n *
https://github.com/JustinRoom/JSCKit\n *\n * @author jiangshicheng\n */\npublic class GuideRippleView extends View implements IViewAttrDelegate {\n Paint paint;\n\n int circleCount;\n int[] colors;\n float circleSpace;\n float speed;\n\n float radius = 0;\n int startAlpha = 0xFF;\n boolean isRunning = false;\n int clipWidth, clipHeight;\n\n public GuideRippleView(Context context) {\n super(context);\n initAttr(context, null, 0);\n }\n\n public GuideRippleView(Context context, @Nullable AttributeSet attrs) {\n super(context, attrs);\n initAttr(context, attrs, 0);\n }\n\n public GuideRippleView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {\n super(context, attrs, defStyleAttr);\n initAttr(context, attrs, defStyleAttr);\n }\n\n @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n public GuideRippleView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {\n super(context, attrs, defStyleAttr, defStyleRes);\n initAttr(context, attrs, defStyleAttr);\n }\n\n @Override\n public void initAttr(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {\n paint = new Paint(Paint.ANTI_ALIAS_FLAG);\n paint.setStyle(Paint.Style.FILL);\n initCirculars(3, new int[]{Color.BLUE, Color.BLUE, Color.BLUE}, 20, .6f);\n }\n\n @Override\n protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n super.onMeasure(widthMeasureSpec, widthMeasureSpec);\n }\n\n @Override\n protected void onDraw(Canvas canvas) {\n if (!isRunning)\n return;\n\n if (clipWidth > 0 && clipHeight > 0){\n int clipLeft = (getWidth() - clipWidth) / 2;\n int clipTop = (getHeight() - clipHeight) / 2;\n canvas.clipRect(clipLeft, clipTop, clipLeft + clipWidth, clipTop + clipHeight);\n }\n\n float maxRadius = getWidth() / 2.0f;\n int alpha = (int) (startAlpha * (1 - radius / maxRadius) + .5f);\n for (int i = 0; i < circleCount; i++) {\n paint.setColor(colors[i]);\n paint.setAlpha(alpha);\n float tempRadius = radius - circleSpace * i;\n if (tempRadius <= 0)\n break;\n canvas.drawCircle(maxRadius, maxRadius, tempRadius, paint);\n }\n radius += speed;\n if (radius > maxRadius)\n radius = 0;\n invalidate();\n }\n\n @Override\n protected void onAttachedToWindow() {\n super.onAttachedToWindow();\n startRipple();\n }\n\n @Override\n protected void onDetachedFromWindow() {\n stopRipple();\n super.onDetachedFromWindow();\n }\n\n public void startRipple() {\n if (isRunning)\n return;\n\n isRunning = true;\n invalidate();\n }\n\n public void stopRipple() {\n isRunning = false;\n }\n\n /**\n * Set the ripple animation display area.\n *\n * @param clipWidth clip width\n * @param clipHeight clip height\n */\n public void setClip(int clipWidth, int clipHeight){\n this.clipWidth = clipWidth;\n this.clipHeight = clipHeight;\n }\n\n /**\n *\n * @param circleCount ripple circle count\n * @param colors colors\n * @param circleSpace the radius offset of two ripple circle\n * @param speed the speed of ripple animation\n */\n public void initCirculars(int circleCount, @NonNull int[] colors, float circleSpace, float speed) {\n this.circleCount = circleCount;\n this.colors = colors;\n this.circleSpace = circleSpace;\n this.speed = speed;\n if (this.colors.length < circleCount)\n throw new IllegalArgumentException(\"colors' length must be equal or more than circleCount.\");\n }\n}\n"} +{"text": "--- !tapi-tbd-v2\narchs: [ armv7, armv7s, arm64, arm64e ]\nplatform: ios\nflags: [ flat_namespace, not_app_extension_safe ]\ninstall-name: /System/Library/PrivateFrameworks/Symptoms.framework/Frameworks/SymptomPresentationFeed.framework/SymptomPresentationFeed\ncurrent-version: 820.232.1\ncompatibility-version: 1\nobjc-constraint: retain_release\nexports:\n - archs: [ armv7, armv7s, arm64, arm64e ]\n symbols: [ _NSTargetObjectUserInfoKey, _NSUnknownKeyException, _NSUnknownUserInfoKey, _advisoryToString,\n _kDarwinNotificationHasAlternateAdvice, _kDarwinNotificationMaterialLinkQualityChange, _kDeltaOnly,\n _kEstTransferTimeConfidence, _kEstTransferTimeDLSecs, _kEstTransferTimeULSecs,\n _kNOIDiscretionaryInvitesWhenForegroundToo, _kPayloadInfoDLKB, _kPayloadInfoULKB,\n _kPerformanceFlowAvgUsecsEstabTime, _kPerformanceFlowConnAttempts, _kPerformanceFlowConnSuccesses,\n _kPerformanceFlowKind, _kPerformanceFlowOverallTime, _kPerformanceFlowRemoteID,\n _kPerformanceFlowTimeStamp, _kPerformanceFlowTimesThresholded, _kPerformanceFlowTxFailPackets,\n _kPerformanceFlowTxPackets, _kPerformanceFlowTxReTxInterval, _kPerformanceFlowTxReTxPackets,\n _kPerformanceNetAttachAdminDisables, _kPerformanceNetAttachBytesIn, _kPerformanceNetAttachBytesOut,\n _kPerformanceNetAttachConnAttempts, _kPerformanceNetAttachConnSuccesses,\n _kPerformanceNetAttachDataStalls, _kPerformanceNetAttachEpochs, _kPerformanceNetAttachFaultyStay,\n _kPerformanceNetAttachIdentifier, _kPerformanceNetAttachKnownGood, _kPerformanceNetAttachLowInternetDL,\n _kPerformanceNetAttachLowInternetUL, _kPerformanceNetAttachLowLqmStay,\n _kPerformanceNetAttachLowQualyStay, _kPerformanceNetAttachLqmTransitionCount,\n _kPerformanceNetAttachLqmTransitionRate, _kPerformanceNetAttachOverallStay,\n _kPerformanceNetAttachPacketsIn, _kPerformanceNetAttachPacketsOut, _kPerformanceNetAttachReTxBytes,\n _kPerformanceNetAttachRttAvg, _kPerformanceNetAttachRttMin, _kPerformanceNetAttachRttVar,\n _kPerformanceNetAttachRxDupeBytes, _kPerformanceNetAttachRxOOOBytes, _kPerformanceNetAttachSinceTime,\n _kPerformanceNetAttachTimeStamp, _kPerformanceNetAttachTopDownloadRate,\n _kUsageCalendarDayResolution96slots, _kUsageCalendarDaySlot, _kUsageCalendarTier1,\n _kUsageCalendarTier2, _kUsageCalendarTier3, _kUsageCalendarTier4, _kUsageCalendarTier5,\n _kUsageCalendarWeekSlot, _kUsageFeed, _kUsageLastTime, _kUsageNetworkAwdl, _kUsageNetworkAwdlInBytes,\n _kUsageNetworkAwdlInBytes_mean, _kUsageNetworkAwdlInBytes_var, _kUsageNetworkAwdlOutBytes,\n _kUsageNetworkAwdlOutBytes_mean, _kUsageNetworkAwdlOutBytes_var, _kUsageNetworkAwdlSampleCount,\n _kUsageNetworkCell, _kUsageNetworkCellInBytes, _kUsageNetworkCellInBytes_mean,\n _kUsageNetworkCellInBytes_var, _kUsageNetworkCellOutBytes, _kUsageNetworkCellOutBytes_mean,\n _kUsageNetworkCellOutBytes_var, _kUsageNetworkCellSampleCount, _kUsageNetworkExpensive,\n _kUsageNetworkExpensiveInBytes, _kUsageNetworkExpensiveInBytes_mean,\n _kUsageNetworkExpensiveInBytes_var, _kUsageNetworkExpensiveOutBytes,\n _kUsageNetworkExpensiveOutBytes_mean, _kUsageNetworkExpensiveOutBytes_var,\n _kUsageNetworkExpensiveSampleCount, _kUsageNetworkWiFi, _kUsageNetworkWiFiInBytes,\n _kUsageNetworkWiFiInBytes_mean, _kUsageNetworkWiFiInBytes_var, _kUsageNetworkWiFiOutBytes,\n _kUsageNetworkWiFiOutBytes_mean, _kUsageNetworkWiFiOutBytes_var, _kUsageNetworkWiFiSampleCount,\n _kUsageNetworkWired, _kUsageNetworkWiredInBytes, _kUsageNetworkWiredInBytes_mean,\n _kUsageNetworkWiredInBytes_var, _kUsageNetworkWiredOutBytes, _kUsageNetworkWiredOutBytes_mean,\n _kUsageNetworkWiredOutBytes_var, _kUsageNetworkWiredSampleCount, _kUsageProcessBundleName,\n _kUsageProcessDataKey, _kUsageProcessProcName, _kUsageSinceTime, _stringToAdvisory ]\n objc-classes: [ _NWNetworkOfInterest, _NWNetworkOfInterestManager, _NWNetworkPredictions, _NetworkInterfaceUtils,\n _NetworkPerformanceFeed, _ProcessNetStatsIndividualEntity, _UsageFeed ]\n objc-ivars: [ _NWNetworkOfInterest._considerAlternate, _NWNetworkOfInterest._customSignature,\n _NWNetworkOfInterest._discretionaryTrafficInvited, _NWNetworkOfInterest._flags,\n _NWNetworkOfInterest._interface, _NWNetworkOfInterest._isAny, _NWNetworkOfInterest._isBuiltin,\n _NWNetworkOfInterest._isTrafficEligible, _NWNetworkOfInterest._linkQuality,\n _NWNetworkOfInterest._powerCostDL, _NWNetworkOfInterest._powerCostUL,\n _NWNetworkOfInterest._predictions, _NWNetworkOfInterest._predictionsGeneratedAt,\n _NWNetworkOfInterest._scopedToLOI, _NWNetworkOfInterest._version,\n _NWNetworkOfInterest._willGetDiscretionaryTrafficInvites, _NWNetworkOfInterestManager._callerQueue,\n _NWNetworkOfInterestManager._connection, _NWNetworkOfInterestManager._delegate,\n _NWNetworkOfInterestManager._service,\n _NWNetworkOfInterestManager.activeDaemonRegardlessPrimaryInterface,\n _NWNetworkOfInterestManager.closing, _NWNetworkOfInterestManager.hasPrimaryInterface,\n _NWNetworkOfInterestManager.notifyToken, _NWNetworkOfInterestManager.registryNOI,\n _NWNetworkOfInterestManager.workspace, _NWNetworkPredictions._changePointAt,\n _NWNetworkPredictions._confidence, _NWNetworkPredictions._resolutionSeconds,\n _NWNetworkPredictions._toQuality, _NetworkInterfaceUtils._hasPrimaryInterface,\n _NetworkPerformanceFeed._delegate, _NetworkPerformanceFeed.activeDaemonRegardlessPrimaryInterface,\n _NetworkPerformanceFeed.callerQueue, _NetworkPerformanceFeed.concQueue,\n _NetworkPerformanceFeed.networkInterfaceUtils, _NetworkPerformanceFeed.workspace, _UsageFeed._delegate,\n _UsageFeed._processFeedData, _UsageFeed.handleAnalytics, _UsageFeed.workspace ]\n...\n"} +{"text": "/*\n * This file is part of the Trezor project, https://trezor.io/\n *\n * Copyright (c) SatoshiLabs\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\n\n#include \n\n#include \"common.h\"\n#include \"flash.h\"\n#include \"norcow.h\"\n\n// NRCW = 4e524357\n#define NORCOW_MAGIC ((uint32_t)0x5743524e)\n#define NORCOW_MAGIC_LEN (sizeof(uint32_t))\n\nstatic const uint8_t norcow_sectors[NORCOW_SECTOR_COUNT] = NORCOW_SECTORS;\nstatic uint8_t norcow_active_sector = 0;\nstatic uint32_t norcow_active_offset = NORCOW_MAGIC_LEN;\n\n/*\n * Returns pointer to sector, starting with offset\n * Fails when there is not enough space for data of given size\n */\nstatic const void *norcow_ptr(uint8_t sector, uint32_t offset, uint32_t size) {\n ensure(sectrue * (sector <= NORCOW_SECTOR_COUNT), \"invalid sector\");\n return flash_get_address(norcow_sectors[sector], offset, size);\n}\n\n/*\n * Writes data to given sector, starting from offset\n */\nstatic secbool norcow_write(uint8_t sector, uint32_t offset, uint32_t prefix,\n const uint8_t *data, uint16_t len) {\n if (sector >= NORCOW_SECTOR_COUNT) {\n return secfalse;\n }\n ensure(flash_unlock(), NULL);\n\n // write prefix\n ensure(flash_write_word(norcow_sectors[sector], offset, prefix), NULL);\n\n if (len > 0) {\n offset += sizeof(uint32_t);\n // write data\n for (uint16_t i = 0; i < len; i++, offset++) {\n ensure(flash_write_byte(norcow_sectors[sector], offset, data[i]), NULL);\n }\n // pad with zeroes\n for (; offset % 4; offset++) {\n ensure(flash_write_byte(norcow_sectors[sector], offset, 0x00), NULL);\n }\n }\n ensure(flash_lock(), NULL);\n return sectrue;\n}\n\n/*\n * Erases sector (and sets a magic)\n */\nstatic void norcow_erase(uint8_t sector, secbool set_magic) {\n ensure(sectrue * (sector <= NORCOW_SECTOR_COUNT), \"invalid sector\");\n ensure(flash_erase_sector(norcow_sectors[sector]), \"erase failed\");\n if (sectrue == set_magic) {\n ensure(norcow_write(sector, 0, NORCOW_MAGIC, NULL, 0), \"set magic failed\");\n }\n}\n\n#define ALIGN4(X) (X) = ((X) + 3) & ~3\n\n/*\n * Reads one item starting from offset\n */\nstatic secbool read_item(uint8_t sector, uint32_t offset, uint16_t *key,\n const void **val, uint16_t *len, uint32_t *pos) {\n *pos = offset;\n\n const void *k = norcow_ptr(sector, *pos, 2);\n if (k == NULL) return secfalse;\n *pos += 2;\n memcpy(key, k, sizeof(uint16_t));\n if (*key == 0xFFFF) {\n return secfalse;\n }\n\n const void *l = norcow_ptr(sector, *pos, 2);\n if (l == NULL) return secfalse;\n *pos += 2;\n memcpy(len, l, sizeof(uint16_t));\n\n *val = norcow_ptr(sector, *pos, *len);\n if (*val == NULL) return secfalse;\n *pos += *len;\n ALIGN4(*pos);\n return sectrue;\n}\n\n/*\n * Writes one item starting from offset\n */\nstatic secbool write_item(uint8_t sector, uint32_t offset, uint16_t key,\n const void *val, uint16_t len, uint32_t *pos) {\n uint32_t prefix = (len << 16) | key;\n *pos = offset + sizeof(uint32_t) + len;\n ALIGN4(*pos);\n return norcow_write(sector, offset, prefix, val, len);\n}\n\n/*\n * Finds item in given sector\n */\nstatic secbool find_item(uint8_t sector, uint16_t key, const void **val,\n uint16_t *len) {\n *val = 0;\n *len = 0;\n uint32_t offset = NORCOW_MAGIC_LEN;\n for (;;) {\n uint16_t k, l;\n const void *v;\n uint32_t pos;\n if (sectrue != read_item(sector, offset, &k, &v, &l, &pos)) {\n break;\n }\n if (key == k) {\n *val = v;\n *len = l;\n }\n offset = pos;\n }\n return sectrue * (*val != NULL);\n}\n\n/*\n * Finds first unused offset in given sector\n */\nstatic uint32_t find_free_offset(uint8_t sector) {\n uint32_t offset = NORCOW_MAGIC_LEN;\n for (;;) {\n uint16_t key, len;\n const void *val;\n uint32_t pos;\n if (sectrue != read_item(sector, offset, &key, &val, &len, &pos)) {\n break;\n }\n offset = pos;\n }\n return offset;\n}\n\n/*\n * Compacts active sector and sets new active sector\n */\nstatic void compact() {\n uint8_t norcow_next_sector = (norcow_active_sector + 1) % NORCOW_SECTOR_COUNT;\n norcow_erase(norcow_next_sector, sectrue);\n\n uint32_t offset = NORCOW_MAGIC_LEN, offsetw = NORCOW_MAGIC_LEN;\n\n for (;;) {\n // read item\n uint16_t k, l;\n const void *v;\n uint32_t pos;\n secbool r = read_item(norcow_active_sector, offset, &k, &v, &l, &pos);\n if (sectrue != r) {\n break;\n }\n offset = pos;\n\n // check if not already saved\n const void *v2;\n uint16_t l2;\n r = find_item(norcow_next_sector, k, &v2, &l2);\n if (sectrue == r) {\n continue;\n }\n\n // scan for latest instance\n uint32_t offsetr = offset;\n for (;;) {\n uint16_t k2;\n uint32_t posr;\n r = read_item(norcow_active_sector, offsetr, &k2, &v2, &l2, &posr);\n if (sectrue != r) {\n break;\n }\n if (k == k2) {\n v = v2;\n l = l2;\n }\n offsetr = posr;\n }\n\n // copy the last item\n uint32_t posw;\n ensure(write_item(norcow_next_sector, offsetw, k, v, l, &posw),\n \"compaction write failed\");\n offsetw = posw;\n }\n\n norcow_erase(norcow_active_sector, secfalse);\n norcow_active_sector = norcow_next_sector;\n norcow_active_offset = find_free_offset(norcow_active_sector);\n}\n\n/*\n * Initializes storage\n */\nvoid norcow_init(void) {\n flash_init();\n secbool found = secfalse;\n // detect active sector - starts with magic\n for (uint8_t i = 0; i < NORCOW_SECTOR_COUNT; i++) {\n const uint32_t *magic = norcow_ptr(i, 0, NORCOW_MAGIC_LEN);\n if (magic != NULL && *magic == NORCOW_MAGIC) {\n found = sectrue;\n norcow_active_sector = i;\n break;\n }\n }\n // no active sectors found - let's erase\n if (sectrue == found) {\n norcow_active_offset = find_free_offset(norcow_active_sector);\n } else {\n norcow_wipe();\n }\n}\n\n/*\n * Wipe the storage\n */\nvoid norcow_wipe(void) {\n norcow_erase(0, sectrue);\n for (uint8_t i = 1; i < NORCOW_SECTOR_COUNT; i++) {\n norcow_erase(i, secfalse);\n }\n norcow_active_sector = 0;\n norcow_active_offset = NORCOW_MAGIC_LEN;\n}\n\n/*\n * Looks for the given key, returns status of the operation\n */\nsecbool norcow_get(uint16_t key, const void **val, uint16_t *len) {\n return find_item(norcow_active_sector, key, val, len);\n}\n\n/*\n * Sets the given key, returns status of the operation\n */\nsecbool norcow_set(uint16_t key, const void *val, uint16_t len) {\n // check whether there is enough free space\n // and compact if full\n if (norcow_active_offset + sizeof(uint32_t) + len > NORCOW_SECTOR_SIZE) {\n compact();\n }\n // write item\n uint32_t pos;\n secbool r = write_item(norcow_active_sector, norcow_active_offset, key, val,\n len, &pos);\n if (sectrue == r) {\n norcow_active_offset = pos;\n }\n return r;\n}\n\n/*\n * Update a word in flash at the given pointer. The pointer must point\n * into the NORCOW area.\n */\nsecbool norcow_update(uint16_t key, uint16_t offset, uint32_t value) {\n const void *ptr;\n uint16_t len;\n if (sectrue != find_item(norcow_active_sector, key, &ptr, &len)) {\n return secfalse;\n }\n if ((offset & 3) != 0 || offset >= len) {\n return secfalse;\n }\n uint32_t sector_offset =\n (const uint8_t *)ptr -\n (const uint8_t *)norcow_ptr(norcow_active_sector, 0, NORCOW_SECTOR_SIZE) +\n offset;\n ensure(flash_unlock(), NULL);\n ensure(flash_write_word(norcow_sectors[norcow_active_sector], sector_offset,\n value),\n NULL);\n ensure(flash_lock(), NULL);\n return sectrue;\n}\n"} +{"text": "# 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# see kafka.server.KafkaConfig for additional details and defaults\n\n############################# Server Basics #############################\n\n# The id of the broker. This must be set to a unique integer for each broker.\nbroker.id={broker_id}\n\n############################# Socket Server Settings #############################\n\nlisteners={transport}://{host}:{port}\nsecurity.inter.broker.protocol={transport}\n\n{sasl_config}\n\nssl.keystore.location={ssl_dir}/kafka.server.keystore.jks\nssl.keystore.password=foobar\nssl.key.password=foobar\nssl.truststore.location={ssl_dir}/kafka.server.truststore.jks\nssl.truststore.password=foobar\n\nauthorizer.class.name=kafka.security.auth.SimpleAclAuthorizer\nallow.everyone.if.no.acl.found=true\n\n# The port the socket server listens on\n#port=9092\n\n# Hostname the broker will bind to. If not set, the server will bind to all interfaces\n#host.name=localhost\n\n# Hostname the broker will advertise to producers and consumers. If not set, it uses the\n# value for \"host.name\" if configured. Otherwise, it will use the value returned from\n# java.net.InetAddress.getCanonicalHostName().\n#advertised.host.name=\n\n# The port to publish to ZooKeeper for clients to use. If this is not set,\n# it will publish the same port that the broker binds to.\n#advertised.port=\n\n# The number of threads handling network requests\nnum.network.threads=3\n \n# The number of threads doing disk I/O\nnum.io.threads=8\n\n# The send buffer (SO_SNDBUF) used by the socket server\nsocket.send.buffer.bytes=102400\n\n# The receive buffer (SO_RCVBUF) used by the socket server\nsocket.receive.buffer.bytes=102400\n\n# The maximum size of a request that the socket server will accept (protection against OOM)\nsocket.request.max.bytes=104857600\n\n\n############################# Log Basics #############################\n\n# A comma seperated list of directories under which to store log files\nlog.dirs={tmp_dir}/data\n\n# The default number of log partitions per topic. More partitions allow greater\n# parallelism for consumption, but this will also result in more files across\n# the brokers.\nnum.partitions={partitions}\ndefault.replication.factor={replicas}\n\n## Short Replica Lag -- Drops failed brokers out of ISR\nreplica.lag.time.max.ms=1000\nreplica.socket.timeout.ms=1000\n\n############################# Log Flush Policy #############################\n\n# Messages are immediately written to the filesystem but by default we only fsync() to sync\n# the OS cache lazily. The following configurations control the flush of data to disk. \n# There are a few important trade-offs here:\n# 1. Durability: Unflushed data may be lost if you are not using replication.\n# 2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush.\n# 3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to exceessive seeks. \n# The settings below allow one to configure the flush policy to flush data after a period of time or\n# every N messages (or both). This can be done globally and overridden on a per-topic basis.\n\n# The number of messages to accept before forcing a flush of data to disk\n#log.flush.interval.messages=10000\n\n# The maximum amount of time a message can sit in a log before we force a flush\n#log.flush.interval.ms=1000\n\n############################# Log Retention Policy #############################\n\n# The following configurations control the disposal of log segments. The policy can\n# be set to delete segments after a period of time, or after a given size has accumulated.\n# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens\n# from the end of the log.\n\n# The minimum age of a log file to be eligible for deletion\nlog.retention.hours=168\n\n# A size-based retention policy for logs. Segments are pruned from the log as long as the remaining\n# segments don't drop below log.retention.bytes.\n#log.retention.bytes=1073741824\n\n# The maximum size of a log segment file. When this size is reached a new log segment will be created.\nlog.segment.bytes=1073741824\n\n# The interval at which log segments are checked to see if they can be deleted according \n# to the retention policies\nlog.retention.check.interval.ms=300000\n\n# By default the log cleaner is disabled and the log retention policy will default to just delete segments after their retention expires.\n# If log.cleaner.enable=true is set the cleaner will be enabled and individual logs can then be marked for log compaction.\nlog.cleaner.enable=false\n\n# tune down offset topics to reduce setup time in tests\noffsets.commit.timeout.ms=500\noffsets.topic.num.partitions=2\noffsets.topic.replication.factor=1\n\n# Allow shorter session timeouts for tests\ngroup.min.session.timeout.ms=1000\n\n\n############################# Zookeeper #############################\n\n# Zookeeper connection string (see zookeeper docs for details).\n# This is a comma separated host:port pairs, each corresponding to a zk\n# server. e.g. \"127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002\".\n# You can also append an optional chroot string to the urls to specify the\n# root directory for all kafka znodes.\nzookeeper.connect={zk_host}:{zk_port}/{zk_chroot}\n\n# Timeout in ms for connecting to zookeeper\nzookeeper.connection.timeout.ms=30000\n# We want to expire kafka broker sessions quickly when brokers die b/c we restart them quickly\nzookeeper.session.timeout.ms=500\n"} +{"text": "package reflect2\n\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n)\n\ntype UnsafeStructField struct {\n\treflect.StructField\n\tstructType *UnsafeStructType\n\trtype unsafe.Pointer\n\tptrRType unsafe.Pointer\n}\n\nfunc newUnsafeStructField(structType *UnsafeStructType, structField reflect.StructField) *UnsafeStructField {\n\treturn &UnsafeStructField{\n\t\tStructField: structField,\n\t\trtype: unpackEFace(structField.Type).data,\n\t\tptrRType: unpackEFace(reflect.PtrTo(structField.Type)).data,\n\t\tstructType: structType,\n\t}\n}\n\nfunc (field *UnsafeStructField) Offset() uintptr {\n\treturn field.StructField.Offset\n}\n\nfunc (field *UnsafeStructField) Name() string {\n\treturn field.StructField.Name\n}\n\nfunc (field *UnsafeStructField) PkgPath() string {\n\treturn field.StructField.PkgPath\n}\n\nfunc (field *UnsafeStructField) Type() Type {\n\treturn field.structType.cfg.Type2(field.StructField.Type)\n}\n\nfunc (field *UnsafeStructField) Tag() reflect.StructTag {\n\treturn field.StructField.Tag\n}\n\nfunc (field *UnsafeStructField) Index() []int {\n\treturn field.StructField.Index\n}\n\nfunc (field *UnsafeStructField) Anonymous() bool {\n\treturn field.StructField.Anonymous\n}\n\nfunc (field *UnsafeStructField) Set(obj interface{}, value interface{}) {\n\tobjEFace := unpackEFace(obj)\n\tassertType(\"StructField.SetIndex argument 1\", field.structType.ptrRType, objEFace.rtype)\n\tvalueEFace := unpackEFace(value)\n\tassertType(\"StructField.SetIndex argument 2\", field.ptrRType, valueEFace.rtype)\n\tfield.UnsafeSet(objEFace.data, valueEFace.data)\n}\n\nfunc (field *UnsafeStructField) UnsafeSet(obj unsafe.Pointer, value unsafe.Pointer) {\n\tfieldPtr := add(obj, field.StructField.Offset, \"same as non-reflect &v.field\")\n\ttypedmemmove(field.rtype, fieldPtr, value)\n}\n\nfunc (field *UnsafeStructField) Get(obj interface{}) interface{} {\n\tobjEFace := unpackEFace(obj)\n\tassertType(\"StructField.GetIndex argument 1\", field.structType.ptrRType, objEFace.rtype)\n\tvalue := field.UnsafeGet(objEFace.data)\n\treturn packEFace(field.ptrRType, value)\n}\n\nfunc (field *UnsafeStructField) UnsafeGet(obj unsafe.Pointer) unsafe.Pointer {\n\treturn add(obj, field.StructField.Offset, \"same as non-reflect &v.field\")\n}\n"} +{"text": "ba = new BankAccount;\n }\n\n /**\n * @covers BankAccount::getBalance\n */\n public function testBalanceIsInitiallyZero()\n {\n $this->assertEquals(0, $this->ba->getBalance());\n }\n\n /**\n * @covers BankAccount::withdrawMoney\n */\n public function testBalanceCannotBecomeNegative()\n {\n try {\n $this->ba->withdrawMoney(1);\n } catch (RuntimeException $e) {\n $this->assertEquals(0, $this->ba->getBalance());\n\n return;\n }\n\n $this->fail();\n }\n\n /**\n * @covers BankAccount::depositMoney\n */\n public function testBalanceCannotBecomeNegative2()\n {\n try {\n $this->ba->depositMoney(-1);\n } catch (RuntimeException $e) {\n $this->assertEquals(0, $this->ba->getBalance());\n\n return;\n }\n\n $this->fail();\n }\n\n /**\n * @covers BankAccount::getBalance\n * @covers BankAccount::depositMoney\n * @covers BankAccount::withdrawMoney\n */\n public function testDepositWithdrawMoney()\n {\n $this->assertEquals(0, $this->ba->getBalance());\n $this->ba->depositMoney(1);\n $this->assertEquals(1, $this->ba->getBalance());\n $this->ba->withdrawMoney(1);\n $this->assertEquals(0, $this->ba->getBalance());\n }\n}\n"} +{"text": "/**\n * Derived from the nVIDIA CUDA 8.0 samples by\n *\n * Eyal Rozenberg \n *\n * The derivation is specifically permitted in the nVIDIA CUDA Samples EULA\n * and the deriver is the owner of this code according to the EULA.\n *\n * Use this reasonably. If you want to discuss licensing formalities, please\n * contact the deriving author.\n *\n *\n * This sample illustrates the usage of CUDA streams for overlapping\n * kernel execution with device/host memcopies. The kernel is used to\n * initialize an array to a specific value, after which the array is\n * copied to the host (CPU) memory. To increase performance, multiple\n * kernel/memcopy pairs are launched asynchronously, each pair in its\n * own stream. Devices with Compute Capability 1.1 can overlap a kernel\n * and a memcopy as long as they are issued in different streams. Kernels\n * are serialized. Thus, if n pairs are launched, streamed approach\n * can reduce the memcopy cost to the (1/n)th of a single copy of the entire\n * data set.\n *\n * Additionally, this sample uses CUDA events to measure elapsed time for\n * CUDA calls. Events are a part of CUDA API and provide a system independent\n * way to measure execution times on CUDA devices with approximately 0.5\n * microsecond precision.\n *\n * Elapsed times are averaged over nreps repetitions (10 by default).\n *\n */\n\n#ifndef EXIT_WAIVED\n#define EXIT_WAIVED 2\n#endif\n\nconst char *sSDKsample = \"simpleStreams\";\n\nconst char *sEventSyncMethod[] =\n{\n\t\"cudaEventDefault\",\n\t\"cudaEventBlockingSync\",\n\t\"cudaEventDisableTiming\",\n\tNULL\n};\n\nconst char *sDeviceSyncMethod[] =\n{\n\t\"cudaDeviceScheduleAuto\",\n\t\"cudaDeviceScheduleSpin\",\n\t\"cudaDeviceScheduleYield\",\n\t\"INVALID\",\n\t\"cudaDeviceScheduleBlockingSync\",\n\tNULL\n};\n\n// System includes\n\n// CUDA runtime\n#include \"cuda_runtime.h\"\n\n// helper functions and utilities to work with CUDA\n#include \"../helper_cuda.h\"\n\n#include \n\n#ifndef WIN32\n#include // for mmap() / munmap()\n#endif\n\n#include \n\n#include \n#include \n#include \n#include \n\n\n// Macro to aligned up to the memory size in question\n#define MEMORY_ALIGNMENT 4096\n#define ALIGN_UP(x,size) ( ((size_t)x+(size-1))&(~(size-1)) )\n\n__global__ void init_array(int *g_data, int *factor, int num_iterations)\n{\n\tint idx = blockIdx.x * blockDim.x + threadIdx.x;\n\n\tfor (int i=0; i n=\" << sSyncMethod[4] << \"\\n\"\n\t\t<< \"\\t--use_generic_memory (default) use generic page-aligned for system memory\\n\"\n\t\t<< \"\\t--use_cuda_malloc_host (optional) use cudaMallocHost to allocate system memory\\n\";\n}\n\nint main(int argc, char **argv)\n{\n\tint nstreams = 4; // number of streams for CUDA calls\n\tint nreps = 10; // number of times each experiment is repeated\n\tint n = 16 * 1024 * 1024; // number of ints in the data set\n\tint nbytes = n * sizeof(int); // number of data bytes\n\tdim3 threads, blocks; // kernel launch configuration\n\tfloat scale_factor = 1.0f;\n\n\t// allocate generic memory and pin it laster instead of using cudaHostAlloc()\n\n\tint device_sync_method = cudaDeviceBlockingSync; // by default we use BlockingSync\n\n\tint niterations; // number of iterations for the loop inside the kernel\n\n\tif (checkCmdLineFlag(argc, (const char **)argv, \"help\"))\n\t{\n\t\tprintHelp();\n\t\treturn EXIT_SUCCESS;\n\t}\n\n\tif ((device_sync_method = getCmdLineArgumentInt(argc, (const char **)argv, \"sync_method\")) >= 0)\n\t{\n\t\tif (device_sync_method == 0 || device_sync_method == 1 || device_sync_method == 2 || device_sync_method == 4)\n\t\t{\n\t\t\tstd::cout << \"Device synchronization method set to = \" << sSyncMethod[device_sync_method] << \"\\n\";\n\t\t\tstd::cout << \"Setting reps to 100 to demonstrate steady state\\n\";\n\t\t\tnreps = 100;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstd::cout << \"Invalid command line option sync_method=\\\"\" << device_sync_method << \"\\\"\\n\";\n\t\t\treturn EXIT_FAILURE;\n\t\t}\n\t}\n\telse\n\t{\n\t\tprintHelp();\n\t\treturn EXIT_SUCCESS;\n\t}\n\n\tif (checkCmdLineFlag(argc, (const char **)argv, \"use_cuda_malloc_host\"))\n\t{\n\t\tstd::cout\n\t\t\t<< \"To simplify this example, support for using cuda_malloc_host instead of \"\n\t\t\t<< \"pinned memory has been dropped.\\n\";\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tstd::cout << \"\\n> \";\n\tchooseCudaDevice(argc, (const char **)argv);\n\tauto current_device = cuda::device::current::get();\n\n\t// Checking for compute capabilities\n\tauto properties = current_device.properties();\n\tauto compute_capability = properties.compute_capability();\n\n\tif (compute_capability < cuda::device::compute_capability_t({1, 1}) ) {\n\t\tstd::cout << properties.name << \" does not have Compute Capability 1.1 or newer. Reducing workload.\\n\";\n\t}\n\n\tif (compute_capability.major() >= 2) {\n\t\tniterations = 5;\n\t} else {\n\t\tif (compute_capability.minor() > 1) {\n\t\t\tniterations = 5;\n\t\t} else {\n\t\t\tniterations = 1; // reduced workload for compute capability 1.0 and 1.1\n\t\t}\n\t}\n\n\t// Check if GPU can map host memory (Generic Method), if not then we override bPinGenericMemory to be false\n\tstd::cout << \"Device: <\" << properties.name << \"> canMapHostMemory: \"\n\t\t\t<< (properties.canMapHostMemory ? \"Yes\" : \"No\") << \"\\n\";\n\n\tif (not properties.can_map_host_memory())\n\t{\n\t\tstd::cout << \"Cannot allocate pinned memory (and map GPU device memory to it); aborting.\\n\";\n\t\treturn EXIT_FAILURE;\n\t}\n\n\t// Anything that is less than 32 Cores will have scaled down workload\n\tauto faux_cores_per_sm = compute_capability.max_in_flight_threads_per_processor();\n\tauto faux_cores_overall = properties.max_in_flight_threads_on_device();\n\tscale_factor = max((32.0f / faux_cores_overall), 1.0f);\n\tn = (int)rint((float)n / scale_factor);\n\n\tstd::cout << \"> CUDA Capable: SM \" << compute_capability.major() << \".\" << compute_capability.minor() << \" hardware\\n\";\n\tstd::cout\n\t\t<< \"> \" << properties.multiProcessorCount << \" Multiprocessor(s)\"\n\t\t<< \" x \" << faux_cores_per_sm << \" (Cores/Multiprocessor) = \"\n\t\t<< faux_cores_overall << \" (Cores)\\n\";\n\n\tstd::cout << \"> scale_factor = \" << 1.0f/scale_factor << \"\\n\";\n\tstd::cout << \"> array_size = \" << n << \"\\n\\n\";\n\n\t// enable use of blocking sync, to reduce CPU usage\n\tstd::cout << \"> Using CPU/GPU Device Synchronization method \" << sDeviceSyncMethod[device_sync_method] << \"\\n\";\n\n\tcuda::host_thread_synch_scheduling_policy_t policy;\n\tswitch(device_sync_method) {\n\tcase 0: policy = cuda::heuristic; break;\n\tcase 1: policy = cuda::spin; break;\n\tcase 2: policy = cuda::yield; break;\n\tcase 4: policy = cuda::block; break;\n\tdefault: // should not be able to get here\n\t\texit(EXIT_FAILURE);\n\t}\n\tcurrent_device.set_synch_scheduling_policy(policy);\n\tcurrent_device.enable_mapping_host_memory();\n\n\t// allocate host memory\n\tint c = 5; // value to which the array will be initialized\n\n\t// Allocate Host memory\n\tauto h_a = cuda::memory::host::make_unique(n);\n\n\t// allocate device memory\n\t// pointers to data and init value in the device memory\n\tauto d_a = cuda::memory::device::make_unique(current_device, n);\n\tauto d_c = cuda::memory::device::make_unique(current_device);\n\tcuda::memory::copy_single(d_c.get(), &c);\n\n\tstd::cout << \"\\nStarting Test\\n\";\n\n\t// allocate and initialize an array of stream handles\n\tstd::vector streams;\n\tstd::generate_n(\n\t\tstd::back_inserter(streams), nstreams,\n\t\t[¤t_device]() {\n\t\t\t// Note: we could omit the specific requirement of synchronization\n\t\t\t// with the default stream, since that's the CUDA default - but I\n\t\t\t// think it's important to state that's the case\n\t\t\treturn current_device.create_stream(\n\t\t\t\tcuda::stream::implicitly_synchronizes_with_default_stream);\n\t\t}\n\t);\n\n\t// create CUDA event handles\n\t// use blocking sync\n\tauto use_blocking_sync = (device_sync_method == cudaDeviceBlockingSync);\n\n\tauto start_event = cuda::event::create(current_device, use_blocking_sync);\n\tauto stop_event = cuda::event::create(current_device, use_blocking_sync);\n\n\t// time memcopy from device\n\tstart_event.record(); // record on the default stream, to ensure that all previous CUDA calls have completed\n\tcuda::memory::async::copy(h_a.get(), d_a.get(), nbytes, streams[0]);\n\tstop_event.record();\n\tstop_event.synchronize(); // block until the event is actually recorded\n\tauto time_memcpy = cuda::event::time_elapsed_between(start_event, stop_event);\n\tstd::cout << \"memcopy:\\t\" << time_memcpy.count() << \"\\n\";\n\n\t// time kernel\n\tthreads=dim3(512, 1);\n\tblocks=dim3(n / threads.x, 1);\n\tstart_event.record();\n\tinit_array<<>>(d_a.get(), d_c.get(), niterations);\n\tstop_event.record();\n\tstop_event.synchronize();\n\tauto time_kernel = cuda::event::time_elapsed_between(start_event, stop_event);\n\tstd::cout << \"kernel:\\t\\t\" << time_kernel.count() << \"\\n\";\n\n\t//////////////////////////////////////////////////////////////////////\n\t// time non-streamed execution for reference\n\tthreads=dim3(512, 1);\n\tblocks=dim3(n / threads.x, 1);\n\tstart_event.record();\n\n\tfor (int k = 0; k < nreps; k++)\n\t{\n\t\tinit_array<<>>(d_a.get(), d_c.get(), niterations);\n\t\tcuda::memory::copy(h_a.get(), d_a.get(), nbytes);\n\t}\n\n\tstop_event.record();\n\tstop_event.synchronize();\n\tauto elapsed_time = cuda::event::time_elapsed_between(start_event, stop_event);\n\tstd::cout << \"non-streamed:\\t\" << elapsed_time.count() / nreps << \"\\n\";\n\n\t//////////////////////////////////////////////////////////////////////\n\t// time execution with nstreams streams\n\tthreads=dim3(512,1);\n\tblocks=dim3(n/(nstreams*threads.x),1);\n\tmemset(h_a.get(), 255, nbytes); // set host memory bits to all 1s, for testing correctness\n\tcuda::memory::device::zero(d_a.get(), nbytes); // set device memory to all 0s, for testing correctness\n\tstart_event.record();\n\n\tfor (int k = 0; k < nreps; k++)\n\t{\n\t\t// asynchronously launch nstreams kernels, each operating on its own portion of data\n\t\tfor (int i = 0; i < nstreams; i++)\n\t\t{\n\t\t\tinit_array<<>>(d_a.get() + i *n / nstreams, d_c.get(), niterations);\n\t\t}\n\n\t\t// asynchronously launch nstreams memcopies. Note that memcopy in stream x will only\n\t\t// commence executing when all previous CUDA calls in stream x have completed\n\t\tfor (int i = 0; i < nstreams; i++)\n\t\t{\n\t\t\tcuda::memory::async::copy(\n\t\t\t\th_a.get() + i * n / nstreams,\n\t\t\t\td_a.get() + i * n / nstreams, nbytes / nstreams,\n\t\t\t\tstreams[i]);\n\t\t}\n\t}\n\n\tstop_event.record();\n\tstop_event.synchronize();\n\telapsed_time = cuda::event::time_elapsed_between(start_event, stop_event);\n\tstd::cout << nstreams <<\" streams:\\t\" << elapsed_time.count() / nreps << \"\\n\";\n\n\t// check whether the output is correct\n\tstd::cout << \"-------------------------------\\n\";\n\tbool bResults = correct_data(h_a.get(), n, c*nreps*niterations);\n\n\tstd::cout << (bResults ? \"SUCCESS\" : \"FAILURE\") << \"\\n\";\n\treturn bResults ? EXIT_SUCCESS : EXIT_FAILURE;\n}\n"} +{"text": "/*\n * BLEAdvertising.h\n *\n * Created on: Jun 21, 2017\n * Author: kolban\n */\n\n#ifndef COMPONENTS_CPP_UTILS_BLEADVERTISING_H_\n#define COMPONENTS_CPP_UTILS_BLEADVERTISING_H_\n#include \"sdkconfig.h\"\n#if defined(CONFIG_BT_ENABLED)\n#include \n#include \"BLEUUID.h\"\n#include \n#include \"FreeRTOS.h\"\n\n/**\n * @brief Advertisement data set by the programmer to be published by the %BLE server.\n */\nclass BLEAdvertisementData {\n\t// Only a subset of the possible BLE architected advertisement fields are currently exposed. Others will\n\t// be exposed on demand/request or as time permits.\n\t//\npublic:\n\tvoid setAppearance(uint16_t appearance);\n\tvoid setCompleteServices(BLEUUID uuid);\n\tvoid setFlags(uint8_t);\n\tvoid setManufacturerData(std::string data);\n\tvoid setName(std::string name);\n\tvoid setPartialServices(BLEUUID uuid);\n\tvoid setServiceData(BLEUUID uuid, std::string data);\n\tvoid setShortName(std::string name);\n\tvoid addData(std::string data); // Add data to the payload.\n\tstd::string getPayload(); // Retrieve the current advert payload.\n\nprivate:\n\tfriend class BLEAdvertising;\n\tstd::string m_payload; // The payload of the advertisement.\n}; // BLEAdvertisementData\n\n\n/**\n * @brief Perform and manage %BLE advertising.\n *\n * A %BLE server will want to perform advertising in order to make itself known to %BLE clients.\n */\nclass BLEAdvertising {\npublic:\n\tBLEAdvertising();\n\tvoid addServiceUUID(BLEUUID serviceUUID);\n\tvoid addServiceUUID(const char* serviceUUID);\n\tvoid start();\n\tvoid stop();\n\tvoid setAppearance(uint16_t appearance);\n\tvoid setMaxInterval(uint16_t maxinterval);\n\tvoid setMinInterval(uint16_t mininterval);\n\tvoid setAdvertisementData(BLEAdvertisementData& advertisementData);\n\tvoid setScanFilter(bool scanRequertWhitelistOnly, bool connectWhitelistOnly);\n\tvoid setScanResponseData(BLEAdvertisementData& advertisementData);\n\tvoid setPrivateAddress(esp_ble_addr_type_t type = BLE_ADDR_TYPE_RANDOM);\n\n\tvoid handleGAPEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t* param);\n\tvoid setMinPreferred(uint16_t);\n\tvoid setMaxPreferred(uint16_t);\n\tvoid setScanResponse(bool);\n\nprivate:\n\tesp_ble_adv_data_t m_advData;\n\tesp_ble_adv_params_t m_advParams;\n\tstd::vector m_serviceUUIDs;\n\tbool m_customAdvData = false; // Are we using custom advertising data?\n\tbool m_customScanResponseData = false; // Are we using custom scan response data?\n\tFreeRTOS::Semaphore m_semaphoreSetAdv = FreeRTOS::Semaphore(\"startAdvert\");\n\tbool\t\t\t\tm_scanResp = true;\n\n};\n#endif /* CONFIG_BT_ENABLED */\n#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ */"} +{"text": "'use strict'\nmodule.exports = app => {\n const { STRING } = app.Sequelize\n const Category = app.model.define('Category', {\n name: STRING(20)\n })\n return Category\n}\n"} +{"text": "{\n \"@context\": {\"ex\": \"http://example.org/\"},\n \"ex:p\": {\n \"ex:q\": {}\n }\n}"} +{"text": "!00 U+0000 .notdef\n!01 U+0001 .notdef\n!02 U+0002 .notdef\n!03 U+0003 .notdef\n!04 U+0004 .notdef\n!05 U+0005 .notdef\n!06 U+0006 .notdef\n!07 U+0007 .notdef\n!08 U+0008 .notdef\n!09 U+0009 .notdef\n!0A U+000A .notdef\n!0B U+000B .notdef\n!0C U+000C .notdef\n!0D U+000D .notdef\n!0E U+000E .notdef\n!0F U+000F .notdef\n!10 U+0010 .notdef\n!11 U+0011 .notdef\n!12 U+0012 .notdef\n!13 U+0013 .notdef\n!14 U+0014 .notdef\n!15 U+0015 .notdef\n!16 U+0016 .notdef\n!17 U+0017 .notdef\n!18 U+0018 .notdef\n!19 U+0019 .notdef\n!1A U+001A .notdef\n!1B U+001B .notdef\n!1C U+001C .notdef\n!1D U+001D .notdef\n!1E U+001E .notdef\n!1F U+001F .notdef\n!20 U+0020 space\n!21 U+0021 exclam\n!22 U+0022 quotedbl\n!23 U+0023 numbersign\n!24 U+0024 dollar\n!25 U+0025 percent\n!26 U+0026 ampersand\n!27 U+0027 quotesingle\n!28 U+0028 parenleft\n!29 U+0029 parenright\n!2A U+002A asterisk\n!2B U+002B plus\n!2C U+002C comma\n!2D U+002D hyphen\n!2E U+002E period\n!2F U+002F slash\n!30 U+0030 zero\n!31 U+0031 one\n!32 U+0032 two\n!33 U+0033 three\n!34 U+0034 four\n!35 U+0035 five\n!36 U+0036 six\n!37 U+0037 seven\n!38 U+0038 eight\n!39 U+0039 nine\n!3A U+003A colon\n!3B U+003B semicolon\n!3C U+003C less\n!3D U+003D equal\n!3E U+003E greater\n!3F U+003F question\n!40 U+0040 at\n!41 U+0041 A\n!42 U+0042 B\n!43 U+0043 C\n!44 U+0044 D\n!45 U+0045 E\n!46 U+0046 F\n!47 U+0047 G\n!48 U+0048 H\n!49 U+0049 I\n!4A U+004A J\n!4B U+004B K\n!4C U+004C L\n!4D U+004D M\n!4E U+004E N\n!4F U+004F O\n!50 U+0050 P\n!51 U+0051 Q\n!52 U+0052 R\n!53 U+0053 S\n!54 U+0054 T\n!55 U+0055 U\n!56 U+0056 V\n!57 U+0057 W\n!58 U+0058 X\n!59 U+0059 Y\n!5A U+005A Z\n!5B U+005B bracketleft\n!5C U+005C backslash\n!5D U+005D bracketright\n!5E U+005E asciicircum\n!5F U+005F underscore\n!60 U+0060 grave\n!61 U+0061 a\n!62 U+0062 b\n!63 U+0063 c\n!64 U+0064 d\n!65 U+0065 e\n!66 U+0066 f\n!67 U+0067 g\n!68 U+0068 h\n!69 U+0069 i\n!6A U+006A j\n!6B U+006B k\n!6C U+006C l\n!6D U+006D m\n!6E U+006E n\n!6F U+006F o\n!70 U+0070 p\n!71 U+0071 q\n!72 U+0072 r\n!73 U+0073 s\n!74 U+0074 t\n!75 U+0075 u\n!76 U+0076 v\n!77 U+0077 w\n!78 U+0078 x\n!79 U+0079 y\n!7A U+007A z\n!7B U+007B braceleft\n!7C U+007C bar\n!7D U+007D braceright\n!7E U+007E asciitilde\n!7F U+007F .notdef\n!80 U+0080 .notdef\n!81 U+0081 .notdef\n!82 U+0082 .notdef\n!83 U+0083 .notdef\n!84 U+0084 .notdef\n!85 U+0085 .notdef\n!86 U+0086 .notdef\n!87 U+0087 .notdef\n!88 U+0088 .notdef\n!89 U+0089 .notdef\n!8A U+008A .notdef\n!8B U+008B .notdef\n!8C U+008C .notdef\n!8D U+008D .notdef\n!8E U+008E .notdef\n!8F U+008F .notdef\n!90 U+0090 .notdef\n!91 U+0091 .notdef\n!92 U+0092 .notdef\n!93 U+0093 .notdef\n!94 U+0094 .notdef\n!95 U+0095 .notdef\n!96 U+0096 .notdef\n!97 U+0097 .notdef\n!98 U+0098 .notdef\n!99 U+0099 .notdef\n!9A U+009A .notdef\n!9B U+009B .notdef\n!9C U+009C .notdef\n!9D U+009D .notdef\n!9E U+009E .notdef\n!9F U+009F .notdef\n!A0 U+00A0 space\n!A1 U+0E01 kokaithai\n!A2 U+0E02 khokhaithai\n!A3 U+0E03 khokhuatthai\n!A4 U+0E04 khokhwaithai\n!A5 U+0E05 khokhonthai\n!A6 U+0E06 khorakhangthai\n!A7 U+0E07 ngonguthai\n!A8 U+0E08 chochanthai\n!A9 U+0E09 chochingthai\n!AA U+0E0A chochangthai\n!AB U+0E0B sosothai\n!AC U+0E0C chochoethai\n!AD U+0E0D yoyingthai\n!AE U+0E0E dochadathai\n!AF U+0E0F topatakthai\n!B0 U+0E10 thothanthai\n!B1 U+0E11 thonangmonthothai\n!B2 U+0E12 thophuthaothai\n!B3 U+0E13 nonenthai\n!B4 U+0E14 dodekthai\n!B5 U+0E15 totaothai\n!B6 U+0E16 thothungthai\n!B7 U+0E17 thothahanthai\n!B8 U+0E18 thothongthai\n!B9 U+0E19 nonuthai\n!BA U+0E1A bobaimaithai\n!BB U+0E1B poplathai\n!BC U+0E1C phophungthai\n!BD U+0E1D fofathai\n!BE U+0E1E phophanthai\n!BF U+0E1F fofanthai\n!C0 U+0E20 phosamphaothai\n!C1 U+0E21 momathai\n!C2 U+0E22 yoyakthai\n!C3 U+0E23 roruathai\n!C4 U+0E24 ruthai\n!C5 U+0E25 lolingthai\n!C6 U+0E26 luthai\n!C7 U+0E27 wowaenthai\n!C8 U+0E28 sosalathai\n!C9 U+0E29 sorusithai\n!CA U+0E2A sosuathai\n!CB U+0E2B hohipthai\n!CC U+0E2C lochulathai\n!CD U+0E2D oangthai\n!CE U+0E2E honokhukthai\n!CF U+0E2F paiyannoithai\n!D0 U+0E30 saraathai\n!D1 U+0E31 maihanakatthai\n!D2 U+0E32 saraaathai\n!D3 U+0E33 saraamthai\n!D4 U+0E34 saraithai\n!D5 U+0E35 saraiithai\n!D6 U+0E36 sarauethai\n!D7 U+0E37 saraueethai\n!D8 U+0E38 sarauthai\n!D9 U+0E39 sarauuthai\n!DA U+0E3A phinthuthai\n!DF U+0E3F bahtthai\n!E0 U+0E40 saraethai\n!E1 U+0E41 saraaethai\n!E2 U+0E42 saraothai\n!E3 U+0E43 saraaimaimuanthai\n!E4 U+0E44 saraaimaimalaithai\n!E5 U+0E45 lakkhangyaothai\n!E6 U+0E46 maiyamokthai\n!E7 U+0E47 maitaikhuthai\n!E8 U+0E48 maiekthai\n!E9 U+0E49 maithothai\n!EA U+0E4A maitrithai\n!EB U+0E4B maichattawathai\n!EC U+0E4C thanthakhatthai\n!ED U+0E4D nikhahitthai\n!EE U+0E4E yamakkanthai\n!EF U+0E4F fongmanthai\n!F0 U+0E50 zerothai\n!F1 U+0E51 onethai\n!F2 U+0E52 twothai\n!F3 U+0E53 threethai\n!F4 U+0E54 fourthai\n!F5 U+0E55 fivethai\n!F6 U+0E56 sixthai\n!F7 U+0E57 seventhai\n!F8 U+0E58 eightthai\n!F9 U+0E59 ninethai\n!FA U+0E5A angkhankhuthai\n!FB U+0E5B khomutthai\n"} +{"text": "Core Tutorials: New Users Start Here!\n-------------------------------------\n\nIf you're new to gensim, we recommend going through all core tutorials in order.\nUnderstanding this functionality is vital for using gensim effectively.\n"} +{"text": "##########################################\n# Copy this file to /boot/moodecfg.txt\n# It will be processed at startup and the\n# system will automaticly Restart.\n#\n# All param=value pairs must be present.\n# Set wlanssid= blank to start AP mode.\n# Example: wlanssid=\n##########################################\n\n[names]\nhostname=moode\nbrowsertitle=moOde Player\nairplayname=Moode Airplay\nspotifyname=Moode Spotify\nbluetoothname=Moode Bluetooth\nsqueezelitename=Moode\nupnpname=Moode UPNP\ndlnaname=Moode DLNA\n\n[system]\ntimezone=America/Detroit\nkeyboard=us\ncpugov=On-demand\nhdmiport=1\neth0chk=1\nlocalui=0\n\n[device]\ni2sdevice=None\n\n[renderers]\nbtsvc=0\npairing_agent=0\nrsmafterbt=No\nairplaysvc=0\nrsmafterapl=No\nspotifysvc=0\nrsmafterspot=No\nslsvc=0\nrsmaftersl=No\n\n[upnp/dlna]\nupnpsvc=0\ndlnasvc=0\nupnp_browser=0\n\n[network]\nwlanssid=MySSID\nwlansec=wpa\nwlanpwd=MyPassword\nwlancountry=US\napdssid=Moode\napdchan=6\napdpwd=moodeaudio\n\n[theme & background]\nthemename=Default\naccentcolor=Emerald\nalphablend=1.0\nadaptive=No\ncover_backdrop=No\ncover_blur=20px\ncover_scale=1.25\n\n[other]\nfont_size=Normal\nplayhist=No\nfirst_use_help=Yes\n"} +{"text": "#Running the ActiveMQ Artemis JMeter Performance Testing Examples\n\n##Create and run a sample broker for performance testing:\n\n```sh\nartemis create my-broker --queues exampleQueue --topics exampleTopic\n\nmy-broker/bin/artemis run\n```\n##Download and Install JMeter's latest release:\n \nhttps://jmeter.apache.org/download_jmeter.cgi\n \n##Copy artemis-jms-client dependencies under $JMETER_HOME/lib folder:\n\n- artemis-jms-client-all.jar\n\n######Create a jndi.properties file with the connectionFactory:\n\n```\nconnectionFactory.ConnectionFactory=tcp://localhost:61616\n```\n\n######Pack jndi.properties file into a jar file and put it under $JMETER_HOME/lib folder:\n\n```sh\njar -cf artemis-jndi.jar jndi.properties\n```\n\n######Open jMeter and run the available Test Plan examples:\n\n- 1.jms_p2p_test.jmx\n- 2.pub_sub_test.jmx\n"} +{"text": "//\n// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.\n//\n\n#import \n\n@class AVAudioPlayer, NSError;\n\n@protocol AVAudioPlayerDelegate \n\n@optional\n- (void)audioPlayerDecodeErrorDidOccur:(AVAudioPlayer *)arg1 error:(NSError *)arg2;\n- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)arg1 successfully:(BOOL)arg2;\n@end\n\n"} +{"text": "\n\n\n\n\n\nNumberSerializers.DoubleSerializer (jackson-databind 2.6.0 API)\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
\n\n\n
\n
com.fasterxml.jackson.databind.ser.std
\n

Class NumberSerializers.DoubleSerializer

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

      Constructor Detail

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

        DoubleSerializer

        \n
        public DoubleSerializer()
        \n
      • \n
      \n
    • \n
    \n\n
      \n
    • \n\n\n

      Method Detail

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

        isEmpty

        \n
        public boolean isEmpty(SerializerProvider prov,\n                       Object value)
        \n
        Description copied from class: JsonSerializer
        \n
        Method called to check whether given serializable value is\n considered \"empty\" value (for purposes of suppressing serialization\n of empty values).\n

        \n Default implementation will consider only null values to be empty.\n

        \n NOTE: replaces JsonSerializer.isEmpty(Object), deprecated in 2.5

        \n
        \n
        Overrides:
        \n
        isEmpty in class JsonSerializer<Object>
        \n
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        serialize

        \n
        public void serialize(Object value,\n                      com.fasterxml.jackson.core.JsonGenerator gen,\n                      SerializerProvider provider)\n               throws IOException
        \n
        Description copied from class: JsonSerializer
        \n
        Method that can be called to ask implementation to serialize\n values of type this serializer handles.
        \n
        \n
        Specified by:
        \n
        serialize in class StdSerializer<Object>
        \n
        Parameters:
        \n
        value - Value to serialize; can not be null.
        \n
        gen - Generator used to output resulting Json content
        \n
        provider - Provider that can be used to get serializers for\n serializing Objects value contains, if any.
        \n
        Throws:
        \n
        IOException
        \n
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        serializeWithType

        \n
        public void serializeWithType(Object value,\n                              com.fasterxml.jackson.core.JsonGenerator gen,\n                              SerializerProvider provider,\n                              TypeSerializer typeSer)\n                       throws IOException
        \n
        Description copied from class: StdScalarSerializer
        \n
        Default implementation will write type prefix, call regular serialization\n method (since assumption is that value itself does not need JSON\n Array or Object start/end markers), and then write type suffix.\n This should work for most cases; some sub-classes may want to\n change this behavior.
        \n
        \n
        Overrides:
        \n
        serializeWithType in class StdScalarSerializer<Object>
        \n
        Parameters:
        \n
        value - Value to serialize; can not be null.
        \n
        gen - Generator used to output resulting Json content
        \n
        provider - Provider that can be used to get serializers for\n serializing Objects value contains, if any.
        \n
        typeSer - Type serializer to use for including type information
        \n
        Throws:
        \n
        IOException
        \n
        \n
      • \n
      \n
    • \n
    \n
  • \n
\n
\n
\n\n\n\n
\n\n\n\n
\n\n
\n
\n\n\n
\n\n\n
\n\n

Copyright © 2014–2015 FasterXML. All rights reserved.

\n\n\n"} +{"text": "// Copyright 2013 the V8 project authors. All rights reserved.\n// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n//\n// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY\n// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\ndescription(\"KDE JS Test\");\n--> end of HTML comment (not ECMA)\n"} +{"text": "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom ..registry import LOSSES\nfrom .utils import weight_reduce_loss\n\n\ndef cross_entropy(pred, label, weight=None, reduction='mean', avg_factor=None):\n # element-wise losses\n loss = F.cross_entropy(pred, label, reduction='none')\n\n # apply weights and do the reduction\n if weight is not None:\n weight = weight.float()\n loss = weight_reduce_loss(\n loss, weight=weight, reduction=reduction, avg_factor=avg_factor)\n\n return loss\n\n\ndef _expand_binary_labels(labels, label_weights, label_channels):\n bin_labels = labels.new_full((labels.size(0), label_channels), 0)\n inds = torch.nonzero(labels >= 1).squeeze()\n if inds.numel() > 0:\n bin_labels[inds, labels[inds] - 1] = 1\n if label_weights is None:\n bin_label_weights = None\n else:\n bin_label_weights = label_weights.view(-1, 1).expand(\n label_weights.size(0), label_channels)\n return bin_labels, bin_label_weights\n\n\ndef binary_cross_entropy(pred,\n label,\n weight=None,\n reduction='mean',\n avg_factor=None):\n if pred.dim() != label.dim():\n label, weight = _expand_binary_labels(label, weight, pred.size(-1))\n\n # weighted element-wise losses\n if weight is not None:\n weight = weight.float()\n loss = F.binary_cross_entropy_with_logits(\n pred, label.float(), weight, reduction='none')\n # do the reduction for the weighted loss\n loss = weight_reduce_loss(loss, reduction=reduction, avg_factor=avg_factor)\n\n return loss\n\n\ndef mask_cross_entropy(pred, target, label, reduction='mean', avg_factor=None):\n # TODO: handle these two reserved arguments\n assert reduction == 'mean' and avg_factor is None\n num_rois = pred.size()[0]\n inds = torch.arange(0, num_rois, dtype=torch.long, device=pred.device)\n pred_slice = pred[inds, label].squeeze(1)\n return F.binary_cross_entropy_with_logits(\n pred_slice, target, reduction='mean')[None]\n\n\n@LOSSES.register_module\nclass CrossEntropyLoss(nn.Module):\n\n def __init__(self,\n use_sigmoid=False,\n use_mask=False,\n reduction='mean',\n loss_weight=1.0):\n super(CrossEntropyLoss, self).__init__()\n assert (use_sigmoid is False) or (use_mask is False)\n self.use_sigmoid = use_sigmoid\n self.use_mask = use_mask\n self.reduction = reduction\n self.loss_weight = loss_weight\n\n if self.use_sigmoid:\n self.cls_criterion = binary_cross_entropy\n elif self.use_mask:\n self.cls_criterion = mask_cross_entropy\n else:\n self.cls_criterion = cross_entropy\n\n def forward(self,\n cls_score,\n label,\n weight=None,\n avg_factor=None,\n reduction_override=None,\n **kwargs):\n assert reduction_override in (None, 'none', 'mean', 'sum')\n reduction = (\n reduction_override if reduction_override else self.reduction)\n loss_cls = self.loss_weight * self.cls_criterion(\n cls_score,\n label,\n weight,\n reduction=reduction,\n avg_factor=avg_factor,\n **kwargs)\n return loss_cls\n"} +{"text": "[\n {\n \"benchmark_name\": \"Benchmark 1\",\n \"parameter_names\": [\"arg0\", \"arg1\", \"arg2\"],\n \"benchmark_description\": \"First benchmark\",\n \"benchmark_type\": \"Time\",\n \"units\": \"miliseconds\",\n \"lessisbetter\": true,\n \"benchmark_version\": \"second version\",\n \"benchmark_language\": \"Python\"\n },\n {\n \"benchmark_name\": \"Benchmark 2\",\n \"parameter_names\": [\"arg0\", \"arg1\"],\n \"benchmark_description\": \"Description 2.\",\n \"benchmark_type\": \"Time\",\n \"units\": \"nanoseconds\",\n \"lessisbetter\": true,\n \"benchmark_version\": \"second version\",\n \"benchmark_language\": \"Python\"\n },\n {\n \"benchmark_name\": \"Benchmark 3\",\n \"parameter_names\": [\"arg0\"],\n \"benchmark_description\": \"Third benchmark\",\n \"benchmark_type\": \"Memory\",\n \"units\": \"kilobytes\",\n \"lessisbetter\": true,\n \"benchmark_version\": \"1\",\n \"benchmark_language\": \"Python\"\n }\n]\n"} +{"text": "export interface DB {\n replaceSnapshot(context: Context, state: Event): Promise;\n insertEvent(evt: any): Promise;\n getEvents(context: Context, seq?: number): Promise;\n getSnapshot(context: Context): Promise | null;\n}\n\nexport interface Event {\n _id?: string;\n seq?: number;\n isSnapshot?: boolean;\n [key: string]: any;\n}\n\nexport type Context = {\n name: string;\n value: string | number;\n}\n"} +{"text": "/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/*\n * This file is part of the LibreOffice project.\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n *\n * This file incorporates work covered by the following license notice:\n *\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed\n * with this work for additional information regarding copyright\n * ownership. The ASF licenses this file to you under the Apache\n * License, Version 2.0 (the \"License\"); you may not use this file\n * except in compliance with the License. You may obtain a copy of\n * the License at http://www.apache.org/licenses/LICENSE-2.0 .\n */\n\n#ifndef __com_sun_star_sdb_tools_XConnectionTools_idl__\n#define __com_sun_star_sdb_tools_XConnectionTools_idl__\n\n#include \n#include \n\nmodule com { module sun { module star {\n module container {\n interface XNameAccess;\n };\n module lang {\n interface XComponent;\n };\n};};};\nmodule com { module sun { module star { module sdb {\n interface XSingleSelectQueryComposer;\n module tools {\n\ninterface XTableName;\ninterface XObjectNames;\ninterface XDataSourceMetaData;\n\n/** encapsulates various useful functionality around a\n com::sun::star::sdb::Connection\n\n

Most of the functionality provided here is meaningful only relative to\n a given database connection. For instance, for quoting table names, you need\n the meta data instance of the connection. Thus, the entry point for obtaining\n a XConnectionTools instance is the\n com::sun::star::sdb::Connection service.

\n\n

Note that nearly all functionality provided by this interface is also\n available by other means, it's only provided here for convenience purposes.

\n\n @since OOo 2.0.4\n*/\ninterface XConnectionTools\n{\n /** creates an instance supporting the XTableName interface,\n which can be used to manipulate table names for various purposes.\n\n

The returned object is guaranteed to not be `NULL`.

\n */\n XTableName createTableName();\n\n /** returns an instance supporting the XObjectNames interface,\n which provides access to functionality around table and query names.\n\n

The returned object is guaranteed to not be `NULL`.

\n */\n XObjectNames getObjectNames();\n\n /** provides access to the application-level data source meta data\n */\n XDataSourceMetaData\n getDataSourceMetaData();\n\n /** get fields for a result set given by a \"command descriptor\"\n\n

A command descriptor here means:\n

  • a SDB-level connection (com.sun.star.sdb::Connection
  • \n
  • a string specifying the name of an object relative to the connection
  • \n
  • a com.sun.star.sdb::CommandType value specifying the type\n of the object
  • \n
\n

\n\n @param commandType\n the type of the object\n\n @param command\n the object. This may be a table name, a query name, or an SQL statement, depending on the value\n of _nCommandType\n\n @param keepFieldsAlive\n If (and only if) CommandType is CommandType.COMMAND, the fields collection which is returned\n by this function here is a temporary object. It is kept alive by another object, which is to be\n created temporarily, too. To ensure that the fields you get are valid as long as you need them,\n the owner which controls their life time is transferred to this parameter upon return.
\n Your fields live as long as this component lives.
\n Additionally, you are encouraged to dispose this component as soon as you don't need the fields anymore.\n It depends on the connection's implementation if this is necessary, but the is no guarantee, so to\n be on the safe side with respect to resource leaks, you should dispose the component.\n\n @return\n the container of the columns (aka fields) of the object\n */\n ::com::sun::star::container::XNameAccess getFieldsByCommandDescriptor( [in] long commandType,\n [in] string command,\n [out] ::com::sun::star::lang::XComponent keepFieldsAlive\n ) raises( com::sun::star::sdbc::SQLException );\n\n /** get the composer initialized with a command and command type.\n @param commandType\n the type of the object\n\n @param command\n the object. This may be a table name, a query name, or an SQL statement, depending on the value\n of _nCommandType\n @return\n the composer filled with command and command type.\n */\n ::com::sun::star::sdb::XSingleSelectQueryComposer getComposer([in] long commandType,[in] string command);\n};\n\n}; }; }; }; };\n\n#endif\n\n/* vim:set shiftwidth=4 softtabstop=4 expandtab: */\n"} +{"text": "#ifndef BOOST_METAPARSE_V1_IMPL_IS_CHAR_C_HPP\r\n#define BOOST_METAPARSE_V1_IMPL_IS_CHAR_C_HPP\r\n\r\n// Copyright Abel Sinkovics (abel@sinkovics.hu) 2015.\r\n// Distributed under the Boost Software License, Version 1.0.\r\n// (See accompanying file LICENSE_1_0.txt or copy at\r\n// http://www.boost.org/LICENSE_1_0.txt)\r\n\r\n#include \r\n\r\nnamespace boost\r\n{\r\n namespace metaparse\r\n {\r\n namespace v1\r\n {\r\n namespace impl\r\n {\r\n template \r\n struct is_char_c\r\n {\r\n typedef is_char_c type;\r\n\r\n template \r\n struct apply : boost::mpl::bool_ {};\r\n };\r\n }\r\n }\r\n }\r\n}\r\n\r\n#endif\r\n\r\n"} +{"text": ""} +{"text": "; RUN: not llvm-as < %s 2>&1 | FileCheck %s\n\ntarget datalayout = \"p:64:64:24\"\n\n; CHECK: Pointer preferred alignment must be a power of 2\n\n"} +{"text": "\n\n \n"} +{"text": "{% set props = status.properties %}\n\n{% if mode == 'simple' %}\n {{ 'status.task_finish.simple'|trans() }} {{ props.testpaper.name|sub_text(15) }}\n{% elseif mode == 'full' %}\n\n{% endif %}"} +{"text": "package TiledImage;\n\n=head1 NAME\n\nTiledImage.pm - Perl module to provide a GD-like interface for rendering large images then breaking them into tiles.\n\n=head1 SYNOPSIS\n\n # create a new image\n my $im = new TiledImage('-width'=>100,'-height'=>100);\n $im->verbose(2);\n \n # allocate some colors\n my $white = $im->colorAllocate(255,255,255);\n my $black = $im->colorAllocate(0,0,0);\n my $red = $im->colorAllocate(255,0,0);\n my $blue = $im->colorAllocate(0,0,255);\n \n # make the background transparent and interlaced\n $im->transparent($white);\n $im->interlaced('true');\n \n # Put a black frame around the picture\n $im->rectangle(0,0,99,99,$black);\n \n # Draw a blue oval\n $im->arc(50,50,95,75,0,360,$blue);\n \n # draw a polygon\n my $poly = GD::Polygon->new;\n $poly->addPt(15,15);\n $poly->addPt(85,15);\n $poly->addPt(50,85);\n $im->filledPolygon ($poly, $red);\n \n # draw strings\n $im->string(GD::gdLargeFont, 10, 10, \"hi world\", $blue);\n \n # create a dummy brush image & call setBrush() & copy() to test image storage\n my $dummyBrush = new GD::Image (20,20);\n my $white2 = $dummyBrush->colorAllocate(255,255,255);\n my $black2 = $dummyBrush->colorAllocate(0,0,0);\n my $red2 = $dummyBrush->colorAllocate(255,0,0);\n my $blue2 = $dummyBrush->colorAllocate(0,0,255);\n $dummyBrush->transparent($white2);\n $dummyBrush->interlaced('true');\n $dummyBrush->filledRectangle(4,4,16,16,$black2);\n $dummyBrush->arc(10,10,8,8,0,360,$blue2);\n \n $im->setBrush ($dummyBrush);\n $im->line (40, 30, 90, 80, GD::gdBrushed); # libgd bug: lines are clipped\n $im->copy ($dummyBrush, 75, 40, 0, 0, 20, 20);\n \n # render and save four tiles\n my ($tileWidth, $tileHeight) = (50, 50);\n for ($x = 0; $x < $im->width; $x += $tileWidth) {\n for ($y = 0; $y < $im->height; $y += $tileHeight) {\n my $tile = $im->renderTile ($x, $y, $tileWidth, $tileHeight);\n my $file = \"TILE.$x.$y.png\";\n open TILE, \">$file\" or die \"Couldn't write $file: $!\";\n print TILE $tile->png;\n close TILE or die \"Couldn't close $file: $!\";\n warn \"Wrote tile to $file\";\n }\n }\n\n=head1 METHODS\n\n=cut\n\nuse GD::Image;\nuse Carp;\nuse TiledImage::MemoryPrimStorage;\n# \"use TiledImage::DBPrimStorage\" commented out because it is imported lazily via an \"eval\" statement below\n# use TiledImage::DBPrimStorage;\n\n# Global table of TiledImage's for cleanup\nmy %tiledImageCleanup;\n\n# Private methods.\n# Code to do (X,Y)-translation for various different intercepted subroutines.\n# subroutine to generate a closure that translates an argument list\nsub makeGDPrimitiveArglistTranslator {\n my @xyIndexList = @_;\n return sub {\n\tmy ($self, $xstart, $ystart, @arglist) = @_;\n\tforeach my $xyIndex (@xyIndexList) {\n\t $arglist[$$xyIndex[0]] -= $xstart;\n\t $arglist[$$xyIndex[1]] -= $ystart;\n\t}\n\treturn @arglist;\n }\n}\n\n# polygon translator\nsub GDPolygonTranslate {\n my ($self, $xstart, $ystart, $poly, @arglist) = @_;\n\n my $translatedPoly = new GD::Polygon;\n foreach my $xy (@{$poly->{'points'}}) {\n\t$translatedPoly->addPt ($$xy[0] - $xstart, $$xy[1] - $ystart);\n }\n\n return ($translatedPoly, @arglist);\n}\n\n# translators\nmy $copyTranslate = makeGDPrimitiveArglistTranslator ([1,2]);\nmy $stringTranslate = makeGDPrimitiveArglistTranslator ([1,2]);\nmy $stringFTTranslate = makeGDPrimitiveArglistTranslator ([4,5]);\nmy $xyTranslate = makeGDPrimitiveArglistTranslator ([0,1]);\nmy $xyxyTranslate = makeGDPrimitiveArglistTranslator ([0,1], [2,3]);\n\n# Code to get the (xmin,ymin,xmax,ymax) bounding-box for intercepted subroutines.\n# bounding box getters\nsub GDPixelBounds { my ($self, $x, $y) = @_; return ($x, $y, $x+1, $y+1) }\nsub GDLineBounds { my ($self, $x1, $y1, $x2, $y2, $col) = @_; return (min($x1,$x2), min($y1,$y2), max($x1,$x2), max($y1,$y2)); }\nsub GDPolygonBounds { my ($self, $poly) = @_; return $poly->bounds() }\nsub GDEllipseBounds { my ($self, $x, $y, $w, $h) = @_; return ($x-$w, $y-$h, $x+$w, $y+$h) } # is this twice as big as it should be?\nsub GDCopyBounds { my ($self, $im, $destx, $desty, $srcx, $srcy, $w, $h) = @_; return ($destx, $desty, $destx+$w-1, $desty+$h-1) }\nsub GDStringBounds { my ($self, $font, $x, $y, $text) = @_; return ($x, $y, $x + length($text)*$font->width, $y + $font->height) }\nsub GDStringUpBounds { my ($self, $font, $x, $y, $text) = @_; return ($x, $y, $x + $font->width, $y + length($text)*$font->height) }\nsub GDStringFTBounds { my ($self, @args) = @_; my @bb = $self->im->stringFT (@args); return @bb ? @bb[0,1,4,5] : () }\n\n# min & max of a list\nsub min {\n my ($x, @y) = @_;\n foreach my $y (@y) {\n\t$x = $y if $y < $x;\n }\n return $x;\n}\n\nsub max {\n my ($x, @y) = @_;\n foreach my $y (@y) {\n\t$x = $y if $y > $x;\n }\n return $x;\n}\n\n\n# The %intercept hash: a function intercept table.\n# Each value is a reference to a hash of references to interception subroutines.\n# Possible interception subroutines:\n# 'translator'\n# 'boundsGetter'\n# 'imageStorer'\n# 'imageRetriever'\nmy %intercept =\n ('setPixel' => {'translator' => $xyTranslate, 'boundsGetter' => \\&GDPixelBounds},\n\n 'line' => {'translator' => $xyxyTranslate, 'boundsGetter' => \\&GDLineBounds},\n 'dashedLine' => {'translator' => $xyxyTranslate, 'boundsGetter' => \\&GDLineBounds},\n\n 'rectangle' => {'translator' => $xyxyTranslate, 'boundsGetter' => \\&GDLineBounds},\n 'filledRectangle' => {'translator' => $xyxyTranslate, 'boundsGetter' => \\&GDLineBounds},\n\n 'polygon' => {'translator' => \\&GDPolygonTranslate, 'boundsGetter' => \\&GDPolygonBounds}, # [AVU 12/5/05] added line for bugfix\n 'openPolygon' => {'translator' => \\&GDPolygonTranslate, 'boundsGetter' => \\&GDPolygonBounds},\n 'unclosedPolygon' => {'translator' => \\&GDPolygonTranslate, 'boundsGetter' => \\&GDPolygonBounds},\n 'filledPolygon' => {'translator' => \\&GDPolygonTranslate, 'boundsGetter' => \\&GDPolygonBounds},\n 'fillPoly' => {'translator' => \\&GDPolygonTranslate, 'boundsGetter' => \\&GDPolygonBounds},\n\n 'ellipse' => {'translator' => $xyTranslate, 'boundsGetter' => \\&GDEllipseBounds},\n 'filledEllipse' => {'translator' => $xyTranslate, 'boundsGetter' => \\&GDEllipseBounds},\n 'arc' => {'translator' => $xyTranslate, 'boundsGetter' => \\&GDEllipseBounds},\n 'filledArc' => {'translator' => $xyTranslate, 'boundsGetter' => \\&GDEllipseBounds},\n\n 'copy' => {'translator' => $copyTranslate, 'boundsGetter' => \\&GDCopyBounds},\n 'copyMerge' => {'translator' => $copyTranslate, 'boundsGetter' => \\&GDCopyBounds},\n 'copyMergeGray' => {'translator' => $copyTranslate, 'boundsGetter' => \\&GDCopyBounds},\n 'copyResized' => {'translator' => $copyTranslate, 'boundsGetter' => \\&GDCopyBounds},\n 'copyResampled' => {'translator' => $copyTranslate, 'boundsGetter' => \\&GDCopyBounds},\n 'copyRotated' => {'translator' => $copyTranslate, 'boundsGetter' => \\&GDCopyBounds},\n\n 'string' => {'translator' => $stringTranslate, 'boundsGetter' => \\&GDStringBounds},\n 'stringUp' => {'translator' => $stringTranslate, 'boundsGetter' => \\&GDStringUpBounds},\n 'char' => {'translator' => $stringTranslate, 'boundsGetter' => \\&GDStringBounds},\n 'charUp' => {'translator' => $stringTranslate, 'boundsGetter' => \\&GDStringUpBounds},\n\n 'stringFT' => {'translator' => $stringFTTranslate, 'boundsGetter' => \\&GDStringFTBounds},\n 'stringFTcircle' => {'translator' => $stringFTTranslate, 'boundsGetter' => \\&GDStringFTBounds},\n\n );\n\n@globalPrimNames = qw(colorAllocate rgb setBrush setThickness);\n\n# List of unimplemented functions:-- these will throw an error if called\n# (all others are silently passed to a dummy GD object)\nmy %unimplemented = map (($_=>1),\n\t\t\t qw (copyRotate90 copyRotate180 copyRotate270\n\t\t\t copyFlipHorizontal copyFlipVertical copyTranspose\n\t\t\t copyReverseTranspose rotate180\n\t\t\t flipHorizontal flipVertical\n\t\t\t fill fillToBorder));\n\nsub getBounds {\n my ($self) = @_;\n return ($self->width, $self->height);\n}\n\nforeach my $sub (sort keys %intercept) {\n no strict \"refs\";\n *$sub = sub {\n\tmy ($self, @args) = @_;\n\t\n\t# check for intercept: if so, get bounding box & store any images\n\tmy @bb = $self->getBoundingBox ($sub, @args);\n\t\n\t# update global bounding box\n\tif (@bb) {\n\t $self->xmin ($bb[0]) if !defined ($self->xmin) || $bb[0] < $self->xmin;\n\t $self->ymin ($bb[1]) if !defined ($self->ymin) || $bb[1] < $self->ymin;\n\t $self->xmax ($bb[2]) if !defined ($self->xmax) || $bb[2] >= $self->xmax;\n\t $self->ymax ($bb[3]) if !defined ($self->ymax) || $bb[3] >= $self->ymax;\n\t}\n\t\n\t# record primitive\n\t$self->primstorage->GDRecordPrimitive ($sub, \\@args, @bb);\n\t\n\t# log primitive\n\twarn \"Recorded $sub (@args) with \", (@bb>0 ? \"bounding box (@bb)\" : \"no bounding box\"), \"\\n\" if $self->verbose == 2;\n }\n}\n\nforeach my $sub (@globalPrimNames) {\n no strict \"refs\";\n *$sub = sub {\n\tmy ($self, @args) = @_;\n\n\t# record primitive\n\t$self->primstorage->GDRecordPrimitive ($sub, \\@args);\n\n\t# log primitive\n\twarn \"Recorded global primitive $sub (@args)\\n\" if $self->verbose == 2;\n\n\t# delegate\n\t$self->im->$sub (@args);\n }\n}\n\nforeach my $sub (sort keys %unimplemented) {\n no strict \"refs\";\n *$sub = sub {\n\tcroak \"Subroutine $sub unimplemented\";\n }\n}\n\nforeach my $field (qw(im width height xmin xmax ymin ymax verbose persistent primstorage)) {\n *$field = sub {\n\tmy $self = shift;\n\t$self->{$field} = shift if @_;\n\treturn $self->{$field};\n }\n}\n\n# Subroutine interceptions.\n# Each of the following can take a ($subroutine, @argument_list) array,\n# representing a call to a GD::Image object, $im, of the form $im->$subroutine (@argument_list).\n\n# $self->intercepts ($subroutine)\n# returns true if this TiledImage object intercepts the named subroutine\n# (i.e. it has an entry in the %intercept hash).\nsub intercepts {\n my ($self, $sub) = @_;\n return exists $intercept{$sub};\n}\n\n# $self->translate ($xOrigin, $yOrigin, $subroutine, @argument_list)\n# \"translates\" all (X,Y)-coordinates in the argument list of the named subroutine,\n# offsetting them relative to the specified (X,Y) origin.\n# Control is dispatched to a \"translator\" via the %intercept hash.\nsub translate {\n my ($self, $xstart, $ystart, $sub, @args) = @_;\n my $translator = $intercept{$sub}->{'translator'};\n return defined($translator) ? &$translator ($self, $xstart, $ystart, @args) : @args;\n}\n\n# $self->getBoundingBox ($subroutine, @argument_list)\n# returns the (xMin,yMin,xMax,yMax) bounding box for the named subroutine\n# with the given argument list.\n# Control is dispatched to a \"bounding-box getter\" via the %intercept hash.\nsub getBoundingBox {\n my ($self, $sub, @args) = @_;\n my $boundsGetter = $intercept{$sub}->{'boundsGetter'};\n return defined($boundsGetter) ? &$boundsGetter ($self, @args) : ();\n}\n\n# Special-case interceptions of specific GD::Image methods\n# intercept clone\nsub clone {\n my ($self) = @_;\n my $clone = {%$self};\n bless $clone, ref ($self);\n $clone->im ($self->im->clone);\n return $clone;\n}\n\n# hackily intercept getPixel\nsub getPixel {\n my ($self, $x, $y) = @_;\n my $im = $self->renderTile ($x, $y, 1, 1);\n return $im->getPixel (0, 0);\n}\n\n# apparently some glyphs call this subroutine to see if a drawing method has\n# been implemented in the version of BioPerl at hand (a backward compatability\n# check), so we must intercept immediately instead of storing in database\nsub can {\n my ($self, $method_name) = @_;\n #warn \"CHECKING FOR $method_name IN can()...\\n\"; #D!!!\n return $self->intercepts($method_name);\n}\n\n# AUTOLOAD method: catches all methods by default\nsub AUTOLOAD {\n my ($self, @args) = @_;\n\n # get subroutine name\n my $sub = our $AUTOLOAD;\n $sub =~ s/.*:://;\n\n # check for DESTROY\n return if $sub eq \"DESTROY\";\n\n warn \"unhandled sub $sub\";\n\n # record primitive\n # we don't need to worry about the bounding box here because\n # all of the primitives with bounding boxes are handled above.\n $self->primstorage->GDRecordPrimitive ($sub, \\@args);\n\n # delegate\n $self->im->$sub (@args);\n}\n\n# This needs to be called manually to cleanup and disconnect from database after done with the object;\n# otherwise, database connections remain open and clog database until instantiating script exits\n#\nsub finish {\n my $self = shift;\n $self->cleanup;\n # there was stuff here, but now it is gone... call 'cleanup' directly? !!!\n}\n\n# Destructor - TEMPORARILY (?) DISABLED due to DBI connectivity problems, destruction is now the responsibility of the caller\n#sub DESTROY {\n# my ($self) = @_;\n# warn \"TiledImage.pm IS CLEANING UP AND DISCONNECTING FROM DATABASE in destructor...\\n\" if $self->verbose;\n# $self->cleanup;\n# $self->gdtile->disconnect if $self->gdtile; # just in case we didn't close the database connection using finish() \n#}\n\n\n# Public methods.\n\n=head2 new\n\n my $tiledImage = new TiledImage (%args);\n\nCreates a new TiledImage object.\n\n%args is a key-value hash with the following keys:\n\n=over 2\n\n=item B<-width>: image width in pixels\n\n=item B<-height>: image height in pixels\n\n=item B<-tile_width_hint>: for optimal performance, set this equal to the tile width\n\n=item B<-verbose>: print lots of debugging information\n\n=item B: flag indicating whether to use filesystem links to repeat identical tiles. True by default; set to zero to disable this feature\n\n=item B<-primdb>: use a database to cache GD primitives, rather than storing them in memory (see TiledImage/gdtile.sql for SQL commands to create the database)\n\n=item B<-tiledimage_name>: unique identifier for this TiledImage. mandatory if B<-primdb> is used\n\n=item B<-persistent>: when used with B<-primdb>, do not delete primitives from database after rendering tiles\n\n=back\n\n=cut\n\n# Constructor\nsub new {\n my ($class, %args) = @_;\n my %allowed_args = map {$_ => 1} qw (-primdb -tiledimage_name -width -height -persistent -verbose -tile_width_hint);\n my @required_args;\n if (exists $args{'-primdb'}) {\n push @required_args, '-tiledimage_name';\n } else {\n $allowed_args{'-tiledimage_name'} = 1;\n }\n\n foreach my $arg (sort keys %args) {\n unless ($allowed_args{$arg}) {\n\tcroak (\"You specified an invalid arg ($arg) to TiledImage constructor (you passed in: \",\n\t join (' ', map { $_ . '=>' . $args{$_} } sort keys %args), \")\");\n }\n }\n\n foreach my $arg (@required_args) {\n unless (defined $args{$arg}) {\n\tcroak (\"You did not specify a required arg ($arg) to TiledImage constructor (you passed in: \",\n\t join (' ', map { $_ . '=>' . $args{$_} } sort keys %args), \")\");\n }\n }\n\n my ($persistent, $verbose) = (1, 0); # defaults\n $verbose = $args{'-verbose'} if exists $args{'-verbose'} ;\n $persistent = $args{'-persistent'} if exists $args{'-persistent'};\n\n my $primstorage;\n if ($args{'-primdb'}) {\n\teval \"use TiledImage::DBPrimStorage\"; # import DBPrimStorage here, rather than at top of file, so TiledImage.pm will still work even if DBI.pm is unavailable\n\t$primstorage = DBPrimStorage->new(\n -primdb => $args{'-primdb'},\n\t -tiledimage_name => $args{'-tiledimage_name'},\n\t -width => $args{'-width'} || '',\n\t -height => $args{'-height'} || '',\n\t -verbose => $verbose);\n } else {\n\t$primstorage = MemoryPrimStorage->new(\n\t -width => $args{-width}, -height => $args{-height},\n\t -tile_width_hint => $args{'-tile_width_hint'} || 1000,\n\t -verbose => $verbose);\n }\n\n # create dummy GD image\n my $im = GD::Image->new (1, 1);\n\n # create the proxy object\n my $self = { 'im' => $im,\n\n\t\t 'xmin' => undef,\n\t\t 'xmax' => undef,\n\t\t 'ymin' => undef,\n\t\t 'ymax' => undef,\n\n\t\t 'width' => $primstorage->{width},\n\t\t 'height' => $primstorage->{height},\n\n\t\t 'verbose' => $verbose,\n\t\t 'persistent' => $persistent,\n\n\t\t 'primstorage' => $primstorage,\n\t };\n\n # bless it, and add to global table\n bless $self, $class;\n $tiledImageCleanup{$self} = 1;\n\n # return\n return $self;\n}\n\n=head2 renderTile\n\n my $gdImage = $tiledImage->renderTile ($xmin, $ymin, $width, $height);\n\nReturns the specified area as a GD::Image object.\n\n=cut\n\n# renderTile:--\n# method to render a tile of given dimensions.\nsub renderTile {\n my ($self, $xmin, $ymin, $width, $height) = @_;\n my ($xmax, $ymax) = ($xmin + $width - 1, $ymin + $height - 1);\n\n # print message\n warn \"\\nRendering tile ($xmin,$ymin)+($width,$height)\\n\" if $self->verbose == 2;\n\n # create GD image\n my $im = GD::Image->new ($width, $height);\n\n my @prims = ($self->primstorage->GDGetGlobalPrimitives,\n\t\t $self->primstorage->GDGetBoundedPrimitives($xmin, $ymin,\n\t\t\t\t\t\t\t $xmax, $ymax));\n\n # sort by command_order\n @prims = sort { $a->[0] <=> $b->[0] } @prims;\n\n my $prev_command = -1;\n foreach my $primitive (@prims) {\n\tmy ($command_order, $sub, @args) = @{$primitive};\n\n\t# GDGetBoundedPrimitives might in some cases\n\t# return more than one copy of the same\n\t# primitive; here we ignore repeated\n\t# primitives.\n\tnext if $command_order == $prev_command;\n\t$prev_command = $command_order;\n\n\tif ($self->intercepts ($sub)) {\n\t @args = $self->translate ($xmin, $ymin, $sub, @args);\n\t}\n\n\twarn \"Replaying $sub (@args)\\n\" if $self->verbose == 2;\n\n\t$im->$sub (@args);\n }\n\n $self->primstorage->perTileCleanup();\n\n # return\n return $im;\n}\n\n=head2 cleanup\n\n $tiledImage->cleanup();\n\nCall this after rendering all tiles, to allow the TiledImage object to perform cleanup operations (e.g. removing primitives from the database).\n\n=cut\n\nsub cleanup {\n my $self = shift;\n\n # use explicit hashrefs instead of AUTOLOAD'ed accessors,\n # so that this method can be called by the signal handlers\n if ($self->{'persistent'} == 0) {\n\twarn \"Deleting primitives from database\\n\";\n\t$self->primstorage->GDDeletePrimitives;\n }\n\n $self->primstorage->cleanup();\n\n # drop from cleanup list\n delete $tiledImageCleanup{$self} if exists $tiledImageCleanup{$self};\n}\n\n\n\n=head2 Intercepted GD::Image methods\n\nThe following methods of B methods have analogous implementations in TiledImage:\n\n=over 2\n\n=item setPixel\n\n=item line\n\n=item dashedLine\n\n=item rectangle\n\n=item filledRectangle\n\n=item polygon\n\n=item openPolygon\n\n=item unclosedPolygon\n\n=item filledPolygon\n\n=item fillPoly\n\n=item ellipse\n\n=item filledEllipse\n\n=item arc\n\n=item filledArc\n\n=item copy\n\n=item copyMerge\n\n=item copyMergeGray\n\n=item copyResized\n\n=item copyResampled\n\n=item copyRotated\n\n=item string\n\n=item stringUp\n\n=item char\n\n=item charUp\n\n=item stringFT\n\n=item stringFTcircle\n\n=item colorAllocate\n\n=item rgb\n\n=item setBrush\n\n=item setThickness\n\n=back\n\n=head2 Unimplemented GD::Image methods\n\nThe following GD::Image methods are B implemented by TiledImage:\n\n=over\n\n=item copyRotate90\n\n=item copyRotate180\n\n=item copyRotate270\n\t\t\t \n=item copyFlipHorizontal\n\n=item copyFlipVertical\n\n=item copyTranspose\n\t\t\t \n=item copyReverseTranspose\n\n=item rotate180\n\t\t\t \n=item flipHorizontal\n\n=item flipVertical\n\t\t\t \n=item fill\n\n=item fillToBorder\n\n=back\n\n=cut\n\n\n# THERE IS CLEARLY A PROBLEM WITH THESE SIGNAL HANDLERS, SO I'M TAKING THEM\n# OUT AND PLACING THE HANDLER IN 'generate_tiles.pl' - it will be the\n# responsibility of the instantiating script to clean up and disconnect! [AVU 2/4/06] !!!\n\n# global_cleanup\n# method to call cleanup on all existing TiledImage's\n#sub global_cleanup {\n# warn \"in global_cleanup\";\n# my @tiledImage = keys %tiledImageCleanup;\n# foreach my $tiledImage (@tiledImage) {\n#\tcleanup ($tiledImage);\n# }\n#}\n\n# signal handlers\n#my $oldSigInt = $SIG{'INT'};\n#$SIG{'INT'} = sub {\n# warn \"caught SIG{INT}\"; #D!!!\n# foreach my $tiledImage (keys %tiledImageCleanup) { # if program was interrupted, we should clean up database\n#\t $tiledImage->{'persistent'} = 0; # entries made so far, no matter what the user specified\n# }\n# global_cleanup();\n# &$oldSigInt() if defined $oldSigInt;\n#};\n\n#my $oldSigKill = $SIG{'KILL'};\n#$SIG{'KILL'} = sub {\n# warn \"caught SIG{KILL}\"; #D!!!\n# foreach my $tiledImage (keys %tiledImageCleanup) { # if program was interrupted, we should clean up database\n#\t$tiledImage->{'persistent'} = 0; # entries made so far, no matter what the user specified\n# }\n# global_cleanup();\n# &$oldSigKill() if defined $oldSigKill;\n#};\n\n\n=head1 AUTHORS\n\nAndrew Uzilov Eandrew.uzilov@gmail.comE\n\nMitchell Skinner Emitch_skinner@berkeley.eduE\n\nIan Holmes Eihh@berkeley.eduE\n\nCopyright (c) 2007-2010 The Evolutionary Software Foundation\n\nThis package and its accompanying libraries are free software; you can\nredistribute it and/or modify it under the terms of the LGPL (either\nversion 2.1, or at your option, any later version) or the Artistic\nLicense 2.0. Refer to LICENSE for the full license text.\n\n=cut\n\n\n# End of package\n1;\n"} +{"text": "\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \n\nextern uintptr_t _l0dable_start;\nextern uintptr_t _l0dable_len;\nextern uintptr_t _jumptable_len;\n\n#define l0dable_start ((uintptr_t)&_l0dable_start)\n#define l0dable_len ((uintptr_t)&_l0dable_len)\n#define jumptable_len ((uintptr_t)&_jumptable_len)\n\n/**************************************************************************/\n\nuint8_t execute_file (const char * fname){\n FRESULT res;\n FIL file;\n UINT readbytes;\n void (*dst)(void);\n uint32_t version=0;\n\n res=f_open(&file, fname, FA_OPEN_EXISTING|FA_READ);\n if (res!=FR_OK){\n\tlcdPrintln(f_get_rc_string(res));\n\tlcdDisplay();\n\treturn -1;\n };\n\n res = f_read(&file, &version, sizeof(uint32_t), &readbytes);\n if(res!=FR_OK){\n\tlcdPrintln(f_get_rc_string(res));\n\tlcdDisplay();\n return -1;\n };\n\n if (version>jumptable_len){\n\tlcdPrintln(\"l0dable incompat.\");\n\tlcdPrint(IntToStr(jumptable_len,4,F_HEX));\n\tlcdPrint(\" < \");\n\tlcdPrintln(IntToStr(version,4,F_HEX));\n\tlcdDisplay();\n return -1;\n };\n\n res = f_read(&file, &dst, sizeof(uint32_t), &readbytes);\n if(res!=FR_OK){\n\tlcdPrintln(f_get_rc_string(res));\n\tlcdDisplay();\n return -1;\n };\n\n if ((uintptr_t)dst(l0dable_start+l0dable_len)){\n\tlcdPrintln(\"l0daddr illegal\");\n\tlcdPrint(IntToStr((uintptr_t)dst,8,F_HEX));\n\tlcdDisplay();\n return -1;\n };\n\n\n res = f_read(&file, (uint8_t *)l0dable_start, l0dable_len, &readbytes);\n if(res!=FR_OK){\n\tlcdPrintln(f_get_rc_string(res));\n\tlcdDisplay();\n return -1;\n };\n\n if(readbytes>=l0dable_len){\n\tlcdPrintln(\"l0dable too long.\");\n\tlcdDisplay();\n\treturn -1;\n };\n\n lcdPrint(IntToStr(readbytes,5,F_LONG));\n lcdPrintln(\" bytes...\");\n\n dst=(void (*)(void)) ((uintptr_t)dst|1); // Enable Thumb mode!\n\n#if 0\n lcdPrint(\"dst= \"); lcdPrint(IntToStr((uintptr_t)dst,8,F_HEX)); lcdNl();\n lcdPrint(\"len= \"); lcdPrint(IntToStr((uintptr_t)&_l0dable_len,8,F_HEX)); lcdNl();\n lcdPrint(\"jt= \"); lcdPrint(IntToStr(jumptable_len,8,F_HEX)); lcdNl();\n lcdPrint(\"ver= \"); lcdPrint(IntToStr(version,8,F_HEX)); lcdNl();\n lcdDisplay();\n#endif\n\n dst();\n return 0;\n}\n\n/**************************************************************************/\n\nvoid executeSelect(const char *ext){\n char filename[FLEN];\n\n if( selectFile(filename,ext) >= 0){\n if(execute_file(filename)!=0){\n getInputWait();\n };\n };\n}\n\n"} +{"text": ".PHONY: clean clean-test clean-pyc clean-build docs help\n.DEFAULT_GOAL := help\ndefine BROWSER_PYSCRIPT\nimport os, webbrowser, sys\ntry:\n\tfrom urllib import pathname2url\nexcept:\n\tfrom urllib.request import pathname2url\n\nwebbrowser.open(\"file://\" + pathname2url(os.path.abspath(sys.argv[1])))\nendef\nexport BROWSER_PYSCRIPT\n\ndefine PRINT_HELP_PYSCRIPT\nimport re, sys\n\nfor line in sys.stdin:\n\tmatch = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)\n\tif match:\n\t\ttarget, help = match.groups()\n\t\tprint(\"%-20s %s\" % (target, help))\nendef\nexport PRINT_HELP_PYSCRIPT\nBROWSER := python3 -c \"$$BROWSER_PYSCRIPT\"\n\nhelp:\n\t@python3 -c \"$$PRINT_HELP_PYSCRIPT\" < $(MAKEFILE_LIST)\n\nclean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts\n\n\nclean-build: ## remove build artifacts\n\trm -fr build/\n\trm -fr dist/\n\trm -fr .eggs/\n\tfind . -name '*.egg-info' -exec rm -fr {} +\n\tfind . -name '*.egg' -exec rm -f {} +\n\nclean-pyc: ## remove Python file artifacts\n\tfind . -name '*.pyc' -exec rm -f {} +\n\tfind . -name '*.pyo' -exec rm -f {} +\n\tfind . -name '*~' -exec rm -f {} +\n\tfind . -name '__pycache__' -exec rm -fr {} +\n\nclean-test: ## remove test and coverage artifacts\n\trm -fr .tox/\n\trm -f .coverage\n\trm -fr htmlcov/\n\nlint: ## check style with flake8\n\tflake8 face_recognition tests\n\ntest: ## run tests quickly with the default Python\n\t\n\t\tpython3 setup.py test\n\ntest-all: ## run tests on every Python version with tox\n\ttox\n\ncoverage: ## check code coverage quickly with the default Python\n\t\n\t\tcoverage run --source face_recognition setup.py test\n\t\n\t\tcoverage report -m\n\t\tcoverage html\n\t\t$(BROWSER) htmlcov/index.html\n\ndocs: ## generate Sphinx HTML documentation, including API docs\n\trm -f docs/face_recognition.rst\n\trm -f docs/modules.rst\n\tsphinx-apidoc -o docs/ face_recognition\n\t$(MAKE) -C docs clean\n\t$(MAKE) -C docs html\n\t$(BROWSER) docs/_build/html/index.html\n\nservedocs: docs ## compile the docs watching for changes\n\twatchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .\n\nrelease: clean ## package and upload a release\n\tpython3 setup.py sdist upload\n\tpython3 setup.py bdist_wheel upload\n\ndist: clean ## builds source and wheel package\n\tpython3 setup.py sdist\n\tpython3 setup.py bdist_wheel\n\tls -l dist\n\ninstall: clean ## install the package to the active Python's site-packages\n\tpython3 setup.py install\n"} +{"text": "\n\n \"Thời lượng phiên nghỉ\"\n \"Tắt âm thanh và rung\"\n \"Do not disturb mode\"\n \"Tắt kết nối Wi-Fi\"\n \"Chế độ toàn màn hình\"\n \"Thông báo\"\n \"Chung\"\n \"Giữ cho màn hình luôn bật\"\n \"Thời lượng phiên nghỉ dài\"\n \"Thông báo đã hoàn thành công việc\"\n \"Cài đặt âm báo\"\n \"Thời lượng một phiên làm việc\"\n \"Số phiên làm việc để có được 1 phiên nghỉ dài\"\n \"Cho phép nghỉ dài\"\n \"Chế độ rung\"\n Không rung\n Nhẹ\n Mạnh\n SOS\n Nhịp tim\n \"Chế độ đêm\"\n Khi đang trong phiên làm việc\n \"Âm báo\"\n \"Bỏ qua cài đặt âm thanh\"\n \"Sử dụng âm thanh thông báo của hệ thống\"\n \"Luôn hiển thị thông báo\"\n \"Lặp lại thông báo cho đến khi nó bị hủy\"\n Thông báo kết thúc phiên nghỉ\n \"Tự khởi động phiên nghỉ\"\n \"Tự khởi động phiên làm việc\"\n Tự khởi động phiên nghỉ sau khi phiên làm việc kết thúc\n Tự khởi động phiên làm việc sau khi phiên nghỉ kết thúc\n Thông báo chính xác\n Flash the screen\n A visual notification for silent environments\n Vô hiệu hóa tối ưu hóa pin cho ứng dụng này\n Chế độ bảo vệ màn hình\n Di chuyển bộ hẹn giờ trong khi màn hình đang bật\n Thông tin ứng dụng\n Đóng góp bản dịch\n Giấy phép Mã nguồn mở\n \"Không tìm thấy ứng dụng Email nào trên thiết bị.\"\n Đánh giá ứng dụng\n Phiên bản\n Mã nguồn\n Giới thiệu ứng dụng\n Sao lưu\n \"Nhập bản sao lưu\"\n Xuất dự phòng\n Nhập thành công\n Nhập dữ liệu thất bại\n Xuất bản sao lưu CSV\n Không có dữ liệu\n \"Các mục hiện tại sẽ bị mất.\"\n Các tập tin có thể nhập trở lại\n Các tập tin không thể nhập trở lại\n Nhãn\n Nhãn hiện tại\n Tên nhãn\n Nhãn đã tồn tại\n Chọn màu\n Xóa nhãn?\n Xóa nhãn này sẽ xóa nó khỏi tất cả các phiên kết thúc. Các phiên sẽ không được gỡ bỏ.\n Chọn nhãn\n Chỉnh sửa nhãn\n Thêm nhãn\n tất cả\n Kết thúc\n Tiếp tục\n Dừng\n Bắt đầu làm việc\n Bắt đầu nghỉ\n Bỏ qua nghỉ ngơi\n Công việc đang diễn ra\n Phiên làm việc bị tạm dừng\n Đang nghỉ\n Tiếp tục?\n Nghỉ xong\n Phiên kết thúc\n Nhấn nút quay lại lần nữa để thoát\n Nhấn vào bộ hẹn giờ để bắt đầu và tạm dừng\n Vuốt sang trái hoặc phải để bỏ qua phiên hiện tại\n Vuốt lên để thêm một phút nữa\n Vuốt xuống bộ hẹn giờ để dừng\n Bạn chỉ cần lưu trữ một nhãn. Nó sẽ không hiển thị để lựa chọn hoặc thống kê.\n \"Tránh làm phiền\"\n \"Giữ công việc theo lộ trình theo thời gian thiết lập trên ứng dụng.\"\n \"Làm mới đầu óc\"\n \"Thả lỏng với lượt nghỉ ngắn và làm mới đầu óc.\"\n \"Bắt đầu\"\n \"Tập trung, tránh mọi sự xao nhãng và cải thiện khả năng tập trung của bạn.\"\n Đóng\n Xóa\n Thay đổi\n Nâng cấp\n Tiết kiệm\n Chọn tất cả\n Thêm phiên\n Nhập thời lượng hợp lệ\n Chỉnh sửa phiên\n Thêm thời lượng (phút)\n Gửi phản hồi\n Nhấn vào để chọn cho phép ứng dụng\n Xóa mục đã chọn?\n Không có dữ liệu\n Goodtime thông báo\n \"Kênh thông báo của ứng dụng Goodtime\"\n \"Nhắc nhở mỗi ngày\"\n \"Đã đến lúc cần phải làm việc năng suất hơn!\"\n Cài đặt\n Trạng thái\n Phản hồi\n Chuyển đổi chế độ xem\n Số liệu thống kê\n Lịch sử\n Tổng quan\n Hôm nay\n Theo Tuần\n Tuần này\n Tháng này\n Tổng cộng\n Thời gian sản xuất\n Phân bổ thời gian làm việc\n Thời gian\n Phiên\n Giờ\n Ngày\n Tuần\n Tháng\n Nhãn màu\n Thêm phiên thủ công\n Chỉnh s���a các phiên hoàn thành\n Xuất nhập khẩu dự phòng\n Xuất thống kê sang CSV\n Chủ đề\n Âm thanh thông báo riêng cho công việc và nghỉ\n Thông báo khăng khăng\n One time payment\n Tất cả các tính năng trong tương lai miễn phí\n Upgrade to support open-source and ad-free software and enjoy some awesome features!\n Hồ sơ\n Xuyen\n Cấu hình này đã tồn tại\n Lưu hồ sơ tùy chỉnh\n Thời gian hẹn giờ\n Cài đặt thời lượng cho phiên làm việc và phiên nghỉ\n Phong cách hẹn giờ\n Mặc định\n Cổ điển\n Chỉ vài phút\n Phiên truy cập\n \"Hiển thị số phiên hoàn thành ngày hôm nay\"\n Hỗ trợ nhà sản xuất\n \"Điều này sẽ thiết lập lại các phiên kết thúc ngày hôm nay.\"\n Đặt lại?\n Hướng dẫn\n Ứng dụng cùng tác giả\n chưa gán nhãn\n Xem nhãn hiện tại\n Hiển thị nhãn hiện tại trên màn hình chính\n Pre-notification\n Notify one minute before a work session ends\n Donate to support open-source and ad-free software!\n Donate\n\n"} +{"text": "import React from 'react';\nimport InputField from 'terra-form-input/lib/InputField';\n\nconst DefaultInputField = () => (\n \n);\n\nexport default DefaultInputField;\n"} +{"text": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage datastore\n\nimport (\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\n\twrapperspb \"github.com/golang/protobuf/ptypes/wrappers\"\n\t\"golang.org/x/net/context\"\n\t\"google.golang.org/api/iterator\"\n\tpb \"google.golang.org/genproto/googleapis/datastore/v1\"\n)\n\ntype operator int\n\nconst (\n\tlessThan operator = iota + 1\n\tlessEq\n\tequal\n\tgreaterEq\n\tgreaterThan\n\n\tkeyFieldName = \"__key__\"\n)\n\nvar operatorToProto = map[operator]pb.PropertyFilter_Operator{\n\tlessThan: pb.PropertyFilter_LESS_THAN,\n\tlessEq: pb.PropertyFilter_LESS_THAN_OR_EQUAL,\n\tequal: pb.PropertyFilter_EQUAL,\n\tgreaterEq: pb.PropertyFilter_GREATER_THAN_OR_EQUAL,\n\tgreaterThan: pb.PropertyFilter_GREATER_THAN,\n}\n\n// filter is a conditional filter on query results.\ntype filter struct {\n\tFieldName string\n\tOp operator\n\tValue interface{}\n}\n\ntype sortDirection bool\n\nconst (\n\tascending sortDirection = false\n\tdescending sortDirection = true\n)\n\nvar sortDirectionToProto = map[sortDirection]pb.PropertyOrder_Direction{\n\tascending: pb.PropertyOrder_ASCENDING,\n\tdescending: pb.PropertyOrder_DESCENDING,\n}\n\n// order is a sort order on query results.\ntype order struct {\n\tFieldName string\n\tDirection sortDirection\n}\n\n// NewQuery creates a new Query for a specific entity kind.\n//\n// An empty kind means to return all entities, including entities created and\n// managed by other App Engine features, and is called a kindless query.\n// Kindless queries cannot include filters or sort orders on property values.\nfunc NewQuery(kind string) *Query {\n\treturn &Query{\n\t\tkind: kind,\n\t\tlimit: -1,\n\t}\n}\n\n// Query represents a datastore query.\ntype Query struct {\n\tkind string\n\tancestor *Key\n\tfilter []filter\n\torder []order\n\tprojection []string\n\n\tdistinct bool\n\tdistinctOn []string\n\tkeysOnly bool\n\teventual bool\n\tlimit int32\n\toffset int32\n\tstart []byte\n\tend []byte\n\n\tnamespace string\n\n\ttrans *Transaction\n\n\terr error\n}\n\nfunc (q *Query) clone() *Query {\n\tx := *q\n\t// Copy the contents of the slice-typed fields to a new backing store.\n\tif len(q.filter) > 0 {\n\t\tx.filter = make([]filter, len(q.filter))\n\t\tcopy(x.filter, q.filter)\n\t}\n\tif len(q.order) > 0 {\n\t\tx.order = make([]order, len(q.order))\n\t\tcopy(x.order, q.order)\n\t}\n\treturn &x\n}\n\n// Ancestor returns a derivative query with an ancestor filter.\n// The ancestor should not be nil.\nfunc (q *Query) Ancestor(ancestor *Key) *Query {\n\tq = q.clone()\n\tif ancestor == nil {\n\t\tq.err = errors.New(\"datastore: nil query ancestor\")\n\t\treturn q\n\t}\n\tq.ancestor = ancestor\n\treturn q\n}\n\n// EventualConsistency returns a derivative query that returns eventually\n// consistent results.\n// It only has an effect on ancestor queries.\nfunc (q *Query) EventualConsistency() *Query {\n\tq = q.clone()\n\tq.eventual = true\n\treturn q\n}\n\n// Namespace returns a derivative query that is associated with the given\n// namespace.\n//\n// A namespace may be used to partition data for multi-tenant applications.\n// For details, see https://cloud.google.com/datastore/docs/concepts/multitenancy.\nfunc (q *Query) Namespace(ns string) *Query {\n\tq = q.clone()\n\tq.namespace = ns\n\treturn q\n}\n\n// Transaction returns a derivative query that is associated with the given\n// transaction.\n//\n// All reads performed as part of the transaction will come from a single\n// consistent snapshot. Furthermore, if the transaction is set to a\n// serializable isolation level, another transaction cannot concurrently modify\n// the data that is read or modified by this transaction.\nfunc (q *Query) Transaction(t *Transaction) *Query {\n\tq = q.clone()\n\tq.trans = t\n\treturn q\n}\n\n// Filter returns a derivative query with a field-based filter.\n// The filterStr argument must be a field name followed by optional space,\n// followed by an operator, one of \">\", \"<\", \">=\", \"<=\", or \"=\".\n// Fields are compared against the provided value using the operator.\n// Multiple filters are AND'ed together.\n// Field names which contain spaces, quote marks, or operator characters\n// should be passed as quoted Go string literals as returned by strconv.Quote\n// or the fmt package's %q verb.\nfunc (q *Query) Filter(filterStr string, value interface{}) *Query {\n\tq = q.clone()\n\tfilterStr = strings.TrimSpace(filterStr)\n\tif filterStr == \"\" {\n\t\tq.err = fmt.Errorf(\"datastore: invalid filter %q\", filterStr)\n\t\treturn q\n\t}\n\tf := filter{\n\t\tFieldName: strings.TrimRight(filterStr, \" ><=!\"),\n\t\tValue: value,\n\t}\n\tswitch op := strings.TrimSpace(filterStr[len(f.FieldName):]); op {\n\tcase \"<=\":\n\t\tf.Op = lessEq\n\tcase \">=\":\n\t\tf.Op = greaterEq\n\tcase \"<\":\n\t\tf.Op = lessThan\n\tcase \">\":\n\t\tf.Op = greaterThan\n\tcase \"=\":\n\t\tf.Op = equal\n\tdefault:\n\t\tq.err = fmt.Errorf(\"datastore: invalid operator %q in filter %q\", op, filterStr)\n\t\treturn q\n\t}\n\tvar err error\n\tf.FieldName, err = unquote(f.FieldName)\n\tif err != nil {\n\t\tq.err = fmt.Errorf(\"datastore: invalid syntax for quoted field name %q\", f.FieldName)\n\t\treturn q\n\t}\n\tq.filter = append(q.filter, f)\n\treturn q\n}\n\n// Order returns a derivative query with a field-based sort order. Orders are\n// applied in the order they are added. The default order is ascending; to sort\n// in descending order prefix the fieldName with a minus sign (-).\n// Field names which contain spaces, quote marks, or the minus sign\n// should be passed as quoted Go string literals as returned by strconv.Quote\n// or the fmt package's %q verb.\nfunc (q *Query) Order(fieldName string) *Query {\n\tq = q.clone()\n\tfieldName, dir := strings.TrimSpace(fieldName), ascending\n\tif strings.HasPrefix(fieldName, \"-\") {\n\t\tfieldName, dir = strings.TrimSpace(fieldName[1:]), descending\n\t} else if strings.HasPrefix(fieldName, \"+\") {\n\t\tq.err = fmt.Errorf(\"datastore: invalid order: %q\", fieldName)\n\t\treturn q\n\t}\n\tfieldName, err := unquote(fieldName)\n\tif err != nil {\n\t\tq.err = fmt.Errorf(\"datastore: invalid syntax for quoted field name %q\", fieldName)\n\t\treturn q\n\t}\n\tif fieldName == \"\" {\n\t\tq.err = errors.New(\"datastore: empty order\")\n\t\treturn q\n\t}\n\tq.order = append(q.order, order{\n\t\tDirection: dir,\n\t\tFieldName: fieldName,\n\t})\n\treturn q\n}\n\n// unquote optionally interprets s as a double-quoted or backquoted Go\n// string literal if it begins with the relevant character.\nfunc unquote(s string) (string, error) {\n\tif s == \"\" || (s[0] != '`' && s[0] != '\"') {\n\t\treturn s, nil\n\t}\n\treturn strconv.Unquote(s)\n}\n\n// Project returns a derivative query that yields only the given fields. It\n// cannot be used with KeysOnly.\nfunc (q *Query) Project(fieldNames ...string) *Query {\n\tq = q.clone()\n\tq.projection = append([]string(nil), fieldNames...)\n\treturn q\n}\n\n// Distinct returns a derivative query that yields de-duplicated entities with\n// respect to the set of projected fields. It is only used for projection\n// queries. Distinct cannot be used with DistinctOn.\nfunc (q *Query) Distinct() *Query {\n\tq = q.clone()\n\tq.distinct = true\n\treturn q\n}\n\n// DistinctOn returns a derivative query that yields de-duplicated entities with\n// respect to the set of the specified fields. It is only used for projection\n// queries. The field list should be a subset of the projected field list.\n// DistinctOn cannot be used with Distinct.\nfunc (q *Query) DistinctOn(fieldNames ...string) *Query {\n\tq = q.clone()\n\tq.distinctOn = fieldNames\n\treturn q\n}\n\n// KeysOnly returns a derivative query that yields only keys, not keys and\n// entities. It cannot be used with projection queries.\nfunc (q *Query) KeysOnly() *Query {\n\tq = q.clone()\n\tq.keysOnly = true\n\treturn q\n}\n\n// Limit returns a derivative query that has a limit on the number of results\n// returned. A negative value means unlimited.\nfunc (q *Query) Limit(limit int) *Query {\n\tq = q.clone()\n\tif limit < math.MinInt32 || limit > math.MaxInt32 {\n\t\tq.err = errors.New(\"datastore: query limit overflow\")\n\t\treturn q\n\t}\n\tq.limit = int32(limit)\n\treturn q\n}\n\n// Offset returns a derivative query that has an offset of how many keys to\n// skip over before returning results. A negative value is invalid.\nfunc (q *Query) Offset(offset int) *Query {\n\tq = q.clone()\n\tif offset < 0 {\n\t\tq.err = errors.New(\"datastore: negative query offset\")\n\t\treturn q\n\t}\n\tif offset > math.MaxInt32 {\n\t\tq.err = errors.New(\"datastore: query offset overflow\")\n\t\treturn q\n\t}\n\tq.offset = int32(offset)\n\treturn q\n}\n\n// Start returns a derivative query with the given start point.\nfunc (q *Query) Start(c Cursor) *Query {\n\tq = q.clone()\n\tq.start = c.cc\n\treturn q\n}\n\n// End returns a derivative query with the given end point.\nfunc (q *Query) End(c Cursor) *Query {\n\tq = q.clone()\n\tq.end = c.cc\n\treturn q\n}\n\n// toProto converts the query to a protocol buffer.\nfunc (q *Query) toProto(req *pb.RunQueryRequest) error {\n\tif len(q.projection) != 0 && q.keysOnly {\n\t\treturn errors.New(\"datastore: query cannot both project and be keys-only\")\n\t}\n\tif len(q.distinctOn) != 0 && q.distinct {\n\t\treturn errors.New(\"datastore: query cannot be both distinct and distinct-on\")\n\t}\n\tdst := &pb.Query{}\n\tif q.kind != \"\" {\n\t\tdst.Kind = []*pb.KindExpression{{Name: q.kind}}\n\t}\n\tif q.projection != nil {\n\t\tfor _, propertyName := range q.projection {\n\t\t\tdst.Projection = append(dst.Projection, &pb.Projection{Property: &pb.PropertyReference{Name: propertyName}})\n\t\t}\n\n\t\tfor _, propertyName := range q.distinctOn {\n\t\t\tdst.DistinctOn = append(dst.DistinctOn, &pb.PropertyReference{Name: propertyName})\n\t\t}\n\n\t\tif q.distinct {\n\t\t\tfor _, propertyName := range q.projection {\n\t\t\t\tdst.DistinctOn = append(dst.DistinctOn, &pb.PropertyReference{Name: propertyName})\n\t\t\t}\n\t\t}\n\t}\n\tif q.keysOnly {\n\t\tdst.Projection = []*pb.Projection{{Property: &pb.PropertyReference{Name: keyFieldName}}}\n\t}\n\n\tvar filters []*pb.Filter\n\tfor _, qf := range q.filter {\n\t\tif qf.FieldName == \"\" {\n\t\t\treturn errors.New(\"datastore: empty query filter field name\")\n\t\t}\n\t\tv, err := interfaceToProto(reflect.ValueOf(qf.Value).Interface(), false)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"datastore: bad query filter value type: %v\", err)\n\t\t}\n\t\top, ok := operatorToProto[qf.Op]\n\t\tif !ok {\n\t\t\treturn errors.New(\"datastore: unknown query filter operator\")\n\t\t}\n\t\txf := &pb.PropertyFilter{\n\t\t\tOp: op,\n\t\t\tProperty: &pb.PropertyReference{Name: qf.FieldName},\n\t\t\tValue: v,\n\t\t}\n\t\tfilters = append(filters, &pb.Filter{\n\t\t\tFilterType: &pb.Filter_PropertyFilter{PropertyFilter: xf},\n\t\t})\n\t}\n\n\tif q.ancestor != nil {\n\t\tfilters = append(filters, &pb.Filter{\n\t\t\tFilterType: &pb.Filter_PropertyFilter{PropertyFilter: &pb.PropertyFilter{\n\t\t\t\tProperty: &pb.PropertyReference{Name: keyFieldName},\n\t\t\t\tOp: pb.PropertyFilter_HAS_ANCESTOR,\n\t\t\t\tValue: &pb.Value{ValueType: &pb.Value_KeyValue{KeyValue: keyToProto(q.ancestor)}},\n\t\t\t}}})\n\t}\n\n\tif len(filters) == 1 {\n\t\tdst.Filter = filters[0]\n\t} else if len(filters) > 1 {\n\t\tdst.Filter = &pb.Filter{FilterType: &pb.Filter_CompositeFilter{CompositeFilter: &pb.CompositeFilter{\n\t\t\tOp: pb.CompositeFilter_AND,\n\t\t\tFilters: filters,\n\t\t}}}\n\t}\n\n\tfor _, qo := range q.order {\n\t\tif qo.FieldName == \"\" {\n\t\t\treturn errors.New(\"datastore: empty query order field name\")\n\t\t}\n\t\txo := &pb.PropertyOrder{\n\t\t\tProperty: &pb.PropertyReference{Name: qo.FieldName},\n\t\t\tDirection: sortDirectionToProto[qo.Direction],\n\t\t}\n\t\tdst.Order = append(dst.Order, xo)\n\t}\n\tif q.limit >= 0 {\n\t\tdst.Limit = &wrapperspb.Int32Value{Value: q.limit}\n\t}\n\tdst.Offset = q.offset\n\tdst.StartCursor = q.start\n\tdst.EndCursor = q.end\n\n\tif t := q.trans; t != nil {\n\t\tif t.id == nil {\n\t\t\treturn errExpiredTransaction\n\t\t}\n\t\tif q.eventual {\n\t\t\treturn errors.New(\"datastore: cannot use EventualConsistency query in a transaction\")\n\t\t}\n\t\treq.ReadOptions = &pb.ReadOptions{\n\t\t\tConsistencyType: &pb.ReadOptions_Transaction{Transaction: t.id},\n\t\t}\n\t}\n\n\tif q.eventual {\n\t\treq.ReadOptions = &pb.ReadOptions{ConsistencyType: &pb.ReadOptions_ReadConsistency_{ReadConsistency: pb.ReadOptions_EVENTUAL}}\n\t}\n\n\treq.QueryType = &pb.RunQueryRequest_Query{Query: dst}\n\treturn nil\n}\n\n// Count returns the number of results for the given query.\n//\n// The running time and number of API calls made by Count scale linearly with\n// with the sum of the query's offset and limit. Unless the result count is\n// expected to be small, it is best to specify a limit; otherwise Count will\n// continue until it finishes counting or the provided context expires.\nfunc (c *Client) Count(ctx context.Context, q *Query) (int, error) {\n\t// Check that the query is well-formed.\n\tif q.err != nil {\n\t\treturn 0, q.err\n\t}\n\n\t// Create a copy of the query, with keysOnly true (if we're not a projection,\n\t// since the two are incompatible).\n\tnewQ := q.clone()\n\tnewQ.keysOnly = len(newQ.projection) == 0\n\n\t// Create an iterator and use it to walk through the batches of results\n\t// directly.\n\tit := c.Run(ctx, newQ)\n\tn := 0\n\tfor {\n\t\terr := it.nextBatch()\n\t\tif err == iterator.Done {\n\t\t\treturn n, nil\n\t\t}\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tn += len(it.results)\n\t}\n}\n\n// GetAll runs the provided query in the given context and returns all keys\n// that match that query, as well as appending the values to dst.\n//\n// dst must have type *[]S or *[]*S or *[]P, for some struct type S or some non-\n// interface, non-pointer type P such that P or *P implements PropertyLoadSaver.\n//\n// As a special case, *PropertyList is an invalid type for dst, even though a\n// PropertyList is a slice of structs. It is treated as invalid to avoid being\n// mistakenly passed when *[]PropertyList was intended.\n//\n// The keys returned by GetAll will be in a 1-1 correspondence with the entities\n// added to dst.\n//\n// If q is a ``keys-only'' query, GetAll ignores dst and only returns the keys.\n//\n// The running time and number of API calls made by GetAll scale linearly with\n// with the sum of the query's offset and limit. Unless the result count is\n// expected to be small, it is best to specify a limit; otherwise GetAll will\n// continue until it finishes collecting results or the provided context\n// expires.\nfunc (c *Client) GetAll(ctx context.Context, q *Query, dst interface{}) ([]*Key, error) {\n\tvar (\n\t\tdv reflect.Value\n\t\tmat multiArgType\n\t\telemType reflect.Type\n\t\terrFieldMismatch error\n\t)\n\tif !q.keysOnly {\n\t\tdv = reflect.ValueOf(dst)\n\t\tif dv.Kind() != reflect.Ptr || dv.IsNil() {\n\t\t\treturn nil, ErrInvalidEntityType\n\t\t}\n\t\tdv = dv.Elem()\n\t\tmat, elemType = checkMultiArg(dv)\n\t\tif mat == multiArgTypeInvalid || mat == multiArgTypeInterface {\n\t\t\treturn nil, ErrInvalidEntityType\n\t\t}\n\t}\n\n\tvar keys []*Key\n\tfor t := c.Run(ctx, q); ; {\n\t\tk, e, err := t.next()\n\t\tif err == iterator.Done {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn keys, err\n\t\t}\n\t\tif !q.keysOnly {\n\t\t\tev := reflect.New(elemType)\n\t\t\tif elemType.Kind() == reflect.Map {\n\t\t\t\t// This is a special case. The zero values of a map type are\n\t\t\t\t// not immediately useful; they have to be make'd.\n\t\t\t\t//\n\t\t\t\t// Funcs and channels are similar, in that a zero value is not useful,\n\t\t\t\t// but even a freshly make'd channel isn't useful: there's no fixed\n\t\t\t\t// channel buffer size that is always going to be large enough, and\n\t\t\t\t// there's no goroutine to drain the other end. Theoretically, these\n\t\t\t\t// types could be supported, for example by sniffing for a constructor\n\t\t\t\t// method or requiring prior registration, but for now it's not a\n\t\t\t\t// frequent enough concern to be worth it. Programmers can work around\n\t\t\t\t// it by explicitly using Iterator.Next instead of the Query.GetAll\n\t\t\t\t// convenience method.\n\t\t\t\tx := reflect.MakeMap(elemType)\n\t\t\t\tev.Elem().Set(x)\n\t\t\t}\n\t\t\tif err = loadEntityProto(ev.Interface(), e); err != nil {\n\t\t\t\tif _, ok := err.(*ErrFieldMismatch); ok {\n\t\t\t\t\t// We continue loading entities even in the face of field mismatch errors.\n\t\t\t\t\t// If we encounter any other error, that other error is returned. Otherwise,\n\t\t\t\t\t// an ErrFieldMismatch is returned.\n\t\t\t\t\terrFieldMismatch = err\n\t\t\t\t} else {\n\t\t\t\t\treturn keys, err\n\t\t\t\t}\n\t\t\t}\n\t\t\tif mat != multiArgTypeStructPtr {\n\t\t\t\tev = ev.Elem()\n\t\t\t}\n\t\t\tdv.Set(reflect.Append(dv, ev))\n\t\t}\n\t\tkeys = append(keys, k)\n\t}\n\treturn keys, errFieldMismatch\n}\n\n// Run runs the given query in the given context.\nfunc (c *Client) Run(ctx context.Context, q *Query) *Iterator {\n\tif q.err != nil {\n\t\treturn &Iterator{err: q.err}\n\t}\n\tt := &Iterator{\n\t\tctx: ctx,\n\t\tclient: c,\n\t\tlimit: q.limit,\n\t\toffset: q.offset,\n\t\tkeysOnly: q.keysOnly,\n\t\tpageCursor: q.start,\n\t\tentityCursor: q.start,\n\t\treq: &pb.RunQueryRequest{\n\t\t\tProjectId: c.dataset,\n\t\t},\n\t}\n\tif q.namespace != \"\" {\n\t\tt.req.PartitionId = &pb.PartitionId{\n\t\t\tNamespaceId: q.namespace,\n\t\t}\n\t}\n\n\tif err := q.toProto(t.req); err != nil {\n\t\tt.err = err\n\t}\n\treturn t\n}\n\n// Iterator is the result of running a query.\ntype Iterator struct {\n\tctx context.Context\n\tclient *Client\n\terr error\n\n\t// results is the list of EntityResults still to be iterated over from the\n\t// most recent API call. It will be nil if no requests have yet been issued.\n\tresults []*pb.EntityResult\n\t// req is the request to send. It may be modified and used multiple times.\n\treq *pb.RunQueryRequest\n\n\t// limit is the limit on the number of results this iterator should return.\n\t// The zero value is used to prevent further fetches from the server.\n\t// A negative value means unlimited.\n\tlimit int32\n\t// offset is the number of results that still need to be skipped.\n\toffset int32\n\t// keysOnly records whether the query was keys-only (skip entity loading).\n\tkeysOnly bool\n\n\t// pageCursor is the compiled cursor for the next batch/page of result.\n\t// TODO(djd): Can we delete this in favour of paging with the last\n\t// entityCursor from each batch?\n\tpageCursor []byte\n\t// entityCursor is the compiled cursor of the next result.\n\tentityCursor []byte\n}\n\n// Next returns the key of the next result. When there are no more results,\n// iterator.Done is returned as the error.\n//\n// If the query is not keys only and dst is non-nil, it also loads the entity\n// stored for that key into the struct pointer or PropertyLoadSaver dst, with\n// the same semantics and possible errors as for the Get function.\nfunc (t *Iterator) Next(dst interface{}) (*Key, error) {\n\tk, e, err := t.next()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif dst != nil && !t.keysOnly {\n\t\terr = loadEntityProto(dst, e)\n\t}\n\treturn k, err\n}\n\nfunc (t *Iterator) next() (*Key, *pb.Entity, error) {\n\t// Fetch additional batches while there are no more results.\n\tfor t.err == nil && len(t.results) == 0 {\n\t\tt.err = t.nextBatch()\n\t}\n\tif t.err != nil {\n\t\treturn nil, nil, t.err\n\t}\n\n\t// Extract the next result, update cursors, and parse the entity's key.\n\te := t.results[0]\n\tt.results = t.results[1:]\n\tt.entityCursor = e.Cursor\n\tif len(t.results) == 0 {\n\t\tt.entityCursor = t.pageCursor // At the end of the batch.\n\t}\n\tif e.Entity.Key == nil {\n\t\treturn nil, nil, errors.New(\"datastore: internal error: server did not return a key\")\n\t}\n\tk, err := protoToKey(e.Entity.Key)\n\tif err != nil || k.Incomplete() {\n\t\treturn nil, nil, errors.New(\"datastore: internal error: server returned an invalid key\")\n\t}\n\n\treturn k, e.Entity, nil\n}\n\n// nextBatch makes a single call to the server for a batch of results.\nfunc (t *Iterator) nextBatch() error {\n\tif t.limit == 0 {\n\t\treturn iterator.Done // Short-circuits the zero-item response.\n\t}\n\n\t// Adjust the query with the latest start cursor, limit and offset.\n\tq := t.req.GetQuery()\n\tq.StartCursor = t.pageCursor\n\tq.Offset = t.offset\n\tif t.limit >= 0 {\n\t\tq.Limit = &wrapperspb.Int32Value{Value: t.limit}\n\t} else {\n\t\tq.Limit = nil\n\t}\n\n\t// Run the query.\n\tresp, err := t.client.client.RunQuery(t.ctx, t.req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Adjust any offset from skipped results.\n\tskip := resp.Batch.SkippedResults\n\tif skip < 0 {\n\t\treturn errors.New(\"datastore: internal error: negative number of skipped_results\")\n\t}\n\tt.offset -= skip\n\tif t.offset < 0 {\n\t\treturn errors.New(\"datastore: internal error: query skipped too many results\")\n\t}\n\tif t.offset > 0 && len(resp.Batch.EntityResults) > 0 {\n\t\treturn errors.New(\"datastore: internal error: query returned results before requested offset\")\n\t}\n\n\t// Adjust the limit.\n\tif t.limit >= 0 {\n\t\tt.limit -= int32(len(resp.Batch.EntityResults))\n\t\tif t.limit < 0 {\n\t\t\treturn errors.New(\"datastore: internal error: query returned more results than the limit\")\n\t\t}\n\t}\n\n\t// If there are no more results available, set limit to zero to prevent\n\t// further fetches. Otherwise, check that there is a next page cursor available.\n\tif resp.Batch.MoreResults != pb.QueryResultBatch_NOT_FINISHED {\n\t\tt.limit = 0\n\t} else if resp.Batch.EndCursor == nil {\n\t\treturn errors.New(\"datastore: internal error: server did not return a cursor\")\n\t}\n\n\t// Update cursors.\n\t// If any results were skipped, use the SkippedCursor as the next entity cursor.\n\tif skip > 0 {\n\t\tt.entityCursor = resp.Batch.SkippedCursor\n\t} else {\n\t\tt.entityCursor = q.StartCursor\n\t}\n\tt.pageCursor = resp.Batch.EndCursor\n\n\tt.results = resp.Batch.EntityResults\n\treturn nil\n}\n\n// Cursor returns a cursor for the iterator's current location.\nfunc (t *Iterator) Cursor() (Cursor, error) {\n\t// If there is still an offset, we need to the skip those results first.\n\tfor t.err == nil && t.offset > 0 {\n\t\tt.err = t.nextBatch()\n\t}\n\n\tif t.err != nil && t.err != iterator.Done {\n\t\treturn Cursor{}, t.err\n\t}\n\n\treturn Cursor{t.entityCursor}, nil\n}\n\n// Cursor is an iterator's position. It can be converted to and from an opaque\n// string. A cursor can be used from different HTTP requests, but only with a\n// query with the same kind, ancestor, filter and order constraints.\n//\n// The zero Cursor can be used to indicate that there is no start and/or end\n// constraint for a query.\ntype Cursor struct {\n\tcc []byte\n}\n\n// String returns a base-64 string representation of a cursor.\nfunc (c Cursor) String() string {\n\tif c.cc == nil {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimRight(base64.URLEncoding.EncodeToString(c.cc), \"=\")\n}\n\n// Decode decodes a cursor from its base-64 string representation.\nfunc DecodeCursor(s string) (Cursor, error) {\n\tif s == \"\" {\n\t\treturn Cursor{}, nil\n\t}\n\tif n := len(s) % 4; n != 0 {\n\t\ts += strings.Repeat(\"=\", 4-n)\n\t}\n\tb, err := base64.URLEncoding.DecodeString(s)\n\tif err != nil {\n\t\treturn Cursor{}, err\n\t}\n\treturn Cursor{b}, nil\n}\n"} +{"text": "1101#3#\n1102#4#\n1103#0#\n1104#3#\n1105#4#\n1106#0#\n1107#3#\n1108#4#\n1109#0#\n1110#2#\n1111#3#\n1112#0#\n1113#2#\n1114#3#\n1115#3#\n1116#3#\n1117#4#\n1118#0#\n1119#1#\n1120#2#\n1121#0#\n1122#2#\n1123#1#\n1124#0#\n1125#3#\n1126#2#\n1127#3#\n1128#2#\n1129#0#\n1130#0#\n1131#0#\n1132#0#\n1133#0#\n1134#0#\n1135#0#\n1136#0#\n1137#0#\n1138#0#\n1139#0#\n1140#0#\n1141#0#\n1151#2#\n1152#3#\n1153#0#\n1154#2#\n1155#3#\n1156#0#\n1157#1#\n1158#2#\n1159#0#\n1160#1#\n1161#0#\n1162#2#\n1163#0#\n1164#0#\n1165#0#\n1166#0#\n1167#0#\n1168#0#\n1169#0#\n1170#0#\n1201#3#\n1202#4#\n1203#0#\n1204#3#\n1205#4#\n1206#0#\n1207#3#\n1208#4#\n1209#0#\n1210#2#\n1211#3#\n1212#0#\n1213#2#\n1214#3#\n1215#0#\n1216#2#\n1217#3#\n1218#0#\n1219#2#\n1220#3#\n1221#0#\n1222#1#\n1223#0#\n1224#0#\n1225#0#\n1226#2#\n1227#0#\n1228#0#\n1229#0#\n1230#0#\n1231#0#\n1232#0#\n1233#0#\n1234#0#\n1235#0#\n1236#0#\n1237#0#\n1250#2#\n1251#3#\n1252#1#\n1253#2#\n1254#0#\n1255#1#\n1301#3#\n1302#4#\n1303#0#\n1304#0#\n1305#0#\n1351#3#\n1352#4#\n1353#0#\n1354#2#\n1355#3#\n1356#0#\n1357#1#\n1358#2#\n1359#0#\n1360#1#\n1361#2#\n1362#0#\n1363#0#\n1364#0#\n1365#0#\n1366#0#\n1367#0#\n1368#0#\n1369#0#\n1401#3#\n1402#4#\n1403#0#\n1404#3#\n1405#4#\n1406#0#\n1407#3#\n1408#4#\n1409#0#\n1410#0#\n1411#0#\n1412#0#\n1413#0#\n1414#0#\n1415#0#\n1416#0#\n1451#2#\n1452#3#\n1453#0#\n1454#2#\n1455#3#\n1456#0#\n1457#1#\n1458#2#\n1459#0#\n1460#2#\n1461#3#\n1462#0#\n1463#1#\n1464#2#\n1465#0#\n1466#0#\n1467#0#\n1468#0#\n1469#0#\n1470#0#\n1471#0#\n1501#3#\n1502#4#\n1503#0#\n1504#3#\n1505#4#\n1506#0#\n1507#2#\n1508#3#\n1509#3#\n1510#2#\n1511#3#\n1512#3#\n1513#1#\n1514#2#\n1515#2#\n1516#0#\n1517#1#\n1518#1#\n1519#2#\n1520#3#\n1521#3#\n1522#0#\n1523#0#\n1524#1#\n1525#0#\n1526#0#\n1527#0#\n1528#0#\n1550#3#\n1551#2#\n1552#1#\n1558#1#\n1601#3#\n1602#4#\n1603#0#\n1604#2#\n1605#3#\n1606#0#\n1607#2#\n1608#3#\n1609#0#\n1610#1#\n1611#2#\n1612#0#\n1613#0#\n1614#0#\n1615#0#\n1701#3#\n1702#4#\n1703#0#\n1704#3#\n1705#4#\n1706#0#\n1707#2#\n1708#3#\n1709#0#\n1710#2#\n1711#3#\n1712#0#\n1713#1#\n1714#1#\n1715#2#\n1716#2#\n1718#0#\n1719#0#\n1720#0#\n1801#3#\n1802#4#\n1803#2#\n1804#3#\n1805#2#\n1806#3#\n1807#0#\n1808#1#\n1809#1#\n1810#2#\n1811#1#\n1812#2#\n1813#0#\n1814#0#\n1901#3#\n1902#4#\n1903#2#\n1904#3#\n1905#2#\n1906#3#\n1907#0#\n1908#1#\n1909#1#\n1910#2#\n1911#1#\n1912#2#\n1950#3#\n1951#4#\n1952#2#\n1953#3#\n1954#2#\n1955#3#\n1956#0#\n1957#1#\n1958#1#\n1959#2#\n1960#1#\n1961#2#\n1962#0#\n1963#0#\n1964#0#\n2101#0#\n2102#1#\n2103#0#\n2104#1#\n2105#0#\n2106#1#\n2107#0#\n2108#1#\n2201#0#\n2202#1#\n2203#0#\n2204#1#\n2205#0#\n2206#0#\n2207#0#\n2208#0#\n2209#1#\n2210#0#\n2211#0#\n2212#0#\n2213#0#\n2214#0#\n2215#0#\n2216#0#\n2217#1#\n2218#0#\n2220#0#\n2221#1#\n2222#0#\n2223#1#\n2224#0#\n2225#1#\n2226#0#\n2227#1#\n2228#0#\n2229#1#\n2230#0#\n2231#1#\n2232#0#\n2233#1#\n2234#0#\n2235#0#\n2236#0#\n2237#0#\n2238#0#\n2239#0#\n2240#0#\n2241#0#\n2242#0#\n2243#0#\n2244#0#\n2245#0#\n2246#0#\n2247#0#\n2248#0#\n2249#0#\n2250#0#\n2251#0#\n2252#0#\n2253#0#\n2254#0#\n2255#0#\n2256#0#\n2257#0#\n2258#0#\n2259#0#\n2260#0#\n2261#0#\n2262#0#\n2263#0#\n2265#0#\n2266#0#\n2267#0#\n2268#0#\n2269#0#\n2270#0#\n2271#0#\n2272#0#\n2273#0#\n2274#0#\n2275#0#\n2276#0#\n2277#0#\n2279#0#\n2280#0#\n2282#0#\n2283#0#\n2284#0#\n2285#0#\n2286#0#\n2287#0#\n2289#0#\n2290#0#\n2291#0#\n2293#0#\n2294#0#\n2295#0#\n2296#0#\n2298#0#\n2299#0#\n2301#0#\n2302#1#\n2303#0#\n2304#1#\n2305#0#\n2306#1#\n2307#0#\n2308#1#\n2309#0#\n2310#1#\n2311#1#\n2312#0#\n2313#1#\n2314#0#\n2315#1#\n2316#0#\n2317#1#\n2318#1#\n2319#1#\n2320#1#\n2321#0#\n2322#1#\n2323#0#\n2324#1#\n2325#0#\n2326#1#\n2327#0#\n2328#0#\n2329#1#\n2330#0#\n2331#1#\n2332#0#\n2333#1#\n2334#0#\n2335#0#\n2336#1#\n2337#0#\n2338#0#\n2339#0#\n2401#0#\n2402#1#\n2403#0#\n2404#1#\n2405#0#\n2406#1#\n2407#0#\n2408#0#\n2409#0#\n2501#0#\n2502#1#\n2503#0#\n2504#1#\n2505#0#\n2506#1#\n2507#0#\n2508#0#\n2601#0#\n2602#0#\n2603#0#\n2604#0#\n2605#0#\n2607#1#\n2608#0#\n2609#0#\n2610#0#\n2611#0#\n2612#0#\n2613#0#\n2614#0#\n2615#0#\n2616#0#\n2617#0#\n2618#0#\n2619#0#\n2620#0#\n5001#0#\n5002#0#\n5003#0#\n5004#0#\n5006#0#\n5007#0#\n5008#0#\n5009#0#\n5010#0#\n5011#0#\n5012#0#\n5013#0#\n5014#0#\n5015#0#\n5016#0#\n5017#0#\n5018#0#\n5019#0#\n\n// ---- EP 2.0 ³»Ä£±¸ ¸ó½ºÅÍ Ãß°¡ ¾ÆÀÌÅÛ -----------\n\n2621#1#\n2622#1#\n2623#1#\n2624#1#\n2625#1#\n2626#1#\n2627#1#\n2628#1#\n\n// ---- EP 4.0 ÅÍÆ² ¾ÆÀÏ·£µå -----------\n\n1142#0#\n1143#0#\n1144#0#\n1238#0#\n1239#0#\n1240#0#\n1306#1#\n1417#1#\n1472#0#\n1473#0#\n1529#0#\n1530#0#\n1531#0#\n2410#0#\n2629#0#\n2630#0#\n5020#0#\n5021#0#\n5022#0#\n5023#0#\n5024#0#\n5025#0#\n5026#0#\n2199#0#\n5027#0#\n5028#0#\n5029#0#\n5030#0#\n5031#0#\n5032#0#\n5033#0#\n5034#0#\n5035#0#\n5036#0#\n5037#0#\n5038#0#\n5039#0#\n5040#0#\n5041#0#\n5042#0#\n5043#0#\n5044#0#\n5045#0#\n5046#0#\n5047#0#\n5048#0#\n5049#0#\n5050#0#\n5051#0#\n5052#0#\n5053#0#\n\n// ---- EP 5.0 À¯³ë - ÀÒ¾î¹ö¸° °í´ëÀÇ À¯»ê -----------\n\n2340#1#\n2341#0#\n2342#1#\n2411#0#\n2412#1#\n2413#0#\n2509#0#\n1721#1#\n1722#0#\n2344#0#\n2345#1#\n2346#0#\n2347#1#\n2348#0#\n2349#1#\n2350#0#\n2351#1#\n\n// --------- ´ÏÇÃÇìÀÓ ÀÌÈÄ Ãß°¡µÇ´Â Åõ±¸·ù -----------\n\n5057#0#\n5058#0#\n5059#0#\n5060#0#\n5061#0#\n5062#0#\n5063#0#\n5064#0#\n5065#0#\n5066#0#\n5067#0#\n5068#0#\n5069#0#\n5070#0#\n5071#0#\n5072#0#\n5073#0#\n5074#0#\n5075#0#\n5076#0#\n5077#0#\n5078#0#\n5079#0#\n5080#0#\n5081#0#\n5082#0#\n5083#0#\n5084#0#\n5085#0#\n5086#0#\n5087#0#\n5088#0#\n5089#0#\n5090#0#\n5091#0#\n5092#0#\n5093#1#\n5094#0#\n\n// -------- ¸ð¹ÙÀÏ ¶ó±×³ª·ÎÅ© ¸¶¹ý»çÆí ---------\n\n2415#1#\n2640#0#\n\n// -------- ¹Ì±¹ 2ÁÖ³â À̺¥Æ® --------\n\n2647#1#\n\n// -------- »õ¹«±âÆÐÄ¡ - ±â¾÷µµ½ÃÆí --------\n\n2113#1#\n2114#1#\n2115#1#\n2116#1#\n2353#1#\n2355#1#\n2416#1#\n2420#1#\n2512#1#\n2513#1#\n2514#1#\n2515#1#\n1264#4#\n1723#2#\n1146#1#\n1147#2#\n1148#1#\n1245#1#\n1246#2#\n2523#1#\n13003#1#\n13004#2#\n1560#2#\n1618#1#\n1620#1#\n1621#1#\n1622#2#\n\n// ------- »õÅõ±¸ÆÐÄ¡ - ±â¾÷µµ½ÃÆí --------\n5108#1#\n5119#1#\n5120#1#\n\n// -------- »õ¹«±âÆÐÄ¡2 - ±â¾÷µµ½ÃÆí --------\n\n5123#1#\n5125#1#\n13005#1#\n1561#1#\n1562#1#\n1815#1#\n\n// -------- ¸ð¹ÙÀÏ º¹»çÆí ----------\n\n2356#1#\n\n// -------- Ç︮¿Â Äù½ºÆ® ----------\n2658#1#\n\n// -------- ¸ð¹ÙÀÏ ±Ã¼öÆí ----------\n1725#1#\n\n// ------- 4ºÐ±â ¾ÆÀÌÅÛ-¹ß۸® ----------\n2357#1#\n2421#1#\n2524#1#\n\n// ------- ÀϺ» ÇÑÁ¤ÆÇÆÐŰÁö -----------\n5143#1#\n5141#1#\n5137#1#\n5140#1#\n\n// ------------- ÀϺ» RJC -------------\n2669#1#\n\n\n// ---------------- 1Â÷È®ÀåÁ÷¾÷±º - ´ÑÀÚ ----------------\n2117#0#\n2118#1#\n2119#0#\n2120#1#\n\n13006#0#\n13007#0#\n13008#1#\n13009#0#\n13010#2#\n13011#3#\n13012#1#\n13013#2#\n13014#0#\n13015#1#\n\n13300#0#\n13301#3#\n13302#4#\n13303#0#\n\n// ---------------- 1Â÷È®ÀåÁ÷¾÷±º - °Ç³Ê ----------------\n\n13100#1#\n13101#2#\n13102#1#\n13103#2#\n13104#1#\n13105#2#\n13106#0#\n13150#3#\n13151#1#\n13152#2#\n13153#1#\n13154#1#\n13155#1#\n13156#0#\n13157#1#\n13158#0#\n13159#1#\n13160#0#\n13161#1#\n13162#1#\n\n\n// ---------------- RO OST ¾ÆÀÌÅÛ ---------------------\n\n5151#1#\n\n// ---------------- ¼ÒÄÏÀÎæƮ Ãß°¡¾ÆÀÌÅÛ ------------------\n\n1816#1#\n1532#2#\n1418#2#\n13016#2#\n13017#1#\n13018#1#\n13019#1#\n1149#2#\n13400#1#\n1476#1#\n1266#1#\n1171#2#\n1172#2#\n1726#1#\n1727#1#\n5166#1#\n5157#1#\n5158#1#\n5159#1#\n5160#1#\n5161#1#\n5162#1#\n5163#1#\n5164#1#\n5165#1#\n2671#1#\n2525#1#\n2359#1#\n2360#1#\n2121#1#\n5167#1#\n5168#1#\n\n\n// ----------------- »ó¹Ý±â Åõ±¸Ãß°¡ ---------------------\n\n5169#1#\n5170#0#\n5171#1#\n5172#0#\n5173#1#\n5174#1#\n5175#0#\n5176#0#\n5177#1#\n\n2521#1#\n2422#1#\n\n// -------------- ÀϺ» 2006 À̺¥Æ® --------------------\n\n5181#1#\n5182#0#\n5183#0#\n5184#0#\n5185#1#\n5186#0#\n5187#1#\n// ------------ Àεµ³×½Ã¾Æ 2006 µ¶¸³À̺¥Æ® ---------------\n5190#1#\n\n// -------------- ÀϺ» 2006 ¸®º» --------------------\n\n5191#1#\n5192#1#\n5193#1#\n5194#1#\n5195#1#\n5196#1#\n5197#1#\n//----------- ¹ÙÀÌºí ¶óÀ̵å¿öµå ¸ðÀÚ ------------\n5208#1#\n\n// --------- ÀϺ» ¾Ö´Ï¹ö¼­¸® ÆÐŰÁö ¾ÆÀÌÅÛ ----------\n5211#1#\n5212#1#\n\n// ---------- avex ¸®¹Í½º ¾ÆÀÌÅÛ ------------\n5225#1#\n\n// ---------------- Å丣 È­»ê ½Å±Ô Àåºñ ¾ÆÀÌÅÛ ------------------\n1371#1#\n13164#1#\n13166#1#\n13168#1#\n13169#2#\n\n// --------------- ¸ðÀÚ µðÀÚÀδëȸ ¼ö»óÀÛ°ú ´ë¸¸ ÇÁ·ÎÆç¶ó ----------------\n5253#1#\n5256#1#\n5258#1#\n\n// --------------- ·¯½Ã¾Æ »ó¹Ý±â À̺¥Æ® ¾ÆÀÌÅÛ ---------------------\n5243#1#\n\n// --------------- À½¿øÅõ±¸ ----------------------------------\n5270#1#\n5271#1#\n\n// ---------------- ű¹ ¼Û²ô¶õ À̺¥Æ® --------------\n5802#1#\n\n// ------------------- 11.3 ½Å±Ô Àåºñ ¾ÆÀÌÅÛ --------------------------\n2123#1#\n2124#1#\n2125#1#\n2364#1#\n2365#1#\n2366#1#\n2367#1#\n2424#1#\n2527#1#\n2528#1#\n2530#1#\n2531#1#\n2532#1#\n2701#1#\n2702#1#\n2703#1#\n1175#1#\n1176#2#\n1268#1#\n1270#1#\n1271#2#\n1375#2#\n1376#1#\n1377#1#\n2000#1#\n13304#2#\n1730#1#\n1731#1#\n1732#1#\n1733#1#\n13404#1#\n13405#2#\n13027#3#\n13028#1#\n1420#1#\n1421#1#\n1422#1#\n1535#1#\n1564#2#\n1565#2#\n1624#2#\n1818#3#\n1819#3#\n1820#3#\n1821#3#\n1822#4#\n1919#1#\n1972#2#\n1973#1#\n13107#2#\n13170#2#\n\n// ------------------ 2007 À¯·´ »ýÀÏ À̺¥Æ® --------------------\n5282#1#\n\n// -------------- ÀϺ» Åõ±¸ 12Á¾ -----------------\n5284#1#\n5285#1#\n5287#1#\n\n// --------------- °¡À幫µµÈ¸ »óÀÚ ¹× Åõ±¸ ---------------\n5296#1#\n5297#1#\n5298#1#\n5299#1#\n\n// --------------- ºê¶óÁú ¸ðÀÚ ÄÁÅ×½ºÆ® ´ç¼±ÀÛ --------------------\n5304#1#\n\n// --------------- ºê¶óÁú ij½¬ ¾ÆÀÌÅÛ 20070605 ------------\n5308#1#\n\n// ------------------ ű¹ ÆÐŰÁö Åõ±¸ ¾ÆÀÌÅÛ ------------------\n5310#1#\n5311#1#\n5312#1#\n5313#1#\n\n// ----------- ¿µ¿õ¼­±â ¾ÆÀÌÅÛ ------------\n5191#1#\n\n// -------------- 2007³â 9¿ù ÀϺ» ¸ð¹ÙÀÏ Åõ±¸ 13Á¾ -----------------\n5340#1#\n5341#1#\n5342#1#\n5343#1#\n5344#1#\n5345#1#\n\n// ------------- ÇϾÇÅ×½ºÆ® -------------\n5351#1#\n5347#1#\n5348#1#\n5349#1#\n5350#1#\n2371#1#\n2372#1#\n2373#1#\n2128#1#\n2432#1#\n2715#1#\n1568#3#\n1569#3#\n1570#3#\n1571#3#\n1309#4#\n1538#2#\n1539#2#\n1540#1#\n13030#2#\n13031#3#\n13032#3#\n13033#1#\n1922#2#\n1976#2#\n1275#3#\n1276#3#\n1277#3#\n1278#3#\n1479#1#\n1480#2#\n1481#3#\n1178#2#\n1179#1#\n1180#2#\n2434#1#\n5353#1#\n\n// ------------- ¸¶¿Õ ¸ð·ÎÅ© -------------\n2537#1#\n2728#1#\n2729#1#\n2730#1#\n2731#1#\n2732#1#\n2374#1#\n2375#1#\n2433#1#\n2536#1#\n5808#1#\n\n// ---------- ÇÒ¦ Å×½ºÆ® -----------\n2716#1#\n2718#1#\n1629#1#\n1631#1#\n13034#2#\n13035#4#\n1572#2#\n1573#2#\n1736#3#\n1737#1#\n1181#2#\n1182#2#\n2130#1#\n2131#1#\n\n// ---------- ÀüÀå ¾ÆÀÌÅÛ -----------\n2538#1#\n2539#1#\n2540#1#\n2435#1#\n2436#1#\n2437#1#\n2376#1#\n2377#1#\n2378#1#\n2379#1#\n2380#1#\n2381#1#\n2382#1#\n\n// -------------- ÀϺ» ¸ó½ºÅÍ »çÀÌµå ½ºÅ丮 À̺¥Æ® -----------------\n2714#1#\n\n// ------------ ¸Þ¸ð¸®¾ó ´øÀü º¸»óÅÛ ----------------\n13412#3#\n13413#3#\n1185#2#\n2542#1#\n\n// -------- ÀϺ» À¯Àú °ø¸ð ¸ðÀÚ --------------\n5379#1#\n\n// -------- 2007 ÀϺ» ¿¬¸» ij½¬¾ÆÀÌÅÛ ----------\n5381#1#\n5382#1#\n\n// ---------- ¸ð¹ÙÀÏ ¾ÆÀÌÅÛ ------------\n5383#1#\n\n// --------------- Çʸ®ÆÇ ÀÚüÁ¦ÀÛ Åõ±¸ 7Á¾ -------------\n5376#1#\n5375#1#\n\n// --------- ű¹ ¸ðÀÚ ¾ÆÀÌÅÛ -------------\n5387#1#\n5388#1#\n\n// --------- Àεµ³×½Ã¾Æ ¸ðÀÚ¾ÆÀÌÅÛ -------------\n5392#1#\n\n// --------- Çʸ®ÇÉ Å¬¸°¾÷ -------------\n2546#1#\n\n// -------------- 2008 ÀϺ» ¾ÆÀÌÅÛ Á¦ 2ź -----------------\n5404#1#\n\n// -------------- 2008 ÀϺ» ¾ÆÀÌÅÛ Åõ±¸ 2ź -----------------\n5363#1#\n5364#1#\n5365#1#\n5367#1#\n\n// -------------- ÀϺ» ¸ðÇèÀÚ ¾ÆÄ«µ¥¹Ì ¸ðÀÚ ¹îÁö -----------------\n5407#1#\n\n// --------- EP13 ½Å±Ô Àåºñ ¾ÆÀÌÅÛ ---------------\n5398#1#\n5399#1#\n2387#1#\n2388#1#\n2389#1#\n2390#1#\n2391#1#\n2440#1#\n2544#1#\n2545#1#\n2133#1#\n2134#1#\n2135#1#\n2745#1#\n2749#1#\n1186#2#\n1483#1#\n1484#1#\n1485#4#\n1740#2#\n1741#1#\n13414#3#\n1544#3#\n1825#3#\n13038#3#\n13039#2#\n1979#2#\n1980#3#\n1925#3#\n1926#2#\n\n// -------- Ãʺ¸ÀÚÁ¸ ¾ÆÀÌÅÛ -----------\n2393#1#\n//---------item Dec 2009--------\n5591#1#\n5738#1#\n5575#1#\n5667#1#\n\n5147#1#"} +{"text": "module.exports = {\n testURL: 'http://localhost:8000',\n preset: 'jest-puppeteer',\n};\n"} +{"text": "\n\n\n\nabc\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"} +{"text": "\n// Copyright Aleksey Gurtovoy 2001-2004\n//\n// Distributed under the Boost Software License, Version 1.0. \n// (See accompanying file LICENSE_1_0.txt or copy at \n// http://www.boost.org/LICENSE_1_0.txt)\n//\n\n// Preprocessed version of \"boost/mpl/aux_/full_lambda.hpp\" header\n// -- DO NOT modify by hand!\n\nnamespace pdalboost { namespace mpl {\n\nnamespace aux {\n\ntemplate<\n bool C1 = false, bool C2 = false, bool C3 = false, bool C4 = false\n , bool C5 = false\n >\nstruct lambda_or\n : true_\n{\n};\n\ntemplate<>\nstruct lambda_or< false,false,false,false,false >\n : false_\n{\n};\n\n} // namespace aux\n\ntemplate<\n typename T\n , typename Tag\n \n >\nstruct lambda\n{\n typedef false_ is_le;\n typedef T result_;\n typedef T type;\n};\n\ntemplate<\n typename T\n >\nstruct is_lambda_expression\n : lambda::is_le\n{\n};\n\ntemplate< int N, typename Tag >\nstruct lambda< arg, Tag >\n{\n typedef true_ is_le;\n typedef mpl::arg result_; // qualified for the sake of MIPSpro 7.41\n typedef mpl::protect type;\n};\n\ntemplate<\n typename F\n , typename Tag\n >\nstruct lambda<\n bind0\n , Tag\n \n >\n{\n typedef false_ is_le;\n typedef bind0<\n F\n > result_;\n\n typedef result_ type;\n};\n\nnamespace aux {\n\ntemplate<\n typename IsLE, typename Tag\n , template< typename P1 > class F\n , typename L1\n >\nstruct le_result1\n{\n typedef F<\n typename L1::type\n > result_;\n\n typedef result_ type;\n};\n\ntemplate<\n typename Tag\n , template< typename P1 > class F\n , typename L1\n >\nstruct le_result1< true_,Tag,F,L1 >\n{\n typedef bind1<\n quote1< F,Tag >\n , typename L1::result_\n > result_;\n\n typedef mpl::protect type;\n};\n\n} // namespace aux\n\ntemplate<\n template< typename P1 > class F\n , typename T1\n , typename Tag\n >\nstruct lambda<\n F\n , Tag\n \n >\n{\n typedef lambda< T1,Tag > l1;\n typedef typename l1::is_le is_le1;\n typedef typename aux::lambda_or<\n is_le1::value\n >::type is_le;\n\n typedef aux::le_result1<\n is_le, Tag, F, l1\n > le_result_;\n\n typedef typename le_result_::result_ result_;\n typedef typename le_result_::type type;\n};\n\ntemplate<\n typename F, typename T1\n , typename Tag\n >\nstruct lambda<\n bind1< F,T1 >\n , Tag\n \n >\n{\n typedef false_ is_le;\n typedef bind1<\n F\n , T1\n > result_;\n\n typedef result_ type;\n};\n\nnamespace aux {\n\ntemplate<\n typename IsLE, typename Tag\n , template< typename P1, typename P2 > class F\n , typename L1, typename L2\n >\nstruct le_result2\n{\n typedef F<\n typename L1::type, typename L2::type\n > result_;\n\n typedef result_ type;\n};\n\ntemplate<\n typename Tag\n , template< typename P1, typename P2 > class F\n , typename L1, typename L2\n >\nstruct le_result2< true_,Tag,F,L1,L2 >\n{\n typedef bind2<\n quote2< F,Tag >\n , typename L1::result_, typename L2::result_\n > result_;\n\n typedef mpl::protect type;\n};\n\n} // namespace aux\n\ntemplate<\n template< typename P1, typename P2 > class F\n , typename T1, typename T2\n , typename Tag\n >\nstruct lambda<\n F< T1,T2 >\n , Tag\n \n >\n{\n typedef lambda< T1,Tag > l1;\n typedef lambda< T2,Tag > l2;\n \n typedef typename l1::is_le is_le1;\n typedef typename l2::is_le is_le2;\n \n\n typedef typename aux::lambda_or<\n is_le1::value, is_le2::value\n >::type is_le;\n\n typedef aux::le_result2<\n is_le, Tag, F, l1, l2\n > le_result_;\n\n typedef typename le_result_::result_ result_;\n typedef typename le_result_::type type;\n};\n\ntemplate<\n typename F, typename T1, typename T2\n , typename Tag\n >\nstruct lambda<\n bind2< F,T1,T2 >\n , Tag\n \n >\n{\n typedef false_ is_le;\n typedef bind2<\n F\n , T1, T2\n > result_;\n\n typedef result_ type;\n};\n\nnamespace aux {\n\ntemplate<\n typename IsLE, typename Tag\n , template< typename P1, typename P2, typename P3 > class F\n , typename L1, typename L2, typename L3\n >\nstruct le_result3\n{\n typedef F<\n typename L1::type, typename L2::type, typename L3::type\n > result_;\n\n typedef result_ type;\n};\n\ntemplate<\n typename Tag\n , template< typename P1, typename P2, typename P3 > class F\n , typename L1, typename L2, typename L3\n >\nstruct le_result3< true_,Tag,F,L1,L2,L3 >\n{\n typedef bind3<\n quote3< F,Tag >\n , typename L1::result_, typename L2::result_, typename L3::result_\n > result_;\n\n typedef mpl::protect type;\n};\n\n} // namespace aux\n\ntemplate<\n template< typename P1, typename P2, typename P3 > class F\n , typename T1, typename T2, typename T3\n , typename Tag\n >\nstruct lambda<\n F< T1,T2,T3 >\n , Tag\n \n >\n{\n typedef lambda< T1,Tag > l1;\n typedef lambda< T2,Tag > l2;\n typedef lambda< T3,Tag > l3;\n \n typedef typename l1::is_le is_le1;\n typedef typename l2::is_le is_le2;\n typedef typename l3::is_le is_le3;\n \n\n typedef typename aux::lambda_or<\n is_le1::value, is_le2::value, is_le3::value\n >::type is_le;\n\n typedef aux::le_result3<\n is_le, Tag, F, l1, l2, l3\n > le_result_;\n\n typedef typename le_result_::result_ result_;\n typedef typename le_result_::type type;\n};\n\ntemplate<\n typename F, typename T1, typename T2, typename T3\n , typename Tag\n >\nstruct lambda<\n bind3< F,T1,T2,T3 >\n , Tag\n \n >\n{\n typedef false_ is_le;\n typedef bind3<\n F\n , T1, T2, T3\n > result_;\n\n typedef result_ type;\n};\n\nnamespace aux {\n\ntemplate<\n typename IsLE, typename Tag\n , template< typename P1, typename P2, typename P3, typename P4 > class F\n , typename L1, typename L2, typename L3, typename L4\n >\nstruct le_result4\n{\n typedef F<\n typename L1::type, typename L2::type, typename L3::type\n , typename L4::type\n > result_;\n\n typedef result_ type;\n};\n\ntemplate<\n typename Tag\n , template< typename P1, typename P2, typename P3, typename P4 > class F\n , typename L1, typename L2, typename L3, typename L4\n >\nstruct le_result4< true_,Tag,F,L1,L2,L3,L4 >\n{\n typedef bind4<\n quote4< F,Tag >\n , typename L1::result_, typename L2::result_, typename L3::result_\n , typename L4::result_\n > result_;\n\n typedef mpl::protect type;\n};\n\n} // namespace aux\n\ntemplate<\n template< typename P1, typename P2, typename P3, typename P4 > class F\n , typename T1, typename T2, typename T3, typename T4\n , typename Tag\n >\nstruct lambda<\n F< T1,T2,T3,T4 >\n , Tag\n \n >\n{\n typedef lambda< T1,Tag > l1;\n typedef lambda< T2,Tag > l2;\n typedef lambda< T3,Tag > l3;\n typedef lambda< T4,Tag > l4;\n \n typedef typename l1::is_le is_le1;\n typedef typename l2::is_le is_le2;\n typedef typename l3::is_le is_le3;\n typedef typename l4::is_le is_le4;\n \n\n typedef typename aux::lambda_or<\n is_le1::value, is_le2::value, is_le3::value, is_le4::value\n >::type is_le;\n\n typedef aux::le_result4<\n is_le, Tag, F, l1, l2, l3, l4\n > le_result_;\n\n typedef typename le_result_::result_ result_;\n typedef typename le_result_::type type;\n};\n\ntemplate<\n typename F, typename T1, typename T2, typename T3, typename T4\n , typename Tag\n >\nstruct lambda<\n bind4< F,T1,T2,T3,T4 >\n , Tag\n \n >\n{\n typedef false_ is_le;\n typedef bind4<\n F\n , T1, T2, T3, T4\n > result_;\n\n typedef result_ type;\n};\n\nnamespace aux {\n\ntemplate<\n typename IsLE, typename Tag\n , template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F\n , typename L1, typename L2, typename L3, typename L4, typename L5\n >\nstruct le_result5\n{\n typedef F<\n typename L1::type, typename L2::type, typename L3::type\n , typename L4::type, typename L5::type\n > result_;\n\n typedef result_ type;\n};\n\ntemplate<\n typename Tag\n , template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F\n , typename L1, typename L2, typename L3, typename L4, typename L5\n >\nstruct le_result5< true_,Tag,F,L1,L2,L3,L4,L5 >\n{\n typedef bind5<\n quote5< F,Tag >\n , typename L1::result_, typename L2::result_, typename L3::result_\n , typename L4::result_, typename L5::result_\n > result_;\n\n typedef mpl::protect type;\n};\n\n} // namespace aux\n\ntemplate<\n template<\n typename P1, typename P2, typename P3, typename P4\n , typename P5\n >\n class F\n , typename T1, typename T2, typename T3, typename T4, typename T5\n , typename Tag\n >\nstruct lambda<\n F< T1,T2,T3,T4,T5 >\n , Tag\n \n >\n{\n typedef lambda< T1,Tag > l1;\n typedef lambda< T2,Tag > l2;\n typedef lambda< T3,Tag > l3;\n typedef lambda< T4,Tag > l4;\n typedef lambda< T5,Tag > l5;\n \n typedef typename l1::is_le is_le1;\n typedef typename l2::is_le is_le2;\n typedef typename l3::is_le is_le3;\n typedef typename l4::is_le is_le4;\n typedef typename l5::is_le is_le5;\n \n\n typedef typename aux::lambda_or<\n is_le1::value, is_le2::value, is_le3::value, is_le4::value\n , is_le5::value\n >::type is_le;\n\n typedef aux::le_result5<\n is_le, Tag, F, l1, l2, l3, l4, l5\n > le_result_;\n\n typedef typename le_result_::result_ result_;\n typedef typename le_result_::type type;\n};\n\ntemplate<\n typename F, typename T1, typename T2, typename T3, typename T4\n , typename T5\n , typename Tag\n >\nstruct lambda<\n bind5< F,T1,T2,T3,T4,T5 >\n , Tag\n \n >\n{\n typedef false_ is_le;\n typedef bind5<\n F\n , T1, T2, T3, T4, T5\n > result_;\n\n typedef result_ type;\n};\n\n/// special case for 'protect'\ntemplate< typename T, typename Tag >\nstruct lambda< mpl::protect, Tag >\n{\n typedef false_ is_le;\n typedef mpl::protect result_;\n typedef result_ type;\n};\n\n/// specializations for the main 'bind' form\n\ntemplate<\n typename F, typename T1, typename T2, typename T3, typename T4\n , typename T5\n , typename Tag\n >\nstruct lambda<\n bind< F,T1,T2,T3,T4,T5 >\n , Tag\n \n >\n{\n typedef false_ is_le;\n typedef bind< F,T1,T2,T3,T4,T5 > result_;\n typedef result_ type;\n};\n\n/// workaround for MWCW 8.3+/EDG < 303, leads to ambiguity on Digital Mars\n\ntemplate<\n typename F, typename Tag1, typename Tag2\n >\nstruct lambda<\n lambda< F,Tag1 >\n , Tag2\n >\n{\n typedef lambda< F,Tag2 > l1;\n typedef lambda< Tag1,Tag2 > l2;\n typedef typename l1::is_le is_le;\n typedef aux::le_result2 le_result_;\n typedef typename le_result_::result_ result_;\n typedef typename le_result_::type type;\n};\n\nBOOST_MPL_AUX_NA_SPEC(2, lambda)\n\n}}\n\n"} +{"text": "/*\n * Copyright 1998-2006 Sun Microsystems, Inc. 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. Sun designates this\n * particular file as subject to the \"Classpath\" exception as provided\n * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,\n * CA 95054 USA or visit www.sun.com if you need additional information or\n * have any questions.\n */\n\npackage org.omg.CORBA;\n\n/**\n * Standard exception thrown\n * when an invocation cannot be made because of an incompatibility between\n * Policy overrides that apply to the particular invocation.\n * It contains a minor code, which gives more detailed information about\n * what caused the exception, and a completion status. It may also contain\n * a string describing the exception.\n *\n * @see documentation on\n * Java IDL exceptions\n */\n\npublic final class INV_POLICY extends SystemException {\n /**\n * Constructs a INV_POLICY exception with a default minor code\n * of 0, a completion state of CompletionStatus.COMPLETED_NO,\n * and a null description.\n */\n public INV_POLICY() {\n this(\"\");\n }\n\n /**\n * Constructs a INV_POLICY exception with the\n * specified description message,\n * a minor code of 0, and a completion state of COMPLETED_NO.\n * @param s the String containing a detail message\n */\n public INV_POLICY(String s) {\n this(s, 0, CompletionStatus.COMPLETED_NO);\n }\n\n /**\n * Constructs a INV_POLICY exception with the specified\n * minor code and completion status.\n * @param minor the minor code\n * @param completed the completion status\n */\n public INV_POLICY(int minor, CompletionStatus completed) {\n this(\"\", minor, completed);\n }\n\n /**\n * Constructs a INV_POLICY exception with the\n * specified description message, minor code, and completion status.\n * @param s the String containing a description message\n * @param minor the minor code\n * @param completed the completion status\n */\n public INV_POLICY(String s, int minor, CompletionStatus completed) {\n super(s, minor, completed);\n }\n}\n"} +{"text": "xyyz\nfooxy\nxyfoo\nfooxybar\n"} +{"text": "/// \n/// \n/// "} +{"text": "import { Action } from '@ngrx/store';\nimport * as actionTypes from '@app/store-actions/action-types';\n\nexport class CloseWebSocketAction implements Action {\n readonly type = actionTypes.CLOSE_WEBSOCKET;\n\n constructor() {}\n}\n"} +{"text": "// Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.\n\n#include \"stdafx.h\"\n#include \"FragmentSplitter.h\"\n\n#include \"MannequinDialog.h\"\n\nIMPLEMENT_DYNAMIC(CFragmentSplitter, CClampedSplitterWnd)\n\nBEGIN_MESSAGE_MAP(CFragmentSplitter, CClampedSplitterWnd)\nON_WM_SETFOCUS()\nEND_MESSAGE_MAP()\n\nvoid CFragmentSplitter::OnSetFocus(CWnd* pOldWnd)\n{\n\t__super::OnSetFocus(pOldWnd);\n\n\tif (auto pMannequinDialog = CMannequinDialog::GetCurrentInstance())\n\t{\n\t\tif (auto pDockingPaneManager = pMannequinDialog->GetDockingPaneManager())\n\t\t{\n\t\t\tif (pDockingPaneManager->IsPaneSelected(CMannequinDialog::IDW_PREVIEWER_PANE) == false)\n\t\t\t{\n\t\t\t\tpDockingPaneManager->ShowPane(CMannequinDialog::IDW_FRAGMENT_EDITOR_PANE, FALSE);\n\t\t\t}\n\t\t}\n\t}\n}\n"} +{"text": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n text/microsoft-resx\n \n \n 2.0\n \n \n System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\n \n \n System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\n \n"} +{"text": "tsk_caseuco_jar = $(top_builddir)/case-uco/java/dist/sleuthkit-caseuco-$(PACKAGE_VERSION).jar\njardir = $(prefix)/share/java\njar_DATA = $(tsk_caseuco_jar)\n\nif OFFLINE\n ant_args=-Doffline=true\nelse\n\nendif\n\n\n$(tsk_caseuco_jar):\n\nall-local:\n\tant $(ant_args)\n\nCLEANFILES = $(tsk_caseuco_jar)\n\nclean-local:\n\tant clean\n"} +{"text": "var convert = require('./convert'),\n func = convert('sortedIndexOf', require('../sortedIndexOf'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n"} +{"text": "// dnlib: See LICENSE.txt for more info\n\nnamespace dnlib.DotNet {\n\t/// \n\t/// Access to .NET core library's simple types\n\t/// \n\tpublic interface ICorLibTypes {\n\t\t/// \n\t\t/// Gets a System.Void\n\t\t/// \n\t\tCorLibTypeSig Void { get; }\n\n\t\t/// \n\t\t/// Gets a System.Boolean\n\t\t/// \n\t\tCorLibTypeSig Boolean { get; }\n\n\t\t/// \n\t\t/// Gets a System.Char\n\t\t/// \n\t\tCorLibTypeSig Char { get; }\n\n\t\t/// \n\t\t/// Gets a System.SByte\n\t\t/// \n\t\tCorLibTypeSig SByte { get; }\n\n\t\t/// \n\t\t/// Gets a System.Byte\n\t\t/// \n\t\tCorLibTypeSig Byte { get; }\n\n\t\t/// \n\t\t/// Gets a System.Int16\n\t\t/// \n\t\tCorLibTypeSig Int16 { get; }\n\n\t\t/// \n\t\t/// Gets a System.UInt16\n\t\t/// \n\t\tCorLibTypeSig UInt16 { get; }\n\n\t\t/// \n\t\t/// Gets a System.Int32\n\t\t/// \n\t\tCorLibTypeSig Int32 { get; }\n\n\t\t/// \n\t\t/// Gets a System.UInt32\n\t\t/// \n\t\tCorLibTypeSig UInt32 { get; }\n\n\t\t/// \n\t\t/// Gets a System.Int64\n\t\t/// \n\t\tCorLibTypeSig Int64 { get; }\n\n\t\t/// \n\t\t/// Gets a System.UInt64\n\t\t/// \n\t\tCorLibTypeSig UInt64 { get; }\n\n\t\t/// \n\t\t/// Gets a System.Single\n\t\t/// \n\t\tCorLibTypeSig Single { get; }\n\n\t\t/// \n\t\t/// Gets a System.Double\n\t\t/// \n\t\tCorLibTypeSig Double { get; }\n\n\t\t/// \n\t\t/// Gets a System.String\n\t\t/// \n\t\tCorLibTypeSig String { get; }\n\n\t\t/// \n\t\t/// Gets a System.TypedReference\n\t\t/// \n\t\tCorLibTypeSig TypedReference { get; }\n\n\t\t/// \n\t\t/// Gets a System.IntPtr\n\t\t/// \n\t\tCorLibTypeSig IntPtr { get; }\n\n\t\t/// \n\t\t/// Gets a System.UIntPtr\n\t\t/// \n\t\tCorLibTypeSig UIntPtr { get; }\n\n\t\t/// \n\t\t/// Gets a System.Object\n\t\t/// \n\t\tCorLibTypeSig Object { get; }\n\n\t\t/// \n\t\t/// Gets the assembly reference to the core library\n\t\t/// \n\t\tAssemblyRef AssemblyRef { get; }\n\n\t\t/// \n\t\t/// Gets a that references a type in the core library assembly\n\t\t/// \n\t\t/// Namespace of type (eg. \"System\")\n\t\t/// Name of type\n\t\t/// A instance. This instance may be a cached instance.\n\t\tTypeRef GetTypeRef(string @namespace, string name);\n\t}\n\n\tpublic static partial class Extensions {\n\t\t/// \n\t\t/// Gets a if matches a primitive type.\n\t\t/// \n\t\t/// this\n\t\t/// The type\n\t\t/// A or null if it didn't match any primitive type\n\t\tpublic static CorLibTypeSig GetCorLibTypeSig(this ICorLibTypes self, ITypeDefOrRef type) {\n\t\t\tCorLibTypeSig corLibType;\n\n\t\t\tif (type is TypeDef td &&\n\t\t\t\ttd.DeclaringType is null &&\n\t\t\t\t!((corLibType = self.GetCorLibTypeSig(td.Namespace, td.Name, td.DefinitionAssembly)) is null)) {\n\t\t\t\treturn corLibType;\n\t\t\t}\n\n\t\t\tif (type is TypeRef tr &&\n\t\t\t\t!(tr.ResolutionScope is TypeRef) &&\n\t\t\t\t!((corLibType = self.GetCorLibTypeSig(tr.Namespace, tr.Name, tr.DefinitionAssembly)) is null)) {\n\t\t\t\treturn corLibType;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/// \n\t\t/// Gets a if and\n\t\t/// matches a primitive type.\n\t\t/// \n\t\t/// this\n\t\t/// Namespace\n\t\t/// Name\n\t\t/// Definition assembly\n\t\t/// A or null if it didn't match any primitive type\n\t\tpublic static CorLibTypeSig GetCorLibTypeSig(this ICorLibTypes self, UTF8String @namespace, UTF8String name, IAssembly defAsm) =>\n\t\t\tself.GetCorLibTypeSig(UTF8String.ToSystemStringOrEmpty(@namespace), UTF8String.ToSystemStringOrEmpty(name), defAsm);\n\n\t\t/// \n\t\t/// Gets a if and\n\t\t/// matches a primitive type.\n\t\t/// \n\t\t/// this\n\t\t/// Namespace\n\t\t/// Name\n\t\t/// Definition assembly\n\t\t/// A or null if it didn't match any primitive type\n\t\tpublic static CorLibTypeSig GetCorLibTypeSig(this ICorLibTypes self, string @namespace, string name, IAssembly defAsm) {\n\t\t\tif (@namespace != \"System\")\n\t\t\t\treturn null;\n\t\t\tif (defAsm is null || !defAsm.IsCorLib())\n\t\t\t\treturn null;\n\t\t\treturn name switch {\n\t\t\t\t\"Void\" => self.Void,\n\t\t\t\t\"Boolean\" => self.Boolean,\n\t\t\t\t\"Char\" => self.Char,\n\t\t\t\t\"SByte\" => self.SByte,\n\t\t\t\t\"Byte\" => self.Byte,\n\t\t\t\t\"Int16\" => self.Int16,\n\t\t\t\t\"UInt16\" => self.UInt16,\n\t\t\t\t\"Int32\" => self.Int32,\n\t\t\t\t\"UInt32\" => self.UInt32,\n\t\t\t\t\"Int64\" => self.Int64,\n\t\t\t\t\"UInt64\" => self.UInt64,\n\t\t\t\t\"Single\" => self.Single,\n\t\t\t\t\"Double\" => self.Double,\n\t\t\t\t\"String\" => self.String,\n\t\t\t\t\"TypedReference\" => self.TypedReference,\n\t\t\t\t\"IntPtr\" => self.IntPtr,\n\t\t\t\t\"UIntPtr\" => self.UIntPtr,\n\t\t\t\t\"Object\" => self.Object,\n\t\t\t\t_ => null,\n\t\t\t};\n\t\t}\n\t}\n}\n"} +{"text": "// Copyright (c) 2018 Loup Inc.\n// Licensed under Apache License v2.0\n\npackage app.loup.geolocation\n\nimport app.loup.geolocation.data.LocationUpdatesRequest\nimport app.loup.geolocation.data.Permission\nimport app.loup.geolocation.data.PermissionRequest\nimport app.loup.geolocation.location.LocationClient\nimport io.flutter.plugin.common.EventChannel\nimport io.flutter.plugin.common.MethodCall\nimport io.flutter.plugin.common.MethodChannel\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.GlobalScope\nimport kotlinx.coroutines.launch\n\n\nclass Handler(private val locationClient: LocationClient) : MethodChannel.MethodCallHandler, EventChannel.StreamHandler {\n\n\n private fun isLocationOperational(permission: Permission, result: MethodChannel.Result) {\n result.success(Codec.encodeResult(locationClient.isLocationOperational(permission)))\n }\n\n private fun requestLocationPermission(permission: PermissionRequest, result: MethodChannel.Result) {\n GlobalScope.launch(Dispatchers.Main) {\n result.success(Codec.encodeResult(locationClient.requestLocationPermission(permission)))\n }\n }\n\n private fun enableLocationSettings(result: MethodChannel.Result) {\n GlobalScope.launch(Dispatchers.Main) {\n result.success(Codec.encodeResult(locationClient.enableLocationServices()))\n }\n }\n\n private fun lastKnownLocation(permission: Permission, result: MethodChannel.Result) {\n GlobalScope.launch(Dispatchers.Main) {\n result.success(Codec.encodeResult(locationClient.lastKnownLocation(permission)))\n }\n }\n\n private fun addLocationUpdatesRequest(request: LocationUpdatesRequest) {\n GlobalScope.launch(Dispatchers.Main) {\n locationClient.addLocationUpdatesRequest(request)\n }\n }\n\n private fun removeLocationUpdatesRequest(id: Int) {\n locationClient.removeLocationUpdatesRequest(id)\n }\n\n\n // MethodChannel.MethodCallHandler\n\n override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {\n when (call.method) {\n \"isLocationOperational\" -> isLocationOperational(Codec.decodePermission(call.arguments), result)\n \"requestLocationPermission\" -> requestLocationPermission(Codec.decodePermissionRequest(call.arguments), result)\n \"lastKnownLocation\" -> lastKnownLocation(Codec.decodePermission(call.arguments), result)\n \"addLocationUpdatesRequest\" -> addLocationUpdatesRequest(Codec.decodeLocationUpdatesRequest(call.arguments))\n \"removeLocationUpdatesRequest\" -> removeLocationUpdatesRequest(Codec.decodeInt(call.arguments))\n \"enableLocationServices\" -> enableLocationSettings(result)\n else -> result.notImplemented()\n }\n }\n\n\n // EventChannel.StreamHandler\n\n override fun onListen(arguments: Any?, events: EventChannel.EventSink) {\n locationClient.registerLocationUpdatesCallback { result ->\n events.success(Codec.encodeResult(result))\n }\n }\n\n override fun onCancel(arguments: Any?) {\n locationClient.deregisterLocationUpdatesCallback()\n }\n}\n"} +{"text": "Given(/^I have debited a card$/) do\n step \"I have tokenized a card\"\n @client.post(\"/cards/#{@card_id}/debits\", {\n 'amount' => 1234\n })\n @debit_id = @client['debits']['id']\n @client.add_hydrate :debit_id, @debit_id\nend\n\nGiven(/^I have a customer with a card$/) do\n step \"I have created a customer\"\n step \"I have tokenized a card\"\n @client.put(\"/cards/#{@card_id}\", {\n 'links' => {\n 'customer' => @customer_id\n }\n })\n\nend\n\nGiven(/^I have more than one debit$/) do\n 2.times { step 'I have debited a card' }\nend\n\nGiven(/^I have created a debit$/) do\n step 'I have created a customer'\n step 'I make a POST request to the link \"customers.debits\" with the body:', '{ \"amount\": 1234 }'\n step 'I should get a 201 Created status code'\n step 'the response is valid according to the \"debits\" schema'\nend\n"} +{"text": "# File generated from CLDR ver. 25\ndecimalSeparator = ,\ngroupingSeparator = .\npercent = %\nzeroDigit = 0\nplusSign = +\nminusSign = -\nexponentialSymbol = E\nperMill = \\u2030\ninfinity = \\u221E\nnotANumber = NaN\nmonetarySeparator = ,\nmonetaryGroupingSeparator = .\ndecimalPattern = #,##0.###\nscientificPattern = #E0\npercentPattern = #,##0%\ncurrencyPattern = \\u00A4#,##0.00\nsimpleCurrencyPattern = \\u00A4\\u00A4\\u00A4\\u00A4#,##0.00\nglobalCurrencyPattern = \\u00A4\\u00A4\\u00A4\\u00A4#,##0.00 \\u00A4\\u00A4\ndefCurrencyCode = MZN\n"} +{"text": "# Unix SMB/CIFS implementation. Tests for NT and posix ACL manipulation\n# Copyright (C) Matthieu Patou 2009-2010\n# Copyright (C) Andrew Bartlett 2012\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see .\n#\n\n\"\"\"Tests for the Samba3 NT -> posix ACL layer\"\"\"\n\nfrom samba.ntacls import setntacl, getntacl, checkset_backend\nfrom samba.dcerpc import xattr, security, smb_acl, idmap\nfrom samba.param import LoadParm\nfrom samba.tests import TestCaseInTempDir\nfrom samba import provision\nimport random\nimport os\nfrom samba.samba3 import smbd, passdb\nfrom samba.samba3 import param as s3param\n\n# To print a posix ACL use:\n# for entry in posix_acl.acl:\n# print \"a_type: %d\" % entry.a_type\n# print \"a_perm: %o\" % entry.a_perm\n# if entry.a_type == smb_acl.SMB_ACL_USER:\n# print \"uid: %d\" % entry.uid\n# if entry.a_type == smb_acl.SMB_ACL_GROUP:\n# print \"gid: %d\" % entry.gid\n\nclass PosixAclMappingTests(TestCaseInTempDir):\n\n def test_setntacl(self):\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n setntacl(self.lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\", use_ntvfs=False)\n\n def test_setntacl_smbd_getntacl(self):\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n setntacl(self.lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\", use_ntvfs=True)\n facl = getntacl(self.lp, self.tempf, direct_db_access=True)\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(facl.as_sddl(anysid),acl)\n\n def test_setntacl_smbd_setposixacl_getntacl(self):\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n setntacl(self.lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\", use_ntvfs=True)\n\n # This will invalidate the ACL, as we have a hook!\n smbd.set_simple_acl(self.tempf, 0640)\n\n # However, this only asks the xattr\n try:\n facl = getntacl(self.lp, self.tempf, direct_db_access=True)\n self.assertTrue(False)\n except TypeError:\n pass\n\n def test_setntacl_invalidate_getntacl(self):\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n setntacl(self.lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\", use_ntvfs=True)\n\n # This should invalidate the ACL, as we include the posix ACL in the hash\n (backend_obj, dbname) = checkset_backend(self.lp, None, None)\n backend_obj.wrap_setxattr(dbname,\n self.tempf, \"system.fake_access_acl\", \"\")\n\n #however, as this is direct DB access, we do not notice it\n facl = getntacl(self.lp, self.tempf, direct_db_access=True)\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(acl, facl.as_sddl(anysid))\n\n def test_setntacl_invalidate_getntacl_smbd(self):\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n setntacl(self.lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\", use_ntvfs=False)\n\n # This should invalidate the ACL, as we include the posix ACL in the hash\n (backend_obj, dbname) = checkset_backend(self.lp, None, None)\n backend_obj.wrap_setxattr(dbname,\n self.tempf, \"system.fake_access_acl\", \"\")\n\n #the hash would break, and we return an ACL based only on the mode, except we set the ACL using the 'ntvfs' mode that doesn't include a hash\n facl = getntacl(self.lp, self.tempf)\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(acl, facl.as_sddl(anysid))\n\n def test_setntacl_smbd_invalidate_getntacl_smbd(self):\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n simple_acl_from_posix = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)(A;;0x001200a9;;;S-1-5-21-2212615479-2695158682-2101375467-513)(A;;;;;WD)\"\n os.chmod(self.tempf, 0750)\n setntacl(self.lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\", use_ntvfs=False)\n\n # This should invalidate the ACL, as we include the posix ACL in the hash\n (backend_obj, dbname) = checkset_backend(self.lp, None, None)\n backend_obj.wrap_setxattr(dbname,\n self.tempf, \"system.fake_access_acl\", \"\")\n\n #the hash will break, and we return an ACL based only on the mode\n facl = getntacl(self.lp, self.tempf, direct_db_access=False)\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(simple_acl_from_posix, facl.as_sddl(anysid))\n\n def test_setntacl_smbd_dont_invalidate_getntacl_smbd(self):\n # set an ACL on a tempfile\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n os.chmod(self.tempf, 0750)\n setntacl(self.lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\", use_ntvfs=False)\n\n # now influence the POSIX ACL->SD mapping it returns something else than\n # what was set previously\n # this should not invalidate the hash and the complete ACL should still\n # be returned\n self.lp.set(\"profile acls\", \"yes\")\n # we should still get back the ACL (and not one mapped from POSIX ACL)\n facl = getntacl(self.lp, self.tempf, direct_db_access=False)\n self.lp.set(\"profile acls\", \"no\")\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(acl, facl.as_sddl(anysid))\n\n def test_setntacl_getntacl_smbd(self):\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n setntacl(self.lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\", use_ntvfs=True)\n facl = getntacl(self.lp, self.tempf, direct_db_access=False)\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(facl.as_sddl(anysid),acl)\n\n def test_setntacl_smbd_getntacl_smbd(self):\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n setntacl(self.lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\", use_ntvfs=False)\n facl = getntacl(self.lp, self.tempf, direct_db_access=False)\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(facl.as_sddl(anysid),acl)\n\n def test_setntacl_smbd_setposixacl_getntacl_smbd(self):\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n simple_acl_from_posix = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;;0x001f019f;;;S-1-5-21-2212615479-2695158682-2101375467-512)(A;;0x00120089;;;S-1-5-21-2212615479-2695158682-2101375467-513)(A;;;;;WD)\"\n setntacl(self.lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\", use_ntvfs=False)\n # This invalidates the hash of the NT acl just set because there is a hook in the posix ACL set code\n smbd.set_simple_acl(self.tempf, 0640)\n facl = getntacl(self.lp, self.tempf, direct_db_access=False)\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(simple_acl_from_posix, facl.as_sddl(anysid))\n\n def test_setntacl_smbd_setposixacl_group_getntacl_smbd(self):\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)\n simple_acl_from_posix = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;;0x001f019f;;;S-1-5-21-2212615479-2695158682-2101375467-512)(A;;0x00120089;;;BA)(A;;0x00120089;;;S-1-5-21-2212615479-2695158682-2101375467-513)(A;;;;;WD)\"\n setntacl(self.lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\", use_ntvfs=False)\n # This invalidates the hash of the NT acl just set because there is a hook in the posix ACL set code\n s4_passdb = passdb.PDB(self.lp.get(\"passdb backend\"))\n (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)\n smbd.set_simple_acl(self.tempf, 0640, BA_gid)\n\n # This should re-calculate an ACL based on the posix details\n facl = getntacl(self.lp,self.tempf, direct_db_access=False)\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(simple_acl_from_posix, facl.as_sddl(anysid))\n\n def test_setntacl_smbd_getntacl_smbd_gpo(self):\n acl = \"O:DAG:DUD:P(A;OICI;0x001f01ff;;;DA)(A;OICI;0x001f01ff;;;EA)(A;OICIIO;0x001f01ff;;;CO)(A;OICI;0x001f01ff;;;DA)(A;OICI;0x001f01ff;;;SY)(A;OICI;0x001200a9;;;AU)(A;OICI;0x001200a9;;;ED)S:AI(OU;CIIDSA;WP;f30e3bbe-9ff0-11d1-b603-0000f80367c1;bf967aa5-0de6-11d0-a285-00aa003049e2;WD)(OU;CIIDSA;WP;f30e3bbf-9ff0-11d1-b603-0000f80367c1;bf967aa5-0de6-11d0-a285-00aa003049e2;WD)\"\n setntacl(self.lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\", use_ntvfs=False)\n facl = getntacl(self.lp, self.tempf, direct_db_access=False)\n domsid = security.dom_sid(\"S-1-5-21-2212615479-2695158682-2101375467\")\n self.assertEquals(facl.as_sddl(domsid),acl)\n\n def test_setntacl_getposixacl(self):\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n setntacl(self.lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\", use_ntvfs=False)\n facl = getntacl(self.lp, self.tempf)\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(facl.as_sddl(anysid),acl)\n posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)\n\n def test_setposixacl_getposixacl(self):\n smbd.set_simple_acl(self.tempf, 0640)\n posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)\n self.assertEquals(posix_acl.count, 4)\n\n self.assertEquals(posix_acl.acl[0].a_type, smb_acl.SMB_ACL_USER_OBJ)\n self.assertEquals(posix_acl.acl[0].a_perm, 6)\n\n self.assertEquals(posix_acl.acl[1].a_type, smb_acl.SMB_ACL_GROUP_OBJ)\n self.assertEquals(posix_acl.acl[1].a_perm, 4)\n\n self.assertEquals(posix_acl.acl[2].a_type, smb_acl.SMB_ACL_OTHER)\n self.assertEquals(posix_acl.acl[2].a_perm, 0)\n\n self.assertEquals(posix_acl.acl[3].a_type, smb_acl.SMB_ACL_MASK)\n self.assertEquals(posix_acl.acl[3].a_perm, 6)\n\n def test_setposixacl_getntacl(self):\n acl = \"\"\n smbd.set_simple_acl(self.tempf, 0750)\n try:\n facl = getntacl(self.lp, self.tempf)\n self.assertTrue(False)\n except TypeError:\n # We don't expect the xattr to be filled in in this case\n pass\n\n def test_setposixacl_getntacl_smbd(self):\n s4_passdb = passdb.PDB(self.lp.get(\"passdb backend\"))\n group_SID = s4_passdb.gid_to_sid(os.stat(self.tempf).st_gid)\n user_SID = s4_passdb.uid_to_sid(os.stat(self.tempf).st_uid)\n smbd.set_simple_acl(self.tempf, 0640)\n facl = getntacl(self.lp, self.tempf, direct_db_access=False)\n acl = \"O:%sG:%sD:(A;;0x001f019f;;;%s)(A;;0x00120089;;;%s)(A;;;;;WD)\" % (user_SID, group_SID, user_SID, group_SID)\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(acl, facl.as_sddl(anysid))\n\n def test_setposixacl_dir_getntacl_smbd(self):\n s4_passdb = passdb.PDB(self.lp.get(\"passdb backend\"))\n user_SID = s4_passdb.uid_to_sid(os.stat(self.tempdir).st_uid)\n BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)\n s4_passdb = passdb.PDB(self.lp.get(\"passdb backend\"))\n (BA_id,BA_type) = s4_passdb.sid_to_id(BA_sid)\n self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)\n SO_sid = security.dom_sid(security.SID_BUILTIN_SERVER_OPERATORS)\n (SO_id,SO_type) = s4_passdb.sid_to_id(SO_sid)\n self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)\n smbd.chown(self.tempdir, BA_id, SO_id)\n smbd.set_simple_acl(self.tempdir, 0750)\n facl = getntacl(self.lp, self.tempdir, direct_db_access=False)\n acl = \"O:BAG:SOD:(A;;0x001f01ff;;;BA)(A;;0x001200a9;;;SO)(A;;;;;WD)(A;OICIIO;0x001f01ff;;;CO)(A;OICIIO;0x001200a9;;;CG)(A;OICIIO;0x001200a9;;;WD)\"\n\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(acl, facl.as_sddl(anysid))\n\n def test_setposixacl_group_getntacl_smbd(self):\n BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)\n s4_passdb = passdb.PDB(self.lp.get(\"passdb backend\"))\n (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)\n group_SID = s4_passdb.gid_to_sid(os.stat(self.tempf).st_gid)\n user_SID = s4_passdb.uid_to_sid(os.stat(self.tempf).st_uid)\n self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)\n smbd.set_simple_acl(self.tempf, 0640, BA_gid)\n facl = getntacl(self.lp, self.tempf, direct_db_access=False)\n domsid = passdb.get_global_sam_sid()\n acl = \"O:%sG:%sD:(A;;0x001f019f;;;%s)(A;;0x00120089;;;BA)(A;;0x00120089;;;%s)(A;;;;;WD)\" % (user_SID, group_SID, user_SID, group_SID)\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(acl, facl.as_sddl(anysid))\n\n def test_setposixacl_getposixacl(self):\n smbd.set_simple_acl(self.tempf, 0640)\n posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)\n self.assertEquals(posix_acl.count, 4)\n\n self.assertEquals(posix_acl.acl[0].a_type, smb_acl.SMB_ACL_USER_OBJ)\n self.assertEquals(posix_acl.acl[0].a_perm, 6)\n\n self.assertEquals(posix_acl.acl[1].a_type, smb_acl.SMB_ACL_GROUP_OBJ)\n self.assertEquals(posix_acl.acl[1].a_perm, 4)\n\n self.assertEquals(posix_acl.acl[2].a_type, smb_acl.SMB_ACL_OTHER)\n self.assertEquals(posix_acl.acl[2].a_perm, 0)\n\n self.assertEquals(posix_acl.acl[3].a_type, smb_acl.SMB_ACL_MASK)\n self.assertEquals(posix_acl.acl[3].a_perm, 7)\n\n def test_setposixacl_dir_getposixacl(self):\n smbd.set_simple_acl(self.tempdir, 0750)\n posix_acl = smbd.get_sys_acl(self.tempdir, smb_acl.SMB_ACL_TYPE_ACCESS)\n self.assertEquals(posix_acl.count, 4)\n\n self.assertEquals(posix_acl.acl[0].a_type, smb_acl.SMB_ACL_USER_OBJ)\n self.assertEquals(posix_acl.acl[0].a_perm, 7)\n\n self.assertEquals(posix_acl.acl[1].a_type, smb_acl.SMB_ACL_GROUP_OBJ)\n self.assertEquals(posix_acl.acl[1].a_perm, 5)\n\n self.assertEquals(posix_acl.acl[2].a_type, smb_acl.SMB_ACL_OTHER)\n self.assertEquals(posix_acl.acl[2].a_perm, 0)\n\n self.assertEquals(posix_acl.acl[3].a_type, smb_acl.SMB_ACL_MASK)\n self.assertEquals(posix_acl.acl[3].a_perm, 7)\n\n def test_setposixacl_group_getposixacl(self):\n BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)\n s4_passdb = passdb.PDB(self.lp.get(\"passdb backend\"))\n (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)\n self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)\n smbd.set_simple_acl(self.tempf, 0670, BA_gid)\n posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)\n\n self.assertEquals(posix_acl.count, 5)\n\n self.assertEquals(posix_acl.acl[0].a_type, smb_acl.SMB_ACL_USER_OBJ)\n self.assertEquals(posix_acl.acl[0].a_perm, 6)\n\n self.assertEquals(posix_acl.acl[1].a_type, smb_acl.SMB_ACL_GROUP_OBJ)\n self.assertEquals(posix_acl.acl[1].a_perm, 7)\n\n self.assertEquals(posix_acl.acl[2].a_type, smb_acl.SMB_ACL_OTHER)\n self.assertEquals(posix_acl.acl[2].a_perm, 0)\n\n self.assertEquals(posix_acl.acl[3].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[3].a_perm, 7)\n self.assertEquals(posix_acl.acl[3].info.gid, BA_gid)\n\n self.assertEquals(posix_acl.acl[4].a_type, smb_acl.SMB_ACL_MASK)\n self.assertEquals(posix_acl.acl[4].a_perm, 7)\n\n def test_setntacl_sysvol_check_getposixacl(self):\n acl = provision.SYSVOL_ACL\n domsid = passdb.get_global_sam_sid()\n setntacl(self.lp, self.tempf,acl,str(domsid), use_ntvfs=False)\n facl = getntacl(self.lp, self.tempf)\n self.assertEquals(facl.as_sddl(domsid),acl)\n posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)\n\n nwrap_module_so_path = os.getenv('NSS_WRAPPER_MODULE_SO_PATH')\n nwrap_module_fn_prefix = os.getenv('NSS_WRAPPER_MODULE_FN_PREFIX')\n\n nwrap_winbind_active = (nwrap_module_so_path != \"\" and\n nwrap_module_fn_prefix == \"winbind\")\n\n LA_sid = security.dom_sid(str(domsid)+\"-\"+str(security.DOMAIN_RID_ADMINISTRATOR))\n BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)\n SO_sid = security.dom_sid(security.SID_BUILTIN_SERVER_OPERATORS)\n SY_sid = security.dom_sid(security.SID_NT_SYSTEM)\n AU_sid = security.dom_sid(security.SID_NT_AUTHENTICATED_USERS)\n\n s4_passdb = passdb.PDB(self.lp.get(\"passdb backend\"))\n\n # These assertions correct for current ad_dc selftest\n # configuration. When other environments have a broad range of\n # groups mapped via passdb, we can relax some of these checks\n (LA_uid,LA_type) = s4_passdb.sid_to_id(LA_sid)\n self.assertEquals(LA_type, idmap.ID_TYPE_UID)\n (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)\n self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)\n (SO_gid,SO_type) = s4_passdb.sid_to_id(SO_sid)\n self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)\n (SY_gid,SY_type) = s4_passdb.sid_to_id(SY_sid)\n self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)\n (AU_gid,AU_type) = s4_passdb.sid_to_id(AU_sid)\n self.assertEquals(AU_type, idmap.ID_TYPE_BOTH)\n\n self.assertEquals(posix_acl.count, 13)\n\n self.assertEquals(posix_acl.acl[0].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[0].a_perm, 7)\n self.assertEquals(posix_acl.acl[0].info.gid, BA_gid)\n\n self.assertEquals(posix_acl.acl[1].a_type, smb_acl.SMB_ACL_USER)\n if nwrap_winbind_active:\n self.assertEquals(posix_acl.acl[1].a_perm, 7)\n else:\n self.assertEquals(posix_acl.acl[1].a_perm, 6)\n self.assertEquals(posix_acl.acl[1].info.uid, LA_uid)\n\n self.assertEquals(posix_acl.acl[2].a_type, smb_acl.SMB_ACL_OTHER)\n self.assertEquals(posix_acl.acl[2].a_perm, 0)\n\n self.assertEquals(posix_acl.acl[3].a_type, smb_acl.SMB_ACL_USER_OBJ)\n if nwrap_winbind_active:\n self.assertEquals(posix_acl.acl[3].a_perm, 7)\n else:\n self.assertEquals(posix_acl.acl[3].a_perm, 6)\n\n self.assertEquals(posix_acl.acl[4].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[4].a_perm, 7)\n self.assertEquals(posix_acl.acl[4].info.uid, BA_gid)\n\n self.assertEquals(posix_acl.acl[5].a_type, smb_acl.SMB_ACL_GROUP_OBJ)\n self.assertEquals(posix_acl.acl[5].a_perm, 7)\n\n self.assertEquals(posix_acl.acl[6].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[6].a_perm, 5)\n self.assertEquals(posix_acl.acl[6].info.uid, SO_gid)\n\n self.assertEquals(posix_acl.acl[7].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[7].a_perm, 5)\n self.assertEquals(posix_acl.acl[7].info.gid, SO_gid)\n\n self.assertEquals(posix_acl.acl[8].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[8].a_perm, 7)\n self.assertEquals(posix_acl.acl[8].info.uid, SY_gid)\n\n self.assertEquals(posix_acl.acl[9].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[9].a_perm, 7)\n self.assertEquals(posix_acl.acl[9].info.gid, SY_gid)\n\n self.assertEquals(posix_acl.acl[10].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[10].a_perm, 5)\n self.assertEquals(posix_acl.acl[10].info.uid, AU_gid)\n\n self.assertEquals(posix_acl.acl[11].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[11].a_perm, 5)\n self.assertEquals(posix_acl.acl[11].info.gid, AU_gid)\n\n self.assertEquals(posix_acl.acl[12].a_type, smb_acl.SMB_ACL_MASK)\n self.assertEquals(posix_acl.acl[12].a_perm, 7)\n\n\n# check that it matches:\n# user::rwx\n# user:root:rwx (selftest user actually)\n# group::rwx\n# group:Local Admins:rwx\n# group:3000000:r-x\n# group:3000001:rwx\n# group:3000002:r-x\n# mask::rwx\n# other::---\n\n#\n# This is in this order in the NDR smb_acl (not re-orderded for display)\n# a_type: GROUP\n# a_perm: 7\n# uid: -1\n# gid: 10\n# a_type: USER\n# a_perm: 6\n# uid: 0 (selftest user actually)\n# gid: -1\n# a_type: OTHER\n# a_perm: 0\n# uid: -1\n# gid: -1\n# a_type: USER_OBJ\n# a_perm: 6\n# uid: -1\n# gid: -1\n# a_type: GROUP_OBJ\n# a_perm: 7\n# uid: -1\n# gid: -1\n# a_type: GROUP\n# a_perm: 5\n# uid: -1\n# gid: 3000020\n# a_type: GROUP\n# a_perm: 7\n# uid: -1\n# gid: 3000000\n# a_type: GROUP\n# a_perm: 5\n# uid: -1\n# gid: 3000001\n# a_type: MASK\n# a_perm: 7\n# uid: -1\n# gid: -1\n\n#\n\n\n def test_setntacl_sysvol_dir_check_getposixacl(self):\n acl = provision.SYSVOL_ACL\n domsid = passdb.get_global_sam_sid()\n setntacl(self.lp, self.tempdir,acl,str(domsid), use_ntvfs=False)\n facl = getntacl(self.lp, self.tempdir)\n self.assertEquals(facl.as_sddl(domsid),acl)\n posix_acl = smbd.get_sys_acl(self.tempdir, smb_acl.SMB_ACL_TYPE_ACCESS)\n\n LA_sid = security.dom_sid(str(domsid)+\"-\"+str(security.DOMAIN_RID_ADMINISTRATOR))\n BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)\n SO_sid = security.dom_sid(security.SID_BUILTIN_SERVER_OPERATORS)\n SY_sid = security.dom_sid(security.SID_NT_SYSTEM)\n AU_sid = security.dom_sid(security.SID_NT_AUTHENTICATED_USERS)\n\n s4_passdb = passdb.PDB(self.lp.get(\"passdb backend\"))\n\n # These assertions correct for current ad_dc selftest\n # configuration. When other environments have a broad range of\n # groups mapped via passdb, we can relax some of these checks\n (LA_uid,LA_type) = s4_passdb.sid_to_id(LA_sid)\n self.assertEquals(LA_type, idmap.ID_TYPE_UID)\n (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)\n self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)\n (SO_gid,SO_type) = s4_passdb.sid_to_id(SO_sid)\n self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)\n (SY_gid,SY_type) = s4_passdb.sid_to_id(SY_sid)\n self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)\n (AU_gid,AU_type) = s4_passdb.sid_to_id(AU_sid)\n self.assertEquals(AU_type, idmap.ID_TYPE_BOTH)\n\n self.assertEquals(posix_acl.count, 13)\n\n self.assertEquals(posix_acl.acl[0].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[0].a_perm, 7)\n self.assertEquals(posix_acl.acl[0].info.gid, BA_gid)\n\n self.assertEquals(posix_acl.acl[1].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[1].a_perm, 7)\n self.assertEquals(posix_acl.acl[1].info.uid, LA_uid)\n\n self.assertEquals(posix_acl.acl[2].a_type, smb_acl.SMB_ACL_OTHER)\n self.assertEquals(posix_acl.acl[2].a_perm, 0)\n\n self.assertEquals(posix_acl.acl[3].a_type, smb_acl.SMB_ACL_USER_OBJ)\n self.assertEquals(posix_acl.acl[3].a_perm, 7)\n\n self.assertEquals(posix_acl.acl[4].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[4].a_perm, 7)\n self.assertEquals(posix_acl.acl[4].info.uid, BA_gid)\n\n self.assertEquals(posix_acl.acl[5].a_type, smb_acl.SMB_ACL_GROUP_OBJ)\n self.assertEquals(posix_acl.acl[5].a_perm, 7)\n\n self.assertEquals(posix_acl.acl[6].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[6].a_perm, 5)\n self.assertEquals(posix_acl.acl[6].info.uid, SO_gid)\n\n self.assertEquals(posix_acl.acl[7].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[7].a_perm, 5)\n self.assertEquals(posix_acl.acl[7].info.gid, SO_gid)\n\n self.assertEquals(posix_acl.acl[8].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[8].a_perm, 7)\n self.assertEquals(posix_acl.acl[8].info.uid, SY_gid)\n\n self.assertEquals(posix_acl.acl[9].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[9].a_perm, 7)\n self.assertEquals(posix_acl.acl[9].info.gid, SY_gid)\n\n self.assertEquals(posix_acl.acl[10].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[10].a_perm, 5)\n self.assertEquals(posix_acl.acl[10].info.uid, AU_gid)\n\n self.assertEquals(posix_acl.acl[11].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[11].a_perm, 5)\n self.assertEquals(posix_acl.acl[11].info.gid, AU_gid)\n\n self.assertEquals(posix_acl.acl[12].a_type, smb_acl.SMB_ACL_MASK)\n self.assertEquals(posix_acl.acl[12].a_perm, 7)\n\n\n# check that it matches:\n# user::rwx\n# user:root:rwx (selftest user actually)\n# group::rwx\n# group:3000000:rwx\n# group:3000001:r-x\n# group:3000002:rwx\n# group:3000003:r-x\n# mask::rwx\n# other::---\n\n\n def test_setntacl_policies_dir_check_getposixacl(self):\n acl = provision.POLICIES_ACL\n domsid = passdb.get_global_sam_sid()\n setntacl(self.lp, self.tempdir,acl,str(domsid), use_ntvfs=False)\n facl = getntacl(self.lp, self.tempdir)\n self.assertEquals(facl.as_sddl(domsid),acl)\n posix_acl = smbd.get_sys_acl(self.tempdir, smb_acl.SMB_ACL_TYPE_ACCESS)\n\n LA_sid = security.dom_sid(str(domsid)+\"-\"+str(security.DOMAIN_RID_ADMINISTRATOR))\n BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)\n SO_sid = security.dom_sid(security.SID_BUILTIN_SERVER_OPERATORS)\n SY_sid = security.dom_sid(security.SID_NT_SYSTEM)\n AU_sid = security.dom_sid(security.SID_NT_AUTHENTICATED_USERS)\n PA_sid = security.dom_sid(str(domsid)+\"-\"+str(security.DOMAIN_RID_POLICY_ADMINS))\n\n s4_passdb = passdb.PDB(self.lp.get(\"passdb backend\"))\n\n # These assertions correct for current ad_dc selftest\n # configuration. When other environments have a broad range of\n # groups mapped via passdb, we can relax some of these checks\n (LA_uid,LA_type) = s4_passdb.sid_to_id(LA_sid)\n self.assertEquals(LA_type, idmap.ID_TYPE_UID)\n (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)\n self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)\n (SO_gid,SO_type) = s4_passdb.sid_to_id(SO_sid)\n self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)\n (SY_gid,SY_type) = s4_passdb.sid_to_id(SY_sid)\n self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)\n (AU_gid,AU_type) = s4_passdb.sid_to_id(AU_sid)\n self.assertEquals(AU_type, idmap.ID_TYPE_BOTH)\n (PA_gid,PA_type) = s4_passdb.sid_to_id(PA_sid)\n self.assertEquals(PA_type, idmap.ID_TYPE_BOTH)\n\n self.assertEquals(posix_acl.count, 15)\n\n self.assertEquals(posix_acl.acl[0].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[0].a_perm, 7)\n self.assertEquals(posix_acl.acl[0].info.gid, BA_gid)\n\n self.assertEquals(posix_acl.acl[1].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[1].a_perm, 7)\n self.assertEquals(posix_acl.acl[1].info.uid, LA_uid)\n\n self.assertEquals(posix_acl.acl[2].a_type, smb_acl.SMB_ACL_OTHER)\n self.assertEquals(posix_acl.acl[2].a_perm, 0)\n\n self.assertEquals(posix_acl.acl[3].a_type, smb_acl.SMB_ACL_USER_OBJ)\n self.assertEquals(posix_acl.acl[3].a_perm, 7)\n\n self.assertEquals(posix_acl.acl[4].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[4].a_perm, 7)\n self.assertEquals(posix_acl.acl[4].info.uid, BA_gid)\n\n self.assertEquals(posix_acl.acl[5].a_type, smb_acl.SMB_ACL_GROUP_OBJ)\n self.assertEquals(posix_acl.acl[5].a_perm, 7)\n\n self.assertEquals(posix_acl.acl[6].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[6].a_perm, 5)\n self.assertEquals(posix_acl.acl[6].info.uid, SO_gid)\n\n self.assertEquals(posix_acl.acl[7].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[7].a_perm, 5)\n self.assertEquals(posix_acl.acl[7].info.gid, SO_gid)\n\n self.assertEquals(posix_acl.acl[8].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[8].a_perm, 7)\n self.assertEquals(posix_acl.acl[8].info.uid, SY_gid)\n\n self.assertEquals(posix_acl.acl[9].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[9].a_perm, 7)\n self.assertEquals(posix_acl.acl[9].info.gid, SY_gid)\n\n self.assertEquals(posix_acl.acl[10].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[10].a_perm, 5)\n self.assertEquals(posix_acl.acl[10].info.uid, AU_gid)\n\n self.assertEquals(posix_acl.acl[11].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[11].a_perm, 5)\n self.assertEquals(posix_acl.acl[11].info.gid, AU_gid)\n\n self.assertEquals(posix_acl.acl[12].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[12].a_perm, 7)\n self.assertEquals(posix_acl.acl[12].info.uid, PA_gid)\n\n self.assertEquals(posix_acl.acl[13].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[13].a_perm, 7)\n self.assertEquals(posix_acl.acl[13].info.gid, PA_gid)\n\n self.assertEquals(posix_acl.acl[14].a_type, smb_acl.SMB_ACL_MASK)\n self.assertEquals(posix_acl.acl[14].a_perm, 7)\n\n\n# check that it matches:\n# user::rwx\n# user:root:rwx (selftest user actually)\n# group::rwx\n# group:3000000:rwx\n# group:3000001:r-x\n# group:3000002:rwx\n# group:3000003:r-x\n# group:3000004:rwx\n# mask::rwx\n# other::---\n\n\n\n def test_setntacl_policies_check_getposixacl(self):\n acl = provision.POLICIES_ACL\n\n domsid = passdb.get_global_sam_sid()\n setntacl(self.lp, self.tempf, acl, str(domsid), use_ntvfs=False)\n facl = getntacl(self.lp, self.tempf)\n self.assertEquals(facl.as_sddl(domsid),acl)\n posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)\n\n nwrap_module_so_path = os.getenv('NSS_WRAPPER_MODULE_SO_PATH')\n nwrap_module_fn_prefix = os.getenv('NSS_WRAPPER_MODULE_FN_PREFIX')\n\n nwrap_winbind_active = (nwrap_module_so_path != \"\" and\n nwrap_module_fn_prefix == \"winbind\")\n\n LA_sid = security.dom_sid(str(domsid)+\"-\"+str(security.DOMAIN_RID_ADMINISTRATOR))\n BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)\n SO_sid = security.dom_sid(security.SID_BUILTIN_SERVER_OPERATORS)\n SY_sid = security.dom_sid(security.SID_NT_SYSTEM)\n AU_sid = security.dom_sid(security.SID_NT_AUTHENTICATED_USERS)\n PA_sid = security.dom_sid(str(domsid)+\"-\"+str(security.DOMAIN_RID_POLICY_ADMINS))\n\n s4_passdb = passdb.PDB(self.lp.get(\"passdb backend\"))\n\n # These assertions correct for current ad_dc selftest\n # configuration. When other environments have a broad range of\n # groups mapped via passdb, we can relax some of these checks\n (LA_uid,LA_type) = s4_passdb.sid_to_id(LA_sid)\n self.assertEquals(LA_type, idmap.ID_TYPE_UID)\n (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)\n self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)\n (SO_gid,SO_type) = s4_passdb.sid_to_id(SO_sid)\n self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)\n (SY_gid,SY_type) = s4_passdb.sid_to_id(SY_sid)\n self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)\n (AU_gid,AU_type) = s4_passdb.sid_to_id(AU_sid)\n self.assertEquals(AU_type, idmap.ID_TYPE_BOTH)\n (PA_gid,PA_type) = s4_passdb.sid_to_id(PA_sid)\n self.assertEquals(PA_type, idmap.ID_TYPE_BOTH)\n\n self.assertEquals(posix_acl.count, 15)\n\n self.assertEquals(posix_acl.acl[0].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[0].a_perm, 7)\n self.assertEquals(posix_acl.acl[0].info.gid, BA_gid)\n\n self.assertEquals(posix_acl.acl[1].a_type, smb_acl.SMB_ACL_USER)\n if nwrap_winbind_active:\n self.assertEquals(posix_acl.acl[1].a_perm, 7)\n else:\n self.assertEquals(posix_acl.acl[1].a_perm, 6)\n self.assertEquals(posix_acl.acl[1].info.uid, LA_uid)\n\n self.assertEquals(posix_acl.acl[2].a_type, smb_acl.SMB_ACL_OTHER)\n self.assertEquals(posix_acl.acl[2].a_perm, 0)\n\n self.assertEquals(posix_acl.acl[3].a_type, smb_acl.SMB_ACL_USER_OBJ)\n if nwrap_winbind_active:\n self.assertEquals(posix_acl.acl[3].a_perm, 7)\n else:\n self.assertEquals(posix_acl.acl[3].a_perm, 6)\n\n self.assertEquals(posix_acl.acl[4].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[4].a_perm, 7)\n self.assertEquals(posix_acl.acl[4].info.uid, BA_gid)\n\n self.assertEquals(posix_acl.acl[5].a_type, smb_acl.SMB_ACL_GROUP_OBJ)\n self.assertEquals(posix_acl.acl[5].a_perm, 7)\n\n self.assertEquals(posix_acl.acl[6].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[6].a_perm, 5)\n self.assertEquals(posix_acl.acl[6].info.uid, SO_gid)\n\n self.assertEquals(posix_acl.acl[7].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[7].a_perm, 5)\n self.assertEquals(posix_acl.acl[7].info.gid, SO_gid)\n\n self.assertEquals(posix_acl.acl[8].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[8].a_perm, 7)\n self.assertEquals(posix_acl.acl[8].info.uid, SY_gid)\n\n self.assertEquals(posix_acl.acl[9].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[9].a_perm, 7)\n self.assertEquals(posix_acl.acl[9].info.gid, SY_gid)\n\n self.assertEquals(posix_acl.acl[10].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[10].a_perm, 5)\n self.assertEquals(posix_acl.acl[10].info.uid, AU_gid)\n\n self.assertEquals(posix_acl.acl[11].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[11].a_perm, 5)\n self.assertEquals(posix_acl.acl[11].info.gid, AU_gid)\n\n self.assertEquals(posix_acl.acl[12].a_type, smb_acl.SMB_ACL_USER)\n self.assertEquals(posix_acl.acl[12].a_perm, 7)\n self.assertEquals(posix_acl.acl[12].info.uid, PA_gid)\n\n self.assertEquals(posix_acl.acl[13].a_type, smb_acl.SMB_ACL_GROUP)\n self.assertEquals(posix_acl.acl[13].a_perm, 7)\n self.assertEquals(posix_acl.acl[13].info.gid, PA_gid)\n\n self.assertEquals(posix_acl.acl[14].a_type, smb_acl.SMB_ACL_MASK)\n self.assertEquals(posix_acl.acl[14].a_perm, 7)\n\n\n# check that it matches:\n# user::rwx\n# user:root:rwx (selftest user actually)\n# group::rwx\n# group:Local Admins:rwx\n# group:3000000:r-x\n# group:3000001:rwx\n# group:3000002:r-x\n# group:3000003:rwx\n# mask::rwx\n# other::---\n\n#\n# This is in this order in the NDR smb_acl (not re-orderded for display)\n# a_type: GROUP\n# a_perm: 7\n# uid: -1\n# gid: 10\n# a_type: USER\n# a_perm: 6\n# uid: 0 (selftest user actually)\n# gid: -1\n# a_type: OTHER\n# a_perm: 0\n# uid: -1\n# gid: -1\n# a_type: USER_OBJ\n# a_perm: 6\n# uid: -1\n# gid: -1\n# a_type: GROUP_OBJ\n# a_perm: 7\n# uid: -1\n# gid: -1\n# a_type: GROUP\n# a_perm: 5\n# uid: -1\n# gid: 3000020\n# a_type: GROUP\n# a_perm: 7\n# uid: -1\n# gid: 3000000\n# a_type: GROUP\n# a_perm: 5\n# uid: -1\n# gid: 3000001\n# a_type: GROUP\n# a_perm: 7\n# uid: -1\n# gid: 3000003\n# a_type: MASK\n# a_perm: 7\n# uid: -1\n# gid: -1\n\n#\n\n def setUp(self):\n super(PosixAclMappingTests, self).setUp()\n s3conf = s3param.get_context()\n s3conf.load(self.get_loadparm().configfile)\n s3conf.set(\"xattr_tdb:file\", os.path.join(self.tempdir,\"xattr.tdb\"))\n self.lp = s3conf\n self.tempf = os.path.join(self.tempdir, \"test\")\n open(self.tempf, 'w').write(\"empty\")\n\n def tearDown(self):\n smbd.unlink(self.tempf)\n os.unlink(os.path.join(self.tempdir,\"xattr.tdb\"))\n super(PosixAclMappingTests, self).tearDown()\n"} +{"text": "// Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.\n\n#include \n\n#include \"NotificationCenterTrayWidget.h\"\n#include \"NotificationHistory.h\"\n#include \"NotificationWidget.h\"\n#include \"NotificationList.h\"\n#include \"NotificationCenterImpl.h\"\n\n// EditorCommon\n#include \"EditorFramework/TrayArea.h\"\n#include \"Controls/QPopupWidget.h\"\n#include \"CryIcon.h\"\n#include \"EditorStyleHelper.h\"\n#include \"QtUtil.h\"\n\n#include \n\n// Qt\n#include \n#include \n#include \n#include \n#include \n#include \n\nREGISTER_TRAY_AREA_WIDGET(CNotificationCenterTrayWidget, 10)\n\nclass CNotificationPopupManager : public QObject\n{\npublic:\n\tCNotificationPopupManager(CNotificationCenterTrayWidget* pNotificationCenterWidget)\n\t\t: QObject(pNotificationCenterWidget)\n\t\t, m_pNotificationCenterWidget(pNotificationCenterWidget)\n\t\t, notificationDistance(10)\n\t\t, animationDuration(250)\n\t\t, animationDistance(25)\n\t\t, notificationMaxCount(20)\n\t\t, m_bPreventPopups(true)\n\t{\n\t}\n\n\t~CNotificationPopupManager()\n\t{\n\t\tHideAllNotificationPopUps();\n\t}\n\npublic:\n\tvoid SpawnNotification(int id)\n\t{\n\t\tCNotificationCenter* pNotificationCenter = static_cast(GetIEditor()->GetNotificationCenter());\n\t\tInternal::CNotification* pNotificationDesc = pNotificationCenter->GetNotification(id);\n\n\t\tif (!gNotificationPreferences.allowPopUps())\n\t\t\treturn;\n\n\t\tQWidget* pWindow = m_pNotificationCenterWidget->window();\n\t\tif (pWindow->windowState() & Qt::WindowMinimized)\n\t\t\treturn;\n\n\t\tif (pNotificationDesc->IsLogMessage())\n\t\t{\n\t\t\tfor (CNotificationWidget* pNotification : m_notificationPopups)\n\t\t\t{\n\t\t\t\tif (pNotification && pNotification->IsLogMessage())\n\t\t\t\t{\n\t\t\t\t\tCombineCryLogNotifications(pNotificationDesc);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Used for when the editor is loading up. Don't show notification pop-ups during startup,\n\t\t// since they will behave erratically \n\t\tif (m_bPreventPopups)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tCNotificationWidget* pNotification = new CNotificationWidget(pNotificationDesc->GetId(), pWindow);\n\t\t// Make sure notifications have a fixed width when being spawned as pop-ups. This doesn't apply\n\t\t// to notifications displayed in the notification center.\n\t\tpNotification->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);\n\n\t\tAdd(pNotification);\n\n\t\tShow(pNotification);\n\t}\n\n\tvoid ClearQueuedNotifications()\n\t{\n\t\tfor (CNotificationWidget* pNotification : m_notificationPopups)\n\t\t{\n\t\t\tpNotification->deleteLater();\n\t\t}\n\n\t\tm_notificationPopups.clear();\n\t}\n\n\tvoid SetPreventPopUps(bool bPreventPopups)\n\t{\n\t\tm_bPreventPopups = bPreventPopups;\n\n\t\t// Try and spawn any queued up notification\n\t\tif (!m_bPreventPopups)\n\t\t\tShowQueuedNotifications();\n\t}\n\n\tvoid HideAllNotificationPopUps()\n\t{\n\t\tfor (auto i = 0; i < m_notificationPopups.size(); ++i)\n\t\t{\n\t\t\tif (!m_notificationPopups[i])\n\t\t\t\tcontinue;\n\n\t\t\tAnimateNotification(m_notificationPopups[i], false);\n\t\t}\n\n\t\tm_notificationPopups.clear();\n\t\tm_moveAnimations.clear();\n\t}\n\n\tint GetNotificationDistance() const { return notificationDistance; }\n\tint GetNotificationMaxCount() const { return notificationMaxCount; }\n\tint GetAnimationDuration() const { return animationDuration; }\n\tint GetAnimationDistance() const { return animationDistance; }\n\n\tvoid SetNotificationDistance(int distance) { notificationDistance = distance; }\n\tvoid SetNotificationMaxCount(int maxCount) { notificationMaxCount = maxCount; }\n\tvoid SetAnimationDuration(int duration) { animationDuration = duration; }\n\tvoid SetAnimationDistance(int distance) { animationDistance = distance; }\n\nprivate:\n\tvoid AnimateNotification(CNotificationWidget* pNotification, bool bIn)\n\t{\n\t\tAnimateMove(pNotification, QPoint(animationDistance, 0), !bIn);\n\t}\n\n\tvoid AnimateMove(CNotificationWidget* pNotification, const QPoint& delta, bool removeOnEnd = false)\n\t{\n\t\t// Check if there's a move animation already for this notification\n\t\tQPropertyAnimation* pMoveAnim = m_moveAnimations[pNotification];\n\n\t\tQRectF startValue = pNotification->geometry();\n\t\tQRectF endValue = startValue;\n\n\t\tif (!pMoveAnim)\n\t\t{\n\t\t\tendValue = QRectF(startValue.left() + delta.x(), startValue.top() + delta.y(), startValue.width(), startValue.height());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// If there was already an animation, make sure to take the existing end value and add the new delta\n\t\t\tstartValue = pMoveAnim->currentValue().toRectF();\n\t\t\tendValue = pMoveAnim->endValue().toRectF();\n\t\t\tendValue = QRectF(endValue.left() + delta.x(), endValue.top() + delta.y(), endValue.width(), endValue.height());\n\n\t\t\tpMoveAnim->stop();\n\t\t\tm_moveAnimations.remove(pNotification);\n\t\t}\n\n\t\tpMoveAnim = new QPropertyAnimation(pNotification, \"geometry\");\n\t\tpMoveAnim->setDuration(animationDuration);\n\t\tpMoveAnim->setEasingCurve(QEasingCurve::OutCubic);\n\t\tpMoveAnim->setStartValue(startValue);\n\t\tpMoveAnim->setEndValue(endValue);\n\t\tpMoveAnim->start(QAbstractAnimation::DeleteWhenStopped);\n\n\t\tm_moveAnimations.insert(pNotification, pMoveAnim);\n\n\t\tconnect(pMoveAnim, &QPropertyAnimation::finished, [this, pNotification, pMoveAnim, removeOnEnd]()\n\t\t{\n\t\t\t// Make sure we don't track this move anim after it's done playing\n\t\t\tif (m_moveAnimations.contains(pNotification) && pMoveAnim == m_moveAnimations[pNotification])\n\t\t\t\tm_moveAnimations.remove(pNotification);\n\n\t\t\tif (removeOnEnd)\n\t\t\t{\n\t\t\t\tpNotification->deleteLater();\n\t\t\t}\n\t\t});\n\t}\n\n\tvoid MoveNotificationsUp(int idx, int delta)\n\t{\n\t\tfor (; idx < m_notificationPopups.size(); ++idx)\n\t\t{\n\t\t\tCNotificationWidget* pNotification = m_notificationPopups[idx];\n\t\t\tAnimateMove(pNotification, QPoint(0, -delta));\n\t\t}\n\t}\n\n\tint Add(CNotificationWidget* pNotification)\n\t{\n\t\tm_notificationPopups.push_back(pNotification);\n\t\treturn m_notificationPopups.size() - 1;\n\t}\n\n\tvoid Remove(CNotificationWidget* pNotification)\n\t{\n\t\tint idx = m_notificationPopups.indexOf(pNotification);\n\t\tif (idx != -1)\n\t\t{\n\t\t\tint freedHeight = pNotification->height();\n\t\t\tm_notificationPopups.removeAt(idx);\n\t\t\t// Move up pop-ups starting from idx\n\t\t\tMoveNotificationsUp(idx, freedHeight + notificationDistance);\n\n\t\t\t// Try and spawn any queued up notification\n\t\t\tShowQueuedNotifications();\n\t\t}\n\t}\n\n\tbool Show(CNotificationWidget* pNotification)\n\t{\n\t\tint idx = m_notificationPopups.indexOf(pNotification);\n\t\tint yDelta = m_pNotificationCenterWidget->height() + notificationDistance;\n\t\tfor (auto i = 0; i < idx; ++i)\n\t\t{\n\t\t\tyDelta += m_notificationPopups[i]->height() + notificationDistance;\n\t\t}\n\n\t\tif (m_pNotificationCenterWidget->window()->windowState() & Qt::WindowMinimized)\n\t\t\treturn false;\n\n\t\tpNotification->ShowAt(m_pNotificationCenterWidget->mapToGlobal(QPoint(0, yDelta)));\n\n\t\t// Get the screen geometry so we make sure we're not spawning a notification outside the screen\n\t\t// This must happen after the notification is shown or else it's dimensions will be incorrect\n\t\tQRect screenRes = QApplication::desktop()->screenGeometry();\n\t\tif ((yDelta + pNotification->height()) > screenRes.height())\n\t\t{\n\t\t\tpNotification->Hide();\n\t\t\treturn false;\n\t\t}\n\n\t\tAnimateNotification(pNotification, true);\n\t\tpNotification->signalNotificationHide.Connect([this, pNotification] { Hide(pNotification); });\n\t\tpNotification->signalNotificationHideAll.Connect([this] { HideAll(); });\n\t\treturn true;\n\t}\n\n\tvoid ShowQueuedNotifications()\n\t{\n\t\tfor (int i = 0; i < m_notificationPopups.size(); ++i)\n\t\t{\n\t\t\tif (m_notificationPopups[i]->isVisible())\n\t\t\t\tcontinue;\n\n\t\t\tif (!Show(m_notificationPopups[i]))\n\t\t\t\treturn;\n\t\t}\n\t}\n\n\tvoid Hide(CNotificationWidget* pNotification)\n\t{\n\t\tAnimateNotification(pNotification, false);\n\t\t// Another notification can now take it's place\n\t\tRemove(pNotification);\n\t}\n\n\tvoid HideAll()\n\t{\n\t\tfor (int i = m_notificationPopups.size() - 1; i >= 0; --i)\n\t\t{\n\t\t\tif (m_notificationPopups[i]->isVisible())\n\t\t\t{\n\t\t\t\tAnimateNotification(m_notificationPopups[i], false);\n\t\t\t\t// Another notification can now take it's place\n\t\t\t\tRemove(m_notificationPopups[i]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_notificationPopups[i]->deleteLater();\n\t\t\t\tm_notificationPopups.removeAt(i);\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid CombineCryLogNotifications(Internal::CNotification* pNotificationDesc)\n\t{\n\t\tif (!pNotificationDesc->IsLogMessage())\n\t\t\treturn;\n\n\t\tfor (auto i = 0; i < m_notificationPopups.size(); ++i)\n\t\t{\n\t\t\tif (m_notificationPopups[i] && m_notificationPopups[i]->IsLogMessage())\n\t\t\t{\n\t\t\t\tCNotificationWidget* pNotification = m_notificationPopups[i];\n\t\t\t\t// Capture height before combining\n\t\t\t\tQSize prevSize = pNotification->size();\n\t\t\t\t// Combine titles, increase message count display and start timer to hide the notification\n\t\t\t\tpNotification->CombineNotifications(pNotificationDesc->GetTitle());\n\t\t\t\tpNotification->StartHideTimer();\n\t\t\t\t// Capture height after combining and calculate delta to check if some space freed up\n\t\t\t\tQSize delta = prevSize - pNotification->size();\n\n\t\t\t\t// If there's already an existing move animation make sure to update the size in the animation\n\t\t\t\t// If not the widget's geometry will keep animating with an outdated size\n\t\t\t\tQPropertyAnimation* pMoveAnim = m_moveAnimations[pNotification];\n\t\t\t\tif (pMoveAnim && !delta.isNull())\n\t\t\t\t{\n\t\t\t\t\tQRectF startValue = pNotification->geometry();\n\t\t\t\t\tstartValue.setSize(pNotification->size());\n\t\t\t\t\tQRectF endValue = pMoveAnim->endValue().toRectF();\n\t\t\t\t\tendValue.setSize(pNotification->size());\n\t\t\t\t\tint timeRemaining = pMoveAnim->duration() - pMoveAnim->currentTime();\n\t\t\t\t\tpMoveAnim->stop();\n\t\t\t\t\tm_moveAnimations.remove(pNotification);\n\n\t\t\t\t\tpMoveAnim = new QPropertyAnimation(pNotification, \"geometry\");\n\t\t\t\t\tpMoveAnim->setDuration(timeRemaining);\n\t\t\t\t\tpMoveAnim->setEasingCurve(QEasingCurve::OutCubic);\n\t\t\t\t\tpMoveAnim->setStartValue(startValue);\n\t\t\t\t\tpMoveAnim->setEndValue(endValue);\n\t\t\t\t\tpMoveAnim->start(QAbstractAnimation::DeleteWhenStopped);\n\n\t\t\t\t\tm_moveAnimations.insert(pNotification, pMoveAnim);\n\n\t\t\t\t\tconnect(pMoveAnim, &QPropertyAnimation::finished, [this, pNotification, pMoveAnim]()\n\t\t\t\t\t{\n\t\t\t\t\t\t// Make sure we don't track this move anim after it's done playing\n\t\t\t\t\t\tif (m_moveAnimations.contains(pNotification) && pMoveAnim == m_moveAnimations[pNotification])\n\t\t\t\t\t\t\tm_moveAnimations.remove(pNotification);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (delta.height() > 0) // If there's a positive delta, then move all other notifications up\n\t\t\t\t\tMoveNotificationsUp(i + 1, delta.height());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\nprivate:\n\t// QSS properties\n\tint notificationDistance;\n\tint animationDuration;\n\tint animationDistance;\n\tint notificationMaxCount;\n\n\tQWidget* m_pNotificationCenterWidget;\n\tQVector m_notificationPopups;\n\t// Ongoing geometry animations need to be cached so we can update the end value if needed\n\tQHash m_moveAnimations;\n\n\t// Used for when the editor is loading up. Accumulate notifications to be displayed after\n\t// the main frame has finished loading. Otherwise notifications will spawn out of screen bounds\n\tbool m_bPreventPopups;\n};\n\nclass CNotificationCenterWidget : public QWidget\n{\npublic:\n\tCNotificationCenterWidget(QWidget* pParent = nullptr)\n\t\t: QWidget(pParent)\n\t{\n\t\tQVBoxLayout* pMainLayout = new QVBoxLayout();\n\t\tpMainLayout->setSpacing(0);\n\t\tpMainLayout->setMargin(0);\n\n\t\tQTabWidget* pTabWidget = new QTabWidget();\n\t\tpTabWidget->setObjectName(\"notificationTabs\");\n\t\tpTabWidget->addTab(new CNotificationList(), \"Current\");\n\t\tpTabWidget->addTab(new CNotificationHistory(), \"History\");\n\t\tpTabWidget->addTab(GetIEditor()->GetPreferences()->GetPageWidget(\"Notifications/General\"), \"Preferences\");\n\t\tpMainLayout->addWidget(pTabWidget);\n\t\tpMainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);\n\t\tsetLayout(pMainLayout);\n\t}\n};\n\nCNotificationCenterDockable::CNotificationCenterDockable(QWidget* pParent /* = nullptr*/)\n\t: CDockableWidget(pParent)\n{\n\tQVBoxLayout* pMainLayout = new QVBoxLayout();\n\tpMainLayout->setSpacing(0);\n\tpMainLayout->setMargin(0);\n\tpMainLayout->addWidget(new CNotificationCenterWidget());\n\tsetLayout(pMainLayout);\n}\n\nCNotificationCenterTrayWidget::CNotificationCenterTrayWidget(QWidget* pParent /* = nullptr*/)\n\t: QToolButton(pParent)\n\t, m_pPopUpMenu(nullptr)\n\t, m_notificationType(-1)\n{\n\tm_pPopUpManager = new CNotificationPopupManager(this);\n\tCNotificationCenter* pNotificationCenter = static_cast(GetIEditor()->GetNotificationCenter());\n\n\tconnect(pNotificationCenter, &CNotificationCenter::NotificationAdded, this, &CNotificationCenterTrayWidget::OnNotificationAdded);\n\tconnect(pNotificationCenter, &CNotificationCenter::NotificationAdded, m_pPopUpManager, &CNotificationPopupManager::SpawnNotification);\n\tconnect(this, &QToolButton::clicked, this, &CNotificationCenterTrayWidget::OnClicked);\n\tconnect(GetIEditor()->GetTrayArea(), &CTrayArea::MainFrameInitialized, [this]()\n\t{\n\t\tm_pPopUpMenu = new QPopupWidget(\"NotificationCenterPopup\", QtUtil::MakeScrollable(new CNotificationCenterWidget()), QSize(480, 640));\n\t\tm_pPopUpMenu->SetFocusShareWidget(this);\n\t\tm_pPopUpMenu->installEventFilter(this); // used to catch show and hide events\n\t});\n\n\tsetIcon(CryIcon(\"icons:Dialogs/notification_text.ico\"));\n}\n\nCNotificationCenterTrayWidget::~CNotificationCenterTrayWidget()\n{\n\tdelete m_pPopUpMenu;\n}\n\nbool CNotificationCenterTrayWidget::eventFilter(QObject* pWatched, QEvent* pEvent)\n{\n\tif (pWatched != m_pPopUpMenu)\n\t\treturn false;\n\n\tif (pEvent->type() == QEvent::Hide)\n\t{\n\t\t// Clear queued up notifications and enable pop ups to be created\n\t\tm_pPopUpManager->ClearQueuedNotifications();\n\t\tm_pPopUpManager->SetPreventPopUps(false);\n\t}\n\telse if (pEvent->type() == QEvent::Show)\n\t{\n\t\t// Prevent popups while the dialog is open\n\t\tm_pPopUpManager->SetPreventPopUps(true);\n\t}\n\n\treturn false;\n}\n\nvoid CNotificationCenterTrayWidget::showEvent(QShowEvent* pEvent)\n{\n\tQToolButton::showEvent(pEvent);\n\tm_pPopUpManager->SetPreventPopUps(false);\n}\n\nvoid CNotificationCenterTrayWidget::OnNotificationAdded(int id)\n{\n\tCNotificationCenter* pNotificationCenter = static_cast(GetIEditor()->GetNotificationCenter());\n\tInternal::CNotification* pNotificationDesc = pNotificationCenter->GetNotification(id);\n\n\t// If we haven't constructed the notifications pop up menu or it's currently hidden, color the tray icon to show\n\t// that there are un-checked notifications\n\tif (!m_pPopUpMenu || !m_pPopUpMenu->isVisible())\n\t{\n\t\tInternal::CNotification::Type notificationType = pNotificationDesc->GetType();\n\t\tif (m_notificationType >= notificationType)\n\t\t\treturn;\n\n\t\tif (notificationType != Internal::CNotification::Progress)\n\t\t\tm_notificationType = notificationType;\n\n\t\tCryIconColorMap colorMap = CryIconColorMap();\n\n\t\tswitch (m_notificationType)\n\t\t{\n\t\tcase Internal::CNotification::Type::Warning:\n\t\t\tcolorMap[QIcon::Selected] = GetStyleHelper()->warningColor();\n\t\t\tsetIcon(CryIcon(\"icons:Dialogs/notification_warning.ico\", colorMap).pixmap(24, 24, QIcon::Normal, QIcon::On));\n\t\t\tbreak;\n\t\tcase Internal::CNotification::Type::Critical:\n\t\t\tcolorMap[QIcon::Selected] = GetStyleHelper()->errorColor();\n\t\t\tsetIcon(CryIcon(\"icons:Dialogs/notification_warning.ico\", colorMap).pixmap(24, 24, QIcon::Normal, QIcon::On));\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcolorMap[QIcon::Selected] = GetStyleHelper()->activeIconTint();\n\t\t\tsetIcon(CryIcon(\"icons:Dialogs/notification_text.ico\", colorMap).pixmap(24, 24, QIcon::Normal, QIcon::On));\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nvoid CNotificationCenterTrayWidget::OnClicked(bool bChecked)\n{\n\tif (!m_pPopUpMenu->isVisible())\n\t{\n\t\tm_notificationType = -1;\n\t\tsetIcon(CryIcon(\"icons:Dialogs/notification_text.ico\"));\n\t}\n\n\tif (m_pPopUpMenu->isVisible())\n\t{\n\t\tm_pPopUpMenu->hide();\n\t\treturn;\n\t}\n\n\tm_pPopUpMenu->ShowAt(mapToGlobal(QPoint(width(), height())));\n\tm_pPopUpManager->HideAllNotificationPopUps();\n}\n\nint CNotificationCenterTrayWidget::GetNotificationDistance() const\n{\n\treturn m_pPopUpManager->GetNotificationDistance();\n}\n\nint CNotificationCenterTrayWidget::GetNotificationMaxCount() const\n{\n\treturn m_pPopUpManager->GetNotificationMaxCount();\n}\n\nint CNotificationCenterTrayWidget::GetAnimationDuration() const\n{\n\treturn m_pPopUpManager->GetAnimationDuration();\n}\n\nint CNotificationCenterTrayWidget::GetAnimationDistance() const\n{\n\treturn m_pPopUpManager->GetAnimationDistance();\n}\n\nvoid CNotificationCenterTrayWidget::SetNotificationDistance(int distance)\n{\n\tm_pPopUpManager->SetNotificationDistance(distance);\n}\n\nvoid CNotificationCenterTrayWidget::SetNotificationMaxCount(int maxCount)\n{\n\tm_pPopUpManager->SetNotificationMaxCount(maxCount);\n}\n\nvoid CNotificationCenterTrayWidget::SetAnimationDuration(int duration)\n{\n\tm_pPopUpManager->SetAnimationDuration(duration);\n}\n\nvoid CNotificationCenterTrayWidget::SetAnimationDistance(int distance)\n{\n\tm_pPopUpManager->SetAnimationDistance(distance);\n\n}\n"} +{"text": "Acidic Slime\nAct of Authority\nAerie Mystics\nAjani's Pridemate\nAkoum Refuge\nAngel of Finality\nAnnihilate\nArcane Denial\nArcane Melee\nArcane Sanctum\nArchangel\nArmillary Sphere\nArmy of the Damned\nAugur of Bolas\nAugury Adept\nAvenger of Zendikar\nAzami, Lady of Scrolls\nAzorius Chancery\nAzorius Guildgate\nAzorius Herald\nAzorius Keyrune\nBaleful Force\nBaleful Strix\nBaloth Woodcrasher\nBane of Progress\nBant Panorama\nBarren Moor\nBasalt Monolith\nBehemoth Sledge\nBlood Rites\nBlue Sun's Zenith\nBojuka Bog\nBoros Charm\nBoros Garrison\nBoros Guildgate\nBorrowing 100,000 Arrows\nBrilliant Plan\nBrooding Saurian\nCapricious Efreet\nCarnage Altar\nCharmbreaker Devils\nCharnelhoard Wurm\nCommand Tower\nConjurer's Closet\nContested Cliffs\nControl Magic\nCradle of Vitality\nCrater Hellion\nCrawlspace\nCrosis's Charm\nCruel Ultimatum\nCrumbling Necropolis\nCultivate\nCurse of Chaos\nCurse of Inertia\nCurse of Predation\nCurse of Shallow Graves\nCurse of the Forsaken\nDarksteel Ingot\nDarksteel Mutation\nDeadwood Treefolk\nDeath Grasp\nDeathbringer Thoctar\nDeceiver Exarch\nDecree of Pain\nDeep Analysis\nDeepfire Elemental\nDerevi, Empyrial Tactician\nDimir Guildgate\nDirge of Dread\nDisciple of Griselbrand\nDismiss\nDiviner Spirit\nDivinity of Pride\nDjinn of Infinite Deceits\nDrifting Meadow\nDromar's Charm\nDruidic Satchel\nDrumhunter\nDungeon Geists\nEcho Mage\nElvish Skysweeper\nEndless Cockroaches\nEndrek Sahr, Master Breeder\nEsper Panorama\nEternal Dragon\nEvolving Wilds\nEye of Doom\nFaerie Conclave\nFamine\nFarhaven Elf\nFecundity\nFell Shepherd\nFiend Hunter\nFiery Justice\nFiligree Angel\nFireball\nFires of Yavimaya\nFissure Vent\nFlickerform\nFlickerwisp\nFog Bank\nForest\nForgotten Cave\nFoster\nFrom the Ashes\nFurnace Celebration\nGahiji, Honored One\nGoblin Bombardment\nGoblin Sharpshooter\nGolgari Guildgate\nGolgari Guildmage\nGolgari Rot Farm\nGrazing Gladehart\nGreed\nGrim Backwoods\nGrixis Charm\nGrixis Panorama\nGruul Guildgate\nGuard Gomazoa\nGuttersnipe\nHada Spy Patrol\nHarmonize\nHomeward Path\nHooded Horror\nHua Tuo, Honored Physician\nHull Breach\nHunted Troll\nIllusionist's Gambit\nIncendiary Command\nInferno Titan\nInfest\nIsland\nIzzet Boilerworks\nIzzet Guildgate\nJace's Archivist\nJade Mage\nJar of Eyeballs\nJeleva, Nephalia's Scourge\nJund Charm\nJund Panorama\nJungle Shrine\nJwar Isle Refuge\nKarmic Guide\nKazandu Refuge\nKazandu Tuskcaller\nKhalni Garden\nKher Keep\nKirtar's Wrath\nKongming, \"Sleeping Dragon\"\nKrosan Grip\nKrosan Tusker\nKrosan Warchief\nLeafdrake Roost\nLeonin Bladetrap\nLim-Dûl's Vault\nLlanowar Reborn\nLonely Sandbar\nLu Xun, Scholar General\nMagus of the Arena\nMarath, Will of the Wild\nMarrow Bats\nMass Mutiny\nMayael the Anima\nMirari\nMirror Entity\nMistmeadow Witch\nMnemonic Wall\nMold Shambler\nMolten Disaster\nMolten Slagheap\nMosswort Bridge\nMountain\nMurkfiend Liege\nMyr Battlesphere\nMystic Barrier\nNaya Charm\nNaya Panorama\nNaya Soulbeast\nNekusar, the Mindrazer\nNevinyrral's Disk\nNew Benalia\nNight Soil\nNightscape Familiar\nNihil Spellbomb\nNivix Guildmage\nObelisk of Esper\nObelisk of Grixis\nObelisk of Jund\nOloro, Ageless Ascetic\nOne Dozen Eyes\nOpal Palace\nOphiomancer\nOpportunity\nOrder of Succession\nOrzhov Basilica\nOrzhov Guildgate\nPhantom Nantuko\nPhthisis\nPhyrexian Delver\nPhyrexian Gargantua\nPhyrexian Reclamation\nPilgrim's Eye\nPlague Boiler\nPlains\nPresence of Gond\nPrice of Knowledge\nPrimal Vigor\nPristine Talisman\nPropaganda\nProsperity\nProssh, Skyraider of Kher\nQuagmire Druid\nRain of Thorns\nRakdos Carnarium\nRakdos Guildgate\nRakeclaw Gargantuan\nRampaging Baloths\nRaven Familiar\nRavenous Baloth\nRazor Hippogriff\nReckless Spite\nReincarnation\nRestore\nRoon of the Hidden Realm\nRough\nRubinia Soulsinger\nRupture Spire\nSakura-Tribe Elder\nSaltcrusted Steppe\nSanguine Bond\nSavage Lands\nSavage Twister\nScarland Thrinax\nSeaside Citadel\nSecluded Steppe\nSeer's Sundial\nSejiri Refuge\nSek'Kuar, Deathkeeper\nSelesnya Charm\nSelesnya Guildgate\nSelesnya Guildmage\nSelesnya Sanctuary\nSelesnya Signet\nSerene Master\nSerra Avatar\nSharding Sphinx\nSharuum the Hegemon\nShattergang Brothers\nSilklash Spider\nSimic Guildgate\nSimic Signet\nSkyscribing\nSkyward Eye Prophets\nSlice and Dice\nSlice in Twain\nSlippery Karst\nSmoldering Crater\nSol Ring\nSoul Manipulation\nSpawning Grounds\nSpellbreaker Behemoth\nSphinx of the Steel Wind\nSpinal Embrace\nSpine of Ish Sah\nSpitebellows\nSpiteful Visions\nSpoils of Victory\nSpringjack Pasture\nSprouting Thrinax\nSprouting Vines\nStalking Vengeance\nStarstorm\nStonecloaker\nStormscape Battlemage\nStrategic Planning\nStreet Spasm\nStronghold Assassin\nSudden Demise\nSudden Spoiling\nSun Droplet\nSurveyor's Scope\nSurvival Cache\nSwamp\nSwiftfoot Boots\nSword of the Paruns\nSydri, Galvanic Genius\nTemple Bell\nTemple of the False God\nTempt with Discovery\nTempt with Glory\nTempt with Immortality\nTempt with Reflections\nTempt with Vengeance\nTerra Ravager\nTerramorphic Expanse\nThopter Foundry\nThornwind Faeries\nThousand-Year Elixir\nThraximundar\nThunderstaff\nTidal Force\nTidehollow Strix\nTooth and Claw\nTower Gargoyle\nTower of Fortunes\nToxic Deluge\nTranquil Thicket\nTransguild Promenade\nTrue-Name Nemesis\nTumble\nUnexpectedly Absent\nUrza's Factory\nUyo, Silent Prophet\nValley Rannet\nVampire Nighthawk\nVile Requiem\nViscera Seer\nViseling\nVision Skeins\nVitu-Ghazi, the City-Tree\nVivid Crag\nVivid Creek\nVivid Grove\nVivid Marsh\nVizkopa Guildmage\nWalker of the Grove\nWall of Reverence\nWar Cadence\nWarstorm Surge\nWash Out\nWayfarer's Bauble\nWell of Lost Dreams\nWhere Ancients Tread\nWidespread Panic\nWight of Precinct Six\nWild Ricochet\nWinged Coatl\nWitch Hunt\nWonder\nWrath of God\nAethermage's Touch\n"} +{"text": "\n \n \n \n \n \n \n \n \n \n\n"} +{"text": "import Relay from 'react-relay/classic';\n\nexport default class OrganizationMemberDelete extends Relay.Mutation {\n static fragments = {\n organizationMember: () => Relay.QL`\n fragment on OrganizationMember {\n id\n organization {\n id\n }\n }\n `\n }\n\n getMutation() {\n return Relay.QL`\n mutation {\n organizationMemberDelete\n }\n `;\n }\n\n getFatQuery() {\n return Relay.QL`\n fragment on OrganizationMemberDeletePayload {\n deletedOrganizationMemberID\n user {\n id\n }\n organization {\n slug\n members {\n count\n }\n }\n }\n `;\n }\n\n getConfigs() {\n return [{\n type: 'REQUIRED_CHILDREN',\n children: [\n Relay.QL`\n fragment on OrganizationMemberDeletePayload {\n user {\n id\n }\n organization {\n members {\n count\n }\n }\n }\n `\n ]\n }, {\n type: 'NODE_DELETE',\n parentName: 'organization',\n parentID: this.props.organizationMember.organization.id,\n connectionName: 'members',\n deletedIDFieldName: 'deletedOrganizationMemberID'\n }];\n }\n\n getVariables() {\n return { id: this.props.organizationMember.id };\n }\n}\n"} +{"text": "#ifndef __EXAMPLEAPP_H\n#define __EXAMPLEAPP_H\n\n#include \n\n\n#define EXAMPLE_APP_TYPE (example_app_get_type ())\nG_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)\n\n\nExampleApp *example_app_new (void);\n\n\n#endif /* __EXAMPLEAPP_H */\n"} +{"text": "# Copyright: 2008 MoinMoin:BastianBlank\n# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.\n\n\"\"\"\nMoinMoin - Converter support\n\nConverters are used to convert between formats or between different featuresets\nof one format.\n\nThere are usually three types of converters:\n\n- Between an input format like Moin Wiki or Creole and the internal tree\n representation.\n- Between the internal tree and an output format like HTML.\n- Between different featuresets of the internal tree representation like URI\n types or macro expansion.\n\nTODO: Merge with new-style macros.\n\"\"\"\n\n\nfrom collections import namedtuple\n\nfrom ..utils.registry import RegistryBase\nfrom ..utils.pysupport import load_package_modules\n\n\nclass ElementException(RuntimeError):\n pass\n\n\nclass RegistryConverter(RegistryBase):\n class Entry(namedtuple('Entry', 'factory type_input type_output priority')):\n def __call__(self, type_input, type_output, **kw):\n if (self.type_output.issupertype(type_output) and\n self.type_input.issupertype(type_input)):\n return self.factory(type_input, type_output, **kw)\n\n def __lt__(self, other):\n if isinstance(other, self.__class__):\n if self.type_output != other.type_output:\n return other.type_output.issupertype(self.type_output)\n if self.type_input != other.type_input:\n return other.type_input.issupertype(self.type_input)\n if self.priority != other.priority:\n return self.priority < other.priority\n return False\n return NotImplemented\n\n def register(self, factory, type_input, type_output, priority=RegistryBase.PRIORITY_MIDDLE):\n \"\"\"\n Register a factory\n\n :param factory: Factory to register. Callable, must return an object.\n \"\"\"\n return self._register(self.Entry(factory, type_input, type_output, priority))\n\n\ndefault_registry = RegistryConverter()\nload_package_modules(__name__, __path__)\n"} +{"text": "'''\n题目:牛客最近来了一个新员工Fish,每天早晨总是会拿着一本英文杂志,写些句子在本子上。同事Cat对Fish写的内容\n颇感兴趣,有一天他向Fish借来翻看,但却读不懂它的意思。例如,“student. a am I”。后来才意识到,这家伙原来把\n句子单词的顺序翻转了,正确的句子应该是“I am a student.”。Cat对一一的翻转这些单词顺序可不在行,你能帮助他么?\n'''\n\n'''\n思路一:\n\n26ms\n5632k\n'''\n\n# -*- coding:utf-8 -*-\nclass Solution:\n def ReverseSentence(self, s):\n # write code here\n if s == None or len(s) <= 0:\n return ''\n # 以空格为界,提取单一字符,然后用切片拍一下顺序\n return ' '.join(s.split(' ')[::-1])\n\n'''\n思路二:首先需要写一个reverse函数,把任何输入的字符串完全翻转。然后从前往后依次遍历新字符串,如果遇到空格,\n就把空格前的字符串用reverse翻转,添加空格,继续遍历。需要注意的是,如果新字符串结尾不是空格,当遍历到结尾的\n时候,前一个空格到结尾的字符串没有翻转,因此记得跳出遍历后,需要再完成一次翻转操作。\n\n举例:\n student. a am I\n I ma a .tneduts\n I pEnd = ' ',首先让空格前面的字符进行翻转,然后 pStart = pEnd\n am pStart = ' ',两个指针都向前进到a位,下一次pEnd继续向前进到空格为止,然后ma翻转变成am\n a\n student. 同理\n\n\n37ms\n5488k\n'''\n\n# -*- coding:utf-8 -*-\nclass Solution:\n def ReverseSentence(self, s):\n # write code here\n if s == None or len(s) <= 0:\n return ''\n s = list(s)\n s = self.Reverse(s)\n pStart = 0\n pEnd = 0\n listTemp = []\n result = ''\n\n while pEnd < len(s):\n if pEnd == len(s) - 1:\n listTemp.append(self.Reverse(s[pStart:]))\n break\n if s[pStart] == ' ':\n pStart += 1\n pEnd += 1\n listTemp.append(' ')\n elif s[pEnd] == ' ':\n listTemp.append(self.Reverse(s[pStart:pEnd]))\n pStart = pEnd\n else:\n pEnd += 1\n for i in listTemp:\n result += ''.join(i)\n return result\n\n def Reverse(self, s):\n start = 0\n end = len(s) - 1\n while start < end:\n s[start], s[end] = s[end], s[start]\n start += 1\n end -= 1\n return s"} +{"text": " 'Adicionar Chaves',\n 'addkeys-placeholder' => 'Adicionar 1 chave por linha, sem o prefixo do grupo',\n 'addsuffixes' => 'Conjunto De Sufixos',\n 'addsuffixes-placeholder' => 'adicione cada tecla de um sufixo formado por linhas inseridas aqui',\n 'auto-fill' => 'Preenchimento Automático',\n 'auto-fill-disabled' => 'Enchimento...',\n 'auto-translate' => 'Auto Traduzir',\n 'auto-translate-disabled' => 'A tradução...',\n 'changed' => 'Alterado',\n 'check-all' => 'Todos',\n 'check-none' => 'Nenhum',\n 'choose-group' => 'Escolha um grupo de tradução',\n 'choose-group-text' => 'Escolha um grupo para apresentar o grupo de traduções. Se os grupos não são visíveis, contacte o seu web-admin.',\n 'cleardstkeys' => 'Clara Chaves',\n 'clearkeys' => 'Clara Chaves',\n 'clearsrckeys' => 'Clara Chaves',\n 'clearsuffixes' => 'Claro Sufixos',\n 'close' => 'Fechar',\n 'confirm-delete' => <<<'TEXT'\nTem certeza de que deseja excluir:\n\n:grupo\n\nas traduções a partir do banco de dados? Quaisquer alterações que não tenham sido publicado nos arquivos de tradução, serão perdidos.\nTEXT\n,\n 'confirm-delete-all' => <<<'TEXT'\nTem certeza de que deseja excluir todas as traduções do banco de dados?\n\nQuaisquer alterações que não tenham sido publicado nos arquivos de tradução, serão perdidos.\nTEXT\n,\n 'confirm-find' => 'Tem certeza de que deseja verificar sua pasta app? Todos encontrados tradução chaves serão adicionados à base de dados.',\n 'copykeys' => 'Teclas De Cópia',\n 'delete' => 'Apagar',\n 'delete-all' => 'Excluir Todos Os',\n 'deleted' => 'Excluídos',\n 'deletekeys' => 'Excluir Chaves',\n 'deleting' => 'Eliminar...',\n 'display-locales' => 'Conjunto De Trabalho',\n 'done-publishing' => 'Feito de publicação de traduções para o grupo :.',\n 'done-publishing-all' => 'Feito de publicação de traduções para o todos grupos.',\n 'dst-preview' => 'Para',\n 'dstkey' => 'Para',\n 'dstkeys' => 'Para Chaves',\n 'dstkeys-placeholder' => 'Adicionar 1 chave por linha, com ou sem o prefixo do grupo',\n 'enter-translation' => 'Digite tradução',\n 'export-warning-text' => 'Aviso, as traduções não são visíveis até que eles são publicados pelo administrador.',\n 'find-in-files' => 'Adicionar Referências',\n 'group' => 'Grupo',\n 'import-add' => 'Apenas adicionar novas traduções',\n 'import-all-done' => 'Feita a importação, processadas :contagem os itens. Recarregue esta página para atualizar os grupos.',\n 'import-done-head' => 'Feita a importação, processado',\n 'import-done-tail' => 'itens. Recarregue esta página para atualizar os grupos.',\n 'import-fresh' => 'Elimine Todos, em seguida, Importar',\n 'import-group' => 'Importação',\n 'import-group-done' => 'Realiza a importação de grupo :, processadas :contagem os itens. Recarregue esta página para atualizar as traduções.',\n 'import-groups' => 'Importar todos os',\n 'import-replace' => 'Substitua as traduções existentes',\n 'in-place-edit' => 'Editar Lugar',\n 'interface-locale' => 'Interface',\n 'key' => 'Chave',\n 'keyop-count-mustmatch' => 'Número de chaves de origem e de destino deve corresponder',\n 'keyop-header' => 'Chave De Operação Resultados',\n 'keyop-header-copy' => 'Copie a chave de operação para : grupo:',\n 'keyop-header-delete' => 'Elimine as chaves de operação a partir de : grupo:',\n 'keyop-header-move' => 'Mova a chave de operação para : grupo:',\n 'keyop-header-preview' => 'Pré-visualizar a chave de operação para : grupo:',\n 'keyop-need-group' => 'Chave de operações requerem um grupo',\n 'keyop-need-keys' => 'Sem chaves previstas para a operação das teclas',\n 'keyop-wildcard-mustmatch' => 'Curinga * caractere deve ser o primeiro ou o último caractere, e se presente deverá ser usado tanto de origem e de destino chaves na mesma posição.',\n 'keyop-wildcard-once' => 'Curinga * personagem só pode aparecer uma vez em uma chave.',\n 'keyops-not-authorized' => 'Operações de chave não são autorizados neste servidor. Contacte o seu web-admin para alterar esta definição.',\n 'keys' => 'Chaves',\n 'loading' => 'Importar...',\n 'locale' => 'Localidade',\n 'mismatches' => 'Incompatíveis Traduções',\n 'missing' => 'Em falta',\n 'missmatched-quotes' => 'incorrectos ou em falta citações em :atributo de seqüência de caracteres',\n 'movekeys' => 'Teclas De Movimento',\n 'preview' => 'Pré-visualização',\n 'primary-locale' => 'Principal',\n 'publish' => 'Publicar Grupo',\n 'publish-all' => 'Publicar Todas As',\n 'publishing' => 'A publicação...',\n 'search' => 'Procura',\n 'search-done' => 'Realiza pesquisa para traduções, encontrada :contagem os itens.',\n 'search-done-head' => 'Realiza pesquisa para traduções, encontrado',\n 'search-done-tail' => 'itens.',\n 'search-header' => 'Resultados encontrados: :contagem',\n 'search-translations' => 'Pesquisa De Traduções',\n 'searching' => 'A procura...',\n 'src-preview' => 'A partir de',\n 'srckey' => 'A partir de',\n 'srckeys' => 'A Partir De Chaves',\n 'srckeys-placeholder' => 'Adicionar 1 chave por linha, com ou sem o prefixo do grupo',\n 'stats' => 'Painel De Visualização',\n 'suffixed-keyops' => 'O Sufixo-Chave De Operações E Pesquisa',\n 'suffixes' => 'Sufixos',\n 'total' => 'Total',\n 'translating-locale' => 'Traduzir',\n 'translation' => 'Tradução',\n 'translation-manager' => 'Tradução Manager',\n 'translation-ops' => 'Auxiliares De Tradução',\n 'translations' => 'Traduções',\n 'wildcard-keyops' => 'Curinga-Chave De Operações De',\n 'zip-all' => 'Zip De Todos Os',\n 'zip-group' => 'Grupo De Zip',\n];\n"} +{"text": "// Boost name_generator.hpp header file ----------------------------------------------//\r\n\r\n// Copyright 2010 Andy Tompkins.\r\n// Distributed under the Boost Software License, Version 1.0. (See\r\n// accompanying file LICENSE_1_0.txt or copy at\r\n// http://www.boost.org/LICENSE_1_0.txt)\r\n\r\n#ifndef BOOST_UUID_NAME_GENERATOR_HPP\r\n#define BOOST_UUID_NAME_GENERATOR_HPP\r\n\r\n#include \r\n#include \r\n#include \r\n#include \r\n#include // for strlen, wcslen\r\n\r\n#ifdef BOOST_NO_STDC_NAMESPACE\r\nnamespace std {\r\n using ::strlen;\r\n using ::wcslen;\r\n} //namespace std\r\n#endif //BOOST_NO_STDC_NAMESPACE\r\n\r\nnamespace boost {\r\nnamespace uuids {\r\n\r\n// generate a name-based uuid\r\n// TODO: add in common namesspace uuids\r\nclass name_generator {\r\npublic:\r\n typedef uuid result_type;\r\n\r\n explicit name_generator(uuid const& namespace_uuid_)\r\n : namespace_uuid(namespace_uuid_)\r\n {}\r\n\r\n uuid operator()(const char* name) {\r\n reset();\r\n process_characters(name, std::strlen(name));\r\n return sha_to_uuid();\r\n }\r\n\r\n uuid operator()(const wchar_t* name) {\r\n reset();\r\n process_characters(name, std::wcslen(name));\r\n return sha_to_uuid();\r\n }\r\n\r\n template \r\n uuid operator()(std::basic_string const& name) {\r\n reset();\r\n process_characters(name.c_str(), name.length());\r\n return sha_to_uuid();\r\n }\r\n \r\n uuid operator()(void const* buffer, std::size_t byte_count) {\r\n reset();\r\n sha.process_bytes(buffer, byte_count);\r\n return sha_to_uuid();\r\n };\r\n\r\nprivate:\r\n // we convert all characters to uint32_t so that each\r\n // character is 4 bytes reguardless of sizeof(char) or\r\n // sizeof(wchar_t). We want the name string on any\r\n // platform / compiler to generate the same uuid\r\n // except for char\r\n template \r\n void process_characters(char_type const*const characters, size_t count) {\r\n BOOST_ASSERT(sizeof(uint32_t) >= sizeof(char_type));\r\n\r\n for (size_t i=0; i((c >> 0) & 0xFF));\r\n sha.process_byte(static_cast((c >> 8) & 0xFF));\r\n sha.process_byte(static_cast((c >> 16) & 0xFF));\r\n sha.process_byte(static_cast((c >> 24) & 0xFF));\r\n }\r\n }\r\n \r\n void process_characters(char const*const characters, size_t count) {\r\n sha.process_bytes(characters, count);\r\n }\r\n\r\n void reset()\r\n {\r\n sha.reset();\r\n sha.process_bytes(namespace_uuid.begin(), namespace_uuid.size());\r\n }\r\n \r\n uuid sha_to_uuid()\r\n {\r\n unsigned int digest[5];\r\n\r\n sha.get_digest(digest);\r\n\r\n uuid u;\r\n for (int i=0; i<4; ++i) {\r\n *(u.begin() + i*4+0) = static_cast((digest[i] >> 24) & 0xFF);\r\n *(u.begin() + i*4+1) = static_cast((digest[i] >> 16) & 0xFF);\r\n *(u.begin() + i*4+2) = static_cast((digest[i] >> 8) & 0xFF);\r\n *(u.begin() + i*4+3) = static_cast((digest[i] >> 0) & 0xFF);\r\n }\r\n\r\n // set variant\r\n // must be 0b10xxxxxx\r\n *(u.begin()+8) &= 0xBF;\r\n *(u.begin()+8) |= 0x80;\r\n\r\n // set version\r\n // must be 0b0101xxxx\r\n *(u.begin()+6) &= 0x5F; //0b01011111\r\n *(u.begin()+6) |= 0x50; //0b01010000\r\n\r\n return u;\r\n }\r\n\r\nprivate:\r\n uuid namespace_uuid;\r\n detail::sha1 sha;\r\n};\r\n\r\n}} // namespace boost::uuids\r\n\r\n#endif // BOOST_UUID_NAME_GENERATOR_HPP\r\n"} +{"text": "#ifndef INSTANTIATE_TEMPLATES\n// for vipl_erode_disk<...> instantiation:\n#include \"../vipl_filterable_section_container_generator_section.hxx\"\n#include \"../accessors/vipl_accessors_section.h\"\n#include \ntypedef section img_type;\n\ntemplate class vipl_erode_disk;\n#endif\n"} +{"text": "#\n# irb/ruby-token.rb - ruby tokens \n# \t$Release Version: 0.9.5$\n# \t$Revision: 11708 $\n# \t$Date: 2007-02-12 16:01:19 -0700 (Mon, 12 Feb 2007) $\n# \tby Keiju ISHITSUKA(keiju@ruby-lang.org)\n#\n# --\n#\n# \n#\nmodule RubyToken\n EXPR_BEG = :EXPR_BEG\n EXPR_MID = :EXPR_MID\n EXPR_END = :EXPR_END\n EXPR_ARG = :EXPR_ARG\n EXPR_FNAME = :EXPR_FNAME\n EXPR_DOT = :EXPR_DOT\n EXPR_CLASS = :EXPR_CLASS\n\n # for ruby 1.4X\n if !defined?(Symbol)\n Symbol = Integer\n end\n \n class Token\n def initialize(seek, line_no, char_no)\n @seek = seek\n @line_no = line_no\n @char_no = char_no\n end\n attr :seek\n attr :line_no\n attr :char_no\n end\n\n class TkNode < Token\n def initialize(seek, line_no, char_no)\n super\n end\n attr :node\n end\n\n class TkId < Token\n def initialize(seek, line_no, char_no, name)\n super(seek, line_no, char_no)\n @name = name\n end\n attr :name\n end\n\n class TkVal < Token\n def initialize(seek, line_no, char_no, value = nil)\n super(seek, line_no, char_no)\n @value = value\n end\n attr :value\n end\n\n class TkOp < Token\n attr :name, true\n end\n\n class TkOPASGN < TkOp\n def initialize(seek, line_no, char_no, op)\n super(seek, line_no, char_no)\n op = TkReading2Token[op][0] unless op.kind_of?(Symbol)\n @op = op\n end\n attr :op\n end\n\n class TkUnknownChar < Token\n def initialize(seek, line_no, char_no, id)\n super(seek, line_no, char_no)\n @name = name\n end\n attr :name\n end\n\n class TkError < Token\n end\n\n def Token(token, value = nil)\n case token\n when String\n if (tk = TkReading2Token[token]).nil?\n\tIRB.fail TkReading2TokenNoKey, token\n end\n tk = Token(tk[0], value) \n if tk.kind_of?(TkOp)\n\ttk.name = token\n end\n return tk\n when Symbol\n if (tk = TkSymbol2Token[token]).nil?\n\tIRB.fail TkSymbol2TokenNoKey, token\n end\n return Token(tk[0], value) \n else \n if (token.ancestors & [TkId, TkVal, TkOPASGN, TkUnknownChar]).empty?\n\ttoken.new(@prev_seek, @prev_line_no, @prev_char_no)\n else\n\ttoken.new(@prev_seek, @prev_line_no, @prev_char_no, value)\n end\n end\n end\n\n TokenDefinitions = [\n [:TkCLASS, TkId, \"class\", EXPR_CLASS],\n [:TkMODULE, TkId, \"module\", EXPR_BEG],\n [:TkDEF,\t TkId, \"def\", EXPR_FNAME],\n [:TkUNDEF, TkId, \"undef\", EXPR_FNAME],\n [:TkBEGIN, TkId, \"begin\", EXPR_BEG],\n [:TkRESCUE, TkId, \"rescue\", EXPR_MID],\n [:TkENSURE, TkId, \"ensure\", EXPR_BEG],\n [:TkEND,\t TkId, \"end\", EXPR_END],\n [:TkIF, TkId, \"if\", EXPR_BEG, :TkIF_MOD],\n [:TkUNLESS, TkId, \"unless\", EXPR_BEG, :TkUNLESS_MOD],\n [:TkTHEN,\t TkId, \"then\", EXPR_BEG],\n [:TkELSIF, TkId, \"elsif\", EXPR_BEG],\n [:TkELSE,\t TkId, \"else\", EXPR_BEG],\n [:TkCASE,\t TkId, \"case\", EXPR_BEG],\n [:TkWHEN,\t TkId, \"when\", EXPR_BEG],\n [:TkWHILE, TkId, \"while\", EXPR_BEG, :TkWHILE_MOD],\n [:TkUNTIL, TkId, \"until\", EXPR_BEG, :TkUNTIL_MOD],\n [:TkFOR,\t TkId, \"for\", EXPR_BEG],\n [:TkBREAK, TkId, \"break\", EXPR_END],\n [:TkNEXT,\t TkId, \"next\", EXPR_END],\n [:TkREDO,\t TkId, \"redo\", EXPR_END],\n [:TkRETRY, TkId, \"retry\", EXPR_END],\n [:TkIN,\t TkId, \"in\", EXPR_BEG],\n [:TkDO,\t TkId, \"do\", EXPR_BEG],\n [:TkRETURN, TkId, \"return\", EXPR_MID],\n [:TkYIELD, TkId, \"yield\", EXPR_END],\n [:TkSUPER, TkId, \"super\", EXPR_END],\n [:TkSELF,\t TkId, \"self\", EXPR_END],\n [:TkNIL, \t TkId, \"nil\", EXPR_END],\n [:TkTRUE,\t TkId, \"true\", EXPR_END],\n [:TkFALSE, TkId, \"false\", EXPR_END],\n [:TkAND,\t TkId, \"and\", EXPR_BEG],\n [:TkOR, \t TkId, \"or\", EXPR_BEG],\n [:TkNOT,\t TkId, \"not\", EXPR_BEG],\n [:TkIF_MOD, TkId],\n [:TkUNLESS_MOD, TkId],\n [:TkWHILE_MOD, TkId],\n [:TkUNTIL_MOD, TkId],\n [:TkALIAS, TkId, \"alias\", EXPR_FNAME],\n [:TkDEFINED, TkId, \"defined?\", EXPR_END],\n [:TklBEGIN, TkId, \"BEGIN\", EXPR_END],\n [:TklEND,\t TkId, \"END\", EXPR_END],\n [:Tk__LINE__, TkId, \"__LINE__\", EXPR_END],\n [:Tk__FILE__, TkId, \"__FILE__\", EXPR_END],\n\n [:TkIDENTIFIER, TkId],\n [:TkFID,\t TkId],\n [:TkGVAR,\t TkId],\n [:TkCVAR,\t TkId],\n [:TkIVAR,\t TkId],\n [:TkCONSTANT, TkId],\n\n [:TkINTEGER, TkVal],\n [:TkFLOAT, TkVal],\n [:TkSTRING, TkVal],\n [:TkXSTRING, TkVal],\n [:TkREGEXP, TkVal],\n [:TkSYMBOL, TkVal],\n\n [:TkDSTRING, TkNode],\n [:TkDXSTRING, TkNode],\n [:TkDREGEXP, TkNode],\n [:TkNTH_REF, TkNode],\n [:TkBACK_REF, TkNode],\n\n [:TkUPLUS, TkOp, \"+@\"],\n [:TkUMINUS, TkOp, \"-@\"],\n [:TkPOW,\t TkOp, \"**\"],\n [:TkCMP,\t TkOp, \"<=>\"],\n [:TkEQ,\t TkOp, \"==\"],\n [:TkEQQ,\t TkOp, \"===\"],\n [:TkNEQ,\t TkOp, \"!=\"],\n [:TkGEQ,\t TkOp, \">=\"],\n [:TkLEQ,\t TkOp, \"<=\"],\n [:TkANDOP, TkOp, \"&&\"],\n [:TkOROP,\t TkOp, \"||\"],\n [:TkMATCH, TkOp, \"=~\"],\n [:TkNMATCH, TkOp, \"!~\"],\n [:TkDOT2,\t TkOp, \"..\"],\n [:TkDOT3,\t TkOp, \"...\"],\n [:TkAREF,\t TkOp, \"[]\"],\n [:TkASET,\t TkOp, \"[]=\"],\n [:TkLSHFT, TkOp, \"<<\"],\n [:TkRSHFT, TkOp, \">>\"],\n [:TkCOLON2, TkOp],\n [:TkCOLON3, TkOp],\n# [:OPASGN,\t TkOp], # +=, -= etc. #\n [:TkASSOC, TkOp, \"=>\"],\n [:TkQUESTION, TkOp, \"?\"],\t #?\n [:TkCOLON, TkOp, \":\"], #:\n \n [:TkfLPAREN], # func( #\n [:TkfLBRACK], # func[ #\n [:TkfLBRACE], # func{ #\n [:TkSTAR], # *arg\n [:TkAMPER], # &arg #\n [:TkSYMBEG], # :SYMBOL\n\n [:TkGT,\t TkOp, \">\"],\n [:TkLT,\t TkOp, \"<\"],\n [:TkPLUS,\t TkOp, \"+\"],\n [:TkMINUS, TkOp, \"-\"],\n [:TkMULT,\t TkOp, \"*\"],\n [:TkDIV,\t TkOp, \"/\"],\n [:TkMOD,\t TkOp, \"%\"],\n [:TkBITOR, TkOp, \"|\"],\n [:TkBITXOR, TkOp, \"^\"],\n [:TkBITAND, TkOp, \"&\"],\n [:TkBITNOT, TkOp, \"~\"],\n [:TkNOTOP, TkOp, \"!\"],\n\n [:TkBACKQUOTE, TkOp, \"`\"],\n\n [:TkASSIGN, Token, \"=\"],\n [:TkDOT,\t Token, \".\"],\n [:TkLPAREN, Token, \"(\"], #(exp)\n [:TkLBRACK, Token, \"[\"], #[arry]\n [:TkLBRACE, Token, \"{\"], #{hash}\n [:TkRPAREN, Token, \")\"],\n [:TkRBRACK, Token, \"]\"],\n [:TkRBRACE, Token, \"}\"],\n [:TkCOMMA, Token, \",\"],\n [:TkSEMICOLON, Token, \";\"],\n\n [:TkCOMMENT],\n [:TkRD_COMMENT],\n [:TkSPACE],\n [:TkNL],\n [:TkEND_OF_SCRIPT],\n\n [:TkBACKSLASH, TkUnknownChar, \"\\\\\"],\n [:TkAT,\t TkUnknownChar, \"@\"],\n [:TkDOLLAR, TkUnknownChar, \"$\"],\n ]\n\n # {reading => token_class}\n # {reading => [token_class, *opt]}\n TkReading2Token = {}\n TkSymbol2Token = {}\n\n def RubyToken.def_token(token_n, super_token = Token, reading = nil, *opts)\n token_n = token_n.id2name if token_n.kind_of?(Symbol)\n if RubyToken.const_defined?(token_n)\n IRB.fail AlreadyDefinedToken, token_n\n end\n token_c = eval(\"class #{token_n} < #{super_token}; end; #{token_n}\")\n \n if reading\n if TkReading2Token[reading]\n\tIRB.fail TkReading2TokenDuplicateError, token_n, reading\n end\n if opts.empty?\n\tTkReading2Token[reading] = [token_c]\n else\n\tTkReading2Token[reading] = [token_c].concat(opts)\n end\n end\n TkSymbol2Token[token_n.intern] = token_c\n end\n\n for defs in TokenDefinitions\n def_token(*defs)\n end\nend\n"} +{"text": "dnl ARM mpn_sec_tabselect\n\ndnl Contributed to the GNU project by Torbjörn Granlund.\n\ndnl Copyright 2013 Free Software Foundation, Inc.\n\ndnl This file is part of the GNU MP Library.\ndnl\ndnl The GNU MP Library is free software; you can redistribute it and/or modify\ndnl it under the terms of either:\ndnl\ndnl * the GNU Lesser General Public License as published by the Free\ndnl Software Foundation; either version 3 of the License, or (at your\ndnl option) any later version.\ndnl\ndnl or\ndnl\ndnl * the GNU General Public License as published by the Free Software\ndnl Foundation; either version 2 of the License, or (at your option) any\ndnl later version.\ndnl\ndnl or both in parallel, as here.\ndnl\ndnl The GNU MP Library is distributed in the hope that it will be useful, but\ndnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\ndnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\ndnl for more details.\ndnl\ndnl You should have received copies of the GNU General Public License and the\ndnl GNU Lesser General Public License along with the GNU MP Library. If not,\ndnl see https://www.gnu.org/licenses/.\n\ninclude(`../config.m4')\n\nC\t cycles/limb\nC StrongARM\t ?\nC XScale\t ?\nC Cortex-A7\t ?\nC Cortex-A8\t ?\nC Cortex-A9\t 2.33\nC Cortex-A15\t 2.2\n\nC TODO\nC * Consider using special code for small nents, either swapping the inner and\nC outer loops, or providing a few completely unrolling the inner loops.\n\ndefine(`rp', `r0')\ndefine(`tp', `r1')\ndefine(`n', `r2')\ndefine(`nents', `r3')\nC which on stack\n\ndefine(`i', `r11')\ndefine(`j', `r12')\ndefine(`c', `r14')\ndefine(`mask', `r7')\n\nASM_START()\nPROLOGUE(mpn_sec_tabselect)\n\tpush\t{r4-r11, r14}\n\n\tsubs\tj, n, #3\n\tbmi\tL(outer_end)\nL(outer_top):\n\tldr\tc, [sp, #36]\n\tmov\ti, nents\n\tpush\t{tp}\n\n\tmov\tr8, #0\n\tmov\tr9, #0\n\tmov\tr10, #0\n\nL(top):\tsubs\tc, c, #1\n\tldm\ttp, {r4,r5,r6}\n\tsbc\tmask, mask, mask\n\tsubs\ti, i, #1\n\tadd\ttp, tp, n, lsl #2\n\tand\tr4, r4, mask\n\tand\tr5, r5, mask\n\tand\tr6, r6, mask\n\torr\tr8, r8, r4\n\torr\tr9, r9, r5\n\torr\tr10, r10, r6\n\tbge\tL(top)\n\n\tstmia\trp!, {r8,r9,r10}\n\tpop\t{tp}\n\tadd\ttp, tp, #12\n\tsubs\tj, j, #3\n\tbpl\tL(outer_top)\nL(outer_end):\n\n\tcmp\tj, #-1\n\tbne\tL(n2)\n\n\tldr\tc, [sp, #36]\n\tmov\ti, nents\n\tmov\tr8, #0\n\tmov\tr9, #0\nL(tp2):\tsubs\tc, c, #1\n\tsbc\tmask, mask, mask\n\tldm\ttp, {r4,r5}\n\tsubs\ti, i, #1\n\tadd\ttp, tp, n, lsl #2\n\tand\tr4, r4, mask\n\tand\tr5, r5, mask\n\torr\tr8, r8, r4\n\torr\tr9, r9, r5\n\tbge\tL(tp2)\n\tstmia\trp, {r8,r9}\n\tpop\t{r4-r11, r14}\n\treturn\tlr\n\nL(n2):\tcmp\tj, #-2\n\tbne\tL(n1)\n\n\tldr\tc, [sp, #36]\n\tmov\ti, nents\n\tmov\tr8, #0\nL(tp1):\tsubs\tc, c, #1\n\tsbc\tmask, mask, mask\n\tldr\tr4, [tp]\n\tsubs\ti, i, #1\n\tadd\ttp, tp, n, lsl #2\n\tand\tr4, r4, mask\n\torr\tr8, r8, r4\n\tbge\tL(tp1)\n\tstr\tr8, [rp]\nL(n1):\tpop\t{r4-r11, r14}\n\treturn\tlr\nEPILOGUE()\n"} +{"text": "Attr.IDBlacklistRegexp\r\nTYPE: string/null\r\nVERSION: 1.6.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\nPCRE regular expression to be matched against all IDs. If the expression is\r\nmatches, the ID is rejected. Use this with care: may cause significant\r\ndegradation. ID matching is done after all other validation.\r\n--# vim: et sw=4 sts=4\r\n"} +{"text": "\n\n 20-243\n Post-Arrest Process Clarification Amendment Act of 2014\n \n 2015-04-24\n \n D.C. Law 20-243\n 61 DCR 8320\n \n \n Law 20-243, the “Post-Arrest Process Clarification Amendment Act of 2014,” was introduced in Council and assigned Bill No. 20-323. The Bill was adopted. The Bill was adopted on first and second readings on June 24, 2014, and July 14, 2014, respectively. Signed by the Mayor on August 5, 2014, it was assigned Act No. 20-420 and transmitted to both Houses of Congress for its review on Sept. 8, 2014, and re-transmitted on Jan. 13, 2015. D.C. Law 20-243 became effective on April 24, 2015.\n \n \n\n"} +{"text": "{\n \"name\": \"ec_cart\",\n \"author\": \"fofa\",\n \"version\": \"0.1.0\",\n \"matches\": [\n {\n \"search\": \"headers\",\n \"text\": \"ec_cart_id\"\n }\n ]\n}"} +{"text": "/*\n * Copyright (c) 2010-2019 Evolveum and contributors\n *\n * This work is dual-licensed under the Apache License 2.0\n * and European Union Public License. See LICENSE file for details.\n */\npackage com.evolveum.midpoint.web.page.admin.objectCollection;\n\nimport com.evolveum.midpoint.security.api.AuthorizationConstants;\nimport com.evolveum.midpoint.web.application.AuthorizationAction;\nimport com.evolveum.midpoint.web.application.PageDescriptor;\nimport com.evolveum.midpoint.web.component.data.column.ColumnUtils;\nimport com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem;\nimport com.evolveum.midpoint.web.component.util.SelectableBean;\nimport com.evolveum.midpoint.web.page.admin.PageAdminObjectList;\nimport com.evolveum.midpoint.web.page.admin.configuration.PageAdminConfiguration;\nimport com.evolveum.midpoint.web.session.UserProfileStorage;\nimport com.evolveum.midpoint.web.util.OnePageParameterEncoder;\n\nimport com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectCollectionType;\n\nimport org.apache.wicket.ajax.AjaxRequestTarget;\nimport org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;\nimport org.apache.wicket.request.mapper.parameter.PageParameters;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * @author skublik\n */\n@PageDescriptor(\n url = \"/admin/objectCollections\", action = {\n @AuthorizationAction(actionUri = PageAdminConfiguration.AUTH_CONFIGURATION_ALL,\n label = PageAdminConfiguration.AUTH_CONFIGURATION_ALL_LABEL,\n description = PageAdminConfiguration.AUTH_CONFIGURATION_ALL_DESCRIPTION),\n @AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_OBJECT_COLLECTIONS_ALL_URL,\n label = \"PageObjectCollections.auth.objectCollectionAll.label\",\n description = \"PageObjectCollections.auth.objectCollectionAll.description\"),\n @AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_OBJECT_COLLECTIONS_URL,\n label = \"PageObjectCollections.auth.objectsCollection.label\",\n description = \"PageObjectCollections.auth.objectsCollection.description\")\n})\npublic class PageObjectCollections extends PageAdminObjectList {\n\n private static final long serialVersionUID = 1L;\n\n public PageObjectCollections() {\n super();\n }\n\n @Override\n protected void objectDetailsPerformed(AjaxRequestTarget target, ObjectCollectionType collection) {\n PageParameters pageParameters = new PageParameters();\n pageParameters.add(OnePageParameterEncoder.PARAMETER, collection.getOid());\n navigateToNext(PageObjectCollection.class, pageParameters);\n }\n\n @Override\n protected Class getType() {\n return ObjectCollectionType.class;\n }\n\n @Override\n protected List, String>> initColumns() {\n\n return ColumnUtils.getDefaultObjectColumns();\n }\n\n @Override\n protected List createRowActions() {\n List menu = new ArrayList<>();\n return menu;\n }\n\n @Override\n protected UserProfileStorage.TableId getTableId() {\n return UserProfileStorage.TableId.TABLE_OBJECTS_COLLECTION;\n }\n\n @Override\n protected boolean isCreateCheckColumnEnabled() {\n return false;\n }\n}\n"} +{"text": "/* $Id$ */\n\n/*\n * Copyright (c) 2001-2010 Aaron Turner \n * Copyright (c) 2013-2018 Fred Klassen - AppNeta\n *\n * The Tcpreplay Suite of tools is free software: you can redistribute it \n * and/or modify it under the terms of the GNU General Public License as \n * published by the Free Software Foundation, either version 3 of the \n * License, or with the authors permission any later version.\n *\n * The Tcpreplay Suite is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with the Tcpreplay Suite. If not, see .\n */\n\n#include \"config.h\"\n#include \"defines.h\"\n#include \"common.h\"\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \"tcpreplay_api.h\"\n#include \"send_packets.h\"\n#include \"replay.h\"\n\n#ifdef TCPREPLAY_EDIT\n#include \"tcpreplay_edit_opts.h\"\n#else\n#include \"tcpreplay_opts.h\"\n#endif\n\n\n\n/**\n * \\brief Returns a string describing the last error.\n *\n * Value when the last call does not result in an error is undefined \n * (may be NULL, may be garbage)\n */\nchar *\ntcpreplay_geterr(tcpreplay_t *ctx)\n{\n assert(ctx);\n return(ctx->errstr);\n}\n\n/**\n * \\brief Returns a string describing the last warning. \n *\n * Value when the last call does not result in an warning is undefined \n * (may be NULL, may be garbage)\n */\nchar *\ntcpreplay_getwarn(tcpreplay_t *ctx)\n{\n assert(ctx);\n return(ctx->warnstr);\n}\n\n/**\n * \\brief Initialize a new tcpreplay context\n *\n * Allocates memory and stuff like that. Always returns a buffer or completely\n * fails by calling exit() on malloc failure.\n */\ntcpreplay_t *\ntcpreplay_init()\n{\n tcpreplay_t *ctx;\n\n /* allocations will reset everything to zeros */\n ctx = safe_malloc(sizeof(tcpreplay_t));\n ctx->options = safe_malloc(sizeof(tcpreplay_opt_t));\n\n /* replay packets only once */\n ctx->options->loop = 1;\n\n /* Default mode is to replay pcap once in real-time */\n ctx->options->speed.mode = speed_multiplier;\n ctx->options->speed.multiplier = 1.0;\n\n /* Set the default timing method */\n ctx->options->accurate = accurate_gtod;\n\n /* set the default MTU size */\n ctx->options->mtu = DEFAULT_MTU;\n\n /* disable periodic statistics */\n ctx->options->stats = -1;\n\n /* disable limit send */\n ctx->options->limit_send = -1;\n\n /* default unique-loops */\n ctx->options->unique_loops = 1.0;\n\n#ifdef ENABLE_VERBOSE\n /* clear out tcpdump struct */\n ctx->options->tcpdump = (tcpdump_t *)safe_malloc(sizeof(tcpdump_t));\n#endif\n\n if (fcntl(STDERR_FILENO, F_SETFL, O_NONBLOCK) < 0)\n tcpreplay_setwarn(ctx, \"Unable to set STDERR to non-blocking: %s\", strerror(errno));\n\n#ifdef ENABLE_PCAP_FINDALLDEVS\n ctx->intlist = get_interface_list();\n#else\n ctx->intlist = NULL;\n#endif\n\n /* set up flows - on by default*/\n ctx->options->flow_stats = 1;\n ctx->flow_hash_table = flow_hash_table_init(DEFAULT_FLOW_HASH_BUCKET_SIZE);\n\n ctx->sp_type = SP_TYPE_NONE;\n ctx->intf1dlt = -1;\n ctx->intf2dlt = -1;\n ctx->abort = false;\n ctx->first_time = true;\n return ctx;\n}\n\n/**\n * \\brief Parses the GNU AutoOpts options for tcpreplay\n *\n * If you're using AutoOpts with tcpreplay_api, then just call this after\n * optionProcess() and it will parse all the options for you. As always,\n * returns 0 on success, and -1 on error & -2 on warning.\n */\nint\ntcpreplay_post_args(tcpreplay_t *ctx, int argc)\n{\n char *temp, *intname;\n char *ebuf;\n tcpreplay_opt_t *options;\n int warn = 0;\n float n;\n int ret = 0;\n\n options = ctx->options;\n\n dbg(2, \"tcpreplay_post_args: parsing command arguments\");\n ebuf = safe_malloc(SENDPACKET_ERRBUF_SIZE);\n#ifdef DEBUG\n if (HAVE_OPT(DBUG))\n debug = OPT_VALUE_DBUG;\n#else\n if (HAVE_OPT(DBUG)) {\n warn ++;\n tcpreplay_setwarn(ctx, \"%s\", \"not configured with --enable-debug. Debugging disabled.\");\n }\n#endif\n\n options->loop = OPT_VALUE_LOOP;\n options->loopdelay_ms = OPT_VALUE_LOOPDELAY_MS;\n\n if (HAVE_OPT(LIMIT))\n options->limit_send = OPT_VALUE_LIMIT;\n\n if (HAVE_OPT(DURATION))\n options->limit_time = OPT_VALUE_DURATION;\n\n if (HAVE_OPT(TOPSPEED)) {\n options->speed.mode = speed_topspeed;\n options->speed.speed = 0;\n } else if (HAVE_OPT(PPS)) {\n n = atof(OPT_ARG(PPS));\n options->speed.speed = (COUNTER)(n * 60.0 * 60.0); /* convert to packets per hour */\n options->speed.mode = speed_packetrate;\n options->speed.pps_multi = OPT_VALUE_PPS_MULTI;\n } else if (HAVE_OPT(ONEATATIME)) {\n options->speed.mode = speed_oneatatime;\n options->speed.speed = 0;\n } else if (HAVE_OPT(MBPS)) {\n n = atof(OPT_ARG(MBPS));\n if (n) {\n options->speed.mode = speed_mbpsrate;\n options->speed.speed = (COUNTER)(n * 1000000.0); /* convert to bps */\n } else {\n options->speed.mode = speed_topspeed;\n options->speed.speed = 0;\n }\n } else if (HAVE_OPT(MULTIPLIER)) {\n options->speed.mode = speed_multiplier;\n options->speed.multiplier = atof(OPT_ARG(MULTIPLIER));\n }\n\n if (HAVE_OPT(MAXSLEEP)) {\n options->maxsleep.tv_sec = OPT_VALUE_MAXSLEEP / 1000;\n options->maxsleep.tv_nsec = (OPT_VALUE_MAXSLEEP % 1000) * 1000 * 1000;\n }\n\n#ifdef ENABLE_VERBOSE\n if (HAVE_OPT(VERBOSE))\n options->verbose = 1;\n\n if (HAVE_OPT(DECODE))\n options->tcpdump->args = safe_strdup(OPT_ARG(DECODE));\n#endif\n\n if (HAVE_OPT(STATS))\n options->stats = OPT_VALUE_STATS;\n\n /*\n * preloading the pcap before the first run\n */\n\n if (HAVE_OPT(PRELOAD_PCAP)) {\n options->preload_pcap = true;\n }\n\n /* Dual file mode */\n if (HAVE_OPT(DUALFILE)) {\n options->dualfile = true;\n if (argc < 2) {\n tcpreplay_seterr(ctx, \"%s\", \"--dualfile mode requires at least two pcap files\");\n ret = -1;\n goto out;\n }\n if (argc % 2 != 0) {\n tcpreplay_seterr(ctx, \"%s\", \"--dualfile mode requires an even number of pcap files\");\n ret = -1;\n goto out;\n }\n }\n\n#ifdef HAVE_NETMAP\n options->netmap_delay = OPT_VALUE_NM_DELAY;\n#endif\n\n if (HAVE_OPT(NETMAP)) {\n#ifdef HAVE_NETMAP\n options->netmap = 1;\n ctx->sp_type = SP_TYPE_NETMAP;\n#else\n err(-1, \"--netmap feature was not compiled in. See INSTALL.\");\n#endif\n }\n\n if (HAVE_OPT(UNIQUE_IP))\n options->unique_ip = 1;\n\n if (HAVE_OPT(UNIQUE_IP_LOOPS)) {\n options->unique_loops = atof(OPT_ARG(UNIQUE_IP_LOOPS));\n if (options->unique_loops < 1.0) {\n tcpreplay_seterr(ctx, \"%s\", \"--unique-ip-loops requires loop count >= 1.0\");\n ret = -1;\n goto out;\n }\n }\n\n /* flow statistics */\n if (HAVE_OPT(NO_FLOW_STATS))\n options->flow_stats = 0;\n\n if (HAVE_OPT(FLOW_EXPIRY)) {\n options->flow_expiry = OPT_VALUE_FLOW_EXPIRY;\n }\n\n if (HAVE_OPT(TIMER)) {\n if (strcmp(OPT_ARG(TIMER), \"select\") == 0) {\n#ifdef HAVE_SELECT\n options->accurate = accurate_select;\n#else\n tcpreplay_seterr(ctx, \"%s\", \"tcpreplay_api not compiled with select support\");\n ret = -1;\n goto out;\n#endif\n } else if (strcmp(OPT_ARG(TIMER), \"ioport\") == 0) {\n#if defined HAVE_IOPORT_SLEEP__\n options.accurate = ACCURATE_IOPORT;\n ioport_sleep_init();\n#else\n err(-1, \"tcpreplay not compiled with IO Port 0x80 support\");\n#endif\n } else if (strcmp(OPT_ARG(TIMER), \"gtod\") == 0) {\n options->accurate = accurate_gtod;\n } else if (strcmp(OPT_ARG(TIMER), \"nano\") == 0) {\n options->accurate = accurate_nanosleep;\n } else if (strcmp(OPT_ARG(TIMER), \"abstime\") == 0) {\n tcpreplay_seterr(ctx, \"%s\", \"abstime is deprecated\");\n ret = -1;\n goto out;\n } else {\n tcpreplay_seterr(ctx, \"Unsupported timer mode: %s\", OPT_ARG(TIMER));\n ret = -1;\n goto out;\n }\n }\n\n#ifdef HAVE_RDTSC\n if (HAVE_OPT(RDTSC_CLICKS)) {\n rdtsc_calibrate(OPT_VALUE_RDTSC_CLICKS);\n }\n#endif\n\n if (HAVE_OPT(PKTLEN)) {\n options->use_pkthdr_len = true;\n warn ++;\n tcpreplay_setwarn(ctx, \"%s\", \"--pktlen may cause problems. Use with caution.\");\n }\n\n if ((intname = get_interface(ctx->intlist, OPT_ARG(INTF1))) == NULL) {\n if (!strncmp(OPT_ARG(INTF1), \"netmap:\", 7) || !strncmp(OPT_ARG(INTF1), \"vale\", 4))\n tcpreplay_seterr(ctx, \"Unable to connect to netmap interface %s. Ensure netmap module is installed (see INSTALL).\",\n OPT_ARG(INTF1));\n else\n tcpreplay_seterr(ctx, \"Invalid interface name/alias: %s\", OPT_ARG(INTF1));\n\n ret = -1;\n goto out;\n }\n\n if (!strncmp(intname, \"netmap:\", 7) || !strncmp(intname, \"vale:\", 5)) {\n#ifdef HAVE_NETMAP\n options->netmap = 1;\n ctx->sp_type = SP_TYPE_NETMAP;\n#else\n tcpreplay_seterr(ctx, \"%s\", \"tcpreplay_api not compiled with netmap support\");\n ret = -1;\n goto out;\n#endif\n }\n\n options->intf1_name = safe_strdup(intname);\n\n /* open interfaces for writing */\n if ((ctx->intf1 = sendpacket_open(options->intf1_name, ebuf, TCPR_DIR_C2S, ctx->sp_type, ctx)) == NULL) {\n tcpreplay_seterr(ctx, \"Can't open %s: %s\", options->intf1_name, ebuf);\n ret = -1;\n goto out;\n }\n\n#if defined HAVE_NETMAP\n ctx->intf1->netmap_delay = ctx->options->netmap_delay;\n#endif\n\n ctx->intf1dlt = sendpacket_get_dlt(ctx->intf1);\n\n if (HAVE_OPT(INTF2)) {\n if (!HAVE_OPT(CACHEFILE) && !HAVE_OPT(DUALFILE)) {\n tcpreplay_seterr(ctx, \"--intf2=%s requires either --cachefile or --dualfile\", OPT_ARG(INTF2));\n ret = -1;\n goto out;\n }\n if ((intname = get_interface(ctx->intlist, OPT_ARG(INTF2))) == NULL) {\n tcpreplay_seterr(ctx, \"Invalid interface name/alias: %s\", OPT_ARG(INTF2));\n ret = -1;\n goto out;\n }\n\n options->intf2_name = safe_strdup(intname);\n\n /* open interface for writing */\n if ((ctx->intf2 = sendpacket_open(options->intf2_name, ebuf, TCPR_DIR_S2C, ctx->sp_type, ctx)) == NULL) {\n tcpreplay_seterr(ctx, \"Can't open %s: %s\", options->intf2_name, ebuf);\n }\n\n#if defined HAVE_NETMAP\n ctx->intf2->netmap_delay = ctx->options->netmap_delay;\n#endif\n\n ctx->intf2dlt = sendpacket_get_dlt(ctx->intf2);\n if (ctx->intf2dlt != ctx->intf1dlt) {\n tcpreplay_seterr(ctx, \"DLT type mismatch for %s (%s) and %s (%s)\",\n options->intf1_name, pcap_datalink_val_to_name(ctx->intf1dlt),\n options->intf2_name, pcap_datalink_val_to_name(ctx->intf2dlt));\n ret = -1;\n goto out;\n }\n }\n\n if (HAVE_OPT(CACHEFILE)) {\n temp = safe_strdup(OPT_ARG(CACHEFILE));\n options->cache_packets = read_cache(&options->cachedata, temp,\n &options->comment);\n safe_free(temp);\n }\n\n /* return -2 on warnings */\n if (warn > 0)\n ret = -2;\n\nout:\n safe_free(ebuf);\n\n return ret;\n}\n\n/**\n * Closes & free's all memory related to a tcpreplay context\n */\nvoid\ntcpreplay_close(tcpreplay_t *ctx)\n{\n tcpreplay_opt_t *options;\n interface_list_t *intlist, *intlistnext;\n packet_cache_t *packet_cache, *next;\n\n assert(ctx);\n assert(ctx->options);\n options = ctx->options;\n\n safe_free(options->intf1_name);\n safe_free(options->intf2_name);\n sendpacket_close(ctx->intf1);\n if (ctx->intf2 != NULL)\n sendpacket_close(ctx->intf2);\n safe_free(options->cachedata);\n safe_free(options->comment);\n\n#ifdef ENABLE_VERBOSE\n safe_free(options->tcpdump_args);\n tcpdump_close(options->tcpdump);\n#endif\n\n /* free the flow hash table */\n flow_hash_table_release(ctx->flow_hash_table);\n\n /* free the file cache */\n packet_cache = options->file_cache->packet_cache;\n while (packet_cache != NULL) {\n next = packet_cache->next;\n safe_free(packet_cache->pktdata);\n safe_free(packet_cache);\n packet_cache = next;\n }\n\n /* free our interface list */\n if (ctx->intlist != NULL) {\n intlist = ctx->intlist;\n while (intlist != NULL) {\n intlistnext = intlist->next;\n safe_free(intlist);\n intlist = intlistnext;\n }\n }\n}\n\n/**\n * \\brief Specifies an interface to use for sending.\n *\n * You may call this up to two (2) times with different interfaces\n * when using a tcpprep cache file or dualfile mode. Note, both interfaces\n * must use the same DLT type\n */\nint\ntcpreplay_set_interface(tcpreplay_t *ctx, tcpreplay_intf intf, char *value)\n{\n static int int1dlt = -1, int2dlt = -1;\n char *intname;\n char *ebuf;\n int ret = 0;\n\n assert(ctx);\n assert(value);\n\n ebuf = safe_malloc(SENDPACKET_ERRBUF_SIZE);\n\n if (intf == intf1) {\n if ((intname = get_interface(ctx->intlist, value)) == NULL) {\n if (!strncmp(OPT_ARG(INTF1), \"netmap:\", 7) || !strncmp(OPT_ARG(INTF1), \"vale\", 4))\n tcpreplay_seterr(ctx, \"Unable to connect to netmap interface %s. Ensure netmap module is installed (see INSTALL).\",\n value);\n else\n tcpreplay_seterr(ctx, \"Invalid interface name/alias: %s\", value);\n ret = -1;\n goto out;\n }\n\n ctx->options->intf1_name = safe_strdup(intname);\n\n /* open interfaces for writing */\n if ((ctx->intf1 = sendpacket_open(ctx->options->intf1_name, ebuf, TCPR_DIR_C2S, ctx->sp_type, ctx)) == NULL) {\n tcpreplay_seterr(ctx, \"Can't open %s: %s\", ctx->options->intf1_name, ebuf);\n ret = -1;\n goto out;\n }\n\n int1dlt = sendpacket_get_dlt(ctx->intf1);\n } else if (intf == intf2) {\n if ((intname = get_interface(ctx->intlist, value)) == NULL) {\n tcpreplay_seterr(ctx, \"Invalid interface name/alias: %s\", ctx->options->intf2_name);\n ret = -1;\n goto out;\n }\n\n ctx->options->intf2_name = safe_strdup(intname);\n\n /* open interface for writing */\n if ((ctx->intf2 = sendpacket_open(ctx->options->intf2_name, ebuf, TCPR_DIR_S2C, ctx->sp_type, ctx)) == NULL) {\n tcpreplay_seterr(ctx, \"Can't open %s: %s\", ctx->options->intf2_name, ebuf);\n ret = -1;\n goto out;\n }\n int2dlt = sendpacket_get_dlt(ctx->intf2);\n }\n\n /*\n * If both interfaces are selected, then make sure both interfaces use\n * the same DLT type\n */\n if (int1dlt != -1 && int2dlt != -1) {\n if (int1dlt != int2dlt) {\n tcpreplay_seterr(ctx, \"DLT type mismatch for %s (%s) and %s (%s)\",\n ctx->options->intf1_name, pcap_datalink_val_to_name(int1dlt), \n ctx->options->intf2_name, pcap_datalink_val_to_name(int2dlt));\n ret = -1;\n goto out;\n }\n }\n\nout:\n safe_free(ebuf);\n return ret;\n}\n\n/**\n * Set the replay speed mode.\n */\nint\ntcpreplay_set_speed_mode(tcpreplay_t *ctx, tcpreplay_speed_mode value)\n{\n assert(ctx);\n\n ctx->options->speed.mode = value;\n return 0;\n}\n\n/**\n * Set the approprate speed value. Value is interpreted based on \n * how tcpreplay_set_speed_mode() value\n */\nint\ntcpreplay_set_speed_speed(tcpreplay_t *ctx, COUNTER value)\n{\n assert(ctx);\n ctx->options->speed.speed = value;\n return 0;\n}\n\n\n/**\n * Sending under packets/sec requires an integer value, not float.\n * you must first call tcpreplay_set_speed_mode(ctx, speed_packetrate)\n */\nint\ntcpreplay_set_speed_pps_multi(tcpreplay_t *ctx, int value)\n{\n assert(ctx);\n ctx->options->speed.pps_multi = value;\n return 0;\n}\n\n/**\n * How many times should we loop through all the pcap files?\n */\nint\ntcpreplay_set_loop(tcpreplay_t *ctx, u_int32_t value)\n{\n assert(ctx);\n ctx->options->loop = value;\n return 0;\n}\n\n/**\n * Set the unique IP address flag\n */\nint\ntcpreplay_set_unique_ip(tcpreplay_t *ctx, bool value)\n{\n assert(ctx);\n ctx->options->unique_ip = value;\n return 0;\n}\n\nint\ntcpreplay_set_unique_ip_loops(tcpreplay_t *ctx, int value)\n{\n assert(ctx);\n ctx->options->unique_loops = value;\n return 0;\n}\n\n/**\n * Set netmap mode\n */\nint\ntcpreplay_set_netmap(_U_ tcpreplay_t *ctx, _U_ bool value)\n{\n assert(ctx);\n#ifdef HAVE_NETMAP\n ctx->options->netmap = value;\n return 0;\n#else\n warn(\"netmap not compiled in\");\n return -1;\n#endif\n}\n\n/**\n * Tell tcpreplay to ignore the snaplen (default) and use the \"actual\"\n * packet len instead\n */\nint\ntcpreplay_set_use_pkthdr_len(tcpreplay_t *ctx, bool value)\n{\n assert(ctx);\n ctx->options->use_pkthdr_len = value;\n return 0;\n}\n\n/**\n * Override the outbound MTU\n */\nint\ntcpreplay_set_mtu(tcpreplay_t *ctx, int value)\n{\n assert(ctx);\n ctx->options->mtu = value;\n return 0;\n}\n\n/**\n * Sets the accurate timing mode\n */\nint\ntcpreplay_set_accurate(tcpreplay_t *ctx, tcpreplay_accurate value)\n{\n assert(ctx);\n ctx->options->accurate = value;\n return 0;\n}\n\n/**\n * Sets the number of seconds between printing stats\n */\nint\ntcpreplay_set_stats(tcpreplay_t *ctx, int value)\n{\n assert(ctx);\n ctx->options->stats = value;\n return 0;\n}\n\n/**\n * \\brief Enable or disable dual file mode\n *\n * In dual file mode, we read two files at the same time and use\n * one file for each interface.\n */\n\nint \ntcpreplay_set_dualfile(tcpreplay_t *ctx, bool value)\n{\n assert(ctx);\n ctx->options->dualfile = value;\n return 0;\n}\n\n/**\n * \\brief Enable or disable preloading the file cache \n *\n * Note: This is a global option and forces all pcaps\n * to be preloaded for this context. If you turn this\n * on, then it forces set_file_cache(true)\n */\nint\ntcpreplay_set_preload_pcap(tcpreplay_t *ctx, bool value)\n{\n assert(ctx);\n ctx->options->preload_pcap = value;\n return 0;\n}\n\n/**\n * \\brief Add a pcap file to be sent via tcpreplay\n *\n * One or more pcap files can be added. Each file will be replayed\n * in order\n */\nint\ntcpreplay_add_pcapfile(tcpreplay_t *ctx, char *pcap_file)\n{\n assert(ctx);\n assert(pcap_file);\n\n if (ctx->options->source_cnt < MAX_FILES) {\n ctx->options->sources[ctx->options->source_cnt].filename = safe_strdup(pcap_file);\n ctx->options->sources[ctx->options->source_cnt].type = source_filename;\n\n /*\n * prepare the cache info data struct. This doesn't actually enable\n * file caching for this pcap (that is controlled globally via\n * tcpreplay_set_file_cache())\n */\n ctx->options->file_cache[ctx->options->source_cnt].index = ctx->options->source_cnt;\n ctx->options->file_cache[ctx->options->source_cnt].cached = false;\n ctx->options->file_cache[ctx->options->source_cnt].packet_cache = NULL;\n\n ctx->options->source_cnt += 1;\n\n\n } else {\n tcpreplay_seterr(ctx, \"Unable to add more then %u files\", MAX_FILES);\n return -1;\n }\n return 0;\n}\n\n/**\n * Limit the total number of packets to send\n */\nint\ntcpreplay_set_limit_send(tcpreplay_t *ctx, COUNTER value)\n{\n assert(ctx);\n ctx->options->limit_send = value;\n return 0;\n}\n\n/**\n * \\brief Specify the tcpprep cache file to use for replaying with two NICs\n *\n * Note: this only works if you have a single pcap file\n * returns -1 on error\n */\nint\ntcpreplay_set_tcpprep_cache(tcpreplay_t *ctx, char *file)\n{\n assert(ctx);\n char *tcpprep_file;\n\n if (ctx->options->source_cnt > 1) {\n tcpreplay_seterr(ctx, \"%s\", \"Unable to use tcpprep cache file with a single pcap file\");\n return -1;\n }\n\n tcpprep_file = safe_strdup(file);\n ctx->options->cache_packets = read_cache(&ctx->options->cachedata, \n tcpprep_file, &ctx->options->comment);\n\n free(tcpprep_file);\n\n return 0;\n}\n\n\n\n/*\n * Verbose mode requires fork() and tcpdump binary, hence won't work\n * under Win32 without Cygwin\n */\n\n/**\n * Enable verbose mode\n */\nint\ntcpreplay_set_verbose(tcpreplay_t *ctx, bool value _U_)\n{\n assert(ctx);\n#ifdef ENABLE_VERBOSE\n ctx->options->verbose = value;\n return 0;\n#else\n tcpreplay_seterr(ctx, \"%s\", \"verbose mode not supported\");\n return -1;\n#endif\n}\n\n/**\n * \\brief Set the arguments to be passed to tcpdump\n *\n * Specify the additional argument to be passed to tcpdump when enabling\n * verbose mode. See TCPDUMP_ARGS in tcpdump.h for the default options\n */\nint\ntcpreplay_set_tcpdump_args(tcpreplay_t *ctx, char *value _U_)\n{\n assert(ctx);\n#ifdef ENABLE_VERBOSE\n assert(value);\n ctx->options->tcpdump_args = safe_strdup(value);\n return 0;\n#else\n tcpreplay_seterr(ctx, \"%s\", \"verbose mode not supported\");\n return -1;\n#endif\n}\n\n/**\n * \\brief Set the path to the tcpdump binary\n *\n * In order to support the verbose feature, tcpreplay needs to know where\n * tcpdump lives\n */\nint\ntcpreplay_set_tcpdump(tcpreplay_t *ctx, tcpdump_t *value _U_)\n{\n assert(ctx);\n#ifdef ENABLE_VERBOSE\n assert(value);\n ctx->options->verbose = true;\n ctx->options->tcpdump = value;\n return 0;\n#else\n tcpreplay_seterr(ctx, \"%s\", \"verbose mode not supported\");\n return -1;\n#endif\n}\n\n\n/**\n * \\brief Set the callback function for handing manual iteration\n *\n * Obviously for this to work, you need to first set speed_mode = speed_oneatatime\n * returns 0 on success, < 0 on error\n */\nint\ntcpreplay_set_manual_callback(tcpreplay_t *ctx, tcpreplay_manual_callback callback)\n{\n assert(ctx);\n assert(callback);\n\n if (ctx->options->speed.mode != speed_oneatatime) {\n tcpreplay_seterr(ctx, \"%s\", \n \"Unable to set manual callback because speed mode is not 'speed_oneatatime'\");\n return -1;\n }\n\n ctx->options->speed.manual_callback = callback;\n return 0;\n}\n\n/**\n * \\brief return the number of packets sent so far\n */\nCOUNTER\ntcpreplay_get_pkts_sent(tcpreplay_t *ctx)\n{\n assert(ctx);\n\n ctx->static_stats.pkts_sent = ctx->stats.pkts_sent;\n return ctx->static_stats.pkts_sent;\n}\n\n/**\n * \\brief return the number of bytes sent so far\n */\nCOUNTER\ntcpreplay_get_bytes_sent(tcpreplay_t *ctx)\n{\n assert(ctx);\n ctx->static_stats.bytes_sent = ctx->stats.bytes_sent;\n return ctx->static_stats.bytes_sent;\n}\n\n/**\n * \\brief return the number of failed attempts to send a packet\n */\nCOUNTER\ntcpreplay_get_failed(tcpreplay_t *ctx)\n{\n assert(ctx);\n ctx->static_stats.failed = ctx->stats.failed;\n return ctx->static_stats.failed;\n}\n\n/**\n * \\brief returns a pointer to the timeval structure of when replay first started\n */\nconst struct timeval *\ntcpreplay_get_start_time(tcpreplay_t *ctx)\n{\n assert(ctx);\n TIMEVAL_SET(&ctx->static_stats.start_time, &ctx->stats.start_time);\n return &ctx->static_stats.start_time;\n}\n\n/**\n * \\brief returns a pointer to the timeval structure of when replay finished\n */\nconst struct timeval *\ntcpreplay_get_end_time(tcpreplay_t *ctx)\n{\n assert(ctx);\n TIMEVAL_SET(&ctx->static_stats.end_time, &ctx->stats.end_time);\n return &ctx->static_stats.end_time;\n}\n\n\n/**\n * \\brief Internal function to set the tcpreplay error string\n *\n * Used to set the error string when there is an error, result is retrieved\n * using tcpedit_geterr(). You shouldn't ever actually call this, but use\n * tcpreplay_seterr() which is a macro wrapping this instead.\n */\nvoid\n__tcpreplay_seterr(tcpreplay_t *ctx, const char *func,\n const int line, const char *file, const char *fmt, ...)\n{\n va_list ap;\n char errormsg[TCPREPLAY_ERRSTR_LEN];\n\n assert(ctx);\n assert(file);\n assert(func);\n assert(line);\n\n va_start(ap, fmt);\n if (fmt != NULL) {\n (void)vsnprintf(errormsg,\n (TCPREPLAY_ERRSTR_LEN - 1), fmt, ap);\n }\n\n va_end(ap);\n\n#ifdef DEBUG\n snprintf(ctx->errstr, (TCPREPLAY_ERRSTR_LEN -1), \"From %s:%s() line %d:\\n%s\",\n file, func, line, errormsg);\n#else\n snprintf(ctx->errstr, (TCPREPLAY_ERRSTR_LEN -1), \"%s\", errormsg);\n#endif\n}\n\n/**\n * \\brief Internal function to set the tcpedit warning string\n *\n * Used to set the warning string when there is an non-fatal issue, result is retrieved\n * using tcpedit_getwarn().\n */\nvoid\ntcpreplay_setwarn(tcpreplay_t *ctx, const char *fmt, ...)\n{\n va_list ap;\n assert(ctx);\n\n va_start(ap, fmt);\n if (fmt != NULL)\n (void)vsnprintf(ctx->warnstr, (TCPREPLAY_ERRSTR_LEN - 1), fmt, ap);\n\n va_end(ap);\n}\n\n\n/**\n * \\brief Does all the prep work before calling tcpreplay_replay()\n *\n * Technically this validates our config options, preloads the tcpprep\n * cache file, loads the packet cache and anything else which might\n * cause a delay for starting to send packets with tcpreplay_replay()\n */\nint \ntcpreplay_prepare(tcpreplay_t *ctx)\n{\n char *intname, *ebuf;\n int int1dlt, int2dlt, i;\n int ret = 0;\n\n assert(ctx);\n\n ebuf = safe_malloc(SENDPACKET_ERRBUF_SIZE);\n\n /*\n * First, process the validations, basically the same we do in \n * tcpreplay_post_args() and AutoOpts\n */\n if (ctx->options->intf1_name == NULL) {\n tcpreplay_seterr(ctx, \"%s\", \"You must specify at least one network interface\");\n ret = -1;\n goto out;\n }\n\n if (ctx->options->source_cnt == 0) {\n tcpreplay_seterr(ctx, \"%s\", \"You must specify at least one source pcap\");\n ret = -1;\n goto out;\n }\n\n if (ctx->options->dualfile) {\n if (!(ctx->options->source_cnt >= 2)) {\n tcpreplay_seterr(ctx, \"%s\", \"Dual file mode requires 2 or more pcap files\");\n ret = -1;\n goto out;\n }\n\n if (ctx->options->source_cnt % 2 != 0) {\n tcpreplay_seterr(ctx, \"%s\", \"Dual file mode requires an even number of pcap files\");\n ret = -1;\n goto out;\n }\n }\n\n if (ctx->options->dualfile && ctx->options->cachedata != NULL) {\n tcpreplay_seterr(ctx, \"%s\", \"Can't use dual file mode and tcpprep cache file together\");\n ret = -1;\n goto out;\n }\n\n if ((ctx->options->dualfile || ctx->options->cachedata != NULL) && \n ctx->options->intf2_name == NULL) {\n tcpreplay_seterr(ctx, \"%s\", \"dual file mode and tcpprep cache files require two interfaces\");\n }\n\n\n#ifndef HAVE_SELECT\n if (ctx->options->accurate == accurate_select) {\n tcpreplay_seterr(ctx, \"%s\", \"tcpreplay_api not compiled with select support\");\n ret = -1;\n goto out;\n }\n#endif\n\n if ((intname = get_interface(ctx->intlist, ctx->options->intf1_name)) == NULL) {\n if (!strncmp(OPT_ARG(INTF1), \"netmap:\", 7) || !strncmp(OPT_ARG(INTF1), \"vale\", 4))\n tcpreplay_seterr(ctx, \"Unable to connect to netmap interface %s. Ensure netmap module is installed (see INSTALL).\",\n OPT_ARG(INTF1));\n else\n tcpreplay_seterr(ctx, \"Invalid interface name/alias: %s\", OPT_ARG(INTF1));\n\n ret = -1;\n goto out;\n }\n\n /* open interfaces for writing */\n if ((ctx->intf1 = sendpacket_open(ctx->options->intf1_name, ebuf, TCPR_DIR_C2S, ctx->sp_type, ctx)) == NULL) {\n tcpreplay_seterr(ctx, \"Can't open %s: %s\", ctx->options->intf1_name, ebuf);\n ret = -1;\n goto out;\n }\n\n int1dlt = sendpacket_get_dlt(ctx->intf1);\n\n if (ctx->options->intf2_name != NULL) {\n if ((intname = get_interface(ctx->intlist, ctx->options->intf2_name)) == NULL) {\n tcpreplay_seterr(ctx, \"Invalid interface name/alias: %s\", OPT_ARG(INTF2));\n ret = -1;\n goto out;\n }\n\n /* open interfaces for writing */\n if ((ctx->intf2 = sendpacket_open(ctx->options->intf2_name, ebuf, TCPR_DIR_C2S, ctx->sp_type, ctx)) == NULL) {\n tcpreplay_seterr(ctx, \"Can't open %s: %s\", ctx->options->intf2_name, ebuf);\n ret = -1;\n goto out;\n }\n\n int2dlt = sendpacket_get_dlt(ctx->intf2);\n if (int2dlt != int1dlt) {\n tcpreplay_seterr(ctx, \"DLT type mismatch for %s (%s) and %s (%s)\",\n ctx->options->intf1_name, pcap_datalink_val_to_name(int1dlt), \n ctx->options->intf2_name, pcap_datalink_val_to_name(int2dlt));\n ret = -1;\n goto out;\n }\n }\n\n /*\n * Setup up the file cache, if required\n */\n if (ctx->options->preload_pcap) {\n /* Initialise each of the file cache structures */\n for (i = 0; i < ctx->options->source_cnt; i++) {\n ctx->options->file_cache[i].index = i;\n ctx->options->file_cache[i].cached = FALSE;\n ctx->options->file_cache[i].packet_cache = NULL;\n }\n }\n\nout:\n safe_free(ebuf);\n return ret;\n}\n\n/**\n * \\brief sends the traffic out the interfaces\n *\n * Designed to be called in a separate thread if you need to. Blocks until\n * the replay is complete or you call tcpreplay_abort() in another thread.\n */\nint\ntcpreplay_replay(tcpreplay_t *ctx)\n{\n int rcode;\n COUNTER loop, total_loops;\n\n assert(ctx);\n\n if (!ctx->options->source_cnt) {\n tcpreplay_seterr(ctx, \"invalid source count: %d\", ctx->options->source_cnt);\n return -1;\n }\n\n if (ctx->options->dualfile && ctx->options->source_cnt < 2) {\n tcpreplay_seterr(ctx, \"invalid dualfile source count: %d\", ctx->options->source_cnt);\n return -1;\n }\n\n init_timestamp(&ctx->stats.start_time);\n init_timestamp(&ctx->stats.time_delta);\n init_timestamp(&ctx->stats.end_time);\n init_timestamp(&ctx->stats.pkt_ts_delta);\n init_timestamp(&ctx->stats.last_print);\n\n ctx->running = true;\n total_loops = ctx->options->loop;\n loop = 0;\n\n /* main loop, when not looping forever (or until abort) */\n if (ctx->options->loop > 0) {\n while (ctx->options->loop-- && !ctx->abort) { /* limited loop */\n ++loop;\n if (ctx->options->stats == 0) {\n if (!ctx->unique_iteration || loop == ctx->unique_iteration)\n printf(\"Loop \" COUNTER_SPEC \" of \" COUNTER_SPEC \"...\\n\",\n loop, total_loops);\n else\n printf(\"Loop \" COUNTER_SPEC \" of \" COUNTER_SPEC \" (\" COUNTER_SPEC \" unique)...\\n\",\n loop, total_loops,\n ctx->unique_iteration);\n }\n if ((rcode = tcpr_replay_index(ctx)) < 0)\n return rcode;\n if (ctx->options->loop > 0) {\n if (!ctx->abort && ctx->options->loopdelay_ms > 0) {\n usleep(ctx->options->loopdelay_ms * 1000);\n gettimeofday(&ctx->stats.end_time, NULL);\n }\n\n if (ctx->options->stats == 0)\n packet_stats(&ctx->stats);\n }\n }\n } else {\n while (!ctx->abort) { /* loop forever unless user aborts */\n ++loop;\n if (ctx->options->stats == 0) {\n if (!ctx->unique_iteration || loop == ctx->unique_iteration)\n printf(\"Loop \" COUNTER_SPEC \"...\\n\", loop);\n else\n printf(\"Loop \" COUNTER_SPEC \" (\" COUNTER_SPEC \" unique)...\\n\", loop,\n ctx->unique_iteration);\n }\n if ((rcode = tcpr_replay_index(ctx)) < 0)\n return rcode;\n\n if (!ctx->abort && ctx->options->loopdelay_ms > 0) {\n usleep(ctx->options->loopdelay_ms * 1000);\n gettimeofday(&ctx->stats.end_time, NULL);\n }\n\n if (ctx->options->stats == 0 && !ctx->abort)\n packet_stats(&ctx->stats);\n }\n }\n\n ctx->running = false;\n\n if (ctx->options->stats >= 0) {\n char buf[64];\n\n if (format_date_time(&ctx->stats.end_time, buf, sizeof(buf)) > 0)\n printf(\"Test complete: %s\\n\", buf);\n }\n\n return 0;\n}\n\n/**\n * \\brief Abort the tcpreplay_replay execution.\n *\n * This might take a little while since tcpreplay_replay() only checks this\n * once per packet (sleeping between packets can cause delays), however, \n * this function returns once the signal has been sent and does not block\n */\nint\ntcpreplay_abort(tcpreplay_t *ctx)\n{\n assert(ctx);\n ctx->abort = true;\n\n printf(\"sendpacket_abort\\n\");\n\n if (ctx->intf1 != NULL)\n sendpacket_abort(ctx->intf1);\n\n if (ctx->intf2 != NULL)\n sendpacket_abort(ctx->intf2);\n\n return 0;\n}\n\n/**\n * \\brief Temporarily suspend tcpreplay_replay()\n *\n * This might take a little while since tcpreplay_replay() only checks this\n * once per packet (sleeping between packets can cause delays), however, \n * this function returns once the signal has been sent and does not block \n *\n * Note that suspending a running context can create odd timing \n */\nint\ntcpreplay_suspend(tcpreplay_t *ctx)\n{\n assert(ctx);\n ctx->suspend = true;\n return 0;\n}\n\n/**\n * \\brief Restart tcpreplay_replay() after suspend\n *\n * Causes the worker thread to restart sending packets\n */\nint\ntcpreplay_restart(tcpreplay_t *ctx)\n{\n assert(ctx);\n ctx->suspend = false;\n return 0;\n}\n\n/**\n * \\brief Tells you if the given tcpreplay context is currently suspended\n *\n * Suspended == running, but not sending packets\n */\nbool\ntcpreplay_is_suspended(tcpreplay_t *ctx)\n{\n assert(ctx);\n return ctx->suspend;\n}\n\n/**\n * \\brief Tells you if the tcpreplay context is running (not yet finished)\n *\n * Returns true even if it is suspended\n */\nbool \ntcpreplay_is_running(tcpreplay_t *ctx)\n{\n assert(ctx);\n return ctx->running;\n}\n\n/**\n * \\brief returns the current statistics during or after a replay\n *\n * For performance reasons, I don't bother to put a mutex around this and you\n * don't need to either. Just realize that your values may be off by one until\n * tcreplay_replay() returns.\n */\nconst tcpreplay_stats_t *\ntcpreplay_get_stats(tcpreplay_t *ctx)\n{\n const tcpreplay_stats_t *ptr;\n\n assert(ctx);\n\n /* copy stats over so they don't change while caller is using the buffer */\n memcpy(&ctx->static_stats, &ctx->stats, sizeof(tcpreplay_stats_t));\n ptr = &ctx->static_stats;\n return ptr;\n}\n\n\n/**\n * \\brief returns the current number of sources/files to be sent\n */\nint\ntcpreplay_get_source_count(tcpreplay_t *ctx)\n{\n assert(ctx);\n return ctx->options->source_cnt;\n}\n\n/**\n * \\brief Returns the current source id being replayed\n */\nint\ntcpreplay_get_current_source(tcpreplay_t *ctx)\n{\n assert(ctx);\n return ctx->current_source;\n}\n\n/* vim: set tabstop=8 expandtab shiftwidth=4 softtabstop=4: */\n\n\n/**\n * \\brief Sets printing of flow statistics\n */\nint tcpreplay_set_flow_stats(tcpreplay_t *ctx, bool value)\n{\n assert(ctx);\n\n ctx->options->flow_stats = value;\n return 0;\n}\n\n/**\n * \\brief Sets the flow expiry in seconds\n */\nint tcpreplay_set_flow_expiry(tcpreplay_t *ctx, int value)\n{\n assert(ctx);\n\n ctx->options->flow_expiry = value;\n return 0;\n}\n\n/**\n * \\brief Get whether to printof flow statistics\n */\nbool tcpreplay_get_flow_stats(tcpreplay_t *ctx)\n{\n assert(ctx);\n\n return ctx->options->flow_stats;\n}\n\n/**\n * \\brief Gets the flow expiry in seconds\n */\nint tcpreplay_get_flow_expiry(tcpreplay_t *ctx)\n{\n assert(ctx);\n\n return ctx->options->flow_expiry;\n}\n"} +{"text": "\n\n \n \n Debug (static runtime)\n Win32\n \n \n Debug (static runtime)\n x64\n \n \n Debug\n Win32\n \n \n Debug\n x64\n \n \n Release (static runtime)\n Win32\n \n \n Release (static runtime)\n x64\n \n \n Release\n Win32\n \n \n Release\n x64\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n OREAnalyticsTestSuite\n {87DD6B48-D3E0-4C2D-A984-0E41259A9D3C}\n OREAnalyticsTestSuite\n $(VCTargetsPath11)\n \n \n \n \n Application\n false\n MultiByte\n \n \n Application\n false\n MultiByte\n \n \n Application\n false\n MultiByte\n \n \n Application\n false\n MultiByte\n \n \n Application\n false\n MultiByte\n \n \n Application\n false\n MultiByte\n \n \n Application\n false\n MultiByte\n \n \n Application\n false\n MultiByte\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n <_ProjectFileVersion>10.0.30319.1\n bin\\\n bin\\\n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n true\n true\n true\n true\n false\n false\n false\n false\n bin\\\n bin\\\n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n false\n false\n true\n true\n false\n false\n false\n false\n bin\\\n bin\\\n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n true\n true\n true\n true\n false\n false\n false\n false\n bin\\\n bin\\\n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n false\n false\n true\n true\n false\n false\n false\n false\n OREAnalytics-test-suite-mt\n OREAnalytics-test-suite-x64-mt\n OREAnalytics-test-suite-mt-s\n OREAnalytics-test-suite-x64-mt-s\n OREAnalytics-test-suite-mt-gd\n OREAnalytics-test-suite-x64-mt-gd\n OREAnalytics-test-suite-mt-sgd\n OREAnalytics-test-suite-x64-mt-sgd\n \n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.tlb\n \n \n \n \n Disabled\n false\n ..;..\\..\\ORETest;..\\..\\OREData;..\\..\\QuantExt;..\\..\\QuantLib;%(AdditionalIncludeDirectories)\n _DEBUG;WIN32;_CONSOLE;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)\n EnableFastChecks\n MultiThreadedDebug\n false\n true\n true\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.pch\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n Level3\n true\n EditAndContinue\n Default\n true\n $(additionalWarning) %(AdditionalOptions)\n \n \n _DEBUG;%(PreprocessorDefinitions)\n 0x0409\n \n \n $(OutDir)$(TargetName)$(TargetExt)\n true\n ..\\lib;..\\..\\OREData\\lib;..\\..\\QuantExt\\lib;..\\..\\QuantLib\\lib;%(AdditionalLibraryDirectories)\n true\n \n \n $(OutDir)$(TargetName).pdb\n Console\n false\n \n \n MachineX86\n false\n \n \n false\n \n \n Auto run test\n \"$(TargetDir)$(TargetName).exe\" --log_level=message --build_info=yes --result_code=no --report_level=short\n \n \n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.tlb\n \n \n \n \n Disabled\n false\n ..;..\\..\\ORETest;..\\..\\OREData;..\\..\\QuantExt;..\\..\\QuantLib;%(AdditionalIncludeDirectories)\n _DEBUG;WIN32;_CONSOLE;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)\n EnableFastChecks\n MultiThreadedDebug\n false\n true\n true\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.pch\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n Level3\n true\n ProgramDatabase\n Default\n true\n $(additionalWarning) %(AdditionalOptions)\n \n \n _DEBUG;%(PreprocessorDefinitions)\n 0x0409\n \n \n $(OutDir)$(TargetName)$(TargetExt)\n true\n ..\\lib;..\\..\\OREData\\lib;..\\..\\QuantExt\\lib;..\\..\\QuantLib\\lib;%(AdditionalLibraryDirectories)\n true\n \n \n $(OutDir)$(TargetName).pdb\n Console\n false\n \n \n \n \n false\n \n \n Auto run test\n \"$(TargetDir)$(TargetName).exe\" --log_level=message --build_info=yes --result_code=no --report_level=short\n \n \n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.tlb\n \n \n \n \n MaxSpeed\n AnySuitable\n false\n Speed\n ..;..\\..\\ORETest;..\\..\\OREData;..\\..\\QuantExt;..\\..\\QuantLib;%(AdditionalIncludeDirectories)\n NDEBUG;WIN32;_CONSOLE;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)\n true\n MultiThreaded\n true\n false\n true\n true\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.pch\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n Level3\n true\n Default\n ProgramDatabase\n true\n $(additionalWarning) %(AdditionalOptions)\n \n \n NDEBUG;%(PreprocessorDefinitions)\n 0x0409\n \n \n $(OutDir)$(TargetName)$(TargetExt)\n true\n ..\\lib;..\\..\\OREData\\lib;..\\..\\QuantExt\\lib;..\\..\\QuantLib\\lib;%(AdditionalLibraryDirectories)\n $(OutDir)$(TargetName).pdb\n Console\n false\n \n \n MachineX86\n true\n true\n \n \n false\n \n \n Auto run test\n \"$(TargetDir)$(TargetName).exe\" --log_level=message --build_info=yes --result_code=no --report_level=short\n \n \n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.tlb\n \n \n \n \n MaxSpeed\n AnySuitable\n false\n Speed\n ..;..\\..\\ORETest;..\\..\\OREData;..\\..\\QuantExt;..\\..\\QuantLib;%(AdditionalIncludeDirectories)\n NDEBUG;WIN32;_CONSOLE;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)\n true\n MultiThreaded\n true\n false\n true\n true\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.pch\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n Level3\n true\n Default\n ProgramDatabase\n true\n $(additionalWarning) %(AdditionalOptions)\n \n \n NDEBUG;%(PreprocessorDefinitions)\n 0x0409\n \n \n $(OutDir)$(TargetName)$(TargetExt)\n true\n ..\\lib;..\\..\\OREData\\lib;..\\..\\QuantExt\\lib;..\\..\\QuantLib\\lib;%(AdditionalLibraryDirectories)\n $(OutDir)$(TargetName).pdb\n Console\n false\n \n \n true\n true\n \n \n false\n \n \n Auto run test\n \"$(TargetDir)$(TargetName).exe\" --log_level=message --build_info=yes --result_code=no --report_level=short\n \n \n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.tlb\n \n \n \n \n Disabled\n false\n ..;..\\..\\ORETest;..\\..\\OREData;..\\..\\QuantExt;..\\..\\QuantLib;%(AdditionalIncludeDirectories)\n _DEBUG;WIN32;_CONSOLE;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)\n EnableFastChecks\n MultiThreadedDebugDLL\n false\n true\n true\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.pch\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n Level3\n true\n EditAndContinue\n Default\n true\n $(additionalWarning) %(AdditionalOptions)\n \n \n _DEBUG;%(PreprocessorDefinitions)\n 0x0409\n \n \n $(OutDir)$(TargetName)$(TargetExt)\n true\n ..\\lib;..\\..\\OREData\\lib;..\\..\\QuantExt\\lib;..\\..\\QuantLib\\lib;%(AdditionalLibraryDirectories)\n true\n $(OutDir)$(TargetName).pdb\n Console\n false\n \n \n MachineX86\n false\n \n \n false\n \n \n Auto run test\n \"$(TargetDir)$(TargetName).exe\" --log_level=message --build_info=yes --result_code=no --report_level=short\n \n \n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.tlb\n \n \n \n \n Disabled\n false\n ..;..\\..\\ORETest;..\\..\\OREData;..\\..\\QuantExt;..\\..\\QuantLib;%(AdditionalIncludeDirectories)\n _DEBUG;WIN32;_CONSOLE;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)\n EnableFastChecks\n MultiThreadedDebugDLL\n false\n true\n true\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.pch\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n Level3\n true\n ProgramDatabase\n Default\n true\n $(additionalWarning) %(AdditionalOptions)\n \n \n _DEBUG;%(PreprocessorDefinitions)\n 0x0409\n \n \n $(OutDir)$(TargetName)$(TargetExt)\n true\n ..\\lib;..\\..\\OREData\\lib;..\\..\\QuantExt\\lib;..\\..\\QuantLib\\lib;%(AdditionalLibraryDirectories)\n true\n $(OutDir)$(TargetName).pdb\n Console\n false\n \n \n \n \n false\n \n \n Auto run test\n \"$(TargetDir)$(TargetName).exe\" --log_level=message --build_info=yes --result_code=no --report_level=short\n \n \n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.tlb\n \n \n \n \n MaxSpeed\n AnySuitable\n false\n Speed\n ..;..\\..\\ORETest;..\\..\\OREData;..\\..\\QuantExt;..\\..\\QuantLib;%(AdditionalIncludeDirectories)\n NDEBUG;WIN32;_CONSOLE;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)\n true\n MultiThreadedDLL\n true\n false\n true\n true\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.pch\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n Level3\n true\n Default\n ProgramDatabase\n true\n $(additionalWarning) %(AdditionalOptions)\n \n \n NDEBUG;%(PreprocessorDefinitions)\n 0x0409\n \n \n $(OutDir)$(TargetName)$(TargetExt)\n true\n ..\\lib;..\\..\\OREData\\lib;..\\..\\QuantExt\\lib;..\\..\\QuantLib\\lib;%(AdditionalLibraryDirectories)\n true\n $(OutDir)$(TargetName).pdb\n Console\n false\n \n \n MachineX86\n true\n \n \n false\n \n \n Auto run test\n \"$(TargetDir)$(TargetName).exe\" --log_level=message --build_info=yes --result_code=no --report_level=short\n \n \n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.tlb\n \n \n \n \n MaxSpeed\n AnySuitable\n false\n Speed\n ..;..\\..\\ORETest;..\\..\\OREData;..\\..\\QuantExt;..\\..\\QuantLib;%(AdditionalIncludeDirectories)\n NDEBUG;WIN32;_CONSOLE;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)\n true\n MultiThreadedDLL\n true\n false\n true\n true\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\testsuite.pch\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n $(IntDir)\\%(RelativeDir)\n \n \n .\\build\\$(PlatformToolset)\\$(Platform)\\$(Configuration)\\\n Level3\n true\n Default\n ProgramDatabase\n true\n $(additionalWarning) %(AdditionalOptions)\n \n \n NDEBUG;%(PreprocessorDefinitions)\n 0x0409\n \n \n $(OutDir)$(TargetName)$(TargetExt)\n true\n ..\\lib;..\\..\\OREData\\lib;..\\..\\QuantExt\\lib;..\\..\\QuantLib\\lib;%(AdditionalLibraryDirectories)\n true\n $(OutDir)$(TargetName).pdb\n Console\n false\n \n \n true\n \n \n false\n \n \n Auto run test\n \"$(TargetDir)$(TargetName).exe\" --log_level=message --build_info=yes --result_code=no --report_level=short\n \n \n \n \n \n\n"} +{"text": "/* -*- Mode:C++; c-file-style:\"gnu\"; indent-tabs-mode:nil; -*- */\n/*\n * Copyright (c) 2011 CTTC\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-1307 USA\n *\n * Author: Nicola Baldo \n */\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace ns3;\n\nclass IsotropicAntennaModelTestCase : public TestCase\n{\npublic:\n static std::string BuildNameString (Angles a);\n IsotropicAntennaModelTestCase (Angles a, double expectedGainDb);\n\n\nprivate:\n virtual void DoRun (void);\n\n Angles m_a;\n double m_expectedGain;\n};\n\nstd::string IsotropicAntennaModelTestCase::BuildNameString (Angles a)\n{\n std::ostringstream oss;\n oss << \"theta=\" << a.theta << \" , phi=\" << a.phi;\n return oss.str ();\n}\n\n\nIsotropicAntennaModelTestCase::IsotropicAntennaModelTestCase (Angles a, double expectedGainDb)\n : TestCase (BuildNameString (a)),\n m_a (a),\n m_expectedGain (expectedGainDb)\n{\n}\n\nvoid\nIsotropicAntennaModelTestCase::DoRun ()\n{\n Ptr a = CreateObject ();\n double actualGain = a->GetGainDb (m_a);\n NS_TEST_EXPECT_MSG_EQ_TOL (actualGain, m_expectedGain, 0.01, \"wrong value of the radiation pattern\");\n}\n\n\n\n\nclass IsotropicAntennaModelTestSuite : public TestSuite\n{\npublic:\n IsotropicAntennaModelTestSuite ();\n};\n\nIsotropicAntennaModelTestSuite::IsotropicAntennaModelTestSuite ()\n : TestSuite (\"isotropic-antenna-model\", UNIT)\n{\n AddTestCase (new IsotropicAntennaModelTestCase (Angles (0, 0), 0.0), TestCase::QUICK);\n AddTestCase (new IsotropicAntennaModelTestCase (Angles (0, M_PI), 0.0), TestCase::QUICK);\n AddTestCase (new IsotropicAntennaModelTestCase (Angles (0, M_PI_2), 0.0), TestCase::QUICK);\n AddTestCase (new IsotropicAntennaModelTestCase (Angles (M_PI, 0), 0.0), TestCase::QUICK);\n AddTestCase (new IsotropicAntennaModelTestCase (Angles (M_PI, M_PI), 0.0), TestCase::QUICK);\n AddTestCase (new IsotropicAntennaModelTestCase (Angles (M_PI, M_PI_2), 0.0), TestCase::QUICK);\n AddTestCase (new IsotropicAntennaModelTestCase (Angles (M_PI_2, 0), 0.0), TestCase::QUICK);\n AddTestCase (new IsotropicAntennaModelTestCase (Angles (M_PI_2, M_PI), 0.0), TestCase::QUICK);\n AddTestCase (new IsotropicAntennaModelTestCase (Angles (M_PI_2, M_PI_2), 0.0), TestCase::QUICK);\n\n};\n\nstatic IsotropicAntennaModelTestSuite staticIsotropicAntennaModelTestSuiteInstance;\n"} +{"text": "#\n# Automated Dynamic Application Penetration Testing (ADAPT)\n#\n# Copyright (C) 2018 Applied Visions - http://securedecisions.com\n#\n# Written by Siege Technologies - http://www.siegetechnologies.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# The general configuration file for ADAPT. \n# If there is a vlue you don't know if should filled or filled with, put none. \n\n[GENERAL_OPTIONS]\n\ntarget = http://localhost:8080\ncontext = http://localhost:8080\n\n# limits returned results by matching confidence level and higher \n# (low, medium, high, paranoid) paranoid -> all information regardless of confidence\nconfidence = paranoid\n\n# limits returned results by matching risk level and higher \n# (low, medium, high, paranoid) paranoid -> all information regardless of risk \nrisk = paranoid\n\n# changes the level of detail within the results \n# low -> pass/fail results \n# medium -> more specific errors reported \n# high -> More collected information is reported\n# full -> All collected data is reported \ndetail = full\n\n# Specify a specific port for the nmap scan script \n# 'none' specifies all ports \n# multiple port numbers should be space separated \nnmap_script_ports = 80\n\n[OUTPUT_OPTIONS]\n# if a specific filename is given, ADAPT will attempt to save the results to that file. \n# if specific_filename is 'none' then ADAPT will resort to saving the results as \n# a timestamped file of whatever filetype is specified for 'filetype'\n# available output options: [json, xml]\nfiletype = json\nspecific_filename = none\n# if append is on then it will append all new data to the file\n# if the file doesn't exist it will be created \nappend = on\n\n[SSH_OPTIONS]\n# specify '//stdin' to enter username/password via stdin\nssh_get_logs = off\nhostname = localhost\nusername = //stdin\npassword = //stdin\nport = 22\n# This specifies space separated key words to look for when looking through lof files\n# This is case sensitive \n# if set to none, defaults to: [ERROR, error, WARNING, warning]\nkeywords = none\n# Multiple locations can be specified, each must be whitespace separated. \n# NOTE: They must be full paths\nlog_paths = ./Desktop/Test.log\n#/var/log/http-error.log\n\n# Can choose 'full', 'bottom' or 'top'\n# Full : scans the full file (ignores read amount)\n# Bottom : reads from the bottom of the file \n# Top : reads from the top of the file\nread_direction = full\n# How many lines to read from a give direction \n# If direction set to 'full', this will be ignored.\nread_amount = 1000\n\n[OWASP_ZAP_OPTIONS]\n\n# passive scanning by zap (on/off)\npassive_scan = on\n\n# spider scanning by zap (on/off)\nspider_scan = on\n\n# Active path scanning by zap (on/off) \nactive_scan = on\n\n#Note that if testing against localhost on same post, this one must be changed. \nzap_port = 8080\n\n# api key for zap. Not necessary to set, can remain as default. \napi_key = none\n\n# These are paths will not be traveresed during testing \nexclude = /logout.php /logout \n\n[AUTH_OPTIONS]\n# Specifies how application authentication will be handled. \n# There are two methods of handling application authentication. \n# 1. none : this bascially skips over authentication and automatically turns off tests\n# 2. .py : Give a python file, and the script will call a function called 'service_auth' and it lets the user handle login. Please see 'login_format.py' for details regarding expected parameters and return values. \n# if either provided method fails, it will turn off authentication\n# you may also put relative paths for the data or script\nauth_module = login_format.py\n\n# These are an example login username and password \n# Put '//stdin' to enter the username/password via stdin\nvalid_username = //stdin\nvalid_password = //stdin\n\n[OWASP_OPTIONS]\nident_004 = on\nauthn_001 = on\nauthn_002 = on\nauthn_003 = on\nauthz_001 = on\nconfig_002 = on\nconfig_006 = on\ncrypst_001 = on\ncrypst_002 = on\nerr_001 = on\nerr_002 = on\ninfo_002 = on\ninpval_001 = on\ninpval_002 = on\ninpval_003 = on\nsess_001 = on\nsess_002 = on\n\n[DEBUG_OPTIONS]\n# Note that while these values can be changed, it is recommended to leave them as default. \n\n# If on, dumps script progess into stdout. \nadapt_verbose = on\n\n# If on, zap will close upon script completion. \nzap_close = on\n\n# If on, zap will be run as a daemon process. \nzap_hidden = on\n"} +{"text": "//\n// iTermStatusBarComponentKnob.m\n// iTerm2SharedARC\n//\n// Created by George Nachman on 6/29/18.\n//\n\n#import \"iTermStatusBarComponentKnob.h\"\n\n#import \"iTermDragHandleView.h\"\n#import \"NSObject+iTerm.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\nNSString *const iTermStatusBarComponentKnobMinimumWidthKey = @\"_minimumWidth\";\n\n@implementation iTermStatusBarComponentKnob\n\n- (instancetype)initWithLabelText:(nullable NSString *)labelText\n type:(iTermStatusBarComponentKnobType)type\n placeholder:(nullable NSString *)placeholder\n defaultValue:(nullable id)defaultValue\n key:(NSString *)key {\n self = [super init];\n if (self) {\n _labelText = [labelText copy];\n _type = type;\n _placeholder = [placeholder copy];\n _value = defaultValue;\n _key = [key copy];\n }\n return self;\n}\n\n- (nullable NSView *)inputView {\n [self doesNotRecognizeSelector:_cmd];\n return nil;\n}\n\n- (nullable NSString *)stringValue {\n return [NSString castFrom:_value];\n}\n\n- (nullable NSNumber *)numberValue {\n return [NSNumber castFrom:_value];\n}\n\n@end\n\nNS_ASSUME_NONNULL_END\n"} +{"text": "freeResult();\n\t\t$this->connection = null;\n\t}\n\n\t/**\n\t * Connects to the database if needed.\n\t *\n\t * @return void Returns void if the database connected successfully.\n\t *\n\t * @since 12.1\n\t * @throws RuntimeException\n\t */\n\tpublic function connect()\n\t{\n\t\tif ($this->connection)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tparent::connect();\n\n\t\t$this->connection->sqliteCreateFunction(\n\t\t\t'ROW_NUMBER',\n\t\t\tfunction($init = null)\n\t\t\t{\n\t\t\t\tstatic $rownum, $partition;\n\n\t\t\t\tif ($init !== null)\n\t\t\t\t{\n\t\t\t\t\t$rownum = $init;\n\t\t\t\t\t$partition = null;\n\n\t\t\t\t\treturn $rownum;\n\t\t\t\t}\n\n\t\t\t\t$args = func_get_args();\n\t\t\t\tarray_shift($args);\n\n\t\t\t\t$partitionBy = $args ? implode(',', $args) : null;\n\n\t\t\t\tif ($partitionBy === null || $partitionBy === $partition)\n\t\t\t\t{\n\t\t\t\t\t$rownum++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$rownum = 1;\n\t\t\t\t\t$partition = $partitionBy;\n\t\t\t\t}\n\n\t\t\t\treturn $rownum;\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Disconnects the database.\n\t *\n\t * @return void\n\t *\n\t * @since 12.1\n\t */\n\tpublic function disconnect()\n\t{\n\t\t$this->freeResult();\n\t\t$this->connection = null;\n\t}\n\n\t/**\n\t * Drops a table from the database.\n\t *\n\t * @param string $tableName The name of the database table to drop.\n\t * @param boolean $ifExists Optionally specify that the table must exist before it is dropped.\n\t *\n\t * @return JDatabaseDriverSqlite Returns this object to support chaining.\n\t *\n\t * @since 12.1\n\t */\n\tpublic function dropTable($tableName, $ifExists = true)\n\t{\n\t\t$this->connect();\n\n\t\t$query = $this->getQuery(true);\n\n\t\t$this->setQuery('DROP TABLE ' . ($ifExists ? 'IF EXISTS ' : '') . $query->quoteName($tableName));\n\n\t\t$this->execute();\n\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Method to escape a string for usage in an SQLite statement.\n\t *\n\t * Note: Using query objects with bound variables is\n\t * preferable to the below.\n\t *\n\t * @param string $text The string to be escaped.\n\t * @param boolean $extra Unused optional parameter to provide extra escaping.\n\t *\n\t * @return string The escaped string.\n\t *\n\t * @since 12.1\n\t */\n\tpublic function escape($text, $extra = false)\n\t{\n\t\tif (is_int($text) || is_float($text))\n\t\t{\n\t\t\treturn $text;\n\t\t}\n\n\t\treturn SQLite3::escapeString($text);\n\t}\n\n\t/**\n\t * Method to get the database collation in use by sampling a text field of a table in the database.\n\t *\n\t * @return mixed The collation in use by the database or boolean false if not supported.\n\t *\n\t * @since 12.1\n\t */\n\tpublic function getCollation()\n\t{\n\t\treturn $this->charset;\n\t}\n\n\t/**\n\t * Method to get the database connection collation, as reported by the driver. If the connector doesn't support\n\t * reporting this value please return an empty string.\n\t *\n\t * @return string\n\t */\n\tpublic function getConnectionCollation()\n\t{\n\t\treturn $this->charset;\n\t}\n\n\t/**\n\t * Shows the table CREATE statement that creates the given tables.\n\t *\n\t * Note: Doesn't appear to have support in SQLite\n\t *\n\t * @param mixed $tables A table name or a list of table names.\n\t *\n\t * @return array A list of the create SQL for the tables.\n\t *\n\t * @since 12.1\n\t * @throws RuntimeException\n\t */\n\tpublic function getTableCreate($tables)\n\t{\n\t\t$this->connect();\n\n\t\t// Sanitize input to an array and iterate over the list.\n\t\tsettype($tables, 'array');\n\n\t\treturn $tables;\n\t}\n\n\t/**\n\t * Retrieves field information about a given table.\n\t *\n\t * @param string $table The name of the database table.\n\t * @param boolean $typeOnly True to only return field types.\n\t *\n\t * @return array An array of fields for the database table.\n\t *\n\t * @since 12.1\n\t * @throws RuntimeException\n\t */\n\tpublic function getTableColumns($table, $typeOnly = true)\n\t{\n\t\t$this->connect();\n\n\t\t$columns = array();\n\t\t$query = $this->getQuery(true);\n\n\t\t$fieldCasing = $this->getOption(PDO::ATTR_CASE);\n\n\t\t$this->setOption(PDO::ATTR_CASE, PDO::CASE_UPPER);\n\n\t\t$table = strtoupper($table);\n\n\t\t$query->setQuery('pragma table_info(' . $table . ')');\n\n\t\t$this->setQuery($query);\n\t\t$fields = $this->loadObjectList();\n\n\t\tif ($typeOnly)\n\t\t{\n\t\t\tforeach ($fields as $field)\n\t\t\t{\n\t\t\t\t$columns[$field->NAME] = $field->TYPE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($fields as $field)\n\t\t\t{\n\t\t\t\t// Do some dirty translation to MySQL output.\n\t\t\t\t// TODO: Come up with and implement a standard across databases.\n\t\t\t\t$columns[$field->NAME] = (object) array(\n\t\t\t\t\t'Field' => $field->NAME,\n\t\t\t\t\t'Type' => $field->TYPE,\n\t\t\t\t\t'Null' => ($field->NOTNULL == '1' ? 'NO' : 'YES'),\n\t\t\t\t\t'Default' => $field->DFLT_VALUE,\n\t\t\t\t\t'Key' => ($field->PK != '0' ? 'PRI' : ''),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$this->setOption(PDO::ATTR_CASE, $fieldCasing);\n\n\t\treturn $columns;\n\t}\n\n\t/**\n\t * Get the details list of keys for a table.\n\t *\n\t * @param string $table The name of the table.\n\t *\n\t * @return array An array of the column specification for the table.\n\t *\n\t * @since 12.1\n\t * @throws RuntimeException\n\t */\n\tpublic function getTableKeys($table)\n\t{\n\t\t$this->connect();\n\n\t\t$keys = array();\n\t\t$query = $this->getQuery(true);\n\n\t\t$fieldCasing = $this->getOption(PDO::ATTR_CASE);\n\n\t\t$this->setOption(PDO::ATTR_CASE, PDO::CASE_UPPER);\n\n\t\t$table = strtoupper($table);\n\t\t$query->setQuery('pragma table_info( ' . $table . ')');\n\n\t\t// $query->bind(':tableName', $table);\n\n\t\t$this->setQuery($query);\n\t\t$rows = $this->loadObjectList();\n\n\t\tforeach ($rows as $column)\n\t\t{\n\t\t\tif ($column->PK == 1)\n\t\t\t{\n\t\t\t\t$keys[$column->NAME] = $column;\n\t\t\t}\n\t\t}\n\n\t\t$this->setOption(PDO::ATTR_CASE, $fieldCasing);\n\n\t\treturn $keys;\n\t}\n\n\t/**\n\t * Method to get an array of all tables in the database (schema).\n\t *\n\t * @return array An array of all the tables in the database.\n\t *\n\t * @since 12.1\n\t * @throws RuntimeException\n\t */\n\tpublic function getTableList()\n\t{\n\t\t$this->connect();\n\n\t\t$type = 'table';\n\n\t\t$query = $this->getQuery(true)\n\t\t\t->select('name')\n\t\t\t->from('sqlite_master')\n\t\t\t->where('type = :type')\n\t\t\t->bind(':type', $type)\n\t\t\t->order('name');\n\n\t\t$this->setQuery($query);\n\n\t\t$tables = $this->loadColumn();\n\n\t\treturn $tables;\n\t}\n\n\t/**\n\t * Get the version of the database connector.\n\t *\n\t * @return string The database connector version.\n\t *\n\t * @since 12.1\n\t */\n\tpublic function getVersion()\n\t{\n\t\t$this->connect();\n\n\t\t$this->setQuery('SELECT sqlite_version()');\n\n\t\treturn $this->loadResult();\n\t}\n\n\t/**\n\t * Select a database for use.\n\t *\n\t * @param string $database The name of the database to select for use.\n\t *\n\t * @return boolean True if the database was successfully selected.\n\t *\n\t * @since 12.1\n\t * @throws RuntimeException\n\t */\n\tpublic function select($database)\n\t{\n\t\t$this->connect();\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the connection to use UTF-8 character encoding.\n\t *\n\t * Returns false automatically for the Oracle driver since\n\t * you can only set the character set when the connection\n\t * is created.\n\t *\n\t * @return boolean True on success.\n\t *\n\t * @since 12.1\n\t */\n\tpublic function setUtf()\n\t{\n\t\t$this->connect();\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Locks a table in the database.\n\t *\n\t * @param string $table The name of the table to unlock.\n\t *\n\t * @return JDatabaseDriverSqlite Returns this object to support chaining.\n\t *\n\t * @since 12.1\n\t * @throws RuntimeException\n\t */\n\tpublic function lockTable($table)\n\t{\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Renames a table in the database.\n\t *\n\t * @param string $oldTable The name of the table to be renamed\n\t * @param string $newTable The new name for the table.\n\t * @param string $backup Not used by Sqlite.\n\t * @param string $prefix Not used by Sqlite.\n\t *\n\t * @return JDatabaseDriverSqlite Returns this object to support chaining.\n\t *\n\t * @since 12.1\n\t * @throws RuntimeException\n\t */\n\tpublic function renameTable($oldTable, $newTable, $backup = null, $prefix = null)\n\t{\n\t\t$this->setQuery('ALTER TABLE ' . $oldTable . ' RENAME TO ' . $newTable)->execute();\n\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Unlocks tables in the database.\n\t *\n\t * @return JDatabaseDriverSqlite Returns this object to support chaining.\n\t *\n\t * @since 12.1\n\t * @throws RuntimeException\n\t */\n\tpublic function unlockTables()\n\t{\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Test to see if the PDO ODBC connector is available.\n\t *\n\t * @return boolean True on success, false otherwise.\n\t *\n\t * @since 12.1\n\t */\n\tpublic static function isSupported()\n\t{\n\t\treturn class_exists('PDO') && in_array('sqlite', PDO::getAvailableDrivers());\n\t}\n\n\t/**\n\t * Method to commit a transaction.\n\t *\n\t * @param boolean $toSavepoint If true, commit to the last savepoint.\n\t *\n\t * @return void\n\t *\n\t * @since 12.3\n\t * @throws RuntimeException\n\t */\n\tpublic function transactionCommit($toSavepoint = false)\n\t{\n\t\t$this->connect();\n\n\t\tif (!$toSavepoint || $this->transactionDepth <= 1)\n\t\t{\n\t\t\tparent::transactionCommit($toSavepoint);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->transactionDepth--;\n\t\t}\n\t}\n\n\t/**\n\t * Method to roll back a transaction.\n\t *\n\t * @param boolean $toSavepoint If true, rollback to the last savepoint.\n\t *\n\t * @return void\n\t *\n\t * @since 12.3\n\t * @throws RuntimeException\n\t */\n\tpublic function transactionRollback($toSavepoint = false)\n\t{\n\t\t$this->connect();\n\n\t\tif (!$toSavepoint || $this->transactionDepth <= 1)\n\t\t{\n\t\t\tparent::transactionRollback($toSavepoint);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$savepoint = 'SP_' . ($this->transactionDepth - 1);\n\t\t\t$this->setQuery('ROLLBACK TO ' . $this->quoteName($savepoint));\n\n\t\t\tif ($this->execute())\n\t\t\t{\n\t\t\t\t$this->transactionDepth--;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Method to initialize a transaction.\n\t *\n\t * @param boolean $asSavepoint If true and a transaction is already active, a savepoint will be created.\n\t *\n\t * @return void\n\t *\n\t * @since 12.3\n\t * @throws RuntimeException\n\t */\n\tpublic function transactionStart($asSavepoint = false)\n\t{\n\t\t$this->connect();\n\n\t\tif (!$asSavepoint || !$this->transactionDepth)\n\t\t{\n\t\t\tparent::transactionStart($asSavepoint);\n\t\t}\n\n\t\t$savepoint = 'SP_' . $this->transactionDepth;\n\t\t$this->setQuery('SAVEPOINT ' . $this->quoteName($savepoint));\n\n\t\tif ($this->execute())\n\t\t{\n\t\t\t$this->transactionDepth++;\n\t\t}\n\t}\n\n\t/**\n\t * Get the query strings to alter the character set and collation of a table.\n\t *\n\t * @param string $tableName The name of the table\n\t *\n\t * @return string[] The queries required to alter the table's character set and collation\n\t *\n\t * @since CMS 3.5.0\n\t */\n\tpublic function getAlterTableCharacterSet($tableName)\n\t{\n\t\treturn array();\n\t}\n\n\t/**\n\t * Return the query string to create new Database.\n\t * Each database driver, other than MySQL, need to override this member to return correct string.\n\t *\n\t * @param stdClass $options Object used to pass user and database name to database driver.\n\t * This object must have \"db_name\" and \"db_user\" set.\n\t * @param boolean $utf True if the database supports the UTF-8 character set.\n\t *\n\t * @return string The query that creates database\n\t *\n\t * @since 12.2\n\t */\n\tprotected function getCreateDatabaseQuery($options, $utf)\n\t{\n\t\treturn 'CREATE DATABASE ' . $this->quoteName($options->db_name);\n\t}\n}\n"} +{"text": "require 'distribution/f/ruby'\nrequire 'distribution/f/gsl'\nrequire 'distribution/f/statistics2'\nrequire 'distribution/f/java'\nmodule Distribution\n # Calculate cdf and inverse cdf for F Distribution.\n #\n module F\n SHORTHAND = 'fdist'\n extend Distributable\n create_distribution_methods\n\n ##\n # :singleton-method: pdf(x,k1,k2)\n # Returns the PDF of F distribution\n # with +k1+ and +k2+ degrees of freedom over [0, +x+]\n\n ##\n # :singleton-method: p_value(qn, k1, k2)\n # Return the P-value of the corresponding integral +qn+ with\n # +k1+ and +k2+ degrees of freedom\n\n ##\n # :singleton-method: cdf(x,k1,k2)\n # Returns the integral of F distribution\n # with +k1+ and +k2+ degrees of freedom over [0, +x+]\n end\nend\n"} +{"text": "owner = SIA\r\n\rcontroller = SIA\r\n\radd_core = SIA\r\r\nenergy = 1.00\r\nindustry = 1\r\ninfra = 4\r\nmanpower = 1.00\r\nleadership = 0.10\r\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.unomi.api;\n\nimport javax.xml.bind.annotation.XmlTransient;\nimport java.io.Serializable;\nimport java.util.List;\n\n/**\n * A convenience object gathering a {@link Persona} and its associated {@link PersonaSession}s.\n */\npublic class PersonaWithSessions implements Serializable {\n private Persona persona;\n\n private List sessions;\n\n public PersonaWithSessions() {\n }\n\n public PersonaWithSessions(Persona persona, List sessions) {\n this.persona = persona;\n this.sessions = sessions;\n }\n\n public Persona getPersona() {\n return persona;\n }\n\n public void setPersona(Persona persona) {\n this.persona = persona;\n }\n\n public List getSessions() {\n return sessions;\n }\n\n public void setSessions(List sessions) {\n this.sessions = sessions;\n }\n\n @XmlTransient\n public PersonaSession getLastSession() {\n return sessions.size()>0?sessions.get(0):null;\n }\n}"} +{"text": "Go 有些与众不同的特性使之在最近几年的软件开发领域脱颖而出。\n例如:\n\n清晰并且简洁\n:\tGo 努力保持小并且优美,你可以在短短几行代码里做许多事情;\n\n并行\n:\tGo 让函数很容易成为非常轻量的线程。这些轻量线程在 Go 中被叫做 goroutines;\n\nChannel\n:\tgoroutines 之间的通讯由 channel 完成;\n\n快速\n:\t相比其他编译语言,Go 的编译速度很快,而执行速度也毫不逊色。其设计目标是跟 C 一样快。对一般应用程序,编译时间做到可以用秒计算;\n\n安全\n:\t当转换一个类型到另一个类型的时候需要显式的转换并遵循严格的规则。Go 有垃圾收集,所以在 Go 中无须像 C 语言那样调用 free() 函数释放内存,语言会处理这一切;\n\n格式化标准\n:\tGo 程序可以被格式化为程序员希望的(几乎)任何形式,但是官方格式是存在的。标准也非常简单 `gofmt 的输出就是官方认可的格式`;\n\n类型后置\n:\t类型在变量名的后面,像这样 `var a int`,来代替 C 中的 `int a`;\n\nUTF-8\n:\t任何地方都是 UTF-8 的,包括字符串以及程序代码。你可以在代码中使用 Φ = Φ + 1;\n\n开源\n:\tGo 的许可证是完全开源的,参阅 Go 发布的源码中的 LICENSE 文件;\n\n开心\n:\t用 Go 写程序会非常开心!:-)\n"} +{"text": "/* Any copyright is dedicated to the Public Domain.\n * http://creativecommons.org/publicdomain/zero/1.0/ */\n\nCu.import(\"resource://services-sync/constants.js\");\nCu.import(\"resource://services-sync/engines.js\");\nCu.import(\"resource://services-sync/engines/clients.js\");\nCu.import(\"resource://services-sync/record.js\");\nCu.import(\"resource://services-sync/service.js\");\nCu.import(\"resource://services-sync/util.js\");\nCu.import(\"resource://testing-common/services/sync/utils.js\");\n\nconst MORE_THAN_CLIENTS_TTL_REFRESH = 691200; // 8 days\nconst LESS_THAN_CLIENTS_TTL_REFRESH = 86400; // 1 day\n\nlet engine = Service.clientsEngine;\n\n/**\n * Unpack the record with this ID, and verify that it has the same version that\n * we should be putting into records.\n */\nfunction check_record_version(user, id) {\n let payload = JSON.parse(user.collection(\"clients\").wbo(id).payload);\n\n let rec = new CryptoWrapper();\n rec.id = id;\n rec.collection = \"clients\";\n rec.ciphertext = payload.ciphertext;\n rec.hmac = payload.hmac;\n rec.IV = payload.IV;\n\n let cleartext = rec.decrypt(Service.collectionKeys.keyForCollection(\"clients\"));\n\n _(\"Payload is \" + JSON.stringify(cleartext));\n do_check_eq(Services.appinfo.version, cleartext.version);\n do_check_eq(2, cleartext.protocols.length);\n do_check_eq(\"1.1\", cleartext.protocols[0]);\n do_check_eq(\"1.5\", cleartext.protocols[1]);\n}\n\nadd_test(function test_bad_hmac() {\n _(\"Ensure that Clients engine deletes corrupt records.\");\n let contents = {\n meta: {global: {engines: {clients: {version: engine.version,\n syncID: engine.syncID}}}},\n clients: {},\n crypto: {}\n };\n let deletedCollections = [];\n let deletedItems = [];\n let callback = {\n __proto__: SyncServerCallback,\n onItemDeleted: function (username, coll, wboID) {\n deletedItems.push(coll + \"/\" + wboID);\n },\n onCollectionDeleted: function (username, coll) {\n deletedCollections.push(coll);\n }\n }\n let server = serverForUsers({\"foo\": \"password\"}, contents, callback);\n let user = server.user(\"foo\");\n\n function check_clients_count(expectedCount) {\n let stack = Components.stack.caller;\n let coll = user.collection(\"clients\");\n\n // Treat a non-existent collection as empty.\n do_check_eq(expectedCount, coll ? coll.count() : 0, stack);\n }\n\n function check_client_deleted(id) {\n let coll = user.collection(\"clients\");\n let wbo = coll.wbo(id);\n return !wbo || !wbo.payload;\n }\n\n function uploadNewKeys() {\n generateNewKeys(Service.collectionKeys);\n let serverKeys = Service.collectionKeys.asWBO(\"crypto\", \"keys\");\n serverKeys.encrypt(Service.identity.syncKeyBundle);\n do_check_true(serverKeys.upload(Service.resource(Service.cryptoKeysURL)).success);\n }\n\n try {\n ensureLegacyIdentityManager();\n let passphrase = \"abcdeabcdeabcdeabcdeabcdea\";\n Service.serverURL = server.baseURI;\n Service.login(\"foo\", \"ilovejane\", passphrase);\n\n generateNewKeys(Service.collectionKeys);\n\n _(\"First sync, client record is uploaded\");\n do_check_eq(engine.lastRecordUpload, 0);\n check_clients_count(0);\n engine._sync();\n check_clients_count(1);\n do_check_true(engine.lastRecordUpload > 0);\n\n // Our uploaded record has a version.\n check_record_version(user, engine.localID);\n\n // Initial setup can wipe the server, so clean up.\n deletedCollections = [];\n deletedItems = [];\n\n _(\"Change our keys and our client ID, reupload keys.\");\n let oldLocalID = engine.localID; // Preserve to test for deletion!\n engine.localID = Utils.makeGUID();\n engine.resetClient();\n generateNewKeys(Service.collectionKeys);\n let serverKeys = Service.collectionKeys.asWBO(\"crypto\", \"keys\");\n serverKeys.encrypt(Service.identity.syncKeyBundle);\n do_check_true(serverKeys.upload(Service.resource(Service.cryptoKeysURL)).success);\n\n _(\"Sync.\");\n engine._sync();\n\n _(\"Old record \" + oldLocalID + \" was deleted, new one uploaded.\");\n check_clients_count(1);\n check_client_deleted(oldLocalID);\n\n _(\"Now change our keys but don't upload them. \" +\n \"That means we get an HMAC error but redownload keys.\");\n Service.lastHMACEvent = 0;\n engine.localID = Utils.makeGUID();\n engine.resetClient();\n generateNewKeys(Service.collectionKeys);\n deletedCollections = [];\n deletedItems = [];\n check_clients_count(1);\n engine._sync();\n\n _(\"Old record was not deleted, new one uploaded.\");\n do_check_eq(deletedCollections.length, 0);\n do_check_eq(deletedItems.length, 0);\n check_clients_count(2);\n\n _(\"Now try the scenario where our keys are wrong *and* there's a bad record.\");\n // Clean up and start fresh.\n user.collection(\"clients\")._wbos = {};\n Service.lastHMACEvent = 0;\n engine.localID = Utils.makeGUID();\n engine.resetClient();\n deletedCollections = [];\n deletedItems = [];\n check_clients_count(0);\n\n uploadNewKeys();\n\n // Sync once to upload a record.\n engine._sync();\n check_clients_count(1);\n\n // Generate and upload new keys, so the old client record is wrong.\n uploadNewKeys();\n\n // Create a new client record and new keys. Now our keys are wrong, as well\n // as the object on the server. We'll download the new keys and also delete\n // the bad client record.\n oldLocalID = engine.localID; // Preserve to test for deletion!\n engine.localID = Utils.makeGUID();\n engine.resetClient();\n generateNewKeys(Service.collectionKeys);\n let oldKey = Service.collectionKeys.keyForCollection();\n\n do_check_eq(deletedCollections.length, 0);\n do_check_eq(deletedItems.length, 0);\n engine._sync();\n do_check_eq(deletedItems.length, 1);\n check_client_deleted(oldLocalID);\n check_clients_count(1);\n let newKey = Service.collectionKeys.keyForCollection();\n do_check_false(oldKey.equals(newKey));\n\n } finally {\n Svc.Prefs.resetBranch(\"\");\n Service.recordManager.clearCache();\n server.stop(run_next_test);\n }\n});\n\nadd_test(function test_properties() {\n _(\"Test lastRecordUpload property\");\n try {\n do_check_eq(Svc.Prefs.get(\"clients.lastRecordUpload\"), undefined);\n do_check_eq(engine.lastRecordUpload, 0);\n\n let now = Date.now();\n engine.lastRecordUpload = now / 1000;\n do_check_eq(engine.lastRecordUpload, Math.floor(now / 1000));\n } finally {\n Svc.Prefs.resetBranch(\"\");\n run_next_test();\n }\n});\n\nadd_test(function test_sync() {\n _(\"Ensure that Clients engine uploads a new client record once a week.\");\n\n let contents = {\n meta: {global: {engines: {clients: {version: engine.version,\n syncID: engine.syncID}}}},\n clients: {},\n crypto: {}\n };\n let server = serverForUsers({\"foo\": \"password\"}, contents);\n let user = server.user(\"foo\");\n\n new SyncTestingInfrastructure(server.server);\n generateNewKeys(Service.collectionKeys);\n\n function clientWBO() {\n return user.collection(\"clients\").wbo(engine.localID);\n }\n\n try {\n\n _(\"First sync. Client record is uploaded.\");\n do_check_eq(clientWBO(), undefined);\n do_check_eq(engine.lastRecordUpload, 0);\n engine._sync();\n do_check_true(!!clientWBO().payload);\n do_check_true(engine.lastRecordUpload > 0);\n\n _(\"Let's time travel more than a week back, new record should've been uploaded.\");\n engine.lastRecordUpload -= MORE_THAN_CLIENTS_TTL_REFRESH;\n let lastweek = engine.lastRecordUpload;\n clientWBO().payload = undefined;\n engine._sync();\n do_check_true(!!clientWBO().payload);\n do_check_true(engine.lastRecordUpload > lastweek);\n\n _(\"Remove client record.\");\n engine.removeClientData();\n do_check_eq(clientWBO().payload, undefined);\n\n _(\"Time travel one day back, no record uploaded.\");\n engine.lastRecordUpload -= LESS_THAN_CLIENTS_TTL_REFRESH;\n let yesterday = engine.lastRecordUpload;\n engine._sync();\n do_check_eq(clientWBO().payload, undefined);\n do_check_eq(engine.lastRecordUpload, yesterday);\n\n } finally {\n Svc.Prefs.resetBranch(\"\");\n Service.recordManager.clearCache();\n server.stop(run_next_test);\n }\n});\n\nadd_test(function test_client_name_change() {\n _(\"Ensure client name change incurs a client record update.\");\n\n let tracker = engine._tracker;\n\n let localID = engine.localID;\n let initialName = engine.localName;\n\n Svc.Obs.notify(\"weave:engine:start-tracking\");\n _(\"initial name: \" + initialName);\n\n // Tracker already has data, so clear it.\n tracker.clearChangedIDs();\n\n let initialScore = tracker.score;\n\n do_check_eq(Object.keys(tracker.changedIDs).length, 0);\n\n Svc.Prefs.set(\"client.name\", \"new name\");\n\n _(\"new name: \" + engine.localName);\n do_check_neq(initialName, engine.localName);\n do_check_eq(Object.keys(tracker.changedIDs).length, 1);\n do_check_true(engine.localID in tracker.changedIDs);\n do_check_true(tracker.score > initialScore);\n do_check_true(tracker.score >= SCORE_INCREMENT_XLARGE);\n\n Svc.Obs.notify(\"weave:engine:stop-tracking\");\n\n run_next_test();\n});\n\nadd_test(function test_send_command() {\n _(\"Verifies _sendCommandToClient puts commands in the outbound queue.\");\n\n let store = engine._store;\n let tracker = engine._tracker;\n let remoteId = Utils.makeGUID();\n let rec = new ClientsRec(\"clients\", remoteId);\n\n store.create(rec);\n let remoteRecord = store.createRecord(remoteId, \"clients\");\n\n let action = \"testCommand\";\n let args = [\"foo\", \"bar\"];\n\n engine._sendCommandToClient(action, args, remoteId);\n\n let newRecord = store._remoteClients[remoteId];\n do_check_neq(newRecord, undefined);\n do_check_eq(newRecord.commands.length, 1);\n\n let command = newRecord.commands[0];\n do_check_eq(command.command, action);\n do_check_eq(command.args.length, 2);\n do_check_eq(command.args, args);\n\n do_check_neq(tracker.changedIDs[remoteId], undefined);\n\n run_next_test();\n});\n\nadd_test(function test_command_validation() {\n _(\"Verifies that command validation works properly.\");\n\n let store = engine._store;\n\n let testCommands = [\n [\"resetAll\", [], true ],\n [\"resetAll\", [\"foo\"], false],\n [\"resetEngine\", [\"tabs\"], true ],\n [\"resetEngine\", [], false],\n [\"wipeAll\", [], true ],\n [\"wipeAll\", [\"foo\"], false],\n [\"wipeEngine\", [\"tabs\"], true ],\n [\"wipeEngine\", [], false],\n [\"logout\", [], true ],\n [\"logout\", [\"foo\"], false],\n [\"__UNKNOWN__\", [], false]\n ];\n\n for each (let [action, args, expectedResult] in testCommands) {\n let remoteId = Utils.makeGUID();\n let rec = new ClientsRec(\"clients\", remoteId);\n\n store.create(rec);\n store.createRecord(remoteId, \"clients\");\n\n engine.sendCommand(action, args, remoteId);\n\n let newRecord = store._remoteClients[remoteId];\n do_check_neq(newRecord, undefined);\n\n if (expectedResult) {\n _(\"Ensuring command is sent: \" + action);\n do_check_eq(newRecord.commands.length, 1);\n\n let command = newRecord.commands[0];\n do_check_eq(command.command, action);\n do_check_eq(command.args, args);\n\n do_check_neq(engine._tracker, undefined);\n do_check_neq(engine._tracker.changedIDs[remoteId], undefined);\n } else {\n _(\"Ensuring command is scrubbed: \" + action);\n do_check_eq(newRecord.commands, undefined);\n\n if (store._tracker) {\n do_check_eq(engine._tracker[remoteId], undefined);\n }\n }\n\n }\n run_next_test();\n});\n\nadd_test(function test_command_duplication() {\n _(\"Ensures duplicate commands are detected and not added\");\n\n let store = engine._store;\n let remoteId = Utils.makeGUID();\n let rec = new ClientsRec(\"clients\", remoteId);\n store.create(rec);\n store.createRecord(remoteId, \"clients\");\n\n let action = \"resetAll\";\n let args = [];\n\n engine.sendCommand(action, args, remoteId);\n engine.sendCommand(action, args, remoteId);\n\n let newRecord = store._remoteClients[remoteId];\n do_check_eq(newRecord.commands.length, 1);\n\n _(\"Check variant args length\");\n newRecord.commands = [];\n\n action = \"resetEngine\";\n engine.sendCommand(action, [{ x: \"foo\" }], remoteId);\n engine.sendCommand(action, [{ x: \"bar\" }], remoteId);\n\n _(\"Make sure we spot a real dupe argument.\");\n engine.sendCommand(action, [{ x: \"bar\" }], remoteId);\n\n do_check_eq(newRecord.commands.length, 2);\n\n run_next_test();\n});\n\nadd_test(function test_command_invalid_client() {\n _(\"Ensures invalid client IDs are caught\");\n\n let id = Utils.makeGUID();\n let error;\n\n try {\n engine.sendCommand(\"wipeAll\", [], id);\n } catch (ex) {\n error = ex;\n }\n\n do_check_eq(error.message.indexOf(\"Unknown remote client ID: \"), 0);\n\n run_next_test();\n});\n\nadd_test(function test_process_incoming_commands() {\n _(\"Ensures local commands are executed\");\n\n engine.localCommands = [{ command: \"logout\", args: [] }];\n\n let ev = \"weave:service:logout:finish\";\n\n var handler = function() {\n Svc.Obs.remove(ev, handler);\n run_next_test();\n };\n\n Svc.Obs.add(ev, handler);\n\n // logout command causes processIncomingCommands to return explicit false.\n do_check_false(engine.processIncomingCommands());\n});\n\nadd_test(function test_command_sync() {\n _(\"Ensure that commands are synced across clients.\");\n\n engine._store.wipe();\n generateNewKeys(Service.collectionKeys);\n\n let contents = {\n meta: {global: {engines: {clients: {version: engine.version,\n syncID: engine.syncID}}}},\n clients: {},\n crypto: {}\n };\n let server = serverForUsers({\"foo\": \"password\"}, contents);\n new SyncTestingInfrastructure(server.server);\n\n let user = server.user(\"foo\");\n let remoteId = Utils.makeGUID();\n\n function clientWBO(id) {\n return user.collection(\"clients\").wbo(id);\n }\n\n _(\"Create remote client record\");\n let rec = new ClientsRec(\"clients\", remoteId);\n engine._store.create(rec);\n let remoteRecord = engine._store.createRecord(remoteId, \"clients\");\n engine.sendCommand(\"wipeAll\", []);\n\n let clientRecord = engine._store._remoteClients[remoteId];\n do_check_neq(clientRecord, undefined);\n do_check_eq(clientRecord.commands.length, 1);\n\n try {\n _(\"Syncing.\");\n engine._sync();\n _(\"Checking record was uploaded.\");\n do_check_neq(clientWBO(engine.localID).payload, undefined);\n do_check_true(engine.lastRecordUpload > 0);\n\n do_check_neq(clientWBO(remoteId).payload, undefined);\n\n Svc.Prefs.set(\"client.GUID\", remoteId);\n engine._resetClient();\n do_check_eq(engine.localID, remoteId);\n _(\"Performing sync on resetted client.\");\n engine._sync();\n do_check_neq(engine.localCommands, undefined);\n do_check_eq(engine.localCommands.length, 1);\n\n let command = engine.localCommands[0];\n do_check_eq(command.command, \"wipeAll\");\n do_check_eq(command.args.length, 0);\n\n } finally {\n Svc.Prefs.resetBranch(\"\");\n Service.recordManager.clearCache();\n server.stop(run_next_test);\n }\n});\n\nadd_test(function test_send_uri_to_client_for_display() {\n _(\"Ensure sendURIToClientForDisplay() sends command properly.\");\n\n let tracker = engine._tracker;\n let store = engine._store;\n\n let remoteId = Utils.makeGUID();\n let rec = new ClientsRec(\"clients\", remoteId);\n rec.name = \"remote\";\n store.create(rec);\n let remoteRecord = store.createRecord(remoteId, \"clients\");\n\n tracker.clearChangedIDs();\n let initialScore = tracker.score;\n\n let uri = \"http://www.mozilla.org/\";\n let title = \"Title of the Page\";\n engine.sendURIToClientForDisplay(uri, remoteId, title);\n\n let newRecord = store._remoteClients[remoteId];\n\n do_check_neq(newRecord, undefined);\n do_check_eq(newRecord.commands.length, 1);\n\n let command = newRecord.commands[0];\n do_check_eq(command.command, \"displayURI\");\n do_check_eq(command.args.length, 3);\n do_check_eq(command.args[0], uri);\n do_check_eq(command.args[1], engine.localID);\n do_check_eq(command.args[2], title);\n\n do_check_true(tracker.score > initialScore);\n do_check_true(tracker.score - initialScore >= SCORE_INCREMENT_XLARGE);\n\n _(\"Ensure unknown client IDs result in exception.\");\n let unknownId = Utils.makeGUID();\n let error;\n\n try {\n engine.sendURIToClientForDisplay(uri, unknownId);\n } catch (ex) {\n error = ex;\n }\n\n do_check_eq(error.message.indexOf(\"Unknown remote client ID: \"), 0);\n\n run_next_test();\n});\n\nadd_test(function test_receive_display_uri() {\n _(\"Ensure processing of received 'displayURI' commands works.\");\n\n // We don't set up WBOs and perform syncing because other tests verify\n // the command API works as advertised. This saves us a little work.\n\n let uri = \"http://www.mozilla.org/\";\n let remoteId = Utils.makeGUID();\n let title = \"Page Title!\";\n\n let command = {\n command: \"displayURI\",\n args: [uri, remoteId, title],\n };\n\n engine.localCommands = [command];\n\n // Received 'displayURI' command should result in the topic defined below\n // being called.\n let ev = \"weave:engine:clients:display-uri\";\n\n let handler = function(subject, data) {\n Svc.Obs.remove(ev, handler);\n\n do_check_eq(subject.uri, uri);\n do_check_eq(subject.client, remoteId);\n do_check_eq(subject.title, title);\n do_check_eq(data, null);\n\n run_next_test();\n };\n\n Svc.Obs.add(ev, handler);\n\n do_check_true(engine.processIncomingCommands());\n});\n\nadd_test(function test_optional_client_fields() {\n _(\"Ensure that we produce records with the fields added in Bug 1097222.\");\n\n const SUPPORTED_PROTOCOL_VERSIONS = [\"1.1\", \"1.5\"];\n let local = engine._store.createRecord(engine.localID, \"clients\");\n do_check_eq(local.name, engine.localName);\n do_check_eq(local.type, engine.localType);\n do_check_eq(local.version, Services.appinfo.version);\n do_check_array_eq(local.protocols, SUPPORTED_PROTOCOL_VERSIONS);\n\n // Optional fields.\n // Make sure they're what they ought to be...\n do_check_eq(local.os, Services.appinfo.OS);\n do_check_eq(local.appPackage, Services.appinfo.ID);\n\n // ... and also that they're non-empty.\n do_check_true(!!local.os);\n do_check_true(!!local.appPackage);\n do_check_true(!!local.application);\n\n // We don't currently populate device or formfactor.\n // See Bug 1100722, Bug 1100723.\n\n run_next_test();\n});\n\nfunction run_test() {\n initTestLogging(\"Trace\");\n Log.repository.getLogger(\"Sync.Engine.Clients\").level = Log.Level.Trace;\n run_next_test();\n}\n"} +{"text": "module Cisco-IOS-XE-wireless-client-oper {\n yang-version 1;\n namespace \"http://cisco.com/ns/yang/Cisco-IOS-XE-wireless-client-oper\";\n prefix wireless-client-oper;\n\n import Cisco-IOS-XE-wireless-client-types {\n prefix wireless-client-types;\n }\n import Cisco-IOS-XE-wireless-enum-types {\n prefix wireless-enum-types;\n }\n import Cisco-IOS-XE-wireless-mobility-types {\n prefix wireless-mobility-types;\n }\n import ietf-inet-types {\n prefix inet;\n }\n import ietf-yang-types {\n prefix yang;\n }\n\n organization\n \"Cisco Systems, Inc.\";\n contact\n \"Cisco Systems, Inc.\n Customer Service\n \n Postal: 170 W Tasman Drive\n San Jose, CA 95134\n \n Tel: +1 1800 553-NETS\n \n E-mail: cs-yang@cisco.com\";\n description\n \"This module contains a collection of YANG definitions\n for wireless client operational data.\n Copyright (c) 2016-2019 by Cisco Systems, Inc.\n All rights reserved.\";\n\n revision 2019-01-01 {\n description\n \" - EoGRE related information and join time for client\n - Add Guest Lan Client attribute\n - Removal of unused leaves\n - Cleaned up spelling errors in descriptions\n - Addition of mobility discovery throttles under CAC statistics\n - Added a counter that indicates move count of foreign client\n - Adding EoGRE related fields and containers\n - Removed unnecessary enums from exclusion auth method\n - Renamed mobility interface client stats container\n - Changing description of the fields\n - Modified 802.11k neighbor list related information\n - Added association time field\n - Added client mobility history data\n - Removed mobility interface events stats\";\n reference \"6.0.0\";\n }\n revision 2018-11-24 {\n description\n \"- Remove leaf client-active\n - Add Units for mm-complete-timestamp\n - Remove binary encoded buffers\n - Add HE capable client flag\n - Add MMIF internal error statistics\n - Hiding SANET and some of client oper fields\";\n reference \"5.0.0\";\n }\n revision 2018-03-22 {\n description\n \"Addition of location-info node. Enum value changes\";\n reference \"4.0.0\";\n }\n revision 2018-03-21 {\n description\n \"Removal of location-info node\";\n reference \"3.0.0\";\n }\n revision 2018-01-24 {\n description\n \"The first generally available version\";\n reference \"2.0.0\";\n }\n revision 2017-09-25 {\n description\n \"Properly indicated leaf-list ordering\";\n reference \"1.1.0\";\n }\n revision 2017-05-05 {\n description\n \"Initial revision\";\n reference \"1.0.0\";\n }\n\n typedef dot11i-auth-key-mgmt-type {\n type enumeration {\n enum \"akm-unknown\" {\n value 0;\n description\n \"The client's AKM type is Unknown\";\n }\n enum \"8021x\" {\n value 1;\n description\n \"The client's AKM type is IEEE 802.1X\";\n }\n enum \"psk\" {\n value 2;\n description\n \"The client's AKM type is PSK\";\n }\n enum \"ft-8021x\" {\n value 3;\n description\n \"The client's AKM type is Fast Transition (FT)-802.1x\";\n }\n enum \"ft-psk\" {\n value 4;\n description\n \"The client's AKM type is Fast Transition (FT)-PSK\";\n }\n enum \"8021x-sha256\" {\n value 5;\n description\n \"The client's AKM type is IEEE 802.1X with SHA256 key derivation\";\n }\n enum \"psk-sha256\" {\n value 6;\n description\n \"The client's AKM type is PSK SHA256 key derivation\";\n }\n enum \"sae\" {\n value 8;\n description\n \"The client's AKM type is Simultaneous Authentication of Equals (SAE)\";\n }\n enum \"ft-sae\" {\n value 9;\n description\n \"The client's AKM type is Fast Transition (FT)-SAE\";\n }\n enum \"suiteb-1x\" {\n value 11;\n description\n \"The client's AKM type is SUITEB-1X\";\n }\n enum \"suiteb192-1x\" {\n value 12;\n description\n \"The client's AKM type is SUITEB192-1X\";\n }\n enum \"owe\" {\n value 18;\n description\n \"The client's AKM type is OWE\";\n }\n }\n description\n \"List of Authentication Key Management (AKM) type(s) for the client\";\n }\n\n typedef encrypt-policy {\n type enumeration {\n enum \"encryp-policy-wep104\" {\n value 0;\n description\n \"The Encryption policy type for the client is WEP (104 bits)\";\n }\n enum \"encryp-policy-none\" {\n value 1;\n description\n \"There is no Encryption policy type for the client\";\n }\n enum \"encryp-policy-wep40\" {\n value 2;\n description\n \"The Encryption policy type for the client is WEP (40 bits)\";\n }\n enum \"encryp-policy-wep128\" {\n value 3;\n description\n \"The Encryption policy type for the client is WEP (128 bits)\";\n }\n enum \"encryp-policy-aes-ccm128\" {\n value 4;\n description\n \"The Encryption policy type for the client is AES-CCMP (128 bits)\";\n }\n enum \"encryp-policy-tkip-mic\" {\n value 5;\n description\n \"The Encryption policy type for the client is TKIP-MIC\";\n }\n enum \"encryp-policy-cisco-tkip-wep40\" {\n value 6;\n description\n \"The Encryption policy type for the client is CKIP-WEP (40 bits)\";\n }\n enum \"encryp-policy-cisco-tkip-wep104\" {\n value 7;\n description\n \"The Encryption policy type for the client is CKIP-WEP (104 bits)\";\n }\n enum \"encryp-policy-cisco-tkip-wep128\" {\n value 8;\n description\n \"The Encryption policy type for the client is CKIP-WEP (128 bits)\";\n }\n enum \"encryp-policy-ckip-kp-40\" {\n value 9;\n description\n \"The Encryption policy type for the client is CKIP-KeyPermutation (40 bits)\";\n }\n enum \"encryp-policy-ckip-kp-104\" {\n value 10;\n description\n \"The Encryption policy type for the client is CKIP-KeyPermutation (104 bits)\";\n }\n enum \"encryp-policy-ckip-mmh-40\" {\n value 11;\n description\n \"The Encryption policy type for the client is CKIP-MMH (40 bits)\";\n }\n enum \"encryp-policy-ckip-mmh-104\" {\n value 12;\n description\n \"The Encryption policy type for the client is CKIP-MMH (104 bits)\";\n }\n enum \"encryp-policy-ckip-kp-mmh-40\" {\n value 13;\n description\n \"The Encryption policy type for the client is CKIP-KeyPermutation with MMH (40 bits)\";\n }\n enum \"encryp-policy-ckip-kp-mmh-104\" {\n value 14;\n description\n \"The Encryption policy type for the client is CKIP-KeyPermutation with MMH (104 bits)\";\n }\n enum \"encryp-policy-wapi-sms4\" {\n value 15;\n description\n \"The Encryption policy type for the client is WAPI\";\n }\n enum \"encryp-policy-aes-gcmp128\" {\n value 20;\n description\n \"The Encryption policy type for the client is GCMP128\";\n }\n enum \"encryp-policy-aes-gcmp256\" {\n value 21;\n description\n \"The Encryption policy type for the client is GCMP256\";\n }\n enum \"encryp-policy-aes-ccmp256\" {\n value 22;\n description\n \"The Encryption policy type for the client is CCMP256\";\n }\n }\n description\n \"List of encryption policy types for the client send in add mobile.\";\n }\n\n typedef client-authentication-type {\n type enumeration {\n enum \"client-authentication-type-local\" {\n value 0;\n description\n \"The client is Locally authenticated\";\n }\n enum \"client-authentication-type-central\" {\n value 1;\n description\n \"The client is Centrally authenticated\";\n }\n enum \"client-is-non-hreap\" {\n value 2;\n description\n \"AP to which the client is connected is in local mode. Authentication type is supported only when the AP is Flex-Connect Mode\";\n }\n }\n description\n \"This data type indicates whether the client is centrally (on Controller) or locally (on AP) authenticated\";\n }\n\n typedef client-switching-mode {\n type enumeration {\n enum \"client-switching-mode-unknown\" {\n value 0;\n description\n \"The switching mode of the client traffic is unknown\";\n }\n enum \"local\" {\n value 1;\n description\n \"The client traffic is locally switched from the AP\";\n }\n enum \"central\" {\n value 2;\n description\n \"The client traffic is centrally switched from Wireless LAN Controller\";\n }\n }\n description\n \"This data type indicates whether the data from the client is centrally (on Controller) or locally (on AP) switched\";\n }\n\n grouping ms-wifi {\n description\n \"WiFi security details of the client\";\n leaf wpa-version {\n type wireless-client-types:dot11-eap-wpa-version;\n description\n \"WPA version of the client\";\n }\n leaf cipher-suite {\n type wireless-client-types:dot11i-cipher-suite;\n description\n \"IEEE 802.11i Cipher Suite type\";\n }\n leaf auth-key-mgmt {\n type wireless-client-oper:dot11i-auth-key-mgmt-type;\n description\n \"IEEE 802.11i Authentication Key Management information\";\n }\n }\n\n grouping ewlc-eogre-client {\n description\n \"EoGRE Client information\";\n leaf is-eogre {\n type boolean;\n description\n \"Whether this is an EoGRE client\";\n }\n leaf previous-match-reason {\n type wireless-enum-types:eogre-client-match-reason;\n description\n \"Previous output of the match process of client to EoGRE client\";\n }\n leaf match-reason {\n type wireless-enum-types:eogre-client-match-reason;\n description\n \"Output of the match process of client to EoGRE client\";\n }\n leaf is-aaa-data {\n type boolean;\n description\n \"Is AAA override received for this client\";\n }\n leaf realm {\n type string;\n description\n \"Client's realm matching EoGRE rule\";\n }\n leaf vlan {\n type uint16 {\n range \"1 .. 4094\";\n }\n description\n \"Vlan tagging for EoGRE client traffic\";\n }\n leaf domain {\n type string;\n description\n \"EoGRE domain\";\n }\n leaf primary-gw {\n type inet:ip-address;\n description\n \"IP address of the primary gateway\";\n }\n leaf secondary-gw {\n type inet:ip-address;\n description\n \"IP address of the secondary gateway\";\n }\n leaf plumbed-gw {\n type string;\n description\n \"Tunnel Gateway Name programmed to carry client traffic\";\n }\n leaf tunnel-ifid {\n type uint32;\n description\n \"Tunnel Gateway datapath index\";\n }\n }\n\n grouping client-dot11k-neighbor-list {\n description\n \"802.11k neighbor list\";\n leaf-list dot11k-neighbor {\n type yang:mac-address;\n max-elements \"9\";\n ordered-by user;\n description\n \"Neighbor Radio Identifier\";\n }\n }\n\n grouping ewlc-client-dot11-oper-data {\n description\n \"IEEE 802.11 operational data of the client\";\n leaf ms-mac-address {\n type yang:mac-address;\n description\n \"Mac Address of the Client\";\n }\n leaf ms-bssid {\n type yang:mac-address;\n description\n \"Basic Service Set Identifier to which the Mobile station is connected. MAC addresses are used as a network address for most IEEE 802 network technologies, including Ethernet, Wi-Fi and Bluetooth.\";\n }\n leaf ap-mac-address {\n type yang:mac-address;\n description\n \"MAC Address of the Access Point to which the client has joined. MAC addresses are used as a network address for most IEEE 802 network technologies, including Ethernet, Wi-Fi and Bluetooth.\";\n }\n leaf current-channel {\n type uint8;\n description\n \"Current Channel on which the wireless client is communicating with Access Point in the wireless LAN.\";\n }\n leaf ms-wlan-id {\n type uint32;\n description\n \"Wireless LAN ID to which the client is connected in the wireless network.\";\n }\n leaf vap-ssid {\n type string;\n description\n \"Service Set Identifier (SSID) of the Wireless LAN to which the client is connected.\";\n }\n leaf policy-profile {\n type string;\n description\n \"Policy profile applied on the Wireless LAN to which the wireless client is connected\";\n }\n leaf ms-ap-slot-id {\n type uint8;\n description\n \"Slot ID of the Acess Point Radio on which the wirless client is conected.\";\n }\n leaf radio-type {\n type wireless-client-types:ms-radio-type;\n description\n \"Type of the Radio of the AP to which the client is associated\";\n }\n leaf ms-assoc-time {\n type yang:date-and-time;\n description\n \"The time at which the association request is received from the mobile station to wireless LAN.\";\n }\n leaf is-11g-client {\n type boolean;\n description\n \"Flag indicating whether the client is connected through IEEE 802.11g protocol\";\n }\n container ms-wifi {\n description\n \"WiFi security of Mobile Station used during the association.\";\n uses wireless-client-oper:ms-wifi;\n }\n leaf ms-wme-enabled {\n type boolean;\n description\n \"Indicator whether Wireless Multimedia Extensions is enabled, or not\";\n }\n leaf dot11w-enabled {\n type boolean;\n description\n \"Flag indicator for IEEE 802.11w feature is enabled\";\n }\n container dot11k-neighbor-list {\n description\n \"802.11k neighbor list\";\n uses wireless-client-oper:client-dot11k-neighbor-list;\n }\n leaf ewlc-ms-phy-type {\n type wireless-client-types:ms-phy-radio-type;\n description\n \"Radio PHY type to which the wireless mobile station is connected\";\n }\n leaf encryption-type {\n type wireless-client-oper:encrypt-policy;\n description\n \"Encryption policy used by the client while communicating with Access Point.\";\n }\n leaf client-wep-policy-type {\n type wireless-client-types:client-wep-policy-type;\n description\n \"Client Wired Equivalent Privacy (WEP) policy type\";\n }\n leaf bss-trans-capable {\n type boolean;\n description\n \"Indicator whether the client is IEEE 802.11v capable\";\n }\n leaf ms-apple-capable {\n type boolean;\n description\n \"Indicator whether client has Fastlane Support\";\n }\n leaf wlan-profile {\n type string;\n description\n \"Profile applied on the Wireless/Remote LAN to which the client is connected\";\n }\n leaf dms-capable {\n type boolean;\n description\n \"Indicator if client is Directed Multicast Service (DMS) Capable\";\n }\n container eogre-client {\n description\n \"EoGRE Client information\";\n uses wireless-client-oper:ewlc-eogre-client;\n }\n }\n\n grouping mmif-client-mobility-history-entry {\n description\n \"Client association and mobility history data\";\n leaf instance-id {\n type uint32;\n description\n \"Wireless management process instance to which client has associated\";\n }\n leaf ms-ap-slot-id {\n type uint32;\n description\n \"Wireless access point slot ID to which client has connected\";\n }\n leaf ms-assoc-time {\n type yang:date-and-time;\n description\n \"Client association timestamp\";\n }\n leaf role {\n type wireless-mobility-types:mm-client-role;\n description\n \"Client mobility role\";\n }\n leaf bssid {\n type yang:mac-address;\n description\n \"BSSID to which client has associated\";\n }\n leaf ap-name {\n type string;\n description\n \"Name of wireless access point to which client has associated\";\n }\n }\n\n grouping mmif-client-mobility-history {\n description\n \"List of client's association and mobility history entries\";\n list entry {\n description\n \"Client association and mobility history entry\";\n uses wireless-client-oper:mmif-client-mobility-history-entry;\n }\n }\n\n grouping mmif-client-history {\n description\n \"Client association and mobility history\";\n leaf client-mac {\n type yang:mac-address;\n description\n \"Client MAC address\";\n }\n container mobility-history {\n description\n \"Client association and mobility history of client\";\n uses wireless-client-oper:mmif-client-mobility-history;\n }\n }\n\n grouping mmif-client-stats {\n description\n \"Mobility Interface client statistics\";\n leaf client-mac {\n type yang:mac-address;\n description\n \"MAC Address of the wireless client. MAC addresses are used as a network address for most IEEE 802 network technologies, including Ethernet, Wi-Fi and Bluetooth.\";\n }\n container mblty-stats {\n description\n \"Mobility Interface mobility event statistics\";\n uses wireless-mobility-types:mmif-mobility-stats;\n }\n list ipc-stats {\n max-elements \"255\";\n description\n \"Inter-process messaging statistics for mobility control CAPWAP messages\";\n uses wireless-mobility-types:mm-msg-stats;\n }\n }\n\n grouping ewlc-mafsm-oper-data {\n description\n \"Client mobility data\";\n leaf ms-mac-addr {\n type yang:mac-address;\n description\n \"MAC address of wireless mobile station\";\n }\n leaf mm-client-role {\n type wireless-mobility-types:mm-client-role;\n description\n \"Mobility role of wireless mobile stations on Wireless LAN Controller\";\n }\n leaf mm-client-roam-type {\n type wireless-mobility-types:mm-client-roam-type;\n description\n \"Roam type indicates Layer 2 or Layer 3 mobility roam by client\";\n }\n leaf mm-instance {\n type uint32;\n description\n \"Move count of client indicating number of inter-controller roams performed by client\";\n }\n leaf mm-complete-timestamp {\n type yang:date-and-time;\n description\n \"Timestamp at which mobility discovery was completed for client\";\n }\n leaf mm-remote-tunnel-ip {\n type inet:ip-address;\n description\n \"Primary IP address of mobility peer for an anchor or foreign client\";\n }\n leaf mm-remote-tunnel-sec-ip {\n type inet:ip-address;\n description\n \"Secondary IP address of mobility peer for an anchor or foreign client\";\n }\n leaf mm-remote-platform-id {\n type uint8;\n description\n \"Platform ID of mobility peer for an anchor or foreign client\";\n }\n leaf mm-remote-tunnel-id {\n type uint32;\n description\n \"Mobility peer tunnel identifier for an anchor or foreign client\";\n }\n leaf mm-anchor-ip {\n type inet:ip-address;\n description\n \"Anchor wireless LAN controller's address for a foreign client\";\n }\n }\n\n grouping ewlc-client-wlan-policy {\n description\n \"Client WLAN policy\";\n leaf current-switching-mode {\n type wireless-client-oper:client-switching-mode;\n description\n \"Client traffic can be switched locally from Access Point or Centrally from the Wireless LAN Controller. Current switching mode indicates the type of switched used for the client traffic\";\n }\n leaf wlan-switching-mode {\n type wireless-client-oper:client-switching-mode;\n description\n \"All clients joined the Wireless LAN will have the same traffic switching mode. Wlan switching mode, which is initialized based on the WLAN properties\";\n }\n leaf central-authentication {\n type wireless-client-oper:client-authentication-type;\n description\n \"Indicator of whether the client is centrally through Wireless LAN Controller or locally through Access Point authenticated. NA for clients connected to Local Mode Access Points\";\n }\n leaf central-dhcp {\n type boolean;\n description\n \"Indicator of whether the client is centrally through Wireless LAN Controller or locally through Access Point gets IP address using DHCP.\";\n }\n leaf central-assoc-enable {\n type boolean;\n description\n \"Indicator of whether the client is centrally through Wireless LAN Controller or locally through Access Point gets Associated to the Wireless LAN.\";\n }\n leaf vlan-central-switching {\n type boolean;\n description\n \"Client traffic can be switched locally from Access Point or Centrally from the Wireless LAN Controller. Vlan based switching mode indicates the client traffic is switched based on the vlan using central switching mode.\";\n }\n leaf is-fabric-client {\n type boolean;\n description\n \"Indicator of whether the client is associated to Wireless WLAN broadcasted by Access Point in the Fabric Network.\";\n }\n leaf is-guest-fabric-client {\n type boolean;\n description\n \"Indicator of whether the client is associated to Guest Wireless WLAN broadcasted by Access Point in the Fabric Network.\";\n }\n }\n\n grouping ewlc-client-common-oper-data {\n description\n \"Client Common Operational Data\";\n leaf client-mac {\n type yang:mac-address;\n description\n \"MAC Address of the wireless mobile station. MAC addresses are used as a network address for most IEEE 802 network technologies, including Ethernet, Wi-Fi and Bluetooth.\";\n }\n leaf ap-name {\n type string;\n description\n \"The Access Point name to which the client is connected in the Wireless Network\";\n }\n leaf ms-ap-slot-id {\n type uint8;\n description\n \"The Radio Slot on the Access Point to which the client is connected in the Wireless Network\";\n }\n leaf ms-radio-type {\n type wireless-client-types:ms-phy-radio-type;\n description\n \"The Wireless Radio type of the client using which it has connected to the Access Point in the Wireless Network\";\n }\n leaf wlan-id {\n type uint32;\n description\n \"Wireless LAN Id indicates the unique Wireless LAN to which the client is connected\";\n }\n leaf client-type {\n type wireless-client-types:ms-client-type;\n description\n \"Client traffic can be switched locally from Access Point in HREAP mode or Centrally from the Wireless LAN Controller in the Local mode. Client Type indicates the wireless network type to which the client is connected based on the traffic switching type.\";\n }\n leaf co-state {\n type wireless-client-types:client-co-state;\n description\n \"The state of the client indicates the last phase of the association the client has been able to complete successfully.\";\n }\n leaf aaa-override-passphrase {\n type boolean;\n description\n \"AAA override passphrase enabled\";\n }\n leaf is-tvi-enabled {\n type boolean;\n description\n \"The Encrypted Traffic Analytics can be enabled on Wireless LANs. This flag indicates the enablement of the Entrypted Traffic Analytics for the client.\";\n }\n container wlan-policy {\n description\n \"Wireless LAN policy inherited by the wireless client after joining to the Wireless LAN.\";\n uses wireless-client-oper:ewlc-client-wlan-policy;\n }\n }\n\n grouping ewlc-client-stats-oper-data {\n description\n \"Client Statistical Operational data\";\n leaf ms-mac-address {\n type yang:mac-address;\n description\n \"MAC Address of the wireless mobile station. MAC addresses are used as a network address for most IEEE 802 network technologies, including Ethernet, Wi-Fi and Bluetooth.\";\n }\n leaf bytes-rx {\n type uint64;\n description\n \"The number of bytes of wireless data traffic received by the Mobile station on a particular Wireless LAN.\";\n }\n leaf bytes-tx {\n type uint64;\n description\n \"The number of bytes of wireless data traffic transmitted by the Mobile station on a particular Wireless LAN.\";\n }\n leaf pkts-rx {\n type uint64;\n description\n \"The number of packets of wireless data traffic received by the Mobile station on a particular Wireless LAN.\";\n }\n leaf pkts-tx {\n type uint64;\n description\n \"The number of packets of wireless data traffic transmitted by the Mobile station on a particular Wireless LAN.\";\n }\n leaf data-retries {\n type uint64;\n description\n \"The number of retries a wireless mobile station has executed for the wireless data traffic on a particular Wireless LAN.\";\n }\n leaf mic-mismatch {\n type uint64;\n description\n \"The number of packets from wireless mobile station for which Message Integrity Check (MIC) mismatch occured on a particular Wireless LAN.\";\n }\n leaf mic-missing {\n type uint64;\n description\n \"The number of packets from wireless mobile station for which Message Integrity Check (MIC) missing occured on a particular Wireless LAN.\";\n }\n leaf most-recent-rssi {\n type int8;\n description\n \"RSSI is the relative received signal strength in a wireless environment, is an indication of the power level being received by the receive radio after the antenna and possible cable loss. Last updated Radio Signal Strength indicator is recorded.\";\n }\n leaf most-recent-snr {\n type uint8;\n description\n \"Signal-to-noise ratio (abbreviated SNR or S/N) is a measure used in science and engineering that compares the level of a desired signal to the level of background noise. Last updated Signal To Noise Ratio is recorded.\";\n }\n }\n\n container client-oper-data {\n config false;\n description\n \"Root container of wireless client operational parameters\";\n list common-oper-data {\n key \"client-mac\";\n description\n \"List containing common operational data of the client\";\n uses wireless-client-oper:ewlc-client-common-oper-data;\n }\n list dot11-oper-data {\n key \"ms-mac-address\";\n description\n \"Container for capturing the 802.11 operational data of the client\";\n uses wireless-client-oper:ewlc-client-dot11-oper-data;\n }\n list mobility-oper-data {\n key \"ms-mac-addr\";\n description\n \"Container for capturing mobility operational data of client\";\n uses wireless-client-oper:ewlc-mafsm-oper-data;\n }\n list mm-if-client-stats {\n key \"client-mac\";\n description\n \"Container for capturing client Mobility Interface stats\";\n uses wireless-client-oper:mmif-client-stats;\n }\n list mm-if-client-history {\n key \"client-mac\";\n description\n \"Container for capturing client mobility history\";\n uses wireless-client-oper:mmif-client-history;\n }\n list traffic-stats {\n key \"ms-mac-address\";\n description\n \"Container for capturing the client traffic statistics info\";\n uses wireless-client-oper:ewlc-client-stats-oper-data;\n }\n }\n}\n"} +{"text": "import { module, test } from 'qunit';\nimport { setupTest } from 'ember-qunit';\nimport moment from 'moment';\nimport d3Format from 'd3-format';\nimport d3TimeFormat from 'd3-time-format';\n\nmodule('Unit | Component | stats-time-series', function(hooks) {\n setupTest(hooks);\n\n const ts = (offset, resolution = 'm') =>\n moment()\n .subtract(offset, resolution)\n .toDate();\n\n const wideData = [\n { timestamp: ts(20), percent: 0.5 },\n { timestamp: ts(18), percent: 0.5 },\n { timestamp: ts(16), percent: 0.4 },\n { timestamp: ts(14), percent: 0.3 },\n { timestamp: ts(12), percent: 0.9 },\n { timestamp: ts(10), percent: 0.3 },\n { timestamp: ts(8), percent: 0.3 },\n { timestamp: ts(6), percent: 0.4 },\n { timestamp: ts(4), percent: 0.5 },\n { timestamp: ts(2), percent: 0.6 },\n { timestamp: ts(0), percent: 0.6 },\n ];\n\n const narrowData = [\n { timestamp: ts(20, 's'), percent: 0.5 },\n { timestamp: ts(18, 's'), percent: 0.5 },\n { timestamp: ts(16, 's'), percent: 0.4 },\n { timestamp: ts(14, 's'), percent: 0.3 },\n { timestamp: ts(12, 's'), percent: 0.9 },\n { timestamp: ts(10, 's'), percent: 0.3 },\n ];\n\n const unboundedData = [\n { timestamp: ts(20, 's'), percent: -0.5 },\n { timestamp: ts(18, 's'), percent: 1.5 },\n ];\n\n const nullData = [\n { timestamp: ts(20, 's'), percent: null },\n { timestamp: ts(18, 's'), percent: null },\n ];\n\n test('xFormat is time-formatted for hours, minutes, and seconds', function(assert) {\n const chart = this.owner.factoryFor('component:stats-time-series').create();\n\n chart.set('data', wideData);\n\n wideData.forEach(datum => {\n assert.equal(\n chart.xFormat()(datum.timestamp),\n d3TimeFormat.timeFormat('%H:%M:%S')(datum.timestamp)\n );\n });\n });\n\n test('yFormat is percent-formatted', function(assert) {\n const chart = this.owner.factoryFor('component:stats-time-series').create();\n\n chart.set('data', wideData);\n\n wideData.forEach(datum => {\n assert.equal(chart.yFormat()(datum.percent), d3Format.format('.1~%')(datum.percent));\n });\n });\n\n test('x scale domain is at least five minutes', function(assert) {\n const chart = this.owner.factoryFor('component:stats-time-series').create();\n\n chart.set('data', narrowData);\n\n assert.equal(\n +chart.get('xScale').domain()[0],\n +moment(Math.max(...narrowData.mapBy('timestamp')))\n .subtract(5, 'm')\n .toDate(),\n 'The lower bound of the xScale is 5 minutes ago'\n );\n });\n\n test('x scale domain is greater than five minutes when the domain of the data is larger than five minutes', function(assert) {\n const chart = this.owner.factoryFor('component:stats-time-series').create();\n\n chart.set('data', wideData);\n\n assert.equal(\n +chart.get('xScale').domain()[0],\n Math.min(...wideData.mapBy('timestamp')),\n 'The lower bound of the xScale is the oldest timestamp in the dataset'\n );\n });\n\n test('y scale domain is typically 0 to 1 (0 to 100%)', function(assert) {\n const chart = this.owner.factoryFor('component:stats-time-series').create();\n\n chart.set('data', wideData);\n\n assert.deepEqual(\n [Math.min(...wideData.mapBy('percent')), Math.max(...wideData.mapBy('percent'))],\n [0.3, 0.9],\n 'The bounds of the value prop of the dataset is narrower than 0 - 1'\n );\n\n assert.deepEqual(\n chart.get('yScale').domain(),\n [0, 1],\n 'The bounds of the yScale are still 0 and 1'\n );\n });\n\n test('the extent of the y domain overrides the default 0 to 1 domain when there are values beyond these bounds', function(assert) {\n const chart = this.owner.factoryFor('component:stats-time-series').create();\n\n chart.set('data', unboundedData);\n\n assert.deepEqual(\n chart.get('yScale').domain(),\n [-0.5, 1.5],\n 'The bounds of the yScale match the bounds of the unbounded data'\n );\n\n chart.set('data', [unboundedData[0]]);\n\n assert.deepEqual(\n chart.get('yScale').domain(),\n [-0.5, 1],\n 'The upper bound is still the default 1, but the lower bound is overridden due to the unbounded low value'\n );\n\n chart.set('data', [unboundedData[1]]);\n\n assert.deepEqual(\n chart.get('yScale').domain(),\n [0, 1.5],\n 'The lower bound is still the default 0, but the upper bound is overridden due to the unbounded high value'\n );\n });\n\n test('when there are only empty frames in the data array, the default y domain is used', function(assert) {\n const chart = this.owner.factoryFor('component:stats-time-series').create();\n\n chart.set('data', nullData);\n\n assert.deepEqual(chart.get('yScale').domain(), [0, 1], 'The bounds are 0 and 1');\n });\n});\n"} +{"text": "module.exports = {\n build: {\n expand: true,\n cwd: 'dist/views',\n src: '**/*.html',\n dest: 'dist/views'\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#ifndef EIGEN_CXX11_TENSOR_TENSOR_CONTRACTION_BLOCKING_H\n#define EIGEN_CXX11_TENSOR_TENSOR_CONTRACTION_BLOCKING_H\n\n\nnamespace Eigen {\nnamespace internal {\n\nenum {\n ShardByRow = 0,\n ShardByCol = 1\n};\n\n\n// Default Blocking Strategy\ntemplate \nclass TensorContractionBlocking {\n public:\n\n typedef typename LhsMapper::Scalar LhsScalar;\n typedef typename RhsMapper::Scalar RhsScalar;\n\n EIGEN_DEVICE_FUNC TensorContractionBlocking(Index k, Index m, Index n, Index num_threads = 1) :\n kc_(k), mc_(m), nc_(n)\n {\n if (ShardingType == ShardByCol) {\n computeProductBlockingSizes(kc_, mc_, nc_, num_threads);\n }\n else {\n computeProductBlockingSizes(kc_, nc_, mc_, num_threads);\n }\n }\n\n EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index kc() const { return kc_; }\n EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index mc() const { return mc_; }\n EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index nc() const { return nc_; }\n\n private:\n Index kc_;\n Index mc_;\n Index nc_;\n};\n\n\n} // end namespace internal\n} // end namespace Eigen\n\n#endif // EIGEN_CXX11_TENSOR_TENSOR_CONTRACTION_BLOCKING_H\n"} +{"text": "/*-----------------------------------------------------------*/\n/* Block Sorting, Lossless Data Compression Library. */\n/* Interface to Sort Transform (GPU version) */\n/*-----------------------------------------------------------*/\n\n/*--\n\nThis file is a part of bsc and/or libbsc, a program and a library for\nlossless, block-sorting data compression.\n\n Copyright (c) 2009-2012 Ilya Grebnov \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\nPlease see the file LICENSE for full copyright information and file AUTHORS\nfor full list of contributors.\n\nSee also the bsc and libbsc web site:\n http://libbsc.com/ for more information.\n\n--*/\n\n/*--\n\nSort Transform is patented by Michael Schindler under US patent 6,199,064.\nHowever for research purposes this algorithm is included in this software.\nSo if you are of the type who should worry about this (making money) worry away.\nThe author shall have no liability with respect to the infringement of\ncopyrights, trade secrets or any patents by this software. In no event will\nthe author be liable for any lost revenue or profits or other special,\nindirect and consequential damages.\n\nSort Transform is disabled by default and can be enabled by defining the\npreprocessor macro LIBBSC_SORT_TRANSFORM_SUPPORT at compile time.\n\n--*/\n\n#ifndef _LIBBSC_ST_CUH\n#define _LIBBSC_ST_CUH\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#if defined(LIBBSC_SORT_TRANSFORM_SUPPORT) && defined(LIBBSC_CUDA_SUPPORT)\n\n /**\n * You should call this function before you call any of the other functions in st.\n * @param features - the set of additional features.\n * @return LIBBSC_NO_ERROR if no error occurred, error code otherwise.\n */\n int bsc_st_cuda_init(int features);\n\n /**\n * Constructs the Sort Transform of order k transformed string of a given string.\n * @param T - the input/output string of n chars.\n * @param n - the length of the given string.\n * @param k[3..8] - the order of Sort Transform.\n * @param features - the set of additional features.\n * @return the primary index if no error occurred, error code otherwise.\n */\n int bsc_st_encode_cuda(unsigned char * T, int n, int k, int features);\n\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n/*-----------------------------------------------------------*/\n/* End st.cuh */\n/*-----------------------------------------------------------*/\n"} +{"text": "/*\n * Copyright (C) STMicroelectronics SA 2014\n * Author: Benjamin Gaignard for STMicroelectronics.\n * License terms: GNU General Public License (GPL), version 2\n */\n\n#ifndef _STI_VTG_H_\n#define _STI_VTG_H_\n\n#define VTG_TOP_FIELD_EVENT 1\n#define VTG_BOTTOM_FIELD_EVENT 2\n\n#define VTG_SYNC_ID_HDMI 1\n#define VTG_SYNC_ID_HDDCS 2\n#define VTG_SYNC_ID_HDF 3\n#define VTG_SYNC_ID_DVO 4\n\nstruct sti_vtg;\nstruct drm_display_mode;\nstruct notifier_block;\n\nstruct sti_vtg *of_vtg_find(struct device_node *np);\nvoid sti_vtg_set_config(struct sti_vtg *vtg,\n\t\tconst struct drm_display_mode *mode);\nint sti_vtg_register_client(struct sti_vtg *vtg, struct notifier_block *nb,\n\t\t\t struct drm_crtc *crtc);\nint sti_vtg_unregister_client(struct sti_vtg *vtg,\n\t\tstruct notifier_block *nb);\n\nu32 sti_vtg_get_line_number(struct drm_display_mode mode, int y);\nu32 sti_vtg_get_pixel_number(struct drm_display_mode mode, int x);\n\n#endif\n"} +{"text": "import math\nimport tables\nimport unicode\nimport hashes\nimport times\nimport algorithm\nimport strutils\n\nimport nico/keycodes\nexport Keycode\nexport Scancode\n\n# Constants\n\nconst maxPaletteSize* = 256\nconst nAudioChannels* = 16\nconst deadzone* = int16.high div 2\nconst gifScale* = 2\nconst maxPlayers* = 4\nconst recordingEnabled* = true\nconst musicBufferSize* = 4096\n\n# TYPES\n\ntype TouchState* = enum\n tsStarted\n tsHeld\n tsMoved\n tsEnded\n tsCancelled\n\ntype Touch* = object\n id*: int\n x*,y*: int\n sx*,sy*: float32\n xrel*,yrel*: float32\n xrelraw*,yrelraw*: float32\n state*: TouchState\n\ntype Palette* = tuple\n size: int\n data: array[maxPaletteSize, tuple[r,g,b: uint8]]\n\nproc hash*(a: Keycode): Hash =\n var h: Hash = 0\n h = h !& a.cint\n result = !$h\n\nimport nico/controller\nimport nico/ringbuffer\n\nvar keysDown* = initTable[Keycode, uint32]() # keysDown[keycode] = numbersOfFramesHeldDown, 1 == first frame held down\nvar aKeyWasPressed*: bool\nvar aKeyWasReleased*: bool\n\ntype KeyListener* = proc(sym: int, mods: uint16, scancode: int, down: bool): bool\n\ntype\n Pint* = int32\n Pfloat* = float32\n ColorId* = int\n\n Rect* = tuple\n x,y,w,h: int\n\n Font* = ref object\n rects*: Table[Rune,Rect]\n data*: seq[uint8]\n w*,h*: int\n\n FontId* = range[0..15]\n MusicId* = range[-1..63]\n SfxId* = range[-1..63]\n\ntype AudioChannelId* = range[-1..nAudioChannels.high]\nconst audioChannelAuto* = -1.AudioChannelId\n\ntype\n ChannelKind* = enum\n channelNone\n channelSynth\n channelWave\n channelMusic\n channelCallback\n\n SynthShape* = enum\n synSame = \"-\"\n synSin = \"sin\"\n synSqr = \"sqr\"\n synP12 = \"p12\"\n synP25 = \"p25\"\n synSaw = \"saw\"\n synTri = \"tri\"\n synNoise = \"noi\"\n synNoise2 = \"met\"\n synWav = \"wav\" # use custom waveform\n\n SynthDataStep* = tuple\n note: uint8\n volume: uint8\n shape: SynthShape\n\n SynthData* = tuple\n speed: uint8\n steps: array[32,SynthDataStep]\n length: uint8\n loop: uint8\n\nproc synthDataToString*(sd: SynthData): string =\n var length = 0\n for i in 0.. 0:\n length += 1\n result &= sd.speed.int.toHex(1)\n result &= sd.loop.int.toHex(1)\n for i in 0.. sdstr.high:\n break\n let noteStr = sdstr[2+i*4+0..2+i*4+1]\n result.steps[i].note = fromHex[uint8](noteStr)\n let volumeStr = sdstr[2+i*4+2..2+i*4+2]\n result.steps[i].volume = fromHex[uint8](volumeStr)\n let shapeStr = sdstr[2+i*4+3..2+i*4+3]\n result.steps[i].shape = fromHex[uint8](shapeStr).SynthShape\n length += 1\n result.length = length.uint8\n\nproc note*(n: int): Pfloat =\n # takes a note integer and converts it to a frequency float32\n # synth(0, sin, note(48))\n return pow(2.0, ((n.float32 - 69.0) / 12.0)) * 440.0\n\nproc noteToNoteStr*(value: int): string =\n let oct = value div 12 - 1\n case value mod 12:\n of 0:\n return \"C-\" & $oct\n of 1:\n return \"C#\" & $oct\n of 2:\n return \"D-\" & $oct\n of 3:\n return \"D#\" & $oct\n of 4:\n return \"E-\" & $oct\n of 5:\n return \"F-\" & $oct\n of 6:\n return \"F#\" & $oct\n of 7:\n return \"G-\" & $oct\n of 8:\n return \"G#\" & $oct\n of 9:\n return \"A-\" & $oct\n of 10:\n return \"A#\" & $oct\n of 11:\n return \"B-\" & $oct\n else:\n return \"???\"\n\nproc noteStrToNote*(s: string): int =\n let noteChar = s[0]\n let note = case noteChar\n of 'C': 0\n of 'D': 2\n of 'E': 4\n of 'F': 5\n of 'G': 7\n of 'A': 9\n of 'B': 11\n else: 0\n let sharp = s[1] == '#'\n let octave = parseInt($s[2])\n return 12 * octave + note + (if sharp: 1 else: 0)\n\nproc note*(n: string): Pfloat =\n return note(noteStrToNote(n))\n\n# low level events\ntype\n EventKind* = enum\n ekMouseButtonDown\n ekMouseButtonUp\n ekMouseMotion\n ekKeyDown\n ekKeyUp\n ekMouseWheel\n ekTextInput\n ekTextEditing\n ekButtonDown\n ekButtonUp\n ekAxisMotion\n\n Event* = object\n kind*: EventKind\n button*: uint8\n x*,y*: int\n xrel*,yrel*: float32\n keycode*: Keycode\n scancode*: Scancode\n mods*: uint16\n clicks*: uint8\n repeat*: int\n ywheel*: int\n text*: string\n which*: uint8\n\n EventListener* = proc(e: Event): bool # takes a single event and returns true if it's handled or false if not\n\ntype\n Surface* = ref object\n data*: seq[uint8]\n channels*: int\n w*,h*: int\n tw*,th*: int\n filename*: string\n spriteFlags*: seq[uint8]\n\nproc set*(s: Surface, x,y: int, v: uint8) =\n if x < 0 or y < 0 or x >= s.w or y >= s.h:\n return\n s.data[y * s.w + x] = v\n\nproc get*(s: Surface, x,y: int): uint8 =\n if x < 0 or y < 0 or x >= s.w or y >= s.h:\n return 0\n return s.data[y * s.w + x]\n\ntype\n Tilemap* = object\n data*: seq[uint8]\n w*,h*: int\n hex*: bool\n hexOffset*: int\n tw*,th*: int\n\ntype\n LineIterator = iterator(): (Pint,Pint)\n Edge = tuple[xint, xfrac, dxint, dxfrac, dy, life: int]\n\n\ntype ResizeFunc* = proc(x,y: int)\n\n## CONVERTERS\n\nconverter toFloat32*(x: float): float32 {.inline.} =\n return x.float32\n\nconverter toPint*(x: float): Pint {.inline.} =\n return floor(x).Pint\n\nconverter toPint*(x: float32): Pint {.inline.} =\n return floor(x).Pint\n\nconverter toPint*(x: SomeInteger): Pint {.inline.} =\n return x.Pint\n\nconverter toPfloat*(x: float): Pfloat {.inline.} =\n return x.Pfloat\n\n## GLOBALS\n##\n\nvar currentPalette*: Palette\n\nvar touches*: seq[Touch]\nvar touchMouseEmulation* = false\n\nvar masterVolume* = 1.0'f\nvar sfxVolume* = 1.0'f\nvar musicVolume* = 1.0'f\n\nvar sampleRate* = 44100.0'f\nvar invSampleRate* = 1.0'f / sampleRate\n\nvar tickFunc*: proc() = nil\n\nvar currentBpm*: Natural = 128\nvar currentTpb*: Natural = 4\n\nvar initialized*: bool\nvar running*: bool\n\nvar keyListeners*: seq[KeyListener] = @[]\nvar eventListeners*: seq[EventListener] = @[]\n\nvar loading*: int # number of resources loading\n\nvar cursorX* = 0\nvar cursorY* = 0\n\nvar swCanvas*: Surface\n\nvar stencilBuffer*: Surface\ntype StencilMode* = enum\n stencilAlways,\n stencilEqual,\n stencilLess,\n stencilGreater,\n stencilLEqual,\n stencilGEqual,\n stencilNot,\nvar stencilMode*: StencilMode\nvar stencilWrite*: bool\nvar stencilRef*: uint8\n\nvar targetScreenWidth* = 128\nvar targetScreenHeight* = 128\n\nvar fixedScreenSize* = true\nvar integerScreenScale* = false\n\nvar screenWidth* = 128\nvar screenHeight* = 128\n\nvar screenPaddingX* = 0\nvar screenPaddingY* = 0\n\nvar keymap*: array[NicoButton, seq[int]]\n\nvar controllerAddedFunc*: proc(controller: NicoController)\nvar controllerRemovedFunc*: proc(controller: NicoController)\n\nvar controllers*: seq[NicoController]\n\nvar focused* = true\nvar recordSeconds* = 30\nvar fullSpeedGif* = true\n\nvar mixerChannels* = 0\n\nvar gDitherPattern*: uint16 = 0b1111_1111_1111_1111\n\n\nvar frameRate* = 60\nvar timeStep* = 1/frameRate\nvar frameMult* = 1\n\nvar basePath*: string # should be the current dir with the app\nvar assetPath*: string # basepath + \"/assets\"\nvar writePath*: string # should be a writable dir\n\nvar screenScale* = 4.0\nvar spritesheets*: array[16,Surface]\nvar spritesheet*: Surface\n\nvar tilemaps*: array[16,Tilemap]\nvar currentTilemap*: ptr Tilemap\n\nvar initFunc*: proc()\nvar updateFunc*: proc(dt: Pfloat)\nvar drawFunc*: proc()\nvar textFunc*: proc(text: string): bool\nvar resizeFuncs*: seq[ResizeFunc]\n\nvar fonts*: array[FontId, Font]\nvar currentFont*: Font\nvar currentFontId*: FontId\n\nvar frame* = 0\n\nvar cameraX*: Pint = 0\nvar cameraY*: Pint = 0\n\nvar paletteMapDraw*: array[maxPaletteSize, ColorId]\nvar paletteMapDisplay*: array[maxPaletteSize, ColorId]\nvar paletteTransparent*: array[maxPaletteSize, bool]\n\nfor i in 0.. 4 or surface.channels < 3:\n raise newException(Exception, \"Converting non RGBA surface to indexed\")\n echo \"channels: \", surface.channels\n result = new(Surface)\n result.data = newSeq[uint8](surface.w*surface.h)\n result.w = surface.w\n result.h = surface.h\n result.channels = 1\n if surface.channels == 3:\n for i in 0.. int:\n cmp(b.time, a.time)\n for c in n.children.mitems:\n c.sortChildren()\n\n proc profileBegin*(name: string) =\n if not profileCollect:\n return\n let now = getTime()\n profileStack.add((name, profilePath, now))\n profilePath &= \"/\" & name\n\n currentProfilerNode.children.add(ProfilerNode(name: name, start: now, count: 1, parent: currentProfilerNode))\n currentProfilerNode = currentProfilerNode.children[^1].addr\n\n proc profileEnd*() =\n if not profileCollect:\n return\n let now = getTime()\n #var top = profileStack.pop()\n #if not profileData.hasKey(profilePath):\n # profileData[profilePath] = 0\n #profileData[profilePath] += (now - top.time).inNanoseconds\n #profilePath = top.path\n\n currentProfilerNode.time = (now - currentProfilerNode.start).inNanoseconds\n currentProfilerNode = currentProfilerNode.parent\n\n proc profileStartFrame*() =\n if not profileCollect:\n return\n\n rootProfilerNode = ProfilerNode(name: \"\", parent: nil, start: getTime())\n currentProfilerNode = rootProfilerNode.addr\n #profilePath = \"\"\n #for k,v in profileData:\n # profileData[k] = 0\n\n proc profileEndFrame*() =\n if not profileCollect:\n return\n\n if currentProfilerNode == nil:\n return\n assert(currentProfilerNode == rootProfilerNode.addr)\n\n let now = getTime()\n currentProfilerNode.time = (now - currentProfilerNode.start).inNanoseconds\n\n\n # go through each node and sort siblings by time\n #currentProfilerNode[].sortChildren()\n\n lastProfileStats = currentProfilerNode[]\n profileHistory.add(currentProfilerNode[])\n\n proc dumpNode(n: ProfilerNode, depth = 0) =\n echo \" \".repeat(depth), (if n.name == \"\": \"root\" else: n.name), \": \", n.time\n for c in n.children:\n dumpNode(c, depth + 1)\n\n #dumpNode(currentProfilerNode[])\n\n #var stats = newSeq[tuple[name: string, time: int64]]()\n #for k,v in profileData:\n # stats.add((k,v))\n # profileDataHistory[(k,profileFrame)] = v\n\n #stats.sort do(a,b: tuple[name: string, time: int64]) -> int:\n # result = cmp(b.time, a.time)\n\n #result = stats\n profileFrame.inc()\n if profileFrame mod 16 == 0:\n profileFrame = 0\n\n proc profileGetLastStats*(): ProfilerNode =\n return lastProfileStats\n\n proc profileGetLastStatsPeak*(): seq[tuple[name: string, time: int64]] =\n var peakTable = initTable[string,int64](64)\n for k,time in profileDataHistory:\n let (key,frame) = k\n if not peakTable.hasKey(key):\n peakTable[key] = 0\n if time > peakTable[key]:\n peakTable[key] = time\n\n var stats = newSeq[tuple[name: string, time: int64]]()\n for k,v in peakTable:\n stats.add((k,v))\n\n stats.sort do(a,b: tuple[name: string, time: int64]) -> int:\n result = cmp(b.time, a.time)\n\n result = stats\n\nelse:\n template profileBegin*(name: untyped): untyped =\n discard\n\n template profileEnd*(): untyped =\n discard\n\n template profileStartFrame*(): untyped =\n discard\n\n template profileEndFrame*(): untyped =\n discard\n\n proc profileGetLastStats*(): seq[tuple[name: string, time: int64]] =\n return @[]\n\n proc profileGetLastStatsPeak*(): seq[tuple[name: string, time: int64]] =\n return @[]\n"} +{"text": "TEST = test\nOBJS = test.o base32.o base64.o common.o read.o dns.o encoding.o login.o user.o fw_query.o\nSRCOBJS = ../src/base32.o ../src/base64.o ../src/common.o ../src/read.o ../src/dns.o ../src/encoding.o ../src/login.o ../src/md5.o ../src/user.o ../src/fw_query.o\n\nOS = `uname | tr \"a-z\" \"A-Z\"`\n\nCHECK_PATH = /usr/local\nLDFLAGS = -L$(CHECK_PATH)/lib `pkg-config check --libs` -lpthread `sh ../src/osflags $(TARGETOS) link`\nCFLAGS = -std=c99 -g -Wall -D$(OS) `pkg-config check --cflags` -I../src -I$(CHECK_PATH)/include -pedantic `sh ../src/osflags $(TARGETOS) cflags`\n\nall: $(TEST)\n\t@LD_LIBRARY_PATH=${CHECK_PATH}/lib ./$(TEST)\n\n$(TEST): $(OBJS) $(SRCOBJS)\n\t@echo LD $(TEST)\n\t@$(CC) -o $@ $(SRCOBJS) $(OBJS) $(LDFLAGS)\n\n.c.o:\n\t@echo CC $<\n\t@$(CC) $(CFLAGS) -c $<\n\nclean:\n\t@echo \"Cleaning tests/\"\n\t@rm -f *~ *.core $(TEST) $(OBJS)\n\n"} +{"text": "/**\n * Pinch\n * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * @constructor\n * @extends AttrRecognizer\n */\nfunction PinchRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(PinchRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof PinchRecognizer\n */\n defaults: {\n event: 'pinch',\n threshold: 0,\n pointers: 2\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_NONE];\n },\n\n attrTest: function(input) {\n return this._super.attrTest.call(this, input) &&\n (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);\n },\n\n emit: function(input) {\n if (input.scale !== 1) {\n var inOut = input.scale < 1 ? 'in' : 'out';\n input.additionalEvent = this.options.event + inOut;\n }\n this._super.emit.call(this, input);\n }\n});\n"} +{"text": "\n\n\n"} +{"text": "_should_ is an expressive, readable, test framework agnostic, assertion library for [node](http://nodejs.org).\n \nIt extends the Object prototype with a single non-enumerable getter that allows you to express how that object should behave.\n\n_should_ literally extends node's _assert_ module, in fact, it is node's assert module, for example `should.equal(str, 'foo')` will work, just as `assert.equal(str, 'foo')` would, and `should.AssertionError` **is** `asset.AssertionError`, meaning any test framework supporting this constructor will function properly with _should_.\n\n## Example\n\n var user = {\n name: 'tj'\n , pets: ['tobi', 'loki', 'jane', 'bandit']\n };\n\n user.should.have.property('name', 'tj');\n user.should.have.property('pets').with.lengthOf(4)\n \n someAsyncTask(foo, function (err, result) {\n should.not.exist(err);\n should.exist(result);\n result.bar.should.equal(foo);\n });\n\n## Installation\n\n $ npm install should\n\n## assert extras\n\nAs mentioned above, _should_ extends node's _assert_. The returned object from `require('should')` is thus similar to the returned object from `require('assert')`, but it has one extra convenience method:\n\n should.exist('hello')\n should.exist([])\n should.exist(null) // will throw\n\nThis is equivalent to `should.ok`, which is equivalent to `assert.ok`, but reads a bit better. It gets better, though:\n\n should.not.exist(false)\n should.not.exist('')\n should.not.exist({}) // will throw\n\nWe may add more _assert_ extras in the future... ;)\n\n## modifiers\n\n _should_'s assertion chaining provides an expressive way to build up an assertion, along with dummy getters such as _an_, _have_, and _be_, provided are what I am simply calling **modifiers**, which have a meaning effect on the assertion. An example of this is the _not_ getter, which negates the meaning, aka `user.should.not.have.property('name')`. In the previous example note the use of _have_, as we could omit it and still construct a valid assertion.\n\nSome modifiers such as _include_ only have an effect with specific assertion methods, for example when asserting a substring like so: `str.should.include.string('test')`, we could omit _include_, but it helps express the meaning, however _keys_ has a strict effect, unless the _include_ modifier is used.\n\n## chaining assertions\n\nSome assertions can be chained, for example if a property is volatile we can first assert property existence:\n\n user.should.have.property('pets').with.lengthOf(4)\n\nwhich is essentially equivalent to below, however the property may not exist:\n\n user.pets.should.have.lengthOf(4)\n\nour dummy getters such as _and_ also help express chaining:\n\n user.should.be.a('object').and.have.property('name', 'tj')\n\n## exist (static)\n\nThe returned object from `require('should')` is the same object as `require('assert')`. So you can use `should` just like `assert`:\n\n should.fail('expected an error!')\n should.strictEqual(foo, bar)\n\nIn general, using the Object prototype's _should_ is nicer than using these `assert` equivalents, because _should_ gives you access to the expressive and readable language described above:\n\n foo.should.equal(bar) // same as should.strictEqual(foo, bar) above\n\nThe only exception, though, is when you can't be sure that a particular object exists. In that case, attempting to access the _should_ property may throw a TypeError:\n\n foo.should.equal(bar) // throws if foo is null or undefined!\n\nFor this case, `require('should')` extends `require('assert')` with an extra convenience method to check whether an object exists:\n\n should.exist({})\n should.exist([])\n should.exist('')\n should.exist(0)\n should.exist(null) // will throw\n should.exist(undefined) // will throw\n\nYou can also check the negation:\n\n should.not.exist(undefined)\n should.not.exist(null)\n should.not.exist('') // will throw\n should.not.exist({}) // will throw\n\nOnce you know an object exists, you can safely use the _should_ property on it.\n\n## ok\n\nAssert truthfulness:\n\n true.should.be.ok\n 'yay'.should.be.ok\n (1).should.be.ok\n\nor negated:\n\n false.should.not.be.ok\n ''.should.not.be.ok\n (0).should.not.be.ok\n\n## true\n\nAssert === true:\n\n true.should.be.true\n '1'.should.not.be.true\n\n## false\n\nAssert === false:\n\n false.should.be.false\n (0).should.not.be.false\n\n## arguments\n\nAssert `Arguments`:\n\n var args = (function(){ return arguments; })(1,2,3);\n args.should.be.arguments;\n [].should.not.be.arguments;\n\n## empty\n\nAsserts that length is 0:\n\n [].should.be.empty\n ''.should.be.empty\n ({ length: 0 }).should.be.empty\n\n## eql\n\nequality:\n\n ({ foo: 'bar' }).should.eql({ foo: 'bar' })\n [1,2,3].should.eql([1,2,3])\n\n## equal\n\nstrict equality:\n\n should.strictEqual(undefined, value)\n should.strictEqual(false, value)\n (4).should.equal(4)\n 'test'.should.equal('test')\n [1,2,3].should.not.equal([1,2,3])\n\n## within\n\nAssert inclusive numeric range:\n\n user.age.should.be.within(5, 50)\n\n## a\n\nAssert __typeof__:\n\n user.should.be.a('object')\n 'test'.should.be.a('string')\n\n## instanceof\n\nAssert __instanceof__:\n\n user.should.be.an.instanceof(User)\n [].should.be.an.instanceof(Array)\n\n## above\n\nAssert numeric value above the given value:\n\n user.age.should.be.above(5)\n user.age.should.not.be.above(100)\n\n## below\n\nAssert numeric value below the given value:\n\n user.age.should.be.below(100)\n user.age.should.not.be.below(5)\n\n## match\n\nAssert regexp match:\n\n username.should.match(/^\\w+$/)\n\n## length\n\nAssert _length_ property exists and has a value of the given number:\n\n user.pets.should.have.length(5)\n user.pets.should.have.a.lengthOf(5)\n\nAliases: _lengthOf_\n\n## string\n\nSubstring assertion:\n\n 'foobar'.should.include.string('foo')\n 'foobar'.should.include.string('bar')\n 'foobar'.should.not.include.string('baz')\n\n## object\n\nAssert inclusion of object:\n\n var obj = {foo: 'bar', baz: {baaz: 42}};\n obj.should.include.object({foo: 'bar'});\n obj.should.include.object({baz: {baaz: 42}});\n obj.should.not.include.object({foo: 'baz'});\n\n## property\n\nAssert property exists and has optional value:\n\n user.should.have.property('name')\n user.should.have.property('age', 15)\n user.should.not.have.property('rawr')\n user.should.not.have.property('age', 0)\n\n## ownProperty\n\nAssert own property (on the immediate object):\n\n ({ foo: 'bar' }).should.have.ownProperty('foo')\n\n## contain\n\nAssert array value:\n\n [1,2,3].should.contain(3)\n [1,2,3].should.contain(2)\n [1,2,3].should.not.contain(4)\n\n## keys\n\nAssert own object keys, which must match _exactly_,\nand will fail if you omit a key or two:\n\n var obj = { foo: 'bar', baz: 'raz' };\n obj.should.have.keys('foo', 'bar');\n obj.should.have.keys(['foo', 'bar']);\n\nusing the _include_ modifier, we can check inclusion of a key,\nbut not fail when we omit a few:\n\n obj.should.include.keys('foo')\n obj.should.include.keys('bar')\n obj.should.not.include.keys('baz')\n\n## respondTo\n\nAssert that the given property is a function:\n\n user.should.respondTo('email')\n\n## Express example\n\nFor example you can use should with the [Expresso TDD Framework](http://github.com/visionmedia/expresso) by simply including it:\n\n var lib = require('mylib')\n , should = require('should');\n \n module.exports = {\n 'test .version': function(){\n lib.version.should.match(/^\\d+\\.\\d+\\.\\d+$/);\n }\n };\n\n## Running tests\n\nTo run the tests for _should_ simple update your git submodules and run:\n\n $ make test\n\n## OMG IT EXTENDS OBJECT???!?!@\n\nYes, yes it does, with a single getter _should_, and no it wont break your code, because it does this **properly** with a non-enumerable property.\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2010-2011 TJ Holowaychuk <tj@vision-media.ca>\nCopyright (c) 2011 Aseem Kishore <aseem.kishore@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"} +{"text": "using System.Collections.Generic;\nusing Essensoft.AspNetCore.Payment.Alipay.Response;\n\nnamespace Essensoft.AspNetCore.Payment.Alipay.Request\n{\n /// \n /// alipay.open.public.personalized.menu.create\n /// \n public class AlipayOpenPublicPersonalizedMenuCreateRequest : IAlipayRequest\n {\n /// \n /// 个性化菜单创建\n /// \n public string BizContent { get; set; }\n\n #region IAlipayRequest Members\n private bool needEncrypt = false;\n private string apiVersion = \"1.0\";\n private string terminalType;\n private string terminalInfo;\n private string prodCode;\n private string notifyUrl;\n private string returnUrl;\n private AlipayObject bizModel;\n\n public void SetNeedEncrypt(bool needEncrypt)\n {\n this.needEncrypt = needEncrypt;\n }\n\n public bool GetNeedEncrypt()\n {\n\n return needEncrypt;\n }\n\n public void SetNotifyUrl(string notifyUrl)\n {\n this.notifyUrl = notifyUrl;\n }\n\n public string GetNotifyUrl()\n {\n return notifyUrl;\n }\n\n public void SetReturnUrl(string returnUrl)\n {\n this.returnUrl = returnUrl;\n }\n\n public string GetReturnUrl()\n {\n return returnUrl;\n }\n\n public void SetTerminalType(string terminalType)\n {\n this.terminalType = terminalType;\n }\n\n public string GetTerminalType()\n {\n return terminalType;\n }\n\n public void SetTerminalInfo(string terminalInfo)\n {\n this.terminalInfo = terminalInfo;\n }\n\n public string GetTerminalInfo()\n {\n return terminalInfo;\n }\n\n public void SetProdCode(string prodCode)\n {\n this.prodCode = prodCode;\n }\n\n public string GetProdCode()\n {\n return prodCode;\n }\n\n public string GetApiName()\n {\n return \"alipay.open.public.personalized.menu.create\";\n }\n\n public void SetApiVersion(string apiVersion)\n {\n this.apiVersion = apiVersion;\n }\n\n public string GetApiVersion()\n {\n return apiVersion;\n }\n\n public IDictionary GetParameters()\n {\n var parameters = new AlipayDictionary\n {\n { \"biz_content\", BizContent }\n };\n return parameters;\n }\n\n public AlipayObject GetBizModel()\n {\n return bizModel;\n }\n\n public void SetBizModel(AlipayObject bizModel)\n {\n this.bizModel = bizModel;\n }\n\n #endregion\n }\n}\n"} +{"text": "<%@ Page Language=\"C#\" MasterPageFile=\"~/App_MasterPages/layout.Master\" AutoEventWireup=\"false\" CodeBehind=\"ContentManagerPreview.aspx.cs\" Inherits=\"mojoPortal.Web.AdminUI.ContentManagerPreview\" Title=\"Untitled Page\" %>\n\n\n\n\n\n \n \n\t \n\t \n \n  \n \n \n \n \n\n\n\n\n\n"} +{"text": "{\n \"name\": \"connection-sharing\",\n \"private\": \"true\",\n \"version\": \"0.0.0\",\n \"description\": \"ERROR: No README.md file found!\",\n \"main\": \"app.js\",\n \"scripts\": {\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n },\n \"dependencies\": { \"express\": \"3.1.1\" },\n \"repository\": \"\",\n \"author\": \"\",\n \"license\": \"BSD\"\n}\n"} +{"text": "auto t = false;\n\nif (true) {\n t = true;\n}\n\nassert_equal(true, t);\n"} +{"text": "\n\n\n\n\nCICE: ice_timers::timer_data Type Reference\n\n\n\n\n\n\n\n\n
\n
\n \n
\n \n \n
\n
\n

ice_timers::timer_data Type Reference

\n

List of all members.

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

Private Attributes

character(char_len) name
logical(log_kind) in_use
logical(log_kind) node_started
integer(int_kind) num_blocks
integer(int_kind) num_nodes
integer(int_kind) num_starts
integer(int_kind) num_stops
real(dbl_kind) node_cycles1
real(dbl_kind) node_cycles2
real(dbl_kind) node_accum_time
logical(log_kind), dimension(:),
\npointer 
block_started
real(dbl_kind), dimension(:),
\npointer 
block_cycles1
real(dbl_kind), dimension(:),
\npointer 
block_cycles2
real(dbl_kind), dimension(:),
\npointer 
block_accum_time
\n

Detailed Description

\n\n

Definition at line 85 of file ice_timers.F90.

\n

Member Data Documentation

\n\n
\n
\n \n \n \n \n
real (dbl_kind),dimension(:),pointer ice_timers::timer_data::block_accum_time [private]
\n
\n
\n\n

Definition at line 113 of file ice_timers.F90.

\n\n
\n
\n\n
\n
\n \n \n \n \n
real (dbl_kind),dimension(:),pointer ice_timers::timer_data::block_cycles1 [private]
\n
\n
\n\n

Definition at line 109 of file ice_timers.F90.

\n\n
\n
\n\n
\n
\n \n \n \n \n
real (dbl_kind),dimension(:),pointer ice_timers::timer_data::block_cycles2 [private]
\n
\n
\n\n

Definition at line 109 of file ice_timers.F90.

\n\n
\n
\n\n
\n
\n \n \n \n \n
logical (log_kind),dimension(:),pointer ice_timers::timer_data::block_started [private]
\n
\n
\n\n

Definition at line 106 of file ice_timers.F90.

\n\n
\n
\n\n
\n
\n \n \n \n \n
logical (log_kind) ice_timers::timer_data::in_use [private]
\n
\n
\n\n

Definition at line 89 of file ice_timers.F90.

\n\n
\n
\n\n
\n
\n \n \n \n \n
character (char_len) ice_timers::timer_data::name [private]
\n
\n
\n\n

Definition at line 86 of file ice_timers.F90.

\n\n
\n
\n\n
\n
\n \n \n \n \n
real (dbl_kind) ice_timers::timer_data::node_accum_time [private]
\n
\n
\n\n

Definition at line 103 of file ice_timers.F90.

\n\n
\n
\n\n
\n
\n \n \n \n \n
real (dbl_kind) ice_timers::timer_data::node_cycles1 [private]
\n
\n
\n\n

Definition at line 99 of file ice_timers.F90.

\n\n
\n
\n\n
\n
\n \n \n \n \n
real (dbl_kind) ice_timers::timer_data::node_cycles2 [private]
\n
\n
\n\n

Definition at line 99 of file ice_timers.F90.

\n\n
\n
\n\n
\n
\n \n \n \n \n
logical (log_kind) ice_timers::timer_data::node_started [private]
\n
\n
\n\n

Definition at line 89 of file ice_timers.F90.

\n\n
\n
\n\n
\n
\n \n \n \n \n
integer (int_kind) ice_timers::timer_data::num_blocks [private]
\n
\n
\n\n

Definition at line 93 of file ice_timers.F90.

\n\n
\n
\n\n
\n
\n \n \n \n \n
integer (int_kind) ice_timers::timer_data::num_nodes [private]
\n
\n
\n\n

Definition at line 93 of file ice_timers.F90.

\n\n
\n
\n\n
\n
\n \n \n \n \n
integer (int_kind) ice_timers::timer_data::num_starts [private]
\n
\n
\n\n

Definition at line 93 of file ice_timers.F90.

\n\n
\n
\n\n
\n
\n \n \n \n \n
integer (int_kind) ice_timers::timer_data::num_stops [private]
\n
\n
\n\n

Definition at line 93 of file ice_timers.F90.

\n\n
\n
\n
The documentation for this type was generated from the following file:\n
\n\n\n\n\n
\n\n
\n\n
Generated on Tue Oct 6 14:02:26 2009 for CICE by \n\n\"doxygen\"/ 1.6.1
\n\n\n"} +{"text": "; RUN: llvm-as %s -o /dev/null\n; RUN: verify-uselistorder %s\n\n; %inc2 uses it's own value, but that's ok, as it's unreachable!\n\ndefine void @test() {\nentry:\n ret void\n\nno_exit.2: ; preds = %endif.6\n %tmp.103 = fcmp olt double 0.000000e+00, 0.000000e+00 ; [#uses=1]\n br i1 %tmp.103, label %endif.6, label %else.0\n\nelse.0: ; preds = %no_exit.2\n store i16 0, i16* null\n br label %endif.6\n\nendif.6: ; preds = %else.0, %no_exit.2\n %inc.2 = add i32 %inc.2, 1 ; [#uses=2]\n %tmp.96 = icmp slt i32 %inc.2, 0 ; [#uses=1]\n br i1 %tmp.96, label %no_exit.2, label %UnifiedReturnBlock1\n\nUnifiedReturnBlock1: ; preds = %endif.6\n ret void\n}\n\n"} +{"text": "package com.fmt.github.repos.viewmodel\n\nimport androidx.lifecycle.LiveData\nimport com.fmt.github.base.viewmodel.BaseViewModel\nimport com.fmt.github.repos.model.ReposItemModel\nimport com.fmt.github.repos.repository.ReposRepository\n\nclass ReposViewModel(private val mReposRepository: ReposRepository) : BaseViewModel() {\n\n fun searchRepos(\n query: String,\n sort: String,\n order: String,\n page: Int\n ): LiveData> = emit {\n mReposRepository.searchRepos(query, sort, order, page).items\n }\n\n fun checkRepoStarred(owner: String, repo: String): LiveData = emit {\n mReposRepository.checkRepoStarred(owner, repo).code() == 204\n }\n\n fun starRepo(owner: String, repo: String): LiveData = emit {\n mReposRepository.starRepo(owner, repo).code() == 204\n }\n\n fun unStarRepo(owner: String, repo: String): LiveData = emit {\n mReposRepository.unStarRepo(owner, repo).code() == 204\n }\n}\n"} +{"text": "/*!\n * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport * as vscode from 'vscode'\nimport { getLogger } from '../logger'\nimport { Endpoints, Region } from './endpoints'\nimport { EndpointsProvider } from './endpointsProvider'\nimport { RegionProvider } from './regionProvider'\n\ninterface RegionData {\n partitionId: string\n region: Region\n serviceIds: string[]\n}\n\nexport class DefaultRegionProvider implements RegionProvider {\n private readonly onRegionProviderUpdatedEmitter: vscode.EventEmitter = new vscode.EventEmitter()\n private readonly regionIdToRegionData: Map = new Map()\n\n public constructor(endpointsProvider: EndpointsProvider) {\n endpointsProvider.onEndpointsUpdated(e => this.loadFromEndpointsProvider(e))\n this.loadFromEndpointsProvider(endpointsProvider)\n }\n\n public get onRegionProviderUpdated(): vscode.Event {\n return this.onRegionProviderUpdatedEmitter.event\n }\n\n public isServiceInRegion(serviceId: string, regionId: string): boolean {\n return !!this.regionIdToRegionData.get(regionId)?.serviceIds.find(x => x === serviceId) ?? false\n }\n\n public getPartitionId(regionId: string): string | undefined {\n const partitionId = this.regionIdToRegionData.get(regionId)?.partitionId\n\n if (!partitionId) {\n getLogger().warn(`Unable to determine the Partition that Region ${regionId} belongs to`)\n }\n\n return partitionId ?? undefined\n }\n\n public getRegions(partitionId: string): Region[] {\n return [...this.regionIdToRegionData.values()]\n .filter(region => region.partitionId === partitionId)\n .map(region => region.region)\n }\n\n private loadFromEndpointsProvider(provider: EndpointsProvider) {\n const endpoints = provider.getEndpoints()\n\n if (endpoints) {\n this.loadFromEndpoints(endpoints)\n }\n }\n\n private loadFromEndpoints(endpoints: Endpoints) {\n this.regionIdToRegionData.clear()\n\n endpoints.partitions.forEach(partition => {\n partition.regions.forEach(region =>\n this.regionIdToRegionData.set(region.id, {\n partitionId: partition.id,\n region: region,\n serviceIds: [],\n })\n )\n\n partition.services.forEach(service => {\n service.endpoints.forEach(endpoint => {\n const regionData = this.regionIdToRegionData.get(endpoint.regionId)\n\n if (regionData) {\n regionData.serviceIds.push(service.id)\n }\n })\n })\n })\n\n this.onRegionProviderUpdatedEmitter.fire()\n }\n}\n"} +{"text": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!21 &2100000\nMaterial:\n serializedVersion: 6\n m_ObjectHideFlags: 0\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 0}\n m_Name: monster_dif\n m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}\n m_ShaderKeywords: \n m_LightmapFlags: 4\n m_EnableInstancingVariants: 0\n m_CustomRenderQueue: -1\n stringTagMap: {}\n disabledShaderPasses: []\n m_SavedProperties:\n serializedVersion: 3\n m_TexEnvs:\n - _BumpMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _DetailAlbedoMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _DetailMask:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _DetailNormalMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _EmissionMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _MainTex:\n m_Texture: {fileID: 2800000, guid: 84dd72cfb05660a44af2dbeadc251030, type: 3}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _MetallicGlossMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _OcclusionMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _ParallaxMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n m_Floats:\n - _BumpScale: 1\n - _Cutoff: 0.5\n - _DetailNormalMapScale: 1\n - _DstBlend: 0\n - _GlossMapScale: 1\n - _Glossiness: 0.5\n - _GlossyReflections: 1\n - _Metallic: 0\n - _Mode: 0\n - _OcclusionStrength: 1\n - _Parallax: 0.02\n - _SmoothnessTextureChannel: 0\n - _SpecularHighlights: 1\n - _SrcBlend: 1\n - _UVSec: 0\n - _ZWrite: 1\n m_Colors:\n - _Color: {r: 0.588, g: 0.588, b: 0.588, a: 1}\n - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}\n"} +{"text": "\n\n\n 2\n \n Debug\n \n ARM\n \n 1\n \n General\n 3\n \n 24\n 1\n 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 ICCARM\n 2\n \n 31\n 1\n 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 \n \n \n \n AARM\n 2\n \n 9\n 1\n 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 OBJCOPY\n 0\n \n 1\n 1\n 1\n \n \n \n \n \n \n \n \n CUSTOM\n 3\n \n \n \n 0\n \n \n \n BICOMP\n 0\n \n \n \n BUILDACTION\n 1\n \n \n \n \n \n \n ILINK\n 0\n \n 18\n 1\n 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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n IARCHIVE\n 0\n \n 0\n 1\n 1\n \n \n \n \n \n \n BILINK\n 0\n \n \n \n \n Release\n \n ARM\n \n 0\n \n General\n 3\n \n 24\n 1\n 0\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ICCARM\n 2\n \n 31\n 1\n 0\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n AARM\n 2\n \n 9\n 1\n 0\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n OBJCOPY\n 0\n \n 1\n 1\n 0\n \n \n \n \n \n \n \n \n CUSTOM\n 3\n \n \n \n 0\n \n \n \n BICOMP\n 0\n \n \n \n BUILDACTION\n 1\n \n \n \n \n \n \n ILINK\n 0\n \n 18\n 1\n 0\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n IARCHIVE\n 0\n \n 0\n 1\n 0\n \n \n \n \n \n \n BILINK\n 0\n \n \n \n \n CMSIS\n \n $PROJ_DIR$\\..\\..\\..\\..\\..\\platform\\Device\\SiliconLabs\\EFR32MG21\\Source\\IAR\\startup_efr32mg21.s\n \n \n $PROJ_DIR$\\..\\..\\..\\..\\..\\platform\\Device\\SiliconLabs\\EFR32MG21\\Source\\system_efr32mg21.c\n \n \n \n emlib\n \n $PROJ_DIR$\\..\\..\\..\\..\\..\\platform\\emlib\\src\\em_cmu.c\n \n \n $PROJ_DIR$\\..\\..\\..\\..\\..\\platform\\emlib\\src\\em_emu.c\n \n \n $PROJ_DIR$\\..\\..\\..\\..\\..\\platform\\emlib\\src\\em_gpio.c\n \n \n $PROJ_DIR$\\..\\..\\..\\..\\..\\platform\\emlib\\src\\em_iadc.c\n \n \n $PROJ_DIR$\\..\\..\\..\\..\\..\\platform\\emlib\\src\\em_prs.c\n \n \n $PROJ_DIR$\\..\\..\\..\\..\\..\\platform\\emlib\\src\\em_system.c\n \n \n $PROJ_DIR$\\..\\..\\..\\..\\..\\platform\\emlib\\src\\em_core.c\n \n \n $PROJ_DIR$\\..\\..\\..\\..\\..\\platform\\emlib\\src\\em_timer.c\n \n \n $PROJ_DIR$\\..\\..\\..\\..\\..\\platform\\emlib\\src\\em_usart.c\n \n \n $PROJ_DIR$\\..\\..\\..\\..\\..\\hardware\\kit\\common\\drivers\\retargetio.c\n \n \n $PROJ_DIR$\\..\\..\\..\\..\\..\\hardware\\kit\\common\\drivers\\retargetserial.c\n \n \n \n Source\n \n $PROJ_DIR$\\..\\src\\main_gpio_int_s2_xg21.c\n \n \n $PROJ_DIR$\\..\\readme_xg21.txt\n \n \n\n\n"} +{"text": "\n// Copyright 2014 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n// This file is autogenerated by:\n// mojo/public/tools/bindings/mojom_bindings_generator.py\n// For:\n// services/network/public/mojom/proxy_lookup_client.mojom\n//\n\npackage org.chromium.network.mojom;\n\nimport org.chromium.mojo.bindings.DeserializationException;\n\n\npublic interface ProxyLookupClient extends org.chromium.mojo.bindings.Interface {\n\n\n\n public interface Proxy extends ProxyLookupClient, org.chromium.mojo.bindings.Interface.Proxy {\n }\n\n Manager MANAGER = ProxyLookupClient_Internal.MANAGER;\n\n\n void onProxyLookupComplete(\nint netError, org.chromium.proxy_resolver.mojom.ProxyInfo proxyInfo);\n\n\n}\n"} +{"text": "TwitchIO\n================\n\nSupport\n---------------------------\nFor support using TwitchIO, please join the official `support server\n`_ on `Discord `_.\n\nInstallation\n---------------------------\nTwitchIO is currently not on PyPI and thus needs to be installed using git.\nThe following commands are currently the valid ways of installing TwitchIO.\n\n**TwitchIO requires Python 3.6 or higher.**\n\n**Windows**\n\n.. code:: sh\n\n py -version -m pip install git+https://github.com/TwitchIO/TwitchIO.git\n\n**Linux**\n\n.. code:: sh\n\n python3 -m pip install git+https://github.com/TwitchIO/TwitchIO.git\n\nGetting Started\n----------------------------\nTwitchIO uses many endpoints which may require different tokens and IDs.\n\n1. IRC endpoints which require an OAuth token.\n To get a token, log in to Twitch with the bot's account and visit:\n https://twitchapps.com/tmi/\n\n2. HTTP endpoints which require a client ID.\n *To be documented.*\n\n3. HTTP endpoints which require an OAuth token and certain scopes.\n *To be documented.*\n\nAll 3 endpoints may be used at the same time. Otherwise, you may choose to use any or some of the endpoints.\n\nCurrently, TwitchIO's development is at a phase which has emphasis on the IRC endpoint and creating a framework around it.\nOnce this is implemented, the other 2 endpoints will be developed further.\n\nA quick and easy bot example:\n\n.. code:: py\n\n from twitchio.ext import commands\n\n\n class Bot(commands.Bot):\n\n def __init__(self):\n super().__init__(irc_token='...', client_id='...', nick='...', prefix='!',\n initial_channels=['...'])\n\n # Events don't need decorators when subclassed\n async def event_ready(self):\n print(f'Ready | {self.nick}')\n\n async def event_message(self, message):\n print(message.content)\n await self.handle_commands(message)\n\n # Commands use a decorator...\n @commands.command(name='test')\n async def my_command(self, ctx):\n await ctx.send(f'Hello {ctx.author.name}!')\n\n\n bot = Bot()\n bot.run()\n\nClient\n----------------------------\n\n.. autoclass:: twitchio.client.Client\n :members:\n\nTopics\n----------------------------\nWebhooks allow you to subscribe to different topics, which ones are described below.\n\n.. autoclass:: twitchio.webhook.Topic\n :members:\n\n.. autoclass:: twitchio.webhook.UserFollows\n :members:\n :show-inheritance:\n\n.. autoclass:: twitchio.webhook.StreamChanged\n :members:\n :show-inheritance:\n\n.. autoclass:: twitchio.webhook.UserChanged\n :members:\n :show-inheritance:\n\n.. autoclass:: twitchio.webhook.GameAnalytics\n :members:\n :show-inheritance:\n\n.. autoclass:: twitchio.webhook.ExtensionAnalytics\n :members:\n :show-inheritance:\n\n\nDataclasses\n----------------------------\nDataclasses belonging to TwitchIO.\n\n.. note::\n These should not be created by the user. Instead, you should use the ones\n passed to event listeners or returned from properties and methods of TwitchIO's objects.\n\n.. autoclass:: twitchio.dataclasses.Message\n :members:\n :inherited-members:\n :show-inheritance:\n\n.. autoclass:: twitchio.dataclasses.Channel\n :members:\n :inherited-members:\n :show-inheritance:\n\n.. autoclass:: twitchio.dataclasses.User\n :members:\n :inherited-members:\n :show-inheritance:\n\n.. autoclass:: twitchio.dataclasses.Context\n :members:\n :inherited-members:\n :show-inheritance:\n\n.. autoclass:: twitchio.dataclasses.NoticeSubscription\n :members:\n :inherited-members:\n :show-inheritance:\n\nErrors\n-----------------------\n\n.. autoexception:: twitchio.errors.TwitchIOBException\n\n.. autoexception:: twitchio.errors.AuthenticationError\n\n.. autoexception:: twitchio.errors.WSConnectionFailure\n\n.. autoexception:: twitchio.errors.ClientError\n\n.. autoexception:: twitchio.errors.EchoMessageWarning\n\n.. autoexception:: twitchio.errors.InvalidContent\n\n.. autoexception:: twitchio.errors.HTTPException\n\n\nModule Contents\n---------------\n\n.. automodule:: twitchio\n :members:\n :show-inheritance:\n"} +{"text": "--TEST--\n\\PHPUnit\\Framework\\MockObject\\Generator::generate('NonExistentClass', [], 'MockFoo', true, true)\n--FILE--\ngenerate(\n 'NonExistentClass',\n [],\n 'MockFoo',\n true,\n true\n);\n\nprint $mock['code'];\n?>\n--EXPECT--\nclass NonExistentClass\n{\n}\n\nclass MockFoo extends NonExistentClass implements PHPUnit\\Framework\\MockObject\\MockObject\n{\n private $__phpunit_invocationMocker;\n private $__phpunit_originalObject;\n private $__phpunit_configurable = [];\n private $__phpunit_returnValueGeneration = true;\n\n public function __clone()\n {\n $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();\n }\n\n public function expects(\\PHPUnit\\Framework\\MockObject\\Matcher\\Invocation $matcher)\n {\n return $this->__phpunit_getInvocationMocker()->expects($matcher);\n }\n\n public function method()\n {\n $any = new \\PHPUnit\\Framework\\MockObject\\Matcher\\AnyInvokedCount;\n $expects = $this->expects($any);\n\n return call_user_func_array([$expects, 'method'], func_get_args());\n }\n\n public function __phpunit_setOriginalObject($originalObject)\n {\n $this->__phpunit_originalObject = $originalObject;\n }\n\n public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)\n {\n $this->__phpunit_returnValueGeneration = $returnValueGeneration;\n }\n\n public function __phpunit_getInvocationMocker()\n {\n if ($this->__phpunit_invocationMocker === null) {\n $this->__phpunit_invocationMocker = new \\PHPUnit\\Framework\\MockObject\\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);\n }\n\n return $this->__phpunit_invocationMocker;\n }\n\n public function __phpunit_hasMatchers()\n {\n return $this->__phpunit_getInvocationMocker()->hasMatchers();\n }\n\n public function __phpunit_verify(bool $unsetInvocationMocker = true)\n {\n $this->__phpunit_getInvocationMocker()->verify();\n\n if ($unsetInvocationMocker) {\n $this->__phpunit_invocationMocker = null;\n }\n }\n}\n"} +{"text": "{\n \"type\": \"FeatureCollection\",\n \"features\": [\n {\n \"type\": \"Feature\",\n \"properties\": {\n \"name\": \"A\",\n \"group\": \"foo\"\n },\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [[[0.5, 0.5], [0.5, 1.5], [1, 1.5], [1, 0.5], [0.5, 0.5]]]\n }\n }, {\n \"type\": \"Feature\",\n \"properties\": {\n \"name\": \"B\",\n \"group\": \"foo\"\n },\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [[[1, 0.5], [1, 1.5], [1.5, 1.5], [1.5, 0.5], [1, 0.5]]]\n }\n }\n ]\n}"} +{"text": "{\n \"variants\": {\n \"facing=north,open=true\": {\n \"model\": \"cfm:block/yellow_kitchen_drawer_open\",\n \"y\": 0\n },\n \"facing=north,open=false\": {\n \"model\": \"cfm:block/yellow_kitchen_drawer_closed\",\n \"y\": 0\n },\n \"facing=east,open=true\": {\n \"model\": \"cfm:block/yellow_kitchen_drawer_open\",\n \"y\": 90\n },\n \"facing=east,open=false\": {\n \"model\": \"cfm:block/yellow_kitchen_drawer_closed\",\n \"y\": 90\n },\n \"facing=south,open=true\": {\n \"model\": \"cfm:block/yellow_kitchen_drawer_open\",\n \"y\": 180\n },\n \"facing=south,open=false\": {\n \"model\": \"cfm:block/yellow_kitchen_drawer_closed\",\n \"y\": 180\n },\n \"facing=west,open=true\": {\n \"model\": \"cfm:block/yellow_kitchen_drawer_open\",\n \"y\": 270\n },\n \"facing=west,open=false\": {\n \"model\": \"cfm:block/yellow_kitchen_drawer_closed\",\n \"y\": 270\n }\n }\n}"} +{"text": "$NetBSD: distinfo,v 1.7 2016/08/30 13:57:31 he Exp $\n\nSHA1 (libnet-1.0.2a.tar.gz) = 804eaf43bb90f93e505d46a9668c914a112bf136\nRMD160 (libnet-1.0.2a.tar.gz) = 43dd2edc31e56b42792727b88d81342dc26d3308\nSHA512 (libnet-1.0.2a.tar.gz) = 2e9a73bd767e1f46eea92e18ddd83cc3179144c8cc5b1a22b4dba50fee16173c951be4dd647a247bd7067c33b9e33489a6efb313ce1ea0c61c4a06009c3c4d95\nSize (libnet-1.0.2a.tar.gz) = 140191 bytes\nSHA1 (patch-aa) = fa71db191c421aa1b36d1107236645fdde0bc8f9\nSHA1 (patch-ab) = 56a2cb8b214529fdaacdbc6154ec2fc88edfa1c8\nSHA1 (patch-ac) = 73c68c9e6ca1dfc751cf8d5b00444fa38ae87e70\nSHA1 (patch-ad) = 237a8caae854df28790b3038c0b782b95b336004\nSHA1 (patch-ae) = d3b0e651bee5344b0d0539065058a939036a8152\n"} +{"text": "#define __CLC_BODY \n#include \n"} +{"text": "#!/usr/bin/env roseus\n;;\n;; convert screenpoint from image_view2 to 3D point\n;;\n;; publish:\n;; ray_marker_array (visualization_msgs::MarkerArray)\n;; marker of touched point for rviz.\n;;\n;; image_marker (image_view2::ImageMarker2)\n;; marker of touched point for image_view2.\n;;\n;; ray_coords (geometry_msgs::PoseStamped)\n;; pose of 3D touched point, frame_id is copied from image.\n;;\n;;\n;; subscribe:\n;; $(param sensor_topic)/screenpoint (geometry_msgs::PointStamped)\n;; screen point from image_view2.\n;;\n;;\n;; TF:\n;; /ray_target\n;; tf of 3D touched point, frame_id is copied from image.\n;;\n(ros::load-ros-manifest \"jsk_recognition_msgs\")\n(ros::load-ros-manifest \"image_view2\")\n\n(defun ros::tf-translation->pos (trans)\n \"convert ros::tf-translation to float-vector\n@param trans ros::tf-translation\n@return translation as float-vector\n\"\n (float-vector (send trans :x) (send trans :y) (send trans :z)))\n\n;;;;\n;;;;\n;;;;\n\n(defun visualize-point (x y &key ((:lifetime lf) 5))\n \"publish marker of touchd point to image_view2\n@param x x[px]\n@param y y[px]\n@param :lifetime life time [s]\"\n (let ((mrk (instance image_view2::ImageMarker2 :init)))\n (send mrk :header :stamp (ros::time-now))\n (send mrk :id 1)\n (send mrk :type image_view2::ImageMarker2::*CIRCLE*)\n (send mrk :action image_view2::ImageMarker2::*ADD*)\n (send mrk :position (instance geometry_msgs::Point :init :x x :y y))\n (send mrk :outline_color (instance std_msgs::ColorRGBA :init :r 0.0 :g 1.0 :b 0.0 :a 1.0))\n (send mrk :scale 15)\n (send mrk :lifetime (ros::Time lf))\n (ros::publish \"image_marker\" mrk)))\n\n(defun visualize-frame (frame &key ((:lifetime lf) 10))\n \"publish marker of frame coordinate to image_view2\n@param frame frame id\n@param :lifetime life time [s]\"\n (let ((mrk (instance image_view2::ImageMarker2 :init)))\n (send mrk :header :stamp (ros::time-now))\n (send mrk :type image_view2::ImageMarker2::*FRAMES*)\n (send mrk :frames frame)\n (send mrk :lifetime (ros::Time lf))\n (ros::publish \"image_marker\" mrk)))\n\n;;;\n;;;\n;; screen point is stored in *screenpoint*\n(defvar *screenpoint* nil)\n(defun point-cb (msg)\n \"subscriber callback\n@param msg subscribed msg\"\n (let* ((x (send msg :point :x))\n\t (y (send msg :point :y))\n\t (req (instance jsk_recognition_msgs::TransformScreenpointRequest :init\n\t\t\t:x x :y y))\n res)\n ;; call PointcloudScreenPointNodelet::screen_to_point\n (ros::wait-for-service *ray_srv*)\n (setq res (ros::service-call *ray_srv* req))\n ;; send marker to image_view2\n (visualize-point x y)\n ;; store result to *screenpoint*\n (setq *screenpoint* res)\n ;; check\n (print (list (send res :vector :x)\n\t\t (send res :vector :y)\n\t\t (send res :vector :z)))\n ))\n\n(defun show-marker (frame p1 v1)\n \"publish markers\n@param frame frame id\n@param p1 postion\n@param v1 vector\"\n (let* ((header (instance std_msgs::header :init\n\t\t\t :stamp (ros::time-now) :frame_id frame))\n\t (p0 (float-vector 0 0 0))\n\t (sp (make-sphere 30 :pos p1))\n ;; Marker::SPHERE\n\t (sp-msg (sphere->marker-msg sp header\n\t\t\t\t :color (float-vector 1 0 1) :alpha 1.0))\n ;; Marker::LINE\n\t (li-msg (line->marker-msg (list p0 p1) header :scale 15\n\t\t\t\t :color (float-vector 0 1 1) :alpha 0.5))\n ;; MarkerArray msg\n\t (msg (instance visualization_msgs::MarkerArray :init))\n ;; PoseStamped msg\n\t (rmsg (instance geometry_msgs::PoseStamped :init))\n\t (av v1) (xv #f(1 0 0)) (bv (v* av xv)) (cv (v* av bv))\n\t (dm (matrix (normalize-vector av)\n\t\t (normalize-vector bv)\n\t\t (normalize-vector cv)))\n ;; camera coordinates from base_footprint\n\t (cam-cds (send *tfl* :lookup-transform\n *base-frame* frame (ros::time 0)))\n base-cds) ;; (let*)\n (cond ((null frame)\n\t (ros::ros-warn \"detected service fail\")\n\t (return-from show-marker nil))\n\t ((null cam-cds)\n\t (ros::ros-warn \"transform fail\")\n\t (return-from show-marker nil)))\n (setq base-cds (send cam-cds :transform (make-coords :pos p1 :rot dm)))\n (send sp-msg :ns \"test_sphere\")\n (send li-msg :ns \"test_line\")\n (send sp-msg :lifetime (ros::time 5))\n (send li-msg :lifetime (ros::time 5))\n (send msg :markers (list sp-msg li-msg))\n (ros::publish \"ray_marker_array\" msg)\n (send *tfb* :send-transform (make-coords :pos p1) frame \"/ray_target\")\n ;; send marker to image_view2\n (visualize-frame (list \"ray_target\"))\n\n ;; send coords based on \"base_footprint\"\n (cond ((> (distance (send *cds* :pos) (send base-cds :pos)) 10)\n\t (ros::ros-warn \"estimated cds is ~A\" base-cds)\n\t (send rmsg :header header)\n\t (send rmsg :pose (ros::coords->tf-pose base-cds))\n\t (ros::publish \"ray_coords\" rmsg)))\n (setq *cds* base-cds)\n ))\n\n(defun init-settings ()\n \"initializer\"\n ;; TF broadcaster and listener\n (setq *tfb* (instance ros::transform-broadcaster :init))\n (setq *tfl* (instance ros::transform-listener :init))\n\n ;; topics are published under *sensor_topic*\n (setq *sensor_topic* (ros::get-param \"~sensor_topic\"))\n ;; service of PointcloudScreenpointNodelet\n (setq *ray_srv* (ros::get-param \"~ray_srv\"))\n ;; set base frame\n (setq *base-frame* (ros::get-param \"~base_frame\" \"base_footprint\"))\n ;; to store previous coords\n (setq *cds* (make-coords))\n\n (ros::advertise \"ray_marker_array\" visualization_msgs::MarkerArray 10)\n (ros::advertise \"image_marker\" image_view2::ImageMarker2 10)\n (ros::advertise \"ray_coords\" geometry_msgs::PoseStamped 1)\n (ros::subscribe (format nil \"~A~A\" *sensor_topic* \"/screenpoint\")\n\t\t geometry_msgs::PointStamped #'point-cb)\n\n ;; check topic and service\n (ros::ros-warn \"pointcloud_screenpoint:sensor -> ~A\" *sensor_topic*)\n (ros::ros-warn \"pointcloud_screenpoint:ray_srv -> ~A\" *ray_srv*)\n )\n\n\n;; main routine\n(ros::roseus \"pointcloud_screenpoint\")\n(init-settings)\n(ros::rate 10)\n(while (ros::ok)\n (ros::spin-once)\n (ros::sleep)\n (when (and *screenpoint*\n\t (> (send (send *screenpoint* :header :stamp) :to-sec) 0.0)\n\t (< (send (ros::time- (ros::time-now) (send *screenpoint* :header :stamp)) :to-sec) 20))\n (show-marker (send *screenpoint* :header :frame_id)\n\t\t (ros::tf-point->pos (send *screenpoint* :point))\n\t\t (ros::tf-translation->pos (send *screenpoint* :vector))))\n )\n(ros::exit)\n\n\n\n\n"} +{"text": "const defaultImage = require('../../../../assets/images/exponent-icon.png');\n\nexport default defaultImage;\n"} +{"text": "document.write(\"Fuck You Github!\");\n"} +{"text": "let f (n : int) (b : bool) =\n if b then\n n + 1\n else\n n - 1\n\nlet id (x : 'a) : 'a =\n x\n"} +{"text": "---\ntitle: Required WIA Child Item Properties for Scanner Storage\ndescription: Required WIA Child Item Properties for Scanner Storage\nms.assetid: 47640b56-d6d9-4ad6-b973-be9fd8992a2c\nms.date: 04/20/2017\nms.localizationpriority: medium\n---\n\n# Required WIA Child Item Properties for Scanner Storage\n\n\nThe WIA scanner storage child (file) item is required to support the following WIA properties:\n\n[**WIA\\_IPA\\_ACCESS\\_RIGHTS**](./wia-ipa-access-rights.md)\n\n[**WIA\\_IPA\\_ITEM\\_CATEGORY**](./wia-ipa-item-category.md)\n\n[**WIA\\_IPA\\_FULL\\_ITEM\\_NAME**](./wia-ipa-full-item-name.md)\n\n[**WIA\\_IPA\\_ITEM\\_NAME**](./wia-ipa-item-name.md)\n\n \n\n"} +{"text": "{\n \"metadata\": {\n \"name\": \"Capitulo17_Decoradores\"\n },\n \"nbformat\": 3,\n \"nbformat_minor\": 0,\n \"worksheets\": [\n {\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"[Python para Desenvolvedores](http://ricardoduarte.github.io/python-para-desenvolvedores/#conteudo)\\n\",\n \"===================================\\n\",\n \"2ª edi\\u00e7\\u00e3o, revisada e ampliada\\n\",\n \"-----------------------------------\\n\",\n \"\\n\",\n \"Cap\\u00edtulo 17: Decoradores\\n\",\n \"=============================\\n\",\n \"_____________________________\\n\",\n \"Decoradores (*decorators*) s\\u00e3o fun\\u00e7\\u00f5es que s\\u00e3o aplicadas em outras fun\\u00e7\\u00f5es e retornam fun\\u00e7\\u00f5es modificadas. Decoradores tanto podem ser usados para criar ou alterar caracter\\u00edsticas das fun\\u00e7\\u00f5es (que s\\u00e3o objetos) quanto para \\u201cenvolver\\u201d as fun\\u00e7\\u00f5es, acrescentando uma camada em torno delas com novas funcionalidades.\\n\",\n \"\\n\",\n \"![Decorador](files/bpypd_diags13.png)\\n\",\n \"\\n\",\n \"A partir do Python 2.4, o caractere \\u201c@\\u201d pode ser usado para automatizar o processo de aplica\\u00e7\\u00e3o do decorador:\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"collapsed\": false,\n \"input\": [\n \"def decorator(f):\\n\",\n \" f.decorated = True\\n\",\n \" return f\\n\",\n \"\\n\",\n \"@decorator\\n\",\n \"def func(arg):\\n\",\n \" return arg\"\n ],\n \"language\": \"python\",\n \"metadata\": {},\n \"outputs\": [],\n \"prompt_number\": 1\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"Com isso, foi criado um atributo novo na fun\\u00e7\\u00e3o, que pode ser usado depois, quando a fun\\u00e7\\u00e3o for executada.\\n\",\n \"\\n\",\n \"Exemplo:\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"collapsed\": false,\n \"input\": [\n \"# Fun\\u00e7\\u00e3o decoradora\\n\",\n \"def dumpargs(f):\\n\",\n \"\\n\",\n \" # Fun\\u00e7\\u00e3o que envolver\\u00e1 a outra\\n\",\n \" def func(*args):\\n\",\n \"\\n\",\n \" # Mostra os argumentos passados para a fun\\u00e7\\u00e3o\\n\",\n \" print args\\n\",\n \"\\n\",\n \" # Retorna o resultado da fun\\u00e7\\u00e3o original\\n\",\n \" return f(*args)\\n\",\n \"\\n\",\n \" # Retorna a fun\\u00e7\\u00e3o modificada\\n\",\n \" return func\\n\",\n \"\\n\",\n \"@dumpargs\\n\",\n \"def multiply(*nums):\\n\",\n \"\\n\",\n \" m = 1\\n\",\n \"\\n\",\n \" for n in nums:\\n\",\n \" m = m * n\\n\",\n \" return m\\n\",\n \"\\n\",\n \"print multiply(1, 2, 3)\"\n ],\n \"language\": \"python\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"output_type\": \"stream\",\n \"stream\": \"stdout\",\n \"text\": [\n \"(1, 2, 3)\\n\",\n \"6\\n\"\n ]\n }\n ],\n \"prompt_number\": 2\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"A sa\\u00edda apresenta os par\\u00e2metros que a fun\\u00e7\\u00e3o decorada recebeu.\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"collapsed\": false,\n \"input\": [],\n \"language\": \"python\",\n \"metadata\": {},\n \"outputs\": [\n {\n \"html\": [\n \"\\n\",\n \"\"\n ],\n \"output_type\": \"pyout\",\n \"prompt_number\": 1,\n \"text\": [\n \"\"\n ]\n }\n ],\n \"prompt_number\": 1\n }\n ],\n \"metadata\": {}\n }\n ]\n}"} +{"text": "/*******************************\n Search\n*******************************/\n\n/* Search Prompt */\n@promptBackground: @inputBackground;\n@promptVerticalPadding: @inputVerticalPadding;\n@promptHorizontalPadding: @inputHorizontalPadding;\n@promptLineHeight: @inputLineHeight;\n@promptFontSize: @relativeMedium;\n@promptPadding: (@promptVerticalPadding + ((1em - @promptLineHeight) / 2)) @promptHorizontalPadding;\n@promptBorder: 1px solid @borderColor;\n@promptBorderRadius: @circularRadius;\n@promptColor: @textColor;\n@promptTransition:\n background-color @defaultDuration @defaultEasing,\n color @defaultDuration @defaultEasing,\n box-shadow @defaultDuration @defaultEasing,\n border-color @defaultDuration @defaultEasing\n;\n@promptBoxShadow: 0em 0em 0em 0em transparent inset;\n\n/* Result Box */\n@resultsWidth: 18em;\n@resultsBackground: #FFFFFF;\n@resultsDistance: 0.5em;\n@resultsBorderRadius: @defaultBorderRadius;\n@resultsBorder: 1px solid @solidBorderColor;\n@resultsBoxShadow: @floatingShadow;\n\n/* Result */\n@resultFontSize: 1em;\n@resultVerticalPadding: @relativeTiny;\n@resultHorizontalPadding: @relativeLarge;\n@resultPadding: @resultVerticalPadding @resultHorizontalPadding;\n@resultTextColor: @textColor;\n@resultLineHeight: 1.33;\n@resultDivider: 1px solid @internalBorderColor;\n@resultLastDivider: none;\n\n/* Result Image */\n@resultImageFloat: right;\n@resultImageBackground: none;\n@resultImageWidth: 5em;\n@resultImageHeight: 3em;\n@resultImageBorderRadius: 0.25em;\n@resultImageMargin: 0em 6em 0em 0em;\n\n/* Result Content */\n@resultTitleFont: @headerFont;\n@resultTitleMargin: -@headerLineHeightOffset 0em 0em;\n@resultTitleFontWeight: bold;\n@resultTitleFontSize: @relativeMedium;\n@resultTitleColor: @darkTextColor;\n\n/* Description */\n@resultDescriptionFontSize: @relativeSmall;\n@resultDescriptionDistance: 0;\n@resultDescriptionColor: @lightTextColor;\n\n/* Price */\n@resultPriceFloat: right;\n@resultPriceColor: @green;\n\n/* Special Message */\n@messageVerticalPadding: 1em;\n@messageHorizontalPadding: 1em;\n@messageHeaderFontSize: @medium;\n@messageHeaderFontWeight: bold;\n@messageHeaderColor: @textColor;\n@messageDescriptionDistance: 0.25rem;\n@messageDescriptionFontSize: 1em;\n@messageDescriptionColor: @textColor;\n\n/* All Results Link */\n@actionBorder: none;\n@actionBackground: @darkWhite;\n@actionPadding: @relativeSmall @relativeMedium;\n@actionColor: @textColor;\n@actionFontWeight: bold;\n@actionAlign: center;\n\n\n/*******************************\n States\n*******************************/\n\n/* Focus */\n@promptFocusBackground: @promptBackground;\n@promptFocusBorderColor: @selectedBorderColor;\n@promptFocusColor: @selectedTextColor;\n\n/* Hover */\n@resultHoverBackground: @offWhite;\n@actionHoverBackground: #E0E0E0;\n\n/* Loading */\n@invertedLoaderFillColor: rgba(0, 0, 0, 0.15);\n\n/* Active Category */\n@categoryActiveBackground: @darkWhite;\n@categoryNameActiveColor: @textColor;\n\n/* Active Result */\n@resultActiveBorderLeft: @internalBorderColor;\n@resultActiveBackground: @darkWhite;\n@resultActiveBoxShadow: none;\n@resultActiveTitleColor: @darkTextColor;\n@resultActiveDescriptionColor: @darkTextColor;\n@resultsZIndex: 998;\n\n\n/*******************************\n Types\n*******************************/\n\n/* Selection */\n@selectionPromptBorderRadius: @defaultBorderRadius;\n\n@selectionCloseTop: 0em;\n@selectionCloseTransition:\n color @defaultDuration @defaultEasing,\n opacity @defaultDuration @defaultEasing\n;\n@selectionCloseRight: 0em;\n@selectionCloseIconOpacity: 0.8;\n@selectionCloseIconColor: '';\n@selectionCloseIconHoverOpacity: 1;\n@selectionCloseIconHoverColor: @red;\n\n@selectionCloseIconInputRight: 1.85714em;\n\n/* Category */\n@categoryBackground: @darkWhite;\n@categoryBoxShadow: none;\n@categoryDivider: 1px solid @internalBorderColor;\n@categoryTransition:\n background @defaultDuration @defaultEasing,\n border-color @defaultDuration @defaultEasing\n;\n\n@categoryResultsWidth: 28em;\n\n@categoryResultBackground: @white;\n@categoryResultLeftBorder: 1px solid @borderColor;\n@categoryResultDivider: @resultDivider;\n@categoryResultLastDivider: none;\n@categoryResultPadding: @resultPadding;\n@categoryResultTransition: @categoryTransition;\n\n@categoryNameWidth: 100px;\n@categoryNameBackground: transparent;\n@categoryNameFont: @pageFont;\n@categoryNameFontSize: 1em;\n@categoryNameFloat: left;\n@categoryNamePadding: 0.4em 1em;\n@categoryNameFontWeight: bold;\n@categoryNameColor: @lightTextColor;\n"} +{"text": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"# Bit Reader\\n\",\n \"Encode/Decode a set of bits\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"Initializes with parameter `options`, which must be a dictionary with the following format:\\n\",\n \"\\n\",\n \"- keys must be a str with the bits places, example: '0-1' means bit 0 and bit 1\\n\",\n \"\\n\",\n \"- values must be a dictionary with the bit value as the key and the category (str) as value. Categories must be unique.\\n\",\n \"\\n\",\n \"- Encode: given a category/categories return a list of possible values\\n\",\n \"- Decode: given a value return a list of categories\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"## Example\\n\",\n \"\\n\",\n \"MOD09 (http://modis-sr.ltdri.org/guide/MOD09_UserGuide_v1_3.pdf)\\n\",\n \"(page 28, state1km, 16 bits):\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 1,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"import ee\\n\",\n \"ee.Initialize()\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 2,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"from geetools import bitreader, cloud_mask\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 3,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"options = {\\n\",\n \" '0-1': {0:'clear', 1:'cloud', 2:'mix'}, # cloud state\\n\",\n \" '2-2': {0: 'no_shadow', 1:'shadow'}, # cloud shadow (bit 0 is not needed)\\n\",\n \" '6-7': {0:'climatology', 1:'low', 2:'average', 3:'high'} # land/water flag\\n\",\n \" }\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 4,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"reader = bitreader.BitReader(options, 16)\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"Internally it computes a dict with\\n\",\n \"- bit_length (length of the group of bits)\\n\",\n \"- lshift (left shift)\\n\",\n \"- shifted (shifted places)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 5,\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"{'clear': {'bit_length': 2, 'lshift': 0, 'shifted': 0},\\n\",\n \" 'cloud': {'bit_length': 2, 'lshift': 0, 'shifted': 1},\\n\",\n \" 'mix': {'bit_length': 2, 'lshift': 0, 'shifted': 2},\\n\",\n \" 'no_shadow': {'bit_length': 1, 'lshift': 2, 'shifted': 0},\\n\",\n \" 'shadow': {'bit_length': 1, 'lshift': 2, 'shifted': 1},\\n\",\n \" 'climatology': {'bit_length': 2, 'lshift': 6, 'shifted': 0},\\n\",\n \" 'low': {'bit_length': 2, 'lshift': 6, 'shifted': 1},\\n\",\n \" 'average': {'bit_length': 2, 'lshift': 6, 'shifted': 2},\\n\",\n \" 'high': {'bit_length': 2, 'lshift': 6, 'shifted': 3}}\"\n ]\n },\n \"execution_count\": 5,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"reader.info\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 6,\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"bit length 16\\n\"\n ]\n }\n ],\n \"source\": [\n \"print('bit length', reader.bit_length)\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"DECODE ONE VALUE\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 7,\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"204: 11001100\\n\"\n ]\n }\n ],\n \"source\": [\n \"value = 204\\n\",\n \"bits = reader.getBin(value)\\n\",\n \"print('204:', bits)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 8,\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"['clear', 'shadow', 'high']\"\n ]\n },\n \"execution_count\": 8,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"reader.decode(204)\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"MATCH ONE VALUE\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 9,\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"False\"\n ]\n },\n \"execution_count\": 9,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"reader.match(204, 'cloud')\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 10,\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"True\"\n ]\n },\n \"execution_count\": 10,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"reader.match(204, 'shadow')\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"ENCODE A VALUE (EXCLUSIVELLY)\\n\",\n \"\\n\",\n \"In this case, shadow is 00000100 (4) and **not** 00000101 (5)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 11,\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"4\"\n ]\n },\n \"execution_count\": 11,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"reader.encode('shadow')\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 12,\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"0\"\n ]\n },\n \"execution_count\": 12,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"reader.encode('clear')\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 13,\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"0\"\n ]\n },\n \"execution_count\": 13,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"reader.encode('no_shadow')\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"ENCODE A VALUE (ALL)\\n\",\n \"\\n\",\n \"This will get **all** values (all combinations where the bit is set)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 14,\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"[4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31, 36, 37, 38, 39, 44, 45, 46, 47, 52, 53, 54, 55, 60, 61, 62, 63, 68, 69, 70, 71, 76, 77, 78, 79, 84, 85, 86, 87, 92, 93, 94, 95, 100, 101, 102, 103, 108, 109, 110, 111, 116, 117, 118, 119, 124, 125, 126, 127, 132, 133, 134, 135, 140, 141, 142, 143, 148, 149, 150, 151, 156, 157, 158, 159, 164, 165, 166, 167, 172, 173, 174, 175, 180, 181, 182, 183, 188, 189, 190, 191, 196, 197, 198, 199]\\n\"\n ]\n }\n ],\n \"source\": [\n \"print(reader.encodeOne('shadow')[0:100])\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 15,\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"[1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 169, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 233, 237, 241, 245, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293, 297, 301, 305, 309, 313, 317, 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 365, 369, 373, 377, 381, 385, 389, 393, 397]\\n\"\n ]\n }\n ],\n \"source\": [\n \"print(reader.encodeOne('cloud')[0:100])\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"ENCODE AND\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 16,\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"[5, 13, 21, 29, 37, 45, 53, 61, 69, 77, 85, 93, 101, 109, 117, 125, 133, 141, 149, 157, 165, 173, 181, 189, 197, 205, 213, 221, 229, 237, 245, 253, 261, 269, 277, 285, 293, 301, 309, 317, 325, 333, 341, 349, 357, 365, 373, 381, 389, 397, 405, 413, 421, 429, 437, 445, 453, 461, 469, 477, 485, 493, 501, 509, 517, 525, 533, 541, 549, 557, 565, 573, 581, 589, 597, 605, 613, 621, 629, 637, 645, 653, 661, 669, 677, 685, 693, 701, 709, 717, 725, 733, 741, 749, 757, 765, 773, 781, 789, 797]\\n\"\n ]\n }\n ],\n \"source\": [\n \"print(reader.encodeAnd('cloud', 'shadow')[0:100])\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"### DECODE AN IMAGE\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 17,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"import ee\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 18,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"import ipygee as ui\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 19,\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"application/vnd.jupyter.widget-view+json\": {\n \"model_id\": \"96a8fc1124ba418c801df5823c46f1ef\",\n \"version_major\": 2,\n \"version_minor\": 0\n },\n \"text/plain\": [\n \"Map(center=[0, 0], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_text'…\"\n ]\n },\n \"metadata\": {},\n \"output_type\": \"display_data\"\n },\n {\n \"data\": {\n \"application/vnd.jupyter.widget-view+json\": {\n \"model_id\": \"4122990af7f34aaa909ab6024a06a3df\",\n \"version_major\": 2,\n \"version_minor\": 0\n },\n \"text/plain\": [\n \"Tab(children=(CustomInspector(children=(SelectMultiple(options=OrderedDict(), value=()), Accordion(selected_in…\"\n ]\n },\n \"metadata\": {},\n \"output_type\": \"display_data\"\n }\n ],\n \"source\": [\n \"Map = ui.Map()\\n\",\n \"Map.show()\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 20,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"modcol = ee.ImageCollection('MODIS/006/MOD09GA').sort('system:time_start', False)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 21,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"mod = ee.Image(modcol.first())\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"BANDS\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 22,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"red = 'sur_refl_b01'\\n\",\n \"green = 'sur_refl_b04'\\n\",\n \"blue = 'sur_refl_b03'\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 23,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"qa = 'state_1km'\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 24,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"qa_mask = mod.select(qa)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 25,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"Map.addLayer(mod, {'bands':[red, green, blue], 'min':0, 'max':5000}, 'Original')\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 26,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"Map.addLayer(qa_mask, {'min':0, 'max':reader.max}, 'QA')\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"APPLY THE `BitReader` TO THE BAND THAT HOLDS THE BIT INFORMATION\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 27,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"mask = reader.decodeImage(mod, qa)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 28,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"Map.addLayer(mask.select(['cloud']), {'min':0, 'max':1}, 'Clouds')\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"`BitReader` INFORMATION FOR KNOW COLLECTIONS AVAILABLE IN `geetools.cloud_mask` MODULE\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 29,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"from geetools import cloud_mask\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 30,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"state1km = cloud_mask.BITS_MODIS09GA\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 31,\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"{'0-1': {0: 'clear', 1: 'cloud', 2: 'mix'},\\n\",\n \" '2': {1: 'shadow'},\\n\",\n \" '8-9': {1: 'small_cirrus', 2: 'average_cirrus', 3: 'high_cirrus'},\\n\",\n \" '13': {1: 'adjacent'},\\n\",\n \" '15': {1: 'snow'}}\"\n ]\n },\n \"execution_count\": 31,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"state1km\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": []\n }\n ],\n \"metadata\": {\n \"kernelspec\": {\n \"display_name\": \"Python 3\",\n \"language\": \"python\",\n \"name\": \"python3\"\n },\n \"language_info\": {\n \"codemirror_mode\": {\n \"name\": \"ipython\",\n \"version\": 3\n },\n \"file_extension\": \".py\",\n \"mimetype\": \"text/x-python\",\n \"name\": \"python\",\n \"nbconvert_exporter\": \"python\",\n \"pygments_lexer\": \"ipython3\",\n \"version\": \"3.7.6\"\n }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"} +{"text": "\n\n\n\n\n\n\n\n\nandroid.support.design.widget.FloatingActionButton\n\n\n\n\n\n\n\n\n\n
\n
\n\"Android\n
\n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
API Diff Specification
To Level:23.1.0
From Level:23.0.0
Generated2015.10.15 12:23
\n
\n
\n \n \n \n
Statistics\n
\n
\n
\n
\n
\n
\n
\n

\nClass android.support.design.widget.FloatingActionButton\n

\n

The superclass changed from android.widget.ImageView to android.widget.ImageButton.
\n\n\n

\n\n\n\n \n\n \n \n\n\n \n \n\n
Added Methods\n
\n \n void hide(OnVisibilityChangedListener)\n  
\n \n void show(OnVisibilityChangedListener)\n  
\n \n\n

\t\n
\n
\n Except as noted, this content is licensed under \n Creative Commons Attribution 2.5.\n For details and restrictions, see the Content License.\n
\n \n
\n
\n
\n\n\n\n\n"} +{"text": "/*\n * drivers/net/ethernet/mellanox/mlxsw/spectrum.h\n * Copyright (c) 2015-2017 Mellanox Technologies. All rights reserved.\n * Copyright (c) 2015-2017 Jiri Pirko \n * Copyright (c) 2015 Ido Schimmel \n * Copyright (c) 2015 Elad Raz \n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the names of the copyright holders 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 * Alternatively, this software may be distributed under the terms of the\n * GNU General Public License (\"GPL\") version 2 as published by the Free\n * Software Foundation.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef _MLXSW_SPECTRUM_H\n#define _MLXSW_SPECTRUM_H\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \"port.h\"\n#include \"core.h\"\n#include \"core_acl_flex_keys.h\"\n#include \"core_acl_flex_actions.h\"\n\n#define MLXSW_SP_VFID_BASE VLAN_N_VID\n#define MLXSW_SP_VFID_MAX 1024\t/* Bridged VLAN interfaces */\n\n#define MLXSW_SP_RFID_BASE 15360\n#define MLXSW_SP_INVALID_RIF 0xffff\n\n#define MLXSW_SP_MID_MAX 7000\n\n#define MLXSW_SP_PORTS_PER_CLUSTER_MAX 4\n\n#define MLXSW_SP_LPM_TREE_MIN 2 /* trees 0 and 1 are reserved */\n#define MLXSW_SP_LPM_TREE_MAX 22\n#define MLXSW_SP_LPM_TREE_COUNT (MLXSW_SP_LPM_TREE_MAX - MLXSW_SP_LPM_TREE_MIN)\n\n#define MLXSW_SP_PORT_BASE_SPEED 25000\t/* Mb/s */\n\n#define MLXSW_SP_BYTES_PER_CELL 96\n\n#define MLXSW_SP_BYTES_TO_CELLS(b) DIV_ROUND_UP(b, MLXSW_SP_BYTES_PER_CELL)\n#define MLXSW_SP_CELLS_TO_BYTES(c) (c * MLXSW_SP_BYTES_PER_CELL)\n\n#define MLXSW_SP_KVD_LINEAR_SIZE 65536 /* entries */\n#define MLXSW_SP_KVD_GRANULARITY 128\n\n/* Maximum delay buffer needed in case of PAUSE frames, in cells.\n * Assumes 100m cable and maximum MTU.\n */\n#define MLXSW_SP_PAUSE_DELAY 612\n\n#define MLXSW_SP_CELL_FACTOR 2\t/* 2 * cell_size / (IPG + cell_size + 1) */\n\nstatic inline u16 mlxsw_sp_pfc_delay_get(int mtu, u16 delay)\n{\n\tdelay = MLXSW_SP_BYTES_TO_CELLS(DIV_ROUND_UP(delay, BITS_PER_BYTE));\n\treturn MLXSW_SP_CELL_FACTOR * delay + MLXSW_SP_BYTES_TO_CELLS(mtu);\n}\n\nstruct mlxsw_sp_port;\n\nstruct mlxsw_sp_upper {\n\tstruct net_device *dev;\n\tunsigned int ref_count;\n};\n\nstruct mlxsw_sp_fid {\n\tvoid (*leave)(struct mlxsw_sp_port *mlxsw_sp_vport);\n\tstruct list_head list;\n\tunsigned int ref_count;\n\tstruct net_device *dev;\n\tstruct mlxsw_sp_rif *r;\n\tu16 fid;\n};\n\nstruct mlxsw_sp_rif {\n\tstruct list_head nexthop_list;\n\tstruct list_head neigh_list;\n\tstruct net_device *dev;\n\tunsigned int ref_count;\n\tstruct mlxsw_sp_fid *f;\n\tunsigned char addr[ETH_ALEN];\n\tint mtu;\n\tu16 rif;\n};\n\nstruct mlxsw_sp_mid {\n\tstruct list_head list;\n\tunsigned char addr[ETH_ALEN];\n\tu16 fid;\n\tu16 mid;\n\tunsigned int ref_count;\n};\n\nstatic inline u16 mlxsw_sp_vfid_to_fid(u16 vfid)\n{\n\treturn MLXSW_SP_VFID_BASE + vfid;\n}\n\nstatic inline u16 mlxsw_sp_fid_to_vfid(u16 fid)\n{\n\treturn fid - MLXSW_SP_VFID_BASE;\n}\n\nstatic inline bool mlxsw_sp_fid_is_vfid(u16 fid)\n{\n\treturn fid >= MLXSW_SP_VFID_BASE && fid < MLXSW_SP_RFID_BASE;\n}\n\nstatic inline bool mlxsw_sp_fid_is_rfid(u16 fid)\n{\n\treturn fid >= MLXSW_SP_RFID_BASE;\n}\n\nstatic inline u16 mlxsw_sp_rif_sp_to_fid(u16 rif)\n{\n\treturn MLXSW_SP_RFID_BASE + rif;\n}\n\nstruct mlxsw_sp_sb_pr {\n\tenum mlxsw_reg_sbpr_mode mode;\n\tu32 size;\n};\n\nstruct mlxsw_cp_sb_occ {\n\tu32 cur;\n\tu32 max;\n};\n\nstruct mlxsw_sp_sb_cm {\n\tu32 min_buff;\n\tu32 max_buff;\n\tu8 pool;\n\tstruct mlxsw_cp_sb_occ occ;\n};\n\nstruct mlxsw_sp_sb_pm {\n\tu32 min_buff;\n\tu32 max_buff;\n\tstruct mlxsw_cp_sb_occ occ;\n};\n\n#define MLXSW_SP_SB_POOL_COUNT\t4\n#define MLXSW_SP_SB_TC_COUNT\t8\n\nstruct mlxsw_sp_sb {\n\tstruct mlxsw_sp_sb_pr prs[2][MLXSW_SP_SB_POOL_COUNT];\n\tstruct {\n\t\tstruct mlxsw_sp_sb_cm cms[2][MLXSW_SP_SB_TC_COUNT];\n\t\tstruct mlxsw_sp_sb_pm pms[2][MLXSW_SP_SB_POOL_COUNT];\n\t} ports[MLXSW_PORT_MAX_PORTS];\n};\n\n#define MLXSW_SP_PREFIX_COUNT (sizeof(struct in6_addr) * BITS_PER_BYTE)\n\nstruct mlxsw_sp_prefix_usage {\n\tDECLARE_BITMAP(b, MLXSW_SP_PREFIX_COUNT);\n};\n\nenum mlxsw_sp_l3proto {\n\tMLXSW_SP_L3_PROTO_IPV4,\n\tMLXSW_SP_L3_PROTO_IPV6,\n};\n\nstruct mlxsw_sp_lpm_tree {\n\tu8 id; /* tree ID */\n\tunsigned int ref_count;\n\tenum mlxsw_sp_l3proto proto;\n\tstruct mlxsw_sp_prefix_usage prefix_usage;\n};\n\nstruct mlxsw_sp_fib;\n\nstruct mlxsw_sp_vr {\n\tu16 id; /* virtual router ID */\n\tbool used;\n\tenum mlxsw_sp_l3proto proto;\n\tu32 tb_id; /* kernel fib table id */\n\tstruct mlxsw_sp_lpm_tree *lpm_tree;\n\tstruct mlxsw_sp_fib *fib;\n};\n\nenum mlxsw_sp_span_type {\n\tMLXSW_SP_SPAN_EGRESS,\n\tMLXSW_SP_SPAN_INGRESS\n};\n\nstruct mlxsw_sp_span_inspected_port {\n\tstruct list_head list;\n\tenum mlxsw_sp_span_type type;\n\tu8 local_port;\n};\n\nstruct mlxsw_sp_span_entry {\n\tu8 local_port;\n\tbool used;\n\tstruct list_head bound_ports_list;\n\tint ref_count;\n\tint id;\n};\n\nenum mlxsw_sp_port_mall_action_type {\n\tMLXSW_SP_PORT_MALL_MIRROR,\n\tMLXSW_SP_PORT_MALL_SAMPLE,\n};\n\nstruct mlxsw_sp_port_mall_mirror_tc_entry {\n\tu8 to_local_port;\n\tbool ingress;\n};\n\nstruct mlxsw_sp_port_mall_tc_entry {\n\tstruct list_head list;\n\tunsigned long cookie;\n\tenum mlxsw_sp_port_mall_action_type type;\n\tunion {\n\t\tstruct mlxsw_sp_port_mall_mirror_tc_entry mirror;\n\t};\n};\n\nstruct mlxsw_sp_router {\n\tstruct mlxsw_sp_lpm_tree lpm_trees[MLXSW_SP_LPM_TREE_COUNT];\n\tstruct mlxsw_sp_vr *vrs;\n\tstruct rhashtable neigh_ht;\n\tstruct rhashtable nexthop_group_ht;\n\tstruct rhashtable nexthop_ht;\n\tstruct {\n\t\tstruct delayed_work dw;\n\t\tunsigned long interval;\t/* ms */\n\t} neighs_update;\n\tstruct delayed_work nexthop_probe_dw;\n#define MLXSW_SP_UNRESOLVED_NH_PROBE_INTERVAL 5000 /* ms */\n\tstruct list_head nexthop_neighs_list;\n\tbool aborted;\n};\n\nstruct mlxsw_sp_acl;\n\nstruct mlxsw_sp {\n\tstruct {\n\t\tstruct list_head list;\n\t\tDECLARE_BITMAP(mapped, MLXSW_SP_VFID_MAX);\n\t} vfids;\n\tstruct {\n\t\tstruct list_head list;\n\t\tDECLARE_BITMAP(mapped, MLXSW_SP_MID_MAX);\n\t} br_mids;\n\tstruct list_head fids;\t/* VLAN-aware bridge FIDs */\n\tstruct mlxsw_sp_rif **rifs;\n\tstruct mlxsw_sp_port **ports;\n\tstruct mlxsw_core *core;\n\tconst struct mlxsw_bus_info *bus_info;\n\tunsigned char base_mac[ETH_ALEN];\n\tstruct {\n\t\tstruct delayed_work dw;\n#define MLXSW_SP_DEFAULT_LEARNING_INTERVAL 100\n\t\tunsigned int interval; /* ms */\n\t} fdb_notify;\n#define MLXSW_SP_MIN_AGEING_TIME 10\n#define MLXSW_SP_MAX_AGEING_TIME 1000000\n#define MLXSW_SP_DEFAULT_AGEING_TIME 300\n\tu32 ageing_time;\n\tstruct mlxsw_sp_upper master_bridge;\n\tstruct mlxsw_sp_upper *lags;\n\tu8 port_to_module[MLXSW_PORT_MAX_PORTS];\n\tstruct mlxsw_sp_sb sb;\n\tstruct mlxsw_sp_router router;\n\tstruct mlxsw_sp_acl *acl;\n\tstruct {\n\t\tDECLARE_BITMAP(usage, MLXSW_SP_KVD_LINEAR_SIZE);\n\t} kvdl;\n\n\tstruct {\n\t\tstruct mlxsw_sp_span_entry *entries;\n\t\tint entries_count;\n\t} span;\n\tstruct notifier_block fib_nb;\n};\n\nstatic inline struct mlxsw_sp_upper *\nmlxsw_sp_lag_get(struct mlxsw_sp *mlxsw_sp, u16 lag_id)\n{\n\treturn &mlxsw_sp->lags[lag_id];\n}\n\nstruct mlxsw_sp_port_pcpu_stats {\n\tu64\t\t\trx_packets;\n\tu64\t\t\trx_bytes;\n\tu64\t\t\ttx_packets;\n\tu64\t\t\ttx_bytes;\n\tstruct u64_stats_sync\tsyncp;\n\tu32\t\t\ttx_dropped;\n};\n\nstruct mlxsw_sp_port_sample {\n\tstruct psample_group __rcu *psample_group;\n\tu32 trunc_size;\n\tu32 rate;\n\tbool truncate;\n};\n\nstruct mlxsw_sp_port {\n\tstruct net_device *dev;\n\tstruct mlxsw_sp_port_pcpu_stats __percpu *pcpu_stats;\n\tstruct mlxsw_sp *mlxsw_sp;\n\tu8 local_port;\n\tu8 stp_state;\n\tu16 learning:1,\n\t learning_sync:1,\n\t uc_flood:1,\n\t mc_flood:1,\n\t mc_router:1,\n\t mc_disabled:1,\n\t bridged:1,\n\t lagged:1,\n\t split:1;\n\tu16 pvid;\n\tu16 lag_id;\n\tstruct {\n\t\tstruct list_head list;\n\t\tstruct mlxsw_sp_fid *f;\n\t\tu16 vid;\n\t} vport;\n\tstruct {\n\t\tu8 tx_pause:1,\n\t\t rx_pause:1,\n\t\t autoneg:1;\n\t} link;\n\tstruct {\n\t\tstruct ieee_ets *ets;\n\t\tstruct ieee_maxrate *maxrate;\n\t\tstruct ieee_pfc *pfc;\n\t} dcb;\n\tstruct {\n\t\tu8 module;\n\t\tu8 width;\n\t\tu8 lane;\n\t} mapping;\n\t/* 802.1Q bridge VLANs */\n\tunsigned long *active_vlans;\n\tunsigned long *untagged_vlans;\n\t/* VLAN interfaces */\n\tstruct list_head vports_list;\n\t/* TC handles */\n\tstruct list_head mall_tc_list;\n\tstruct {\n\t\t#define MLXSW_HW_STATS_UPDATE_TIME HZ\n\t\tstruct rtnl_link_stats64 *cache;\n\t\tstruct delayed_work update_dw;\n\t} hw_stats;\n\tstruct mlxsw_sp_port_sample *sample;\n};\n\nbool mlxsw_sp_port_dev_check(const struct net_device *dev);\nstruct mlxsw_sp_port *mlxsw_sp_port_lower_dev_hold(struct net_device *dev);\nvoid mlxsw_sp_port_dev_put(struct mlxsw_sp_port *mlxsw_sp_port);\n\nstatic inline bool\nmlxsw_sp_port_is_pause_en(const struct mlxsw_sp_port *mlxsw_sp_port)\n{\n\treturn mlxsw_sp_port->link.tx_pause || mlxsw_sp_port->link.rx_pause;\n}\n\nstatic inline struct mlxsw_sp_port *\nmlxsw_sp_port_lagged_get(struct mlxsw_sp *mlxsw_sp, u16 lag_id, u8 port_index)\n{\n\tstruct mlxsw_sp_port *mlxsw_sp_port;\n\tu8 local_port;\n\n\tlocal_port = mlxsw_core_lag_mapping_get(mlxsw_sp->core,\n\t\t\t\t\t\tlag_id, port_index);\n\tmlxsw_sp_port = mlxsw_sp->ports[local_port];\n\treturn mlxsw_sp_port && mlxsw_sp_port->lagged ? mlxsw_sp_port : NULL;\n}\n\nstatic inline u16\nmlxsw_sp_vport_vid_get(const struct mlxsw_sp_port *mlxsw_sp_vport)\n{\n\treturn mlxsw_sp_vport->vport.vid;\n}\n\nstatic inline bool\nmlxsw_sp_port_is_vport(const struct mlxsw_sp_port *mlxsw_sp_port)\n{\n\tu16 vid = mlxsw_sp_vport_vid_get(mlxsw_sp_port);\n\n\treturn vid != 0;\n}\n\nstatic inline void mlxsw_sp_vport_fid_set(struct mlxsw_sp_port *mlxsw_sp_vport,\n\t\t\t\t\t struct mlxsw_sp_fid *f)\n{\n\tmlxsw_sp_vport->vport.f = f;\n}\n\nstatic inline struct mlxsw_sp_fid *\nmlxsw_sp_vport_fid_get(const struct mlxsw_sp_port *mlxsw_sp_vport)\n{\n\treturn mlxsw_sp_vport->vport.f;\n}\n\nstatic inline struct net_device *\nmlxsw_sp_vport_dev_get(const struct mlxsw_sp_port *mlxsw_sp_vport)\n{\n\tstruct mlxsw_sp_fid *f = mlxsw_sp_vport_fid_get(mlxsw_sp_vport);\n\n\treturn f ? f->dev : NULL;\n}\n\nstatic inline struct mlxsw_sp_port *\nmlxsw_sp_port_vport_find(const struct mlxsw_sp_port *mlxsw_sp_port, u16 vid)\n{\n\tstruct mlxsw_sp_port *mlxsw_sp_vport;\n\n\tlist_for_each_entry(mlxsw_sp_vport, &mlxsw_sp_port->vports_list,\n\t\t\t vport.list) {\n\t\tif (mlxsw_sp_vport_vid_get(mlxsw_sp_vport) == vid)\n\t\t\treturn mlxsw_sp_vport;\n\t}\n\n\treturn NULL;\n}\n\nstatic inline struct mlxsw_sp_port *\nmlxsw_sp_port_vport_find_by_fid(const struct mlxsw_sp_port *mlxsw_sp_port,\n\t\t\t\tu16 fid)\n{\n\tstruct mlxsw_sp_port *mlxsw_sp_vport;\n\n\tlist_for_each_entry(mlxsw_sp_vport, &mlxsw_sp_port->vports_list,\n\t\t\t vport.list) {\n\t\tstruct mlxsw_sp_fid *f = mlxsw_sp_vport_fid_get(mlxsw_sp_vport);\n\n\t\tif (f && f->fid == fid)\n\t\t\treturn mlxsw_sp_vport;\n\t}\n\n\treturn NULL;\n}\n\nstatic inline struct mlxsw_sp_fid *mlxsw_sp_fid_find(struct mlxsw_sp *mlxsw_sp,\n\t\t\t\t\t\t u16 fid)\n{\n\tstruct mlxsw_sp_fid *f;\n\n\tlist_for_each_entry(f, &mlxsw_sp->fids, list)\n\t\tif (f->fid == fid)\n\t\t\treturn f;\n\n\treturn NULL;\n}\n\nstatic inline struct mlxsw_sp_fid *\nmlxsw_sp_vfid_find(const struct mlxsw_sp *mlxsw_sp,\n\t\t const struct net_device *br_dev)\n{\n\tstruct mlxsw_sp_fid *f;\n\n\tlist_for_each_entry(f, &mlxsw_sp->vfids.list, list)\n\t\tif (f->dev == br_dev)\n\t\t\treturn f;\n\n\treturn NULL;\n}\n\nstatic inline struct mlxsw_sp_rif *\nmlxsw_sp_rif_find_by_dev(const struct mlxsw_sp *mlxsw_sp,\n\t\t\t const struct net_device *dev)\n{\n\tint i;\n\n\tfor (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++)\n\t\tif (mlxsw_sp->rifs[i] && mlxsw_sp->rifs[i]->dev == dev)\n\t\t\treturn mlxsw_sp->rifs[i];\n\n\treturn NULL;\n}\n\nenum mlxsw_sp_flood_table {\n\tMLXSW_SP_FLOOD_TABLE_UC,\n\tMLXSW_SP_FLOOD_TABLE_BC,\n\tMLXSW_SP_FLOOD_TABLE_MC,\n};\n\nint mlxsw_sp_buffers_init(struct mlxsw_sp *mlxsw_sp);\nvoid mlxsw_sp_buffers_fini(struct mlxsw_sp *mlxsw_sp);\nint mlxsw_sp_port_buffers_init(struct mlxsw_sp_port *mlxsw_sp_port);\nint mlxsw_sp_sb_pool_get(struct mlxsw_core *mlxsw_core,\n\t\t\t unsigned int sb_index, u16 pool_index,\n\t\t\t struct devlink_sb_pool_info *pool_info);\nint mlxsw_sp_sb_pool_set(struct mlxsw_core *mlxsw_core,\n\t\t\t unsigned int sb_index, u16 pool_index, u32 size,\n\t\t\t enum devlink_sb_threshold_type threshold_type);\nint mlxsw_sp_sb_port_pool_get(struct mlxsw_core_port *mlxsw_core_port,\n\t\t\t unsigned int sb_index, u16 pool_index,\n\t\t\t u32 *p_threshold);\nint mlxsw_sp_sb_port_pool_set(struct mlxsw_core_port *mlxsw_core_port,\n\t\t\t unsigned int sb_index, u16 pool_index,\n\t\t\t u32 threshold);\nint mlxsw_sp_sb_tc_pool_bind_get(struct mlxsw_core_port *mlxsw_core_port,\n\t\t\t\t unsigned int sb_index, u16 tc_index,\n\t\t\t\t enum devlink_sb_pool_type pool_type,\n\t\t\t\t u16 *p_pool_index, u32 *p_threshold);\nint mlxsw_sp_sb_tc_pool_bind_set(struct mlxsw_core_port *mlxsw_core_port,\n\t\t\t\t unsigned int sb_index, u16 tc_index,\n\t\t\t\t enum devlink_sb_pool_type pool_type,\n\t\t\t\t u16 pool_index, u32 threshold);\nint mlxsw_sp_sb_occ_snapshot(struct mlxsw_core *mlxsw_core,\n\t\t\t unsigned int sb_index);\nint mlxsw_sp_sb_occ_max_clear(struct mlxsw_core *mlxsw_core,\n\t\t\t unsigned int sb_index);\nint mlxsw_sp_sb_occ_port_pool_get(struct mlxsw_core_port *mlxsw_core_port,\n\t\t\t\t unsigned int sb_index, u16 pool_index,\n\t\t\t\t u32 *p_cur, u32 *p_max);\nint mlxsw_sp_sb_occ_tc_port_bind_get(struct mlxsw_core_port *mlxsw_core_port,\n\t\t\t\t unsigned int sb_index, u16 tc_index,\n\t\t\t\t enum devlink_sb_pool_type pool_type,\n\t\t\t\t u32 *p_cur, u32 *p_max);\n\nint mlxsw_sp_switchdev_init(struct mlxsw_sp *mlxsw_sp);\nvoid mlxsw_sp_switchdev_fini(struct mlxsw_sp *mlxsw_sp);\nint mlxsw_sp_port_vlan_init(struct mlxsw_sp_port *mlxsw_sp_port);\nvoid mlxsw_sp_port_switchdev_init(struct mlxsw_sp_port *mlxsw_sp_port);\nvoid mlxsw_sp_port_switchdev_fini(struct mlxsw_sp_port *mlxsw_sp_port);\nint mlxsw_sp_port_vid_to_fid_set(struct mlxsw_sp_port *mlxsw_sp_port,\n\t\t\t\t enum mlxsw_reg_svfa_mt mt, bool valid, u16 fid,\n\t\t\t\t u16 vid);\nint mlxsw_sp_port_vlan_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid_begin,\n\t\t\t u16 vid_end, bool is_member, bool untagged);\nint mlxsw_sp_vport_flood_set(struct mlxsw_sp_port *mlxsw_sp_vport, u16 fid,\n\t\t\t bool set);\nvoid mlxsw_sp_port_active_vlans_del(struct mlxsw_sp_port *mlxsw_sp_port);\nint mlxsw_sp_port_pvid_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid);\nint mlxsw_sp_port_fdb_flush(struct mlxsw_sp_port *mlxsw_sp_port, u16 fid);\nint mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid,\n\t\t\tbool adding);\nstruct mlxsw_sp_fid *mlxsw_sp_fid_create(struct mlxsw_sp *mlxsw_sp, u16 fid);\nvoid mlxsw_sp_fid_destroy(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_fid *f);\nvoid mlxsw_sp_rif_bridge_destroy(struct mlxsw_sp *mlxsw_sp,\n\t\t\t\t struct mlxsw_sp_rif *r);\nint mlxsw_sp_port_ets_set(struct mlxsw_sp_port *mlxsw_sp_port,\n\t\t\t enum mlxsw_reg_qeec_hr hr, u8 index, u8 next_index,\n\t\t\t bool dwrr, u8 dwrr_weight);\nint mlxsw_sp_port_prio_tc_set(struct mlxsw_sp_port *mlxsw_sp_port,\n\t\t\t u8 switch_prio, u8 tclass);\nint __mlxsw_sp_port_headroom_set(struct mlxsw_sp_port *mlxsw_sp_port, int mtu,\n\t\t\t\t u8 *prio_tc, bool pause_en,\n\t\t\t\t struct ieee_pfc *my_pfc);\nint mlxsw_sp_port_ets_maxrate_set(struct mlxsw_sp_port *mlxsw_sp_port,\n\t\t\t\t enum mlxsw_reg_qeec_hr hr, u8 index,\n\t\t\t\t u8 next_index, u32 maxrate);\nint __mlxsw_sp_port_vid_learning_set(struct mlxsw_sp_port *mlxsw_sp_port,\n\t\t\t\t u16 vid_begin, u16 vid_end,\n\t\t\t\t bool learn_enable);\n\n#ifdef CONFIG_MLXSW_SPECTRUM_DCB\n\nint mlxsw_sp_port_dcb_init(struct mlxsw_sp_port *mlxsw_sp_port);\nvoid mlxsw_sp_port_dcb_fini(struct mlxsw_sp_port *mlxsw_sp_port);\n\n#else\n\nstatic inline int mlxsw_sp_port_dcb_init(struct mlxsw_sp_port *mlxsw_sp_port)\n{\n\treturn 0;\n}\n\nstatic inline void mlxsw_sp_port_dcb_fini(struct mlxsw_sp_port *mlxsw_sp_port)\n{}\n\n#endif\n\nint mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp);\nvoid mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp);\nint mlxsw_sp_router_netevent_event(struct notifier_block *unused,\n\t\t\t\t unsigned long event, void *ptr);\nvoid mlxsw_sp_router_rif_gone_sync(struct mlxsw_sp *mlxsw_sp,\n\t\t\t\t struct mlxsw_sp_rif *r);\n\nint mlxsw_sp_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, unsigned int entry_count);\nvoid mlxsw_sp_kvdl_free(struct mlxsw_sp *mlxsw_sp, int entry_index);\n\nstruct mlxsw_afk *mlxsw_sp_acl_afk(struct mlxsw_sp_acl *acl);\n\nstruct mlxsw_sp_acl_rule_info {\n\tunsigned int priority;\n\tstruct mlxsw_afk_element_values values;\n\tstruct mlxsw_afa_block *act_block;\n};\n\nenum mlxsw_sp_acl_profile {\n\tMLXSW_SP_ACL_PROFILE_FLOWER,\n};\n\nstruct mlxsw_sp_acl_profile_ops {\n\tsize_t ruleset_priv_size;\n\tint (*ruleset_add)(struct mlxsw_sp *mlxsw_sp,\n\t\t\t void *priv, void *ruleset_priv);\n\tvoid (*ruleset_del)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv);\n\tint (*ruleset_bind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv,\n\t\t\t struct net_device *dev, bool ingress);\n\tvoid (*ruleset_unbind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv);\n\tsize_t rule_priv_size;\n\tint (*rule_add)(struct mlxsw_sp *mlxsw_sp,\n\t\t\tvoid *ruleset_priv, void *rule_priv,\n\t\t\tstruct mlxsw_sp_acl_rule_info *rulei);\n\tvoid (*rule_del)(struct mlxsw_sp *mlxsw_sp, void *rule_priv);\n};\n\nstruct mlxsw_sp_acl_ops {\n\tsize_t priv_size;\n\tint (*init)(struct mlxsw_sp *mlxsw_sp, void *priv);\n\tvoid (*fini)(struct mlxsw_sp *mlxsw_sp, void *priv);\n\tconst struct mlxsw_sp_acl_profile_ops *\n\t\t\t(*profile_ops)(struct mlxsw_sp *mlxsw_sp,\n\t\t\t\t enum mlxsw_sp_acl_profile profile);\n};\n\nstruct mlxsw_sp_acl_ruleset;\n\nstruct mlxsw_sp_acl_ruleset *\nmlxsw_sp_acl_ruleset_get(struct mlxsw_sp *mlxsw_sp,\n\t\t\t struct net_device *dev, bool ingress,\n\t\t\t enum mlxsw_sp_acl_profile profile);\nvoid mlxsw_sp_acl_ruleset_put(struct mlxsw_sp *mlxsw_sp,\n\t\t\t struct mlxsw_sp_acl_ruleset *ruleset);\n\nstruct mlxsw_sp_acl_rule_info *\nmlxsw_sp_acl_rulei_create(struct mlxsw_sp_acl *acl);\nvoid mlxsw_sp_acl_rulei_destroy(struct mlxsw_sp_acl_rule_info *rulei);\nint mlxsw_sp_acl_rulei_commit(struct mlxsw_sp_acl_rule_info *rulei);\nvoid mlxsw_sp_acl_rulei_priority(struct mlxsw_sp_acl_rule_info *rulei,\n\t\t\t\t unsigned int priority);\nvoid mlxsw_sp_acl_rulei_keymask_u32(struct mlxsw_sp_acl_rule_info *rulei,\n\t\t\t\t enum mlxsw_afk_element element,\n\t\t\t\t u32 key_value, u32 mask_value);\nvoid mlxsw_sp_acl_rulei_keymask_buf(struct mlxsw_sp_acl_rule_info *rulei,\n\t\t\t\t enum mlxsw_afk_element element,\n\t\t\t\t const char *key_value,\n\t\t\t\t const char *mask_value, unsigned int len);\nvoid mlxsw_sp_acl_rulei_act_continue(struct mlxsw_sp_acl_rule_info *rulei);\nvoid mlxsw_sp_acl_rulei_act_jump(struct mlxsw_sp_acl_rule_info *rulei,\n\t\t\t\t u16 group_id);\nint mlxsw_sp_acl_rulei_act_drop(struct mlxsw_sp_acl_rule_info *rulei);\nint mlxsw_sp_acl_rulei_act_fwd(struct mlxsw_sp *mlxsw_sp,\n\t\t\t struct mlxsw_sp_acl_rule_info *rulei,\n\t\t\t struct net_device *out_dev);\n\nstruct mlxsw_sp_acl_rule;\n\nstruct mlxsw_sp_acl_rule *\nmlxsw_sp_acl_rule_create(struct mlxsw_sp *mlxsw_sp,\n\t\t\t struct mlxsw_sp_acl_ruleset *ruleset,\n\t\t\t unsigned long cookie);\nvoid mlxsw_sp_acl_rule_destroy(struct mlxsw_sp *mlxsw_sp,\n\t\t\t struct mlxsw_sp_acl_rule *rule);\nint mlxsw_sp_acl_rule_add(struct mlxsw_sp *mlxsw_sp,\n\t\t\t struct mlxsw_sp_acl_rule *rule);\nvoid mlxsw_sp_acl_rule_del(struct mlxsw_sp *mlxsw_sp,\n\t\t\t struct mlxsw_sp_acl_rule *rule);\nstruct mlxsw_sp_acl_rule *\nmlxsw_sp_acl_rule_lookup(struct mlxsw_sp *mlxsw_sp,\n\t\t\t struct mlxsw_sp_acl_ruleset *ruleset,\n\t\t\t unsigned long cookie);\nstruct mlxsw_sp_acl_rule_info *\nmlxsw_sp_acl_rule_rulei(struct mlxsw_sp_acl_rule *rule);\n\nint mlxsw_sp_acl_init(struct mlxsw_sp *mlxsw_sp);\nvoid mlxsw_sp_acl_fini(struct mlxsw_sp *mlxsw_sp);\n\nextern const struct mlxsw_sp_acl_ops mlxsw_sp_acl_tcam_ops;\n\nint mlxsw_sp_flower_replace(struct mlxsw_sp_port *mlxsw_sp_port, bool ingress,\n\t\t\t __be16 protocol, struct tc_cls_flower_offload *f);\nvoid mlxsw_sp_flower_destroy(struct mlxsw_sp_port *mlxsw_sp_port, bool ingress,\n\t\t\t struct tc_cls_flower_offload *f);\n\n#endif\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 ruby 1.0\n\nruby.setup taskjuggler 3.5.0 gem {} rubygems ruby19\nruby.link_binaries_suffix\nrevision 1\nname taskjuggler\nhomepage http://www.taskjuggler.org/\ncategories office pim\n\ndescription A powerful project management tool.\nlong_description TaskJuggler is a modern and powerful, Open Source \\\n project management tool.\n\nmaintainers nomaintainer\n\nlicense GPL-2\nplatforms darwin\nsupported_archs noarch\n\nchecksums rmd160 ce4ccc93c137edb2d8a7b5bf002ffb4b050f5c0d \\\n sha256 42f2e81470be9b2486fc074ba6ff04180258f462fed5c46cba871b7518cd0465\n\ndepends_lib port:ruby${ruby.suffix} \\\n port:rb${ruby.suffix}-mail \\\n port:rb${ruby.suffix}-rspec \\\n port:rb${ruby.suffix}-term-ansicolor\n\npost-destroot {\n set vim_syntax ${destroot}${prefix}/share/vim/vimfiles/syntax\n xinstall -d ${vim_syntax}\n move ${destroot}${ruby.gemdir}/gems/${name}-${version}/data/tjp.vim ${vim_syntax}\n}\n"} +{"text": "// temp19k9.scl\r\n// \r\n// Chain of 19 minor thirds tempered by 1/9 kleisma\r\n// \r\n\r\n@60\r\n\r\n:intervals\r\n\r\n261.6255653006\r\n271.81853598083\r\n282.40862793607\r\n293.41130980736\r\n304.84265779003\r\n314.11407882217\r\n326.35200974457\r\n339.06673262958\r\n352.27682225125\r\n366.00158141044\r\n377.13307501509\r\n391.82623534045\r\n407.09184571451\r\n422.95220417284\r\n439.43048454013\r\n452.79523167251\r\n470.4362008006\r\n488.76446469244\r\n507.80680338678\r\n523.2511306012\r\n"} +{"text": "reference: https://www.ipp.eu/outils/baremes-ipp/\nunit: /1\nvalues:\n 1930-07-01:\n value: 0.04\n 1936-01-01:\n value: 0.035\n 1937-01-01:\n value: 0.04\n 1945-01-01:\n value: 0.06\n 1948-07-01:\n value: 0.02\n 1967-09-01:\n value: null\n"} +{"text": "@import '../variables.scss';\n\n.metrics {\n margin: 6px 10px 8px;\n @include vertical-space-children(24px);\n}\n\n.title {\n composes: flexRow from '../dim-ui/common.m.scss';\n color: rgb(255, 255, 255);\n font-size: 16px;\n text-transform: uppercase;\n align-items: center;\n\n img {\n height: 25px;\n width: 25px;\n margin-right: 4px;\n margin-left: 5px;\n }\n}\n"} +{"text": "# $FreeBSD$\n\n.include \n\nSUBDIR= \n.if ${MK_OPENSSL} != \"no\"\nSUBDIR+=libcrypto libssl\n.if ${MK_OPENSSH} != \"no\"\nSUBDIR+=libssh\n.endif\n.if ${MK_LIBRESSL} != \"no\"\nSUBDIR+=libtls\n.endif\n.endif\n\nSUBDIR.${MK_TESTS}+= tests\n\n.include \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"} +{"text": "# WeBWorK problem written by Carl Yao\n# Portland Community College\n#\n# Prove a function is odd/even.\n#\n# Last update: Carl Yao 03/28/2018\n#\n# ENDDESCRIPTION\n\n## DBCCSS('8.F','F-IF')\n## DBsubject(Algebra)\n## DBchapter(Function)\n## DBsection(Domain and Range)\n## Institution(PCC)\n## Author(Alex Jordan, Carl Yao, Chris Hughes)\n## MO(1)\n## KEYWORDS('function')\n\n##############################################\n\nDOCUMENT();\n\nloadMacros(\n \"PGstandard.pl\",\n \"MathObjects.pl\",\n \"PGML.pl\",\n \"PGcourse.pl\",\n \"bizarroArithmetic.pl\",\n \"PCCmacros.pl\",\n);\n\n##############################################\nTEXT(beginproblem());\n\nContext(\"Numeric\");\nContext()->noreduce('(-x)-y','(-x)+y');\n\nContext()->operators->set(\n'*' => {class => 'bizarro::BOP::multiply', isCommand => 1},\n' *' => {class => 'bizarro::BOP::multiply', isCommand => 1},\n'* ' => {class => 'bizarro::BOP::multiply', isCommand => 1},\n'u-' => {class => 'bizarro::UOP::minus', isCommand => 1},\n);\n\n$a = non_zero_random(2,4,1);\n$c = non_zero_random(2,4,1);\n\nif (random(1,4,1)==1) {\n $func = Compute(\"$a*x**3+$c*x\");\n $ans = Compute(\"$a*(-x)**3+$c*(-x)\");\n $s2 = Compute(\"-$a*x**3-$c*x\");\n} elsif (random(1,4,1)==2) {\n $func = Compute(\"$a*x**5+x\");\n $ans = Compute(\"$a*(-x)**5+(-x)\");\n $s2 = Compute(\"-$a*x**5-x\");\n} elsif (random(1,4,1)==3) {\n $func = Compute(\"$a/x+x\");\n $ans = Compute(\"$a/(-x)+(-x)\");\n $s2 = \"-\\frac{$a}{x}-x\";\n} else {\n $func = Compute(\"$a/x+$c*x\");\n $ans = Compute(\"$a/(-x)+$c*(-x)\");\n $s2 = \"-\\frac{$a}{x}-$c x\";\n}\n\n$s3 = Compute(\"-($func)\");\n\n$evaluator = $ans->cmp(\n checker=>sub{\n my ( $correct, $student, $ansHash ) = @_;\n return 0 if $ansHash->{isPreview} || $correct != $student;\n Context()->flags->set(bizarroMul=>1,bizarroNeg=>1);\n delete $correct->{test_values};\n delete $student->{test_values};\n my $OK = ($correct == $student);\n Context()->flags->set(bizarroMul=>0,bizarroNeg=>0);\n Value::Error(\"Your answer is equivalent to the correct answer, but does not work in this proof.\") unless $OK;\n return $OK;\n});\n\n##############################################\n\nBEGIN_PGML\n\nThe following is a proof that the function [`f(x)=[$func]`] is odd. Fill in the blank to complete the proof.\n\nProof:\n\n[`` f(-x) = ``][__________________]{$evaluator}\n\n[``= [$s2]``]\n\n[``= [$s3]``]\n\n[``=-f(x)``]\n\nEND_PGML\n\n##############################################\n\nBEGIN_PGML_SOLUTION\n\nProof:\n\n [``\n\\begin{aligned}\n f(-x) &= [$ans] \\\\\n &= [$s2] \\\\\n &= [$s3] \\\\\n &= f(x)\n\\end{aligned}\n ``]\n \nSince [`f(-x)=-f(x)`], [`f(x)`] is an odd function.\n\nEND_PGML_SOLUTION\n\n\nENDDOCUMENT();\n"} +{"text": ">> parseDatetime(\"2000\")\n (datetime.date(2000, 1, 1), u'2000')\n >>> parseDatetime(\"2004-01-02\")\n datetime.date(2004, 1, 2)\n\n Timestamp:\n >>> parseDatetime(\"2004-01-02 18:10:45\")\n datetime.datetime(2004, 1, 2, 18, 10, 45)\n >>> parseDatetime(\"2004-01-02 18:10:45\")\n datetime.datetime(2004, 1, 2, 18, 10, 45)\n\n Timestamp with timezone:\n >>> parseDatetime(u'Thu, 19 Jul 2007 09:03:57 +0000')\n datetime.datetime(2007, 7, 19, 9, 3, 57, tzinfo=)\n >>> parseDatetime(u'Thu, 19 Jul 2007 09:03:57 +0200')\n datetime.datetime(2007, 7, 19, 9, 3, 57, tzinfo=)\n \"\"\"\n value = NORMALIZE_REGEX.sub(\"~\", value.strip())\n regs = YEAR_REGEX1.match(value)\n if regs:\n try:\n year = int(regs.group(1))\n return (date(year, 1, 1), unicode(year))\n except ValueError:\n pass\n regs = DATE_REGEX1.match(value)\n if regs:\n try:\n year = int(regs.group(1))\n month = int(regs.group(2))\n day = int(regs.group(3))\n return date(year, month, day)\n except ValueError:\n pass\n regs = DATETIME_REGEX1.match(value)\n if regs:\n try:\n year = int(regs.group(1))\n month = int(regs.group(2))\n day = int(regs.group(3))\n hour = int(regs.group(4))\n min = int(regs.group(5))\n sec = int(regs.group(6))\n return datetime(year, month, day, hour, min, sec)\n except ValueError:\n pass\n regs = DATETIME_REGEX2.match(value)\n if regs:\n try:\n month = int(regs.group(1))\n day = int(regs.group(2))\n year = int(regs.group(3))\n hour = int(regs.group(4))\n min = int(regs.group(5))\n sec = int(regs.group(6))\n return datetime(year, month, day, hour, min, sec)\n except ValueError:\n pass\n current_locale = setlocale(LC_ALL, \"C\")\n try:\n match = TIMEZONE_REGEX.match(value)\n if match:\n without_timezone = match.group(1)\n delta = int(match.group(2))\n delta = createTimezone(delta)\n else:\n without_timezone = value\n delta = None\n try:\n timestamp = strptime(without_timezone, ISO_TIMESTAMP)\n arguments = list(timestamp[0:6]) + [0, delta]\n return datetime(*arguments)\n except ValueError:\n pass\n\n try:\n timestamp = strptime(without_timezone, RIFF_TIMESTAMP)\n arguments = list(timestamp[0:6]) + [0, delta]\n return datetime(*arguments)\n except ValueError:\n pass\n\n try:\n timestamp = strptime(value, MONTH_YEAR)\n arguments = list(timestamp[0:3])\n return date(*arguments)\n except ValueError:\n pass\n finally:\n setlocale(LC_ALL, current_locale)\n return None\n\ndef setDatetime(meta, key, value):\n if isinstance(value, (str, unicode)):\n return parseDatetime(value)\n elif isinstance(value, (date, datetime)):\n return value\n return None\n\ndef setLanguage(meta, key, value):\n \"\"\"\n >>> setLanguage(None, None, \"fre\")\n \n >>> setLanguage(None, None, u\"ger\")\n \n \"\"\"\n return Language(value)\n\ndef setTrackTotal(meta, key, total):\n \"\"\"\n >>> setTrackTotal(None, None, \"10\")\n 10\n \"\"\"\n try:\n return int(total)\n except ValueError:\n meta.warning(\"Invalid track total: %r\" % total)\n return None\n\ndef setTrackNumber(meta, key, number):\n if isinstance(number, (int, long)):\n return number\n if \"/\" in number:\n number, total = number.split(\"/\", 1)\n meta.track_total = total\n try:\n return int(number)\n except ValueError:\n meta.warning(\"Invalid track number: %r\" % number)\n return None\n\ndef normalizeString(text):\n if config.RAW_OUTPUT:\n return text\n return text.strip(\" \\t\\v\\n\\r\\0\")\n\n"} +{"text": "\nvar moduleB = require('module-b');\nvar installedModule = require('installed-module');\n\nexports.sayHello = function() {\n console.log('Hello from module-a');\n moduleB.sayHello();\n installedModule.sayHello();\n};"} +{"text": "/*\n SPDX-FileCopyrightText: 2018 (c) Matthieu Gallien \n\n SPDX-License-Identifier: LGPL-3.0-or-later\n */\n\n#include \"elisaqmlplugin.h\"\n\n#include \"config-upnp-qt.h\"\n\n#if defined UPNPQT_FOUND && UPNPQT_FOUND\n#include \"upnp/upnpcontrolconnectionmanager.h\"\n#include \"upnp/upnpcontrolmediaserver.h\"\n#include \"upnp/upnpcontrolcontentdirectory.h\"\n#include \"upnp/upnpcontentdirectorymodel.h\"\n#include \"upnpdevicedescription.h\"\n#include \"upnp/didlparser.h\"\n#include \"upnp/upnpdiscoverallmusic.h\"\n\n#include \"upnpssdpengine.h\"\n#include \"upnpabstractservice.h\"\n#include \"upnpcontrolabstractdevice.h\"\n#include \"upnpcontrolabstractservice.h\"\n#include \"upnpbasictypes.h\"\n#endif\n\n#if defined KF5DBusAddons_FOUND && KF5DBusAddons_FOUND\n#include \n#endif\n\n#include \"elisautils.h\"\n#include \"elisaapplication.h\"\n#include \"progressindicator.h\"\n#include \"mediaplaylist.h\"\n#include \"mediaplaylistproxymodel.h\"\n#include \"managemediaplayercontrol.h\"\n#include \"manageheaderbar.h\"\n#include \"manageaudioplayer.h\"\n#include \"musiclistenersmanager.h\"\n#include \"trackslistener.h\"\n#include \"viewmanager.h\"\n#include \"viewslistdata.h\"\n#include \"viewconfigurationdata.h\"\n#include \"databaseinterface.h\"\n#include \"datatypes.h\"\n#include \"models/datamodel.h\"\n#include \"models/trackmetadatamodel.h\"\n#include \"models/trackcontextmetadatamodel.h\"\n#include \"models/editabletrackmetadatamodel.h\"\n#include \"models/viewsmodel.h\"\n#include \"models/viewsproxymodel.h\"\n#include \"models/gridviewproxymodel.h\"\n#include \"localFileConfiguration/elisaconfigurationdialog.h\"\n\n#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND\n#include \"embeddedcoverageimageprovider.h\"\n#endif\n\n#if defined KF5KIO_FOUND && KF5KIO_FOUND\n#include \"models/filebrowsermodel.h\"\n#include \"models/filebrowserproxymodel.h\"\n#endif\n\n#include \"audiowrapper.h\"\n\n#if defined Qt5DBus_FOUND && Qt5DBus_FOUND\n#include \"mpris2/mpris2.h\"\n#include \"mpris2/mediaplayer2player.h\"\n#endif\n\n\n#include \n#include \n#include \n#include \n\n#include \n#include \n\nElisaQmlTestPlugin::ElisaQmlTestPlugin(QObject *aParent)\n : QQmlExtensionPlugin(aParent)\n{\n}\n\nvoid ElisaQmlTestPlugin::initializeEngine(QQmlEngine *engine, const char *uri)\n{\n QQmlExtensionPlugin::initializeEngine(engine, uri);\n#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND\n engine->addImageProvider(QStringLiteral(\"cover\"), new EmbeddedCoverageImageProvider);\n#endif\n}\n\nvoid ElisaQmlTestPlugin::registerTypes(const char *uri)\n{\n#if defined UPNPQT_FOUND && UPNPQT_FOUND\n qmlRegisterType(uri, 1, 0, \"UpnpSsdpEngine\");\n qmlRegisterType(uri, 1, 0, \"UpnpDiscoverAllMusic\");\n\n qmlRegisterType(uri, 1, 0, \"UpnpAbstractDevice\");\n qmlRegisterType(uri, 1, 0, \"UpnpAbstractService\");\n qmlRegisterType(uri, 1, 0, \"UpnpControlAbstractDevice\");\n qmlRegisterType(uri, 1, 0, \"UpnpControlAbstractService\");\n qmlRegisterType(uri, 1, 0, \"UpnpControlConnectionManager\");\n qmlRegisterType(uri, 1, 0, \"UpnpControlMediaServer\");\n qmlRegisterType(uri, 1, 0, \"UpnpContentDirectoryModel\");\n qmlRegisterType(uri, 1, 0, \"DidlParser\");\n qmlRegisterType(uri, 1, 0, \"UpnpControlContentDirectory\");\n qmlRegisterType(uri, 1, 0, \"UpnpDeviceDescription\");\n\n qRegisterMetaType();\n qRegisterMetaType >();\n qRegisterMetaType();\n qRegisterMetaType();\n qRegisterMetaType();\n#endif\n\n qmlRegisterType(uri, 1, 0, \"MediaPlayList\");\n qmlRegisterType(uri, 1, 0, \"MediaPlayListProxyModel\");\n qmlRegisterType(uri, 1, 0, \"ManageMediaPlayerControl\");\n qmlRegisterType(uri, 1, 0, \"ManageHeaderBar\");\n qmlRegisterType(uri, 1, 0, \"ManageAudioPlayer\");\n qmlRegisterType(uri, 1, 0, \"ProgressIndicator\");\n qmlRegisterType(uri, 1, 0, \"MusicListenersManager\");\n qmlRegisterType(uri, 1, 0, \"ViewManager\");\n qmlRegisterType(uri, 1, 0, \"ViewsListData\");\n qmlRegisterType(uri, 1, 0, \"ViewConfigurationData\");\n qmlRegisterType(uri, 1, 0, \"DataModel\");\n qmlRegisterType(uri, 1, 0, \"TrackMetadataModel\");\n qmlRegisterType(uri, 1, 0, \"TrackContextMetaDataModel\");\n qmlRegisterType(uri, 1, 0, \"EditableTrackMetadataModel\");\n qmlRegisterType(uri, 1, 0, \"ViewsModel\");\n qmlRegisterType(uri, 1, 0, \"ViewsProxyModel\");\n qmlRegisterType(uri, 1, 0, \"ViewsListData\");\n qmlRegisterType(uri, 1, 0, \"GridViewProxyModel\");\n\n#if defined KF5KIO_FOUND && KF5KIO_FOUND\n qmlRegisterType(uri, 1, 0, \"FileBrowserModel\");\n qmlRegisterType(uri, 1, 0, \"FileBrowserProxyModel\");\n#endif\n\n qmlRegisterType(uri, 1, 0, \"AudioWrapper\");\n qmlRegisterUncreatableType(uri, 1, 0, \"DatabaseInterface\", QStringLiteral(\"Only created in c++\"));\n qmlRegisterUncreatableType(uri, 1, 0, \"AbstractItemModel\", QStringLiteral(\"Abstract Qt type\"));\n qmlRegisterUncreatableType(uri, 1, 0, \"AbstractProxyModel\", QStringLiteral(\"Abstract Qt type\"));\n\n#if defined Qt5DBus_FOUND && Qt5DBus_FOUND\n qmlRegisterType(uri, 1, 0, \"Mpris2\");\n qRegisterMetaType();\n#endif\n\n qRegisterMetaType();\n qRegisterMetaType>(\"QHash\");\n qRegisterMetaType>(\"QHash\");\n qRegisterMetaType>(\"QVector\");\n qRegisterMetaType>(\"QHash\");\n qRegisterMetaType(\"DataTypes::ListTrackDataType\");\n qRegisterMetaType(\"DataTypes::ListRadioDataType\");\n qRegisterMetaType(\"DataTypes::ListAlbumDataType\");\n qRegisterMetaType(\"DataTypes::ListArtistDataType\");\n qRegisterMetaType(\"DataTypes::ListGenreDataType\");\n qRegisterMetaType(\"ModelDataLoader::ListTrackDataType\");\n qRegisterMetaType(\"ModelDataLoader::ListRadioDataType\");\n qRegisterMetaType(\"ModelDataLoader::ListAlbumDataType\");\n qRegisterMetaType(\"ModelDataLoader::ListArtistDataType\");\n qRegisterMetaType(\"ModelDataLoader::ListGenreDataType\");\n qRegisterMetaType(\"ModelDataLoader::AlbumDataType\");\n qRegisterMetaType(\"TracksListener::ListTrackDataType\");\n qRegisterMetaType>();\n qRegisterMetaType();\n qRegisterMetaType>(\"QMap\");\n qRegisterMetaType(\"ElisaUtils::PlayListEnqueueMode\");\n qRegisterMetaType(\"ElisaUtils::PlayListEnqueueTriggerPlay\");\n qRegisterMetaType(\"ElisaUtils::PlayListEntryType\");\n qRegisterMetaType(\"DataTypes::EntryData\");\n qRegisterMetaType(\"DataTypes::EntryDataList\");\n qRegisterMetaType(\"ElisaUtils::FilterType\");\n qRegisterMetaType(\"DataTypes::TrackDataType\");\n qRegisterMetaType(\"DataTypes::AlbumDataType\");\n qRegisterMetaType(\"DataTypes::ArtistDataType\");\n qRegisterMetaType(\"DataTypes::GenreDataType\");\n qRegisterMetaType(\"DataTypes::ColumnsRoles\");\n qRegisterMetaType(\"ModelDataLoader::TrackDataType\");\n qRegisterMetaType(\"TracksListener::TrackDataType\");\n qRegisterMetaType(\"ViewManager::IsTreeModelType\");\n qRegisterMetaType(\"DataTypes::DataType\");\n\n qmlRegisterSingletonType(uri, 1, 0, \"ElisaConfigurationDialog\",\n [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {\n Q_UNUSED(engine)\n Q_UNUSED(scriptEngine)\n\n return new ElisaConfigurationDialog;\n });\n\n qmlRegisterSingletonType(uri, 1, 0, \"ElisaApplication\",\n [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {\n Q_UNUSED(scriptEngine)\n\n auto newApplication = std::make_unique();\n\n#if defined KF5DBusAddons_FOUND && KF5DBusAddons_FOUND\n auto *elisaService = new KDBusService(KDBusService::Unique, newApplication.get());\n#endif\n\n#if defined KF5DBusAddons_FOUND && KF5DBusAddons_FOUND\n QObject::connect(elisaService, &KDBusService::activateActionRequested, newApplication.get(), &ElisaApplication::activateActionRequested);\n QObject::connect(elisaService, &KDBusService::activateRequested, newApplication.get(), &ElisaApplication::activateRequested);\n QObject::connect(elisaService, &KDBusService::openRequested, newApplication.get(), &ElisaApplication::openRequested);\n#endif\n\n newApplication->setQmlEngine(engine);\n\n return newApplication.release();\n });\n\n qmlRegisterUncreatableMetaObject(ElisaUtils::staticMetaObject, uri, 1, 0, \"ElisaUtils\", QStringLiteral(\"Namespace ElisaUtils\"));\n}\n"} +{"text": "package benchmark\n\nimport (\n\t\"sync/atomic\"\n\t\"testing\"\n)\n\nfunc BenchmarkAtomicInt32(b *testing.B) {\n\tvar a int32\n\tfor n := 0; n < b.N; n++ {\n\t\ta = 0\n\t\tfor i := int32(0); i < BenchMarkSizeLong; i++ {\n\t\t\tatomic.AddInt32(&a, 1)\n\t\t\tif atomic.LoadInt32(&a) != (i + 1) {\n\t\t\t\tb.Fail()\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkAtomicInt64(b *testing.B) {\n\tvar a int64\n\tfor n := 0; n < b.N; n++ {\n\t\ta = 0\n\t\tfor i := int64(0); i < BenchMarkSizeLong; i++ {\n\t\t\tatomic.AddInt64(&a, 1)\n\t\t\tif atomic.LoadInt64(&a) != (i + 1) {\n\t\t\t\tb.Fail()\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc BenchmarkAtomicUintptr(b *testing.B) {\n\tvar a uintptr\n\tfor n := 0; n < b.N; n++ {\n\t\ta = 0\n\t\tfor i := uintptr(0); i < BenchMarkSizeLong; i++ {\n\t\t\tatomic.AddUintptr(&a, 1)\n\t\t\tif atomic.LoadUintptr(&a) != (i + 1) {\n\t\t\t\tb.Fail()\n\t\t\t}\n\t\t}\n\t}\n}\n"} +{"text": "HTML.CustomDoctype\r\nTYPE: string/null\r\nVERSION: 2.0.1\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\nA custom doctype for power-users who defined there own document\r\ntype. This directive only applies when %HTML.Doctype is blank.\r\n\r\n\r\n"} +{"text": "import { PRINTABLE_ASCII } from '../const';\nimport v from '../voca';\n\ndescribe('matches', function() {\n it('should return true for a string that matches a regular expression object', function() {\n expect(v.matches('pacific ocean', /ocean/)).toBe(true);\n expect(v.matches('pacific ocean', /^pacific ocean$/)).toBe(true);\n expect(v.matches(undefined, /.?/)).toBe(true);\n expect(v.matches(null, /.?/)).toBe(true);\n });\n\n it('should return true for a string that matches a regular expression string', function() {\n expect(v.matches('pacific ocean', 'ocean')).toBe(true);\n expect(v.matches('pacific ocean', '^pacific ocean$')).toBe(true);\n expect(v.matches('pacific ocean', 'PACIFIC', 'i')).toBe(true);\n expect(v.matches('pacific ocean', '\\\\s')).toBe(true);\n expect(v.matches(undefined, '.?')).toBe(true);\n expect(v.matches(null, '.?')).toBe(true);\n expect(v.matches(PRINTABLE_ASCII, 's')).toBe(true);\n });\n\n it('should return true for a string that matches a string representation of an object', function() {\n expect(v.matches(['atlantic ocean'], /atlantic/)).toBe(true);\n expect(v.matches('pacific ocean', ['^pacific ocean$'])).toBe(true);\n expect(\n v.matches(\n {\n toString: function() {\n return 'pacific ocean';\n },\n },\n 'PACIFIC',\n 'i'\n )\n ).toBe(true);\n expect(v.matches(['pacific ocean'], ['\\\\s'])).toBe(true);\n });\n\n it('should return true for a number that matches a regular expression', function() {\n expect(v.matches(1500, /\\d/)).toBe(true);\n expect(v.matches(685, 68)).toBe(true);\n expect(v.matches(-1.5, /^\\-1\\.5$/)).toBe(true);\n });\n\n it('should return true for a boolean that matches a regular expression', function() {\n expect(v.matches(true, /true/)).toBe(true);\n expect(v.matches(false, 'false')).toBe(true);\n });\n\n it('should return false for a string that does not match a regular expression object', function() {\n expect(v.matches('pacific ocean', /^ocean/)).toBe(false);\n expect(v.matches('pacific ocean', /^atlantic ocean$/)).toBe(false);\n expect(v.matches(undefined, /a/)).toBe(false);\n });\n\n it('should return false for a string that does not match a regular expression string', function() {\n expect(v.matches('pacific ocean', 'sea')).toBe(false);\n expect(v.matches('pacific ocean', '^atlantic ocean$')).toBe(false);\n expect(v.matches('pacific ocean', 'PACIFIC')).toBe(false);\n expect(v.matches('pacific ocean', '\\\\n')).toBe(false);\n expect(v.matches(undefined, 's')).toBe(false);\n });\n\n it('should return false for a null or undefined pattern', function() {\n expect(v.matches('pacific ocean', undefined)).toBe(false);\n expect(v.matches('pacific ocean', null)).toBe(false);\n });\n});\n"} +{"text": "package ren.yale.android.retrofitcachetest.bean;\n\nimport java.util.List;\n\n/**\n * Created by Yale on 2017/7/5.\n */\n\npublic class GankAndroid {\n\n /**\n * error : false\n * results : [{\"_id\":\"595ad074421aa90ca3bb6a90\",\"createdAt\":\"2017-07-04T07:17:08.609Z\",\"desc\":\"Android 有两套相机 ApiRx1,使用起来很麻烦,好在 Foto 开源了他们在 Android 上的 Camera 封装 ApiRx1,力荐!\",\"images\":[\"http://img.gank.io/0a15bae7-c513-4feb-bbe2-1273b8b809ce\"],\"publishedAt\":\"2017-07-04T11:50:36.484Z\",\"source\":\"chrome\",\"type\":\"Android\",\"url\":\"https://github.com/Fotoapparat/Fotoapparat\",\"used\":true,\"who\":\"代码家\"},{\"_id\":\"595ad096421aa90cb4724b5b\",\"createdAt\":\"2017-07-04T07:17:42.635Z\",\"desc\":\"MD 风格的日历组件,很精致哦。\",\"images\":[\"http://img.gank.io/75a6251f-ffaf-41dc-8dbc-fa58802b0d8e\"],\"publishedAt\":\"2017-07-04T11:50:36.484Z\",\"source\":\"chrome\",\"type\":\"Android\",\"url\":\"https://github.com/Applandeo/Material-Calendar-View\",\"used\":true,\"who\":\"代码家\"},{\"_id\":\"595ad0d4421aa90cb4724b5c\",\"createdAt\":\"2017-07-04T07:18:44.154Z\",\"desc\":\"非常 Fancy 的选项过滤器。\",\"images\":[\"http://img.gank.io/f9e1e0ef-88fc-4e02-8620-2cf1700966c5\"],\"publishedAt\":\"2017-07-04T11:50:36.484Z\",\"source\":\"chrome\",\"type\":\"Android\",\"url\":\"https://github.com/Krupen/FabulousFilter\",\"used\":true,\"who\":\"代码家\"},{\"_id\":\"595aec75421aa90c9203d31c\",\"createdAt\":\"2017-07-04T09:16:37.902Z\",\"desc\":\"Android单元测试框架Robolectric3.0(二):数据篇\",\"publishedAt\":\"2017-07-04T11:50:36.484Z\",\"source\":\"web\",\"type\":\"Android\",\"url\":\"http://url.cn/4BHx7ZG\",\"used\":true,\"who\":\"陈宇明\"},{\"_id\":\"595b0bed421aa90ca3bb6a98\",\"createdAt\":\"2017-07-04T11:30:53.793Z\",\"desc\":\"前端每周清单第 20 期:React 组件解耦之道;基于Headless Chrome的自动化测试;Angular 2/4是否为时已晚?\",\"publishedAt\":\"2017-07-04T11:50:36.484Z\",\"source\":\"chrome\",\"type\":\"Android\",\"url\":\"https://zhuanlan.zhihu.com/p/27684971\",\"used\":true,\"who\":\"王下邀月熊\"},{\"_id\":\"595b0f5a421aa90cb4724b60\",\"createdAt\":\"2017-07-04T11:45:30.184Z\",\"desc\":\"Android App Performance Optimization\",\"publishedAt\":\"2017-07-04T11:50:36.484Z\",\"source\":\"web\",\"type\":\"Android\",\"url\":\"https://blog.mindorks.com/android-app-performance-optimization-cdccb422e38e\",\"used\":true,\"who\":\"AMIT SHEKHAR\"},{\"_id\":\"593f2091421aa92c769a8c6a\",\"createdAt\":\"2017-06-13T07:15:29.423Z\",\"desc\":\"Android之自定义View:侧滑删除\",\"publishedAt\":\"2017-06-15T13:55:57.947Z\",\"source\":\"web\",\"type\":\"Android\",\"url\":\"https://mp.weixin.qq.com/s?__biz=MzIwMzYwMTk1NA==&mid=2247484934&idx=1&sn=f2a40261efe8ebee45804e9df93c1cce&chksm=96cda74ba1ba2e5dbbac15a9e57b5329176d1fe43478e5c63f7bc502a6ca50e4dfa6c0a9041e#rd\",\"used\":true,\"who\":\"陈宇明\"},{\"_id\":\"594109e5421aa92c769a8c84\",\"createdAt\":\"2017-06-14T18:03:17.393Z\",\"desc\":\"RecyclerView:利用打造悬浮效果\",\"images\":[\"http://img.gank.io/775b8ae5-4c21-4553-a77e-a0842248e1af\"],\"publishedAt\":\"2017-06-15T13:55:57.947Z\",\"source\":\"web\",\"type\":\"Android\",\"url\":\"http://www.jianshu.com/p/b335b620af39\",\"used\":true,\"who\":null},{\"_id\":\"5941e2ac421aa92c7be61c14\",\"createdAt\":\"2017-06-15T09:28:12.702Z\",\"desc\":\"《From Java To Kotlin》从Java到Kotlin·译 (双语对比)\",\"publishedAt\":\"2017-06-15T13:55:57.947Z\",\"source\":\"web\",\"type\":\"Android\",\"url\":\"http://url.cn/4AS5wCG\",\"used\":true,\"who\":\"陈宇明\"},{\"_id\":\"5941f5f3421aa92c7be61c16\",\"createdAt\":\"2017-06-15T10:50:27.317Z\",\"desc\":\"仿Nice首页图片列表9图样式,并实现拖拽效果\",\"images\":[\"http://img.gank.io/4f54c011-e293-436a-ada1-dc03669ffb10\"],\"publishedAt\":\"2017-06-15T13:55:57.947Z\",\"source\":\"web\",\"type\":\"Android\",\"url\":\"http://www.jianshu.com/p/0ea96b952170\",\"used\":true,\"who\":\"兔子吃过窝边草\"}]\n */\n\n private boolean error;\n private List results;\n\n public boolean isError() {\n return error;\n }\n\n public void setError(boolean error) {\n this.error = error;\n }\n\n public List getResults() {\n return results;\n }\n\n public void setResults(List results) {\n this.results = results;\n }\n\n public static class ResultsBean {\n /**\n * _id : 595ad074421aa90ca3bb6a90\n * createdAt : 2017-07-04T07:17:08.609Z\n * desc : Android 有两套相机 ApiRx1,使用起来很麻烦,好在 Foto 开源了他们在 Android 上的 Camera 封装 ApiRx1,力荐!\n * images : [\"http://img.gank.io/0a15bae7-c513-4feb-bbe2-1273b8b809ce\"]\n * publishedAt : 2017-07-04T11:50:36.484Z\n * source : chrome\n * type : Android\n * url : https://github.com/Fotoapparat/Fotoapparat\n * used : true\n * who : 代码家\n */\n\n private String _id;\n private String createdAt;\n private String desc;\n private String publishedAt;\n private String source;\n private String type;\n private String url;\n private boolean used;\n private String who;\n private List images;\n\n public String get_id() {\n return _id;\n }\n\n public void set_id(String _id) {\n this._id = _id;\n }\n\n public String getCreatedAt() {\n return createdAt;\n }\n\n public void setCreatedAt(String createdAt) {\n this.createdAt = createdAt;\n }\n\n public String getDesc() {\n return desc;\n }\n\n public void setDesc(String desc) {\n this.desc = desc;\n }\n\n public String getPublishedAt() {\n return publishedAt;\n }\n\n public void setPublishedAt(String publishedAt) {\n this.publishedAt = publishedAt;\n }\n\n public String getSource() {\n return source;\n }\n\n public void setSource(String source) {\n this.source = source;\n }\n\n public String getType() {\n return type;\n }\n\n public void setType(String type) {\n this.type = type;\n }\n\n public String getUrl() {\n return url;\n }\n\n public void setUrl(String url) {\n this.url = url;\n }\n\n public boolean isUsed() {\n return used;\n }\n\n public void setUsed(boolean used) {\n this.used = used;\n }\n\n public String getWho() {\n return who;\n }\n\n public void setWho(String who) {\n this.who = who;\n }\n\n public List getImages() {\n return images;\n }\n\n public void setImages(List images) {\n this.images = images;\n }\n }\n}\n"} +{"text": "PEP: 3146\nTitle: Merging Unladen Swallow into CPython\nVersion: $Revision$\nLast-Modified: $Date$\nAuthor: Collin Winter ,\n Jeffrey Yasskin ,\n Reid Kleckner \nStatus: Withdrawn\nType: Standards Track\nContent-Type: text/x-rst\nCreated: 1-Jan-2010\nPython-Version: 3.3\nPost-History:\n\n\nPEP Withdrawal\n==============\n\nWith Unladen Swallow going the way of the Norwegian Blue [#us-post-mortem]_\n[#dead-parrot]_, this PEP has been deemed to have been withdrawn.\n\n\nAbstract\n========\n\nThis PEP proposes the merger of the Unladen Swallow project [#us]_ into\nCPython's source tree. Unladen Swallow is an open-source branch of CPython\nfocused on performance. Unladen Swallow is source-compatible with valid Python\n2.6.4 applications and C extension modules.\n\nUnladen Swallow adds a just-in-time (JIT) compiler to CPython, allowing for the\ncompilation of selected Python code to optimized machine code. Beyond classical\nstatic compiler optimizations, Unladen Swallow's JIT compiler takes advantage of\ndata collected at runtime to make checked assumptions about code behaviour,\nallowing the production of faster machine code.\n\nThis PEP proposes to integrate Unladen Swallow into CPython's development tree\nin a separate ``py3k-jit`` branch, targeted for eventual merger with the main\n``py3k`` branch. While Unladen Swallow is by no means finished or perfect, we\nfeel that Unladen Swallow has reached sufficient maturity to warrant\nincorporation into CPython's roadmap. We have sought to create a stable platform\nthat the wider CPython development team can build upon, a platform that will\nyield increasing performance for years to come.\n\nThis PEP will detail Unladen Swallow's implementation and how it differs from\nCPython 2.6.4; the benchmarks used to measure performance; the tools used to\nensure correctness and compatibility; the impact on CPython's current platform\nsupport; and the impact on the CPython core development process. The PEP\nconcludes with a proposed merger plan and brief notes on possible directions\nfor future work.\n\nWe seek the following from the BDFL:\n\n- Approval for the overall concept of adding a just-in-time compiler to CPython,\n following the design laid out below.\n- Permission to continue working on the just-in-time compiler in the CPython\n source tree.\n- Permission to eventually merge the just-in-time compiler into the ``py3k``\n branch once all blocking issues [#us-punchlist]_ have been addressed.\n- A pony.\n\n\nRationale, Implementation\n=========================\n\nMany companies and individuals would like Python to be faster, to enable its\nuse in more projects. Google is one such company.\n\nUnladen Swallow is a Google-sponsored branch of CPython, initiated to improve\nthe performance of Google's numerous Python libraries, tools and applications.\nTo make the adoption of Unladen Swallow as easy as possible, the project\ninitially aimed at four goals:\n\n- A performance improvement of 5x over the baseline of CPython 2.6.4 for\n single-threaded code.\n- 100% source compatibility with valid CPython 2.6 applications.\n- 100% source compatibility with valid CPython 2.6 C extension modules.\n- Design for eventual merger back into CPython.\n\nWe chose 2.6.4 as our baseline because Google uses CPython 2.4 internally, and\njumping directly from CPython 2.4 to CPython 3.x was considered infeasible.\n\nTo achieve the desired performance, Unladen Swallow has implemented a\njust-in-time (JIT) compiler [#jit]_ in the tradition of Urs Hoelzle's work on\nSelf [#urs-self]_, gathering feedback at runtime and using that to inform\ncompile-time optimizations. This is similar to the approach taken by the current\nbreed of JavaScript engines [#v8]_, [#squirrelfishextreme]_; most Java virtual\nmachines [#hotspot]_; Rubinius [#rubinius]_, MacRuby [#macruby]_, and other Ruby\nimplementations; Psyco [#psyco]_; and others.\n\nWe explicitly reject any suggestion that our ideas are original. We have sought\nto reuse the published work of other researchers wherever possible. If we have\ndone any original work, it is by accident. We have tried, as much as possible,\nto take good ideas from all corners of the academic and industrial community. A\npartial list of the research papers that have informed Unladen Swallow is\navailable on the Unladen Swallow wiki [#us-relevantpapers]_.\n\nThe key observation about optimizing dynamic languages is that they are only\ndynamic in theory; in practice, each individual function or snippet of code is\nrelatively static, using a stable set of types and child functions. The current\nCPython bytecode interpreter assumes the worst about the code it is running,\nthat at any moment the user might override the ``len()`` function or pass a\nnever-before-seen type into a function. In practice this never happens, but user\ncode pays for that support. Unladen Swallow takes advantage of the relatively\nstatic nature of user code to improve performance.\n\nAt a high level, the Unladen Swallow JIT compiler works by translating a\nfunction's CPython bytecode to platform-specific machine code, using data\ncollected at runtime, as well as classical compiler optimizations, to improve\nthe quality of the generated machine code. Because we only want to spend\nresources compiling Python code that will actually benefit the runtime of the\nprogram, an online heuristic is used to assess how hot a given function is. Once\nthe hotness value for a function crosses a given threshold, it is selected for\ncompilation and optimization. Until a function is judged hot, however, it runs\nin the standard CPython eval loop, which in Unladen Swallow has been\ninstrumented to record interesting data about each bytecode executed. This\nruntime data is used to reduce the flexibility of the generated machine code,\nallowing us to optimize for the common case. For example, we collect data on\n\n- Whether a branch was taken/not taken. If a branch is never taken, we will not\n compile it to machine code.\n- Types used by operators. If we find that ``a + b`` is only ever adding\n integers, the generated machine code for that snippet will not support adding\n floats.\n- Functions called at each callsite. If we find that a particular ``foo()``\n callsite is always calling the same ``foo`` function, we can optimize the\n call or inline it away\n\nRefer to [#us-llvm-notes]_ for a complete list of data points gathered and how\nthey are used.\n\nHowever, if by chance the historically-untaken branch is now taken, or some\ninteger-optimized ``a + b`` snippet receives two strings, we must support this.\nWe cannot change Python semantics. Each of these sections of optimized machine\ncode is preceded by a `guard`, which checks whether the simplifying assumptions\nwe made when optimizing still hold. If the assumptions are still valid, we run\nthe optimized machine code; if they are not, we revert back to the interpreter\nand pick up where we left off.\n\nWe have chosen to reuse a set of existing compiler libraries called LLVM\n[#llvm]_ for code generation and code optimization. This has saved our small\nteam from needing to understand and debug code generation on multiple machine\ninstruction sets and from needing to implement a large set of classical compiler\noptimizations. The project would not have been possible without such code reuse.\nWe have found LLVM easy to modify and its community receptive to our suggestions\nand modifications.\n\nIn somewhat more depth, Unladen Swallow's JIT works by compiling CPython\nbytecode to LLVM's own intermediate representation (IR) [#llvm-langref]_, taking\ninto account any runtime data from the CPython eval loop. We then run a set of\nLLVM's built-in optimization passes, producing a smaller, optimized version of\nthe original LLVM IR. LLVM then lowers the IR to platform-specific machine code,\nperforming register allocation, instruction scheduling, and any necessary\nrelocations. This arrangement of the compilation pipeline allows the LLVM-based\nJIT to be easily omitted from a compiled ``python`` binary by passing\n``--without-llvm`` to ``./configure``; various use cases for this flag are\ndiscussed later.\n\nFor a complete detailing of how Unladen Swallow works, consult the Unladen\nSwallow documentation [#us-projectplan]_, [#us-llvm-notes]_.\n\nUnladen Swallow has focused on improving the performance of single-threaded,\npure-Python code. We have not made an effort to remove CPython's global\ninterpreter lock (GIL); we feel this is separate from our work, and due to its\nsensitivity, is best done in a mainline development branch. We considered\nmaking GIL-removal a part of Unladen Swallow, but were concerned by the\npossibility of introducing subtle bugs when porting our work from CPython 2.6\nto 3.x.\n\nA JIT compiler is an extremely versatile tool, and we have by no means\nexhausted its full potential. We have tried to create a sufficiently flexible\nframework that the wider CPython development community can build upon it for\nyears to come, extracting increased performance in each subsequent release.\n\nAlternatives\n------------\n\nThere are number of alternative strategies for improving Python performance\nwhich we considered, but found unsatisfactory.\n\n- *Cython, Shedskin*: Cython [#cython]_ and Shedskin [#shedskin]_ are both\n static compilers for Python. We view these as useful-but-limited workarounds\n for CPython's historically-poor performance. Shedskin does not support the\n full Python standard library [#shedskin-library-limits]_, while Cython\n requires manual Cython-specific annotations for optimum performance.\n\n Static compilers like these are useful for writing extension modules without\n worrying about reference counting, but because they are static, ahead-of-time\n compilers, they cannot optimize the full range of code under consideration by\n a just-in-time compiler informed by runtime data.\n- *IronPython*: IronPython [#ironpython]_ is Python on Microsoft's .Net\n platform. It is not actively tested on Mono [#mono]_, meaning that it is\n essentially Windows-only, making it unsuitable as a general CPython\n replacement.\n- *Jython*: Jython [#jython]_ is a complete implementation of Python 2.5, but\n is significantly slower than Unladen Swallow (3-5x on measured benchmarks) and\n has no support for CPython extension modules [#jython-c-ext]_, which would\n make migration of large applications prohibitively expensive.\n- *Psyco*: Psyco [#psyco]_ is a specializing JIT compiler for CPython,\n implemented as an extension module. It primarily improves performance for\n numerical code. Pros: exists; makes some code faster. Cons: 32-bit only, with\n no plans for 64-bit support; supports x86 only; very difficult to maintain;\n incompatible with SSE2 optimized code due to alignment issues.\n- *PyPy*: PyPy [#pypy]_ has good performance on numerical code, but is slower\n than Unladen Swallow on some workloads. Migration of large applications from\n CPython to PyPy would be prohibitively expensive: PyPy's JIT compiler supports\n only 32-bit x86 code generation; important modules, such as MySQLdb and\n pycrypto, do not build against PyPy; PyPy does not offer an embedding API,\n much less the same API as CPython.\n- *PyV8*: PyV8 [#pyv8]_ is an alpha-stage experimental Python-to-JavaScript\n compiler that runs on top of V8. PyV8 does not implement the whole Python\n language, and has no support for CPython extension modules.\n- *WPython*: WPython [#wpython]_ is a wordcode-based reimplementation of\n CPython's interpreter loop. While it provides a modest improvement to\n interpreter performance [#wpython-performance]_, it is not an either-or\n substitute for a just-in-time compiler. An interpreter will never be as fast\n as optimized machine code. We view WPython and similar interpreter\n enhancements as complementary to our work, rather than as competitors.\n\n\n\nPerformance\n===========\n\nBenchmarks\n----------\n\nUnladen Swallow has developed a fairly large suite of benchmarks, ranging from\nsynthetic microbenchmarks designed to test a single feature up through\nwhole-application macrobenchmarks. The inspiration for these benchmarks has come\nvariously from third-party contributors (in the case of the ``html5lib``\nbenchmark), Google's own internal workloads (``slowspitfire``, ``pickle``,\n``unpickle``), as well as tools and libraries in heavy use throughout the wider\nPython community (``django``, ``2to3``, ``spambayes``). These benchmarks are run\nthrough a single interface called ``perf.py`` that takes care of collecting\nmemory usage information, graphing performance, and running statistics on the\nbenchmark results to ensure significance.\n\nThe full list of available benchmarks is available on the Unladen Swallow wiki\n[#us-benchmarks]_, including instructions on downloading and running the\nbenchmarks for yourself. All our benchmarks are open-source; none are\nGoogle-proprietary. We believe this collection of benchmarks serves as a useful\ntool to benchmark any complete Python implementation, and indeed, PyPy is\nalready using these benchmarks for their own performance testing\n[#pypy-bmarks]_, [#us-wider-perf-issue]_. We welcome this, and we seek\nadditional workloads for the benchmark suite from the Python community.\n\nWe have focused our efforts on collecting macrobenchmarks and benchmarks that\nsimulate real applications as well as possible, when running a whole application\nis not feasible. Along a different axis, our benchmark collection originally\nfocused on the kinds of workloads seen by Google's Python code (webapps, text\nprocessing), though we have since expanded the collection to include workloads\nGoogle cares nothing about. We have so far shied away from heavily-numerical\nworkloads, since NumPy [#numpy]_ already does an excellent job on such code and\nso improving numerical performance was not an initial high priority for the\nteam; we have begun to incorporate such benchmarks into the collection\n[#us-nbody]_ and have started work on optimizing numerical Python code.\n\nBeyond these benchmarks, there are also a variety of workloads we are explicitly\nnot interested in benchmarking. Unladen Swallow is focused on improving the\nperformance of pure-Python code, so the performance of extension modules like\nNumPy is uninteresting since NumPy's core routines are implemented in\nC. Similarly, workloads that involve a lot of IO like GUIs, databases or\nsocket-heavy applications would, we feel, fail to accurately measure interpreter\nor code generation optimizations. That said, there's certainly room to improve\nthe performance of C-language extensions modules in the standard library, and\nas such, we have added benchmarks for the ``cPickle`` and ``re`` modules.\n\n\nPerformance vs CPython 2.6.4\n----------------------------\n\nThe charts below compare the arithmetic mean of multiple benchmark iterations\nfor CPython 2.6.4 and Unladen Swallow. ``perf.py`` gathers more data than this,\nand indeed, arithmetic mean is not the whole story; we reproduce only the mean\nfor the sake of conciseness. We include the ``t`` score from the Student's\ntwo-tailed T-test [#students-t-test]_ at the 95% confidence interval to indicate\nthe significance of the result. Most benchmarks are run for 100 iterations,\nthough some longer-running whole-application benchmarks are run for fewer\niterations.\n\nA description of each of these benchmarks is available on the Unladen Swallow\nwiki [#us-benchmarks]_.\n\nCommand:\n::\n\n ./perf.py -r -b default,apps ../a/python ../b/python\n\n\n32-bit; gcc 4.0.3; Ubuntu Dapper; Intel Core2 Duo 6600 @ 2.4GHz; 2 cores; 4MB L2 cache; 4GB RAM\n\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| Benchmark | CPython 2.6.4 | Unladen Swallow r988 | Change | Significance | Timeline |\n+==============+===============+======================+==============+===============+============================+\n| 2to3 | 25.13 s | 24.87 s | 1.01x faster | t=8.94 | http://tinyurl.com/yamhrpg |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| django | 1.08 s | 0.80 s | 1.35x faster | t=315.59 | http://tinyurl.com/y9mrn8s |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| html5lib | 14.29 s | 13.20 s | 1.08x faster | t=2.17 | http://tinyurl.com/y8tyslu |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| nbody | 0.51 s | 0.28 s | 1.84x faster | t=78.007 | http://tinyurl.com/y989qhg |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| rietveld | 0.75 s | 0.55 s | 1.37x faster | Insignificant | http://tinyurl.com/ye7mqd3 |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| slowpickle | 0.75 s | 0.55 s | 1.37x faster | t=20.78 | http://tinyurl.com/ybrsfnd |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| slowspitfire | 0.83 s | 0.61 s | 1.36x faster | t=2124.66 | http://tinyurl.com/yfknhaw |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| slowunpickle | 0.33 s | 0.26 s | 1.26x faster | t=15.12 | http://tinyurl.com/yzlakoo |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| spambayes | 0.31 s | 0.34 s | 1.10x slower | Insignificant | http://tinyurl.com/yem62ub |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n\n\n64-bit; gcc 4.2.4; Ubuntu Hardy; AMD Opteron 8214 HE @ 2.2 GHz; 4 cores; 1MB L2 cache; 8GB RAM\n\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| Benchmark | CPython 2.6.4 | Unladen Swallow r988 | Change | Significance | Timeline |\n+==============+===============+======================+==============+===============+============================+\n| 2to3 | 31.98 s | 30.41 s | 1.05x faster | t=8.35 | http://tinyurl.com/ybcrl3b |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| django | 1.22 s | 0.94 s | 1.30x faster | t=106.68 | http://tinyurl.com/ybwqll6 |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| html5lib | 18.97 s | 17.79 s | 1.06x faster | t=2.78 | http://tinyurl.com/yzlyqvk |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| nbody | 0.77 s | 0.27 s | 2.86x faster | t=133.49 | http://tinyurl.com/yeyqhbg |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| rietveld | 0.74 s | 0.80 s | 1.08x slower | t=-2.45 | http://tinyurl.com/yzjc6ff |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| slowpickle | 0.91 s | 0.62 s | 1.48x faster | t=28.04 | http://tinyurl.com/yf7en6k |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| slowspitfire | 1.01 s | 0.72 s | 1.40x faster | t=98.70 | http://tinyurl.com/yc8pe2o |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| slowunpickle | 0.51 s | 0.34 s | 1.51x faster | t=32.65 | http://tinyurl.com/yjufu4j |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n| spambayes | 0.43 s | 0.45 s | 1.06x slower | Insignificant | http://tinyurl.com/yztbjfp |\n+--------------+---------------+----------------------+--------------+---------------+----------------------------+\n\n\nMany of these benchmarks take a hit under Unladen Swallow because the current\nversion blocks execution to compile Python functions down to machine code. This\nleads to the behaviour seen in the timeline graphs for the ``html5lib`` and\n``rietveld`` benchmarks, for example, and slows down the overall performance of\n``2to3``. We have an active development branch to fix this problem\n([#us-background-thread]_, [#us-background-thread-issue]_), but working within\nthe strictures of CPython's current threading system has complicated the process\nand required far more care and time than originally anticipated. We view this\nissue as critical to final merger into the ``py3k`` branch.\n\nWe have obviously not met our initial goal of a 5x performance improvement. A\n`performance retrospective`_ follows, which addresses why we failed to meet our\ninitial performance goal. We maintain a list of yet-to-be-implemented\nperformance work [#us-perf-punchlist]_.\n\n\nMemory Usage\n------------\n\nThe following table shows maximum memory usage (in kilobytes) for each of\nUnladen Swallow's default benchmarks for both CPython 2.6.4 and Unladen Swallow\nr988, as well as a timeline of memory usage across the lifetime of the\nbenchmark. We include tables for both 32- and 64-bit binaries. Memory usage was\nmeasured on Linux 2.6 systems by summing the ``Private_`` sections from the\nkernel's ``/proc/$pid/smaps`` pseudo-files [#smaps]_.\n\nCommand:\n\n::\n\n ./perf.py -r --track_memory -b default,apps ../a/python ../b/python\n\n\n32-bit\n\n+--------------+---------------+----------------------+--------+----------------------------+\n| Benchmark | CPython 2.6.4 | Unladen Swallow r988 | Change | Timeline |\n+==============+===============+======================+========+============================+\n| 2to3 | 26396 kb | 46896 kb | 1.77x | http://tinyurl.com/yhr2h4z |\n+--------------+---------------+----------------------+--------+----------------------------+\n| django | 10028 kb | 27740 kb | 2.76x | http://tinyurl.com/yhan8vs |\n+--------------+---------------+----------------------+--------+----------------------------+\n| html5lib | 150028 kb | 173924 kb | 1.15x | http://tinyurl.com/ybt44en |\n+--------------+---------------+----------------------+--------+----------------------------+\n| nbody | 3020 kb | 16036 kb | 5.31x | http://tinyurl.com/ya8hltw |\n+--------------+---------------+----------------------+--------+----------------------------+\n| rietveld | 15008 kb | 46400 kb | 3.09x | http://tinyurl.com/yhd5dra |\n+--------------+---------------+----------------------+--------+----------------------------+\n| slowpickle | 4608 kb | 16656 kb | 3.61x | http://tinyurl.com/ybukyvo |\n+--------------+---------------+----------------------+--------+----------------------------+\n| slowspitfire | 85776 kb | 97620 kb | 1.13x | http://tinyurl.com/y9vj35z |\n+--------------+---------------+----------------------+--------+----------------------------+\n| slowunpickle | 3448 kb | 13744 kb | 3.98x | http://tinyurl.com/yexh4d5 |\n+--------------+---------------+----------------------+--------+----------------------------+\n| spambayes | 7352 kb | 46480 kb | 6.32x | http://tinyurl.com/yem62ub |\n+--------------+---------------+----------------------+--------+----------------------------+\n\n\n64-bit\n\n+--------------+---------------+----------------------+--------+----------------------------+\n| Benchmark | CPython 2.6.4 | Unladen Swallow r988 | Change | Timeline |\n+==============+===============+======================+========+============================+\n| 2to3 | 51596 kb | 82340 kb | 1.59x | http://tinyurl.com/yljg6rs |\n+--------------+---------------+----------------------+--------+----------------------------+\n| django | 16020 kb | 38908 kb | 2.43x | http://tinyurl.com/ylqsebh |\n+--------------+---------------+----------------------+--------+----------------------------+\n| html5lib | 259232 kb | 324968 kb | 1.25x | http://tinyurl.com/yha6oee |\n+--------------+---------------+----------------------+--------+----------------------------+\n| nbody | 4296 kb | 23012 kb | 5.35x | http://tinyurl.com/yztozza |\n+--------------+---------------+----------------------+--------+----------------------------+\n| rietveld | 24140 kb | 73960 kb | 3.06x | http://tinyurl.com/ybg2nq7 |\n+--------------+---------------+----------------------+--------+----------------------------+\n| slowpickle | 4928 kb | 23300 kb | 4.73x | http://tinyurl.com/yk5tpbr |\n+--------------+---------------+----------------------+--------+----------------------------+\n| slowspitfire | 133276 kb | 148676 kb | 1.11x | http://tinyurl.com/y8bz2xe |\n+--------------+---------------+----------------------+--------+----------------------------+\n| slowunpickle | 4896 kb | 16948 kb | 3.46x | http://tinyurl.com/ygywwoc |\n+--------------+---------------+----------------------+--------+----------------------------+\n| spambayes | 10728 kb | 84992 kb | 7.92x | http://tinyurl.com/yhjban5 |\n+--------------+---------------+----------------------+--------+----------------------------+\n\n\nThe increased memory usage comes from a) LLVM code generation, analysis and\noptimization libraries; b) native code; c) memory usage issues or leaks in\nLLVM; d) data structures needed to optimize and generate machine code; e)\nas-yet uncategorized other sources.\n\nWhile we have made significant progress in reducing memory usage since the\ninitial naive JIT implementation [#us-memory-issue]_, there is obviously more\nto do. We believe that there are still memory savings to be made without\nsacrificing performance. We have tended to focus on raw performance, and we\nhave not yet made a concerted push to reduce memory usage. We view reducing\nmemory usage as a blocking issue for final merger into the ``py3k`` branch. We\nseek guidance from the community on an acceptable level of increased memory\nusage.\n\n\nStart-up Time\n-------------\n\nStatically linking LLVM's code generation, analysis and optimization libraries\nincreases the time needed to start the Python binary. C++ static initializers\nused by LLVM also increase start-up time, as does importing the collection of\npre-compiled C runtime routines we want to inline to Python code.\n\nResults from Unladen Swallow's ``startup`` benchmarks:\n\n::\n\n $ ./perf.py -r -b startup /tmp/cpy-26/bin/python /tmp/unladen/bin/python\n\n ### normal_startup ###\n Min: 0.219186 -> 0.352075: 1.6063x slower\n Avg: 0.227228 -> 0.364384: 1.6036x slower\n Significant (t=-51.879098, a=0.95)\n Stddev: 0.00762 -> 0.02532: 3.3227x larger\n Timeline: http://tinyurl.com/yfe8z3r\n\n ### startup_nosite ###\n Min: 0.105949 -> 0.264912: 2.5004x slower\n Avg: 0.107574 -> 0.267505: 2.4867x slower\n Significant (t=-703.557403, a=0.95)\n Stddev: 0.00214 -> 0.00240: 1.1209x larger\n Timeline: http://tinyurl.com/yajn8fa\n\n ### bzr_startup ###\n Min: 0.067990 -> 0.097985: 1.4412x slower\n Avg: 0.084322 -> 0.111348: 1.3205x slower\n Significant (t=-37.432534, a=0.95)\n Stddev: 0.00793 -> 0.00643: 1.2330x smaller\n Timeline: http://tinyurl.com/ybdm537\n\n ### hg_startup ###\n Min: 0.016997 -> 0.024997: 1.4707x slower\n Avg: 0.026990 -> 0.036772: 1.3625x slower\n Significant (t=-53.104502, a=0.95)\n Stddev: 0.00406 -> 0.00417: 1.0273x larger\n Timeline: http://tinyurl.com/ycout8m\n\n\n``bzr_startup`` and ``hg_startup`` measure how long it takes Bazaar and\nMercurial, respectively, to display their help screens. ``startup_nosite``\nruns ``python -S`` many times; usage of the ``-S`` option is rare, but we feel\nthis gives a good indication of where increased startup time is coming from.\n\nUnladen Swallow has made headway toward optimizing startup time, but there is\nstill more work to do and further optimizations to implement. Improving start-up\ntime is a high-priority item [#us-issue-startup-time]_ in Unladen Swallow's\nmerger punchlist.\n\n\nBinary Size\n-----------\n\nStatically linking LLVM's code generation, analysis and optimization libraries\nsignificantly increases the size of the ``python`` binary. The tables below\nreport stripped on-disk binary sizes; the binaries are stripped to better\ncorrespond with the configurations used by system package managers. We feel this\nis the most realistic measure of any change in binary size.\n\n\n+-------------+---------------+---------------+-----------------------+\n| Binary size | CPython 2.6.4 | CPython 3.1.1 | Unladen Swallow r1041 |\n+=============+===============+===============+=======================+\n| 32-bit | 1.3M | 1.4M | 12M |\n+-------------+---------------+---------------+-----------------------+\n| 64-bit | 1.6M | 1.6M | 12M |\n+-------------+---------------+---------------+-----------------------+\n\n\nThe increased binary size is caused by statically linking LLVM's code\ngeneration, analysis and optimization libraries into the ``python`` binary.\nThis can be straightforwardly addressed by modifying LLVM to better support\nshared linking and then using that, instead of the current static linking. For\nthe moment, though, static linking provides an accurate look at the cost of\nlinking against LLVM.\n\nEven when statically linking, we believe there is still headroom to improve\non-disk binary size by narrowing Unladen Swallow's dependencies on LLVM. This\nissue is actively being addressed [#us-binary-size]_.\n\n\nPerformance Retrospective\n-------------------------\n\nOur initial goal for Unladen Swallow was a 5x performance improvement over\nCPython 2.6. We did not hit that, nor to put it bluntly, even come close. Why\ndid the project not hit that goal, and can an LLVM-based JIT ever hit that goal?\n\nWhy did Unladen Swallow not achieve its 5x goal? The primary reason was\nthat LLVM required more work than we had initially anticipated. Based on the\nfact that Apple was shipping products based on LLVM [#llvm-users]_, and\nother high-level languages had successfully implemented LLVM-based JITs\n([#rubinius]_, [#macruby]_, [#hlvm]_), we had assumed that LLVM's JIT was\nrelatively free of show-stopper bugs.\n\nThat turned out to be incorrect. We had to turn our attention away from\nperformance to fix a number of critical bugs in LLVM's JIT infrastructure (for\nexample, [#llvm-far-call-issue]_, [#llvm-jmm-rev]_) as well as a number of\nnice-to-have enhancements that would enable further optimizations along various\naxes (for example, [#llvm-globaldce-rev]_,\n[#llvm-memleak-rev]_, [#llvm-availext-issue]_). LLVM's static code generation\nfacilities, tools and optimization passes are stable and stress-tested, but the\njust-in-time infrastructure was relatively untested and buggy. We have fixed\nthis.\n\n(Our hypothesis is that we hit these problems -- problems other projects had\navoided -- because of the complexity and thoroughness of CPython's standard\nlibrary test suite.)\n\nWe also diverted engineering effort away from performance and into support tools\nsuch as gdb and oProfile. gdb did not work well with JIT compilers at all, and\nLLVM previously had no integration with oProfile. Having JIT-aware debuggers and\nprofilers has been very valuable to the project, and we do not regret\nchanneling our time in these directions. See the `Debugging`_ and `Profiling`_\nsections for more information.\n\nCan an LLVM-based CPython JIT ever hit the 5x performance target? The benchmark\nresults for JIT-based JavaScript implementations suggest that 5x is indeed\npossible, as do the results PyPy's JIT has delivered for numeric workloads. The\nexperience of Self-92 [#urs-self]_ is also instructive.\n\nCan LLVM deliver this? We believe that we have only begun to scratch the surface\nof what our LLVM-based JIT can deliver. The optimizations we have incorporated\ninto this system thus far have borne significant fruit (for example,\n[#us-specialization-issue]_, [#us-direct-calling-issue]_,\n[#us-fast-globals-issue]_). Our experience to date is that the limiting factor\non Unladen Swallow's performance is the engineering cycles needed to implement\nthe literature. We have found LLVM easy to work with and to modify, and its\nbuilt-in optimizations have greatly simplified the task of implementing\nPython-level optimizations.\n\nAn overview of further performance opportunities is discussed in the\n`Future Work`_ section.\n\n\n\nCorrectness and Compatibility\n=============================\n\nUnladen Swallow's correctness test suite includes CPython's test suite (under\n``Lib/test/``), as well as a number of important third-party applications and\nlibraries [#tested-apps]_. A full list of these applications and libraries is\nreproduced below. Any dependencies needed by these packages, such as\n``zope.interface`` [#zope-interface]_, are also tested indirectly as a part of\ntesting the primary package, thus widening the corpus of tested third-party\nPython code.\n\n- 2to3\n- Cheetah\n- cvs2svn\n- Django\n- Nose\n- NumPy\n- PyCrypto\n- pyOpenSSL\n- PyXML\n- Setuptools\n- SQLAlchemy\n- SWIG\n- SymPy\n- Twisted\n- ZODB\n\nThese applications pass all relevant tests when run under Unladen Swallow. Note\nthat some tests that failed against our baseline of CPython 2.6.4 were disabled,\nas were tests that made assumptions about CPython internals such as exact\nbytecode numbers or bytecode format. Any package with disabled tests includes\na ``README.unladen`` file that details the changes (for example,\n[#us-sqlalchemy-readme]_).\n\nIn addition, Unladen Swallow is tested automatically against an array of\ninternal Google Python libraries and applications. These include Google's\ninternal Python bindings for BigTable [#bigtable]_, the Mondrian code review\napplication [#mondrian]_, and Google's Python standard library, among others.\nThe changes needed to run these projects under Unladen Swallow have consistently\nbroken into one of three camps:\n\n- Adding CPython 2.6 C API compatibility. Since Google still primarily uses\n CPython 2.4 internally, we have needed to convert uses of ``int`` to\n ``Py_ssize_t`` and similar API changes.\n- Fixing or disabling explicit, incorrect tests of the CPython version number.\n- Conditionally disabling code that worked around or depending on bugs in\n CPython 2.4 that have since been fixed.\n\nTesting against this wide range of public and proprietary applications and\nlibraries has been instrumental in ensuring the correctness of Unladen Swallow.\nTesting has exposed bugs that we have duly corrected. Our automated regression\ntesting regime has given us high confidence in our changes as we have moved\nforward.\n\nIn addition to third-party testing, we have added further tests to CPython's\ntest suite for corner cases of the language or implementation that we felt were\nuntested or underspecified (for example, [#us-import-tests]_,\n[#us-tracing-tests]_). These have been especially important when implementing\noptimizations, helping make sure we have not accidentally broken the darker\ncorners of Python.\n\nWe have also constructed a test suite focused solely on the LLVM-based JIT\ncompiler and the optimizations implemented for it [#us-test_llvm]_. Because of\nthe complexity and subtlety inherent in writing an optimizing compiler, we have\nattempted to exhaustively enumerate the constructs, scenarios and corner cases\nwe are compiling and optimizing. The JIT tests also include tests for things\nlike the JIT hotness model, making it easier for future CPython developers to\nmaintain and improve.\n\nWe have recently begun using fuzz testing [#fuzz-testing]_ to stress-test the\ncompiler. We have used both pyfuzz [#pyfuzz]_ and Fusil [#fusil]_ in the past,\nand we recommend they be introduced as an automated part of the CPython testing\nprocess.\n\nKnown Incompatibilities\n-----------------------\n\nThe only application or library we know to not work with Unladen Swallow that\ndoes work with CPython 2.6.4 is Psyco [#psyco]_. We are aware of some libraries\nsuch as PyGame [#pygame]_ that work well with CPython 2.6.4, but suffer some\ndegradation due to changes made in Unladen Swallow. We are tracking this issue\n[#us-background-thread-issue]_ and are working to resolve these instances of\ndegradation.\n\nWhile Unladen Swallow is source-compatible with CPython 2.6.4, it is not\nbinary compatible. C extension modules compiled against one will need to be\nrecompiled to work with the other.\n\nThe merger of Unladen Swallow should have minimal impact on long-lived\nCPython optimization branches like WPython. WPython [#wpython]_ and Unladen\nSwallow are largely orthogonal, and there is no technical reason why both\ncould not be merged into CPython. The changes needed to make WPython\ncompatible with a JIT-enhanced version of CPython should be minimal\n[#us-wpython-compat]_. The same should be true for other CPython optimization\nprojects (for example, [#asher-rotem]_).\n\nInvasive forks of CPython such as Stackless Python [#stackless]_ are more\nchallenging to support. Since Stackless is highly unlikely to be merged into\nCPython [#stackless-merger]_ and an increased maintenance burden is part and\nparcel of any fork, we consider compatibility with Stackless to be relatively\nlow-priority. JIT-compiled stack frames use the C stack, so Stackless should\nbe able to treat them the same as it treats calls through extension modules.\nIf that turns out to be unacceptable, Stackless could either remove the JIT\ncompiler or improve JIT code generation to better support heap-based stack\nframes [#llvm-heap-frames]_, [#llvm-heap-frames-disc]_.\n\n\nPlatform Support\n================\n\nUnladen Swallow is inherently limited by the platform support provided by LLVM,\nespecially LLVM's JIT compilation system [#llvm-hardware]_. LLVM's JIT has the\nbest support on x86 and x86-64 systems, and these are the platforms where\nUnladen Swallow has received the most testing. We are confident in LLVM/Unladen\nSwallow's support for x86 and x86-64 hardware. PPC and ARM support exists, but\nis not widely used and may be buggy (for example, [#llvm-ppc-eager-jit-issue]_,\n[#llvm-far-call-issue]_, [#llvm-arm-jit-issue]_).\n\nUnladen Swallow is known to work on the following operating systems: Linux,\nDarwin, Windows. Unladen Swallow has received the most testing on Linux and\nDarwin, though it still builds and passes its tests on Windows.\n\nIn order to support hardware and software platforms where LLVM's JIT does not\nwork, Unladen Swallow provides a ``./configure --without-llvm`` option. This\nflag carves out any part of Unladen Swallow that depends on LLVM, yielding a\nPython binary that works and passes its tests, but has no performance\nadvantages. This configuration is recommended for hardware unsupported by LLVM,\nor systems that care more about memory usage than performance.\n\n\nImpact on CPython Development\n=============================\n\nExperimenting with Changes to Python or CPython Bytecode\n--------------------------------------------------------\n\nUnladen Swallow's JIT compiler operates on CPython bytecode, and as such, it is\nimmune to Python language changes that affect only the parser.\n\nWe recommend that changes to the CPython bytecode compiler or the semantics of\nindividual bytecodes be prototyped in the interpreter loop first, then be ported\nto the JIT compiler once the semantics are clear. To make this easier, Unladen\nSwallow includes a ``--without-llvm`` configure-time option that strips out the\nJIT compiler and all associated infrastructure. This leaves the current burden\nof experimentation unchanged so that developers can prototype in the current\nlow-barrier-to-entry interpreter loop.\n\nUnladen Swallow began implementing its JIT compiler by doing straightforward,\nnaive translations from bytecode implementations into LLVM API calls. We found\nthis process to be easily understood, and we recommend the same approach for\nCPython. We include several sample changes from the Unladen Swallow repository\nhere as examples of this style of development: [#us-r359]_, [#us-r376]_,\n[#us-r417]_, [#us-r517]_.\n\n\nDebugging\n---------\n\nThe Unladen Swallow team implemented changes to gdb to make it easier to use gdb\nto debug JIT-compiled Python code. These changes were released in gdb 7.0\n[#gdb70]_. They make it possible for gdb to identify and unwind past\nJIT-generated call stack frames. This allows gdb to continue to function as\nbefore for CPython development if one is changing, for example, the ``list``\ntype or builtin functions.\n\nExample backtrace after our changes, where ``baz``, ``bar`` and ``foo`` are\nJIT-compiled:\n\n::\n\n Program received signal SIGSEGV, Segmentation fault.\n 0x00002aaaabe7d1a8 in baz ()\n (gdb) bt\n #0 0x00002aaaabe7d1a8 in baz ()\n #1 0x00002aaaabe7d12c in bar ()\n #2 0x00002aaaabe7d0aa in foo ()\n #3 0x00002aaaabe7d02c in main ()\n #4 0x0000000000b870a2 in llvm::JIT::runFunction (this=0x1405b70, F=0x14024e0, ArgValues=...)\n at /home/rnk/llvm-gdb/lib/ExecutionEngine/JIT/JIT.cpp:395\n #5 0x0000000000baa4c5 in llvm::ExecutionEngine::runFunctionAsMain\n (this=0x1405b70, Fn=0x14024e0, argv=..., envp=0x7fffffffe3c0)\n at /home/rnk/llvm-gdb/lib/ExecutionEngine/ExecutionEngine.cpp:377\n #6 0x00000000007ebd52 in main (argc=2, argv=0x7fffffffe3a8,\n envp=0x7fffffffe3c0) at /home/rnk/llvm-gdb/tools/lli/lli.cpp:208\n\nPreviously, the JIT-compiled frames would have caused gdb to unwind incorrectly,\ngenerating lots of obviously-incorrect ``#6 0x00002aaaabe7d0aa in ?? ()``-style\nstack frames.\n\nHighlights:\n\n- gdb 7.0 is able to correctly parse JIT-compiled stack frames, allowing full\n use of gdb on non-JIT-compiled functions, that is, the vast majority of the\n CPython codebase.\n- Disassembling inside a JIT-compiled stack frame automatically prints the full\n list of instructions making up that function. This is an advance over the\n state of gdb before our work: developers needed to guess the starting address\n of the function and manually disassemble the assembly code.\n- Flexible underlying mechanism allows CPython to add more and more information,\n and eventually reach parity with C/C++ support in gdb for JIT-compiled machine\n code.\n\nLowlights:\n\n- gdb cannot print local variables or tell you what line you're currently\n executing inside a JIT-compiled function. Nor can it step through\n JIT-compiled code, except for one instruction at a time.\n- Not yet integrated with Apple's gdb or Microsoft's Visual Studio debuggers.\n\nThe Unladen Swallow team is working with Apple to get these changes\nincorporated into their future gdb releases.\n\n\nProfiling\n---------\n\nUnladen Swallow integrates with oProfile 0.9.4 and newer [#oprofile]_ to support\nassembly-level profiling on Linux systems. This means that oProfile will\ncorrectly symbolize JIT-compiled functions in its reports.\n\nExample report, where the ``#u#``-prefixed symbol names are JIT-compiled Python\nfunctions:\n\n::\n\n $ opreport -l ./python | less\n CPU: Core 2, speed 1600 MHz (estimated)\n Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000\n samples % image name symbol name\n 79589 4.2329 python PyString_FromFormatV\n 62971 3.3491 python PyEval_EvalCodeEx\n 62713 3.3354 python tupledealloc\n 57071 3.0353 python _PyEval_CallFunction\n 50009 2.6597 24532.jo #u#force_unicode\n 47468 2.5246 python PyUnicodeUCS2_Decode\n 45829 2.4374 python PyFrame_New\n 45173 2.4025 python lookdict_string\n 43082 2.2913 python PyType_IsSubtype\n 39763 2.1148 24532.jo #u#render5\n 38145 2.0287 python _PyType_Lookup\n 37643 2.0020 python PyObject_GC_UnTrack\n 37105 1.9734 python frame_dealloc\n 36849 1.9598 python PyEval_EvalFrame\n 35630 1.8950 24532.jo #u#resolve\n 33313 1.7717 python PyObject_IsInstance\n 33208 1.7662 python PyDict_GetItem\n 33168 1.7640 python PyTuple_New\n 30458 1.6199 python PyCFunction_NewEx\n\nThis support is functional, but as-yet unpolished. Unladen Swallow maintains a\npunchlist of items we feel are important to improve in our oProfile integration\nto make it more useful to core CPython developers [#us-oprofile-punchlist]_.\n\nHighlights:\n\n- Symbolization of JITted frames working in oProfile on Linux.\n\nLowlights:\n\n- No work yet invested in improving symbolization of JIT-compiled frames for\n Apple's Shark [#shark]_ or Microsoft's Visual Studio profiling tools.\n- Some polishing still desired for oProfile output.\n\nWe recommend using oProfile 0.9.5 (and newer) to work around a now-fixed bug on\nx86-64 platforms in oProfile. oProfile 0.9.4 will work fine on 32-bit platforms,\nhowever.\n\nGiven the ease of integrating oProfile with LLVM [#llvm-oprofile-change]_ and\nUnladen Swallow [#us-oprofile-change]_, other profiling tools should be easy as\nwell, provided they support a similar JIT interface [#oprofile-jit-interface]_.\n\nWe have documented the process for using oProfile to profile Unladen Swallow\n[#oprofile-workflow]_. This document will be merged into CPython's `Doc/` tree\nin the merge.\n\n\nAddition of C++ to CPython\n--------------------------\n\nIn order to use LLVM, Unladen Swallow has introduced C++ into the core CPython\ntree and build process. This is an unavoidable part of depending on LLVM; though\nLLVM offers a C API [#llvm-c-api]_, it is limited and does not expose the\nfunctionality needed by CPython. Because of this, we have implemented the\ninternal details of the Unladen Swallow JIT and its supporting infrastructure\nin C++. We do not propose converting the entire CPython codebase to C++.\n\nHighlights:\n\n- Easy use of LLVM's full, powerful code generation and related APIs.\n- Convenient, abstract data structures simplify code.\n- C++ is limited to relatively small corners of the CPython codebase.\n- C++ can be disabled via ``./configure --without-llvm``, which even omits the\n dependency on ``libstdc++``.\n\nLowlights:\n\n- Developers must know two related languages, C and C++ to work on the full\n range of CPython's internals.\n- A C++ style guide will need to be developed and enforced. PEP 7 will be\n extended [#pep7-cpp]_ to encompass C++ by taking the relevant parts of\n the C++ style guides from Unladen Swallow [#us-styleguide]_, LLVM\n [#llvm-styleguide]_ and Google [#google-styleguide]_.\n- Different C++ compilers emit different ABIs; this can cause problems if\n CPython is compiled with one C++ compiler and extensions modules are compiled\n with a different C++ compiler.\n\n\nManaging LLVM Releases, C++ API Changes\n---------------------------------------\n\nLLVM is released regularly every six months. This means that LLVM may be\nreleased two or three times during the course of development of a CPython 3.x\nrelease. Each LLVM release brings newer and more powerful optimizations,\nimproved platform support and more sophisticated code generation.\n\nLLVM releases usually include incompatible changes to the LLVM C++ API; the\nrelease notes for LLVM 2.6 [#llvm-26-whatsnew]_ include a list of\nintentionally-introduced incompatibilities. Unladen Swallow has tracked LLVM\ntrunk closely over the course of development. Our experience has been\nthat LLVM API changes are obvious and easily or mechanically remedied. We\ninclude two such changes from the Unladen Swallow tree as references here:\n[#us-llvm-r820]_, [#us-llvm-r532]_.\n\nDue to API incompatibilities, we recommend that an LLVM-based CPython target\ncompatibility with a single version of LLVM at a time. This will lower the\noverhead on the core development team. Pegging to an LLVM version should not be\na problem from a packaging perspective, because pre-built LLVM packages\ngenerally become available via standard system package managers fairly quickly\nfollowing an LLVM release, and failing that, llvm.org itself includes binary\nreleases.\n\nUnladen Swallow has historically included a copy of the LLVM and Clang source\ntrees in the Unladen Swallow tree; this was done to allow us to closely track\nLLVM trunk as we made patches to it. We do not recommend this model of\ndevelopment for CPython. CPython releases should be based on official LLVM\nreleases. Pre-built LLVM packages are available from MacPorts [#llvm-macports]_\nfor Darwin, and from most major Linux distributions ([#llvm-ubuntu]_,\n[#llvm-debian]_, [#llvm-fedora]_). LLVM itself provides additional binaries,\nsuch as for MinGW [#llvm-mingw]_.\n\nLLVM is currently intended to be statically linked; this means that binary\nreleases of CPython will include the relevant parts (not all!) of LLVM. This\nwill increase the binary size, as noted above. To simplify downstream package\nmanagement, we will modify LLVM to better support shared linking. This issue\nwill block final merger [#us-shared-link-issue]_.\n\nUnladen Swallow has tasked a full-time engineer with fixing any remaining\ncritical issues in LLVM before LLVM's 2.7 release. We consider it essential that\nCPython 3.x be able to depend on a released version of LLVM, rather than closely\ntracking LLVM trunk as Unladen Swallow has done. We believe we will finish this\nwork [#us-llvm-punchlist]_ before the release of LLVM 2.7, expected in May 2010.\n\n\nBuilding CPython\n----------------\n\nIn addition to a runtime dependency on LLVM, Unladen Swallow includes a\nbuild-time dependency on Clang [#clang]_, an LLVM-based C/C++ compiler. We use\nthis to compile parts of the C-language Python runtime to LLVM's intermediate\nrepresentation; this allows us to perform cross-language inlining, yielding\nincreased performance. Clang is not required to run Unladen Swallow. Clang\nbinary packages are available from most major Linux distributions (for example,\n[#clang-debian]_).\n\nWe examined the impact of Unladen Swallow on the time needed to build Python,\nincluding configure, full builds and incremental builds after touching a single\nC source file.\n\n+-------------+---------------+---------------+----------------------+\n| ./configure | CPython 2.6.4 | CPython 3.1.1 | Unladen Swallow r988 |\n+=============+===============+===============+======================+\n| Run 1 | 0m20.795s | 0m16.558s | 0m15.477s |\n+-------------+---------------+---------------+----------------------+\n| Run 2 | 0m15.255s | 0m16.349s | 0m15.391s |\n+-------------+---------------+---------------+----------------------+\n| Run 3 | 0m15.228s | 0m16.299s | 0m15.528s |\n+-------------+---------------+---------------+----------------------+\n\n+-------------+---------------+---------------+----------------------+\n| Full make | CPython 2.6.4 | CPython 3.1.1 | Unladen Swallow r988 |\n+=============+===============+===============+======================+\n| Run 1 | 1m30.776s | 1m22.367s | 1m54.053s |\n+-------------+---------------+---------------+----------------------+\n| Run 2 | 1m21.374s | 1m22.064s | 1m49.448s |\n+-------------+---------------+---------------+----------------------+\n| Run 3 | 1m22.047s | 1m23.645s | 1m49.305s |\n+-------------+---------------+---------------+----------------------+\n\nFull builds take a hit due to a) additional ``.cc`` files needed for LLVM\ninteraction, b) statically linking LLVM into ``libpython``, c) compiling parts\nof the Python runtime to LLVM IR to enable cross-language inlining.\n\nIncremental builds are also somewhat slower than mainline CPython. The table\nbelow shows incremental rebuild times after touching ``Objects/listobject.c``.\n\n+-------------+---------------+---------------+-----------------------+\n| Incr make | CPython 2.6.4 | CPython 3.1.1 | Unladen Swallow r1024 |\n+=============+===============+===============+=======================+\n| Run 1 | 0m1.854s | 0m1.456s | 0m6.680s |\n+-------------+---------------+---------------+-----------------------+\n| Run 2 | 0m1.437s | 0m1.442s | 0m5.310s |\n+-------------+---------------+---------------+-----------------------+\n| Run 3 | 0m1.440s | 0m1.425s | 0m7.639s |\n+-------------+---------------+---------------+-----------------------+\n\nAs with full builds, this extra time comes from statically linking LLVM\ninto ``libpython``. If ``libpython`` were linked shared against LLVM, this\noverhead would go down.\n\n\nProposed Merge Plan\n===================\n\nWe propose focusing our efforts on eventual merger with CPython's 3.x line of\ndevelopment. The BDFL has indicated that 2.7 is to be the final release of\nCPython's 2.x line of development [#bdfl-27-final]_, and since 2.7 alpha 1 has\nalready been released [#cpy-27a1]_, we have missed the window. Python 3 is the\nfuture, and that is where we will target our performance efforts.\n\nWe recommend the following plan for merger of Unladen Swallow into the CPython\nsource tree:\n\n- Creation of a branch in the CPython SVN repository to work in, call it\n ``py3k-jit`` as a strawman. This will be a branch of the CPython ``py3k``\n branch.\n- We will keep this branch closely integrated to ``py3k``. The further we\n deviate, the harder our work will be.\n- Any JIT-related patches will go into the ``py3k-jit`` branch.\n- Non-JIT-related patches will go into the ``py3k`` branch (once reviewed and\n approved) and be merged back into the ``py3k-jit`` branch.\n- Potentially-contentious issues, such as the introduction of new command line\n flags or environment variables, will be discussed on python-dev.\n\n\nBecause Google uses CPython 2.x internally, Unladen Swallow is based on CPython\n2.6. We would need to port our compiler to Python 3; this would be done as\npatches are applied to the ``py3k-jit`` branch, so that the branch remains a\nconsistent implementation of Python 3 at all times.\n\nWe believe this approach will be minimally disruptive to the 3.2 or 3.3 release\nprocess while we iron out any remaining issues blocking final merger into\n``py3k``. Unladen Swallow maintains a punchlist of known issues needed before\nfinal merger [#us-punchlist]_, which includes all problems mentioned in this\nPEP; we trust the CPython community will have its own concerns. This punchlist\nis not static; other issues may emerge in the future that will block final\nmerger into the ``py3k`` branch.\n\nChanges will be committed directly to the ``py3k-jit`` branch, with only large,\ntricky or controversial changes sent for pre-commit code review.\n\n\nContingency Plans\n-----------------\n\nThere is a chance that we will not be able to reduce memory usage or startup\ntime to a level satisfactory to the CPython community. Our primary contingency\nplan for this situation is to shift from an online just-in-time compilation\nstrategy to an offline ahead-of-time strategy using an instrumented CPython\ninterpreter loop to obtain feedback. This is the same model used by gcc's\nfeedback-directed optimizations (`-fprofile-generate`) [#gcc-fdo]_ and\nMicrosoft Visual Studio's profile-guided optimizations [#msvc-pgo]_; we will\nrefer to this as \"feedback-directed optimization\" here, or FDO.\n\nWe believe that an FDO compiler for Python would be inferior to a JIT compiler.\nFDO requires a high-quality, representative benchmark suite, which is a relative\nrarity in both open- and closed-source development. A JIT compiler can\ndynamically find and optimize the hot spots in any application -- benchmark\nsuite or no -- allowing it to adapt to changes in application bottlenecks\nwithout human intervention.\n\nIf an ahead-of-time FDO compiler is required, it should be able to leverage a\nlarge percentage of the code and infrastructure already developed for Unladen\nSwallow's JIT compiler. Indeed, these two compilation strategies could exist\nside-by-side.\n\n\nFuture Work\n===========\n\nA JIT compiler is an extremely flexible tool, and we have by no means exhausted\nits full potential. Unladen Swallow maintains a list of yet-to-be-implemented\nperformance optimizations [#us-perf-punchlist]_ that the team has not yet\nhad time to fully implement. Examples:\n\n- Python/Python inlining [#inlining]_. Our compiler currently performs no\n inlining between pure-Python functions. Work on this is on-going\n [#us-inlining]_.\n- Unboxing [#unboxing]_. Unboxing is critical for numerical performance. PyPy\n in particular has demonstrated the value of unboxing to heavily-numeric\n workloads.\n- Recompilation, adaptation. Unladen Swallow currently only compiles a Python\n function once, based on its usage pattern up to that point. If the usage\n pattern changes, limitations in LLVM [#us-recompile-issue]_ prevent us from\n recompiling the function to better serve the new usage pattern.\n- JIT-compile regular expressions. Modern JavaScript engines reuse their JIT\n compilation infrastructure to boost regex performance [#us-regex-perf]_.\n Unladen Swallow has developed benchmarks for Python regular expression\n performance ([#us-bm-re-compile]_, [#us-bm-re-v8]_, [#us-bm-re-effbot]_), but\n work on regex performance is still at an early stage [#us-regex-issue]_.\n- Trace compilation [#traces-waste-of-time]_, [#traces-explicit-pipeline]_.\n Based on the results of PyPy and Tracemonkey [#tracemonkey]_, we believe that\n a CPython JIT should incorporate trace compilation to some degree. We\n initially avoided a purely-tracing JIT compiler in favor of a simpler,\n function-at-a-time compiler. However this function-at-a-time compiler has laid\n the groundwork for a future tracing compiler implemented in the same terms.\n- Profile generation/reuse. The runtime data gathered by the JIT could be\n persisted to disk and reused by subsequent JIT compilations, or by external\n tools such as Cython [#cython]_ or a feedback-enhanced code coverage tool.\n\nThis list is by no means exhaustive. There is a vast literature on optimizations\nfor dynamic languages that could and should be implemented in terms of Unladen\nSwallow's LLVM-based JIT compiler [#us-relevantpapers]_.\n\n\nUnladen Swallow Community\n=========================\n\nWe would like to thank the community of developers who have contributed to\nUnladen Swallow, in particular: James Abbatiello, Joerg Blank, Eric Christopher,\nAlex Gaynor, Chris Lattner, Nick Lewycky, Evan Phoenix and Thomas Wouters.\n\n\nLicensing\n=========\n\nAll work on Unladen Swallow is licensed to the Python Software Foundation (PSF)\nunder the terms of the Python Software Foundation License v2 [#psf-lic]_ under\nthe umbrella of Google's blanket Contributor License Agreement with the PSF.\n\nLLVM is licensed [#llvm-lic]_ under the University of llinois/NCSA Open Source\nLicense [#ui-lic]_, a liberal, OSI-approved license. The University of Illinois\nUrbana-Champaign is the sole copyright holder for LLVM.\n\n\nReferences\n==========\n\n.. [#us-post-mortem]\n http://qinsb.blogspot.com/2011/03/unladen-swallow-retrospective.html\n\n.. [#dead-parrot]\n http://en.wikipedia.org/wiki/Dead_Parrot_sketch\n\n.. [#us]\n http://code.google.com/p/unladen-swallow/\n\n.. [#llvm]\n http://llvm.org/\n\n.. [#clang]\n http://clang.llvm.org/\n\n.. [#tested-apps]\n http://code.google.com/p/unladen-swallow/wiki/Testing\n\n.. [#llvm-hardware]\n http://llvm.org/docs/GettingStarted.html#hardware\n\n.. [#llvm-c-api]\n http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/\n\n.. [#llvm-26-whatsnew]\n http://llvm.org/releases/2.6/docs/ReleaseNotes.html#whatsnew\n\n.. [#us-llvm-r820]\n http://code.google.com/p/unladen-swallow/source/detail?r=820\n\n.. [#us-llvm-r532]\n http://code.google.com/p/unladen-swallow/source/detail?r=532\n\n.. [#llvm-macports]\n http://trac.macports.org/browser/trunk/dports/lang/llvm/Portfile\n\n.. [#llvm-ubuntu]\n http://packages.ubuntu.com/karmic/llvm\n\n.. [#llvm-debian]\n http://packages.debian.org/unstable/devel/llvm\n\n.. [#clang-debian]\n http://packages.debian.org/sid/clang\n\n.. [#llvm-fedora]\n http://koji.fedoraproject.org/koji/buildinfo?buildID=134384\n\n.. [#gdb70]\n http://www.gnu.org/software/gdb/download/ANNOUNCEMENT\n\n.. [#oprofile]\n http://oprofile.sourceforge.net/news/\n\n.. [#us-oprofile-punchlist]\n http://code.google.com/p/unladen-swallow/issues/detail?id=63\n\n.. [#shark]\n http://developer.apple.com/tools/sharkoptimize.html\n\n.. [#llvm-oprofile-change]\n http://llvm.org/viewvc/llvm-project?view=rev&revision=75279\n\n.. [#us-oprofile-change]\n http://code.google.com/p/unladen-swallow/source/detail?r=986\n\n.. [#oprofile-jit-interface]\n http://oprofile.sourceforge.net/doc/devel/jit-interface.html\n\n.. [#oprofile-workflow]\n http://code.google.com/p/unladen-swallow/wiki/UsingOProfile\n\n.. [#llvm-mingw]\n http://llvm.org/releases/download.html\n\n.. [#us-r359]\n http://code.google.com/p/unladen-swallow/source/detail?r=359\n\n.. [#us-r376]\n http://code.google.com/p/unladen-swallow/source/detail?r=376\n\n.. [#us-r417]\n http://code.google.com/p/unladen-swallow/source/detail?r=417\n\n.. [#us-r517]\n http://code.google.com/p/unladen-swallow/source/detail?r=517\n\n.. [#bdfl-27-final]\n https://mail.python.org/pipermail/python-dev/2010-January/095682.html\n\n.. [#cpy-27a1]\n http://www.python.org/dev/peps/pep-0373/\n\n.. [#cpy-32]_\n http://www.python.org/dev/peps/pep-0392/\n\n.. [#us-punchlist]\n http://code.google.com/p/unladen-swallow/issues/list?q=label:Merger\n\n.. [#us-binary-size]\n http://code.google.com/p/unladen-swallow/issues/detail?id=118\n\n.. [#us-issue-startup-time]\n http://code.google.com/p/unladen-swallow/issues/detail?id=64\n\n.. [#zope-interface]\n http://www.zope.org/Products/ZopeInterface\n\n.. [#bigtable]\n http://en.wikipedia.org/wiki/BigTable\n\n.. [#mondrian]\n http://www.niallkennedy.com/blog/2006/11/google-mondrian.html\n\n.. [#us-sqlalchemy-readme]\n http://code.google.com/p/unladen-swallow/source/browse/tests/lib/sqlalchemy/README.unladen\n\n.. [#us-test_llvm]\n http://code.google.com/p/unladen-swallow/source/browse/trunk/Lib/test/test_llvm.py\n\n.. [#fuzz-testing]\n http://en.wikipedia.org/wiki/Fuzz_testing\n\n.. [#pyfuzz]\n http://bitbucket.org/ebo/pyfuzz/overview/\n\n.. [#fusil]\n http://lwn.net/Articles/322826/\n\n.. [#us-memory-issue]\n http://code.google.com/p/unladen-swallow/issues/detail?id=68\n\n.. [#us-benchmarks]\n http://code.google.com/p/unladen-swallow/wiki/Benchmarks\n\n.. [#students-t-test]\n http://en.wikipedia.org/wiki/Student's_t-test\n\n.. [#smaps]\n http://bmaurer.blogspot.com/2006/03/memory-usage-with-smaps.html\n\n.. [#us-background-thread]\n http://code.google.com/p/unladen-swallow/source/browse/branches/background-thread\n\n.. [#us-background-thread-issue]\n http://code.google.com/p/unladen-swallow/issues/detail?id=40\n\n.. [#us-import-tests]\n http://code.google.com/p/unladen-swallow/source/detail?r=888\n\n.. [#us-tracing-tests]\n http://code.google.com/p/unladen-swallow/source/diff?spec=svn576&r=576&format=side&path=/trunk/Lib/test/test_trace.py\n\n.. [#us-perf-punchlist]\n http://code.google.com/p/unladen-swallow/issues/list?q=label:Performance\n\n.. [#jit]\n http://en.wikipedia.org/wiki/Just-in-time_compilation\n\n.. [#urs-self]\n http://research.sun.com/self/papers/urs-thesis.html\n\n.. [#us-projectplan]\n http://code.google.com/p/unladen-swallow/wiki/ProjectPlan\n\n.. [#us-relevantpapers]\n http://code.google.com/p/unladen-swallow/wiki/RelevantPapers\n\n.. [#us-llvm-notes]\n http://code.google.com/p/unladen-swallow/source/browse/trunk/Python/llvm_notes.txt\n\n.. [#psf-lic]\n http://www.python.org/psf/license/\n\n.. [#llvm-lic]\n http://llvm.org/docs/DeveloperPolicy.html#clp\n\n.. [#ui-lic]\n http://www.opensource.org/licenses/UoI-NCSA.php\n\n.. [#v8]\n http://code.google.com/p/v8/\n\n.. [#squirrelfishextreme]\n http://webkit.org/blog/214/introducing-squirrelfish-extreme/\n\n.. [#rubinius]\n http://rubini.us/\n\n.. [#parrot-on-llvm]\n http://lists.parrot.org/pipermail/parrot-dev/2009-September/002811.html\n\n.. [#macruby]\n http://www.macruby.org/\n\n.. [#hotspot]\n http://en.wikipedia.org/wiki/HotSpot\n\n.. [#psyco]\n http://psyco.sourceforge.net/\n\n.. [#pypy]\n http://codespeak.net/pypy/dist/pypy/doc/\n\n.. [#inlining]\n http://en.wikipedia.org/wiki/Inline_expansion\n\n.. [#unboxing]\n http://en.wikipedia.org/wiki/Object_type_(object-oriented_programming%29\n\n.. [#us-inlining]\n http://code.google.com/p/unladen-swallow/issues/detail?id=86\n\n.. [#us-styleguide]\n http://code.google.com/p/unladen-swallow/wiki/StyleGuide\n\n.. [#llvm-styleguide]\n http://llvm.org/docs/CodingStandards.html\n\n.. [#google-styleguide]\n http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml\n\n.. [#us-recompile-issue]\n http://code.google.com/p/unladen-swallow/issues/detail?id=41\n\n.. [#us-regex-perf]\n http://code.google.com/p/unladen-swallow/wiki/ProjectPlan#Regular_Expressions\n\n.. [#us-bm-re-compile]\n http://code.google.com/p/unladen-swallow/source/browse/tests/performance/bm_regex_compile.py\n\n.. [#us-bm-re-v8]\n http://code.google.com/p/unladen-swallow/source/browse/tests/performance/bm_regex_v8.py\n\n.. [#us-bm-re-effbot]\n http://code.google.com/p/unladen-swallow/source/browse/tests/performance/bm_regex_effbot.py\n\n.. [#us-regex-issue]\n http://code.google.com/p/unladen-swallow/issues/detail?id=13\n\n.. [#pygame]\n http://www.pygame.org/\n\n.. [#numpy]\n http://numpy.scipy.org/\n\n.. [#pypy-bmarks]\n http://codespeak.net:8099/plotsummary.html\n\n.. [#llvm-users]\n http://llvm.org/Users.html\n\n.. [#hlvm]\n http://www.ffconsultancy.com/ocaml/hlvm/\n\n.. [#llvm-far-call-issue]\n http://llvm.org/PR5201\n\n.. [#llvm-jmm-rev]\n http://llvm.org/viewvc/llvm-project?view=rev&revision=76828\n\n.. [#llvm-memleak-rev]\n http://llvm.org/viewvc/llvm-project?rev=91611&view=rev\n\n.. [#llvm-globaldce-rev]\n http://llvm.org/viewvc/llvm-project?rev=85182&view=rev\n\n.. [#llvm-availext-issue]\n http://llvm.org/PR5735\n\n.. [#us-specialization-issue]\n http://code.google.com/p/unladen-swallow/issues/detail?id=73\n\n.. [#us-direct-calling-issue]\n http://code.google.com/p/unladen-swallow/issues/detail?id=88\n\n.. [#us-fast-globals-issue]\n http://code.google.com/p/unladen-swallow/issues/detail?id=67\n\n.. [#traces-waste-of-time]\n http://www.ics.uci.edu/~franz/Site/pubs-pdf/C44Prepub.pdf\n\n.. [#traces-explicit-pipeline]\n http://www.ics.uci.edu/~franz/Site/pubs-pdf/ICS-TR-07-12.pdf\n\n.. [#tracemonkey]\n https://wiki.mozilla.org/JavaScript:TraceMonkey\n\n.. [#llvm-langref]\n http://llvm.org/docs/LangRef.html\n\n.. [#us-wider-perf-issue]\n http://code.google.com/p/unladen-swallow/issues/detail?id=120\n\n.. [#us-nbody]\n http://code.google.com/p/unladen-swallow/source/browse/tests/performance/bm_nbody.py\n\n.. [#us-shared-link-issue]\n http://code.google.com/p/unladen-swallow/issues/detail?id=130\n\n.. [#us-llvm-punchlist]\n http://code.google.com/p/unladen-swallow/issues/detail?id=131\n\n.. [#llvm-ppc-eager-jit-issue]\n http://llvm.org/PR4816\n\n.. [#llvm-arm-jit-issue]\n http://llvm.org/PR6065\n\n.. [#cython]\n http://www.cython.org/\n\n.. [#shedskin]\n http://shed-skin.blogspot.com/\n\n.. [#shedskin-library-limits]\n http://shedskin.googlecode.com/files/shedskin-tutorial-0.3.html\n\n.. [#wpython]\n http://code.google.com/p/wpython/\n\n.. [#wpython-performance]\n http://www.mail-archive.com/python-dev@python.org/msg45143.html\n\n.. [#ironpython]\n http://ironpython.net/\n\n.. [#mono]\n http://www.mono-project.com/\n\n.. [#jython]\n http://www.jython.org/\n\n.. [#jython-c-ext]\n http://wiki.python.org/jython/JythonFaq/GeneralInfo\n\n.. [#pyv8]\n http://code.google.com/p/pyv8/\n\n.. [#gcc-fdo]\n http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html\n\n.. [#msvc-pgo]\n http://msdn.microsoft.com/en-us/library/e7k32f4k.aspx\n\n.. [#us-wpython-compat]\n http://www.mail-archive.com/python-dev@python.org/msg44962.html\n\n.. [#asher-rotem]\n http://portal.acm.org/citation.cfm?id=1534530.1534550\n\n.. [#stackless]\n http://www.stackless.com/\n\n.. [#stackless-merger]\n https://mail.python.org/pipermail/python-dev/2004-June/045165.html\n\n.. [#llvm-heap-frames]\n http://www.nondot.org/sabre/LLVMNotes/ExplicitlyManagedStackFrames.txt\n\n.. [#llvm-heap-frames-disc]\n http://old.nabble.com/LLVM-and-coroutines-microthreads-td23080883.html\n\n.. [#pep7-cpp]\n http://www.mail-archive.com/python-dev@python.org/msg45544.html\n\n\nCopyright\n=========\n\nThis document has been placed in the public domain.\n\n..\n Local Variables:\n mode: indented-text\n indent-tabs-mode: nil\n sentence-end-double-space: t\n fill-column: 70\n coding: utf-8\n End:\n\n\n\n"} +{"text": "/*******************************************************************************************************\n* Copyright 2017 Alliance for Sustainable Energy, LLC\n*\n* NOTICE: This software was developed at least in part by Alliance for Sustainable Energy, LLC\n* (�Alliance�) under Contract No. DE-AC36-08GO28308 with the U.S. Department of Energy and the U.S.\n* The Government retains for itself and others acting on its behalf a nonexclusive, paid-up,\n* irrevocable worldwide license in the software to reproduce, prepare derivative works, distribute\n* copies to the public, perform publicly and display publicly, and to permit others to do so.\n*\n* Redistribution and use in source and binary forms, with or without modification, are permitted\n* provided that the following conditions are met:\n*\n* 1. Redistributions of source code must retain the above copyright notice, the above government\n* rights notice, this list of conditions and the following disclaimer.\n*\n* 2. Redistributions in binary form must reproduce the above copyright notice, the above government\n* rights notice, this list of conditions and the following disclaimer in the documentation and/or\n* other materials provided with the distribution.\n*\n* 3. The entire corresponding source code of any redistribution, with or without modification, by a\n* research entity, including but not limited to any contracting manager/operator of a United States\n* National Laboratory, any institution of higher learning, and any non-profit organization, must be\n* made publicly available under this license for as long as the redistribution is made available by\n* the research entity.\n*\n* 4. Redistribution of this software, without modification, must refer to the software by the same\n* designation. Redistribution of a modified version of this software (i) may not refer to the modified\n* version by the same designation, or by any confusingly similar designation, and (ii) must refer to\n* the underlying software originally provided by Alliance as �System Advisor Model� or �SAM�. Except\n* to comply with the foregoing, the terms �System Advisor Model�, �SAM�, or any confusingly similar\n* designation may not be used to refer to any modified version of this software or any modified\n* version of the underlying software originally provided by Alliance without the prior written consent\n* of Alliance.\n*\n* 5. The name of the copyright holder, contributors, the United States Government, the United States\n* Department of Energy, or any of their employees may not be used to endorse or promote products\n* derived from this software without specific prior written permission.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER,\n* CONTRIBUTORS, UNITED STATES GOVERNMENT OR UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR\n* EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*******************************************************************************************************/\n\n#ifndef __uncertainties_h\n#define __uncertainties_h\n\n#include \n#include \n#include \n#include \n\n#include \n\n\n// forwards\nclass wxMetroButton;\nclass wxRadioChoice;\nclass wxScrolledWindow;\nclass wxExtTextCtrl;\nclass wxCheckListBox;\nclass wxSnapLayout;\nclass wxDVSelectionListCtrl;\nclass wxSlider;\nclass wxCheckBox;\nclass wxChoice;\nclass wxSearchCtrl;\nclass MetricsTable;\n\nclass Case;\nclass Simulation;\n\nclass Uncertainties\n{\npublic:\n\n\tstatic std::vector &Colours();\n\n\tUncertainties();\n\n\tvoid Copy( Uncertainties *gr );\n\tbool SameAs( Uncertainties *gr );\n\n\tbool Read( wxInputStream &is );\n\tbool Write( wxOutputStream &os );\n\n\tenum { BAR, STACKED, LINE, SCATTER, CONTOUR };\n\tint Type;\n\n\twxArrayString Y;\n\t\n\twxString XLabel;\n\twxString YLabel;\n\twxString Title;\n\n\tbool ShowXValues;\n\tbool ShowYValues;\n\tbool ShowLegend;\n\tint LegendPos;\n\n\tint Size;\n\tbool CoarseGrid;\n\tbool FineGrid;\n\tdouble YMin, YMax;\n\twxString Notes;\n\tdouble FontScale;\n\tint FontFace; // 0=system,1=arial,2=times,3=metro\t\n};\n\nBEGIN_DECLARE_EVENT_TYPES()\n\tDECLARE_EVENT_TYPE( wxEVT_Uncertainties_SELECT, 0)\nEND_DECLARE_EVENT_TYPES()\n\n#define EVT_Uncertainties_SELECT(id, func) EVT_COMMAND(id, wxEVT_Uncertainties_SELECT, func)\n\nclass UncertaintiesCtrl : public wxPLPlotCtrl\n{\npublic:\n\tUncertaintiesCtrl( wxWindow *parent, int id );\n\t\n\t// multiple variables over a single simulation\n\tint Display(Simulation *sim, Uncertainties &g);\n\t// multiple variables over a single simulation\n\tint Figure2(Simulation *sim);\n\t// multiple variables over a single simulation\n\tint Figure5(Simulation *sim);\n\t// multiple variables over a single simulation\n\tint Figure10(Simulation *sim);\n\n\t// one variable over multiple simulations\n\tint Display(std::vector sims, Uncertainties &g);\n\n\tint IntersectionLines(const double &x_min, const double &x_max, const double &y_min, const double &y_max, const wxString &label, const wxPLOutputDevice::Style &style);\n\n\n\tvoid SetUncertainties( const Uncertainties &g ) { m_g = g; }\n\tUncertainties GetUncertainties() { return m_g; }\nprotected:\n\tSimulation *m_s;\n\tUncertainties m_g;\n\n\tvoid OnLeftDown( wxMouseEvent & );\n\n\tDECLARE_EVENT_TABLE();\n};\n\nBEGIN_DECLARE_EVENT_TYPES()\n\tDECLARE_EVENT_TYPE( wxEVT_Uncertainties_PROPERTY_CHANGE, 0)\nEND_DECLARE_EVENT_TYPES()\n\n#define EVT_Uncertainties_PROPERTY_CHANGE(id, func) EVT_COMMAND(id, wxEVT_Uncertainties_PROPERTY_CHANGE, func)\n\nclass UncertaintiesProperties : public wxPanel\n{\npublic:\n\tUncertaintiesProperties( wxWindow *parent, int id );\n\n\tvoid SetupVariables( Simulation *sim );\n\tvoid Clear();\n\n\tvoid Set( const Uncertainties &g );\n\tvoid Get( Uncertainties &g );\n\nprivate:\n\twxArrayString m_names;\n\twxArrayString m_selected;\n\tSimulation *m_sim;\n\n\twxRadioChoice *m_type;\n\twxExtTextCtrl *m_title;\n\twxDVSelectionListCtrl *m_Y;\n\n\twxSearchCtrl *m_srch;\n\n\twxExtTextCtrl *m_xlabel;\n\twxExtTextCtrl *m_ylabel;\n\twxSlider *m_scale;\n\twxSlider *m_size;\n\twxCheckBox *m_coarse, *m_fine;\n\twxCheckBox *m_showLegend;\n\twxChoice *m_legendPos;\n\twxChoice *m_font;\n\t\n\tvoid OnEdit(wxCommandEvent &);\n\tvoid OnSearch(wxCommandEvent &);\n\tvoid OnSlider(wxScrollEvent &);\n\tvoid SendChangeEvent();\n\n\tDECLARE_EVENT_TABLE();\n\n};\n\nclass UncertaintiesViewer : public wxPanel\n{\npublic:\n\tUncertaintiesViewer( wxWindow *parent );\n\t\n\tvoid Setup( Simulation *sim );\n\t\n\tUncertaintiesCtrl *CreateNewUncertainties();\n\tvoid DeleteUncertainties( UncertaintiesCtrl * );\n\tvoid DeleteAll();\n\n\tvoid SetUncertainties( std::vector &gl );\n\tvoid GetUncertainties( std::vector &gl );\n\n\tUncertaintiesCtrl *Current();\nprivate:\n\tvoid UpdateUncertainties();\n//\tvoid UpdateProperties();\n\tvoid OnCommand( wxCommandEvent & );\n\tvoid OnUncertaintiesSelect( wxCommandEvent & );\n\tvoid SetCurrent( UncertaintiesCtrl *gc );\n\n // display table of standard deviations\n void DisplayStdDevs();\n\n\t// display a set of probability of exceedances in a table\n void DisplayProbOfExceedances();\n\n\tUncertaintiesCtrl *m_current;\n MetricsTable *m_stddevTable;\n MetricsTable *m_exceedanceTable;\n//\tUncertaintiesProperties *m_props;\n\twxSnapLayout *m_layout;\n\tstd::vector m_Uncertainties;\n\n\tSimulation *m_sim;\n\n\n\tDECLARE_EVENT_TABLE();\n};\n\n#endif\n\n"} +{"text": "/*\n * Copyright 2019 Azavea\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 geotrellis.util\n\nimport java.net.URI\n\nimport org.scalatest.matchers.should.Matchers\nimport org.scalatest.funspec.AnyFunSpec\n\nclass FileRangeReaderProviderSpec extends AnyFunSpec with Matchers {\n describe(\"FileRangeReaderProviderSpec\") {\n val path = \"raster/data/aspect.tif\"\n\n it(\"should create a FileRangeReader from a URI\") {\n val reader = RangeReader(new URI(path))\n\n assert(reader.isInstanceOf[FileRangeReader])\n }\n\n it(\"should be able to process a URI with a scheme and an authority\") {\n val expectedPath = \"data/path/to/my/data/blah.tif\"\n val reader = RangeReader(new URI(s\"file://$expectedPath\"))\n\n reader.asInstanceOf[FileRangeReader].file.toString should be (expectedPath)\n }\n\n it(\"should be able to process a URI with a scheme and no authority\") {\n val expectedPath = \"data/path/to/my/data/blah.tif\"\n val reader = RangeReader(new URI(s\"file:$expectedPath\"))\n\n reader.asInstanceOf[FileRangeReader].file.toString should be (expectedPath)\n }\n\n it(\"should be able to process a URI that's a relative path\") {\n val expectedPath = \"../data/path/to/my/data/blah.tif\"\n val reader = RangeReader(new URI(s\"$expectedPath\"))\n\n reader.asInstanceOf[FileRangeReader].file.toString should be (expectedPath)\n }\n\n it(\"should be able to process a URI with a scheme and authority that's an absolute path\") {\n val expectedPath = \"/data/path/to/my/data/blah.tif\"\n val reader = RangeReader(new URI(s\"file://$expectedPath\"))\n\n reader.asInstanceOf[FileRangeReader].file.toString should be (expectedPath)\n }\n\n it(\"should be able to process a URI with a scheme and no authority that's an absolute path\") {\n val expectedPath = \"/data/path/to/my/data/blah.tif\"\n val reader = RangeReader(new URI(s\"file:$expectedPath\"))\n\n reader.asInstanceOf[FileRangeReader].file.toString should be (expectedPath)\n }\n\n it(\"should be able to process a URI that's an absolute path\") {\n val expectedPath = \"/data/path/to/my/data/blah.tif\"\n val reader = RangeReader(new URI(s\"$expectedPath\"))\n\n reader.asInstanceOf[FileRangeReader].file.toString should be (expectedPath)\n }\n }\n}\n"} +{"text": "\n\n\n\n\tarchiveVersion\n\t1\n\tclasses\n\t\n\tobjectVersion\n\t46\n\tobjects\n\t\n\t\t006CE543BCFC47E7AB666869\n\t\t\n\t\t\tbuildActionMask\n\t\t\t2147483647\n\t\t\tfiles\n\t\t\t\n\t\t\tinputPaths\n\t\t\t\n\t\t\tisa\n\t\t\tPBXShellScriptBuildPhase\n\t\t\tname\n\t\t\tCheck Pods Manifest.lock\n\t\t\toutputPaths\n\t\t\t\n\t\t\trunOnlyForDeploymentPostprocessing\n\t\t\t0\n\t\t\tshellPath\n\t\t\t/bin/sh\n\t\t\tshellScript\n\t\t\tdiff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n\n\t\t\tshowEnvVarsInLog\n\t\t\t0\n\t\t\n\t\t0E8BBA2F9ED2474C8534716D\n\t\t\n\t\t\tfileRef\n\t\t\t8C50D98031904B55BA82D2E5\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A03EAC919C4F4E40095708C\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.h\n\t\t\tpath\n\t\t\tVENTouchLockTests-Prefix.pch\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A03EACA19C4F72C0095708C\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.objc\n\t\t\tpath\n\t\t\tVENTouchLockEnterPasscodeViewControllerSpec.m\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A03EACB19C4F72C0095708C\n\t\t\n\t\t\tfileRef\n\t\t\t3A03EACA19C4F72C0095708C\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A03EACC19C4FF1D0095708C\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A9819BE68A300AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A03EACE19C4FF440095708C\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A9919BE68A300AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A03EACF19C4FF990095708C\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A8919BE686900AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A03EAD019C4FF990095708C\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A9B19BE68A300AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A03EAD119C4FF990095708C\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A9D19BE68A300AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A03EAD219C4FF990095708C\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A9F19BE68A300AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A03EAD319C4FF990095708C\n\t\t\n\t\t\tfileRef\n\t\t\t3A709AAD19BE68BF00AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A03EAD419C4FF990095708C\n\t\t\n\t\t\tfileRef\n\t\t\t3A709AAF19BE68BF00AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A03EAD619C4FF990095708C\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A8F19BE688000AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A03EAD819C56C9E0095708C\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.objc\n\t\t\tpath\n\t\t\tUIViewController+VENTouchLockSpec.m\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A03EAD919C56C9E0095708C\n\t\t\n\t\t\tfileRef\n\t\t\t3A03EAD819C56C9E0095708C\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A03EADA19C5E41A0095708C\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.objc\n\t\t\tpath\n\t\t\tVENTouchLockSpec.m\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A03EADB19C5E41A0095708C\n\t\t\n\t\t\tfileRef\n\t\t\t3A03EADA19C5E41A0095708C\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A4FE4165D8CB1C8FB147395\n\t\t\n\t\t\tincludeInIndex\n\t\t\t1\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\ttext.xcconfig\n\t\t\tname\n\t\t\tPods-VENTouchLockTests.debug.xcconfig\n\t\t\tpath\n\t\t\tPods/Target Support Files/Pods-VENTouchLockTests/Pods-VENTouchLockTests.debug.xcconfig\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A5C456419D9C15F00E86B7C\n\t\t\n\t\t\tchildren\n\t\t\t\n\t\t\t\t3A5C456519D9C16B00E86B7C\n\t\t\t\t3A5C456619D9C16B00E86B7C\n\t\t\t\n\t\t\tisa\n\t\t\tPBXGroup\n\t\t\tname\n\t\t\tModels\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A5C456519D9C16B00E86B7C\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.h\n\t\t\tname\n\t\t\tVENTouchLockAppearance.h\n\t\t\tpath\n\t\t\tModels/VENTouchLockAppearance.h\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A5C456619D9C16B00E86B7C\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.objc\n\t\t\tname\n\t\t\tVENTouchLockAppearance.m\n\t\t\tpath\n\t\t\tModels/VENTouchLockAppearance.m\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A5C456719D9C16B00E86B7C\n\t\t\n\t\t\tfileRef\n\t\t\t3A5C456519D9C16B00E86B7C\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A5C456819D9C16B00E86B7C\n\t\t\n\t\t\tfileRef\n\t\t\t3A5C456619D9C16B00E86B7C\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A5C456919D9C1A500E86B7C\n\t\t\n\t\t\tfileRef\n\t\t\t3A5C456619D9C16B00E86B7C\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709A6619BE67D800AC9238\n\t\t\n\t\t\tchildren\n\t\t\t\n\t\t\t\t3A709A7219BE67D800AC9238\n\t\t\t\t3A709A7C19BE67D800AC9238\n\t\t\t\t3A709A7119BE67D800AC9238\n\t\t\t\t3D5E0250C8A240A2922F55F7\n\t\t\t\tAE7750A29BBEFCCFD46D3B6D\n\t\t\t\n\t\t\tisa\n\t\t\tPBXGroup\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A6719BE67D800AC9238\n\t\t\n\t\t\tattributes\n\t\t\t\n\t\t\t\tLastUpgradeCheck\n\t\t\t\t0600\n\t\t\t\tORGANIZATIONNAME\n\t\t\t\tVenmo\n\t\t\t\tTargetAttributes\n\t\t\t\t\n\t\t\t\t\t3A709A6F19BE67D800AC9238\n\t\t\t\t\t\n\t\t\t\t\t\tCreatedOnToolsVersion\n\t\t\t\t\t\t6.0\n\t\t\t\t\t\n\t\t\t\t\t3A709A7A19BE67D800AC9238\n\t\t\t\t\t\n\t\t\t\t\t\tCreatedOnToolsVersion\n\t\t\t\t\t\t6.0\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\tbuildConfigurationList\n\t\t\t3A709A6A19BE67D800AC9238\n\t\t\tcompatibilityVersion\n\t\t\tXcode 3.2\n\t\t\tdevelopmentRegion\n\t\t\tEnglish\n\t\t\thasScannedForEncodings\n\t\t\t0\n\t\t\tisa\n\t\t\tPBXProject\n\t\t\tknownRegions\n\t\t\t\n\t\t\t\ten\n\t\t\t\n\t\t\tmainGroup\n\t\t\t3A709A6619BE67D800AC9238\n\t\t\tproductRefGroup\n\t\t\t3A709A7119BE67D800AC9238\n\t\t\tprojectDirPath\n\t\t\t\n\t\t\tprojectReferences\n\t\t\t\n\t\t\tprojectRoot\n\t\t\t\n\t\t\ttargets\n\t\t\t\n\t\t\t\t3A709A6F19BE67D800AC9238\n\t\t\t\t3A709A7A19BE67D800AC9238\n\t\t\t\n\t\t\n\t\t3A709A6A19BE67D800AC9238\n\t\t\n\t\t\tbuildConfigurations\n\t\t\t\n\t\t\t\t3A709A8119BE67D800AC9238\n\t\t\t\t3A709A8219BE67D800AC9238\n\t\t\t\n\t\t\tdefaultConfigurationIsVisible\n\t\t\t0\n\t\t\tdefaultConfigurationName\n\t\t\tRelease\n\t\t\tisa\n\t\t\tXCConfigurationList\n\t\t\n\t\t3A709A6B19BE67D800AC9238\n\t\t\n\t\t\tbuildActionMask\n\t\t\t2147483647\n\t\t\tfiles\n\t\t\t\n\t\t\t\t3A709AA419BE68A300AC9238\n\t\t\t\t3A709A9319BE688000AC9238\n\t\t\t\t3A709A8A19BE686900AC9238\n\t\t\t\t3A709AAA19BE68A300AC9238\n\t\t\t\t3A709AB219BE68BF00AC9238\n\t\t\t\t3A709AA819BE68A300AC9238\n\t\t\t\t3A709AA619BE68A300AC9238\n\t\t\t\t3A5C456819D9C16B00E86B7C\n\t\t\t\t3A709AB419BE68BF00AC9238\n\t\t\t\n\t\t\tisa\n\t\t\tPBXSourcesBuildPhase\n\t\t\trunOnlyForDeploymentPostprocessing\n\t\t\t0\n\t\t\n\t\t3A709A6C19BE67D800AC9238\n\t\t\n\t\t\tbuildActionMask\n\t\t\t2147483647\n\t\t\tfiles\n\t\t\t\n\t\t\t\t0E8BBA2F9ED2474C8534716D\n\t\t\t\n\t\t\tisa\n\t\t\tPBXFrameworksBuildPhase\n\t\t\trunOnlyForDeploymentPostprocessing\n\t\t\t0\n\t\t\n\t\t3A709A6D19BE67D800AC9238\n\t\t\n\t\t\tbuildActionMask\n\t\t\t2147483647\n\t\t\tfiles\n\t\t\t\n\t\t\t\t3A709A9219BE688000AC9238\n\t\t\t\t3A709A7619BE67D800AC9238\n\t\t\t\t3A03EACC19C4FF1D0095708C\n\t\t\t\t3A5C456719D9C16B00E86B7C\n\t\t\t\t3A709AA919BE68A300AC9238\n\t\t\t\t3A709AB319BE68BF00AC9238\n\t\t\t\t3A709AA719BE68A300AC9238\n\t\t\t\t3A709AB119BE68BF00AC9238\n\t\t\t\t3A709AA519BE68A300AC9238\n\t\t\t\n\t\t\tisa\n\t\t\tPBXHeadersBuildPhase\n\t\t\trunOnlyForDeploymentPostprocessing\n\t\t\t0\n\t\t\n\t\t3A709A6E19BE67D800AC9238\n\t\t\n\t\t\tbuildActionMask\n\t\t\t2147483647\n\t\t\tfiles\n\t\t\t\n\t\t\t\t3A709AB519BE68BF00AC9238\n\t\t\t\n\t\t\tisa\n\t\t\tPBXResourcesBuildPhase\n\t\t\trunOnlyForDeploymentPostprocessing\n\t\t\t0\n\t\t\n\t\t3A709A6F19BE67D800AC9238\n\t\t\n\t\t\tbuildConfigurationList\n\t\t\t3A709A8319BE67D800AC9238\n\t\t\tbuildPhases\n\t\t\t\n\t\t\t\t578CFE7974F84E93ACDBAB3E\n\t\t\t\t3A709A6B19BE67D800AC9238\n\t\t\t\t3A709A6C19BE67D800AC9238\n\t\t\t\t3A709A6D19BE67D800AC9238\n\t\t\t\t3A709A6E19BE67D800AC9238\n\t\t\t\tDBA0684AD4E9464DAC14CC9A\n\t\t\t\n\t\t\tbuildRules\n\t\t\t\n\t\t\tdependencies\n\t\t\t\n\t\t\tisa\n\t\t\tPBXNativeTarget\n\t\t\tname\n\t\t\tVENTouchLock\n\t\t\tproductName\n\t\t\tVENTouchLock\n\t\t\tproductReference\n\t\t\t3A709A7019BE67D800AC9238\n\t\t\tproductType\n\t\t\tcom.apple.product-type.framework\n\t\t\n\t\t3A709A7019BE67D800AC9238\n\t\t\n\t\t\texplicitFileType\n\t\t\twrapper.framework\n\t\t\tincludeInIndex\n\t\t\t0\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tpath\n\t\t\tVENTouchLock.framework\n\t\t\tsourceTree\n\t\t\tBUILT_PRODUCTS_DIR\n\t\t\n\t\t3A709A7119BE67D800AC9238\n\t\t\n\t\t\tchildren\n\t\t\t\n\t\t\t\t3A709A7019BE67D800AC9238\n\t\t\t\t3A709A7B19BE67D800AC9238\n\t\t\t\n\t\t\tisa\n\t\t\tPBXGroup\n\t\t\tname\n\t\t\tProducts\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A7219BE67D800AC9238\n\t\t\n\t\t\tchildren\n\t\t\t\n\t\t\t\t3A709A7519BE67D800AC9238\n\t\t\t\t3A709A8919BE686900AC9238\n\t\t\t\t3A5C456419D9C15F00E86B7C\n\t\t\t\t3A709A9419BE688E00AC9238\n\t\t\t\t3A709AAB19BE68B400AC9238\n\t\t\t\t3A709A8B19BE687100AC9238\n\t\t\t\t3A709A7319BE67D800AC9238\n\t\t\t\n\t\t\tisa\n\t\t\tPBXGroup\n\t\t\tpath\n\t\t\tVENTouchLock\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A7319BE67D800AC9238\n\t\t\n\t\t\tchildren\n\t\t\t\n\t\t\t\t3A709A7419BE67D800AC9238\n\t\t\t\n\t\t\tisa\n\t\t\tPBXGroup\n\t\t\tname\n\t\t\tSupporting Files\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A7419BE67D800AC9238\n\t\t\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\ttext.plist.xml\n\t\t\tpath\n\t\t\tInfo.plist\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A7519BE67D800AC9238\n\t\t\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.h\n\t\t\tpath\n\t\t\tVENTouchLock.h\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A7619BE67D800AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A7519BE67D800AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\tsettings\n\t\t\t\n\t\t\t\tATTRIBUTES\n\t\t\t\t\n\t\t\t\t\tPublic\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t3A709A7719BE67D800AC9238\n\t\t\n\t\t\tbuildActionMask\n\t\t\t2147483647\n\t\t\tfiles\n\t\t\t\n\t\t\t\t3A5C456919D9C1A500E86B7C\n\t\t\t\t3A03EACF19C4FF990095708C\n\t\t\t\t3A03EAD019C4FF990095708C\n\t\t\t\t3A03EAD119C4FF990095708C\n\t\t\t\t3A03EAD219C4FF990095708C\n\t\t\t\t3A03EAD319C4FF990095708C\n\t\t\t\t3A03EAD919C56C9E0095708C\n\t\t\t\t3A03EAD419C4FF990095708C\n\t\t\t\t3A03EAD619C4FF990095708C\n\t\t\t\t3A03EADB19C5E41A0095708C\n\t\t\t\t3A03EACE19C4FF440095708C\n\t\t\t\t3A03EACB19C4F72C0095708C\n\t\t\t\n\t\t\tisa\n\t\t\tPBXSourcesBuildPhase\n\t\t\trunOnlyForDeploymentPostprocessing\n\t\t\t0\n\t\t\n\t\t3A709A7819BE67D800AC9238\n\t\t\n\t\t\tbuildActionMask\n\t\t\t2147483647\n\t\t\tfiles\n\t\t\t\n\t\t\t\tB0AAA75C21C74F8DA9D13175\n\t\t\t\n\t\t\tisa\n\t\t\tPBXFrameworksBuildPhase\n\t\t\trunOnlyForDeploymentPostprocessing\n\t\t\t0\n\t\t\n\t\t3A709A7919BE67D800AC9238\n\t\t\n\t\t\tbuildActionMask\n\t\t\t2147483647\n\t\t\tfiles\n\t\t\t\n\t\t\tisa\n\t\t\tPBXResourcesBuildPhase\n\t\t\trunOnlyForDeploymentPostprocessing\n\t\t\t0\n\t\t\n\t\t3A709A7A19BE67D800AC9238\n\t\t\n\t\t\tbuildConfigurationList\n\t\t\t3A709A8619BE67D800AC9238\n\t\t\tbuildPhases\n\t\t\t\n\t\t\t\t006CE543BCFC47E7AB666869\n\t\t\t\t3A709A7719BE67D800AC9238\n\t\t\t\t3A709A7819BE67D800AC9238\n\t\t\t\t3A709A7919BE67D800AC9238\n\t\t\t\t8B971D45E9814AC3A4071695\n\t\t\t\n\t\t\tbuildRules\n\t\t\t\n\t\t\tdependencies\n\t\t\t\n\t\t\tisa\n\t\t\tPBXNativeTarget\n\t\t\tname\n\t\t\tVENTouchLockTests\n\t\t\tproductName\n\t\t\tVENTouchLockTests\n\t\t\tproductReference\n\t\t\t3A709A7B19BE67D800AC9238\n\t\t\tproductType\n\t\t\tcom.apple.product-type.bundle.unit-test\n\t\t\n\t\t3A709A7B19BE67D800AC9238\n\t\t\n\t\t\texplicitFileType\n\t\t\twrapper.cfbundle\n\t\t\tincludeInIndex\n\t\t\t0\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tpath\n\t\t\tVENTouchLockTests.xctest\n\t\t\tsourceTree\n\t\t\tBUILT_PRODUCTS_DIR\n\t\t\n\t\t3A709A7C19BE67D800AC9238\n\t\t\n\t\t\tchildren\n\t\t\t\n\t\t\t\t3A03EADA19C5E41A0095708C\n\t\t\t\t3A03EACA19C4F72C0095708C\n\t\t\t\t3A03EAD819C56C9E0095708C\n\t\t\t\t3A709A7D19BE67D800AC9238\n\t\t\t\n\t\t\tisa\n\t\t\tPBXGroup\n\t\t\tpath\n\t\t\tVENTouchLockTests\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A7D19BE67D800AC9238\n\t\t\n\t\t\tchildren\n\t\t\t\n\t\t\t\t3A709A7E19BE67D800AC9238\n\t\t\t\t3A03EAC919C4F4E40095708C\n\t\t\t\n\t\t\tisa\n\t\t\tPBXGroup\n\t\t\tname\n\t\t\tSupporting Files\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A7E19BE67D800AC9238\n\t\t\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\ttext.plist.xml\n\t\t\tpath\n\t\t\tInfo.plist\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A8119BE67D800AC9238\n\t\t\n\t\t\tbuildSettings\n\t\t\t\n\t\t\t\tALWAYS_SEARCH_USER_PATHS\n\t\t\t\tNO\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD\n\t\t\t\tgnu++0x\n\t\t\t\tCLANG_CXX_LIBRARY\n\t\t\t\tlibc++\n\t\t\t\tCLANG_ENABLE_MODULES\n\t\t\t\tYES\n\t\t\t\tCLANG_ENABLE_OBJC_ARC\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE\n\t\t\t\tYES_ERROR\n\t\t\t\tCLANG_WARN_EMPTY_BODY\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN_INT_CONVERSION\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS\n\t\t\t\tYES_ERROR\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH\n\t\t\t\tYES\n\t\t\t\tCODE_SIGN_IDENTITY[sdk=iphoneos*]\n\t\t\t\tiPhone Developer\n\t\t\t\tCOPY_PHASE_STRIP\n\t\t\t\tNO\n\t\t\t\tCURRENT_PROJECT_VERSION\n\t\t\t\t1\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND\n\t\t\t\tYES\n\t\t\t\tGCC_C_LANGUAGE_STANDARD\n\t\t\t\tgnu99\n\t\t\t\tGCC_DYNAMIC_NO_PIC\n\t\t\t\tNO\n\t\t\t\tGCC_OPTIMIZATION_LEVEL\n\t\t\t\t0\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS\n\t\t\t\t\n\t\t\t\t\tDEBUG=1\n\t\t\t\t\t$(inherited)\n\t\t\t\t\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN\n\t\t\t\tNO\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION\n\t\t\t\tYES\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE\n\t\t\t\tYES_ERROR\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR\n\t\t\t\tYES\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS\n\t\t\t\tYES_AGGRESSIVE\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION\n\t\t\t\tYES\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE\n\t\t\t\tYES\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET\n\t\t\t\t8.0\n\t\t\t\tMTL_ENABLE_DEBUG_INFO\n\t\t\t\tYES\n\t\t\t\tONLY_ACTIVE_ARCH\n\t\t\t\tYES\n\t\t\t\tSDKROOT\n\t\t\t\tiphoneos\n\t\t\t\tTARGETED_DEVICE_FAMILY\n\t\t\t\t1,2\n\t\t\t\tVERSIONING_SYSTEM\n\t\t\t\tapple-generic\n\t\t\t\tVERSION_INFO_PREFIX\n\t\t\t\t\n\t\t\t\n\t\t\tisa\n\t\t\tXCBuildConfiguration\n\t\t\tname\n\t\t\tDebug\n\t\t\n\t\t3A709A8219BE67D800AC9238\n\t\t\n\t\t\tbuildSettings\n\t\t\t\n\t\t\t\tALWAYS_SEARCH_USER_PATHS\n\t\t\t\tNO\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD\n\t\t\t\tgnu++0x\n\t\t\t\tCLANG_CXX_LIBRARY\n\t\t\t\tlibc++\n\t\t\t\tCLANG_ENABLE_MODULES\n\t\t\t\tYES\n\t\t\t\tCLANG_ENABLE_OBJC_ARC\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE\n\t\t\t\tYES_ERROR\n\t\t\t\tCLANG_WARN_EMPTY_BODY\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN_INT_CONVERSION\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS\n\t\t\t\tYES_ERROR\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE\n\t\t\t\tYES\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH\n\t\t\t\tYES\n\t\t\t\tCODE_SIGN_IDENTITY[sdk=iphoneos*]\n\t\t\t\tiPhone Developer\n\t\t\t\tCOPY_PHASE_STRIP\n\t\t\t\tYES\n\t\t\t\tCURRENT_PROJECT_VERSION\n\t\t\t\t1\n\t\t\t\tENABLE_NS_ASSERTIONS\n\t\t\t\tNO\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND\n\t\t\t\tYES\n\t\t\t\tGCC_C_LANGUAGE_STANDARD\n\t\t\t\tgnu99\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION\n\t\t\t\tYES\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE\n\t\t\t\tYES_ERROR\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR\n\t\t\t\tYES\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS\n\t\t\t\tYES_AGGRESSIVE\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION\n\t\t\t\tYES\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE\n\t\t\t\tYES\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET\n\t\t\t\t8.0\n\t\t\t\tMTL_ENABLE_DEBUG_INFO\n\t\t\t\tNO\n\t\t\t\tSDKROOT\n\t\t\t\tiphoneos\n\t\t\t\tTARGETED_DEVICE_FAMILY\n\t\t\t\t1,2\n\t\t\t\tVALIDATE_PRODUCT\n\t\t\t\tYES\n\t\t\t\tVERSIONING_SYSTEM\n\t\t\t\tapple-generic\n\t\t\t\tVERSION_INFO_PREFIX\n\t\t\t\t\n\t\t\t\n\t\t\tisa\n\t\t\tXCBuildConfiguration\n\t\t\tname\n\t\t\tRelease\n\t\t\n\t\t3A709A8319BE67D800AC9238\n\t\t\n\t\t\tbuildConfigurations\n\t\t\t\n\t\t\t\t3A709A8419BE67D800AC9238\n\t\t\t\t3A709A8519BE67D800AC9238\n\t\t\t\n\t\t\tdefaultConfigurationIsVisible\n\t\t\t0\n\t\t\tdefaultConfigurationName\n\t\t\tRelease\n\t\t\tisa\n\t\t\tXCConfigurationList\n\t\t\n\t\t3A709A8419BE67D800AC9238\n\t\t\n\t\t\tbaseConfigurationReference\n\t\t\tEF1F7E543F036C4EB61FDC73\n\t\t\tbuildSettings\n\t\t\t\n\t\t\t\tDEFINES_MODULE\n\t\t\t\tYES\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION\n\t\t\t\t1\n\t\t\t\tDYLIB_CURRENT_VERSION\n\t\t\t\t1\n\t\t\t\tDYLIB_INSTALL_NAME_BASE\n\t\t\t\t@rpath\n\t\t\t\tINFOPLIST_FILE\n\t\t\t\tVENTouchLock/Info.plist\n\t\t\t\tINSTALL_PATH\n\t\t\t\t$(LOCAL_LIBRARY_DIR)/Frameworks\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS\n\t\t\t\t$(inherited) @executable_path/Frameworks @loader_path/Frameworks\n\t\t\t\tPRODUCT_NAME\n\t\t\t\t$(TARGET_NAME)\n\t\t\t\tSKIP_INSTALL\n\t\t\t\tYES\n\t\t\t\n\t\t\tisa\n\t\t\tXCBuildConfiguration\n\t\t\tname\n\t\t\tDebug\n\t\t\n\t\t3A709A8519BE67D800AC9238\n\t\t\n\t\t\tbaseConfigurationReference\n\t\t\t7214AFB127B057149904A934\n\t\t\tbuildSettings\n\t\t\t\n\t\t\t\tDEFINES_MODULE\n\t\t\t\tYES\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION\n\t\t\t\t1\n\t\t\t\tDYLIB_CURRENT_VERSION\n\t\t\t\t1\n\t\t\t\tDYLIB_INSTALL_NAME_BASE\n\t\t\t\t@rpath\n\t\t\t\tINFOPLIST_FILE\n\t\t\t\tVENTouchLock/Info.plist\n\t\t\t\tINSTALL_PATH\n\t\t\t\t$(LOCAL_LIBRARY_DIR)/Frameworks\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS\n\t\t\t\t$(inherited) @executable_path/Frameworks @loader_path/Frameworks\n\t\t\t\tPRODUCT_NAME\n\t\t\t\t$(TARGET_NAME)\n\t\t\t\tSKIP_INSTALL\n\t\t\t\tYES\n\t\t\t\n\t\t\tisa\n\t\t\tXCBuildConfiguration\n\t\t\tname\n\t\t\tRelease\n\t\t\n\t\t3A709A8619BE67D800AC9238\n\t\t\n\t\t\tbuildConfigurations\n\t\t\t\n\t\t\t\t3A709A8719BE67D800AC9238\n\t\t\t\t3A709A8819BE67D800AC9238\n\t\t\t\n\t\t\tdefaultConfigurationIsVisible\n\t\t\t0\n\t\t\tdefaultConfigurationName\n\t\t\tRelease\n\t\t\tisa\n\t\t\tXCConfigurationList\n\t\t\n\t\t3A709A8719BE67D800AC9238\n\t\t\n\t\t\tbaseConfigurationReference\n\t\t\t3A4FE4165D8CB1C8FB147395\n\t\t\tbuildSettings\n\t\t\t\n\t\t\t\tFRAMEWORK_SEARCH_PATHS\n\t\t\t\t\n\t\t\t\t\t$(SDKROOT)/Developer/Library/Frameworks\n\t\t\t\t\t$(inherited)\n\t\t\t\t\n\t\t\t\tGCC_PREFIX_HEADER\n\t\t\t\tVENTouchLockTests/VENTouchLockTests-Prefix.pch\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS\n\t\t\t\t\n\t\t\t\t\tDEBUG=1\n\t\t\t\t\t$(inherited)\n\t\t\t\t\n\t\t\t\tINFOPLIST_FILE\n\t\t\t\tVENTouchLockTests/Info.plist\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS\n\t\t\t\t$(inherited) @executable_path/Frameworks @loader_path/Frameworks\n\t\t\t\tPRODUCT_NAME\n\t\t\t\t$(TARGET_NAME)\n\t\t\t\n\t\t\tisa\n\t\t\tXCBuildConfiguration\n\t\t\tname\n\t\t\tDebug\n\t\t\n\t\t3A709A8819BE67D800AC9238\n\t\t\n\t\t\tbaseConfigurationReference\n\t\t\tACF4DE98AD7E614B0C1615BF\n\t\t\tbuildSettings\n\t\t\t\n\t\t\t\tFRAMEWORK_SEARCH_PATHS\n\t\t\t\t\n\t\t\t\t\t$(SDKROOT)/Developer/Library/Frameworks\n\t\t\t\t\t$(inherited)\n\t\t\t\t\n\t\t\t\tGCC_PREFIX_HEADER\n\t\t\t\tVENTouchLockTests/VENTouchLockTests-Prefix.pch\n\t\t\t\tINFOPLIST_FILE\n\t\t\t\tVENTouchLockTests/Info.plist\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS\n\t\t\t\t$(inherited) @executable_path/Frameworks @loader_path/Frameworks\n\t\t\t\tPRODUCT_NAME\n\t\t\t\t$(TARGET_NAME)\n\t\t\t\n\t\t\tisa\n\t\t\tXCBuildConfiguration\n\t\t\tname\n\t\t\tRelease\n\t\t\n\t\t3A709A8919BE686900AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.objc\n\t\t\tpath\n\t\t\tVENTouchLock.m\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A8A19BE686900AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A8919BE686900AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709A8B19BE687100AC9238\n\t\t\n\t\t\tchildren\n\t\t\t\n\t\t\t\t3A709A8E19BE688000AC9238\n\t\t\t\t3A709A8F19BE688000AC9238\n\t\t\t\n\t\t\tisa\n\t\t\tPBXGroup\n\t\t\tname\n\t\t\tCategories\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A8E19BE688000AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.h\n\t\t\tname\n\t\t\tUIViewController+VENTouchLock.h\n\t\t\tpath\n\t\t\tCategories/UIViewController+VENTouchLock.h\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A8F19BE688000AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.objc\n\t\t\tname\n\t\t\tUIViewController+VENTouchLock.m\n\t\t\tpath\n\t\t\tCategories/UIViewController+VENTouchLock.m\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A9219BE688000AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A8E19BE688000AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709A9319BE688000AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A8F19BE688000AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709A9419BE688E00AC9238\n\t\t\n\t\t\tchildren\n\t\t\t\n\t\t\t\t3A709A9819BE68A300AC9238\n\t\t\t\t3A709A9919BE68A300AC9238\n\t\t\t\t3A709A9A19BE68A300AC9238\n\t\t\t\t3A709A9B19BE68A300AC9238\n\t\t\t\t3A709A9C19BE68A300AC9238\n\t\t\t\t3A709A9D19BE68A300AC9238\n\t\t\t\t3A709A9E19BE68A300AC9238\n\t\t\t\t3A709A9F19BE68A300AC9238\n\t\t\t\n\t\t\tisa\n\t\t\tPBXGroup\n\t\t\tname\n\t\t\tControllers\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A9819BE68A300AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.h\n\t\t\tname\n\t\t\tVENTouchLockEnterPasscodeViewController.h\n\t\t\tpath\n\t\t\tControllers/VENTouchLockEnterPasscodeViewController.h\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A9919BE68A300AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.objc\n\t\t\tname\n\t\t\tVENTouchLockEnterPasscodeViewController.m\n\t\t\tpath\n\t\t\tControllers/VENTouchLockEnterPasscodeViewController.m\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A9A19BE68A300AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.h\n\t\t\tname\n\t\t\tVENTouchLockPasscodeViewController.h\n\t\t\tpath\n\t\t\tControllers/VENTouchLockPasscodeViewController.h\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A9B19BE68A300AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.objc\n\t\t\tname\n\t\t\tVENTouchLockPasscodeViewController.m\n\t\t\tpath\n\t\t\tControllers/VENTouchLockPasscodeViewController.m\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A9C19BE68A300AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.h\n\t\t\tname\n\t\t\tVENTouchLockCreatePasscodeViewController.h\n\t\t\tpath\n\t\t\tControllers/VENTouchLockCreatePasscodeViewController.h\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A9D19BE68A300AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.objc\n\t\t\tname\n\t\t\tVENTouchLockCreatePasscodeViewController.m\n\t\t\tpath\n\t\t\tControllers/VENTouchLockCreatePasscodeViewController.m\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A9E19BE68A300AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.h\n\t\t\tname\n\t\t\tVENTouchLockSplashViewController.h\n\t\t\tpath\n\t\t\tControllers/VENTouchLockSplashViewController.h\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709A9F19BE68A300AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.objc\n\t\t\tname\n\t\t\tVENTouchLockSplashViewController.m\n\t\t\tpath\n\t\t\tControllers/VENTouchLockSplashViewController.m\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709AA419BE68A300AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A9919BE68A300AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709AA519BE68A300AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A9A19BE68A300AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709AA619BE68A300AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A9B19BE68A300AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709AA719BE68A300AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A9C19BE68A300AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709AA819BE68A300AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A9D19BE68A300AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709AA919BE68A300AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A9E19BE68A300AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709AAA19BE68A300AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709A9F19BE68A300AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709AAB19BE68B400AC9238\n\t\t\n\t\t\tchildren\n\t\t\t\n\t\t\t\t3A709AAC19BE68BF00AC9238\n\t\t\t\t3A709AAD19BE68BF00AC9238\n\t\t\t\t3A709AAE19BE68BF00AC9238\n\t\t\t\t3A709AAF19BE68BF00AC9238\n\t\t\t\t3A709AB019BE68BF00AC9238\n\t\t\t\n\t\t\tisa\n\t\t\tPBXGroup\n\t\t\tname\n\t\t\tViews\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709AAC19BE68BF00AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.h\n\t\t\tname\n\t\t\tVENTouchLockPasscodeCharacterView.h\n\t\t\tpath\n\t\t\tViews/VENTouchLockPasscodeCharacterView.h\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709AAD19BE68BF00AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.objc\n\t\t\tname\n\t\t\tVENTouchLockPasscodeCharacterView.m\n\t\t\tpath\n\t\t\tViews/VENTouchLockPasscodeCharacterView.m\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709AAE19BE68BF00AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.h\n\t\t\tname\n\t\t\tVENTouchLockPasscodeView.h\n\t\t\tpath\n\t\t\tViews/VENTouchLockPasscodeView.h\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709AAF19BE68BF00AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tsourcecode.c.objc\n\t\t\tname\n\t\t\tVENTouchLockPasscodeView.m\n\t\t\tpath\n\t\t\tViews/VENTouchLockPasscodeView.m\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709AB019BE68BF00AC9238\n\t\t\n\t\t\tfileEncoding\n\t\t\t4\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\tfile.xib\n\t\t\tname\n\t\t\tVENTouchLockPasscodeView.xib\n\t\t\tpath\n\t\t\tViews/VENTouchLockPasscodeView.xib\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t3A709AB119BE68BF00AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709AAC19BE68BF00AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709AB219BE68BF00AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709AAD19BE68BF00AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709AB319BE68BF00AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709AAE19BE68BF00AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709AB419BE68BF00AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709AAF19BE68BF00AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3A709AB519BE68BF00AC9238\n\t\t\n\t\t\tfileRef\n\t\t\t3A709AB019BE68BF00AC9238\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\t3D5E0250C8A240A2922F55F7\n\t\t\n\t\t\tchildren\n\t\t\t\n\t\t\t\t8A8322082DAA4E4E8840A4D1\n\t\t\t\t4BBF12C3327B45B5803FC9C5\n\t\t\t\t8C50D98031904B55BA82D2E5\n\t\t\t\n\t\t\tisa\n\t\t\tPBXGroup\n\t\t\tname\n\t\t\tFrameworks\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t4BBF12C3327B45B5803FC9C5\n\t\t\n\t\t\texplicitFileType\n\t\t\tarchive.ar\n\t\t\tincludeInIndex\n\t\t\t0\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tpath\n\t\t\tlibPods-VENTouchLockTests.a\n\t\t\tsourceTree\n\t\t\tBUILT_PRODUCTS_DIR\n\t\t\n\t\t578CFE7974F84E93ACDBAB3E\n\t\t\n\t\t\tbuildActionMask\n\t\t\t2147483647\n\t\t\tfiles\n\t\t\t\n\t\t\tinputPaths\n\t\t\t\n\t\t\tisa\n\t\t\tPBXShellScriptBuildPhase\n\t\t\tname\n\t\t\tCheck Pods Manifest.lock\n\t\t\toutputPaths\n\t\t\t\n\t\t\trunOnlyForDeploymentPostprocessing\n\t\t\t0\n\t\t\tshellPath\n\t\t\t/bin/sh\n\t\t\tshellScript\n\t\t\tdiff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n\n\t\t\tshowEnvVarsInLog\n\t\t\t0\n\t\t\n\t\t7214AFB127B057149904A934\n\t\t\n\t\t\tincludeInIndex\n\t\t\t1\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\ttext.xcconfig\n\t\t\tname\n\t\t\tPods.release.xcconfig\n\t\t\tpath\n\t\t\tPods/Target Support Files/Pods/Pods.release.xcconfig\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\t8A8322082DAA4E4E8840A4D1\n\t\t\n\t\t\texplicitFileType\n\t\t\tarchive.ar\n\t\t\tincludeInIndex\n\t\t\t0\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tpath\n\t\t\tlibPods-VENTouchLock.a\n\t\t\tsourceTree\n\t\t\tBUILT_PRODUCTS_DIR\n\t\t\n\t\t8B971D45E9814AC3A4071695\n\t\t\n\t\t\tbuildActionMask\n\t\t\t2147483647\n\t\t\tfiles\n\t\t\t\n\t\t\tinputPaths\n\t\t\t\n\t\t\tisa\n\t\t\tPBXShellScriptBuildPhase\n\t\t\tname\n\t\t\tCopy Pods Resources\n\t\t\toutputPaths\n\t\t\t\n\t\t\trunOnlyForDeploymentPostprocessing\n\t\t\t0\n\t\t\tshellPath\n\t\t\t/bin/sh\n\t\t\tshellScript\n\t\t\t\"${SRCROOT}/Pods/Target Support Files/Pods-VENTouchLockTests/Pods-VENTouchLockTests-resources.sh\"\n\n\t\t\tshowEnvVarsInLog\n\t\t\t0\n\t\t\n\t\t8C50D98031904B55BA82D2E5\n\t\t\n\t\t\texplicitFileType\n\t\t\tarchive.ar\n\t\t\tincludeInIndex\n\t\t\t0\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tpath\n\t\t\tlibPods.a\n\t\t\tsourceTree\n\t\t\tBUILT_PRODUCTS_DIR\n\t\t\n\t\tACF4DE98AD7E614B0C1615BF\n\t\t\n\t\t\tincludeInIndex\n\t\t\t1\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\ttext.xcconfig\n\t\t\tname\n\t\t\tPods-VENTouchLockTests.release.xcconfig\n\t\t\tpath\n\t\t\tPods/Target Support Files/Pods-VENTouchLockTests/Pods-VENTouchLockTests.release.xcconfig\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\tAE7750A29BBEFCCFD46D3B6D\n\t\t\n\t\t\tchildren\n\t\t\t\n\t\t\t\tEF1F7E543F036C4EB61FDC73\n\t\t\t\t7214AFB127B057149904A934\n\t\t\t\t3A4FE4165D8CB1C8FB147395\n\t\t\t\tACF4DE98AD7E614B0C1615BF\n\t\t\t\n\t\t\tisa\n\t\t\tPBXGroup\n\t\t\tname\n\t\t\tPods\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\tB0AAA75C21C74F8DA9D13175\n\t\t\n\t\t\tfileRef\n\t\t\t4BBF12C3327B45B5803FC9C5\n\t\t\tisa\n\t\t\tPBXBuildFile\n\t\t\n\t\tDBA0684AD4E9464DAC14CC9A\n\t\t\n\t\t\tbuildActionMask\n\t\t\t2147483647\n\t\t\tfiles\n\t\t\t\n\t\t\tinputPaths\n\t\t\t\n\t\t\tisa\n\t\t\tPBXShellScriptBuildPhase\n\t\t\tname\n\t\t\tCopy Pods Resources\n\t\t\toutputPaths\n\t\t\t\n\t\t\trunOnlyForDeploymentPostprocessing\n\t\t\t0\n\t\t\tshellPath\n\t\t\t/bin/sh\n\t\t\tshellScript\n\t\t\t\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n\n\t\t\tshowEnvVarsInLog\n\t\t\t0\n\t\t\n\t\tEF1F7E543F036C4EB61FDC73\n\t\t\n\t\t\tincludeInIndex\n\t\t\t1\n\t\t\tisa\n\t\t\tPBXFileReference\n\t\t\tlastKnownFileType\n\t\t\ttext.xcconfig\n\t\t\tname\n\t\t\tPods.debug.xcconfig\n\t\t\tpath\n\t\t\tPods/Target Support Files/Pods/Pods.debug.xcconfig\n\t\t\tsourceTree\n\t\t\t<group>\n\t\t\n\t\n\trootObject\n\t3A709A6719BE67D800AC9238\n\n\n"} +{"text": "using System;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace MovieAngularJSApp.Models\n{\n public class Movie\n {\n public int Id { get; set; }\n\n\t\t[Required(ErrorMessage=\"Movie Title is Required\")]\n\t\t[MinLength(3, ErrorMessage=\"Movie Title must be at least 3 characters\")]\n\t\tpublic string Title { get; set; }\n\n\t\t[Required(ErrorMessage = \"Movie Director is Required.\")]\n public string Director { get; set; }\n\n\t\t[Range(0, 100, ErrorMessage =\"Ticket price must be between 0 and 100 dollars.\")]\n\t\tpublic decimal TicketPrice { get; set; }\n\n\t\t[Required(ErrorMessage=\"Movie Release Date is required\")]\n\t\tpublic DateTime ReleaseDate { get; set; }\n\t}\n}"} +{"text": "\n\nPython: module telemetry.page.page_test_runner\n\n\n\n\n
 
\n 
telemetry.page.page_test_runner
index
telemetry/page/page_test_runner.py
\n

# Copyright (c) 2012 The Chromium Authors. All rights reserved.
\n# Use of this source code is governed by a BSD-style license that can be
\n# found in the LICENSE file.

\n

\n\n\n\n \n\n
 
\nModules
       
telemetry.core.browser_options
\ntelemetry.core.discover
\nos
\n
telemetry.page.page_runner
\ntelemetry.page.page_set
\ntelemetry.page.page_test
\n
telemetry.core.profile_types
\nsys
\ntelemetry.test
\n

\n\n\n\n \n\n
 
\nClasses
       
\n
__builtin__.object\n
\n
\n
PageTestRunner\n
\n
\n
\n

\n\n\n\n \n\n
 
\nclass PageTestRunner(__builtin__.object)
    Methods defined here:
\n
FindTestConstructors(self, base_dir)
\n\n
FindTestName(self, test_constructors, args)
Find the test name in an arbitrary argument list.
\n 
\nWe can't use the optparse parser, because the test may add its own
\ncommand-line options. If the user passed in any of those, the
\noptparse parsing will fail.
\n 
\nReturns:
\n  test_name or None
\n\n
GetModernizedTestName(self, arg)
Sometimes tests change names but buildbots keep calling the old name.
\n 
\nIf arg matches an old test name, return the new test name instead.
\nOtherwise, return the arg.
\n\n
GetPageSet(self, test, page_set_filenames)
\n\n
ParseCommandLine(self, args, base_dir, page_set_filenames)
\n\n
PrintParseError(self, message)
\n\n
Run(self, base_dir, page_set_filenames)
\n\n
__init__(self)
\n\n
\nData descriptors defined here:
\n
__dict__
\n
dictionary for instance variables (if defined)
\n
\n
__weakref__
\n
list of weak references to the object (if defined)
\n
\n
test_class
\n
\n
test_class_name
\n
\n

\n\n\n\n \n\n
 
\nFunctions
       
Main(base_dir, page_set_filenames)
Turns a PageTest into a command-line program.
\n 
\nArgs:
\n  base_dir: Path to directory containing tests and ProfileCreators.
\n
\n"} +{"text": "'''Pexpect is a Python module for spawning child applications and controlling\nthem automatically. Pexpect can be used for automating interactive applications\nsuch as ssh, ftp, passwd, telnet, etc. It can be used to automate setup\nscripts for duplicating software package installations on different servers. It\ncan be used for automated software testing. Pexpect is in the spirit of Don\nLibes' Expect, but Pexpect is pure Python. Other Expect-like modules for Python\nrequire TCL and Expect or require C extensions to be compiled. Pexpect does not\nuse C, Expect, or TCL extensions. It should work on any platform that supports\nthe standard Python pty module. The Pexpect interface focuses on ease of use so\nthat simple tasks are easy.\n\nThere are two main interfaces to the Pexpect system; these are the function,\nrun() and the class, spawn. The spawn class is more powerful. The run()\nfunction is simpler than spawn, and is good for quickly calling program. When\nyou call the run() function it executes a given program and then returns the\noutput. This is a handy replacement for os.system().\n\nFor example::\n\n pexpect.run('ls -la')\n\nThe spawn class is the more powerful interface to the Pexpect system. You can\nuse this to spawn a child program then interact with it by sending input and\nexpecting responses (waiting for patterns in the child's output).\n\nFor example::\n\n child = pexpect.spawn('scp foo user@example.com:.')\n child.expect('Password:')\n child.sendline(mypassword)\n\nThis works even for commands that ask for passwords or other input outside of\nthe normal stdio streams. For example, ssh reads input directly from the TTY\ndevice which bypasses stdin.\n\nCredits: Noah Spurrier, Richard Holden, Marco Molteni, Kimberley Burchett,\nRobert Stone, Hartmut Goebel, Chad Schroeder, Erick Tryzelaar, Dave Kirby, Ids\nvander Molen, George Todd, Noel Taylor, Nicolas D. Cesar, Alexander Gattin,\nJacques-Etienne Baudoux, Geoffrey Marshall, Francisco Lourenco, Glen Mabey,\nKarthik Gurusamy, Fernando Perez, Corey Minyard, Jon Cohen, Guillaume\nChazarain, Andrew Ryan, Nick Craig-Wood, Andrew Stone, Jorgen Grahn, John\nSpiegel, Jan Grant, and Shane Kerr. Let me know if I forgot anyone.\n\nPexpect is free, open source, and all that good stuff.\nhttp://pexpect.sourceforge.net/\n\nPEXPECT LICENSE\n\n This license is approved by the OSI and FSF as GPL-compatible.\n http://opensource.org/licenses/isc-license.txt\n\n Copyright (c) 2012, Noah Spurrier \n PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY\n PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE\n COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES.\n 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\nimport sys\nPY3 = (sys.version_info[0] >= 3)\n\nfrom .exceptions import ExceptionPexpect, EOF, TIMEOUT\nfrom .utils import split_command_line, which, is_executable_file\nfrom .expect import Expecter, searcher_re, searcher_string\n\nif sys.platform != 'win32':\n # On Unix, these are available at the top level for backwards compatibility\n from .pty_spawn import spawn, spawnu\n from .run import run, runu\n\n__version__ = '4.8.0'\n__revision__ = ''\n__all__ = ['ExceptionPexpect', 'EOF', 'TIMEOUT', 'spawn', 'spawnu', 'run', 'runu',\n 'which', 'split_command_line', '__version__', '__revision__']\n\n\n\n# vim: set shiftround expandtab tabstop=4 shiftwidth=4 ft=python autoindent :\n"} +{"text": "#!@TOOLS_PYTHON@\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\n# as 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., 675 Mass Ave, Cambridge, MA 02139, USA.\n#\n\n#\n# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.\n# Copyright 2008, 2012 Richard Lowe\n# Copyright 2019 Garrett D'Amore \n# Copyright (c) 2015, 2016 by Delphix. All rights reserved.\n# Copyright 2016 Nexenta Systems, Inc.\n# Copyright (c) 2019, Joyent, Inc.\n# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.\n#\n\nfrom __future__ import print_function\n\nimport getopt\nimport io\nimport os\nimport re\nimport subprocess\nimport sys\nimport tempfile\n\nif sys.version_info[0] < 3:\n from cStringIO import StringIO\nelse:\n from io import StringIO\n\n#\n# Adjust the load path based on our location and the version of python into\n# which it is being loaded. This assumes the normal onbld directory\n# structure, where we are in bin/ and the modules are in\n# lib/python(version)?/onbld/Scm/. If that changes so too must this.\n#\nsys.path.insert(1, os.path.join(os.path.dirname(__file__), \"..\", \"lib\",\n \"python%d.%d\" % sys.version_info[:2]))\n\n#\n# Add the relative path to usr/src/tools to the load path, such that when run\n# from the source tree we use the modules also within the source tree.\n#\nsys.path.insert(2, os.path.join(os.path.dirname(__file__), \"..\"))\n\nfrom onbld.Scm import Ignore\nfrom onbld.Checks import Comments, Copyright, CStyle, HdrChk, WsCheck\nfrom onbld.Checks import JStyle, Keywords, ManLint, Mapfile, SpellCheck\n\nclass GitError(Exception):\n pass\n\ndef git(command):\n \"\"\"Run a command and return a stream containing its stdout (and write its\n stderr to its stdout)\"\"\"\n\n if type(command) != list:\n command = command.split()\n\n command = [\"git\"] + command\n\n try:\n tmpfile = tempfile.TemporaryFile(prefix=\"git-nits\", mode=\"w+b\")\n except EnvironmentError as e:\n raise GitError(\"Could not create temporary file: %s\\n\" % e)\n\n try:\n p = subprocess.Popen(command,\n stdout=tmpfile,\n stderr=subprocess.PIPE)\n except OSError as e:\n raise GitError(\"could not execute %s: %s\\n\" % (command, e))\n\n err = p.wait()\n if err != 0:\n raise GitError(p.stderr.read())\n\n tmpfile.seek(0)\n lines = []\n for l in tmpfile:\n lines.append(l.decode('utf-8', 'replace'))\n return lines\n\ndef git_root():\n \"\"\"Return the root of the current git workspace\"\"\"\n\n p = git('rev-parse --git-dir')\n dir = p[0]\n\n return os.path.abspath(os.path.join(dir, os.path.pardir))\n\ndef git_branch():\n \"\"\"Return the current git branch\"\"\"\n\n p = git('branch')\n\n for elt in p:\n if elt[0] == '*':\n if elt.endswith('(no branch)'):\n return None\n return elt.split()[1]\n\ndef git_parent_branch(branch):\n \"\"\"Return the parent of the current git branch.\n\n If this branch tracks a remote branch, return the remote branch which is\n tracked. If not, default to origin/master.\"\"\"\n\n if not branch:\n return None\n\n p = git([\"for-each-ref\", \"--format=%(refname:short) %(upstream:short)\",\n \"refs/heads/\"])\n\n if not p:\n sys.stderr.write(\"Failed finding git parent branch\\n\")\n sys.exit(1)\n\n for line in p:\n # Git 1.7 will leave a ' ' trailing any non-tracking branch\n if ' ' in line and not line.endswith(' \\n'):\n local, remote = line.split()\n if local == branch:\n return remote\n return 'origin/master'\n\ndef git_comments(parent):\n \"\"\"Return a list of any checkin comments on this git branch\"\"\"\n\n p = git('log --pretty=tformat:%%B:SEP: %s..' % parent)\n\n if not p:\n sys.stderr.write(\"No outgoing changesets found - missing -p option?\\n\");\n sys.exit(1)\n\n return [x.strip() for x in p if x != ':SEP:\\n']\n\ndef git_file_list(parent, paths=None):\n \"\"\"Return the set of files which have ever changed on this branch.\n\n NB: This includes files which no longer exist, or no longer actually\n differ.\"\"\"\n\n p = git(\"log --name-only --pretty=format: %s.. %s\" %\n (parent, ' '.join(paths)))\n\n if not p:\n sys.stderr.write(\"Failed building file-list from git\\n\")\n sys.exit(1)\n\n ret = set()\n for fname in p:\n if fname and not fname.isspace() and fname not in ret:\n ret.add(fname.strip())\n\n return ret\n\ndef not_check(root, cmd):\n \"\"\"Return a function which returns True if a file given as an argument\n should be excluded from the check named by 'cmd'\"\"\"\n\n ignorefiles = list(filter(os.path.exists,\n [os.path.join(root, \".git\", \"%s.NOT\" % cmd),\n os.path.join(root, \"exception_lists\", cmd)]))\n return Ignore.ignore(root, ignorefiles)\n\ndef gen_files(root, parent, paths, exclude, filter=None):\n \"\"\"Return a function producing file names, relative to the current\n directory, of any file changed on this branch (limited to 'paths' if\n requested), and excluding files for which exclude returns a true value \"\"\"\n\n if filter is None:\n filter = lambda x: os.path.isfile(x)\n\n # Taken entirely from Python 2.6's os.path.relpath which we would use if we\n # could.\n def relpath(path, here):\n c = os.path.abspath(os.path.join(root, path)).split(os.path.sep)\n s = os.path.abspath(here).split(os.path.sep)\n l = len(os.path.commonprefix((s, c)))\n return os.path.join(*[os.path.pardir] * (len(s)-l) + c[l:])\n\n def ret(select=None):\n if not select:\n select = lambda x: True\n\n for abspath in git_file_list(parent, paths):\n path = relpath(abspath, '.')\n try:\n res = git(\"diff %s HEAD %s\" % (parent, path))\n except GitError as e:\n # This ignores all the errors that can be thrown. Usually, this\n # means that git returned non-zero because the file doesn't\n # exist, but it could also fail if git can't create a new file\n # or it can't be executed. Such errors are 1) unlikely, and 2)\n # will be caught by other invocations of git().\n continue\n empty = not res\n if (filter(path) and not empty and\n select(path) and not exclude(abspath)):\n yield path\n return ret\n\ndef gen_links(root, parent, paths, exclude):\n \"\"\"Return a function producing symbolic link names, relative to the current\n directory, of any file changed on this branch (limited to 'paths' if\n requested), and excluding files for which exclude returns a true value \"\"\"\n\n return gen_files(root, parent, paths, exclude, lambda x: os.path.islink(x))\n\ndef comchk(root, parent, flist, output):\n output.write(\"Comments:\\n\")\n\n return Comments.comchk(git_comments(parent), check_db=True,\n output=output)\n\n\ndef mapfilechk(root, parent, flist, output):\n ret = 0\n\n # We are interested in examining any file that has the following\n # in its final path segment:\n # - Contains the word 'mapfile'\n # - Begins with 'map.'\n # - Ends with '.map'\n # We don't want to match unless these things occur in final path segment\n # because directory names with these strings don't indicate a mapfile.\n # We also ignore files with suffixes that tell us that the files\n # are not mapfiles.\n MapfileRE = re.compile(r'.*((mapfile[^/]*)|(/map\\.+[^/]*)|(\\.map))$',\n re.IGNORECASE)\n NotMapSuffixRE = re.compile(r'.*\\.[ch]$', re.IGNORECASE)\n\n output.write(\"Mapfile comments:\\n\")\n\n for f in flist(lambda x: MapfileRE.match(x) and not\n NotMapSuffixRE.match(x)):\n with io.open(f, encoding='utf-8', errors='replace') as fh:\n ret |= Mapfile.mapfilechk(fh, output=output)\n return ret\n\ndef copyright(root, parent, flist, output):\n ret = 0\n output.write(\"Copyrights:\\n\")\n for f in flist():\n with io.open(f, encoding='utf-8', errors='replace') as fh:\n ret |= Copyright.copyright(fh, output=output)\n return ret\n\ndef hdrchk(root, parent, flist, output):\n ret = 0\n output.write(\"Header format:\\n\")\n for f in flist(lambda x: x.endswith('.h')):\n with io.open(f, encoding='utf-8', errors='replace') as fh:\n ret |= HdrChk.hdrchk(fh, lenient=True, output=output)\n return ret\n\ndef cstyle(root, parent, flist, output):\n ret = 0\n output.write(\"C style:\\n\")\n for f in flist(lambda x: x.endswith('.c') or x.endswith('.h')):\n with io.open(f, mode='rb') as fh:\n ret |= CStyle.cstyle(fh, output=output, picky=True,\n check_posix_types=True,\n check_continuation=True)\n return ret\n\ndef jstyle(root, parent, flist, output):\n ret = 0\n output.write(\"Java style:\\n\")\n for f in flist(lambda x: x.endswith('.java')):\n with io.open(f, mode='rb') as fh:\n ret |= JStyle.jstyle(fh, output=output, picky=True)\n return ret\n\ndef manlint(root, parent, flist, output):\n ret = 0\n output.write(\"Man page format/spelling:\\n\")\n ManfileRE = re.compile(r'.*\\.[0-9][a-z]*$', re.IGNORECASE)\n for f in flist(lambda x: ManfileRE.match(x)):\n with io.open(f, mode='rb') as fh:\n ret |= ManLint.manlint(fh, output=output, picky=True)\n ret |= SpellCheck.spellcheck(fh, output=output)\n return ret\n\ndef keywords(root, parent, flist, output):\n ret = 0\n output.write(\"SCCS Keywords:\\n\")\n for f in flist():\n with io.open(f, encoding='utf-8', errors='replace') as fh:\n ret |= Keywords.keywords(fh, output=output)\n return ret\n\ndef wscheck(root, parent, flist, output):\n ret = 0\n output.write(\"white space nits:\\n\")\n for f in flist():\n with io.open(f, encoding='utf-8', errors='replace') as fh:\n ret |= WsCheck.wscheck(fh, output=output)\n return ret\n\ndef symlinks(root, parent, flist, output):\n ret = 0\n output.write(\"Symbolic links:\\n\")\n for f in flist():\n output.write(\" \"+f+\"\\n\")\n ret |= 1\n return ret\n\ndef iswinreserved(name):\n reserved = [\n 'con', 'prn', 'aux', 'nul',\n 'com1', 'com2', 'com3', 'com4', 'com5',\n 'com6', 'com7', 'com8', 'com9', 'com0',\n 'lpt1', 'lpt2', 'lpt3', 'lpt4', 'lpt5',\n 'lpt6', 'lpt7', 'lpt8', 'lpt9', 'lpt0' ]\n l = name.lower()\n for r in reserved:\n if l == r or l.startswith(r+\".\"):\n return True\n return False\n\ndef haswinspecial(name):\n specials = '<>:\"\\\\|?*'\n for c in name:\n if c in specials:\n return True\n return False\n\ndef winnames(root, parent, flist, output):\n ret = 0\n output.write(\"Illegal filenames (Windows):\\n\")\n for f in flist():\n if haswinspecial(f):\n output.write(\" \"+f+\": invalid character in name\\n\")\n ret |= 1\n continue\n\n parts = f.split('/')\n for p in parts:\n if iswinreserved(p):\n output.write(\" \"+f+\": reserved file name\\n\")\n ret |= 1\n break\n\n return ret\n\ndef run_checks(root, parent, cmds, scmds, paths='', opts={}):\n \"\"\"Run the checks given in 'cmds', expected to have well-known signatures,\n and report results for any which fail.\n\n Return failure if any of them did.\n\n NB: the function name of the commands passed in is used to name the NOT\n file which excepts files from them.\"\"\"\n\n ret = 0\n\n for cmd in cmds:\n s = StringIO()\n\n exclude = not_check(root, cmd.__name__)\n result = cmd(root, parent, gen_files(root, parent, paths, exclude),\n output=s)\n ret |= result\n\n if result != 0:\n print(s.getvalue())\n\n for cmd in scmds:\n s = StringIO()\n\n exclude = not_check(root, cmd.__name__)\n result = cmd(root, parent, gen_links(root, parent, paths, exclude),\n output=s)\n ret |= result\n\n if result != 0:\n print(s.getvalue())\n\n return ret\n\ndef nits(root, parent, paths):\n cmds = [copyright,\n cstyle,\n hdrchk,\n jstyle,\n keywords,\n manlint,\n mapfilechk,\n winnames,\n wscheck]\n scmds = [symlinks]\n run_checks(root, parent, cmds, scmds, paths)\n\ndef pbchk(root, parent, paths):\n cmds = [comchk,\n copyright,\n cstyle,\n hdrchk,\n jstyle,\n keywords,\n manlint,\n mapfilechk,\n winnames,\n wscheck]\n scmds = [symlinks]\n run_checks(root, parent, cmds, scmds)\n\ndef main(cmd, args):\n parent_branch = None\n checkname = None\n\n try:\n opts, args = getopt.getopt(args, 'b:c:p:')\n except getopt.GetoptError as e:\n sys.stderr.write(str(e) + '\\n')\n sys.stderr.write(\"Usage: %s [-c check] [-p branch] [path...]\\n\" % cmd)\n sys.exit(1)\n\n for opt, arg in opts:\n # We accept \"-b\" as an alias of \"-p\" for backwards compatibility.\n if opt == '-p' or opt == '-b':\n parent_branch = arg\n elif opt == '-c':\n checkname = arg\n\n if not parent_branch:\n parent_branch = git_parent_branch(git_branch())\n\n if checkname is None:\n if cmd == 'git-pbchk':\n checkname = 'pbchk'\n else:\n checkname = 'nits'\n\n if checkname == 'pbchk':\n if args:\n sys.stderr.write(\"only complete workspaces may be pbchk'd\\n\");\n sys.exit(1)\n pbchk(git_root(), parent_branch, None)\n elif checkname == 'nits':\n nits(git_root(), parent_branch, args)\n else:\n run_checks(git_root(), parent_branch, [eval(checkname)], args)\n\nif __name__ == '__main__':\n try:\n main(os.path.basename(sys.argv[0]), sys.argv[1:])\n except GitError as e:\n sys.stderr.write(\"failed to run git:\\n %s\\n\" % str(e))\n sys.exit(1)\n"} +{"text": "{\n \"name\": \"node-xml\",\n \"version\": \"1.0.2\",\n \"directories\": {\n \"lib\": \"./lib\"\n },\n \"main\": \"./lib/node-xml\",\n \"engines\": {\n \"node\" : \">=0.1.93\"\n },\n \"dependencies\": {\n },\n \"description\": \"An xml parser for node.js written in Javascript.\",\n \"author\": \"Rob Righter \",\n \"homepage\": \"https://github.com/robrighter/node-xml\",\n \"repository\" :\n {\n \"type\" : \"git\",\n \"url\" : \"git://github.com/robrighter/node-xml.git\"\n }\n}"} +{"text": "// Copyright (c) 2015, Cisco Systems\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n//\n// 1. Redistributions of source code must retain the above copyright 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. Neither the name of the copyright holder nor the names of its\n// contributors may be used to endorse or promote products derived\n// from this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// This file is autogenerated\n//\n// The following edits are possible, without affecting the validity of the\n// file:\n//\n// * Fields may be renamed.\n// * Fields may be deleted.\n// * The unique numbered tag for a field may be changed, provided that\n// the ordering of tags for fields within a message is preserved.\n// * Message types may be renamed.\n// * Message types may be deleted (if all fields that reference them\n// have been deleted).\n//\n// All Cisco message and field extensions must be preserved (except when the\n// field itself is being deleted).\n\nsyntax = \"proto3\";\n\npackage cisco_ios_xr_ipv6_ospfv3_oper.ospfv3.processes.process.vrfs.vrf.fast_reroutes.fast_reroute;\n\n// OSPF IPFRR Topology Information\nmessage ospfv3_sh_ipfrr_topo_KEYS {\n string process_name = 1;\n string vrf_name = 2;\n string router_id = 3;\n uint32 area_id = 4;\n}\n\nmessage ospfv3_sh_ipfrr_topo {\n // Area ID string in decimal or dotted decimal format\n string ipfrr_topo_area_id = 50;\n // OSPF Router ID\n string ipfrr_router_id = 51;\n // IPFRR Topology Revision\n uint32 ipfrr_area_revision = 52;\n // IPFRR Topology entries\n repeated ospf_sh_ipfrr_topo_entry ipfrr_topo = 53;\n}\n\n// OSPF_IPFRR Topology Entry\nmessage ospf_sh_ipfrr_topo_entry {\n // IPFRR Topology Node ID\n string node_id = 1;\n // IPFRR Topology LSA ID\n uint32 lsaid = 2;\n // IPFRR Topology Distance\n uint32 distance = 3;\n // IPFRR Topoogy Type-4 entry\n bool type4 = 4;\n // IPFRR Topology Revision\n uint32 revision = 5;\n // IPFRR Topology Neighbor Sourced\n bool neighbor_sourced = 6;\n // IPFRR Topology DR entry\n bool dr = 7;\n}\n\n"} +{"text": "import Command from './Command';\nimport Parameter from '../data/Parameter';\nimport MainPanelItem from '../menu/MainPanelItem';\n\n/**\n * Command to add and delete a parameter.\n * @class\n */\nexport default class AddDeleteParameterCmd extends Command {\n constructor(add, initialData, id, parentId, position, rb) {\n super();\n this.add = add;\n this.initialData = initialData;\n this.parentId = parentId;\n this.position = position;\n this.rb = rb;\n this.id = id;\n this.showDelete = true;\n }\n\n getName() {\n if (this.add) {\n return 'Add parameter';\n } else {\n return 'Delete parameter';\n }\n }\n\n setShowDelete(showDelete) {\n this.showDelete = showDelete;\n }\n\n do() {\n if (this.add) {\n this.addParameter();\n } else {\n this.deleteParameter();\n }\n }\n\n undo() {\n if (this.add) {\n this.deleteParameter();\n } else {\n this.addParameter();\n }\n }\n\n addParameter() {\n let parent = this.rb.getDataObject(this.parentId);\n if (parent !== null) {\n let parameter = new Parameter(this.id, this.initialData, this.rb);\n this.rb.addParameter(parameter);\n let panelItem = new MainPanelItem(\n 'parameter', parent.getPanelItem(), parameter,\n { hasChildren: true, showAdd: true, showDelete: this.showDelete, draggable: true }, this.rb);\n panelItem.openParentItems();\n parameter.setPanelItem(panelItem);\n parent.getPanelItem().insertChild(this.position, panelItem);\n parameter.setup();\n this.rb.notifyEvent(parameter, Command.operation.add);\n }\n }\n\n deleteParameter() {\n let parameter = this.rb.getDataObject(this.id);\n if (parameter !== null) {\n this.initialData = parameter.toJS();\n this.rb.deleteParameter(parameter);\n }\n }\n}"} +{"text": "//\n// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.\n//\n\n#import \n\n__attribute__((visibility(\"hidden\")))\n@interface RCDataStoreServerRequestHandlingPolicy : NSXPCStoreServerRequestHandlingPolicy\n{\n}\n\n- (BOOL)shouldAcceptConnectionsFromClientWithContext:(id)arg1;\n\n@end\n\n"} +{"text": "/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n#ifndef HTTP_HELPER\n#define HTTP_HELPER\n\n#include \n\nint makePutRequest(const std::string& url, const std::string& body);\nint makePostRequest(const std::string& url, const std::string& body);\nint makeDeleteRequest(const std::string& url);\n\n#endif /* end of include guard: HTTP_HELPER */\n"} +{"text": "// This file was procedurally generated from the following sources:\n// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case\n// - src/computed-property-names/evaluation/class-declaration-fields-methods.template\n/*---\ndescription: Computed property name from additive expression \"subtract\" (ComputedPropertyName in ClassExpression)\nesid: prod-ComputedPropertyName\nfeatures: [computed-property-names]\nflags: [generated]\ninfo: |\n ClassExpression:\n classBindingIdentifier opt ClassTail\n\n ClassTail:\n ClassHeritage opt { ClassBody opt }\n\n ClassBody:\n ClassElementList\n\n ClassElementList:\n ClassElement\n\n ClassElement:\n MethodDefinition\n\n MethodDefinition:\n PropertyName ...\n get PropertyName ...\n set PropertyName ...\n\n PropertyName:\n ComputedPropertyName\n\n ComputedPropertyName:\n [ AssignmentExpression ]\n---*/\n\n\nlet C = class {\n [1 - 1] = () => {\n return 0;\n };\n\n static [1 - 1] = () => {\n return 0;\n };\n};\n\nlet c = new C();\n\nassert.sameValue(\n c[1 - 1](),\n 0\n);\nassert.sameValue(\n C[1 - 1](),\n 0\n);\nassert.sameValue(\n c[String(1 - 1)](),\n 0\n);\nassert.sameValue(\n C[String(1 - 1)](),\n 0\n);\n"} +{"text": "# Chef generated my.cnf for instance mysql-<%= @config.name %>\n\n[client]\n<% if @config.charset %>\ndefault-character-set = <%= @config.charset %>\n<% end %>\n<% if @config.port %>\nport = <%= @config.port %>\n<% end %>\n<% if @socket_file %>\nsocket = <%= @socket_file %>\n<% end %>\n\n[mysql]\n<% if @config.charset %>\ndefault-character-set = <%= @config.charset %>\n<% end %>\n\n[mysqld]\n<% if @config.run_user %>\nuser = <%= @config.run_user %>\n<% end %>\n<% if @pid_file %>\npid-file = <%= @pid_file %>\n<% end %>\n<% if @socket_file %>\nsocket = <%= @socket_file %>\n<% end %>\n<% if @config.bind_address %>\nbind-address = <%= @config.bind_address %>\n<% end %>\n<% if @config.port %>\nport = <%= @config.port %>\n<% end %>\n<% if @data_dir %>\ndatadir = <%= @data_dir %>\n<% end %>\n<% if @tmp_dir %>\ntmpdir = <%= @tmp_dir %>\n<% end %>\n<% @config.mysqld_options.each do |option,value| %>\n<%= option %> = <%= value %>\n<% end %>\n<% if @lc_messages_dir %>\nlc-messages-dir = <%= @lc_messages_dir %>\n<% end %>\n<% if @error_log %>\nlog-error = <%= @error_log %>\n<% end %>\n<% if @include_dir %>\n!includedir <%= @include_dir %>\n<% end %>\n\n[mysqld_safe]\n<% if @socket_file %>\nsocket = <%= @socket_file %>\n<% end %>\n"} +{"text": "/*\n * This file is part of Splice Machine.\n * Splice Machine is free software: you can redistribute it and/or modify it under the terms of the\n * GNU Affero General Public License as published by the Free Software Foundation, either\n * version 3, or (at your option) any later version.\n * Splice Machine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License along with Splice Machine.\n * If not, see .\n *\n * Some parts of this source code are based on Apache Derby, and the following notices apply to\n * Apache Derby:\n *\n * Apache Derby is a subproject of the Apache DB project, and is licensed under\n * the Apache License, Version 2.0 (the \"License\"); you may not use these files\n * except 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\n * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations under the License.\n *\n * Splice Machine, Inc. has modified the Apache Derby code in this file.\n *\n * All such Splice Machine modifications are Copyright 2012 - 2020 Splice Machine, Inc.,\n * and are licensed to you under the GNU Affero General Public License.\n */\n\npackage com.splicemachine.db.impl.sql.conn;\n\nimport com.splicemachine.db.iapi.sql.dictionary.TableDescriptor;\n\n//this class is for temporary tables. The information kept here is necessary to implement the rollback\n//and commit behavior for temporary tables.\n\n/**\nThe temp tables will have following data structure\nTableDescriptor\nDeclared in savepoint level\nDropped in savepoint level\nModified in savepoint level\n\nThe actual logic\n\nLanguageConnectionContext will keep the \"current savepoint level\". At any point in\ntime, this is the total number of savepoints defined for a transaction.\nAt the start of any new transaction, the \"current savepoint level\" will be set to 0.\n\nEverytime a new user defined savepoint is set, store returns the total number of savepoints\nfor the connection at that point.\nFor eg, in a new transaction,\n\"current savepoint level' will be 0. When the first savepoint is set, store will return\n1 and \"current savepoint level\" will be set to 1. For next savepoint, store will return 2 and so on\nand so forth.\n\nWhen language calls rollback or release of a savepoint, store will again return the total number of savepoints\nfor the connection after rollback or release and we will set \"current savepoint level\" to that number. For eg,\nstart tran (\"current savepoint level\"=0)\nset savepoint 1 (\"current savepoint level\"=1)\nset savepoint 2 (\"current savepoint level\"=2)\nset savepoint 3 (\"current savepoint level\"=3)\nset savepoint 4 (\"current savepoint level\"=4)\nrelease savepoint 3 (\"current savepoint level\"=2)\nrollback savepoint 1 (\"current savepoint level\"=0)\n\nIf the temporary table was declared with ON ROLLBACK DELETE ROWS and contents of that temporary table\nwere modified in a transaction or within a savepoint unit, then we keep track of that by saving the\nsavepoint level in dataModifiedInSavepointLevel. This information will be used at rollback of savepoint or transaction.\nAlso, when a savepoint is released, we check if the table was modified in any of the savepoints that\nare getting released. If yes, then we put the current savepoint level as dataModifiedInSavepointLevel.\neg\nstart tran (\"current savepoint level\"=0)\ndeclare temp table 0 ON ROLLBACK DELETE ROWS(\"declared in savepoint level\"=0, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=-1)\ncommit (temp table 0 (\"declared in savepoint level\"=-1, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=-1))\nstart tran (\"current savepoint level = 0)\n temp table 0 (\"declared in savepoint level\"=-1, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=-1)\nset savepoint 1(\"current savepoint level = 1\")\n temp table 0 (\"declared in savepoint level\"=-1, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=-1)\nset savepoint 2(\"current savepoint level = 2\")\n delete 1 row from temp table 0\n temp table 0 (\"declared in savepoint level\"=-1, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=2)\nrelease savepoint 2 (\"current savepoint level\"=1) and reset the modified in savepoint level as follows\n temp table 0 (\"declared in savepoint level\"=-1, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=1)\nrollback (\"current savepoint level\"=0) All the rows from the temp table 0 will be removed\nAt the time of commit, we set dataModifiedInSavepointLevel to -1.\nAt the time of rollback (transaction / savepoint), first we check if the table was modified in the unit of work\ngetting rolled back. If yes, then we delete all the data from the temp table and we set dataModifiedInSavepointLevel to -1.\n\nWhen language calls release of a savepoint, store will again return the total number of savepoints\nin the system after release. We will go through all the temp tables and reset their declared or\ndropped or modified in savepoint level to the value returned by the release savepoint if those tables had their\ndeclared or dropped or modified in savepoint levels higher than what was returned by the release savepoint.\neg\nstart tran (\"current savepoint level\"=0)\ndeclare temp table 0 (\"declared in savepoint level\"=0, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=-1)\nset savepoint 1(\"current savepoint level = 1\")\ndeclare temp table 1 (\"declared in savepoint level\"=1, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=-1)\nset savepoint 2(\"current savepoint level = 2\")\ndeclare temp table 2 (\"declared in savepoint level\"=2, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=-1)\nrelease savepoint 1 (\"current savepoint level\"=0) and reset the savepoint levels as follows\n temp table 1 (\"declared in savepoint level\"=0, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=-1)\n temp table 2 (\"declared in savepoint level\"=0, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=-1)\nset savepoint 3(\"current savepoint level = 1\")\nrollback savepoint 3 (\"current savepoint level\"=0) and temp table info will look as follows\n temp table 0 (\"declared in savepoint level\"=0, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=-1)\n temp table 1 (\"declared in savepoint level\"=0, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=-1)\n temp table 2 (\"declared in savepoint level\"=0, \"dropped in savepoint level\"=-1, \"dataModifiedInSavepointLevel\"=-1)\n\nWhen you declare a temp table, it will have \"declared in savepoint level\" as the current savepoint\nlevel of the LanguageConnectionContext (which will be 0 in a transaction with no user-defined savepoints).\nThe \"dropped in savepoint level\" for new temp tables will be set to -1.\nThe \"dataModifiedInSavepointLevel\" for new temp tables will be set to -1 as well.\n\nWhen a temp table is dropped, we will first check if the table was declared in a savepoint level\nequal to the current savepoint level.\n\tIf yes, then we will remove it from the temp tables list for the LanguageConnectionContext .\n eg\n start tran (\"current savepoint level = 0\")\n set savepoint 1(\"current savepoint level = 1\")\n declare temp table 1 (\"declared in savepoint level\"=1, \"dropped in savepoint level\"=-1)\n drop temp table 1 (declared in savepoint level same as current savepoint level and hence will remove it from list of temp tables)\n\tIf no, then we will set the dropped in savepoint level as the current savepoint level of the\n\t\tLanguageConnectionContext (which will be 0 in a transaction without savepoints and it also means\n\t\tthat the table was declared in a previous transaction).\n\nAt the time of commit, go through all the temp tables with \"dropped in savepoint level\" != -1 (meaning dropped in this transaction)\nand remove them from the temp tables list for the LanguageConnectionContext. All the rest of the temp tables with\n\"dropped in savepoint level\" = -1, we will set their \"declared in savepoint level\" to -1 and , \"dataModifiedInSavepointLevel\" to -1.\neg\n start tran (\"current savepoint level = 0)\n\t declare temp table t1(\"declared in savepoint level\" = 0, \"dropped in savepoint level\"=-1)\n commit (temp table 1 (\"declared in savepoint level\"=-1, \"dropped in savepoint level\"=-1))\n start tran (\"current savepoint level = 0)\n\t drop temp table t1 (\"declared in savepoint level\" = -1, \"dropped in savepoint level\"=0)\n commit (temp table t1 will be removed from list of temp tables)\n\nAt the time of rollback\n if rolling back transaction, first set the \"current savepoint level\" to 0\n if rolling back to a savepoint, first set the \"current savepoint level\" to savepoint level returned by Store\n for the rollback to savepoint command\n Now go through all the temp tables.\n\tIf \"declared in savepoint level\" of temp table is greater than or equal to \"current savepoint level\"\n (ie table was declared in this unit of work)\n And if table was not dropped in this unit of work ie \"dropped in savepoint level\" = -1\n Then we should remove the table from the list of temp tables and drop the conglomerate created for it\n\t\t eg\n\t\t start tran (\"current savepoint level = 0)\n\t \tdeclare temp table t2(\"declared in savepoint level\" = 0, \"dropped in savepoint level\"=-1)\n\t\t rollback tran\n (temp table t2 will be removed from list of tables and conglomerate associated with it will be dropped)\n And if table was dropped in this unit of work ie \"dropped in savepoint level\" >= \"current savepoint level\"\n Then we should remove the table from the list of temp tables\n\t\t eg\n\t\t start tran (\"current savepoint level = 0)\n set savepoint 1(\"current savepoint level = 1\")\n\t \tdeclare temp table t2(\"declared in savepoint level\" = 1, \"dropped in savepoint level\"=-1)\n set savepoint 2(\"current savepoint level = 2\")\n\t\t drop temp table t1 (\"declared in savepoint level\" = 1, \"dropped in savepoint level\"=2)\n\t\t rollback savepoint 1 (\"current savepoint level = 0) temp table t1 will be removed from the list of temp tables\n\tElse if the \"dropped in savepoint level\" of temp table is greate than or equal to \"current savepoint level\"\n\t \tit mean that table was dropped in this unit of work (and was declared in an earlier savepoint unit / transaction) and we will\n restore it as part of rollback ie replace the existing entry for this table in valid temp tables list with restored temp table.\n At the end of restoring, \"declared in savepoint level\" will remain unchanged and \"dropped in savepoint level\" will be -1.\n\t\teg\n\t\t start tran (\"current savepoint level = 0)\n\t\t declare temp table t1 with definition 1(\"declared in savepoint level\" = 0, \"dropped in savepoint level\"=-1, definition 1(stored in table descriptor))\n\t\t commit (temp table t1 \"declared in savepoint level\" = -1, \"dropped in savepoint level\"=-1)\n\t\t start tran (\"current savepoint level = 0)\n set savepoint 1(\"current savepoint level = 1\")\n\t\t drop temp table t1 (\"declared in savepoint level\" = -1, \"dropped in savepoint level\"=1, definition 1(stored in table descriptor))\n\t\t declare temp table t1 with definition 2(say different than definition 1)\n (\"declared in savepoint level\" = -1, \"dropped in savepoint level\"=1, definition 1(stored in table descriptor)) ,\n\t\t\t (\"declared in savepoint level\" = 1, \"dropped in savepoint level\"=-1, definition 2(stored in table descriptor))\n set savepoint 2(\"current savepoint level = 2\")\n drop temp table t1(\"declared in savepoint level\" = -1, \"dropped in savepoint level\"=1, definition 1(stored in table descriptor)) ,\n\t\t\t (\"declared in savepoint level\" = 1, \"dropped in savepoint level\"=2, definition 2(stored in table descriptor))\n\t\t rollback tran\n (Remove : temp table t1(\"declared in savepoint level\" = 1, \"dropped in savepoint level\"=2, definition 2(stored in table descriptor)\n (Restore : temp table t1\"declared in savepoint level\" = -1, \"dropped in savepoint level\"=-1, definition 1(stored in table descriptor))\n\tElse if the \"dataModifiedInSavepointLevel\" of temp table is greate than or equal to \"current savepoint level\"\n\t \tit means that table was declared in an earlier savepoint unit / transaction and was modified in the current UOW. And hence we will delete all the\n data from it.\n*/\nclass TempTableInfo\n{\n\n\tprivate TableDescriptor td;\n\tprivate int declaredInSavepointLevel;\n\tprivate int droppededInSavepointLevel;\n\tprivate int dataModifiedInSavepointLevel;\n\n\tTempTableInfo(TableDescriptor td, int declaredInSavepointLevel)\n\t{\n\t\tthis.td = td;\n\t\tthis.declaredInSavepointLevel = declaredInSavepointLevel;\n\t\tthis.droppededInSavepointLevel = -1;\n\t\tthis.dataModifiedInSavepointLevel = -1;\n\t}\n\n\t/**\n\t * Return the table descriptor\n\t */\n\tTableDescriptor getTableDescriptor() {\n return td;\n }\n\n\t/**\n\t * Set the table descriptor. Will be called while temporary is being restored\n\t */\n\tvoid setTableDescriptor(TableDescriptor td) {\n this.td = td;\n }\n\n\t/**\n\t * Matches by name and only temp tables that have not been dropped (that's when droppededInSavepointLevel will be -1)\n\t */\n\tboolean matches(String tableName) {\n return (td.getName().equals(tableName) && droppededInSavepointLevel == -1);\n }\n\n\t/**\n\t * Return the savepoint level when the table was last modified\n\t */\n\tint getModifiedInSavepointLevel() {\n return dataModifiedInSavepointLevel;\n }\n\n\t/**\n\t * Set the savepoint level when the table was last modified\n\t */\n\tvoid setModifiedInSavepointLevel(int dataModifiedInSavepointLevel) {\n this.dataModifiedInSavepointLevel = dataModifiedInSavepointLevel;\n }\n\n\t/**\n\t * Return the savepoint level when the table was declared\n\t */\n\tint getDeclaredInSavepointLevel() {\n return declaredInSavepointLevel;\n }\n\n\t/**\n\t * Set the savepoint level when the table was declared\n\t */\n\tvoid setDeclaredInSavepointLevel(int declaredInSavepointLevel) {\n this.declaredInSavepointLevel = declaredInSavepointLevel;\n }\n\n\t/**\n\t * Return the savepoint level when the table was dropped\n\t */\n\tint getDroppedInSavepointLevel() {\n return droppededInSavepointLevel;\n }\n\n\t/**\n\t * Return the savepoint level when the table was dropped\n\t */\n\tpublic void setDroppedInSavepointLevel(int droppededInSavepointLevel) {\n this.droppededInSavepointLevel = droppededInSavepointLevel;\n }\n}\n"} +{"text": "\r\n\r\n \r\n\r\n\r\n"} +{"text": "#!/usr/bin/env bash\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\nset -e\n\nexport GOOS=darwin\nexport GOARCH=amd64\n\nexport PROFILE=\"release\"\nexport PROJECT_HOME=`pwd`\n\nif [ -f \"${PROJECT_HOME}/assembly/common/app.properties\" ]; then\n . ${PROJECT_HOME}/assembly/common/app.properties\nfi\n\nif [ -f \"${PROJECT_HOME}/assembly/common/build.sh\" ]; then\n sh ${PROJECT_HOME}/assembly/common/build.sh\nfi\n"} +{"text": "// Copyright 2019 The etcd Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage raftpb\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/gogo/protobuf/proto\"\n)\n\n// ConfChangeI abstracts over ConfChangeV2 and (legacy) ConfChange to allow\n// treating them in a unified manner.\ntype ConfChangeI interface {\n\tAsV2() ConfChangeV2\n\tAsV1() (ConfChange, bool)\n}\n\n// MarshalConfChange calls Marshal on the underlying ConfChange or ConfChangeV2\n// and returns the result along with the corresponding EntryType.\nfunc MarshalConfChange(c ConfChangeI) (EntryType, []byte, error) {\n\tvar typ EntryType\n\tvar ccdata []byte\n\tvar err error\n\tif ccv1, ok := c.AsV1(); ok {\n\t\ttyp = EntryConfChange\n\t\tccdata, err = ccv1.Marshal()\n\t} else {\n\t\tccv2 := c.AsV2()\n\t\ttyp = EntryConfChangeV2\n\t\tccdata, err = ccv2.Marshal()\n\t}\n\treturn typ, ccdata, err\n}\n\n// AsV2 returns a V2 configuration change carrying out the same operation.\nfunc (c ConfChange) AsV2() ConfChangeV2 {\n\treturn ConfChangeV2{\n\t\tChanges: []ConfChangeSingle{{\n\t\t\tType: c.Type,\n\t\t\tNodeID: c.NodeID,\n\t\t}},\n\t\tContext: c.Context,\n\t}\n}\n\n// AsV1 returns the ConfChange and true.\nfunc (c ConfChange) AsV1() (ConfChange, bool) {\n\treturn c, true\n}\n\n// AsV2 is the identity.\nfunc (c ConfChangeV2) AsV2() ConfChangeV2 { return c }\n\n// AsV1 returns ConfChange{} and false.\nfunc (c ConfChangeV2) AsV1() (ConfChange, bool) { return ConfChange{}, false }\n\n// EnterJoint returns two bools. The second bool is true if and only if this\n// config change will use Joint Consensus, which is the case if it contains more\n// than one change or if the use of Joint Consensus was requested explicitly.\n// The first bool can only be true if second one is, and indicates whether the\n// Joint State will be left automatically.\nfunc (c *ConfChangeV2) EnterJoint() (autoLeave bool, ok bool) {\n\t// NB: in theory, more config changes could qualify for the \"simple\"\n\t// protocol but it depends on the config on top of which the changes apply.\n\t// For example, adding two learners is not OK if both nodes are part of the\n\t// base config (i.e. two voters are turned into learners in the process of\n\t// applying the conf change). In practice, these distinctions should not\n\t// matter, so we keep it simple and use Joint Consensus liberally.\n\tif c.Transition != ConfChangeTransitionAuto || len(c.Changes) > 1 {\n\t\t// Use Joint Consensus.\n\t\tvar autoLeave bool\n\t\tswitch c.Transition {\n\t\tcase ConfChangeTransitionAuto:\n\t\t\tautoLeave = true\n\t\tcase ConfChangeTransitionJointImplicit:\n\t\t\tautoLeave = true\n\t\tcase ConfChangeTransitionJointExplicit:\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"unknown transition: %+v\", c))\n\t\t}\n\t\treturn autoLeave, true\n\t}\n\treturn false, false\n}\n\n// LeaveJoint is true if the configuration change leaves a joint configuration.\n// This is the case if the ConfChangeV2 is zero, with the possible exception of\n// the Context field.\nfunc (c *ConfChangeV2) LeaveJoint() bool {\n\tcpy := *c\n\tcpy.Context = nil\n\treturn proto.Equal(&cpy, &ConfChangeV2{})\n}\n\n// ConfChangesFromString parses a Space-delimited sequence of operations into a\n// slice of ConfChangeSingle. The supported operations are:\n// - vn: make n a voter,\n// - ln: make n a learner,\n// - rn: remove n, and\n// - un: update n.\nfunc ConfChangesFromString(s string) ([]ConfChangeSingle, error) {\n\tvar ccs []ConfChangeSingle\n\ttoks := strings.Split(strings.TrimSpace(s), \" \")\n\tif toks[0] == \"\" {\n\t\ttoks = nil\n\t}\n\tfor _, tok := range toks {\n\t\tif len(tok) < 2 {\n\t\t\treturn nil, fmt.Errorf(\"unknown token %s\", tok)\n\t\t}\n\t\tvar cc ConfChangeSingle\n\t\tswitch tok[0] {\n\t\tcase 'v':\n\t\t\tcc.Type = ConfChangeAddNode\n\t\tcase 'l':\n\t\t\tcc.Type = ConfChangeAddLearnerNode\n\t\tcase 'r':\n\t\t\tcc.Type = ConfChangeRemoveNode\n\t\tcase 'u':\n\t\t\tcc.Type = ConfChangeUpdateNode\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown input: %s\", tok)\n\t\t}\n\t\tid, err := strconv.ParseUint(tok[1:], 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcc.NodeID = id\n\t\tccs = append(ccs, cc)\n\t}\n\treturn ccs, nil\n}\n\n// ConfChangesToString is the inverse to ConfChangesFromString.\nfunc ConfChangesToString(ccs []ConfChangeSingle) string {\n\tvar buf strings.Builder\n\tfor i, cc := range ccs {\n\t\tif i > 0 {\n\t\t\tbuf.WriteByte(' ')\n\t\t}\n\t\tswitch cc.Type {\n\t\tcase ConfChangeAddNode:\n\t\t\tbuf.WriteByte('v')\n\t\tcase ConfChangeAddLearnerNode:\n\t\t\tbuf.WriteByte('l')\n\t\tcase ConfChangeRemoveNode:\n\t\t\tbuf.WriteByte('r')\n\t\tcase ConfChangeUpdateNode:\n\t\t\tbuf.WriteByte('u')\n\t\tdefault:\n\t\t\tbuf.WriteString(\"unknown\")\n\t\t}\n\t\tfmt.Fprintf(&buf, \"%d\", cc.NodeID)\n\t}\n\treturn buf.String()\n}\n"} +{"text": "package schema2\n\nimport (\n\t\"context\"\n\n\t\"github.com/docker/distribution\"\n\t\"github.com/opencontainers/go-digest\"\n)\n\n// builder is a type for constructing manifests.\ntype builder struct {\n\t// bs is a BlobService used to publish the configuration blob.\n\tbs distribution.BlobService\n\n\t// configMediaType is media type used to describe configuration\n\tconfigMediaType string\n\n\t// configJSON references\n\tconfigJSON []byte\n\n\t// dependencies is a list of descriptors that gets built by successive\n\t// calls to AppendReference. In case of image configuration these are layers.\n\tdependencies []distribution.Descriptor\n}\n\n// NewManifestBuilder is used to build new manifests for the current schema\n// version. It takes a BlobService so it can publish the configuration blob\n// as part of the Build process.\nfunc NewManifestBuilder(bs distribution.BlobService, configMediaType string, configJSON []byte) distribution.ManifestBuilder {\n\tmb := &builder{\n\t\tbs: bs,\n\t\tconfigMediaType: configMediaType,\n\t\tconfigJSON: make([]byte, len(configJSON)),\n\t}\n\tcopy(mb.configJSON, configJSON)\n\n\treturn mb\n}\n\n// Build produces a final manifest from the given references.\nfunc (mb *builder) Build(ctx context.Context) (distribution.Manifest, error) {\n\tm := Manifest{\n\t\tVersioned: SchemaVersion,\n\t\tLayers: make([]distribution.Descriptor, len(mb.dependencies)),\n\t}\n\tcopy(m.Layers, mb.dependencies)\n\n\tconfigDigest := digest.FromBytes(mb.configJSON)\n\n\tvar err error\n\tm.Config, err = mb.bs.Stat(ctx, configDigest)\n\tswitch err {\n\tcase nil:\n\t\t// Override MediaType, since Put always replaces the specified media\n\t\t// type with application/octet-stream in the descriptor it returns.\n\t\tm.Config.MediaType = mb.configMediaType\n\t\treturn FromStruct(m)\n\tcase distribution.ErrBlobUnknown:\n\t\t// nop\n\tdefault:\n\t\treturn nil, err\n\t}\n\n\t// Add config to the blob store\n\tm.Config, err = mb.bs.Put(ctx, mb.configMediaType, mb.configJSON)\n\t// Override MediaType, since Put always replaces the specified media\n\t// type with application/octet-stream in the descriptor it returns.\n\tm.Config.MediaType = mb.configMediaType\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn FromStruct(m)\n}\n\n// AppendReference adds a reference to the current ManifestBuilder.\nfunc (mb *builder) AppendReference(d distribution.Describable) error {\n\tmb.dependencies = append(mb.dependencies, d.Descriptor())\n\treturn nil\n}\n\n// References returns the current references added to this builder.\nfunc (mb *builder) References() []distribution.Descriptor {\n\treturn mb.dependencies\n}\n"} +{"text": "{\n \"login\": \"avano\",\n \"id\": 7081216,\n \"node_id\": \"MDQ6VXNlcjcwODEyMTY=\",\n \"avatar_url\": \"https://avatars2.githubusercontent.com/u/7081216?v=4\",\n \"gravatar_id\": \"\",\n \"url\": \"https://api.github.com/users/avano\",\n \"html_url\": \"https://github.com/avano\",\n \"followers_url\": \"https://api.github.com/users/avano/followers\",\n \"following_url\": \"https://api.github.com/users/avano/following{/other_user}\",\n \"gists_url\": \"https://api.github.com/users/avano/gists{/gist_id}\",\n \"starred_url\": \"https://api.github.com/users/avano/starred{/owner}{/repo}\",\n \"subscriptions_url\": \"https://api.github.com/users/avano/subscriptions\",\n \"organizations_url\": \"https://api.github.com/users/avano/orgs\",\n \"repos_url\": \"https://api.github.com/users/avano/repos\",\n \"events_url\": \"https://api.github.com/users/avano/events{/privacy}\",\n \"received_events_url\": \"https://api.github.com/users/avano/received_events\",\n \"type\": \"User\",\n \"site_admin\": false,\n \"name\": \"Andrej Vaňo\",\n \"company\": \"Red Hat\",\n \"blog\": \"\",\n \"location\": \"Trnava, Slovakia\",\n \"email\": null,\n \"hireable\": true,\n \"bio\": null,\n \"public_repos\": 30,\n \"public_gists\": 3,\n \"followers\": 9,\n \"following\": 6,\n \"created_at\": \"2014-03-27T12:40:40Z\",\n \"updated_at\": \"2020-03-14T12:16:56Z\",\n \"private_gists\": 19,\n \"total_private_repos\": 5,\n \"owned_private_repos\": 2,\n \"disk_usage\": 13029,\n \"collaborators\": 1,\n \"two_factor_authentication\": true,\n \"plan\": {\n \"name\": \"free\",\n \"space\": 976562499,\n \"collaborators\": 0,\n \"private_repos\": 10000\n }\n}"} +{"text": "import {Triangles} from './jsx/allLiveEditors'\n\n# Triangles\n\n`` renders a list of triangles.\n\n## Props\n\n| Name | Type | Default | Description |\n| ---------- | ------------ | ------- | ----------------------------------- |\n| `children` | `Triangle[]` | `[]` | array of Triangle markers to render |\n\n### Triangle\n\n```js\ntype Color = {\n r: number, // between 0 and 1\n g: number, // between 0 and 1\n b: number, // between 0 and 1\n a: number, // between 0 and 1\n}\n\ntype Triangle = {\n id?: number, // positive integer\n pose: {\n position: { x: number, y: number, z: number },\n orientation: { x: number, y: number, z: number, w: number }\n }\n scale: {\n x: number,\n y: number,\n z: number,\n },\n color: Color,\n colors?: Color[],\n points: [{ x: number, y: number, z: number }]\n // Pass true to not render the triangles to the screen - just the hitmap.\n // This can be used to render the interior of a group of lines as transparent during normal rendering, but as \n // clickable for hitmap purposes.\n onlyRenderInHitmap?: boolean,\n}\n```\n\n\n"} +{"text": "#include \"contour/sketchtokens.h\"\r\n#include \"contour/structuredforest.h\"\r\n#include \"proposals/proposal.h\"\r\n#include \"segmentation/segmentation.h\"\r\n#include \"imgproc/image.h\"\r\n\r\nint main( int argc, const char * argv[] ) {\r\n\r\n\t/* Setup the proposals settings */\r\n\t// Play with those numbers to increase the number of proposals\r\n\t// Number of seeds N_S and number of segmentations per seed N_T\r\n\tconst int N_S = 130, N_T = 5;\r\n\t// Maximal overlap between any two proposals (intersection / union)\r\n\tconst float max_iou = 0.8;\r\n\t\r\n\tProposalSettings prop_settings;\r\n\tprop_settings.max_iou = max_iou;\r\n\t// Foreground/background proposals\r\n\tstd::vector vbg = {0,15};\r\n\tprop_settings.unaries.push_back( ProposalSettings::UnarySettings( N_S, N_T, seedUnary(), backgroundUnary(vbg) ) );\r\n\t// Pure background proposals\r\n\tstd::vector allbg = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};\r\n\tprop_settings.unaries.push_back( ProposalSettings::UnarySettings( 0, N_T, zeroUnary(), backgroundUnary(allbg), 0.1, 1 ) );\r\n\t\r\n\t/* Create the proposlas */\r\n\tProposal prop( prop_settings );\r\n\t\r\n\t/* Create the boundary detector */\r\n\t// Sketch tokens\r\n\t// SketchTokens detector;\r\n\t// detector.load( \"../data/st_full_c.dat\" );\r\n\t\r\n\t// Structured Forests are a bit faster, but produce more proposals\r\n\t// StructuredForest detector;\r\n\t// detector.load( \"../data/sf.dat\" );\r\n\t\r\n\t// Muilti Scale Structured Forests generally perform best\r\n\tMultiScaleStructuredForest detector;\r\n\tdetector.load( \"../data/sf.dat\" );\r\n\r\n\tfor( int i=1; i s = geodesicKMeans( im, detector, 1000 );\r\n\t\tRMatrixXb p = prop.propose( *s );\r\n\t\tprintf(\"Generated %d proposals\\n\", (int)p.rows() );\r\n\t\t\r\n\t\t// If you just want boxes use\r\n\t\tRMatrixXi boxes = s->maskToBox( p );\r\n\t\t\r\n\t\t// To use the proposals use the over segmentation s.s() and p.row(n)\r\n\t\t// you can get the binary segmentation mask using the following lines\r\n\t\tint n_prop = 0;\r\n\t\t\r\n\t\tRMatrixXb segment( s->s().rows(), s->s().cols() );\r\n\t\tfor( int j=0; js().rows(); j++ )\r\n\t\t\tfor( int i=0; is().cols(); i++ )\r\n\t\t\t\tsegment(j,i) = p( n_prop, s->s()(j,i) );\r\n\t}\r\n\r\n\treturn 0;\r\n}"} +{"text": "from __future__ import absolute_import\n\nimport numpy as np\nfrom scipy import ndimage\nfrom scipy import linalg\n\nfrom os import listdir\nfrom os.path import isfile, join\nimport random, math\nfrom six.moves import range\n\n'''\n Fairly basic set of tools for realtime data augmentation on image data.\n Can easily be extended to include new transforms, new preprocessing methods, etc...\n'''\n\ndef random_rotation(x, rg, fill_mode=\"nearest\", cval=0.):\n angle = random.uniform(-rg, rg)\n x = ndimage.interpolation.rotate(x, angle, axes=(1,2), reshape=False, mode=fill_mode, cval=cval)\n return x\n\ndef random_shift(x, wrg, hrg, fill_mode=\"nearest\", cval=0.):\n crop_left_pixels = 0\n crop_right_pixels = 0\n crop_top_pixels = 0\n crop_bottom_pixels = 0\n\n original_w = x.shape[1]\n original_h = x.shape[2]\n\n if wrg:\n crop = random.uniform(0., wrg)\n split = random.uniform(0, 1)\n crop_left_pixels = int(split*crop*x.shape[1])\n crop_right_pixels = int((1-split)*crop*x.shape[1])\n\n if hrg:\n crop = random.uniform(0., hrg)\n split = random.uniform(0, 1)\n crop_top_pixels = int(split*crop*x.shape[2])\n crop_bottom_pixels = int((1-split)*crop*x.shape[2])\n\n x = ndimage.interpolation.shift(x, (0, crop_left_pixels, crop_top_pixels), mode=fill_mode, cval=cval)\n return x\n\ndef horizontal_flip(x):\n for i in range(x.shape[0]):\n x[i] = np.fliplr(x[i])\n return x\n\ndef vertical_flip(x):\n for i in range(x.shape[0]):\n x[i] = np.flipud(x[i])\n return x\n\n\ndef random_barrel_transform(x, intensity):\n # TODO\n pass\n\ndef random_shear(x, intensity):\n # TODO\n pass\n\ndef random_channel_shift(x, rg):\n # TODO\n pass\n\ndef random_zoom(x, rg, fill_mode=\"nearest\", cval=0.):\n zoom_w = random.uniform(1.-rg, 1.)\n zoom_h = random.uniform(1.-rg, 1.)\n x = ndimage.interpolation.zoom(x, zoom=(1., zoom_w, zoom_h), mode=fill_mode, cval=cval)\n return x # shape of result will be different from shape of input!\n\n\n\n\ndef array_to_img(x, scale=True):\n from PIL import Image\n x = x.transpose(1, 2, 0) \n if scale:\n x += max(-np.min(x), 0)\n x /= np.max(x)\n x *= 255\n if x.shape[2] == 3:\n # RGB\n return Image.fromarray(x.astype(\"uint8\"), \"RGB\")\n else:\n # grayscale\n return Image.fromarray(x[:,:,0].astype(\"uint8\"), \"L\")\n\n\ndef img_to_array(img):\n x = np.asarray(img, dtype='float32')\n if len(x.shape)==3:\n # RGB: height, width, channel -> channel, height, width\n x = x.transpose(2, 0, 1)\n else:\n # grayscale: height, width -> channel, height, width\n x = x.reshape((1, x.shape[0], x.shape[1]))\n return x\n\n\ndef load_img(path, grayscale=False):\n from PIL import Image\n img = Image.open(open(path))\n if grayscale:\n img = img.convert('L')\n else: # Assure 3 channel even when loaded image is grayscale\n img = img.convert('RGB')\n return img\n\n\ndef list_pictures(directory, ext='jpg|jpeg|bmp|png'):\n return [join(directory,f) for f in listdir(directory) \\\n if isfile(join(directory,f)) and re.match('([\\w]+\\.(?:' + ext + '))', f)]\n\n\n\nclass ImageDataGenerator(object):\n '''\n Generate minibatches with \n realtime data augmentation.\n '''\n def __init__(self, \n featurewise_center=True, # set input mean to 0 over the dataset\n samplewise_center=False, # set each sample mean to 0\n featurewise_std_normalization=True, # divide inputs by std of the dataset\n samplewise_std_normalization=False, # divide each input by its std\n\n zca_whitening=False, # apply ZCA whitening\n rotation_range=0., # degrees (0 to 180)\n width_shift_range=0., # fraction of total width\n height_shift_range=0., # fraction of total height\n horizontal_flip=False,\n vertical_flip=False,\n ):\n self.__dict__.update(locals())\n self.mean = None\n self.std = None\n self.principal_components = None\n\n\n def flow(self, X, y, batch_size=32, shuffle=False, seed=None, save_to_dir=None, save_prefix=\"\", save_format=\"jpeg\"):\n if seed:\n random.seed(seed)\n\n if shuffle:\n seed = random.randint(1, 10e6)\n np.random.seed(seed)\n np.random.shuffle(X)\n np.random.seed(seed)\n np.random.shuffle(y)\n\n nb_batch = int(math.ceil(float(X.shape[0])/batch_size))\n for b in range(nb_batch):\n batch_end = (b+1)*batch_size\n if batch_end > X.shape[0]:\n nb_samples = X.shape[0] - b*batch_size\n else:\n nb_samples = batch_size\n\n bX = np.zeros(tuple([nb_samples]+list(X.shape)[1:]))\n for i in range(nb_samples):\n x = X[b*batch_size+i]\n x = self.random_transform(x.astype(\"float32\"))\n x = self.standardize(x)\n bX[i] = x\n\n if save_to_dir:\n for i in range(nb_samples):\n img = array_to_img(bX[i], scale=True)\n img.save(save_to_dir + \"/\" + save_prefix + \"_\" + str(i) + \".\" + save_format)\n\n yield bX, y[b*batch_size:b*batch_size+nb_samples]\n\n\n def standardize(self, x):\n if self.featurewise_center:\n x -= self.mean\n if self.featurewise_std_normalization:\n x /= self.std\n\n if self.zca_whitening:\n flatx = np.reshape(x, (x.shape[0]*x.shape[1]*x.shape[2]))\n whitex = np.dot(flatx, self.principal_components)\n x = np.reshape(whitex, (x.shape[0], x.shape[1], x.shape[2]))\n\n if self.samplewise_center:\n x -= np.mean(x)\n if self.samplewise_std_normalization:\n x /= np.std(x)\n\n return x\n\n\n def random_transform(self, x):\n if self.rotation_range:\n x = random_rotation(x, self.rotation_range)\n if self.width_shift_range or self.height_shift_range:\n x = random_shift(x, self.width_shift_range, self.height_shift_range)\n if self.horizontal_flip:\n if random.random() < 0.5:\n x = horizontal_flip(x)\n if self.vertical_flip:\n if random.random() < 0.5:\n x = vertical_flip(x)\n\n # TODO:\n # zoom\n # barrel/fisheye\n # shearing\n # channel shifting\n return x\n\n\n def fit(self, X, \n augment=False, # fit on randomly augmented samples\n rounds=1, # if augment, how many augmentation passes over the data do we use\n seed=None\n ):\n '''\n Required for featurewise_center, featurewise_std_normalization and zca_whitening.\n '''\n X = np.copy(X)\n \n if augment:\n aX = np.zeros(tuple([rounds*X.shape[0]]+list(X.shape)[1:]))\n for r in range(rounds):\n for i in range(X.shape[0]):\n img = array_to_img(X[i])\n img = self.random_transform(img)\n aX[i+r*X.shape[0]] = img_to_array(img)\n X = aX\n\n if self.featurewise_center:\n self.mean = np.mean(X, axis=0)\n X -= self.mean\n if self.featurewise_std_normalization:\n self.std = np.std(X, axis=0)\n X /= self.std\n\n if self.zca_whitening:\n flatX = np.reshape(X, (X.shape[0], X.shape[1]*X.shape[2]*X.shape[3]))\n fudge = 10e-6\n sigma = np.dot(flatX.T, flatX) / flatX.shape[1]\n U, S, V = linalg.svd(sigma)\n self.principal_components = np.dot(np.dot(U, np.diag(1. / np.sqrt(S + fudge))), U.T)\n\n\n"} +{"text": "/*****************************************************************************\n\n Licensed to Accellera Systems Initiative Inc. (Accellera) under one or\n more contributor license agreements. See the NOTICE file distributed\n with this work for additional information regarding copyright ownership.\n Accellera licenses this file to you under the Apache License, Version 2.0\n (the \"License\"); you may not use this file except in compliance with the\n License. You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied. See the License for the specific language governing\n permissions and limitations under the License.\n\n *****************************************************************************/\n\n/*****************************************************************************\n\n main.cpp -- \n\n Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15\n\n *****************************************************************************/\n\n/*****************************************************************************\n\n MODIFICATION LOG - modifiers, enter your name, affiliation, date and\n changes you are making here.\n\n Name, Affiliation, Date:\n Description of Modification:\n\n *****************************************************************************/\n\n// Main routine\n \n#include \"systemc.h\"\n#include \"test.h\"\n#include \"tb.h\"\n#include \"monitor.h\"\n#include \"define.h\"\n \nint sc_main(int ac, char *av[])\n{\n sc_clock clock(\"Clock\", CLOCK_PERIOD, SC_NS, DUTY_CYCLE, 0, SC_NS);\n sc_clock tb_clock(\"TBClock\", TB_CLOCK_PERIOD, SC_NS, DUTY_CYCLE, 0, SC_NS);\n sc_clock mon_clock(\"MonClock\", CLOCK_PERIOD, SC_NS, DUTY_CYCLE, 75, SC_NS);\n \n sc_signal reset_sig;\n\n sc_signal i1;\n sc_signal i2;\n sc_signal i3;\n sc_signal i4;\n sc_signal i5;\n \n sc_signal cont1;\n sc_signal cont2;\n sc_signal cont3;\n \n sc_signal o1;\n sc_signal o2;\n sc_signal o3;\n sc_signal o4;\n sc_signal o5;\n\n test TEST (\"TEST\", clock, reset_sig, i1, i2, i3, i4, i5,\n\t cont1, cont2, cont3, o1, o2, o3, o4, o5);\n tb TB (\"TB\", tb_clock, reset_sig, i1, i2, i3, i4, i5,\n\t cont1, cont2, cont3, o1, o2, o3, o4, o5);\n monitor MONITOR (\"MONITOR\", mon_clock, reset_sig, i1, i2, i3, i4, i5,\n\t cont1, cont2, cont3, o1, o2, o3, o4, o5);\n\n // Simulation Run Control\n sc_start();\n return 0;\n}\n"} +{"text": "// Licensed to the Software Freedom Conservancy (SFC) 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 SFC 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'use strict';\n\nvar fs = require('fs'),\n http = require('http'),\n path = require('path'),\n url = require('url');\n\nvar express = require('express');\nvar multer = require('multer');\nvar serveIndex = require('serve-index');\n\nvar Server = require('./httpserver').Server,\n resources = require('./resources'),\n promise = require('../..').promise,\n isDevMode = require('../../_base').isDevMode(),\n string = require('../../_base').require('goog.string');\n\nvar WEB_ROOT = '/common';\nvar JS_ROOT = '/javascript';\n\nvar baseDirectory = resources.locate(isDevMode ? 'common/src/web' : '.');\nvar jsDirectory = resources.locate(isDevMode ? 'javascript' : '..');\n\nvar Pages = (function() {\n var pages = {};\n function addPage(page, path) {\n pages.__defineGetter__(page, function() {\n return exports.whereIs(path);\n });\n }\n\n addPage('ajaxyPage', 'ajaxy_page.html');\n addPage('alertsPage', 'alerts.html');\n addPage('bodyTypingPage', 'bodyTypingTest.html');\n addPage('booleanAttributes', 'booleanAttributes.html');\n addPage('childPage', 'child/childPage.html');\n addPage('chinesePage', 'cn-test.html');\n addPage('clickJacker', 'click_jacker.html');\n addPage('clickEventPage', 'clickEventPage.html');\n addPage('clicksPage', 'clicks.html');\n addPage('colorPage', 'colorPage.html');\n addPage('deletingFrame', 'deletingFrame.htm');\n addPage('draggableLists', 'draggableLists.html');\n addPage('dragAndDropPage', 'dragAndDropTest.html');\n addPage('droppableItems', 'droppableItems.html');\n addPage('documentWrite', 'document_write_in_onload.html');\n addPage('dynamicallyModifiedPage', 'dynamicallyModifiedPage.html');\n addPage('dynamicPage', 'dynamic.html');\n addPage('echoPage', 'echo');\n addPage('errorsPage', 'errors.html');\n addPage('xhtmlFormPage', 'xhtmlFormPage.xhtml');\n addPage('formPage', 'formPage.html');\n addPage('formSelectionPage', 'formSelectionPage.html');\n addPage('framesetPage', 'frameset.html');\n addPage('grandchildPage', 'child/grandchild/grandchildPage.html');\n addPage('html5Page', 'html5Page.html');\n addPage('html5OfflinePage', 'html5/offline.html');\n addPage('iframePage', 'iframes.html');\n addPage('javascriptEnhancedForm', 'javascriptEnhancedForm.html');\n addPage('javascriptPage', 'javascriptPage.html');\n addPage('linkedImage', 'linked_image.html');\n addPage('longContentPage', 'longContentPage.html');\n addPage('macbethPage', 'macbeth.html');\n addPage('mapVisibilityPage', 'map_visibility.html');\n addPage('metaRedirectPage', 'meta-redirect.html');\n addPage('missedJsReferencePage', 'missedJsReference.html');\n addPage('mouseTrackerPage', 'mousePositionTracker.html');\n addPage('nestedPage', 'nestedElements.html');\n addPage('readOnlyPage', 'readOnlyPage.html');\n addPage('rectanglesPage', 'rectangles.html');\n addPage('redirectPage', 'redirect');\n addPage('resultPage', 'resultPage.html');\n addPage('richTextPage', 'rich_text.html');\n addPage('selectableItemsPage', 'selectableItems.html');\n addPage('selectPage', 'selectPage.html');\n addPage('simpleTestPage', 'simpleTest.html');\n addPage('simpleXmlDocument', 'simple.xml');\n addPage('sleepingPage', 'sleep');\n addPage('slowIframes', 'slow_loading_iframes.html');\n addPage('slowLoadingAlertPage', 'slowLoadingAlert.html');\n addPage('svgPage', 'svgPiechart.xhtml');\n addPage('tables', 'tables.html');\n addPage('underscorePage', 'underscore.html');\n addPage('unicodeLtrPage', 'utf8/unicode_ltr.html');\n addPage('uploadPage', 'upload.html');\n addPage('veryLargeCanvas', 'veryLargeCanvas.html');\n addPage('xhtmlTestPage', 'xhtmlTest.html');\n\n return pages;\n})();\n\n\nvar Path = {\n BASIC_AUTH: WEB_ROOT + '/basicAuth',\n ECHO: WEB_ROOT + '/echo',\n GENERATED: WEB_ROOT + '/generated',\n MANIFEST: WEB_ROOT + '/manifest',\n REDIRECT: WEB_ROOT + '/redirect',\n PAGE: WEB_ROOT + '/page',\n SLEEP: WEB_ROOT + '/sleep',\n UPLOAD: WEB_ROOT + '/upload'\n};\n\nvar app = express();\n\napp.get('/', sendIndex)\n.get('/favicon.ico', function(req, res) {\n res.writeHead(204);\n res.end();\n})\n.use(JS_ROOT, serveIndex(jsDirectory), express.static(jsDirectory))\n.post(Path.UPLOAD, handleUpload)\n.use(WEB_ROOT, serveIndex(baseDirectory), express.static(baseDirectory))\n.get(Path.ECHO, sendEcho)\n.get(Path.PAGE, sendInifinitePage)\n.get(Path.PAGE + '/*', sendInifinitePage)\n.get(Path.REDIRECT, redirectToResultPage)\n.get(Path.SLEEP, sendDelayedResponse)\n\nif (isDevMode) {\n var closureDir = resources.locate('third_party/closure/goog');\n app.use('/third_party/closure/goog',\n serveIndex(closureDir), express.static(closureDir));\n}\nvar server = new Server(app);\n\n\nfunction redirectToResultPage(_, response) {\n response.writeHead(303, {\n Location: Pages.resultPage\n });\n return response.end();\n}\n\n\nfunction sendInifinitePage(request, response) {\n var pathname = url.parse(request.url).pathname;\n var lastIndex = pathname.lastIndexOf('/');\n var pageNumber =\n (lastIndex == -1 ? 'Unknown' : pathname.substring(lastIndex + 1));\n var body = [\n '',\n 'Page', pageNumber, '',\n 'Page number ', pageNumber, '',\n '

top'\n ].join('');\n response.writeHead(200, {\n 'Content-Length': Buffer.byteLength(body, 'utf8'),\n 'Content-Type': 'text/html; charset=utf-8'\n });\n response.end(body);\n}\n\n\nfunction sendDelayedResponse(request, response) {\n var duration = 0;\n var query = url.parse(request.url).query || '';\n var match = query.match(/\\btime=(\\d+)/);\n if (match) {\n duration = parseInt(match[1], 10);\n }\n\n setTimeout(function() {\n var body = [\n '',\n 'Done',\n 'Slept for ', duration, 's'\n ].join('');\n response.writeHead(200, {\n 'Content-Length': Buffer.byteLength(body, 'utf8'),\n 'Content-Type': 'text/html; charset=utf-8',\n 'Cache-Control': 'no-cache',\n 'Pragma': 'no-cache',\n 'Expires': 0\n });\n response.end(body);\n }, duration * 1000);\n}\n\n\nfunction handleUpload(request, response, next) {\n multer({\n inMemory: true,\n onFileUploadComplete: function(file) {\n response.writeHead(200);\n response.write(file.buffer);\n response.end('');\n }\n })(request, response, function() {});\n}\n\n\nfunction sendEcho(request, response) {\n var body = [\n '',\n 'Echo',\n '

',\n request.method, ' ', request.url, ' ', 'HTTP/', request.httpVersion,\n '
'\n ];\n for (var name in request.headers) {\n body.push('
',\n name, ': ', request.headers[name], '
');\n }\n body = body.join('');\n response.writeHead(200, {\n 'Content-Length': Buffer.byteLength(body, 'utf8'),\n 'Content-Type': 'text/html; charset=utf-8'\n });\n response.end(body);\n}\n\n\n/**\n * Responds to a request for the file server's main index.\n * @param {!http.ServerRequest} request The request object.\n * @param {!http.ServerResponse} response The response object.\n */\nfunction sendIndex(request, response) {\n var pathname = url.parse(request.url).pathname;\n\n var host = request.headers.host;\n if (!host) {\n host = server.host();\n }\n\n var requestUrl = ['http://' + host + pathname].join('');\n\n function createListEntry(path) {\n var url = requestUrl + path;\n return ['
  • ', path, ''].join('');\n }\n\n var data = ['

    /


      ',\n createListEntry('common')];\n if (isDevMode) {\n data.push(createListEntry('javascript'));\n }\n data.push('
    ');\n data = data.join('');\n\n response.writeHead(200, {\n 'Content-Type': 'text/html; charset=UTF-8',\n 'Content-Length': Buffer.byteLength(data, 'utf8')\n });\n response.end(data);\n}\n\n\n// PUBLIC application\n\n\n/**\n * Starts the server on the specified port.\n * @param {number=} opt_port The port to use, or 0 for any free port.\n * @return {!webdriver.promise.Promise.} A promise that will resolve\n * with the server host when it has fully started.\n */\nexports.start = server.start.bind(server);\n\n\n/**\n * Stops the server.\n * @return {!webdriver.promise.Promise} A promise that will resolve when the\n * server has closed all connections.\n */\nexports.stop = server.stop.bind(server);\n\n\n/**\n * Formats a URL for this server.\n * @param {string=} opt_pathname The desired pathname on the server.\n * @return {string} The formatted URL.\n * @throws {Error} If the server is not running.\n */\nexports.url = server.url.bind(server);\n\n\n/**\n * Builds the URL for a file in the //common/src/web directory of the\n * Selenium client.\n * @param {string} filePath A path relative to //common/src/web to compute a\n * URL for.\n * @return {string} The formatted URL.\n * @throws {Error} If the server is not running.\n */\nexports.whereIs = function(filePath) {\n filePath = filePath.replace(/\\\\/g, '/');\n if (!string.startsWith(filePath, '/')) {\n filePath = '/' + filePath;\n }\n return server.url(WEB_ROOT + filePath);\n};\n\n\nexports.Pages = Pages;\n\n\nif (require.main === module) {\n server.start(2310).then(function() {\n console.log('Server running at ' + server.url());\n });\n}\n"} +{"text": "require 'spec_helper'\n\ndescribe Bogus::OverwrittenClasses do\n let(:overwritten_classes) { Bogus::OverwrittenClasses.new }\n\n let(:klass) { Class.new }\n\n it \"adds classes\" do\n overwritten_classes.add(\"Foo::Bar\", klass)\n overwritten_classes.add(\"Baz::Bam\", klass)\n\n expect(overwritten_classes.classes).to eq [[\"Foo::Bar\", klass],\n [\"Baz::Bam\", klass]]\n end\n\n it \"clears overwritten classes\" do\n overwritten_classes.add(\"Foo::Bar\", klass)\n overwritten_classes.add(\"Baz::Bam\", klass)\n overwritten_classes.clear\n\n expect(overwritten_classes.classes).to eq []\n end\n\n it \"returns an empty array with no classes\" do\n expect(overwritten_classes.classes).to eq []\n end\nend\n"} +{"text": " {\n test('should insert element after the charset declaration', () => {\n const doc = window.document.implementation.createHTMLDocument()\n doc.head.innerHTML = `\n \n \n `\n\n setContentSecurityPolicy(doc, csp)\n\n const element = doc.head.children[1]\n expect(element.tagName).toMatch(/meta/i)\n expect(element.getAttribute('http-equiv')).toEqual('Content-Security-Policy')\n expect(element.getAttribute('content')).toEqual(csp)\n })\n\n test('should replace existing CSPs', () => {\n const doc = window.document.implementation.createHTMLDocument()\n doc.head.innerHTML = `\n \n \n `\n\n setContentSecurityPolicy(doc, csp)\n\n expect(doc.querySelectorAll('meta').length).toEqual(1)\n expect(doc.querySelector('meta').content).toEqual(csp)\n })\n\n test('should remove URL-containing attributes coming before the CSP', () => {\n const doc = window.document.implementation.createHTMLDocument()\n doc.documentElement.setAttribute('manifest', '/manifest.appcache')\n doc.head.setAttribute('profile', 'http://some-profile-uri-whatever-that-means')\n\n setContentSecurityPolicy(doc, csp)\n\n expect(doc.documentElement.hasAttribute('manifest')).toEqual(false)\n expect(doc.head.hasAttribute('profile')).toEqual(false)\n })\n})\n"} +{"text": "package zerolog\n\nimport (\n\t\"net\"\n\t\"time\"\n)\n\ntype encoder interface {\n\tAppendArrayDelim(dst []byte) []byte\n\tAppendArrayEnd(dst []byte) []byte\n\tAppendArrayStart(dst []byte) []byte\n\tAppendBeginMarker(dst []byte) []byte\n\tAppendBool(dst []byte, val bool) []byte\n\tAppendBools(dst []byte, vals []bool) []byte\n\tAppendBytes(dst, s []byte) []byte\n\tAppendDuration(dst []byte, d time.Duration, unit time.Duration, useInt bool) []byte\n\tAppendDurations(dst []byte, vals []time.Duration, unit time.Duration, useInt bool) []byte\n\tAppendEndMarker(dst []byte) []byte\n\tAppendFloat32(dst []byte, val float32) []byte\n\tAppendFloat64(dst []byte, val float64) []byte\n\tAppendFloats32(dst []byte, vals []float32) []byte\n\tAppendFloats64(dst []byte, vals []float64) []byte\n\tAppendHex(dst, s []byte) []byte\n\tAppendIPAddr(dst []byte, ip net.IP) []byte\n\tAppendIPPrefix(dst []byte, pfx net.IPNet) []byte\n\tAppendInt(dst []byte, val int) []byte\n\tAppendInt16(dst []byte, val int16) []byte\n\tAppendInt32(dst []byte, val int32) []byte\n\tAppendInt64(dst []byte, val int64) []byte\n\tAppendInt8(dst []byte, val int8) []byte\n\tAppendInterface(dst []byte, i interface{}) []byte\n\tAppendInts(dst []byte, vals []int) []byte\n\tAppendInts16(dst []byte, vals []int16) []byte\n\tAppendInts32(dst []byte, vals []int32) []byte\n\tAppendInts64(dst []byte, vals []int64) []byte\n\tAppendInts8(dst []byte, vals []int8) []byte\n\tAppendKey(dst []byte, key string) []byte\n\tAppendLineBreak(dst []byte) []byte\n\tAppendMACAddr(dst []byte, ha net.HardwareAddr) []byte\n\tAppendNil(dst []byte) []byte\n\tAppendObjectData(dst []byte, o []byte) []byte\n\tAppendString(dst []byte, s string) []byte\n\tAppendStrings(dst []byte, vals []string) []byte\n\tAppendTime(dst []byte, t time.Time, format string) []byte\n\tAppendTimes(dst []byte, vals []time.Time, format string) []byte\n\tAppendUint(dst []byte, val uint) []byte\n\tAppendUint16(dst []byte, val uint16) []byte\n\tAppendUint32(dst []byte, val uint32) []byte\n\tAppendUint64(dst []byte, val uint64) []byte\n\tAppendUint8(dst []byte, val uint8) []byte\n\tAppendUints(dst []byte, vals []uint) []byte\n\tAppendUints16(dst []byte, vals []uint16) []byte\n\tAppendUints32(dst []byte, vals []uint32) []byte\n\tAppendUints64(dst []byte, vals []uint64) []byte\n\tAppendUints8(dst []byte, vals []uint8) []byte\n}\n"} +{"text": "\n Introduction To The CoNLL-2000 Shared Task: Chunking\n \n
    \n Text chunking is a useful preprocessing step for parsing.\n There has been a large interest in recognizing non-overlapping noun phrases (Ramshaw and Marcus (1995) and follow-up papers) but relatively little has been written about identifying phrases of other syntactic categories.\n The CoNLL-2000 shared task attempts to fill this gap.\n
    \n
    \n Text chunking consists of dividing a text into phrases in such a way that syntactically related words become member of the same phrase.\n These phrases are non-overlapping which means that one word can only be a member of one chunk Here is an example sentence: [NP He ] [vp reckons ] [NP the current account deficit] [vp will narrow] [pp to [NP only 1.8 billion] [pp in] [NP September] .\n Chunks have been represented as groups of words between square brackets.\n A tag next to the open bracket denotes the type of the chunk.\n As far as we know, there are no annotated corpora available which contain specific information about dividing sentences into chunks of words of arbitrary types.\n We have chosen to work with a corpus with parse information, the Wall Street Journal WSJ part of the Penn Treebank II corpus (Marcus et al., 1993), and to extract chunk information from the parse trees in this corpus.\n We will give a global description of the various chunk types in the next section.\n
    \n
    \n The chunk types are based on the syntactic category part (i.e. without function tag) of the bracket label in the Treebank (cf.\n Bies (1995) p.35).\n Roughly, a chunk contains everything to the left of and including the syntactic head of the constituent of the same name.\n Some Treebank constituents do not have related chunks.\n The head of S (simple declarative clause) for example is normally thought to be the verb, but as the verb is already part of the VP chunk, no S chunk exists in our example sentence.\n Besides the head, a chunk also contains premodifiers (like determiners and adjectives in NPs), but no postmodifiers or arguments.\n This is why the PP chunk only contains the preposition, and not the argument NP, and the SBAR chunk consists of only the complementizer.\n There are several difficulties when converting trees into chunks.\n In the most simple case, a chunk is just a syntactic constituent without any further embedded constituents, like the NPs in our examples.\n In some cases, the chunk contains only what is left after other chunks have been removed from the constituent, cf.\n &quot;(VP loves (NP Mary))&quot; above, or ADJPs and PPs below.\n We will discuss some special cases during the following description of the individual chunk types.\n Our NP chunks are very similar to the ones of Ramshaw and Marcus (1995).\n Specifically, possessive NP constructions are split in front of the possessive marker (e.g.\n [NP Eastern Airlines] [NP creditors]) and the handling of coordinated NPs follows the Treebank annotators.\n However, as Ramshaw and Marcus do not describe the details of their conversion algorithm, results may differ in difficult cases, e.g. involving NAC and NX.1 An ADJP constituent inside an NP constituent becomes part of the NP chunk: (NP The (ADJP most volatile) form) [NP the most volatile form] In the Treebank, verb phrases are highly embedded; see e.g. the following sentence which contains four VP constituents.\n Following Ramshaw and Marcus' V-type chunks, this sentence will only contain one VP chunk: ((S (NP-SBJ-3 Mr. Icahn) (VP may not (VP want (S (NP-SBJ *-3) (VP to (VP sell ...))))) . ))\n [NP Mr. Icahn] [vp may not want to sell] It is still possible however to have one VP chunk directly follow another: [NP The impression [NP I] [vp have got] [vp is] [NP they] [vp 'd love to do] [PRT away] [pp with] [NP it].\n In this case the two VP constituents did not overlap in the Treebank.\n Adverbs/adverbial phrases become part of the VP chunk (as long as they are in front of the main verb): (VP could (ADVP very well) (VP show ... )) [vp could very well show] In contrast to Ramshaw and Marcus (1995), predicative adjectives of the verb are not part of the VP chunk, e.g. in &quot;[NP they [vp are 1 [paw unhappy ]&quot;.\n In inverted sentences, the auxiliary verb is not part of any verb phrase in the Treebank.\n Consequently it does not belong to any VP chunk: (NP-SBJ *-1) (VP to (VP be (ADJPPRD excellent)))))) , but ... [CONJP Not only ] does [NP your product [vp have to be [ADJP excellent , but ... ADVP chunks mostly correspond to ADVP constituents in the Treebank.\n However, ADVPs inside ADJPs or inside VPs if in front of the main verb are assimilated into the ADJP respectively VP chunk.\n On the other hand, ADVPs that contain an NP make two chunks: (ADVP-TMP (NP a year) earlier) [NP a year] [ADVP earlier] ADJPs inside NPs are assimilated into the NP.\n And parallel to ADVPs, ADJPs that contain an NP make two chunks: (ADJP-PRD (NP 68 years) old) [NP 68 years] [ADJP old] It would be interesting to see how changing these decisions (as can be done in the Treebank-to-chunk conversion script2) influences the chunking task.\n Most PP chunks just consist of one word (the preposition) with the part-of-speech tag IN.\n This does not mean, though, that finding PP chunks is completely trivial.\n INs can also constitute an SBAR chunk (see below) and some PP chunks contain more than one word.\n This is the case with fixed multi-word prepositions such as such as, because of, due to, with prepositions preceded by a modifier: well above, just after, even in, particularly among or with coordinated prepositions: inside and outside.\n We think that PPs behave sufficiently differently from NPs in a sentence for not wanting to group them into one class (as Ramshaw and Marcus did in their N-type chunks), and that on the other hand tagging all NP chunks inside a PP as I-PP would only confuse the chunker.\n We therefore chose not to handle the recognition of true PPs (prep.+NP) during this first chunking step.\n SBAR chunks mostly consist of one word (the complementizer) with the part-of-speech tag IN, but like multi-word prepositions, there are also multi-word complementizers: even though, so that, just as, even if, as if, only if.\n Conjunctions can consist of more than one word as well: as well as, instead of, rather than, not only, but also.\n One-word conjunctions (like and, or) are not annotated as CONJP in the Treebank, and are consequently no CONJP chunks in our data.\n The Treebank uses the PRT constituent to annotate verb particles, and our PRT chunk does the same.\n The only multi-word particle is on and off This chunk type should be easy to recognize as it should coincide with the partof-speech tag RP, but through tagging errors it is sometimes also assigned IN (preposition) or RB (adverb).\n INTJ is an interjection phrase/chunk like no, oh, hello, alas, good grief!.\n It is quite rare.\n The list marker LST is even rarer.\n Examples are 1., 2., 3., first, second, a, b, c. It might consist of two words: the number and the period.\n The UCP chunk is reminiscent of the UCP (unlike coordinated phrase) constituent in the Treebank.\n Arguably, the conjunction is the head of the UCP, so most UCP chunks consist of conjunctions like and and or.\n UCPs are the rarest chunks and are probably not very useful for other NLP tasks.\n Tokens outside any chunk are mostly punctuation signs and the conjunctions in ordinary coordinated phrases.\n The word not may also be outside of any chunk.\n This happens in two cases: Either not is not inside the VP constituent in the Treebank annotation e.g. in ... (VP have (VP told (NP-1 clients) (S (NP-SBJ *-1) not (VP to (VP ship (NP anything)))))) or not is not followed by another verb (because the main verb is a form of to be).\n As the right chunk boundary is defined by the chunk's head, i.e. the main verb in this case, not is then in fact a postmodifier and as such not included in the chunk: &quot;... [SBAR that ] [NP there ] [vp were ] n't [NP any major problems] .&quot; All chunks were automatically extracted from the parsed version of the Treebank, guided by the tree structure, the syntactic constituent labels, the part-of-speech tags and by knowledge about which tags can be heads of which constituents.\n However, some trees are very complex and some annotations are inconsistent.\n What to think about a VP in which the main verb is tagged as NN (common noun)?\n Either we allow NNs as heads of VPs (not very elegant but which is what we did) or we have a VP without a head.\n The first solution might also introduce errors elsewhere... As Ramshaw and Marcus (1995) already noted: &quot;While this automatic derivation process introduced a small percentage of errors on its own, it was the only practical way both to provide the amount of training data required and to allow for fully-automatic testing.&quot;\n
    \n
    \n For the CoNLL shared task, we have chosen to work with the same sections of the Penn Treebank as the widely used data set for base noun phrase recognition (Ramshaw and Marcus, 1995): WSJ sections 15-18 of the Penn Treebank as training material and section 20 as test materia13.\n The chunks in the data were selected to match the descriptions in the previous section.\n An overview of the chunk types in the training data can be found in table 1.\n De data sets contain tokens (words and punctuation marks), information about the location of sentence boundaries and information about chunk boundaries.\n Additionally, a partof-speech (POS) tag was assigned to each token by a standard POS tagger (Brill (1994) trained on the Penn Treebank).\n We used these POS tags rather than the Treebank ones in order to make sure that the performance rates obtained for this data are realistic estimates for data for which no treebank POS tags are available.\n In our example sentence in section 2, we have used brackets for encoding text chunks.\n In the data sets we have represented chunks with three types of tags: B-X first word of a chunk of type X I-X non-initial word in an X chunk 0 word outside of any chunk This representation type is based on a representation proposed by Ramshaw and Marcus (1995) for noun phrase chunks.\n The three tag groups are sufficient for encoding the chunks in the data since these are non-overlapping.\n Using these chunk tags makes it possible to approach the chunking task as a word classification task.\n We can use chunk tags for representing our example sentence in the following way: The output of a chunk recognizer may contain inconsistencies in the chunk tags in case a word tagged I-X follows a word tagged 0 or I-Y, with X and Y being different.\n These inconsistencies can be resolved by assuming that such I-X tags start a new chunk.\n The performance on this task is measured with three rates.\n First, the percentage of detected phrases that are correct (precision).\n Second, the percentage of phrases in the data that were found by the chunker (recall).\n And third, the Fo=1 rate which is equal to (132+1)*precision*recall / (02*precision+recall) with 0.1 (van Rijsbergen, 1975).\n The latter rate has been used as the target for optimization4.\n
    \n
    \n The eleven systems that have been applied to the CoNLL-2000 shared task can be divided in four groups: Vilain and Day (2000) approached the shared task in three different ways.\n The most successful was an application of the Alembic parser which uses transformation-based rules.\n Johansson (2000) uses context-sensitive and contextfree rules for transforming part-of-speech (POS) tag sequences to chunk tag sequences.\n Dejean (2000) has applied the theory refinement system ALLiS to the shared task.\n In order to obtain a system which could process XML formatted data while using context information, he has used three extra tools.\n Veenstra and Van den Bosch (2000) examined different parameter settings of a memory-based learning algorithm.\n They found that modified value difference metric applied to POS information only worked best.\n A large number of the systems applied to the CoNLL-2000 shared task uses statistical methods.\n Pla, Molina and Prieto (2000) use a finite-state version of Markov Models.\n They started with using POS information only and obtained a better performance when lexical information was used.\n Zhou, Tey and Su (2000) implemented a chunk tagger based on HMMs.\n The initial performance of the tagger was improved by a post-process correction method based on error driven learning and by incorporating chunk probabilities generated by a memory-based learning process.\n The two other statistical systems use maximum-entropy based methods.\n Osborne (2000) trained Ratnaparkhi's maximum-entropy POS tagger to output chunk tags.\n Koeling (2000) used a standard maximum-entropy learner for generating chunk tags from words and POS tags.\n Both have tested different feature combinations before finding an optimal one and their final results are close to each other.\n Three systems use system combination.\n Tjong Kim Sang (2000) trained and tested five memory-based learning systems to produce different representations of the chunk tags.\n A combination of the five by majority voting performed better than the individual parts.\n Van Halteren (2000) used Weighted Probability Distribution Voting (WPDV) for combining the results of four WPDV chunk taggers and a memory-based chunk tagger.\n Again the combination outperformed the individual systems.\n Kudoh and Matsumoto (2000) created 231 support vector machine classifiers to predict the unique pairs of chunk tags.\n The results of the classifiers were combined by a dynamic programming algorithm.\n The performance of the systems can be found in Table 2.\n A baseline performance was obtained by selecting the chunk tag most frequently associated with a POS tag.\n All systems outperform the baseline.\n The majority of the systems reached an Fo=1 score between 91.50 and 92.50.\n Two approaches performed a lot better: the combination system WPDV used by Van Halteren and the Support Vector Machines used by Kudoh and Matsumoto.\n
    \n
    \n In the early nineties, Abney (1991) proposed to approach parsing by starting with finding related chunks of words.\n By then, Church (1988) had already reported on recognition of base noun phrases with statistical methods.\n Ramshaw and Marcus (1995) approached chunking by using a machine learning method.\n Their work has inspired many others to study the application of learning methods to noun phrase chunking5.\n Other chunk types have not received the same attention as NP chunks.\n The most complete work is Buchholz et al. (1999), which presents results for NP, VP, PP, ADJP and ADVP chunks.\n Veenstra (1999) works with NP, VP and PP chunks.\n Both he and Buchholz et al. use data generated by the script that produced the CoNLL-2000 shared task data sets.\n Ratnaparkhi (1998) has recognized arbitrary chunks as part of a parsing task but did not report on the chunking performance.\n Part of the Sparkle project has concentrated on finding various sorts of chunks for the different languages 'An elaborate overview of the work done on noun phrase chunking can be found on http://lcg-www.uia. ac.bererikt/research/np-chunking.html (Carroll et al., 1997).\n
    \n
    \n We have presented an introduction to the CoNLL-2000 shared task: dividing text into syntactically related non-overlapping groups of words, so-called text chunking.\n For this task we have generated training and test data from the Penn Treebank.\n This data has been processed by eleven systems.\n The best performing system was a combination of Support Vector Machines submitted by Taku Kudoh and Yuji Matsumoto.\n It obtained an Fo=1 score of 93.48 on this task.\n
    \n
    \n We would like to thank the members of the CNTS - Language Technology Group in Antwerp, Belgium and the members of the ILK group in Tilburg, The Netherlands for valuable discussions and comments.\n Tjong Kim Sang is funded by the European TMR network Learning Computational Grammars.\n Buchholz is supported by the Netherlands Organization for Scientific Research (NWO).\n
    \n
    \n"} +{"text": "/********************************************* \r\n作者:曹旭升 \r\nQQ:279060597\r\n访问博客了解详细介绍及更多内容: \r\nhttp://blog.shengxunwei.com\r\n**********************************************/\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Text;\r\nusing Microsoft.Practices.EnterpriseLibrary.Configuration.Design;\r\nusing Microsoft.Practices.EnterpriseLibrary.Common.Configuration;\r\nusing Microsoft.Practices.EnterpriseLibrary.Configuration.Design.Properties;\r\nnamespace Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.Design\r\n{\r\n\tsealed class ExceptionHandlingSettingsBuilder \r\n\t{\r\n\t\tprivate ExceptionHandlingSettingsNode exceptionHandlingSettingsNode;\r\n\t\tprivate IConfigurationUIHierarchy hierarchy;\r\n\t\tprivate ExceptionHandlingSettings exceptionHandlingSettings;\r\n\t\tpublic ExceptionHandlingSettingsBuilder(IServiceProvider serviceProvider, ExceptionHandlingSettingsNode exceptionHandlingSettingsNode) \r\n\t\t{\r\n\t\t\tthis.exceptionHandlingSettingsNode = exceptionHandlingSettingsNode;\r\n\t\t\thierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider);\r\n\t\t}\r\n\t\tpublic ExceptionHandlingSettings Build()\r\n\t\t{\r\n\t\t\texceptionHandlingSettings = new ExceptionHandlingSettings();\r\n\t\t\tif (!this.exceptionHandlingSettingsNode.RequirePermission)\t\r\n\t\t\t\texceptionHandlingSettings.SectionInformation.RequirePermission = this.exceptionHandlingSettingsNode.RequirePermission;\r\n\t\t\tBuildPolicies();\r\n\t\t\treturn exceptionHandlingSettings;\r\n\t\t}\r\n\t\tprivate void BuildPolicies()\r\n\t\t{\r\n\t\t\tIList policies = hierarchy.FindNodesByType(exceptionHandlingSettingsNode, typeof(ExceptionPolicyNode));\r\n\t\t\tforeach (ConfigurationNode policyNode in policies)\r\n\t\t\t{\r\n\t\t\t\texceptionHandlingSettings.ExceptionPolicies.Add(CreateExceptionPolicyData((ExceptionPolicyNode)policyNode));\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\tprivate ExceptionPolicyData CreateExceptionPolicyData(ExceptionPolicyNode policyNode)\r\n\t\t{\r\n\t\t\tExceptionPolicyData policyData = new ExceptionPolicyData(policyNode.Name);\t\t\t\t\t\t\r\n\t\t\tIList exceptionTypes = hierarchy.FindNodesByType(policyNode, typeof(ExceptionTypeNode));\r\n\t\t\tforeach (ConfigurationNode exceptionTypeNode in exceptionTypes)\r\n\t\t\t{\r\n\t\t\t\tpolicyData.ExceptionTypes.Add(CreateExceptionTypeData((ExceptionTypeNode)exceptionTypeNode));\r\n\t\t\t}\r\n\t\t\treturn policyData;\r\n\t\t}\r\n\t\tprivate static ExceptionTypeData CreateExceptionTypeData(ExceptionTypeNode exceptionTypeNode)\r\n\t\t{\r\n\t\t\tExceptionTypeData exceptionTypeData = new ExceptionTypeData(exceptionTypeNode.Name, exceptionTypeNode.Type, exceptionTypeNode.PostHandlingAction);\t\t\t\r\n\t\t\tforeach (ConfigurationNode exceptionHandlerNode in exceptionTypeNode.Nodes)\r\n\t\t\t{\r\n\t\t\t\texceptionTypeData.ExceptionHandlers.Add(((ExceptionHandlerNode)exceptionHandlerNode).ExceptionHandlerData);\r\n\t\t\t}\r\n\t\t\treturn exceptionTypeData;\r\n\t\t}\r\n\t}\r\n}\r\n"} +{"text": "//\n// TaskNotification.cpp\n//\n// $Id: //poco/1.4/Foundation/src/TaskNotification.cpp#1 $\n//\n// Library: Foundation\n// Package: Tasks\n// Module: Tasks\n//\n// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.\n// and Contributors.\n//\n// SPDX-License-Identifier:\tBSL-1.0\n//\n\n\n#include \"Poco/TaskNotification.h\"\n\n\nnamespace Poco {\n\n\nTaskNotification::TaskNotification(Task* pTask):\n\t_pTask(pTask)\n{\n\tif (_pTask) _pTask->duplicate();\n}\n\n\nTaskNotification::~TaskNotification()\n{\n\tif (_pTask) _pTask->release();\n}\n\n\nTaskStartedNotification::TaskStartedNotification(Task* pTask):\n\tTaskNotification(pTask)\n{\n}\n\n\t\nTaskStartedNotification::~TaskStartedNotification()\n{\n}\n\n\nTaskCancelledNotification::TaskCancelledNotification(Task* pTask):\n\tTaskNotification(pTask)\n{\n}\n\n\t\nTaskCancelledNotification::~TaskCancelledNotification()\n{\n}\n\n\nTaskFinishedNotification::TaskFinishedNotification(Task* pTask):\n\tTaskNotification(pTask)\n{\n}\n\n\t\nTaskFinishedNotification::~TaskFinishedNotification()\n{\n}\n\n\nTaskFailedNotification::TaskFailedNotification(Task* pTask, const Exception& exc):\n\tTaskNotification(pTask),\n\t_pException(exc.clone())\n{\n}\n\n\t\nTaskFailedNotification::~TaskFailedNotification()\n{\n\tdelete _pException;\n}\n\n\nTaskProgressNotification::TaskProgressNotification(Task* pTask, float progress):\n\tTaskNotification(pTask),\n\t_progress(progress)\n{\n}\n\n\t\nTaskProgressNotification::~TaskProgressNotification()\n{\n}\n\n\n} // namespace Poco\n"} +{"text": "\n\n \n \n\n\n"} +{"text": "app['auth']->viaRequest('api', function ($request) {\n if ($request->input('api_token')) {\n return User::where('api_token', $request->input('api_token'))->first();\n }\n });\n }\n}\n"} +{"text": "{ Filter = {\n Executables = (\"BTAvrcp\", \"backboardd\" );\n Bundles = ( \"com.apple.springboard\", \"com.apple.music\" );\n Mode = \"Any\";\n}; }"} +{"text": "package com.songwenju.customtvrecyclerview.adapter;\n\nimport android.content.Context;\nimport android.support.annotation.NonNull;\nimport android.support.v7.widget.RecyclerView;\nimport android.view.View;\nimport android.widget.RelativeLayout;\nimport android.widget.TextView;\n\nimport com.songwenju.customtvrecyclerview.widget.CustomRecyclerView;\nimport com.songwenju.customtvrecyclerview.R;\nimport com.songwenju.customtvrecyclerview.util.SpUtil;\n\nimport java.util.List;\n\n/**\n * songwenju on 16-12-23 : 10 : 13.\n * 邮箱:songwenju@outlook.com\n */\n\npublic class PopRecyclerAdapter extends CustomRecyclerView.CustomAdapter {\n\n public PopRecyclerAdapter(Context context, List data) {\n super(context, data);\n }\n\n @Override\n protected RecyclerView.ViewHolder onSetViewHolder(View view) {\n return new PopViewHolder(view);\n }\n\n @NonNull\n @Override\n protected int onSetItemLayout() {\n return R.layout.list_menu_popwindow_item;\n }\n\n @Override\n protected void onSetItemData(RecyclerView.ViewHolder viewHolder, int position) {\n PopViewHolder holder = (PopViewHolder) viewHolder;\n holder.tvItem.setText(mData.get(position));\n if (position == SpUtil.getInt(Constants.CATEGORY_POP_SELECT_POSITION, -1)) {\n holder.tvItem.setTextColor(mContext.getResources().getColor(R.color.orange));\n } else {\n holder.tvItem.setTextColor(mContext.getResources().getColor(R.color.common_white));\n }\n }\n\n @Override\n protected void onItemFocus(View itemView, int position) {\n RelativeLayout layout = (RelativeLayout) itemView.findViewById(R.id.item_contain);\n layout.setBackgroundResource(R.drawable.pop_item_focus_drawable);\n\n TextView itemText = (TextView) itemView.findViewById(R.id.tv_item);\n itemText.setTextColor(mContext.getResources().getColor(R.color.common_white));\n }\n\n @Override\n protected void onItemGetNormal(View itemView, int position) {\n RelativeLayout layout = (RelativeLayout) itemView.findViewById(R.id.item_contain);\n layout.setBackgroundResource(R.drawable.pop_item_unfocus_drawable);\n if (position == SpUtil.getInt(Constants.CATEGORY_POP_SELECT_POSITION, -1)) {\n TextView itemText = (TextView) itemView.findViewById(R.id.tv_item);\n itemText.setTextColor(mContext.getResources().getColor(R.color.orange));\n }\n }\n\n @Override\n protected int getCount() {\n return mData.size();\n }\n\n private class PopViewHolder extends RecyclerView.ViewHolder {\n\n TextView tvItem;\n\n public PopViewHolder(View itemView) {\n super(itemView);\n tvItem = (TextView) itemView.findViewById(R.id.tv_item);\n }\n }\n}\n"} +{"text": "/**\n* bootstrap.js v3.0.0 by @fat and @mdo\n* Copyright 2013 Twitter Inc.\n* http://www.apache.org/licenses/LICENSE-2.0\n*/\nif (!jQuery) { throw new Error(\"Bootstrap requires jQuery\") }\n\n/* ========================================================================\n * Bootstrap: transition.js v3.0.0\n * http://twbs.github.com/bootstrap/javascript.html#transitions\n * ========================================================================\n * Copyright 2013 Twitter, 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+function ($) { \"use strict\";\n\n // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)\n // ============================================================\n\n function transitionEnd() {\n var el = document.createElement('bootstrap')\n\n var transEndEventNames = {\n 'WebkitTransition' : 'webkitTransitionEnd'\n , 'MozTransition' : 'transitionend'\n , 'OTransition' : 'oTransitionEnd otransitionend'\n , 'transition' : 'transitionend'\n }\n\n for (var name in transEndEventNames) {\n if (el.style[name] !== undefined) {\n return { end: transEndEventNames[name] }\n }\n }\n }\n\n // http://blog.alexmaccaw.com/css-transitions\n $.fn.emulateTransitionEnd = function (duration) {\n var called = false, $el = this\n $(this).one($.support.transition.end, function () { called = true })\n var callback = function () { if (!called) $($el).trigger($.support.transition.end) }\n setTimeout(callback, duration)\n return this\n }\n\n $(function () {\n $.support.transition = transitionEnd()\n })\n\n}(window.jQuery);\n\n/* ========================================================================\n * Bootstrap: alert.js v3.0.0\n * http://twbs.github.com/bootstrap/javascript.html#alerts\n * ========================================================================\n * Copyright 2013 Twitter, 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+function ($) { \"use strict\";\n\n // ALERT CLASS DEFINITION\n // ======================\n\n var dismiss = '[data-dismiss=\"alert\"]'\n var Alert = function (el) {\n $(el).on('click', dismiss, this.close)\n }\n\n Alert.prototype.close = function (e) {\n var $this = $(this)\n var selector = $this.attr('data-target')\n\n if (!selector) {\n selector = $this.attr('href')\n selector = selector && selector.replace(/.*(?=#[^\\s]*$)/, '') // strip for ie7\n }\n\n var $parent = $(selector)\n\n if (e) e.preventDefault()\n\n if (!$parent.length) {\n $parent = $this.hasClass('alert') ? $this : $this.parent()\n }\n\n $parent.trigger(e = $.Event('close.bs.alert'))\n\n if (e.isDefaultPrevented()) return\n\n $parent.removeClass('in')\n\n function removeElement() {\n $parent.trigger('closed.bs.alert').remove()\n }\n\n $.support.transition && $parent.hasClass('fade') ?\n $parent\n .one($.support.transition.end, removeElement)\n .emulateTransitionEnd(150) :\n removeElement()\n }\n\n\n // ALERT PLUGIN DEFINITION\n // =======================\n\n var old = $.fn.alert\n\n $.fn.alert = function (option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.alert')\n\n if (!data) $this.data('bs.alert', (data = new Alert(this)))\n if (typeof option == 'string') data[option].call($this)\n })\n }\n\n $.fn.alert.Constructor = Alert\n\n\n // ALERT NO CONFLICT\n // =================\n\n $.fn.alert.noConflict = function () {\n $.fn.alert = old\n return this\n }\n\n\n // ALERT DATA-API\n // ==============\n\n $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)\n\n}(window.jQuery);\n\n/* ========================================================================\n * Bootstrap: button.js v3.0.0\n * http://twbs.github.com/bootstrap/javascript.html#buttons\n * ========================================================================\n * Copyright 2013 Twitter, 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+function ($) { \"use strict\";\n\n // BUTTON PUBLIC CLASS DEFINITION\n // ==============================\n\n var Button = function (element, options) {\n this.$element = $(element)\n this.options = $.extend({}, Button.DEFAULTS, options)\n }\n\n Button.DEFAULTS = {\n loadingText: 'loading...'\n }\n\n Button.prototype.setState = function (state) {\n var d = 'disabled'\n var $el = this.$element\n var val = $el.is('input') ? 'val' : 'html'\n var data = $el.data()\n\n state = state + 'Text'\n\n if (!data.resetText) $el.data('resetText', $el[val]())\n\n $el[val](data[state] || this.options[state])\n\n // push to event loop to allow forms to submit\n setTimeout(function () {\n state == 'loadingText' ?\n $el.addClass(d).attr(d, d) :\n $el.removeClass(d).removeAttr(d);\n }, 0)\n }\n\n Button.prototype.toggle = function () {\n var $parent = this.$element.closest('[data-toggle=\"buttons\"]')\n\n if ($parent.length) {\n var $input = this.$element.find('input')\n .prop('checked', !this.$element.hasClass('active'))\n .trigger('change')\n if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active')\n }\n\n this.$element.toggleClass('active')\n }\n\n\n // BUTTON PLUGIN DEFINITION\n // ========================\n\n var old = $.fn.button\n\n $.fn.button = function (option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.button')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.button', (data = new Button(this, options)))\n\n if (option == 'toggle') data.toggle()\n else if (option) data.setState(option)\n })\n }\n\n $.fn.button.Constructor = Button\n\n\n // BUTTON NO CONFLICT\n // ==================\n\n $.fn.button.noConflict = function () {\n $.fn.button = old\n return this\n }\n\n\n // BUTTON DATA-API\n // ===============\n\n $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {\n var $btn = $(e.target)\n if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')\n $btn.button('toggle')\n e.preventDefault()\n })\n\n}(window.jQuery);\n\n/* ========================================================================\n * Bootstrap: carousel.js v3.0.0\n * http://twbs.github.com/bootstrap/javascript.html#carousel\n * ========================================================================\n * Copyright 2012 Twitter, 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+function ($) { \"use strict\";\n\n // CAROUSEL CLASS DEFINITION\n // =========================\n\n var Carousel = function (element, options) {\n this.$element = $(element)\n this.$indicators = this.$element.find('.carousel-indicators')\n this.options = options\n this.paused =\n this.sliding =\n this.interval =\n this.$active =\n this.$items = null\n\n this.options.pause == 'hover' && this.$element\n .on('mouseenter', $.proxy(this.pause, this))\n .on('mouseleave', $.proxy(this.cycle, this))\n }\n\n Carousel.DEFAULTS = {\n interval: 5000\n , pause: 'hover'\n , wrap: true\n }\n\n Carousel.prototype.cycle = function (e) {\n e || (this.paused = false)\n\n this.interval && clearInterval(this.interval)\n\n this.options.interval\n && !this.paused\n && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))\n\n return this\n }\n\n Carousel.prototype.getActiveIndex = function () {\n this.$active = this.$element.find('.item.active')\n this.$items = this.$active.parent().children()\n\n return this.$items.index(this.$active)\n }\n\n Carousel.prototype.to = function (pos) {\n var that = this\n var activeIndex = this.getActiveIndex()\n\n if (pos > (this.$items.length - 1) || pos < 0) return\n\n if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })\n if (activeIndex == pos) return this.pause().cycle()\n\n return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))\n }\n\n Carousel.prototype.pause = function (e) {\n e || (this.paused = true)\n\n if (this.$element.find('.next, .prev').length && $.support.transition.end) {\n this.$element.trigger($.support.transition.end)\n this.cycle(true)\n }\n\n this.interval = clearInterval(this.interval)\n\n return this\n }\n\n Carousel.prototype.next = function () {\n if (this.sliding) return\n return this.slide('next')\n }\n\n Carousel.prototype.prev = function () {\n if (this.sliding) return\n return this.slide('prev')\n }\n\n Carousel.prototype.slide = function (type, next) {\n var $active = this.$element.find('.item.active')\n var $next = next || $active[type]()\n var isCycling = this.interval\n var direction = type == 'next' ? 'left' : 'right'\n var fallback = type == 'next' ? 'first' : 'last'\n var that = this\n\n if (!$next.length) {\n if (!this.options.wrap) return\n $next = this.$element.find('.item')[fallback]()\n }\n\n this.sliding = true\n\n isCycling && this.pause()\n\n var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })\n\n if ($next.hasClass('active')) return\n\n if (this.$indicators.length) {\n this.$indicators.find('.active').removeClass('active')\n this.$element.one('slid', function () {\n var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])\n $nextIndicator && $nextIndicator.addClass('active')\n })\n }\n\n if ($.support.transition && this.$element.hasClass('slide')) {\n this.$element.trigger(e)\n if (e.isDefaultPrevented()) return\n $next.addClass(type)\n $next[0].offsetWidth // force reflow\n $active.addClass(direction)\n $next.addClass(direction)\n $active\n .one($.support.transition.end, function () {\n $next.removeClass([type, direction].join(' ')).addClass('active')\n $active.removeClass(['active', direction].join(' '))\n that.sliding = false\n setTimeout(function () { that.$element.trigger('slid') }, 0)\n })\n .emulateTransitionEnd(600)\n } else {\n this.$element.trigger(e)\n if (e.isDefaultPrevented()) return\n $active.removeClass('active')\n $next.addClass('active')\n this.sliding = false\n this.$element.trigger('slid')\n }\n\n isCycling && this.cycle()\n\n return this\n }\n\n\n // CAROUSEL PLUGIN DEFINITION\n // ==========================\n\n var old = $.fn.carousel\n\n $.fn.carousel = function (option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.carousel')\n var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)\n var action = typeof option == 'string' ? option : options.slide\n\n if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))\n if (typeof option == 'number') data.to(option)\n else if (action) data[action]()\n else if (options.interval) data.pause().cycle()\n })\n }\n\n $.fn.carousel.Constructor = Carousel\n\n\n // CAROUSEL NO CONFLICT\n // ====================\n\n $.fn.carousel.noConflict = function () {\n $.fn.carousel = old\n return this\n }\n\n\n // CAROUSEL DATA-API\n // =================\n\n $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {\n var $this = $(this), href\n var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\\s]+$)/, '')) //strip for ie7\n var options = $.extend({}, $target.data(), $this.data())\n var slideIndex = $this.attr('data-slide-to')\n if (slideIndex) options.interval = false\n\n $target.carousel(options)\n\n if (slideIndex = $this.attr('data-slide-to')) {\n $target.data('bs.carousel').to(slideIndex)\n }\n\n e.preventDefault()\n })\n\n $(window).on('load', function () {\n $('[data-ride=\"carousel\"]').each(function () {\n var $carousel = $(this)\n $carousel.carousel($carousel.data())\n })\n })\n\n}(window.jQuery);\n\n/* ========================================================================\n * Bootstrap: collapse.js v3.0.0\n * http://twbs.github.com/bootstrap/javascript.html#collapse\n * ========================================================================\n * Copyright 2012 Twitter, 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+function ($) { \"use strict\";\n\n // COLLAPSE PUBLIC CLASS DEFINITION\n // ================================\n\n var Collapse = function (element, options) {\n this.$element = $(element)\n this.options = $.extend({}, Collapse.DEFAULTS, options)\n this.transitioning = null\n\n if (this.options.parent) this.$parent = $(this.options.parent)\n if (this.options.toggle) this.toggle()\n }\n\n Collapse.DEFAULTS = {\n toggle: true\n }\n\n Collapse.prototype.dimension = function () {\n var hasWidth = this.$element.hasClass('width')\n return hasWidth ? 'width' : 'height'\n }\n\n Collapse.prototype.show = function () {\n if (this.transitioning || this.$element.hasClass('in')) return\n\n var startEvent = $.Event('show.bs.collapse')\n this.$element.trigger(startEvent)\n if (startEvent.isDefaultPrevented()) return\n\n var actives = this.$parent && this.$parent.find('> .panel > .in')\n\n if (actives && actives.length) {\n var hasData = actives.data('bs.collapse')\n if (hasData && hasData.transitioning) return\n actives.collapse('hide')\n hasData || actives.data('bs.collapse', null)\n }\n\n var dimension = this.dimension()\n\n this.$element\n .removeClass('collapse')\n .addClass('collapsing')\n [dimension](0)\n\n this.transitioning = 1\n\n var complete = function () {\n this.$element\n .removeClass('collapsing')\n .addClass('in')\n [dimension]('auto')\n this.transitioning = 0\n this.$element.trigger('shown.bs.collapse')\n }\n\n if (!$.support.transition) return complete.call(this)\n\n var scrollSize = $.camelCase(['scroll', dimension].join('-'))\n\n this.$element\n .one($.support.transition.end, $.proxy(complete, this))\n .emulateTransitionEnd(350)\n [dimension](this.$element[0][scrollSize])\n }\n\n Collapse.prototype.hide = function () {\n if (this.transitioning || !this.$element.hasClass('in')) return\n\n var startEvent = $.Event('hide.bs.collapse')\n this.$element.trigger(startEvent)\n if (startEvent.isDefaultPrevented()) return\n\n var dimension = this.dimension()\n\n this.$element\n [dimension](this.$element[dimension]())\n [0].offsetHeight\n\n this.$element\n .addClass('collapsing')\n .removeClass('collapse')\n .removeClass('in')\n\n this.transitioning = 1\n\n var complete = function () {\n this.transitioning = 0\n this.$element\n .trigger('hidden.bs.collapse')\n .removeClass('collapsing')\n .addClass('collapse')\n }\n\n if (!$.support.transition) return complete.call(this)\n\n this.$element\n [dimension](0)\n .one($.support.transition.end, $.proxy(complete, this))\n .emulateTransitionEnd(350)\n }\n\n Collapse.prototype.toggle = function () {\n this[this.$element.hasClass('in') ? 'hide' : 'show']()\n }\n\n\n // COLLAPSE PLUGIN DEFINITION\n // ==========================\n\n var old = $.fn.collapse\n\n $.fn.collapse = function (option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.collapse')\n var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)\n\n if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }\n\n $.fn.collapse.Constructor = Collapse\n\n\n // COLLAPSE NO CONFLICT\n // ====================\n\n $.fn.collapse.noConflict = function () {\n $.fn.collapse = old\n return this\n }\n\n\n // COLLAPSE DATA-API\n // =================\n\n $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {\n var $this = $(this), href\n var target = $this.attr('data-target')\n || e.preventDefault()\n || (href = $this.attr('href')) && href.replace(/.*(?=#[^\\s]+$)/, '') //strip for ie7\n var $target = $(target)\n var data = $target.data('bs.collapse')\n var option = data ? 'toggle' : $this.data()\n var parent = $this.attr('data-parent')\n var $parent = parent && $(parent)\n\n if (!data || !data.transitioning) {\n if ($parent) $parent.find('[data-toggle=collapse][data-parent=\"' + parent + '\"]').not($this).addClass('collapsed')\n $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')\n }\n\n $target.collapse(option)\n })\n\n}(window.jQuery);\n\n/* ========================================================================\n * Bootstrap: dropdown.js v3.0.0\n * http://twbs.github.com/bootstrap/javascript.html#dropdowns\n * ========================================================================\n * Copyright 2012 Twitter, 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+function ($) { \"use strict\";\n\n // DROPDOWN CLASS DEFINITION\n // =========================\n\n var backdrop = '.dropdown-backdrop'\n var toggle = '[data-toggle=dropdown]'\n var Dropdown = function (element) {\n var $el = $(element).on('click.bs.dropdown', this.toggle)\n }\n\n Dropdown.prototype.toggle = function (e) {\n var $this = $(this)\n\n if ($this.is('.disabled, :disabled')) return\n\n var $parent = getParent($this)\n var isActive = $parent.hasClass('open')\n\n clearMenus()\n\n if (!isActive) {\n if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {\n // if mobile we we use a backdrop because click events don't delegate\n $('
    ').insertAfter($(this)).on('click', clearMenus)\n }\n\n $parent.trigger(e = $.Event('show.bs.dropdown'))\n\n if (e.isDefaultPrevented()) return\n\n $parent\n .toggleClass('open')\n .trigger('shown.bs.dropdown')\n\n $this.focus()\n }\n\n return false\n }\n\n Dropdown.prototype.keydown = function (e) {\n if (!/(38|40|27)/.test(e.keyCode)) return\n\n var $this = $(this)\n\n e.preventDefault()\n e.stopPropagation()\n\n if ($this.is('.disabled, :disabled')) return\n\n var $parent = getParent($this)\n var isActive = $parent.hasClass('open')\n\n if (!isActive || (isActive && e.keyCode == 27)) {\n if (e.which == 27) $parent.find(toggle).focus()\n return $this.click()\n }\n\n var $items = $('[role=menu] li:not(.divider):visible a', $parent)\n\n if (!$items.length) return\n\n var index = $items.index($items.filter(':focus'))\n\n if (e.keyCode == 38 && index > 0) index-- // up\n if (e.keyCode == 40 && index < $items.length - 1) index++ // down\n if (!~index) index=0\n\n $items.eq(index).focus()\n }\n\n function clearMenus() {\n $(backdrop).remove()\n $(toggle).each(function (e) {\n var $parent = getParent($(this))\n if (!$parent.hasClass('open')) return\n $parent.trigger(e = $.Event('hide.bs.dropdown'))\n if (e.isDefaultPrevented()) return\n $parent.removeClass('open').trigger('hidden.bs.dropdown')\n })\n }\n\n function getParent($this) {\n var selector = $this.attr('data-target')\n\n if (!selector) {\n selector = $this.attr('href')\n selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\\s]*$)/, '') //strip for ie7\n }\n\n var $parent = selector && $(selector)\n\n return $parent && $parent.length ? $parent : $this.parent()\n }\n\n\n // DROPDOWN PLUGIN DEFINITION\n // ==========================\n\n var old = $.fn.dropdown\n\n $.fn.dropdown = function (option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('dropdown')\n\n if (!data) $this.data('dropdown', (data = new Dropdown(this)))\n if (typeof option == 'string') data[option].call($this)\n })\n }\n\n $.fn.dropdown.Constructor = Dropdown\n\n\n // DROPDOWN NO CONFLICT\n // ====================\n\n $.fn.dropdown.noConflict = function () {\n $.fn.dropdown = old\n return this\n }\n\n\n // APPLY TO STANDARD DROPDOWN ELEMENTS\n // ===================================\n\n $(document)\n .on('click.bs.dropdown.data-api', clearMenus)\n .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })\n .on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle)\n .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)\n\n}(window.jQuery);\n\n/* ========================================================================\n * Bootstrap: modal.js v3.0.0\n * http://twbs.github.com/bootstrap/javascript.html#modals\n * ========================================================================\n * Copyright 2012 Twitter, 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+function ($) { \"use strict\";\n\n // MODAL CLASS DEFINITION\n // ======================\n\n var Modal = function (element, options) {\n this.options = options\n this.$element = $(element)\n this.$backdrop =\n this.isShown = null\n\n if (this.options.remote) this.$element.load(this.options.remote)\n }\n\n Modal.DEFAULTS = {\n backdrop: true\n , keyboard: true\n , show: true\n }\n\n Modal.prototype.toggle = function (_relatedTarget) {\n return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)\n }\n\n Modal.prototype.show = function (_relatedTarget) {\n var that = this\n var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })\n\n this.$element.trigger(e)\n\n if (this.isShown || e.isDefaultPrevented()) return\n\n this.isShown = true\n\n this.escape()\n\n this.$element.on('click.dismiss.modal', '[data-dismiss=\"modal\"]', $.proxy(this.hide, this))\n\n this.backdrop(function () {\n var transition = $.support.transition && that.$element.hasClass('fade')\n\n if (!that.$element.parent().length) {\n that.$element.appendTo(document.body) // don't move modals dom position\n }\n\n that.$element.show()\n\n if (transition) {\n that.$element[0].offsetWidth // force reflow\n }\n\n that.$element\n .addClass('in')\n .attr('aria-hidden', false)\n\n that.enforceFocus()\n\n var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })\n\n transition ?\n that.$element.find('.modal-dialog') // wait for modal to slide in\n .one($.support.transition.end, function () {\n that.$element.focus().trigger(e)\n })\n .emulateTransitionEnd(300) :\n that.$element.focus().trigger(e)\n })\n }\n\n Modal.prototype.hide = function (e) {\n if (e) e.preventDefault()\n\n e = $.Event('hide.bs.modal')\n\n this.$element.trigger(e)\n\n if (!this.isShown || e.isDefaultPrevented()) return\n\n this.isShown = false\n\n this.escape()\n\n $(document).off('focusin.bs.modal')\n\n this.$element\n .removeClass('in')\n .attr('aria-hidden', true)\n .off('click.dismiss.modal')\n\n $.support.transition && this.$element.hasClass('fade') ?\n this.$element\n .one($.support.transition.end, $.proxy(this.hideModal, this))\n .emulateTransitionEnd(300) :\n this.hideModal()\n }\n\n Modal.prototype.enforceFocus = function () {\n $(document)\n .off('focusin.bs.modal') // guard against infinite focus loop\n .on('focusin.bs.modal', $.proxy(function (e) {\n if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {\n this.$element.focus()\n }\n }, this))\n }\n\n Modal.prototype.escape = function () {\n if (this.isShown && this.options.keyboard) {\n this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {\n e.which == 27 && this.hide()\n }, this))\n } else if (!this.isShown) {\n this.$element.off('keyup.dismiss.bs.modal')\n }\n }\n\n Modal.prototype.hideModal = function () {\n var that = this\n this.$element.hide()\n this.backdrop(function () {\n that.removeBackdrop()\n that.$element.trigger('hidden.bs.modal')\n })\n }\n\n Modal.prototype.removeBackdrop = function () {\n this.$backdrop && this.$backdrop.remove()\n this.$backdrop = null\n }\n\n Modal.prototype.backdrop = function (callback) {\n var that = this\n var animate = this.$element.hasClass('fade') ? 'fade' : ''\n\n if (this.isShown && this.options.backdrop) {\n var doAnimate = $.support.transition && animate\n\n this.$backdrop = $('
    ')\n .appendTo(document.body)\n\n this.$element.on('click.dismiss.modal', $.proxy(function (e) {\n if (e.target !== e.currentTarget) return\n this.options.backdrop == 'static'\n ? this.$element[0].focus.call(this.$element[0])\n : this.hide.call(this)\n }, this))\n\n if (doAnimate) this.$backdrop[0].offsetWidth // force reflow\n\n this.$backdrop.addClass('in')\n\n if (!callback) return\n\n doAnimate ?\n this.$backdrop\n .one($.support.transition.end, callback)\n .emulateTransitionEnd(150) :\n callback()\n\n } else if (!this.isShown && this.$backdrop) {\n this.$backdrop.removeClass('in')\n\n $.support.transition && this.$element.hasClass('fade')?\n this.$backdrop\n .one($.support.transition.end, callback)\n .emulateTransitionEnd(150) :\n callback()\n\n } else if (callback) {\n callback()\n }\n }\n\n\n // MODAL PLUGIN DEFINITION\n // =======================\n\n var old = $.fn.modal\n\n $.fn.modal = function (option, _relatedTarget) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.modal')\n var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)\n\n if (!data) $this.data('bs.modal', (data = new Modal(this, options)))\n if (typeof option == 'string') data[option](_relatedTarget)\n else if (options.show) data.show(_relatedTarget)\n })\n }\n\n $.fn.modal.Constructor = Modal\n\n\n // MODAL NO CONFLICT\n // =================\n\n $.fn.modal.noConflict = function () {\n $.fn.modal = old\n return this\n }\n\n\n // MODAL DATA-API\n // ==============\n\n $(document).on('click.bs.modal.data-api', '[data-toggle=\"modal\"]', function (e) {\n var $this = $(this)\n var href = $this.attr('href')\n var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\\s]+$)/, ''))) //strip for ie7\n var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())\n\n e.preventDefault()\n\n $target\n .modal(option, this)\n .one('hide', function () {\n $this.is(':visible') && $this.focus()\n })\n })\n\n $(document)\n .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })\n .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })\n\n}(window.jQuery);\n\n/* ========================================================================\n * Bootstrap: tooltip.js v3.0.0\n * http://twbs.github.com/bootstrap/javascript.html#tooltip\n * Inspired by the original jQuery.tipsy by Jason Frame\n * ========================================================================\n * Copyright 2012 Twitter, 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+function ($) { \"use strict\";\n\n // TOOLTIP PUBLIC CLASS DEFINITION\n // ===============================\n\n var Tooltip = function (element, options) {\n this.type =\n this.options =\n this.enabled =\n this.timeout =\n this.hoverState =\n this.$element = null\n\n this.init('tooltip', element, options)\n }\n\n Tooltip.DEFAULTS = {\n animation: true\n , placement: 'top'\n , selector: false\n , template: '
    '\n , trigger: 'hover focus'\n , title: ''\n , delay: 0\n , html: false\n , container: false\n }\n\n Tooltip.prototype.init = function (type, element, options) {\n this.enabled = true\n this.type = type\n this.$element = $(element)\n this.options = this.getOptions(options)\n\n var triggers = this.options.trigger.split(' ')\n\n for (var i = triggers.length; i--;) {\n var trigger = triggers[i]\n\n if (trigger == 'click') {\n this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))\n } else if (trigger != 'manual') {\n var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'\n var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'\n\n this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))\n this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))\n }\n }\n\n this.options.selector ?\n (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :\n this.fixTitle()\n }\n\n Tooltip.prototype.getDefaults = function () {\n return Tooltip.DEFAULTS\n }\n\n Tooltip.prototype.getOptions = function (options) {\n options = $.extend({}, this.getDefaults(), this.$element.data(), options)\n\n if (options.delay && typeof options.delay == 'number') {\n options.delay = {\n show: options.delay\n , hide: options.delay\n }\n }\n\n return options\n }\n\n Tooltip.prototype.getDelegateOptions = function () {\n var options = {}\n var defaults = this.getDefaults()\n\n this._options && $.each(this._options, function (key, value) {\n if (defaults[key] != value) options[key] = value\n })\n\n return options\n }\n\n Tooltip.prototype.enter = function (obj) {\n var self = obj instanceof this.constructor ?\n obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)\n\n clearTimeout(self.timeout)\n\n self.hoverState = 'in'\n\n if (!self.options.delay || !self.options.delay.show) return self.show()\n\n self.timeout = setTimeout(function () {\n if (self.hoverState == 'in') self.show()\n }, self.options.delay.show)\n }\n\n Tooltip.prototype.leave = function (obj) {\n var self = obj instanceof this.constructor ?\n obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)\n\n clearTimeout(self.timeout)\n\n self.hoverState = 'out'\n\n if (!self.options.delay || !self.options.delay.hide) return self.hide()\n\n self.timeout = setTimeout(function () {\n if (self.hoverState == 'out') self.hide()\n }, self.options.delay.hide)\n }\n\n Tooltip.prototype.show = function () {\n var e = $.Event('show.bs.'+ this.type)\n\n if (this.hasContent() && this.enabled) {\n this.$element.trigger(e)\n\n if (e.isDefaultPrevented()) return\n\n var $tip = this.tip()\n\n this.setContent()\n\n if (this.options.animation) $tip.addClass('fade')\n\n var placement = typeof this.options.placement == 'function' ?\n this.options.placement.call(this, $tip[0], this.$element[0]) :\n this.options.placement\n\n var autoToken = /\\s?auto?\\s?/i\n var autoPlace = autoToken.test(placement)\n if (autoPlace) placement = placement.replace(autoToken, '') || 'top'\n\n $tip\n .detach()\n .css({ top: 0, left: 0, display: 'block' })\n .addClass(placement)\n\n this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)\n\n var pos = this.getPosition()\n var actualWidth = $tip[0].offsetWidth\n var actualHeight = $tip[0].offsetHeight\n\n if (autoPlace) {\n var $parent = this.$element.parent()\n\n var orgPlacement = placement\n var docScroll = document.documentElement.scrollTop || document.body.scrollTop\n var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()\n var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()\n var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left\n\n placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :\n placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :\n placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :\n placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :\n placement\n\n $tip\n .removeClass(orgPlacement)\n .addClass(placement)\n }\n\n var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)\n\n this.applyPlacement(calculatedOffset, placement)\n this.$element.trigger('shown.bs.' + this.type)\n }\n }\n\n Tooltip.prototype.applyPlacement = function(offset, placement) {\n var replace\n var $tip = this.tip()\n var width = $tip[0].offsetWidth\n var height = $tip[0].offsetHeight\n\n // manually read margins because getBoundingClientRect includes difference\n var marginTop = parseInt($tip.css('margin-top'), 10)\n var marginLeft = parseInt($tip.css('margin-left'), 10)\n\n // we must check for NaN for ie 8/9\n if (isNaN(marginTop)) marginTop = 0\n if (isNaN(marginLeft)) marginLeft = 0\n\n offset.top = offset.top + marginTop\n offset.left = offset.left + marginLeft\n\n $tip\n .offset(offset)\n .addClass('in')\n\n // check to see if placing tip in new offset caused the tip to resize itself\n var actualWidth = $tip[0].offsetWidth\n var actualHeight = $tip[0].offsetHeight\n\n if (placement == 'top' && actualHeight != height) {\n replace = true\n offset.top = offset.top + height - actualHeight\n }\n\n if (/bottom|top/.test(placement)) {\n var delta = 0\n\n if (offset.left < 0) {\n delta = offset.left * -2\n offset.left = 0\n\n $tip.offset(offset)\n\n actualWidth = $tip[0].offsetWidth\n actualHeight = $tip[0].offsetHeight\n }\n\n this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')\n } else {\n this.replaceArrow(actualHeight - height, actualHeight, 'top')\n }\n\n if (replace) $tip.offset(offset)\n }\n\n Tooltip.prototype.replaceArrow = function(delta, dimension, position) {\n this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + \"%\") : '')\n }\n\n Tooltip.prototype.setContent = function () {\n var $tip = this.tip()\n var title = this.getTitle()\n\n $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)\n $tip.removeClass('fade in top bottom left right')\n }\n\n Tooltip.prototype.hide = function () {\n var that = this\n var $tip = this.tip()\n var e = $.Event('hide.bs.' + this.type)\n\n function complete() {\n if (that.hoverState != 'in') $tip.detach()\n }\n\n this.$element.trigger(e)\n\n if (e.isDefaultPrevented()) return\n\n $tip.removeClass('in')\n\n $.support.transition && this.$tip.hasClass('fade') ?\n $tip\n .one($.support.transition.end, complete)\n .emulateTransitionEnd(150) :\n complete()\n\n this.$element.trigger('hidden.bs.' + this.type)\n\n return this\n }\n\n Tooltip.prototype.fixTitle = function () {\n var $e = this.$element\n if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {\n $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')\n }\n }\n\n Tooltip.prototype.hasContent = function () {\n return this.getTitle()\n }\n\n Tooltip.prototype.getPosition = function () {\n var el = this.$element[0]\n return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {\n width: el.offsetWidth\n , height: el.offsetHeight\n }, this.$element.offset())\n }\n\n Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {\n return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :\n placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :\n placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :\n /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }\n }\n\n Tooltip.prototype.getTitle = function () {\n var title\n var $e = this.$element\n var o = this.options\n\n title = $e.attr('data-original-title')\n || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)\n\n return title\n }\n\n Tooltip.prototype.tip = function () {\n return this.$tip = this.$tip || $(this.options.template)\n }\n\n Tooltip.prototype.arrow = function () {\n return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')\n }\n\n Tooltip.prototype.validate = function () {\n if (!this.$element[0].parentNode) {\n this.hide()\n this.$element = null\n this.options = null\n }\n }\n\n Tooltip.prototype.enable = function () {\n this.enabled = true\n }\n\n Tooltip.prototype.disable = function () {\n this.enabled = false\n }\n\n Tooltip.prototype.toggleEnabled = function () {\n this.enabled = !this.enabled\n }\n\n Tooltip.prototype.toggle = function (e) {\n var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this\n self.tip().hasClass('in') ? self.leave(self) : self.enter(self)\n }\n\n Tooltip.prototype.destroy = function () {\n this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)\n }\n\n\n // TOOLTIP PLUGIN DEFINITION\n // =========================\n\n var old = $.fn.tooltip\n\n $.fn.tooltip = function (option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }\n\n $.fn.tooltip.Constructor = Tooltip\n\n\n // TOOLTIP NO CONFLICT\n // ===================\n\n $.fn.tooltip.noConflict = function () {\n $.fn.tooltip = old\n return this\n }\n\n}(window.jQuery);\n\n/* ========================================================================\n * Bootstrap: popover.js v3.0.0\n * http://twbs.github.com/bootstrap/javascript.html#popovers\n * ========================================================================\n * Copyright 2012 Twitter, 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+function ($) { \"use strict\";\n\n // POPOVER PUBLIC CLASS DEFINITION\n // ===============================\n\n var Popover = function (element, options) {\n this.init('popover', element, options)\n }\n\n if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')\n\n Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {\n placement: 'right'\n , trigger: 'click'\n , content: ''\n , template: '

    '\n })\n\n\n // NOTE: POPOVER EXTENDS tooltip.js\n // ================================\n\n Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)\n\n Popover.prototype.constructor = Popover\n\n Popover.prototype.getDefaults = function () {\n return Popover.DEFAULTS\n }\n\n Popover.prototype.setContent = function () {\n var $tip = this.tip()\n var title = this.getTitle()\n var content = this.getContent()\n\n $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)\n $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)\n\n $tip.removeClass('fade top bottom left right in')\n\n // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do\n // this manually by checking the contents.\n if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()\n }\n\n Popover.prototype.hasContent = function () {\n return this.getTitle() || this.getContent()\n }\n\n Popover.prototype.getContent = function () {\n var $e = this.$element\n var o = this.options\n\n return $e.attr('data-content')\n || (typeof o.content == 'function' ?\n o.content.call($e[0]) :\n o.content)\n }\n\n Popover.prototype.arrow = function () {\n return this.$arrow = this.$arrow || this.tip().find('.arrow')\n }\n\n Popover.prototype.tip = function () {\n if (!this.$tip) this.$tip = $(this.options.template)\n return this.$tip\n }\n\n\n // POPOVER PLUGIN DEFINITION\n // =========================\n\n var old = $.fn.popover\n\n $.fn.popover = function (option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.popover')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.popover', (data = new Popover(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }\n\n $.fn.popover.Constructor = Popover\n\n\n // POPOVER NO CONFLICT\n // ===================\n\n $.fn.popover.noConflict = function () {\n $.fn.popover = old\n return this\n }\n\n}(window.jQuery);\n\n/* ========================================================================\n * Bootstrap: scrollspy.js v3.0.0\n * http://twbs.github.com/bootstrap/javascript.html#scrollspy\n * ========================================================================\n * Copyright 2012 Twitter, 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+function ($) { \"use strict\";\n\n // SCROLLSPY CLASS DEFINITION\n // ==========================\n\n function ScrollSpy(element, options) {\n var href\n var process = $.proxy(this.process, this)\n\n this.$element = $(element).is('body') ? $(window) : $(element)\n this.$body = $('body')\n this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)\n this.options = $.extend({}, ScrollSpy.DEFAULTS, options)\n this.selector = (this.options.target\n || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\\s]+$)/, '')) //strip for ie7\n || '') + ' .nav li > a'\n this.offsets = $([])\n this.targets = $([])\n this.activeTarget = null\n\n this.refresh()\n this.process()\n }\n\n ScrollSpy.DEFAULTS = {\n offset: 10\n }\n\n ScrollSpy.prototype.refresh = function () {\n var offsetMethod = this.$element[0] == window ? 'offset' : 'position'\n\n this.offsets = $([])\n this.targets = $([])\n\n var self = this\n var $targets = this.$body\n .find(this.selector)\n .map(function () {\n var $el = $(this)\n var href = $el.data('target') || $el.attr('href')\n var $href = /^#\\w/.test(href) && $(href)\n\n return ($href\n && $href.length\n && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null\n })\n .sort(function (a, b) { return a[0] - b[0] })\n .each(function () {\n self.offsets.push(this[0])\n self.targets.push(this[1])\n })\n }\n\n ScrollSpy.prototype.process = function () {\n var scrollTop = this.$scrollElement.scrollTop() + this.options.offset\n var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight\n var maxScroll = scrollHeight - this.$scrollElement.height()\n var offsets = this.offsets\n var targets = this.targets\n var activeTarget = this.activeTarget\n var i\n\n if (scrollTop >= maxScroll) {\n return activeTarget != (i = targets.last()[0]) && this.activate(i)\n }\n\n for (i = offsets.length; i--;) {\n activeTarget != targets[i]\n && scrollTop >= offsets[i]\n && (!offsets[i + 1] || scrollTop <= offsets[i + 1])\n && this.activate( targets[i] )\n }\n }\n\n ScrollSpy.prototype.activate = function (target) {\n this.activeTarget = target\n\n $(this.selector)\n .parents('.active')\n .removeClass('active')\n\n var selector = this.selector\n + '[data-target=\"' + target + '\"],'\n + this.selector + '[href=\"' + target + '\"]'\n\n var active = $(selector)\n .parents('li')\n .addClass('active')\n\n if (active.parent('.dropdown-menu').length) {\n active = active\n .closest('li.dropdown')\n .addClass('active')\n }\n\n active.trigger('activate')\n }\n\n\n // SCROLLSPY PLUGIN DEFINITION\n // ===========================\n\n var old = $.fn.scrollspy\n\n $.fn.scrollspy = function (option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.scrollspy')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }\n\n $.fn.scrollspy.Constructor = ScrollSpy\n\n\n // SCROLLSPY NO CONFLICT\n // =====================\n\n $.fn.scrollspy.noConflict = function () {\n $.fn.scrollspy = old\n return this\n }\n\n\n // SCROLLSPY DATA-API\n // ==================\n\n $(window).on('load', function () {\n $('[data-spy=\"scroll\"]').each(function () {\n var $spy = $(this)\n $spy.scrollspy($spy.data())\n })\n })\n\n}(window.jQuery);\n\n/* ========================================================================\n * Bootstrap: tab.js v3.0.0\n * http://twbs.github.com/bootstrap/javascript.html#tabs\n * ========================================================================\n * Copyright 2012 Twitter, 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+function ($) { \"use strict\";\n\n // TAB CLASS DEFINITION\n // ====================\n\n var Tab = function (element) {\n this.element = $(element)\n }\n\n Tab.prototype.show = function () {\n var $this = this.element\n var $ul = $this.closest('ul:not(.dropdown-menu)')\n var selector = $this.attr('data-target')\n\n if (!selector) {\n selector = $this.attr('href')\n selector = selector && selector.replace(/.*(?=#[^\\s]*$)/, '') //strip for ie7\n }\n\n if ($this.parent('li').hasClass('active')) return\n\n var previous = $ul.find('.active:last a')[0]\n var e = $.Event('show.bs.tab', {\n relatedTarget: previous\n })\n\n $this.trigger(e)\n\n if (e.isDefaultPrevented()) return\n\n var $target = $(selector)\n\n this.activate($this.parent('li'), $ul)\n this.activate($target, $target.parent(), function () {\n $this.trigger({\n type: 'shown.bs.tab'\n , relatedTarget: previous\n })\n })\n }\n\n Tab.prototype.activate = function (element, container, callback) {\n var $active = container.find('> .active')\n var transition = callback\n && $.support.transition\n && $active.hasClass('fade')\n\n function next() {\n $active\n .removeClass('active')\n .find('> .dropdown-menu > .active')\n .removeClass('active')\n\n element.addClass('active')\n\n if (transition) {\n element[0].offsetWidth // reflow for transition\n element.addClass('in')\n } else {\n element.removeClass('fade')\n }\n\n if (element.parent('.dropdown-menu')) {\n element.closest('li.dropdown').addClass('active')\n }\n\n callback && callback()\n }\n\n transition ?\n $active\n .one($.support.transition.end, next)\n .emulateTransitionEnd(150) :\n next()\n\n $active.removeClass('in')\n }\n\n\n // TAB PLUGIN DEFINITION\n // =====================\n\n var old = $.fn.tab\n\n $.fn.tab = function ( option ) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tab')\n\n if (!data) $this.data('bs.tab', (data = new Tab(this)))\n if (typeof option == 'string') data[option]()\n })\n }\n\n $.fn.tab.Constructor = Tab\n\n\n // TAB NO CONFLICT\n // ===============\n\n $.fn.tab.noConflict = function () {\n $.fn.tab = old\n return this\n }\n\n\n // TAB DATA-API\n // ============\n\n $(document).on('click.bs.tab.data-api', '[data-toggle=\"tab\"], [data-toggle=\"pill\"]', function (e) {\n e.preventDefault()\n $(this).tab('show')\n })\n\n}(window.jQuery);\n\n/* ========================================================================\n * Bootstrap: affix.js v3.0.0\n * http://twbs.github.com/bootstrap/javascript.html#affix\n * ========================================================================\n * Copyright 2012 Twitter, 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+function ($) { \"use strict\";\n\n // AFFIX CLASS DEFINITION\n // ======================\n\n var Affix = function (element, options) {\n this.options = $.extend({}, Affix.DEFAULTS, options)\n this.$window = $(window)\n .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))\n .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))\n\n this.$element = $(element)\n this.affixed =\n this.unpin = null\n\n this.checkPosition()\n }\n\n Affix.RESET = 'affix affix-top affix-bottom'\n\n Affix.DEFAULTS = {\n offset: 0\n }\n\n Affix.prototype.checkPositionWithEventLoop = function () {\n setTimeout($.proxy(this.checkPosition, this), 1)\n }\n\n Affix.prototype.checkPosition = function () {\n if (!this.$element.is(':visible')) return\n\n var scrollHeight = $(document).height()\n var scrollTop = this.$window.scrollTop()\n var position = this.$element.offset()\n var offset = this.options.offset\n var offsetTop = offset.top\n var offsetBottom = offset.bottom\n\n if (typeof offset != 'object') offsetBottom = offsetTop = offset\n if (typeof offsetTop == 'function') offsetTop = offset.top()\n if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()\n\n var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :\n offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :\n offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false\n\n if (this.affixed === affix) return\n if (this.unpin) this.$element.css('top', '')\n\n this.affixed = affix\n this.unpin = affix == 'bottom' ? position.top - scrollTop : null\n\n this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))\n\n if (affix == 'bottom') {\n this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })\n }\n }\n\n\n // AFFIX PLUGIN DEFINITION\n // =======================\n\n var old = $.fn.affix\n\n $.fn.affix = function (option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.affix')\n var options = typeof option == 'object' && option\n\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }\n\n $.fn.affix.Constructor = Affix\n\n\n // AFFIX NO CONFLICT\n // =================\n\n $.fn.affix.noConflict = function () {\n $.fn.affix = old\n return this\n }\n\n\n // AFFIX DATA-API\n // ==============\n\n $(window).on('load', function () {\n $('[data-spy=\"affix\"]').each(function () {\n var $spy = $(this)\n var data = $spy.data()\n\n data.offset = data.offset || {}\n\n if (data.offsetBottom) data.offset.bottom = data.offsetBottom\n if (data.offsetTop) data.offset.top = data.offsetTop\n\n $spy.affix(data)\n })\n })\n\n}(window.jQuery);\n"} +{"text": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Snowflake.Input.Controller\n{\n public class ControllerElementCollection : IControllerElementCollection\n {\n // standard + extended face buttons\n\n /// \n public IControllerElementInfo? ButtonA => this[ControllerElement.ButtonA];\n\n /// \n public IControllerElementInfo? ButtonB => this[ControllerElement.ButtonB];\n\n /// \n public IControllerElementInfo? ButtonC => this[ControllerElement.ButtonC];\n\n /// \n public IControllerElementInfo? ButtonX => this[ControllerElement.ButtonX];\n\n /// \n public IControllerElementInfo? ButtonY => this[ControllerElement.ButtonY];\n\n /// \n public IControllerElementInfo? ButtonZ => this[ControllerElement.ButtonZ];\n\n // shoulders\n\n /// \n public IControllerElementInfo? ButtonL => this[ControllerElement.ButtonL];\n\n /// \n public IControllerElementInfo? ButtonR => this[ControllerElement.ButtonR];\n\n // start/select/guide\n\n /// \n public IControllerElementInfo? ButtonStart => this[ControllerElement.ButtonStart];\n\n /// \n public IControllerElementInfo? ButtonSelect => this[ControllerElement.ButtonSelect];\n\n /// \n public IControllerElementInfo? ButtonGuide => this[ControllerElement.ButtonGuide];\n\n // used for mouse buttons and analog stick clicks\n\n /// \n public IControllerElementInfo? ButtonClickL => this[ControllerElement.ButtonClickL];\n\n /// \n public IControllerElementInfo? ButtonClickR => this[ControllerElement.ButtonClickR];\n\n // misc use\n\n /// \n public IControllerElementInfo? Button0 => this[ControllerElement.Button0];\n\n /// \n public IControllerElementInfo? Button1 => this[ControllerElement.Button1];\n\n /// \n public IControllerElementInfo? Button2 => this[ControllerElement.Button2];\n\n /// \n public IControllerElementInfo? Button3 => this[ControllerElement.Button3];\n\n /// \n public IControllerElementInfo? Button4 => this[ControllerElement.Button4];\n\n /// \n public IControllerElementInfo? Button5 => this[ControllerElement.Button5];\n\n /// \n public IControllerElementInfo? Button6 => this[ControllerElement.Button6];\n\n /// \n public IControllerElementInfo? Button7 => this[ControllerElement.Button7];\n\n /// \n public IControllerElementInfo? Button8 => this[ControllerElement.Button8];\n\n /// \n public IControllerElementInfo? Button9 => this[ControllerElement.Button9];\n\n /// \n public IControllerElementInfo? Button10 => this[ControllerElement.Button10];\n\n /// \n public IControllerElementInfo? Button11 => this[ControllerElement.Button11];\n\n /// \n public IControllerElementInfo? Button12 => this[ControllerElement.Button12];\n\n /// \n public IControllerElementInfo? Button13 => this[ControllerElement.Button13];\n\n /// \n public IControllerElementInfo? Button14 => this[ControllerElement.Button14];\n\n /// \n public IControllerElementInfo? Button15 => this[ControllerElement.Button15];\n\n /// \n public IControllerElementInfo? Button16 => this[ControllerElement.Button16];\n\n /// \n public IControllerElementInfo? Button17 => this[ControllerElement.Button17];\n\n /// \n public IControllerElementInfo? Button18 => this[ControllerElement.Button18];\n\n /// \n public IControllerElementInfo? Button19 => this[ControllerElement.Button19];\n\n /// \n public IControllerElementInfo? Button20 => this[ControllerElement.Button20];\n\n /// \n public IControllerElementInfo? Button21 => this[ControllerElement.Button21];\n\n /// \n public IControllerElementInfo? Button22 => this[ControllerElement.Button22];\n\n /// \n public IControllerElementInfo? Button23 => this[ControllerElement.Button23];\n\n /// \n public IControllerElementInfo? Button24 => this[ControllerElement.Button24];\n\n /// \n public IControllerElementInfo? Button25 => this[ControllerElement.Button25];\n\n /// \n public IControllerElementInfo? Button26 => this[ControllerElement.Button26];\n\n /// \n public IControllerElementInfo? Button27 => this[ControllerElement.Button27];\n\n /// \n public IControllerElementInfo? Button28 => this[ControllerElement.Button28];\n\n /// \n public IControllerElementInfo? Button29 => this[ControllerElement.Button29];\n\n /// \n public IControllerElementInfo? Button30 => this[ControllerElement.Button30];\n\n /// \n public IControllerElementInfo? Button31 => this[ControllerElement.Button31];\n\n // 8-way direciotnal\n\n /// \n public IControllerElementInfo? DirectionalN => this[ControllerElement.DirectionalN];\n\n /// \n public IControllerElementInfo? DirectionalE => this[ControllerElement.DirectionalE];\n\n /// \n public IControllerElementInfo? DirectionalS => this[ControllerElement.DirectionalS];\n\n /// \n public IControllerElementInfo? DirectionalW => this[ControllerElement.DirectionalW];\n\n /// \n public IControllerElementInfo? DirectionalNE => this[ControllerElement.DirectionalNE];\n\n /// \n public IControllerElementInfo? DirectionalNW => this[ControllerElement.DirectionalNW];\n\n /// \n public IControllerElementInfo? DirectionalSE => this[ControllerElement.DirectionalSE];\n\n /// \n public IControllerElementInfo? DirectionalSW => this[ControllerElement.DirectionalSW];\n\n // two ananlog triggers\n\n /// \n public IControllerElementInfo? TriggerLeft => this[ControllerElement.TriggerLeft];\n\n /// \n public IControllerElementInfo? TriggerRight => this[ControllerElement.TriggerRight];\n\n // left analog directions\n\n /// \n public IControllerElementInfo? AxisLeftAnalogPositiveX => this[ControllerElement.AxisLeftAnalogPositiveX];\n\n /// \n public IControllerElementInfo? AxisLeftAnalogNegativeX => this[ControllerElement.AxisLeftAnalogNegativeX];\n\n /// \n public IControllerElementInfo? AxisLeftAnalogPositiveY => this[ControllerElement.AxisLeftAnalogPositiveY];\n\n /// \n public IControllerElementInfo? AxisLeftAnalogNegativeY => this[ControllerElement.AxisLeftAnalogNegativeY];\n\n // right analog directions\n\n /// \n public IControllerElementInfo? AxisRightAnalogPositiveX => this[ControllerElement.AxisRightAnalogPositiveX];\n\n /// \n public IControllerElementInfo? AxisRightAnalogNegativeX => this[ControllerElement.AxisRightAnalogNegativeX];\n\n /// \n public IControllerElementInfo? AxisRightAnalogPositiveY => this[ControllerElement.AxisRightAnalogPositiveY];\n\n /// \n public IControllerElementInfo? AxisRightAnalogNegativeY => this[ControllerElement.AxisRightAnalogNegativeY];\n\n // rumble\n\n /// \n public IControllerElementInfo? RumbleBig => this[ControllerElement.RumbleBig];\n\n /// \n public IControllerElementInfo? RumbleSmall => this[ControllerElement.RumbleSmall];\n\n // mouse pointer support\n\n /// \n public IControllerElementInfo? Pointer2D => this[ControllerElement.Pointer2D];\n\n /// \n public IControllerElementInfo? Pointer3D => this[ControllerElement.Pointer3D];\n\n // pointer axes (wii remote and mouse)\n\n /// \n public IControllerElementInfo? PointerAxisPositiveX => this[ControllerElement.PointerAxisPositiveX];\n\n /// \n public IControllerElementInfo? PointerAxisNegativeX => this[ControllerElement.PointerAxisNegativeX];\n\n /// \n public IControllerElementInfo? PointerAxisPositiveY => this[ControllerElement.PointerAxisPositiveY];\n\n /// \n public IControllerElementInfo? PointerAxisNegativeY => this[ControllerElement.PointerAxisNegativeY];\n\n /// \n public IControllerElementInfo? PointerAxisPositiveZ => this[ControllerElement.PointerAxisPositiveZ];\n\n /// \n public IControllerElementInfo? PointerAxisNegativeZ => this[ControllerElement.PointerAxisNegativeZ];\n\n // keyboard layout\n\n /// \n public IControllerElementInfo? Keyboard => this[ControllerElement.Keyboard];\n\n /// \n public IControllerElementInfo? Touchscreen => this[ControllerElement.Touchscreen];\n\n /// \n public IControllerElementInfo? Gyroscope => this[ControllerElement.Gyroscope];\n\n private readonly IDictionary controllerElements;\n\n /// \n public IControllerElementInfo? this[ControllerElement element]\n {\n get\n {\n if (this.controllerElements.ContainsKey(element) || element == ControllerElement.NoElement)\n {\n return this.controllerElements[element];\n }\n\n return null;\n }\n }\n\n public ControllerElementCollection()\n {\n this.controllerElements = new Dictionary();\n }\n\n internal void Add(ControllerElement elementKey, IControllerElementInfo info)\n {\n this.controllerElements[elementKey] = info;\n }\n\n /// \n public IEnumerator> GetEnumerator()\n {\n return this.controllerElements.GetEnumerator();\n }\n\n /// \n IEnumerator IEnumerable.GetEnumerator()\n {\n return this.GetEnumerator();\n }\n }\n}\n"} +{"text": "using System;\nusing System.Collections.Generic;\nusing DG.Tweening;\nusing TMPro;\nusing Cysharp.Threading.Tasks;\nusing UnityEngine;\n\npublic class GameTooltipText : MonoBehaviour\n{\n\n public Game game;\n public TextMeshProUGUI tmp;\n \n public float fadeDuration = 0.4f;\n public Ease ease = Ease.OutCirc;\n \n public GameMessage CurrentMessage { get; protected set; }\n\n private readonly List sequences = new List();\n \n protected void Awake()\n {\n game.onGameSpeedUp.AddListener(_ => Animate(new GameMessage\n {\n Type = GameMessage.AnimationType.Expand, \n Color = Scanner.SpeedUpColor, \n TextFunction = () => \"GAME_SPEED_UP\".Get()\n }));\n game.onGameSpeedDown.AddListener(_ => Animate(new GameMessage\n {\n Type = GameMessage.AnimationType.Shrink,\n Color = Scanner.SpeedDownColor,\n TextFunction = () => \"GAME_SLOW_DOWN\".Get()\n }));\n game.onGameWillUnpause.AddListener(async _ =>\n {\n await UniTask.Delay(TimeSpan.FromSeconds(1.4f));\n Animate(new GameMessage\n {\n Type = GameMessage.AnimationType.Expand,\n Color = Color.white,\n TextFunction = () => \"GAME_RESUME_IN_X\".Get(Mathf.Max(0.1f, game.UnpauseCountdown).ToString(\"0.0\")),\n MaxSpacing = 96\n }, 2.1f);\n });\n tmp.color = Color.clear;\n tmp.text = \"\";\n }\n\n public async void Animate(GameMessage message, float duration = 1.5f)\n {\n CurrentMessage = message;\n tmp.color = message.Color.WithAlpha(0);\n tmp.text = message.TextFunction();\n tmp.characterSpacing = message.Type == GameMessage.AnimationType.Shrink ? message.MaxSpacing : message.MinSpacing;\n\n sequences.ForEach(it => it.Kill());\n sequences.Clear();\n DOTween.Sequence()\n .Append(\n DOTween.To(\n () => tmp.color,\n it => tmp.color = it,\n tmp.color.WithAlpha(1),\n fadeDuration\n )\n .SetEase(Ease.OutCubic)\n )\n .Append(\n DOTween.To(\n () => tmp.color,\n it => tmp.color = it,\n tmp.color.WithAlpha(0),\n fadeDuration\n )\n .SetDelay(duration - fadeDuration * 2)\n .SetEase(Ease.OutCubic)\n )\n .Also(it => sequences.Add(it));\n DOTween.Sequence()\n .Append(\n DOTween.To(\n () => tmp.characterSpacing,\n it => tmp.characterSpacing = it,\n message.Type == GameMessage.AnimationType.Expand ? message.MaxSpacing : message.MinSpacing,\n duration\n )\n .SetEase(ease)\n )\n .Also(it => sequences.Add(it));\n\n await UniTask.Delay(TimeSpan.FromSeconds(duration));\n CurrentMessage = null;\n }\n\n public void Update()\n {\n if (CurrentMessage != null)\n {\n tmp.text = CurrentMessage.TextFunction();\n }\n }\n}\n\npublic class GameMessage\n{\n public AnimationType Type;\n public Color Color;\n public Func TextFunction;\n public float MaxSpacing = 192f;\n public float MinSpacing;\n \n public enum AnimationType\n {\n Expand, Shrink, None\n }\n}"} +{"text": "cask \"airtool\" do\n version \"1.9.1\"\n sha256 \"85a469adad7be1a53a2c2e0a99edf97da8109de4a057e30431cebb0f7f1f9430\"\n\n url \"https://www.intuitibits.com/downloads/Airtool_#{version}.pkg\"\n appcast \"https://www.intuitibits.com/appcasts/airtoolcast.xml\"\n name \"Airtool\"\n homepage \"https://www.intuitibits.com/products/airtool/\"\n\n pkg \"Airtool_#{version}.pkg\"\n\n uninstall_preflight do\n set_ownership \"/Library/Application Support/Airtool\"\n end\n\n uninstall pkgutil: [\n \"com.intuitibits.airtool-helper.pkg\",\n \"com.intuitibits.airtool.pkg\",\n ],\n launchctl: \"com.intuitibits.airtool.airtool-bpf\",\n login_item: \"Airtool\",\n delete: \"/Library/Application Support/Airtool\"\nend\n"} +{"text": "import scipy as sp\nimport numpy as np\n\n\n# Do the bayes thing\ndef bayes_single(data, v):\n sigma = sp.var(data)\n mu = sp.average(data)\n return sp.e ** (-1 * (v - mu) ** 2 / (2 * sigma)) / np.sqrt(2 * sp.pi * sigma)\n\n\n# Do a bayes on an array of arrays\ndef bayes(data, v, P_c):\n ret = P_c\n # Assuming read values have the same dimensions as input values\n for i in range(0, len(v)):\n ret *= bayes_single(data[i], v[i])\n return ret\n\n\n# Read data.txt into input_data\nf = open('data.txt', 'r')\ninput_data = np.loadtxt(f)\ninput_data = input_data[input_data[:, 0].argsort()]\n\n# dim and data_size stay constant throughout the program\ndim = input_data.max(axis=0)\ndata_size = len(input_data)\n\n# Make lists of data according to each dimension\ndata_list = np.split(input_data, np.where(np.diff(input_data[:, 0]))[0] + 1)\n\n# Remove dimension data\nfor i in range(0, len(data_list)):\n data_list[i] = np.swapaxes(data_list[i], 1, 0)\n data_list[i] = np.delete(data_list[i], 0, axis=0)\n\n# Get requested calculations\nrequested = np.zeros(len(data_list[0]))\nfor i in range(0, len(requested)):\n requested[i] = input('Enter ' + chr(88 + i) + ': ')\n\n# Print out answer to calculations\nfor i in range(0, len(data_list)):\n print('Class ' + str(i) + ' probability: ' + str(bayes(data_list[i],\n requested,\n len(data_list[i]) / data_size)))\n"} +{"text": "/*\n * Copyright (c) Microsoft Corporation\n *\n * All rights reserved.\n *\n * MIT License\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, 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 LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\npackage com.microsoft.azuretools.authmanage.srvpri.entities;\n\nimport java.util.UUID;\n\n/**\n * Created by vlashch on 8/18/16.\n */\npublic class ServicePrincipal {\n public UUID appId;\n public boolean accountEnabled;\n}\n"} +{"text": " /*\n * Copyright 2015, The Querydsl Team (http://www.querydsl.com/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 * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.querydsl.lucene3;\n\nimport com.querydsl.core.types.ConstantImpl;\nimport com.querydsl.core.types.dsl.StringOperation;\n\n/**\n * {@code PhraseElement} represents the embedded String as a phrase\n *\n * @author tiwe\n *\n */\npublic class PhraseElement extends StringOperation {\n\n private static final long serialVersionUID = 2350215644019186076L;\n\n public PhraseElement(String str) {\n super(LuceneOps.PHRASE, ConstantImpl.create(str));\n }\n\n}\n"} +{"text": "// Copyright 2019 Canonical Ltd.\n// Licensed under the AGPLv3, see LICENCE file for details.\n\npackage instancemutater\n\nimport (\n\t\"time\"\n\n\t\"github.com/juju/charm/v8\"\n\n\t\"github.com/juju/juju/core/cache\"\n\t\"github.com/juju/juju/core/instance\"\n\t\"github.com/juju/juju/core/lxdprofile\"\n\t\"github.com/juju/juju/core/status\"\n\t\"github.com/juju/juju/state\"\n)\n\n// InstanceMutaterState represents point of use methods from the state object.\ntype InstanceMutaterState interface {\n\tstate.EntityFinder\n\n\tApplication(appName string) (Application, error)\n\tCharm(curl *charm.URL) (Charm, error)\n\tControllerTimestamp() (*time.Time, error)\n}\n\n// Machine represents point of use methods from the state Machine object.\ntype Machine interface {\n\tInstanceId() (instance.Id, error)\n\tCharmProfiles() ([]string, error)\n\tSetCharmProfiles([]string) error\n\tSetModificationStatus(status.StatusInfo) error\n\tUnits() ([]Unit, error)\n}\n\n// Unit represents a point of use methods from the state Unit object.\ntype Unit interface {\n\tApplication() string\n}\n\n// Charm represents point of use methods from the state Charm object.\ntype Charm interface {\n\tLXDProfile() lxdprofile.Profile\n}\n\n// Application represents point of use methods from the state Application object.\ntype Application interface {\n\tCharmURL() *charm.URL\n}\n\n// ModelCache represents point of use methods from the cache\n// model\ntype ModelCache interface {\n\tName() string\n\tMachine(machineId string) (ModelCacheMachine, error)\n\tWatchMachines() (cache.StringsWatcher, error)\n}\n\n// ModelCacheMachine represents a point of use Machine from the cache package.\ntype ModelCacheMachine interface {\n\tContainerType() instance.ContainerType\n\tIsManual() bool\n\tWatchLXDProfileVerificationNeeded() (cache.NotifyWatcher, error)\n\tWatchContainers() (cache.StringsWatcher, error)\n}\n"} +{"text": "/*\n * Author: Landon Fuller \n *\n * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc.\n * All rights reserved.\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#import \n\n@interface PLCrashReportSymbolInfo : NSObject {\n@private\n /** The symbol name. */\n NSString *_symbolName;\n \n /** The symbol start address. */\n uint64_t _startAddress;\n \n /** The symbol end address, if explicitly defined. Will be 0 if unknown. */\n uint64_t _endAddress;\n}\n\n- (id) initWithSymbolName: (NSString *) symbolName\n startAddress: (uint64_t) startAddress\n endAddress: (uint64_t) endAddress;\n\n/** The symbol name. */\n@property(nonatomic, readonly) NSString *symbolName;\n\n/** The symbol start address. */\n@property(nonatomic, readonly) uint64_t startAddress;\n\n/* The symbol end address, if explicitly defined. This will only be included if the end address is\n * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess\n * heuristics.\n *\n * If unknown, the address will be 0.\n */\n@property(nonatomic, readonly) uint64_t endAddress;\n\n@end\n"} +{"text": "/**\n * PANDA 3D SOFTWARE\n * Copyright (c) Carnegie Mellon University. All rights reserved.\n *\n * All use of this software is subject to the terms of the revised BSD\n * license. You should have received a copy of this license along\n * with this source code in a file named \"LICENSE.\"\n *\n * @file directbase.cxx\n * @author drose\n * @date 2000-09-15\n */\n\n#include \"directbase.h\"\n"} +{"text": "#ifndef boxm2_render_exp_image_functor_h\n#define boxm2_render_exp_image_functor_h\n//:\n// \\file\n\n#include \n#include \n#include \n#include \n#include \n\nclass boxm2_render_vis_image_functor\n{\n public:\n // \"default\" constructor\n boxm2_render_vis_image_functor() = default;\n\n bool init_data(std::vector & datas, vil_image_view* vis_img)\n {\n alpha_data_=new boxm2_data(datas[0]->data_buffer(),datas[0]->buffer_length(),datas[0]->block_id());\n vis_img_ =vis_img;\n return true;\n }\n\n inline bool step_cell(float seg_len,int index,unsigned i, unsigned j, float abs_depth )\n {\n boxm2_data::datatype alpha=alpha_data_->data()[index];\n float vis=(*vis_img_)(i,j);\n vis*=std::exp(-alpha*seg_len);\n (*vis_img_)(i,j)=vis;\n return true;\n }\n\n private:\n boxm2_data * alpha_data_;\n vil_image_view *vis_img_;\n};\n\ntemplate \nclass boxm2_render_exp_image_functor\n{\n public:\n // \"default\" constructor\n boxm2_render_exp_image_functor() = default;\n\n inline bool init_data(std::vector & datas, vil_image_view * expected, vil_image_view* vis_img)\n {\n alpha_data_=new boxm2_data(datas[0]->data_buffer(),datas[0]->buffer_length(),datas[0]->block_id());\n mog3_data_=new boxm2_data(datas[1]->data_buffer(),datas[1]->buffer_length(),datas[1]->block_id());\n expected_img_=expected;\n vis_img_ =vis_img;\n return true;\n }\n\n inline bool step_cell(float seg_len,int index,unsigned i, unsigned j, float abs_depth )\n {\n boxm2_data::datatype alpha=alpha_data_->data()[index];\n float vis=(*vis_img_)(i,j);\n float exp_int=(*expected_img_)(i,j);\n float curr_p=(1-std::exp(-alpha*seg_len))*vis;\n float exp_color = boxm2_processor_type::type::expected_color(mog3_data_->data()[index]);\n exp_int += curr_p * exp_color;\n (*expected_img_)(i,j)=exp_int;\n vis*=std::exp(-alpha*seg_len);\n (*vis_img_)(i,j)=vis;\n return true;\n }\n\n private:\n boxm2_data * alpha_data_;\n boxm2_data * mog3_data_;\n vil_image_view *expected_img_;\n vil_image_view *vis_img_;\n};\n\n//: Functor class to normalize expected image\nclass normalize_intensity\n{\n public:\n normalize_intensity() = default;\n\n void operator()(float mask, float &pix) const\n {\n pix+=mask*0.5f;\n }\n};\n\n#endif\n"} +{"text": "/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n}\n\nmodule.exports = composeArgsRight;\n"} +{"text": "// Copyright 2009 the Sputnik authors. All rights reserved.\n// This code is governed by the BSD license found in the LICENSE file.\n\n/**\n * @name: S15.9.5.40_A3_T1;\n * @section: 15.9.5.40;\n * @assertion: The Date.prototype.setFullYear property \"length\" has { ReadOnly, DontDelete, DontEnum } attributes;\n * @description: Checking ReadOnly attribute;\n */\n\nx = Date.prototype.setFullYear.length;\nDate.prototype.setFullYear.length = 1;\nif (Date.prototype.setFullYear.length !== x) {\n $ERROR('#1: The Date.prototype.setFullYear.length has the attribute ReadOnly');\n}\n\n"} +{"text": "#py2.7\r\nimport os\r\n\r\npath0='ardscript'\r\npath2='new2'\r\npath3='new3'\r\nif path3 not in os.listdir('.'):\r\n os.mkdir(path3)\r\nfiles2=os.listdir(path2)\r\nfor name in os.listdir(path0):\r\n if name not in files2: continue\r\n f0=open(path0+os.sep+name,'rb')\r\n f2=open(path2+os.sep+name,'rb')\r\n lines0=f0.read().decode('utf-16').replace(u'\\r\\n',u'\\n').split('\\n')\r\n lines2=f2.read().decode('utf-16').replace(u'\\r\\n',u'\\n').split('\\n')\r\n f0.close()\r\n f2.close()\r\n \r\n newtxt=[]\r\n i2=0\r\n for line in lines0:\r\n if len(line)<3:\r\n newtxt.append(line)\r\n elif line[0:2]==u'\\\\w':\r\n## newtxt.append(line[2:line.find(u'\\\\h')])\r\n nl=line[0:2]+lines2[i2]+line[line.find(u'\\\\h'):]\r\n i2+=1\r\n newtxt.append(nl)\r\n elif ord(line[0].encode('gbk')[0])>0x80:\r\n## newtxt.append(line[0:line.find(u'\\\\h')])\r\n nl=lines2[i2]+line[line.find(u'\\\\h'):]\r\n i2+=1\r\n newtxt.append(nl)\r\n elif line[0]=='\"':\r\n## newtxt.append(line[1:line.find(u'\"',1)])\r\n nl='\"'+lines2[i2]+line[line.find(u'\"',1):]\r\n i2+=1\r\n newtxt.append(nl)\r\n else:\r\n newtxt.append(line)\r\n fs=file(path3+os.sep+name,'wb')\r\n fs.write(u'\\r\\n'.join(newtxt).encode('utf_16'))\r\n fs.close()\r\n"} +{"text": "/**\n * Copyright 2013-2015 Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BeforeInputEventPlugin\n * @typechecks static-only\n */\n\n'use strict';\n\nvar EventConstants = require('EventConstants');\nvar EventPropagators = require('EventPropagators');\nvar ExecutionEnvironment = require('ExecutionEnvironment');\nvar FallbackCompositionState = require('FallbackCompositionState');\nvar SyntheticCompositionEvent = require('SyntheticCompositionEvent');\nvar SyntheticInputEvent = require('SyntheticInputEvent');\n\nvar keyOf = require('keyOf');\n\nvar END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space\nvar START_KEYCODE = 229;\n\nvar canUseCompositionEvent = (\n ExecutionEnvironment.canUseDOM &&\n 'CompositionEvent' in window\n);\n\nvar documentMode = null;\nif (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {\n documentMode = document.documentMode;\n}\n\n// Webkit offers a very useful `textInput` event that can be used to\n// directly represent `beforeInput`. The IE `textinput` event is not as\n// useful, so we don't use it.\nvar canUseTextInputEvent = (\n ExecutionEnvironment.canUseDOM &&\n 'TextEvent' in window &&\n !documentMode &&\n !isPresto()\n);\n\n// In IE9+, we have access to composition events, but the data supplied\n// by the native compositionend event may be incorrect. Japanese ideographic\n// spaces, for instance (\\u3000) are not recorded correctly.\nvar useFallbackCompositionData = (\n ExecutionEnvironment.canUseDOM &&\n (\n !canUseCompositionEvent ||\n (documentMode && documentMode > 8 && documentMode <= 11)\n )\n);\n\n/**\n * Opera <= 12 includes TextEvent in window, but does not fire\n * text input events. Rely on keypress instead.\n */\nfunction isPresto() {\n var opera = window.opera;\n return (\n typeof opera === 'object' &&\n typeof opera.version === 'function' &&\n parseInt(opera.version(), 10) <= 12\n );\n}\n\nvar SPACEBAR_CODE = 32;\nvar SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);\n\nvar topLevelTypes = EventConstants.topLevelTypes;\n\n// Events and their corresponding property names.\nvar eventTypes = {\n beforeInput: {\n phasedRegistrationNames: {\n bubbled: keyOf({onBeforeInput: null}),\n captured: keyOf({onBeforeInputCapture: null}),\n },\n dependencies: [\n topLevelTypes.topCompositionEnd,\n topLevelTypes.topKeyPress,\n topLevelTypes.topTextInput,\n topLevelTypes.topPaste,\n ],\n },\n compositionEnd: {\n phasedRegistrationNames: {\n bubbled: keyOf({onCompositionEnd: null}),\n captured: keyOf({onCompositionEndCapture: null}),\n },\n dependencies: [\n topLevelTypes.topBlur,\n topLevelTypes.topCompositionEnd,\n topLevelTypes.topKeyDown,\n topLevelTypes.topKeyPress,\n topLevelTypes.topKeyUp,\n topLevelTypes.topMouseDown,\n ],\n },\n compositionStart: {\n phasedRegistrationNames: {\n bubbled: keyOf({onCompositionStart: null}),\n captured: keyOf({onCompositionStartCapture: null}),\n },\n dependencies: [\n topLevelTypes.topBlur,\n topLevelTypes.topCompositionStart,\n topLevelTypes.topKeyDown,\n topLevelTypes.topKeyPress,\n topLevelTypes.topKeyUp,\n topLevelTypes.topMouseDown,\n ],\n },\n compositionUpdate: {\n phasedRegistrationNames: {\n bubbled: keyOf({onCompositionUpdate: null}),\n captured: keyOf({onCompositionUpdateCapture: null}),\n },\n dependencies: [\n topLevelTypes.topBlur,\n topLevelTypes.topCompositionUpdate,\n topLevelTypes.topKeyDown,\n topLevelTypes.topKeyPress,\n topLevelTypes.topKeyUp,\n topLevelTypes.topMouseDown,\n ],\n },\n};\n\n// Track whether we've ever handled a keypress on the space key.\nvar hasSpaceKeypress = false;\n\n/**\n * Return whether a native keypress event is assumed to be a command.\n * This is required because Firefox fires `keypress` events for key commands\n * (cut, copy, select-all, etc.) even though no character is inserted.\n */\nfunction isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}\n\n\n/**\n * Translate native top level events into event types.\n *\n * @param {string} topLevelType\n * @return {object}\n */\nfunction getCompositionEventType(topLevelType) {\n switch (topLevelType) {\n case topLevelTypes.topCompositionStart:\n return eventTypes.compositionStart;\n case topLevelTypes.topCompositionEnd:\n return eventTypes.compositionEnd;\n case topLevelTypes.topCompositionUpdate:\n return eventTypes.compositionUpdate;\n }\n}\n\n/**\n * Does our fallback best-guess model think this event signifies that\n * composition has begun?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\nfunction isFallbackCompositionStart(topLevelType, nativeEvent) {\n return (\n topLevelType === topLevelTypes.topKeyDown &&\n nativeEvent.keyCode === START_KEYCODE\n );\n}\n\n/**\n * Does our fallback mode think that this event is the end of composition?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\nfunction isFallbackCompositionEnd(topLevelType, nativeEvent) {\n switch (topLevelType) {\n case topLevelTypes.topKeyUp:\n // Command keys insert or clear IME input.\n return (END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1);\n case topLevelTypes.topKeyDown:\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return (nativeEvent.keyCode !== START_KEYCODE);\n case topLevelTypes.topKeyPress:\n case topLevelTypes.topMouseDown:\n case topLevelTypes.topBlur:\n // Events are not possible without cancelling IME.\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Google Input Tools provides composition data via a CustomEvent,\n * with the `data` property populated in the `detail` object. If this\n * is available on the event object, use it. If not, this is a plain\n * composition event and we have nothing special to extract.\n *\n * @param {object} nativeEvent\n * @return {?string}\n */\nfunction getDataFromCustomEvent(nativeEvent) {\n var detail = nativeEvent.detail;\n if (typeof detail === 'object' && 'data' in detail) {\n return detail.data;\n }\n return null;\n}\n\n// Track the current IME composition fallback object, if any.\nvar currentComposition = null;\n\n/**\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {DOMEventTarget} topLevelTarget The listening component root node.\n * @param {string} topLevelTargetID ID of `topLevelTarget`.\n * @param {object} nativeEvent Native browser event.\n * @return {?object} A SyntheticCompositionEvent.\n */\nfunction extractCompositionEvent(\n topLevelType,\n topLevelTarget,\n topLevelTargetID,\n nativeEvent\n) {\n var eventType;\n var fallbackData;\n\n if (canUseCompositionEvent) {\n eventType = getCompositionEventType(topLevelType);\n } else if (!currentComposition) {\n if (isFallbackCompositionStart(topLevelType, nativeEvent)) {\n eventType = eventTypes.compositionStart;\n }\n } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {\n eventType = eventTypes.compositionEnd;\n }\n\n if (!eventType) {\n return null;\n }\n\n if (useFallbackCompositionData) {\n // The current composition is stored statically and must not be\n // overwritten while composition continues.\n if (!currentComposition && eventType === eventTypes.compositionStart) {\n currentComposition = FallbackCompositionState.getPooled(topLevelTarget);\n } else if (eventType === eventTypes.compositionEnd) {\n if (currentComposition) {\n fallbackData = currentComposition.getData();\n }\n }\n }\n\n var event = SyntheticCompositionEvent.getPooled(\n eventType,\n topLevelTargetID,\n nativeEvent\n );\n\n if (fallbackData) {\n // Inject data generated from fallback path into the synthetic event.\n // This matches the property of native CompositionEventInterface.\n event.data = fallbackData;\n } else {\n var customData = getDataFromCustomEvent(nativeEvent);\n if (customData !== null) {\n event.data = customData;\n }\n }\n\n EventPropagators.accumulateTwoPhaseDispatches(event);\n return event;\n}\n\n/**\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {object} nativeEvent Native browser event.\n * @return {?string} The string corresponding to this `beforeInput` event.\n */\nfunction getNativeBeforeInputChars(topLevelType, nativeEvent) {\n switch (topLevelType) {\n case topLevelTypes.topCompositionEnd:\n return getDataFromCustomEvent(nativeEvent);\n case topLevelTypes.topKeyPress:\n /**\n * If native `textInput` events are available, our goal is to make\n * use of them. However, there is a special case: the spacebar key.\n * In Webkit, preventing default on a spacebar `textInput` event\n * cancels character insertion, but it *also* causes the browser\n * to fall back to its default spacebar behavior of scrolling the\n * page.\n *\n * Tracking at:\n * https://code.google.com/p/chromium/issues/detail?id=355103\n *\n * To avoid this issue, use the keypress event as if no `textInput`\n * event is available.\n */\n var which = nativeEvent.which;\n if (which !== SPACEBAR_CODE) {\n return null;\n }\n\n hasSpaceKeypress = true;\n return SPACEBAR_CHAR;\n\n case topLevelTypes.topTextInput:\n // Record the characters to be added to the DOM.\n var chars = nativeEvent.data;\n\n // If it's a spacebar character, assume that we have already handled\n // it at the keypress level and bail immediately. Android Chrome\n // doesn't give us keycodes, so we need to blacklist it.\n if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {\n return null;\n }\n\n return chars;\n\n default:\n // For other native event types, do nothing.\n return null;\n }\n}\n\n/**\n * For browsers that do not provide the `textInput` event, extract the\n * appropriate string to use for SyntheticInputEvent.\n *\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {object} nativeEvent Native browser event.\n * @return {?string} The fallback string for this `beforeInput` event.\n */\nfunction getFallbackBeforeInputChars(topLevelType, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n if (currentComposition) {\n if (\n topLevelType === topLevelTypes.topCompositionEnd ||\n isFallbackCompositionEnd(topLevelType, nativeEvent)\n ) {\n var chars = currentComposition.getData();\n FallbackCompositionState.release(currentComposition);\n currentComposition = null;\n return chars;\n }\n return null;\n }\n\n switch (topLevelType) {\n case topLevelTypes.topPaste:\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n case topLevelTypes.topKeyPress:\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {\n return String.fromCharCode(nativeEvent.which);\n }\n return null;\n case topLevelTypes.topCompositionEnd:\n return useFallbackCompositionData ? null : nativeEvent.data;\n default:\n return null;\n }\n}\n\n/**\n * Extract a SyntheticInputEvent for `beforeInput`, based on either native\n * `textInput` or fallback behavior.\n *\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {DOMEventTarget} topLevelTarget The listening component root node.\n * @param {string} topLevelTargetID ID of `topLevelTarget`.\n * @param {object} nativeEvent Native browser event.\n * @return {?object} A SyntheticInputEvent.\n */\nfunction extractBeforeInputEvent(\n topLevelType,\n topLevelTarget,\n topLevelTargetID,\n nativeEvent\n) {\n var chars;\n\n if (canUseTextInputEvent) {\n chars = getNativeBeforeInputChars(topLevelType, nativeEvent);\n } else {\n chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);\n }\n\n // If no characters are being inserted, no BeforeInput event should\n // be fired.\n if (!chars) {\n return null;\n }\n\n var event = SyntheticInputEvent.getPooled(\n eventTypes.beforeInput,\n topLevelTargetID,\n nativeEvent\n );\n\n event.data = chars;\n EventPropagators.accumulateTwoPhaseDispatches(event);\n return event;\n}\n\n/**\n * Create an `onBeforeInput` event to match\n * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.\n *\n * This event plugin is based on the native `textInput` event\n * available in Chrome, Safari, Opera, and IE. This event fires after\n * `onKeyPress` and `onCompositionEnd`, but before `onInput`.\n *\n * `beforeInput` is spec'd but not implemented in any browsers, and\n * the `input` event does not provide any useful information about what has\n * actually been added, contrary to the spec. Thus, `textInput` is the best\n * available event to identify the characters that have actually been inserted\n * into the target node.\n *\n * This plugin is also responsible for emitting `composition` events, thus\n * allowing us to share composition fallback code for both `beforeInput` and\n * `composition` event types.\n */\nvar BeforeInputEventPlugin = {\n\n eventTypes: eventTypes,\n\n /**\n * @param {string} topLevelType Record from `EventConstants`.\n * @param {DOMEventTarget} topLevelTarget The listening component root node.\n * @param {string} topLevelTargetID ID of `topLevelTarget`.\n * @param {object} nativeEvent Native browser event.\n * @return {*} An accumulation of synthetic events.\n * @see {EventPluginHub.extractEvents}\n */\n extractEvents: function(\n topLevelType,\n topLevelTarget,\n topLevelTargetID,\n nativeEvent\n ) {\n return [\n extractCompositionEvent(\n topLevelType,\n topLevelTarget,\n topLevelTargetID,\n nativeEvent\n ),\n extractBeforeInputEvent(\n topLevelType,\n topLevelTarget,\n topLevelTargetID,\n nativeEvent\n ),\n ];\n },\n};\n\nmodule.exports = BeforeInputEventPlugin;\n"} +{"text": "/*\n * Project: Digital Wristwatch\n * Author: Zak Kemble, contact@zakkemble.co.uk\n * Copyright: (C) 2013 by Zak Kemble\n * License: GNU GPL v3 (see License.txt)\n * Web: http://blog.zakkemble.co.uk/diy-digital-wristwatch/\n */\n\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\nusing System.Text;\nusing System.IO;\nusing System.Drawing.Imaging;\n\nnamespace bitmapConverter\n{\n class converter\n {\n private Bitmap img; // Image\n private string lastErrorStr = \"\";\n private StringBuilder code = new StringBuilder();\n private string varName = \"\"; // File name without extension\n\n // Get last error\n public string lastError()\n {\n return lastErrorStr;\n }\n\n // Load image\n public bool load(string file, bool horizontal)\n {\n // Try to load image\n try\n {\n using (Bitmap temp = new Bitmap(file))\n {\n if (img != null)\n {\n img.Dispose();\n img = null;\n }\n\n int width = temp.Width;\n if (horizontal && width % 8 != 0)\n width += 8-(width % 8);\n\n // Make sure image is in the right format\n img = new Bitmap(width, temp.Height, PixelFormat.Format32bppArgb);\n using (Graphics g = Graphics.FromImage(img))\n {\n g.Clear(Color.Transparent);\n g.DrawImage(temp, 0, 0, temp.Width, temp.Height);\n }\n }\n }\n catch (Exception ex)\n {\n lastErrorStr = ex.Message;\n return false;\n }\n\n varName = Path.GetFileNameWithoutExtension(file);\n\n redToGreyHex(horizontal);\n\n return true;\n }\n\n // Get red values from image\n private void redToGreyHex(bool horizontal)\n {\n //code.Clear();\n code.Length = 0;\n code.Capacity = 0;\n\n code.AppendLine(\"const byte \" + varName + \"[] PROGMEM ={\");\n\n if (horizontal)\n {\n for (int y = 0; y < img.Height; y++)\n {\n for (int x = 0; x < img.Width / 8; x++)\n {\n byte val = 0;\n for (int b = 0; b < 8; b++)\n {\n // Get pixel info\n Color pixel = img.GetPixel((x * 8) + b, y);\n byte red = pixel.R;\n byte alpha = pixel.A;\n\n // A black pixel must be fully opaque and have no red, anything else makes a white pixel\n bool pixelIsBlack = (red == 0 && alpha == 255);\n\n // Apply to preview image\n img.SetPixel((x * 8) + b, y, Color.FromKnownColor(pixelIsBlack ? KnownColor.Black : KnownColor.White));\n\n // Apply to generated code\n if (pixelIsBlack)\n val |= (byte)(1 << (7 - b));\n }\n code.AppendFormat(\"0x{0:X2},\", val);\n }\n code.Append(Environment.NewLine);\n }\n }\n else\n {\n for (int y = 0; y < img.Height / 8; y++)\n {\n for (int x = 0; x < img.Width; x++)\n {\n byte val = 0;\n for (int b = 0; b < 8; b++)\n {\n // Get pixel info\n Color pixel = img.GetPixel(x, (y * 8) + b);\n byte red = pixel.R;\n byte alpha = pixel.A;\n\n // A black pixel must be fully opaque and have no red, anything else makes a white pixel\n bool pixelIsBlack = (red == 0 && alpha == 255);\n\n // Apply to preview image\n img.SetPixel(x, (y * 8) + b, Color.FromKnownColor(pixelIsBlack ? KnownColor.Black : KnownColor.White));\n\n // Apply to generated code\n if (pixelIsBlack)\n val |= (byte)(1 << b);\n }\n code.AppendFormat(\"0x{0:X2},\", val);\n }\n code.Append(Environment.NewLine);\n }\n }\n\n code.AppendLine(\"};\");\n }\n\n public string getCode()\n {\n return code.ToString();\n }\n\n public Bitmap getImage()\n {\n return img;\n }\n }\n}\n"} +{"text": "#include \"qtscriptshell_QStyleOptionViewItem.h\"\n\n#include \n#include \n#include \n#include \n\n#define QTSCRIPT_IS_GENERATED_FUNCTION(fun) ((fun.data().toUInt32() & 0xFFFF0000) == 0xBABE0000)\n\n\nQtScriptShell_QStyleOptionViewItem::QtScriptShell_QStyleOptionViewItem()\n : QStyleOptionViewItem() {}\n\nQtScriptShell_QStyleOptionViewItem::QtScriptShell_QStyleOptionViewItem(const QStyleOptionViewItem& other)\n : QStyleOptionViewItem(other) {}\n\nQtScriptShell_QStyleOptionViewItem::QtScriptShell_QStyleOptionViewItem(int version)\n : QStyleOptionViewItem(version) {}\n\nQtScriptShell_QStyleOptionViewItem::~QtScriptShell_QStyleOptionViewItem() {}\n\n"} +{"text": "# pylint: disable=bare-except\n\n# Imports\n\nimport types\n\n__author__ = \"ContraxSuite, LLC; LexPredict, LLC\"\n__copyright__ = \"Copyright 2015-2020, ContraxSuite, LLC\"\n__license__ = \"https://github.com/LexPredict/lexpredict-lexnlp/blob/1.7.0/LICENSE\"\n__version__ = \"1.7.0\"\n__maintainer__ = \"LexPredict, LLC\"\n__email__ = \"support@contraxsuite.com\"\n\n\ndef safe_failure(func):\n \"\"\"\n return None on failure, either skip result if generator\n \"\"\"\n def decorator(*args, **kwargs):\n raise_exc = not kwargs.pop('safe_failure', True)\n try:\n res = func(*args, **kwargs)\n if isinstance(res, types.GeneratorType):\n try:\n yield from func(*args, **kwargs)\n except:\n if raise_exc:\n raise\n except:\n if raise_exc:\n raise\n return None\n\n return decorator\n"} +{"text": "'use strict';\n\n/*!\n * Module dependencies.\n */\n\nvar RegExpClone = require('regexp-clone')\n\n/**\n * Clones objects\n *\n * @param {Object} obj the object to clone\n * @param {Object} options\n * @return {Object} the cloned object\n * @api private\n */\n\nvar clone = exports.clone = function clone (obj, options) {\n if (obj === undefined || obj === null)\n return obj;\n\n if (Array.isArray(obj))\n return exports.cloneArray(obj, options);\n\n if (obj.constructor) {\n if (/ObjectI[dD]$/.test(obj.constructor.name)) {\n return 'function' == typeof obj.clone\n ? obj.clone()\n : new obj.constructor(obj.id);\n }\n\n if ('ReadPreference' === obj._type && obj.isValid && obj.toObject) {\n return 'function' == typeof obj.clone\n ? obj.clone()\n : new obj.constructor(obj.mode, clone(obj.tags, options));\n }\n\n if ('Binary' == obj._bsontype && obj.buffer && obj.value) {\n return 'function' == typeof obj.clone\n ? obj.clone()\n : new obj.constructor(obj.value(true), obj.sub_type);\n }\n\n if ('Date' === obj.constructor.name || 'Function' === obj.constructor.name)\n return new obj.constructor(+obj);\n\n if ('RegExp' === obj.constructor.name)\n return RegExpClone(obj);\n\n if ('Buffer' === obj.constructor.name)\n return exports.cloneBuffer(obj);\n }\n\n if (isObject(obj))\n return exports.cloneObject(obj, options);\n\n if (obj.valueOf)\n return obj.valueOf();\n};\n\n/*!\n * ignore\n */\n\nvar cloneObject = exports.cloneObject = function cloneObject (obj, options) {\n var retainKeyOrder = options && options.retainKeyOrder\n , minimize = options && options.minimize\n , ret = {}\n , hasKeys\n , keys\n , val\n , k\n , i\n\n if (retainKeyOrder) {\n for (k in obj) {\n val = clone(obj[k], options);\n\n if (!minimize || ('undefined' !== typeof val)) {\n hasKeys || (hasKeys = true);\n ret[k] = val;\n }\n }\n } else {\n // faster\n\n keys = Object.keys(obj);\n i = keys.length;\n\n while (i--) {\n k = keys[i];\n val = clone(obj[k], options);\n\n if (!minimize || ('undefined' !== typeof val)) {\n if (!hasKeys) hasKeys = true;\n ret[k] = val;\n }\n }\n }\n\n return minimize\n ? hasKeys && ret\n : ret;\n};\n\nvar cloneArray = exports.cloneArray = function cloneArray (arr, options) {\n var ret = [];\n for (var i = 0, l = arr.length; i < l; i++)\n ret.push(clone(arr[i], options));\n return ret;\n};\n\n/**\n * process.nextTick helper.\n *\n * Wraps the given `callback` in a try/catch. If an error is\n * caught it will be thrown on nextTick.\n *\n * node-mongodb-native had a habit of state corruption when\n * an error was immediately thrown from within a collection\n * method (find, update, etc) callback.\n *\n * @param {Function} [callback]\n * @api private\n */\n\nvar tick = exports.tick = function tick (callback) {\n if ('function' !== typeof callback) return;\n return function () {\n // callbacks should always be fired on the next\n // turn of the event loop. A side benefit is\n // errors thrown from executing the callback\n // will not cause drivers state to be corrupted\n // which has historically been a problem.\n var args = arguments;\n soon(function(){\n callback.apply(this, args);\n });\n }\n}\n\n/**\n * Merges `from` into `to` without overwriting existing properties.\n *\n * @param {Object} to\n * @param {Object} from\n * @api private\n */\n\nvar merge = exports.merge = function merge (to, from) {\n var keys = Object.keys(from)\n , i = keys.length\n , key\n\n while (i--) {\n key = keys[i];\n if ('undefined' === typeof to[key]) {\n to[key] = from[key];\n } else {\n if (exports.isObject(from[key])) {\n merge(to[key], from[key]);\n } else {\n to[key] = from[key];\n }\n }\n }\n}\n\n/**\n * Same as merge but clones the assigned values.\n *\n * @param {Object} to\n * @param {Object} from\n * @api private\n */\n\nvar mergeClone = exports.mergeClone = function mergeClone (to, from) {\n var keys = Object.keys(from)\n , i = keys.length\n , key\n\n while (i--) {\n key = keys[i];\n if ('undefined' === typeof to[key]) {\n // make sure to retain key order here because of a bug handling the $each\n // operator in mongodb 2.4.4\n to[key] = clone(from[key], { retainKeyOrder : 1});\n } else {\n if (exports.isObject(from[key])) {\n mergeClone(to[key], from[key]);\n } else {\n // make sure to retain key order here because of a bug handling the\n // $each operator in mongodb 2.4.4\n to[key] = clone(from[key], { retainKeyOrder : 1});\n }\n }\n }\n}\n\n/**\n * Read pref helper (mongo 2.2 drivers support this)\n *\n * Allows using aliases instead of full preference names:\n *\n * p primary\n * pp primaryPreferred\n * s secondary\n * sp secondaryPreferred\n * n nearest\n *\n * @param {String} pref\n */\n\nexports.readPref = function readPref (pref) {\n switch (pref) {\n case 'p':\n pref = 'primary';\n break;\n case 'pp':\n pref = 'primaryPreferred';\n break;\n case 's':\n pref = 'secondary';\n break;\n case 'sp':\n pref = 'secondaryPreferred';\n break;\n case 'n':\n pref = 'nearest';\n break;\n }\n\n return pref;\n}\n\n/**\n * Object.prototype.toString.call helper\n */\n\nvar _toString = Object.prototype.toString;\nvar toString = exports.toString = function (arg) {\n return _toString.call(arg);\n}\n\n/**\n * Determines if `arg` is an object.\n *\n * @param {Object|Array|String|Function|RegExp|any} arg\n * @return {Boolean}\n */\n\nvar isObject = exports.isObject = function (arg) {\n return '[object Object]' == exports.toString(arg);\n}\n\n/**\n * Determines if `arg` is an array.\n *\n * @param {Object}\n * @return {Boolean}\n * @see nodejs utils\n */\n\nvar isArray = exports.isArray = function (arg) {\n return Array.isArray(arg) ||\n 'object' == typeof arg && '[object Array]' == exports.toString(arg);\n}\n\n/**\n * Object.keys helper\n */\n\nexports.keys = Object.keys || function (obj) {\n var keys = [];\n for (var k in obj) if (obj.hasOwnProperty(k)) {\n keys.push(k);\n }\n return keys;\n}\n\n/**\n * Basic Object.create polyfill.\n * Only one argument is supported.\n *\n * Based on https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create\n */\n\nexports.create = 'function' == typeof Object.create\n ? Object.create\n : create;\n\nfunction create (proto) {\n if (arguments.length > 1) {\n throw new Error(\"Adding properties is not supported\")\n }\n\n function F () {}\n F.prototype = proto;\n return new F;\n}\n\n/**\n * inheritance\n */\n\nexports.inherits = function (ctor, superCtor) {\n ctor.prototype = exports.create(superCtor.prototype);\n ctor.prototype.constructor = ctor;\n}\n\n/**\n * nextTick helper\n * compat with node 0.10 which behaves differently than previous versions\n */\n\nvar soon = exports.soon = 'function' == typeof setImmediate\n ? setImmediate\n : process.nextTick;\n\n/**\n * Clones the contents of a buffer.\n *\n * @param {Buffer} buff\n * @return {Buffer}\n */\n\nexports.cloneBuffer = function (buff) {\n var dupe = new Buffer(buff.length);\n buff.copy(dupe, 0, 0, buff.length);\n return dupe;\n};\n"} +{"text": "PROGS = gpioctl\n\nINSTDIR = $(prefix)/usr/bin\nINSTMODE = 0755\nINSTOWNER = root\nINSTGROUP = root\n\nOBJS = main.o\n\nall: $(PROGS)\n$(PROGS): $(OBJS)\n\t$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@\n\t$(STRIP) $@\n\n%.o: %.c\n\t$(CC) -c $(CFLAGS) $^ -o $@\n\ninstall: $(PROGS)\n\t$(INSTALL) -d $(INSTDIR)\n\t$(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) $(PROGS) $(INSTDIR)\n\nclean:\n\trm -f $(PROGS) *.o core\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"} +{"text": "#include \n#include \n\n/*-----------------------------------------------*/\n/* the following lines are specific to this file */\n/*-----------------------------------------------*/\n\n/* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR\n * and VER_INTERNALNAME_STR must be defined before including COMMON.VER\n * The strings don't need a '\\0', since common.ver has them.\n */\n#define\tVER_FILETYPE\tVFT_DLL\n/* possible values:\t\tVFT_UNKNOWN\n\t\t\t\tVFT_APP\n\t\t\t\tVFT_DLL\n\t\t\t\tVFT_DRV\n\t\t\t\tVFT_FONT\n\t\t\t\tVFT_VXD\n\t\t\t\tVFT_STATIC_LIB\n*/\n#define\tVER_FILESUBTYPE\tVFT2_UNKNOWN\n/* possible values\t\tVFT2_UNKNOWN\n\t\t\t\tVFT2_DRV_PRINTER\n\t\t\t\tVFT2_DRV_KEYBOARD\n\t\t\t\tVFT2_DRV_LANGUAGE\n\t\t\t\tVFT2_DRV_DISPLAY\n\t\t\t\tVFT2_DRV_MOUSE\n\t\t\t\tVFT2_DRV_NETWORK\n\t\t\t\tVFT2_DRV_SYSTEM\n\t\t\t\tVFT2_DRV_INSTALLABLE\n\t\t\t\tVFT2_DRV_SOUND\n\t\t\t\tVFT2_DRV_COMM\n*/\n#define VER_FILEDESCRIPTION_STR \"Network Card Detection - User Mode APIs\"\n#define VER_INTERNALNAME_STR \"NETDTECT.DLL\"\n#define VER_ORIGINALFILENAME_STR \"NETDTECT.DLL\"\n\n#include \"common.ver\"\n\n"} +{"text": "/**\n * Copyright (C) 2002-2020 The FreeCol Team\n *\n * This file is part of FreeCol.\n *\n * FreeCol 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 * FreeCol 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 FreeCol. If not, see .\n */\n\npackage net.sf.freecol.client.gui.action;\n\nimport java.awt.event.ActionEvent;\nimport java.awt.event.KeyEvent;\n\nimport javax.swing.JRadioButtonMenuItem;\nimport javax.swing.KeyStroke;\n\nimport net.sf.freecol.client.ClientOptions;\nimport net.sf.freecol.client.FreeColClient;\n\nimport static net.sf.freecol.common.util.StringUtils.*;\n\n\n/**\n * Display text over tiles.\n */\npublic final class DisplayTileTextAction extends SelectableAction {\n\n public static final String id = \"displayTileTextAction.\";\n\n // FIXME: make ClientOptions use enum\n public static enum DisplayText {\n EMPTY, NAMES, OWNERS, REGIONS;\n\n public String getKey() {\n return getEnumKey(this);\n }\n };\n\n private static final int[] accelerators = {\n KeyEvent.VK_E,\n KeyEvent.VK_N,\n KeyEvent.VK_O,\n KeyEvent.VK_R\n };\n\n private DisplayText display = null;\n\n\n /**\n * Creates this action\n *\n * @param freeColClient The {@code FreeColClient} for the game.\n * @param type a {@code DisplayText} value\n */\n public DisplayTileTextAction(FreeColClient freeColClient,\n DisplayText type) {\n super(freeColClient, id + type.getKey(),\n ClientOptions.DISPLAY_TILE_TEXT);\n display = type;\n setAccelerator(KeyStroke.getKeyStroke(accelerators[type.ordinal()],\n KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK));\n setSelected(shouldBeSelected());\n }\n\n\n // Override SelectableAction\n\n /**\n * {@inheritDoc}\n */\n @Override\n public boolean shouldBeSelected() {\n return display != null\n && freeColClient.getClientOptions() != null\n && freeColClient.getClientOptions().getDisplayTileText()\n == display.ordinal()\n && super.shouldBeEnabled();\n }\n\n\n // Interface ActionListener\n\n /**\n * {@inheritDoc}\n */\n @Override\n public void actionPerformed(ActionEvent ae) {\n if (((JRadioButtonMenuItem)ae.getSource()).isSelected()) {\n freeColClient.getClientOptions()\n .setInteger(ClientOptions.DISPLAY_TILE_TEXT, display.ordinal());\n getGUI().refresh();\n }\n }\n}\n"} +{"text": "/*=============================================================================\r\n Copyright (c) 2001-2014 Joel de Guzman\r\n\r\n Distributed under the Boost Software License, Version 1.0. (See accompanying\r\n file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r\n==============================================================================*/\r\n#if !defined(BOOST_SPIRIT_X3_CHAR_FEBRUARY_02_2007_0921AM)\r\n#define BOOST_SPIRIT_X3_CHAR_FEBRUARY_02_2007_0921AM\r\n\r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n\r\n#if defined(BOOST_SPIRIT_X3_UNICODE)\r\n#include \r\n#endif\r\n\r\n#endif\r\n"} +{"text": "# Copyright (c) 2015 Red Hat, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n# implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport json\n\nfrom autobahn.asyncio import websocket\nimport msgpack\nfrom oslo_utils import uuidutils\n\nfrom zaqar.transport.websocket import protocol\n\n\nclass ProtocolFactory(websocket.WebSocketServerFactory):\n\n protocol = protocol.MessagingProtocol\n\n def __init__(self, uri, handler, external_port, auth_strategy,\n loop, secret_key):\n websocket.WebSocketServerFactory.__init__(\n self, url=uri, externalPort=external_port)\n self._handler = handler\n self._auth_strategy = auth_strategy\n self._loop = loop\n self._secret_key = secret_key\n self._protos = {}\n\n def __call__(self):\n proto_id = uuidutils.generate_uuid()\n proto = self.protocol(self._handler, proto_id, self._auth_strategy,\n self._loop)\n self._protos[proto_id] = proto\n proto.factory = self\n return proto\n\n def unregister(self, proto_id):\n self._protos.pop(proto_id)\n\n\nclass NotificationFactory(object):\n\n protocol = protocol.NotificationProtocol\n\n def __init__(self, factory):\n self.message_factory = factory\n\n def set_subscription_url(self, url):\n self._subscription_url = url\n\n def get_subscriber(self, protocol):\n return '%s%s' % (self._subscription_url, protocol.proto_id)\n\n def send_data(self, data, proto_id):\n instance = self.message_factory._protos.get(proto_id)\n if instance:\n # NOTE(Eva-i): incoming data is encoded in JSON, let's convert it\n # to MsgPack, if notification should be encoded in binary format.\n if instance.notify_in_binary:\n data = msgpack.packb(json.loads(data))\n instance.sendMessage(data, instance.notify_in_binary)\n\n def __call__(self):\n return self.protocol(self)\n"} +{"text": "#!/usr/bin/env python3\n\n'''\nname: Zookeeper 未授权访问漏洞\ndescription: Zookeeper 未授权访问漏洞\n'''\n\nfrom urllib.parse import urlparse\nfrom kazoo.client import KazooClient\n\nclass Zookeeper_Unauthorized_BaseVerify:\n def __init__(self, url):\n self.ip = urlparse(url).hostname\n self.port =urlparse(url).port\n if not self.port:\n self.port = '80'\n\n def run(self):\n try:\n zk = KazooClient(hosts='{}:{}'.format(self.ip, self.port))\n zk.start()\n chidlrens = zk.get_children('/')\n if len(chidlrens) > 0:\n print('存在Zookeeper 未授权访问漏洞')\n return True\n except Exception as e:\n print(e)\n return False\n finally:\n zk.stop()\n\nif __name__ == '__main__':\n Zookeeper_Unauthorized = Zookeeper_Unauthorized_BaseVerify('http://baidu.com')\n Zookeeper_Unauthorized.run()\n\n"} +{"text": "{\n \"PdfRendererIndex.enterFullscreen\": \"সম্পূর্ণ স্ক্রিনে দেখুন\",\n \"PdfRendererIndex.exitFullscreen\": \"সম্পূর্ণ স্ক্রিন থেকে বেরিয়ে আসুন\"\n}"} +{"text": "//\n// DirectoryIterator_WIN32U.h\n//\n// $Id: //poco/1.4/Foundation/include/Poco/DirectoryIterator_WIN32U.h#1 $\n//\n// Library: Foundation\n// Package: Filesystem\n// Module: DirectoryIterator\n//\n// Definition of the DirectoryIteratorImpl class for WIN32.\n//\n// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.\n// and Contributors.\n//\n// SPDX-License-Identifier:\tBSL-1.0\n//\n\n\n#ifndef Foundation_DirectoryIterator_WIN32U_INCLUDED\n#define Foundation_DirectoryIterator_WIN32U_INCLUDED\n\n\n#include \"Poco/Foundation.h\"\n#include \"Poco/UnWindows.h\"\n\n\nnamespace Poco {\n\n\nclass Foundation_API DirectoryIteratorImpl\n{\npublic:\n\tDirectoryIteratorImpl(const std::string& path);\n\t~DirectoryIteratorImpl();\n\t\n\tvoid duplicate();\n\tvoid release();\n\t\n\tconst std::string& get() const;\n\tconst std::string& next();\n\t\nprivate:\n\tHANDLE _fh;\n\tWIN32_FIND_DATAW _fd;\n\tstd::string _current;\n\tint _rc;\n};\n\n\n//\n// inlines\n//\nconst std::string& DirectoryIteratorImpl::get() const\n{\n\treturn _current;\n}\n\n\ninline void DirectoryIteratorImpl::duplicate()\n{\n\t++_rc;\n}\n\n\ninline void DirectoryIteratorImpl::release()\n{\n\tif (--_rc == 0)\n\t\tdelete this;\n}\n\n\n} // namespace Poco\n\n\n#endif // Foundation_DirectoryIterator_WIN32U_INCLUDED\n"} +{"text": "// SPDX-License-Identifier: GPL-2.0\n/*\n * r8a7743 Clock Pulse Generator / Module Standby and Software Reset\n *\n * Copyright (C) 2016 Cogent Embedded Inc.\n */\n\n#include \n#include \n#include \n#include \n#include \n\n#include \n\n#include \"renesas-cpg-mssr.h\"\n#include \"rcar-gen2-cpg.h\"\n\nenum clk_ids {\n\t/* Core Clock Outputs exported to DT */\n\tLAST_DT_CORE_CLK = R8A7743_CLK_OSC,\n\n\t/* External Input Clocks */\n\tCLK_EXTAL,\n\tCLK_USB_EXTAL,\n\n\t/* Internal Core Clocks */\n\tCLK_MAIN,\n\tCLK_PLL0,\n\tCLK_PLL1,\n\tCLK_PLL3,\n\tCLK_PLL1_DIV2,\n\n\t/* Module Clocks */\n\tMOD_CLK_BASE\n};\n\nstatic struct cpg_core_clk r8a7743_core_clks[] __initdata = {\n\t/* External Clock Inputs */\n\tDEF_INPUT(\"extal\",\tCLK_EXTAL),\n\tDEF_INPUT(\"usb_extal\",\tCLK_USB_EXTAL),\n\n\t/* Internal Core Clocks */\n\tDEF_BASE(\".main\",\tCLK_MAIN, CLK_TYPE_GEN2_MAIN, CLK_EXTAL),\n\tDEF_BASE(\".pll0\",\tCLK_PLL0, CLK_TYPE_GEN2_PLL0, CLK_MAIN),\n\tDEF_BASE(\".pll1\",\tCLK_PLL1, CLK_TYPE_GEN2_PLL1, CLK_MAIN),\n\tDEF_BASE(\".pll3\",\tCLK_PLL3, CLK_TYPE_GEN2_PLL3, CLK_MAIN),\n\n\tDEF_FIXED(\".pll1_div2\",\tCLK_PLL1_DIV2, CLK_PLL1, 2, 1),\n\n\t/* Core Clock Outputs */\n\tDEF_BASE(\"z\", R8A7743_CLK_Z, CLK_TYPE_GEN2_Z,\tCLK_PLL0),\n\tDEF_BASE(\"sdh\", R8A7743_CLK_SDH, CLK_TYPE_GEN2_SDH,\tCLK_PLL1),\n\tDEF_BASE(\"sd0\", R8A7743_CLK_SD0, CLK_TYPE_GEN2_SD0,\tCLK_PLL1),\n\tDEF_BASE(\"qspi\", R8A7743_CLK_QSPI, CLK_TYPE_GEN2_QSPI,\tCLK_PLL1_DIV2),\n\tDEF_BASE(\"rcan\", R8A7743_CLK_RCAN, CLK_TYPE_GEN2_RCAN,\tCLK_USB_EXTAL),\n\n\tDEF_FIXED(\"zg\", R8A7743_CLK_ZG,\tCLK_PLL1,\t 3, 1),\n\tDEF_FIXED(\"zx\", R8A7743_CLK_ZX,\tCLK_PLL1,\t 3, 1),\n\tDEF_FIXED(\"zs\", R8A7743_CLK_ZS,\tCLK_PLL1,\t 6, 1),\n\tDEF_FIXED(\"hp\", R8A7743_CLK_HP,\tCLK_PLL1,\t 12, 1),\n\tDEF_FIXED(\"b\", R8A7743_CLK_B,\tCLK_PLL1,\t 12, 1),\n\tDEF_FIXED(\"lb\", R8A7743_CLK_LB,\tCLK_PLL1,\t 24, 1),\n\tDEF_FIXED(\"p\", R8A7743_CLK_P,\tCLK_PLL1,\t 24, 1),\n\tDEF_FIXED(\"cl\", R8A7743_CLK_CL,\tCLK_PLL1,\t 48, 1),\n\tDEF_FIXED(\"m2\", R8A7743_CLK_M2,\tCLK_PLL1,\t 8, 1),\n\tDEF_FIXED(\"zb3\", R8A7743_CLK_ZB3,\tCLK_PLL3,\t 4, 1),\n\tDEF_FIXED(\"zb3d2\", R8A7743_CLK_ZB3D2,\tCLK_PLL3,\t 8, 1),\n\tDEF_FIXED(\"ddr\", R8A7743_CLK_DDR,\tCLK_PLL3,\t 8, 1),\n\tDEF_FIXED(\"mp\", R8A7743_CLK_MP,\tCLK_PLL1_DIV2,\t 15, 1),\n\tDEF_FIXED(\"cp\", R8A7743_CLK_CP,\tCLK_EXTAL,\t 2, 1),\n\tDEF_FIXED(\"r\", R8A7743_CLK_R,\tCLK_PLL1,\t49152, 1),\n\tDEF_FIXED(\"osc\", R8A7743_CLK_OSC,\tCLK_PLL1,\t12288, 1),\n\n\tDEF_DIV6P1(\"sd2\", R8A7743_CLK_SD2,\tCLK_PLL1_DIV2,\t0x078),\n\tDEF_DIV6P1(\"sd3\", R8A7743_CLK_SD3,\tCLK_PLL1_DIV2,\t0x26c),\n\tDEF_DIV6P1(\"mmc0\", R8A7743_CLK_MMC0,\tCLK_PLL1_DIV2,\t0x240),\n};\n\nstatic const struct mssr_mod_clk r8a7743_mod_clks[] __initconst = {\n\tDEF_MOD(\"msiof0\",\t\t 0,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"vcp0\",\t\t\t 101,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"vpc0\",\t\t\t 103,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"tmu1\",\t\t\t 111,\tR8A7743_CLK_P),\n\tDEF_MOD(\"3dg\",\t\t\t 112,\tR8A7743_CLK_ZG),\n\tDEF_MOD(\"2d-dmac\",\t\t 115,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"fdp1-1\",\t\t 118,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"fdp1-0\",\t\t 119,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"tmu3\",\t\t\t 121,\tR8A7743_CLK_P),\n\tDEF_MOD(\"tmu2\",\t\t\t 122,\tR8A7743_CLK_P),\n\tDEF_MOD(\"cmt0\",\t\t\t 124,\tR8A7743_CLK_R),\n\tDEF_MOD(\"tmu0\",\t\t\t 125,\tR8A7743_CLK_CP),\n\tDEF_MOD(\"vsp1du1\",\t\t 127,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"vsp1du0\",\t\t 128,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"vsp1-sy\",\t\t 131,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"scifa2\",\t\t 202,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"scifa1\",\t\t 203,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"scifa0\",\t\t 204,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"msiof2\",\t\t 205,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"scifb0\",\t\t 206,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"scifb1\",\t\t 207,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"msiof1\",\t\t 208,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"scifb2\",\t\t 216,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"sys-dmac1\",\t\t 218,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"sys-dmac0\",\t\t 219,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"tpu0\",\t\t\t 304,\tR8A7743_CLK_CP),\n\tDEF_MOD(\"sdhi3\",\t\t 311,\tR8A7743_CLK_SD3),\n\tDEF_MOD(\"sdhi2\",\t\t 312,\tR8A7743_CLK_SD2),\n\tDEF_MOD(\"sdhi0\",\t\t 314,\tR8A7743_CLK_SD0),\n\tDEF_MOD(\"mmcif0\",\t\t 315,\tR8A7743_CLK_MMC0),\n\tDEF_MOD(\"iic0\",\t\t\t 318,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"pciec\",\t\t 319,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"iic1\",\t\t\t 323,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"usb3.0\",\t\t 328,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"cmt1\",\t\t\t 329,\tR8A7743_CLK_R),\n\tDEF_MOD(\"usbhs-dmac0\",\t\t 330,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"usbhs-dmac1\",\t\t 331,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"rwdt\",\t\t\t 402,\tR8A7743_CLK_R),\n\tDEF_MOD(\"irqc\",\t\t\t 407,\tR8A7743_CLK_CP),\n\tDEF_MOD(\"intc-sys\",\t\t 408,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"audio-dmac1\",\t\t 501,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"audio-dmac0\",\t\t 502,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"thermal\",\t\t 522,\tCLK_EXTAL),\n\tDEF_MOD(\"pwm\",\t\t\t 523,\tR8A7743_CLK_P),\n\tDEF_MOD(\"usb-ehci\",\t\t 703,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"usbhs\",\t\t 704,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"hscif2\",\t\t 713,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"scif5\",\t\t 714,\tR8A7743_CLK_P),\n\tDEF_MOD(\"scif4\",\t\t 715,\tR8A7743_CLK_P),\n\tDEF_MOD(\"hscif1\",\t\t 716,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"hscif0\",\t\t 717,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"scif3\",\t\t 718,\tR8A7743_CLK_P),\n\tDEF_MOD(\"scif2\",\t\t 719,\tR8A7743_CLK_P),\n\tDEF_MOD(\"scif1\",\t\t 720,\tR8A7743_CLK_P),\n\tDEF_MOD(\"scif0\",\t\t 721,\tR8A7743_CLK_P),\n\tDEF_MOD(\"du1\",\t\t\t 723,\tR8A7743_CLK_ZX),\n\tDEF_MOD(\"du0\",\t\t\t 724,\tR8A7743_CLK_ZX),\n\tDEF_MOD(\"lvds0\",\t\t 726,\tR8A7743_CLK_ZX),\n\tDEF_MOD(\"ipmmu-sgx\",\t\t 800,\tR8A7743_CLK_ZX),\n\tDEF_MOD(\"vin2\",\t\t\t 809,\tR8A7743_CLK_ZG),\n\tDEF_MOD(\"vin1\",\t\t\t 810,\tR8A7743_CLK_ZG),\n\tDEF_MOD(\"vin0\",\t\t\t 811,\tR8A7743_CLK_ZG),\n\tDEF_MOD(\"etheravb\",\t\t 812,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"ether\",\t\t 813,\tR8A7743_CLK_P),\n\tDEF_MOD(\"sata1\",\t\t 814,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"sata0\",\t\t 815,\tR8A7743_CLK_ZS),\n\tDEF_MOD(\"gpio7\",\t\t 904,\tR8A7743_CLK_CP),\n\tDEF_MOD(\"gpio6\",\t\t 905,\tR8A7743_CLK_CP),\n\tDEF_MOD(\"gpio5\",\t\t 907,\tR8A7743_CLK_CP),\n\tDEF_MOD(\"gpio4\",\t\t 908,\tR8A7743_CLK_CP),\n\tDEF_MOD(\"gpio3\",\t\t 909,\tR8A7743_CLK_CP),\n\tDEF_MOD(\"gpio2\",\t\t 910,\tR8A7743_CLK_CP),\n\tDEF_MOD(\"gpio1\",\t\t 911,\tR8A7743_CLK_CP),\n\tDEF_MOD(\"gpio0\",\t\t 912,\tR8A7743_CLK_CP),\n\tDEF_MOD(\"can1\",\t\t\t 915,\tR8A7743_CLK_P),\n\tDEF_MOD(\"can0\",\t\t\t 916,\tR8A7743_CLK_P),\n\tDEF_MOD(\"qspi_mod\",\t\t 917,\tR8A7743_CLK_QSPI),\n\tDEF_MOD(\"i2c5\",\t\t\t 925,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"iicdvfs\",\t\t 926,\tR8A7743_CLK_CP),\n\tDEF_MOD(\"i2c4\",\t\t\t 927,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"i2c3\",\t\t\t 928,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"i2c2\",\t\t\t 929,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"i2c1\",\t\t\t 930,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"i2c0\",\t\t\t 931,\tR8A7743_CLK_HP),\n\tDEF_MOD(\"ssi-all\",\t\t1005,\tR8A7743_CLK_P),\n\tDEF_MOD(\"ssi9\",\t\t\t1006,\tMOD_CLK_ID(1005)),\n\tDEF_MOD(\"ssi8\",\t\t\t1007,\tMOD_CLK_ID(1005)),\n\tDEF_MOD(\"ssi7\",\t\t\t1008,\tMOD_CLK_ID(1005)),\n\tDEF_MOD(\"ssi6\",\t\t\t1009,\tMOD_CLK_ID(1005)),\n\tDEF_MOD(\"ssi5\",\t\t\t1010,\tMOD_CLK_ID(1005)),\n\tDEF_MOD(\"ssi4\",\t\t\t1011,\tMOD_CLK_ID(1005)),\n\tDEF_MOD(\"ssi3\",\t\t\t1012,\tMOD_CLK_ID(1005)),\n\tDEF_MOD(\"ssi2\",\t\t\t1013,\tMOD_CLK_ID(1005)),\n\tDEF_MOD(\"ssi1\",\t\t\t1014,\tMOD_CLK_ID(1005)),\n\tDEF_MOD(\"ssi0\",\t\t\t1015,\tMOD_CLK_ID(1005)),\n\tDEF_MOD(\"scu-all\",\t\t1017,\tR8A7743_CLK_P),\n\tDEF_MOD(\"scu-dvc1\",\t\t1018,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scu-dvc0\",\t\t1019,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scu-ctu1-mix1\",\t1020,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scu-ctu0-mix0\",\t1021,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scu-src9\",\t\t1022,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scu-src8\",\t\t1023,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scu-src7\",\t\t1024,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scu-src6\",\t\t1025,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scu-src5\",\t\t1026,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scu-src4\",\t\t1027,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scu-src3\",\t\t1028,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scu-src2\",\t\t1029,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scu-src1\",\t\t1030,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scu-src0\",\t\t1031,\tMOD_CLK_ID(1017)),\n\tDEF_MOD(\"scifa3\",\t\t1106,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"scifa4\",\t\t1107,\tR8A7743_CLK_MP),\n\tDEF_MOD(\"scifa5\",\t\t1108,\tR8A7743_CLK_MP),\n};\n\nstatic const unsigned int r8a7743_crit_mod_clks[] __initconst = {\n\tMOD_CLK_ID(402),\t/* RWDT */\n\tMOD_CLK_ID(408),\t/* INTC-SYS (GIC) */\n};\n\n/*\n * CPG Clock Data\n */\n\n/*\n * MD\tEXTAL\t\tPLL0\tPLL1\tPLL3\n * 14 13 19\t(MHz)\t\t*1\t*1\n *---------------------------------------------------\n * 0 0 0\t15\t\tx172/2\tx208/2\tx106\n * 0 0 1\t15\t\tx172/2\tx208/2\tx88\n * 0 1 0\t20\t\tx130/2\tx156/2\tx80\n * 0 1 1\t20\t\tx130/2\tx156/2\tx66\n * 1 0 0\t26 / 2\t\tx200/2\tx240/2\tx122\n * 1 0 1\t26 / 2\t\tx200/2\tx240/2\tx102\n * 1 1 0\t30 / 2\t\tx172/2\tx208/2\tx106\n * 1 1 1\t30 / 2\t\tx172/2\tx208/2\tx88\n *\n * *1 :\tTable 7.5a indicates VCO output (PLLx = VCO/2)\n */\n#define CPG_PLL_CONFIG_INDEX(md)\t((((md) & BIT(14)) >> 12) | \\\n\t\t\t\t\t (((md) & BIT(13)) >> 12) | \\\n\t\t\t\t\t (((md) & BIT(19)) >> 19))\n\nstatic const struct rcar_gen2_cpg_pll_config cpg_pll_configs[8] __initconst = {\n\t/* EXTAL div\tPLL1 mult\tPLL3 mult */\n\t{ 1,\t\t208,\t\t106,\t},\n\t{ 1,\t\t208,\t\t88,\t},\n\t{ 1,\t\t156,\t\t80,\t},\n\t{ 1,\t\t156,\t\t66,\t},\n\t{ 2,\t\t240,\t\t122,\t},\n\t{ 2,\t\t240,\t\t102,\t},\n\t{ 2,\t\t208,\t\t106,\t},\n\t{ 2,\t\t208,\t\t88,\t},\n};\n\nstatic int __init r8a7743_cpg_mssr_init(struct device *dev)\n{\n\tconst struct rcar_gen2_cpg_pll_config *cpg_pll_config;\n\tstruct device_node *np = dev->of_node;\n\tunsigned int i;\n\tu32 cpg_mode;\n\tint error;\n\n\terror = rcar_rst_read_mode_pins(&cpg_mode);\n\tif (error)\n\t\treturn error;\n\n\tcpg_pll_config = &cpg_pll_configs[CPG_PLL_CONFIG_INDEX(cpg_mode)];\n\n\tif (of_device_is_compatible(np, \"renesas,r8a7744-cpg-mssr\")) {\n\t\t/* RZ/G1N uses a 1/5 divider for ZG */\n\t\tfor (i = 0; i < ARRAY_SIZE(r8a7743_core_clks); i++)\n\t\t\tif (r8a7743_core_clks[i].id == R8A7743_CLK_ZG) {\n\t\t\t\tr8a7743_core_clks[i].div = 5;\n\t\t\t\tbreak;\n\t\t\t}\n\t}\n\treturn rcar_gen2_cpg_init(cpg_pll_config, 2, cpg_mode);\n}\n\nconst struct cpg_mssr_info r8a7743_cpg_mssr_info __initconst = {\n\t/* Core Clocks */\n\t.core_clks = r8a7743_core_clks,\n\t.num_core_clks = ARRAY_SIZE(r8a7743_core_clks),\n\t.last_dt_core_clk = LAST_DT_CORE_CLK,\n\t.num_total_core_clks = MOD_CLK_BASE,\n\n\t/* Module Clocks */\n\t.mod_clks = r8a7743_mod_clks,\n\t.num_mod_clks = ARRAY_SIZE(r8a7743_mod_clks),\n\t.num_hw_mod_clks = 12 * 32,\n\n\t/* Critical Module Clocks */\n\t.crit_mod_clks = r8a7743_crit_mod_clks,\n\t.num_crit_mod_clks = ARRAY_SIZE(r8a7743_crit_mod_clks),\n\n\t/* Callbacks */\n\t.init = r8a7743_cpg_mssr_init,\n\t.cpg_clk_register = rcar_gen2_cpg_clk_register,\n};\n"} +{"text": "/dts-v1/;\n\n#include \"WITI.dtsi\"\n\n/ {\n\tcompatible = \"mqmaker,witi-256m\", \"mqmaker,witi\", \"mediatek,mt7621-soc\";\n\tmodel = \"MQmaker WiTi (256MB RAM)\";\n\n\tmemory@0 {\n\t\tdevice_type = \"memory\";\n\t\treg = <0x0 0x10000000>;\n\t};\n};\n"} +{"text": "/**\r\n * \\file size.hpp\r\n *\r\n * \\brief The family of \\c size operations.\r\n *\r\n * Copyright (c) 2009-2010, Marco Guazzone\r\n *\r\n * Distributed under the Boost Software License, Version 1.0. (See\r\n * accompanying file LICENSE_1_0.txt or copy at\r\n * http://www.boost.org/LICENSE_1_0.txt)\r\n *\r\n * \\author Marco Guazzone, marco.guazzone@gmail.com\r\n */\r\n\r\n#ifndef BOOST_NUMERIC_UBLAS_OPERATION_SIZE_HPP\r\n#define BOOST_NUMERIC_UBLAS_OPERATION_SIZE_HPP\r\n\r\n\r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n#include \r\n\r\n\r\nnamespace boost { namespace numeric { namespace ublas {\r\n\r\nnamespace detail { namespace /**/ {\r\n\r\n/// Define a \\c has_size_type trait class.\r\nBOOST_MPL_HAS_XXX_TRAIT_DEF(size_type)\r\n\r\n\r\n/**\r\n * \\brief Wrapper type-traits used in \\c boost::lazy_enabled_if for getting the\r\n * size type (see below).\r\n * \\tparam VectorT A vector type.\r\n */\r\ntemplate \r\nstruct vector_size_type\r\n{\r\n /// The size type.\r\n typedef typename vector_traits::size_type type;\r\n};\r\n\r\n/**\r\n * \\brief Wrapper type-traits used in \\c boost::lazy_enabled_if for getting the\r\n * size type (see below).\r\n * \\tparam MatrixT A matrix type.\r\n */\r\ntemplate \r\nstruct matrix_size_type\r\n{\r\n /// The size type.\r\n typedef typename matrix_traits::size_type type;\r\n};\r\n\r\n\r\n/**\r\n * \\brief Auxiliary class for computing the size of the given dimension for\r\n * a container of the given category.\r\n * \\tparam Dim The dimension number (starting from 1).\r\n * \\tparam CategoryT The category type (e.g., vector_tag).\r\n */\r\ntemplate \r\nstruct size_by_dim_impl;\r\n\r\n\r\n/**\r\n * \\brief Auxiliary class for computing the size of the given dimension for\r\n * a container of the given category and with the given orientation.\r\n * \\tparam Dim The dimension number (starting from 1).\r\n * \\tparam CategoryT The category type (e.g., vector_tag).\r\n * \\tparam OrientationT The orientation category type (e.g., row_major_tag).\r\n */\r\ntemplate \r\nstruct size_by_tag_impl;\r\n\r\n\r\n/**\r\n * \\brief Specialization of \\c size_by_dim_impl for computing the size of a\r\n * vector.\r\n */\r\ntemplate <>\r\nstruct size_by_dim_impl<1, vector_tag>\r\n{\r\n /**\r\n * \\brief Compute the size of the given vector.\r\n * \\tparam ExprT A vector expression type.\r\n * \\pre ExprT must be a model of VectorExpression.\r\n */\r\n template \r\n BOOST_UBLAS_INLINE\r\n static typename vector_traits::size_type apply(vector_expression const& ve)\r\n {\r\n return ve().size();\r\n }\r\n};\r\n\r\n\r\n/**\r\n * \\brief Specialization of \\c size_by_dim_impl for computing the number of\r\n * rows of a matrix\r\n */\r\ntemplate <>\r\nstruct size_by_dim_impl<1, matrix_tag>\r\n{\r\n /**\r\n * \\brief Compute the number of rows of the given matrix.\r\n * \\tparam ExprT A matrix expression type.\r\n * \\pre ExprT must be a model of MatrixExpression.\r\n */\r\n template \r\n BOOST_UBLAS_INLINE\r\n static typename matrix_traits::size_type apply(matrix_expression const& me)\r\n {\r\n return me().size1();\r\n }\r\n};\r\n\r\n\r\n/**\r\n * \\brief Specialization of \\c size_by_dim_impl for computing the number of\r\n * columns of a matrix\r\n */\r\ntemplate <>\r\nstruct size_by_dim_impl<2, matrix_tag>\r\n{\r\n /**\r\n * \\brief Compute the number of columns of the given matrix.\r\n * \\tparam ExprT A matrix expression type.\r\n * \\pre ExprT must be a model of MatrixExpression.\r\n */\r\n template \r\n BOOST_UBLAS_INLINE\r\n static typename matrix_traits::size_type apply(matrix_expression const& me)\r\n {\r\n return me().size2();\r\n }\r\n};\r\n\r\n\r\n/**\r\n * \\brief Specialization of \\c size_by_tag_impl for computing the size of the\r\n * major dimension of a row-major oriented matrix.\r\n */\r\ntemplate <>\r\nstruct size_by_tag_impl\r\n{\r\n /**\r\n * \\brief Compute the number of rows of the given matrix.\r\n * \\tparam ExprT A matrix expression type.\r\n * \\pre ExprT must be a model of MatrixExpression.\r\n */\r\n template \r\n BOOST_UBLAS_INLINE\r\n static typename matrix_traits::size_type apply(matrix_expression const& me)\r\n {\r\n return me().size1();\r\n }\r\n};\r\n\r\n\r\n/**\r\n * \\brief Specialization of \\c size_by_tag_impl for computing the size of the\r\n * minor dimension of a row-major oriented matrix.\r\n */\r\ntemplate <>\r\nstruct size_by_tag_impl\r\n{\r\n /**\r\n * \\brief Compute the number of columns of the given matrix.\r\n * \\tparam ExprT A matrix expression type.\r\n * \\pre ExprT must be a model of MatrixExpression.\r\n */\r\n template \r\n BOOST_UBLAS_INLINE\r\n static typename matrix_traits::size_type apply(matrix_expression const& me)\r\n {\r\n return me().size2();\r\n }\r\n};\r\n\r\n\r\n/**\r\n * \\brief Specialization of \\c size_by_tag_impl for computing the size of the\r\n * leading dimension of a row-major oriented matrix.\r\n */\r\ntemplate <>\r\nstruct size_by_tag_impl\r\n{\r\n /**\r\n * \\brief Compute the number of columns of the given matrix.\r\n * \\tparam ExprT A matrix expression type.\r\n * \\pre ExprT must be a model of MatrixExpression.\r\n */\r\n template \r\n BOOST_UBLAS_INLINE\r\n static typename matrix_traits::size_type apply(matrix_expression const& me)\r\n {\r\n return me().size2();\r\n }\r\n};\r\n\r\n\r\n/// \\brief Specialization of \\c size_by_tag_impl for computing the size of the\r\n/// major dimension of a column-major oriented matrix.\r\ntemplate <>\r\nstruct size_by_tag_impl\r\n{\r\n /**\r\n * \\brief Compute the number of columns of the given matrix.\r\n * \\tparam ExprT A matrix expression type.\r\n * \\pre ExprT must be a model of MatrixExpression.\r\n */\r\n template \r\n BOOST_UBLAS_INLINE\r\n static typename matrix_traits::size_type apply(matrix_expression const& me)\r\n {\r\n return me().size2();\r\n }\r\n};\r\n\r\n\r\n/// \\brief Specialization of \\c size_by_tag_impl for computing the size of the\r\n/// minor dimension of a column-major oriented matrix.\r\ntemplate <>\r\nstruct size_by_tag_impl\r\n{\r\n /**\r\n * \\brief Compute the number of rows of the given matrix.\r\n * \\tparam ExprT A matrix expression type.\r\n * \\pre ExprT must be a model of MatrixExpression.\r\n */\r\n template \r\n BOOST_UBLAS_INLINE\r\n static typename matrix_traits::size_type apply(matrix_expression const& me)\r\n {\r\n return me().size1();\r\n }\r\n};\r\n\r\n\r\n/// \\brief Specialization of \\c size_by_tag_impl for computing the size of the\r\n/// leading dimension of a column-major oriented matrix.\r\ntemplate <>\r\nstruct size_by_tag_impl\r\n{\r\n /**\r\n * \\brief Compute the number of rows of the given matrix.\r\n * \\tparam ExprT A matrix expression type.\r\n * \\pre ExprT must be a model of MatrixExpression.\r\n */\r\n template \r\n BOOST_UBLAS_INLINE\r\n static typename matrix_traits::size_type apply(matrix_expression const& me)\r\n {\r\n return me().size1();\r\n }\r\n};\r\n\r\n\r\n/// \\brief Specialization of \\c size_by_tag_impl for computing the size of the\r\n/// given dimension of a unknown oriented expression.\r\ntemplate \r\nstruct size_by_tag_impl: size_by_tag_impl\r\n{\r\n // Empty\r\n};\r\n\r\n}} // Namespace detail::\r\n\r\n\r\n/**\r\n * \\brief Return the number of columns.\r\n * \\tparam VectorExprT A type which models the vector expression concept.\r\n * \\param ve A vector expression.\r\n * \\return The length of the input vector expression.\r\n */\r\ntemplate \r\nBOOST_UBLAS_INLINE\r\ntypename ::boost::lazy_enable_if_c<\r\n detail::has_size_type::value,\r\n detail::vector_size_type\r\n>::type size(vector_expression const& ve)\r\n{\r\n return ve().size();\r\n}\r\n\r\n\r\n/**\r\n * \\brief Return the size of the given dimension for the given vector\r\n * expression.\r\n * \\tparam Dim The dimension number (starting from 1).\r\n * \\tparam VectorExprT A vector expression type.\r\n * \\param ve A vector expression.\r\n * \\return The length of the input vector expression.\r\n */\r\ntemplate \r\nBOOST_UBLAS_INLINE\r\ntypename vector_traits::size_type size(vector_expression const& ve)\r\n{\r\n return detail::size_by_dim_impl::apply(ve);\r\n}\r\n\r\n\r\n/**\r\n * \\brief Return the size of the given dimension for the given matrix\r\n * expression.\r\n * \\tparam Dim The dimension number (starting from 1).\r\n * \\tparam MatrixExprT A matrix expression type.\r\n * \\param e A matrix expression.\r\n * \\return The size of the input matrix expression associated to the dimension\r\n * \\a Dim.\r\n */\r\ntemplate \r\nBOOST_UBLAS_INLINE\r\ntypename matrix_traits::size_type size(matrix_expression const& me)\r\n{\r\n return detail::size_by_dim_impl::apply(me);\r\n}\r\n\r\n\r\n/**\r\n * \\brief Return the size of the given dimension tag for the given matrix\r\n * expression.\r\n * \\tparam TagT The dimension tag type (e.g., tag::major).\r\n * \\tparam MatrixExprT A matrix expression type.\r\n * \\param e A matrix expression.\r\n * \\return The size of the input matrix expression associated to the dimension\r\n * tag \\a TagT.\r\n */\r\ntemplate \r\nBOOST_UBLAS_INLINE\r\ntypename ::boost::lazy_enable_if_c<\r\n detail::has_size_type::value,\r\n detail::matrix_size_type\r\n>::type size(matrix_expression const& me)\r\n{\r\n return detail::size_by_tag_impl::orientation_category>::apply(me);\r\n}\r\n\r\n}}} // Namespace boost::numeric::ublas\r\n\r\n\r\n#endif // BOOST_NUMERIC_UBLAS_OPERATION_SIZE_HPP\r\n"} +{"text": "\n\n \n \n"} +{"text": "{*************************************************************************}\r\n{* *}\r\n{* XIV OI *}\r\n{* *}\r\n{* Zadanie: Atrakcje turystyczne *}\r\n{* Plik: atr0.pas *}\r\n{* Autor: Piotr Stanczyk *}\r\n{* Opis: Rozwiazanie wzorcowe O(k*(m+n)*log(n) + k^2*2^k) *}\r\n{* *}\r\n{*************************************************************************}\r\nconst INF = 1000000001;\r\nconst MaxK=20;\r\nconst MaxN=20000;\r\nconst MaxM=1000000;\r\nconst TabSize=2000001;\r\nconst BufS=351200;\r\n\r\ntype DW = record\r\n t, s : longint;\r\nend;\r\n\r\nvar\r\n sol : array[0..BufS-1,0..MaxK-1] of longint;\r\n kol : array[0..BufS-1] of longint;\r\n kolhead : longint;\r\n bf : array[0..TabSize-1] of longint;\r\n zb : array[0..TabSize-1] of longint;\r\n wie : array[0..TabSize] of integer;\r\n kra : array[0..MaxN] of longint;\r\n ks : longint;\r\n ilezb : array[0..MaxK+1] of longint;\r\n odl : array[0..MaxK+2,0..MaxK+2] of longint;\r\n ogr : array[0..MaxK+2] of longint;\r\n n, m, k : longint;\r\n res : array[0..MaxN+1] of DW;\r\n h,p : array[0..MaxN+1] of longint;\r\n\r\n\r\nfunction min(a, b : longint) : longint;\r\nbegin\r\n if a < b then\r\n min := a\r\n else\r\n min := b;\r\nend;\r\n\r\nprocedure Dodaj(p,k,l : longint);\r\nbegin\r\n Inc(ks);\r\n wie[ks] := k;\r\n bf[ks] := l;\r\n zb[ks] := kra[p];\r\n kra[p] := ks;\r\nend;\r\n\r\nprocedure CalcZb(v, k, bity : longint);\r\nbegin\r\n Inc(ilezb[bity]);\r\n if k > 0 then\r\n begin\r\n CalcZb(v shl 1, k-1, bity);\r\n CalcZb((v shl 1)+1, k-1, bity+1);\r\n end;\r\nend;\r\n\r\nprocedure GenZb(v, k, bity : longint);\r\nbegin\r\n Dec(ilezb[bity]);\r\n zb[ilezb[bity]] := v;\r\n if k > 0 then\r\n begin\r\n GenZb((v shl 1)+1, k-1, bity+1);\r\n GenZb(v shl 1, k-1, bity);\r\n end;\r\nend;\r\n\r\nprocedure GenZbN;\r\nvar x : longint;\r\nbegin\r\n for x := 1 to k+1 do ilezb[x] := 0;\r\n ilezb[1] := 1;\r\n CalcZb(1, k-1, 1);\r\n for x := 1 to k do Inc(ilezb[x+1], ilezb[x]);\r\n Dec(ilezb[1]);\r\n zb[ilezb[1]] := 1 shl k;\r\n GenZb(1, k-1, 1);\r\nend;\r\n\r\nprocedure InicjujBufor;\r\nvar x : longint;\r\nbegin\r\n kolhead := 0;\r\n for x := 0 to BufS-1 do kol[x] := x+1;\r\n for x := 0 to 1 shl k do bf[x] := -1;\r\nend;\r\n\r\nprocedure DajBufor(nr : longint);\r\nvar x : longint;\r\nbegin\r\n if bf[nr] = -1 then\r\n begin\r\n bf[nr] := kolhead;\r\n for x := 0 to MaxK-1 do sol[kolhead][x] := INF;\r\n kolhead := kol[kolhead];\r\n end;\r\nend;\r\n\r\nprocedure ZwolnijBufor(nr : longint);\r\nbegin\r\n if bf[nr] <> -1 then\r\n begin\r\n kol[bf[nr]] := kolhead;\r\n kolhead := bf[nr];\r\n end;\r\nend;\r\n\r\nprocedure WczytajDane;\r\nvar x : longint;\r\n pk, kk, wa, g : longint;\r\nbegin\r\n for x := 0 to MaxN do kra[x] := -1;\r\n Readln(n, m, k);\r\n for x := 0 to m-1 do \r\n begin\r\n Readln(pk, kk, wa);\r\n Dodaj(pk, kk, wa);\r\n Dodaj(kk, pk, wa);\r\n end;\r\n for x := 0 to k+1 do ogr[x] := 0;\r\n Readln(g);\r\n for x := 0 to g-1 do\r\n begin\r\n Readln(pk, kk);\r\n ogr[kk-1] := ogr[kk-1] OR (1 shl (pk-2));\r\n end;\r\nend;\r\n\r\nprocedure XCh(a, b : longint);\r\nvar tmp : longint;\r\nbegin\r\n tmp := h[a];\r\n h[a] := h[b];\r\n h[b] := tmp;\r\n tmp := p[h[a]];\r\n p[h[a]] := p[h[b]];\r\n p[h[b]] := tmp;\r\nend;\r\n\r\nprocedure Dijkstra(s : longint);\r\nvar hs,e,u,x,a : longint;\r\nbegin\r\n hs := n;\r\n for x := n downto 1 do\r\n begin\r\n h[x] := x;\r\n p[x] := x;\r\n res[x].t := INF;\r\n end;\r\n res[s].t := 0;\r\n XCh(1, s);\r\n while (hs > 1) do\r\n begin\r\n u := h[1];\r\n XCh(hs, 1);\r\n Dec(hs);\r\n a := 1;\r\n while (a shl 1) <= hs do\r\n begin\r\n a := a shl 1;\r\n if (a < hs) AND (res[h[a+1]].t < res[h[a]].t) then Inc(a); \r\n if res[h[a shr 1]].t <= res[h[a]].t then break;\r\n XCh(a,a shr 1);\r\n end;\r\n x := kra[u];\r\n while x <> -1 do\r\n begin\r\n e := wie[x];\r\n if res[e].t > res[u].t + bf[x] then\r\n begin\r\n res[e].t := res[u].t + bf[x];\r\n res[e].s := u;\r\n e := p[e];\r\n while (e > 1) AND (res[h[e]].t < res[h[e shr 1]].t) do \r\n begin\r\n XCh(e,e shr 1);\r\n e := e shr 1;\r\n end;\r\n end;\r\n x := zb[x];\r\n end;\r\n end;\r\nend;\r\n\r\nprocedure LiczOdl;\r\nvar x,y : longint;\r\nbegin\r\n for x := 0 to k+1 do\r\n begin\r\n if x = k+1 then\r\n Dijkstra(n)\r\n else\r\n Dijkstra(x+1);\r\n for y := 0 to k+1 do \r\n if y = k+1 then\r\n odl[x][y] := res[n].t\r\n else\r\n odl[x][y] := res[y+1].t;\r\n end;\r\nend;\r\n\r\nfunction Rozwiaz : longint;\r\nvar zak,x,y,z,it : longint;\r\nbegin\r\n zak := (1 shl k) - 1;\r\n for x := 0 to k-1 do if ogr[x+1] = 0 then\r\n begin\r\n DajBufor(1 shl x);\r\n sol[bf[1 shl x]][x] := odl[0][x+1];\r\n end;\r\n for it := 0 to zak - 1 do\r\n begin\r\n x := zb[it];\r\n if bf[x] <> -1 then\r\n begin\r\n for y := 0 to k-1 do if ((x AND (1 shl y)) = 0) AND ((ogr[y+1] OR x) = x) then\r\n begin\r\n for z := 0 to k-1 do if (x AND (1 shl z)) <> 0 then\r\n begin\r\n DajBufor(x OR (1 shl y));\r\n sol[bf[x OR (1 shl y)]][y] := min(sol[bf[x OR (1 shl y)]][y], odl[z+1][y+1] + sol[bf[x]][z]);\r\n end;\r\n end;\r\n if x <> zak then ZwolnijBufor(x);\r\n end;\r\n end;\r\n Rozwiaz := INF;\r\n for x := 0 to k-1 do Rozwiaz := min(Rozwiaz, sol[bf[zak]][x]+odl[x+1][k+1]);\r\nend;\r\n\r\nbegin\r\n ks := 0;\r\n WczytajDane();\r\n LiczOdl();\r\n if k = 0 then\r\n WriteLn(odl[0][1])\r\n else\r\n begin\r\n GenZbN();\r\n InicjujBufor();\r\n Writeln(Rozwiaz());\r\n end;\r\nend.\r\n"} +{"text": "# Application Control\n\nThe ApplicationControl application demonstrates how you can find applications supporting certain classes of operations and run them using those operations contexts. It uses Application control API.\n\n\n\n\n\n
    \n
    \n
    \n\n### Verified Version\n* Xamarin.Forms : 4.5.0\n* Tizen.NET : 6.0.0\n* Tizen.NET.SDK : 1.0.9\n\n\n### Supported Profile\n* Mobile\n\n### Author\n* Jeong-Kyun Pu, Hyunjin Park\n"} +{"text": "using AutoLot.Dal.EfStructures;\nusing AutoLot.Models.Entities;\nusing AutoLot.Dal.Repos.Base;\nusing AutoLot.Dal.Repos.Interfaces;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace AutoLot.Dal.Repos\n{\n public class CreditRiskRepo : BaseRepo, ICreditRiskRepo\n {\n public CreditRiskRepo(ApplicationDbContext context) : base(context)\n {\n }\n\n internal CreditRiskRepo(DbContextOptions options) : base(options)\n {\n }\n }\n}"} +{"text": "\n\n\n \n\n \n\n"} +{"text": "namespace ZeroLog\n{\n public partial interface ILog\n {\n bool IsLevelEnabled(Level level);\n ILogEvent ForLevel(Level level);\n }\n}\n"} +{"text": "%VOCEVALSEG Evaluates a set of segmentation results.\r\n% VOCEVALSEG(VOCopts,ID); prints out the per class and overall\r\n% segmentation accuracies. Accuracies are given using the intersection/union \r\n% metric:\r\n% true positives / (true positives + false positives + false negatives) \r\n%\r\n% [ACCURACIES,AVACC,CONF] = VOCEVALSEG(VOCopts,ID) returns the per class\r\n% percentage ACCURACIES, the average accuracy AVACC and the confusion\r\n% matrix CONF.\r\n%\r\n% [ACCURACIES,AVACC,CONF,RAWCOUNTS] = VOCEVALSEG(VOCopts,ID) also returns\r\n% the unnormalised confusion matrix, which contains raw pixel counts.\r\nfunction [accuracies,avacc,conf,rawcounts, overall_acc, avg_class_acc] = MyVOCevalsegBoundary(VOCopts, id, w)\r\n\r\n% get structural element\r\nst_w = 2*w + 1;\r\nse = strel('square', st_w);\r\n\r\n% image test set\r\nfn = sprintf(VOCopts.seg.imgsetpath,VOCopts.testset);\r\nfid = fopen(fn, 'r');\r\ngtids = textscan(fid, '%s');\r\ngtids = gtids{1};\r\nfclose(fid);\r\n%[gtids,t]=textread(sprintf(VOCopts.seg.imgsetpath,VOCopts.testset),'%s %d');\r\n\r\n% number of labels = number of classes plus one for the background\r\nnum = VOCopts.nclasses+1; \r\nconfcounts = zeros(num);\r\ncount=0;\r\ntic;\r\nfor i=1:length(gtids)\r\n % display progress\r\n if toc>1\r\n fprintf('test confusion: %d/%d\\n',i,length(gtids));\r\n drawnow;\r\n tic;\r\n end\r\n \r\n imname = gtids{i};\r\n \r\n % ground truth label file\r\n gtfile = sprintf(VOCopts.seg.clsimgpath,imname);\r\n [gtim,map] = imread(gtfile); \r\n gtim = double(gtim);\r\n \r\n % results file\r\n resfile = sprintf(VOCopts.seg.clsrespath,id,VOCopts.testset,imname);\r\n try\r\n [resim,map] = imread(resfile);\r\n catch err\r\n fprintf(1, 'Fail to read %s\\n', resfile);\r\n continue;\r\n end\r\n\r\n resim = double(resim);\r\n \r\n % Check validity of results image\r\n maxlabel = max(resim(:));\r\n if (maxlabel>VOCopts.nclasses), \r\n error('Results image ''%s'' has out of range value %d (the value should be <= %d)',imname,maxlabel,VOCopts.nclasses);\r\n end\r\n\r\n szgtim = size(gtim); szresim = size(resim);\r\n if any(szgtim~=szresim)\r\n error('Results image ''%s'' is the wrong size, was %d x %d, should be %d x %d.',imname,szresim(1),szresim(2),szgtim(1),szgtim(2));\r\n end\r\n \r\n % dilate gt\r\n binary_gt = gtim == 255;\r\n dilate_gt = imdilate(binary_gt, se);\r\n target_gt = dilate_gt & (gtim~=255);\r\n \r\n %pixel locations to include in computation\r\n locs = target_gt;\r\n %locs = gtim<255;\r\n \r\n % joint histogram\r\n sumim = 1+gtim+resim*num; \r\n hs = histc(sumim(locs),1:num*num); \r\n count = count + numel(find(locs));\r\n confcounts(:) = confcounts(:) + hs(:);\r\nend\r\n\r\n% confusion matrix - first index is true label, second is inferred label\r\n%conf = zeros(num);\r\nconf = 100*confcounts./repmat(1E-20+sum(confcounts,2),[1 size(confcounts,2)]);\r\nrawcounts = confcounts;\r\n\r\n% Pixel Accuracy\r\noverall_acc = 100*sum(diag(confcounts)) / sum(confcounts(:));\r\nfprintf('Percentage of pixels correctly labelled overall: %6.3f%%\\n',overall_acc);\r\n\r\n% Class Accuracy\r\nclass_acc = zeros(1, num);\r\nclass_count = 0;\r\nfprintf('Accuracy for each class (pixel accuracy)\\n');\r\nfor i = 1 : num\r\n denom = sum(confcounts(i, :));\r\n if (denom == 0)\r\n denom = 1;\r\n else\r\n class_count = class_count + 1;\r\n end\r\n class_acc(i) = 100 * confcounts(i, i) / denom; \r\n if i == 1\r\n clname = 'background';\r\n else\r\n clname = VOCopts.classes{i-1};\r\n end\r\n fprintf(' %14s: %6.3f%%\\n', clname, class_acc(i));\r\nend\r\nfprintf('-------------------------\\n');\r\navg_class_acc = sum(class_acc) / class_count;\r\nfprintf('Mean Class Accuracy: %6.3f%%\\n', avg_class_acc);\r\n\r\n% Pixel IOU\r\naccuracies = zeros(VOCopts.nclasses,1);\r\nfprintf('Accuracy for each class (intersection/union measure)\\n');\r\nfor j=1:num\r\n \r\n gtj=sum(confcounts(j,:));\r\n resj=sum(confcounts(:,j));\r\n gtjresj=confcounts(j,j);\r\n % The accuracy is: true positive / (true positive + false positive + false negative) \r\n % which is equivalent to the following percentage:\r\n accuracies(j)=100*gtjresj/(gtj+resj-gtjresj); \r\n \r\n clname = 'background';\r\n if (j>1), clname = VOCopts.classes{j-1};end;\r\n fprintf(' %14s: %6.3f%%\\n',clname,accuracies(j));\r\nend\r\naccuracies = accuracies(1:end);\r\navacc = mean(accuracies);\r\nfprintf('-------------------------\\n');\r\nfprintf('Average accuracy: %6.3f%%\\n',avacc);\r\n"} +{"text": "http_proxy_io\n=============\n\n## Overview\n\nhttp_proxy_io implements an IO that has minimal functionality allowing communication over an HTTP proxy.\n\n## References\n\n[RFC 2616](https://tools.ietf.org/html/rfc2616)\n[RFC 2617](https://tools.ietf.org/html/rfc2617)\n[RFC 2817](https://www.ietf.org/rfc/rfc2817.txt)\n\n## Exposed API\n\n```c\nMOCKABLE_FUNCTION(, const IO_INTERFACE_DESCRIPTION*, http_proxy_io_get_interface_description);\n```\n\n\n### http_proxy_io_create\n\n`http_proxy_io_create` is the implementation provided via `http_proxy_io_get_interface_description` for the `concrete_io_create` member.\n\n```c\nCONCRETE_IO_HANDLE http_proxy_io_create(void* io_create_parameters);\n```\n\n**SRS_HTTP_PROXY_IO_01_001: [** `http_proxy_io_create` shall create a new instance of the HTTP proxy IO. **]**\n\n**SRS_HTTP_PROXY_IO_01_002: [** If `io_create_parameters` is NULL, `http_proxy_io_create` shall fail and return NULL. **]**\n\n**SRS_HTTP_PROXY_IO_01_003: [** `io_create_parameters` shall be used as an `HTTP_PROXY_IO_CONFIG*`. **]**\n\n**SRS_HTTP_PROXY_IO_01_004: [** If the `hostname` or `proxy_hostname` member is NULL, then `http_proxy_io_create` shall fail and return NULL. **]**\n\n**SRS_HTTP_PROXY_IO_01_005: [** `http_proxy_io_create` shall copy the `hostname`, `port`, `username` and `password` values for later use when the actual CONNECT is performed. **]**\n\n**SRS_HTTP_PROXY_IO_01_006: [** `hostname` and `proxy_hostname`, `username` and `password` shall be copied by calling `mallocAndStrcpy_s`. **]**\n\n**SRS_HTTP_PROXY_IO_01_094: [** `username` and `password` shall be optional. **]**\n\n**SRS_HTTP_PROXY_IO_01_095: [** If one of the fields `username` and `password` is non-NULL, then the other has to be also non-NULL, otherwise `http_proxy_io_create` shall fail and return NULL. **]**\n\n**SRS_HTTP_PROXY_IO_01_007: [** If `mallocAndStrcpy_s` fails then `http_proxy_io_create` shall fail and return NULL. **]**\n\n**SRS_HTTP_PROXY_IO_01_009: [** `http_proxy_io_create` shall create a new socket IO by calling `xio_create` with the arguments: **]**\n\n**SRS_HTTP_PROXY_IO_01_010: [** - `io_interface_description` shall be set to the result of `socketio_get_interface_description`. **]**\n\n**SRS_HTTP_PROXY_IO_01_011: [** - `xio_create_parameters` shall be set to a `SOCKETIO_CONFIG*` where `hostname` is set to the `proxy_hostname` member of `io_create_parameters` and `port` is set to the `proxy_port` member of `io_create_parameters`. **]**\n\n**SRS_HTTP_PROXY_IO_01_050: [** If `socketio_get_interface_description` fails, `http_proxy_io_create` shall fail and return NULL. **]**\n\n**SRS_HTTP_PROXY_IO_01_012: [** If `xio_create` fails, `http_proxy_io_create` shall fail and return NULL. **]**\n\n**SRS_HTTP_PROXY_IO_01_008: [** When `http_proxy_io_create` fails, all allocated resources up to that point shall be freed. **]**\n\n### http_proxy_io_destroy\n\n`http_proxy_io_destroy` is the implementation provided via `http_proxy_io_get_interface_description` for the `concrete_io_destroy` member.\n\n```c\nvoid http_proxy_io_destroy(CONCRETE_IO_HANDLE http_proxy_io);\n```\n\n**SRS_HTTP_PROXY_IO_01_013: [** `http_proxy_io_destroy` shall free the HTTP proxy IO instance indicated by `http_proxy_io`. **]**\n\n**SRS_HTTP_PROXY_IO_01_014: [** If `http_proxy_io` is NULL, `http_proxy_io_destroy` shall do nothing. **]**\n\n**SRS_HTTP_PROXY_IO_01_015: [** `http_proxy_io_destroy` should close the IO if it was open before freeing all the resources. **]**\n\n**SRS_HTTP_PROXY_IO_01_016: [** `http_proxy_io_destroy` shall destroy the underlying IO created in `http_proxy_io_create` by calling `xio_destroy`. **]**\n\n### http_proxy_io_open\n\n`http_proxy_io_open` is the implementation provided via `http_proxy_io_get_interface_description` for the `concrete_io_open` member.\n\n```c\nint http_proxy_io_open(CONCRETE_IO_HANDLE http_proxy_io, ON_IO_OPEN_COMPLETE on_io_open_complete, void* on_io_open_complete_context, ON_BYTES_RECEIVED on_bytes_received, void* on_bytes_received_context, ON_IO_ERROR on_io_error, void* on_io_error_context)\n```\n\n**SRS_HTTP_PROXY_IO_01_017: [** `http_proxy_io_open` shall open the HTTP proxy IO and on success it shall return 0. **]**\n\n**SRS_HTTP_PROXY_IO_01_018: [** If any of the arguments `http_proxy_io`, `on_io_open_complete`, `on_bytes_received` or `on_io_error` are NULL then `http_proxy_io_open` shall return a non-zero value. **]**\n\n**SRS_HTTP_PROXY_IO_01_019: [** `http_proxy_io_open` shall open the underlying IO by calling `xio_open` on the underlying IO handle created in `http_proxy_io_create`, while passing to it the callbacks `on_underlying_io_open_complete`, `on_underlying_io_bytes_received` and `on_underlying_io_error`. **]**\n\n**SRS_HTTP_PROXY_IO_01_020: [** If `xio_open` fails, then `http_proxy_io_open` shall return a non-zero value. **]**\n\n**SRS_HTTP_PROXY_IO_01_021: [** If `http_proxy_io_open` is called while the IO was already open, `http_proxy_io_open` shall fail and return a non-zero value. **]**\n\n**SRS_HTTP_PROXY_IO_01_051: [** The arguments `on_io_open_complete_context`, `on_bytes_received_context` and `on_io_error_context` shall be allowed to be NULL. **]**\n\n### http_proxy_io_close\n\n`http_proxy_io_close` is the implementation provided via `http_proxy_io_get_interface_description` for the `concrete_io_close` member.\n\n```c\nint http_proxy_io_close(CONCRETE_IO_HANDLE http_proxy_io, ON_IO_CLOSE_COMPLETE on_io_close_complete, void* on_io_close_complete_context)\n```\n\n**SRS_HTTP_PROXY_IO_01_022: [** `http_proxy_io_close` shall close the HTTP proxy IO and on success it shall return 0. **]**\n\n**SRS_HTTP_PROXY_IO_01_023: [** If the argument `http_proxy_io` is NULL, `http_proxy_io_close` shall fail and return a non-zero value. **]**\n\n**SRS_HTTP_PROXY_IO_01_024: [** `http_proxy_io_close` shall close the underlying IO by calling `xio_close` on the IO handle create in `http_proxy_io_create`, while passing to it the `on_underlying_io_close_complete` callback. **]**\n\n**SRS_HTTP_PROXY_IO_01_025: [** If `xio_close` fails, `http_proxy_io_close` shall fail and return a non-zero value. **]**\n\n**SRS_HTTP_PROXY_IO_01_026: [** The `on_io_close_complete` and `on_io_close_complete_context` arguments shall be saved for later use. **]**\n\n**SRS_HTTP_PROXY_IO_01_027: [** If `http_proxy_io_close` is called when not open, `http_proxy_io_close` shall fail and return a non-zero value. **]**\n\n**SRS_HTTP_PROXY_IO_01_028: [** `on_io_close_complete` shall be allowed to be NULL. **]**\n\n**SRS_HTTP_PROXY_IO_01_052: [** `on_io_close_complete_context` shall be allowed to be NULL. **]**\n\n**SRS_HTTP_PROXY_IO_01_053: [** `http_proxy_io_close` while OPENING shall trigger the `on_io_open_complete` callback with `IO_OPEN_CANCELLED`. **]**\n\n**SRS_HTTP_PROXY_IO_01_054: [** `http_proxy_io_close` while OPENING shall fail and return a non-zero value. **]**\n\n### http_proxy_io_send\n\n`http_proxy_io_send` is the implementation provided via `http_proxy_io_get_interface_description` for the `concrete_io_send` member.\n\n```c\nint http_proxy_io_send(CONCRETE_IO_HANDLE http_proxy_io, const void* buffer, size_t size, ON_SEND_COMPLETE on_send_complete, void* on_send_complete_context)\n```\n\n**SRS_HTTP_PROXY_IO_01_029: [** `http_proxy_io_send` shall send the `size` bytes pointed to by `buffer` and on success it shall return 0. **]**\n\n**SRS_HTTP_PROXY_IO_01_030: [** If any of the arguments `http_proxy_io` or `buffer` is NULL, `http_proxy_io_send` shall fail and return a non-zero value. **]**\n\n**SRS_HTTP_PROXY_IO_01_031: [** If `size` is 0, `http_proxy_io_send` shall fail and return a non-zero value. **]**\n\n**SRS_HTTP_PROXY_IO_01_032: [** `on_send_complete` shall be allowed to be NULL. **]**\n\n**SRS_HTTP_PROXY_IO_01_033: [** `http_proxy_io_send` shall send the bytes by calling `xio_send` on the underlying IO created in `http_proxy_io_create` and passing `buffer` and `size` as arguments. **]**\n\n**SRS_HTTP_PROXY_IO_01_034: [** If `http_proxy_io_send` is called when the IO is not open, `http_proxy_io_send` shall fail and return a non-zero value. **]**\n\n**SRS_HTTP_PROXY_IO_01_035: [** If the IO is in an error state (an error was reported through the `on_io_error` callback), `http_proxy_io_send` shall fail and return a non-zero value. **]**\n\n**SRS_HTTP_PROXY_IO_01_055: [** If `xio_send` fails, `http_proxy_io_send` shall fail and return a non-zero value. **]**\n\n### http_proxy_io_dowork\n\n`http_proxy_io_dowork` is the implementation provided via `http_proxy_io_get_interface_description` for the `concrete_io_dowork` member.\n\n```c\nvoid http_proxy_io_dowork(CONCRETE_IO_HANDLE http_proxy_io)\n```\n\n**SRS_HTTP_PROXY_IO_01_037: [** `http_proxy_io_dowork` shall call `xio_dowork` on the underlying IO created in `http_proxy_io_create`. **]**\n\n**SRS_HTTP_PROXY_IO_01_038: [** If the `http_proxy_io` argument is NULL, `http_proxy_io_dowork` shall do nothing. **]**\n\n**SRS_HTTP_PROXY_IO_01_039: [** If the IO is not open (no open has been called or the IO has been closed) then `http_proxy_io_dowork` shall do nothing. **]**\n\n### http_proxy_io_set_option\n\n`http_proxy_io_set_option` is the implementation provided via `http_proxy_io_get_interface_description` for the `concrete_io_setoption` member.\n\n```c\nint http_proxy_io_set_option(CONCRETE_IO_HANDLE http_proxy_io, const char* optionName, const void* value)\n```\n\n**SRS_HTTP_PROXY_IO_01_040: [** If any of the arguments `http_proxy_io` or `option_name` is NULL, `http_proxy_io_set_option` shall return a non-zero value. **]**\n\n**SRS_HTTP_PROXY_IO_01_042: [** If the option was handled by `http_proxy_io_set_option` or the underlying IO, then `http_proxy_io_set_option` shall return 0. **]**\n\n**SRS_HTTP_PROXY_IO_01_043: [** If the `option_name` argument indicates an option that is not handled by `http_proxy_io_set_option`, then `xio_setoption` shall be called on the underlying IO created in `http_proxy_io_create`, passing the option name and value to it. **]**\n\n**SRS_HTTP_PROXY_IO_01_044: [** if `xio_setoption` fails, `http_proxy_io_set_option` shall return a non-zero value. **]**\n\n**SRS_HTTP_PROXY_IO_01_056: [** The `value` argument shall be allowed to be NULL. **]**\n\nOptions that shall be handled by HTTP proxy IO:\n\n**SRS_HTTP_PROXY_IO_01_045: [** None. **]**\n\n### http_proxy_io_retrieve_options\n\n`http_proxy_io_retrieve_options` is the implementation provided via `http_proxy_io_get_interface_description` for the `concrete_io_retrieveoptions` member.\n\n```c\nstatic OPTIONHANDLER_HANDLE http_proxy_io_retrieve_options(CONCRETE_IO_HANDLE http_proxy_io)\n```\n\n**SRS_HTTP_PROXY_IO_01_046: [** `http_proxy_io_retrieve_options` shall return an `OPTIONHANDLER_HANDLE` obtained by calling `xio_retrieveoptions` on the underlying IO created in `http_proxy_io_create`. **]**\n\n**SRS_HTTP_PROXY_IO_01_047: [** If the parameter `http_proxy_io` is NULL then `http_proxy_io_retrieve_options` shall fail and return NULL. **]**\n\n**SRS_HTTP_PROXY_IO_01_048: [** If `xio_retrieveoptions` fails, `http_proxy_io_retrieve_options` shall return NULL. **]**\n\n### http_proxy_io_get_interface_description\n\n```c\nextern const IO_INTERFACE_DESCRIPTION* http_proxy_io_get_interface_description(void);\n```\n\n**SRS_HTTP_PROXY_IO_01_049: [** `http_proxy_io_get_interface_description` shall return a pointer to an `IO_INTERFACE_DESCRIPTION` structure that contains pointers to the functions: `http_proxy_io_retrieve_options`, `http_proxy_io_retrieve_create`, `http_proxy_io_destroy`, `http_proxy_io_open`, `http_proxy_io_close`, `http_proxy_io_send` and `http_proxy_io_dowork`. **]**\n\n### on_underlying_io_open_complete\n\n**SRS_HTTP_PROXY_IO_01_057: [** When `on_underlying_io_open_complete` is called, the `http_proxy_io` shall send the CONNECT request constructed per RFC 2817: **]**\n\n**SRS_HTTP_PROXY_IO_01_078: [** When `on_underlying_io_open_complete` is called with `IO_OPEN_ERROR`, the `on_open_complete` callback shall be triggered with `IO_OPEN_ERROR`, passing also the `on_open_complete_context` argument as `context`. **]**\n\n**SRS_HTTP_PROXY_IO_01_079: [** When `on_underlying_io_open_complete` is called with `IO_OPEN_CANCELLED`, the `on_open_complete` callback shall be triggered with `IO_OPEN_CANCELLED`, passing also the `on_open_complete_context` argument as `context`. **]**\n\n**SRS_HTTP_PROXY_IO_01_059: [** - If `username` and `password` have been specified in the arguments passed to `http_proxy_io_create`, then the header `Proxy-Authorization` shall be added to the request. **]**\n\n**SRS_HTTP_PROXY_IO_01_060: [** - The value of `Proxy-Authorization` shall be the constructed according to RFC 2617. **]**\n\n**SRS_HTTP_PROXY_IO_01_061: [** Encoding to Base64 shall be done by calling `Base64_Encode_Bytes`. **]**\n\n**SRS_HTTP_PROXY_IO_01_062: [** If any failure is encountered while constructing the request, the `on_open_complete` callback shall be triggered with `IO_OPEN_ERROR`, passing also the `on_open_complete_context` argument as `context`. **]**\n\n**SRS_HTTP_PROXY_IO_01_063: [** The request shall be sent by calling `xio_send` and passing NULL as `on_send_complete` callback. **]**\n\n**SRS_HTTP_PROXY_IO_01_064: [** If `xio_send` fails, the `on_open_complete` callback shall be triggered with `IO_OPEN_ERROR`, passing also the `on_open_complete_context` argument as `context`. **]**\n\n**SRS_HTTP_PROXY_IO_01_076: [** When `on_underlying_io_open_complete` is called while waiting for the CONNECT reply, the `on_open_complete` callback shall be triggered with `IO_OPEN_ERROR`, passing also the `on_open_complete_context` argument as `context`. **]**\n\n**SRS_HTTP_PROXY_IO_01_077: [** When `on_underlying_io_open_complete` is called in after OPEN has completed, the `on_io_error` callback shall be triggered passing the `on_io_error_context` argument as `context`. **]**\n\n**SRS_HTTP_PROXY_IO_01_081: [** `on_underlying_io_open_complete` called with NULL context shall do nothing. **]**\n\n### on_underlying_io_bytes_received\n\n**SRS_HTTP_PROXY_IO_01_065: [** When bytes are received and the response to the CONNECT request was not yet received, the bytes shall be accumulated until a double new-line is detected. **]**\n\n**SRS_HTTP_PROXY_IO_01_066: [** When a double new-line is detected the response shall be parsed in order to extract the status code. **]**\n\n**SRS_HTTP_PROXY_IO_01_067: [** If allocating memory for the buffered bytes fails, the `on_open_complete` callback shall be triggered with `IO_OPEN_ERROR`, passing also the `on_open_complete_context` argument as `context`. **]**\n\n**SRS_HTTP_PROXY_IO_01_068: [** If parsing the CONNECT response fails, the `on_open_complete` callback shall be triggered with `IO_OPEN_ERROR`, passing also the `on_open_complete_context` argument as `context`. **]**\n\n**SRS_HTTP_PROXY_IO_01_069: [** Any successful (2xx) response to a CONNECT request indicates that the proxy has established a connection to the requested host and port, and has switched to tunneling the current connection to that server connection. **]**\n\n**SRS_HTTP_PROXY_IO_01_070: [** When a success status code is parsed, the `on_open_complete` callback shall be triggered with `IO_OPEN_OK`, passing also the `on_open_complete_context` argument as `context`. **]**\n\n**SRS_HTTP_PROXY_IO_01_071: [** If the status code is not successful, the `on_open_complete` callback shall be triggered with `IO_OPEN_ERROR`, passing also the `on_open_complete_context` argument as `context`. **]**\n\n**SRS_HTTP_PROXY_IO_01_072: [** Any bytes that are extra (not consumed by the CONNECT response), shall be indicated as received by calling the `on_bytes_received` callback and passing the `on_bytes_received_context` as context argument. **]**\n\n**SRS_HTTP_PROXY_IO_01_073: [** Once a success status code was parsed, the IO shall be OPEN. **]**\n\n**SRS_HTTP_PROXY_IO_01_074: [** If `on_underlying_io_bytes_received` is called while OPEN, all bytes shall be indicated as received by calling the `on_bytes_received` callback and passing the `on_bytes_received_context` as context argument. **]**\n\n**SRS_HTTP_PROXY_IO_01_080: [** If `on_underlying_io_bytes_received` is called while the underlying IO is being opened, the `on_open_complete` callback shall be triggered with `IO_OPEN_ERROR`, passing also the `on_open_complete_context` argument as `context`. **]**\n\n**SRS_HTTP_PROXY_IO_01_082: [** `on_underlying_io_bytes_received` called with NULL context shall do nothing. **]**\n\n### on_underlying_io_close_complete\n\n**SRS_HTTP_PROXY_IO_01_083: [** `on_underlying_io_close_complete` while CLOSING shall call the `on_io_close_complete` callback, passing to it the `on_io_close_complete_context` as `context` argument. **]**\n\n**SRS_HTTP_PROXY_IO_01_084: [** `on_underlying_io_close_complete` called with NULL context shall do nothing. **]**\n\n**SRS_HTTP_PROXY_IO_01_086: [** If the `on_io_close_complete` callback passed to `http_proxy_io_close` was NULL, no callback shall be triggered. **]**\n\n### on_underlying_io_error\n\n**SRS_HTTP_PROXY_IO_01_087: [** If the `on_underlying_io_error` callback is called while OPENING, the `on_open_complete` callback shall be triggered with `IO_OPEN_ERROR`, passing also the `on_open_complete_context` argument as `context`. **]**\n\n**SRS_HTTP_PROXY_IO_01_088: [** `on_underlying_io_error` called with NULL context shall do nothing. **]**\n\n**SRS_HTTP_PROXY_IO_01_089: [** If the `on_underlying_io_error` callback is called while the IO is OPEN, the `on_io_error` callback shall be called with the `on_io_error_context` argument as `context`. **]**\n\n## RFC 2817 relevant part\n\n5.2 Requesting a Tunnel with CONNECT\n\n A CONNECT method requests that a proxy establish a tunnel connection on its behalf.\n **SRS_HTTP_PROXY_IO_01_075: [** The Request-URI portion of the Request-Line is always an 'authority' as defined by URI Generic Syntax [2], which is to say the host name and port number destination of the requested connection separated by a colon: **]**\n\n CONNECT server.example.com:80 HTTP/1.1\n Host: server.example.com:80\n\n Other HTTP mechanisms can be used normally with the CONNECT method -- except end-to-end protocol Upgrade requests, of course, since the tunnel must be established first.\n\n For example, proxy authentication might be used to establish the authority to create a tunnel:\n\n CONNECT server.example.com:80 HTTP/1.1\n Host: server.example.com:80\n Proxy-Authorization: basic aGVsbG86d29ybGQ=\n\n Like any other pipelined HTTP/1.1 request, data to be tunneled may be sent immediately after the blank line.\n The usual caveats also apply: data may be discarded if the eventual response is negative, and the connection may be reset with no response if more than one TCP segment is outstanding.\n\n5.3 Establishing a Tunnel with CONNECT\n\n **SRS_HTTP_PROXY_IO_01_090: [** Any successful (2xx) response to a CONNECT request indicates that the proxy has established a connection to the requested host and port, and has switched to tunneling the current connection to that server connection. **]**\n\n It may be the case that the proxy itself can only reach the requested origin server through another proxy.\n In this case, the first proxy SHOULD make a CONNECT request of that next proxy, requesting a tunnel to the authority.\n A proxy MUST NOT respond with any 2xx status code unless it has either a direct or tunnel connection established to the authority.\n\n An origin server which receives a CONNECT request for itself MAY respond with a 2xx status code to indicate that a connection is established.\n\n If at any point either one of the peers gets disconnected, any outstanding data that came from that peer will be passed to the other one, and after that also the other connection will be terminated by the proxy.\n If there is outstanding data to that peer undelivered, that data will be discarded.\n\n## RFC 2617 relevant part\n\n Basic Authentication Scheme\n\n The \"basic\" authentication scheme is based on the model that the client must authenticate itself with a user-ID and a password for each realm.\n The realm value should be considered an opaque string which can only be compared for equality with other realms on that server.\n The server will service the request only if it can validate the user-ID and password for the protection space of the Request-URI.\n There are no optional authentication parameters.\n\n For Basic, the framework above is utilized as follows:\n\n challenge = \"Basic\" realm\n credentials = \"Basic\" basic-credentials\n\n Upon receipt of an unauthorized request for a URI within the protection space, the origin server MAY respond with a challenge like the following:\n\n WWW-Authenticate: Basic realm=\"WallyWorld\"\n\n where \"WallyWorld\" is the string assigned by the server to identify the protection space of the Request-URI.\n A proxy may respond with the same challenge using the Proxy-Authenticate header field.\n\n **SRS_HTTP_PROXY_IO_01_091: [** To receive authorization, the client sends the userid and password, separated by a single colon (\":\") character, within a base64 [7] encoded string in the credentials. **]**\n\n basic-credentials = base64-user-pass\n base64-user-pass = \n user-pass = userid \":\" password\n userid = *\n password = *TEXT\n\n **SRS_HTTP_PROXY_IO_01_093: [** Userids might be case sensitive. **]**\n\n If the user agent wishes to send the userid \"Aladdin\" and password \"open sesame\", it would use the following header field:\n\n Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n\n A client SHOULD assume that all paths at or deeper than the depth of the last symbolic element in the path field of the Request-URI also are within the protection space specified by the Basic realm value of the current challenge.\n \n **SRS_HTTP_PROXY_IO_01_092: [** A client MAY preemptively send the corresponding Authorization header with requests for resources in that space without receipt of another challenge from the server. **]**\n Similarly, when a client sends a request to a proxy, it may reuse a userid and password in the Proxy-Authorization header field without receiving another challenge from the proxy server.\n See section 4 for security considerations associated with Basic authentication.\n"} +{"text": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading;\n\nnamespace TestUtility\n{\n public partial class TestAssets\n {\n private class TestProject : ITestProject\n {\n private HashSet _disposableFiles = new HashSet();\n private bool _disposed;\n\n public string Name { get; }\n public string BaseDirectory { get; }\n public string Directory { get; }\n public bool ShadowCopied { get; }\n\n public TestProject(string name, string baseDirectory, string directory, bool shadowCopied)\n {\n this.Name = name;\n this.BaseDirectory = baseDirectory;\n this.Directory = directory;\n this.ShadowCopied = shadowCopied;\n }\n\n ~TestProject()\n {\n throw new InvalidOperationException($\"{nameof(ITestProject)}.{nameof(Dispose)}() not called for {this.Name}\");\n }\n\n public string AddDisposableFile(string fileName, string contents = null)\n {\n var filePath = Path.Combine(Directory, fileName);\n File.WriteAllText(filePath, contents ?? string.Empty);\n _disposableFiles.Add(filePath);\n\n return filePath;\n }\n\n public virtual void Dispose()\n {\n if (_disposed)\n {\n throw new InvalidOperationException($\"{nameof(ITestProject)} for {this.Name} already disposed.\");\n }\n\n if (this.ShadowCopied)\n {\n RunWithRetry(() => System.IO.Directory.Delete(this.BaseDirectory, recursive: true));\n if (System.IO.Directory.Exists(this.BaseDirectory))\n {\n throw new InvalidOperationException($\"{nameof(ITestProject)} directory still exists: '{this.BaseDirectory}'\");\n }\n }\n else\n {\n foreach (var filePath in _disposableFiles)\n {\n RunWithRetry(() => File.Delete(filePath));\n if (System.IO.File.Exists(filePath))\n {\n throw new InvalidOperationException($\"{nameof(ITestProject)} file still exists: '{filePath}'\");\n }\n }\n }\n\n this._disposed = true;\n GC.SuppressFinalize(this);\n\n void RunWithRetry(Action action)\n {\n var retries = 0;\n while (retries <= 5)\n {\n try\n {\n action.Invoke();\n break;\n }\n catch\n {\n Thread.Sleep(1000);\n retries++;\n }\n }\n }\n }\n }\n }\n}\n"} +{"text": "/**************************************************************************\n * \n * Copyright 2007 VMware, Inc.\n * 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\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sub license, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n * \n * The above copyright notice and this permission notice (including the\n * next paragraph) shall be included in all copies or substantial portions\n * 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 NON-INFRINGEMENT.\n * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR\n * ANY 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\n\n#ifndef ST_CB_STRINGS_H\n#define ST_CB_STRINGS_H\n\n\nstruct dd_function_table;\n\nextern void\nst_init_string_functions(struct dd_function_table *functions);\n\n\n#endif /* ST_CB_CLEAR_H */\n\n"} +{"text": "#Mon Oct 14 10:29:18 CST 2019\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-5.4.1-all.zip\n"} +{"text": "{**}\n{strip}\n\t
    \n\t\t
    \n\t\t\t{include file=\\App\\Layout::getTemplatePath('dashboards/WidgetHeaderTitle.tpl', $MODULE_NAME)}\n\t\t\t{include file=\\App\\Layout::getTemplatePath('dashboards/WidgetHeaderButtons.tpl', $MODULE_NAME)}\n\t\t
    \n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t\t\n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t\t
    \n\t\t\t{include file=\\App\\Layout::getTemplatePath('dashboards/HistoryContents.tpl', $MODULE_NAME)}\n\t\t
    \n\t\t{/strip}\n"} +{"text": "// -----------------------------------------------------------------------------------\n// Serial ST4 slave\n\n/*\nST4 port data communication scheme:\n\n5V power ---- Teensy3.2, Nano, etc.\nGnd ---------\n\nHC Signal OnStep\nRAw ---- Data ---> Recv. data\nDEs <--- Clock ---- Clock\nDEn <--- Data ---- Send data\nRAe ---- 12.5Hz Square wave ---> 100% sure SHC is present, switches DEs & DEn to OUTPUT\n\nData is exchanged on clock edges similar to SPI so is timing insensitive (runs with interrupts enabled.)\n\nOne data byte is exchanged (in both directions w/basic error detection and recovery.) A value 0x00 byte \nmeans \"no data\" and is ignored on both sides. Mega2560 hardware runs at (fastest) 10mS/byte (100 Bps) and \nall others (Teensy3.x, etc.) at 2mS/byte (500 Bps.)\n*/\n\n#include \"Stream.h\"\n\n#ifdef __ARM_Teensy3__\n IntervalTimer Timer1; // built into Teensyduino\n#else\n #include // from https://github.com/PaulStoffregen/TimerOne\n#endif\n\nvoid dataClock();\nvoid shcTone();\n\nclass Sst4 : public Stream\n{\n public:\n void begin(long baudRate);\n void end();\n bool active();\n virtual size_t write(uint8_t);\n virtual size_t write(const uint8_t *, size_t);\n virtual int available(void);\n virtual int read(void);\n virtual int peek(void);\n virtual void flush(void);\n\n inline size_t write(unsigned long n) { return write((uint8_t)n); }\n inline size_t write(long n) { return write((uint8_t)n); }\n inline size_t write(unsigned int n) { return write((uint8_t)n); }\n inline size_t write(int n) { return write((uint8_t)n); }\n using Print::write;\n\n volatile char _xmit_buffer[256] = \"\";\n volatile byte _xmit_head = 0;\n volatile byte _xmit_tail = 0;\n volatile char _recv_buffer[256] = \"\";\n volatile byte _recv_tail = 0;\n volatile unsigned long lastMs = 0;\n\n private:\n byte _recv_head = 0;\n long time_out = 500;\n};\n\nvoid Sst4::begin(long baudRate=9600) {\n _xmit_head=0; _xmit_tail=0; _xmit_buffer[0]=0;\n _recv_head=0; _recv_tail=0; _recv_buffer[0]=0;\n \n pinMode(ST4DEs,INPUT_PULLUP);\n pinMode(ST4DEn,INPUT_PULLUP);\n pinMode(ST4RAe,OUTPUT);\n pinMode(ST4RAw,OUTPUT);\n\n attachInterrupt(digitalPinToInterrupt(ST4DEs),dataClock,CHANGE);\n\n#ifdef __ARM_Teensy3__\n Timer1.begin(shcTone,40000);\n#else\n Timer1.initialize(40000);\n Timer1.attachInterrupt(shcTone);\n#endif\n}\n\nvoid Sst4::end() {\n pinMode(ST4RAe,INPUT_PULLUP);\n pinMode(ST4RAw,INPUT_PULLUP);\n detachInterrupt(digitalPinToInterrupt(ST4DEs));\n#ifdef __ARM_Teensy3__\n Timer1.end();\n#else\n Timer1.stop();\n#endif\n _xmit_head=0; _xmit_tail=0; _xmit_buffer[0]=0;\n _recv_head=0; _recv_tail=0; _recv_buffer[0]=0;\n}\n\nbool Sst4::active() {\n static unsigned long comp=0;\n bool result=false;\n noInterrupts();\n if (comp!=lastMs) { result=true; comp=lastMs; }\n interrupts();\n return result;\n}\n\nsize_t Sst4::write(uint8_t data) {\n unsigned long t_start=millis();\n byte xh=_xmit_head; xh--; while (_xmit_tail == xh) { if ((millis()-t_start)>_timeout) return 0; }\n noInterrupts();\n _xmit_buffer[_xmit_tail]=data; _xmit_tail++;\n _xmit_buffer[_xmit_tail]=0;\n interrupts();\n return 1;\n}\n\nsize_t Sst4::write(const uint8_t *data, size_t quantity) {\n // fail if trying to write more than the buffer can hold\n if ((int)quantity>254) return 0;\n\n for (int i=0; i<(int)quantity; i++) { if (!write(data[i])) return 0; }\n return 1;\n}\n\nint Sst4::available(void) {\n int a=0;\n noInterrupts();\n for (byte b=_recv_head; _recv_buffer[b]!=(char)0; b++) a++;\n interrupts();\n return a;\n}\n\nint Sst4::read(void) {\n noInterrupts();\n int c=_recv_buffer[_recv_head]; if (c!=0) _recv_head++;\n interrupts();\n if (c==0) c=-1;\n return c;\n}\n\nint Sst4::peek(void) {\n noInterrupts();\n int c=_recv_buffer[_recv_head];\n interrupts();\n if (c==0) c=-1;\n\n return c;\n}\n\nvoid Sst4::flush(void) {\n unsigned long startMs=millis();\n int c;\n do {\n noInterrupts();\n c=_xmit_buffer[_xmit_head];\n interrupts();\n } while ((c!=0) && ((millis()-startMs)<_timeout));\n}\n\nSst4 SerialST4;\n\nvolatile uint8_t data_in = 0;\nvolatile uint8_t data_out = 0;\n\nvoid dataClock() {\n static volatile unsigned long t=0;\n static volatile int i=9;\n static volatile boolean frame_error=false;\n static volatile boolean send_error=false;\n static volatile boolean recv_error=false;\n static volatile uint8_t s_parity=0;\n static volatile uint8_t r_parity=0;\n volatile uint8_t state=0;\n \n SerialST4.lastMs=millis();\n unsigned long t1=t; t=micros();\n volatile unsigned long elapsed=t-t1;\n\n if (digitalRead(ST4DEs)==HIGH) {\n state=digitalRead(ST4DEn); \n if (i==8) { if (state!=LOW) frame_error=true; } // recv start bit\n if ((i>=0) && (i<=7)) { r_parity+=state; bitWrite(data_in,i,state); } // recv data bit\n if (i==-1) { if ((r_parity&1)!=state) recv_error=true; } // recv parity bit\n if (i==-2) { if (state==HIGH) send_error=true; } // recv remote parity, ok?\n if (i==-3) { // recv stop bit\n if (state!=LOW) frame_error=true;\n\n if ((!frame_error) && (!recv_error)) {\n if (data_in!=0) {\n SerialST4._recv_buffer[SerialST4._recv_tail]=(char)data_in; \n SerialST4._recv_tail++;\n }\n SerialST4._recv_buffer[SerialST4._recv_tail]=(char)0;\n }\n }\n } else {\n if ((elapsed>1500L) || (i==-3)) {\n i=9; \n r_parity=0; s_parity=0;\n recv_error=false;\n\n // send the same data again?\n if ((!send_error) && (!frame_error)) {\n data_out=SerialST4._xmit_buffer[SerialST4._xmit_head]; \n if (data_out!=0) SerialST4._xmit_head++;\n } else { send_error=false; frame_error=false; }\n }\n i--;\n if (i==8) { digitalWrite(ST4RAw,LOW); } // send start bit\n if ((i>=0) && (i<=7)) { // send data bit\n state=bitRead(data_out,i); s_parity+=state; digitalWrite(ST4RAw,state);\n }\n if (i==-1) { digitalWrite(ST4RAw,s_parity&1); } // send parity bit\n if (i==-2) { digitalWrite(ST4RAw,recv_error); } // send local parity check\n if (i==-3) { digitalWrite(ST4RAw,LOW); } // send stop bit\n }\n}\n\n// this routine keeps a 12.5Hz \"tone\" on the RAe pin (always) but also on the\n// RAw pin when the data comms clock from OnStep isn't running\nvoid shcTone() {\n static volatile boolean tone_state=false;\n if (tone_state) { \n tone_state=false; \n digitalWrite(ST4RAe,HIGH); \n if (millis()-SerialST4.lastMs>2000L) digitalWrite(ST4RAw,HIGH);\n } else {\n tone_state=true;\n digitalWrite(ST4RAe,LOW);\n if (millis()-SerialST4.lastMs>2000L) digitalWrite(ST4RAw,LOW); \n }\n}\n\n"} +{"text": "-- select6.test\n-- \n-- execsql {SELECT count(*) FROM (SELECT * FROM (SELECT DISTINCT y FROM t1))}\nSELECT count(*) FROM (SELECT * FROM (SELECT DISTINCT y FROM t1))"} +{"text": "// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\nnamespace StyleCop.Analyzers.Test.CSharp8.LayoutRules\n{\n using StyleCop.Analyzers.Test.CSharp7.LayoutRules;\n\n public class SA1516CSharp8UsingGroupsUnitTests : SA1516CSharp7UsingGroupsUnitTests\n {\n }\n}\n"} +{"text": "# Converted from Textmate theme Slime using Coloration v0.3.3 (http://github.com/sickill/coloration)\n# -------------------- Put following in katesyntaxhighlightingrc --------------------\n\n[Default Item Styles - Schema Slime]\nAlert=f8f8f0,f8f8f0,0,0,0,0,00a8c6,,---\nBase-N Integer=c7af3f,c7af3f,0,0,0,0,,,---\nCharacter=9fb3c2,9fb3c2,0,0,0,0,,,---\nComment=63717d,63717d,0,0,0,0,,,---\nData Type=c7af3f,c7af3f,0,0,0,1,,,---\nDecimal/Value=c7af3f,c7af3f,0,0,0,0,,,---\nError=f8f8f0,f8f8f0,0,0,0,0,00a8c6,,---\nFloating Point=c7af3f,c7af3f,0,0,0,0,,,---\nFunction=c7af3f,c7af3f,0,0,0,0,,,---\nKeyword=9fb3c2,9fb3c2,0,0,0,0,,,---\nNormal=ffffff,ffffff,0,0,0,0,,,---\nOthers=ffffff,ffffff,0,0,0,0,,,---\nRegion Marker=ffffff,ffffff,0,0,0,0,,,---\nString=faffdb,faffdb,0,0,0,0,,,---\n\n[Highlighting Ruby - Schema Slime]\nRuby:Access Control=0,9fb3c2,9fb3c2,0,0,0,0,,,---\nRuby:Command=0,faffdb,faffdb,0,0,0,0,,,---\nRuby:Constant=0,ffffff,ffffff,0,0,0,0,,,---\nRuby:Constant Value=0,c7af3f,c7af3f,0,0,0,0,,,---\nRuby:Default globals=0,8ab8a2,8ab8a2,0,0,0,0,,,---\nRuby:Definition=0,c7af3f,c7af3f,0,0,0,0,,,---\nRuby:Delimiter=0,9fb3c2,9fb3c2,0,0,0,0,,,---\nRuby:Global Constant=0,c7af3f,c7af3f,0,0,0,0,,,---\nRuby:Global Variable=0,8ab8a2,8ab8a2,0,0,0,0,,,---\nRuby:Instance Variable=0,8ab8a2,8ab8a2,0,0,0,0,,,---\nRuby:Class Variable=0,8ab8a2,8ab8a2,0,0,0,0,,,---\nRuby:Kernel methods=0,c7af3f,c7af3f,0,0,0,0,,,---\nRuby:Member=0,c7af3f,c7af3f,0,0,0,0,,,---\nRuby:Message=0,ffffff,ffffff,0,0,0,0,,,---\nRuby:Operator=0,9fb3c2,9fb3c2,0,0,0,0,,,---\nRuby:Pseudo variable=0,8ab8a2,8ab8a2,0,0,0,0,,,---\nRuby:Raw String=0,faffdb,faffdb,0,0,0,0,,,---\nRuby:Regular Expression=0,faffdb,faffdb,0,0,0,0,,,---\nRuby:Symbol=0,c7af3f,c7af3f,0,0,0,0,,,---\n\n[Highlighting JavaScript - Schema Slime]\nJavaScript:Objects=0,8ab8a2,8ab8a2,0,0,0,0,,,---\n\n[Highlighting Ruby/Rails/RHTML - Schema Slime]\nRuby/Rails/RHTML:Message=0,ffffff,ffffff,0,0,0,0,,,---\nRuby/Rails/RHTML:Raw String=0,faffdb,faffdb,0,0,0,0,,,---\nRuby/Rails/RHTML:Symbol=0,c7af3f,c7af3f,0,0,0,0,,,---\nRuby/Rails/RHTML:Value=0,faffdb,faffdb,0,0,0,0,,,---\nRuby/Rails/RHTML:Element=0,c7af3f,c7af3f,0,0,0,0,,,---\nRuby/Rails/RHTML:Kernel methods=0,c7af3f,c7af3f,0,0,0,0,,,---\nRuby/Rails/RHTML:Attribute=0,8ab8a2,8ab8a2,0,0,0,0,,,---\n\n[Highlighting XML - Schema Slime]\nXML:Value=0,faffdb,faffdb,0,0,0,0,,,---\nXML:Element=0,c7af3f,c7af3f,0,0,0,0,,,---\nXML:Attribute=0,8ab8a2,8ab8a2,0,0,0,0,,,---\n\n# -------------------- Put following in kateschemarc --------------------\n\n[Slime]\nColor Background=20,22,23\nColor Highlighted Bracket=20,22,23\nColor Highlighted Line=34,37,40\nColor Selection=51,58,63\nColor Tab Marker=59,58,50\nColor Word Wrap Marker=59,58,50"} +{"text": "hasGroup(\"boss\");\n }\n}\n"} +{"text": "//\n// FLEXHeapEnumerator.h\n// Flipboard\n//\n// Created by Ryan Olson on 5/28/14.\n// Copyright (c) 2014 Flipboard. All rights reserved.\n//\n\n#import \n\ntypedef void (^flex_object_enumeration_block_t)(__unsafe_unretained id object, __unsafe_unretained Class actualClass);\n\n@interface FLEXHeapEnumerator : NSObject\n\n+ (void)enumerateLiveObjectsUsingBlock:(flex_object_enumeration_block_t)block;\n\n@end\n"} +{"text": "{\n \"type\": \"Module\",\n \"span\": {\n \"start\": 0,\n \"end\": 252,\n \"ctxt\": 0\n },\n \"body\": [\n {\n \"type\": \"ImportDeclaration\",\n \"span\": {\n \"start\": 0,\n \"end\": 26,\n \"ctxt\": 0\n },\n \"specifiers\": [\n {\n \"type\": \"ImportDefaultSpecifier\",\n \"span\": {\n \"start\": 7,\n \"end\": 12,\n \"ctxt\": 0\n },\n \"local\": {\n \"type\": \"Identifier\",\n \"span\": {\n \"start\": 7,\n \"end\": 12,\n \"ctxt\": 0\n },\n \"value\": \"React\",\n \"typeAnnotation\": null,\n \"optional\": false\n }\n }\n ],\n \"source\": {\n \"type\": \"StringLiteral\",\n \"span\": {\n \"start\": 18,\n \"end\": 25,\n \"ctxt\": 0\n },\n \"value\": \"react\",\n \"hasEscape\": false\n },\n \"typeOnly\": false,\n \"asserts\": null\n },\n {\n \"type\": \"FunctionDeclaration\",\n \"identifier\": {\n \"type\": \"Identifier\",\n \"span\": {\n \"start\": 37,\n \"end\": 40,\n \"ctxt\": 0\n },\n \"value\": \"App\",\n \"typeAnnotation\": null,\n \"optional\": false\n },\n \"declare\": false,\n \"params\": [],\n \"decorators\": [],\n \"span\": {\n \"start\": 28,\n \"end\": 231,\n \"ctxt\": 0\n },\n \"body\": {\n \"type\": \"BlockStatement\",\n \"span\": {\n \"start\": 43,\n \"end\": 231,\n \"ctxt\": 0\n },\n \"stmts\": [\n {\n \"type\": \"VariableDeclaration\",\n \"span\": {\n \"start\": 47,\n \"end\": 70,\n \"ctxt\": 0\n },\n \"kind\": \"const\",\n \"declare\": false,\n \"declarations\": [\n {\n \"type\": \"VariableDeclarator\",\n \"span\": {\n \"start\": 53,\n \"end\": 69,\n \"ctxt\": 0\n },\n \"id\": {\n \"type\": \"Identifier\",\n \"span\": {\n \"start\": 53,\n \"end\": 62,\n \"ctxt\": 0\n },\n \"value\": \"isLoading\",\n \"typeAnnotation\": null,\n \"optional\": false\n },\n \"init\": {\n \"type\": \"BooleanLiteral\",\n \"span\": {\n \"start\": 65,\n \"end\": 69,\n \"ctxt\": 0\n },\n \"value\": true\n },\n \"definite\": false\n }\n ]\n },\n {\n \"type\": \"ReturnStatement\",\n \"span\": {\n \"start\": 73,\n \"end\": 229,\n \"ctxt\": 0\n },\n \"argument\": {\n \"type\": \"ParenthesisExpression\",\n \"span\": {\n \"start\": 80,\n \"end\": 228,\n \"ctxt\": 0\n },\n \"expression\": {\n \"type\": \"JSXElement\",\n \"span\": {\n \"start\": 86,\n \"end\": 224,\n \"ctxt\": 0\n },\n \"opening\": {\n \"type\": \"JSXOpeningElement\",\n \"name\": {\n \"type\": \"Identifier\",\n \"span\": {\n \"start\": 87,\n \"end\": 90,\n \"ctxt\": 0\n },\n \"value\": \"div\",\n \"typeAnnotation\": null,\n \"optional\": false\n },\n \"span\": {\n \"start\": 86,\n \"end\": 91,\n \"ctxt\": 0\n },\n \"attributes\": [],\n \"selfClosing\": false,\n \"typeArguments\": null\n },\n \"children\": [\n {\n \"type\": \"JSXText\",\n \"span\": {\n \"start\": 91,\n \"end\": 98,\n \"ctxt\": 0\n },\n \"value\": \"\\n\\n \",\n \"raw\": \"\\n\\n \"\n },\n {\n \"type\": \"JSXElement\",\n \"span\": {\n \"start\": 98,\n \"end\": 113,\n \"ctxt\": 0\n },\n \"opening\": {\n \"type\": \"JSXOpeningElement\",\n \"name\": {\n \"type\": \"Identifier\",\n \"span\": {\n \"start\": 99,\n \"end\": 101,\n \"ctxt\": 0\n },\n \"value\": \"h1\",\n \"typeAnnotation\": null,\n \"optional\": false\n },\n \"span\": {\n \"start\": 98,\n \"end\": 102,\n \"ctxt\": 0\n },\n \"attributes\": [],\n \"selfClosing\": false,\n \"typeArguments\": null\n },\n \"children\": [\n {\n \"type\": \"JSXText\",\n \"span\": {\n \"start\": 102,\n \"end\": 108,\n \"ctxt\": 0\n },\n \"value\": \"works \",\n \"raw\": \"works \"\n }\n ],\n \"closing\": {\n \"type\": \"JSXClosingElement\",\n \"span\": {\n \"start\": 108,\n \"end\": 113,\n \"ctxt\": 0\n },\n \"name\": {\n \"type\": \"Identifier\",\n \"span\": {\n \"start\": 110,\n \"end\": 112,\n \"ctxt\": 0\n },\n \"value\": \"h1\",\n \"typeAnnotation\": null,\n \"optional\": false\n }\n }\n },\n {\n \"type\": \"JSXText\",\n \"span\": {\n \"start\": 113,\n \"end\": 120,\n \"ctxt\": 0\n },\n \"value\": \"\\n\\n \",\n \"raw\": \"\\n\\n \"\n },\n {\n \"type\": \"JSXExpressionContainer\",\n \"span\": {\n \"start\": 120,\n \"end\": 213,\n \"ctxt\": 0\n },\n \"expression\": {\n \"type\": \"ConditionalExpression\",\n \"span\": {\n \"start\": 130,\n \"end\": 205,\n \"ctxt\": 0\n },\n \"test\": {\n \"type\": \"Identifier\",\n \"span\": {\n \"start\": 130,\n \"end\": 139,\n \"ctxt\": 0\n },\n \"value\": \"isLoading\",\n \"typeAnnotation\": null,\n \"optional\": false\n },\n \"consequent\": {\n \"type\": \"JSXElement\",\n \"span\": {\n \"start\": 142,\n \"end\": 161,\n \"ctxt\": 0\n },\n \"opening\": {\n \"type\": \"JSXOpeningElement\",\n \"name\": {\n \"type\": \"Identifier\",\n \"span\": {\n \"start\": 143,\n \"end\": 146,\n \"ctxt\": 0\n },\n \"value\": \"div\",\n \"typeAnnotation\": null,\n \"optional\": false\n },\n \"span\": {\n \"start\": 142,\n \"end\": 147,\n \"ctxt\": 0\n },\n \"attributes\": [],\n \"selfClosing\": false,\n \"typeArguments\": null\n },\n \"children\": [\n {\n \"type\": \"JSXText\",\n \"span\": {\n \"start\": 147,\n \"end\": 155,\n \"ctxt\": 0\n },\n \"value\": \"loading \",\n \"raw\": \"loading \"\n }\n ],\n \"closing\": {\n \"type\": \"JSXClosingElement\",\n \"span\": {\n \"start\": 155,\n \"end\": 161,\n \"ctxt\": 0\n },\n \"name\": {\n \"type\": \"Identifier\",\n \"span\": {\n \"start\": 157,\n \"end\": 160,\n \"ctxt\": 0\n },\n \"value\": \"div\",\n \"typeAnnotation\": null,\n \"optional\": false\n }\n }\n },\n \"alternate\": {\n \"type\": \"JSXElement\",\n \"span\": {\n \"start\": 164,\n \"end\": 205,\n \"ctxt\": 0\n },\n \"opening\": {\n \"type\": \"JSXOpeningElement\",\n \"name\": {\n \"type\": \"Identifier\",\n \"span\": {\n \"start\": 165,\n \"end\": 168,\n \"ctxt\": 0\n },\n \"value\": \"div\",\n \"typeAnnotation\": null,\n \"optional\": false\n },\n \"span\": {\n \"start\": 164,\n \"end\": 169,\n \"ctxt\": 0\n },\n \"attributes\": [],\n \"selfClosing\": false,\n \"typeArguments\": null\n },\n \"children\": [\n {\n \"type\": \"JSXText\",\n \"span\": {\n \"start\": 169,\n \"end\": 199,\n \"ctxt\": 0\n },\n \"value\": \"naaaaaaaaaaaaffffffffffffffff \",\n \"raw\": \"naaaaaaaaaaaaffffffffffffffff \"\n }\n ],\n \"closing\": {\n \"type\": \"JSXClosingElement\",\n \"span\": {\n \"start\": 199,\n \"end\": 205,\n \"ctxt\": 0\n },\n \"name\": {\n \"type\": \"Identifier\",\n \"span\": {\n \"start\": 201,\n \"end\": 204,\n \"ctxt\": 0\n },\n \"value\": \"div\",\n \"typeAnnotation\": null,\n \"optional\": false\n }\n }\n }\n }\n },\n {\n \"type\": \"JSXText\",\n \"span\": {\n \"start\": 213,\n \"end\": 218,\n \"ctxt\": 0\n },\n \"value\": \"\\n\\n \",\n \"raw\": \"\\n\\n \"\n }\n ],\n \"closing\": {\n \"type\": \"JSXClosingElement\",\n \"span\": {\n \"start\": 218,\n \"end\": 224,\n \"ctxt\": 0\n },\n \"name\": {\n \"type\": \"Identifier\",\n \"span\": {\n \"start\": 220,\n \"end\": 223,\n \"ctxt\": 0\n },\n \"value\": \"div\",\n \"typeAnnotation\": null,\n \"optional\": false\n }\n }\n }\n }\n }\n ]\n },\n \"generator\": false,\n \"async\": false,\n \"typeParameters\": null,\n \"returnType\": null\n },\n {\n \"type\": \"ExportDefaultExpression\",\n \"span\": {\n \"start\": 233,\n \"end\": 252,\n \"ctxt\": 0\n },\n \"expression\": {\n \"type\": \"Identifier\",\n \"span\": {\n \"start\": 248,\n \"end\": 251,\n \"ctxt\": 0\n },\n \"value\": \"App\",\n \"typeAnnotation\": null,\n \"optional\": false\n }\n }\n ],\n \"interpreter\": null\n}\n"} +{"text": "// -*- C++ -*-\n\n// Copyright (C) 2005, 2006, 2009, 2011 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 gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp\n * Contains implementations of gp_ht_map_'s insert related functions,\n * when the hash value is not stored.\n */\n\nPB_DS_CLASS_T_DEC\ninline typename PB_DS_CLASS_C_DEC::size_type\nPB_DS_CLASS_C_DEC::\nfind_ins_pos(key_const_reference r_key, false_type)\n{\n size_type hash = ranged_probe_fn_base::operator()(r_key);\n size_type i;\n\n /* The insertion position is initted to a non-legal value to indicate\n * that it has not been initted yet.\n */\n size_type ins_pos = m_num_e;\n resize_base::notify_insert_search_start();\n for (i = 0; i < m_num_e; ++i)\n {\n const size_type pos = ranged_probe_fn_base::operator()(r_key, hash, i);\n _GLIBCXX_DEBUG_ASSERT(pos < m_num_e);\n entry* const p_e = m_entries + pos;\n switch(p_e->m_stat)\n {\n case empty_entry_status:\n\t {\n resize_base::notify_insert_search_end();\n\t PB_DS_CHECK_KEY_DOES_NOT_EXIST(r_key)\n\t return (ins_pos == m_num_e) ? pos : ins_pos;\n\t }\n\t break;\n case erased_entry_status:\n\t if (ins_pos == m_num_e)\n\t ins_pos = pos;\n\t break;\n case valid_entry_status:\n\t if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), r_key))\n {\n\t resize_base::notify_insert_search_end();\n\t PB_DS_CHECK_KEY_EXISTS(r_key)\n return pos;\n }\n\t break;\n default:\n\t _GLIBCXX_DEBUG_ASSERT(0);\n };\n\n resize_base::notify_insert_search_collision();\n }\n resize_base::notify_insert_search_end();\n if (ins_pos == m_num_e)\n __throw_insert_error();\n return ins_pos;\n}\n\nPB_DS_CLASS_T_DEC\ninline std::pair\nPB_DS_CLASS_C_DEC::\ninsert_imp(const_reference r_val, false_type)\n{\n key_const_reference r_key = PB_DS_V2F(r_val);\n const size_type pos = find_ins_pos(r_key, \n\t\t\t\t traits_base::m_store_extra_indicator);\n\n if (m_entries[pos].m_stat == valid_entry_status)\n {\n PB_DS_CHECK_KEY_EXISTS(r_key)\n return std::make_pair(&(m_entries + pos)->m_value, false);\n }\n\n PB_DS_CHECK_KEY_DOES_NOT_EXIST(r_key)\n return std::make_pair(insert_new_imp(r_val, pos), true);\n}\n\n"} +{"text": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code, released\n * March 31, 1998.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n\n/**\n File Name: 15.5.4.10-1.js\n ECMA Section: 15.5.4.10 String.prototype.substring( start, end )\n Description:\n\n 15.5.4.10 String.prototype.substring(start, end)\n\n Returns a substring of the result of converting this object to a string,\n starting from character position start and running to character position\n end of the string. The result is a string value, not a String object.\n\n If either argument is NaN or negative, it is replaced with zero; if either\n argument is larger than the length of the string, it is replaced with the\n length of the string.\n\n If start is larger than end, they are swapped.\n\n When the substring method is called with two arguments start and end, the\n following steps are taken:\n\n 1. Call ToString, giving it the this value as its argument.\n 2. Call ToInteger(start).\n 3. Call ToInteger (end).\n 4. Compute the number of characters in Result(1).\n 5. Compute min(max(Result(2), 0), Result(4)).\n 6. Compute min(max(Result(3), 0), Result(4)).\n 7. Compute min(Result(5), Result(6)).\n 8. Compute max(Result(5), Result(6)).\n 9. Return a string whose length is the difference between Result(8) and\n Result(7), containing characters from Result(1), namely the characters\n with indices Result(7) through Result(8)1, in ascending order.\n\n Note that the substring function is intentionally generic; it does not require\n that its this value be a String object. Therefore it can be transferred to other\n kinds of objects for use as a method.\n\n Author: christine@netscape.com\n Date: 12 november 1997\n*/\n\nvar SECTION = \"15.5.4.10-1\";\nvar VERSION = \"ECMA_1\";\nstartTest();\nvar TITLE = \"String.prototype.substring( start, end )\";\n\nwriteHeaderToLog( SECTION + \" \"+ TITLE);\n\nnew TestCase( SECTION, \"String.prototype.substring.length\", 2, String.prototype.substring.length );\nnew TestCase( SECTION, \"delete String.prototype.substring.length\", false, delete String.prototype.substring.length );\nnew TestCase( SECTION, \"delete String.prototype.substring.length; String.prototype.substring.length\", 2, eval(\"delete String.prototype.substring.length; String.prototype.substring.length\") );\n\n// test cases for when substring is called with no arguments.\n\n// this is a string object\n\nnew TestCase( SECTION,\n\t\t\"var s = new String('this is a string object'); typeof s.substring()\",\n\t\t\"string\",\n\t\teval(\"var s = new String('this is a string object'); typeof s.substring()\") );\n\nnew TestCase( SECTION,\n\t\t\"var s = new String(''); s.substring(1,0)\",\n\t\t\"\",\n\t\teval(\"var s = new String(''); s.substring(1,0)\") );\n\nnew TestCase( SECTION,\n\t\t\"var s = new String('this is a string object'); s.substring(true, false)\",\n\t\t\"t\",\n\t\teval(\"var s = new String('this is a string object'); s.substring(false, true)\") );\n\nnew TestCase( SECTION,\n\t\t\"var s = new String('this is a string object'); s.substring(NaN, Infinity)\",\n\t\t\"this is a string object\",\n\t\teval(\"var s = new String('this is a string object'); s.substring(NaN, Infinity)\") );\n\n\nnew TestCase( SECTION,\n\t\t\"var s = new String('this is a string object'); s.substring(Infinity, NaN)\",\n\t\t\"this is a string object\",\n\t\teval(\"var s = new String('this is a string object'); s.substring(Infinity, NaN)\") );\n\n\nnew TestCase( SECTION,\n\t\t\"var s = new String('this is a string object'); s.substring(Infinity, Infinity)\",\n\t\t\"\",\n\t\teval(\"var s = new String('this is a string object'); s.substring(Infinity, Infinity)\") );\n\nnew TestCase( SECTION,\n\t\t\"var s = new String('this is a string object'); s.substring(-0.01, 0)\",\n\t\t\"\",\n\t\teval(\"var s = new String('this is a string object'); s.substring(-0.01,0)\") );\n\n\nnew TestCase( SECTION,\n\t\t\"var s = new String('this is a string object'); s.substring(s.length, s.length)\",\n\t\t\"\",\n\t\teval(\"var s = new String('this is a string object'); s.substring(s.length, s.length)\") );\n\nnew TestCase( SECTION,\n\t\t\"var s = new String('this is a string object'); s.substring(s.length+1, 0)\",\n\t\t\"this is a string object\",\n\t\teval(\"var s = new String('this is a string object'); s.substring(s.length+1, 0)\") );\n\n\nnew TestCase( SECTION,\n\t\t\"var s = new String('this is a string object'); s.substring(-Infinity, -Infinity)\",\n\t\t\"\",\n\t\teval(\"var s = new String('this is a string object'); s.substring(-Infinity, -Infinity)\") );\n\n// this is not a String object, start is not an integer\n\n\nnew TestCase( SECTION,\n\t\t\"var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(Infinity,-Infinity)\",\n\t\t\"1,2,3,4,5\",\n\t\teval(\"var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(Infinity,-Infinity)\") );\n\nnew TestCase( SECTION,\n\t\t\"var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(true, false)\",\n\t\t\"1\",\n\t\teval(\"var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(true, false)\") );\n\nnew TestCase( SECTION,\n\t\t\"var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring('4', '5')\",\n\t\t\"3\",\n\t\teval(\"var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring('4', '5')\") );\n\n\n// this is an object object\nnew TestCase( SECTION,\n\t\t\"var obj = new Object(); obj.substring = String.prototype.substring; obj.substring(8,0)\",\n\t\t\"[object \",\n\t\teval(\"var obj = new Object(); obj.substring = String.prototype.substring; obj.substring(8,0)\") );\n\nnew TestCase( SECTION,\n\t\t\"var obj = new Object(); obj.substring = String.prototype.substring; obj.substring(8,obj.toString().length)\",\n\t\t\"Object]\",\n\t\teval(\"var obj = new Object(); obj.substring = String.prototype.substring; obj.substring(8, obj.toString().length)\") );\n\n// this is a function object\nnew TestCase( SECTION,\n\t\t\"var obj = new Function(); obj.substring = String.prototype.substring; obj.toString = Object.prototype.toString; obj.substring(8, Infinity)\",\n\t\t\"Function]\",\n\t\teval(\"var obj = new Function(); obj.substring = String.prototype.substring; obj.toString = Object.prototype.toString; obj.substring(8,Infinity)\") );\n// this is a number object\nnew TestCase( SECTION,\n\t\t\"var obj = new Number(NaN); obj.substring = String.prototype.substring; obj.substring(Infinity, NaN)\",\n\t\t\"NaN\",\n\t\teval(\"var obj = new Number(NaN); obj.substring = String.prototype.substring; obj.substring(Infinity, NaN)\") );\n\n// this is the Math object\nnew TestCase( SECTION,\n\t\t\"var obj = Math; obj.substring = String.prototype.substring; obj.substring(Math.PI, -10)\",\n\t\t\"[ob\",\n\t\teval(\"var obj = Math; obj.substring = String.prototype.substring; obj.substring(Math.PI, -10)\") );\n\n// this is a Boolean object\n\nnew TestCase( SECTION,\n\t\t\"var obj = new Boolean(); obj.substring = String.prototype.substring; obj.substring(new Array(), new Boolean(1))\",\n\t\t\"f\",\n\t\teval(\"var obj = new Boolean(); obj.substring = String.prototype.substring; obj.substring(new Array(), new Boolean(1))\") );\n\n// this is a user defined object\n\nnew TestCase( SECTION,\n\t \"var obj = new MyObject( void 0 ); obj.substring(0, 100)\",\n\t \"undefined\",\n\t eval( \"var obj = new MyObject( void 0 ); obj.substring(0,100)\") );\n\ntest();\n\nfunction MyObject( value ) {\n this.value = value;\n this.substring = String.prototype.substring;\n this.toString = new Function ( \"return this.value+''\" );\n}\n"} +{"text": "#\n# Copyright (c) 2017 Otávio Santana and others\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# and Apache License v2.0 which accompanies this distribution.\n# The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html\n# and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.\n#\n# You may elect to redistribute this code under either of these licenses.\n#\n# Contributors:\n#\n# Otavio Santana\n#\norg.eclipse.jnosql.artemis.keyvalue.spi.KeyValueExtension"} +{"text": "//===- llvm/Support/Signals.h - Signal Handling support ----------*- 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// This file defines some helpful functions for dealing with the possibility of\n// unix signals occurring while your program is running.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef LLVM_SUPPORT_SIGNALS_H\n#define LLVM_SUPPORT_SIGNALS_H\n\n#include \n\nnamespace llvm {\nclass StringRef;\nclass raw_ostream;\n\nnamespace sys {\n\n /// This function runs all the registered interrupt handlers, including the\n /// removal of files registered by RemoveFileOnSignal.\n void RunInterruptHandlers();\n\n /// This function registers signal handlers to ensure that if a signal gets\n /// delivered that the named file is removed.\n /// Remove a file if a fatal signal occurs.\n bool RemoveFileOnSignal(StringRef Filename, std::string* ErrMsg = nullptr);\n\n /// This function removes a file from the list of files to be removed on\n /// signal delivery.\n void DontRemoveFileOnSignal(StringRef Filename);\n\n /// When an error signal (such as SIGABRT or SIGSEGV) is delivered to the\n /// process, print a stack trace and then exit.\n /// Print a stack trace if a fatal signal occurs.\n /// \\param Argv0 the current binary name, used to find the symbolizer\n /// relative to the current binary before searching $PATH; can be\n /// StringRef(), in which case we will only search $PATH.\n /// \\param DisableCrashReporting if \\c true, disable the normal crash\n /// reporting mechanisms on the underlying operating system.\n void PrintStackTraceOnErrorSignal(StringRef Argv0,\n bool DisableCrashReporting = false);\n\n /// Disable all system dialog boxes that appear when the process crashes.\n void DisableSystemDialogsOnCrash();\n\n /// Print the stack trace using the given \\c raw_ostream object.\n void PrintStackTrace(raw_ostream &OS);\n\n // Run all registered signal handlers.\n void RunSignalHandlers();\n\n using SignalHandlerCallback = void (*)(void *);\n\n /// Add a function to be called when an abort/kill signal is delivered to the\n /// process. The handler can have a cookie passed to it to identify what\n /// instance of the handler it is.\n void AddSignalHandler(SignalHandlerCallback FnPtr, void *Cookie);\n\n /// This function registers a function to be called when the user \"interrupts\"\n /// the program (typically by pressing ctrl-c). When the user interrupts the\n /// program, the specified interrupt function is called instead of the program\n /// being killed, and the interrupt function automatically disabled.\n ///\n /// Note that interrupt functions are not allowed to call any non-reentrant\n /// functions. An null interrupt function pointer disables the current\n /// installed function. Note also that the handler may be executed on a\n /// different thread on some platforms.\n void SetInterruptFunction(void (*IF)());\n\n /// Registers a function to be called when an \"info\" signal is delivered to\n /// the process.\n ///\n /// On POSIX systems, this will be SIGUSR1; on systems that have it, SIGINFO\n /// will also be used (typically ctrl-t).\n ///\n /// Note that signal handlers are not allowed to call any non-reentrant\n /// functions. An null function pointer disables the current installed\n /// function. Note also that the handler may be executed on a different\n /// thread on some platforms.\n void SetInfoSignalFunction(void (*Handler)());\n} // End sys namespace\n} // End llvm namespace\n\n#endif\n"} +{"text": "#include \"gb.h\"\n#ifdef _WIN32\n#ifndef _WIN32_WINNT\n#define _WIN32_WINNT 0x0500\n#endif\n#include \n#else\n#include \n#endif\n\nstatic const unsigned GB_TAC_TRIGGER_BITS[] = {512, 8, 32, 128};\n\n#ifndef DISABLE_TIMEKEEPING\nstatic int64_t get_nanoseconds(void)\n{\n#ifndef _WIN32\n struct timeval now;\n gettimeofday(&now, NULL);\n return (now.tv_usec) * 1000 + now.tv_sec * 1000000000L;\n#else\n FILETIME time;\n GetSystemTimeAsFileTime(&time);\n return (((int64_t)time.dwHighDateTime << 32) | time.dwLowDateTime) * 100L;\n#endif\n}\n\nstatic void nsleep(uint64_t nanoseconds)\n{\n#ifndef _WIN32\n struct timespec sleep = {0, nanoseconds};\n nanosleep(&sleep, NULL);\n#else\n HANDLE timer;\n LARGE_INTEGER time;\n timer = CreateWaitableTimer(NULL, true, NULL);\n time.QuadPart = -(nanoseconds / 100L);\n SetWaitableTimer(timer, &time, 0, NULL, NULL, false);\n WaitForSingleObject(timer, INFINITE);\n CloseHandle(timer);\n#endif\n}\n\nbool GB_timing_sync_turbo(GB_gameboy_t *gb)\n{\n if (!gb->turbo_dont_skip) {\n int64_t nanoseconds = get_nanoseconds();\n if (nanoseconds <= gb->last_sync + (1000000000LL * LCDC_PERIOD / GB_get_clock_rate(gb))) {\n return true;\n }\n gb->last_sync = nanoseconds;\n }\n return false;\n}\n\nvoid GB_timing_sync(GB_gameboy_t *gb)\n{\n if (gb->turbo) {\n gb->cycles_since_last_sync = 0;\n return;\n }\n /* Prevent syncing if not enough time has passed.*/\n if (gb->cycles_since_last_sync < LCDC_PERIOD / 3) return;\n\n uint64_t target_nanoseconds = gb->cycles_since_last_sync * 1000000000LL / 2 / GB_get_clock_rate(gb); /* / 2 because we use 8MHz units */\n int64_t nanoseconds = get_nanoseconds();\n int64_t time_to_sleep = target_nanoseconds + gb->last_sync - nanoseconds;\n if (time_to_sleep > 0 && time_to_sleep < LCDC_PERIOD * 1000000000LL / GB_get_clock_rate(gb)) {\n nsleep(time_to_sleep);\n gb->last_sync += target_nanoseconds;\n }\n else {\n gb->last_sync = nanoseconds;\n }\n\n gb->cycles_since_last_sync = 0;\n if (gb->update_input_hint_callback) {\n gb->update_input_hint_callback(gb);\n }\n}\n#else\n\nbool GB_timing_sync_turbo(GB_gameboy_t *gb)\n{\n return false;\n}\n\nvoid GB_timing_sync(GB_gameboy_t *gb)\n{\n}\n\n#endif\nstatic void GB_ir_run(GB_gameboy_t *gb)\n{\n if (gb->ir_queue_length == 0) return;\n if (gb->cycles_since_input_ir_change >= gb->ir_queue[0].delay) {\n gb->cycles_since_input_ir_change -= gb->ir_queue[0].delay;\n gb->infrared_input = gb->ir_queue[0].state;\n gb->ir_queue_length--;\n memmove(&gb->ir_queue[0], &gb->ir_queue[1], sizeof(gb->ir_queue[0]) * (gb->ir_queue_length));\n }\n}\n\nstatic void advance_tima_state_machine(GB_gameboy_t *gb)\n{\n if (gb->tima_reload_state == GB_TIMA_RELOADED) {\n gb->tima_reload_state = GB_TIMA_RUNNING;\n }\n else if (gb->tima_reload_state == GB_TIMA_RELOADING) {\n gb->io_registers[GB_IO_IF] |= 4;\n gb->tima_reload_state = GB_TIMA_RELOADED;\n }\n}\n\nstatic void increase_tima(GB_gameboy_t *gb)\n{\n gb->io_registers[GB_IO_TIMA]++;\n if (gb->io_registers[GB_IO_TIMA] == 0) {\n gb->io_registers[GB_IO_TIMA] = gb->io_registers[GB_IO_TMA];\n gb->tima_reload_state = GB_TIMA_RELOADING;\n }\n}\n\nstatic void GB_set_internal_div_counter(GB_gameboy_t *gb, uint32_t value)\n{\n /* TIMA increases when a specific high-bit becomes a low-bit. */\n value &= INTERNAL_DIV_CYCLES - 1;\n uint32_t triggers = gb->div_counter & ~value;\n if ((gb->io_registers[GB_IO_TAC] & 4) && (triggers & GB_TAC_TRIGGER_BITS[gb->io_registers[GB_IO_TAC] & 3])) {\n increase_tima(gb);\n }\n \n /* TODO: Can switching to double speed mode trigger an event? */\n if (triggers & (gb->cgb_double_speed? 0x2000 : 0x1000)) {\n GB_apu_run(gb);\n GB_apu_div_event(gb);\n }\n gb->div_counter = value;\n}\n\nstatic void GB_timers_run(GB_gameboy_t *gb, uint8_t cycles)\n{\n GB_STATE_MACHINE(gb, div, cycles, 1) {\n GB_STATE(gb, div, 1);\n GB_STATE(gb, div, 2);\n GB_STATE(gb, div, 3);\n }\n \n GB_set_internal_div_counter(gb, 0);\nmain:\n GB_SLEEP(gb, div, 1, 3);\n while (true) {\n advance_tima_state_machine(gb);\n GB_set_internal_div_counter(gb, gb->div_counter + 4);\n gb->apu.apu_cycles += 4 << !gb->cgb_double_speed;\n GB_SLEEP(gb, div, 2, 4);\n }\n \n /* Todo: This is ugly to allow compatibility with 0.11 save states. Fix me when breaking save compatibility */\n {\n div3:\n /* Compensate for lack of prefetch emulation, as well as DIV's internal initial value */\n GB_set_internal_div_counter(gb, 8);\n goto main;\n }\n}\n\nstatic void advance_serial(GB_gameboy_t *gb, uint8_t cycles)\n{\n if (gb->serial_length == 0) {\n gb->serial_cycles += cycles;\n return;\n }\n \n while (cycles > gb->serial_length) {\n advance_serial(gb, gb->serial_length);\n cycles -= gb->serial_length;\n }\n \n uint16_t previous_serial_cycles = gb->serial_cycles;\n gb->serial_cycles += cycles;\n if ((gb->serial_cycles & gb->serial_length) != (previous_serial_cycles & gb->serial_length)) {\n gb->serial_count++;\n if (gb->serial_count == 8) {\n gb->serial_length = 0;\n gb->serial_count = 0;\n gb->io_registers[GB_IO_SC] &= ~0x80;\n gb->io_registers[GB_IO_IF] |= 8;\n }\n \n gb->io_registers[GB_IO_SB] <<= 1;\n \n if (gb->serial_transfer_bit_end_callback) {\n gb->io_registers[GB_IO_SB] |= gb->serial_transfer_bit_end_callback(gb);\n }\n else {\n gb->io_registers[GB_IO_SB] |= 1;\n }\n \n if (gb->serial_length) {\n /* Still more bits to send */\n if (gb->serial_transfer_bit_start_callback) {\n gb->serial_transfer_bit_start_callback(gb, gb->io_registers[GB_IO_SB] & 0x80);\n }\n }\n \n }\n return;\n \n}\n\nvoid GB_advance_cycles(GB_gameboy_t *gb, uint8_t cycles)\n{ \n // Affected by speed boost\n gb->dma_cycles += cycles;\n\n if (!gb->stopped) {\n GB_timers_run(gb, cycles);\n advance_serial(gb, cycles); // TODO: Verify what happens in STOP mode\n }\n\n gb->debugger_ticks += cycles;\n\n if (!gb->cgb_double_speed) {\n cycles <<= 1;\n }\n \n // Not affected by speed boost\n gb->double_speed_alignment += cycles;\n gb->hdma_cycles += cycles;\n gb->apu_output.sample_cycles += cycles;\n gb->cycles_since_ir_change += cycles;\n gb->cycles_since_input_ir_change += cycles;\n gb->cycles_since_last_sync += cycles;\n gb->cycles_since_run += cycles;\n if (!gb->stopped) { // TODO: Verify what happens in STOP mode\n GB_dma_run(gb);\n GB_hdma_run(gb);\n }\n GB_apu_run(gb);\n GB_display_run(gb, cycles);\n GB_ir_run(gb);\n}\n\n/* \n This glitch is based on the expected results of mooneye-gb rapid_toggle test.\n This glitch happens because how TIMA is increased, see GB_set_internal_div_counter.\n According to GiiBiiAdvance, GBC's behavior is different, but this was not tested or implemented.\n*/\nvoid GB_emulate_timer_glitch(GB_gameboy_t *gb, uint8_t old_tac, uint8_t new_tac)\n{\n /* Glitch only happens when old_tac is enabled. */\n if (!(old_tac & 4)) return;\n\n unsigned old_clocks = GB_TAC_TRIGGER_BITS[old_tac & 3];\n unsigned new_clocks = GB_TAC_TRIGGER_BITS[new_tac & 3];\n\n /* The bit used for overflow testing must have been 1 */\n if (gb->div_counter & old_clocks) {\n /* And now either the timer must be disabled, or the new bit used for overflow testing be 0. */\n if (!(new_tac & 4) || gb->div_counter & new_clocks) {\n increase_tima(gb);\n }\n }\n}\n\nvoid GB_rtc_run(GB_gameboy_t *gb)\n{\n if ((gb->rtc_real.high & 0x40) == 0) { /* is timer running? */\n time_t current_time = time(NULL);\n while (gb->last_rtc_second < current_time) {\n gb->last_rtc_second++;\n if (++gb->rtc_real.seconds == 60)\n {\n gb->rtc_real.seconds = 0;\n if (++gb->rtc_real.minutes == 60)\n {\n gb->rtc_real.minutes = 0;\n if (++gb->rtc_real.hours == 24)\n {\n gb->rtc_real.hours = 0;\n if (++gb->rtc_real.days == 0)\n {\n if (gb->rtc_real.high & 1) /* Bit 8 of days*/\n {\n gb->rtc_real.high |= 0x80; /* Overflow bit */\n }\n gb->rtc_real.high ^= 1;\n }\n }\n }\n }\n }\n }\n}\n"} +{"text": "{\n \"_from\": \"invert-kv@^2.0.0\",\n \"_id\": \"invert-kv@2.0.0\",\n \"_inBundle\": false,\n \"_integrity\": \"sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==\",\n \"_location\": \"/invert-kv\",\n \"_phantomChildren\": {},\n \"_requested\": {\n \"type\": \"range\",\n \"registry\": true,\n \"raw\": \"invert-kv@^2.0.0\",\n \"name\": \"invert-kv\",\n \"escapedName\": \"invert-kv\",\n \"rawSpec\": \"^2.0.0\",\n \"saveSpec\": null,\n \"fetchSpec\": \"^2.0.0\"\n },\n \"_requiredBy\": [\n \"/lcid\"\n ],\n \"_resolved\": \"https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz\",\n \"_shasum\": \"7393f5afa59ec9ff5f67a27620d11c226e3eec02\",\n \"_spec\": \"invert-kv@^2.0.0\",\n \"_where\": \"/Users/mperrotte/npminc/cli/node_modules/lcid\",\n \"author\": {\n \"name\": \"Sindre Sorhus\",\n \"email\": \"sindresorhus@gmail.com\",\n \"url\": \"sindresorhus.com\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/sindresorhus/invert-kv/issues\"\n },\n \"bundleDependencies\": false,\n \"deprecated\": false,\n \"description\": \"Invert the key/value of an object. Example: `{foo: 'bar'}` → `{bar: 'foo'}`\",\n \"devDependencies\": {\n \"ava\": \"*\",\n \"xo\": \"*\"\n },\n \"engines\": {\n \"node\": \">=4\"\n },\n \"files\": [\n \"index.js\"\n ],\n \"homepage\": \"https://github.com/sindresorhus/invert-kv#readme\",\n \"keywords\": [\n \"object\",\n \"key\",\n \"value\",\n \"kv\",\n \"invert\"\n ],\n \"license\": \"MIT\",\n \"name\": \"invert-kv\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/sindresorhus/invert-kv.git\"\n },\n \"scripts\": {\n \"test\": \"xo && ava\"\n },\n \"version\": \"2.0.0\"\n}\n"} +{"text": "var wheat = [\n { year: 1565, wheat: 41, wages: 5 },\n { year: 1570, wheat: 45, wages: 5.05 },\n { year: 1575, wheat: 42, wages: 5.08 },\n { year: 1580, wheat: 49, wages: 5.12 },\n { year: 1585, wheat: 41.5, wages: 5.15 },\n { year: 1590, wheat: 47, wages: 5.25 },\n { year: 1595, wheat: 64, wages: 5.54 },\n { year: 1600, wheat: 27, wages: 5.61 },\n { year: 1605, wheat: 33, wages: 5.69 },\n { year: 1610, wheat: 32, wages: 5.78 },\n { year: 1615, wheat: 33, wages: 5.94 },\n { year: 1620, wheat: 35, wages: 6.01 },\n { year: 1625, wheat: 33, wages: 6.12 },\n { year: 1630, wheat: 45, wages: 6.22 },\n { year: 1635, wheat: 33, wages: 6.3 },\n { year: 1640, wheat: 39, wages: 6.37 },\n { year: 1645, wheat: 53, wages: 6.45 },\n { year: 1650, wheat: 42, wages: 6.5 },\n { year: 1655, wheat: 40.5, wages: 6.6 },\n { year: 1660, wheat: 46.5, wages: 6.75 },\n { year: 1665, wheat: 32, wages: 6.8 },\n { year: 1670, wheat: 37, wages: 6.9 },\n { year: 1675, wheat: 43, wages: 7 },\n { year: 1680, wheat: 35, wages: 7.3 },\n { year: 1685, wheat: 27, wages: 7.6 },\n { year: 1690, wheat: 40, wages: 8 },\n { year: 1695, wheat: 50, wages: 8.5 },\n { year: 1700, wheat: 30, wages: 9 },\n { year: 1705, wheat: 32, wages: 10 },\n { year: 1710, wheat: 44, wages: 11 },\n { year: 1715, wheat: 33, wages: 11.75 },\n { year: 1720, wheat: 29, wages: 12.5 },\n { year: 1725, wheat: 39, wages: 13 },\n { year: 1730, wheat: 26, wages: 13.3 },\n { year: 1735, wheat: 32, wages: 13.6 },\n { year: 1740, wheat: 27, wages: 14 },\n { year: 1745, wheat: 27.5, wages: 14.5 },\n { year: 1750, wheat: 31, wages: 15 },\n { year: 1755, wheat: 35.5, wages: 15.7 },\n { year: 1760, wheat: 31, wages: 16.5 },\n { year: 1765, wheat: 43, wages: 17.6 },\n { year: 1770, wheat: 47, wages: 18.5 },\n { year: 1775, wheat: 44, wages: 19.5 },\n { year: 1780, wheat: 46, wages: 21 },\n { year: 1785, wheat: 42, wages: 23 },\n { year: 1790, wheat: 47.5, wages: 25.5 },\n { year: 1795, wheat: 76, wages: 27.5 },\n { year: 1800, wheat: 79, wages: 28.5 },\n { year: 1805, wheat: 81, wages: 29.5 },\n { year: 1810, wheat: 99, wages: 30 },\n { year: 1815, wheat: 78 }, // TODO\n { year: 1820, wheat: 54 },\n { year: 1821, wheat: 54 }\n];\n\nvar monarch = [\n { name: \"Elizabeth\", start: 1565, end: 1603 },\n { name: \"James I\", start: 1603, end: 1625 },\n { name: \"Charles I\", start: 1625, end: 1649 },\n { name: \"Cromwell\", start: 1649, end: 1660, commonwealth: true },\n { name: \"Charles II\", start: 1660, end: 1685 },\n { name: \"James II\", start: 1685, end: 1689 },\n { name: \"W&M\", start: 1689, end: 1702 },\n { name: \"Anne\", start: 1702, end: 1714 },\n { name: \"George I\", start: 1714, end: 1727 },\n { name: \"George II\", start: 1727, end: 1760 },\n { name: \"George III\", start: 1760, end: 1820 },\n { name: \"George IV\", start: 1820, end: 1821 }\n];\n"} +{"text": "\n\n \n \n \n \n \n \n \n Lasersaur v14.03 Build Instructions\n\n\n\n\n \n \n \n \n\n \n \n\n \n\n \n\n \n
    \n \n \n
    \n \n
      \n
    1. \n
    2. \n
    3. \n
    4. \n
    \n \n
    \n
    \n \n
    \n Perspective\n
    \n
    \n
    \n \n
    \n Top\n
    \n
    \n
    \n \n
    \n Front\n
    \n
    \n
    \n \n
    \n Right\n
    \n
    \n
    \n \n \n \n Previous\n \n \n \n Next\n \n
    8xCB5-10
    2xHBLFSD5
    8xHNTPZ5-5
    \n
    \n\n \n\n\n \n \n \n\n"} +{"text": "require_relative '../../spec_helper'\nrequire_relative 'fixtures/classes'\n\ndescribe \"Array#shuffle\" do\n it \"returns the same values, in a usually different order\" do\n a = [1, 2, 3, 4]\n different = false\n 10.times do\n s = a.shuffle\n s.sort.should == a\n different ||= (a != s)\n end\n different.should be_true # Will fail once in a blue moon (4!^10)\n end\n\n it \"is not destructive\" do\n a = [1, 2, 3]\n 10.times do\n a.shuffle\n a.should == [1, 2, 3]\n end\n end\n\n it \"does not return subclass instances with Array subclass\" do\n ArraySpecs::MyArray[1, 2, 3].shuffle.should be_an_instance_of(Array)\n end\n\n it \"attempts coercion via #to_hash\" do\n obj = mock('hash')\n obj.should_receive(:to_hash).once.and_return({})\n [2, 3].shuffle(obj)\n end\n\n it \"calls #rand on the Object passed by the :random key in the arguments Hash\" do\n obj = mock(\"array_shuffle_random\")\n obj.should_receive(:rand).at_least(1).times.and_return(0.5)\n\n result = [1, 2].shuffle(random: obj)\n result.size.should == 2\n result.should include(1, 2)\n end\n\n it \"raises a NoMethodError if an object passed for the RNG does not define #rand\" do\n obj = BasicObject.new\n\n -> { [1, 2].shuffle(random: obj) }.should raise_error(NoMethodError)\n end\n\n it \"accepts a Float for the value returned by #rand\" do\n random = mock(\"array_shuffle_random\")\n random.should_receive(:rand).at_least(1).times.and_return(0.3)\n\n [1, 2].shuffle(random: random).should be_an_instance_of(Array)\n end\n\n it \"calls #to_int on the Object returned by #rand\" do\n value = mock(\"array_shuffle_random_value\")\n value.should_receive(:to_int).at_least(1).times.and_return(0)\n random = mock(\"array_shuffle_random\")\n random.should_receive(:rand).at_least(1).times.and_return(value)\n\n [1, 2].shuffle(random: random).should be_an_instance_of(Array)\n end\n\n it \"raises a RangeError if the value is less than zero\" do\n value = mock(\"array_shuffle_random_value\")\n value.should_receive(:to_int).and_return(-1)\n random = mock(\"array_shuffle_random\")\n random.should_receive(:rand).and_return(value)\n\n -> { [1, 2].shuffle(random: random) }.should raise_error(RangeError)\n end\n\n it \"raises a RangeError if the value is equal to one\" do\n value = mock(\"array_shuffle_random_value\")\n value.should_receive(:to_int).at_least(1).times.and_return(1)\n random = mock(\"array_shuffle_random\")\n random.should_receive(:rand).at_least(1).times.and_return(value)\n\n -> { [1, 2].shuffle(random: random) }.should raise_error(RangeError)\n end\nend\n\ndescribe \"Array#shuffle!\" do\n it \"returns the same values, in a usually different order\" do\n a = [1, 2, 3, 4]\n original = a\n different = false\n 10.times do\n a = a.shuffle!\n a.sort.should == [1, 2, 3, 4]\n different ||= (a != [1, 2, 3, 4])\n end\n different.should be_true # Will fail once in a blue moon (4!^10)\n a.should equal(original)\n end\n\n it \"raises a #{frozen_error_class} on a frozen array\" do\n -> { ArraySpecs.frozen_array.shuffle! }.should raise_error(frozen_error_class)\n -> { ArraySpecs.empty_frozen_array.shuffle! }.should raise_error(frozen_error_class)\n end\nend\n"} +{"text": "define( [\n\t\"../core\",\n\t\"../core/nodeName\"\n], function( jQuery, nodeName ) {\n\n\"use strict\";\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE <=9 - 11 only\n\t// Use typeof to avoid zero-argument method invocation on host objects (#15151)\n\tvar ret;\n\n\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\tret = context.getElementsByTagName( tag || \"*\" );\n\n\t} else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n\t\tret = context.querySelectorAll( tag || \"*\" );\n\n\t} else {\n\t\tret = [];\n\t}\n\n\tif ( tag === undefined || tag && nodeName( context, tag ) ) {\n\t\treturn jQuery.merge( [ context ], ret );\n\t}\n\n\treturn ret;\n}\n\nreturn getAll;\n} );\n"} +{"text": "# Installing GRR clients on Mac OS X\n\nFor OSX you will see a pkg file, install the pkg. It will add a\nlaunchd item and start it.\n\nSee [Linux instructions](on-linux.md). They apply also to OSX.\n\nOn OSX you can also use the Uninstall GRR flow.\n\n## Uninstalling on Mac OS X\n\nThis is a quick manual on how to remove the GRR client completely from a machine.\n\nOn OSX, pkg uninstall is not supported. The files to delete are:\n\n```docker\n/usr/local/lib/grr/*\n/etc/grr.local.yaml\n/Library/LaunchDaemons/com.google.code.grr.plist\n```\n\nThe service can be stopped using\n\n```docker\nsudo launchctl unload /Library/LaunchDaemons/com.google.corp.grr.plist\n```\n"} +{"text": "description=DCI 4K 23.98 fps\nframe_rate_num=24000\nframe_rate_den=1001\nwidth=4096\nheight=2160\nprogressive=1\nsample_aspect_num=1\nsample_aspect_den=1\ndisplay_aspect_num=17\ndisplay_aspect_den=9\ncolorspace=2020\n"} +{"text": "\n\n \n \n \n \n \n"} +{"text": "// SPDX-License-Identifier: GPL-2.0\n#include \n#include \"util/kvm-stat.h\"\n#include \"util/parse-events.h\"\n#include \"util/debug.h\"\n#include \"util/evsel.h\"\n#include \"util/evlist.h\"\n#include \"util/pmu.h\"\n\n#include \"book3s_hv_exits.h\"\n#include \"book3s_hcalls.h\"\n#include \n\n#define NR_TPS 4\n\nconst char *vcpu_id_str = \"vcpu_id\";\nconst int decode_str_len = 40;\nconst char *kvm_entry_trace = \"kvm_hv:kvm_guest_enter\";\nconst char *kvm_exit_trace = \"kvm_hv:kvm_guest_exit\";\n\ndefine_exit_reasons_table(hv_exit_reasons, kvm_trace_symbol_exit);\ndefine_exit_reasons_table(hcall_reasons, kvm_trace_symbol_hcall);\n\n/* Tracepoints specific to ppc_book3s_hv */\nconst char *ppc_book3s_hv_kvm_tp[] = {\n\t\"kvm_hv:kvm_guest_enter\",\n\t\"kvm_hv:kvm_guest_exit\",\n\t\"kvm_hv:kvm_hcall_enter\",\n\t\"kvm_hv:kvm_hcall_exit\",\n\tNULL,\n};\n\n/* 1 extra placeholder for NULL */\nconst char *kvm_events_tp[NR_TPS + 1];\nconst char *kvm_exit_reason;\n\nstatic void hcall_event_get_key(struct evsel *evsel,\n\t\t\t\tstruct perf_sample *sample,\n\t\t\t\tstruct event_key *key)\n{\n\tkey->info = 0;\n\tkey->key = evsel__intval(evsel, sample, \"req\");\n}\n\nstatic const char *get_hcall_exit_reason(u64 exit_code)\n{\n\tstruct exit_reasons_table *tbl = hcall_reasons;\n\n\twhile (tbl->reason != NULL) {\n\t\tif (tbl->exit_code == exit_code)\n\t\t\treturn tbl->reason;\n\t\ttbl++;\n\t}\n\n\tpr_debug(\"Unknown hcall code: %lld\\n\",\n\t (unsigned long long)exit_code);\n\treturn \"UNKNOWN\";\n}\n\nstatic bool hcall_event_end(struct evsel *evsel,\n\t\t\t struct perf_sample *sample __maybe_unused,\n\t\t\t struct event_key *key __maybe_unused)\n{\n\treturn (!strcmp(evsel->name, kvm_events_tp[3]));\n}\n\nstatic bool hcall_event_begin(struct evsel *evsel,\n\t\t\t struct perf_sample *sample, struct event_key *key)\n{\n\tif (!strcmp(evsel->name, kvm_events_tp[2])) {\n\t\thcall_event_get_key(evsel, sample, key);\n\t\treturn true;\n\t}\n\n\treturn false;\n}\nstatic void hcall_event_decode_key(struct perf_kvm_stat *kvm __maybe_unused,\n\t\t\t\t struct event_key *key,\n\t\t\t\t char *decode)\n{\n\tconst char *hcall_reason = get_hcall_exit_reason(key->key);\n\n\tscnprintf(decode, decode_str_len, \"%s\", hcall_reason);\n}\n\nstatic struct kvm_events_ops hcall_events = {\n\t.is_begin_event = hcall_event_begin,\n\t.is_end_event = hcall_event_end,\n\t.decode_key = hcall_event_decode_key,\n\t.name = \"HCALL-EVENT\",\n};\n\nstatic struct kvm_events_ops exit_events = {\n\t.is_begin_event = exit_event_begin,\n\t.is_end_event = exit_event_end,\n\t.decode_key = exit_event_decode_key,\n\t.name = \"VM-EXIT\"\n};\n\nstruct kvm_reg_events_ops kvm_reg_events_ops[] = {\n\t{ .name = \"vmexit\", .ops = &exit_events },\n\t{ .name = \"hcall\", .ops = &hcall_events },\n\t{ NULL, NULL },\n};\n\nconst char * const kvm_skip_events[] = {\n\tNULL,\n};\n\n\nstatic int is_tracepoint_available(const char *str, struct evlist *evlist)\n{\n\tstruct parse_events_error err;\n\tint ret;\n\n\tbzero(&err, sizeof(err));\n\tret = parse_events(evlist, str, &err);\n\tif (err.str)\n\t\tparse_events_print_error(&err, \"tracepoint\");\n\treturn ret;\n}\n\nstatic int ppc__setup_book3s_hv(struct perf_kvm_stat *kvm,\n\t\t\t\tstruct evlist *evlist)\n{\n\tconst char **events_ptr;\n\tint i, nr_tp = 0, err = -1;\n\n\t/* Check for book3s_hv tracepoints */\n\tfor (events_ptr = ppc_book3s_hv_kvm_tp; *events_ptr; events_ptr++) {\n\t\terr = is_tracepoint_available(*events_ptr, evlist);\n\t\tif (err)\n\t\t\treturn -1;\n\t\tnr_tp++;\n\t}\n\n\tfor (i = 0; i < nr_tp; i++)\n\t\tkvm_events_tp[i] = ppc_book3s_hv_kvm_tp[i];\n\n\tkvm_events_tp[i] = NULL;\n\tkvm_exit_reason = \"trap\";\n\tkvm->exit_reasons = hv_exit_reasons;\n\tkvm->exit_reasons_isa = \"HV\";\n\n\treturn 0;\n}\n\n/* Wrapper to setup kvm tracepoints */\nstatic int ppc__setup_kvm_tp(struct perf_kvm_stat *kvm)\n{\n\tstruct evlist *evlist = evlist__new();\n\n\tif (evlist == NULL)\n\t\treturn -ENOMEM;\n\n\t/* Right now, only supported on book3s_hv */\n\treturn ppc__setup_book3s_hv(kvm, evlist);\n}\n\nint setup_kvm_events_tp(struct perf_kvm_stat *kvm)\n{\n\treturn ppc__setup_kvm_tp(kvm);\n}\n\nint cpu_isa_init(struct perf_kvm_stat *kvm, const char *cpuid __maybe_unused)\n{\n\tint ret;\n\n\tret = ppc__setup_kvm_tp(kvm);\n\tif (ret) {\n\t\tkvm->exit_reasons = NULL;\n\t\tkvm->exit_reasons_isa = NULL;\n\t}\n\n\treturn ret;\n}\n\n/*\n * Incase of powerpc architecture, pmu registers are programmable\n * by guest kernel. So monitoring guest via host may not provide\n * valid samples with default 'cycles' event. It is better to use\n * 'trace_imc/trace_cycles' event for guest profiling, since it\n * can track the guest instruction pointer in the trace-record.\n *\n * Function to parse the arguments and return appropriate values.\n */\nint kvm_add_default_arch_event(int *argc, const char **argv)\n{\n\tconst char **tmp;\n\tbool event = false;\n\tint i, j = *argc;\n\n\tconst struct option event_options[] = {\n\t\tOPT_BOOLEAN('e', \"event\", &event, NULL),\n\t\tOPT_END()\n\t};\n\n\ttmp = calloc(j + 1, sizeof(char *));\n\tif (!tmp)\n\t\treturn -EINVAL;\n\n\tfor (i = 0; i < j; i++)\n\t\ttmp[i] = argv[i];\n\n\tparse_options(j, tmp, event_options, NULL, PARSE_OPT_KEEP_UNKNOWN);\n\tif (!event) {\n\t\tif (pmu_have_event(\"trace_imc\", \"trace_cycles\")) {\n\t\t\targv[j++] = strdup(\"-e\");\n\t\t\targv[j++] = strdup(\"trace_imc/trace_cycles/\");\n\t\t\t*argc += 2;\n\t\t} else {\n\t\t\tfree(tmp);\n\t\t\treturn -EINVAL;\n\t\t}\n\t}\n\n\tfree(tmp);\n\treturn 0;\n}\n"} +{"text": "name: block_bio_queue\nID: 399\nformat:\n\tfield:unsigned short common_type;\toffset:0;\tsize:2;\tsigned:0;\n\tfield:unsigned char common_flags;\toffset:2;\tsize:1;\tsigned:0;\n\tfield:unsigned char common_preempt_count;\toffset:3;\tsize:1;\tsigned:0;\n\tfield:int common_pid;\toffset:4;\tsize:4;\tsigned:1;\n\n\tfield:dev_t dev;\toffset:8;\tsize:4;\tsigned:0;\n\tfield:sector_t sector;\toffset:16;\tsize:8;\tsigned:0;\n\tfield:unsigned int nr_sector;\toffset:24;\tsize:4;\tsigned:0;\n\tfield:char rwbs[8];\toffset:28;\tsize:8;\tsigned:0;\n\tfield:char comm[16];\toffset:36;\tsize:16;\tsigned:0;\n\nprint fmt: \"%d,%d %s %llu + %u [%s]\", ((unsigned int) ((REC->dev) >> 20)), ((unsigned int) ((REC->dev) & ((1U << 20) - 1))), REC->rwbs, (unsigned long long)REC->sector, REC->nr_sector, REC->comm\n"} +{"text": "package = \"Lua-cURL\"\nversion = \"0.3.4-1\"\n\nsource = {\n url = \"https://github.com/Lua-cURL/Lua-cURLv3/archive/v0.3.4.zip\",\n dir = \"Lua-cURLv3-0.3.4\",\n}\n\ndescription = {\n summary = \"Lua binding to libcurl\",\n detailed = [[\n ]],\n homepage = \"https://github.com/Lua-cURL\",\n license = \"MIT/X11\"\n}\n\ndependencies = {\n \"lua >= 5.1, < 5.4\"\n}\n\nexternal_dependencies = {\n platforms = {\n windows = {\n CURL = {\n header = \"curl/curl.h\",\n library = \"libcurl\",\n }\n };\n unix = {\n CURL = {\n header = \"curl/curl.h\",\n -- library = \"curl\",\n }\n };\n }\n}\n\nbuild = {\n copy_directories = {'doc', 'examples'},\n\n type = \"builtin\",\n\n platforms = {\n windows = { modules = {\n lcurl = {\n libraries = {\"libcurl\", \"ws2_32\"},\n }\n }},\n unix = { modules = {\n lcurl = {\n libraries = {\"curl\"},\n }\n }}\n },\n\n modules = {\n [\"cURL\" ] = \"src/lua/cURL.lua\",\n [\"cURL.safe\" ] = \"src/lua/cURL/safe.lua\",\n [\"cURL.utils\" ] = \"src/lua/cURL/utils.lua\",\n [\"cURL.impl.cURL\" ] = \"src/lua/cURL/impl/cURL.lua\",\n\n lcurl = {\n sources = {\n \"src/l52util.c\", \"src/lceasy.c\", \"src/lcerror.c\",\n \"src/lchttppost.c\", \"src/lcurl.c\", \"src/lcutils.c\",\n \"src/lcmulti.c\", \"src/lcshare.c\",\n },\n incdirs = { \"$(CURL_INCDIR)\" },\n libdirs = { \"$(CURL_LIBDIR)\" }\n },\n }\n}\n\n\n"} +{"text": "/*\nCopyright The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Code generated by client-gen. DO NOT EDIT.\n\npackage fake\n\nimport (\n\t\"context\"\n\n\tv1beta1 \"k8s.io/api/authorization/v1beta1\"\n\tv1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\tschema \"k8s.io/apimachinery/pkg/runtime/schema\"\n\ttesting \"k8s.io/client-go/testing\"\n)\n\n// FakeSubjectAccessReviews implements SubjectAccessReviewInterface\ntype FakeSubjectAccessReviews struct {\n\tFake *FakeAuthorizationV1beta1\n}\n\nvar subjectaccessreviewsResource = schema.GroupVersionResource{Group: \"authorization.k8s.io\", Version: \"v1beta1\", Resource: \"subjectaccessreviews\"}\n\nvar subjectaccessreviewsKind = schema.GroupVersionKind{Group: \"authorization.k8s.io\", Version: \"v1beta1\", Kind: \"SubjectAccessReview\"}\n\n// Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any.\nfunc (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1beta1.SubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SubjectAccessReview, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), &v1beta1.SubjectAccessReview{})\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1beta1.SubjectAccessReview), err\n}\n"} +{"text": "/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\npackage org.apache.apex.malhar.lib.io;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.net.URI;\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport javax.servlet.ServletException;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\nimport org.eclipse.jetty.server.Handler;\nimport org.eclipse.jetty.server.Request;\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.server.handler.AbstractHandler;\nimport org.junit.Assert;\nimport org.junit.Test;\n\nimport org.apache.apex.malhar.lib.testbench.CollectorTestSink;\nimport org.apache.apex.malhar.lib.util.TestUtils;\nimport org.apache.commons.io.IOUtils;\n\n/**\n * Functional test for {\n *\n * @linkcom.datatorrent.lib.io.HttpLinesInputOperator }.\n *\n * @since 0.9.4\n */\npublic class HttpLinesInputOperatorTest\n{\n @Test\n public void testHttpInputModule() throws Exception\n {\n\n final List receivedMessages = new ArrayList();\n Handler handler = new AbstractHandler()\n {\n @Override\n public void handle(String string, Request rq, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException\n {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n IOUtils.copy(request.getInputStream(), bos);\n receivedMessages.add(new String(bos.toByteArray()));\n response.setContentType(\"text/plain\");\n response.setStatus(HttpServletResponse.SC_OK);\n response.getOutputStream().println(\"Hello\");\n response.getOutputStream().println(\"World,\");\n response.getOutputStream().println(\"Big\");\n response.getOutputStream().println(\"Data!\");\n response.getOutputStream().flush();\n\n ((Request)request).setHandled(true);\n }\n\n };\n\n Server server = new Server(0);\n server.setHandler(handler);\n server.start();\n\n String url = \"http://localhost:\" + server.getConnectors()[0].getLocalPort() + \"/somecontext\";\n\n final HttpLinesInputOperator operator = new HttpLinesInputOperator();\n CollectorTestSink sink = TestUtils.setSink(operator.outputPort, new CollectorTestSink());\n operator.setUrl(new URI(url));\n\n operator.setup(null);\n operator.activate(null);\n\n int timeoutMillis = 3000;\n while (sink.collectedTuples.isEmpty() && timeoutMillis > 0) {\n operator.emitTuples();\n timeoutMillis -= 20;\n Thread.sleep(20);\n }\n\n Assert.assertTrue(\"tuple emitted\", sink.collectedTuples.size() > 0);\n\n Assert.assertEquals(\"\", sink.collectedTuples.get(0), \"Hello\");\n Assert.assertEquals(\"\", sink.collectedTuples.get(1), \"World,\");\n Assert.assertEquals(\"\", sink.collectedTuples.get(2), \"Big\");\n Assert.assertEquals(\"\", sink.collectedTuples.get(3), \"Data!\");\n\n operator.deactivate();\n operator.teardown();\n server.stop();\n\n }\n\n}\n"} +{"text": "\n\n\nservice\n\n\\x0a2D Particle Simulator\\x0a\n\\x0aEnter the number of particles to simulate \\x281-10\\x29:\\x0a\n8\\x0a\n\\x0aEnter Position (x,y):\\x0a\n311.81900,192.94846\\x0a\n\\x0aEnter Velocity (x,y):\\x0a\n11.01635,4.50456\\x0a\n\\x0aEnter Mass:\\x0a\n79.88327\\x0a\n\\x0aEnter Radius:\\x0a\n74.36530\\x0a\n\\x0aInvalid simulation data. Try again.\\x0a\n\\x0aEnter Position (x,y):\\x0a\n156.41941,180.56579\\x0a\n\\x0aEnter Velocity (x,y):\\x0a\n4.15413,6.60669\\x0a\n\\x0aEnter Mass:\\x0a\n5.12982\\x0a\n\\x0aEnter Radius:\\x0a\n7.66530\\x0a\n\\x0aParticle #1 added at (156.41941,180.56579) velocity(4.15413,6.60669) mass(5.12982) radius(7.66530).\\x0a\n\\x0aEnter Position (x,y):\\x0a\n157.03480,131.50058\\x0a\n\\x0aEnter Velocity (x,y):\\x0a\n4.61881,9.29996\\x0a\n\\x0aEnter Mass:\\x0a\n2.66772\\x0a\n\\x0aEnter Radius:\\x0a\n4.16800\\x0a\n\\x0aParticle #2 added at (157.03480,131.50058) velocity(4.61881,9.29996) mass(2.66772) radius(4.16800).\\x0a\n\\x0aEnter Position (x,y):\\x0a\n159.15516,113.61230\\x0a\n\\x0aEnter Velocity (x,y):\\x0a\n2.45241,3.77152\\x0a\n\\x0aEnter Mass:\\x0a\n7.24180\\x0a\n\\x0aEnter Radius:\\x0a\n6.86645\\x0a\n\\x0aParticle #3 added at (159.15516,113.61230) velocity(2.45241,3.77152) mass(7.24180) radius(6.86645).\\x0a\n\\x0aEnter Position (x,y):\\x0a\n177.32699,116.09034\\x0a\n\\x0aEnter Velocity (x,y):\\x0a\n5.07399,0.03327\\x0a\n\\x0aEnter Mass:\\x0a\n6.37852\\x0a\n\\x0aEnter Radius:\\x0a\n1.05075\\x0a\n\\x0aParticle #4 added at (177.32699,116.09034) velocity(5.07399,0.03327) mass(6.37852) radius(1.05075).\\x0a\n\\x0aEnter Position (x,y):\\x0a\n119.91250,157.69975\\x0a\n\\x0aEnter Velocity (x,y):\\x0a\n3.54561,5.20260\\x0a\n\\x0aEnter Mass:\\x0a\n9.61916\\x0a\n\\x0aEnter Radius:\\x0a\n6.37378\\x0a\n\\x0aParticle #5 added at (119.91250,157.69975) velocity(3.54561,5.20260) mass(9.61916) radius(6.37378).\\x0a\n\\x0aEnter Position (x,y):\\x0a\n168.09678,115.08057\\x0a\n\\x0aEnter Velocity (x,y):\\x0a\n5.29824,5.66343\\x0a\n\\x0aEnter Mass:\\x0a\n2.42906\\x0a\n\\x0aEnter Radius:\\x0a\n2.49543\\x0a\n\\x0aInvalid simulation data. Try again.\\x0a\n\\x0aEnter Position (x,y):\\x0a\n176.98647,115.77149\\x0a\n\\x0aEnter Velocity (x,y):\\x0a\n3.31908,9.16155\\x0a\n\\x0aEnter Mass:\\x0a\n2.74467\\x0a\n\\x0aEnter Radius:\\x0a\n1.29510\\x0a\n\\x0aInvalid simulation data. Try again.\\x0a\n\\x0aEnter Position (x,y):\\x0a\n138.92584,192.43458\\x0a\n\\x0aEnter Velocity (x,y):\\x0a\n7.36059,9.19238\\x0a\n\\x0aEnter Mass:\\x0a\n7.54731\\x0a\n\\x0aEnter Radius:\\x0a\n3.14163\\x0a\n\\x0aParticle #6 added at (138.92584,192.43458) velocity(7.36059,9.19238) mass(7.54731) radius(3.14163).\\x0a\n\\x0aEnter Position (x,y):\\x0a\n149.30760,122.47263\\x0a\n\\x0aEnter Velocity (x,y):\\x0a\n8.92701,8.95365\\x0a\n\\x0aEnter Mass:\\x0a\n4.68844\\x0a\n\\x0aEnter Radius:\\x0a\n6.41635\\x0a\n\\x0aInvalid simulation data. Try again.\\x0a\n\\x0aEnter Position (x,y):\\x0a\n168.76496,191.59083\\x0a\n\\x0aEnter Velocity (x,y):\\x0a\n1.12907,5.87905\\x0a\n\\x0aEnter Mass:\\x0a\n5.33590\\x0a\n\\x0aEnter Radius:\\x0a\n7.22010\\x0a\n\\x0aParticle #7 added at (168.76496,191.59083) velocity(1.12907,5.87905) mass(5.33590) radius(7.22010).\\x0a\n\\x0aEnter Position (x,y):\\x0a\n176.64543,180.56606\\x0a\n\\x0aEnter Velocity (x,y):\\x0a\n1.66940,7.48388\\x0a\n\\x0aEnter Mass:\\x0a\n4.67140\\x0a\n\\x0aEnter Radius:\\x0a\n9.02526\\x0a\n\\x0aInvalid simulation data. Try again.\\x0a\n\\x0aEnter Position (x,y):\\x0a\n114.86424,120.61629\\x0a\n\\x0aEnter Velocity (x,y):\\x0a\n5.63434,7.26614\\x0a\n\\x0aEnter Mass:\\x0a\n5.87121\\x0a\n\\x0aEnter Radius:\\x0a\n8.74203\\x0a\n\\x0aParticle #8 added at (114.86424,120.61629) velocity(5.63434,7.26614) mass(5.87121) radius(8.74203).\\x0a\n\\x0aRunning simulation with...\\x0a\n\\x0a8 total particles:\\x0a\n\\x0a0: Position (156.41000,180.56000) Velocity (4.15000,6.60000) mass (5.12000) radius (7.66000).\\x0a\n\\x0a1: Position (157.03000,131.50000) Velocity (4.61000,9.29000) mass (2.66000) radius (4.16000).\\x0a\n\\x0a2: Position (159.15000,113.61000) Velocity (2.45000,3.77000) mass (7.24000) radius (6.86000).\\x0a\n\\x0a3: Position (177.32000,116.09000) Velocity (5.07000,0.03000) mass (6.37000) radius (1.05000).\\x0a\n\\x0a4: Position (119.91000,157.69000) Velocity (3.54000,5.20000) mass (9.61000) radius (6.37000).\\x0a\n\\x0a5: Position (138.92000,192.43000) Velocity (7.36000,9.19000) mass (7.54000) radius (3.14000).\\x0a\n\\x0a6: Position (168.76000,191.59000) Velocity (1.12000,5.87000) mass (5.33000) radius (7.22000).\\x0a\n\\x0a7: Position (114.86000,120.61000) Velocity (5.63000,7.26000) mass (5.87000) radius (8.74000).\\x0a\n\\x0a--------------------\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000001000001000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000100000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00010000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000100000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00100000000000000000\\x0a\n\\x0a00000000000000010000\\x0a\n\\x0a00000000000100000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a--------------------\\x0a\n\\x0aSimulation complete, 7 collisions simulated over 10 seconds in 80 frames.\\x0a\n\\x0a8 total particles:\\x0a\n\\x0a0: Position (177.44268,171.45924) Velocity (1.76172,0.79110) mass (5.12000) radius (7.66000).\\x0a\n\\x0a1: Position (108.98485,182.61222) Velocity (-15.18048,17.10687) mass (2.66000) radius (4.16000).\\x0a\n\\x0a2: Position (183.65000,151.31000) Velocity (2.45000,3.77000) mass (7.24000) radius (6.86000).\\x0a\n\\x0a3: Position (169.88000,116.39000) Velocity (-5.07000,0.03000) mass (6.37000) radius (1.05000).\\x0a\n\\x0a4: Position (122.47417,193.20985) Velocity (-5.80380,-1.57893) mass (9.61000) radius (6.37000).\\x0a\n\\x0a5: Position (146.91521,181.32942) Velocity (0.70555,-4.70001) mass (7.54000) radius (3.14000).\\x0a\n\\x0a6: Position (191.58489,184.59261) Velocity (-10.22658,-1.24211) mass (5.33000) radius (7.22000).\\x0a\n\\x0a7: Position (164.75913,189.90775) Velocity (2.35140,5.56855) mass (5.87000) radius (8.74000).\\x0a\n\\x0a--------------------\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00001000000000000000\\x0a\n\\x0a00000000000010000000\\x0a\n\\x0a01000000010000000010\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000010000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000001000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000001000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a00000000000000000000\\x0a\n\\x0a--------------------\\x0a\n\\x0aGoodbye\\x0a\n\n\n"} +{"text": "/*\n * (C) Copyright 2003-2004\n * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com\n *\n * SPDX-License-Identifier:\tGPL-2.0+\n */\n\n/*\n * Neutralize little endians.\n */\n#define SWAP_LONG(data) ((unsigned long) \\\n\t\t\t (((unsigned long)(data) >> 24) | \\\n\t\t\t ((unsigned long)(data) << 24) | \\\n\t\t\t (((unsigned long)(data) >> 8) & 0x0000ff00 ) | \\\n\t\t\t (((unsigned long)(data) << 8) & 0x00ff0000 )))\n#define SWAP_SHORT(data) ((unsigned short) \\\n\t\t\t (((unsigned short)(data) >> 8 ) | \\\n\t\t\t ((unsigned short)(data) << 8 )))\n#define LOAD_LONG(data) SWAP_LONG(data)\n#define LOAD_SHORT(data) SWAP_SHORT(data)\n\n#define S1D_WRITE_PALETTE(p,i,r,g,b)\t\t\t\t\t\\\n\t{\t\t\t\t\t\t\t\t\\\n\t\tout_8(&((uchar*)(p))[palette_index], (uchar)(i));\t\\\n\t\tout_8(&((uchar*)(p))[palette_index], (uchar)(r));\t\\\n\t\tout_8(&((uchar*)(p))[palette_index], (uchar)(g));\t\\\n\t\tout_8(&((uchar*)(p))[palette_index], (uchar)(b));\t\\\n\t}\n\ntypedef struct\n{\n ushort Index;\n uchar Value;\n} S1D_REGS;\n\ntypedef struct /**** BMP file info structure ****/\n{\n\tunsigned int biSize; /* Size of info header */\n\tint biWidth; /* Width of image */\n\tint biHeight; /* Height of image */\n\tunsigned short biPlanes; /* Number of color planes */\n\tunsigned short biBitCount; /* Number of bits per pixel */\n\tunsigned int biCompression; /* Type of compression to use */\n\tunsigned int biSizeImage; /* Size of image data */\n\tint biXPelsPerMeter; /* X pixels per meter */\n\tint biYPelsPerMeter; /* Y pixels per meter */\n\tunsigned int biClrUsed; /* Number of colors used */\n\tunsigned int biClrImportant; /* Number of important colors */\n} BITMAPINFOHEADER;\n"} +{"text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\npackage org.apache.guacamole.net.auth;\n\nimport java.util.Map;\n\n/**\n * Represents the semantics which apply to an existing connection when shared,\n * along with a human-readable name and unique identifier.\n */\npublic interface SharingProfile extends Identifiable, Attributes {\n\n /**\n * Returns the human-readable name assigned to this SharingProfile.\n *\n * @return\n * The name assigned to this SharingProfile.\n */\n public String getName();\n\n /**\n * Sets the human-readable name assigned to this SharingProfile.\n *\n * @param name\n * The name to assign.\n */\n public void setName(String name);\n\n /**\n * Returns the identifier of the primary connection associated with this\n * connection. The primary connection is the connection that this sharing\n * profile can be used to share.\n *\n * @return\n * The identifier of the primary connection associated with this\n * connection.\n */\n public String getPrimaryConnectionIdentifier();\n\n /**\n * Sets the identifier of the primary connection associated with this\n * connection. The primary connection is the connection that this sharing\n * profile can be used to share.\n *\n * @param identifier\n * The identifier of the primary connection associated with this\n * connection.\n */\n public void setPrimaryConnectionIdentifier(String identifier);\n\n /**\n * Returns a map which contains connection parameter name/value pairs as\n * key/value pairs. Changes to this map will affect the parameters stored\n * within this sharing profile. The differences in these parameters compared\n * to those of the associated primary connection yield different levels of\n * access to users joining the primary connection via this sharing profile.\n * Note that because configurations may contain sensitive information, some\n * data in this map may be omitted or tokenized.\n *\n * @return\n * A map which contains all connection parameter name/value pairs as\n * key/value pairs.\n */\n public Map getParameters();\n\n /**\n * Replaces all current parameters with the parameters defined within the\n * given map. Key/value pairs within the map represent parameter name/value\n * pairs. The differences in these parameters compared to those of the\n * associated primary connection yield different levels of access to users\n * joining the primary connection via this sharing profile.\n *\n * @param parameters\n * A map which contains all connection parameter name/value pairs as\n * key/value pairs.\n */\n public void setParameters(Map parameters);\n\n}\n"} +{"text": "import TypeClass\n\ndefclass Witchcraft.Apply do\n @moduledoc \"\"\"\n An extension of `Witchcraft.Functor`, `Apply` provides a way to _apply_ arguments\n to functions when both are wrapped in the same kind of container. This can be\n seen as running function application \"in a context\".\n\n For a nice, illustrated introduction,\n see [Functors, Applicatives, And Monads In Pictures](http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html).\n\n ## Graphically\n\n If function application looks like this\n\n data |> function == result\n\n and a functor looks like this\n\n %Container ~> function == %Container\n\n then an apply looks like\n\n %Container ~>> %Container == %Container\n\n which is similar to function application inside containers, plus the ability to\n attach special effects to applications.\n\n data --------------- function ---------------> result\n %Container --- %Container ---> %Container\n\n This lets us do functorial things like\n\n * continue applying values to a curried function resulting from a `Witchcraft.Functor.lift/2`\n * apply multiple functions to multiple arguments (with lists)\n * propogate some state (like [`Nothing`](https://hexdocs.pm/algae/Algae.Maybe.Nothing.html#content)\n in [`Algae.Maybe`](https://hexdocs.pm/algae/Algae.Maybe.html#content))\n\n but now with a much larger number of arguments, reuse partially applied functions,\n and run effects with the function container as well as the data container.\n\n ## Examples\n\n iex> ap([fn x -> x + 1 end, fn y -> y * 10 end], [1, 2, 3])\n [2, 3, 4, 10, 20, 30]\n\n iex> [100, 200]\n ...> |> Witchcraft.Functor.lift(fn(x, y, z) -> x * y / z end)\n ...> |> provide([5, 2])\n ...> |> provide([100, 50])\n [5.0, 10.0, 2.0, 4.0, 10.0, 20.0, 4.0, 8.0]\n # ↓ ↓\n # 100 * 5 / 100 200 * 5 / 50\n\n iex> import Witchcraft.Functor\n ...>\n ...> [100, 200]\n ...> ~> fn(x, y, z) ->\n ...> x * y / z\n ...> end <<~ [5, 2]\n ...> <<~ [100, 50]\n [5.0, 10.0, 2.0, 4.0, 10.0, 20.0, 4.0, 8.0]\n # ↓ ↓\n # 100 * 5 / 100 200 * 5 / 50\n\n %Algae.Maybe.Just{just: 42}\n ~> fn(x, y, z) ->\n x * y / z\n end <<~ %Algae.Maybe.Nothing{}\n <<~ %Algae.Maybe.Just{just: 99}\n #=> %Algae.Maybe.Nothing{}\n\n ## `convey` vs `ap`\n\n `convey` and `ap` essentially associate in opposite directions. For example,\n large data is _usually_ more efficient with `ap`, and large numbers of\n functions are _usually_ more efficient with `convey`.\n\n It's also more consistent consistency. In Elixir, we like to think of a \"subject\"\n being piped through a series of transformations. This places the function argument\n as the second argument. In `Witchcraft.Functor`, this was of little consequence.\n However, in `Apply`, we're essentially running superpowered function application.\n `ap` is short for `apply`, as to not conflict with `Kernel.apply/2`, and is meant\n to respect a similar API, with the function as the first argument. This also reads\n nicely when piped, as it becomes `[funs] |> ap([args1]) |> ap([args2])`,\n which is similar in structure to `fun.(arg2).(arg1)`.\n\n With potentially multiple functions being applied over potentially\n many arguments, we need to worry about ordering. `convey` not only flips\n the order of arguments, but also who is in control of ordering.\n `convey` typically runs each function over all arguments (`first_fun ⬸ all_args`),\n and `ap` runs all functions for each element (`first_arg ⬸ all_funs`).\n This may change the order of results, and is a feature, not a bug.\n\n iex> [1, 2, 3]\n ...> |> convey([&(&1 + 1), &(&1 * 10)])\n [\n 2, 10, # [(1 + 1), (1 * 10)]\n 3, 20, # [(2 + 1), (2 * 10)]\n 4, 30 # [(3 + 1), (3 * 10)]\n ]\n\n iex> [&(&1 + 1), &(&1 * 10)]\n ...> |> ap([1, 2, 3])\n [\n 2, 3, 4, # [(1 + 1), (2 + 1), (3 + 1)]\n 10, 20, 30 # [(1 * 10), (2 * 10), (3 * 10)]\n ]\n\n ## Type Class\n\n An instance of `Witchcraft.Apply` must also implement `Witchcraft.Functor`,\n and define `Witchcraft.Apply.convey/2`.\n\n Functor [map/2]\n ↓\n Apply [convey/2]\n \"\"\"\n\n alias __MODULE__\n use Quark\n\n alias Witchcraft.Functor\n extend Witchcraft.Functor\n use Witchcraft.Functor\n\n @type t :: any()\n @type fun :: any()\n\n defmacro __using__(opts \\\\ []) do\n quote do\n use Witchcraft.Functor, unquote(opts)\n import unquote(__MODULE__), unquote(opts)\n end\n end\n\n where do\n @doc \"\"\"\n Pipe arguments to functions, when both are wrapped in the same\n type of data structure.\n\n ## Examples\n\n iex> [1, 2, 3]\n ...> |> convey([fn x -> x + 1 end, fn y -> y * 10 end])\n [2, 10, 3, 20, 4, 30]\n\n \"\"\"\n @spec convey(Apply.t(), Apply.fun()) :: Apply.t()\n def convey(wrapped_args, wrapped_funs)\n end\n\n properties do\n def composition(data) do\n alias Witchcraft.Functor\n use Quark\n\n as = data |> generate() |> Functor.map(&inspect/1)\n fs = data |> generate() |> Functor.replace(fn x -> x <> x end)\n gs = data |> generate() |> Functor.replace(fn y -> y <> \"foo\" end)\n\n left = Apply.convey(Apply.convey(as, gs), fs)\n\n right =\n fs\n |> Functor.lift(&compose/2)\n |> (fn x -> Apply.convey(gs, x) end).()\n |> (fn y -> Apply.convey(as, y) end).()\n\n equal?(left, right)\n end\n end\n\n @doc \"\"\"\n Alias for `convey/2`.\n\n Why \"hose\"?\n\n * Pipes (`|>`) are application with arguments flipped\n * `ap/2` is like function application \"in a context\"\n * The opposite of `ap` is a contextual pipe\n * `hose`s are a kind of flexible pipe\n\n Q.E.D.\n\n ![](http://s2.quickmeme.com/img/fd/fd0baf5ada879021c32129fc7dea679bd7666e708df8ca8ca536da601ea3d29e.jpg)\n\n ## Examples\n\n iex> [1, 2, 3]\n ...> |> hose([fn x -> x + 1 end, fn y -> y * 10 end])\n [2, 10, 3, 20, 4, 30]\n\n \"\"\"\n @spec hose(Apply.t(), Apply.fun()) :: Apply.t()\n def hose(wrapped_args, wrapped_funs), do: convey(wrapped_args, wrapped_funs)\n\n @doc \"\"\"\n Reverse arguments and sequencing of `convey/2`.\n\n Conceptually this makes operations happen in\n a different order than `convey/2`, with the left-side arguments (functions) being\n run on all right-side arguments, in that order. We're altering the _sequencing_\n of function applications.\n\n ## Examples\n\n iex> ap([fn x -> x + 1 end, fn y -> y * 10 end], [1, 2, 3])\n [2, 3, 4, 10, 20, 30]\n\n # For comparison\n iex> convey([1, 2, 3], [fn x -> x + 1 end, fn y -> y * 10 end])\n [2, 10, 3, 20, 4, 30]\n\n iex> [100, 200]\n ...> |> Witchcraft.Functor.lift(fn(x, y, z) -> x * y / z end)\n ...> |> ap([5, 2])\n ...> |> ap([100, 50])\n [5.0, 10.0, 2.0, 4.0, 10.0, 20.0, 4.0, 8.0]\n # ↓ ↓\n # 100 * 5 / 100 200 * 5 / 50\n\n \"\"\"\n @spec ap(Apply.fun(), Apply.t()) :: Apply.t()\n def ap(wrapped_funs, wrapped) do\n lift(wrapped, wrapped_funs, fn arg, fun -> fun.(arg) end)\n end\n\n @doc \"\"\"\n Async version of `convey/2`\n\n ## Examples\n\n iex> [1, 2, 3]\n ...> |> async_convey([fn x -> x + 1 end, fn y -> y * 10 end])\n [2, 10, 3, 20, 4, 30]\n\n 0..10_000\n |> Enum.to_list()\n |> async_convey([\n fn x ->\n Process.sleep(500)\n x + 1\n end,\n fn y ->\n Process.sleep(500)\n y * 10\n end\n ])\n #=> [1, 0, 2, 10, 3, 30, ...] in around a second\n\n \"\"\"\n @spec async_convey(Apply.t(), Apply.fun()) :: Apply.t()\n def async_convey(wrapped_args, wrapped_funs) do\n wrapped_args\n |> convey(\n lift(wrapped_funs, fn fun, arg ->\n Task.async(fn ->\n fun.(arg)\n end)\n end)\n )\n |> map(&Task.await/1)\n end\n\n @doc \"\"\"\n Async version of `ap/2`\n\n ## Examples\n\n iex> [fn x -> x + 1 end, fn y -> y * 10 end]\n ...> |> async_ap([1, 2, 3])\n [2, 3, 4, 10, 20, 30]\n\n [\n fn x ->\n Process.sleep(500)\n x + 1\n end,\n fn y ->\n Process.sleep(500)\n y * 10\n end\n ]\n |> async_ap(Enum.to_list(0..10_000))\n #=> [1, 2, 3, 4, ...] in around a second\n\n \"\"\"\n @spec async_ap(Apply.fun(), Apply.t()) :: Apply.t()\n def async_ap(wrapped_funs, wrapped_args) do\n wrapped_funs\n |> lift(fn fun, arg ->\n Task.async(fn ->\n fun.(arg)\n end)\n end)\n |> ap(wrapped_args)\n |> map(&Task.await/1)\n end\n\n @doc \"\"\"\n Operator alias for `ap/2`\n\n Moves against the pipe direction, but in the order of normal function application\n\n ## Examples\n\n iex> [fn x -> x + 1 end, fn y -> y * 10 end] <<~ [1, 2, 3]\n [2, 3, 4, 10, 20, 30]\n\n iex> import Witchcraft.Functor\n ...>\n ...> [100, 200]\n ...> ~> fn(x, y, z) -> x * y / z\n ...> end <<~ [5, 2]\n ...> <<~ [100, 50]\n ...> ~> fn x -> x + 1 end\n [6.0, 11.0, 3.0, 5.0, 11.0, 21.0, 5.0, 9.0]\n\n iex> import Witchcraft.Functor, only: [<~: 2]\n ...> fn(a, b, c, d) -> a * b - c + d end <~ [1, 2] <<~ [3, 4] <<~ [5, 6] <<~ [7, 8]\n [5, 6, 4, 5, 6, 7, 5, 6, 8, 9, 7, 8, 10, 11, 9, 10]\n\n \"\"\"\n defalias wrapped_funs <<~ wrapped, as: :provide\n\n @doc \"\"\"\n Operator alias for `reverse_ap/2`, moving in the pipe direction\n\n ## Examples\n\n iex> [1, 2, 3] ~>> [fn x -> x + 1 end, fn y -> y * 10 end]\n [2, 10, 3, 20, 4, 30]\n\n iex> import Witchcraft.Functor\n ...>\n ...> [100, 50]\n ...> ~>> ([5, 2] # Note the bracket\n ...> ~>> ([100, 200] # on both `Apply` lines\n ...> ~> fn(x, y, z) -> x * y / z end))\n [5.0, 10.0, 2.0, 4.0, 10.0, 20.0, 4.0, 8.0]\n\n \"\"\"\n defalias wrapped ~>> wrapped_funs, as: :supply\n\n @doc \"\"\"\n Same as `convey/2`, but with all functions curried.\n\n ## Examples\n\n iex> [1, 2, 3]\n ...> |> supply([fn x -> x + 1 end, fn y -> y * 10 end])\n [2, 10, 3, 20, 4, 30]\n\n \"\"\"\n @spec supply(Apply.t(), Apply.fun()) :: Apply.t()\n def supply(args, funs), do: convey(args, Functor.map(funs, &curry/1))\n\n @doc \"\"\"\n Same as `ap/2`, but with all functions curried.\n\n ## Examples\n\n iex> [&+/2, &*/2]\n ...> |> provide([1, 2, 3])\n ...> |> ap([4, 5, 6])\n [5, 6, 7, 6, 7, 8, 7, 8, 9, 4, 5, 6, 8, 10, 12, 12, 15, 18]\n\n \"\"\"\n @spec provide(Apply.fun(), Apply.t()) :: Apply.t()\n def provide(funs, args), do: funs |> Functor.map(&curry/1) |> ap(args)\n\n @doc \"\"\"\n Sequence actions, replacing the first/previous values with the last argument\n\n This is essentially a sequence of actions forgetting the first argument\n\n ## Examples\n\n iex> [1, 2, 3]\n ...> |> then([4, 5, 6])\n ...> |> then([7, 8, 9])\n [\n 7, 8, 9,\n 7, 8, 9,\n 7, 8, 9,\n 7, 8, 9,\n 7, 8, 9,\n 7, 8, 9,\n 7, 8, 9,\n 7, 8, 9,\n 7, 8, 9\n ]\n\n iex> {1, 2, 3} |> then({4, 5, 6}) |> then({7, 8, 9})\n {12, 15, 9}\n\n \"\"\"\n @spec then(Apply.t(), Apply.t()) :: Apply.t()\n def then(wrapped_a, wrapped_b), do: over(&Quark.constant(&2, &1), wrapped_a, wrapped_b)\n\n @doc \"\"\"\n Sequence actions, replacing the last argument with the first argument's values\n\n This is essentially a sequence of actions forgetting the second argument\n\n ## Examples\n\n iex> [1, 2, 3]\n ...> |> following([3, 4, 5])\n ...> |> following([5, 6, 7])\n [\n 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 2, 2, 2, 2, 2, 2, 2, 2, 2,\n 3, 3, 3, 3, 3, 3, 3, 3, 3\n ]\n\n iex> {1, 2, 3} |> following({4, 5, 6}) |> following({7, 8, 9})\n {12, 15, 3}\n\n \"\"\"\n @spec following(Apply.t(), Apply.t()) :: Apply.t()\n def following(wrapped_a, wrapped_b), do: lift(wrapped_b, wrapped_a, &Quark.constant(&2, &1))\n\n @doc \"\"\"\n Extends `Functor.lift/2` to apply arguments to a binary function\n\n ## Examples\n\n iex> lift([1, 2], [3, 4], &+/2)\n [4, 5, 5, 6]\n\n iex> [1, 2]\n ...> |> lift([3, 4], &*/2)\n [3, 6, 4, 8]\n\n \"\"\"\n @spec lift(Apply.t(), Apply.t(), fun()) :: Apply.t()\n def lift(a, b, fun) do\n a\n |> lift(fun)\n |> (fn f -> convey(b, f) end).()\n end\n\n @doc \"\"\"\n Extends `lift` to apply arguments to a ternary function\n\n ## Examples\n\n iex> lift([1, 2], [3, 4], [5, 6], fn(a, b, c) -> a * b - c end)\n [-2, -3, 1, 0, -1, -2, 3, 2]\n\n \"\"\"\n @spec lift(Apply.t(), Apply.t(), Apply.t(), fun()) :: Apply.t()\n def lift(a, b, c, fun), do: a |> lift(b, fun) |> ap(c)\n\n @doc \"\"\"\n Extends `lift` to apply arguments to a quaternary function\n\n ## Examples\n\n iex> lift([1, 2], [3, 4], [5, 6], [7, 8], fn(a, b, c, d) -> a * b - c + d end)\n [5, 6, 4, 5, 8, 9, 7, 8, 6, 7, 5, 6, 10, 11, 9, 10]\n\n \"\"\"\n @spec lift(Apply.t(), Apply.t(), Apply.t(), Apply.t(), fun()) :: Apply.t()\n def lift(a, b, c, d, fun), do: a |> lift(b, c, fun) |> ap(d)\n\n @doc \"\"\"\n Extends `Functor.async_lift/2` to apply arguments to a binary function\n\n ## Examples\n\n iex> async_lift([1, 2], [3, 4], &+/2)\n [4, 5, 5, 6]\n\n iex> [1, 2]\n ...> |> async_lift([3, 4], &*/2)\n [3, 6, 4, 8]\n\n \"\"\"\n @spec async_lift(Apply.t(), Apply.t(), fun()) :: Apply.t()\n def async_lift(a, b, fun) do\n a\n |> async_lift(fun)\n |> (fn f -> async_convey(b, f) end).()\n end\n\n @doc \"\"\"\n Extends `async_lift` to apply arguments to a ternary function\n\n ## Examples\n\n iex> async_lift([1, 2], [3, 4], [5, 6], fn(a, b, c) -> a * b - c end)\n [-2, -3, 1, 0, -1, -2, 3, 2]\n\n \"\"\"\n @spec async_lift(Apply.t(), Apply.t(), Apply.t(), fun()) :: Apply.t()\n def async_lift(a, b, c, fun), do: a |> async_lift(b, fun) |> async_ap(c)\n\n @doc \"\"\"\n Extends `async_lift` to apply arguments to a quaternary function\n\n ## Examples\n\n iex> async_lift([1, 2], [3, 4], [5, 6], [7, 8], fn(a, b, c, d) -> a * b - c + d end)\n [5, 6, 4, 5, 8, 9, 7, 8, 6, 7, 5, 6, 10, 11, 9, 10]\n\n \"\"\"\n @spec async_lift(Apply.t(), Apply.t(), Apply.t(), Apply.t(), fun()) :: Apply.t()\n def async_lift(a, b, c, d, fun), do: a |> async_lift(b, c, fun) |> async_ap(d)\n\n @doc \"\"\"\n Extends `over` to apply arguments to a binary function\n\n ## Examples\n\n iex> over(&+/2, [1, 2], [3, 4])\n [4, 5, 5, 6]\n\n iex> (&*/2)\n ...> |> over([1, 2], [3, 4])\n [3, 4, 6, 8]\n\n \"\"\"\n @spec over(fun(), Apply.t(), Apply.t()) :: Apply.t()\n def over(fun, a, b), do: a |> lift(fun) |> ap(b)\n\n @doc \"\"\"\n Extends `over` to apply arguments to a ternary function\n\n ## Examples\n\n iex> fn(a, b, c) -> a * b - c end\n iex> |> over([1, 2], [3, 4], [5, 6])\n [-2, -3, -1, -2, 1, 0, 3, 2]\n\n \"\"\"\n @spec over(fun(), Apply.t(), Apply.t(), Apply.t()) :: Apply.t()\n def over(fun, a, b, c), do: fun |> over(a, b) |> ap(c)\n\n @doc \"\"\"\n Extends `over` to apply arguments to a ternary function\n\n ## Examples\n\n iex> fn(a, b, c) -> a * b - c end\n ...> |> over([1, 2], [3, 4], [5, 6])\n [-2, -3, -1, -2, 1, 0, 3, 2]\n\n \"\"\"\n @spec over(fun(), Apply.t(), Apply.t(), Apply.t()) :: Apply.t()\n def over(fun, a, b, c, d), do: fun |> over(a, b, c) |> ap(d)\n\n @doc \"\"\"\n Extends `async_over` to apply arguments to a binary function\n\n ## Examples\n\n iex> async_over(&+/2, [1, 2], [3, 4])\n [4, 5, 5, 6]\n\n iex> (&*/2)\n ...> |> async_over([1, 2], [3, 4])\n [3, 4, 6, 8]\n\n \"\"\"\n @spec async_over(fun(), Apply.t(), Apply.t()) :: Apply.t()\n def async_over(fun, a, b), do: a |> lift(fun) |> async_ap(b)\n\n @doc \"\"\"\n Extends `async_over` to apply arguments to a ternary function\n\n ## Examples\n\n iex> fn(a, b, c) -> a * b - c end\n iex> |> async_over([1, 2], [3, 4], [5, 6])\n [-2, -3, -1, -2, 1, 0, 3, 2]\n\n \"\"\"\n @spec async_over(fun(), Apply.t(), Apply.t(), Apply.t()) :: Apply.t()\n def async_over(fun, a, b, c), do: fun |> async_over(a, b) |> async_ap(c)\n\n @doc \"\"\"\n Extends `async_over` to apply arguments to a ternary function\n\n ## Examples\n\n iex> fn(a, b, c) -> a * b - c end\n ...> |> async_over([1, 2], [3, 4], [5, 6])\n [-2, -3, -1, -2, 1, 0, 3, 2]\n\n \"\"\"\n @spec async_over(fun(), Apply.t(), Apply.t(), Apply.t()) :: Apply.t()\n def async_over(fun, a, b, c, d), do: fun |> async_over(a, b, c) |> async_ap(d)\nend\n\ndefinst Witchcraft.Apply, for: Function do\n use Quark\n def convey(g, f), do: fn x -> curry(f).(x).(curry(g).(x)) end\nend\n\ndefinst Witchcraft.Apply, for: List do\n def convey(val_list, fun_list) when is_list(fun_list) do\n Enum.flat_map(val_list, fn val ->\n Enum.map(fun_list, fn fun -> fun.(val) end)\n end)\n end\nend\n\n# Contents must be semigroups\ndefinst Witchcraft.Apply, for: Tuple do\n import TypeClass.Property.Generator, only: [generate: 1]\n use Witchcraft.Semigroup\n\n custom_generator(_) do\n {generate(\"\"), generate(1), generate(0), generate(\"\"), generate(\"\"), generate(\"\")}\n end\n\n def convey({v, w}, {a, fun}), do: {v <> a, fun.(w)}\n def convey({v, w, x}, {a, b, fun}), do: {v <> a, w <> b, fun.(x)}\n def convey({v, w, x, y}, {a, b, c, fun}), do: {v <> a, w <> b, x <> c, fun.(y)}\n\n def convey({v, w, x, y, z}, {a, b, c, d, fun}) do\n {\n a <> v,\n b <> w,\n c <> x,\n d <> y,\n fun.(z)\n }\n end\n\n def convey(tuple_a, tuple_b) when tuple_size(tuple_a) == tuple_size(tuple_b) do\n last_index = tuple_size(tuple_a) - 1\n\n tuple_a\n |> Tuple.to_list()\n |> Enum.zip(Tuple.to_list(tuple_b))\n |> Enum.with_index()\n |> Enum.map(fn\n {{arg, fun}, ^last_index} -> fun.(arg)\n {{left, right}, _} -> left <> right\n end)\n |> List.to_tuple()\n end\nend\n"} +{"text": "#!/bin/sh\n\n# $Id: findEnsFtpNames.sh,v 1.1 2009/07/14 18:40:25 hiram Exp $\n\nVERSION=$1\nif [ \"x${VERSION}y\" = \"xy\" ]; then\n echo \"usage: findEnsFtpNames.sh \"\n echo \"where is something like: 55\"\n echo \"this script will scan the ftp.ensembl.org site and extract\"\n echo \"the names from the files there that we need to create\"\n echo \"correspondence to UCSC database names\"\n echo \"when complete, look for result files:\"\n echo \"release..gtf.names\"\n echo \"release..MySQL.names\"\n echo \"release..fasta.names\"\n echo \"use those lists to edit EnsGeneAutomate.pm\"\n exit 255\nfi\n\necho \"Scanning for GTF file names\"\n\necho \"user anonymous hiram@soe\ncd pub/release-${VERSION}/gtf\nls -lR\nbye\" > ftp.rsp\n\nftp -n -v -i ftp.ensembl.org < ftp.rsp > release.${VERSION}.gtf.ls-lR\n\negrep -v \"CHECKSUMS|README\" release.${VERSION}.gtf.ls-lR | awk '\n{\nif (match($1,\"^[a-z_]*:$\")) {gsub(\":$\",\"\",$1); printf \"%s/\", $1 }\nif (NF == 9) { if (match($1,\"^-rw\")) {printf \"%s\\n\", $NF} }\n}\n' | sed -e \"s#^#'x' => '#; s#\\$#',#\" > release.${VERSION}.gtf.names\n\necho \"Scanning for MySQL table files\"\n\necho \"user anonymous hiram@soe\ncd pub/release-${VERSION}/mysql\nls -lR\nbye\" > ftp.rsp\n\nftp -i -n -v ftp.ensembl.org < ftp.rsp > release.${VERSION}.MySQL.ls-lR\n\negrep \"_core_${VERSION}.*:$\" release.${VERSION}.MySQL.ls-lR \\\n | sed -e 's/://;' | sed -e \"s#^#'x' => '#; s#\\$#',#\" \\\n > release.${VERSION}.MySQL.names\n\nif [ 0 = 1 ]; then\nawk '\nBEGIN{ D=\"notYet\" }\n{\n if (!match($1,\"^d\")) {\n if (match($1,\"^./\")) {\n gsub(\"^./\",\"\",$1); gsub(\":$\",\"\",$1); D = $1;\n if (match(D,\"_core_\")) { printf \"%s\\n\", D }\n }\n }\n}\n' release.${VERSION}.MySQL.ls-lR \\\n\t| sed -e \"s#^#'x' => '#; s#\\$#',#\" > release.${VERSION}.MySQL.names\n\nfi\n\necho \"Scanning for protein fasta files:\"\n\necho \"user anonymous hiram@ucsc\ncd pub/release-${VERSION}/fasta\nls -lR\nbye\" > ftp.rsp\n\nftp -i -n -v ftp.ensembl.org < ftp.rsp > release.${VERSION}.fasta.ls-lR\n\nawk '\nBEGIN{ D=\"notYet\" }\n{\n if (!match($1,\"^d\")) {\n if (match($1,\"^[a-z_]*/pep:$\")) {\n gsub(\":$\",\"\",$1); D = $1;\n }\n if ((9 == NF) && match($1,\"^-rw\") && match($NF,\"pep.all.fa\")) {\n printf \"%s/%s\\n\", D, $NF\n }\n }\n}\n' release.${VERSION}.fasta.ls-lR \\\n\t| sed -e \"s#^#'x' => '#; s#\\$#',#\" > release.${VERSION}.fasta.names\n\nrm -f ftp.rsp\n"} +{"text": "\n * Marcello Duarte \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nnamespace Prophecy\\PhpDocumentor;\n\nuse phpDocumentor\\Reflection\\DocBlock\\Tag\\MethodTag as LegacyMethodTag;\nuse phpDocumentor\\Reflection\\DocBlock\\Tags\\Method;\n\n/**\n * @author Théo FIDRY \n *\n * @internal\n */\nfinal class ClassAndInterfaceTagRetriever implements MethodTagRetrieverInterface\n{\n private $classRetriever;\n\n public function __construct(MethodTagRetrieverInterface $classRetriever = null)\n {\n if (null !== $classRetriever) {\n $this->classRetriever = $classRetriever;\n\n return;\n }\n\n $this->classRetriever = class_exists('phpDocumentor\\Reflection\\DocBlockFactory') && class_exists('phpDocumentor\\Reflection\\Types\\ContextFactory')\n ? new ClassTagRetriever()\n : new LegacyClassTagRetriever()\n ;\n }\n\n /**\n * @param \\ReflectionClass $reflectionClass\n *\n * @return LegacyMethodTag[]|Method[]\n */\n public function getTagList(\\ReflectionClass $reflectionClass)\n {\n return array_merge(\n $this->classRetriever->getTagList($reflectionClass),\n $this->getInterfacesTagList($reflectionClass)\n );\n }\n\n /**\n * @param \\ReflectionClass $reflectionClass\n *\n * @return LegacyMethodTag[]|Method[]\n */\n private function getInterfacesTagList(\\ReflectionClass $reflectionClass)\n {\n $interfaces = $reflectionClass->getInterfaces();\n $tagList = array();\n\n foreach($interfaces as $interface) {\n $tagList = array_merge($tagList, $this->classRetriever->getTagList($interface));\n }\n\n return $tagList;\n }\n}\n"} +{"text": "/*\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n#pragma once\n\n#include \n#include \n#include \n\n#include \n#include \n\nnamespace facebook {\nnamespace jsi {\n\nclass Runtime;\n\nusing RuntimeFactory = std::function()>;\n\nstd::vector runtimeGenerators();\n\nclass JSITestBase : public ::testing::TestWithParam {\n public:\n JSITestBase() : factory(GetParam()), runtime(factory()), rt(*runtime) {}\n\n Value eval(const char* code) {\n return rt.global().getPropertyAsFunction(rt, \"eval\").call(rt, code);\n }\n\n Function function(const std::string& code) {\n return eval((\"(\" + code + \")\").c_str()).getObject(rt).getFunction(rt);\n }\n\n bool checkValue(const Value& value, const std::string& jsValue) {\n return function(\"function(value) { return value == \" + jsValue + \"; }\")\n .call(rt, std::move(value))\n .getBool();\n }\n\n RuntimeFactory factory;\n std::unique_ptr runtime;\n Runtime& rt;\n};\n} // namespace jsi\n} // namespace facebook\n"} +{"text": "\ncoming soon\n"} +{"text": "\nWildcardInForeignImport.hs:6:48: error:\n Wildcard ‘_’ not allowed\n in the foreign declaration for ‘c_sin’\n"} +{"text": "package org.carlspring.strongbox.services.impl;\n\nimport org.carlspring.strongbox.resource.ConfigurationResourceResolver;\nimport org.carlspring.strongbox.security.certificates.KeyStoreManager;\nimport org.carlspring.strongbox.services.TrustStoreService;\nimport org.carlspring.strongbox.services.support.TrustStoreCertificateOperationException;\n\nimport javax.annotation.PostConstruct;\nimport javax.inject.Inject;\nimport java.io.IOException;\nimport java.net.InetAddress;\nimport java.net.URL;\nimport java.nio.file.Paths;\nimport java.security.KeyManagementException;\nimport java.security.KeyStoreException;\nimport java.security.NoSuchAlgorithmException;\nimport java.security.cert.CertificateException;\n\nimport org.springframework.core.io.Resource;\nimport org.springframework.stereotype.Service;\n\n/**\n * @author Przemyslaw Fusik\n */\n@Service\npublic class TrustStoreServiceImpl\n implements TrustStoreService\n{\n\n private static final String PASSWORD = \"password\";\n\n private Resource trustStore;\n\n @Inject\n private KeyStoreManager keyStoreManager;\n\n @Inject\n private ConfigurationResourceResolver configurationResourceResolver;\n\n\n @PostConstruct\n public void init()\n throws IOException\n {\n trustStore = getTrustStoreResource();\n }\n\n @Override\n public void addSslCertificatesToTrustStore(String host)\n throws IOException, TrustStoreCertificateOperationException\n {\n final URL url = new URL(host);\n final String urlHost = url.getHost();\n final int urlPort = url.getPort() != -1 ? url.getPort() : url.getDefaultPort();\n\n try\n {\n keyStoreManager.addCertificates(Paths.get(trustStore.getURI()),\n PASSWORD.toCharArray(),\n InetAddress.getByName(urlHost),\n urlPort);\n }\n catch (IOException | CertificateException | NoSuchAlgorithmException | KeyStoreException | KeyManagementException ex)\n {\n throw new TrustStoreCertificateOperationException(ex);\n }\n }\n\n private Resource getTrustStoreResource()\n {\n return configurationResourceResolver.getConfigurationResource(\"strongbox.truststore.jks\",\n \"etc/ssl/truststore.jks\");\n }\n\n}\n"} +{"text": "\n\n\n\nInsert title here\n\n\n

    Freemarker基本操作

    \n\n

    1. 取基本值

    \n
      \n\t
    • 整数:${intVar}
    • \n\t
    • 长整数:${longVar}
    • \n\t
    • 字符串:${stringVar}
    • \n\t
    • 双精度:${doubleVar}
    • \n\t
    • 布尔值:${booleanVar?string('yes','no')}
    • \n\t
    • 日期:${dateVar?string('yyyy-MM-dd')}
    • \n\t
    • null:${nullVar!'我是默认值'}
    • \n\t
    • missing:${ssssVar!'我是默认值'}
    • \n
    \n\n

    2. 赋值运算

    \n
      \n\t
    • 赋值&运算
    • \n\t[#assign a = 100 /]\n\ta = ${a}\n\t
      \n\ta+100=${a+100}\n
    \n\n

    3. 封装类型

    \n
      \n\t
    • 对象
    • \n\t${(userObj.name)!\"默认值\"}\n\t
    • 富文本
    • \n\t${(briefVar)!?html}\n
    \n\n

    4. 遍历集合

    \n
      \n\t
    • List集合
    • \n\t[#list myList as item]\n\t${item!}
      \n\t[/#list]\n\t\n\t
    • Map集合
    • \n\t[#list map?keys as key]\n\t${key}:${map[key]!}
      \n\t[/#list]\n
    \n\n

    5. 逻辑处理

    \n
      \n\t
    • if
    • \n\t[#assign var = 99 /]\n\t\n\t[#if var == 99]\n\t${var!}
      \n\t[/#if]\n\t\n\t
    • if else
    • \n\t[#if var == 99]\n\t\tvar = 99
      \n\t[#else]\n\t\tvar != 99
      \n\t[/#if]\n\t\n\t
    • if elseif else
    • \n\t[#if var > 99]\n\t\tvar 大于 99
      \n\t[#elseif var == 99]\n\t\tvar 等于 99
      \n\t[#else]\n\t\tvar 小于 99
      \n\t[/#if]\n\t\n\t
    • if多条件 || && !
    • \n\t[#assign var2 = 'python' /]\n\t[#if var2 == 'python' || var2 == 'java']\n\tpython or java
      \n\t[/#if]\n\t\n\t
    • switch case break default
    • \n\t[#assign var3 = 10 /]\n\t[#switch var3]\n\t\t\n\t[#case 10] 10
      \n\t\t[#break]\n\t\n\t[#case 100] 100
      \n\t\t[#break]\n\t\n\t[#default] other\n\t\n\t[/#switch]\n\t\n
    \n\n

    6. 字符操作

    \n
      \n\t
    • 字符串常用内建函数-连接
    • \n\t[#assign stra = 'hello' /]\n\t[#assign strb = 'world' /]\n\t${stra + strb}
      \n\t\n\t
    • 字符串常用内建函数-截取
    • \n\t${(stra + strb)?substring(5,8)}
      \n\t\n\t
    • 字符串常用内建函数-长度
    • \n\t${(stra + strb)?length}
      \n\t\n\t
    • 字符串常用内建函数-大写
    • \n\t${(stra + strb)?upper_case}
      \n\t\n\t
    • 字符串常用内建函数-小写
    • \n\t${(stra + strb)?lower_case}
      \n\t\n\t
    • 字符串常用内建函数-index_of
    • \n\t${(stra + strb)?index_of('w')}
      \n\t\n\t
    • 字符串常用内建函数-last_index_of
    • \n\t${(stra + strb)?last_index_of('o')}
      \n\t\n\t
    • 字符串常用内建函数-replace
    • \n\t${(stra + strb)?replace('o','xx')}
      \n\t\n
    \n\n\n

    7. 自定义函数

    \n
      \n\t
    • 整数排序sort_int
    • \n\t[#assign mylistinfo = [2,3,4,5,1,8,9,8,7] /]\n\t
    • 未排序
    • \n\t[#list mylistinfo as item]\n\t\t${item},\n\t[/#list]\n\t\n\t[#assign mylistinfo = [2,3,4,5,1,8,9,8,7] /]\n\t
    • 已排序
    • \n\t[#list sort_int(mylistinfo) as item]\n\t\t${item},\n\t[/#list]\n\t\n\t[#assign mylistinfo = [2,3,4,5,1,8,9,8,7] /]\n\t
    • 内建排序-升序
    • \n\t[#list mylistinfo?sort as item]\n\t\t${item_index}:${item},\n\t[/#list]\n\t
    • 内建排序-降序
    • \n\t[#list mylistinfo?sort?reverse as item]\n\t\t${item_index}:${item},\n\t[/#list]\n\t
    • List长度
    • \n\t${mylistinfo?size}\n\t
    • List下标取值
    • \n\t${mylistinfo[3]}\n\t\n
    \n\n

    8. 自定义指令

    \n
      \n\t
    • 用户123456是否拥有admin角色,并且返回admin的权限
    • \n\t[@role user='123456' role='admin';result1,result2]\n\t\t[#if result1]\n\t\t\t我的角色是admin\n\t\t[/#if]\n\t\t我拥有的权限是:\n\t\t[#list result2 as item]\n\t\t\t${item},\n\t\t[/#list]\n\t\t\n\t[/@role]\n
    \n\n\n\n"} +{"text": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* rendering object for CSS display:inline objects */\n\n#include \"nsInlineFrame.h\"\n#include \"nsLineLayout.h\"\n#include \"nsBlockFrame.h\"\n#include \"nsPlaceholderFrame.h\"\n#include \"nsGkAtoms.h\"\n#include \"nsStyleContext.h\"\n#include \"nsPresContext.h\"\n#include \"nsRenderingContext.h\"\n#include \"nsCSSAnonBoxes.h\"\n#include \"mozilla/RestyleManagerHandle.h\"\n#include \"mozilla/RestyleManagerHandleInlines.h\"\n#include \"nsDisplayList.h\"\n#include \"mozilla/Likely.h\"\n#include \"SVGTextFrame.h\"\n#include \"mozilla/StyleSetHandle.h\"\n#include \"mozilla/StyleSetHandleInlines.h\"\n\n#ifdef DEBUG\n#undef NOISY_PUSHING\n#endif\n\nusing namespace mozilla;\nusing namespace mozilla::layout;\n\n\n//////////////////////////////////////////////////////////////////////\n\n// Basic nsInlineFrame methods\n\nnsInlineFrame*\nNS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)\n{\n return new (aPresShell) nsInlineFrame(aContext);\n}\n\nNS_IMPL_FRAMEARENA_HELPERS(nsInlineFrame)\n\nNS_QUERYFRAME_HEAD(nsInlineFrame)\n NS_QUERYFRAME_ENTRY(nsInlineFrame)\nNS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)\n\n#ifdef DEBUG_FRAME_DUMP\nnsresult\nnsInlineFrame::GetFrameName(nsAString& aResult) const\n{\n return MakeFrameName(NS_LITERAL_STRING(\"Inline\"), aResult);\n}\n#endif\n\nnsIAtom*\nnsInlineFrame::GetType() const\n{\n return nsGkAtoms::inlineFrame;\n}\n\nvoid\nnsInlineFrame::InvalidateFrame(uint32_t aDisplayItemKey)\n{\n if (IsSVGText()) {\n nsIFrame* svgTextFrame =\n nsLayoutUtils::GetClosestFrameOfType(GetParent(),\n nsGkAtoms::svgTextFrame);\n svgTextFrame->InvalidateFrame();\n return;\n }\n nsContainerFrame::InvalidateFrame(aDisplayItemKey);\n}\n\nvoid\nnsInlineFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey)\n{\n if (IsSVGText()) {\n nsIFrame* svgTextFrame =\n nsLayoutUtils::GetClosestFrameOfType(GetParent(),\n nsGkAtoms::svgTextFrame);\n svgTextFrame->InvalidateFrame();\n return;\n }\n nsContainerFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey);\n}\n\nstatic inline bool\nIsMarginZero(const nsStyleCoord &aCoord)\n{\n return aCoord.GetUnit() == eStyleUnit_Auto ||\n nsLayoutUtils::IsMarginZero(aCoord);\n}\n\n/* virtual */ bool\nnsInlineFrame::IsSelfEmpty()\n{\n#if 0\n // I used to think inline frames worked this way, but it seems they\n // don't. At least not in our codebase.\n if (GetPresContext()->CompatibilityMode() == eCompatibility_FullStandards) {\n return false;\n }\n#endif\n const nsStyleMargin* margin = StyleMargin();\n const nsStyleBorder* border = StyleBorder();\n const nsStylePadding* padding = StylePadding();\n // Block-start and -end ignored, since they shouldn't affect things, but this\n // doesn't really match with nsLineLayout.cpp's setting of\n // ZeroEffectiveSpanBox, anymore, so what should this really be?\n WritingMode wm = GetWritingMode();\n bool haveStart, haveEnd;\n // Initially set up haveStart and haveEnd in terms of visual (LTR/TTB)\n // coordinates; we'll exchange them later if bidi-RTL is in effect to\n // get logical start and end flags.\n if (wm.IsVertical()) {\n haveStart =\n border->GetComputedBorderWidth(NS_SIDE_TOP) != 0 ||\n !nsLayoutUtils::IsPaddingZero(padding->mPadding.GetTop()) ||\n !IsMarginZero(margin->mMargin.GetTop());\n haveEnd =\n border->GetComputedBorderWidth(NS_SIDE_BOTTOM) != 0 ||\n !nsLayoutUtils::IsPaddingZero(padding->mPadding.GetBottom()) ||\n !IsMarginZero(margin->mMargin.GetBottom());\n } else {\n haveStart =\n border->GetComputedBorderWidth(NS_SIDE_LEFT) != 0 ||\n !nsLayoutUtils::IsPaddingZero(padding->mPadding.GetLeft()) ||\n !IsMarginZero(margin->mMargin.GetLeft());\n haveEnd =\n border->GetComputedBorderWidth(NS_SIDE_RIGHT) != 0 ||\n !nsLayoutUtils::IsPaddingZero(padding->mPadding.GetRight()) ||\n !IsMarginZero(margin->mMargin.GetRight());\n }\n if (haveStart || haveEnd) {\n // We skip this block and return false for box-decoration-break:clone since\n // in that case all the continuations will have the border/padding/margin.\n if ((GetStateBits() & NS_FRAME_PART_OF_IBSPLIT) &&\n StyleBorder()->mBoxDecorationBreak == StyleBoxDecorationBreak::Slice) {\n // When direction=rtl, we need to consider logical rather than visual\n // start and end, so swap the flags.\n if (!wm.IsBidiLTR()) {\n Swap(haveStart, haveEnd);\n }\n // For ib-split frames, ignore things we know we'll skip in GetSkipSides.\n // XXXbz should we be doing this for non-ib-split frames too, in a more\n // general way?\n\n // Get the first continuation eagerly, as a performance optimization, to\n // avoid having to get it twice..\n nsIFrame* firstCont = FirstContinuation();\n return\n (!haveStart || firstCont->FrameIsNonFirstInIBSplit()) &&\n (!haveEnd || firstCont->FrameIsNonLastInIBSplit());\n }\n return false;\n }\n return true;\n}\n\nbool\nnsInlineFrame::IsEmpty()\n{\n if (!IsSelfEmpty()) {\n return false;\n }\n\n for (nsIFrame* kid : mFrames) {\n if (!kid->IsEmpty())\n return false;\n }\n\n return true;\n}\n\nnsIFrame::FrameSearchResult\nnsInlineFrame::PeekOffsetCharacter(bool aForward, int32_t* aOffset,\n bool aRespectClusters)\n{\n // Override the implementation in nsFrame, to skip empty inline frames\n NS_ASSERTION (aOffset && *aOffset <= 1, \"aOffset out of range\");\n int32_t startOffset = *aOffset;\n if (startOffset < 0)\n startOffset = 1;\n if (aForward == (startOffset == 0)) {\n // We're before the frame and moving forward, or after it and moving backwards:\n // skip to the other side, but keep going.\n *aOffset = 1 - startOffset;\n }\n return CONTINUE;\n}\n\nvoid\nnsInlineFrame::DestroyFrom(nsIFrame* aDestructRoot)\n{\n nsFrameList* overflowFrames = GetOverflowFrames();\n if (overflowFrames) {\n // Fixup the parent pointers for any child frames on the OverflowList.\n // nsIFrame::DestroyFrom depends on that to find the sticky scroll\n // container (an ancestor).\n overflowFrames->ApplySetParent(this);\n }\n nsContainerFrame::DestroyFrom(aDestructRoot);\n}\n\nnsresult\nnsInlineFrame::StealFrame(nsIFrame* aChild)\n{\n if (MaybeStealOverflowContainerFrame(aChild)) {\n return NS_OK;\n }\n\n nsInlineFrame* parent = this;\n bool removed = false;\n do {\n removed = parent->mFrames.StartRemoveFrame(aChild);\n if (removed) {\n break;\n }\n\n // We didn't find the child in our principal child list.\n // Maybe it's on the overflow list?\n nsFrameList* frameList = parent->GetOverflowFrames();\n if (frameList) {\n removed = frameList->ContinueRemoveFrame(aChild);\n if (frameList->IsEmpty()) {\n parent->DestroyOverflowList();\n }\n if (removed) {\n break;\n }\n }\n\n // Due to our \"lazy reparenting\" optimization 'aChild' might not actually\n // be on any of our child lists, but instead in one of our next-in-flows.\n parent = static_cast(parent->GetNextInFlow());\n } while (parent);\n\n MOZ_ASSERT(removed, \"nsInlineFrame::StealFrame: can't find aChild\");\n return removed ? NS_OK : NS_ERROR_UNEXPECTED;\n}\n\nvoid\nnsInlineFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,\n const nsDisplayListSet& aLists)\n{\n BuildDisplayListForInline(aBuilder, aLists);\n\n // The sole purpose of this is to trigger display of the selection\n // window for Named Anchors, which don't have any children and\n // normally don't have any size, but in Editor we use CSS to display\n // an image to represent this \"hidden\" element.\n if (!mFrames.FirstChild()) {\n DisplaySelectionOverlay(aBuilder, aLists.Content());\n }\n}\n\n//////////////////////////////////////////////////////////////////////\n// Reflow methods\n\n/* virtual */ void\nnsInlineFrame::AddInlineMinISize(nsRenderingContext *aRenderingContext,\n nsIFrame::InlineMinISizeData *aData)\n{\n DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::MIN_ISIZE);\n}\n\n/* virtual */ void\nnsInlineFrame::AddInlinePrefISize(nsRenderingContext *aRenderingContext,\n nsIFrame::InlinePrefISizeData *aData)\n{\n DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::PREF_ISIZE);\n}\n\n/* virtual */\nLogicalSize\nnsInlineFrame::ComputeSize(nsRenderingContext *aRenderingContext,\n WritingMode aWM,\n const LogicalSize& aCBSize,\n nscoord aAvailableISize,\n const LogicalSize& aMargin,\n const LogicalSize& aBorder,\n const LogicalSize& aPadding,\n ComputeSizeFlags aFlags)\n{\n // Inlines and text don't compute size before reflow.\n return LogicalSize(aWM, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);\n}\n\nnsRect\nnsInlineFrame::ComputeTightBounds(DrawTarget* aDrawTarget) const\n{\n // be conservative\n if (StyleContext()->HasTextDecorationLines()) {\n return GetVisualOverflowRect();\n }\n return ComputeSimpleTightBounds(aDrawTarget);\n}\n\nvoid\nnsInlineFrame::ReparentFloatsForInlineChild(nsIFrame* aOurLineContainer,\n nsIFrame* aFrame,\n bool aReparentSiblings)\n{\n // XXXbz this would be better if it took a nsFrameList or a frame\n // list slice....\n NS_ASSERTION(aOurLineContainer->GetNextContinuation() ||\n aOurLineContainer->GetPrevContinuation(),\n \"Don't call this when we have no continuation, it's a waste\");\n if (!aFrame) {\n NS_ASSERTION(aReparentSiblings, \"Why did we get called?\");\n return;\n }\n\n nsBlockFrame* frameBlock = nsLayoutUtils::GetFloatContainingBlock(aFrame);\n if (!frameBlock || frameBlock == aOurLineContainer) {\n return;\n }\n\n nsBlockFrame* ourBlock = nsLayoutUtils::GetAsBlock(aOurLineContainer);\n NS_ASSERTION(ourBlock, \"Not a block, but broke vertically?\");\n\n while (true) {\n ourBlock->ReparentFloats(aFrame, frameBlock, false);\n\n if (!aReparentSiblings)\n return;\n nsIFrame* next = aFrame->GetNextSibling();\n if (!next)\n return;\n if (next->GetParent() == aFrame->GetParent()) {\n aFrame = next;\n continue;\n }\n // This is paranoid and will hardly ever get hit ... but we can't actually\n // trust that the frames in the sibling chain all have the same parent,\n // because lazy reparenting may be going on. If we find a different\n // parent we need to redo our analysis.\n ReparentFloatsForInlineChild(aOurLineContainer, next, aReparentSiblings);\n return;\n }\n}\n\nstatic void\nReparentChildListStyle(nsPresContext* aPresContext,\n const nsFrameList::Slice& aFrames,\n nsIFrame* aParentFrame)\n{\n RestyleManagerHandle restyleManager = aPresContext->RestyleManager();\n\n for (nsFrameList::Enumerator e(aFrames); !e.AtEnd(); e.Next()) {\n NS_ASSERTION(e.get()->GetParent() == aParentFrame, \"Bogus parentage\");\n restyleManager->ReparentStyleContext(e.get());\n nsLayoutUtils::MarkDescendantsDirty(e.get());\n }\n}\n\nvoid\nnsInlineFrame::Reflow(nsPresContext* aPresContext,\n ReflowOutput& aMetrics,\n const ReflowInput& aReflowInput,\n nsReflowStatus& aStatus)\n{\n MarkInReflow();\n DO_GLOBAL_REFLOW_COUNT(\"nsInlineFrame\");\n DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);\n if (nullptr == aReflowInput.mLineLayout) {\n NS_ERROR(\"must have non-null aReflowInput.mLineLayout\");\n return;\n }\n if (IsFrameTreeTooDeep(aReflowInput, aMetrics, aStatus)) {\n return;\n }\n\n bool lazilySetParentPointer = false;\n\n // Check for an overflow list with our prev-in-flow\n nsInlineFrame* prevInFlow = (nsInlineFrame*)GetPrevInFlow();\n if (prevInFlow) {\n AutoFrameListPtr prevOverflowFrames(aPresContext,\n prevInFlow->StealOverflowFrames());\n if (prevOverflowFrames) {\n // When pushing and pulling frames we need to check for whether any\n // views need to be reparented.\n nsContainerFrame::ReparentFrameViewList(*prevOverflowFrames, prevInFlow,\n this);\n\n // Check if we should do the lazilySetParentPointer optimization.\n // Only do it in simple cases where we're being reflowed for the\n // first time, nothing (e.g. bidi resolution) has already given\n // us children, and there's no next-in-flow, so all our frames\n // will be taken from prevOverflowFrames.\n if ((GetStateBits() & NS_FRAME_FIRST_REFLOW) && mFrames.IsEmpty() &&\n !GetNextInFlow()) {\n // If our child list is empty, just put the new frames into it.\n // Note that we don't set the parent pointer for the new frames. Instead wait\n // to do this until we actually reflow the frame. If the overflow list contains\n // thousands of frames this is a big performance issue (see bug #5588)\n mFrames.SetFrames(*prevOverflowFrames);\n lazilySetParentPointer = true;\n } else {\n // Insert the new frames at the beginning of the child list\n // and set their parent pointer\n const nsFrameList::Slice& newFrames =\n mFrames.InsertFrames(this, nullptr, *prevOverflowFrames);\n // If our prev in flow was under the first continuation of a first-line\n // frame then we need to reparent the style contexts to remove the\n // the special first-line styling. In the lazilySetParentPointer case\n // we reparent the style contexts when we set their parents in\n // nsInlineFrame::ReflowFrames and nsInlineFrame::ReflowInlineFrame.\n if (aReflowInput.mLineLayout->GetInFirstLine()) {\n ReparentChildListStyle(aPresContext, newFrames, this);\n }\n }\n }\n }\n\n // It's also possible that we have an overflow list for ourselves\n#ifdef DEBUG\n if (GetStateBits() & NS_FRAME_FIRST_REFLOW) {\n // If it's our initial reflow, then we should not have an overflow list.\n // However, add an assertion in case we get reflowed more than once with\n // the initial reflow reason\n nsFrameList* overflowFrames = GetOverflowFrames();\n NS_ASSERTION(!overflowFrames || overflowFrames->IsEmpty(),\n \"overflow list is not empty for initial reflow\");\n }\n#endif\n if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {\n DrainFlags flags =\n lazilySetParentPointer ? eDontReparentFrames : DrainFlags(0);\n if (aReflowInput.mLineLayout->GetInFirstLine()) {\n flags = DrainFlags(flags | eInFirstLine);\n }\n DrainSelfOverflowListInternal(flags);\n }\n\n // Set our own reflow state (additional state above and beyond aReflowInput)\n InlineReflowInput irs;\n irs.mPrevFrame = nullptr;\n irs.mLineContainer = aReflowInput.mLineLayout->LineContainerFrame();\n irs.mLineLayout = aReflowInput.mLineLayout;\n irs.mNextInFlow = (nsInlineFrame*) GetNextInFlow();\n irs.mSetParentPointer = lazilySetParentPointer;\n\n if (mFrames.IsEmpty()) {\n // Try to pull over one frame before starting so that we know\n // whether we have an anonymous block or not.\n bool complete;\n (void) PullOneFrame(aPresContext, irs, &complete);\n }\n\n ReflowFrames(aPresContext, aReflowInput, irs, aMetrics, aStatus);\n\n ReflowAbsoluteFrames(aPresContext, aMetrics, aReflowInput, aStatus);\n\n // Note: the line layout code will properly compute our\n // overflow-rect state for us.\n\n NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);\n}\n\nnsresult \nnsInlineFrame::AttributeChanged(int32_t aNameSpaceID,\n nsIAtom* aAttribute,\n int32_t aModType)\n{\n nsresult rv =\n nsContainerFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);\n\n if (NS_FAILED(rv)) {\n return rv;\n }\n\n if (IsSVGText()) {\n SVGTextFrame* f = static_cast(\n nsLayoutUtils::GetClosestFrameOfType(this, nsGkAtoms::svgTextFrame));\n f->HandleAttributeChangeInDescendant(mContent->AsElement(),\n aNameSpaceID, aAttribute);\n }\n\n return NS_OK;\n}\n\nbool\nnsInlineFrame::DrainSelfOverflowListInternal(DrainFlags aFlags)\n{\n AutoFrameListPtr overflowFrames(PresContext(), StealOverflowFrames());\n if (overflowFrames) {\n // The frames on our own overflowlist may have been pushed by a\n // previous lazilySetParentPointer Reflow so we need to ensure the\n // correct parent pointer. This is sometimes skipped by Reflow.\n if (!(aFlags & eDontReparentFrames)) {\n nsIFrame* firstChild = overflowFrames->FirstChild();\n const bool doReparentSC = (aFlags & eInFirstLine);\n RestyleManagerHandle restyleManager = PresContext()->RestyleManager();\n for (nsIFrame* f = firstChild; f; f = f->GetNextSibling()) {\n f->SetParent(this);\n if (doReparentSC) {\n restyleManager->ReparentStyleContext(f);\n nsLayoutUtils::MarkDescendantsDirty(f);\n }\n }\n }\n bool result = !overflowFrames->IsEmpty();\n mFrames.AppendFrames(nullptr, *overflowFrames);\n return result;\n }\n return false;\n}\n\n/* virtual */ bool\nnsInlineFrame::DrainSelfOverflowList()\n{\n nsIFrame* lineContainer = nsLayoutUtils::FindNearestBlockAncestor(this);\n // Add the eInFirstLine flag if we have a ::first-line ancestor frame.\n // No need to look further than the nearest line container though.\n DrainFlags flags = DrainFlags(0);\n for (nsIFrame* p = GetParent(); p != lineContainer; p = p->GetParent()) {\n if (p->GetType() == nsGkAtoms::lineFrame) {\n flags = DrainFlags(flags | eInFirstLine);\n break;\n }\n }\n return DrainSelfOverflowListInternal(flags);\n}\n\n/* virtual */ bool\nnsInlineFrame::CanContinueTextRun() const\n{\n // We can continue a text run through an inline frame\n return true;\n}\n\n/* virtual */ void\nnsInlineFrame::PullOverflowsFromPrevInFlow()\n{\n nsInlineFrame* prevInFlow = static_cast(GetPrevInFlow());\n if (prevInFlow) {\n nsPresContext* presContext = PresContext();\n AutoFrameListPtr prevOverflowFrames(presContext,\n prevInFlow->StealOverflowFrames());\n if (prevOverflowFrames) {\n // Assume that our prev-in-flow has the same line container that we do.\n nsContainerFrame::ReparentFrameViewList(*prevOverflowFrames, prevInFlow,\n this);\n mFrames.InsertFrames(this, nullptr, *prevOverflowFrames);\n }\n }\n}\n\nvoid\nnsInlineFrame::ReflowFrames(nsPresContext* aPresContext,\n const ReflowInput& aReflowInput,\n InlineReflowInput& irs,\n ReflowOutput& aMetrics,\n nsReflowStatus& aStatus)\n{\n aStatus = NS_FRAME_COMPLETE;\n\n nsLineLayout* lineLayout = aReflowInput.mLineLayout;\n bool inFirstLine = aReflowInput.mLineLayout->GetInFirstLine();\n RestyleManagerHandle restyleManager = aPresContext->RestyleManager();\n WritingMode frameWM = aReflowInput.GetWritingMode();\n WritingMode lineWM = aReflowInput.mLineLayout->mRootSpan->mWritingMode;\n LogicalMargin framePadding = aReflowInput.ComputedLogicalBorderPadding();\n nscoord startEdge = 0;\n const bool boxDecorationBreakClone =\n MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==\n StyleBoxDecorationBreak::Clone);\n // Don't offset by our start borderpadding if we have a prev continuation or\n // if we're in a part of an {ib} split other than the first one. For\n // box-decoration-break:clone we always offset our start since all\n // continuations have border/padding.\n if ((!GetPrevContinuation() && !FrameIsNonFirstInIBSplit()) ||\n boxDecorationBreakClone) {\n startEdge = framePadding.IStart(frameWM);\n }\n nscoord availableISize = aReflowInput.AvailableISize();\n NS_ASSERTION(availableISize != NS_UNCONSTRAINEDSIZE,\n \"should no longer use available widths\");\n // Subtract off inline axis border+padding from availableISize\n availableISize -= startEdge;\n availableISize -= framePadding.IEnd(frameWM);\n lineLayout->BeginSpan(this, &aReflowInput, startEdge,\n startEdge + availableISize, &mBaseline);\n\n // First reflow our principal children.\n nsIFrame* frame = mFrames.FirstChild();\n bool done = false;\n while (frame) {\n // Check if we should lazily set the child frame's parent pointer.\n if (irs.mSetParentPointer) {\n nsIFrame* child = frame;\n do {\n child->SetParent(this);\n if (inFirstLine) {\n restyleManager->ReparentStyleContext(child);\n nsLayoutUtils::MarkDescendantsDirty(child);\n }\n // We also need to do the same for |frame|'s next-in-flows that are in\n // the sibling list. Otherwise, if we reflow |frame| and it's complete\n // we'll crash when trying to delete its next-in-flow.\n // This scenario doesn't happen often, but it can happen.\n nsIFrame* nextSibling = child->GetNextSibling();\n child = child->GetNextInFlow();\n if (MOZ_UNLIKELY(child)) {\n while (child != nextSibling && nextSibling) {\n nextSibling = nextSibling->GetNextSibling();\n }\n if (!nextSibling) {\n child = nullptr;\n }\n }\n MOZ_ASSERT(!child || mFrames.ContainsFrame(child));\n } while (child);\n\n // Fix the parent pointer for ::first-letter child frame next-in-flows,\n // so nsFirstLetterFrame::Reflow can destroy them safely (bug 401042).\n nsIFrame* realFrame = nsPlaceholderFrame::GetRealFrameFor(frame);\n if (realFrame->GetType() == nsGkAtoms::letterFrame) {\n nsIFrame* child = realFrame->PrincipalChildList().FirstChild();\n if (child) {\n NS_ASSERTION(child->GetType() == nsGkAtoms::textFrame,\n \"unexpected frame type\");\n nsIFrame* nextInFlow = child->GetNextInFlow();\n for ( ; nextInFlow; nextInFlow = nextInFlow->GetNextInFlow()) {\n NS_ASSERTION(nextInFlow->GetType() == nsGkAtoms::textFrame,\n \"unexpected frame type\");\n if (mFrames.ContainsFrame(nextInFlow)) {\n nextInFlow->SetParent(this);\n if (inFirstLine) {\n restyleManager->ReparentStyleContext(nextInFlow);\n nsLayoutUtils::MarkDescendantsDirty(nextInFlow);\n }\n }\n else {\n#ifdef DEBUG \n // Once we find a next-in-flow that isn't ours none of the\n // remaining next-in-flows should be either.\n for ( ; nextInFlow; nextInFlow = nextInFlow->GetNextInFlow()) {\n NS_ASSERTION(!mFrames.ContainsFrame(nextInFlow),\n \"unexpected letter frame flow\");\n }\n#endif\n break;\n }\n }\n }\n }\n }\n MOZ_ASSERT(frame->GetParent() == this);\n\n if (!done) {\n bool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK();\n ReflowInlineFrame(aPresContext, aReflowInput, irs, frame, aStatus);\n done = NS_INLINE_IS_BREAK(aStatus) || \n (!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus));\n if (done) {\n if (!irs.mSetParentPointer) {\n break;\n }\n // Keep reparenting the remaining siblings, but don't reflow them.\n nsFrameList* pushedFrames = GetOverflowFrames();\n if (pushedFrames && pushedFrames->FirstChild() == frame) {\n // Don't bother if |frame| was pushed to our overflow list.\n break;\n }\n } else {\n irs.mPrevFrame = frame;\n }\n }\n frame = frame->GetNextSibling();\n }\n\n // Attempt to pull frames from our next-in-flow until we can't\n if (!done && GetNextInFlow()) {\n while (true) {\n bool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK();\n bool isComplete;\n if (!frame) { // Could be non-null if we pulled a first-letter frame and\n // it created a continuation, since we don't push those.\n frame = PullOneFrame(aPresContext, irs, &isComplete);\n }\n#ifdef NOISY_PUSHING\n printf(\"%p pulled up %p\\n\", this, frame);\n#endif\n if (nullptr == frame) {\n if (!isComplete) {\n aStatus = NS_FRAME_NOT_COMPLETE;\n }\n break;\n }\n ReflowInlineFrame(aPresContext, aReflowInput, irs, frame, aStatus);\n if (NS_INLINE_IS_BREAK(aStatus) || \n (!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus))) {\n break;\n }\n irs.mPrevFrame = frame;\n frame = frame->GetNextSibling();\n }\n }\n\n NS_ASSERTION(!NS_FRAME_IS_COMPLETE(aStatus) || !GetOverflowFrames(),\n \"We can't be complete AND have overflow frames!\");\n\n // If after reflowing our children they take up no area then make\n // sure that we don't either.\n //\n // Note: CSS demands that empty inline elements still affect the\n // line-height calculations. However, continuations of an inline\n // that are empty we force to empty so that things like collapsed\n // whitespace in an inline element don't affect the line-height.\n aMetrics.ISize(lineWM) = lineLayout->EndSpan(this);\n\n // Compute final width.\n\n // XXX Note that that the padding start and end are in the frame's\n // writing mode, but the metrics' inline-size is in the line's\n // writing mode. This makes sense if the line and frame are both\n // vertical or both horizontal, but what should happen with\n // orthogonal inlines?\n\n // Make sure to not include our start border and padding if we have a prev\n // continuation or if we're in a part of an {ib} split other than the first\n // one. For box-decoration-break:clone we always include our start border\n // and padding since all continuations have them.\n if ((!GetPrevContinuation() && !FrameIsNonFirstInIBSplit()) ||\n boxDecorationBreakClone) {\n aMetrics.ISize(lineWM) += framePadding.IStart(frameWM);\n }\n\n /*\n * We want to only apply the end border and padding if we're the last\n * continuation and either not in an {ib} split or the last part of it. To\n * be the last continuation we have to be complete (so that we won't get a\n * next-in-flow) and have no non-fluid continuations on our continuation\n * chain. For box-decoration-break:clone we always apply the end border and\n * padding since all continuations have them.\n */\n if ((NS_FRAME_IS_COMPLETE(aStatus) &&\n !LastInFlow()->GetNextContinuation() &&\n !FrameIsNonLastInIBSplit()) ||\n boxDecorationBreakClone) {\n aMetrics.ISize(lineWM) += framePadding.IEnd(frameWM);\n }\n\n nsLayoutUtils::SetBSizeFromFontMetrics(this, aMetrics,\n framePadding, lineWM, frameWM);\n\n // For now our overflow area is zero. The real value will be\n // computed in |nsLineLayout::RelativePositionFrames|.\n aMetrics.mOverflowAreas.Clear();\n\n#ifdef NOISY_FINAL_SIZE\n ListTag(stdout);\n printf(\": metrics=%d,%d ascent=%d\\n\",\n aMetrics.Width(), aMetrics.Height(), aMetrics.TopAscent());\n#endif\n}\n\nvoid\nnsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,\n const ReflowInput& aReflowInput,\n InlineReflowInput& irs,\n nsIFrame* aFrame,\n nsReflowStatus& aStatus)\n{\n nsLineLayout* lineLayout = aReflowInput.mLineLayout;\n bool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK();\n bool pushedFrame;\n lineLayout->ReflowFrame(aFrame, aStatus, nullptr, pushedFrame);\n \n if (NS_INLINE_IS_BREAK_BEFORE(aStatus)) {\n if (aFrame != mFrames.FirstChild()) {\n // Change break-before status into break-after since we have\n // already placed at least one child frame. This preserves the\n // break-type so that it can be propagated upward.\n aStatus = NS_FRAME_NOT_COMPLETE |\n NS_INLINE_BREAK | NS_INLINE_BREAK_AFTER |\n (aStatus & NS_INLINE_BREAK_TYPE_MASK);\n PushFrames(aPresContext, aFrame, irs.mPrevFrame, irs);\n }\n else {\n // Preserve reflow status when breaking-before our first child\n // and propagate it upward without modification.\n }\n return;\n }\n\n // Create a next-in-flow if needed.\n if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {\n CreateNextInFlow(aFrame);\n }\n\n if (NS_INLINE_IS_BREAK_AFTER(aStatus)) {\n nsIFrame* nextFrame = aFrame->GetNextSibling();\n if (nextFrame) {\n NS_FRAME_SET_INCOMPLETE(aStatus);\n PushFrames(aPresContext, nextFrame, aFrame, irs);\n }\n else {\n // We must return an incomplete status if there are more child\n // frames remaining in a next-in-flow that follows this frame.\n nsInlineFrame* nextInFlow = static_cast(GetNextInFlow());\n while (nextInFlow) {\n if (nextInFlow->mFrames.NotEmpty()) {\n NS_FRAME_SET_INCOMPLETE(aStatus);\n break;\n }\n nextInFlow = static_cast(nextInFlow->GetNextInFlow());\n }\n }\n return;\n }\n\n if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus) && !reflowingFirstLetter) {\n nsIFrame* nextFrame = aFrame->GetNextSibling();\n if (nextFrame) {\n PushFrames(aPresContext, nextFrame, aFrame, irs);\n }\n }\n}\n\nnsIFrame*\nnsInlineFrame::PullOneFrame(nsPresContext* aPresContext,\n InlineReflowInput& irs,\n bool* aIsComplete)\n{\n bool isComplete = true;\n\n nsIFrame* frame = nullptr;\n nsInlineFrame* nextInFlow = irs.mNextInFlow;\n while (nextInFlow) {\n frame = nextInFlow->mFrames.FirstChild();\n if (!frame) {\n // The nextInFlow's principal list has no frames, try its overflow list.\n nsFrameList* overflowFrames = nextInFlow->GetOverflowFrames();\n if (overflowFrames) {\n frame = overflowFrames->RemoveFirstChild();\n if (overflowFrames->IsEmpty()) {\n // We're stealing the only frame - delete the overflow list.\n nextInFlow->DestroyOverflowList();\n } else {\n // We leave the remaining frames on the overflow list (rather than\n // putting them on nextInFlow's principal list) so we don't have to\n // set up the parent for them.\n }\n // ReparentFloatsForInlineChild needs it to be on a child list -\n // we remove it again below.\n nextInFlow->mFrames.SetFrames(frame);\n }\n }\n\n if (frame) {\n // If our block has no next continuation, then any floats belonging to\n // the pulled frame must belong to our block already. This check ensures\n // we do no extra work in the common non-vertical-breaking case.\n if (irs.mLineContainer && irs.mLineContainer->GetNextContinuation()) {\n // The blockChildren.ContainsFrame check performed by\n // ReparentFloatsForInlineChild will be fast because frame's ancestor\n // will be the first child of its containing block.\n ReparentFloatsForInlineChild(irs.mLineContainer, frame, false);\n }\n nextInFlow->mFrames.RemoveFirstChild();\n // nsFirstLineFrame::PullOneFrame calls ReparentStyleContext.\n\n mFrames.InsertFrame(this, irs.mPrevFrame, frame);\n isComplete = false;\n if (irs.mLineLayout) {\n irs.mLineLayout->SetDirtyNextLine();\n }\n nsContainerFrame::ReparentFrameView(frame, nextInFlow, this);\n break;\n }\n nextInFlow = static_cast(nextInFlow->GetNextInFlow());\n irs.mNextInFlow = nextInFlow;\n }\n\n *aIsComplete = isComplete;\n return frame;\n}\n\nvoid\nnsInlineFrame::PushFrames(nsPresContext* aPresContext,\n nsIFrame* aFromChild,\n nsIFrame* aPrevSibling,\n InlineReflowInput& aState)\n{\n NS_PRECONDITION(aFromChild, \"null pointer\");\n NS_PRECONDITION(aPrevSibling, \"pushing first child\");\n NS_PRECONDITION(aPrevSibling->GetNextSibling() == aFromChild, \"bad prev sibling\");\n\n#ifdef NOISY_PUSHING\n printf(\"%p pushing aFromChild %p, disconnecting from prev sib %p\\n\", \n this, aFromChild, aPrevSibling);\n#endif\n\n // Add the frames to our overflow list (let our next in flow drain\n // our overflow list when it is ready)\n SetOverflowFrames(mFrames.RemoveFramesAfter(aPrevSibling));\n if (aState.mLineLayout) {\n aState.mLineLayout->SetDirtyNextLine();\n }\n}\n\n\n//////////////////////////////////////////////////////////////////////\n\nnsIFrame::LogicalSides\nnsInlineFrame::GetLogicalSkipSides(const ReflowInput* aReflowInput) const\n{\n if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==\n StyleBoxDecorationBreak::Clone)) {\n return LogicalSides();\n }\n\n LogicalSides skip;\n if (!IsFirst()) {\n nsInlineFrame* prev = (nsInlineFrame*) GetPrevContinuation();\n if ((GetStateBits() & NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET) ||\n (prev && (prev->mRect.height || prev->mRect.width))) {\n // Prev continuation is not empty therefore we don't render our start\n // border edge.\n skip |= eLogicalSideBitsIStart;\n }\n else {\n // If the prev continuation is empty, then go ahead and let our start\n // edge border render.\n }\n }\n if (!IsLast()) {\n nsInlineFrame* next = (nsInlineFrame*) GetNextContinuation();\n if ((GetStateBits() & NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET) ||\n (next && (next->mRect.height || next->mRect.width))) {\n // Next continuation is not empty therefore we don't render our end\n // border edge.\n skip |= eLogicalSideBitsIEnd;\n }\n else {\n // If the next continuation is empty, then go ahead and let our end\n // edge border render.\n }\n }\n\n if (GetStateBits() & NS_FRAME_PART_OF_IBSPLIT) {\n // All but the last part of an {ib} split should skip the \"end\" side (as\n // determined by this frame's direction) and all but the first part of such\n // a split should skip the \"start\" side. But figuring out which part of\n // the split we are involves getting our first continuation, which might be\n // expensive. So don't bother if we already have the relevant bits set.\n if (skip != LogicalSides(eLogicalSideBitsIBoth)) {\n // We're missing one of the skip bits, so check whether we need to set it.\n // Only get the first continuation once, as an optimization.\n nsIFrame* firstContinuation = FirstContinuation();\n if (firstContinuation->FrameIsNonLastInIBSplit()) {\n skip |= eLogicalSideBitsIEnd;\n }\n if (firstContinuation->FrameIsNonFirstInIBSplit()) {\n skip |= eLogicalSideBitsIStart;\n }\n }\n }\n\n return skip;\n}\n\nnscoord\nnsInlineFrame::GetLogicalBaseline(mozilla::WritingMode aWritingMode) const\n{\n return mBaseline;\n}\n\n#ifdef ACCESSIBILITY\na11y::AccType\nnsInlineFrame::AccessibleType()\n{\n // Broken image accessibles are created here, because layout\n // replaces the image or image control frame with an inline frame\n if (mContent->IsHTMLElement(nsGkAtoms::input)) // Broken \n return a11y::eHTMLButtonType;\n if (mContent->IsHTMLElement(nsGkAtoms::img)) // Create accessible for broken \n return a11y::eHyperTextType;\n\n return a11y::eNoType;\n}\n#endif\n\n//////////////////////////////////////////////////////////////////////\n\n// nsLineFrame implementation\n\nnsFirstLineFrame*\nNS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)\n{\n return new (aPresShell) nsFirstLineFrame(aContext);\n}\n\nNS_IMPL_FRAMEARENA_HELPERS(nsFirstLineFrame)\n\nvoid\nnsFirstLineFrame::Init(nsIContent* aContent,\n nsContainerFrame* aParent,\n nsIFrame* aPrevInFlow)\n{\n nsInlineFrame::Init(aContent, aParent, aPrevInFlow);\n if (!aPrevInFlow) {\n MOZ_ASSERT(StyleContext()->GetPseudo() == nsCSSPseudoElements::firstLine);\n return;\n }\n\n // This frame is a continuation - fixup the style context if aPrevInFlow\n // is the first-in-flow (the only one with a ::first-line pseudo).\n if (aPrevInFlow->StyleContext()->GetPseudo() == nsCSSPseudoElements::firstLine) {\n MOZ_ASSERT(FirstInFlow() == aPrevInFlow);\n // Create a new style context that is a child of the parent\n // style context thus removing the ::first-line style. This way\n // we behave as if an anonymous (unstyled) span was the child\n // of the parent frame.\n nsStyleContext* parentContext = aParent->StyleContext();\n RefPtr newSC = PresContext()->StyleSet()->\n ResolveAnonymousBoxStyle(nsCSSAnonBoxes::mozLineFrame, parentContext);\n SetStyleContext(newSC);\n } else {\n MOZ_ASSERT(FirstInFlow() != aPrevInFlow);\n MOZ_ASSERT(aPrevInFlow->StyleContext()->GetPseudo() ==\n nsCSSAnonBoxes::mozLineFrame);\n }\n}\n\n#ifdef DEBUG_FRAME_DUMP\nnsresult\nnsFirstLineFrame::GetFrameName(nsAString& aResult) const\n{\n return MakeFrameName(NS_LITERAL_STRING(\"Line\"), aResult);\n}\n#endif\n\nnsIAtom*\nnsFirstLineFrame::GetType() const\n{\n return nsGkAtoms::lineFrame;\n}\n\nnsIFrame*\nnsFirstLineFrame::PullOneFrame(nsPresContext* aPresContext, InlineReflowInput& irs,\n bool* aIsComplete)\n{\n nsIFrame* frame = nsInlineFrame::PullOneFrame(aPresContext, irs, aIsComplete);\n if (frame && !GetPrevInFlow()) {\n // We are a first-line frame. Fixup the child frames\n // style-context that we just pulled.\n NS_ASSERTION(frame->GetParent() == this, \"Incorrect parent?\");\n aPresContext->RestyleManager()->ReparentStyleContext(frame);\n nsLayoutUtils::MarkDescendantsDirty(frame);\n }\n return frame;\n}\n\nvoid\nnsFirstLineFrame::Reflow(nsPresContext* aPresContext,\n ReflowOutput& aMetrics,\n const ReflowInput& aReflowInput,\n nsReflowStatus& aStatus)\n{\n MarkInReflow();\n if (nullptr == aReflowInput.mLineLayout) {\n return; // XXX does this happen? why?\n }\n\n // Check for an overflow list with our prev-in-flow\n nsFirstLineFrame* prevInFlow = (nsFirstLineFrame*)GetPrevInFlow();\n if (prevInFlow) {\n AutoFrameListPtr prevOverflowFrames(aPresContext,\n prevInFlow->StealOverflowFrames());\n if (prevOverflowFrames) {\n // Reparent the new frames and their style contexts.\n const nsFrameList::Slice& newFrames =\n mFrames.InsertFrames(this, nullptr, *prevOverflowFrames);\n ReparentChildListStyle(aPresContext, newFrames, this);\n }\n }\n\n // It's also possible that we have an overflow list for ourselves.\n DrainSelfOverflowList();\n\n // Set our own reflow state (additional state above and beyond\n // aReflowInput)\n InlineReflowInput irs;\n irs.mPrevFrame = nullptr;\n irs.mLineContainer = aReflowInput.mLineLayout->LineContainerFrame();\n irs.mLineLayout = aReflowInput.mLineLayout;\n irs.mNextInFlow = (nsInlineFrame*) GetNextInFlow();\n\n bool wasEmpty = mFrames.IsEmpty();\n if (wasEmpty) {\n // Try to pull over one frame before starting so that we know\n // whether we have an anonymous block or not.\n bool complete;\n PullOneFrame(aPresContext, irs, &complete);\n }\n\n if (nullptr == GetPrevInFlow()) {\n // XXX This is pretty sick, but what we do here is to pull-up, in\n // advance, all of the next-in-flows children. We re-resolve their\n // style while we are at at it so that when we reflow they have\n // the right style.\n //\n // All of this is so that text-runs reflow properly.\n irs.mPrevFrame = mFrames.LastChild();\n for (;;) {\n bool complete;\n nsIFrame* frame = PullOneFrame(aPresContext, irs, &complete);\n if (!frame) {\n break;\n }\n irs.mPrevFrame = frame;\n }\n irs.mPrevFrame = nullptr;\n }\n\n NS_ASSERTION(!aReflowInput.mLineLayout->GetInFirstLine(),\n \"Nested first-line frames? BOGUS\");\n aReflowInput.mLineLayout->SetInFirstLine(true);\n ReflowFrames(aPresContext, aReflowInput, irs, aMetrics, aStatus);\n aReflowInput.mLineLayout->SetInFirstLine(false);\n\n ReflowAbsoluteFrames(aPresContext, aMetrics, aReflowInput, aStatus);\n\n // Note: the line layout code will properly compute our overflow state for us\n}\n\n/* virtual */ void\nnsFirstLineFrame::PullOverflowsFromPrevInFlow()\n{\n nsFirstLineFrame* prevInFlow = static_cast(GetPrevInFlow());\n if (prevInFlow) {\n nsPresContext* presContext = PresContext();\n AutoFrameListPtr prevOverflowFrames(presContext,\n prevInFlow->StealOverflowFrames());\n if (prevOverflowFrames) {\n // Assume that our prev-in-flow has the same line container that we do.\n const nsFrameList::Slice& newFrames =\n mFrames.InsertFrames(this, nullptr, *prevOverflowFrames);\n ReparentChildListStyle(presContext, newFrames, this);\n }\n }\n}\n\n/* virtual */ bool\nnsFirstLineFrame::DrainSelfOverflowList()\n{\n AutoFrameListPtr overflowFrames(PresContext(), StealOverflowFrames());\n if (overflowFrames) {\n bool result = !overflowFrames->IsEmpty();\n const nsFrameList::Slice& newFrames =\n mFrames.AppendFrames(nullptr, *overflowFrames);\n ReparentChildListStyle(PresContext(), newFrames, this);\n return result;\n }\n return false;\n}\n"} +{"text": "---\ndate: 2016-04-09T16:50:16+02:00\ntitle: Pages organization\nweight: 5\n---\n\nIn **Hugo**, pages are the core of your site. Once it is configured, pages are definitely the added value to your documentation site.\n\n## Folders\n\nOrganize your site like [any other Hugo project](https://gohugo.io/content/organization/). Typically, you will have a *content* folder with all your pages.\n\n content\n ├── level-one \n │ ├── level-two\n │ │ ├── level-three\n │ │ │ ├── level-four\n │ │ │ │ ├── _index.md <-- /level-one/level-two/level-three/level-four\n │ │ │ │ ├── page-4-a.md <-- /level-one/level-two/level-three/level-four/page-4-a\n │ │ │ │ ├── page-4-b.md <-- /level-one/level-two/level-three/level-four/page-4-b\n │ │ │ │ └── page-4-c.md <-- /level-one/level-two/level-three/level-four/page-4-c\n │ │ │ ├── _index.md <-- /level-one/level-two/level-three\n │ │ │ ├── page-3-a.md <-- /level-one/level-two/level-three/page-3-a\n │ │ │ ├── page-3-b.md <-- /level-one/level-two/level-three/page-3-b\n │ │ │ └── page-3-c.md <-- /level-one/level-two/level-three/page-3-c\n │ │ ├── _index.md <-- /level-one/level-two\n │ │ ├── page-2-a.md <-- /level-one/level-two/page-2-a\n │ │ ├── page-2-b.md <-- /level-one/level-two/page-2-b\n │ │ └── page-2-c.md <-- /level-one/level-two/page-2-c\n │ ├── _index.md <-- /level-one\n │ ├── page-1-a.md <-- /level-one/page-1-a\n │ ├── page-1-b.md <-- /level-one/page-1-b\n │ └── page-1-c.md <-- /level-one/page-1-c\n ├── _index.md <-- /\n └── page-top.md <-- /page-top\n\n{{% notice note %}}\n`_index.md` is required in each folder, it’s your “folder home page”\n{{% /notice %}}\n\n## Types\n\n**Hugo-theme-learn** defines two types of pages. *Default* and *Chapter*. Both can be used at any level of the documentation, the only difference being layout display.\n\nA **Chapter** displays a page meant to be used as introduction for a set of child pages. Commonly, it contains a simple title and a catch line to define content that can be found under it.\nYou can define any HTML as prefix for the menu. In the example below, it's just a number but that could be an [icon](https://fortawesome.github.io/Font-Awesome/).\n\n![Chapter page](/cont/pages/images/pages-chapter.png?width=50pc)\n\n```markdown\n+++\ntitle = \"Basics\"\nchapter = true\nweight = 5\npre = \"1. \"\n+++\n\n### Chapter 1\n\n# Basics\n\nDiscover what this Hugo theme is all about and the core-concepts behind it.\n```\n\nTo tell **Hugo-theme-learn** to consider a page as a chapter, set `chapter=true` in the Front Matter of the page.\n\nA **Default** page is any other content page.\n\n![Default page](/cont/pages/images/pages-default.png?width=50pc)\n\n```toml\n+++\ntitle = \"Installation\"\nweight = 15\n+++\n```\n\nThe following steps are here to help you initialize your new website. If you don't know Hugo at all, we strongly suggest you to train by following this [great documentation for beginners](https://gohugo.io/overview/quickstart/).\n\n## Create your project\n\nHugo provides a `new` command to create a new website.\n\n```\nhugo new site \n```\n\n**Hugo-theme-learn** provides [archetypes]({{< relref \"cont/archetypes.fr.md\" >}}) to help you create this kind of pages.\n\n## Front Matter configuration\n\nEach Hugo page has to define a [Front Matter](https://gohugo.io/content/front-matter/) in *yaml*, *toml* or *json*.\n\n**Hugo-theme-learn** uses the following parameters on top of Hugo ones :\n\n```toml\n+++\n# Table of content (toc) is enabled by default. Set this parameter to true to disable it.\n# Note: Toc is always disabled for chapter pages\ndisableToc = \"false\"\n# If set, this will be used for the page's menu entry (instead of the `title` attribute)\nmenuTitle = \"\"\n# The title of the page in menu will be prefixed by this HTML content\npre = \"\"\n# The title of the page in menu will be postfixed by this HTML content\npost = \"\"\n# Set the page as a chapter, changing the way it's displayed\nchapter = false\n# Hide a menu entry by setting this to true\nhidden = false\n# Display name of this page modifier. If set, it will be displayed in the footer. \nLastModifierDisplayName = \"\"\n# Email of this page modifier. If set with LastModifierDisplayName, it will be displayed in the footer\nLastModifierEmail = \"\"\n+++\n```\n\n### Add icon to a menu entry\n\nIn the page frontmatter, add a `pre` param to insert any HTML code before the menu label. The example below uses the Github icon.\n\n```toml\n+++\ntitle = \"Github repo\"\npre = \" \"\n+++\n```\n\n![Title with icon](/cont/pages/images/frontmatter-icon.png)\n\n### Ordering sibling menu/page entries\n\nHugo provides a [flexible way](https://gohugo.io/content/ordering/) to handle order for your pages.\n\nThe simplest way is to set `weight` parameter to a number.\n\n```toml\n+++\ntitle = \"My page\"\nweight = 5\n+++\n```\n\n### Using a custom title for menu entries\n\nBy default, **Hugo-theme-learn** will use a page's `title` attribute for the menu item (or `linkTitle` if defined).\n\nBut a page's title has to be descriptive on its own while the menu is a hierarchy. \nWe've added the `menuTitle` parameter for that purpose:\n\nFor example (for a page named `content/install/linux.md`): \n\n```toml\n+++\ntitle = \"Install on Linux\"\nmenuTitle = \"Linux\"\n+++\n```\n\n## Homepage\n\nTo configure your home page, you basically have three choices:\n\n1. Create an `_index.md` document in `content` folder and fill the file with *Markdown content*\n2. Create an `index.html` file in the `static` folder and fill the file with *HTML content*\n3. Configure your server to automatically redirect home page to one your documentation page\n"} +{"text": ";;;; -*- indent-tabs-mode: nil -*-\n;;;\n;;; swank-mkcl.lisp --- SLIME backend for MKCL.\n;;;\n;;; This code has been placed in the Public Domain. All warranties\n;;; are disclaimed.\n;;;\n\n;;; Administrivia\n\n(defpackage swank/mkcl\n (:use cl swank/backend))\n\n(in-package swank/mkcl)\n\n;;(declaim (optimize (debug 3)))\n\n(defvar *tmp*)\n\n(defimplementation gray-package-name ()\n '#:gray)\n\n(eval-when (:compile-toplevel :load-toplevel)\n\n (swank/backend::import-swank-mop-symbols :clos\n ;; '(:eql-specializer\n ;; :eql-specializer-object\n ;; :generic-function-declarations\n ;; :specializer-direct-methods\n ;; :compute-applicable-methods-using-classes)\n nil\n ))\n\n\f\n;;; UTF8\n\n(defimplementation string-to-utf8 (string)\n (mkcl:octets (si:utf-8 string)))\n\n(defimplementation utf8-to-string (octets)\n (string (si:utf-8 octets)))\n\n\n;;;; TCP Server\n\n(eval-when (:compile-toplevel :load-toplevel)\n ;; At compile-time we need access to the sb-bsd-sockets package for the\n ;; the following code to be read properly.\n ;; It is a bit a shame we have to load the entire module to get that.\n (require 'sockets))\n\n\n(defun resolve-hostname (name)\n (car (sb-bsd-sockets:host-ent-addresses\n (sb-bsd-sockets:get-host-by-name name))))\n\n(defimplementation create-socket (host port &key backlog)\n (let ((socket (make-instance 'sb-bsd-sockets:inet-socket\n\t\t\t :type :stream\n\t\t\t :protocol :tcp)))\n (setf (sb-bsd-sockets:sockopt-reuse-address socket) t)\n (sb-bsd-sockets:socket-bind socket (resolve-hostname host) port)\n (sb-bsd-sockets:socket-listen socket (or backlog 5))\n socket))\n\n(defimplementation local-port (socket)\n (nth-value 1 (sb-bsd-sockets:socket-name socket)))\n\n(defimplementation close-socket (socket)\n (sb-bsd-sockets:socket-close socket))\n\n(defun accept (socket)\n \"Like socket-accept, but retry on EINTR.\"\n (loop (handler-case\n (return (sb-bsd-sockets:socket-accept socket))\n (sb-bsd-sockets:interrupted-error ()))))\n\n(defimplementation accept-connection (socket\n &key external-format\n buffering timeout)\n (declare (ignore timeout))\n (sb-bsd-sockets:socket-make-stream (accept socket)\n :output t ;; bogus\n :input t ;; bogus\n :buffering buffering ;; bogus\n :element-type (if external-format\n 'character \n '(unsigned-byte 8))\n :external-format external-format\n ))\n\n(defimplementation preferred-communication-style ()\n :spawn\n )\n\n(defvar *external-format-to-coding-system*\n '((:iso-8859-1\n \"latin-1\" \"latin-1-unix\" \"iso-latin-1-unix\" \n \"iso-8859-1\" \"iso-8859-1-unix\")\n (:utf-8 \"utf-8\" \"utf-8-unix\")))\n\n(defun external-format (coding-system)\n (or (car (rassoc-if (lambda (x) (member coding-system x :test #'equal))\n *external-format-to-coding-system*))\n (find coding-system (si:all-encodings) :test #'string-equal)))\n\n(defimplementation find-external-format (coding-system)\n #+unicode (external-format coding-system)\n ;; Without unicode support, MKCL uses the one-byte encoding of the\n ;; underlying OS, and will barf on anything except :DEFAULT. We\n ;; return NIL here for known multibyte encodings, so\n ;; SWANK:CREATE-SERVER will barf.\n #-unicode (let ((xf (external-format coding-system)))\n (if (member xf '(:utf-8))\n nil\n :default)))\n\n\n\f\n;;;; Unix signals\n\n(defimplementation install-sigint-handler (handler)\n (let ((old-handler (symbol-function 'si:terminal-interrupt)))\n (setf (symbol-function 'si:terminal-interrupt)\n (if (consp handler)\n (car handler)\n (lambda (&rest args)\n (declare (ignore args))\n (funcall handler)\n (continue))))\n (list old-handler)))\n\n\n(defimplementation getpid ()\n (mkcl:getpid))\n\n(defimplementation set-default-directory (directory)\n (mk-ext::chdir (namestring directory))\n (default-directory))\n\n(defimplementation default-directory ()\n (namestring (mk-ext:getcwd)))\n\n(defmacro progf (plist &rest forms)\n `(let (_vars _vals)\n (do ((p ,plist (cddr p)))\n ((endp p))\n (push (car p) _vars)\n (push (cadr p) _vals))\n (progv _vars _vals ,@forms)\n )\n )\n\n(defvar *inferior-lisp-sleeping-post* nil)\n\n(defimplementation quit-lisp ()\n (progf (ignore-errors (eval (read-from-string \"swank::*saved-global-streams*\"))) ;; restore original IO streams.\n (when *inferior-lisp-sleeping-post* (mt:semaphore-signal *inferior-lisp-sleeping-post*))\n ;;(mk-ext:quit :verbose t)\n ))\n\n\f\n;;;; Compilation\n\n(defvar *buffer-name* nil)\n(defvar *buffer-start-position*)\n(defvar *buffer-string*)\n(defvar *compile-filename*)\n\n(defun signal-compiler-condition (&rest args)\n (signal (apply #'make-condition 'compiler-condition args)))\n\n#|\n(defun handle-compiler-warning (condition)\n (signal-compiler-condition\n :original-condition condition\n :message (format nil \"~A\" condition)\n :severity :warning\n :location\n (if *buffer-name*\n (make-location (list :buffer *buffer-name*)\n (list :offset *buffer-start-position* 0))\n ;; ;; compiler::*current-form*\n ;; (if compiler::*current-function*\n ;; (make-location (list :file *compile-filename*)\n ;; (list :function-name \n ;; (symbol-name\n ;; (slot-value compiler::*current-function*\n ;; 'compiler::name))))\n (list :error \"No location found.\")\n ;; )\n )))\n|#\n\n#|\n(defun condition-location (condition)\n (let ((file (compiler:compiler-message-file condition))\n (position (compiler:compiler-message-file-position condition)))\n (if (and position (not (minusp position)))\n (if *buffer-name*\n (make-buffer-location *buffer-name*\n *buffer-start-position*\n position)\n (make-file-location file position))\n (make-error-location \"No location found.\"))))\n|#\n\n(defun condition-location (condition)\n (if *buffer-name*\n (make-location (list :buffer *buffer-name*)\n (list :offset *buffer-start-position* 0))\n ;; ;; compiler::*current-form* ;\n ;; (if compiler::*current-function* ;\n ;; (make-location (list :file *compile-filename*) ;\n ;; (list :function-name ;\n ;; (symbol-name ;\n ;; (slot-value compiler::*current-function* ;\n ;; 'compiler::name)))) ;\n (if (typep condition 'compiler::compiler-message)\n (make-location (list :file (namestring (compiler:compiler-message-file condition)))\n (list :end-position (compiler:compiler-message-file-end-position condition)))\n (list :error \"No location found.\"))\n )\n )\n\n(defun handle-compiler-message (condition)\n (unless (typep condition 'compiler::compiler-note)\n (signal-compiler-condition\n :original-condition condition\n :message (princ-to-string condition)\n :severity (etypecase condition\n (compiler:compiler-fatal-error :error)\n (compiler:compiler-error :error)\n (error :error)\n (style-warning :style-warning)\n (warning :warning))\n :location (condition-location condition))))\n\n(defimplementation call-with-compilation-hooks (function)\n (handler-bind ((compiler:compiler-message #'handle-compiler-message))\n (funcall function)))\n\n(defimplementation swank-compile-file (input-file output-file\n load-p external-format\n &key policy)\n (declare (ignore policy))\n (with-compilation-hooks ()\n (let ((*buffer-name* nil)\n (*compile-filename* input-file))\n (handler-bind (#|\n (compiler::compiler-note\n #'(lambda (n)\n (format t \"~%swank saw a compiler note: ~A~%\" n) (finish-output) nil))\n (compiler::compiler-warning\n #'(lambda (w)\n (format t \"~%swank saw a compiler warning: ~A~%\" w) (finish-output) nil))\n (compiler::compiler-error\n #'(lambda (e)\n (format t \"~%swank saw a compiler error: ~A~%\" e) (finish-output) nil))\n |#\n )\n (multiple-value-bind (output-truename warnings-p failure-p)\n (compile-file input-file :output-file output-file :external-format external-format)\n (values output-truename warnings-p\n (or failure-p\n (and load-p (not (load output-truename))))))))))\n\n(defimplementation swank-compile-string (string &key buffer position filename line column policy)\n (declare (ignore filename line column policy))\n (with-compilation-hooks ()\n (let ((*buffer-name* buffer)\n (*buffer-start-position* position)\n (*buffer-string* string))\n (with-input-from-string (s string)\n (when position (file-position position))\n (compile-from-stream s)))))\n\n(defun compile-from-stream (stream)\n (let ((file (mkcl:mkstemp \"TMP:MKCL-SWANK-TMPXXXXXX\"))\n output-truename\n warnings-p\n failure-p\n )\n (with-open-file (s file :direction :output :if-exists :overwrite)\n (do ((line (read-line stream nil) (read-line stream nil)))\n\t ((not line))\n\t(write-line line s)))\n (unwind-protect\n (progn\n (multiple-value-setq (output-truename warnings-p failure-p)\n (compile-file file))\n (and (not failure-p) (load output-truename)))\n (when (probe-file file) (delete-file file))\n (when (probe-file output-truename) (delete-file output-truename)))))\n\n\f\n;;;; Documentation\n\n(defun grovel-docstring-for-arglist (name type)\n (flet ((compute-arglist-offset (docstring)\n (when docstring\n (let ((pos1 (search \"Args: \" docstring)))\n (if pos1\n (+ pos1 6)\n (let ((pos2 (search \"Syntax: \" docstring)))\n (when pos2\n (+ pos2 8))))))))\n (let* ((docstring (si::get-documentation name type))\n (pos (compute-arglist-offset docstring)))\n (if pos\n (multiple-value-bind (arglist errorp)\n (ignore-errors\n (values (read-from-string docstring t nil :start pos)))\n (if (or errorp (not (listp arglist)))\n :not-available\n arglist\n ))\n :not-available ))))\n\n(defimplementation arglist (name)\n (cond ((and (symbolp name) (special-operator-p name))\n (let ((arglist (grovel-docstring-for-arglist name 'function)))\n (if (consp arglist) (cdr arglist) arglist)))\n ((and (symbolp name) (macro-function name))\n (let ((arglist (grovel-docstring-for-arglist name 'function)))\n (if (consp arglist) (cdr arglist) arglist)))\n ((or (functionp name) (fboundp name))\n (multiple-value-bind (name fndef)\n (if (functionp name)\n (values (function-name name) name)\n (values name (fdefinition name)))\n (let ((fle (function-lambda-expression fndef)))\n (case (car fle)\n (si:lambda-block (caddr fle))\n (t (typecase fndef\n (generic-function (clos::generic-function-lambda-list fndef))\n (compiled-function (grovel-docstring-for-arglist name 'function))\n (function :not-available)))))))\n (t :not-available)))\n\n(defimplementation function-name (f)\n (si:compiled-function-name f)\n )\n\n(eval-when (:compile-toplevel :load-toplevel)\n ;; At compile-time we need access to the walker package for the\n ;; the following code to be read properly.\n ;; It is a bit a shame we have to load the entire module to get that.\n (require 'walker))\n\n(defimplementation macroexpand-all (form &optional env)\n (declare (ignore env))\n (walker:macroexpand-all form))\n\n(defimplementation describe-symbol-for-emacs (symbol)\n (let ((result '()))\n (dolist (type '(:VARIABLE :FUNCTION :CLASS))\n (let ((doc (describe-definition symbol type)))\n (when doc\n (setf result (list* type doc result)))))\n result))\n\n(defimplementation describe-definition (name type)\n (case type\n (:variable (documentation name 'variable))\n (:function (documentation name 'function))\n (:class (documentation name 'class))\n (t nil)))\n\n;;; Debugging\n\n(eval-when (:compile-toplevel :load-toplevel)\n (import\n '(si::*break-env*\n si::*ihs-top*\n si::*ihs-current*\n si::*ihs-base*\n si::*frs-base*\n si::*frs-top*\n si::*tpl-commands*\n si::*tpl-level*\n si::frs-top\n si::ihs-top\n si::ihs-fun\n si::ihs-env\n si::sch-frs-base\n si::set-break-env\n si::set-current-ihs\n si::tpl-commands)))\n\n(defvar *backtrace* '())\n\n(defun in-swank-package-p (x)\n (and\n (symbolp x)\n (member (symbol-package x)\n (list #.(find-package :swank)\n #.(find-package :swank/backend)\n #.(ignore-errors (find-package :swank-mop))\n #.(ignore-errors (find-package :swank-loader))))\n t))\n\n(defun is-swank-source-p (name)\n (setf name (pathname name))\n #+(or)\n (pathname-match-p\n name\n (make-pathname :defaults swank-loader::*source-directory*\n :name (pathname-name name)\n :type (pathname-type name)\n :version (pathname-version name)))\n nil)\n\n(defun is-ignorable-fun-p (x)\n (or\n (in-swank-package-p (frame-name x))\n (multiple-value-bind (file position)\n (ignore-errors (si::compiled-function-file (car x)))\n (declare (ignore position))\n (if file (is-swank-source-p file)))))\n\n(defmacro find-ihs-top (x)\n (declare (ignore x))\n '(si::ihs-top))\n\n(defimplementation call-with-debugging-environment (debugger-loop-fn)\n (declare (type function debugger-loop-fn))\n (let* (;;(*tpl-commands* si::tpl-commands)\n (*ihs-base* 0)\n (*ihs-top* (find-ihs-top 'call-with-debugging-environment))\n (*ihs-current* *ihs-top*)\n (*frs-base* (or (sch-frs-base 0 #|*frs-top*|# *ihs-base*) (1+ (frs-top))))\n (*frs-top* (frs-top))\n (*read-suppress* nil)\n ;;(*tpl-level* (1+ *tpl-level*))\n (*backtrace* (loop for ihs from 0 below *ihs-top*\n collect (list (si::ihs-fun ihs)\n (si::ihs-env ihs)\n nil))))\n (declare (special *ihs-current*))\n (loop for f from *frs-base* to *frs-top*\n do (let ((i (- (si::frs-ihs f) *ihs-base* 1)))\n (when (plusp i)\n (let* ((x (elt *backtrace* i))\n (name (si::frs-tag f)))\n (unless (mkcl:fixnump name)\n (push name (third x)))))))\n (setf *backtrace* (remove-if #'is-ignorable-fun-p (nreverse *backtrace*)))\n (setf *tmp* *backtrace*)\n (set-break-env)\n (set-current-ihs)\n (let ((*ihs-base* *ihs-top*))\n (funcall debugger-loop-fn))))\n\n(defimplementation call-with-debugger-hook (hook fun)\n (let ((*debugger-hook* hook)\n (*ihs-base* (find-ihs-top 'call-with-debugger-hook)))\n (funcall fun)))\n\n(defimplementation compute-backtrace (start end)\n (when (numberp end)\n (setf end (min end (length *backtrace*))))\n (loop for f in (subseq *backtrace* start end)\n collect f))\n\n(defimplementation format-sldb-condition (condition)\n \"Format a condition for display in SLDB.\"\n ;;(princ-to-string condition)\n (format nil \"~A~%In thread: ~S\" condition mt:*thread*)\n )\n\n(defun frame-name (frame)\n (let ((x (first frame)))\n (if (symbolp x)\n x\n (function-name x))))\n\n(defun function-position (fun)\n (multiple-value-bind (file position)\n (si::compiled-function-file fun)\n (and file (make-location\n `(:file ,(if (stringp file) file (namestring file)))\n ;;`(:position ,position)\n `(:end-position , position)))))\n\n(defun frame-function (frame)\n (let* ((x (first frame))\n fun position)\n (etypecase x\n (symbol (and (fboundp x)\n (setf fun (fdefinition x)\n position (function-position fun))))\n (function (setf fun x position (function-position x))))\n (values fun position)))\n\n(defun frame-decode-env (frame)\n (let ((functions '())\n (blocks '())\n (variables '()))\n (setf frame (si::decode-ihs-env (second frame)))\n (dolist (record frame)\n (let* ((record0 (car record))\n\t (record1 (cdr record)))\n\t(cond ((or (symbolp record0) (stringp record0))\n\t (setq variables (acons record0 record1 variables)))\n\t ((not (mkcl:fixnump record0))\n\t (push record1 functions))\n\t ((symbolp record1)\n\t (push record1 blocks))\n\t (t\n\t ))))\n (values functions blocks variables)))\n\n(defimplementation print-frame (frame stream)\n (let ((function (first frame)))\n (let ((fname\n;;; (cond ((symbolp function) function)\n;;; ((si:instancep function) (slot-value function 'name))\n;;; ((compiled-function-p function)\n;;; (or (si::compiled-function-name function) 'lambda))\n;;; (t :zombi))\n (si::get-fname function)\n ))\n (if (eq fname 'si::bytecode)\n (format stream \"~A [Evaluation of: ~S]\"\n fname (function-lambda-expression function))\n (format stream \"~A\" fname)\n )\n (when (si::closurep function)\n (format stream\n \", closure generated from ~A\"\n (si::get-fname (si:closure-producer function)))\n )\n )\n )\n )\n\n(defimplementation frame-source-location (frame-number)\n (nth-value 1 (frame-function (elt *backtrace* frame-number))))\n\n(defimplementation frame-catch-tags (frame-number)\n (third (elt *backtrace* frame-number)))\n\n(defimplementation frame-locals (frame-number)\n (loop for (name . value) in (nth-value 2 (frame-decode-env (elt *backtrace* frame-number)))\n with i = 0\n collect (list :name name :id (prog1 i (incf i)) :value value)))\n\n(defimplementation frame-var-value (frame-number var-id)\n (cdr (elt (nth-value 2 (frame-decode-env (elt *backtrace* frame-number))) var-id)))\n\n(defimplementation disassemble-frame (frame-number)\n (let ((fun (frame-fun (elt *backtrace* frame-number))))\n (disassemble fun)))\n\n(defimplementation eval-in-frame (form frame-number)\n (let ((env (second (elt *backtrace* frame-number))))\n (si:eval-in-env form env)))\n\n#|\n(defimplementation gdb-initial-commands ()\n ;; These signals are used by the GC.\n #+linux '(\"handle SIGPWR noprint nostop\"\n \"handle SIGXCPU noprint nostop\"))\n\n(defimplementation command-line-args ()\n (loop for n from 0 below (si:argc) collect (si:argv n)))\n|#\n\n;;;; Inspector\n\n(defmethod emacs-inspect ((o t))\n ; ecl clos support leaves some to be desired\n (cond\n ((streamp o)\n (list*\n (format nil \"~S is an ordinary stream~%\" o)\n (append\n (list\n \"Open for \"\n (cond\n ((ignore-errors (interactive-stream-p o)) \"Interactive\")\n ((and (input-stream-p o) (output-stream-p o)) \"Input and output\")\n ((input-stream-p o) \"Input\")\n ((output-stream-p o) \"Output\"))\n `(:newline) `(:newline))\n (label-value-line*\n (\"Element type\" (stream-element-type o))\n (\"External format\" (stream-external-format o)))\n (ignore-errors (label-value-line*\n (\"Broadcast streams\" (broadcast-stream-streams o))))\n (ignore-errors (label-value-line*\n (\"Concatenated streams\" (concatenated-stream-streams o))))\n (ignore-errors (label-value-line*\n (\"Echo input stream\" (echo-stream-input-stream o))))\n (ignore-errors (label-value-line*\n (\"Echo output stream\" (echo-stream-output-stream o))))\n (ignore-errors (label-value-line*\n (\"Output String\" (get-output-stream-string o))))\n (ignore-errors (label-value-line*\n (\"Synonym symbol\" (synonym-stream-symbol o))))\n (ignore-errors (label-value-line*\n (\"Input stream\" (two-way-stream-input-stream o))))\n (ignore-errors (label-value-line*\n (\"Output stream\" (two-way-stream-output-stream o)))))))\n ((si:instancep o) ;;t\n (let* ((cl (si:instance-class o))\n (slots (clos::class-slots cl)))\n (list* (format nil \"~S is an instance of class ~A~%\"\n o (clos::class-name cl))\n (loop for x in slots append\n (let* ((name (clos::slot-definition-name x))\n (value (if (slot-boundp o name)\n (clos::slot-value o name)\n \"Unbound\"\n )))\n (list\n (format nil \"~S: \" name)\n `(:value ,value)\n `(:newline)))))))\n (t (list (format nil \"~A\" o)))))\n\n;;;; Definitions\n\n(defimplementation find-definitions (name)\n (if (fboundp name)\n (let ((tmp (find-source-location (symbol-function name))))\n `(((defun ,name) ,tmp)))))\n\n(defimplementation find-source-location (obj)\n (setf *tmp* obj)\n (or\n (typecase obj\n (function\n (multiple-value-bind (file pos) (ignore-errors (si::compiled-function-file obj))\n (if (and file pos) \n (make-location\n `(:file ,(if (stringp file) file (namestring file)))\n `(:end-position ,pos) ;; `(:position ,pos)\n `(:snippet\n ,(with-open-file (s file)\n (file-position s pos)\n (skip-comments-and-whitespace s)\n (read-snippet s))))))))\n `(:error (format nil \"Source definition of ~S not found\" obj))))\n\n;;;; Profiling\n\n\n(eval-when (:compile-toplevel :load-toplevel)\n ;; At compile-time we need access to the profile package for the\n ;; the following code to be read properly.\n ;; It is a bit a shame we have to load the entire module to get that.\n (require 'profile))\n\n\n(defimplementation profile (fname)\n (when fname (eval `(profile:profile ,fname))))\n\n(defimplementation unprofile (fname)\n (when fname (eval `(profile:unprofile ,fname))))\n\n(defimplementation unprofile-all ()\n (profile:unprofile-all)\n \"All functions unprofiled.\")\n\n(defimplementation profile-report ()\n (profile:report))\n\n(defimplementation profile-reset ()\n (profile:reset)\n \"Reset profiling counters.\")\n\n(defimplementation profiled-functions ()\n (profile:profile))\n\n(defimplementation profile-package (package callers methods)\n (declare (ignore callers methods))\n (eval `(profile:profile ,(package-name (find-package package)))))\n\n\n;;;; Threads\n\n(defvar *thread-id-counter* 0)\n\n(defvar *thread-id-counter-lock*\n (mt:make-lock :name \"thread id counter lock\"))\n\n(defun next-thread-id ()\n (mt:with-lock (*thread-id-counter-lock*)\n (incf *thread-id-counter*))\n )\n\n(defparameter *thread-id-map* (make-hash-table))\n(defparameter *id-thread-map* (make-hash-table))\n\n(defvar *thread-id-map-lock*\n (mt:make-lock :name \"thread id map lock\"))\n\n(defparameter +default-thread-local-variables+\n '(*macroexpand-hook*\n *default-pathname-defaults*\n *readtable*\n *random-state*\n *compile-print*\n *compile-verbose*\n *load-print*\n *load-verbose*\n *print-array*\n *print-base*\n *print-case*\n *print-circle*\n *print-escape*\n *print-gensym*\n *print-length*\n *print-level*\n *print-lines*\n *print-miser-width*\n *print-pprint-dispatch*\n *print-pretty*\n *print-radix*\n *print-readably*\n *print-right-margin*\n *read-base*\n *read-default-float-format*\n *read-eval*\n *read-suppress*\n ))\n \n(defun thread-local-default-bindings ()\n (let (local)\n (dolist (var +default-thread-local-variables+ local)\n (setq local (acons var (symbol-value var) local))\n )))\n\n;; mkcl doesn't have weak pointers\n(defimplementation spawn (fn &key name initial-bindings)\n (let* ((local-defaults (thread-local-default-bindings))\n (thread \n ;;(mt:make-thread :name name)\n (mt:make-thread :name name\n :initial-bindings (nconc initial-bindings \n local-defaults))\n )\n (id (next-thread-id)))\n (mt:with-lock (*thread-id-map-lock*)\n (setf (gethash id *thread-id-map*) thread)\n (setf (gethash thread *id-thread-map*) id))\n (mt:thread-preset\n thread\n #'(lambda ()\n (unwind-protect\n (progn\n ;;(format t \"~&Starting thread: ~S.~%\" name) (finish-output)\n (mt:thread-detach nil)\n (funcall fn))\n (progn\n ;;(format t \"~&Wrapping up thread: ~S.~%\" name) (finish-output)\n (mt:with-lock (*thread-id-map-lock*)\n (remhash thread *id-thread-map*)\n (remhash id *thread-id-map*))\n ;;(format t \"~&Finished thread: ~S~%\" name) (finish-output)\n ))))\n (mt:thread-enable thread)\n (mt:thread-yield)\n thread\n ))\n\n(defimplementation thread-id (thread)\n (block thread-id\n (mt:with-lock (*thread-id-map-lock*)\n (or (gethash thread *id-thread-map*)\n (let ((id (next-thread-id)))\n (setf (gethash id *thread-id-map*) thread)\n (setf (gethash thread *id-thread-map*) id)\n id)))))\n\n(defimplementation find-thread (id)\n (mt:with-lock (*thread-id-map-lock*)\n (gethash id *thread-id-map*)))\n\n(defimplementation thread-name (thread)\n (mt:thread-name thread))\n\n(defimplementation thread-status (thread)\n (if (mt:thread-active-p thread)\n \"RUNNING\"\n \"STOPPED\"))\n\n(defimplementation make-lock (&key name)\n (mt:make-lock :name name :recursive t))\n\n(defimplementation call-with-lock-held (lock function)\n (declare (type function function))\n (mt:with-lock (lock) (funcall function)))\n\n(defimplementation current-thread ()\n mt:*thread*)\n\n(defimplementation all-threads ()\n (mt:all-threads))\n\n(defimplementation interrupt-thread (thread fn)\n (mt:interrupt-thread thread fn))\n\n(defimplementation kill-thread (thread)\n (mt:interrupt-thread thread #'mt:terminate-thread)\n )\n\n(defimplementation thread-alive-p (thread)\n (mt:thread-active-p thread))\n\n(defvar *mailbox-lock* (mt:make-lock :name \"mailbox lock\"))\n(defvar *mailboxes* (list))\n(declaim (type list *mailboxes*))\n\n(defstruct (mailbox (:conc-name mailbox.))\n thread\n locked-by\n (mutex (mt:make-lock :name \"thread mailbox\"))\n (semaphore (mt:make-semaphore))\n (queue '() :type list))\n\n(defun mailbox (thread)\n \"Return THREAD's mailbox.\"\n (mt:with-lock (*mailbox-lock*)\n (or (find thread *mailboxes* :key #'mailbox.thread)\n (let ((mb (make-mailbox :thread thread)))\n (push mb *mailboxes*)\n mb))))\n\n(defimplementation send (thread message)\n (handler-case\n (let* ((mbox (mailbox thread))\n (mutex (mailbox.mutex mbox)))\n;; (mt:interrupt-thread\n;; thread\n;; (lambda ()\n;; (mt:with-lock (mutex)\n;; (setf (mailbox.queue mbox)\n;; (nconc (mailbox.queue mbox) (list message))))))\n\n;; (format t \"~&! thread = ~S~% thread = ~S~% message = ~S~%\"\n;; mt:*thread* thread message) (finish-output)\n (mt:with-lock (mutex)\n (setf (mailbox.locked-by mbox) mt:*thread*)\n (setf (mailbox.queue mbox)\n (nconc (mailbox.queue mbox) (list message)))\n ;;(format t \"*\") (finish-output)\n (handler-case\n (mt:semaphore-signal (mailbox.semaphore mbox))\n (condition (condition)\n (format t \"Something went bad with semaphore-signal ~A\" condition) (finish-output)\n ;;(break)\n ))\n (setf (mailbox.locked-by mbox) nil)\n )\n ;;(format t \"+\") (finish-output)\n )\n (condition (condition)\n (format t \"~&Error in send: ~S~%\" condition) (finish-output))\n )\n )\n\n;; (defimplementation receive ()\n;; (block got-mail\n;; (let* ((mbox (mailbox mt:*thread*))\n;; (mutex (mailbox.mutex mbox)))\n;; (loop\n;; (mt:with-lock (mutex)\n;; (if (mailbox.queue mbox)\n;; (return-from got-mail (pop (mailbox.queue mbox)))))\n;; ;;interrupt-thread will halt this if it takes longer than 1sec\n;; (sleep 1)))))\n\n\n(defimplementation receive-if (test &optional timeout)\n (handler-case\n (let* ((mbox (mailbox (current-thread)))\n (mutex (mailbox.mutex mbox))\n got-one)\n (assert (or (not timeout) (eq timeout t)))\n (loop\n (check-slime-interrupts)\n ;;(format t \"~&: ~S~%\" mt:*thread*) (finish-output)\n (handler-case\n (setq got-one (mt:semaphore-wait (mailbox.semaphore mbox) 2))\n (condition (condition)\n (format t \"~&In (swank-mkcl) receive-if: Something went bad with semaphore-wait ~A~%\" condition)\n (finish-output)\n nil\n )\n )\n (mt:with-lock (mutex)\n (setf (mailbox.locked-by mbox) mt:*thread*)\n (let* ((q (mailbox.queue mbox))\n (tail (member-if test q)))\n (when tail \n (setf (mailbox.queue mbox) (nconc (ldiff q tail) (cdr tail)))\n (setf (mailbox.locked-by mbox) nil)\n ;;(format t \"~&thread ~S received: ~S~%\" mt:*thread* (car tail))\n (return (car tail))))\n (setf (mailbox.locked-by mbox) nil)\n )\n\n ;;(format t \"/ ~S~%\" mt:*thread*) (finish-output)\n (when (eq timeout t) (return (values nil t)))\n;; (unless got-one\n;; (format t \"~&In (swank-mkcl) receive-if: semaphore-wait timed out!~%\"))\n )\n )\n (condition (condition)\n (format t \"~&Error in (swank-mkcl) receive-if: ~S, ~A~%\" condition condition) (finish-output)\n nil\n )\n )\n )\n\n\n(defmethod stream-finish-output ((stream stream))\n (finish-output stream))\n\n\n;;\n\n;;#+windows\n(defimplementation doze-in-repl ()\n (setq *inferior-lisp-sleeping-post* (mt:make-semaphore))\n ;;(loop (sleep 1))\n (mt:semaphore-wait *inferior-lisp-sleeping-post*)\n (mk-ext:quit :verbose t)\n )\n\n"} +{"text": "/**\n * Copyright 2011-2019 Asakusa Framework 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 com.asakusafw.yaess.core.task;\n\nimport java.io.IOException;\nimport java.text.MessageFormat;\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport com.asakusafw.yaess.core.ExecutionContext;\nimport com.asakusafw.yaess.core.ExecutionScript;\nimport com.asakusafw.yaess.core.ExecutionScriptHandler;\n\n/**\n * Tracking execution in testing.\n * @since 0.2.3\n */\n@FunctionalInterface\npublic interface ExecutionTracker {\n\n /**\n * The key name of this implementation class name for handlers.\n */\n String KEY_CLASS = \"tracker.class\";\n\n /**\n * The key name of tracking ID for handlers.\n */\n String KEY_ID = \"tracker.id\";\n\n /**\n * Adds an execution script which is executed in handler.\n * @param id tracking ID\n * @param record tracking record\n * @throws IOException to fail handler's execution\n * @throws InterruptedException to fail handler's execution\n * @see ExecutionTracker.Id#get(String)\n */\n void add(Id id, Record record) throws IOException, InterruptedException;\n\n /**\n * A tracking record.\n */\n public class Record {\n\n /**\n * Current context.\n */\n public final ExecutionContext context;\n\n /**\n * Current script.\n */\n public final ExecutionScript script;\n\n /**\n * Current handler.\n */\n public final ExecutionScriptHandler handler;\n\n /**\n * Creates a new instance.\n * @param context current context\n * @param script executed script\n * @param handler executor handler\n */\n public Record(ExecutionContext context, ExecutionScript script, ExecutionScriptHandler handler) {\n this.context = context;\n this.script = script;\n this.handler = handler;\n }\n\n @Override\n public String toString() {\n return MessageFormat.format(\n \"{0}/{1}/{2}\",\n context.getFlowId(),\n context.getPhase(),\n script == null ? handler.getHandlerId() : script.getId());\n }\n }\n\n /**\n * Tracking ID.\n */\n public class Id {\n\n private static final Map CACHE = new HashMap<>();\n\n private final String token;\n\n /**\n * Creates a new instance.\n * @param token ID token\n */\n private Id(String token) {\n this.token = token;\n }\n\n /**\n * Returns a created ID for the specified token, or create a new ID if does not exist.\n * @param token ID token\n * @return identity for token\n */\n public static Id get(String token) {\n synchronized (CACHE) {\n Id cached = CACHE.get(token);\n if (cached != null) {\n return cached;\n }\n Id id = new Id(token);\n CACHE.put(token, id);\n return id;\n }\n }\n\n @Override\n public int hashCode() {\n final int prime = 31;\n int result = 1;\n result = prime * result + token.hashCode();\n return result;\n }\n\n @Override\n public boolean equals(Object obj) {\n if (this == obj) {\n return true;\n }\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n Id other = (Id) obj;\n if (!token.equals(other.token)) {\n return false;\n }\n return true;\n }\n\n @Override\n public String toString() {\n return token;\n }\n }\n}\n"} +{"text": "//\n// ARSession.h\n// ARKit\n//\n// Copyright © 2016-2017 Apple Inc. All rights reserved.\n//\n\n#import \n#import \n\nNS_ASSUME_NONNULL_BEGIN\n\n@class ARAnchor;\n@class ARCamera;\n@class ARFrame;\n@class ARCollaborationData;\n@class ARWorldMap;\n@class ARRay;\n@class ARRaycastQuery;\n@class ARRaycastResult;\n@class ARTrackedRaycast;\n\n@protocol ARSessionDelegate;\n\n/**\n Set of options for running the session.\n @discussion These options alter the behavior of calling run on a session.\n Providing no options will result in the default behavior of resuming tracking\n from the last known position and keeping all existing anchors.\n */\nAPI_AVAILABLE(ios(11.0))\ntypedef NS_OPTIONS(NSUInteger, ARSessionRunOptions) {\n /** The session will reset tracking. */\n ARSessionRunOptionResetTracking = (1 << 0),\n \n /** The session will remove existing anchors. */\n ARSessionRunOptionRemoveExistingAnchors = (1 << 1),\n \n /** The session will stop currently active tracked raycasts. */\n ARSessionRunOptionStopTrackedRaycasts = (1 << 2),\n /** The session will reset scene reconstruction. */\n ARSessionRunOptionResetSceneReconstruction = (1 << 3)\n} NS_SWIFT_NAME(ARSession.RunOptions);\n\n/**\n The ARSession class configures and runs different Augmented Reality techniques on a device.\n */\nAPI_AVAILABLE(ios(11.0))\n@interface ARSession : NSObject\n\n/**\n Unique identifier of the running session.\n \n @discussion The identifier may change after calling runWithConfiguration.\n */\n@property (atomic, strong, readonly) NSUUID *identifier API_AVAILABLE(ios(13.0));\n\n/**\n A delegate for receiving ARSession updates.\n */\n@property (nonatomic, weak, nullable) id delegate;\n\n/**\n The dispatch queue on which the delegate calls are performed.\n @discussion If not provided or nil, delegate calls will be performed on the main queue.\n */\n@property (nonatomic, strong, nullable) dispatch_queue_t delegateQueue;\n\n\n/**\n The current frame of the session.\n */\n@property (nonatomic, copy, nullable, readonly) ARFrame *currentFrame;\n\n/**\n The configuration currently being used by the session.\n */\n@property (nonatomic, copy, nullable, readonly) ARConfiguration *configuration;\n\n\n\n/**\n Runs the session with the provided configuration.\n @discussion Calling run on a session that has already started will\n transition immediately to using the new configuration.\n @param configuration The configuration to use.\n */\n\n- (void)runWithConfiguration:(ARConfiguration *)configuration NS_SWIFT_UNAVAILABLE(\"Use run(_:options:) instead\");\n\n\n/**\n Runs the session with the provided configuration and options.\n @discussion Calling run on a session that has already started will\n transition immediately to using the new configuration. Options\n can be used to alter the default behavior when transitioning configurations.\n @param configuration The configuration to use.\n @param options The run options to use.\n */\n\n- (void)runWithConfiguration:(ARConfiguration *)configuration options:(ARSessionRunOptions)options NS_SWIFT_NAME(run(_:options:));\n\n/**\n Pauses the session.\n @discussion Once paused, no more updates will be received from the\n session until run is called again.\n */\n- (void)pause;\n\n/**\n Adds an anchor to the session.\n @discussion The anchor will be added in the next frame update.\n @param anchor The anchor to add.\n */\n- (void)addAnchor:(__kindof ARAnchor *)anchor NS_SWIFT_NAME(add(anchor:));\n\n/**\n Removes an anchor from the session.\n @discussion The anchor will be removed from subsequent frame updates.\n @param anchor The anchor to remove.\n */\n- (void)removeAnchor:(__kindof ARAnchor *)anchor NS_SWIFT_NAME(remove(anchor:));\n\n/**\n Sets the world origin of the session to be at the position and orientation specified by the provided transform.\n @param relativeTransform The rotation and translation from the current world origin to the desired world origin.\n Any scale on the transform is ignored.\n */\n- (void)setWorldOrigin:(simd_float4x4)relativeTransform NS_SWIFT_NAME(setWorldOrigin(relativeTransform:)) API_AVAILABLE(ios(11.3));\n\n/**\n Copies the current state of the world being tracked by the session.\n @discussion A world map is only provided when running an ARWorldTrackingConfiguration.\n @param completionHandler The completion handler to call when the get has completed. This handler is executed\n on the session's delegate queue. The completion handler takes the following parameters:\n worldMap - The current world map or nil if unavailable.\n error - An error that indicates why the world map is unavailable, or nil if a world map was provided.\n */\n- (void)getCurrentWorldMapWithCompletionHandler:(void (^)(ARWorldMap * _Nullable worldMap, NSError * _Nullable error))completionHandler API_AVAILABLE(ios(12.0));\n\n/**\n Creates a new reference object from scanned features within the provided bounds.\n \n @discussion Reference objects can be stored and used to track 3D objects from previously scanned data.\n Creation requires that an ARObjectScanningConfiguration is used so that sufficient features are scanned.\n @param transform The transformation matrix that defines the rotation and translation of the bounds in\n world coordinates. This will be used as the reference object's transform, defining its coordinate space.\n @param center The center of the object's bounds in the transform's coordinate space. A zero vector will\n define the object's origin centered within its extent.\n @param extent The extent of the object's bounds in the transform's coordinate space. This defines the bounds'\n size in each dimension.\n @param completionHandler The completion handler to call when the creation has completed. This handler is executed\n on the session's delegate queue. The completion handler takes the following parameters:\n referenceObject - The reference object created or nil if unavailable.\n error - An error that indicates why creation failed, or nil if a reference object was provided.\n */\n- (void)createReferenceObjectWithTransform:(simd_float4x4)transform\n center:(simd_float3)center\n extent:(simd_float3)extent\n completionHandler:(void (^)(ARReferenceObject * _Nullable referenceObject, NSError * _Nullable error))completionHandler\nNS_SWIFT_NAME(createReferenceObject(transform:center:extent:completionHandler:)) API_AVAILABLE(ios(12.0));\n\n#pragma mark - Raycasting\n\n/**\n Perform a raycast.\n @param query Raycast query used for raycasting.\n @return List of raycast results, sorted from nearest to farthest (in distance from the camera). The results could be empty if raycast fails.\n */\n- (NSArray *)raycast:(ARRaycastQuery *)query API_AVAILABLE(ios(13.0));\n\n/**\n Perform a tracked raycast.\n @discussion The session performs continuous raycasting and calls the update handler with the updated results.\n The ARTrackedRaycast object returned can be used to update the raycast with a new raycast query or stop raycasting.\n @param query Raycast query used for raycasting.\n @param updateHandler update handler where updated list of results, sorted from nearest to farthest (in distance from\n the camera) are delivered. updateHandler will be called on session's delegate queue.\n @return Tracked raycast object used to update or stop raycasting. This could be nil if the raycast fails or if the\n configuration is not `ARWorldTrackingConfiguration` or its subclasses.\n */\n- (nullable ARTrackedRaycast *)trackedRaycast:(ARRaycastQuery *)query updateHandler:(void (^)(NSArray *))updateHandler API_AVAILABLE(ios(13.0));\n\n#pragma mark - Collaboration\n\n/**\n Update session with collaboration data.\n \n @discussion Use this to update the session with collaboration data received from other participants.\n \n @param collaborationData Collaboration data for updating the session.\n @see ARCollaborationData\n */\n- (void)updateWithCollaborationData:(ARCollaborationData *)collaborationData API_AVAILABLE(ios(13.0));\n\n@end\n\n#pragma mark - ARSessionObserver\n\n\nAPI_AVAILABLE(ios(11.0))\n@protocol ARSessionObserver \n\n@optional\n\n/**\n This is called when a session fails.\n \n @discussion On failure the session will be paused.\n @param session The session that failed.\n @param error The error being reported (see ARError.h).\n */\n- (void)session:(ARSession *)session didFailWithError:(NSError *)error;\n\n/**\n This is called when the camera’s tracking state has changed.\n \n @param session The session being run.\n @param camera The camera that changed tracking states.\n */\n- (void)session:(ARSession *)session cameraDidChangeTrackingState:(ARCamera *)camera;\n\n/**\n This is called when a session is interrupted.\n \n @discussion A session will be interrupted and no longer able to track when\n it fails to receive required sensor data. This happens when video capture is interrupted,\n for example when the application is sent to the background or when there are\n multiple foreground applications (see AVCaptureSessionInterruptionReason).\n No additional frame updates will be delivered until the interruption has ended.\n @param session The session that was interrupted.\n */\n- (void)sessionWasInterrupted:(ARSession *)session;\n\n/**\n This is called when a session interruption has ended.\n \n @discussion A session will continue running from the last known state once\n the interruption has ended. If the device has moved, anchors will be misaligned.\n To avoid this, some applications may want to reset tracking (see ARSessionRunOptions)\n or attempt to relocalize (see `-[ARSessionObserver sessionShouldAttemptRelocalization:]`).\n @param session The session that was interrupted.\n */\n- (void)sessionInterruptionEnded:(ARSession *)session;\n\n/**\n This is called after a session resumes from a pause or interruption to determine\n whether or not the session should attempt to relocalize.\n \n @discussion To avoid misaligned anchors, apps may wish to attempt a relocalization after\n a session pause or interruption. If YES is returned: the session will begin relocalizing\n and tracking state will switch to limited with reason relocalizing. If successful, the\n session's tracking state will return to normal. Because relocalization depends on\n the user's location, it can run indefinitely. Apps that wish to give up on relocalization\n may call run with `ARSessionRunOptionResetTracking` at any time.\n @param session The session to relocalize.\n @return Return YES to begin relocalizing.\n */\n- (BOOL)sessionShouldAttemptRelocalization:(ARSession *)session API_AVAILABLE(ios(11.3));\n\n/**\n This is called when the session outputs a new audio sample buffer.\n \n @param session The session being run.\n @param audioSampleBuffer The captured audio sample buffer.\n */\n- (void)session:(ARSession *)session didOutputAudioSampleBuffer:(CMSampleBufferRef)audioSampleBuffer;\n\n/**\n This is called when the session generated new collaboration data.\n \n @discussion This data should be sent to all participants.\n \n @param session The session that produced world tracking collaboration data.\n @param data Collaboration data to be sent to participants.\n @see ARCollaborationData\n */\n- (void)session:(ARSession *)session didOutputCollaborationData:(ARCollaborationData *)data API_AVAILABLE(ios(13.0));\n\n@end\n\n#pragma mark - ARSessionDelegate\n\n\nAPI_AVAILABLE(ios(11.0))\n@protocol ARSessionDelegate \n\n@optional\n\n/**\n This is called when a new frame has been updated.\n \n @param session The session being run.\n @param frame The frame that has been updated.\n */\n- (void)session:(ARSession *)session didUpdateFrame:(ARFrame *)frame;\n\n/**\n This is called when new anchors are added to the session.\n \n @param session The session being run.\n @param anchors An array of added anchors.\n */\n- (void)session:(ARSession *)session didAddAnchors:(NSArray<__kindof ARAnchor*>*)anchors;\n\n/**\n This is called when anchors are updated.\n \n @param session The session being run.\n @param anchors An array of updated anchors.\n */\n- (void)session:(ARSession *)session didUpdateAnchors:(NSArray<__kindof ARAnchor*>*)anchors;\n\n/**\n This is called when anchors are removed from the session.\n \n @param session The session being run.\n @param anchors An array of removed anchors.\n */\n- (void)session:(ARSession *)session didRemoveAnchors:(NSArray<__kindof ARAnchor*>*)anchors;\n\n\n@end\n\n/**\n A data source for an ARSession\n */\n@protocol ARSessionProviding \n\n/// To ensure session changes are detected, Swift classes should mark this property as `@objc` and `dynamic`\n@property (readonly) ARSession *session;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"} +{"text": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!1001 &100100000\nPrefab:\n m_ObjectHideFlags: 1\n serializedVersion: 2\n m_Modification:\n m_TransformParent: {fileID: 0}\n m_Modifications: []\n m_RemovedComponents: []\n m_ParentPrefab: {fileID: 0}\n m_RootGameObject: {fileID: 1207221346183892}\n m_IsPrefabParent: 1\n--- !u!1 &1057321637562398\nGameObject:\n m_ObjectHideFlags: 0\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n serializedVersion: 5\n m_Component:\n - component: {fileID: 4343207777919082}\n - component: {fileID: 95136127354012824}\n - component: {fileID: 136976847709920116}\n m_Layer: 0\n m_Name: ballon\n m_TagString: Untagged\n m_Icon: {fileID: 0}\n m_NavMeshLayer: 0\n m_StaticEditorFlags: 0\n m_IsActive: 1\n--- !u!1 &1181849102071720\nGameObject:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n serializedVersion: 5\n m_Component:\n - component: {fileID: 4347247677462242}\n - component: {fileID: 33605781880135254}\n - component: {fileID: 23067865308481886}\n m_Layer: 0\n m_Name: pSphere1\n m_TagString: Untagged\n m_Icon: {fileID: 0}\n m_NavMeshLayer: 0\n m_StaticEditorFlags: 0\n m_IsActive: 1\n--- !u!1 &1207221346183892\nGameObject:\n m_ObjectHideFlags: 0\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n serializedVersion: 5\n m_Component:\n - component: {fileID: 4292920337357262}\n - component: {fileID: 114874453366772316}\n - component: {fileID: 114537197540792740}\n - component: {fileID: 54357640908494980}\n m_Layer: 0\n m_Name: ButtonBalloon\n m_TagString: Untagged\n m_Icon: {fileID: 0}\n m_NavMeshLayer: 0\n m_StaticEditorFlags: 0\n m_IsActive: 1\n--- !u!1 &1247598877563472\nGameObject:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n serializedVersion: 5\n m_Component:\n - component: {fileID: 4699699221017062}\n - component: {fileID: 33923112610764030}\n - component: {fileID: 23987754555849932}\n m_Layer: 0\n m_Name: pCone1\n m_TagString: Untagged\n m_Icon: {fileID: 0}\n m_NavMeshLayer: 0\n m_StaticEditorFlags: 0\n m_IsActive: 1\n--- !u!1 &1975736859843456\nGameObject:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n serializedVersion: 5\n m_Component:\n - component: {fileID: 4853275677113812}\n - component: {fileID: 33023875140711058}\n - component: {fileID: 23594847843911446}\n m_Layer: 0\n m_Name: pCylinder1\n m_TagString: Untagged\n m_Icon: {fileID: 0}\n m_NavMeshLayer: 0\n m_StaticEditorFlags: 0\n m_IsActive: 1\n--- !u!4 &4292920337357262\nTransform:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1207221346183892}\n m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}\n m_LocalPosition: {x: 0.087, y: -0.137, z: 2.32}\n m_LocalScale: {x: 1, y: 1, z: 1}\n m_Children:\n - {fileID: 4343207777919082}\n m_Father: {fileID: 0}\n m_RootOrder: 0\n m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n--- !u!4 &4343207777919082\nTransform:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1057321637562398}\n m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}\n m_LocalPosition: {x: 0, y: 0, z: 0}\n m_LocalScale: {x: 1, y: 1, z: 1}\n m_Children:\n - {fileID: 4699699221017062}\n - {fileID: 4853275677113812}\n - {fileID: 4347247677462242}\n m_Father: {fileID: 4292920337357262}\n m_RootOrder: 0\n m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n--- !u!4 &4347247677462242\nTransform:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1181849102071720}\n m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}\n m_LocalPosition: {x: 0, y: 0.1, z: 0}\n m_LocalScale: {x: 4, y: 4, z: 4}\n m_Children: []\n m_Father: {fileID: 4343207777919082}\n m_RootOrder: 2\n m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n--- !u!4 &4699699221017062\nTransform:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1247598877563472}\n m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}\n m_LocalPosition: {x: 0, y: 0.10026, z: 0}\n m_LocalScale: {x: 0.4779768, y: 0.47797668, z: 0.47797668}\n m_Children: []\n m_Father: {fileID: 4343207777919082}\n m_RootOrder: 0\n m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n--- !u!4 &4853275677113812\nTransform:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1975736859843456}\n m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}\n m_LocalPosition: {x: 0, y: 0.01990828, z: 0}\n m_LocalScale: {x: 0.044697683, y: 7.7405767, z: 0.044697672}\n m_Children: []\n m_Father: {fileID: 4343207777919082}\n m_RootOrder: 1\n m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n--- !u!23 &23067865308481886\nMeshRenderer:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1181849102071720}\n m_Enabled: 1\n m_CastShadows: 1\n m_ReceiveShadows: 1\n m_DynamicOccludee: 1\n m_MotionVectors: 1\n m_LightProbeUsage: 1\n m_ReflectionProbeUsage: 1\n m_Materials:\n - {fileID: 2100000, guid: 79faf1ee4d8eade4c9a79165a7e2711c, type: 2}\n m_StaticBatchInfo:\n firstSubMesh: 0\n subMeshCount: 0\n m_StaticBatchRoot: {fileID: 0}\n m_ProbeAnchor: {fileID: 0}\n m_LightProbeVolumeOverride: {fileID: 0}\n m_ScaleInLightmap: 1\n m_PreserveUVs: 0\n m_IgnoreNormalsForChartDetection: 0\n m_ImportantGI: 0\n m_StitchLightmapSeams: 0\n m_SelectedEditorRenderState: 3\n m_MinimumChartSize: 4\n m_AutoUVMaxDistance: 0.5\n m_AutoUVMaxAngle: 89\n m_LightmapParameters: {fileID: 0}\n m_SortingLayerID: 0\n m_SortingLayer: 0\n m_SortingOrder: 0\n--- !u!23 &23594847843911446\nMeshRenderer:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1975736859843456}\n m_Enabled: 1\n m_CastShadows: 1\n m_ReceiveShadows: 1\n m_DynamicOccludee: 1\n m_MotionVectors: 1\n m_LightProbeUsage: 1\n m_ReflectionProbeUsage: 1\n m_Materials:\n - {fileID: 2100000, guid: 596a09116b0e27248b289dd06bb6586f, type: 2}\n m_StaticBatchInfo:\n firstSubMesh: 0\n subMeshCount: 0\n m_StaticBatchRoot: {fileID: 0}\n m_ProbeAnchor: {fileID: 0}\n m_LightProbeVolumeOverride: {fileID: 0}\n m_ScaleInLightmap: 1\n m_PreserveUVs: 0\n m_IgnoreNormalsForChartDetection: 0\n m_ImportantGI: 0\n m_StitchLightmapSeams: 0\n m_SelectedEditorRenderState: 3\n m_MinimumChartSize: 4\n m_AutoUVMaxDistance: 0.5\n m_AutoUVMaxAngle: 89\n m_LightmapParameters: {fileID: 0}\n m_SortingLayerID: 0\n m_SortingLayer: 0\n m_SortingOrder: 0\n--- !u!23 &23987754555849932\nMeshRenderer:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1247598877563472}\n m_Enabled: 1\n m_CastShadows: 1\n m_ReceiveShadows: 1\n m_DynamicOccludee: 1\n m_MotionVectors: 1\n m_LightProbeUsage: 1\n m_ReflectionProbeUsage: 1\n m_Materials:\n - {fileID: 2100000, guid: 79faf1ee4d8eade4c9a79165a7e2711c, type: 2}\n m_StaticBatchInfo:\n firstSubMesh: 0\n subMeshCount: 0\n m_StaticBatchRoot: {fileID: 0}\n m_ProbeAnchor: {fileID: 0}\n m_LightProbeVolumeOverride: {fileID: 0}\n m_ScaleInLightmap: 1\n m_PreserveUVs: 0\n m_IgnoreNormalsForChartDetection: 0\n m_ImportantGI: 0\n m_StitchLightmapSeams: 0\n m_SelectedEditorRenderState: 3\n m_MinimumChartSize: 4\n m_AutoUVMaxDistance: 0.5\n m_AutoUVMaxAngle: 89\n m_LightmapParameters: {fileID: 0}\n m_SortingLayerID: 0\n m_SortingLayer: 0\n m_SortingOrder: 0\n--- !u!33 &33023875140711058\nMeshFilter:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1975736859843456}\n m_Mesh: {fileID: 4300004, guid: 54f72652009c7574a96c8d088d1c78ef, type: 3}\n--- !u!33 &33605781880135254\nMeshFilter:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1181849102071720}\n m_Mesh: {fileID: 4300000, guid: 54f72652009c7574a96c8d088d1c78ef, type: 3}\n--- !u!33 &33923112610764030\nMeshFilter:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1247598877563472}\n m_Mesh: {fileID: 4300002, guid: 54f72652009c7574a96c8d088d1c78ef, type: 3}\n--- !u!54 &54357640908494980\nRigidbody:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1207221346183892}\n serializedVersion: 2\n m_Mass: 1\n m_Drag: 0\n m_AngularDrag: 0.05\n m_UseGravity: 1\n m_IsKinematic: 1\n m_Interpolate: 0\n m_Constraints: 0\n m_CollisionDetection: 0\n--- !u!95 &95136127354012824\nAnimator:\n serializedVersion: 3\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1057321637562398}\n m_Enabled: 1\n m_Avatar: {fileID: 9000000, guid: 54f72652009c7574a96c8d088d1c78ef, type: 3}\n m_Controller: {fileID: 9100000, guid: 44ee23df6a9de3b4eafa8eb8424e8f65, type: 2}\n m_CullingMode: 0\n m_UpdateMode: 0\n m_ApplyRootMotion: 0\n m_LinearVelocityBlending: 0\n m_WarningMessage: \n m_HasTransformHierarchy: 1\n m_AllowConstantClipSamplingOptimization: 1\n--- !u!114 &114537197540792740\nMonoBehaviour:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1207221346183892}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: 11500000, guid: 728fec8e9feecf64f933543126cbecae, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n TargetAnimator: {fileID: 95136127354012824}\n AnimActions:\n - ButtonState: 0\n ParamName: State\n ParamType: 3\n BoolValue: 0\n IntValue: 0\n FloatValue: 0\n InvalidParam: 1\n - ButtonState: 1\n ParamName: State\n ParamType: 3\n BoolValue: 0\n IntValue: 1\n FloatValue: 0\n InvalidParam: 1\n - ButtonState: 2\n ParamName: State\n ParamType: 3\n BoolValue: 0\n IntValue: 2\n FloatValue: 0\n InvalidParam: 1\n - ButtonState: 3\n ParamName: State\n ParamType: 3\n BoolValue: 0\n IntValue: 3\n FloatValue: 0\n InvalidParam: 1\n - ButtonState: 4\n ParamName: State\n ParamType: 3\n BoolValue: 0\n IntValue: 4\n FloatValue: 0\n InvalidParam: 1\n - ButtonState: 5\n ParamName: State\n ParamType: 3\n BoolValue: 0\n IntValue: 5\n FloatValue: 0\n InvalidParam: 1\n--- !u!114 &114874453366772316\nMonoBehaviour:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1207221346183892}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: 11500000, guid: e77a98cf320fe9340a55eecfe4567ca4, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n ButtonState: 4\n ButtonPressFilter: 1\n RequireGaze: 1\n MainCollider: {fileID: 0}\n MainRenderer: {fileID: 0}\n--- !u!136 &136976847709920116\nCapsuleCollider:\n m_ObjectHideFlags: 1\n m_PrefabParentObject: {fileID: 0}\n m_PrefabInternal: {fileID: 100100000}\n m_GameObject: {fileID: 1057321637562398}\n m_Material: {fileID: 0}\n m_IsTrigger: 0\n m_Enabled: 1\n m_Radius: 0.05\n m_Height: 0.2\n m_Direction: 1\n m_Center: {x: 0, y: 0.1, z: 0}\n"} +{"text": "{\n \"state\": {\n \"_\": {\n \"off\": \"Neakt\\u00edvny\",\n \"on\": \"Akt\\u00edvny\"\n },\n \"battery\": {\n \"off\": \"Norm\\u00e1lna\",\n \"on\": \"Slab\\u00e1\"\n },\n \"cold\": {\n \"off\": \"Norm\\u00e1lny\",\n \"on\": \"Studen\\u00fd\"\n },\n \"connectivity\": {\n \"off\": \"Odpojen\\u00fd\",\n \"on\": \"Pripojen\\u00fd\"\n },\n \"door\": {\n \"off\": \"Zatvoren\\u00e9\",\n \"on\": \"Otvoren\\u00e9\"\n },\n \"garage_door\": {\n \"off\": \"Zatvoren\\u00e9\",\n \"on\": \"Otvoren\\u00e9\"\n },\n \"gas\": {\n \"off\": \"\\u017diadny plyn\",\n \"on\": \"Zachyten\\u00fd plyn\"\n },\n \"heat\": {\n \"off\": \"Norm\\u00e1lny\",\n \"on\": \"Hor\\u00faci\"\n },\n \"lock\": {\n \"off\": \"Zamknut\\u00fd\",\n \"on\": \"Odomknut\\u00fd\"\n },\n \"moisture\": {\n \"off\": \"Sucho\",\n \"on\": \"Vlhko\"\n },\n \"motion\": {\n \"off\": \"K\\u013eud\",\n \"on\": \"Pohyb\"\n },\n \"occupancy\": {\n \"off\": \"Vo\\u013en\\u00e9\",\n \"on\": \"Obsaden\\u00e9\"\n },\n \"opening\": {\n \"off\": \"Zatvoren\\u00e9\",\n \"on\": \"Otvoren\\u00e9\"\n },\n \"presence\": {\n \"off\": \"Pre\\u010d\",\n \"on\": \"Doma\"\n },\n \"problem\": {\n \"off\": \"OK\",\n \"on\": \"Probl\\u00e9m\"\n },\n \"safety\": {\n \"off\": \"Zabezpe\\u010den\\u00e9\",\n \"on\": \"Nezabezpe\\u010den\\u00e9\"\n },\n \"smoke\": {\n \"off\": \"\\u017diadny dym\",\n \"on\": \"Zachyten\\u00fd dym\"\n },\n \"sound\": {\n \"off\": \"Ticho\",\n \"on\": \"Zachyten\\u00fd zvuk\"\n },\n \"vibration\": {\n \"off\": \"K\\u013eud\",\n \"on\": \"Zachyten\\u00e9 vibr\\u00e1cie\"\n },\n \"window\": {\n \"off\": \"Zatvoren\\u00e9\",\n \"on\": \"Otvoren\\u00e9\"\n }\n },\n \"title\": \"Bin\\u00e1rny senzor\"\n}"} +{"text": "// Strange selector mirrors selector used in Bulma\n// https://github.com/jgthms/bulma/issues/912\n.tag:not(body) {\n text-transform: uppercase;\n border-radius: 200px;\n font-weight: $weight-normal;\n font-size: $size-7;\n line-height: 1;\n height: 1.5em;\n\n &.is-pending,\n &.is-light {\n background: $grey-blue;\n color: findColorInvert(darken($grey-blue, 10%));\n }\n\n &.is-running {\n background: $blue;\n color: $blue-invert;\n }\n\n &.is-primary {\n background: $primary;\n color: $primary-invert;\n }\n\n &.is-complete {\n background: $nomad-green-dark;\n color: findColorInvert($nomad-green-dark);\n }\n\n &.is-error {\n background: $danger;\n color: $danger-invert;\n }\n\n &.is-cancelled {\n background: $orange;\n color: $orange-invert;\n }\n\n &.is-hollow {\n font-weight: $weight-semibold;\n color: darken($grey-blue, 20%);\n background: transparent;\n }\n\n &.no-text-transform {\n text-transform: none;\n }\n\n &.is-outlined {\n box-shadow: 0 0 0 1px $white;\n }\n\n &.is-alone {\n padding: 0;\n margin-bottom: 1em;\n }\n\n &.is-small {\n font-size: 0.7rem;\n vertical-align: 2px;\n }\n}\n"} +{"text": "fileFormatVersion: 2\nguid: 63bd1b35e776e934baa717b2b0a1691d\nTextureImporter:\n fileIDToRecycleName: {}\n externalObjects: {}\n serializedVersion: 7\n mipmaps:\n mipMapMode: 0\n enableMipMap: 1\n sRGBTexture: 0\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 streamingMipmaps: 1\n streamingMipmapsPriority: 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: 4\n mipBias: -100\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 spritePixelsToUnits: 100\n spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n spriteGenerateFallbackPhysicsShape: 1\n alphaUsage: 1\n alphaIsTransparency: 0\n spriteTessellationDetail: -1\n textureType: 1\n textureShape: 1\n singleChannelComponent: 0\n maxTextureSizeSet: 0\n compressionQualitySet: 0\n textureFormatSet: 0\n platformSettings:\n - serializedVersion: 2\n buildTarget: DefaultTexturePlatform\n maxTextureSize: 2048\n resizeAlgorithm: 0\n textureFormat: -1\n textureCompression: 2\n compressionQuality: 50\n crunchedCompression: 0\n allowsAlphaSplitting: 0\n overridden: 0\n androidETC2FallbackOverride: 0\n - serializedVersion: 2\n buildTarget: Standalone\n maxTextureSize: 2048\n resizeAlgorithm: 0\n textureFormat: 27\n textureCompression: 2\n compressionQuality: 50\n crunchedCompression: 0\n allowsAlphaSplitting: 0\n overridden: 1\n androidETC2FallbackOverride: 0\n - serializedVersion: 2\n buildTarget: PS4\n maxTextureSize: 2048\n resizeAlgorithm: 0\n textureFormat: 27\n textureCompression: 2\n compressionQuality: 50\n crunchedCompression: 0\n allowsAlphaSplitting: 0\n overridden: 1\n androidETC2FallbackOverride: 0\n spriteSheet:\n serializedVersion: 2\n sprites: []\n outline: []\n physicsShape: []\n bones: []\n spriteID: \n vertices: []\n indices: \n edges: []\n weights: []\n spritePackingTag: \n pSDRemoveMatte: 0\n pSDShowRemoveMatteOption: 0\n userData: \n assetBundleName: \n assetBundleVariant: \n"} +{"text": "/*\n * Copyright (c) 2006-2018, RT-Thread Development Team\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Change Logs:\n * Date Author Notes\n */\n/* @(#)rpc_msg.h\t2.1 88/07/29 4.0 RPCSRC */\n/*\n * Sun RPC is a product of Sun Microsystems, Inc. and is provided for\n * unrestricted use provided that this legend is included on all tape\n * media and as a part of the software program in whole or part. Users\n * may copy or modify Sun RPC without charge, but are not authorized\n * to license or distribute it to anyone else except as part of a product or\n * program developed by the user.\n *\n * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE\n * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.\n *\n * Sun RPC is provided with no support and without any obligation on the\n * part of Sun Microsystems, Inc. to assist in its use, correction,\n * modification or enhancement.\n *\n * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE\n * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC\n * OR ANY PART THEREOF.\n *\n * In no event will Sun Microsystems, Inc. be liable for any lost revenue\n * or profits or other special, indirect and consequential damages, even if\n * Sun has been advised of the possibility of such damages.\n *\n * Sun Microsystems, Inc.\n * 2550 Garcia Avenue\n * Mountain View, California 94043\n */\n/* @(#)rpc_msg.h 1.7 86/07/16 SMI */\n\n#ifndef _RPC_MSG_H\n#define _RPC_MSG_H 1\n\n#include \n#include \n\n/*\n * rpc_msg.h\n * rpc message definition\n *\n * Copyright (C) 1984, Sun Microsystems, Inc.\n */\n\n#define RPC_MSG_VERSION\t\t((unsigned long) 2)\n#define RPC_SERVICE_PORT\t((unsigned short) 2048)\n\n/*\n * Bottom up definition of an rpc message.\n * NOTE: call and reply use the same overall struct but\n * different parts of unions within it.\n */\n\nenum msg_type {\n\tCALL=0,\n\tREPLY=1\n};\n\nenum reply_stat {\n\tMSG_ACCEPTED=0,\n\tMSG_DENIED=1\n};\n\nenum accept_stat {\n\tSUCCESS=0,\n\tPROG_UNAVAIL=1,\n\tPROG_MISMATCH=2,\n\tPROC_UNAVAIL=3,\n\tGARBAGE_ARGS=4,\n\tSYSTEM_ERR=5\n};\n\nenum reject_stat {\n\tRPC_MISMATCH=0,\n\tAUTH_ERROR=1\n};\n\n/*\n * Reply part of an rpc exchange\n */\n\n/*\n * Reply to an rpc request that was accepted by the server.\n * Note: there could be an error even though the request was\n * accepted.\n */\nstruct accepted_reply {\n\tstruct opaque_auth\tar_verf;\n\tint\t ar_stat;\n\tunion {\n\t\tstruct {\n\t\t\tunsigned long\tlow;\n\t\t\tunsigned long\thigh;\n\t\t} AR_versions;\n\t\tstruct {\n\t\t\tchar*\twhere;\n\t\t\txdrproc_t proc;\n\t\t} AR_results;\n\t\t/* and many other null cases */\n\t} ru;\n#define\tar_results\tru.AR_results\n#define\tar_vers\t\tru.AR_versions\n};\n\n/*\n * Reply to an rpc request that was rejected by the server.\n */\nstruct rejected_reply {\n\tint rj_stat;\n\tunion {\n\t\tstruct {\n\t\t\tunsigned long low;\n\t\t\tunsigned long high;\n\t\t} RJ_versions;\n\t\tint RJ_why; /* why authentication did not work */\n\t} ru;\n#define\trj_vers\tru.RJ_versions\n#define\trj_why\tru.RJ_why\n};\n\n/*\n * Body of a reply to an rpc request.\n */\nstruct reply_body {\n\tint rp_stat;\n\tunion {\n\t\tstruct accepted_reply RP_ar;\n\t\tstruct rejected_reply RP_dr;\n\t} ru;\n#define\trp_acpt\tru.RP_ar\n#define\trp_rjct\tru.RP_dr\n};\n\n/*\n * Body of an rpc request call.\n */\nstruct call_body {\n\tunsigned long cb_rpcvers;\t/* must be equal to two */\n\tunsigned long cb_prog;\n\tunsigned long cb_vers;\n\tunsigned long cb_proc;\n\tstruct opaque_auth cb_cred;\n\tstruct opaque_auth cb_verf; /* protocol specific - provided by client */\n};\n\n/*\n * The rpc message\n */\nstruct rpc_msg {\n\tunsigned long\trm_xid;\n\tint\t\t\t\trm_direction;\n\tunion {\n\t\tstruct call_body RM_cmb;\n\t\tstruct reply_body RM_rmb;\n\t} ru;\n#define\trm_call\t\tru.RM_cmb\n#define\trm_reply\tru.RM_rmb\n};\n#define\tacpted_rply\tru.RM_rmb.ru.RP_ar\n#define\trjcted_rply\tru.RM_rmb.ru.RP_dr\n\n\n/*\n * XDR routine to handle a rpc message.\n * xdr_callmsg(xdrs, cmsg)\n * \tXDR *xdrs;\n * \tstruct rpc_msg *cmsg;\n */\nextern bool_t\txdr_callmsg (XDR *__xdrs, struct rpc_msg *__cmsg);\n\n/*\n * XDR routine to pre-serialize the static part of a rpc message.\n * xdr_callhdr(xdrs, cmsg)\n * \tXDR *xdrs;\n * \tstruct rpc_msg *cmsg;\n */\nextern bool_t\txdr_callhdr (XDR *__xdrs, struct rpc_msg *__cmsg);\n\n/*\n * XDR routine to handle a rpc reply.\n * xdr_replymsg(xdrs, rmsg)\n * \tXDR *xdrs;\n * \tstruct rpc_msg *rmsg;\n */\nextern bool_t\txdr_replymsg (XDR *__xdrs, struct rpc_msg *__rmsg);\n\n/*\n * Fills in the error part of a reply message.\n * _seterr_reply(msg, error)\n * \tstruct rpc_msg *msg;\n * \tstruct rpc_err *error;\n */\nextern void\t_seterr_reply (struct rpc_msg *__msg, struct rpc_err *__error);\n\n#endif /* rpc/rpc_msg.h */\n"} +{"text": "\n\n\n<roundcube:object name=\"pagetitle\" />\n\n\n\n\n\n
    \n\n
    \n \n

    \n
    \n

    \n
    \n\n\n\n"} +{"text": "{-# LANGUAGE Trustworthy #-}\n{-# LANGUAGE NoImplicitPrelude\n , BangPatterns\n , NondecreasingIndentation\n #-}\n{-# OPTIONS_GHC -funbox-strict-fields #-}\n\n-----------------------------------------------------------------------------\n-- |\n-- Module : GHC.IO.Encoding.Latin1\n-- Copyright : (c) The University of Glasgow, 2009\n-- License : see libraries/base/LICENSE\n-- \n-- Maintainer : libraries@haskell.org\n-- Stability : internal\n-- Portability : non-portable\n--\n-- Single-byte encodings that map directly to Unicode code points.\n--\n-- Portions Copyright : (c) Tom Harper 2008-2009,\n-- (c) Bryan O'Sullivan 2009,\n-- (c) Duncan Coutts 2009\n--\n-----------------------------------------------------------------------------\n\nmodule GHC.IO.Encoding.Latin1 (\n latin1, mkLatin1,\n latin1_checked, mkLatin1_checked,\n ascii, mkAscii,\n latin1_decode,\n ascii_decode,\n latin1_encode,\n latin1_checked_encode,\n ascii_encode,\n ) where\n\nimport GHC.Base\nimport GHC.Real\nimport GHC.Num\n-- import GHC.IO\nimport GHC.IO.Buffer\nimport GHC.IO.Encoding.Failure\nimport GHC.IO.Encoding.Types\n\n-- -----------------------------------------------------------------------------\n-- Latin1\n\nlatin1 :: TextEncoding\nlatin1 = mkLatin1 ErrorOnCodingFailure\n\n-- | @since 4.4.0.0\nmkLatin1 :: CodingFailureMode -> TextEncoding\nmkLatin1 cfm = TextEncoding { textEncodingName = \"ISO-8859-1\",\n mkTextDecoder = latin1_DF cfm,\n mkTextEncoder = latin1_EF cfm }\n\nlatin1_DF :: CodingFailureMode -> IO (TextDecoder ())\nlatin1_DF cfm =\n return (BufferCodec {\n encode = latin1_decode,\n recover = recoverDecode cfm,\n close = return (),\n getState = return (),\n setState = const $ return ()\n })\n\nlatin1_EF :: CodingFailureMode -> IO (TextEncoder ())\nlatin1_EF cfm =\n return (BufferCodec {\n encode = latin1_encode,\n recover = recoverEncode cfm,\n close = return (),\n getState = return (),\n setState = const $ return ()\n })\n\nlatin1_checked :: TextEncoding\nlatin1_checked = mkLatin1_checked ErrorOnCodingFailure\n\n-- | @since 4.4.0.0\nmkLatin1_checked :: CodingFailureMode -> TextEncoding\nmkLatin1_checked cfm = TextEncoding { textEncodingName = \"ISO-8859-1\",\n mkTextDecoder = latin1_DF cfm,\n mkTextEncoder = latin1_checked_EF cfm }\n\nlatin1_checked_EF :: CodingFailureMode -> IO (TextEncoder ())\nlatin1_checked_EF cfm =\n return (BufferCodec {\n encode = latin1_checked_encode,\n recover = recoverEncode cfm,\n close = return (),\n getState = return (),\n setState = const $ return ()\n })\n\n-- -----------------------------------------------------------------------------\n-- ASCII\n\n-- | @since 4.9.0.0\nascii :: TextEncoding\nascii = mkAscii ErrorOnCodingFailure\n\n-- | @since 4.9.0.0\nmkAscii :: CodingFailureMode -> TextEncoding\nmkAscii cfm = TextEncoding { textEncodingName = \"ASCII\",\n mkTextDecoder = ascii_DF cfm,\n mkTextEncoder = ascii_EF cfm }\n\nascii_DF :: CodingFailureMode -> IO (TextDecoder ())\nascii_DF cfm =\n return (BufferCodec {\n encode = ascii_decode,\n recover = recoverDecode cfm,\n close = return (),\n getState = return (),\n setState = const $ return ()\n })\n\nascii_EF :: CodingFailureMode -> IO (TextEncoder ())\nascii_EF cfm =\n return (BufferCodec {\n encode = ascii_encode,\n recover = recoverEncode cfm,\n close = return (),\n getState = return (),\n setState = const $ return ()\n })\n\n\n\n-- -----------------------------------------------------------------------------\n-- The actual decoders and encoders\n\n-- TODO: Eliminate code duplication between the checked and unchecked\n-- versions of the decoder or encoder (but don't change the Core!)\n\nlatin1_decode :: DecodeBuffer\nlatin1_decode \n input@Buffer{ bufRaw=iraw, bufL=ir0, bufR=iw, bufSize=_ }\n output@Buffer{ bufRaw=oraw, bufL=_, bufR=ow0, bufSize=os }\n = let \n loop !ir !ow\n | ow >= os = done OutputUnderflow ir ow\n | ir >= iw = done InputUnderflow ir ow\n | otherwise = do\n c0 <- readWord8Buf iraw ir\n ow' <- writeCharBuf oraw ow (unsafeChr (fromIntegral c0))\n loop (ir+1) ow'\n\n -- lambda-lifted, to avoid thunks being built in the inner-loop:\n done why !ir !ow = return (why,\n if ir == iw then input{ bufL=0, bufR=0 }\n else input{ bufL=ir },\n output{ bufR=ow })\n in\n loop ir0 ow0\n\nascii_decode :: DecodeBuffer\nascii_decode\n input@Buffer{ bufRaw=iraw, bufL=ir0, bufR=iw, bufSize=_ }\n output@Buffer{ bufRaw=oraw, bufL=_, bufR=ow0, bufSize=os }\n = let\n loop !ir !ow\n | ow >= os = done OutputUnderflow ir ow\n | ir >= iw = done InputUnderflow ir ow\n | otherwise = do\n c0 <- readWord8Buf iraw ir\n if c0 > 0x7f then invalid else do\n ow' <- writeCharBuf oraw ow (unsafeChr (fromIntegral c0))\n loop (ir+1) ow'\n where\n invalid = done InvalidSequence ir ow\n\n -- lambda-lifted, to avoid thunks being built in the inner-loop:\n done why !ir !ow = return (why,\n if ir == iw then input{ bufL=0, bufR=0 }\n else input{ bufL=ir },\n output{ bufR=ow })\n in\n loop ir0 ow0\n\nlatin1_encode :: EncodeBuffer\nlatin1_encode\n input@Buffer{ bufRaw=iraw, bufL=ir0, bufR=iw, bufSize=_ }\n output@Buffer{ bufRaw=oraw, bufL=_, bufR=ow0, bufSize=os }\n = let\n done why !ir !ow = return (why,\n if ir == iw then input{ bufL=0, bufR=0 }\n else input{ bufL=ir },\n output{ bufR=ow })\n loop !ir !ow\n | ow >= os = done OutputUnderflow ir ow\n | ir >= iw = done InputUnderflow ir ow\n | otherwise = do\n (c,ir') <- readCharBuf iraw ir\n writeWord8Buf oraw ow (fromIntegral (ord c))\n loop ir' (ow+1)\n in\n loop ir0 ow0\n\nlatin1_checked_encode :: EncodeBuffer\nlatin1_checked_encode input output\n = single_byte_checked_encode 0xff input output\n\nascii_encode :: EncodeBuffer\nascii_encode input output\n = single_byte_checked_encode 0x7f input output\n\nsingle_byte_checked_encode :: Int -> EncodeBuffer\nsingle_byte_checked_encode max_legal_char\n input@Buffer{ bufRaw=iraw, bufL=ir0, bufR=iw, bufSize=_ }\n output@Buffer{ bufRaw=oraw, bufL=_, bufR=ow0, bufSize=os }\n = let\n done why !ir !ow = return (why,\n if ir == iw then input{ bufL=0, bufR=0 }\n else input{ bufL=ir },\n output{ bufR=ow })\n loop !ir !ow\n | ow >= os = done OutputUnderflow ir ow\n | ir >= iw = done InputUnderflow ir ow\n | otherwise = do\n (c,ir') <- readCharBuf iraw ir\n if ord c > max_legal_char then invalid else do\n writeWord8Buf oraw ow (fromIntegral (ord c))\n loop ir' (ow+1)\n where\n invalid = done InvalidSequence ir ow\n in\n loop ir0 ow0\n{-# INLINE single_byte_checked_encode #-}\n"} +{"text": "# begin crush map\ntunable choose_local_tries 0\ntunable choose_local_fallback_tries 0\ntunable choose_total_tries 50\ntunable chooseleaf_descend_once 1\ntunable straw_calc_version 1\n\n# devices\ndevice 0 osd.0\n\n# types\ntype 0 osd\ntype 1 host\ntype 2 chassis\ntype 3 rack\ntype 4 row\ntype 5 pdu\ntype 6 pod\ntype 7 room\ntype 8 datacenter\ntype 9 region\ntype 10 root\n\n# buckets\nhost vagrant-ubuntu-trusty-64 {\n id -2 # do not change unnecessarily\n # weight 0.038\n alg straw\n hash 0 # rjenkins1\n item osd.0 weight 0.038\n}\nroot default {\n id -1 # do not change unnecessarily\n # weight 0.038\n alg straw\n hash 0 # rjenkins1\n item vagrant-ubuntu-trusty-64 weight 0.038\n}\n\n# rules\nrule replicated_ruleset {\n ruleset 0\n type replicated\n min_size 1\n max_size 10\n step take default\n step chooseleaf firstn 0 type host\n step emit\n}\nrule racky {\n ruleset 1\n type replicated\n min_size 1\n max_size 10\n step take default\n step chooseleaf firstn 0 type rack\n step emit\n}\n\n# end crush map\n"} +{"text": "% 高度なリンキング\n\n\n\n\n\n\nRustにおけるリンクの一般的なケースについては本書の前の方で説明しましたが、他言語から利用できるような幅広いリンクをサポートすることは、ネイティブライブラリとのシームレスな相互利用を実現するために、Rustにとって重要です。\n\n\n# リンク引数\n\n\n\n\n\nどのようにリンクをカスタマイズするかを `rustc` に指示するために、1つの方法があります。それは、 `link_args` アトリビュートを使うことです。\nこのアトリビュートは `extern` ブロックに適用され、生成物を作るときにリンカに渡したいフラグをそのまま指定します。\n使い方の例は次のようになります。\n\n``` no_run\n#![feature(link_args)]\n\n#[link_args = \"-foo -bar -baz\"]\nextern {}\n# fn main() {}\n```\n\n\n\n\n\n\n\n\n\nこれはリンクを実行するための認められた方法ではないため、この機能は現在 `feature(link_args)` ゲートによって隠されているということに注意しましょう。\n今は `rustc` がシステムリンカ(多くのシステムでは `gcc` 、MSVCでは `link.exe` )に渡すので、追加のコマンドライン引数を提供することには意味がありますが、それが今後もそうだとは限りません。\n将来、 `rustc` がネイティブライブラリをリンクするためにLLVMを直接使うようになるかもしれませんし、そのような場合には `link_args` は意味がなくなるでしょう。\n`rustc` に `-C link-args` 引数をつけることで、 `link_args` アトリビュートと同じような効果を得ることができます。\n\n\n\nこのアトリビュートは使わ *ない* ことが強く推奨されているので、代わりにもっと正式な `#[link(...)]` アトリビュートを `extern` ブロックに使いましょう。\n\n\n# スタティック��ンク\n\n\n\n\n\n\n\n\nスタティックリンクとは全ての必要なライブラリを含めた成果物を生成する手順のことで、そうすればコンパイルされたプロジェクトを使いたいシステム全てにライブラリをインストールする必要がなくなります。\nRustのみで構築された依存関係はデフォルトでスタティックリンクされます。そのため、Rustをインストールしなくても、作成されたバイナリやライブラリを使うことができます。\n対照的に、ネイティブライブラリ(例えば `libc` や `libm` )はダイナミックリンクされるのが普通です。しかし、これを変更してそれらを同様にスタティックリンクすることも可能です。\n\n\n\n\nリンクは非常にプラットフォームに依存した話題であり、スタティックリンクのできないプラットフォームすらあるかもしれません!\nこのセクションは選んだプラットフォームにおけるリンクについての基本が理解できていることを前提とします。\n\n\n## Linux\n\n\n\n\nデフォルトでは、Linux上の全てのRustのプログラムはシステムの `libc` とその他のいくつものライブラリとリンクされます。\nGCCと `glibc` (Linuxにおける最も一般的な `libc` )を使った64ビットLinuxマシンでの例を見てみましょう。\n\n``` text\n$ cat example.rs\nfn main() {}\n$ rustc example.rs\n$ ldd example\n linux-vdso.so.1 => (0x00007ffd565fd000)\n libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa81889c000)\n libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa81867e000)\n librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fa818475000)\n libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa81825f000)\n libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa817e9a000)\n /lib64/ld-linux-x86-64.so.2 (0x00007fa818cf9000)\n libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa817b93000)\n```\n\n\n\n\n古いシステムで新しいライブラリの機能を使いたいときや、実行するプログラムに必要な依存関係を満たさないシステムをターゲットにしたいときは、Linuxにおけるダイナミックリンクは望ましくないかもしれません。\n\n\n\n\nスタティックリンクは代わりの `libc` である [`musl`](http://www.musl-libc.org/) によってサポートされています。\n以下の手順に従い、 `musl` を有効にした独自バージョンのRustをコンパイルして独自のディレクトリにインストールすることができます。\n\n```text\n$ mkdir musldist\n$ PREFIX=$(pwd)/musldist\n$\n$ # Build musl\n$ curl -O http://www.musl-libc.org/releases/musl-1.1.10.tar.gz\n$ tar xf musl-1.1.10.tar.gz\n$ cd musl-1.1.10/\nmusl-1.1.10 $ ./configure --disable-shared --prefix=$PREFIX\nmusl-1.1.10 $ make\nmusl-1.1.10 $ make install\nmusl-1.1.10 $ cd ..\n$ du -h musldist/lib/libc.a\n2.2M musldist/lib/libc.a\n$\n$ # Build libunwind.a\n$ curl -O http://llvm.org/releases/3.7.0/llvm-3.7.0.src.tar.xz\n$ tar xf llvm-3.7.0.src.tar.xz\n$ cd llvm-3.7.0.src/projects/\nllvm-3.7.0.src/projects $ curl http://llvm.org/releases/3.7.0/libunwind-3.7.0.src.tar.xz | tar xJf -\nllvm-3.7.0.src/projects $ mv libunwind-3.7.0.src libunwind\nllvm-3.7.0.src/projects $ mkdir libunwind/build\nllvm-3.7.0.src/projects $ cd libunwind/build\nllvm-3.7.0.src/projects/libunwind/build $ cmake -DLLVM_PATH=../../.. -DLIBUNWIND_ENABLE_SHARED=0 ..\nllvm-3.7.0.src/projects/libunwind/build $ make\nllvm-3.7.0.src/projects/libunwind/build $ cp lib/libunwind.a $PREFIX/lib/\nllvm-3.7.0.src/projects/libunwind/build $ cd ../../../../\n$ du -h musldist/lib/libunwind.a\n164K musldist/lib/libunwind.a\n$\n$ # Build musl-enabled rust\n$ git clone https://github.com/rust-lang/rust.git muslrust\n$ cd muslrust\nmuslrust $ ./configure --target=x86_64-unknown-linux-musl --musl-root=$PREFIX --prefix=$PREFIX\nmuslrust $ make\nmuslrust $ make install\nmuslrust $ cd ..\n$ du -h musldist/bin/rustc\n12K musldist/bin/rustc\n```\n\n\n\n\nこれで `musl` が有効になったRustのビルドが手に入りました!\n独自のプレフィックスを付けてインストールしたので、試しに実行するときにはシステムがバイナリと適切なライブラリを見付けられることを確かめなければなりません。\n\n```text\n$ export PATH=$PREFIX/bin:$PATH\n$ export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH\n```\n\n\n試してみましょう!\n\n```text\n$ echo 'fn main() { println!(\"hi!\"); panic!(\"failed\"); }' > example.rs\n$ rustc --target=x86_64-unknown-linux-musl example.rs\n$ ldd example\n not a dynamic executable\n$ ./example\nhi!\nthread '
    ' panicked at 'failed', example.rs:1\n```\n\n\n\n成功しました!\nこのバイナリは同じマシンアーキテクチャであればほとんど全てのLinuxマシンにコピーして問題なく実行することができます。\n\n\n\n\n`cargo build` も `--target` オプションを受け付けるので、あなたのクレートも普通にビルドできるはずです。\nただし、リンクする前にネイティブライブラリを `musl` 向けにリコンパイルする必要はあるかもしれません。\n"} +{"text": "/*-\n * See the file LICENSE for redistribution information.\n *\n * Copyright (c) 2000, 2015 Oracle and/or its affiliates. All rights reserved.\n *\n */\n\npackage com.sleepycat.collections;\n\nimport java.util.Comparator;\nimport java.util.SortedMap;\n\nimport com.sleepycat.bind.EntityBinding;\nimport com.sleepycat.bind.EntryBinding;\nimport com.sleepycat.db.Database;\nimport com.sleepycat.db.OperationStatus;\nimport com.sleepycat.util.RuntimeExceptionWrapper;\n\n/**\n * A SortedMap view of a {@link Database}.\n *\n *

    In addition to the standard SortedMap methods, this class provides the\n * following methods for stored sorted maps only. Note that the use of these\n * methods is not compatible with the standard Java collections interface.

    \n *
      \n *
    • {@link #headMap(Object, boolean)}
    • \n *
    • {@link #tailMap(Object, boolean)}
    • \n *
    • {@link #subMap(Object, boolean, Object, boolean)}
    • \n *
    \n *\n * @author Mark Hayes\n */\npublic class StoredSortedMap\n extends StoredMap\n implements SortedMap {\n\n /**\n * Creates a sorted map view of a {@link Database}.\n *\n * @param database is the Database underlying the new collection.\n *\n * @param keyBinding is the binding used to translate between key buffers\n * and key objects.\n *\n * @param valueBinding is the binding used to translate between value\n * buffers and value objects.\n *\n * @param writeAllowed is true to create a read-write collection or false\n * to create a read-only collection.\n *\n * @throws IllegalArgumentException if formats are not consistently\n * defined or a parameter is invalid.\n *\n * @throws RuntimeExceptionWrapper if a checked exception is thrown,\n * including a {@code DatabaseException} on BDB (C edition).\n */\n public StoredSortedMap(Database database,\n EntryBinding keyBinding,\n EntryBinding valueBinding,\n boolean writeAllowed) {\n\n super(new DataView(database, keyBinding, valueBinding, null,\n writeAllowed, null));\n }\n\n /**\n * Creates a sorted map view of a {@link Database} with a {@link\n * PrimaryKeyAssigner}. Writing is allowed for the created map.\n *\n * @param database is the Database underlying the new collection.\n *\n * @param keyBinding is the binding used to translate between key buffers\n * and key objects.\n *\n * @param valueBinding is the binding used to translate between value\n * buffers and value objects.\n *\n * @param keyAssigner is used by the {@link #append} method to assign\n * primary keys.\n *\n * @throws IllegalArgumentException if formats are not consistently\n * defined or a parameter is invalid.\n *\n * @throws RuntimeExceptionWrapper if a checked exception is thrown,\n * including a {@code DatabaseException} on BDB (C edition).\n */\n public StoredSortedMap(Database database,\n EntryBinding keyBinding,\n EntryBinding valueBinding,\n PrimaryKeyAssigner keyAssigner) {\n\n super(new DataView(database, keyBinding, valueBinding, null,\n true, keyAssigner));\n }\n\n /**\n * Creates a sorted map entity view of a {@link Database}.\n *\n * @param database is the Database underlying the new collection.\n *\n * @param keyBinding is the binding used to translate between key buffers\n * and key objects.\n *\n * @param valueEntityBinding is the binding used to translate between\n * key/value buffers and entity value objects.\n *\n * @param writeAllowed is true to create a read-write collection or false\n * to create a read-only collection.\n *\n * @throws IllegalArgumentException if formats are not consistently\n * defined or a parameter is invalid.\n *\n * @throws RuntimeExceptionWrapper if a checked exception is thrown,\n * including a {@code DatabaseException} on BDB (C edition).\n */\n public StoredSortedMap(Database database,\n EntryBinding keyBinding,\n EntityBinding valueEntityBinding,\n boolean writeAllowed) {\n\n super(new DataView(database, keyBinding, null, valueEntityBinding,\n writeAllowed, null));\n }\n\n /**\n * Creates a sorted map entity view of a {@link Database} with a {@link\n * PrimaryKeyAssigner}. Writing is allowed for the created map.\n *\n * @param database is the Database underlying the new collection.\n *\n * @param keyBinding is the binding used to translate between key buffers\n * and key objects.\n *\n * @param valueEntityBinding is the binding used to translate between\n * key/value buffers and entity value objects.\n *\n * @param keyAssigner is used by the {@link #append} method to assign\n * primary keys.\n *\n * @throws IllegalArgumentException if formats are not consistently\n * defined or a parameter is invalid.\n *\n * @throws RuntimeExceptionWrapper if a checked exception is thrown,\n * including a {@code DatabaseException} on BDB (C edition).\n */\n public StoredSortedMap(Database database,\n EntryBinding keyBinding,\n EntityBinding valueEntityBinding,\n PrimaryKeyAssigner keyAssigner) {\n\n super(new DataView(database, keyBinding, null, valueEntityBinding,\n true, keyAssigner));\n }\n\n StoredSortedMap(DataView mapView) {\n\n super(mapView);\n }\n\n /**\n * Returns null since comparators are not supported. The natural ordering\n * of a stored collection is data byte order, whether the data classes\n * implement the {@link java.lang.Comparable} interface or not.\n * This method does not conform to the {@link SortedMap#comparator}\n * interface.\n *\n * @return null.\n */\n public Comparator comparator() {\n\n return null;\n }\n\n /**\n * Returns the first (lowest) key currently in this sorted map.\n * This method conforms to the {@link SortedMap#firstKey} interface.\n *\n * @return the first key.\n *\n *\n * @throws RuntimeExceptionWrapper if a checked exception is thrown,\n * including a {@code DatabaseException} on BDB (C edition).\n */\n public K firstKey() {\n\n return getFirstOrLastKey(true);\n }\n\n /**\n * Returns the last (highest) element currently in this sorted map.\n * This method conforms to the {@link SortedMap#lastKey} interface.\n *\n * @return the last key.\n *\n *\n * @throws RuntimeExceptionWrapper if a checked exception is thrown,\n * including a {@code DatabaseException} on BDB (C edition).\n */\n public K lastKey() {\n\n return getFirstOrLastKey(false);\n }\n\n private K getFirstOrLastKey(boolean doGetFirst) {\n\n DataCursor cursor = null;\n try {\n cursor = new DataCursor(view, false);\n OperationStatus status;\n if (doGetFirst) {\n status = cursor.getFirst(false);\n } else {\n status = cursor.getLast(false);\n }\n return (K) ((status == OperationStatus.SUCCESS) ?\n cursor.getCurrentKey() :\n null);\n } catch (Exception e) {\n throw StoredContainer.convertException(e);\n } finally {\n closeCursor(cursor);\n }\n }\n\n /**\n * Returns a view of the portion of this sorted set whose keys are\n * strictly less than toKey.\n * This method conforms to the {@link SortedMap#headMap} interface.\n *\n *

    Note that the return value is a StoredStoredMap and must be treated\n * as such; for example, its iterators must be explicitly closed.

    \n *\n * @param toKey is the upper bound.\n *\n * @return the submap.\n *\n * @throws RuntimeExceptionWrapper if a checked exception is thrown,\n * including a {@code DatabaseException} on BDB (C edition).\n */\n public SortedMap headMap(K toKey) {\n\n return subMap(null, false, toKey, false);\n }\n\n /**\n * Returns a view of the portion of this sorted map whose elements are\n * strictly less than toKey, optionally including toKey.\n * This method does not exist in the standard {@link SortedMap} interface.\n *\n *

    Note that the return value is a StoredStoredMap and must be treated\n * as such; for example, its iterators must be explicitly closed.

    \n *\n * @param toKey is the upper bound.\n *\n * @param toInclusive is true to include toKey.\n *\n * @return the submap.\n *\n * @throws RuntimeExceptionWrapper if a checked exception is thrown,\n * including a {@code DatabaseException} on BDB (C edition).\n */\n public SortedMap headMap(K toKey, boolean toInclusive) {\n\n return subMap(null, false, toKey, toInclusive);\n }\n\n /**\n * Returns a view of the portion of this sorted map whose elements are\n * greater than or equal to fromKey.\n * This method conforms to the {@link SortedMap#tailMap} interface.\n *\n *

    Note that the return value is a StoredStoredMap and must be treated\n * as such; for example, its iterators must be explicitly closed.

    \n *\n * @param fromKey is the lower bound.\n *\n * @return the submap.\n *\n * @throws RuntimeExceptionWrapper if a checked exception is thrown,\n * including a {@code DatabaseException} on BDB (C edition).\n */\n public SortedMap tailMap(K fromKey) {\n\n return subMap(fromKey, true, null, false);\n }\n\n /**\n * Returns a view of the portion of this sorted map whose elements are\n * strictly greater than fromKey, optionally including fromKey.\n * This method does not exist in the standard {@link SortedMap} interface.\n *\n *

    Note that the return value is a StoredStoredMap and must be treated\n * as such; for example, its iterators must be explicitly closed.

    \n *\n * @param fromKey is the lower bound.\n *\n * @param fromInclusive is true to include fromKey.\n *\n * @return the submap.\n *\n * @throws RuntimeExceptionWrapper if a checked exception is thrown,\n * including a {@code DatabaseException} on BDB (C edition).\n */\n public SortedMap tailMap(K fromKey, boolean fromInclusive) {\n\n return subMap(fromKey, fromInclusive, null, false);\n }\n\n /**\n * Returns a view of the portion of this sorted map whose elements range\n * from fromKey, inclusive, to toKey, exclusive.\n * This method conforms to the {@link SortedMap#subMap} interface.\n *\n *

    Note that the return value is a StoredStoredMap and must be treated\n * as such; for example, its iterators must be explicitly closed.

    \n *\n * @param fromKey is the lower bound.\n *\n * @param toKey is the upper bound.\n *\n * @return the submap.\n *\n * @throws RuntimeExceptionWrapper if a checked exception is thrown,\n * including a {@code DatabaseException} on BDB (C edition).\n */\n public SortedMap subMap(K fromKey, K toKey) {\n\n return subMap(fromKey, true, toKey, false);\n }\n\n /**\n * Returns a view of the portion of this sorted map whose elements are\n * strictly greater than fromKey and strictly less than toKey,\n * optionally including fromKey and toKey.\n * This method does not exist in the standard {@link SortedMap} interface.\n *\n *

    Note that the return value is a StoredStoredMap and must be treated\n * as such; for example, its iterators must be explicitly closed.

    \n *\n * @param fromKey is the lower bound.\n *\n * @param fromInclusive is true to include fromKey.\n *\n * @param toKey is the upper bound.\n *\n * @param toInclusive is true to include toKey.\n *\n * @return the submap.\n *\n * @throws RuntimeExceptionWrapper if a checked exception is thrown,\n * including a {@code DatabaseException} on BDB (C edition).\n */\n public SortedMap subMap(K fromKey,\n boolean fromInclusive,\n K toKey,\n boolean toInclusive) {\n try {\n return new StoredSortedMap(\n view.subView(fromKey, fromInclusive, toKey, toInclusive, null));\n } catch (Exception e) {\n throw StoredContainer.convertException(e);\n }\n }\n}\n"} +{"text": "/**\r\n * Copyright 2013-2019 the original author or authors from the Jeddict project (https://jeddict.github.io/).\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\r\n * use this file except in compliance with the License. You may obtain a copy of\r\n * 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, WITHOUT\r\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r\n * License for the specific language governing permissions and limitations under\r\n * the License.\r\n */\r\npackage io.github.jeddict.orm.generator.compiler.constraints;\r\n\r\nimport io.github.jeddict.bv.constraints.Size;\r\nimport io.github.jeddict.orm.generator.compiler.InvalidDataException;\r\nimport static io.github.jeddict.orm.generator.util.ORMConverterUtil.AT;\r\nimport static io.github.jeddict.orm.generator.util.ORMConverterUtil.CLOSE_PARANTHESES;\r\nimport static io.github.jeddict.orm.generator.util.ORMConverterUtil.OPEN_PARANTHESES;\r\nimport static io.github.jeddict.util.StringUtils.isBlank;\r\n\r\n/**\r\n *\r\n * @author Gaurav Gupta\r\n */\r\npublic class SizeSnippet extends ConstraintSnippet {\r\n\r\n public SizeSnippet(Size size) {\r\n super(size);\r\n }\r\n\r\n @Override\r\n protected String getAPI() {\r\n return \"Size\";\r\n }\r\n\r\n @Override\r\n public String getSnippet() throws InvalidDataException {\r\n StringBuilder builder = new StringBuilder(AT);\r\n builder.append(getAPI());\r\n\r\n if (isBlank(constraint.getMessage())\r\n && isBlank(constraint.getMin())\r\n && isBlank(constraint.getMax())) {\r\n return builder.toString();\r\n }\r\n\r\n builder.append(OPEN_PARANTHESES)\r\n .append(attributeExp(\"min\", constraint.getMin()))\r\n .append(attributeExp(\"max\", constraint.getMax()))\r\n .append(attribute(\"message\", constraint.getMessage()));\r\n\r\n return builder.substring(0, builder.length() - 1) + CLOSE_PARANTHESES;\r\n }\r\n\r\n}\r\n"} +{"text": "import { mountUseStyles } from '@airbnb/lunar-test-utils';\nimport transformer from '../../../src/components/Interweave/factories/transformer';\nimport Link from '../../../src/components/Link';\n\ndescribe('transformer()', () => {\n it('replaces a tag with a link', () => {\n const a = document.createElement('a');\n a.setAttribute('href', 'http://airbnb.com');\n\n // @ts-ignore Need to fix types upstream\n const wrapper = mountUseStyles(transformer(a, 'Airbnb'));\n\n expect(wrapper.find(Link)).toHaveLength(1);\n });\n\n it('uses text content as children', () => {\n const a = document.createElement('a');\n a.setAttribute('href', 'http://airbnb.com');\n a.textContent = 'Children';\n\n // @ts-ignore Need to fix types upstream\n const wrapper = mountUseStyles(transformer(a, []));\n\n expect(wrapper.find(Link).prop('children')).toBe('Children');\n });\n\n it('does nothing for unknown element', () => {\n expect(transformer(document.createElement('div'), [])).toBeUndefined();\n });\n});\n"} +{"text": ";/*++\r\n;\r\n;Copyright (c) 1995-1997 Microsoft Corporation\r\n;\r\n;Module Name:\r\n;\r\n; urlmon.mc\r\n;\r\n;Abstract:\r\n;\r\n; Contains internationalizable message text for URLMON DLL error codes\r\n;\r\n;--*/\r\n\r\n; AS: Why are the severity names nonstandard (as per winerror.h?)\r\n; Take out to use default. \r\nSeverityNames=(\r\n CoError=0x2\r\n )\r\n \r\nFacilityNames=(Internet=0xc:FACILITY_INTERNET\r\n CodeDownload=0xb:FACILITY_CODE_DOWNLOAD\r\n )\r\n\r\n;// \r\n;// \r\n;// WinINet and protocol specific errors are mapped to one of the following \r\n;// error which are returned in IBSC::OnStopBinding \r\n;// \r\n;// \r\n\r\nMessageId=0x2 Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_INVALID_URL\r\nLanguage=English\r\nThe URL is invalid.\r\n.\r\n\r\nMessageId=0x3 Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_NO_SESSION\r\nLanguage=English\r\nNo Internet session has been established.\r\n.\r\n\r\nMessageId=0x4 Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_CANNOT_CONNECT\r\nLanguage=English\r\nUnable to connect to the target server.\r\n.\r\n\r\nMessageId=0x5 Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_RESOURCE_NOT_FOUND\r\nLanguage=English\r\nThe system cannot locate the resource specified.\r\n.\r\n\r\nMessageId=0x6 Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_OBJECT_NOT_FOUND\r\nLanguage=English\r\nThe system cannot locate the object specified.\r\n.\r\n\r\nMessageId=0x7 Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_DATA_NOT_AVAILABLE\r\nLanguage=English\r\nNo data is available for the requested resource.\r\n.\r\n\r\nMessageId=0x8 Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_DOWNLOAD_FAILURE\r\nLanguage=English\r\nThe download of the specified resource has failed.\r\n.\r\n\r\nMessageId=0x9 Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_AUTHENTICATION_REQUIRED\r\nLanguage=English\r\nAuthentication is required to access this resource.\r\n.\r\n\r\nMessageId=0xA Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_NO_VALID_MEDIA\r\nLanguage=English\r\nThe server could not recognize the provided mime type.\r\n.\r\n\r\nMessageId=0xB Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_CONNECTION_TIMEOUT\r\nLanguage=English\r\nThe operation was timed out.\r\n.\r\n\r\nMessageId=0xC Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_INVALID_REQUEST\r\nLanguage=English\r\nThe server did not understand the request, or the request was invalid.\r\n.\r\n\r\nMessageId=0xD Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_UNKNOWN_PROTOCOL\r\nLanguage=English\r\nThe specified protocol is unknown.\r\n.\r\n\r\nMessageId=0xE Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_SECURITY_PROBLEM\r\nLanguage=English\r\nA security problem occurred.\r\n.\r\n\r\nMessageId=0xF Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_CANNOT_LOAD_DATA\r\nLanguage=English\r\nThe system could not load the persisted data.\r\n.\r\n\r\nMessageId=0x10 Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_CANNOT_INSTANTIATE_OBJECT\r\nLanguage=English\r\nUnable to instantiate the object.\r\n.\r\n\r\nMessageId=0x14 Facility=Internet Severity=CoError\r\nSymbolicName=INET_E_REDIRECT_FAILED\r\nLanguage=English\r\nA redirection problem occured.\r\n.\r\n\r\n"} +{"text": "#!/usr/bin/env perl\n\npackage Bio::Roary::Main::GeneAlignmentFromNucleotides;\n\n# ABSTRACT: Take in multi-FASTA files of nucleotides and align each file with PRANK or MAFFT\n# PODNAME: protein_alignment_from_nucleotides\n\n=head1 SYNOPSIS\n\nTake in multi-FASTA files of nucleotides and align each file with PRANK or MAFFT\n\n=cut\n\nuse Cwd qw(abs_path); \nBEGIN { unshift( @INC, abs_path('./lib') ) }\nBEGIN { unshift( @INC, abs_path('./t/lib') ) }\nuse Bio::Roary::CommandLine::GeneAlignmentFromNucleotides;\n\nBio::Roary::CommandLine::GeneAlignmentFromNucleotides->new(args => \\@ARGV, script_name => $0)->run;\n"} +{"text": "var o = {\n x : 1,\n f1: function() {\n this.x += 5;\n this[x] -= 4;\n },\n del: 5\n\n}\n\no.f1();\ndelete o.del;\nvar x = \"1\";\n"} +{"text": "/* NOTICE: This file has been changed by Plutext Pty Ltd for use in docx4j.\r\n * The package name has been changed; there may also be other changes.\r\n * \r\n * This notice is included to meet the condition in clause 4(b) of the License. \r\n */\r\n \r\n /* ====================================================================\r\n Licensed to the Apache Software Foundation (ASF) under one or more\r\n contributor license agreements. See the NOTICE file distributed with\r\n this work for additional information regarding copyright ownership.\r\n The ASF licenses this file to You under the Apache License, Version 2.0\r\n (the \"License\"); you may not use this file except in compliance with\r\n the License. You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n==================================================================== */\r\n\r\npackage org.docx4j.org.apache.poi.hpsf;\r\n\r\n/**\r\n *

    This exception is the superclass of all other checked exceptions thrown\r\n * in this package. It supports a nested \"reason\" throwable, i.e. an exception\r\n * that caused this one to be thrown.

    \r\n * \r\n * @author Rainer Klute <klute@rainer-klute.de>\r\n */\r\npublic class HPSFException extends Exception\r\n{\r\n\r\n /**\r\n *

    The underlying reason for this exception - may be\r\n * null.

    \r\n * */\r\n private Throwable reason;\r\n\r\n\r\n\r\n /**\r\n *

    Creates an {@link HPSFException}.

    \r\n */\r\n public HPSFException()\r\n {\r\n super();\r\n }\r\n\r\n\r\n\r\n /**\r\n *

    Creates an {@link HPSFException} with a message string.

    \r\n *\r\n * @param msg The message string.\r\n */\r\n public HPSFException(final String msg)\r\n {\r\n super(msg);\r\n }\r\n\r\n\r\n\r\n /**\r\n *

    Creates a new {@link HPSFException} with a reason.

    \r\n *\r\n * @param reason The reason, i.e. a throwable that indirectly\r\n * caused this exception.\r\n */\r\n public HPSFException(final Throwable reason)\r\n {\r\n super();\r\n this.reason = reason;\r\n }\r\n\r\n\r\n\r\n /**\r\n *

    Creates an {@link HPSFException} with a message string and a\r\n * reason.

    \r\n *\r\n * @param msg The message string.\r\n * @param reason The reason, i.e. a throwable that indirectly\r\n * caused this exception.\r\n */\r\n public HPSFException(final String msg, final Throwable reason)\r\n {\r\n super(msg);\r\n this.reason = reason;\r\n }\r\n\r\n\r\n\r\n /**\r\n *

    Returns the {@link Throwable} that caused this exception to\r\n * be thrown or null if there was no such {@link\r\n * Throwable}.

    \r\n *\r\n * @return The reason\r\n */\r\n public Throwable getReason()\r\n {\r\n return reason;\r\n }\r\n\r\n}\r\n"} +{"text": "#ifndef QEMU_X509_H\n#define QEMU_X509_H\n\n#define X509_CA_CERT_FILE \"ca-cert.pem\"\n#define X509_CA_CRL_FILE \"ca-crl.pem\"\n#define X509_SERVER_KEY_FILE \"server-key.pem\"\n#define X509_SERVER_CERT_FILE \"server-cert.pem\"\n\n#endif /* QEMU_X509_H */\n"} +{"text": "/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n==============================================================================*/\n\n#include \"tensorflow/compiler/xrt/client/xrt_client.h\"\n\n#include \"tensorflow/compiler/xla/literal_util.h\"\n#include \"tensorflow/compiler/xla/service/computation_placer.h\"\n#include \"tensorflow/compiler/xla/status_macros.h\"\n#include \"tensorflow/compiler/xrt/client/xrt_tf_client.h\"\n#include \"tensorflow/compiler/xrt/xrt.pb.h\"\n#include \"tensorflow/core/framework/device_attributes.pb.h\"\n#include \"tensorflow/core/framework/function.pb.h\"\n#include \"tensorflow/core/framework/node_def.pb.h\"\n#include \"tensorflow/core/framework/op_def.pb.h\"\n#include \"tensorflow/core/framework/tensor.pb.h\"\n#include \"tensorflow/core/framework/tensor_shape.pb.h\"\n#include \"tensorflow/core/framework/types.pb.h\"\n#include \"tensorflow/core/lib/core/errors.h\"\n#include \"tensorflow/core/platform/tensor_coding.h\"\n#include \"tensorflow/core/protobuf/tpu/topology.pb.h\"\n\nnamespace tensorflow {\n\nnamespace {\n\n// Deserializes a TensorProto containing a scalar string value.\nxla::StatusOr DeserializeTensorProtoAsString(\n const TensorProto& proto) {\n if (proto.dtype() != DT_STRING) {\n return errors::InvalidArgument(\"Tensors must be of type DT_STRING, got \",\n DataType_Name(proto.dtype()));\n }\n if (proto.tensor_shape().dim_size() != 0 ||\n proto.tensor_shape().unknown_rank()) {\n return errors::InvalidArgument(\"String tensor must be a scalar, got \",\n proto.tensor_shape().DebugString());\n }\n if (proto.string_val_size() > 0) {\n if (proto.string_val_size() != 1) {\n return errors::InvalidArgument(\n \"Expected at most one string_val in TensorProto, got \",\n proto.string_val_size());\n }\n return proto.string_val(0);\n } else {\n std::string data;\n port::DecodeStringList(proto.tensor_content(), &data, 1);\n return data;\n }\n}\n\n// Deserializes a xla::Literal from a TensorProto.\nxla::StatusOr DeserializeTensorProtoAsLiteral(\n const TensorProto& proto) {\n TF_ASSIGN_OR_RETURN(std::string data, DeserializeTensorProtoAsString(proto));\n xla::LiteralProto literal_proto;\n literal_proto.ParsePartialFromString(data);\n return xla::Literal::CreateFromProto(literal_proto);\n}\n\n} // namespace\n\nXrtBuffer::XrtBuffer(XrtTensorHandle handle, int xrt_device_ordinal,\n xla::Shape shape)\n : handle_(std::move(handle)),\n xrt_device_ordinal_(xrt_device_ordinal),\n shape_(std::move(shape)) {}\n\nXrtBuffer::~XrtBuffer() { Delete(); }\n\n/*static*/ xla::StatusOr> XrtBuffer::FromLiteral(\n const std::shared_ptr& context, int xrt_device_ordinal,\n const xla::LiteralSlice& literal) {\n xrt::XLAAllocation allocation;\n *allocation.mutable_value() = literal.ToProto();\n\n auto proto = absl::make_unique();\n proto->set_dtype(DT_STRING);\n allocation.SerializeToString(proto->add_string_val());\n\n if (xrt_device_ordinal < 0 ||\n xrt_device_ordinal >= context->tf_device_ids().size()) {\n return errors::InvalidArgument(\"Invalid XRT device ordinal \",\n xrt_device_ordinal);\n }\n int tf_device_id = context->tf_device_ids().at(xrt_device_ordinal);\n XrtTensorHandle literal_handle =\n context->tf_context()->SendTensor(std::move(proto), tf_device_id,\n /*host_memory=*/true);\n\n XrtTensorHandle buffer_handle = std::move(context->tf_context()->EnqueueOp(\n \"XRTAllocate\", {&literal_handle}, /*output_arity=*/1, /*attrs=*/{},\n tf_device_id)[0]);\n\n return std::make_shared(std::move(buffer_handle),\n xrt_device_ordinal, literal.shape());\n}\n\n/*static*/ xla::StatusOr> XrtBuffer::MakeTuple(\n const std::shared_ptr& context,\n const std::vector>& elements,\n int xrt_device_ordinal) {\n if (elements.empty()) {\n // XRTMakeTuple cannot construct empty tuples. Construct via a literal\n // instead.\n return FromLiteral(context, xrt_device_ordinal,\n xla::LiteralUtil::MakeTuple({}));\n }\n\n if (xrt_device_ordinal < 0 ||\n xrt_device_ordinal >= context->tf_device_ids().size()) {\n return errors::InvalidArgument(\"Invalid XRT device ordinal \",\n xrt_device_ordinal);\n }\n int tf_device_id = context->tf_device_ids().at(xrt_device_ordinal);\n xrt::XLATupleNode tuple_description;\n std::vector element_shapes;\n element_shapes.reserve(elements.size());\n for (int index = 0; index < elements.size(); ++index) {\n xrt::XLATupleNode* node = tuple_description.add_tuples();\n node->set_input_index(index);\n element_shapes.push_back(elements[index]->shape());\n if (elements[index]->handle().device_id() != tf_device_id) {\n return errors::InvalidArgument(\n \"All elements of tuple must be on the same device ( \",\n elements[index]->handle().device_id(), \" vs. \", tf_device_id, \")\");\n }\n }\n auto proto = absl::make_unique();\n proto->set_dtype(DT_STRING);\n tuple_description.SerializeToString(proto->add_string_val());\n\n XrtTensorHandle description_handle =\n context->tf_context()->SendTensor(std::move(proto), tf_device_id,\n /*host_memory=*/true);\n\n protobuf::Map attrs;\n attrs[\"Ninputs\"] = MakeAttrValue(elements.size());\n\n std::vector args;\n args.reserve(elements.size() + 1);\n args.push_back(&description_handle);\n for (const auto& element : elements) {\n args.push_back(&element->handle());\n }\n XrtTensorHandle buffer_handle = std::move(context->tf_context()->EnqueueOp(\n \"XRTMakeTuple\", args, /*output_arity=*/1, attrs, tf_device_id)[0]);\n return std::make_shared(\n std::move(buffer_handle), xrt_device_ordinal,\n xla::ShapeUtil::MakeTupleShape(element_shapes));\n}\n\nxla::StatusOr XrtBuffer::ToLiteral() const {\n TF_RET_CHECK(handle_.valid());\n XrtTensorHandle literal_handle = std::move(handle_.context()->EnqueueOp(\n \"XRTReadLiteral\", {&handle_}, /*output_arity=*/1, /*attrs=*/{},\n handle_.device_id())[0]);\n\n std::shared_ptr future =\n handle_.context()->RecvTensor(literal_handle, DT_STRING,\n /*host_memory=*/true);\n\n // Flush the queue to make sure the producers are dispatched before blocking\n // on the future.\n handle_.context()->FlushQueue();\n\n TF_ASSIGN_OR_RETURN(RecvTensorResponse * response, future->Get());\n VLOG(10) << \"ToLiteral received tensor \" << response->DebugString();\n TF_RET_CHECK(!response->is_dead());\n return DeserializeTensorProtoAsLiteral(response->tensor());\n}\n\nvoid XrtBuffer::Delete() {\n if (handle_.valid()) {\n handle_.context()->EnqueueOp(\"XRTReleaseAllocationHandle\", {&handle_},\n /*output_arity=*/0,\n /*attrs=*/{}, handle_.device_id());\n handle_ = XrtTensorHandle();\n }\n}\n\nxla::StatusOr>>\nXrtBuffer::DestructureTuple() {\n TF_RET_CHECK(shape_.IsTuple());\n std::vector> output;\n output.reserve(shape_.tuple_shapes().size());\n for (int i = 0; i < shape_.tuple_shapes().size(); ++i) {\n TensorProto index_proto;\n index_proto.set_dtype(DT_INT32);\n index_proto.mutable_tensor_shape()->add_dim()->set_size(1);\n index_proto.add_int_val(i);\n XrtTensorHandle index =\n EnqueueConst(handle_.context().get(), handle_.device_id(), index_proto,\n /*host_memory=*/true);\n XrtTensorHandle sub = std::move(\n handle_.context()->EnqueueOp(\"XRTSubTuple\", {&handle_, &index},\n /*output_arity=*/1,\n /*attrs=*/{}, handle_.device_id())[0]);\n output.push_back(std::make_shared(\n std::move(sub), xrt_device_ordinal_, shape_.tuple_shapes(i)));\n }\n return output;\n}\n\n/*static*/ xla::StatusOr> XrtExecutable::Compile(\n std::shared_ptr context,\n const xla::HloModuleProto& hlo_module_proto,\n const std::vector& argument_shapes,\n const xla::Shape& result_shape, xla::DeviceAssignment device_assignment) {\n if (device_assignment.replica_count() <= 0 ||\n device_assignment.computation_count() <= 0) {\n return errors::InvalidArgument(\n \"Device assignment must be non-empty; got \",\n device_assignment.replica_count(), \" replicas and \",\n device_assignment.computation_count(), \" computations per replica.\");\n }\n\n // TODO(phawkins): add support for per-core argument and return shapes.\n TF_RET_CHECK(device_assignment.computation_count() == 1)\n << \"Computation count != 1 not implemented\";\n\n xrt::XLAComputation computation;\n computation.mutable_config()->set_num_replicas(\n device_assignment.replica_count());\n computation.mutable_config()->set_num_cores_per_replica(\n device_assignment.computation_count());\n\n xrt::DeviceAssignment* xrt_assignment =\n computation.mutable_config()->mutable_device_assignment();\n for (int computation = 0; computation < device_assignment.computation_count();\n ++computation) {\n xrt::DeviceAssignment::ComputationDevice* xrt_devices =\n xrt_assignment->add_computation_devices();\n for (int replica = 0; replica < device_assignment.replica_count();\n ++replica) {\n int xrt_device_ordinal = device_assignment(replica, computation);\n if (xrt_device_ordinal < 0 ||\n xrt_device_ordinal >= context->tf_device_ids().size()) {\n return errors::InvalidArgument(\"Invalid device ordinal in device \",\n \"assignment: \", xrt_device_ordinal);\n }\n *xrt_devices->add_replica_devices() =\n context->device_mesh_coordinates().at(xrt_device_ordinal);\n }\n }\n\n xla::ProgramShape program_shape;\n for (const xla::Shape& shape : argument_shapes) {\n xla::Shape* param_shape = program_shape.add_parameters();\n *param_shape = shape;\n if (!xla::LayoutUtil::HasLayout(shape)) {\n xla::LayoutUtil::SetToDefaultLayout(param_shape);\n }\n }\n *program_shape.mutable_result() = result_shape;\n if (!xla::LayoutUtil::HasLayout(result_shape)) {\n xla::LayoutUtil::SetToDefaultLayout(program_shape.mutable_result());\n }\n *computation.mutable_config()->mutable_program_shape() =\n program_shape.ToProto();\n *computation.mutable_hlo_snapshot()->mutable_hlo()->mutable_hlo_module() =\n hlo_module_proto;\n\n auto proto = absl::make_unique();\n proto->set_dtype(DT_STRING);\n computation.SerializeToString(proto->add_string_val());\n\n int xrt_device_ordinal_for_compilation = device_assignment(0, 0);\n int tf_device_id =\n context->tf_device_ids().at(xrt_device_ordinal_for_compilation);\n XrtTensorHandle computation_handle =\n context->tf_context()->SendTensor(std::move(proto), tf_device_id,\n /*host_memory=*/true);\n\n XrtTensorHandle executable_handle =\n std::move(context->tf_context()->EnqueueOp(\n \"XRTCompile\", {&computation_handle}, /*output_arity=*/2, /*attrs=*/{},\n tf_device_id)[0]);\n\n if (device_assignment.num_elements() > 1) {\n string wire_id = XrtGetUniqueWireID();\n int recv_tf_device_id = context->tf_context()->cpu_device_id();\n EnqueueSend(context->tf_context().get(), executable_handle, DT_INT64,\n recv_tf_device_id, wire_id, /*host_memory=*/true);\n executable_handle =\n EnqueueRecv(context->tf_context().get(), DT_INT64, tf_device_id,\n recv_tf_device_id, wire_id, /*host_memory=*/true);\n }\n\n return std::make_shared(\n std::move(context), std::move(executable_handle), program_shape,\n std::move(device_assignment));\n}\n\nXrtExecutable::XrtExecutable(std::shared_ptr context,\n XrtTensorHandle handle, xla::ProgramShape shape,\n xla::DeviceAssignment device_assignment)\n : context_(std::move(context)),\n handle_(std::move(handle)),\n shape_(std::move(shape)),\n device_assignment_(std::move(device_assignment)) {}\n\nXrtExecutable::~XrtExecutable() { Delete(); }\n\nvoid XrtExecutable::Delete() {\n if (handle_.valid()) {\n handle_.context()->EnqueueOp(\"XRTReleaseCompilationHandle\", {&handle_},\n /*output_arity=*/0,\n /*attrs=*/{}, handle_.device_id());\n handle_ = XrtTensorHandle();\n }\n}\n\nxla::StatusOr> XrtExecutable::Execute(\n const std::vector>& args) {\n TF_RET_CHECK(device_assignment_.replica_count() == 1 &&\n device_assignment_.computation_count() == 1)\n << device_assignment_.ToString();\n int xrt_device_ordinal = device_assignment_(0, 0);\n int tf_device_id = context_->tf_device_ids().at(xrt_device_ordinal);\n\n TensorProto config_proto;\n config_proto.set_dtype(DT_STRING);\n config_proto.add_string_val();\n XrtTensorHandle execution_config_handle =\n EnqueueConst(handle_.context().get(), tf_device_id, config_proto,\n /*host_memory=*/true);\n\n protobuf::Map attrs;\n attrs[\"Ninputs\"] = MakeAttrValue(args.size());\n\n std::vector inputs;\n inputs.reserve(args.size() + 2);\n inputs.push_back(&handle_);\n inputs.push_back(&execution_config_handle);\n for (const std::shared_ptr& arg : args) {\n if (arg->handle().device_id() != tf_device_id) {\n return errors::InvalidArgument(\n \"Input buffer to Execute() is not on the device for which the \"\n \"computation was compiled. Target device is \",\n tf_device_id, \", buffer is on device \", arg->handle().device_id());\n }\n inputs.push_back(&arg->handle());\n }\n\n XrtTensorHandle result_handle = std::move(handle_.context()->EnqueueOp(\n \"XRTExecute\", inputs, /*output_arity=*/1, attrs, tf_device_id)[0]);\n\n return std::make_shared(std::move(result_handle),\n xrt_device_ordinal, shape_.result());\n}\n\nxla::StatusOr>>\nXrtExecutable::ExecuteReplicated(\n absl::Span>> args) {\n if (args.size() != device_assignment_.computation_count()) {\n return errors::InvalidArgument(\n \"Mismatched number of computation per replica between executable and \"\n \"arguments. Expected computations_per_replica=\",\n device_assignment_.computation_count(),\n \"; got computations_per_replica=\", args.size());\n }\n\n for (int computation = 0;\n computation < device_assignment_.computation_count(); ++computation) {\n if (args[computation].n1() != device_assignment_.replica_count()) {\n return errors::InvalidArgument(\n \"Mismatched number of replicas between executable and arguments for \"\n \" computation \",\n computation,\n \". Expected replicas=\", device_assignment_.replica_count(),\n \"; got replicas=\", args[computation].n1());\n }\n for (int replica = 0; replica < device_assignment_.replica_count();\n ++replica) {\n int xrt_device_ordinal = device_assignment_(replica, computation);\n int tf_device_id = context_->tf_device_ids().at(xrt_device_ordinal);\n for (int arg = 0; arg < args[computation].n2(); ++arg) {\n const std::shared_ptr& buffer =\n args[computation](replica, arg);\n if (buffer->handle().device_id() != tf_device_id) {\n return errors::InvalidArgument(\n \"Input buffer to ExecuteReplicated() is not on the device for \"\n \"which the computation was compiled. Target device is \",\n tf_device_id, \", buffer is on device \",\n buffer->handle().device_id());\n }\n }\n }\n }\n\n std::vector input_arity;\n input_arity.reserve(args.size());\n for (const auto& arg : args) {\n input_arity.push_back(arg.n2());\n }\n TF_ASSIGN_OR_RETURN(string exec_fn, context_->GetExecuteReplicatedFunction(\n input_arity, device_assignment_));\n\n std::vector input_types;\n std::vector inputs;\n inputs.push_back(&handle_);\n input_types.push_back(DT_INT64);\n\n std::vector execution_config_handles(\n device_assignment_.computation_count());\n int tf_cpu_device_id = context_->tf_context()->cpu_device_id();\n for (int j = 0; j < device_assignment_.computation_count(); ++j) {\n TensorProto config_proto;\n config_proto.set_dtype(DT_STRING);\n xrt::XRTExecutionConfig config;\n config.set_core_index_in_replica(j);\n config_proto.add_string_val(config.SerializeAsString());\n execution_config_handles[j] = EnqueueConst(context_->tf_context().get(),\n tf_cpu_device_id, config_proto,\n /*host_memory=*/true);\n inputs.push_back(&execution_config_handles[j]);\n input_types.push_back(DT_STRING);\n }\n\n for (int i = 0; i < device_assignment_.replica_count(); ++i) {\n for (int j = 0; j < device_assignment_.computation_count(); ++j) {\n for (int k = 0; k < args[j].n2(); ++k) {\n inputs.push_back(&args[j](i, k)->handle());\n input_types.push_back(DT_INT64);\n }\n }\n }\n\n // Run all the XRTExecute ops in parallel using a multi-device function.\n // We do this for two reasons:\n // a) we need the operators to run in parallel, but without async mode enabled\n // they might not.\n // b) we need the operators to all be issued as part of the same\n // EnqueueRequest batch, otherwise we will deadlock.\n // TODO(phawkins): It would be even better to enable async mode, when its\n // error semantics have been improved.\n std::vector output_types(device_assignment_.num_elements(),\n DT_INT64);\n std::vector outputs = context_->tf_context()->EnqueueOp(\n exec_fn, inputs, /*output_arity=*/output_types.size(), /*attrs=*/{},\n tf_cpu_device_id);\n\n xla::Array2D> results(\n device_assignment_.computation_count(),\n device_assignment_.replica_count());\n int output_num = 0;\n for (int i = 0; i < device_assignment_.computation_count(); ++i) {\n for (int j = 0; j < device_assignment_.replica_count(); ++j) {\n int xrt_device_ordinal = device_assignment_(j, i); // NB. different order\n int tf_device_id = context_->tf_device_ids().at(xrt_device_ordinal);\n\n // EnqueueOp doesn't know about multidevice functions, so it will assume\n // that the outputs are on the CPU. Override the device IDs it assigned;\n // we know better.\n outputs[output_num].set_device_id(tf_device_id);\n\n // TODO(phawkins): use a per-core result shape here.\n results(i, j) = std::make_shared(\n std::move(outputs[output_num]), xrt_device_ordinal, shape_.result());\n ++output_num;\n }\n }\n return results;\n}\n\n/*static*/ xla::StatusOr> XrtContext::Create(\n std::shared_ptr tf_context, string device_type) {\n auto context = std::make_shared(tf_context, device_type);\n if (context->tf_device_ids().empty()) {\n return errors::NotFound(\"No accelerator devices of type \", device_type,\n \" are present.\");\n }\n if (device_type == \"TPU\") {\n TF_RETURN_IF_ERROR(context->InitializeTPU());\n } else {\n // Fill in a dummy topology mapping for CPU/GPU.\n for (int i = 0; i < context->tf_device_ids().size(); ++i) {\n context->device_mesh_coordinates_.push_back({});\n context->device_mesh_coordinates_.back().add_value(i);\n }\n }\n return context;\n}\n\nXrtContext::XrtContext(std::shared_ptr tf_context,\n string device_type)\n : tf_context_(std::move(tf_context)), device_type_(std::move(device_type)) {\n for (int i = 0; i < tf_context_->devices().size(); ++i) {\n const DeviceAttributes& device = tf_context_->devices()[i];\n VLOG(2) << \"Device: \" << i << \": \" << device.DebugString();\n if (device.device_type() == device_type_) {\n tf_device_ids_.push_back(i);\n VLOG(1) << \"Accelerator device \" << i << \": \" << device.name();\n }\n }\n}\n\nint XrtContext::device_count() const { return tf_device_ids_.size(); }\n\nstatic Status RegisterTPUInitializeFunction(XrtTfContext* context) {\n FunctionDef fdef;\n OpDef* opdef = fdef.mutable_signature();\n opdef->set_name(\"TPUInitFunc\");\n OpDef::ArgDef* outdef = opdef->add_output_arg();\n outdef->set_name(\"topology\");\n outdef->set_type(DT_STRING);\n\n NodeDef* ndef = fdef.add_node_def();\n ndef->set_name(\"n\");\n ndef->set_op(\"ConfigureDistributedTPU\");\n\n (*fdef.mutable_ret())[\"topology\"] = \"n:topology\";\n\n Status status = context->RegisterFunction(fdef);\n VLOG(10) << \"RegisterTPUInitializeFunction returned \" << status;\n return status;\n}\n\nStatus XrtContext::InitializeTPU() {\n LOG(INFO) << \"Initializing TPU devices.\";\n TF_RETURN_IF_ERROR(RegisterTPUInitializeFunction(tf_context_.get()));\n\n TensorProto index_proto;\n index_proto.set_dtype(DT_INT32);\n index_proto.add_int_val(0);\n XrtTensorHandle device_ordinal = EnqueueConst(\n tf_context_.get(), /*device_id=*/tf_context_->cpu_device_id(),\n index_proto, /*host_memory=*/false);\n\n protobuf::Map attrs;\n attrs[\"f\"].mutable_func()->set_name(\"TPUInitFunc\");\n attrs[\"Tin\"].mutable_list();\n attrs[\"Tout\"].mutable_list()->add_type(DT_STRING);\n XrtTensorHandle t = std::move(\n tf_context_->EnqueueOp(\"TPUPartitionedCall\", {&device_ordinal},\n /*output_arity=*/1,\n /*attrs=*/attrs, tf_context_->cpu_device_id())[0]);\n\n auto result = tf_context_->RecvTensor(t, DT_STRING, /*host_memory=*/false);\n TF_ASSIGN_OR_RETURN(RecvTensorResponse * response, result->Get());\n VLOG(10) << \"TPU topology \" << response->DebugString();\n\n TF_ASSIGN_OR_RETURN(std::string data,\n DeserializeTensorProtoAsString(response->tensor()));\n\n tpu::TopologyProto tpu_topology;\n tpu_topology.ParsePartialFromString(data);\n VLOG(4) << \"TPU topology:\\n\" << tpu_topology.DebugString();\n\n TF_RET_CHECK(tpu_topology.num_tasks() == 1) << tpu_topology.DebugString();\n TF_RET_CHECK(tpu_topology.num_tpu_devices_per_task() == tf_device_ids_.size())\n << tpu_topology.DebugString() << \" \" << tf_device_ids_.size();\n\n const int mesh_rank = tpu_topology.mesh_shape_size();\n TF_RET_CHECK(tpu_topology.device_coordinates_size() ==\n tf_device_ids_.size() * mesh_rank);\n\n for (int i = 0; i < tf_device_ids_.size(); ++i) {\n device_mesh_coordinates_.push_back({});\n auto& coords = device_mesh_coordinates_.back();\n for (int j = 0; j < mesh_rank; ++j) {\n coords.add_value(tpu_topology.device_coordinates(i * mesh_rank + j));\n }\n }\n\n LOG(INFO) << \"TPU initialization succeeded.\";\n return Status::OK();\n}\n\nXrtContext::ExecuteReplicatedKey::ExecuteReplicatedKey(\n absl::Span input_arity, xla::DeviceAssignment device_assignment)\n : input_arity(input_arity.begin(), input_arity.end()),\n device_assignment(std::move(device_assignment)) {}\n\nbool XrtContext::ExecuteReplicatedKey::operator==(\n const ExecuteReplicatedKey& other) const {\n return input_arity == other.input_arity &&\n device_assignment == other.device_assignment;\n}\n\nxla::StatusOr XrtContext::GetExecuteReplicatedFunction(\n absl::Span input_arity,\n const xla::DeviceAssignment& device_assignment) {\n ExecuteReplicatedKey key(input_arity, device_assignment);\n\n absl::MutexLock lock(&mu_);\n auto it = replicated_fns_.find(key);\n if (it != replicated_fns_.end()) {\n return it->second;\n }\n\n string name = absl::StrCat(\"ExecuteReplicated_\", replicated_fns_.size());\n\n FunctionDef fdef;\n OpDef* opdef = fdef.mutable_signature();\n opdef->set_name(name);\n OpDef::ArgDef* execution_handle = opdef->add_input_arg();\n execution_handle->set_name(\"execution_handle\");\n execution_handle->set_type(DT_INT64);\n\n TF_RET_CHECK(device_assignment.computation_count() == input_arity.size());\n\n std::vector execution_configs;\n execution_configs.reserve(device_assignment.computation_count());\n for (int j = 0; j < device_assignment.computation_count(); ++j) {\n OpDef::ArgDef* execution_config = opdef->add_input_arg();\n execution_config->set_name(absl::StrCat(\"execution_config_computation\", j));\n execution_config->set_type(DT_STRING);\n execution_configs.push_back(execution_config);\n }\n\n for (int i = 0; i < device_assignment.replica_count(); ++i) {\n for (int j = 0; j < device_assignment.computation_count(); ++j) {\n NodeDef* ndef = fdef.add_node_def();\n ndef->set_name(absl::StrFormat(\"execute_replica%d_computation%d\", i, j));\n ndef->set_op(\"XRTExecute\");\n (*ndef->mutable_attr())[\"Ninputs\"] = MakeAttrValue(input_arity[j]);\n ndef->add_input(execution_handle->name());\n ndef->add_input(execution_configs[j]->name());\n int tf_device_id = tf_device_ids_.at(device_assignment(i, j));\n ndef->set_device(tf_context_->devices().at(tf_device_id).name());\n\n for (int k = 0; k < input_arity[j]; ++k) {\n OpDef::ArgDef* arg = opdef->add_input_arg();\n arg->set_name(\n absl::StrFormat(\"in_replica%d_computation%d_arg%d\", i, j, k));\n arg->set_type(DT_INT64);\n\n ndef->add_input(arg->name());\n }\n OpDef::ArgDef* ret = opdef->add_output_arg();\n ret->set_name(absl::StrFormat(\"out_replica%d_computation%d\", i, j));\n ret->set_type(DT_INT64);\n\n (*fdef.mutable_ret())[ret->name()] =\n absl::StrCat(ndef->name(), \":output_handle\");\n }\n }\n\n VLOG(10) << fdef.DebugString();\n\n Status status = tf_context_->RegisterFunction(fdef);\n VLOG(4) << \"GetExecuteReplicatedFunction returned \" << status;\n if (!status.ok()) return status;\n\n replicated_fns_[key] = name;\n return name;\n}\n\n} // namespace tensorflow\n"} +{"text": "using GameFramework.Fsm;\nusing GameFramework.Procedure;\nusing System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityGameFramework.Runtime;\nusing ETModel;\nusing GameFramework;\nnamespace Trinity\n{\n public class ProcedureTest : ProcedureBase\n {\n protected override void OnEnter(IFsm procedureOwner)\n {\n base.OnEnter(procedureOwner);\n\n Debug.Log(\"进入了测试流程\");\n }\n\n\n protected override async void OnUpdate(IFsm procedureOwner, float elapseSeconds, float realElapseSeconds)\n {\n base.OnUpdate(procedureOwner, elapseSeconds, realElapseSeconds);\n\n if (Input.GetKeyDown(KeyCode.A))\n {\n Session session = GameEntry.ETNetwork.CreateSession(GameEntry.ETNetwork.ServerIP);\n session.Send(new TestMessage() { Info = \"6666\" });\n\n TestRpcResponse response = (TestRpcResponse)await session.Call(new TestRpcRequest() { Info = \"Hello Server\" });\n Debug.Log(response.Info);\n session.Dispose();\n }\n\n }\n }\n}\n\n"} +{"text": "package org.carlspring.strongbox.cron.jobs.fields;\n\nimport javax.annotation.concurrent.Immutable;\n\n/**\n * @author Przemyslaw Fusik\n */\n@Immutable\npublic class CronJobNamedField\n extends CronJobField\n{\n\n private final String name;\n\n public CronJobNamedField(String name)\n {\n this(null, name);\n }\n\n public CronJobNamedField(CronJobField field,\n String name)\n {\n super(field);\n this.name = name;\n }\n\n @Override\n public String getKey()\n {\n return \"name\";\n }\n\n @Override\n public String getValue()\n {\n return name;\n }\n\n @Override\n public String getName()\n {\n return getValue();\n }\n}\n"} +{"text": "#define O_CREAT 0400\n#define O_EXCL 02000\n#define O_NOCTTY 04000\n#define O_TRUNC 01000\n#define O_APPEND 0010\n#define O_NONBLOCK 0200\n#define O_DSYNC 0020\n#define O_SYNC 040020\n#define O_RSYNC 040020\n#define O_DIRECTORY 0200000\n#define O_NOFOLLOW 0400000\n#define O_CLOEXEC 02000000\n\n#define O_ASYNC 010000\n#define O_DIRECT 0100000\n#define O_LARGEFILE 020000\n#define O_NOATIME 01000000\n#define O_PATH 010000000\n#define O_TMPFILE 020200000\n#define O_NDELAY O_NONBLOCK\n\n#define F_DUPFD 0\n#define F_GETFD 1\n#define F_SETFD 2\n#define F_GETFL 3\n#define F_SETFL 4\n\n#define F_SETOWN 24\n#define F_GETOWN 23\n#define F_SETSIG 10\n#define F_GETSIG 11\n\n#define F_GETLK 33\n#define F_SETLK 34\n#define F_SETLKW 35\n\n#define F_SETOWN_EX 15\n#define F_GETOWN_EX 16\n\n#define F_GETOWNER_UIDS 17\n"} +{"text": "/*\n * Generated by class-dump 3.3.4 (64 bit).\n *\n * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.\n */\n\n#import \"NSObject.h\"\n\n@class NSMutableArray;\n\n@interface ObjectUpdates : NSObject\n{\n NSMutableArray *_addedObjects;\n NSMutableArray *_removedObjects;\n}\n\n@property(readonly, nonatomic) NSMutableArray *removedObjects; // @synthesize removedObjects=_removedObjects;\n@property(readonly, nonatomic) NSMutableArray *addedObjects; // @synthesize addedObjects=_addedObjects;\n- (id)description;\n- (void)dealloc;\n- (id)init;\n\n@end\n\n"} +{"text": "\n\n\n\n\n\nBenchmarkTest00180\n\n\n
    \n
    \n
    \n\t
    \n\t
    \n\t
    \n
    \n
    \n\n\t
    \n
    \n
    \n\n\n\n"} +{"text": "/*\n * Copyright (c) 2005-2020 Radiance Kirill Grouchnikov. All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without \n * modification, are permitted provided that the following conditions are met:\n * \n * o Redistributions of source code must retain the above copyright notice, \n * this list of conditions and the following disclaimer. \n * \n * o Redistributions in binary form must reproduce the above copyright notice, \n * this list of conditions and the following disclaimer in the documentation \n * and/or other materials provided with the distribution. \n * \n * o Neither the name of the copyright holder nor the names of\n * its contributors may be used to endorse or promote products derived \n * from this software without specific prior written permission. \n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" \n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, \n * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR \n * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR \n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, \n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, \n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; \n * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE \n * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, \n * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n */\npackage org.pushingpixels.flamingo.internal.ui.ribbon;\n\nimport javax.swing.*;\nimport javax.swing.plaf.PanelUI;\nimport java.awt.*;\n\n\n/**\n * UI for control panel of ribbon band ({@link JBandControlPanel}).\n * \n * @author Kirill Grouchnikov\n */\npublic abstract class BandControlPanelUI extends PanelUI {\n\t/**\n\t * Returns the layout gap for the controls in the associated control panel.\n\t * \n\t * @return The layout gap for the controls in the associated control panel.\n\t */\n\tpublic abstract int getLayoutGap();\n\n\t@Override\n\tpublic void update(Graphics g, JComponent c) {\n\t}\n}\n"} +{"text": "// This is gel/vsol/tests/test_vsol_digital_curve_3d.cxx\n// \\author Peter Vanroose\n// \\date 13 November 2004\n//-----------------------------------------------------------------------------\n#include \n#include \n#include \"testlib/testlib_test.h\"\n//:\n// \\file\n\n#ifdef _MSC_VER\n# include \"vcl_msvc_warnings.h\"\n#endif\n\n#include \"vgl/vgl_point_3d.h\"\n#include \n#include \n#include \n#include \n\nvoid test_vsol_digital_curve_3d()\n{\n std::vector samples(5);\n samples[0]=new vsol_point_3d(0.0,0.0,0.0);\n samples[1]=new vsol_point_3d(1.0,2.0,3.0);\n samples[2]=new vsol_point_3d(2.5,3.5,4.5);\n samples[3]=new vsol_point_3d(4.5,3.0,-1.0);\n samples[4]=new vsol_point_3d(6.0,4.5,0.0);\n\n vsol_digital_curve_3d_sptr dc=new vsol_digital_curve_3d(samples);\n TEST(\"Constructor\", !dc, false);\n\n TEST(\"vsol_digital_curve_3d::size()\", dc->size(), 5);\n\n vsol_point_3d_sptr p=dc->point(0);\n TEST(\"vsol_digital_curve_3d::point(0)\", p->x(), 0.0);\n TEST(\"vsol_digital_curve_3d::point(0)\", p->y(), 0.0);\n TEST(\"vsol_digital_curve_3d::point(0)\", p->z(), 0.0);\n\n p=dc->point(3);\n TEST(\"vsol_digital_curve_3d::point(3)\", p->x(), 4.5);\n TEST(\"vsol_digital_curve_3d::point(3)\", p->y(), 3.0);\n TEST(\"vsol_digital_curve_3d::point(3)\", p->z(), -1.0);\n\n vsol_digital_curve_3d_sptr dc2=new vsol_digital_curve_3d(*dc);\n TEST(\"Copy constructor\", !dc2, false);\n\n TEST(\"== operator\", *dc2, *dc);\n\n TEST(\"vsol_digital_curve_3d::interp(2.5)\",\n dc->interp(2.5), vgl_point_3d(3.5,3.25,1.75));\n\n TEST(\"vsol_digital_curve_3d::interp(2.0)\",\n dc->interp(2.0), vgl_point_3d(2.5,3.5,4.5));\n\n std::cout << \"digital curve: \" << *dc << std::endl;\n vsol_digital_curve_3d_sptr curve1, curve2;\n // Split the curve at a segment\n double index = closest_index(vgl_point_3d(1.5,3.0,4.0),dc);\n TEST_NEAR(\"closest_index at (1.5,3.0,4.0)\", index, 14.0/9, 1e-12);\n bool split_test = split(dc, 1.5, curve1, curve2);\n TEST(\"split curve at 1.5\", split_test && curve1 && curve2, true);\n std::cout << \"curve 1: \" << *curve1 << std::endl\n << curve1->point(2)->get_p() << std::endl;\n TEST(\"split result 1\", curve1->point(2)->get_p() == vgl_point_3d(1.75,2.75,3.75)\n && curve1->size() == 3, true);\n std::cout << \"curve 2: \" << *curve2 << std::endl\n << curve2->point(0)->get_p() << std::endl;\n TEST(\"split result 2\", curve2->point(0)->get_p() == vgl_point_3d(1.75,2.75,3.75)\n && curve2->size() == 4, true);\n\n // Split the curve at a point\n index = closest_index(vgl_point_3d(5.0,2.0,-1.0),dc);\n std::cout << index << std::endl;\n TEST(\"closest_index at (5.0,2.0,-1)\", index, 3.0);\n split_test = split(dc, index, curve1, curve2);\n TEST(\"split curve at this index\", split_test && curve1 && curve2, true);\n std::cout << \"curve 1: \" << *curve1 << std::endl;\n TEST(\"split result 1\", curve1->point(3)->get_p() == vgl_point_3d(4.5,3.0,-1.0)\n && curve1->size() == 4, true);\n std::cout << \"curve 2: \" << *curve2 << std::endl;\n TEST(\"split result 2\", curve2->point(0)->get_p() == vgl_point_3d(4.5,3.0,-1.0)\n && curve2->size() == 2, true);\n\n // Split curve at its end points (this should fail)\n index = closest_index(vgl_point_3d(7.0,5.0,1.0),dc);\n std::cout << index << std::endl;\n TEST(\"closest_index at (7.0,5.0,1.0)\", index, 4.0);\n split_test = split(dc, index, curve1, curve2);\n TEST(\"split curve at 4.0 (end)\", split_test, false);\n index = closest_index(vgl_point_3d(0.0,-1.0,-2.0),dc);\n std::cout << index << std::endl;\n TEST(\"closest_index at (0.0,-1.0)\", index, 0.0);\n split_test = split(dc, index, curve1, curve2);\n TEST(\"split curve at 0.0 (start)\", split_test, false);\n}\n\nTESTMAIN(test_vsol_digital_curve_3d);\n"} +{"text": "{\n \"cli_option_init_settings\": \"-ρυθμίσεις\",\n \"cli_option_init_settings_description\": \"Αρχικοποιήστε τις ρυθμίσεις.\",\n \"cli_ui_options\": \"Επιλογές διεπαφής χρήστη\",\n \"error_cannot_parse_the_value\": \"Δεν είναι δυνατή η ανάλυση της τιμής.\",\n \"key_0\": \"0\",\n \"key_1\": \"1\",\n \"key_2\": \"2\",\n \"key_3\": \"3\",\n \"key_4\": \"4\",\n \"key_5\": \"5\",\n \"key_6\": \"6\",\n \"key_7\": \"7\",\n \"key_8\": \"8\",\n \"key_9\": \"9\",\n \"key_a\": \"ΕΝΑ\",\n \"key_alt\": \"Τα παντα\",\n \"key_apostrophe\": \""\",\n \"key_b\": \"σι\",\n \"key_backslash\": \"\\\\\",\n \"key_backspace\": \"⌫\",\n \"key_c\": \"ντο\",\n \"key_capslock\": \"κεφαλαία\",\n \"key_comma\": \",\",\n \"key_command\": \"⌘\",\n \"key_ctrl\": \"Ctrl\",\n \"key_d\": \"ρε\",\n \"key_delete\": \"Διαγράφω\",\n \"key_downarrow\": \"🡫\",\n \"key_e\": \"ΕΙΝΑΙ\",\n \"key_end\": \"Τέλος\",\n \"key_enter\": \"Εισαγω\",\n \"key_equal\": \"=\",\n \"key_escape\": \"Esc\",\n \"key_f\": \"φά\",\n \"key_f1\": \"ΣΤ1\",\n \"key_f10\": \"F10\",\n \"key_f11\": \"F11\",\n \"key_f12\": \"F12\",\n \"key_f13\": \"F13\",\n \"key_f14\": \"F14\",\n \"key_f15\": \"F15\",\n \"key_f16\": \"F16\",\n \"key_f17\": \"F17\",\n \"key_f18\": \"F18\",\n \"key_f19\": \"F19\",\n \"key_f2\": \"F2\",\n \"key_f20\": \"F20\",\n \"key_f21\": \"F21\",\n \"key_f22\": \"F22\",\n \"key_f23\": \"F23\",\n \"key_f24\": \"F24\",\n \"key_f25\": \"F25\",\n \"key_f3\": \"ΣΤ3\",\n \"key_f4\": \"F4\",\n \"key_f5\": \"F5\",\n \"key_f6\": \"ΣΤ6\",\n \"key_f7\": \"ΣΤ7\",\n \"key_f8\": \"F8\",\n \"key_f9\": \"F9\",\n \"key_g\": \"σολ\",\n \"key_graveaccent\": \""\",\n \"key_h\": \"Η\",\n \"key_home\": \"Σπίτι\",\n \"key_i\": \"Εγώ\",\n \"key_insert\": \"Εισάγετε\",\n \"key_j\": \"Ι\",\n \"key_k\": \"ΠΡΟΣ ΤΗΝ\",\n \"key_keypad0\": \"Πληκτρολόγιο 0\",\n \"key_keypad1\": \"Πληκτρολόγιο 1\",\n \"key_keypad2\": \"Πληκτρολόγιο 2\",\n \"key_keypad3\": \"Πληκτρολόγιο 3\",\n \"key_keypad4\": \"Πλήκτρο 4\",\n \"key_keypad5\": \"Πληκτρολόγιο 5\",\n \"key_keypad6\": \"Πληκτρολόγιο 6\",\n \"key_keypad7\": \"Πληκτρολόγιο 7\",\n \"key_keypad8\": \"Πληκτρολόγιο 8\",\n \"key_keypad9\": \"Πληκτρολόγιο 9\",\n \"key_keypadadd\": \"Προσθήκη πληκτρολογίου\",\n \"key_keypaddecimal\": \"Πληκτρολόγιο.\",\n \"key_keypaddivide\": \"Πληκτρολόγιο /\",\n \"key_keypadenter\": \"Πληκτρολογήστε Enter\",\n \"key_keypadequal\": \"Πληκτρολόγιο =\",\n \"key_keypadmultiply\": \"Πληκτρολόγιο *\",\n \"key_keypadsubstract\": \"Πληκτρολόγιο -\",\n \"key_l\": \"μεγάλο\",\n \"key_leftalt\": \"Αριστερά Alt\",\n \"key_leftarrow\": \"🡨\",\n \"key_leftbracket\": \"[\",\n \"key_leftcommand\": \"Αριστερά ⌘\",\n \"key_leftcontrol\": \"Αριστερά Ctrl\",\n \"key_leftshift\": \"Αριστερά ⇧\",\n \"key_m\": \"Μ\",\n \"key_menu\": \"Μενού\",\n \"key_minus\": \"-\",\n \"key_n\": \"Ν\",\n \"key_numlock\": \"Num Lock\",\n \"key_o\": \"Ο\",\n \"key_p\": \"Π\",\n \"key_pagedown\": \"Σελίδα προς τα κάτω\",\n \"key_pageup\": \"Σελίδα προς τα πάνω\",\n \"key_period\": \".\",\n \"key_printscreen\": \"Εκτύπωση οθόνης\",\n \"key_q\": \"Ερ\",\n \"key_r\": \"Ρ\",\n \"key_rightalt\": \"Δεξιά Alt\",\n \"key_rightarrow\": \"🡪\",\n \"key_rightbracket\": \"]\",\n \"key_rightcommand\": \"Σωστά ⌘\",\n \"key_rightcontrol\": \"Δεξιά Ctrl\",\n \"key_rightshift\": \"Σωστά ⇧\",\n \"key_s\": \"μικρό\",\n \"key_scrolllock\": \"Κλείδωμα κύλισης\",\n \"key_semicolon\": \";\",\n \"key_shift\": \"⇧\",\n \"key_slash\": \"/\",\n \"key_space\": \"Χώρος\",\n \"key_t\": \"Τ\",\n \"key_tab\": \"Αυτί\",\n \"key_u\": \"Ε\",\n \"key_uparrow\": \"🡩\",\n \"key_v\": \"Β\",\n \"key_w\": \"ΣΕ\",\n \"key_world1\": \"Κόσμος 1\",\n \"key_world2\": \"Κόσμος 2\",\n \"key_x\": \"Χ\",\n \"key_y\": \"ΚΑΙ\",\n \"key_z\": \"ΑΠΟ\",\n \"keyboard_shortcut\": \"Συντόμευση πληκτρολογίου\",\n \"keyboard_shortcuts\": \"Συντομεύσεις πληκτρολογίου\",\n \"layout_grid_stretch_both\": \"Και τα δυο\",\n \"layout_grid_stretch_horizontal\": \"Οριζόντιος\",\n \"layout_grid_stretch_none\": \"Κανένας\",\n \"layout_grid_stretch_vertical\": \"Κατακόρυφος\",\n \"layout_row_stretch_expand\": \"Επεκτείνουν\",\n \"layout_row_stretch_none\": \"Κανένας\",\n \"popup_above_left\": \"Πάνω αριστερά\",\n \"popup_above_right\": \"Πάνω δεξιά\",\n \"popup_below_left\": \"Κάτω αριστερά\",\n \"popup_below_right\": \"Κάτω δεξιά\",\n \"reset_the_value\": \"Επαναφέρετε την τιμή.\",\n \"style_font_default\": \"Προκαθορισμένο\",\n \"style_metrics_extra_large\": \"Πολύ μεγάλο\",\n \"style_metrics_large\": \"Μεγάλο\",\n \"style_metrics_medium\": \"Μεσαίο\",\n \"style_metrics_small\": \"Μικρό\",\n \"style_palette_dark\": \"Σκοτάδι\",\n \"style_palette_light\": \"Φως\",\n \"ui_aspect_ratio_16_9\": \"16:9\",\n \"ui_aspect_ratio_1_85\": \"1.85:1\",\n \"ui_aspect_ratio_2_35\": \"2.35:1\",\n \"ui_aspect_ratio_2_39\": \"2.39:1\",\n \"ui_aspect_ratio_from_source\": \"Από την πηγή\",\n \"ui_aspect_ratio_unscaled\": \"Απεικονισμένο\",\n \"ui_button_type_exclusive\": \"Αποκλειστικός\",\n \"ui_button_type_push\": \"Σπρώξτε\",\n \"ui_button_type_radio\": \"Ραδιόφωνο\",\n \"ui_button_type_toggle\": \"Μεταβάλλω\",\n \"ui_color_role_background\": \"Ιστορικό\",\n \"ui_color_role_background_bellows\": \"Ιστορικό Μπάλες\",\n \"ui_color_role_background_header\": \"Κεφαλίδα φόντου\",\n \"ui_color_role_background_tool_bar\": \"BackgroundBar Toolbar\",\n \"ui_color_role_border\": \"Σύνορο\",\n \"ui_color_role_border_button\": \"Border_button\",\n \"ui_color_role_button\": \"Κουμπί\",\n \"ui_color_role_cached\": \"Αποθηκεύεται προσωρινά\",\n \"ui_color_role_checked\": \"Τετραγωνισμένος\",\n \"ui_color_role_foreground\": \"Σε πρώτο πλάνο\",\n \"ui_color_role_foreground_dim\": \"Νέο μέτωπο Dim\",\n \"ui_color_role_handle\": \"Λαβή\",\n \"ui_color_role_hovered\": \"Καλύπτεται\",\n \"ui_color_role_none\": \"Κανένας\",\n \"ui_color_role_overlay\": \"Επικάλυμμα\",\n \"ui_color_role_overlay_light\": \"Φως επικάλυψης\",\n \"ui_color_role_pressed\": \"Πατημένο\",\n \"ui_color_role_shadow\": \"Σκιά\",\n \"ui_color_role_text_focus\": \"Κείμενο Focus\",\n \"ui_color_role_tooltip_background\": \"Υπόβαθρο εργαλείου\",\n \"ui_color_role_tooltip_foreground\": \"Προειδοποίηση εργαλείου\",\n \"ui_color_role_trough\": \"Σκάφη\",\n \"ui_corner_lower_left\": \"Κάτω αριστερά\",\n \"ui_corner_lower_right\": \"Κάτω δεξιά\",\n \"ui_corner_upper_left\": \"Πάνω αριστερά\",\n \"ui_corner_upper_right\": \"Πάνω δεξιά\",\n \"ui_expand_both\": \"Και τα δυο\",\n \"ui_expand_horizontal\": \"Οριζόντιος\",\n \"ui_expand_none\": \"Κανένας\",\n \"ui_expand_vertical\": \"Κατακόρυφος\",\n \"ui_h_align_center\": \"Κέντρο\",\n \"ui_h_align_fill\": \"Γέμισμα\",\n \"ui_h_align_left\": \"Αριστερά\",\n \"ui_h_align_right\": \"σωστά\",\n \"ui_image_rotate_0\": \"0°\",\n \"ui_image_rotate_180\": \"180°\",\n \"ui_image_rotate_270\": \"270°\",\n \"ui_image_rotate_90\": \"90°\",\n \"ui_metrics_role_border\": \"Σύνορο\",\n \"ui_metrics_role_dialog\": \"Διάλογος\",\n \"ui_metrics_role_drag\": \"Σέρνω\",\n \"ui_metrics_role_font_header\": \"Κεφαλίδα γραμματοσειράς\",\n \"ui_metrics_role_font_large\": \"Μεγάλες γραμματοσειρές\",\n \"ui_metrics_role_font_medium\": \"Μέσο γραμματοσειράς\",\n \"ui_metrics_role_font_small\": \"Μικρή γραμματοσειρά\",\n \"ui_metrics_role_font_title\": \"Τίτλος γραμματοσειράς\",\n \"ui_metrics_role_handle\": \"Λαβή\",\n \"ui_metrics_role_icon\": \"Εικόνισμα\",\n \"ui_metrics_role_icon_mini\": \"Εικονίδιο Μίνι\",\n \"ui_metrics_role_icon_small\": \"Εικονίδιο Μικρό\",\n \"ui_metrics_role_margin\": \"Περιθώριο\",\n \"ui_metrics_role_margin_dialog\": \"Διάλογος περιθωρίου\",\n \"ui_metrics_role_margin_inside\": \"ui_metrics_role_margin_inside\",\n \"ui_metrics_role_margin_large\": \"Περιθώριο μεγάλο\",\n \"ui_metrics_role_margin_small\": \"Περιθώριο μικρό\",\n \"ui_metrics_role_menu\": \"Μενού\",\n \"ui_metrics_role_move\": \"Κίνηση\",\n \"ui_metrics_role_none\": \"Κανένας\",\n \"ui_metrics_role_scroll_area\": \"Περιοχή κύλισης\",\n \"ui_metrics_role_scroll_bar\": \"Γραμμή κύλισης\",\n \"ui_metrics_role_scroll_bar_small\": \"ScrollBarSmall\",\n \"ui_metrics_role_scrub\": \"Σφουγγάρισμα\",\n \"ui_metrics_role_search_box\": \"Κουτί αναζήτησης\",\n \"ui_metrics_role_shadow\": \"Σκιά\",\n \"ui_metrics_role_shadow_small\": \"Σκιά Μικρή\",\n \"ui_metrics_role_slider\": \"Ολισθητής\",\n \"ui_metrics_role_spacing\": \"Διαχωρισμός\",\n \"ui_metrics_role_spacing_large\": \"Μεγάλο\",\n \"ui_metrics_role_spacing_small\": \"Μικρό\",\n \"ui_metrics_role_swatch\": \"Δείγμα υφάσματος\",\n \"ui_metrics_role_swatch_small\": \"SwatchSmall\",\n \"ui_metrics_role_text_column\": \"Κώδικας κειμένου\",\n \"ui_metrics_role_text_column_large\": \"Μεγάλη στήλη κειμένου\",\n \"ui_metrics_role_tooltip_offset\": \"Εξέλιξη εργαλείου\",\n \"ui_orientation_horizontal\": \"Οριζόντιος\",\n \"ui_orientation_vertical\": \"Κατακόρυφος\",\n \"ui_scroll_type_both\": \"Και τα δυο\",\n \"ui_scroll_type_horizontal\": \"Οριζόντιος\",\n \"ui_scroll_type_vertical\": \"Κατακόρυφος\",\n \"ui_selection_type_multiple\": \"Πολλαπλούς\",\n \"ui_selection_type_none\": \"Κανένας\",\n \"ui_selection_type_radio\": \"Ραδιόφωνο\",\n \"ui_selection_type_single\": \"Μονόκλινο\",\n \"ui_side_bottom\": \"Κάτω μέρος\",\n \"ui_side_left\": \"Αριστερά\",\n \"ui_side_right\": \"σωστά\",\n \"ui_side_top\": \"Μπλουζα\",\n \"ui_sort_order_forward\": \"Προς τα εμπρός\",\n \"ui_sort_order_reverse\": \"ΑΝΤΙΣΤΡΟΦΗ\",\n \"ui_text_v_align_baseline\": \"Βασική γραμμή\",\n \"ui_text_v_align_bottom\": \"Κάτω μέρος\",\n \"ui_text_v_align_center\": \"Κέντρο\",\n \"ui_text_v_align_left\": \"Αριστερά\",\n \"ui_text_v_align_right\": \"σωστά\",\n \"ui_text_v_align_top\": \"Μπλουζα\",\n \"ui_v_align_bottom\": \"Κάτω μέρος\",\n \"ui_v_align_center\": \"Κέντρο\",\n \"ui_v_align_fill\": \"Γέμισμα\",\n \"ui_v_align_top\": \"Μπλουζα\",\n \"ui_view_type_list\": \"Λίστα\",\n \"ui_view_type_tiles\": \"Πλακάκια\"\n}"} +{"text": "'use strict';\nangular.module(\"ngLocale\", [], [\"$provide\", function($provide) {\nvar PLURAL_CATEGORY = {ZERO: \"zero\", ONE: \"one\", TWO: \"two\", FEW: \"few\", MANY: \"many\", OTHER: \"other\"};\nfunction getDecimals(n) {\n n = n + '';\n var i = n.indexOf('.');\n return (i == -1) ? 0 : n.length - i - 1;\n}\n\nfunction getVF(n, opt_precision) {\n var v = opt_precision;\n\n if (undefined === v) {\n v = Math.min(getDecimals(n), 3);\n }\n\n var base = Math.pow(10, v);\n var f = ((n * base) | 0) % base;\n return {v: v, f: f};\n}\n\n$provide.value(\"$locale\", {\n \"DATETIME_FORMATS\": {\n \"AMPMS\": [\n \"AM\",\n \"PM\"\n ],\n \"DAY\": [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n ],\n \"ERANAMES\": [\n \"Before Christ\",\n \"Anno Domini\"\n ],\n \"ERAS\": [\n \"BC\",\n \"AD\"\n ],\n \"FIRSTDAYOFWEEK\": 0,\n \"MONTH\": [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ],\n \"SHORTDAY\": [\n \"Sun\",\n \"Mon\",\n \"Tue\",\n \"Wed\",\n \"Thu\",\n \"Fri\",\n \"Sat\"\n ],\n \"SHORTMONTH\": [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n ],\n \"STANDALONEMONTH\": [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ],\n \"WEEKENDRANGE\": [\n 5,\n 6\n ],\n \"fullDate\": \"EEEE, d MMMM y\",\n \"longDate\": \"d MMMM y\",\n \"medium\": \"d MMM y h:mm:ss a\",\n \"mediumDate\": \"d MMM y\",\n \"mediumTime\": \"h:mm:ss a\",\n \"short\": \"dd/MM/y h:mm a\",\n \"shortDate\": \"dd/MM/y\",\n \"shortTime\": \"h:mm a\"\n },\n \"NUMBER_FORMATS\": {\n \"CURRENCY_SYM\": \"$\",\n \"DECIMAL_SEP\": \".\",\n \"GROUP_SEP\": \",\",\n \"PATTERNS\": [\n {\n \"gSize\": 3,\n \"lgSize\": 3,\n \"maxFrac\": 3,\n \"minFrac\": 0,\n \"minInt\": 1,\n \"negPre\": \"-\",\n \"negSuf\": \"\",\n \"posPre\": \"\",\n \"posSuf\": \"\"\n },\n {\n \"gSize\": 3,\n \"lgSize\": 3,\n \"maxFrac\": 2,\n \"minFrac\": 2,\n \"minInt\": 1,\n \"negPre\": \"-\\u00a4\",\n \"negSuf\": \"\",\n \"posPre\": \"\\u00a4\",\n \"posSuf\": \"\"\n }\n ]\n },\n \"id\": \"en-nr\",\n \"localeID\": \"en_NR\",\n \"pluralCat\": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}\n});\n}]);\n"} +{"text": "/*\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 binarylog\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"google.golang.org/grpc/grpclog\"\n)\n\n// NewLoggerFromConfigString reads the string and build a logger. It can be used\n// to build a new logger and assign it to binarylog.Logger.\n//\n// Example filter config strings:\n// - \"\" Nothing will be logged\n// - \"*\" All headers and messages will be fully logged.\n// - \"*{h}\" Only headers will be logged.\n// - \"*{m:256}\" Only the first 256 bytes of each message will be logged.\n// - \"Foo/*\" Logs every method in service Foo\n// - \"Foo/*,-Foo/Bar\" Logs every method in service Foo except method /Foo/Bar\n// - \"Foo/*,Foo/Bar{m:256}\" Logs the first 256 bytes of each message in method\n// /Foo/Bar, logs all headers and messages in every other method in service\n// Foo.\n//\n// If two configs exist for one certain method or service, the one specified\n// later overrides the previous config.\nfunc NewLoggerFromConfigString(s string) Logger {\n\tif s == \"\" {\n\t\treturn nil\n\t}\n\tl := newEmptyLogger()\n\tmethods := strings.Split(s, \",\")\n\tfor _, method := range methods {\n\t\tif err := l.fillMethodLoggerWithConfigString(method); err != nil {\n\t\t\tgrpclog.Warningf(\"failed to parse binary log config: %v\", err)\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn l\n}\n\n// fillMethodLoggerWithConfigString parses config, creates methodLogger and adds\n// it to the right map in the logger.\nfunc (l *logger) fillMethodLoggerWithConfigString(config string) error {\n\t// \"\" is invalid.\n\tif config == \"\" {\n\t\treturn errors.New(\"empty string is not a valid method binary logging config\")\n\t}\n\n\t// \"-service/method\", blacklist, no * or {} allowed.\n\tif config[0] == '-' {\n\t\ts, m, suffix, err := parseMethodConfigAndSuffix(config[1:])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid config: %q, %v\", config, err)\n\t\t}\n\t\tif m == \"*\" {\n\t\t\treturn fmt.Errorf(\"invalid config: %q, %v\", config, \"* not allowed in blacklist config\")\n\t\t}\n\t\tif suffix != \"\" {\n\t\t\treturn fmt.Errorf(\"invalid config: %q, %v\", config, \"header/message limit not allowed in blacklist config\")\n\t\t}\n\t\tif err := l.setBlacklist(s + \"/\" + m); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid config: %v\", err)\n\t\t}\n\t\treturn nil\n\t}\n\n\t// \"*{h:256;m:256}\"\n\tif config[0] == '*' {\n\t\thdr, msg, err := parseHeaderMessageLengthConfig(config[1:])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid config: %q, %v\", config, err)\n\t\t}\n\t\tif err := l.setDefaultMethodLogger(&methodLoggerConfig{hdr: hdr, msg: msg}); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid config: %v\", err)\n\t\t}\n\t\treturn nil\n\t}\n\n\ts, m, suffix, err := parseMethodConfigAndSuffix(config)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid config: %q, %v\", config, err)\n\t}\n\thdr, msg, err := parseHeaderMessageLengthConfig(suffix)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid header/message length config: %q, %v\", suffix, err)\n\t}\n\tif m == \"*\" {\n\t\tif err := l.setServiceMethodLogger(s, &methodLoggerConfig{hdr: hdr, msg: msg}); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid config: %v\", err)\n\t\t}\n\t} else {\n\t\tif err := l.setMethodMethodLogger(s+\"/\"+m, &methodLoggerConfig{hdr: hdr, msg: msg}); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid config: %v\", err)\n\t\t}\n\t}\n\treturn nil\n}\n\nconst (\n\t// TODO: this const is only used by env_config now. But could be useful for\n\t// other config. Move to binarylog.go if necessary.\n\tmaxUInt = ^uint64(0)\n\n\t// For \"p.s/m\" plus any suffix. Suffix will be parsed again. See test for\n\t// expected output.\n\tlongMethodConfigRegexpStr = `^([\\w./]+)/((?:\\w+)|[*])(.+)?$`\n\n\t// For suffix from above, \"{h:123,m:123}\". See test for expected output.\n\toptionalLengthRegexpStr = `(?::(\\d+))?` // Optional \":123\".\n\theaderConfigRegexpStr = `^{h` + optionalLengthRegexpStr + `}$`\n\tmessageConfigRegexpStr = `^{m` + optionalLengthRegexpStr + `}$`\n\theaderMessageConfigRegexpStr = `^{h` + optionalLengthRegexpStr + `;m` + optionalLengthRegexpStr + `}$`\n)\n\nvar (\n\tlongMethodConfigRegexp = regexp.MustCompile(longMethodConfigRegexpStr)\n\theaderConfigRegexp = regexp.MustCompile(headerConfigRegexpStr)\n\tmessageConfigRegexp = regexp.MustCompile(messageConfigRegexpStr)\n\theaderMessageConfigRegexp = regexp.MustCompile(headerMessageConfigRegexpStr)\n)\n\n// Turn \"service/method{h;m}\" into \"service\", \"method\", \"{h;m}\".\nfunc parseMethodConfigAndSuffix(c string) (service, method, suffix string, _ error) {\n\t// Regexp result:\n\t//\n\t// in: \"p.s/m{h:123,m:123}\",\n\t// out: []string{\"p.s/m{h:123,m:123}\", \"p.s\", \"m\", \"{h:123,m:123}\"},\n\tmatch := longMethodConfigRegexp.FindStringSubmatch(c)\n\tif match == nil {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"%q contains invalid substring\", c)\n\t}\n\tservice = match[1]\n\tmethod = match[2]\n\tsuffix = match[3]\n\treturn\n}\n\n// Turn \"{h:123;m:345}\" into 123, 345.\n//\n// Return maxUInt if length is unspecified.\nfunc parseHeaderMessageLengthConfig(c string) (hdrLenStr, msgLenStr uint64, err error) {\n\tif c == \"\" {\n\t\treturn maxUInt, maxUInt, nil\n\t}\n\t// Header config only.\n\tif match := headerConfigRegexp.FindStringSubmatch(c); match != nil {\n\t\tif s := match[1]; s != \"\" {\n\t\t\thdrLenStr, err = strconv.ParseUint(s, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn 0, 0, fmt.Errorf(\"failed to convert %q to uint\", s)\n\t\t\t}\n\t\t\treturn hdrLenStr, 0, nil\n\t\t}\n\t\treturn maxUInt, 0, nil\n\t}\n\n\t// Message config only.\n\tif match := messageConfigRegexp.FindStringSubmatch(c); match != nil {\n\t\tif s := match[1]; s != \"\" {\n\t\t\tmsgLenStr, err = strconv.ParseUint(s, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn 0, 0, fmt.Errorf(\"failed to convert %q to uint\", s)\n\t\t\t}\n\t\t\treturn 0, msgLenStr, nil\n\t\t}\n\t\treturn 0, maxUInt, nil\n\t}\n\n\t// Header and message config both.\n\tif match := headerMessageConfigRegexp.FindStringSubmatch(c); match != nil {\n\t\t// Both hdr and msg are specified, but one or two of them might be empty.\n\t\thdrLenStr = maxUInt\n\t\tmsgLenStr = maxUInt\n\t\tif s := match[1]; s != \"\" {\n\t\t\thdrLenStr, err = strconv.ParseUint(s, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn 0, 0, fmt.Errorf(\"failed to convert %q to uint\", s)\n\t\t\t}\n\t\t}\n\t\tif s := match[2]; s != \"\" {\n\t\t\tmsgLenStr, err = strconv.ParseUint(s, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn 0, 0, fmt.Errorf(\"failed to convert %q to uint\", s)\n\t\t\t}\n\t\t}\n\t\treturn hdrLenStr, msgLenStr, nil\n\t}\n\treturn 0, 0, fmt.Errorf(\"%q contains invalid substring\", c)\n}\n"} +{"text": "/**\n* Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.\n* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.\n* Licensed under the MIT License (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n* http://opensource.org/licenses/MIT\n* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n*/\n@charset \"utf-8\";\n\n.sidebar .navbar-sample1 .navbar-nav a{color:#555759}\n.sidebar{position:fixed; top:0; left:0px; width:180px; height:100%; min-height: 800px; background:#e5e8eb; overflow:auto;}\n.navbar-sample1{position:relative; border:0; border-bottom:3px solid #73797C; z-index:1; clear:both; border-radius:0;}\nli.active{color:#fff;}\n.sidebar .navbar-sample1 .navbar-nav>.active>a{color:#3498db}\n.right_wrapper{height:auto; width:auto; min-width:1200px;float:left; position:absolute; left:180px;z-index:-1}\n.left_wraper{width:180px; height:100%;}\n\n\n.dropdown:hover .menu-top {\n display: block;\n}\n\n.dropdown-submenu{\n position:relative;\n}\n\n.dropdown-submenu > .dropdown-menu{\n top:0;\n left:100%;\n margin-top:-6px;\n margin-left:-1px;\n}\n\n.dropdown-submenu:hover > .dropdown-menu{\n display:block;\n}\n\n.dropdown-submenu > a:after{\n display:block;\n content:\" \";\n float:right;\n width:0;\n height:0;\n border-color:transparent;\n border-style:solid;\n border-width:5px 0 5px 5px;\n border-left-color:#cccccc;\n margin-top:5px;\n margin-right:-10px;\n}\n\n.dropdown-submenu:hover > a:after{\n border-left-color:#ffffff;\n}\n\n.dropdown-submenu .pull-left{\n float:none;\n}\n\n.dropdown-submenu.pull-left > .dropdown-menu{\n left:-100%;\n margin-left:10px;\n -webkit-border-radius:6px 0 6px 6px;\n -moz-border-radius:6px 0 6px 6px;\n border-radius:6px 0 6px 6px;\n}\n\n\n/*二级页面样式 start*/\n.secondary-page .panel{\n border:none;\n background: #fafafa;\n}\n.secondary-page .nav-top-div{\n border:none;\n}\n.secondary-page .doc-content-box{\n border:none;\n background: #fff;\n /*box-shadow: 0 0 16px rgba(0,0,0,0.2);*/\n}\n.secondary-page .dropdown-content{\n box-shadow: 0 0 10px rgba(0,0,0,0.2);\n width: 928px;\n right: -1094px;\n background: #fafafa;\n}\n.secondary-page .dropdown-content::after{\n content:\"\";\n position: absolute;\n width: 21px;\n height: 60px;\n background: #fafafa;\n top:0;\n left:0;\n z-index: 1000;\n margin-left: -12px;\n border-color:#fafafa;\n}\n.sidebar-nav ul a.all-system-title{\n padding: 26px 0 18px 20px;\n font-size:16px;\n line-height: 1;\n color:#333;\n cursor: pointer;\n}\n.right-content a{\n color:#57a3f1; \n}\n.right-content{\n border-bottom: 1px solid #e5e5e5;\n padding-bottom: 14px;\n}\n.secondary-page .dropdown-content .hide-overflow-content a{\n color:#7b7d8a;\n font-size:14px;\n\n}\n.secondary-page .dropdown-content .hide-overflow-content a span{\n color:#bbb;\n font-size: 12px; \n}\n.secondary-page .dropdown-content .hide-overflow-content a:hover{\n color: #57a3f1;\n}\n.secondary-page .sidebar-nav .title-contrl a{\n font-size: 14px;\n font-weight:bold;\n color:#333;\n padding:10px 0 10px 20px;\n}\n.secondary-page .sidebar-nav .api-list-title{\n font-size: 14px;\n font-weight:bold;\n color:#333;\n padding:10px 0 10px 20px;\n}\n.secondary-page .sidebar-nav .api-hover-a:hover{\n border:none;\n background-color: #57a3f1;\n color: #fff;\n}\n.secondary-page .sidebar-nav .drop-down-list{\n font-size: 12px;\n color:#333;\n}\n.secondary-page .sidebar-nav .api-hover-a{\n position: relative;\n}\n.secondary-page .sidebar-nav .api-hover-a .add-project-tip{\n position: absolute;\n top: 0;\n right: 0;\n color: #57e724;\n margin-right: 20px;\n font-size:10px;\n margin-top: 10px;\n}\n.secondary-page .sidebar-nav .drop-down-list li a{\n height: 53px;\n line-height: 53px;\n padding: 0 0 0 30px;\n transition: all .0s;\n padding: 10px 0 0 20px;\n}\n.secondary-page .sidebar-nav .api-hover-a .describe{\n font-size: 12px;\n color: #999;\n padding-top: 3px;\n}\n.secondary-page .sidebar-nav .api-hover-a:hover .describe{\n color:#fff;\n}\n/*API列表 satrt*/\n.api_docs-list{\n padding-top: 20px;\n}\n.api_docs-list table tr th{\n padding:15px 0 15px 15px;\n line-height: 1;\n border:none;\n}\n.api_docs-list table tr td{\n padding: 20px 0 20px 15px;\n line-height: 1;\n border:none;\n}\n\n/*API列表 end*/\n"} +{"text": "action_button_click_icon=menu\nautotranslate=check\nautotranslate_allpages=false\nbasic_functions_in_panel=false\nclean_site_after_google=false\ncomplete_beep=false\ncontext_menu_translate_allpages_auto=true\ncontext_menu_translate_allpages_auto_separator=true\ncontext_menu_translate_auto=true\ncontext_menu_translate_clipboard=true\ncontext_menu_translate_custom=true\ncontext_menu_translate_forget=true\ncontext_menu_translate_go_google=false\ncontext_menu_translate_go_google_separator=false\ncontext_menu_translate_learning=true\ncontext_menu_translate_learning_separator=false\ncontext_menu_translate_page=true\ncontext_menu_translate_page_google=true\ncontext_menu_translate_selection=true\ncontext_menu_translate_selection_sound=true\ncontext_menu_translate_settings=true\ncontext_menu_translate_settings_separator=true\ncontext_menu_translate_text_separator=true\ncopy_clipboard_notification=true\ncurrent_locale=zh-CN\ndefault_lang_to=auto\ndomain_google_translator=translate.google.cn\ndomain_translate_list={\"www.runningcheese.com\":{\"always_domain_question\":false,\"always_domain_translate\":false}}\nfont_family_tooltip_box=\nfont_size_tooltip_box=\nfont_size_tooltip_logo=\nhotkeys=[{\"shiftKey\":false,\"ctrlKey\":false,\"altKey\":true,\"keyCode\":65,\"key\":\"a\",\"method\":\"translate_selection\"},{\"shiftKey\":false,\"ctrlKey\":false,\"altKey\":true,\"keyCode\":83,\"key\":\"s\",\"method\":\"translate_clipboard\"},{\"shiftKey\":false,\"ctrlKey\":false,\"altKey\":true,\"keyCode\":84,\"key\":\"T\",\"method\":\"translate_custom\"}]\nignore_pdf_linebreaks=false\nlast_lang_from=auto\nlast_lang_to=zh-CN\nlearning_background=true\nlearning_background_color=#CCFFFF\nlearning_border=true\nlearning_border_color=#006600\nlearning_enable=false\nlearning_font=true\nlearning_font_color=#000000\nlearning_lang_from=zh-CN\nlearning_lang_to=en\nlearning_max_count=1\nlearning_min_length=50\nlearning_only_http=false\nlearning_show_translation_in_tooltip=false\nlist_disabled_lang_to=nl,am,co,fy,haw,ku,ky,lb,ps,sm,gd,sn,sd,xh,eo,da,uk,uz,ur,hy,ig,bg,si,hr,ht,is,gl,ca,hu,kn,hi,id,gu,kk,tr,tg,sr,st,cy,bn,ceb,ne,eu,su,iw,el,yi,lv,no,cs,sk,sl,sw,pa,ka,mi,pl,bs,fa,te,ta,jw,ga,et,sv,be,zu,lt,so,yo,my,ro,lo,fi,hmn,tl,mn,ha,az,sq,af,mk,mr,ml,ms,mt,mg,km,ny\npromt_https=false\nreverse_lang_value=reverse\nrun_trans_full_page=true\nsave_last_lang_from=false\nsave_last_lang_reverse=false\nset_lowercase_panel_from=false\nset_lowercase_panel_reverse=false\nset_lowercase_panel_to=false\nset_lowercase_tooltip_from=false\nset_lowercase_tooltip_reverse=false\nset_lowercase_tooltip_to=true\nshow_tooltip_animation=transparency\nshow_tooltip_animation_speed=20\nsound_playback_rate=100\ntooltip_background_color_enable=false\ntooltip_background_color_value=#FFFFFF\ntooltip_check_cyrillic=false\ntooltip_check_page_language=false\ntooltip_font_color_enable=false\ntooltip_font_color_value=#000000\ntooltip_height_from=80\ntooltip_height_panel=200\ntooltip_height_reverse=80\ntooltip_height_to=80\ntooltip_position_is_save=false\ntooltip_position_x=545\ntooltip_position_y=270\ntooltip_show_box_name=true\ntooltip_theme=light\ntooltip_theme_cache=\ntooltip_theme_custom_path=\ntooltip_use_webpage_zoom=true\ntooltip_width=350\ntranslate_box_restore_restart=true\ntranslate_clipboard_translate_open=default\ntranslate_clipboard_window_new=default\ntranslate_instant_panel=true\ntranslate_instant_tooltip=true\ntranslate_page_hide_header=true\ntranslate_page_show_only_selected_languages=false\ntranslate_panel_pin=onetab\ntranslate_selection_fly=false\ntranslate_selection_fly_auto=alt\ntranslate_selection_fly_auto_translate_open=default\ntranslate_selection_fly_auto_window_new=default\ntranslate_selection_fly_copy=true\ntranslate_selection_fly_panel=false\ntranslate_selection_fly_sound=true\ntranslate_selection_fly_tooltip=false\ntranslate_selection_fly_translate=true\ntranslate_selection_fly_translate_open=default\ntranslate_selection_fly_translate_plus=false\ntranslate_selection_fly_window_new=default\ntranslate_selection_impossible_target=notifycation\ntranslate_selection_long_click=true\ntranslate_selection_long_click_action=tooltip\ntranslate_selection_long_click_copy=true\ntranslate_selection_long_click_sound=true\ntranslate_selection_long_click_timer=400\ntranslate_selection_long_click_translate=true\ntranslate_selection_long_click_translate_open=default\ntranslate_selection_long_click_translate_plus=false\ntranslate_selection_long_click_window_new=default\ntranslate_selection_middle_click=true\ntranslate_selection_middle_click_action=translate\ntranslate_selection_middle_click_copy=true\ntranslate_selection_middle_click_sound=true\ntranslate_selection_middle_click_translate=true\ntranslate_selection_middle_click_translate_open=default\ntranslate_selection_middle_click_translate_plus=false\ntranslate_selection_middle_click_window_new=default\ntranslate_selection_timer=0\ntranslate_subtitles_youtube=false\ntranslate_tooltip_pin=close\ntranslate_word_fly=false\ntranslate_word_fly_key=alt\ntranslate_word_fly_long_click=false\ntranslate_word_fly_long_click_timer=50\ntranslate_word_fly_sound=false\ntranslate_word_fly_translate_open=default\ntranslate_word_fly_window_new=default\nview_reverse_translate_panel=false\nview_reverse_translate_tooltip=false\nview_source_translate_panel=true\nview_source_translate_tooltip=true\n"} +{"text": "class SofiaSip < Formula\n desc \"SIP User-Agent library\"\n homepage \"http://sofia-sip.sourceforge.net/\"\n url \"https://downloads.sourceforge.net/project/sofia-sip/sofia-sip/1.12.11/sofia-sip-1.12.11.tar.gz\"\n sha256 \"2b01bc2e1826e00d1f7f57d29a2854b15fd5fe24695e47a14a735d195dd37c81\"\n revision 1\n\n bottle do\n cellar :any\n sha256 \"2e78cc40330c53363fb1dddc0568464001b46944628283e26811e4e6ccae28fe\" => :el_capitan\n sha256 \"e2f9ede8ce51b2074659a1fcf576d83031c9037aafd3c39f75330e8e7cb236a5\" => :yosemite\n sha256 \"1e68620530a8dda00d795bdf92f7c564174eefde5d7e703839de2e080bd89ea4\" => :mavericks\n end\n\n depends_on \"pkg-config\" => :build\n depends_on \"glib\"\n depends_on \"gettext\"\n depends_on \"openssl\"\n\n def install\n system \"./configure\", \"--disable-dependency-tracking\",\n \"--prefix=#{prefix}\"\n system \"make\", \"install\"\n end\n\n test do\n system \"#{bin}/localinfo\"\n system \"#{bin}/sip-date\"\n end\nend\n"} +{"text": "/**\n * __ ____\n * / /__ _ __ / __/ __ \n * / //_/(_)/ /_ / / ___ ____ ___ __ __ / /_ \n * / ,< / // __/_\\ \\ / _ \\ / __// _ \\/ // // __/ \n * /_/|_|/_/ \\__//___// .__//_/ \\___/\\_,_/ \\__/ \n * /_/ github.com/KitSprout \n * \n * @file boardConfig.h\n * @author KitSprout\n * @date 03-Jun-2018\n * @brief \n * \n */\n\n/* Define to prevent recursive inclusion ---------------------------------------------------*/\n#ifndef __BOARDCONFIG_H\n#define __BOARDCONFIG_H\n\n#ifdef __cplusplus\n extern \"C\" {\n#endif\n\n/* Includes --------------------------------------------------------------------------------*/\n/* Define ----------------------------------------------------------------------------------*/\n\n#define KS_HW_BOARD_NAME \"SmartIMU\"\n#define KS_HW_MCU_NAME \"STM32F411CE\"\n\n#define KS_HW_USE_CLOCK_SOUCE_INT (0U)\n#define KS_HW_USE_CLOCK_SOUCE_EXT (1U)\n#define KS_HW_HCLOCK_SOUCE KS_HW_USE_CLOCK_SOUCE_EXT\n#define KS_HW_LCLOCK_SOUCE KS_HW_USE_CLOCK_SOUCE_INT\n\n#define KS_FW_UART_HAL_LIBRARY (0U)\n#define KS_FW_SPI_HAL_LIBRARY (0U)\n#define KS_FW_I2C_HAL_LIBRARY (0U)\n#define KS_FW_USB_ENABLE (1U)\n\n#define KS_SYSCLK SystemCoreClock\n\n\n/* -------- LED and KEY */\n\n#define LED_R_PIN GPIO_PIN_13\n#define LED_R_GPIO_PORT GPIOC\n#define LED_R_Set() __GPIO_SET(LED_R_GPIO_PORT, LED_R_PIN)\n#define LED_R_Reset() __GPIO_RST(LED_R_GPIO_PORT, LED_R_PIN)\n#define LED_R_Toggle() __GPIO_TOG(LED_R_GPIO_PORT, LED_R_PIN)\n#define LED_R_On() LED_R_Reset()\n#define LED_R_Off() LED_R_Set()\n\n#define LED_G_PIN GPIO_PIN_14\n#define LED_G_GPIO_PORT GPIOC\n#define LED_G_Set() __GPIO_SET(LED_G_GPIO_PORT, LED_G_PIN)\n#define LED_G_Reset() __GPIO_RST(LED_G_GPIO_PORT, LED_G_PIN)\n#define LED_G_Toggle() __GPIO_TOG(LED_G_GPIO_PORT, LED_G_PIN)\n#define LED_G_On() LED_G_Reset()\n#define LED_G_Off() LED_G_Set()\n\n#define LED_B_PIN GPIO_PIN_15\n#define LED_B_GPIO_PORT GPIOC\n#define LED_B_Set() __GPIO_SET(LED_B_GPIO_PORT, LED_B_PIN)\n#define LED_B_Reset() __GPIO_RST(LED_B_GPIO_PORT, LED_B_PIN)\n#define LED_B_Toggle() __GPIO_TOG(LED_B_GPIO_PORT, LED_B_PIN)\n#define LED_B_On() LED_B_Reset()\n#define LED_B_Off() LED_B_Set()\n\n\n/* Macro -----------------------------------------------------------------------------------*/\n/* Typedef ---------------------------------------------------------------------------------*/\n/* Extern ----------------------------------------------------------------------------------*/\n/* Functions -------------------------------------------------------------------------------*/\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n/*************************************** END OF FILE ****************************************/\n"} +{"text": "//*****************************************************************************\n// Copyright 2017-2020 Intel Corporation\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//*****************************************************************************\n\n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \"gtest/gtest.h\"\n#include \"ngraph/autodiff/adjoints.hpp\"\n#include \"ngraph/file_util.hpp\"\n#include \"ngraph/graph_util.hpp\"\n#include \"ngraph/log.hpp\"\n#include \"ngraph/ngraph.hpp\"\n#include \"ngraph/op/batch_norm.hpp\"\n#include \"ngraph/op/concat.hpp\"\n#include \"ngraph/op/max_pool.hpp\"\n#include \"ngraph/op/negative.hpp\"\n#include \"ngraph/op/parameter.hpp\"\n#include \"ngraph/op/relu.hpp\"\n#include \"ngraph/op/sigmoid.hpp\"\n#include \"ngraph/op/sum.hpp\"\n#include \"ngraph/op/tanh.hpp\"\n#include \"ngraph/pass/algebraic_simplification.hpp\"\n#include \"ngraph/pass/core_fusion.hpp\"\n#include \"ngraph/pass/graph_rewrite.hpp\"\n#include \"ngraph/pass/manager.hpp\"\n#include \"ngraph/pass/reshape_elimination.hpp\"\n#include \"ngraph/pass/visualize_tree.hpp\"\n#include \"ngraph/pattern/matcher.hpp\"\n#include \"ngraph/pattern/op/label.hpp\"\n#include \"ngraph/pattern/op/skip.hpp\"\n#include \"ngraph/serializer.hpp\"\n#include \"ngraph/util.hpp\"\n#include \"nlohmann/json.hpp\"\n#include \"runtime/gpu/op/rnn.hpp\"\n#include \"runtime/gpu/pass/gpu_rnn_fusion.hpp\"\n#include \"util/all_close.hpp\"\n#include \"util/autodiff/backprop_function.hpp\"\n#include \"util/autodiff/numeric_compare.hpp\"\n#include \"util/matcher.hpp\"\n#include \"util/random.hpp\"\n#include \"util/test_tools.hpp\"\n\nusing namespace ngraph;\nusing namespace std;\n\n#if CUDNN_VERSION >= 7200\nTEST(gpu_fusion, rnn_fprop_1_lstm_cell)\n{\n auto src_layer = make_shared(element::f32, Shape{10, 100});\n auto src_iter = make_shared(element::f32, Shape{10, 100});\n auto params =\n make_shared(element::f32, Shape{400 * 100 + 400 * 100 + 400 + 400});\n auto state_iter = make_shared(element::f32, Shape{10, 100});\n\n const int number_of_timesteps = 1;\n const int number_of_gates_per_cell = 4;\n const int src_seq_length = 1;\n const int src_layer_feature_size = 100;\n const int feature_size = 100;\n const int rnn_direction = 1;\n const int num_of_rnn_fused_layer = 1;\n auto rnn_node = make_shared(src_layer,\n src_iter,\n params,\n state_iter,\n number_of_timesteps,\n number_of_gates_per_cell,\n src_seq_length,\n src_layer_feature_size,\n feature_size,\n rnn_direction,\n num_of_rnn_fused_layer);\n auto rnn_ht_output = rnn_node->output(0);\n auto rnn_ct_output = rnn_node->output(1);\n\n auto func = make_shared(OutputVector{rnn_ht_output, rnn_ct_output},\n ParameterVector{src_layer, src_iter, params, state_iter});\n auto backend = runtime::Backend::create(\"GPU\");\n\n shared_ptr src_layer_t =\n backend->create_tensor(element::f32, src_layer->get_output_shape(0));\n shared_ptr src_iter_t =\n backend->create_tensor(element::f32, src_iter->get_output_shape(0));\n shared_ptr state_iter_t =\n backend->create_tensor(element::f32, state_iter->get_output_shape(0));\n shared_ptr params_t =\n backend->create_tensor(element::f32, params->get_output_shape(0));\n\n shared_ptr result_ht = backend->create_tensor(element::f32, {10, 100});\n shared_ptr result_ct = backend->create_tensor(element::f32, Shape{10, 100});\n\n copy_data(src_layer_t, vector(1000, 1));\n copy_data(src_iter_t, vector(1000, 1));\n copy_data(state_iter_t, vector(1000, 1));\n copy_data(params_t, vector(shape_size(params->get_output_shape(0)), 1));\n\n auto handle = backend->compile(func);\n handle->call_with_validate({result_ht, result_ct},\n {src_layer_t, src_iter_t, params_t, state_iter_t});\n vector expected_ht(10 * 100, 0.964028f);\n vector expected_ct;\n for (size_t i = 0; i < 10 * 100; i++)\n {\n expected_ct.push_back(0.964028f);\n }\n\n EXPECT_TRUE(test::all_close(expected_ht, read_vector(result_ht)));\n EXPECT_TRUE(test::all_close(expected_ct, read_vector(result_ct)));\n}\n#endif\n\n#ifndef NGRAPH_JSON_DISABLE\nTEST(gpu_fusion, fuse_lstm_cells)\n{\n pass::Manager pass_manager;\n pass_manager.register_pass();\n const string json_path =\n file_util::path_join(SERIALIZED_ZOO, \"mxnet/2rnn_layer_3lstm_cell.json\");\n const string json_string = file_util::read_file_to_string(json_path);\n stringstream ss(json_string);\n shared_ptr func = ngraph::deserialize(ss);\n pass_manager.run_passes(func);\n auto lstm_ops = get_ops_of_type(func);\n EXPECT_EQ(lstm_ops.size(), 6);\n}\n\nTEST(gpu_fusion, fuse_2_layer_rnn)\n{\n pass::Manager pass_manager;\n pass_manager.register_pass();\n pass_manager.register_pass();\n const string json_path =\n file_util::path_join(SERIALIZED_ZOO, \"mxnet/2rnn_layer_3lstm_cell.json\");\n const string json_string = file_util::read_file_to_string(json_path);\n stringstream ss(json_string);\n shared_ptr func = ngraph::deserialize(ss);\n pass_manager.run_passes(func);\n size_t count = count_ops_of_type(func);\n auto rnn_ops = get_ops_of_type(func);\n EXPECT_EQ(rnn_ops.size(), count);\n for (auto& node : rnn_ops)\n {\n EXPECT_EQ(node->get_num_timesteps(), node->get_src_sequence_length());\n }\n}\n\nTEST(DISABLED_gpu_fusion, fuse_1_layer_rnn)\n{\n pass::Manager pass_manager;\n pass_manager.register_pass();\n pass_manager.register_pass();\n const string json_path =\n file_util::path_join(SERIALIZED_ZOO, \"mxnet/1rnn_layer_3lstm_cell.json\");\n const string json_string = file_util::read_file_to_string(json_path);\n stringstream ss(json_string);\n shared_ptr func = ngraph::deserialize(ss);\n pass_manager.run_passes(func);\n size_t count = count_ops_of_type(func);\n auto rnn_ops = get_ops_of_type(func);\n EXPECT_EQ(rnn_ops.size(), 1);\n EXPECT_EQ(rnn_ops.size(), count);\n for (auto& node : rnn_ops)\n {\n EXPECT_EQ(node->get_num_timesteps(), node->get_src_sequence_length());\n }\n}\n#endif\n\nTEST(gpu_fusion, lstm_analytic)\n{\n auto input_xt = std::make_shared(element::f32, Shape{1, 1});\n auto weights_i2h = std::make_shared(element::f32, Shape{4, 1});\n auto weights_i2h_reshape =\n std::make_shared(weights_i2h, AxisVector{1, 0}, Shape{1, 4});\n auto dot_1 = std::make_shared(input_xt, weights_i2h_reshape);\n\n auto bias_i2h = std::make_shared(element::f32, Shape{4});\n auto broadcast_bias_i2h =\n std::make_shared(bias_i2h, Shape{1, 4}, AxisSet{0});\n auto add_1 = std::make_shared(dot_1, broadcast_bias_i2h);\n\n auto h_const = op::v0::Constant::create(element::f32, Shape{}, {1.0});\n auto hidden_ht = std::make_shared(h_const, Shape{1, 1}, AxisSet{0, 1});\n auto weights_h2h = std::make_shared(element::f32, Shape{4, 1});\n auto param2_2_reshape =\n std::make_shared(weights_h2h, AxisVector{1, 0}, Shape{1, 4});\n auto dot_2 = std::make_shared(hidden_ht, param2_2_reshape);\n\n auto bias_h2h = std::make_shared(element::f32, Shape{4});\n auto broadcast_bias_h2h =\n std::make_shared(bias_h2h, Shape{1, 4}, AxisSet{0});\n auto add_2 = std::make_shared(dot_2, broadcast_bias_h2h);\n\n auto X = std::make_shared(add_2, add_1);\n // construct forget gate\n auto input_slice_0 = std::make_shared(X, Coordinate{0, 0}, Coordinate{1, 1});\n auto forget_gate = std::make_shared(input_slice_0);\n\n // ct-1 -> cell state\n auto c_const = op::v0::Constant::create(element::f32, Shape{}, {-1.0});\n auto ct_1 = std::make_shared(c_const, Shape{1, 1}, AxisSet{0, 1});\n // auto ct_1 = std::make_shared(element::f32, Shape{10, 100});\n auto multiply_forget_gate_ct_1 = std::make_shared(forget_gate, ct_1);\n\n // construct input gate\n auto input_slice_1 = std::make_shared(X, Coordinate{0, 1}, Coordinate{1, 2});\n auto input_gate = std::make_shared(input_slice_1);\n auto input_slice_2 = std::make_shared(X, Coordinate{0, 2}, Coordinate{1, 3});\n auto tanh_1 = std::make_shared(input_slice_2);\n auto multiply_input_gate_tanh_1 = std::make_shared(input_gate, tanh_1);\n\n auto ct = std::make_shared(multiply_forget_gate_ct_1, multiply_input_gate_tanh_1);\n\n // construct output gate\n auto input_slice_3 = std::make_shared(X, Coordinate{0, 3}, Coordinate{1, 4});\n auto output_gate = std::make_shared(input_slice_3);\n auto tanh_2 = std::make_shared(ct);\n auto ht = std::make_shared(output_gate, tanh_2);\n\n auto f = make_shared(\n OutputVector{ht, ct},\n ParameterVector{input_xt, weights_i2h, weights_h2h, bias_i2h, bias_h2h});\n\n auto backend = runtime::Backend::create(\"GPU\");\n\n std::shared_ptr input_xt_t =\n backend->create_tensor(element::f32, input_xt->get_output_shape(0));\n copy_data(input_xt_t, std::vector{1.0});\n\n std::shared_ptr weights_i2h_t =\n backend->create_tensor(element::f32, weights_i2h->get_output_shape(0));\n copy_data(weights_i2h_t, std::vector{-1.0, -1.0, -1.0, -1.0});\n\n std::shared_ptr weights_h2h_t =\n backend->create_tensor(element::f32, weights_h2h->get_output_shape(0));\n copy_data(weights_h2h_t, std::vector{-1.0, -1.0, -1.0, -1.0});\n\n std::shared_ptr bias_i2h_t =\n backend->create_tensor(element::f32, bias_i2h->get_output_shape(0));\n copy_data(bias_i2h_t, std::vector{-1.0, -1.0, -1.0, -1.0});\n\n std::shared_ptr bias_h2h_t =\n backend->create_tensor(element::f32, bias_h2h->get_output_shape(0));\n copy_data(bias_h2h_t, std::vector{-1.0, -1.0, -1.0, -1.0});\n\n std::shared_ptr result_ht =\n backend->create_tensor(element::f32, ht->get_output_shape(0));\n std::shared_ptr result_ct =\n backend->create_tensor(element::f32, ct->get_output_shape(0));\n\n auto handle = backend->compile(f);\n handle->call_with_validate({result_ht, result_ct},\n {input_xt_t, weights_i2h_t, weights_h2h_t, bias_i2h_t, bias_h2h_t});\n\n auto sig = [](float x) { return 1.0f / (1.0f + std::exp(-x)); };\n float ct_val = -sig(-4.0f) + sig(-4.0f) * std::tanh(-4.0f);\n float ht_val = sig(-4.0f) * std::tanh(ct_val);\n\n EXPECT_TRUE(test::all_close(std::vector{ht_val}, read_vector(result_ht)));\n EXPECT_TRUE(test::all_close(std::vector{ct_val}, read_vector(result_ct)));\n}\n\nTEST(gpu_fusion, fuse_2_layer_rnn_1lstm_analytic)\n{\n auto input_xt = std::make_shared(element::f32, Shape{1, 1});\n auto weights_i2h = std::make_shared(element::f32, Shape{4, 1});\n auto weights_i2h_reshape =\n std::make_shared(weights_i2h, AxisVector{1, 0}, Shape{1, 4});\n auto dot_1 = std::make_shared(input_xt, weights_i2h_reshape);\n\n auto bias_i2h = std::make_shared(element::f32, Shape{4});\n auto broadcast_bias_i2h =\n std::make_shared(bias_i2h, Shape{1, 4}, AxisSet{0});\n auto add_1 = std::make_shared(dot_1, broadcast_bias_i2h);\n\n auto h_const = op::v0::Constant::create(element::f32, Shape{}, {1.0});\n auto hidden_ht = std::make_shared(h_const, Shape{1, 1}, AxisSet{0, 1});\n auto weights_h2h = std::make_shared(element::f32, Shape{4, 1});\n auto param2_2_reshape =\n std::make_shared(weights_h2h, AxisVector{1, 0}, Shape{1, 4});\n auto dot_2 = std::make_shared(hidden_ht, param2_2_reshape);\n\n auto bias_h2h = std::make_shared(element::f32, Shape{4});\n auto broadcast_bias_h2h =\n std::make_shared(bias_h2h, Shape{1, 4}, AxisSet{0});\n auto add_2 = std::make_shared(dot_2, broadcast_bias_h2h);\n\n auto X = std::make_shared(add_2, add_1);\n // construct forget gate\n auto input_slice_0 = std::make_shared(X, Coordinate{0, 0}, Coordinate{1, 1});\n auto forget_gate = std::make_shared(input_slice_0);\n\n // ct-1 -> cell state\n auto c_const = op::v0::Constant::create(element::f32, Shape{}, {1.0});\n auto ct_1 = std::make_shared(c_const, Shape{1, 1}, AxisSet{0, 1});\n // auto ct_1 = std::make_shared(element::f32, Shape{10, 100});\n auto multiply_forget_gate_ct_1 = std::make_shared(forget_gate, ct_1);\n\n // construct input gate\n auto input_slice_1 = std::make_shared(X, Coordinate{0, 1}, Coordinate{1, 2});\n auto input_gate = std::make_shared(input_slice_1);\n auto input_slice_2 = std::make_shared(X, Coordinate{0, 2}, Coordinate{1, 3});\n auto tanh_1 = std::make_shared(input_slice_2);\n auto multiply_input_gate_tanh_1 = std::make_shared(input_gate, tanh_1);\n\n auto ct = std::make_shared(multiply_forget_gate_ct_1, multiply_input_gate_tanh_1);\n\n // construct output gate\n auto input_slice_3 = std::make_shared(X, Coordinate{0, 3}, Coordinate{1, 4});\n auto output_gate = std::make_shared(input_slice_3);\n auto tanh_2 = std::make_shared(ct);\n auto ht = std::make_shared(output_gate, tanh_2);\n\n // next lstm layer\n auto weights_i2h_0 = std::make_shared(element::f32, Shape{4, 1});\n auto weights_i2h_0_reshape_0 =\n std::make_shared(weights_i2h_0, AxisVector{1, 0}, Shape{1, 4});\n auto dot_1_0 = std::make_shared(ht, weights_i2h_0_reshape_0);\n\n auto bias_i2h_0 = std::make_shared(element::f32, Shape{4});\n auto broadcast_bias_i2h_0_0 =\n std::make_shared(bias_i2h_0, Shape{1, 4}, AxisSet{0});\n auto add_1_0 = std::make_shared(dot_1_0, broadcast_bias_i2h_0_0);\n\n auto h_const_0 = op::v0::Constant::create(element::f32, Shape{}, {1.0});\n auto hidden_ht_0 = std::make_shared(h_const_0, Shape{1, 1}, AxisSet{0, 1});\n auto weights_h2h_0 = std::make_shared(element::f32, Shape{4, 1});\n auto param2_2_reshape_0 =\n std::make_shared(weights_h2h_0, AxisVector{1, 0}, Shape{1, 4});\n auto dot_2_0 = std::make_shared(hidden_ht_0, param2_2_reshape_0);\n\n auto bias_h2h_0 = std::make_shared(element::f32, Shape{4});\n auto broadcast_bias_h2h_0_0 =\n std::make_shared(bias_h2h_0, Shape{1, 4}, AxisSet{0});\n auto add_2_0 = std::make_shared(dot_2_0, broadcast_bias_h2h_0_0);\n\n auto X_0 = std::make_shared(add_2_0, add_1_0);\n // construct forget gate\n auto input_slice_0_0 = std::make_shared(X_0, Coordinate{0, 0}, Coordinate{1, 1});\n auto forget_gate_0 = std::make_shared(input_slice_0_0);\n\n // ct-1 -> cell state\n auto c_const_0 = op::v0::Constant::create(element::f32, Shape{}, {1.0});\n auto ct_1_0 = std::make_shared(c_const_0, Shape{1, 1}, AxisSet{0, 1});\n // auto ct_1 = std::make_shared(element::f32, Shape{10, 100});\n auto multiply_forget_gate_0_ct_1_0 = std::make_shared(forget_gate_0, ct_1_0);\n\n // construct input gate\n auto input_slice_1_0 = std::make_shared(X_0, Coordinate{0, 1}, Coordinate{1, 2});\n auto input_gate_0 = std::make_shared(input_slice_1_0);\n auto input_slice_2_0 = std::make_shared(X_0, Coordinate{0, 2}, Coordinate{1, 3});\n auto tanh_1_0 = std::make_shared(input_slice_2_0);\n auto multiply_input_gate_0_tanh_1_0 =\n std::make_shared(input_gate_0, tanh_1_0);\n\n auto ct_0 = std::make_shared(multiply_forget_gate_0_ct_1_0,\n multiply_input_gate_0_tanh_1_0);\n\n // construct output gate\n auto input_slice_3_0 = std::make_shared(X_0, Coordinate{0, 3}, Coordinate{1, 4});\n auto output_gate_0 = std::make_shared(input_slice_3_0);\n auto tanh_2_0 = std::make_shared(ct_0);\n auto ht_0 = std::make_shared(output_gate_0, tanh_2_0);\n\n auto f = make_shared(OutputVector{ht_0, ct_0},\n ParameterVector{input_xt,\n weights_i2h,\n weights_h2h,\n bias_i2h,\n bias_h2h,\n weights_i2h_0,\n weights_h2h_0,\n bias_i2h_0,\n bias_h2h_0});\n\n auto backend = runtime::Backend::create(\"GPU\");\n\n auto params = f->get_parameters();\n std::vector> arg_tensors;\n for (shared_ptr param : params)\n {\n vector tensor_vals(shape_size(param->get_output_shape(0)), 1.0f);\n auto tensor = backend->create_tensor(element::f32, param->get_output_shape(0));\n copy_data(tensor, tensor_vals);\n arg_tensors.push_back(tensor);\n }\n\n std::shared_ptr result_ht =\n backend->create_tensor(element::f32, ht->get_output_shape(0));\n std::shared_ptr result_ct =\n backend->create_tensor(element::f32, ct->get_output_shape(0));\n\n auto handle = backend->compile(f);\n handle->call_with_validate({result_ht, result_ct}, arg_tensors);\n // EXPECT_EQ(1, count_ops_of_type(f));\n\n auto sig = [](float x) { return 1.0f / (1.0f + std::exp(-x)); };\n float kernel = 4.0f;\n float ct_val_first = sig(kernel) + sig(kernel) * std::tanh(kernel);\n float ht_val_first = sig(kernel) * std::tanh(ct_val_first);\n\n kernel = 3.0f + ht_val_first;\n float ct_val_second = sig(kernel) + sig(kernel) * std::tanh(kernel);\n float ht_val_second = sig(kernel) * std::tanh(ct_val_second);\n\n EXPECT_TRUE(test::all_close(std::vector{ht_val_second}, read_vector(result_ht)));\n EXPECT_TRUE(test::all_close(std::vector{ct_val_second}, read_vector(result_ct)));\n}\n\n#ifndef NGRAPH_JSON_DISABLE\nTEST(gpu_fusion, rnn_fusion_inter_vs_gpu_1lstm_cell)\n{\n const std::string file_name(\"mxnet/1_lstm_cell_forward.json\");\n auto gpu_f = make_function_from_file(file_name);\n auto int_f = make_function_from_file(file_name);\n test::Uniform rng(-10.0f, 10.0f);\n vector> args;\n\n for (shared_ptr param : int_f->get_parameters())\n {\n vector tensor_val(shape_size(param->get_output_shape(0)));\n rng.initialize(tensor_val);\n args.push_back(tensor_val);\n }\n auto int_results = execute(int_f, args, \"INTERPRETER\");\n auto gpu_results = execute(gpu_f, args, \"GPU\");\n for (size_t i = 0; i < gpu_results.size(); i++)\n {\n EXPECT_TRUE(test::all_close(gpu_results.at(i), int_results.at(i), 1.0e-4f, 1.0e-4f));\n }\n}\n\nTEST(DISABLED_gpu_fusion, rnn_fusion_inter_vs_gpu_1rnn_layer_3lstm_cell)\n{\n const std::string file_name(\"mxnet/1rnn_layer_3lstm_cell.json\");\n auto gpu_f = make_function_from_file(file_name);\n auto int_f = make_function_from_file(file_name);\n test::Uniform rng(-10.0f, 10.0f);\n vector> args;\n\n for (shared_ptr param : int_f->get_parameters())\n {\n vector tensor_val(shape_size(param->get_output_shape(0)));\n rng.initialize(tensor_val);\n args.push_back(tensor_val);\n }\n auto int_results = execute(int_f, args, \"INTERPRETER\");\n auto gpu_results = execute(gpu_f, args, \"GPU\");\n for (size_t i = 0; i < gpu_results.size(); i++)\n {\n EXPECT_TRUE(test::all_close(gpu_results.at(i), int_results.at(i), 1.0e-4f, 1.0e-4f));\n }\n}\n\nTEST(gpu_fusion, rnn_fusion_inter_vs_gpu_2rnn_layer_3lstm_cell)\n{\n const std::string file_name(\"mxnet/2rnn_layer_3lstm_cell.json\");\n auto gpu_f = make_function_from_file(file_name);\n auto int_f = make_function_from_file(file_name);\n test::Uniform rng(-10.0f, 10.0f);\n vector> args;\n\n for (shared_ptr param : int_f->get_parameters())\n {\n vector tensor_val(shape_size(param->get_output_shape(0)));\n rng.initialize(tensor_val);\n args.push_back(tensor_val);\n }\n auto int_results = execute(int_f, args, \"INTERPRETER\");\n auto gpu_results = execute(gpu_f, args, \"GPU\");\n for (size_t i = 0; i < gpu_results.size(); i++)\n {\n EXPECT_TRUE(test::all_close(gpu_results.at(i), int_results.at(i), 1.0e-3f, 1.0e-3f));\n }\n}\n\nTEST(gpu_fusion, fuse_rnn_across_layer)\n{\n pass::Manager pass_manager;\n pass_manager.register_pass();\n pass_manager.register_pass();\n pass_manager.register_pass();\n pass_manager.register_pass();\n const string json_path =\n file_util::path_join(SERIALIZED_ZOO, \"mxnet/2rnn_layer_1timestep.json\");\n const string json_string = file_util::read_file_to_string(json_path);\n stringstream ss(json_string);\n shared_ptr func = ngraph::deserialize(ss);\n pass_manager.run_passes(func);\n size_t ref_rnn_count = 1;\n auto rnn_count = count_ops_of_type(func);\n EXPECT_EQ(ref_rnn_count, rnn_count);\n}\n\nTEST(gpu_fusion, fuse_rnn_across_2layer_1timestep)\n{\n const std::string file_name(\"mxnet/2rnn_layer_1timestep.json\");\n auto gpu_f = make_function_from_file(file_name);\n auto int_f = make_function_from_file(file_name);\n test::Uniform rng(-10.0f, 10.0f);\n vector> args;\n\n for (shared_ptr param : int_f->get_parameters())\n {\n vector tensor_val(shape_size(param->get_output_shape(0)));\n rng.initialize(tensor_val);\n args.push_back(tensor_val);\n }\n auto int_results = execute(int_f, args, \"INTERPRETER\");\n auto gpu_results = execute(gpu_f, args, \"GPU\");\n\n // TODO (pruthvi): Enable this after fixing failing\n // mxnet rnn unit tests\n // EXPECT_EQ(1, count_ops_of_type(gpu_f));\n for (size_t i = 0; i < gpu_results.size(); i++)\n {\n EXPECT_TRUE(test::all_close(gpu_results.at(1), int_results.at(1), 1.0e-4f, 1.0e-4f));\n }\n}\n#endif\n"} +{"text": "var genobj = require('generate-object-property')\nvar genfun = require('generate-function')\nvar jsonpointer = require('jsonpointer')\nvar xtend = require('xtend')\nvar formats = require('./formats')\n\nvar get = function(obj, additionalSchemas, ptr) {\n\n var visit = function(sub) {\n if (sub && sub.id === ptr) return sub\n if (typeof sub !== 'object' || !sub) return null\n return Object.keys(sub).reduce(function(res, k) {\n return res || visit(sub[k])\n }, null)\n }\n\n var res = visit(obj)\n if (res) return res\n\n ptr = ptr.replace(/^#/, '')\n ptr = ptr.replace(/\\/$/, '')\n\n try {\n return jsonpointer.get(obj, decodeURI(ptr))\n } catch (err) {\n var end = ptr.indexOf('#')\n var other\n // external reference\n if (end !== 0) {\n // fragment doesn't exist.\n if (end === -1) {\n other = additionalSchemas[ptr]\n } else {\n var ext = ptr.slice(0, end)\n other = additionalSchemas[ext]\n var fragment = ptr.slice(end).replace(/^#/, '')\n try {\n return jsonpointer.get(other, fragment)\n } catch (err) {}\n }\n } else {\n other = additionalSchemas[ptr]\n }\n return other || null\n }\n}\n\nvar formatName = function(field) {\n field = JSON.stringify(field)\n var pattern = /\\[([^\\[\\]\"]+)\\]/\n while (pattern.test(field)) field = field.replace(pattern, '.\"+$1+\"')\n return field\n}\n\nvar types = {}\n\ntypes.any = function() {\n return 'true'\n}\n\ntypes.null = function(name) {\n return name+' === null'\n}\n\ntypes.boolean = function(name) {\n return 'typeof '+name+' === \"boolean\"'\n}\n\ntypes.array = function(name) {\n return 'Array.isArray('+name+')'\n}\n\ntypes.object = function(name) {\n return 'typeof '+name+' === \"object\" && '+name+' && !Array.isArray('+name+')'\n}\n\ntypes.number = function(name) {\n return 'typeof '+name+' === \"number\"'\n}\n\ntypes.integer = function(name) {\n return 'typeof '+name+' === \"number\" && (Math.floor('+name+') === '+name+' || '+name+' > 9007199254740992 || '+name+' < -9007199254740992)'\n}\n\ntypes.string = function(name) {\n return 'typeof '+name+' === \"string\"'\n}\n\nvar unique = function(array) {\n var list = []\n for (var i = 0; i < array.length; i++) {\n list.push(typeof array[i] === 'object' ? JSON.stringify(array[i]) : array[i])\n }\n for (var i = 1; i < list.length; i++) {\n if (list.indexOf(list[i]) !== i) return false\n }\n return true\n}\n\nvar isMultipleOf = function(name, multipleOf) {\n var res;\n var factor = ((multipleOf | 0) !== multipleOf) ? Math.pow(10, multipleOf.toString().split('.').pop().length) : 1\n if (factor > 1) {\n var factorName = ((name | 0) !== name) ? Math.pow(10, name.toString().split('.').pop().length) : 1\n if (factorName > factor) res = true\n else res = Math.round(factor * name) % (factor * multipleOf)\n }\n else res = name % multipleOf;\n return !res;\n}\n\nvar toType = function(node) {\n return node.type\n}\n\nvar compile = function(schema, cache, root, reporter, opts) {\n var fmts = opts ? xtend(formats, opts.formats) : formats\n var scope = {unique:unique, formats:fmts, isMultipleOf:isMultipleOf}\n var verbose = opts ? !!opts.verbose : false;\n var greedy = opts && opts.greedy !== undefined ?\n opts.greedy : false;\n\n var syms = {}\n var gensym = function(name) {\n return name+(syms[name] = (syms[name] || 0)+1)\n }\n\n var reversePatterns = {}\n var patterns = function(p) {\n if (reversePatterns[p]) return reversePatterns[p]\n var n = gensym('pattern')\n scope[n] = new RegExp(p)\n reversePatterns[p] = n\n return n\n }\n\n var vars = ['i','j','k','l','m','n','o','p','q','r','s','t','u','v','x','y','z']\n var genloop = function() {\n var v = vars.shift()\n vars.push(v+v[0])\n return v\n }\n\n var visit = function(name, node, reporter, filter) {\n var properties = node.properties\n var type = node.type\n var tuple = false\n\n if (Array.isArray(node.items)) { // tuple type\n properties = {}\n node.items.forEach(function(item, i) {\n properties[i] = item\n })\n type = 'array'\n tuple = true\n }\n\n var indent = 0\n var error = function(msg, prop, value) {\n validate('errors++')\n if (reporter === true) {\n validate('if (validate.errors === null) validate.errors = []')\n if (verbose) {\n validate('validate.errors.push({field:%s,message:%s,value:%s,type:%s})', formatName(prop || name), JSON.stringify(msg), value || name, JSON.stringify(type))\n } else {\n validate('validate.errors.push({field:%s,message:%s})', formatName(prop || name), JSON.stringify(msg))\n }\n }\n }\n\n if (node.required === true) {\n indent++\n validate('if (%s === undefined) {', name)\n error('is required')\n validate('} else {')\n } else {\n indent++\n validate('if (%s !== undefined) {', name)\n }\n\n var valid = [].concat(type)\n .map(function(t) {\n return types[t || 'any'](name)\n })\n .join(' || ') || 'true'\n\n if (valid !== 'true') {\n indent++\n validate('if (!(%s)) {', valid)\n error('is the wrong type')\n validate('} else {')\n }\n\n if (tuple) {\n if (node.additionalItems === false) {\n validate('if (%s.length > %d) {', name, node.items.length)\n error('has additional items')\n validate('}')\n } else if (node.additionalItems) {\n var i = genloop()\n validate('for (var %s = %d; %s < %s.length; %s++) {', i, node.items.length, i, name, i)\n visit(name+'['+i+']', node.additionalItems, reporter, filter)\n validate('}')\n }\n }\n\n if (node.format && fmts[node.format]) {\n if (type !== 'string' && formats[node.format]) validate('if (%s) {', types.string(name))\n var n = gensym('format')\n scope[n] = fmts[node.format]\n\n if (typeof scope[n] === 'function') validate('if (!%s(%s)) {', n, name)\n else validate('if (!%s.test(%s)) {', n, name)\n error('must be '+node.format+' format')\n validate('}')\n if (type !== 'string' && formats[node.format]) validate('}')\n }\n\n if (Array.isArray(node.required)) {\n var isUndefined = function(req) {\n return genobj(name, req) + ' === undefined'\n }\n\n var checkRequired = function (req) {\n var prop = genobj(name, req);\n validate('if (%s === undefined) {', prop)\n error('is required', prop)\n validate('missing++')\n validate('}')\n }\n validate('if ((%s)) {', type !== 'object' ? types.object(name) : 'true')\n validate('var missing = 0')\n node.required.map(checkRequired)\n validate('}');\n if (!greedy) {\n validate('if (missing === 0) {')\n indent++\n }\n }\n\n if (node.uniqueItems) {\n if (type !== 'array') validate('if (%s) {', types.array(name))\n validate('if (!(unique(%s))) {', name)\n error('must be unique')\n validate('}')\n if (type !== 'array') validate('}')\n }\n\n if (node.enum) {\n var complex = node.enum.some(function(e) {\n return typeof e === 'object'\n })\n\n var compare = complex ?\n function(e) {\n return 'JSON.stringify('+name+')'+' !== JSON.stringify('+JSON.stringify(e)+')'\n } :\n function(e) {\n return name+' !== '+JSON.stringify(e)\n }\n\n validate('if (%s) {', node.enum.map(compare).join(' && ') || 'false')\n error('must be an enum value')\n validate('}')\n }\n\n if (node.dependencies) {\n if (type !== 'object') validate('if (%s) {', types.object(name))\n\n Object.keys(node.dependencies).forEach(function(key) {\n var deps = node.dependencies[key]\n if (typeof deps === 'string') deps = [deps]\n\n var exists = function(k) {\n return genobj(name, k) + ' !== undefined'\n }\n\n if (Array.isArray(deps)) {\n validate('if (%s !== undefined && !(%s)) {', genobj(name, key), deps.map(exists).join(' && ') || 'true')\n error('dependencies not set')\n validate('}')\n }\n if (typeof deps === 'object') {\n validate('if (%s !== undefined) {', genobj(name, key))\n visit(name, deps, reporter, filter)\n validate('}')\n }\n })\n\n if (type !== 'object') validate('}')\n }\n\n if (node.additionalProperties || node.additionalProperties === false) {\n if (type !== 'object') validate('if (%s) {', types.object(name))\n\n var i = genloop()\n var keys = gensym('keys')\n\n var toCompare = function(p) {\n return keys+'['+i+'] !== '+JSON.stringify(p)\n }\n\n var toTest = function(p) {\n return '!'+patterns(p)+'.test('+keys+'['+i+'])'\n }\n\n var additionalProp = Object.keys(properties || {}).map(toCompare)\n .concat(Object.keys(node.patternProperties || {}).map(toTest))\n .join(' && ') || 'true'\n\n validate('var %s = Object.keys(%s)', keys, name)\n ('for (var %s = 0; %s < %s.length; %s++) {', i, i, keys, i)\n ('if (%s) {', additionalProp)\n\n if (node.additionalProperties === false) {\n if (filter) validate('delete %s', name+'['+keys+'['+i+']]')\n error('has additional properties', null, JSON.stringify(name+'.') + ' + ' + keys + '['+i+']')\n } else {\n visit(name+'['+keys+'['+i+']]', node.additionalProperties, reporter, filter)\n }\n\n validate\n ('}')\n ('}')\n\n if (type !== 'object') validate('}')\n }\n\n if (node.$ref) {\n var sub = get(root, opts && opts.schemas || {}, node.$ref)\n if (sub) {\n var fn = cache[node.$ref]\n if (!fn) {\n cache[node.$ref] = function proxy(data) {\n return fn(data)\n }\n fn = compile(sub, cache, root, false, opts)\n }\n var n = gensym('ref')\n scope[n] = fn\n validate('if (!(%s(%s))) {', n, name)\n error('referenced schema does not match')\n validate('}')\n }\n }\n\n if (node.not) {\n var prev = gensym('prev')\n validate('var %s = errors', prev)\n visit(name, node.not, false, filter)\n validate('if (%s === errors) {', prev)\n error('negative schema matches')\n validate('} else {')\n ('errors = %s', prev)\n ('}')\n }\n\n if (node.items && !tuple) {\n if (type !== 'array') validate('if (%s) {', types.array(name))\n\n var i = genloop()\n validate('for (var %s = 0; %s < %s.length; %s++) {', i, i, name, i)\n visit(name+'['+i+']', node.items, reporter, filter)\n validate('}')\n\n if (type !== 'array') validate('}')\n }\n\n if (node.patternProperties) {\n if (type !== 'object') validate('if (%s) {', types.object(name))\n var keys = gensym('keys')\n var i = genloop()\n validate\n ('var %s = Object.keys(%s)', keys, name)\n ('for (var %s = 0; %s < %s.length; %s++) {', i, i, keys, i)\n\n Object.keys(node.patternProperties).forEach(function(key) {\n var p = patterns(key)\n validate('if (%s.test(%s)) {', p, keys+'['+i+']')\n visit(name+'['+keys+'['+i+']]', node.patternProperties[key], reporter, filter)\n validate('}')\n })\n\n validate('}')\n if (type !== 'object') validate('}')\n }\n\n if (node.pattern) {\n var p = patterns(node.pattern)\n if (type !== 'string') validate('if (%s) {', types.string(name))\n validate('if (!(%s.test(%s))) {', p, name)\n error('pattern mismatch')\n validate('}')\n if (type !== 'string') validate('}')\n }\n\n if (node.allOf) {\n node.allOf.forEach(function(sch) {\n visit(name, sch, reporter, filter)\n })\n }\n\n if (node.anyOf && node.anyOf.length) {\n var prev = gensym('prev')\n\n node.anyOf.forEach(function(sch, i) {\n if (i === 0) {\n validate('var %s = errors', prev)\n } else {\n validate('if (errors !== %s) {', prev)\n ('errors = %s', prev)\n }\n visit(name, sch, false, false)\n })\n node.anyOf.forEach(function(sch, i) {\n if (i) validate('}')\n })\n validate('if (%s !== errors) {', prev)\n error('no schemas match')\n validate('}')\n }\n\n if (node.oneOf && node.oneOf.length) {\n var prev = gensym('prev')\n var passes = gensym('passes')\n\n validate\n ('var %s = errors', prev)\n ('var %s = 0', passes)\n\n node.oneOf.forEach(function(sch, i) {\n visit(name, sch, false, false)\n validate('if (%s === errors) {', prev)\n ('%s++', passes)\n ('} else {')\n ('errors = %s', prev)\n ('}')\n })\n\n validate('if (%s !== 1) {', passes)\n error('no (or more than one) schemas match')\n validate('}')\n }\n\n if (node.multipleOf !== undefined) {\n if (type !== 'number' && type !== 'integer') validate('if (%s) {', types.number(name))\n\n validate('if (!isMultipleOf(%s, %d)) {', name, node.multipleOf)\n\n error('has a remainder')\n validate('}')\n\n if (type !== 'number' && type !== 'integer') validate('}')\n }\n\n if (node.maxProperties !== undefined) {\n if (type !== 'object') validate('if (%s) {', types.object(name))\n\n validate('if (Object.keys(%s).length > %d) {', name, node.maxProperties)\n error('has more properties than allowed')\n validate('}')\n\n if (type !== 'object') validate('}')\n }\n\n if (node.minProperties !== undefined) {\n if (type !== 'object') validate('if (%s) {', types.object(name))\n\n validate('if (Object.keys(%s).length < %d) {', name, node.minProperties)\n error('has less properties than allowed')\n validate('}')\n\n if (type !== 'object') validate('}')\n }\n\n if (node.maxItems !== undefined) {\n if (type !== 'array') validate('if (%s) {', types.array(name))\n\n validate('if (%s.length > %d) {', name, node.maxItems)\n error('has more items than allowed')\n validate('}')\n\n if (type !== 'array') validate('}')\n }\n\n if (node.minItems !== undefined) {\n if (type !== 'array') validate('if (%s) {', types.array(name))\n\n validate('if (%s.length < %d) {', name, node.minItems)\n error('has less items than allowed')\n validate('}')\n\n if (type !== 'array') validate('}')\n }\n\n if (node.maxLength !== undefined) {\n if (type !== 'string') validate('if (%s) {', types.string(name))\n\n validate('if (%s.length > %d) {', name, node.maxLength)\n error('has longer length than allowed')\n validate('}')\n\n if (type !== 'string') validate('}')\n }\n\n if (node.minLength !== undefined) {\n if (type !== 'string') validate('if (%s) {', types.string(name))\n\n validate('if (%s.length < %d) {', name, node.minLength)\n error('has less length than allowed')\n validate('}')\n\n if (type !== 'string') validate('}')\n }\n\n if (node.minimum !== undefined) {\n validate('if (%s %s %d) {', name, node.exclusiveMinimum ? '<=' : '<', node.minimum)\n error('is less than minimum')\n validate('}')\n }\n\n if (node.maximum !== undefined) {\n validate('if (%s %s %d) {', name, node.exclusiveMaximum ? '>=' : '>', node.maximum)\n error('is more than maximum')\n validate('}')\n }\n\n if (properties) {\n Object.keys(properties).forEach(function(p) {\n if (Array.isArray(type) && type.indexOf('null') !== -1) validate('if (%s !== null) {', name)\n\n visit(genobj(name, p), properties[p], reporter, filter)\n\n if (Array.isArray(type) && type.indexOf('null') !== -1) validate('}')\n })\n }\n\n while (indent--) validate('}')\n }\n\n var validate = genfun\n ('function validate(data) {')\n ('validate.errors = null')\n ('var errors = 0')\n\n visit('data', schema, reporter, opts && opts.filter)\n\n validate\n ('return errors === 0')\n ('}')\n\n validate = validate.toFunction(scope)\n validate.errors = null\n\n if (Object.defineProperty) {\n Object.defineProperty(validate, 'error', {\n get: function() {\n if (!validate.errors) return ''\n return validate.errors.map(function(err) {\n return err.field + ' ' + err.message;\n }).join('\\n')\n }\n })\n }\n\n validate.toJSON = function() {\n return schema\n }\n\n return validate\n}\n\nmodule.exports = function(schema, opts) {\n if (typeof schema === 'string') schema = JSON.parse(schema)\n return compile(schema, {}, schema, true, opts)\n}\n\nmodule.exports.filter = function(schema, opts) {\n var validate = module.exports(schema, xtend(opts, {filter: true}))\n return function(sch) {\n validate(sch)\n return sch\n }\n}\n"} +{"text": "APE / Monkey's Audio plugin for DeaDBeeF\nCopyright (C) 2009-2014 Alexey Yakovenko \nbased on apedec from FFMpeg Copyright (c) 2007 Benjamin Zores \nbased upon libdemac from Dave Chapman.\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n"} +{"text": "# CMS Example\n\n*A React-Relay CMS UI example using graphql-pouch.*\n\nThis contains a complete example of React, Relay and GraphQL shorthand notation schema which will work with GraphQL-Pouch.\n\n## Setup\n\nSomehow you need to download this, do it however you like but we’ll go over how to do it with git here.\n\n```bash\ngit clone https://github.com/MikeBild/graphql-pouch.git\ncd graphql-pouch/example/cms-relay\n```\n\n## Running\n\n__First running GraphQL-Pouch__\n\n```bash\nnpm install\nnpm run graphql-pouch:schema\nnpm run graphql-pouch\n```\n\nThis will run the schema migration on your default schema and start GraphQL-Pouch. Navigate to the URL printed in your console and you see the GraphiQL-UI. Use it to navigate to the documentation for the GraphQL server.\n\n__Second running the React-React Relay application__\n\n```bash\nnpm start\n```\n\nThis will run the React-Relay build process and starts a separate server to serve the CMS application for development.\n"} +{"text": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \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": "\t.module crt0\n\t.globl\tl__INITIALIZER\n\t.globl\ts__INITIALIZED\n\t.globl\ts__INITIALIZER\n\t.globl\t_main\n\n\tvram_char_base_addr\t.equ\t0x8000\n\tvram_copy_ctrl_addr .equ 0x92c1\n\tcurser_addr \t.equ 0x92c2\n\n\t.area\t_HEADER (ABS)\n\t;; Reset vector\n\t.org \t0\n\tjp\tinit\n\n\t.org\t0x08\n\treti\n\t.org\t0x10\n\treti\n\t.org\t0x18\n\treti\n\t.org\t0x20\n\treti\n\t.org\t0x28\n\treti\n\t.org\t0x30\n\treti\n\t.org\t0x38\n\treti\n\n\t;; keyboard interrupt vector\n\t.org\t0x80\n\t.dw\t#0x1600\n\n\t.org\tcurser_addr\n\t.dw\tvram_char_base_addr\n\n\t.org\t0x100\ninit:\n\t;; Set stack pointer\n\tld\tsp,#0xff00\n\n\t;; set cursor address to 0\n\tld\thl, #vram_copy_ctrl_addr\n\tld\t(hl), #0xff\n\n\t;; Initialise global variables\n\tcall\tgsinit\n\n\t;; enable mode 2 interrupt \n\tld\ta, #0\n\tld\ti, a\t\t; load interrupt register\n\tim\t#2\n\tei\n\n\t;; go into main\n\tcall\t_main\n\tjp\t_exit\n\n\t;; Ordering of segments for the linker.\n\t.area\t_HOME\n\t.area\t_CODE\n\t.area\t_INITIALIZER\n\t.area _GSINIT\n\t.area _GSFINAL\n\n\t.area\t_DATA\n\t.area\t_INITIALIZED\n\t.area\t_BSEG\n\t.area _BSS\n\t.area _HEAP\n\n\t.area _CODE\n__clock::\n\tret\n\n_exit::\n\t;; Exit - special code to the emulator\n1$:\n\thalt\n\tjr\t1$\n\n\t.area _GSINIT\ngsinit::\n\tld\tbc, #l__INITIALIZER\n\tld\ta, b\n\tor\ta, c\n\tjr\tZ, gsinit_next\n\tld\tde, #s__INITIALIZED\n\tld\thl, #s__INITIALIZER\n\tldir\ngsinit_next:\n\t.area _GSFINAL\n\tret"} +{"text": "\n\n \n {bca37a72-5b07-46cf-b44e-89f8e06451a2}\n Release\n \n \n true\n \n \n true\n true\n Base\n \n \n true\n true\n Base\n \n \n true\n lib\n JPHNE\n NO_STRICT\n true\n true\n CppStaticLibrary\n true\n rtl.bpi;vcl.bpi;bcbie.bpi;vclx.bpi;vclactnband.bpi;xmlrtl.bpi;bcbsmp.bpi;dbrtl.bpi;vcldb.bpi;bdertl.bpi;vcldbx.bpi;dsnap.bpi;dsnapcon.bpi;vclib.bpi;ibxpress.bpi;adortl.bpi;dbxcds.bpi;dbexpress.bpi;DbxCommonDriver.bpi;websnap.bpi;vclie.bpi;webdsnap.bpi;inet.bpi;inetdbbde.bpi;inetdbxpress.bpi;soaprtl.bpi;Rave75VCL.bpi;teeUI.bpi;tee.bpi;teedb.bpi;IndyCore.bpi;IndySystem.bpi;IndyProtocols.bpi;IntrawebDB_90_100.bpi;Intraweb_90_100.bpi;dclZipForged11.bpi;vclZipForged11.bpi;GR32_BDS2006.bpi;GR32_DSGN_BDS2006.bpi;Jcl.bpi;JclVcl.bpi;JvCoreD11R.bpi;JvSystemD11R.bpi;JvStdCtrlsD11R.bpi;JvAppFrmD11R.bpi;JvBandsD11R.bpi;JvDBD11R.bpi;JvDlgsD11R.bpi;JvBDED11R.bpi;JvCmpD11R.bpi;JvCryptD11R.bpi;JvCtrlsD11R.bpi;JvCustomD11R.bpi;JvDockingD11R.bpi;JvDotNetCtrlsD11R.bpi;JvEDID11R.bpi;JvGlobusD11R.bpi;JvHMID11R.bpi;JvInterpreterD11R.bpi;JvJansD11R.bpi;JvManagedThreadsD11R.bpi;JvMMD11R.bpi;JvNetD11R.bpi;JvPageCompsD11R.bpi;JvPluginD11R.bpi;JvPrintPreviewD11R.bpi;JvRuntimeDesignD11R.bpi;JvTimeFrameworkD11R.bpi;JvValidatorsD11R.bpi;JvWizardD11R.bpi;JvXPCtrlsD11R.bpi;VclSmp.bpi;CExceptionExpert11.bpi\n false\n $(BDS)\\include;$(BDS)\\include\\dinkumware;$(BDS)\\include\\vcl;..\\src;..\\include;..\n rtl.lib;vcl.lib\n 32\n $(BDS)\\lib;$(BDS)\\lib\\obj;$(BDS)\\lib\\psdk\n \n \n false\n false\n true\n _DEBUG;$(Defines)\n true\n false\n true\n None\n DEBUG\n true\n Debug\n true\n true\n true\n $(BDS)\\lib\\debug;$(ILINK_LibraryPath)\n Full\n true\n \n \n NDEBUG;$(Defines)\n Release\n $(BDS)\\lib\\release;$(ILINK_LibraryPath)\n None\n \n \n CPlusPlusBuilder.Personality\n CppStaticLibrary\n \nFalseFalse1000FalseFalseFalseFalseFalse103312521.0.0.01.0.0.0FalseFalseFalseTrueFalse\n \n \n CodeGear C++Builder Office 2000 Servers Package\n CodeGear C++Builder Office XP Servers Package\n FalseTrueTrue3$(BDS)\\include;$(BDS)\\include\\dinkumware;$(BDS)\\include\\vcl;..\\src;..\\include;..$(BDS)\\include;$(BDS)\\include\\dinkumware;$(BDS)\\include\\vcl;..\\src;..\\include;..$(BDS)\\include;$(BDS)\\include\\dinkumware;$(BDS)\\include\\vcl;..\\src;..\\src;..\\include1$(BDS)\\lib;$(BDS)\\lib\\obj;$(BDS)\\lib\\psdk1NO_STRICT13216\n \n \n \n \n 3\n \n \n 4\n \n \n 5\n \n \n 6\n \n \n 7\n \n \n 8\n \n \n 0\n \n \n 1\n \n \n 2\n \n \n 9\n \n \n 10\n \n \n 11\n \n \n 12\n \n \n 14\n \n \n 13\n \n \n 15\n \n \n 16\n \n \n 17\n \n \n 18\n \n \n Cfg_1\n \n \n Cfg_2\n \n \n"} +{"text": "@charset \"utf-8\";\n\nbody {\n margin:0;\n}\n\n#mocha {\n font: 20px/1.5 \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n margin: 60px 50px;\n}\n\n#mocha ul,\n#mocha li {\n margin: 0;\n padding: 0;\n}\n\n#mocha ul {\n list-style: none;\n}\n\n#mocha h1,\n#mocha h2 {\n margin: 0;\n}\n\n#mocha h1 {\n margin-top: 15px;\n font-size: 1em;\n font-weight: 200;\n}\n\n#mocha h1 a {\n text-decoration: none;\n color: inherit;\n}\n\n#mocha h1 a:hover {\n text-decoration: underline;\n}\n\n#mocha .suite .suite h1 {\n margin-top: 0;\n font-size: .8em;\n}\n\n#mocha .hidden {\n display: none;\n}\n\n#mocha h2 {\n font-size: 12px;\n font-weight: normal;\n cursor: pointer;\n}\n\n#mocha .suite {\n margin-left: 15px;\n}\n\n#mocha .test {\n margin-left: 15px;\n overflow: hidden;\n}\n\n#mocha .test.pending:hover h2::after {\n content: '(pending)';\n font-family: arial, sans-serif;\n}\n\n#mocha .test.pass.medium .duration {\n background: #c09853;\n}\n\n#mocha .test.pass.slow .duration {\n background: #b94a48;\n}\n\n#mocha .test.pass::before {\n content: '✓';\n font-size: 12px;\n display: block;\n float: left;\n margin-right: 5px;\n color: #00d6b2;\n}\n\n#mocha .test.pass .duration {\n font-size: 9px;\n margin-left: 5px;\n padding: 2px 5px;\n color: #fff;\n -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);\n -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);\n box-shadow: inset 0 1px 1px rgba(0,0,0,.2);\n -webkit-border-radius: 5px;\n -moz-border-radius: 5px;\n -ms-border-radius: 5px;\n -o-border-radius: 5px;\n border-radius: 5px;\n}\n\n#mocha .test.pass.fast .duration {\n display: none;\n}\n\n#mocha .test.pending {\n color: #0b97c4;\n}\n\n#mocha .test.pending::before {\n content: '◦';\n color: #0b97c4;\n}\n\n#mocha .test.fail {\n color: #c00;\n}\n\n#mocha .test.fail pre {\n color: black;\n}\n\n#mocha .test.fail::before {\n content: '✖';\n font-size: 12px;\n display: block;\n float: left;\n margin-right: 5px;\n color: #c00;\n}\n\n#mocha .test pre.error {\n color: #c00;\n max-height: 300px;\n overflow: auto;\n}\n\n/**\n * (1): approximate for browsers not supporting calc\n * (2): 42 = 2*15 + 2*10 + 2*1 (padding + margin + border)\n * ^^ seriously\n */\n#mocha .test pre {\n display: block;\n float: left;\n clear: left;\n font: 12px/1.5 monaco, monospace;\n margin: 5px;\n padding: 15px;\n border: 1px solid #eee;\n max-width: 85%; /*(1)*/\n max-width: calc(100% - 42px); /*(2)*/\n word-wrap: break-word;\n border-bottom-color: #ddd;\n -webkit-border-radius: 3px;\n -webkit-box-shadow: 0 1px 3px #eee;\n -moz-border-radius: 3px;\n -moz-box-shadow: 0 1px 3px #eee;\n border-radius: 3px;\n}\n\n#mocha .test h2 {\n position: relative;\n}\n\n#mocha .test a.replay {\n position: absolute;\n top: 3px;\n right: 0;\n text-decoration: none;\n vertical-align: middle;\n display: block;\n width: 15px;\n height: 15px;\n line-height: 15px;\n text-align: center;\n background: #eee;\n font-size: 15px;\n -moz-border-radius: 15px;\n border-radius: 15px;\n -webkit-transition: opacity 200ms;\n -moz-transition: opacity 200ms;\n transition: opacity 200ms;\n opacity: 0.3;\n color: #888;\n}\n\n#mocha .test:hover a.replay {\n opacity: 1;\n}\n\n#mocha-report.pass .test.fail {\n display: none;\n}\n\n#mocha-report.fail .test.pass {\n display: none;\n}\n\n#mocha-report.pending .test.pass,\n#mocha-report.pending .test.fail {\n display: none;\n}\n#mocha-report.pending .test.pass.pending {\n display: block;\n}\n\n#mocha-error {\n color: #c00;\n font-size: 1.5em;\n font-weight: 100;\n letter-spacing: 1px;\n}\n\n#mocha-stats {\n position: fixed;\n top: 15px;\n right: 10px;\n font-size: 12px;\n margin: 0;\n color: #888;\n z-index: 1;\n}\n\n#mocha-stats .progress {\n float: right;\n padding-top: 0;\n}\n\n#mocha-stats em {\n color: black;\n}\n\n#mocha-stats a {\n text-decoration: none;\n color: inherit;\n}\n\n#mocha-stats a:hover {\n border-bottom: 1px solid #eee;\n}\n\n#mocha-stats li {\n display: inline-block;\n margin: 0 5px;\n list-style: none;\n padding-top: 11px;\n}\n\n#mocha-stats canvas {\n width: 40px;\n height: 40px;\n}\n\n#mocha code .comment { color: #ddd; }\n#mocha code .init { color: #2f6fad; }\n#mocha code .string { color: #5890ad; }\n#mocha code .keyword { color: #8a6343; }\n#mocha code .number { color: #2f6fad; }\n\n@media screen and (max-device-width: 480px) {\n #mocha {\n margin: 60px 0px;\n }\n\n #mocha #stats {\n position: absolute;\n }\n}\n"} +{"text": "/*\n * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.\n *\n * Copyright (c) 2008-2017 Oracle and/or its affiliates. All rights reserved.\n *\n * The contents of this file are subject to the terms of either the GNU\n * General Public License Version 2 only (\"GPL\") or the Common Development\n * and Distribution License(\"CDDL\") (collectively, the \"License\"). You\n * may not use this file except in compliance with the License. You can\n * obtain a copy of the License at\n * https://oss.oracle.com/licenses/CDDL+GPL-1.1\n * or LICENSE.txt. See the License for the specific\n * language governing permissions and limitations under the License.\n *\n * When distributing the software, include this License Header Notice in each\n * file and include the License file at LICENSE.txt.\n *\n * GPL Classpath Exception:\n * Oracle designates this particular file as subject to the \"Classpath\"\n * exception as provided by Oracle in the GPL Version 2 section of the License\n * file that accompanied this code.\n *\n * Modifications:\n * If applicable, add the following below the License Header, with the fields\n * enclosed by brackets [] replaced by your own identifying information:\n * \"Portions Copyright [year] [name of copyright owner]\"\n *\n * Contributor(s):\n * If you wish your version of this file to be governed by only the CDDL or\n * only the GPL Version 2, indicate your decision by adding \"[Contributor]\n * elects to include this software in this distribution under the [CDDL or GPL\n * Version 2] license.\" If you don't indicate a single choice of license, a\n * recipient has the option to distribute your version of this file under\n * either the CDDL, the GPL Version 2 or to extend the choice of license to\n * its licensees as provided above. However, if you add GPL Version 2 code\n * and therefore, elected the GPL Version 2 license, then the option applies\n * only if the new code is made subject to such option by the copyright\n * holder.\n */\n\npackage com.sun.enterprise.naming.impl;\n\nimport org.glassfish.api.naming.GlassfishNamingManager;\nimport org.glassfish.api.naming.JNDIBinding;\nimport com.sun.enterprise.naming.spi.NamingObjectFactory;\nimport org.junit.*;\nimport static org.junit.Assert.*;\nimport org.glassfish.api.invocation.ComponentInvocation;\nimport org.glassfish.api.invocation.InvocationException;\nimport org.glassfish.api.invocation.InvocationManager;\nimport org.glassfish.api.invocation.InvocationManagerImpl;\n\nimport javax.naming.Context;\nimport javax.naming.InitialContext;\nimport javax.naming.NamingException;\nimport javax.naming.spi.NamingManager;\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport java.util.Properties;\n\npublic class AppTest {\n private static final String INITIAL_CONTEXT_TEST_MODE = \"com.sun.enterprise.naming.TestMode\";\n\n @Test public void testCreateNewInitialContext() {\n try {\n newInitialContext();\n assert (true);\n } catch (Exception ex) {\n ex.printStackTrace();\n assert (false);\n }\n }\n\n @Test public void testBind() {\n GlassfishNamingManager nm = null;\n try {\n InvocationManager im = new InvocationManagerImpl();\n InitialContext ic = newInitialContext();\n nm = new GlassfishNamingManagerImpl(ic);\n nm.publishObject(\"foo\", \"Hello: foo\", false);\n System.out.println(\"**lookup() ==> \" + ic.lookup(\"foo\"));\n assert (true);\n } catch (Exception ex) {\n ex.printStackTrace();\n assert (false);\n } finally {\n try {\n nm.unpublishObject(\"foo\");\n } catch (Exception ex) {\n\n }\n }\n }\n\n @Test(expected = Exception.class) public void testEmptySubContext() throws Exception {\n String name1 = \"rmi://a//b/c/d/name1\";\n Context ctx = newInitialContext();\n ctx.bind(name1, \"Name1\");\n String val = (String) ctx.lookup(name1);\n }\n\n\n @Test public void testCachingNamingObjectFactory() {\n GlassfishNamingManagerImpl nm = null;\n try {\n InvocationManager im = new InvocationManagerImpl();\n InitialContext ic = newInitialContext();\n nm = new GlassfishNamingManagerImpl(ic);\n nm.publishObject(\"foo\", \"Hello: foo\", false);\n System.out.println(\"**lookup() ==> \" + ic.lookup(\"foo\"));\n\n NamingObjectFactory factory = new NamingObjectFactory() {\n private int counter = 1;\n\n public boolean isCreateResultCacheable() {\n return true;\n }\n\n public Object create(Context ic) {\n return (\"FACTORY_Created: \" + counter++);\n }\n\n public String toString() {\n return \"Huh? \";\n }\n };\n nm.publishObject(\"bar\", factory, false);\n System.out.println(\"**lookup() ==> \" + ic.lookup(\"bar\"));\n System.out.println(\"**lookup() ==> \" + ic.lookup(\"bar\"));\n assert (true);\n } catch (Exception ex) {\n ex.printStackTrace();\n assert (false);\n } finally {\n try {\n nm.unpublishObject(\"foo\");\n nm.unpublishObject(\"bar\");\n } catch (Exception ex) {\n\t\t//ignore\n }\n }\n }\n\n private static class Binding\n implements JNDIBinding {\n String logicalName;\n Object value;\n\n public Binding(String logicalName, Object value) {\n this.logicalName = \"java:comp/env/\" + logicalName;\n this.value = value;\n }\n\n public String getName() {\n return logicalName;\n }\n\n public String getJndiName() {\n return null;\n }\n\n public Object getValue() {\n return value;\n }\n } \n\n @Test public void testEmptyJavaCompEnv() {\n GlassfishNamingManagerImpl nm = null;\n InvocationManager im = new InvocationManagerImpl();\n ComponentInvocation inv = null;\n try {\n InitialContext ic = newInitialContext();\n triggerLoadingNamedProxies(ic);\n nm = new GlassfishNamingManagerImpl(ic);\n nm.setInvocationManager(im);\n\n inv = new ComponentInvocation(\"comp1\",\n ComponentInvocation.ComponentInvocationType.EJB_INVOCATION,\n null, null, null);\n im.preInvoke(inv);\n\n nm.bindToComponentNamespace(\"app1\", \"mod1\", \"comp1\", false, new ArrayList());\n\n Context ctx = (Context) ic.lookup(\"java:comp/env\");\n System.out.println(\"**lookup(java:comp/env) ==> \" + ctx);\n } catch (javax.naming.NamingException nnfEx) {\n nnfEx.printStackTrace();\n assert (false);\n }\n }\n\n @Test public void testNonCachingNamingObjectFactory() {\n GlassfishNamingManagerImpl nm = null;\n InvocationManager im = new InvocationManagerImpl();\n ComponentInvocation inv = null;\n try {\n InitialContext ic = newInitialContext();\n triggerLoadingNamedProxies(ic);\n nm = new GlassfishNamingManagerImpl(ic);\n nm.setInvocationManager(im);\n\n List bindings =\n new ArrayList();\n\n NamingObjectFactory intFactory = new NamingObjectFactory() {\n private int counter = 1;\n\n public boolean isCreateResultCacheable() {\n return false;\n }\n\n public Object create(Context ic) {\n return new Integer(++counter);\n }\n\n public String toString() {\n return \"Huh? \";\n }\n };\n bindings.add(new Binding(\"conf/area\", intFactory));\n bindings.add(new Binding(\"conf/location\", \"Santa Clara\"));\n\n nm.bindToComponentNamespace(\"app1\", \"mod1\", \"comp1\", false, bindings);\n\n inv = new ComponentInvocation(\"comp1\",\n ComponentInvocation.ComponentInvocationType.EJB_INVOCATION,\n null, null, null);\n im.preInvoke(inv);\n \n System.out.println(\"**lookup(java:comp/env/conf/area) ==> \" + ic.lookup(\"java:comp/env/conf/area\"));\n System.out.println(\"**lookup(java:comp/env/conf/location) ==> \" + ic.lookup(\"java:comp/env/conf/location\"));\n\n NamingObjectFactory floatFactory = new NamingObjectFactory() {\n private int counter = 1;\n\n public boolean isCreateResultCacheable() {\n return false;\n }\n\n public Object create(Context ic) {\n return Float.valueOf((\"7\" + (++counter)) + \".\" + 2323);\n }\n\n public String toString() {\n return \"Huh? \";\n }\n };\n List bindings2 =\n new ArrayList();\n bindings2.add(new Binding(\"conf/area\", floatFactory));\n bindings2.add(new Binding(\"conf/location\", \"Santa Clara[14]\"));\n\n nm.bindToComponentNamespace(\"app1\", \"mod1\", \"comp2\", false, bindings2);\n\n inv = new ComponentInvocation(\"comp2\",\n ComponentInvocation.ComponentInvocationType.EJB_INVOCATION,\n null, null, null);\n im.preInvoke(inv);\n System.out.println(\"**lookup(java:comp/env/conf/area) ==> \" + ic.lookup(\"java:comp/env/conf/area\"));\n System.out.println(\"**lookup(java:comp/env/conf/location) ==> \" + ic.lookup(\"java:comp/env/conf/location\"));\n\n assert (true);\n } catch (InvocationException inEx) {\n inEx.printStackTrace();\n assert(false);\n } catch (Exception ex) {\n ex.printStackTrace();\n assert (false);\n } finally {\n try {\n im.postInvoke(inv);\n nm.unbindComponentObjects(\"comp1\");\n } catch (InvocationException inEx) {\n \n } catch (Exception ex) {\n\n }\n }\n }\n\n /**\n * Performs an ignored test lookup to trigger the initial loading of named proxies.\n * See NamedNamingObjectManager.checkAndLoadProxies, which creates a default \n * GlassFishNamingManagerImpl. This is not what we want in this test class; we\n * want our own instance of GlassFishNamingManagerImpl that takes our own\n * InvocationManagerImpl. \n * GlassFishNamingManagerImpl(InitialContext) calls JavaURLContext.setNamingManager(this)\n * to save the GlassFishNamingManagerImpl into JavaURLContext, so the last call wins.\n * We want to make sure our test GlassFishNamingManagerImpl is instantiated after the \n * default one.\n */\n private void triggerLoadingNamedProxies(InitialContext ic) {\n try {\n ic.lookup(\"java:comp/env/to-be-ingored\");\n } catch (Exception ignore) {\n }\n }\n\n private InitialContext newInitialContext() throws NamingException {\n\n\t// Create a special InitialContext for test purposes\n\t// Can't just do a new no-arg InitialContext() since\n\t// this code runs outside a managed environment and the\n\t// normal behavior would be to try to contact a server.\n\t// Instead, create an initialcontext with a special\n\t// property to tell InitialContext to act as if it's\n\t// running in the server.\n\tProperties props = new Properties();\n\tprops.setProperty( SerialContext.INITIAL_CONTEXT_TEST_MODE, \"true\");\n\t\n\treturn new InitialContext( props );\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.hadoop.mapreduce.lib.partition;\n\nimport org.apache.hadoop.conf.Configuration;\nimport org.apache.hadoop.io.BinaryComparable;\nimport org.apache.hadoop.io.BytesWritable;\nimport org.apache.hadoop.util.ReflectionUtils;\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertTrue;\n\npublic class TestBinaryPartitioner {\n\n @Test\n public void testDefaultOffsets() {\n Configuration conf = new Configuration();\n BinaryPartitioner partitioner = \n ReflectionUtils.newInstance(BinaryPartitioner.class, conf);\n \n BinaryComparable key1 = new BytesWritable(new byte[] { 1, 2, 3, 4, 5 }); \n BinaryComparable key2 = new BytesWritable(new byte[] { 1, 2, 3, 4, 5 });\n int partition1 = partitioner.getPartition(key1, null, 10);\n int partition2 = partitioner.getPartition(key2, null, 10);\n assertEquals(partition1, partition2);\n \n key1 = new BytesWritable(new byte[] { 1, 2, 3, 4, 5 }); \n key2 = new BytesWritable(new byte[] { 6, 2, 3, 4, 5 });\n partition1 = partitioner.getPartition(key1, null, 10);\n partition2 = partitioner.getPartition(key2, null, 10);\n assertTrue(partition1 != partition2);\n \n key1 = new BytesWritable(new byte[] { 1, 2, 3, 4, 5 }); \n key2 = new BytesWritable(new byte[] { 1, 2, 3, 4, 6 });\n partition1 = partitioner.getPartition(key1, null, 10);\n partition2 = partitioner.getPartition(key2, null, 10);\n assertTrue(partition1 != partition2);\n }\n\n @Test\n public void testCustomOffsets() {\n Configuration conf = new Configuration();\n BinaryComparable key1 = new BytesWritable(new byte[] { 1, 2, 3, 4, 5 }); \n BinaryComparable key2 = new BytesWritable(new byte[] { 6, 2, 3, 7, 8 });\n \n BinaryPartitioner.setOffsets(conf, 1, -3);\n BinaryPartitioner partitioner = \n ReflectionUtils.newInstance(BinaryPartitioner.class, conf);\n int partition1 = partitioner.getPartition(key1, null, 10);\n int partition2 = partitioner.getPartition(key2, null, 10);\n assertEquals(partition1, partition2);\n \n BinaryPartitioner.setOffsets(conf, 1, 2);\n partitioner = ReflectionUtils.newInstance(BinaryPartitioner.class, conf);\n partition1 = partitioner.getPartition(key1, null, 10);\n partition2 = partitioner.getPartition(key2, null, 10);\n assertEquals(partition1, partition2);\n \n BinaryPartitioner.setOffsets(conf, -4, -3);\n partitioner = ReflectionUtils.newInstance(BinaryPartitioner.class, conf);\n partition1 = partitioner.getPartition(key1, null, 10);\n partition2 = partitioner.getPartition(key2, null, 10);\n assertEquals(partition1, partition2);\n }\n\n @Test\n public void testLowerBound() {\n Configuration conf = new Configuration();\n BinaryPartitioner.setLeftOffset(conf, 0);\n BinaryPartitioner partitioner = \n ReflectionUtils.newInstance(BinaryPartitioner.class, conf);\n BinaryComparable key1 = new BytesWritable(new byte[] { 1, 2, 3, 4, 5 }); \n BinaryComparable key2 = new BytesWritable(new byte[] { 6, 2, 3, 4, 5 });\n int partition1 = partitioner.getPartition(key1, null, 10);\n int partition2 = partitioner.getPartition(key2, null, 10);\n assertTrue(partition1 != partition2);\n }\n\n @Test\n public void testUpperBound() {\n Configuration conf = new Configuration();\n BinaryPartitioner.setRightOffset(conf, 4);\n BinaryPartitioner partitioner = \n ReflectionUtils.newInstance(BinaryPartitioner.class, conf);\n BinaryComparable key1 = new BytesWritable(new byte[] { 1, 2, 3, 4, 5 }); \n BinaryComparable key2 = new BytesWritable(new byte[] { 1, 2, 3, 4, 6 });\n int partition1 = partitioner.getPartition(key1, null, 10);\n int partition2 = partitioner.getPartition(key2, null, 10);\n assertTrue(partition1 != partition2);\n }\n \n}\n"} +{"text": "// Copyright 2019 the V8 project authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n// Flags: --harmony-dynamic-import --harmony-top-level-await\n\nlet ran = false;\ntry {\n await import('modules-skip-2.mjs');\n assertUnreachable();\n} catch (e) {\n assertEquals(e.message, '42 is not the answer');\n ran = true;\n}\n\nassertEquals(ran, true);\n"} +{"text": "2--Demonstration/2_Demonstration_Demonstrators_2_170.jpg\n6\n868.343 193.832 54.4077 66.9554 0.99885\n736.538 142.808 63.3545 77.9676 0.997843\n316.051 116.632 62.1965 92.3622 0.989491\n928.815 175.483 78.1857 89.9104 0.984661\n586.595 102.186 51.4946 63.0324 0.983172\n41.7971 116.82 24.3712 33.2697 0.899043\n"} +{"text": "package chat.rocket.android.chatdetails.ui\n\nimport android.view.ViewGroup\nimport androidx.recyclerview.widget.RecyclerView\nimport chat.rocket.android.R\nimport chat.rocket.android.chatdetails.adapter.OptionItemHolder\nimport chat.rocket.android.chatdetails.adapter.OptionViewHolder\nimport chat.rocket.android.chatdetails.domain.Option\nimport chat.rocket.android.util.extensions.inflate\n\nclass ChatDetailsAdapter: RecyclerView.Adapter() {\n private val options: MutableList
    \n\n Adatvédelmi irányelvek\n

    Ez az oldal nyújt tájékoztatást az applikációnkat (monerujo: Monero pénztárca)\n használók személyes információinak gyűjtésére, felhasználására és közzétételére\n vonatkozó irányelveinkről.\n

    \n

    Az applikáció használatával elfogadod az ezen irányelveknek megfelelő\n információgyűjtést és azok felhasználását.\n

    \n

    Gyűjtött adatok

    \n

    Személyes adat bármi olyan adat, mely személyazonosításra alkalmas.\n

    \n

    A Monero-kulcsok és a nyilvános címek az applikáció által helyileg kerülnek\n összegyűjtésre és feldolgozásra a tranzakciók lebonyolítása céljából, majd ezek\n titkosított formában kerülnek továbbításra a Monero hálózatába.\n

    \n

    Más személyes adatot nem gyűjt az applikáció.

    \n

    Az átváltási funkció (opcionális) használata esetén a monerujo a coinmarketcap.com\n nyilvános API-ján keresztül kéri le az árfolyamot.\n A kéréseid során történő adatgyűjtés módjával kapcsolatban tekintsd meg az adatvédelmi\n irányelveiket a https://coinmarketcap.com/privacy weboldalon.

    \n

    Ha BTC-címekre való fizetésre használod az applikációt, akkor az XMR.TO szolgáltatását\n használod. Részletes adatvédelmi irányelveiket a https://xmr.to/ weboldalon tekintheted meg.\n A monerujo számukra a kedvezményezett BTC-címet és a küldeni kívánt mennyiséget közli meg,\n ám az IP-címed is begyűjthető.

    \n

    Applikációengedélyek

    \n
      \n
    • INTERNET : csatlakozás a Monero-hálózathoz egy Monero daemon csomóponton keresztül
    • \n
    • READ_EXTERNAL_STORAGE : az eszközön tárolt tárcafájlok olvasása
    • \n
    • WRITE_EXTERNAL_STORAGE : az eszközön tárolt tárcafájlok írása
    • \n
    • WAKE_LOCK : az eszköz ébren tartása szinkronizálás közben
    • \n
    • CAMERA : QR-kódok beolvasása Monero fogadásához
    • \n
    \n

    Az adatvédelmi irányelvek módosításai

    \n

    Az adatvédelmi irányelveket időnként frissíthetjük. Bármiféle módosításról\n értesíteni fogunk az új adatvédelmi irányelvek applikációban és weboldalon (www.monerujo.io)\n történő közzétételével.\n Javasolt az adatvédelmi irányelvek időközönkénti átolvasása a változásokról való értesülés céljából.\n

    Az adatvédelmi irányelvek legutolsó frissítése: 2017. november 10.\n

    \n

    Lépj kapcsolatba velünk

    \n

    Ha bármilyen kérdésed merül fel az adatvédelmi irányelveinkkel vagy az adatok\n gyűjtésével és feldolgozásával kapcsolatban, úgy kérlek, írj e-mailt a privacy@monerujo.io címre.\n

    \n ]]>
    \n\n"} +{"text": "// --------------------------------------------------------------------------\n// OpenMS -- Open-Source Mass Spectrometry\n// --------------------------------------------------------------------------\n// Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,\n// ETH Zurich, and Freie Universitaet Berlin 2002-2020.\n//\n// This software is released under a three-clause BSD license:\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// * Neither the name of any author or any participating institution\n// may be used to endorse or promote products derived from this software\n// without specific prior written permission.\n// For a full list of authors, refer to the file AUTHORS.\n// --------------------------------------------------------------------------\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n// ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING\n// INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\n// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// --------------------------------------------------------------------------\n// $Maintainer: Mathias Walzer $\n// $Authors: $\n// --------------------------------------------------------------------------\n//\n\n#include \n\nusing namespace std;\n\nnamespace OpenMS\n{\n WindowMower::WindowMower() :\n DefaultParamHandler(\"WindowMower\")\n {\n defaults_.setValue(\"windowsize\", 50.0, \"The size of the sliding window along the m/z axis.\");\n defaults_.setValue(\"peakcount\", 2, \"The number of peaks that should be kept.\");\n defaults_.setValue(\"movetype\", \"slide\", \"Whether sliding window (one peak steps) or jumping window (window size steps) should be used.\");\n defaults_.setValidStrings(\"movetype\", ListUtils::create(\"slide,jump\"));\n defaultsToParam_();\n }\n\n WindowMower::~WindowMower()\n {\n }\n\n WindowMower::WindowMower(const WindowMower & source) :\n DefaultParamHandler(source)\n {\n }\n\n WindowMower & WindowMower::operator=(const WindowMower & source)\n {\n if (this != &source)\n {\n DefaultParamHandler::operator=(source);\n }\n return *this;\n }\n\n void WindowMower::filterPeakSpectrum(PeakSpectrum & spectrum)\n {\n bool sliding = (String)param_.getValue(\"movetype\") == \"slide\" ? true : false;\n\n if (sliding)\n {\n filterPeakSpectrumForTopNInSlidingWindow(spectrum);\n }\n else\n {\n filterPeakSpectrumForTopNInJumpingWindow(spectrum);\n }\n }\n\n void WindowMower::filterPeakMap(PeakMap & exp)\n {\n bool sliding = (String)param_.getValue(\"movetype\") == \"slide\" ? true : false;\n for (PeakMap::Iterator it = exp.begin(); it != exp.end(); ++it)\n {\n if (sliding)\n {\n filterPeakSpectrumForTopNInSlidingWindow(*it);\n }\n else\n {\n filterPeakSpectrumForTopNInJumpingWindow(*it);\n }\n }\n }\n\n}\n"} +{"text": "\n\n \n \n"} +{"text": "\n\n\n \n Visitera\n \n \n {% style \"/assets/bulma/css/bulma.min.css\" %}\n {% style \"/assets/font-awesome/css/all.css\" %}\n \n\n \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n {% block form %}\n {% endblock %}\n
    \n
    \n
    \n
    \n
    \n
    \n \n\n \n \n"} +{"text": "using UnityEngine;\nusing System;\nusing System.Collections.Generic;\nusing LuaInterface;\nusing LuaFramework;\nusing UnityEditor;\n\nusing BindType = ToLuaMenu.BindType;\nusing System.Reflection;\n\npublic static class CustomSettings\n{\n public static string FrameworkPath = AppConst.FrameworkRoot;\n public static string saveDir = FrameworkPath + \"/ToLua/Source/Generate/\";\n public static string luaDir = FrameworkPath + \"/Lua/\";\n public static string toluaBaseType = FrameworkPath + \"/ToLua/BaseType/\";\n\tpublic static string baseLuaDir = FrameworkPath + \"/ToLua/Lua\";\n\tpublic static string injectionFilesPath = Application.dataPath + \"/ToLua/Injection/\";\n\n //导出时强制做为静态类的类型(注意customTypeList 还要添加这个类型才能导出)\n //unity 有些类作为sealed class, 其实完全等价于静态类\n public static List staticClassTypes = new List\n { \n typeof(UnityEngine.Application),\n typeof(UnityEngine.Time),\n typeof(UnityEngine.Screen),\n typeof(UnityEngine.SleepTimeout),\n typeof(UnityEngine.Input),\n typeof(UnityEngine.Resources),\n typeof(UnityEngine.Physics),\n typeof(UnityEngine.RenderSettings),\n typeof(UnityEngine.QualitySettings),\n typeof(UnityEngine.GL),\n typeof(UnityEngine.Graphics),\n };\n\n //附加导出委托类型(在导出委托时, customTypeList 中牵扯的委托类型都会导出, 无需写在这里)\n public static DelegateType[] customDelegateList = \n { \n _DT(typeof(Action)), \n _DT(typeof(UnityEngine.Events.UnityAction)),\n _DT(typeof(System.Predicate)),\n _DT(typeof(System.Action)),\n _DT(typeof(System.Comparison)),\n _DT(typeof(System.Func)),\n };\n\n //在这里添加你要导出注册到lua的类型列表\n public static BindType[] customTypeList =\n { \n //------------------------为例子导出--------------------------------\n //_GT(typeof(TestEventListener)),\n //_GT(typeof(TestProtol)),\n //_GT(typeof(TestAccount)),\n //_GT(typeof(Dictionary)).SetLibName(\"AccountMap\"),\n //_GT(typeof(KeyValuePair)),\n //_GT(typeof(Dictionary.KeyCollection)),\n //_GT(typeof(Dictionary.ValueCollection)),\n //_GT(typeof(TestExport)),\n //_GT(typeof(TestExport.Space)),\n //------------------------------------------------------------------- \n \n _GT(typeof(LuaInjectionStation)),\n _GT(typeof(InjectType)),\n _GT(typeof(Debugger)).SetNameSpace(null), \n\n#if USING_DOTWEENING\n _GT(typeof(DG.Tweening.DOTween)),\n _GT(typeof(DG.Tweening.Tween)).SetBaseType(typeof(System.Object)).AddExtendType(typeof(DG.Tweening.TweenExtensions)),\n _GT(typeof(DG.Tweening.Sequence)).AddExtendType(typeof(DG.Tweening.TweenSettingsExtensions)),\n _GT(typeof(DG.Tweening.Tweener)).AddExtendType(typeof(DG.Tweening.TweenSettingsExtensions)),\n _GT(typeof(DG.Tweening.LoopType)),\n _GT(typeof(DG.Tweening.PathMode)),\n _GT(typeof(DG.Tweening.PathType)),\n _GT(typeof(DG.Tweening.RotateMode)),\n _GT(typeof(Component)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),\n _GT(typeof(Transform)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),\n _GT(typeof(Light)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),\n _GT(typeof(Material)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),\n _GT(typeof(Rigidbody)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),\n _GT(typeof(Camera)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),\n _GT(typeof(AudioSource)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),\n //_GT(typeof(LineRenderer)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),\n //_GT(typeof(TrailRenderer)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)), \n#else\n \n _GT(typeof(Component)),\n _GT(typeof(Transform)),\n _GT(typeof(Material)),\n _GT(typeof(Light)),\n _GT(typeof(Rigidbody)),\n _GT(typeof(Camera)),\n _GT(typeof(AudioSource)),\n //_GT(typeof(LineRenderer))\n //_GT(typeof(TrailRenderer))\n#endif\n \n _GT(typeof(Behaviour)),\n _GT(typeof(MonoBehaviour)), \n _GT(typeof(GameObject)),\n _GT(typeof(TrackedReference)),\n _GT(typeof(Application)),\n _GT(typeof(Physics)),\n _GT(typeof(Collider)),\n _GT(typeof(Time)), \n _GT(typeof(Texture)),\n _GT(typeof(Texture2D)),\n _GT(typeof(Shader)), \n _GT(typeof(Renderer)),\n _GT(typeof(WWW)),\n _GT(typeof(Screen)), \n _GT(typeof(CameraClearFlags)),\n _GT(typeof(AudioClip)), \n _GT(typeof(AssetBundle)),\n _GT(typeof(ParticleSystem)),\n _GT(typeof(AsyncOperation)).SetBaseType(typeof(System.Object)), \n _GT(typeof(LightType)),\n _GT(typeof(SleepTimeout)),\n#if UNITY_5_3_OR_NEWER && !UNITY_5_6_OR_NEWER\n _GT(typeof(UnityEngine.Experimental.Director.DirectorPlayer)),\n#endif\n _GT(typeof(Animator)),\n _GT(typeof(Input)),\n _GT(typeof(KeyCode)),\n _GT(typeof(SkinnedMeshRenderer)),\n _GT(typeof(Space)), \n \n\n _GT(typeof(MeshRenderer)),\n#if !UNITY_5_4_OR_NEWER\n _GT(typeof(ParticleEmitter)),\n _GT(typeof(ParticleRenderer)),\n _GT(typeof(ParticleAnimator)), \n#endif\n\n _GT(typeof(BoxCollider)),\n _GT(typeof(MeshCollider)),\n _GT(typeof(SphereCollider)), \n _GT(typeof(CharacterController)),\n _GT(typeof(CapsuleCollider)),\n \n _GT(typeof(Animation)), \n _GT(typeof(AnimationClip)).SetBaseType(typeof(UnityEngine.Object)), \n _GT(typeof(AnimationState)),\n _GT(typeof(AnimationBlendMode)),\n _GT(typeof(QueueMode)), \n _GT(typeof(PlayMode)),\n _GT(typeof(WrapMode)),\n\n _GT(typeof(QualitySettings)),\n _GT(typeof(RenderSettings)), \n _GT(typeof(BlendWeights)), \n _GT(typeof(RenderTexture)), \n\t\t_GT(typeof(Resources)),\n\t\t_GT(typeof(LuaProfiler)), \n \n //for LuaFramework\n _GT(typeof(UIPanel)),\n _GT(typeof(UILabel)),\n _GT(typeof(UIGrid)),\n _GT(typeof(Util)),\n _GT(typeof(WrapGrid)),\n _GT(typeof(AppConst)),\n _GT(typeof(LuaHelper)),\n _GT(typeof(ByteBuffer)),\n _GT(typeof(LuaBehaviour)),\n\n _GT(typeof(GameManager)),\n _GT(typeof(LuaManager)),\n _GT(typeof(PanelManager)),\n _GT(typeof(SoundManager)),\n _GT(typeof(TimerManager)),\n _GT(typeof(ThreadManager)),\n _GT(typeof(NetworkManager)),\n _GT(typeof(ResourceManager)),\t\t \n };\n\n public static List dynamicList = new List()\n {\n typeof(MeshRenderer),\n#if !UNITY_5_4_OR_NEWER\n typeof(ParticleEmitter),\n typeof(ParticleRenderer),\n typeof(ParticleAnimator),\n#endif\n\n typeof(BoxCollider),\n typeof(MeshCollider),\n typeof(SphereCollider),\n typeof(CharacterController),\n typeof(CapsuleCollider),\n\n typeof(Animation),\n typeof(AnimationClip),\n typeof(AnimationState),\n\n typeof(BlendWeights),\n typeof(RenderTexture),\n typeof(Rigidbody),\n };\n\n //重载函数,相同参数个数,相同位置out参数匹配出问题时, 需要强制匹配解决\n //使用方法参见例子14\n public static List outList = new List()\n {\n \n };\n \n //ngui优化,下面的类没有派生类,可以作为sealed class\n public static List sealedList = new List()\n {\n /*typeof(Transform),\n typeof(UIRoot),\n typeof(UICamera),\n typeof(UIViewport),\n typeof(UIPanel),\n typeof(UILabel),\n typeof(UIAnchor),\n typeof(UIAtlas),\n typeof(UIFont),\n typeof(UITexture),\n typeof(UISprite),\n typeof(UIGrid),\n typeof(UITable),\n typeof(UIWrapGrid),\n typeof(UIInput),\n typeof(UIScrollView),\n typeof(UIEventListener),\n typeof(UIScrollBar),\n typeof(UICenterOnChild),\n typeof(UIScrollView), \n typeof(UIButton),\n typeof(UITextList),\n typeof(UIPlayTween),\n typeof(UIDragScrollView),\n typeof(UISpriteAnimation),\n typeof(UIWrapContent),\n typeof(TweenWidth),\n typeof(TweenAlpha),\n typeof(TweenColor),\n typeof(TweenRotation),\n typeof(TweenPosition),\n typeof(TweenScale),\n typeof(TweenHeight),\n typeof(TypewriterEffect),\n typeof(UIToggle),\n typeof(Localization),*/\n };\n\n public static BindType _GT(Type t)\n {\n return new BindType(t);\n }\n\n public static DelegateType _DT(Type t)\n {\n return new DelegateType(t);\n } \n\n\n [MenuItem(\"Lua/Attach Profiler\", false, 151)]\n static void AttachProfiler()\n {\n if (!Application.isPlaying)\n {\n EditorUtility.DisplayDialog(\"警告\", \"请在运行时执行此功能\", \"确定\");\n return;\n }\n\n LuaClient.Instance.AttachProfiler();\n }\n\n [MenuItem(\"Lua/Detach Profiler\", false, 152)]\n static void DetachProfiler()\n {\n if (!Application.isPlaying)\n { \n return;\n }\n\n LuaClient.Instance.DetachProfiler();\n }\n}\n"} +{"text": "/*\nCopyright (c) 2014 Ashley Jeffs\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n// Package gabs implements a simplified wrapper around creating and parsing\n// unknown or dynamic JSON.\npackage gabs\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n//------------------------------------------------------------------------------\n\nvar (\n\t// ErrOutOfBounds indicates an index was out of bounds.\n\tErrOutOfBounds = errors.New(\"out of bounds\")\n\n\t// ErrNotObjOrArray is returned when a target is not an object or array type\n\t// but needs to be for the intended operation.\n\tErrNotObjOrArray = errors.New(\"not an object or array\")\n\n\t// ErrNotObj is returned when a target is not an object but needs to be for\n\t// the intended operation.\n\tErrNotObj = errors.New(\"not an object\")\n\n\t// ErrNotArray is returned when a target is not an array but needs to be for\n\t// the intended operation.\n\tErrNotArray = errors.New(\"not an array\")\n\n\t// ErrPathCollision is returned when creating a path failed because an\n\t// element collided with an existing value.\n\tErrPathCollision = errors.New(\"encountered value collision whilst building path\")\n\n\t// ErrInvalidInputObj is returned when the input value was not a\n\t// map[string]interface{}.\n\tErrInvalidInputObj = errors.New(\"invalid input object\")\n\n\t// ErrInvalidInputText is returned when the input data could not be parsed.\n\tErrInvalidInputText = errors.New(\"input text could not be parsed\")\n\n\t// ErrInvalidPath is returned when the filepath was not valid.\n\tErrInvalidPath = errors.New(\"invalid file path\")\n\n\t// ErrInvalidBuffer is returned when the input buffer contained an invalid\n\t// JSON string.\n\tErrInvalidBuffer = errors.New(\"input buffer contained invalid JSON\")\n)\n\n//------------------------------------------------------------------------------\n\nfunc resolveJSONPointerHierarchy(path string) ([]string, error) {\n\tif len(path) < 1 {\n\t\treturn nil, errors.New(\"failed to resolve JSON pointer: path must not be empty\")\n\t}\n\tif path[0] != '/' {\n\t\treturn nil, errors.New(\"failed to resolve JSON pointer: path must begin with '/'\")\n\t}\n\thierarchy := strings.Split(path, \"/\")[1:]\n\tfor i, v := range hierarchy {\n\t\tv = strings.Replace(v, \"~1\", \"/\", -1)\n\t\tv = strings.Replace(v, \"~0\", \"~\", -1)\n\t\thierarchy[i] = v\n\t}\n\treturn hierarchy, nil\n}\n\n//------------------------------------------------------------------------------\n\n// Container references a specific element within a JSON structure.\ntype Container struct {\n\tobject interface{}\n}\n\n// Data returns the underlying interface{} of the target element in the JSON\n// structure.\nfunc (g *Container) Data() interface{} {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.object\n}\n\n//------------------------------------------------------------------------------\n\n// Path searches the JSON structure following a path in dot notation.\nfunc (g *Container) Path(path string) *Container {\n\treturn g.Search(strings.Split(path, \".\")...)\n}\n\n// Search attempts to find and return an object within the JSON structure by\n// following a provided hierarchy of field names to locate the target. If the\n// search encounters an array and has not reached the end target then it will\n// iterate each object of the array for the target and return all of the results\n// in a JSON array.\nfunc (g *Container) Search(hierarchy ...string) *Container {\n\tvar object interface{}\n\n\tobject = g.Data()\n\tfor target := 0; target < len(hierarchy); target++ {\n\t\tif mmap, ok := object.(map[string]interface{}); ok {\n\t\t\tobject, ok = mmap[hierarchy[target]]\n\t\t\tif !ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t} else if marray, ok := object.([]interface{}); ok {\n\t\t\ttmpArray := []interface{}{}\n\t\t\tfor _, val := range marray {\n\t\t\t\ttmpGabs := &Container{val}\n\t\t\t\tres := tmpGabs.Search(hierarchy[target:]...)\n\t\t\t\tif res != nil {\n\t\t\t\t\ttmpArray = append(tmpArray, res.Data())\n\t\t\t\t}\n\t\t\t}\n\t\t\tif len(tmpArray) == 0 {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn &Container{tmpArray}\n\t\t} else {\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn &Container{object}\n}\n\n// JSONPointer parses a JSON pointer path (https://tools.ietf.org/html/rfc6901)\n// and either returns a *gabs.Container containing the result or an error if the\n// referenced item could not be found.\nfunc (g *Container) JSONPointer(path string) (*Container, error) {\n\thierarchy, err := resolveJSONPointerHierarchy(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tobject := g.Data()\n\tfor target := 0; target < len(hierarchy); target++ {\n\t\tpathSeg := hierarchy[target]\n\t\tif mmap, ok := object.(map[string]interface{}); ok {\n\t\t\tobject, ok = mmap[pathSeg]\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to resolve JSON pointer: index '%v' value '%v' was not found\", target, pathSeg)\n\t\t\t}\n\t\t} else if marray, ok := object.([]interface{}); ok {\n\t\t\tindex, err := strconv.Atoi(pathSeg)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to resolve JSON pointer: could not parse index '%v' value '%v' into array index: %v\", target, pathSeg, err)\n\t\t\t}\n\t\t\tif len(marray) <= index {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to resolve JSON pointer: index '%v' value '%v' exceeded target array size of '%v'\", target, pathSeg, len(marray))\n\t\t\t}\n\t\t\tobject = marray[index]\n\t\t} else {\n\t\t\treturn &Container{nil}, fmt.Errorf(\"failed to resolve JSON pointer: index '%v' field '%v' was not found\", target, pathSeg)\n\t\t}\n\t}\n\treturn &Container{object}, nil\n}\n\n// S is a shorthand alias for Search.\nfunc (g *Container) S(hierarchy ...string) *Container {\n\treturn g.Search(hierarchy...)\n}\n\n// Exists checks whether a path exists.\nfunc (g *Container) Exists(hierarchy ...string) bool {\n\treturn g.Search(hierarchy...) != nil\n}\n\n// ExistsP checks whether a dot notation path exists.\nfunc (g *Container) ExistsP(path string) bool {\n\treturn g.Exists(strings.Split(path, \".\")...)\n}\n\n// Index attempts to find and return an element within a JSON array by an index.\nfunc (g *Container) Index(index int) *Container {\n\tif array, ok := g.Data().([]interface{}); ok {\n\t\tif index >= len(array) {\n\t\t\treturn &Container{nil}\n\t\t}\n\t\treturn &Container{array[index]}\n\t}\n\treturn &Container{nil}\n}\n\n// Children returns a slice of all children of an array element. This also works\n// for objects, however, the children returned for an object will be in a random\n// order and you lose the names of the returned objects this way.\nfunc (g *Container) Children() ([]*Container, error) {\n\tif array, ok := g.Data().([]interface{}); ok {\n\t\tchildren := make([]*Container, len(array))\n\t\tfor i := 0; i < len(array); i++ {\n\t\t\tchildren[i] = &Container{array[i]}\n\t\t}\n\t\treturn children, nil\n\t}\n\tif mmap, ok := g.Data().(map[string]interface{}); ok {\n\t\tchildren := []*Container{}\n\t\tfor _, obj := range mmap {\n\t\t\tchildren = append(children, &Container{obj})\n\t\t}\n\t\treturn children, nil\n\t}\n\treturn nil, ErrNotObjOrArray\n}\n\n// ChildrenMap returns a map of all the children of an object element.\nfunc (g *Container) ChildrenMap() (map[string]*Container, error) {\n\tif mmap, ok := g.Data().(map[string]interface{}); ok {\n\t\tchildren := map[string]*Container{}\n\t\tfor name, obj := range mmap {\n\t\t\tchildren[name] = &Container{obj}\n\t\t}\n\t\treturn children, nil\n\t}\n\treturn nil, ErrNotObj\n}\n\n//------------------------------------------------------------------------------\n\n// Set the value of a field at a JSON path, any parts of the path that do not\n// exist will be constructed, and if a collision occurs with a non object type\n// whilst iterating the path an error is returned.\nfunc (g *Container) Set(value interface{}, path ...string) (*Container, error) {\n\tif len(path) == 0 {\n\t\tg.object = value\n\t\treturn g, nil\n\t}\n\tvar object interface{}\n\tif g.object == nil {\n\t\tg.object = map[string]interface{}{}\n\t}\n\tobject = g.object\n\tfor target := 0; target < len(path); target++ {\n\t\tif mmap, ok := object.(map[string]interface{}); ok {\n\t\t\tif target == len(path)-1 {\n\t\t\t\tmmap[path[target]] = value\n\t\t\t} else if mmap[path[target]] == nil {\n\t\t\t\tmmap[path[target]] = map[string]interface{}{}\n\t\t\t}\n\t\t\tobject = mmap[path[target]]\n\t\t} else {\n\t\t\treturn &Container{nil}, ErrPathCollision\n\t\t}\n\t}\n\treturn &Container{object}, nil\n}\n\n// SetP sets the value of a field at a JSON path using dot notation, any parts\n// of the path that do not exist will be constructed, and if a collision occurs\n// with a non object type whilst iterating the path an error is returned.\nfunc (g *Container) SetP(value interface{}, path string) (*Container, error) {\n\treturn g.Set(value, strings.Split(path, \".\")...)\n}\n\n// SetIndex attempts to set a value of an array element based on an index.\nfunc (g *Container) SetIndex(value interface{}, index int) (*Container, error) {\n\tif array, ok := g.Data().([]interface{}); ok {\n\t\tif index >= len(array) {\n\t\t\treturn &Container{nil}, ErrOutOfBounds\n\t\t}\n\t\tarray[index] = value\n\t\treturn &Container{array[index]}, nil\n\t}\n\treturn &Container{nil}, ErrNotArray\n}\n\n// SetJSONPointer parses a JSON pointer path\n// (https://tools.ietf.org/html/rfc6901) and sets the leaf to a value. Returns\n// an error if the pointer could not be resolved due to missing fields.\nfunc (g *Container) SetJSONPointer(value interface{}, path string) error {\n\thierarchy, err := resolveJSONPointerHierarchy(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(hierarchy) == 0 {\n\t\tg.object = value\n\t\treturn nil\n\t}\n\n\tobject := g.object\n\n\tfor target := 0; target < len(hierarchy); target++ {\n\t\tpathSeg := hierarchy[target]\n\t\tif mmap, ok := object.(map[string]interface{}); ok {\n\t\t\tif target == len(hierarchy)-1 {\n\t\t\t\tobject = value\n\t\t\t\tmmap[pathSeg] = object\n\t\t\t} else if object = mmap[pathSeg]; object == nil {\n\t\t\t\treturn fmt.Errorf(\"failed to resolve JSON pointer: index '%v' value '%v' was not found\", target, pathSeg)\n\t\t\t}\n\t\t} else if marray, ok := object.([]interface{}); ok {\n\t\t\tindex, err := strconv.Atoi(pathSeg)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to resolve JSON pointer: could not parse index '%v' value '%v' into array index: %v\", target, pathSeg, err)\n\t\t\t}\n\t\t\tif len(marray) <= index {\n\t\t\t\treturn fmt.Errorf(\"failed to resolve JSON pointer: index '%v' value '%v' exceeded target array size of '%v'\", target, pathSeg, len(marray))\n\t\t\t}\n\t\t\tif target == len(hierarchy)-1 {\n\t\t\t\tobject = value\n\t\t\t\tmarray[index] = object\n\t\t\t} else if object = marray[index]; object == nil {\n\t\t\t\treturn fmt.Errorf(\"failed to resolve JSON pointer: index '%v' value '%v' was not found\", target, pathSeg)\n\t\t\t}\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"failed to resolve JSON pointer: index '%v' value '%v' was not found\", target, pathSeg)\n\t\t}\n\t}\n\treturn nil\n}\n\n// Object creates a new JSON object at a target path. Returns an error if the\n// path contains a collision with a non object type.\nfunc (g *Container) Object(path ...string) (*Container, error) {\n\treturn g.Set(map[string]interface{}{}, path...)\n}\n\n// ObjectP creates a new JSON object at a target path using dot notation.\n// Returns an error if the path contains a collision with a non object type.\nfunc (g *Container) ObjectP(path string) (*Container, error) {\n\treturn g.Object(strings.Split(path, \".\")...)\n}\n\n// ObjectI creates a new JSON object at an array index. Returns an error if the\n// object is not an array or the index is out of bounds.\nfunc (g *Container) ObjectI(index int) (*Container, error) {\n\treturn g.SetIndex(map[string]interface{}{}, index)\n}\n\n// Array creates a new JSON array at a path. Returns an error if the path\n// contains a collision with a non object type.\nfunc (g *Container) Array(path ...string) (*Container, error) {\n\treturn g.Set([]interface{}{}, path...)\n}\n\n// ArrayP creates a new JSON array at a path using dot notation. Returns an\n// error if the path contains a collision with a non object type.\nfunc (g *Container) ArrayP(path string) (*Container, error) {\n\treturn g.Array(strings.Split(path, \".\")...)\n}\n\n// ArrayI creates a new JSON array within an array at an index. Returns an error\n// if the element is not an array or the index is out of bounds.\nfunc (g *Container) ArrayI(index int) (*Container, error) {\n\treturn g.SetIndex([]interface{}{}, index)\n}\n\n// ArrayOfSize creates a new JSON array of a particular size at a path. Returns\n// an error if the path contains a collision with a non object type.\nfunc (g *Container) ArrayOfSize(size int, path ...string) (*Container, error) {\n\ta := make([]interface{}, size)\n\treturn g.Set(a, path...)\n}\n\n// ArrayOfSizeP creates a new JSON array of a particular size at a path using\n// dot notation. Returns an error if the path contains a collision with a non\n// object type.\nfunc (g *Container) ArrayOfSizeP(size int, path string) (*Container, error) {\n\treturn g.ArrayOfSize(size, strings.Split(path, \".\")...)\n}\n\n// ArrayOfSizeI create a new JSON array of a particular size within an array at\n// an index. Returns an error if the element is not an array or the index is out\n// of bounds.\nfunc (g *Container) ArrayOfSizeI(size, index int) (*Container, error) {\n\ta := make([]interface{}, size)\n\treturn g.SetIndex(a, index)\n}\n\n// Delete an element at a path, an error is returned if the element does not\n// exist.\nfunc (g *Container) Delete(path ...string) error {\n\tvar object interface{}\n\n\tif g.object == nil {\n\t\treturn ErrNotObj\n\t}\n\tobject = g.object\n\tfor target := 0; target < len(path); target++ {\n\t\tif mmap, ok := object.(map[string]interface{}); ok {\n\t\t\tif target == len(path)-1 {\n\t\t\t\tif _, ok := mmap[path[target]]; ok {\n\t\t\t\t\tdelete(mmap, path[target])\n\t\t\t\t} else {\n\t\t\t\t\treturn ErrNotObj\n\t\t\t\t}\n\t\t\t}\n\t\t\tobject = mmap[path[target]]\n\t\t} else {\n\t\t\treturn ErrNotObj\n\t\t}\n\t}\n\treturn nil\n}\n\n// DeleteP deletes an element at a path using dot notation, an error is returned\n// if the element does not exist.\nfunc (g *Container) DeleteP(path string) error {\n\treturn g.Delete(strings.Split(path, \".\")...)\n}\n\n// MergeFn merges two objects using a provided function to resolve collisions.\n//\n// The collision function receives two interface{} arguments, destination (the\n// original object) and source (the object being merged into the destination).\n// Which ever value is returned becomes the new value in the destination object\n// at the location of the collision.\nfunc (g *Container) MergeFn(source *Container, collisionFn func(destination, source interface{}) interface{}) error {\n\tvar recursiveFnc func(map[string]interface{}, []string) error\n\trecursiveFnc = func(mmap map[string]interface{}, path []string) error {\n\t\tfor key, value := range mmap {\n\t\t\tnewPath := append(path, key)\n\t\t\tif g.Exists(newPath...) {\n\t\t\t\texistingData := g.Search(newPath...).Data()\n\t\t\t\tswitch t := value.(type) {\n\t\t\t\tcase map[string]interface{}:\n\t\t\t\t\tswitch existingVal := existingData.(type) {\n\t\t\t\t\tcase map[string]interface{}:\n\t\t\t\t\t\tif err := recursiveFnc(t, newPath); err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif _, err := g.Set(collisionFn(existingVal, t), newPath...); err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tif _, err := g.Set(collisionFn(existingData, t), newPath...); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// path doesn't exist. So set the value\n\t\t\t\tif _, err := g.Set(value, newPath...); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\tif mmap, ok := source.Data().(map[string]interface{}); ok {\n\t\treturn recursiveFnc(mmap, []string{})\n\t}\n\treturn nil\n}\n\n// Merge a source object into an existing destination object. When a collision\n// is found within the merged structures (both a source and destination object\n// contain the same non-object keys) the result will be an array containing both\n// values, where values that are already arrays will be expanded into the\n// resulting array.\n//\n// It is possible to merge structures will different collision behaviours with\n// MergeFn.\nfunc (g *Container) Merge(source *Container) error {\n\treturn g.MergeFn(source, func(dest, source interface{}) interface{} {\n\t\tdestArr, destIsArray := dest.([]interface{})\n\t\tsourceArr, sourceIsArray := source.([]interface{})\n\t\tif destIsArray {\n\t\t\tif sourceIsArray {\n\t\t\t\treturn append(destArr, sourceArr...)\n\t\t\t}\n\t\t\treturn append(destArr, source)\n\t\t}\n\t\tif sourceIsArray {\n\t\t\treturn append(append([]interface{}{}, dest), sourceArr...)\n\t\t}\n\t\treturn []interface{}{dest, source}\n\t})\n}\n\n//------------------------------------------------------------------------------\n\n/*\nArray modification/search - Keeping these options simple right now, no need for\nanything more complicated since you can just cast to []interface{}, modify and\nthen reassign with Set.\n*/\n\n// ArrayAppend attempts to append a value onto a JSON array at a path. If the\n// target is not a JSON array then it will be converted into one, with its\n// original contents set to the first element of the array.\nfunc (g *Container) ArrayAppend(value interface{}, path ...string) error {\n\tif array, ok := g.Search(path...).Data().([]interface{}); ok {\n\t\tarray = append(array, value)\n\t\t_, err := g.Set(array, path...)\n\t\treturn err\n\t}\n\n\tnewArray := []interface{}{}\n\tif d := g.Search(path...).Data(); d != nil {\n\t\tnewArray = append(newArray, d)\n\t}\n\tnewArray = append(newArray, value)\n\n\t_, err := g.Set(newArray, path...)\n\treturn err\n}\n\n// ArrayAppendP attempts to append a value onto a JSON array at a path using dot\n// notation. If the target is not a JSON array then it will be converted into\n// one, with its original contents set to the first element of the array.\nfunc (g *Container) ArrayAppendP(value interface{}, path string) error {\n\treturn g.ArrayAppend(value, strings.Split(path, \".\")...)\n}\n\n// ArrayRemove attempts to remove an element identified by an index from a JSON\n// array at a path.\nfunc (g *Container) ArrayRemove(index int, path ...string) error {\n\tif index < 0 {\n\t\treturn ErrOutOfBounds\n\t}\n\tarray, ok := g.Search(path...).Data().([]interface{})\n\tif !ok {\n\t\treturn ErrNotArray\n\t}\n\tif index < len(array) {\n\t\tarray = append(array[:index], array[index+1:]...)\n\t} else {\n\t\treturn ErrOutOfBounds\n\t}\n\t_, err := g.Set(array, path...)\n\treturn err\n}\n\n// ArrayRemoveP attempts to remove an element identified by an index from a JSON\n// array at a path using dot notation.\nfunc (g *Container) ArrayRemoveP(index int, path string) error {\n\treturn g.ArrayRemove(index, strings.Split(path, \".\")...)\n}\n\n// ArrayElement attempts to access an element by an index from a JSON array at a\n// path.\nfunc (g *Container) ArrayElement(index int, path ...string) (*Container, error) {\n\tif index < 0 {\n\t\treturn &Container{nil}, ErrOutOfBounds\n\t}\n\tarray, ok := g.Search(path...).Data().([]interface{})\n\tif !ok {\n\t\treturn &Container{nil}, ErrNotArray\n\t}\n\tif index < len(array) {\n\t\treturn &Container{array[index]}, nil\n\t}\n\treturn &Container{nil}, ErrOutOfBounds\n}\n\n// ArrayElementP attempts to access an element by an index from a JSON array at\n// a path using dot notation.\nfunc (g *Container) ArrayElementP(index int, path string) (*Container, error) {\n\treturn g.ArrayElement(index, strings.Split(path, \".\")...)\n}\n\n// ArrayCount counts the number of elements in a JSON array at a path.\nfunc (g *Container) ArrayCount(path ...string) (int, error) {\n\tif array, ok := g.Search(path...).Data().([]interface{}); ok {\n\t\treturn len(array), nil\n\t}\n\treturn 0, ErrNotArray\n}\n\n// ArrayCountP counts the number of elements in a JSON array at a path using dot\n// notation.\nfunc (g *Container) ArrayCountP(path string) (int, error) {\n\treturn g.ArrayCount(strings.Split(path, \".\")...)\n}\n\n//------------------------------------------------------------------------------\n\n// Bytes marshals an element to a JSON []byte blob.\nfunc (g *Container) Bytes() []byte {\n\tif g.Data() != nil {\n\t\tif bytes, err := json.Marshal(g.object); err == nil {\n\t\t\treturn bytes\n\t\t}\n\t}\n\treturn []byte(\"{}\")\n}\n\n// BytesIndent marshals an element to a JSON []byte blob formatted with a prefix\n// and indent string.\nfunc (g *Container) BytesIndent(prefix string, indent string) []byte {\n\tif g.object != nil {\n\t\tif bytes, err := json.MarshalIndent(g.object, prefix, indent); err == nil {\n\t\t\treturn bytes\n\t\t}\n\t}\n\treturn []byte(\"{}\")\n}\n\n// String marshals an element to a JSON formatted string.\nfunc (g *Container) String() string {\n\treturn string(g.Bytes())\n}\n\n// StringIndent marshals an element to a JSON string formatted with a prefix and\n// indent string.\nfunc (g *Container) StringIndent(prefix string, indent string) string {\n\treturn string(g.BytesIndent(prefix, indent))\n}\n\n// EncodeOpt is a functional option for the EncodeJSON method.\ntype EncodeOpt func(e *json.Encoder)\n\n// EncodeOptHTMLEscape sets the encoder to escape the JSON for html.\nfunc EncodeOptHTMLEscape(doEscape bool) EncodeOpt {\n\treturn func(e *json.Encoder) {\n\t\te.SetEscapeHTML(doEscape)\n\t}\n}\n\n// EncodeOptIndent sets the encoder to indent the JSON output.\nfunc EncodeOptIndent(prefix string, indent string) EncodeOpt {\n\treturn func(e *json.Encoder) {\n\t\te.SetIndent(prefix, indent)\n\t}\n}\n\n// EncodeJSON marshals an element to a JSON formatted []byte using a variant\n// list of modifier functions for the encoder being used. Functions for\n// modifying the output are prefixed with EncodeOpt, e.g. EncodeOptHTMLEscape.\nfunc (g *Container) EncodeJSON(encodeOpts ...EncodeOpt) []byte {\n\tvar b bytes.Buffer\n\tencoder := json.NewEncoder(&b)\n\tencoder.SetEscapeHTML(false) // Do not escape by default.\n\tfor _, opt := range encodeOpts {\n\t\topt(encoder)\n\t}\n\tif err := encoder.Encode(g.object); err != nil {\n\t\treturn []byte(\"{}\")\n\t}\n\tresult := b.Bytes()\n\tif len(result) > 0 {\n\t\tresult = result[:len(result)-1]\n\t}\n\treturn result\n}\n\n// New creates a new gabs JSON object.\nfunc New() *Container {\n\treturn &Container{map[string]interface{}{}}\n}\n\n// Consume an already unmarshalled JSON object (or a new map[string]interface{})\n// into a *Container.\nfunc Consume(root interface{}) (*Container, error) {\n\treturn &Container{root}, nil\n}\n\n// ParseJSON unmarshals a JSON byte slice into a *Container.\nfunc ParseJSON(sample []byte) (*Container, error) {\n\tvar gabs Container\n\n\tif err := json.Unmarshal(sample, &gabs.object); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &gabs, nil\n}\n\n// ParseJSONDecoder applies a json.Decoder to a *Container.\nfunc ParseJSONDecoder(decoder *json.Decoder) (*Container, error) {\n\tvar gabs Container\n\n\tif err := decoder.Decode(&gabs.object); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &gabs, nil\n}\n\n// ParseJSONFile reads a file and unmarshals the contents into a *Container.\nfunc ParseJSONFile(path string) (*Container, error) {\n\tif len(path) > 0 {\n\t\tcBytes, err := ioutil.ReadFile(path)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcontainer, err := ParseJSON(cBytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn container, nil\n\t}\n\treturn nil, ErrInvalidPath\n}\n\n// ParseJSONBuffer reads a buffer and unmarshals the contents into a *Container.\nfunc ParseJSONBuffer(buffer io.Reader) (*Container, error) {\n\tvar gabs Container\n\tjsonDecoder := json.NewDecoder(buffer)\n\tif err := jsonDecoder.Decode(&gabs.object); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &gabs, nil\n}\n\n//------------------------------------------------------------------------------\n"} +{"text": "-----BEGIN CERTIFICATE-----\nMIIEKTCCAxGgAwIBAgIJAJX2ZIcF7lJKMA0GCSqGSIb3DQEBCwUAMIGqMQswCQYD\nVQQGEwJDWjETMBEGA1UECAwKU29tZS1TdGF0ZTEPMA0GA1UEBwwGUHJhZ3VlMRww\nGgYDVQQKDBNGYWxjb24gR3VhcmQgcy5yLm8uMRwwGgYDVQQLDBNGYWxjb24gR3Vh\ncmQgcy5yLm8uMRUwEwYDVQQDDAxGYWxjb24gR3VhcmQxIjAgBgkqhkiG9w0BCQEW\nE2luZm9AZmFsY29uZ3VhcmQuY3owHhcNMTYwMzA4MjAyOTM1WhcNMjYwMzA2MjAy\nOTM1WjCBqjELMAkGA1UEBhMCQ1oxEzARBgNVBAgMClNvbWUtU3RhdGUxDzANBgNV\nBAcMBlByYWd1ZTEcMBoGA1UECgwTRmFsY29uIEd1YXJkIHMuci5vLjEcMBoGA1UE\nCwwTRmFsY29uIEd1YXJkIHMuci5vLjEVMBMGA1UEAwwMRmFsY29uIEd1YXJkMSIw\nIAYJKoZIhvcNAQkBFhNpbmZvQGZhbGNvbmd1YXJkLmN6MIIBIjANBgkqhkiG9w0B\nAQEFAAOCAQ8AMIIBCgKCAQEAzrO5AC9RDZsTBiHLMzdfWHiL/pWShBV8gE4QR7pp\nkFd+FvfFypFD2MndI5aSmYoX2OU+8eUbUcWZvooFI0uY76sdn5YKGs8JcFx14yON\njAyilu5rqvYiAMCMr1t9DAX69LStPpNrRNezuE5Kpn6HADWT8udpR1uQjiJ1/YWf\nIiYKtGGzc4uQEkiS1ROK1IBJA0v/Ul4OKiOVaaOJVauAWiuaWC0wZUPeqGRnkpom\nOy495nVsdn0yNxcXr/z9r+UT+WGXcgaX4Q1Lz9f5wCG3iG5XTsG5F+3KIMLZUTDm\nV9CNdB0gOcQ9qjm9tcdDiRdigq+YI/8JpfUuTio+XyKTqQIDAQABo1AwTjAdBgNV\nHQ4EFgQUsdTpcciQ1o+mhM6RIS5roLhblZswHwYDVR0jBBgwFoAUsdTpcciQ1o+m\nhM6RIS5roLhblZswDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAsSIG\nqfo8MjvQRrNVUZGSysk7w8oOag3R9MIeyXYxTqtHUbNNHPLgaABkK8HyLVw0MwEi\n8dea16fZdacQK2zctGeoOQuJexUSlQ6XbyLmPaJMGFYjeOSB4FeaRHvjvQljsV8U\nD+CmHi5KrYvOtpxIWCGSNddZiMsK2hvbLClPd3ihbCU484HfyFpZIZycDlPDiUfX\nYWOa1C7/Gkqq+AfdMcNWFGZ3jyMvJkOgKnrJnUAIHPT05rhDw2QjunVAc3wU7ptr\nBrdGIiKpPfjo22AfOIolpobcTP7IwOBpewPHxVjGnOvr+uM4s8gcWkd4UiUfTLSm\n13ohEgoDGZEi2S3cOQ==\n-----END CERTIFICATE-----\n"} +{"text": "\n# coding: utf-8\n\n# # Bike Sharing Dataset Linear Modeling\n# \n# + Based on Bike Sharing dataset from [UCI Machine Learning Repository](https://archive.ics.uci.edu/ml/datasets/Bike+Sharing+Dataset)\n# + This notebook is based upon the hourly data file, i.e. hour.csv\n# + This notebook showcases linear modeling using linear regression\n\n# ### Problem Statement\n# Given the Bike Sharing dataset with hourly level information of bikes along with weather and other attributes, model a system which can predict the bike count.\n\n# ## Import required packages\n\n# In[1]:\n\n\nget_ipython().magic('matplotlib inline')\n# data manuipulation\nimport numpy as np\nimport pandas as pd\n\n# modeling utilities\nimport scipy.stats as stats\nfrom sklearn import metrics\nfrom sklearn import preprocessing\nfrom sklearn import linear_model\nfrom sklearn.model_selection import cross_val_score\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.model_selection import cross_val_predict\n\n# plotting libraries\nimport matplotlib.pyplot as plt\nimport seaborn as sn\n\n\nsn.set_style('whitegrid')\nsn.set_context('talk')\nparams = {'legend.fontsize': 'x-large',\n 'figure.figsize': (30, 10),\n 'axes.labelsize': 'x-large',\n 'axes.titlesize':'x-large',\n 'xtick.labelsize':'x-large',\n 'ytick.labelsize':'x-large'}\n\nplt.rcParams.update(params)\n\n\n# ## Load Dataset\n\n# In[2]:\n\n\nhour_df = pd.read_csv('hour.csv')\nprint(\"Shape of dataset::{}\".format(hour_df.shape))\n\n\n# ## Preprocessing\n# + Standarize column names\n# + Typecast attributes\n# + Encode Categoricals using One Hot Encoding\n\n# ### Standarize Column Names\n\n# In[3]:\n\n\nhour_df.rename(columns={'instant':'rec_id',\n 'dteday':'datetime',\n 'holiday':'is_holiday',\n 'workingday':'is_workingday',\n 'weathersit':'weather_condition',\n 'hum':'humidity',\n 'mnth':'month',\n 'cnt':'total_count',\n 'hr':'hour',\n 'yr':'year'},inplace=True)\n\n\n# ### Typecast Attributes\n\n# In[4]:\n\n\n# date time conversion\nhour_df['datetime'] = pd.to_datetime(hour_df.datetime)\n\n# categorical variables\nhour_df['season'] = hour_df.season.astype('category')\nhour_df['is_holiday'] = hour_df.is_holiday.astype('category')\nhour_df['weekday'] = hour_df.weekday.astype('category')\nhour_df['weather_condition'] = hour_df.weather_condition.astype('category')\nhour_df['is_workingday'] = hour_df.is_workingday.astype('category')\nhour_df['month'] = hour_df.month.astype('category')\nhour_df['year'] = hour_df.year.astype('category')\nhour_df['hour'] = hour_df.hour.astype('category')\n\n\n# \n# ### Encode Categoricals (One Hot Encoding)\n\n# In[5]:\n\n\ndef fit_transform_ohe(df,col_name):\n \"\"\"This function performs one hot encoding for the specified\n column.\n\n Args:\n df(pandas.DataFrame): the data frame containing the mentioned column name\n col_name: the column to be one hot encoded\n\n Returns:\n tuple: label_encoder, one_hot_encoder, transformed column as pandas Series\n\n \"\"\"\n # label encode the column\n le = preprocessing.LabelEncoder()\n le_labels = le.fit_transform(df[col_name])\n df[col_name+'_label'] = le_labels\n \n # one hot encoding\n ohe = preprocessing.OneHotEncoder()\n feature_arr = ohe.fit_transform(df[[col_name+'_label']]).toarray()\n feature_labels = [col_name+'_'+str(cls_label) for cls_label in le.classes_]\n features_df = pd.DataFrame(feature_arr, columns=feature_labels)\n \n return le,ohe,features_df\n\n# given label encoder and one hot encoder objects, \n# encode attribute to ohe\ndef transform_ohe(df,le,ohe,col_name):\n \"\"\"This function performs one hot encoding for the specified\n column using the specified encoder objects.\n\n Args:\n df(pandas.DataFrame): the data frame containing the mentioned column name\n le(Label Encoder): the label encoder object used to fit label encoding\n ohe(One Hot Encoder): the onen hot encoder object used to fit one hot encoding\n col_name: the column to be one hot encoded\n\n Returns:\n tuple: transformed column as pandas Series\n\n \"\"\"\n # label encode\n col_labels = le.transform(df[col_name])\n df[col_name+'_label'] = col_labels\n \n # ohe \n feature_arr = ohe.fit_transform(df[[col_name+'_label']]).toarray()\n feature_labels = [col_name+'_'+str(cls_label) for cls_label in le.classes_]\n features_df = pd.DataFrame(feature_arr, columns=feature_labels)\n \n return features_df\n\n\n# ## Train-Test Split\n\n# In[6]:\n\n\nX, X_test, y, y_test = train_test_split(hour_df.iloc[:,0:-3], hour_df.iloc[:,-1], \n test_size=0.33, random_state=42)\n\nX.reset_index(inplace=True)\ny = y.reset_index()\n\nX_test.reset_index(inplace=True)\ny_test = y_test.reset_index()\n\nprint(\"Training set::{}{}\".format(X.shape,y.shape))\nprint(\"Testing set::{}\".format(X_test.shape))\n\n\n# ## Normality Test\n\n# In[7]:\n\n\nstats.probplot(y.total_count.tolist(), dist=\"norm\", plot=plt)\nplt.show()\n\n\n# In[8]:\n\n\ncat_attr_list = ['season','is_holiday',\n 'weather_condition','is_workingday',\n 'hour','weekday','month','year']\nnumeric_feature_cols = ['temp','humidity','windspeed','hour','weekday','month','year']\nsubset_cat_features = ['season','is_holiday','weather_condition','is_workingday']\n\n\n# In[9]:\n\n\nencoded_attr_list = []\nfor col in cat_attr_list:\n return_obj = fit_transform_ohe(X,col)\n encoded_attr_list.append({'label_enc':return_obj[0],\n 'ohe_enc':return_obj[1],\n 'feature_df':return_obj[2],\n 'col_name':col})\n\n\n# In[10]:\n\n\nfeature_df_list = [X[numeric_feature_cols]]\nfeature_df_list.extend([enc['feature_df'] for enc in encoded_attr_list if enc['col_name'] in subset_cat_features])\n\ntrain_df_new = pd.concat(feature_df_list, axis=1)\nprint(\"Shape::{}\".format(train_df_new.shape))\n\n\n# ## Linear Regression\n\n# In[11]:\n\n\nX = train_df_new\ny= y.total_count.values.reshape(-1,1)\n\nlin_reg = linear_model.LinearRegression()\n\n\n# ### Cross Validation\n\n# In[12]:\n\n\npredicted = cross_val_predict(lin_reg, X, y, cv=10)\n\nfig, ax = plt.subplots()\nax.scatter(y, y-predicted)\nax.axhline(lw=2,color='black')\nax.set_xlabel('Observed')\nax.set_ylabel('Residual')\nplt.show()\n\n\n# In[13]:\n\n\nr2_scores = cross_val_score(lin_reg, X, y, cv=10)\nmse_scores = cross_val_score(lin_reg, X, y, cv=10,scoring='neg_mean_squared_error')\n\n\n# In[14]:\n\n\nfig, ax = plt.subplots()\nax.plot([i for i in range(len(r2_scores))],r2_scores,lw=2)\nax.set_xlabel('Iteration')\nax.set_ylabel('R-Squared')\nax.title.set_text(\"Cross Validation Scores, Avg:{}\".format(np.average(r2_scores)))\nplt.show()\n\n\n# In[15]:\n\n\nprint(\"R-squared::{}\".format(r2_scores))\nprint(\"MSE::{}\".format(mse_scores))\n\n\n# In[16]:\n\n\nlin_reg.fit(X,y)\n\n\n# ## Test Dataset Performance\n\n# In[17]:\n\n\ntest_encoded_attr_list = []\nfor enc in encoded_attr_list:\n col_name = enc['col_name']\n le = enc['label_enc']\n ohe = enc['ohe_enc']\n test_encoded_attr_list.append({'feature_df':transform_ohe(X_test,\n le,ohe,\n col_name),\n 'col_name':col_name})\n \n \ntest_feature_df_list = [X_test[numeric_feature_cols]]\ntest_feature_df_list.extend([enc['feature_df'] for enc in test_encoded_attr_list if enc['col_name'] in subset_cat_features])\n\ntest_df_new = pd.concat(test_feature_df_list, axis=1) \nprint(\"Shape::{}\".format(test_df_new.shape))\n\n\n# In[18]:\n\n\ntest_df_new.head()\n\n\n# In[19]:\n\n\nX_test = test_df_new\ny_test = y_test.total_count.values.reshape(-1,1)\n\ny_pred = lin_reg.predict(X_test)\n\nresiduals = y_test-y_pred\n\n\n# In[20]:\n\n\nr2_score = lin_reg.score(X_test,y_test)\nprint(\"R-squared::{}\".format(r2_score))\nprint(\"MSE: %.2f\"\n % metrics.mean_squared_error(y_test, y_pred))\n\n\n# In[21]:\n\n\nfig, ax = plt.subplots()\nax.scatter(y_test, residuals)\nax.axhline(lw=2,color='black')\nax.set_xlabel('Observed')\nax.set_ylabel('Residuals')\nax.title.set_text(\"Residual Plot with R-Squared={}\".format(np.average(r2_score)))\nplt.show()\n\n\n# ## Stats Models\n\n# In[22]:\n\n\nimport statsmodels.api as sm\n\n# Set the independent variable\nX = X.values.tolist()\n\n# This handles the intercept. \n# Statsmodel takes 0 intercept by default\nX = sm.add_constant(X)\n\nX_test = X_test.values.tolist()\nX_test = sm.add_constant(X_test)\n\n\n# Build OLS model\nmodel = sm.OLS(y, X)\nresults = model.fit()\n\n# Get the predicted values for dependent variable\npred_y = results.predict(X_test)\n\n# View Model stats\nprint(results.summary())\n\n\n# In[23]:\n\n\nplt.scatter(pred_y,y_test)\n\n"} +{"text": "package io.ray.streaming.runtime.master.resourcemanager.strategy.impl;\n\nimport io.ray.streaming.runtime.config.types.ResourceAssignStrategyType;\nimport io.ray.streaming.runtime.core.graph.executiongraph.ExecutionGraph;\nimport io.ray.streaming.runtime.core.graph.executiongraph.ExecutionJobVertex;\nimport io.ray.streaming.runtime.core.graph.executiongraph.ExecutionVertex;\nimport io.ray.streaming.runtime.core.resource.Container;\nimport io.ray.streaming.runtime.core.resource.ResourceType;\nimport io.ray.streaming.runtime.master.resourcemanager.ResourceAssignmentView;\nimport io.ray.streaming.runtime.master.resourcemanager.ViewBuilder;\nimport io.ray.streaming.runtime.master.resourcemanager.strategy.ResourceAssignStrategy;\nimport io.ray.streaming.runtime.master.scheduler.ScheduleException;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n/**\n * Based on Ray dynamic resource function, resource details(by ray gcs get) and execution logic\n * diagram, PipelineFirstStrategy provides a actor scheduling strategies to make the cluster load\n * balanced and controllable scheduling. Assume that we have 2 containers and have a DAG graph\n * composed of a source node with parallelism of 2 and a sink node with parallelism of 2, the\n * structure will be like:\n *
    \n *   container_0\n *             |- source_1\n *             |- sink_1\n *   container_1\n *             |- source_2\n *             |- sink_2\n * 
    \n */\npublic class PipelineFirstStrategy implements ResourceAssignStrategy {\n\n public static final Logger LOG = LoggerFactory.getLogger(PipelineFirstStrategy.class);\n\n private int currentContainerIndex = 0;\n\n /**\n * Assign resource to each execution vertex in the given execution graph.\n *\n * @param containers registered containers\n * @param executionGraph execution graph\n * @return allocating map, key is container ID, value is list of vertextId, and contains vertices\n */\n @Override\n public ResourceAssignmentView assignResource(\n List containers,\n ExecutionGraph executionGraph) {\n\n Map vertices = executionGraph.getExecutionJobVertexMap();\n Map vertexRemainingNum = new HashMap<>();\n\n vertices.forEach((k, v) -> {\n int size = v.getExecutionVertices().size();\n vertexRemainingNum.put(k, size);\n });\n int totalExecutionVerticesNum = vertexRemainingNum.values().stream()\n .mapToInt(Integer::intValue)\n .sum();\n int containerNum = containers.size();\n int capacityPerContainer = Math.max(totalExecutionVerticesNum / containerNum, 1);\n\n updateContainerCapacity(containers, capacityPerContainer);\n\n int enlargeCapacityThreshold = 0;\n boolean enlarged = false;\n if (capacityPerContainer * containerNum < totalExecutionVerticesNum) {\n enlargeCapacityThreshold = capacityPerContainer * containerNum;\n LOG.info(\"Need to enlarge capacity per container, threshold: {}.\", enlargeCapacityThreshold);\n }\n LOG.info(\"Total execution vertices num: {}, container num: {}, capacity per container: {}.\",\n totalExecutionVerticesNum, containerNum, capacityPerContainer);\n\n int maxParallelism = executionGraph.getMaxParallelism();\n\n int allocatedVertexCount = 0;\n for (int i = 0; i < maxParallelism; i++) {\n for (ExecutionJobVertex jobVertex : vertices.values()) {\n List exeVertices = jobVertex.getExecutionVertices();\n // current job vertex assign finished\n if (exeVertices.size() <= i) {\n continue;\n }\n ExecutionVertex executionVertex = exeVertices.get(i);\n Map requiredResource = executionVertex.getResource();\n if (requiredResource.containsKey(ResourceType.CPU.getValue())) {\n LOG.info(\"Required resource contain {} value : {}, no limitation by default.\",\n ResourceType.CPU, requiredResource.get(ResourceType.CPU.getValue()));\n requiredResource.remove(ResourceType.CPU.getValue());\n }\n\n Container targetContainer = findMatchedContainer(requiredResource, containers);\n\n targetContainer.allocateActor(executionVertex);\n allocatedVertexCount++;\n // Once allocatedVertexCount reaches threshold, we should enlarge capacity\n if (!enlarged && enlargeCapacityThreshold > 0\n && allocatedVertexCount >= enlargeCapacityThreshold) {\n updateContainerCapacity(containers, capacityPerContainer + 1);\n enlarged = true;\n LOG.info(\"Enlarge capacity per container to: {}.\", containers.get(0).getCapacity());\n }\n }\n }\n\n ResourceAssignmentView allocatingView = ViewBuilder.buildResourceAssignmentView(containers);\n LOG.info(\"Assigning resource finished, allocating map: {}.\", allocatingView);\n return allocatingView;\n }\n\n @Override\n public String getName() {\n return ResourceAssignStrategyType.PIPELINE_FIRST_STRATEGY.getName();\n }\n\n /**\n * Update container capacity. eg: we have 89 actors and 8 containers, capacity will be 11 when\n * initialing, and will be increased to 12 when allocating actor#89, just for load balancing.\n */\n private void updateContainerCapacity(List containers, int capacity) {\n containers.forEach(c -> c.updateCapacity(capacity));\n }\n\n /**\n * Find a container which matches required resource\n *\n * @param requiredResource required resource\n * @param containers registered containers\n * @return container that matches the required resource\n */\n private Container findMatchedContainer(\n Map requiredResource,\n List containers) {\n\n LOG.info(\"Check resource, required: {}.\", requiredResource);\n\n int checkedNum = 0;\n // if current container does not have enough resource, go to the next one (loop)\n while (!hasEnoughResource(requiredResource, getCurrentContainer(containers))) {\n checkedNum++;\n forwardToNextContainer(containers);\n if (checkedNum >= containers.size()) {\n throw new ScheduleException(\n String.format(\"No enough resource left, required resource: %s, available resource: %s.\",\n requiredResource, containers));\n }\n }\n return getCurrentContainer(containers);\n }\n\n /**\n * Check if current container has enough resource\n *\n * @param requiredResource required resource\n * @param container container\n * @return true if matches, false else\n */\n private boolean hasEnoughResource(Map requiredResource, Container container) {\n LOG.info(\"Check resource for index: {}, container: {}\", currentContainerIndex, container);\n\n if (null == requiredResource) {\n return true;\n }\n\n if (container.isFull()) {\n LOG.info(\"Container {} is full.\", container);\n return false;\n }\n\n Map availableResource = container.getAvailableResources();\n for (Map.Entry entry : requiredResource.entrySet()) {\n if (availableResource.containsKey(entry.getKey())) {\n if (availableResource.get(entry.getKey()) < entry.getValue()) {\n LOG.warn(\"No enough resource for container {}. required: {}, available: {}.\",\n container.getAddress(), requiredResource, availableResource);\n return false;\n }\n } else {\n LOG.warn(\"No enough resource for container {}. required: {}, available: {}.\",\n container.getAddress(), requiredResource, availableResource);\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Forward to next container\n *\n * @param containers registered container list\n * @return next container in the list\n */\n private Container forwardToNextContainer(List containers) {\n this.currentContainerIndex = (this.currentContainerIndex + 1) % containers.size();\n return getCurrentContainer(containers);\n }\n\n /**\n * Get current container\n *\n * @param containers registered container\n * @return current container to allocate actor\n */\n private Container getCurrentContainer(List containers) {\n return containers.get(currentContainerIndex);\n }\n}\n"} +{"text": "dropCollection(static::$cacheCollection);\n parent::tearDown();\n }\n\n /**\n * Creates test cache instance.\n * @return Cache cache instance.\n */\n protected function createCache()\n {\n return Yii::createObject([\n 'class' => Cache::className(),\n 'db' => $this->getConnection(),\n 'cacheCollection' => static::$cacheCollection,\n 'gcProbability' => 0,\n ]);\n }\n\n // Tests:\n\n public function testSet()\n {\n $cache = $this->createCache();\n\n $key = 'test_key';\n $value = 'test_value';\n $this->assertTrue($cache->set($key, $value), 'Unable to set value!');\n $this->assertEquals($value, $cache->get($key), 'Unable to set value correctly!');\n\n $newValue = 'test_new_value';\n $this->assertTrue($cache->set($key, $newValue), 'Unable to update value!');\n $this->assertEquals($newValue, $cache->get($key), 'Unable to update value correctly!');\n }\n\n public function testAdd()\n {\n $cache = $this->createCache();\n\n $key = 'test_key';\n $value = 'test_value';\n $this->assertTrue($cache->add($key, $value), 'Unable to add value!');\n $this->assertEquals($value, $cache->get($key), 'Unable to add value correctly!');\n\n $newValue = 'test_new_value';\n $this->assertTrue($cache->add($key, $newValue), 'Unable to re-add value!');\n $this->assertEquals($value, $cache->get($key), 'Original value is lost!');\n }\n\n /**\n * @depends testSet\n */\n public function testDelete()\n {\n $cache = $this->createCache();\n\n $key = 'test_key';\n $value = 'test_value';\n $cache->set($key, $value);\n\n $this->assertTrue($cache->delete($key), 'Unable to delete key!');\n $this->assertEquals(false, $cache->get($key), 'Value is not deleted!');\n }\n\n /**\n * @depends testSet\n */\n public function testFlush()\n {\n $cache = $this->createCache();\n\n $cache->set('key1', 'value1');\n $cache->set('key2', 'value2');\n\n $this->assertTrue($cache->flush(), 'Unable to flush cache!');\n\n $collection = $cache->db->getCollection($cache->cacheCollection);\n $rows = $this->findAll($collection);\n $this->assertCount(0, $rows, 'Unable to flush records!');\n }\n\n /**\n * @depends testSet\n */\n public function testGc()\n {\n $cache = $this->createCache();\n\n $cache->set('key1', 'value1');\n $cache->set('key2', 'value2');\n\n $collection = $cache->db->getCollection($cache->cacheCollection);\n\n list($row) = $this->findAll($collection);\n $collection->update(['_id' => $row['_id']], ['expire' => time() - 10]);\n\n $cache->gc(true);\n\n $rows = $this->findAll($collection);\n $this->assertCount(1, $rows, 'Unable to collect garbage!');\n }\n\n /**\n * @depends testSet\n */\n public function testGetExpired()\n {\n $cache = $this->createCache();\n\n $key = 'test_key';\n $value = 'test_value';\n $cache->set($key, $value);\n\n $collection = $cache->db->getCollection($cache->cacheCollection);\n list($row) = $this->findAll($collection);\n $collection->update(['_id' => $row['_id']], ['expire' => time() - 10]);\n\n $this->assertEquals(false, $cache->get($key), 'Expired key value returned!');\n }\n}\n"} +{"text": "/**\n * SyntaxHighlighter\n * http://alexgorbatchev.com/SyntaxHighlighter\n *\n * SyntaxHighlighter is donationware. If you are using it, please donate.\n * http://alexgorbatchev.com/SyntaxHighlighter/donate.html\n *\n * @version\n * 3.0.83 (July 02 2010)\n * \n * @copyright\n * Copyright (C) 2004-2010 Alex Gorbatchev.\n *\n * @license\n * Dual licensed under the MIT and GPL licenses.\n */\n;(function()\n{\n\t// CommonJS\n\ttypeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;\n\n\tfunction Brush()\n\t{\n\t\t// Contributes by B.v.Zanten, Getronics\n\t\t// http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro\n\n\t\tvar keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' +\n\t\t\t\t\t'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' +\n\t\t\t\t\t'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' +\n\t\t\t\t\t'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' +\n\t\t\t\t\t'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' +\n\t\t\t\t\t'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' +\n\t\t\t\t\t'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' +\n\t\t\t\t\t'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' +\n\t\t\t\t\t'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' +\n\t\t\t\t\t'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' +\n\t\t\t\t\t'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' +\n\t\t\t\t\t'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' +\n\t\t\t\t\t'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' +\n\t\t\t\t\t'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' +\n\t\t\t\t\t'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' +\n\t\t\t\t\t'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' +\n\t\t\t\t\t'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' +\n\t\t\t\t\t'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' +\n\t\t\t\t\t'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' +\n\t\t\t\t\t'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' +\n\t\t\t\t\t'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning';\n\t\tvar alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' +\n\t\t\t\t\t'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' +\n\t\t\t\t\t'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' +\n\t\t\t\t\t'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' +\n\t\t\t\t\t'spps spsv sv tee cat cd cp h history kill lp ls ' +\n\t\t\t\t\t'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' +\n\t\t\t\t\t'erase rd ren type % \\\\?';\n\n\t\tthis.regexList = [\n\t\t\t{ regex: /#.*$/gm,\t\t\t\t\t\t\t\t\t\tcss: 'comments' }, // one line comments\n\t\t\t{ regex: /\\$[a-zA-Z0-9]+\\b/g,\t\t\t\t\t\t\tcss: 'value' }, // variables $Computer1\n\t\t\t{ regex: /\\-[a-zA-Z]+\\b/g,\t\t\t\t\t\t\t\tcss: 'keyword' }, // Operators -not -and -eq\n\t\t\t{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,\tcss: 'string' }, // strings\n\t\t\t{ regex: SyntaxHighlighter.regexLib.singleQuotedString,\tcss: 'string' }, // strings\n\t\t\t{ regex: new RegExp(this.getKeywords(keywords), 'gmi'),\tcss: 'keyword' },\n\t\t\t{ regex: new RegExp(this.getKeywords(alias), 'gmi'),\tcss: 'keyword' }\n\t\t];\n\t};\n\n\tBrush.prototype\t= new SyntaxHighlighter.Highlighter();\n\tBrush.aliases\t= ['powershell', 'ps'];\n\n\tSyntaxHighlighter.brushes.PowerShell = Brush;\n\n\t// CommonJS\n\ttypeof(exports) != 'undefined' ? exports.Brush = Brush : null;\n})();\n"} +{"text": "import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\nimport { enableProdMode } from '@angular/core';\nimport { AppModule } from './app.module';\n\nenableProdMode();\nplatformBrowserDynamic().bootstrapModule(AppModule);"} +{"text": "/**\n * @license\n * Visual Blocks Language\n *\n * Copyright 2012 Google Inc.\n * https://developers.google.com/blockly/\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 * @fileoverview Generating Python for list blocks.\n * @author q.neutron@gmail.com (Quynh Neutron)\n */\n'use strict';\n\ngoog.provide('Blockly.Python.lists');\n\ngoog.require('Blockly.Python');\n\n\nBlockly.Python['lists_create_empty'] = function(block) {\n // Create an empty list.\n return ['[]', Blockly.Python.ORDER_ATOMIC];\n};\n\nBlockly.Python['lists_create_with'] = function(block) {\n // Create a list with any number of elements of any type.\n var code = new Array(block.itemCount_);\n for (var n = 0; n < block.itemCount_; n++) {\n code[n] = Blockly.Python.valueToCode(block, 'ADD' + n,\n Blockly.Python.ORDER_NONE) || 'None';\n }\n code = '[' + code.join(', ') + ']';\n return [code, Blockly.Python.ORDER_ATOMIC];\n};\n\nBlockly.Python['lists_repeat'] = function(block) {\n // Create a list with one element repeated.\n var argument0 = Blockly.Python.valueToCode(block, 'ITEM',\n Blockly.Python.ORDER_NONE) || 'None';\n var argument1 = Blockly.Python.valueToCode(block, 'NUM',\n Blockly.Python.ORDER_MULTIPLICATIVE) || '0';\n var code = '[' + argument0 + '] * ' + argument1;\n return [code, Blockly.Python.ORDER_MULTIPLICATIVE];\n};\n\nBlockly.Python['lists_length'] = function(block) {\n // String or array length.\n var argument0 = Blockly.Python.valueToCode(block, 'VALUE',\n Blockly.Python.ORDER_NONE) || '[]';\n return ['len(' + argument0 + ')', Blockly.Python.ORDER_FUNCTION_CALL];\n};\n\nBlockly.Python['lists_isEmpty'] = function(block) {\n // Is the string null or array empty?\n var argument0 = Blockly.Python.valueToCode(block, 'VALUE',\n Blockly.Python.ORDER_NONE) || '[]';\n var code = 'not len(' + argument0 + ')';\n return [code, Blockly.Python.ORDER_LOGICAL_NOT];\n};\n\nBlockly.Python['lists_indexOf'] = function(block) {\n // Find an item in the list.\n var argument0 = Blockly.Python.valueToCode(block, 'FIND',\n Blockly.Python.ORDER_NONE) || '[]';\n var argument1 = Blockly.Python.valueToCode(block, 'VALUE',\n Blockly.Python.ORDER_MEMBER) || '\\'\\'';\n var code;\n if (block.getFieldValue('END') == 'FIRST') {\n var functionName = Blockly.Python.provideFunction_(\n 'first_index',\n ['def ' + Blockly.Python.FUNCTION_NAME_PLACEHOLDER_ + '(myList, elem):',\n ' try: theIndex = myList.index(elem) + 1',\n ' except: theIndex = 0',\n ' return theIndex']);\n code = functionName + '(' + argument1 + ', ' + argument0 + ')';\n return [code, Blockly.Python.ORDER_FUNCTION_CALL];\n } else {\n var functionName = Blockly.Python.provideFunction_(\n 'last_index',\n ['def ' + Blockly.Python.FUNCTION_NAME_PLACEHOLDER_ + '(myList, elem):',\n ' try: theIndex = len(myList) - myList[::-1].index(elem)',\n ' except: theIndex = 0',\n ' return theIndex']);\n code = functionName + '(' + argument1 + ', ' + argument0 + ')';\n return [code, Blockly.Python.ORDER_FUNCTION_CALL];\n }\n};\n\nBlockly.Python['lists_getIndex'] = function(block) {\n // Get element at index.\n // Note: Until January 2013 this block did not have MODE or WHERE inputs.\n var mode = block.getFieldValue('MODE') || 'GET';\n var where = block.getFieldValue('WHERE') || 'FROM_START';\n var at = Blockly.Python.valueToCode(block, 'AT',\n Blockly.Python.ORDER_UNARY_SIGN) || '1';\n var list = Blockly.Python.valueToCode(block, 'VALUE',\n Blockly.Python.ORDER_MEMBER) || '[]';\n\n if (where == 'FIRST') {\n if (mode == 'GET') {\n var code = list + '[0]';\n return [code, Blockly.Python.ORDER_MEMBER];\n } else {\n var code = list + '.pop(0)';\n if (mode == 'GET_REMOVE') {\n return [code, Blockly.Python.ORDER_FUNCTION_CALL];\n } else if (mode == 'REMOVE') {\n return code + '\\n';\n }\n }\n } else if (where == 'LAST') {\n if (mode == 'GET') {\n var code = list + '[-1]';\n return [code, Blockly.Python.ORDER_MEMBER];\n } else {\n var code = list + '.pop()';\n if (mode == 'GET_REMOVE') {\n return [code, Blockly.Python.ORDER_FUNCTION_CALL];\n } else if (mode == 'REMOVE') {\n return code + '\\n';\n }\n }\n } else if (where == 'FROM_START') {\n // Blockly uses one-based indicies.\n if (Blockly.isNumber(at)) {\n // If the index is a naked number, decrement it right now.\n at = parseInt(at, 10) - 1;\n } else {\n // If the index is dynamic, decrement it in code.\n at = 'int(' + at + ' - 1)';\n }\n if (mode == 'GET') {\n var code = list + '[' + at + ']';\n return [code, Blockly.Python.ORDER_MEMBER];\n } else {\n var code = list + '.pop(' + at + ')';\n if (mode == 'GET_REMOVE') {\n return [code, Blockly.Python.ORDER_FUNCTION_CALL];\n } else if (mode == 'REMOVE') {\n return code + '\\n';\n }\n }\n } else if (where == 'FROM_END') {\n if (mode == 'GET') {\n var code = list + '[-' + at + ']';\n return [code, Blockly.Python.ORDER_MEMBER];\n } else {\n var code = list + '.pop(-' + at + ')';\n if (mode == 'GET_REMOVE') {\n return [code, Blockly.Python.ORDER_FUNCTION_CALL];\n } else if (mode == 'REMOVE') {\n return code + '\\n';\n }\n }\n } else if (where == 'RANDOM') {\n Blockly.Python.definitions_['import_random'] = 'import random';\n if (mode == 'GET') {\n code = 'random.choice(' + list + ')';\n return [code, Blockly.Python.ORDER_FUNCTION_CALL];\n } else {\n var functionName = Blockly.Python.provideFunction_(\n 'lists_remove_random_item',\n ['def ' + Blockly.Python.FUNCTION_NAME_PLACEHOLDER_ + '(myList):',\n ' x = int(random.random() * len(myList))',\n ' return myList.pop(x)']);\n code = functionName + '(' + list + ')';\n if (mode == 'GET_REMOVE') {\n return [code, Blockly.Python.ORDER_FUNCTION_CALL];\n } else if (mode == 'REMOVE') {\n return code + '\\n';\n }\n }\n }\n throw 'Unhandled combination (lists_getIndex).';\n};\n\nBlockly.Python['lists_setIndex'] = function(block) {\n // Set element at index.\n // Note: Until February 2013 this block did not have MODE or WHERE inputs.\n var list = Blockly.Python.valueToCode(block, 'LIST',\n Blockly.Python.ORDER_MEMBER) || '[]';\n var mode = block.getFieldValue('MODE') || 'GET';\n var where = block.getFieldValue('WHERE') || 'FROM_START';\n var at = Blockly.Python.valueToCode(block, 'AT',\n Blockly.Python.ORDER_NONE) || '1';\n var value = Blockly.Python.valueToCode(block, 'TO',\n Blockly.Python.ORDER_NONE) || 'None';\n // Cache non-trivial values to variables to prevent repeated look-ups.\n // Closure, which accesses and modifies 'list'.\n function cacheList() {\n if (list.match(/^\\w+$/)) {\n return '';\n }\n var listVar = Blockly.Python.variableDB_.getDistinctName(\n 'tmp_list', Blockly.Variables.NAME_TYPE);\n var code = listVar + ' = ' + list + '\\n';\n list = listVar;\n return code;\n }\n if (where == 'FIRST') {\n if (mode == 'SET') {\n return list + '[0] = ' + value + '\\n';\n } else if (mode == 'INSERT') {\n return list + '.insert(0, ' + value + ')\\n';\n }\n } else if (where == 'LAST') {\n if (mode == 'SET') {\n return list + '[-1] = ' + value + '\\n';\n } else if (mode == 'INSERT') {\n return list + '.append(' + value + ')\\n';\n }\n } else if (where == 'FROM_START') {\n // Blockly uses one-based indicies.\n if (Blockly.isNumber(at)) {\n // If the index is a naked number, decrement it right now.\n at = parseInt(at, 10) - 1;\n } else {\n // If the index is dynamic, decrement it in code.\n at = 'int(' + at + ' - 1)';\n }\n if (mode == 'SET') {\n return list + '[' + at + '] = ' + value + '\\n';\n } else if (mode == 'INSERT') {\n return list + '.insert(' + at + ', ' + value + ')\\n';\n }\n } else if (where == 'FROM_END') {\n if (mode == 'SET') {\n return list + '[-' + at + '] = ' + value + '\\n';\n } else if (mode == 'INSERT') {\n return list + '.insert(-' + at + ', ' + value + ')\\n';\n }\n } else if (where == 'RANDOM') {\n Blockly.Python.definitions_['import_random'] = 'import random';\n var code = cacheList();\n var xVar = Blockly.Python.variableDB_.getDistinctName(\n 'tmp_x', Blockly.Variables.NAME_TYPE);\n code += xVar + ' = int(random.random() * len(' + list + '))\\n';\n if (mode == 'SET') {\n code += list + '[' + xVar + '] = ' + value + '\\n';\n return code;\n } else if (mode == 'INSERT') {\n code += list + '.insert(' + xVar + ', ' + value + ')\\n';\n return code;\n }\n }\n throw 'Unhandled combination (lists_setIndex).';\n};\n\nBlockly.Python['lists_getSublist'] = function(block) {\n // Get sublist.\n var list = Blockly.Python.valueToCode(block, 'LIST',\n Blockly.Python.ORDER_MEMBER) || '[]';\n var where1 = block.getFieldValue('WHERE1');\n var where2 = block.getFieldValue('WHERE2');\n var at1 = Blockly.Python.valueToCode(block, 'AT1',\n Blockly.Python.ORDER_ADDITIVE) || '1';\n var at2 = Blockly.Python.valueToCode(block, 'AT2',\n Blockly.Python.ORDER_ADDITIVE) || '1';\n if (where1 == 'FIRST' || (where1 == 'FROM_START' && at1 == '1')) {\n at1 = '';\n } else if (where1 == 'FROM_START') {\n // Blockly uses one-based indicies.\n if (Blockly.isNumber(at1)) {\n // If the index is a naked number, decrement it right now.\n at1 = parseInt(at1, 10) - 1;\n } else {\n // If the index is dynamic, decrement it in code.\n at1 = 'int(' + at1 + ' - 1)';\n }\n } else if (where1 == 'FROM_END') {\n if (Blockly.isNumber(at1)) {\n at1 = -parseInt(at1, 10);\n } else {\n at1 = '-int(' + at1 + ')';\n }\n }\n if (where2 == 'LAST' || (where2 == 'FROM_END' && at2 == '1')) {\n at2 = '';\n } else if (where1 == 'FROM_START') {\n if (Blockly.isNumber(at2)) {\n at2 = parseInt(at2, 10);\n } else {\n at2 = 'int(' + at2 + ')';\n }\n } else if (where1 == 'FROM_END') {\n if (Blockly.isNumber(at2)) {\n // If the index is a naked number, increment it right now.\n // Add special case for -0.\n at2 = 1 - parseInt(at2, 10);\n if (at2 == 0) {\n at2 = '';\n }\n } else {\n // If the index is dynamic, increment it in code.\n Blockly.Python.definitions_['import_sys'] = 'import sys';\n at2 = 'int(1 - ' + at2 + ') or sys.maxsize';\n }\n }\n var code = list + '[' + at1 + ' : ' + at2 + ']';\n return [code, Blockly.Python.ORDER_MEMBER];\n};\n\nBlockly.Python['lists_split'] = function(block) {\n // Block for splitting text into a list, or joining a list into text.\n var mode = block.getFieldValue('MODE');\n if (mode == 'SPLIT') {\n var value_input = Blockly.Python.valueToCode(block, 'INPUT',\n Blockly.Python.ORDER_MEMBER) || '\\'\\'';\n var value_delim = Blockly.Python.valueToCode(block, 'DELIM',\n Blockly.Python.ORDER_NONE);\n var code = value_input + '.split(' + value_delim + ')';\n } else if (mode == 'JOIN') {\n var value_input = Blockly.Python.valueToCode(block, 'INPUT',\n Blockly.Python.ORDER_NONE) || '[]';\n var value_delim = Blockly.Python.valueToCode(block, 'DELIM',\n Blockly.Python.ORDER_MEMBER) || '\\'\\'';\n var code = value_delim + '.join(' + value_input + ')';\n } else {\n throw 'Unknown mode: ' + mode;\n }\n return [code, Blockly.Python.ORDER_FUNCTION_CALL];\n};\n"} +{"text": "# Copyright 2003, 2004, 2005, 2006, 2007, 2008 by Jim Weirich (jim@weirichhouse.org)\n# All rights reserved.\n\n# Permission is granted for use, copying, modification, distribution,\n# and distribution of modified versions of this work as long as the\n# above copyright notice is included.\n\n# Configuration information about an upload host system.\n# * name :: Name of host system.\n# * webdir :: Base directory for the web information for the\n# application. The application name (APP) is appended to\n# this directory before using.\n# * pkgdir :: Directory on the host system where packages can be\n# placed.\nHostInfo = Struct.new(:name, :webdir, :pkgdir)\n\n# Manage several publishers as a single entity.\nclass CompositePublisher\n def initialize\n @publishers = []\n end\n\n # Add a publisher to the composite.\n def add(pub)\n @publishers << pub\n end\n\n # Upload all the individual publishers.\n def upload\n @publishers.each { |p| p.upload }\n end\nend\n\n# Publish an entire directory to an existing remote directory using\n# SSH.\nclass SshDirPublisher\n def initialize(host, remote_dir, local_dir)\n @host = host\n @remote_dir = remote_dir\n @local_dir = local_dir\n end\n\n def upload\n run %{scp -rq #{@local_dir}/* #{@host}:#{@remote_dir}}\n end\nend\n\n# Publish an entire directory to a fresh remote directory using SSH.\nclass SshFreshDirPublisher < SshDirPublisher\n def upload\n run %{ssh #{@host} rm -rf #{@remote_dir}} rescue nil\n run %{ssh #{@host} mkdir #{@remote_dir}}\n super\n end\nend\n\n# Publish a list of files to an existing remote directory.\nclass SshFilePublisher\n # Create a publisher using the give host information.\n def initialize(host, remote_dir, local_dir, *files)\n @host = host\n @remote_dir = remote_dir\n @local_dir = local_dir\n @files = files\n end\n\n # Upload the local directory to the remote directory.\n def upload\n @files.each do |fn|\n run %{scp -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}}\n end\n end\nend\n"} +{"text": "package com.effective.android.component.paccounts\n\nimport androidx.fragment.app.Fragment\n\ninterface ComponentPaccountsSdk {\n\n fun getMainFragment(): Fragment\n\n fun getMainName(): String\n}"} +{"text": "/*\nCopyright (c) 2014 Microsoft Corporation. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\n\nAuthor: Leonardo de Moura\n*/\n#pragma once\n#include \"kernel/environment.h\"\n#include \"frontends/lean/parser_config.h\"\n#include \"frontends/lean/cmd_table.h\"\nnamespace lean {\nclass parser;\n/** \\brief Return true iff the current token is a notation declaration */\nbool curr_is_notation_decl(parser & p);\n/** \\brief Parse a notation declaration, throws an error if the current token is not a \"notation declaration\".\n If allow_local is true, then notation may contain reference to local constants.\n*/\nnotation_entry parse_notation(parser & p, bool overload, buffer & new_tokens, bool allow_local);\n\n/** \\brief Parse local notation */\nenvironment local_notation_cmd(parser & p);\n\nvoid register_notation_cmds(cmd_table & r);\n\nbool is_notation_cmd(name const & cmd_name);\n\nvoid initialize_notation_cmd();\nvoid finalize_notation_cmd();\n}\n"}