text
stringlengths 2
99.9k
| meta
dict |
|---|---|
package pgs
type mockPP struct {
match bool
out []byte
err error
}
func (pp mockPP) Match(a Artifact) bool { return pp.match }
func (pp mockPP) Process(in []byte) ([]byte, error) { return pp.out, pp.err }
|
{
"pile_set_name": "Github"
}
|
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
Foo foo.rb /^class Foo$/;" c
bar foo.rb /^ def bar$/;" f class:Foo
baz foo.rb ?^ def baz$?;" f class:Foo
foo foo.rb 2;" f class:Foo
foo test.rb /^def foo$/;" f class:Object
quux foo.rb /^ def quux(re: \/\\Afoo\\z\/)$/;" f class:Foo
quuux foo.rb abc;" f class:Foo
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
JBoss, Home of Professional Open Source
Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual
contributors by the @authors tag. See the copyright.txt in the
distribution for a full listing of individual 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.wildfly.quickstarts</groupId>
<artifactId>quickstart-parent</artifactId>
<!--
Maintain separation between the artifact id and the version to help prevent
merge conflicts between commits changing the GA and those changing the V.
-->
<version>21.0.0.Beta1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>hibernate</artifactId>
<packaging>war</packaging>
<name>Quickstart: hibernate</name>
<description>This project demonstrates how to use Hibernate 5</description>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<dependencies>
<!-- First declare the APIs we depend on and need for compilation.
All of them are provided by JBoss EAP -->
<!-- Import the CDI API, we use provided scope as the API is included in JBoss EAP -->
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<scope>provided</scope>
</dependency>
<!--Import dependencies to hibernate packages(eg. hibernate-core)
depending on features you want to use like Hibernate Session used in the
quickstart.
Scope is provided because these JARs are shipped with JBoss EAP -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<scope>provided</scope>
</dependency>
<!-- Import the JPA API, we use provided scope as the API is included in EAP -->
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Bean Validation Implementation
Provides portable constraints such as @Email
Hibernate Validator is shipped in JBoss EAP -->
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>provided</scope>
</dependency>
<!-- hibernate-validator dependencies excluded on server dependency management yet required -->
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Import the EJB API, we use provided scope as the API is included in JBoss EAP -->
<dependency>
<groupId>org.jboss.spec.javax.ejb</groupId>
<artifactId>jboss-ejb-api_3.2_spec</artifactId>
<scope>provided</scope>
</dependency>
<!-- Import the JSF API, we use provided scope as the API is included in JBoss EAP -->
<dependency>
<groupId>org.jboss.spec.javax.faces</groupId>
<artifactId>jboss-jsf-api_2.3_spec</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.xml.bind</groupId>
<artifactId>jboss-jaxb-api_2.3_spec</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.annotation</groupId>
<artifactId>jboss-annotations-api_1.3_spec</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
|
{
"pile_set_name": "Github"
}
|
dojo.provide("dojox.wire.ml.util");
dojo.require("dojox.xml.parser");
dojo.require("dojox.wire.Wire");
dojox.wire.ml._getValue = function(/*String*/source, /*Array*/args){
// summary:
// Return a value
// description:
// This method obtains an object by an ID of a widget or an DOM
// element.
// If 'source' specifies a dotted notation to its property, a Wire is
// used to get the object property.
// If 'source' starts with "arguments", 'args' is used as a root
// object for the Wire.
// source:
// A string to specify an object and its property
// args:
// An optional arguments array
// returns:
// A value
if(!source){
return undefined; //undefined
}
var property = undefined;
if(args && source.length >= 9 && source.substring(0, 9) == "arguments"){
property = source.substring(9);
return new dojox.wire.Wire({property: property}).getValue(args);
}
var i = source.indexOf('.');
if(i >= 0){
property = source.substring(i + 1);
source = source.substring(0, i);
}
var object = (dijit.byId(source) || dojo.byId(source) || dojo.getObject(source));
if(!object){
return undefined; //undefined
}
if(!property){
return object; //Object
}else{
return new dojox.wire.Wire({object: object, property: property}).getValue(); //anything
}
};
dojox.wire.ml._setValue = function(/*String*/target, /*anything*/value){
// summary:
// Store a value
// description:
// This method stores a value by an ID of a widget or an DOM
// element with a dotted notation to its property, using a Wire.
// target:
// A string to specify an object and its property
// value:
// A value
if(!target){
return; //undefined
}
var i = target.indexOf('.');
if(i < 0){
return; //undefined
}
var object = this._getValue(target.substring(0, i));
if(!object){
return; //undefined
}
var property = target.substring(i + 1);
var wire = new dojox.wire.Wire({object: object, property: property}).setValue(value);
};
dojo.declare("dojox.wire.ml.XmlElement", null, {
// summary:
// An object wrapping an XML element
// description:
// This class represents an XML element.
constructor: function(/*Element||String*/element){
// summary:
// Initialize with an XML element or a tag name
// element:
// An XML element or a tag name
if(dojo.isString(element)){
element = this._getDocument().createElement(element);
}
this.element = element;
},
getPropertyValue: function(/*String*/property){
// summary:
// Return a property value
// description:
// If 'property' starts with '@', the attribute value is returned.
// If 'property' specifies "text()", the value of the first child
// text is returned.
// Otherwise, child elements of the tag name specified with
// 'property' are returned.
// property:
// A property name
// returns:
// A property value
var value = undefined;
if(!this.element){
return value; //undefined
}
if(!property){
return value; //undefined
}
if(property.charAt(0) == '@'){
var attribute = property.substring(1);
value = this.element.getAttribute(attribute);
}else if(property == "text()"){
var text = this.element.firstChild;
if(text){
value = text.nodeValue;
}
}else{ // child elements
var elements = [];
for(var i = 0; i < this.element.childNodes.length; i++){
var child = this.element.childNodes[i];
if(child.nodeType === 1 /* ELEMENT_NODE */ && child.nodeName == property){
elements.push(new dojox.wire.ml.XmlElement(child));
}
}
if(elements.length > 0){
if(elements.length === 1){
value = elements[0];
}else{
value = elements;
}
}
}
return value; //String||Array||XmlElement
},
setPropertyValue: function(/*String*/property, /*String||Array||XmlElement*/value){
// summary:
// Store a property value
// description:
// If 'property' starts with '@', 'value' is set to the attribute.
// If 'property' specifies "text()", 'value' is set as the first
// child text.
// If 'value' is a string, a child element of the tag name
// specified with 'property' is created and 'value' is set as
// the first child text of the child element.
// Otherwise, 'value' is set to as child elements.
// property:
// A property name
// value:
// A property value
var i;
var text;
if(!this.element){
return; //undefined
}
if(!property){
return; //undefined
}
if(property.charAt(0) == '@'){
var attribute = property.substring(1);
if(value){
this.element.setAttribute(attribute, value);
}else{
this.element.removeAttribute(attribute);
}
}else if(property == "text()"){
while(this.element.firstChild){
this.element.removeChild(this.element.firstChild);
}
if(value){
text = this._getDocument().createTextNode(value);
this.element.appendChild(text);
}
}else{ // child elements
var nextChild = null;
var child;
for(i = this.element.childNodes.length - 1; i >= 0; i--){
child = this.element.childNodes[i];
if(child.nodeType === 1 /* ELEMENT_NODE */ && child.nodeName == property){
if(!nextChild){
nextChild = child.nextSibling;
}
this.element.removeChild(child);
}
}
if(value){
if(dojo.isArray(value)){
for(i in value){
var e = value[i];
if(e.element){
this.element.insertBefore(e.element, nextChild);
}
}
}else if(value instanceof dojox.wire.ml.XmlElement){
if(value.element){
this.element.insertBefore(value.element, nextChild);
}
}else{ // assume string
child = this._getDocument().createElement(property);
text = this._getDocument().createTextNode(value);
child.appendChild(text);
this.element.insertBefore(child, nextChild);
}
}
}
},
toString: function(){
// summary:
// Return a value of the first text child of the element
// description:
// A value of the first text child of the element is returned.
// returns:
// A value of the first text child of the element
var s = "";
if(this.element){
var text = this.element.firstChild;
if(text){
s = text.nodeValue;
}
}
return s; //String
},
toObject: function(){
// summary:
// Return an object representation of the element
// description:
// An object with properties for child elements, attributes and
// text is returned.
// returns:
// An object representation of the element
if(!this.element){
return null; //null
}
var text = "";
var obj = {};
var elements = 0;
var i;
for(i = 0; i < this.element.childNodes.length; i++){
var child = this.element.childNodes[i];
if(child.nodeType === 1 /* ELEMENT_NODE */){
elements++;
var o = new dojox.wire.ml.XmlElement(child).toObject();
var name = child.nodeName;
var p = obj[name];
if(!p){
obj[name] = o;
}else if(dojo.isArray(p)){
p.push(o);
}else{
obj[name] = [p, o]; // make them array
}
}else if(child.nodeType === 3 /* TEXT_NODE */ ||
child.nodeType === 4 /* CDATA_SECTION_NODE */){
text += child.nodeValue;
}
}
var attributes = 0;
if(this.element.nodeType === 1 /* ELEMENT_NODE */){
attributes = this.element.attributes.length;
for(i = 0; i < attributes; i++){
var attr = this.element.attributes[i];
obj["@" + attr.nodeName] = attr.nodeValue;
}
}
if(elements === 0){
if(attributes === 0){
// text only
return text; //String
}
// text with attributes
obj["text()"] = text;
}
// else ignore text
return obj; //Object
},
_getDocument: function(){
// summary:
// Return a DOM document
// description:
// If 'element' is specified, a DOM document of the element is
// returned.
// Otherwise, a DOM document is created.
// returns:
// A DOM document
if(this.element){
return (this.element.nodeType == 9 /* DOCUMENT_NODE */ ?
this.element : this.element.ownerDocument); //Document
}else{
return dojox.xml.parser.parse(); //Document
}
}
});
|
{
"pile_set_name": "Github"
}
|
{
"name" : "orchardpear",
"friendlyName" : "Pear Orchard",
"hueShiftOptions" : [-40, -25, 0, 25, 40],
"mainBlock" : "dirt",
"subBlocks" : [ "cobblestone", "plantmatter" ],
"ores" : "surface",
"spawnProfile" : {
"groups" : [
{
"select" : 3,
"pool" : [
[ 0.08, "bunnything" ],
[ 0.08, "fuhen" ],
[ 0.08, "fublackbat" ],
[ 0.08, "bobfae" ],
[ 0.08, "juvenilepoptop" ],
[ 0.08, "adultpoptop" ],
[ 0.08, "crutter" ],
[ 0.08, "spookit" ],
[ 0.08, "warmdeer" ]
]
},
{
"select" : 1,
"pool" : [
[ 0.2, "blueback" ],
[ 0.2, "greentip" ],
[ 0.2, "redwing" ],
[ 0.2, "bee_honey" ],
[ 0.2, "bee_carpenter" ]
]
},
{
"select" : 2,
"pool" : "generatedGround"
},
{
"select" : 4,
"pool" : [
[ 1, "birdcritter" ],
[ 1, "squirrelcritter" ],
[ 1, "snailcritter" ],
[ 1, "sporelingcritter" ],
[ 1, "owlcritter" ],
[ 1, "blipcritter" ],
[ 1, "mousecritter" ],
[ 1, "fireflyspawner" ]
]
}
],
"monsterParameters" : {
"colors" : "forest"
}
},
"weather" : [
[0, [
"/weather.config:garden"
]]
],
"skyOptions" : [
{
// sunny earth days, red/orange sunrise and purple/red sunset
"mainColor" : [255, 255, 255],
"morningColors" : [ [242, 120, 0], [255, 230, 176] ],
"dayColors" : [ [115, 224, 255], [255, 255, 255] ],
"eveningColors" : [ [125, 17, 158], [210, 52, 50] ],
"nightColors" : [ [24, 38, 53, 80], [58, 42, 70, 160] ],
"morningLightColor" : [140, 71, 0],
"dayLightColor" : [200, 200, 200],
"eveningLightColor" : [160, 120, 180],
"nightLightColor" : [40, 20, 60]
}
],
"parallax" : "/parallax/surface/garden.parallax",
"ambientNoises" : {
"day" : {
"tracks" : [ "/sfx/environmental/garden_day.ogg" ]
},
"night" : {
"tracks" : [ "/sfx/environmental/garden_night.ogg" ]
}
},
"musicTrack" : {
"day" : {
"tracks" : [ "/music/epsilon-indi.ogg", "/music/hymn-to-the-stars.ogg", "/music/procyon.ogg", "/music/stellarformation.ogg", "/music/vast-immortal-suns.ogg", "/music/atlas.ogg", "/music/blue-straggler.ogg", "/music/cygnus-x1.ogg", "/music/europa.ogg", "/music/haiku.ogg", "/music/m54.ogg", "/music/on-the-beach-at-night.ogg" ]
},
"night" : {
"tracks" : [ "/music/jupiter.ogg", "/music/arctic-constellation1.ogg", "/music/arctic-constellation2.ogg", "/music/mercury.ogg", "/music/mira.ogg", "/music/procyon.ogg", "/music/tranquility-base.ogg", "/music/psyche.ogg", "/music/accretion-disc.ogg", "/music/cygnus-x1.ogg", "/music/eridanus-supervoid.ogg", "/music/horsehead-nebula.ogg", "/music/large-magellanic-cloud.ogg", "/music/m54.ogg", "/music/nomads.ogg", "/music/on-the-beach-at-night.ogg" ]
}
},
"surfacePlaceables" : {
"grassMod" : [ "fualiengrass", "grass" ],
"grassModDensity" : 0.9,
"items" : [
{
"mode" : "floor",
"priority" : 1.0,
"variants" : 1,
"distribution" : "/biomes/distributions.config:potsRare",
"type" : "object",
"objectSets" : [
{
"pool" : [ [0.35, "capsulesmall" ], [0.35, "capsulemed" ], [0.35, "capsulebig" ] ],
"parameters" : { }
}
]
},
{
"mode" : "floor",
"priority" : 3.0,
"variants" : 6,
"distribution" : "/biomes/distributions.config:ffCommon",
"type" : "tree",
"treeFoliageHueShiftMax" : 0,
"treeStemHueShiftMax" : 0,
"treeStemList" : [ "pearwood" ],
"treeFoliageList" : [ "pear" ]
},
{
"mode" : "floor",
"priority" : 0.0,
"variants" : 1,
"distribution" : "/biomes/distributions.config:overgroundChests",
"type" : "treasureBox",
"treasureBoxSets" : [ "basicChest" ]
},
{
"mode" : "floor",
"priority" : 1.0,
"variants" : 1,
"distribution" : "/biomes/distributions.config:overgroundChests",
"type" : "object",
"objectSets" : [
{
"pool" : [ [1, "statuspod" ] ],
"parameters" : { }
}
]
},
{
"mode" : "floor",
"priority" : 0.0,
"variants" : 1,
"distribution" : "/biomes/distributions.config:overgroundChests",
"type" : "treasureBox",
"treasureBoxSets" : [ "weaponChest" ]
},
{
"mode" : "floor",
"priority" : 3.0,
"variants" : 1,
"distribution" : "/biomes/distributions.config:tiyDistTerrainfeatures",
"type" : "microdungeon",
"microdungeons" : [ "terrainfeatures" ]
}
]
},
"undergroundPlaceables" : {
"grassMod" : [ "grass" ],
"grassModDensity" : 0.3,
"ceilingGrassMod" : [ "undergrowth" ],
"ceilingGrassModDensity" : 0.3,
"items" : [
{
"mode" : "ceiling",
"priority" : 2.0,
"variants" : 1,
"distribution" : "/biomes/distributions.config:denseMedium",
"type" : "tree",
"treeFoliageHueShiftMax" : 180,
"treeStemHueShiftMax" : 180,
"treeStemList" : [ "vine", "vine2", "vine3", "vine4" ],
"treeFoliageList" : [ "flowery" ]
}
]
}
}
|
{
"pile_set_name": "Github"
}
|
---
layout: relation
title: 'nmod:appos'
shortdef: ''
udver: '2'
---
|
{
"pile_set_name": "Github"
}
|
---
title: "Associating Custom Data with SharePoint Tools Extensions | Microsoft Docs"
ms.date: "02/02/2017"
ms.topic: "conceptual"
dev_langs:
- "VB"
- "CSharp"
helpviewer_keywords:
- "projects [SharePoint development in Visual Studio], associating custom data"
- "project items [SharePoint development in Visual Studio], associating custom data"
- "SharePoint project items, associating custom data"
- "SharePoint projects, associating custom data"
- "SharePoint development in Visual Studio, extensibility features"
author: John-Hart
ms.author: johnhart
manager: jillfra
ms.workload:
- "office"
---
# Associate custom data with SharePoint tools extensions
You can add custom data to certain objects in SharePoint tools extensions. This is useful when you have data in one part of your extension that you want to access later from other code in your extension. Instead of implementing a custom way to store and access data, you can associate the data with an object in your extension and then retrieve the data from the same object later.
Adding custom data to objects is also useful when you want to preserve data that is relevant to a specific item in Visual Studio. SharePoint tools extensions are loaded just once in Visual Studio, so your extension might work with several different items (such as projects, project items, or **Server Explorer** nodes) at any time. If you have custom data that is relevant only to a specific item, you can add the data to the object that represents that item.
When you add custom data to objects in SharePoint tools extensions, the data does not persist. The data is available only during the lifespan of the object. After the object is reclaimed by garbage collection, the data is lost.
In extensions of the SharePoint project system, you can also save string data that persists after an extension is unloaded. For more information, see [Saving data in extensions of the SharePoint project system](../sharepoint/saving-data-in-extensions-of-the-sharepoint-project-system.md).
## Objects that can contain custom data
You can add custom data to any object in the SharePoint tools object model that implements the <xref:Microsoft.VisualStudio.SharePoint.IAnnotatedObject> interface. This interface defines just one property, <xref:Microsoft.VisualStudio.SharePoint.IAnnotatedObject.Annotations%2A>, which is a collection of custom data objects. The following types implement <xref:Microsoft.VisualStudio.SharePoint.IAnnotatedObject>:
- <xref:Microsoft.VisualStudio.SharePoint.IMappedFolder>
- <xref:Microsoft.VisualStudio.SharePoint.IMenuItem>
- <xref:Microsoft.VisualStudio.SharePoint.ISharePointProject>
- <xref:Microsoft.VisualStudio.SharePoint.ISharePointProjectFeature>
- <xref:Microsoft.VisualStudio.SharePoint.ISharePointProjectFeatureResourceFile>
- <xref:Microsoft.VisualStudio.SharePoint.ISharePointProjectItem>
- <xref:Microsoft.VisualStudio.SharePoint.ISharePointProjectItemFile>
- <xref:Microsoft.VisualStudio.SharePoint.ISharePointProjectItemType>
- <xref:Microsoft.VisualStudio.SharePoint.ISharePointProjectItemTypeDefinition>
- <xref:Microsoft.VisualStudio.SharePoint.ISharePointProjectMember>
- <xref:Microsoft.VisualStudio.SharePoint.ISharePointProjectPackage>
- <xref:Microsoft.VisualStudio.SharePoint.Deployment.IDeploymentContext>
- <xref:Microsoft.VisualStudio.SharePoint.Explorer.IExplorerNode>
- <xref:Microsoft.VisualStudio.SharePoint.Explorer.IExplorerNodeType>
- <xref:Microsoft.VisualStudio.SharePoint.Explorer.IExplorerNodeTypeDefinition>
## Add and retrieve custom data
To add custom data to an object in a SharePoint tools extension, get the <xref:Microsoft.VisualStudio.SharePoint.IAnnotatedObject.Annotations%2A> property of the object you want to add the data to, and then use the <xref:Microsoft.VisualStudio.SharePoint.IAnnotationDictionary.Add%2A> method to add the data to the object.
To retrieve custom data from an object in a SharePoint tools extension, get the <xref:Microsoft.VisualStudio.SharePoint.IAnnotatedObject.Annotations%2A> property of the object and then use one of the following methods:
- <xref:Microsoft.VisualStudio.SharePoint.IAnnotationDictionary.TryGetValue%2A>. This method returns **true** if the data object exists, or **false** if it does not exist. You can use this method to retrieve instances of value types or reference types.
- <xref:Microsoft.VisualStudio.SharePoint.IAnnotationDictionary.GetValue%2A>. This method returns the data object if it exits, or **null** if it does not exist. You can use this method only to retrieve instances of reference types.
The following code example determines whether a certain data object is already associated with a project item. If the data object is not already associated with the project item, then the code adds the object to the <xref:Microsoft.VisualStudio.SharePoint.IAnnotatedObject.Annotations%2A> property of the project item. To see this example in the context of a larger example, see [How to: Add a property to a custom SharePoint project item type](../sharepoint/how-to-add-a-property-to-a-custom-sharepoint-project-item-type.md).
[!code-vb[SPExtensibility.ProjectItemExtension.MenuAndProperty#13](../sharepoint/codesnippet/VisualBasic/projectitemmenuandproperty/extension/projectitemtypeproperty.vb#13)]
[!code-csharp[SPExtensibility.ProjectItemExtension.MenuAndProperty#13](../sharepoint/codesnippet/CSharp/projectitemmenuandproperty/extension/projectitemtypeproperty.cs#13)]
## See also
- [Programming concepts and features for SharePoint tools extensions](../sharepoint/programming-concepts-and-features-for-sharepoint-tools-extensions.md)
- [Walkthrough: Creating a custom action project item with an item template, Part 1](../sharepoint/walkthrough-creating-a-custom-action-project-item-with-an-item-template-part-1.md)
- [Walkthrough: Extending Server Explorer to display web parts](../sharepoint/walkthrough-extending-server-explorer-to-display-web-parts.md)
- [How to: Add a property to SharePoint projects](../sharepoint/how-to-add-a-property-to-sharepoint-projects.md)
- [How to: Add a property to a custom SharePoint project item type](../sharepoint/how-to-add-a-property-to-a-custom-sharepoint-project-item-type.md)
|
{
"pile_set_name": "Github"
}
|
package com.kbeanie.multipicker.sample;
import android.app.Application;
import com.crashlytics.android.Crashlytics;
import com.google.android.gms.ads.MobileAds;
import com.kbeanie.multipicker.api.Picker;
import com.kbeanie.multipicker.core.PickerManager;
import com.kbeanie.multipicker.sample.utils.PickerUtils;
import io.fabric.sdk.android.Fabric;
/**
* Created by kbibek on 2/18/16.
*/
public class AbApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
if (!BuildConfig.DEBUG) {
Fabric.with(this, new Crashlytics());
}
MobileAds.initialize(this);
PickerManager.debugglable = true;
}
}
|
{
"pile_set_name": "Github"
}
|
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
22FF882815F76E6900D6EACF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22FF882715F76E6900D6EACF /* UIKit.framework */; };
22FF882A15F76E6900D6EACF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22FF882915F76E6900D6EACF /* Foundation.framework */; };
22FF882C15F76E6900D6EACF /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22FF882B15F76E6900D6EACF /* CoreGraphics.framework */; };
22FF883215F76E6900D6EACF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 22FF883015F76E6900D6EACF /* InfoPlist.strings */; };
22FF883415F76E6900D6EACF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FF883315F76E6900D6EACF /* main.m */; };
22FF883815F76E6900D6EACF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FF883715F76E6900D6EACF /* AppDelegate.m */; };
22FF883B15F76E6900D6EACF /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FF883A15F76E6900D6EACF /* ViewController.m */; };
22FF883E15F76E6A00D6EACF /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22FF883C15F76E6A00D6EACF /* ViewController.xib */; };
22FF884815F7A4C100D6EACF /* CVCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FF884715F7A4C100D6EACF /* CVCell.m */; };
22FF884A15F7A66900D6EACF /* CVCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22FF884915F7A66900D6EACF /* CVCell.xib */; };
22FF885215F7BBF400D6EACF /* NibCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22FF885115F7BBF400D6EACF /* NibCell.xib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
22FF882315F76E6900D6EACF /* CollectionViewExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CollectionViewExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
22FF882715F76E6900D6EACF /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
22FF882915F76E6900D6EACF /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
22FF882B15F76E6900D6EACF /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
22FF882F15F76E6900D6EACF /* CollectionViewExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CollectionViewExample-Info.plist"; sourceTree = "<group>"; };
22FF883115F76E6900D6EACF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
22FF883315F76E6900D6EACF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
22FF883515F76E6900D6EACF /* CollectionViewExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CollectionViewExample-Prefix.pch"; sourceTree = "<group>"; };
22FF883615F76E6900D6EACF /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
22FF883715F76E6900D6EACF /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
22FF883915F76E6900D6EACF /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
22FF883A15F76E6900D6EACF /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
22FF883D15F76E6A00D6EACF /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController.xib; sourceTree = "<group>"; };
22FF884615F7A4C100D6EACF /* CVCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CVCell.h; sourceTree = "<group>"; };
22FF884715F7A4C100D6EACF /* CVCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CVCell.m; sourceTree = "<group>"; };
22FF884915F7A66900D6EACF /* CVCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CVCell.xib; sourceTree = "<group>"; };
22FF885115F7BBF400D6EACF /* NibCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NibCell.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
22FF882015F76E6900D6EACF /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
22FF882815F76E6900D6EACF /* UIKit.framework in Frameworks */,
22FF882A15F76E6900D6EACF /* Foundation.framework in Frameworks */,
22FF882C15F76E6900D6EACF /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
22FF881815F76E6900D6EACF = {
isa = PBXGroup;
children = (
22FF882D15F76E6900D6EACF /* CollectionViewExample */,
22FF882615F76E6900D6EACF /* Frameworks */,
22FF882415F76E6900D6EACF /* Products */,
);
sourceTree = "<group>";
};
22FF882415F76E6900D6EACF /* Products */ = {
isa = PBXGroup;
children = (
22FF882315F76E6900D6EACF /* CollectionViewExample.app */,
);
name = Products;
sourceTree = "<group>";
};
22FF882615F76E6900D6EACF /* Frameworks */ = {
isa = PBXGroup;
children = (
22FF882715F76E6900D6EACF /* UIKit.framework */,
22FF882915F76E6900D6EACF /* Foundation.framework */,
22FF882B15F76E6900D6EACF /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
22FF882D15F76E6900D6EACF /* CollectionViewExample */ = {
isa = PBXGroup;
children = (
22FF884D15F7BA7100D6EACF /* App delegate */,
22FF884E15F7BA7E00D6EACF /* Collection view */,
22FF885015F7BA9D00D6EACF /* Subclass-based cells */,
22FF884F15F7BA9600D6EACF /* Nib-based cells */,
22FF882E15F76E6900D6EACF /* Supporting Files */,
);
path = CollectionViewExample;
sourceTree = "<group>";
};
22FF882E15F76E6900D6EACF /* Supporting Files */ = {
isa = PBXGroup;
children = (
22FF882F15F76E6900D6EACF /* CollectionViewExample-Info.plist */,
22FF883015F76E6900D6EACF /* InfoPlist.strings */,
22FF883315F76E6900D6EACF /* main.m */,
22FF883515F76E6900D6EACF /* CollectionViewExample-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
22FF884D15F7BA7100D6EACF /* App delegate */ = {
isa = PBXGroup;
children = (
22FF883615F76E6900D6EACF /* AppDelegate.h */,
22FF883715F76E6900D6EACF /* AppDelegate.m */,
);
name = "App delegate";
sourceTree = "<group>";
};
22FF884E15F7BA7E00D6EACF /* Collection view */ = {
isa = PBXGroup;
children = (
22FF883915F76E6900D6EACF /* ViewController.h */,
22FF883A15F76E6900D6EACF /* ViewController.m */,
22FF883C15F76E6A00D6EACF /* ViewController.xib */,
);
name = "Collection view";
sourceTree = "<group>";
};
22FF884F15F7BA9600D6EACF /* Nib-based cells */ = {
isa = PBXGroup;
children = (
22FF885115F7BBF400D6EACF /* NibCell.xib */,
);
name = "Nib-based cells";
sourceTree = "<group>";
};
22FF885015F7BA9D00D6EACF /* Subclass-based cells */ = {
isa = PBXGroup;
children = (
22FF884615F7A4C100D6EACF /* CVCell.h */,
22FF884715F7A4C100D6EACF /* CVCell.m */,
22FF884915F7A66900D6EACF /* CVCell.xib */,
);
name = "Subclass-based cells";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
22FF882215F76E6900D6EACF /* CollectionViewExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 22FF884115F76E6A00D6EACF /* Build configuration list for PBXNativeTarget "CollectionViewExample" */;
buildPhases = (
22FF881F15F76E6900D6EACF /* Sources */,
22FF882015F76E6900D6EACF /* Frameworks */,
22FF882115F76E6900D6EACF /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = CollectionViewExample;
productName = CollectionViewExample;
productReference = 22FF882315F76E6900D6EACF /* CollectionViewExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
22FF881A15F76E6900D6EACF /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Charismatic Megafauna Ltd";
};
buildConfigurationList = 22FF881D15F76E6900D6EACF /* Build configuration list for PBXProject "CollectionViewExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 22FF881815F76E6900D6EACF;
productRefGroup = 22FF882415F76E6900D6EACF /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
22FF882215F76E6900D6EACF /* CollectionViewExample */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
22FF882115F76E6900D6EACF /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
22FF883215F76E6900D6EACF /* InfoPlist.strings in Resources */,
22FF883E15F76E6A00D6EACF /* ViewController.xib in Resources */,
22FF884A15F7A66900D6EACF /* CVCell.xib in Resources */,
22FF885215F7BBF400D6EACF /* NibCell.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
22FF881F15F76E6900D6EACF /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
22FF883415F76E6900D6EACF /* main.m in Sources */,
22FF883815F76E6900D6EACF /* AppDelegate.m in Sources */,
22FF883B15F76E6900D6EACF /* ViewController.m in Sources */,
22FF884815F7A4C100D6EACF /* CVCell.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
22FF883015F76E6900D6EACF /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
22FF883115F76E6900D6EACF /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
22FF883C15F76E6A00D6EACF /* ViewController.xib */ = {
isa = PBXVariantGroup;
children = (
22FF883D15F76E6A00D6EACF /* en */,
);
name = ViewController.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
22FF883F15F76E6A00D6EACF /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = 2;
};
name = Debug;
};
22FF884015F76E6A00D6EACF /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = 2;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
22FF884215F76E6A00D6EACF /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "CollectionViewExample/CollectionViewExample-Prefix.pch";
INFOPLIST_FILE = "CollectionViewExample/CollectionViewExample-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = 2;
WRAPPER_EXTENSION = app;
};
name = Debug;
};
22FF884315F76E6A00D6EACF /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "CollectionViewExample/CollectionViewExample-Prefix.pch";
INFOPLIST_FILE = "CollectionViewExample/CollectionViewExample-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = 2;
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
22FF881D15F76E6900D6EACF /* Build configuration list for PBXProject "CollectionViewExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
22FF883F15F76E6A00D6EACF /* Debug */,
22FF884015F76E6A00D6EACF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
22FF884115F76E6A00D6EACF /* Build configuration list for PBXNativeTarget "CollectionViewExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
22FF884215F76E6A00D6EACF /* Debug */,
22FF884315F76E6A00D6EACF /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 22FF881A15F76E6900D6EACF /* Project object */;
}
|
{
"pile_set_name": "Github"
}
|
package zipkintracer_test
import (
"testing"
zipkin "github.com/openzipkin/zipkin-go-opentracing"
)
func TestBoundarySampler(t *testing.T) {
type triple struct {
id uint64
salt int64
rate float64
}
for input, want := range map[triple]bool{
{123, 456, 1.0}: true,
{123, 456, 999}: true,
{123, 456, 0.0}: false,
{123, 456, -42}: false,
{1229998, 0, 0.01}: false,
{1229999, 0, 0.01}: false,
{1230000, 0, 0.01}: true,
{1230001, 0, 0.01}: true,
{1230098, 0, 0.01}: true,
{1230099, 0, 0.01}: true,
{1230100, 0, 0.01}: false,
{1230101, 0, 0.01}: false,
{1, 9999999, 0.01}: false,
{999, 0, 0.99}: true,
{9999, 0, 0.99}: false,
} {
sampler := zipkin.NewBoundarySampler(input.rate, input.salt)
if have := sampler(input.id); want != have {
t.Errorf("%#+v: want %v, have %v", input, want, have)
}
}
}
func TestCountingSampler(t *testing.T) {
for n := 1; n < 100; n++ {
sampler := zipkin.NewCountingSampler(float64(n) / 100)
found := 0
for i := 0; i < 100; i++ {
if sampler(1) {
found++
}
}
if found != n {
t.Errorf("want %d, have %d\n", n, found)
}
}
}
|
{
"pile_set_name": "Github"
}
|
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2015 Google, Inc
* Written by Simon Glass <sjg@chromium.org>
*/
#include <common.h>
#include <dm.h>
#include <log.h>
#include <syscon.h>
#include <asm/arch-rockchip/clock.h>
static const struct udevice_id rk3188_syscon_ids[] = {
{ .compatible = "rockchip,rk3188-noc", .data = ROCKCHIP_SYSCON_NOC },
{ .compatible = "rockchip,rk3188-grf", .data = ROCKCHIP_SYSCON_GRF },
{ .compatible = "rockchip,rk3188-pmu", .data = ROCKCHIP_SYSCON_PMU },
{ }
};
U_BOOT_DRIVER(syscon_rk3188) = {
.name = "rk3188_syscon",
.id = UCLASS_SYSCON,
.of_match = rk3188_syscon_ids,
};
#if CONFIG_IS_ENABLED(OF_PLATDATA)
static int rk3188_syscon_bind_of_platdata(struct udevice *dev)
{
dev->driver_data = dev->driver->of_match->data;
debug("syscon: %s %d\n", dev->name, (uint)dev->driver_data);
return 0;
}
U_BOOT_DRIVER(rockchip_rk3188_noc) = {
.name = "rockchip_rk3188_noc",
.id = UCLASS_SYSCON,
.of_match = rk3188_syscon_ids,
.bind = rk3188_syscon_bind_of_platdata,
};
U_BOOT_DRIVER(rockchip_rk3188_grf) = {
.name = "rockchip_rk3188_grf",
.id = UCLASS_SYSCON,
.of_match = rk3188_syscon_ids + 1,
.bind = rk3188_syscon_bind_of_platdata,
};
U_BOOT_DRIVER(rockchip_rk3188_pmu) = {
.name = "rockchip_rk3188_pmu",
.id = UCLASS_SYSCON,
.of_match = rk3188_syscon_ids + 2,
.bind = rk3188_syscon_bind_of_platdata,
};
#endif
|
{
"pile_set_name": "Github"
}
|
; Kunena Forum translation
;
; All translations can be found from https://www.transifex.com/projects/p/Kunena/
; Please join the translation team if you want to contribute your changes to the next release.
;
; License GNU General Public License version 3 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8 - No BOM
; Using new INI string format for Joomla! 2.5
MOD_KUNENAMENU = "Kunena تىزىملىكى مودۇلى"
MOD_KUNENAMENU_FIELD_ALLCHILDREN_DESC = "تىزىملىكنى يېيىپ تارماق تىزىملىك بىلەن بىرلىكتە كۆرسىتىش"
MOD_KUNENAMENU_FIELD_ALLCHILDREN_LABEL = "تارماق تىزىملىك ئەزاسىنى كۆرسىتىش"
MOD_KUNENAMENU_FIELD_CLASS_DESC = "تىزىملىك ئەزاسىنىڭ CSS ئارقا قوشۇلغۇچىسى"
MOD_KUNENAMENU_FIELD_CLASS_LABEL = "تىزىملىك ئارقا ئۇلىغۇچىسى"
MOD_KUNENAMENU_FIELD_ENDLEVEL_DESC = "كۆرسىتىلىدىغان تىزىملىك ئەزاسىنىڭ ئاخىرلىشىش دەرىجىسى. ئەگەر «بارلىق» تاللانسا، «تارماق تىزىملىك ئەزاسىنى كۆرسىتىش» تەڭشىكىگە باغلىق بولۇپ، بارلىق دەرىجىدىكى تىزىملىكنىڭ ھەممىسى كۆرسىتىلىدۇ."
MOD_KUNENAMENU_FIELD_ENDLEVEL_LABEL = "ئاخىرلىشىش دەرىجىسى"
MOD_KUNENAMENU_FIELD_MENUTYPE_DESC = "تۆۋەندىكى تىزمىدىن تىزىملىك تاللاڭ"
MOD_KUNENAMENU_FIELD_MENUTYPE_LABEL = "تىزىملىك تاللاش"
MOD_KUNENAMENU_FIELD_STARTLEVEL_DESC = "كۆرسىتىلىدىغان تىزىملىك ئەزاسىنىڭ باشلىنىش دەرىجىسى. ئەگەر باشلىنىش دەرىجىسى بىلەن ئاخىرلىشىش دەرىجىسى ئوخشاش بولۇپ، «تارماق تىزىملىك ئەزاسىنى كۆرسىتىش» تەڭشىكى «ھەئە» دەپ بېكىتىلگەن بولسا، ئۇ ھالدا پەقەت نۆۋەتتىكى دەرىجىدىكى تىزىملىك ئەزاسىلا كۆرسىتىلىدۇ."
MOD_KUNENAMENU_FIELD_STARTLEVEL_LABEL = "باشلىنىش دەرىجىسى"
MOD_KUNENAMENU_FIELD_TAG_ID_DESC = "تىزىملىكنىڭ غول UL نىڭ ID خاسلىقىنى تەڭشەش (تاللاش تۈرى)"
MOD_KUNENAMENU_FIELD_TAG_ID_LABEL = "تىزىملىك خەتكۈچىنىڭ ID سى"
MOD_KUNENAMENU_FIELD_TARGET_DESC = "سەكرىمە كۆزنەكنىڭ JavaScript قىممىتى، e.g. top=50,left=50,width=200,height=300"
MOD_KUNENAMENU_FIELD_TARGET_LABEL = "نىشان ئورۇن"
MOD_KUNENAMENU_XML_DESCRIPTION = "بۇ، مۇنبەر تىزىملىكىنى ئالدى سۇپىدا كۆرسىتىش مودۇلى"
|
{
"pile_set_name": "Github"
}
|
/*******************************************************************************************************
*
* msi.gama.util.file.IGamaFileMetaData.java, in plugin msi.gama.core,
* is part of the source code of the GAMA modeling and simulation platform (v. 1.8.1)
*
* (c) 2007-2020 UMI 209 UMMISCO IRD/SU & Partners
*
* Visit https://github.com/gama-platform/gama for license information and contacts.
*
********************************************************************************************************/
package msi.gama.util.file;
/**
* Class IGamaFileInfo. Provides meta-information on files (like crs and envelope for shapefiles, number of rows/columns
* for csv files, etc. Used in the UI for decorating files in the navigator. Will be used also to accelerate the loading
* of files in GAMA, when it can be retrieved ( i.e. when we are in a workspace context).
*
* @author drogoul
* @since 11 févr. 2015
*
*/
public interface IGamaFileMetaData {
/**
* A delimiter character for separating attributes in the property string
*/
final static public String DELIMITER = "_!_";
final static public String SUB_DELIMITER = "@%@";
public final static String FAILED = "failed";
public final static String SUFFIX_DEL = " | ";
long getModificationStamp();
/**
* Indicates a failure in the computation of metadata
*
* @return
*/
boolean hasFailed();
/**
* Never returns null
*
* @return the suffix to use for decorating files in the navigator
*/
String getSuffix();
void appendSuffix(StringBuilder sb);
/**
* Returns a thumbnail (imageDescriptor or anything else) or null if no image are provided
*
* @return an image (ImageDescriptor, BufferedImage, ...) or null
*/
public Object getThumbnail();
/**
* Returns a string that can be stored in the metadata part of the workspace. The implementing classes should also
* allow instantiating with this string as an input
*
* @return a string describing completely the attributes of this metadata or null
*/
public String toPropertyString();
/**
* Returns a string that can be displayed in hover info
*
* @return
*/
public String getDocumentation();
/**
* @param modificationStamp
*/
void setModificationStamp(long modificationStamp);
}
|
{
"pile_set_name": "Github"
}
|
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#if defined(MULTIBOOT_LOAD_ELF32)
# define XX 32
# define E_MACHINE MULTIBOOT_ELF32_MACHINE
# define ELFCLASSXX ELFCLASS32
# define Elf_Ehdr Elf32_Ehdr
# define Elf_Phdr Elf32_Phdr
# define Elf_Shdr Elf32_Shdr
#elif defined(MULTIBOOT_LOAD_ELF64)
# define XX 64
# define E_MACHINE MULTIBOOT_ELF64_MACHINE
# define ELFCLASSXX ELFCLASS64
# define Elf_Ehdr Elf64_Ehdr
# define Elf_Phdr Elf64_Phdr
# define Elf_Shdr Elf64_Shdr
#else
#error "I'm confused"
#endif
#include <grub/i386/relocator.h>
#define CONCAT(a,b) CONCAT_(a, b)
#define CONCAT_(a,b) a ## b
#pragma GCC diagnostic ignored "-Wcast-align"
/* Check if BUFFER contains ELF32 (or ELF64). */
static int
CONCAT(grub_multiboot_is_elf, XX) (void *buffer)
{
Elf_Ehdr *ehdr = (Elf_Ehdr *) buffer;
return ehdr->e_ident[EI_CLASS] == ELFCLASSXX;
}
static grub_err_t
CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld)
{
Elf_Ehdr *ehdr = (Elf_Ehdr *) mld->buffer;
char *phdr_base;
grub_err_t err;
grub_relocator_chunk_t ch;
grub_uint32_t load_offset, load_size;
int i;
void *source;
if (ehdr->e_ident[EI_MAG0] != ELFMAG0
|| ehdr->e_ident[EI_MAG1] != ELFMAG1
|| ehdr->e_ident[EI_MAG2] != ELFMAG2
|| ehdr->e_ident[EI_MAG3] != ELFMAG3
|| ehdr->e_ident[EI_DATA] != ELFDATA2LSB)
return grub_error(GRUB_ERR_UNKNOWN_OS, N_("invalid arch-independent ELF magic"));
if (ehdr->e_ident[EI_CLASS] != ELFCLASSXX || ehdr->e_machine != E_MACHINE
|| ehdr->e_version != EV_CURRENT)
return grub_error (GRUB_ERR_UNKNOWN_OS, N_("invalid arch-dependent ELF magic"));
if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN)
return grub_error (GRUB_ERR_UNKNOWN_OS, N_("this ELF file is not of the right type"));
/* FIXME: Should we support program headers at strange locations? */
if (ehdr->e_phoff + (grub_uint32_t) ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH)
return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset");
phdr_base = (char *) mld->buffer + ehdr->e_phoff;
#define phdr(i) ((Elf_Phdr *) (phdr_base + (i) * ehdr->e_phentsize))
mld->link_base_addr = ~0;
/* Calculate lowest and highest load address. */
for (i = 0; i < ehdr->e_phnum; i++)
if (phdr(i)->p_type == PT_LOAD)
{
mld->link_base_addr = grub_min (mld->link_base_addr, phdr(i)->p_paddr);
highest_load = grub_max (highest_load, phdr(i)->p_paddr + phdr(i)->p_memsz);
}
#ifdef MULTIBOOT_LOAD_ELF64
if (highest_load >= 0x100000000)
return grub_error (GRUB_ERR_BAD_OS, "segment crosses 4 GiB border");
#endif
load_size = highest_load - mld->link_base_addr;
if (mld->relocatable)
{
if (load_size > mld->max_addr || mld->min_addr > mld->max_addr - load_size)
return grub_error (GRUB_ERR_BAD_OS, "invalid min/max address and/or load size");
err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch,
mld->min_addr, mld->max_addr - load_size,
load_size, mld->align ? mld->align : 1,
mld->preference, mld->avoid_efi_boot_services);
}
else
err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, &ch,
mld->link_base_addr, load_size);
if (err)
{
grub_dprintf ("multiboot_loader", "Cannot allocate memory for OS image\n");
return err;
}
mld->load_base_addr = get_physical_target_address (ch);
source = get_virtual_current_address (ch);
grub_dprintf ("multiboot_loader", "link_base_addr=0x%x, load_base_addr=0x%x, "
"load_size=0x%x, relocatable=%d\n", mld->link_base_addr,
mld->load_base_addr, load_size, mld->relocatable);
if (mld->relocatable)
grub_dprintf ("multiboot_loader", "align=0x%lx, preference=0x%x, avoid_efi_boot_services=%d\n",
(long) mld->align, mld->preference, mld->avoid_efi_boot_services);
/* Load every loadable segment in memory. */
for (i = 0; i < ehdr->e_phnum; i++)
{
if (phdr(i)->p_type == PT_LOAD)
{
grub_dprintf ("multiboot_loader", "segment %d: paddr=0x%lx, memsz=0x%lx, vaddr=0x%lx\n",
i, (long) phdr(i)->p_paddr, (long) phdr(i)->p_memsz, (long) phdr(i)->p_vaddr);
load_offset = phdr(i)->p_paddr - mld->link_base_addr;
if (phdr(i)->p_filesz != 0)
{
if (grub_file_seek (mld->file, (grub_off_t) phdr(i)->p_offset)
== (grub_off_t) -1)
return grub_errno;
if (grub_file_read (mld->file, (grub_uint8_t *) source + load_offset, phdr(i)->p_filesz)
!= (grub_ssize_t) phdr(i)->p_filesz)
{
if (!grub_errno)
grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"),
mld->filename);
return grub_errno;
}
}
if (phdr(i)->p_filesz < phdr(i)->p_memsz)
grub_memset ((grub_uint8_t *) source + load_offset + phdr(i)->p_filesz, 0,
phdr(i)->p_memsz - phdr(i)->p_filesz);
}
}
for (i = 0; i < ehdr->e_phnum; i++)
if (phdr(i)->p_vaddr <= ehdr->e_entry
&& phdr(i)->p_vaddr + phdr(i)->p_memsz > ehdr->e_entry)
{
grub_multiboot_payload_eip = (ehdr->e_entry - phdr(i)->p_vaddr)
+ phdr(i)->p_paddr;
#ifdef MULTIBOOT_LOAD_ELF64
# ifdef __mips
/* We still in 32-bit mode. */
if ((ehdr->e_entry - phdr(i)->p_vaddr)
+ phdr(i)->p_paddr < 0xffffffff80000000ULL)
return grub_error (GRUB_ERR_BAD_OS, "invalid entry point for ELF64");
# else
/* We still in 32-bit mode. */
if ((ehdr->e_entry - phdr(i)->p_vaddr)
+ phdr(i)->p_paddr > 0xffffffff)
return grub_error (GRUB_ERR_BAD_OS, "invalid entry point for ELF64");
# endif
#endif
break;
}
if (i == ehdr->e_phnum)
return grub_error (GRUB_ERR_BAD_OS, "entry point isn't in a segment");
#if defined (__i386__) || defined (__x86_64__)
#elif defined (__mips)
grub_multiboot_payload_eip |= 0x80000000;
#else
#error Please complete this
#endif
if (ehdr->e_shnum)
{
grub_uint8_t *shdr, *shdrptr;
shdr = grub_malloc ((grub_uint32_t) ehdr->e_shnum * ehdr->e_shentsize);
if (!shdr)
return grub_errno;
if (grub_file_seek (mld->file, ehdr->e_shoff) == (grub_off_t) -1)
{
grub_free (shdr);
return grub_errno;
}
if (grub_file_read (mld->file, shdr, (grub_uint32_t) ehdr->e_shnum * ehdr->e_shentsize)
!= (grub_ssize_t) ehdr->e_shnum * ehdr->e_shentsize)
{
if (!grub_errno)
grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"),
mld->filename);
return grub_errno;
}
for (shdrptr = shdr, i = 0; i < ehdr->e_shnum;
shdrptr += ehdr->e_shentsize, i++)
{
Elf_Shdr *sh = (Elf_Shdr *) shdrptr;
void *src;
grub_addr_t target;
if (mld->mbi_ver >= 2 && (sh->sh_type == SHT_REL || sh->sh_type == SHT_RELA))
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "ELF files with relocs are not supported yet");
/* This section is a loaded section,
so we don't care. */
if (sh->sh_addr != 0)
continue;
/* This section is empty, so we don't care. */
if (sh->sh_size == 0)
continue;
err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, 0,
(0xffffffff - sh->sh_size) + 1,
sh->sh_size, sh->sh_addralign,
GRUB_RELOCATOR_PREFERENCE_NONE,
mld->avoid_efi_boot_services);
if (err)
{
grub_dprintf ("multiboot_loader", "Error loading shdr %d\n", i);
return err;
}
src = get_virtual_current_address (ch);
target = get_physical_target_address (ch);
if (grub_file_seek (mld->file, sh->sh_offset) == (grub_off_t) -1)
return grub_errno;
if (grub_file_read (mld->file, src, sh->sh_size)
!= (grub_ssize_t) sh->sh_size)
{
if (!grub_errno)
grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"),
mld->filename);
return grub_errno;
}
sh->sh_addr = target;
}
grub_multiboot_add_elfsyms (ehdr->e_shnum, ehdr->e_shentsize,
ehdr->e_shstrndx, shdr);
}
#undef phdr
return grub_errno;
}
#undef XX
#undef E_MACHINE
#undef ELFCLASSXX
#undef Elf_Ehdr
#undef Elf_Phdr
#undef Elf_Shdr
|
{
"pile_set_name": "Github"
}
|
/*
* parameters.h
* Brandon Azad
*/
#ifndef VOUCHER_SWAP__PARAMETERS_H_
#define VOUCHER_SWAP__PARAMETERS_H_
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#ifdef PARAMETERS_EXTERN
#define extern PARAMETERS_EXTERN
#endif
// Some helpful units.
#define KB (1024uLL)
#define MB (1024uLL * KB)
#define GB (1024uLL * MB)
// Generate the name for an offset.
#define OFFSET(base_, object_) _##base_##__##object_##__offset_
// Generate the name for the size of an object.
#define SIZE(object_) _##object_##__size_
// Generate the name for the size of a zalloc block of objects.
#define BLOCK_SIZE(object_) _##object_##__block_size_
// Generate the name for the number of elements in a zalloc block.
#define COUNT_PER_BLOCK(object_) _##object_##__per_block_
// Generate the name for the address of an object.
#define ADDRESS(object_) _##object_##__address_
// Generate the name for the static (unslid) address of an object.
#define STATIC_ADDRESS(object_) _##object_##__static_address_
// A convenience macro for accessing a field of a structure.
#define FIELD(object_, struct_, field_, type_) \
( *(type_ *) ( ((uint8_t *) object_) + OFFSET(struct_, field_) ) )
// The static base address of the kernel.
extern uint64_t STATIC_ADDRESS(kernel_base);
// The kernel_slide granularity.
extern uint64_t kernel_slide_step;
// Messages up to this size are allocated from the dedicated ipc.kmsgs zone.
extern size_t message_size_for_kmsg_zone;
// The size of elements in ipc.kmsgs.
extern size_t kmsg_zone_size;
// The maximum number of OOL ports in a single message.
extern size_t max_ool_ports_per_message;
// How much to allocate between sleeps while trying to trigger garbage collection.
extern size_t gc_step;
// Parameters for ipc_entry.
extern size_t SIZE(ipc_entry);
extern size_t OFFSET(ipc_entry, ie_object);
extern size_t OFFSET(ipc_entry, ie_bits);
extern size_t OFFSET(ipc_entry, ie_request);
// Parameters for ipc_port.
extern size_t SIZE(ipc_port);
extern size_t BLOCK_SIZE(ipc_port);
extern size_t COUNT_PER_BLOCK(ipc_port);
extern size_t OFFSET(ipc_port, ip_bits);
extern size_t OFFSET(ipc_port, ip_references);
extern size_t OFFSET(ipc_port, waitq_flags);
extern size_t OFFSET(ipc_port, imq_messages);
extern size_t OFFSET(ipc_port, imq_msgcount);
extern size_t OFFSET(ipc_port, imq_qlimit);
extern size_t OFFSET(ipc_port, ip_receiver);
extern size_t OFFSET(ipc_port, ip_kobject);
extern size_t OFFSET(ipc_port, ip_nsrequest);
extern size_t OFFSET(ipc_port, ip_requests);
extern size_t OFFSET(ipc_port, ip_mscount);
extern size_t OFFSET(ipc_port, ip_srights);
// Parameters for ipc_port_request.
extern size_t SIZE(ipc_port_request);
extern size_t OFFSET(ipc_port_request, ipr_soright);
// Parameters for struct ipc_space.
extern size_t OFFSET(ipc_space, is_table_size);
extern size_t OFFSET(ipc_space, is_table);
// Parameters for ipc_voucher.
extern size_t SIZE(ipc_voucher);
extern size_t BLOCK_SIZE(ipc_voucher);
extern size_t COUNT_PER_BLOCK(ipc_voucher);
// Parameters for struct proc.
extern size_t OFFSET(proc, p_pid);
extern size_t OFFSET(proc, p_ucred);
// Parameters for struct sysctl_oid.
extern size_t SIZE(sysctl_oid);
extern size_t OFFSET(sysctl_oid, oid_parent);
extern size_t OFFSET(sysctl_oid, oid_link);
extern size_t OFFSET(sysctl_oid, oid_kind);
extern size_t OFFSET(sysctl_oid, oid_handler);
extern size_t OFFSET(sysctl_oid, oid_version);
extern size_t OFFSET(sysctl_oid, oid_refcnt);
// Parameters for struct task.
extern size_t OFFSET(task, lck_mtx_type);
extern size_t OFFSET(task, ref_count);
extern size_t OFFSET(task, active);
extern size_t OFFSET(task, map);
extern size_t OFFSET(task, itk_space);
extern size_t OFFSET(task, bsd_info);
/*
* parameters_init
*
* Description:
* Initialize the parameters for the system.
*/
bool parameters_init(void);
#undef extern
#endif
|
{
"pile_set_name": "Github"
}
|
var slide = require('../slide');
var fs = require('fs');
fs.readFile('slide/test.md', 'utf8', function(err, data) {
var res = slide(data);
console.log(res);
});
|
{
"pile_set_name": "Github"
}
|
/**
* Sequences and sequence utility tools.
*/
package com.topologi.diffx.sequence;
|
{
"pile_set_name": "Github"
}
|
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
v1beta1 "k8s.io/api/policy/v1beta1"
"k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
type PolicyV1beta1Interface interface {
RESTClient() rest.Interface
EvictionsGetter
PodDisruptionBudgetsGetter
PodSecurityPoliciesGetter
}
// PolicyV1beta1Client is used to interact with features provided by the policy group.
type PolicyV1beta1Client struct {
restClient rest.Interface
}
func (c *PolicyV1beta1Client) Evictions(namespace string) EvictionInterface {
return newEvictions(c, namespace)
}
func (c *PolicyV1beta1Client) PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface {
return newPodDisruptionBudgets(c, namespace)
}
func (c *PolicyV1beta1Client) PodSecurityPolicies() PodSecurityPolicyInterface {
return newPodSecurityPolicies(c)
}
// NewForConfig creates a new PolicyV1beta1Client for the given config.
func NewForConfig(c *rest.Config) (*PolicyV1beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &PolicyV1beta1Client{client}, nil
}
// NewForConfigOrDie creates a new PolicyV1beta1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *PolicyV1beta1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new PolicyV1beta1Client for the given RESTClient.
func New(c rest.Interface) *PolicyV1beta1Client {
return &PolicyV1beta1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1beta1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *PolicyV1beta1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}
|
{
"pile_set_name": "Github"
}
|
/*
* Remote processor messaging transport (OMAP platform-specific bits)
*
* Copyright (C) 2011 Texas Instruments, Inc.
* Copyright (C) 2011 Google, Inc.
*
* Ohad Ben-Cohen <ohad@wizery.com>
* Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* 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.
*/
#include "remoteproc.h"
#ifndef dev_dbg
#define dev_dbg(dev,fmt,...) printf(fmt,__VA_ARGS__)
#endif
#ifndef dev_err
#define dev_err(dev,fmt,...) printf(fmt,__VA_ARGS__)
#endif
#define IRQ_NONE false
#define IS_ERR(ptr) (NULL==ptr)
static int l_errno = 0;
static inline void* ERR_PTR(int errno) {
l_errno=errno;
return NULL;
}
#define PTR_ERR(ptr) (l_errno)
typedef bool irqreturn_t;
/* kick the remote processor, and let it know which virtqueue to poke at */
static bool rproc_virtio_notify(struct virtqueue *vq)
{
struct rproc_vring *rvring = vq->priv;
struct rproc *rproc = rvring->rvdev->rproc;
int notifyid = rvring->notifyid;
dev_dbg(&rproc->dev, "kicking vq index: %d\n", notifyid);
rproc->ops->kick(rproc, notifyid);
return true;
}
/**
* rproc_vq_interrupt() - tell remoteproc that a virtqueue is interrupted
* @rproc: handle to the remote processor
* @notifyid: index of the signalled virtqueue (unique per this @rproc)
*
* This function should be called by the platform-specific rproc driver,
* when the remote processor signals that a specific virtqueue has pending
* messages available.
*
* Returns IRQ_NONE if no message was found in the @notifyid virtqueue,
* and otherwise returns IRQ_HANDLED.
*/
irqreturn_t rproc_vq_interrupt(struct rproc *rproc, int notifyid)
{
struct rproc_vring *rvring;
dev_dbg(&rproc->dev, "vq index %d is interrupted\n", notifyid);
//rvring = idr_find(&rproc->notifyids, notifyid);
// TODO : from notifyid to get rvring
if (!rvring || !rvring->vq)
return IRQ_NONE;
return vring_interrupt(0, rvring->vq);
}
static struct virtqueue *rp_find_vq(struct virtio_device *vdev,
unsigned id,
void (*callback)(struct virtqueue *vq),
const char *name)
{
struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
struct rproc *rproc = vdev_to_rproc(vdev);
struct device *dev = &rproc->dev;
struct rproc_vring *rvring;
struct virtqueue *vq;
void *addr;
int len, size, ret;
/* we're temporarily limited to two virtqueues per rvdev */
if (id >= ARRAY_SIZE(rvdev->vring))
return ERR_PTR(-EINVAL);
if (!name)
return NULL;
ret = rproc_alloc_vring(rvdev, id);
if (ret)
return ERR_PTR(ret);
rvring = &rvdev->vring[id];
addr = rvring->va;
len = rvring->len;
/* zero vring */
size = vring_size(len, rvring->align);
memset(addr, 0, size);
dev_dbg(dev, "vring%d: va %p qsz %d notifyid %d\n",
id, addr, len, rvring->notifyid);
/*
* Create the new vq, and tell virtio we're not interested in
* the 'weak' smp barriers, since we're talking with a real device.
*/
vq = vring_new_virtqueue(id, len, rvring->align, vdev, false, addr,
rproc_virtio_notify, callback, name);
if (!vq) {
dev_err(dev, "vring_new_virtqueue %s failed\n", name);
rproc_free_vring(rvring);
return ERR_PTR(-ENOMEM);
}
rvring->vq = vq;
vq->priv = rvring;
return vq;
}
static void __rproc_virtio_del_vqs(struct virtio_device *vdev)
{
struct virtqueue *vq, *n;
struct rproc_vring *rvring;
// list_for_each_entry_safe(vq, n, &vdev->vqs, list) {
// rvring = vq->priv;
// rvring->vq = NULL;
// vring_del_virtqueue(vq);
// rproc_free_vring(rvring);
// }
}
static void rproc_virtio_del_vqs(struct virtio_device *vdev)
{
struct rproc *rproc = vdev_to_rproc(vdev);
/* power down the remote processor before deleting vqs */
rproc_shutdown(rproc);
__rproc_virtio_del_vqs(vdev);
}
static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned nvqs,
struct virtqueue *vqs[],
vq_callback_t *callbacks[],
const char *names[])
{
struct rproc *rproc = vdev_to_rproc(vdev);
int i, ret;
for (i = 0; i < nvqs; ++i) {
vqs[i] = rp_find_vq(vdev, i, callbacks[i], names[i]);
if (IS_ERR(vqs[i])) {
ret = PTR_ERR(vqs[i]);
goto error;
}
}
/* now that the vqs are all set, boot the remote processor */
ret = rproc_boot(rproc);
if (ret) {
dev_err(&rproc->dev, "rproc_boot() failed %d\n", ret);
goto error;
}
return 0;
error:
__rproc_virtio_del_vqs(vdev);
return ret;
}
static u8 rproc_virtio_get_status(struct virtio_device *vdev)
{
struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
struct fw_rsc_vdev *rsc;
rsc = (void *)rvdev->rproc->table_ptr + rvdev->rsc_offset;
return rsc->status;
}
static void rproc_virtio_set_status(struct virtio_device *vdev, u8 status)
{
struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
struct fw_rsc_vdev *rsc;
rsc = (void *)rvdev->rproc->table_ptr + rvdev->rsc_offset;
rsc->status = status;
dev_dbg(&vdev->dev, "status: %d\n", status);
}
static void rproc_virtio_reset(struct virtio_device *vdev)
{
struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
struct fw_rsc_vdev *rsc;
rsc = (void *)rvdev->rproc->table_ptr + rvdev->rsc_offset;
rsc->status = 0;
dev_dbg(&vdev->dev, "reset !\n",0);
}
/* provide the vdev features as retrieved from the firmware */
static u64 rproc_virtio_get_features(struct virtio_device *vdev)
{
struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
struct fw_rsc_vdev *rsc;
rsc = (void *)rvdev->rproc->table_ptr + rvdev->rsc_offset;
return rsc->dfeatures;
}
static int rproc_virtio_finalize_features(struct virtio_device *vdev)
{
struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
struct fw_rsc_vdev *rsc;
rsc = (void *)rvdev->rproc->table_ptr + rvdev->rsc_offset;
/* Give virtio_ring a chance to accept features */
vring_transport_features(vdev);
/* Make sure we don't have any features > 32 bits! */
BUG_ON((u32)vdev->features != vdev->features);
/*
* Remember the finalized features of our vdev, and provide it
* to the remote processor once it is powered on.
*/
rsc->gfeatures = vdev->features;
return 0;
}
static void rproc_virtio_get(struct virtio_device *vdev, unsigned offset,
void *buf, unsigned len)
{
struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
struct fw_rsc_vdev *rsc;
void *cfg;
rsc = (void *)rvdev->rproc->table_ptr + rvdev->rsc_offset;
cfg = &rsc->vring[rsc->num_of_vrings];
if (offset + len > rsc->config_len || offset + len < len) {
dev_err(&vdev->dev, "rproc_virtio_get: access out of bounds\n",0);
return;
}
memcpy(buf, cfg + offset, len);
}
static void rproc_virtio_set(struct virtio_device *vdev, unsigned offset,
const void *buf, unsigned len)
{
struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
struct fw_rsc_vdev *rsc;
void *cfg;
rsc = (void *)rvdev->rproc->table_ptr + rvdev->rsc_offset;
cfg = &rsc->vring[rsc->num_of_vrings];
if (offset + len > rsc->config_len || offset + len < len) {
dev_err(&vdev->dev, "rproc_virtio_set: access out of bounds\n",0);
return;
}
memcpy(cfg + offset, buf, len);
}
//static const struct virtio_config_ops rproc_virtio_config_ops = {
// .get_features = rproc_virtio_get_features,
// .finalize_features = rproc_virtio_finalize_features,
// .find_vqs = rproc_virtio_find_vqs,
// .del_vqs = rproc_virtio_del_vqs,
// .reset = rproc_virtio_reset,
// .set_status = rproc_virtio_set_status,
// .get_status = rproc_virtio_get_status,
// .get = rproc_virtio_get,
// .set = rproc_virtio_set,
//};
/*
* This function is called whenever vdev is released, and is responsible
* to decrement the remote processor's refcount which was taken when vdev was
* added.
*
* Never call this function directly; it will be called by the driver
* core when needed.
*/
static void rproc_vdev_release(struct device *dev)
{
// struct virtio_device *vdev = dev_to_virtio(dev);
// struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
// struct rproc *rproc = vdev_to_rproc(vdev);
//
// list_del(&rvdev->node);
// kfree(rvdev);
//
// put_device(&rproc->dev);
}
/**
* rproc_add_virtio_dev() - register an rproc-induced virtio device
* @rvdev: the remote vdev
*
* This function registers a virtio device. This vdev's partent is
* the rproc device.
*
* Returns 0 on success or an appropriate error value otherwise.
*/
int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)
{
struct rproc *rproc = rvdev->rproc;
struct device *dev = &rproc->dev;
struct virtio_device *vdev = &rvdev->vdev;
int ret;
// vdev->id.device = id,
// vdev->config = &rproc_virtio_config_ops,
// vdev->dev.parent = dev;
// vdev->dev.release = rproc_vdev_release;
//
// /*
// * We're indirectly making a non-temporary copy of the rproc pointer
// * here, because drivers probed with this vdev will indirectly
// * access the wrapping rproc.
// *
// * Therefore we must increment the rproc refcount here, and decrement
// * it _only_ when the vdev is released.
// */
// get_device(&rproc->dev);
//
// ret = register_virtio_device(vdev);
// if (ret) {
// put_device(&rproc->dev);
// dev_err(dev, "failed to register vdev: %d\n", ret);
// goto out;
// }
//
// dev_info(dev, "registered %s (type %d)\n", dev_name(&vdev->dev), id);
out:
return ret;
}
/**
* rproc_remove_virtio_dev() - remove an rproc-induced virtio device
* @rvdev: the remote vdev
*
* This function unregisters an existing virtio device.
*/
void rproc_remove_virtio_dev(struct rproc_vdev *rvdev)
{
unregister_virtio_device(&rvdev->vdev);
}
|
{
"pile_set_name": "Github"
}
|
/**
* jQuery Galleriffic plugin
*
* Copyright (c) 2008 Trent Foley (http://trentacular.com)
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* Much thanks to primary contributer Ponticlaro (http://www.ponticlaro.com)
*/
;(function($) {
// Globally keep track of all images by their unique hash. Each item is an image data object.
var allImages = {};
var imageCounter = 0;
// Galleriffic static class
$.galleriffic = {
version: '2.0.1',
// Strips invalid characters and any leading # characters
normalizeHash: function(hash) {
return hash.replace(/^.*#/, '').replace(/\?.*$/, '');
},
getImage: function(hash) {
if (!hash)
return undefined;
hash = $.galleriffic.normalizeHash(hash);
return allImages[hash];
},
// Global function that looks up an image by its hash and displays the image.
// Returns false when an image is not found for the specified hash.
// @param {String} hash This is the unique hash value assigned to an image.
gotoImage: function(hash) {
var imageData = $.galleriffic.getImage(hash);
if (!imageData)
return false;
var gallery = imageData.gallery;
gallery.gotoImage(imageData);
return true;
},
// Removes an image from its respective gallery by its hash.
// Returns false when an image is not found for the specified hash or the
// specified owner gallery does match the located images gallery.
// @param {String} hash This is the unique hash value assigned to an image.
// @param {Object} ownerGallery (Optional) When supplied, the located images
// gallery is verified to be the same as the specified owning gallery before
// performing the remove operation.
removeImageByHash: function(hash, ownerGallery) {
var imageData = $.galleriffic.getImage(hash);
if (!imageData)
return false;
var gallery = imageData.gallery;
if (ownerGallery && ownerGallery != gallery)
return false;
return gallery.removeImageByIndex(imageData.index);
}
};
var defaults = {
delay: 3000,
numThumbs: 20,
preloadAhead: 40, // Set to -1 to preload all images
enableTopPager: false,
enableBottomPager: true,
maxPagesToShow: 7,
imageContainerSel: '',
captionContainerSel: '',
controlsContainerSel: '',
loadingContainerSel: '',
renderSSControls: true,
renderNavControls: true,
playLinkText: 'Play',
pauseLinkText: 'Pause',
prevLinkText: 'Previous',
nextLinkText: 'Next',
nextPageLinkText: 'Next ›',
prevPageLinkText: '‹ Prev',
enableHistory: false,
enableKeyboardNavigation: true,
autoStart: false,
syncTransitions: false,
defaultTransitionDuration: 1000,
onSlideChange: undefined, // accepts a delegate like such: function(prevIndex, nextIndex) { ... }
onTransitionOut: undefined, // accepts a delegate like such: function(slide, caption, isSync, callback) { ... }
onTransitionIn: undefined, // accepts a delegate like such: function(slide, caption, isSync) { ... }
onPageTransitionOut: undefined, // accepts a delegate like such: function(callback) { ... }
onPageTransitionIn: undefined, // accepts a delegate like such: function() { ... }
onImageAdded: undefined, // accepts a delegate like such: function(imageData, $li) { ... }
onImageRemoved: undefined // accepts a delegate like such: function(imageData, $li) { ... }
};
// Primary Galleriffic initialization function that should be called on the thumbnail container.
$.fn.galleriffic = function(settings) {
// Extend Gallery Object
$.extend(this, {
// Returns the version of the script
version: $.galleriffic.version,
// Current state of the slideshow
isSlideshowRunning: false,
slideshowTimeout: undefined,
// This function is attached to the click event of generated hyperlinks within the gallery
clickHandler: function(e, link) {
this.pause();
if (!this.enableHistory) {
// The href attribute holds the unique hash for an image
var hash = $.galleriffic.normalizeHash($(link).attr('href'));
$.galleriffic.gotoImage(hash);
e.preventDefault();
}
},
// Appends an image to the end of the set of images. Argument listItem can be either a jQuery DOM element or arbitrary html.
// @param listItem Either a jQuery object or a string of html of the list item that is to be added to the gallery.
appendImage: function(listItem) {
this.addImage(listItem, false, false);
return this;
},
// Inserts an image into the set of images. Argument listItem can be either a jQuery DOM element or arbitrary html.
// @param listItem Either a jQuery object or a string of html of the list item that is to be added to the gallery.
// @param {Integer} position The index within the gallery where the item shouold be added.
insertImage: function(listItem, position) {
this.addImage(listItem, false, true, position);
return this;
},
// Adds an image to the gallery and optionally inserts/appends it to the DOM (thumbExists)
// @param listItem Either a jQuery object or a string of html of the list item that is to be added to the gallery.
// @param {Boolean} thumbExists Specifies whether the thumbnail already exists in the DOM or if it needs to be added.
// @param {Boolean} insert Specifies whether the the image is appended to the end or inserted into the gallery.
// @param {Integer} position The index within the gallery where the item shouold be added.
addImage: function(listItem, thumbExists, insert, position) {
var $li = ( typeof listItem === "string" ) ? $(listItem) : listItem;
var $aThumb = $li.find('a.thumb');
var slideUrl = $aThumb.attr('href');
var title = $aThumb.attr('title');
var $caption = $li.find('.caption').remove();
var hash = $aThumb.attr('name');
// Increment the image counter
imageCounter++;
// Autogenerate a hash value if none is present or if it is a duplicate
if (!hash || allImages[''+hash]) {
hash = imageCounter;
}
// Set position to end when not specified
if (!insert)
position = this.data.length;
var imageData = {
title:title,
slideUrl:slideUrl,
caption:$caption,
hash:hash,
gallery:this,
index:position
};
// Add the imageData to this gallery's array of images
if (insert) {
this.data.splice(position, 0, imageData);
// Reset index value on all imageData objects
this.updateIndices(position);
}
else {
this.data.push(imageData);
}
var gallery = this;
// Add the element to the DOM
if (!thumbExists) {
// Update thumbs passing in addition post transition out handler
this.updateThumbs(function() {
var $thumbsUl = gallery.find('ul.thumbs');
if (insert)
$thumbsUl.children(':eq('+position+')').before($li);
else
$thumbsUl.append($li);
if (gallery.onImageAdded)
gallery.onImageAdded(imageData, $li);
});
}
// Register the image globally
allImages[''+hash] = imageData;
// Setup attributes and click handler
$aThumb.attr('rel', 'history')
.attr('href', '#'+hash)
.removeAttr('name')
.click(function(e) {
gallery.clickHandler(e, this);
});
return this;
},
// Removes an image from the gallery based on its index.
// Returns false when the index is out of range.
removeImageByIndex: function(index) {
if (index < 0 || index >= this.data.length)
return false;
var imageData = this.data[index];
if (!imageData)
return false;
this.removeImage(imageData);
return true;
},
// Convenience method that simply calls the global removeImageByHash method.
removeImageByHash: function(hash) {
return $.galleriffic.removeImageByHash(hash, this);
},
// Removes an image from the gallery.
removeImage: function(imageData) {
var index = imageData.index;
// Remove the image from the gallery data array
this.data.splice(index, 1);
// Remove the global registration
delete allImages[''+imageData.hash];
// Remove the image's list item from the DOM
this.updateThumbs(function() {
var $li = gallery.find('ul.thumbs')
.children(':eq('+index+')')
.remove();
if (gallery.onImageRemoved)
gallery.onImageRemoved(imageData, $li);
});
// Update each image objects index value
this.updateIndices(index);
return this;
},
// Updates the index values of the each of the images in the gallery after the specified index
updateIndices: function(startIndex) {
for (i = startIndex; i < this.data.length; i++) {
this.data[i].index = i;
}
return this;
},
// Scraped the thumbnail container for thumbs and adds each to the gallery
initializeThumbs: function() {
this.data = [];
var gallery = this;
this.find('ul.thumbs > li').each(function(i) {
gallery.addImage($(this), true, false);
});
return this;
},
isPreloadComplete: false,
// Initalizes the image preloader
preloadInit: function() {
if (this.preloadAhead == 0) return this;
this.preloadStartIndex = this.currentImage.index;
var nextIndex = this.getNextIndex(this.preloadStartIndex);
return this.preloadRecursive(this.preloadStartIndex, nextIndex);
},
// Changes the location in the gallery the preloader should work
// @param {Integer} index The index of the image where the preloader should restart at.
preloadRelocate: function(index) {
// By changing this startIndex, the current preload script will restart
this.preloadStartIndex = index;
return this;
},
// Recursive function that performs the image preloading
// @param {Integer} startIndex The index of the first image the current preloader started on.
// @param {Integer} currentIndex The index of the current image to preload.
preloadRecursive: function(startIndex, currentIndex) {
// Check if startIndex has been relocated
if (startIndex != this.preloadStartIndex) {
var nextIndex = this.getNextIndex(this.preloadStartIndex);
return this.preloadRecursive(this.preloadStartIndex, nextIndex);
}
var gallery = this;
// Now check for preloadAhead count
var preloadCount = currentIndex - startIndex;
if (preloadCount < 0)
preloadCount = this.data.length-1-startIndex+currentIndex;
if (this.preloadAhead >= 0 && preloadCount > this.preloadAhead) {
// Do this in order to keep checking for relocated start index
setTimeout(function() { gallery.preloadRecursive(startIndex, currentIndex); }, 500);
return this;
}
var imageData = this.data[currentIndex];
if (!imageData)
return this;
// If already loaded, continue
if (imageData.image)
return this.preloadNext(startIndex, currentIndex);
// Preload the image
var image = new Image();
image.onload = function() {
imageData.image = this;
gallery.preloadNext(startIndex, currentIndex);
};
image.alt = imageData.title;
image.src = imageData.slideUrl;
return this;
},
// Called by preloadRecursive in order to preload the next image after the previous has loaded.
// @param {Integer} startIndex The index of the first image the current preloader started on.
// @param {Integer} currentIndex The index of the current image to preload.
preloadNext: function(startIndex, currentIndex) {
var nextIndex = this.getNextIndex(currentIndex);
if (nextIndex == startIndex) {
this.isPreloadComplete = true;
} else {
// Use setTimeout to free up thread
var gallery = this;
setTimeout(function() { gallery.preloadRecursive(startIndex, nextIndex); }, 100);
}
return this;
},
// Safe way to get the next image index relative to the current image.
// If the current image is the last, returns 0
getNextIndex: function(index) {
var nextIndex = index+1;
if (nextIndex >= this.data.length)
nextIndex = 0;
return nextIndex;
},
// Safe way to get the previous image index relative to the current image.
// If the current image is the first, return the index of the last image in the gallery.
getPrevIndex: function(index) {
var prevIndex = index-1;
if (prevIndex < 0)
prevIndex = this.data.length-1;
return prevIndex;
},
// Pauses the slideshow
pause: function() {
this.isSlideshowRunning = false;
if (this.slideshowTimeout) {
clearTimeout(this.slideshowTimeout);
this.slideshowTimeout = undefined;
}
if (this.$controlsContainer) {
this.$controlsContainer
.find('div.ss-controls a').removeClass().addClass('play')
.attr('title', this.playLinkText)
.attr('href', '#play')
.html(this.playLinkText);
}
return this;
},
// Plays the slideshow
play: function() {
this.isSlideshowRunning = true;
if (this.$controlsContainer) {
this.$controlsContainer
.find('div.ss-controls a').removeClass().addClass('pause')
.attr('title', this.pauseLinkText)
.attr('href', '#pause')
.html(this.pauseLinkText);
}
if (!this.slideshowTimeout) {
var gallery = this;
this.slideshowTimeout = setTimeout(function() { gallery.ssAdvance(); }, this.delay);
}
return this;
},
// Toggles the state of the slideshow (playing/paused)
toggleSlideshow: function() {
if (this.isSlideshowRunning)
this.pause();
else
this.play();
return this;
},
// Advances the slideshow to the next image and delegates navigation to the
// history plugin when history is enabled
// enableHistory is true
ssAdvance: function() {
if (this.isSlideshowRunning)
this.next(true);
return this;
},
// Advances the gallery to the next image.
// @param {Boolean} dontPause Specifies whether to pause the slideshow.
// @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.
next: function(dontPause, bypassHistory) {
this.gotoIndex(this.getNextIndex(this.currentImage.index), dontPause, bypassHistory);
return this;
},
// Navigates to the previous image in the gallery.
// @param {Boolean} dontPause Specifies whether to pause the slideshow.
// @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.
previous: function(dontPause, bypassHistory) {
this.gotoIndex(this.getPrevIndex(this.currentImage.index), dontPause, bypassHistory);
return this;
},
// Navigates to the next page in the gallery.
// @param {Boolean} dontPause Specifies whether to pause the slideshow.
// @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.
nextPage: function(dontPause, bypassHistory) {
var page = this.getCurrentPage();
var lastPage = this.getNumPages() - 1;
if (page < lastPage) {
var startIndex = page * this.numThumbs;
var nextPage = startIndex + this.numThumbs;
this.gotoIndex(nextPage, dontPause, bypassHistory);
}
return this;
},
// Navigates to the previous page in the gallery.
// @param {Boolean} dontPause Specifies whether to pause the slideshow.
// @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.
previousPage: function(dontPause, bypassHistory) {
var page = this.getCurrentPage();
if (page > 0) {
var startIndex = page * this.numThumbs;
var prevPage = startIndex - this.numThumbs;
this.gotoIndex(prevPage, dontPause, bypassHistory);
}
return this;
},
// Navigates to the image at the specified index in the gallery
// @param {Integer} index The index of the image in the gallery to display.
// @param {Boolean} dontPause Specifies whether to pause the slideshow.
// @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.
gotoIndex: function(index, dontPause, bypassHistory) {
if (!dontPause)
this.pause();
if (index < 0) index = 0;
else if (index >= this.data.length) index = this.data.length-1;
var imageData = this.data[index];
if (!bypassHistory && this.enableHistory)
$.historyLoad(String(imageData.hash)); // At the moment, historyLoad only accepts string arguments
else
this.gotoImage(imageData);
return this;
},
// This function is garaunteed to be called anytime a gallery slide changes.
// @param {Object} imageData An object holding the image metadata of the image to navigate to.
gotoImage: function(imageData) {
var index = imageData.index;
if (this.onSlideChange)
this.onSlideChange(this.currentImage.index, index);
this.currentImage = imageData;
this.preloadRelocate(index);
this.refresh();
return this;
},
// Returns the default transition duration value. The value is halved when not
// performing a synchronized transition.
// @param {Boolean} isSync Specifies whether the transitions are synchronized.
getDefaultTransitionDuration: function(isSync) {
if (isSync)
return this.defaultTransitionDuration;
return this.defaultTransitionDuration / 2;
},
// Rebuilds the slideshow image and controls and performs transitions
refresh: function() {
var imageData = this.currentImage;
if (!imageData)
return this;
var index = imageData.index;
// Update Controls
if (this.$controlsContainer) {
this.$controlsContainer
.find('div.nav-controls a.prev').attr('href', '#'+this.data[this.getPrevIndex(index)].hash).end()
.find('div.nav-controls a.next').attr('href', '#'+this.data[this.getNextIndex(index)].hash);
}
var previousSlide = this.$imageContainer.find('span.current').addClass('previous').removeClass('current');
var previousCaption = 0;
if (this.$captionContainer) {
previousCaption = this.$captionContainer.find('span.current').addClass('previous').removeClass('current');
}
// Perform transitions simultaneously if syncTransitions is true and the next image is already preloaded
var isSync = this.syncTransitions && imageData.image;
// Flag we are transitioning
var isTransitioning = true;
var gallery = this;
var transitionOutCallback = function() {
// Flag that the transition has completed
isTransitioning = false;
// Remove the old slide
previousSlide.remove();
// Remove old caption
if (previousCaption)
previousCaption.remove();
if (!isSync) {
if (imageData.image && imageData.hash == gallery.data[gallery.currentImage.index].hash) {
gallery.buildImage(imageData, isSync);
} else {
// Show loading container
if (gallery.$loadingContainer) {
gallery.$loadingContainer.show();
}
}
}
};
if (previousSlide.length == 0) {
// For the first slide, the previous slide will be empty, so we will call the callback immediately
transitionOutCallback();
} else {
if (this.onTransitionOut) {
this.onTransitionOut(previousSlide, previousCaption, isSync, transitionOutCallback);
} else {
previousSlide.fadeTo(this.getDefaultTransitionDuration(isSync), 0.0, transitionOutCallback);
if (previousCaption)
previousCaption.fadeTo(this.getDefaultTransitionDuration(isSync), 0.0);
}
}
// Go ahead and begin transitioning in of next image
if (isSync)
this.buildImage(imageData, isSync);
if (!imageData.image) {
var image = new Image();
// Wire up mainImage onload event
image.onload = function() {
imageData.image = this;
// Only build image if the out transition has completed and we are still on the same image hash
if (!isTransitioning && imageData.hash == gallery.data[gallery.currentImage.index].hash) {
gallery.buildImage(imageData, isSync);
}
};
// set alt and src
image.alt = imageData.title;
image.src = imageData.slideUrl;
}
// This causes the preloader (if still running) to relocate out from the currentIndex
this.relocatePreload = true;
return this.syncThumbs();
},
// Called by the refresh method after the previous image has been transitioned out or at the same time
// as the out transition when performing a synchronous transition.
// @param {Object} imageData An object holding the image metadata of the image to build.
// @param {Boolean} isSync Specifies whether the transitions are synchronized.
buildImage: function(imageData, isSync) {
var gallery = this;
var nextIndex = this.getNextIndex(imageData.index);
// Construct new hidden span for the image
var newSlide = this.$imageContainer
.append('<span class="image-wrapper current"><a class="advance-link" rel="history" href="#'+this.data[nextIndex].hash+'" title="'+imageData.title+'"> </a></span>')
.find('span.current').css('opacity', '0');
newSlide.find('a')
.append(imageData.image)
.click(function(e) {
gallery.clickHandler(e, this);
});
var newCaption = 0;
if (this.$captionContainer) {
// Construct new hidden caption for the image
newCaption = this.$captionContainer
.append('<span class="image-caption current"></span>')
.find('span.current').css('opacity', '0')
.append(imageData.caption);
}
// Hide the loading conatiner
if (this.$loadingContainer) {
this.$loadingContainer.hide();
}
// Transition in the new image
if (this.onTransitionIn) {
this.onTransitionIn(newSlide, newCaption, isSync);
} else {
newSlide.fadeTo(this.getDefaultTransitionDuration(isSync), 1.0);
if (newCaption)
newCaption.fadeTo(this.getDefaultTransitionDuration(isSync), 1.0);
}
if (this.isSlideshowRunning) {
if (this.slideshowTimeout)
clearTimeout(this.slideshowTimeout);
this.slideshowTimeout = setTimeout(function() { gallery.ssAdvance(); }, this.delay);
}
return this;
},
// Returns the current page index that should be shown for the currentImage
getCurrentPage: function() {
return Math.floor(this.currentImage.index / this.numThumbs);
},
// Applies the selected class to the current image's corresponding thumbnail.
// Also checks if the current page has changed and updates the displayed page of thumbnails if necessary.
syncThumbs: function() {
var page = this.getCurrentPage();
if (page != this.displayedPage)
this.updateThumbs();
// Remove existing selected class and add selected class to new thumb
var $thumbs = this.find('ul.thumbs').children();
$thumbs.filter('.selected').removeClass('selected');
$thumbs.eq(this.currentImage.index).addClass('selected');
return this;
},
// Performs transitions on the thumbnails container and updates the set of
// thumbnails that are to be displayed and the navigation controls.
// @param {Delegate} postTransitionOutHandler An optional delegate that is called after
// the thumbnails container has transitioned out and before the thumbnails are rebuilt.
updateThumbs: function(postTransitionOutHandler) {
var gallery = this;
var transitionOutCallback = function() {
// Call the Post-transition Out Handler
if (postTransitionOutHandler)
postTransitionOutHandler();
gallery.rebuildThumbs();
// Transition In the thumbsContainer
if (gallery.onPageTransitionIn)
gallery.onPageTransitionIn();
else
gallery.show();
};
// Transition Out the thumbsContainer
if (this.onPageTransitionOut) {
this.onPageTransitionOut(transitionOutCallback);
} else {
this.hide();
transitionOutCallback();
}
return this;
},
// Updates the set of thumbnails that are to be displayed and the navigation controls.
rebuildThumbs: function() {
var needsPagination = this.data.length > this.numThumbs;
// Rebuild top pager
if (this.enableTopPager) {
var $topPager = this.find('div.top');
if ($topPager.length == 0)
$topPager = this.prepend('<div class="top pagination"></div>').find('div.top');
else
$topPager.empty();
if (needsPagination)
this.buildPager($topPager);
}
// Rebuild bottom pager
if (this.enableBottomPager) {
var $bottomPager = this.find('div.bottom');
if ($bottomPager.length == 0)
$bottomPager = this.append('<div class="bottom pagination"></div>').find('div.bottom');
else
$bottomPager.empty();
if (needsPagination)
this.buildPager($bottomPager);
}
var page = this.getCurrentPage();
var startIndex = page*this.numThumbs;
var stopIndex = startIndex+this.numThumbs-1;
if (stopIndex >= this.data.length)
stopIndex = this.data.length-1;
// Show/Hide thumbs
var $thumbsUl = this.find('ul.thumbs');
$thumbsUl.find('li').each(function(i) {
var $li = $(this);
if (i >= startIndex && i <= stopIndex) {
$li.show();
} else {
$li.hide();
}
});
this.displayedPage = page;
// Remove the noscript class from the thumbs container ul
$thumbsUl.removeClass('noscript');
return this;
},
// Returns the total number of pages required to display all the thumbnails.
getNumPages: function() {
return Math.ceil(this.data.length/this.numThumbs);
},
// Rebuilds the pager control in the specified matched element.
// @param {jQuery} pager A jQuery element set matching the particular pager to be rebuilt.
buildPager: function(pager) {
var gallery = this;
var numPages = this.getNumPages();
var page = this.getCurrentPage();
var startIndex = page * this.numThumbs;
var pagesRemaining = this.maxPagesToShow - 1;
var pageNum = page - Math.floor((this.maxPagesToShow - 1) / 2) + 1;
if (pageNum > 0) {
var remainingPageCount = numPages - pageNum;
if (remainingPageCount < pagesRemaining) {
pageNum = pageNum - (pagesRemaining - remainingPageCount);
}
}
if (pageNum < 0) {
pageNum = 0;
}
// Prev Page Link
if (page > 0) {
var prevPage = startIndex - this.numThumbs;
pager.append('<a rel="history" href="#'+this.data[prevPage].hash+'" title="'+this.prevPageLinkText+'">'+this.prevPageLinkText+'</a>');
}
// Create First Page link if needed
if (pageNum > 0) {
this.buildPageLink(pager, 0, numPages);
if (pageNum > 1)
pager.append('<span class="ellipsis">…</span>');
pagesRemaining--;
}
// Page Index Links
while (pagesRemaining > 0) {
this.buildPageLink(pager, pageNum, numPages);
pagesRemaining--;
pageNum++;
}
// Create Last Page link if needed
if (pageNum < numPages) {
var lastPageNum = numPages - 1;
if (pageNum < lastPageNum)
pager.append('<span class="ellipsis">…</span>');
this.buildPageLink(pager, lastPageNum, numPages);
}
// Next Page Link
var nextPage = startIndex + this.numThumbs;
if (nextPage < this.data.length) {
pager.append('<a rel="history" href="#'+this.data[nextPage].hash+'" title="'+this.nextPageLinkText+'">'+this.nextPageLinkText+'</a>');
}
pager.find('a').click(function(e) {
gallery.clickHandler(e, this);
});
return this;
},
// Builds a single page link within a pager. This function is called by buildPager
// @param {jQuery} pager A jQuery element set matching the particular pager to be rebuilt.
// @param {Integer} pageNum The page number of the page link to build.
// @param {Integer} numPages The total number of pages required to display all thumbnails.
buildPageLink: function(pager, pageNum, numPages) {
var pageLabel = pageNum + 1;
var currentPage = this.getCurrentPage();
if (pageNum == currentPage)
pager.append('<span class="current">'+pageLabel+'</span>');
else if (pageNum < numPages) {
var imageIndex = pageNum*this.numThumbs;
pager.append('<a rel="history" href="#'+this.data[imageIndex].hash+'" title="'+pageLabel+'">'+pageLabel+'</a>');
}
return this;
}
});
// Now initialize the gallery
$.extend(this, defaults, settings);
// Verify the history plugin is available
if (this.enableHistory && !$.historyInit)
this.enableHistory = false;
// Select containers
if (this.imageContainerSel) this.$imageContainer = $(this.imageContainerSel);
if (this.captionContainerSel) this.$captionContainer = $(this.captionContainerSel);
if (this.loadingContainerSel) this.$loadingContainer = $(this.loadingContainerSel);
// Initialize the thumbails
this.initializeThumbs();
if (this.maxPagesToShow < 3)
this.maxPagesToShow = 3;
this.displayedPage = -1;
this.currentImage = this.data[0];
var gallery = this;
// Hide the loadingContainer
if (this.$loadingContainer)
this.$loadingContainer.hide();
// Setup controls
if (this.controlsContainerSel) {
this.$controlsContainer = $(this.controlsContainerSel).empty();
if (this.renderSSControls) {
if (this.autoStart) {
this.$controlsContainer
.append('<div class="ss-controls"><a href="#pause" class="pause" title="'+this.pauseLinkText+'">'+this.pauseLinkText+'</a></div>');
} else {
this.$controlsContainer
.append('<div class="ss-controls"><a href="#play" class="play" title="'+this.playLinkText+'">'+this.playLinkText+'</a></div>');
}
this.$controlsContainer.find('div.ss-controls a')
.click(function(e) {
gallery.toggleSlideshow();
e.preventDefault();
return false;
});
}
if (this.renderNavControls) {
this.$controlsContainer
.append('<div class="nav-controls"><a class="prev" rel="history" title="'+this.prevLinkText+'">'+this.prevLinkText+'</a><a class="next" rel="history" title="'+this.nextLinkText+'">'+this.nextLinkText+'</a></div>')
.find('div.nav-controls a')
.click(function(e) {
gallery.clickHandler(e, this);
});
}
}
var initFirstImage = !this.enableHistory || !location.hash;
if (this.enableHistory && location.hash) {
var hash = $.galleriffic.normalizeHash(location.hash);
var imageData = allImages[hash];
if (!imageData)
initFirstImage = true;
}
// Setup gallery to show the first image
if (initFirstImage)
this.gotoIndex(0, false, true);
// Setup Keyboard Navigation
if (this.enableKeyboardNavigation) {
$(document).keydown(function(e) {
var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
switch(key) {
case 32: // space
gallery.next();
e.preventDefault();
break;
case 33: // Page Up
gallery.previousPage();
e.preventDefault();
break;
case 34: // Page Down
gallery.nextPage();
e.preventDefault();
break;
case 35: // End
gallery.gotoIndex(gallery.data.length-1);
e.preventDefault();
break;
case 36: // Home
gallery.gotoIndex(0);
e.preventDefault();
break;
case 37: // left arrow
gallery.previous();
e.preventDefault();
break;
case 39: // right arrow
gallery.next();
e.preventDefault();
break;
}
});
}
// Auto start the slideshow
if (this.autoStart)
this.play();
// Kickoff Image Preloader after 1 second
setTimeout(function() { gallery.preloadInit(); }, 1000);
return this;
};
})(jQuery);
|
{
"pile_set_name": "Github"
}
|
BODY { font-family: Helvetica, sans-serif }
TD { font-family: Helvetica, sans-serif }
P { font-family: Helvetica, sans-serif }
H1 { font-family: Helvetica, sans-serif }
H2 { font-family: Helvetica, sans-serif }
H4 { font-family: Helvetica, sans-serif }
P.tiny { font-size: 8pt }
|
{
"pile_set_name": "Github"
}
|
package com.github.iojjj.likeslayout;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
|
{
"pile_set_name": "Github"
}
|
paper-for-ios:
title: "Paper for iOS"
description: "A collection of art created on iPad with the iOS app **Paper by WeTransfer**. Tutorials and other learnings related to my [**Mastering Paper**](/mastering-paper/) series are also included."
paper-by-53:
title: "Paper by FiftyThree"
description: "A collection of art created on iPad with the iOS app **Paper by WeTransfer**. Tutorials and other learnings related to my [**Mastering Paper**](/mastering-paper/') series are also included."
sktchy:
title: "Sktchy"
description: "Portraits painted and drawn in a variety of media inspired by photographs shared on [**Sktchy**](https://get.sktchy.com/)."
jekyll:
title: "Jekyll"
description: "An archive of posts related to [**Jekyll**](https://jekyllrb.com) --- a Ruby Gem that transforms plain text into static websites and blogs."
til:
title: "Today I learned"
description: "Learnings captured for educational purposes and posterity."
|
{
"pile_set_name": "Github"
}
|
package metrics
import (
"math"
"sync"
"sync/atomic"
)
// EWMAs continuously calculate an exponentially-weighted moving average
// based on an outside source of clock ticks.
type EWMA interface {
Rate() float64
Snapshot() EWMA
Tick()
Update(int64)
}
// NewEWMA constructs a new EWMA with the given alpha.
func NewEWMA(alpha float64) EWMA {
return &StandardEWMA{alpha: alpha}
}
// NewEWMA1 constructs a new EWMA for a one-minute moving average.
func NewEWMA1() EWMA {
return NewEWMA(1 - math.Exp(-5.0/60.0/1))
}
// NewEWMA5 constructs a new EWMA for a five-minute moving average.
func NewEWMA5() EWMA {
return NewEWMA(1 - math.Exp(-5.0/60.0/5))
}
// NewEWMA15 constructs a new EWMA for a fifteen-minute moving average.
func NewEWMA15() EWMA {
return NewEWMA(1 - math.Exp(-5.0/60.0/15))
}
// EWMASnapshot is a read-only copy of another EWMA.
type EWMASnapshot float64
// Rate returns the rate of events per second at the time the snapshot was
// taken.
func (a EWMASnapshot) Rate() float64 { return float64(a) }
// Snapshot returns the snapshot.
func (a EWMASnapshot) Snapshot() EWMA { return a }
// Tick panics.
func (EWMASnapshot) Tick() {
panic("Tick called on an EWMASnapshot")
}
// Update panics.
func (EWMASnapshot) Update(int64) {
panic("Update called on an EWMASnapshot")
}
// NilEWMA is a no-op EWMA.
type NilEWMA struct{}
// Rate is a no-op.
func (NilEWMA) Rate() float64 { return 0.0 }
// Snapshot is a no-op.
func (NilEWMA) Snapshot() EWMA { return NilEWMA{} }
// Tick is a no-op.
func (NilEWMA) Tick() {}
// Update is a no-op.
func (NilEWMA) Update(n int64) {}
// StandardEWMA is the standard implementation of an EWMA and tracks the number
// of uncounted events and processes them on each tick. It uses the
// sync/atomic package to manage uncounted events.
type StandardEWMA struct {
uncounted int64 // /!\ this should be the first member to ensure 64-bit alignment
alpha float64
rate float64
init bool
mutex sync.Mutex
}
// Rate returns the moving average rate of events per second.
func (a *StandardEWMA) Rate() float64 {
a.mutex.Lock()
defer a.mutex.Unlock()
return a.rate * float64(1e9)
}
// Snapshot returns a read-only copy of the EWMA.
func (a *StandardEWMA) Snapshot() EWMA {
return EWMASnapshot(a.Rate())
}
// Tick ticks the clock to update the moving average. It assumes it is called
// every five seconds.
func (a *StandardEWMA) Tick() {
count := atomic.LoadInt64(&a.uncounted)
atomic.AddInt64(&a.uncounted, -count)
instantRate := float64(count) / float64(5e9)
a.mutex.Lock()
defer a.mutex.Unlock()
if a.init {
a.rate += a.alpha * (instantRate - a.rate)
} else {
a.init = true
a.rate = instantRate
}
}
// Update adds n uncounted events.
func (a *StandardEWMA) Update(n int64) {
atomic.AddInt64(&a.uncounted, n)
}
|
{
"pile_set_name": "Github"
}
|
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- Derived from AWS service descriptions, licensed under Apache 2.0.
-- |
-- Module : Network.AWS.Route53.CreateVPCAssociationAuthorization
-- Copyright : (c) 2013-2018 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Authorizes the AWS account that created a specified VPC to submit an @AssociateVPCWithHostedZone@ request to associate the VPC with a specified hosted zone that was created by a different account. To submit a @CreateVPCAssociationAuthorization@ request, you must use the account that created the hosted zone. After you authorize the association, use the account that created the VPC to submit an @AssociateVPCWithHostedZone@ request.
--
--
module Network.AWS.Route53.CreateVPCAssociationAuthorization
(
-- * Creating a Request
createVPCAssociationAuthorization
, CreateVPCAssociationAuthorization
-- * Request Lenses
, cvaaHostedZoneId
, cvaaVPC
-- * Destructuring the Response
, createVPCAssociationAuthorizationResponse
, CreateVPCAssociationAuthorizationResponse
-- * Response Lenses
, cvaarsResponseStatus
, cvaarsHostedZoneId
, cvaarsVPC
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.Route53.Types
import Network.AWS.Route53.Types.Product
-- | A complex type that contains information about the request to authorize associating a VPC with your private hosted zone. Authorization is only required when a private hosted zone and a VPC were created by using different accounts.
--
--
--
-- /See:/ 'createVPCAssociationAuthorization' smart constructor.
data CreateVPCAssociationAuthorization = CreateVPCAssociationAuthorization'
{ _cvaaHostedZoneId :: !ResourceId
, _cvaaVPC :: !VPC
} deriving (Eq, Read, Show, Data, Typeable, Generic)
-- | Creates a value of 'CreateVPCAssociationAuthorization' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cvaaHostedZoneId' - The ID of the private hosted zone that you want to authorize associating a VPC with.
--
-- * 'cvaaVPC' - A complex type that contains the VPC ID and region for the VPC that you want to authorize associating with your hosted zone.
createVPCAssociationAuthorization
:: ResourceId -- ^ 'cvaaHostedZoneId'
-> VPC -- ^ 'cvaaVPC'
-> CreateVPCAssociationAuthorization
createVPCAssociationAuthorization pHostedZoneId_ pVPC_ =
CreateVPCAssociationAuthorization'
{_cvaaHostedZoneId = pHostedZoneId_, _cvaaVPC = pVPC_}
-- | The ID of the private hosted zone that you want to authorize associating a VPC with.
cvaaHostedZoneId :: Lens' CreateVPCAssociationAuthorization ResourceId
cvaaHostedZoneId = lens _cvaaHostedZoneId (\ s a -> s{_cvaaHostedZoneId = a})
-- | A complex type that contains the VPC ID and region for the VPC that you want to authorize associating with your hosted zone.
cvaaVPC :: Lens' CreateVPCAssociationAuthorization VPC
cvaaVPC = lens _cvaaVPC (\ s a -> s{_cvaaVPC = a})
instance AWSRequest CreateVPCAssociationAuthorization
where
type Rs CreateVPCAssociationAuthorization =
CreateVPCAssociationAuthorizationResponse
request = postXML route53
response
= receiveXML
(\ s h x ->
CreateVPCAssociationAuthorizationResponse' <$>
(pure (fromEnum s)) <*> (x .@ "HostedZoneId") <*>
(x .@ "VPC"))
instance Hashable CreateVPCAssociationAuthorization
where
instance NFData CreateVPCAssociationAuthorization
where
instance ToElement CreateVPCAssociationAuthorization
where
toElement
= mkElement
"{https://route53.amazonaws.com/doc/2013-04-01/}CreateVPCAssociationAuthorizationRequest"
instance ToHeaders CreateVPCAssociationAuthorization
where
toHeaders = const mempty
instance ToPath CreateVPCAssociationAuthorization
where
toPath CreateVPCAssociationAuthorization'{..}
= mconcat
["/2013-04-01/hostedzone/", toBS _cvaaHostedZoneId,
"/authorizevpcassociation"]
instance ToQuery CreateVPCAssociationAuthorization
where
toQuery = const mempty
instance ToXML CreateVPCAssociationAuthorization
where
toXML CreateVPCAssociationAuthorization'{..}
= mconcat ["VPC" @= _cvaaVPC]
-- | A complex type that contains the response information from a @CreateVPCAssociationAuthorization@ request.
--
--
--
-- /See:/ 'createVPCAssociationAuthorizationResponse' smart constructor.
data CreateVPCAssociationAuthorizationResponse = CreateVPCAssociationAuthorizationResponse'
{ _cvaarsResponseStatus :: !Int
, _cvaarsHostedZoneId :: !ResourceId
, _cvaarsVPC :: !VPC
} deriving (Eq, Read, Show, Data, Typeable, Generic)
-- | Creates a value of 'CreateVPCAssociationAuthorizationResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cvaarsResponseStatus' - -- | The response status code.
--
-- * 'cvaarsHostedZoneId' - The ID of the hosted zone that you authorized associating a VPC with.
--
-- * 'cvaarsVPC' - The VPC that you authorized associating with a hosted zone.
createVPCAssociationAuthorizationResponse
:: Int -- ^ 'cvaarsResponseStatus'
-> ResourceId -- ^ 'cvaarsHostedZoneId'
-> VPC -- ^ 'cvaarsVPC'
-> CreateVPCAssociationAuthorizationResponse
createVPCAssociationAuthorizationResponse pResponseStatus_ pHostedZoneId_ pVPC_ =
CreateVPCAssociationAuthorizationResponse'
{ _cvaarsResponseStatus = pResponseStatus_
, _cvaarsHostedZoneId = pHostedZoneId_
, _cvaarsVPC = pVPC_
}
-- | -- | The response status code.
cvaarsResponseStatus :: Lens' CreateVPCAssociationAuthorizationResponse Int
cvaarsResponseStatus = lens _cvaarsResponseStatus (\ s a -> s{_cvaarsResponseStatus = a})
-- | The ID of the hosted zone that you authorized associating a VPC with.
cvaarsHostedZoneId :: Lens' CreateVPCAssociationAuthorizationResponse ResourceId
cvaarsHostedZoneId = lens _cvaarsHostedZoneId (\ s a -> s{_cvaarsHostedZoneId = a})
-- | The VPC that you authorized associating with a hosted zone.
cvaarsVPC :: Lens' CreateVPCAssociationAuthorizationResponse VPC
cvaarsVPC = lens _cvaarsVPC (\ s a -> s{_cvaarsVPC = a})
instance NFData
CreateVPCAssociationAuthorizationResponse
where
|
{
"pile_set_name": "Github"
}
|
#include <bits/types.h>
#include <format.h>
char* fmtbytes(char* p, char* e, const void* data, uint len)
{
const uint8_t* val = data;
const uint8_t* end = data + len;
for(; val < end; val++)
p = fmtbyte(p, e, *val);
return p;
}
|
{
"pile_set_name": "Github"
}
|
import { createStore } from '@tencent/ff-redux';
import { generateResetableReducer } from '../../../../helpers';
import { RootReducer } from '../reducers/RootReducer';
export function configStore() {
const store = createStore(generateResetableReducer(RootReducer));
// hot reloading
if (typeof module !== 'undefined' && (module as any).hot) {
(module as any).hot.accept('../reducers/RootReducer', () => {
store.replaceReducer(generateResetableReducer(require('../reducers/RootReducer').RootReducer));
});
}
return store;
}
|
{
"pile_set_name": "Github"
}
|
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-time.yml)
# Get System Time
Get the time on the device
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-time.yml)
## Example Usage
```java
// Java
String time = driver.getDeviceTime();
```
```python
# Python
time = self.driver.device_time
time = self.driver.get_device_time()
time = self.driver.get_device_time("YYYY-MM-DD")
```
```javascript
// Javascript
// webdriver.io example
let time = driver.getDeviceTime();
// wd example
let time = await driver.getDeviceTime();
```
```ruby
# Ruby
# ruby_lib example
device_time
# ruby_lib_core example
@driver.device_time
```
```php
# PHP
$time = $driver->getDeviceTime();
```
```csharp
// C#
string result = driver.DeviceTime;
```
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-time.yml)
## Support
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-time.yml)
### Appium Server
|Platform|Driver|Platform Versions|Appium Version|Driver Version|
|--------|----------------|------|--------------|--------------|
| iOS | [XCUITest](/docs/en/drivers/ios-xcuitest.md) | 9.3+ | 1.6.0+ | All |
| | [UIAutomation](/docs/en/drivers/ios-uiautomation.md) | 8.0 to 9.3 | All | All |
| Android | [Espresso](/docs/en/drivers/android-espresso.md) | ?+ | 1.9.0+ | All |
| | [UiAutomator2](/docs/en/drivers/android-uiautomator2.md) | ?+ | 1.6.0+ | All |
| | [UiAutomator](/docs/en/drivers/android-uiautomator.md) | 4.3+ | All | All |
| Mac | [Mac](/docs/en/drivers/mac.md) | None | None | None |
| Windows | [Windows](/docs/en/drivers/windows.md) | None | None | None |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-time.yml)
### Appium Clients
|Language|Support|Documentation|
|--------|-------|-------------|
|[Java](https://github.com/appium/java-client/releases/latest)| All | [appium.github.io](https://appium.github.io/java-client/io/appium/java_client/HasDeviceTime.html#getDeviceTime--) |
|[Python](https://github.com/appium/python-client/releases/latest)| All | [appium.github.io](https://appium.github.io/python-client-sphinx/webdriver.extensions.html#webdriver.extensions.device_time.DeviceTime.device_time) |
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3119) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#device_time-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-time.yml)
## HTTP API Specifications
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-time.yml)
### Endpoint
`GET /session/:session_id/appium/device/system_time`
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-time.yml)
### URL Parameters
|name|description|
|----|-----------|
|session_id|ID of the session to route the command to|
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-time.yml)
### JSON Parameters
None
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-time.yml)
### Response
Time on the device (`string`)
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-time.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L357)
|
{
"pile_set_name": "Github"
}
|
<package format="2">
<name>tf2_sensor_msgs</name>
<version>0.7.5</version>
<description>
Small lib to transform sensor_msgs with tf. Most notably, PointCloud2
</description>
<author>Vincent Rabaud</author>
<maintainer email="vincent.rabaud@gmail.com">Vincent Rabaud</maintainer>
<license>BSD</license>
<url type="website">http://www.ros.org/wiki/tf2_ros</url>
<buildtool_depend version_gte="0.5.6">catkin</buildtool_depend>
<build_depend>cmake_modules</build_depend>
<build_depend>eigen</build_depend>
<depend>sensor_msgs</depend>
<depend>tf2</depend>
<depend>tf2_ros</depend>
<exec_depend>python3-pykdl</exec_depend>
<exec_depend>rospy</exec_depend>
<build_export_depend>eigen</build_export_depend>
<test_depend>rostest</test_depend>
<test_depend>geometry_msgs</test_depend>
</package>
|
{
"pile_set_name": "Github"
}
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin-sample-po</artifactId>
<packaging>pom</packaging>
<name>Maven JAXB 2.x Plugin Sample [po]</name>
<parent>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin-samples</artifactId>
<version>0.14.1-SNAPSHOT</version>
</parent>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>maven-assembly</id>
<phase>package</phase>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>maven-unpack</id>
<phase>pre-integration-test</phase>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<executions>
<execution>
<id>maven-integration-test</id>
<phase>integration-test</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
|
{
"pile_set_name": "Github"
}
|
<testcase>
<info>
<keywords>
warning
</keywords>
</info>
#
# Server-side
<reply>
</reply>
#
# Client-side
<client>
<server>
none
</server>
<features>
unix-sockets
</features>
<name>
file name argument looks like a flag
</name>
<command>
--stderr log/moo1268 --unix-socket -k hej://moo
</command>
</client>
<verify>
<file name="log/moo1268" mode="text">
Warning: The file name argument '-k' looks like a flag.
curl: (1) Protocol "hej" not supported or disabled in libcurl
</file>
# we expect an error since we provide a weird URL
<errorcode>
1
</errorcode>
</verify>
</testcase>
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: e5d07b10565a49a4782b8552763536be
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
<!-- Copyright © 1991-2018 Unicode, Inc.
For terms of use, see http://www.unicode.org/copyright.html
Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries.
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
-->
<ldml>
<identity>
<version number="$Revision: 13869 $"/>
<language type="om"/>
<territory type="KE"/>
</identity>
<dates>
<calendars>
<calendar type="gregorian">
<months>
<monthContext type="stand-alone">
<monthWidth type="narrow">
<month type="1">A</month>
<month type="2">G</month>
<month type="3">B</month>
<month type="4">E</month>
<month type="5">C</month>
<month type="6">W</month>
<month type="7">A</month>
<month type="8">H</month>
<month type="9">F</month>
<month type="10">O</month>
<month type="11">S</month>
<month type="12">M</month>
</monthWidth>
</monthContext>
</months>
<days>
<dayContext type="stand-alone">
<dayWidth type="narrow">
<day type="sun">D</day>
<day type="mon">W</day>
<day type="tue">Q</day>
<day type="wed">R</day>
<day type="thu">K</day>
<day type="fri">J</day>
<day type="sat">S</day>
</dayWidth>
</dayContext>
</days>
<quarters>
<quarterContext type="format">
<quarterWidth type="abbreviated">
<quarter type="1">K1</quarter>
<quarter type="2">K2</quarter>
<quarter type="3">K3</quarter>
<quarter type="4">K4</quarter>
</quarterWidth>
</quarterContext>
</quarters>
<eras>
<eraAbbr>
<era type="0">KD</era>
<era type="0" alt="variant">BCE</era>
<era type="1" alt="variant">KB</era>
</eraAbbr>
</eras>
<timeFormats>
<timeFormatLength type="full">
<timeFormat>
<pattern>HH:mm:ss zzzz</pattern>
</timeFormat>
</timeFormatLength>
<timeFormatLength type="long">
<timeFormat>
<pattern>HH:mm:ss z</pattern>
</timeFormat>
</timeFormatLength>
<timeFormatLength type="medium">
<timeFormat>
<pattern>HH:mm:ss</pattern>
</timeFormat>
</timeFormatLength>
<timeFormatLength type="short">
<timeFormat>
<pattern>HH:mm</pattern>
</timeFormat>
</timeFormatLength>
</timeFormats>
</calendar>
</calendars>
</dates>
<numbers>
<currencies>
<currency type="KES">
<symbol>Ksh</symbol>
</currency>
</currencies>
</numbers>
</ldml>
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
namespace TeleprompterConsole
{
public class Program
{
public static void Main(string[] args)
{
RunTeleprompter().Wait();
}
private static async Task RunTeleprompter()
{
var config = new TelePrompterConfig();
var displayTask = ShowTeleprompter(config);
var speedTask = GetInput(config);
await Task.WhenAny(displayTask, speedTask);
}
private static async Task ShowTeleprompter(TelePrompterConfig config)
{
var words = ReadFrom("SampleQuotes.txt");
foreach (var word in words)
{
Console.Write(word);
if (!string.IsNullOrWhiteSpace(word))
{
await Task.Delay(config.DelayInMilliseconds);
}
}
config.SetDone();
}
private static async Task GetInput(TelePrompterConfig config)
{
Action work = () =>
{
do {
var key = Console.ReadKey(true);
if (key.KeyChar == '>')
config.UpdateDelay(-10);
else if (key.KeyChar == '<')
config.UpdateDelay(10);
else if (key.KeyChar == 'X' || key.KeyChar == 'x')
config.SetDone();
} while (!config.Done);
};
await Task.Run(work);
}
static IEnumerable<string> ReadFrom(string file)
{
string line;
using (var reader = File.OpenText(file))
{
while ((line = reader.ReadLine()) != null)
{
var words = line.Split(' ');
var lineLength = 0;
foreach (var word in words)
{
yield return word + " ";
lineLength += word.Length + 1;
if (lineLength > 70)
{
yield return Environment.NewLine;
lineLength = 0;
}
}
yield return Environment.NewLine;
}
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
#ifndef BOOST_MPL_CONTAINS_FWD_HPP_INCLUDED
#define BOOST_MPL_CONTAINS_FWD_HPP_INCLUDED
// Copyright Eric Friedman 2002
// Copyright Aleksey Gurtovoy 2004
//
// Distributed under 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)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
namespace boost { namespace mpl {
template< typename Tag > struct contains_impl;
template< typename Sequence, typename T > struct contains;
}}
#endif // BOOST_MPL_CONTAINS_FWD_HPP_INCLUDED
|
{
"pile_set_name": "Github"
}
|
{
"acno": "D00537",
"acquisitionYear": 1856,
"all_artists": "Joseph Mallord William Turner",
"catTextResId": 1140858,
"catalogueGroup": {
"accessionRanges": "D00462-D00552; D40755-D40758",
"completeStatus": "COMPLETE",
"finbergNumber": "XXV",
"groupType": "Turner Sketchbook",
"id": 65686,
"shortTitle": "Smaller South Wales Sketchbook"
},
"classification": "on paper, unique",
"contributorCount": 1,
"contributors": [
{
"birthYear": 1775,
"date": "1775\u20131851",
"displayOrder": 1,
"fc": "Joseph Mallord William Turner",
"gender": "Male",
"id": 558,
"mda": "Turner, Joseph Mallord William",
"role": "artist",
"startLetter": "T"
}
],
"creditLine": "Accepted by the nation as part of the Turner Bequest 1856",
"dateRange": {
"endYear": 1795,
"startYear": 1795,
"text": "1795"
},
"dateText": "1795",
"depth": "",
"dimensions": "support: 132 x 206 mm",
"finberg": "XXV 75",
"foreignTitle": null,
"groupTitle": "Smaller South Wales Sketchbook",
"height": "206",
"id": 27952,
"inscription": null,
"medium": null,
"movementCount": 0,
"pageNumber": 151,
"subjectCount": 0,
"thumbnailCopyright": null,
"thumbnailUrl": null,
"title": "Blank",
"units": "mm",
"url": "http://www.tate.org.uk/art/artworks/turner-blank-d00537",
"width": "132"
}
|
{
"pile_set_name": "Github"
}
|
# created by tools/loadICU.tcl -- do not edit
namespace eval ::tcl::clock {
::msgcat::mcset es_SV DATE_FORMAT "%m-%d-%Y"
::msgcat::mcset es_SV TIME_FORMAT_12 "%I:%M:%S %P"
::msgcat::mcset es_SV DATE_TIME_FORMAT "%m-%d-%Y %I:%M:%S %P %z"
}
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env ruby
# The compass command line utility
# This allows compass to run easily from a git checkout without install.
def fallback_load_path(path)
retried = false
begin
yield
rescue LoadError
unless retried
$: << path
retried = true
retry
end
raise
end
end
fallback_load_path(File.join(File.dirname(__FILE__), '..', 'lib')) do
require 'compass'
require 'compass/exec'
end
if defined?(Bundler)
require 'bundler/shared_helpers'
Bundler.require :assets if Bundler::SharedHelpers.in_bundle?
end
runner = Proc.new do
Compass::Exec::SubCommandUI.new(ARGV).run!
end
if ARGV.delete("--profile")
require 'ruby-prof'
RubyProf.start
exit_code = runner.call
result = RubyProf.stop
# Print a flat profile to text
printer = RubyProf::FlatPrinter.new(result)
printer.print(STDERR, 0)
exit exit_code
else
exit runner.call || 1
end
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
/*!\file
* \brief Provides the high level interface to wrap encoder algorithms.
*
*/
#include <limits.h>
#include <string.h>
#include "vpx/internal/vpx_codec_internal.h"
#include "vpx_config.h"
#define SAVE_STATUS(ctx,var) (ctx?(ctx->err = var):var)
vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx,
vpx_codec_iface_t *iface,
vpx_codec_enc_cfg_t *cfg,
vpx_codec_flags_t flags,
int ver) {
vpx_codec_err_t res;
if (ver != VPX_ENCODER_ABI_VERSION)
res = VPX_CODEC_ABI_MISMATCH;
else if (!ctx || !iface || !cfg)
res = VPX_CODEC_INVALID_PARAM;
else if (iface->abi_version != VPX_CODEC_INTERNAL_ABI_VERSION)
res = VPX_CODEC_ABI_MISMATCH;
else if (!(iface->caps & VPX_CODEC_CAP_ENCODER))
res = VPX_CODEC_INCAPABLE;
else if ((flags & VPX_CODEC_USE_XMA) && !(iface->caps & VPX_CODEC_CAP_XMA))
res = VPX_CODEC_INCAPABLE;
else if ((flags & VPX_CODEC_USE_PSNR)
&& !(iface->caps & VPX_CODEC_CAP_PSNR))
res = VPX_CODEC_INCAPABLE;
else if ((flags & VPX_CODEC_USE_OUTPUT_PARTITION)
&& !(iface->caps & VPX_CODEC_CAP_OUTPUT_PARTITION))
res = VPX_CODEC_INCAPABLE;
else {
ctx->iface = iface;
ctx->name = iface->name;
ctx->priv = NULL;
ctx->init_flags = flags;
ctx->config.enc = cfg;
res = ctx->iface->init(ctx, NULL);
if (res) {
ctx->err_detail = ctx->priv ? ctx->priv->err_detail : NULL;
vpx_codec_destroy(ctx);
}
if (ctx->priv)
ctx->priv->iface = ctx->iface;
}
return SAVE_STATUS(ctx, res);
}
vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx,
vpx_codec_iface_t *iface,
vpx_codec_enc_cfg_t *cfg,
int num_enc,
vpx_codec_flags_t flags,
vpx_rational_t *dsf,
int ver) {
vpx_codec_err_t res = VPX_CODEC_OK;
if (ver != VPX_ENCODER_ABI_VERSION)
res = VPX_CODEC_ABI_MISMATCH;
else if (!ctx || !iface || !cfg || (num_enc > 16 || num_enc < 1))
res = VPX_CODEC_INVALID_PARAM;
else if (iface->abi_version != VPX_CODEC_INTERNAL_ABI_VERSION)
res = VPX_CODEC_ABI_MISMATCH;
else if (!(iface->caps & VPX_CODEC_CAP_ENCODER))
res = VPX_CODEC_INCAPABLE;
else if ((flags & VPX_CODEC_USE_XMA) && !(iface->caps & VPX_CODEC_CAP_XMA))
res = VPX_CODEC_INCAPABLE;
else if ((flags & VPX_CODEC_USE_PSNR)
&& !(iface->caps & VPX_CODEC_CAP_PSNR))
res = VPX_CODEC_INCAPABLE;
else if ((flags & VPX_CODEC_USE_OUTPUT_PARTITION)
&& !(iface->caps & VPX_CODEC_CAP_OUTPUT_PARTITION))
res = VPX_CODEC_INCAPABLE;
else {
int i;
void *mem_loc = NULL;
if (!(res = iface->enc.mr_get_mem_loc(cfg, &mem_loc))) {
for (i = 0; i < num_enc; i++) {
vpx_codec_priv_enc_mr_cfg_t mr_cfg;
/* Validate down-sampling factor. */
if (dsf->num < 1 || dsf->num > 4096 || dsf->den < 1 ||
dsf->den > dsf->num) {
res = VPX_CODEC_INVALID_PARAM;
break;
}
mr_cfg.mr_low_res_mode_info = mem_loc;
mr_cfg.mr_total_resolutions = num_enc;
mr_cfg.mr_encoder_id = num_enc - 1 - i;
mr_cfg.mr_down_sampling_factor.num = dsf->num;
mr_cfg.mr_down_sampling_factor.den = dsf->den;
/* Force Key-frame synchronization. Namely, encoder at higher
* resolution always use the same frame_type chosen by the
* lowest-resolution encoder.
*/
if (mr_cfg.mr_encoder_id)
cfg->kf_mode = VPX_KF_DISABLED;
ctx->iface = iface;
ctx->name = iface->name;
ctx->priv = NULL;
ctx->init_flags = flags;
ctx->config.enc = cfg;
res = ctx->iface->init(ctx, &mr_cfg);
if (res) {
const char *error_detail =
ctx->priv ? ctx->priv->err_detail : NULL;
/* Destroy current ctx */
ctx->err_detail = error_detail;
vpx_codec_destroy(ctx);
/* Destroy already allocated high-level ctx */
while (i) {
ctx--;
ctx->err_detail = error_detail;
vpx_codec_destroy(ctx);
i--;
}
}
if (ctx->priv)
ctx->priv->iface = ctx->iface;
if (res)
break;
ctx++;
cfg++;
dsf++;
}
ctx--;
}
}
return SAVE_STATUS(ctx, res);
}
vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
vpx_codec_enc_cfg_t *cfg,
unsigned int usage) {
vpx_codec_err_t res;
vpx_codec_enc_cfg_map_t *map;
if (!iface || !cfg || usage > INT_MAX)
res = VPX_CODEC_INVALID_PARAM;
else if (!(iface->caps & VPX_CODEC_CAP_ENCODER))
res = VPX_CODEC_INCAPABLE;
else {
res = VPX_CODEC_INVALID_PARAM;
for (map = iface->enc.cfg_maps; map->usage >= 0; map++) {
if (map->usage == (int)usage) {
*cfg = map->cfg;
cfg->g_usage = usage;
res = VPX_CODEC_OK;
break;
}
}
}
return res;
}
#if ARCH_X86 || ARCH_X86_64
/* On X86, disable the x87 unit's internal 80 bit precision for better
* consistency with the SSE unit's 64 bit precision.
*/
#include "vpx_ports/x86.h"
#define FLOATING_POINT_INIT() do {\
unsigned short x87_orig_mode = x87_set_double_precision();
#define FLOATING_POINT_RESTORE() \
x87_set_control_word(x87_orig_mode); }while(0)
#else
static void FLOATING_POINT_INIT() {}
static void FLOATING_POINT_RESTORE() {}
#endif
vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
const vpx_image_t *img,
vpx_codec_pts_t pts,
unsigned long duration,
vpx_enc_frame_flags_t flags,
unsigned long deadline) {
vpx_codec_err_t res = VPX_CODEC_OK;
if (!ctx || (img && !duration))
res = VPX_CODEC_INVALID_PARAM;
else if (!ctx->iface || !ctx->priv)
res = VPX_CODEC_ERROR;
else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER))
res = VPX_CODEC_INCAPABLE;
else {
unsigned int num_enc = ctx->priv->enc.total_encoders;
/* Execute in a normalized floating point environment, if the platform
* requires it.
*/
FLOATING_POINT_INIT();
if (num_enc == 1)
res = ctx->iface->enc.encode(ctx->priv->alg_priv, img, pts,
duration, flags, deadline);
else {
/* Multi-resolution encoding:
* Encode multi-levels in reverse order. For example,
* if mr_total_resolutions = 3, first encode level 2,
* then encode level 1, and finally encode level 0.
*/
int i;
ctx += num_enc - 1;
if (img) img += num_enc - 1;
for (i = num_enc - 1; i >= 0; i--) {
if ((res = ctx->iface->enc.encode(ctx->priv->alg_priv, img, pts,
duration, flags, deadline)))
break;
ctx--;
if (img) img--;
}
ctx++;
}
FLOATING_POINT_RESTORE();
}
return SAVE_STATUS(ctx, res);
}
const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
vpx_codec_iter_t *iter) {
const vpx_codec_cx_pkt_t *pkt = NULL;
if (ctx) {
if (!iter)
ctx->err = VPX_CODEC_INVALID_PARAM;
else if (!ctx->iface || !ctx->priv)
ctx->err = VPX_CODEC_ERROR;
else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER))
ctx->err = VPX_CODEC_INCAPABLE;
else
pkt = ctx->iface->enc.get_cx_data(ctx->priv->alg_priv, iter);
}
if (pkt && pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
// If the application has specified a destination area for the
// compressed data, and the codec has not placed the data there,
// and it fits, copy it.
vpx_codec_priv_t *const priv = ctx->priv;
char *const dst_buf = (char *)priv->enc.cx_data_dst_buf.buf;
if (dst_buf &&
pkt->data.raw.buf != dst_buf &&
pkt->data.raw.sz + priv->enc.cx_data_pad_before +
priv->enc.cx_data_pad_after <= priv->enc.cx_data_dst_buf.sz) {
vpx_codec_cx_pkt_t *modified_pkt = &priv->enc.cx_data_pkt;
memcpy(dst_buf + priv->enc.cx_data_pad_before, pkt->data.raw.buf,
pkt->data.raw.sz);
*modified_pkt = *pkt;
modified_pkt->data.raw.buf = dst_buf;
modified_pkt->data.raw.sz += priv->enc.cx_data_pad_before +
priv->enc.cx_data_pad_after;
pkt = modified_pkt;
}
if (dst_buf == pkt->data.raw.buf) {
priv->enc.cx_data_dst_buf.buf = dst_buf + pkt->data.raw.sz;
priv->enc.cx_data_dst_buf.sz -= pkt->data.raw.sz;
}
}
return pkt;
}
vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx,
const vpx_fixed_buf_t *buf,
unsigned int pad_before,
unsigned int pad_after) {
if (!ctx || !ctx->priv)
return VPX_CODEC_INVALID_PARAM;
if (buf) {
ctx->priv->enc.cx_data_dst_buf = *buf;
ctx->priv->enc.cx_data_pad_before = pad_before;
ctx->priv->enc.cx_data_pad_after = pad_after;
} else {
ctx->priv->enc.cx_data_dst_buf.buf = NULL;
ctx->priv->enc.cx_data_dst_buf.sz = 0;
ctx->priv->enc.cx_data_pad_before = 0;
ctx->priv->enc.cx_data_pad_after = 0;
}
return VPX_CODEC_OK;
}
const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx) {
vpx_image_t *img = NULL;
if (ctx) {
if (!ctx->iface || !ctx->priv)
ctx->err = VPX_CODEC_ERROR;
else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER))
ctx->err = VPX_CODEC_INCAPABLE;
else if (!ctx->iface->enc.get_preview)
ctx->err = VPX_CODEC_INCAPABLE;
else
img = ctx->iface->enc.get_preview(ctx->priv->alg_priv);
}
return img;
}
vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx) {
vpx_fixed_buf_t *buf = NULL;
if (ctx) {
if (!ctx->iface || !ctx->priv)
ctx->err = VPX_CODEC_ERROR;
else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER))
ctx->err = VPX_CODEC_INCAPABLE;
else if (!ctx->iface->enc.get_glob_hdrs)
ctx->err = VPX_CODEC_INCAPABLE;
else
buf = ctx->iface->enc.get_glob_hdrs(ctx->priv->alg_priv);
}
return buf;
}
vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx,
const vpx_codec_enc_cfg_t *cfg) {
vpx_codec_err_t res;
if (!ctx || !ctx->iface || !ctx->priv || !cfg)
res = VPX_CODEC_INVALID_PARAM;
else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER))
res = VPX_CODEC_INCAPABLE;
else
res = ctx->iface->enc.cfg_set(ctx->priv->alg_priv, cfg);
return SAVE_STATUS(ctx, res);
}
int vpx_codec_pkt_list_add(struct vpx_codec_pkt_list *list,
const struct vpx_codec_cx_pkt *pkt) {
if (list->cnt < list->max) {
list->pkts[list->cnt++] = *pkt;
return 0;
}
return 1;
}
const vpx_codec_cx_pkt_t *vpx_codec_pkt_list_get(struct vpx_codec_pkt_list *list,
vpx_codec_iter_t *iter) {
const vpx_codec_cx_pkt_t *pkt;
if (!(*iter)) {
*iter = list->pkts;
}
pkt = (const vpx_codec_cx_pkt_t *)*iter;
if ((size_t)(pkt - list->pkts) < list->cnt)
*iter = pkt + 1;
else
pkt = NULL;
return pkt;
}
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Util.Helpers {
/// <summary>
/// 类型转换
/// </summary>
public static partial class Convert {
/// <summary>
/// 转换为32位整型
/// </summary>
/// <param name="input">输入值</param>
public static int ToInt( object input ) {
return ToIntOrNull( input ) ?? 0;
}
/// <summary>
/// 转换为32位可空整型
/// </summary>
/// <param name="input">输入值</param>
public static int? ToIntOrNull( object input ) {
var success = int.TryParse( input.SafeString(), out var result );
if( success )
return result;
try {
var temp = ToDoubleOrNull( input, 0 );
if( temp == null )
return null;
return System.Convert.ToInt32( temp );
}
catch {
return null;
}
}
/// <summary>
/// 转换为64位整型
/// </summary>
/// <param name="input">输入值</param>
public static long ToLong( object input ) {
return ToLongOrNull( input ) ?? 0;
}
/// <summary>
/// 转换为64位可空整型
/// </summary>
/// <param name="input">输入值</param>
public static long? ToLongOrNull( object input ) {
var success = long.TryParse( input.SafeString(), out var result );
if( success )
return result;
try {
var temp = ToDecimalOrNull( input, 0 );
if( temp == null )
return null;
return System.Convert.ToInt64( temp );
}
catch {
return null;
}
}
/// <summary>
/// 转换为32位浮点型,并按指定小数位舍入
/// </summary>
/// <param name="input">输入值</param>
/// <param name="digits">小数位数</param>
public static float ToFloat( object input, int? digits = null ) {
return ToFloatOrNull( input, digits ) ?? 0;
}
/// <summary>
/// 转换为32位可空浮点型,并按指定小数位舍入
/// </summary>
/// <param name="input">输入值</param>
/// <param name="digits">小数位数</param>
public static float? ToFloatOrNull( object input, int? digits = null ) {
var success = float.TryParse( input.SafeString(), out var result );
if( !success )
return null;
if( digits == null )
return result;
return (float)Math.Round( result, digits.Value );
}
/// <summary>
/// 转换为64位浮点型,并按指定小数位舍入
/// </summary>
/// <param name="input">输入值</param>
/// <param name="digits">小数位数</param>
public static double ToDouble( object input, int? digits = null ) {
return ToDoubleOrNull( input, digits ) ?? 0;
}
/// <summary>
/// 转换为64位可空浮点型,并按指定小数位舍入
/// </summary>
/// <param name="input">输入值</param>
/// <param name="digits">小数位数</param>
public static double? ToDoubleOrNull( object input, int? digits = null ) {
var success = double.TryParse( input.SafeString(), out var result );
if( !success )
return null;
if( digits == null )
return result;
return Math.Round( result, digits.Value );
}
/// <summary>
/// 转换为128位浮点型,并按指定小数位舍入
/// </summary>
/// <param name="input">输入值</param>
/// <param name="digits">小数位数</param>
public static decimal ToDecimal( object input, int? digits = null ) {
return ToDecimalOrNull( input, digits ) ?? 0;
}
/// <summary>
/// 转换为128位可空浮点型,并按指定小数位舍入
/// </summary>
/// <param name="input">输入值</param>
/// <param name="digits">小数位数</param>
public static decimal? ToDecimalOrNull( object input, int? digits = null ) {
var success = decimal.TryParse( input.SafeString(), out var result );
if( !success )
return null;
if( digits == null )
return result;
return Math.Round( result, digits.Value );
}
/// <summary>
/// 转换为布尔值
/// </summary>
/// <param name="input">输入值</param>
public static bool ToBool( object input ) {
return ToBoolOrNull( input ) ?? false;
}
/// <summary>
/// 转换为可空布尔值
/// </summary>
/// <param name="input">输入值</param>
public static bool? ToBoolOrNull( object input ) {
bool? value = GetBool( input );
if( value != null )
return value.Value;
return bool.TryParse( input.SafeString(), out var result ) ? (bool?)result : null;
}
/// <summary>
/// 获取布尔值
/// </summary>
private static bool? GetBool( object input ) {
switch( input.SafeString().ToLower() ) {
case "0":
return false;
case "否":
return false;
case "不":
return false;
case "no":
return false;
case "fail":
return false;
case "1":
return true;
case "是":
return true;
case "ok":
return true;
case "yes":
return true;
default:
return null;
}
}
/// <summary>
/// 转换为日期
/// </summary>
/// <param name="input">输入值</param>
public static DateTime ToDate( object input ) {
return ToDateOrNull( input ) ?? DateTime.MinValue;
}
/// <summary>
/// 转换为可空日期
/// </summary>
/// <param name="input">输入值</param>
public static DateTime? ToDateOrNull( object input ) {
return DateTime.TryParse( input.SafeString(), out var result ) ? (DateTime?)result : null;
}
/// <summary>
/// 转换为Guid
/// </summary>
/// <param name="input">输入值</param>
public static Guid ToGuid( object input ) {
return ToGuidOrNull( input ) ?? Guid.Empty;
}
/// <summary>
/// 转换为可空Guid
/// </summary>
/// <param name="input">输入值</param>
public static Guid? ToGuidOrNull( object input ) {
return Guid.TryParse( input.SafeString(), out var result ) ? (Guid?)result : null;
}
/// <summary>
/// 转换为Guid集合
/// </summary>
/// <param name="input">以逗号分隔的Guid集合字符串,范例:83B0233C-A24F-49FD-8083-1337209EBC9A,EAB523C6-2FE7-47BE-89D5-C6D440C3033A</param>
public static List<Guid> ToGuidList( string input ) {
return ToList<Guid>( input );
}
/// <summary>
/// 泛型集合转换
/// </summary>
/// <typeparam name="T">目标元素类型</typeparam>
/// <param name="input">以逗号分隔的元素集合字符串,范例:83B0233C-A24F-49FD-8083-1337209EBC9A,EAB523C6-2FE7-47BE-89D5-C6D440C3033A</param>
public static List<T> ToList<T>( string input ) {
var result = new List<T>();
if( string.IsNullOrWhiteSpace( input ) )
return result;
var array = input.Split( ',' );
result.AddRange( from each in array where !string.IsNullOrWhiteSpace( each ) select To<T>( each ) );
return result;
}
/// <summary>
/// 通用泛型转换
/// </summary>
/// <typeparam name="T">目标类型</typeparam>
/// <param name="input">输入值</param>
public static T To<T>( object input ) {
if( input == null )
return default( T );
if( input is string && string.IsNullOrWhiteSpace( input.ToString() ) )
return default( T );
Type type = Common.GetType<T>();
var typeName = type.Name.ToLower();
try {
if( typeName == "string" )
return (T)(object)input.ToString();
if( typeName == "guid" )
return (T)(object)new Guid( input.ToString() );
if( type.IsEnum )
return Enum.Parse<T>( input );
if( input is IConvertible )
return (T)System.Convert.ChangeType( input, type );
return (T)input;
}
catch {
return default( T );
}
}
/// <summary>
/// 转换为字节数组
/// </summary>
/// <param name="input">输入值</param>
public static byte[] ToBytes( string input ) {
return ToBytes( input, Encoding.UTF8 );
}
/// <summary>
/// 转换为字节数组
/// </summary>
/// <param name="input">输入值</param>
/// <param name="encoding">字符编码</param>
public static byte[] ToBytes( string input, Encoding encoding ) {
return string.IsNullOrWhiteSpace( input ) ? new byte[] { } : encoding.GetBytes( input );
}
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<AIRobots.label>Robots</AIRobots.label>
<AIRobots.description>Configure the colony's active robots.</AIRobots.description>
</LanguageData>
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
// This must be on top, do not change. Required by webpack.
import '../common/main';
// This must be on top, do not change. Required by webpack.
// tslint:disable-next-line: ordered-imports
import '../common/index.css';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { WidgetManagerComponent } from '../ipywidgets/container';
import { IVsCodeApi, PostOffice } from '../react-common/postOffice';
import { detectBaseTheme } from '../react-common/themeDetector';
import { getConnectedInteractiveEditor } from './interactivePanel';
import { createStore } from './redux/store';
// This special function talks to vscode from a web panel
export declare function acquireVsCodeApi(): IVsCodeApi;
const baseTheme = detectBaseTheme();
// tslint:disable-next-line: no-any
const testMode = (window as any).inTestMode;
// tslint:disable-next-line: no-typeof-undefined
const skipDefault = testMode ? false : typeof acquireVsCodeApi !== 'undefined';
// Create the redux store
const postOffice = new PostOffice();
const store = createStore(skipDefault, baseTheme, testMode, postOffice);
// Wire up a connected react control for our InteractiveEditor
const ConnectedInteractiveEditor = getConnectedInteractiveEditor();
// Stick them all together
// tslint:disable:no-typeof-undefined
ReactDOM.render(
<Provider store={store}>
<ConnectedInteractiveEditor />
<WidgetManagerComponent postOffice={postOffice} widgetContainerId={'rootWidget'} store={store} />
</Provider>,
document.getElementById('root') as HTMLElement
);
|
{
"pile_set_name": "Github"
}
|
/* $NetBSD: defs.h,v 1.10 2013/10/18 20:19:36 christos Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
* All rights reserved.
*
* Written by Philip A. Nelson for Piermont Information Systems Inc.
*
* 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.
* 3. The name of Piermont Information Systems Inc. may not be used to endorse
* or promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``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 PIERMONT INFORMATION SYSTEMS INC. 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.
*
*/
/* defs.h: definitions needed for the menu system. */
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
#include <stdio.h>
#include "mdb.h"
#ifdef MAIN
#define EXTERN
#define INIT(x) = x
#else
#define EXTERN extern
#define INIT(x)
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
/* Global variables .. to be defined in main.c, extern elsewhere. */
EXTERN char *prog_name;
EXTERN char *src_name;
EXTERN char *out_name INIT("menu_defs");
EXTERN char *sys_name INIT("menu_sys.def");
EXTERN int do_dynamic INIT(0);
EXTERN int do_msgxlat INIT(0);
EXTERN int line_no INIT(1);
EXTERN int had_errors INIT(FALSE);
EXTERN int max_strlen INIT(1);
EXTERN id_rec *root INIT(NULL);
EXTERN struct menu_info default_info;
EXTERN id_rec default_menu;
EXTERN action error_act INIT({NULL});
/* Prototypes. */
/* From util.c */
void yyerror(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
void buff_add_ch(char);
char *buff_copy(void);
/* from scan.l */
int yylex(void);
/* from parse.y */
int yyparse(void);
/* Vars not defined in main.c */
extern FILE *yyin;
/* from avl.c */
id_rec *find_id(id_rec *, char *);
int insert_id(id_rec **, id_rec *);
/* from mdb.c */
id_rec *get_menu(char *);
void check_defined(void);
void write_menu_file(char *);
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{008B1F56-5191-45CE-BA3D-291CB1BB6618}</ProjectGuid>
<RootNamespace>tiled_shading_demo</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">bin\$(Platform)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\$(Platform)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">bin\$(Platform)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\$(Platform)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">bin\$(Platform)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\$(Platform)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">bin\$(Platform)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\$(Platform)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)_$(Configuration)</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName)_$(Configuration)</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)_$(Configuration)</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName)_$(Configuration)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>glew32.lib;freeglut.lib;DevIL.lib;ILU.lib;ILUT.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>lib\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>glew32.lib;freeglut.lib;DevIL.lib;ILU.lib;ILUT.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>lib\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>glew32.lib;freeglut.lib;DevIL.lib;ILU.lib;ILUT.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>lib\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>glew32.lib;freeglut.lib;DevIL.lib;ILU.lib;ILUT.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>lib\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="utils\Assert.cpp" />
<ClCompile Include="utils\CheckGLError.cpp" />
<ClCompile Include="utils\GLTimerQuery.cpp" />
<ClCompile Include="utils\PerformanceTimer.cpp" />
<ClCompile Include="utils\Random.cpp" />
<ClCompile Include="utils\SimpleCamera.cpp" />
<ClCompile Include="utils\SimpleShader.cpp" />
<ClCompile Include="linmath\Aabb.cpp" />
<ClCompile Include="linmath\float2.cpp" />
<ClCompile Include="linmath\float3.cpp" />
<ClCompile Include="linmath\float3x3.cpp" />
<ClCompile Include="linmath\float4.cpp" />
<ClCompile Include="linmath\float4x4.cpp" />
<ClCompile Include="linmath\int2.cpp" />
<ClCompile Include="linmath\int3.cpp" />
<ClCompile Include="linmath\int4.cpp" />
<ClCompile Include="LightGrid.cpp" />
<ClCompile Include="OBJModel.cpp" />
<ClCompile Include="tiled_shading_demo.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="utils\Assert.h" />
<ClInclude Include="utils\CheckGLError.h" />
<ClInclude Include="utils\GlBufferObject.h" />
<ClInclude Include="utils\GLTimerQuery.h" />
<ClInclude Include="utils\IntTypes.h" />
<ClInclude Include="utils\Math.h" />
<ClInclude Include="utils\Path.h" />
<ClInclude Include="utils\PerformanceTimer.h" />
<ClInclude Include="utils\Random.h" />
<ClInclude Include="utils\Rendering.h" />
<ClInclude Include="utils\SimpleCamera.h" />
<ClInclude Include="utils\SimpleShader.h" />
<ClInclude Include="utils\Win32ApiWrapper.h" />
<ClInclude Include="linmath\Aabb.h" />
<ClInclude Include="linmath\Common.h" />
<ClInclude Include="linmath\float2.h" />
<ClInclude Include="linmath\float3.h" />
<ClInclude Include="linmath\float3x3.h" />
<ClInclude Include="linmath\float4.h" />
<ClInclude Include="linmath\float4x4.h" />
<ClInclude Include="linmath\int2.h" />
<ClInclude Include="linmath\int3.h" />
<ClInclude Include="linmath\int4.h" />
<ClInclude Include="linmath\SmallVector2.h" />
<ClInclude Include="linmath\SmallVector3.h" />
<ClInclude Include="linmath\SmallVector4.h" />
<ClInclude Include="ClipRegion.h" />
<ClInclude Include="Config.h" />
<ClInclude Include="Light.h" />
<ClInclude Include="LightGrid.h" />
<ClInclude Include="OBJModel.h" />
</ItemGroup>
<ItemGroup>
<None Include="shaders\deferred_fragment.glsl" />
<None Include="shaders\deferred_vertex.glsl" />
<None Include="shaders\simple_fragment.glsl" />
<None Include="shaders\simple_vertex.glsl" />
<None Include="shaders\srgb.glsl" />
<None Include="shaders\tiled_deferred_fragment.glsl" />
<None Include="shaders\tiled_deferred_vertex.glsl" />
<None Include="shaders\tiled_forward_fragment.glsl" />
<None Include="shaders\tiled_forward_vertex.glsl" />
<None Include="shaders\tiledShading.glsl" />
<None Include="linmath\SmallVector2.inl" />
<None Include="linmath\SmallVector3.inl" />
<None Include="linmath\SmallVector4.inl" />
<None Include="ReadMe.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
|
{
"pile_set_name": "Github"
}
|
/* This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
* Copyright (C) 2018 OzzieIsaacs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
var direction = 0; // Descending order
var sort = 0; // Show sorted entries
$("#sort_name").click(function() {
var count = 0;
var index = 0;
var store;
// Append 2nd half of list to first half for easier processing
var cnt = $("#second").contents();
$("#list").append(cnt);
// Count no of elements
var listItems = $("#list").children(".row");
var listlength = listItems.length;
// check for each element if its Starting character matches
$(".row").each(function() {
if ( sort === 1) {
store = this.attributes["data-name"];
} else {
store = this.attributes["data-id"];
}
$(this).find("a").html(store.value);
if ($(this).css("display") !== "none") {
count++;
}
});
/*listItems.sort(function(a,b){
return $(a).children()[1].innerText.localeCompare($(b).children()[1].innerText)
});*/
// Find count of middle element
if (count > 20) {
var middle = parseInt(count / 2, 10) + (count % 2);
// search for the middle of all visibe elements
$(".row").each(function() {
index++;
if ($(this).css("display") !== "none") {
middle--;
if (middle <= 0) {
return false;
}
}
});
// Move second half of visible elements
$("#second").append(listItems.slice(index, listlength));
}
sort = (sort + 1) % 2;
});
$("#desc").click(function() {
if (direction === 0) {
return;
}
var index = 0;
var list = $("#list");
var second = $("#second");
// var cnt = ;
list.append(second.contents());
var listItems = list.children(".row");
var reversed, elementLength, middle;
reversed = listItems.get().reverse();
elementLength = reversed.length;
// Find count of middle element
var count = $(".row:visible").length;
if (count > 20) {
middle = parseInt(count / 2) + (count % 2);
//var middle = parseInt(count / 2) + (count % 2);
// search for the middle of all visible elements
$(reversed).each(function() {
index++;
if ($(this).css("display") !== "none") {
middle--;
if (middle <= 0) {
return false;
}
}
});
list.append(reversed.slice(0, index));
second.append(reversed.slice(index, elementLength));
} else {
list.append(reversed.slice(0, elementLength));
}
direction = 0;
});
$("#asc").click(function() {
if (direction === 1) {
return;
}
var index = 0;
var list = $("#list");
var second = $("#second");
list.append(second.contents());
var listItems = list.children(".row");
var reversed = listItems.get().reverse();
var elementLength = reversed.length;
// Find count of middle element
var count = $(".row:visible").length;
if (count > 20) {
var middle = parseInt(count / 2) + (count % 2);
//var middle = parseInt(count / 2) + (count % 2);
// search for the middle of all visible elements
$(reversed).each(function() {
index++;
if ($(this).css("display") !== "none") {
middle--;
if (middle <= 0) {
return false;
}
}
});
// middle = parseInt(elementLength / 2) + (elementLength % 2);
list.append(reversed.slice(0, index));
second.append(reversed.slice(index, elementLength));
} else {
list.append(reversed.slice(0, elementLength));
}
direction = 1;
});
$("#all").click(function() {
var cnt = $("#second").contents();
$("#list").append(cnt);
// Find count of middle element
var listItems = $("#list").children(".row");
var listlength = listItems.length;
var middle = parseInt(listlength / 2, 10) + (listlength % 2);
// go through all elements and make them visible
listItems.each(function() {
$(this).show();
});
// Move second half of all elements
if (listlength > 20) {
$("#second").append(listItems.slice(middle, listlength));
}
});
$(".char").click(function() {
var character = this.innerText;
var count = 0;
var index = 0;
// Append 2nd half of list to first half for easier processing
var cnt = $("#second").contents();
$("#list").append(cnt);
// Count no of elements
var listItems = $("#list").children(".row");
var listlength = listItems.length;
// check for each element if its Starting character matches
$(".row").each(function() {
if (this.attributes["data-id"].value.charAt(0).toUpperCase() !== character) {
$(this).hide();
} else {
$(this).show();
count++;
}
});
if (count > 20) {
// Find count of middle element
var middle = parseInt(count / 2, 10) + (count % 2);
// search for the middle of all visibe elements
$(".row").each(function() {
index++;
if ($(this).css("display") !== "none") {
middle--;
if (middle <= 0) {
return false;
}
}
});
// Move second half of visible elements
$("#second").append(listItems.slice(index, listlength));
}
});
|
{
"pile_set_name": "Github"
}
|
version https://git-lfs.github.com/spec/v1
oid sha256:8d1dbc70fc0266a346d81777a353adbef1d800ae9548b86d44b0ac3b2e434c84
size 22703
|
{
"pile_set_name": "Github"
}
|
package dao
import (
"context"
"strconv"
"time"
"go-common/app/service/main/share/model"
)
// PubShare .
func (d *Dao) PubShare(c context.Context, p *model.ShareParams) (err error) {
msg := &model.MIDShare{
OID: p.OID,
MID: p.MID,
TP: p.TP,
Time: time.Now().Unix(),
}
return d.databus.Send(c, strconv.FormatInt(p.MID, 10), &msg)
}
// PubStatShare .
func (d *Dao) PubStatShare(c context.Context, typ string, oid, count int64) (err error) {
msg := &model.ArchiveShare{
Type: typ,
ID: oid,
Count: int(count),
Ts: time.Now().Unix(),
}
return d.archiveDatabus.Send(c, strconv.FormatInt(oid, 10), &msg)
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* The MIT License (MIT)
*
* Webzash - Easy to use web based double entry accounting software
*
* Copyright (c) 2014 Prashant Shah <pshah.mumbai@gmail.com>
*
* 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.
*/
App::uses('AppController', 'Controller');
/**
* Webzash App Controller
*
* @package Webzash
* @subpackage Webzash.controllers
*/
class WebzashAppController extends AppController {
public $helpers = array('Webzash.Generic',
'Html' => array('className' => 'BoostCake.BoostCakeHtml'),
'Form' => array('className' => 'BoostCake.BoostCakeForm'),
);
public $components = array(
'Security', 'Session', 'Paginator', 'Webzash.Permission', 'Webzash.Generic',
'Webzash.CustomPaginator',
'Auth' => array(
'loginRedirect' => array(
'plugin' => 'webzash',
'controller' => 'dashboard',
'action' => 'index',
),
'logoutRedirect' => array(
'plugin' => 'webzash',
'controller' => 'wzusers',
'action' => 'login',
),
'loginAction' => array(
'plugin' => 'webzash',
'controller' => 'wzusers',
'action' => 'login',
),
'authenticate' => array(
'Form' => array(
'fields' => array('username' => 'username', 'password' => 'password'),
'userModel' => 'Wzuser',
),
),
'flash' => array(
'element' => 'danger',
'key' => 'auth',
'params' => array(
'class' => 'alert-danger',
),
),
'authorize' => array('Controller'),
)
);
function beforeFilter() {
parent::beforeFilter();
/* Uncomment ANY of the below line to enable translation of the application in your langauge */
// Configure::write('Config.language', 'fra');
// CakeSession::write('Config.language', 'fra');
/* CSRF Token Expiry timelimit, change this to set the expiry time for CSRF Tokens */
// $this->Security->csrfExpires = '+1 seconds';
/* Better error messages for blackhole errors */
$this->Security->blackHoleCallback = 'blackholeErrorCallback';
/* Read URL to get the controller name */
$url_params = Router::getParams();
/* Load account setting only if the controller is NOT in admin sections */
if ($url_params['controller'] == 'admin' || $url_params['controller'] == 'wzusers' ||
$url_params['controller'] == 'wzaccounts' || $url_params['controller'] == 'wzsettings') {
return;
}
if (!$this->Auth->user('id')) {
return;
}
/* Load account related settings and entry types */
$account_id = CakeSession::read('ActiveAccount.id');
if (empty($account_id)) {
$this->Session->setFlash(__d('webzash', 'Please choose a account.'), 'danger');
return $this->redirect(array('plugin' => 'webzash', 'controller' => 'wzusers', 'action' => 'account'));
}
/* Write settings */
App::import("Webzash.Model", "Setting");
$Setting = new Setting();
$setting = '';
try {
$setting = $Setting->findById(1);
} catch (Exception $e) {
CakeSession::delete('ActiveAccount.id');
CakeSession::delete('ActiveAccount.account_role');
$this->Session->setFlash(__d('webzash', 'Settings table is missing. Please check whether this is a valid account database.'), 'danger');
return $this->redirect(array('plugin' => 'webzash', 'controller' => 'wzusers', 'action' => 'account'));
}
if (!$setting) {
CakeSession::delete('ActiveAccount.id');
CakeSession::delete('ActiveAccount.account_role');
$this->Session->setFlash(__d('webzash', 'Account settings not found. Please check if the database settings are correct.'), 'danger');
return $this->redirect(array('plugin' => 'webzash', 'controller' => 'wzusers', 'action' => 'account'));
}
/* Check if database version is correct */
if ($setting['Setting']['database_version'] < 5) {
CakeSession::delete('ActiveAccount.id');
CakeSession::delete('ActiveAccount.account_role');
$this->Session->setFlash(__d('webzash', 'You are connecting to a database which belongs to older version of this application. Please check the Wiki in the help section on how to upgrade your database.'), 'danger');
return $this->redirect(array('plugin' => 'webzash', 'controller' => 'wzusers', 'action' => 'account'));
}
if ($setting['Setting']['database_version'] == 5) {
/* If user has admin role then redirect to update page */
if (CakeSession::read('ActiveAccount.account_role') == "admin") {
$this->Session->setFlash(__d('webzash', 'You need to update the account database before activating this account.'), 'danger');
return $this->redirect(array('plugin' => 'webzash', 'controller' => 'wzaccounts', 'action' => 'update'));
}
/* If user does not belong to admin role then show message to contact administrator */
CakeSession::delete('ActiveAccount.id');
CakeSession::delete('ActiveAccount.account_role');
$this->Session->setFlash(__d('webzash', 'You need to update the account database before activating this account. Kindly contact the site administrator to update the account database.'), 'danger');
return $this->redirect(array('plugin' => 'webzash', 'controller' => 'wzusers', 'action' => 'account'));
}
if ($setting['Setting']['database_version'] > 6) {
CakeSession::delete('ActiveAccount.id');
CakeSession::delete('ActiveAccount.account_role');
$this->Session->setFlash(__d('webzash', 'You are connecting to a database which belongs to newer version of this application. Please upgrade this application before you can connect to the database.'), 'danger');
return $this->redirect(array('plugin' => 'webzash', 'controller' => 'wzusers', 'action' => 'account'));
}
/* Validate settings */
if (!($setting['Setting']['decimal_places'] == 2 || $setting['Setting']['decimal_places'] == 3)) {
CakeSession::delete('ActiveAccount.id');
CakeSession::delete('ActiveAccount.account_role');
$this->Session->setFlash(__d('webzash', 'Decimal places should be set to 2 or 3 in account settings.'), 'danger');
return $this->redirect(array('plugin' => 'webzash', 'controller' => 'wzusers', 'action' => 'account'));
}
Configure::write('Account.name', $setting['Setting']['name']);
Configure::write('Account.address', $setting['Setting']['address']);
Configure::write('Account.email', $setting['Setting']['email']);
Configure::write('Account.currency_symbol', $setting['Setting']['currency_symbol']);
Configure::write('Account.currency_format', $setting['Setting']['currency_format']);
Configure::write('Account.decimal_places', $setting['Setting']['decimal_places']);
$dateFormat = explode('|', $setting['Setting']['date_format']);
Configure::write('Account.dateformatPHP', $dateFormat[0]);
Configure::write('Account.dateformatJS', $dateFormat[1]);
Configure::write('Account.startdate', $setting['Setting']['fy_start']);
Configure::write('Account.enddate', $setting['Setting']['fy_end']);
Configure::write('Account.locked', $setting['Setting']['account_locked']);
Configure::write('Account.email_use_default', $setting['Setting']['email_use_default']);
Configure::write('Account.CurrentDatabaseVersion', $setting['Setting']['database_version']);
/* Write entry types */
App::import("Webzash.Model", "Entrytype");
$Entrytype = new Entrytype();
$rawentrytypes = '';
try {
$rawentrytypes = $Entrytype->find('all');
} catch (Exception $e) {
CakeSession::delete('ActiveAccount.id');
CakeSession::delete('ActiveAccount.account_role');
$this->Session->setFlash(__d('webzash', 'Entry types table is missing. Please check whether this is a valid account database.'), 'danger');
return $this->redirect(array('plugin' => 'webzash', 'controller' => 'wzusers', 'action' => 'account'));
}
$entrytypes = array();
foreach ($rawentrytypes as $entrytype) {
$entrytypes[$entrytype['Entrytype']['id']] = array(
'prefix' => $entrytype['Entrytype']['prefix'],
'suffix' => $entrytype['Entrytype']['suffix'],
'zero_padding' => $entrytype['Entrytype']['zero_padding'],
'label' => $entrytype['Entrytype']['label'],
'name' => $entrytype['Entrytype']['name'],
);
}
Configure::write('Account.ET', $entrytypes);
}
/* Custom handling of blackhole error message */
public function blackholeErrorCallback($type)
{
$this->Session->setFlash(__d('webzash', 'CSRF Token Expired ! You have exceeded the time limit set to complete a request, so for security reasons you need to redo whatever you were trying to do.'), 'danger');
return $this->redirect(array('plugin' => 'webzash', 'controller' => 'dashboard', 'action' => 'index'));
}
public function isAuthorized($user) {
/* Admin can access every action */
if (isset($user['role']) && $user['role'] === 'admin') {
return true;
}
/* Default deny */
return false;
}
}
|
{
"pile_set_name": "Github"
}
|
JAVAFX SAMPLES README
Contents:
What's in the samples zip file?
What do I need to set up my environment?
How do I run the prebuilt samples?
How do I run the sample projects in NetBeans IDE?
What are the other ways I can package the samples?
Sample Descriptions
===============================
What's in the samples zip file?
===============================
The samples zip file contains prebuilt samples that you can run, plus NetBeans
project files for each sample.
Extracting the zip file produces the following directory structure:
--src (Contains a NetBeans project for each sample)
--<Sample1>
--nbproject
--src
--build.xml
--manifest.mf
--<Sample2>
...
<sample1>.jar (Runs the sample as a standalone application)
<sample2>.jar
...
========================================
What do I need to set up my environment?
========================================
To run the samples, you need the following environment:
- A supported version** of the Java Development Kit (JDK) or Java Runtime
Environment (JRE). The JDK includes the JRE.
To open the samples projects in NetBeans IDE, you need the following
environment:
- A supported version** of the JDK.
- A supported version** of NetBeans IDE.
**To find information about the supported versions of operating system and browser
for a particular Java release, see
http://www.oracle.com/technetwork/java/javase/downloads/index.html
==================================
How do I run the prebuilt samples?
==================================
To run as a standalone application, double-click the JAR file.
=================================================
How do I run the sample projects in NetBeans IDE?
=================================================
The following procedure assumes you have already extracted the samples zip
file.
To run the sample projects:
1. In NetBeans IDE, click Open Project in the toolbar, or on the File menu,
select Open Project.
2. Navigate to the location in which you unzipped the samples, and in the src
directory, select a project, then click Open.
3. To run the application in NetBeans IDE, in the Project pane, right-click
the project and choose Run.
==================================================
What are the other ways I can package the samples?
==================================================
You can also package any of the samples as an applet, JNLP, or native bundle
that includes an installer and a copy of the JRE for execution in an environment
that does not have JavaFX installed. See https://docs.oracle.com/javafx for
additional information about deploying JavaFX application.
===================
Sample Descriptions
===================
The following samples are included in the zip file.
---------
Ensemble8
A gallery of sample applications that demonstrate a large variety of JavaFX
features, including animation, charts, and controls. For each sample, you
can do the following on ALL platforms:
- View and interact with the running sample.
- Read its description.
You can do the following for each sample on desktop platforms only:
- Copy its source code.
- For several samples, you can adjust the properties of the sample components.
- If you are connected to the internet, you can also follow links to the
relevant API documentation.
Ensemble8 also runs with JavaFX for ARM.
-------------
MandelbrotSet
A sample application that demonstrates advantages of parallel execution done
using Java Parallel API. The application renders an image using Mandelbrot set
algorithm and provides intuitive navigation within the range of input parameters.
More information is available in index.html file inside the MandelbrotSet folder.
------
Modena
A sample application that demonstrates the look and feel of UI components using
the Modena theme. It gives you the option to contrast Modena and Caspian themes,
and explore various aspects of these themes.
------------
3DViewer
3DViewer is a sample application that allows the user to navigate and examine a
3D scene with a mouse or a trackpad. 3DViewer has importers for a subset of the
features in OBJ and Maya files. The ability to import animation is also
provided for Maya files. (Note that in the case of Maya files, construction
history should be deleted on all the objects when saving as a Maya file.)
3DViewer also has the ability to export the contents of the scene as Java or
FXML files.
--------------------------------------------------------------------
Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
{
"pile_set_name": "Github"
}
|
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { DataService, Dialog, GetCountryList, GetZones } from '@vendure/admin-ui/core';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
@Component({
selector: 'vdr-add-country-to-zone-dialog',
templateUrl: './add-country-to-zone-dialog.component.html',
styleUrls: ['./add-country-to-zone-dialog.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AddCountryToZoneDialogComponent implements Dialog<string[]>, OnInit {
resolveWith: (result?: string[]) => void;
zoneName: string;
currentMembers: GetZones.Members[] = [];
availableCountries$: Observable<GetCountryList.Items[]>;
selectedMemberIds: string[] = [];
constructor(private dataService: DataService) {}
ngOnInit(): void {
const currentMemberIds = this.currentMembers.map(m => m.id);
this.availableCountries$ = this.dataService.settings
.getCountries(99999)
.mapStream(data => data.countries.items)
.pipe(map(countries => countries.filter(c => !currentMemberIds.includes(c.id))));
}
cancel() {
this.resolveWith();
}
add() {
this.resolveWith(this.selectedMemberIds);
}
}
|
{
"pile_set_name": "Github"
}
|
46.806400 0.000000 -0.000000 -0.000000 -0.000000 0.000000 0.000000 1.000000
46.910140 -0.019217 -0.015999 1.066867 -0.000302 -0.005696 -0.001151 0.999983
47.013900 -0.050265 -0.033200 2.135838 -0.001041 -0.010592 -0.003114 0.999939
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<h1>require.js: Simple Test, no head tag</h1>
<p>Check console for messages</p>
<script type="text/javascript">
var require = {
baseUrl: "./"
};
</script>
<script type="text/javascript" src="../require.js"></script>
<script type="text/javascript" src="doh/runner.js"></script>
<script type="text/javascript" src="doh/_browserRunner.js"></script>
<script type="text/javascript">
require(["require", "simple", "dimple", "func"],
function(require, simple, dimple, func) {
doh.register(
"simple-nohead",
[
function colors(t){
t.is("blue", simple.color);
t.is("dimple-blue", dimple.color);
t.is("You called a function", func());
}
]
);
doh.run();
}
);
</script>
|
{
"pile_set_name": "Github"
}
|
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ShadowMapping.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
{
"HostName": {
"Generated": "@logon",
"Value": "${Hostname}",
"LastRun": "Never"
},
"HostIp": {
"Generated": "@cron",
"Value": "${HostIp}",
"LastRun": "Never"
},
"Release": {
"Generated": "@cron",
"Value": "${Release}",
"LastRun": "Never"
},
"Kernel": {
"Generated": "@cron",
"Value": "${Kernel}",
"LastRun": "Never"
},
"Platform": {
"Generated": "@cron",
"Value": "${Platform}",
"LastRun": "Never"
},
"Uptime": {
"Generated": "@logon",
"Days": "${UptimeDays}",
"Hours": "${UptimeHours}",
"Minutes": "${UptimeMinutes}",
"Seconds": "${UptimeSeconds}",
"LastRun": "Never"
},
"InstallDate": {
"Generated": "@cron",
"Value": "${InstallDate}",
"LastRun": "Never"
},
"CpuUsage": {
"Generated": "@logon",
"Average": "${CpuUsageAverage}",
"CpuCount": "${CpuUsageCpuCount}",
"CoreCount": "${CpuUsageCoreCount}",
"SocketCount": "${CpuUsageSocketCount}",
"LastRun": "Never"
},
"CpuLoad": {
"Generated": "@logon",
"Value": "${CpuLoad}",
"LastRun": "Never"
},
"Memory": {
"Generated": "@logon",
"TotalGB": "${MemTotalGB}",
"FreeGB": "${MemFreeGB}",
"UsedGB": "${MemUsedGB}",
"FreePerc": "${MemFreePerc}",
"UsedPerc": "${MemUsedPerc}",
"LastRun": "Never"
},
"Swap": {
"Generated": "@logon",
"TotalGB": "${SwapTotalGB}",
"FreeGB": "${SwapFreeGB}",
"UsedGB": "${SwapUsedGB}",
"FreePerc": "${SwapFreePerc}",
"UsedPerc": "${SwapUsedPerc}",
"LastRun": "Never"
},
"DiskRoot": {
"Generated": "@logon",
"TotalGB": "${DiskRootTotalGB}",
"FreeGB": "${DiskRootFreeGB}",
"UsedGB": "${DiskRootUsedGB}",
"FreePerc": "${DiskRootFreePerc}",
"UsedPerc": "${DiskRootUsedPerc}",
"LastRun": "Never"
},
"Updates": {
"Generated": "@cron",
"Type": "${UpdateType}",
"Count": "${UpdateCount}",
"LastRun": "Never"
},
"Sessions": {
"Generated": "@logon",
"Count": "${SessionCount}",
"LastRun": "Never"
},
"Processes": {
"Generated": "@logon",
"Count": "${ProcessCount}",
"Max": "${ProcessMax}",
"LastRun": "Never"
},
"Httpd": {
"Generated": "@cron",
"Version": "${HtppdVersion}",
"LastRun": "Never"
},
"Nginx": {
"Generated": "@cron",
"Version": "${NginxVersion}",
"LastRun": "Never"
},
"Mysql": {
"Generated": "@cron",
"Version": "${MysqlVersion}",
"Distribution": "${MysqlDistribution}",
"LastRun": "Never"
},
"Postgres": {
"Generated": "@cron",
"Version": "${PostgresVersion}",
"LastRun": "Never"
},
"Php": {
"Generated": "@cron",
"Version": "${PhpVersion}",
"MaxMemory": "${PhpMaxMemory}",
"LastRun": "Never"
},
"Elasticsearch": {
"Generated": "@cron",
"Version": "${ElasticsearchVersion}",
"LastRun": "Never"
},
"Logstash": {
"Generated": "@cron",
"Version": "${LogstashVersion}",
"LastRun": "Never"
},
"Kibana": {
"Generated": "@cron",
"Version": "${KibanaVersion}",
"LastRun": "Never"
}
}
|
{
"pile_set_name": "Github"
}
|
/* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */
#ifndef LIBFDT_H
#define LIBFDT_H
/*
* libfdt - Flat Device Tree manipulation
* Copyright (C) 2006 David Gibson, IBM Corporation.
*/
#include "libfdt_env.h"
#include "fdt.h"
#ifdef __cplusplus
extern "C" {
#endif
#define FDT_FIRST_SUPPORTED_VERSION 0x02
#define FDT_LAST_SUPPORTED_VERSION 0x11
/* Error codes: informative error codes */
#define FDT_ERR_NOTFOUND 1
/* FDT_ERR_NOTFOUND: The requested node or property does not exist */
#define FDT_ERR_EXISTS 2
/* FDT_ERR_EXISTS: Attempted to create a node or property which
* already exists */
#define FDT_ERR_NOSPACE 3
/* FDT_ERR_NOSPACE: Operation needed to expand the device
* tree, but its buffer did not have sufficient space to
* contain the expanded tree. Use fdt_open_into() to move the
* device tree to a buffer with more space. */
/* Error codes: codes for bad parameters */
#define FDT_ERR_BADOFFSET 4
/* FDT_ERR_BADOFFSET: Function was passed a structure block
* offset which is out-of-bounds, or which points to an
* unsuitable part of the structure for the operation. */
#define FDT_ERR_BADPATH 5
/* FDT_ERR_BADPATH: Function was passed a badly formatted path
* (e.g. missing a leading / for a function which requires an
* absolute path) */
#define FDT_ERR_BADPHANDLE 6
/* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle.
* This can be caused either by an invalid phandle property
* length, or the phandle value was either 0 or -1, which are
* not permitted. */
#define FDT_ERR_BADSTATE 7
/* FDT_ERR_BADSTATE: Function was passed an incomplete device
* tree created by the sequential-write functions, which is
* not sufficiently complete for the requested operation. */
/* Error codes: codes for bad device tree blobs */
#define FDT_ERR_TRUNCATED 8
/* FDT_ERR_TRUNCATED: FDT or a sub-block is improperly
* terminated (overflows, goes outside allowed bounds, or
* isn't properly terminated). */
#define FDT_ERR_BADMAGIC 9
/* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
* device tree at all - it is missing the flattened device
* tree magic number. */
#define FDT_ERR_BADVERSION 10
/* FDT_ERR_BADVERSION: Given device tree has a version which
* can't be handled by the requested operation. For
* read-write functions, this may mean that fdt_open_into() is
* required to convert the tree to the expected version. */
#define FDT_ERR_BADSTRUCTURE 11
/* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
* structure block or other serious error (e.g. misnested
* nodes, or subnodes preceding properties). */
#define FDT_ERR_BADLAYOUT 12
/* FDT_ERR_BADLAYOUT: For read-write functions, the given
* device tree has it's sub-blocks in an order that the
* function can't handle (memory reserve map, then structure,
* then strings). Use fdt_open_into() to reorganize the tree
* into a form suitable for the read-write operations. */
/* "Can't happen" error indicating a bug in libfdt */
#define FDT_ERR_INTERNAL 13
/* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
* Should never be returned, if it is, it indicates a bug in
* libfdt itself. */
/* Errors in device tree content */
#define FDT_ERR_BADNCELLS 14
/* FDT_ERR_BADNCELLS: Device tree has a #address-cells, #size-cells
* or similar property with a bad format or value */
#define FDT_ERR_BADVALUE 15
/* FDT_ERR_BADVALUE: Device tree has a property with an unexpected
* value. For example: a property expected to contain a string list
* is not NUL-terminated within the length of its value. */
#define FDT_ERR_BADOVERLAY 16
/* FDT_ERR_BADOVERLAY: The device tree overlay, while
* correctly structured, cannot be applied due to some
* unexpected or missing value, property or node. */
#define FDT_ERR_NOPHANDLES 17
/* FDT_ERR_NOPHANDLES: The device tree doesn't have any
* phandle available anymore without causing an overflow */
#define FDT_ERR_BADFLAGS 18
/* FDT_ERR_BADFLAGS: The function was passed a flags field that
* contains invalid flags or an invalid combination of flags. */
#define FDT_ERR_MAX 18
/* constants */
#define FDT_MAX_PHANDLE 0xfffffffe
/* Valid values for phandles range from 1 to 2^32-2. */
/**********************************************************************/
/* Low-level functions (you probably don't need these) */
/**********************************************************************/
#ifndef SWIG /* This function is not useful in Python */
const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
#endif
static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
{
return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
}
uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
/*
* Alignment helpers:
* These helpers access words from a device tree blob. They're
* built to work even with unaligned pointers on platforms (ike
* ARM) that don't like unaligned loads and stores
*/
static inline uint32_t fdt32_ld(const fdt32_t *p)
{
const uint8_t *bp = (const uint8_t *)p;
return ((uint32_t)bp[0] << 24)
| ((uint32_t)bp[1] << 16)
| ((uint32_t)bp[2] << 8)
| bp[3];
}
static inline void fdt32_st(void *property, uint32_t value)
{
uint8_t *bp = (uint8_t *)property;
bp[0] = value >> 24;
bp[1] = (value >> 16) & 0xff;
bp[2] = (value >> 8) & 0xff;
bp[3] = value & 0xff;
}
static inline uint64_t fdt64_ld(const fdt64_t *p)
{
const uint8_t *bp = (const uint8_t *)p;
return ((uint64_t)bp[0] << 56)
| ((uint64_t)bp[1] << 48)
| ((uint64_t)bp[2] << 40)
| ((uint64_t)bp[3] << 32)
| ((uint64_t)bp[4] << 24)
| ((uint64_t)bp[5] << 16)
| ((uint64_t)bp[6] << 8)
| bp[7];
}
static inline void fdt64_st(void *property, uint64_t value)
{
uint8_t *bp = (uint8_t *)property;
bp[0] = value >> 56;
bp[1] = (value >> 48) & 0xff;
bp[2] = (value >> 40) & 0xff;
bp[3] = (value >> 32) & 0xff;
bp[4] = (value >> 24) & 0xff;
bp[5] = (value >> 16) & 0xff;
bp[6] = (value >> 8) & 0xff;
bp[7] = value & 0xff;
}
/**********************************************************************/
/* Traversal functions */
/**********************************************************************/
int fdt_next_node(const void *fdt, int offset, int *depth);
/**
* fdt_first_subnode() - get offset of first direct subnode
*
* @fdt: FDT blob
* @offset: Offset of node to check
* @return offset of first subnode, or -FDT_ERR_NOTFOUND if there is none
*/
int fdt_first_subnode(const void *fdt, int offset);
/**
* fdt_next_subnode() - get offset of next direct subnode
*
* After first calling fdt_first_subnode(), call this function repeatedly to
* get direct subnodes of a parent node.
*
* @fdt: FDT blob
* @offset: Offset of previous subnode
* @return offset of next subnode, or -FDT_ERR_NOTFOUND if there are no more
* subnodes
*/
int fdt_next_subnode(const void *fdt, int offset);
/**
* fdt_for_each_subnode - iterate over all subnodes of a parent
*
* @node: child node (int, lvalue)
* @fdt: FDT blob (const void *)
* @parent: parent node (int)
*
* This is actually a wrapper around a for loop and would be used like so:
*
* fdt_for_each_subnode(node, fdt, parent) {
* Use node
* ...
* }
*
* if ((node < 0) && (node != -FDT_ERR_NOTFOUND)) {
* Error handling
* }
*
* Note that this is implemented as a macro and @node is used as
* iterator in the loop. The parent variable be constant or even a
* literal.
*
*/
#define fdt_for_each_subnode(node, fdt, parent) \
for (node = fdt_first_subnode(fdt, parent); \
node >= 0; \
node = fdt_next_subnode(fdt, node))
/**********************************************************************/
/* General functions */
/**********************************************************************/
#define fdt_get_header(fdt, field) \
(fdt32_ld(&((const struct fdt_header *)(fdt))->field))
#define fdt_magic(fdt) (fdt_get_header(fdt, magic))
#define fdt_totalsize(fdt) (fdt_get_header(fdt, totalsize))
#define fdt_off_dt_struct(fdt) (fdt_get_header(fdt, off_dt_struct))
#define fdt_off_dt_strings(fdt) (fdt_get_header(fdt, off_dt_strings))
#define fdt_off_mem_rsvmap(fdt) (fdt_get_header(fdt, off_mem_rsvmap))
#define fdt_version(fdt) (fdt_get_header(fdt, version))
#define fdt_last_comp_version(fdt) (fdt_get_header(fdt, last_comp_version))
#define fdt_boot_cpuid_phys(fdt) (fdt_get_header(fdt, boot_cpuid_phys))
#define fdt_size_dt_strings(fdt) (fdt_get_header(fdt, size_dt_strings))
#define fdt_size_dt_struct(fdt) (fdt_get_header(fdt, size_dt_struct))
#define fdt_set_hdr_(name) \
static inline void fdt_set_##name(void *fdt, uint32_t val) \
{ \
struct fdt_header *fdth = (struct fdt_header *)fdt; \
fdth->name = cpu_to_fdt32(val); \
}
fdt_set_hdr_(magic);
fdt_set_hdr_(totalsize);
fdt_set_hdr_(off_dt_struct);
fdt_set_hdr_(off_dt_strings);
fdt_set_hdr_(off_mem_rsvmap);
fdt_set_hdr_(version);
fdt_set_hdr_(last_comp_version);
fdt_set_hdr_(boot_cpuid_phys);
fdt_set_hdr_(size_dt_strings);
fdt_set_hdr_(size_dt_struct);
#undef fdt_set_hdr_
/**
* fdt_header_size - return the size of the tree's header
* @fdt: pointer to a flattened device tree
*/
size_t fdt_header_size(const void *fdt);
/**
* fdt_header_size_ - internal function which takes a version number
*/
size_t fdt_header_size_(uint32_t version);
/**
* fdt_check_header - sanity check a device tree header
* @fdt: pointer to data which might be a flattened device tree
*
* fdt_check_header() checks that the given buffer contains what
* appears to be a flattened device tree, and that the header contains
* valid information (to the extent that can be determined from the
* header alone).
*
* returns:
* 0, if the buffer appears to contain a valid device tree
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_TRUNCATED, standard meanings, as above
*/
int fdt_check_header(const void *fdt);
/**
* fdt_move - move a device tree around in memory
* @fdt: pointer to the device tree to move
* @buf: pointer to memory where the device is to be moved
* @bufsize: size of the memory space at buf
*
* fdt_move() relocates, if possible, the device tree blob located at
* fdt to the buffer at buf of size bufsize. The buffer may overlap
* with the existing device tree blob at fdt. Therefore,
* fdt_move(fdt, fdt, fdt_totalsize(fdt))
* should always succeed.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE, standard meanings
*/
int fdt_move(const void *fdt, void *buf, int bufsize);
/**********************************************************************/
/* Read-only functions */
/**********************************************************************/
int fdt_check_full(const void *fdt, size_t bufsize);
/**
* fdt_get_string - retrieve a string from the strings block of a device tree
* @fdt: pointer to the device tree blob
* @stroffset: offset of the string within the strings block (native endian)
* @lenp: optional pointer to return the string's length
*
* fdt_get_string() retrieves a pointer to a single string from the
* strings block of the device tree blob at fdt, and optionally also
* returns the string's length in *lenp.
*
* returns:
* a pointer to the string, on success
* NULL, if stroffset is out of bounds, or doesn't point to a valid string
*/
const char *fdt_get_string(const void *fdt, int stroffset, int *lenp);
/**
* fdt_string - retrieve a string from the strings block of a device tree
* @fdt: pointer to the device tree blob
* @stroffset: offset of the string within the strings block (native endian)
*
* fdt_string() retrieves a pointer to a single string from the
* strings block of the device tree blob at fdt.
*
* returns:
* a pointer to the string, on success
* NULL, if stroffset is out of bounds, or doesn't point to a valid string
*/
const char *fdt_string(const void *fdt, int stroffset);
/**
* fdt_find_max_phandle - find and return the highest phandle in a tree
* @fdt: pointer to the device tree blob
* @phandle: return location for the highest phandle value found in the tree
*
* fdt_find_max_phandle() finds the highest phandle value in the given device
* tree. The value returned in @phandle is only valid if the function returns
* success.
*
* returns:
* 0 on success or a negative error code on failure
*/
int fdt_find_max_phandle(const void *fdt, uint32_t *phandle);
/**
* fdt_get_max_phandle - retrieves the highest phandle in a tree
* @fdt: pointer to the device tree blob
*
* fdt_get_max_phandle retrieves the highest phandle in the given
* device tree. This will ignore badly formatted phandles, or phandles
* with a value of 0 or -1.
*
* This function is deprecated in favour of fdt_find_max_phandle().
*
* returns:
* the highest phandle on success
* 0, if no phandle was found in the device tree
* -1, if an error occurred
*/
static inline uint32_t fdt_get_max_phandle(const void *fdt)
{
uint32_t phandle;
int err;
err = fdt_find_max_phandle(fdt, &phandle);
if (err < 0)
return (uint32_t)-1;
return phandle;
}
/**
* fdt_generate_phandle - return a new, unused phandle for a device tree blob
* @fdt: pointer to the device tree blob
* @phandle: return location for the new phandle
*
* Walks the device tree blob and looks for the highest phandle value. On
* success, the new, unused phandle value (one higher than the previously
* highest phandle value in the device tree blob) will be returned in the
* @phandle parameter.
*
* Returns:
* 0 on success or a negative error-code on failure
*/
int fdt_generate_phandle(const void *fdt, uint32_t *phandle);
/**
* fdt_num_mem_rsv - retrieve the number of memory reserve map entries
* @fdt: pointer to the device tree blob
*
* Returns the number of entries in the device tree blob's memory
* reservation map. This does not include the terminating 0,0 entry
* or any other (0,0) entries reserved for expansion.
*
* returns:
* the number of entries
*/
int fdt_num_mem_rsv(const void *fdt);
/**
* fdt_get_mem_rsv - retrieve one memory reserve map entry
* @fdt: pointer to the device tree blob
* @address, @size: pointers to 64-bit variables
*
* On success, *address and *size will contain the address and size of
* the n-th reserve map entry from the device tree blob, in
* native-endian format.
*
* returns:
* 0, on success
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE, standard meanings
*/
int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
/**
* fdt_subnode_offset_namelen - find a subnode based on substring
* @fdt: pointer to the device tree blob
* @parentoffset: structure block offset of a node
* @name: name of the subnode to locate
* @namelen: number of characters of name to consider
*
* Identical to fdt_subnode_offset(), but only examine the first
* namelen characters of name for matching the subnode name. This is
* useful for finding subnodes based on a portion of a larger string,
* such as a full path.
*/
#ifndef SWIG /* Not available in Python */
int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
const char *name, int namelen);
#endif
/**
* fdt_subnode_offset - find a subnode of a given node
* @fdt: pointer to the device tree blob
* @parentoffset: structure block offset of a node
* @name: name of the subnode to locate
*
* fdt_subnode_offset() finds a subnode of the node at structure block
* offset parentoffset with the given name. name may include a unit
* address, in which case fdt_subnode_offset() will find the subnode
* with that unit address, or the unit address may be omitted, in
* which case fdt_subnode_offset() will find an arbitrary subnode
* whose name excluding unit address matches the given name.
*
* returns:
* structure block offset of the requested subnode (>=0), on success
* -FDT_ERR_NOTFOUND, if the requested subnode does not exist
* -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE
* tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings.
*/
int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
/**
* fdt_path_offset_namelen - find a tree node by its full path
* @fdt: pointer to the device tree blob
* @path: full path of the node to locate
* @namelen: number of characters of path to consider
*
* Identical to fdt_path_offset(), but only consider the first namelen
* characters of path as the path name.
*/
#ifndef SWIG /* Not available in Python */
int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen);
#endif
/**
* fdt_path_offset - find a tree node by its full path
* @fdt: pointer to the device tree blob
* @path: full path of the node to locate
*
* fdt_path_offset() finds a node of a given path in the device tree.
* Each path component may omit the unit address portion, but the
* results of this are undefined if any such path component is
* ambiguous (that is if there are multiple nodes at the relevant
* level matching the given component, differentiated only by unit
* address).
*
* returns:
* structure block offset of the node with the requested path (>=0), on
* success
* -FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
* -FDT_ERR_NOTFOUND, if the requested node does not exist
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings.
*/
int fdt_path_offset(const void *fdt, const char *path);
/**
* fdt_get_name - retrieve the name of a given node
* @fdt: pointer to the device tree blob
* @nodeoffset: structure block offset of the starting node
* @lenp: pointer to an integer variable (will be overwritten) or NULL
*
* fdt_get_name() retrieves the name (including unit address) of the
* device tree node at structure block offset nodeoffset. If lenp is
* non-NULL, the length of this name is also returned, in the integer
* pointed to by lenp.
*
* returns:
* pointer to the node's name, on success
* If lenp is non-NULL, *lenp contains the length of that name
* (>=0)
* NULL, on error
* if lenp is non-NULL *lenp contains an error code (<0):
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
* tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE, standard meanings
*/
const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
/**
* fdt_first_property_offset - find the offset of a node's first property
* @fdt: pointer to the device tree blob
* @nodeoffset: structure block offset of a node
*
* fdt_first_property_offset() finds the first property of the node at
* the given structure block offset.
*
* returns:
* structure block offset of the property (>=0), on success
* -FDT_ERR_NOTFOUND, if the requested node has no properties
* -FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_BEGIN_NODE tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings.
*/
int fdt_first_property_offset(const void *fdt, int nodeoffset);
/**
* fdt_next_property_offset - step through a node's properties
* @fdt: pointer to the device tree blob
* @offset: structure block offset of a property
*
* fdt_next_property_offset() finds the property immediately after the
* one at the given structure block offset. This will be a property
* of the same node as the given property.
*
* returns:
* structure block offset of the next property (>=0), on success
* -FDT_ERR_NOTFOUND, if the given property is the last in its node
* -FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_PROP tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings.
*/
int fdt_next_property_offset(const void *fdt, int offset);
/**
* fdt_for_each_property_offset - iterate over all properties of a node
*
* @property_offset: property offset (int, lvalue)
* @fdt: FDT blob (const void *)
* @node: node offset (int)
*
* This is actually a wrapper around a for loop and would be used like so:
*
* fdt_for_each_property_offset(property, fdt, node) {
* Use property
* ...
* }
*
* if ((property < 0) && (property != -FDT_ERR_NOTFOUND)) {
* Error handling
* }
*
* Note that this is implemented as a macro and property is used as
* iterator in the loop. The node variable can be constant or even a
* literal.
*/
#define fdt_for_each_property_offset(property, fdt, node) \
for (property = fdt_first_property_offset(fdt, node); \
property >= 0; \
property = fdt_next_property_offset(fdt, property))
/**
* fdt_get_property_by_offset - retrieve the property at a given offset
* @fdt: pointer to the device tree blob
* @offset: offset of the property to retrieve
* @lenp: pointer to an integer variable (will be overwritten) or NULL
*
* fdt_get_property_by_offset() retrieves a pointer to the
* fdt_property structure within the device tree blob at the given
* offset. If lenp is non-NULL, the length of the property value is
* also returned, in the integer pointed to by lenp.
*
* Note that this code only works on device tree versions >= 16. fdt_getprop()
* works on all versions.
*
* returns:
* pointer to the structure representing the property
* if lenp is non-NULL, *lenp contains the length of the property
* value (>=0)
* NULL, on error
* if lenp is non-NULL, *lenp contains an error code (<0):
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
int offset,
int *lenp);
/**
* fdt_get_property_namelen - find a property based on substring
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to find
* @name: name of the property to find
* @namelen: number of characters of name to consider
* @lenp: pointer to an integer variable (will be overwritten) or NULL
*
* Identical to fdt_get_property(), but only examine the first namelen
* characters of name for matching the property name.
*/
#ifndef SWIG /* Not available in Python */
const struct fdt_property *fdt_get_property_namelen(const void *fdt,
int nodeoffset,
const char *name,
int namelen, int *lenp);
#endif
/**
* fdt_get_property - find a given property in a given node
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to find
* @name: name of the property to find
* @lenp: pointer to an integer variable (will be overwritten) or NULL
*
* fdt_get_property() retrieves a pointer to the fdt_property
* structure within the device tree blob corresponding to the property
* named 'name' of the node at offset nodeoffset. If lenp is
* non-NULL, the length of the property value is also returned, in the
* integer pointed to by lenp.
*
* returns:
* pointer to the structure representing the property
* if lenp is non-NULL, *lenp contains the length of the property
* value (>=0)
* NULL, on error
* if lenp is non-NULL, *lenp contains an error code (<0):
* -FDT_ERR_NOTFOUND, node does not have named property
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
* tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
const char *name, int *lenp);
static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
const char *name,
int *lenp)
{
return (struct fdt_property *)(uintptr_t)
fdt_get_property(fdt, nodeoffset, name, lenp);
}
/**
* fdt_getprop_by_offset - retrieve the value of a property at a given offset
* @fdt: pointer to the device tree blob
* @offset: offset of the property to read
* @namep: pointer to a string variable (will be overwritten) or NULL
* @lenp: pointer to an integer variable (will be overwritten) or NULL
*
* fdt_getprop_by_offset() retrieves a pointer to the value of the
* property at structure block offset 'offset' (this will be a pointer
* to within the device blob itself, not a copy of the value). If
* lenp is non-NULL, the length of the property value is also
* returned, in the integer pointed to by lenp. If namep is non-NULL,
* the property's namne will also be returned in the char * pointed to
* by namep (this will be a pointer to within the device tree's string
* block, not a new copy of the name).
*
* returns:
* pointer to the property's value
* if lenp is non-NULL, *lenp contains the length of the property
* value (>=0)
* if namep is non-NULL *namep contiains a pointer to the property
* name.
* NULL, on error
* if lenp is non-NULL, *lenp contains an error code (<0):
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
#ifndef SWIG /* This function is not useful in Python */
const void *fdt_getprop_by_offset(const void *fdt, int offset,
const char **namep, int *lenp);
#endif
/**
* fdt_getprop_namelen - get property value based on substring
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to find
* @name: name of the property to find
* @namelen: number of characters of name to consider
* @lenp: pointer to an integer variable (will be overwritten) or NULL
*
* Identical to fdt_getprop(), but only examine the first namelen
* characters of name for matching the property name.
*/
#ifndef SWIG /* Not available in Python */
const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
const char *name, int namelen, int *lenp);
static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset,
const char *name, int namelen,
int *lenp)
{
return (void *)(uintptr_t)fdt_getprop_namelen(fdt, nodeoffset, name,
namelen, lenp);
}
#endif
/**
* fdt_getprop - retrieve the value of a given property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to find
* @name: name of the property to find
* @lenp: pointer to an integer variable (will be overwritten) or NULL
*
* fdt_getprop() retrieves a pointer to the value of the property
* named 'name' of the node at offset nodeoffset (this will be a
* pointer to within the device blob itself, not a copy of the value).
* If lenp is non-NULL, the length of the property value is also
* returned, in the integer pointed to by lenp.
*
* returns:
* pointer to the property's value
* if lenp is non-NULL, *lenp contains the length of the property
* value (>=0)
* NULL, on error
* if lenp is non-NULL, *lenp contains an error code (<0):
* -FDT_ERR_NOTFOUND, node does not have named property
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
* tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
const void *fdt_getprop(const void *fdt, int nodeoffset,
const char *name, int *lenp);
static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
const char *name, int *lenp)
{
return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
}
/**
* fdt_get_phandle - retrieve the phandle of a given node
* @fdt: pointer to the device tree blob
* @nodeoffset: structure block offset of the node
*
* fdt_get_phandle() retrieves the phandle of the device tree node at
* structure block offset nodeoffset.
*
* returns:
* the phandle of the node at nodeoffset, on success (!= 0, != -1)
* 0, if the node has no phandle, or another error occurs
*/
uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
/**
* fdt_get_alias_namelen - get alias based on substring
* @fdt: pointer to the device tree blob
* @name: name of the alias th look up
* @namelen: number of characters of name to consider
*
* Identical to fdt_get_alias(), but only examine the first namelen
* characters of name for matching the alias name.
*/
#ifndef SWIG /* Not available in Python */
const char *fdt_get_alias_namelen(const void *fdt,
const char *name, int namelen);
#endif
/**
* fdt_get_alias - retrieve the path referenced by a given alias
* @fdt: pointer to the device tree blob
* @name: name of the alias th look up
*
* fdt_get_alias() retrieves the value of a given alias. That is, the
* value of the property named 'name' in the node /aliases.
*
* returns:
* a pointer to the expansion of the alias named 'name', if it exists
* NULL, if the given alias or the /aliases node does not exist
*/
const char *fdt_get_alias(const void *fdt, const char *name);
/**
* fdt_get_path - determine the full path of a node
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose path to find
* @buf: character buffer to contain the returned path (will be overwritten)
* @buflen: size of the character buffer at buf
*
* fdt_get_path() computes the full path of the node at offset
* nodeoffset, and records that path in the buffer at buf.
*
* NOTE: This function is expensive, as it must scan the device tree
* structure from the start to nodeoffset.
*
* returns:
* 0, on success
* buf contains the absolute path of the node at
* nodeoffset, as a NUL-terminated string.
* -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
* -FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
* characters and will not fit in the given buffer.
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE, standard meanings
*/
int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
/**
* fdt_supernode_atdepth_offset - find a specific ancestor of a node
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose parent to find
* @supernodedepth: depth of the ancestor to find
* @nodedepth: pointer to an integer variable (will be overwritten) or NULL
*
* fdt_supernode_atdepth_offset() finds an ancestor of the given node
* at a specific depth from the root (where the root itself has depth
* 0, its immediate subnodes depth 1 and so forth). So
* fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
* will always return 0, the offset of the root node. If the node at
* nodeoffset has depth D, then:
* fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
* will return nodeoffset itself.
*
* NOTE: This function is expensive, as it must scan the device tree
* structure from the start to nodeoffset.
*
* returns:
* structure block offset of the node at node offset's ancestor
* of depth supernodedepth (>=0), on success
* -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
* -FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of
* nodeoffset
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE, standard meanings
*/
int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
int supernodedepth, int *nodedepth);
/**
* fdt_node_depth - find the depth of a given node
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose parent to find
*
* fdt_node_depth() finds the depth of a given node. The root node
* has depth 0, its immediate subnodes depth 1 and so forth.
*
* NOTE: This function is expensive, as it must scan the device tree
* structure from the start to nodeoffset.
*
* returns:
* depth of the node at nodeoffset (>=0), on success
* -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE, standard meanings
*/
int fdt_node_depth(const void *fdt, int nodeoffset);
/**
* fdt_parent_offset - find the parent of a given node
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose parent to find
*
* fdt_parent_offset() locates the parent node of a given node (that
* is, it finds the offset of the node which contains the node at
* nodeoffset as a subnode).
*
* NOTE: This function is expensive, as it must scan the device tree
* structure from the start to nodeoffset, *twice*.
*
* returns:
* structure block offset of the parent of the node at nodeoffset
* (>=0), on success
* -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE, standard meanings
*/
int fdt_parent_offset(const void *fdt, int nodeoffset);
/**
* fdt_node_offset_by_prop_value - find nodes with a given property value
* @fdt: pointer to the device tree blob
* @startoffset: only find nodes after this offset
* @propname: property name to check
* @propval: property value to search for
* @proplen: length of the value in propval
*
* fdt_node_offset_by_prop_value() returns the offset of the first
* node after startoffset, which has a property named propname whose
* value is of length proplen and has value equal to propval; or if
* startoffset is -1, the very first such node in the tree.
*
* To iterate through all nodes matching the criterion, the following
* idiom can be used:
* offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
* propval, proplen);
* while (offset != -FDT_ERR_NOTFOUND) {
* // other code here
* offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
* propval, proplen);
* }
*
* Note the -1 in the first call to the function, if 0 is used here
* instead, the function will never locate the root node, even if it
* matches the criterion.
*
* returns:
* structure block offset of the located node (>= 0, >startoffset),
* on success
* -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
* tree after startoffset
* -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE, standard meanings
*/
int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
const char *propname,
const void *propval, int proplen);
/**
* fdt_node_offset_by_phandle - find the node with a given phandle
* @fdt: pointer to the device tree blob
* @phandle: phandle value
*
* fdt_node_offset_by_phandle() returns the offset of the node
* which has the given phandle value. If there is more than one node
* in the tree with the given phandle (an invalid tree), results are
* undefined.
*
* returns:
* structure block offset of the located node (>= 0), on success
* -FDT_ERR_NOTFOUND, no node with that phandle exists
* -FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE, standard meanings
*/
int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
/**
* fdt_node_check_compatible: check a node's compatible property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of a tree node
* @compatible: string to match against
*
*
* fdt_node_check_compatible() returns 0 if the given node contains a
* 'compatible' property with the given string as one of its elements,
* it returns non-zero otherwise, or on error.
*
* returns:
* 0, if the node has a 'compatible' property listing the given string
* 1, if the node has a 'compatible' property, but it does not list
* the given string
* -FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
* -FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE, standard meanings
*/
int fdt_node_check_compatible(const void *fdt, int nodeoffset,
const char *compatible);
/**
* fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
* @fdt: pointer to the device tree blob
* @startoffset: only find nodes after this offset
* @compatible: 'compatible' string to match against
*
* fdt_node_offset_by_compatible() returns the offset of the first
* node after startoffset, which has a 'compatible' property which
* lists the given compatible string; or if startoffset is -1, the
* very first such node in the tree.
*
* To iterate through all nodes matching the criterion, the following
* idiom can be used:
* offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
* while (offset != -FDT_ERR_NOTFOUND) {
* // other code here
* offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
* }
*
* Note the -1 in the first call to the function, if 0 is used here
* instead, the function will never locate the root node, even if it
* matches the criterion.
*
* returns:
* structure block offset of the located node (>= 0, >startoffset),
* on success
* -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
* tree after startoffset
* -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE, standard meanings
*/
int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
const char *compatible);
/**
* fdt_stringlist_contains - check a string list property for a string
* @strlist: Property containing a list of strings to check
* @listlen: Length of property
* @str: String to search for
*
* This is a utility function provided for convenience. The list contains
* one or more strings, each terminated by \0, as is found in a device tree
* "compatible" property.
*
* @return: 1 if the string is found in the list, 0 not found, or invalid list
*/
int fdt_stringlist_contains(const char *strlist, int listlen, const char *str);
/**
* fdt_stringlist_count - count the number of strings in a string list
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of a tree node
* @property: name of the property containing the string list
* @return:
* the number of strings in the given property
* -FDT_ERR_BADVALUE if the property value is not NUL-terminated
* -FDT_ERR_NOTFOUND if the property does not exist
*/
int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property);
/**
* fdt_stringlist_search - find a string in a string list and return its index
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of a tree node
* @property: name of the property containing the string list
* @string: string to look up in the string list
*
* Note that it is possible for this function to succeed on property values
* that are not NUL-terminated. That's because the function will stop after
* finding the first occurrence of @string. This can for example happen with
* small-valued cell properties, such as #address-cells, when searching for
* the empty string.
*
* @return:
* the index of the string in the list of strings
* -FDT_ERR_BADVALUE if the property value is not NUL-terminated
* -FDT_ERR_NOTFOUND if the property does not exist or does not contain
* the given string
*/
int fdt_stringlist_search(const void *fdt, int nodeoffset, const char *property,
const char *string);
/**
* fdt_stringlist_get() - obtain the string at a given index in a string list
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of a tree node
* @property: name of the property containing the string list
* @index: index of the string to return
* @lenp: return location for the string length or an error code on failure
*
* Note that this will successfully extract strings from properties with
* non-NUL-terminated values. For example on small-valued cell properties
* this function will return the empty string.
*
* If non-NULL, the length of the string (on success) or a negative error-code
* (on failure) will be stored in the integer pointer to by lenp.
*
* @return:
* A pointer to the string at the given index in the string list or NULL on
* failure. On success the length of the string will be stored in the memory
* location pointed to by the lenp parameter, if non-NULL. On failure one of
* the following negative error codes will be returned in the lenp parameter
* (if non-NULL):
* -FDT_ERR_BADVALUE if the property value is not NUL-terminated
* -FDT_ERR_NOTFOUND if the property does not exist
*/
const char *fdt_stringlist_get(const void *fdt, int nodeoffset,
const char *property, int index,
int *lenp);
/**********************************************************************/
/* Read-only functions (addressing related) */
/**********************************************************************/
/**
* FDT_MAX_NCELLS - maximum value for #address-cells and #size-cells
*
* This is the maximum value for #address-cells, #size-cells and
* similar properties that will be processed by libfdt. IEE1275
* requires that OF implementations handle values up to 4.
* Implementations may support larger values, but in practice higher
* values aren't used.
*/
#define FDT_MAX_NCELLS 4
/**
* fdt_address_cells - retrieve address size for a bus represented in the tree
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node to find the address size for
*
* When the node has a valid #address-cells property, returns its value.
*
* returns:
* 0 <= n < FDT_MAX_NCELLS, on success
* 2, if the node has no #address-cells property
* -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
* #address-cells property
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_address_cells(const void *fdt, int nodeoffset);
/**
* fdt_size_cells - retrieve address range size for a bus represented in the
* tree
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node to find the address range size for
*
* When the node has a valid #size-cells property, returns its value.
*
* returns:
* 0 <= n < FDT_MAX_NCELLS, on success
* 1, if the node has no #size-cells property
* -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
* #size-cells property
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_size_cells(const void *fdt, int nodeoffset);
/**********************************************************************/
/* Write-in-place functions */
/**********************************************************************/
/**
* fdt_setprop_inplace_namelen_partial - change a property's value,
* but not its size
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @namelen: number of characters of name to consider
* @idx: index of the property to change in the array
* @val: pointer to data to replace the property value with
* @len: length of the property value
*
* Identical to fdt_setprop_inplace(), but modifies the given property
* starting from the given index, and using only the first characters
* of the name. It is useful when you want to manipulate only one value of
* an array and you have a string that doesn't end with \0.
*/
#ifndef SWIG /* Not available in Python */
int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
const char *name, int namelen,
uint32_t idx, const void *val,
int len);
#endif
/**
* fdt_setprop_inplace - change a property's value, but not its size
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @val: pointer to data to replace the property value with
* @len: length of the property value
*
* fdt_setprop_inplace() replaces the value of a given property with
* the data in val, of length len. This function cannot change the
* size of a property, and so will only work if len is equal to the
* current length of the property.
*
* This function will alter only the bytes in the blob which contain
* the given property value, and will not alter or move any other part
* of the tree.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, if len is not equal to the property's current length
* -FDT_ERR_NOTFOUND, node does not have the named property
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
#ifndef SWIG /* Not available in Python */
int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
const void *val, int len);
#endif
/**
* fdt_setprop_inplace_u32 - change the value of a 32-bit integer property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @val: 32-bit integer value to replace the property with
*
* fdt_setprop_inplace_u32() replaces the value of a given property
* with the 32-bit integer value in val, converting val to big-endian
* if necessary. This function cannot change the size of a property,
* and so will only work if the property already exists and has length
* 4.
*
* This function will alter only the bytes in the blob which contain
* the given property value, and will not alter or move any other part
* of the tree.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, if the property's length is not equal to 4
* -FDT_ERR_NOTFOUND, node does not have the named property
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
const char *name, uint32_t val)
{
fdt32_t tmp = cpu_to_fdt32(val);
return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
}
/**
* fdt_setprop_inplace_u64 - change the value of a 64-bit integer property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @val: 64-bit integer value to replace the property with
*
* fdt_setprop_inplace_u64() replaces the value of a given property
* with the 64-bit integer value in val, converting val to big-endian
* if necessary. This function cannot change the size of a property,
* and so will only work if the property already exists and has length
* 8.
*
* This function will alter only the bytes in the blob which contain
* the given property value, and will not alter or move any other part
* of the tree.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, if the property's length is not equal to 8
* -FDT_ERR_NOTFOUND, node does not have the named property
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset,
const char *name, uint64_t val)
{
fdt64_t tmp = cpu_to_fdt64(val);
return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
}
/**
* fdt_setprop_inplace_cell - change the value of a single-cell property
*
* This is an alternative name for fdt_setprop_inplace_u32()
*/
static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
const char *name, uint32_t val)
{
return fdt_setprop_inplace_u32(fdt, nodeoffset, name, val);
}
/**
* fdt_nop_property - replace a property with nop tags
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to nop
* @name: name of the property to nop
*
* fdt_nop_property() will replace a given property's representation
* in the blob with FDT_NOP tags, effectively removing it from the
* tree.
*
* This function will alter only the bytes in the blob which contain
* the property, and will not alter or move any other part of the
* tree.
*
* returns:
* 0, on success
* -FDT_ERR_NOTFOUND, node does not have the named property
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
/**
* fdt_nop_node - replace a node (subtree) with nop tags
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node to nop
*
* fdt_nop_node() will replace a given node's representation in the
* blob, including all its subnodes, if any, with FDT_NOP tags,
* effectively removing it from the tree.
*
* This function will alter only the bytes in the blob which contain
* the node and its properties and subnodes, and will not alter or
* move any other part of the tree.
*
* returns:
* 0, on success
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_nop_node(void *fdt, int nodeoffset);
/**********************************************************************/
/* Sequential write functions */
/**********************************************************************/
/* fdt_create_with_flags flags */
#define FDT_CREATE_FLAG_NO_NAME_DEDUP 0x1
/* FDT_CREATE_FLAG_NO_NAME_DEDUP: Do not try to de-duplicate property
* names in the fdt. This can result in faster creation times, but
* a larger fdt. */
#define FDT_CREATE_FLAGS_ALL (FDT_CREATE_FLAG_NO_NAME_DEDUP)
/**
* fdt_create_with_flags - begin creation of a new fdt
* @fdt: pointer to memory allocated where fdt will be created
* @bufsize: size of the memory space at fdt
* @flags: a valid combination of FDT_CREATE_FLAG_ flags, or 0.
*
* fdt_create_with_flags() begins the process of creating a new fdt with
* the sequential write interface.
*
* fdt creation process must end with fdt_finished() to produce a valid fdt.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
* -FDT_ERR_BADFLAGS, flags is not valid
*/
int fdt_create_with_flags(void *buf, int bufsize, uint32_t flags);
/**
* fdt_create - begin creation of a new fdt
* @fdt: pointer to memory allocated where fdt will be created
* @bufsize: size of the memory space at fdt
*
* fdt_create() is equivalent to fdt_create_with_flags() with flags=0.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
*/
int fdt_create(void *buf, int bufsize);
int fdt_resize(void *fdt, void *buf, int bufsize);
int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
int fdt_finish_reservemap(void *fdt);
int fdt_begin_node(void *fdt, const char *name);
int fdt_property(void *fdt, const char *name, const void *val, int len);
static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val)
{
fdt32_t tmp = cpu_to_fdt32(val);
return fdt_property(fdt, name, &tmp, sizeof(tmp));
}
static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val)
{
fdt64_t tmp = cpu_to_fdt64(val);
return fdt_property(fdt, name, &tmp, sizeof(tmp));
}
#ifndef SWIG /* Not available in Python */
static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
{
return fdt_property_u32(fdt, name, val);
}
#endif
/**
* fdt_property_placeholder - add a new property and return a ptr to its value
*
* @fdt: pointer to the device tree blob
* @name: name of property to add
* @len: length of property value in bytes
* @valp: returns a pointer to where where the value should be placed
*
* returns:
* 0, on success
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_NOSPACE, standard meanings
*/
int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp);
#define fdt_property_string(fdt, name, str) \
fdt_property(fdt, name, str, strlen(str)+1)
int fdt_end_node(void *fdt);
int fdt_finish(void *fdt);
/**********************************************************************/
/* Read-write functions */
/**********************************************************************/
int fdt_create_empty_tree(void *buf, int bufsize);
int fdt_open_into(const void *fdt, void *buf, int bufsize);
int fdt_pack(void *fdt);
/**
* fdt_add_mem_rsv - add one memory reserve map entry
* @fdt: pointer to the device tree blob
* @address, @size: 64-bit values (native endian)
*
* Adds a reserve map entry to the given blob reserving a region at
* address address of length size.
*
* This function will insert data into the reserve map and will
* therefore change the indexes of some entries in the table.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
* contain the new reservation entry
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
/**
* fdt_del_mem_rsv - remove a memory reserve map entry
* @fdt: pointer to the device tree blob
* @n: entry to remove
*
* fdt_del_mem_rsv() removes the n-th memory reserve map entry from
* the blob.
*
* This function will delete data from the reservation table and will
* therefore change the indexes of some entries in the table.
*
* returns:
* 0, on success
* -FDT_ERR_NOTFOUND, there is no entry of the given index (i.e. there
* are less than n+1 reserve map entries)
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_del_mem_rsv(void *fdt, int n);
/**
* fdt_set_name - change the name of a given node
* @fdt: pointer to the device tree blob
* @nodeoffset: structure block offset of a node
* @name: name to give the node
*
* fdt_set_name() replaces the name (including unit address, if any)
* of the given node with the given string. NOTE: this function can't
* efficiently check if the new name is unique amongst the given
* node's siblings; results are undefined if this function is invoked
* with a name equal to one of the given node's siblings.
*
* This function may insert or delete data from the blob, and will
* therefore change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, there is insufficient free space in the blob
* to contain the new name
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE, standard meanings
*/
int fdt_set_name(void *fdt, int nodeoffset, const char *name);
/**
* fdt_setprop - create or change a property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @val: pointer to data to set the property value to
* @len: length of the property value
*
* fdt_setprop() sets the value of the named property in the given
* node to the given value and length, creating the property if it
* does not already exist.
*
* This function may insert or delete data from the blob, and will
* therefore change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
* contain the new property value
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_setprop(void *fdt, int nodeoffset, const char *name,
const void *val, int len);
/**
* fdt_setprop_placeholder - allocate space for a property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @len: length of the property value
* @prop_data: return pointer to property data
*
* fdt_setprop_placeholer() allocates the named property in the given node.
* If the property exists it is resized. In either case a pointer to the
* property data is returned.
*
* This function may insert or delete data from the blob, and will
* therefore change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
* contain the new property value
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,
int len, void **prop_data);
/**
* fdt_setprop_u32 - set a property to a 32-bit integer
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @val: 32-bit integer value for the property (native endian)
*
* fdt_setprop_u32() sets the value of the named property in the given
* node to the given 32-bit integer value (converting to big-endian if
* necessary), or creates a new property with that value if it does
* not already exist.
*
* This function may insert or delete data from the blob, and will
* therefore change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
* contain the new property value
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
uint32_t val)
{
fdt32_t tmp = cpu_to_fdt32(val);
return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
}
/**
* fdt_setprop_u64 - set a property to a 64-bit integer
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @val: 64-bit integer value for the property (native endian)
*
* fdt_setprop_u64() sets the value of the named property in the given
* node to the given 64-bit integer value (converting to big-endian if
* necessary), or creates a new property with that value if it does
* not already exist.
*
* This function may insert or delete data from the blob, and will
* therefore change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
* contain the new property value
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name,
uint64_t val)
{
fdt64_t tmp = cpu_to_fdt64(val);
return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
}
/**
* fdt_setprop_cell - set a property to a single cell value
*
* This is an alternative name for fdt_setprop_u32()
*/
static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
uint32_t val)
{
return fdt_setprop_u32(fdt, nodeoffset, name, val);
}
/**
* fdt_setprop_string - set a property to a string value
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @str: string value for the property
*
* fdt_setprop_string() sets the value of the named property in the
* given node to the given string value (using the length of the
* string to determine the new length of the property), or creates a
* new property with that value if it does not already exist.
*
* This function may insert or delete data from the blob, and will
* therefore change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
* contain the new property value
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
#define fdt_setprop_string(fdt, nodeoffset, name, str) \
fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
/**
* fdt_setprop_empty - set a property to an empty value
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
*
* fdt_setprop_empty() sets the value of the named property in the
* given node to an empty (zero length) value, or creates a new empty
* property if it does not already exist.
*
* This function may insert or delete data from the blob, and will
* therefore change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
* contain the new property value
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
#define fdt_setprop_empty(fdt, nodeoffset, name) \
fdt_setprop((fdt), (nodeoffset), (name), NULL, 0)
/**
* fdt_appendprop - append to or create a property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to append to
* @val: pointer to data to append to the property value
* @len: length of the data to append to the property value
*
* fdt_appendprop() appends the value to the named property in the
* given node, creating the property if it does not already exist.
*
* This function may insert data into the blob, and will therefore
* change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
* contain the new property value
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
const void *val, int len);
/**
* fdt_appendprop_u32 - append a 32-bit integer value to a property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @val: 32-bit integer value to append to the property (native endian)
*
* fdt_appendprop_u32() appends the given 32-bit integer value
* (converting to big-endian if necessary) to the value of the named
* property in the given node, or creates a new property with that
* value if it does not already exist.
*
* This function may insert data into the blob, and will therefore
* change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
* contain the new property value
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
const char *name, uint32_t val)
{
fdt32_t tmp = cpu_to_fdt32(val);
return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
}
/**
* fdt_appendprop_u64 - append a 64-bit integer value to a property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @val: 64-bit integer value to append to the property (native endian)
*
* fdt_appendprop_u64() appends the given 64-bit integer value
* (converting to big-endian if necessary) to the value of the named
* property in the given node, or creates a new property with that
* value if it does not already exist.
*
* This function may insert data into the blob, and will therefore
* change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
* contain the new property value
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
static inline int fdt_appendprop_u64(void *fdt, int nodeoffset,
const char *name, uint64_t val)
{
fdt64_t tmp = cpu_to_fdt64(val);
return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
}
/**
* fdt_appendprop_cell - append a single cell value to a property
*
* This is an alternative name for fdt_appendprop_u32()
*/
static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
const char *name, uint32_t val)
{
return fdt_appendprop_u32(fdt, nodeoffset, name, val);
}
/**
* fdt_appendprop_string - append a string to a property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @str: string value to append to the property
*
* fdt_appendprop_string() appends the given string to the value of
* the named property in the given node, or creates a new property
* with that value if it does not already exist.
*
* This function may insert data into the blob, and will therefore
* change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
* contain the new property value
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
#define fdt_appendprop_string(fdt, nodeoffset, name, str) \
fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
/**
* fdt_appendprop_addrrange - append a address range property
* @fdt: pointer to the device tree blob
* @parent: offset of the parent node
* @nodeoffset: offset of the node to add a property at
* @name: name of property
* @addr: start address of a given range
* @size: size of a given range
*
* fdt_appendprop_addrrange() appends an address range value (start
* address and size) to the value of the named property in the given
* node, or creates a new property with that value if it does not
* already exist.
* If "name" is not specified, a default "reg" is used.
* Cell sizes are determined by parent's #address-cells and #size-cells.
*
* This function may insert data into the blob, and will therefore
* change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
* #address-cells property
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADVALUE, addr or size doesn't fit to respective cells size
* -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
* contain a new property
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_appendprop_addrrange(void *fdt, int parent, int nodeoffset,
const char *name, uint64_t addr, uint64_t size);
/**
* fdt_delprop - delete a property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to nop
* @name: name of the property to nop
*
* fdt_del_property() will delete the given property.
*
* This function will delete data from the blob, and will therefore
* change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_NOTFOUND, node does not have the named property
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_delprop(void *fdt, int nodeoffset, const char *name);
/**
* fdt_add_subnode_namelen - creates a new node based on substring
* @fdt: pointer to the device tree blob
* @parentoffset: structure block offset of a node
* @name: name of the subnode to locate
* @namelen: number of characters of name to consider
*
* Identical to fdt_add_subnode(), but use only the first namelen
* characters of name as the name of the new node. This is useful for
* creating subnodes based on a portion of a larger string, such as a
* full path.
*/
#ifndef SWIG /* Not available in Python */
int fdt_add_subnode_namelen(void *fdt, int parentoffset,
const char *name, int namelen);
#endif
/**
* fdt_add_subnode - creates a new node
* @fdt: pointer to the device tree blob
* @parentoffset: structure block offset of a node
* @name: name of the subnode to locate
*
* fdt_add_subnode() creates a new node as a subnode of the node at
* structure block offset parentoffset, with the given name (which
* should include the unit address, if any).
*
* This function will insert data into the blob, and will therefore
* change the offsets of some existing nodes.
* returns:
* structure block offset of the created nodeequested subnode (>=0), on
* success
* -FDT_ERR_NOTFOUND, if the requested subnode does not exist
* -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE
* tag
* -FDT_ERR_EXISTS, if the node at parentoffset already has a subnode of
* the given name
* -FDT_ERR_NOSPACE, if there is insufficient free space in the
* blob to contain the new node
* -FDT_ERR_NOSPACE
* -FDT_ERR_BADLAYOUT
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings.
*/
int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
/**
* fdt_del_node - delete a node (subtree)
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node to nop
*
* fdt_del_node() will remove the given node, including all its
* subnodes if any, from the blob.
*
* This function will delete data from the blob, and will therefore
* change the offsets of some existing nodes.
*
* returns:
* 0, on success
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_del_node(void *fdt, int nodeoffset);
/**
* fdt_overlay_apply - Applies a DT overlay on a base DT
* @fdt: pointer to the base device tree blob
* @fdto: pointer to the device tree overlay blob
*
* fdt_overlay_apply() will apply the given device tree overlay on the
* given base device tree.
*
* Expect the base device tree to be modified, even if the function
* returns an error.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, there's not enough space in the base device tree
* -FDT_ERR_NOTFOUND, the overlay points to some inexistant nodes or
* properties in the base DT
* -FDT_ERR_BADPHANDLE,
* -FDT_ERR_BADOVERLAY,
* -FDT_ERR_NOPHANDLES,
* -FDT_ERR_INTERNAL,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADOFFSET,
* -FDT_ERR_BADPATH,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_overlay_apply(void *fdt, void *fdto);
/**********************************************************************/
/* Debugging / informational functions */
/**********************************************************************/
const char *fdt_strerror(int errval);
#ifdef __cplusplus
}
#endif
#endif /* LIBFDT_H */
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Basic User Interface Test: caret-color</title>
<link rel="author" title="Chris Lilley" href="mailto:chris@w3.org">
<link rel="author" title="Florian Rivoal" href="mailto:florian@rivoal.net">
<link rel="help" href="http://www.w3.org/TR/css3-ui/#caret-color">
<meta name="flags" content="interact">
<meta name="assert" content="Test checks that caret-color can be set on a textarea">
<style>
textarea {
font-size: 3em;
font-weight: bold;
width: 10em;
padding: 10px;
background: black; color: white; /* the color of a thin object like the caret is easier to see on a black background. */
caret-color: lime;
}
</style>
<body>
<p>Test passes if, when the text area below is focused for editing, the text insertion caret is green.</p>
<p>The shape of the caret, and whether it flashes, are not part of the test.</p>
<textarea id="test"></textarea>
<script>
window.onload = function() {
document.getElementById("test").focus();
}
</script>
</body>
|
{
"pile_set_name": "Github"
}
|
/* This is a compiled file, you should be editing the file in the templates directory */
.pace {
-webkit-pointer-events: none;
pointer-events: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.pace-inactive {
display: none;
}
.pace .pace-progress {
background: #e90f92;
position: fixed;
z-index: 2000;
top: 0;
right: 100%;
width: 100%;
height: 2px;
}
.pace .pace-progress-inner {
display: block;
position: absolute;
right: 0px;
width: 100px;
height: 100%;
box-shadow: 0 0 10px #e90f92, 0 0 5px #e90f92;
opacity: 1.0;
-webkit-transform: rotate(3deg) translate(0px, -4px);
-moz-transform: rotate(3deg) translate(0px, -4px);
-ms-transform: rotate(3deg) translate(0px, -4px);
-o-transform: rotate(3deg) translate(0px, -4px);
transform: rotate(3deg) translate(0px, -4px);
}
.pace .pace-activity {
display: block;
position: fixed;
z-index: 2000;
top: 15px;
right: 15px;
width: 14px;
height: 14px;
border: solid 2px transparent;
border-top-color: #e90f92;
border-left-color: #e90f92;
border-radius: 10px;
-webkit-animation: pace-spinner 400ms linear infinite;
-moz-animation: pace-spinner 400ms linear infinite;
-ms-animation: pace-spinner 400ms linear infinite;
-o-animation: pace-spinner 400ms linear infinite;
animation: pace-spinner 400ms linear infinite;
}
@-webkit-keyframes pace-spinner {
0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
@-moz-keyframes pace-spinner {
0% { -moz-transform: rotate(0deg); transform: rotate(0deg); }
100% { -moz-transform: rotate(360deg); transform: rotate(360deg); }
}
@-o-keyframes pace-spinner {
0% { -o-transform: rotate(0deg); transform: rotate(0deg); }
100% { -o-transform: rotate(360deg); transform: rotate(360deg); }
}
@-ms-keyframes pace-spinner {
0% { -ms-transform: rotate(0deg); transform: rotate(0deg); }
100% { -ms-transform: rotate(360deg); transform: rotate(360deg); }
}
@keyframes pace-spinner {
0% { transform: rotate(0deg); transform: rotate(0deg); }
100% { transform: rotate(360deg); transform: rotate(360deg); }
}
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: d6aa45e0a09d6f447b359d0dd6c8bd87
timeCreated: 1505986991
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 4096
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Standalone
maxTextureSize: 4096
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2010-2017 The OTS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef OTS_CFF_TYPE2_CHARSTRING_H_
#define OTS_CFF_TYPE2_CHARSTRING_H_
#include "cff.h"
#include "ots.h"
#include <map>
#include <vector>
namespace ots {
// Validates all charstrings in |char_strings_index|. Charstring is a small
// language for font hinting defined in Adobe Technical Note #5177.
// http://www.adobe.com/devnet/font/pdfs/5177.Type2.pdf
//
// The validation will fail if one of the following conditions is met:
// 1. The code uses more than 48 values of argument stack.
// 2. The code uses deeply nested subroutine calls (more than 10 levels.)
// 3. The code passes invalid number of operands to an operator.
// 4. The code calls an undefined global or local subroutine.
// 5. The code uses one of the following operators that are unlikely used in
// an ordinary fonts, and could be dangerous: random, put, get, index, roll.
//
// Arguments:
// global_subrs_index: Global subroutines which could be called by a charstring
// in |char_strings_index|.
// fd_select: A map from glyph # to font #.
// local_subrs_per_font: A list of Local Subrs associated with FDArrays. Can be
// empty.
// local_subrs: A Local Subrs associated with Top DICT. Can be NULL.
// cff_table: A buffer which contains actual byte code of charstring, global
// subroutines and local subroutines.
bool ValidateType2CharStringIndex(
Font *font,
const CFFIndex &char_strings_index,
const CFFIndex &global_subrs_index,
const std::map<uint16_t, uint8_t> &fd_select,
const std::vector<CFFIndex *> &local_subrs_per_font,
const CFFIndex *local_subrs,
Buffer *cff_table);
// The list of Operators. See Appendix. A in Adobe Technical Note #5177.
enum Type2CharStringOperator {
kHStem = 1,
kVStem = 3,
kVMoveTo = 4,
kRLineTo = 5,
kHLineTo = 6,
kVLineTo = 7,
kRRCurveTo = 8,
kCallSubr = 10,
kReturn = 11,
kEndChar = 14,
kHStemHm = 18,
kHintMask = 19,
kCntrMask = 20,
kRMoveTo = 21,
kHMoveTo = 22,
kVStemHm = 23,
kRCurveLine = 24,
kRLineCurve = 25,
kVVCurveTo = 26,
kHHCurveTo = 27,
kCallGSubr = 29,
kVHCurveTo = 30,
kHVCurveTo = 31,
kDotSection = 12 << 8,
kAnd = (12 << 8) + 3,
kOr = (12 << 8) + 4,
kNot = (12 << 8) + 5,
kAbs = (12 << 8) + 9,
kAdd = (12 << 8) + 10,
kSub = (12 << 8) + 11,
kDiv = (12 << 8) + 12,
kNeg = (12 << 8) + 14,
kEq = (12 << 8) + 15,
kDrop = (12 << 8) + 18,
kPut = (12 << 8) + 20,
kGet = (12 << 8) + 21,
kIfElse = (12 << 8) + 22,
kRandom = (12 << 8) + 23,
kMul = (12 << 8) + 24,
kSqrt = (12 << 8) + 26,
kDup = (12 << 8) + 27,
kExch = (12 << 8) + 28,
kIndex = (12 << 8) + 29,
kRoll = (12 << 8) + 30,
kHFlex = (12 << 8) + 34,
kFlex = (12 << 8) + 35,
kHFlex1 = (12 << 8) + 36,
kFlex1 = (12 << 8) + 37,
// Operators that are undocumented, such as 'blend', will be rejected.
};
} // namespace ots
#endif // OTS_CFF_TYPE2_CHARSTRING_H_
|
{
"pile_set_name": "Github"
}
|
#ifdef HAVE_ARCH_X86_64_SUPPORT
#define MEMCPY_FN(fn, name, desc) \
extern void *fn(void *, const void *, size_t);
#include "mem-memcpy-x86-64-asm-def.h"
#undef MEMCPY_FN
#endif
|
{
"pile_set_name": "Github"
}
|
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2009 Thomas Capricelli <orzel@freehackers.org>
//
// This code initially comes from MINPACK whose original authors are:
// Copyright Jorge More - Argonne National Laboratory
// Copyright Burt Garbow - Argonne National Laboratory
// Copyright Ken Hillstrom - Argonne National Laboratory
//
// This Source Code Form is subject to the terms of the Minpack license
// (a BSD-like license) described in the campaigned CopyrightMINPACK.txt file.
#ifndef EIGEN_LMONESTEP_H
#define EIGEN_LMONESTEP_H
namespace Eigen {
template<typename FunctorType>
LevenbergMarquardtSpace::Status
LevenbergMarquardt<FunctorType>::minimizeOneStep(FVectorType &x)
{
using std::abs;
using std::sqrt;
RealScalar temp, temp1,temp2;
RealScalar ratio;
RealScalar pnorm, xnorm, fnorm1, actred, dirder, prered;
eigen_assert(x.size()==n); // check the caller is not cheating us
temp = 0.0; xnorm = 0.0;
/* calculate the jacobian matrix. */
Index df_ret = m_functor.df(x, m_fjac);
if (df_ret<0)
return LevenbergMarquardtSpace::UserAsked;
if (df_ret>0)
// numerical diff, we evaluated the function df_ret times
m_nfev += df_ret;
else m_njev++;
/* compute the qr factorization of the jacobian. */
for (int j = 0; j < x.size(); ++j)
m_wa2(j) = m_fjac.col(j).blueNorm();
QRSolver qrfac(m_fjac);
if(qrfac.info() != Success) {
m_info = NumericalIssue;
return LevenbergMarquardtSpace::ImproperInputParameters;
}
// Make a copy of the first factor with the associated permutation
m_rfactor = qrfac.matrixR();
m_permutation = (qrfac.colsPermutation());
/* on the first iteration and if external scaling is not used, scale according */
/* to the norms of the columns of the initial jacobian. */
if (m_iter == 1) {
if (!m_useExternalScaling)
for (Index j = 0; j < n; ++j)
m_diag[j] = (m_wa2[j]==0.)? 1. : m_wa2[j];
/* on the first iteration, calculate the norm of the scaled x */
/* and initialize the step bound m_delta. */
xnorm = m_diag.cwiseProduct(x).stableNorm();
m_delta = m_factor * xnorm;
if (m_delta == 0.)
m_delta = m_factor;
}
/* form (q transpose)*m_fvec and store the first n components in */
/* m_qtf. */
m_wa4 = m_fvec;
m_wa4 = qrfac.matrixQ().adjoint() * m_fvec;
m_qtf = m_wa4.head(n);
/* compute the norm of the scaled gradient. */
m_gnorm = 0.;
if (m_fnorm != 0.)
for (Index j = 0; j < n; ++j)
if (m_wa2[m_permutation.indices()[j]] != 0.)
m_gnorm = (std::max)(m_gnorm, abs( m_rfactor.col(j).head(j+1).dot(m_qtf.head(j+1)/m_fnorm) / m_wa2[m_permutation.indices()[j]]));
/* test for convergence of the gradient norm. */
if (m_gnorm <= m_gtol) {
m_info = Success;
return LevenbergMarquardtSpace::CosinusTooSmall;
}
/* rescale if necessary. */
if (!m_useExternalScaling)
m_diag = m_diag.cwiseMax(m_wa2);
do {
/* determine the levenberg-marquardt parameter. */
internal::lmpar2(qrfac, m_diag, m_qtf, m_delta, m_par, m_wa1);
/* store the direction p and x + p. calculate the norm of p. */
m_wa1 = -m_wa1;
m_wa2 = x + m_wa1;
pnorm = m_diag.cwiseProduct(m_wa1).stableNorm();
/* on the first iteration, adjust the initial step bound. */
if (m_iter == 1)
m_delta = (std::min)(m_delta,pnorm);
/* evaluate the function at x + p and calculate its norm. */
if ( m_functor(m_wa2, m_wa4) < 0)
return LevenbergMarquardtSpace::UserAsked;
++m_nfev;
fnorm1 = m_wa4.stableNorm();
/* compute the scaled actual reduction. */
actred = -1.;
if (Scalar(.1) * fnorm1 < m_fnorm)
actred = 1. - numext::abs2(fnorm1 / m_fnorm);
/* compute the scaled predicted reduction and */
/* the scaled directional derivative. */
m_wa3 = m_rfactor.template triangularView<Upper>() * (m_permutation.inverse() *m_wa1);
temp1 = numext::abs2(m_wa3.stableNorm() / m_fnorm);
temp2 = numext::abs2(sqrt(m_par) * pnorm / m_fnorm);
prered = temp1 + temp2 / Scalar(.5);
dirder = -(temp1 + temp2);
/* compute the ratio of the actual to the predicted */
/* reduction. */
ratio = 0.;
if (prered != 0.)
ratio = actred / prered;
/* update the step bound. */
if (ratio <= Scalar(.25)) {
if (actred >= 0.)
temp = RealScalar(.5);
if (actred < 0.)
temp = RealScalar(.5) * dirder / (dirder + RealScalar(.5) * actred);
if (RealScalar(.1) * fnorm1 >= m_fnorm || temp < RealScalar(.1))
temp = Scalar(.1);
/* Computing MIN */
m_delta = temp * (std::min)(m_delta, pnorm / RealScalar(.1));
m_par /= temp;
} else if (!(m_par != 0. && ratio < RealScalar(.75))) {
m_delta = pnorm / RealScalar(.5);
m_par = RealScalar(.5) * m_par;
}
/* test for successful iteration. */
if (ratio >= RealScalar(1e-4)) {
/* successful iteration. update x, m_fvec, and their norms. */
x = m_wa2;
m_wa2 = m_diag.cwiseProduct(x);
m_fvec = m_wa4;
xnorm = m_wa2.stableNorm();
m_fnorm = fnorm1;
++m_iter;
}
/* tests for convergence. */
if (abs(actred) <= m_ftol && prered <= m_ftol && Scalar(.5) * ratio <= 1. && m_delta <= m_xtol * xnorm)
{
m_info = Success;
return LevenbergMarquardtSpace::RelativeErrorAndReductionTooSmall;
}
if (abs(actred) <= m_ftol && prered <= m_ftol && Scalar(.5) * ratio <= 1.)
{
m_info = Success;
return LevenbergMarquardtSpace::RelativeReductionTooSmall;
}
if (m_delta <= m_xtol * xnorm)
{
m_info = Success;
return LevenbergMarquardtSpace::RelativeErrorTooSmall;
}
/* tests for termination and stringent tolerances. */
if (m_nfev >= m_maxfev)
{
m_info = NoConvergence;
return LevenbergMarquardtSpace::TooManyFunctionEvaluation;
}
if (abs(actred) <= NumTraits<Scalar>::epsilon() && prered <= NumTraits<Scalar>::epsilon() && Scalar(.5) * ratio <= 1.)
{
m_info = Success;
return LevenbergMarquardtSpace::FtolTooSmall;
}
if (m_delta <= NumTraits<Scalar>::epsilon() * xnorm)
{
m_info = Success;
return LevenbergMarquardtSpace::XtolTooSmall;
}
if (m_gnorm <= NumTraits<Scalar>::epsilon())
{
m_info = Success;
return LevenbergMarquardtSpace::GtolTooSmall;
}
} while (ratio < Scalar(1e-4));
return LevenbergMarquardtSpace::Running;
}
} // end namespace Eigen
#endif // EIGEN_LMONESTEP_H
|
{
"pile_set_name": "Github"
}
|
// Copyright 2014 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.
package http2
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"io"
"log"
"strings"
"sync"
"golang.org/x/net/http/httpguts"
"golang.org/x/net/http2/hpack"
)
const frameHeaderLen = 9
var padZeros = make([]byte, 255) // zeros for padding
// A FrameType is a registered frame type as defined in
// http://http2.github.io/http2-spec/#rfc.section.11.2
type FrameType uint8
const (
FrameData FrameType = 0x0
FrameHeaders FrameType = 0x1
FramePriority FrameType = 0x2
FrameRSTStream FrameType = 0x3
FrameSettings FrameType = 0x4
FramePushPromise FrameType = 0x5
FramePing FrameType = 0x6
FrameGoAway FrameType = 0x7
FrameWindowUpdate FrameType = 0x8
FrameContinuation FrameType = 0x9
)
var frameName = map[FrameType]string{
FrameData: "DATA",
FrameHeaders: "HEADERS",
FramePriority: "PRIORITY",
FrameRSTStream: "RST_STREAM",
FrameSettings: "SETTINGS",
FramePushPromise: "PUSH_PROMISE",
FramePing: "PING",
FrameGoAway: "GOAWAY",
FrameWindowUpdate: "WINDOW_UPDATE",
FrameContinuation: "CONTINUATION",
}
func (t FrameType) String() string {
if s, ok := frameName[t]; ok {
return s
}
return fmt.Sprintf("UNKNOWN_FRAME_TYPE_%d", uint8(t))
}
// Flags is a bitmask of HTTP/2 flags.
// The meaning of flags varies depending on the frame type.
type Flags uint8
// Has reports whether f contains all (0 or more) flags in v.
func (f Flags) Has(v Flags) bool {
return (f & v) == v
}
// Frame-specific FrameHeader flag bits.
const (
// Data Frame
FlagDataEndStream Flags = 0x1
FlagDataPadded Flags = 0x8
// Headers Frame
FlagHeadersEndStream Flags = 0x1
FlagHeadersEndHeaders Flags = 0x4
FlagHeadersPadded Flags = 0x8
FlagHeadersPriority Flags = 0x20
// Settings Frame
FlagSettingsAck Flags = 0x1
// Ping Frame
FlagPingAck Flags = 0x1
// Continuation Frame
FlagContinuationEndHeaders Flags = 0x4
FlagPushPromiseEndHeaders Flags = 0x4
FlagPushPromisePadded Flags = 0x8
)
var flagName = map[FrameType]map[Flags]string{
FrameData: {
FlagDataEndStream: "END_STREAM",
FlagDataPadded: "PADDED",
},
FrameHeaders: {
FlagHeadersEndStream: "END_STREAM",
FlagHeadersEndHeaders: "END_HEADERS",
FlagHeadersPadded: "PADDED",
FlagHeadersPriority: "PRIORITY",
},
FrameSettings: {
FlagSettingsAck: "ACK",
},
FramePing: {
FlagPingAck: "ACK",
},
FrameContinuation: {
FlagContinuationEndHeaders: "END_HEADERS",
},
FramePushPromise: {
FlagPushPromiseEndHeaders: "END_HEADERS",
FlagPushPromisePadded: "PADDED",
},
}
// a frameParser parses a frame given its FrameHeader and payload
// bytes. The length of payload will always equal fh.Length (which
// might be 0).
type frameParser func(fc *frameCache, fh FrameHeader, payload []byte) (Frame, error)
var frameParsers = map[FrameType]frameParser{
FrameData: parseDataFrame,
FrameHeaders: parseHeadersFrame,
FramePriority: parsePriorityFrame,
FrameRSTStream: parseRSTStreamFrame,
FrameSettings: parseSettingsFrame,
FramePushPromise: parsePushPromise,
FramePing: parsePingFrame,
FrameGoAway: parseGoAwayFrame,
FrameWindowUpdate: parseWindowUpdateFrame,
FrameContinuation: parseContinuationFrame,
}
func typeFrameParser(t FrameType) frameParser {
if f := frameParsers[t]; f != nil {
return f
}
return parseUnknownFrame
}
// A FrameHeader is the 9 byte header of all HTTP/2 frames.
//
// See http://http2.github.io/http2-spec/#FrameHeader
type FrameHeader struct {
valid bool // caller can access []byte fields in the Frame
// Type is the 1 byte frame type. There are ten standard frame
// types, but extension frame types may be written by WriteRawFrame
// and will be returned by ReadFrame (as UnknownFrame).
Type FrameType
// Flags are the 1 byte of 8 potential bit flags per frame.
// They are specific to the frame type.
Flags Flags
// Length is the length of the frame, not including the 9 byte header.
// The maximum size is one byte less than 16MB (uint24), but only
// frames up to 16KB are allowed without peer agreement.
Length uint32
// StreamID is which stream this frame is for. Certain frames
// are not stream-specific, in which case this field is 0.
StreamID uint32
}
// Header returns h. It exists so FrameHeaders can be embedded in other
// specific frame types and implement the Frame interface.
func (h FrameHeader) Header() FrameHeader { return h }
func (h FrameHeader) String() string {
var buf bytes.Buffer
buf.WriteString("[FrameHeader ")
h.writeDebug(&buf)
buf.WriteByte(']')
return buf.String()
}
func (h FrameHeader) writeDebug(buf *bytes.Buffer) {
buf.WriteString(h.Type.String())
if h.Flags != 0 {
buf.WriteString(" flags=")
set := 0
for i := uint8(0); i < 8; i++ {
if h.Flags&(1<<i) == 0 {
continue
}
set++
if set > 1 {
buf.WriteByte('|')
}
name := flagName[h.Type][Flags(1<<i)]
if name != "" {
buf.WriteString(name)
} else {
fmt.Fprintf(buf, "0x%x", 1<<i)
}
}
}
if h.StreamID != 0 {
fmt.Fprintf(buf, " stream=%d", h.StreamID)
}
fmt.Fprintf(buf, " len=%d", h.Length)
}
func (h *FrameHeader) checkValid() {
if !h.valid {
panic("Frame accessor called on non-owned Frame")
}
}
func (h *FrameHeader) invalidate() { h.valid = false }
// frame header bytes.
// Used only by ReadFrameHeader.
var fhBytes = sync.Pool{
New: func() interface{} {
buf := make([]byte, frameHeaderLen)
return &buf
},
}
// ReadFrameHeader reads 9 bytes from r and returns a FrameHeader.
// Most users should use Framer.ReadFrame instead.
func ReadFrameHeader(r io.Reader) (FrameHeader, error) {
bufp := fhBytes.Get().(*[]byte)
defer fhBytes.Put(bufp)
return readFrameHeader(*bufp, r)
}
func readFrameHeader(buf []byte, r io.Reader) (FrameHeader, error) {
_, err := io.ReadFull(r, buf[:frameHeaderLen])
if err != nil {
return FrameHeader{}, err
}
return FrameHeader{
Length: (uint32(buf[0])<<16 | uint32(buf[1])<<8 | uint32(buf[2])),
Type: FrameType(buf[3]),
Flags: Flags(buf[4]),
StreamID: binary.BigEndian.Uint32(buf[5:]) & (1<<31 - 1),
valid: true,
}, nil
}
// A Frame is the base interface implemented by all frame types.
// Callers will generally type-assert the specific frame type:
// *HeadersFrame, *SettingsFrame, *WindowUpdateFrame, etc.
//
// Frames are only valid until the next call to Framer.ReadFrame.
type Frame interface {
Header() FrameHeader
// invalidate is called by Framer.ReadFrame to make this
// frame's buffers as being invalid, since the subsequent
// frame will reuse them.
invalidate()
}
// A Framer reads and writes Frames.
type Framer struct {
r io.Reader
lastFrame Frame
errDetail error
// lastHeaderStream is non-zero if the last frame was an
// unfinished HEADERS/CONTINUATION.
lastHeaderStream uint32
maxReadSize uint32
headerBuf [frameHeaderLen]byte
// TODO: let getReadBuf be configurable, and use a less memory-pinning
// allocator in server.go to minimize memory pinned for many idle conns.
// Will probably also need to make frame invalidation have a hook too.
getReadBuf func(size uint32) []byte
readBuf []byte // cache for default getReadBuf
maxWriteSize uint32 // zero means unlimited; TODO: implement
w io.Writer
wbuf []byte
// AllowIllegalWrites permits the Framer's Write methods to
// write frames that do not conform to the HTTP/2 spec. This
// permits using the Framer to test other HTTP/2
// implementations' conformance to the spec.
// If false, the Write methods will prefer to return an error
// rather than comply.
AllowIllegalWrites bool
// AllowIllegalReads permits the Framer's ReadFrame method
// to return non-compliant frames or frame orders.
// This is for testing and permits using the Framer to test
// other HTTP/2 implementations' conformance to the spec.
// It is not compatible with ReadMetaHeaders.
AllowIllegalReads bool
// ReadMetaHeaders if non-nil causes ReadFrame to merge
// HEADERS and CONTINUATION frames together and return
// MetaHeadersFrame instead.
ReadMetaHeaders *hpack.Decoder
// MaxHeaderListSize is the http2 MAX_HEADER_LIST_SIZE.
// It's used only if ReadMetaHeaders is set; 0 means a sane default
// (currently 16MB)
// If the limit is hit, MetaHeadersFrame.Truncated is set true.
MaxHeaderListSize uint32
// TODO: track which type of frame & with which flags was sent
// last. Then return an error (unless AllowIllegalWrites) if
// we're in the middle of a header block and a
// non-Continuation or Continuation on a different stream is
// attempted to be written.
logReads, logWrites bool
debugFramer *Framer // only use for logging written writes
debugFramerBuf *bytes.Buffer
debugReadLoggerf func(string, ...interface{})
debugWriteLoggerf func(string, ...interface{})
frameCache *frameCache // nil if frames aren't reused (default)
}
func (fr *Framer) maxHeaderListSize() uint32 {
if fr.MaxHeaderListSize == 0 {
return 16 << 20 // sane default, per docs
}
return fr.MaxHeaderListSize
}
func (f *Framer) startWrite(ftype FrameType, flags Flags, streamID uint32) {
// Write the FrameHeader.
f.wbuf = append(f.wbuf[:0],
0, // 3 bytes of length, filled in in endWrite
0,
0,
byte(ftype),
byte(flags),
byte(streamID>>24),
byte(streamID>>16),
byte(streamID>>8),
byte(streamID))
}
func (f *Framer) endWrite() error {
// Now that we know the final size, fill in the FrameHeader in
// the space previously reserved for it. Abuse append.
length := len(f.wbuf) - frameHeaderLen
if length >= (1 << 24) {
return ErrFrameTooLarge
}
_ = append(f.wbuf[:0],
byte(length>>16),
byte(length>>8),
byte(length))
if f.logWrites {
f.logWrite()
}
n, err := f.w.Write(f.wbuf)
if err == nil && n != len(f.wbuf) {
err = io.ErrShortWrite
}
return err
}
func (f *Framer) logWrite() {
if f.debugFramer == nil {
f.debugFramerBuf = new(bytes.Buffer)
f.debugFramer = NewFramer(nil, f.debugFramerBuf)
f.debugFramer.logReads = false // we log it ourselves, saying "wrote" below
// Let us read anything, even if we accidentally wrote it
// in the wrong order:
f.debugFramer.AllowIllegalReads = true
}
f.debugFramerBuf.Write(f.wbuf)
fr, err := f.debugFramer.ReadFrame()
if err != nil {
f.debugWriteLoggerf("http2: Framer %p: failed to decode just-written frame", f)
return
}
f.debugWriteLoggerf("http2: Framer %p: wrote %v", f, summarizeFrame(fr))
}
func (f *Framer) writeByte(v byte) { f.wbuf = append(f.wbuf, v) }
func (f *Framer) writeBytes(v []byte) { f.wbuf = append(f.wbuf, v...) }
func (f *Framer) writeUint16(v uint16) { f.wbuf = append(f.wbuf, byte(v>>8), byte(v)) }
func (f *Framer) writeUint32(v uint32) {
f.wbuf = append(f.wbuf, byte(v>>24), byte(v>>16), byte(v>>8), byte(v))
}
const (
minMaxFrameSize = 1 << 14
maxFrameSize = 1<<24 - 1
)
// SetReuseFrames allows the Framer to reuse Frames.
// If called on a Framer, Frames returned by calls to ReadFrame are only
// valid until the next call to ReadFrame.
func (fr *Framer) SetReuseFrames() {
if fr.frameCache != nil {
return
}
fr.frameCache = &frameCache{}
}
type frameCache struct {
dataFrame DataFrame
}
func (fc *frameCache) getDataFrame() *DataFrame {
if fc == nil {
return &DataFrame{}
}
return &fc.dataFrame
}
// NewFramer returns a Framer that writes frames to w and reads them from r.
func NewFramer(w io.Writer, r io.Reader) *Framer {
fr := &Framer{
w: w,
r: r,
logReads: logFrameReads,
logWrites: logFrameWrites,
debugReadLoggerf: log.Printf,
debugWriteLoggerf: log.Printf,
}
fr.getReadBuf = func(size uint32) []byte {
if cap(fr.readBuf) >= int(size) {
return fr.readBuf[:size]
}
fr.readBuf = make([]byte, size)
return fr.readBuf
}
fr.SetMaxReadFrameSize(maxFrameSize)
return fr
}
// SetMaxReadFrameSize sets the maximum size of a frame
// that will be read by a subsequent call to ReadFrame.
// It is the caller's responsibility to advertise this
// limit with a SETTINGS frame.
func (fr *Framer) SetMaxReadFrameSize(v uint32) {
if v > maxFrameSize {
v = maxFrameSize
}
fr.maxReadSize = v
}
// ErrorDetail returns a more detailed error of the last error
// returned by Framer.ReadFrame. For instance, if ReadFrame
// returns a StreamError with code PROTOCOL_ERROR, ErrorDetail
// will say exactly what was invalid. ErrorDetail is not guaranteed
// to return a non-nil value and like the rest of the http2 package,
// its return value is not protected by an API compatibility promise.
// ErrorDetail is reset after the next call to ReadFrame.
func (fr *Framer) ErrorDetail() error {
return fr.errDetail
}
// ErrFrameTooLarge is returned from Framer.ReadFrame when the peer
// sends a frame that is larger than declared with SetMaxReadFrameSize.
var ErrFrameTooLarge = errors.New("http2: frame too large")
// terminalReadFrameError reports whether err is an unrecoverable
// error from ReadFrame and no other frames should be read.
func terminalReadFrameError(err error) bool {
if _, ok := err.(StreamError); ok {
return false
}
return err != nil
}
// ReadFrame reads a single frame. The returned Frame is only valid
// until the next call to ReadFrame.
//
// If the frame is larger than previously set with SetMaxReadFrameSize, the
// returned error is ErrFrameTooLarge. Other errors may be of type
// ConnectionError, StreamError, or anything else from the underlying
// reader.
func (fr *Framer) ReadFrame() (Frame, error) {
fr.errDetail = nil
if fr.lastFrame != nil {
fr.lastFrame.invalidate()
}
fh, err := readFrameHeader(fr.headerBuf[:], fr.r)
if err != nil {
return nil, err
}
if fh.Length > fr.maxReadSize {
return nil, ErrFrameTooLarge
}
payload := fr.getReadBuf(fh.Length)
if _, err := io.ReadFull(fr.r, payload); err != nil {
return nil, err
}
f, err := typeFrameParser(fh.Type)(fr.frameCache, fh, payload)
if err != nil {
if ce, ok := err.(connError); ok {
return nil, fr.connError(ce.Code, ce.Reason)
}
return nil, err
}
if err := fr.checkFrameOrder(f); err != nil {
return nil, err
}
if fr.logReads {
fr.debugReadLoggerf("http2: Framer %p: read %v", fr, summarizeFrame(f))
}
if fh.Type == FrameHeaders && fr.ReadMetaHeaders != nil {
return fr.readMetaFrame(f.(*HeadersFrame))
}
return f, nil
}
// connError returns ConnectionError(code) but first
// stashes away a public reason to the caller can optionally relay it
// to the peer before hanging up on them. This might help others debug
// their implementations.
func (fr *Framer) connError(code ErrCode, reason string) error {
fr.errDetail = errors.New(reason)
return ConnectionError(code)
}
// checkFrameOrder reports an error if f is an invalid frame to return
// next from ReadFrame. Mostly it checks whether HEADERS and
// CONTINUATION frames are contiguous.
func (fr *Framer) checkFrameOrder(f Frame) error {
last := fr.lastFrame
fr.lastFrame = f
if fr.AllowIllegalReads {
return nil
}
fh := f.Header()
if fr.lastHeaderStream != 0 {
if fh.Type != FrameContinuation {
return fr.connError(ErrCodeProtocol,
fmt.Sprintf("got %s for stream %d; expected CONTINUATION following %s for stream %d",
fh.Type, fh.StreamID,
last.Header().Type, fr.lastHeaderStream))
}
if fh.StreamID != fr.lastHeaderStream {
return fr.connError(ErrCodeProtocol,
fmt.Sprintf("got CONTINUATION for stream %d; expected stream %d",
fh.StreamID, fr.lastHeaderStream))
}
} else if fh.Type == FrameContinuation {
return fr.connError(ErrCodeProtocol, fmt.Sprintf("unexpected CONTINUATION for stream %d", fh.StreamID))
}
switch fh.Type {
case FrameHeaders, FrameContinuation:
if fh.Flags.Has(FlagHeadersEndHeaders) {
fr.lastHeaderStream = 0
} else {
fr.lastHeaderStream = fh.StreamID
}
}
return nil
}
// A DataFrame conveys arbitrary, variable-length sequences of octets
// associated with a stream.
// See http://http2.github.io/http2-spec/#rfc.section.6.1
type DataFrame struct {
FrameHeader
data []byte
}
func (f *DataFrame) StreamEnded() bool {
return f.FrameHeader.Flags.Has(FlagDataEndStream)
}
// Data returns the frame's data octets, not including any padding
// size byte or padding suffix bytes.
// The caller must not retain the returned memory past the next
// call to ReadFrame.
func (f *DataFrame) Data() []byte {
f.checkValid()
return f.data
}
func parseDataFrame(fc *frameCache, fh FrameHeader, payload []byte) (Frame, error) {
if fh.StreamID == 0 {
// DATA frames MUST be associated with a stream. If a
// DATA frame is received whose stream identifier
// field is 0x0, the recipient MUST respond with a
// connection error (Section 5.4.1) of type
// PROTOCOL_ERROR.
return nil, connError{ErrCodeProtocol, "DATA frame with stream ID 0"}
}
f := fc.getDataFrame()
f.FrameHeader = fh
var padSize byte
if fh.Flags.Has(FlagDataPadded) {
var err error
payload, padSize, err = readByte(payload)
if err != nil {
return nil, err
}
}
if int(padSize) > len(payload) {
// If the length of the padding is greater than the
// length of the frame payload, the recipient MUST
// treat this as a connection error.
// Filed: https://github.com/http2/http2-spec/issues/610
return nil, connError{ErrCodeProtocol, "pad size larger than data payload"}
}
f.data = payload[:len(payload)-int(padSize)]
return f, nil
}
var (
errStreamID = errors.New("invalid stream ID")
errDepStreamID = errors.New("invalid dependent stream ID")
errPadLength = errors.New("pad length too large")
errPadBytes = errors.New("padding bytes must all be zeros unless AllowIllegalWrites is enabled")
)
func validStreamIDOrZero(streamID uint32) bool {
return streamID&(1<<31) == 0
}
func validStreamID(streamID uint32) bool {
return streamID != 0 && streamID&(1<<31) == 0
}
// WriteData writes a DATA frame.
//
// It will perform exactly one Write to the underlying Writer.
// It is the caller's responsibility not to violate the maximum frame size
// and to not call other Write methods concurrently.
func (f *Framer) WriteData(streamID uint32, endStream bool, data []byte) error {
return f.WriteDataPadded(streamID, endStream, data, nil)
}
// WriteDataPadded writes a DATA frame with optional padding.
//
// If pad is nil, the padding bit is not sent.
// The length of pad must not exceed 255 bytes.
// The bytes of pad must all be zero, unless f.AllowIllegalWrites is set.
//
// It will perform exactly one Write to the underlying Writer.
// It is the caller's responsibility not to violate the maximum frame size
// and to not call other Write methods concurrently.
func (f *Framer) WriteDataPadded(streamID uint32, endStream bool, data, pad []byte) error {
if !validStreamID(streamID) && !f.AllowIllegalWrites {
return errStreamID
}
if len(pad) > 0 {
if len(pad) > 255 {
return errPadLength
}
if !f.AllowIllegalWrites {
for _, b := range pad {
if b != 0 {
// "Padding octets MUST be set to zero when sending."
return errPadBytes
}
}
}
}
var flags Flags
if endStream {
flags |= FlagDataEndStream
}
if pad != nil {
flags |= FlagDataPadded
}
f.startWrite(FrameData, flags, streamID)
if pad != nil {
f.wbuf = append(f.wbuf, byte(len(pad)))
}
f.wbuf = append(f.wbuf, data...)
f.wbuf = append(f.wbuf, pad...)
return f.endWrite()
}
// A SettingsFrame conveys configuration parameters that affect how
// endpoints communicate, such as preferences and constraints on peer
// behavior.
//
// See http://http2.github.io/http2-spec/#SETTINGS
type SettingsFrame struct {
FrameHeader
p []byte
}
func parseSettingsFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) {
if fh.Flags.Has(FlagSettingsAck) && fh.Length > 0 {
// When this (ACK 0x1) bit is set, the payload of the
// SETTINGS frame MUST be empty. Receipt of a
// SETTINGS frame with the ACK flag set and a length
// field value other than 0 MUST be treated as a
// connection error (Section 5.4.1) of type
// FRAME_SIZE_ERROR.
return nil, ConnectionError(ErrCodeFrameSize)
}
if fh.StreamID != 0 {
// SETTINGS frames always apply to a connection,
// never a single stream. The stream identifier for a
// SETTINGS frame MUST be zero (0x0). If an endpoint
// receives a SETTINGS frame whose stream identifier
// field is anything other than 0x0, the endpoint MUST
// respond with a connection error (Section 5.4.1) of
// type PROTOCOL_ERROR.
return nil, ConnectionError(ErrCodeProtocol)
}
if len(p)%6 != 0 {
// Expecting even number of 6 byte settings.
return nil, ConnectionError(ErrCodeFrameSize)
}
f := &SettingsFrame{FrameHeader: fh, p: p}
if v, ok := f.Value(SettingInitialWindowSize); ok && v > (1<<31)-1 {
// Values above the maximum flow control window size of 2^31 - 1 MUST
// be treated as a connection error (Section 5.4.1) of type
// FLOW_CONTROL_ERROR.
return nil, ConnectionError(ErrCodeFlowControl)
}
return f, nil
}
func (f *SettingsFrame) IsAck() bool {
return f.FrameHeader.Flags.Has(FlagSettingsAck)
}
func (f *SettingsFrame) Value(id SettingID) (v uint32, ok bool) {
f.checkValid()
for i := 0; i < f.NumSettings(); i++ {
if s := f.Setting(i); s.ID == id {
return s.Val, true
}
}
return 0, false
}
// Setting returns the setting from the frame at the given 0-based index.
// The index must be >= 0 and less than f.NumSettings().
func (f *SettingsFrame) Setting(i int) Setting {
buf := f.p
return Setting{
ID: SettingID(binary.BigEndian.Uint16(buf[i*6 : i*6+2])),
Val: binary.BigEndian.Uint32(buf[i*6+2 : i*6+6]),
}
}
func (f *SettingsFrame) NumSettings() int { return len(f.p) / 6 }
// HasDuplicates reports whether f contains any duplicate setting IDs.
func (f *SettingsFrame) HasDuplicates() bool {
num := f.NumSettings()
if num == 0 {
return false
}
// If it's small enough (the common case), just do the n^2
// thing and avoid a map allocation.
if num < 10 {
for i := 0; i < num; i++ {
idi := f.Setting(i).ID
for j := i + 1; j < num; j++ {
idj := f.Setting(j).ID
if idi == idj {
return true
}
}
}
return false
}
seen := map[SettingID]bool{}
for i := 0; i < num; i++ {
id := f.Setting(i).ID
if seen[id] {
return true
}
seen[id] = true
}
return false
}
// ForeachSetting runs fn for each setting.
// It stops and returns the first error.
func (f *SettingsFrame) ForeachSetting(fn func(Setting) error) error {
f.checkValid()
for i := 0; i < f.NumSettings(); i++ {
if err := fn(f.Setting(i)); err != nil {
return err
}
}
return nil
}
// WriteSettings writes a SETTINGS frame with zero or more settings
// specified and the ACK bit not set.
//
// It will perform exactly one Write to the underlying Writer.
// It is the caller's responsibility to not call other Write methods concurrently.
func (f *Framer) WriteSettings(settings ...Setting) error {
f.startWrite(FrameSettings, 0, 0)
for _, s := range settings {
f.writeUint16(uint16(s.ID))
f.writeUint32(s.Val)
}
return f.endWrite()
}
// WriteSettingsAck writes an empty SETTINGS frame with the ACK bit set.
//
// It will perform exactly one Write to the underlying Writer.
// It is the caller's responsibility to not call other Write methods concurrently.
func (f *Framer) WriteSettingsAck() error {
f.startWrite(FrameSettings, FlagSettingsAck, 0)
return f.endWrite()
}
// A PingFrame is a mechanism for measuring a minimal round trip time
// from the sender, as well as determining whether an idle connection
// is still functional.
// See http://http2.github.io/http2-spec/#rfc.section.6.7
type PingFrame struct {
FrameHeader
Data [8]byte
}
func (f *PingFrame) IsAck() bool { return f.Flags.Has(FlagPingAck) }
func parsePingFrame(_ *frameCache, fh FrameHeader, payload []byte) (Frame, error) {
if len(payload) != 8 {
return nil, ConnectionError(ErrCodeFrameSize)
}
if fh.StreamID != 0 {
return nil, ConnectionError(ErrCodeProtocol)
}
f := &PingFrame{FrameHeader: fh}
copy(f.Data[:], payload)
return f, nil
}
func (f *Framer) WritePing(ack bool, data [8]byte) error {
var flags Flags
if ack {
flags = FlagPingAck
}
f.startWrite(FramePing, flags, 0)
f.writeBytes(data[:])
return f.endWrite()
}
// A GoAwayFrame informs the remote peer to stop creating streams on this connection.
// See http://http2.github.io/http2-spec/#rfc.section.6.8
type GoAwayFrame struct {
FrameHeader
LastStreamID uint32
ErrCode ErrCode
debugData []byte
}
// DebugData returns any debug data in the GOAWAY frame. Its contents
// are not defined.
// The caller must not retain the returned memory past the next
// call to ReadFrame.
func (f *GoAwayFrame) DebugData() []byte {
f.checkValid()
return f.debugData
}
func parseGoAwayFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) {
if fh.StreamID != 0 {
return nil, ConnectionError(ErrCodeProtocol)
}
if len(p) < 8 {
return nil, ConnectionError(ErrCodeFrameSize)
}
return &GoAwayFrame{
FrameHeader: fh,
LastStreamID: binary.BigEndian.Uint32(p[:4]) & (1<<31 - 1),
ErrCode: ErrCode(binary.BigEndian.Uint32(p[4:8])),
debugData: p[8:],
}, nil
}
func (f *Framer) WriteGoAway(maxStreamID uint32, code ErrCode, debugData []byte) error {
f.startWrite(FrameGoAway, 0, 0)
f.writeUint32(maxStreamID & (1<<31 - 1))
f.writeUint32(uint32(code))
f.writeBytes(debugData)
return f.endWrite()
}
// An UnknownFrame is the frame type returned when the frame type is unknown
// or no specific frame type parser exists.
type UnknownFrame struct {
FrameHeader
p []byte
}
// Payload returns the frame's payload (after the header). It is not
// valid to call this method after a subsequent call to
// Framer.ReadFrame, nor is it valid to retain the returned slice.
// The memory is owned by the Framer and is invalidated when the next
// frame is read.
func (f *UnknownFrame) Payload() []byte {
f.checkValid()
return f.p
}
func parseUnknownFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) {
return &UnknownFrame{fh, p}, nil
}
// A WindowUpdateFrame is used to implement flow control.
// See http://http2.github.io/http2-spec/#rfc.section.6.9
type WindowUpdateFrame struct {
FrameHeader
Increment uint32 // never read with high bit set
}
func parseWindowUpdateFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) {
if len(p) != 4 {
return nil, ConnectionError(ErrCodeFrameSize)
}
inc := binary.BigEndian.Uint32(p[:4]) & 0x7fffffff // mask off high reserved bit
if inc == 0 {
// A receiver MUST treat the receipt of a
// WINDOW_UPDATE frame with an flow control window
// increment of 0 as a stream error (Section 5.4.2) of
// type PROTOCOL_ERROR; errors on the connection flow
// control window MUST be treated as a connection
// error (Section 5.4.1).
if fh.StreamID == 0 {
return nil, ConnectionError(ErrCodeProtocol)
}
return nil, streamError(fh.StreamID, ErrCodeProtocol)
}
return &WindowUpdateFrame{
FrameHeader: fh,
Increment: inc,
}, nil
}
// WriteWindowUpdate writes a WINDOW_UPDATE frame.
// The increment value must be between 1 and 2,147,483,647, inclusive.
// If the Stream ID is zero, the window update applies to the
// connection as a whole.
func (f *Framer) WriteWindowUpdate(streamID, incr uint32) error {
// "The legal range for the increment to the flow control window is 1 to 2^31-1 (2,147,483,647) octets."
if (incr < 1 || incr > 2147483647) && !f.AllowIllegalWrites {
return errors.New("illegal window increment value")
}
f.startWrite(FrameWindowUpdate, 0, streamID)
f.writeUint32(incr)
return f.endWrite()
}
// A HeadersFrame is used to open a stream and additionally carries a
// header block fragment.
type HeadersFrame struct {
FrameHeader
// Priority is set if FlagHeadersPriority is set in the FrameHeader.
Priority PriorityParam
headerFragBuf []byte // not owned
}
func (f *HeadersFrame) HeaderBlockFragment() []byte {
f.checkValid()
return f.headerFragBuf
}
func (f *HeadersFrame) HeadersEnded() bool {
return f.FrameHeader.Flags.Has(FlagHeadersEndHeaders)
}
func (f *HeadersFrame) StreamEnded() bool {
return f.FrameHeader.Flags.Has(FlagHeadersEndStream)
}
func (f *HeadersFrame) HasPriority() bool {
return f.FrameHeader.Flags.Has(FlagHeadersPriority)
}
func parseHeadersFrame(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err error) {
hf := &HeadersFrame{
FrameHeader: fh,
}
if fh.StreamID == 0 {
// HEADERS frames MUST be associated with a stream. If a HEADERS frame
// is received whose stream identifier field is 0x0, the recipient MUST
// respond with a connection error (Section 5.4.1) of type
// PROTOCOL_ERROR.
return nil, connError{ErrCodeProtocol, "HEADERS frame with stream ID 0"}
}
var padLength uint8
if fh.Flags.Has(FlagHeadersPadded) {
if p, padLength, err = readByte(p); err != nil {
return
}
}
if fh.Flags.Has(FlagHeadersPriority) {
var v uint32
p, v, err = readUint32(p)
if err != nil {
return nil, err
}
hf.Priority.StreamDep = v & 0x7fffffff
hf.Priority.Exclusive = (v != hf.Priority.StreamDep) // high bit was set
p, hf.Priority.Weight, err = readByte(p)
if err != nil {
return nil, err
}
}
if len(p)-int(padLength) <= 0 {
return nil, streamError(fh.StreamID, ErrCodeProtocol)
}
hf.headerFragBuf = p[:len(p)-int(padLength)]
return hf, nil
}
// HeadersFrameParam are the parameters for writing a HEADERS frame.
type HeadersFrameParam struct {
// StreamID is the required Stream ID to initiate.
StreamID uint32
// BlockFragment is part (or all) of a Header Block.
BlockFragment []byte
// EndStream indicates that the header block is the last that
// the endpoint will send for the identified stream. Setting
// this flag causes the stream to enter one of "half closed"
// states.
EndStream bool
// EndHeaders indicates that this frame contains an entire
// header block and is not followed by any
// CONTINUATION frames.
EndHeaders bool
// PadLength is the optional number of bytes of zeros to add
// to this frame.
PadLength uint8
// Priority, if non-zero, includes stream priority information
// in the HEADER frame.
Priority PriorityParam
}
// WriteHeaders writes a single HEADERS frame.
//
// This is a low-level header writing method. Encoding headers and
// splitting them into any necessary CONTINUATION frames is handled
// elsewhere.
//
// It will perform exactly one Write to the underlying Writer.
// It is the caller's responsibility to not call other Write methods concurrently.
func (f *Framer) WriteHeaders(p HeadersFrameParam) error {
if !validStreamID(p.StreamID) && !f.AllowIllegalWrites {
return errStreamID
}
var flags Flags
if p.PadLength != 0 {
flags |= FlagHeadersPadded
}
if p.EndStream {
flags |= FlagHeadersEndStream
}
if p.EndHeaders {
flags |= FlagHeadersEndHeaders
}
if !p.Priority.IsZero() {
flags |= FlagHeadersPriority
}
f.startWrite(FrameHeaders, flags, p.StreamID)
if p.PadLength != 0 {
f.writeByte(p.PadLength)
}
if !p.Priority.IsZero() {
v := p.Priority.StreamDep
if !validStreamIDOrZero(v) && !f.AllowIllegalWrites {
return errDepStreamID
}
if p.Priority.Exclusive {
v |= 1 << 31
}
f.writeUint32(v)
f.writeByte(p.Priority.Weight)
}
f.wbuf = append(f.wbuf, p.BlockFragment...)
f.wbuf = append(f.wbuf, padZeros[:p.PadLength]...)
return f.endWrite()
}
// A PriorityFrame specifies the sender-advised priority of a stream.
// See http://http2.github.io/http2-spec/#rfc.section.6.3
type PriorityFrame struct {
FrameHeader
PriorityParam
}
// PriorityParam are the stream prioritzation parameters.
type PriorityParam struct {
// StreamDep is a 31-bit stream identifier for the
// stream that this stream depends on. Zero means no
// dependency.
StreamDep uint32
// Exclusive is whether the dependency is exclusive.
Exclusive bool
// Weight is the stream's zero-indexed weight. It should be
// set together with StreamDep, or neither should be set. Per
// the spec, "Add one to the value to obtain a weight between
// 1 and 256."
Weight uint8
}
func (p PriorityParam) IsZero() bool {
return p == PriorityParam{}
}
func parsePriorityFrame(_ *frameCache, fh FrameHeader, payload []byte) (Frame, error) {
if fh.StreamID == 0 {
return nil, connError{ErrCodeProtocol, "PRIORITY frame with stream ID 0"}
}
if len(payload) != 5 {
return nil, connError{ErrCodeFrameSize, fmt.Sprintf("PRIORITY frame payload size was %d; want 5", len(payload))}
}
v := binary.BigEndian.Uint32(payload[:4])
streamID := v & 0x7fffffff // mask off high bit
return &PriorityFrame{
FrameHeader: fh,
PriorityParam: PriorityParam{
Weight: payload[4],
StreamDep: streamID,
Exclusive: streamID != v, // was high bit set?
},
}, nil
}
// WritePriority writes a PRIORITY frame.
//
// It will perform exactly one Write to the underlying Writer.
// It is the caller's responsibility to not call other Write methods concurrently.
func (f *Framer) WritePriority(streamID uint32, p PriorityParam) error {
if !validStreamID(streamID) && !f.AllowIllegalWrites {
return errStreamID
}
if !validStreamIDOrZero(p.StreamDep) {
return errDepStreamID
}
f.startWrite(FramePriority, 0, streamID)
v := p.StreamDep
if p.Exclusive {
v |= 1 << 31
}
f.writeUint32(v)
f.writeByte(p.Weight)
return f.endWrite()
}
// A RSTStreamFrame allows for abnormal termination of a stream.
// See http://http2.github.io/http2-spec/#rfc.section.6.4
type RSTStreamFrame struct {
FrameHeader
ErrCode ErrCode
}
func parseRSTStreamFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) {
if len(p) != 4 {
return nil, ConnectionError(ErrCodeFrameSize)
}
if fh.StreamID == 0 {
return nil, ConnectionError(ErrCodeProtocol)
}
return &RSTStreamFrame{fh, ErrCode(binary.BigEndian.Uint32(p[:4]))}, nil
}
// WriteRSTStream writes a RST_STREAM frame.
//
// It will perform exactly one Write to the underlying Writer.
// It is the caller's responsibility to not call other Write methods concurrently.
func (f *Framer) WriteRSTStream(streamID uint32, code ErrCode) error {
if !validStreamID(streamID) && !f.AllowIllegalWrites {
return errStreamID
}
f.startWrite(FrameRSTStream, 0, streamID)
f.writeUint32(uint32(code))
return f.endWrite()
}
// A ContinuationFrame is used to continue a sequence of header block fragments.
// See http://http2.github.io/http2-spec/#rfc.section.6.10
type ContinuationFrame struct {
FrameHeader
headerFragBuf []byte
}
func parseContinuationFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) {
if fh.StreamID == 0 {
return nil, connError{ErrCodeProtocol, "CONTINUATION frame with stream ID 0"}
}
return &ContinuationFrame{fh, p}, nil
}
func (f *ContinuationFrame) HeaderBlockFragment() []byte {
f.checkValid()
return f.headerFragBuf
}
func (f *ContinuationFrame) HeadersEnded() bool {
return f.FrameHeader.Flags.Has(FlagContinuationEndHeaders)
}
// WriteContinuation writes a CONTINUATION frame.
//
// It will perform exactly one Write to the underlying Writer.
// It is the caller's responsibility to not call other Write methods concurrently.
func (f *Framer) WriteContinuation(streamID uint32, endHeaders bool, headerBlockFragment []byte) error {
if !validStreamID(streamID) && !f.AllowIllegalWrites {
return errStreamID
}
var flags Flags
if endHeaders {
flags |= FlagContinuationEndHeaders
}
f.startWrite(FrameContinuation, flags, streamID)
f.wbuf = append(f.wbuf, headerBlockFragment...)
return f.endWrite()
}
// A PushPromiseFrame is used to initiate a server stream.
// See http://http2.github.io/http2-spec/#rfc.section.6.6
type PushPromiseFrame struct {
FrameHeader
PromiseID uint32
headerFragBuf []byte // not owned
}
func (f *PushPromiseFrame) HeaderBlockFragment() []byte {
f.checkValid()
return f.headerFragBuf
}
func (f *PushPromiseFrame) HeadersEnded() bool {
return f.FrameHeader.Flags.Has(FlagPushPromiseEndHeaders)
}
func parsePushPromise(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err error) {
pp := &PushPromiseFrame{
FrameHeader: fh,
}
if pp.StreamID == 0 {
// PUSH_PROMISE frames MUST be associated with an existing,
// peer-initiated stream. The stream identifier of a
// PUSH_PROMISE frame indicates the stream it is associated
// with. If the stream identifier field specifies the value
// 0x0, a recipient MUST respond with a connection error
// (Section 5.4.1) of type PROTOCOL_ERROR.
return nil, ConnectionError(ErrCodeProtocol)
}
// The PUSH_PROMISE frame includes optional padding.
// Padding fields and flags are identical to those defined for DATA frames
var padLength uint8
if fh.Flags.Has(FlagPushPromisePadded) {
if p, padLength, err = readByte(p); err != nil {
return
}
}
p, pp.PromiseID, err = readUint32(p)
if err != nil {
return
}
pp.PromiseID = pp.PromiseID & (1<<31 - 1)
if int(padLength) > len(p) {
// like the DATA frame, error out if padding is longer than the body.
return nil, ConnectionError(ErrCodeProtocol)
}
pp.headerFragBuf = p[:len(p)-int(padLength)]
return pp, nil
}
// PushPromiseParam are the parameters for writing a PUSH_PROMISE frame.
type PushPromiseParam struct {
// StreamID is the required Stream ID to initiate.
StreamID uint32
// PromiseID is the required Stream ID which this
// Push Promises
PromiseID uint32
// BlockFragment is part (or all) of a Header Block.
BlockFragment []byte
// EndHeaders indicates that this frame contains an entire
// header block and is not followed by any
// CONTINUATION frames.
EndHeaders bool
// PadLength is the optional number of bytes of zeros to add
// to this frame.
PadLength uint8
}
// WritePushPromise writes a single PushPromise Frame.
//
// As with Header Frames, This is the low level call for writing
// individual frames. Continuation frames are handled elsewhere.
//
// It will perform exactly one Write to the underlying Writer.
// It is the caller's responsibility to not call other Write methods concurrently.
func (f *Framer) WritePushPromise(p PushPromiseParam) error {
if !validStreamID(p.StreamID) && !f.AllowIllegalWrites {
return errStreamID
}
var flags Flags
if p.PadLength != 0 {
flags |= FlagPushPromisePadded
}
if p.EndHeaders {
flags |= FlagPushPromiseEndHeaders
}
f.startWrite(FramePushPromise, flags, p.StreamID)
if p.PadLength != 0 {
f.writeByte(p.PadLength)
}
if !validStreamID(p.PromiseID) && !f.AllowIllegalWrites {
return errStreamID
}
f.writeUint32(p.PromiseID)
f.wbuf = append(f.wbuf, p.BlockFragment...)
f.wbuf = append(f.wbuf, padZeros[:p.PadLength]...)
return f.endWrite()
}
// WriteRawFrame writes a raw frame. This can be used to write
// extension frames unknown to this package.
func (f *Framer) WriteRawFrame(t FrameType, flags Flags, streamID uint32, payload []byte) error {
f.startWrite(t, flags, streamID)
f.writeBytes(payload)
return f.endWrite()
}
func readByte(p []byte) (remain []byte, b byte, err error) {
if len(p) == 0 {
return nil, 0, io.ErrUnexpectedEOF
}
return p[1:], p[0], nil
}
func readUint32(p []byte) (remain []byte, v uint32, err error) {
if len(p) < 4 {
return nil, 0, io.ErrUnexpectedEOF
}
return p[4:], binary.BigEndian.Uint32(p[:4]), nil
}
type streamEnder interface {
StreamEnded() bool
}
type headersEnder interface {
HeadersEnded() bool
}
type headersOrContinuation interface {
headersEnder
HeaderBlockFragment() []byte
}
// A MetaHeadersFrame is the representation of one HEADERS frame and
// zero or more contiguous CONTINUATION frames and the decoding of
// their HPACK-encoded contents.
//
// This type of frame does not appear on the wire and is only returned
// by the Framer when Framer.ReadMetaHeaders is set.
type MetaHeadersFrame struct {
*HeadersFrame
// Fields are the fields contained in the HEADERS and
// CONTINUATION frames. The underlying slice is owned by the
// Framer and must not be retained after the next call to
// ReadFrame.
//
// Fields are guaranteed to be in the correct http2 order and
// not have unknown pseudo header fields or invalid header
// field names or values. Required pseudo header fields may be
// missing, however. Use the MetaHeadersFrame.Pseudo accessor
// method access pseudo headers.
Fields []hpack.HeaderField
// Truncated is whether the max header list size limit was hit
// and Fields is incomplete. The hpack decoder state is still
// valid, however.
Truncated bool
}
// PseudoValue returns the given pseudo header field's value.
// The provided pseudo field should not contain the leading colon.
func (mh *MetaHeadersFrame) PseudoValue(pseudo string) string {
for _, hf := range mh.Fields {
if !hf.IsPseudo() {
return ""
}
if hf.Name[1:] == pseudo {
return hf.Value
}
}
return ""
}
// RegularFields returns the regular (non-pseudo) header fields of mh.
// The caller does not own the returned slice.
func (mh *MetaHeadersFrame) RegularFields() []hpack.HeaderField {
for i, hf := range mh.Fields {
if !hf.IsPseudo() {
return mh.Fields[i:]
}
}
return nil
}
// PseudoFields returns the pseudo header fields of mh.
// The caller does not own the returned slice.
func (mh *MetaHeadersFrame) PseudoFields() []hpack.HeaderField {
for i, hf := range mh.Fields {
if !hf.IsPseudo() {
return mh.Fields[:i]
}
}
return mh.Fields
}
func (mh *MetaHeadersFrame) checkPseudos() error {
var isRequest, isResponse bool
pf := mh.PseudoFields()
for i, hf := range pf {
switch hf.Name {
case ":method", ":path", ":scheme", ":authority":
isRequest = true
case ":status":
isResponse = true
default:
return pseudoHeaderError(hf.Name)
}
// Check for duplicates.
// This would be a bad algorithm, but N is 4.
// And this doesn't allocate.
for _, hf2 := range pf[:i] {
if hf.Name == hf2.Name {
return duplicatePseudoHeaderError(hf.Name)
}
}
}
if isRequest && isResponse {
return errMixPseudoHeaderTypes
}
return nil
}
func (fr *Framer) maxHeaderStringLen() int {
v := fr.maxHeaderListSize()
if uint32(int(v)) == v {
return int(v)
}
// They had a crazy big number for MaxHeaderBytes anyway,
// so give them unlimited header lengths:
return 0
}
// readMetaFrame returns 0 or more CONTINUATION frames from fr and
// merge them into the provided hf and returns a MetaHeadersFrame
// with the decoded hpack values.
func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) {
if fr.AllowIllegalReads {
return nil, errors.New("illegal use of AllowIllegalReads with ReadMetaHeaders")
}
mh := &MetaHeadersFrame{
HeadersFrame: hf,
}
var remainSize = fr.maxHeaderListSize()
var sawRegular bool
var invalid error // pseudo header field errors
hdec := fr.ReadMetaHeaders
hdec.SetEmitEnabled(true)
hdec.SetMaxStringLength(fr.maxHeaderStringLen())
hdec.SetEmitFunc(func(hf hpack.HeaderField) {
if VerboseLogs && fr.logReads {
fr.debugReadLoggerf("http2: decoded hpack field %+v", hf)
}
if !httpguts.ValidHeaderFieldValue(hf.Value) {
invalid = headerFieldValueError(hf.Value)
}
isPseudo := strings.HasPrefix(hf.Name, ":")
if isPseudo {
if sawRegular {
invalid = errPseudoAfterRegular
}
} else {
sawRegular = true
if !validWireHeaderFieldName(hf.Name) {
invalid = headerFieldNameError(hf.Name)
}
}
if invalid != nil {
hdec.SetEmitEnabled(false)
return
}
size := hf.Size()
if size > remainSize {
hdec.SetEmitEnabled(false)
mh.Truncated = true
return
}
remainSize -= size
mh.Fields = append(mh.Fields, hf)
})
// Lose reference to MetaHeadersFrame:
defer hdec.SetEmitFunc(func(hf hpack.HeaderField) {})
var hc headersOrContinuation = hf
for {
frag := hc.HeaderBlockFragment()
if _, err := hdec.Write(frag); err != nil {
return nil, ConnectionError(ErrCodeCompression)
}
if hc.HeadersEnded() {
break
}
if f, err := fr.ReadFrame(); err != nil {
return nil, err
} else {
hc = f.(*ContinuationFrame) // guaranteed by checkFrameOrder
}
}
mh.HeadersFrame.headerFragBuf = nil
mh.HeadersFrame.invalidate()
if err := hdec.Close(); err != nil {
return nil, ConnectionError(ErrCodeCompression)
}
if invalid != nil {
fr.errDetail = invalid
if VerboseLogs {
log.Printf("http2: invalid header: %v", invalid)
}
return nil, StreamError{mh.StreamID, ErrCodeProtocol, invalid}
}
if err := mh.checkPseudos(); err != nil {
fr.errDetail = err
if VerboseLogs {
log.Printf("http2: invalid pseudo headers: %v", err)
}
return nil, StreamError{mh.StreamID, ErrCodeProtocol, err}
}
return mh, nil
}
func summarizeFrame(f Frame) string {
var buf bytes.Buffer
f.Header().writeDebug(&buf)
switch f := f.(type) {
case *SettingsFrame:
n := 0
f.ForeachSetting(func(s Setting) error {
n++
if n == 1 {
buf.WriteString(", settings:")
}
fmt.Fprintf(&buf, " %v=%v,", s.ID, s.Val)
return nil
})
if n > 0 {
buf.Truncate(buf.Len() - 1) // remove trailing comma
}
case *DataFrame:
data := f.Data()
const max = 256
if len(data) > max {
data = data[:max]
}
fmt.Fprintf(&buf, " data=%q", data)
if len(f.Data()) > max {
fmt.Fprintf(&buf, " (%d bytes omitted)", len(f.Data())-max)
}
case *WindowUpdateFrame:
if f.StreamID == 0 {
buf.WriteString(" (conn)")
}
fmt.Fprintf(&buf, " incr=%v", f.Increment)
case *PingFrame:
fmt.Fprintf(&buf, " ping=%q", f.Data[:])
case *GoAwayFrame:
fmt.Fprintf(&buf, " LastStreamID=%v ErrCode=%v Debug=%q",
f.LastStreamID, f.ErrCode, f.debugData)
case *RSTStreamFrame:
fmt.Fprintf(&buf, " ErrCode=%v", f.ErrCode)
}
return buf.String()
}
|
{
"pile_set_name": "Github"
}
|
8
5
26
12
5
235
13
6
28
30
3
3
3
3
5
2
33
7
2
4
7
12
14
5
8
3
10
4
5
3
6
6
209
20
3
10
14
3
4
6
8
5
11
7
3
2
3
3
212
5
222
4
10
10
5
6
3
8
3
10
254
220
2
3
5
24
5
4
222
7
3
3
223
8
15
12
14
14
3
2
2
3
13
3
11
4
4
6
5
7
13
5
3
5
2
5
3
5
2
7
15
17
14
3
6
6
3
17
5
4
7
6
4
4
8
6
8
3
9
3
6
3
4
5
3
3
660
4
6
10
3
6
3
2
5
13
2
4
4
10
4
8
4
3
7
9
9
3
10
37
3
13
4
12
3
6
10
8
5
21
2
3
8
3
2
3
3
4
12
2
4
8
8
4
3
2
20
1
6
32
2
11
6
18
3
8
11
3
212
3
4
2
6
7
12
11
3
2
16
10
6
4
6
3
2
7
3
2
2
2
2
5
6
4
3
10
3
4
6
5
3
4
4
5
6
4
3
4
4
5
7
5
5
3
2
7
2
4
12
4
5
6
2
4
4
8
4
15
13
7
16
5
3
23
5
5
7
3
2
9
8
7
5
8
11
4
10
76
4
47
4
3
2
7
4
2
3
37
10
4
2
20
5
4
4
10
10
4
3
7
23
240
7
13
5
5
3
3
2
5
4
2
8
7
19
2
23
8
7
2
5
3
8
3
8
13
5
5
5
2
3
23
4
9
8
4
3
3
5
220
2
3
4
6
14
3
53
6
2
5
18
6
3
219
6
5
2
5
3
6
5
15
4
3
17
3
2
4
7
2
3
3
4
4
3
2
664
6
3
23
5
5
16
5
8
2
4
2
24
12
3
2
3
5
8
3
5
4
3
14
3
5
8
2
3
7
9
4
2
3
6
8
4
3
4
6
5
3
3
6
3
19
4
4
6
3
6
3
5
22
5
4
4
3
8
11
4
9
7
6
13
4
4
4
6
17
9
3
3
3
4
3
221
5
11
3
4
2
12
6
3
5
7
5
7
4
9
7
14
37
19
217
16
3
5
2
2
7
19
7
6
7
4
24
5
11
4
7
7
9
13
3
4
3
6
28
4
4
5
5
2
5
6
4
4
6
10
5
4
3
2
3
3
6
5
5
4
3
2
3
7
4
6
18
16
8
16
4
5
8
6
9
13
1545
6
215
6
5
6
3
45
31
5
2
2
4
3
3
2
5
4
3
5
7
7
4
5
8
5
4
749
2
31
9
11
2
11
5
4
4
7
9
11
4
5
4
7
3
4
6
2
15
3
4
3
4
3
5
2
13
5
5
3
3
23
4
4
5
7
4
13
2
4
3
4
2
6
2
7
3
5
5
3
29
5
4
4
3
10
2
3
79
16
6
6
7
7
3
5
5
7
4
3
7
9
5
6
5
9
6
3
6
4
17
2
10
9
3
6
2
3
21
22
5
11
4
2
17
2
224
2
14
3
4
4
2
4
4
4
4
5
3
4
4
10
2
6
3
3
5
7
2
7
5
6
3
218
2
2
5
2
6
3
5
222
14
6
33
3
2
5
3
3
3
9
5
3
3
2
7
4
3
4
3
5
6
5
26
4
13
9
7
3
221
3
3
4
4
4
4
2
18
5
3
7
9
6
8
3
10
3
11
9
5
4
17
5
5
6
6
3
2
4
12
17
6
7
218
4
2
4
10
3
5
15
3
9
4
3
3
6
29
3
3
4
5
5
3
8
5
6
6
7
5
3
5
3
29
2
31
5
15
24
16
5
207
4
3
3
2
15
4
4
13
5
5
4
6
10
2
7
8
4
6
20
5
3
4
3
12
12
5
17
7
3
3
3
6
10
3
5
25
80
4
9
3
2
11
3
3
2
3
8
7
5
5
19
5
3
3
12
11
2
6
5
5
5
3
3
3
4
209
14
3
2
5
19
4
4
3
4
14
5
6
4
13
9
7
4
7
10
2
9
5
7
2
8
4
6
5
5
222
8
7
12
5
216
3
4
4
6
3
14
8
7
13
4
3
3
3
3
17
5
4
3
33
6
6
33
7
5
3
8
7
5
2
9
4
2
233
24
7
4
8
10
3
4
15
2
16
3
3
13
12
7
5
4
207
4
2
4
27
15
2
5
2
25
6
5
5
6
13
6
18
6
4
12
225
10
7
5
2
2
11
4
14
21
8
10
3
5
4
232
2
5
5
3
7
17
11
6
6
23
4
6
3
5
4
2
17
3
6
5
8
3
2
2
14
9
4
4
2
5
5
3
7
6
12
6
10
3
6
2
2
19
5
4
4
9
2
4
13
3
5
6
3
6
5
4
9
6
3
5
7
3
6
6
4
3
10
6
3
221
3
5
3
6
4
8
5
3
6
4
4
2
54
5
6
11
3
3
4
4
4
3
7
3
11
11
7
10
6
13
223
213
15
231
7
3
7
228
2
3
4
4
5
6
7
4
13
3
4
5
3
6
4
6
7
2
4
3
4
3
3
6
3
7
3
5
18
5
6
8
10
3
3
3
2
4
2
4
4
5
6
6
4
10
13
3
12
5
12
16
8
4
19
11
2
4
5
6
8
5
6
4
18
10
4
2
216
6
6
6
2
4
12
8
3
11
5
6
14
5
3
13
4
5
4
5
3
28
6
3
7
219
3
9
7
3
10
6
3
4
19
5
7
11
6
15
19
4
13
11
3
7
5
10
2
8
11
2
6
4
6
24
6
3
3
3
3
6
18
4
11
4
2
5
10
8
3
9
5
3
4
5
6
2
5
7
4
4
14
6
4
4
5
5
7
2
4
3
7
3
3
6
4
5
4
4
4
3
3
3
3
8
14
2
3
5
3
2
4
5
3
7
3
3
18
3
4
4
5
7
3
3
3
13
5
4
8
211
5
5
3
5
2
5
4
2
655
6
3
5
11
2
5
3
12
9
15
11
5
12
217
2
6
17
3
3
207
5
5
4
5
9
3
2
8
5
4
3
2
5
12
4
14
5
4
2
13
5
8
4
225
4
3
4
5
4
3
3
6
23
9
2
6
7
233
4
4
6
18
3
4
6
3
4
4
2
3
7
4
13
227
4
3
5
4
2
12
9
17
3
7
14
6
4
5
21
4
8
9
2
9
25
16
3
6
4
7
8
5
2
3
5
4
3
3
5
3
3
3
2
3
19
2
4
3
4
2
3
4
4
2
4
3
3
3
2
6
3
17
5
6
4
3
13
5
3
3
3
4
9
4
2
14
12
4
5
24
4
3
37
12
11
21
3
4
3
13
4
2
3
15
4
11
4
4
3
8
3
4
4
12
8
5
3
3
4
2
220
3
5
223
3
3
3
10
3
15
4
241
9
7
3
6
6
23
4
13
7
3
4
7
4
9
3
3
4
10
5
5
1
5
24
2
4
5
5
6
14
3
8
2
3
5
13
13
3
5
2
3
15
3
4
2
10
4
4
4
5
5
3
5
3
4
7
4
27
3
6
4
15
3
5
6
6
5
4
8
3
9
2
6
3
4
3
7
4
18
3
11
3
3
8
9
7
24
3
219
7
10
4
5
9
12
2
5
4
4
4
3
3
19
5
8
16
8
6
22
3
23
3
242
9
4
3
3
5
7
3
3
5
8
3
7
5
14
8
10
3
4
3
7
4
6
7
4
10
4
3
11
3
7
10
3
13
6
8
12
10
5
7
9
3
4
7
7
10
8
30
9
19
4
3
19
15
4
13
3
215
223
4
7
4
8
17
16
3
7
6
5
5
4
12
3
7
4
4
13
4
5
2
5
6
5
6
6
7
10
18
23
9
3
3
6
5
2
4
2
7
3
3
2
5
5
14
10
224
6
3
4
3
7
5
9
3
6
4
2
5
11
4
3
3
2
8
4
7
4
10
7
3
3
18
18
17
3
3
3
4
5
3
3
4
12
7
3
11
13
5
4
7
13
5
4
11
3
12
3
6
4
4
21
4
6
9
5
3
10
8
4
6
4
4
6
5
4
8
6
4
6
4
4
5
9
6
3
4
2
9
3
18
2
4
3
13
3
6
6
8
7
9
3
2
16
3
4
6
3
2
33
22
14
4
9
12
4
5
6
3
23
9
4
3
5
5
3
4
5
3
5
3
10
4
5
5
8
4
4
6
8
5
4
3
4
6
3
3
3
5
9
12
6
5
9
3
5
3
2
2
2
18
3
2
21
2
5
4
6
4
5
10
3
9
3
2
10
7
3
6
6
4
4
8
12
7
3
7
3
3
9
3
4
5
4
4
5
5
10
15
4
4
14
6
227
3
14
5
216
22
5
4
2
2
6
3
4
2
9
9
4
3
28
13
11
4
5
3
3
2
3
3
5
3
4
3
5
23
26
3
4
5
6
4
6
3
5
5
3
4
3
2
2
2
7
14
3
6
7
17
2
2
15
14
16
4
6
7
13
6
4
5
6
16
3
3
28
3
6
15
3
9
2
4
6
3
3
22
4
12
6
7
2
5
4
10
3
16
6
9
2
5
12
7
5
5
5
5
2
11
9
17
4
3
11
7
3
5
15
4
3
4
211
8
7
5
4
7
6
7
6
3
6
5
6
5
3
4
4
26
4
6
10
4
4
3
2
3
3
4
5
9
3
9
4
4
5
5
8
2
4
2
3
8
4
11
19
5
8
6
3
5
6
12
3
2
4
16
12
3
4
4
8
6
5
6
6
219
8
222
6
16
3
13
19
5
4
3
11
6
10
4
7
7
12
5
3
3
5
6
10
3
8
2
5
4
7
2
4
4
2
12
9
6
4
2
40
2
4
10
4
223
4
2
20
6
7
24
5
4
5
2
20
16
6
5
13
2
3
3
19
3
2
4
5
6
7
11
12
5
6
7
7
3
5
3
5
3
14
3
4
4
2
11
1
7
3
9
6
11
12
5
8
6
221
4
2
12
4
3
15
4
5
226
7
218
7
5
4
5
18
4
5
9
4
4
2
9
18
18
9
5
6
6
3
3
7
3
5
4
4
4
12
3
6
31
5
4
7
3
6
5
6
5
11
2
2
11
11
6
7
5
8
7
10
5
23
7
4
3
5
34
2
5
23
7
3
6
8
4
4
4
2
5
3
8
5
4
8
25
2
3
17
8
3
4
8
7
3
15
6
5
7
21
9
5
6
6
5
3
2
3
10
3
6
3
14
7
4
4
8
7
8
2
6
12
4
213
6
5
21
8
2
5
23
3
11
2
3
6
25
2
3
6
7
6
6
4
4
6
3
17
9
7
6
4
3
10
7
2
3
3
3
11
8
3
7
6
4
14
36
3
4
3
3
22
13
21
4
2
7
4
4
17
15
3
7
11
2
4
7
6
209
6
3
2
2
24
4
9
4
3
3
3
29
2
2
4
3
3
5
4
6
3
3
2
4
|
{
"pile_set_name": "Github"
}
|
From 93aed9fb56d50ccadfaf8ed95d1fb87a26b905a1 Mon Sep 17 00:00:00 2001
From: kszaq <kszaquitto@gmail.com>
Date: Thu, 14 Sep 2017 21:21:18 +0200
Subject: [PATCH 3/4] bcmdhd: match only Broadcom SDIO devices
---
bcmdhd.1.363.59.144.x.cn/bcmsdh_sdmmc_linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bcmdhd.1.363.59.144.x.cn/bcmsdh_sdmmc_linux.c b/bcmdhd.1.363.59.144.x.cn/bcmsdh_sdmmc_linux.c
index adb6c5e..c4fd55a 100644
--- a/bcmdhd.1.363.59.144.x.cn/bcmsdh_sdmmc_linux.c
+++ b/bcmdhd.1.363.59.144.x.cn/bcmsdh_sdmmc_linux.c
@@ -229,7 +229,7 @@ static const struct sdio_device_id bcmsdh_sdmmc_ids[] = {
{ SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4334) },
{ SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4324) },
{ SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_43239) },
- { SDIO_DEVICE_CLASS(SDIO_CLASS_NONE) },
+ { SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_ANY_ID) },
{ /* end: all zeroes */ },
};
--
2.25.1
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See License.txt in the repository root.
package com.microsoft.tfs.core.clients.versioncontrol.soapextensions;
import java.io.File;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Calendar;
import com.microsoft.tfs.core.Messages;
import com.microsoft.tfs.core.clients.versioncontrol.PropertyUtils;
import com.microsoft.tfs.core.clients.versioncontrol.VersionControlClient;
import com.microsoft.tfs.core.clients.versioncontrol.VersionControlConstants;
import com.microsoft.tfs.core.clients.versioncontrol.exceptions.DestroyedContentUnavailableException;
import com.microsoft.tfs.core.clients.versioncontrol.exceptions.ItemNotFoundException;
import com.microsoft.tfs.core.clients.versioncontrol.exceptions.VersionControlException;
import com.microsoft.tfs.core.clients.versioncontrol.path.ServerPath;
import com.microsoft.tfs.core.clients.versioncontrol.soapextensions.internal.DownloadURL;
import com.microsoft.tfs.core.clients.versioncontrol.specs.DownloadSpec;
import com.microsoft.tfs.core.internal.wrappers.WebServiceObjectWrapper;
import com.microsoft.tfs.core.internal.wrappers.WrapperUtils;
import com.microsoft.tfs.core.util.FileEncoding;
import com.microsoft.tfs.util.Check;
import com.microsoft.tfs.util.temp.TempStorageService;
import ms.tfs.versioncontrol.clientservices._03._Item;
import ms.tfs.versioncontrol.clientservices._03._PropertyValue;
/**
* Contains information about a version control item.
*
* @since TEE-SDK-10.1
*/
public class Item extends WebServiceObjectWrapper implements Comparable<Item> {
private DownloadURL downloadURLObject;
public Item() {
this(new _Item());
}
public Item(final ItemType itemType, final String serverItem, final int encoding) {
this(
new _Item(
0,
null,
0,
encoding,
itemType.getWebServiceObject(),
0,
serverItem,
null,
null,
null,
0,
null,
false,
null,
null));
}
public Item(final _Item item) {
super(item);
// Update the wrapper and wrapped objects
setDownloadURL(item.getDurl());
}
/**
* Gets the web service object this class wraps. The returned object should
* not be modified.
*
* @return the web service object this class wraps.
*/
public _Item getWebServiceObject() {
return (_Item) webServiceObject;
}
@Override
public int compareTo(final Item other) {
// First we sort by path.
final int res = ServerPath.compareTopDown(getServerItem(), other.getServerItem());
if (res != 0) {
return res;
}
/*
* Now we compare by deletion ID. Visual Studio's code sorts this way to
* give consistent order to matching paths. I'm not sure if this field
* is special in any way, or if they just arbitrarily chose it for the
* secondary sort.
*/
if (getDeletionID() < other.getDeletionID()) {
return -1;
} else if (getDeletionID() > other.getDeletionID()) {
return 1;
} else {
return 0;
}
}
public int getChangeSetID() {
return getWebServiceObject().getCs();
}
public void setChangeSetID(final int cs) {
getWebServiceObject().setCs(cs);
}
public Calendar getCheckinDate() {
return (Calendar) getWebServiceObject().getDate().clone();
}
public void setCheckinDate(final Calendar date) {
getWebServiceObject().setDate((Calendar) date.clone());
}
public int getDeletionID() {
return getWebServiceObject().getDid();
}
public void setDeletionID(final int did) {
getWebServiceObject().setDid(did);
}
public FileEncoding getEncoding() {
return new FileEncoding(getWebServiceObject().getEnc());
}
public void setEncoding(final FileEncoding encoding) {
getWebServiceObject().setEnc(encoding.getCodePage());
}
public byte[] getContentHashValue() {
return getWebServiceObject().getHash();
}
public void setContentHashValue(final byte[] hash) {
getWebServiceObject().setHash(hash);
}
public String getServerItem() {
return getWebServiceObject().getItem();
}
public void setServerItem(final String item) {
getWebServiceObject().setItem(item);
}
public int getItemID() {
return getWebServiceObject().getItemid();
}
public void setItemID(final int itemid) {
getWebServiceObject().setItemid(itemid);
}
public long getContentLength() {
return getWebServiceObject().getLen();
}
public void setContentLength(final long len) {
getWebServiceObject().setLen(len);
}
public ItemType getItemType() {
return ItemType.fromWebServiceObject(getWebServiceObject().getType());
}
public void setItemType(final ItemType type) {
getWebServiceObject().setType(type.getWebServiceObject());
}
public void setDownloadURL(final String url) {
getWebServiceObject().setDurl(url);
downloadURLObject = new DownloadURL(url);
}
public String getDownloadURL() {
return getWebServiceObject().getDurl();
}
public String getTimeZone() {
return getWebServiceObject().getTz();
}
public String getTimeZoneO() {
return getWebServiceObject().getTzo();
}
public PropertyValue[] getPropertyValues() {
// TODO remove the selectUnique
return PropertyUtils.selectUnique(
(PropertyValue[]) WrapperUtils.wrap(PropertyValue.class, getWebServiceObject().getPropertyValues()));
}
public void setPropertyValues(final PropertyValue[] properties) {
getWebServiceObject().setPropertyValues(
(_PropertyValue[]) WrapperUtils.unwrap(_PropertyValue.class, properties));
}
/**
* This method always returns false for items in a TFS 2005 or TFS 2008
* server.
*
* @return true if the item is a branch, false if it is not a branch
* @since TFS2010
*/
public boolean isBranch() {
return getWebServiceObject().isIsbranch();
}
/**
* Downloads the content for this version of the item to a temp file in a
* new temp directory allocated with {@link TempStorageService}.
*
* @param fileName
* the file name (not full path) to give the temporary file
* @return the temporary file created
*/
public synchronized File downloadFileToTempLocation(final VersionControlClient client, final String fileName) {
Check.notNullOrEmpty(fileName, "fileName"); //$NON-NLS-1$
Check.notNull(client, "client"); //$NON-NLS-1$
try {
final File file = new File(TempStorageService.getInstance().createTempDirectory(), fileName);
downloadFile(client, file.getAbsolutePath());
return file;
} catch (final IOException e) {
throw new VersionControlException(e);
}
}
/**
* Downloads the content for this version of the item.
*
* @param filePath
* where to save the downloaded file contents (must not be
* <code>null</code>)
*/
public synchronized void downloadFile(final VersionControlClient client, final String filePath) {
Check.notNull(filePath, "filePath"); //$NON-NLS-1$
Check.notNull(client, "client"); //$NON-NLS-1$
prepareForDownload(client);
client.downloadFile(new DownloadSpec(getDownloadURL()), new File(filePath), true);
}
/**
* Makes sure we have all the information needed to download the file and
* this item can be downloaded.
*/
private void prepareForDownload(final VersionControlClient client) {
Check.notNull(client, "client"); //$NON-NLS-1$
// Make sure we have a file, not a directory
if (getItemType() != ItemType.FILE) {
throw new VersionControlException(
MessageFormat.format(Messages.getString("PendingChange.PathIsNotAFileFormat"), getServerItem())); //$NON-NLS-1$
}
// Check for the case where the user attempts to download an item that
// is in an indeterminate
// state.
if (getChangeSetID() == VersionControlConstants.INDETERMINATE_CHANGESET) {
throw new VersionControlException(
MessageFormat.format(Messages.getString("Item.ItemChangesetIndeterminateFormat"), getServerItem())); //$NON-NLS-1$
}
// For cases where the download URL wasn't requested, we get it here.
if (getDownloadURL() == null || getDownloadURL().length() == 0) {
final Item item = client.getItem(getItemID(), getChangeSetID(), true);
if (item == null) {
throw new ItemNotFoundException(
MessageFormat.format(
Messages.getString("Item.ItemNotFoundExceptionFormat"), //$NON-NLS-1$
getServerItem()));
} else if (null == item.getDownloadURL()) {
// In the case where the user has AdminProjectRigths but not
// Read the Url will be null even though the caller will get the
// item.
throw new VersionControlException(
MessageFormat.format(
Messages.getString("Item.ItemCannotBeDownloadReadPermissionRequiredFormat"), //$NON-NLS-1$
item.getServerItem()));
}
cloneDownloadURLFromItem(item);
}
// If the content is destroyed, we can't download it.
if (isContentDestroyed(client)) {
throw new DestroyedContentUnavailableException(
MessageFormat.format(
Messages.getString("Item.DestroyedContentUnavailableExceptionFormat"), //$NON-NLS-1$
getChangeSetID(),
getServerItem()));
}
}
/**
* @return true if the content for this file has been destroyed, false if
* the content exists, or if the item is a directory.
*/
public synchronized boolean isContentDestroyed(final VersionControlClient client) {
Check.notNull(client, "client"); //$NON-NLS-1$
// For cases where the download URL wasn't requested, we get it here.
if (getDownloadURL() == null || getDownloadURL().length() == 0) {
final Item item = client.getItem(getItemID(), getChangeSetID(), true);
cloneDownloadURLFromItem(item);
}
return downloadURLObject.isContentDestroyed();
}
/**
* Given another {@link Item} object, obtains the download URL information
* from it and stuffs it in this object.
*/
private void cloneDownloadURLFromItem(final Item item) {
Check.notNull(item, "item"); //$NON-NLS-1$
getWebServiceObject().setDurl(item.getDownloadURL());
downloadURLObject = item.downloadURLObject;
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2013 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.
// +build darwin dragonfly freebsd netbsd openbsd
package terminal
import "syscall"
const ioctlReadTermios = syscall.TIOCGETA
const ioctlWriteTermios = syscall.TIOCSETA
|
{
"pile_set_name": "Github"
}
|
// Copyright 2018 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.
// +build linux,gccgo,arm
package unix
import (
"syscall"
"unsafe"
)
func seek(fd int, offset int64, whence int) (int64, syscall.Errno) {
var newoffset int64
offsetLow := uint32(offset & 0xffffffff)
offsetHigh := uint32((offset >> 32) & 0xffffffff)
_, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0)
return newoffset, err
}
|
{
"pile_set_name": "Github"
}
|
simple HTTP router
|
{
"pile_set_name": "Github"
}
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2006 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include <stdio.h>
#include <stdlib.h>
#include "mpi.h"
#include "mpithreadtest.h"
int rank;
MTEST_THREAD_RETURN_TYPE run_test(void * arg);
MTEST_THREAD_RETURN_TYPE run_test(void * arg)
{
MPI_Status reqstat;
int i, j;
int peer = rank ? 0 : 1;
for (j = 0; j < 10; j++) {
if (rank % 2) {
for (i = 0; i < 16; i++)
MPI_Send(NULL, 0, MPI_CHAR, peer, j, MPI_COMM_WORLD);
for (i = 0; i < 16; i++)
MPI_Recv(NULL, 0, MPI_CHAR, peer, j, MPI_COMM_WORLD, &reqstat);
}
else {
for (i = 0; i < 16; i++)
MPI_Recv(NULL, 0, MPI_CHAR, peer, j, MPI_COMM_WORLD, &reqstat);
for (i = 0; i < 16; i++)
MPI_Send(NULL, 0, MPI_CHAR, peer, j, MPI_COMM_WORLD);
}
}
return (MTEST_THREAD_RETURN_TYPE)NULL;
}
int main(int argc, char ** argv)
{
int zero = 0, pmode, nprocs;
MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &pmode);
if (pmode != MPI_THREAD_MULTIPLE) {
fprintf(stderr, "Thread Multiple not supported by the MPI implementation\n");
MPI_Abort(MPI_COMM_WORLD, -1);
}
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs != 2) {
fprintf(stderr, "Need two processes\n");
MPI_Abort(MPI_COMM_WORLD, -1);
}
MTest_Start_thread(run_test, NULL);
run_test(&zero);
MTest_Join_threads();
MPI_Finalize();
/* This program works if it gets here */
if (rank == 0) {
printf( " No Errors\n" );
}
return 0;
}
|
{
"pile_set_name": "Github"
}
|
package statefile
import (
"encoding/json"
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags"
)
const invalidFormat = "Invalid state file format"
// jsonUnmarshalDiags is a helper that translates errors returned from
// json.Unmarshal into hopefully-more-helpful diagnostics messages.
func jsonUnmarshalDiags(err error) tfdiags.Diagnostics {
var diags tfdiags.Diagnostics
if err == nil {
return diags
}
switch tErr := err.(type) {
case *json.SyntaxError:
// We've usually already successfully parsed a source file as JSON at
// least once before we'd use jsonUnmarshalDiags with it (to sniff
// the version number) so this particular error should not appear much
// in practice.
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
invalidFormat,
fmt.Sprintf("The state file could not be parsed as JSON: syntax error at byte offset %d.", tErr.Offset),
))
case *json.UnmarshalTypeError:
// This is likely to be the most common area, describing a
// non-conformance between the file and the expected file format
// at a semantic level.
if tErr.Field != "" {
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
invalidFormat,
fmt.Sprintf("The state file field %q has invalid value %s", tErr.Field, tErr.Value),
))
break
} else {
// Without a field name, we can't really say anything helpful.
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
invalidFormat,
"The state file does not conform to the expected JSON data structure.",
))
}
default:
// Fallback for all other types of errors. This can happen only for
// custom UnmarshalJSON implementations, so should be encountered
// only rarely.
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
invalidFormat,
fmt.Sprintf("The state file does not conform to the expected JSON data structure: %s.", err.Error()),
))
}
return diags
}
|
{
"pile_set_name": "Github"
}
|
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
extern void PUT32 ( unsigned int, unsigned int );
extern unsigned int GET32 ( unsigned int );
extern void dummy ( unsigned int );
extern void uart_init ( void );
extern void hexstrings ( unsigned int d );
extern void hexstring ( unsigned int d );
extern void init_timer ( void );
extern unsigned int timer_tick ( void );
extern void start_l1cache ( void );
extern void stop_l1cache ( void );
extern void ARMTEST0 ( unsigned int );
extern void ARMTEST1 ( unsigned int );
extern void ARMTEST2 ( unsigned int );
extern void ARMTEST3 ( unsigned int );
extern void THUMBTEST0 ( unsigned int );
extern void THUMBTEST1 ( unsigned int );
extern void THUMBTEST2 ( unsigned int );
//------------------------------------------------------------------------
int notmain ( void )
{
unsigned int beg,end;
uart_init();
hexstring(0x12345678);
start_l1cache();
init_timer();
beg=timer_tick();
ARMTEST0(0x01000000);
end=timer_tick();
hexstring(end-beg);
init_timer();
beg=timer_tick();
ARMTEST0(0x01000000);
end=timer_tick();
hexstring(end-beg);
init_timer();
beg=timer_tick();
ARMTEST1(0x01000000);
end=timer_tick();
hexstring(end-beg);
init_timer();
beg=timer_tick();
ARMTEST2(0x01000000);
end=timer_tick();
hexstring(end-beg);
init_timer();
beg=timer_tick();
ARMTEST3(0x01000000);
end=timer_tick();
hexstring(end-beg);
init_timer();
beg=timer_tick();
THUMBTEST0(0x01000000);
end=timer_tick();
hexstring(end-beg);
init_timer();
beg=timer_tick();
THUMBTEST1(0x01000000);
end=timer_tick();
hexstring(end-beg);
init_timer();
beg=timer_tick();
THUMBTEST2(0x01000000);
end=timer_tick();
hexstring(end-beg);
stop_l1cache();
return(0);
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//
// Copyright (c) 2012 David Welch dwelch@dwelch.com
//
// 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.
//
//-------------------------------------------------------------------------
|
{
"pile_set_name": "Github"
}
|
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Customizing SumatraPDF 3.3</title>
<style type="text/css">
body {
font-size: 90%;
background-color: #f5f5f5;
}
.desc {
padding: 0px 10px 0px 10px;
}
.txt1 {
/* bold doesn't look good in the fonts above */
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
font-size: 88%;
color: #800; /* this is brown */
}
.txt2 {
font-family: Verdana, Arial, sans-serif;
font-family: serif;
font-size: 90%;
font-weight: bold;
color: #800; /* this is brown */
}
.txt {
font-family: serif;
font-size: 95%;
font-weight: bold;
color: #800; /* this is brown */
color: #000;
background-color: #ececec;
border: 1px solid #fff;
border-radius: 10px;
-webkit-border-radius: 10px;
box-shadow: rgba(0, 0, 0, .15) 3px 3px 4px;
-webkit-box-shadow: rgba(0, 0, 0, .15) 3px 3px 4px;
padding: 10px 10px 10px 20px;
}
.cm {
color: #800; /* this is brown, a bit aggressive */
color: #8c8c8c; /* this is gray */
color: #555; /* this is darker gray */
font-weight: normal;
}
</style>
</head>
<body>
<div class="desc">
<h2>Customizing SumatraPDF 3.3</h2>
<p>You can change the look and behavior of
<a href="http://www.sumatrapdfreader.org/">SumatraPDF</a>
by editing the file <code>SumatraPDF-settings.txt</code>. The file is stored in
<code>%LOCALAPPDATA%\SumatraPDF</code> directory for the installed version or in the
same directory as <code>SumatraPDF.exe</code> executable for the portable version.</p>
<p>Use the menu item <code>Settings -> Advanced Settings...</code> to open the settings file
with your default text editor.</p>
<p>The file is in a simple text format. Below is an explanation of
what the different settings mean and what their default values are.</p>
<p>Highlighted settings can't be changed from the UI. Modifying other settings
directly in this file is not recommended.</p>
<p>If you add or remove lines with square brackets, <b>make sure to always add/remove
square brackets in pairs</b>! Else you risk losing all the data following them.</p>
</div>
<pre class="txt">
<div><span class="cm" id="MainWindowBackground">background <a href="#color">color</a> of the non-document windows, traditionally yellow</span>
MainWindowBackground = #fff200
<span class="cm" id="EscToExit">if true, Esc key closes SumatraPDF</span>
EscToExit = false
<span class="cm" id="ReuseInstance">if true, we'll always open files using existing SumatraPDF process</span>
ReuseInstance = false
<span class="cm" id="UseSysColors">if true, we use Windows system <a href="#color">colors</a> for background/text color. Over-rides other settings</span>
UseSysColors = false
<span class="cm" id="RestoreSession">if true and SessionData isn't empty, that session will be restored at startup</span>
RestoreSession = true
</div>
<span class="cm" id="TabWidth">maximum width of a single tab</span>
TabWidth = 300
<div>
<span class="cm" id="FixedPageUI">customization options for PDF, XPS, DjVu and PostScript UI</span>
FixedPageUI [
<span class="cm" id="FixedPageUI_TextColor"><a href="#color">color</a> value with which black (text) will be substituted</span>
TextColor = #000000
<span class="cm" id="FixedPageUI_BackgroundColor"><a href="#color">color</a> value with which white (background) will be substituted</span>
BackgroundColor = #ffffff
<span class="cm" id="FixedPageUI_SelectionColor"><a href="#color">color</a> value for the text selection rectangle (also used to highlight found text) (introduced in
version 2.4)</span>
SelectionColor = #f5fc0c
<span class="cm" id="FixedPageUI_WindowMargin">top, right, bottom and left margin (in that order) between window and document</span>
WindowMargin = 2 4 2 4
<span class="cm" id="FixedPageUI_PageSpacing">horizontal and vertical distance between two pages in facing and book view modes</span>
PageSpacing = 4 4
<span class="cm" id="FixedPageUI_GradientColors"><a href="#color">colors</a> to use for the gradient from top to bottom (stops will be inserted at regular intervals
throughout the document); currently only up to three <a href="#color">colors</a> are supported; the idea behind this
experimental feature is that the background might allow to subconsciously determine reading
progress; suggested values: #2828aa #28aa28 #aa2828</span>
GradientColors =
]
<span class="cm" id="EbookUI">customization options for eBooks (EPUB, Mobi, FictionBook) UI. If UseFixedPageUI is true,
FixedPageUI settings apply instead</span>
EbookUI [
<span class="cm" id="EbookUI_FontName">name of the font. takes effect after re-opening the document</span>
FontName = Georgia
<span class="cm" id="EbookUI_FontSize">size of the font. takes effect after re-opening the document</span>
FontSize = 12.5
<span class="cm" id="EbookUI_TextColor"><a href="#color">color</a> for text</span>
TextColor = #5f4b32
<span class="cm" id="EbookUI_BackgroundColor"><a href="#color">color</a> of the background (page)</span>
BackgroundColor = #fbf0d9
<span class="cm" id="EbookUI_UseFixedPageUI">if true, the UI used for PDF documents will be used for ebooks as well (enables printing and
searching, disables automatic reflow)</span>
UseFixedPageUI = false
]
<span class="cm" id="ComicBookUI">customization options for Comic Book and images UI</span>
ComicBookUI [
<span class="cm" id="ComicBookUI_WindowMargin">top, right, bottom and left margin (in that order) between window and document</span>
WindowMargin = 0 0 0 0
<span class="cm" id="ComicBookUI_PageSpacing">horizontal and vertical distance between two pages in facing and book view modes</span>
PageSpacing = 4 4
<span class="cm" id="ComicBookUI_CbxMangaMode">if true, default to displaying Comic Book files in manga mode (from right to left if showing 2
pages at a time)</span>
CbxMangaMode = false
]
<span class="cm" id="ChmUI">customization options for CHM UI. If UseFixedPageUI is true, FixedPageUI settings apply instead</span>
ChmUI [
<span class="cm" id="ChmUI_UseFixedPageUI">if true, the UI used for PDF documents will be used for CHM documents as well</span>
UseFixedPageUI = false
]
<span class="cm" id="ExternalViewers">list of additional external viewers for various file types (can have multiple entries for the same
format)</span>
ExternalViewers [
[
<span class="cm" id="ExternalViewers_CommandLine">command line with which to call the external viewer, may contain %p for page number and
"%1" for the file name (add quotation marks around paths containing spaces)</span>
CommandLine =
<span class="cm" id="ExternalViewers_Name">name of the external viewer to be shown in the menu (implied by CommandLine if missing)</span>
Name =
<span class="cm" id="ExternalViewers_Filter">optional filter for which file types the menu item is to be shown; separate multiple entries
using ';' and don't include any spaces (e.g. *.pdf;*.xps for all PDF and XPS
documents)</span>
Filter =
]
]
<span class="cm" id="ShowMenubar">if false, the menu bar will be hidden for all newly opened windows (use F9 to show it until the
window closes or Alt to show it just briefly), only applies if UseTabs is false (introduced in
version 2.5)</span>
ShowMenubar = true
<span class="cm" id="ReloadModifiedDocuments">if true, a document will be reloaded automatically whenever it's changed (currently doesn't
work for documents shown in the ebook UI) (introduced in version 2.5)</span>
ReloadModifiedDocuments = true
<span class="cm" id="FullPathInTitle">if true, we show the full path to a file in the title bar (introduced in version 3.0)</span>
FullPathInTitle = false
<span class="cm" id="ZoomLevels">sequence of zoom levels when zooming in/out; all values must lie between 8.33 and 6400</span>
ZoomLevels = 8.33 12.5 18 25 33.33 50 66.67 75 100 125 150 200 300 400 600 800 1000 1200 1600 2000 2400 3200 4800 6400
<span class="cm" id="ZoomIncrement">zoom step size in percents relative to the current zoom level. if zero or negative, the values from
ZoomLevels are used instead</span>
ZoomIncrement = 0
<span class="cm" id="PrinterDefaults">these override the default settings in the Print dialog</span>
PrinterDefaults [
<span class="cm" id="PrinterDefaults_PrintScale">default value for scaling (shrink, fit, none)</span>
PrintScale = shrink
]
<span class="cm" id="ForwardSearch">customization options for how we show forward search results (used from LaTeX editors)</span>
ForwardSearch [
<span class="cm" id="ForwardSearch_HighlightOffset">when set to a positive value, the forward search highlight style will be changed to a rectangle
at the left of the page (with the indicated amount of margin from the page margin)</span>
HighlightOffset = 0
<span class="cm" id="ForwardSearch_HighlightWidth">width of the highlight rectangle (if HighlightOffset is > 0)</span>
HighlightWidth = 15
<span class="cm" id="ForwardSearch_HighlightColor"><a href="#color">color</a> used for the forward search highlight</span>
HighlightColor = #6581ff
<span class="cm" id="ForwardSearch_HighlightPermanent">if true, highlight remains visible until the next mouse click (instead of fading away
immediately)</span>
HighlightPermanent = false
]
<span class="cm" id="DefaultPasswords">a whitespace separated list of passwords to try when opening a password protected document
(passwords containing spaces must be quoted) (introduced in version 2.4)</span>
DefaultPasswords =
<span class="cm" id="CustomScreenDPI">actual resolution of the main screen in DPI (if this value isn't positive, the system's UI
setting is used) (introduced in version 2.5)</span>
CustomScreenDPI = 0
</div>
<span class="cm" id="RememberStatePerDocument">if true, we store display settings for each document separately (i.e. everything after
UseDefaultState in FileStates)</span>
RememberStatePerDocument = true
<span class="cm" id="UiLanguage"><a href="langs3.3.html">ISO code</a> of the current UI language</span>
UiLanguage =
<span class="cm" id="ShowToolbar">if true, we show the toolbar at the top of the window</span>
ShowToolbar = true
<span class="cm" id="ShowFavorites">if true, we show the Favorites sidebar</span>
ShowFavorites = false
<span class="cm" id="AssociatedExtensions">a list of extensions that SumatraPDF has associated itself with and will reassociate if a different
application takes over (e.g. ".pdf .xps .epub")</span>
AssociatedExtensions =
<span class="cm" id="AssociateSilently">whether file associations should be fixed silently or only after user feedback</span>
AssociateSilently = false
<span class="cm" id="CheckForUpdates">if true, we check once a day if an update is available</span>
CheckForUpdates = true
<span class="cm" id="VersionToSkip">we won't ask again to update to this version</span>
VersionToSkip =
<span class="cm" id="RememberOpenedFiles">if true, we remember which files we opened and their display settings</span>
RememberOpenedFiles = true
<span class="cm" id="InverseSearchCmdLine">pattern used to launch the LaTeX editor when doing inverse search</span>
InverseSearchCmdLine =
<span class="cm" id="EnableTeXEnhancements">if true, we expose the SyncTeX inverse search command line in Settings -> Options</span>
EnableTeXEnhancements = false
<span class="cm" id="DefaultDisplayMode">default layout of pages. valid values: automatic, single page, facing, book view, continuous,
continuous facing, continuous book view</span>
DefaultDisplayMode = automatic
<span class="cm" id="DefaultZoom">default zoom (in %) or one of those values: fit page, fit width, fit content</span>
DefaultZoom = fit page
<span class="cm" id="WindowState">default state of the window. 1 is normal, 2 is maximized, 3 is fullscreen, 4 is minimized</span>
WindowState = 1
<span class="cm" id="WindowPos">default position (x, y) and size (width, height) of the window</span>
WindowPos = 0 0 0 0
<span class="cm" id="ShowToc">if true, we show table of contents (Bookmarks) sidebar if it's present in the document</span>
ShowToc = true
<span class="cm" id="SidebarDx">width of favorites/bookmarks sidebar (if shown)</span>
SidebarDx = 0
<span class="cm" id="TocDy">if both favorites and bookmarks parts of sidebar are visible, this is the height of bookmarks (table
of contents) part</span>
TocDy = 0
<span class="cm" id="TreeFontSize">font size for bookmarks and favorites tree views. 0 means Windows default (introduced in version
3.3)</span>
TreeFontSize = 0
<span class="cm" id="ShowStartPage">if true, we show a list of frequently read documents when no document is loaded</span>
ShowStartPage = true
<span class="cm" id="UseTabs">if true, documents are opened in tabs instead of new windows (introduced in version 3.0)</span>
UseTabs = true
<span class="cm" id="FileStates">information about opened files (in most recently used order)</span>
FileStates [
[
<span class="cm" id="FileStates_FilePath">path of the document</span>
FilePath =
<span class="cm" id="FileStates_Favorites">Values which are persisted for bookmarks/favorites</span>
Favorites [
[
<span class="cm" id="Favorites_Name">name of this favorite as shown in the menu</span>
Name =
<span class="cm" id="Favorites_PageNo">number of the bookmarked page</span>
PageNo = 0
<span class="cm" id="Favorites_PageLabel">label for this page (only present if logical and physical page numbers are not the same)</span>
PageLabel =
]
]
<span class="cm" id="FileStates_IsPinned">a document can be "pinned" to the Frequently Read list so that it isn't displaced by
recently opened documents</span>
IsPinned = false
<span class="cm" id="FileStates_IsMissing">if true, the file is considered missing and won't be shown in any list</span>
IsMissing = false
<span class="cm" id="FileStates_OpenCount">number of times this document has been opened recently</span>
OpenCount = 0
<span class="cm" id="FileStates_DecryptionKey">data required to open a password protected document without having to ask for the password again</span>
DecryptionKey =
<span class="cm" id="FileStates_UseDefaultState">if true, we use global defaults when opening this file (instead of the values below)</span>
UseDefaultState = false
<span class="cm" id="FileStates_DisplayMode">layout of pages. valid values: automatic, single page, facing, book view, continuous, continuous
facing, continuous book view</span>
DisplayMode = automatic
<span class="cm" id="FileStates_ScrollPos">how far this document has been scrolled (in x and y direction)</span>
ScrollPos = 0 0
<span class="cm" id="FileStates_PageNo">number of the last read page</span>
PageNo = 1
<span class="cm" id="FileStates_Zoom">zoom (in %) or one of those values: fit page, fit width, fit content</span>
Zoom = fit page
<span class="cm" id="FileStates_Rotation">how far pages have been rotated as a multiple of 90 degrees</span>
Rotation = 0
<span class="cm" id="FileStates_WindowState">state of the window. 1 is normal, 2 is maximized, 3 is fullscreen, 4 is minimized</span>
WindowState = 0
<span class="cm" id="FileStates_WindowPos">default position (can be on any monitor)</span>
WindowPos = 0 0 0 0
<span class="cm" id="FileStates_ShowToc">if true, we show table of contents (Bookmarks) sidebar if it's present in the document</span>
ShowToc = true
<span class="cm" id="FileStates_SidebarDx">width of the left sidebar panel containing the table of contents</span>
SidebarDx = 0
<span class="cm" id="FileStates_DisplayR2L">if true, the document is displayed right-to-left in facing and book view modes (only used for
comic book documents)</span>
DisplayR2L = false
<span class="cm" id="FileStates_ReparseIdx">data required to restore the last read page in the ebook UI</span>
ReparseIdx = 0
<span class="cm" id="FileStates_TocState">data required to determine which parts of the table of contents have been expanded</span>
TocState =
]
]
<span class="cm" id="SessionData">state of the last session, usage depends on RestoreSession (introduced in version 3.1)</span>
SessionData [
[
<span class="cm" id="SessionData_TabStates">data required for restoring the view state of a single tab</span>
TabStates [
[
<span class="cm" id="TabStates_FilePath">path of the document</span>
FilePath =
<span class="cm" id="TabStates_DisplayMode">same as FileStates -> DisplayMode</span>
DisplayMode = automatic
<span class="cm" id="TabStates_PageNo">number of the last read page</span>
PageNo = 1
<span class="cm" id="TabStates_Zoom">same as FileStates -> Zoom</span>
Zoom = fit page
<span class="cm" id="TabStates_Rotation">same as FileStates -> Rotation</span>
Rotation = 0
<span class="cm" id="TabStates_ScrollPos">how far this document has been scrolled (in x and y direction)</span>
ScrollPos = 0 0
<span class="cm" id="TabStates_ShowToc">if true, the table of contents was shown when the document was closed</span>
ShowToc = true
<span class="cm" id="TabStates_TocState">same as FileStates -> TocState</span>
TocState =
]
]
<span class="cm" id="SessionData_TabIndex">index of the currently selected tab (1-based)</span>
TabIndex = 1
<span class="cm" id="SessionData_WindowState">same as FileState -> WindowState</span>
WindowState = 0
<span class="cm" id="SessionData_WindowPos">default position (can be on any monitor)</span>
WindowPos = 0 0 0 0
<span class="cm" id="SessionData_SidebarDx">width of favorites/bookmarks sidebar (if shown)</span>
SidebarDx = 0
]
]
<span class="cm" id="ReopenOnce">data required for reloading documents after an auto-update (introduced in version 3.0)</span>
ReopenOnce =
<span class="cm" id="TimeOfLastUpdateCheck">data required to determine when SumatraPDF last checked for updates</span>
TimeOfLastUpdateCheck = 0 0
<span class="cm" id="OpenCountWeek">value required to determine recency for the OpenCount value in FileStates</span>
OpenCountWeek = 0
</pre>
<div class="desc">
<h3 id="color">Syntax for color values</h3>
<p>
The syntax for colors is: <code>#rrggbb</code>.</p>
<p>The components are hex values (ranging from 00 to FF) and stand for:
<ul>
<li><code>rr</code> : red component</li>
<li><code>gg</code> : green component</li>
<li><code>bb</code> : blue component</li>
</ul>
For example #ff0000 means red color. You can use <a href="https://galactic.ink/sphere/">Sphere</a> to pick a color.
</p>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
/*
* 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.aliyuncs.drds.model.v20171016;
import com.aliyuncs.RpcAcsRequest;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.drds.Endpoint;
/**
* @author auto create
* @version
*/
public class DescribeDrdsInstancesRequest extends RpcAcsRequest<DescribeDrdsInstancesResponse> {
private String type;
private String tags;
public DescribeDrdsInstancesRequest() {
super("Drds", "2017-10-16", "DescribeDrdsInstances", "Drds");
setMethod(MethodType.POST);
try {
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap);
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType);
} catch (Exception e) {}
}
public String getType() {
return this.type;
}
public void setType(String type) {
this.type = type;
if(type != null){
putQueryParameter("Type", type);
}
}
public String getTags() {
return this.tags;
}
public void setTags(String tags) {
this.tags = tags;
if(tags != null){
putQueryParameter("Tags", tags);
}
}
@Override
public Class<DescribeDrdsInstancesResponse> getResponseClass() {
return DescribeDrdsInstancesResponse.class;
}
}
|
{
"pile_set_name": "Github"
}
|
/***
*wcschr.c - search a wchar_t string for a given wchar_t character
*
* Copyright (C) 2009-2010 Intel Corporation. All rights reserved.
*
* The information and source code contained herein is the exclusive
* property of Intel Corporation and may not be disclosed, examined
* or reproduced in whole or in part without explicit written authorization
* from the company.
*
*Purpose:
* defines wcschr() - search a wchar_t string for a wchar_t character
*
*******************************************************************************/
#include <vcruntime_internal.h>
#include <intrin.h>
#define XMM_SIZE sizeof(__m128i)
#define XMM_CHARS (XMM_SIZE / sizeof(wchar_t))
#define PAGE_SIZE ((intptr_t)0x1000)
#define PAGE_OFFSET(p) ((PAGE_SIZE-1) & (intptr_t)(p))
#define XMM_PAGE_SAFE(p) (PAGE_OFFSET(p) <= (PAGE_SIZE - XMM_SIZE))
/***
*wchar_t *wcschr(string, c) - search a string for a wchar_t character
*
*Purpose:
* Searches a wchar_t string for a given wchar_t character,
* which may be the null character L'\0'.
*
*Entry:
* wchar_t *string - wchar_t string to search in
* wchar_t c - wchar_t character to search for
*
*Exit:
* returns pointer to the first occurrence of c in string
* returns NULL if c does not occur in string
*
*Exceptions:
*
*******************************************************************************/
wchar_t * __cdecl wcschr (
const wchar_t * string,
wchar_t ch
)
{
__m128i match, characters, temp;
unsigned mask;
unsigned long offset;
// Build match pattern with target character in every position.
match = _mm_cvtsi32_si128(ch);
match = _mm_shufflelo_epi16(match, 0);
match = _mm_shuffle_epi32(match, 0);
for (;;)
{
// If the next XMMWORD does not overlap a page boundary check
// it for match of character or zero.
if (XMM_PAGE_SAFE(string))
{
// Check for match with either the search or zero character.
// There may be more than one match, but only the first is
// significant.
characters = _mm_loadu_si128((__m128i*)string);
temp = _mm_xor_si128(temp, temp);
temp = _mm_cmpeq_epi16(temp, characters);
characters = _mm_cmpeq_epi16(characters, match);
temp = _mm_or_si128(temp, characters);
mask = _mm_movemask_epi8(temp);
// If one or more matches was found, get the position of
// the first one. If that character is the same as the
// search character return the pointer to it, otherwise
// it must be the terminating zero so return NULL.
if (mask != 0)
{
_BitScanForward(&offset, mask);
string = (wchar_t *)(offset + (intptr_t)string);
return (*string == ch) ? (wchar_t *)string : NULL;
}
// No match found in this XMMWORD so skip to next.
string += XMM_CHARS;
}
else
{
// If it is not safe to check an entire XMMWORD, check
// a single character and try again.
if (*string == ch) return (wchar_t *)string;
if (*string == 0) return NULL;
// No match so skip to next character.
++string;
}
}
}
|
{
"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.hudi.testutils.providers;
import org.apache.hudi.client.HoodieWriteClient;
import org.apache.hudi.config.HoodieWriteConfig;
import java.io.IOException;
public interface HoodieWriteClientProvider {
HoodieWriteClient getHoodieWriteClient(HoodieWriteConfig cfg) throws IOException;
}
|
{
"pile_set_name": "Github"
}
|
- name: enable compute service
changed_when: false
shell: |
set -o pipefail
set -xe
# get the status of all nova-compute servies in json format
services=$(openstack compute service list \
--service nova-compute -c Host -c Status -f json)
# filter status results for only hosts that have disabled services
disabled=$(echo ${services} | \
jq -r '.[] | select(.Status == "disabled") .Host')
# enable nova-compute services on disabled hosts
echo "${disabled}" | \
xargs -n 1 -I % openstack compute service set --enable % nova-compute
args:
executable: /bin/bash
environment:
"{{ cloud_vars | osadmin() }}"
|
{
"pile_set_name": "Github"
}
|
// Symbian-specific file.
// INCLUDE FILES
#include "private/gcconfig.h"
#ifdef __cplusplus
extern "C" {
#endif
int winscw_data_end;
#ifdef __cplusplus
}
#endif
// End Of File
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-spring-cloud-config</artifactId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>log4j-spring-cloud-config-client</artifactId>
<packaging>jar</packaging>
<name>Apache Log4j Spring Cloud Config Client Support</name>
<description>Apache Log4j Spring Cloud Config Client Support</description>
<properties>
<log4jParentDir>${basedir}/../..</log4jParentDir>
<docLabel>Log4j Spring Cloud Config Client Documentation</docLabel>
<projectDir>/log4j-spring-cloud-config-client</projectDir>
<module.name>org.apache.logging.log4j.spring.cloud.config.client</module.name>
</properties>
<dependencies>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-bus</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Include the standard NOTICE and LICENSE -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>org.apache.logging.log4j.spring.cloud.config.controller</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>${changes.plugin.version}</version>
<reportSets>
<reportSet>
<reports>
<report>changes-report</report>
</reports>
</reportSet>
</reportSets>
<configuration>
<issueLinkTemplate>%URL%/%ISSUE%</issueLinkTemplate>
<useJql>true</useJql>
<component>Spring</component>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.plugin.version}</version>
<configuration>
<!--<propertiesLocation>${vfs.parent.dir}/checkstyle.properties</propertiesLocation> -->
<configLocation>${log4jParentDir}/checkstyle.xml</configLocation>
<suppressionsLocation>${log4jParentDir}/checkstyle-suppressions.xml</suppressionsLocation>
<enableRulesSummary>false</enableRulesSummary>
<propertyExpansion>basedir=${basedir}</propertyExpansion>
<propertyExpansion>licensedir=${log4jParentDir}/checkstyle-header.txt</propertyExpansion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.plugin.version}</version>
<configuration>
<bottom><![CDATA[<p align="center">Copyright © {inceptionYear}-{currentYear} {organizationName}. All Rights Reserved.<br />
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo,
and the Apache Log4j logo are trademarks of The Apache Software Foundation.</p>]]></bottom>
<!-- module link generation is completely broken in the javadoc plugin for a multi-module non-aggregating
project -->
<detectOfflineLinks>false</detectOfflineLinks>
<linksource>true</linksource>
<source>8</source>
</configuration>
<reportSets>
<reportSet>
<id>non-aggregate</id>
<reports>
<report>javadoc</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>${jxr.plugin.version}</version>
<reportSets>
<reportSet>
<id>non-aggregate</id>
<reports>
<report>jxr</report>
</reports>
</reportSet>
<reportSet>
<id>aggregate</id>
<reports>
<report>aggregate</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${pmd.plugin.version}</version>
<configuration>
<targetJdk>${maven.compiler.target}</targetJdk>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
|
{
"pile_set_name": "Github"
}
|
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. 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 apmhttputil_test
import (
"crypto/tls"
"encoding/json"
"net/http"
"testing"
"github.com/stretchr/testify/assert"
"go.elastic.co/apm/internal/apmhttputil"
"go.elastic.co/apm/model"
"go.elastic.co/fastjson"
)
func TestRequestURLClient(t *testing.T) {
req := mustNewRequest("https://user:pass@host.invalid:9443/path?query&querier=foo#fragment")
assert.Equal(t, model.URL{
Protocol: "https",
Hostname: "host.invalid",
Port: "9443",
Path: "/path",
Search: "query&querier=foo",
Hash: "fragment",
}, apmhttputil.RequestURL(req))
}
func TestRequestURLServer(t *testing.T) {
req := mustNewRequest("/path?query&querier=foo")
req.Host = "host.invalid:8080"
assert.Equal(t, model.URL{
Protocol: "http",
Hostname: "host.invalid",
Port: "8080",
Path: "/path",
Search: "query&querier=foo",
}, apmhttputil.RequestURL(req))
}
func TestRequestURLServerTLS(t *testing.T) {
req := mustNewRequest("/path?query&querier=foo")
req.Host = "host.invalid:8080"
req.TLS = &tls.ConnectionState{}
assert.Equal(t, "https", apmhttputil.RequestURL(req).Protocol)
}
func TestRequestURLHeaders(t *testing.T) {
type test struct {
name string
full string
header http.Header
}
tests := []test{{
name: "Forwarded",
full: "https://forwarded.invalid:443/",
header: http.Header{"Forwarded": []string{"Host=\"forwarded.invalid:443\"; proto=HTTPS"}},
}, {
name: "Forwarded-Empty-Host",
full: "http://host.invalid/", // falls back to the next option
header: http.Header{"Forwarded": []string{""}},
}, {
name: "X-Forwarded-Host",
full: "http://x-forwarded-host.invalid/",
header: http.Header{"X-Forwarded-Host": []string{"x-forwarded-host.invalid"}},
}, {
name: "X-Forwarded-Proto",
full: "https://host.invalid/",
header: http.Header{"X-Forwarded-Proto": []string{"https"}},
}, {
name: "X-Forwarded-Protocol",
full: "https://host.invalid/",
header: http.Header{"X-Forwarded-Protocol": []string{"https"}},
}, {
name: "X-Url-Scheme",
full: "https://host.invalid/",
header: http.Header{"X-Url-Scheme": []string{"https"}},
}, {
name: "Front-End-Https",
full: "https://host.invalid/",
header: http.Header{"Front-End-Https": []string{"on"}},
}, {
name: "X-Forwarded-Ssl",
full: "https://host.invalid/",
header: http.Header{"X-Forwarded-Ssl": []string{"on"}},
}}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
req := mustNewRequest("/")
req.Host = "host.invalid"
req.Header = test.header
out := apmhttputil.RequestURL(req)
// Marshal the URL to gets its "full" representation.
var w fastjson.Writer
err := out.MarshalFastJSON(&w)
assert.NoError(t, err)
var decoded struct {
Full string
}
err = json.Unmarshal(w.Bytes(), &decoded)
assert.NoError(t, err)
assert.Equal(t, test.full, decoded.Full)
})
}
}
func mustNewRequest(url string) *http.Request {
req, err := http.NewRequest("GET", url, nil)
if err != nil {
panic(err)
}
return req
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2017 Google
*
* 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.
*/
#import "FIRAdditionalUserInfo.h"
NS_ASSUME_NONNULL_BEGIN
@interface FIRAdditionalUserInfo () <NSSecureCoding>
/** @fn userInfoWithVerifyAssertionResponse:
@brief A convenience factory method for constructing a @c FIRAdditionalUserInfo instance from
data returned by the verifyAssertion endpoint.
@param verifyAssertionResponse Data returned by the verifyAssertion endpoint.
@return A new instance of @c FIRAdditionalUserInfo using data from the verifyAssertion endpoint.
*/
+ (nullable instancetype)userInfoWithVerifyAssertionResponse:
(FIRVerifyAssertionResponse *)verifyAssertionResponse;
/** @fn initWithProviderID:profile:username:
@brief Designated initializer.
@param providerID The provider identifier.
@param profile Dictionary containing the additional IdP specific information.
@param username The name of the user.
@param isNewUser Indicates whether or not the current user was signed in for the first time.
*/
- (nullable instancetype)initWithProviderID:(nullable NSString *)providerID
profile:(nullable NSDictionary<NSString *, NSObject *> *)profile
username:(nullable NSString *)username
isNewUser:(BOOL)isNewUser NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
|
{
"pile_set_name": "Github"
}
|
[rutorrent]
title="ruTorrent"
desc="ruTorrent"
port_forward="yes"
dst.ports="8050/tcp"
|
{
"pile_set_name": "Github"
}
|
package org.estatio.module.capex.dom.documents.categorisation;
import org.apache.isis.applib.annotation.Mixin;
import org.incode.module.document.dom.impl.docs.Document;
import org.estatio.module.task.dom.dobj.DomainObject_currentStateAbstract;
import org.estatio.module.invoice.dom.DocumentTypeData;
/**
* This cannot be inlined (needs to be a mixin) because Document is part of the incode platform and
* does not know about its categorisation state.
*/
@Mixin(method="prop")
public class Document_categorisationState
extends DomainObject_currentStateAbstract<
Document,
IncomingDocumentCategorisationStateTransition,
IncomingDocumentCategorisationStateTransitionType,
IncomingDocumentCategorisationState> {
public Document_categorisationState(final Document document) {
super(document, IncomingDocumentCategorisationStateTransition.class);
}
// necessary because Isis' metamodel unable to infer return type from generic method
@Override
public IncomingDocumentCategorisationState prop() {
return super.prop();
}
public boolean hideProp() {
return !DocumentTypeData.hasIncomingType(domainObject);
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.lang.management;
import javax.management.ObjectName;
/**
* A platform managed object is a {@linkplain javax.management.MXBean JMX MXBean}
* for monitoring and managing a component in the Java platform.
* Each platform managed object has a unique
* <a href="ManagementFactory.html#MXBean">object name</a>
* for the {@linkplain ManagementFactory#getPlatformMBeanServer
* platform MBeanServer} access.
* All platform MXBeans will implement this interface.
*
* <p>
* Note:
* The platform MXBean interfaces (i.e. all subinterfaces
* of {@code PlatformManagedObject}) are implemented
* by the Java platform only. New methods may be added in these interfaces
* in future Java SE releases.
* In addition, this {@code PlatformManagedObject} interface is only
* intended for the management interfaces for the platform to extend but
* not for applications.
*
* @see ManagementFactory
* @since 1.7
*/
public interface PlatformManagedObject {
/**
* Returns an {@link ObjectName ObjectName} instance representing
* the object name of this platform managed object.
*
* @return an {@link ObjectName ObjectName} instance representing
* the object name of this platform managed object.
*/
public ObjectName getObjectName();
}
|
{
"pile_set_name": "Github"
}
|
module.exports = function (casper, scenario, vp) {
require('./loadCookies')(casper, scenario);
casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36');
};
|
{
"pile_set_name": "Github"
}
|
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2015 Benoit Steiner <benoit.steiner.goog@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_TYPE_CASTING_AVX_H
#define EIGEN_TYPE_CASTING_AVX_H
namespace Eigen {
namespace internal {
// For now we use SSE to handle integers, so we can't use AVX instructions to cast
// from int to float
template <>
struct type_casting_traits<float, int> {
enum {
VectorizedCast = 0,
SrcCoeffRatio = 1,
TgtCoeffRatio = 1
};
};
template <>
struct type_casting_traits<int, float> {
enum {
VectorizedCast = 0,
SrcCoeffRatio = 1,
TgtCoeffRatio = 1
};
};
template<> EIGEN_STRONG_INLINE Packet8i pcast<Packet8f, Packet8i>(const Packet8f& a) {
return _mm256_cvtps_epi32(a);
}
template<> EIGEN_STRONG_INLINE Packet8f pcast<Packet8i, Packet8f>(const Packet8i& a) {
return _mm256_cvtepi32_ps(a);
}
} // end namespace internal
} // end namespace Eigen
#endif // EIGEN_TYPE_CASTING_AVX_H
|
{
"pile_set_name": "Github"
}
|
/*
Copyright 2019 Adobe. All rights reserved.
This file is licensed 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 REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
@import '../commons/index.css';
.spectrum-Table {
border-collapse: separate;
border-spacing: 0;
}
.spectrum-Table-sortedIcon {
display: none;
margin-inline-start: var(--spectrum-table-header-sort-icon-gap);
vertical-align: middle;
transition: transform var(--spectrum-global-animation-duration-100) ease-in-out;
}
.spectrum-Table-headCell {
box-sizing: border-box;
text-align: start;
font-size: var(--spectrum-table-header-text-size);
font-weight: var(--spectrum-table-header-text-font-weight);
line-height: var(--spectrum-table-header-text-line-height);
min-block-size: var(--spectrum-table-header-min-height);
letter-spacing: var(--spectrum-table-header-text-letter-spacing);
text-transform: uppercase;
padding-block: var(--spectrum-table-header-padding-y);
padding-inline: var(--spectrum-table-header-padding-x);
transition: color var(--spectrum-global-animation-duration-100) ease-in-out;
cursor: default;
outline: 0;
border-radius: var(--spectrum-table-header-border-radius);
&.is-sortable {
cursor: pointer;
}
&.is-sorted-asc,
&.is-sorted-desc {
.spectrum-Table-sortedIcon {
display: inline-block;
/* offset icon because it's not properly aligned */
margin-block-start: calc(var(--spectrum-global-dimension-size-25) * -1);
}
}
&.is-sorted-asc {
.spectrum-Table-sortedIcon {
transform: rotateZ(180deg);
}
}
}
.spectrum-Table-cell--alignCenter {
text-align: center;
}
.spectrum-Table-cell--alignRight {
text-align: end;
}
/* Helper for shared drop target overlay */
%drop-target {
&::before {
content: '';
position: absolute;
inset-block-start: 0;
inset-inline-start: 0;
inset-block-end: 0;
inset-inline-end: 0;
z-index: 1;
}
}
.spectrum-Table-body {
position: relative;
border-width: var(--spectrum-table-border-size);
border-radius: var(--spectrum-table-border-radius);
overflow: auto;
vertical-align: var(--spectrum-table-cell-vertical-alignment);
&.is-drop-target {
@inherit: %drop-target;
}
}
/* The tbody tag doesn't allow setting a border-radius, so these hacks are to make that work
by putting it on the individual cells instead. */
.spectrum-Table:not(.spectrum-Table--quiet) {
tbody.spectrum-Table-body {
border-width: var(--spectrum-table-border-size);
border-radius: var(--spectrum-table-border-radius);
.spectrum-Table-row:first-child .spectrum-Table-cell:first-child {
border-start-start-radius: var(--spectrum-table-border-radius);
}
.spectrum-Table-row:first-child .spectrum-Table-cell:last-child {
border-start-end-radius: var(--spectrum-table-border-radius);
}
.spectrum-Table-row:last-child .spectrum-Table-cell:first-child {
border-end-start-radius: var(--spectrum-table-border-radius);
}
.spectrum-Table-row:last-child .spectrum-Table-cell:last-child {
border-end-end-radius: var(--spectrum-table-border-radius);
}
}
}
.spectrum-Table-cell {
box-sizing: border-box;
font-size: var(--spectrum-table-cell-text-size);
font-weight: var(--spectrum-table-cell-text-font-weight);
line-height: var(--spectrum-table-cell-text-line-height);
padding-block: var(--spectrum-table-cell-padding-y);
padding-inline: var(--spectrum-table-cell-padding-x);
/* Subtract top/bottom padding for this value to be correct in this implementation */
min-block-size: calc(var(--spectrum-table-cell-min-height) - calc(var(--spectrum-table-cell-padding-y) * 2));
}
.spectrum-Table-cell,
.spectrum-Table-headCell {
position: relative;
&:focus-ring,
&.is-focused {
outline: none;
&::before {
content: '';
/* Float above border */
z-index: 1;
position: absolute;
inset-block-start: 0;
inset-inline-end: 0;
inset-block-end: 0;
inset-inline-start: 0;
border-radius: calc(var(--spectrum-table-cell-border-radius-key-focus) - 1px);
}
}
}
.spectrum-Table-headCell {
&:focus-ring,
&.is-focused {
&::before {
inset-block-start: var(--spectrum-table-border-size);
inset-inline-end: var(--spectrum-table-border-size);
inset-block-end: var(--spectrum-table-border-size);
inset-inline-start: var(--spectrum-table-border-size);
}
}
}
.spectrum-Table-cell--divider {
border-inline-end-width: var(--spectrum-table-divider-border-size);
}
.spectrum-Table-row {
position: relative;
cursor: pointer;
transition: background-color var(--spectrum-global-animation-duration-100) ease-in-out;
&:focus {
outline: 0;
}
&.is-drop-target {
@inherit: %drop-target;
}
}
.spectrum-Table > .spectrum-Table-body > .spectrum-Table-row:last-of-type {
border-block-end-style: none;
}
.spectrum-Table--quiet {
.spectrum-Table-body {
border-radius: var(--spectrum-table-quiet-border-radius);
}
.spectrum-Table-body,
.spectrum-Table-row {
&.is-drop-target {
&::before {
border-radius: var(--spectrum-border-radius);
}
}
}
}
.spectrum-Table-checkboxCell {
padding-inline-end: var(--spectrum-table-cell-checkbox-padding-right);
/* have to eliminate vertical padding to allow proper vertical alignment */
padding-block-start: 0px;
padding-block-end: 0px;
vertical-align: var(--spectrum-table-cell-checkbox-vertical-alignment);
}
.spectrum-Table-checkbox {
vertical-align: super;
}
|
{
"pile_set_name": "Github"
}
|
#!/bin/sh
#
# udev This is a minimal non-LSB version of a UDEV startup script. It
# was derived by stripping down the udev-058 LSB version for use
# with buildroot on embedded hardware using Linux 2.6.34+ kernels.
#
# You may need to customize this for your system's resource limits
# (including startup time!) and administration. For example, if
# your early userspace has a custom initramfs or initrd you might
# need /dev much earlier; or without hotpluggable busses (like USB,
# PCMCIA, MMC/SD, and so on) your /dev might be static after boot.
#
# This script assumes your system boots right into the eventual root
# filesystem, and that init runs this udev script before any programs
# needing more device nodes than the bare-bones set -- /dev/console,
# /dev/zero, /dev/null -- that's needed to boot and run this script.
#
# Check for config file and read it
UDEV_CONFIG=/etc/udev/udev.conf
test -r $UDEV_CONFIG || exit 6
. $UDEV_CONFIG
case "$1" in
start)
printf "Populating %s using udev: " "${udev_root:-/dev}"
[ -e /proc/sys/kernel/hotplug ] && printf '\000\000\000\000' > /proc/sys/kernel/hotplug
/sbin/udevd -d || { echo "FAIL"; exit 1; }
udevadm trigger --type=subsystems --action=add
udevadm trigger --type=devices --action=add
udevadm settle --timeout=30 || echo "udevadm settle failed"
echo "done"
;;
stop)
# Stop execution of events
udevadm control --stop-exec-queue
killall udevd
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0
|
{
"pile_set_name": "Github"
}
|
# This is an incomplete bundle fragment. Do not attempt to deploy.
services:
"flannel":
charm: "cs:~containers/flannel"
annotations:
"gui-x": "475"
"gui-y": "605"
relations:
- - "flannel:etcd"
- "etcd:db"
- - "flannel:cni"
- "kubernetes-master:cni"
- - "flannel:cni"
- "kubernetes-worker:cni"
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2017 MediaTek Inc.
* Author: Kevin Chen <kevin-cw.chen@mediatek.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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.
*/
#include <linux/clk-provider.h>
#include <linux/platform_device.h>
#include <dt-bindings/clock/mt6797-clk.h>
#include "clk-mtk.h"
#include "clk-gate.h"
static const struct mtk_gate_regs mm0_cg_regs = {
.set_ofs = 0x0104,
.clr_ofs = 0x0108,
.sta_ofs = 0x0100,
};
static const struct mtk_gate_regs mm1_cg_regs = {
.set_ofs = 0x0114,
.clr_ofs = 0x0118,
.sta_ofs = 0x0110,
};
#define GATE_MM0(_id, _name, _parent, _shift) { \
.id = _id, \
.name = _name, \
.parent_name = _parent, \
.regs = &mm0_cg_regs, \
.shift = _shift, \
.ops = &mtk_clk_gate_ops_setclr, \
}
#define GATE_MM1(_id, _name, _parent, _shift) { \
.id = _id, \
.name = _name, \
.parent_name = _parent, \
.regs = &mm1_cg_regs, \
.shift = _shift, \
.ops = &mtk_clk_gate_ops_setclr, \
}
static const struct mtk_gate mm_clks[] = {
GATE_MM0(CLK_MM_SMI_COMMON, "mm_smi_common", "mm_sel", 0),
GATE_MM0(CLK_MM_SMI_LARB0, "mm_smi_larb0", "mm_sel", 1),
GATE_MM0(CLK_MM_SMI_LARB5, "mm_smi_larb5", "mm_sel", 2),
GATE_MM0(CLK_MM_CAM_MDP, "mm_cam_mdp", "mm_sel", 3),
GATE_MM0(CLK_MM_MDP_RDMA0, "mm_mdp_rdma0", "mm_sel", 4),
GATE_MM0(CLK_MM_MDP_RDMA1, "mm_mdp_rdma1", "mm_sel", 5),
GATE_MM0(CLK_MM_MDP_RSZ0, "mm_mdp_rsz0", "mm_sel", 6),
GATE_MM0(CLK_MM_MDP_RSZ1, "mm_mdp_rsz1", "mm_sel", 7),
GATE_MM0(CLK_MM_MDP_RSZ2, "mm_mdp_rsz2", "mm_sel", 8),
GATE_MM0(CLK_MM_MDP_TDSHP, "mm_mdp_tdshp", "mm_sel", 9),
GATE_MM0(CLK_MM_MDP_COLOR, "mm_mdp_color", "mm_sel", 10),
GATE_MM0(CLK_MM_MDP_WDMA, "mm_mdp_wdma", "mm_sel", 11),
GATE_MM0(CLK_MM_MDP_WROT0, "mm_mdp_wrot0", "mm_sel", 12),
GATE_MM0(CLK_MM_MDP_WROT1, "mm_mdp_wrot1", "mm_sel", 13),
GATE_MM0(CLK_MM_FAKE_ENG, "mm_fake_eng", "mm_sel", 14),
GATE_MM0(CLK_MM_DISP_OVL0, "mm_disp_ovl0", "mm_sel", 15),
GATE_MM0(CLK_MM_DISP_OVL1, "mm_disp_ovl1", "mm_sel", 16),
GATE_MM0(CLK_MM_DISP_OVL0_2L, "mm_disp_ovl0_2l", "mm_sel", 17),
GATE_MM0(CLK_MM_DISP_OVL1_2L, "mm_disp_ovl1_2l", "mm_sel", 18),
GATE_MM0(CLK_MM_DISP_RDMA0, "mm_disp_rdma0", "mm_sel", 19),
GATE_MM0(CLK_MM_DISP_RDMA1, "mm_disp_rdma1", "mm_sel", 20),
GATE_MM0(CLK_MM_DISP_WDMA0, "mm_disp_wdma0", "mm_sel", 21),
GATE_MM0(CLK_MM_DISP_WDMA1, "mm_disp_wdma1", "mm_sel", 22),
GATE_MM0(CLK_MM_DISP_COLOR, "mm_disp_color", "mm_sel", 23),
GATE_MM0(CLK_MM_DISP_CCORR, "mm_disp_ccorr", "mm_sel", 24),
GATE_MM0(CLK_MM_DISP_AAL, "mm_disp_aal", "mm_sel", 25),
GATE_MM0(CLK_MM_DISP_GAMMA, "mm_disp_gamma", "mm_sel", 26),
GATE_MM0(CLK_MM_DISP_OD, "mm_disp_od", "mm_sel", 27),
GATE_MM0(CLK_MM_DISP_DITHER, "mm_disp_dither", "mm_sel", 28),
GATE_MM0(CLK_MM_DISP_UFOE, "mm_disp_ufoe", "mm_sel", 29),
GATE_MM0(CLK_MM_DISP_DSC, "mm_disp_dsc", "mm_sel", 30),
GATE_MM0(CLK_MM_DISP_SPLIT, "mm_disp_split", "mm_sel", 31),
GATE_MM1(CLK_MM_DSI0_MM_CLOCK, "mm_dsi0_mm_clock", "mm_sel", 0),
GATE_MM1(CLK_MM_DSI1_MM_CLOCK, "mm_dsi1_mm_clock", "mm_sel", 2),
GATE_MM1(CLK_MM_DPI_MM_CLOCK, "mm_dpi_mm_clock", "mm_sel", 4),
GATE_MM1(CLK_MM_DPI_INTERFACE_CLOCK, "mm_dpi_interface_clock",
"dpi0_sel", 5),
GATE_MM1(CLK_MM_LARB4_AXI_ASIF_MM_CLOCK, "mm_larb4_axi_asif_mm_clock",
"mm_sel", 6),
GATE_MM1(CLK_MM_LARB4_AXI_ASIF_MJC_CLOCK, "mm_larb4_axi_asif_mjc_clock",
"mjc_sel", 7),
GATE_MM1(CLK_MM_DISP_OVL0_MOUT_CLOCK, "mm_disp_ovl0_mout_clock",
"mm_sel", 8),
GATE_MM1(CLK_MM_FAKE_ENG2, "mm_fake_eng2", "mm_sel", 9),
GATE_MM1(CLK_MM_DSI0_INTERFACE_CLOCK, "mm_dsi0_interface_clock",
"clk26m", 1),
GATE_MM1(CLK_MM_DSI1_INTERFACE_CLOCK, "mm_dsi1_interface_clock",
"clk26m", 3),
};
static const struct of_device_id of_match_clk_mt6797_mm[] = {
{ .compatible = "mediatek,mt6797-mmsys", },
{}
};
static int clk_mt6797_mm_probe(struct platform_device *pdev)
{
struct clk_onecell_data *clk_data;
int r;
struct device_node *node = pdev->dev.of_node;
clk_data = mtk_alloc_clk_data(CLK_MM_NR);
mtk_clk_register_gates(node, mm_clks, ARRAY_SIZE(mm_clks),
clk_data);
r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
if (r)
dev_err(&pdev->dev,
"could not register clock provider: %s: %d\n",
pdev->name, r);
return r;
}
static struct platform_driver clk_mt6797_mm_drv = {
.probe = clk_mt6797_mm_probe,
.driver = {
.name = "clk-mt6797-mm",
.of_match_table = of_match_clk_mt6797_mm,
},
};
builtin_platform_driver(clk_mt6797_mm_drv);
|
{
"pile_set_name": "Github"
}
|
#
# Makefile for the linux YAFFS filesystem routines.
#
obj-$(CONFIG_YAFFS_FS) += yaffs.o
yaffs-y := yaffs_ecc.o yaffs_vfs.o yaffs_guts.o yaffs_checkptrw.o
yaffs-y += yaffs_packedtags1.o yaffs_packedtags2.o yaffs_nand.o
yaffs-y += yaffs_tagscompat.o yaffs_tagsvalidity.o
yaffs-y += yaffs_mtdif.o yaffs_mtdif1.o yaffs_mtdif2.o
yaffs-y += yaffs_nameval.o yaffs_attribs.o
yaffs-y += yaffs_allocator.o
yaffs-y += yaffs_yaffs1.o
yaffs-y += yaffs_yaffs2.o
yaffs-y += yaffs_bitmap.o
yaffs-y += yaffs_verify.o
|
{
"pile_set_name": "Github"
}
|
---
layout: page
title: "Q30515: /I Linker Option Should Read /INF"
permalink: /pubs/pc/reference/microsoft/kb/Q30515/
---
## Q30515: /I Linker Option Should Read /INF
Article: Q30515
Version(s): 3.61 3.65
Operating System: MS-DOS
Flags: ENDUSER | docerr
Last Modified: 18-OCT-1988
Pages 266 and 267 of the "Microsoft C Optimizing Compiler CodeView and
Utilities" manual for Versions 5.00 and 5.10 incorrectly list the
shortened name of the /INFORMATION option as /I.
If /I is given as an option, the result is an error stating that /I is
an unrecognized option.
The correct shortened name for /INFORMATION is /INF.
|
{
"pile_set_name": "Github"
}
|
:100000000C9440030C945D030C945D030C945D030D
:100010000C945D030C945D030C945D030C94100C24
:100020000C945D030C945D030C945D030C941E0E04
:100030000C945D030C945D030C945D030C945D03C0
:100040000C94C70F0C945D030C94470B0C94090B94
:100050000C945D030C945D030C945D030C945D03A0
:100060000C945D030C945D03D909E909070AE909B9
:100070000B0A2C0A110A170A1F0A301936193919E6
:100080003C19411949195319BA19BA19BA195B1906
:100090005D1966196F197719BA19BA19BA19BA1907
:1000A000BA197F19BA198919911994199D19A619A4
:1000B000AC19DC20DF20E420E720EA20ED20F0204E
:1000C000F320F620F920FC2008210821082108212E
:1000D00008210821082108210221FF2005213E0DC9
:1000E0000A002C52583A002C4275663A002C002C1B
:1000F00057506F733A002C002C4D506F733A003CF0
:10010000436865636B003C416C61726D003C486FF5
:100110006D65003C486F6C64003C52756E003C514C
:1001200075657565003C49646C65005D0D0A005B92
:10013000302E323A000D0A003D00244E005D0D0ABB
:10014000002046002054002047005B473830005B09
:100150004733005B4732005B4731005B4730005D4F
:100160000D0A005B544C4F3A005D0D0A002C005BF9
:100170004739323A005D0D0A002C003A0033300056
:100180003238005B47005D0D0A002C005B50524284
:100190003A00290D0A00206D61782074726176653D
:1001A0006C2C206465670020616363656C2C20649F
:1001B00065672F7365635E3200206D617820726120
:1001C00074652C206465672F736563002C2073743D
:1001D00065702F646567007A007900780020280038
:1001E0003D0024002028686F6D696E672070756C73
:1001F0006C2D6F66662C206D6D290D0A0020286815
:10020000617264206C696D6974732C20626F6F6C0D
:10021000290D0A2432323D002028736F6674206C49
:10022000696D6974732C20626F6F6C290D0A24321A
:10023000313D0020286175746F2073746172742CD5
:1002400020626F6F6C290D0A2432303D0020287225
:1002500065706F727420696E636865732C20626FBD
:100260006F6C290D0A2431343D002028617263200F
:10027000746F6C6572616E63652C20646567290D0F
:100280000A2431333D0020286A756E6374696F6EED
:1002900020646576696174696F6E2C2064656729D6
:1002A0000D0A2431323D00290D0A2431313D002050
:1002B00028737461747573207265706F7274206D29
:1002C00061736B3A00202870726F62652070696EEE
:1002D00020696E766572742C20626F6F6C290D0A2E
:1002E0002431303D0020286C696D69742070696E7E
:1002F0007320696E766572742C20626F6F6C290DA5
:100300000A24363D0020287374657020656E616292
:100310006C6520696E766572742C20626F6F6C2933
:100320000D0A24353D00290D0A24343D002028649F
:10033000697220706F727420696E76657274206DB8
:1003400061736B3A00290D0A24333D002028737431
:10035000657020706F727420696E76657274206D9E
:1003600061736B3A002028737465702069646C6552
:100370002064656C61792C206D736563290D0A24F6
:10038000323D002028737465702070756C73652C85
:100390002075736563290D0A24313D0024303D002A
:1003A00024242028766965772073657474696E67E4
:1003B00073290D0A2423202876696577202320706D
:1003C0006172616D6574657273290D0A2447202876
:1003D00076696577207061727365722073746174D9
:1003E00065290D0A24492028766965772062756998
:1003F0006C6420696E666F290D0A244E2028766988
:100400006577207374617274757020626C6F636BB2
:1004100073290D0A24783D76616C75652028736117
:1004200076652073657474696E67290D0A244E78A9
:100430003D6C696E65202873617665207374617206
:1004400074757020626C6F636B290D0A2443202839
:10045000636865636B2067636F6465206D6F6465B7
:10046000290D0A245820286B696C6C20616C61721C
:100470006D206C6F636B290D0A7E20286379636C95
:1004800065207374617274290D0A212028666565E0
:100490006420686F6C64290D0A3F202863757272AE
:1004A000656E7420737461747573290D0A637472B8
:1004B0006C2D7820287265736574290D0A000D0A69
:1004C000486F72757320302E32205B2724272066F8
:1004D0006F722068656C705D0D0A005D0D0A004446
:1004E000697361626C656400456E61626C6564008D
:1004F00043617574696F6E3A20556E6C6F636B65FE
:100500006400272448277C2724582720746F2075EF
:100510006E6C6F636B00526573657420746F20633B
:100520006F6E74696E7565005B000D0A0050726F26
:100530006265206661696C0041626F727420647547
:1005400072696E67206379636C6500486172642F1D
:10055000736F6674206C696D697400414C41524D33
:100560003A20000D0A00496E76616C696420676369
:100570006F64652049443A00556E646566696E652E
:10058000642066656564207261746500556E7375DC
:1005900070706F7274656420636F6D6D616E64005E
:1005A0004D6F64616C2067726F75702076696F6C37
:1005B0006174696F6E004C696E65206F7665726656
:1005C0006C6F7700486F6D696E67206E6F74206581
:1005D0006E61626C656400416C61726D206C6F636A
:1005E0006B004E6F742069646C6500454550524F36
:1005F0004D2072656164206661696C2E20557369B7
:100600006E672064656661756C74730056616C7505
:1006100065203C20332075736563005365747469ED
:100620006E672064697361626C65640056616C7505
:1006300065203C203000496E76616C6964207374DB
:100640006174656D656E7400426164206E756D62E3
:10065000657220666F726D617400457870656374B1
:10066000656420636F6D6D616E64206C6574746584
:1006700072006572726F723A20006F6B0D0A000093
:1006800011241FBECFEFD8E0DEBFCDBF11E0A0E048
:10069000B1E0E0ECF3E502C005900D92AE30B10799
:1006A000D9F716E0AEE0B1E001C01D92A53EB1075A
:1006B000E1F70E945F030C94DE290C9400000E9475
:1006C000D70A0E94C6190E9449100E94D2240E9493
:1006D000560C8EE1E7E3F5E0DF011D928A95E9F71C
:1006E00081E08093370578948091D40684FF03C01D
:1006F00081E080933805C1E00E949D0B0E94230594
:100700000E94A20B0E9496200E94181B0E941910A2
:100710000E944A1E0E943505109237051092390535
:100720008091D40681FF03C0C093470502C0109298
:1007300047050E94410DE0CFEF92FF921F93CF93A8
:10074000DF9300D000D0CDB7DEB77C01122F8091AF
:100750003805823021F149835A836B837C830E9460
:100760009F0C8091370581111AC00E94671B498137
:100770005A816B817C81882339F00E94340D498134
:100780005A816B817C81E7CF212FC7010E946F1BAB
:1007900080913805811103C088E0809338050F905F
:1007A0000F900F900F90DF91CF911F91FF90EF90DE
:1007B00008958F929F92AF92BF92CF92DF92EF9265
:1007C000FF924B015C0180913805823009F447C0EB
:1007D00020E030E040EA51E4C501B4010E947828ED
:1007E0000E947C270E9413276B017C010E94B20D9E
:1007F00020E030E04AE754E4C501B4010E947828C3
:100800004B015C0182E38C9DB0018D9D700D112424
:1008100080E090E00E943F279B01AC01C501B4013C
:100820000E942A260E947C270E941327CB010E9447
:100830003E1FC114D10499F00E949F0C21E0C21AFE
:10084000D1088091370581110AC08FEF90E722E02F
:10085000815090402040E1F700C00000EACFFF90B7
:10086000EF90DF90CF90BF90AF909F908F900895C2
:100870004F925F926F927F928F929F92AF92BF92B0
:10088000CF92DF92EF92FF920F931F93CF93DF935C
:1008900000D000D0CDB7DEB74C016A017B01722ECB
:1008A00080913805823009F49EC00E94B20D60909C
:1008B00047050E94A420882351F09FB7F8948091A7
:1008C00039058064809339059FBF0E949F0C8091F9
:1008D0003705811188C0272DB701A601C4010E94E8
:1008E0009C0381E0809348059FB7F8948091390577
:1008F0008260809339059FBF0E949F0C80913705CD
:10090000811171C080913805877FB1F780914805CA
:10091000813041F49FB7F8948091390580648093C9
:1009200039059FBF0E949F0C8091370581115BC0E4
:100930000E9419100E94181B0E944A1E09E415E02B
:1009400087E9A82E86E0B82E2401F8016191719103
:10095000819191918F01F5012191319141915191B5
:100960005F0129833A834B835C830E94412729815D
:100970003A814B815C810E94A626F20161937193BA
:10098000819391932F01F5E005351F07F1F6272D8F
:10099000B701A601C4010E949C039FB7F8948091FF
:1009A00039058260809339059FBF0E94B20D809106
:1009B0003705811118C0609247050F900F900F9076
:1009C0000F90DF91CF911F910F91FF90EF90DF90EB
:1009D000CF90BF90AF909F908F907F906F905F90DF
:1009E0004F900C9490220F900F900F900F90DF91EA
:1009F000CF911F910F91FF90EF90DF90CF90BF901C
:100A0000AF909F908F907F906F905F904F900895E0
:100A10008091390584FD16C09FB7F89480913905FF
:100A20008061809339059FBF80913805847351F0B0
:100A30009FB7F894809139058062809339059FBFF4
:100A40000C94EF0D08958EE3E5E5F5E0DF011D92CE
:100A50008A95E9F767E775E080E00E947F188111C9
:100A600003C087E00C94C3200895CF92DF92EF92E9
:100A7000FF920F931F93CF93DF9300D000D0CDB799
:100A8000DEB78BE3C82E85E0D82E97E9E92E96E0F5
:100A9000F92E0BE615E0F60161917191819191912A
:100AA0006F01F70121913191419151917F0129838A
:100AB0003A834B835C830E94412729813A814B8191
:100AC0005C810E94A626F8016193719381939193B2
:100AD0008F01F7E4CF16F5E0DF06E9F60F900F90EF
:100AE0000F900F90DF91CF911F910F91FF90EF909A
:100AF000DF90CF9008952F923F924F925F926F9226
:100B00007F928F929F92AF92BF92CF92DF92EF929D
:100B1000FF920F931F93CF93DF93CDB7DEB7A197CB
:100B20000FB6F894DEBF0FBECDBF5C018CE3E3E9E6
:100B3000F5E0DF011D928A95E9F78DE0E5E5F5E046
:100B4000A4E9B5E001900D928A95E1F71D8E00E0D1
:100B500010E0E12CF12C912C312CCC24C394D12C1D
:100B60008D8DF501E80FF11D90819E8F992309F479
:100B7000DCC09E8D91549A3108F0E0C48F5F8D8F58
:100B8000AE01475E5F4FBE01635E7F4FC5010E94AD
:100B90008C1E882309F4D4C4498C5A8C6B8C7C8CB1
:100BA000C301B2010E943D290E941327862E70E0E6
:100BB00080E090E00E9441279B01AC01C301B2019B
:100BC0000E942A2620E030E048EC52E40E94782877
:100BD0000E94DB280E941327BE8DB73419F0BD3464
:100BE000B9F059C0E1E08E1639F0F2E38F12B2C4C9
:100BF0002AE02093930508C03110A4C48092940584
:100C00002224239482E0382E6623B1F087E1ADC41C
:100C10006111FCCF82E1881689F18815D8F092E045
:100C2000891629F1A1E18A1629F1811093C421E0E6
:100C300020939B05B8E02B2EC601022C02C0880F22
:100C4000991F0A94E2F79C012E213F21232B01F1E9
:100C500085E18BC4B6E48B16A1F0E7E48E16A1F013
:100C6000F2E38F1277C491E09093A005E5CF8092D4
:100C70009B05E0CF81E080939F05DECF10929F051A
:100C8000DBCF10929E05D8CFA1E0A0939E05D4CFD4
:100C9000E82AF92A65CFBE8DB43579F0B83591F0E0
:100CA000B63409F057C44092A1055092A205609253
:100CB000A3057092A405212C11C08092C205A9E061
:100CC0002A2E0CC04092C3055092C4056092C505FF
:100CD0007092C605FAE02F2E99249394F601022C07
:100CE00002C0EE0FFF1F0A94E2F7FF8FEE8FCF01D5
:100CF00080239123892B09F027C481E693E0022CFD
:100D000002C0959587950A94E2F780FF09C020E01C
:100D100030E0A901C301B2010E94A22687FD16C4DA
:100D20008E8D9F8D082B192B1BCF992021F0311010
:100D300002C0E2E03E2E05FF0EC08091B205909108
:100D4000B305A091B405B091B50580389649A8497E
:100D5000B1050CF0FDC380919505813031F4F2E0CE
:100D60003F1232C000FFFCC32FC080915605811195
:100D70002BC000FF13C080919605813029F523E335
:100D800033E34BEC51E46091A1057091A205809191
:100D9000A3059091A4050E9478280EC020E030E0C1
:100DA00040E752E46091660570916705809168059F
:100DB000909169050E94A6266093A1057093A205F3
:100DC0008093A3059093A40510FD10C08091620547
:100DD00090916305A0916405B09165058093BE056F
:100DE0009093BF05A093C005B093C1058091930572
:100DF000813029F406FD02C08CE1B7C30F7B8091DE
:100E00009605813061F08CE0E7E7F5E0DE011D96A4
:100E100001900D928A95E1F7E7FC2DC034C073EC88
:100E2000A72E75E0B72EC12CD12C692C712CC301D3
:100E30000C2C02C0959587950A94E2F780FF10C0AC
:100E400023E333E34BEC51E4D5016D917D918D911A
:100E50009C910E947828F50160837183828393833B
:100E6000FFEFCF1ADF0A24E0A20EB11C83E0C81600
:100E7000D104E9F6C8CF80919A05873028F5909182
:100E80005B05981323C08090930592E0891629F0A2
:100E9000A8E08A1609F4D2C03DC1992009F48FC098
:100EA000C80180759927892B09F4A6CF6091B605F2
:100EB0007091B7058091B8059091B9050E943D29C0
:100EC0000E941327673058F08DE14FC3BE01635F66
:100ED0007F4F0E947F188111D6CF87E046C3809153
:100EE000B105843109F06DC00F7A662309F46FC033
:100EF00088248A94860EBE016F5F7F4F882D0E94E2
:100F00007F18882351F32090B10540908F055090B1
:100F100090056090910570909205FE0131966F01E9
:100F200063ECA62E65E0B62E8BE695E09F8F8E8F44
:100F3000E12CF12CA92DB0E0B9A3A8A388A199A117
:100F40000E2C02C0959587950A94E2F780FD42C069
:100F5000FFEFEF1AFF0A24E0C20ED11C84E0A80EB6
:100F6000B11CAE8DBF8D1496BF8FAE8FB3E0EB1664
:100F7000F10421F7F0909405E5E0FE1609F478C13C
:100F8000F2E03F12BAC1FF2009F475C120E030E061
:100F9000A9016091A1057091A2058091A30590918E
:100FA000A4050E94A226882309F4DAC221E0F216E1
:100FB00009F461C184E0F812A5C1911060C18AE111
:100FC000D4C2823009F0C6C207FDC4C28DCF809062
:100FD0009A0591CFB4E12B1226C0EE8DFF8D208DA6
:100FE000318D428D538D60817181828193810E9408
:100FF0002A26D5012D913D914D915C910E942A2682
:10100000F6016083718382839383F2E0EF12A0CFB5
:10101000A30192010E942A26D6016D937D938D93A0
:101020009C93139795CFF50180819181A281B38123
:10103000F60180839183A283B3838ACF992009F438
:10104000BECF40908F0550909005609091057090B4
:10105000920543ECE42E45E0F42E5BE6A52E55E028
:10106000B52EFE013D96FF8FEE8FC12CD12C892D20
:1010700090E099A388A388A199A10C2C02C0959512
:1010800087950A94E2F780FF27C0AE8DBF8D2D9122
:101090003D914D915C91F5016081718182819381D7
:1010A0000E942A26D7012D913D914D915C910E947D
:1010B0002A26F7016083718382839383F2E0CF1243
:1010C00015C0A30192010E942A26D7016D937D933A
:1010D0008D939C9313970AC0F501808D918DA28DFD
:1010E000B38DF70180839183A283B383FFEFCF1A7F
:1010F000DF0A24E0E20EF11C84E0A80EB11CAE8DE4
:10110000BF8D1496BF8FAE8FB3E0CB16D10409F01C
:10111000B2CFACC091100CC0E5E08E1609F494C0BB
:10112000F7E08F1609F49DC023E082129FC084C0AF
:101130002090970540908F05509090056090910504
:10114000709092052BE6A22E25E0B22E33ECE32E12
:1011500035E0F32ECE010D969F8F8E8FC12CD12CB2
:10116000A92DB0E0B9A3A8A388A199A10C2C02C015
:10117000959587950A94E2F780FD0BC0F501808173
:101180009181A281B381F70180839183A283B3838C
:101190003FC0F7E08F16E1F1211029C0D501589624
:1011A0002D913D914D915C915B97EE8DFF8D60810E
:1011B0007181828193810E942B26D7012D913D91CF
:1011C0004D915C910E942B26F7016083718382838D
:1011D0009383F2E0CF121CC0A30192010E942B2640
:1011E000D7016D937D938D939C93139711C0F50157
:1011F0002081318142815381D7016D917D918D9103
:101200009C910E942B26F7016083718382839383D4
:10121000FFEFCF1ADF0A24E0A20EB11C84E0E80E33
:10122000F11CAE8DBF8D1496BF8FAE8FB3E0CB1681
:10123000D10409F099CF70CF911001C0312CBE01BB
:101240006F5F7F4F86E007C0911001C0312CBE0157
:101250006F5F7F4F87E00E947F18882309F43DCE9F
:1012600005C080919405823008F076C1812C82CE31
:10127000911074C142C0911045C0312C40C02091E2
:10128000C3053091C4054091C5055091C6056091D4
:101290006B0570916C0580916D0590916E050E94B3
:1012A000A22681112FC02091C7053091C805409119
:1012B000C9055091CA0560916F05709170058091C4
:1012C0007105909172050E94A22681111BC0209188
:1012D000CB053091CC054091CD055091CE05609164
:1012E00073057091740580917505909176050E9443
:1012F000A226811107C081E238C1311003C00E7DE2
:101300001C7F02C00E7D107E012B09F02BC1809145
:1013100095058093560520E030E040E752E4609167
:10132000A1057091A2058091A3059091A4050E944A
:10133000782860936605709367058093680590939D
:1013400069058091C20580936A058091930581307B
:1013500051F46091B6057091B7058091B8059091F0
:10136000B9050E94D9038091980580935905809111
:101370009A0590915B05981759F080935B058CE076
:10138000FE013D96A7E7B5E001900D928A95E1F741
:1013900080919705809358058091930590E0FC011A
:1013A0003297E930F10508F057C0EC5CFF4F0C9420
:1013B0008429BE016F5F7F4F882D0E946117809145
:1013C0005B05881149C08CE0FE013196A7E7B5E0C6
:1013D00019C0332049F020E040E050E060E87FEBA6
:1013E00083EC95E00E949C0320E040E050E060E840
:1013F0007FEBCE0101960E949C038CE0FE013196AA
:10140000ABE6B5E001900D928A95E1F725C06BE659
:1014100075E086E003C06BE675E087E00E94611727
:101420001BC08CE0E3ECF5E0A3E8B5E0EBCF8CE08B
:10143000E3E8F5E0DF011D928A95E9F70DC08CE045
:10144000EBE3F5E0DF011D928A95E9F70E94181B96
:101450000E944A1E0E94350580919405809355058F
:10146000B2E03B1231C08130C1F088F0843019F510
:101470004091660550916705609168057091690516
:101480002091560583EC95E00E94380414C020E0BA
:1014900040E050E060E87FEB0AC040916605509163
:1014A000670560916805709169052091560583EC88
:1014B00095E00E949C038CE0E3ECF5E0ABE6B5E040
:1014C00001900D928A95E1F780919B0580935C05D0
:1014D000882369F00E94B20D1092470580915C0547
:1014E000823019F40E94080502C010925C056091D8
:1014F0009E0560935F0570E08091C20590E00E94B8
:10150000F30B80919F0580936005813039F480E072
:1015100090E00E94EC0D0E94CC0D06C081E090E0AE
:101520000E94EC0D0E94EF0D8091A0058130E1F446
:101530008091C20590E00E947F0C16C081E015C02A
:1015400082E013C088E111C089E10FC084E00DC0C2
:101550008BE10BC084E109C08EE107C08FE105C0BB
:1015600086E103C084E201C080E0A1960FB6F89442
:10157000DEBF0FBECDBFDF91CF911F910F91FF90C6
:10158000EF90DF90CF90BF90AF909F908F907F9023
:101590006F905F904F903F902F9008959091100121
:1015A00080911101891708F48058891B0895E0EC97
:1015B000F0E08081826080831092C50080E180939A
:1015C000C400E1ECF0E080818061808380818860EC
:1015D00080838081806880830895E0910F0191E08D
:1015E0009E0F903409F490E020910E01921305C0F3
:1015F0002091390524FFF8CF0895F0E0E153FA4F28
:10160000808390930F018091C10080628093C1001C
:1016100008951F920F920FB60F9211248F939F93EC
:10162000EF93FF9380910E01E82FF0E0E153FA4F22
:1016300090819093C6008F5F803409F480E080939E
:101640000E0190910F01891305C08091C1008F7D1B
:101650008093C100FF91EF919F918F910F900FBEEA
:101660000F901F901895909110018091110189178A
:1016700061F0E92FF0E0E15FF94F80819F5F9038E2
:1016800009F490E09093100108958FEF08951F9250
:101690000F920FB60F9211242F933F934F935F93A6
:1016A0006F937F938F939F93AF93BF93EF93FF932A
:1016B0008091C6008132B1F028F48831E1F40E94B3
:1016C00008052AC08F3341F08E37A9F49FB7F894EC
:1016D0008091390582600BC09FB7F89480913905DD
:1016E000816005C09FB7F894809139058860809328
:1016F00039059FBF11C0E091110191E09E0F903814
:1017000009F490E020911001921731F0F0E0E15FD0
:10171000F94F808390931101FF91EF91BF91AF91A9
:101720009F918F917F916F915F914F913F912F91F9
:101730000F900FBE0F901F9018958091110180930C
:10174000100108958AB18C638AB98BB1837C8BB9FF
:10175000F8941092B20083EF8093B30082E08093FC
:10176000B00086E08093B100E0E7F0E08081826025
:101770008083789408959BB1982B9BB908959BB171
:10178000809589238BB90895EF92FF920F931F9351
:10179000CF93DF931F92CDB7DEB78430E0F4E82E0D
:1017A000F12CF701EA5FFE4F80818823A1F08701C9
:1017B0000D56194F613039F469830E94BB0B698162
:1017C000F801608308C00E94BF0BF8011082F70186
:1017D000E157F94F10820F90DF91CF911F910F9138
:1017E000FF90EF900895CF93DF9300D0CDB7DEB791
:1017F00090913805923079F06A8389830E94340D84
:101800000E94B20D6A81898181500F900F90DF9103
:10181000CF910C94C40B0F900F90DF91CF9108954E
:101820001F920F920FB60F9211242F933F934F9355
:101830005F936F937F938F939F93AF93BF93CF9358
:10184000DF93EF93FF93809112018F5F80931201DA
:10185000811119C0C0E0D0E08C2FFE01ED56F94F88
:101860009081FE01E157F94F992319F090819F5F14
:10187000908390819F3F19F460E00E94C40B2196F1
:10188000C430D10549F7FF91EF91DF91CF91BF911E
:10189000AF919F918F917F916F915F914F913F9108
:1018A0002F910F900FBE0F901F901895EAE7F0E070
:1018B000808187608083ACE7B0E08C9180648C93FA
:1018C0008081806880838081806480830895909186
:1018D0007C00907F90937C0090917C00982B90935B
:1018E0007C0080917A00806480937A0080917A00F5
:1018F00086FDFCCF80917800909179000895CF9378
:10190000DF9300D000D01F92CDB7DEB70E94670CE6
:101910004AE050E0BE016F5F7F4F0E949929CE01DF
:1019200001960E94491F8AE091E00E94491F0F9092
:101930000F900F900F900F90DF91CF910895CF935C
:10194000C0913905CC2309F486C08C2F807639F1FB
:1019500081E080933805C6FF17C0C5FF02C08FEF36
:1019600001C08DEF0E94162181E00E9435219FB7B2
:10197000F894809139058F7E809339059FBF8091BF
:10198000390584FFFCCF03C08EEF0E9416219FB75C
:10199000F894809139058F79809339059FBFC4FFF2
:1019A00004C081E0809337055DC0C0FF0AC00E947B
:1019B000D5239FB7F894809139058E7F80933905A0
:1019C0009FBFC3FF15C080913805803149F480E284
:1019D000809338050E9467100E9489101092470575
:1019E0009FB7F89480913905877F809339059FBF11
:1019F000C1FF1DC080913805883089F480E1809353
:101A000038050E9489100E94CC0D8091D40681FF78
:101A100004C081E08093470502C0109247059FB73C
:101A2000F894809139058D7F809339059FBFC2FF5F
:101A300012C00E943D1B892B21F088E0809338055D
:101A400002C0109238059FB7F894809139058B7FBA
:101A5000809339059FBF80913805847319F0CF9129
:101A60000C948910CF91089580914705882341F007
:101A70009FB7F894809139058260809339059FBFA4
:101A80000895CF93DF930E945B21809138058130C8
:101A900021F482E00E94352121C01092380583E1B3
:101AA00091E00E94D3241AC08D3069F0DD2391F1BA
:101AB000D1E0893209F4D0E00E94330B8F3F09F462
:101AC00045C08A3089F7EC2FF0E0ED5EFE4F1082C2
:101AD0000E949F0C80913705882311F0C0E0EBCF66
:101AE00080911301811104C08CE00E94C320F6CFC5
:101AF000843229F483E191E00E94F224F6CF8091B0
:101B00003805813011F489E0F0CF83E191E00E9443
:101B10007B05EBCF813280F28F3271F28832A1F0F7
:101B2000CF3428F08BE00E94C320C0E0C5CF2C2F1B
:101B300030E0CF5F9FE9980FF901ED5EFE4F9A31DB
:101B400008F480528083B8CFD1E0B6CF0E94340D24
:101B50000E949F0C80913705882309F4ADCFDF9157
:101B6000CF9108950E94340D80913805803171F431
:101B700081E0809347050AC080913805803159F48F
:101B80000E949F0C80913705811105C00E943D1B6A
:101B9000892BB1F7F1CF08958091D40682FF02C05E
:101BA000299A01C02998809138058471A1F080910B
:101BB00094018093A801809195018093A701809161
:101BC000C706880F845081958093A60180916F008D
:101BD000826080936F0008958093920108958091B0
:101BE0006F008D7F80936F0080918100887F81607E
:101BF00080938100109293018091CA068F3F21F457
:101C00009091390595FF09C090913805943029F0DD
:101C100090E00E943E1F81E001C080E0909192011F
:101C2000992359F09091D40692FF02C091E0892740
:101C3000882311F0299A0895299808951F920F92E8
:101C40000FB60F9211242F933F934F935F936F938F
:101C50007F938F939F93AF93BF93CF93DF93EF9334
:101C6000FF938091930181117FC195B18091A8016B
:101C700080729F7D892B85B985B18F7E9091A70158
:101C8000892B85B98091A60186BD82E085BD81E062
:101C90008093930178948091BA019091BB01892B34
:101CA00009F0A4C08091980190919701981709F4C8
:101CB00092C0E091980186E0E89FF0011124E4547D
:101CC000FE4FF093BB01E093BA018381948190931E
:101CD000890080938800808191819093B6018093E0
:101CE000B501A2818091B7018A1771F1A093B70164
:101CF00081E1A89FD0011124A052BE4FB093B90139
:101D0000A093B8011D968D919D910D90BC91A02D31
:101D1000B695A795979587958093990190939A0189
:101D2000A0939B01B0939C0180939D0190939E0191
:101D3000A0939F01B093A0018093A1019093A20171
:101D4000A093A301B093A401C091B801D091B901AF
:101D500080919401988189278093A80125818981A8
:101D60009A81AB81BC81022E04C0B695A795979548
:101D700087950A94D2F78093A9019093AA01A09322
:101D8000AB01B093AC018D819E81AF81B885022EED
:101D900004C0B695A795979587950A94D2F7809336
:101DA000AD019093AE01A093AF01B093B0018985CE
:101DB0009A85AB85BC8504C0B695A7959795879500
:101DC0002A95D2F78093B1019093B201A093B30109
:101DD000B093B4010BC00E94EF0D9FB7F8948091AF
:101DE00039058460809339059FBFBEC00E94AA2038
:101DF0001092A7018091A9019091AA01A091AB0135
:101E0000B091AC014091990150919A0160919B0170
:101E100070919C01840F951FA61FB71F8093990195
:101E200090939A01A0939B01B0939C01E091B8011B
:101E3000F091B9014585568567857089481759071E
:101E40006A077B0768F520E12093A7014585568541
:101E500067857089841B950BA60BB70B809399013E
:101E600090939A01A0939B01B0939C012081809153
:101E70003B0590913C05A0913D05B0913E0525FFA5
:101E800004C00197A109B10903C00196A11DB11DAC
:101E900080933B0590933C05A0933D05B0933E0590
:101EA0008091AD019091AE01A091AF01B091B001D0
:101EB00040919D0150919E0160919F017091A00100
:101EC000840F951FA61FB71F80939D0190939E01BD
:101ED000A0939F01B093A0018091B1019091B201B4
:101EE000A091B301B091B4014091A1015091A20120
:101EF0006091A3017091A401840F951FA61FB71FC5
:101F00008093A1019093A201A093A301B093A40197
:101F100080913805843039F480913A059091A70179
:101F200089238093A7018091B5019091B601019713
:101F30009093B6018093B501892B69F41092BB018F
:101F40001092BA01809198018F5F8093980186303A
:101F500011F410929801809195019091A701892721
:101F60008093A70110929301FF91EF91DF91CF91A0
:101F7000BF91AF919F918F917F916F915F914F91A1
:101F80003F912F910F900FBE0F901F9018951F92A9
:101F90000F920FB60F9211248F939F9395B180915A
:101FA000950180719F7E892B85B915BC9F918F917A
:101FB0000F900FBE0F901F901895FF920F931F93D5
:101FC000CF93DF931092950110929401C0E0D0E07E
:101FD0000C2F1C2F2091C80630E08C2F0C2E02C035
:101FE000359527950A94E2F720FF07C0F0909501F8
:101FF0000E94F9198F29809395012091C90630E03C
:1020000002C0359527951A95E2F720FF08C0109178
:102010009401802F0E94FB19812B809394012196BB
:10202000C330D105A9F6DF91CF911F910F91FF9099
:102030000895CF93C1E0C09392010E94EF0D8BE20F
:10204000E3E6F1E0DF011D928A95E9F783E2E9E931
:10205000F1E0DF011D928A95E9F71092910110924B
:1020600090011092980110929701C09396011092DE
:1020700093010E94DD0F85B18F7E90919501892B90
:1020800085B985B18F7D90919401892B85B9CF91C8
:102090000895249A219A259AE1E8F0E080818F7EC4
:1020A0008083808188608083E0E8F0E080818C7F9D
:1020B000808380818F708083EEE6F0E08081887F6E
:1020C000808314BC15BC8081816080830895CF9388
:1020D000DF93C0919001D09191012097B9F081E0F8
:1020E0008093640160917A0170917B0180917C0101
:1020F00090917D019B01AC010E947828698B7A8BBD
:102100008B8B9C8B1092910110929001DF91CF915B
:1021100008952F923F924F925F926F927F928F928B
:102120009F92AF92BF92CF92DF92EF92FF920F9366
:102130001F93CF93DF93CDB7DEB7E5970FB6F89433
:10214000DEBF0FBECDBF9091980180919601981788
:1021500009F4E1C58091900190919101892B09F0DA
:1021600057C20E943D1B1C019093910180939001E6
:10217000009709F4D0C58091640110913805882337
:1021800019F010926401BDC0809163018F5F8530AA
:1021900019F08093630102C010926301E091630122
:1021A00021E12E9FF0011124E052FE4FF0938F01A8
:1021B000E0938E01D1018C91808311964D915D91B8
:1021C0006D917C91149703E0440F551F661F771F94
:1021D0000A95D1F7418352836383748315964D9199
:1021E0005D916D917C91189783E0440F551F661F98
:1021F000771F8A95D1F74583568367837087199631
:102200004D915D916D917C911C9793E0440F551F0A
:10221000661F771F9A95D1F7418752876387748726
:102220001D966D917D918D919C9150976B017C01D4
:1022300023E0CC0CDD1CEE1CFF1C2A95D1F7C586D3
:10224000D686E786F08A0E943F27609365017093E7
:1022500066018093670190936801F10125A136A181
:1022600047A150A50E94A6269B01AC01609369017D
:1022700070936A0180936B0190936C0160E070E051
:1022800080EA9FE30E94A62660936D0170936E0121
:1022900080936F01909370011092710110927201FE
:1022A00010927301109274011032E1F46091820176
:1022B00070918301809184019091850160937A01EE
:1022C00070937B0180937C0190937D019B01AC0115
:1022D0000E947828D10151966D937D938D939C93A4
:1022E00054970FC0F10161897289838994890E9492
:1022F000FF2860937A0170937B0180937C01909317
:102300007D0110927601109277011092780110925F
:102310007901D10191968D909D90AD90BC9094974C
:10232000A501940160E070E080E09FE30E94A62692
:102330002B013C01F101C5A0D6A0E7A0F0A410320A
:1023400009F04DC0F2E0F0937501D10151962D9145
:102350003D914D915C9154972D833E834F835887D7
:102360000E9478289B01AC01C701B6010E942A2671
:102370002B013C0120E030E0A9010E94A22687FF4A
:102380001DC0A5019401C501B4010E942B26A7011F
:1023900096010E9478289B01AC016D817E818F811E
:1023A00098850E942A260E94FF28609382017093DC
:1023B000830180938401909385012AC14092760124
:1023C00050927701609278017092790110928201A7
:1023D00010928301109284011092850119C110920C
:1023E0007501C0928601D0928701E0928801F09237
:1023F00089010E944D1B4B015C0160938201709327
:10240000830180938401909385019B01AC010E941C
:10241000782869837A838B839C8300919001109143
:102420009101D80195962D913D914D915C91989790
:1024300029873A874B875C8751962D913D914D9125
:102440005C9154972D833E834F8358879B01AC0149
:102450006D817E818F8198850E942A269B01AC0127
:10246000C301B2010E9478289B01AC0169857A857D
:102470008B859C850E942B2620E030E040E05FE3C6
:102480000E9478286B017C0120E030E0A9010E94C5
:10249000442818160CF0ACC029853A854B855C851C
:1024A000C701B6010E94A22687FF8EC0F801858C65
:1024B000968CA78CB0A029813A814B815C81C501A3
:1024C000B4010E942A269B01AC01C301B2010E9403
:1024D000782860938A0170938B0180938C0190938C
:1024E0008D01A70196010E94A22687FF3DC0C5016C
:1024F000B4010E94FF2860937E0170937F01809356
:10250000800190938101A50194016D817E818F816D
:1025100098850E94A226811104C0F1E0F093750114
:1025200077C02D813E814F815885C501B4010E943D
:102530002A269B01AC01C301B2010E9478289B01AD
:10254000AC01609186017091870180918801909122
:1025500089010E942A2660938601709387018093E7
:1025600088019093890154C0C0928601D09287015E
:10257000E0928801F0928901C0928A01D0928B0189
:10258000E0928C01F0928D01D80191966D917D9130
:102590008D919C9194979B01AC010E942B26A701E1
:1025A00096010E94782829813A814B815C810E94A2
:1025B0002B260E94FF2860937E0170937F018093F9
:1025C00080019093810124C0B2E0B09375018091A5
:1025D0007A0190917B01A0917C01B0917D01809363
:1025E0007E0190937F01A0938001B093810110C080
:1025F0001092860110928701109288011092890131
:1026000080927E0190927F01A0928001B092810120
:1026100080919701F6E0F89FF0011124E454FE4FF9
:10262000FE83ED838091630182832091900130913C
:1026300091013E872D87D9019596BC91BCA7F901E0
:10264000F6A1FDA7D9019796BC91BEA7F901F0A507
:10265000FFA720916D0130916E0140916F01509163
:1026600070016CA57DA58B2F9F2F0E942A2668A73D
:1026700079A78AA79BA720E030E0A9010E94A226A3
:1026800087FF04C018A619A61AA61BA620918601CA
:10269000288F30918701398F409188014A8F50915E
:1026A00089015B8F80917E018C8F90917F019D8F3E
:1026B000A0918001AE8FB0918101BF8FE0918A011E
:1026C000E8A3F0918B01F9A320918C012AA330910A
:1026D0008D013BA3409176014CA3509177015DA3FE
:1026E000809178018EA3909179019FA3209182011E
:1026F00030918301409184015091850128AB39AB21
:102700004AAB5BAB30917A01398340917B014987B9
:1027100020907C0130907D01509175015F878CA5E0
:102720008C8B9DA59D8BAEA5AE8BBFA5BF8B3EE3CD
:10273000C32E33ECD32E3EE2E32E39E3F32E188A78
:10274000198A1A8A1B8A26013701EF85EE2321F0A8
:10275000E13009F47CC0B1C0AD85BE8591962D9164
:102760003D914D915C919497C701B6010E947828E4
:102770004B015C0120E030E040E05FE30E947828FC
:102780009B01AC0169817985C1010E942B269B01C7
:10279000AC01C701B6010E9478289B01AC016C898D
:1027A0007D898E899F890E942A268B018DAB9CABE7
:1027B000288D398D4A8D5B8D0E94A22687FF3FC0F0
:1027C000288D398D4A8D5B8D6CA57DA58EA59FA525
:1027D0000E942A269B01AC010E942B266B017C01E2
:1027E0002C8D3D8D4E8D5F8D69817985C1010E9453
:1027F0002B269B01AC01C701B6010E94A6266B01E6
:102800007C0128A139A14AA15BA1688D798D8A8DAF
:102810009B8D0E94A226882319F0B1E0BF8702C0D9
:10282000E2E0EF87FC8DF9832D8D29872E8C3F8C7C
:10283000088D198D3A8D3DAB4B8D4CABAFC0A501CA
:10284000940169817985C1010E942B267CC0A70172
:1028500096016C8D7D8D8E8D9F8D0E9478289B01B9
:10286000AC016C897D898E899F890E942A268B0103
:102870008DAB9CAB28A139A14AA15BA10E94A226E5
:1028800087FF8CC028A139A14AA15BA16C897D89F1
:102890008E899F890E942A262C8D3D8D4E8D5F8DBD
:1028A0000E94A6266B017C0108A119A15AA15DAB6B
:1028B0008BA18CAB92E09F8771C0AD85BE85919650
:1028C0002D913D914D915C919497C701B6010E9465
:1028D00078284B015C019B01AC0169817985C101BC
:1028E0000E94442818169CF520E030E040E05FE3A9
:1028F000C501B4010E9478289B01AC0169817985EA
:10290000C1010E942A269B01AC01C701B6010E94A9
:1029100078289B01AC016C897D898E899F890E94F2
:102920002A268B018DAB9CAB2CA13DA14EA15FA1B2
:102930000E94442818165CF4A501940169817985E8
:10294000C1010E942A26698379871C0127C02CA116
:102950003DA14EA15FA16C897D898E899F890E94CE
:102960002A269B01AC010E942B266B017C0128A921
:1029700039A94AA95BA969817985C1010E942B26E1
:102980009B01AC01C701B6010E94A6266B017C0128
:102990000CA11DA1BEA1BDABEFA1ECABA70196019F
:1029A000688979898A899B890E942B26688B798B13
:1029B0008A8B9B8BA30192010E94A22687FD5AC09D
:1029C00028A539A54AA55BA5B8018DA99CA90E9497
:1029D000442818160CF444C089819985D10180934C
:1029E0007A0190937B01A0937C01B0937D01FF85D8
:1029F000F09375014090690150906A0160906B01FD
:102A000070906C0198014DA95CA9C301B2010E94AC
:102A1000782869837A838B839C830E948F266B013D
:102A20007C016091650170916601809167019091D0
:102A300068010E948F264B015C01A70196010E944C
:102A40002A260E94132769877A878B879C87E985C6
:102A5000FA85AD81BE81ED93FC933097B1F15AC0F8
:102A60002EE333EC4EE259E3C301B2010E942B2660
:102A70002B013C01288939894A895B89C301B2014C
:102A80000E942A266B017C012CA13DA14EA15FA1D1
:102A9000B8018DA99CA90E94442818167CF0898150
:102AA0009985D10180937A0190937B01A0937C0159
:102AB000B0937D013F85309375019CCF0C8B1D8BAE
:102AC0004DA94E8B5CA95F8B40CE8091380580323A
:102AD00009F510927A0110927B0110927C011092FC
:102AE0007D01109271011092720110927301109287
:102AF0007401C0926501D0926601E0926701F09284
:102B00006801A3019201C701B6010E94A626AD8506
:102B1000BE85EEC020917101309172014091730128
:102B200050917401688979898A899B890E942B2632
:102B30002B013C0129813A814B815C81C501B401A3
:102B40000E942A269B01AC01C301B2010E94A62665
:102B50004B015C0129813A814B815C81C701B6013F
:102B60000E942A26A50194010E9478286093710191
:102B700070937201809373019093740120EC31EE95
:102B800044E65EE4C501B4010E9478280E948F26C5
:102B90000E941327603DB7E07B078105910520F473
:102BA000ED81FE81158231C0603AFFE07F0781052B
:102BB000910510F4E1E009C06034FFE17F07810571
:102BC000910510F4E2E001C0E3E0AD81BE8115960D
:102BD000EC93AD81BE8115962C911597022E04C001
:102BE00096958795779567950A94D2F7E985FA8542
:102BF00002C0EE0FFF1F2A95E2F7ED93FC936115DB
:102C00007105F1E08F07910538F4AD81BE8114960E
:102C10007C936E93139706C02FEF3FEFED81FE81FB
:102C20003483238380919601809397018F5F863050
:102C300019F08093960102C01092960120917601BE
:102C4000309177014091780150917901B8018DA9B7
:102C50009CA90E9444281816C4F4E0919001F091B8
:102C60009101C801ADA9BCA985A396A3A7A3B0A74C
:102C700089819A81AB81BC818093650190936601C3
:102C8000A0936701B09368015ECA20E030E0A9011B
:102C9000B8018DA99CA90E9444281816ACF5109281
:102CA0007A0110927B0110927C0110927D011092AA
:102CB0007101109272011092730110927401C0920E
:102CC0006501D0926601E0926701F092680100917F
:102CD0009001109191012091690130916A01409118
:102CE0006B0150916C01C701B6010E94A626D80164
:102CF00095966D937D938D939C9398970E94841ED7
:102D000088E08093380507C01092910110929001DD
:102D10000E94291B18CAE5960FB6F894DEBF0FBEB5
:102D2000CDBFDF91CF911F910F91FF90EF90DF907A
:102D3000CF90BF90AF909F908F907F906F905F905B
:102D40004F903F902F900895F999FECF92BD81BD8D
:102D500081E08FBB80B50895F894F999FECF92BDBC
:102D600081BD81E08FBB40B54627842F992787FD21
:102D70009095262F30E082239323892B39F06F3FE3
:102D800019F060BD84E006C084E104C0442321F052
:102D900060BD84E28FBBF99A789408959F92AF92B8
:102DA000BF92CF92DF92EF92FF920F931F93CF9338
:102DB000DF938C017A016B01C40ED51EEB01912CBF
:102DC0005C01A61AB70ACE018A0D9B1DCC15DD0544
:102DD00091F0911009C0692D772767FD7095272F15
:102DE000221F2227221F01C021E06991922E960EF8
:102DF0000E94AC16E8CF692DC8018E0D9F1DDF9192
:102E0000CF911F910F91FF90EF90DF90CF90BF90E7
:102E1000AF909F900C94AC169F92AF92BF92CF92BE
:102E2000DF92EF92FF920F931F93CF93DF938B016B
:102E30007A016C01C40ED51EEC01912C5B01A81A1D
:102E4000B90AC5018C0F9D1FCC15DD0591F00E94BC
:102E5000A416911009C0292D332727FD3095232F63
:102E6000221F2227221F01C021E0922E980E899353
:102E7000E8CFC8018E0D9F1D0E94A41621E030E00E
:102E8000981611F020E030E0C901DF91CF911F9139
:102E90000F91FF90EF90DF90CF90BF90AF909F90F9
:102EA000089521E5829FC001112440E550E09D5F17
:102EB0000C94CE1640E550E0BC018EEA93E00C94F1
:102EC000CE162DE0829FC00111244CE050E09E5FA1
:102ED0000C94CE1661E080E090E00E94AC164DE4C8
:102EE00050E067E976E081E090E00C94CE168AE04D
:102EF0008093C70689E18093CA061092C80686E0CF
:102F00008093C90683E08093CB068AE097EDA3EA1D
:102F1000BCE38093CC069093CD06A093CE06B093ED
:102F2000CF068FE692E1A3E0BBE38093D0069093B7
:102F3000D106A093D206B093D3061092D50680E0B6
:102F400090E0A8ECB1E48093D6069093D706A093C6
:102F5000D806B093D90680E090E0AAEFB3E480935E
:102F6000DA069093DB06A093DC06B093DD068AEFC9
:102F700090E09093DF068093DE0680E090E0A0E88A
:102F8000BFE38093E0069093E106A093E206B0933E
:102F9000E30682E08093D40684EE98E3AEE0B1E4E9
:102FA0008093970690939806A0939906B0939A06FB
:102FB00080939B0690939C06A0939D06B0939E06DB
:102FC00080939F069093A006A093A106B093A206BB
:102FD00080E090ECA8E2B6E48093A3069093A40668
:102FE000A093A506B093A6068093A7069093A80683
:102FF000A093A906B093AA068093AB069093AC0663
:10300000A093AD06B093AE0680E094E3AEE1B9E4E0
:103010008093AF069093B006A093B106B093B2062A
:103020008093B3069093B406A093B506B093B6060A
:103030008093B7069093B806A093B906B093BA06EA
:1030400080E090E0A7E8B4EC8093BB069093BC06C8
:10305000A093BD06B093BE068093BF069093C006B2
:10306000A093C106B093C2068093C3069093C40692
:10307000A093C506B093C6060C946A1760E080E082
:1030800093E00E94AC1660E081E593E00C94AC16EE
:1030900060E08EEA93E00C94AC161F93CF93DF931D
:1030A000182FEB0181E5189FB00111247D5F40E5E9
:1030B00050E0CE010E940C17892B39F41882BE0112
:1030C000812F0E94511780E001C081E0DF91CF91F4
:1030D0001F910895CF93DF93EC0140E550E06EEA35
:1030E00073E00E940C17892B31F41882CE010E94E4
:1030F0005A1780E001C081E0DF91CF9108951F93BE
:10310000CF93DF93182FEB018DE0189FB0011124AE
:103110007E5F4CE050E0CE010E940C17892B59F4E1
:103120008CE0FE0111928A95E9F7BE01812F0E9481
:10313000611780E001C081E0DF91CF911F91089578
:1031400080E090E00E94A416813059F44DE450E0F4
:1031500061E070E087E996E00E940C1721E0892B7E
:1031600009F420E0822F0895CF92DF92EF92FF9230
:10317000CF93DF93C82F6A017B0120E030E0A901E3
:10318000C701B6010E94A22687FDF2C0C43608F42A
:1031900056C02CE92C0F80E0233008F047C030E007
:1031A0008230D1F0833091F1813041F0F901EE0F9E
:1031B000FF1FEE0FFF1FE956F94F33C0E901CC0F97
:1031C000DD1FCC0FDD1FCD55D94F20E030E040E7AB
:1031D00052E4C701B60113C0E901CC0FDD1FCC0FCB
:1031E000DD1FC155D94F20E030E040E752E4C70170
:1031F000B6010E94782820E030E040E752E40E94C7
:103200007828688379838A839B83AEC0F901EE0FA7
:10321000FF1FEE0FFF1FE554F94FF7FAF094F7F890
:10322000F094C082D182E282F3829EC08F5F2A3006
:1032300008F4A0C0843009F49DC02A50ADCFC70166
:10324000B6010E943D290E9413278C2F90E08C31FB
:10325000910508F08FC0FC01E35CFF4F0C948429BA
:10326000633008F489C06093C7067EC06093CA06C5
:103270007BC06093C80602C06093C9060E94DD0F40
:1032800073C08091D406662311F0846007C08B7FE1
:1032900005C08091D406662321F080648093D40613
:1032A00063C08F7BFBCF8091D406662311F08068CA
:1032B000F5CF8F77F3CF6093CB06C092CC06D09238
:1032C000CD06E092CE06F092CF064EC0C092D00658
:1032D000D092D106E092D206F092D30645C08091FA
:1032E000D406662311F08160D9CF8E7FD7CF80912D
:1032F000D406662311F08260D1CF8D7FCFCF80912D
:10330000D406662321F084FF39C08062C7CF8F7D49
:10331000C5CF8091D406662311F08061BFCF8F7C2A
:10332000BDCF6093D50620C0C092D606D092D706F6
:10333000E092D806F092D90617C0C092DA06D09271
:10334000DB06E092DC06F092DD060EC070E07093C2
:10335000DF066093DE0608C0C092E006D092E10668
:10336000E092E206F092E3060E946A1780E007C04E
:1033700084E005C083E003C086E001C08AE0DF91FD
:10338000CF91FF90EF90DF90CF9008951F93CF9350
:10339000DF93CDB7DEB72C970FB6F894DEBF0FBE24
:1033A000CDBF0E94A01881110BC087E00E94C320EE
:1033B0000E9477170E943E180E9448180E946321BD
:1033C00010E0BE016F5F7F4F812F0E947F18811137
:1033D00003C087E00E94C3201F5F183091F72C962E
:1033E0000FB6F894DEBF0FBECDBFDF91CF911F9116
:1033F000089580E1089580E208954F925F926F9260
:103400007F928F929F92AF92BF92CF92DF92EF9274
:10341000FF920F931F93CF93DF93109153021111DB
:1034200001C012E1115000915102101709F4EFC0D0
:1034300089E2189FE0011124CB5ADD4F8D889E88C8
:10344000AF88B88C69A17AA18BA19CA19B01AC012A
:103450000E942B262DA13EA14FA158A50E9478289D
:103460006B017C019B01AC01B401C5010E94A22645
:1034700087FF02C064017501A601B701498B5A8B11
:103480006B8B7C8B111101C012E177247A94710E41
:10349000701619F029E2622E27C080915402081399
:1034A00051C00E9467104EC0679C800111240B5AC6
:1034B0001D4F711002C092E1792E7A9480915402CE
:1034C000781202C00E946710F801C588D688E78884
:1034D000F08CA701960161897289838994890E9481
:1034E000A226811106C0E801809151027812DCCF3A
:1034F00029C0F80161A172A183A194A19B01AC0133
:103500000E942B26F80125A136A147A150A50E94B3
:10351000782829893A894B895C890E942B264B019E
:103520005C01A70196010E94A226F80187FF05C051
:10353000818A928AA38AB48AD6CFC18AD28AE38A40
:10354000F48AD1CF60905102F9E26F9E800111247C
:103550000B5A1D4F77247394760C82E1781201C0C8
:10356000712C5090530289E2482E751409F44DC015
:10357000479CE0011124CB5ADD4FF80181889288E5
:10358000A388B488C988DA88EB88FC88A7019601EB
:10359000C501B4010E94A22687FF23C0F80161A1E2
:1035A00072A183A194A19B01AC010E942B26F8017A
:1035B00025A136A147A150A50E9478289B01AC0106
:1035C000C501B4010E942B264B015C01A7019601A5
:1035D0000E94A22687FF05C0898A9A8AAB8ABC8A84
:1035E000672C2D893E894F89588D69897A898B8905
:1035F0009C890E94A226811101C0672C7394F2E17C
:103600007F1201C0712C8E01B0CF60925102DF9108
:10361000CF911F910F91FF90EF90DF90CF90BF90CF
:10362000AF909F908F907F906F905F904F90089594
:103630008CE1E5E3F2E0DF011D928A95E9F7109253
:1036400054021092530281E0809352021092510270
:1036500008959091540280915302891769F081E096
:10366000890F823109F480E020915102921302C047
:103670008093510280935402089580915402909156
:103680005302981739F029E2829FC00111248B5A06
:103690009D4F089580E090E00895E0915402EF5F1F
:1036A000E23109F4E0E080915302E81761F089E229
:1036B000E89FF0011124EB5AFD4F618972898389DB
:1036C00094890C94FF2860E070E0CB01089581E0BC
:1036D0002091540290915202291380E008952F9274
:1036E0003F924F925F926F927F928F929F92AF9292
:1036F000BF92CF92DF92EF92FF920F931F93CF93DF
:10370000DF93CDB7DEB7AD970FB6F894DEBF0FBE2F
:10371000CDBF142F052F6B8F7C8F822E20915302EB
:1037200039E2239F10011124F101EB5AFD4F1F01D3
:10373000158616861786108A15A216A217A210A63D
:10374000108249E956E766E97EE741A352A363A3E5
:1037500074A35C0137E9E32E36E0F32E9E01235F6C
:103760003F4F3E8F2D8F85E392E098A38F8F6F019F
:10377000FE013196FAA3E9A3912CF50161917191B3
:10378000819191915F01F7012081318142815381C3
:103790000E9478280E944828ED8DFE8D61937193D8
:1037A00081939193FE8FED8FEF8DF8A14190519011
:1037B00061907190F8A3EF8F6419750986099709D4
:1037C0002B013C0197FF07C0442455243201461ABF
:1037D000570A680A790AF60141825282638274822A
:1037E000F1012585368547855089421653066406C2
:1037F000750610F429013A01F1014586568667865F
:10380000708A0E944127F7012081318142815381D2
:103810000E94A6262B013C01E9A1FAA161937193B4
:1038200081939193FAA3E9A320E030E0A9010E94DB
:10383000A22687FF0AC0F1019081892D9DA70E94D1
:10384000FB199DA5892BF1018083A3019201C3017E
:10385000B2010E947828F10125A136A147A150A507
:103860000E942B26F10165A376A387A390A79394CA
:10387000F4E0EF0EF11C24E0C20ED11C33E09312F1
:103880007CCF0E94FF286B017C01F10165A376A328
:1038900087A390A785859685A785B089892B8A2BD4
:1038A0008B2B09F4DEC120E030E0A901612F702FDD
:1038B0008B8D9C8D0E94A22687FD21C0882061F0FF
:1038C000212F302F4B8D5C8DC701B6010E94A6269B
:1038D000162F072F8B8F9C8F20E030E040E85FE3AE
:1038E000612F702F8B8D9C8D0E94A22687FF0DC0AB
:1038F00010E000E030E83B8F8FE38C8F06C019E9C1
:1039000006E7F6E9FB8F2EE72C8FA701960160E012
:1039100070E080E89FE30E94A62669A77AA78BA79C
:103920009CA7E1E4F2E0FAA3E9A323EA36E038A396
:103930002F8FCE010D969A8F898FFE013196FE8FC3
:10394000ED8FC12CD12C7601ED8DFE8D8080918084
:10395000A280B38020E030E0A901C501B4010E943B
:10396000A226882309F47FC029A53AA54BA55CA50A
:10397000C501B4010E9478284B015C01ED8DFE8DDC
:1039800060837183828393839B01AC0160E070E06C
:1039900080E89FE30E94A6262B013C01E89477F87B
:1039A000EF8DF8A12081318142815381C301B201A1
:1039B0000E9478286BA37CA38DA39EA39B01AC01DE
:1039C000612F702F8B8D9C8D0E94A22687FF06C0D1
:1039D0001BA30CA3FB8DFDA32C8D2EA3F101F1A144
:1039E000FB8FF101F2A1FC8FF101F3A1FFA3F10123
:1039F000F4A1F8A7EF8DF8A1248535854685578574
:103A0000C301B2010E9478283B018C019B01AC01EB
:103A10006B8D7C8D8FA198A50E94A22687FF04C084
:103A20006B8C7C8C0FA118A5C301D801F10181A377
:103A300092A3A3A3B4A3E9A1FAA120813181428179
:103A40005381C501B4010E9478289B01AC01C701D4
:103A5000B6010E942A266B017C011BA10CA1FDA1CD
:103A6000FB8F2EA12C8F8D8D9E8D04969E8F8D8F1A
:103A7000E9A1FAA13496FAA3E9A32F8D38A12C5F0E
:103A80003F4F38A32F8FE98DFA8D8E179F0709F0CE
:103A90005BCF909153028091540298130AC0F101B8
:103AA000118A128A138A148A118E128E138E148E22
:103AB00049C0A701960160E070E080E89FE30E94A2
:103AC0002A2620E030E040E05FE30E9478280E9450
:103AD000FF286B017C012091CC063091CD064091EE
:103AE000CE065091CF06F10161A172A183A194A1EC
:103AF0000E947828A70196010E9478284B015C015A
:103B0000A701960160E070E080E89FE30E942A260A
:103B10009B01AC01C501B4010E94A6266B017C018A
:103B200020E030E0A9010E94A22687FF04C0C12C3A
:103B3000D12CE12CF12CA601B701F101418F528F5C
:103B4000638F748F212F302F4B8D5C8D612F702FE1
:103B50008B8D9C8D0E947828162F072FF82EE92E2A
:103B6000862F902FAF2DBE2DF101858F968FA78FB9
:103B7000B0A3A18CB28CC38CD48C60904D02709099
:103B80004E0280904F02909050029301A401612F49
:103B9000702F8F2D9E2D0E94A22687FD0BC09301B2
:103BA000A401B501C6010E94A22687FD11C05301E0
:103BB00064010EC0212F302F4F2D5E2DB501C6019F
:103BC0000E94A22687FD04C0A12EB02ECF2CDE2C91
:103BD000C501D601F101858B968BA78BB08F8CE048
:103BE000FE013196A1E4B2E001900D928A95E1F7D1
:103BF000812F902FAF2DBE2D80934D0290934E02BA
:103C0000A0934F02B09350028CE0FE013D96A5E3D5
:103C1000B2E001900D928A95E1F780915202809373
:103C200053028F5F823109F480E080935202AD9697
:103C30000FB6F894DEBF0FBECDBFDF91CF911F91BD
:103C40000F91FF90EF90DF90CF90BF90AF909F903B
:103C50008F907F906F905F904F903F902F900C943B
:103C6000FD19AD960FB6F894DEBF0FBECDBFDF9144
:103C7000CF911F910F91FF90EF90DF90CF90BF9069
:103C8000AF909F908F907F906F905F904F903F90FC
:103C90002F90089580913B0590913C05A0913D05A2
:103CA000B0913E058093350290933602A09337027F
:103CB000B093380280913F0590914005A091410555
:103CC000B09142058093390290933A02A0933B024F
:103CD000B0933C028091430590914405A091450525
:103CE000B091460580933D0290933E02A0933F021F
:103CF000B093400208958091530290915402891725
:103D000008F48E5E891B08950E946710809154020A
:103D1000809351020C94FD196F927F928F929F9223
:103D2000AF92BF92CF92DF92EF92FF920F931F93C9
:103D3000CF93DF937C018B016A01FB018081F70146
:103D4000E80FF11D2081EF012D3229F42296218107
:103D50006624639407C02B3211F0219602C022968C
:103D60002181612CA12CB12C712C60E070E0CB0181
:103D7000FE0130ED932E920E29E02915C8F0B39480
:103D800028E02B1588F0A1107A94A5E0B0E09B0103
:103D9000AC010E944B29660F771F881F991F690D80
:103DA000711D811D911D0BC0A11009C0739407C026
:103DB0002EEF921207C0A11005C0AA24A394219649
:103DC0002081D6CFBB2009F449C00E943F274B0178
:103DD0005C0120E030E0A9010E94A226882361F165
:103DE0008FEF78166CF42AE037ED43E25CE3C5010F
:103DF000B4010E9478284B015C0173947394F0CF56
:103E000078120BC02DEC3CEC4CEC5DE3C501B40129
:103E10000E9478284B015C010FC0772069F020E0F8
:103E200030E040E251E4C501B4010E9478284B0122
:103E30005C017A9417149CF3662021F0B7FAB094D1
:103E4000B7F8B094F60180829182A282B382CE1933
:103E5000DF09C150F801C08381E001C080E0DF913B
:103E6000CF911F910F91FF90EF90DF90CF90BF9077
:103E7000AF909F908F907F906F900895009741F042
:103E8000EFE9FFE03197F1F700C000000197F6CFAE
:103E90000895CF93DF93EC018991882319F00E9454
:103EA000ED0AFACFDF91CF910895CF93DF93FC0114
:103EB0008491EF012196882321F00E94ED0AFE01F2
:103EC000F7CFDF91CF910895EF92FF920F931F9359
:103ED000CF93DF93CDB7DEB728970FB6F894DEBF48
:103EE0000FBECDBFFE0131967F019E01275F3F4F80
:103EF000982F917091938695E217F307C9F78F0178
:103F0000F80182918F01805D0E94ED0A0E151F0558
:103F1000B9F728960FB6F894DEBF0FBECDBFDF917C
:103F2000CF911F910F91FF90EF9008951F93CF9322
:103F3000DF9300D01F92CDB7DEB7811109C080E3B7
:103F40000F900F900F90DF91CF911F910C94ED0A7D
:103F500090E02AE011E0190FE1E0F0E0EC0FFD1F26
:103F6000E90FF11D622F0E945629905D90838823EE
:103F700011F0912FEFCF112341F0FE01E10FF11D60
:103F800080810E94ED0A1150F6CF0F900F900F9094
:103F9000DF91CF911F9108958F929F92AF92BF9220
:103FA000CF92DF92EF92FF920F931F93CF93DF9305
:103FB000CDB7DEB72A970FB6F894DEBF0FBECDBFE0
:103FC0006B017C01142F20E030E0A9010E94A226A1
:103FD00087FF07C08DE20E94ED0AF7FAF094F7F828
:103FE000F094012F023060F020E030E048EC52E421
:103FF000C701B6010E9478286B017C010250F2CF04
:1040000010FF0AC020E030E040E251E4C701B601F1
:104010000E9478286B017C0120E030E040E05FE303
:10402000C701B6010E942B260E940E27E1E0F0E0B6
:10403000EC0FFD1FE10FF11D2EE22083D12C5AE081
:10404000852E912CA12CB12C61157105810591054E
:10405000A9F0D11201C0D394EE24E394F12CEC0E1C
:10406000FD1EED0CF11CA50194010E946229605D0A
:10407000F7016083B901CA01D394E6CF80E3D1167A
:1040800048F4E1E0F0E0EC0FFD1FED0DF11D808341
:10409000D394F5CF8D2DD1120BC0D394D3948F5FD1
:1040A000E1E0F0E0EC0FFD1FE80FF11D80E38083FD
:1040B000DD2041F0FE01ED0DF11D80810E94ED0A31
:1040C000DA94F6CF2A960FB6F894DEBF0FBECDBFB6
:1040D000DF91CF911F910F91FF90EF90DF90CF90E4
:1040E000BF90AF909F908F9008952091D40620FFAD
:1040F00008C02BE832E441E25DE30E94782844E006
:1041000001C043E00C94CC1F2091D40620FF08C0CE
:104110002BE832E441E25DE30E94782841E001C0EF
:1041200040E00C94CC1F43E00C94CC1F3D98809150
:10413000D40687FF04C045981092E4060895459A76
:1041400080E28093E406089586B180729091E4063F
:1041500089270895809148058130A1F40E94A42008
:10416000882381F0109248058CE0EBE3F5E0A9E4A8
:10417000B5E001900D928A95E1F78091390588604C
:10418000809339050895CF93C82F8C3009F44CC023
:10419000811103C08AE796E044C082E796E00E945E
:1041A000551F4C2F50E0FA013197E631F10580F5AB
:1041B000E75AFF4F0C9484298AE596E002C088E410
:1041C00096E00E94551F2BC086E396E0FACF8CE262
:1041D00096E0F7CF8BE196E0F4CF8CE096E0F1CF5C
:1041E0008BEE95E0EECF82EE95E0EBCF87ED95E09C
:1041F000E8CF84EC95E0E5CF86EB95E0E2CF80EA6E
:1042000095E0DFCF8CE895E0DCCF88E795E0D9CF6B
:1042100086E695E00E94551F8C2F0E94961F83E62C
:1042200095E0CF910C94551FCF910895CF93C82F4F
:104230008BE595E00E94551FCE3F51F0CF3F29F00E
:10424000CD3F51F48DE295E005C08BE495E002C0CE
:1042500088E395E00E94551F8AE295E00E94551F71
:1042600084EF91E0CF910C943E1FCF93C82F88E24A
:1042700095E00E94551FC33091F038F4C13061F0D1
:10428000C230A1F482E095E00FC0C43059F0C530CF
:1042900069F48FED94E008C086E195E005C080EFF9
:1042A00094E002C088EE94E00E94551F8BED94E0EC
:1042B000CF910C94551F8EEB94E00C94551F80EA1F
:1042C00093E00C94551FFF920F931F93CF93DF93AE
:1042D0008CE993E00E94551F8091C7060E94961FAB
:1042E00083E893E00E94551F8091CA060E94961FA2
:1042F00085E693E00E94551F8091C8060E94961F94
:104300008CE493E00E94551F8091C8060E94641FB0
:1043100085E493E00E94551F8091C9060E94961F74
:104320008DE293E00E94551F8091C9060E94641F90
:1043300086E293E00E94551F8091D40682FB882775
:1043400080F90E94961F85E093E00E94551F80919E
:10435000D40686FB882780F90E94961F85EE92E09E
:104360000E94551F8091D406881F8827881F0E94AD
:10437000961F85EC92E00E94551F8091CB060E940B
:10438000961F8FEA92E00E94551F8091CB060E94F3
:10439000641F87EA92E00E94551F6091CC067091DD
:1043A000CD068091CE069091CF060E94932086E89C
:1043B00092E00E94551F6091D0067091D1068091C5
:1043C000D2069091D3060E9493208AE692E00E9442
:1043D000551F8091D40681700E94961F8DE492E053
:1043E0000E94551F8091D406869581700E94961F69
:1043F00083E392E00E94551F8091D40685FB8827B5
:1044000080F90E94961F88E192E00E94551F8091DA
:10441000D40683FB882780F90E94961F8DEF91E0D8
:104420000E94551F8091D406829581700E94961F2C
:1044300084EE91E00E94551F84E6F82E10E0C7E953
:10444000D6E000E082EE91E00E94551F802F8F0D94
:104450000E94961F80EE91E00E94551F123091F04D
:104460001330D9F0113029F0688179818A819B81DC
:104470001BC020E030E040E752E46C857D858E85EE
:104480009F8508C020E030E041E655E4688D798DD5
:104490008A8D9B8D0E94A62607C08CA19DA1AEA1EE
:1044A000BFA1BC01CD0190580E9493208DED91E0F9
:1044B0000E94551F013029F0023031F08BED91E060
:1044C00005C089ED91E002C087ED91E00E94551F83
:1044D000123051F0133059F0113019F08CEC91E09A
:1044E00008C089EB91E005C087EA91E002C086E947
:1044F00091E00E94551F82E991E00E94551F0F5FD5
:104500002496033009F09ECF8AE0F80E1F5F8CE8F6
:10451000F81295CFDF91CF911F910F91FF900895E1
:10452000CF92DF92FF920F931F93CF93DF9300D030
:1045300000D0CDB7DEB78CE891E00E94551F09E4AA
:1045400015E097E9C92E96E0D92EF12CF80161917A
:104550007191819191918F01F60121913191419158
:1045600051916F0129833A834B835C830E944127D9
:1045700029813A814B815C810E94A6260E94752088
:10458000F2E0FF1621F08AE891E00E94551FF394B3
:1045900083E0F812DBCF86E891E00F900F900F9048
:1045A0000F90DF91CF911F910F91FF90DF90CF90EF
:1045B0000C94551FEF92FF920F931F93CF93DF93AD
:1045C000CDB7DEB72C970FB6F894DEBF0FBECDBFC8
:1045D000F12CBE016F5F7F4F8F2D0E947F188111DC
:1045E00004C087E00E94C32069C083E891E00E9474
:1045F000551F86E0F81631F0E7E0FE1208C08DE79F
:1046000091E002C080E891E00E94551F04C086E35B
:104610008F0D0E94961F8BE791E00E94551F8E011F
:104620000F5F1F4FE12CF801619171918191919180
:104630008F010E947520F2E0EF1619F089E791E0F2
:1046400002C085E791E00E94551FE39483E0E812E1
:10465000EACFF394E8E0FE12BCCF8FE691E00E942F
:10466000551F03E815E0F12CF801619171918191DA
:1046700091918F010E947520F2E0FF1619F08DE6EE
:1046800091E002C089E691E00E94551FF39483E017
:10469000F812EACF83E691E00E94551F60918F05E2
:1046A0007091900580919105909192050E947520DE
:1046B0008FE591E00E94551F0E9490222C960FB624
:1046C000F894DEBF0FBECDBFDF91CF911F910F9148
:1046D000FF90EF90089580915505823091F038F465
:1046E000882361F08130A1F487E591E00FC0833029
:1046F00059F0853069F48AE491E008C08BE591E0D7
:1047000005C083E591E002C08FE491E00E94551F4F
:1047100087E491E00E94551F80915B058A5C0E94AE
:10472000961F84E491E00E94551F80916A050E94C3
:10473000961F81E491E00E94551F6091660570917B
:10474000670580916805909169050E9484208DE33A
:1047500091E00C94551F1F93CF93DF93182FEB011B
:104760008AE391E00E94551F812F0E94961F88E3E3
:1047700091E00E94551FCE010E94491F85E391E000
:10478000DF91CF911F910C94551FCF93DF93EC01D4
:104790008FE291E00E94551FCE010E94491F8BE2DB
:1047A00091E0DF91CF910C94551FBF92CF92DF9291
:1047B000EF92FF920F931F93CF93DF93CDB7DEB7A6
:1047C0006C970FB6F894DEBF0FBECDBF8CE0EBE365
:1047D000F5E0DE011D9601900D928A95E1F780913A
:1047E00038058430D9F040F48130D9F070F082304F
:1047F000E1F48FEF90E017C0803151F0803259F032
:10480000883099F48EE191E00EC085E291E00BC012
:1048100089E191E008C083E191E005C08DE091E07D
:1048200002C086E091E00E94551F8091CB0680FD7A
:1048300005C08091CB0681FF8AC03CC088EF90E024
:104840000E94551F6E012DE0C20ED11C37E9E32EE8
:1048500036E0F32E8E010F5F1F4FB12CF6016191F0
:104860007191819191916F01F70121913191419164
:1048700051917F01298F3A8F4B8F5C8F0E94412786
:10488000298D3A8D4B8D5C8D0E94A626F80161938F
:104890007193819391938F010E947520F2E0BF166E
:1048A00021F086EF90E00E94551FB39423E0B212EE
:1048B000D5CFBFCF8FEE90E00E94551F27E7E22EA5
:1048C00025E0F22E8E010F5F1F4FB12C6801F7011A
:1048D00061917191819191917F012085318542850E
:1048E00053850E942B269B01AC01F80160817181E8
:1048F000828193810E942A26F801608371838283DA
:104900009383F2E0BF120FC020918F053091900584
:1049100040919105509192050E942A26F8016083EA
:104920007183828393830C5F1F4FF60160817181D5
:10493000828193810E947520F2E0BF1621F08DEEF6
:1049400090E00E94551FB39423E0B212BFCF809134
:10495000CB0682FF08C087EE90E00E94551F0E94A0
:104960007B1E0E94961F8091CB0683FF08C082EEBB
:1049700090E00E94551F0E94CE0A0E94961F8EED65
:1049800090E06C960FB6F894DEBF0FBECDBFDF91FE
:10499000CF911F910F91FF90EF90DF90CF90BF903C
:1049A0000C94551F08951F93CF93DF93EC0110E0F3
:1049B000BE01812F0E944D18811102C087E009C0FD
:1049C0008881882341F0CE010E94491FCE010E94B8
:1049D0007B050E94C3201F5F123051F7DF91CF91FA
:1049E0001F910895CF92DF92EF92FF921F93CF9382
:1049F000DF93CDB7DEB729970FB6F894DEBF0FBEB1
:104A0000CDBF7C0181E08987F7018181833449F141
:104A10002CF4882341F0843249F049C08734C1F036
:104A20008835A9F144C00E945F2110C082E08987C7
:104A3000F7018281882311F083E0FEC08091380560
:104A4000807311F088E0F8C00E94632180E0F4C018
:104A500082E08987F70182818111EECF0E946B236A
:104A6000F5CF82E08987F70192819111E5CF90918E
:104A70003805923021F40E94080585E005C09111A7
:104A8000E1CF8093380584E00E943521DFCF82E0BA
:104A90008987F70182818111CFCF809138058130DC
:104AA000A9F683E00E94352110923805CFCF90916E
:104AB0003805923038F6883491F01CF4833231F0A6
:104AC00059C08934C1F08E34B9F154C082E089876D
:104AD000F70182818111B0CF0E94DA22B7CF809195
:104AE000D40684FFA8C0809137058111AFCFC701DC
:104AF0000E94D324ABCF82E08987F70182818111A4
:104B000007C0C7010E946A18C7010E94C5239ECF33
:104B10008D3309F091CF83E0F701E80FF11D90810B
:104B2000DF0113979C938F5F90819111F5CF898757
:104B3000C7010E945A178ACF82E08987F7018281D4
:104B4000811114C010E0B701812F0E944D1881110E
:104B500004C087E00E94C32004C0B701812F0E94D7
:104B6000AB231F5F123009F471CFEDCF91116ACFE3
:104B700011E001C010E0AE014B5F5F4FBE01675F07
:104B80007F4FC7010E948C1E811102C082E054C079
:104B9000898521E0280F2987F701E80FF11D808121
:104BA0008D3309F049CF112321F1822F90E0E22FBC
:104BB000F0E0D701AE0FBF1F3C91E81BF90BEE0DE3
:104BC000FF1D30832F5F3C913111F1CF2987C70141
:104BD0000E947B05811130C06D817E818F81988517
:104BE0000E943D290E941327862FB7010E9451176A
:104BF0002DCFAE014F5F5F4FBE01675F7F4FC70193
:104C00000E948C1E882311F28985F701E80FF11D9F
:104C10008081811111CFC980DA80EB80FC806D81A9
:104C20007E818F8198850E941327862FB701A60168
:104C30000E94B41801C085E029960FB6F894DEBF33
:104C40000FBECDBFDF91CF911F91FF90EF90DF900E
:104C5000CF9008955058BB27AA270ED0C4C1B5D114
:104C600030F0BAD120F031F49F3F11F41EF4AAC104
:104C70000EF4E095E7FB77C1E92FC6D180F3BA17B0
:104C8000620773078407950718F071F49EF5F5C164
:104C90000EF4E0950B2EBA2FA02D0B01B901900157
:104CA0000C01CA01A0011124FF27591B99F0593F9B
:104CB00050F4503E68F11A16F040A22F232F342FE3
:104CC0004427585FF3CF469537952795A795F04031
:104CD0005395C9F77EF41F16BA0B620B730B840B46
:104CE000BAF09150A1F0FF0FBB1F661F771F881FFE
:104CF000C2F70EC0BA0F621F731F841F48F4879556
:104D000077956795B795F7959E3F08F0B3CF939544
:104D1000880F08F09927EE0F97958795089596D1FB
:104D200080F09F3740F491110EF4A8C160E070E06C
:104D300080E89FE3089526F01B16611D711D811DFB
:104D400018C132C1ECD008F481E008950CD04BC1F9
:104D500043D140F03AD130F021F45F3F19F003C164
:104D600051118CC12FC150D198F39923C9F3552308
:104D7000B1F3951B550BBB27AA276217730784074E
:104D800038F09F5F5F4F220F331F441FAA1FA9F304
:104D900033D00E2E3AF0E0E830D091505040E695F6
:104DA000001CCAF729D0FE2F27D0660F771F881F57
:104DB000BB1F261737074807AB07B0E809F0BB0B46
:104DC000802DBF01FF2793585F4F2AF09E3F51056A
:104DD00068F0C9C053C15F3FECF3983EDCF38695A1
:104DE00077956795B795F7959F5FC9F7880F911DE0
:104DF0009695879597F90895E1E0660F771F881FCC
:104E0000BB1F621773078407BA0720F0621B730B7E
:104E1000840BBA0BEE1F88F7E095089504D06894D0
:104E2000B1112CC10895F8D088F09F5790F0B92F98
:104E30009927B751A0F0D1F0660F771F881F991FEF
:104E40001AF0BA95C9F712C0B13081F016D1B1E0AD
:104E5000089513C1672F782F8827B85F39F0B93FBD
:104E6000CCF3869577956795B395D9F73EF49095F1
:104E70008095709561957F4F8F4F9F4F0895E8946F
:104E800009C097FB3EF490958095709561957F4F92
:104E90008F4F9F4F9923A9F0F92F96E9BB27939540
:104EA000F695879577956795B795F111F8CFFAF450
:104EB000BB0F11F460FF1BC06F5F7F4F8F4F9F4F81
:104EC00016C0882311F096E911C0772321F09EE8DF
:104ED000872F762F05C0662371F096E8862F70E045
:104EE00060E02AF09A95660F771F881FDAF7880F1F
:104EF0009695879597F90895A9D080F09F3740F44B
:104F000091110EF0BBC060E070E080E89FEB089567
:104F100026F41B16611D711D811D2BC045C0990F04
:104F20000008550FAA0BE0E8FEEF16161706E80773
:104F3000F907C0F012161306E407F50798F0621B94
:104F4000730B840B950B39F40A2661F0232B242B69
:104F5000252B21F408950A2609F4A140A6958FEF88
:104F6000811D811D089597F99F6780E870E060E0DA
:104F70000895882371F4772321F09850872B762F9A
:104F800007C0662311F499270DC09051862B70E05D
:104F900060E02AF09A95660F771F881FDAF7880F6E
:104FA0009695879597F908959F3F31F0915020F499
:104FB000879577956795B795880F911D96958795F5
:104FC00097F908959FEF80EC089500240A9416162F
:104FD000170618060906089500240A9412161306E7
:104FE000140605060895092E0394000C11F4882375
:104FF00052F0BB0F40F4BF2B11F460FF04C06F5F91
:105000007F4F8F4F9F4F089557FD9058440F551F66
:1050100059F05F3F71F04795880F97FB991F61F03A
:105020009F3F79F087950895121613061406551FB1
:10503000F2CF4695F1DF08C0161617061806991F1D
:10504000F1CF86957105610508940895E5DFA0F01C
:10505000BEE7B91788F4BB279F3860F41616B11D58
:10506000672F782F8827985FF7CF86957795679574
:10507000B11D93959639C8F30895E894BB27662728
:105080007727CB0197F908954ADF08F48FEF089549
:10509000C3DF58F19E5758F19851A0F0E9F09830CD
:1050A00020F5092E9927660F771F881F991F0A94EC
:1050B000D1F712C0062E672F782F8827985F11F43A
:1050C000000C07C0993FB4F3869577956795939543
:1050D000D9F7611D711D811D3EF4909580957095E5
:1050E00061957F4F8F4F9F4F08956894C7CFC5CF6D
:1050F0000BD079CF6ADF28F06FDF18F0952309F025
:1051000032CF60CF1124BACF7FDFA0F3959FD1F3C8
:10511000950F50E0551F629FF001729FBB27F00D65
:10512000B11D639FAA27F00DB11DAA1F649F6627BA
:10513000B00DA11D661F829F2227B00DA11D621F09
:10514000739FB00DA11D621F839FA00D611D221FC3
:10515000749F3327A00D611D231F849F600D211DA7
:10516000822F762F6A2F11249F5750408AF0E1F04A
:1051700088234AF0EE0FFF1FBB1F661F771F881F93
:1051800091505040A9F79E3F510570F0ECCE76CF7C
:105190005F3FECF3983EDCF3869577956795B7957E
:1051A000F795E7959F5FC1F7FE2B880F911D9695A8
:1051B000879597F9089530DFE0F09E37D8F096395B
:1051C000B8F49E3848F4672F782F8827985FF9CF76
:1051D00086957795679593959539D0F3B62FB170ED
:1051E0006B0F711D811D20F48795779567959395B9
:1051F000C0CEDACE43CF11F40EF4E4CED5CE0CDF20
:10520000D0F39923D9F3CEF39F57550B87FF3CD0AA
:105210000024A0E640EA900180585695979528F41E
:10522000805C660F771F881F20F026173707480716
:1052300030F4621B730B840B202931294A2BA6956D
:1052400017940794202531254A2758F7660F771FB2
:10525000881F20F026173707480730F4620B730BBE
:10526000840B200D311D411DA09581F7B901842FBC
:105270009158880F969587950895E8DE20F09F371E
:1052800008F4FCCE76CE90CE91505040660F771F3A
:10529000881FD2F708950E948A29A59F900DB49F78
:1052A000900DA49F800D911D11240895991B79E004
:1052B00004C0991F961708F0961B881F7A95C9F7A6
:1052C00080950895A1E21A2EAA1BBB1BFD010DC0FB
:1052D000AA1FBB1FEE1FFF1FA217B307E407F507A6
:1052E00020F0A21BB30BE40BF50B661F771F881F82
:1052F000991F1A9469F760957095809590959B0118
:10530000AC01BD01CF010895EE0FFF1F0590F49190
:10531000E02D0994A29FB001B39FC001A39F700D1F
:10532000811D1124911DB29F700D811D1124911DAD
:105330000895FB019F01E8944230C4F04532B4F473
:105340004A3029F497FB1EF4909581959F4F642F66
:1053500077270E94CA29805D8A330CF0895D81938A
:10536000CB010097A1F716F45DE251931082C901B9
:105370000C94BA29DC01FC01672F71917723E1F7C6
:10538000329704C07C916D9370836291AE17BF0712
:10539000C8F30895AA1BBB1B51E107C0AA1FBB1F7E
:1053A000A617B70710F0A61BB70B881F991F5A95B1
:1053B000A9F780959095BC01CD010895F894FFCF91
:0E53C0000000E5062000040810200D0A000081
:00000001FF
|
{
"pile_set_name": "Github"
}
|
package io.gitlab.arturbosch.detekt.rules.style
import io.gitlab.arturbosch.detekt.api.CodeSmell
import io.gitlab.arturbosch.detekt.api.Config
import io.gitlab.arturbosch.detekt.api.Debt
import io.gitlab.arturbosch.detekt.api.Entity
import io.gitlab.arturbosch.detekt.api.Issue
import io.gitlab.arturbosch.detekt.api.Rule
import io.gitlab.arturbosch.detekt.api.Severity
import org.jetbrains.kotlin.psi.KtClass
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtNamedFunction
import org.jetbrains.kotlin.psi.KtTypeAlias
import org.jetbrains.kotlin.psi.psiUtil.isPublic
/**
* Library typealias and classes should be internal or private.
*
* <noncompliant>
* // code from a library
* class A
* </noncompliant>
*
* <compliant>
* // code from a library
* internal class A
* </compliant>
*
* @since 1.11.0
*/
class LibraryEntitiesShouldNotBePublic(ruleSetConfig: Config = Config.empty) : Rule(ruleSetConfig) {
override val issue: Issue = Issue(
javaClass.simpleName,
Severity.Style,
"Library class should not be public",
Debt.FIVE_MINS
)
override fun visitCondition(root: KtFile): Boolean = super.visitCondition(root) && filters != null
override fun visitClass(klass: KtClass) {
if (klass.isInner()) {
return
}
if (klass.isPublic) {
report(CodeSmell(issue, Entity.from(klass), "Class ${klass.nameAsSafeName} should not be public"))
}
}
override fun visitTypeAlias(typeAlias: KtTypeAlias) {
if (typeAlias.isPublic) {
report(CodeSmell(issue,
Entity.from(typeAlias),
"TypeAlias ${typeAlias.nameAsSafeName} should not be public"))
}
}
override fun visitNamedFunction(function: KtNamedFunction) {
if (function.isTopLevel && function.isPublic) {
report(CodeSmell(issue,
Entity.from(function),
"Top level function ${function.nameAsSafeName} should not be public"))
}
}
}
|
{
"pile_set_name": "Github"
}
|
{erl_opts, [debug_info, warn_export_vars]}.
{xref_checks, [undefined_function_calls]}.
{eunit_opts, [verbose]}.
{plugins, [rebar3_hex]}.
|
{
"pile_set_name": "Github"
}
|
Copyright (c) 2005-2013 Joergen Ibsen
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.
|
{
"pile_set_name": "Github"
}
|
sha1
|
{
"pile_set_name": "Github"
}
|
# Elm 架構
本章節包含:
- Elm 架構基本概論
- Html.App.program 介紹
- 訊息(Messages)
- 命令(Commands)
- 訂閱(Subscriptions)
|
{
"pile_set_name": "Github"
}
|
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
}
}
|
{
"pile_set_name": "Github"
}
|
namespace CSUtil.Commons {
using UnityEngine;
public static class VectorUtil {
/// <summary>
/// Given a rectangle and screen resolution, pushes the rectangle back into screen space
/// if it was moved beyond any screen edge.
/// </summary>
/// <param name="rect">The subject rectangle</param>
/// <param name="resolution">The limiting rectangle from (0, 0) to resolution</param>
public static void ClampRectToScreen(ref Rect rect, Vector2 resolution) {
rect.x = Mathf.Clamp(rect.x, 0f, resolution.x - rect.width);
rect.y = Mathf.Clamp(rect.y, 0f, resolution.y - rect.height);
}
}
}
|
{
"pile_set_name": "Github"
}
|
import React from 'react';
import { expect } from 'chai';
import { shallow } from 'enzyme';
import Panel from 'src/components/Panel';
describe('Panel', () => {
it('should render title if passed', () => {
const props = { title: 'title' };
expect(shallow(<Panel {...props} />).find('.panel-title')).to.have.length(1);
});
it('should not render title if not passed', () => {
const props = { };
expect(shallow(<Panel {...props} />).find('.panel-title')).to.have.length(0);
});
it('should render className if passed', () => {
const props = { className: 'sweet-panel' };
expect(shallow(<Panel {...props} />).is(`.${props.className}`)).to.be.true();
});
it('should pass onClick', () => {
const props = { onClick: () => {} };
expect(shallow(<Panel {...props} />).prop('onClick')).to.deep.equal(props.onClick);
});
});
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.