text
stringlengths 2
100k
| meta
dict |
---|---|
<?php
use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
/**
* This class has been auto-generated
* by the Symfony Dependency Injection Component.
*
* @final since Symfony 3.3
*/
class ProjectServiceContainer extends Container
{
private $parameters = [];
private $targetDirs = [];
public function __construct()
{
$this->services = [];
$this->normalizedIds = [
'symfony\\component\\dependencyinjection\\tests\\fixtures\\customdefinition' => 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition',
'symfony\\component\\dependencyinjection\\tests\\fixtures\\testservicesubscriber' => 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber',
];
$this->methodMap = [
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition' => 'getCustomDefinitionService',
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber' => 'getTestServiceSubscriberService',
'foo_service' => 'getFooServiceService',
];
$this->privates = [
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition' => true,
];
$this->aliases = [];
}
public function getRemovedIds()
{
return [
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition' => true,
'service_locator.jmktfsv' => true,
'service_locator.jmktfsv.foo_service' => true,
];
}
public function compile()
{
throw new LogicException('You cannot compile a dumped container that was already compiled.');
}
public function isCompiled()
{
return true;
}
public function isFrozen()
{
@trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the isCompiled() method instead.', __METHOD__), E_USER_DEPRECATED);
return true;
}
/**
* Gets the public 'Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber' shared service.
*
* @return \Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber
*/
protected function getTestServiceSubscriberService()
{
return $this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber();
}
/**
* Gets the public 'foo_service' shared autowired service.
*
* @return \Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber
*/
protected function getFooServiceService()
{
return $this->services['foo_service'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber((new \Symfony\Component\DependencyInjection\ServiceLocator(['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition' => function () {
$f = function (\Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition $v = null) { return $v; }; return $f(${($_ = isset($this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition']) ? $this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition'] : ($this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition())) && false ?: '_'});
}, 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber' => function () {
$f = function (\Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber $v) { return $v; }; return $f(${($_ = isset($this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber']) ? $this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber'] : ($this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber())) && false ?: '_'});
}, 'bar' => function () {
$f = function (\Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition $v) { return $v; }; return $f(${($_ = isset($this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber']) ? $this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber'] : ($this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber())) && false ?: '_'});
}, 'baz' => function () {
$f = function (\Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition $v = null) { return $v; }; return $f(${($_ = isset($this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition']) ? $this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition'] : ($this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition())) && false ?: '_'});
}]))->withContext('foo_service', $this));
}
/**
* Gets the private 'Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition' shared service.
*
* @return \Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition
*/
protected function getCustomDefinitionService()
{
return $this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition();
}
}
| {
"pile_set_name": "Github"
} |
{
"dependencies": {
"connect": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/connect/-/connect-3.4.1.tgz",
"from": "[email protected]",
"dependencies": {
"debug": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
"from": "debug@>=2.2.0 <2.3.0",
"dependencies": {
"ms": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz",
"from": "[email protected]"
}
}
},
"finalhandler": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.4.1.tgz",
"from": "[email protected]",
"dependencies": {
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"from": "escape-html@>=1.0.3 <1.1.0"
},
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
"from": "on-finished@>=2.3.0 <2.4.0",
"dependencies": {
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"from": "[email protected]"
}
}
},
"unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
"from": "unpipe@>=1.0.0 <1.1.0"
}
}
},
"parseurl": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz",
"from": "parseurl@>=1.3.1 <1.4.0"
},
"utils-merge": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz",
"from": "[email protected]"
}
}
},
"cors": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/cors/-/cors-2.7.1.tgz",
"from": "[email protected]",
"dependencies": {
"vary": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.0.tgz",
"from": "vary@>=1.0.0 <2.0.0"
}
}
},
"fsevents": {
"version": "1.0.14",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.0.14.tgz",
"from": "fsevents@>=1.0.0 <2.0.0",
"dependencies": {
"abbrev": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz",
"from": "abbrev@>=1.0.0 <2.0.0"
},
"ansi-regex": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz",
"from": "ansi-regex@>=2.0.0 <3.0.0"
},
"ansi-styles": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
"from": "ansi-styles@>=2.2.1 <3.0.0"
},
"aproba": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/aproba/-/aproba-1.0.4.tgz",
"from": "aproba@>=1.0.3 <2.0.0"
},
"are-we-there-yet": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz",
"from": "are-we-there-yet@>=1.1.2 <1.2.0"
},
"asn1": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz",
"from": "asn1@>=0.2.3 <0.3.0"
},
"assert-plus": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz",
"from": "assert-plus@>=0.2.0 <0.3.0"
},
"async": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
"from": "async@>=1.5.2 <2.0.0"
},
"aws-sign2": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz",
"from": "aws-sign2@>=0.6.0 <0.7.0"
},
"aws4": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.4.1.tgz",
"from": "aws4@>=1.2.1 <2.0.0"
},
"balanced-match": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz",
"from": "balanced-match@>=0.4.1 <0.5.0"
},
"bl": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz",
"from": "bl@>=1.1.2 <1.2.0",
"dependencies": {
"readable-stream": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz",
"from": "readable-stream@>=2.0.5 <2.1.0"
}
}
},
"block-stream": {
"version": "0.0.9",
"resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz",
"from": "block-stream@*"
},
"boom": {
"version": "2.10.1",
"resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz",
"from": "boom@>=2.0.0 <3.0.0"
},
"brace-expansion": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.5.tgz",
"from": "brace-expansion@>=1.0.0 <2.0.0"
},
"buffer-shims": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz",
"from": "buffer-shims@>=1.0.0 <2.0.0"
},
"caseless": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz",
"from": "caseless@>=0.11.0 <0.12.0"
},
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"from": "chalk@>=1.1.1 <2.0.0"
},
"code-point-at": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz",
"from": "code-point-at@>=1.0.0 <2.0.0"
},
"combined-stream": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz",
"from": "combined-stream@>=1.0.5 <1.1.0"
},
"commander": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz",
"from": "commander@>=2.9.0 <3.0.0"
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"from": "[email protected]"
},
"console-control-strings": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
"from": "console-control-strings@>=1.1.0 <1.2.0"
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"from": "core-util-is@>=1.0.0 <1.1.0"
},
"cryptiles": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz",
"from": "cryptiles@>=2.0.0 <3.0.0"
},
"dashdash": {
"version": "1.14.0",
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.0.tgz",
"from": "dashdash@>=1.12.0 <2.0.0",
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"from": "assert-plus@>=1.0.0 <2.0.0"
}
}
},
"debug": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
"from": "debug@>=2.2.0 <2.3.0"
},
"deep-extend": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.1.tgz",
"from": "deep-extend@>=0.4.0 <0.5.0"
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"from": "delayed-stream@>=1.0.0 <1.1.0"
},
"delegates": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
"from": "delegates@>=1.0.0 <2.0.0"
},
"ecc-jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz",
"from": "ecc-jsbn@>=0.1.1 <0.2.0"
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"from": "escape-string-regexp@>=1.0.2 <2.0.0"
},
"extend": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz",
"from": "extend@>=3.0.0 <3.1.0"
},
"extsprintf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz",
"from": "[email protected]"
},
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
"from": "forever-agent@>=0.6.1 <0.7.0"
},
"form-data": {
"version": "1.0.0-rc4",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz",
"from": "form-data@>=1.0.0-rc4 <1.1.0"
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"from": "fs.realpath@>=1.0.0 <2.0.0"
},
"fstream": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.10.tgz",
"from": "fstream@>=1.0.2 <2.0.0"
},
"fstream-ignore": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz",
"from": "fstream-ignore@>=1.0.5 <1.1.0"
},
"gauge": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.6.0.tgz",
"from": "gauge@>=2.6.0 <2.7.0"
},
"generate-function": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz",
"from": "generate-function@>=2.0.0 <3.0.0"
},
"generate-object-property": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
"from": "generate-object-property@>=1.1.0 <2.0.0"
},
"getpass": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz",
"from": "getpass@>=0.1.1 <0.2.0",
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"from": "assert-plus@>=1.0.0 <2.0.0"
}
}
},
"glob": {
"version": "7.0.5",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.0.5.tgz",
"from": "glob@>=7.0.5 <8.0.0"
},
"graceful-fs": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz",
"from": "graceful-fs@>=4.1.2 <5.0.0"
},
"graceful-readlink": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
"from": "graceful-readlink@>=1.0.0"
},
"har-validator": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz",
"from": "har-validator@>=2.0.6 <2.1.0"
},
"has-ansi": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
"from": "has-ansi@>=2.0.0 <3.0.0"
},
"has-color": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz",
"from": "has-color@>=0.1.7 <0.2.0"
},
"has-unicode": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
"from": "has-unicode@>=2.0.0 <3.0.0"
},
"hawk": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz",
"from": "hawk@>=3.1.3 <3.2.0"
},
"hoek": {
"version": "2.16.3",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
"from": "hoek@>=2.0.0 <3.0.0"
},
"http-signature": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz",
"from": "http-signature@>=1.1.0 <1.2.0"
},
"inflight": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz",
"from": "inflight@>=1.0.4 <2.0.0"
},
"inherits": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
"from": "inherits@>=2.0.1 <2.1.0"
},
"ini": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz",
"from": "ini@>=1.3.0 <1.4.0"
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"from": "is-fullwidth-code-point@>=1.0.0 <2.0.0"
},
"is-my-json-valid": {
"version": "2.13.1",
"resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz",
"from": "is-my-json-valid@>=2.12.4 <3.0.0"
},
"is-property": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
"from": "is-property@>=1.0.0 <2.0.0"
},
"is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
"from": "is-typedarray@>=1.0.0 <1.1.0"
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"from": "isarray@>=1.0.0 <1.1.0"
},
"isstream": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
"from": "isstream@>=0.1.2 <0.2.0"
},
"jodid25519": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz",
"from": "jodid25519@>=1.0.0 <2.0.0"
},
"jsbn": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz",
"from": "jsbn@>=0.1.0 <0.2.0"
},
"json-schema": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz",
"from": "[email protected]"
},
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
"from": "json-stringify-safe@>=5.0.1 <5.1.0"
},
"jsonpointer": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz",
"from": "[email protected]"
},
"jsprim": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.0.tgz",
"from": "jsprim@>=1.2.2 <2.0.0"
},
"mime-db": {
"version": "1.23.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.23.0.tgz",
"from": "mime-db@>=1.23.0 <1.24.0"
},
"mime-types": {
"version": "2.1.11",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz",
"from": "mime-types@>=2.1.7 <2.2.0"
},
"minimatch": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz",
"from": "minimatch@>=3.0.2 <4.0.0"
},
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"from": "[email protected]"
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"from": "mkdirp@>=0.5.0 <0.6.0"
},
"ms": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz",
"from": "[email protected]"
},
"node-pre-gyp": {
"version": "0.6.29",
"resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.29.tgz",
"from": "node-pre-gyp@>=0.6.29 <0.7.0"
},
"node-uuid": {
"version": "1.4.7",
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz",
"from": "node-uuid@>=1.4.7 <1.5.0"
},
"nopt": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
"from": "nopt@>=3.0.1 <3.1.0"
},
"npmlog": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-3.1.2.tgz",
"from": "npmlog@>=3.1.2 <3.2.0"
},
"number-is-nan": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz",
"from": "number-is-nan@>=1.0.0 <2.0.0"
},
"oauth-sign": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz",
"from": "oauth-sign@>=0.8.1 <0.9.0"
},
"object-assign": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz",
"from": "object-assign@>=4.1.0 <5.0.0"
},
"once": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz",
"from": "once@>=1.3.0 <2.0.0"
},
"path-is-absolute": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz",
"from": "path-is-absolute@>=1.0.0 <2.0.0"
},
"pinkie": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
"from": "pinkie@>=2.0.0 <3.0.0"
},
"pinkie-promise": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
"from": "pinkie-promise@>=2.0.0 <3.0.0"
},
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"from": "process-nextick-args@>=1.0.6 <1.1.0"
},
"qs": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.2.0.tgz",
"from": "qs@>=6.2.0 <6.3.0"
},
"rc": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/rc/-/rc-1.1.6.tgz",
"from": "rc@>=1.1.0 <1.2.0",
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"from": "minimist@>=1.2.0 <2.0.0"
}
}
},
"readable-stream": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz",
"from": "readable-stream@>=2.0.0 <3.0.0||>=1.1.13 <2.0.0"
},
"request": {
"version": "2.73.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.73.0.tgz",
"from": "request@>=2.0.0 <3.0.0"
},
"rimraf": {
"version": "2.5.3",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.3.tgz",
"from": "rimraf@>=2.5.0 <2.6.0"
},
"semver": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.2.0.tgz",
"from": "semver@>=5.2.0 <5.3.0"
},
"set-blocking": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"from": "set-blocking@>=2.0.0 <2.1.0"
},
"signal-exit": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz",
"from": "signal-exit@>=3.0.0 <4.0.0"
},
"sntp": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz",
"from": "sntp@>=1.0.0 <2.0.0"
},
"sshpk": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.8.3.tgz",
"from": "sshpk@>=1.7.0 <2.0.0",
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"from": "assert-plus@>=1.0.0 <2.0.0"
}
}
},
"string-width": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz",
"from": "string-width@>=1.0.1 <2.0.0"
},
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"from": "string_decoder@>=0.10.0 <0.11.0"
},
"stringstream": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
"from": "stringstream@>=0.0.4 <0.1.0"
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"from": "strip-ansi@>=3.0.1 <4.0.0"
},
"strip-json-comments": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz",
"from": "strip-json-comments@>=1.0.4 <1.1.0"
},
"supports-color": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"from": "supports-color@>=2.0.0 <3.0.0"
},
"tar": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz",
"from": "tar@>=2.2.0 <2.3.0"
},
"tar-pack": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.1.4.tgz",
"from": "tar-pack@>=3.1.0 <3.2.0"
},
"tough-cookie": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz",
"from": "tough-cookie@>=2.2.0 <2.3.0"
},
"tunnel-agent": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz",
"from": "tunnel-agent@>=0.4.1 <0.5.0"
},
"tweetnacl": {
"version": "0.13.3",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz",
"from": "tweetnacl@>=0.13.0 <0.14.0"
},
"uid-number": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz",
"from": "uid-number@>=0.0.6 <0.1.0"
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"from": "util-deprecate@>=1.0.1 <1.1.0"
},
"verror": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz",
"from": "[email protected]"
},
"wide-align": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.0.tgz",
"from": "wide-align@>=1.1.0 <2.0.0"
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"from": "wrappy@>=1.0.0 <2.0.0"
},
"xtend": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
"from": "xtend@>=4.0.0 <5.0.0"
}
}
},
"memory-fs": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.3.0.tgz",
"from": "[email protected]",
"dependencies": {
"errno": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz",
"from": "errno@>=0.1.3 <0.2.0",
"dependencies": {
"prr": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz",
"from": "prr@>=0.0.0 <0.1.0"
}
}
},
"readable-stream": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.2.tgz",
"from": "readable-stream@>=2.0.1 <3.0.0",
"dependencies": {
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"from": "core-util-is@>=1.0.0 <1.1.0"
},
"inherits": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
"from": "inherits@>=2.0.1 <2.1.0"
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"from": "isarray@>=1.0.0 <1.1.0"
},
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"from": "process-nextick-args@>=1.0.6 <1.1.0"
},
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"from": "string_decoder@>=0.10.0 <0.11.0"
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"from": "util-deprecate@>=1.0.1 <1.1.0"
}
}
}
}
},
"mime": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz",
"from": "[email protected]"
},
"nan": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.4.0.tgz",
"from": "nan@>=2.3.0 <3.0.0"
},
"underscore": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz",
"from": "[email protected]"
},
"webpack": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-1.13.0.tgz",
"from": "[email protected]",
"dependencies": {
"acorn": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-3.1.0.tgz",
"from": "acorn@>=3.0.0 <4.0.0"
},
"async": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
"from": "async@>=1.3.0 <2.0.0"
},
"clone": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz",
"from": "clone@>=1.0.2 <2.0.0"
},
"enhanced-resolve": {
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz",
"from": "enhanced-resolve@>=0.9.0 <0.10.0",
"dependencies": {
"graceful-fs": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz",
"from": "graceful-fs@>=4.1.2 <5.0.0"
},
"memory-fs": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz",
"from": "memory-fs@>=0.2.0 <0.3.0"
}
}
},
"interpret": {
"version": "0.6.6",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-0.6.6.tgz",
"from": "interpret@>=0.6.4 <0.7.0"
},
"loader-utils": {
"version": "0.2.14",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.14.tgz",
"from": "loader-utils@>=0.2.11 <0.3.0",
"dependencies": {
"big.js": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-3.1.3.tgz",
"from": "big.js@>=3.1.3 <4.0.0"
},
"emojis-list": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-1.0.2.tgz",
"from": "emojis-list@>=1.0.0 <2.0.0"
},
"json5": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/json5/-/json5-0.5.0.tgz",
"from": "json5@>=0.5.0 <0.6.0"
},
"object-assign": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz",
"from": "object-assign@>=4.0.1 <5.0.0"
}
}
},
"memory-fs": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.3.0.tgz",
"from": "memory-fs@>=0.3.0 <0.4.0",
"dependencies": {
"errno": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz",
"from": "errno@>=0.1.3 <0.2.0",
"dependencies": {
"prr": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz",
"from": "prr@>=0.0.0 <0.1.0"
}
}
},
"readable-stream": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.2.tgz",
"from": "readable-stream@>=2.0.1 <3.0.0",
"dependencies": {
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"from": "core-util-is@>=1.0.0 <1.1.0"
},
"inherits": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
"from": "inherits@>=2.0.1 <2.1.0"
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"from": "isarray@>=1.0.0 <1.1.0"
},
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"from": "process-nextick-args@>=1.0.6 <1.1.0"
},
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"from": "string_decoder@>=0.10.0 <0.11.0"
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"from": "util-deprecate@>=1.0.1 <1.1.0"
}
}
}
}
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"from": "mkdirp@>=0.5.0 <0.6.0",
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"from": "[email protected]"
}
}
},
"node-libs-browser": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-0.5.3.tgz",
"from": "node-libs-browser@>=0.4.0 <=0.6.0",
"dependencies": {
"assert": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/assert/-/assert-1.3.0.tgz",
"from": "assert@>=1.1.1 <2.0.0"
},
"browserify-zlib": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz",
"from": "browserify-zlib@>=0.1.4 <0.2.0",
"dependencies": {
"pako": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/pako/-/pako-0.2.8.tgz",
"from": "pako@>=0.2.0 <0.3.0"
}
}
},
"buffer": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-3.6.0.tgz",
"from": "buffer@>=3.0.3 <4.0.0",
"dependencies": {
"base64-js": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz",
"from": "[email protected]"
},
"ieee754": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.6.tgz",
"from": "ieee754@>=1.1.4 <2.0.0"
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"from": "isarray@>=1.0.0 <2.0.0"
}
}
},
"console-browserify": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz",
"from": "console-browserify@>=1.1.0 <2.0.0",
"dependencies": {
"date-now": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz",
"from": "date-now@>=0.1.4 <0.2.0"
}
}
},
"constants-browserify": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-0.0.1.tgz",
"from": "[email protected]"
},
"crypto-browserify": {
"version": "3.2.8",
"resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.2.8.tgz",
"from": "crypto-browserify@>=3.2.6 <3.3.0",
"dependencies": {
"pbkdf2-compat": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/pbkdf2-compat/-/pbkdf2-compat-2.0.1.tgz",
"from": "[email protected]"
},
"ripemd160": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-0.2.0.tgz",
"from": "[email protected]"
},
"sha.js": {
"version": "2.2.6",
"resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.2.6.tgz",
"from": "[email protected]"
}
}
},
"domain-browser": {
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz",
"from": "domain-browser@>=1.1.1 <2.0.0"
},
"events": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/events/-/events-1.1.0.tgz",
"from": "events@>=1.0.0 <2.0.0"
},
"http-browserify": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/http-browserify/-/http-browserify-1.7.0.tgz",
"from": "http-browserify@>=1.3.2 <2.0.0",
"dependencies": {
"Base64": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/Base64/-/Base64-0.2.1.tgz",
"from": "Base64@>=0.2.0 <0.3.0"
},
"inherits": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
"from": "inherits@>=2.0.1 <2.1.0"
}
}
},
"https-browserify": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.0.tgz",
"from": "[email protected]"
},
"os-browserify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz",
"from": "os-browserify@>=0.1.2 <0.2.0"
},
"path-browserify": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz",
"from": "[email protected]"
},
"process": {
"version": "0.11.2",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.2.tgz",
"from": "process@>=0.11.0 <0.12.0"
},
"punycode": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
"from": "punycode@>=1.2.4 <2.0.0"
},
"querystring-es3": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz",
"from": "querystring-es3@>=0.2.0 <0.3.0"
},
"readable-stream": {
"version": "1.1.14",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"from": "readable-stream@>=1.1.13 <2.0.0",
"dependencies": {
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"from": "core-util-is@>=1.0.0 <1.1.0"
},
"inherits": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
"from": "inherits@>=2.0.1 <2.1.0"
},
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"from": "[email protected]"
}
}
},
"stream-browserify": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-1.0.0.tgz",
"from": "stream-browserify@>=1.0.0 <2.0.0",
"dependencies": {
"inherits": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
"from": "inherits@>=2.0.1 <2.1.0"
}
}
},
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"from": "string_decoder@>=0.10.25 <0.11.0"
},
"timers-browserify": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz",
"from": "timers-browserify@>=1.0.1 <2.0.0"
},
"tty-browserify": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
"from": "[email protected]"
},
"url": {
"version": "0.10.3",
"resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz",
"from": "url@>=0.10.1 <0.11.0",
"dependencies": {
"punycode": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
"from": "[email protected]"
},
"querystring": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
"from": "[email protected]"
}
}
},
"util": {
"version": "0.10.3",
"resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",
"from": "util@>=0.10.3 <0.11.0",
"dependencies": {
"inherits": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
"from": "[email protected]"
}
}
},
"vm-browserify": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
"from": "[email protected]",
"dependencies": {
"indexof": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz",
"from": "[email protected]"
}
}
}
}
},
"optimist": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
"from": "optimist@>=0.6.0 <0.7.0",
"dependencies": {
"minimist": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
"from": "minimist@>=0.0.1 <0.1.0"
},
"wordwrap": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
"from": "wordwrap@>=0.0.2 <0.1.0"
}
}
},
"supports-color": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz",
"from": "supports-color@>=3.1.0 <4.0.0",
"dependencies": {
"has-flag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
"from": "has-flag@>=1.0.0 <2.0.0"
}
}
},
"tapable": {
"version": "0.1.10",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz",
"from": "tapable@>=0.1.8 <0.2.0"
},
"uglify-js": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.6.2.tgz",
"from": "uglify-js@>=2.6.0 <2.7.0",
"dependencies": {
"async": {
"version": "0.2.10",
"resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz",
"from": "async@>=0.2.6 <0.3.0"
},
"source-map": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz",
"from": "source-map@>=0.5.1 <0.6.0"
},
"uglify-to-browserify": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz",
"from": "uglify-to-browserify@>=1.0.0 <1.1.0"
},
"yargs": {
"version": "3.10.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz",
"from": "yargs@>=3.10.0 <3.11.0",
"dependencies": {
"camelcase": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
"from": "camelcase@>=1.0.2 <2.0.0"
},
"cliui": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz",
"from": "cliui@>=2.1.0 <3.0.0",
"dependencies": {
"center-align": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz",
"from": "center-align@>=0.1.1 <0.2.0",
"dependencies": {
"align-text": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
"from": "align-text@>=0.1.1 <0.2.0",
"dependencies": {
"kind-of": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz",
"from": "kind-of@>=3.0.2 <4.0.0",
"dependencies": {
"is-buffer": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.3.tgz",
"from": "is-buffer@>=1.0.2 <2.0.0"
}
}
},
"longest": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
"from": "longest@>=1.0.1 <2.0.0"
},
"repeat-string": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.5.4.tgz",
"from": "repeat-string@>=1.5.2 <2.0.0"
}
}
},
"lazy-cache": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz",
"from": "lazy-cache@>=1.0.3 <2.0.0"
}
}
},
"right-align": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
"from": "right-align@>=0.1.1 <0.2.0",
"dependencies": {
"align-text": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
"from": "align-text@>=0.1.1 <0.2.0",
"dependencies": {
"kind-of": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz",
"from": "kind-of@>=3.0.2 <4.0.0",
"dependencies": {
"is-buffer": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.3.tgz",
"from": "is-buffer@>=1.0.2 <2.0.0"
}
}
},
"longest": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
"from": "longest@>=1.0.1 <2.0.0"
},
"repeat-string": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.5.4.tgz",
"from": "repeat-string@>=1.5.2 <2.0.0"
}
}
}
}
},
"wordwrap": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz",
"from": "[email protected]"
}
}
},
"decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"from": "decamelize@>=1.0.0 <2.0.0"
},
"window-size": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz",
"from": "[email protected]"
}
}
}
}
},
"watchpack": {
"version": "0.2.9",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-0.2.9.tgz",
"from": "watchpack@>=0.2.1 <0.3.0",
"dependencies": {
"async": {
"version": "0.9.2",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
"from": "async@>=0.9.0 <0.10.0"
},
"chokidar": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.4.3.tgz",
"from": "chokidar@>=1.0.0 <2.0.0",
"dependencies": {
"anymatch": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz",
"from": "anymatch@>=1.3.0 <2.0.0",
"dependencies": {
"arrify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
"from": "arrify@>=1.0.0 <2.0.0"
},
"micromatch": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.8.tgz",
"from": "micromatch@>=2.1.5 <3.0.0",
"dependencies": {
"arr-diff": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
"from": "arr-diff@>=2.0.0 <3.0.0",
"dependencies": {
"arr-flatten": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz",
"from": "arr-flatten@>=1.0.1 <2.0.0"
}
}
},
"array-unique": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
"from": "array-unique@>=0.2.1 <0.3.0"
},
"braces": {
"version": "1.8.4",
"resolved": "https://registry.npmjs.org/braces/-/braces-1.8.4.tgz",
"from": "braces@>=1.8.2 <2.0.0",
"dependencies": {
"expand-range": {
"version": "1.8.2",
"resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
"from": "expand-range@>=1.8.1 <2.0.0",
"dependencies": {
"fill-range": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz",
"from": "fill-range@>=2.1.0 <3.0.0",
"dependencies": {
"is-number": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz",
"from": "is-number@>=2.1.0 <3.0.0"
},
"isobject": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
"from": "isobject@>=2.0.0 <3.0.0",
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"from": "[email protected]"
}
}
},
"randomatic": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.5.tgz",
"from": "randomatic@>=1.1.3 <2.0.0"
},
"repeat-string": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.5.4.tgz",
"from": "repeat-string@>=1.5.2 <2.0.0"
}
}
}
}
},
"preserve": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz",
"from": "preserve@>=0.2.0 <0.3.0"
},
"repeat-element": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz",
"from": "repeat-element@>=1.1.2 <2.0.0"
}
}
},
"expand-brackets": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
"from": "expand-brackets@>=0.1.4 <0.2.0",
"dependencies": {
"is-posix-bracket": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz",
"from": "is-posix-bracket@>=0.1.0 <0.2.0"
}
}
},
"extglob": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
"from": "extglob@>=0.3.1 <0.4.0"
},
"filename-regex": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz",
"from": "filename-regex@>=2.0.0 <3.0.0"
},
"is-extglob": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
"from": "is-extglob@>=1.0.0 <2.0.0"
},
"kind-of": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.3.tgz",
"from": "kind-of@>=3.0.2 <4.0.0",
"dependencies": {
"is-buffer": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.3.tgz",
"from": "is-buffer@>=1.0.2 <2.0.0"
}
}
},
"normalize-path": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz",
"from": "normalize-path@>=2.0.1 <3.0.0"
},
"object.omit": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.0.tgz",
"from": "object.omit@>=2.0.0 <3.0.0",
"dependencies": {
"for-own": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.4.tgz",
"from": "for-own@>=0.1.3 <0.2.0",
"dependencies": {
"for-in": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.5.tgz",
"from": "for-in@>=0.1.5 <0.2.0"
}
}
},
"is-extendable": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
"from": "is-extendable@>=0.1.1 <0.2.0"
}
}
},
"parse-glob": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz",
"from": "parse-glob@>=3.0.4 <4.0.0",
"dependencies": {
"glob-base": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz",
"from": "glob-base@>=0.3.0 <0.4.0"
},
"is-dotfile": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz",
"from": "is-dotfile@>=1.0.0 <2.0.0"
}
}
},
"regex-cache": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz",
"from": "regex-cache@>=0.4.2 <0.5.0",
"dependencies": {
"is-equal-shallow": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz",
"from": "is-equal-shallow@>=0.1.3 <0.2.0"
},
"is-primitive": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz",
"from": "is-primitive@>=2.0.0 <3.0.0"
}
}
}
}
}
}
},
"async-each": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.0.tgz",
"from": "async-each@>=1.0.0 <2.0.0"
},
"glob-parent": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
"from": "glob-parent@>=2.0.0 <3.0.0"
},
"inherits": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
"from": "inherits@>=2.0.1 <3.0.0"
},
"is-binary-path": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz",
"from": "is-binary-path@>=1.0.0 <2.0.0",
"dependencies": {
"binary-extensions": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.4.0.tgz",
"from": "binary-extensions@>=1.0.0 <2.0.0"
}
}
},
"is-glob": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
"from": "is-glob@>=2.0.0 <3.0.0",
"dependencies": {
"is-extglob": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
"from": "is-extglob@>=1.0.0 <2.0.0"
}
}
},
"path-is-absolute": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz",
"from": "path-is-absolute@>=1.0.0 <2.0.0"
},
"readdirp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.0.0.tgz",
"from": "readdirp@>=2.0.0 <3.0.0",
"dependencies": {
"minimatch": {
"version": "2.0.10",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz",
"from": "minimatch@>=2.0.10 <3.0.0",
"dependencies": {
"brace-expansion": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.4.tgz",
"from": "brace-expansion@>=1.0.0 <2.0.0",
"dependencies": {
"balanced-match": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz",
"from": "balanced-match@>=0.4.1 <0.5.0"
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"from": "[email protected]"
}
}
}
}
},
"readable-stream": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.2.tgz",
"from": "readable-stream@>=2.0.2 <3.0.0",
"dependencies": {
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"from": "core-util-is@>=1.0.0 <1.1.0"
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"from": "isarray@>=1.0.0 <1.1.0"
},
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"from": "process-nextick-args@>=1.0.6 <1.1.0"
},
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"from": "string_decoder@>=0.10.0 <0.11.0"
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"from": "util-deprecate@>=1.0.1 <1.1.0"
}
}
}
}
}
}
},
"graceful-fs": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz",
"from": "graceful-fs@>=4.1.2 <5.0.0"
}
}
},
"webpack-core": {
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/webpack-core/-/webpack-core-0.6.8.tgz",
"from": "webpack-core@>=0.6.0 <0.7.0",
"dependencies": {
"source-list-map": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-0.1.6.tgz",
"from": "source-list-map@>=0.1.0 <0.2.0"
},
"source-map": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
"from": "source-map@>=0.4.1 <0.5.0",
"dependencies": {
"amdefine": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz",
"from": "amdefine@>=0.0.4"
}
}
}
}
}
}
},
"webpack-dev-middleware": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-1.6.1.tgz",
"from": "[email protected]",
"dependencies": {
"memory-fs": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.3.0.tgz",
"from": "memory-fs@>=0.3.0 <0.4.0",
"dependencies": {
"errno": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz",
"from": "errno@>=0.1.3 <0.2.0",
"dependencies": {
"prr": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz",
"from": "prr@>=0.0.0 <0.1.0"
}
}
},
"readable-stream": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.2.tgz",
"from": "readable-stream@>=2.0.1 <3.0.0",
"dependencies": {
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"from": "core-util-is@>=1.0.0 <1.1.0"
},
"inherits": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
"from": "inherits@>=2.0.1 <2.1.0"
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"from": "isarray@>=1.0.0 <1.1.0"
},
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"from": "process-nextick-args@>=1.0.6 <1.1.0"
},
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"from": "string_decoder@>=0.10.0 <0.11.0"
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"from": "util-deprecate@>=1.0.1 <1.1.0"
}
}
}
}
},
"mime": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz",
"from": "mime@>=1.3.4 <2.0.0"
},
"range-parser": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.3.tgz",
"from": "range-parser@>=1.0.3 <2.0.0"
}
}
},
"webpack-hot-middleware": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/webpack-hot-middleware/-/webpack-hot-middleware-2.10.0.tgz",
"from": "[email protected]",
"dependencies": {
"ansi-html": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.5.tgz",
"from": "[email protected]"
},
"html-entities": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.0.tgz",
"from": "html-entities@>=1.2.0 <2.0.0"
},
"querystring": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
"from": "querystring@>=0.2.0 <0.3.0"
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"from": "strip-ansi@>=3.0.0 <4.0.0",
"dependencies": {
"ansi-regex": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz",
"from": "ansi-regex@>=2.0.0 <3.0.0"
}
}
}
}
}
}
}
| {
"pile_set_name": "Github"
} |
喜多村ゆい最新番号
【KMDS-20407】性に目覚めた息子~性教育を口実に熟れた肉体を差し出し息子との肉欲交尾に溺れる熟女お母さん~
【JKNK-035】人妻のねっとりフェラ&手コキ
【EVIS-115】民家盗撮オナニー 小型望遠カメラ vol.2
【VNDS-3149】奥さん!!お尻が熟れすぎですよ! 6
【VNDS-3085】ぐちょ濡れ えろい体のおばさん女教師
【DSE-1226】近親相姦 愛しい私の息子 総集編
【JKNK-004】超モデル体型美熟女 喜多村ゆい 46歳
【VNDS-2964】美熟女教師にお礼参りのぶっかけレイプ
【MAMA-336】初めての浮気現場 13
【JRZD-341】初撮り人妻ドキュメント 喜多村ゆい</a>2013-01-31センタービレッジ$$$聚楽120分钟 | {
"pile_set_name": "Github"
} |
{% extends "admin/popup_response.html" %}
| {
"pile_set_name": "Github"
} |
<?php
$customers = array(array(
'id'=>1,
'name'=>'Bread Barn',
'phone'=>'8436-365-256'
), array(
'id'=>2,
'name'=>'Icecream Island',
'phone'=>'8452-389-719'
), array(
'id'=>3,
'name'=>'Pizza Palace',
'phone'=>'9378-255-743'
)
);
if (isset($_REQUEST['id'])) {
$id = $_REQUEST['id'];
foreach ($customers as &$customer) {
if ($customer['id'] == $id) {
echo json_encode($customer);
break;
}
}
} else {
echo json_encode($customers);
}
?> | {
"pile_set_name": "Github"
} |
/*
GeoGebra - Dynamic Mathematics for Everyone
http://www.geogebra.org
This file is part of GeoGebra.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation.
*/
/*
* AlgoUnitVectorVector.java
*
* Created on 30. August 2001, 21:37
*/
package org.geogebra.common.kernel.algos;
import org.geogebra.common.kernel.CircularDefinitionException;
import org.geogebra.common.kernel.Construction;
import org.geogebra.common.kernel.StringTemplate;
import org.geogebra.common.kernel.commands.Commands;
import org.geogebra.common.kernel.geos.GeoElement;
import org.geogebra.common.kernel.kernelND.GeoPointND;
import org.geogebra.common.kernel.kernelND.GeoVectorND;
/**
*
* @author Markus
*/
public abstract class AlgoUnitVector extends AlgoElement {
protected GeoElement inputGeo; // input
protected GeoVectorND u; // output
protected boolean normalize;
protected double length;
/** Creates new AlgoOrthoVectorVector */
public AlgoUnitVector(Construction cons, GeoElement inputGeo,
boolean normalize) {
super(cons);
this.normalize = normalize;
this.inputGeo = inputGeo;
u = createVector(cons);
GeoPointND possStartPoint = getInputStartPoint();
if (possStartPoint != null && possStartPoint.isLabelSet()) {
try {
u.setStartPoint(possStartPoint);
} catch (CircularDefinitionException e) {
// can't happen for new vector v
}
}
setInputOutput(); // for AlgoElement
compute();
}
/**
*
* @param cons1
* construction
* @return new vector
*/
abstract protected GeoVectorND createVector(Construction cons1);
abstract protected GeoPointND getInputStartPoint();
// for AlgoElement
@Override
protected void setInputOutput() {
input = new GeoElement[1];
input[0] = inputGeo;
super.setOutputLength(1);
super.setOutput(0, (GeoElement) u);
setDependencies(); // done by AlgoElement
}
@Override
public Commands getClassName() {
return normalize ? Commands.UnitVector : Commands.Direction;
}
public GeoVectorND getVector() {
return u;
}
@Override
final public String toString(StringTemplate tpl) {
if (!normalize) {
return getLoc().getPlainDefault("DirectionOfA", "Direction of %0",
inputGeo.getLabel(tpl));
}
return getLoc().getPlainDefault("UnitVectorOfA", "Unit vector of %0",
inputGeo.getLabel(tpl));
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project> | {
"pile_set_name": "Github"
} |
#! /usr/bin/env python
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) 2011-2015, Michigan State University.
# Copyright (C) 2015, The Regents of the University of California.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# * Neither the name of the Michigan State University nor the names
# of its contributors may be used to endorse or promote products
# derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Contact: [email protected]
import khmer
import sys
import screed
import os.path
from khmer.thread_utils import ThreadedSequenceProcessor, verbose_fasta_iter
K = 32
HASHTABLE_SIZE = int(4e6)
THRESHOLD = 500
N_HT = 4
WORKER_THREADS = 5
###
GROUPSIZE = 100
###
def main():
infile = sys.argv[1]
outfile = os.path.basename(infile) + '.graphsize'
if len(sys.argv) == 3:
outfile = sys.argv[2]
print('input file to graphsize filter: %s' % infile)
print('filtering to output:', outfile)
print('-- settings:')
print('K', K)
print('HASHTABLE SIZE %g' % HASHTABLE_SIZE)
print('N HASHTABLES %d' % N_HT)
print('THRESHOLD', THRESHOLD)
print('N THREADS', WORKER_THREADS)
print('--')
print('creating ht')
ht = khmer.Nodegraph(K, HASHTABLE_SIZE, N_HT)
print('eating fa', infile)
total_reads, n_consumed = ht.consume_seqfile(infile)
outfp = open(outfile, 'w')
###
def process_fn(record, ht=ht):
kmer = record['sequence'][:K]
size = ht.calc_connected_graph_size(kmer, THRESHOLD)
if size >= THRESHOLD:
return record['name'], record['sequence']
return None, None
tsp = ThreadedSequenceProcessor(process_fn, WORKER_THREADS, GROUPSIZE)
###
tsp.start(verbose_fasta_iter(infile), outfp)
if __name__ == '__main__':
main()
| {
"pile_set_name": "Github"
} |
/* Derivative for two-frequency estimation */
/*
Copyright (C) 2004 University of Texas at Austin
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <rsf.h>
/*^*/
#include "expder2.h"
static int n1, n2;
static float *a, *b, *c, *d;
void expder2_init(int m1, int m2 /* data size */,
float **aa /* filter [4][m1*m2] */)
/*< initialize >*/
{
n1 = m1;
n2 = m2;
a = aa[0];
b = aa[1];
c = aa[2];
d = aa[3];
}
void expder2_lop (bool adj, bool add, int nx, int ny, float *xx, float *yy)
/*< linear operator >*/
{
int i, j, k;
if (ny != 4*nx) sf_error("%s: size error: %d != 4*%d",__FILE__,ny,nx);
sf_adjnull(adj,add,nx,ny,xx,yy);
for (j=0; j < n2; j++) {
for (i=4; i < n1; i++) {
k = i + j*n1;
if (adj) {
xx[k-1] += b[k]*yy[k] + a[k]*yy[k+nx] +
d[k]*yy[k+2*nx] + c[k]*yy[k+3*nx];
xx[k-2] -= (2.*b[k]*d[k]*(c[k]*yy[k] + a[k]*yy[k+2*nx]) +
(b[k]+2.*a[k]*c[k]*d[k])*yy[k+nx] +
(d[k]+2.*a[k]*c[k]*b[k])*yy[k+3*nx]);
xx[k-3] += b[k]*d[k]*(d[k]*yy[k]+b[k]*yy[k+2*nx]) +
d[k]*(a[k]*d[k]+2.*b[k]*c[k])*yy[k+nx] +
b[k]*(c[k]*b[k]+2.*d[k]*a[k])*yy[k+3*nx];
xx[k-4] -= b[k]*d[k]*(d[k]*yy[k+nx] + b[k]*yy[k+3*nx]);
} else {
yy[k] += b[k]*(xx[k-1] +
d[k]*(d[k]*xx[k-3] - 2.*c[k]*xx[k-2]));
yy[k+nx] += a[k]*xx[k-1]-(b[k]+2.*a[k]*c[k]*d[k])*xx[k-2] +
d[k]*((a[k]*d[k]+2.*b[k]*c[k])*xx[k-3] -
d[k]*b[k]*xx[k-4]);
yy[k+2*nx] += d[k]*(xx[k-1] +
b[k]*(b[k]*xx[k-3] - 2.*a[k]*xx[k-2]));
yy[k+3*nx] += c[k]*xx[k-1]-(d[k]+2.*a[k]*c[k]*b[k])*xx[k-2] +
b[k]*((c[k]*b[k]+2.*d[k]*a[k])*xx[k-3] -
d[k]*b[k]*xx[k-4]);
}
}
}
}
| {
"pile_set_name": "Github"
} |
OFF
428 839 0
-0.155600 -0.072020 -0.513300
0.147500 -0.122600 -0.564100
0.065260 -0.012050 -0.280100
-0.115300 -0.073600 -0.822800
0.173700 -0.110200 -0.803400
0.313500 -0.047230 -0.457400
0.014750 -0.037210 -1.110000
0.256700 0.103700 -0.052500
0.467000 -0.037290 -0.696300
0.063180 0.081690 0.025880
-0.348500 0.197200 -0.144500
-0.461100 0.120300 -0.578800
-0.120600 0.096420 -0.145200
-0.321200 0.039190 -0.856900
0.347000 -0.006584 -1.008000
-0.046020 0.074000 0.327200
0.686300 0.147800 -0.526800
0.477100 0.126300 -0.187300
0.527500 0.035870 -0.986600
0.024660 0.152500 -1.322000
0.333400 0.066980 -1.231000
0.457600 0.186900 0.102400
-0.475600 0.202200 -0.999600
-0.213400 0.081500 -1.182000
0.622300 0.381300 0.010510
0.362500 0.088130 0.438700
-0.589200 0.330700 -0.513400
-0.634100 0.470500 -0.883800
-0.208900 0.144300 0.272200
-0.401100 0.331700 0.291300
-0.587000 0.598700 -0.294100
-0.637500 0.578100 -0.609300
0.324900 0.291600 -1.446000
-0.287300 0.072200 0.540700
0.867900 0.392100 -0.669900
0.792300 0.484800 -0.275700
0.610200 0.287400 -1.283000
0.763200 0.232600 -0.950000
-0.467000 0.498000 -0.012900
-0.163200 0.433200 -1.510000
0.836300 0.568400 -1.185000
0.551700 0.291300 0.350900
-0.630300 0.731700 -0.456400
-0.635500 0.706900 -0.694900
-0.410800 0.347200 -1.242000
-0.610900 0.640200 -0.382300
-0.698500 0.556300 -0.383800
-0.703100 0.660000 -0.438700
0.560600 0.260300 0.574400
0.431000 0.009849 0.834200
-0.699500 0.699200 -0.451700
-0.762500 0.685000 -0.433500
-0.645100 0.534900 -0.145700
-0.731700 0.561800 -0.292000
-0.546900 0.595400 -0.222800
-0.602000 0.625700 -0.301700
-0.518000 0.483100 -1.147000
0.169300 0.015670 0.508400
0.218800 -0.077960 0.868800
-0.000068 -0.116600 0.894800
-0.752700 0.627200 -0.335700
-0.705800 0.900500 -0.453800
-0.603800 0.927000 -0.508500
-0.686200 0.636200 -0.238000
-0.674400 0.661900 -0.387200
-0.719700 0.620700 -0.123800
0.996400 0.835900 -0.482500
0.966800 0.602600 -0.416100
0.866200 0.651500 -0.397100
0.791000 0.655000 -0.164900
0.832900 0.604600 -0.289200
0.657200 0.642200 -1.388000
0.272600 0.597700 -1.561000
-0.769700 0.812900 -0.432900
-0.723500 0.787900 -0.374500
0.882100 0.589500 -0.079200
0.803500 0.660300 -0.136700
0.436300 0.575900 -1.510000
-0.607600 0.949200 -0.326000
-0.627000 0.854800 -0.414600
-0.738500 0.764200 -0.231700
-0.761500 0.715800 -0.304700
-0.756800 0.709600 -0.183200
-0.496200 0.799300 -0.010190
-0.458800 0.338300 0.603400
-0.484800 0.682200 0.277400
-0.429700 0.740000 -1.382000
-0.438600 0.050220 0.981200
-0.436900 0.204400 0.822100
-0.348000 0.129300 0.656400
0.870500 0.788100 -0.450500
0.868500 0.884800 -0.419100
-0.672600 0.911900 -0.292500
-0.615700 0.815800 -0.373000
-0.675500 0.725500 -0.006100
-0.587800 0.657000 -0.125700
-0.632200 0.621400 -0.039120
0.863200 0.965400 -0.309800
1.003000 0.608000 -0.337000
0.931000 0.721600 -0.377100
0.935500 0.621600 -0.279200
0.998900 0.726600 -0.254800
0.950700 0.653400 -0.054870
0.962900 0.535400 -0.210700
0.352600 -0.163900 1.066000
-0.596600 0.860000 -0.268600
-0.715100 0.758200 -0.133400
-0.515700 0.835000 0.021580
-0.146000 -0.281000 1.231000
0.917800 0.759400 -0.364900
0.717400 0.633800 0.056220
0.716500 0.691500 0.034650
0.688300 0.560500 0.364400
-0.605200 1.016000 -0.936100
-0.563700 0.967700 -1.204000
-0.655700 0.731600 -0.897200
-0.461100 0.760200 0.150300
-0.080040 0.759200 -1.570000
0.953900 0.858600 -0.394000
0.817000 0.798400 -0.312700
0.808200 0.871200 -0.334600
0.973400 0.653000 -0.152300
0.913700 0.695000 -0.069920
0.807800 0.715200 -0.034420
0.765100 0.787300 0.026870
0.656700 0.912300 0.150100
-0.607300 0.914000 -0.186300
-0.556900 0.782800 -0.202300
-0.659300 0.766500 0.045410
0.823500 1.011000 -1.023000
0.855400 1.401000 -0.380600
0.846900 1.007000 -0.448800
0.953500 0.774500 -0.226600
0.821400 0.846400 -0.260000
0.963400 0.739000 -0.178800
0.842700 0.754600 0.094040
0.776200 0.923800 0.144900
0.046360 1.262000 -1.533000
0.287000 0.881800 -1.557000
-0.638300 0.893600 -0.149400
-0.574500 0.858300 -0.136700
-0.663900 0.799600 -0.047600
-0.537600 0.930500 0.113200
0.807700 1.300000 -0.802000
0.886300 1.274000 -0.228900
0.837300 0.972200 -0.262000
0.891400 0.903600 -0.226100
0.859200 0.710700 -0.170000
0.947000 0.747200 -0.057530
0.912000 0.772900 -0.057170
0.906600 0.747500 0.052610
-0.589700 1.295000 -0.289200
-0.600200 0.953900 -0.076410
-0.554800 0.814100 -0.059310
0.856600 0.903900 -0.195500
0.939200 0.834600 -0.119300
0.730800 0.860800 -0.166500
0.789400 0.797300 -0.162400
0.898500 0.653600 -0.858000
0.487900 0.781900 -1.481000
-0.550100 0.984400 -0.118400
-0.653200 0.933000 -0.065660
-0.586100 0.350700 1.052000
-0.278200 1.191000 -1.452000
0.705400 0.828600 -0.066450
0.866300 0.846600 -0.034430
0.855400 0.863700 0.115700
0.721500 0.894000 0.079890
-0.538000 1.330000 -0.583700
-0.593200 0.969700 0.015540
-0.633100 0.811400 0.048680
-0.657300 0.940600 0.116300
-0.585200 0.868500 0.106800
0.803000 0.887300 -0.032640
0.669100 0.933300 0.324500
0.667700 0.804100 0.248100
0.635700 0.507100 0.638600
0.620100 0.330600 0.755800
-0.648700 0.932200 0.033150
-0.542500 0.993900 0.049280
0.835000 0.949800 -0.058240
0.759500 0.969300 -0.003780
0.826100 0.929400 0.005850
0.898100 0.887800 -0.033040
0.861200 0.947500 0.110000
0.737300 0.965800 0.101500
0.680900 0.738700 0.548800
0.709300 0.493300 0.947600
-0.406000 0.873600 0.356900
0.640800 0.018200 1.135000
-0.610000 0.221300 1.045000
-0.568200 -0.079300 1.237000
0.209500 -0.298200 1.259000
-0.116000 -0.256300 1.295000
0.597900 1.176000 -1.366000
0.566400 -0.208700 1.243000
-0.483100 1.156000 0.491300
-0.537600 0.603100 1.053000
-0.794400 0.173300 1.226000
0.761900 1.123000 0.121500
0.735200 1.363000 -1.200000
0.746800 1.139000 0.411300
0.597700 0.919100 0.508900
0.655700 0.753000 0.761300
0.708200 0.977700 -1.271000
0.492000 -0.193800 1.309000
-0.493500 1.509000 -0.297600
-0.510200 1.464000 -0.508100
-0.422300 -0.154300 1.271000
0.743700 1.529000 -0.596500
0.738000 1.550000 -0.501800
0.759200 1.612000 -0.821900
0.702900 0.248300 0.992100
0.908100 0.450400 1.166000
0.958700 0.142800 1.241000
-0.527700 1.149000 0.210600
0.728000 1.571000 -0.324800
0.857400 0.023850 1.291000
-0.423700 1.741000 -0.562700
-0.417400 1.548000 -0.392300
-0.409400 1.620000 -0.643300
-0.555300 1.388000 -0.955500
-0.574200 1.239000 -0.051490
-0.500100 1.422000 0.026880
-0.385500 1.063000 0.443500
-0.305100 1.085000 0.607000
-0.830600 0.196300 1.317000
0.653400 1.746000 -0.530800
0.660300 1.597000 -0.400000
0.749300 1.353000 0.049340
0.607800 0.877200 0.571800
0.430300 1.217000 -1.474000
0.328500 1.564000 -1.391000
-0.420000 1.681000 -0.829900
-0.415700 1.406000 -1.283000
-0.428700 1.376000 0.272700
-0.407600 0.910500 0.613100
-0.476000 0.748300 0.617900
0.858300 0.035940 1.220000
-0.368400 1.561000 -1.168000
-0.346900 0.974500 0.808800
-0.090580 1.560000 -1.373000
0.597100 1.700000 -0.425500
0.585800 1.772000 -0.675600
0.688900 1.242000 0.549100
0.728700 0.669800 1.075000
-0.397500 0.915800 1.097000
0.574900 1.660000 -0.414900
-0.245100 1.799000 -0.690200
0.178100 1.859000 -1.078000
0.722900 1.565000 -0.095780
0.589700 1.547000 0.277700
0.543700 0.914500 0.890200
1.023000 0.288700 1.304000
-0.343800 1.629000 -0.425000
-0.309400 1.741000 -0.439300
-0.305600 1.703000 -0.486400
-0.259000 1.721000 -0.426600
-0.284400 1.709000 -0.431900
-0.352700 1.579000 -0.395200
-0.333800 1.598000 -0.348000
-0.374000 1.634000 -0.277100
-0.472400 1.570000 -0.125100
0.571800 1.788000 -0.448800
0.559600 1.743000 -0.485300
0.582300 1.812000 -0.591500
0.547600 1.764000 -0.505500
0.645200 1.699000 -0.151400
0.580700 1.156000 0.615500
-0.236400 1.750000 -0.506400
-0.154400 1.796000 -0.479200
-0.302200 1.715000 -0.362400
-0.819600 0.466800 1.213000
0.462300 1.840000 -0.479700
0.559200 1.746000 -0.438600
0.576000 1.694000 -0.295500
0.563300 1.745000 -0.338600
0.659100 1.388000 0.445500
0.436900 1.155000 0.733100
1.009000 0.388900 1.194000
-0.179000 1.749000 -0.516400
-0.193400 1.837000 -0.545800
-0.235400 1.736000 -0.451600
-0.239100 1.709000 -0.291000
0.436000 1.787000 -0.516900
0.391500 1.801000 -0.478900
0.447900 1.781000 -0.462900
0.515200 1.746000 -0.394000
0.598700 0.880000 1.097000
-0.180400 1.745000 -0.389600
-0.163100 1.758000 -0.469300
-0.301500 1.768000 -0.057360
-0.314900 1.562000 0.265600
-0.375300 1.424000 0.558400
-0.753800 0.599700 1.285000
-0.123600 1.796000 -1.091000
0.506200 1.845000 -0.565300
0.398000 1.748000 -0.453400
0.391800 1.927000 -0.624200
0.556200 1.767000 -0.978900
-0.088980 1.851000 -0.544100
-0.049640 1.685000 -0.412100
-0.099580 1.729000 -0.384800
-0.166300 1.772000 -0.411300
-0.247400 1.756000 -0.980400
-0.313100 1.359000 0.679400
-0.147000 1.072000 0.827400
0.430500 1.846000 -0.524000
0.419200 1.758000 -0.401100
0.416500 1.775000 -0.363900
0.467200 1.733000 -0.295800
0.601600 1.688000 0.041260
0.944900 0.564900 1.273000
-0.074720 1.917000 -0.618500
-0.225900 1.870000 -0.615400
0.044420 1.716000 -0.451400
-0.015300 1.699000 -0.471200
-0.027520 1.714000 -0.424500
-0.110900 1.719000 -0.306400
-0.610900 0.771300 1.240000
0.334800 1.853000 -0.778200
0.287200 1.728000 -0.388400
0.370800 1.718000 -0.330100
0.375600 1.057000 1.076000
-0.025620 1.812000 -0.511700
-0.010330 1.706000 -0.347400
0.334800 1.857000 -0.548300
0.338500 1.739000 -0.492500
0.335800 1.740000 -0.435300
0.369000 1.821000 -0.083270
0.523800 1.612000 -1.211000
0.464300 1.678000 0.187900
0.545600 1.509000 0.620600
0.897200 0.711200 1.234000
0.484600 1.069000 1.269000
0.783300 0.766700 1.315000
0.058870 1.753000 -0.384100
-0.063010 1.720000 -0.271100
0.252800 1.928000 -0.590800
0.201800 1.850000 -0.443100
0.284000 1.720000 -0.474600
0.217900 1.799000 -0.478000
0.237600 1.739000 -0.425700
0.312300 1.694000 -0.427100
0.489000 1.430000 0.712400
0.381700 1.303000 0.737100
0.335000 1.157000 0.831600
-0.100400 1.798000 -0.021960
-0.202400 1.666000 0.164400
0.319400 1.726000 -0.341600
0.232300 1.830000 -0.310000
0.246400 1.854000 -0.167400
0.441200 1.705000 0.341000
0.480200 1.626000 0.537800
0.088140 1.865000 -0.451100
-0.084660 1.840000 -0.810200
0.069900 1.836000 -0.392800
0.014270 1.833000 -0.157100
0.083270 1.885000 -0.420200
-0.116800 1.756000 0.338300
-0.079140 1.726000 0.319100
-0.163400 1.727000 0.324600
-0.399900 0.960100 1.284000
-0.183500 1.100000 1.280000
0.141400 2.119000 -0.147300
0.180500 1.916000 -0.295800
0.067740 2.008000 -0.230800
-0.025440 1.839000 -0.087210
-0.126300 1.795000 0.319400
0.440800 1.772000 0.309800
-0.118600 1.315000 0.742600
0.036060 1.286000 0.841900
0.073820 1.259000 0.863700
0.124000 1.140000 1.205000
0.311100 1.663000 0.798400
0.043100 1.956000 0.176000
-0.012270 1.906000 0.284600
-0.118400 1.666000 0.807400
0.334800 1.765000 0.299400
0.225700 1.216000 0.816900
-0.038060 1.842000 0.048290
0.009811 1.861000 0.305600
-0.076500 1.794000 0.616100
0.000664 1.805000 0.477400
-0.217800 1.635000 0.509600
0.375100 1.934000 0.067570
0.309400 1.839000 0.024410
0.284100 1.857000 0.315500
-0.067050 1.925000 0.031020
0.039160 1.886000 0.064230
-0.032040 1.930000 0.071080
0.068860 1.848000 -0.053490
-0.060070 1.874000 0.354300
0.312100 1.916000 0.362200
0.298600 1.840000 0.747200
0.299700 1.752000 0.533800
0.196700 1.443000 0.787000
0.012530 2.013000 0.018100
0.087450 1.965000 0.268200
0.066850 1.943000 0.315800
0.243300 2.131000 -0.031660
0.236500 1.882000 0.080560
0.222400 1.956000 0.166500
0.158500 1.856000 0.006200
0.245200 1.102000 1.283000
0.054230 2.014000 0.048740
0.062310 1.890000 0.304900
0.075460 1.939000 0.408300
0.269300 2.036000 0.047550
0.170900 2.001000 0.042730
0.097420 1.990000 0.072250
0.184100 1.908000 -0.039380
0.148200 2.005000 0.281600
0.255200 1.950000 0.268200
0.226800 1.950000 0.340100
0.164200 1.945000 0.411300
0.223400 1.848000 0.468700
0.153400 2.032000 0.069950
0.153300 1.899000 0.318500
0.181100 1.696000 0.822400
0.073460 2.128000 0.042560
0.219900 1.880000 0.292100
0.134800 1.854000 0.423800
0.042400 1.876000 0.750800
-0.570300 0.780800 0.090300
-0.090660 1.731000 -0.507000
0.017930 2.095000 -0.050790
0.090320 1.118000 1.311000
3 0 1 2
3 1 3 4
3 1 4 5
3 3 6 4
3 2 1 7
3 8 5 4
3 1 5 7
3 7 9 2
3 0 10 11
3 0 2 12
3 0 13 3
3 4 14 8
3 0 11 13
3 3 13 6
3 4 6 14
3 12 9 15
3 8 16 17
3 8 14 18
3 6 19 20
3 7 17 21
3 13 11 22
3 6 23 19
3 16 24 17
3 25 9 7
3 11 26 27
3 11 27 22
3 10 28 29
3 14 20 18
3 26 30 31
3 11 10 26
3 13 22 23
3 20 19 32
3 33 28 15
3 34 35 16
3 18 36 37
3 26 31 27
3 30 26 38
3 10 29 38
3 19 23 39
3 40 37 36
3 41 25 21
3 31 42 43
3 22 44 23
3 21 24 41
3 31 45 42
3 46 47 45
3 36 20 32
3 25 48 49
3 45 47 42
3 50 42 47
3 47 46 51
3 45 52 46
3 53 46 52
3 30 54 55
3 30 55 45
3 56 22 27
3 22 56 44
3 15 57 33
3 34 37 40
3 25 49 57
3 57 58 59
3 60 51 53
3 51 46 53
3 45 55 52
3 29 28 33
3 59 33 57
3 42 50 61
3 43 42 62
3 60 63 64
3 60 53 65
3 60 65 63
3 66 67 68
3 69 35 70
3 40 36 71
3 39 72 32
3 50 73 61
3 51 60 73
3 73 64 74
3 68 67 70
3 70 75 76
3 70 76 69
3 32 72 77
3 78 79 61
3 73 60 64
3 80 74 81
3 63 82 81
3 52 65 53
3 54 38 83
3 84 85 29
3 56 86 44
3 29 33 84
3 87 88 89
3 33 59 89
3 90 91 66
3 61 92 78
3 61 73 92
3 93 92 73
3 73 74 93
3 63 65 94
3 63 94 82
3 52 95 96
3 91 97 66
3 98 99 100
3 101 100 99
3 102 98 100
3 70 67 103
3 70 103 75
3 59 58 104
3 78 62 79
3 92 93 105
3 74 80 93
3 105 93 80
3 106 82 94
3 107 95 83
3 39 44 86
3 59 108 89
3 99 109 101
3 75 103 102
3 110 69 111
3 41 24 112
3 36 77 71
3 49 104 58
3 113 114 115
3 114 56 115
3 116 107 83
3 38 85 116
3 38 116 83
3 117 39 86
3 118 119 109
3 118 120 119
3 100 101 121
3 122 102 100
3 75 123 76
3 69 124 111
3 125 111 124
3 24 110 112
3 92 126 78
3 80 127 105
3 128 65 96
3 56 114 86
3 33 88 84
3 129 130 131
3 132 109 119
3 119 120 133
3 101 134 121
3 100 121 122
3 135 136 123
3 136 124 123
3 124 69 123
3 69 76 123
3 111 125 110
3 117 137 138
3 78 126 139
3 140 139 126
3 106 94 141
3 142 107 116
3 143 130 129
3 131 130 144
3 145 131 144
3 97 146 118
3 119 133 132
3 147 134 132
3 122 148 149
3 150 75 102
3 123 75 135
3 78 151 62
3 140 126 127
3 139 140 152
3 153 152 140
3 132 133 147
3 154 155 156
3 154 156 157
3 134 147 149
3 134 149 148
3 158 40 129
3 75 150 135
3 71 77 159
3 72 159 77
3 139 152 160
3 140 127 153
3 152 153 161
3 84 88 162
3 163 117 86
3 133 157 147
3 164 165 149
3 149 165 150
3 135 166 136
3 124 136 167
3 124 167 125
3 72 138 159
3 151 168 43
3 152 161 169
3 152 169 160
3 170 169 161
3 171 172 142
3 157 156 147
3 164 173 165
3 135 150 166
3 174 175 125
3 110 175 112
3 48 176 177
3 128 171 178
3 142 179 171
3 180 181 182
3 173 183 165
3 183 150 165
3 184 136 166
3 136 185 167
3 176 112 186
3 177 176 187
3 171 179 178
3 179 169 178
3 116 188 142
3 163 86 114
3 137 117 163
3 181 180 145
3 180 182 173
3 183 173 182
3 181 184 182
3 166 150 184
3 136 184 185
3 104 49 189
3 169 179 160
3 190 87 191
3 108 192 193
3 180 173 164
3 182 184 150
3 182 150 183
3 185 184 181
3 71 159 194
3 104 195 192
3 142 188 196
3 197 84 162
3 191 198 190
3 87 108 191
3 199 185 181
3 40 200 129
3 201 174 185
3 175 202 186
3 176 186 203
3 200 40 204
3 205 192 195
3 206 207 151
3 108 193 208
3 209 210 130
3 211 143 129
3 212 213 214
3 142 196 215
3 130 210 216
3 204 194 200
3 217 205 195
3 218 207 219
3 207 220 221
3 206 151 222
3 215 223 222
3 196 188 224
3 224 188 225
3 191 226 198
3 191 108 208
3 227 228 210
3 144 229 199
3 186 230 203
3 213 212 187
3 137 231 138
3 137 232 231
3 221 220 233
3 222 223 206
3 114 221 234
3 215 235 223
3 236 225 188
3 84 197 237
3 114 234 163
3 226 191 208
3 210 228 216
3 185 199 201
3 217 195 238
3 207 218 220
3 221 239 234
3 240 236 237
3 163 241 137
3 137 241 232
3 228 227 242
3 227 209 243
3 129 200 211
3 201 244 174
3 187 203 245
3 197 246 237
3 163 234 241
3 228 242 247
3 211 209 143
3 194 231 200
3 231 232 200
3 238 214 217
3 218 248 220
3 224 225 196
3 241 249 232
3 209 211 243
3 250 229 144
3 229 250 251
3 252 245 203
3 217 214 253
3 254 255 256
3 257 258 259
3 258 255 259
3 255 254 259
3 220 248 233
3 260 259 219
3 260 219 261
3 206 223 262
3 247 242 263
3 227 264 242
3 263 242 264
3 227 265 266
3 216 228 267
3 174 268 202
3 256 269 218
3 256 255 269
3 270 269 255
3 259 260 271
3 259 271 257
3 223 235 262
3 198 226 272
3 263 266 273
3 247 263 274
3 275 228 276
3 216 267 250
3 201 229 277
3 202 268 278
3 202 278 230
3 214 213 279
3 214 279 253
3 280 281 269
3 255 258 282
3 257 282 258
3 260 283 271
3 261 283 260
3 241 234 239
3 273 266 284
3 273 284 285
3 263 273 286
3 263 286 274
3 247 274 287
3 277 229 251
3 201 277 244
3 288 245 252
3 269 270 280
3 282 257 289
3 282 289 290
3 262 291 261
3 239 221 233
3 262 235 292
3 293 292 235
3 294 272 226
3 295 249 241
3 266 296 284
3 273 285 286
3 297 286 285
3 298 296 265
3 265 296 266
3 274 286 287
3 211 200 299
3 300 281 280
3 290 289 301
3 302 301 289
3 271 283 303
3 239 233 304
3 262 292 291
3 239 295 241
3 305 293 196
3 225 236 306
3 296 298 307
3 296 307 284
3 286 297 308
3 286 308 287
3 265 243 298
3 276 287 309
3 276 309 310
3 276 310 275
3 250 311 251
3 187 245 213
3 213 312 279
3 281 300 313
3 281 313 314
3 315 316 317
3 301 302 317
3 289 303 302
3 318 302 303
3 197 319 246
3 320 298 243
3 309 287 308
3 321 322 309
3 310 309 322
3 252 323 288
3 324 316 315
3 218 314 248
3 304 233 248
3 317 325 315
3 302 318 325
3 302 325 317
3 303 283 318
3 284 307 326
3 285 327 328
3 275 310 329
3 200 330 299
3 331 251 311
3 277 251 332
3 333 288 334
3 335 333 334
3 232 249 330
3 232 330 200
3 336 315 325
3 337 325 318
3 337 318 283
3 326 338 339
3 340 341 342
3 327 340 328
3 343 328 321
3 322 329 310
3 344 244 332
3 268 344 345
3 345 278 268
3 230 278 346
3 249 299 330
3 347 291 348
3 349 321 342
3 350 351 349
3 251 352 353
3 288 323 334
3 313 354 338
3 338 355 313
3 315 336 356
3 315 356 324
3 336 325 337
3 349 342 350
3 331 352 251
3 251 353 332
3 345 346 278
3 230 346 323
3 338 354 339
3 295 304 248
3 357 337 291
3 337 283 291
3 267 329 311
3 354 358 339
3 291 347 357
3 359 360 361
3 362 363 246
3 331 311 329
3 358 364 339
3 365 339 364
3 358 356 366
3 358 366 364
3 355 338 320
3 356 337 357
3 357 347 367
3 361 360 368
3 331 369 352
3 355 249 295
3 348 361 368
3 370 306 371
3 372 371 306
3 363 373 306
3 332 374 344
3 348 368 375
3 376 375 368
3 377 293 305
3 369 378 352
3 346 345 379
3 347 380 367
3 368 381 376
3 368 360 381
3 382 383 384
3 350 365 351
3 351 365 385
3 351 386 329
3 369 387 378
3 374 345 344
3 367 366 357
3 366 367 388
3 367 380 388
3 380 389 390
3 391 390 389
3 359 383 392
3 351 385 386
3 378 387 393
3 394 353 395
3 394 332 353
3 345 396 379
3 390 391 397
3 390 397 388
3 398 375 376
3 381 392 399
3 365 364 400
3 386 385 401
3 402 401 403
3 379 396 371
3 371 372 379
3 379 372 373
3 323 379 404
3 391 405 397
3 376 406 398
3 399 392 407
3 365 400 408
3 402 403 409
3 332 394 374
3 379 373 404
3 323 404 334
3 410 375 402
3 410 402 409
3 391 410 405
3 377 382 293
3 411 401 408
3 401 385 408
3 412 413 402
3 414 415 393
3 415 416 393
3 395 416 394
3 410 409 417
3 410 417 405
3 415 418 399
3 371 396 370
3 417 411 408
3 374 419 345
3 419 396 345
3 403 411 409
3 411 417 409
3 405 417 420
3 414 421 418
3 416 415 422
3 423 422 383
3 377 423 382
3 370 396 419
3 408 400 417
3 419 374 394
3 417 400 420
3 418 415 414
3 382 423 383
3 377 419 423
3 416 422 423
3 420 400 364
3 416 423 394
3 312 253 279
3 246 240 237
3 202 175 174
3 225 306 370
3 54 95 55
3 52 55 95
3 57 49 58
3 390 388 380
3 399 418 406
3 72 39 117
3 365 408 385
3 288 333 245
3 161 153 141
3 80 106 127
3 277 332 244
3 384 293 382
3 44 39 23
3 204 71 194
3 36 32 77
3 34 16 37
3 63 81 64
3 74 64 81
3 66 98 67
3 373 372 306
3 177 49 48
3 174 244 268
3 2 9 12
3 393 416 395
3 344 268 244
3 35 24 16
3 337 356 336
3 67 98 103
3 102 103 98
3 319 362 246
3 239 304 295
3 227 266 264
3 263 264 266
3 21 25 7
3 320 338 298
3 378 393 352
3 399 407 415
3 394 423 419
3 125 185 174
3 359 392 360
3 381 360 392
3 352 395 353
3 96 424 128
3 61 79 42
3 227 243 265
3 186 112 175
3 20 36 18
3 134 148 121
3 122 121 148
3 248 355 295
3 276 228 247
3 87 89 108
3 249 355 320
3 403 401 411
3 306 236 240
3 287 276 247
3 57 9 25
3 291 283 261
3 162 88 190
3 120 118 146
3 34 68 35
3 70 35 68
3 56 27 115
3 320 299 249
3 97 91 145
3 314 313 355
3 280 425 300
3 340 326 341
3 339 341 326
3 424 107 172
3 142 172 107
3 117 138 72
3 73 50 51
3 312 333 335
3 145 91 131
3 207 206 219
3 389 380 348
3 189 212 214
3 348 375 389
3 280 270 425
3 317 425 270
3 294 362 319
3 180 164 155
3 203 187 176
3 376 381 406
3 399 406 381
3 285 284 327
3 297 343 308
3 50 47 51
3 197 162 272
3 207 221 168
3 115 43 113
3 88 33 89
3 158 34 40
3 6 13 23
3 7 5 17
3 386 401 331
3 402 331 401
3 349 351 322
3 329 322 351
3 85 188 116
3 26 10 38
3 32 19 39
3 114 113 221
3 291 292 348
3 30 38 54
3 41 48 25
3 177 187 212
3 366 388 426
3 393 387 414
3 421 414 387
3 52 96 65
3 144 130 250
3 216 250 130
3 210 209 227
3 218 269 314
3 281 314 269
3 30 45 31
3 5 8 17
3 425 317 316
3 120 146 133
3 128 178 170
3 169 170 178
3 369 413 387
3 421 387 413
3 311 250 267
3 71 204 40
3 356 357 366
3 349 322 321
3 427 373 363
3 108 59 192
3 151 43 62
3 20 14 6
3 228 275 267
3 329 267 275
3 41 112 48
3 176 48 112
3 197 272 319
3 294 319 272
3 196 225 305
3 370 305 225
3 101 109 134
3 132 134 109
3 149 147 164
3 156 164 147
3 127 106 153
3 141 153 106
3 271 303 257
3 289 257 303
3 59 104 192
3 129 131 158
3 151 160 222
3 179 222 160
3 320 243 299
3 419 377 370
3 350 342 341
3 254 219 259
3 348 292 361
3 384 361 292
3 237 85 84
3 207 168 151
3 398 406 412
3 418 412 406
3 35 69 24
3 110 24 69
3 347 348 380
3 377 305 370
3 79 62 42
3 343 321 308
3 309 308 321
3 248 314 355
3 133 146 157
3 154 157 146
3 65 128 94
3 54 83 95
3 105 127 92
3 126 92 127
3 9 57 15
3 88 87 190
3 329 386 331
3 203 230 252
3 196 293 215
3 235 215 293
3 392 383 407
3 229 201 199
3 80 81 106
3 82 106 81
3 384 292 293
3 230 323 252
3 27 31 115
3 43 115 31
3 352 393 395
3 246 363 240
3 306 240 363
3 389 375 391
3 410 391 375
3 151 78 160
3 139 160 78
3 145 180 154
3 155 154 180
3 298 338 307
3 326 307 338
3 85 38 29
3 138 231 159
3 194 159 231
3 366 426 364
3 284 326 327
3 340 327 326
3 43 168 113
3 221 113 168
3 185 125 167
3 118 98 66
3 66 97 118
3 164 156 155
3 145 144 181
3 199 181 144
3 1 0 3
3 49 177 189
3 212 189 177
3 346 379 323
3 230 186 202
3 21 17 24
3 211 299 243
3 324 354 300
3 313 300 354
3 270 290 317
3 301 317 290
3 361 384 359
3 383 359 384
3 141 94 161
3 407 383 415
3 422 415 383
3 94 128 161
3 170 161 128
3 209 130 143
3 10 0 12
3 175 110 125
3 238 189 214
3 189 238 104
3 195 104 238
3 328 340 321
3 342 321 340
3 12 15 10
3 28 10 15
3 218 219 256
3 254 256 219
3 188 85 236
3 237 236 85
3 331 402 369
3 413 369 402
3 324 356 354
3 358 354 356
3 375 398 402
3 412 402 398
3 425 316 300
3 324 300 316
3 179 142 222
3 215 222 142
3 341 339 350
3 365 350 339
3 245 333 213
3 312 213 333
3 98 118 99
3 109 99 118
3 102 122 150
3 149 150 122
3 96 95 424
3 107 424 95
3 128 424 171
3 172 171 424
3 421 413 418
3 412 418 413
3 16 8 37
3 18 37 8
3 219 206 261
3 262 261 206
3 158 131 90
3 91 90 131
3 34 158 68
3 90 68 158
3 90 66 68
3 145 154 97
3 146 97 154
3 190 198 162
3 272 162 198
3 426 388 397
3 420 364 426
3 405 420 426
3 426 397 405
3 328 343 297
3 297 285 328
3 255 282 270
3 290 270 282
3 404 373 427
| {
"pile_set_name": "Github"
} |
#pragma region License
/*
* This file is part of the Boomerang Decompiler.
*
* See the file "LICENSE.TERMS" for information on usage and
* redistribution of this file, and for a DISCLAIMER OF ALL
* WARRANTIES.
*/
#pragma endregion License
#include "SettingsDlg.h"
#include "boomerang-gui/Decompiler.h"
#include "boomerang-gui/ui_SettingsDlg.h"
#include "boomerang/core/Project.h"
#include "boomerang/core/Settings.h"
#include "boomerang/ifc/ITypeRecovery.h"
#include "boomerang/util/log/Log.h"
Q_DECLARE_METATYPE(ITypeRecovery *)
SettingsDlg::SettingsDlg(Decompiler *decompiler, QWidget *_parent)
: QDialog(_parent)
, ui(new Ui::SettingsDlg)
, m_settings(decompiler->getProject()->getSettings())
{
ui->setupUi(this);
// fill combo box with possible logging levels
ui->cbLogLevel->clear();
ui->cbLogLevel->setEditable(false);
ui->cbLogLevel->addItem("Fatal", static_cast<int>(LogLevel::Fatal));
ui->cbLogLevel->addItem("Error", static_cast<int>(LogLevel::Error));
ui->cbLogLevel->addItem("Warning", static_cast<int>(LogLevel::Warning));
ui->cbLogLevel->addItem("Message", static_cast<int>(LogLevel::Message));
ui->cbLogLevel->addItem("Verbose 1", static_cast<int>(LogLevel::Verbose1));
ui->cbLogLevel->addItem("Verbose 2", static_cast<int>(LogLevel::Verbose2));
for (int i = 0; i < ui->cbLogLevel->count(); i++) {
LogLevel cmbLevel = static_cast<LogLevel>(ui->cbLogLevel->itemData(i).value<int>());
if (cmbLevel == Log::getOrCreateLog().getLogLevel()) {
ui->cbLogLevel->setCurrentIndex(i);
break;
}
}
ui->chkDebugDecoder->setChecked(m_settings->debugDecoder);
ui->chkDebugGenerator->setChecked(m_settings->debugGen);
ui->chkDebugLiveness->setChecked(m_settings->debugLiveness);
ui->chkDebugProof->setChecked(m_settings->debugProof);
ui->chkDebugSwitch->setChecked(m_settings->debugSwitch);
ui->chkDebugTA->setChecked(m_settings->debugTA);
ui->chkDebugUnused->setChecked(m_settings->debugUnused);
ui->chkTraceDecoder->setChecked(m_settings->traceDecoder);
ui->chkVerbose->setChecked(m_settings->verboseOutput);
// Decode settings
ui->chkDecodeChildren->setChecked(m_settings->decodeChildren);
ui->chkDecodeMain->setChecked(m_settings->decodeMain);
ui->chkDecodeThruIndirectCall->setChecked(m_settings->decodeThruIndCall);
ui->chkGenCallGraph->setChecked(m_settings->generateCallGraph);
// Decompile settings
ui->cbDotFile->addItem(m_settings->dotFile);
ui->cbDotFile->setEditable(false);
ui->spbPropMaxDepth->setRange(0, std::numeric_limits<int>::max());
ui->spbPropMaxDepth->setValue(m_settings->propMaxDepth);
ITypeRecovery *rec = decompiler->getProject()->getTypeRecoveryEngine();
ui->cbTypeRecoveryEngine->addItem("<None>", QVariant::fromValue<ITypeRecovery *>(nullptr));
ui->cbTypeRecoveryEngine->addItem(rec->getName(), QVariant::fromValue<ITypeRecovery *>(rec));
ui->cbTypeRecoveryEngine->setCurrentIndex(m_settings->useTypeAnalysis ? 1 : 0);
ui->chkAssumeABI->setChecked(m_settings->assumeABI);
ui->chkChangeSignatures->setChecked(m_settings->changeSignatures);
ui->chkGenSymbols->setChecked(m_settings->generateSymbols);
ui->chkNameParameters->setChecked(m_settings->nameParameters);
ui->chkRemoveLabels->setChecked(m_settings->removeLabels);
ui->chkRemoveNull->setChecked(m_settings->removeNull);
ui->chkRemoveReturns->setChecked(m_settings->removeReturns);
ui->chkUseDataflow->setChecked(m_settings->useDataflow);
ui->chkUseGlobals->setChecked(m_settings->useGlobals);
ui->chkUseLocals->setChecked(m_settings->useLocals);
ui->chkUsePromotion->setChecked(m_settings->usePromotion);
ui->chkUseProof->setChecked(m_settings->useProof);
}
SettingsDlg::~SettingsDlg()
{
delete ui;
}
void SettingsDlg::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange: ui->retranslateUi(this); break;
default: break;
}
}
void SettingsDlg::on_btnApply_clicked()
{
Log::getOrCreateLog().setLogLevel(
static_cast<LogLevel>(ui->cbLogLevel->currentData().value<int>()));
m_settings->debugDecoder = ui->chkDebugDecoder->isChecked();
m_settings->debugGen = ui->chkDebugGenerator->isChecked();
m_settings->debugLiveness = ui->chkDebugLiveness->isChecked();
m_settings->debugProof = ui->chkDebugProof->isChecked();
m_settings->debugSwitch = ui->chkDebugSwitch->isChecked();
m_settings->debugTA = ui->chkDebugTA->isChecked();
m_settings->debugUnused = ui->chkDebugUnused->isChecked();
m_settings->traceDecoder = ui->chkTraceDecoder->isChecked();
m_settings->verboseOutput = ui->chkVerbose->isChecked();
// Decode
m_settings->decodeChildren = ui->chkDecodeChildren->isChecked();
m_settings->decodeMain = ui->chkDecodeMain->isChecked();
m_settings->decodeThruIndCall = ui->chkDecodeThruIndirectCall->isChecked();
m_settings->generateCallGraph = ui->chkGenCallGraph->isChecked();
// Decompile
m_settings->dotFile = ui->cbDotFile->currentData().value<QString>();
m_settings->propMaxDepth = ui->spbPropMaxDepth->value();
m_settings->useTypeAnalysis = ui->cbTypeRecoveryEngine->currentData()
.value<ITypeRecovery *>() != nullptr;
m_settings->assumeABI = ui->chkAssumeABI->isChecked();
m_settings->changeSignatures = ui->chkChangeSignatures->isChecked();
m_settings->generateSymbols = ui->chkGenSymbols->isChecked();
m_settings->nameParameters = ui->chkNameParameters->isChecked();
m_settings->removeLabels = ui->chkRemoveLabels->isChecked();
m_settings->removeNull = ui->chkRemoveNull->isChecked();
m_settings->removeReturns = ui->chkRemoveReturns->isChecked();
m_settings->useDataflow = ui->chkUseDataflow->isChecked();
m_settings->useGlobals = ui->chkUseGlobals->isChecked();
m_settings->useLocals = ui->chkUseLocals->isChecked();
m_settings->usePromotion = ui->chkUsePromotion->isChecked();
m_settings->useProof = ui->chkUseProof->isChecked();
}
void SettingsDlg::on_btnOk_clicked()
{
on_btnApply_clicked();
accept();
}
| {
"pile_set_name": "Github"
} |
from django.core.management.base import BaseCommand
from usaspending_api.download.models import JobStatus
from usaspending_api.download import lookups
from django.db import transaction
import logging
@transaction.atomic
class Command(BaseCommand):
help = "Loads static enum data for job statuses."
@transaction.atomic
def handle(self, *args, **options):
logger = logging.getLogger("console")
JobStatus.objects.all().delete()
for status in lookups.JOB_STATUS:
logger.info("Updating status: {}".format(status))
job_status = JobStatus(job_status_id=status.id, name=status.name, description=status.desc)
job_status.save()
| {
"pile_set_name": "Github"
} |
.TH PCRELIMITS 3 "05 November 2013" "PCRE 8.34"
.SH NAME
PCRE - Perl-compatible regular expressions
.SH "SIZE AND OTHER LIMITATIONS"
.rs
.sp
There are some size limitations in PCRE but it is hoped that they will never in
practice be relevant.
.P
The maximum length of a compiled pattern is approximately 64K data units (bytes
for the 8-bit library, 16-bit units for the 16-bit library, and 32-bit units for
the 32-bit library) if PCRE is compiled with the default internal linkage size,
which is 2 bytes for the 8-bit and 16-bit libraries, and 4 bytes for the 32-bit
library. If you want to process regular expressions that are truly enormous,
you can compile PCRE with an internal linkage size of 3 or 4 (when building the
16-bit or 32-bit library, 3 is rounded up to 4). See the \fBREADME\fP file in
the source distribution and the
.\" HREF
\fBpcrebuild\fP
.\"
documentation for details. In these cases the limit is substantially larger.
However, the speed of execution is slower.
.P
All values in repeating quantifiers must be less than 65536.
.P
There is no limit to the number of parenthesized subpatterns, but there can be
no more than 65535 capturing subpatterns. There is, however, a limit to the
depth of nesting of parenthesized subpatterns of all kinds. This is imposed in
order to limit the amount of system stack used at compile time. The limit can
be specified when PCRE is built; the default is 250.
.P
There is a limit to the number of forward references to subsequent subpatterns
of around 200,000. Repeated forward references with fixed upper limits, for
example, (?2){0,100} when subpattern number 2 is to the right, are included in
the count. There is no limit to the number of backward references.
.P
The maximum length of name for a named subpattern is 32 characters, and the
maximum number of named subpatterns is 10000.
.P
The maximum length of a name in a (*MARK), (*PRUNE), (*SKIP), or (*THEN) verb
is 255 for the 8-bit library and 65535 for the 16-bit and 32-bit libraries.
.P
The maximum length of a subject string is the largest positive number that an
integer variable can hold. However, when using the traditional matching
function, PCRE uses recursion to handle subpatterns and indefinite repetition.
This means that the available stack space may limit the size of a subject
string that can be processed by certain patterns. For a discussion of stack
issues, see the
.\" HREF
\fBpcrestack\fP
.\"
documentation.
.
.
.SH AUTHOR
.rs
.sp
.nf
Philip Hazel
University Computing Service
Cambridge CB2 3QH, England.
.fi
.
.
.SH REVISION
.rs
.sp
.nf
Last updated: 05 November 2013
Copyright (c) 1997-2013 University of Cambridge.
.fi
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<ttFont ttLibVersion="2.5">
<post>
<formatType value="3.0"/>
<italicAngle value="0.0"/>
<underlinePosition value="-45"/>
<underlineThickness value="30"/>
<isFixedPitch value="0"/>
<minMemType42 value="0"/>
<maxMemType42 value="0"/>
<minMemType1 value="0"/>
<maxMemType1 value="0"/>
</post>
</ttFont>
| {
"pile_set_name": "Github"
} |
using Uno;
using Uno.Collections;
using Uno.UX;
using Uno.Compiler.ExportTargetInterop;
using Fuse;
using Fuse.Input;
namespace Fuse.Controls.Native.Android
{
extern(Android) internal static class InputDispatch
{
internal static float2 RootOffset { get; set; }
static readonly Dictionary<Java.Object, Visual> _listeners = new Dictionary<Java.Object, Visual>();
static readonly HashSet<int> _activePointers = new HashSet<int>();
static Java.Object _touchListenerHandle;
static Java.Object TouchListener
{
get { return _touchListenerHandle ?? (_touchListenerHandle = CreateTouchListener()); }
}
static bool OnTouch(Java.Object view, Java.Object motionEvent)
{
if (ViewVisualMap.ContainsKey(view))
{
var me = new MotionEvent(motionEvent);
var visual = (Visual)ViewVisualMap.Get(view);
if (visual == null)
return false;
RaiseEvent(visual, view, me);
}
return false;
}
public static void RaiseEvent(Visual visual, Java.Object viewHandle, MotionEvent motionEvent)
{
var rootVisual = FindRoot(visual);
Java.Object rootView = null;
var rootViewport = rootVisual as NativeRootViewport;
if (rootViewport != null)
rootView = rootViewport.RootView.NativeHandle;
var action = motionEvent.ActionMasked;
var data = motionEvent.PointerEventDataForView(rootView, viewHandle, visual.Viewport.PixelsPerPoint);
switch (action)
{
case 3: // android.view.MotionEvent.ACTION_CANCEL:
for (var i = 0; i < data.Length; i++)
RaiseReleased(rootVisual, visual, data[i]);
break;
case 0: // android.view.MotionEvent.ACTION_DOWN:
case 5: // android.view.MotionEvent.ACTION_POINTER_DOWN:
for (var i = 0; i < data.Length; i++)
RaisePressed(rootVisual, visual, data[i]);
break;
case 2: // android.view.MotionEvent.ACTION_MOVE:
for (var i = 0; i < data.Length; i++)
RaiseMoved(rootVisual, visual, data[i]);
break;
case 1: // android.view.MotionEvent.ACTION_UP:
case 6: // android.view.MotionEvent.ACTION_POINTER_UP:
{
/// Uhhh... android why
int pointerMask = MotionEvent.PointerIndexMask;
int pointerShit = MotionEvent.PointerIndexShift;
int pointerIndex = (motionEvent.Action & pointerMask) >> pointerShit;
RaiseReleased(rootVisual, visual, data[pointerIndex]);
}
break;
}
}
static bool IsPointerActive(int pointerId)
{
if (!_activePointers.Contains(pointerId))
{
_activePointers.Add(pointerId);
return false;
}
return true;
}
static void DeactivatePointer(int pointerId)
{
if (_activePointers.Contains(pointerId))
_activePointers.Remove(pointerId);
}
static void RaisePressed(Visual rootVisual, Visual visual, PointerEventData data)
{
if (IsPointerActive(data.PointIndex))
return;
try
{
Fuse.Input.Pointer.RaisePressed(rootVisual, data);
}
catch (Exception e)
{
Fuse.AppBase.OnUnhandledExceptionInternal(e);
}
}
static void RaiseMoved(Visual rootVisual, Visual visual, PointerEventData data)
{
try
{
Fuse.Input.Pointer.RaiseMoved(rootVisual, data);
}
catch (Exception e)
{
Fuse.AppBase.OnUnhandledExceptionInternal(e);
}
}
static void RaiseReleased(Visual rootVisual, Visual visual, PointerEventData data)
{
DeactivatePointer(data.PointIndex);
try
{
Fuse.Input.Pointer.RaiseReleased(rootVisual, data);
}
catch (Exception e)
{
Fuse.AppBase.OnUnhandledExceptionInternal(e);
}
}
/*static readonly object _captureIdentiy = new object();
static void RaiseCancel(Visual visual, PointerEventData data)
{
DeactivatePointer(data.PointIndex);
try
{
if (Fuse.Input.Pointer.HardCapture(data.PointIndex, visual, _captureIdentiy, LostCallback))
Fuse.Input.Pointer.ReleaseHardCapture(data.PointIndex);
}
catch (Exception e)
{
Fuse.AppBase.OnUnhandledExceptionInternal(e);
}
}
static void LostCallback() { }*/
static JavaMap _viewVisualMap;
static JavaMap ViewVisualMap
{
get { return _viewVisualMap ?? (_viewVisualMap = new JavaMap()); }
}
public static void AddListener(Java.Object nativeHandle, Visual owner)
{
ViewVisualMap.Put(nativeHandle, owner);
SetOnTouchListener(nativeHandle, TouchListener);
}
public static void AddListener(ViewHandle viewHandle, Visual owner)
{
AddListener(viewHandle.NativeHandle, owner);
}
public static void RemoveListener(Java.Object nativeHandle)
{
ViewVisualMap.Remove(nativeHandle);
ClearOnTouchListener(nativeHandle);
}
public static void RemoveListener(ViewHandle viewHandle)
{
RemoveListener(viewHandle.NativeHandle);
}
static Visual FindRoot(Visual visual)
{
return visual.Parent != null ? FindRoot(visual.Parent) : visual;
}
[Foreign(Language.Java)]
static Java.Object CreateTouchListener()
@{
return new android.view.View.OnTouchListener() {
public boolean onTouch(android.view.View view, android.view.MotionEvent e) {
return @{OnTouch(Java.Object,Java.Object):Call(view, e)};
}
};
@}
[Foreign(Language.Java)]
static void SetOnTouchListener(Java.Object viewHandle, Java.Object listenerHandle)
@{
((android.view.View)viewHandle).setOnTouchListener(((android.view.View.OnTouchListener)listenerHandle));
@}
[Foreign(Language.Java)]
static void ClearOnTouchListener(Java.Object viewHandle)
@{
((android.view.View)viewHandle).setOnTouchListener(null);
@}
}
[ForeignInclude(Language.Java, "java.util.HashMap")]
[ForeignInclude(Language.Java, "java.util.Map")]
extern(Android) class JavaMap
{
readonly Java.Object _handle;
public JavaMap()
{
_handle = Create();
}
public void Put(Java.Object key, object value)
{
Put(_handle, key, value);
}
public void Remove(Java.Object key)
{
Remove(_handle, key);
}
public bool ContainsKey(Java.Object key)
{
return ContainsKey(_handle, key);
}
public object Get(Java.Object key)
{
return (object)Get(_handle, key);
}
[Foreign(Language.Java)]
static Java.Object Create()
@{
return new HashMap<Object, Object>();
@}
[Foreign(Language.Java)]
static void Put(Java.Object handle, Java.Object key, object value)
@{
@SuppressWarnings("unchecked")
Map<Object, Object> map = (Map<Object, Object>)handle;
map.put(key, value);
@}
[Foreign(Language.Java)]
static void Remove(Java.Object handle, Java.Object key)
@{
@SuppressWarnings("unchecked")
Map<Object, Object> map = (Map<Object, Object>)handle;
map.remove(key);
@}
[Foreign(Language.Java)]
static bool ContainsKey(Java.Object handle, Java.Object key)
@{
@SuppressWarnings("unchecked")
Map<Object, Object> map = (Map<Object, Object>)handle;
return map.containsKey(key);
@}
[Foreign(Language.Java)]
static object Get(Java.Object handle, Java.Object key)
@{
@SuppressWarnings("unchecked")
Map<Object, Object> map = (Map<Object, Object>)handle;
return map.get(key);
@}
}
extern(Android) public class MotionEvent
{
readonly Java.Object _handle;
public MotionEvent(Java.Object handle)
{
_handle = handle;
}
public int GetPointerId(int pointerIndex)
{
return GetPointerId(_handle, pointerIndex);
}
public int ActionMasked
{
get { return GetActionMasked(_handle); }
}
public int Action
{
get { return GetAction(_handle); }
}
public long EventTime
{
get { return GetEventTime(_handle); }
}
public int PointerCount
{
get { return GetPointerCount(_handle); }
}
public float2 GetPosition(int pointerIndex)
{
return float2(GetX(_handle, pointerIndex), GetY(_handle, pointerIndex));
}
public PointerEventData[] PointerEventDataForView(Java.Object rootView, Java.Object view, float pointDensity)
{
var pointerEventData = new PointerEventData[PointerCount];
var locationOnScreen = GetLocationOnScreen(view) - GetLocationOnScreen(rootView);
for (var i = 0; i < pointerEventData.Length; i++)
{
var windowPoint = (locationOnScreen + GetPosition(i)) / pointDensity;
var pointerId = GetPointerId(i);
pointerEventData[i] = new PointerEventData()
{
PointIndex = pointerId,
WindowPoint = windowPoint,
Timestamp = (EventTime / 1000.0) - Time.FrameTimeBase,
PointerType = Uno.Platform.PointerType.Touch,
IsPrimary = (pointerId == 0),
};
}
return pointerEventData;
}
public override bool Equals(object obj)
{
if (obj is MotionEvent)
{
return Compare(_handle, ((MotionEvent)obj)._handle);
}
else
{
return false;
}
}
static int[] _locationOnScreen = new int[2];
float2 GetLocationOnScreen(Java.Object viewHandle)
{
GetLocationOnScreen(viewHandle, _locationOnScreen);
return float2(_locationOnScreen[0], _locationOnScreen[1]);
}
[Foreign(Language.Java)]
void GetLocationOnScreen(Java.Object viewHandle, int[] result)
@{
int[] array = new int[2];
((android.view.View)viewHandle).getLocationOnScreen(array);
result.set(0, array[0]);
result.set(1, array[1]);
@}
[Foreign(Language.Java)]
int GetAction(Java.Object handle)
@{
return ((android.view.MotionEvent)handle).getAction();
@}
[Foreign(Language.Java)]
int GetPointerId(Java.Object handle, int pointerIndex)
@{
return ((android.view.MotionEvent)handle).getPointerId(pointerIndex);
@}
[Foreign(Language.Java)]
int GetActionMasked(Java.Object handle)
@{
return ((android.view.MotionEvent)handle).getActionMasked();
@}
[Foreign(Language.Java)]
long GetEventTime(Java.Object handle)
@{
return ((android.view.MotionEvent)handle).getEventTime();
@}
[Foreign(Language.Java)]
int GetPointerCount(Java.Object handle)
@{
return ((android.view.MotionEvent)handle).getPointerCount();
@}
[Foreign(Language.Java)]
float GetX(Java.Object handle, int pointerIndex)
@{
return ((android.view.MotionEvent)handle).getX(pointerIndex);
@}
[Foreign(Language.Java)]
float GetY(Java.Object handle, int pointerIndex)
@{
return ((android.view.MotionEvent)handle).getY(pointerIndex);
@}
[Foreign(Language.Java)]
float GetXPrecision(Java.Object handle)
@{
return ((android.view.MotionEvent)handle).getXPrecision();
@}
[Foreign(Language.Java)]
float GetYPrecision(Java.Object handle)
@{
return ((android.view.MotionEvent)handle).getYPrecision();
@}
public static int PointerIndexMask
{
get { return GetPointerIndexMask(); }
}
public static int PointerIndexShift
{
get { return GetPointerIndexShift(); }
}
[Foreign(Language.Java)]
static int GetPointerIndexMask()
@{
return android.view.MotionEvent.ACTION_POINTER_INDEX_MASK;
@}
[Foreign(Language.Java)]
static int GetPointerIndexShift()
@{
return android.view.MotionEvent.ACTION_POINTER_INDEX_SHIFT;
@}
[Foreign(Language.Java)]
static bool Compare(Java.Object handle1, Java.Object handle2)
@{
return (((android.view.MotionEvent)handle1) == ((android.view.MotionEvent)handle2));
@}
}
}
| {
"pile_set_name": "Github"
} |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
'use strict'
const {app, ipcMain} = require('electron')
const sessionStore = require('./sessionStore')
const windows = require('./browser/windows')
const updateStatus = require('../js/constants/updateStatus')
const updater = require('./updater')
const appConfig = require('../js/constants/appConfig')
const async = require('async')
const messages = require('../js/constants/messages')
const settings = require('../js/constants/settings')
const appActions = require('../js/actions/appActions')
const platformUtil = require('./common/lib/platformUtil')
const Immutable = require('immutable')
const {makeImmutable} = require('./common/state/immutableUtil')
// Used to collect the per window state when shutting down the application
let immutablePerWindowState
let sessionStateStoreComplete
let sessionStateStoreCompleteCallback
let saveAppStateTimeout
let windowCloseRequestId
let shuttingDown
let immutableLastWindowClosedState
let isAllWindowsClosed
let sessionStateSaveInterval
// Stores the last window state for each requested window in case a hung window happens,
// we'll at least have the last known window state.
let immutableWindowStateCache
let sessionStoreQueue
let appStore
windows.on('new-window-state', (windowId, immutableWindowState) => {
immutableWindowStateCache = immutableWindowStateCache.set(windowId, immutableWindowState)
})
// Useful for automated tests
const reset = () => {
immutablePerWindowState = Immutable.List()
sessionStateStoreComplete = false
if (saveAppStateTimeout) {
clearTimeout(saveAppStateTimeout)
}
saveAppStateTimeout = null
windowCloseRequestId = 0
shuttingDown = false
immutableLastWindowClosedState = undefined
isAllWindowsClosed = false
sessionStateSaveInterval = null
immutableWindowStateCache = Immutable.Map()
if (sessionStateStoreCompleteCallback) {
sessionStateStoreCompleteCallback()
}
sessionStateStoreCompleteCallback = null
sessionStoreQueue = async.queue((task, callback) => {
task(callback)
}, 1)
}
reset()
const logSaveAppStateError = (e) => {
console.error('Error saving app state: ', e)
}
const saveAppState = (forceSave = false) => {
if (!sessionStateStoreCompleteCallback) {
return
}
if (!appStore) {
appStore = require('../js/stores/appStore')
}
// If we're shutting down early and can't access the state, it's better
// to not try to save anything at all and just quit.
if (shuttingDown && !appStore.getState()) {
app.exit(0)
}
let immutableAppState = appStore.getState().set('perWindowState', immutablePerWindowState)
const receivedAllWindows = immutablePerWindowState.size === windows.getAllRendererWindows().length
if (receivedAllWindows) {
clearTimeout(saveAppStateTimeout)
}
if (!forceSave && !receivedAllWindows) {
return
}
return sessionStore.saveAppState(immutableAppState, shuttingDown).catch((e) => {
logSaveAppStateError(e)
}).then(() => {
if (receivedAllWindows || forceSave) {
sessionStateStoreComplete = true
}
if (sessionStateStoreComplete) {
if (shuttingDown) {
// If the status is still UPDATE_AVAILABLE then the user wants to quit
// and not restart
if (immutableAppState.get('updates') && (immutableAppState.getIn(['updates', 'status']) === updateStatus.UPDATE_AVAILABLE ||
immutableAppState.getIn(['updates', 'status']) === updateStatus.UPDATE_AVAILABLE_DEFERRED)) {
// In this case on win32, the process doesn't try to auto restart, so avoid the user
// having to open the app twice. Maybe squirrel detects the app is already shutting down.
if (platformUtil.isWindows()) {
immutableAppState = immutableAppState.setIn(['updates', 'status'], updateStatus.UPDATE_APPLYING_RESTART)
} else {
immutableAppState = immutableAppState.setIn(['updates', 'status'], updateStatus.UPDATE_APPLYING_NO_RESTART)
}
}
// Workaround potential race condition in #14667
const quitTimeout = platformUtil.isLinux() && immutableAppState.getIn(['settings', settings.SHUTDOWN_CLEAR_HISTORY]) ? 1000 : 0
setTimeout(() => {
// If there's an update to apply, then do it here.
// Otherwise just quit.
if (immutableAppState.get('updates') && (immutableAppState.getIn(['updates', 'status']) === updateStatus.UPDATE_APPLYING_NO_RESTART ||
immutableAppState.getIn(['updates', 'status']) === updateStatus.UPDATE_APPLYING_RESTART)) {
updater.quitAndInstall()
} else {
app.quit()
}
}, quitTimeout)
} else {
const cb = sessionStateStoreCompleteCallback
sessionStateStoreCompleteCallback = null
sessionStateStoreComplete = false
cb()
}
}
})
}
/**
* Saves the session storage for all windows
*/
const initiateSessionStateSave = () => {
sessionStoreQueue.push((cb) => {
sessionStateStoreComplete = false
sessionStateStoreCompleteCallback = cb
immutablePerWindowState = Immutable.List()
// quit triggered by window-all-closed should save last window state
if (isAllWindowsClosed && immutableLastWindowClosedState) {
immutablePerWindowState = immutablePerWindowState.push(immutableLastWindowClosedState)
saveAppState(true)
} else if (windows.getAllRendererWindows().length > 0) {
++windowCloseRequestId
const windowIds = windows.getAllRendererWindows().map((win) => {
return win.id
})
windows.getAllRendererWindows().forEach((win) => {
win.webContents.send(messages.REQUEST_WINDOW_STATE, windowCloseRequestId)
})
// Just in case a window is not responsive, we don't want to wait forever.
// In this case just save session store for the windows that we have already.
saveAppStateTimeout = setTimeout(() => {
// Rewrite perwindowstate here
immutablePerWindowState = Immutable.fromJS(windowIds
.filter((windowId) => immutableWindowStateCache.get(windowId))
.map((windowId) => immutableWindowStateCache.get(windowId)))
saveAppState(true)
}, appConfig.quitTimeout)
} else {
saveAppState()
}
})
}
const removeWindowFromCache = (windowId) => {
if (shuttingDown) {
return
}
immutableWindowStateCache = immutableWindowStateCache.delete(windowId)
}
app.on('before-quit', (e) => {
if (shuttingDown && sessionStateStoreComplete) {
return
}
e.preventDefault()
// before-quit can be triggered multiple times because of the preventDefault call
if (shuttingDown) {
return
} else {
shuttingDown = true
}
appActions.shuttingDown()
if (sessionStateSaveInterval !== undefined) {
clearInterval(sessionStateSaveInterval)
}
module.exports.initiateSessionStateSave()
})
const startSessionSaveInterval = () => {
// save app state every 5 minutes regardless of update frequency
sessionStateSaveInterval = setInterval(module.exports.initiateSessionStateSave, appConfig.sessionSaveInterval)
}
// User initiated exit using File->Quit
ipcMain.on(messages.RESPONSE_WINDOW_STATE, (evt, mem) => {
const memory = mem.memory()
const data = memory.windowState
const id = memory.requestId
const immutableWindowState = makeImmutable(data)
const senderWindowId = evt.sender.getOwnerBrowserWindow().id
if (id !== windowCloseRequestId) {
return
}
if (data) {
immutablePerWindowState = immutablePerWindowState.push(immutableWindowState)
immutableWindowStateCache = immutableWindowStateCache.set(senderWindowId, immutableWindowState)
}
saveAppState()
})
ipcMain.on(messages.LAST_WINDOW_STATE, (evt, data) => {
// Remember last window (that was not buffer window, i.e. had frames).
// When the last tab of a window closes, the window is closed before the tab closes, so
// a used closing window will almost always have at least 1 frame.
if (data && data.frames && data.frames.length) {
immutableLastWindowClosedState = Immutable.fromJS(data)
}
})
process.on(messages.UNDO_CLOSED_WINDOW, () => {
if (immutableLastWindowClosedState) {
immutableLastWindowClosedState = sessionStore.cleanPerWindowData(immutableLastWindowClosedState)
appActions.newWindow(undefined, undefined, immutableLastWindowClosedState)
immutableLastWindowClosedState = undefined
}
})
app.on('window-all-closed', () => {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (!platformUtil.isDarwin()) {
isAllWindowsClosed = true
app.quit()
}
})
module.exports = {
startSessionSaveInterval,
initiateSessionStateSave,
reset,
removeWindowFromCache
}
| {
"pile_set_name": "Github"
} |
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: Osmocom GSM Core Library
Description: GSM Core Library
Version: @VERSION@
Libs: -L${libdir} -losmogsm
Cflags: -I${includedir}/
| {
"pile_set_name": "Github"
} |
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define appName "pyo"
#define pyVer "3.6"
#define appVer "0.9.1"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{C33D5687-694D-4000-AF85-191E2DC66F64}
AppName={#appName}
AppVersion={#appVer}
AppPublisher=ajaxsoundstudio.com
AppPublisherURL=https://github.com/belangeo/pyo
AppSupportURL=https://github.com/belangeo/pyo
AppUpdatesURL=https://github.com/belangeo/pyo
DefaultDirName={code:GetDirName}
DisableDirPage=no
AlwaysShowDirOnReadyPage=yes
DefaultGroupName={#appName}
AllowNoIcons=yes
InfoBeforeFile=C:\Users\olivier\git\pyo\installers\win\\README-win32-py36.txt
LicenseFile=C:\Users\olivier\git\pyo\COPYING.txt
OutputBaseFilename={#appName}_{#appVer}_py{#pyVer}_setup
Compression=lzma
SolidCompression=yes
ChangesAssociations=yes
ChangesEnvironment=yes
DirExistsWarning=no
SetupIconFile=C:\Users\olivier\git\pyo\utils\E-PyoIcon.ico
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\pyo.py"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\pyo64.py"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\pyolib\*"; DestDir: "{app}\Lib\site-packages\pyolib"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\_pyo.cp36-win32.pyd"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\_pyo64.cp36-win32.pyd"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\libsndfile-1.dll"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\liblo-7.dll"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\portaudio.dll"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\portmidi.dll"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\porttime.dll"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\pthreadVC2.dll"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\pthreadGC2.dll"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\dcomp.dll"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\gpsvc.dll"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\sysntfy.dll"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\msvcr100.dll"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\MinGW\bin\libgcc_s_dw2-1.dll"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\MinGW\bin\libstdc++-6.dll"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\pyo-{#appVer}-py{#pyVer}.egg-info"; DestDir: "{app}\Lib\site-packages"; Flags: ignoreversion
Source: "C:\Users\olivier\git\pyo\examples\*"; DestDir: "{userdesktop}\pyo_examples\"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
; E-Pyo stuff
Source: "C:\Users\olivier\git\pyo\utils\E-Pyo_py36\E-Pyo.exe"; DestDir: "{pf}\E-Pyo"; Flags: ignoreversion
Source: "C:\Users\olivier\git\pyo\utils\E-Pyo_py36\Resources\*"; DestDir: "{pf}\E-Pyo\Resources"; Flags: ignoreversion recursesubdirs createallsubdirs
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
[Icons]
Name: "{group}\E-Pyo"; Filename: "{pf}\E-Pyo\E-Pyo.exe"; WorkingDir: "{pf}\E-Pyo"
Name: "{commondesktop}\E-Pyo"; Filename: "{pf}\E-Pyo\E-Pyo.exe"; Tasks: desktopicon
[Run]
Filename: "{pf}\E-Pyo\E-Pyo.exe"; Description: "{cm:LaunchProgram,E-Pyo}"; Flags: nowait postinstall skipifsilent
[InstallDelete]
Type: filesandordirs; Name: "{userdesktop}\pyo_examples";
Type: filesandordirs; Name: "{userdocs}\.epyo";
;;;;;;;;;;;;;
[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{app};{olddata}"; Check: NeedsAddPath('{app}')
[Code]
procedure ExitProcess(exitCode:integer);
external '[email protected] stdcall';
function NeedsAddPath(Param: string): boolean;
var
OrigPath: string;
begin
if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
'Path', OrigPath)
then begin
Result := True;
exit;
end;
// look for the path with leading and trailing semicolon
// Pos() returns 0 if not found
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
end;
function GetDirName(Value: string): string;
var
InstallPath: string;
reg1 : string;
reg2 : string;
reg3 : string;
reg4 : string;
begin
reg1 := 'SOFTWARE\Python\PythonCore\' + '{#PyVer}' + '-32\InstallPath';
reg2 := 'SOFTWARE\Wow6432Node\Python\PythonCore\' + '{#PyVer}' + '-32\InstallPath';
reg3 := 'Software\Python\PythonCore\' + '{#PyVer}' + '-32\InstallPath';
reg4 := 'Software\Wow6432Node\Python\PythonCore\' + '{#PyVer}' + '-32\InstallPath';
if RegQueryStringValue(HKLM, reg1, '', InstallPath) then
BEGIN
Result := InstallPath;
END else
if RegQueryStringValue(HKCU, reg3, '', InstallPath) then
BEGIN
Result := InstallPath;
END else
if RegQueryStringValue(HKLM, reg2, '', InstallPath) then
BEGIN
Result := InstallPath;
END else
if RegQueryStringValue(HKCU, reg4, '', InstallPath) then
BEGIN
Result := InstallPath;
END else
BEGIN
Result := 'C:\Python36-32';
END
end; | {
"pile_set_name": "Github"
} |
/*
* LibrePCB - Professional EDA for everyone!
* Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
* https://librepcb.org/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBREPCB_WORKSPACE_WORKSPACESETTINGSITEM_GENERICVALUELIST_H
#define LIBREPCB_WORKSPACE_WORKSPACESETTINGSITEM_GENERICVALUELIST_H
/*******************************************************************************
* Includes
******************************************************************************/
#include "workspacesettingsitem.h"
#include <QtCore>
/*******************************************************************************
* Namespace / Forward Declarations
******************************************************************************/
namespace librepcb {
namespace workspace {
/*******************************************************************************
* Class WorkspaceSettingsItem_GenericValueList
******************************************************************************/
/**
* @brief Generic implementation of ::librepcb::workspace::WorkspaceSettingsItem
* for simple, value-in-list-type settings
*/
template <typename T>
class WorkspaceSettingsItem_GenericValueList final
: public WorkspaceSettingsItem {
public:
// Constructors / Destructor
WorkspaceSettingsItem_GenericValueList() = delete;
WorkspaceSettingsItem_GenericValueList(
const WorkspaceSettingsItem_GenericValueList& other) = delete;
explicit WorkspaceSettingsItem_GenericValueList(
const QString& listKey, const QString& itemKey, const T& defaultValue,
QObject* parent = nullptr) noexcept
: WorkspaceSettingsItem(parent),
mListKey(listKey),
mItemKey(itemKey),
mDefaultValue(defaultValue),
mCurrentValue(defaultValue) {}
~WorkspaceSettingsItem_GenericValueList() noexcept {}
/**
* @brief Get the current value
*
* @return Current value
*/
const T& get() const noexcept { return mCurrentValue; }
/**
* @brief Set the value
*
* @param value The new value
*/
void set(const T& value) noexcept {
mCurrentValue = value;
emit edited();
}
/**
* @brief Get the default value
*
* @return Default value
*/
const T& getDefault() const noexcept { return mDefaultValue; }
/**
* @copydoc ::librepcb::workspace::WorkspaceSettingsItem::restoreDefault()
*/
virtual void restoreDefault() noexcept override { set(mDefaultValue); }
/**
* @copydoc ::librepcb::workspace::WorkspaceSettingsItem::load()
*/
void load(const SExpression& root) override {
T values; // temporary object to make this method atomic
foreach (const SExpression& child,
root.getChildByPath(mListKey).getChildren(mItemKey)) {
values.append(
child.template getValueOfFirstChild<typename T::value_type>());
}
set(values);
}
/**
* @copydoc ::librepcb::workspace::WorkspaceSettingsItem::serialize()
*/
void serialize(SExpression& root) const override {
SExpression& child = root.appendList(mListKey, true);
foreach (const auto& item, mCurrentValue) {
child.appendChild(mItemKey, item, true);
}
}
// Operator Overloadings
WorkspaceSettingsItem_GenericValueList& operator=(
const WorkspaceSettingsItem_GenericValueList& rhs) = delete;
private:
QString mListKey; ///< Outer key used for serialization
QString mItemKey; ///< Inner key used for serialization
T mDefaultValue; ///< Initial, default value
T mCurrentValue; ///< Current value
};
/*******************************************************************************
* End of File
******************************************************************************/
} // namespace workspace
} // namespace librepcb
#endif // LIBREPCB_WORKSPACE_WORKSPACESETTINGSITEM_GENERICVALUELIST_H
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2" xmlns:aapt="http://schemas.android.com/aapt">
<item android:state_focused="true" android:drawable="@drawable/ayc"/>
<item android:state_pressed="true" android:drawable="@drawable/ayc"/>
<item android:state_selected="true" android:drawable="@drawable/ayc"/>
<item android:drawable="@drawable/ayb"/>
</selector>
| {
"pile_set_name": "Github"
} |
package com.mongodb.socialite.cli;
import com.mongodb.MongoClientURI;
import com.mongodb.socialite.ServiceManager;
import com.mongodb.socialite.SocialiteConfiguration;
import com.mongodb.socialite.api.Content;
import com.mongodb.socialite.api.User;
import com.mongodb.socialite.benchmark.graph.GraphGenerator;
import com.mongodb.socialite.benchmark.graph.GraphMutation;
import com.mongodb.socialite.benchmark.graph.ZipZipfGraphGenerator;
import com.mongodb.socialite.services.ContentService;
import com.mongodb.socialite.services.FeedService;
import com.mongodb.socialite.services.UserGraphService;
import com.mongodb.socialite.util.BlockingWorkQueue;
import com.yammer.dropwizard.cli.ConfiguredCommand;
import com.yammer.dropwizard.config.Bootstrap;
import net.sourceforge.argparse4j.inf.Namespace;
import net.sourceforge.argparse4j.inf.Subparser;
import java.util.List;
import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.lang.Runnable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LoadCommand extends ConfiguredCommand<SocialiteConfiguration> {
private static Logger logger = LoggerFactory.getLogger(LoadCommand.class);
public LoadCommand() {
super("load", "Loads synthetic data for testing");
}
@Override
public void configure(Subparser subparser) {
super.configure(subparser); //To change body of overridden methods use File | Settings | File Templates.
subparser.addArgument("--users").required(true).type(Integer.class);
subparser.addArgument("--maxfollows").required(true).type(Integer.class);
subparser.addArgument("--messages").required(true).type(Integer.class);
subparser.addArgument("--threads").required(true).type(Integer.class);
}
@Override
protected void run(Bootstrap<SocialiteConfiguration> configBootstrap, Namespace namespace, SocialiteConfiguration config) throws Exception {
// Get the configured default MongoDB URI
MongoClientURI default_uri = config.mongodb.default_database_uri;
// Initialize the services as per configuration
ServiceManager services = new ServiceManager(config.services, default_uri);
final UserGraphService userGraph = services.getUserGraphService();
final FeedService feedService = services.getFeedService();
final ContentService contentService = services.getContentService();
final int threads = namespace.getInt("threads");
ExecutorService executor = new ThreadPoolExecutor(threads, threads,
0L, TimeUnit.MILLISECONDS,
new BlockingWorkQueue<Runnable>(1000));
final int userCount = namespace.getInt("users");
final int maxFollows = namespace.getInt("maxfollows");
GraphGenerator graphGenerator = new ZipZipfGraphGenerator(maxFollows);
logger.info("Queuing user graph actions for {} users", userCount);
for( int i = 0; i < userCount; i++ ) {
final GraphMutation mutation = graphGenerator.next();
executor.submit( new Runnable() {
@Override
public void run() {
try{
userGraph.createUser(mutation.user);
List<User> followers = mutation.getFollowers();
for( User u : followers ) {
userGraph.follow(mutation.user, u);
}
if(logger.isDebugEnabled()){
logger.debug("Added {} followers for user {}",
followers.size(), mutation.user.getUserId());
}
} catch(Exception e){
logger.error(e.toString());
logger.debug("", e);
}
}
});
}
int messageCount = namespace.getInt("messages");
logger.info("Queuing {} messages for {} users", messageCount, userCount);
// send messageCount messages from each user
for( int j = 0; j < messageCount; j++ ) {
executor.submit( new Runnable() {
@Override
public void run() {
try{
for( int i = 0; i < userCount; i++ ) {
final User user = new User( String.valueOf(i));
final Content content = new Content( user, randomString(), null);
contentService.publishContent(user, content);
feedService.post( user, content );
}
} catch(Exception e){
logger.error(e.toString());
logger.debug("", e);
}
}
});
}
executor.shutdown();
logger.info("All actions queued, waiting for completion...");
executor.awaitTermination(Long.MAX_VALUE,TimeUnit.SECONDS);
logger.info("Done.");
services.stop();
}
private static final char[] chars = "abcdefghijklmnopqrstuvwxyz".toCharArray();
private Random random = new Random();
protected String randomString() {
int length = Math.abs(10 + random.nextInt(130));
StringBuilder sb = new StringBuilder();
for( int i = 0; i < length; i++ ) {
char c = chars[random.nextInt(chars.length)];
sb.append(c);
}
return sb.toString();
}
} | {
"pile_set_name": "Github"
} |
/*
* Copyright © 2016 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/*
* Please use intel_vbt_defs.h for VBT private data, to hide and abstract away
* the VBT from the rest of the driver. Add the parsed, clean data to struct
* intel_vbt_data within struct drm_i915_private.
*/
#ifndef _INTEL_BIOS_H_
#define _INTEL_BIOS_H_
enum intel_backlight_type {
INTEL_BACKLIGHT_PMIC,
INTEL_BACKLIGHT_LPSS,
INTEL_BACKLIGHT_DISPLAY_DDI,
INTEL_BACKLIGHT_DSI_DCS,
INTEL_BACKLIGHT_PANEL_DRIVER_INTERFACE,
};
struct edp_power_seq {
u16 t1_t3;
u16 t8;
u16 t9;
u16 t10;
u16 t11_t12;
} __packed;
/*
* MIPI Sequence Block definitions
*
* Note the VBT spec has AssertReset / DeassertReset swapped from their
* usual naming, we use the proper names here to avoid confusion when
* reading the code.
*/
enum mipi_seq {
MIPI_SEQ_END = 0,
MIPI_SEQ_DEASSERT_RESET, /* Spec says MipiAssertResetPin */
MIPI_SEQ_INIT_OTP,
MIPI_SEQ_DISPLAY_ON,
MIPI_SEQ_DISPLAY_OFF,
MIPI_SEQ_ASSERT_RESET, /* Spec says MipiDeassertResetPin */
MIPI_SEQ_BACKLIGHT_ON, /* sequence block v2+ */
MIPI_SEQ_BACKLIGHT_OFF, /* sequence block v2+ */
MIPI_SEQ_TEAR_ON, /* sequence block v2+ */
MIPI_SEQ_TEAR_OFF, /* sequence block v3+ */
MIPI_SEQ_POWER_ON, /* sequence block v3+ */
MIPI_SEQ_POWER_OFF, /* sequence block v3+ */
MIPI_SEQ_MAX
};
enum mipi_seq_element {
MIPI_SEQ_ELEM_END = 0,
MIPI_SEQ_ELEM_SEND_PKT,
MIPI_SEQ_ELEM_DELAY,
MIPI_SEQ_ELEM_GPIO,
MIPI_SEQ_ELEM_I2C, /* sequence block v2+ */
MIPI_SEQ_ELEM_SPI, /* sequence block v3+ */
MIPI_SEQ_ELEM_PMIC, /* sequence block v3+ */
MIPI_SEQ_ELEM_MAX
};
#define MIPI_DSI_UNDEFINED_PANEL_ID 0
#define MIPI_DSI_GENERIC_PANEL_ID 1
struct mipi_config {
u16 panel_id;
/* General Params */
u32 enable_dithering:1;
u32 rsvd1:1;
u32 is_bridge:1;
u32 panel_arch_type:2;
u32 is_cmd_mode:1;
#define NON_BURST_SYNC_PULSE 0x1
#define NON_BURST_SYNC_EVENTS 0x2
#define BURST_MODE 0x3
u32 video_transfer_mode:2;
u32 cabc_supported:1;
#define PPS_BLC_PMIC 0
#define PPS_BLC_SOC 1
u32 pwm_blc:1;
/* Bit 13:10 */
#define PIXEL_FORMAT_RGB565 0x1
#define PIXEL_FORMAT_RGB666 0x2
#define PIXEL_FORMAT_RGB666_LOOSELY_PACKED 0x3
#define PIXEL_FORMAT_RGB888 0x4
u32 videomode_color_format:4;
/* Bit 15:14 */
#define ENABLE_ROTATION_0 0x0
#define ENABLE_ROTATION_90 0x1
#define ENABLE_ROTATION_180 0x2
#define ENABLE_ROTATION_270 0x3
u32 rotation:2;
u32 bta_enabled:1;
u32 rsvd2:15;
/* 2 byte Port Description */
#define DUAL_LINK_NOT_SUPPORTED 0
#define DUAL_LINK_FRONT_BACK 1
#define DUAL_LINK_PIXEL_ALT 2
u16 dual_link:2;
u16 lane_cnt:2;
u16 pixel_overlap:3;
u16 rgb_flip:1;
#define DL_DCS_PORT_A 0x00
#define DL_DCS_PORT_C 0x01
#define DL_DCS_PORT_A_AND_C 0x02
u16 dl_dcs_cabc_ports:2;
u16 dl_dcs_backlight_ports:2;
u16 rsvd3:4;
u16 rsvd4;
u8 rsvd5;
u32 target_burst_mode_freq;
u32 dsi_ddr_clk;
u32 bridge_ref_clk;
#define BYTE_CLK_SEL_20MHZ 0
#define BYTE_CLK_SEL_10MHZ 1
#define BYTE_CLK_SEL_5MHZ 2
u8 byte_clk_sel:2;
u8 rsvd6:6;
/* DPHY Flags */
u16 dphy_param_valid:1;
u16 eot_pkt_disabled:1;
u16 enable_clk_stop:1;
u16 rsvd7:13;
u32 hs_tx_timeout;
u32 lp_rx_timeout;
u32 turn_around_timeout;
u32 device_reset_timer;
u32 master_init_timer;
u32 dbi_bw_timer;
u32 lp_byte_clk_val;
/* 4 byte Dphy Params */
u32 prepare_cnt:6;
u32 rsvd8:2;
u32 clk_zero_cnt:8;
u32 trail_cnt:5;
u32 rsvd9:3;
u32 exit_zero_cnt:6;
u32 rsvd10:2;
u32 clk_lane_switch_cnt;
u32 hl_switch_cnt;
u32 rsvd11[6];
/* timings based on dphy spec */
u8 tclk_miss;
u8 tclk_post;
u8 rsvd12;
u8 tclk_pre;
u8 tclk_prepare;
u8 tclk_settle;
u8 tclk_term_enable;
u8 tclk_trail;
u16 tclk_prepare_clkzero;
u8 rsvd13;
u8 td_term_enable;
u8 teot;
u8 ths_exit;
u8 ths_prepare;
u16 ths_prepare_hszero;
u8 rsvd14;
u8 ths_settle;
u8 ths_skip;
u8 ths_trail;
u8 tinit;
u8 tlpx;
u8 rsvd15[3];
/* GPIOs */
u8 panel_enable;
u8 bl_enable;
u8 pwm_enable;
u8 reset_r_n;
u8 pwr_down_r;
u8 stdby_r_n;
} __packed;
/* all delays have a unit of 100us */
struct mipi_pps_data {
u16 panel_on_delay;
u16 bl_enable_delay;
u16 bl_disable_delay;
u16 panel_off_delay;
u16 panel_power_cycle_delay;
} __packed;
#endif /* _INTEL_BIOS_H_ */
| {
"pile_set_name": "Github"
} |
import { blobDisplayPath } from '../../../helpers/blob-display-path';
import { module, test } from 'qunit';
module('Unit | Helper | blob display path');
// Replace this with your real tests.
test('it works', function (assert) {
var result = blobDisplayPath(['mydir/myblob.png', 'mydir/']);
assert.ok(result === 'myblob.png');
});
| {
"pile_set_name": "Github"
} |
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* https://opensso.dev.java.net/public/CDDLv1.0.html or
* opensso/legal/CDDLv1.0.txt
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: FedletConfigurationImpl.java,v 1.5 2010/01/26 21:31:59 madan_ranganath Exp $
*
*/
package com.sun.identity.plugin.configuration.impl;
import com.sun.identity.shared.debug.Debug;
import com.sun.identity.plugin.configuration.ConfigurationException;
import com.sun.identity.plugin.configuration.ConfigurationInstance;
import com.sun.identity.plugin.configuration.ConfigurationListener;
import com.sun.identity.saml2.common.SAML2Constants;
import com.sun.identity.saml2.jaxb.metadata.EntityDescriptorElement;
import com.sun.identity.saml2.meta.SAML2MetaConstants;
import com.sun.identity.saml2.meta.SAML2MetaSecurityUtils;
import com.sun.identity.saml2.meta.SAML2MetaUtils;
import com.sun.identity.shared.xml.XMLUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Properties;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import javax.xml.bind.JAXBException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
* The <code>FedletConfigurationImpl</code> class is the implementation for
* Fedlet to retrieve metadata/COT configuration from flat files.
*/
public class FedletConfigurationImpl implements ConfigurationInstance {
// Name of attribute in COT file to contains the COT name
private static final String COT_NAME = "cot-name";
// Suffix for extended metadata file name.
private static final String EXTENDED_XML_SUFFIX = "-extended.xml";
// Suffix for COT file name.
private static final String COT_FILE_SUFFIX = ".cot";
// fedlet home directory which contains metadata/COT/configuration files
private static String fedletHomeDir;
// property name to point to the fedlet home
// if not defined, default to "$user_home/fedlet"
private static final String FEDLET_HOME_DIR =
"com.sun.identity.fedlet.home";
private String componentName = null;
private static final String RESOURCE_BUNDLE = "fmConfigurationService";
static Debug debug = Debug.getInstance("libPlugins");;
// Map to store COT information
private static Map cotMap = new HashMap();
// Map to store metadata information
private static Map entityMap = new HashMap();
/**
* Initializer.
* @param componentName Name of the components, e.g. SAML1, SAML2, ID-FF
* @param session FM Session object.
* @exception ConfigurationException if could not initialize the instance.
*/
public void init(String componentName, Object session)
throws ConfigurationException {
if (debug.messageEnabled()) {
debug.message("FedletConfigurationImpl.init: component=" +
componentName);
}
this.componentName = componentName;
fedletHomeDir = System.getProperty(FEDLET_HOME_DIR);
if ((fedletHomeDir == null) || (fedletHomeDir.trim().length() == 0)) {
fedletHomeDir = System.getProperty("user.home") +
File.separator + "fedlet";
}
if (debug.messageEnabled()) {
debug.message("FedletConfigurationImpl.init: fedlet home=" +
fedletHomeDir);
}
// initialize SAML2 metadata and COT from fedlet home directory
initializeMetadataAndCOT();
if (debug.messageEnabled()) {
debug.message("FedletConfImpl entityMap: =" + entityMap.keySet());
debug.message("FedletConfImpl cotMap: =" + cotMap.keySet());
}
}
/**
* Returns Configurations.
* @param realm the name of organization at which the configuration resides.
* @param configName configuration instance name. e.g. "/sp".
* The configName could be null or empty string, which means the default
* configuration for this components.
* @return Map of key/value pairs, key is the attribute name, value is
* a Set of attribute values or null if service configuration doesn't
* doesn't exist.
* @exception ConfigurationException if an error occurred while getting
* service configuration.
*/
public Map getConfiguration(String realm, String configName)
throws ConfigurationException {
if (debug.messageEnabled()) {
debug.message("FedletConfigurationImpl.getConfiguration: " +
"componentName = " + componentName + ", realm = " + realm +
", configName = " + configName);
}
// only need to support SAML2/LIBCOT for now
if ("SAML2".equals(componentName)) {
return (Map) entityMap.get(configName);
} else if ("LIBCOT".equals(componentName)) {
return (Map) cotMap.get(configName);
} else {
return null;
}
}
/**
* Initializes SAMLv2 metadata and COT from flat files under Fedlet
* home directory.
* The metadata information will be stored in a Map, key is the entity ID,
* value is a Map whose key is the standard/extended attribute name,
* value is a String containing the standard/extended metadata XML.
* Standard metadata is stored in a file named <fileName>.xml
* Extended metadata is stored in a file named <fileName>-extended.xml
*
* The COT information will be stored in a Map, key is the COT name,
* value is a Map whose key is the attribute name, value is a Set of
* values for the attribute.
* COT is stored in a file named <filename>.cot
*
*/
private void initializeMetadataAndCOT() {
try {
// read all SAML2 metadata/COT files from fedlet home directory
File homeDir = new File(fedletHomeDir);
String[] files = homeDir.list();
if ((files == null) || (files.length == 0)) {
return;
}
for (int i = 0; i < files.length; i++) {
String fileName = files[i];
if (debug.messageEnabled()) {
debug.message("FedletConfigImpl.initMetaCOT: " + fileName);
}
if (fileName.endsWith(EXTENDED_XML_SUFFIX)) {
// processing metadata entry
handleSAML2Metadata(fileName.substring(0,
fileName.length() - EXTENDED_XML_SUFFIX.length()));
} else if (fileName.endsWith(COT_FILE_SUFFIX)) {
handleCOT(fileName.substring(0,
fileName.length() - COT_FILE_SUFFIX.length()));
} else {
continue;
}
}
} catch (NullPointerException npe) {
debug.error("FedletConfigurationImpl.processSAML2Metadata()", npe);
} catch (SecurityException se) {
debug.error("FedletConfigurationImpl.processSAML2Metadata()", se);
}
}
/**
* Gets SAML2 metadata from flat files and stores in entityMap.
*/
private void handleSAML2Metadata(String fileName) {
// get standard metadata
String metaFile = fedletHomeDir + File.separator + fileName + ".xml";
if (debug.messageEnabled()) {
debug.message("FedletConfigurationImpl.handleSAML2Metadata: " +
"metaFile=" + metaFile);
}
String metaXML = openFile(metaFile);
if (metaXML == null) {
return;
}
metaXML = workaroundAbstractRoleDescriptor(metaXML);
String entityId = getEntityID(metaXML);
if (entityId == null) {
return;
}
Map map = new HashMap();
Set set = new HashSet();
set.add(metaXML);
map.put("sun-fm-saml2-metadata", set);
// get extended metadata files
String extFile = fedletHomeDir + File.separator + fileName
+ EXTENDED_XML_SUFFIX;
String extXML = openFile(extFile);
if (extXML == null) {
return;
}
set = new HashSet();
set.add(extXML);
map.put("sun-fm-saml2-entityconfig", set);
// add to entity Map
entityMap.put(entityId, map);
if (debug.messageEnabled()) {
debug.message("FedletConfigurationImpl.handleSAML2Metadata: " +
"done processing entity " + entityId);
}
}
private String workaroundAbstractRoleDescriptor(String metaXML) {
Document doc = XMLUtils.toDOMDocument(metaXML, debug);
if (doc != null) {
NodeList nl = doc.getDocumentElement().getElementsByTagNameNS(
SAML2MetaConstants.NS_METADATA,
SAML2MetaConstants.ROLE_DESCRIPTOR);
int length = nl.getLength();
for (int i = 0; i < length; i++) {
Element child = (Element)nl.item(i);
String type = child.getAttributeNS(SAML2Constants.NS_XSI,
"type");
if ((type != null) && (type.equals(
SAML2MetaConstants.ATTRIBUTE_QUERY_DESCRIPTOR_TYPE)) ||
(type.endsWith(":" +
SAML2MetaConstants.ATTRIBUTE_QUERY_DESCRIPTOR_TYPE))) {
metaXML = metaXML.replaceAll(
SAML2Constants.XSI_DECLARE_STR,
"");
metaXML = metaXML.replaceAll(
"xsi:type=\"query:AttributeQueryDescriptorType\"",
"");
metaXML = metaXML.replaceAll("<" +
SAML2MetaConstants.ROLE_DESCRIPTOR,
"<" + SAML2MetaSecurityUtils.PREFIX_MD_QUERY
+ ":" +
SAML2MetaConstants.ATTRIBUTE_QUERY_DESCRIPTOR);
metaXML = metaXML.replaceAll("</" +
SAML2MetaConstants.ROLE_DESCRIPTOR,
"</" +
SAML2MetaSecurityUtils.PREFIX_MD_QUERY
+ ":" +
SAML2MetaConstants.ATTRIBUTE_QUERY_DESCRIPTOR);
}
}
}
return metaXML;
}
private String getEntityID(String metaXML) {
try {
Object obj = SAML2MetaUtils.convertStringToJAXB(metaXML);
if (obj instanceof EntityDescriptorElement) {
return ((EntityDescriptorElement) obj).getEntityID();
}
} catch (JAXBException jaxbe) {
debug.error("FedletConfigImpl.getEntityID: " + metaXML, jaxbe);
}
return null;
}
/**
* Gets COT information from flat file and stores in cotMap.
* The COT is stored in a flat file named "<fileName>.cot" which contains
* list of properties, format like this :
* <attribute_name>=<value1>,<value2>,<value3>,...
* for example:
* cot-name=sample
* sun-fm-cot-status=Active
* sun-fm-trusted-providers=idp,sp
* Note : Value which contains "%" and "," need to be escaped to
* "%25" and "%2c" before saving to the file.
*/
private void handleCOT(String fileName) {
String cotFile = fedletHomeDir + File.separator + fileName
+ COT_FILE_SUFFIX;
if (debug.messageEnabled()) {
debug.message("FedletConfigurationImpl.handleCOT: " +
"cotFile=" + cotFile);
}
FileInputStream fis = null;
try {
fis = new FileInputStream(cotFile);
Properties props = new Properties();
props.load(fis);
// convert each value string to a Set.
Map attrMap = new HashMap();
if (props != null) {
Enumeration keys = props.propertyNames();
while (keys.hasMoreElements()) {
String key = (String)keys.nextElement();
String vals = props.getProperty(key);
if ((vals != null) && (vals.length() > 0)) {
attrMap.put(key, toValSet(key, vals));
}
}
}
Set cotName = (Set) attrMap.get(COT_NAME);
if (cotName == null) {
debug.error("FedletConfigImpl.handleCOT: null COT name in "
+ cotFile);
} else {
cotMap.put((String) cotName.iterator().next(), attrMap);
if (debug.messageEnabled()) {
debug.message("FedletConfigurationImpl.handleCOT: " +
"done processing cot " + cotName);
}
}
} catch (FileNotFoundException fnf) {
debug.error("FedletConfigurationImpl.handleCOT: " + cotFile
+ " for component " + componentName, fnf);
} catch (IOException ioe) {
debug.error("FedletConfigurationImpl.getConfiguration:" + cotFile
+ " for component " + componentName, ioe);
} finally {
if (fis != null) {
try {
fis.close();
} catch (IOException ioe) {
}
}
}
}
/**
* Converts a string of values from the attributes properties file
* to a Set, decoding special characters in each value.
*/
protected Set toValSet(String attrName, String vals) {
Set valset = new HashSet();
char[] valchars = vals.toCharArray();
int i, j;
for (i = 0, j = 0; j < valchars.length; j++) {
char c = valchars[j];
if (c == ',') {
if (i == j) {
i = j +1;
} else { // separator found
String val = new String(valchars, i, j-i).trim();
if (val.length() > 0) {
val = decodeVal(val);
}
valset.add(val);
i = j +1;
}
}
}
if (j == valchars.length && i < j) {
String val = new String(valchars, i, j-i).trim();
if (val.length() > 0) {
val = decodeVal(val);
}
valset.add(val);
}
return valset;
}
/**
* Decodes a value, %2C to comma and %25 to percent.
*/
protected String decodeVal(String v) {
char[] chars = v.toCharArray();
StringBuffer sb = new StringBuffer(chars.length);
int i = 0, lastIdx = 0;
for (i = 0; i < chars.length; i++) {
if (chars[i] == '%' && i+2 < chars.length && chars[i+1] == '2') {
if (lastIdx != i) {
sb.append(chars, lastIdx, i-lastIdx);
}
if (chars[i+2] == 'C') {
sb.append(',');
}
else if (chars[i+2] == '5') {
sb.append('%');
}
else {
sb.append(chars, i, 3);
}
i += 2;
lastIdx = i+1;
}
}
if (lastIdx != i) {
sb.append(chars, lastIdx, i-lastIdx);
}
return sb.toString();
}
/**
* Returns the content of a file as String.
* Returns null if error occurs.
*/
private String openFile(String file) {
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader(file));
StringBuffer sb = new StringBuffer(5000);
String temp;
while ((temp = br.readLine()) != null) {
sb.append(temp);
}
return sb.toString();
} catch (FileNotFoundException fnf) {
debug.error("FedletConfigurationImpl.getConfiguration: " + file
+ " for component " + componentName, fnf);
return null;
} catch (IOException ioe) {
debug.error("FedletConfigurationImpl.getConfiguration:" + file
+ " for component " + componentName, ioe);
return null;
} finally {
if (br != null) {
try {
br.close();
} catch (IOException ioe) {
}
}
}
}
/**
* Sets Configurations.
* @param realm the name of organization at which the configuration resides.
* @param configName configuration instance name. e.g. "/sp"
* The configName could be null or empty string, which means the default
* configuration for this components.
* @param avPairs Map of key/value pairs to be set in the service
* configuration, key is the attribute name, value is
* a Set of attribute values.
* @exception ConfigurationException if could not set service configuration
* or service configuration doesn't exist.
*/
public void setConfiguration(String realm,
String configName, Map avPairs)
throws ConfigurationException {
if (debug.messageEnabled()) {
debug.message("FedletConfigurationImpl.setConfiguration: " +
"componentName = " + componentName + ", realm = " + realm +
", configName = " + configName + ", avPairs = " + avPairs);
}
String[] data = { componentName, realm };
throw new ConfigurationException(RESOURCE_BUNDLE,
"failedSetConfig", data);
}
/**
* Creates Configurations.
* @param realm the name of organization at which the configuration resides.
* @param configName service configuration name. e.g. "/sp"
* The configName could be null or empty string, which means the
* default configuration for this components.
* @param avPairs Map of key/value pairs to be set in the service
* configuration, key is the attribute name, value is
* a Set of attribute values.
* @exception ConfigurationException if could not create service
* configuration.
*/
public void createConfiguration(String realm, String configName,
Map avPairs)
throws ConfigurationException {
if (debug.messageEnabled()) {
debug.message("FedletConfigurationImpl.createConfiguration: " +
"componentName = " + componentName + ", realm = " + realm +
", configName = " + configName + ", avPairs = " + avPairs);
}
String[] data = { componentName, realm };
throw new ConfigurationException(RESOURCE_BUNDLE,
"failedCreateConfig", data);
}
/**
* Deletes Configuration.
* @param realm the name of organization at which the configuration resides.
* @param configName service configuration name. e.g. "/sp"
* The configName could be null or empty string, which means the default
* configuration for this components.
* @param attributes A set of attributes to be deleted from the Service
* configuration. If the value is null or empty, deletes all service
* configuration.
* @exception ConfigurationException if could not delete service
* configuration.
*/
public void deleteConfiguration(String realm,
String configName, Set attributes)
throws ConfigurationException {
if (debug.messageEnabled()) {
debug.message("FedletConfigurationImpl.deleteConfiguration: " +
"componentName = " + componentName + ", realm = " + realm +
", configName = " + configName + ", attributes = " +
attributes);
}
String[] data = { componentName, realm };
throw new ConfigurationException(RESOURCE_BUNDLE,
"failedDeleteConfig", data);
}
/**
* Returns all service config name for this components.
* @param realm the name of organization at which the configuration resides.
* @return Set of service configuration names. Return null if there
* is no service configuration for this component, return empty set
* if there is only default configuration instance.
* @exception ConfigurationException if could not get all service
* configuration names.
*/
public Set getAllConfigurationNames(String realm)
throws ConfigurationException {
if (debug.messageEnabled()) {
debug.message("FedletConfigurationImpl.getAllConfigurationNames"+
": realm = " + realm + ", componentName = " + componentName);
}
if ("SAML2".equals(componentName)) {
return entityMap.keySet();
} else if ("LIBCOT".equals(componentName)) {
return cotMap.keySet();
} else {
return Collections.EMPTY_SET;
}
}
/**
* Registers for changes to the component's configuration. The object will
* be called when configuration for this component is changed.
* @return the registered id for this listener instance.
* @exception ConfigurationException if could not register the listener.
*/
public String addListener(ConfigurationListener listener)
throws ConfigurationException {
return "NO_OP";
}
/**
* Unregisters the listener from the component for the given
* listener ID. The ID was issued when the listener was registered.
* @param listenerID the returned id when the listener was registered.
* @exception ConfigurationException if could not register the listener.
*/
public void removeListener(String listenerID)
throws ConfigurationException {
}
}
| {
"pile_set_name": "Github"
} |
using System.Collections.Generic;
using NUnit.Framework;
using ProtoCore.DSASM;
using ProtoCore.Lang.Replication;
using ProtoFFI;
using ProtoScript.Runners;
namespace ProtoTest.Associative
{
class ReplicatorTest : ProtoTestBase
{
DebugRunner fsr;
public override void Setup()
{
// Specify some of the requirements of IDE.
base.Setup();
fsr = new DebugRunner(core);
DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
CLRModuleType.ClearTypes();
}
[Test]
public void ComputeReducedParams()
{
// Tracked by http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4115
string code =
@"
a = [1,2];
b = [3,4];
";
//Run
fsr.PreStart(code);
DebugRunner.VMState vms = null;
vms = fsr.Run();
var mirror = vms.mirror;
List<StackValue> args = new List<StackValue>();
args.Add(mirror.GetRawFirstValue("a"));
args.Add(mirror.GetRawFirstValue("b"));
List<ReplicationInstruction> ris = new List<ReplicationInstruction>();
ris.Add(
new ReplicationInstruction()
{
ZipIndecies = new List<int> { 0, 1 },
Zipped = true
}
);
runtimeCore = fsr.runtimeCore;
List<List<StackValue>> combin = ProtoCore.Lang.Replication.Replicator.ComputeAllReducedParams(args, ris, runtimeCore);
Assert.IsTrue(combin[0][0].IntegerValue == 1);
Assert.IsTrue(combin[0][1].IntegerValue == 3);
}
}
}
| {
"pile_set_name": "Github"
} |
#include "Python.h"
#include "python_bindings.hpp"
/* Module methods */
PyMethodDef module_methods[] = {
{"ROPium", (PyCFunction)ropium_ROPium, METH_VARARGS, "Create a new ROPium instance"},
{NULL}
};
/* Module information */
PyModuleDef ropium_module_def = {
PyModuleDef_HEAD_INIT,
"ropium",
nullptr,
-1, // m_size
module_methods, // m_methods
nullptr, // m_slots
nullptr, // m_traverse
nullptr, // m_clear
nullptr // m_free
};
PyMODINIT_FUNC PyInit_ropium(){
Py_Initialize();
PyObject* module = PyModule_Create(&ropium_module_def);
init_arch(module);
init_ropchain(module);
return module;
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2013, Peter Thorson. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the WebSocket++ Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL PETER THORSON BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
//#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE transport_asio_timers
#include <boost/test/unit_test.hpp>
#include <exception>
#include <iostream>
#include <websocketpp/common/thread.hpp>
#include <websocketpp/transport/asio/endpoint.hpp>
#include <websocketpp/transport/asio/security/tls.hpp>
// Concurrency
#include <websocketpp/concurrency/none.hpp>
// HTTP
#include <websocketpp/http/request.hpp>
#include <websocketpp/http/response.hpp>
// Loggers
#include <websocketpp/logger/stub.hpp>
//#include <websocketpp/logger/basic.hpp>
#include <boost/asio.hpp>
// Accept a connection, read data, and discard until EOF
void run_dummy_server(int port) {
using boost::asio::ip::tcp;
try {
boost::asio::io_service io_service;
tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v6(), port));
tcp::socket socket(io_service);
acceptor.accept(socket);
for (;;) {
char data[512];
boost::system::error_code ec;
socket.read_some(boost::asio::buffer(data), ec);
if (ec == boost::asio::error::eof) {
break;
} else if (ec) {
// other error
throw ec;
}
}
} catch (std::exception & e) {
std::cout << e.what() << std::endl;
} catch (boost::system::error_code & ec) {
std::cout << ec.message() << std::endl;
}
}
// Wait for the specified time period then fail the test
void run_test_timer(long value) {
boost::asio::io_service ios;
boost::asio::deadline_timer t(ios,boost::posix_time::milliseconds(value));
boost::system::error_code ec;
t.wait(ec);
BOOST_FAIL( "Test timed out" );
}
struct config {
typedef websocketpp::concurrency::none concurrency_type;
//typedef websocketpp::log::basic<concurrency_type,websocketpp::log::alevel> alog_type;
typedef websocketpp::log::stub alog_type;
typedef websocketpp::log::stub elog_type;
typedef websocketpp::http::parser::request request_type;
typedef websocketpp::http::parser::response response_type;
typedef websocketpp::transport::asio::tls_socket::endpoint socket_type;
static const long timeout_socket_pre_init = 1000;
static const long timeout_proxy = 1000;
static const long timeout_socket_post_init = 1000;
static const long timeout_dns_resolve = 1000;
static const long timeout_connect = 1000;
static const long timeout_socket_shutdown = 1000;
};
// Mock context that does no validation
typedef websocketpp::lib::shared_ptr<boost::asio::ssl::context> context_ptr;
context_ptr on_tls_init(websocketpp::connection_hdl hdl) {
return context_ptr(new boost::asio::ssl::context(boost::asio::ssl::context::tlsv1));
}
// Mock connection
struct mock_con: public websocketpp::transport::asio::connection<config> {
typedef websocketpp::transport::asio::connection<config> base;
mock_con(bool a, config::alog_type& b, config::elog_type& c) : base(a,b,c) {}
void start() {
base::init(websocketpp::lib::bind(&mock_con::handle_start,this,
websocketpp::lib::placeholders::_1));
}
void handle_start(const websocketpp::lib::error_code& ec) {
using websocketpp::transport::asio::socket::make_error_code;
using websocketpp::transport::asio::socket::error::tls_handshake_timeout;
BOOST_CHECK_EQUAL( ec, make_error_code(tls_handshake_timeout) );
base::cancel_socket();
}
};
typedef websocketpp::transport::asio::connection<config> con_type;
typedef websocketpp::lib::shared_ptr<mock_con> connection_ptr;
struct mock_endpoint : public websocketpp::transport::asio::endpoint<config> {
typedef websocketpp::transport::asio::endpoint<config> base;
mock_endpoint() {
alog.set_channels(websocketpp::log::alevel::all);
base::init_logging(&alog,&elog);
init_asio();
}
void connect(std::string u) {
m_con.reset(new mock_con(false,alog,elog));
websocketpp::uri_ptr uri(new websocketpp::uri(u));
BOOST_CHECK( uri->get_valid() );
BOOST_CHECK_EQUAL( base::init(m_con), websocketpp::lib::error_code() );
base::async_connect(
m_con,
uri,
websocketpp::lib::bind(
&mock_endpoint::handle_connect,
this,
m_con,
websocketpp::lib::placeholders::_1,
websocketpp::lib::placeholders::_2
)
);
}
void handle_connect(connection_ptr con, websocketpp::connection_hdl,
const websocketpp::lib::error_code & ec)
{
BOOST_CHECK( !ec );
con->start();
}
connection_ptr m_con;
config::alog_type alog;
config::elog_type elog;
};
BOOST_AUTO_TEST_CASE( tls_handshake_timeout ) {
websocketpp::lib::thread dummy_server(websocketpp::lib::bind(&run_dummy_server,9005));
websocketpp::lib::thread timer(websocketpp::lib::bind(&run_test_timer,5000));
dummy_server.detach();
timer.detach();
mock_endpoint endpoint;
endpoint.set_tls_init_handler(&on_tls_init);
endpoint.connect("wss://localhost:9005");
endpoint.run();
}
| {
"pile_set_name": "Github"
} |
---
title: Metabase
linkTitle: Metabase
description: Metabase
block_indexing: true
menu:
v1.3:
identifier: metabase
parent: ecosystem-integrations
weight: 576
isTocNested: true
showAsideToc: true
---
[Metabase](https://www.metabase.com/) is an extremly easy-to-use Business Intelligence (BI) tool. It bills itself as `the easy, open source way for everyone in your company to ask questions and learn from data`. This page shows how Metabase can be setup to integrate with YugabyteDB's PostgreSQL compatible API.
## 1. Start local cluster with YSQL API enabled
Follow [Quick Start](../../../quick-start/) instructions to run a local YugabyteDB cluster. Test YugabyteDB's PostgreSQL compatible YSQL API as [documented](../../../quick-start/test-postgresql/) so that you can confirm that you have a PostgresSQL compatible service running on `localhost:5433`.
## 2. Load data
### Download the sample schema
```sh
$ wget https://raw.githubusercontent.com/yugabyte/yb-sql-workshop/master/query-using-bi-tools/schema.sql
```
### Download the sample data
```sh
$ wget https://github.com/yugabyte/yb-sql-workshop/raw/master/query-using-bi-tools/sample-data.tgz
```
```sh
$ tar zxvf sample-data.tgz
```
```sh
$ ls data/
```
```
orders.sql products.sql reviews.sql users.sql
```
### Connect to YugabyteDB using ysqlsh
You can do this as shown below.
```sh
$ ./bin/ysqlsh
```
```
ysqlsh (11.2)
Type "help" for help.
postgres=#
```
### Create a database
```sql
postgres=> CREATE DATABASE yb_demo;
```
```sql
postgres=> GRANT ALL ON DATABASE yb_demo to postgres;
```
```sql
postgres=> \c yb_demo;
```
### Create schema and load data
First create the 4 tables necessary to store the data.
```sql
postgres=> \i 'schema.sql';
```
Now load the data into the tables.
```sql
postgres=> \i 'data/products.sql'
```
```sql
postgres=> \i 'data/users.sql'
```
```sql
postgres=> \i 'data/orders.sql'
```
```sql
postgres=> \i 'data/reviews.sql'
```
## 3. Download and configure Metabase
Detailed steps for setting up Metabase are available [here](https://www.metabase.com/docs/latest/setting-up-metabase.html). The following are the minimal setup steps for getting started.
```sh
$ wget http://downloads.metabase.com/v0.30.4/metabase.jar
```
```sh
$ java -jar metabase.jar
```
Go to http://localhost:3000 to configure your Metabase server and point it to the YSQL API endpoint at `localhost:5433`.
## 4. Run complex queries with Metabase
Detailed steps on how to use Metabase are available [here](https://www.metabase.com/docs/latest/getting-started.html). For this doc, we will specifically focus on asking questions that require RDBMS capabilities.
- Filter data using WHERE clauses
- Join data between tables
- Perform data aggregation using GROUP BY
- Use built-in functions such as SUM, MIN, MAX, etc.
You can click on Ask a Question -> Custom Query. Choose the database we just setup, and enter the SQL queries noted in the [Retail Analytics](../../realworld-apps/retail-analytics/) section.
| {
"pile_set_name": "Github"
} |
... floating around again ...
... originated in rec.humor.funny - January 1993 ...
... Ian Horswill ([email protected]) ...
Unix was a program gone bad. Born into poverty, its parents, the phone company, couldn't afford more than a roll of teletype paper a year, so Unix never had decent documentation and its source files had to go without any [[comments]] whatsoever. Year after year, Papa Bell would humiliate itself asking for rate increases so that it could feed its [[child]]. Still, Unix had to go to [[school]] with only two and three letter command names because the phone company just couldn't afford any better. At school, the other operating systems with real command names, and even command completion, would taunt poor little Unix for not having any job or terminal management facilities or for having to use its file system for interprocess communication and locking.
Then, bitter and emasculated by its poverty, the phone company began to drink. During lost weekends of drunken excess, it would brutally beat poor little Unix about the face and neck. Eventually, Unix ran away from home. Soon it was living on the streets of Berkeley. There, Unix got involved with a bad crowd. Its life became a degrading journey of drugs and debauchery. To keep itself alive, it sold cheap source licenses for itself to universities which used it for medical experiments. Being wantonly hacked by an endless stream of nameless, faceless undergraduates, both [[men]] and [[women]], often by more than one at the same time, Unix fell into a hell-hole of depravity.
And so it was that poor little Unix began to go [[insane]]. It retreated steadily into a dreamworld, the only place where it felt safe. It took heroin and dreamed of being a real operating system.
It took LSD and dreamed of being a raspberry flavored three-toed yak.
It liked that better. As Unix became increasingly attracted to LSD, it would spend weekends reading Hunter Thompson and taking cocktails of [[acid]] and speed while writing crazed poetry in which it found deep meaning but which no one else could understand:
<pre>
$sed <$mf >$mf.new -e '1,/^# AUTOMATICALLY/!d'
make shlist || ($echo "Searching for .SH files..."; \
$echo *.SH | $tr ' ' '\012' | $egrep -v '\*' >.shlist)
if $test -s .deptmp; then
for file in `cat .shlist`; do
$echo `$expr X$file : 'X\(.*\).SH'`: $file config.sh \; \
/bin/sh $file >> .deptmp
done
$echo "Updating $mf..."
$echo "# If this runs make out of memory, delete /usr/include lines." \
>> $mf.new
$sed 's|^\(.*\.o:\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \
>>$mf.new
else
make hlist || ($echo "Searching for .h files..."; \
$echo *.h | $tr ' ' '\012' | $egrep -v '\*' >.hlist)
$echo "You don't seem to have a proper C preprocessor. Using grep instead."
$egrep '^#include ' `cat .clist` `cat .hlist` >.deptmp
$echo "Updating $mf..."
<.clist $sed -n \
-e '/\//{' \
-e 's|^\(.*\)/\(.*\)\.c|\2.o: \1/\2.c; '"$defrule \1/\2.c|p"
\
-e d
\
-e '}'
\
-e 's|^\(.*\)\.c|\1.o: \1.c|p' >> $mf.new
<.hlist $sed -n 's|\(.*/\)\(.*\)|s= \2= \1\2=|p' >.hsed
<.deptmp $sed -n 's|c:#include "\(.*\)".*$|o: \1|p' | \
$sed 's|^[^;]*/||' | \
$sed -f .hsed >> $mf.new
<.deptmp $sed -n 's|c:#include <\(.*\)>.*$|o: /usr/include/\1|p' \
>> $mf.new
<.deptmp $sed -n 's|h:#include "\(.*\)".*$|h: \1|p' | \
$sed -f .hsed >> $mf.new
<.deptmp $sed -n 's|h:#include <\(.*\)>.*$|h: /usr/include/\1|p' \
>> $mf.new
for file in `$cat .shlist`; do
$echo `$expr X$file : 'X\(.*\).SH'`: $file config.sh \; \
/bin/sh $file >> $mf.new
done
fi
</pre>
Eventually, Unix began walking down Telegraph Avenue talking to itself, saying "Panic: freeing free inode," over and over again.
Sometimes it would accost perfect strangers and yell "Bus error (core dumped)!" or "UNEXPECTED INCONSISTENCY: RUN FSCK MANUALLY!" at them in a high pitched squeal like a chihuahua with amphetamine psychosis. Upstanding citizens pretended it was invisible. Mothers with children crossed to the other side of the street.
Then one evening Unix watched television, an event which would change its life. There it discovered professional wrestling and knew that it had found its true calling. It began to take huge doses of corticosteroids to build itself up even bigger than the biggest of the programs which had beaten it up as a child. It ate three dozen pancakes and four dozen new features for breakfast each day. As the complications of the steroids grew worse, its internal organs grew to the point where Unix could no longer contain them. First the kernel grew, then the [[C]] library, then the number of daemons. Soon one of its window systems was requiring two megabytes of swap space for each open window. Unix began to bulge in strange, unflattering places. But Unix continued to take the drugs and its internal organs continued to grow. They grew out its ears and nostrils. They placed incredible stresses on Unix's brain until it finally liquefied under pressure.
Soon Unix had the mass of Andre the Giant, the body of the Elephant Man, and the mind of a forgotten Jack Nicholson character.
The worst strain was on Unix's mind. Unable to assimilate all the conflicting patchworks of features it had ingested, its personality began to fragment into millions of distinct, incompatible operating systems. People would cautiously say "good morning Unix. And who are we today?" and it would reply "Beastie" ([[BSD]]), or "Domain", or "I'm System III, but I'll be System V tomorrow." [[e-Psychiatrist|Psychiatrist]]s labored for years to weld together the two major poles of Unix's personality, "Beasty Boy", an inner-city youth from Berkeley, and "Belle", a southern transvestite who wanted a to be a woman.
With each attempt, the two poles would mutate, like psychotic retroviruses, leaving their union a worthless blob of protoplasm requiring constant life support to remain compatible with its parent personalities.
Finally, unbalanced by its own cancerous growth, Unix fell into a vat of toxic radioactive wombat urine, from which it emerged, skin white and hair green. It smelled like somebody's dead grandmother.
With a horrible grin on its face, it set out to conquer the world. | {
"pile_set_name": "Github"
} |
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Serializer | foo', function(hooks) {
setupTest(hooks);
// Replace this with your real tests.
test('it exists', function(assert) {
let store = this.owner.lookup('service:store');
let serializer = store.serializerFor('foo');
assert.ok(serializer);
});
test('it serializes records', function(assert) {
let store = this.owner.lookup('service:store');
let record = store.createRecord('foo', {});
let serializedRecord = record.serialize();
assert.ok(serializedRecord);
});
});
| {
"pile_set_name": "Github"
} |
Length of : 0
Length of x : 1
Length of 01234567890123456789012345678901234567890123456789012345678901234567890123456789 : 80
Now is the time[0] = "N"
Now is the time[1] = "o"
Now is the time[10] = " "
Now is the time[last] = "e"
Num throws 2000
| {
"pile_set_name": "Github"
} |
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2014-2019, Lawrence Livermore National Security, LLC.
// Produced at the Lawrence Livermore National Laboratory.
// Written by the LBANN Research Team (B. Van Essen, et al.) listed in
// the CONTRIBUTORS file. <[email protected]>
//
// LLNL-CODE-697807.
// All rights reserved.
//
// This file is part of LBANN: Livermore Big Artificial Neural Network
// Toolkit. For details, see http://software.llnl.gov/LBANN or
// https://github.com/LLNL/LBANN.
//
// Licensed under the Apache License, Version 2.0 (the "Licensee"); you
// may not use this file except in compliance with the License. You may
// obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied. See the License for the specific language governing
// permissions and limitations under the license.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef LBANN_DATA_READER_NUMPY_NPZ_CONDUIT_HPP
#define LBANN_DATA_READER_NUMPY_NPZ_CONDUIT_HPP
#include "lbann/data_readers/data_reader.hpp"
#include "conduit/conduit.hpp"
#include <cnpy.h>
namespace lbann {
/**
* Data reader for data stored in numpy (.npz) files that are encapsulated .
* in conduit::Nodes
*/
class numpy_npz_conduit_reader : public generic_data_reader {
public:
numpy_npz_conduit_reader(const bool shuffle);
// These need to be explicit because of some issue with the cnpy copy
// constructor/assignment operator not linking correctly otherwise.
// dah -- ??
numpy_npz_conduit_reader(const numpy_npz_conduit_reader&);
numpy_npz_conduit_reader& operator=(const numpy_npz_conduit_reader&);
~numpy_npz_conduit_reader() override {}
numpy_npz_conduit_reader* copy() const override { return new numpy_npz_conduit_reader(*this); }
void copy_members(const numpy_npz_conduit_reader& rhs);
std::string get_type() const override {
return "numpy_npz_conduit_reader";
}
/// Set whether to fetch labels.
void set_has_labels(bool b) { m_has_labels = b; }
/// Set whether to fetch responses.
void set_has_responses(bool b) { m_has_responses = b; }
/// Set a scaling factor for int16 data.
void set_scaling_factor_int16(DataType s) { m_scaling_factor_int16 = s; }
void load() override;
void set_num_labels(int n) { m_num_labels = n; }
int get_num_labels() const override { return m_num_labels; }
int get_num_responses() const override { return get_linearized_response_size(); }
int get_linearized_data_size() const override { return m_num_features; }
int get_linearized_label_size() const override { return m_num_labels; }
int get_linearized_response_size() const override { return m_num_response_features; }
const std::vector<int> get_data_dims() const override { return m_data_dims; }
protected:
void do_preload_data_store() override;
bool fetch_datum(CPUMat& X, int data_id, int mb_idx) override;
bool fetch_label(CPUMat& Y, int data_id, int mb_idx) override;
bool fetch_response(CPUMat& Y, int data_id, int mb_idx) override;
/// Number of samples.
int m_num_samples = 0;
/// Number of features in each sample.
int m_num_features = 0;
/// Number of label classes.
int m_num_labels = 0;
/// Number of features in each response.
int m_num_response_features = 0;
/// Whether to fetch a label from the last column.
bool m_has_labels = true;
/// Whether to fetch a response from the last column.
bool m_has_responses = true;
std::vector<int> m_data_dims;
int m_data_word_size = 0;
size_t m_response_word_size = 0;
// A constant to be multiplied when data is converted
// from int16 to DataType.
DataType m_scaling_factor_int16 = 1.0;
// fills in: m_num_samples, m_num_features, m_num_response_features,
// m_data_dims, m_data_word_size, m_response_word_size
void fill_in_metadata();
std::vector<std::string> m_filenames;
bool load_numpy_npz_from_file(const std::unordered_set<int> &data_ids, std::unordered_set<int>& label_classes);
void load_conduit_node(const std::string filename, int data_id, conduit::Node &output, bool reset = true);
std::unordered_map<int, std::map<std::string, cnpy::NpyArray>> m_npz_cache;
void load_npz(const std::string filename, int data_id, conduit::Node &node);
};
} // namespace lbann
#endif // LBANN_DATA_READER_NUMPY_NPZ_CONDUIT_HPP
| {
"pile_set_name": "Github"
} |
/* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices
*/
@interface _SBSCarPlayApplicationInfo : NSObject <SBSCarPlayApplicationIcon> {
NSData * _iconImageData;
double _iconImageScale;
NSString * _localizedDisplayName;
}
@property (readonly, copy) NSString *debugDescription;
@property (readonly, copy) NSString *description;
@property (readonly) unsigned long long hash;
@property (nonatomic, retain) NSData *iconImageData;
@property (nonatomic) double iconImageScale;
@property (nonatomic, retain) NSString *localizedDisplayName;
@property (readonly) Class superclass;
- (void).cxx_destruct;
- (id)iconImageData;
- (double)iconImageScale;
- (id)localizedDisplayName;
- (void)setIconImageData:(id)arg1;
- (void)setIconImageScale:(double)arg1;
- (void)setLocalizedDisplayName:(id)arg1;
@end
| {
"pile_set_name": "Github"
} |
package base_types
type ServiceDocument struct {
DocumentVersion int64 `json:"documentVersion,omitempty"`
DocumentEpoch int64 `json:"documentEpoch,omitempty"`
DocumentKind string `json:"documentKind,omitempty"`
DocumentSelfLink string `json:"documentSelfLink,omitempty"`
DocumentUpdateTimeMicros interface{} `json:"documentUpdateTimeMicros,omitempty"`
DocumentUpdateAction string `json:"documentUpdateAction,omitempty"`
DocumentExpirationTime interface{} `json:"documentExpirationTime,omitempty"`
DocumentOwner string `json:"documentOwner,omitempty"`
DocumentSourceLink string `json:"documentSourceLink,omitempty"`
DocumentAuthPrincipalLink string `json:"documentAuthPrincipalLink,omitempty"`
DocumentTransactionId string `json:"documentTransactionId,omitempty"`
}
| {
"pile_set_name": "Github"
} |
// @ts-check
const expect = require('chai').expect;
const sinon = require('sinon');
const checkValidInstall = require('../../../lib/utils/check-valid-install');
const fs = require('fs-extra');
describe('Unit: Utils > checkValidInstall', function () {
afterEach(() => {
sinon.restore();
});
it('fails when config.js present', function () {
const existsStub = sinon.stub(fs, 'existsSync');
existsStub.withArgs(sinon.match(/config\.js/)).returns(true);
const errorStub = sinon.stub(console, 'error');
expect(checkValidInstall('test')).to.equal(false);
expect(existsStub.calledOnce).to.be.true;
expect(errorStub.calledOnce).to.be.true;
expect(existsStub.args[0][0]).to.match(/config\.js/);
expect(errorStub.args[0][0]).to.match(/Ghost-CLI only works with Ghost versions >= 1\.0\.0/);
});
it('fails within a Ghost git clone', function () {
const existsStub = sinon.stub(fs, 'existsSync');
const readJsonStub = sinon.stub(fs, 'readJsonSync');
existsStub.withArgs(sinon.match(/config\.js/)).returns(false);
existsStub.withArgs(sinon.match(/package\.json/)).returns(true);
existsStub.withArgs(sinon.match(/Gruntfile\.js/)).returns(true);
readJsonStub.returns({name: 'ghost'});
const errorStub = sinon.stub(console, 'error');
expect(checkValidInstall('test')).to.equal(false);
expect(existsStub.calledThrice).to.be.true;
expect(errorStub.calledOnce).to.be.true;
expect(existsStub.args[1][0]).to.match(/package\.json/);
expect(errorStub.args[0][0]).to.match(/Ghost-CLI commands do not work inside of a git clone/);
});
it('neither passes nor fails when .ghost-cli file is missing', function () {
const existsStub = sinon.stub(fs, 'existsSync');
existsStub.withArgs(sinon.match(/config\.js/)).returns(false);
existsStub.withArgs(sinon.match(/package\.json/)).returns(false);
existsStub.withArgs(sinon.match(/\.ghost-cli/)).returns(false);
expect(checkValidInstall('test')).to.equal(null);
expect(existsStub.calledThrice).to.be.true;
expect(existsStub.args[2][0]).to.match(/\.ghost-cli/);
});
it('passes in "valid" installation', function () {
const existsStub = sinon.stub(fs, 'existsSync');
existsStub.withArgs(sinon.match(/config\.js/)).returns(false);
existsStub.withArgs(sinon.match(/package\.json/)).returns(false);
existsStub.withArgs(sinon.match(/\.ghost-cli/)).returns(true);
const errorStub = sinon.stub(console, 'error');
expect(checkValidInstall('test')).to.equal(true);
expect(existsStub.calledThrice).to.be.true;
expect(errorStub.called).to.be.false;
});
});
| {
"pile_set_name": "Github"
} |
**string_decoder.js** (`require('string_decoder')`) from Node.js core
Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details.
Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**
The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. | {
"pile_set_name": "Github"
} |
#include <vector>
#include "caffe/layers/flatten_layer.hpp"
namespace caffe {
template <typename Dtype>
void FlattenLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {
CHECK_NE(top[0], bottom[0]) << this->type() << " Layer does not "
"allow in-place computation.";
const int start_axis = bottom[0]->CanonicalAxisIndex(
this->layer_param_.flatten_param().axis());
const int end_axis = bottom[0]->CanonicalAxisIndex(
this->layer_param_.flatten_param().end_axis());
vector<int> top_shape;
for (int i = 0; i < start_axis; ++i) {
top_shape.push_back(bottom[0]->shape(i));
}
const int flattened_dim = bottom[0]->count(start_axis, end_axis + 1);
top_shape.push_back(flattened_dim);
for (int i = end_axis + 1; i < bottom[0]->num_axes(); ++i) {
top_shape.push_back(bottom[0]->shape(i));
}
top[0]->Reshape(top_shape);
CHECK_EQ(top[0]->count(), bottom[0]->count());
}
template <typename Dtype>
void FlattenLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {
top[0]->ShareData(*bottom[0]);
}
template <typename Dtype>
void FlattenLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,
const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom) {
bottom[0]->ShareDiff(*top[0]);
}
INSTANTIATE_CLASS(FlattenLayer);
REGISTER_LAYER_CLASS(Flatten);
} // namespace caffe
| {
"pile_set_name": "Github"
} |
[android-components](../../index.md) / [mozilla.components.lib.crash.service](../index.md) / [CrashTelemetryService](index.md) / [record](./record.md)
# record
`abstract fun record(crash: `[`UncaughtExceptionCrash`](../../mozilla.components.lib.crash/-crash/-uncaught-exception-crash/index.md)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/lib/crash/src/main/java/mozilla/components/lib/crash/service/CrashTelemetryService.kt#L16)
Records telemetry for this [Crash.UncaughtExceptionCrash](../../mozilla.components.lib.crash/-crash/-uncaught-exception-crash/index.md).
`abstract fun record(crash: `[`NativeCodeCrash`](../../mozilla.components.lib.crash/-crash/-native-code-crash/index.md)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/lib/crash/src/main/java/mozilla/components/lib/crash/service/CrashTelemetryService.kt#L21)
Records telemetry for this [Crash.NativeCodeCrash](../../mozilla.components.lib.crash/-crash/-native-code-crash/index.md).
`abstract fun record(throwable: `[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/lib/crash/src/main/java/mozilla/components/lib/crash/service/CrashTelemetryService.kt#L26)
Records telemetry for this caught [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) (non-crash).
| {
"pile_set_name": "Github"
} |
var a = 0
def direct(f: Int => Unit) = ()
direct(/*start*/a = _/*end*/)
// Int => Unit | {
"pile_set_name": "Github"
} |
import * as cli from '../cli';
import { compileInMemory } from './utils';
describe('metadata test', () => {
let namespaces: string;
beforeAll(async () => {
namespaces = await cli.buildTypeScriptFromSources([
`
syntax = "proto3";
package test;
service Service {
rpc Single (Message) returns (Message) {}
}
message Message {
string field = 1;
}
`,
]);
});
it('should accept metadata object', async () => {
const result = compileInMemory({
'grpc-namespaces.ts': namespaces,
'test.ts': `
import { Metadata } from 'grpc';
import { clientFactory } from 'rxjs-grpc';
import { test } from './grpc-namespaces';
const Services = clientFactory<test.ClientFactory>('test.proto', 'test');
const services = new Services('localhost:1234');
const Service = services.getService();
Service.single({ field: 'string' }, new Metadata());
`,
});
expect(result.errors).toEqual([]);
expect(result.ok).toBe(true);
});
it('should not accept invalid metadata object', async () => {
const result = compileInMemory({
'grpc-namespaces.ts': namespaces,
'test.ts': `
import { Metadata } from 'grpc';
import { clientFactory } from 'rxjs-grpc';
import { test } from './grpc-namespaces';
const Services = clientFactory<test.ClientFactory>('test.proto', 'test');
const services = new Services('localhost:1234');
const Service = services.getService();
Service.single({ field: 'string' }, { NOT_A_METADATA: 'yes' });
`,
});
expect(result.errors.length).toBeGreaterThan(0);
expect(result.ok).toBe(false);
});
it('should pass metadata object', async () => {
const result = compileInMemory({
'grpc-namespaces.ts': namespaces,
'test.ts': `
import { of } from 'rxjs';
import { serverBuilder } from 'rxjs-grpc';
import { test } from './grpc-namespaces';
const server = serverBuilder<test.ServerBuilder>('test.proto', 'test');
server.addService({
single(request, metadata) {
console.log(metadata.get('test'));
return of();
}
});
server.start('0.0.0.0:1234');
`,
});
expect(result.errors).toEqual([]);
expect(result.ok).toBe(true);
});
});
| {
"pile_set_name": "Github"
} |
package jwt
import (
"crypto/subtle"
"fmt"
"time"
)
// For a type to be a Claims object, it must just have a Valid method that determines
// if the token is invalid for any supported reason
type Claims interface {
Valid() error
}
// Structured version of Claims Section, as referenced at
// https://tools.ietf.org/html/rfc7519#section-4.1
// See examples for how to use this with your own claim types
type StandardClaims struct {
Audience string `json:"aud,omitempty"`
ExpiresAt int64 `json:"exp,omitempty"`
Id string `json:"jti,omitempty"`
IssuedAt int64 `json:"iat,omitempty"`
Issuer string `json:"iss,omitempty"`
NotBefore int64 `json:"nbf,omitempty"`
Subject string `json:"sub,omitempty"`
}
// Validates time based claims "exp, iat, nbf".
// There is no accounting for clock skew.
// As well, if any of the above claims are not in the token, it will still
// be considered a valid claim.
func (c StandardClaims) Valid() error {
vErr := new(ValidationError)
now := TimeFunc().Unix()
// The claims below are optional, by default, so if they are set to the
// default value in Go, let's not fail the verification for them.
if c.VerifyExpiresAt(now, false) == false {
delta := time.Unix(now, 0).Sub(time.Unix(c.ExpiresAt, 0))
vErr.Inner = fmt.Errorf("token is expired by %v", delta)
vErr.Errors |= ValidationErrorExpired
}
if c.VerifyIssuedAt(now, false) == false {
vErr.Inner = fmt.Errorf("Token used before issued")
vErr.Errors |= ValidationErrorIssuedAt
}
if c.VerifyNotBefore(now, false) == false {
vErr.Inner = fmt.Errorf("token is not valid yet")
vErr.Errors |= ValidationErrorNotValidYet
}
if vErr.valid() {
return nil
}
return vErr
}
// Compares the aud claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *StandardClaims) VerifyAudience(cmp string, req bool) bool {
return verifyAud(c.Audience, cmp, req)
}
// Compares the exp claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *StandardClaims) VerifyExpiresAt(cmp int64, req bool) bool {
return verifyExp(c.ExpiresAt, cmp, req)
}
// Compares the iat claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *StandardClaims) VerifyIssuedAt(cmp int64, req bool) bool {
return verifyIat(c.IssuedAt, cmp, req)
}
// Compares the iss claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *StandardClaims) VerifyIssuer(cmp string, req bool) bool {
return verifyIss(c.Issuer, cmp, req)
}
// Compares the nbf claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *StandardClaims) VerifyNotBefore(cmp int64, req bool) bool {
return verifyNbf(c.NotBefore, cmp, req)
}
// ----- helpers
func verifyAud(aud string, cmp string, required bool) bool {
if aud == "" {
return !required
}
if subtle.ConstantTimeCompare([]byte(aud), []byte(cmp)) != 0 {
return true
} else {
return false
}
}
func verifyExp(exp int64, now int64, required bool) bool {
if exp == 0 {
return !required
}
return now <= exp
}
func verifyIat(iat int64, now int64, required bool) bool {
if iat == 0 {
return !required
}
return now >= iat
}
func verifyIss(iss string, cmp string, required bool) bool {
if iss == "" {
return !required
}
if subtle.ConstantTimeCompare([]byte(iss), []byte(cmp)) != 0 {
return true
} else {
return false
}
}
func verifyNbf(nbf int64, now int64, required bool) bool {
if nbf == 0 {
return !required
}
return now >= nbf
}
| {
"pile_set_name": "Github"
} |
<?php
namespace Illuminate\Foundation\Console;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
class ConfigClearCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'config:clear';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Remove the configuration cache file';
/**
* The filesystem instance.
*
* @var \Illuminate\Filesystem\Filesystem
*/
protected $files;
/**
* Create a new config clear command instance.
*
* @param \Illuminate\Filesystem\Filesystem $files
* @return void
*/
public function __construct(Filesystem $files)
{
parent::__construct();
$this->files = $files;
}
/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
$this->files->delete($this->laravel->getCachedConfigPath());
$this->info('Configuration cache cleared!');
}
}
| {
"pile_set_name": "Github"
} |
{
"name": "mean-angular2-registration-login-example-server",
"version": "1.0.0",
"description": "Server for MEAN Stack with Angular 2 User Registration and Login Example",
"repository": {
"type": "git",
"url": "https://github.com/cornflourblue/mean-angular2-registration-login-example.git"
},
"dependencies": {
"bcryptjs": "^2.1.0",
"body-parser": "^1.13.2",
"cors": "^2.8.1",
"express": "^4.13.0",
"express-jwt": "^3.0.1",
"jsonwebtoken": "^5.0.2",
"lodash": "^4.17.10",
"mongodb": "^2.1.16",
"mongoskin": "^2.1.0",
"q": "^1.4.1",
"request": "^2.87.0",
"rootpath": "^0.1.2"
},
"license": "MIT"
}
| {
"pile_set_name": "Github"
} |
SUMMARY = "Smart replacement for plain tuple used in __version__"
SECTION = "devel/python"
HOMEPAGE = "https://launchpad.net/versiontools"
LICENSE = "LGPLv3"
LIC_FILES_CHKSUM = "file://setup.py;beginline=3;endline=20;md5=02193721a38fd8a05a4ddeb7df8e294d"
SRC_URI[md5sum] = "602b7db8eea30dd29a1d451997adf251"
SRC_URI[sha256sum] = "a969332887a18a9c98b0df0ea4d4ca75972f24ca94f06fb87d591377e83414f6"
inherit pypi setuptools3
| {
"pile_set_name": "Github"
} |
// Mixins
// --------------------------
.fa-icon() {
display: inline-block;
font: normal normal normal @fa-font-size-base/1 FontAwesome; // shortening font declaration
font-size: inherit; // can't have font-size inherit on line above, so need to override
text-rendering: auto; // optimizelegibility throws things off #1094
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transform: translate(0, 0); // ensures no half-pixel rendering in firefox
}
.fa-icon-rotate(@degrees, @rotation) {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation);
-webkit-transform: rotate(@degrees);
-ms-transform: rotate(@degrees);
transform: rotate(@degrees);
}
.fa-icon-flip(@horiz, @vert, @rotation) {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1);
-webkit-transform: scale(@horiz, @vert);
-ms-transform: scale(@horiz, @vert);
transform: scale(@horiz, @vert);
}
| {
"pile_set_name": "Github"
} |
goog.provide('ghostwheel.utils');
goog.require('cljs.core');
goog.require('clojure.walk');
goog.require('cljs.env');
goog.require('orchestra_cljs.spec.test');
ghostwheel.utils.ghostwheel_default_config = cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword("ghostwheel.core","report-output","ghostwheel.core/report-output",-1945560991),new cljs.core.Keyword("ghostwheel.core","instrument","ghostwheel.core/instrument",-427699197),new cljs.core.Keyword("ghostwheel.core","extrument","ghostwheel.core/extrument",-1845043355),new cljs.core.Keyword("ghostwheel.core","check","ghostwheel.core/check",-379901241),new cljs.core.Keyword("ghostwheel.core","check-coverage","ghostwheel.core/check-coverage",195314921),new cljs.core.Keyword("ghostwheel.core","num-tests","ghostwheel.core/num-tests",-646548501),new cljs.core.Keyword("ghostwheel.core","trace","ghostwheel.core/trace",531995664),new cljs.core.Keyword("ghostwheel.core","trace-color","ghostwheel.core/trace-color",-2040710640),new cljs.core.Keyword("ghostwheel.core","expound","ghostwheel.core/expound",2100442996),new cljs.core.Keyword("ghostwheel.core","outstrument","ghostwheel.core/outstrument",-653830347),new cljs.core.Keyword("ghostwheel.core","num-tests-ext","ghostwheel.core/num-tests-ext",-1546795687),new cljs.core.Keyword("ghostwheel.core","extensive-tests","ghostwheel.core/extensive-tests",-1219157415),new cljs.core.Keyword("ghostwheel.core","ignore-fx","ghostwheel.core/ignore-fx",-1650876390),new cljs.core.Keyword("ghostwheel.core","defn-macro","ghostwheel.core/defn-macro",-493811684)],[new cljs.core.Keyword(null,"js-console","js-console",1240105791),false,null,false,false,(0),(0),new cljs.core.Keyword(null,"violet","violet",-1351470549),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"show-valid-values?","show-valid-values?",-587258094),true,new cljs.core.Keyword(null,"print-specs?","print-specs?",146397677),true], null),false,(100),false,false,null]);
ghostwheel.utils.cljs_env_QMARK_ = (function ghostwheel$utils$cljs_env_QMARK_(env){
return cljs.core.boolean$(new cljs.core.Keyword(null,"ns","ns",441598760).cljs$core$IFn$_invoke$arity$1(env));
});
var _STAR_config_cache_85415 = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword("ghostwheel.utils","timestamp","ghostwheel.utils/timestamp",-1150458516),(0),new cljs.core.Keyword("ghostwheel.utils","value","ghostwheel.utils/value",2111420378),null], null));
var read_config_file_85416 = ((function (_STAR_config_cache_85415){
return (function (){
return null;
});})(_STAR_config_cache_85415))
;
var reload_config_85417 = ((function (_STAR_config_cache_85415,read_config_file_85416){
return (function (){
var plain_config = (function (){var cljs_compiler_config = (cljs.core.truth_(cljs.env._STAR_compiler_STAR_)?(function (){var or__4131__auto__ = cljs.core.get_in.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(cljs.env._STAR_compiler_STAR_),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.Keyword(null,"external-config","external-config",-471423941),new cljs.core.Keyword(null,"ghostwheel","ghostwheel",1311459564)], null));
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return cljs.core.get_in.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(cljs.env._STAR_compiler_STAR_),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"options","options",99638489),new cljs.core.Keyword(null,"ghostwheel","ghostwheel",1311459564)], null));
}
})():null);
if(cljs.core.truth_(cljs_compiler_config)){
return cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([cljs.core.PersistentArrayMap.EMPTY,read_config_file_85416(),cljs_compiler_config], 0));
} else {
return null;
}
})();
if(cljs.core.truth_(plain_config)){
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,cljs.core.map.cljs$core$IFn$_invoke$arity$2(((function (plain_config,_STAR_config_cache_85415,read_config_file_85416){
return (function (p__85349){
var vec__85350 = p__85349;
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__85350,(0),null);
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__85350,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.keyword.cljs$core$IFn$_invoke$arity$2("ghostwheel.core",cljs.core.name(k)),v], null);
});})(plain_config,_STAR_config_cache_85415,read_config_file_85416))
,plain_config));
} else {
return null;
}
});})(_STAR_config_cache_85415,read_config_file_85416))
;
ghostwheel.utils.get_env_config = ((function (_STAR_config_cache_85415,read_config_file_85416,reload_config_85417){
return (function ghostwheel$utils$get_env_config(var_args){
var G__85358 = arguments.length;
switch (G__85358) {
case 0:
return ghostwheel.utils.get_env_config.cljs$core$IFn$_invoke$arity$0();
break;
case 1:
return ghostwheel.utils.get_env_config.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});})(_STAR_config_cache_85415,read_config_file_85416,reload_config_85417))
;
ghostwheel.utils.get_env_config.cljs$core$IFn$_invoke$arity$0 = ((function (_STAR_config_cache_85415,read_config_file_85416,reload_config_85417){
return (function (){
return ghostwheel.utils.get_env_config.cljs$core$IFn$_invoke$arity$1(true);
});})(_STAR_config_cache_85415,read_config_file_85416,reload_config_85417))
;
ghostwheel.utils.get_env_config.cljs$core$IFn$_invoke$arity$1 = ((function (_STAR_config_cache_85415,read_config_file_85416,reload_config_85417){
return (function (cache_QMARK_){
if(cljs.core.not(cache_QMARK_)){
return reload_config_85417();
} else {
var now = cljs.core.identity(Date.now());
if(((now - new cljs.core.Keyword("ghostwheel.utils","timestamp","ghostwheel.utils/timestamp",-1150458516).cljs$core$IFn$_invoke$arity$1(cljs.core.deref(_STAR_config_cache_85415))) < (2000))){
return new cljs.core.Keyword("ghostwheel.utils","value","ghostwheel.utils/value",2111420378).cljs$core$IFn$_invoke$arity$1(cljs.core.deref(_STAR_config_cache_85415));
} else {
return new cljs.core.Keyword("ghostwheel.utils","value","ghostwheel.utils/value",2111420378).cljs$core$IFn$_invoke$arity$1(cljs.core.reset_BANG_(_STAR_config_cache_85415,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword("ghostwheel.utils","timestamp","ghostwheel.utils/timestamp",-1150458516),now,new cljs.core.Keyword("ghostwheel.utils","value","ghostwheel.utils/value",2111420378),reload_config_85417()], null)));
}
}
});})(_STAR_config_cache_85415,read_config_file_85416,reload_config_85417))
;
ghostwheel.utils.get_env_config.cljs$lang$maxFixedArity = 1;
ghostwheel.utils.get_base_config = (function ghostwheel$utils$get_base_config(var_args){
var G__85373 = arguments.length;
switch (G__85373) {
case 0:
return ghostwheel.utils.get_base_config.cljs$core$IFn$_invoke$arity$0();
break;
case 1:
return ghostwheel.utils.get_base_config.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
ghostwheel.utils.get_base_config.cljs$core$IFn$_invoke$arity$0 = (function (){
return ghostwheel.utils.get_base_config.cljs$core$IFn$_invoke$arity$1(true);
});
ghostwheel.utils.get_base_config.cljs$core$IFn$_invoke$arity$1 = (function (cache_QMARK_){
return cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([ghostwheel.utils.ghostwheel_default_config,ghostwheel.utils.get_env_config.cljs$core$IFn$_invoke$arity$1(cache_QMARK_)], 0));
});
ghostwheel.utils.get_base_config.cljs$lang$maxFixedArity = 1;
ghostwheel.utils.clj__GT_cljs = (function ghostwheel$utils$clj__GT_cljs(var_args){
var G__85384 = arguments.length;
switch (G__85384) {
case 1:
return ghostwheel.utils.clj__GT_cljs.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
case 2:
return ghostwheel.utils.clj__GT_cljs.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
ghostwheel.utils.clj__GT_cljs.cljs$core$IFn$_invoke$arity$1 = (function (form){
return ghostwheel.utils.clj__GT_cljs.cljs$core$IFn$_invoke$arity$2(form,true);
});
ghostwheel.utils.clj__GT_cljs.cljs$core$IFn$_invoke$arity$2 = (function (form,strip_core_ns){
var ns_replacements = (function (){var G__85393 = new cljs.core.PersistentArrayMap(null, 6, ["clojure.core","cljs.core","clojure.test","cljs.test","clojure.spec.alpha","cljs.spec.alpha","clojure.spec.test.alpha","cljs.spec.test.alpha","orchestra.spec.test","orchestra-cljs.spec.test","clojure.spec.gen.alpha","cljs.spec.gen.alpha"], null);
if(cljs.core.truth_(strip_core_ns)){
return cljs.core.merge.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([G__85393,new cljs.core.PersistentArrayMap(null, 2, ["clojure.core",null,"cljs.core",null], null)], 0));
} else {
return G__85393;
}
})();
var replace_namespace = ((function (ns_replacements){
return (function (p1__85380_SHARP_){
if((!(cljs.core.qualified_symbol_QMARK_(p1__85380_SHARP_)))){
return p1__85380_SHARP_;
} else {
var nspace = cljs.core.namespace(p1__85380_SHARP_);
if(cljs.core.contains_QMARK_(ns_replacements,nspace)){
return cljs.core.symbol.cljs$core$IFn$_invoke$arity$2(cljs.core.get.cljs$core$IFn$_invoke$arity$2(ns_replacements,nspace),cljs.core.name(p1__85380_SHARP_));
} else {
return p1__85380_SHARP_;
}
}
});})(ns_replacements))
;
return clojure.walk.postwalk(replace_namespace,form);
});
ghostwheel.utils.clj__GT_cljs.cljs$lang$maxFixedArity = 2;
ghostwheel.utils.gen_exception = (function ghostwheel$utils$gen_exception(env,msg){
return cljs.core.sequence.cljs$core$IFn$_invoke$arity$1(cljs.core.seq(cljs.core.concat.cljs$core$IFn$_invoke$arity$2((new cljs.core.List(null,new cljs.core.Symbol(null,"throw","throw",595905694,null),null,(1),null)),(new cljs.core.List(null,cljs.core.sequence.cljs$core$IFn$_invoke$arity$1(cljs.core.seq(cljs.core.concat.cljs$core$IFn$_invoke$arity$2((new cljs.core.List(null,((ghostwheel.utils.cljs_env_QMARK_(env))?new cljs.core.Symbol("js","Error.","js/Error.",750655924,null):new cljs.core.Symbol(null,"Exception.","Exception.",-981206655,null)),null,(1),null)),(new cljs.core.List(null,msg,null,(1),null))))),null,(1),null)))));
});
//# sourceMappingURL=ghostwheel.utils.js.map
| {
"pile_set_name": "Github"
} |
import sys
import os
import shutil
import StringIO
from binascii import unhexlify
from hashlib import md5
from random import Random
import errno
import unittest
import tarfile
from test import test_support
from test import test_support as support
# Check for our compression modules.
try:
import gzip
gzip.GzipFile
except (ImportError, AttributeError):
gzip = None
try:
import bz2
except ImportError:
bz2 = None
def md5sum(data):
return md5(data).hexdigest()
TEMPDIR = os.path.abspath(test_support.TESTFN)
tarname = test_support.findfile("testtar.tar")
gzipname = os.path.join(TEMPDIR, "testtar.tar.gz")
bz2name = os.path.join(TEMPDIR, "testtar.tar.bz2")
tmpname = os.path.join(TEMPDIR, "tmp.tar")
md5_regtype = "65f477c818ad9e15f7feab0c6d37742f"
md5_sparse = "a54fbc4ca4f4399a90e1b27164012fc6"
class ReadTest(unittest.TestCase):
tarname = tarname
mode = "r:"
def setUp(self):
self.tar = tarfile.open(self.tarname, mode=self.mode,
encoding="iso8859-1")
def tearDown(self):
self.tar.close()
class UstarReadTest(ReadTest):
def test_fileobj_regular_file(self):
tarinfo = self.tar.getmember("ustar/regtype")
fobj = self.tar.extractfile(tarinfo)
data = fobj.read()
self.assertTrue((len(data), md5sum(data)) == (tarinfo.size, md5_regtype),
"regular file extraction failed")
def test_fileobj_readlines(self):
self.tar.extract("ustar/regtype", TEMPDIR)
tarinfo = self.tar.getmember("ustar/regtype")
with open(os.path.join(TEMPDIR, "ustar/regtype"), "rU") as fobj1:
lines1 = fobj1.readlines()
fobj2 = self.tar.extractfile(tarinfo)
lines2 = fobj2.readlines()
self.assertTrue(lines1 == lines2,
"fileobj.readlines() failed")
self.assertTrue(len(lines2) == 114,
"fileobj.readlines() failed")
self.assertTrue(lines2[83] ==
"I will gladly admit that Python is not the fastest running scripting language.\n",
"fileobj.readlines() failed")
def test_fileobj_iter(self):
self.tar.extract("ustar/regtype", TEMPDIR)
tarinfo = self.tar.getmember("ustar/regtype")
with open(os.path.join(TEMPDIR, "ustar/regtype"), "rU") as fobj1:
lines1 = fobj1.readlines()
fobj2 = self.tar.extractfile(tarinfo)
lines2 = [line for line in fobj2]
self.assertTrue(lines1 == lines2,
"fileobj.__iter__() failed")
def test_fileobj_seek(self):
self.tar.extract("ustar/regtype", TEMPDIR)
with open(os.path.join(TEMPDIR, "ustar/regtype"), "rb") as fobj:
data = fobj.read()
tarinfo = self.tar.getmember("ustar/regtype")
fobj = self.tar.extractfile(tarinfo)
text = fobj.read()
fobj.seek(0)
self.assertTrue(0 == fobj.tell(),
"seek() to file's start failed")
fobj.seek(2048, 0)
self.assertTrue(2048 == fobj.tell(),
"seek() to absolute position failed")
fobj.seek(-1024, 1)
self.assertTrue(1024 == fobj.tell(),
"seek() to negative relative position failed")
fobj.seek(1024, 1)
self.assertTrue(2048 == fobj.tell(),
"seek() to positive relative position failed")
s = fobj.read(10)
self.assertTrue(s == data[2048:2058],
"read() after seek failed")
fobj.seek(0, 2)
self.assertTrue(tarinfo.size == fobj.tell(),
"seek() to file's end failed")
self.assertTrue(fobj.read() == "",
"read() at file's end did not return empty string")
fobj.seek(-tarinfo.size, 2)
self.assertTrue(0 == fobj.tell(),
"relative seek() to file's start failed")
fobj.seek(512)
s1 = fobj.readlines()
fobj.seek(512)
s2 = fobj.readlines()
self.assertTrue(s1 == s2,
"readlines() after seek failed")
fobj.seek(0)
self.assertTrue(len(fobj.readline()) == fobj.tell(),
"tell() after readline() failed")
fobj.seek(512)
self.assertTrue(len(fobj.readline()) + 512 == fobj.tell(),
"tell() after seek() and readline() failed")
fobj.seek(0)
line = fobj.readline()
self.assertTrue(fobj.read() == data[len(line):],
"read() after readline() failed")
fobj.close()
# Test if symbolic and hard links are resolved by extractfile(). The
# test link members each point to a regular member whose data is
# supposed to be exported.
def _test_fileobj_link(self, lnktype, regtype):
a = self.tar.extractfile(lnktype)
b = self.tar.extractfile(regtype)
self.assertEqual(a.name, b.name)
def test_fileobj_link1(self):
self._test_fileobj_link("ustar/lnktype", "ustar/regtype")
def test_fileobj_link2(self):
self._test_fileobj_link("./ustar/linktest2/lnktype", "ustar/linktest1/regtype")
def test_fileobj_symlink1(self):
self._test_fileobj_link("ustar/symtype", "ustar/regtype")
def test_fileobj_symlink2(self):
self._test_fileobj_link("./ustar/linktest2/symtype", "ustar/linktest1/regtype")
def test_issue14160(self):
self._test_fileobj_link("symtype2", "ustar/regtype")
class ListTest(ReadTest, unittest.TestCase):
# Override setUp to use default encoding (UTF-8)
def setUp(self):
self.tar = tarfile.open(self.tarname, mode=self.mode)
def test_list(self):
with test_support.captured_stdout() as t:
self.tar.list(verbose=False)
out = t.getvalue()
self.assertIn('ustar/conttype', out)
self.assertIn('ustar/regtype', out)
self.assertIn('ustar/lnktype', out)
self.assertIn('ustar' + ('/12345' * 40) + '67/longname', out)
self.assertIn('./ustar/linktest2/symtype', out)
self.assertIn('./ustar/linktest2/lnktype', out)
# Make sure it puts trailing slash for directory
self.assertIn('ustar/dirtype/', out)
self.assertIn('ustar/dirtype-with-size/', out)
# Make sure it is able to print non-ASCII characters
self.assertIn('ustar/umlauts-'
'\xc4\xd6\xdc\xe4\xf6\xfc\xdf', out)
self.assertIn('misc/regtype-hpux-signed-chksum-'
'\xc4\xd6\xdc\xe4\xf6\xfc\xdf', out)
self.assertIn('misc/regtype-old-v7-signed-chksum-'
'\xc4\xd6\xdc\xe4\xf6\xfc\xdf', out)
# Make sure it prints files separated by one newline without any
# 'ls -l'-like accessories if verbose flag is not being used
# ...
# ustar/conttype
# ustar/regtype
# ...
self.assertRegexpMatches(out, r'ustar/conttype ?\r?\n'
r'ustar/regtype ?\r?\n')
# Make sure it does not print the source of link without verbose flag
self.assertNotIn('link to', out)
self.assertNotIn('->', out)
def test_list_verbose(self):
with test_support.captured_stdout() as t:
self.tar.list(verbose=True)
out = t.getvalue()
# Make sure it prints files separated by one newline with 'ls -l'-like
# accessories if verbose flag is being used
# ...
# ?rw-r--r-- tarfile/tarfile 7011 2003-01-06 07:19:43 ustar/conttype
# ?rw-r--r-- tarfile/tarfile 7011 2003-01-06 07:19:43 ustar/regtype
# ...
self.assertRegexpMatches(out, (r'-rw-r--r-- tarfile/tarfile\s+7011 '
r'\d{4}-\d\d-\d\d\s+\d\d:\d\d:\d\d '
r'ustar/\w+type ?\r?\n') * 2)
# Make sure it prints the source of link with verbose flag
self.assertIn('ustar/symtype -> regtype', out)
self.assertIn('./ustar/linktest2/symtype -> ../linktest1/regtype', out)
self.assertIn('./ustar/linktest2/lnktype link to '
'./ustar/linktest1/regtype', out)
self.assertIn('gnu' + ('/123' * 125) + '/longlink link to gnu' +
('/123' * 125) + '/longname', out)
self.assertIn('pax' + ('/123' * 125) + '/longlink link to pax' +
('/123' * 125) + '/longname', out)
class GzipListTest(ListTest):
tarname = gzipname
mode = "r:gz"
taropen = tarfile.TarFile.gzopen
class Bz2ListTest(ListTest):
tarname = bz2name
mode = "r:bz2"
taropen = tarfile.TarFile.bz2open
class CommonReadTest(ReadTest):
def test_empty_tarfile(self):
# Test for issue6123: Allow opening empty archives.
# This test checks if tarfile.open() is able to open an empty tar
# archive successfully. Note that an empty tar archive is not the
# same as an empty file!
with tarfile.open(tmpname, self.mode.replace("r", "w")):
pass
try:
tar = tarfile.open(tmpname, self.mode)
tar.getnames()
except tarfile.ReadError:
self.fail("tarfile.open() failed on empty archive")
else:
self.assertListEqual(tar.getmembers(), [])
finally:
tar.close()
def test_null_tarfile(self):
# Test for issue6123: Allow opening empty archives.
# This test guarantees that tarfile.open() does not treat an empty
# file as an empty tar archive.
with open(tmpname, "wb"):
pass
self.assertRaises(tarfile.ReadError, tarfile.open, tmpname, self.mode)
self.assertRaises(tarfile.ReadError, tarfile.open, tmpname)
def test_non_existent_tarfile(self):
# Test for issue11513: prevent non-existent gzipped tarfiles raising
# multiple exceptions.
exctype = OSError if '|' in self.mode else IOError
with self.assertRaisesRegexp(exctype, "xxx") as ex:
tarfile.open("xxx", self.mode)
self.assertEqual(ex.exception.errno, errno.ENOENT)
def test_ignore_zeros(self):
# Test TarFile's ignore_zeros option.
if self.mode.endswith(":gz"):
_open = gzip.GzipFile
elif self.mode.endswith(":bz2"):
_open = bz2.BZ2File
else:
_open = open
# generate 512 pseudorandom bytes
data = unhexlify('%1024x' % Random(0).getrandbits(512*8))
for char in ('\0', 'a'):
# Test if EOFHeaderError ('\0') and InvalidHeaderError ('a')
# are ignored correctly.
with _open(tmpname, "wb") as fobj:
fobj.write(char * 1024)
tarinfo = tarfile.TarInfo("foo")
tarinfo.size = len(data)
fobj.write(tarinfo.tobuf())
fobj.write(data)
tar = tarfile.open(tmpname, mode="r", ignore_zeros=True)
try:
self.assertListEqual(tar.getnames(), ["foo"],
"ignore_zeros=True should have skipped the %r-blocks" % char)
finally:
tar.close()
def test_premature_end_of_archive(self):
for size in (512, 600, 1024, 1200):
with tarfile.open(tmpname, "w:") as tar:
t = tarfile.TarInfo("foo")
t.size = 1024
tar.addfile(t, StringIO.StringIO("a" * 1024))
with open(tmpname, "r+b") as fobj:
fobj.truncate(size)
with tarfile.open(tmpname) as tar:
with self.assertRaisesRegexp(tarfile.ReadError, "unexpected end of data"):
for t in tar:
pass
with tarfile.open(tmpname) as tar:
t = tar.next()
with self.assertRaisesRegexp(tarfile.ReadError, "unexpected end of data"):
tar.extract(t, TEMPDIR)
with self.assertRaisesRegexp(tarfile.ReadError, "unexpected end of data"):
tar.extractfile(t).read()
def test_length_zero_header(self):
# bpo-39017 (CVE-2019-20907): reading a zero-length header should fail
# with an exception
with self.assertRaisesRegexp(tarfile.ReadError, "file could not be opened successfully"):
with tarfile.open(support.findfile('recursion.tar')) as tar:
pass
class MiscReadTest(CommonReadTest):
taropen = tarfile.TarFile.taropen
def test_no_name_argument(self):
with open(self.tarname, "rb") as fobj:
with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
self.assertEqual(tar.name, os.path.abspath(fobj.name))
def test_no_name_attribute(self):
with open(self.tarname, "rb") as fobj:
data = fobj.read()
fobj = StringIO.StringIO(data)
self.assertRaises(AttributeError, getattr, fobj, "name")
tar = tarfile.open(fileobj=fobj, mode=self.mode)
self.assertEqual(tar.name, None)
def test_empty_name_attribute(self):
with open(self.tarname, "rb") as fobj:
data = fobj.read()
fobj = StringIO.StringIO(data)
fobj.name = ""
with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
self.assertEqual(tar.name, None)
def test_illegal_mode_arg(self):
with open(tmpname, 'wb'):
pass
self.addCleanup(os.unlink, tmpname)
with self.assertRaisesRegexp(ValueError, 'mode must be '):
tar = self.taropen(tmpname, 'q')
with self.assertRaisesRegexp(ValueError, 'mode must be '):
tar = self.taropen(tmpname, 'rw')
with self.assertRaisesRegexp(ValueError, 'mode must be '):
tar = self.taropen(tmpname, '')
def test_fileobj_with_offset(self):
# Skip the first member and store values from the second member
# of the testtar.
tar = tarfile.open(self.tarname, mode=self.mode)
try:
tar.next()
t = tar.next()
name = t.name
offset = t.offset
data = tar.extractfile(t).read()
finally:
tar.close()
# Open the testtar and seek to the offset of the second member.
if self.mode.endswith(":gz"):
_open = gzip.GzipFile
elif self.mode.endswith(":bz2"):
_open = bz2.BZ2File
else:
_open = open
fobj = _open(self.tarname, "rb")
try:
fobj.seek(offset)
# Test if the tarfile starts with the second member.
tar = tar.open(self.tarname, mode="r:", fileobj=fobj)
t = tar.next()
self.assertEqual(t.name, name)
# Read to the end of fileobj and test if seeking back to the
# beginning works.
tar.getmembers()
self.assertEqual(tar.extractfile(t).read(), data,
"seek back did not work")
tar.close()
finally:
fobj.close()
def test_fail_comp(self):
# For Gzip and Bz2 Tests: fail with a ReadError on an uncompressed file.
if self.mode == "r:":
self.skipTest('needs a gz or bz2 mode')
self.assertRaises(tarfile.ReadError, tarfile.open, tarname, self.mode)
with open(tarname, "rb") as fobj:
self.assertRaises(tarfile.ReadError, tarfile.open,
fileobj=fobj, mode=self.mode)
def test_v7_dirtype(self):
# Test old style dirtype member (bug #1336623):
# Old V7 tars create directory members using an AREGTYPE
# header with a "/" appended to the filename field.
tarinfo = self.tar.getmember("misc/dirtype-old-v7")
self.assertTrue(tarinfo.type == tarfile.DIRTYPE,
"v7 dirtype failed")
def test_xstar_type(self):
# The xstar format stores extra atime and ctime fields inside the
# space reserved for the prefix field. The prefix field must be
# ignored in this case, otherwise it will mess up the name.
try:
self.tar.getmember("misc/regtype-xstar")
except KeyError:
self.fail("failed to find misc/regtype-xstar (mangled prefix?)")
def test_check_members(self):
for tarinfo in self.tar:
self.assertTrue(int(tarinfo.mtime) == 07606136617,
"wrong mtime for %s" % tarinfo.name)
if not tarinfo.name.startswith("ustar/"):
continue
self.assertTrue(tarinfo.uname == "tarfile",
"wrong uname for %s" % tarinfo.name)
def test_find_members(self):
self.assertTrue(self.tar.getmembers()[-1].name == "misc/eof",
"could not find all members")
def test_extract_hardlink(self):
# Test hardlink extraction (e.g. bug #857297).
with tarfile.open(tarname, errorlevel=1, encoding="iso8859-1") as tar:
tar.extract("ustar/regtype", TEMPDIR)
self.addCleanup(test_support.unlink, os.path.join(TEMPDIR, "ustar/regtype"))
tar.extract("ustar/lnktype", TEMPDIR)
self.addCleanup(test_support.unlink, os.path.join(TEMPDIR, "ustar/lnktype"))
with open(os.path.join(TEMPDIR, "ustar/lnktype"), "rb") as f:
data = f.read()
self.assertEqual(md5sum(data), md5_regtype)
tar.extract("ustar/symtype", TEMPDIR)
self.addCleanup(test_support.unlink, os.path.join(TEMPDIR, "ustar/symtype"))
with open(os.path.join(TEMPDIR, "ustar/symtype"), "rb") as f:
data = f.read()
self.assertEqual(md5sum(data), md5_regtype)
def test_extractall(self):
# Test if extractall() correctly restores directory permissions
# and times (see issue1735).
tar = tarfile.open(tarname, encoding="iso8859-1")
try:
directories = [t for t in tar if t.isdir()]
tar.extractall(TEMPDIR, directories)
for tarinfo in directories:
path = os.path.join(TEMPDIR, tarinfo.name)
if sys.platform != "win32":
# Win32 has no support for fine grained permissions.
self.assertEqual(tarinfo.mode & 0777, os.stat(path).st_mode & 0777)
self.assertEqual(tarinfo.mtime, os.path.getmtime(path))
finally:
tar.close()
def test_init_close_fobj(self):
# Issue #7341: Close the internal file object in the TarFile
# constructor in case of an error. For the test we rely on
# the fact that opening an empty file raises a ReadError.
empty = os.path.join(TEMPDIR, "empty")
with open(empty, "wb") as fobj:
fobj.write("")
try:
tar = object.__new__(tarfile.TarFile)
try:
tar.__init__(empty)
except tarfile.ReadError:
self.assertTrue(tar.fileobj.closed)
else:
self.fail("ReadError not raised")
finally:
support.unlink(empty)
def test_parallel_iteration(self):
# Issue #16601: Restarting iteration over tarfile continued
# from where it left off.
with tarfile.open(self.tarname) as tar:
for m1, m2 in zip(tar, tar):
self.assertEqual(m1.offset, m2.offset)
self.assertEqual(m1.name, m2.name)
class StreamReadTest(CommonReadTest):
mode="r|"
def test_fileobj_regular_file(self):
tarinfo = self.tar.next() # get "regtype" (can't use getmember)
fobj = self.tar.extractfile(tarinfo)
data = fobj.read()
self.assertTrue((len(data), md5sum(data)) == (tarinfo.size, md5_regtype),
"regular file extraction failed")
def test_provoke_stream_error(self):
tarinfos = self.tar.getmembers()
f = self.tar.extractfile(tarinfos[0]) # read the first member
self.assertRaises(tarfile.StreamError, f.read)
def test_compare_members(self):
tar1 = tarfile.open(tarname, encoding="iso8859-1")
try:
tar2 = self.tar
while True:
t1 = tar1.next()
t2 = tar2.next()
if t1 is None:
break
self.assertTrue(t2 is not None, "stream.next() failed.")
if t2.islnk() or t2.issym():
self.assertRaises(tarfile.StreamError, tar2.extractfile, t2)
continue
v1 = tar1.extractfile(t1)
v2 = tar2.extractfile(t2)
if v1 is None:
continue
self.assertTrue(v2 is not None, "stream.extractfile() failed")
self.assertTrue(v1.read() == v2.read(), "stream extraction failed")
finally:
tar1.close()
class DetectReadTest(unittest.TestCase):
def _testfunc_file(self, name, mode):
try:
tar = tarfile.open(name, mode)
except tarfile.ReadError:
self.fail()
else:
tar.close()
def _testfunc_fileobj(self, name, mode):
try:
with open(name, "rb") as f:
tar = tarfile.open(name, mode, fileobj=f)
except tarfile.ReadError:
self.fail()
else:
tar.close()
def _test_modes(self, testfunc):
testfunc(tarname, "r")
testfunc(tarname, "r:")
testfunc(tarname, "r:*")
testfunc(tarname, "r|")
testfunc(tarname, "r|*")
if gzip:
self.assertRaises(tarfile.ReadError, tarfile.open, tarname, mode="r:gz")
self.assertRaises(tarfile.ReadError, tarfile.open, tarname, mode="r|gz")
self.assertRaises(tarfile.ReadError, tarfile.open, gzipname, mode="r:")
self.assertRaises(tarfile.ReadError, tarfile.open, gzipname, mode="r|")
testfunc(gzipname, "r")
testfunc(gzipname, "r:*")
testfunc(gzipname, "r:gz")
testfunc(gzipname, "r|*")
testfunc(gzipname, "r|gz")
if bz2:
self.assertRaises(tarfile.ReadError, tarfile.open, tarname, mode="r:bz2")
self.assertRaises(tarfile.ReadError, tarfile.open, tarname, mode="r|bz2")
self.assertRaises(tarfile.ReadError, tarfile.open, bz2name, mode="r:")
self.assertRaises(tarfile.ReadError, tarfile.open, bz2name, mode="r|")
testfunc(bz2name, "r")
testfunc(bz2name, "r:*")
testfunc(bz2name, "r:bz2")
testfunc(bz2name, "r|*")
testfunc(bz2name, "r|bz2")
def test_detect_file(self):
self._test_modes(self._testfunc_file)
def test_detect_fileobj(self):
self._test_modes(self._testfunc_fileobj)
@unittest.skipUnless(bz2, 'requires bz2')
def test_detect_stream_bz2(self):
# Originally, tarfile's stream detection looked for the string
# "BZh91" at the start of the file. This is incorrect because
# the '9' represents the blocksize (900kB). If the file was
# compressed using another blocksize autodetection fails.
with open(tarname, "rb") as fobj:
data = fobj.read()
# Compress with blocksize 100kB, the file starts with "BZh11".
with bz2.BZ2File(tmpname, "wb", compresslevel=1) as fobj:
fobj.write(data)
self._testfunc_file(tmpname, "r|*")
class MemberReadTest(ReadTest):
def _test_member(self, tarinfo, chksum=None, **kwargs):
if chksum is not None:
self.assertTrue(md5sum(self.tar.extractfile(tarinfo).read()) == chksum,
"wrong md5sum for %s" % tarinfo.name)
kwargs["mtime"] = 07606136617
kwargs["uid"] = 1000
kwargs["gid"] = 100
if "old-v7" not in tarinfo.name:
# V7 tar can't handle alphabetic owners.
kwargs["uname"] = "tarfile"
kwargs["gname"] = "tarfile"
for k, v in kwargs.iteritems():
self.assertTrue(getattr(tarinfo, k) == v,
"wrong value in %s field of %s" % (k, tarinfo.name))
def test_find_regtype(self):
tarinfo = self.tar.getmember("ustar/regtype")
self._test_member(tarinfo, size=7011, chksum=md5_regtype)
def test_find_conttype(self):
tarinfo = self.tar.getmember("ustar/conttype")
self._test_member(tarinfo, size=7011, chksum=md5_regtype)
def test_find_dirtype(self):
tarinfo = self.tar.getmember("ustar/dirtype")
self._test_member(tarinfo, size=0)
def test_find_dirtype_with_size(self):
tarinfo = self.tar.getmember("ustar/dirtype-with-size")
self._test_member(tarinfo, size=255)
def test_find_lnktype(self):
tarinfo = self.tar.getmember("ustar/lnktype")
self._test_member(tarinfo, size=0, linkname="ustar/regtype")
def test_find_symtype(self):
tarinfo = self.tar.getmember("ustar/symtype")
self._test_member(tarinfo, size=0, linkname="regtype")
def test_find_blktype(self):
tarinfo = self.tar.getmember("ustar/blktype")
self._test_member(tarinfo, size=0, devmajor=3, devminor=0)
def test_find_chrtype(self):
tarinfo = self.tar.getmember("ustar/chrtype")
self._test_member(tarinfo, size=0, devmajor=1, devminor=3)
def test_find_fifotype(self):
tarinfo = self.tar.getmember("ustar/fifotype")
self._test_member(tarinfo, size=0)
def test_find_sparse(self):
tarinfo = self.tar.getmember("ustar/sparse")
self._test_member(tarinfo, size=86016, chksum=md5_sparse)
def test_find_umlauts(self):
tarinfo = self.tar.getmember("ustar/umlauts-\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
self._test_member(tarinfo, size=7011, chksum=md5_regtype)
def test_find_ustar_longname(self):
name = "ustar/" + "12345/" * 39 + "1234567/longname"
self.assertIn(name, self.tar.getnames())
def test_find_regtype_oldv7(self):
tarinfo = self.tar.getmember("misc/regtype-old-v7")
self._test_member(tarinfo, size=7011, chksum=md5_regtype)
def test_find_pax_umlauts(self):
self.tar.close()
self.tar = tarfile.open(self.tarname, mode=self.mode, encoding="iso8859-1")
tarinfo = self.tar.getmember("pax/umlauts-\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
self._test_member(tarinfo, size=7011, chksum=md5_regtype)
class LongnameTest(ReadTest):
def test_read_longname(self):
# Test reading of longname (bug #1471427).
longname = self.subdir + "/" + "123/" * 125 + "longname"
try:
tarinfo = self.tar.getmember(longname)
except KeyError:
self.fail("longname not found")
self.assertTrue(tarinfo.type != tarfile.DIRTYPE, "read longname as dirtype")
def test_read_longlink(self):
longname = self.subdir + "/" + "123/" * 125 + "longname"
longlink = self.subdir + "/" + "123/" * 125 + "longlink"
try:
tarinfo = self.tar.getmember(longlink)
except KeyError:
self.fail("longlink not found")
self.assertTrue(tarinfo.linkname == longname, "linkname wrong")
def test_truncated_longname(self):
longname = self.subdir + "/" + "123/" * 125 + "longname"
tarinfo = self.tar.getmember(longname)
offset = tarinfo.offset
self.tar.fileobj.seek(offset)
fobj = StringIO.StringIO(self.tar.fileobj.read(3 * 512))
with self.assertRaises(tarfile.ReadError):
tarfile.open(name="foo.tar", fileobj=fobj)
def test_header_offset(self):
# Test if the start offset of the TarInfo object includes
# the preceding extended header.
longname = self.subdir + "/" + "123/" * 125 + "longname"
offset = self.tar.getmember(longname).offset
with open(tarname, "rb") as fobj:
fobj.seek(offset)
tarinfo = tarfile.TarInfo.frombuf(fobj.read(512))
self.assertEqual(tarinfo.type, self.longnametype)
class GNUReadTest(LongnameTest):
subdir = "gnu"
longnametype = tarfile.GNUTYPE_LONGNAME
def test_sparse_file(self):
tarinfo1 = self.tar.getmember("ustar/sparse")
fobj1 = self.tar.extractfile(tarinfo1)
tarinfo2 = self.tar.getmember("gnu/sparse")
fobj2 = self.tar.extractfile(tarinfo2)
self.assertTrue(fobj1.read() == fobj2.read(),
"sparse file extraction failed")
class PaxReadTest(LongnameTest):
subdir = "pax"
longnametype = tarfile.XHDTYPE
def test_pax_global_headers(self):
tar = tarfile.open(tarname, encoding="iso8859-1")
try:
tarinfo = tar.getmember("pax/regtype1")
self.assertEqual(tarinfo.uname, "foo")
self.assertEqual(tarinfo.gname, "bar")
self.assertEqual(tarinfo.pax_headers.get("VENDOR.umlauts"), u"\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
tarinfo = tar.getmember("pax/regtype2")
self.assertEqual(tarinfo.uname, "")
self.assertEqual(tarinfo.gname, "bar")
self.assertEqual(tarinfo.pax_headers.get("VENDOR.umlauts"), u"\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
tarinfo = tar.getmember("pax/regtype3")
self.assertEqual(tarinfo.uname, "tarfile")
self.assertEqual(tarinfo.gname, "tarfile")
self.assertEqual(tarinfo.pax_headers.get("VENDOR.umlauts"), u"\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
finally:
tar.close()
def test_pax_number_fields(self):
# All following number fields are read from the pax header.
tar = tarfile.open(tarname, encoding="iso8859-1")
try:
tarinfo = tar.getmember("pax/regtype4")
self.assertEqual(tarinfo.size, 7011)
self.assertEqual(tarinfo.uid, 123)
self.assertEqual(tarinfo.gid, 123)
self.assertEqual(tarinfo.mtime, 1041808783.0)
self.assertEqual(type(tarinfo.mtime), float)
self.assertEqual(float(tarinfo.pax_headers["atime"]), 1041808783.0)
self.assertEqual(float(tarinfo.pax_headers["ctime"]), 1041808783.0)
finally:
tar.close()
class WriteTestBase(unittest.TestCase):
# Put all write tests in here that are supposed to be tested
# in all possible mode combinations.
def test_fileobj_no_close(self):
fobj = StringIO.StringIO()
tar = tarfile.open(fileobj=fobj, mode=self.mode)
tar.addfile(tarfile.TarInfo("foo"))
tar.close()
self.assertTrue(fobj.closed is False, "external fileobjs must never closed")
# Issue #20238: Incomplete gzip output with mode="w:gz"
data = fobj.getvalue()
del tar
test_support.gc_collect()
self.assertFalse(fobj.closed)
self.assertEqual(data, fobj.getvalue())
class WriteTest(WriteTestBase):
mode = "w:"
def test_100_char_name(self):
# The name field in a tar header stores strings of at most 100 chars.
# If a string is shorter than 100 chars it has to be padded with '\0',
# which implies that a string of exactly 100 chars is stored without
# a trailing '\0'.
name = "0123456789" * 10
tar = tarfile.open(tmpname, self.mode)
try:
t = tarfile.TarInfo(name)
tar.addfile(t)
finally:
tar.close()
tar = tarfile.open(tmpname)
try:
self.assertTrue(tar.getnames()[0] == name,
"failed to store 100 char filename")
finally:
tar.close()
def test_tar_size(self):
# Test for bug #1013882.
tar = tarfile.open(tmpname, self.mode)
try:
path = os.path.join(TEMPDIR, "file")
with open(path, "wb") as fobj:
fobj.write("aaa")
tar.add(path)
finally:
tar.close()
self.assertTrue(os.path.getsize(tmpname) > 0,
"tarfile is empty")
# The test_*_size tests test for bug #1167128.
def test_file_size(self):
tar = tarfile.open(tmpname, self.mode)
try:
path = os.path.join(TEMPDIR, "file")
with open(path, "wb"):
pass
tarinfo = tar.gettarinfo(path)
self.assertEqual(tarinfo.size, 0)
with open(path, "wb") as fobj:
fobj.write("aaa")
tarinfo = tar.gettarinfo(path)
self.assertEqual(tarinfo.size, 3)
finally:
tar.close()
def test_directory_size(self):
path = os.path.join(TEMPDIR, "directory")
os.mkdir(path)
try:
tar = tarfile.open(tmpname, self.mode)
try:
tarinfo = tar.gettarinfo(path)
self.assertEqual(tarinfo.size, 0)
finally:
tar.close()
finally:
os.rmdir(path)
def test_link_size(self):
if hasattr(os, "link"):
link = os.path.join(TEMPDIR, "link")
target = os.path.join(TEMPDIR, "link_target")
with open(target, "wb") as fobj:
fobj.write("aaa")
os.link(target, link)
try:
tar = tarfile.open(tmpname, self.mode)
try:
# Record the link target in the inodes list.
tar.gettarinfo(target)
tarinfo = tar.gettarinfo(link)
self.assertEqual(tarinfo.size, 0)
finally:
tar.close()
finally:
os.remove(target)
os.remove(link)
def test_symlink_size(self):
if hasattr(os, "symlink"):
path = os.path.join(TEMPDIR, "symlink")
os.symlink("link_target", path)
try:
tar = tarfile.open(tmpname, self.mode)
try:
tarinfo = tar.gettarinfo(path)
self.assertEqual(tarinfo.size, 0)
finally:
tar.close()
finally:
os.remove(path)
def test_add_self(self):
# Test for #1257255.
dstname = os.path.abspath(tmpname)
tar = tarfile.open(tmpname, self.mode)
try:
self.assertTrue(tar.name == dstname, "archive name must be absolute")
tar.add(dstname)
self.assertTrue(tar.getnames() == [], "added the archive to itself")
cwd = os.getcwd()
os.chdir(TEMPDIR)
tar.add(dstname)
os.chdir(cwd)
self.assertTrue(tar.getnames() == [], "added the archive to itself")
finally:
tar.close()
def test_exclude(self):
tempdir = os.path.join(TEMPDIR, "exclude")
os.mkdir(tempdir)
try:
for name in ("foo", "bar", "baz"):
name = os.path.join(tempdir, name)
open(name, "wb").close()
exclude = os.path.isfile
tar = tarfile.open(tmpname, self.mode, encoding="iso8859-1")
try:
with test_support.check_warnings(("use the filter argument",
DeprecationWarning)):
tar.add(tempdir, arcname="empty_dir", exclude=exclude)
finally:
tar.close()
tar = tarfile.open(tmpname, "r")
try:
self.assertEqual(len(tar.getmembers()), 1)
self.assertEqual(tar.getnames()[0], "empty_dir")
finally:
tar.close()
finally:
shutil.rmtree(tempdir)
def test_filter(self):
tempdir = os.path.join(TEMPDIR, "filter")
os.mkdir(tempdir)
try:
for name in ("foo", "bar", "baz"):
name = os.path.join(tempdir, name)
open(name, "wb").close()
def filter(tarinfo):
if os.path.basename(tarinfo.name) == "bar":
return
tarinfo.uid = 123
tarinfo.uname = "foo"
return tarinfo
tar = tarfile.open(tmpname, self.mode, encoding="iso8859-1")
try:
tar.add(tempdir, arcname="empty_dir", filter=filter)
finally:
tar.close()
tar = tarfile.open(tmpname, "r")
try:
for tarinfo in tar:
self.assertEqual(tarinfo.uid, 123)
self.assertEqual(tarinfo.uname, "foo")
self.assertEqual(len(tar.getmembers()), 3)
finally:
tar.close()
finally:
shutil.rmtree(tempdir)
# Guarantee that stored pathnames are not modified. Don't
# remove ./ or ../ or double slashes. Still make absolute
# pathnames relative.
# For details see bug #6054.
def _test_pathname(self, path, cmp_path=None, dir=False):
# Create a tarfile with an empty member named path
# and compare the stored name with the original.
foo = os.path.join(TEMPDIR, "foo")
if not dir:
open(foo, "w").close()
else:
os.mkdir(foo)
tar = tarfile.open(tmpname, self.mode)
try:
tar.add(foo, arcname=path)
finally:
tar.close()
tar = tarfile.open(tmpname, "r")
try:
t = tar.next()
finally:
tar.close()
if not dir:
os.remove(foo)
else:
os.rmdir(foo)
self.assertEqual(t.name, cmp_path or path.replace(os.sep, "/"))
def test_pathnames(self):
self._test_pathname("foo")
self._test_pathname(os.path.join("foo", ".", "bar"))
self._test_pathname(os.path.join("foo", "..", "bar"))
self._test_pathname(os.path.join(".", "foo"))
self._test_pathname(os.path.join(".", "foo", "."))
self._test_pathname(os.path.join(".", "foo", ".", "bar"))
self._test_pathname(os.path.join(".", "foo", "..", "bar"))
self._test_pathname(os.path.join(".", "foo", "..", "bar"))
self._test_pathname(os.path.join("..", "foo"))
self._test_pathname(os.path.join("..", "foo", ".."))
self._test_pathname(os.path.join("..", "foo", ".", "bar"))
self._test_pathname(os.path.join("..", "foo", "..", "bar"))
self._test_pathname("foo" + os.sep + os.sep + "bar")
self._test_pathname("foo" + os.sep + os.sep, "foo", dir=True)
def test_abs_pathnames(self):
if sys.platform == "win32":
self._test_pathname("C:\\foo", "foo")
else:
self._test_pathname("/foo", "foo")
self._test_pathname("///foo", "foo")
def test_cwd(self):
# Test adding the current working directory.
with support.change_cwd(TEMPDIR):
tar = tarfile.open(tmpname, self.mode)
try:
tar.add(".")
finally:
tar.close()
tar = tarfile.open(tmpname, "r")
try:
for t in tar:
self.assertTrue(t.name == "." or t.name.startswith("./"))
finally:
tar.close()
@unittest.skipUnless(hasattr(os, 'symlink'), "needs os.symlink")
def test_extractall_symlinks(self):
# Test if extractall works properly when tarfile contains symlinks
tempdir = os.path.join(TEMPDIR, "testsymlinks")
temparchive = os.path.join(TEMPDIR, "testsymlinks.tar")
os.mkdir(tempdir)
try:
source_file = os.path.join(tempdir,'source')
target_file = os.path.join(tempdir,'symlink')
with open(source_file,'w') as f:
f.write('something\n')
os.symlink(source_file, target_file)
tar = tarfile.open(temparchive,'w')
tar.add(source_file, arcname=os.path.basename(source_file))
tar.add(target_file, arcname=os.path.basename(target_file))
tar.close()
# Let's extract it to the location which contains the symlink
tar = tarfile.open(temparchive,'r')
# this should not raise OSError: [Errno 17] File exists
try:
tar.extractall(path=tempdir)
except OSError:
self.fail("extractall failed with symlinked files")
finally:
tar.close()
finally:
os.unlink(temparchive)
shutil.rmtree(tempdir)
@unittest.skipUnless(hasattr(os, 'symlink'), "needs os.symlink")
def test_extractall_broken_symlinks(self):
# Test if extractall works properly when tarfile contains broken
# symlinks
tempdir = os.path.join(TEMPDIR, "testsymlinks")
temparchive = os.path.join(TEMPDIR, "testsymlinks.tar")
os.mkdir(tempdir)
try:
source_file = os.path.join(tempdir,'source')
target_file = os.path.join(tempdir,'symlink')
with open(source_file,'w') as f:
f.write('something\n')
os.symlink(source_file, target_file)
tar = tarfile.open(temparchive,'w')
tar.add(target_file, arcname=os.path.basename(target_file))
tar.close()
# remove the real file
os.unlink(source_file)
# Let's extract it to the location which contains the symlink
tar = tarfile.open(temparchive,'r')
# this should not raise OSError: [Errno 17] File exists
try:
tar.extractall(path=tempdir)
except OSError:
self.fail("extractall failed with broken symlinked files")
finally:
tar.close()
finally:
os.unlink(temparchive)
shutil.rmtree(tempdir)
@unittest.skipUnless(hasattr(os, 'link'), "needs os.link")
def test_extractall_hardlinks(self):
# Test if extractall works properly when tarfile contains symlinks
tempdir = os.path.join(TEMPDIR, "testsymlinks")
temparchive = os.path.join(TEMPDIR, "testsymlinks.tar")
os.mkdir(tempdir)
try:
source_file = os.path.join(tempdir,'source')
target_file = os.path.join(tempdir,'symlink')
with open(source_file,'w') as f:
f.write('something\n')
os.link(source_file, target_file)
tar = tarfile.open(temparchive,'w')
tar.add(source_file, arcname=os.path.basename(source_file))
tar.add(target_file, arcname=os.path.basename(target_file))
tar.close()
# Let's extract it to the location which contains the symlink
tar = tarfile.open(temparchive,'r')
# this should not raise OSError: [Errno 17] File exists
try:
tar.extractall(path=tempdir)
except OSError:
self.fail("extractall failed with linked files")
finally:
tar.close()
finally:
os.unlink(temparchive)
shutil.rmtree(tempdir)
def test_open_nonwritable_fileobj(self):
for exctype in IOError, EOFError, RuntimeError:
class BadFile(StringIO.StringIO):
first = True
def write(self, data):
if self.first:
self.first = False
raise exctype
f = BadFile()
with self.assertRaises(exctype):
tar = tarfile.open(tmpname, self.mode, fileobj=f,
format=tarfile.PAX_FORMAT,
pax_headers={'non': 'empty'})
self.assertFalse(f.closed)
class StreamWriteTest(WriteTestBase):
mode = "w|"
def test_stream_padding(self):
# Test for bug #1543303.
tar = tarfile.open(tmpname, self.mode)
tar.close()
if self.mode.endswith("gz"):
with gzip.GzipFile(tmpname) as fobj:
data = fobj.read()
elif self.mode.endswith("bz2"):
dec = bz2.BZ2Decompressor()
with open(tmpname, "rb") as fobj:
data = fobj.read()
data = dec.decompress(data)
self.assertTrue(len(dec.unused_data) == 0,
"found trailing data")
else:
with open(tmpname, "rb") as fobj:
data = fobj.read()
self.assertTrue(data.count("\0") == tarfile.RECORDSIZE,
"incorrect zero padding")
@unittest.skipIf(sys.platform == 'win32', 'not appropriate for Windows')
@unittest.skipUnless(hasattr(os, 'umask'), 'requires os.umask')
def test_file_mode(self):
# Test for issue #8464: Create files with correct
# permissions.
if os.path.exists(tmpname):
os.remove(tmpname)
original_umask = os.umask(0022)
try:
tar = tarfile.open(tmpname, self.mode)
tar.close()
mode = os.stat(tmpname).st_mode & 0777
self.assertEqual(mode, 0644, "wrong file permissions")
finally:
os.umask(original_umask)
def test_issue13639(self):
try:
with tarfile.open(unicode(tmpname, sys.getfilesystemencoding()), self.mode):
pass
except UnicodeDecodeError:
self.fail("_Stream failed to write unicode filename")
class GNUWriteTest(unittest.TestCase):
# This testcase checks for correct creation of GNU Longname
# and Longlink extended headers (cp. bug #812325).
def _length(self, s):
blocks, remainder = divmod(len(s) + 1, 512)
if remainder:
blocks += 1
return blocks * 512
def _calc_size(self, name, link=None):
# Initial tar header
count = 512
if len(name) > tarfile.LENGTH_NAME:
# GNU longname extended header + longname
count += 512
count += self._length(name)
if link is not None and len(link) > tarfile.LENGTH_LINK:
# GNU longlink extended header + longlink
count += 512
count += self._length(link)
return count
def _test(self, name, link=None):
tarinfo = tarfile.TarInfo(name)
if link:
tarinfo.linkname = link
tarinfo.type = tarfile.LNKTYPE
tar = tarfile.open(tmpname, "w")
try:
tar.format = tarfile.GNU_FORMAT
tar.addfile(tarinfo)
v1 = self._calc_size(name, link)
v2 = tar.offset
self.assertTrue(v1 == v2, "GNU longname/longlink creation failed")
finally:
tar.close()
tar = tarfile.open(tmpname)
try:
member = tar.next()
self.assertIsNotNone(member,
"unable to read longname member")
self.assertEqual(tarinfo.name, member.name,
"unable to read longname member")
self.assertEqual(tarinfo.linkname, member.linkname,
"unable to read longname member")
finally:
tar.close()
def test_longname_1023(self):
self._test(("longnam/" * 127) + "longnam")
def test_longname_1024(self):
self._test(("longnam/" * 127) + "longname")
def test_longname_1025(self):
self._test(("longnam/" * 127) + "longname_")
def test_longlink_1023(self):
self._test("name", ("longlnk/" * 127) + "longlnk")
def test_longlink_1024(self):
self._test("name", ("longlnk/" * 127) + "longlink")
def test_longlink_1025(self):
self._test("name", ("longlnk/" * 127) + "longlink_")
def test_longnamelink_1023(self):
self._test(("longnam/" * 127) + "longnam",
("longlnk/" * 127) + "longlnk")
def test_longnamelink_1024(self):
self._test(("longnam/" * 127) + "longname",
("longlnk/" * 127) + "longlink")
def test_longnamelink_1025(self):
self._test(("longnam/" * 127) + "longname_",
("longlnk/" * 127) + "longlink_")
class HardlinkTest(unittest.TestCase):
# Test the creation of LNKTYPE (hardlink) members in an archive.
def setUp(self):
self.foo = os.path.join(TEMPDIR, "foo")
self.bar = os.path.join(TEMPDIR, "bar")
with open(self.foo, "wb") as fobj:
fobj.write("foo")
os.link(self.foo, self.bar)
self.tar = tarfile.open(tmpname, "w")
self.tar.add(self.foo)
def tearDown(self):
self.tar.close()
support.unlink(self.foo)
support.unlink(self.bar)
def test_add_twice(self):
# The same name will be added as a REGTYPE every
# time regardless of st_nlink.
tarinfo = self.tar.gettarinfo(self.foo)
self.assertTrue(tarinfo.type == tarfile.REGTYPE,
"add file as regular failed")
def test_add_hardlink(self):
tarinfo = self.tar.gettarinfo(self.bar)
self.assertTrue(tarinfo.type == tarfile.LNKTYPE,
"add file as hardlink failed")
def test_dereference_hardlink(self):
self.tar.dereference = True
tarinfo = self.tar.gettarinfo(self.bar)
self.assertTrue(tarinfo.type == tarfile.REGTYPE,
"dereferencing hardlink failed")
class PaxWriteTest(GNUWriteTest):
def _test(self, name, link=None):
# See GNUWriteTest.
tarinfo = tarfile.TarInfo(name)
if link:
tarinfo.linkname = link
tarinfo.type = tarfile.LNKTYPE
tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT)
try:
tar.addfile(tarinfo)
finally:
tar.close()
tar = tarfile.open(tmpname)
try:
if link:
l = tar.getmembers()[0].linkname
self.assertTrue(link == l, "PAX longlink creation failed")
else:
n = tar.getmembers()[0].name
self.assertTrue(name == n, "PAX longname creation failed")
finally:
tar.close()
def test_pax_global_header(self):
pax_headers = {
u"foo": u"bar",
u"uid": u"0",
u"mtime": u"1.23",
u"test": u"\xe4\xf6\xfc",
u"\xe4\xf6\xfc": u"test"}
tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT,
pax_headers=pax_headers)
try:
tar.addfile(tarfile.TarInfo("test"))
finally:
tar.close()
# Test if the global header was written correctly.
tar = tarfile.open(tmpname, encoding="iso8859-1")
try:
self.assertEqual(tar.pax_headers, pax_headers)
self.assertEqual(tar.getmembers()[0].pax_headers, pax_headers)
# Test if all the fields are unicode.
for key, val in tar.pax_headers.iteritems():
self.assertTrue(type(key) is unicode)
self.assertTrue(type(val) is unicode)
if key in tarfile.PAX_NUMBER_FIELDS:
try:
tarfile.PAX_NUMBER_FIELDS[key](val)
except (TypeError, ValueError):
self.fail("unable to convert pax header field")
finally:
tar.close()
def test_pax_extended_header(self):
# The fields from the pax header have priority over the
# TarInfo.
pax_headers = {u"path": u"foo", u"uid": u"123"}
tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT, encoding="iso8859-1")
try:
t = tarfile.TarInfo()
t.name = u"\xe4\xf6\xfc" # non-ASCII
t.uid = 8**8 # too large
t.pax_headers = pax_headers
tar.addfile(t)
finally:
tar.close()
tar = tarfile.open(tmpname, encoding="iso8859-1")
try:
t = tar.getmembers()[0]
self.assertEqual(t.pax_headers, pax_headers)
self.assertEqual(t.name, "foo")
self.assertEqual(t.uid, 123)
finally:
tar.close()
class UstarUnicodeTest(unittest.TestCase):
# All *UnicodeTests FIXME
format = tarfile.USTAR_FORMAT
def test_iso8859_1_filename(self):
self._test_unicode_filename("iso8859-1")
def test_utf7_filename(self):
self._test_unicode_filename("utf7")
def test_utf8_filename(self):
self._test_unicode_filename("utf8")
def _test_unicode_filename(self, encoding):
tar = tarfile.open(tmpname, "w", format=self.format, encoding=encoding, errors="strict")
try:
name = u"\xe4\xf6\xfc"
tar.addfile(tarfile.TarInfo(name))
finally:
tar.close()
tar = tarfile.open(tmpname, encoding=encoding)
try:
self.assertTrue(type(tar.getnames()[0]) is not unicode)
self.assertEqual(tar.getmembers()[0].name, name.encode(encoding))
finally:
tar.close()
def test_unicode_filename_error(self):
tar = tarfile.open(tmpname, "w", format=self.format, encoding="ascii", errors="strict")
try:
tarinfo = tarfile.TarInfo()
tarinfo.name = "\xe4\xf6\xfc"
if self.format == tarfile.PAX_FORMAT:
self.assertRaises(UnicodeError, tar.addfile, tarinfo)
else:
tar.addfile(tarinfo)
tarinfo.name = u"\xe4\xf6\xfc"
self.assertRaises(UnicodeError, tar.addfile, tarinfo)
tarinfo.name = "foo"
tarinfo.uname = u"\xe4\xf6\xfc"
self.assertRaises(UnicodeError, tar.addfile, tarinfo)
finally:
tar.close()
def test_unicode_argument(self):
tar = tarfile.open(tarname, "r", encoding="iso8859-1", errors="strict")
try:
for t in tar:
self.assertTrue(type(t.name) is str)
self.assertTrue(type(t.linkname) is str)
self.assertTrue(type(t.uname) is str)
self.assertTrue(type(t.gname) is str)
finally:
tar.close()
def test_uname_unicode(self):
for name in (u"\xe4\xf6\xfc", "\xe4\xf6\xfc"):
t = tarfile.TarInfo("foo")
t.uname = name
t.gname = name
fobj = StringIO.StringIO()
tar = tarfile.open("foo.tar", mode="w", fileobj=fobj, format=self.format, encoding="iso8859-1")
try:
tar.addfile(t)
finally:
tar.close()
fobj.seek(0)
tar = tarfile.open("foo.tar", fileobj=fobj, encoding="iso8859-1")
t = tar.getmember("foo")
self.assertEqual(t.uname, "\xe4\xf6\xfc")
self.assertEqual(t.gname, "\xe4\xf6\xfc")
class GNUUnicodeTest(UstarUnicodeTest):
format = tarfile.GNU_FORMAT
class PaxUnicodeTest(UstarUnicodeTest):
format = tarfile.PAX_FORMAT
def _create_unicode_name(self, name):
tar = tarfile.open(tmpname, "w", format=self.format)
t = tarfile.TarInfo()
t.pax_headers["path"] = name
tar.addfile(t)
tar.close()
def test_error_handlers(self):
# Test if the unicode error handlers work correctly for characters
# that cannot be expressed in a given encoding.
self._create_unicode_name(u"\xe4\xf6\xfc")
for handler, name in (("utf-8", u"\xe4\xf6\xfc".encode("utf8")),
("replace", "???"), ("ignore", "")):
tar = tarfile.open(tmpname, format=self.format, encoding="ascii",
errors=handler)
self.assertEqual(tar.getnames()[0], name)
tar.close()
self.assertRaises(UnicodeError, tarfile.open, tmpname,
encoding="ascii", errors="strict")
def test_error_handler_utf8(self):
# Create a pathname that has one component representable using
# iso8859-1 and the other only in iso8859-15.
self._create_unicode_name(u"\xe4\xf6\xfc/\u20ac")
tar = tarfile.open(tmpname, format=self.format, encoding="iso8859-1",
errors="utf-8")
self.assertEqual(tar.getnames()[0], "\xe4\xf6\xfc/" + u"\u20ac".encode("utf8"))
tar.close()
class AppendTest(unittest.TestCase):
# Test append mode (cp. patch #1652681).
def setUp(self):
self.tarname = tmpname
if os.path.exists(self.tarname):
test_support.unlink(self.tarname)
def _add_testfile(self, fileobj=None):
with tarfile.open(self.tarname, "a", fileobj=fileobj) as tar:
tar.addfile(tarfile.TarInfo("bar"))
def _create_testtar(self, mode="w:"):
with tarfile.open(tarname, encoding="iso8859-1") as src:
t = src.getmember("ustar/regtype")
t.name = "foo"
f = src.extractfile(t)
with tarfile.open(self.tarname, mode) as tar:
tar.addfile(t, f)
def _test(self, names=["bar"], fileobj=None):
with tarfile.open(self.tarname, fileobj=fileobj) as tar:
self.assertEqual(tar.getnames(), names)
def test_non_existing(self):
self._add_testfile()
self._test()
def test_empty(self):
tarfile.open(self.tarname, "w:").close()
self._add_testfile()
self._test()
def test_empty_fileobj(self):
fobj = StringIO.StringIO("\0" * 1024)
self._add_testfile(fobj)
fobj.seek(0)
self._test(fileobj=fobj)
def test_fileobj(self):
self._create_testtar()
with open(self.tarname) as fobj:
data = fobj.read()
fobj = StringIO.StringIO(data)
self._add_testfile(fobj)
fobj.seek(0)
self._test(names=["foo", "bar"], fileobj=fobj)
def test_existing(self):
self._create_testtar()
self._add_testfile()
self._test(names=["foo", "bar"])
@unittest.skipUnless(gzip, 'requires gzip')
def test_append_gz(self):
self._create_testtar("w:gz")
self.assertRaises(tarfile.ReadError, tarfile.open, tmpname, "a")
@unittest.skipUnless(bz2, 'requires bz2')
def test_append_bz2(self):
self._create_testtar("w:bz2")
self.assertRaises(tarfile.ReadError, tarfile.open, tmpname, "a")
# Append mode is supposed to fail if the tarfile to append to
# does not end with a zero block.
def _test_error(self, data):
with open(self.tarname, "wb") as fobj:
fobj.write(data)
self.assertRaises(tarfile.ReadError, self._add_testfile)
def test_null(self):
self._test_error("")
def test_incomplete(self):
self._test_error("\0" * 13)
def test_premature_eof(self):
data = tarfile.TarInfo("foo").tobuf()
self._test_error(data)
def test_trailing_garbage(self):
data = tarfile.TarInfo("foo").tobuf()
self._test_error(data + "\0" * 13)
def test_invalid(self):
self._test_error("a" * 512)
class LimitsTest(unittest.TestCase):
def test_ustar_limits(self):
# 100 char name
tarinfo = tarfile.TarInfo("0123456789" * 10)
tarinfo.tobuf(tarfile.USTAR_FORMAT)
# 101 char name that cannot be stored
tarinfo = tarfile.TarInfo("0123456789" * 10 + "0")
self.assertRaises(ValueError, tarinfo.tobuf, tarfile.USTAR_FORMAT)
# 256 char name with a slash at pos 156
tarinfo = tarfile.TarInfo("123/" * 62 + "longname")
tarinfo.tobuf(tarfile.USTAR_FORMAT)
# 256 char name that cannot be stored
tarinfo = tarfile.TarInfo("1234567/" * 31 + "longname")
self.assertRaises(ValueError, tarinfo.tobuf, tarfile.USTAR_FORMAT)
# 512 char name
tarinfo = tarfile.TarInfo("123/" * 126 + "longname")
self.assertRaises(ValueError, tarinfo.tobuf, tarfile.USTAR_FORMAT)
# 512 char linkname
tarinfo = tarfile.TarInfo("longlink")
tarinfo.linkname = "123/" * 126 + "longname"
self.assertRaises(ValueError, tarinfo.tobuf, tarfile.USTAR_FORMAT)
# uid > 8 digits
tarinfo = tarfile.TarInfo("name")
tarinfo.uid = 010000000
self.assertRaises(ValueError, tarinfo.tobuf, tarfile.USTAR_FORMAT)
def test_gnu_limits(self):
tarinfo = tarfile.TarInfo("123/" * 126 + "longname")
tarinfo.tobuf(tarfile.GNU_FORMAT)
tarinfo = tarfile.TarInfo("longlink")
tarinfo.linkname = "123/" * 126 + "longname"
tarinfo.tobuf(tarfile.GNU_FORMAT)
# uid >= 256 ** 7
tarinfo = tarfile.TarInfo("name")
tarinfo.uid = 04000000000000000000L
self.assertRaises(ValueError, tarinfo.tobuf, tarfile.GNU_FORMAT)
def test_pax_limits(self):
tarinfo = tarfile.TarInfo("123/" * 126 + "longname")
tarinfo.tobuf(tarfile.PAX_FORMAT)
tarinfo = tarfile.TarInfo("longlink")
tarinfo.linkname = "123/" * 126 + "longname"
tarinfo.tobuf(tarfile.PAX_FORMAT)
tarinfo = tarfile.TarInfo("name")
tarinfo.uid = 04000000000000000000L
tarinfo.tobuf(tarfile.PAX_FORMAT)
class MiscTest(unittest.TestCase):
def test_read_number_fields(self):
# Issue 24514: Test if empty number fields are converted to zero.
self.assertEqual(tarfile.nti("\0"), 0)
self.assertEqual(tarfile.nti(" \0"), 0)
class ContextManagerTest(unittest.TestCase):
def test_basic(self):
with tarfile.open(tarname) as tar:
self.assertFalse(tar.closed, "closed inside runtime context")
self.assertTrue(tar.closed, "context manager failed")
def test_closed(self):
# The __enter__() method is supposed to raise IOError
# if the TarFile object is already closed.
tar = tarfile.open(tarname)
tar.close()
with self.assertRaises(IOError):
with tar:
pass
def test_exception(self):
# Test if the IOError exception is passed through properly.
with self.assertRaises(Exception) as exc:
with tarfile.open(tarname) as tar:
raise IOError
self.assertIsInstance(exc.exception, IOError,
"wrong exception raised in context manager")
self.assertTrue(tar.closed, "context manager failed")
def test_no_eof(self):
# __exit__() must not write end-of-archive blocks if an
# exception was raised.
try:
with tarfile.open(tmpname, "w") as tar:
raise Exception
except:
pass
self.assertEqual(os.path.getsize(tmpname), 0,
"context manager wrote an end-of-archive block")
self.assertTrue(tar.closed, "context manager failed")
def test_eof(self):
# __exit__() must write end-of-archive blocks, i.e. call
# TarFile.close() if there was no error.
with tarfile.open(tmpname, "w"):
pass
self.assertNotEqual(os.path.getsize(tmpname), 0,
"context manager wrote no end-of-archive block")
def test_fileobj(self):
# Test that __exit__() did not close the external file
# object.
with open(tmpname, "wb") as fobj:
try:
with tarfile.open(fileobj=fobj, mode="w") as tar:
raise Exception
except:
pass
self.assertFalse(fobj.closed, "external file object was closed")
self.assertTrue(tar.closed, "context manager failed")
class LinkEmulationTest(ReadTest):
# Test for issue #8741 regression. On platforms that do not support
# symbolic or hard links tarfile tries to extract these types of members as
# the regular files they point to.
def _test_link_extraction(self, name):
self.tar.extract(name, TEMPDIR)
with open(os.path.join(TEMPDIR, name), "rb") as f:
data = f.read()
self.assertEqual(md5sum(data), md5_regtype)
def test_hardlink_extraction1(self):
self._test_link_extraction("ustar/lnktype")
def test_hardlink_extraction2(self):
self._test_link_extraction("./ustar/linktest2/lnktype")
def test_symlink_extraction1(self):
self._test_link_extraction("ustar/symtype")
def test_symlink_extraction2(self):
self._test_link_extraction("./ustar/linktest2/symtype")
class GzipMiscReadTest(MiscReadTest):
tarname = gzipname
mode = "r:gz"
taropen = tarfile.TarFile.gzopen
class GzipUstarReadTest(UstarReadTest):
tarname = gzipname
mode = "r:gz"
class GzipStreamReadTest(StreamReadTest):
tarname = gzipname
mode = "r|gz"
class GzipWriteTest(WriteTest):
mode = "w:gz"
class GzipStreamWriteTest(StreamWriteTest):
mode = "w|gz"
class Bz2MiscReadTest(MiscReadTest):
tarname = bz2name
mode = "r:bz2"
taropen = tarfile.TarFile.bz2open
class Bz2UstarReadTest(UstarReadTest):
tarname = bz2name
mode = "r:bz2"
class Bz2StreamReadTest(StreamReadTest):
tarname = bz2name
mode = "r|bz2"
class Bz2WriteTest(WriteTest):
mode = "w:bz2"
class Bz2StreamWriteTest(StreamWriteTest):
mode = "w|bz2"
class Bz2PartialReadTest(unittest.TestCase):
# Issue5068: The _BZ2Proxy.read() method loops forever
# on an empty or partial bzipped file.
def _test_partial_input(self, mode):
class MyStringIO(StringIO.StringIO):
hit_eof = False
def read(self, n):
if self.hit_eof:
raise AssertionError("infinite loop detected in tarfile.open()")
self.hit_eof = self.pos == self.len
return StringIO.StringIO.read(self, n)
def seek(self, *args):
self.hit_eof = False
return StringIO.StringIO.seek(self, *args)
data = bz2.compress(tarfile.TarInfo("foo").tobuf())
for x in range(len(data) + 1):
try:
tarfile.open(fileobj=MyStringIO(data[:x]), mode=mode)
except tarfile.ReadError:
pass # we have no interest in ReadErrors
def test_partial_input(self):
self._test_partial_input("r")
def test_partial_input_bz2(self):
self._test_partial_input("r:bz2")
def test_main():
support.unlink(TEMPDIR)
os.makedirs(TEMPDIR)
tests = [
UstarReadTest,
MiscReadTest,
StreamReadTest,
DetectReadTest,
MemberReadTest,
GNUReadTest,
PaxReadTest,
ListTest,
WriteTest,
StreamWriteTest,
GNUWriteTest,
PaxWriteTest,
UstarUnicodeTest,
GNUUnicodeTest,
PaxUnicodeTest,
AppendTest,
LimitsTest,
MiscTest,
ContextManagerTest,
]
if hasattr(os, "link"):
tests.append(HardlinkTest)
else:
tests.append(LinkEmulationTest)
with open(tarname, "rb") as fobj:
data = fobj.read()
if gzip:
# Create testtar.tar.gz and add gzip-specific tests.
support.unlink(gzipname)
with gzip.open(gzipname, "wb") as tar:
tar.write(data)
tests += [
GzipMiscReadTest,
GzipUstarReadTest,
GzipStreamReadTest,
GzipListTest,
GzipWriteTest,
GzipStreamWriteTest,
]
if bz2:
# Create testtar.tar.bz2 and add bz2-specific tests.
support.unlink(bz2name)
tar = bz2.BZ2File(bz2name, "wb")
try:
tar.write(data)
finally:
tar.close()
tests += [
Bz2MiscReadTest,
Bz2UstarReadTest,
Bz2StreamReadTest,
Bz2ListTest,
Bz2WriteTest,
Bz2StreamWriteTest,
Bz2PartialReadTest,
]
try:
test_support.run_unittest(*tests)
finally:
if os.path.exists(TEMPDIR):
shutil.rmtree(TEMPDIR)
if __name__ == "__main__":
test_main()
| {
"pile_set_name": "Github"
} |
import os
from cudatext import *
import cudatext_cmd as cmds
fn_ini = os.path.join(app_path(APP_DIR_SETTINGS), 'plugins.ini')
W_all = 650
H_all = 500
class DialogEmmet:
def __init__(self, do_expand, do_insert):
self.do_expand = do_expand
self.do_insert = do_insert
self.h = dlg_proc(0, DLG_CREATE)
dlg_proc(self.h, DLG_PROP_SET, prop={
'w': W_all,
'h': H_all,
'cap': 'Emmet preview dialog',
'border': DBORDER_SIZE,
'w_min': 300,
'h_min': 150,
})
n = dlg_proc(self.h, DLG_CTL_ADD, prop='label')
dlg_proc(self.h, DLG_CTL_PROP_SET, index=n, prop={
'name': 'label1',
'cap': 'Abbreviation:',
'x': 6,
'y': 6,
})
n = dlg_proc(self.h, DLG_CTL_ADD, prop='button')
dlg_proc(self.h, DLG_CTL_PROP_SET, index=n, prop={
'name': 'btn_ok',
'y': 26,
'w': 90,
'a_r': ('', ']'),
'a_l': None,
'sp_r': 6,
'cap': 'Insert',
'ex0': True, #default for Enter
'on_change': self.on_ok_click,
})
n = dlg_proc(self.h, DLG_CTL_ADD, prop='button')
dlg_proc(self.h, DLG_CTL_PROP_SET, index=n, prop={
'name': 'btn_copy',
'a_l': ('btn_ok', '['),
'a_r': ('btn_ok', ']'),
'a_t': ('btn_ok', ']'),
'sp_t': 6,
'cap': 'Copy',
'on_change': self.on_copy_click,
})
n = dlg_proc(self.h, DLG_CTL_ADD, prop='edit')
dlg_proc(self.h, DLG_CTL_PROP_SET, index=n, prop={
'name': 'input',
'x': 6,
'y': 26,
'a_r': ('btn_ok', '['),
'sp_r': 6,
'act': True,
'on_change': self.on_edit_change,
'tab_order': 0,
})
n = dlg_proc(self.h, DLG_CTL_ADD, prop='memo')
dlg_proc(self.h, DLG_CTL_PROP_SET, index=n, prop={
'name': 'preview',
'ex0': True, #read only
'a_l': ('', '['),
'a_t': ('input', ']'),
'a_r': ('input', ']'),
'a_b': ('', ']'),
'sp_t': 6,
'sp_b': 6,
'sp_l': 6,
})
def result(self, no_stops):
text = dlg_proc(self.h, DLG_CTL_PROP_GET, name='input')['val']
if text:
text = self.do_expand(text)
if text and no_stops:
for i in range(10):
text = text.replace('${%d}'%i, '')
return text
def on_edit_change(self, id_dlg, id_ctl, data='', info=''):
text = self.result(False) # better keep tabstops
if text:
s = text.replace('\t', ' ')
s = s.split('\n')
s = '\t'.join(s)
dlg_proc(self.h, DLG_CTL_PROP_SET, name='preview', prop={
'val': s,
})
def on_ok_click(self, id_dlg, id_ctl, data='', info=''):
text = self.result(False)
dlg_proc(self.h, DLG_HIDE)
if text:
self.do_insert(text)
def on_copy_click(self, id_dlg, id_ctl, data='', info=''):
text = self.result(True)
if text:
app_proc(PROC_SET_CLIP, text)
def show(self):
dlg_proc(self.h, DLG_CTL_FOCUS, name='input')
self.pos_load()
self.on_edit_change(0, 0)
dlg_proc(self.h, DLG_SHOW_MODAL)
self.pos_save()
def close(self):
dlg_proc(self.h, DLG_HIDE)
def pos_load(self):
x = int(ini_read(fn_ini, 'emmet', 'x', '-1'))
y = int(ini_read(fn_ini, 'emmet', 'y', '-1'))
w = int(ini_read(fn_ini, 'emmet', 'w', '-1'))
h = int(ini_read(fn_ini, 'emmet', 'h', '-1'))
if x<0: return
dlg_proc(self.h, DLG_PROP_SET, prop={'x':x, 'y':y, 'w':w, 'h':h, })
def pos_save(self):
prop = dlg_proc(self.h, DLG_PROP_GET)
if not prop: return
x = prop['x']
y = prop['y']
w = prop['w']
h = prop['h']
ini_write(fn_ini, 'emmet', 'x', str(x))
ini_write(fn_ini, 'emmet', 'y', str(y))
ini_write(fn_ini, 'emmet', 'w', str(w))
ini_write(fn_ini, 'emmet', 'h', str(h))
| {
"pile_set_name": "Github"
} |
"""@package docstring
Provides the models used by the application.
"""
from google.appengine.ext import db
from google.appengine.ext import search
import datetime
import markdown
class Secret(db.Model):
name = db.StringProperty()
value = db.StringProperty()
class Radar(search.SearchableModel):
# This first set of properties are user-specified.
# For flexibility and robustness, we represent them all as strings.
# The Radar Problem ID
number = db.StringProperty()
# The radar number this radar duplicates
parent_number = db.StringProperty()
title = db.StringProperty()
# Radar state
status = db.StringProperty()
resolved = db.StringProperty()
# App Engine user who created this entry
user = db.UserProperty()
product = db.StringProperty()
classification = db.StringProperty()
reproducible = db.StringProperty()
product_version = db.StringProperty()
# problem description plus anything else.
description = db.TextProperty()
# when the Radar was filed
originated = db.StringProperty()
# when the OpenRadar object was created
created = db.DateTimeProperty()
# These remaining properties are managed by the OpenRadar web app.
# They are automatically set when put() is called.
# We will add more as needed to allow better performance or to simplify
# sorting and querying.
# The integer part of the Radar Problem ID
number_intvalue = db.IntegerProperty()
# when the OpenRadar object was last modified
modified = db.DateTimeProperty()
def username(self):
return self.user.nickname().split("@")[0]
def put(self):
self.modified = datetime.datetime.now()
# Sanitize the data before storing
self.sanitize()
return db.Model.put(self)
def comments(self):
return Comment.gql("WHERE radar = :1 AND is_reply_to = :2 order by posted_at desc", self, None)
def children(self):
gqlQuery = Radar.gql("WHERE parent_number = :1 ORDER BY number ASC", self.number)
return gqlQuery.fetch(gqlQuery.count())
def parent(self):
return Radar.gql("WHERE number = :1", self.parent_number).get()
def sanitize(self):
if (self.classification):
self.classification = self.classification.strip()
if (self.description):
self.description = self.description.strip()
if (self.number):
self.number = self.number.strip()
if self.number.startswith('FB'):
self.number_intvalue = int(self.number[2:])
else:
self.number_intvalue = int(self.number)
if (self.originated):
self.originated = self.originated.strip()
if (self.product):
self.product = self.product.strip()
if (self.product_version):
self.product_version = self.product_version.strip()
if (self.resolved):
self.resolved = self.resolved.strip()
if (self.reproducible):
self.reproducible = self.reproducible.strip()
# The most common format for duplicates is "Duplicate/<radar_number>"
# If that format is found, extract the included radar number and store
# it in self.parent_number
if (self.status):
current_status = self.status.strip()
status_words = current_status.split("/")
if (len(status_words) == 2):
# Trim any leading or trailing whitespace from the status type
status_type = status_words[0].strip()
# Determine whether status_type equals "duplicate", ignore
# case sensitivity
if (status_type.lower() == "duplicate"):
status_type = "Duplicate"
parent_radar_number = status_words[1].strip()
if (parent_radar_number.isdigit()):
self.parent_number = parent_radar_number
# Put the components back together
current_status = status_type + "/" + parent_radar_number
# Update self.status with the sanitized status
self.status = current_status;
if (self.title):
self.title = self.title.strip()
def toDictionary(self):
return {
"id":self.key().id(),
"title":self.title,
"number":self.number,
"user":self.user.email(),
"status":self.status,
"description":self.description,
"resolved":self.resolved,
"product":self.product,
"classification":self.classification,
"reproducible":self.reproducible,
"product_version":self.product_version,
"originated":self.originated}
md = markdown.Markdown()
class Comment(search.SearchableModel):
user = db.UserProperty() # App Engine user who wrote the comment
subject = db.StringProperty()
body = db.TextProperty() # as markdown
posted_at = db.DateTimeProperty()
radar = db.ReferenceProperty(Radar)
is_reply_to = db.SelfReferenceProperty()
def __init__(self, *args, **kwargs):
super(Comment, self).__init__(*args, **kwargs)
if(not self.posted_at): self.posted_at = datetime.datetime.now()
if(not self.body): self.body = ""
if(not self.subject): self.subject = ""
def username(self):
return self.user.nickname().split("@")[0]
def radar_exists(self):
try:
return self.radar != None
except db.Error:
return False
def radarnumber(self):
return self.radar_exists() and self.radar.number or "Deleted"
def radartitle(self):
return self.radar_exists() and self.radar.title or "Deleted"
def replies(self):
return Comment.gql("WHERE is_reply_to = :1 order by posted_at desc", self)
# I know this is a bad place to put it, but my only other idea is custom django template tags, and I just couldn't get those to work
def draw(self, onlyInner = False):
from google.appengine.ext.webapp import template
import os
directory = os.path.dirname(__file__)
path = os.path.join(directory, os.path.join('../templates', "comment.html"))
return template.render(path, {"comment": self, "onlyInner": onlyInner})
def form(self):
from google.appengine.ext.webapp import template
import os
directory = os.path.dirname(__file__)
path = os.path.join(directory, os.path.join('../templates', "comment-form.html"))
return template.render(path, {"comment": self})
def html_body(self):
return md.convert(self.body)
def editable_by_current_user(self):
from google.appengine.api import users
user = users.GetCurrentUser()
return user == self.user or users.is_current_user_admin()
def deleteOrBlank(self):
if self.replies().count() > 0:
self.subject = "(Removed)"
self.body = "*This comment has been removed by its author or a moderator.*"
self.put()
return "blanked"
else:
self.delete()
return "deleted"
def toDictionary(self):
result = {
"id":self.key().id(),
"user":self.user.email(),
"subject":self.subject,
"body":self.body,
"radar":self.radar.number,
}
if self.is_reply_to:
result["is_reply_to"] = self.is_reply_to.key().id()
return result
class Profile(db.Model):
name = db.StringProperty() # screen name
twitter = db.StringProperty() # twitter id
user = db.UserProperty()
radar_count = db.IntegerProperty()
class Bump(db.Model):
radar = db.ReferenceProperty(Radar) # users can bump radars to raise their profile
user = db.UserProperty() # the bumping user
created = db.DateTimeProperty() # when the bump was added
class APIKey(db.Model):
user = db.UserProperty()
created = db.DateTimeProperty()
apikey = db.StringProperty()
| {
"pile_set_name": "Github"
} |
package gui
import (
"github.com/jesseduffield/lazygit/pkg/commands"
)
// you can only copy from one context at a time, because the order and position of commits matter
func (gui *Gui) resetCherryPickingIfNecessary(context Context) error {
oldContextKey := gui.State.Modes.CherryPicking.ContextKey
if oldContextKey != context.GetKey() {
// need to reset the cherry picking mode
gui.State.Modes.CherryPicking.ContextKey = context.GetKey()
gui.State.Modes.CherryPicking.CherryPickedCommits = make([]*commands.Commit, 0)
return gui.rerenderContextViewIfPresent(oldContextKey)
}
return nil
}
func (gui *Gui) handleCopyCommit() error {
if ok, err := gui.validateNotInFilterMode(); err != nil || !ok {
return err
}
// get currently selected commit, add the sha to state.
context := gui.currentSideContext()
if context == nil {
return nil
}
if err := gui.resetCherryPickingIfNecessary(context); err != nil {
return err
}
item, ok := context.SelectedItem()
if !ok {
return nil
}
commit, ok := item.(*commands.Commit)
if !ok {
return nil
}
// we will un-copy it if it's already copied
for index, cherryPickedCommit := range gui.State.Modes.CherryPicking.CherryPickedCommits {
if commit.Sha == cherryPickedCommit.Sha {
gui.State.Modes.CherryPicking.CherryPickedCommits = append(gui.State.Modes.CherryPicking.CherryPickedCommits[0:index], gui.State.Modes.CherryPicking.CherryPickedCommits[index+1:]...)
return context.HandleRender()
}
}
gui.addCommitToCherryPickedCommits(context.GetPanelState().GetSelectedLineIdx())
return context.HandleRender()
}
func (gui *Gui) cherryPickedCommitShaMap() map[string]bool {
commitShaMap := map[string]bool{}
for _, commit := range gui.State.Modes.CherryPicking.CherryPickedCommits {
commitShaMap[commit.Sha] = true
}
return commitShaMap
}
func (gui *Gui) commitsListForContext() []*commands.Commit {
context := gui.currentSideContext()
if context == nil {
return nil
}
// using a switch statement, but we should use polymorphism
switch context.GetKey() {
case BRANCH_COMMITS_CONTEXT_KEY:
return gui.State.Commits
case REFLOG_COMMITS_CONTEXT_KEY:
return gui.State.FilteredReflogCommits
case SUB_COMMITS_CONTEXT_KEY:
return gui.State.SubCommits
default:
gui.Log.Errorf("no commit list for context %s", context.GetKey())
return nil
}
}
func (gui *Gui) addCommitToCherryPickedCommits(index int) {
commitShaMap := gui.cherryPickedCommitShaMap()
commitsList := gui.commitsListForContext()
commitShaMap[commitsList[index].Sha] = true
newCommits := []*commands.Commit{}
for _, commit := range commitsList {
if commitShaMap[commit.Sha] {
// duplicating just the things we need to put in the rebase TODO list
newCommits = append(newCommits, &commands.Commit{Name: commit.Name, Sha: commit.Sha})
}
}
gui.State.Modes.CherryPicking.CherryPickedCommits = newCommits
}
func (gui *Gui) handleCopyCommitRange() error {
if ok, err := gui.validateNotInFilterMode(); err != nil || !ok {
return err
}
// get currently selected commit, add the sha to state.
context := gui.currentSideContext()
if context == nil {
return nil
}
if err := gui.resetCherryPickingIfNecessary(context); err != nil {
return err
}
commitShaMap := gui.cherryPickedCommitShaMap()
commitsList := gui.commitsListForContext()
selectedLineIdx := context.GetPanelState().GetSelectedLineIdx()
if selectedLineIdx > len(commitsList)-1 {
return nil
}
// find the last commit that is copied that's above our position
// if there are none, startIndex = 0
startIndex := 0
for index, commit := range commitsList[0:selectedLineIdx] {
if commitShaMap[commit.Sha] {
startIndex = index
}
}
for index := startIndex; index <= selectedLineIdx; index++ {
gui.addCommitToCherryPickedCommits(index)
}
return context.HandleRender()
}
// HandlePasteCommits begins a cherry-pick rebase with the commits the user has copied
func (gui *Gui) HandlePasteCommits() error {
if ok, err := gui.validateNotInFilterMode(); err != nil || !ok {
return err
}
return gui.ask(askOpts{
title: gui.Tr.SLocalize("CherryPick"),
prompt: gui.Tr.SLocalize("SureCherryPick"),
handleConfirm: func() error {
return gui.WithWaitingStatus(gui.Tr.SLocalize("CherryPickingStatus"), func() error {
err := gui.GitCommand.CherryPickCommits(gui.State.Modes.CherryPicking.CherryPickedCommits)
return gui.handleGenericMergeCommandResult(err)
})
},
})
}
func (gui *Gui) exitCherryPickingMode() error {
contextKey := gui.State.Modes.CherryPicking.ContextKey
gui.State.Modes.CherryPicking.ContextKey = ""
gui.State.Modes.CherryPicking.CherryPickedCommits = nil
if contextKey == "" {
gui.Log.Warn("context key blank when trying to exit cherry picking mode")
return nil
}
return gui.rerenderContextViewIfPresent(contextKey)
}
func (gui *Gui) rerenderContextViewIfPresent(contextKey string) error {
if contextKey == "" {
return nil
}
context := gui.contextForContextKey(contextKey)
viewName := context.GetViewName()
view, err := gui.g.View(viewName)
if err != nil {
gui.Log.Warn(err)
return nil
}
if view.Context == contextKey {
if err := context.HandleRender(); err != nil {
return err
}
}
return nil
}
| {
"pile_set_name": "Github"
} |
import { IntrospectionResultData } from 'apollo-cache-inmemory';
declare global {
const __INTROSPECTION__: IntrospectionResultData;
// tslint:disable-next-line:interface-name
interface Window {
__API__: string;
}
}
| {
"pile_set_name": "Github"
} |
#pragma once
#include <dds/util/fs.hpp>
namespace dds {
fs::path user_home_dir();
fs::path user_data_dir();
fs::path user_cache_dir();
fs::path user_config_dir();
inline fs::path dds_data_dir() { return user_data_dir() / "dds"; }
inline fs::path dds_cache_dir() { return user_cache_dir() / "dds-cache"; }
inline fs::path dds_config_dir() { return user_config_dir() / "dds"; }
} // namespace dds | {
"pile_set_name": "Github"
} |
import React from 'react'
import { Link } from 'react-static'
import { Message } from 'semantic-ui-react'
import ComponentExample from 'docs/src/components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/src/components/ComponentDoc/ExampleSection'
const TransitionablePortalUsageExamples = () => (
<ExampleSection title='Usage'>
<ComponentExample
title='Transition'
description='You can use define transitions.'
examplePath='addons/TransitionablePortal/Usage/TransitionablePortalExampleTransition'
>
<Message info>
See <Link to='/modules/transition'>Transition</Link> for more examples
of usage.
</Message>
</ComponentExample>
</ExampleSection>
)
export default TransitionablePortalUsageExamples
| {
"pile_set_name": "Github"
} |
aufs
ip_vs
br_netfilter
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Constants;
using Framework.Database;
using Game.Entities;
using Game.Groups;
using Game.Networking;
using System;
using System.Collections.Generic;
using System.Linq;
using Game.Cache;
namespace Game.Arenas
{
public class ArenaTeam
{
public ArenaTeam()
{
stats.Rating = (ushort)WorldConfig.GetIntValue(WorldCfg.ArenaStartRating);
}
public bool Create(ObjectGuid captainGuid, byte _type, string arenaTeamName, uint backgroundColor, byte emblemStyle, uint emblemColor, byte borderStyle, uint borderColor)
{
// Check if captain is present
if (!Global.ObjAccessor.FindPlayer(captainGuid))
return false;
// Check if arena team name is already taken
if (Global.ArenaTeamMgr.GetArenaTeamByName(arenaTeamName) != null)
return false;
// Generate new arena team id
teamId = Global.ArenaTeamMgr.GenerateArenaTeamId();
// Assign member variables
CaptainGuid = captainGuid;
type = _type;
TeamName = arenaTeamName;
BackgroundColor = backgroundColor;
EmblemStyle = emblemStyle;
EmblemColor = emblemColor;
BorderStyle = borderStyle;
BorderColor = borderColor;
ulong captainLowGuid = captainGuid.GetCounter();
// Save arena team to db
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ARENA_TEAM);
stmt.AddValue(0, teamId);
stmt.AddValue(1, TeamName);
stmt.AddValue(2, captainLowGuid);
stmt.AddValue(3, type);
stmt.AddValue(4, stats.Rating);
stmt.AddValue(5, BackgroundColor);
stmt.AddValue(6, EmblemStyle);
stmt.AddValue(7, EmblemColor);
stmt.AddValue(8, BorderStyle);
stmt.AddValue(9, BorderColor);
DB.Characters.Execute(stmt);
// Add captain as member
AddMember(CaptainGuid);
Log.outDebug(LogFilter.Arena, "New ArenaTeam created Id: {0}, Name: {1} Type: {2} Captain low GUID: {3}", GetId(), GetName(), GetArenaType(), captainLowGuid);
return true;
}
public bool AddMember(ObjectGuid playerGuid)
{
string playerName;
Class playerClass;
// Check if arena team is full (Can't have more than type * 2 players)
if (GetMembersSize() >= GetArenaType() * 2)
return false;
// Get player name and class either from db or character cache
CharacterCacheEntry characterInfo;
Player player = Global.ObjAccessor.FindPlayer(playerGuid);
if (player)
{
playerClass = player.GetClass();
playerName = player.GetName();
}
else if ((characterInfo = Global.CharacterCacheStorage.GetCharacterCacheByGuid(playerGuid)) != null)
{
playerName = characterInfo.Name;
playerClass = characterInfo.ClassId;
}
else
return false;
// Check if player is already in a similar arena team
if ((player && player.GetArenaTeamId(GetSlot()) != 0) || Global.CharacterCacheStorage.GetCharacterArenaTeamIdByGuid(playerGuid, GetArenaType()) != 0)
{
Log.outDebug(LogFilter.Arena, "Arena: {0} {1} already has an arena team of type {2}", playerGuid.ToString(), playerName, GetArenaType());
return false;
}
// Set player's personal rating
uint personalRating = 0;
if (WorldConfig.GetIntValue(WorldCfg.ArenaStartPersonalRating) > 0)
personalRating = WorldConfig.GetUIntValue(WorldCfg.ArenaStartPersonalRating);
else if (GetRating() >= 1000)
personalRating = 1000;
// Try to get player's match maker rating from db and fall back to config setting if not found
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MATCH_MAKER_RATING);
stmt.AddValue(0, playerGuid.GetCounter());
stmt.AddValue(1, GetSlot());
SQLResult result = DB.Characters.Query(stmt);
uint matchMakerRating;
if (!result.IsEmpty())
matchMakerRating = result.Read<ushort>(0);
else
matchMakerRating = WorldConfig.GetUIntValue(WorldCfg.ArenaStartMatchmakerRating);
// Remove all player signatures from other petitions
// This will prevent player from joining too many arena teams and corrupt arena team data integrity
//Player.RemovePetitionsAndSigns(playerGuid, GetArenaType());
// Feed data to the struct
ArenaTeamMember newMember = new ArenaTeamMember();
newMember.Name = playerName;
newMember.Guid = playerGuid;
newMember.Class = (byte)playerClass;
newMember.SeasonGames = 0;
newMember.WeekGames = 0;
newMember.SeasonWins = 0;
newMember.WeekWins = 0;
newMember.PersonalRating = 0;
newMember.MatchMakerRating = (ushort)matchMakerRating;
Members.Add(newMember);
Global.CharacterCacheStorage.UpdateCharacterArenaTeamId(playerGuid, GetSlot(), GetId());
// Save player's arena team membership to db
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ARENA_TEAM_MEMBER);
stmt.AddValue(0, teamId);
stmt.AddValue(1, playerGuid.GetCounter());
DB.Characters.Execute(stmt);
// Inform player if online
if (player)
{
player.SetInArenaTeam(teamId, GetSlot(), GetArenaType());
player.SetArenaTeamIdInvited(0);
// Hide promote/remove buttons
if (CaptainGuid != playerGuid)
player.SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType.Member, 1);
}
Log.outDebug(LogFilter.Arena, "Player: {0} [{1}] joined arena team type: {2} [Id: {3}, Name: {4}].", playerName, playerGuid.ToString(), GetArenaType(), GetId(), GetName());
return true;
}
public bool LoadArenaTeamFromDB(SQLResult result)
{
if (result.IsEmpty())
return false;
teamId = result.Read<uint>(0);
TeamName = result.Read<string>(1);
CaptainGuid = ObjectGuid.Create(HighGuid.Player, result.Read<ulong>(2));
type = result.Read<byte>(3);
BackgroundColor = result.Read<uint>(4);
EmblemStyle = result.Read<byte>(5);
EmblemColor = result.Read<uint>(6);
BorderStyle = result.Read<byte>(7);
BorderColor = result.Read<uint>(8);
stats.Rating = result.Read<ushort>(9);
stats.WeekGames = result.Read<ushort>(10);
stats.WeekWins = result.Read<ushort>(11);
stats.SeasonGames = result.Read<ushort>(12);
stats.SeasonWins = result.Read<ushort>(13);
stats.Rank = result.Read<uint>(14);
return true;
}
public bool LoadMembersFromDB(SQLResult result)
{
if (result.IsEmpty())
return false;
bool captainPresentInTeam = false;
do
{
uint arenaTeamId = result.Read<uint>(0);
// We loaded all members for this arena_team already, break cycle
if (arenaTeamId > teamId)
break;
ArenaTeamMember newMember = new ArenaTeamMember();
newMember.Guid = ObjectGuid.Create(HighGuid.Player, result.Read<ulong>(1));
newMember.WeekGames = result.Read<ushort>(2);
newMember.WeekWins = result.Read<ushort>(3);
newMember.SeasonGames = result.Read<ushort>(4);
newMember.SeasonWins = result.Read<ushort>(5);
newMember.Name = result.Read<string>(6);
newMember.Class = result.Read<byte>(7);
newMember.PersonalRating = result.Read<ushort>(8);
newMember.MatchMakerRating = (ushort)(result.Read<ushort>(9) > 0 ? result.Read<ushort>(9) : 1500);
// Delete member if character information is missing
if (string.IsNullOrEmpty(newMember.Name))
{
Log.outError(LogFilter.Sql, "ArenaTeam {0} has member with empty name - probably {1} doesn't exist, deleting him from memberlist!", arenaTeamId, newMember.Guid.ToString());
DelMember(newMember.Guid, true);
continue;
}
// Check if team team has a valid captain
if (newMember.Guid == GetCaptain())
captainPresentInTeam = true;
// Put the player in the team
Members.Add(newMember);
Global.CharacterCacheStorage.UpdateCharacterArenaTeamId(newMember.Guid, GetSlot(), GetId());
}
while (result.NextRow());
if (Empty() || !captainPresentInTeam)
{
// Arena team is empty or captain is not in team, delete from db
Log.outDebug(LogFilter.Arena, "ArenaTeam {0} does not have any members or its captain is not in team, disbanding it...", teamId);
return false;
}
return true;
}
public bool SetName(string name)
{
if (TeamName == name || string.IsNullOrEmpty(name) || name.Length > 24 || Global.ObjectMgr.IsReservedName(name) || !ObjectManager.IsValidCharterName(name))
return false;
TeamName = name;
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ARENA_TEAM_NAME);
stmt.AddValue(0, TeamName);
stmt.AddValue(1, GetId());
DB.Characters.Execute(stmt);
return true;
}
public void SetCaptain(ObjectGuid guid)
{
// Disable remove/promote buttons
Player oldCaptain = Global.ObjAccessor.FindPlayer(GetCaptain());
if (oldCaptain)
oldCaptain.SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType.Member, 1);
// Set new captain
CaptainGuid = guid;
// Update database
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ARENA_TEAM_CAPTAIN);
stmt.AddValue(0, guid.GetCounter());
stmt.AddValue(1, GetId());
DB.Characters.Execute(stmt);
// Enable remove/promote buttons
Player newCaptain = Global.ObjAccessor.FindPlayer(guid);
if (newCaptain)
{
newCaptain.SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType.Member, 0);
if (oldCaptain)
{
Log.outDebug(LogFilter.Arena, "Player: {0} [GUID: {1}] promoted player: {2} [GUID: {3}] to leader of arena team [Id: {4}, Name: {5}] [Type: {6}].",
oldCaptain.GetName(), oldCaptain.GetGUID().ToString(), newCaptain.GetName(),
newCaptain.GetGUID().ToString(), GetId(), GetName(), GetArenaType());
}
}
}
public void DelMember(ObjectGuid guid, bool cleanDb)
{
// Remove member from team
foreach (var member in Members)
{
if (member.Guid == guid)
{
Members.Remove(member);
Global.CharacterCacheStorage.UpdateCharacterArenaTeamId(guid, GetSlot(), 0);
break;
}
}
// Remove arena team info from player data
Player player = Global.ObjAccessor.FindPlayer(guid);
if (player)
{
// delete all info regarding this team
for (uint i = 0; i < (int)ArenaTeamInfoType.End; ++i)
player.SetArenaTeamInfoField(GetSlot(), (ArenaTeamInfoType)i, 0);
Log.outDebug(LogFilter.Arena, "Player: {0} [GUID: {1}] left arena team type: {2} [Id: {3}, Name: {4}].", player.GetName(), player.GetGUID().ToString(), GetArenaType(), GetId(), GetName());
}
// Only used for single member deletion, for arena team disband we use a single query for more efficiency
if (cleanDb)
{
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM_MEMBER);
stmt.AddValue(0, GetId());
stmt.AddValue(1, guid.GetCounter());
DB.Characters.Execute(stmt);
}
}
public void Disband(WorldSession session)
{
// Broadcast update
if (session != null)
{
Player player = session.GetPlayer();
if (player)
Log.outDebug(LogFilter.Arena, "Player: {0} [GUID: {1}] disbanded arena team type: {2} [Id: {3}, Name: {4}].", player.GetName(), player.GetGUID().ToString(), GetArenaType(), GetId(), GetName());
}
// Remove all members from arena team
while (!Members.Empty())
DelMember(Members.FirstOrDefault().Guid, false);
// Update database
SQLTransaction trans = new SQLTransaction();
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM);
stmt.AddValue(0, teamId);
trans.Append(stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM_MEMBERS);
stmt.AddValue(0, teamId);
trans.Append(stmt);
DB.Characters.CommitTransaction(trans);
// Remove arena team from ArenaTeamMgr
Global.ArenaTeamMgr.RemoveArenaTeam(teamId);
}
public void Disband()
{
// Remove all members from arena team
while (!Members.Empty())
DelMember(Members.First().Guid, false);
// Update database
SQLTransaction trans = new SQLTransaction();
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM);
stmt.AddValue(0, teamId);
trans.Append(stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_ARENA_TEAM_MEMBERS);
stmt.AddValue(0, teamId);
trans.Append(stmt);
DB.Characters.CommitTransaction(trans);
// Remove arena team from ArenaTeamMgr
Global.ArenaTeamMgr.RemoveArenaTeam(teamId);
}
public void SendStats(WorldSession session)
{
/*WorldPacket data = new WorldPacket(ServerOpcodes.ArenaTeamStats);
data.WriteUInt32(GetId()); // team id
data.WriteUInt32(stats.Rating); // rating
data.WriteUInt32(stats.WeekGames); // games this week
data.WriteUInt32(stats.WeekWins); // wins this week
data.WriteUInt32(stats.SeasonGames); // played this season
data.WriteUInt32(stats.SeasonWins); // wins this season
data.WriteUInt32(stats.Rank); // rank
session.SendPacket(data);*/
}
public void NotifyStatsChanged()
{
// This is called after a rated match ended
// Updates arena team stats for every member of the team (not only the ones who participated!)
foreach (var member in Members)
{
Player player = Global.ObjAccessor.FindPlayer(member.Guid);
if (player)
SendStats(player.GetSession());
}
}
void BroadcastPacket(ServerPacket packet)
{
foreach (var member in Members)
{
Player player = Global.ObjAccessor.FindPlayer(member.Guid);
if (player)
player.SendPacket(packet);
}
}
public static byte GetSlotByType(uint type)
{
switch ((ArenaTypes)type)
{
case ArenaTypes.Team2v2: return 0;
case ArenaTypes.Team3v3: return 1;
case ArenaTypes.Team5v5: return 2;
default:
break;
}
Log.outError(LogFilter.Arena, "FATAL: Unknown arena team type {0} for some arena team", type);
return 0xFF;
}
public static byte GetTypeBySlot(byte slot)
{
switch (slot)
{
case 0: return (byte)ArenaTypes.Team2v2;
case 1: return (byte)ArenaTypes.Team3v3;
case 2: return (byte)ArenaTypes.Team5v5;
default:
break;
}
Log.outError(LogFilter.Arena, "FATAL: Unknown arena team slot {0} for some arena team", slot);
return 0xFF;
}
public bool IsMember(ObjectGuid guid)
{
foreach (var member in Members)
if (member.Guid == guid)
return true;
return false;
}
public uint GetAverageMMR(Group group)
{
if (!group)
return 0;
uint matchMakerRating = 0;
uint playerDivider = 0;
foreach (var member in Members)
{
// Skip if player is not online
if (!Global.ObjAccessor.FindPlayer(member.Guid))
continue;
// Skip if player is not a member of group
if (!group.IsMember(member.Guid))
continue;
matchMakerRating += member.MatchMakerRating;
++playerDivider;
}
// x/0 = crash
if (playerDivider == 0)
playerDivider = 1;
matchMakerRating /= playerDivider;
return matchMakerRating;
}
float GetChanceAgainst(uint ownRating, uint opponentRating)
{
// Returns the chance to win against a team with the given rating, used in the rating adjustment calculation
// ELO system
return (float)(1.0f / (1.0f + Math.Exp(Math.Log(10.0f) * ((float)opponentRating - ownRating) / 650.0f)));
}
int GetMatchmakerRatingMod(uint ownRating, uint opponentRating, bool won)
{
// 'Chance' calculation - to beat the opponent
// This is a simulation. Not much info on how it really works
float chance = GetChanceAgainst(ownRating, opponentRating);
float won_mod = (won) ? 1.0f : 0.0f;
float mod = won_mod - chance;
// Work in progress:
/*
// This is a simulation, as there is not much info on how it really works
float confidence_mod = min(1.0f - fabs(mod), 0.5f);
// Apply confidence factor to the mod:
mod *= confidence_factor
// And only after that update the new confidence factor
confidence_factor -= ((confidence_factor - 1.0f) * confidence_mod) / confidence_factor;
*/
// Real rating modification
mod *= WorldConfig.GetFloatValue(WorldCfg.ArenaMatchmakerRatingModifier);
return (int)Math.Ceiling(mod);
}
int GetRatingMod(uint ownRating, uint opponentRating, bool won)
{
// 'Chance' calculation - to beat the opponent
// This is a simulation. Not much info on how it really works
float chance = GetChanceAgainst(ownRating, opponentRating);
// Calculate the rating modification
float mod;
// todo Replace this hack with using the confidence factor (limiting the factor to 2.0f)
if (won)
{
if (ownRating < 1300)
{
float win_rating_modifier1 = WorldConfig.GetFloatValue(WorldCfg.ArenaWinRatingModifier1);
if (ownRating < 1000)
mod = win_rating_modifier1 * (1.0f - chance);
else
mod = ((win_rating_modifier1 / 2.0f) + ((win_rating_modifier1 / 2.0f) * (1300.0f - ownRating) / 300.0f)) * (1.0f - chance);
}
else
mod = WorldConfig.GetFloatValue(WorldCfg.ArenaWinRatingModifier2) * (1.0f - chance);
}
else
mod = WorldConfig.GetFloatValue(WorldCfg.ArenaLoseRatingModifier) * (-chance);
return (int)Math.Ceiling(mod);
}
public void FinishGame(int mod)
{
// Rating can only drop to 0
if (stats.Rating + mod < 0)
stats.Rating = 0;
else
{
stats.Rating += (ushort)mod;
// Check if rating related achivements are met
foreach (var member in Members)
{
Player player = Global.ObjAccessor.FindPlayer(member.Guid);
if (player)
player.UpdateCriteria(CriteriaTypes.HighestTeamRating, stats.Rating, type);
}
}
// Update number of games played per season or week
stats.WeekGames += 1;
stats.SeasonGames += 1;
// Update team's rank, start with rank 1 and increase until no team with more rating was found
stats.Rank = 1;
foreach (var i in Global.ArenaTeamMgr.GetArenaTeamMap())
{
if (i.Value.GetArenaType() == type && i.Value.GetStats().Rating > stats.Rating)
++stats.Rank;
}
}
public int WonAgainst(uint ownMMRating, uint opponentMMRating, ref int ratingChange)
{
// Called when the team has won
// Change in Matchmaker rating
int mod = GetMatchmakerRatingMod(ownMMRating, opponentMMRating, true);
// Change in Team Rating
ratingChange = GetRatingMod(stats.Rating, opponentMMRating, true);
// Modify the team stats accordingly
FinishGame(ratingChange);
// Update number of wins per season and week
stats.WeekWins += 1;
stats.SeasonWins += 1;
// Return the rating change, used to display it on the results screen
return mod;
}
public int LostAgainst(uint ownMMRating, uint opponentMMRating, ref int ratingChange)
{
// Called when the team has lost
// Change in Matchmaker Rating
int mod = GetMatchmakerRatingMod(ownMMRating, opponentMMRating, false);
// Change in Team Rating
ratingChange = GetRatingMod(stats.Rating, opponentMMRating, false);
// Modify the team stats accordingly
FinishGame(ratingChange);
// return the rating change, used to display it on the results screen
return mod;
}
public void MemberLost(Player player, uint againstMatchmakerRating, int matchmakerRatingChange = -12)
{
// Called for each participant of a match after losing
foreach (var member in Members)
{
if (member.Guid == player.GetGUID())
{
// Update personal rating
int mod = GetRatingMod(member.PersonalRating, againstMatchmakerRating, false);
member.ModifyPersonalRating(player, mod, GetArenaType());
// Update matchmaker rating
member.ModifyMatchmakerRating(matchmakerRatingChange, GetSlot());
// Update personal played stats
member.WeekGames += 1;
member.SeasonGames += 1;
// update the unit fields
player.SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType.GamesWeek, member.WeekGames);
player.SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType.GamesSeason, member.SeasonGames);
return;
}
}
}
public void OfflineMemberLost(ObjectGuid guid, uint againstMatchmakerRating, int matchmakerRatingChange = -12)
{
// Called for offline player after ending rated arena match!
foreach (var member in Members)
{
if (member.Guid == guid)
{
// update personal rating
int mod = GetRatingMod(member.PersonalRating, againstMatchmakerRating, false);
member.ModifyPersonalRating(null, mod, GetArenaType());
// update matchmaker rating
member.ModifyMatchmakerRating(matchmakerRatingChange, GetSlot());
// update personal played stats
member.WeekGames += 1;
member.SeasonGames += 1;
return;
}
}
}
public void MemberWon(Player player, uint againstMatchmakerRating, int matchmakerRatingChange)
{
// called for each participant after winning a match
foreach (var member in Members)
{
if (member.Guid == player.GetGUID())
{
// update personal rating
int mod = GetRatingMod(member.PersonalRating, againstMatchmakerRating, true);
member.ModifyPersonalRating(player, mod, GetArenaType());
// update matchmaker rating
member.ModifyMatchmakerRating(matchmakerRatingChange, GetSlot());
// update personal stats
member.WeekGames += 1;
member.SeasonGames += 1;
member.SeasonWins += 1;
member.WeekWins += 1;
// update unit fields
player.SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType.GamesWeek, member.WeekGames);
player.SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType.GamesSeason, member.SeasonGames);
return;
}
}
}
public void SaveToDB()
{
// Save team and member stats to db
// Called after a match has ended or when calculating arena_points
SQLTransaction trans = new SQLTransaction();
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ARENA_TEAM_STATS);
stmt.AddValue(0, stats.Rating);
stmt.AddValue(1, stats.WeekGames);
stmt.AddValue(2, stats.WeekWins);
stmt.AddValue(3, stats.SeasonGames);
stmt.AddValue(4, stats.SeasonWins);
stmt.AddValue(5, stats.Rank);
stmt.AddValue(6, GetId());
trans.Append(stmt);
foreach (var member in Members)
{
// Save the effort and go
if (member.WeekGames == 0)
continue;
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ARENA_TEAM_MEMBER);
stmt.AddValue(0, member.PersonalRating);
stmt.AddValue(1, member.WeekGames);
stmt.AddValue(2, member.WeekWins);
stmt.AddValue(3, member.SeasonGames);
stmt.AddValue(4, member.SeasonWins);
stmt.AddValue(5, GetId());
stmt.AddValue(6, member.Guid.GetCounter());
trans.Append(stmt);
stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_CHARACTER_ARENA_STATS);
stmt.AddValue(0, member.Guid.GetCounter());
stmt.AddValue(1, GetSlot());
stmt.AddValue(2, member.MatchMakerRating);
trans.Append(stmt);
}
DB.Characters.CommitTransaction(trans);
}
public bool FinishWeek()
{
// No need to go further than this
if (stats.WeekGames == 0)
return false;
// Reset team stats
stats.WeekGames = 0;
stats.WeekWins = 0;
// Reset member stats
foreach (var member in Members)
{
member.WeekGames = 0;
member.WeekWins = 0;
}
return true;
}
public bool IsFighting()
{
foreach (var member in Members)
{
Player player = Global.ObjAccessor.FindPlayer(member.Guid);
if (player)
if (player.GetMap().IsBattleArena())
return true;
}
return false;
}
public ArenaTeamMember GetMember(string name)
{
foreach (var member in Members)
if (member.Name == name)
return member;
return null;
}
public ArenaTeamMember GetMember(ObjectGuid guid)
{
foreach (var member in Members)
if (member.Guid == guid)
return member;
return null;
}
public uint GetId() { return teamId; }
public byte GetArenaType() { return type; }
public byte GetSlot() { return GetSlotByType(GetArenaType()); }
public ObjectGuid GetCaptain() { return CaptainGuid; }
public string GetName() { return TeamName; }
public ArenaTeamStats GetStats() { return stats; }
public uint GetRating() { return stats.Rating; }
public int GetMembersSize() { return Members.Count; }
bool Empty() { return Members.Empty(); }
public List<ArenaTeamMember> GetMembers()
{
return Members;
}
uint teamId;
byte type;
string TeamName;
ObjectGuid CaptainGuid;
uint BackgroundColor; // ARGB format
byte EmblemStyle; // icon id
uint EmblemColor; // ARGB format
byte BorderStyle; // border image id
uint BorderColor; // ARGB format
List<ArenaTeamMember> Members = new List<ArenaTeamMember>();
ArenaTeamStats stats;
}
public class ArenaTeamMember
{
public ObjectGuid Guid;
public string Name;
public byte Class;
public ushort WeekGames;
public ushort WeekWins;
public ushort SeasonGames;
public ushort SeasonWins;
public ushort PersonalRating;
public ushort MatchMakerRating;
public void ModifyPersonalRating(Player player, int mod, uint type)
{
if (PersonalRating + mod < 0)
PersonalRating = 0;
else
PersonalRating += (ushort)mod;
if (player)
{
player.SetArenaTeamInfoField(ArenaTeam.GetSlotByType(type), ArenaTeamInfoType.PersonalRating, PersonalRating);
player.UpdateCriteria(CriteriaTypes.HighestPersonalRating, PersonalRating, type);
}
}
public void ModifyMatchmakerRating(int mod, uint slot)
{
if (MatchMakerRating + mod < 0)
MatchMakerRating = 0;
else
MatchMakerRating += (ushort)mod;
}
}
public struct ArenaTeamStats
{
public ushort Rating;
public ushort WeekGames;
public ushort WeekWins;
public ushort SeasonGames;
public ushort SeasonWins;
public uint Rank;
}
}
| {
"pile_set_name": "Github"
} |
// generates export.hpp for each module from compat/linkage.hpp
#pragma once
#include "compat/linkage-macros.hpp"
#ifdef BUILD_USER_INTERFACE
# define OTR_GUI_EXPORT OTR_GENERIC_EXPORT
#else
# define OTR_GUI_EXPORT OTR_GENERIC_IMPORT
#endif
| {
"pile_set_name": "Github"
} |
package org.lwjglb.game;
import org.lwjglb.engine.GameEngine;
import org.lwjglb.engine.IGameLogic;
import org.lwjglb.engine.Window;
public class Main {
public static void main(String[] args) {
try {
boolean vSync = true;
IGameLogic gameLogic = new DummyGame();
Window.WindowOptions opts = new Window.WindowOptions();
opts.cullFace = true;
opts.showFps = true;
opts.compatibleProfile = true;
opts.antialiasing = true;
opts.frustumCulling = true;
GameEngine gameEng = new GameEngine("GAME", vSync, opts, gameLogic);
gameEng.run();
} catch (Exception excp) {
excp.printStackTrace();
System.exit(-1);
}
}
}
| {
"pile_set_name": "Github"
} |
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeAutoscalingV1 struct {
*testing.Fake
}
func (c *FakeAutoscalingV1) HorizontalPodAutoscalers(namespace string) v1.HorizontalPodAutoscalerInterface {
return &FakeHorizontalPodAutoscalers{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeAutoscalingV1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}
| {
"pile_set_name": "Github"
} |
## ☀️ Part 11: Retry-ability
### 📚 You will learn
- deep dive into assertions
- built-in command waits
- retry-ability 🔑
+++
- keep `todomvc` app running
- open `cypress/integration/11-retry-ability/spec.js`
+++
## Todo: finish the test "shows UL"
```js
it('shows list of items', function () {
// ...
cy.contains('ul', 'todo A')
// confirm that the above element
// 1. is visible
// 2. has class "todo-list"
// 3. css property "list-style-type" is equal "none"
})
```
+++
Most assertions I write are BDD
```js
cy.contains('ul', 'todo A').should('be.visible')
expect($el).to.have.prop('disabled', false)
```
[on/assertions#BDD-Assertions](https://on.cypress.io/assertions#BDD-Assertions)
+++
1, 2, or 3 arguments
```js
.should('be.visible')
.should('have.class', 'todo-list')
.should('have.css', 'list-style-type', 'none')
```
+++
## There is IntelliSense

+++
⚠️ straight Chai IntelliSense is not so good

+++
If you must, there are TDD assertions like
```js
assert.equal(3, 3, 'values are equal')
assert.isTrue(true, 'this value is true')
```
[on/assertions#TDD-Assertions](https://on.cypress.io/assertions#TDD-Assertions)
+++
## Todo: BDD vs TDD
Finish test "shows UL - TDD"
```js
it('shows UL - TDD', function () {
cy.contains('ul', 'todo A').then($ul => {
// use TDD assertions
// $ul is visible
// $ul has class "todo-list"
// $ul css has "list-style-type" = "none"
})
})
```
+++
## @fa[question](do you see the difference?)
Which style do you prefer?
⚠️ [Chai-jQuery](https://on.cypress.io/assertions#Chai-jQuery) and [Sinon-Chai](https://on.cypress.io/assertions#Sinon-Chai) are only available in BDD mode.
+++
## BDD

+++
## TDD

+++
## What if you need more complex assertions?
Write you own [should(cb)](http://on.cypress.io/should#Function) assertion
```js
cy.get('.docs-header').find('div')
.should(($div) => {
expect($div).to.have.length(1)
const className = $div[0].className
expect(className).to.match(/heading-/)
})
```
+++
## Todo: write complex assertion
```js
it('every item starts with todo', function () {
// ...
cy.get('.todo label').should($labels => {
// confirm that there are 4 labels
// and that each one starts with "todo-"
})
})
```
+++
## `should(cb)` common use cases
- dynamic data, like scoped class names
- text between two cells is unknown but should be the same
- displayed value should be the same as API has returned
[https://example.cypress.io/commands/assertions](https://example.cypress.io/commands/assertions)
+++
## 🔑 Retry-ability
> Key concept in Cypress, yet should go mostly unnoticed.
Note:
Add link to retry-ability page when finished https://github.com/cypress-io/cypress-documentation/pull/1314
+++
### Commands and assertions
```javascript
it('creates 2 items', function () {
cy.visit('/') // command
cy.focused() // command
.should('have.class', 'new-todo') // assertion
cy.get('.new-todo') // command
.type('todo A{enter}') // command
.type('todo B{enter}') // command
cy.get('.todo-list li') // command
.should('have.length', 2) // assertion
})
```
+++
### Look at the last command + assertion
```javascript
cy.get('.todo-list li') // command
.should('have.length', 2) // assertion
```
Command `cy.get()` will be retried _until_ the assertion `should('have.length', 2)` passes.
Note:
If not shown, this is a good moment to slow down the app and show how the assertion still works, especially when slowing down progressively - 1 item, slow down by 1 second, 2 items - slow down by 2 seconds.
+++
Command `cy.contains` will be retried _until 3 assertions_ that follow it all pass.
```js
cy.contains('ul', 'todo A') // command
.should('be.visible') // assertion
.and('have.class', 'todo-list') // assertion
.and('have.css', 'list-style-type', 'none') // assertion
```
+++
Command `cy.get` will be retried _until 5 assertions_ that follow it all pass.
```js
cy.get('.todo label') // command
.should($labels => {
expect($labels).to.have.length(4) // assertion
$labels.each((k, el) => { // 4 assertions
expect(el.textContent).to.match(/^todo /)
})
})
```
+++
## Retry-ability
Only some commands are retried: `cy.get`, `cy.find`, `its`. They don't change the application's state.
NOT retried: `cy.click`, `cy.task`, etc.

+++
## `then(cb)` vs `should(cb)`
- `should(cb)` retries
- `then(cb)` does not retry
### Todo: demonstrate this
+++
## return value from `should(cb)`
Question: can you return value from `should(cb)`?
Note:
`Should(cb)` does not return a value, it just passes along the value yielded by the command. If you need a value, first call `should(cb)` and then `then(cb)` to return it.
+++
## Automatic Waiting

Built-in assertion in most commands, even if they do not retry assertions that follow. `cy.click` cannot click a button if there is no button, or if it's disabled!
Note:
Just like a human user, Cypress tries to do sensible thing. Very rarely though you need to retry a command that is NOT retried by Cypress, in that case you can perform it yourself, see [When Can the Test Click?](https://www.cypress.io/blog/2019/01/22/when-can-the-test-click/)
+++
## Timeouts
By default, command retries for up to 4 seconds. You can change config setting `defaultCommandTimeout` globally.
```sh
cypress run --config defaultCommandTimeout=10000
```
⚠️ changing global command timeout is not recommended.
+++
## Timeouts
Change timeout for a particular command
```js
// we've modified the timeout which affects
// default + added assertions
cy.get('.mobile-nav', { timeout: 10000 })
.should('be.visible')
.and('contain', 'Home')
```
See [Timeouts](https://on.cypress.io/introduction-to-cypress#Timeouts)
+++
> ⚠️ Only the last command is retried ⚠️
+++
### Todo: write test that checks the label

⌨️ test "has the right label"
+++
```js
it('has the right label', () => {
cy.get('.new-todo').type('todo A{enter}')
cy.get('.todo-list li') // command
.find('label') // command
.should('contain', 'todo A') // assertion
})
```
+++
### Todo: write test that checks two labels

⌨️ test "has two labels"
+++
```js
it('has two labels', () => {
cy.get('.new-todo').type('todo A{enter}')
cy.get('.todo-list li') // command
.find('label') // command
.should('contain', 'todo A') // assertion
cy.get('.new-todo').type('todo B{enter}')
cy.get('.todo-list li') // command
.find('label') // command
.should('contain', 'todo B') // assertion
})
```
+++
## Add delay to the app
```js
// todomvc/app.js
addTodo ({ commit, state }) {
// ...
setTimeout(() => {
axios.post('/todos', todo).then(() => {
commit('ADD_TODO', todo)
})
}, 0)
},
```
> Is the test passing now?
+++
## Todo: debug the failing test
- inspect the failing command "FIND"
- inspect previous command "GET"
- what do you think is happening?
Note:
`FIND` command is never going to succeed, because it is already locked to search in the _first_ `<li>` element only. So when the second correct `<li>` element appears, `FIND` still only searches in the first one - because Cypress does not go back to retry `cy.get`.
+++
## Todo: remove or shorten the artificial delay to make the test flaky
> Use the binary search algorithm to find delay that turns the test into flaky test - sometimes the test passes, sometimes it fails.
Note:
For me it was 46ms. Flaky test like this works fine locally, yet sometimes fails in production where network delays are longer.
+++
> ⚠️ Only the last command is retried ⚠️
```js
cy.get('.new-todo').type('todo B{enter}')
cy.get('.todo-list li') // queries immediately, finds 1 <li>
.find('label') // retried, retried, retried with 1 <li>
// never succeeds with only 1st <li>
.should('contain', 'todo B')
```
How do we fix the flaky test?
+++
## Solution 1: merge queries
```js
// dangerous ⚠️
cy.get('.todo-list li')
.find('label')
.should(...)
// recommended ✅
cy.get('.todo-list li label')
.should(...)
```
⌨️ try this in test "solution 1: merges queries"
Note:
The test should pass now, even with longer delay, because `cy.get` is retried.
+++
## merge queries for `cy.its`
```javascript
// dangerous ⚠️
// only the last "its" will be retried
cy.window()
.its('app') // runs once
.its('model') // runs once
.its('todos') // retried
.should('have.length', 2)
// ✅ recommended
cy.window()
.its('app.model.todos') // retried
.should('have.length', 2)
```
From [Set flag to start tests](https://glebbahmutov.com/blog/set-flag-to-start-tests/)
+++
## Solution 2: alternate commands and assertions
```js
cy.get('.new-todo').type('todo A{enter}')
cy.get('.todo-list li') // command
.should('have.length', 1) // assertion
.find('label') // command
.should('contain', 'todo A') // assertion
cy.get('.new-todo').type('todo B{enter}')
cy.get('.todo-list li') // command
.should('have.length', 2) // assertion
.find('label') // command
.should('contain', 'todo B') // assertion
```
⌨️ try this in test "solution 2: alternate commands and assertions"
+++
## Cypress Retries: Triple Header
### 1. DOM queries
```js
cy.get('li')
.should('have.length', 2)
```
+++
## Cypress Retries: Triple Header
### 2. Network
```js
// spy / stub network calls
cy.route(...).as('new-item')
cy.wait('@new-item')
.its('response.body')
.should('have.length', 2)
```
+++
## Cypress Retries: Triple Header
### 3. Application
```js
// access and spy / stub application code
cy.spy(...).as('some-method')
cy.get('@some-method')
.should('have.been.calledOnce)
```
+++
## 📝 Take away
Most commands have built-in sensible waits:
> Element should exist and be visible before clicking
+++
## 📝 Take away
Many commands also retry themselves until the assertions that follow pass
```js
cy.get('li')
.should('have.length', 2)
```
DOM 🎉 Network 🎉 Application methods 🎉
+++
## 📝 Take away
> ⚠️ Only the last command is retried ⚠️
1. Merge queries into one command
2. Alternate commands and assertions
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android" >
<set
android:ordering="sequentially" >
<objectAnimator
android:duration="100"
android:propertyName="rotation"
android:valueFrom="0.0"
android:valueTo="0.0"
android:valueType="floatType"
android:interpolator="@android:interpolator/linear" />
<objectAnimator
android:duration="516"
android:propertyName="rotation"
android:valueFrom="0.0"
android:valueTo="-305.0"
android:valueType="floatType"
android:interpolator="@anim/fingerprint_fp_to_error_state_animation_interpolator_3" />
<objectAnimator
android:duration="1116"
android:propertyName="rotation"
android:valueFrom="-305.0"
android:valueTo="-305.0"
android:valueType="floatType"
android:interpolator="@anim/fingerprint_fp_to_error_state_animation_interpolator_0" />
<objectAnimator
android:duration="800"
android:propertyName="rotation"
android:valueFrom="-305.0"
android:valueTo="-720.0"
android:valueType="floatType"
android:interpolator="@anim/fingerprint_fp_to_error_state_animation_interpolator_0" />
</set>
</set>
| {
"pile_set_name": "Github"
} |
/**
* This file is part of Aion-Lightning <aion-lightning.org>.
*
* Aion-Lightning is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Aion-Lightning is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
* along with Aion-Lightning.
* If not, see <http://www.gnu.org/licenses/>.
*/
package com.aionemu.gameserver.skillengine.properties;
import java.util.SortedMap;
import java.util.TreeMap;
import com.aionemu.gameserver.model.gameobjects.Creature;
import com.aionemu.gameserver.skillengine.model.Skill;
import com.aionemu.gameserver.utils.MathUtil;
/**
* @author MrPoke
*/
public class MaxCountProperty {
public static final boolean set(final Skill skill, Properties properties) {
TargetRangeAttribute value = properties.getTargetType();
int maxcount = properties.getTargetMaxCount();
switch (value) {
case AREA:
int areaCounter = 0;
final Creature firstTarget = skill.getFirstTarget();
if (firstTarget == null) {
return false;
}
SortedMap<Double, Creature> sortedMap = new TreeMap<Double, Creature>();
for (Creature creature : skill.getEffectedList()) {
sortedMap.put(MathUtil.getDistance(firstTarget, creature), creature);
}
skill.getEffectedList().clear();
for (Creature creature : sortedMap.values()) {
if (areaCounter >= maxcount) {
break;
}
skill.getEffectedList().add(creature);
areaCounter++;
}
default:
break;
}
return true;
}
}
| {
"pile_set_name": "Github"
} |
#include <catch2/catch.hpp>
#include <tl/optional.hpp>
TEST_CASE("Nullopt", "[nullopt]") {
tl::optional<int> o1 = tl::nullopt;
tl::optional<int> o2{tl::nullopt};
tl::optional<int> o3(tl::nullopt);
tl::optional<int> o4 = {tl::nullopt};
REQUIRE(!o1);
REQUIRE(!o2);
REQUIRE(!o3);
REQUIRE(!o4);
REQUIRE(!std::is_default_constructible<tl::nullopt_t>::value);
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>YoutubePlayerDemo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>3CCFC41E19FB1565000838B6</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>3CCFC43719FB1565000838B6</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
| {
"pile_set_name": "Github"
} |
/**
* CascadeShadowMapMethod is a shadow map method to apply cascade shadow mapping on materials.
* Must be used with a DirectionalLight with a CascadeShadowMapper assigned to its shadowMapper property.
*
* @see away3d.lights.shadowmaps.CascadeShadowMapper
*/
package away3d.materials.methods;
import away3d.core.base.IRenderable;
import away3d.cameras.Camera3D;
import away3d.core.managers.Stage3DProxy;
import away3d.materials.compilation.ShaderRegisterCache;
import away3d.materials.compilation.ShaderRegisterData;
import away3d.utils.ArrayUtils;
import away3d.materials.compilation.ShaderRegisterElement;
import away3d.lights.DirectionalLight;
import away3d.lights.shadowmaps.CascadeShadowMapper;
import openfl.errors.Error;
import openfl.events.Event;
import away3d.events.ShadingMethodEvent;
import openfl.Vector;
class CascadeShadowMapMethod extends ShadowMapMethodBase {
public var baseMethod(get, set):SimpleShadowMapMethodBase;
private var _baseMethod:SimpleShadowMapMethodBase;
private var _cascadeShadowMapper:CascadeShadowMapper;
private var _depthMapCoordVaryings:Vector<ShaderRegisterElement>;
private var _cascadeProjections:Vector<ShaderRegisterElement>;
/**
* Creates a new CascadeShadowMapMethod object.
*
* @param shadowMethodBase The shadow map sampling method used to sample individual cascades (fe: HardShadowMapMethod, SoftShadowMapMethod)
*/
public function new(shadowMethodBase:SimpleShadowMapMethodBase) {
super(shadowMethodBase.castingLight);
_baseMethod = shadowMethodBase;
if (!(Std.is(_castingLight, DirectionalLight))) throw new Error("CascadeShadowMapMethod is only compatible with DirectionalLight");
_cascadeShadowMapper = cast(_castingLight.shadowMapper, CascadeShadowMapper);
if (_cascadeShadowMapper == null) throw new Error("CascadeShadowMapMethod requires a light that has a CascadeShadowMapper instance assigned to shadowMapper.");
_cascadeShadowMapper.addEventListener(Event.CHANGE, onCascadeChange, false, 0, true);
_baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, onShaderInvalidated, false, 0, true);
}
/**
* The shadow map sampling method used to sample individual cascades. These are typically those used in conjunction
* with a DirectionalShadowMapper.
*
* @see HardShadowMapMethod
* @see SoftShadowMapMethod
*/
private function get_baseMethod():SimpleShadowMapMethodBase {
return _baseMethod;
}
private function set_baseMethod(value:SimpleShadowMapMethodBase):SimpleShadowMapMethodBase {
if (_baseMethod == value) return value;
_baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, onShaderInvalidated);
_baseMethod = value;
_baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, onShaderInvalidated, false, 0, true);
invalidateShaderProgram();
return value;
}
/**
* @inheritDoc
*/
override public function initVO(vo:MethodVO):Void {
var tempVO:MethodVO = new MethodVO();
_baseMethod.initVO(tempVO);
vo.needsGlobalVertexPos = true;
vo.needsProjection = true;
}
/**
* @inheritDoc
*/
override private function set_sharedRegisters(value:ShaderRegisterData):ShaderRegisterData {
super.sharedRegisters = value;
_baseMethod.sharedRegisters = value;
return value;
}
/**
* @inheritDoc
*/
override public function initConstants(vo:MethodVO):Void {
var fragmentData:Vector<Float> = vo.fragmentData;
var vertexData:Vector<Float> = vo.vertexData;
var index:Int = vo.fragmentConstantsIndex;
fragmentData[index] = 1.0;
fragmentData[index + 1] = 1 / 255.0;
fragmentData[index + 2] = 1 / 65025.0;
fragmentData[index + 3] = 1 / 16581375.0;
fragmentData[index + 6] = .5;
fragmentData[index + 7] = -.5;
index = vo.vertexConstantsIndex;
vertexData[index] = .5;
vertexData[index + 1] = -.5;
vertexData[index + 2] = 0;
}
/**
* @inheritDoc
*/
override public function cleanCompilationData():Void {
super.cleanCompilationData();
_cascadeProjections = null;
_depthMapCoordVaryings = null;
}
/**
* @inheritDoc
*/
override public function getVertexCode(vo:MethodVO, regCache:ShaderRegisterCache):String {
var code:String = "";
var dataReg:ShaderRegisterElement = regCache.getFreeVertexConstant();
initProjectionsRegs(regCache);
vo.vertexConstantsIndex = dataReg.index * 4;
var temp:ShaderRegisterElement = regCache.getFreeVertexVectorTemp();
var i:Int = 0;
while (i < _cascadeShadowMapper.numCascades) {
code += "m44 " + temp + ", " + _sharedRegisters.globalPositionVertex + ", " + _cascadeProjections[i] + "\n" + "add " + _depthMapCoordVaryings[i] + ", " + temp + ", " + dataReg + ".zzwz\n";
++i;
}
return code;
}
/**
* Creates the registers for the cascades' projection coordinates.
*/
private function initProjectionsRegs(regCache:ShaderRegisterCache):Void {
_cascadeProjections = ArrayUtils.Prefill(new Vector<ShaderRegisterElement>(), _cascadeShadowMapper.numCascades);
_depthMapCoordVaryings =ArrayUtils.Prefill( new Vector<ShaderRegisterElement>(), _cascadeShadowMapper.numCascades);
var i:Int = 0;
while (i < _cascadeShadowMapper.numCascades) {
_depthMapCoordVaryings[i] = regCache.getFreeVarying();
_cascadeProjections[i] = regCache.getFreeVertexConstant();
regCache.getFreeVertexConstant();
regCache.getFreeVertexConstant();
regCache.getFreeVertexConstant();
++i;
}
}
/**
* @inheritDoc
*/
override public function getFragmentCode(vo:MethodVO, regCache:ShaderRegisterCache, targetReg:ShaderRegisterElement):String {
var numCascades:Int = _cascadeShadowMapper.numCascades;
var depthMapRegister:ShaderRegisterElement = regCache.getFreeTextureReg();
var decReg:ShaderRegisterElement = regCache.getFreeFragmentConstant();
var dataReg:ShaderRegisterElement = regCache.getFreeFragmentConstant();
var planeDistanceReg:ShaderRegisterElement = regCache.getFreeFragmentConstant();
var planeDistances:Vector<String> = [planeDistanceReg + ".x", planeDistanceReg + ".y", planeDistanceReg + ".z", planeDistanceReg + ".w"];
var code:String;
vo.fragmentConstantsIndex = decReg.index * 4;
vo.texturesIndex = depthMapRegister.index;
var inQuad:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp();
regCache.addFragmentTempUsages(inQuad, 1);
var uvCoord:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp();
regCache.addFragmentTempUsages(uvCoord, 1);
// assume lowest partition is selected, will be overwritten later otherwise
code = "mov " + uvCoord + ", " + _depthMapCoordVaryings[numCascades - 1] + "\n";
var i:Int = numCascades - 2;
while (i >= 0) {
var uvProjection:ShaderRegisterElement = _depthMapCoordVaryings[i];
// calculate if in texturemap (result == 0 or 1, only 1 for a single partition)
code += "slt " + inQuad + ".z, " + _sharedRegisters.projectionFragment + ".z, " + planeDistances[i] + "\n";
// z = x > minX, w = y > minY
var temp:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp();
// linearly interpolate between old and new uv coords using predicate value == conditional toggle to new value if predicate == 1 (true)
code += "sub " + temp + ", " + uvProjection + ", " + uvCoord + "\n" + "mul " + temp + ", " + temp + ", " + inQuad + ".z\n" + "add " + uvCoord + ", " + uvCoord + ", " + temp + "\n";
--i;
}
regCache.removeFragmentTempUsage(inQuad);
code += "div " + uvCoord + ", " + uvCoord + ", " + uvCoord + ".w\n" + "mul " + uvCoord + ".xy, " + uvCoord + ".xy, " + dataReg + ".zw\n" + "add " + uvCoord + ".xy, " + uvCoord + ".xy, " + dataReg + ".zz\n";
code += _baseMethod.getCascadeFragmentCode(vo, regCache, decReg, depthMapRegister, uvCoord, targetReg) + "add " + targetReg + ".w, " + targetReg + ".w, " + dataReg + ".y\n";
regCache.removeFragmentTempUsage(uvCoord);
return code;
}
/**
* @inheritDoc
*/
override public function activate(vo:MethodVO, stage3DProxy:Stage3DProxy):Void {
stage3DProxy.context3D.setTextureAt(vo.texturesIndex, _castingLight.shadowMapper.depthMap.getTextureForStage3D(stage3DProxy));
var vertexData:Vector<Float> = vo.vertexData;
var vertexIndex:Int = vo.vertexConstantsIndex;
vo.vertexData[vo.vertexConstantsIndex + 3] = -1 / (_cascadeShadowMapper.depth * _epsilon);
var numCascades:Int = _cascadeShadowMapper.numCascades;
vertexIndex += 4;
var k:Int = 0;
while (k < numCascades) {
_cascadeShadowMapper.getDepthProjections(k).copyRawDataTo(vertexData, vertexIndex, true);
vertexIndex += 16;
++k;
}
var fragmentData:Vector<Float> = vo.fragmentData;
var fragmentIndex:Int = vo.fragmentConstantsIndex;
fragmentData[(fragmentIndex + 5)] = 1 - _alpha;
var nearPlaneDistances:Vector<Float> = _cascadeShadowMapper.nearPlaneDistances;
fragmentIndex += 8;
var i:Int = 0;
while (i < numCascades) {
fragmentData[(fragmentIndex + i)] = nearPlaneDistances[i];
++i;
}
_baseMethod.activateForCascade(vo, stage3DProxy);
}
/**
* @inheritDoc
*/
override public function setRenderState(vo:MethodVO, renderable:IRenderable, stage3DProxy:Stage3DProxy, camera:Camera3D):Void {
}
/**
* Called when the shadow mappers cascade configuration changes.
*/
private function onCascadeChange(event:Event):Void {
invalidateShaderProgram();
}
/**
* Called when the base method's shader code is invalidated.
*/
private function onShaderInvalidated(event:ShadingMethodEvent):Void {
invalidateShaderProgram();
}
}
| {
"pile_set_name": "Github"
} |
#! /usr/bin/env python
"""Test script for the dumbdbm module
Original by Roger E. Masse
"""
import os
import unittest
import dumbdbm
from test import test_support
_fname = test_support.TESTFN
def _delete_files():
for ext in [".dir", ".dat", ".bak"]:
try:
os.unlink(_fname + ext)
except OSError:
pass
class DumbDBMTestCase(unittest.TestCase):
_dict = {'0': '',
'a': 'Python:',
'b': 'Programming',
'c': 'the',
'd': 'way',
'f': 'Guido',
'g': 'intended'
}
def __init__(self, *args):
unittest.TestCase.__init__(self, *args)
def test_dumbdbm_creation(self):
f = dumbdbm.open(_fname, 'c')
self.assertEqual(f.keys(), [])
for key in self._dict:
f[key] = self._dict[key]
self.read_helper(f)
f.close()
def test_dumbdbm_creation_mode(self):
# On platforms without chmod, don't do anything.
if not (hasattr(os, 'chmod') and hasattr(os, 'umask')):
return
try:
old_umask = os.umask(0002)
f = dumbdbm.open(_fname, 'c', 0637)
f.close()
finally:
os.umask(old_umask)
expected_mode = 0635
is_posix = True
if os.name == 'java':
if os._name != 'posix':
is_posix = False
elif os.name != 'posix':
is_posix = False
if not is_posix:
# Windows only supports setting the read-only attribute.
# This shouldn't fail, but doesn't work like Unix either.
expected_mode = 0666
import stat
st = os.stat(_fname + '.dat')
self.assertEqual(stat.S_IMODE(st.st_mode), expected_mode)
st = os.stat(_fname + '.dir')
self.assertEqual(stat.S_IMODE(st.st_mode), expected_mode)
def test_close_twice(self):
f = dumbdbm.open(_fname)
f['a'] = 'b'
self.assertEqual(f['a'], 'b')
f.close()
f.close()
def test_dumbdbm_modification(self):
self.init_db()
f = dumbdbm.open(_fname, 'w')
self._dict['g'] = f['g'] = "indented"
self.read_helper(f)
f.close()
def test_dumbdbm_read(self):
self.init_db()
f = dumbdbm.open(_fname, 'r')
self.read_helper(f)
f.close()
def test_dumbdbm_keys(self):
self.init_db()
f = dumbdbm.open(_fname)
keys = self.keys_helper(f)
f.close()
def test_write_write_read(self):
# test for bug #482460
f = dumbdbm.open(_fname)
f['1'] = 'hello'
f['1'] = 'hello2'
f.close()
f = dumbdbm.open(_fname)
self.assertEqual(f['1'], 'hello2')
f.close()
def test_line_endings(self):
# test for bug #1172763: dumbdbm would die if the line endings
# weren't what was expected.
f = dumbdbm.open(_fname)
f['1'] = 'hello'
f['2'] = 'hello2'
f.close()
# Mangle the file by adding \r before each newline
fp = open(_fname + '.dir', 'r+')
data = fp.read()
data = data.replace('\n', '\r\n')
fp.seek(0)
fp.truncate()
fp.write(data)
fp.close()
f = dumbdbm.open(_fname)
self.assertEqual(f['1'], 'hello')
self.assertEqual(f['2'], 'hello2')
f.close()
def read_helper(self, f):
keys = self.keys_helper(f)
for key in self._dict:
self.assertEqual(self._dict[key], f[key])
def init_db(self):
f = dumbdbm.open(_fname, 'w')
for k in self._dict:
f[k] = self._dict[k]
f.close()
def keys_helper(self, f):
keys = f.keys()
keys.sort()
dkeys = self._dict.keys()
dkeys.sort()
self.assertEqual(keys, dkeys)
return keys
# Perform randomized operations. This doesn't make assumptions about
# what *might* fail.
def test_random(self):
import random
d = {} # mirror the database
for dummy in range(5):
f = dumbdbm.open(_fname)
for dummy in range(100):
k = random.choice('abcdefghijklm')
if random.random() < 0.2:
if k in d:
del d[k]
del f[k]
else:
v = random.choice('abc') * random.randrange(10000)
d[k] = v
f[k] = v
self.assertEqual(f[k], v)
f.close()
f = dumbdbm.open(_fname)
expected = d.items()
expected.sort()
got = f.items()
got.sort()
self.assertEqual(expected, got)
f.close()
def tearDown(self):
_delete_files()
def setUp(self):
_delete_files()
def test_main():
try:
test_support.run_unittest(DumbDBMTestCase)
finally:
_delete_files()
if __name__ == "__main__":
test_main()
| {
"pile_set_name": "Github"
} |
//
// This is a single-, double-, triple-, and quadruple-click detector
// component for LinuxCNC.
//
// Copyright 2012 Sebastian Kuzminsky <[email protected]>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
component multiclick "Single-, double-, triple-, and quadruple-click detector";
license "GPL";
pin in bit in "The input line, this is where we look for clicks.";
pin out bit single_click
"Goes high briefly when a single-click is detected on the 'in' pin.";
pin out bit single_click_only
"""Goes high briefly when a single-click is detected on the 'in' pin
and no second click followed it.""";
pin out bit double_click
"Goes high briefly when a double-click is detected on the 'in' pin.";
pin out bit double_click_only
"""Goes high briefly when a double-click is detected on the 'in' pin
and no third click followed it.""";
pin out bit triple_click
"Goes high briefly when a triple-click is detected on the 'in' pin.";
pin out bit triple_click_only
"""Goes high briefly when a triple-click is detected on the 'in' pin
and no fourth click followed it.""";
pin out bit quadruple_click
"Goes high briefly when a quadruple-click is detected on the 'in' pin.";
pin out bit quadruple_click_only
"""Goes high briefly when a quadruple-click is detected on the 'in'
pin and no fifth click followed it.""";
// for debugging
pin out s32 state;
param rw bit invert_input = FALSE
"""If FALSE (the default), clicks start with rising edges. If TRUE,
clicks start with falling edges.""";
param rw u32 max_hold_ns = 250000000
"""If the input is held down longer than this, it's not part of a
multi-click. (Default 250,000,000 ns, 250 ms.)""";
param rw u32 max_space_ns = 250000000
"""If the input is released longer than this, it's not part of a
multi-click. (Default 250,000,000 ns, 250 ms.)""";
param rw u32 output_hold_ns = 100000000
"""Positive pulses on the output pins last this long. (Default
100,000,000 ns, 100 ms.)""";
variable int click_state = 0; // wish i could have an enum type here
//
// When entering a new non-IDLE state in the state machine, timer is set to
// 0 and timeout is set to the timeout for the new state.
//
// Each time the component's function runs and the state machine is not
// IDLE, the timer is incremented by the thread period. When the timer
// exceeds the timeout, the state machine resets.
//
variable unsigned timer;
variable unsigned timeout;
//
// When an "X"-click (for X={single,double,triple,quadruple}) is detected,
// the X-click pin goes high and the X_click_hold_timer is set to the
// output_hold_ns param. Each invocation of the function, the
// X_click_hold_timer is decremented by the thread period, and when the
// timer falls below 0, the X-click output pin goes back to low again.
//
// Similarly for the X_click_only_hold_timer, but it doesnt start until
// max_space_ns after the click is detected (to ensure that this is not an
// X+1 click).
//
variable unsigned single_click_hold_timer;
variable unsigned single_click_only_hold_timer;
variable unsigned double_click_hold_timer;
variable unsigned double_click_only_hold_timer;
variable unsigned triple_click_hold_timer;
variable unsigned triple_click_only_hold_timer;
variable unsigned quadruple_click_hold_timer;
variable unsigned quadruple_click_only_hold_timer;
description """A click is defined as a rising edge on the 'in' pin,
followed by the 'in' pin being True for at most 'max-hold-ns' nanoseconds,
followed by a falling edge.
A double-click is defined as two clicks, separated by at
most 'max-space-ns' nanoseconds with the 'in' pin in the False state.
I bet you can guess the definition of triple- and quadruple-click.
You probably want to run the input signal through a debounce component
before feeding it to the multiclick detector, if the input is at all
noisy.
The '*-click' pins go high as soon as the input detects the correct
number of clicks.
The '*-click-only' pins go high a short while after the click, after
the click separator space timeout has expired to show that no further
click is coming. This is useful for triggering halui MDI commands.""";
function _ nofp "Detect single-, double-, triple-, and quadruple-clicks";
;;
typedef enum {
IDLE = 0,
SAW_FIRST_RISING_EDGE,
SAW_FIRST_CLICK,
SAW_SECOND_RISING_EDGE,
SAW_SECOND_CLICK,
SAW_THIRD_RISING_EDGE,
SAW_THIRD_CLICK,
SAW_FOURTH_RISING_EDGE,
SAW_FOURTH_CLICK,
HELD_TOO_LONG
} state_t;
FUNCTION(_) {
int new_in = in;
if (1 == invert_input) {
new_in = !new_in;
}
if (click_state != IDLE) {
timer += period;
}
//
// update the output pins
//
if (single_click_hold_timer > 0) {
if (single_click_hold_timer > period) {
single_click_hold_timer -= period;
} else {
single_click_hold_timer = 0;
single_click = 0;
}
}
if (single_click_only_hold_timer > 0) {
if (single_click_only_hold_timer > period) {
single_click_only_hold_timer -= period;
} else {
single_click_only_hold_timer = 0;
single_click_only = 0;
}
}
if (double_click_hold_timer > 0) {
if (double_click_hold_timer > period) {
double_click_hold_timer -= period;
} else {
double_click_hold_timer = 0;
double_click = 0;
}
}
if (double_click_only_hold_timer > 0) {
if (double_click_only_hold_timer > period) {
double_click_only_hold_timer -= period;
} else {
double_click_only_hold_timer = 0;
double_click_only = 0;
}
}
if (triple_click_hold_timer > 0) {
if (triple_click_hold_timer > period) {
triple_click_hold_timer -= period;
} else {
triple_click_hold_timer = 0;
triple_click = 0;
}
}
if (triple_click_only_hold_timer > 0) {
if (triple_click_only_hold_timer > period) {
triple_click_only_hold_timer -= period;
} else {
triple_click_only_hold_timer = 0;
triple_click_only = 0;
}
}
if (quadruple_click_hold_timer > 0) {
if (quadruple_click_hold_timer > period) {
quadruple_click_hold_timer -= period;
} else {
quadruple_click_hold_timer = 0;
quadruple_click = 0;
}
}
if (quadruple_click_only_hold_timer > 0) {
if (quadruple_click_only_hold_timer > period) {
quadruple_click_only_hold_timer -= period;
} else {
quadruple_click_only_hold_timer = 0;
quadruple_click_only = 0;
}
}
//
// update state, if needed
//
switch (click_state) {
case IDLE: {
if (1 == new_in) {
click_state = SAW_FIRST_RISING_EDGE;
timer = 0;
timeout = max_hold_ns;
}
break;
}
case SAW_FIRST_RISING_EDGE: {
if (0 == new_in) {
click_state = SAW_FIRST_CLICK;
timer = 0;
timeout = max_space_ns;
single_click = 1;
single_click_hold_timer = output_hold_ns;
}
break;
}
case SAW_FIRST_CLICK: {
if (1 == new_in) {
click_state = SAW_SECOND_RISING_EDGE;
timer = 0;
timeout = max_hold_ns;
}
break;
}
case SAW_SECOND_RISING_EDGE: {
if (0 == new_in) {
click_state = SAW_SECOND_CLICK;
timer = 0;
timeout = max_space_ns;
double_click = 1;
double_click_hold_timer = output_hold_ns;
}
break;
}
case SAW_SECOND_CLICK: {
if (1 == new_in) {
click_state = SAW_THIRD_RISING_EDGE;
timer = 0;
timeout = max_hold_ns;
}
break;
}
case SAW_THIRD_RISING_EDGE: {
if (0 == new_in) {
click_state = SAW_THIRD_CLICK;
timer = 0;
timeout = max_space_ns;
triple_click = 1;
triple_click_hold_timer = output_hold_ns;
}
break;
}
case SAW_THIRD_CLICK: {
if (1 == new_in) {
click_state = SAW_FOURTH_RISING_EDGE;
timer = 0;
timeout = max_hold_ns;
}
break;
}
case SAW_FOURTH_RISING_EDGE: {
if (0 == new_in) {
// four clicks is the most we look for, and we just saw it,
// so we're done now
click_state = SAW_FOURTH_CLICK;
timer = 0;
timeout = max_space_ns;
quadruple_click = 1;
quadruple_click_hold_timer = output_hold_ns;
}
break;
}
case SAW_FOURTH_CLICK: {
if (1 == new_in) {
click_state = HELD_TOO_LONG;
}
break;
}
case HELD_TOO_LONG: {
if (0 == new_in) {
click_state = IDLE;
}
break;
}
default: {
// invalid click_state!
click_state = IDLE;
}
}
if ((click_state != IDLE) && (click_state != HELD_TOO_LONG) && (timer > timeout)) {
if (1 == new_in) {
click_state = HELD_TOO_LONG;
} else {
// timeout after some activity on the input line, trigger one
// of the "only" outputs if appropriate
switch (click_state) {
case SAW_FIRST_CLICK: {
single_click_only = 1;
single_click_only_hold_timer = output_hold_ns;
break;
}
case SAW_SECOND_CLICK: {
double_click_only = 1;
double_click_only_hold_timer = output_hold_ns;
break;
}
case SAW_THIRD_CLICK: {
triple_click_only = 1;
triple_click_only_hold_timer = output_hold_ns;
break;
}
case SAW_FOURTH_CLICK: {
quadruple_click_only = 1;
quadruple_click_only_hold_timer = output_hold_ns;
break;
}
}
click_state = IDLE;
}
}
state = click_state;
}
| {
"pile_set_name": "Github"
} |
package thaumcraft.api.casters;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.UUID;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.RayTraceResult;
public class FocusEngine {
public static HashMap<String,Class<IFocusElement>> elements = new HashMap<>();
private static HashMap<String,ResourceLocation> elementIcons = new HashMap<>();
private static HashMap<String,Integer> elementColor = new HashMap<>();
public static void registerElement(Class element, ResourceLocation icon, int color) {
try {
IFocusElement fe = (IFocusElement) element.newInstance();
elements.put(fe.getKey(), element);
elementIcons.put(fe.getKey(), icon);
elementColor.put(fe.getKey(), color);
} catch (Exception e) { }
}
public static IFocusElement getElement(String key) {
try {
return elements.get(key).newInstance();
} catch (Exception e) { }
return null;
}
public static ResourceLocation getElementIcon(String key) {
return elementIcons.get(key);
}
public static int getElementColor(String key) {
return elementColor.get(key);
}
public static boolean doesPackageContainElement(FocusPackage focusPackage, String key) {
for (IFocusElement node: focusPackage.nodes) {
if (node.getKey().equals(key)) return true;
}
return false;
}
/**
*
* @param caster
* @param focusPackage
* @param nocopy set to true only if the focus package passed in is temporary and not attached to an actual focus.
* Use this to preserve any settings, targets, etc that has been set during package construction
*/
public static void castFocusPackage(EntityLivingBase caster, FocusPackage focusPackage, boolean nocopy) {
FocusPackage focusPackageCopy;
if (nocopy)
focusPackageCopy = focusPackage;
else
focusPackageCopy = focusPackage.copy(caster);
focusPackageCopy.initialize(caster);
focusPackageCopy.setUniqueID(UUID.randomUUID());
for (FocusEffect effect:focusPackageCopy.getFocusEffects()) {
effect.onCast(caster);
}
runFocusPackage(focusPackageCopy, null, null);
}
/**
* Overrides castFocusPackage(EntityLivingBase caster, FocusPackage focusPackage, boolean nocopy) with nocopy = false
* @param caster
* @param focusPackage
*/
public static void castFocusPackage(EntityLivingBase caster, FocusPackage focusPackage) {
castFocusPackage(caster,focusPackage,false);
}
public static void runFocusPackage(FocusPackage focusPackage, Trajectory[] trajectories, RayTraceResult[] targets) {
Trajectory[] prevTrajectories = trajectories;
RayTraceResult[] prevTargets = targets;
synchronized (focusPackage.nodes) {
if (!(focusPackage.nodes.get(0) instanceof FocusMediumRoot)) {
focusPackage.nodes.add(0,new FocusMediumRoot(trajectories,targets));
}
for (int idx=0;idx<focusPackage.nodes.size();idx++) {
focusPackage.setExecutionIndex(idx);
IFocusElement node = focusPackage.nodes.get(idx);
if (idx>0 && ((FocusNode)node).getParent()==null) {
IFocusElement nodePrev = focusPackage.nodes.get(idx-1);
if (node instanceof FocusNode && nodePrev instanceof FocusNode) {
((FocusNode)node).setParent((FocusNode)nodePrev);
}
}
if (node instanceof FocusNode && ((FocusNode)node).getPackage()==null) {
((FocusNode)node).setPackage(focusPackage);
}
if (node instanceof FocusNode) {
focusPackage.multiplyPower(((FocusNode)node).getPowerMultiplier());
}
if (node instanceof FocusPackage) {
runFocusPackage((FocusPackage) node, prevTrajectories, prevTargets);
break;
}
else
if (node instanceof FocusMedium) {
FocusMedium medium = (FocusMedium) node;
if (prevTrajectories!=null)
for (Trajectory trajectory : prevTrajectories) {
medium.execute(trajectory);
}
if (medium.hasIntermediary()) break;
}
else
if (node instanceof FocusMod) {
if (node instanceof FocusModSplit) {
FocusModSplit split = (FocusModSplit) node;
for (FocusPackage sp : split.getSplitPackages() ) {
split.setPackage(sp);
sp.multiplyPower(focusPackage.getPower());
split.execute();
/*returnLast =*/ runFocusPackage(sp,split.supplyTrajectories(),split.supplyTargets());
}
break;
} else {
((FocusMod) node).execute();
}
}
else
if (node instanceof FocusEffect) {
FocusEffect effect = (FocusEffect) node;
if (prevTargets!=null) {
int num=0;
for (RayTraceResult target : prevTargets) {
if (target.entityHit!=null) {
String k = target.entityHit.getEntityId() + focusPackage.getUniqueID().toString();
if (damageResistList.contains(k) && target.entityHit.hurtResistantTime>0) {
target.entityHit.hurtResistantTime=0;
} else {
if (damageResistList.size()>10) damageResistList.remove(0);
damageResistList.add(k);
}
}
Trajectory tra = prevTrajectories!=null? ((prevTrajectories.length==prevTargets.length) ? prevTrajectories[num] : prevTrajectories[0]) : null;
effect.execute(target, tra, focusPackage.getPower(), num);
num++;
}
}
}
if (node instanceof FocusNode) {
prevTrajectories = ((FocusNode)node).supplyTrajectories();
prevTargets = ((FocusNode)node).supplyTargets();
}
}
}
}
private static ArrayList<String> damageResistList = new ArrayList<>();
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>DAY Function</title>
</head>
<body>
<h1><code>DAY</code> Function</h1>
<p>Returns the day-of-month part of a date/time string. </p>
<h2>Syntax</h2>
<blockquote>
<code>DAY(<i>date</i>)</code>
</blockquote>
<h2>Arguments</h2>
<ul class="args">
<li><b>date</b> (date/time expression)<br>A text value that can be parsed into a date/time. </li>
</ul>
<h2>Return Value</h2>
<blockquote>
An integer representing the specified day of the month.
</blockquote>
<h2>Examples</h2>
<ul class="examples">
<li><code>PRINT DAY('2016-03-07');</code><br>Prints 7. </li>
<li><code>PRINT DAY('2016-07-23 22:06:53.742 -04:00');</code><br>Prints 23. </li>
</ul>
<br>
</body>
</html>
| {
"pile_set_name": "Github"
} |
Network Working Group M. Andrews
Internet-Draft ISC
Intended status: Best Current Practice April 6, 2016
Expires: October 8, 2016
A Common Operational Problem in DNS Servers - Failure To Respond.
draft-ietf-dnsop-no-response-issue-03
Abstract
The DNS is a query / response protocol. Failure to respond or to
respond correctly to queries causes both immediate operational
problems and long term problems with protocol development.
This document identifies a number of common kinds of queries to which
some servers either fail to respond or else respond incorrectly.
This document also suggests procedures for TLD and other similar zone
operators to apply to help reduce / eliminate the problem.
The document does not look at the DNS data itself, just the structure
of the responses.
Status of This Memo
This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
This Internet-Draft will expire on October 8, 2016.
Copyright Notice
Copyright (c) 2016 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of
Andrews Expires October 8, 2016 [Page 1]
Internet-Draft Failure to respond April 2016
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Common queries kinds that result in non responses. . . . . . 3
2.1. EDNS Queries - Version Independent . . . . . . . . . . . 3
2.2. EDNS Queries - Version Specific . . . . . . . . . . . . . 4
2.3. EDNS Options . . . . . . . . . . . . . . . . . . . . . . 4
2.4. EDNS Flags . . . . . . . . . . . . . . . . . . . . . . . 4
2.5. DNS Flags . . . . . . . . . . . . . . . . . . . . . . . . 4
2.6. Unknown / Unsupported Type Queries . . . . . . . . . . . 5
2.7. Unknown DNS opcodes . . . . . . . . . . . . . . . . . . . 5
2.8. TCP Queries . . . . . . . . . . . . . . . . . . . . . . . 5
3. Remediating . . . . . . . . . . . . . . . . . . . . . . . . . 5
4. Firewalls and Load Balancers . . . . . . . . . . . . . . . . 7
5. Scrubbing Services . . . . . . . . . . . . . . . . . . . . . 8
6. Whole Answer Caches . . . . . . . . . . . . . . . . . . . . . 9
7. Response Code Selection . . . . . . . . . . . . . . . . . . . 9
8. Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
8.1. Testing - Basic DNS . . . . . . . . . . . . . . . . . . . 10
8.2. Testing - Extended DNS . . . . . . . . . . . . . . . . . 12
9. Security Considerations . . . . . . . . . . . . . . . . . . . 15
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16
11. Normative References . . . . . . . . . . . . . . . . . . . . 16
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 17
1. Introduction
The DNS [RFC1034], [RFC1035] is a query / response protocol. Failure
to respond to queries or to respond incorrectly causes both immediate
operational problems and long term problems with protocol
development.
Failure to respond to a query is indistinguishable from a packet loss
without doing a analysis of query response patterns and results in
unnecessary additional queries being made by DNS clients and
unnecessary delays being introduced to the resolution process.
Due to the inability to distinguish between packet loss and
nameservers dropping EDNS [RFC6891] queries, packet loss is sometimes
misclassified as lack of EDNS support which can lead to DNSSEC
validation failures.
Andrews Expires October 8, 2016 [Page 2]
Internet-Draft Failure to respond April 2016
Allowing servers which fail to respond to queries to remain results
in developers being afraid to deploy implementations of recent
standards. Such servers need to be identified and corrected /
replaced.
The DNS has response codes that cover almost any conceivable query
response. A nameserver should be able to respond to any conceivable
query using them.
Unless a nameserver is under attack, it should respond to all queries
directed to it as a result of following delegations. Additionally
code should not assume that there isn't a delegation to the server
even if it is not configured to serve the zone. Broken delegations
are a common occurrence in the DNS and receiving queries for zones
that the server is not configured for is not necessarily an
indication that the server is under attack. Parent zone operators
are supposed to regularly check that the delegating NS records are
consistent with those of the delegated zone and to correct them when
they are not [RFC1034]. If this was being done regularly, the
instances of broken delegations would be much lower.
When a nameserver is under attack it may wish to drop packets. A
common attack is to use a nameserver as a amplifier by sending
spoofed packets. This is done because response packets are bigger
than the queries and big amplification factors are available
especially if EDNS is supported. Limiting the rate of responses is
reasonable when this is occurring and the client should retry. This
however only works if legitimate clients are not being forced to
guess whether EDNS queries are accept or not. While there is still a
pool of servers that don't respond to EDNS requests, clients have no
way to know if the lack of response is due to packet loss, EDNS
packets not being supported or rate limiting due to the server being
under attack. Mis-classifications of server characteristics are
unavoidable when rate limiting is done.
2. Common queries kinds that result in non responses.
There are three common query kinds that result in non responses
today. These are EDNS queries, queries for unknown (unallocated) or
unsupported types, and filtering of TCP queries.
2.1. EDNS Queries - Version Independent
Identifying servers that fail to respond to EDNS queries can be done
by first identifying that the server responds to regular DNS queries,
followed by a series of otherwise identical queries using EDNS, then
making the original query again. A series of EDNS queries is needed
as at least one DNS implementation responds to the first EDNS query
Andrews Expires October 8, 2016 [Page 3]
Internet-Draft Failure to respond April 2016
with FORMERR but fails to respond to subsequent queries from the same
address for a period until a regular DNS query is made. The EDNS
query should specify a UDP buffer size of 512 bytes to avoid false
classification of not supporting EDNS due to response packet size.
If the server responds to the first and last queries but fails to
respond to most or all of the EDNS queries, it is probably faulty.
The test should be repeated a number of times to eliminate the
likelihood of a false positive due to packet loss.
Firewalls may also block larger EDNS responses but there is no easy
way to check authoritative servers to see if the firewall is
misconfigured.
2.2. EDNS Queries - Version Specific
Some servers respond correctly to EDNS version 0 queries but fail to
respond to EDNS queries with version numbers that are higher than
zero. Servers should respond with BADVERS to EDNS queries with
version numbers that they do not support.
Some servers respond correctly to EDNS version 0 queries but fail to
set QR=1 when responding to EDNS versions they do not support. Such
answers are discarded or treated as requests.
2.3. EDNS Options
Some servers fail to respond to EDNS queries with EDNS options set.
Unknown EDNS options are supposed to be ignored by the server
[RFC6891].
2.4. EDNS Flags
Some servers fail to respond to EDNS queries with EDNS flags set.
Server should ignore EDNS flags they do not understand and should not
add them to the response [RFC6891].
2.5. DNS Flags
Some servers fail to respond to DNS queries with various DNS flags
set, regardless of whether they are defined or still reserved. At
the time of writing there are servers that fail to respond to queries
with the AD bit set to 1 and servers that fail to respond to queries
with the last reserved flag bit set.
Andrews Expires October 8, 2016 [Page 4]
Internet-Draft Failure to respond April 2016
2.6. Unknown / Unsupported Type Queries
Identifying servers that fail to respond to unknown or unsupported
types can be done by making an initial DNS query for an A record,
making a number of queries for an unallocated type, then making a
query for an A record again. IANA maintains a registry of allocated
types.
If the server responds to the first and last queries but fails to
respond to the queries for the unallocated type, it is probably
faulty. The test should be repeated a number of times to eliminate
the likelihood of a false positive due to packet loss.
2.7. Unknown DNS opcodes
The use of previously undefined opcodes is to be expected. Since the
DNS was first defined two new opcodes have been added, UPDATE and
NOTIFY.
NOTIMP is the expected rcode to an unknown / unimplemented opcode.
Note: while new opcodes will most probably use the current layout
structure for the rest of the message there is no requirement than
anything other than the DNS header match.
2.8. TCP Queries
All DNS servers are supposed to respond to queries over TCP
[RFC5966]. Firewalls that drop TCP connection attempts rather that
resetting the connect attempt or send a ICMP/ICMPv6 administratively
prohibited message introduce excessive delays to the resolution
process.
Whether a server accepts TCP connections can be tested by first
checking that it responds to UDP queries to confirm that it is up and
operating, then attempting the same query over TCP. An additional
query should be made over UDP if the TCP connection attempt fails to
confirm that the server under test is still operating.
3. Remediating
While the first step in remediating this problem is to get the
offending nameserver code corrected, there is a very long tail
problem with DNS servers in that it can often take over a decade
between the code being corrected and a nameserver being upgraded with
corrected code. With that in mind it is requested that TLD, and
other similar zone operators, take steps to identify and inform their
customers, directly or indirectly through registrars, that they are
Andrews Expires October 8, 2016 [Page 5]
Internet-Draft Failure to respond April 2016
running such servers and that the customers need to correct the
problem.
TLD operators are being asked to do this as they, due to the nature
of running a TLD and the hierarchical nature of the DNS, have access
to a large numbers of nameserver names as well as contact details for
the registrants of those nameservers. While it is possible to
construct lists of nameservers from other sources, and that has been
done to survey the state of the Internet, that doesn't give the
tester the contact details necessary to inform the operators. The
SOA RNAME is often invalid and whois data is obscured and / or not
available which makes it infeasible for others to do this.
While this section talks about TLD operators performing this work, it
may be done by registrars on behalf of the TLD operator. The intent
is to ensure that the testing happens and that operators of non-
compliant nameservers be informed, rather than to prescribe who does
the actual testing and communication. Note: having registrars
perform this testing and reporting is likely to result in duplicate
reports for the same server being issued by multiple registrars.
TLD operators should construct a list of servers child zones are
delegated to along with a delegated zone name. This name shall be
the query name used to test the server as it is supposed to exist.
For each server the TLD operator shall make an SOA query of the
delegated zone name. This should result in the SOA record being
returned in the answer section. If the SOA record is not returned
but some other response is returned, this is a indication of a bad
delegation and the TLD operator should take whatever steps it
normally takes to rectify a bad delegation. If more that one zone is
delegated to the server, it should choose another zone until it finds
a zone which responds correctly or it exhausts the list of zones
delegated to the server.
If the server fails to get a response to a SOA query, the TLD
operator should make an A query as some nameservers fail to respond
to SOA queries but respond to A queries. If it gets no response to
the A query, another delegated zone should be queried for as some
nameservers fail to respond to zones they are not configured for. If
subsequent queries find a responding zone, all delegation to this
server need to be checked and rectified using the TLD's normal
procedures.
Having identified a working <server, query name> tuple the TLD
operator should now check that the server responds to EDNS, Unknown
Query Type and TCP tests as described above. If the TLD operator
finds that server fails any of the tests, the TLD operator shall take
Andrews Expires October 8, 2016 [Page 6]
Internet-Draft Failure to respond April 2016
steps to inform the operator of the server that they are running a
faulty nameserver and that they need to take steps to correct the
matter. The TLD operator shall also record the <server, query name>
for follow-up testing.
If repeated attempts to inform and get the customer to correct /
replace the faulty server are unsuccessful the TLD operator shall
remove all delegations to said server from the zone. Removal of
delegations is the step of last resort in handling complaints as
specified in [RFC1033] COMPLAINTS.
It will also be necessary for TLD operators to repeat the scans
periodically. It is recommended that this be performed monthly
backing off to bi-annually once the numbers of faulty servers found
drops off to less than 1 in 100000 servers tested. Follow-up tests
for faulty servers still need to be performed monthly.
Some operators claim that they can't perform checks at registration
time. If a check is not performed at registration time, it needs to
be performed within a week of registration in order to detect faulty
servers swiftly.
Checking of delegations by TLD operators should be nothing new as
they have been required from the very beginnings of DNS to do this
[RFC1034]. Checking for compliance of nameserver operations should
just be a extension of such testing.
It is recommended that TLD operators setup a test web page which
performs the tests the TLD operator performs as part of their regular
audits to allow nameserver operators to test that they have correctly
fixed their servers. Such tests should be rate limited to avoid
these pages being a denial of service vector.
Nothing in this section precludes others testing servers for protocol
compliance. DNS operators should test their servers to ensure that
their vendors have shipped protocol compliant products. Nameserver
vendors can use these tests as a part of this release processes.
Registrants can use these tests to check their DNS operators servers.
4. Firewalls and Load Balancers
Firewalls and load balancers can affect the externally visible
behaviour of a nameserver. Tests for conformance need to be done
from outside of any firewall so that the system as a whole is tested.
Firewalls and load balancers should not drop DNS packets that they
don't understand. They should either pass through the packets or
generate an appropriate error response.
Andrews Expires October 8, 2016 [Page 7]
Internet-Draft Failure to respond April 2016
Requests for unknown query types is normal client behaviour and
should not be construed as an attack. Nameservers have always been
expected to be able to handle such queries.
Requests with unassigned flags set (DNS or EDNS) is expected client
behaviour and should not be construed as an attack. The behaviour
for unassigned is to ignore them in the request and to not set them
in the response. All dropping DNS / EDNS packets with unassigned
flags does is make it harder to deploy extensions that make use of
them due to the need to reconfigure / update firewalls.
Requests with unknown EDNS options is expected client behaviour and
should not be construed as an attack. The correct behaviour for
unknown EDNS options is to ignore there presence when constructing a
reply.
Requests with unknown EDNS versions is expected client behaviour and
should not be construed as an attack. The correct behaviour for
unknown EDNS versions is to return BADVERS along with the highest
EDNS version the server supports. All dropping EDNS packets does is
break EDNS version negotiation.
Firewalls should not assume that there will only be a single response
message to a requests. There have been proposals to use EDNS to
signal that multiple DNS messages be returned rather than a single
UDP message that is fragmented at the IP layer.
5. Scrubbing Services
Scrubbing services, like firewalls, can affect the externally visible
behaviour of a nameserver. If a operator uses a scrubbing service,
they should check that legitimate queries are not being blocked.
Scrubbing services, unlike firewalls, are also turned on and off in
response to denial of service attacks. One needs to take care when
choosing a scrubbing service and ask questions like:
Do they pass unknown DNS query types?
Do they pass unknown EDNS versions?
Do they pass unknown EDNS options?
Do they pass unknown EDNS flags?
Do they pass requests with unknown DNS opcodes?
Andrews Expires October 8, 2016 [Page 8]
Internet-Draft Failure to respond April 2016
Do they pass requests with the remaining reserved DNS header flag
bit set?
None of these are attack vectors but some scrubbing services treat
them as such.
6. Whole Answer Caches
Whole answer caches take a previously constructed answer and return
it to a subsequent query for the same qname, qtype and qclass, just
updating the query id field and possibly the qname to match the
incoming query to avoid constructing each response individually.
Whole answer caches can return the wrong response to a query if they
do not take all of the attributes of the query into account, rather
than just some of them e.g. qname, qtype and qclass. This has
implications when testing and with overall protocol compliance.
e.g. There are whole answer caches that ignore the EDNS version
field which results in incorrect answers to non EDNS version 0
queries being returned if they were preceded by a EDNS version 0
query for the same name and type.
e.g. There are caches that ignore the EDNS options in the query
resulting in options only working some of the time and/or options
being returned when not requested.
7. Response Code Selection
Choosing the correct response code when fixing a nameserver is
important. Just because a type is not implemented does not mean that
NOTIMP is the correct response code to return. Response codes need
to be chosen considering how clients will handle them.
For unimplemented opcodes NOTIMP is the expected response code.
Additionally a new opcode could change the message format by
extending the header or changing the structure of the records etc.
This may result in FORMERR being returned though NOTIMP would be more
correct.
In general, for unimplemented type codes Name Error (NXDOMAIN) and
NOERROR (no data) are the expected response codes. A server is not
supposed to serve a zone which contains unsupported types ([RFC1034])
so the only thing left is return if the QNAME exists or not. NOTIMP
and REFUSED are not useful responses as they force the clients to try
all the authoritative servers for a zone looking for a server which
will answer the query.
Andrews Expires October 8, 2016 [Page 9]
Internet-Draft Failure to respond April 2016
Meta queries type may be the exception but these need to be thought
about on a case by case basis.
If the server supports EDNS and get a query with an unsupported EDNS
version, the correct response is BADVERS [RFC6891].
If the server do not support EDNS at all, FORMERR and NOTIMP are the
expected error codes. That said a minimal EDNS server implementation
just requires parsing the OPT records and responding with an empty
OPT record. There is no need to interpret any EDNS options present
in the request as unsupported options are expected to be ignored
[RFC6891].
8. Testing
Testing is divided into two sections. Basic DNS which all servers
should meet and Extended DNS which should be met by all servers that
support EDNS. If a server does not support EDNS it should still
respond to all the tests.
It is advisable to run all of the tests below in parallel so as to
minimise the delays due to multiple timeouts when the servers do not
respond.
The tests below use dig from BIND 9.11.0 which is still in
development.
8.1. Testing - Basic DNS
This first set of tests cover basic DNS server behaviour and all
servers should pass these tests.
Verify the server is configured for the zone:
dig +noedns +noad +norec soa $zone @$server
expect: status: NOERROR
expect: SOA record
expect: flag: aa to be present
Andrews Expires October 8, 2016 [Page 10]
Internet-Draft Failure to respond April 2016
Check that TCP queries work:
dig +noedns +noad +norec +tcp soa $zone @$server
expect: status: NOERROR
expect: SOA record
expect: flag: aa to be present
The requirement that TCP be supported is defined in [RFC5966].
Check that queries for an unknown type work:
dig +noedns +noad +norec type1000 $zone @$server
expect: status: NOERROR
expect: an empty answer section.
expect: flag: aa to be present
That new types are to be expected is specified in Section 3.6,
[RFC1035]. Servers that don't support a new type are expected to
reject a zone that contains a unsupported type as per Section 5.2,
[RFC1035]. This means that a server that does load a zone can answer
questions for unknown types with NOERROR or NXDOMAIN as per
Section 4.3.2, [RFC1034]. [RFC6895] later reserved distinct ranges
for meta and data types which allows servers to be definitive about
whether a query should be answerable from zone content or not.
Check that queries with CD=1 work:
dig +noedns +noad +norec +cd soa $zone @$server
expect: status: NOERROR
expect: SOA record to be present
expect: flag: aa to be present
CD use in queries is defined in [RFC4035].
Check that queries with AD=1 work:
dig +noedns +norec +ad soa $zone @$server
expect: status: NOERROR
expect: SOA record to be present
expect: flag: aa to be present
AD use in queries is defined in [RFC6840].
Andrews Expires October 8, 2016 [Page 11]
Internet-Draft Failure to respond April 2016
Check that queries with the last unassigned DNS header flag work and
that the flag bit is not copied to the response:
dig +noedns +noad +norec +zflag soa $zone @$server
expect: status: NOERROR
expect: SOA record to be present
expect: MBZ to not be in the response
expect: flag: aa to be present
MBZ (Must Be Zero) presence indicates the flag bit has been
incorrectly copied. See Section 4.1.1, [RFC1035] "Z Reserved for
future use. Must be zero in all queries and responses."
Check that new opcodes are handled:
dig +noedns +noad +opcode=15 +norec +header-only @$server
expect: status: NOTIMP
expect: SOA record to not be present
expect: flag: aa to NOT be present
As unknown opcodes have no definition, including packet format other
than there must be a DNS header present, there is only one possible
rcode that make sense to return to a request with a unknown opcode
and that is NOTIMP.
8.2. Testing - Extended DNS
The next set of test cover various aspects of EDNS behaviour. If any
of these tests succeed, then all of them should succeed. There are
servers that support EDNS but fail to handle plain EDNS queries
correctly so a plain EDNS query is not a good indicator of lack of
EDNS support.
Check that plain EDNS queries work:
dig +nocookie +edns=0 +noad +norec soa $zone @$server
expect: status: NOERROR
expect: SOA record to be present
expect: OPT record to be present
expect: EDNS Version 0 in response
expect: flag: aa to be present
+nocookie disables sending a EDNS COOKIE option in which is on by
default.
Andrews Expires October 8, 2016 [Page 12]
Internet-Draft Failure to respond April 2016
Check that EDNS version 1 queries work (EDNS supported):
dig +nocookie +edns=1 +noednsneg +noad +norec soa $zone @$server
expect: status: BADVERS
expect: SOA record to not be present
expect: OPT record to be present
expect: EDNS Version 0 in response
expect: flag: aa to NOT be present
Only EDNS Version 0 is currently defined so the response should
always be a 0 version. This will change when EDNS version 1 is
defined. BADVERS is the expected rcode if EDNS is supported as per
Section 6.1.3, [RFC6891].
Check that EDNS queries with an unknown option work (EDNS supported):
dig +nocookie +edns=0 +noad +norec +ednsopt=100 soa $zone @$server
expect: status: NOERROR
expect: SOA record to be present
expect: OPT record to be present
expect: OPT=100 to not be present
expect: EDNS Version 0 in response
expect: flag: aa to be present
Unknown EDNS options are supposed to be ignored, Section 6.1.2,
[RFC6891].
Check that EDNS queries with unknown flags work (EDNS supported):
dig +nocookie +edns=0 +noad +norec +ednsflags=0x40 soa $zone @$server
expect: status: NOERROR
expect: SOA record to be present
expect: OPT record to be present
expect: MBZ not to be present
expect: EDNS Version 0 in response
expect: flag: aa to be present
MBZ (Must Be Zero) presence indicates the flag bit has been
incorrectly copied as per Section 6.1.4, [RFC6891].
Andrews Expires October 8, 2016 [Page 13]
Internet-Draft Failure to respond April 2016
Check that EDNS version 1 queries with unknown flags work (EDNS
supported):
dig +nocookie +edns=1 +noednsneg +noad +norec +ednsflags=0x40 soa \
$zone @$server
expect: status: BADVERS
expect: SOA record to NOT be present
expect: OPT record to be present
expect: MBZ not to be present
expect: EDNS Version 0 in response
expect: flag: aa to NOT be present
+noednsneg disables EDNS version negotiation in DiG; MBZ (Must Be
Zero) presence indicates the flag bit has been incorrectly copied.
Check that EDNS version 1 queries with unknown options work (EDNS
supported):
dig +nocookie +edns=1 +noednsneg +noad +norec +ednsopt=100 soa \
$zone @$server
expect: status: BADVERS
expect: SOA record to NOT be present
expect: OPT record to be present
expect: OPT=100 to NOT be present
expect: EDNS Version 0 in response
expect: flag: aa to be present
+noednsneg disables EDNS version negotiation in DiG.
Check that a DNSSEC queries work (EDNS supported):
dig +nocookie +edns=0 +noad +norec +dnssec soa $zone @$server
expect: status: NOERROR
expect: SOA record to be present
expect: OPT record to be present
expect: DO=1 to be present if a RRSIG is in the response
expect: EDNS Version 0 in response
expect: flag: aa to be present
DO=1 should be present if RRSIGs are returned as they indicate that
the server supports DNSSEC. Servers that support DNSSEC are supposed
to copy the DO bit from the request to the response as per [RFC3225].
Andrews Expires October 8, 2016 [Page 14]
Internet-Draft Failure to respond April 2016
Check that EDNS version 1 DNSSEC queries work (EDNS supported):
dig +nocookie +edns=1 +noednsneg +noad +norec +dnssec soa \
$zone @$server
expect: status: BADVERS
expect: SOA record to not be present
expect: OPT record to be present
expect: DO=1 to be present if the EDNS version 0 DNSSEC query test
returned DO=1
expect: EDNS Version 0 in response
expect: flag: aa to NOT be present
+noednsneg disables EDNS version negotiation in DiG.
Check that EDNS queries with multiple defined EDNS options work:
dig +edns=0 +noad +norec +cookie +nsid +expire +subnet=0.0.0.0/0 \
soa $zone @$server
expect: status: NOERROR
expect: SOA record to be present
expect: OPT record to be present
expect: EDNS Version 0 in response
expect: flag: aa to be present
If EDNS is not supported by the nameserver, we expect a response to
all the above queries. That response may be a FORMERR or NOTIMP
error response or the OPT record may just be ignored.
Some nameservers only return a EDNS response when a particular EDNS
option or flag (e.g. DO=1) is present in the request. This
behaviour is not compliant behaviour and may hide other incorrect
behaviour from the above tests. Re-testing with the triggering
option / flag present will expose this misbehaviour.
9. Security Considerations
Testing protocol compliance can potentially result in false reports
of attempts to break services from Intrusion Detection Services and
firewalls. None of the tests listed above should break nominally
EDNS compliant servers. None of the tests above should break non
EDNS servers. All the tests above are well formed, though not
necessarily common, DNS queries.
Relaxing firewall settings to ensure EDNS compliance could
potentially expose a critical implementation flaw in the nameserver.
Andrews Expires October 8, 2016 [Page 15]
Internet-Draft Failure to respond April 2016
Nameservers should be tested for conformance before relaxing firewall
settings.
When removing delegations for non-compliant servers there can be a
knock on effect on other zones that require these zones to be
operational for the nameservers addresses to be resolved.
10. IANA Considerations
IANA / ICANN needs to consider what tests, if any, from above that it
should add to the zone maintenance procedures for zones under its
control including pre-delegation checks. Otherwise this document has
no actions for IANA.
11. Normative References
[RFC1033] Lottor, M., "Domain Administrators Operations Guide",
RFC 1033, DOI 10.17487/RFC1033, November 1987,
<http://www.rfc-editor.org/info/rfc1033>.
[RFC1034] Mockapetris, P., "Domain names - concepts and facilities",
STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987,
<http://www.rfc-editor.org/info/rfc1034>.
[RFC1035] Mockapetris, P., "Domain names - implementation and
specification", STD 13, RFC 1035, DOI 10.17487/RFC1035,
November 1987, <http://www.rfc-editor.org/info/rfc1035>.
[RFC3225] Conrad, D., "Indicating Resolver Support of DNSSEC",
RFC 3225, DOI 10.17487/RFC3225, December 2001,
<http://www.rfc-editor.org/info/rfc3225>.
[RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S.
Rose, "Protocol Modifications for the DNS Security
Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005,
<http://www.rfc-editor.org/info/rfc4035>.
[RFC5966] Bellis, R., "DNS Transport over TCP - Implementation
Requirements", RFC 5966, DOI 10.17487/RFC5966, August
2010, <http://www.rfc-editor.org/info/rfc5966>.
[RFC6840] Weiler, S., Ed. and D. Blacka, Ed., "Clarifications and
Implementation Notes for DNS Security (DNSSEC)", RFC 6840,
DOI 10.17487/RFC6840, February 2013,
<http://www.rfc-editor.org/info/rfc6840>.
Andrews Expires October 8, 2016 [Page 16]
Internet-Draft Failure to respond April 2016
[RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms
for DNS (EDNS(0))", STD 75, RFC 6891,
DOI 10.17487/RFC6891, April 2013,
<http://www.rfc-editor.org/info/rfc6891>.
[RFC6895] Eastlake 3rd, D., "Domain Name System (DNS) IANA
Considerations", BCP 42, RFC 6895, DOI 10.17487/RFC6895,
April 2013, <http://www.rfc-editor.org/info/rfc6895>.
Author's Address
M. Andrews
Internet Systems Consortium
950 Charter Street
Redwood City, CA 94063
US
Email: [email protected]
Andrews Expires October 8, 2016 [Page 17]
| {
"pile_set_name": "Github"
} |
$( document ).ready(function() {
// Shift nav in mobile when clicking the menu.
$(document).on('click', "[data-toggle='wy-nav-top']", function() {
$("[data-toggle='wy-nav-shift']").toggleClass("shift");
$("[data-toggle='rst-versions']").toggleClass("shift");
});
// Close menu when you click a link.
$(document).on('click', ".wy-menu-vertical .current ul li a", function() {
$("[data-toggle='wy-nav-shift']").removeClass("shift");
$("[data-toggle='rst-versions']").toggleClass("shift");
});
$(document).on('click', "[data-toggle='rst-current-version']", function() {
$("[data-toggle='rst-versions']").toggleClass("shift-up");
});
// Make tables responsive
$("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>");
});
window.SphinxRtdTheme = (function (jquery) {
var stickyNav = (function () {
var navBar,
win,
stickyNavCssClass = 'stickynav',
applyStickNav = function () {
if (navBar.height() <= win.height()) {
navBar.addClass(stickyNavCssClass);
} else {
navBar.removeClass(stickyNavCssClass);
}
},
enable = function () {
applyStickNav();
win.on('resize', applyStickNav);
},
init = function () {
navBar = jquery('nav.wy-nav-side:first');
win = jquery(window);
};
jquery(init);
return {
enable : enable
};
}());
return {
StickyNav : stickyNav
};
}($));
| {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Driver for Digigram VXpocket V2/440 soundcards
*
* Copyright (c) 2002 by Takashi Iwai <[email protected]>
*/
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <sound/core.h>
#include "vxpocket.h"
#include <pcmcia/ciscode.h>
#include <pcmcia/cisreg.h>
#include <sound/initval.h>
#include <sound/tlv.h>
/*
*/
MODULE_AUTHOR("Takashi Iwai <[email protected]>");
MODULE_DESCRIPTION("Digigram VXPocket");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{Digigram,VXPocket},{Digigram,VXPocket440}}");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */
static int ibl[SNDRV_CARDS];
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for VXPocket soundcard.");
module_param_array(id, charp, NULL, 0444);
MODULE_PARM_DESC(id, "ID string for VXPocket soundcard.");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable VXPocket soundcard.");
module_param_array(ibl, int, NULL, 0444);
MODULE_PARM_DESC(ibl, "Capture IBL size for VXPocket soundcard.");
/*
*/
static unsigned int card_alloc;
/*
*/
static void vxpocket_release(struct pcmcia_device *link)
{
free_irq(link->irq, link->priv);
pcmcia_disable_device(link);
}
/*
* destructor, called from snd_card_free_when_closed()
*/
static int snd_vxpocket_dev_free(struct snd_device *device)
{
struct vx_core *chip = device->device_data;
snd_vx_free_firmware(chip);
kfree(chip);
return 0;
}
/*
* Hardware information
*/
/* VX-pocket V2
*
* 1 DSP, 1 sync UER
* 1 programmable clock (NIY)
* 1 stereo analog input (line/micro)
* 1 stereo analog output
* Only output levels can be modified
*/
static const DECLARE_TLV_DB_SCALE(db_scale_old_vol, -11350, 50, 0);
static const struct snd_vx_hardware vxpocket_hw = {
.name = "VXPocket",
.type = VX_TYPE_VXPOCKET,
/* hardware specs */
.num_codecs = 1,
.num_ins = 1,
.num_outs = 1,
.output_level_max = VX_ANALOG_OUT_LEVEL_MAX,
.output_level_db_scale = db_scale_old_vol,
};
/* VX-pocket 440
*
* 1 DSP, 1 sync UER, 1 sync World Clock (NIY)
* SMPTE (NIY)
* 2 stereo analog input (line/micro)
* 2 stereo analog output
* Only output levels can be modified
* UER, but only for the first two inputs and outputs.
*/
static const struct snd_vx_hardware vxp440_hw = {
.name = "VXPocket440",
.type = VX_TYPE_VXP440,
/* hardware specs */
.num_codecs = 2,
.num_ins = 2,
.num_outs = 2,
.output_level_max = VX_ANALOG_OUT_LEVEL_MAX,
.output_level_db_scale = db_scale_old_vol,
};
/*
* create vxpocket instance
*/
static int snd_vxpocket_new(struct snd_card *card, int ibl,
struct pcmcia_device *link,
struct snd_vxpocket **chip_ret)
{
struct vx_core *chip;
struct snd_vxpocket *vxp;
static const struct snd_device_ops ops = {
.dev_free = snd_vxpocket_dev_free,
};
int err;
chip = snd_vx_create(card, &vxpocket_hw, &snd_vxpocket_ops,
sizeof(struct snd_vxpocket) - sizeof(struct vx_core));
if (!chip)
return -ENOMEM;
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
if (err < 0) {
kfree(chip);
return err;
}
chip->ibl.size = ibl;
vxp = to_vxpocket(chip);
vxp->p_dev = link;
link->priv = chip;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
link->resource[0]->end = 16;
link->config_flags |= CONF_ENABLE_IRQ;
link->config_index = 1;
link->config_regs = PRESENT_OPTION;
*chip_ret = vxp;
return 0;
}
/**
* snd_vxpocket_assign_resources - initialize the hardware and card instance.
* @chip: VX core instance
* @port: i/o port for the card
* @irq: irq number for the card
*
* this function assigns the specified port and irq, boot the card,
* create pcm and control instances, and initialize the rest hardware.
*
* returns 0 if successful, or a negative error code.
*/
static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq)
{
int err;
struct snd_card *card = chip->card;
struct snd_vxpocket *vxp = to_vxpocket(chip);
snd_printdd(KERN_DEBUG "vxpocket assign resources: port = 0x%x, irq = %d\n", port, irq);
vxp->port = port;
sprintf(card->shortname, "Digigram %s", card->driver);
sprintf(card->longname, "%s at 0x%x, irq %i",
card->shortname, port, irq);
chip->irq = irq;
card->sync_irq = chip->irq;
if ((err = snd_vx_setup_firmware(chip)) < 0)
return err;
return 0;
}
/*
* configuration callback
*/
static int vxpocket_config(struct pcmcia_device *link)
{
struct vx_core *chip = link->priv;
int ret;
snd_printdd(KERN_DEBUG "vxpocket_config called\n");
/* redefine hardware record according to the VERSION1 string */
if (!strcmp(link->prod_id[1], "VX-POCKET")) {
snd_printdd("VX-pocket is detected\n");
} else {
snd_printdd("VX-pocket 440 is detected\n");
/* overwrite the hardware information */
chip->hw = &vxp440_hw;
chip->type = vxp440_hw.type;
strcpy(chip->card->driver, vxp440_hw.name);
}
ret = pcmcia_request_io(link);
if (ret)
goto failed_preirq;
ret = request_threaded_irq(link->irq, snd_vx_irq_handler,
snd_vx_threaded_irq_handler,
IRQF_SHARED, link->devname, link->priv);
if (ret)
goto failed_preirq;
ret = pcmcia_enable_device(link);
if (ret)
goto failed;
chip->dev = &link->dev;
if (snd_vxpocket_assign_resources(chip, link->resource[0]->start,
link->irq) < 0)
goto failed;
return 0;
failed:
free_irq(link->irq, link->priv);
failed_preirq:
pcmcia_disable_device(link);
return -ENODEV;
}
#ifdef CONFIG_PM
static int vxp_suspend(struct pcmcia_device *link)
{
struct vx_core *chip = link->priv;
snd_printdd(KERN_DEBUG "SUSPEND\n");
if (chip) {
snd_printdd(KERN_DEBUG "snd_vx_suspend calling\n");
snd_vx_suspend(chip);
}
return 0;
}
static int vxp_resume(struct pcmcia_device *link)
{
struct vx_core *chip = link->priv;
snd_printdd(KERN_DEBUG "RESUME\n");
if (pcmcia_dev_present(link)) {
//struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
if (chip) {
snd_printdd(KERN_DEBUG "calling snd_vx_resume\n");
snd_vx_resume(chip);
}
}
snd_printdd(KERN_DEBUG "resume done!\n");
return 0;
}
#endif
/*
*/
static int vxpocket_probe(struct pcmcia_device *p_dev)
{
struct snd_card *card;
struct snd_vxpocket *vxp;
int i, err;
/* find an empty slot from the card list */
for (i = 0; i < SNDRV_CARDS; i++) {
if (!(card_alloc & (1 << i)))
break;
}
if (i >= SNDRV_CARDS) {
snd_printk(KERN_ERR "vxpocket: too many cards found\n");
return -EINVAL;
}
if (! enable[i])
return -ENODEV; /* disabled explicitly */
/* ok, create a card instance */
err = snd_card_new(&p_dev->dev, index[i], id[i], THIS_MODULE,
0, &card);
if (err < 0) {
snd_printk(KERN_ERR "vxpocket: cannot create a card instance\n");
return err;
}
err = snd_vxpocket_new(card, ibl[i], p_dev, &vxp);
if (err < 0) {
snd_card_free(card);
return err;
}
card->private_data = vxp;
vxp->index = i;
card_alloc |= 1 << i;
vxp->p_dev = p_dev;
return vxpocket_config(p_dev);
}
static void vxpocket_detach(struct pcmcia_device *link)
{
struct snd_vxpocket *vxp;
struct vx_core *chip;
if (! link)
return;
vxp = link->priv;
chip = (struct vx_core *)vxp;
card_alloc &= ~(1 << vxp->index);
chip->chip_status |= VX_STAT_IS_STALE; /* to be sure */
snd_card_disconnect(chip->card);
vxpocket_release(link);
snd_card_free_when_closed(chip->card);
}
/*
* Module entry points
*/
static const struct pcmcia_device_id vxp_ids[] = {
PCMCIA_DEVICE_MANF_CARD(0x01f1, 0x0100),
PCMCIA_DEVICE_NULL
};
MODULE_DEVICE_TABLE(pcmcia, vxp_ids);
static struct pcmcia_driver vxp_cs_driver = {
.owner = THIS_MODULE,
.name = "snd-vxpocket",
.probe = vxpocket_probe,
.remove = vxpocket_detach,
.id_table = vxp_ids,
#ifdef CONFIG_PM
.suspend = vxp_suspend,
.resume = vxp_resume,
#endif
};
module_pcmcia_driver(vxp_cs_driver);
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.giraph.factories;
import org.apache.giraph.conf.GiraphConfigurationSettable;
import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
import org.apache.giraph.edge.OutEdges;
import org.apache.giraph.utils.ReflectionUtils;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableComparable;
/**
* Default factory class for creating {@link OutEdges} instances to be used
* during computation. This factory simply creates an instance of the
* {@link OutEdges} class set in the configuration.
*
* @param <I> Vertex ID type.
* @param <E> Edge value type.
*/
public class DefaultOutEdgesFactory<I extends WritableComparable,
E extends Writable> implements OutEdgesFactory<I, E>,
GiraphConfigurationSettable {
/** Configuration */
private ImmutableClassesGiraphConfiguration<I, ?, E> conf;
@Override
public void setConf(ImmutableClassesGiraphConfiguration conf) {
this.conf = conf;
}
@Override
public OutEdges<I, E> newInstance() {
return ReflectionUtils.newInstance(conf.getOutEdgesClass(), conf);
}
}
| {
"pile_set_name": "Github"
} |
:020000040000FA
:060000000219FD02031CC1
:03000B0002008D63
:03001300020535AE
:03001B0002009050
:03002B000202D1FD
:03005B0002054457
:030073000203097C
:100080000406080C10182030406080A0C0054032E3
:10009000C2AFC2A853E6EFC28E856B8BC0D0D2D35D
:1000A000C0E0C0F0C2CAA8CCA9CDD2CAD2AF758A6E
:1000B00000C3E8956CF8E9956DF9C3E913F9E81305
:1000C000F8E5666007C3E913F9E813F8E97025E875
:1000D000956E4020956E501CE582B410177C007B15
:1000E000007A007908900000A86AE5667004C3E809
:1000F00013F801FD900000D2A8D2AA61E7E0FDC389
:100100009CC39840EF98EB33FB0582E0FCC39DC392
:100110009840E198EB33FB0582E0FDC39CC3984017
:10012000D398EB33FB0582E0FCC39DC39840C59890
:10013000EB33FB0582E0FDC39CC39840B798EB33DB
:10014000FB0582E0FCC39DC39840A998EB33FB05F7
:1001500082E0FDC39CC398409B98EB33FB0582E093
:10016000FCC39DC398408D98EB33FB0582217890AA
:100170000000D2A8D2AA61E7E0FDC39CC39840EF7B
:1001800098EA33FA0582E0FCC39DC39840E198EAFF
:1001900033FA0582E0FDC39CC39840D398EA33FA52
:1001A0000582E0FCC39DC39840C598EA33FA0582F6
:1001B000E0FDC39CC39840B798EA33FA0582E0FC9F
:1001C000C39DC39840A998EA33FA0582E0FDC39C19
:1001D000C398409B98EA33FA0582E0FCC39DC3981C
:1001E000408D98EA33FA0582EBC46B6A54F0F9EA61
:1001F000C454F0C3996009900000D2A8D2AA61E764
:10020000EBF4C454F0F9EAF4C4540F49FAEBF4C423
:10021000540FFBC3EAF99460FAEB9400FB5020C33F
:10022000E97B007A0079006016C3135006F9C39584
:1002300052600AE9F5527553007900800205533087
:100240003A27C3EA94D0F8EB9407F9400BE8FAE9AF
:10025000FB203509D235415D303502C235203902E7
:10026000B235C3EA33FAEB33FBEB2B3B3BF9C3EB81
:1002700013FBEA13FAEA29FAEB3400FB30E3047AC1
:10028000FF7BFFE5255403601B202A18E55D33F949
:10029000EB7007C3E99A4002E9FAE53CC4332AFA55
:1002A000EB3400FBC3EA33C4540FF8EB33C454F00F
:1002B00048F87005EA60027801900000D2A8D2AA3E
:1002C000E5226002152281D4900000D2A8D2AA6152
:1002D000E7C0D0C0E0C2CF0541E5666009E56560D2
:1002E000057565006104756501E52360021523C38A
:1002F000E55460057555006104E5552401F5555038
:10030000037555FFD0E0D0D032C2AF53E67F75926F
:10031000FA7593FFC22053917FD2AF32C0E0E58AD5
:10032000303408856B8BF0A3D0E032D0E0C2AF53FD
:10033000E6EFC0D0C0E0C0F0D2D3D2AF5388EFA870
:100340008AA98CAA40308D010A758A00758C0075C7
:100350004000438810E566700AC3E833F8E933F9D2
:10036000EA33FA30331FE8C4540FFAE9C454F04AB0
:10037000FAC3132AFAC3E833F8E933F9E82AFAE9A9
:100380003406FB61D830320FC3E833E933FAE82A88
:10039000FAE93400FB61D8303115E875F056A4AAAB
:1003A000F0E975F056A42AFAC5F03400FB61D8C311
:1003B000EA13FAE913F9E813F8E875F056A4AAF07D
:1003C000E975F056A42AFAC5F03400C313FBEA130A
:1003D000FAC3EB13FBEA13FAC3EB94125009C3EA16
:1003E0009434EB940750160522E52270021522C3BF
:1003F000E52294325002A128755400A12BE5226019
:100400000215223036067C007D088117AC31AD32F2
:10041000303A04AC33AD34C3EA9CFAEB9DFB92084E
:10042000AE60AF61303A425007203509D235813590
:10043000303502C235303504AE62AF63203902B2C6
:1004400035C3EA33FAEB33FBA208500AEAF424017D
:10045000FAEBF43400FBC3EA9450FAEB9400FB503F
:100460001478007A007B008175A208500878007A21
:10047000007B0081D4E5255403601B202A18E55D2C
:1004800033F9EB7007C3E99A4002E9FAE53CC4335B
:100490002AFAEB3400FBEA8EF0A4F9AAF0EB8EF016
:1004A000A42AFAC5F03400FBC3EB13FDEA13F8C32A
:1004B000ED13FDE813F80FEF146004C3E833F8C33D
:1004C000E933EA33FAEB33FBDFEDEB30E30678FF99
:1004D0007AFF7B078854D230E86003755500C3E586
:1004E0005BFC955C4002AC5CC3EC95545008EC7529
:1004F000F008A4FAABF0EAF4F8EBF45407F9C3E817
:10050000940AFAE99400FB50047A007B008856892B
:10051000578A588B5975230AD0F0D0E0D0D053F7C2
:10052000DF43F74043E6103275230AD0F0D0E0D025
:10053000D043E61032C2AAD28EC2CA85CC6C85CD19
:100540006DD2CA32C2AFC0D0C0E0D2D3A8F9E55A4A
:1005500030E20AE5FA20E23520E132A165E5FA3021
:10056000E22B20E128C3E55713F8E55613F5FB8885
:10057000FCC3E55913F8E55813F5E988EA85575A9D
:1005800053F7BFD2A8303402D2AA53E6EF53F7DFB5
:10059000D0E0D0D0D2AF32790180147903801079C5
:1005A0000A800C791E80087964800479C8800078FC
:1005B00017E4D5E0FDD8FAD9F62278FF202828796B
:1005C000A1E76023E548601F74FF8548F084853FFC
:1005D000F030290375F005A4F8C5F0600278FFC378
:1005E000E8955D5002A85D885C22C3E54794A0E5CC
:1005F000489400E55C500314A1FB046002F55C2202
:1006000075E89022055EC3E55E9408405330EDF432
:10061000A8BDA9BE755E00E9FA79A0E76041EA705D
:1006200006E55F6018800CC3E8955F600EE55F50DB
:1006300005600A1480070460FA8002E55FF55FC375
:100640009569401B755BC0C394044013755B80C300
:100650009404400B755B40C394044003755B002217
:10066000E55B2410500274FFF55B22743279A68793
:10067000F0A4C5F0A2F733F55D227547007548F088
:1006800022C2AFC2CAA8CCA9CDAA4130CF010AD29A
:10069000CAD2AFC3EA13FAE913F9E813F8AB42ACD4
:1006A0004388428943C3E89BF8E99C20280A547F89
:1006B000F9302C02E19FC1F8AD448A44F9EA9D5417
:1006C0007FFA600678FF79FFC1DDAE45AF468B4506
:1006D0008C46A842A943C3E89EF8E99FF9C3E548C0
:1006E00013FBE54713FAE82AF547E93BF5485006BE
:1006F0007547FF7548FFE145AA47AB48AC47AD4891
:100700007E047F02C3EB9404400D1E1FC3EB9408CC
:1007100040052029021E1FC3ED13FDEC13FCDEF77C
:10072000C3EA9CFAEB9DFBEF6009C3E913F9E813F8
:10073000F8DFF7EA28FAEB39FB8A478B4850067B4B
:10074000FF8B478B48C3EB94025002D22C30280415
:100750007F03E1707892E6FFC3E53D948240110F7C
:10076000C3E53D94A040010FC3EF940640027F050E
:100770007E02E548C4540FF9E548C454F0F8E54753
:10078000C4540F28F8C3E89EFAE99400FB4009C35B
:10079000EA9401EB940050047A01E4FB0207EBAA0F
:1007A00047AB48EBC4FEEAC4540F4EFCC3EA9CFAC4
:1007B000EB9400FBC3E813C313F8EA28FAEB340008
:1007C000FB8A478B48C3EB94024002C22C7802EBB1
:1007D000C4FE7B00EAC4540F4EFAC3EA98FA4005FF
:1007E000C3940150027A017892E6FF302002E1EBD7
:1007F000854E92854F93D22043E680C3E49AF8E475
:100800009BF9C3E833F8E933F9302C03020880E898
:10081000FAE9FBD3E913FDE813FC884E894FC3EFD7
:1008200094036038EF20E00CE82CF8E93DF9ECFA8D
:10083000EDFB8013E828F8E939F9C3E82401F8E969
:100840003400F97AFF7BFFC3EF9403400F8A508B8B
:1008500051884A894B8C4C8D4D0208B5885089517E
:100860008A4A8B4B8C4C8D4D3028127550F0755147
:10087000FF754CF0754DFF754EF0754FFF0208B5D2
:10088000E8FAD3E813FC884EC3EF94036021EF200D
:10089000E007E82CF8ECFA01A0E8282401F87AFF38
:1008A000C3EF940340098A50884A8C4C0208B588EB
:1008B000508A4A8C4C30200201B5753A02D220434E
:1008C000E680E5255403602DA847A948C3E913F93C
:1008D000E813F8302804E92440F9C2AF53E67F75E5
:1008E0009100C3E498F594E499F595759104D220AC
:1008F00043E680D2AF22D221754900752000302B0B
:10090000037520402114D221754900752040302BF9
:100910000375200078017901202C20E5255403601F
:1009200002C2217914E548C313700104F8C394147A
:1009300040027814302804781B791BC3E833F8C3CD
:10094000E933F9202010E549600C302803D53A043A
:10095000D22221C711BD0549E59B5440B520022193
:10096000B130280908C3E899400118214320210A21
:1009700008C3E899400221142143C22153E67F7540
:100980009100302C117594007595F0759104D2206A
:1009900043E680020914E5487EFFC3334009C333B0
:1009A0004005C3334001FEC3E49E759400F59521D4
:1009B0008BC3E5399401500221143021022114D84F
:1009C0000221C52143C222C2AF53E67F7591008543
:1009D0005094855195759104854A92854B93D22008
:1009E00043E680D2AFE5255403600720290205398C
:1009F000801030220D202B0A20210715811581023D
:100A000013CE2278003021027801E53D75F007A46D
:100A1000F9E5F028F5F0E9A2F013A2F113A2F21320
:100A2000F53DC394785003753D78C3E53D953E4050
:100A300009C292C291C29075D57F302002413A8599
:100A40004C92854D93D22043E68022203810C2AFCD
:100A5000C294D29575D536D2AF759F13611BC2AFC4
:100A6000C294D29375D51BD2AF759F13611B2038EA
:100A700010C2AFC29075D52DD295D2AF759F0361CC
:100A80001BC2AFC29275D52DD293D2AF759F236191
:100A90001B203810C2AFC295D29375D52DD2AF7539
:100AA0009F238077C2AFC293D29575D52DD2AF75F3
:100AB0009F038067203810C2AFC29175D51BD293B7
:100AC000D2AF759F138054C2AFC29175D536D295FF
:100AD000D2AF759F138044203810C2AFC293D29416
:100AE00075D51BD2AF759F038031C2AFC295D2942A
:100AF00075D536D2AF759F238021203810C2AFC282
:100B00009275D536D294D2AF759F23800EC2AFC2F4
:100B10009075D51BD294D2AF759F03227A147B783F
:100B200080127A107B8C800C7A0D7BB480067A0B55
:100B30007BC88000E564D5E001227902E4C294D547
:100B4000E0FDD291D5E0FDC291D5E0FDD294D5E093
:100B5000FDE920E002D29230E002D290E564D5E0D7
:100B6000FDE920E002C29230E002C2907496D5E026
:100B7000FDD9C9EAF8D5E0FDD8FBDBB8C29422C2A2
:100B800092C291C290C295C294C29375D57F2278C9
:100B90008076FF0876FF0876FF0876FF0876FF0864
:100BA00076FF0876090876FF087601788C760108CA
:100BB00076FF0876FF0876FF0876FF0876FF08764E
:100BC000030876FF0876FF0876FF0876250876D0BA
:100BD0000876280876500876040876FF087602081A
:100BE00076FF08767A0876FF087607087601087699
:100BF000FF0876FF08760008760022FA75F00CA44C
:100C0000ABF0EAC333F8740133F9E8C333F8E933DE
:100C1000F9E8C32BF8E93400F9E8C333F8E933F90C
:100C2000227888E6C39403D23A5002C23AC238E628
:100C300030E102D238A23892397886E614900080EA
:100C40009378A6F67886E6F53FC394025003753F85
:100C500002789CE6753EFFB40203753EA0B4030320
:100C6000753E8278A0E6F8600674282409D8FCF561
:100C7000697896E671FB88318932789EE671FB8847
:100C80003389347897E671FB88358936717F223055
:100C900036117A007B007CFF7D007E0091F58B6130
:100CA0008A6022303A227896E6FA7B00789EE6FC4B
:100CB0007D00C3EA33FAEB33FBC3EC33FCED33FDC9
:100CC0007E0A91F58B638A627896303A02789EE6C6
:100CD000FA7B007897E6FC7D007E00303A10C3EA8C
:100CE00033FAEB33FBC3EC33FCED33FD7E0A91F5B5
:100CF0008B618A6022C3EC9EFCED9400FDC3EC9AEC
:100D0000FCED9BFDC3EC9423ED940050047C237D0B
:100D100000C3EC94FFED940140047CFF7D017BFF58
:100D20000B7A000AEA7009C3EC33FCED33FDA12015
:100D3000EC8AF0A4AEF0ED8AF0A42E947C40E4EAB4
:100D4000F460DD22D236918F1205A31205A37A003A
:100D50007B007C1012059BE5542AFA74003BFBDCF7
:100D6000F37C04C3EB13FBEA13FADCF7FFEB60023E
:100D70007FFFC236918F2278A5E6F954037000E90F
:100D8000540C7000E954307000E954C070002275B2
:100D900067007568007597DE7597AD7581C043FF74
:100DA0008075EF0675A900717F7580FF75F1F0758C
:100DB000A4007580FF75D4FF75900075F23F75A58E
:100DC0003F75900075D53F75A60175E34075E20249
:100DD000717FE4F8F6D8FD718F121412789886644A
:100DE000753001C2AF1205AB711C1205A37122123E
:100DF00005A371281205A3B177C2AF7567007568A6
:100E00000078FA79FA308507D9FBD8F7021C0091EF
:100E100021918F78988664717F75A91375A71075D5
:100E2000C10075A70075660075E405758811758E9B
:100E30000475890975C80475910475D84075D90879
:100E400075F782759E0375960275DA4275DB4275F9
:100E5000A82375E69075B801759B80759D0075D1C6
:100E60000C75BCB975BB1075E88075B20112059799
:100E7000D2AF753C00C2301205ABC231C232C233B0
:100E8000C2347552007553007522001205A7C3E5E0
:100E900022940A5002E15FD2317522001205A7C3E5
:100EA000E522940A5002E15FC231D232752200126B
:100EB00005A7C3E522940A5002E15F75E4D5758861
:100EC00051758E017589AA758C00758D00C2A9D2E5
:100ED000ABD2AA756B80756A14756E50C232D2346B
:100EE00075220A1205A7756A10C3E522940A755285
:100EF000007553004069758E0C756B00756A287516
:100F00006E2875220A1205A7756A20C3E522940A85
:100F10007552007553004047758E0C756B80756A6D
:100F200014756E1475220A1205A7756A10C3E5229E
:100F3000940A755200755300402575E405758811B3
:100F4000758E04758909D2A9C2ABC2AAC234D23344
:100F50007522001205A7C3E522940A4002A1F912E6
:100F6000059B203003020DF9C2AF711C711C711C6E
:100F7000D2AF1205AB203403303A0302101E120523
:100F80009B788CE6C39401500302101EE530C39495
:100F900001500302101E7567A57568F17F02D236F5
:100FA000918F1205A7C2AFC236918FC3E554947FCB
:100FB000D2AF406A120597C2AF712ED2AFDFDFB158
:100FC00044C3EF7897F61205AB1214FF7F0AD236AE
:100FD000918F1205A7C2AFC236918FC3E554947F9B
:100FE000D2AF50E8120597C2AF711C12059F711C59
:100FF000D2AFDFDAB144EF24037896F6F87997E7B9
:10100000C394234003985006E824237897F61205EA
:10101000AB9159B12E1205A7120C8F020DF975670D
:10102000007568001205A7C3E55494014003020F40
:1010300075C2AF120B2E120B2E120B2ED2AF120551
:10104000AB753000E4F537F5380537E537F4703F18
:101050000538789AE67819146012783214600D78A1
:101060007D14600878FA146003753800C3E5389879
:10107000401D120B7F120597153875370078998639
:1010800064C2AF120B2ED2AF789886641205A712F5
:10109000059FE5237003020DF9C3E5549401500A3E
:1010A000C3E552940150160210491205A7E52370BA
:1010B00003020DF975520075530002125FC3E55229
:1010C00094017017C2AF120B7F78998664120B1CC3
:1010D00078988664D2AF1205A74151C3E5529402B5
:1010E0007017C2AF120B7F78998664120B22789822
:1010F0008664D2AF1205A74151C3E552940370171D
:10110000C2AF120B7F78998664120B287898866498
:10111000D2AF1205A74151C3E55294047017C2AF74
:10112000120B7F78998664120B2E78988664D2AF62
:101130001205A74151C3E55294057017C2AF120BB7
:101140007F78998664120B2E78988664D2AF120548
:10115000A74151C3E55294077019C3E55394065053
:101160000201997401303A0274037888F6C238C2D9
:10117000394151C3E55294087019C3E553940650A0
:101180000201997402303A0274047888F6D238D297
:10119000394151C3E55294097017C3E55394065081
:1011A000020199303A0BC37888E69402F6C23A41BC
:1011B00051C3E552940A7016C3E5539406500201D8
:1011C00099203A0A7888E62402F6D23A4151C3E5DA
:1011D0005294147025C3E553940650020199C2AF8E
:1011E000901A0B740093D2AF7888F613C238C239C4
:1011F0004002D2384002D2398057C3E5529415706C
:1012000038C3E5539406404FC2AF901A0B74009355
:10121000D2AFF8B801027402B802027401B8030236
:101220007404B8040274037888F613C238C23940D3
:1012300002D2384002D2398018C3E552940C7011A2
:101240007567A57568F1C3E5539406400A9159D2B4
:10125000AF7552007553007567007568000199C23B
:10126000AF120B7FE4D2AFE4F55EF524F525F53D32
:10127000755E0812059712060030EDFDA8BDA9BEE7
:10128000E97001F8885F120604755E08C2AF1206A5
:101290006B855D5B855D5CD2AF75A71075C13075E0
:1012A000A70075A903756601303A07C238303502C8
:1012B000D238D228753900120AD7120AFA12067AE1
:1012C00012068112067A12068112067A1209061295
:1012D0000A03120A4B1206811208F6202C0312058B
:1012E000BA302C031205EA120A03120A6E120681A2
:1012F000120906120A03120A911206811208F61246
:101300000A03120AB4120681120906120A03120A0B
:10131000D71206811206001208F6120A03120AFA00
:10132000120604120681302827855D5B79187A0C35
:10133000C3E53999400EC228D2298A3B855D5B8579
:101340005D5C800CC3E554940140030212CC61D66D
:1013500030291F202B1CE53B147006C229D22A41DC
:10136000CCF53B203A07C3E554940140030212CC6C
:101370008064753C00203A0F78FA79A4E76002781F
:1013800003C3E55598504FE523604B303A1720389A
:1013900005203507800F303502800A202B07D22B1D
:1013A000855D5B41FC78F0302B05855D5B7820C363
:1013B000E5489850030212CC302B1BC22BC23830A8
:1013C0003502D238D229753B12855D5B41CC053C94
:1013D000E554600261D9753C00C2AF120B7F7524E1
:1013E0000075250075A91375A71075C10075A700B4
:1013F000756600D2AF1205A7120B7F78A4E66006CF
:10140000D295D294D293C3E53C94044003020DF9E3
:101410000144901A0D78209192E520B4550AA391C9
:1014200092E520B4AA0280137567A57568F1120BC6
:101430008F9159756700756800801D901A03788038
:101440007B0A9192A308DBFA901A0F788C7B1A9191
:1014500092A308DBFA901A2922C2AF91D591B290DB
:101460001A0074109197A374079197A37421919710
:10147000901A0378807B0A9196A308DBFA901A0FE2
:10148000788C7B1A9196A308DBFA91E891C6901AA2
:101490002922E493F622E6438F01538FFDFFC3E533
:1014A00083941C400122EF8567B78568B7F0538F9E
:1014B000FE22438F02438F018567B78568B7901A74
:1014C0000DF0538FFC22901A0D74559197901A0EBF
:1014D00074AA9197227A3079D07820901A4091920C
:1014E000E520F709A3DAF7227A3079D0901A40E79D
:1014F000919709A3DAF9227C051205ABDCFB22C225
:10150000AF120B1C120B22120B28120B2E12059F6E
:10151000120B1C120B22120B28120B2E12059F12FB
:101520000B1C120B22120B28120B2ED2AF22C2AFB1
:10153000120B2E120B28120B22120B1C12059F12DB
:101540000B2E120B28120B22120B1C12059F120BD2
:0D1550002E120B28120B22120B1CD2AF2200
:1019FD00020D8F100721FFFFFFFFFFFF09FF01FF02
:101A0D0055AA01FFFFFFFFFF03FFFFFF25D0285061
:0D1A1D0004FF02FF7AFF0701FFFF0000FF3A
:101A4000234C5F485F303523202020202020202099
:101A500023424C48454C492445464D3842323123B7
:101A60002020202020202020202020202020202076
:101C0000C2AFC2D37597DE7597AD7581C075A90057
:101C100043FF80752438752503B1DB7529A5752A26
:101C2000F143F12053A4DFD28575D4FF75E3407DE5
:101C3000FA780379E67C10752200752300901DE880
:101C40007B0675249875250130850281482085081A
:101C5000D8FBD9F9DCF781BA308508D8FBD9F9DC93
:101C6000F781BAB19BE493A3C39A6004DDC381BA40
:101C7000DBDBB18D600281317B08E493FAA3B16EA6
:101C8000DBF87A30B16E752200752300B18DEAFC65
:101C9000EBFDC3ED94FE400EB18D8A278B28ED300D
:101CA000E0048A828B83B18D7AC270D8C3ED94FE32
:101CB000601950CEBD0029EC600F7520007521FF22
:101CC000752900752A000200008100A827A92808AC
:101CD00009D804D90281DDB191EAF281D10D81A642
:101CE000C3ED94035051EDA2E092007AC5C3E582A2
:101CF0009400E583941C508C200010438F02438F86
:101D0000018529B7852AB7F0300027A827A9280818
:101D100009438F01538FFDD804D902A132C3E58353
:101D2000941C4003A3A117E28529B7852AB7F0A325
:101D3000A117538FFC81827AC1BD030CE493A3FAEF
:101D4000B152DCF8B14A81828184AA22AB23B16E00
:101D5000EBFAEA6222752608C3E52313F523E52290
:101D600013F52250066323A0632201D526EAB1DBD6
:101D7000B1DB75260AEAF4200102D285300102C2E5
:101D800085B1DBC3134002C201D526EB22B191EA33
:101D9000FB208502A191308502A196752608AE240C
:101DA000AF25C3EF13FFEE13FEB1DFB1DBC3EA13C0
:101DB0003085024480FA30E703632201C3E5231330
:101DC000F523E52213F52250066323A0632201D5F3
:101DD00026D9E52265236523F52222AE24AF250E00
:101DE0000FDEFEDFFCD20122424C48656C693437BD
:061DF0003164E8B20601B7
:00000001FF
| {
"pile_set_name": "Github"
} |
//
// YMCPhysicsDebugger.m
// PhysicsDebugger
//
// Created by ymc-thzi on 17.10.13.
// Copyright (c) 2013 YMC. All rights reserved.
//
#import "YMCPhysicsDebugger.h"
#import <SpriteKit/SpriteKit.h>
//import the swizzler to catch physicsBody method calls
#import "YMCSwizzler.h"
@implementation YMCPhysicsDebugger
+(void)init {
SEL circleSelector = sel_registerName("bodyWithCircleOfRadiusSwizzled:");
SEL rectangleSelector = sel_registerName("bodyWithRectangleOfSizeSwizzled:");
SEL polygonSelector = sel_registerName("bodyWithPolygonFromPathSwizzled:");
SEL edgechainSelector = sel_registerName("bodyWithEdgeChainFromPathSwizzled:");
YMCSwizzler([SKPhysicsBody class], @selector(bodyWithCircleOfRadius:), circleSelector);
YMCSwizzler([SKPhysicsBody class], @selector(bodyWithRectangleOfSize:), rectangleSelector);
YMCSwizzler([SKPhysicsBody class], @selector(bodyWithPolygonFromPath:), polygonSelector);
YMCSwizzler([SKPhysicsBody class], @selector(bodyWithEdgeChainFromPath:), edgechainSelector);
}
@end
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#block1, #block2 {
height: 20px;
background-color: green;
}
#block1 {
margin-bottom: 10px;
}
#block2 {
margin-top: 10px;
}
#table {
display: table;
}
#caption {
display: table-caption;
caption-side: top;
height: 20px;
margin: 20px 0;
background-color: blue;
}
#cell {
display: table-cell;
width: 100px;
height: 20px;
background-color: orange;
}
</style>
</head>
<body>
<div id="block1"></div>
<div id="table">
<div id="caption"></div>
<div id="cell"></div>
</div>
<div id="block2"></div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
#ifndef V8SVGAngle_h
#define V8SVGAngle_h
#include "bindings/core/v8/ScriptWrappable.h"
#include "bindings/core/v8/ToV8.h"
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8DOMWrapper.h"
#include "bindings/core/v8/WrapperTypeInfo.h"
#include "core/CoreExport.h"
#include "core/svg/SVGAngleTearOff.h"
#include "platform/heap/Handle.h"
namespace blink {
class V8SVGAngle {
public:
CORE_EXPORT static bool hasInstance(v8::Local<v8::Value>, v8::Isolate*);
static v8::Local<v8::Object> findInstanceInPrototypeChain(v8::Local<v8::Value>, v8::Isolate*);
CORE_EXPORT static v8::Local<v8::FunctionTemplate> domTemplate(v8::Isolate*);
static SVGAngleTearOff* toImpl(v8::Local<v8::Object> object)
{
return toScriptWrappable(object)->toImpl<SVGAngleTearOff>();
}
CORE_EXPORT static SVGAngleTearOff* toImplWithTypeCheck(v8::Isolate*, v8::Local<v8::Value>);
CORE_EXPORT static const WrapperTypeInfo wrapperTypeInfo;
static void refObject(ScriptWrappable*);
static void derefObject(ScriptWrappable*);
template<typename VisitorDispatcher>
static void trace(VisitorDispatcher visitor, ScriptWrappable* scriptWrappable)
{
#if ENABLE(OILPAN)
visitor->trace(scriptWrappable->toImpl<SVGAngleTearOff>());
#endif
}
static void visitDOMWrapper(v8::Isolate*, ScriptWrappable*, const v8::Persistent<v8::Object>&);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static void installConditionallyEnabledProperties(v8::Local<v8::Object>, v8::Isolate*) { }
static void preparePrototypeObject(v8::Isolate*, v8::Local<v8::Object> prototypeObject, v8::Local<v8::FunctionTemplate> interfaceTemplate) { }
};
template <>
struct V8TypeOf<SVGAngleTearOff> {
typedef V8SVGAngle Type;
};
} // namespace blink
#endif // V8SVGAngle_h
| {
"pile_set_name": "Github"
} |
#ifndef IVE_TEXTURE1D
#define IVE_TEXTURE1D 1
#include <osg/Texture1D>
#include "ReadWrite.h"
namespace ive{
class Texture1D : public osg::Texture1D {
public:
void write(DataOutputStream* out);
void read(DataInputStream* in);
};
}
#endif
| {
"pile_set_name": "Github"
} |
// +build js
package unix
const randomTrap = 0
const fstatatTrap = 0
func IsNonblock(fd int) (nonblocking bool, err error) {
return false, nil
}
| {
"pile_set_name": "Github"
} |
/* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */
/*<!--match-->*/
.cm-s-midnight span.CodeMirror-matchhighlight { background: #494949; }
.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67 !important; }
/*<!--activeline-->*/
.cm-s-midnight .CodeMirror-activeline-background { background: #253540; }
.cm-s-midnight.CodeMirror {
background: #0F192A;
color: #D1EDFF;
}
.cm-s-midnight div.CodeMirror-selected { background: #314D67; }
.cm-s-midnight .CodeMirror-line::selection, .cm-s-midnight .CodeMirror-line > span::selection, .cm-s-midnight .CodeMirror-line > span > span::selection { background: rgba(49, 77, 103, .99); }
.cm-s-midnight .CodeMirror-line::-moz-selection, .cm-s-midnight .CodeMirror-line > span::-moz-selection, .cm-s-midnight .CodeMirror-line > span > span::-moz-selection { background: rgba(49, 77, 103, .99); }
.cm-s-midnight .CodeMirror-gutters { background: #0F192A; border-right: 1px solid; }
.cm-s-midnight .CodeMirror-guttermarker { color: white; }
.cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
.cm-s-midnight .CodeMirror-linenumber { color: #D0D0D0; }
.cm-s-midnight .CodeMirror-cursor { border-left: 1px solid #F8F8F0; }
.cm-s-midnight span.cm-comment { color: #428BDD; }
.cm-s-midnight span.cm-atom { color: #AE81FF; }
.cm-s-midnight span.cm-number { color: #D1EDFF; }
.cm-s-midnight span.cm-property, .cm-s-midnight span.cm-attribute { color: #A6E22E; }
.cm-s-midnight span.cm-keyword { color: #E83737; }
.cm-s-midnight span.cm-string { color: #1DC116; }
.cm-s-midnight span.cm-variable { color: #FFAA3E; }
.cm-s-midnight span.cm-variable-2 { color: #FFAA3E; }
.cm-s-midnight span.cm-def { color: #4DD; }
.cm-s-midnight span.cm-bracket { color: #D1EDFF; }
.cm-s-midnight span.cm-tag { color: #449; }
.cm-s-midnight span.cm-link { color: #AE81FF; }
.cm-s-midnight span.cm-error { background: #F92672; color: #F8F8F0; }
.cm-s-midnight .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="midiclock"
ProjectGUID="{9B448D22-EC7E-4BD8-A552-B268D843CC3C}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="midiclock.dir\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
BasicRuntimeChecks="3"
CompileAs="1"
DebugInformationFormat="3"
ExceptionHandling="0"
InlineFunctionExpansion="0"
Optimization="0"
RuntimeLibrary="1"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\"Debug\""
AssemblerListingLocation="Debug"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Debug/midiclock.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\"Debug\""/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,PM_CHECK_ERRORS=1,DEBUG,CMAKE_INTDIR=\"Debug\""
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386 /debug"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Debug\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Debug\midiclock.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="2"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Debug/midiclock.pdb"
GenerateDebugInformation="TRUE"
SubSystem="1"
ImportLibrary="..\pm_test\Debug\midiclock.lib"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="midiclock.dir\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions=" /Zm1000"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
CompileAs="1"
ExceptionHandling="0"
InlineFunctionExpansion="2"
Optimization="2"
RuntimeLibrary="0"
WarningLevel="3"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\"Release\""
AssemblerListingLocation="Release"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="../pm_test/Release/midiclock.pdb"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="..\pm_common;..\porttime;"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\"Release\""/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,CMAKE_INTDIR=\"Release\""
MkTypLibCompatible="FALSE"
TargetEnvironment="1"
GenerateStublessProxies="TRUE"
TypeLibraryName="$(InputName).tlb"
OutputDirectory="$(IntDir)"
HeaderFileName="$(InputName).h"
DLLDataFileName=""
InterfaceIdentifierFileName="$(InputName)_i.c"
ProxyFileName="$(InputName)_p.c"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /STACK:10000000 /machine:I386"
AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\Release\portmidi_s.lib winmm.lib "
OutputFile="..\pm_test\Release\midiclock.exe"
Version="0.0"
GenerateManifest="TRUE"
LinkIncremental="1"
AdditionalLibraryDirectories=""
ProgramDataBaseFile="../pm_test/Release/midiclock.pdb"
SubSystem="1"
ImportLibrary="..\pm_test\Release\midiclock.lib"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="">
<File
RelativePath="..\pm_test\midiclock.c">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
| {
"pile_set_name": "Github"
} |
// { dg-do compile }
// Copyright (C) 2007-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// This file tests explicit instantiation of library containers.
#include <stack>
template class std::stack<int>;
struct NonDefaultConstructible : std::deque<int> {
NonDefaultConstructible(int) { }
};
template class std::stack<int, NonDefaultConstructible>;
| {
"pile_set_name": "Github"
} |
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto
package v1beta1
import (
fmt "fmt"
io "io"
proto "github.com/gogo/protobuf/proto"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
math "math"
math_bits "math/bits"
reflect "reflect"
strings "strings"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
func (m *PartialObjectMetadataList) Reset() { *m = PartialObjectMetadataList{} }
func (*PartialObjectMetadataList) ProtoMessage() {}
func (*PartialObjectMetadataList) Descriptor() ([]byte, []int) {
return fileDescriptor_90ec10f86b91f9a8, []int{0}
}
func (m *PartialObjectMetadataList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *PartialObjectMetadataList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
func (m *PartialObjectMetadataList) XXX_Merge(src proto.Message) {
xxx_messageInfo_PartialObjectMetadataList.Merge(m, src)
}
func (m *PartialObjectMetadataList) XXX_Size() int {
return m.Size()
}
func (m *PartialObjectMetadataList) XXX_DiscardUnknown() {
xxx_messageInfo_PartialObjectMetadataList.DiscardUnknown(m)
}
var xxx_messageInfo_PartialObjectMetadataList proto.InternalMessageInfo
func init() {
proto.RegisterType((*PartialObjectMetadataList)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1beta1.PartialObjectMetadataList")
}
func init() {
proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto", fileDescriptor_90ec10f86b91f9a8)
}
var fileDescriptor_90ec10f86b91f9a8 = []byte{
// 317 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x41, 0x4b, 0xf3, 0x30,
0x1c, 0xc6, 0x9b, 0xf7, 0x65, 0x38, 0x3a, 0x04, 0xd9, 0x69, 0xee, 0x90, 0x0d, 0x4f, 0xf3, 0xb0,
0x84, 0x0d, 0x11, 0xc1, 0xdb, 0x6e, 0x82, 0xa2, 0xec, 0x28, 0x1e, 0x4c, 0xbb, 0xbf, 0x5d, 0xac,
0x69, 0x4a, 0xf2, 0xef, 0xc0, 0x9b, 0x1f, 0xc1, 0x8f, 0xb5, 0xe3, 0x8e, 0x03, 0x61, 0xb8, 0xf8,
0x45, 0x24, 0x5d, 0x15, 0x19, 0x0a, 0xbb, 0xf5, 0x79, 0xca, 0xef, 0x97, 0x27, 0x24, 0x1c, 0xa7,
0x67, 0x96, 0x49, 0xcd, 0xd3, 0x22, 0x02, 0x93, 0x01, 0x82, 0xe5, 0x33, 0xc8, 0x26, 0xda, 0xf0,
0xea, 0x87, 0xc8, 0xa5, 0x12, 0xf1, 0x54, 0x66, 0x60, 0x9e, 0x79, 0x9e, 0x26, 0xbe, 0xb0, 0x5c,
0x01, 0x0a, 0x3e, 0x1b, 0x44, 0x80, 0x62, 0xc0, 0x13, 0xc8, 0xc0, 0x08, 0x84, 0x09, 0xcb, 0x8d,
0x46, 0xdd, 0x3c, 0xde, 0xa0, 0xec, 0x27, 0xca, 0xf2, 0x34, 0xf1, 0x85, 0x65, 0x1e, 0x65, 0x15,
0xda, 0xee, 0x27, 0x12, 0xa7, 0x45, 0xc4, 0x62, 0xad, 0x78, 0xa2, 0x13, 0xcd, 0x4b, 0x43, 0x54,
0x3c, 0x94, 0xa9, 0x0c, 0xe5, 0xd7, 0xc6, 0xdc, 0x3e, 0xd9, 0x65, 0xd4, 0xf6, 0x9e, 0xf6, 0xe9,
0x5f, 0x94, 0x29, 0x32, 0x94, 0x0a, 0xb8, 0x8d, 0xa7, 0xa0, 0xc4, 0x36, 0x77, 0xf4, 0x46, 0xc2,
0xc3, 0x1b, 0x61, 0x50, 0x8a, 0xa7, 0xeb, 0xe8, 0x11, 0x62, 0xbc, 0x02, 0x14, 0x13, 0x81, 0xe2,
0x52, 0x5a, 0x6c, 0xde, 0x85, 0x75, 0x55, 0xe5, 0xd6, 0xbf, 0x2e, 0xe9, 0x35, 0x86, 0x8c, 0xed,
0x72, 0x71, 0xe6, 0x69, 0x6f, 0x1a, 0x1d, 0xcc, 0x57, 0x9d, 0xc0, 0xad, 0x3a, 0xf5, 0xaf, 0x66,
0xfc, 0x6d, 0x6c, 0xde, 0x87, 0x35, 0x89, 0xa0, 0x6c, 0x8b, 0x74, 0xff, 0xf7, 0x1a, 0xc3, 0xf3,
0xdd, 0xd4, 0xbf, 0xae, 0x1d, 0xed, 0x57, 0xe7, 0xd4, 0x2e, 0xbc, 0x71, 0xbc, 0x11, 0x8f, 0xfa,
0xf3, 0x35, 0x0d, 0x16, 0x6b, 0x1a, 0x2c, 0xd7, 0x34, 0x78, 0x71, 0x94, 0xcc, 0x1d, 0x25, 0x0b,
0x47, 0xc9, 0xd2, 0x51, 0xf2, 0xee, 0x28, 0x79, 0xfd, 0xa0, 0xc1, 0xed, 0x5e, 0xf5, 0x52, 0x9f,
0x01, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x82, 0x5b, 0x80, 0x29, 0x02, 0x00, 0x00,
}
func (m *PartialObjectMetadataList) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *PartialObjectMetadataList) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *PartialObjectMetadataList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
{
size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
if len(m.Items) > 0 {
for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
offset -= sovGenerated(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *PartialObjectMetadataList) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Items) > 0 {
for _, e := range m.Items {
l = e.Size()
n += 1 + l + sovGenerated(uint64(l))
}
}
l = m.ListMeta.Size()
n += 1 + l + sovGenerated(uint64(l))
return n
}
func sovGenerated(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozGenerated(x uint64) (n int) {
return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *PartialObjectMetadataList) String() string {
if this == nil {
return "nil"
}
repeatedStringForItems := "[]PartialObjectMetadata{"
for _, f := range this.Items {
repeatedStringForItems += fmt.Sprintf("%v", f) + ","
}
repeatedStringForItems += "}"
s := strings.Join([]string{`&PartialObjectMetadataList{`,
`Items:` + repeatedStringForItems + `,`,
`ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
}
func valueToStringGenerated(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *PartialObjectMetadataList) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: PartialObjectMetadataList: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: PartialObjectMetadataList: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Items = append(m.Items, v1.PartialObjectMetadata{})
if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthGenerated
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthGenerated
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipGenerated(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGenerated
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGenerated
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGenerated
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthGenerated
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupGenerated
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthGenerated
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group")
)
| {
"pile_set_name": "Github"
} |
/*
* This file is part of ReadonlyREST.
*
* ReadonlyREST is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ReadonlyREST is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ReadonlyREST. If not, see http://www.gnu.org/licenses/
*/
package tech.beshu.ror.accesscontrol.blocks.rules
import cats.implicits._
import cats.data.NonEmptySet
import monix.eval.Task
import tech.beshu.ror.accesscontrol.blocks.{BlockContext, BlockContextUpdater}
import tech.beshu.ror.accesscontrol.blocks.rules.Rule.RuleResult.Rejected
import tech.beshu.ror.accesscontrol.blocks.rules.Rule.{RegularRule, RuleResult}
import tech.beshu.ror.accesscontrol.blocks.rules.UsersRule.Settings
import tech.beshu.ror.accesscontrol.blocks.variables.runtime.RuntimeMultiResolvableVariable
import tech.beshu.ror.accesscontrol.domain.{LoggedUser, User}
import tech.beshu.ror.accesscontrol.utils.RuntimeMultiResolvableVariableOps.resolveAll
import tech.beshu.ror.utils.MatcherWithWildcards
import scala.collection.JavaConverters._
class UsersRule(val settings: Settings)
extends RegularRule {
override val name: Rule.Name = UsersRule.name
override def check[B <: BlockContext : BlockContextUpdater](blockContext: B): Task[RuleResult[B]] = Task {
blockContext.userMetadata.loggedUser match {
case None => Rejected()
case Some(user) => matchUser(user, blockContext)
}
}
private def matchUser[B <: BlockContext](user: LoggedUser, blockContext: B): RuleResult[B] = {
val resolvedIds = resolveAll(settings.userIds.toNonEmptyList, blockContext).toSet
RuleResult.fromCondition(blockContext) {
new MatcherWithWildcards(resolvedIds.map(_.value.value).asJava).`match`(user.id.value.value)
}
}
}
object UsersRule {
val name = Rule.Name("users")
final case class Settings(userIds: NonEmptySet[RuntimeMultiResolvableVariable[User.Id]])
}
| {
"pile_set_name": "Github"
} |
# $NetBSD: Makefile,v 1.15 2017/08/16 20:45:41 wiz Exp $
#
DISTNAME= lag-2.1
PKGNAME= gp-lag-2.1
PKGREVISION= 1
CATEGORIES= math
MASTER_SITES= ftp://ftp-gap.dcs.st-and.ac.uk/pub/gap/gap4/share/
EXTRACT_SUFX= .zoo
MAINTAINER= [email protected]
#HOMEPAGE= http://www.gap-system.org/Share/lag.html
COMMENT= GAP Bracket Lie Algebra functions
WRKSRC= ${WRKDIR}/lag
NO_BUILD= YES
GAP_PKG_NAME= lag
USE_TOOLS+= pax
do-install:
${INSTALL_DATA_DIR} ${DESTDIR}${GAP_PKG_ROOT}
cd ${WRKDIR} && pax -rw ${GAP_PKG_NAME} ${DESTDIR}${GAP_PKG_ROOT}
.include "../../math/gap/gap.package.mk"
.include "../../mk/bsd.pkg.mk"
| {
"pile_set_name": "Github"
} |
{
"Commands:": "명령:",
"Options:": "옵션:",
"Examples:": "예시:",
"boolean": "여부",
"count": "개수",
"string": "문자열",
"number": "숫자",
"array": "배열",
"required": "필수",
"default:": "기본:",
"choices:": "선택:",
"aliases:": "별칭:",
"generated-value": "생성된 값",
"Not enough non-option arguments: got %s, need at least %s": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다",
"Too many non-option arguments: got %s, maximum of %s": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다",
"Missing argument value: %s": {
"one": "인자값을 받지 못했습니다: %s",
"other": "인자값들을 받지 못했습니다: %s"
},
"Missing required argument: %s": {
"one": "필수 인자를 받지 못했습니다: %s",
"other": "필수 인자들을 받지 못했습니다: %s"
},
"Unknown argument: %s": {
"one": "알 수 없는 인자입니다: %s",
"other": "알 수 없는 인자들입니다: %s"
},
"Invalid values:": "잘못된 값입니다:",
"Argument: %s, Given: %s, Choices: %s": "인자: %s, 입력받은 값: %s, 선택지: %s",
"Argument check failed: %s": "유효하지 않은 인자입니다: %s",
"Implications failed:": "옵션의 조합이 잘못되었습니다:",
"Not enough arguments following: %s": "인자가 충분하게 주어지지 않았습니다: %s",
"Invalid JSON config file: %s": "유효하지 않은 JSON 설정파일입니다: %s",
"Path to JSON config file": "JSON 설정파일 경로",
"Show help": "도움말을 보여줍니다",
"Show version number": "버전 넘버를 보여줍니다",
"Did you mean %s?": "찾고계신게 %s입니까?",
"Arguments %s and %s are mutually exclusive" : "%s와 %s 인자는 같이 사용될 수 없습니다",
"Positionals:": "위치:",
"command": "명령"
}
| {
"pile_set_name": "Github"
} |
(set-logic QF_BV)
(set-info :status sat)
(declare-fun c () (_ BitVec 8))
(declare-fun s () (_ BitVec 8))
(declare-fun x () (_ BitVec 8))
(assert (= c #b01010111))
(assert (= s #b01110111))
(assert (= (bvmul x c) s))
(check-sat)
(exit)
| {
"pile_set_name": "Github"
} |
/*
* TeleStax, Open Source Cloud Communications Copyright 2012.
* and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.restcomm.protocols.ss7.sccp.parameter;
/**
* Return cause values parameter for connectionless message
*
* @author baranowb
* @author sergey vetyutnev
*/
public interface ReturnCause extends Parameter {
int PARAMETER_CODE = 0xB;
/**
* Gets the value of this parameter.
*
* @return the value of this parameter.
*/
ReturnCauseValue getValue();
/**
* @return the digital value of a parameter
*/
int getDigitalValue();
}
| {
"pile_set_name": "Github"
} |
# Those are new methods required for prefer local routees.
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.actor.typed.javadsl.GroupRouter.withRandomRouting")
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.actor.typed.javadsl.GroupRouter.withRoundRobinRouting")
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.actor.typed.scaladsl.GroupRouter.withRandomRouting")
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.actor.typed.scaladsl.GroupRouter.withRoundRobinRouting")
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.actor.typed.internal.routing.GroupRouterImpl.this")
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.actor.typed.internal.routing.InitialGroupRouterImpl.this") | {
"pile_set_name": "Github"
} |
/// <reference path="../fourslash.ts"/>
// @allowNonTsExtensions: true
// @Filename: jsDocCallback.js
//// /**
//// * @callback FooCallback
//// * @param {string} eventName - What even is the navigation bar?
//// */
//// /** @type {FooCallback} */
//// var t;
verify.navigationBar([
{
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "FooCallback",
"kind": "type"
},
{
"text": "t",
"kind": "var"
}
]
},
{
"text": "FooCallback",
"kind": "type",
"indent": 1
}
])
| {
"pile_set_name": "Github"
} |
'use strict';
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const isStream = require('is-stream');
const {Worker} = (() => {
try {
return require('worker_threads');
} catch (_) {
return {};
}
})();
let worker; // Lazy
let taskIdCounter = 0;
const tasks = new Map();
const recreateWorkerError = sourceError => {
const error = new Error(sourceError.message);
for (const [key, value] of Object.entries(sourceError)) {
if (key !== 'message') {
error[key] = value;
}
}
return error;
};
const createWorker = () => {
worker = new Worker(path.join(__dirname, 'thread.js'));
worker.on('message', message => {
const task = tasks.get(message.id);
tasks.delete(message.id);
if (tasks.size === 0) {
worker.unref();
}
if (message.error === undefined) {
task.resolve(message.value);
} else {
task.reject(recreateWorkerError(message.error));
}
});
worker.on('error', error => {
// Any error here is effectively an equivalent of segfault, and have no scope, so we just throw it on callback level
throw error;
});
};
const taskWorker = (method, args, transferList) => new Promise((resolve, reject) => {
const id = taskIdCounter++;
tasks.set(id, {resolve, reject});
if (worker === undefined) {
createWorker();
}
worker.ref();
worker.postMessage({id, method, args}, transferList);
});
const hasha = (input, options = {}) => {
let outputEncoding = options.encoding || 'hex';
if (outputEncoding === 'buffer') {
outputEncoding = undefined;
}
const hash = crypto.createHash(options.algorithm || 'sha512');
const update = buffer => {
const inputEncoding = typeof buffer === 'string' ? 'utf8' : undefined;
hash.update(buffer, inputEncoding);
};
if (Array.isArray(input)) {
input.forEach(update);
} else {
update(input);
}
return hash.digest(outputEncoding);
};
hasha.stream = (options = {}) => {
let outputEncoding = options.encoding || 'hex';
if (outputEncoding === 'buffer') {
outputEncoding = undefined;
}
const stream = crypto.createHash(options.algorithm || 'sha512');
stream.setEncoding(outputEncoding);
return stream;
};
hasha.fromStream = async (stream, options = {}) => {
if (!isStream(stream)) {
throw new TypeError('Expected a stream');
}
return new Promise((resolve, reject) => {
// TODO: Use `stream.pipeline` and `stream.finished` when targeting Node.js 10
stream
.on('error', reject)
.pipe(hasha.stream(options))
.on('error', reject)
.on('finish', function () {
resolve(this.read());
});
});
};
if (Worker === undefined) {
hasha.fromFile = async (filePath, options) => hasha.fromStream(fs.createReadStream(filePath), options);
hasha.async = async (input, options) => hasha(input, options);
} else {
hasha.fromFile = async (filePath, {algorithm = 'sha512', encoding = 'hex'} = {}) => {
const hash = await taskWorker('hashFile', [algorithm, filePath]);
if (encoding === 'buffer') {
return Buffer.from(hash);
}
return Buffer.from(hash).toString(encoding);
};
hasha.async = async (input, {algorithm = 'sha512', encoding = 'hex'} = {}) => {
if (encoding === 'buffer') {
encoding = undefined;
}
const hash = await taskWorker('hash', [algorithm, input]);
if (encoding === undefined) {
return Buffer.from(hash);
}
return Buffer.from(hash).toString(encoding);
};
}
hasha.fromFileSync = (filePath, options) => hasha(fs.readFileSync(filePath), options);
module.exports = hasha;
| {
"pile_set_name": "Github"
} |
@charset "UTF-8";
@font-face {
font-family: "socicon";
src:url("../fonts/socicon.eot");
src:url("../fonts/socicon.eot?#iefix") format("embedded-opentype"),
url("../fonts/socicon.woff") format("woff"),
url("../fonts/socicon.ttf") format("truetype"),
url("../fonts/socicon.svg#socicon") format("svg");
font-weight: normal;
font-style: normal;
}
[data-icon]:before {
font-family: "socicon" !important;
content: attr(data-icon);
font-style: normal !important;
font-weight: normal !important;
font-variant: normal !important;
text-transform: none !important;
speak: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
[class^="socicon-"]:before,
[class*=" socicon-"]:before {
font-family: "socicon" !important;
font-style: normal !important;
font-weight: normal !important;
font-variant: normal !important;
text-transform: none !important;
speak: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.socicon-modelmayhem:before {
content: "\e000";
}
.socicon-mixcloud:before {
content: "\e001";
}
.socicon-drupal:before {
content: "\e002";
}
.socicon-swarm:before {
content: "\e003";
}
.socicon-istock:before {
content: "\e004";
}
.socicon-yammer:before {
content: "\e005";
}
.socicon-ello:before {
content: "\e006";
}
.socicon-stackoverflow:before {
content: "\e007";
}
.socicon-persona:before {
content: "\e008";
}
.socicon-triplej:before {
content: "\e009";
}
.socicon-houzz:before {
content: "\e00a";
}
.socicon-rss:before {
content: "\e00b";
}
.socicon-paypal:before {
content: "\e00c";
}
.socicon-odnoklassniki:before {
content: "\e00d";
}
.socicon-airbnb:before {
content: "\e00e";
}
.socicon-periscope:before {
content: "\e00f";
}
.socicon-outlook:before {
content: "\e010";
}
.socicon-coderwall:before {
content: "\e011";
}
.socicon-tripadvisor:before {
content: "\e012";
}
.socicon-appnet:before {
content: "\e013";
}
.socicon-goodreads:before {
content: "\e014";
}
.socicon-tripit:before {
content: "\e015";
}
.socicon-lanyrd:before {
content: "\e016";
}
.socicon-slideshare:before {
content: "\e017";
}
.socicon-buffer:before {
content: "\e018";
}
.socicon-disqus:before {
content: "\e019";
}
.socicon-vkontakte:before {
content: "\e01a";
}
.socicon-whatsapp:before {
content: "\e01b";
}
.socicon-patreon:before {
content: "\e01c";
}
.socicon-storehouse:before {
content: "\e01d";
}
.socicon-pocket:before {
content: "\e01e";
}
.socicon-mail:before {
content: "\e01f";
}
.socicon-blogger:before {
content: "\e020";
}
.socicon-technorati:before {
content: "\e021";
}
.socicon-reddit:before {
content: "\e022";
}
.socicon-dribbble:before {
content: "\e023";
}
.socicon-stumbleupon:before {
content: "\e024";
}
.socicon-digg:before {
content: "\e025";
}
.socicon-envato:before {
content: "\e026";
}
.socicon-behance:before {
content: "\e027";
}
.socicon-delicious:before {
content: "\e028";
}
.socicon-deviantart:before {
content: "\e029";
}
.socicon-forrst:before {
content: "\e02a";
}
.socicon-play:before {
content: "\e02b";
}
.socicon-zerply:before {
content: "\e02c";
}
.socicon-wikipedia:before {
content: "\e02d";
}
.socicon-apple:before {
content: "\e02e";
}
.socicon-flattr:before {
content: "\e02f";
}
.socicon-github:before {
content: "\e030";
}
.socicon-renren:before {
content: "\e031";
}
.socicon-friendfeed:before {
content: "\e032";
}
.socicon-newsvine:before {
content: "\e033";
}
.socicon-identica:before {
content: "\e034";
}
.socicon-bebo:before {
content: "\e035";
}
.socicon-zynga:before {
content: "\e036";
}
.socicon-steam:before {
content: "\e037";
}
.socicon-xbox:before {
content: "\e038";
}
.socicon-windows:before {
content: "\e039";
}
.socicon-qq:before {
content: "\e03a";
}
.socicon-douban:before {
content: "\e03b";
}
.socicon-meetup:before {
content: "\e03c";
}
.socicon-playstation:before {
content: "\e03d";
}
.socicon-android:before {
content: "\e03e";
}
.socicon-snapchat:before {
content: "\e03f";
}
.socicon-twitter:before {
content: "\e040";
}
.socicon-facebook:before {
content: "\e041";
}
.socicon-googleplus:before {
content: "\e042";
}
.socicon-pinterest:before {
content: "\e043";
}
.socicon-foursquare:before {
content: "\e044";
}
.socicon-yahoo:before {
content: "\e045";
}
.socicon-skype:before {
content: "\e046";
}
.socicon-yelp:before {
content: "\e047";
}
.socicon-feedburner:before {
content: "\e048";
}
.socicon-linkedin:before {
content: "\e049";
}
.socicon-viadeo:before {
content: "\e04a";
}
.socicon-xing:before {
content: "\e04b";
}
.socicon-myspace:before {
content: "\e04c";
}
.socicon-soundcloud:before {
content: "\e04d";
}
.socicon-spotify:before {
content: "\e04e";
}
.socicon-grooveshark:before {
content: "\e04f";
}
.socicon-lastfm:before {
content: "\e050";
}
.socicon-youtube:before {
content: "\e051";
}
.socicon-vimeo:before {
content: "\e052";
}
.socicon-dailymotion:before {
content: "\e053";
}
.socicon-vine:before {
content: "\e054";
}
.socicon-flickr:before {
content: "\e055";
}
.socicon-500px:before {
content: "\e056";
}
.socicon-wordpress:before {
content: "\e058";
}
.socicon-tumblr:before {
content: "\e059";
}
.socicon-twitch:before {
content: "\e05a";
}
.socicon-8tracks:before {
content: "\e05b";
}
.socicon-amazon:before {
content: "\e05c";
}
.socicon-icq:before {
content: "\e05d";
}
.socicon-smugmug:before {
content: "\e05e";
}
.socicon-ravelry:before {
content: "\e05f";
}
.socicon-weibo:before {
content: "\e060";
}
.socicon-baidu:before {
content: "\e061";
}
.socicon-angellist:before {
content: "\e062";
}
.socicon-ebay:before {
content: "\e063";
}
.socicon-imdb:before {
content: "\e064";
}
.socicon-stayfriends:before {
content: "\e065";
}
.socicon-residentadvisor:before {
content: "\e066";
}
.socicon-google:before {
content: "\e067";
}
.socicon-yandex:before {
content: "\e068";
}
.socicon-sharethis:before {
content: "\e069";
}
.socicon-bandcamp:before {
content: "\e06a";
}
.socicon-itunes:before {
content: "\e06b";
}
.socicon-deezer:before {
content: "\e06c";
}
.socicon-telegram:before {
content: "\e06e";
}
.socicon-openid:before {
content: "\e06f";
}
.socicon-amplement:before {
content: "\e070";
}
.socicon-viber:before {
content: "\e071";
}
.socicon-zomato:before {
content: "\e072";
}
.socicon-draugiem:before {
content: "\e074";
}
.socicon-endomodo:before {
content: "\e075";
}
.socicon-filmweb:before {
content: "\e076";
}
.socicon-stackexchange:before {
content: "\e077";
}
.socicon-wykop:before {
content: "\e078";
}
.socicon-teamspeak:before {
content: "\e079";
}
.socicon-teamviewer:before {
content: "\e07a";
}
.socicon-ventrilo:before {
content: "\e07b";
}
.socicon-younow:before {
content: "\e07c";
}
.socicon-raidcall:before {
content: "\e07d";
}
.socicon-mumble:before {
content: "\e07e";
}
.socicon-medium:before {
content: "\e06d";
}
.socicon-bebee:before {
content: "\e07f";
}
.socicon-hitbox:before {
content: "\e080";
}
.socicon-reverbnation:before {
content: "\e081";
}
.socicon-formulr:before {
content: "\e082";
}
.socicon-instagram:before {
content: "\e057";
}
.socicon-battlenet:before {
content: "\e083";
}
.socicon-chrome:before {
content: "\e084";
}
.socicon-discord:before {
content: "\e086";
}
.socicon-issuu:before {
content: "\e087";
}
.socicon-macos:before {
content: "\e088";
}
.socicon-firefox:before {
content: "\e089";
}
.socicon-opera:before {
content: "\e08d";
}
.socicon-keybase:before {
content: "\e090";
}
.socicon-alliance:before {
content: "\e091";
}
.socicon-livejournal:before {
content: "\e092";
}
.socicon-googlephotos:before {
content: "\e093";
}
.socicon-horde:before {
content: "\e094";
}
.socicon-etsy:before {
content: "\e095";
}
.socicon-zapier:before {
content: "\e096";
}
.socicon-google-scholar:before {
content: "\e097";
}
.socicon-researchgate:before {
content: "\e098";
}
.socicon-wechat:before {
content: "\e099";
}
.socicon-strava:before {
content: "\e09a";
}
.socicon-line:before {
content: "\e09b";
}
.socicon-lyft:before {
content: "\e09c";
}
.socicon-uber:before {
content: "\e09d";
}
.socicon-songkick:before {
content: "\e09e";
}
.socicon-viewbug:before {
content: "\e09f";
}
.socicon-googlegroups:before {
content: "\e0a0";
}
.socicon-quora:before {
content: "\e073";
}
.socicon-diablo:before {
content: "\e085";
}
.socicon-blizzard:before {
content: "\e0a1";
}
.socicon-hearthstone:before {
content: "\e08b";
}
.socicon-heroes:before {
content: "\e08a";
}
.socicon-overwatch:before {
content: "\e08c";
}
.socicon-warcraft:before {
content: "\e08e";
}
.socicon-starcraft:before {
content: "\e08f";
}
.socicon-beam:before {
content: "\e0a2";
}
.socicon-curse:before {
content: "\e0a3";
}
.socicon-player:before {
content: "\e0a4";
}
.socicon-streamjar:before {
content: "\e0a5";
}
.socicon-nintendo:before {
content: "\e0a6";
}
.socicon-hellocoton:before {
content: "\e0a7";
}
| {
"pile_set_name": "Github"
} |
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
} | {
"pile_set_name": "Github"
} |
#!/usr/bin/env python
"""
Copyright (c) 2014 tilt (https://github.com/AeonDave/tilt)
See the file 'LICENSE' for copying permission
"""
from lib.logger import logger
def sort(value):
return sorted(value)
def remove_duplicates(value):
return set(value)
def list_to_string(value):
for host in value:
if host:
if type(host) is list:
for element in host:
logger.info(element)
if type(host) is str:
logger.info(host)
| {
"pile_set_name": "Github"
} |
/*
* The USB Monitor, inspired by Dave Harding's USBMon.
*
* Copyright (C) 2005 Pete Zaitcev ([email protected])
*/
#ifndef __USB_MON_H
#define __USB_MON_H
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/kref.h>
/* #include <linux/usb.h> */ /* We use struct pointers only in this header */
#define TAG "usbmon"
struct mon_bus {
struct list_head bus_link;
spinlock_t lock;
struct usb_bus *u_bus;
int text_inited;
int bin_inited;
struct dentry *dent_s; /* Debugging file */
struct dentry *dent_t; /* Text interface file */
struct dentry *dent_u; /* Second text interface file */
struct device *classdev; /* Device in usbmon class */
/* Ref */
int nreaders; /* Under mon_lock AND mbus->lock */
struct list_head r_list; /* Chain of readers (usually one) */
struct kref ref; /* Under mon_lock */
/* Stats */
unsigned int cnt_events;
unsigned int cnt_text_lost;
};
/*
* An instance of a process which opened a file (but can fork later)
*/
struct mon_reader {
struct list_head r_link;
struct mon_bus *m_bus;
void *r_data; /* Use container_of instead? */
void (*rnf_submit)(void *data, struct urb *urb);
void (*rnf_error)(void *data, struct urb *urb, int error);
void (*rnf_complete)(void *data, struct urb *urb, int status);
};
void mon_reader_add(struct mon_bus *mbus, struct mon_reader *r);
void mon_reader_del(struct mon_bus *mbus, struct mon_reader *r);
struct mon_bus *mon_bus_lookup(unsigned int num);
int /*bool*/ mon_text_add(struct mon_bus *mbus, const struct usb_bus *ubus);
void mon_text_del(struct mon_bus *mbus);
int /*bool*/ mon_bin_add(struct mon_bus *mbus, const struct usb_bus *ubus);
void mon_bin_del(struct mon_bus *mbus);
int __init mon_text_init(void);
void mon_text_exit(void);
int __init mon_bin_init(void);
void mon_bin_exit(void);
/*
*/
extern struct mutex mon_lock;
extern const struct file_operations mon_fops_stat;
extern struct mon_bus mon_bus0; /* Only for redundant checks */
#endif /* __USB_MON_H */
| {
"pile_set_name": "Github"
} |
//
// RingBufferT.h
// EMUUSBAudio
//
// Created by Wouter Pasman on 28/11/14.
// Copyright (c) 2014 Wouter Pasman. All rights reserved.
//
#ifndef __EMUUSBAudio__RingBufferT__
#define __EMUUSBAudio__RingBufferT__
#include <libkern/OSTypes.h>
#include <IOKit/IOLib.h>
/*
RingBuffer. A ring buffer is a FIFO buffer with fixed size.
This is just the interface definition. Check RingBufferDefault
Seems we can't use exceptions in the kernel, I get "cannot use 'throw' with
exceptions disabled". Therefore all functions return IOReturn.
*/
template<typename T> class RingBufferT {
public:
/*! initializes the buffer. Also call the first time
@param size the size of the ring buffer.
*/
virtual IOReturn init(UInt32 size, char *typeName) = 0;
/*! put one object in the ring. May print warning if overflow
@param object the object to push
@param time the time stamp associated with this object.
This is typically the lowest level timestamp you can get our hands on,
eg a timestamp from a USB frame.
@return kIOReturnSuccess if ok, possibly kIOReturnOverrun */
virtual IOReturn push( T object, UInt64 time) = 0;
/*! puts num objects in the ring. prints error and continues if overflow.
@param objects array[num] of num objects to push
@param num the number of objects in the array
@param time the time stamp associated with the first object, in system time ns.
This is typically the lowest level timestamp you can get our hands on,
eg a timestamp from a USB frame.
@param time_per_obj the time per object of type T (ns)
@return kIOReturnSuccess if ok, possibly kIOReturnOverrun */
virtual IOReturn push(T *objects, UInt32 num, UInt64 time, UInt32 time_per_obj) = 0 ;
/* Get one object from the ring.
@param pointer to mem block to contain the object
@return kIOReturnSuccess if ok, possibly kIOReturnUnderrun */
virtual IOReturn pop(T * object) = 0;
/*! pop num objects from the ring.
caller has to ensure that the size of objects array is at least num
@param objects array[num] of num objects to push
@param num the number of objects in the array
@return kIOReturnSuccess if ok, possibly kIOReturnUnderrun */
virtual IOReturn pop(T *objects, UInt32 num) = 0;
/*! get the number of objects in the ring */
virtual UInt32 available() = 0;
/*! get the number of free slots in the ring */
virtual UInt32 vacant() = 0;
/*! called when the write head wraps back to 0. Overwrite to get notification.
@param time the time associated with the push of the object that caused the wrap.
*/
virtual void notifyWrap(UInt64 time) = 0 ;
/*! set the current read head position. CoreAudio may start reading at weird positions.
returns kIOReturnUnderrun if the head was repositioned (by lack of better return possibility). */
virtual IOReturn seek(UInt32 pos) = 0;
/*! get current write buffer position. Useful for debugging latencies */
virtual UInt32 currentWritePosition() = 0;
};
#endif /* defined(__EMUUSBAudio__RingBufferT__) */
| {
"pile_set_name": "Github"
} |
; RUN: opt -module-summary %s -o %t.o
; RUN: opt -module-summary %p/Inputs/thinlto_alias.ll -o %t2.o
; Ensure that a preempted weak symbol that is linked in as a local
; copy is handled properly. Specifically, the local copy will be promoted,
; and internalization should be able to use the original non-promoted
; name to locate the summary (otherwise internalization will abort because
; it expects to locate summaries for all definitions).
; Note that gold picks the first copy of weakfunc() as the prevailing one,
; so listing %t2.o first is sufficient to ensure that this copy is
; preempted.
; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
; RUN: --plugin-opt=thinlto \
; RUN: --plugin-opt=save-temps \
; RUN: -o %t3.o %t2.o %t.o
; RUN: llvm-nm %t3.o | FileCheck %s
; RUN: llvm-dis %t.o.4.opt.bc -o - | FileCheck --check-prefix=OPT %s
; RUN: llvm-dis %t2.o.4.opt.bc -o - | FileCheck --check-prefix=OPT2 %s
; This does not currently pass because the gold plugin now uses the
; combined summary rather than the IRMover to change the module's linkage
; during the ThinLTO backend. The internalization step implemented by IRMover
; for preempted symbols has not yet been implemented for the combined summary.
; XFAIL: *
; CHECK-NOT: U f
; OPT: define hidden void @weakfunc.llvm.0()
; OPT2: define weak void @weakfunc()
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@weakfuncAlias = alias void (...), bitcast (void ()* @weakfunc to void (...)*)
define weak void @weakfunc() {
entry:
ret void
}
| {
"pile_set_name": "Github"
} |
<?php
namespace Illuminate\Database\Eloquent\Relations;
use Illuminate\Database\Eloquent\Builder;
class MorphPivot extends Pivot
{
/**
* The type of the polymorphic relation.
*
* Explicitly define this so it's not included in saved attributes.
*
* @var string
*/
protected $morphType;
/**
* The value of the polymorphic relation.
*
* Explicitly define this so it's not included in saved attributes.
*
* @var string
*/
protected $morphClass;
/**
* Set the keys for a save update query.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
protected function setKeysForSaveQuery(Builder $query)
{
$query->where($this->morphType, $this->morphClass);
return parent::setKeysForSaveQuery($query);
}
/**
* Delete the pivot model record from the database.
*
* @return int
*/
public function delete()
{
$query = $this->getDeleteQuery();
$query->where($this->morphType, $this->morphClass);
return $query->delete();
}
/**
* Set the morph type for the pivot.
*
* @param string $morphType
* @return $this
*/
public function setMorphType($morphType)
{
$this->morphType = $morphType;
return $this;
}
/**
* Set the morph class for the pivot.
*
* @param string $morphClass
* @return \Illuminate\Database\Eloquent\Relations\MorphPivot
*/
public function setMorphClass($morphClass)
{
$this->morphClass = $morphClass;
return $this;
}
}
| {
"pile_set_name": "Github"
} |
// stdafx.cpp : source file that includes just the standard includes
// pcid.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
| {
"pile_set_name": "Github"
} |
//
// XMAlbumColumn.h
//
// Create by nali on 23/2/2017
// Copyright © 2017. All rights reserved.
//
// Model file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
#import <UIKit/UIKit.h>
#import "XMAlbumColumnItem.h"
@interface XMAlbumColumn : NSObject
@property (nonatomic, strong) NSArray * albumColumnItems;
@property (nonatomic, assign) NSInteger channelPlayCount;
@property (nonatomic, assign) NSInteger columnContentCount;
@property (nonatomic, strong) NSString * columnIntro;
@property (nonatomic, strong) NSString * columnTitle;
@property (nonatomic, assign) NSInteger createdAt;
@property (nonatomic, assign) NSInteger currentPage;
@property (nonatomic, assign) NSInteger idField;
@property (nonatomic, strong) NSString * kind;
@property (nonatomic, assign) NSInteger totalCount;
@property (nonatomic, assign) NSInteger totalPage;
@property (nonatomic, assign) NSInteger updatedAt;
-(instancetype)initWithDictionary:(NSDictionary *)dictionary;
-(NSDictionary *)toDictionary;
@end | {
"pile_set_name": "Github"
} |
// This file is part of the pd::base library.
// Copyright (C) 2006-2014, Eugene Mamchits <[email protected]>.
// Copyright (C) 2006-2014, YANDEX LLC.
// This library may be distributed under the terms of the GNU LGPL 2.1.
// See the file ‘COPYING’ or ‘http://www.gnu.org/licenses/lgpl-2.1.html’.
#pragma once
#include <pd/base/spinlock.H>
#pragma GCC visibility push(default)
namespace pd {
template<typename x_t>
class list_item_t {
protected:
x_t *next, **me;
inline list_item_t(x_t *_this, x_t *&list) throw() {
if((next = list)) next->list_item_t<x_t>::me = &next;
*(me = &list) = _this;
}
inline ~list_item_t() throw() {
if((*me = next)) next->list_item_t<x_t>::me = me;
}
list_item_t(list_item_t const &) = delete;
list_item_t &operator=(list_item_t const &) = delete;
};
} // namespace pd
#pragma GCC visibility pop
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.