text
stringlengths 2
100k
| meta
dict |
---|---|
<?php
/**
* bubbleSort 冒泡排序
*
* 原理:
* 1.比较相邻的元素。如果第一个比第二个大,就交换他们两个。
* 2.对每一对相邻元素作同样的工作,从第一对到最后一对。最后的元素应该会是最大的数。
* 3.针对所有的元素重复以上的步骤,除了最后一个。
* 4.持续每次对越来越少的元素重复上面的步骤,直到没有任何一对数字需要比较。
*
* 时间复杂度:最好 O(n) 平均 O(n^2) 最坏 O(n^2)
* 空间复杂度:O(1)
*
*/
/**
* bubbleSort
*
* @param array $arr
*
* @return array
*/
function bubbleSort(array $arr)
{
$length = count($arr);
if ( $length < 2 ) {
return $arr;
}
for ($i = 0; $i < $length; $i++) {
for ($j = $length-1; $j > $i; $j--) {
if ( $arr[$j] < $arr[$j-1] ) {
list($arr[$j], $arr[$j-1]) = [$arr[$j-1], $arr[$j]];
}
}
}
return $arr;
}
// example
$arr = [1, 5, 3, 100, 40, 50];
echo "<pre>";
print_r($arr);
$arr = bubbleSort($arr);
print_r($arr); | {
"pile_set_name": "Github"
} |
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDvdzKDTYvRgjBO
UOrzDwkAZGwNFHHlMYyMGI5tItj3tCzXkbpM0uz3ZjHVahu+eYc+KvYApM64F2dB
b16hs713FCk8mihYABjnSndrQsl/U2v8YFT7DipfLReqqaOGu2o9HdvWfiUlaiC/
UGGfR+YblpK7CG+7/hvTXtUsMw+OppoeH9z87rhOJMxtiC7XwU5rhEmab/1f1XM/
nLoZrfDAcTbDywoeu826SJ3mifajq7oK3LDdNLjWZwfEsCO1qp2C4gLvBlOOKsWO
LNby6ByxCOPlCTa0UCaVuoNclYol71jyi17KW+Nk0nNe9yaVcyr6H0z3bImfJhbS
u4rzI93nAgMBAAECggEBAOIPOJRTpGaH7GpCYUpLK0g/hPFkF5EyEWg/1lSYzRIp
+RsX6zOS+zkiNHEv1jkeKNo7XDiHXM7U6RkQtdkZAQdk9PjM3sEUdm4CEnIjfmzA
p/R8TD0kxkNLIkhuFH2gd05y3ZHDS/XiFkAE9eOT0FrC7om6ESD7ZfFIWR18pncW
ZGq7tFAZZRmpkum2D+MJy1gWxIXBxt5madTEpRxQd56toEnfx372F0y4zkcX3pnE
4H6FaJUBjdvKl2QzF5c0jBqgxMRvWP5YfNu8+dmaQORPkpzSptOPmZM9VKV+tJVS
1xnOI6DtrnNZRojegR/E6KhNyiPTYy97UgYzdKS+SSECgYEA+wgSIqrfkeqqotJx
cGxF4x9v/ldKr5hlhJNoKXLkepkcrvhhxfHKgjWz1nZY/+Rpg42GFMvxWRrGTMIJ
ddiOr24p0HCkusWRMKQL7XxvuHDq0ro8SGqXzqWGuH31R+YNP8dy2pqd3OlwzTgg
8v0wwzx8AuyP5Ys4M20Ewv7Xuy0CgYEA9DSGMU8jmjxJ/uPDCXWOEAqtE78wTtIw
uMBv+ge0inc37xf+fN6D/ziTrJvgw/XyT15pmQdOlXx3Sg1h9XBZeIlaeCdFWrFB
oYrVsiuoXRswfkFwA0yOkCsHyGiI4TE0W1rGbqP158IjwXPczBswWI7i/D6LpINL
BD7YYpfHmeMCgYB08AiKr7Cf54H/gSqo5TcVGzLvdzhqXgKEZKp0DHpUhfivpTLe
o8jjKSMSN2U0JvHj/0xDadGO4YMYhJcll3C4VggSejaybpA46WJJCdt9PtSUv36P
eWAoOkFstfhJuufXGxDstnPtUa1jW881gi5x9D4MmqhZlKXkhtdeApr6LQKBgQDd
ItsJt9JTjpirGfC5lhwI5sIICa9jEO9RveEoluWkJYUfG6k1xgHdkYwYWCdXDFZa
DPKuwnEk6MrU4f181joO7sJf35/sGmuGL0SHzQTvGvn0uqkGM8M9RdoMXqzkzzvM
Jg1ej1bUgXcDbTnaEhzbdLiTFsg5NzMtKwOjdDIpZQKBgEIHeJIqiGjYgf7mUlX2
vNWgFNlzApkFSCQ8TkzkDOjtCdSHfdRDJ6+q8cS2TSQ7QPoAlI1woS0G48TNbVSo
wD0jNVRTdpA6R5FPsg09ohB/caSn0zlGVha2GS08ceYrn7nn4PSZ/UIYTm3pjUlV
H5tvHv0gG2C5vy3tIYQtSQCk
-----END PRIVATE KEY-----
| {
"pile_set_name": "Github"
} |
<component name="libraryTable">
<library name="com.android.support:design-27.0.2">
<CLASSES>
<root url="file://$PROJECT_DIR$/dachshundtablayout/build/intermediates/exploded-aar/com.android.support/design/27.0.2/res" />
<root url="jar://$PROJECT_DIR$/dachshundtablayout/build/intermediates/exploded-aar/com.android.support/design/27.0.2/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/design/27.0.2/94d41fc2899844b127c66f2b8ad8a0afa3eb2469/design-27.0.2-sources.jar!/" />
</SOURCES>
</library>
</component> | {
"pile_set_name": "Github"
} |
[mysqld]
#old-passwords
binlog-format=row
innodb-flush-log-at-trx-commit=0
| {
"pile_set_name": "Github"
} |
<!-- no side column -->
<div class="row">
<div class="small-12 medium-8 columns">
<h1>Kenoberiañ da Open Food Facts</h1>
<h2 class="subheader">All you need is a scan-do attitude! :-)</h2>
<!-- note to translators: you can replace "All you need is a scan-do attitude!" by a sentence that works better
for your language. Something that says that it's easy to contribute and that all that is needed is good will and a positive / can-do attitude -->
<blockquote>Can we make the food industry more open and transparent? Yes we scan!
<!-- note to translators: please translate "Can we make the food industry more open and transparent" but keep "Yes we scan!" in English -->
<cite>25.000 Open Food Facts contributors and growing - Since 2012</cite></blockquote>
</div>
<div class="text-center small-12 medium-4 columns">
<img src="/images/svg/crowdsourcing-icon.svg" width="100%" style="max-width:356px" alt="Yes we scan!" />
</div>
</div>
<hr>
<div class="row text-center">
<div class="large-12 columns">
<h2>Everyone can contribute</h2>
<h4 class="subheader">Be part of our collaborative, free and open database of food products from around the world!</h4>
<p>Open Food Facts is a non-profit project made entirely by volunteers, we do need you.</p>
</div>
</div>
<div class="row text-center">
<div class="medium-3 columns">
<h3>Ouzhpennañ produioù</h3>
<p>Use our <a href="https://play.google.com/store/apps/details?id=org.openfoodfacts.scanner&hl=en">Android</a>,
<a href="https://apps.apple.com/app/open-food-facts/id588797948">iPhone</a> or
<a href="https://microsoft.com/p/openfoodfacts/9nblggh0dkqr">Windows Phone</a> app to
easily scan the barcode of products from your home or local stores and upload pictures of their label.</p>
<p>No smartphone? No problem: you can also use your camera to add products directly on the web site.</p>
</div>
<div class="medium-3 columns">
<h3>Complete products</h3>
<p>We need to categorize products and extract ingredients lists and nutrition facts to
analyze their nutritional quality, determine if they are suitable for vegans and vegetatarians and much more!</p>
<p><a href="/help-complete-products">You can help us complete products</a> by selecting and cropping photos
and filling in information.</p>
</div>
<div class="medium-3 columns">
<h3>Tell the world</h3>
<p>Do you like Open Food Facts? Tell others about it!</p>
<p>You can present the project to your family and friends, show them how to install the app and contribute,
write a blog post, and share Open Food Facts on social media.</p>
</div>
<div class="medium-3 columns">
<h3>Make it local</h3>
<p>You can help translate the <a href="https://translate.openfoodfacts.org">site and mobile app in your language</a>,
as well as <a href="https://wiki.openfoodfacts.org/Translations">the taxonomies</a>, and to translate presentations, announcements etc.</p>
<p>Start or join a local contributors community: add local products, recruit friends, present the project in local meetups and
conferences etc.</p>
</div>
</div>
<hr>
<div class="row text-center">
<div class="large-12 columns">
<h2>Expert help needed</h2>
<p>Developing Open Food Facts also requires specialized knowledge and expertise in many different areas:</p>
</div>
</div>
<ul class="text-center small-block-grid-1 medium-block-grid-2 large-block-grid-3">
<li>
<h3>Project management</h3>
<p>We have tons of ideas and you probably have even more, but it is quite a challenge to prioritize them,
to build a roadmap, and to manage projects when every participant is a volunteer with often limited time available.</p>
</li>
<li>
<h3>Ergrafañ</h3>
<p>We need help to build a better user experience on the Open Food Facts web site and mobile app, to improve
their design, to create impactful presentation materials etc.</p>
</li>
<li>
<h3>Diorren</h3>
<p>We have a <a href="https://world.openfoodfacts.org/development">lot of development work to do</a>.
On the Open Food Facts backend (Perl and MongoDB), API (JSON),
web site (templatized HTML5, JS, Foundation), iOS and Android apps (a <a href="https://github.com/openfoodfacts/openfoodfacts-androidapp">Java/Kotlin version</a>
on Android, and <a href="https://github.com/openfoodfacts/openfoodfacts-ios">a Swift version on iOS</a>, both needing volunteers),
but also to build new cool reuses etc.
We have projects in many programming languages to ensure anyone can reuse and contribute to Open Food Facts, in any language.
We also have a growing Artificial Intelligence effort to simplify contribution work.
Our code is on <a href="https://github.com/openfoodfacts">GitHub</a>.
</li>
<li>
<h3>Community building</h3>
<p>We need to build local communities in all countries and at the same time unite them globally.</p>
<p>It is very difficult to bootstrap a local community in a country without living there, so your help
to find the first very motivated participants is essential. Are you one of them?</p>
</li>
<li>
<h3>Kehentiñ</h3>
<p>We are not sure what to write here, could you help?</p>
<p>More seriously, there are lot of cool things that users, contributors and reusers do with Open Food Facts,
it would be great to get more people to know about it. In particular, we need help for public
and <a href="/press">media relations</a>.</p>
</li>
<li>
<h3>Raktresoù ispisial</h3>
<p>There are lots of interesting and original applications of food open data that we could work on with
government food agencies, food producers, researchers, universities, schools, NGOs etc. Maybe you already have ideas?
If you do, please help us to push them forward.</p>
</li>
</ul>
<hr>
<div class="row text-center">
<div class="large-12 columns">
<h2>Let's talk!</h2>
<h4 class="subheader">A lot of ideas, energy and enthusiasm are shared in our contributors community, join us!</h4>
<p>Here are some places where you can meet other contributors, talk to them and work with them:</p>
</div>
</div>
<ul class="text-center small-block-grid-1 medium-block-grid-2 large-block-grid-3">
<li>
<h3>Slack</h3>
<p>Slack is the best way to interact and collaborate with other contributors, developers and reusers. It's a discussion forum
you can access from your browser or your phone. It completely changed how we work together. Please try it, click on the button
below to get invited to our Slack.</p>
<script async defer src="https://slack.openfoodfacts.org/slackin.js"></script>
</li>
<li>
<h3>Strolladoù Facebook</h3>
<p>We have <a href="https://www.facebook.com/groups/OpenFoodFacts">Facebook groups for Open Food Facts contributors</a> in many languages. Joining them is a good way to get news about
the project and to share announcements to a wider audience.</p>
</li>
<li>
<h3>Wiki</h3>
<p>We also have a <a href="https://wiki.openfoodfacts.org/">wiki</a> that we use to collaboratively document Open Food Facts and its sub-projects.
From the wiki, you can learn how to help translate the multilingual information (categories, labels etc.) a food product might have (<a href="https://wiki.openfoodfacts.org/Global_taxonomies">using what we call taxonomies</a>).
You can even help add a food category or a label that is not yet supported by Open Food Facts.</p>
</li>
</ul>
<hr>
<div class="row text-center">
<div class="large-12 columns">
<p>There are many more ways to contribute to Open Food Facts, please <a href="https://slack.openfoodfacts.org">join us on Slack</a> and let's start the discussion!</p>
</div>
</div>
| {
"pile_set_name": "Github"
} |
package tests.testPersistence.test;
/*Generated by MPS */
import jetbrains.mps.MPSLaunch;
import jetbrains.mps.lang.test.runtime.BaseTransformationTest;
import org.junit.ClassRule;
import jetbrains.mps.lang.test.runtime.TestParametersCache;
import org.junit.Rule;
import jetbrains.mps.lang.test.runtime.RunWithCommand;
import org.junit.Test;
import jetbrains.mps.lang.test.runtime.BaseTestBody;
import jetbrains.mps.lang.test.runtime.TransformationTest;
import jetbrains.mps.persistence.PersistenceUtil;
import jetbrains.mps.extapi.persistence.ModelFactoryService;
import jetbrains.mps.persistence.PreinstalledModelFactoryTypes;
import jetbrains.mps.smodel.persistence.def.ModelPersistence;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import junit.framework.Assert;
import jetbrains.mps.smodel.adapter.structure.concept.SConceptAdapterById;
import jetbrains.mps.java.stub.JavaPackageNameStub;
import org.jetbrains.mps.openapi.persistence.PersistenceFacade;
import jetbrains.mps.smodel.SNodeId;
import jetbrains.mps.smodel.SNodePointer;
import jetbrains.mps.smodel.loading.ModelLoadResult;
import jetbrains.mps.smodel.SModelHeader;
import jetbrains.mps.persistence.ByteArrayInputSource;
import jetbrains.mps.smodel.loading.ModelLoadingState;
import jetbrains.mps.extapi.model.SModelBase;
import jetbrains.mps.smodel.SModel;
import org.jetbrains.mps.openapi.model.SNode;
import java.util.HashMap;
import java.util.List;
import jetbrains.mps.smodel.ImplicitImportsLegacyHolder;
import java.util.Comparator;
import java.util.Set;
import org.jetbrains.mps.openapi.language.SContainmentLink;
import java.util.HashSet;
import jetbrains.mps.util.IterableUtil;
import java.util.Iterator;
import org.jetbrains.mps.openapi.language.SProperty;
import org.jetbrains.mps.openapi.language.SReferenceLink;
import org.jetbrains.mps.openapi.model.SReference;
import java.util.Map;
import org.jetbrains.mps.openapi.model.SModelReference;
import java.util.ArrayList;
import java.util.Collections;
import org.jetbrains.mps.openapi.language.SConcept;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
@MPSLaunch
public class TestPersistence_Test extends BaseTransformationTest {
@ClassRule
public static final TestParametersCache ourParamCache = new TestParametersCache(TestPersistence_Test.class, "${mps_home}", "r:8ef4c1fc-fb61-4d5c-806c-7a971cfb9392(tests.testPersistence.test@tests)", false);
@Rule
public final RunWithCommand myWithCommandRule = new RunWithCommand(this);
public TestPersistence_Test() {
super(ourParamCache);
}
@Test
public void test_testLastVersionIndexing() throws Throwable {
new TestBody(this).test_testLastVersionIndexing();
}
@Test
public void test_testPersistenceReadWrite() throws Throwable {
new TestBody(this).test_testPersistenceReadWrite();
}
@Test
public void test_testPersistenceUpgrade() throws Throwable {
new TestBody(this).test_testPersistenceUpgrade();
}
/*package*/ static class TestBody extends BaseTestBody {
/*package*/ TestBody(TransformationTest owner) {
super(owner);
}
public void test_testLastVersionIndexing() throws Exception {
TestPersistenceHelper helper = new TestPersistenceHelper(myProject.getRepository());
CollectCallback c = new CollectCallback();
byte[] serialized = PersistenceUtil.modelAsBytes(helper.getTestModel(), myProject.getComponent(ModelFactoryService.class).getFactoryByType(PreinstalledModelFactoryTypes.PLAIN_XML));
try {
ModelPersistence.index(new ByteArrayInputStream(serialized), c);
} catch (IOException e) {
Assert.fail(e.getMessage());
}
Assert.assertTrue(c.myConcepts.contains(((SConceptAdapterById) CONCEPTS.ClassConcept$bK).getId()));
Assert.assertTrue(c.myImports.contains(new JavaPackageNameStub("java.io").asModelReference(PersistenceFacade.getInstance().createModuleReference("6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)"))));
Assert.assertTrue(c.myExtRefs.contains(new SNodeId.Foreign("~System")));
Assert.assertTrue(c.myLocalRefs.contains(new SNodePointer("r:b44bed60-e0f0-4d48-bb29-e0fdb2041a66(tests.testPersistence.testModel)", "3895553186365322355").getNodeId()));
Assert.assertTrue(c.myPropertyValues.contains("instance of ClassConcept"));
}
public void test_testPersistenceReadWrite() throws Exception {
// tests write and read in each supported persistence, check that model is not changed after write/read cycle
TestPersistenceHelper helper = new TestPersistenceHelper(myProject.getRepository());
for (int i = TestPersistenceHelper.START_PERSISTENCE_TEST_VERSION; i <= ModelPersistence.LAST_VERSION; ++i) {
PersistenceUtil.InMemoryStreamDataSource dataSource = new PersistenceUtil.InMemoryStreamDataSource();
helper.saveTestModelInPersistence(dataSource, i);
byte[] content = dataSource.getContentBytes();
ModelLoadResult result = ModelPersistence.readModel(SModelHeader.create(i), new ByteArrayInputSource(content), ModelLoadingState.FULLY_LOADED);
Assert.assertTrue(result.getState() == ModelLoadingState.FULLY_LOADED);
this.assertDeepModelEquals(helper.getTestModel().getSModel(), result.getModel());
result.getModel().dispose();
}
}
public void test_testPersistenceUpgrade() throws Exception {
TestPersistenceHelper helper = new TestPersistenceHelper(myProject.getRepository());
final ModelFactoryService mfsvc = myProject.getComponent(ModelFactoryService.class);
// tests that it's possible to upgrade to the latest persistence from any supported persistence
for (int fromVersion = TestPersistenceHelper.START_PERSISTENCE_TEST_VERSION; fromVersion < ModelPersistence.LAST_VERSION; fromVersion++) {
// prepare data source in requested version
PersistenceUtil.InMemoryStreamDataSource notUpgradedData = new PersistenceUtil.InMemoryStreamDataSource();
helper.saveTestModelInPersistence(notUpgradedData, fromVersion);
// load model from source version
SModelBase notUpgradedModel = ((SModelBase) PersistenceUtil.loadModel(notUpgradedData.getContentBytes(), mfsvc.getFactoryByType(PreinstalledModelFactoryTypes.PLAIN_XML)));
// save model in last persistence
PersistenceUtil.InMemoryStreamDataSource upgradedData = new PersistenceUtil.InMemoryStreamDataSource();
ModelPersistence.saveModel(notUpgradedModel.getSModel(), upgradedData, ModelPersistence.LAST_VERSION);
// load model in last persistence from saved
SModelBase upgradedModel = ((SModelBase) PersistenceUtil.loadModel(upgradedData.getContentBytes(), mfsvc.getFactoryByType(PreinstalledModelFactoryTypes.PLAIN_XML)));
// do test
this.assertDeepModelEquals(notUpgradedModel.getSModel(), upgradedModel.getSModel());
notUpgradedModel.getSModel().dispose();
upgradedModel.getSModel().dispose();
}
}
public void assertDeepModelEquals(SModel expectedModel, SModel actualModel) {
this.assertSameImports(expectedModel, actualModel);
this.assertSameModelImports(expectedModel, actualModel);
this.assertSameLanguageAspects(expectedModel, actualModel);
this.assertSameNodesCollections("root", expectedModel.getRootNodes(), actualModel.getRootNodes());
}
public void assertSameNodesCollections(String objectName, Iterable<SNode> expected, Iterable<SNode> actual) {
HashMap<org.jetbrains.mps.openapi.model.SNodeId, SNode> actualIdToNodeMap = new HashMap<org.jetbrains.mps.openapi.model.SNodeId, SNode>();
for (SNode actualNode : actual) {
actualIdToNodeMap.put(actualNode.getNodeId(), actualNode);
}
for (SNode expectedNode : expected) {
org.jetbrains.mps.openapi.model.SNodeId rootId = expectedNode.getNodeId();
SNode actualNode = actualIdToNodeMap.get(rootId);
Assert.assertNotNull("Not found expected " + objectName + " " + expectedNode, actualNode);
this.assertDeepNodeEquals(expectedNode, actualNode);
actualIdToNodeMap.remove(rootId);
}
Assert.assertTrue("Found not expected " + objectName + " " + actualIdToNodeMap, actualIdToNodeMap.isEmpty());
}
public void assertSameModelImports(SModel expectedModel, SModel actualModel) {
TestPersistenceHelper.assertListsEqual(this.getImportedModelUIDs(expectedModel), this.getImportedModelUIDs(actualModel), "model import");
}
public void assertSameLanguageAspects(SModel expectedModel, SModel actualModel) {
List<SModel.ImportElement> expectedLanguageAspects = expectedModel.getImplicitImportsSupport().getAdditionalModelVersions();
List<SModel.ImportElement> actualLanguageAspects = actualModel.getImplicitImportsSupport().getAdditionalModelVersions();
for (SModel.ImportElement expectedEl : expectedLanguageAspects) {
boolean found = false;
for (SModel.ImportElement actualEl : actualLanguageAspects) {
if (actualEl.getModelReference().equals(expectedEl.getModelReference())) {
found = true;
break;
}
}
if (!(found)) {
Assert.fail("Not found expected language aspect " + expectedEl.getModelReference());
}
}
for (SModel.ImportElement actualEl : actualLanguageAspects) {
boolean found = false;
for (SModel.ImportElement expectedEl : expectedLanguageAspects) {
if (actualEl.getModelReference().equals(expectedEl.getModelReference())) {
found = true;
break;
}
}
if (!(found)) {
Assert.fail("Unexpected language aspect " + actualEl.getModelReference());
}
}
}
public void assertSameImports(SModel expectedModel, SModel actualModel) {
final ImplicitImportsLegacyHolder is1 = expectedModel.getImplicitImportsSupport();
final ImplicitImportsLegacyHolder is2 = actualModel.getImplicitImportsSupport();
is1.calculateImplicitImports();
is2.calculateImplicitImports();
TestPersistenceHelper.assertListsEqual(is1.getAdditionalModelVersions(), is2.getAdditionalModelVersions(), new Comparator<SModel.ImportElement>() {
@Override
public int compare(SModel.ImportElement import1, SModel.ImportElement import2) {
return (import1.getModelReference().equals(import2.getModelReference()) ? 0 : 1);
}
}, "import");
}
public void assertDeepNodeEquals(SNode expectedNode, SNode actualNode) {
Assert.assertEquals(this.getErrorString("concept", expectedNode, actualNode), expectedNode.getConcept().getQualifiedName(), actualNode.getConcept().getQualifiedName());
this.assertPropertyEquals(expectedNode, actualNode);
this.assertReferenceEquals(expectedNode, actualNode);
this.assertDeepChildrenEquals(expectedNode, actualNode);
}
public void assertDeepChildrenEquals(SNode expectedNode, SNode actualNode) {
Set<SContainmentLink> roles = new HashSet<SContainmentLink>();
for (SNode child : expectedNode.getChildren()) {
roles.add(child.getContainmentLink());
}
for (SNode child : actualNode.getChildren()) {
roles.add(child.getContainmentLink());
}
for (SContainmentLink role : roles) {
Iterable<? extends SNode> expectedChildren = expectedNode.getChildren(role);
Iterable<? extends SNode> actualChildren = actualNode.getChildren(role);
int esize = IterableUtil.asCollection(expectedChildren).size();
int asize = IterableUtil.asCollection(actualChildren).size();
Assert.assertEquals(this.getErrorString("child count in role " + role, expectedNode, actualNode), esize, asize);
Iterator<? extends SNode> actualIterator = actualChildren.iterator();
for (SNode expectedChild : expectedChildren) {
SNode actualChild = actualIterator.next();
Assert.assertEquals(this.getErrorString("children in role " + role, expectedNode, actualNode), expectedChild.getNodeId(), actualChild.getNodeId());
this.assertDeepNodeEquals(expectedChild, actualChild);
}
}
}
public void assertPropertyEquals(SNode expectedNode, SNode actualNode) {
HashSet<SProperty> propertes = new HashSet<SProperty>();
propertes.addAll(IterableUtil.asCollection(expectedNode.getProperties()));
propertes.addAll(IterableUtil.asCollection(actualNode.getProperties()));
for (SProperty key : propertes) {
String expectedProperty = expectedNode.getProperty(key);
String actualProperty = actualNode.getProperty(key);
Assert.assertEquals(this.getErrorString("property " + key, expectedNode, actualNode), expectedProperty, actualProperty);
}
}
public String getErrorString(String text, SNode expectedNode, SNode actualNode) {
return "Different " + text + " for nodes " + expectedNode + " and " + actualNode + ".";
}
public void assertReferenceEquals(SNode expectedNode, SNode actualNode) {
Set<SReferenceLink> roles = new HashSet<SReferenceLink>();
for (SReference r : expectedNode.getReferences()) {
roles.add(r.getLink());
}
for (SReference r : actualNode.getReferences()) {
roles.add(r.getLink());
}
Map<SReferenceLink, Set<SReference>> expRoleToReferenceMap = this.createRoleToReferenceMap(expectedNode);
Map<SReferenceLink, Set<SReference>> actRoleToReferenceMap = this.createRoleToReferenceMap(actualNode);
for (SReferenceLink role : roles) {
Assert.assertEquals(this.getErrorString("different number of referents in role " + role, expectedNode, actualNode), expRoleToReferenceMap.get(role).size(), actRoleToReferenceMap.get(role).size());
SReference expectedReference = expectedNode.getReference(role);
SReference actualReference = actualNode.getReference(role);
this.assertReferenceEquals(this.getErrorString("reference in role " + role, expectedNode, actualNode), expectedReference, actualReference);
}
}
public Map<SReferenceLink, Set<SReference>> createRoleToReferenceMap(SNode n) {
// XXX I don't get why there's map with set, MPS doesn't support associations with cardinality > 1
Map<SReferenceLink, Set<SReference>> expRoleToReferenceMap = new HashMap<SReferenceLink, Set<SReference>>();
for (SReference ref : n.getReferences()) {
Set<SReference> set = expRoleToReferenceMap.get(ref.getLink());
if (set == null) {
set = new HashSet<SReference>();
expRoleToReferenceMap.put(ref.getLink(), set);
}
set.add(ref);
}
return expRoleToReferenceMap;
}
public void assertReferenceEquals(String errorString, SReference expectedReference, SReference actualReference) {
if (expectedReference == null) {
Assert.assertNull(errorString, actualReference);
return;
}
Assert.assertNotNull(errorString, actualReference);
// assertIdEqualsOrBothNull(errorString, expectedReference.getTargetNode(), actualReference.getTargetNode());
Assert.assertEquals(errorString, ((jetbrains.mps.smodel.SReference) expectedReference).getResolveInfo(), ((jetbrains.mps.smodel.SReference) actualReference).getResolveInfo());
Assert.assertEquals(errorString, expectedReference.getLink(), actualReference.getLink());
Assert.assertEquals(errorString, expectedReference.getTargetNodeId(), actualReference.getTargetNodeId());
}
public void assertIdEqualsOrBothNull(String errorString, SNode expectedNode, SNode actualNode) {
if (expectedNode == null) {
Assert.assertNull(errorString, actualNode);
return;
}
Assert.assertNotNull(errorString, actualNode);
Assert.assertEquals(errorString, expectedNode.getNodeId(), actualNode.getNodeId());
}
public List<SModelReference> getImportedModelUIDs(SModel sModel) {
List<SModelReference> references = new ArrayList<SModelReference>();
for (SModel.ImportElement importElement : sModel.importedModels()) {
references.add(importElement.getModelReference());
}
return Collections.unmodifiableList(references);
}
}
private static final class CONCEPTS {
/*package*/ static final SConcept ClassConcept$bK = MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept");
}
}
| {
"pile_set_name": "Github"
} |
package com.efraespada.stringcarelibrary;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | {
"pile_set_name": "Github"
} |
# Copyright 2016 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.
import os
import re
import StringIO
import sys
VARIABLE_PATTERN = re.compile("^(?P<indentation>\s*)'(?P<name>[^']*)':\s*\[$")
EXCLUSION_PATTERN = re.compile("^(?:README|OWNERS|.*\.(pyc?|sh|swp)|.*~)$")
DATA_SOURCES_PATH_FOR_VARIABLES = {
"net_test_support_data_sources": [
"net/data/ssl/certificates",
],
"net_unittests_data_sources": [
"net/data/cert_issuer_source_aia_unittest",
"net/data/cert_issuer_source_static_unittest",
"net/data/certificate_policies_unittest",
"net/data/name_constraints_unittest",
"net/data/parse_certificate_unittest",
"net/data/parse_ocsp_unittest",
"net/data/test.html",
"net/data/url_request_unittest",
"net/data/verify_certificate_chain_unittest",
"net/data/verify_name_match_unittest/names",
"net/data/verify_signed_data_unittest",
"net/third_party/nist-pkits/certs",
"net/third_party/nist-pkits/crls",
],
}
def list_data_sources(root, paths, exclusion):
"""Returns the list of data source found in |paths|.
Args:
root: string, path to the repository root
paths: list of string, paths relative to repository root
exclusion: compiled regular expression, filename matching this pattern
will be excluded from the result
"""
data_sources = []
for path in paths:
fullpath = os.path.normpath(os.path.join(root, path))
if os.path.isfile(fullpath):
if not exclusion.match(os.path.basename(path)):
data_sources.append(path)
continue
for dirpath, dirnames, filenames in os.walk(fullpath):
for filename in filenames:
if not exclusion.match(filename):
data_sources.append(os.path.normpath(os.path.join(dirpath, filename)))
return data_sources
def format_data_sources(name, dir, data_sources, indentation):
"""Converts |data_sources| to a gyp variable assignment.
Args:
name: string, name of the variable
dir: string, path to the directory containing the gyp file
data_sources: list of filenames
indentation: string
"""
buffer = StringIO.StringIO()
buffer.write("%s'%s': [\n" % (indentation, name))
for data_source in sorted(data_sources):
buffer.write(" %s'%s',\n" % (
indentation, os.path.relpath(data_source, dir)))
buffer.write("%s],\n" % (indentation,))
return buffer.getvalue()
def save_file_if_changed(path, content):
"""Writes |content| to file at |path| if file has changed.
Args:
path: string, path of the file to save
content: string, content to write to file
"""
with open(path, "r") as file:
old_content = file.read()
if content != old_content:
with open(path, "w") as file:
file.write(content)
sys.stdout.write("updated %s, do not forget to run 'git add'\n" % (path,))
def edit_file(path, root, data_sources_for_variables):
"""Updates file at |path| by rewriting variables values.
Args:
path: string, path of the file to edit
root: string, path to the repository root
data_sources_for_variables: dictionary mapping variable names to
the list of data sources to use
"""
dir = os.path.relpath(os.path.dirname(path), root)
buffer = StringIO.StringIO()
with open(path, "r") as file:
indentation = ""
current_var = None
for line in file:
if not current_var:
match = VARIABLE_PATTERN.match(line)
if not match:
buffer.write(line)
continue
variable = match.group("name")
if variable not in data_sources_for_variables:
buffer.write(line)
continue
current_var = variable
indentation = match.group("indentation")
buffer.write(format_data_sources(
variable, dir, data_sources_for_variables[variable], indentation))
else:
if line == indentation + "],\n":
current_var = None
save_file_if_changed(path, buffer.getvalue())
def main(args):
root_dir = os.path.normpath(os.path.join(
os.path.dirname(__file__), os.pardir, os.pardir))
net_gypi = os.path.normpath(os.path.join(root_dir, "net", "net.gypi"))
data_sources_for_variables = {}
for variable in DATA_SOURCES_PATH_FOR_VARIABLES:
data_sources_for_variables[variable] = list_data_sources(
root_dir, DATA_SOURCES_PATH_FOR_VARIABLES[variable], EXCLUSION_PATTERN)
edit_file(net_gypi, root_dir, data_sources_for_variables)
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
| {
"pile_set_name": "Github"
} |
[@augurproject/types](../README.md) › [Globals](../globals.md) › ["augur-sdk/src/event-handlers"](../modules/_augur_sdk_src_event_handlers_.md) › [MarketFinalized](_augur_sdk_src_event_handlers_.marketfinalized.md)
# Interface: MarketFinalized
## Hierarchy
↳ [FormattedEventLog](_augur_sdk_src_event_handlers_.formattedeventlog.md)
↳ **MarketFinalized**
## Index
### Properties
* [address](_augur_sdk_src_event_handlers_.marketfinalized.md#address)
* [blockHash](_augur_sdk_src_event_handlers_.marketfinalized.md#blockhash)
* [blockNumber](_augur_sdk_src_event_handlers_.marketfinalized.md#blocknumber)
* [contractName](_augur_sdk_src_event_handlers_.marketfinalized.md#contractname)
* [eventName](_augur_sdk_src_event_handlers_.marketfinalized.md#eventname)
* [logIndex](_augur_sdk_src_event_handlers_.marketfinalized.md#logindex)
* [market](_augur_sdk_src_event_handlers_.marketfinalized.md#market)
* [removed](_augur_sdk_src_event_handlers_.marketfinalized.md#removed)
* [timestamp](_augur_sdk_src_event_handlers_.marketfinalized.md#timestamp)
* [transactionHash](_augur_sdk_src_event_handlers_.marketfinalized.md#transactionhash)
* [transactionIndex](_augur_sdk_src_event_handlers_.marketfinalized.md#transactionindex)
* [universe](_augur_sdk_src_event_handlers_.marketfinalized.md#universe)
* [winningPayoutNumerators](_augur_sdk_src_event_handlers_.marketfinalized.md#winningpayoutnumerators)
## Properties
### address
• **address**: *[Address](../modules/_augur_sdk_src_event_handlers_.md#address)*
*Inherited from [FormattedEventLog](_augur_sdk_src_event_handlers_.formattedeventlog.md).[address](_augur_sdk_src_event_handlers_.formattedeventlog.md#address)*
*Defined in [packages/augur-sdk/src/event-handlers.ts:17](https://github.com/AugurProject/augur/blob/69c4be52bf/packages/augur-sdk/src/event-handlers.ts#L17)*
___
### blockHash
• **blockHash**: *[Bytes32](../modules/_augur_sdk_src_event_handlers_.md#bytes32)*
*Inherited from [FormattedEventLog](_augur_sdk_src_event_handlers_.formattedeventlog.md).[blockHash](_augur_sdk_src_event_handlers_.formattedeventlog.md#blockhash)*
*Defined in [packages/augur-sdk/src/event-handlers.ts:23](https://github.com/AugurProject/augur/blob/69c4be52bf/packages/augur-sdk/src/event-handlers.ts#L23)*
___
### blockNumber
• **blockNumber**: *number*
*Inherited from [FormattedEventLog](_augur_sdk_src_event_handlers_.formattedeventlog.md).[blockNumber](_augur_sdk_src_event_handlers_.formattedeventlog.md#blocknumber)*
*Defined in [packages/augur-sdk/src/event-handlers.ts:18](https://github.com/AugurProject/augur/blob/69c4be52bf/packages/augur-sdk/src/event-handlers.ts#L18)*
___
### contractName
• **contractName**: *string*
*Inherited from [FormattedEventLog](_augur_sdk_src_event_handlers_.formattedeventlog.md).[contractName](_augur_sdk_src_event_handlers_.formattedeventlog.md#contractname)*
*Defined in [packages/augur-sdk/src/event-handlers.ts:22](https://github.com/AugurProject/augur/blob/69c4be52bf/packages/augur-sdk/src/event-handlers.ts#L22)*
___
### eventName
• **eventName**: *string*
*Inherited from [Event](_augur_sdk_src_event_handlers_.event.md).[eventName](_augur_sdk_src_event_handlers_.event.md#eventname)*
*Defined in [packages/augur-sdk/src/event-handlers.ts:9](https://github.com/AugurProject/augur/blob/69c4be52bf/packages/augur-sdk/src/event-handlers.ts#L9)*
___
### logIndex
• **logIndex**: *number*
*Inherited from [FormattedEventLog](_augur_sdk_src_event_handlers_.formattedeventlog.md).[logIndex](_augur_sdk_src_event_handlers_.formattedeventlog.md#logindex)*
*Defined in [packages/augur-sdk/src/event-handlers.ts:19](https://github.com/AugurProject/augur/blob/69c4be52bf/packages/augur-sdk/src/event-handlers.ts#L19)*
___
### market
• **market**: *[Address](../modules/_augur_sdk_src_event_handlers_.md#address)*
*Defined in [packages/augur-sdk/src/event-handlers.ts:138](https://github.com/AugurProject/augur/blob/69c4be52bf/packages/augur-sdk/src/event-handlers.ts#L138)*
___
### removed
• **removed**: *boolean*
*Inherited from [FormattedEventLog](_augur_sdk_src_event_handlers_.formattedeventlog.md).[removed](_augur_sdk_src_event_handlers_.formattedeventlog.md#removed)*
*Defined in [packages/augur-sdk/src/event-handlers.ts:24](https://github.com/AugurProject/augur/blob/69c4be52bf/packages/augur-sdk/src/event-handlers.ts#L24)*
___
### timestamp
• **timestamp**: *string*
*Defined in [packages/augur-sdk/src/event-handlers.ts:139](https://github.com/AugurProject/augur/blob/69c4be52bf/packages/augur-sdk/src/event-handlers.ts#L139)*
___
### transactionHash
• **transactionHash**: *[Bytes32](../modules/_augur_sdk_src_event_handlers_.md#bytes32)*
*Inherited from [FormattedEventLog](_augur_sdk_src_event_handlers_.formattedeventlog.md).[transactionHash](_augur_sdk_src_event_handlers_.formattedeventlog.md#transactionhash)*
*Defined in [packages/augur-sdk/src/event-handlers.ts:20](https://github.com/AugurProject/augur/blob/69c4be52bf/packages/augur-sdk/src/event-handlers.ts#L20)*
___
### transactionIndex
• **transactionIndex**: *number*
*Inherited from [FormattedEventLog](_augur_sdk_src_event_handlers_.formattedeventlog.md).[transactionIndex](_augur_sdk_src_event_handlers_.formattedeventlog.md#transactionindex)*
*Defined in [packages/augur-sdk/src/event-handlers.ts:21](https://github.com/AugurProject/augur/blob/69c4be52bf/packages/augur-sdk/src/event-handlers.ts#L21)*
___
### universe
• **universe**: *[Address](../modules/_augur_sdk_src_event_handlers_.md#address)*
*Defined in [packages/augur-sdk/src/event-handlers.ts:137](https://github.com/AugurProject/augur/blob/69c4be52bf/packages/augur-sdk/src/event-handlers.ts#L137)*
___
### winningPayoutNumerators
• **winningPayoutNumerators**: *string[]*
*Defined in [packages/augur-sdk/src/event-handlers.ts:140](https://github.com/AugurProject/augur/blob/69c4be52bf/packages/augur-sdk/src/event-handlers.ts#L140)*
| {
"pile_set_name": "Github"
} |
#pragma once
/*
* 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.
*/
/**
* $Id: 5e61a8e1771a556963016100330a21a0a6c054eb $
*
* @file src/lib/sim/base.h
* @brief Master include file for all lib/sim functions.
*
* @copyright 2019 The FreeRADIUS server project
*/
RCSIDH(sim_base_h, "$Id: 5e61a8e1771a556963016100330a21a0a6c054eb $")
#include <freeradius-devel/sim/common.h>
#include <freeradius-devel/sim/comp128.h
#include <freeradius-devel/sim/milenage.h>
#include <freeradius-devel/sim/ts_34_108.h>
| {
"pile_set_name": "Github"
} |
Write a comment here
*** Parameters: ***
{} # params
*** Markdown input: ***
<div class="frame">
<a class="photo" href="http://www.flickr.com/photos/censi/88561568/" ><img moz-do-not-send="true" src="http://static.flickr.com/28/88561568_ab84d28245_m.jpg" width="240" height="180" alt="Aperitif" /></a>
</div>
*** Output of inspect ***
md_el(:document,[
md_html(" <div class=\"frame\">\n <a class=\"photo\" href=\"http://www.flickr.com/photos/censi/88561568/\" ><img moz-do-not-send=\"true\" src=\"http://static.flickr.com/28/88561568_ab84d28245_m.jpg\" width=\"240\" height=\"180\" alt=\"Aperitif\" /></a>\n </div>")
],{},[])
*** Output of to_html ***
<div class="frame">
<a class="photo" href="http://www.flickr.com/photos/censi/88561568/"><img moz-do-not-send="true" src="http://static.flickr.com/28/88561568_ab84d28245_m.jpg" width="240" height="180" alt="Aperitif" /></a>
</div>
*** Output of to_latex ***
*** Output of to_md ***
*** Output of to_s ***
| {
"pile_set_name": "Github"
} |
package pflag
import "strconv"
// -- uint32 value
type uint32Value uint32
func newUint32Value(val uint32, p *uint32) *uint32Value {
*p = val
return (*uint32Value)(p)
}
func (i *uint32Value) Set(s string) error {
v, err := strconv.ParseUint(s, 0, 32)
*i = uint32Value(v)
return err
}
func (i *uint32Value) Type() string {
return "uint32"
}
func (i *uint32Value) String() string { return strconv.FormatUint(uint64(*i), 10) }
func uint32Conv(sval string) (interface{}, error) {
v, err := strconv.ParseUint(sval, 0, 32)
if err != nil {
return 0, err
}
return uint32(v), nil
}
// GetUint32 return the uint32 value of a flag with the given name
func (f *FlagSet) GetUint32(name string) (uint32, error) {
val, err := f.getFlagType(name, "uint32", uint32Conv)
if err != nil {
return 0, err
}
return val.(uint32), nil
}
// Uint32Var defines a uint32 flag with specified name, default value, and usage string.
// The argument p points to a uint32 variable in which to store the value of the flag.
func (f *FlagSet) Uint32Var(p *uint32, name string, value uint32, usage string) {
f.VarP(newUint32Value(value, p), name, "", usage)
}
// Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) {
f.VarP(newUint32Value(value, p), name, shorthand, usage)
}
// Uint32Var defines a uint32 flag with specified name, default value, and usage string.
// The argument p points to a uint32 variable in which to store the value of the flag.
func Uint32Var(p *uint32, name string, value uint32, usage string) {
CommandLine.VarP(newUint32Value(value, p), name, "", usage)
}
// Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash.
func Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) {
CommandLine.VarP(newUint32Value(value, p), name, shorthand, usage)
}
// Uint32 defines a uint32 flag with specified name, default value, and usage string.
// The return value is the address of a uint32 variable that stores the value of the flag.
func (f *FlagSet) Uint32(name string, value uint32, usage string) *uint32 {
p := new(uint32)
f.Uint32VarP(p, name, "", value, usage)
return p
}
// Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) Uint32P(name, shorthand string, value uint32, usage string) *uint32 {
p := new(uint32)
f.Uint32VarP(p, name, shorthand, value, usage)
return p
}
// Uint32 defines a uint32 flag with specified name, default value, and usage string.
// The return value is the address of a uint32 variable that stores the value of the flag.
func Uint32(name string, value uint32, usage string) *uint32 {
return CommandLine.Uint32P(name, "", value, usage)
}
// Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash.
func Uint32P(name, shorthand string, value uint32, usage string) *uint32 {
return CommandLine.Uint32P(name, shorthand, value, usage)
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<!-- Generated by javadoc (1.8.0_231) on Sun Nov 17 02:10:59 CET 2019 -->
<title>Uses of Package org.deidentifier.arx.gui.view</title>
<meta name="date" content="2019-11-17">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Package org.deidentifier.arx.gui.view";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li class="navBarCell1Rev">Use</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/deidentifier/arx/gui/view/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Uses of Package org.deidentifier.arx.gui.view" class="title">Uses of Package<br>org.deidentifier.arx.gui.view</h1>
</div>
<div class="contentContainer">No usage of org.deidentifier.arx.gui.view</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li class="navBarCell1Rev">Use</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/deidentifier/arx/gui/view/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<body>
<a download="suggested-filename" href="">link</a>
<script>
var anchorElement = document.querySelector('a[download]');
url = window.location.href;
anchorElement.href = url.substr(url.indexOf('=') + 1);
anchorElement.click();
</script>
</body>
</html>
| {
"pile_set_name": "Github"
} |
# encoding: utf-8
# Copyright (c) 2012-2017, Jungwacht Blauring Schweiz. This file is part of
# hitobito and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito.
class InvoiceItemDecorator < ApplicationDecorator
decorates :invoice_item
def cost
format_currency(model.cost)
end
def unit_cost
format_currency(model.unit_cost)
end
def vat_rate
h.number_to_percentage(model.vat_rate || 0)
end
def total
format_currency(model.total)
end
def format_currency(value)
invoice.decorate.format_currency(value)
end
end
| {
"pile_set_name": "Github"
} |
/*
* Popup Background
*
*/
.popup-image {
position: absolute;
z-index: 5;
img {
width: 100%;
height: auto;
}
}
.popup-products {
.popup-image {
&:nth-child(1) {
top: 0;
left: 0;
width: 45%;
max-width: 450px;
}
&:nth-child(2) {
left: 5%;
bottom: 15%;
width: 50%;
max-width: 350px;
}
&:nth-child(3) {
right: 5%;
top: 15%;
width: 40%;
max-width: 400px;
}
&:nth-child(4) {
bottom: 0;
right: 0;
width: 55%;
max-width: 500px;
}
}
}
.popup-services {
.popup-image {
&:nth-child(1) {
top: 5%;
left: 10%;
width: 40%;
max-width: 200px;
}
&:nth-child(2) {
left: 5%;
bottom: 15%;
width: 50%;
max-width: 400px;
}
&:nth-child(3) {
right: 5%;
top: 10%;
width: 40%;
max-width: 300px;
}
&:nth-child(4) {
bottom: 0;
right: 0;
width: 50%;
max-width: 450px;
}
}
}
.popup-together {
.popup-image {
&:nth-child(1) {
top: 0;
left: 0;
width: 45%;
max-width: 340px;
}
&:nth-child(2) {
left: 4%;
bottom: 7%;
width: 50%;
max-width: 320px;
}
&:nth-child(3) {
right: 5%;
top: 15%;
width: 40%;
max-width: 350px;
}
&:nth-child(4) {
bottom: 0;
right: 0;
width: 55%;
max-width: 310px;
}
}
}
.popup-own-products {
.popup-image {
&:nth-child(1) {
top: 5%;
left: 15%;
width: 45%;
max-width: 340px;
}
&:nth-child(2) {
left: 1%;
bottom: 7%;
width: 50%;
max-width: 320px;
}
&:nth-child(3) {
right: 5%;
top: 15%;
width: 40%;
max-width: 350px;
}
&:nth-child(4) {
bottom: 0;
right: 7%;
width: 55%;
max-width: 310px;
}
}
}
.popup-ventures {
.popup-image {
&:nth-child(1) {
top: 3%;
left: 6%;
width: 50%;
max-width: 450px;
}
&:nth-child(2) {
left: 3%;
bottom: 4%;
width: 50%;
max-width: 370px;
}
&:nth-child(3) {
right: 26%;
top: 15%;
width: 35%;
max-width: 210px;
}
&:nth-child(4) {
top: 10%;
right: 5%;
width: 35%;
max-width: 210px;
}
&:nth-child(5) {
bottom: 2%;
right: 7%;
width: 55%;
max-width: 240px;
}
}
}
.popup-collective {
.popup-image {
&:nth-child(1) {
top: 2%;
left: 3%;
width: 55%;
max-width: 450px;
}
&:nth-child(2) {
left: 5%;
bottom: 15%;
width: 50%;
max-width: 400px;
}
&:nth-child(3) {
right: 5%;
top: 10%;
width: 40%;
max-width: 300px;
}
&:nth-child(4) {
bottom: 0;
right: 0;
width: 50%;
max-width: 450px;
}
}
}
.popup-brands,
.popup-startups {
.popup-image {
img {
width: 80px;
margin-left: -40px;
}
&:nth-child(1),
&:nth-child(2),
&:nth-child(3),
&:nth-child(4) {
left: 33%;
}
&:nth-child(5),
&:nth-child(6),
&:nth-child(7),
&:nth-child(8) {
left: 67%;
}
&:nth-child(1) { top: 2% }
&:nth-child(2) { top: 17% }
&:nth-child(3) { bottom: 17% }
&:nth-child(4) { bottom: 2% }
&:nth-child(5) { top: 7% }
&:nth-child(6) { top: 22% }
&:nth-child(7) { bottom: 22% }
&:nth-child(8) { bottom: 7% }
&:nth-child(9),
&:nth-child(10),
&:nth-child(11),
&:nth-child(12),
&:nth-child(13),
&:nth-child(14) {
display: none;
}
}
}
@media screen and (min-width: $bp-smaller) {
.popup-brands,
.popup-startups {
.popup-image {
img {
width: 100px;
margin-left: -50px;
}
}
}
}
@media screen and (min-width: $bp-tablet) {
.popup-brands {
.popup-image {
img {
width: 120px;
margin-left: -60px;
}
&:nth-child(1),
&:nth-child(2),
&:nth-child(3),
&:nth-child(4) {
left: 20%;
}
&:nth-child(5),
&:nth-child(6),
&:nth-child(7),
&:nth-child(8) {
left: 50%;
}
&:nth-child(9),
&:nth-child(10),
&:nth-child(11),
&:nth-child(12) {
display: block;
left: 80%;
}
&:nth-child(9) { top: 2% }
&:nth-child(10) { top: 17% }
&:nth-child(11) { bottom: 17% }
&:nth-child(12) { bottom: 2% }
}
}
.popup-startups {
.popup-image {
img {
width: 140px;
margin-left: -75px;
}
}
}
}
@media screen and (min-width: $bp-medium) {
.popup-brands {
.popup-image {
img {
width: 150px;
}
&:nth-child(1),
&:nth-child(2),
&:nth-child(3),
&:nth-child(4) {
left: 10%;
}
&:nth-child(5),
&:nth-child(6),
&:nth-child(7),
&:nth-child(8) {
left: 40%;
}
&:nth-child(9),
&:nth-child(10),
&:nth-child(11),
&:nth-child(12) {
left: 70%;
}
&:nth-child(2),
&:nth-child(4),
&:nth-child(6),
&:nth-child(8),
&:nth-child(10),
&:nth-child(12) {
margin-left: 15%;
}
&:nth-child(5) { top: 2% }
&:nth-child(6) { top: 17% }
&:nth-child(7) { bottom: 17% }
&:nth-child(8) { bottom: 2% }
}
}
}
@media screen and (min-width: $bp-large) {
.popup-brands {
.popup-image {
&:nth-child(13),
&:nth-child(14) {
display: block;
}
&:nth-child(13) {
left: 10%;
top: 35%;
}
&:nth-child(14) {
left: 85%;
top: 47%;
}
}
}
.popup-startups {
.popup-image {
img {
width: 180px;
margin-left: -90px;
}
&:nth-child(1) {
left: 20%;
top: 10%;
}
&:nth-child(2) {
left: 15%;
top: 45%;
}
&:nth-child(3) {
left: 20%;
bottom: 10%;
}
&:nth-child(4) {
left: 50%;
top: 20%;
}
&:nth-child(5) {
left: 50%;
bottom: 20%;
top: auto;
}
&:nth-child(6) {
left: 80%;
top: 10%;
}
&:nth-child(7) {
left: 85%;
top: 45%;
}
&:nth-child(8) {
left: 80%;
bottom: 10%;
}
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* (C) Copyright IBM Corp. 2020.
*
* 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.
*/
package com.ibm.watson.discovery.v2.model;
import com.ibm.cloud.sdk.core.service.model.GenericModel;
/** The deleteEnrichment options. */
public class DeleteEnrichmentOptions extends GenericModel {
protected String projectId;
protected String enrichmentId;
/** Builder. */
public static class Builder {
private String projectId;
private String enrichmentId;
private Builder(DeleteEnrichmentOptions deleteEnrichmentOptions) {
this.projectId = deleteEnrichmentOptions.projectId;
this.enrichmentId = deleteEnrichmentOptions.enrichmentId;
}
/** Instantiates a new builder. */
public Builder() {}
/**
* Instantiates a new builder with required properties.
*
* @param projectId the projectId
* @param enrichmentId the enrichmentId
*/
public Builder(String projectId, String enrichmentId) {
this.projectId = projectId;
this.enrichmentId = enrichmentId;
}
/**
* Builds a DeleteEnrichmentOptions.
*
* @return the deleteEnrichmentOptions
*/
public DeleteEnrichmentOptions build() {
return new DeleteEnrichmentOptions(this);
}
/**
* Set the projectId.
*
* @param projectId the projectId
* @return the DeleteEnrichmentOptions builder
*/
public Builder projectId(String projectId) {
this.projectId = projectId;
return this;
}
/**
* Set the enrichmentId.
*
* @param enrichmentId the enrichmentId
* @return the DeleteEnrichmentOptions builder
*/
public Builder enrichmentId(String enrichmentId) {
this.enrichmentId = enrichmentId;
return this;
}
}
protected DeleteEnrichmentOptions(Builder builder) {
com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.projectId, "projectId cannot be empty");
com.ibm.cloud.sdk.core.util.Validator.notEmpty(
builder.enrichmentId, "enrichmentId cannot be empty");
projectId = builder.projectId;
enrichmentId = builder.enrichmentId;
}
/**
* New builder.
*
* @return a DeleteEnrichmentOptions builder
*/
public Builder newBuilder() {
return new Builder(this);
}
/**
* Gets the projectId.
*
* <p>The ID of the project. This information can be found from the deploy page of the Discovery
* administrative tooling.
*
* @return the projectId
*/
public String projectId() {
return projectId;
}
/**
* Gets the enrichmentId.
*
* <p>The ID of the enrichment.
*
* @return the enrichmentId
*/
public String enrichmentId() {
return enrichmentId;
}
}
| {
"pile_set_name": "Github"
} |
# encoding: UTF-8
module Vines
class Stream
class Component
class Start < State
def initialize(stream, success=Handshake)
super
end
def node(node)
raise StreamErrors::NotAuthorized unless stream?(node)
stream.start(node)
advance
end
end
end
end
end
| {
"pile_set_name": "Github"
} |
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
; Audio out Audio in
-odac -iadc ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o sininv.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>
; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
; Instrument #1.
instr 1
irad = 0.5
i1 = sininv(irad)
print i1
endin
</CsInstruments>
<CsScore>
; Play Instrument #1 for one second.
i 1 0 1
e
</CsScore>
</CsoundSynthesizer>
| {
"pile_set_name": "Github"
} |
// (C) Copyright John Maddock 2007.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// This file is machine generated, do not edit by hand
// Polynomial evaluation using Horners rule
#ifndef BOOST_MATH_TOOLS_POLY_RAT_17_HPP
#define BOOST_MATH_TOOLS_POLY_RAT_17_HPP
namespace boost{ namespace math{ namespace tools{ namespace detail{
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
{
return static_cast<V>(0);
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
{
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
{
if(x <= 1)
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
{
if(x <= 1)
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
{
if(x <= 1)
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
{
if(x <= 1)
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
{
if(x <= 1)
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
{
if(x <= 1)
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
{
if(x <= 1)
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
{
if(x <= 1)
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
{
if(x <= 1)
return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
{
if(x <= 1)
return static_cast<V>(((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((b[10] * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>(((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) / ((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
{
if(x <= 1)
return static_cast<V>((((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((b[11] * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) / (((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
{
if(x <= 1)
return static_cast<V>(((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((b[12] * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>(((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) / ((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
{
if(x <= 1)
return static_cast<V>((((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((b[13] * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) / (((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*)
{
if(x <= 1)
return static_cast<V>(((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((b[14] * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>(((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) / ((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<16>*)
{
if(x <= 1)
return static_cast<V>((((((((((((((((a[15] * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((((b[15] * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) / (((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]));
}
}
template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<17>*)
{
if(x <= 1)
return static_cast<V>(((((((((((((((((a[16] * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((((b[16] * x + b[15]) * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
else
{
V z = 1 / x;
return static_cast<V>(((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) * z + a[16]) / ((((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]) * z + b[16]));
}
}
}}}} // namespaces
#endif // include guard
| {
"pile_set_name": "Github"
} |
//
// UIScrollView+STRefresh.m
// SwipeTableView
//
// Created by Roy lee on 16/7/10.
// Copyright © 2016年 Roy lee. All rights reserved.
//
#import "UIScrollView+STRefresh.h"
#import <objc/runtime.h>
@implementation UIScrollView (STRefresh)
- (STRefreshHeader *)header {
return objc_getAssociatedObject(self, _cmd);
}
- (void)setHeader:(STRefreshHeader *)header {
[self.header removeFromSuperview];
[self addSubview:header];
SEL key = @selector(header);
objc_setAssociatedObject(self, key, header, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
@end
| {
"pile_set_name": "Github"
} |
{
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"collection_name": "test",
"database_name": "command-monitoring-tests",
"tests": [
{
"description": "A successful mixed bulk write",
"operation": {
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "insertOne",
"arguments": {
"document": {
"_id": 4,
"x": 44
}
}
},
{
"name": "updateOne",
"arguments": {
"filter": {
"_id": 3
},
"update": {
"$set": {
"x": 333
}
}
}
}
]
}
},
"expectations": [
{
"command_started_event": {
"command": {
"insert": "test",
"documents": [
{
"_id": 4,
"x": 44
}
],
"ordered": true
},
"command_name": "insert",
"database_name": "command-monitoring-tests"
}
},
{
"command_succeeded_event": {
"reply": {
"ok": 1,
"n": 1
},
"command_name": "insert"
}
},
{
"command_started_event": {
"command": {
"update": "test",
"updates": [
{
"q": {
"_id": 3
},
"u": {
"$set": {
"x": 333
}
},
"upsert": false,
"multi": false
}
],
"ordered": true
},
"command_name": "update",
"database_name": "command-monitoring-tests"
}
},
{
"command_succeeded_event": {
"reply": {
"ok": 1,
"n": 1
},
"command_name": "update"
}
}
]
}
]
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>CMSIS-DSP: ARMCM3 Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="stylsheetf" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 46px;">
<td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">CMSIS-DSP
 <span id="projectnumber">Version 1.4.4</span>
</div>
<div id="projectbrief">CMSIS DSP Software Library</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
<ul class="tablist">
<li><a href="../../General/html/index.html"><span>CMSIS</span></a></li>
<li><a href="../../Core/html/index.html"><span>CORE</span></a></li>
<li><a href="../../Driver/html/index.html"><span>Driver</span></a></li>
<li class="current"><a href="../../DSP/html/index.html"><span>DSP</span></a></li>
<li><a href="../../RTOS/html/index.html"><span>RTOS API</span></a></li>
<li><a href="../../Pack/html/index.html"><span>Pack</span></a></li>
<li><a href="../../SVD/html/index.html"><span>SVD</span></a></li>
</ul>
</div>
<!-- Generated by Doxygen 1.8.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Usage and Description</span></a></li>
<li><a href="modules.html"><span>Reference</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('dir_918b1d9c020a9c8774a15ad3971a73ba.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">ARMCM3 Directory Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr>
<tr class="memitem:arm__matrix__example_2_a_r_m_2_r_t_e_2_device_2_a_r_m_c_m3_2system___a_r_m_c_m3_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="arm__matrix__example_2_a_r_m_2_r_t_e_2_device_2_a_r_m_c_m3_2system___a_r_m_c_m3_8c.html">arm_matrix_example/ARM/RTE/Device/ARMCM3/system_ARMCM3.c</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_be2d3df67661aefe0e3f0071a1d6f8f1.html">DSP_Lib</a></li><li class="navelem"><a class="el" href="dir_50f4d4f91ce5cd72cb6928b47e85a7f8.html">Examples</a></li><li class="navelem"><a class="el" href="dir_6128d62f89366c4b8843a6e619831037.html">arm_matrix_example</a></li><li class="navelem"><a class="el" href="dir_7101093b4d1c318dab4c75d3b6d4e65e.html">ARM</a></li><li class="navelem"><a class="el" href="dir_56c57e2f0b48b2b8a51ef27bd8c502e6.html">RTE</a></li><li class="navelem"><a class="el" href="dir_81c44c586c907f45c06b9b0a1d54e536.html">Device</a></li><li class="navelem"><a class="el" href="dir_918b1d9c020a9c8774a15ad3971a73ba.html">ARMCM3</a></li>
<li class="footer">Generated on Tue Sep 23 2014 18:52:44 for CMSIS-DSP by ARM Ltd. All rights reserved.
<!--
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.2
-->
</li>
</ul>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
#include <stdio.h>
EXEC SQL INCLUDE sqlca;
exec sql include ../regression;
EXEC SQL WHENEVER SQLERROR sqlprint;
int
main ()
{
ECPGdebug (1, stderr);
EXEC SQL CONNECT TO REGRESSDB1;
EXEC SQL CREATE TABLE foo (a int, b varchar);
EXEC SQL INSERT INTO foo VALUES (5, 'abc');
EXEC SQL INSERT INTO foo VALUES (6, 'def');
EXEC SQL INSERT INTO foo VALUES (7, 'ghi');
EXEC SQL COPY foo TO STDOUT WITH DELIMITER ',';
printf ("copy to STDOUT : sqlca.sqlcode = %ld\n", sqlca.sqlcode);
EXEC SQL DISCONNECT;
return 0;
}
| {
"pile_set_name": "Github"
} |
K 13
svn:mime-type
V 24
application/octet-stream
END
| {
"pile_set_name": "Github"
} |
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/material_sets/metallic/gear"
}
}
| {
"pile_set_name": "Github"
} |
/*
* Generic PXA PATA driver
*
* Copyright (C) 2010 Marek Vasut <[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, 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; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/blkdev.h>
#include <linux/ata.h>
#include <linux/libata.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/slab.h>
#include <linux/completion.h>
#include <scsi/scsi_host.h>
#include <mach/pxa2xx-regs.h>
#include <mach/pata_pxa.h>
#include <mach/dma.h>
#define DRV_NAME "pata_pxa"
#define DRV_VERSION "0.1"
struct pata_pxa_data {
uint32_t dma_channel;
struct pxa_dma_desc *dma_desc;
dma_addr_t dma_desc_addr;
uint32_t dma_desc_id;
/* DMA IO physical address */
uint32_t dma_io_addr;
/* PXA DREQ<0:2> pin selector */
uint32_t dma_dreq;
/* DMA DCSR register value */
uint32_t dma_dcsr;
struct completion dma_done;
};
/*
* Setup the DMA descriptors. The size is transfer capped at 4k per descriptor,
* if the transfer is longer, it is split into multiple chained descriptors.
*/
static void pxa_load_dmac(struct scatterlist *sg, struct ata_queued_cmd *qc)
{
struct pata_pxa_data *pd = qc->ap->private_data;
uint32_t cpu_len, seg_len;
dma_addr_t cpu_addr;
cpu_addr = sg_dma_address(sg);
cpu_len = sg_dma_len(sg);
do {
seg_len = (cpu_len > 0x1000) ? 0x1000 : cpu_len;
pd->dma_desc[pd->dma_desc_id].ddadr = pd->dma_desc_addr +
((pd->dma_desc_id + 1) * sizeof(struct pxa_dma_desc));
pd->dma_desc[pd->dma_desc_id].dcmd = DCMD_BURST32 |
DCMD_WIDTH2 | (DCMD_LENGTH & seg_len);
if (qc->tf.flags & ATA_TFLAG_WRITE) {
pd->dma_desc[pd->dma_desc_id].dsadr = cpu_addr;
pd->dma_desc[pd->dma_desc_id].dtadr = pd->dma_io_addr;
pd->dma_desc[pd->dma_desc_id].dcmd |= DCMD_INCSRCADDR |
DCMD_FLOWTRG;
} else {
pd->dma_desc[pd->dma_desc_id].dsadr = pd->dma_io_addr;
pd->dma_desc[pd->dma_desc_id].dtadr = cpu_addr;
pd->dma_desc[pd->dma_desc_id].dcmd |= DCMD_INCTRGADDR |
DCMD_FLOWSRC;
}
cpu_len -= seg_len;
cpu_addr += seg_len;
pd->dma_desc_id++;
} while (cpu_len);
/* Should not happen */
if (seg_len & 0x1f)
DALGN |= (1 << pd->dma_dreq);
}
/*
* Prepare taskfile for submission.
*/
static void pxa_qc_prep(struct ata_queued_cmd *qc)
{
struct pata_pxa_data *pd = qc->ap->private_data;
int si = 0;
struct scatterlist *sg;
if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return;
pd->dma_desc_id = 0;
DCSR(pd->dma_channel) = 0;
DALGN &= ~(1 << pd->dma_dreq);
for_each_sg(qc->sg, sg, qc->n_elem, si)
pxa_load_dmac(sg, qc);
pd->dma_desc[pd->dma_desc_id - 1].ddadr = DDADR_STOP;
/* Fire IRQ only at the end of last block */
pd->dma_desc[pd->dma_desc_id - 1].dcmd |= DCMD_ENDIRQEN;
DDADR(pd->dma_channel) = pd->dma_desc_addr;
DRCMR(pd->dma_dreq) = DRCMR_MAPVLD | pd->dma_channel;
}
/*
* Configure the DMA controller, load the DMA descriptors, but don't start the
* DMA controller yet. Only issue the ATA command.
*/
static void pxa_bmdma_setup(struct ata_queued_cmd *qc)
{
qc->ap->ops->sff_exec_command(qc->ap, &qc->tf);
}
/*
* Execute the DMA transfer.
*/
static void pxa_bmdma_start(struct ata_queued_cmd *qc)
{
struct pata_pxa_data *pd = qc->ap->private_data;
init_completion(&pd->dma_done);
DCSR(pd->dma_channel) = DCSR_RUN;
}
/*
* Wait until the DMA transfer completes, then stop the DMA controller.
*/
static void pxa_bmdma_stop(struct ata_queued_cmd *qc)
{
struct pata_pxa_data *pd = qc->ap->private_data;
if ((DCSR(pd->dma_channel) & DCSR_RUN) &&
wait_for_completion_timeout(&pd->dma_done, HZ))
dev_err(qc->ap->dev, "Timeout waiting for DMA completion!");
DCSR(pd->dma_channel) = 0;
}
/*
* Read DMA status. The bmdma_stop() will take care of properly finishing the
* DMA transfer so we always have DMA-complete interrupt here.
*/
static unsigned char pxa_bmdma_status(struct ata_port *ap)
{
struct pata_pxa_data *pd = ap->private_data;
unsigned char ret = ATA_DMA_INTR;
if (pd->dma_dcsr & DCSR_BUSERR)
ret |= ATA_DMA_ERR;
return ret;
}
/*
* No IRQ register present so we do nothing.
*/
static void pxa_irq_clear(struct ata_port *ap)
{
}
/*
* Check for ATAPI DMA. ATAPI DMA is unsupported by this driver. It's still
* unclear why ATAPI has DMA issues.
*/
static int pxa_check_atapi_dma(struct ata_queued_cmd *qc)
{
return -EOPNOTSUPP;
}
static struct scsi_host_template pxa_ata_sht = {
ATA_BMDMA_SHT(DRV_NAME),
};
static struct ata_port_operations pxa_ata_port_ops = {
.inherits = &ata_bmdma_port_ops,
.cable_detect = ata_cable_40wire,
.bmdma_setup = pxa_bmdma_setup,
.bmdma_start = pxa_bmdma_start,
.bmdma_stop = pxa_bmdma_stop,
.bmdma_status = pxa_bmdma_status,
.check_atapi_dma = pxa_check_atapi_dma,
.sff_irq_clear = pxa_irq_clear,
.qc_prep = pxa_qc_prep,
};
/*
* DMA interrupt handler.
*/
static void pxa_ata_dma_irq(int dma, void *port)
{
struct ata_port *ap = port;
struct pata_pxa_data *pd = ap->private_data;
pd->dma_dcsr = DCSR(dma);
DCSR(dma) = pd->dma_dcsr;
if (pd->dma_dcsr & DCSR_STOPSTATE)
complete(&pd->dma_done);
}
static int __devinit pxa_ata_probe(struct platform_device *pdev)
{
struct ata_host *host;
struct ata_port *ap;
struct pata_pxa_data *data;
struct resource *cmd_res;
struct resource *ctl_res;
struct resource *dma_res;
struct resource *irq_res;
struct pata_pxa_pdata *pdata = pdev->dev.platform_data;
int ret = 0;
/*
* Resource validation, three resources are needed:
* - CMD port base address
* - CTL port base address
* - DMA port base address
* - IRQ pin
*/
if (pdev->num_resources != 4) {
dev_err(&pdev->dev, "invalid number of resources\n");
return -EINVAL;
}
/*
* CMD port base address
*/
cmd_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (unlikely(cmd_res == NULL))
return -EINVAL;
/*
* CTL port base address
*/
ctl_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (unlikely(ctl_res == NULL))
return -EINVAL;
/*
* DMA port base address
*/
dma_res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
if (unlikely(dma_res == NULL))
return -EINVAL;
/*
* IRQ pin
*/
irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (unlikely(irq_res == NULL))
return -EINVAL;
/*
* Allocate the host
*/
host = ata_host_alloc(&pdev->dev, 1);
if (!host)
return -ENOMEM;
ap = host->ports[0];
ap->ops = &pxa_ata_port_ops;
ap->pio_mask = ATA_PIO4;
ap->mwdma_mask = ATA_MWDMA2;
ap->ioaddr.cmd_addr = devm_ioremap(&pdev->dev, cmd_res->start,
resource_size(cmd_res));
ap->ioaddr.ctl_addr = devm_ioremap(&pdev->dev, ctl_res->start,
resource_size(ctl_res));
ap->ioaddr.bmdma_addr = devm_ioremap(&pdev->dev, dma_res->start,
resource_size(dma_res));
/*
* Adjust register offsets
*/
ap->ioaddr.altstatus_addr = ap->ioaddr.ctl_addr;
ap->ioaddr.data_addr = ap->ioaddr.cmd_addr +
(ATA_REG_DATA << pdata->reg_shift);
ap->ioaddr.error_addr = ap->ioaddr.cmd_addr +
(ATA_REG_ERR << pdata->reg_shift);
ap->ioaddr.feature_addr = ap->ioaddr.cmd_addr +
(ATA_REG_FEATURE << pdata->reg_shift);
ap->ioaddr.nsect_addr = ap->ioaddr.cmd_addr +
(ATA_REG_NSECT << pdata->reg_shift);
ap->ioaddr.lbal_addr = ap->ioaddr.cmd_addr +
(ATA_REG_LBAL << pdata->reg_shift);
ap->ioaddr.lbam_addr = ap->ioaddr.cmd_addr +
(ATA_REG_LBAM << pdata->reg_shift);
ap->ioaddr.lbah_addr = ap->ioaddr.cmd_addr +
(ATA_REG_LBAH << pdata->reg_shift);
ap->ioaddr.device_addr = ap->ioaddr.cmd_addr +
(ATA_REG_DEVICE << pdata->reg_shift);
ap->ioaddr.status_addr = ap->ioaddr.cmd_addr +
(ATA_REG_STATUS << pdata->reg_shift);
ap->ioaddr.command_addr = ap->ioaddr.cmd_addr +
(ATA_REG_CMD << pdata->reg_shift);
/*
* Allocate and load driver's internal data structure
*/
data = devm_kzalloc(&pdev->dev, sizeof(struct pata_pxa_data),
GFP_KERNEL);
if (!data)
return -ENOMEM;
ap->private_data = data;
data->dma_dreq = pdata->dma_dreq;
data->dma_io_addr = dma_res->start;
/*
* Allocate space for the DMA descriptors
*/
data->dma_desc = dmam_alloc_coherent(&pdev->dev, PAGE_SIZE,
&data->dma_desc_addr, GFP_KERNEL);
if (!data->dma_desc)
return -EINVAL;
/*
* Request the DMA channel
*/
data->dma_channel = pxa_request_dma(DRV_NAME, DMA_PRIO_LOW,
pxa_ata_dma_irq, ap);
if (data->dma_channel < 0)
return -EBUSY;
/*
* Stop and clear the DMA channel
*/
DCSR(data->dma_channel) = 0;
/*
* Activate the ATA host
*/
ret = ata_host_activate(host, irq_res->start, ata_sff_interrupt,
pdata->irq_flags, &pxa_ata_sht);
if (ret)
pxa_free_dma(data->dma_channel);
return ret;
}
static int __devexit pxa_ata_remove(struct platform_device *pdev)
{
struct ata_host *host = dev_get_drvdata(&pdev->dev);
struct pata_pxa_data *data = host->ports[0]->private_data;
pxa_free_dma(data->dma_channel);
ata_host_detach(host);
return 0;
}
static struct platform_driver pxa_ata_driver = {
.probe = pxa_ata_probe,
.remove = __devexit_p(pxa_ata_remove),
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
},
};
module_platform_driver(pxa_ata_driver);
MODULE_AUTHOR("Marek Vasut <[email protected]>");
MODULE_DESCRIPTION("DMA-capable driver for PATA on PXA CPU");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION);
MODULE_ALIAS("platform:" DRV_NAME);
| {
"pile_set_name": "Github"
} |
{
"type": "object",
"": "http://json-schema.org/draft-03/schema",
"properties": {
"meta": {
"type": "object",
"properties": {
"code": {
"type": "integer"
}
}
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"created_time": {
"type": "string"
},
"text": {
"type": "string"
},
"from": {
"type": "object",
"properties": {
"username": {
"type": "string"
},
"profile_picture": {
"type": "string"
},
"id": {
"type": "string"
},
"full_name": {
"type": "string"
}
}
},
"id": {
"type": "string"
}
}
}
}
}
} | {
"pile_set_name": "Github"
} |
# MCU name
MCU = atmega32u4
# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# ATmega32A bootloadHID
# ATmega328P USBasp
BOOTLOADER = atmel-dfu
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug
COMMAND_ENABLE = yes # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
ENCODER_ENABLE = yes
LAYOUTS = ortho_4x12
LAYOUTS_HAS_RGB = no | {
"pile_set_name": "Github"
} |
import { Range } from 'immutable'
import React from 'react'
import {
BLOCK_SIZE as B,
FIELD_BLOCK_SIZE as FBZ,
SCREEN_HEIGHT,
SCREEN_WIDTH,
} from '../utils/constants'
export default class Grid extends React.PureComponent<{ t?: number }> {
render() {
const { t = -1 } = this.props
const hrow = Math.floor(t / FBZ)
const hcol = t % FBZ
return (
<g className="dash-lines" stroke="steelblue" strokeWidth="0.5" strokeDasharray="2 2">
{Range(1, FBZ + 1)
.map(col => (
<line
key={col}
x1={B * col}
y1={0}
x2={B * col}
y2={SCREEN_HEIGHT}
strokeOpacity={hcol === col || hcol === col - 1 ? 1 : 0.3}
/>
))
.toArray()}
{Range(1, FBZ + 1)
.map(row => (
<line
key={row}
x1={0}
y1={B * row}
x2={SCREEN_WIDTH}
y2={B * row}
strokeOpacity={hrow === row || hrow === row - 1 ? 1 : 0.3}
/>
))
.toArray()}
</g>
)
}
}
| {
"pile_set_name": "Github"
} |
@import "../bower/ionic/scss/mixins";
@mixin maskBoxImage($value) {
-webkit-mask-box-image: url(#{$value});
mask-box-image: url(#{$value});
}
.jr-crop {
background-color: #000;
overflow: hidden;
}
.jr-crop-center-container {
@include display-flex();
@include justify-content(center);
@include align-items(center);
position: absolute;
width: 100%;
height: 100%;
}
.jr-crop-img {
opacity: 0.6;
}
.bar.jr-crop-footer {
border: none;
background-color: transparent;
background-image: none;
}
.jr-crop-select.jr-crop-select-circle {
@include maskBoxImage("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTAwcHgiIGhlaWdodD0iMTAwcHgiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxMDAgMTAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjUwIi8+DQo8L3N2Zz4=");
} | {
"pile_set_name": "Github"
} |
/*
* OpenClinica is distributed under the
* GNU Lesser General Public License (GNU LGPL).
* For details see: http://www.openclinica.org/license
* copyright 2003-2005 Akaza Research
*/
package core.org.akaza.openclinica.web.bean;
import core.org.akaza.openclinica.bean.managestudy.StudyGroupClassBean;
import java.util.ArrayList;
/**
* @author jxu
*
* TODO To change the template for this generated type comment go to Window -
* Preferences - Java - Code Style - Code Templates
*/
public class StudyGroupClassRow extends EntityBeanRow {
// columns:
public static final int COL_NAME = 0;
public static final int COL_TYPE = 1;
public static final int COL_SUBJECT_ASSIGNMENT = 2;
public static final int COL_STATUS = 3;
/*
* (non-Javadoc)
*
* @see core.org.akaza.openclinica.core.EntityBeanRow#compareColumn(java.lang.Object,
* int)
*/
@Override
protected int compareColumn(Object row, int sortingColumn) {
if (!row.getClass().equals(StudyGroupClassRow.class)) {
return 0;
}
StudyGroupClassBean thisStudy = (StudyGroupClassBean) bean;
StudyGroupClassBean argStudy = (StudyGroupClassBean) ((StudyGroupClassRow) row).bean;
int answer = 0;
switch (sortingColumn) {
case COL_NAME:
answer = thisStudy.getName().toLowerCase().compareTo(argStudy.getName().toLowerCase());
break;
case COL_TYPE:
answer = thisStudy.getGroupClassTypeName().toLowerCase().compareTo(argStudy.getGroupClassTypeName().toLowerCase());
break;
case COL_SUBJECT_ASSIGNMENT:
answer = thisStudy.getSubjectAssignment().toLowerCase().compareTo(argStudy.getSubjectAssignment().toLowerCase());
break;
case COL_STATUS:
answer = thisStudy.getStatus().compareTo(argStudy.getStatus());
break;
}
return answer;
}
@Override
public String getSearchString() {
StudyGroupClassBean thisStudy = (StudyGroupClassBean) bean;
return thisStudy.getName() + " " + thisStudy.getGroupClassTypeName() + " " + thisStudy.getSubjectAssignment();
}
/*
* (non-Javadoc)
*
* @see core.org.akaza.openclinica.core.EntityBeanRow#generatRowsFromBeans(java.util.ArrayList)
*/
@Override
public ArrayList generatRowsFromBeans(ArrayList beans) {
return StudyGroupClassRow.generateRowsFromBeans(beans);
}
public static ArrayList generateRowsFromBeans(ArrayList beans) {
ArrayList answer = new ArrayList();
Class[] parameters = null;
Object[] arguments = null;
for (int i = 0; i < beans.size(); i++) {
try {
StudyGroupClassRow row = new StudyGroupClassRow();
row.setBean((StudyGroupClassBean) beans.get(i));
answer.add(row);
} catch (Exception e) {
}
}
return answer;
}
}
| {
"pile_set_name": "Github"
} |
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
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.
==============================================================================*/
#ifndef TENSORFLOW_CORE_PLATFORM_PROFILE_UTILS_ANDROID_ARMV7A_CPU_UTILS_HELPER_H_
#define TENSORFLOW_CORE_PLATFORM_PROFILE_UTILS_ANDROID_ARMV7A_CPU_UTILS_HELPER_H_
#include <sys/types.h>
#include "tensorflow/core/platform/macros.h"
#include "tensorflow/core/platform/profile_utils/i_cpu_utils_helper.h"
#include "tensorflow/core/platform/types.h"
#if defined(__ANDROID__) && (__ANDROID_API__ >= 21) && \
(defined(__ARM_ARCH_7A__) || defined(__aarch64__))
struct perf_event_attr;
namespace tensorflow {
namespace profile_utils {
// Implementation of CpuUtilsHelper for Android armv7a
class AndroidArmV7ACpuUtilsHelper : public ICpuUtilsHelper {
public:
AndroidArmV7ACpuUtilsHelper() = default;
void ResetClockCycle() final;
uint64 GetCurrentClockCycle() final;
void EnableClockCycleProfiling() final;
void DisableClockCycleProfiling() final;
int64 CalculateCpuFrequency() final;
private:
static constexpr int INVALID_FD = -1;
static constexpr int64 INVALID_CPU_FREQUENCY = -1;
void InitializeInternal();
// syscall __NR_perf_event_open with arguments
int OpenPerfEvent(perf_event_attr *const hw_event, const pid_t pid,
const int cpu, const int group_fd,
const unsigned long flags);
int64 ReadCpuFrequencyFile(const int cpu_id, const char *const type);
bool is_initialized_{false};
int fd_{INVALID_FD};
TF_DISALLOW_COPY_AND_ASSIGN(AndroidArmV7ACpuUtilsHelper);
};
} // namespace profile_utils
} // namespace tensorflow
#endif // defined(__ANDROID__) && (__ANDROID_API__ >= 21) &&
// (defined(__ARM_ARCH_7A__) || defined(__aarch64__))
#endif // TENSORFLOW_CORE_PLATFORM_PROFILE_UTILS_ANDROID_ARMV7A_CPU_UTILS_HELPER_H_
| {
"pile_set_name": "Github"
} |
package sample.killrweather
import spray.json.JsString
import spray.json.JsValue
import spray.json.JsonFormat
/**
* Formats to marshall and unmarshall objects to JSON in the HTTP API, for internode serialization CBOR and Jackson is used
*/
object JsonFormats {
import spray.json.RootJsonFormat
// import the default encoders for primitive types (Int, String, Lists etc)
import spray.json.DefaultJsonProtocol._
import spray.json.deserializationError
/**
* Given a set of possible case objects, create a format that accepts uses their toString representation in json
*/
private final case class SimpleEnumFormat[T](possibleValues: Set[T]) extends JsonFormat[T] {
val stringToValue: Map[String, T] = possibleValues.map(value => value.toString.toLowerCase -> value).toMap
val valueToString: Map[T, String] = stringToValue.map { case (string, value) => value -> string }
override def read(json: JsValue): T = json match {
case JsString(text) =>
stringToValue.get(text.toLowerCase) match {
case Some(t) => t
case None => deserializationError(s"Possible values are ${stringToValue.keySet}, [$text] is not among them")
}
case surprise =>
deserializationError(s"Expected a string value, got $surprise")
}
override def write(obj: T): JsValue =
JsString(valueToString(obj))
}
implicit val functionFormat: JsonFormat[WeatherStation.Function] = SimpleEnumFormat(WeatherStation.Function.All)
implicit val dataTypeFormat: JsonFormat[WeatherStation.DataType] = SimpleEnumFormat(WeatherStation.DataType.All)
implicit val dataFormat: RootJsonFormat[WeatherStation.Data] = jsonFormat3(WeatherStation.Data)
implicit val dataIngestedFormat: RootJsonFormat[WeatherStation.DataRecorded] = jsonFormat1(WeatherStation.DataRecorded)
implicit val queryWindowFormat: RootJsonFormat[WeatherStation.TimeWindow] = jsonFormat3(WeatherStation.TimeWindow)
implicit val queryStatusFormat: RootJsonFormat[WeatherStation.QueryResult] = jsonFormat5(WeatherStation.QueryResult)
}
| {
"pile_set_name": "Github"
} |
/*
*
* Copyright 2019 gRPC 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.
*
*/
package grpc
import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
// PreparedMsg is responsible for creating a Marshalled and Compressed object.
//
// This API is EXPERIMENTAL.
type PreparedMsg struct {
// Struct for preparing msg before sending them
encodedData []byte
hdr []byte
payload []byte
}
// Encode marshalls and compresses the message using the codec and compressor for the stream.
func (p *PreparedMsg) Encode(s Stream, msg interface{}) error {
ctx := s.Context()
rpcInfo, ok := rpcInfoFromContext(ctx)
if !ok {
return status.Errorf(codes.Internal, "grpc: unable to get rpcInfo")
}
// check if the context has the relevant information to prepareMsg
if rpcInfo.preloaderInfo == nil {
return status.Errorf(codes.Internal, "grpc: rpcInfo.preloaderInfo is nil")
}
if rpcInfo.preloaderInfo.codec == nil {
return status.Errorf(codes.Internal, "grpc: rpcInfo.preloaderInfo.codec is nil")
}
// prepare the msg
data, err := encode(rpcInfo.preloaderInfo.codec, msg)
if err != nil {
return err
}
p.encodedData = data
compData, err := compress(data, rpcInfo.preloaderInfo.cp, rpcInfo.preloaderInfo.comp)
if err != nil {
return err
}
p.hdr, p.payload = msgHeader(data, compData)
return nil
}
| {
"pile_set_name": "Github"
} |
// Copyright 2017 Authors of Cilium
//
// 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.
package cmd
import (
"github.com/spf13/cobra"
)
// bpfPolicyCmd represents the bpf_policy command
var bpfPolicyCmd = &cobra.Command{
Use: "policy",
Short: "Manage policy related BPF maps",
}
func init() {
bpfCmd.AddCommand(bpfPolicyCmd)
}
| {
"pile_set_name": "Github"
} |
pbr>=2.0
sphinx>=1.5,<4.0
| {
"pile_set_name": "Github"
} |
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsJVMPluginTagInfo_h___
#define nsJVMPluginTagInfo_h___
#include "nsIJVMPluginTagInfo.h"
#include "nsAgg.h"
/*******************************************************************************
* nsJVMPluginTagInfo: The browser makes one of these when it sees an APPLET or
* appropriate OBJECT tag.
******************************************************************************/
class nsIPluginTagInfo2;
class nsJVMPluginTagInfo : public nsIJVMPluginTagInfo {
public:
NS_DECL_AGGREGATED
/* from nsIJVMPluginTagInfo: */
/* ====> These are usually only called by the plugin, not the browser... */
NS_IMETHOD
GetCode(const char* *result);
NS_IMETHOD
GetCodeBase(const char* *result);
NS_IMETHOD
GetArchive(const char* *result);
NS_IMETHOD
GetName(const char* *result);
NS_IMETHOD
GetMayScript(PRBool *result);
/* Methods specific to nsJVMPluginInstancePeer: */
/* ====> From here on are things only called by the browser, not the plugin... */
static NS_METHOD
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr,
nsIPluginTagInfo2* info);
protected:
nsJVMPluginTagInfo(nsISupports* outer, nsIPluginTagInfo2* info);
virtual ~nsJVMPluginTagInfo(void);
/* Instance Variables: */
nsIPluginTagInfo2* fPluginTagInfo;
char* fSimulatedCodebase;
char* fSimulatedCode;
};
#endif // nsJVMPluginTagInfo_h___
| {
"pile_set_name": "Github"
} |
/*
* This file is part of OpenTTD.
* OpenTTD 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, version 2.
* OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file script_engine.cpp Implementation of ScriptEngine. */
#include "../../stdafx.h"
#include "script_engine.hpp"
#include "script_cargo.hpp"
#include "../../company_base.h"
#include "../../strings_func.h"
#include "../../rail.h"
#include "../../road.h"
#include "../../engine_base.h"
#include "../../engine_func.h"
#include "../../articulated_vehicles.h"
#include "table/strings.h"
#include "../../safeguards.h"
/* static */ bool ScriptEngine::IsValidEngine(EngineID engine_id)
{
const Engine *e = ::Engine::GetIfValid(engine_id);
if (e == nullptr || !e->IsEnabled()) return false;
/* AIs have only access to engines they can purchase or still have in use.
* Deity has access to all engined that will be or were available ever. */
CompanyID company = ScriptObject::GetCompany();
return company == OWNER_DEITY || ::IsEngineBuildable(engine_id, e->type, company) || ::Company::Get(company)->group_all[e->type].num_engines[engine_id] > 0;
}
/* static */ bool ScriptEngine::IsBuildable(EngineID engine_id)
{
const Engine *e = ::Engine::GetIfValid(engine_id);
return e != nullptr && ::IsEngineBuildable(engine_id, e->type, ScriptObject::GetCompany());
}
/* static */ char *ScriptEngine::GetName(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return nullptr;
::SetDParam(0, engine_id);
return GetString(STR_ENGINE_NAME);
}
/* static */ CargoID ScriptEngine::GetCargoType(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return CT_INVALID;
CargoArray cap = ::GetCapacityOfArticulatedParts(engine_id);
CargoID most_cargo = CT_INVALID;
uint amount = 0;
for (CargoID cid = 0; cid < NUM_CARGO; cid++) {
if (cap[cid] > amount) {
amount = cap[cid];
most_cargo = cid;
}
}
return most_cargo;
}
/* static */ bool ScriptEngine::CanRefitCargo(EngineID engine_id, CargoID cargo_id)
{
if (!IsValidEngine(engine_id)) return false;
if (!ScriptCargo::IsValidCargo(cargo_id)) return false;
return HasBit(::GetUnionOfArticulatedRefitMasks(engine_id, true), cargo_id);
}
/* static */ bool ScriptEngine::CanPullCargo(EngineID engine_id, CargoID cargo_id)
{
if (!IsValidEngine(engine_id)) return false;
if (GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL) return false;
if (!ScriptCargo::IsValidCargo(cargo_id)) return false;
return (::RailVehInfo(engine_id)->ai_passenger_only != 1) || ScriptCargo::HasCargoClass(cargo_id, ScriptCargo::CC_PASSENGERS);
}
/* static */ int32 ScriptEngine::GetCapacity(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return -1;
const Engine *e = ::Engine::Get(engine_id);
switch (e->type) {
case VEH_ROAD:
case VEH_TRAIN: {
CargoArray capacities = GetCapacityOfArticulatedParts(engine_id);
for (CargoID c = 0; c < NUM_CARGO; c++) {
if (capacities[c] == 0) continue;
return capacities[c];
}
return -1;
}
case VEH_SHIP:
case VEH_AIRCRAFT:
return e->GetDisplayDefaultCapacity();
default: NOT_REACHED();
}
}
/* static */ int32 ScriptEngine::GetReliability(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return -1;
if (GetVehicleType(engine_id) == ScriptVehicle::VT_RAIL && IsWagon(engine_id)) return -1;
return ::ToPercent16(::Engine::Get(engine_id)->reliability);
}
/* static */ int32 ScriptEngine::GetMaxSpeed(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return -1;
const Engine *e = ::Engine::Get(engine_id);
int32 max_speed = e->GetDisplayMaxSpeed(); // km-ish/h
if (e->type == VEH_AIRCRAFT) max_speed /= _settings_game.vehicle.plane_speed;
return max_speed;
}
/* static */ Money ScriptEngine::GetPrice(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return -1;
return ::Engine::Get(engine_id)->GetCost();
}
/* static */ int32 ScriptEngine::GetMaxAge(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return -1;
if (GetVehicleType(engine_id) == ScriptVehicle::VT_RAIL && IsWagon(engine_id)) return -1;
return ::Engine::Get(engine_id)->GetLifeLengthInDays();
}
/* static */ Money ScriptEngine::GetRunningCost(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return -1;
return ::Engine::Get(engine_id)->GetRunningCost();
}
/* static */ int32 ScriptEngine::GetPower(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return -1;
if (GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL && GetVehicleType(engine_id) != ScriptVehicle::VT_ROAD) return -1;
if (IsWagon(engine_id)) return -1;
return ::Engine::Get(engine_id)->GetPower();
}
/* static */ int32 ScriptEngine::GetWeight(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return -1;
if (GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL && GetVehicleType(engine_id) != ScriptVehicle::VT_ROAD) return -1;
return ::Engine::Get(engine_id)->GetDisplayWeight();
}
/* static */ int32 ScriptEngine::GetMaxTractiveEffort(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return -1;
if (GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL && GetVehicleType(engine_id) != ScriptVehicle::VT_ROAD) return -1;
if (IsWagon(engine_id)) return -1;
return ::Engine::Get(engine_id)->GetDisplayMaxTractiveEffort();
}
/* static */ ScriptDate::Date ScriptEngine::GetDesignDate(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return ScriptDate::DATE_INVALID;
return (ScriptDate::Date)::Engine::Get(engine_id)->intro_date;
}
/* static */ ScriptVehicle::VehicleType ScriptEngine::GetVehicleType(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return ScriptVehicle::VT_INVALID;
switch (::Engine::Get(engine_id)->type) {
case VEH_ROAD: return ScriptVehicle::VT_ROAD;
case VEH_TRAIN: return ScriptVehicle::VT_RAIL;
case VEH_SHIP: return ScriptVehicle::VT_WATER;
case VEH_AIRCRAFT: return ScriptVehicle::VT_AIR;
default: NOT_REACHED();
}
}
/* static */ bool ScriptEngine::IsWagon(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return false;
if (GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL) return false;
return ::RailVehInfo(engine_id)->power == 0;
}
/* static */ bool ScriptEngine::CanRunOnRail(EngineID engine_id, ScriptRail::RailType track_rail_type)
{
if (!IsValidEngine(engine_id)) return false;
if (GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL) return false;
if (!ScriptRail::IsRailTypeAvailable(track_rail_type)) return false;
return ::IsCompatibleRail((::RailType)::RailVehInfo(engine_id)->railtype, (::RailType)track_rail_type);
}
/* static */ bool ScriptEngine::HasPowerOnRail(EngineID engine_id, ScriptRail::RailType track_rail_type)
{
if (!IsValidEngine(engine_id)) return false;
if (GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL) return false;
if (!ScriptRail::IsRailTypeAvailable(track_rail_type)) return false;
return ::HasPowerOnRail((::RailType)::RailVehInfo(engine_id)->railtype, (::RailType)track_rail_type);
}
/* static */ bool ScriptEngine::CanRunOnRoad(EngineID engine_id, ScriptRoad::RoadType road_type)
{
return HasPowerOnRoad(engine_id, road_type);
}
/* static */ bool ScriptEngine::HasPowerOnRoad(EngineID engine_id, ScriptRoad::RoadType road_type)
{
if (!IsValidEngine(engine_id)) return false;
if (GetVehicleType(engine_id) != ScriptVehicle::VT_ROAD) return false;
if (!ScriptRoad::IsRoadTypeAvailable(road_type)) return false;
return ::HasPowerOnRoad((::RoadType)::RoadVehInfo(engine_id)->roadtype, (::RoadType)road_type);
}
/* static */ ScriptRoad::RoadType ScriptEngine::GetRoadType(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return ScriptRoad::ROADTYPE_INVALID;
if (GetVehicleType(engine_id) != ScriptVehicle::VT_ROAD) return ScriptRoad::ROADTYPE_INVALID;
return (ScriptRoad::RoadType)(uint)::RoadVehInfo(engine_id)->roadtype;
}
/* static */ ScriptRail::RailType ScriptEngine::GetRailType(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return ScriptRail::RAILTYPE_INVALID;
if (GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL) return ScriptRail::RAILTYPE_INVALID;
return (ScriptRail::RailType)(uint)::RailVehInfo(engine_id)->railtype;
}
/* static */ bool ScriptEngine::IsArticulated(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return false;
if (GetVehicleType(engine_id) != ScriptVehicle::VT_ROAD && GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL) return false;
return IsArticulatedEngine(engine_id);
}
/* static */ ScriptAirport::PlaneType ScriptEngine::GetPlaneType(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return ScriptAirport::PT_INVALID;
if (GetVehicleType(engine_id) != ScriptVehicle::VT_AIR) return ScriptAirport::PT_INVALID;
return (ScriptAirport::PlaneType)::AircraftVehInfo(engine_id)->subtype;
}
/* static */ uint ScriptEngine::GetMaximumOrderDistance(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return 0;
switch (GetVehicleType(engine_id)) {
case ScriptVehicle::VT_AIR:
return ::Engine::Get(engine_id)->GetRange() * ::Engine::Get(engine_id)->GetRange();
default:
return 0;
}
}
/* static */ bool ScriptEngine::EnableForCompany(EngineID engine_id, ScriptCompany::CompanyID company)
{
company = ScriptCompany::ResolveCompanyID(company);
EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY);
EnforcePrecondition(false, IsValidEngine(engine_id));
EnforcePrecondition(false, company != ScriptCompany::COMPANY_INVALID);
return ScriptObject::DoCommand(0, engine_id, (uint32)company | (1 << 31), CMD_ENGINE_CTRL);
}
/* static */ bool ScriptEngine::DisableForCompany(EngineID engine_id, ScriptCompany::CompanyID company)
{
company = ScriptCompany::ResolveCompanyID(company);
EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY);
EnforcePrecondition(false, IsValidEngine(engine_id));
EnforcePrecondition(false, company != ScriptCompany::COMPANY_INVALID);
return ScriptObject::DoCommand(0, engine_id, company, CMD_ENGINE_CTRL);
}
| {
"pile_set_name": "Github"
} |
/*
* Summary: internals routines and limits exported by the parser.
* Description: this module exports a number of internal parsing routines
* they are not really all intended for applications but
* can prove useful doing low level processing.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_PARSER_INTERNALS_H__
#define __XML_PARSER_INTERNALS_H__
#include <libxml/xmlversion.h>
#include <libxml/parser.h>
#include <libxml/HTMLparser.h>
#include <libxml/chvalid.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* xmlParserMaxDepth:
*
* arbitrary depth limit for the XML documents that we allow to
* process. This is not a limitation of the parser but a safety
* boundary feature, use XML_PARSE_HUGE option to override it.
*/
XMLPUBVAR unsigned int xmlParserMaxDepth;
/**
* XML_MAX_TEXT_LENGTH:
*
* Maximum size allowed for a single text node when building a tree.
* This is not a limitation of the parser but a safety boundary feature,
* use XML_PARSE_HUGE option to override it.
* Introduced in 2.9.0
*/
#define XML_MAX_TEXT_LENGTH 10000000
/**
* XML_MAX_NAME_LENGTH:
*
* Maximum size allowed for a markup identitier
* This is not a limitation of the parser but a safety boundary feature,
* use XML_PARSE_HUGE option to override it.
* Note that with the use of parsing dictionaries overriding the limit
* may result in more runtime memory usage in face of "unfriendly' content
* Introduced in 2.9.0
*/
#define XML_MAX_NAME_LENGTH 50000
/**
* XML_MAX_DICTIONARY_LIMIT:
*
* Maximum size allowed by the parser for a dictionary by default
* This is not a limitation of the parser but a safety boundary feature,
* use XML_PARSE_HUGE option to override it.
* Introduced in 2.9.0
*/
#define XML_MAX_DICTIONARY_LIMIT 10000000
/**
* XML_MAX_LOOKUP_LIMIT:
*
* Maximum size allowed by the parser for ahead lookup
* This is an upper boundary enforced by the parser to avoid bad
* behaviour on "unfriendly' content
* Introduced in 2.9.0
*/
#define XML_MAX_LOOKUP_LIMIT 10000000
/**
* XML_MAX_NAMELEN:
*
* Identifiers can be longer, but this will be more costly
* at runtime.
*/
#define XML_MAX_NAMELEN 100
/**
* INPUT_CHUNK:
*
* The parser tries to always have that amount of input ready.
* One of the point is providing context when reporting errors.
*/
#define INPUT_CHUNK 250
/************************************************************************
* *
* UNICODE version of the macros. *
* *
************************************************************************/
/**
* IS_BYTE_CHAR:
* @c: an byte value (int)
*
* Macro to check the following production in the XML spec:
*
* [2] Char ::= #x9 | #xA | #xD | [#x20...]
* any byte character in the accepted range
*/
#define IS_BYTE_CHAR(c) xmlIsChar_ch(c)
/**
* IS_CHAR:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
* | [#x10000-#x10FFFF]
* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
*/
#define IS_CHAR(c) xmlIsCharQ(c)
/**
* IS_CHAR_CH:
* @c: an xmlChar (usually an unsigned char)
*
* Behaves like IS_CHAR on single-byte value
*/
#define IS_CHAR_CH(c) xmlIsChar_ch(c)
/**
* IS_BLANK:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [3] S ::= (#x20 | #x9 | #xD | #xA)+
*/
#define IS_BLANK(c) xmlIsBlankQ(c)
/**
* IS_BLANK_CH:
* @c: an xmlChar value (normally unsigned char)
*
* Behaviour same as IS_BLANK
*/
#define IS_BLANK_CH(c) xmlIsBlank_ch(c)
/**
* IS_BASECHAR:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [85] BaseChar ::= ... long list see REC ...
*/
#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
/**
* IS_DIGIT:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [88] Digit ::= ... long list see REC ...
*/
#define IS_DIGIT(c) xmlIsDigitQ(c)
/**
* IS_DIGIT_CH:
* @c: an xmlChar value (usually an unsigned char)
*
* Behaves like IS_DIGIT but with a single byte argument
*/
#define IS_DIGIT_CH(c) xmlIsDigit_ch(c)
/**
* IS_COMBINING:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
* [87] CombiningChar ::= ... long list see REC ...
*/
#define IS_COMBINING(c) xmlIsCombiningQ(c)
/**
* IS_COMBINING_CH:
* @c: an xmlChar (usually an unsigned char)
*
* Always false (all combining chars > 0xff)
*/
#define IS_COMBINING_CH(c) 0
/**
* IS_EXTENDER:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
*
* [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 |
* #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] |
* [#x309D-#x309E] | [#x30FC-#x30FE]
*/
#define IS_EXTENDER(c) xmlIsExtenderQ(c)
/**
* IS_EXTENDER_CH:
* @c: an xmlChar value (usually an unsigned char)
*
* Behaves like IS_EXTENDER but with a single-byte argument
*/
#define IS_EXTENDER_CH(c) xmlIsExtender_ch(c)
/**
* IS_IDEOGRAPHIC:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
*
* [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
*/
#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
/**
* IS_LETTER:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
*
* [84] Letter ::= BaseChar | Ideographic
*/
#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
/**
* IS_LETTER_CH:
* @c: an xmlChar value (normally unsigned char)
*
* Macro behaves like IS_LETTER, but only check base chars
*
*/
#define IS_LETTER_CH(c) xmlIsBaseChar_ch(c)
/**
* IS_ASCII_LETTER:
* @c: an xmlChar value
*
* Macro to check [a-zA-Z]
*
*/
#define IS_ASCII_LETTER(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
((0x61 <= (c)) && ((c) <= 0x7a)))
/**
* IS_ASCII_DIGIT:
* @c: an xmlChar value
*
* Macro to check [0-9]
*
*/
#define IS_ASCII_DIGIT(c) ((0x30 <= (c)) && ((c) <= 0x39))
/**
* IS_PUBIDCHAR:
* @c: an UNICODE value (int)
*
* Macro to check the following production in the XML spec:
*
*
* [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
*/
#define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c)
/**
* IS_PUBIDCHAR_CH:
* @c: an xmlChar value (normally unsigned char)
*
* Same as IS_PUBIDCHAR but for single-byte value
*/
#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
/**
* SKIP_EOL:
* @p: and UTF8 string pointer
*
* Skips the end of line chars.
*/
#define SKIP_EOL(p) \
if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \
if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; }
/**
* MOVETO_ENDTAG:
* @p: and UTF8 string pointer
*
* Skips to the next '>' char.
*/
#define MOVETO_ENDTAG(p) \
while ((*p) && (*(p) != '>')) (p)++
/**
* MOVETO_STARTTAG:
* @p: and UTF8 string pointer
*
* Skips to the next '<' char.
*/
#define MOVETO_STARTTAG(p) \
while ((*p) && (*(p) != '<')) (p)++
/**
* Global variables used for predefined strings.
*/
XMLPUBVAR const xmlChar xmlStringText[];
XMLPUBVAR const xmlChar xmlStringTextNoenc[];
XMLPUBVAR const xmlChar xmlStringComment[];
/*
* Function to finish the work of the macros where needed.
*/
XMLPUBFUN int XMLCALL xmlIsLetter (int c);
/**
* Parser context.
*/
XMLPUBFUN xmlParserCtxtPtr XMLCALL
xmlCreateFileParserCtxt (const char *filename);
XMLPUBFUN xmlParserCtxtPtr XMLCALL
xmlCreateURLParserCtxt (const char *filename,
int options);
XMLPUBFUN xmlParserCtxtPtr XMLCALL
xmlCreateMemoryParserCtxt(const char *buffer,
int size);
XMLPUBFUN xmlParserCtxtPtr XMLCALL
xmlCreateEntityParserCtxt(const xmlChar *URL,
const xmlChar *ID,
const xmlChar *base);
XMLPUBFUN int XMLCALL
xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
xmlCharEncoding enc);
XMLPUBFUN int XMLCALL
xmlSwitchToEncoding (xmlParserCtxtPtr ctxt,
xmlCharEncodingHandlerPtr handler);
XMLPUBFUN int XMLCALL
xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt,
xmlParserInputPtr input,
xmlCharEncodingHandlerPtr handler);
#ifdef IN_LIBXML
/* internal error reporting */
XMLPUBFUN void XMLCALL
__xmlErrEncoding (xmlParserCtxtPtr ctxt,
xmlParserErrors xmlerr,
const char *msg,
const xmlChar * str1,
const xmlChar * str2);
#endif
/**
* Input Streams.
*/
XMLPUBFUN xmlParserInputPtr XMLCALL
xmlNewStringInputStream (xmlParserCtxtPtr ctxt,
const xmlChar *buffer);
XMLPUBFUN xmlParserInputPtr XMLCALL
xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
xmlEntityPtr entity);
XMLPUBFUN int XMLCALL
xmlPushInput (xmlParserCtxtPtr ctxt,
xmlParserInputPtr input);
XMLPUBFUN xmlChar XMLCALL
xmlPopInput (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlFreeInputStream (xmlParserInputPtr input);
XMLPUBFUN xmlParserInputPtr XMLCALL
xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
const char *filename);
XMLPUBFUN xmlParserInputPtr XMLCALL
xmlNewInputStream (xmlParserCtxtPtr ctxt);
/**
* Namespaces.
*/
XMLPUBFUN xmlChar * XMLCALL
xmlSplitQName (xmlParserCtxtPtr ctxt,
const xmlChar *name,
xmlChar **prefix);
/**
* Generic production rules.
*/
XMLPUBFUN const xmlChar * XMLCALL
xmlParseName (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
xmlParseNmtoken (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
xmlParseEntityValue (xmlParserCtxtPtr ctxt,
xmlChar **orig);
XMLPUBFUN xmlChar * XMLCALL
xmlParseAttValue (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseCharData (xmlParserCtxtPtr ctxt,
int cdata);
XMLPUBFUN xmlChar * XMLCALL
xmlParseExternalID (xmlParserCtxtPtr ctxt,
xmlChar **publicID,
int strict);
XMLPUBFUN void XMLCALL
xmlParseComment (xmlParserCtxtPtr ctxt);
XMLPUBFUN const xmlChar * XMLCALL
xmlParsePITarget (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParsePI (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
xmlChar **value);
XMLPUBFUN xmlEnumerationPtr XMLCALL
xmlParseNotationType (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlEnumerationPtr XMLCALL
xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
xmlEnumerationPtr *tree);
XMLPUBFUN int XMLCALL
xmlParseAttributeType (xmlParserCtxtPtr ctxt,
xmlEnumerationPtr *tree);
XMLPUBFUN void XMLCALL
xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlElementContentPtr XMLCALL
xmlParseElementMixedContentDecl
(xmlParserCtxtPtr ctxt,
int inputchk);
XMLPUBFUN xmlElementContentPtr XMLCALL
xmlParseElementChildrenContentDecl
(xmlParserCtxtPtr ctxt,
int inputchk);
XMLPUBFUN int XMLCALL
xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
const xmlChar *name,
xmlElementContentPtr *result);
XMLPUBFUN int XMLCALL
xmlParseElementDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
xmlParseCharRef (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlEntityPtr XMLCALL
xmlParseEntityRef (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseReference (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParsePEReference (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
#ifdef LIBXML_SAX1_ENABLED
XMLPUBFUN const xmlChar * XMLCALL
xmlParseAttribute (xmlParserCtxtPtr ctxt,
xmlChar **value);
XMLPUBFUN const xmlChar * XMLCALL
xmlParseStartTag (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseEndTag (xmlParserCtxtPtr ctxt);
#endif /* LIBXML_SAX1_ENABLED */
XMLPUBFUN void XMLCALL
xmlParseCDSect (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseContent (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseElement (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
xmlParseVersionNum (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
xmlParseEncName (xmlParserCtxtPtr ctxt);
XMLPUBFUN const xmlChar * XMLCALL
xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
xmlParseSDDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseTextDecl (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseMisc (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
const xmlChar *ExternalID,
const xmlChar *SystemID);
/**
* XML_SUBSTITUTE_NONE:
*
* If no entities need to be substituted.
*/
#define XML_SUBSTITUTE_NONE 0
/**
* XML_SUBSTITUTE_REF:
*
* Whether general entities need to be substituted.
*/
#define XML_SUBSTITUTE_REF 1
/**
* XML_SUBSTITUTE_PEREF:
*
* Whether parameter entities need to be substituted.
*/
#define XML_SUBSTITUTE_PEREF 2
/**
* XML_SUBSTITUTE_BOTH:
*
* Both general and parameter entities need to be substituted.
*/
#define XML_SUBSTITUTE_BOTH 3
XMLPUBFUN xmlChar * XMLCALL
xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,
const xmlChar *str,
int what,
xmlChar end,
xmlChar end2,
xmlChar end3);
XMLPUBFUN xmlChar * XMLCALL
xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt,
const xmlChar *str,
int len,
int what,
xmlChar end,
xmlChar end2,
xmlChar end3);
/*
* Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
*/
XMLPUBFUN int XMLCALL nodePush (xmlParserCtxtPtr ctxt,
xmlNodePtr value);
XMLPUBFUN xmlNodePtr XMLCALL nodePop (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL inputPush (xmlParserCtxtPtr ctxt,
xmlParserInputPtr value);
XMLPUBFUN xmlParserInputPtr XMLCALL inputPop (xmlParserCtxtPtr ctxt);
XMLPUBFUN const xmlChar * XMLCALL namePop (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL namePush (xmlParserCtxtPtr ctxt,
const xmlChar *value);
/*
* other commodities shared between parser.c and parserInternals.
*/
XMLPUBFUN int XMLCALL xmlSkipBlankChars (xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL xmlStringCurrentChar (xmlParserCtxtPtr ctxt,
const xmlChar *cur,
int *len);
XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang);
/*
* Really core function shared with HTML parser.
*/
XMLPUBFUN int XMLCALL xmlCurrentChar (xmlParserCtxtPtr ctxt,
int *len);
XMLPUBFUN int XMLCALL xmlCopyCharMultiByte (xmlChar *out,
int val);
XMLPUBFUN int XMLCALL xmlCopyChar (int len,
xmlChar *out,
int val);
XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in);
#ifdef LIBXML_HTML_ENABLED
/*
* Actually comes from the HTML parser but launched from the init stuff.
*/
XMLPUBFUN void XMLCALL htmlInitAutoClose (void);
XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename,
const char *encoding);
#endif
/*
* Specific function to keep track of entities references
* and used by the XSLT debugger.
*/
#ifdef LIBXML_LEGACY_ENABLED
/**
* xmlEntityReferenceFunc:
* @ent: the entity
* @firstNode: the fist node in the chunk
* @lastNode: the last nod in the chunk
*
* Callback function used when one needs to be able to track back the
* provenance of a chunk of nodes inherited from an entity replacement.
*/
typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent,
xmlNodePtr firstNode,
xmlNodePtr lastNode);
XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func);
XMLPUBFUN xmlChar * XMLCALL
xmlParseQuotedString (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlParseNamespace (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
xmlScanName (xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt);
XMLPUBFUN xmlChar * XMLCALL
xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
xmlChar **prefix);
/**
* Entities
*/
XMLPUBFUN xmlChar * XMLCALL
xmlDecodeEntities (xmlParserCtxtPtr ctxt,
int len,
int what,
xmlChar end,
xmlChar end2,
xmlChar end3);
XMLPUBFUN void XMLCALL
xmlHandleEntity (xmlParserCtxtPtr ctxt,
xmlEntityPtr entity);
#endif /* LIBXML_LEGACY_ENABLED */
#ifdef IN_LIBXML
/*
* internal only
*/
XMLPUBFUN void XMLCALL
xmlErrMemory (xmlParserCtxtPtr ctxt,
const char *extra);
#endif
#ifdef __cplusplus
}
#endif
#endif /* __XML_PARSER_INTERNALS_H__ */
| {
"pile_set_name": "Github"
} |
<Canvas>
<Kind>42</Kind>
<Name>Post Effects</Name>
<IsMinified>1</IsMinified>
<XPosition>1.000000000</XPosition>
<YPosition>310.000000000</YPosition>
</Canvas>
<Widget>
<Kind>2</Kind>
<Name>Enable</Name>
<Value>0</Value>
</Widget>
<Widget>
<Kind>4</Kind>
<Name>Chroma_Distortion</Name>
<Value>0.000000000</Value>
</Widget>
<Widget>
<Kind>4</Kind>
<Name>Grain_Distortion</Name>
<Value>0.000000000</Value>
</Widget>
<Widget>
<Kind>2</Kind>
<Name>Do Bloom</Name>
<Value>1</Value>
</Widget>
<Widget>
<Kind>4</Kind>
<Name>Bloom Level</Name>
<Value>0.472906411</Value>
</Widget>
<Widget>
<Kind>44</Kind>
<Name>Bloom Size</Name>
<Value>4</Value>
</Widget>
| {
"pile_set_name": "Github"
} |
-Dcassandra.config.loader=com.instaclustr.cassandra.k8s.ConcatenatedYamlConfigurationLoader
-Dcassandra.libjemalloc=/usr/lib64/libjemalloc.so.1 | {
"pile_set_name": "Github"
} |
<?php
/*
* Copyright 2014 Google Inc.
*
* 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.
*/
class Google_Service_ShoppingContent_MonetaryAmount extends Google_Model
{
protected $priceAmountType = 'Google_Service_ShoppingContent_Price';
protected $priceAmountDataType = '';
protected $taxAmountType = 'Google_Service_ShoppingContent_Price';
protected $taxAmountDataType = '';
/**
* @param Google_Service_ShoppingContent_Price
*/
public function setPriceAmount(Google_Service_ShoppingContent_Price $priceAmount)
{
$this->priceAmount = $priceAmount;
}
/**
* @return Google_Service_ShoppingContent_Price
*/
public function getPriceAmount()
{
return $this->priceAmount;
}
/**
* @param Google_Service_ShoppingContent_Price
*/
public function setTaxAmount(Google_Service_ShoppingContent_Price $taxAmount)
{
$this->taxAmount = $taxAmount;
}
/**
* @return Google_Service_ShoppingContent_Price
*/
public function getTaxAmount()
{
return $this->taxAmount;
}
}
| {
"pile_set_name": "Github"
} |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
function createRippleHandler(instance, eventName, action, cb) {
return function handleEvent(event) {
if (cb) {
cb.call(instance, event);
}
if (event.defaultPrevented) {
return false;
}
if (instance.ripple) {
instance.ripple[action](event);
}
if (instance.props && typeof instance.props['on' + eventName] === 'function') {
instance.props['on' + eventName](event);
}
return true;
};
}
exports.default = createRippleHandler; | {
"pile_set_name": "Github"
} |
/*
* Copyright 2019 American Express Travel Related Services Company, Inc.
*
* 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.
*/
global.Intl = require('lean-intl');
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# A python script which manages IAM binding patches declaratively IAM policy
# patch can be defined in a separate file declaratively and it can either be
# added or removed from a projects iam policy
#
# Usage
# python iam_patch.py --action=add --project=agwliamtest \
# --iam_bindings_file=iam_bindings.yaml
# python iam_patch.py --action=remove --project=agwliamtest \
# --iam_bindings_file=iam_bindings.yaml
import argparse
import logging
import subprocess
import sys
import tempfile
import time
import yaml
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"--action",
default="add",
type=str,
help=("The action to take. Valid values: add, remove"))
parser.add_argument(
"--project", default=None, type=str, help=("The project."))
parser.add_argument(
"--iam_bindings_file",
default=None,
type=str,
help=("The IAM bindings file."))
parser.set_defaults(dry_run=False)
parser.add_argument(
'--dry_run',
dest='dry_run',
action='store_true',
help=("Don't patch the final IAM policy, only print it")) # noqa: E501
return parser.parse_args()
def get_current_iam_policy(project):
"""Fetches and returns the current iam policy as a yaml object"""
return yaml.load(
subprocess.check_output(["gcloud", "projects", "get-iam-policy",
project]))
def iam_policy_to_dict(bindings):
"""
iam_policy_to_dict takes an iam policy binding in the GCP API format and
converts it into a python dict so that it can be easily updated
"""
bindings_dict = dict()
for binding in bindings:
role = binding['role']
bindings_dict[role] = set(binding['members'])
return bindings_dict
def iam_dict_to_policy(bindings_dict):
"""
iam_dict_to_policy takes an iam policy binding in the dict format and
converts it into GCP API format so that it can be sent to GCP IAM API for
an update
"""
bindings = []
for k, v in bindings_dict.items():
bindings.append({"role": k, "members": list(v)})
return bindings
def apply_iam_bindings_patch(current_policy, bindings_patch, action):
"""
Patches the current policy with the supplied patch.
action can be add or remove.
"""
for item in bindings_patch['bindings']:
members = item['members']
roles = item['roles']
for role in roles:
if role not in current_policy.keys():
current_policy[role] = set()
if action == "add":
current_policy[role].update(members)
else:
current_policy[role].difference_update(members)
return current_policy
def patch_iam_policy(args):
"""
Fetches the current IAM policy, patches it with the bindings supplied in
--iam_bindings_file and updates the new iam policy
"""
current_policy = get_current_iam_policy(args.project)
logging.info("Current IAM Policy")
logging.info(
yaml.dump(current_policy, default_flow_style=False, default_style=''))
current_policy_bindings_dict = iam_policy_to_dict(current_policy['bindings'])
with open(args.iam_bindings_file) as iam_bindings_file:
bindings_patch = yaml.load(iam_bindings_file.read())
current_policy_bindings_dict = apply_iam_bindings_patch(
current_policy_bindings_dict, bindings_patch, args.action)
current_policy['bindings'] = iam_dict_to_policy(current_policy_bindings_dict)
logging.info("Updated Policy")
logging.info("\n" + yaml.dump(
current_policy, default_flow_style=False, default_style=''))
updated_policy_file = tempfile.NamedTemporaryFile(delete=False)
with open(updated_policy_file.name, 'w') as f:
yaml.dump(current_policy, f, default_flow_style=False)
logging.debug("Temp file %s", updated_policy_file.name)
if not args.dry_run:
subprocess.check_call([
"gcloud", "projects", "set-iam-policy", args.project,
updated_policy_file.name
])
else:
logging.info("Skipping patching the IAM policy because --dry_run was set")
if __name__ == "__main__":
logging.getLogger().setLevel(logging.INFO)
args = parse_args()
if args.action not in ["add", "remove"]:
raise ValueError("invalid --action. Valid values are add, remove")
for i in range(5):
try:
patch_iam_policy(args)
logging.info("Successfully patched IAM policy")
break
except Exception as e:
logging.error(e)
if i < 4:
logging.info("Retrying in 15 seconds..")
time.sleep(15)
else:
logging.error("Patching IAM policy failed")
sys.exit(1)
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2000 World Wide Web Consortium,
* (Massachusetts Institute of Technology, Institut National de
* Recherche en Informatique et en Automatique, Keio University). All
* Rights Reserved. This program is distributed under the W3C's Software
* Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
* details.
*/
package org.w3c.dom.smil;
import org.w3c.dom.DOMException;
/**
* This interface support use-cases commonly associated with animation.
* "accelerate" and "decelerate" are float values in the timing draft and
* percentage values even in this draft if both of them represent a
* percentage.
*/
public interface ElementTimeManipulation {
/**
* Defines the playback speed of element time. The value is specified as
* a multiple of normal (parent time container) play speed. Legal values
* are signed floating point values. Zero values are not allowed. The
* default is <code>1.0</code> (no modification of speed).
* @exception DOMException
* NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.
*/
public float getSpeed();
public void setSpeed(float speed)
throws DOMException;
/**
* The percentage value of the simple acceleration of time for the
* element. Allowed values are from <code>0</code> to <code>100</code> .
* Default value is <code>0</code> (no acceleration).
* <br> The sum of the values for accelerate and decelerate must not exceed
* 100. If it does, the deceleration value will be reduced to make the
* sum legal.
* @exception DOMException
* NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.
*/
public float getAccelerate();
public void setAccelerate(float accelerate)
throws DOMException;
/**
* The percentage value of the simple decelerate of time for the
* element. Allowed values are from <code>0</code> to <code>100</code> .
* Default value is <code>0</code> (no deceleration).
* <br> The sum of the values for accelerate and decelerate must not exceed
* 100. If it does, the deceleration value will be reduced to make the
* sum legal.
* @exception DOMException
* NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.
*/
public float getDecelerate();
public void setDecelerate(float decelerate)
throws DOMException;
/**
* The autoReverse attribute controls the "play forwards then backwards"
* functionality. Default value is <code>false</code> .
* @exception DOMException
* NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.
*/
public boolean getAutoReverse();
public void setAutoReverse(boolean autoReverse)
throws DOMException;
}
| {
"pile_set_name": "Github"
} |
import React from 'react';
import { StyleSheet, View, Platform } from 'react-native';
import PropTypes from 'prop-types';
const Gradient = ({ style, gradientSteps, maximumValue, getStepColor }) => {
const rows = [];
for (let i = 0; i <= gradientSteps; i++) {
rows.push(
<View
key={i}
style={{
flex: 1,
marginLeft: Platform.OS === 'ios' ? -StyleSheet.hairlineWidth : 0,
backgroundColor: getStepColor(i * maximumValue / gradientSteps)
}}
/>
);
}
return <View style={[styles.container, style]}>{rows}</View>;
};
export default Gradient;
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'stretch'
}
});
Gradient.propTypes = {
gradientSteps: PropTypes.number.isRequired,
maximumValue: PropTypes.number.isRequired,
getStepColor: PropTypes.func.isRequired
};
| {
"pile_set_name": "Github"
} |
var path = require('path')
var test = require('tape')
var download = require('electron-download')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
var series = require('run-series')
var compareVersion = require('compare-version')
var extract = require('extract-zip')
var config = require('./config')
var ORIGINAL_CWD = process.cwd()
var WORK_CWD = path.join(__dirname, 'work')
var versions = config.versions
var archs = ['x64']
var platforms = ['darwin', 'mas']
var slice = Array.prototype.slice
var releases = []
versions.forEach(function (version) {
archs.forEach(function (arch) {
platforms.forEach(function (platform) {
// Only versions later than 0.34.0 offer mas builds
if (platform !== 'mas' || compareVersion(version, '0.34.0') >= 0) {
releases.push({
arch: arch,
platform: platform,
version: version
})
}
})
})
})
exports.generateReleaseName = function getExtractName (release) {
return 'v' + release.version + '-' + release.platform + '-' + release.arch
}
exports.generateAppPath = function getExtractName (release) {
return path.join(exports.generateReleaseName(release), 'Electron.app')
}
exports.downloadElectrons = function downloadElectrons (callback) {
series(releases.map(function (release) {
return function (cb) {
download(release, function (err, zipPath) {
if (err) return callback(err)
extract(zipPath, {dir: path.join(WORK_CWD, exports.generateReleaseName(release))}, cb)
})
}
}), callback)
}
exports.setup = function setup () {
test('setup', function (t) {
mkdirp(WORK_CWD, function (err) {
if (err) {
t.end(err)
} else {
process.chdir(WORK_CWD)
t.end()
}
})
})
}
exports.teardown = function teardown () {
test('teardown', function (t) {
process.chdir(ORIGINAL_CWD)
rimraf(WORK_CWD, function (err) {
t.end(err)
})
})
}
exports.forEachRelease = function forEachRelease (cb) {
releases.forEach(cb)
}
exports.testAllReleases = function testAllReleases (name, createTest /*, ...createTestArgs */) {
var args = slice.call(arguments, 2)
exports.setup()
exports.forEachRelease(function (release) {
test(name + ':' + exports.generateReleaseName(release),
createTest.apply(null, [release].concat(args)))
})
exports.teardown()
}
| {
"pile_set_name": "Github"
} |
/*
* Summary: Implementation of the XSLT number functions
* Description: Implementation of the XSLT number functions
*
* Copy: See Copyright for the status of this software.
*
* Author: Bjorn Reese <[email protected]> and Daniel Veillard
*/
#ifndef __XML_XSLT_NUMBERSINTERNALS_H__
#define __XML_XSLT_NUMBERSINTERNALS_H__
#include <libxml/tree.h>
#include "xsltexports.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _xsltCompMatch;
/**
* xsltNumberData:
*
* This data structure is just a wrapper to pass xsl:number data in.
*/
typedef struct _xsltNumberData xsltNumberData;
typedef xsltNumberData *xsltNumberDataPtr;
struct _xsltNumberData {
const xmlChar *level;
const xmlChar *count;
const xmlChar *from;
const xmlChar *value;
const xmlChar *format;
int has_format;
int digitsPerGroup;
int groupingCharacter;
int groupingCharacterLen;
xmlDocPtr doc;
xmlNodePtr node;
struct _xsltCompMatch *countPat;
struct _xsltCompMatch *fromPat;
/*
* accelerators
*/
};
/**
* xsltFormatNumberInfo,:
*
* This data structure lists the various parameters needed to format numbers.
*/
typedef struct _xsltFormatNumberInfo xsltFormatNumberInfo;
typedef xsltFormatNumberInfo *xsltFormatNumberInfoPtr;
struct _xsltFormatNumberInfo {
int integer_hash; /* Number of '#' in integer part */
int integer_digits; /* Number of '0' in integer part */
int frac_digits; /* Number of '0' in fractional part */
int frac_hash; /* Number of '#' in fractional part */
int group; /* Number of chars per display 'group' */
int multiplier; /* Scaling for percent or permille */
char add_decimal; /* Flag for whether decimal point appears in pattern */
char is_multiplier_set; /* Flag to catch multiple occurences of percent/permille */
char is_negative_pattern;/* Flag for processing -ve prefix/suffix */
};
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_NUMBERSINTERNALS_H__ */
| {
"pile_set_name": "Github"
} |
<?php
namespace QuickBooksOnline\API\Data;
/**
* @xmlNamespace http://schema.intuit.com/finance/v3
* @xmlType string
* @xmlName IPPFaultTypeEnum
* @var IPPFaultTypeEnum
* @xmlDefinition FaultTypeEnumeration list
*/
class IPPFaultTypeEnum
{
/**
* Initializes this object, optionally with pre-defined property values
*
* Initializes this object and it's property members, using the dictionary
* of key/value pairs passed as an optional argument.
*
* @param dictionary $keyValInitializers key/value pairs to be populated into object's properties
* @param boolean $verbose specifies whether object should echo warnings
*/
public function __construct($keyValInitializers=array(), $verbose=FALSE)
{
foreach($keyValInitializers as $initPropName => $initPropVal)
{
if (property_exists('IPPFaultTypeEnum',$initPropName) || property_exists('QuickBooksOnline\API\Data\IPPFaultTypeEnum',$initPropName))
{
$this->{$initPropName} = $initPropVal;
}
else
{
if ($verbose)
echo "Property does not exist ($initPropName) in class (".get_class($this).")";
}
}
}
/**
* @xmlType value
* @var string
*/
public $value;
} // end class IPPFaultTypeEnum
| {
"pile_set_name": "Github"
} |
آدرینا
آرمیتا
آنیتا
آوا
آوین
آوینا
آیلین
آیناز
النا
الینا
باران
بهار
بهاره
بیتا
تارا
تینا
ثنا
درسا
دینا
رها
رونیکا
زهرا
سارا
سارینا
ستایش
سوگند
عسل
غزل
فاطمه
فاطمه زهرا
مارال
محیا
مرسانا
مریم
ملینا
مهدیس
مهرسا
نازنین
نیایش
هستی
هلیا
پارمیس
پرنیا
پریا
کیانا
کیمیا
یاسمن
یاسمین
یسنا
یلدا
| {
"pile_set_name": "Github"
} |
/*
950621-1.c from the execute part of the gcc torture suite.
*/
#include <testfwk.h>
#ifdef __SDCC
#pragma std_c99
#endif
struct s
{
int a;
int b;
struct s *dummy;
};
f (struct s *sp)
{
return sp && sp->a == -1 && sp->b == -1;
}
void
testTortureExecute (void)
{
struct s x;
x.a = x.b = -1;
if (f (&x) == 0)
ASSERT (0);
return;
}
| {
"pile_set_name": "Github"
} |
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
// them here for backwards compatibility.
package unix
const (
IFF_SMART = 0x20
IFT_1822 = 0x2
IFT_A12MPPSWITCH = 0x82
IFT_AAL2 = 0xbb
IFT_AAL5 = 0x31
IFT_ADSL = 0x5e
IFT_AFLANE8023 = 0x3b
IFT_AFLANE8025 = 0x3c
IFT_ARAP = 0x58
IFT_ARCNET = 0x23
IFT_ARCNETPLUS = 0x24
IFT_ASYNC = 0x54
IFT_ATM = 0x25
IFT_ATMDXI = 0x69
IFT_ATMFUNI = 0x6a
IFT_ATMIMA = 0x6b
IFT_ATMLOGICAL = 0x50
IFT_ATMRADIO = 0xbd
IFT_ATMSUBINTERFACE = 0x86
IFT_ATMVCIENDPT = 0xc2
IFT_ATMVIRTUAL = 0x95
IFT_BGPPOLICYACCOUNTING = 0xa2
IFT_BSC = 0x53
IFT_CCTEMUL = 0x3d
IFT_CEPT = 0x13
IFT_CES = 0x85
IFT_CHANNEL = 0x46
IFT_CNR = 0x55
IFT_COFFEE = 0x84
IFT_COMPOSITELINK = 0x9b
IFT_DCN = 0x8d
IFT_DIGITALPOWERLINE = 0x8a
IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
IFT_DLSW = 0x4a
IFT_DOCSCABLEDOWNSTREAM = 0x80
IFT_DOCSCABLEMACLAYER = 0x7f
IFT_DOCSCABLEUPSTREAM = 0x81
IFT_DS0 = 0x51
IFT_DS0BUNDLE = 0x52
IFT_DS1FDL = 0xaa
IFT_DS3 = 0x1e
IFT_DTM = 0x8c
IFT_DVBASILN = 0xac
IFT_DVBASIOUT = 0xad
IFT_DVBRCCDOWNSTREAM = 0x93
IFT_DVBRCCMACLAYER = 0x92
IFT_DVBRCCUPSTREAM = 0x94
IFT_ENC = 0xf4
IFT_EON = 0x19
IFT_EPLRS = 0x57
IFT_ESCON = 0x49
IFT_ETHER = 0x6
IFT_FAITH = 0xf2
IFT_FAST = 0x7d
IFT_FASTETHER = 0x3e
IFT_FASTETHERFX = 0x45
IFT_FDDI = 0xf
IFT_FIBRECHANNEL = 0x38
IFT_FRAMERELAYINTERCONNECT = 0x3a
IFT_FRAMERELAYMPI = 0x5c
IFT_FRDLCIENDPT = 0xc1
IFT_FRELAY = 0x20
IFT_FRELAYDCE = 0x2c
IFT_FRF16MFRBUNDLE = 0xa3
IFT_FRFORWARD = 0x9e
IFT_G703AT2MB = 0x43
IFT_G703AT64K = 0x42
IFT_GIF = 0xf0
IFT_GIGABITETHERNET = 0x75
IFT_GR303IDT = 0xb2
IFT_GR303RDT = 0xb1
IFT_H323GATEKEEPER = 0xa4
IFT_H323PROXY = 0xa5
IFT_HDH1822 = 0x3
IFT_HDLC = 0x76
IFT_HDSL2 = 0xa8
IFT_HIPERLAN2 = 0xb7
IFT_HIPPI = 0x2f
IFT_HIPPIINTERFACE = 0x39
IFT_HOSTPAD = 0x5a
IFT_HSSI = 0x2e
IFT_HY = 0xe
IFT_IBM370PARCHAN = 0x48
IFT_IDSL = 0x9a
IFT_IEEE80211 = 0x47
IFT_IEEE80212 = 0x37
IFT_IEEE8023ADLAG = 0xa1
IFT_IFGSN = 0x91
IFT_IMT = 0xbe
IFT_INTERLEAVE = 0x7c
IFT_IP = 0x7e
IFT_IPFORWARD = 0x8e
IFT_IPOVERATM = 0x72
IFT_IPOVERCDLC = 0x6d
IFT_IPOVERCLAW = 0x6e
IFT_IPSWITCH = 0x4e
IFT_IPXIP = 0xf9
IFT_ISDN = 0x3f
IFT_ISDNBASIC = 0x14
IFT_ISDNPRIMARY = 0x15
IFT_ISDNS = 0x4b
IFT_ISDNU = 0x4c
IFT_ISO88022LLC = 0x29
IFT_ISO88023 = 0x7
IFT_ISO88024 = 0x8
IFT_ISO88025 = 0x9
IFT_ISO88025CRFPINT = 0x62
IFT_ISO88025DTR = 0x56
IFT_ISO88025FIBER = 0x73
IFT_ISO88026 = 0xa
IFT_ISUP = 0xb3
IFT_L3IPXVLAN = 0x89
IFT_LAPB = 0x10
IFT_LAPD = 0x4d
IFT_LAPF = 0x77
IFT_LOCALTALK = 0x2a
IFT_LOOP = 0x18
IFT_MEDIAMAILOVERIP = 0x8b
IFT_MFSIGLINK = 0xa7
IFT_MIOX25 = 0x26
IFT_MODEM = 0x30
IFT_MPC = 0x71
IFT_MPLS = 0xa6
IFT_MPLSTUNNEL = 0x96
IFT_MSDSL = 0x8f
IFT_MVL = 0xbf
IFT_MYRINET = 0x63
IFT_NFAS = 0xaf
IFT_NSIP = 0x1b
IFT_OPTICALCHANNEL = 0xc3
IFT_OPTICALTRANSPORT = 0xc4
IFT_OTHER = 0x1
IFT_P10 = 0xc
IFT_P80 = 0xd
IFT_PARA = 0x22
IFT_PFLOG = 0xf6
IFT_PFSYNC = 0xf7
IFT_PLC = 0xae
IFT_POS = 0xab
IFT_PPPMULTILINKBUNDLE = 0x6c
IFT_PROPBWAP2MP = 0xb8
IFT_PROPCNLS = 0x59
IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
IFT_PROPMUX = 0x36
IFT_PROPWIRELESSP2P = 0x9d
IFT_PTPSERIAL = 0x16
IFT_PVC = 0xf1
IFT_QLLC = 0x44
IFT_RADIOMAC = 0xbc
IFT_RADSL = 0x5f
IFT_REACHDSL = 0xc0
IFT_RFC1483 = 0x9f
IFT_RS232 = 0x21
IFT_RSRB = 0x4f
IFT_SDLC = 0x11
IFT_SDSL = 0x60
IFT_SHDSL = 0xa9
IFT_SIP = 0x1f
IFT_SLIP = 0x1c
IFT_SMDSDXI = 0x2b
IFT_SMDSICIP = 0x34
IFT_SONET = 0x27
IFT_SONETOVERHEADCHANNEL = 0xb9
IFT_SONETPATH = 0x32
IFT_SONETVT = 0x33
IFT_SRP = 0x97
IFT_SS7SIGLINK = 0x9c
IFT_STACKTOSTACK = 0x6f
IFT_STARLAN = 0xb
IFT_STF = 0xd7
IFT_T1 = 0x12
IFT_TDLC = 0x74
IFT_TERMPAD = 0x5b
IFT_TR008 = 0xb0
IFT_TRANSPHDLC = 0x7b
IFT_TUNNEL = 0x83
IFT_ULTRA = 0x1d
IFT_USB = 0xa0
IFT_V11 = 0x40
IFT_V35 = 0x2d
IFT_V36 = 0x41
IFT_V37 = 0x78
IFT_VDSL = 0x61
IFT_VIRTUALIPADDRESS = 0x70
IFT_VOICEEM = 0x64
IFT_VOICEENCAP = 0x67
IFT_VOICEFXO = 0x65
IFT_VOICEFXS = 0x66
IFT_VOICEOVERATM = 0x98
IFT_VOICEOVERFRAMERELAY = 0x99
IFT_VOICEOVERIP = 0x68
IFT_X213 = 0x5d
IFT_X25 = 0x5
IFT_X25DDN = 0x4
IFT_X25HUNTGROUP = 0x7a
IFT_X25MLP = 0x79
IFT_X25PLE = 0x28
IFT_XETHER = 0x1a
IPPROTO_MAXID = 0x34
IPV6_FAITH = 0x1d
IP_FAITH = 0x16
MAP_NORESERVE = 0x40
MAP_RENAME = 0x20
NET_RT_MAXID = 0x6
RTF_PRCLONING = 0x10000
RTM_OLDADD = 0x9
RTM_OLDDEL = 0xa
SIOCADDRT = 0x8030720a
SIOCALIFADDR = 0x8118691b
SIOCDELRT = 0x8030720b
SIOCDLIFADDR = 0x8118691d
SIOCGLIFADDR = 0xc118691c
SIOCGLIFPHYADDR = 0xc118694b
SIOCSLIFPHYADDR = 0x8118694a
)
| {
"pile_set_name": "Github"
} |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# return objects representing the tags we need to base the Alpine image on
# The versions of Alpine we care about, for this dockerfile
$shortTags = @('3.9','3.10')
$parent = Join-Path -Path $PSScriptRoot -ChildPath '..'
$repoRoot = Join-Path -path (Join-Path -Path $parent -ChildPath '..') -ChildPath '..'
$modulePath = Join-Path -Path $repoRoot -ChildPath 'tools\getDockerTags'
Import-Module $modulePath
Get-DockerTags -ShortTags $shortTags -Image "alpine" -FullTagFilter '^3.\d\d?$' -OnlyShortTags
| {
"pile_set_name": "Github"
} |
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"publicDnsName": {
"value": "GEN-UNIQUE"
},
"adminUsername": {
"value": "GEN-UNIQUE"
},
"adminPassword": {
"value": "GEN-PASSWORD"
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at http://smartos.org/CDDL
*
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file.
*
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright 2016, Joyent, Inc. All rights reserved.
*
*
* fwadm: CLI shared logic
*/
var cmdln = require('cmdln');
var fs = require('fs');
var mod_obj = require('./util/obj');
var tab = require('tab');
var tty = require('tty');
var util = require('util');
var verror = require('verror');
var hasKey = mod_obj.hasKey;
// --- Globals
var DEFAULT_FIELDS = ['uuid', 'enabled', 'rule'];
var DEFAULT_FIELD_WIDTHS = {
created_by: 10,
description: 15,
enabled: 7,
global: 6,
owner_uuid: 36,
rule: 20,
uuid: 36,
version: 20
};
// Have we output an error?
var OUTPUT_ERROR = false;
var UUID_REGEX =
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
// --- Exported functions
/**
* Displays a list of firewall rules
*/
function displayRules(err, res, opts) {
if (err) {
return outputError(err, opts);
}
if (opts && opts.json) {
return console.log(json(res));
}
var fields = opts.fields || DEFAULT_FIELDS;
var tableOpts = {
columns: [],
omitHeader: opts.parseable || false,
rows: []
};
if (opts.parseable) {
tableOpts.columnSeparator = opts.delim || ':';
}
fields.forEach(function (f) {
tableOpts.columns.push({
align: 'left',
label: f.toUpperCase(),
// Parseable output: make all field widths 1, so that
// there's no whitespace between them
width: opts.parseable ? 1 : DEFAULT_FIELD_WIDTHS[f]
});
});
res.forEach(function (r) {
tableOpts.rows.push(fields.map(function (f, i) {
if (!r[f]) {
return '-';
}
var str = r[f].toString();
if (tableOpts.columnSeparator) {
str = str.split(tableOpts.columnSeparator).join(
'\\' + tableOpts.columnSeparator);
}
if (opts.parseable) {
// We don't care about fixing the length for parseable
// output: there's no spacing
return str;
}
var len = str.length;
if (len > tableOpts.columns[i].width) {
tableOpts.columns[i].width = len;
}
return str;
}));
});
tab.emitTable(tableOpts);
}
/**
* Output an error and then exit
*/
function exitWithErr(err, opts) {
outputError(err, opts);
return process.exit(1);
}
/**
* Reads the payload from one of: a file, stdin, a text argument
*/
function getPayload(opts, args, callback) {
var file;
if (opts && opts.file) {
file = opts.file;
}
// If no file specified, try to find the rule from the commandline args
if (!file && args.length > 0) {
var payload = {
rule: args.join(' ')
};
callback(null, payload);
return;
}
if (!file && !tty.isatty(0)) {
file = '-';
}
if (!file) {
callback(new cmdln.UsageError('Must supply file!'));
return;
}
if (file === '-') {
file = '/dev/stdin';
}
fs.readFile(file, function (err, data) {
if (err) {
if (err.code === 'ENOENT') {
return callback(new verror.VError(
'File "%s" does not exist.', file));
}
return callback(new verror.VError(
'Error reading "%s": %s', file, err.message));
}
return callback(null, JSON.parse(data.toString()));
});
}
/**
* Have we output an error so far?
*/
function haveOutputErr() {
return OUTPUT_ERROR;
}
/**
* Pretty-print a JSON object
*/
function json(obj) {
return JSON.stringify(obj, null, 2);
}
/**
* Outputs an error to the console, displaying all of the error messages
* if it's a MultiError
*/
function outputError(err, opts) {
var errs = [ err ];
OUTPUT_ERROR = true;
if (hasKey(err, 'ase_errors')) {
errs = err.ase_errors;
}
if (opts && opts.json) {
return console.error(json({
errors: errs.map(function (e) {
var j = { message: e.message };
if (hasKey(e, 'code')) {
j.code = e.code;
}
if (opts.verbose) {
j.stack = e.stack;
}
if (e.cmdlnErrHelpFromErr) {
j.help = cmdln.errHelpFromErr(e);
}
return j;
})
}));
}
errs.forEach(function (e) {
console.error(e.message);
if (opts && opts.verbose) {
console.error(e.stack);
}
if (e.cmdlnErrHelpFromErr) {
console.error('\n' + cmdln.errHelpFromErr(e));
}
});
}
/**
* Outputs one formatted rule line
*/
function ruleLine(r) {
return util.format('%s %s %s', r.uuid,
r.enabled ? 'true ' : 'false ', r.rule);
}
/**
* Prints an error and exits if the UUID is invalid
*/
function validateUUID(arg) {
if (!arg) {
console.error('Error: missing UUID');
process.exit(1);
}
if (!UUID_REGEX.test(arg)) {
console.error('Error: invalid UUID "%s"', arg);
process.exit(1);
}
return arg;
}
module.exports = {
displayRules: displayRules,
exitWithErr: exitWithErr,
getPayload: getPayload,
haveOutputErr : haveOutputErr,
json: json,
outputError: outputError,
ruleLine: ruleLine,
validateUUID: validateUUID
};
| {
"pile_set_name": "Github"
} |
---
title: Azure SQL Database 用の Azure Policy 規制コンプライアンス コントロール
description: Azure SQL Database と SQL Managed Instance に対して使用できる Azure Policy の規制コンプライアンス コントロールの一覧を示します。 これらの組み込みポリシー定義により、Azure リソースのコンプライアンスを管理するための一般的な方法が提供されます。
ms.date: 09/04/2020
ms.topic: sample
author: stevestein
ms.author: sstein
ms.service: sql-database
ms.custom: subject-policy-compliancecontrols
ms.openlocfilehash: 64596a1f1f40ba5e015a38705a299fcc04d1a59a
ms.sourcegitcommit: de2750163a601aae0c28506ba32be067e0068c0c
ms.translationtype: HT
ms.contentlocale: ja-JP
ms.lasthandoff: 09/04/2020
ms.locfileid: "89488995"
---
# <a name="azure-policy-regulatory-compliance-controls-for-azure-sql-database--sql-managed-instance"></a>Azure SQL Database と SQL Managed Instance 用の Azure Policy 規制コンプライアンス コントロール
[!INCLUDE[appliesto-sqldb-sqlmi](../includes/appliesto-sqldb-sqlmi.md)]
[Azure Policy の規制コンプライアンス](../../governance/policy/concepts/regulatory-compliance.md)により、さまざまなコンプライアンス基準に関連する**コンプライアンス ドメイン**および**セキュリティ コントロール**に対して、"_組み込み_" と呼ばれる、Microsoft が作成および管理するイニシアチブ定義が提供されます。 このページでは、Azure SQL Database と SQL Managed Instance 用の**コンプライアンス ドメイン**と**セキュリティ コントロール**の一覧を示します。 **セキュリティ コントロール**の組み込みを個別に割り当てることで、Azure リソースを特定の基準に準拠させることができます。
[!INCLUDE [azure-policy-compliancecontrols-introwarning](../../../includes/policy/standards/intro-warning.md)]
[!INCLUDE [azure-policy-compliancecontrols-sql](../../../includes/policy/standards/byrp/microsoft.sql.md)]
## <a name="next-steps"></a>次のステップ
- [Azure Policy の規制コンプライアンス](../../governance/policy/concepts/regulatory-compliance.md)の詳細を確認します。
- [Azure Policy GitHub リポジトリ](https://github.com/Azure/azure-policy)のビルトインを参照します。
| {
"pile_set_name": "Github"
} |
#ifndef WMLEX_H
#define WMLEX_H
/************************************************************
wmlex.h
This file can be freely modified for the generation of
custom code.
Copyright (c) 1999-2003 Bumble-Bee Software Ltd.
************************************************************/
#include <yywmlex.h>
#endif
| {
"pile_set_name": "Github"
} |
package com.aylson.dc.sys.dao;
import com.aylson.core.frame.dao.BaseDao;
import com.aylson.dc.sys.po.NoticeRead;
import com.aylson.dc.sys.search.NoticeReadSearch;
public interface NoticeReadDao extends BaseDao<NoticeRead,NoticeReadSearch> {
}
| {
"pile_set_name": "Github"
} |
julia 1.0
JuliaInterpreter
| {
"pile_set_name": "Github"
} |
using System;
namespace ACE.Entity.Enum
{
[Flags]
public enum ObjectDescriptionFlag
{
None = 0x00000000,
Openable = 0x00000001,
Inscribable = 0x00000002,
Stuck = 0x00000004,
Player = 0x00000008,
Attackable = 0x00000010,
PlayerKiller = 0x00000020,
HiddenAdmin = 0x00000040,
UiHidden = 0x00000080,
Book = 0x00000100,
Vendor = 0x00000200,
PkSwitch = 0x00000400,
NpkSwitch = 0x00000800,
Door = 0x00001000,
Corpse = 0x00002000,
LifeStone = 0x00004000,
Food = 0x00008000,
Healer = 0x00010000,
Lockpick = 0x00020000,
Portal = 0x00040000,
Admin = 0x00100000,
FreePkStatus = 0x00200000,
ImmuneCellRestrictions = 0x00400000,
RequiresPackSlot = 0x00800000,
Retained = 0x01000000,
PkLiteStatus = 0x02000000,
IncludesSecondHeader = 0x04000000,
BindStone = 0x08000000,
VolatileRare = 0x10000000,
WieldOnUse = 0x20000000,
WieldLeft = 0x40000000,
}
}
| {
"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.commons.configuration2;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import javax.sql.DataSource;
import java.sql.Clob;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.configuration2.builder.fluent.DatabaseBuilderParameters;
import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler;
import org.apache.commons.configuration2.event.ConfigurationErrorEvent;
import org.apache.commons.configuration2.event.ConfigurationEvent;
import org.apache.commons.configuration2.event.ErrorListenerTestImpl;
import org.apache.commons.configuration2.event.EventType;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.easymock.EasyMock;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
* Test for database stored configurations. Note, when running this Unit
* Test in Eclipse it sometimes takes a couple tries. Otherwise you may get
* database is already in use by another process errors.
*
*/
public class TestDatabaseConfiguration
{
/** Constant for another configuration name. */
private static final String CONFIG_NAME2 = "anotherTestConfig";
/** An error listener for testing whether internal errors occurred.*/
private ErrorListenerTestImpl listener;
/** The test helper. */
private DatabaseConfigurationTestHelper helper;
@Before
public void setUp() throws Exception
{
/*
* Thread.sleep may or may not help with the database is already in
* use exception.
*/
//Thread.sleep(1000);
// set up the datasource
helper = new DatabaseConfigurationTestHelper();
helper.setUp();
}
@After
public void tearDown() throws Exception
{
// if an error listener is defined, we check whether an error occurred
if(listener != null)
{
listener.done();
}
helper.tearDown();
}
/**
* Creates a database configuration with default values.
*
* @return the configuration
* @throws ConfigurationException if an error occurs
*/
private PotentialErrorDatabaseConfiguration setUpConfig()
throws ConfigurationException
{
return helper.setUpConfig(PotentialErrorDatabaseConfiguration.class);
}
/**
* Creates an error listener and adds it to the specified configuration.
*
* @param config the configuration
*/
private void setUpErrorListener(final PotentialErrorDatabaseConfiguration config)
{
// remove log listener to avoid exception longs
config.clearErrorListeners();
listener = new ErrorListenerTestImpl(config);
config.addEventListener(ConfigurationErrorEvent.ANY, listener);
config.failOnConnect = true;
}
/**
* Prepares a test for a database error. Sets up a config and registers an
* error listener.
*
* @return the initialized configuration
* @throws ConfigurationException if an error occurs
*/
private PotentialErrorDatabaseConfiguration setUpErrorConfig()
throws ConfigurationException
{
final PotentialErrorDatabaseConfiguration config = setUpConfig();
setUpErrorListener(config);
return config;
}
/**
* Checks the error listener for an expected error. The properties of the
* error event will be compared with the expected values.
*
* @param type the expected type of the error event
* @param opType the expected operation type
* @param key the expected property key
* @param value the expected property value
*/
private void checkErrorListener(
final EventType<? extends ConfigurationErrorEvent> type,
final EventType<?> opType, final String key, final Object value)
{
final Throwable exception = listener.checkEvent(type, opType, key, value);
assertTrue("Wrong exception", exception instanceof SQLException);
listener = null; // mark as checked
}
@Test
public void testAddPropertyDirectSingle() throws ConfigurationException
{
final DatabaseConfiguration config = helper.setUpConfig();
config.addPropertyDirect("key", "value");
assertTrue("missing property", config.containsKey("key"));
}
/**
* Tests whether a commit is performed after a property was added.
*/
@Test
public void testAddPropertyDirectCommit() throws ConfigurationException
{
helper.setAutoCommit(false);
final DatabaseConfiguration config = helper.setUpConfig();
config.addPropertyDirect("key", "value");
assertTrue("missing property", config.containsKey("key"));
}
@Test
public void testAddPropertyDirectMultiple() throws ConfigurationException
{
final DatabaseConfiguration config = helper.setUpMultiConfig();
config.addPropertyDirect("key", "value");
assertTrue("missing property", config.containsKey("key"));
}
@Test
public void testAddNonStringProperty() throws ConfigurationException
{
final DatabaseConfiguration config = helper.setUpConfig();
config.addPropertyDirect("boolean", Boolean.TRUE);
assertTrue("missing property", config.containsKey("boolean"));
}
@Test
public void testGetPropertyDirectSingle() throws ConfigurationException
{
final Configuration config = setUpConfig();
assertEquals("property1", "value1", config.getProperty("key1"));
assertEquals("property2", "value2", config.getProperty("key2"));
assertEquals("unknown property", null, config.getProperty("key3"));
}
@Test
public void testGetPropertyDirectMultiple() throws ConfigurationException
{
final Configuration config = helper.setUpMultiConfig();
assertEquals("property1", "value1", config.getProperty("key1"));
assertEquals("property2", "value2", config.getProperty("key2"));
assertEquals("unknown property", null, config.getProperty("key3"));
}
@Test
public void testClearPropertySingle() throws ConfigurationException
{
final Configuration config = helper.setUpConfig();
config.clearProperty("key1");
assertFalse("property not cleared", config.containsKey("key1"));
}
@Test
public void testClearPropertyMultiple() throws ConfigurationException
{
final Configuration config = helper.setUpMultiConfig();
config.clearProperty("key1");
assertFalse("property not cleared", config.containsKey("key1"));
}
/**
* Tests that another configuration is not affected when clearing
* properties.
*/
@Test
public void testClearPropertyMultipleOtherConfig() throws ConfigurationException
{
final DatabaseConfiguration config = helper.setUpMultiConfig();
final DatabaseConfiguration config2 =
helper.setUpMultiConfig(DatabaseConfiguration.class,
CONFIG_NAME2);
config2.addProperty("key1", "some test");
config.clearProperty("key1");
assertFalse("property not cleared", config.containsKey("key1"));
assertTrue("Property cleared in other config", config2
.containsKey("key1"));
}
/**
* Tests whether a commit is performed after a property was cleared.
*/
@Test
public void testClearPropertyCommit() throws ConfigurationException
{
helper.setAutoCommit(false);
final Configuration config = helper.setUpConfig();
config.clearProperty("key1");
assertFalse("property not cleared", config.containsKey("key1"));
}
@Test
public void testClearSingle() throws ConfigurationException
{
final Configuration config = helper.setUpConfig();
config.clear();
assertTrue("configuration is not cleared", config.isEmpty());
}
@Test
public void testClearMultiple() throws ConfigurationException
{
final Configuration config = helper.setUpMultiConfig();
config.clear();
assertTrue("configuration is not cleared", config.isEmpty());
}
/**
* Tests whether a commit is performed after a clear operation.
*/
@Test
public void testClearCommit() throws ConfigurationException
{
helper.setAutoCommit(false);
final Configuration config = helper.setUpConfig();
config.clear();
assertTrue("configuration is not cleared", config.isEmpty());
}
@Test
public void testGetKeysSingle() throws ConfigurationException
{
final Configuration config = setUpConfig();
final Iterator<String> it = config.getKeys();
assertEquals("1st key", "key1", it.next());
assertEquals("2nd key", "key2", it.next());
}
@Test
public void testGetKeysMultiple() throws ConfigurationException
{
final Configuration config = helper.setUpMultiConfig();
final Iterator<String> it = config.getKeys();
assertEquals("1st key", "key1", it.next());
assertEquals("2nd key", "key2", it.next());
}
@Test
public void testContainsKeySingle() throws ConfigurationException
{
final Configuration config = setUpConfig();
assertTrue("missing key1", config.containsKey("key1"));
assertTrue("missing key2", config.containsKey("key2"));
}
@Test
public void testContainsKeyMultiple() throws ConfigurationException
{
final Configuration config = helper.setUpMultiConfig();
assertTrue("missing key1", config.containsKey("key1"));
assertTrue("missing key2", config.containsKey("key2"));
}
@Test
public void testIsEmptySingle() throws ConfigurationException
{
final Configuration config1 = setUpConfig();
assertFalse("The configuration is empty", config1.isEmpty());
}
@Test
public void testIsEmptyMultiple() throws ConfigurationException
{
final Configuration config1 = helper.setUpMultiConfig();
assertFalse("The configuration named 'test' is empty", config1.isEmpty());
final Configuration config2 = helper.setUpMultiConfig(DatabaseConfiguration.class, "testIsEmpty");
assertTrue("The configuration named 'testIsEmpty' is not empty", config2.isEmpty());
}
@Test
public void testGetList() throws ConfigurationException
{
final DatabaseBuilderParameters params = helper.setUpDefaultParameters().setTable("configurationList");
final Configuration config1 = helper.createConfig(DatabaseConfiguration.class, params);
final List<Object> list = config1.getList("key3");
assertEquals(3,list.size());
}
@Test
public void testGetKeys() throws ConfigurationException
{
final DatabaseBuilderParameters params = helper.setUpDefaultParameters().setTable("configurationList");
final Configuration config1 = helper.createConfig(DatabaseConfiguration.class, params);
final Iterator<String> i = config1.getKeys();
assertTrue(i.hasNext());
final Object key = i.next();
assertEquals("key3",key.toString());
assertFalse(i.hasNext());
}
@Test
public void testClearSubset() throws ConfigurationException
{
final Configuration config = setUpConfig();
final Configuration subset = config.subset("key1");
subset.clear();
assertTrue("the subset is not empty", subset.isEmpty());
assertFalse("the parent configuration is empty", config.isEmpty());
}
/**
* Tests whether the configuration has already an error listener registered
* that is used for logging.
*/
@Test
public void testLogErrorListener() throws ConfigurationException
{
final DatabaseConfiguration config = helper.setUpConfig();
assertEquals("No error listener registered", 1, config
.getEventListeners(ConfigurationErrorEvent.ANY).size());
}
/**
* Tests handling of errors in getProperty().
*/
@Test
public void testGetPropertyError() throws ConfigurationException
{
setUpErrorConfig().getProperty("key1");
checkErrorListener(ConfigurationErrorEvent.READ,
ConfigurationErrorEvent.READ, "key1", null);
}
/**
* Tests handling of errors in addPropertyDirect().
*/
@Test
public void testAddPropertyError() throws ConfigurationException
{
setUpErrorConfig().addProperty("key1", "value");
checkErrorListener(ConfigurationErrorEvent.WRITE,
ConfigurationEvent.ADD_PROPERTY, "key1", "value");
}
/**
* Tests handling of errors in isEmpty().
*/
@Test
public void testIsEmptyError() throws ConfigurationException
{
assertTrue("Wrong return value for failure", setUpErrorConfig().isEmpty());
checkErrorListener(ConfigurationErrorEvent.READ,
ConfigurationErrorEvent.READ, null, null);
}
/**
* Tests handling of errors in containsKey().
*/
@Test
public void testContainsKeyError() throws ConfigurationException
{
assertFalse("Wrong return value for failure", setUpErrorConfig().containsKey("key1"));
checkErrorListener(ConfigurationErrorEvent.READ,
ConfigurationErrorEvent.READ, "key1", null);
}
/**
* Tests handling of errors in clearProperty().
*/
@Test
public void testClearPropertyError() throws ConfigurationException
{
setUpErrorConfig().clearProperty("key1");
checkErrorListener(ConfigurationErrorEvent.WRITE,
ConfigurationEvent.CLEAR_PROPERTY, "key1", null);
}
/**
* Tests handling of errors in clear().
*/
@Test
public void testClearError() throws ConfigurationException
{
setUpErrorConfig().clear();
checkErrorListener(ConfigurationErrorEvent.WRITE,
ConfigurationEvent.CLEAR, null, null);
}
/**
* Tests handling of errors in getKeys().
*/
@Test
public void testGetKeysError() throws ConfigurationException
{
final Iterator<String> it = setUpErrorConfig().getKeys();
checkErrorListener(ConfigurationErrorEvent.READ,
ConfigurationErrorEvent.READ, null, null);
assertFalse("Iteration is not empty", it.hasNext());
}
/**
* Tests obtaining a property as list whose value contains the list
* delimiter. Multiple values should be returned.
*/
@Test
public void testGetListWithDelimiter() throws ConfigurationException
{
final DatabaseConfiguration config = setUpConfig();
config.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));
final List<Object> values = config.getList("keyMulti");
assertEquals("Wrong number of list elements", 3, values.size());
assertEquals("Wrong list element 0", "a", values.get(0));
assertEquals("Wrong list element 2", "c", values.get(2));
}
/**
* Tests obtaining a property whose value contains the list delimiter when
* delimiter parsing is disabled.
*/
@Test
public void testGetListWithDelimiterParsingDisabled() throws ConfigurationException
{
final DatabaseConfiguration config = setUpConfig();
assertEquals("Wrong value of property", "a;b;c", config.getString("keyMulti"));
}
/**
* Tests adding a property containing the list delimiter. When this property
* is queried multiple values should be returned.
*/
@Test
public void testAddWithDelimiter() throws ConfigurationException
{
final DatabaseConfiguration config = setUpConfig();
config.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));
config.addProperty("keyList", "1;2;3");
final String[] values = config.getStringArray("keyList");
assertEquals("Wrong number of property values", 3, values.length);
assertEquals("Wrong value at index 1", "2", values[1]);
}
/**
* Tests setProperty() if the property value contains the list delimiter.
*/
@Test
public void testSetPropertyWithDelimiter() throws ConfigurationException
{
final DatabaseConfiguration config = helper.setUpMultiConfig();
config.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));
config.setProperty("keyList", "1;2;3");
final String[] values = config.getStringArray("keyList");
assertEquals("Wrong number of property values", 3, values.length);
assertEquals("Wrong value at index 1", "2", values[1]);
}
/**
* Tests whether a CLOB as a property value is handled correctly.
*/
@Test
public void testExtractPropertyValueCLOB() throws ConfigurationException,
SQLException
{
final ResultSet rs = EasyMock.createMock(ResultSet.class);
final Clob clob = EasyMock.createMock(Clob.class);
final String content = "This is the content of the test CLOB!";
EasyMock.expect(rs.getObject(DatabaseConfigurationTestHelper.COL_VALUE))
.andReturn(clob);
EasyMock.expect(clob.length())
.andReturn(Long.valueOf(content.length()));
EasyMock.expect(clob.getSubString(1, content.length())).andReturn(
content);
EasyMock.replay(rs, clob);
final DatabaseConfiguration config = helper.setUpConfig();
assertEquals("Wrong extracted value", content,
config.extractPropertyValue(rs));
EasyMock.verify(rs, clob);
}
/**
* Tests whether an empty CLOB is correctly handled by
* extractPropertyValue().
*/
@Test
public void testExtractPropertyValueCLOBEmpty()
throws ConfigurationException, SQLException
{
final ResultSet rs = EasyMock.createMock(ResultSet.class);
final Clob clob = EasyMock.createMock(Clob.class);
EasyMock.expect(rs.getObject(DatabaseConfigurationTestHelper.COL_VALUE))
.andReturn(clob);
EasyMock.expect(clob.length()).andReturn(0L);
EasyMock.replay(rs, clob);
final DatabaseConfiguration config = helper.setUpConfig();
assertEquals("Wrong extracted value", "",
config.extractPropertyValue(rs));
EasyMock.verify(rs, clob);
}
/**
* A specialized database configuration implementation that can be
* configured to throw an exception when obtaining a connection. This way
* database exceptions can be simulated.
*/
public static class PotentialErrorDatabaseConfiguration extends DatabaseConfiguration
{
/** A flag whether a getConnection() call should fail. */
boolean failOnConnect;
@Override
public DataSource getDatasource()
{
if (failOnConnect)
{
final DataSource ds = EasyMock.createMock(DataSource.class);
try
{
EasyMock.expect(ds.getConnection()).andThrow(
new SQLException("Simulated DB error"));
}
catch (final SQLException e)
{
// should not happen
throw new AssertionError("Unexpected exception!");
}
EasyMock.replay(ds);
return ds;
}
return super.getDatasource();
}
}
}
| {
"pile_set_name": "Github"
} |
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: floor backend 0 implementation
last mod: $Id$
********************************************************************/
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ogg/ogg.h>
#include "vorbis/codec.h"
#include "codec_internal.h"
#include "registry.h"
#include "lpc.h"
#include "lsp.h"
#include "codebook.h"
#include "scales.h"
#include "misc.h"
#include "os.h"
#include "misc.h"
#include <stdio.h>
typedef struct {
int ln;
int m;
int **linearmap;
int n[2];
vorbis_info_floor0 *vi;
long bits;
long frames;
} vorbis_look_floor0;
/***********************************************/
static void floor0_free_info(vorbis_info_floor *i){
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
if(info){
memset(info,0,sizeof(*info));
_ogg_free(info);
}
}
static void floor0_free_look(vorbis_look_floor *i){
vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
if(look){
if(look->linearmap){
if(look->linearmap[0])_ogg_free(look->linearmap[0]);
if(look->linearmap[1])_ogg_free(look->linearmap[1]);
_ogg_free(look->linearmap);
}
memset(look,0,sizeof(*look));
_ogg_free(look);
}
}
static vorbis_info_floor *floor0_unpack (vorbis_info *vi,oggpack_buffer *opb){
codec_setup_info *ci=vi->codec_setup;
int j;
vorbis_info_floor0 *info=_ogg_malloc(sizeof(*info));
info->order=oggpack_read(opb,8);
info->rate=oggpack_read(opb,16);
info->barkmap=oggpack_read(opb,16);
info->ampbits=oggpack_read(opb,6);
info->ampdB=oggpack_read(opb,8);
info->numbooks=oggpack_read(opb,4)+1;
if(info->order<1)goto err_out;
if(info->rate<1)goto err_out;
if(info->barkmap<1)goto err_out;
if(info->numbooks<1)goto err_out;
for(j=0;j<info->numbooks;j++){
info->books[j]=oggpack_read(opb,8);
if(info->books[j]<0 || info->books[j]>=ci->books)goto err_out;
if(ci->book_param[info->books[j]]->maptype==0)goto err_out;
if(ci->book_param[info->books[j]]->dim<1)goto err_out;
}
return(info);
err_out:
floor0_free_info(info);
return(NULL);
}
/* initialize Bark scale and normalization lookups. We could do this
with static tables, but Vorbis allows a number of possible
combinations, so it's best to do it computationally.
The below is authoritative in terms of defining scale mapping.
Note that the scale depends on the sampling rate as well as the
linear block and mapping sizes */
static void floor0_map_lazy_init(vorbis_block *vb,
vorbis_info_floor *infoX,
vorbis_look_floor0 *look){
if(!look->linearmap[vb->W]){
vorbis_dsp_state *vd=vb->vd;
vorbis_info *vi=vd->vi;
codec_setup_info *ci=vi->codec_setup;
vorbis_info_floor0 *info=(vorbis_info_floor0 *)infoX;
int W=vb->W;
int n=ci->blocksizes[W]/2,j;
/* we choose a scaling constant so that:
floor(bark(rate/2-1)*C)=mapped-1
floor(bark(rate/2)*C)=mapped */
float scale=look->ln/toBARK(info->rate/2.f);
/* the mapping from a linear scale to a smaller bark scale is
straightforward. We do *not* make sure that the linear mapping
does not skip bark-scale bins; the decoder simply skips them and
the encoder may do what it wishes in filling them. They're
necessary in some mapping combinations to keep the scale spacing
accurate */
look->linearmap[W]=_ogg_malloc((n+1)*sizeof(**look->linearmap));
for(j=0;j<n;j++){
int val=floor( toBARK((info->rate/2.f)/n*j)
*scale); /* bark numbers represent band edges */
if(val>=look->ln)val=look->ln-1; /* guard against the approximation */
look->linearmap[W][j]=val;
}
look->linearmap[W][j]=-1;
look->n[W]=n;
}
}
static vorbis_look_floor *floor0_look(vorbis_dsp_state *vd,
vorbis_info_floor *i){
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
vorbis_look_floor0 *look=_ogg_calloc(1,sizeof(*look));
(void)vd;
look->m=info->order;
look->ln=info->barkmap;
look->vi=info;
look->linearmap=_ogg_calloc(2,sizeof(*look->linearmap));
return look;
}
static void *floor0_inverse1(vorbis_block *vb,vorbis_look_floor *i){
vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
vorbis_info_floor0 *info=look->vi;
int j,k;
int ampraw=oggpack_read(&vb->opb,info->ampbits);
if(ampraw>0){ /* also handles the -1 out of data case */
long maxval=(1<<info->ampbits)-1;
float amp=(float)ampraw/maxval*info->ampdB;
int booknum=oggpack_read(&vb->opb,ov_ilog(info->numbooks));
if(booknum!=-1 && booknum<info->numbooks){ /* be paranoid */
codec_setup_info *ci=vb->vd->vi->codec_setup;
codebook *b=ci->fullbooks+info->books[booknum];
float last=0.f;
/* the additional b->dim is a guard against any possible stack
smash; b->dim is provably more than we can overflow the
vector */
float *lsp=_vorbis_block_alloc(vb,sizeof(*lsp)*(look->m+b->dim+1));
if(vorbis_book_decodev_set(b,lsp,&vb->opb,look->m)==-1)goto eop;
for(j=0;j<look->m;){
for(k=0;j<look->m && k<b->dim;k++,j++)lsp[j]+=last;
last=lsp[j-1];
}
lsp[look->m]=amp;
return(lsp);
}
}
eop:
return(NULL);
}
static int floor0_inverse2(vorbis_block *vb,vorbis_look_floor *i,
void *memo,float *out){
vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
vorbis_info_floor0 *info=look->vi;
floor0_map_lazy_init(vb,info,look);
if(memo){
float *lsp=(float *)memo;
float amp=lsp[look->m];
/* take the coefficients back to a spectral envelope curve */
vorbis_lsp_to_curve(out,
look->linearmap[vb->W],
look->n[vb->W],
look->ln,
lsp,look->m,amp,(float)info->ampdB);
return(1);
}
memset(out,0,sizeof(*out)*look->n[vb->W]);
return(0);
}
/* export hooks */
const vorbis_func_floor floor0_exportbundle={
NULL,&floor0_unpack,&floor0_look,&floor0_free_info,
&floor0_free_look,&floor0_inverse1,&floor0_inverse2
};
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (1.8.0_31) on Sun Feb 04 22:42:13 CST 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>类 cn.chenhaoxiang.utils.CookieUtil的使用 (sell 0.0.1-SNAPSHOT API)</title>
<meta name="date" content="2018-02-04">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="\u7C7B cn.chenhaoxiang.utils.CookieUtil\u7684\u4F7F\u7528 (sell 0.0.1-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>您的浏览器已禁用 JavaScript。</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="../package-summary.html">程序包</a></li>
<li><a href="../../../../cn/chenhaoxiang/utils/CookieUtil.html" title="cn.chenhaoxiang.utils中的类">类</a></li>
<li class="navBarCell1Rev">使用</li>
<li><a href="../package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>上一个</li>
<li>下一个</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?cn/chenhaoxiang/utils/class-use/CookieUtil.html" target="_top">框架</a></li>
<li><a href="CookieUtil.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="类的使用 cn.chenhaoxiang.utils.CookieUtil" class="title">类的使用<br>cn.chenhaoxiang.utils.CookieUtil</h2>
</div>
<div class="classUseContainer">没有cn.chenhaoxiang.utils.CookieUtil的用法</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="跳过导航链接">跳过导航链接</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="../../../../overview-summary.html">概览</a></li>
<li><a href="../package-summary.html">程序包</a></li>
<li><a href="../../../../cn/chenhaoxiang/utils/CookieUtil.html" title="cn.chenhaoxiang.utils中的类">类</a></li>
<li class="navBarCell1Rev">使用</li>
<li><a href="../package-tree.html">树</a></li>
<li><a href="../../../../deprecated-list.html">已过时</a></li>
<li><a href="../../../../index-all.html">索引</a></li>
<li><a href="../../../../help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>上一个</li>
<li>下一个</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?cn/chenhaoxiang/utils/class-use/CookieUtil.html" target="_top">框架</a></li>
<li><a href="CookieUtil.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2018 <a href="http://www.spring.io">Pivotal Software, Inc.</a>. All rights reserved.</small></p>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/* SPDX-License-Identifier: GPL-2.0-or-later */
/* PCI IRQ assignment */
#include "pci_irqs.asl"
/* PCR access */
#include <soc/intel/common/acpi/pcr.asl>
/* eMMC, SD Card */
#include "scs.asl"
/* GPIO controller */
#if CONFIG(SOC_INTEL_CANNONLAKE_PCH_H)
#include "gpio_cnp_h.asl"
#else
#include "gpio.asl"
#endif
/* GFX 00:02.0 */
#include "gfx.asl"
/* LPC 0:1f.0 */
#include <soc/intel/common/block/acpi/acpi/lpc.asl>
/* PCH HDA */
#include "pch_hda.asl"
/* PCIE Ports */
#include "pcie.asl"
/* Serial IO */
#include "serialio.asl"
/* SMBus 0:1f.4 */
#include "smbus.asl"
/* ISH 0:13.0 */
#include "ish.asl"
/* USB XHCI 0:14.0 */
#include "xhci.asl"
/* PCI _OSC */
#include <soc/intel/common/acpi/pci_osc.asl>
/* GBe 0:1f.6 */
#include "pch_glan.asl"
/* PMC Core */
#include <soc/intel/common/block/acpi/acpi/pmc.asl>
| {
"pile_set_name": "Github"
} |
#version 120
#ezquake-definitions
#ifdef DRAW_SKYBOX
uniform samplerCube skyTex;
#else
uniform sampler2D skyDomeTex;
uniform sampler2D skyDomeCloudTex;
#endif
uniform float skySpeedscale;
uniform float skySpeedscale2;
varying vec3 Direction;
void main()
{
#if defined(DRAW_SKYBOX)
gl_FragColor = textureCube(skyTex, Direction);
#else
const float len = 3.09375;
// Flatten it out
vec3 dir = normalize(vec3(Direction.x, Direction.y, 3 * Direction.z));
vec4 skyColor = texture2D(skyDomeTex, vec2(skySpeedscale + dir.x * len, skySpeedscale + dir.y * len));
vec4 cloudColor = texture2D(skyDomeCloudTex, vec2(skySpeedscale2 + dir.x * len, skySpeedscale2 + dir.y * len));
gl_FragColor = mix(skyColor, cloudColor, cloudColor.a);
#endif
}
| {
"pile_set_name": "Github"
} |
Core.HiddenElements
TYPE: lookup
--DEFAULT--
array (
'script' => true,
'style' => true,
)
--DESCRIPTION--
<p>
This directive is a lookup array of elements which should have their
contents removed when they are not allowed by the HTML definition.
For example, the contents of a <code>script</code> tag are not
normally shown in a document, so if script tags are to be removed,
their contents should be removed to. This is opposed to a <code>b</code>
tag, which defines some presentational changes but does not hide its
contents.
</p>
--# vim: et sw=4 sts=4
| {
"pile_set_name": "Github"
} |
14
charge = 0
O 1.040752 0.120302 0.145548
C 2.430190 0.064160 0.120726
C 3.143113 1.081049 1.010272
C 4.188381 0.000031 1.342503
C 3.146754 -1.063792 0.920944
C 3.576980 -2.247788 0.214460
N 3.917299 -3.169594 -0.385206
H 0.685251 -0.450271 -0.541318
H 2.824416 0.091934 -0.901951
H 2.517760 1.310123 1.875691
H 3.479836 2.009375 0.550975
H 4.559032 -0.060635 2.363999
H 5.033827 0.017282 0.654394
H 2.516420 -1.343777 1.768672 | {
"pile_set_name": "Github"
} |
'use strict';
var defaults = require('./../defaults');
var utils = require('./../utils');
var InterceptorManager = require('./InterceptorManager');
var dispatchRequest = require('./dispatchRequest');
var isAbsoluteURL = require('./../helpers/isAbsoluteURL');
var combineURLs = require('./../helpers/combineURLs');
/**
* Create a new instance of Axios
*
* @param {Object} instanceConfig The default config for the instance
*/
function Axios(instanceConfig) {
this.defaults = instanceConfig;
this.interceptors = {
request: new InterceptorManager(),
response: new InterceptorManager()
};
}
/**
* Dispatch a request
*
* @param {Object} config The config specific for this request (merged with this.defaults)
*/
Axios.prototype.request = function request(config) {
/*eslint no-param-reassign:0*/
// Allow for axios('example/url'[, config]) a la fetch API
if (typeof config === 'string') {
config = utils.merge({
url: arguments[0]
}, arguments[1]);
}
config = utils.merge(defaults, this.defaults, { method: 'get' }, config);
// Support baseURL config
if (config.baseURL && !isAbsoluteURL(config.url)) {
config.url = combineURLs(config.baseURL, config.url);
}
// Hook up interceptors middleware
var chain = [dispatchRequest, undefined];
var promise = Promise.resolve(config);
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
chain.unshift(interceptor.fulfilled, interceptor.rejected);
});
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
chain.push(interceptor.fulfilled, interceptor.rejected);
});
while (chain.length) {
promise = promise.then(chain.shift(), chain.shift());
}
return promise;
};
// Provide aliases for supported request methods
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, config) {
return this.request(utils.merge(config || {}, {
method: method,
url: url
}));
};
});
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, data, config) {
return this.request(utils.merge(config || {}, {
method: method,
url: url,
data: data
}));
};
});
module.exports = Axios;
| {
"pile_set_name": "Github"
} |
# sifter.js
[](https://www.npmjs.org/package/sifter)
[](https://www.npmjs.org/package/sifter)
[](https://travis-ci.org/brianreavis/sifter.js)
[](https://coveralls.io/r/brianreavis/sifter.js)
Sifter is a client and server-side library (via [UMD](https://github.com/umdjs/umd)) for textually searching arrays and hashes of objects by property – or multiple properties. It's designed specifically for autocomplete. The process is three-step: *score*, *filter*, *sort*.
* **Supports díåcritîçs.**<br>For example, if searching for "montana" and an item in the set has a value of "montaña", it will still be matched. Sorting will also play nicely with diacritics.
* **Smart scoring.**<br>Items are scored / sorted intelligently depending on where a match is found in the string (how close to the beginning) and what percentage of the string matches.
* **Multi-field sorting.**<br>When scores aren't enough to go by – like when getting results for an empty query – it can sort by one or more fields. For example, sort by a person's first name and last name without actually merging the properties to a single string.
* **Nested properties.**<br>Allows to search and sort on nested properties so you can perform search on complex objects without flattening them simply by using dot-notation to reference fields (ie. `nested.property`).
```sh
$ npm install sifter # node.js
$ bower install sifter # browser
```
## Usage
```js
var sifter = new Sifter([
{title: 'Annapurna I', location: 'Nepal', continent: 'Asia'},
{title: 'Annapurna II', location: 'Nepal', continent: 'Asia'},
{title: 'Annapurna III', location: 'Nepal', continent: 'Asia'},
{title: 'Eiger', location: 'Switzerland', continent: 'Europe'},
{title: 'Everest', location: 'Nepal', continent: 'Asia'},
{title: 'Gannett', location: 'Wyoming', continent: 'North America'},
{title: 'Denali', location: 'Alaska', continent: 'North America'}
]);
var result = sifter.search('anna', {
fields: ['title', 'location', 'continent'],
sort: [{field: 'title', direction: 'asc'}],
limit: 3
});
```
Seaching will provide back meta information and an "items" array that contains objects with the index (or key, if searching a hash) and a score that represents how good of a match the item was. Items that did not match will not be returned.
```
{"score": 0.2878787878787879, "id": 0},
{"score": 0.27777777777777773, "id": 1},
{"score": 0.2692307692307692, "id": 2}
```
Items are sorted by best-match, primarily. If two or more items have the same score (which will be the case when searching with an empty string), it will resort to the fields listed in the "sort" option.
The full result comes back in the format of:
```js
{
"options": {
"fields": ["title", "location", "continent"],
"sort": [
{"field": "title", "direction": "asc"}
],
"limit": 3
},
"query": "anna",
"tokens": [{
"string": "anna",
"regex": /[aÀÁÂÃÄÅàáâãäå][nÑñ][nÑñ][aÀÁÂÃÄÅàáâãäå]/
}],
"total": 3,
"items": [
{"score": 0.2878787878787879, "id": 0},
{"score": 0.27777777777777773, "id": 1},
{"score": 0.2692307692307692,"id": 2}
]
}
```
### API
#### #.search(query, options)
Performs a search for `query` with the provided `options`.
<table width="100%">
<tr>
<th align="left">Option</th>
<th align="left">Type</th>
<th align="left" width="100%">Description</th>
</tr>
<tr>
<td valign="top"><code>fields</code></td>
<td valign="top">array</td>
<td valign="top">An array of property names to be searched.</td>
</tr>
<tr>
<td valign="top"><code>limit</code></td>
<td valign="top">integer</td>
<td valign="top">The maximum number of results to return.</td>
</tr>
<tr>
<td valign="top"><code>sort</code></td>
<td valign="top">array</td>
<td valign="top">An array of fields to sort by. Each item should be an object containing at least a <code>"field"</code> property. Optionally, <code>direction</code> can be set to <code>"asc"</code> or <code>"desc"</code>. The order of the array defines the sort precedence.<br><br>Unless present, a special <code>"$score"</code> property will be automatically added to the beginning of the sort list. This will make results sorted primarily by match quality (descending).</td>
</tr>
<tr>
<td valign="top"><code>sort_empty</code></td>
<td valign="top">array</td>
<td valign="top">Optional. Defaults to "sort" setting. If provided, these sort settings are used when no query is present.</td>
</tr>
<tr>
<td valign="top"><code>filter</code></td>
<td valign="top">boolean</td>
<td valign="top">If <code>false</code>, items with a score of zero will <em>not</em> be filtered out of the result-set.</td>
</tr>
<tr>
<td valign="top"><code>conjunction</code></td>
<td valign="top">string</td>
<td valign="top">Determines how multiple search terms are joined (<code>"and"</code> or <code>"or"</code>, defaults to <code>"or"</code>).</td>
</tr>
<tr>
<td valign="top"><code>nesting</code></td>
<td valign="top">boolean</td>
<td valign="top">If <code>true</code>, nested fields will be available for search and sort using dot-notation to reference them (e.g. <code>nested.property</code>)<br><em>Warning: can reduce performance</em></td>
</tr>
</table>
## CLI

Sifter comes with a command line interface that's useful for testing on datasets. It accepts JSON and CSV data, either from a file or from stdin (unix pipes). If using CSV data, the first line of the file must be a header row.
```sh
$ npm install -g sifter
```
```sh
$ cat file.csv | sifter --query="ant" --fields=title
$ sifter --query="ant" --fields=title --file=file.csv
```
## Contributing
Install the dependencies that are required to build and test:
```sh
$ npm install
```
First build a copy with `make` then run the test suite with `make test`.
When issuing a pull request, please exclude "sifter.js" and "sifter.min.js" in the project root.
## License
Copyright © 2013–2015 [Brian Reavis](http://twitter.com/brianreavis) & [Contributors](https://github.com/brianreavis/sifter.js/graphs/contributors)
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.
| {
"pile_set_name": "Github"
} |
r600 0x9400
0x000287A0 R7xx_CB_SHADER_CONTROL
0x00028230 R7xx_PA_SC_EDGERULE
0x000286C8 R7xx_SPI_THREAD_GROUPING
0x00008D8C R7xx_SQ_DYN_GPR_CNTL_PS_FLUSH_REQ
0x00008490 CP_STRMOUT_CNTL
0x000085F0 CP_COHER_CNTL
0x000085F4 CP_COHER_SIZE
0x000088C4 VGT_CACHE_INVALIDATION
0x00028A50 VGT_ENHANCE
0x000088CC VGT_ES_PER_GS
0x00028A2C VGT_GROUP_DECR
0x00028A28 VGT_GROUP_FIRST_DECR
0x00028A24 VGT_GROUP_PRIM_TYPE
0x00028A30 VGT_GROUP_VECT_0_CNTL
0x00028A38 VGT_GROUP_VECT_0_FMT_CNTL
0x00028A34 VGT_GROUP_VECT_1_CNTL
0x00028A3C VGT_GROUP_VECT_1_FMT_CNTL
0x00028A40 VGT_GS_MODE
0x00028A6C VGT_GS_OUT_PRIM_TYPE
0x00028B38 VGT_GS_MAX_VERT_OUT
0x000088C8 VGT_GS_PER_ES
0x000088E8 VGT_GS_PER_VS
0x000088D4 VGT_GS_VERTEX_REUSE
0x00028A14 VGT_HOS_CNTL
0x00028A18 VGT_HOS_MAX_TESS_LEVEL
0x00028A1C VGT_HOS_MIN_TESS_LEVEL
0x00028A20 VGT_HOS_REUSE_DEPTH
0x0000895C VGT_INDEX_TYPE
0x00028408 VGT_INDX_OFFSET
0x00028AA0 VGT_INSTANCE_STEP_RATE_0
0x00028AA4 VGT_INSTANCE_STEP_RATE_1
0x00028400 VGT_MAX_VTX_INDX
0x00028404 VGT_MIN_VTX_INDX
0x00028A94 VGT_MULTI_PRIM_IB_RESET_EN
0x0002840C VGT_MULTI_PRIM_IB_RESET_INDX
0x00008970 VGT_NUM_INDICES
0x00008974 VGT_NUM_INSTANCES
0x00028A10 VGT_OUTPUT_PATH_CNTL
0x00028A84 VGT_PRIMITIVEID_EN
0x00008958 VGT_PRIMITIVE_TYPE
0x00028AB4 VGT_REUSE_OFF
0x00028AB8 VGT_VTX_CNT_EN
0x000088B0 VGT_VTX_VECT_EJECT_REG
0x00028AD4 VGT_STRMOUT_VTX_STRIDE_0
0x00028AE4 VGT_STRMOUT_VTX_STRIDE_1
0x00028AF4 VGT_STRMOUT_VTX_STRIDE_2
0x00028B04 VGT_STRMOUT_VTX_STRIDE_3
0x00028B28 VGT_STRMOUT_DRAW_OPAQUE_OFFSET
0x00028B2C VGT_STRMOUT_DRAW_OPAQUE_BUFFER_FILLED_SIZE
0x00028B30 VGT_STRMOUT_DRAW_OPAQUE_VERTEX_STRIDE
0x00028810 PA_CL_CLIP_CNTL
0x00008A14 PA_CL_ENHANCE
0x00028C14 PA_CL_GB_HORZ_CLIP_ADJ
0x00028C18 PA_CL_GB_HORZ_DISC_ADJ
0x00028C0C PA_CL_GB_VERT_CLIP_ADJ
0x00028C10 PA_CL_GB_VERT_DISC_ADJ
0x00028820 PA_CL_NANINF_CNTL
0x00028E1C PA_CL_POINT_CULL_RAD
0x00028E18 PA_CL_POINT_SIZE
0x00028E10 PA_CL_POINT_X_RAD
0x00028E14 PA_CL_POINT_Y_RAD
0x00028E2C PA_CL_UCP_0_W
0x00028E3C PA_CL_UCP_1_W
0x00028E4C PA_CL_UCP_2_W
0x00028E5C PA_CL_UCP_3_W
0x00028E6C PA_CL_UCP_4_W
0x00028E7C PA_CL_UCP_5_W
0x00028E20 PA_CL_UCP_0_X
0x00028E30 PA_CL_UCP_1_X
0x00028E40 PA_CL_UCP_2_X
0x00028E50 PA_CL_UCP_3_X
0x00028E60 PA_CL_UCP_4_X
0x00028E70 PA_CL_UCP_5_X
0x00028E24 PA_CL_UCP_0_Y
0x00028E34 PA_CL_UCP_1_Y
0x00028E44 PA_CL_UCP_2_Y
0x00028E54 PA_CL_UCP_3_Y
0x00028E64 PA_CL_UCP_4_Y
0x00028E74 PA_CL_UCP_5_Y
0x00028E28 PA_CL_UCP_0_Z
0x00028E38 PA_CL_UCP_1_Z
0x00028E48 PA_CL_UCP_2_Z
0x00028E58 PA_CL_UCP_3_Z
0x00028E68 PA_CL_UCP_4_Z
0x00028E78 PA_CL_UCP_5_Z
0x00028440 PA_CL_VPORT_XOFFSET_0
0x00028458 PA_CL_VPORT_XOFFSET_1
0x00028470 PA_CL_VPORT_XOFFSET_2
0x00028488 PA_CL_VPORT_XOFFSET_3
0x000284A0 PA_CL_VPORT_XOFFSET_4
0x000284B8 PA_CL_VPORT_XOFFSET_5
0x000284D0 PA_CL_VPORT_XOFFSET_6
0x000284E8 PA_CL_VPORT_XOFFSET_7
0x00028500 PA_CL_VPORT_XOFFSET_8
0x00028518 PA_CL_VPORT_XOFFSET_9
0x00028530 PA_CL_VPORT_XOFFSET_10
0x00028548 PA_CL_VPORT_XOFFSET_11
0x00028560 PA_CL_VPORT_XOFFSET_12
0x00028578 PA_CL_VPORT_XOFFSET_13
0x00028590 PA_CL_VPORT_XOFFSET_14
0x000285A8 PA_CL_VPORT_XOFFSET_15
0x0002843C PA_CL_VPORT_XSCALE_0
0x00028454 PA_CL_VPORT_XSCALE_1
0x0002846C PA_CL_VPORT_XSCALE_2
0x00028484 PA_CL_VPORT_XSCALE_3
0x0002849C PA_CL_VPORT_XSCALE_4
0x000284B4 PA_CL_VPORT_XSCALE_5
0x000284CC PA_CL_VPORT_XSCALE_6
0x000284E4 PA_CL_VPORT_XSCALE_7
0x000284FC PA_CL_VPORT_XSCALE_8
0x00028514 PA_CL_VPORT_XSCALE_9
0x0002852C PA_CL_VPORT_XSCALE_10
0x00028544 PA_CL_VPORT_XSCALE_11
0x0002855C PA_CL_VPORT_XSCALE_12
0x00028574 PA_CL_VPORT_XSCALE_13
0x0002858C PA_CL_VPORT_XSCALE_14
0x000285A4 PA_CL_VPORT_XSCALE_15
0x00028448 PA_CL_VPORT_YOFFSET_0
0x00028460 PA_CL_VPORT_YOFFSET_1
0x00028478 PA_CL_VPORT_YOFFSET_2
0x00028490 PA_CL_VPORT_YOFFSET_3
0x000284A8 PA_CL_VPORT_YOFFSET_4
0x000284C0 PA_CL_VPORT_YOFFSET_5
0x000284D8 PA_CL_VPORT_YOFFSET_6
0x000284F0 PA_CL_VPORT_YOFFSET_7
0x00028508 PA_CL_VPORT_YOFFSET_8
0x00028520 PA_CL_VPORT_YOFFSET_9
0x00028538 PA_CL_VPORT_YOFFSET_10
0x00028550 PA_CL_VPORT_YOFFSET_11
0x00028568 PA_CL_VPORT_YOFFSET_12
0x00028580 PA_CL_VPORT_YOFFSET_13
0x00028598 PA_CL_VPORT_YOFFSET_14
0x000285B0 PA_CL_VPORT_YOFFSET_15
0x00028444 PA_CL_VPORT_YSCALE_0
0x0002845C PA_CL_VPORT_YSCALE_1
0x00028474 PA_CL_VPORT_YSCALE_2
0x0002848C PA_CL_VPORT_YSCALE_3
0x000284A4 PA_CL_VPORT_YSCALE_4
0x000284BC PA_CL_VPORT_YSCALE_5
0x000284D4 PA_CL_VPORT_YSCALE_6
0x000284EC PA_CL_VPORT_YSCALE_7
0x00028504 PA_CL_VPORT_YSCALE_8
0x0002851C PA_CL_VPORT_YSCALE_9
0x00028534 PA_CL_VPORT_YSCALE_10
0x0002854C PA_CL_VPORT_YSCALE_11
0x00028564 PA_CL_VPORT_YSCALE_12
0x0002857C PA_CL_VPORT_YSCALE_13
0x00028594 PA_CL_VPORT_YSCALE_14
0x000285AC PA_CL_VPORT_YSCALE_15
0x00028450 PA_CL_VPORT_ZOFFSET_0
0x00028468 PA_CL_VPORT_ZOFFSET_1
0x00028480 PA_CL_VPORT_ZOFFSET_2
0x00028498 PA_CL_VPORT_ZOFFSET_3
0x000284B0 PA_CL_VPORT_ZOFFSET_4
0x000284C8 PA_CL_VPORT_ZOFFSET_5
0x000284E0 PA_CL_VPORT_ZOFFSET_6
0x000284F8 PA_CL_VPORT_ZOFFSET_7
0x00028510 PA_CL_VPORT_ZOFFSET_8
0x00028528 PA_CL_VPORT_ZOFFSET_9
0x00028540 PA_CL_VPORT_ZOFFSET_10
0x00028558 PA_CL_VPORT_ZOFFSET_11
0x00028570 PA_CL_VPORT_ZOFFSET_12
0x00028588 PA_CL_VPORT_ZOFFSET_13
0x000285A0 PA_CL_VPORT_ZOFFSET_14
0x000285B8 PA_CL_VPORT_ZOFFSET_15
0x0002844C PA_CL_VPORT_ZSCALE_0
0x00028464 PA_CL_VPORT_ZSCALE_1
0x0002847C PA_CL_VPORT_ZSCALE_2
0x00028494 PA_CL_VPORT_ZSCALE_3
0x000284AC PA_CL_VPORT_ZSCALE_4
0x000284C4 PA_CL_VPORT_ZSCALE_5
0x000284DC PA_CL_VPORT_ZSCALE_6
0x000284F4 PA_CL_VPORT_ZSCALE_7
0x0002850C PA_CL_VPORT_ZSCALE_8
0x00028524 PA_CL_VPORT_ZSCALE_9
0x0002853C PA_CL_VPORT_ZSCALE_10
0x00028554 PA_CL_VPORT_ZSCALE_11
0x0002856C PA_CL_VPORT_ZSCALE_12
0x00028584 PA_CL_VPORT_ZSCALE_13
0x0002859C PA_CL_VPORT_ZSCALE_14
0x000285B4 PA_CL_VPORT_ZSCALE_15
0x0002881C PA_CL_VS_OUT_CNTL
0x00028818 PA_CL_VTE_CNTL
0x00028C48 PA_SC_AA_MASK
0x00008B40 PA_SC_AA_SAMPLE_LOCS_2S
0x00008B44 PA_SC_AA_SAMPLE_LOCS_4S
0x00008B48 PA_SC_AA_SAMPLE_LOCS_8S_WD0
0x00008B4C PA_SC_AA_SAMPLE_LOCS_8S_WD1
0x00028C20 PA_SC_AA_SAMPLE_LOCS_8S_WD1_MCTX
0x00028C1C PA_SC_AA_SAMPLE_LOCS_MCTX
0x00028214 PA_SC_CLIPRECT_0_BR
0x0002821C PA_SC_CLIPRECT_1_BR
0x00028224 PA_SC_CLIPRECT_2_BR
0x0002822C PA_SC_CLIPRECT_3_BR
0x00028210 PA_SC_CLIPRECT_0_TL
0x00028218 PA_SC_CLIPRECT_1_TL
0x00028220 PA_SC_CLIPRECT_2_TL
0x00028228 PA_SC_CLIPRECT_3_TL
0x0002820C PA_SC_CLIPRECT_RULE
0x00008BF0 PA_SC_ENHANCE
0x00028244 PA_SC_GENERIC_SCISSOR_BR
0x00028240 PA_SC_GENERIC_SCISSOR_TL
0x00028C00 PA_SC_LINE_CNTL
0x00028A0C PA_SC_LINE_STIPPLE
0x00008B10 PA_SC_LINE_STIPPLE_STATE
0x00028A4C PA_SC_MODE_CNTL
0x00028A48 PA_SC_MPASS_PS_CNTL
0x00008B20 PA_SC_MULTI_CHIP_CNTL
0x00028034 PA_SC_SCREEN_SCISSOR_BR
0x00028030 PA_SC_SCREEN_SCISSOR_TL
0x00028254 PA_SC_VPORT_SCISSOR_0_BR
0x0002825C PA_SC_VPORT_SCISSOR_1_BR
0x00028264 PA_SC_VPORT_SCISSOR_2_BR
0x0002826C PA_SC_VPORT_SCISSOR_3_BR
0x00028274 PA_SC_VPORT_SCISSOR_4_BR
0x0002827C PA_SC_VPORT_SCISSOR_5_BR
0x00028284 PA_SC_VPORT_SCISSOR_6_BR
0x0002828C PA_SC_VPORT_SCISSOR_7_BR
0x00028294 PA_SC_VPORT_SCISSOR_8_BR
0x0002829C PA_SC_VPORT_SCISSOR_9_BR
0x000282A4 PA_SC_VPORT_SCISSOR_10_BR
0x000282AC PA_SC_VPORT_SCISSOR_11_BR
0x000282B4 PA_SC_VPORT_SCISSOR_12_BR
0x000282BC PA_SC_VPORT_SCISSOR_13_BR
0x000282C4 PA_SC_VPORT_SCISSOR_14_BR
0x000282CC PA_SC_VPORT_SCISSOR_15_BR
0x00028250 PA_SC_VPORT_SCISSOR_0_TL
0x00028258 PA_SC_VPORT_SCISSOR_1_TL
0x00028260 PA_SC_VPORT_SCISSOR_2_TL
0x00028268 PA_SC_VPORT_SCISSOR_3_TL
0x00028270 PA_SC_VPORT_SCISSOR_4_TL
0x00028278 PA_SC_VPORT_SCISSOR_5_TL
0x00028280 PA_SC_VPORT_SCISSOR_6_TL
0x00028288 PA_SC_VPORT_SCISSOR_7_TL
0x00028290 PA_SC_VPORT_SCISSOR_8_TL
0x00028298 PA_SC_VPORT_SCISSOR_9_TL
0x000282A0 PA_SC_VPORT_SCISSOR_10_TL
0x000282A8 PA_SC_VPORT_SCISSOR_11_TL
0x000282B0 PA_SC_VPORT_SCISSOR_12_TL
0x000282B8 PA_SC_VPORT_SCISSOR_13_TL
0x000282C0 PA_SC_VPORT_SCISSOR_14_TL
0x000282C8 PA_SC_VPORT_SCISSOR_15_TL
0x000282D4 PA_SC_VPORT_ZMAX_0
0x000282DC PA_SC_VPORT_ZMAX_1
0x000282E4 PA_SC_VPORT_ZMAX_2
0x000282EC PA_SC_VPORT_ZMAX_3
0x000282F4 PA_SC_VPORT_ZMAX_4
0x000282FC PA_SC_VPORT_ZMAX_5
0x00028304 PA_SC_VPORT_ZMAX_6
0x0002830C PA_SC_VPORT_ZMAX_7
0x00028314 PA_SC_VPORT_ZMAX_8
0x0002831C PA_SC_VPORT_ZMAX_9
0x00028324 PA_SC_VPORT_ZMAX_10
0x0002832C PA_SC_VPORT_ZMAX_11
0x00028334 PA_SC_VPORT_ZMAX_12
0x0002833C PA_SC_VPORT_ZMAX_13
0x00028344 PA_SC_VPORT_ZMAX_14
0x0002834C PA_SC_VPORT_ZMAX_15
0x000282D0 PA_SC_VPORT_ZMIN_0
0x000282D8 PA_SC_VPORT_ZMIN_1
0x000282E0 PA_SC_VPORT_ZMIN_2
0x000282E8 PA_SC_VPORT_ZMIN_3
0x000282F0 PA_SC_VPORT_ZMIN_4
0x000282F8 PA_SC_VPORT_ZMIN_5
0x00028300 PA_SC_VPORT_ZMIN_6
0x00028308 PA_SC_VPORT_ZMIN_7
0x00028310 PA_SC_VPORT_ZMIN_8
0x00028318 PA_SC_VPORT_ZMIN_9
0x00028320 PA_SC_VPORT_ZMIN_10
0x00028328 PA_SC_VPORT_ZMIN_11
0x00028330 PA_SC_VPORT_ZMIN_12
0x00028338 PA_SC_VPORT_ZMIN_13
0x00028340 PA_SC_VPORT_ZMIN_14
0x00028348 PA_SC_VPORT_ZMIN_15
0x00028200 PA_SC_WINDOW_OFFSET
0x00028208 PA_SC_WINDOW_SCISSOR_BR
0x00028204 PA_SC_WINDOW_SCISSOR_TL
0x00028A08 PA_SU_LINE_CNTL
0x00028A04 PA_SU_POINT_MINMAX
0x00028A00 PA_SU_POINT_SIZE
0x00028E0C PA_SU_POLY_OFFSET_BACK_OFFSET
0x00028E08 PA_SU_POLY_OFFSET_BACK_SCALE
0x00028DFC PA_SU_POLY_OFFSET_CLAMP
0x00028DF8 PA_SU_POLY_OFFSET_DB_FMT_CNTL
0x00028E04 PA_SU_POLY_OFFSET_FRONT_OFFSET
0x00028E00 PA_SU_POLY_OFFSET_FRONT_SCALE
0x00028814 PA_SU_SC_MODE_CNTL
0x00028C08 PA_SU_VTX_CNTL
0x00008C04 SQ_GPR_RESOURCE_MGMT_1
0x00008C08 SQ_GPR_RESOURCE_MGMT_2
0x00008C10 SQ_STACK_RESOURCE_MGMT_1
0x00008C14 SQ_STACK_RESOURCE_MGMT_2
0x00008C0C SQ_THREAD_RESOURCE_MGMT
0x00028380 SQ_VTX_SEMANTIC_0
0x00028384 SQ_VTX_SEMANTIC_1
0x00028388 SQ_VTX_SEMANTIC_2
0x0002838C SQ_VTX_SEMANTIC_3
0x00028390 SQ_VTX_SEMANTIC_4
0x00028394 SQ_VTX_SEMANTIC_5
0x00028398 SQ_VTX_SEMANTIC_6
0x0002839C SQ_VTX_SEMANTIC_7
0x000283A0 SQ_VTX_SEMANTIC_8
0x000283A4 SQ_VTX_SEMANTIC_9
0x000283A8 SQ_VTX_SEMANTIC_10
0x000283AC SQ_VTX_SEMANTIC_11
0x000283B0 SQ_VTX_SEMANTIC_12
0x000283B4 SQ_VTX_SEMANTIC_13
0x000283B8 SQ_VTX_SEMANTIC_14
0x000283BC SQ_VTX_SEMANTIC_15
0x000283C0 SQ_VTX_SEMANTIC_16
0x000283C4 SQ_VTX_SEMANTIC_17
0x000283C8 SQ_VTX_SEMANTIC_18
0x000283CC SQ_VTX_SEMANTIC_19
0x000283D0 SQ_VTX_SEMANTIC_20
0x000283D4 SQ_VTX_SEMANTIC_21
0x000283D8 SQ_VTX_SEMANTIC_22
0x000283DC SQ_VTX_SEMANTIC_23
0x000283E0 SQ_VTX_SEMANTIC_24
0x000283E4 SQ_VTX_SEMANTIC_25
0x000283E8 SQ_VTX_SEMANTIC_26
0x000283EC SQ_VTX_SEMANTIC_27
0x000283F0 SQ_VTX_SEMANTIC_28
0x000283F4 SQ_VTX_SEMANTIC_29
0x000283F8 SQ_VTX_SEMANTIC_30
0x000283FC SQ_VTX_SEMANTIC_31
0x000288E0 SQ_VTX_SEMANTIC_CLEAR
0x0003CFF4 SQ_VTX_START_INST_LOC
0x000281C0 SQ_ALU_CONST_BUFFER_SIZE_GS_0
0x000281C4 SQ_ALU_CONST_BUFFER_SIZE_GS_1
0x000281C8 SQ_ALU_CONST_BUFFER_SIZE_GS_2
0x000281CC SQ_ALU_CONST_BUFFER_SIZE_GS_3
0x000281D0 SQ_ALU_CONST_BUFFER_SIZE_GS_4
0x000281D4 SQ_ALU_CONST_BUFFER_SIZE_GS_5
0x000281D8 SQ_ALU_CONST_BUFFER_SIZE_GS_6
0x000281DC SQ_ALU_CONST_BUFFER_SIZE_GS_7
0x000281E0 SQ_ALU_CONST_BUFFER_SIZE_GS_8
0x000281E4 SQ_ALU_CONST_BUFFER_SIZE_GS_9
0x000281E8 SQ_ALU_CONST_BUFFER_SIZE_GS_10
0x000281EC SQ_ALU_CONST_BUFFER_SIZE_GS_11
0x000281F0 SQ_ALU_CONST_BUFFER_SIZE_GS_12
0x000281F4 SQ_ALU_CONST_BUFFER_SIZE_GS_13
0x000281F8 SQ_ALU_CONST_BUFFER_SIZE_GS_14
0x000281FC SQ_ALU_CONST_BUFFER_SIZE_GS_15
0x00028140 SQ_ALU_CONST_BUFFER_SIZE_PS_0
0x00028144 SQ_ALU_CONST_BUFFER_SIZE_PS_1
0x00028148 SQ_ALU_CONST_BUFFER_SIZE_PS_2
0x0002814C SQ_ALU_CONST_BUFFER_SIZE_PS_3
0x00028150 SQ_ALU_CONST_BUFFER_SIZE_PS_4
0x00028154 SQ_ALU_CONST_BUFFER_SIZE_PS_5
0x00028158 SQ_ALU_CONST_BUFFER_SIZE_PS_6
0x0002815C SQ_ALU_CONST_BUFFER_SIZE_PS_7
0x00028160 SQ_ALU_CONST_BUFFER_SIZE_PS_8
0x00028164 SQ_ALU_CONST_BUFFER_SIZE_PS_9
0x00028168 SQ_ALU_CONST_BUFFER_SIZE_PS_10
0x0002816C SQ_ALU_CONST_BUFFER_SIZE_PS_11
0x00028170 SQ_ALU_CONST_BUFFER_SIZE_PS_12
0x00028174 SQ_ALU_CONST_BUFFER_SIZE_PS_13
0x00028178 SQ_ALU_CONST_BUFFER_SIZE_PS_14
0x0002817C SQ_ALU_CONST_BUFFER_SIZE_PS_15
0x00028180 SQ_ALU_CONST_BUFFER_SIZE_VS_0
0x00028184 SQ_ALU_CONST_BUFFER_SIZE_VS_1
0x00028188 SQ_ALU_CONST_BUFFER_SIZE_VS_2
0x0002818C SQ_ALU_CONST_BUFFER_SIZE_VS_3
0x00028190 SQ_ALU_CONST_BUFFER_SIZE_VS_4
0x00028194 SQ_ALU_CONST_BUFFER_SIZE_VS_5
0x00028198 SQ_ALU_CONST_BUFFER_SIZE_VS_6
0x0002819C SQ_ALU_CONST_BUFFER_SIZE_VS_7
0x000281A0 SQ_ALU_CONST_BUFFER_SIZE_VS_8
0x000281A4 SQ_ALU_CONST_BUFFER_SIZE_VS_9
0x000281A8 SQ_ALU_CONST_BUFFER_SIZE_VS_10
0x000281AC SQ_ALU_CONST_BUFFER_SIZE_VS_11
0x000281B0 SQ_ALU_CONST_BUFFER_SIZE_VS_12
0x000281B4 SQ_ALU_CONST_BUFFER_SIZE_VS_13
0x000281B8 SQ_ALU_CONST_BUFFER_SIZE_VS_14
0x000281BC SQ_ALU_CONST_BUFFER_SIZE_VS_15
0x000288D8 SQ_PGM_CF_OFFSET_ES
0x000288DC SQ_PGM_CF_OFFSET_FS
0x000288D4 SQ_PGM_CF_OFFSET_GS
0x000288CC SQ_PGM_CF_OFFSET_PS
0x000288D0 SQ_PGM_CF_OFFSET_VS
0x00028854 SQ_PGM_EXPORTS_PS
0x00028890 SQ_PGM_RESOURCES_ES
0x000288A4 SQ_PGM_RESOURCES_FS
0x0002887C SQ_PGM_RESOURCES_GS
0x00028850 SQ_PGM_RESOURCES_PS
0x00028868 SQ_PGM_RESOURCES_VS
0x00009100 SPI_CONFIG_CNTL
0x0000913C SPI_CONFIG_CNTL_1
0x000286DC SPI_FOG_CNTL
0x000286E4 SPI_FOG_FUNC_BIAS
0x000286E0 SPI_FOG_FUNC_SCALE
0x000286D8 SPI_INPUT_Z
0x000286D4 SPI_INTERP_CONTROL_0
0x00028644 SPI_PS_INPUT_CNTL_0
0x00028648 SPI_PS_INPUT_CNTL_1
0x0002864C SPI_PS_INPUT_CNTL_2
0x00028650 SPI_PS_INPUT_CNTL_3
0x00028654 SPI_PS_INPUT_CNTL_4
0x00028658 SPI_PS_INPUT_CNTL_5
0x0002865C SPI_PS_INPUT_CNTL_6
0x00028660 SPI_PS_INPUT_CNTL_7
0x00028664 SPI_PS_INPUT_CNTL_8
0x00028668 SPI_PS_INPUT_CNTL_9
0x0002866C SPI_PS_INPUT_CNTL_10
0x00028670 SPI_PS_INPUT_CNTL_11
0x00028674 SPI_PS_INPUT_CNTL_12
0x00028678 SPI_PS_INPUT_CNTL_13
0x0002867C SPI_PS_INPUT_CNTL_14
0x00028680 SPI_PS_INPUT_CNTL_15
0x00028684 SPI_PS_INPUT_CNTL_16
0x00028688 SPI_PS_INPUT_CNTL_17
0x0002868C SPI_PS_INPUT_CNTL_18
0x00028690 SPI_PS_INPUT_CNTL_19
0x00028694 SPI_PS_INPUT_CNTL_20
0x00028698 SPI_PS_INPUT_CNTL_21
0x0002869C SPI_PS_INPUT_CNTL_22
0x000286A0 SPI_PS_INPUT_CNTL_23
0x000286A4 SPI_PS_INPUT_CNTL_24
0x000286A8 SPI_PS_INPUT_CNTL_25
0x000286AC SPI_PS_INPUT_CNTL_26
0x000286B0 SPI_PS_INPUT_CNTL_27
0x000286B4 SPI_PS_INPUT_CNTL_28
0x000286B8 SPI_PS_INPUT_CNTL_29
0x000286BC SPI_PS_INPUT_CNTL_30
0x000286C0 SPI_PS_INPUT_CNTL_31
0x000286CC SPI_PS_IN_CONTROL_0
0x000286D0 SPI_PS_IN_CONTROL_1
0x000286C4 SPI_VS_OUT_CONFIG
0x00028614 SPI_VS_OUT_ID_0
0x00028618 SPI_VS_OUT_ID_1
0x0002861C SPI_VS_OUT_ID_2
0x00028620 SPI_VS_OUT_ID_3
0x00028624 SPI_VS_OUT_ID_4
0x00028628 SPI_VS_OUT_ID_5
0x0002862C SPI_VS_OUT_ID_6
0x00028630 SPI_VS_OUT_ID_7
0x00028634 SPI_VS_OUT_ID_8
0x00028638 SPI_VS_OUT_ID_9
0x00028438 SX_ALPHA_REF
0x00028410 SX_ALPHA_TEST_CONTROL
0x00028354 SX_SURFACE_SYNC
0x00009014 SX_MEMORY_EXPORT_SIZE
0x00009604 TC_INVALIDATE
0x00009400 TD_FILTER4
0x00009404 TD_FILTER4_1
0x00009408 TD_FILTER4_2
0x0000940C TD_FILTER4_3
0x00009410 TD_FILTER4_4
0x00009414 TD_FILTER4_5
0x00009418 TD_FILTER4_6
0x0000941C TD_FILTER4_7
0x00009420 TD_FILTER4_8
0x00009424 TD_FILTER4_9
0x00009428 TD_FILTER4_10
0x0000942C TD_FILTER4_11
0x00009430 TD_FILTER4_12
0x00009434 TD_FILTER4_13
0x00009438 TD_FILTER4_14
0x0000943C TD_FILTER4_15
0x00009440 TD_FILTER4_16
0x00009444 TD_FILTER4_17
0x00009448 TD_FILTER4_18
0x0000944C TD_FILTER4_19
0x00009450 TD_FILTER4_20
0x00009454 TD_FILTER4_21
0x00009458 TD_FILTER4_22
0x0000945C TD_FILTER4_23
0x00009460 TD_FILTER4_24
0x00009464 TD_FILTER4_25
0x00009468 TD_FILTER4_26
0x0000946C TD_FILTER4_27
0x00009470 TD_FILTER4_28
0x00009474 TD_FILTER4_29
0x00009478 TD_FILTER4_30
0x0000947C TD_FILTER4_31
0x00009480 TD_FILTER4_32
0x00009484 TD_FILTER4_33
0x00009488 TD_FILTER4_34
0x0000948C TD_FILTER4_35
0x0000A80C TD_GS_SAMPLER0_BORDER_ALPHA
0x0000A81C TD_GS_SAMPLER1_BORDER_ALPHA
0x0000A82C TD_GS_SAMPLER2_BORDER_ALPHA
0x0000A83C TD_GS_SAMPLER3_BORDER_ALPHA
0x0000A84C TD_GS_SAMPLER4_BORDER_ALPHA
0x0000A85C TD_GS_SAMPLER5_BORDER_ALPHA
0x0000A86C TD_GS_SAMPLER6_BORDER_ALPHA
0x0000A87C TD_GS_SAMPLER7_BORDER_ALPHA
0x0000A88C TD_GS_SAMPLER8_BORDER_ALPHA
0x0000A89C TD_GS_SAMPLER9_BORDER_ALPHA
0x0000A8AC TD_GS_SAMPLER10_BORDER_ALPHA
0x0000A8BC TD_GS_SAMPLER11_BORDER_ALPHA
0x0000A8CC TD_GS_SAMPLER12_BORDER_ALPHA
0x0000A8DC TD_GS_SAMPLER13_BORDER_ALPHA
0x0000A8EC TD_GS_SAMPLER14_BORDER_ALPHA
0x0000A8FC TD_GS_SAMPLER15_BORDER_ALPHA
0x0000A90C TD_GS_SAMPLER16_BORDER_ALPHA
0x0000A91C TD_GS_SAMPLER17_BORDER_ALPHA
0x0000A808 TD_GS_SAMPLER0_BORDER_BLUE
0x0000A818 TD_GS_SAMPLER1_BORDER_BLUE
0x0000A828 TD_GS_SAMPLER2_BORDER_BLUE
0x0000A838 TD_GS_SAMPLER3_BORDER_BLUE
0x0000A848 TD_GS_SAMPLER4_BORDER_BLUE
0x0000A858 TD_GS_SAMPLER5_BORDER_BLUE
0x0000A868 TD_GS_SAMPLER6_BORDER_BLUE
0x0000A878 TD_GS_SAMPLER7_BORDER_BLUE
0x0000A888 TD_GS_SAMPLER8_BORDER_BLUE
0x0000A898 TD_GS_SAMPLER9_BORDER_BLUE
0x0000A8A8 TD_GS_SAMPLER10_BORDER_BLUE
0x0000A8B8 TD_GS_SAMPLER11_BORDER_BLUE
0x0000A8C8 TD_GS_SAMPLER12_BORDER_BLUE
0x0000A8D8 TD_GS_SAMPLER13_BORDER_BLUE
0x0000A8E8 TD_GS_SAMPLER14_BORDER_BLUE
0x0000A8F8 TD_GS_SAMPLER15_BORDER_BLUE
0x0000A908 TD_GS_SAMPLER16_BORDER_BLUE
0x0000A918 TD_GS_SAMPLER17_BORDER_BLUE
0x0000A804 TD_GS_SAMPLER0_BORDER_GREEN
0x0000A814 TD_GS_SAMPLER1_BORDER_GREEN
0x0000A824 TD_GS_SAMPLER2_BORDER_GREEN
0x0000A834 TD_GS_SAMPLER3_BORDER_GREEN
0x0000A844 TD_GS_SAMPLER4_BORDER_GREEN
0x0000A854 TD_GS_SAMPLER5_BORDER_GREEN
0x0000A864 TD_GS_SAMPLER6_BORDER_GREEN
0x0000A874 TD_GS_SAMPLER7_BORDER_GREEN
0x0000A884 TD_GS_SAMPLER8_BORDER_GREEN
0x0000A894 TD_GS_SAMPLER9_BORDER_GREEN
0x0000A8A4 TD_GS_SAMPLER10_BORDER_GREEN
0x0000A8B4 TD_GS_SAMPLER11_BORDER_GREEN
0x0000A8C4 TD_GS_SAMPLER12_BORDER_GREEN
0x0000A8D4 TD_GS_SAMPLER13_BORDER_GREEN
0x0000A8E4 TD_GS_SAMPLER14_BORDER_GREEN
0x0000A8F4 TD_GS_SAMPLER15_BORDER_GREEN
0x0000A904 TD_GS_SAMPLER16_BORDER_GREEN
0x0000A914 TD_GS_SAMPLER17_BORDER_GREEN
0x0000A800 TD_GS_SAMPLER0_BORDER_RED
0x0000A810 TD_GS_SAMPLER1_BORDER_RED
0x0000A820 TD_GS_SAMPLER2_BORDER_RED
0x0000A830 TD_GS_SAMPLER3_BORDER_RED
0x0000A840 TD_GS_SAMPLER4_BORDER_RED
0x0000A850 TD_GS_SAMPLER5_BORDER_RED
0x0000A860 TD_GS_SAMPLER6_BORDER_RED
0x0000A870 TD_GS_SAMPLER7_BORDER_RED
0x0000A880 TD_GS_SAMPLER8_BORDER_RED
0x0000A890 TD_GS_SAMPLER9_BORDER_RED
0x0000A8A0 TD_GS_SAMPLER10_BORDER_RED
0x0000A8B0 TD_GS_SAMPLER11_BORDER_RED
0x0000A8C0 TD_GS_SAMPLER12_BORDER_RED
0x0000A8D0 TD_GS_SAMPLER13_BORDER_RED
0x0000A8E0 TD_GS_SAMPLER14_BORDER_RED
0x0000A8F0 TD_GS_SAMPLER15_BORDER_RED
0x0000A900 TD_GS_SAMPLER16_BORDER_RED
0x0000A910 TD_GS_SAMPLER17_BORDER_RED
0x0000A40C TD_PS_SAMPLER0_BORDER_ALPHA
0x0000A41C TD_PS_SAMPLER1_BORDER_ALPHA
0x0000A42C TD_PS_SAMPLER2_BORDER_ALPHA
0x0000A43C TD_PS_SAMPLER3_BORDER_ALPHA
0x0000A44C TD_PS_SAMPLER4_BORDER_ALPHA
0x0000A45C TD_PS_SAMPLER5_BORDER_ALPHA
0x0000A46C TD_PS_SAMPLER6_BORDER_ALPHA
0x0000A47C TD_PS_SAMPLER7_BORDER_ALPHA
0x0000A48C TD_PS_SAMPLER8_BORDER_ALPHA
0x0000A49C TD_PS_SAMPLER9_BORDER_ALPHA
0x0000A4AC TD_PS_SAMPLER10_BORDER_ALPHA
0x0000A4BC TD_PS_SAMPLER11_BORDER_ALPHA
0x0000A4CC TD_PS_SAMPLER12_BORDER_ALPHA
0x0000A4DC TD_PS_SAMPLER13_BORDER_ALPHA
0x0000A4EC TD_PS_SAMPLER14_BORDER_ALPHA
0x0000A4FC TD_PS_SAMPLER15_BORDER_ALPHA
0x0000A50C TD_PS_SAMPLER16_BORDER_ALPHA
0x0000A51C TD_PS_SAMPLER17_BORDER_ALPHA
0x0000A408 TD_PS_SAMPLER0_BORDER_BLUE
0x0000A418 TD_PS_SAMPLER1_BORDER_BLUE
0x0000A428 TD_PS_SAMPLER2_BORDER_BLUE
0x0000A438 TD_PS_SAMPLER3_BORDER_BLUE
0x0000A448 TD_PS_SAMPLER4_BORDER_BLUE
0x0000A458 TD_PS_SAMPLER5_BORDER_BLUE
0x0000A468 TD_PS_SAMPLER6_BORDER_BLUE
0x0000A478 TD_PS_SAMPLER7_BORDER_BLUE
0x0000A488 TD_PS_SAMPLER8_BORDER_BLUE
0x0000A498 TD_PS_SAMPLER9_BORDER_BLUE
0x0000A4A8 TD_PS_SAMPLER10_BORDER_BLUE
0x0000A4B8 TD_PS_SAMPLER11_BORDER_BLUE
0x0000A4C8 TD_PS_SAMPLER12_BORDER_BLUE
0x0000A4D8 TD_PS_SAMPLER13_BORDER_BLUE
0x0000A4E8 TD_PS_SAMPLER14_BORDER_BLUE
0x0000A4F8 TD_PS_SAMPLER15_BORDER_BLUE
0x0000A508 TD_PS_SAMPLER16_BORDER_BLUE
0x0000A518 TD_PS_SAMPLER17_BORDER_BLUE
0x0000A404 TD_PS_SAMPLER0_BORDER_GREEN
0x0000A414 TD_PS_SAMPLER1_BORDER_GREEN
0x0000A424 TD_PS_SAMPLER2_BORDER_GREEN
0x0000A434 TD_PS_SAMPLER3_BORDER_GREEN
0x0000A444 TD_PS_SAMPLER4_BORDER_GREEN
0x0000A454 TD_PS_SAMPLER5_BORDER_GREEN
0x0000A464 TD_PS_SAMPLER6_BORDER_GREEN
0x0000A474 TD_PS_SAMPLER7_BORDER_GREEN
0x0000A484 TD_PS_SAMPLER8_BORDER_GREEN
0x0000A494 TD_PS_SAMPLER9_BORDER_GREEN
0x0000A4A4 TD_PS_SAMPLER10_BORDER_GREEN
0x0000A4B4 TD_PS_SAMPLER11_BORDER_GREEN
0x0000A4C4 TD_PS_SAMPLER12_BORDER_GREEN
0x0000A4D4 TD_PS_SAMPLER13_BORDER_GREEN
0x0000A4E4 TD_PS_SAMPLER14_BORDER_GREEN
0x0000A4F4 TD_PS_SAMPLER15_BORDER_GREEN
0x0000A504 TD_PS_SAMPLER16_BORDER_GREEN
0x0000A514 TD_PS_SAMPLER17_BORDER_GREEN
0x0000A400 TD_PS_SAMPLER0_BORDER_RED
0x0000A410 TD_PS_SAMPLER1_BORDER_RED
0x0000A420 TD_PS_SAMPLER2_BORDER_RED
0x0000A430 TD_PS_SAMPLER3_BORDER_RED
0x0000A440 TD_PS_SAMPLER4_BORDER_RED
0x0000A450 TD_PS_SAMPLER5_BORDER_RED
0x0000A460 TD_PS_SAMPLER6_BORDER_RED
0x0000A470 TD_PS_SAMPLER7_BORDER_RED
0x0000A480 TD_PS_SAMPLER8_BORDER_RED
0x0000A490 TD_PS_SAMPLER9_BORDER_RED
0x0000A4A0 TD_PS_SAMPLER10_BORDER_RED
0x0000A4B0 TD_PS_SAMPLER11_BORDER_RED
0x0000A4C0 TD_PS_SAMPLER12_BORDER_RED
0x0000A4D0 TD_PS_SAMPLER13_BORDER_RED
0x0000A4E0 TD_PS_SAMPLER14_BORDER_RED
0x0000A4F0 TD_PS_SAMPLER15_BORDER_RED
0x0000A500 TD_PS_SAMPLER16_BORDER_RED
0x0000A510 TD_PS_SAMPLER17_BORDER_RED
0x0000AA00 TD_PS_SAMPLER0_CLEARTYPE_KERNEL
0x0000AA04 TD_PS_SAMPLER1_CLEARTYPE_KERNEL
0x0000AA08 TD_PS_SAMPLER2_CLEARTYPE_KERNEL
0x0000AA0C TD_PS_SAMPLER3_CLEARTYPE_KERNEL
0x0000AA10 TD_PS_SAMPLER4_CLEARTYPE_KERNEL
0x0000AA14 TD_PS_SAMPLER5_CLEARTYPE_KERNEL
0x0000AA18 TD_PS_SAMPLER6_CLEARTYPE_KERNEL
0x0000AA1C TD_PS_SAMPLER7_CLEARTYPE_KERNEL
0x0000AA20 TD_PS_SAMPLER8_CLEARTYPE_KERNEL
0x0000AA24 TD_PS_SAMPLER9_CLEARTYPE_KERNEL
0x0000AA28 TD_PS_SAMPLER10_CLEARTYPE_KERNEL
0x0000AA2C TD_PS_SAMPLER11_CLEARTYPE_KERNEL
0x0000AA30 TD_PS_SAMPLER12_CLEARTYPE_KERNEL
0x0000AA34 TD_PS_SAMPLER13_CLEARTYPE_KERNEL
0x0000AA38 TD_PS_SAMPLER14_CLEARTYPE_KERNEL
0x0000AA3C TD_PS_SAMPLER15_CLEARTYPE_KERNEL
0x0000AA40 TD_PS_SAMPLER16_CLEARTYPE_KERNEL
0x0000AA44 TD_PS_SAMPLER17_CLEARTYPE_KERNEL
0x0000A60C TD_VS_SAMPLER0_BORDER_ALPHA
0x0000A61C TD_VS_SAMPLER1_BORDER_ALPHA
0x0000A62C TD_VS_SAMPLER2_BORDER_ALPHA
0x0000A63C TD_VS_SAMPLER3_BORDER_ALPHA
0x0000A64C TD_VS_SAMPLER4_BORDER_ALPHA
0x0000A65C TD_VS_SAMPLER5_BORDER_ALPHA
0x0000A66C TD_VS_SAMPLER6_BORDER_ALPHA
0x0000A67C TD_VS_SAMPLER7_BORDER_ALPHA
0x0000A68C TD_VS_SAMPLER8_BORDER_ALPHA
0x0000A69C TD_VS_SAMPLER9_BORDER_ALPHA
0x0000A6AC TD_VS_SAMPLER10_BORDER_ALPHA
0x0000A6BC TD_VS_SAMPLER11_BORDER_ALPHA
0x0000A6CC TD_VS_SAMPLER12_BORDER_ALPHA
0x0000A6DC TD_VS_SAMPLER13_BORDER_ALPHA
0x0000A6EC TD_VS_SAMPLER14_BORDER_ALPHA
0x0000A6FC TD_VS_SAMPLER15_BORDER_ALPHA
0x0000A70C TD_VS_SAMPLER16_BORDER_ALPHA
0x0000A71C TD_VS_SAMPLER17_BORDER_ALPHA
0x0000A608 TD_VS_SAMPLER0_BORDER_BLUE
0x0000A618 TD_VS_SAMPLER1_BORDER_BLUE
0x0000A628 TD_VS_SAMPLER2_BORDER_BLUE
0x0000A638 TD_VS_SAMPLER3_BORDER_BLUE
0x0000A648 TD_VS_SAMPLER4_BORDER_BLUE
0x0000A658 TD_VS_SAMPLER5_BORDER_BLUE
0x0000A668 TD_VS_SAMPLER6_BORDER_BLUE
0x0000A678 TD_VS_SAMPLER7_BORDER_BLUE
0x0000A688 TD_VS_SAMPLER8_BORDER_BLUE
0x0000A698 TD_VS_SAMPLER9_BORDER_BLUE
0x0000A6A8 TD_VS_SAMPLER10_BORDER_BLUE
0x0000A6B8 TD_VS_SAMPLER11_BORDER_BLUE
0x0000A6C8 TD_VS_SAMPLER12_BORDER_BLUE
0x0000A6D8 TD_VS_SAMPLER13_BORDER_BLUE
0x0000A6E8 TD_VS_SAMPLER14_BORDER_BLUE
0x0000A6F8 TD_VS_SAMPLER15_BORDER_BLUE
0x0000A708 TD_VS_SAMPLER16_BORDER_BLUE
0x0000A718 TD_VS_SAMPLER17_BORDER_BLUE
0x0000A604 TD_VS_SAMPLER0_BORDER_GREEN
0x0000A614 TD_VS_SAMPLER1_BORDER_GREEN
0x0000A624 TD_VS_SAMPLER2_BORDER_GREEN
0x0000A634 TD_VS_SAMPLER3_BORDER_GREEN
0x0000A644 TD_VS_SAMPLER4_BORDER_GREEN
0x0000A654 TD_VS_SAMPLER5_BORDER_GREEN
0x0000A664 TD_VS_SAMPLER6_BORDER_GREEN
0x0000A674 TD_VS_SAMPLER7_BORDER_GREEN
0x0000A684 TD_VS_SAMPLER8_BORDER_GREEN
0x0000A694 TD_VS_SAMPLER9_BORDER_GREEN
0x0000A6A4 TD_VS_SAMPLER10_BORDER_GREEN
0x0000A6B4 TD_VS_SAMPLER11_BORDER_GREEN
0x0000A6C4 TD_VS_SAMPLER12_BORDER_GREEN
0x0000A6D4 TD_VS_SAMPLER13_BORDER_GREEN
0x0000A6E4 TD_VS_SAMPLER14_BORDER_GREEN
0x0000A6F4 TD_VS_SAMPLER15_BORDER_GREEN
0x0000A704 TD_VS_SAMPLER16_BORDER_GREEN
0x0000A714 TD_VS_SAMPLER17_BORDER_GREEN
0x0000A600 TD_VS_SAMPLER0_BORDER_RED
0x0000A610 TD_VS_SAMPLER1_BORDER_RED
0x0000A620 TD_VS_SAMPLER2_BORDER_RED
0x0000A630 TD_VS_SAMPLER3_BORDER_RED
0x0000A640 TD_VS_SAMPLER4_BORDER_RED
0x0000A650 TD_VS_SAMPLER5_BORDER_RED
0x0000A660 TD_VS_SAMPLER6_BORDER_RED
0x0000A670 TD_VS_SAMPLER7_BORDER_RED
0x0000A680 TD_VS_SAMPLER8_BORDER_RED
0x0000A690 TD_VS_SAMPLER9_BORDER_RED
0x0000A6A0 TD_VS_SAMPLER10_BORDER_RED
0x0000A6B0 TD_VS_SAMPLER11_BORDER_RED
0x0000A6C0 TD_VS_SAMPLER12_BORDER_RED
0x0000A6D0 TD_VS_SAMPLER13_BORDER_RED
0x0000A6E0 TD_VS_SAMPLER14_BORDER_RED
0x0000A6F0 TD_VS_SAMPLER15_BORDER_RED
0x0000A700 TD_VS_SAMPLER16_BORDER_RED
0x0000A710 TD_VS_SAMPLER17_BORDER_RED
0x00009508 TA_CNTL_AUX
0x0002802C DB_DEPTH_CLEAR
0x00028D34 DB_PREFETCH_LIMIT
0x00028D30 DB_PRELOAD_CONTROL
0x00028D0C DB_RENDER_CONTROL
0x00028D10 DB_RENDER_OVERRIDE
0x0002880C DB_SHADER_CONTROL
0x00028D28 DB_SRESULTS_COMPARE_STATE0
0x00028D2C DB_SRESULTS_COMPARE_STATE1
0x00028430 DB_STENCILREFMASK
0x00028434 DB_STENCILREFMASK_BF
0x00028028 DB_STENCIL_CLEAR
0x00028780 CB_BLEND0_CONTROL
0x00028784 CB_BLEND1_CONTROL
0x00028788 CB_BLEND2_CONTROL
0x0002878C CB_BLEND3_CONTROL
0x00028790 CB_BLEND4_CONTROL
0x00028794 CB_BLEND5_CONTROL
0x00028798 CB_BLEND6_CONTROL
0x0002879C CB_BLEND7_CONTROL
0x00028804 CB_BLEND_CONTROL
0x00028420 CB_BLEND_ALPHA
0x0002841C CB_BLEND_BLUE
0x00028418 CB_BLEND_GREEN
0x00028414 CB_BLEND_RED
0x0002812C CB_CLEAR_ALPHA
0x00028128 CB_CLEAR_BLUE
0x00028124 CB_CLEAR_GREEN
0x00028120 CB_CLEAR_RED
0x00028C30 CB_CLRCMP_CONTROL
0x00028C38 CB_CLRCMP_DST
0x00028C3C CB_CLRCMP_MSK
0x00028C34 CB_CLRCMP_SRC
0x0002842C CB_FOG_BLUE
0x00028428 CB_FOG_GREEN
0x00028424 CB_FOG_RED
0x00008040 WAIT_UNTIL
0x00009714 VC_ENHANCE
0x00009830 DB_DEBUG
0x00009838 DB_WATERMARKS
0x00028D44 DB_ALPHA_TO_MASK
0x00009700 VC_CNTL
| {
"pile_set_name": "Github"
} |
'use strict';
module.exports = {
name: 'logging',
version: '0.0.1',
type: 'solution',
basePath: '../',
projects: [
'projects/logging',
'projects/test-logging'
]
};
| {
"pile_set_name": "Github"
} |
var vows = require('vows');
var assert = require('assert');
var suite = vows.describe('jStat');
require('../env.js');
suite.addBatch({
'': {
'topic': function() {
return jStat;
},
'': function(jStat) {
}
}
});
suite.export(module);
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env ksh
set -p
#
# CDDL HEADER START
#
# 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 usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Copyright (c) 2013 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/reservation/reservation.shlib
#
# DESCRIPTION:
#
# ZFS has two mechanisms dealing with space for datasets, namely
# reservations and quotas. Setting one should not affect the other,
# provided the values are legal (i.e. enough space in pool etc).
#
# STRATEGY:
# 1) Create one filesystem
# 2) Get the current quota setting
# 3) Set a reservation
# 4) Verify that the quota value remains unchanged
#
verify_runnable "both"
log_assert "Verify reservation settings do not affect quota settings"
function cleanup
{
log_must zero_reservation $TESTPOOL/$TESTFS
}
log_onexit cleanup
space_avail=`get_prop available $TESTPOOL`
((resv_size_set = (space_avail - RESV_DELTA) / 2))
fs_quota=`$ZFS get quota $TESTPOOL/$TESTFS`
log_must $ZFS set reservation=$resv_size_set $TESTPOOL/$TESTFS
new_fs_quota=`$ZFS get quota $TESTPOOL/$TESTFS`
if [[ $fs_quota != $new_fs_quota ]]; then
log_fail "Quota value on $TESTFS has changed " \
"($fs_quota != $new_fs_quota)"
fi
log_pass "Quota settings unaffected by reservation settings"
| {
"pile_set_name": "Github"
} |
define([
"./core",
"./var/rnotwhite"
], function( jQuery, rnotwhite ) {
// String to Object options format cache
var optionsCache = {};
// Convert String-formatted options into Object-formatted ones and store in cache
function createOptions( options ) {
var object = optionsCache[ options ] = {};
jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
object[ flag ] = true;
});
return object;
}
/*
* Create a callback list using the following parameters:
*
* options: an optional list of space-separated options that will change how
* the callback list behaves or a more traditional option object
*
* By default a callback list will act like an event callback list and can be
* "fired" multiple times.
*
* Possible options:
*
* once: will ensure the callback list can only be fired once (like a Deferred)
*
* memory: will keep track of previous values and will call any callback added
* after the list has been fired right away with the latest "memorized"
* values (like a Deferred)
*
* unique: will ensure a callback can only be added once (no duplicate in the list)
*
* stopOnFalse: interrupt callings when a callback returns false
*
*/
jQuery.Callbacks = function( options ) {
// Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
options = typeof options === "string" ?
( optionsCache[ options ] || createOptions( options ) ) :
jQuery.extend( {}, options );
var // Last fire value (for non-forgettable lists)
memory,
// Flag to know if list was already fired
fired,
// Flag to know if list is currently firing
firing,
// First callback to fire (used internally by add and fireWith)
firingStart,
// End of the loop when firing
firingLength,
// Index of currently firing callback (modified by remove if needed)
firingIndex,
// Actual callback list
list = [],
// Stack of fire calls for repeatable lists
stack = !options.once && [],
// Fire callbacks
fire = function( data ) {
memory = options.memory && data;
fired = true;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
firing = true;
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
memory = false; // To prevent further calls using add
break;
}
}
firing = false;
if ( list ) {
if ( stack ) {
if ( stack.length ) {
fire( stack.shift() );
}
} else if ( memory ) {
list = [];
} else {
self.disable();
}
}
},
// Actual Callbacks object
self = {
// Add a callback or a collection of callbacks to the list
add: function() {
if ( list ) {
// First, we save the current length
var start = list.length;
(function add( args ) {
jQuery.each( args, function( _, arg ) {
var type = jQuery.type( arg );
if ( type === "function" ) {
if ( !options.unique || !self.has( arg ) ) {
list.push( arg );
}
} else if ( arg && arg.length && type !== "string" ) {
// Inspect recursively
add( arg );
}
});
})( arguments );
// Do we need to add the callbacks to the
// current firing batch?
if ( firing ) {
firingLength = list.length;
// With memory, if we're not firing then
// we should call right away
} else if ( memory ) {
firingStart = start;
fire( memory );
}
}
return this;
},
// Remove a callback from the list
remove: function() {
if ( list ) {
jQuery.each( arguments, function( _, arg ) {
var index;
while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
list.splice( index, 1 );
// Handle firing indexes
if ( firing ) {
if ( index <= firingLength ) {
firingLength--;
}
if ( index <= firingIndex ) {
firingIndex--;
}
}
}
});
}
return this;
},
// Check if a given callback is in the list.
// If no argument is given, return whether or not list has callbacks attached.
has: function( fn ) {
return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
},
// Remove all callbacks from the list
empty: function() {
list = [];
firingLength = 0;
return this;
},
// Have the list do nothing anymore
disable: function() {
list = stack = memory = undefined;
return this;
},
// Is it disabled?
disabled: function() {
return !list;
},
// Lock the list in its current state
lock: function() {
stack = undefined;
if ( !memory ) {
self.disable();
}
return this;
},
// Is it locked?
locked: function() {
return !stack;
},
// Call all callbacks with the given context and arguments
fireWith: function( context, args ) {
if ( list && ( !fired || stack ) ) {
args = args || [];
args = [ context, args.slice ? args.slice() : args ];
if ( firing ) {
stack.push( args );
} else {
fire( args );
}
}
return this;
},
// Call all the callbacks with the given arguments
fire: function() {
self.fireWith( this, arguments );
return this;
},
// To know if the callbacks have already been called at least once
fired: function() {
return !!fired;
}
};
return self;
};
return jQuery;
});
| {
"pile_set_name": "Github"
} |
/*
* Copyright 1997-2020 Optimatika
*
* 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 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.
*/
package org.ojalgo.type.keyvalue;
import static org.ojalgo.function.constant.PrimitiveMath.*;
import org.ojalgo.netio.ASCII;
import org.ojalgo.type.context.NumberContext;
/**
* @deprecated v49
*/
@Deprecated
public final class IntToDouble implements KeyValue<Integer, Double> {
public final int key;
public final double value;
public IntToDouble(final int aKey, final double aValue) {
super();
key = aKey;
value = aValue;
}
public IntToDouble(final int aKey, final Double aValue) {
super();
key = aKey;
value = aValue != null ? aValue : ZERO;
}
public IntToDouble(final Integer aKey, final double aValue) {
super();
key = aKey != null ? aKey : 0;
value = aValue;
}
public IntToDouble(final Integer aKey, final Double aValue) {
super();
key = aKey != null ? aKey : 0;
value = aValue != null ? aValue : ZERO;
}
IntToDouble() {
this(0, ZERO);
}
public int compareTo(final IntToDouble aReference) {
return (key < aReference.key ? -1 : (key == aReference.key ? 0 : 1));
}
public int compareTo(final KeyValue<Integer, ?> aReference) {
return NumberContext.compare(key, aReference.getKey());
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof IntToDouble)) {
return false;
}
final IntToDouble other = (IntToDouble) obj;
if (key != other.key) {
return false;
}
return true;
}
public Integer getKey() {
return key;
}
public Double getValue() {
return value;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = (prime * result) + key;
return result;
}
@Override
public String toString() {
return String.valueOf(key) + String.valueOf(ASCII.EQUALS) + String.valueOf(value);
}
}
| {
"pile_set_name": "Github"
} |
export default {
timeupdate: { // 快应用事件名
detail: function (evt) { // 转换detail
return {
currentTime: evt.currenttime,
duration: ''
}
}
},
fullscreenchange: {
detail: function (evt) { // 转换detail
return {
fullScreen: evt.fullscreen,
direction: 'horizontal'
}
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2003-2012 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#ifndef _STRUCT_UCONTEXT
#if __DARWIN_UNIX03
#define _STRUCT_UCONTEXT struct __darwin_ucontext
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_UCONTEXT struct ucontext
#endif /* __DARWIN_UNIX03 */
_STRUCT_UCONTEXT
{
int uc_onstack;
__darwin_sigset_t uc_sigmask; /* signal mask used by this context */
_STRUCT_SIGALTSTACK uc_stack; /* stack used by this context */
_STRUCT_UCONTEXT *uc_link; /* pointer to resuming context */
__darwin_size_t uc_mcsize; /* size of the machine context passed in */
_STRUCT_MCONTEXT *uc_mcontext; /* pointer to machine specific context */
#ifdef _XOPEN_SOURCE
_STRUCT_MCONTEXT __mcontext_data;
#endif /* _XOPEN_SOURCE */
};
/* user context */
typedef _STRUCT_UCONTEXT ucontext_t; /* [???] user context */
#endif /* _STRUCT_UCONTEXT */
| {
"pile_set_name": "Github"
} |
/*
* Copyright © 2018, VideoLAN and dav1d authors
* Copyright © 2018, Two Orioles, LLC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. 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.
*
* 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 OWNER 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.
*/
#ifndef DAV1D_COMMON_DUMP_H
#define DAV1D_COMMON_DUMP_H
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include "common/bitdepth.h"
static inline void append_plane_to_file(const pixel *buf, ptrdiff_t stride,
int w, int h, const char *const file)
{
FILE *const f = fopen(file, "ab");
while (h--) {
fwrite(buf, w * sizeof(pixel), 1, f);
buf += PXSTRIDE(stride);
}
fclose(f);
}
static inline void hex_fdump(FILE *out, const pixel *buf, ptrdiff_t stride,
int w, int h, const char *what)
{
fprintf(out, "%s\n", what);
while (h--) {
int x;
for (x = 0; x < w; x++)
fprintf(out, " " PIX_HEX_FMT, buf[x]);
buf += PXSTRIDE(stride);
fprintf(out, "\n");
}
}
static inline void hex_dump(const pixel *buf, ptrdiff_t stride,
int w, int h, const char *what)
{
hex_fdump(stdout, buf, stride, w, h, what);
}
static inline void coef_dump(const coef *buf, const int w, const int h,
const int len, const char *what)
{
int y;
printf("%s\n", what);
for (y = 0; y < h; y++) {
int x;
for (x = 0; x < w; x++)
printf(" %*d", len, buf[x]);
buf += w;
printf("\n");
}
}
static inline void ac_dump(const int16_t *buf, int w, int h, const char *what)
{
printf("%s\n", what);
while (h--) {
for (int x = 0; x < w; x++)
printf(" %03d", buf[x]);
buf += w;
printf("\n");
}
}
#endif /* DAV1D_COMMON_DUMP_H */
| {
"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.
-- MySQL dump 10.13 Distrib 5.1.50, for apple-darwin10.3.0 (i386)
--
-- Host: localhost Database: xa_db
-- ------------------------------------------------------
-- Server version 5.1.50
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `xa_access_audit`
--
DROP TABLE IF EXISTS `xa_access_audit`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `xa_access_audit` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`create_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`added_by_id` bigint(20) DEFAULT NULL,
`upd_by_id` bigint(20) DEFAULT NULL,
`audit_type` int(11) NOT NULL DEFAULT '0',
`access_result` int(11) DEFAULT '0',
`access_type` varchar(255) DEFAULT NULL,
`acl_enforcer` varchar(255) DEFAULT NULL,
`agent_id` varchar(255) DEFAULT NULL,
`client_ip` varchar(255) DEFAULT NULL,
`client_type` varchar(255) DEFAULT NULL,
`policy_id` bigint(20) DEFAULT '0',
`repo_name` varchar(255) DEFAULT NULL,
`repo_type` int(11) DEFAULT '0',
`result_reason` varchar(255) DEFAULT NULL,
`session_id` varchar(255) DEFAULT NULL,
`event_time` datetime DEFAULT NULL,
`request_user` varchar(255) DEFAULT NULL,
`action` varchar(2000) DEFAULT NULL,
`request_data` varchar(4000) DEFAULT NULL,
`resource_path` varchar(4000) DEFAULT NULL,
`resource_type` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `xa_access_audit_added_by_id` (`added_by_id`),
KEY `xa_access_audit_upd_by_id` (`upd_by_id`),
KEY `xa_access_audit_cr_time` (`create_time`),
KEY `xa_access_audit_up_time` (`update_time`),
KEY `xa_access_audit_event_time` (`event_time`)
)DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `xa_access_audit`
--
LOCK TABLES `xa_access_audit` WRITE;
/*!40000 ALTER TABLE `xa_access_audit` DISABLE KEYS */;
/*!40000 ALTER TABLE `xa_access_audit` ENABLE KEYS */;
UNLOCK TABLES;
-- Dump completed on 2014-05-25 0:07:27
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
/* //device/apps/common/assets/res/any/strings.xml
**
** Copyright 2006, The Android Open Source Project
**
** 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.
*/
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="mmcc_imsi_unknown_in_hlr" msgid="5424518490295341205">"Не е обезбедена SIM-картичка, MM#2"</string>
<string name="mmcc_illegal_ms" msgid="3527626511418944853">"Не е дозволена SIM-картичка, MM#3"</string>
<string name="mmcc_illegal_me" msgid="3948912590657398489">"Телефонот не е дозволен MM#6"</string>
</resources>
| {
"pile_set_name": "Github"
} |
/*
* 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.
*/
/** \file
* \ingroup collada
*/
#include "ImportSettings.h"
| {
"pile_set_name": "Github"
} |
var searchData=
[
['b',['B',['../namespacepvr.html#a675b14a2f2079f7f72e7f2ad35d13de7a9d5ed678fe57bcca610140957afab571',1,'pvr']]],
['back',['Back',['../namespacepvr.html#a1ca56afd652113209f2535e7688a4189a0557fa923dcee4d0f86b1409f5c2167f',1,'pvr']]],
['bonebatch',['BoneBatch',['../namespacepvr.html#a7449705e04c8fe948e390ea793106107aa65c9562b8c9e07299be6bc0b4f3a072',1,'pvr']]]
];
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env bash
set -e
if [[ $# -lt 4 ]]
then
echo "wrong number of arguments supplied: $#"
exit 0
fi
if [ -z ${MOSES} ]
then
echo "variable MOSES undefined"
exit 0
fi
config_file=`readlink -f $1`
temp_dir=`readlink -f $2`
filename=`readlink -f $3`
output_filename=$4
cores=`lscpu | grep -Po "^(CPU\(s\)|Processeur\(s\)).?:\s+\K\d+$"`
if [ -d "${temp_dir}" ]
then
echo "directory ${temp_dir} already exists"
exit 0
fi
mkdir -p ${temp_dir}
printf "started: "; date
${MOSES}/scripts/training/filter-model-given-input.pl ${temp_dir}/model ${config_file} ${filename} >/dev/null 2>/dev/null
cat ${filename} | sed "s/|//g" | ${MOSES}/bin/moses -f ${temp_dir}/model/moses.ini -threads ${cores} > ${output_filename} 2>/dev/null
rm -rf ${temp_dir}
printf "finished: "; date
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.management.remote.rmi;
import java.security.ProtectionDomain;
/**
<p>A class loader that only knows how to define a limited number
of classes, and load a limited number of other classes through
delegation to another loader. It is used to get around a problem
with Serialization, in particular as used by RMI. The JMX Remote API
defines exactly what class loader must be used to deserialize arguments on
the server, and return values on the client. We communicate this class
loader to RMI by setting it as the context class loader. RMI uses the
context class loader to load classes as it deserializes, which is what we
want. However, before consulting the context class loader, it
looks up the call stack for a class with a non-null class loader,
and uses that if it finds one. So, in the standalone version of
javax.management.remote, if the class you're looking for is known
to the loader of jmxremote.jar (typically the system class loader)
then that loader will load it. This contradicts the class-loading
semantics required.
<p>We get around the problem by ensuring that the search up the
call stack will find a non-null class loader that doesn't load any
classes of interest, namely this one. So even though this loader
is indeed consulted during deserialization, it never finds the
class being deserialized. RMI then proceeds to use the context
class loader, as we require.
<p>This loader is constructed with the name and byte-code of one
or more classes that it defines, and a class-loader to which it
will delegate certain other classes required by that byte-code.
We construct the byte-code somewhat painstakingly, by compiling
the Java code directly, converting into a string, copying that
string into the class that needs this loader, and using the
stringToBytes method to convert it into the byte array. We
compile with -g:none because there's not much point in having
line-number information and the like in these directly-encoded
classes.
<p>The referencedClassNames should contain the names of all
classes that are referenced by the classes defined by this loader.
It is not necessary to include standard J2SE classes, however.
Here, a class is referenced if it is the superclass or a
superinterface of a defined class, or if it is the type of a
field, parameter, or return value. A class is not referenced if
it only appears in the throws clause of a method or constructor.
Of course, referencedClassNames should not contain any classes
that the user might want to deserialize, because the whole point
of this loader is that it does not find such classes.
*/
class NoCallStackClassLoader extends ClassLoader {
/** Simplified constructor when this loader only defines one class. */
public NoCallStackClassLoader(String className,
byte[] byteCode,
String[] referencedClassNames,
ClassLoader referencedClassLoader,
ProtectionDomain protectionDomain) {
this(new String[] {className}, new byte[][] {byteCode},
referencedClassNames, referencedClassLoader, protectionDomain);
}
public NoCallStackClassLoader(String[] classNames,
byte[][] byteCodes,
String[] referencedClassNames,
ClassLoader referencedClassLoader,
ProtectionDomain protectionDomain) {
super(null);
/* Validation. */
if (classNames == null || classNames.length == 0
|| byteCodes == null || classNames.length != byteCodes.length
|| referencedClassNames == null || protectionDomain == null)
throw new IllegalArgumentException();
for (int i = 0; i < classNames.length; i++) {
if (classNames[i] == null || byteCodes[i] == null)
throw new IllegalArgumentException();
}
for (int i = 0; i < referencedClassNames.length; i++) {
if (referencedClassNames[i] == null)
throw new IllegalArgumentException();
}
this.classNames = classNames;
this.byteCodes = byteCodes;
this.referencedClassNames = referencedClassNames;
this.referencedClassLoader = referencedClassLoader;
this.protectionDomain = protectionDomain;
}
/* This method is called at most once per name. Define the name
* if it is one of the classes whose byte code we have, or
* delegate the load if it is one of the referenced classes.
*/
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
// Note: classNames is guaranteed by the constructor to be non-null.
for (int i = 0; i < classNames.length; i++) {
if (name.equals(classNames[i])) {
return defineClass(classNames[i], byteCodes[i], 0,
byteCodes[i].length, protectionDomain);
}
}
/* If the referencedClassLoader is null, it is the bootstrap
* class loader, and there's no point in delegating to it
* because it's already our parent class loader.
*/
if (referencedClassLoader != null) {
for (int i = 0; i < referencedClassNames.length; i++) {
if (name.equals(referencedClassNames[i]))
return referencedClassLoader.loadClass(name);
}
}
throw new ClassNotFoundException(name);
}
private final String[] classNames;
private final byte[][] byteCodes;
private final String[] referencedClassNames;
private final ClassLoader referencedClassLoader;
private final ProtectionDomain protectionDomain;
/**
* <p>Construct a <code>byte[]</code> using the characters of the
* given <code>String</code>. Only the low-order byte of each
* character is used. This method is useful to reduce the
* footprint of classes that include big byte arrays (e.g. the
* byte code of other classes), because a string takes up much
* less space in a class file than the byte code to initialize a
* <code>byte[]</code> with the same number of bytes.</p>
*
* <p>We use just one byte per character even though characters
* contain two bytes. The resultant output length is much the
* same: using one byte per character is shorter because it has
* more characters in the optimal 1-127 range but longer because
* it has more zero bytes (which are frequent, and are encoded as
* two bytes in classfile UTF-8). But one byte per character has
* two key advantages: (1) you can see the string constants, which
* is reassuring, (2) you don't need to know whether the class
* file length is odd.</p>
*
* <p>This method differs from {@link String#getBytes()} in that
* it does not use any encoding. So it is guaranteed that each
* byte of the result is numerically identical (mod 256) to the
* corresponding character of the input.
*/
public static byte[] stringToBytes(String s) {
final int slen = s.length();
byte[] bytes = new byte[slen];
for (int i = 0; i < slen; i++)
bytes[i] = (byte) s.charAt(i);
return bytes;
}
}
/*
You can use the following Emacs function to convert class files into
strings to be used by the stringToBytes method above. Select the
whole (defun...) with the mouse and type M-x eval-region, or save it
to a file and do M-x load-file. Then visit the *.class file and do
M-x class-string.
;; class-string.el
;; visit the *.class file with emacs, then invoke this function
(defun class-string ()
"Construct a Java string whose bytes are the same as the current
buffer. The resultant string is put in a buffer called *string*,
possibly with a numeric suffix like <2>. From there it can be
insert-buffer'd into a Java program."
(interactive)
(let* ((s (buffer-string))
(slen (length s))
(i 0)
(buf (generate-new-buffer "*string*")))
(set-buffer buf)
(insert "\"")
(while (< i slen)
(if (> (current-column) 61)
(insert "\"+\n\""))
(let ((c (aref s i)))
(insert (cond
((> c 126) (format "\\%o" c))
((= c ?\") "\\\"")
((= c ?\\) "\\\\")
((< c 33)
(let ((nextc (if (< (1+ i) slen)
(aref s (1+ i))
?\0)))
(cond
((and (<= nextc ?7) (>= nextc ?0))
(format "\\%03o" c))
(t
(format "\\%o" c)))))
(t c))))
(setq i (1+ i)))
(insert "\"")
(switch-to-buffer buf)))
Alternatively, the following class reads a class file and outputs a string
that can be used by the stringToBytes method above.
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
public class BytesToString {
public static void main(String[] args) throws IOException {
File f = new File(args[0]);
int len = (int)f.length();
byte[] classBytes = new byte[len];
FileInputStream in = new FileInputStream(args[0]);
try {
int pos = 0;
for (;;) {
int n = in.read(classBytes, pos, (len-pos));
if (n < 0)
throw new RuntimeException("class file changed??");
pos += n;
if (pos >= n)
break;
}
} finally {
in.close();
}
int pos = 0;
boolean lastWasOctal = false;
for (int i=0; i<len; i++) {
int value = classBytes[i];
if (value < 0)
value += 256;
String s = null;
if (value == '\\')
s = "\\\\";
else if (value == '\"')
s = "\\\"";
else {
if ((value >= 32 && value < 127) && ((!lastWasOctal ||
(value < '0' || value > '7')))) {
s = Character.toString((char)value);
}
}
if (s == null) {
s = "\\" + Integer.toString(value, 8);
lastWasOctal = true;
} else {
lastWasOctal = false;
}
if (pos > 61) {
System.out.print("\"");
if (i<len)
System.out.print("+");
System.out.println();
pos = 0;
}
if (pos == 0)
System.out.print(" \"");
System.out.print(s);
pos += s.length();
}
System.out.println("\"");
}
}
*/
| {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Predis\Response;
use Predis\PredisException;
/**
* Exception class that identifies server-side Redis errors.
*
* @author Daniele Alessandri <[email protected]>
*/
class ServerException extends PredisException implements ErrorInterface
{
/**
* Gets the type of the error returned by Redis.
*
* @return string
*/
public function getErrorType()
{
list($errorType) = explode(' ', $this->getMessage(), 2);
return $errorType;
}
/**
* Converts the exception to an instance of Predis\Response\Error.
*
* @return Error
*/
public function toErrorResponse()
{
return new Error($this->getMessage());
}
}
| {
"pile_set_name": "Github"
} |
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <objc/NSObject.h>
@class CIMDebugLogger, CIMIssueReporterCandidateState, NSArray, NSString, NSURL;
@interface CIMIssueReporterRadarInfoController : NSObject
{
NSString *_currentOSBuildVersion;
NSURL *_temporaryPlistURL;
CIMIssueReporterCandidateState *_candidateState;
NSArray *_userWordKeyPairs;
CIMDebugLogger *_debugLogger;
}
- (void).cxx_destruct;
@property(readonly, retain) CIMDebugLogger *debugLogger; // @synthesize debugLogger=_debugLogger;
@property(retain) NSArray *userWordKeyPairs; // @synthesize userWordKeyPairs=_userWordKeyPairs;
@property(readonly, retain) CIMIssueReporterCandidateState *candidateState; // @synthesize candidateState=_candidateState;
@property(readonly, copy) NSURL *temporaryPlistURL; // @synthesize temporaryPlistURL=_temporaryPlistURL;
- (void)createAdditionalDebugInfoPlist;
- (id)inputModeStringForMecabraInputMethodType:(int)arg1;
@property(readonly, copy) NSString *inputMode;
@property(readonly, copy) NSString *currentOSBuildVersion; // @synthesize currentOSBuildVersion=_currentOSBuildVersion;
- (id)initWithDebugLogger:(id)arg1 candidateState:(id)arg2;
@end
| {
"pile_set_name": "Github"
} |
/*
This file is part of Mitsuba, a physically based rendering system.
Copyright (c) 2007-2014 by Wenzel Jakob and others.
Mitsuba is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
as published by the Free Software Foundation.
Mitsuba 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/>.
*/
#include <mitsuba/render/trimesh.h>
#include <mitsuba/core/fresolver.h>
#include <mitsuba/core/properties.h>
#include <mitsuba/core/fstream.h>
#include <mitsuba/core/timer.h>
#include <ply/ply_parser.hpp>
#if MTS_USE_BOOST_TR1
#include <boost/tr1/functional.hpp>
#else
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
#include <functional>
#else
#include <functional>
#endif
#endif
#if !MTS_USE_BOOST_TR1 && defined(_MSC_VER) && (_MSC_VER >= 1600)
# define PLY_USE_NULLPTR 1
#else
# define PLY_USE_NULLPTR 0
#endif
using namespace std::placeholders;
MTS_NAMESPACE_BEGIN
/*!\plugin{ply}{PLY (Stanford Triangle Format) mesh loader}
* \order{6}
* \parameters{
* \parameter{filename}{\String}{
* Filename of the PLY file that should be loaded
* }
* \parameter{faceNormals}{\Boolean}{
* When set to \code{true}, Mitsuba will use face normals when rendering
* the object, which will give it a faceted appearance. \default{\code{false}}
* }
* \parameter{maxSmoothAngle}{\Float}{
* When specified, Mitsuba will discard all vertex normals in the input mesh and rebuild
* them in a way that is sensitive to the presence of creases and corners. For more
* details on this parameter, see page~\pageref{sec:maxSmoothAngle}. Disabled by default.
* }
* \parameter{flipNormals}{\Boolean}{
* Optional flag to flip all normals. \default{\code{false}, i.e.
* the normals are left unchanged}.
* }
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional linear object-to-world transformation.
* \default{none (i.e. object space $=$ world space)}
* }
* \parameter{srgb}{\Boolean}{
* When set to \code{true}, any vertex colors will be interpreted as sRGB,
* instead of linear RGB \default{\code{true}}.
* }
* }
* \renderings{
* \rendering{The PLY plugin is useful for loading large geometry. (Dragon
* statue courtesy of XYZ RGB)}{shape_ply_dragon}
* \rendering{The Stanford bunny loaded with \code{faceNormals=true}. Note
* the faceted appearance.}{shape_ply_bunny}
* }
* This plugin implements a fast loader for the Stanford PLY format (both
* the ASCII and binary format). It is based on the \code{libply} library by
* Ares Lagae (\url{http://people.cs.kuleuven.be/~ares.lagae/libply}).
* The current plugin implementation supports triangle meshes with optional
* UV coordinates, vertex normals, and vertex colors.
*
* When loading meshes that contain vertex colors, note that they need to be
* explicitly referenced in a BSDF using a special texture named
* \pluginref{vertexcolors}.
*/
class PLYLoader : public TriMesh {
public:
PLYLoader(const Properties &props) : TriMesh(props) {
fs::path filePath = Thread::getThread()->getFileResolver()->resolve(
props.getString("filename"));
m_name = filePath.stem().string();
/* Determines whether vertex colors should be
treated as linear RGB or sRGB. */
m_sRGB = props.getBoolean("srgb", true);
/* Object-space -> World-space transformation */
m_objectToWorld = props.getTransform("toWorld", Transform());
/* Load the geometry */
Log(EInfo, "Loading geometry from \"%s\" ..", filePath.filename().string().c_str());
if (!fs::exists(filePath))
Log(EError, "PLY file \"%s\" could not be found!", filePath.string().c_str());
m_triangleCount = m_vertexCount = 0;
m_vertexCtr = m_faceCount = m_faceCtr = m_indexCtr = 0;
m_normal = Normal(0.0f);
m_uv = Point2(0.0f);
m_hasNormals = false;
m_hasTexCoords = false;
memset(&m_face, 0, sizeof(uint32_t)*4);
loadPLY(filePath);
if (m_triangleCount == 0 || m_vertexCount == 0)
Log(EError, "Unable to load \"%s\" (no triangles or vertices found)!");
Assert(m_faceCtr == m_faceCount);
Assert(m_vertexCtr == m_vertexCount);
if (props.hasProperty("maxSmoothAngle")) {
if (m_faceNormals)
Log(EError, "The properties 'maxSmoothAngle' and 'faceNormals' "
"can't be specified at the same time!");
rebuildTopology(props.getFloat("maxSmoothAngle"));
}
if (m_triangleCount < m_faceCount * 2) {
/* Needed less memory than the earlier conservative estimate -- free it! */
Triangle *temp = new Triangle[m_triangleCount];
memcpy(temp, m_triangles, sizeof(Triangle) * m_triangleCount);
delete[] m_triangles;
m_triangles = temp;
}
}
PLYLoader(Stream *stream, InstanceManager *manager) : TriMesh(stream, manager) { }
void loadPLY(const fs::path &path);
void info_callback(const std::string& filename, std::size_t line_number,
const std::string& message) {
Log(EInfo, "\"%s\" [line %i] info: %s", filename.c_str(), line_number,
message.c_str());
}
void warning_callback(const std::string& filename, std::size_t line_number,
const std::string& message) {
Log(EWarn, "\"%s\" [line %i] warning: %s", filename.c_str(), line_number,
message.c_str());
}
void error_callback(const std::string& filename, std::size_t line_number,
const std::string& message) {
Log(EError, "\"%s\" [line %i] error: %s", filename.c_str(), line_number,
message.c_str());
}
template<typename ValueType> std::function <void (ValueType)>
scalar_property_definition_callback(const std::string& element_name,
const std::string& property_name);
template<typename SizeType, typename IndexType> std::tuple<std::function<void (SizeType)>,
std::function<void (IndexType)>, std::function<void ()> >
list_property_definition_callback(const std::string& element_name,
const std::string& property_name);
std::tuple<std::function<void()>, std::function<void()> >
element_definition_callback(const std::string& element_name, std::size_t count) {
if (element_name == "vertex") {
m_vertexCount = count;
m_positions = new Point[m_vertexCount];
return std::tuple<std::function<void()>,
std::function<void()> >(
std::bind(&PLYLoader::vertex_begin_callback, this),
std::bind(&PLYLoader::vertex_end_callback, this)
);
} else if (element_name == "face") {
m_faceCount = count;
m_triangles = new Triangle[m_faceCount*2];
return std::tuple<std::function<void()>,
std::function<void()> >(
std::bind(&PLYLoader::face_begin_callback, this),
std::bind(&PLYLoader::face_end_callback, this)
);
} else {
#if PLY_USE_NULLPTR
return
std::tuple<std::function<void()>,
std::function<void()> >(nullptr, nullptr);
#else
return
std::tuple<std::function<void()>,
std::function<void()> >(0, 0);
#endif
}
}
void vertex_x_callback(ply::float32 x) { m_position.x = x; }
void vertex_y_callback(ply::float32 y) { m_position.y = y; }
void vertex_z_callback(ply::float32 z) { m_position.z = z; }
void normal_x_callback(ply::float32 x) {
if (!m_normals)
m_normals = new Normal[m_vertexCount];
m_normal.x = x;
}
void normal_y_callback(ply::float32 y) { m_normal.y = y; }
void normal_z_callback(ply::float32 z) { m_normal.z = z; }
void texcoord_u_callback(ply::float32 x) {
if (!m_texcoords)
m_texcoords = new Point2[m_vertexCount];
m_uv.x = x;
}
void texcoord_v_callback(ply::float32 y) { m_uv.y = y; }
inline Float fromSRGBComponent(Float value) {
if (value <= (Float) 0.04045)
return value / (Float) 12.92;
return std::pow((value + (Float) 0.055)
/ (Float) (1.0 + 0.055), (Float) 2.4);
}
void vertex_begin_callback() { }
void vertex_end_callback() {
Point p = m_objectToWorld(m_position);
m_aabb.expandBy(p);
m_positions[m_vertexCtr] = p;
if (m_normals)
m_normals[m_vertexCtr] = normalize(m_objectToWorld(m_normal));
if (m_texcoords)
m_texcoords[m_vertexCtr] = m_uv;
if (m_colors) {
if (m_sRGB)
m_colors[m_vertexCtr] = Color3(
fromSRGBComponent(m_red),
fromSRGBComponent(m_green),
fromSRGBComponent(m_blue));
else
m_colors[m_vertexCtr] = Color3(m_red, m_green, m_blue);
}
m_vertexCtr++;
}
void red_callback_uint8(ply::uint8 r) {
if (!m_colors)
m_colors = new Color3[m_vertexCount];
m_red = r / 255.0f;
}
void green_callback_uint8(ply::uint8 g) { m_green = g / 255.0f; }
void blue_callback_uint8(ply::uint8 b) { m_blue = b / 255.0f; }
void red_callback(ply::float32 r) {
if (!m_colors)
m_colors = new Color3[m_vertexCount];
m_red = r;
}
void green_callback(ply::float32 g) { m_green = g; }
void blue_callback(ply::float32 b) { m_blue = b; }
/* Face colors are unsupported */
void face_red_callback_uint8(ply::uint8 r) { }
void face_green_callback_uint8(ply::uint8 g) { }
void face_blue_callback_uint8(ply::uint8 b) { }
void face_red_callback(ply::float32 r) { }
void face_green_callback(ply::float32 g) { }
void face_blue_callback(ply::float32 b) { }
void face_begin_callback() { }
void face_end_callback() { }
void face_vertex_indices_begin_uint8(ply::uint8 size) {
if (size != 3 && size != 4)
Log(EError, "Encountered a face with %i vertices! "
"Only triangle and quad-based PLY meshes are supported for now.", size);
m_indexCtr = 0;
}
void face_vertex_indices_begin_uint32(ply::uint32 size) {
if (size != 3 && size != 4)
Log(EError, "Only triangle and quad-based PLY meshes are supported for now.");
m_indexCtr = 0;
}
void face_vertex_indices_element_int32(ply::int32 element) {
Assert(m_indexCtr < 4);
Assert((size_t) element < m_vertexCount);
m_face[m_indexCtr++] = element;
}
void face_vertex_indices_element_uint32(ply::uint32 element) {
Assert(m_indexCtr < 4);
Assert((size_t) element < m_vertexCount);
m_face[m_indexCtr++] = element;
}
void face_vertex_indices_end() {
Assert(m_indexCtr == 3 || m_indexCtr == 4);
Triangle t;
t.idx[0] = m_face[0]; t.idx[1] = m_face[1]; t.idx[2] = m_face[2];
m_triangles[m_triangleCount++] = t;
if (m_indexCtr == 4) {
t.idx[0] = m_face[3]; t.idx[1] = m_face[0]; t.idx[2] = m_face[2];
m_triangles[m_triangleCount++] = t;
}
m_faceCtr++;
}
MTS_DECLARE_CLASS()
private:
Point m_position;
Normal m_normal;
Float m_red, m_green, m_blue;
Transform m_objectToWorld;
size_t m_faceCount, m_vertexCtr;
size_t m_faceCtr, m_indexCtr;
uint32_t m_face[4];
bool m_hasNormals, m_hasTexCoords;
Point2 m_uv;
bool m_sRGB;
};
template<> std::function <void (ply::float32)>
PLYLoader::scalar_property_definition_callback(const std::string& element_name,
const std::string& property_name) {
if (element_name == "vertex") {
if (property_name == "x") {
return std::bind(&PLYLoader::vertex_x_callback, this, _1);
} else if (property_name == "y") {
return std::bind(&PLYLoader::vertex_y_callback, this, _1);
} else if (property_name == "z") {
return std::bind(&PLYLoader::vertex_z_callback, this, _1);
} else if (property_name == "nx") {
m_hasNormals = true;
return std::bind(&PLYLoader::normal_x_callback, this, _1);
} else if (property_name == "ny") {
return std::bind(&PLYLoader::normal_y_callback, this, _1);
} else if (property_name == "nz") {
return std::bind(&PLYLoader::normal_z_callback, this, _1);
} else if (property_name == "u" || property_name == "texture_u" || property_name == "s") {
m_hasTexCoords = true;
return std::bind(&PLYLoader::texcoord_u_callback, this, _1);
} else if (property_name == "v" || property_name == "texture_v" || property_name == "t") {
return std::bind(&PLYLoader::texcoord_v_callback, this, _1);
} else if (property_name == "diffuse_red" || property_name == "red") {
return std::bind(&PLYLoader::red_callback, this, _1);
} else if (property_name == "diffuse_green" || property_name == "green") {
return std::bind(&PLYLoader::green_callback, this, _1);
} else if (property_name == "diffuse_blue" || property_name == "blue") {
return std::bind(&PLYLoader::blue_callback, this, _1);
}
} else if (element_name == "face") {
if (property_name == "diffuse_red" || property_name == "red") {
return std::bind(&PLYLoader::face_red_callback, this, _1);
} else if (property_name == "diffuse_green" || property_name == "green") {
return std::bind(&PLYLoader::face_green_callback, this, _1);
} else if (property_name == "diffuse_blue" || property_name == "blue") {
return std::bind(&PLYLoader::face_blue_callback, this, _1);
}
}
#if PLY_USE_NULLPTR
return nullptr;
#else
return 0;
#endif
}
template<> std::function <void (ply::uint8)>
PLYLoader::scalar_property_definition_callback(const std::string& element_name,
const std::string& property_name) {
if (element_name == "vertex") {
if (property_name == "diffuse_red" || property_name == "red") {
return std::bind(&PLYLoader::red_callback_uint8, this, _1);
} else if (property_name == "diffuse_green" || property_name == "green") {
return std::bind(&PLYLoader::green_callback_uint8, this, _1);
} else if (property_name == "diffuse_blue" || property_name == "blue") {
return std::bind(&PLYLoader::blue_callback_uint8, this, _1);
}
} else if (element_name == "face") {
if (property_name == "diffuse_red" || property_name == "red") {
return std::bind(&PLYLoader::face_red_callback_uint8, this, _1);
} else if (property_name == "diffuse_green" || property_name == "green") {
return std::bind(&PLYLoader::face_green_callback_uint8, this, _1);
} else if (property_name == "diffuse_blue" || property_name == "blue") {
return std::bind(&PLYLoader::face_blue_callback_uint8, this, _1);
}
}
#if PLY_USE_NULLPTR
return nullptr;
#else
return 0;
#endif
}
template<> std::tuple<std::function<void (ply::uint8)>,
std::function<void (ply::int32)>, std::function<void ()> >
PLYLoader::list_property_definition_callback(const std::string& element_name,
const std::string& property_name) {
if ((element_name == "face") && (property_name == "vertex_indices" || property_name == "vertex_index")) {
return std::tuple<std::function<void (ply::uint8)>,
std::function<void (ply::int32)>, std::function<void ()> >(
std::bind(&PLYLoader::face_vertex_indices_begin_uint8, this, _1),
std::bind(&PLYLoader::face_vertex_indices_element_int32, this, _1),
std::bind(&PLYLoader::face_vertex_indices_end, this)
);
} else {
#if PLY_USE_NULLPTR
return std::tuple<std::function<void (ply::uint8)>,
std::function<void (ply::int32)>,
std::function<void ()> >(nullptr, nullptr, nullptr);
#else
return std::tuple<std::function<void (ply::uint8)>,
std::function<void (ply::int32)>,
std::function<void ()> >(0, 0, 0);
#endif
}
}
template<> std::tuple<std::function<void (ply::uint32)>,
std::function<void (ply::int32)>, std::function<void ()> >
PLYLoader::list_property_definition_callback(const std::string& element_name,
const std::string& property_name) {
if ((element_name == "face") && (property_name == "vertex_indices" || property_name == "vertex_index")) {
return std::tuple<std::function<void (ply::uint32)>,
std::function<void (ply::int32)>, std::function<void ()> >(
std::bind(&PLYLoader::face_vertex_indices_begin_uint32, this, _1),
std::bind(&PLYLoader::face_vertex_indices_element_int32, this, _1),
std::bind(&PLYLoader::face_vertex_indices_end, this)
);
} else {
#if PLY_USE_NULLPTR
return std::tuple<std::function<void (ply::uint32)>,
std::function<void (ply::int32)>,
std::function<void ()> >(nullptr, nullptr, nullptr);
#else
return std::tuple<std::function<void (ply::uint32)>,
std::function<void (ply::int32)>,
std::function<void ()> >(0, 0, 0);
#endif
}
}
template<> std::tuple<std::function<void (ply::uint8)>,
std::function<void (ply::uint32)>, std::function<void ()> >
PLYLoader::list_property_definition_callback(const std::string& element_name,
const std::string& property_name) {
if ((element_name == "face") && (property_name == "vertex_indices" || property_name == "vertex_index")) {
return std::tuple<std::function<void (ply::uint8)>,
std::function<void (ply::uint32)>, std::function<void ()> >(
std::bind(&PLYLoader::face_vertex_indices_begin_uint8, this, _1),
std::bind(&PLYLoader::face_vertex_indices_element_uint32, this, _1),
std::bind(&PLYLoader::face_vertex_indices_end, this)
);
} else {
#if PLY_USE_NULLPTR
return std::tuple<std::function<void (ply::uint8)>,
std::function<void (ply::uint32)>,
std::function<void ()> >(nullptr, nullptr, nullptr);
#else
return std::tuple<std::function<void (ply::uint8)>,
std::function<void (ply::uint32)>,
std::function<void ()> >(0, 0, 0);
#endif
}
}
template<> std::tuple<std::function<void (ply::uint32)>,
std::function<void (ply::uint32)>, std::function<void ()> >
PLYLoader::list_property_definition_callback(const std::string& element_name,
const std::string& property_name) {
if ((element_name == "face") && (property_name == "vertex_indices" || property_name == "vertex_index")) {
return std::tuple<std::function<void (ply::uint32)>,
std::function<void (ply::uint32)>, std::function<void ()> >(
std::bind(&PLYLoader::face_vertex_indices_begin_uint32, this, _1),
std::bind(&PLYLoader::face_vertex_indices_element_uint32, this, _1),
std::bind(&PLYLoader::face_vertex_indices_end, this)
);
} else {
#if PLY_USE_NULLPTR
return std::tuple<std::function<void (ply::uint32)>,
std::function<void (ply::uint32)>,
std::function<void ()> >(nullptr, nullptr, nullptr);
#else
return std::tuple<std::function<void (ply::uint32)>,
std::function<void (ply::uint32)>,
std::function<void ()> >(0, 0, 0);
#endif
}
}
void PLYLoader::loadPLY(const fs::path &path) {
ply::ply_parser ply_parser;
ply_parser.info_callback(std::bind(&PLYLoader::info_callback,
this, std::ref(m_name), _1, _2));
ply_parser.warning_callback(std::bind(&PLYLoader::warning_callback,
this, std::ref(m_name), _1, _2));
ply_parser.error_callback(std::bind(&PLYLoader::error_callback,
this, std::ref(m_name), _1, _2));
ply_parser.element_definition_callback(std::bind(&PLYLoader::element_definition_callback,
this, _1, _2));
ply::ply_parser::scalar_property_definition_callbacks_type scalar_property_definition_callbacks;
ply::ply_parser::list_property_definition_callbacks_type list_property_definition_callbacks;
ply::at<ply::float32>(scalar_property_definition_callbacks) = std::bind(
&PLYLoader::scalar_property_definition_callback<ply::float32>, this, _1, _2);
ply::at<ply::uint8>(scalar_property_definition_callbacks) = std::bind(
&PLYLoader::scalar_property_definition_callback<ply::uint8>, this, _1, _2);
ply::at<ply::uint8, ply::int32>(list_property_definition_callbacks) = std::bind(
&PLYLoader::list_property_definition_callback<ply::uint8, ply::int32>, this, _1, _2);
ply::at<ply::uint32, ply::int32>(list_property_definition_callbacks) = std::bind(
&PLYLoader::list_property_definition_callback<ply::uint32, ply::int32>, this, _1, _2);
ply::at<ply::uint8, ply::uint32>(list_property_definition_callbacks) = std::bind(
&PLYLoader::list_property_definition_callback<ply::uint8, ply::uint32>, this, _1, _2);
ply::at<ply::uint32, ply::uint32>(list_property_definition_callbacks) = std::bind(
&PLYLoader::list_property_definition_callback<ply::uint32, ply::uint32>, this, _1, _2);
ply_parser.scalar_property_definition_callbacks(scalar_property_definition_callbacks);
ply_parser.list_property_definition_callbacks(list_property_definition_callbacks);
ref<Timer> timer = new Timer();
ply_parser.parse(path.string());
size_t vertexSize = sizeof(Point);
if (m_normals)
vertexSize += sizeof(Normal);
if (m_colors)
vertexSize += sizeof(Spectrum);
if (m_texcoords)
vertexSize += sizeof(Point2);
Log(EInfo, "\"%s\": Loaded " SIZE_T_FMT " triangles, " SIZE_T_FMT
" vertices (%s in %i ms).", m_name.c_str(), m_triangleCount, m_vertexCount,
memString(sizeof(uint32_t) * m_triangleCount * 3 + vertexSize * m_vertexCount).c_str(),
timer->getMilliseconds());
}
MTS_IMPLEMENT_CLASS_S(PLYLoader, false, TriMesh)
MTS_EXPORT_PLUGIN(PLYLoader, "PLY mesh loader");
MTS_NAMESPACE_END
| {
"pile_set_name": "Github"
} |
'use strict';
var assert = require('minimalistic-assert');
var inherits = require('inherits');
var des = require('../des');
var utils = des.utils;
var Cipher = des.Cipher;
function DESState() {
this.tmp = new Array(2);
this.keys = null;
}
function DES(options) {
Cipher.call(this, options);
var state = new DESState();
this._desState = state;
this.deriveKeys(state, options.key);
}
inherits(DES, Cipher);
module.exports = DES;
DES.create = function create(options) {
return new DES(options);
};
var shiftTable = [
1, 1, 2, 2, 2, 2, 2, 2,
1, 2, 2, 2, 2, 2, 2, 1
];
DES.prototype.deriveKeys = function deriveKeys(state, key) {
state.keys = new Array(16 * 2);
assert.equal(key.length, this.blockSize, 'Invalid key length');
var kL = utils.readUInt32BE(key, 0);
var kR = utils.readUInt32BE(key, 4);
utils.pc1(kL, kR, state.tmp, 0);
kL = state.tmp[0];
kR = state.tmp[1];
for (var i = 0; i < state.keys.length; i += 2) {
var shift = shiftTable[i >>> 1];
kL = utils.r28shl(kL, shift);
kR = utils.r28shl(kR, shift);
utils.pc2(kL, kR, state.keys, i);
}
};
DES.prototype._update = function _update(inp, inOff, out, outOff) {
var state = this._desState;
var l = utils.readUInt32BE(inp, inOff);
var r = utils.readUInt32BE(inp, inOff + 4);
// Initial Permutation
utils.ip(l, r, state.tmp, 0);
l = state.tmp[0];
r = state.tmp[1];
if (this.type === 'encrypt')
this._encrypt(state, l, r, state.tmp, 0);
else
this._decrypt(state, l, r, state.tmp, 0);
l = state.tmp[0];
r = state.tmp[1];
utils.writeUInt32BE(out, l, outOff);
utils.writeUInt32BE(out, r, outOff + 4);
};
DES.prototype._pad = function _pad(buffer, off) {
var value = buffer.length - off;
for (var i = off; i < buffer.length; i++)
buffer[i] = value;
return true;
};
DES.prototype._unpad = function _unpad(buffer) {
var pad = buffer[buffer.length - 1];
for (var i = buffer.length - pad; i < buffer.length; i++)
assert.equal(buffer[i], pad);
return buffer.slice(0, buffer.length - pad);
};
DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {
var l = lStart;
var r = rStart;
// Apply f() x16 times
for (var i = 0; i < state.keys.length; i += 2) {
var keyL = state.keys[i];
var keyR = state.keys[i + 1];
// f(r, k)
utils.expand(r, state.tmp, 0);
keyL ^= state.tmp[0];
keyR ^= state.tmp[1];
var s = utils.substitute(keyL, keyR);
var f = utils.permute(s);
var t = r;
r = (l ^ f) >>> 0;
l = t;
}
// Reverse Initial Permutation
utils.rip(r, l, out, off);
};
DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {
var l = rStart;
var r = lStart;
// Apply f() x16 times
for (var i = state.keys.length - 2; i >= 0; i -= 2) {
var keyL = state.keys[i];
var keyR = state.keys[i + 1];
// f(r, k)
utils.expand(l, state.tmp, 0);
keyL ^= state.tmp[0];
keyR ^= state.tmp[1];
var s = utils.substitute(keyL, keyR);
var f = utils.permute(s);
var t = l;
l = (r ^ f) >>> 0;
r = t;
}
// Reverse Initial Permutation
utils.rip(l, r, out, off);
};
| {
"pile_set_name": "Github"
} |
<?php
class LDAP
{
public $sAuthSource = '';
public $aUserInfo = array();
public $sSystem = '';
public $sLdapLog = '';
private static $instance = null;
public function __construct()
{
}
public function &getSingleton()
{
if (self::$instance == null) {
self::$instance = new RBAC();
}
return self::$instance;
}
public function log($_link, $text)
{
$this->sLdapLog .= $text . ": " . @ldap_errno($_link) . ',' . @ldap_error($_link) . "\n";
}
/**
* Autentificacion de un usuario a traves de la clase RBAC_user
*
* verifica que un usuario tiene derechos de iniciar una aplicacion
*
* @author Fernando Ontiveros Lira <[email protected]>
* @access public
* @param string $strUser UserId (login) de usuario
* @param string $strPass Password
* @return
* -1: no existe usuario
* -2: password errado
* -3: usuario inactivo
* -4: usuario vencido
* n : uid de usuario
*/
public function VerifyLogin($strUser, $strPass)
{
//get the AuthSource properties
if (strlen($strPass) == 0) {
return -2;
}
$RBAC = RBAC::getSingleton();
$aAuthSource = $RBAC->authSourcesObj->load($this->sAuthSource);
$sAuthHost = $aAuthSource['AUTH_SOURCE_SERVER_NAME'];
$sAuthPort = $aAuthSource['AUTH_SOURCE_PORT'];
$sAuthTls = $aAuthSource['AUTH_SOURCE_ENABLED_TLS'];
$sAuthBaseDn = $aAuthSource['AUTH_SOURCE_BASE_DN'];
$sAuthFilter = $aAuthSource['AUTH_SOURCE_OBJECT_CLASSES'];
$sAuthType = 'AD';
$sAuthVersion = $aAuthSource['AUTH_SOURCE_VERSION'];
$aAttributes = $aAuthSource['AUTH_SOURCE_ATTRIBUTES']; //array ('dn',"cn", "samaccountname", "givenname", "sn", "mail");
$sAuthUser = $aAuthSource['AUTH_SOURCE_SEARCH_USER'];
$sAuthPass = $aAuthSource['AUTH_SOURCE_PASSWORD'];
$_link = @ldap_connect($sAuthHost, $sAuthPort);
$this->log($_link, "ldap connect");
ldap_set_option($_link, LDAP_OPT_PROTOCOL_VERSION, $sAuthVersion);
$this->log($_link, "ldap set Protocol Version $sAuthVersion");
ldap_set_option($_link, LDAP_OPT_REFERRALS, 0);
$this->log($_link, "ldap set option Referrals");
if (isset($sAuthTls) && $sAuthTls) {
@ldap_start_tls($_link);
$this->log($_link, "start tls");
}
$bind = @ldap_bind($_link);
$this->log($_link, "ldap bind anonymous");
$validUserPass = @ldap_bind($_link, $strUser, $strPass);
$this->log($_link, "ldap binding with user $strUser");
return $validUserPass;
}
public function searchUsers($sKeyword)
{
$sKeyword = trim($sKeyword);
$RBAC = RBAC::getSingleton();
$aAuthSource = $RBAC->authSourcesObj->load($this->sAuthSource);
$pass = explode("_", $aAuthSource['AUTH_SOURCE_PASSWORD']);
foreach ($pass as $index => $value) {
if ($value == '2NnV3ujj3w') {
$aAuthSource['AUTH_SOURCE_PASSWORD'] = G::decrypt($pass[0],
$aAuthSource['AUTH_SOURCE_SERVER_NAME']);
}
}
$oLink = @ldap_connect($aAuthSource['AUTH_SOURCE_SERVER_NAME'],
$aAuthSource['AUTH_SOURCE_PORT']);
@ldap_set_option($oLink, LDAP_OPT_PROTOCOL_VERSION,
$aAuthSource['AUTH_SOURCE_VERSION']);
@ldap_set_option($oLink, LDAP_OPT_REFERRALS, 0);
if (isset($aAuthSource['AUTH_SOURCE_ENABLED_TLS']) && $aAuthSource['AUTH_SOURCE_ENABLED_TLS']) {
@ldap_start_tls($oLink);
}
if ($aAuthSource['AUTH_ANONYMOUS'] == '1') {
$bBind = @ldap_bind($oLink);
} else {
$bBind = @ldap_bind($oLink, $aAuthSource['AUTH_SOURCE_SEARCH_USER'],
$aAuthSource['AUTH_SOURCE_PASSWORD']);
}
if (!$bBind) {
throw new Exception('Unable to bind to server : ' . $aAuthSource['AUTH_SOURCE_SERVER_NAME'] . ' in port ' . $aAuthSource['AUTH_SOURCE_PORT']);
}
if (substr($sKeyword, -1) != '*') {
if ($sKeyword != '') {
$sKeyword = '*' . $sKeyword . '*';
} else {
$sKeyword .= '*';
}
}
$additionalFilter = isset($aAuthSource['AUTH_SOURCE_DATA']['AUTH_SOURCE_ADDITIONAL_FILTER'])
? trim($aAuthSource['AUTH_SOURCE_DATA']['AUTH_SOURCE_ADDITIONAL_FILTER'])
: '';
$sFilter = '(&(|(objectClass=*))';
if (isset($aAuthSource['AUTH_SOURCE_DATA']['LDAP_TYPE']) && $aAuthSource['AUTH_SOURCE_DATA']['LDAP_TYPE']
== 'ad') {
$sFilter = "(&(|(objectClass=*))(|(samaccountname=$sKeyword)(userprincipalname=$sKeyword))$additionalFilter)";
} else {
$sFilter = "(&(|(objectClass=*))(|(uid=$sKeyword)(cn=$sKeyword))$additionalFilter)";
}
$aUsers = array();
$oSearch = @ldap_search($oLink, $aAuthSource['AUTH_SOURCE_BASE_DN'],
$sFilter,
array('dn', 'uid', 'samaccountname', 'cn', 'givenname',
'sn', 'mail', 'userprincipalname', 'objectcategory', 'manager'));
if ($oError = @ldap_errno($oLink)) {
return $aUsers;
} else {
if ($oSearch) {
if (@ldap_count_entries($oLink, $oSearch) > 0) {
$sUsername = '';
$oEntry = @ldap_first_entry($oLink, $oSearch);
$uidUser = isset($aAuthSource['AUTH_SOURCE_DATA']['AUTH_SOURCE_IDENTIFIER_FOR_USER'])
? $aAuthSource['AUTH_SOURCE_DATA']['AUTH_SOURCE_IDENTIFIER_FOR_USER']
: 'uid';
do {
$aAttr = $this->getLdapAttributes($oLink, $oEntry);
$sUsername = isset($aAttr[$uidUser]) ? $aAttr[$uidUser] : '';
if ($sUsername != '') {
// note added by gustavo cruz gustavo-at-colosa.com
// assign the givenname and sn fields if these are set
$aUsers[] = [
'sUsername' => $sUsername,
'sFullname' => isset($aAttr['cn']) ? $aAttr['cn'] : '',
'sFirstname' => isset($aAttr['givenname']) ? $aAttr['givenname'] : '',
'sLastname' => isset($aAttr['sn']) ? $aAttr['sn'] : '',
'sEmail' => isset($aAttr['mail'])
? $aAttr['mail']
: (isset($aAttr['userprincipalname']) ? $aAttr['userprincipalname'] : ''),
'sDN' => $aAttr['dn']
];
}
} while ($oEntry = @ldap_next_entry($oLink, $oEntry));
}
}
return $aUsers;
}
}
public function getLdapAttributes($oLink, $oEntry)
{
$aAttrib['dn'] = @ldap_get_dn($oLink, $oEntry);
$aAttr = @ldap_get_attributes($oLink, $oEntry);
for ($iAtt = 0; $iAtt < $aAttr['count']; $iAtt++) {
switch ($aAttr[$aAttr[$iAtt]]['count']) {
case 0: $aAttrib[strtolower($aAttr[$iAtt])] = '';
break;
case 1: $aAttrib[strtolower($aAttr[$iAtt])] = $aAttr[$aAttr[$iAtt]][0];
break;
default:
$aAttrib[strtolower($aAttr[$iAtt])] = $aAttr[$aAttr[$iAtt]];
unset($aAttrib[$aAttr[$iAtt]]['count']);
break;
}
}
return $aAttrib;
}
}
| {
"pile_set_name": "Github"
} |
<html>
<%@ page session="true"%>
<body>
<jsp:useBean id='counter' scope='session' class='com.acme.Counter' type="com.acme.Counter" />
<h1>JSP1.2 Beans: 1</h1>
Counter accessed <jsp:getProperty name="counter" property="count"/> times.<br/>
Counter last accessed by <jsp:getProperty name="counter" property="last"/><br/>
<jsp:setProperty name="counter" property="last" value="<%= request.getRequestURI()%>"/>
<a href="bean2.jsp">Goto bean2.jsp</a>
</body>
</html>
| {
"pile_set_name": "Github"
} |
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012-2014 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#include <ripple/app/main/Application.h>
#include <ripple/app/paths/RippleState.h>
#include <ripple/ledger/ReadView.h>
#include <ripple/net/RPCErr.h>
#include <ripple/protocol/ErrorCodes.h>
#include <ripple/protocol/jss.h>
#include <ripple/rpc/Context.h>
#include <ripple/rpc/impl/RPCHelpers.h>
namespace ripple {
Json::Value
doAccountCurrencies(RPC::JsonContext& context)
{
auto& params = context.params;
// Get the current ledger
std::shared_ptr<ReadView const> ledger;
auto result = RPC::lookupLedger(ledger, context);
if (!ledger)
return result;
if (!(params.isMember(jss::account) || params.isMember(jss::ident)))
return RPC::missing_field_error(jss::account);
std::string const strIdent(
params.isMember(jss::account) ? params[jss::account].asString()
: params[jss::ident].asString());
bool const bStrict =
params.isMember(jss::strict) && params[jss::strict].asBool();
// Get info on account.
AccountID accountID; // out param
if (auto jvAccepted = RPC::accountFromString(accountID, strIdent, bStrict))
return jvAccepted;
if (!ledger->exists(keylet::account(accountID)))
return rpcError(rpcACT_NOT_FOUND);
std::set<Currency> send, receive;
for (auto const& item : getRippleStateItems(accountID, *ledger))
{
auto const rspEntry = item.get();
STAmount const& saBalance = rspEntry->getBalance();
if (saBalance < rspEntry->getLimit())
receive.insert(saBalance.getCurrency());
if ((-saBalance) < rspEntry->getLimitPeer())
send.insert(saBalance.getCurrency());
}
send.erase(badCurrency());
receive.erase(badCurrency());
Json::Value& sendCurrencies =
(result[jss::send_currencies] = Json::arrayValue);
for (auto const& c : send)
sendCurrencies.append(to_string(c));
Json::Value& recvCurrencies =
(result[jss::receive_currencies] = Json::arrayValue);
for (auto const& c : receive)
recvCurrencies.append(to_string(c));
return result;
}
} // namespace ripple
| {
"pile_set_name": "Github"
} |
/*
Copyright 2016 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.
*/
package etcd3
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"k8s.io/klog"
"path"
"reflect"
"strings"
"time"
"github.com/ibuildthecloud/kvsql/clientv3"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/apiserver/pkg/storage"
"k8s.io/apiserver/pkg/storage/etcd"
"k8s.io/apiserver/pkg/storage/value"
utiltrace "k8s.io/utils/trace"
)
// authenticatedDataString satisfies the value.Context interface. It uses the key to
// authenticate the stored data. This does not defend against reuse of previously
// encrypted values under the same key, but will prevent an attacker from using an
// encrypted value from a different key. A stronger authenticated data segment would
// include the etcd3 Version field (which is incremented on each write to a key and
// reset when the key is deleted), but an attacker with write access to etcd can
// force deletion and recreation of keys to weaken that angle.
type authenticatedDataString string
// AuthenticatedData implements the value.Context interface.
func (d authenticatedDataString) AuthenticatedData() []byte {
return []byte(string(d))
}
var _ value.Context = authenticatedDataString("")
type store struct {
client *clientv3.Client
// getOpts contains additional options that should be passed
// to all Get() calls.
getOps []clientv3.OpOption
codec runtime.Codec
versioner storage.Versioner
transformer value.Transformer
pathPrefix string
watcher *watcher
pagingEnabled bool
leaseManager *leaseManager
}
type objState struct {
obj runtime.Object
meta *storage.ResponseMeta
rev int64
data []byte
stale bool
}
// New returns an etcd3 implementation of storage.Interface.
func New(c *clientv3.Client, codec runtime.Codec, prefix string, transformer value.Transformer, pagingEnabled bool) storage.Interface {
return newStore(c, true, pagingEnabled, codec, prefix, transformer)
}
func newStore(c *clientv3.Client, quorumRead, pagingEnabled bool, codec runtime.Codec, prefix string, transformer value.Transformer) *store {
versioner := etcd.APIObjectVersioner{}
result := &store{
client: c,
codec: codec,
versioner: versioner,
transformer: transformer,
pagingEnabled: pagingEnabled,
// for compatibility with etcd2 impl.
// no-op for default prefix of '/registry'.
// keeps compatibility with etcd2 impl for custom prefixes that don't start with '/'
pathPrefix: path.Join("/", prefix),
watcher: newWatcher(c, codec, versioner, transformer),
leaseManager: newDefaultLeaseManager(c),
}
if !quorumRead {
// In case of non-quorum reads, we can set WithSerializable()
// options for all Get operations.
result.getOps = append(result.getOps, clientv3.WithSerializable())
}
return result
}
// Versioner implements storage.Interface.Versioner.
func (s *store) Versioner() storage.Versioner {
return s.versioner
}
// Get implements storage.Interface.Get.
func (s *store) Get(ctx context.Context, key string, resourceVersion string, out runtime.Object, ignoreNotFound bool) error {
key = path.Join(s.pathPrefix, key)
getResp, err := s.client.KV.Get(ctx, key, s.getOps...)
if err != nil {
return err
}
if len(getResp.Kvs) == 0 {
if ignoreNotFound {
return runtime.SetZeroValue(out)
}
return storage.NewKeyNotFoundError(key, 0)
}
kv := getResp.Kvs[0]
data, _, err := s.transformer.TransformFromStorage(kv.Value, authenticatedDataString(key))
if err != nil {
return storage.NewInternalError(err.Error())
}
return decode(s.codec, s.versioner, data, out, kv.ModRevision)
}
// Create implements storage.Interface.Create.
func (s *store) Create(ctx context.Context, key string, obj, out runtime.Object, ttl uint64) error {
if version, err := s.versioner.ObjectResourceVersion(obj); err == nil && version != 0 {
return errors.New("resourceVersion should not be set on objects to be created")
}
if err := s.versioner.PrepareObjectForStorage(obj); err != nil {
return fmt.Errorf("PrepareObjectForStorage failed: %v", err)
}
data, err := runtime.Encode(s.codec, obj)
if err != nil {
return err
}
key = path.Join(s.pathPrefix, key)
opts, err := s.ttlOpts(ctx, int64(ttl))
if err != nil {
return err
}
newData, err := s.transformer.TransformToStorage(data, authenticatedDataString(key))
if err != nil {
return storage.NewInternalError(err.Error())
}
txnResp, err := s.client.KV.Txn(ctx).If(
notFound(key),
).Then(
clientv3.OpPut(key, string(newData), opts...),
).Commit()
if err != nil {
return err
}
if !txnResp.Succeeded {
return storage.NewKeyExistsError(key, 0)
}
if out != nil {
putResp := txnResp.Responses[0].GetResponsePut()
return decode(s.codec, s.versioner, data, out, putResp.Header.Revision)
}
return nil
}
// Delete implements storage.Interface.Delete.
func (s *store) Delete(ctx context.Context, key string, out runtime.Object, preconditions *storage.Preconditions) error {
v, err := conversion.EnforcePtr(out)
if err != nil {
panic("unable to convert output object to pointer")
}
key = path.Join(s.pathPrefix, key)
if preconditions == nil {
return s.unconditionalDelete(ctx, key, out)
}
return s.conditionalDelete(ctx, key, out, v, preconditions)
}
func (s *store) unconditionalDelete(ctx context.Context, key string, out runtime.Object) error {
// We need to do get and delete in single transaction in order to
// know the value and revision before deleting it.
txnResp, err := s.client.KV.Txn(ctx).If().Then(
clientv3.OpGet(key),
clientv3.OpDelete(key),
).Commit()
if err != nil {
return err
}
getResp := txnResp.Responses[0].GetResponseRange()
if len(getResp.Kvs) == 0 {
return storage.NewKeyNotFoundError(key, 0)
}
kv := getResp.Kvs[0]
data, _, err := s.transformer.TransformFromStorage(kv.Value, authenticatedDataString(key))
if err != nil {
return storage.NewInternalError(err.Error())
}
return decode(s.codec, s.versioner, data, out, kv.ModRevision)
}
func (s *store) conditionalDelete(ctx context.Context, key string, out runtime.Object, v reflect.Value, preconditions *storage.Preconditions) error {
getResp, err := s.client.KV.Get(ctx, key)
if err != nil {
return err
}
for {
origState, err := s.getState(getResp, key, v, false)
if err != nil {
return err
}
if err := preconditions.Check(key, origState.obj); err != nil {
return err
}
txnResp, err := s.client.KV.Txn(ctx).If(
clientv3.Compare(clientv3.ModRevision(key), "=", origState.rev),
).Then(
clientv3.OpDelete(key),
).Else(
clientv3.OpGet(key),
).Commit()
if err != nil {
return err
}
if !txnResp.Succeeded {
getResp = (*clientv3.GetResponse)(txnResp.Responses[0].GetResponseRange())
klog.V(4).Infof("deletion of %s failed because of a conflict, going to retry", key)
continue
}
return decode(s.codec, s.versioner, origState.data, out, origState.rev)
}
}
// GuaranteedUpdate implements storage.Interface.GuaranteedUpdate.
func (s *store) GuaranteedUpdate(
ctx context.Context, key string, out runtime.Object, ignoreNotFound bool,
preconditions *storage.Preconditions, tryUpdate storage.UpdateFunc, suggestion ...runtime.Object) error {
trace := utiltrace.New(fmt.Sprintf("GuaranteedUpdate etcd3: %s", reflect.TypeOf(out).String()))
defer trace.LogIfLong(500 * time.Millisecond)
v, err := conversion.EnforcePtr(out)
if err != nil {
panic("unable to convert output object to pointer")
}
key = path.Join(s.pathPrefix, key)
getCurrentState := func() (*objState, error) {
getResp, err := s.client.KV.Get(ctx, key, s.getOps...)
if err != nil {
return nil, err
}
return s.getState(getResp, key, v, ignoreNotFound)
}
var origState *objState
var mustCheckData bool
if len(suggestion) == 1 && suggestion[0] != nil {
origState, err = s.getStateFromObject(suggestion[0])
if err != nil {
return err
}
mustCheckData = true
} else {
origState, err = getCurrentState()
if err != nil {
return err
}
}
trace.Step("initial value restored")
transformContext := authenticatedDataString(key)
for {
if err := preconditions.Check(key, origState.obj); err != nil {
return err
}
ret, ttl, err := s.updateState(origState, tryUpdate)
if err != nil {
// It's possible we were working with stale data
if mustCheckData && apierrors.IsConflict(err) {
// Actually fetch
origState, err = getCurrentState()
if err != nil {
return err
}
mustCheckData = false
// Retry
continue
}
return err
}
data, err := runtime.Encode(s.codec, ret)
if err != nil {
return err
}
if !origState.stale && bytes.Equal(data, origState.data) {
// if we skipped the original Get in this loop, we must refresh from
// etcd in order to be sure the data in the store is equivalent to
// our desired serialization
if mustCheckData {
origState, err = getCurrentState()
if err != nil {
return err
}
mustCheckData = false
if !bytes.Equal(data, origState.data) {
// original data changed, restart loop
continue
}
}
// recheck that the data from etcd is not stale before short-circuiting a write
if !origState.stale {
return decode(s.codec, s.versioner, origState.data, out, origState.rev)
}
}
newData, err := s.transformer.TransformToStorage(data, transformContext)
if err != nil {
return storage.NewInternalError(err.Error())
}
opts, err := s.ttlOpts(ctx, int64(ttl))
if err != nil {
return err
}
trace.Step("Transaction prepared")
txnResp, err := s.client.KV.Txn(ctx).If(
clientv3.Compare(clientv3.ModRevision(key), "=", origState.rev),
).Then(
clientv3.OpPut(key, string(newData), opts...),
).Else(
clientv3.OpGet(key),
).Commit()
if err != nil {
return err
}
trace.Step("Transaction committed")
if !txnResp.Succeeded {
getResp := (*clientv3.GetResponse)(txnResp.Responses[0].GetResponseRange())
klog.V(4).Infof("GuaranteedUpdate of %s failed because of a conflict, going to retry", key)
origState, err = s.getState(getResp, key, v, ignoreNotFound)
if err != nil {
return err
}
trace.Step("Retry value restored")
mustCheckData = false
continue
}
putResp := txnResp.Responses[0].GetResponsePut()
return decode(s.codec, s.versioner, data, out, putResp.Header.Revision)
}
}
// GetToList implements storage.Interface.GetToList.
func (s *store) GetToList(ctx context.Context, key string, resourceVersion string, pred storage.SelectionPredicate, listObj runtime.Object) error {
listPtr, err := meta.GetItemsPtr(listObj)
if err != nil {
return err
}
v, err := conversion.EnforcePtr(listPtr)
if err != nil || v.Kind() != reflect.Slice {
panic("need ptr to slice")
}
key = path.Join(s.pathPrefix, key)
getResp, err := s.client.KV.Get(ctx, key, s.getOps...)
if err != nil {
return err
}
if len(getResp.Kvs) > 0 {
data, _, err := s.transformer.TransformFromStorage(getResp.Kvs[0].Value, authenticatedDataString(key))
if err != nil {
return storage.NewInternalError(err.Error())
}
if err := appendListItem(v, data, uint64(getResp.Kvs[0].ModRevision), pred, s.codec, s.versioner); err != nil {
return err
}
}
// update version with cluster level revision
return s.versioner.UpdateList(listObj, uint64(getResp.Header.Revision), "")
}
func (s *store) Count(key string) (int64, error) {
key = path.Join(s.pathPrefix, key)
getResp, err := s.client.KV.Get(context.Background(), key, clientv3.WithRange(clientv3.GetPrefixRangeEnd(key)), clientv3.WithCountOnly())
if err != nil {
return 0, err
}
return getResp.Count, nil
}
// continueToken is a simple structured object for encoding the state of a continue token.
// TODO: if we change the version of the encoded from, we can't start encoding the new version
// until all other servers are upgraded (i.e. we need to support rolling schema)
// This is a public API struct and cannot change.
type continueToken struct {
APIVersion string `json:"v"`
ResourceVersion int64 `json:"rv"`
StartKey string `json:"start"`
}
// parseFrom transforms an encoded predicate from into a versioned struct.
// TODO: return a typed error that instructs clients that they must relist
func decodeContinue(continueValue, keyPrefix string) (fromKey string, rv int64, err error) {
data, err := base64.RawURLEncoding.DecodeString(continueValue)
if err != nil {
return "", 0, fmt.Errorf("continue key is not valid: %v", err)
}
var c continueToken
if err := json.Unmarshal(data, &c); err != nil {
return "", 0, fmt.Errorf("continue key is not valid: %v", err)
}
switch c.APIVersion {
case "meta.k8s.io/v1":
if c.ResourceVersion == 0 {
return "", 0, fmt.Errorf("continue key is not valid: incorrect encoded start resourceVersion (version meta.k8s.io/v1)")
}
if len(c.StartKey) == 0 {
return "", 0, fmt.Errorf("continue key is not valid: encoded start key empty (version meta.k8s.io/v1)")
}
// defend against path traversal attacks by clients - path.Clean will ensure that startKey cannot
// be at a higher level of the hierarchy, and so when we append the key prefix we will end up with
// continue start key that is fully qualified and cannot range over anything less specific than
// keyPrefix.
key := c.StartKey
if !strings.HasPrefix(key, "/") {
key = "/" + key
}
cleaned := path.Clean(key)
if cleaned != key {
return "", 0, fmt.Errorf("continue key is not valid: %s", c.StartKey)
}
return keyPrefix + cleaned[1:], c.ResourceVersion, nil
default:
return "", 0, fmt.Errorf("continue key is not valid: server does not recognize this encoded version %q", c.APIVersion)
}
}
// encodeContinue returns a string representing the encoded continuation of the current query.
func encodeContinue(key, keyPrefix string, resourceVersion int64) (string, error) {
nextKey := strings.TrimPrefix(key, keyPrefix)
if nextKey == key {
return "", fmt.Errorf("unable to encode next field: the key and key prefix do not match")
}
out, err := json.Marshal(&continueToken{APIVersion: "meta.k8s.io/v1", ResourceVersion: resourceVersion, StartKey: nextKey})
if err != nil {
return "", err
}
return base64.RawURLEncoding.EncodeToString(out), nil
}
// List implements storage.Interface.List.
func (s *store) List(ctx context.Context, key, resourceVersion string, pred storage.SelectionPredicate, listObj runtime.Object) error {
listPtr, err := meta.GetItemsPtr(listObj)
if err != nil {
return err
}
v, err := conversion.EnforcePtr(listPtr)
if err != nil || v.Kind() != reflect.Slice {
panic("need ptr to slice")
}
if s.pathPrefix != "" {
key = path.Join(s.pathPrefix, key)
}
// We need to make sure the key ended with "/" so that we only get children "directories".
// e.g. if we have key "/a", "/a/b", "/ab", getting keys with prefix "/a" will return all three,
// while with prefix "/a/" will return only "/a/b" which is the correct answer.
if !strings.HasSuffix(key, "/") {
key += "/"
}
keyPrefix := key
// set the appropriate clientv3 options to filter the returned data set
var paging bool
options := make([]clientv3.OpOption, 0, 4)
if s.pagingEnabled && pred.Limit > 0 {
paging = true
options = append(options, clientv3.WithLimit(pred.Limit))
}
var returnedRV, continueRV int64
var continueKey string
switch {
case s.pagingEnabled && len(pred.Continue) > 0:
continueKey, continueRV, err = decodeContinue(pred.Continue, keyPrefix)
if err != nil {
return apierrors.NewBadRequest(fmt.Sprintf("invalid continue token: %v", err))
}
if len(resourceVersion) > 0 && resourceVersion != "0" {
return apierrors.NewBadRequest("specifying resource version is not allowed when using continue")
}
rangeEnd := clientv3.GetPrefixRangeEnd(keyPrefix)
options = append(options, clientv3.WithRange(rangeEnd))
key = continueKey
// If continueRV > 0, the LIST request needs a specific resource version.
// continueRV==0 is invalid.
// If continueRV < 0, the request is for the latest resource version.
if continueRV > 0 {
options = append(options, clientv3.WithRev(continueRV))
returnedRV = continueRV
}
case s.pagingEnabled && pred.Limit > 0:
if len(resourceVersion) > 0 {
fromRV, err := s.versioner.ParseResourceVersion(resourceVersion)
if err != nil {
return apierrors.NewBadRequest(fmt.Sprintf("invalid resource version: %v", err))
}
if fromRV > 0 {
options = append(options, clientv3.WithRev(int64(fromRV)))
}
returnedRV = int64(fromRV)
}
rangeEnd := clientv3.GetPrefixRangeEnd(keyPrefix)
options = append(options, clientv3.WithRange(rangeEnd))
default:
if len(resourceVersion) > 0 {
fromRV, err := s.versioner.ParseResourceVersion(resourceVersion)
if err != nil {
return apierrors.NewBadRequest(fmt.Sprintf("invalid resource version: %v", err))
}
if fromRV > 0 {
options = append(options, clientv3.WithRev(int64(fromRV)))
}
returnedRV = int64(fromRV)
}
options = append(options, clientv3.WithPrefix())
}
// loop until we have filled the requested limit from etcd or there are no more results
var lastKey []byte
var hasMore bool
for {
getResp, err := s.client.KV.Get(ctx, key, options...)
if err != nil {
return interpretListError(err, len(pred.Continue) > 0, continueKey, keyPrefix)
}
hasMore = getResp.More
if len(getResp.Kvs) == 0 && getResp.More {
return fmt.Errorf("no results were found, but etcd indicated there were more values remaining")
}
// avoid small allocations for the result slice, since this can be called in many
// different contexts and we don't know how significantly the result will be filtered
if pred.Empty() {
growSlice(v, len(getResp.Kvs))
} else {
growSlice(v, 2048, len(getResp.Kvs))
}
// take items from the response until the bucket is full, filtering as we go
for _, kv := range getResp.Kvs {
if paging && int64(v.Len()) >= pred.Limit {
hasMore = true
break
}
lastKey = kv.Key
data, _, err := s.transformer.TransformFromStorage(kv.Value, authenticatedDataString(kv.Key))
if err != nil {
utilruntime.HandleError(fmt.Errorf("unable to transform key %q: %v", kv.Key, err))
continue
}
if err := appendListItem(v, data, uint64(kv.ModRevision), pred, s.codec, s.versioner); err != nil {
return err
}
}
// indicate to the client which resource version was returned
if returnedRV == 0 {
returnedRV = getResp.Header.Revision
}
// no more results remain or we didn't request paging
if !hasMore || !paging {
break
}
// we're paging but we have filled our bucket
if int64(v.Len()) >= pred.Limit {
break
}
key = string(lastKey) + "\x00"
}
// instruct the client to begin querying from immediately after the last key we returned
// we never return a key that the client wouldn't be allowed to see
if hasMore {
// we want to start immediately after the last key
next, err := encodeContinue(string(lastKey)+"\x00", keyPrefix, returnedRV)
if err != nil {
return err
}
return s.versioner.UpdateList(listObj, uint64(returnedRV), next)
}
// no continuation
return s.versioner.UpdateList(listObj, uint64(returnedRV), "")
}
// growSlice takes a slice value and grows its capacity up
// to the maximum of the passed sizes or maxCapacity, whichever
// is smaller. Above maxCapacity decisions about allocation are left
// to the Go runtime on append. This allows a caller to make an
// educated guess about the potential size of the total list while
// still avoiding overly aggressive initial allocation. If sizes
// is empty maxCapacity will be used as the size to grow.
func growSlice(v reflect.Value, maxCapacity int, sizes ...int) {
cap := v.Cap()
max := cap
for _, size := range sizes {
if size > max {
max = size
}
}
if len(sizes) == 0 || max > maxCapacity {
max = maxCapacity
}
if max <= cap {
return
}
if v.Len() > 0 {
extra := reflect.MakeSlice(v.Type(), 0, max)
reflect.Copy(extra, v)
v.Set(extra)
} else {
extra := reflect.MakeSlice(v.Type(), 0, max)
v.Set(extra)
}
}
// Watch implements storage.Interface.Watch.
func (s *store) Watch(ctx context.Context, key string, resourceVersion string, pred storage.SelectionPredicate) (watch.Interface, error) {
return s.watch(ctx, key, resourceVersion, pred, false)
}
// WatchList implements storage.Interface.WatchList.
func (s *store) WatchList(ctx context.Context, key string, resourceVersion string, pred storage.SelectionPredicate) (watch.Interface, error) {
return s.watch(ctx, key, resourceVersion, pred, true)
}
func (s *store) watch(ctx context.Context, key string, rv string, pred storage.SelectionPredicate, recursive bool) (watch.Interface, error) {
rev, err := s.versioner.ParseResourceVersion(rv)
if err != nil {
return nil, err
}
key = path.Join(s.pathPrefix, key)
return s.watcher.Watch(ctx, key, int64(rev), recursive, pred)
}
func (s *store) getState(getResp *clientv3.GetResponse, key string, v reflect.Value, ignoreNotFound bool) (*objState, error) {
state := &objState{
obj: reflect.New(v.Type()).Interface().(runtime.Object),
meta: &storage.ResponseMeta{},
}
if len(getResp.Kvs) == 0 {
if !ignoreNotFound {
return nil, storage.NewKeyNotFoundError(key, 0)
}
if err := runtime.SetZeroValue(state.obj); err != nil {
return nil, err
}
} else {
data, stale, err := s.transformer.TransformFromStorage(getResp.Kvs[0].Value, authenticatedDataString(key))
if err != nil {
return nil, storage.NewInternalError(err.Error())
}
state.rev = getResp.Kvs[0].ModRevision
state.meta.ResourceVersion = uint64(state.rev)
state.data = data
state.stale = stale
if err := decode(s.codec, s.versioner, state.data, state.obj, state.rev); err != nil {
return nil, err
}
}
return state, nil
}
func (s *store) getStateFromObject(obj runtime.Object) (*objState, error) {
state := &objState{
obj: obj,
meta: &storage.ResponseMeta{},
}
rv, err := s.versioner.ObjectResourceVersion(obj)
if err != nil {
return nil, fmt.Errorf("couldn't get resource version: %v", err)
}
state.rev = int64(rv)
state.meta.ResourceVersion = uint64(state.rev)
// Compute the serialized form - for that we need to temporarily clean
// its resource version field (those are not stored in etcd).
if err := s.versioner.PrepareObjectForStorage(obj); err != nil {
return nil, fmt.Errorf("PrepareObjectForStorage failed: %v", err)
}
state.data, err = runtime.Encode(s.codec, obj)
if err != nil {
return nil, err
}
s.versioner.UpdateObject(state.obj, uint64(rv))
return state, nil
}
func (s *store) updateState(st *objState, userUpdate storage.UpdateFunc) (runtime.Object, uint64, error) {
ret, ttlPtr, err := userUpdate(st.obj, *st.meta)
if err != nil {
return nil, 0, err
}
if err := s.versioner.PrepareObjectForStorage(ret); err != nil {
return nil, 0, fmt.Errorf("PrepareObjectForStorage failed: %v", err)
}
var ttl uint64
if ttlPtr != nil {
ttl = *ttlPtr
}
return ret, ttl, nil
}
// ttlOpts returns client options based on given ttl.
// ttl: if ttl is non-zero, it will attach the key to a lease with ttl of roughly the same length
func (s *store) ttlOpts(ctx context.Context, ttl int64) ([]clientv3.OpOption, error) {
if ttl == 0 {
return nil, nil
}
id, err := s.leaseManager.GetLease(ctx, ttl)
if err != nil {
return nil, err
}
return []clientv3.OpOption{clientv3.WithLease(id)}, nil
}
// decode decodes value of bytes into object. It will also set the object resource version to rev.
// On success, objPtr would be set to the object.
func decode(codec runtime.Codec, versioner storage.Versioner, value []byte, objPtr runtime.Object, rev int64) error {
if _, err := conversion.EnforcePtr(objPtr); err != nil {
panic("unable to convert output object to pointer")
}
_, _, err := codec.Decode(value, nil, objPtr)
if err != nil {
return err
}
// being unable to set the version does not prevent the object from being extracted
versioner.UpdateObject(objPtr, uint64(rev))
return nil
}
// appendListItem decodes and appends the object (if it passes filter) to v, which must be a slice.
func appendListItem(v reflect.Value, data []byte, rev uint64, pred storage.SelectionPredicate, codec runtime.Codec, versioner storage.Versioner) error {
obj, _, err := codec.Decode(data, nil, reflect.New(v.Type().Elem()).Interface().(runtime.Object))
if err != nil {
return err
}
// being unable to set the version does not prevent the object from being extracted
versioner.UpdateObject(obj, rev)
if matched, err := pred.Matches(obj); err == nil && matched {
v.Set(reflect.Append(v, reflect.ValueOf(obj).Elem()))
}
return nil
}
func notFound(key string) clientv3.Cmp {
return clientv3.Compare(clientv3.ModRevision(key), "=", 0)
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2010-2011 Atheros Communications Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "hw.h"
#include "ar9003_phy.h"
#include "ar9003_rtt.h"
#define RTT_RESTORE_TIMEOUT 1000
#define RTT_ACCESS_TIMEOUT 100
#define RTT_BAD_VALUE 0x0bad0bad
/*
* RTT (Radio Retention Table) hardware implementation information
*
* There is an internal table (i.e. the rtt) for each chain (or bank).
* Each table contains 6 entries and each entry is corresponding to
* a specific calibration parameter as depicted below.
* 0~2 - DC offset DAC calibration: loop, low, high (offsetI/Q_...)
* 3 - Filter cal (filterfc)
* 4 - RX gain settings
* 5 - Peak detector offset calibration (agc_caldac)
*/
void ar9003_hw_rtt_enable(struct ath_hw *ah)
{
REG_WRITE(ah, AR_PHY_RTT_CTRL, 1);
}
void ar9003_hw_rtt_disable(struct ath_hw *ah)
{
REG_WRITE(ah, AR_PHY_RTT_CTRL, 0);
}
void ar9003_hw_rtt_set_mask(struct ath_hw *ah, u32 rtt_mask)
{
REG_RMW_FIELD(ah, AR_PHY_RTT_CTRL,
AR_PHY_RTT_CTRL_RESTORE_MASK, rtt_mask);
}
bool ar9003_hw_rtt_force_restore(struct ath_hw *ah)
{
if (!ath9k_hw_wait(ah, AR_PHY_RTT_CTRL,
AR_PHY_RTT_CTRL_FORCE_RADIO_RESTORE,
0, RTT_RESTORE_TIMEOUT))
return false;
REG_RMW_FIELD(ah, AR_PHY_RTT_CTRL,
AR_PHY_RTT_CTRL_FORCE_RADIO_RESTORE, 1);
if (!ath9k_hw_wait(ah, AR_PHY_RTT_CTRL,
AR_PHY_RTT_CTRL_FORCE_RADIO_RESTORE,
0, RTT_RESTORE_TIMEOUT))
return false;
return true;
}
static void ar9003_hw_rtt_load_hist_entry(struct ath_hw *ah, u8 chain,
u32 index, u32 data28)
{
u32 val;
val = SM(data28, AR_PHY_RTT_SW_RTT_TABLE_DATA);
REG_WRITE(ah, AR_PHY_RTT_TABLE_SW_INTF_1_B(chain), val);
val = SM(0, AR_PHY_RTT_SW_RTT_TABLE_ACCESS) |
SM(1, AR_PHY_RTT_SW_RTT_TABLE_WRITE) |
SM(index, AR_PHY_RTT_SW_RTT_TABLE_ADDR);
REG_WRITE(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain), val);
udelay(1);
val |= SM(1, AR_PHY_RTT_SW_RTT_TABLE_ACCESS);
REG_WRITE(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain), val);
udelay(1);
if (!ath9k_hw_wait(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain),
AR_PHY_RTT_SW_RTT_TABLE_ACCESS, 0,
RTT_ACCESS_TIMEOUT))
return;
val &= ~SM(1, AR_PHY_RTT_SW_RTT_TABLE_WRITE);
REG_WRITE(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain), val);
udelay(1);
ath9k_hw_wait(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain),
AR_PHY_RTT_SW_RTT_TABLE_ACCESS, 0,
RTT_ACCESS_TIMEOUT);
}
void ar9003_hw_rtt_load_hist(struct ath_hw *ah, u8 chain, u32 *table)
{
int i;
for (i = 0; i < MAX_RTT_TABLE_ENTRY; i++)
ar9003_hw_rtt_load_hist_entry(ah, chain, i, table[i]);
}
static int ar9003_hw_rtt_fill_hist_entry(struct ath_hw *ah, u8 chain, u32 index)
{
u32 val;
val = SM(0, AR_PHY_RTT_SW_RTT_TABLE_ACCESS) |
SM(0, AR_PHY_RTT_SW_RTT_TABLE_WRITE) |
SM(index, AR_PHY_RTT_SW_RTT_TABLE_ADDR);
REG_WRITE(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain), val);
udelay(1);
val |= SM(1, AR_PHY_RTT_SW_RTT_TABLE_ACCESS);
REG_WRITE(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain), val);
udelay(1);
if (!ath9k_hw_wait(ah, AR_PHY_RTT_TABLE_SW_INTF_B(chain),
AR_PHY_RTT_SW_RTT_TABLE_ACCESS, 0,
RTT_ACCESS_TIMEOUT))
return RTT_BAD_VALUE;
val = REG_READ(ah, AR_PHY_RTT_TABLE_SW_INTF_1_B(chain));
return val;
}
void ar9003_hw_rtt_fill_hist(struct ath_hw *ah, u8 chain, u32 *table)
{
int i;
for (i = 0; i < MAX_RTT_TABLE_ENTRY; i++)
table[i] = ar9003_hw_rtt_fill_hist_entry(ah, chain, i);
}
void ar9003_hw_rtt_clear_hist(struct ath_hw *ah)
{
int i, j;
for (i = 0; i < AR9300_MAX_CHAINS; i++) {
if (!(ah->rxchainmask & (1 << i)))
continue;
for (j = 0; j < MAX_RTT_TABLE_ENTRY; j++)
ar9003_hw_rtt_load_hist_entry(ah, i, j, 0);
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Windows environment variables.
package windows
import (
"syscall"
"unsafe"
)
func Getenv(key string) (value string, found bool) {
return syscall.Getenv(key)
}
func Setenv(key, value string) error {
return syscall.Setenv(key, value)
}
func Clearenv() {
syscall.Clearenv()
}
func Environ() []string {
return syscall.Environ()
}
// Returns a default environment associated with the token, rather than the current
// process. If inheritExisting is true, then this environment also inherits the
// environment of the current process.
func (token Token) Environ(inheritExisting bool) (env []string, err error) {
var block *uint16
err = CreateEnvironmentBlock(&block, token, inheritExisting)
if err != nil {
return nil, err
}
defer DestroyEnvironmentBlock(block)
blockp := uintptr(unsafe.Pointer(block))
for {
entry := UTF16PtrToString((*uint16)(unsafe.Pointer(blockp)))
if len(entry) == 0 {
break
}
env = append(env, entry)
blockp += 2 * (uintptr(len(entry)) + 1)
}
return env, nil
}
func Unsetenv(key string) error {
return syscall.Unsetenv(key)
}
| {
"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>BuildMachineOSBuild</key>
<string>15F34</string>
<key>CFBundleExecutable</key>
<string>BrcmPatchRAM2</string>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>BrcmPatchRAM2</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>2.2.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>2.2.7</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>7D175</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>15E60</string>
<key>DTSDKName</key>
<string>macosx10.11</string>
<key>DTXcode</key>
<string>0730</string>
<key>DTXcodeBuild</key>
<string>7D175</string>
<key>IOKitPersonalities</key>
<dict>
<key>0489_e032</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1485_v5581</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57394</integer>
<key>idVendor</key>
<integer>1161</integer>
</dict>
<key>0489_e042</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1484_v5580</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57410</integer>
<key>idVendor</key>
<integer>1161</integer>
</dict>
<key>0489_e046</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1465_v5561</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57414</integer>
<key>idVendor</key>
<integer>1161</integer>
</dict>
<key>0489_e04f</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1486_v5582</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57423</integer>
<key>idVendor</key>
<integer>1161</integer>
</dict>
<key>0489_e052</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom BCM20702 Bluetooth USB Device</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1758_v5854</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57426</integer>
<key>idVendor</key>
<integer>1161</integer>
</dict>
<key>0489_e055</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0331_v4427</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57429</integer>
<key>idVendor</key>
<integer>1161</integer>
</dict>
<key>0489_e059</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1466_v5562</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57433</integer>
<key>idVendor</key>
<integer>1161</integer>
</dict>
<key>0489_e079</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB</string>
<key>FirmwareKey</key>
<string>BCM4335C0_003.001.009.0066.0115_v4211</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57465</integer>
<key>idVendor</key>
<integer>1161</integer>
</dict>
<key>0489_e07a</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1483.1651_v5747</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57466</integer>
<key>idVendor</key>
<integer>1161</integer>
</dict>
<key>0489_e087</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1532_v5628</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57479</integer>
<key>idVendor</key>
<integer>1161</integer>
</dict>
<key>0489_e096</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0340_v4436</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57494</integer>
<key>idVendor</key>
<integer>1161</integer>
</dict>
<key>0489_e0a1</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.1 USB</string>
<key>FirmwareKey</key>
<string>BCM20703A1_001.001.005.0214.0414_v4510</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57505</integer>
<key>idVendor</key>
<integer>1161</integer>
</dict>
<key>04ca_2003</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1488_v5584</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8195</integer>
<key>idVendor</key>
<integer>1226</integer>
</dict>
<key>04ca_2004</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1489_v5585</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8196</integer>
<key>idVendor</key>
<integer>1226</integer>
</dict>
<key>04ca_2005</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth Module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1490_v5586</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8197</integer>
<key>idVendor</key>
<integer>1226</integer>
</dict>
<key>04ca_2006</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth Module</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0327_v4423</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8198</integer>
<key>idVendor</key>
<integer>1226</integer>
</dict>
<key>04ca_2009</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0330_v4426</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8201</integer>
<key>idVendor</key>
<integer>1226</integer>
</dict>
<key>04ca_200a</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1492_v5588</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8202</integer>
<key>idVendor</key>
<integer>1226</integer>
</dict>
<key>04ca_200b</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1493_v5589</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8203</integer>
<key>idVendor</key>
<integer>1226</integer>
</dict>
<key>04ca_200c</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1494_v5590</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8204</integer>
<key>idVendor</key>
<integer>1226</integer>
</dict>
<key>04ca_200e</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1499_v5595</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8206</integer>
<key>idVendor</key>
<integer>1226</integer>
</dict>
<key>04ca_200f</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1521_v5617</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8207</integer>
<key>idVendor</key>
<integer>1226</integer>
</dict>
<key>04ca_2012</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0339_v4435</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8210</integer>
<key>idVendor</key>
<integer>1226</integer>
</dict>
<key>04ca_2016</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB</string>
<key>FirmwareKey</key>
<string>BCM4335C0_003.001.009.0066.0121_v4217</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8214</integer>
<key>idVendor</key>
<integer>1226</integer>
</dict>
<key>04f2_b4a1</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0316_v4412</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>46241</integer>
<key>idVendor</key>
<integer>1266</integer>
</dict>
<key>050d_065a</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Belkin Bluetooth 4.0 USB Adapter</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1482_v5578</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>1626</integer>
<key>idVendor</key>
<integer>1293</integer>
</dict>
<key>0930_021e</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom BCM20702 Bluetooth USB Device</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1759_v5855</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>542</integer>
<key>idVendor</key>
<integer>2352</integer>
</dict>
<key>0930_021f</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0335_v4431</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>543</integer>
<key>idVendor</key>
<integer>2352</integer>
</dict>
<key>0930_0221</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom BCM20702 Bluetooth 4.0 USB Device</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1762_v5858</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>545</integer>
<key>idVendor</key>
<integer>2352</integer>
</dict>
<key>0930_0223</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom BCM20702 Bluetooth 4.0 USB Device</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1763_v5859</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>547</integer>
<key>idVendor</key>
<integer>2352</integer>
</dict>
<key>0930_0225</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB Device</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0334_v4430</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>549</integer>
<key>idVendor</key>
<integer>2352</integer>
</dict>
<key>0930_0226</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB Device</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0334_v4430</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>550</integer>
<key>idVendor</key>
<integer>2352</integer>
</dict>
<key>0930_0229</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB Device</string>
<key>FirmwareKey</key>
<string>BCM4335C0_003.001.009.0066.0104_v4200</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>553</integer>
<key>idVendor</key>
<integer>2352</integer>
</dict>
<key>0a5c_2168</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>BCM43162 Bluetooth 4.0 +HS USB Device</string>
<key>FirmwareKey</key>
<string>BCM4335C0_003.001.009.0066.0108_v4204</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8552</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_2169</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom BCM20702 Bluetooth USB Device</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1462_v5558</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8553</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_216a</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Dell Wireless 1708 Bluetooth 4.0 LE Device</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0336_v4432</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8554</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_216b</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom 20702 Bluetooth 4.0 Adapter</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1768_v5864</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8555</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_216c</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom 43142 Bluetooth 4.0 Adapter</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0328_v4424</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8556</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_216d</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom 43142 Bluetooth 4.0 Adapter</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0329_v4425</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8557</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_216e</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom 43162 Bluetooth 4.0 Adapter</string>
<key>FirmwareKey</key>
<string>BCM4335C0_003.001.009.0066.0105_v4201</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8558</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_216f</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>DW1560 Bluetooth 4.0 LE</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1572_v5668</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8559</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_21d7</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Dell Wireless 1704 Bluetooth v4.0+HS</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0341_v4437</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8663</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_21de</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom BCM20702 Bluetooth 4.0 +HS USB Device</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1461_v5557</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8670</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_21e1</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom 20702 Bluetooth 4.0 Adapter</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1770_v5866</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8673</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_21e3</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom 20702 Bluetooth 4.0 Adapter</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1767_v5863</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8675</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_21e6</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>ThinkPad Bluetooth 4.0</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1757_v5853</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8678</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_21e8</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom BCM20702 Bluetooth 4.0 USB Device</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1764_v5860</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8680</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_21ec</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom BCM20702 Bluetooth 4.0 USB Device</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1460_v5556</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8684</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_21f1</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 Adapter</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1765_v5861</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8689</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_21f3</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1761_v5857</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8691</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_21f4</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1760_v5856</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8692</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_21fb</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom 20702 Bluetooth 4.0 Adapter</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1766_v5862</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8699</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_21fd</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom BCM20702 Bluetooth 4.0 +HS USB Device</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1463_v5559</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>8701</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_640b</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 Adapter</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1769_v5865</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>25611</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_6410</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Dell Wireless 1830 Bluetooth 4.1 LE</string>
<key>FirmwareKey</key>
<string>BCM20703A1_001.001.005.0214.0422_v4518</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>25616</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_6412</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Dell Wireless 1820A Bluetooth 4.1 LE</string>
<key>FirmwareKey</key>
<string>BCM4350C5_003.006.007.0095.1703_v5799</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>25618</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_6413</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB Device</string>
<key>FirmwareKey</key>
<string>BCM4350C5_003.006.007.0120.2118_v6214</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>25619</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_6414</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.1 USB</string>
<key>FirmwareKey</key>
<string>BCM4350C5_003.006.007.0145.2724_v6820</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>25620</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_6417</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom 20702 Bluetooth 4.0</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1502.1780_v5876</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>25623</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_6418</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom 4371 Bluetooth 4.1 Adapter</string>
<key>FirmwareKey</key>
<string>BCM4371C2_001.003.015.0093.0116_v4212</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>25624</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0a5c_7460</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom BCM20703 Bluetooth USB Device</string>
<key>FirmwareKey</key>
<string>BCM20703A1_001.001.005.0214.0473_v4569</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>29792</integer>
<key>idVendor</key>
<integer>2652</integer>
</dict>
<key>0b05_17b5</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth Module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1468_v5564</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>6069</integer>
<key>idVendor</key>
<integer>2821</integer>
</dict>
<key>0b05_17cb</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>ASUS USB-BT400</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1467_v5563</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>6091</integer>
<key>idVendor</key>
<integer>2821</integer>
</dict>
<key>0b05_17cf</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1469_v5565</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>6095</integer>
<key>idVendor</key>
<integer>2821</integer>
</dict>
<key>0b05_180a</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1714_v5810</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>6154</integer>
<key>idVendor</key>
<integer>2821</integer>
</dict>
<key>0bb4_0306</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom BCM20703 Bluetooth USB Device</string>
<key>FirmwareKey</key>
<string>BCM20703A1_001.001.005.0214.0481_v4577</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>774</integer>
<key>idVendor</key>
<integer>2996</integer>
</dict>
<key>105b_e065</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0312_v4408</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57445</integer>
<key>idVendor</key>
<integer>4187</integer>
</dict>
<key>105b_e066</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1487_v5583</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>57446</integer>
<key>idVendor</key>
<integer>4187</integer>
</dict>
<key>13d3_3384</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1477_v5573</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13188</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3388</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>BCM43142 Bluetooth 4.0 +HS USB Device</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0332_v4428</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13192</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3389</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>BCM43142 Bluetooth 4.0 +HS USB Device</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0333_v4429</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13193</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3392</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth Module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1478_v5574</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13202</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3404</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth Module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1479_v5575</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13316</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3411</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom BCM20702 Bluetooth 4.0 +HS USB Device</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1450_v5546</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13329</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3413</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1481_v5577</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13331</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3418</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1480_v5576</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13336</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3427</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Broadcom Bluetooth 4.0 USB Device</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0334_v4430</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13351</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3435</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1501_v5597</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13365</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3456</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1502_v5598</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13398</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3482</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0346_v4442</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13442</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3484</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM43142A0_001.001.011.0311.0347_v4443</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13444</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3504</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM4371C2_001.003.015.0093.0118_v4214</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13572</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>13d3_3508</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Bluetooth USB module</string>
<key>FirmwareKey</key>
<string>BCM4371C2_001.003.015.0093.0117_v4213</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>13576</integer>
<key>idVendor</key>
<integer>5075</integer>
</dict>
<key>145f_01a3</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Trust Bluetooth 4.0 Adapter</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1483_v5579</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>419</integer>
<key>idVendor</key>
<integer>5215</integer>
</dict>
<key>413c_8143</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>DW1550 Bluetooth 4.0 LE</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1449_v5545</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>33091</integer>
<key>idVendor</key>
<integer>16700</integer>
</dict>
<key>413c_8197</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>DisplayName</key>
<string>Dell Wireless 380 Bluetooth 4.0 Module</string>
<key>FirmwareKey</key>
<string>BCM20702A1_001.002.014.1443.1447_v5543</string>
<key>IOClass</key>
<string>BrcmPatchRAM2</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAM2</string>
<key>IOProviderClass</key>
<string>IOUSBHostDevice</string>
<key>idProduct</key>
<integer>33175</integer>
<key>idVendor</key>
<integer>16700</integer>
</dict>
<key>BrcmPatchRAMResidency</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.no-one.BrcmPatchRAM2</string>
<key>IOClass</key>
<string>BrcmPatchRAMResidency</string>
<key>IOMatchCategory</key>
<string>BrcmPatchRAMResidency</string>
<key>IOProviderClass</key>
<string>disabled_IOResources</string>
</dict>
</dict>
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.iokit.IOUSBHostFamily</key>
<string>1.0.1</string>
<key>com.apple.kpi.bsd</key>
<string>8.0</string>
<key>com.apple.kpi.iokit</key>
<string>8.0</string>
<key>com.apple.kpi.libkern</key>
<string>8.0</string>
<key>com.apple.kpi.mach</key>
<string>8.0</string>
<key>com.no-one.BrcmFirmwareStore</key>
<string>2.2.7</string>
</dict>
<key>Source Code</key>
<string>https://github.com/RehabMan/BrcmPatchRAM.git</string>
</dict>
</plist>
| {
"pile_set_name": "Github"
} |
<?php
namespace CASHMusic\Admin;
use CASHMusic\Core\CASHSystem as CASHSystem;
use CASHMusic\Core\CASHRequest as CASHRequest;
use ArrayIterator;
use CASHMusic\Admin\AdminHelper;
$admin_helper = new AdminHelper($admin_primary_cash_request, $cash_admin);
if (!$request_parameters) {
AdminHelper::controllerRedirect('/calendar/venues/');
}
if (isset($_POST['dodelete']) || isset($_REQUEST['modalconfirm'])) {
$venue_delete_request = new CASHRequest(
array(
'cash_request_type' => 'calendar',
'cash_action' => 'deletevenue',
'venue_id' => $request_parameters[0]
)
);
if ($venue_delete_request->response['status_uid'] == 'calendar_deletevenue_200') {
$admin_helper->formSuccess('Success. Deleted.','/calendar/venues/' . $venue_delete_request->response['payload']);
} else {
$admin_helper->formFailure('Error. There was a problem deleting.');
}
}
$cash_admin->setPageContentTemplate('delete_confirm');
?> | {
"pile_set_name": "Github"
} |
<block_set xmlns="http://de.fhg.iais.roberta.blockly" robottype="ev3" xmlversion="" description="" tags="">
<instance x="-129" y="-18">
<block type="robActions_motor_on_for" id="395" inline="false" >
<field name="MOTORPORT">B</field>
<field name="MOTORROTATION">ROTATIONS</field>
<value name="POWER">
<block type="math_constant" id="361" >
<field name="CONSTANT">PI</field>
</block>
</value>
<value name="VALUE">
<block type="math_constant" id="376" >
<field name="CONSTANT">GOLDEN_RATIO</field>
</block>
</value>
</block>
</instance>
</block_set> | {
"pile_set_name": "Github"
} |
<?php
return [
[
'Introduction',
'Postcardware',
'Installation and Setup',
'Questions and Issues',
'Changelog',
'About us',
],
'Usage' => [
'Enum Setup',
'Make Enum',
'Enum Methods',
'Compare Enums',
],
];
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.