text
stringlengths 2
99.5k
| meta
dict |
|---|---|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "mozilla/dom/SVGCircleElement.h"
#include "mozilla/gfx/2D.h"
#include "nsGkAtoms.h"
#include "gfxContext.h"
#include "mozilla/dom/SVGCircleElementBinding.h"
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Circle)
using namespace mozilla::gfx;
namespace mozilla {
namespace dom {
JSObject*
SVGCircleElement::WrapNode(JSContext *aCx)
{
return SVGCircleElementBinding::Wrap(aCx, this);
}
nsSVGElement::LengthInfo SVGCircleElement::sLengthInfo[3] =
{
{ &nsGkAtoms::cx, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X },
{ &nsGkAtoms::cy, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::Y },
{ &nsGkAtoms::r, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::XY }
};
//----------------------------------------------------------------------
// Implementation
SVGCircleElement::SVGCircleElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: SVGCircleElementBase(aNodeInfo)
{
}
//----------------------------------------------------------------------
// nsIDOMNode methods
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGCircleElement)
//----------------------------------------------------------------------
already_AddRefed<SVGAnimatedLength>
SVGCircleElement::Cx()
{
return mLengthAttributes[ATTR_CX].ToDOMAnimatedLength(this);
}
already_AddRefed<SVGAnimatedLength>
SVGCircleElement::Cy()
{
return mLengthAttributes[ATTR_CY].ToDOMAnimatedLength(this);
}
already_AddRefed<SVGAnimatedLength>
SVGCircleElement::R()
{
return mLengthAttributes[ATTR_R].ToDOMAnimatedLength(this);
}
//----------------------------------------------------------------------
// nsSVGElement methods
/* virtual */ bool
SVGCircleElement::HasValidDimensions() const
{
return mLengthAttributes[ATTR_R].IsExplicitlySet() &&
mLengthAttributes[ATTR_R].GetAnimValInSpecifiedUnits() > 0;
}
nsSVGElement::LengthAttributesInfo
SVGCircleElement::GetLengthInfo()
{
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
ArrayLength(sLengthInfo));
}
//----------------------------------------------------------------------
// nsSVGPathGeometryElement methods
void
SVGCircleElement::ConstructPath(gfxContext *aCtx)
{
float x, y, r;
GetAnimatedLengthValues(&x, &y, &r, nullptr);
if (r > 0.0f)
aCtx->Arc(gfxPoint(x, y), r, 0, 2*M_PI);
}
TemporaryRef<Path>
SVGCircleElement::BuildPath(PathBuilder* aBuilder)
{
float x, y, r;
GetAnimatedLengthValues(&x, &y, &r, nullptr);
if (r <= 0.0f) {
return nullptr;
}
RefPtr<PathBuilder> pathBuilder = aBuilder ? aBuilder : CreatePathBuilder();
pathBuilder->Arc(Point(x, y), r, 0, Float(2*M_PI));
return pathBuilder->Finish();
}
} // namespace dom
} // namespace mozilla
|
{
"pile_set_name": "Github"
}
|
<Workspace Version="1.0.1.1821" X="126.45345609826" Y="-146.195429573173" zoom="0.979089623423451" Name="Home" Description="" RunType="Manual" RunPeriod="1000" HasRunWithoutCrash="False">
<NamespaceResolutionMap />
<Elements>
<CoreNodeModels.Input.DoubleSlider guid="74ddd04a-7367-4df1-b2a7-4fd38b43b91d" type="CoreNodeModels.Input.DoubleSlider" nickname="Number Slider" x="-63.9999999999995" y="40" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="True" IsFrozen="false" isPinned="false">
<System.Double>6.515</System.Double>
<Range min="0" max="20" step="0.1" />
</CoreNodeModels.Input.DoubleSlider>
<CoreNodeModels.Input.DoubleSlider guid="ff56b080-a7f6-43af-9493-e1cf18a05064" type="CoreNodeModels.Input.DoubleSlider" nickname="Number Slider" x="-63.9999999999995" y="166.944444444445" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="True" IsFrozen="false" isPinned="false">
<System.Double>10.136</System.Double>
<Range min="0" max="20" step="0.1" />
</CoreNodeModels.Input.DoubleSlider>
<Dynamo.Graph.Nodes.CodeBlockNodeModel guid="2d25a0e9-96de-4e77-b65f-e6cb0c627361" type="Dynamo.Graph.Nodes.CodeBlockNodeModel" nickname="Code Block" x="190.242424242424" y="64.6666666666667" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false" CodeText="domain[0][0]..domain[1][0]..#ucount+1;
domain[0][1]..domain[1][1]..#vcount+1;" ShouldFocus="false" />
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="88eef2ea-8304-4b9a-be32-ace885b25862" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="UV.ByCoordinates" x="190.242424242424" y="164.666666666667" isVisible="true" isUpstreamVisible="true" lacing="CrossProduct" isSelectedInput="False" IsFrozen="false" isPinned="false" assembly="ProtoGeometry.dll" function="Autodesk.DesignScript.Geometry.UV.ByCoordinates@double,double" />
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="f12819a1-2524-4bbb-9023-81e8123f25e2" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="Flatten" x="340.242424242424" y="64.6666666666667" isVisible="true" isUpstreamVisible="true" lacing="Shortest" isSelectedInput="False" IsFrozen="false" isPinned="false" assembly="BuiltIn" function="Flatten@var[]..[]" />
<Dynamo.Graph.Nodes.CodeBlockNodeModel guid="ece35171-b7df-48ab-923b-6fe45f6b2d07" type="Dynamo.Graph.Nodes.CodeBlockNodeModel" nickname="Code Block" x="188.575757575758" y="189.724747474747" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false" CodeText="domain[0][0]..domain[1][0]..#ucount+1;
domain[0][1]..domain[1][1]..#vcount+1;" ShouldFocus="false" />
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="438ed167-47d2-4880-b999-21c8436dafb5" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="UV.ByCoordinates" x="188.575757575758" y="289.724747474747" isVisible="true" isUpstreamVisible="true" lacing="CrossProduct" isSelectedInput="False" IsFrozen="false" isPinned="false" assembly="ProtoGeometry.dll" function="Autodesk.DesignScript.Geometry.UV.ByCoordinates@double,double" />
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="ba00a157-83b4-47f0-849f-749609635fd3" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="Flatten" x="338.575757575758" y="189.724747474747" isVisible="true" isUpstreamVisible="true" lacing="Shortest" isSelectedInput="False" IsFrozen="false" isPinned="false" assembly="BuiltIn" function="Flatten@var[]..[]" />
<Dynamo.Graph.Nodes.ZeroTouch.DSVarArgFunction guid="971c93a1-cbdf-4aee-9378-71fd257dd941" type="Dynamo.Graph.Nodes.ZeroTouch.DSVarArgFunction" nickname="List.Join" x="583.416666666666" y="216.638888888888" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false" assembly="DSCoreNodes.dll" function="DSCore.List.Join@var[]..[]" inputcount="2" />
<Dynamo.Graph.Nodes.CodeBlockNodeModel guid="3a0e4a80-429a-4bb0-8bb1-5569a6310145" type="Dynamo.Graph.Nodes.CodeBlockNodeModel" nickname="Get Surface Domain" x="121.722222222222" y="277.666666666666" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false" CodeText="{{0,0},{1,1}};" ShouldFocus="false" />
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="623ce1f8-4b9a-42a6-bf5b-5de791b3ee8d" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="Surface.PointAtParameter" x="651.094696969696" y="51.6559343434337" isVisible="true" isUpstreamVisible="true" lacing="Longest" isSelectedInput="False" IsFrozen="false" isPinned="false" assembly="ProtoGeometry.dll" function="Autodesk.DesignScript.Geometry.Surface.PointAtParameter@double,double" />
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="9052fadc-5159-452a-a128-16150b900d67" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="UV.U" x="501.094696969696" y="51.6559343434337" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false" assembly="ProtoGeometry.dll" function="Autodesk.DesignScript.Geometry.UV.U" />
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="a68015db-f99d-4491-a9ed-470497dd1f87" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="UV.V" x="501.094696969696" y="151.655934343434" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false" assembly="ProtoGeometry.dll" function="Autodesk.DesignScript.Geometry.UV.V" />
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="c6705797-2d7a-48ae-86fd-4ae5b5c86025" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="Voronoi.ByParametersOnSurface" x="842.371984614853" y="177.049537427381" isVisible="true" isUpstreamVisible="true" lacing="Shortest" isSelectedInput="False" IsFrozen="false" isPinned="false" assembly="Tessellation.dll" function="Tessellation.Voronoi.ByParametersOnSurface@Autodesk.DesignScript.Geometry.UV[],Autodesk.DesignScript.Geometry.Surface" />
<Dynamo.Nodes.DSFaceSelection guid="38f3892e-cbb6-43b4-820a-4d7a71ecf333" type="Dynamo.Nodes.DSFaceSelection" nickname="Select Face" x="-63.9999999999995" y="396.559228567496" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="True" IsFrozen="false" isPinned="false">
<instance id="16e58ffa-d140-450b-96cc-558991852bd0-0000e945:16:SURFACE" />
</Dynamo.Nodes.DSFaceSelection>
<CoreNodeModels.CreateList guid="e0742a93-a903-484c-a8ec-6eb6bf2e3cfc" type="CoreNodeModels.CreateList" nickname="Create List" x="1070.26136363636" y="151.378156565656" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false" inputcount="2" />
<Watch3DNodeModels.Watch3D guid="a021abbe-950e-4c5b-8359-374139248fea" type="Watch3DNodeModels.Watch3D" nickname="Watch 3D" x="1394.01326272945" y="144.264048672435" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false">
<view width="239" height="429">
<Camera Name="a021abbe-950e-4c5b-8359-374139248fea Preview" eyeX="-17" eyeY="24" eyeZ="50" lookX="12" lookY="-13" lookZ="-58" upX="0" upY="1" upZ="0" />
<Camera Name="a021abbe-950e-4c5b-8359-374139248fea Preview" eyeX="-17" eyeY="24" eyeZ="50" lookX="12" lookY="-13" lookZ="-58" upX="0" upY="1" upZ="0" />
</view>
</Watch3DNodeModels.Watch3D>
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="766acb4e-9065-4048-aaa0-ab1ee1567c5c" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="ModelCurve.ByCurve" x="983.166666666667" y="250.578029033703" isVisible="true" isUpstreamVisible="true" lacing="Longest" isSelectedInput="False" IsFrozen="false" isPinned="false" assembly="RevitNodes.dll" function="Revit.Elements.ModelCurve.ByCurve@Autodesk.DesignScript.Geometry.Curve" />
<Dynamo.Graph.Nodes.ZeroTouch.DSFunction guid="a80c323f-7443-42fd-a38c-4a84623fdeb5" type="Dynamo.Graph.Nodes.ZeroTouch.DSFunction" nickname="Flatten" x="1225.965989014" y="-32.770343148435" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false" assembly="BuiltIn" function="Flatten@var[]..[]" />
</Elements>
<Connectors>
<Dynamo.Graph.Connectors.ConnectorModel start="74ddd04a-7367-4df1-b2a7-4fd38b43b91d" start_index="0" end="2d25a0e9-96de-4e77-b65f-e6cb0c627361" end_index="1" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="74ddd04a-7367-4df1-b2a7-4fd38b43b91d" start_index="0" end="2d25a0e9-96de-4e77-b65f-e6cb0c627361" end_index="2" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="ff56b080-a7f6-43af-9493-e1cf18a05064" start_index="0" end="ece35171-b7df-48ab-923b-6fe45f6b2d07" end_index="1" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="ff56b080-a7f6-43af-9493-e1cf18a05064" start_index="0" end="ece35171-b7df-48ab-923b-6fe45f6b2d07" end_index="2" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="2d25a0e9-96de-4e77-b65f-e6cb0c627361" start_index="0" end="88eef2ea-8304-4b9a-be32-ace885b25862" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="2d25a0e9-96de-4e77-b65f-e6cb0c627361" start_index="1" end="88eef2ea-8304-4b9a-be32-ace885b25862" end_index="1" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="88eef2ea-8304-4b9a-be32-ace885b25862" start_index="0" end="f12819a1-2524-4bbb-9023-81e8123f25e2" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="f12819a1-2524-4bbb-9023-81e8123f25e2" start_index="0" end="971c93a1-cbdf-4aee-9378-71fd257dd941" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="ece35171-b7df-48ab-923b-6fe45f6b2d07" start_index="0" end="438ed167-47d2-4880-b999-21c8436dafb5" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="ece35171-b7df-48ab-923b-6fe45f6b2d07" start_index="1" end="438ed167-47d2-4880-b999-21c8436dafb5" end_index="1" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="438ed167-47d2-4880-b999-21c8436dafb5" start_index="0" end="ba00a157-83b4-47f0-849f-749609635fd3" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="ba00a157-83b4-47f0-849f-749609635fd3" start_index="0" end="971c93a1-cbdf-4aee-9378-71fd257dd941" end_index="1" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="ba00a157-83b4-47f0-849f-749609635fd3" start_index="0" end="9052fadc-5159-452a-a128-16150b900d67" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="ba00a157-83b4-47f0-849f-749609635fd3" start_index="0" end="a68015db-f99d-4491-a9ed-470497dd1f87" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="971c93a1-cbdf-4aee-9378-71fd257dd941" start_index="0" end="c6705797-2d7a-48ae-86fd-4ae5b5c86025" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="3a0e4a80-429a-4bb0-8bb1-5569a6310145" start_index="0" end="2d25a0e9-96de-4e77-b65f-e6cb0c627361" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="3a0e4a80-429a-4bb0-8bb1-5569a6310145" start_index="0" end="ece35171-b7df-48ab-923b-6fe45f6b2d07" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="623ce1f8-4b9a-42a6-bf5b-5de791b3ee8d" start_index="0" end="e0742a93-a903-484c-a8ec-6eb6bf2e3cfc" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="9052fadc-5159-452a-a128-16150b900d67" start_index="0" end="623ce1f8-4b9a-42a6-bf5b-5de791b3ee8d" end_index="1" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="a68015db-f99d-4491-a9ed-470497dd1f87" start_index="0" end="623ce1f8-4b9a-42a6-bf5b-5de791b3ee8d" end_index="2" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="c6705797-2d7a-48ae-86fd-4ae5b5c86025" start_index="0" end="e0742a93-a903-484c-a8ec-6eb6bf2e3cfc" end_index="1" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="38f3892e-cbb6-43b4-820a-4d7a71ecf333" start_index="0" end="623ce1f8-4b9a-42a6-bf5b-5de791b3ee8d" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="38f3892e-cbb6-43b4-820a-4d7a71ecf333" start_index="0" end="c6705797-2d7a-48ae-86fd-4ae5b5c86025" end_index="1" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="e0742a93-a903-484c-a8ec-6eb6bf2e3cfc" start_index="0" end="a021abbe-950e-4c5b-8359-374139248fea" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="e0742a93-a903-484c-a8ec-6eb6bf2e3cfc" start_index="0" end="a80c323f-7443-42fd-a38c-4a84623fdeb5" end_index="0" portType="0" />
</Connectors>
<Notes>
<Dynamo.Graph.Notes.NoteModel guid="64bf90a6-7530-468e-b81e-fc20c3278a7d" text="Wiggle Sliders 
for Awesome" x="0" y="-60.377275265928" />
</Notes>
<Annotations />
<Presets />
<Cameras>
<Camera Name="Background Preview" eyeX="-17" eyeY="24" eyeZ="50" lookX="12" lookY="-13" lookZ="-58" upX="0" upY="1" upZ="0" />
</Cameras>
</Workspace>
|
{
"pile_set_name": "Github"
}
|
SUBROUTINE BSEQGP (NORIG,ILD,JUMP)
C
EXTERNAL ORF
INTEGER GEOM1, GEOM2, SEQGP(3), EOF(3), SUB(2),
1 TWO, ORF, OBW, OP, RD,
2 RDREW, WRT, WRTREW, REW, GRID(8),
3 Z
DIMENSION NORIG(2), ILD(1), ISYS(100)
COMMON /BANDA / IBUF1, DUM2A(2), NOPCH, DUM1A, METHOD,
1 ICRIT, NGPTS, NSPTS
COMMON /BANDB / NBIT, KORE, DUM1B, NGRD
COMMON /BANDD / OBW, NBW, OP, NP, NCM,
1 NZERO, NEL, NEQ, NEQR
COMMON /BANDS / NN, MM, DUM2(2), NGRID, DUM3(3),
1 MINDEG, NEDGE
COMMON /BANDW / MAXW0, RMS0, MAXW1, RMS1, I77,
1 BRMS0, BRMS1
COMMON /TWO / TWO(1)
COMMON /SYSTEM/ IBUF, NOUT
COMMON /NAMES / RD, RDREW, WRT, WRTREW, REW,
1 NOREW
COMMON /GEOMX / GEOM1, GEOM2
COMMON /ZZZZZZ/ Z(1)
EQUIVALENCE (IBUF,ISYS(1)), (NLPP,ISYS(9)),
1 (LPCH,ISYS(91)), (IECHO,ISYS(19))
DATA SUB , EOF , SEQGP /
1 4HSSEQ, 4HGP , 3*2147483647, 5301, 53, 4 /
C
C THIS ROUTINE IS USED ONLY IN BANDIT MODULE
C
C NORIG(I) = ORIGINAL GRID POINT CORRESPONDING TO BANDIT INTERNAL
C LABLE I
C ILD(I) = NEW RESEQUENCED LABEL CORRESPONDING TO BANDIT INTERNAL
C LABLE I
C NN = NUMBER OF GRID POINTS
C NGRD .LT.0, INSUFF. WORKING CORE, OR SCRATCH ARRAY FOR BANDIT
C
J77 = 0
IF (NN.LE.0 .OR. NGRD.LT.0) GO TO 145
C
C PRINT BANDIT SUMMARY.
C
IF (NLPP.LE.48 .AND. METHOD.EQ.0) CALL PAGE1
WRITE (NOUT,10)
10 FORMAT (//53X,22H*** BANDIT SUMMARY ***,/,
1 /72X,6HBEFORE,5X,5HAFTER)
C
WRITE (NOUT,20) OBW,NBW,OP,NP,MAXW0,MAXW1
20 FORMAT (40X,13HBANDWIDTH (B),15X,2I10,
1 /40X,11HPROFILE (P), 17X,2I10,
2 /40X,25HMAXIMUM WAVEFRONT (C-MAX),3X,2I10)
C
ANN = FLOAT(NN)
AV1 = FLOAT(OP)/ANN
AV2 = FLOAT(NP)/ANN
WRITE (NOUT,30) AV1,AV2,RMS0,RMS1,BRMS0,BRMS1,NGPTS
30 FORMAT (40X,25HAVERAGE WAVEFRONT (C-AVG),3X,2F10.3,
1 /40X,21HRMS WAVEFRONT (C-RMS),7X,2F10.3,
2 /40X,21HRMS BANDWITCH (B-RMS),7X,2F10.3,
3 /40X,25HNUMBER OF GRID POINTS (N),15X,I8)
C
IF (NSPTS .GT. 0) WRITE (NOUT,35) NSPTS
35 FORMAT (40X,23HNUMBER OF SCALAR POINTS,17X,I8)
C
WRITE (NOUT,40) NEL,NEQR,NEQ
40 FORMAT (40X,30HNUMBER OF ELEMENTS (NON-RIGID) ,10X,I8,
1 /40X,35HNUMBER OF RIGID ELEMENTS PROCESSED*,5X,I8,
2 /40X,35HNUMBER OF MPC EQUATIONS PROCESSED*,5X,I8)
C
WRITE (NOUT,50) NCM,MM,MINDEG
50 FORMAT (40X,20HNUMBER OF COMPONENTS,20X,I8,
1 /40X,20HMAXIMUM NODAL DEGREE,20X,I8,
2 /40X,20HMINIMUM NODAL DEGREE,20X,I8)
C
NONZ = 2*NEDGE + NN
AN = NN*NN
DEN = FLOAT(NONZ)*100./AN
WRITE (NOUT,60) NEDGE,DEN,NZERO,KORE
60 FORMAT (40X,22HNUMBER OF UNIQUE EDGES,18X,I8,
1 /40X,23HMATRIX DENSITY, PERCENT, 16X,F9.3,
2 /40X,31HNUMBER OF POINTS OF ZERO DEGREE,9X,I8,
3 /40X,16HBANDIT OPEN CORE,24X,I8)
C
IF (ICRIT .EQ. 1) WRITE (NOUT,61)
IF (ICRIT .EQ. 2) WRITE (NOUT,62)
IF (ICRIT .EQ. 3) WRITE (NOUT,63)
IF (ICRIT .EQ. 4) WRITE (NOUT,64)
61 FORMAT (40X,10HCRITERION*,25X,13HRMS WAVEFRONT)
62 FORMAT (40X,10HCRITERION*,29X,9HBANDWIDTH)
63 FORMAT (40X,10HCRITERION*,31X,7HPROFILE)
64 FORMAT (40X,10HCRITERION*,25X,13HMAX WAVEFRONT)
C
IF (METHOD .EQ. -1) WRITE (NOUT,66)
IF (METHOD .EQ. +1) WRITE (NOUT,67)
IF (METHOD .EQ. 0) WRITE (NOUT,68)
66 FORMAT (40X,12HMETHOD USED*,34X,2HCM)
67 FORMAT (40X,12HMETHOD USED*,33X,3HGPS)
68 FORMAT (40X,12HMETHOD USED*,26X,10HCM AND GPS)
C
IF (JUMP .EQ. 0) GO TO 90
WRITE (NOUT,75)
75 FORMAT (/31X,'(* THESE DEFAULT OPTIONS CAN BE OVERRIDDEN BY THE',
1 ' NASTRAN CARD)')
WRITE (NOUT,80)
80 FORMAT (//31X,'BANDIT FINDS GRID POINT RE-SEQUENCING NOT ',
1 'NECESSARY')
GO TO 142
C
C GENERATE SEQGP ARRAY AND OUTPUT SEQGP CARDS
C
90 J = 0
DO 100 I = 1,NN
Z(J+1) = NORIG(I)
Z(J+2) = ILD(I)
100 J = J + 2
CALL SORT (0,0,2,1,Z(1),J)
C
C CHECK AGAINST ORIGINAL GRID POINT DATA, AND SEE ANY UNUSED GRIDS
C (SUCH AS THE THIRD GRID ON CBAR CARD). IF THEY EXIST, BRING THEM
C IN, AND RE-SORT TABLE. (GEOM1 IS READY HERE, SEE BGRID)
C
CALL OPEN (*160,GEOM1,Z(IBUF1),RD)
NNX = NN
IF (NN .EQ. NGRID) GO TO 106
CALL READ (*104,*104,GEOM1,GRID,3,0,K)
102 CALL READ (*104,*104,GEOM1,GRID,8,0,K)
CALL BISLOC (*103,GRID(1),Z,2,NNX,K)
GO TO 102
103 NN = NN + 1
Z(J+1) = GRID(1)
Z(J+2) = NN
J = J + 2
GO TO 102
C
C DO THE SAME CHECK IF SCALAR POINTS ARE PRESENT
C
104 IF (NSPTS .EQ. 0) GO TO 1045
NONZ = J + 2*NSPTS + 2
CALL PRELOC (*1045,Z(NONZ),GEOM2)
GRID(1) = 5551
GRID(2) = 49
CALL LOCATE (*1044,Z(NONZ),GRID,K)
1042 CALL READ (*1044,*1044,GEOM2,I,1,0,K)
CALL BISLOC (*1043,I,Z,2,NNX,K)
GO TO 1042
1043 NN = NN + 1
Z(J+1) = I
Z(J+2) = NN
J = J + 2
GO TO 1042
1044 CALL CLOSE (GEOM2,REW)
1045 I = NN - NNX
IF (I .GT. 0) WRITE (NOUT,105) I
105 FORMAT (40X,29HNO. OF NON-ACTIVE GRID POINTS,11X,I8)
106 I = (J+7)/8
WRITE (NOUT,107) I
107 FORMAT (40X,28HNO. OF SEQGP CARDS GENERATED,12X,I8)
WRITE (NOUT,75)
IF (NOPCH .EQ. +9) GO TO 147
IF (NNX .NE. NN) CALL SORT (0,0,2,1,Z(1),J)
IF (IECHO .EQ. -1) GO TO 125
CALL PAGE1
WRITE (NOUT,110)
110 FORMAT (//35X,52HS Y S T E M G E N E R A T E D S E Q G P C A R
1D S,/)
WRITE (NOUT,120) (Z(I),I=1,J)
120 FORMAT (25X,8HSEQGP ,8I8)
121 FORMAT ( 8HSEQGP ,8I8)
125 IF (NOPCH .LE. 0) GO TO 130
WRITE (LPCH,121) (Z(I),I=1,J)
127 J77 = -2
GO TO 141
C
C BEEF UP INTERNAL GRID NOS. BY 1000 AS REQUIRED BY NASTRAN
C
130 DO 140 I = 2,J,2
140 Z(I) = Z(I)*1000
C
C REWIND AND SKIP FORWARDS TO THE END OF GEOM1 FILE.
C OVERWRITE THE OLD SEQGP RECORD IF NECESSARY.
C (WARNING - IF SEQGP IS NOT THE VERY LAST ITEM IN GEOM1 FILE, THE
C FOLLOWING LOGIC OF INSERTING SEQGP CARDS NEEDS MODIFICATION -
C BECAUSE GEOM1 IS IN ALPHA-NUMERIC SORTED ORDER).
C
CALL REWIND (GEOM1)
CALL SKPFIL (GEOM1,+1)
CALL SKPFIL (GEOM1,-1)
CALL BCKREC (GEOM1)
CALL READ (*150,*150,GEOM1,NORIG(1),3,1,I)
IF (NORIG(1).EQ.SEQGP(1) .AND. NORIG(2).EQ.SEQGP(2))
1 CALL BCKREC (GEOM1)
CALL CLOSE (GEOM1,NOREW)
C
C ADD SEQGP CARDS TO THE END OF GEOM1 FILE
C SET GEOM1 TRAILER, AND CLEAR /SYSTEM/ 76TH WORD
C
CALL OPEN (*160,GEOM1,Z(IBUF1),WRT)
CALL WRITE (GEOM1,SEQGP(1),3,0)
CALL WRITE (GEOM1,Z(1),J,1)
CALL WRITE (GEOM1,EOF(1),3,1)
C
Z(1) = GEOM1
CALL RDTRL (Z(1))
I = (SEQGP(2)+31)/16
J = SEQGP(2)-I*16 + 48
Z(I) = ORF(Z(I),TWO(J))
CALL WRTTRL (Z(1))
141 CALL CLOSE (GEOM1,REW)
142 DO 143 I = 1,KORE
143 Z(I) = 0
145 ISYS(I77) = J77
IF (NGRD .LT. 0) RETURN
CALL PAGE2 (-2)
WRITE (NOUT,146)
146 FORMAT (1H0,9X,45H**NO ERRORS FOUND - EXECUTE NASTRAN PROGRAM**)
RETURN
C
C SPECIAL PUNCH OPTION (BANDTPCH=+9)
C TO PUNCH OUT EXTERNAL GRIDS IN RE-SEQUENCED INTERNAL ORDER
C
147 CALL SORT (0,0,2,2,Z(1),J)
WRITE (NOUT,148) (Z(I),I=1,J,2)
148 FORMAT (1H1,35X,59HLIST OF EXTERNAL GRID POINTS IN INTERNAL RE-SEQ
1UENCED ORDER,/4X,31(4H----),/,(/5X,15I8))
WRITE (LPCH,149) (Z(I),I=1,J,2)
149 FORMAT (10I7)
GO TO 127
C
C FILE ERROR
C
150 K = -2
GO TO 170
160 K = -1
170 CALL MESAGE (K,GEOM1,SUB)
RETURN
END
|
{
"pile_set_name": "Github"
}
|
<html class="reftest-wait">
<head>
<script type="text/javascript">
window.onload = function() {
// Get the frame
var frame = document.getElementById("testframe");
// Set margin* attributes
frame.marginWidth = "30px";
frame.marginHeight = "20px";
// Trigger the reftest snapshot
document.documentElement.className = '';
}
</script>
</head>
<body>
<iframe id="testframe" src="653930-1-iframe.html">
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
#%RAML 1.0 DataType
description: |
This resource type describes completed and in-progress buildrequests.
Much of the contextual data for a buildrequest is associated with the buildset that contains this buildrequest.
Update Methods
--------------
All update methods are available as attributes of ``master.data.updates``.
.. py:class:: buildbot.data.buildrequests.BuildRequest
.. py:method:: claimBuildRequests(brids, claimed_at=None)
:param list(integer) brids: list of buildrequest id to claim
:param datetime claimed_at: date and time when the buildrequest is claimed
:returns: (boolean) whether claim succeeded or not
Claim a list of buildrequests
.. py:method:: unclaimBuildRequests(brids)
:param list(integer) brids: list of buildrequest id to unclaim
Unclaim a list of buildrequests
.. py:method:: completeBuildRequests(brids, results, complete_at=None)
:param list(integer) brids: list of buildrequest id to complete
:param integer results: the results of the buildrequest (see :ref:`Build-Result-Codes`)
:param datetime complete_at: date and time when the buildrequest is completed
Complete a list of buildrequest with the ``results`` status
properties:
buildrequestid:
description: the unique ID of this buildrequest
type: integer
builderid:
description: the id of the builder linked to this buildrequest
type: integer
buildsetid:
description: the id of the buildset that contains this buildrequest
type: integer
claimed:
description: |
True if this buildrequest has been claimed.
Note that this is a calculated field (from claimed_at != None).
Ordering by this field is not optimized by the database layer.
type: boolean
claimed_at?:
description: |
time at which this build has last been claimed.
None if this buildrequest has never been claimed or has been unclaimed
type: date
claimed_by_masterid?:
description: |
the id of the master that claimed this buildrequest.
None if this buildrequest has never been claimed or has been unclaimed
type: integer
complete:
description: true if this buildrequest is complete
type: boolean
complete_at?:
description: |
time at which this buildrequest was completed, or None if it's still running
type: date
priority:
description: the priority of this buildrequest
type: integer
properties?:
description: a dictionary of properties corresponding to buildrequest.
type: sourcedproperties
results?:
description: |
the results of this buildrequest (see :ref:`Build-Result-Codes`), or None if not complete
type: integer
submitted_at:
description: time at which this buildrequest were submitted
type: date
waited_for:
description: |
True if the entity that triggered this buildrequest is waiting for it to complete.
Should be used by an (unimplemented so far) clean shutdown to only start br that are waited_for.
type: boolean
type: object
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Theme\Model\Theme;
use Magento\Framework\Filesystem;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\View\Design\ThemeInterface;
/**
* Theme registration model class
*/
class Registration
{
/**
* @var \Magento\Theme\Model\ResourceModel\Theme\Data\CollectionFactory
*/
protected $_collectionFactory;
/**
* Collection of themes in file-system
*
* @var Collection
*/
protected $_themeCollection;
/**
* Allowed sequence relation by type, array(parent theme, child theme)
*
* @var array
*/
protected $_allowedRelations = [
[ThemeInterface::TYPE_PHYSICAL, ThemeInterface::TYPE_VIRTUAL],
[ThemeInterface::TYPE_VIRTUAL, ThemeInterface::TYPE_STAGING],
];
/**
* Forbidden sequence relation by type
*
* @var array
*/
protected $_forbiddenRelations = [
[ThemeInterface::TYPE_VIRTUAL, ThemeInterface::TYPE_VIRTUAL],
[ThemeInterface::TYPE_PHYSICAL, ThemeInterface::TYPE_STAGING],
];
/**
* Initialize dependencies
*
* @param \Magento\Theme\Model\ResourceModel\Theme\Data\CollectionFactory $collectionFactory
* @param \Magento\Theme\Model\Theme\Data\Collection $filesystemCollection
*/
public function __construct(
\Magento\Theme\Model\ResourceModel\Theme\Data\CollectionFactory $collectionFactory,
\Magento\Theme\Model\Theme\Data\Collection $filesystemCollection
) {
$this->_collectionFactory = $collectionFactory;
$this->_themeCollection = $filesystemCollection;
}
/**
* Theme registration
*
* @return $this
*/
public function register()
{
$this->_themeCollection->clear();
foreach ($this->_themeCollection as $theme) {
$this->_registerThemeRecursively($theme);
}
$this->checkPhysicalThemes()->checkAllowedThemeRelations();
return $this;
}
/**
* Register theme and recursively all its ascendants
*
* Second param is optional and is used to prevent circular references in inheritance chain
*
* @param ThemeInterface &$theme
* @param array $inheritanceChain
* @return $this
*
* @throws LocalizedException
*/
protected function _registerThemeRecursively(&$theme, $inheritanceChain = [])
{
if ($theme->getId()) {
return $this;
}
$themeModel = $this->getThemeFromDb($theme->getFullPath());
if ($themeModel->getId()) {
$theme = $themeModel;
return $this;
}
$tempId = $theme->getFullPath();
if (in_array($tempId, $inheritanceChain)) {
throw new LocalizedException(__('Circular-reference in theme inheritance detected for "%1"', $tempId));
}
$inheritanceChain[] = $tempId;
$parentTheme = $theme->getParentTheme();
if ($parentTheme) {
$this->_registerThemeRecursively($parentTheme, $inheritanceChain);
$theme->setParentId($parentTheme->getId());
}
$this->_savePreviewImage($theme);
$theme->setType(ThemeInterface::TYPE_PHYSICAL);
$theme->save();
return $this;
}
/**
* Save preview image for theme
*
* @param ThemeInterface $theme
* @return $this
*/
protected function _savePreviewImage(ThemeInterface $theme)
{
$themeDirectory = $theme->getCustomization()->getThemeFilesPath();
if (!$theme->getPreviewImage() || !$themeDirectory) {
return $this;
}
$imagePath = $themeDirectory . '/' . $theme->getPreviewImage();
if (0 === strpos($imagePath, (string) $themeDirectory)) {
$theme->getThemeImage()->createPreviewImage($imagePath);
}
return $this;
}
/**
* Get theme from DB by full path
*
* @param string $fullPath
* @return ThemeInterface
*/
public function getThemeFromDb($fullPath)
{
return $this->_collectionFactory->create()->getThemeByFullPath($fullPath);
}
/**
* Checks all physical themes that they were not deleted
*
* @return $this
*/
public function checkPhysicalThemes()
{
$themes = $this->_collectionFactory->create()->addTypeFilter(ThemeInterface::TYPE_PHYSICAL);
/** @var $theme ThemeInterface */
foreach ($themes as $theme) {
if (!$this->_themeCollection->hasTheme($theme)) {
$theme->setType(ThemeInterface::TYPE_VIRTUAL)->save();
}
}
return $this;
}
/**
* Check whether all themes have correct parent theme by type
*
* @return $this
*/
public function checkAllowedThemeRelations()
{
foreach ($this->_forbiddenRelations as $typesSequence) {
list($parentType, $childType) = $typesSequence;
$collection = $this->_collectionFactory->create();
$collection->addTypeRelationFilter($parentType, $childType);
/** @var $theme ThemeInterface */
foreach ($collection as $theme) {
$parentId = $this->_getResetParentId($theme);
if ($theme->getParentId() != $parentId) {
$theme->setParentId($parentId)->save();
}
}
}
return $this;
}
/**
* Reset parent themes by type
*
* @param ThemeInterface $theme
* @return int|null
*/
protected function _getResetParentId(ThemeInterface $theme)
{
$parentTheme = $theme->getParentTheme();
while ($parentTheme) {
foreach ($this->_allowedRelations as $typesSequence) {
list($parentType, $childType) = $typesSequence;
if ($theme->getType() == $childType && $parentTheme->getType() == $parentType) {
return $parentTheme->getId();
}
}
$parentTheme = $parentTheme->getParentTheme();
}
return null;
}
}
|
{
"pile_set_name": "Github"
}
|
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <objc/NSObject.h>
#import <RemoteTextInput/NSSecureCoding-Protocol.h>
@class NSAttributedString, NSDictionary, NSMutableDictionary, NSString, RTIStyledIntermediateText, TIKeyboardIntermediateText, TIKeyboardOutput;
@interface RTITextOperations : NSObject <NSSecureCoding>
{
TIKeyboardOutput *_keyboardOutput;
TIKeyboardIntermediateText *_intermediateText;
RTIStyledIntermediateText *_styledIntermediateText;
NSDictionary *_attributedPlaceholders;
NSAttributedString *_textCheckingAnnotatedString;
NSString *_textToAssert;
SEL _editingActionSelector;
NSString *_textCheckingAnnotationToRemove;
struct _NSRange _selectionRangeToAssert;
struct _NSRange _textCheckingAnnotationRange;
struct _NSRange _textCheckingReplacementRange;
struct _NSRange _textCheckingAnnotationRemovalRange;
}
+ (BOOL)supportsSecureCoding;
- (void).cxx_destruct;
@property(copy, nonatomic) NSString *textCheckingAnnotationToRemove; // @synthesize textCheckingAnnotationToRemove=_textCheckingAnnotationToRemove;
@property(nonatomic) struct _NSRange textCheckingAnnotationRemovalRange; // @synthesize textCheckingAnnotationRemovalRange=_textCheckingAnnotationRemovalRange;
@property(nonatomic) struct _NSRange textCheckingReplacementRange; // @synthesize textCheckingReplacementRange=_textCheckingReplacementRange;
@property(nonatomic) struct _NSRange textCheckingAnnotationRange; // @synthesize textCheckingAnnotationRange=_textCheckingAnnotationRange;
@property(nonatomic) SEL editingActionSelector; // @synthesize editingActionSelector=_editingActionSelector;
@property(nonatomic) struct _NSRange selectionRangeToAssert; // @synthesize selectionRangeToAssert=_selectionRangeToAssert;
@property(copy, nonatomic) NSString *textToAssert; // @synthesize textToAssert=_textToAssert;
@property(copy, nonatomic) NSAttributedString *textCheckingAnnotatedString; // @synthesize textCheckingAnnotatedString=_textCheckingAnnotatedString;
@property(retain, nonatomic) NSDictionary *attributedPlaceholders; // @synthesize attributedPlaceholders=_attributedPlaceholders;
@property(retain, nonatomic) RTIStyledIntermediateText *styledIntermediateText; // @synthesize styledIntermediateText=_styledIntermediateText;
@property(retain, nonatomic) TIKeyboardIntermediateText *intermediateText; // @synthesize intermediateText=_intermediateText;
@property(readonly, nonatomic) NSAttributedString *attributedInsertionText;
- (void)insertAttributedText:(id)arg1 replacementRange:(struct _NSRange)arg2;
- (void)insertAttributedText:(id)arg1;
@property(readonly, nonatomic) NSMutableDictionary *mutableAttributedPlaceholders;
- (void)_createAttributedPlaceholdersIfNecessary;
- (void)insertText:(id)arg1 replacementRange:(struct _NSRange)arg2;
@property(readonly, nonatomic) TIKeyboardOutput *keyboardOutput; // @synthesize keyboardOutput=_keyboardOutput;
- (BOOL)isEqual:(id)arg1;
- (id)description;
- (id)init;
- (id)initWithCoder:(id)arg1;
- (void)encodeWithCoder:(id)arg1;
@end
|
{
"pile_set_name": "Github"
}
|
package me.leolin.shortcutbadger.impl;
import android.content.AsyncQueryHandler;
import android.content.ComponentName;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ProviderInfo;
import android.net.Uri;
import android.os.Looper;
import java.util.Arrays;
import java.util.List;
import me.leolin.shortcutbadger.Badger;
import me.leolin.shortcutbadger.ShortcutBadgeException;
/**
* @author Leo Lin
*/
public class SonyHomeBadger implements Badger {
private static final String INTENT_ACTION = "com.sonyericsson.home.action.UPDATE_BADGE";
private static final String INTENT_EXTRA_PACKAGE_NAME = "com.sonyericsson.home.intent.extra.badge.PACKAGE_NAME";
private static final String INTENT_EXTRA_ACTIVITY_NAME = "com.sonyericsson.home.intent.extra.badge.ACTIVITY_NAME";
private static final String INTENT_EXTRA_MESSAGE = "com.sonyericsson.home.intent.extra.badge.MESSAGE";
private static final String INTENT_EXTRA_SHOW_MESSAGE = "com.sonyericsson.home.intent.extra.badge.SHOW_MESSAGE";
private static final String PROVIDER_CONTENT_URI = "content://com.sonymobile.home.resourceprovider/badge";
private static final String PROVIDER_COLUMNS_BADGE_COUNT = "badge_count";
private static final String PROVIDER_COLUMNS_PACKAGE_NAME = "package_name";
private static final String PROVIDER_COLUMNS_ACTIVITY_NAME = "activity_name";
private static final String SONY_HOME_PROVIDER_NAME = "com.sonymobile.home.resourceprovider";
private final Uri BADGE_CONTENT_URI = Uri.parse(PROVIDER_CONTENT_URI);
private AsyncQueryHandler mQueryHandler;
@Override
public void executeBadge(Context context, ComponentName componentName,
int badgeCount) throws ShortcutBadgeException {
if (sonyBadgeContentProviderExists(context)) {
executeBadgeByContentProvider(context, componentName, badgeCount);
} else {
executeBadgeByBroadcast(context, componentName, badgeCount);
}
}
@Override
public List<String> getSupportLaunchers() {
return Arrays.asList("com.sonyericsson.home", "com.sonymobile.home");
}
private static void executeBadgeByBroadcast(Context context, ComponentName componentName,
int badgeCount) {
Intent intent = new Intent(INTENT_ACTION);
intent.putExtra(INTENT_EXTRA_PACKAGE_NAME, componentName.getPackageName());
intent.putExtra(INTENT_EXTRA_ACTIVITY_NAME, componentName.getClassName());
intent.putExtra(INTENT_EXTRA_MESSAGE, String.valueOf(badgeCount));
intent.putExtra(INTENT_EXTRA_SHOW_MESSAGE, badgeCount > 0);
context.sendBroadcast(intent);
}
/**
* Send request to Sony badge content provider to set badge in Sony home launcher.
*
* @param context the context to use
* @param componentName the componentName to use
* @param badgeCount the badge count
*/
private void executeBadgeByContentProvider(Context context, ComponentName componentName,
int badgeCount) {
if (badgeCount < 0) {
return;
}
final ContentValues contentValues = createContentValues(badgeCount, componentName);
if (Looper.myLooper() == Looper.getMainLooper()) {
// We're in the main thread. Let's ensure the badge update happens in a background
// thread by using an AsyncQueryHandler and an async update.
if (mQueryHandler == null) {
mQueryHandler = new AsyncQueryHandler(
context.getApplicationContext().getContentResolver()) {
};
}
insertBadgeAsync(contentValues);
} else {
// Already in a background thread. Let's update the badge synchronously. Otherwise,
// if we use the AsyncQueryHandler, this thread may already be dead by the time the
// async execution finishes, which will lead to an IllegalStateException.
insertBadgeSync(context, contentValues);
}
}
/**
* Asynchronously inserts the badge counter.
*
* @param contentValues Content values containing the badge count, package and activity names
*/
private void insertBadgeAsync(final ContentValues contentValues) {
mQueryHandler.startInsert(0, null, BADGE_CONTENT_URI, contentValues);
}
/**
* Synchronously inserts the badge counter.
*
* @param context Caller context
* @param contentValues Content values containing the badge count, package and activity names
*/
private void insertBadgeSync(final Context context, final ContentValues contentValues) {
context.getApplicationContext().getContentResolver()
.insert(BADGE_CONTENT_URI, contentValues);
}
/**
* Creates a ContentValues object to be used in the badge counter update. The package and
* activity names must correspond to an activity that holds an intent filter with action
* "android.intent.action.MAIN" and category android.intent.category.LAUNCHER" in the manifest.
* Also, it is not allowed to publish badges on behalf of another client, so the package and
* activity names must belong to the process from which the insert is made.
* To be able to insert badges, the app must have the PROVIDER_INSERT_BADGE
* permission in the manifest file. In case these conditions are not
* fulfilled, or any content values are missing, there will be an unhandled
* exception on the background thread.
*
* @param badgeCount the badge count
* @param componentName the component name from which package and class name will be extracted
*
*/
private ContentValues createContentValues(final int badgeCount,
final ComponentName componentName) {
final ContentValues contentValues = new ContentValues();
contentValues.put(PROVIDER_COLUMNS_BADGE_COUNT, badgeCount);
contentValues.put(PROVIDER_COLUMNS_PACKAGE_NAME, componentName.getPackageName());
contentValues.put(PROVIDER_COLUMNS_ACTIVITY_NAME, componentName.getClassName());
return contentValues;
}
/**
* Check if the latest Sony badge content provider exists .
*
* @param context the context to use
* @return true if Sony badge content provider exists, otherwise false.
*/
private static boolean sonyBadgeContentProviderExists(Context context) {
boolean exists = false;
ProviderInfo info = context.getPackageManager().resolveContentProvider(SONY_HOME_PROVIDER_NAME, 0);
if (info != null) {
exists = true;
}
return exists;
}
}
|
{
"pile_set_name": "Github"
}
|
package com.vimeo.sample.model;
import com.vimeo.sample_java_model.ExternalModel1;
import com.vimeo.stag.UseStag;
/**
* Testing adapter creation for a model class
* that relies on an externally defined class.
* <p>
* Created by mohammad.yasir on 28/12/16.
*/
@UseStag
public class TestExternalExample {
public GenericClass<ExternalModel1> mTesting;
}
|
{
"pile_set_name": "Github"
}
|
package pflag
import "strconv"
// -- uint Value
type uintValue uint
func newUintValue(val uint, p *uint) *uintValue {
*p = val
return (*uintValue)(p)
}
func (i *uintValue) Set(s string) error {
v, err := strconv.ParseUint(s, 0, 64)
*i = uintValue(v)
return err
}
func (i *uintValue) Type() string {
return "uint"
}
func (i *uintValue) String() string { return strconv.FormatUint(uint64(*i), 10) }
func uintConv(sval string) (interface{}, error) {
v, err := strconv.ParseUint(sval, 0, 0)
if err != nil {
return 0, err
}
return uint(v), nil
}
// GetUint return the uint value of a flag with the given name
func (f *FlagSet) GetUint(name string) (uint, error) {
val, err := f.getFlagType(name, "uint", uintConv)
if err != nil {
return 0, err
}
return val.(uint), nil
}
// UintVar defines a uint flag with specified name, default value, and usage string.
// The argument p points to a uint variable in which to store the value of the flag.
func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string) {
f.VarP(newUintValue(value, p), name, "", usage)
}
// UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) UintVarP(p *uint, name, shorthand string, value uint, usage string) {
f.VarP(newUintValue(value, p), name, shorthand, usage)
}
// UintVar defines a uint flag with specified name, default value, and usage string.
// The argument p points to a uint variable in which to store the value of the flag.
func UintVar(p *uint, name string, value uint, usage string) {
CommandLine.VarP(newUintValue(value, p), name, "", usage)
}
// UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash.
func UintVarP(p *uint, name, shorthand string, value uint, usage string) {
CommandLine.VarP(newUintValue(value, p), name, shorthand, usage)
}
// Uint defines a uint flag with specified name, default value, and usage string.
// The return value is the address of a uint variable that stores the value of the flag.
func (f *FlagSet) Uint(name string, value uint, usage string) *uint {
p := new(uint)
f.UintVarP(p, name, "", value, usage)
return p
}
// UintP is like Uint, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) UintP(name, shorthand string, value uint, usage string) *uint {
p := new(uint)
f.UintVarP(p, name, shorthand, value, usage)
return p
}
// Uint defines a uint flag with specified name, default value, and usage string.
// The return value is the address of a uint variable that stores the value of the flag.
func Uint(name string, value uint, usage string) *uint {
return CommandLine.UintP(name, "", value, usage)
}
// UintP is like Uint, but accepts a shorthand letter that can be used after a single dash.
func UintP(name, shorthand string, value uint, usage string) *uint {
return CommandLine.UintP(name, shorthand, value, usage)
}
|
{
"pile_set_name": "Github"
}
|
define("ace/mode/clojure_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ClojureHighlightRules = function() {
var builtinFunctions = (
'* *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* ' +
'*command-line-args* *compile-files* *compile-path* *e *err* *file* ' +
'*flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* ' +
'*print-dup* *print-length* *print-level* *print-meta* *print-readably* ' +
'*read-eval* *source-path* *use-context-classloader* ' +
'*warn-on-reflection* + - -> ->> .. / < <= = ' +
'== > > >= >= accessor aclone ' +
'add-classpath add-watch agent agent-errors aget alength alias all-ns ' +
'alter alter-meta! alter-var-root amap ancestors and apply areduce ' +
'array-map aset aset-boolean aset-byte aset-char aset-double aset-float ' +
'aset-int aset-long aset-short assert assoc assoc! assoc-in associative? ' +
'atom await await-for await1 bases bean bigdec bigint binding bit-and ' +
'bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left ' +
'bit-shift-right bit-test bit-xor boolean boolean-array booleans ' +
'bound-fn bound-fn* butlast byte byte-array bytes cast char char-array ' +
'char-escape-string char-name-string char? chars chunk chunk-append ' +
'chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? ' +
'class class? clear-agent-errors clojure-version coll? comment commute ' +
'comp comparator compare compare-and-set! compile complement concat cond ' +
'condp conj conj! cons constantly construct-proxy contains? count ' +
'counted? create-ns create-struct cycle dec decimal? declare definline ' +
'defmacro defmethod defmulti defn defn- defonce defstruct delay delay? ' +
'deliver deref derive descendants destructure disj disj! dissoc dissoc! ' +
'distinct distinct? doall doc dorun doseq dosync dotimes doto double ' +
'double-array doubles drop drop-last drop-while empty empty? ensure ' +
'enumeration-seq eval even? every? false? ffirst file-seq filter find ' +
'find-doc find-ns find-var first float float-array float? floats flush ' +
'fn fn? fnext for force format future future-call future-cancel ' +
'future-cancelled? future-done? future? gen-class gen-interface gensym ' +
'get get-in get-method get-proxy-class get-thread-bindings get-validator ' +
'hash hash-map hash-set identical? identity if-let if-not ifn? import ' +
'in-ns inc init-proxy instance? int int-array integer? interleave intern ' +
'interpose into into-array ints io! isa? iterate iterator-seq juxt key ' +
'keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list ' +
'list* list? load load-file load-reader load-string loaded-libs locking ' +
'long long-array longs loop macroexpand macroexpand-1 make-array ' +
'make-hierarchy map map? mapcat max max-key memfn memoize merge ' +
'merge-with meta method-sig methods min min-key mod name namespace neg? ' +
'newline next nfirst nil? nnext not not-any? not-empty not-every? not= ' +
'ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ' +
'ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? ' +
'or parents partial partition pcalls peek persistent! pmap pop pop! ' +
'pop-thread-bindings pos? pr pr-str prefer-method prefers ' +
'primitives-classnames print print-ctor print-doc print-dup print-method ' +
'print-namespace-doc print-simple print-special-doc print-str printf ' +
'println println-str prn prn-str promise proxy proxy-call-with-super ' +
'proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot ' +
'rand rand-int range ratio? rational? rationalize re-find re-groups ' +
're-matcher re-matches re-pattern re-seq read read-line read-string ' +
'reduce ref ref-history-count ref-max-history ref-min-history ref-set ' +
'refer refer-clojure release-pending-sends rem remove remove-method ' +
'remove-ns remove-watch repeat repeatedly replace replicate require ' +
'reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq ' +
'rsubseq second select-keys send send-off seq seq? seque sequence ' +
'sequential? set set-validator! set? short short-array shorts ' +
'shutdown-agents slurp some sort sort-by sorted-map sorted-map-by ' +
'sorted-set sorted-set-by sorted? special-form-anchor special-symbol? ' +
'split-at split-with str stream? string? struct struct-map subs subseq ' +
'subvec supers swap! symbol symbol? sync syntax-symbol-anchor take ' +
'take-last take-nth take-while test the-ns time to-array to-array-2d ' +
'trampoline transient tree-seq true? type unchecked-add unchecked-dec ' +
'unchecked-divide unchecked-inc unchecked-multiply unchecked-negate ' +
'unchecked-remainder unchecked-subtract underive unquote ' +
'unquote-splicing update-in update-proxy use val vals var-get var-set ' +
'var? vary-meta vec vector vector? when when-first when-let when-not ' +
'while with-bindings with-bindings* with-in-str with-loading-context ' +
'with-local-vars with-meta with-open with-out-str with-precision xml-seq ' +
'zero? zipmap'
);
var keywords = ('throw try var ' +
'def do fn if let loop monitor-enter monitor-exit new quote recur set!'
);
var buildinConstants = ("true false nil");
var keywordMapper = this.createKeywordMapper({
"keyword": keywords,
"constant.language": buildinConstants,
"support.function": builtinFunctions
}, "identifier", false, " ");
this.$rules = {
"start" : [
{
token : "comment",
regex : ";.*$"
}, {
token : "keyword", //parens
regex : "[\\(|\\)]"
}, {
token : "keyword", //lists
regex : "[\\'\\(]"
}, {
token : "keyword", //vectors
regex : "[\\[|\\]]"
}, {
token : "keyword", //sets and maps
regex : "[\\{|\\}|\\#\\{|\\#\\}]"
}, {
token : "keyword", // ampersands
regex : '[\\&]'
}, {
token : "keyword", // metadata
regex : '[\\#\\^\\{]'
}, {
token : "keyword", // anonymous fn syntactic sugar
regex : '[\\%]'
}, {
token : "keyword", // deref reader macro
regex : '[@]'
}, {
token : "constant.numeric", // hex
regex : "0[xX][0-9a-fA-F]+\\b"
}, {
token : "constant.numeric", // float
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, {
token : "constant.language",
regex : '[!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+||=|!=|<=|>=|<>|<|>|!|&&]'
}, {
token : keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b"
}, {
token : "string", // single line
regex : '"',
next: "string"
}, {
token : "constant", // symbol
regex : /:[^()\[\]{}'"\^%`,;\s]+/
}, {
token : "string.regexp", //Regular Expressions
regex : '/#"(?:\\.|(?:\\")|[^""\n])*"/g'
}
],
"string" : [
{
token : "constant.language.escape",
regex : "\\\\.|\\\\$"
}, {
token : "string",
regex : '[^"\\\\]+'
}, {
token : "string",
regex : '"',
next : "start"
}
]
};
};
oop.inherits(ClojureHighlightRules, TextHighlightRules);
exports.ClojureHighlightRules = ClojureHighlightRules;
});
define("ace/mode/matching_parens_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
"use strict";
var Range = require("../range").Range;
var MatchingParensOutdent = function() {};
(function() {
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false;
return /^\s*\)/.test(input);
};
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row);
var match = line.match(/^(\s*\))/);
if (!match) return 0;
var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column});
if (!openBracePos || openBracePos.row == row) return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent);
};
this.$getIndent = function(line) {
var match = line.match(/^(\s+)/);
if (match) {
return match[1];
}
return "";
};
}).call(MatchingParensOutdent.prototype);
exports.MatchingParensOutdent = MatchingParensOutdent;
});
define("ace/mode/clojure",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/clojure_highlight_rules","ace/mode/matching_parens_outdent"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var ClojureHighlightRules = require("./clojure_highlight_rules").ClojureHighlightRules;
var MatchingParensOutdent = require("./matching_parens_outdent").MatchingParensOutdent;
var Mode = function() {
this.HighlightRules = ClojureHighlightRules;
this.$outdent = new MatchingParensOutdent();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function() {
this.lineCommentStart = ";";
this.minorIndentFunctions = ["defn", "defn-", "defmacro", "def", "deftest", "testing"];
this.$toIndent = function(str) {
return str.split('').map(function(ch) {
if (/\s/.exec(ch)) {
return ch;
} else {
return ' ';
}
}).join('');
};
this.$calculateIndent = function(line, tab) {
var baseIndent = this.$getIndent(line);
var delta = 0;
var isParen, ch;
for (var i = line.length - 1; i >= 0; i--) {
ch = line[i];
if (ch === '(') {
delta--;
isParen = true;
} else if (ch === '(' || ch === '[' || ch === '{') {
delta--;
isParen = false;
} else if (ch === ')' || ch === ']' || ch === '}') {
delta++;
}
if (delta < 0) {
break;
}
}
if (delta < 0 && isParen) {
i += 1;
var iBefore = i;
var fn = '';
while (true) {
ch = line[i];
if (ch === ' ' || ch === '\t') {
if(this.minorIndentFunctions.indexOf(fn) !== -1) {
return this.$toIndent(line.substring(0, iBefore - 1) + tab);
} else {
return this.$toIndent(line.substring(0, i + 1));
}
} else if (ch === undefined) {
return this.$toIndent(line.substring(0, iBefore - 1) + tab);
}
fn += line[i];
i++;
}
} else if(delta < 0 && !isParen) {
return this.$toIndent(line.substring(0, i+1));
} else if(delta > 0) {
baseIndent = baseIndent.substring(0, baseIndent.length - tab.length);
return baseIndent;
} else {
return baseIndent;
}
};
this.getNextLineIndent = function(state, line, tab) {
return this.$calculateIndent(line, tab);
};
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input);
};
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
this.$id = "ace/mode/clojure";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
window.require(["ace/mode/clojure"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
|
{
"pile_set_name": "Github"
}
|
{
"richMenuId": "richmenu-f85ab95699420f1c9330f22bb4f489e8",
"size": {
"width": 2500,
"height": 843
},
"selected": true,
"name": "NAME",
"chatBarText": "CHAT_BAR_TEXT",
"areas": [ ]
}
|
{
"pile_set_name": "Github"
}
|
{
"properties": {
"displayName": "[Deprecated]: Function App should only be accessible over HTTPS",
"policyType": "BuiltIn",
"mode": "All",
"description": "Use of HTTPS ensures server/service authentication and protects data in transit from network layer eavesdropping attacks.",
"metadata": {
"version": "1.0.0-deprecated",
"category": "Security Center",
"deprecated": true
},
"parameters": {
"effect": {
"type": "string",
"defaultValue": "AuditIfNotExists",
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allof": [
{
"field": "type",
"equals": "microsoft.Web/sites"
},
{
"anyof": [
{
"field": "kind",
"equals": "functionapp"
},
{
"field": "kind",
"equals": "functionapp,linux"
},
{
"field": "kind",
"equals": "functionapp,linux,container"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Security/complianceResults",
"name": "OnlyHttpsForFunctionApp",
"existenceCondition": {
"field": "Microsoft.Security/complianceResults/resourceStatus",
"in": [
"OffByPolicy",
"Healthy"
]
}
}
}
}
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/5df82f4f-773a-4a2d-97a2-422a806f1a55",
"name": "5df82f4f-773a-4a2d-97a2-422a806f1a55"
}
|
{
"pile_set_name": "Github"
}
|
################################################################################
#
# Intel PRO/1000 Linux driver
# Copyright(c) 1999 - 2006 Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
#
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
#
# Contact Information:
# Linux NICS <linux.nics@intel.com>
# e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
#
################################################################################
#
# Makefile for the Intel(R) PRO/1000 ethernet driver
#
obj-$(CONFIG_E1000) += e1000.o
e1000-objs := e1000_main.o e1000_hw.o e1000_ethtool.o e1000_param.o
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2013-2014 BlackBerry Limited.
*
* 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.
*/
#include "applicationui.hpp"
#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
#include <bb/cascades/AbstractPane>
#include <bb/cascades/LocaleHandler>
#include <bb/system/InvokeManager>
using namespace bb::cascades;
using namespace bb::system;
ApplicationUI::ApplicationUI() :
QObject(),
m_translator(new QTranslator(this)),
m_localeHandler(new LocaleHandler(this)),
m_invokeManager(new InvokeManager(this))
{
// Start the headless part right away
InvokeRequest request;
request.setTarget("com.example.TranslateHLService");
request.setAction("com.example.TranslateHLService.START");
m_invokeManager->invoke(request);
/*
* bb::cascades::LocaleHandler
*
* When the language or locale of the device changes, this class is responsible
* for dynamically updating text with any necessary changes.
*
* Tip: It relies on bb::cascades, which is not accessible in an headless app.
*
* This connect() function will call onSystemLanguageChanged() whenever the user
* changes language or locale.
*
*/
if (!QObject::connect(m_localeHandler, SIGNAL(systemLanguageChanged()),
this, SLOT(onSystemLanguageChanged()))) {
// This is an abnormal situation! Something went wrong!
// Add own code to recover here
qWarning() << "Recovering from a failed connect()";
}
// initial load
// Call onSystemLanguageChanged() directly to load the right translation on startup
onSystemLanguageChanged();
// Create scene document from main.qml asset, the parent is set
// to ensure the document gets destroyed properly at shut down.
QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
// Make app available to the qml.
qml->setContextProperty("app", this);
// Create root object for the UI
AbstractPane *root = qml->createRootObject<AbstractPane>();
// Set created root object as the application scene
Application::instance()->setScene(root);
}
void ApplicationUI::onSystemLanguageChanged()
{
// Remove old translation
QCoreApplication::instance()->removeTranslator(m_translator);
// Initiate, load and install the application translation files.
/*
* QLocale().name()
*
* Returns the language and country of this locale as a string of the
* form "language_country", where language is a lowercase, two-letter
* ISO 639 language code, and country is an uppercase, two- or three-letter
* ISO 3166 country code.
*/
QString locale_string = QLocale().name();
// Append the locale to the name of the app to build the ts file name
QString file_name = QString("TranslateHL_%1").arg(locale_string);
// Try to load the correct ts file, if successful install the translation
if (m_translator->load(file_name, "app/native/qm")) {
QCoreApplication::instance()->installTranslator(m_translator);
}
}
void ApplicationUI::onSystemLanguageChanged(const QString& newLocale)
{
// This function is used only for simulating a system language change
// Remove old translation
QCoreApplication::instance()->removeTranslator(m_translator);
// Append the locale to the name of the app to build the ts file name
QString file_name = QString("TranslateHL_%1").arg(newLocale);
// Try to load the correct ts file, if successful install the translation
if (m_translator->load(file_name, "app/native/qm")) {
QCoreApplication::instance()->installTranslator(m_translator);
}
}
void ApplicationUI::invokeSettings()
{
// Open the Settings card at the language section
InvokeRequest request;
request.setUri("settings://language");
request.setTarget("sys.settings.card");
request.setAction("bb.action.OPEN");
m_invokeManager->invoke(request);
}
void ApplicationUI::sendToHeadless(const QString& command, QString parameters)
{
// Start the headless part right away
InvokeRequest request;
request.setTarget("com.example.TranslateHLService");
request.setAction("com.example.TranslateHLService." + command.toUpper());
request.setData(parameters.toUtf8());
m_invokeManager->invoke(request);
// Only used during app development
if (command == "SHUTDOWN")
bb::Application::instance()->quit();
}
|
{
"pile_set_name": "Github"
}
|
---
id: version-0.55-flatlist
title: FlatList
original_id: flatlist
---
A performant interface for rendering painless flat lists, supporting the most handy features:
- Fully cross-platform.
- Optional horizontal mode.
- Configurable viewability callbacks.
- Header support.
- Footer support.
- Separator support.
- Pull to Refresh.
- Scroll loading.
- ScrollToIndex support.
If you need section support, use [`<SectionList>`](sectionlist.md).
Minimal Example:
<FlatList
data={[{key: 'a'}, {key: 'b'}]}
renderItem={({item}) => <Text>{item.key}</Text>}
/>
More complex, multi-select example demonstrating `PureComponent` usage for perf optimization and avoiding bugs.
- By binding the `onPressItem` handler, the props will remain `===` and `PureComponent` will prevent wasteful re-renders unless the actual `id`, `selected`, or `title` props change, even if the components rendered in `MyListItem` did not have such optimizations.
- By passing `extraData={this.state}` to `FlatList` we make sure `FlatList` itself will re-render when the `state.selected` changes. Without setting this prop, `FlatList` would not know it needs to re-render any items because it is also a `PureComponent` and the prop comparison will not show any changes.
- `keyExtractor` tells the list to use the `id`s for the react keys instead of the default `key` property.
class MyListItem extends React.PureComponent {
_onPress = () => {
this.props.onPressItem(this.props.id);
};
render() {
const textColor = this.props.selected ? "red" : "black";
return (
<TouchableOpacity onPress={this._onPress}>
<View>
<Text style={{ color: textColor }}>
{this.props.title}
</Text>
</View>
</TouchableOpacity>
);
}
}
class MultiSelectList extends React.PureComponent {
state = {selected: (new Map(): Map<string, boolean>)};
_keyExtractor = (item, index) => item.id;
_onPressItem = (id: string) => {
// updater functions are preferred for transactional updates
this.setState((state) => {
// copy the map rather than modifying state.
const selected = new Map(state.selected);
selected.set(id, !selected.get(id)); // toggle
return {selected};
});
};
_renderItem = ({item}) => (
<MyListItem
id={item.id}
onPressItem={this._onPressItem}
selected={!!this.state.selected.get(item.id)}
title={item.title}
/>
);
render() {
return (
<FlatList
data={this.props.data}
extraData={this.state}
keyExtractor={this._keyExtractor}
renderItem={this._renderItem}
/>
);
}
}
This is a convenience wrapper around [`<VirtualizedList>`](virtualizedlist.md), and thus inherits its props (as well as those of [`<ScrollView>`](scrollview.md)) that aren't explicitly listed here, along with the following caveats:
- Internal state is not preserved when content scrolls out of the render window. Make sure all your data is captured in the item data or external stores like Flux, Redux, or Relay.
- This is a `PureComponent` which means that it will not re-render if `props` remain shallow-equal. Make sure that everything your `renderItem` function depends on is passed as a prop (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on changes. This includes the `data` prop and parent component state.
- In order to constrain memory and enable smooth scrolling, content is rendered asynchronously offscreen. This means it's possible to scroll faster than the fill rate and momentarily see blank content. This is a tradeoff that can be adjusted to suit the needs of each application, and we are working on improving it behind the scenes.
- By default, the list looks for a `key` prop on each item and uses that for the React key. Alternatively, you can provide a custom `keyExtractor` prop.
Also inherits [ScrollView Props](scrollview.md#props), unless it is nested in another FlatList of same orientation.
### Props
- [`ScrollView` props...](scrollview.md#props)
- [`VirtualizedList` props...](virtualizedlist.md#props)
- [`renderItem`](flatlist.md#renderitem)
- [`data`](flatlist.md#data)
- [`ItemSeparatorComponent`](flatlist.md#itemseparatorcomponent)
- [`ListEmptyComponent`](flatlist.md#listemptycomponent)
- [`ListFooterComponent`](flatlist.md#listfootercomponent)
- [`ListHeaderComponent`](flatlist.md#listheadercomponent)
- [`columnWrapperStyle`](flatlist.md#columnwrapperstyle)
- [`extraData`](flatlist.md#extradata)
- [`getItemLayout`](flatlist.md#getitemlayout)
- [`horizontal`](flatlist.md#horizontal)
- [`initialNumToRender`](flatlist.md#initialnumtorender)
- [`initialScrollIndex`](flatlist.md#initialscrollindex)
- [`inverted`](flatlist.md#inverted)
- [`keyExtractor`](flatlist.md#keyextractor)
- [`numColumns`](flatlist.md#numcolumns)
- [`onEndReached`](flatlist.md#onendreached)
- [`onEndReachedThreshold`](flatlist.md#onendreachedthreshold)
- [`onRefresh`](flatlist.md#onrefresh)
- [`onViewableItemsChanged`](flatlist.md#onviewableitemschanged)
- [`progressViewOffset`](flatlist.md#progressviewoffset)
- [`legacyImplementation`](flatlist.md#legacyimplementation)
- [`refreshing`](flatlist.md#refreshing)
- [`removeClippedSubviews`](flatlist.md#removeclippedsubviews)
- [`viewabilityConfig`](flatlist.md#viewabilityconfig)
- [`viewabilityConfigCallbackPairs`](flatlist.md#viewabilityconfigcallbackpairs)
### Methods
- [`scrollToEnd`](flatlist.md#scrolltoend)
- [`scrollToIndex`](flatlist.md#scrolltoindex)
- [`scrollToItem`](flatlist.md#scrolltoitem)
- [`scrollToOffset`](flatlist.md#scrolltooffset)
- [`recordInteraction`](flatlist.md#recordinteraction)
- [`flashScrollIndicators`](flatlist.md#flashscrollindicators)
---
# Reference
## Props
### `renderItem`
```jsx
renderItem({ item: Object, index: number, separators: { highlight: Function, unhighlight: Function, updateProps: Function(select: string, newProps: Object) } }) => ?React.Element
```
Takes an item from `data` and renders it into the list.
Provides additional metadata like `index` if you need it, as well as a more generic `separators.updateProps` function which let you set whatever props you want to change the rendering of either the leading separator or trailing separator in case the more common `highlight` and `unhighlight` (which set the `highlighted: boolean` prop) are insufficient for your use case.
| Type | Required |
| -------- | -------- |
| function | Yes |
Example usage:
```jsx
<FlatList
ItemSeparatorComponent={Platform.OS !== 'android' && ({highlighted}) => (
<View style={[style.separator, highlighted && {marginLeft: 0}]} />
)}
data={[{title: 'Title Text', key: 'item1'}]}
renderItem={({item, separators}) => (
<TouchableHighlight
onPress={() => this._onPress(item)}
onShowUnderlay={separators.highlight}
onHideUnderlay={separators.unhighlight}>
<View style={{backgroundColor: 'white'}}>
<Text>{item.title}</Text>
</View>
</TouchableHighlight>
)}
/>
```
---
### `data`
For simplicity, data is only a plain array. If you want to use something else, like an immutable list, use the underlying [`VirtualizedList`](virtualizedlist.md) directly.
| Type | Required |
| ----- | -------- |
| array | Yes |
---
### `ItemSeparatorComponent`
Rendered in between each item, but not at the top or bottom. By default, `highlighted` and `leadingItem` props are provided. `renderItem` provides `separators.highlight`/`unhighlight` which will update the `highlighted` prop, but you can also add custom props with `separators.updateProps`.
| Type | Required |
| --------- | -------- |
| component | No |
---
### `ListEmptyComponent`
Rendered when the list is empty. Can be a React Component Class, a render function, or a rendered element.
| Type | Required |
| ---------------------------- | -------- |
| component, function, element | No |
---
### `ListFooterComponent`
Rendered at the bottom of all the items. Can be a React Component Class, a render function, or a rendered element.
| Type | Required |
| ---------------------------- | -------- |
| component, function, element | No |
---
### `ListHeaderComponent`
Rendered at the top of all the items. Can be a React Component Class, a render function, or a rendered element.
| Type | Required |
| ---------------------------- | -------- |
| component, function, element | No |
---
### `columnWrapperStyle`
Optional custom style for multi-item rows generated when `numColumns > 1`.
| Type | Required |
| ------------ | -------- |
| style object | No |
---
### `extraData`
A marker property for telling the list to re-render (since it implements `PureComponent`). If any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the `data` prop, stick it here and treat it immutably.
| Type | Required |
| ---- | -------- |
| any | No |
---
### `getItemLayout`
```jsx
(data, index) => {length: number, offset: number, index: number}
```
`getItemLayout` is an optional optimization that let us skip measurement of dynamic content if you know the height of items a priori. `getItemLayout` is the most efficient, and is handy to use if you have fixed height items, for example:
```jsx
getItemLayout={(data, index) => (
{length: ITEM_HEIGHT, offset: ITEM_HEIGHT * index, index}
)}
```
Adding `getItemLayout` can be a great performance boost for lists of several hundred items. Remember to include separator length (height or width) in your offset calculation if you specify `ItemSeparatorComponent`.
| Type | Required |
| -------- | -------- |
| function | No |
---
### `horizontal`
If true, renders items next to each other horizontally instead of stacked vertically.
| Type | Required |
| ------- | -------- |
| boolean | No |
---
### `initialNumToRender`
How many items to render in the initial batch. This should be enough to fill the screen but not much more. Note these items will never be unmounted as part of the windowed rendering in order to improve perceived performance of scroll-to-top actions.
| Type | Required |
| ------ | -------- |
| number | No |
---
### `initialScrollIndex`
Instead of starting at the top with the first item, start at `initialScrollIndex`. This disables the "scroll to top" optimization that keeps the first `initialNumToRender` items always rendered and immediately renders the items starting at this initial index. Requires `getItemLayout` to be implemented.
| Type | Required |
| ------ | -------- |
| number | No |
---
### `inverted`
Reverses the direction of scroll. Uses scale transforms of `-1`.
| Type | Required |
| ------- | -------- |
| boolean | No |
---
### `keyExtractor`
```jsx
(item: object, index: number) => string;
```
Used to extract a unique key for a given item at the specified index. Key is used for caching and as the react key to track item re-ordering. The default extractor checks `item.key`, then falls back to using the index, like React does.
| Type | Required |
| -------- | -------- |
| function | No |
---
### `numColumns`
Multiple columns can only be rendered with `horizontal={false}` and will zig-zag like a `flexWrap` layout. Items should all be the same height - masonry layouts are not supported.
| Type | Required |
| ------ | -------- |
| number | No |
---
### `onEndReached`
```jsx
(info: {distanceFromEnd: number}) => void
```
Called once when the scroll position gets within `onEndReachedThreshold` of the rendered content.
| Type | Required |
| -------- | -------- |
| function | No |
---
### `onEndReachedThreshold`
How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the `onEndReached` callback. Thus a value of 0.5 will trigger `onEndReached` when the end of the content is within half the visible length of the list.
| Type | Required |
| ------ | -------- |
| number | No |
---
### `onRefresh`
```jsx
() => void
```
If provided, a standard RefreshControl will be added for "Pull to Refresh" functionality. Make sure to also set the `refreshing` prop correctly.
| Type | Required |
| -------- | -------- |
| function | No |
---
### `onViewableItemsChanged`
```jsx
(info: {
viewableItems: array,
changed: array,
}) => void
```
Called when the viewability of rows changes, as defined by the `viewabilityConfig` prop.
| Type | Required |
| -------- | -------- |
| function | No |
---
### `progressViewOffset`
Set this when offset is needed for the loading indicator to show correctly.
| Type | Required | Platform |
| ------ | -------- | -------- |
| number | No | Android |
---
### `legacyImplementation`
May not have full feature parity and is meant for debugging and performance comparison.
| Type | Required |
| ------- | -------- |
| boolean | No |
---
### `refreshing`
Set this true while waiting for new data from a refresh.
| Type | Required |
| ------- | -------- |
| boolean | No |
---
### `removeClippedSubviews`
This may improve scroll performance for large lists.
> Note: May have bugs (missing content) in some circumstances - use at your own risk.
| Type | Required |
| ------- | -------- |
| boolean | No |
---
### `viewabilityConfig`
See `ViewabilityHelper.js` for flow type and further documentation.
| Type | Required |
| ----------------- | -------- |
| ViewabilityConfig | No |
`viewabilityConfig` takes a type `ViewabilityConfig` an object with following properties
| Property | Required | Type |
| -------------------------------- | -------- | ------- |
| minimumViewTime | No | number |
| viewAreaCoveragePercentThreshold | No | number |
| itemVisiblePercentThreshold | No | number |
| waitForInteraction | No | boolean |
At least one of the `viewAreaCoveragePercentThreshold` or `itemVisiblePercentThreshold` is required. This needs to be done in the `constructor` to avoid following error ([ref](https://github.com/facebook/react-native/issues/17408)):
```
Error: Changing viewabilityConfig on the fly is not supported`
```
```jsx
constructor (props) {
super(props)
this.viewabilityConfig = {
waitForInteraction: true,
viewAreaCoveragePercentThreshold: 95
}
}
```
```jsx
<FlatList
viewabilityConfig={this.viewabilityConfig}
...
```
#### minimumViewTime
Minimum amount of time (in milliseconds) that an item must be physically viewable before the viewability callback will be fired. A high number means that scrolling through content without stopping will not mark the content as viewable.
#### viewAreaCoveragePercentThreshold
Percent of viewport that must be covered for a partially occluded item to count as "viewable", 0-100. Fully visible items are always considered viewable. A value of 0 means that a single pixel in the viewport makes the item viewable, and a value of 100 means that an item must be either entirely visible or cover the entire viewport to count as viewable.
#### itemVisiblePercentThreshold
Similar to `viewAreaPercentThreshold`, but considers the percent of the item that is visible, rather than the fraction of the viewable area it covers.
#### waitForInteraction
Nothing is considered viewable until the user scrolls or `recordInteraction` is called after render.
---
### `viewabilityConfigCallbackPairs`
List of `ViewabilityConfig`/`onViewableItemsChanged` pairs. A specific `onViewableItemsChanged` will be called when its corresponding `ViewabilityConfig`'s conditions are met. See `ViewabilityHelper.js` for flow type and further documentation.
| Type | Required |
| -------------------------------------- | -------- |
| array of ViewabilityConfigCallbackPair | No |
## Methods
### `scrollToEnd()`
```jsx
scrollToEnd([params]);
```
Scrolls to the end of the content. May be janky without `getItemLayout` prop.
**Parameters:**
| Name | Type | Required | Description |
| ------ | ------ | -------- | ----------- |
| params | object | No | See below. |
Valid `params` keys are:
- 'animated' (boolean) - Whether the list should do an animation while scrolling. Defaults to `true`.
---
### `scrollToIndex()`
```jsx
scrollToIndex(params);
```
Scrolls to the item at the specified index such that it is positioned in the viewable area such that `viewPosition` 0 places it at the top, 1 at the bottom, and 0.5 centered in the middle.
> Note: Cannot scroll to locations outside the render window without specifying the `getItemLayout` prop.
**Parameters:**
| Name | Type | Required | Description |
| ------ | ------ | -------- | ----------- |
| params | object | Yes | See below. |
Valid `params` keys are:
- 'animated' (boolean) - Whether the list should do an animation while scrolling. Defaults to `true`.
- 'index' (number) - The index to scroll to. Required.
- 'viewOffset' (number) - A fixed number of pixels to offset the final target position.
- 'viewPosition' (number) - A value of `0` places the item specified by index at the top, `1` at the bottom, and `0.5` centered in the middle.
---
### `scrollToItem()`
```jsx
scrollToItem(params);
```
Requires linear scan through data - use `scrollToIndex` instead if possible.
> Note: Cannot scroll to locations outside the render window without specifying the `getItemLayout` prop.
**Parameters:**
| Name | Type | Required | Description |
| ------ | ------ | -------- | ----------- |
| params | object | Yes | See below. |
Valid `params` keys are:
- 'animated' (boolean) - Whether the list should do an animation while scrolling. Defaults to `true`.
- 'item' (object) - The item to scroll to. Required.
- 'viewPosition' (number)
---
### `scrollToOffset()`
```jsx
scrollToOffset(params);
```
Scroll to a specific content pixel offset in the list.
**Parameters:**
| Name | Type | Required | Description |
| ------ | ------ | -------- | ----------- |
| params | object | Yes | See below. |
Valid `params` keys are:
- 'offset' (number) - The offset to scroll to. In case of `horizontal` being true, the offset is the x-value, in any other case the offset is the y-value. Required.
- 'animated' (boolean) - Whether the list should do an animation while scrolling. Defaults to `true`.
---
### `recordInteraction()`
```jsx
recordInteraction();
```
Tells the list an interaction has occurred, which should trigger viewability calculations, e.g. if `waitForInteractions` is true and the user has not scrolled. This is typically called by taps on items or by navigation actions.
---
### `flashScrollIndicators()`
```jsx
flashScrollIndicators();
```
Displays the scroll indicators momentarily.
|
{
"pile_set_name": "Github"
}
|
/*
Gruvbox style (light) (c) Pavel Pertsev (original style at https://github.com/morhetz/gruvbox)
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #fbf1c7;
}
.hljs,
.hljs-subst {
color: #3c3836;
}
/* Gruvbox Red */
.hljs-deletion,
.hljs-formula,
.hljs-keyword,
.hljs-link,
.hljs-selector-tag {
color: #9d0006;
}
/* Gruvbox Blue */
.hljs-built_in,
.hljs-emphasis,
.hljs-name,
.hljs-quote,
.hljs-strong,
.hljs-title,
.hljs-variable {
color: #076678;
}
/* Gruvbox Yellow */
.hljs-attr,
.hljs-params,
.hljs-template-tag,
.hljs-type {
color: #b57614;
}
/* Gruvbox Purple */
.hljs-builtin-name,
.hljs-doctag,
.hljs-literal,
.hljs-number {
color: #8f3f71;
}
/* Gruvbox Orange */
.hljs-code,
.hljs-meta,
.hljs-regexp,
.hljs-selector-id,
.hljs-template-variable {
color: #af3a03;
}
/* Gruvbox Green */
.hljs-addition,
.hljs-meta-string,
.hljs-section,
.hljs-selector-attr,
.hljs-selector-class,
.hljs-string,
.hljs-symbol {
color: #79740e;
}
/* Gruvbox Aqua */
.hljs-attribute,
.hljs-bullet,
.hljs-class,
.hljs-function,
.hljs-function .hljs-keyword,
.hljs-meta-keyword,
.hljs-selector-pseudo,
.hljs-tag {
color: #427b58;
}
/* Gruvbox Gray */
.hljs-comment {
color: #928374;
}
/* Gruvbox Purple */
.hljs-link_label,
.hljs-literal,
.hljs-number {
color: #8f3f71;
}
.hljs-comment,
.hljs-emphasis {
font-style: italic;
}
.hljs-section,
.hljs-strong,
.hljs-tag {
font-weight: bold;
}
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Uses of Class squidpony.squidmath.Arrangement.ValueCollection (squidlib-util 3.0.1)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="use: package: squidpony.squidmath, class: Arrangement, class: ValueCollection">
<meta name="generator" content="javadoc/ClassUseWriter">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../script-dir/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
<script type="text/javascript" src="../../../script-dir/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../script-dir/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../script-dir/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../script-dir/jquery-3.4.1.js"></script>
<script type="text/javascript" src="../../../script-dir/jquery-ui.js"></script>
</head>
<body class="class-use">
<script type="text/javascript">var pathtoroot = "../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flexBox">
<header role="banner" class="flexHeader">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../index.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../Arrangement.ValueCollection.html" title="class in squidpony.squidmath">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<div class="navListSearch"><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="skipNav"><a id="skip.navbar.top">
<!-- -->
</a></div>
</nav>
</header>
<div class="flexContent">
<main role="main">
<div class="header">
<h1 title="Uses of Class squidpony.squidmath.Arrangement.ValueCollection" class="title">Uses of Class<br>squidpony.squidmath.Arrangement.ValueCollection</h1>
</div>
<div class="classUseContainer">No usage of squidpony.squidmath.Arrangement.ValueCollection</div>
</main>
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../index.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../Arrangement.ValueCollection.html" title="class in squidpony.squidmath">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright © 2012–2020. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
/*
*
* Copyright 2014 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package transport
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"math"
"net"
"strconv"
"sync"
"sync/atomic"
"time"
"github.com/golang/protobuf/proto"
"golang.org/x/net/http2"
"golang.org/x/net/http2/hpack"
spb "google.golang.org/genproto/googleapis/rpc/status"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/internal"
"google.golang.org/grpc/internal/channelz"
"google.golang.org/grpc/internal/grpcrand"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/peer"
"google.golang.org/grpc/stats"
"google.golang.org/grpc/status"
"google.golang.org/grpc/tap"
)
var (
// ErrIllegalHeaderWrite indicates that setting header is illegal because of
// the stream's state.
ErrIllegalHeaderWrite = errors.New("transport: the stream is done or WriteHeader was already called")
// ErrHeaderListSizeLimitViolation indicates that the header list size is larger
// than the limit set by peer.
ErrHeaderListSizeLimitViolation = errors.New("transport: trying to send header list size larger than the limit set by peer")
// statusRawProto is a function to get to the raw status proto wrapped in a
// status.Status without a proto.Clone().
statusRawProto = internal.StatusRawProto.(func(*status.Status) *spb.Status)
)
// serverConnectionCounter counts the number of connections a server has seen
// (equal to the number of http2Servers created). Must be accessed atomically.
var serverConnectionCounter uint64
// http2Server implements the ServerTransport interface with HTTP2.
type http2Server struct {
lastRead int64 // Keep this field 64-bit aligned. Accessed atomically.
ctx context.Context
done chan struct{}
conn net.Conn
loopy *loopyWriter
readerDone chan struct{} // sync point to enable testing.
writerDone chan struct{} // sync point to enable testing.
remoteAddr net.Addr
localAddr net.Addr
maxStreamID uint32 // max stream ID ever seen
authInfo credentials.AuthInfo // auth info about the connection
inTapHandle tap.ServerInHandle
framer *framer
// The max number of concurrent streams.
maxStreams uint32
// controlBuf delivers all the control related tasks (e.g., window
// updates, reset streams, and various settings) to the controller.
controlBuf *controlBuffer
fc *trInFlow
stats stats.Handler
// Keepalive and max-age parameters for the server.
kp keepalive.ServerParameters
// Keepalive enforcement policy.
kep keepalive.EnforcementPolicy
// The time instance last ping was received.
lastPingAt time.Time
// Number of times the client has violated keepalive ping policy so far.
pingStrikes uint8
// Flag to signify that number of ping strikes should be reset to 0.
// This is set whenever data or header frames are sent.
// 1 means yes.
resetPingStrikes uint32 // Accessed atomically.
initialWindowSize int32
bdpEst *bdpEstimator
maxSendHeaderListSize *uint32
mu sync.Mutex // guard the following
// drainChan is initialized when drain(...) is called the first time.
// After which the server writes out the first GoAway(with ID 2^31-1) frame.
// Then an independent goroutine will be launched to later send the second GoAway.
// During this time we don't want to write another first GoAway(with ID 2^31 -1) frame.
// Thus call to drain(...) will be a no-op if drainChan is already initialized since draining is
// already underway.
drainChan chan struct{}
state transportState
activeStreams map[uint32]*Stream
// idle is the time instant when the connection went idle.
// This is either the beginning of the connection or when the number of
// RPCs go down to 0.
// When the connection is busy, this value is set to 0.
idle time.Time
// Fields below are for channelz metric collection.
channelzID int64 // channelz unique identification number
czData *channelzData
bufferPool *bufferPool
connectionID uint64
}
// newHTTP2Server constructs a ServerTransport based on HTTP2. ConnectionError is
// returned if something goes wrong.
func newHTTP2Server(conn net.Conn, config *ServerConfig) (_ ServerTransport, err error) {
writeBufSize := config.WriteBufferSize
readBufSize := config.ReadBufferSize
maxHeaderListSize := defaultServerMaxHeaderListSize
if config.MaxHeaderListSize != nil {
maxHeaderListSize = *config.MaxHeaderListSize
}
framer := newFramer(conn, writeBufSize, readBufSize, maxHeaderListSize)
// Send initial settings as connection preface to client.
isettings := []http2.Setting{{
ID: http2.SettingMaxFrameSize,
Val: http2MaxFrameLen,
}}
// TODO(zhaoq): Have a better way to signal "no limit" because 0 is
// permitted in the HTTP2 spec.
maxStreams := config.MaxStreams
if maxStreams == 0 {
maxStreams = math.MaxUint32
} else {
isettings = append(isettings, http2.Setting{
ID: http2.SettingMaxConcurrentStreams,
Val: maxStreams,
})
}
dynamicWindow := true
iwz := int32(initialWindowSize)
if config.InitialWindowSize >= defaultWindowSize {
iwz = config.InitialWindowSize
dynamicWindow = false
}
icwz := int32(initialWindowSize)
if config.InitialConnWindowSize >= defaultWindowSize {
icwz = config.InitialConnWindowSize
dynamicWindow = false
}
if iwz != defaultWindowSize {
isettings = append(isettings, http2.Setting{
ID: http2.SettingInitialWindowSize,
Val: uint32(iwz)})
}
if config.MaxHeaderListSize != nil {
isettings = append(isettings, http2.Setting{
ID: http2.SettingMaxHeaderListSize,
Val: *config.MaxHeaderListSize,
})
}
if config.HeaderTableSize != nil {
isettings = append(isettings, http2.Setting{
ID: http2.SettingHeaderTableSize,
Val: *config.HeaderTableSize,
})
}
if err := framer.fr.WriteSettings(isettings...); err != nil {
return nil, connectionErrorf(false, err, "transport: %v", err)
}
// Adjust the connection flow control window if needed.
if delta := uint32(icwz - defaultWindowSize); delta > 0 {
if err := framer.fr.WriteWindowUpdate(0, delta); err != nil {
return nil, connectionErrorf(false, err, "transport: %v", err)
}
}
kp := config.KeepaliveParams
if kp.MaxConnectionIdle == 0 {
kp.MaxConnectionIdle = defaultMaxConnectionIdle
}
if kp.MaxConnectionAge == 0 {
kp.MaxConnectionAge = defaultMaxConnectionAge
}
// Add a jitter to MaxConnectionAge.
kp.MaxConnectionAge += getJitter(kp.MaxConnectionAge)
if kp.MaxConnectionAgeGrace == 0 {
kp.MaxConnectionAgeGrace = defaultMaxConnectionAgeGrace
}
if kp.Time == 0 {
kp.Time = defaultServerKeepaliveTime
}
if kp.Timeout == 0 {
kp.Timeout = defaultServerKeepaliveTimeout
}
kep := config.KeepalivePolicy
if kep.MinTime == 0 {
kep.MinTime = defaultKeepalivePolicyMinTime
}
done := make(chan struct{})
t := &http2Server{
ctx: context.Background(),
done: done,
conn: conn,
remoteAddr: conn.RemoteAddr(),
localAddr: conn.LocalAddr(),
authInfo: config.AuthInfo,
framer: framer,
readerDone: make(chan struct{}),
writerDone: make(chan struct{}),
maxStreams: maxStreams,
inTapHandle: config.InTapHandle,
fc: &trInFlow{limit: uint32(icwz)},
state: reachable,
activeStreams: make(map[uint32]*Stream),
stats: config.StatsHandler,
kp: kp,
idle: time.Now(),
kep: kep,
initialWindowSize: iwz,
czData: new(channelzData),
bufferPool: newBufferPool(),
}
t.controlBuf = newControlBuffer(t.done)
if dynamicWindow {
t.bdpEst = &bdpEstimator{
bdp: initialWindowSize,
updateFlowControl: t.updateFlowControl,
}
}
if t.stats != nil {
t.ctx = t.stats.TagConn(t.ctx, &stats.ConnTagInfo{
RemoteAddr: t.remoteAddr,
LocalAddr: t.localAddr,
})
connBegin := &stats.ConnBegin{}
t.stats.HandleConn(t.ctx, connBegin)
}
if channelz.IsOn() {
t.channelzID = channelz.RegisterNormalSocket(t, config.ChannelzParentID, fmt.Sprintf("%s -> %s", t.remoteAddr, t.localAddr))
}
t.connectionID = atomic.AddUint64(&serverConnectionCounter, 1)
t.framer.writer.Flush()
defer func() {
if err != nil {
t.Close()
}
}()
// Check the validity of client preface.
preface := make([]byte, len(clientPreface))
if _, err := io.ReadFull(t.conn, preface); err != nil {
return nil, connectionErrorf(false, err, "transport: http2Server.HandleStreams failed to receive the preface from client: %v", err)
}
if !bytes.Equal(preface, clientPreface) {
return nil, connectionErrorf(false, nil, "transport: http2Server.HandleStreams received bogus greeting from client: %q", preface)
}
frame, err := t.framer.fr.ReadFrame()
if err == io.EOF || err == io.ErrUnexpectedEOF {
return nil, err
}
if err != nil {
return nil, connectionErrorf(false, err, "transport: http2Server.HandleStreams failed to read initial settings frame: %v", err)
}
atomic.StoreInt64(&t.lastRead, time.Now().UnixNano())
sf, ok := frame.(*http2.SettingsFrame)
if !ok {
return nil, connectionErrorf(false, nil, "transport: http2Server.HandleStreams saw invalid preface type %T from client", frame)
}
t.handleSettings(sf)
go func() {
t.loopy = newLoopyWriter(serverSide, t.framer, t.controlBuf, t.bdpEst)
t.loopy.ssGoAwayHandler = t.outgoingGoAwayHandler
if err := t.loopy.run(); err != nil {
errorf("transport: loopyWriter.run returning. Err: %v", err)
}
t.conn.Close()
close(t.writerDone)
}()
go t.keepalive()
return t, nil
}
// operateHeader takes action on the decoded headers.
func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func(*Stream), traceCtx func(context.Context, string) context.Context) (fatal bool) {
streamID := frame.Header().StreamID
state := &decodeState{
serverSide: true,
}
if err := state.decodeHeader(frame); err != nil {
if se, ok := status.FromError(err); ok {
t.controlBuf.put(&cleanupStream{
streamID: streamID,
rst: true,
rstCode: statusCodeConvTab[se.Code()],
onWrite: func() {},
})
}
return false
}
buf := newRecvBuffer()
s := &Stream{
id: streamID,
st: t,
buf: buf,
fc: &inFlow{limit: uint32(t.initialWindowSize)},
recvCompress: state.data.encoding,
method: state.data.method,
contentSubtype: state.data.contentSubtype,
}
if frame.StreamEnded() {
// s is just created by the caller. No lock needed.
s.state = streamReadDone
}
if state.data.timeoutSet {
s.ctx, s.cancel = context.WithTimeout(t.ctx, state.data.timeout)
} else {
s.ctx, s.cancel = context.WithCancel(t.ctx)
}
pr := &peer.Peer{
Addr: t.remoteAddr,
}
// Attach Auth info if there is any.
if t.authInfo != nil {
pr.AuthInfo = t.authInfo
}
s.ctx = peer.NewContext(s.ctx, pr)
// Attach the received metadata to the context.
if len(state.data.mdata) > 0 {
s.ctx = metadata.NewIncomingContext(s.ctx, state.data.mdata)
}
if state.data.statsTags != nil {
s.ctx = stats.SetIncomingTags(s.ctx, state.data.statsTags)
}
if state.data.statsTrace != nil {
s.ctx = stats.SetIncomingTrace(s.ctx, state.data.statsTrace)
}
if t.inTapHandle != nil {
var err error
info := &tap.Info{
FullMethodName: state.data.method,
}
s.ctx, err = t.inTapHandle(s.ctx, info)
if err != nil {
warningf("transport: http2Server.operateHeaders got an error from InTapHandle: %v", err)
t.controlBuf.put(&cleanupStream{
streamID: s.id,
rst: true,
rstCode: http2.ErrCodeRefusedStream,
onWrite: func() {},
})
s.cancel()
return false
}
}
t.mu.Lock()
if t.state != reachable {
t.mu.Unlock()
s.cancel()
return false
}
if uint32(len(t.activeStreams)) >= t.maxStreams {
t.mu.Unlock()
t.controlBuf.put(&cleanupStream{
streamID: streamID,
rst: true,
rstCode: http2.ErrCodeRefusedStream,
onWrite: func() {},
})
s.cancel()
return false
}
if streamID%2 != 1 || streamID <= t.maxStreamID {
t.mu.Unlock()
// illegal gRPC stream id.
errorf("transport: http2Server.HandleStreams received an illegal stream id: %v", streamID)
s.cancel()
return true
}
t.maxStreamID = streamID
t.activeStreams[streamID] = s
if len(t.activeStreams) == 1 {
t.idle = time.Time{}
}
t.mu.Unlock()
if channelz.IsOn() {
atomic.AddInt64(&t.czData.streamsStarted, 1)
atomic.StoreInt64(&t.czData.lastStreamCreatedTime, time.Now().UnixNano())
}
s.requestRead = func(n int) {
t.adjustWindow(s, uint32(n))
}
s.ctx = traceCtx(s.ctx, s.method)
if t.stats != nil {
s.ctx = t.stats.TagRPC(s.ctx, &stats.RPCTagInfo{FullMethodName: s.method})
inHeader := &stats.InHeader{
FullMethod: s.method,
RemoteAddr: t.remoteAddr,
LocalAddr: t.localAddr,
Compression: s.recvCompress,
WireLength: int(frame.Header().Length),
Header: metadata.MD(state.data.mdata).Copy(),
}
t.stats.HandleRPC(s.ctx, inHeader)
}
s.ctxDone = s.ctx.Done()
s.wq = newWriteQuota(defaultWriteQuota, s.ctxDone)
s.trReader = &transportReader{
reader: &recvBufferReader{
ctx: s.ctx,
ctxDone: s.ctxDone,
recv: s.buf,
freeBuffer: t.bufferPool.put,
},
windowHandler: func(n int) {
t.updateWindow(s, uint32(n))
},
}
// Register the stream with loopy.
t.controlBuf.put(®isterStream{
streamID: s.id,
wq: s.wq,
})
handle(s)
return false
}
// HandleStreams receives incoming streams using the given handler. This is
// typically run in a separate goroutine.
// traceCtx attaches trace to ctx and returns the new context.
func (t *http2Server) HandleStreams(handle func(*Stream), traceCtx func(context.Context, string) context.Context) {
defer close(t.readerDone)
for {
t.controlBuf.throttle()
frame, err := t.framer.fr.ReadFrame()
atomic.StoreInt64(&t.lastRead, time.Now().UnixNano())
if err != nil {
if se, ok := err.(http2.StreamError); ok {
warningf("transport: http2Server.HandleStreams encountered http2.StreamError: %v", se)
t.mu.Lock()
s := t.activeStreams[se.StreamID]
t.mu.Unlock()
if s != nil {
t.closeStream(s, true, se.Code, false)
} else {
t.controlBuf.put(&cleanupStream{
streamID: se.StreamID,
rst: true,
rstCode: se.Code,
onWrite: func() {},
})
}
continue
}
if err == io.EOF || err == io.ErrUnexpectedEOF {
t.Close()
return
}
warningf("transport: http2Server.HandleStreams failed to read frame: %v", err)
t.Close()
return
}
switch frame := frame.(type) {
case *http2.MetaHeadersFrame:
if t.operateHeaders(frame, handle, traceCtx) {
t.Close()
break
}
case *http2.DataFrame:
t.handleData(frame)
case *http2.RSTStreamFrame:
t.handleRSTStream(frame)
case *http2.SettingsFrame:
t.handleSettings(frame)
case *http2.PingFrame:
t.handlePing(frame)
case *http2.WindowUpdateFrame:
t.handleWindowUpdate(frame)
case *http2.GoAwayFrame:
// TODO: Handle GoAway from the client appropriately.
default:
errorf("transport: http2Server.HandleStreams found unhandled frame type %v.", frame)
}
}
}
func (t *http2Server) getStream(f http2.Frame) (*Stream, bool) {
t.mu.Lock()
defer t.mu.Unlock()
if t.activeStreams == nil {
// The transport is closing.
return nil, false
}
s, ok := t.activeStreams[f.Header().StreamID]
if !ok {
// The stream is already done.
return nil, false
}
return s, true
}
// adjustWindow sends out extra window update over the initial window size
// of stream if the application is requesting data larger in size than
// the window.
func (t *http2Server) adjustWindow(s *Stream, n uint32) {
if w := s.fc.maybeAdjust(n); w > 0 {
t.controlBuf.put(&outgoingWindowUpdate{streamID: s.id, increment: w})
}
}
// updateWindow adjusts the inbound quota for the stream and the transport.
// Window updates will deliver to the controller for sending when
// the cumulative quota exceeds the corresponding threshold.
func (t *http2Server) updateWindow(s *Stream, n uint32) {
if w := s.fc.onRead(n); w > 0 {
t.controlBuf.put(&outgoingWindowUpdate{streamID: s.id,
increment: w,
})
}
}
// updateFlowControl updates the incoming flow control windows
// for the transport and the stream based on the current bdp
// estimation.
func (t *http2Server) updateFlowControl(n uint32) {
t.mu.Lock()
for _, s := range t.activeStreams {
s.fc.newLimit(n)
}
t.initialWindowSize = int32(n)
t.mu.Unlock()
t.controlBuf.put(&outgoingWindowUpdate{
streamID: 0,
increment: t.fc.newLimit(n),
})
t.controlBuf.put(&outgoingSettings{
ss: []http2.Setting{
{
ID: http2.SettingInitialWindowSize,
Val: n,
},
},
})
}
func (t *http2Server) handleData(f *http2.DataFrame) {
size := f.Header().Length
var sendBDPPing bool
if t.bdpEst != nil {
sendBDPPing = t.bdpEst.add(size)
}
// Decouple connection's flow control from application's read.
// An update on connection's flow control should not depend on
// whether user application has read the data or not. Such a
// restriction is already imposed on the stream's flow control,
// and therefore the sender will be blocked anyways.
// Decoupling the connection flow control will prevent other
// active(fast) streams from starving in presence of slow or
// inactive streams.
if w := t.fc.onData(size); w > 0 {
t.controlBuf.put(&outgoingWindowUpdate{
streamID: 0,
increment: w,
})
}
if sendBDPPing {
// Avoid excessive ping detection (e.g. in an L7 proxy)
// by sending a window update prior to the BDP ping.
if w := t.fc.reset(); w > 0 {
t.controlBuf.put(&outgoingWindowUpdate{
streamID: 0,
increment: w,
})
}
t.controlBuf.put(bdpPing)
}
// Select the right stream to dispatch.
s, ok := t.getStream(f)
if !ok {
return
}
if size > 0 {
if err := s.fc.onData(size); err != nil {
t.closeStream(s, true, http2.ErrCodeFlowControl, false)
return
}
if f.Header().Flags.Has(http2.FlagDataPadded) {
if w := s.fc.onRead(size - uint32(len(f.Data()))); w > 0 {
t.controlBuf.put(&outgoingWindowUpdate{s.id, w})
}
}
// TODO(bradfitz, zhaoq): A copy is required here because there is no
// guarantee f.Data() is consumed before the arrival of next frame.
// Can this copy be eliminated?
if len(f.Data()) > 0 {
buffer := t.bufferPool.get()
buffer.Reset()
buffer.Write(f.Data())
s.write(recvMsg{buffer: buffer})
}
}
if f.Header().Flags.Has(http2.FlagDataEndStream) {
// Received the end of stream from the client.
s.compareAndSwapState(streamActive, streamReadDone)
s.write(recvMsg{err: io.EOF})
}
}
func (t *http2Server) handleRSTStream(f *http2.RSTStreamFrame) {
// If the stream is not deleted from the transport's active streams map, then do a regular close stream.
if s, ok := t.getStream(f); ok {
t.closeStream(s, false, 0, false)
return
}
// If the stream is already deleted from the active streams map, then put a cleanupStream item into controlbuf to delete the stream from loopy writer's established streams map.
t.controlBuf.put(&cleanupStream{
streamID: f.Header().StreamID,
rst: false,
rstCode: 0,
onWrite: func() {},
})
}
func (t *http2Server) handleSettings(f *http2.SettingsFrame) {
if f.IsAck() {
return
}
var ss []http2.Setting
var updateFuncs []func()
f.ForeachSetting(func(s http2.Setting) error {
switch s.ID {
case http2.SettingMaxHeaderListSize:
updateFuncs = append(updateFuncs, func() {
t.maxSendHeaderListSize = new(uint32)
*t.maxSendHeaderListSize = s.Val
})
default:
ss = append(ss, s)
}
return nil
})
t.controlBuf.executeAndPut(func(interface{}) bool {
for _, f := range updateFuncs {
f()
}
return true
}, &incomingSettings{
ss: ss,
})
}
const (
maxPingStrikes = 2
defaultPingTimeout = 2 * time.Hour
)
func (t *http2Server) handlePing(f *http2.PingFrame) {
if f.IsAck() {
if f.Data == goAwayPing.data && t.drainChan != nil {
close(t.drainChan)
return
}
// Maybe it's a BDP ping.
if t.bdpEst != nil {
t.bdpEst.calculate(f.Data)
}
return
}
pingAck := &ping{ack: true}
copy(pingAck.data[:], f.Data[:])
t.controlBuf.put(pingAck)
now := time.Now()
defer func() {
t.lastPingAt = now
}()
// A reset ping strikes means that we don't need to check for policy
// violation for this ping and the pingStrikes counter should be set
// to 0.
if atomic.CompareAndSwapUint32(&t.resetPingStrikes, 1, 0) {
t.pingStrikes = 0
return
}
t.mu.Lock()
ns := len(t.activeStreams)
t.mu.Unlock()
if ns < 1 && !t.kep.PermitWithoutStream {
// Keepalive shouldn't be active thus, this new ping should
// have come after at least defaultPingTimeout.
if t.lastPingAt.Add(defaultPingTimeout).After(now) {
t.pingStrikes++
}
} else {
// Check if keepalive policy is respected.
if t.lastPingAt.Add(t.kep.MinTime).After(now) {
t.pingStrikes++
}
}
if t.pingStrikes > maxPingStrikes {
// Send goaway and close the connection.
errorf("transport: Got too many pings from the client, closing the connection.")
t.controlBuf.put(&goAway{code: http2.ErrCodeEnhanceYourCalm, debugData: []byte("too_many_pings"), closeConn: true})
}
}
func (t *http2Server) handleWindowUpdate(f *http2.WindowUpdateFrame) {
t.controlBuf.put(&incomingWindowUpdate{
streamID: f.Header().StreamID,
increment: f.Increment,
})
}
func appendHeaderFieldsFromMD(headerFields []hpack.HeaderField, md metadata.MD) []hpack.HeaderField {
for k, vv := range md {
if isReservedHeader(k) {
// Clients don't tolerate reading restricted headers after some non restricted ones were sent.
continue
}
for _, v := range vv {
headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)})
}
}
return headerFields
}
func (t *http2Server) checkForHeaderListSize(it interface{}) bool {
if t.maxSendHeaderListSize == nil {
return true
}
hdrFrame := it.(*headerFrame)
var sz int64
for _, f := range hdrFrame.hf {
if sz += int64(f.Size()); sz > int64(*t.maxSendHeaderListSize) {
errorf("header list size to send violates the maximum size (%d bytes) set by client", *t.maxSendHeaderListSize)
return false
}
}
return true
}
// WriteHeader sends the header metadata md back to the client.
func (t *http2Server) WriteHeader(s *Stream, md metadata.MD) error {
if s.updateHeaderSent() || s.getState() == streamDone {
return ErrIllegalHeaderWrite
}
s.hdrMu.Lock()
if md.Len() > 0 {
if s.header.Len() > 0 {
s.header = metadata.Join(s.header, md)
} else {
s.header = md
}
}
if err := t.writeHeaderLocked(s); err != nil {
s.hdrMu.Unlock()
return err
}
s.hdrMu.Unlock()
return nil
}
func (t *http2Server) setResetPingStrikes() {
atomic.StoreUint32(&t.resetPingStrikes, 1)
}
func (t *http2Server) writeHeaderLocked(s *Stream) error {
// TODO(mmukhi): Benchmark if the performance gets better if count the metadata and other header fields
// first and create a slice of that exact size.
headerFields := make([]hpack.HeaderField, 0, 2) // at least :status, content-type will be there if none else.
headerFields = append(headerFields, hpack.HeaderField{Name: ":status", Value: "200"})
headerFields = append(headerFields, hpack.HeaderField{Name: "content-type", Value: contentType(s.contentSubtype)})
if s.sendCompress != "" {
headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-encoding", Value: s.sendCompress})
}
headerFields = appendHeaderFieldsFromMD(headerFields, s.header)
success, err := t.controlBuf.executeAndPut(t.checkForHeaderListSize, &headerFrame{
streamID: s.id,
hf: headerFields,
endStream: false,
onWrite: t.setResetPingStrikes,
})
if !success {
if err != nil {
return err
}
t.closeStream(s, true, http2.ErrCodeInternal, false)
return ErrHeaderListSizeLimitViolation
}
if t.stats != nil {
// Note: WireLength is not set in outHeader.
// TODO(mmukhi): Revisit this later, if needed.
outHeader := &stats.OutHeader{
Header: s.header.Copy(),
}
t.stats.HandleRPC(s.Context(), outHeader)
}
return nil
}
// WriteStatus sends stream status to the client and terminates the stream.
// There is no further I/O operations being able to perform on this stream.
// TODO(zhaoq): Now it indicates the end of entire stream. Revisit if early
// OK is adopted.
func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error {
if s.getState() == streamDone {
return nil
}
s.hdrMu.Lock()
// TODO(mmukhi): Benchmark if the performance gets better if count the metadata and other header fields
// first and create a slice of that exact size.
headerFields := make([]hpack.HeaderField, 0, 2) // grpc-status and grpc-message will be there if none else.
if !s.updateHeaderSent() { // No headers have been sent.
if len(s.header) > 0 { // Send a separate header frame.
if err := t.writeHeaderLocked(s); err != nil {
s.hdrMu.Unlock()
return err
}
} else { // Send a trailer only response.
headerFields = append(headerFields, hpack.HeaderField{Name: ":status", Value: "200"})
headerFields = append(headerFields, hpack.HeaderField{Name: "content-type", Value: contentType(s.contentSubtype)})
}
}
headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-status", Value: strconv.Itoa(int(st.Code()))})
headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-message", Value: encodeGrpcMessage(st.Message())})
if p := statusRawProto(st); p != nil && len(p.Details) > 0 {
stBytes, err := proto.Marshal(p)
if err != nil {
// TODO: return error instead, when callers are able to handle it.
grpclog.Errorf("transport: failed to marshal rpc status: %v, error: %v", p, err)
} else {
headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-status-details-bin", Value: encodeBinHeader(stBytes)})
}
}
// Attach the trailer metadata.
headerFields = appendHeaderFieldsFromMD(headerFields, s.trailer)
trailingHeader := &headerFrame{
streamID: s.id,
hf: headerFields,
endStream: true,
onWrite: t.setResetPingStrikes,
}
s.hdrMu.Unlock()
success, err := t.controlBuf.execute(t.checkForHeaderListSize, trailingHeader)
if !success {
if err != nil {
return err
}
t.closeStream(s, true, http2.ErrCodeInternal, false)
return ErrHeaderListSizeLimitViolation
}
// Send a RST_STREAM after the trailers if the client has not already half-closed.
rst := s.getState() == streamActive
t.finishStream(s, rst, http2.ErrCodeNo, trailingHeader, true)
if t.stats != nil {
t.stats.HandleRPC(s.Context(), &stats.OutTrailer{
Trailer: s.trailer.Copy(),
})
}
return nil
}
// Write converts the data into HTTP2 data frame and sends it out. Non-nil error
// is returns if it fails (e.g., framing error, transport error).
func (t *http2Server) Write(s *Stream, hdr []byte, data []byte, opts *Options) error {
if !s.isHeaderSent() { // Headers haven't been written yet.
if err := t.WriteHeader(s, nil); err != nil {
if _, ok := err.(ConnectionError); ok {
return err
}
// TODO(mmukhi, dfawley): Make sure this is the right code to return.
return status.Errorf(codes.Internal, "transport: %v", err)
}
} else {
// Writing headers checks for this condition.
if s.getState() == streamDone {
// TODO(mmukhi, dfawley): Should the server write also return io.EOF?
s.cancel()
select {
case <-t.done:
return ErrConnClosing
default:
}
return ContextErr(s.ctx.Err())
}
}
// Add some data to header frame so that we can equally distribute bytes across frames.
emptyLen := http2MaxFrameLen - len(hdr)
if emptyLen > len(data) {
emptyLen = len(data)
}
hdr = append(hdr, data[:emptyLen]...)
data = data[emptyLen:]
df := &dataFrame{
streamID: s.id,
h: hdr,
d: data,
onEachWrite: t.setResetPingStrikes,
}
if err := s.wq.get(int32(len(hdr) + len(data))); err != nil {
select {
case <-t.done:
return ErrConnClosing
default:
}
return ContextErr(s.ctx.Err())
}
return t.controlBuf.put(df)
}
// keepalive running in a separate goroutine does the following:
// 1. Gracefully closes an idle connection after a duration of keepalive.MaxConnectionIdle.
// 2. Gracefully closes any connection after a duration of keepalive.MaxConnectionAge.
// 3. Forcibly closes a connection after an additive period of keepalive.MaxConnectionAgeGrace over keepalive.MaxConnectionAge.
// 4. Makes sure a connection is alive by sending pings with a frequency of keepalive.Time and closes a non-responsive connection
// after an additional duration of keepalive.Timeout.
func (t *http2Server) keepalive() {
p := &ping{}
// True iff a ping has been sent, and no data has been received since then.
outstandingPing := false
// Amount of time remaining before which we should receive an ACK for the
// last sent ping.
kpTimeoutLeft := time.Duration(0)
// Records the last value of t.lastRead before we go block on the timer.
// This is required to check for read activity since then.
prevNano := time.Now().UnixNano()
// Initialize the different timers to their default values.
idleTimer := time.NewTimer(t.kp.MaxConnectionIdle)
ageTimer := time.NewTimer(t.kp.MaxConnectionAge)
kpTimer := time.NewTimer(t.kp.Time)
defer func() {
// We need to drain the underlying channel in these timers after a call
// to Stop(), only if we are interested in resetting them. Clearly we
// are not interested in resetting them here.
idleTimer.Stop()
ageTimer.Stop()
kpTimer.Stop()
}()
for {
select {
case <-idleTimer.C:
t.mu.Lock()
idle := t.idle
if idle.IsZero() { // The connection is non-idle.
t.mu.Unlock()
idleTimer.Reset(t.kp.MaxConnectionIdle)
continue
}
val := t.kp.MaxConnectionIdle - time.Since(idle)
t.mu.Unlock()
if val <= 0 {
// The connection has been idle for a duration of keepalive.MaxConnectionIdle or more.
// Gracefully close the connection.
t.drain(http2.ErrCodeNo, []byte{})
return
}
idleTimer.Reset(val)
case <-ageTimer.C:
t.drain(http2.ErrCodeNo, []byte{})
ageTimer.Reset(t.kp.MaxConnectionAgeGrace)
select {
case <-ageTimer.C:
// Close the connection after grace period.
infof("transport: closing server transport due to maximum connection age.")
t.Close()
case <-t.done:
}
return
case <-kpTimer.C:
lastRead := atomic.LoadInt64(&t.lastRead)
if lastRead > prevNano {
// There has been read activity since the last time we were
// here. Setup the timer to fire at kp.Time seconds from
// lastRead time and continue.
outstandingPing = false
kpTimer.Reset(time.Duration(lastRead) + t.kp.Time - time.Duration(time.Now().UnixNano()))
prevNano = lastRead
continue
}
if outstandingPing && kpTimeoutLeft <= 0 {
infof("transport: closing server transport due to idleness.")
t.Close()
return
}
if !outstandingPing {
if channelz.IsOn() {
atomic.AddInt64(&t.czData.kpCount, 1)
}
t.controlBuf.put(p)
kpTimeoutLeft = t.kp.Timeout
outstandingPing = true
}
// The amount of time to sleep here is the minimum of kp.Time and
// timeoutLeft. This will ensure that we wait only for kp.Time
// before sending out the next ping (for cases where the ping is
// acked).
sleepDuration := minTime(t.kp.Time, kpTimeoutLeft)
kpTimeoutLeft -= sleepDuration
kpTimer.Reset(sleepDuration)
case <-t.done:
return
}
}
}
// Close starts shutting down the http2Server transport.
// TODO(zhaoq): Now the destruction is not blocked on any pending streams. This
// could cause some resource issue. Revisit this later.
func (t *http2Server) Close() error {
t.mu.Lock()
if t.state == closing {
t.mu.Unlock()
return errors.New("transport: Close() was already called")
}
t.state = closing
streams := t.activeStreams
t.activeStreams = nil
t.mu.Unlock()
t.controlBuf.finish()
close(t.done)
err := t.conn.Close()
if channelz.IsOn() {
channelz.RemoveEntry(t.channelzID)
}
// Cancel all active streams.
for _, s := range streams {
s.cancel()
}
if t.stats != nil {
connEnd := &stats.ConnEnd{}
t.stats.HandleConn(t.ctx, connEnd)
}
return err
}
// deleteStream deletes the stream s from transport's active streams.
func (t *http2Server) deleteStream(s *Stream, eosReceived bool) {
// In case stream sending and receiving are invoked in separate
// goroutines (e.g., bi-directional streaming), cancel needs to be
// called to interrupt the potential blocking on other goroutines.
s.cancel()
t.mu.Lock()
if _, ok := t.activeStreams[s.id]; ok {
delete(t.activeStreams, s.id)
if len(t.activeStreams) == 0 {
t.idle = time.Now()
}
}
t.mu.Unlock()
if channelz.IsOn() {
if eosReceived {
atomic.AddInt64(&t.czData.streamsSucceeded, 1)
} else {
atomic.AddInt64(&t.czData.streamsFailed, 1)
}
}
}
// finishStream closes the stream and puts the trailing headerFrame into controlbuf.
func (t *http2Server) finishStream(s *Stream, rst bool, rstCode http2.ErrCode, hdr *headerFrame, eosReceived bool) {
oldState := s.swapState(streamDone)
if oldState == streamDone {
// If the stream was already done, return.
return
}
hdr.cleanup = &cleanupStream{
streamID: s.id,
rst: rst,
rstCode: rstCode,
onWrite: func() {
t.deleteStream(s, eosReceived)
},
}
t.controlBuf.put(hdr)
}
// closeStream clears the footprint of a stream when the stream is not needed any more.
func (t *http2Server) closeStream(s *Stream, rst bool, rstCode http2.ErrCode, eosReceived bool) {
s.swapState(streamDone)
t.deleteStream(s, eosReceived)
t.controlBuf.put(&cleanupStream{
streamID: s.id,
rst: rst,
rstCode: rstCode,
onWrite: func() {},
})
}
func (t *http2Server) RemoteAddr() net.Addr {
return t.remoteAddr
}
func (t *http2Server) Drain() {
t.drain(http2.ErrCodeNo, []byte{})
}
func (t *http2Server) drain(code http2.ErrCode, debugData []byte) {
t.mu.Lock()
defer t.mu.Unlock()
if t.drainChan != nil {
return
}
t.drainChan = make(chan struct{})
t.controlBuf.put(&goAway{code: code, debugData: debugData, headsUp: true})
}
var goAwayPing = &ping{data: [8]byte{1, 6, 1, 8, 0, 3, 3, 9}}
// Handles outgoing GoAway and returns true if loopy needs to put itself
// in draining mode.
func (t *http2Server) outgoingGoAwayHandler(g *goAway) (bool, error) {
t.mu.Lock()
if t.state == closing { // TODO(mmukhi): This seems unnecessary.
t.mu.Unlock()
// The transport is closing.
return false, ErrConnClosing
}
sid := t.maxStreamID
if !g.headsUp {
// Stop accepting more streams now.
t.state = draining
if len(t.activeStreams) == 0 {
g.closeConn = true
}
t.mu.Unlock()
if err := t.framer.fr.WriteGoAway(sid, g.code, g.debugData); err != nil {
return false, err
}
if g.closeConn {
// Abruptly close the connection following the GoAway (via
// loopywriter). But flush out what's inside the buffer first.
t.framer.writer.Flush()
return false, fmt.Errorf("transport: Connection closing")
}
return true, nil
}
t.mu.Unlock()
// For a graceful close, send out a GoAway with stream ID of MaxUInt32,
// Follow that with a ping and wait for the ack to come back or a timer
// to expire. During this time accept new streams since they might have
// originated before the GoAway reaches the client.
// After getting the ack or timer expiration send out another GoAway this
// time with an ID of the max stream server intends to process.
if err := t.framer.fr.WriteGoAway(math.MaxUint32, http2.ErrCodeNo, []byte{}); err != nil {
return false, err
}
if err := t.framer.fr.WritePing(false, goAwayPing.data); err != nil {
return false, err
}
go func() {
timer := time.NewTimer(time.Minute)
defer timer.Stop()
select {
case <-t.drainChan:
case <-timer.C:
case <-t.done:
return
}
t.controlBuf.put(&goAway{code: g.code, debugData: g.debugData})
}()
return false, nil
}
func (t *http2Server) ChannelzMetric() *channelz.SocketInternalMetric {
s := channelz.SocketInternalMetric{
StreamsStarted: atomic.LoadInt64(&t.czData.streamsStarted),
StreamsSucceeded: atomic.LoadInt64(&t.czData.streamsSucceeded),
StreamsFailed: atomic.LoadInt64(&t.czData.streamsFailed),
MessagesSent: atomic.LoadInt64(&t.czData.msgSent),
MessagesReceived: atomic.LoadInt64(&t.czData.msgRecv),
KeepAlivesSent: atomic.LoadInt64(&t.czData.kpCount),
LastRemoteStreamCreatedTimestamp: time.Unix(0, atomic.LoadInt64(&t.czData.lastStreamCreatedTime)),
LastMessageSentTimestamp: time.Unix(0, atomic.LoadInt64(&t.czData.lastMsgSentTime)),
LastMessageReceivedTimestamp: time.Unix(0, atomic.LoadInt64(&t.czData.lastMsgRecvTime)),
LocalFlowControlWindow: int64(t.fc.getSize()),
SocketOptions: channelz.GetSocketOption(t.conn),
LocalAddr: t.localAddr,
RemoteAddr: t.remoteAddr,
// RemoteName :
}
if au, ok := t.authInfo.(credentials.ChannelzSecurityInfo); ok {
s.Security = au.GetSecurityValue()
}
s.RemoteFlowControlWindow = t.getOutFlowWindow()
return &s
}
func (t *http2Server) IncrMsgSent() {
atomic.AddInt64(&t.czData.msgSent, 1)
atomic.StoreInt64(&t.czData.lastMsgSentTime, time.Now().UnixNano())
}
func (t *http2Server) IncrMsgRecv() {
atomic.AddInt64(&t.czData.msgRecv, 1)
atomic.StoreInt64(&t.czData.lastMsgRecvTime, time.Now().UnixNano())
}
func (t *http2Server) getOutFlowWindow() int64 {
resp := make(chan uint32, 1)
timer := time.NewTimer(time.Second)
defer timer.Stop()
t.controlBuf.put(&outFlowControlSizeRequest{resp})
select {
case sz := <-resp:
return int64(sz)
case <-t.done:
return -1
case <-timer.C:
return -2
}
}
func getJitter(v time.Duration) time.Duration {
if v == infinity {
return 0
}
// Generate a jitter between +/- 10% of the value.
r := int64(v / 10)
j := grpcrand.Int63n(2*r) - r
return time.Duration(j)
}
|
{
"pile_set_name": "Github"
}
|
#
# fontconfig/fc-lang/es.orth
#
# Copyright © 2002 Keith Packard
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of the author(s) not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. The authors make no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# Spanish (ES)
#
# Sources:
# www.evertype.com
# www.eki.ee/letter
#
0041-005a
0061-007a
#00A1 # INVERTED EXCLAMATION MARK
#00BF # INVERTED QUESTION MARK
00C1 # LATIN CAPITAL LETTER A WITH ACUTE
#00C7 # LATIN CAPITAL LETTER C WITH CEDILLA important @eki.ee
00C9 # LATIN CAPITAL LETTER E WITH ACUTE
00CD # LATIN CAPITAL LETTER I WITH ACUTE
00D1 # LATIN CAPITAL LETTER N WITH TILDE
00D3 # LATIN CAPITAL LETTER O WITH ACUTE
00DA # LATIN CAPITAL LETTER U WITH ACUTE
00DC # LATIN CAPITAL LETTER U WITH DIAERESIS
00E1 # LATIN SMALL LETTER A WITH ACUTE
#00E7 # LATIN SMALL LETTER C WITH CEDILLA important @eki.ee
00E9 # LATIN SMALL LETTER E WITH ACUTE
00ED # LATIN SMALL LETTER I WITH ACUTE
00F1 # LATIN SMALL LETTER N WITH TILDE
00F3 # LATIN SMALL LETTER O WITH ACUTE
00FA # LATIN SMALL LETTER U WITH ACUTE
00FC # LATIN SMALL LETTER U WITH DIAERESIS
#
|
{
"pile_set_name": "Github"
}
|
[7DE11F53-74872F9D-C:45]
Name=Wave Race 64 (U) (V1.0)
Cheat0="Misses Don't Count",801C27CF 0000
Cheat1="Infinite Time Stunt Mode",801C295E 00FF
Cheat2="Super Speed",801C27C7 0005,D0154051 0010,801C27C7 0020
Cheat3="99 Points",801CB0A3 0063
Cheat4="Infinite Course Out Time",801C2983 00FF
Cheat5="Maximum Power\Player 1",801C27C7 0005
Cheat6="Maximum Power\Player 2",801C2DEA 0005,801C308A 0005
Cheat7="Only Play Glacier Coast",800DA753 0007
Cheat8="Open\Difficulty Option",801CAFE0 00??
Cheat8_O=$01 Hard,$02 Expert,$03 Hard & Expert,$10 Dolphin,$11 Dolphin & Hard,$12 Dolphin & Expert,$13 Dolphin Hard & Expert
Cheat9="Open\Level Option",800DA753 00??
Cheat9_O=$02 Sunset Bay,$03 Above & Drake Lake,$04 All Above & Marine Fortress,$05 All Above & Port Blue,$06 All Above & Southern Island,$0D All Above & Twilight City,$16 All Above & Glacier Coast
Cheat10="Open\Course Option",801CAFEB 00??
Cheat10_N=This works in all modes except for Championship Mode.
Cheat10_O=$00 Dolphin Park,$01 Sunny Beach,$02 Sunset Bay,$03 Drake Lake,$04 Marian Fortress,$05 Port Blue,$06 Twilight City,$07 Glacier Coast,$08 Southern Island
Cheat11="Always First Place",801C269F 0000
|
{
"pile_set_name": "Github"
}
|
---
title: "Accessibility Checker Rule Help: WCAG20_Frame_HasTitle"
---
import "../../../styles/ToolHelp.scss"
import { CodeSnippet, Tag } from "carbon-components-react";
<div className="toolHelp">
<Row>
<Column colLg={16} colMd={8} colSm={4} className="toolHead">
### Inline frame does not have a title
<div id="locLevel"></div>
Inline frames must have a unique, non-empty title
</Column>
</Row>
<Row>
<Column colLg={11} colMd={5} colSm={4} className="toolMain">
### Why is this important?
An inline frame’s title provides a label for the frame that describes its content to the user. With this information a user can determine which frame to enter and explore in detail.
<div id="locSnippet"></div>
### What to do
* Use the `"title"` attribute of the `<iframe>` element to provide a unique, non-empty title that describes its contents.
For example:
<CodeSnippet type="multi" light={true}><iframe src="https://cloudstorage.html" id="adiframe"
name="adiframe" title="Cloud Storage">
<a href="storage-ad.html"> Cloud storage</a>
</iframe></CodeSnippet>
</Column>
<Column colLg={5} colMd={3} colSm={4} className="toolLeft">
### About this requirement
[IBM 4.1.2 Name, Role, Value](http://www.ibm.com/able/guidelines/ci162/name_role_value.html)
[WCAG 2.1 technique H64](https://www.w3.org/WAI/WCAG21/Techniques/html/H64)
### Who does this affect?
* Blind people using screen readers
* People who physically cannot use a pointing device
* People with dexterity impairment who navigate web pages with a keyboard
</Column>
</Row>
</div>
export default ({ children, _frontmatter }) => (<React.Fragment>{children}</React.Fragment>)
|
{
"pile_set_name": "Github"
}
|
package org.apache.helix.controller.stages;
/*
* 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.
*/
import java.util.HashMap;
import java.util.Map;
import org.apache.helix.HelixDefinedState;
import org.apache.helix.HelixManager;
import org.apache.helix.controller.LogUtil;
import org.apache.helix.controller.common.PartitionStateMap;
import org.apache.helix.controller.dataproviders.ResourceControllerDataProvider;
import org.apache.helix.controller.pipeline.AbstractAsyncBaseStage;
import org.apache.helix.controller.pipeline.AsyncWorkerType;
import org.apache.helix.model.BuiltInStateModelDefinitions;
import org.apache.helix.model.IdealState;
import org.apache.helix.model.MaintenanceSignal;
import org.apache.helix.model.Partition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MaintenanceRecoveryStage extends AbstractAsyncBaseStage {
private static Logger LOG = LoggerFactory.getLogger(MaintenanceRecoveryStage.class);
@Override
public AsyncWorkerType getAsyncWorkerType() {
return AsyncWorkerType.MaintenanceRecoveryWorker;
}
@Override
public void execute(final ClusterEvent event) throws Exception {
// Check the cache is there
ResourceControllerDataProvider cache =
event.getAttribute(AttributeName.ControllerDataProvider.name());
if (cache == null) {
return;
}
// Check if the maintenance signal has been changed during this pipeline run
// If true, skip this stage because the Controller already changed the signal
// The flag will be flipped in the next ReadClusterDataStage()
if (cache.hasMaintenanceSignalChanged()) {
return;
}
// Check for the maintenance signal
// If it was entered manually or the signal is null (which shouldn't happen), skip this stage
MaintenanceSignal maintenanceSignal = cache.getMaintenanceSignal();
if (maintenanceSignal == null || maintenanceSignal
.getTriggeringEntity() != MaintenanceSignal.TriggeringEntity.CONTROLLER) {
return;
}
HelixManager manager = event.getAttribute(AttributeName.helixmanager.name());
if (manager == null || !manager.isConnected()) {
LogUtil.logInfo(LOG, _eventId,
"MaintenanceRecoveryStage failed due to HelixManager being null or not connected!");
return;
}
// At this point, the cluster entered maintenance mode automatically. Retrieve the
// auto-triggering reason
MaintenanceSignal.AutoTriggerReason internalReason = maintenanceSignal.getAutoTriggerReason();
boolean shouldExitMaintenance;
String reason;
switch (internalReason) {
case MAX_OFFLINE_INSTANCES_EXCEEDED:
// Check on the number of offline/disabled instances
int numOfflineInstancesForAutoExit =
cache.getClusterConfig().getNumOfflineInstancesForAutoExit();
if (numOfflineInstancesForAutoExit < 0) {
return; // Config is not set, no auto-exit
}
// Get the count of all instances that are either offline or disabled
int offlineDisabledCount =
cache.getAllInstances().size() - cache.getEnabledLiveInstances().size();
shouldExitMaintenance = offlineDisabledCount <= numOfflineInstancesForAutoExit;
reason = String.format(
"Auto-exiting maintenance mode for cluster %s; Num. of offline/disabled instances is %d, less than or equal to the exit threshold %d",
event.getClusterName(), offlineDisabledCount, numOfflineInstancesForAutoExit);
break;
case MAX_PARTITION_PER_INSTANCE_EXCEEDED:
IntermediateStateOutput intermediateStateOutput =
event.getAttribute(AttributeName.INTERMEDIATE_STATE.name());
if (intermediateStateOutput == null) {
return;
}
shouldExitMaintenance = !violatesMaxPartitionsPerInstance(cache, intermediateStateOutput);
reason = String.format(
"Auto-exiting maintenance mode for cluster %s; All instances have fewer or equal number of partitions than maxPartitionsPerInstance threshold.",
event.getClusterName());
break;
default:
shouldExitMaintenance = false;
reason = "";
}
if (shouldExitMaintenance) {
// The cluster has recovered sufficiently, so proceed to exit the maintenance mode by removing
// MaintenanceSignal. AutoTriggerReason won't be recorded
manager.getClusterManagmentTool().autoEnableMaintenanceMode(manager.getClusterName(), false,
reason, internalReason);
cache.setMaintenanceSignalChanged(); // Set the flag so we do not double enable/disable
LogUtil.logInfo(LOG, _eventId, reason);
}
}
/**
* Check that the intermediateStateOutput assignment does not violate maxPartitionPerInstance
* threshold.
* @param cache
* @param intermediateStateOutput
* @return true if violation is found, false otherwise.
*/
private boolean violatesMaxPartitionsPerInstance(ResourceControllerDataProvider cache,
IntermediateStateOutput intermediateStateOutput) {
int maxPartitionPerInstance = cache.getClusterConfig().getMaxPartitionsPerInstance();
if (maxPartitionPerInstance <= 0) {
// Config is not set; return
return false;
}
Map<String, PartitionStateMap> resourceStatesMap =
intermediateStateOutput.getResourceStatesMap();
Map<String, Integer> instancePartitionCounts = new HashMap<>();
for (String resource : resourceStatesMap.keySet()) {
IdealState idealState = cache.getIdealState(resource);
if (idealState != null
&& idealState.getStateModelDefRef().equals(BuiltInStateModelDefinitions.Task.name())) {
// Ignore task here. Task has its own throttling logic
continue;
}
PartitionStateMap partitionStateMap = resourceStatesMap.get(resource);
Map<Partition, Map<String, String>> stateMaps = partitionStateMap.getStateMap();
for (Partition p : stateMaps.keySet()) {
Map<String, String> stateMap = stateMaps.get(p);
for (String instance : stateMap.keySet()) {
// If this replica is in DROPPED state, do not count it in the partition count since it is
// to be dropped
String state = stateMap.get(instance);
if (state.equals(HelixDefinedState.DROPPED.name())) {
continue;
}
if (!instancePartitionCounts.containsKey(instance)) {
instancePartitionCounts.put(instance, 0);
}
// Number of replicas (from different partitions) held in this instance
int partitionCount = instancePartitionCounts.get(instance);
partitionCount++;
if (partitionCount > maxPartitionPerInstance) {
// There exists an instance whose intermediate state assignment violates the maximum
// partitions per instance threshold, return!
return true;
}
instancePartitionCounts.put(instance, partitionCount);
}
}
}
// No violation found
return false;
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2019 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.
package pgerror
import (
"bytes"
"fmt"
"strings"
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode"
"github.com/cockroachdb/errors"
)
// Flatten turns any error into a pgerror with fields populated. As
// the name implies, the details from the chain of causes is projected
// into a single struct. This is useful in at least two places:
//
// - to generate Error objects suitable for 19.1 nodes, which
// only recognize this type of payload.
// - to generate an error packet on pgwire.
//
// Additionally, this can be used in the remainder of the code
// base when an Error object is expected, until that code
// is updated to use the errors library directly.
//
// Flatten() returns a nil ptr if err was nil to start with.
func Flatten(err error) *Error {
if err == nil {
return nil
}
resErr := &Error{
Code: GetPGCode(err).String(),
Message: err.Error(),
Severity: GetSeverity(err),
ConstraintName: GetConstraintName(err),
}
// Populate the source field if available.
if file, line, fn, ok := errors.GetOneLineSource(err); ok {
resErr.Source = &Error_Source{File: file, Line: int32(line), Function: fn}
}
// Populate the details and hints.
resErr.Hint = errors.FlattenHints(err)
resErr.Detail = errors.FlattenDetails(err)
// Add a useful error prefix if not already there.
switch resErr.Code {
case pgcode.Internal.String():
// The string "internal error" clarifies the nature of the error
// to users, and is also introduced for compatibility with
// previous CockroachDB versions.
if !strings.HasPrefix(resErr.Message, InternalErrorPrefix) {
resErr.Message = InternalErrorPrefix + ": " + resErr.Message
}
// If the error flows towards a human user and does not get
// sent via telemetry, we want to empower the user to
// file a moderately useful error report. For this purpose,
// append the innermost stack trace.
resErr.Detail += getInnerMostStackTraceAsDetail(err)
case pgcode.SerializationFailure.String():
// The string "restart transaction" is asserted by test code. This
// can be changed if/when test code learns to use the 40001 code
// (or the errors library) instead.
//
// TODO(knz): investigate whether 3rd party frameworks parse this
// string instead of using the pg code to determine whether to
// retry.
if !strings.HasPrefix(resErr.Message, TxnRetryMsgPrefix) {
resErr.Message = TxnRetryMsgPrefix + ": " + resErr.Message
}
}
return resErr
}
func getInnerMostStackTraceAsDetail(err error) string {
if c := errors.UnwrapOnce(err); c != nil {
s := getInnerMostStackTraceAsDetail(c)
if s != "" {
return s
}
}
// Fall through: there is no stack trace so far.
if st := errors.GetReportableStackTrace(err); st != nil {
var t bytes.Buffer
t.WriteString("stack trace:\n")
for i := len(st.Frames) - 1; i >= 0; i-- {
f := st.Frames[i]
fmt.Fprintf(&t, "%s:%d: %s()\n", f.Filename, f.Lineno, f.Function)
}
return t.String()
}
return ""
}
// InternalErrorPrefix is prepended on internal errors.
const InternalErrorPrefix = "internal error"
// TxnRetryMsgPrefix is the prefix inserted in an error message when flattened
const TxnRetryMsgPrefix = "restart transaction"
// GetPGCode retrieves the error code for an error.
func GetPGCode(err error) pgcode.Code {
return GetPGCodeInternal(err, ComputeDefaultCode)
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2008 Juergen Beisert, kernel@pengutronix.de
* Copyright 2009 Sascha Hauer, s.hauer@pengutronix.de
* Copyright 2012 Philippe Retornaz, philippe.retornaz@epfl.ch
*
* Initial development of this code was funded by
* Phytec Messtechnik GmbH, http://www.phytec.de
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#include <linux/module.h>
#include <linux/device.h>
#include <linux/of.h>
#include <linux/mfd/mc13xxx.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include <sound/soc-dapm.h>
#include <linux/regmap.h>
#include "mc13783.h"
#define AUDIO_RX0_ALSPEN (1 << 5)
#define AUDIO_RX0_ALSPSEL (1 << 7)
#define AUDIO_RX0_ADDCDC (1 << 21)
#define AUDIO_RX0_ADDSTDC (1 << 22)
#define AUDIO_RX0_ADDRXIN (1 << 23)
#define AUDIO_RX1_PGARXEN (1 << 0);
#define AUDIO_RX1_PGASTEN (1 << 5)
#define AUDIO_RX1_ARXINEN (1 << 10)
#define AUDIO_TX_AMC1REN (1 << 5)
#define AUDIO_TX_AMC1LEN (1 << 7)
#define AUDIO_TX_AMC2EN (1 << 9)
#define AUDIO_TX_ATXINEN (1 << 11)
#define AUDIO_TX_RXINREC (1 << 13)
#define SSI_NETWORK_CDCTXRXSLOT(x) (((x) & 0x3) << 2)
#define SSI_NETWORK_CDCTXSECSLOT(x) (((x) & 0x3) << 4)
#define SSI_NETWORK_CDCRXSECSLOT(x) (((x) & 0x3) << 6)
#define SSI_NETWORK_CDCRXSECGAIN(x) (((x) & 0x3) << 8)
#define SSI_NETWORK_CDCSUMGAIN(x) (1 << 10)
#define SSI_NETWORK_CDCFSDLY(x) (1 << 11)
#define SSI_NETWORK_DAC_SLOTS_8 (1 << 12)
#define SSI_NETWORK_DAC_SLOTS_4 (2 << 12)
#define SSI_NETWORK_DAC_SLOTS_2 (3 << 12)
#define SSI_NETWORK_DAC_SLOT_MASK (3 << 12)
#define SSI_NETWORK_DAC_RXSLOT_0_1 (0 << 14)
#define SSI_NETWORK_DAC_RXSLOT_2_3 (1 << 14)
#define SSI_NETWORK_DAC_RXSLOT_4_5 (2 << 14)
#define SSI_NETWORK_DAC_RXSLOT_6_7 (3 << 14)
#define SSI_NETWORK_DAC_RXSLOT_MASK (3 << 14)
#define SSI_NETWORK_STDCRXSECSLOT(x) (((x) & 0x3) << 16)
#define SSI_NETWORK_STDCRXSECGAIN(x) (((x) & 0x3) << 18)
#define SSI_NETWORK_STDCSUMGAIN (1 << 20)
/*
* MC13783_AUDIO_CODEC and MC13783_AUDIO_DAC mostly share the same
* register layout
*/
#define AUDIO_SSI_SEL (1 << 0)
#define AUDIO_CLK_SEL (1 << 1)
#define AUDIO_CSM (1 << 2)
#define AUDIO_BCL_INV (1 << 3)
#define AUDIO_CFS_INV (1 << 4)
#define AUDIO_CFS(x) (((x) & 0x3) << 5)
#define AUDIO_CLK(x) (((x) & 0x7) << 7)
#define AUDIO_C_EN (1 << 11)
#define AUDIO_C_CLK_EN (1 << 12)
#define AUDIO_C_RESET (1 << 15)
#define AUDIO_CODEC_CDCFS8K16K (1 << 10)
#define AUDIO_DAC_CFS_DLY_B (1 << 10)
struct mc13783_priv {
struct mc13xxx *mc13xxx;
struct regmap *regmap;
enum mc13783_ssi_port adc_ssi_port;
enum mc13783_ssi_port dac_ssi_port;
};
/* Mapping between sample rates and register value */
static unsigned int mc13783_rates[] = {
8000, 11025, 12000, 16000,
22050, 24000, 32000, 44100,
48000, 64000, 96000
};
static int mc13783_pcm_hw_params_dac(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
struct snd_soc_component *component = dai->component;
unsigned int rate = params_rate(params);
int i;
for (i = 0; i < ARRAY_SIZE(mc13783_rates); i++) {
if (rate == mc13783_rates[i]) {
snd_soc_component_update_bits(component, MC13783_AUDIO_DAC,
0xf << 17, i << 17);
return 0;
}
}
return -EINVAL;
}
static int mc13783_pcm_hw_params_codec(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
struct snd_soc_component *component = dai->component;
unsigned int rate = params_rate(params);
unsigned int val;
switch (rate) {
case 8000:
val = 0;
break;
case 16000:
val = AUDIO_CODEC_CDCFS8K16K;
break;
default:
return -EINVAL;
}
snd_soc_component_update_bits(component, MC13783_AUDIO_CODEC, AUDIO_CODEC_CDCFS8K16K,
val);
return 0;
}
static int mc13783_pcm_hw_params_sync(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
return mc13783_pcm_hw_params_dac(substream, params, dai);
else
return mc13783_pcm_hw_params_codec(substream, params, dai);
}
static int mc13783_set_fmt(struct snd_soc_dai *dai, unsigned int fmt,
unsigned int reg)
{
struct snd_soc_component *component = dai->component;
unsigned int val = 0;
unsigned int mask = AUDIO_CFS(3) | AUDIO_BCL_INV | AUDIO_CFS_INV |
AUDIO_CSM | AUDIO_C_CLK_EN | AUDIO_C_RESET;
/* DAI mode */
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S:
val |= AUDIO_CFS(2);
break;
case SND_SOC_DAIFMT_DSP_A:
val |= AUDIO_CFS(1);
break;
default:
return -EINVAL;
}
/* DAI clock inversion */
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
case SND_SOC_DAIFMT_NB_NF:
val |= AUDIO_BCL_INV;
break;
case SND_SOC_DAIFMT_NB_IF:
val |= AUDIO_BCL_INV | AUDIO_CFS_INV;
break;
case SND_SOC_DAIFMT_IB_NF:
break;
case SND_SOC_DAIFMT_IB_IF:
val |= AUDIO_CFS_INV;
break;
}
/* DAI clock master masks */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM:
val |= AUDIO_C_CLK_EN;
break;
case SND_SOC_DAIFMT_CBS_CFS:
val |= AUDIO_CSM;
break;
case SND_SOC_DAIFMT_CBM_CFS:
case SND_SOC_DAIFMT_CBS_CFM:
return -EINVAL;
}
val |= AUDIO_C_RESET;
snd_soc_component_update_bits(component, reg, mask, val);
return 0;
}
static int mc13783_set_fmt_async(struct snd_soc_dai *dai, unsigned int fmt)
{
if (dai->id == MC13783_ID_STEREO_DAC)
return mc13783_set_fmt(dai, fmt, MC13783_AUDIO_DAC);
else
return mc13783_set_fmt(dai, fmt, MC13783_AUDIO_CODEC);
}
static int mc13783_set_fmt_sync(struct snd_soc_dai *dai, unsigned int fmt)
{
int ret;
ret = mc13783_set_fmt(dai, fmt, MC13783_AUDIO_DAC);
if (ret)
return ret;
/*
* In synchronous mode force the voice codec into slave mode
* so that the clock / framesync from the stereo DAC is used
*/
fmt &= ~SND_SOC_DAIFMT_MASTER_MASK;
fmt |= SND_SOC_DAIFMT_CBS_CFS;
ret = mc13783_set_fmt(dai, fmt, MC13783_AUDIO_CODEC);
return ret;
}
static int mc13783_sysclk[] = {
13000000,
15360000,
16800000,
-1,
26000000,
-1, /* 12000000, invalid for voice codec */
-1, /* 3686400, invalid for voice codec */
33600000,
};
static int mc13783_set_sysclk(struct snd_soc_dai *dai,
int clk_id, unsigned int freq, int dir,
unsigned int reg)
{
struct snd_soc_component *component = dai->component;
int clk;
unsigned int val = 0;
unsigned int mask = AUDIO_CLK(0x7) | AUDIO_CLK_SEL;
for (clk = 0; clk < ARRAY_SIZE(mc13783_sysclk); clk++) {
if (mc13783_sysclk[clk] < 0)
continue;
if (mc13783_sysclk[clk] == freq)
break;
}
if (clk == ARRAY_SIZE(mc13783_sysclk))
return -EINVAL;
if (clk_id == MC13783_CLK_CLIB)
val |= AUDIO_CLK_SEL;
val |= AUDIO_CLK(clk);
snd_soc_component_update_bits(component, reg, mask, val);
return 0;
}
static int mc13783_set_sysclk_dac(struct snd_soc_dai *dai,
int clk_id, unsigned int freq, int dir)
{
return mc13783_set_sysclk(dai, clk_id, freq, dir, MC13783_AUDIO_DAC);
}
static int mc13783_set_sysclk_codec(struct snd_soc_dai *dai,
int clk_id, unsigned int freq, int dir)
{
return mc13783_set_sysclk(dai, clk_id, freq, dir, MC13783_AUDIO_CODEC);
}
static int mc13783_set_sysclk_sync(struct snd_soc_dai *dai,
int clk_id, unsigned int freq, int dir)
{
int ret;
ret = mc13783_set_sysclk(dai, clk_id, freq, dir, MC13783_AUDIO_DAC);
if (ret)
return ret;
return mc13783_set_sysclk(dai, clk_id, freq, dir, MC13783_AUDIO_CODEC);
}
static int mc13783_set_tdm_slot_dac(struct snd_soc_dai *dai,
unsigned int tx_mask, unsigned int rx_mask, int slots,
int slot_width)
{
struct snd_soc_component *component = dai->component;
unsigned int val = 0;
unsigned int mask = SSI_NETWORK_DAC_SLOT_MASK |
SSI_NETWORK_DAC_RXSLOT_MASK;
switch (slots) {
case 2:
val |= SSI_NETWORK_DAC_SLOTS_2;
break;
case 4:
val |= SSI_NETWORK_DAC_SLOTS_4;
break;
case 8:
val |= SSI_NETWORK_DAC_SLOTS_8;
break;
default:
return -EINVAL;
}
switch (rx_mask) {
case 0x03:
val |= SSI_NETWORK_DAC_RXSLOT_0_1;
break;
case 0x0c:
val |= SSI_NETWORK_DAC_RXSLOT_2_3;
break;
case 0x30:
val |= SSI_NETWORK_DAC_RXSLOT_4_5;
break;
case 0xc0:
val |= SSI_NETWORK_DAC_RXSLOT_6_7;
break;
default:
return -EINVAL;
}
snd_soc_component_update_bits(component, MC13783_SSI_NETWORK, mask, val);
return 0;
}
static int mc13783_set_tdm_slot_codec(struct snd_soc_dai *dai,
unsigned int tx_mask, unsigned int rx_mask, int slots,
int slot_width)
{
struct snd_soc_component *component = dai->component;
unsigned int val = 0;
unsigned int mask = 0x3f;
if (slots != 4)
return -EINVAL;
if (tx_mask != 0x3)
return -EINVAL;
val |= (0x00 << 2); /* primary timeslot RX/TX(?) is 0 */
val |= (0x01 << 4); /* secondary timeslot TX is 1 */
snd_soc_component_update_bits(component, MC13783_SSI_NETWORK, mask, val);
return 0;
}
static int mc13783_set_tdm_slot_sync(struct snd_soc_dai *dai,
unsigned int tx_mask, unsigned int rx_mask, int slots,
int slot_width)
{
int ret;
ret = mc13783_set_tdm_slot_dac(dai, tx_mask, rx_mask, slots,
slot_width);
if (ret)
return ret;
ret = mc13783_set_tdm_slot_codec(dai, tx_mask, rx_mask, slots,
slot_width);
return ret;
}
static const struct snd_kcontrol_new mc1l_amp_ctl =
SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_TX, 7, 1, 0);
static const struct snd_kcontrol_new mc1r_amp_ctl =
SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_TX, 5, 1, 0);
static const struct snd_kcontrol_new mc2_amp_ctl =
SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_TX, 9, 1, 0);
static const struct snd_kcontrol_new atx_amp_ctl =
SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_TX, 11, 1, 0);
/* Virtual mux. The chip does the input selection automatically
* as soon as we enable one input. */
static const char * const adcl_enum_text[] = {
"MC1L", "RXINL",
};
static SOC_ENUM_SINGLE_VIRT_DECL(adcl_enum, adcl_enum_text);
static const struct snd_kcontrol_new left_input_mux =
SOC_DAPM_ENUM("Route", adcl_enum);
static const char * const adcr_enum_text[] = {
"MC1R", "MC2", "RXINR", "TXIN",
};
static SOC_ENUM_SINGLE_VIRT_DECL(adcr_enum, adcr_enum_text);
static const struct snd_kcontrol_new right_input_mux =
SOC_DAPM_ENUM("Route", adcr_enum);
static const struct snd_kcontrol_new samp_ctl =
SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 3, 1, 0);
static const char * const speaker_amp_source_text[] = {
"CODEC", "Right"
};
static SOC_ENUM_SINGLE_DECL(speaker_amp_source, MC13783_AUDIO_RX0, 4,
speaker_amp_source_text);
static const struct snd_kcontrol_new speaker_amp_source_mux =
SOC_DAPM_ENUM("Speaker Amp Source MUX", speaker_amp_source);
static const char * const headset_amp_source_text[] = {
"CODEC", "Mixer"
};
static SOC_ENUM_SINGLE_DECL(headset_amp_source, MC13783_AUDIO_RX0, 11,
headset_amp_source_text);
static const struct snd_kcontrol_new headset_amp_source_mux =
SOC_DAPM_ENUM("Headset Amp Source MUX", headset_amp_source);
static const struct snd_kcontrol_new cdcout_ctl =
SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 18, 1, 0);
static const struct snd_kcontrol_new adc_bypass_ctl =
SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_CODEC, 16, 1, 0);
static const struct snd_kcontrol_new lamp_ctl =
SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 5, 1, 0);
static const struct snd_kcontrol_new hlamp_ctl =
SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 10, 1, 0);
static const struct snd_kcontrol_new hramp_ctl =
SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 9, 1, 0);
static const struct snd_kcontrol_new llamp_ctl =
SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 16, 1, 0);
static const struct snd_kcontrol_new lramp_ctl =
SOC_DAPM_SINGLE("Switch", MC13783_AUDIO_RX0, 15, 1, 0);
static const struct snd_soc_dapm_widget mc13783_dapm_widgets[] = {
/* Input */
SND_SOC_DAPM_INPUT("MC1LIN"),
SND_SOC_DAPM_INPUT("MC1RIN"),
SND_SOC_DAPM_INPUT("MC2IN"),
SND_SOC_DAPM_INPUT("RXINR"),
SND_SOC_DAPM_INPUT("RXINL"),
SND_SOC_DAPM_INPUT("TXIN"),
SND_SOC_DAPM_SUPPLY("MC1 Bias", MC13783_AUDIO_TX, 0, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("MC2 Bias", MC13783_AUDIO_TX, 1, 0, NULL, 0),
SND_SOC_DAPM_SWITCH("MC1L Amp", MC13783_AUDIO_TX, 7, 0, &mc1l_amp_ctl),
SND_SOC_DAPM_SWITCH("MC1R Amp", MC13783_AUDIO_TX, 5, 0, &mc1r_amp_ctl),
SND_SOC_DAPM_SWITCH("MC2 Amp", MC13783_AUDIO_TX, 9, 0, &mc2_amp_ctl),
SND_SOC_DAPM_SWITCH("TXIN Amp", MC13783_AUDIO_TX, 11, 0, &atx_amp_ctl),
SND_SOC_DAPM_MUX("PGA Left Input Mux", SND_SOC_NOPM, 0, 0,
&left_input_mux),
SND_SOC_DAPM_MUX("PGA Right Input Mux", SND_SOC_NOPM, 0, 0,
&right_input_mux),
SND_SOC_DAPM_MUX("Speaker Amp Source MUX", SND_SOC_NOPM, 0, 0,
&speaker_amp_source_mux),
SND_SOC_DAPM_MUX("Headset Amp Source MUX", SND_SOC_NOPM, 0, 0,
&headset_amp_source_mux),
SND_SOC_DAPM_PGA("PGA Left Input", SND_SOC_NOPM, 0, 0, NULL, 0),
SND_SOC_DAPM_PGA("PGA Right Input", SND_SOC_NOPM, 0, 0, NULL, 0),
SND_SOC_DAPM_ADC("ADC", "Capture", MC13783_AUDIO_CODEC, 11, 0),
SND_SOC_DAPM_SUPPLY("ADC_Reset", MC13783_AUDIO_CODEC, 15, 0, NULL, 0),
SND_SOC_DAPM_PGA("Voice CODEC PGA", MC13783_AUDIO_RX1, 0, 0, NULL, 0),
SND_SOC_DAPM_SWITCH("Voice CODEC Bypass", MC13783_AUDIO_CODEC, 16, 0,
&adc_bypass_ctl),
/* Output */
SND_SOC_DAPM_SUPPLY("DAC_E", MC13783_AUDIO_DAC, 11, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("DAC_Reset", MC13783_AUDIO_DAC, 15, 0, NULL, 0),
SND_SOC_DAPM_OUTPUT("RXOUTL"),
SND_SOC_DAPM_OUTPUT("RXOUTR"),
SND_SOC_DAPM_OUTPUT("HSL"),
SND_SOC_DAPM_OUTPUT("HSR"),
SND_SOC_DAPM_OUTPUT("LSPL"),
SND_SOC_DAPM_OUTPUT("LSP"),
SND_SOC_DAPM_OUTPUT("SP"),
SND_SOC_DAPM_OUTPUT("CDCOUT"),
SND_SOC_DAPM_SWITCH("CDCOUT Switch", MC13783_AUDIO_RX0, 18, 0,
&cdcout_ctl),
SND_SOC_DAPM_SWITCH("Speaker Amp Switch", MC13783_AUDIO_RX0, 3, 0,
&samp_ctl),
SND_SOC_DAPM_SWITCH("Loudspeaker Amp", SND_SOC_NOPM, 0, 0, &lamp_ctl),
SND_SOC_DAPM_SWITCH("Headset Amp Left", MC13783_AUDIO_RX0, 10, 0,
&hlamp_ctl),
SND_SOC_DAPM_SWITCH("Headset Amp Right", MC13783_AUDIO_RX0, 9, 0,
&hramp_ctl),
SND_SOC_DAPM_SWITCH("Line out Amp Left", MC13783_AUDIO_RX0, 16, 0,
&llamp_ctl),
SND_SOC_DAPM_SWITCH("Line out Amp Right", MC13783_AUDIO_RX0, 15, 0,
&lramp_ctl),
SND_SOC_DAPM_DAC("DAC", "Playback", MC13783_AUDIO_RX0, 22, 0),
SND_SOC_DAPM_PGA("DAC PGA", MC13783_AUDIO_RX1, 5, 0, NULL, 0),
};
static struct snd_soc_dapm_route mc13783_routes[] = {
/* Input */
{ "MC1L Amp", NULL, "MC1LIN"},
{ "MC1R Amp", NULL, "MC1RIN" },
{ "MC2 Amp", NULL, "MC2IN" },
{ "TXIN Amp", NULL, "TXIN"},
{ "PGA Left Input Mux", "MC1L", "MC1L Amp" },
{ "PGA Left Input Mux", "RXINL", "RXINL"},
{ "PGA Right Input Mux", "MC1R", "MC1R Amp" },
{ "PGA Right Input Mux", "MC2", "MC2 Amp"},
{ "PGA Right Input Mux", "TXIN", "TXIN Amp"},
{ "PGA Right Input Mux", "RXINR", "RXINR"},
{ "PGA Left Input", NULL, "PGA Left Input Mux"},
{ "PGA Right Input", NULL, "PGA Right Input Mux"},
{ "ADC", NULL, "PGA Left Input"},
{ "ADC", NULL, "PGA Right Input"},
{ "ADC", NULL, "ADC_Reset"},
{ "Voice CODEC PGA", "Voice CODEC Bypass", "ADC" },
{ "Speaker Amp Source MUX", "CODEC", "Voice CODEC PGA"},
{ "Speaker Amp Source MUX", "Right", "DAC PGA"},
{ "Headset Amp Source MUX", "CODEC", "Voice CODEC PGA"},
{ "Headset Amp Source MUX", "Mixer", "DAC PGA"},
/* Output */
{ "HSL", NULL, "Headset Amp Left" },
{ "HSR", NULL, "Headset Amp Right"},
{ "RXOUTL", NULL, "Line out Amp Left"},
{ "RXOUTR", NULL, "Line out Amp Right"},
{ "SP", "Speaker Amp Switch", "Speaker Amp Source MUX"},
{ "LSP", "Loudspeaker Amp", "Speaker Amp Source MUX"},
{ "HSL", "Headset Amp Left", "Headset Amp Source MUX"},
{ "HSR", "Headset Amp Right", "Headset Amp Source MUX"},
{ "Line out Amp Left", NULL, "DAC PGA"},
{ "Line out Amp Right", NULL, "DAC PGA"},
{ "DAC PGA", NULL, "DAC"},
{ "DAC", NULL, "DAC_E"},
{ "CDCOUT", "CDCOUT Switch", "Voice CODEC PGA"},
};
static const char * const mc13783_3d_mixer[] = {"Stereo", "Phase Mix",
"Mono", "Mono Mix"};
static SOC_ENUM_SINGLE_DECL(mc13783_enum_3d_mixer,
MC13783_AUDIO_RX1, 16,
mc13783_3d_mixer);
static struct snd_kcontrol_new mc13783_control_list[] = {
SOC_SINGLE("Loudspeaker enable", MC13783_AUDIO_RX0, 5, 1, 0),
SOC_SINGLE("PCM Playback Volume", MC13783_AUDIO_RX1, 6, 15, 0),
SOC_SINGLE("PCM Playback Switch", MC13783_AUDIO_RX1, 5, 1, 0),
SOC_DOUBLE("PCM Capture Volume", MC13783_AUDIO_TX, 19, 14, 31, 0),
SOC_ENUM("3D Control", mc13783_enum_3d_mixer),
SOC_SINGLE("CDCOUT Switch", MC13783_AUDIO_RX0, 18, 1, 0),
SOC_SINGLE("Earpiece Amp Switch", MC13783_AUDIO_RX0, 3, 1, 0),
SOC_DOUBLE("Headset Amp Switch", MC13783_AUDIO_RX0, 10, 9, 1, 0),
SOC_DOUBLE("Line out Amp Switch", MC13783_AUDIO_RX0, 16, 15, 1, 0),
SOC_SINGLE("PCM Capture Mixin Switch", MC13783_AUDIO_RX0, 22, 1, 0),
SOC_SINGLE("Line in Capture Mixin Switch", MC13783_AUDIO_RX0, 23, 1, 0),
SOC_SINGLE("CODEC Capture Volume", MC13783_AUDIO_RX1, 1, 15, 0),
SOC_SINGLE("CODEC Capture Mixin Switch", MC13783_AUDIO_RX0, 21, 1, 0),
SOC_SINGLE("Line in Capture Volume", MC13783_AUDIO_RX1, 12, 15, 0),
SOC_SINGLE("Line in Capture Switch", MC13783_AUDIO_RX1, 10, 1, 0),
SOC_SINGLE("MC1 Capture Bias Switch", MC13783_AUDIO_TX, 0, 1, 0),
SOC_SINGLE("MC2 Capture Bias Switch", MC13783_AUDIO_TX, 1, 1, 0),
};
static int mc13783_probe(struct snd_soc_component *component)
{
struct mc13783_priv *priv = snd_soc_component_get_drvdata(component);
snd_soc_component_init_regmap(component,
dev_get_regmap(component->dev->parent, NULL));
/* these are the reset values */
mc13xxx_reg_write(priv->mc13xxx, MC13783_AUDIO_RX0, 0x25893);
mc13xxx_reg_write(priv->mc13xxx, MC13783_AUDIO_RX1, 0x00d35A);
mc13xxx_reg_write(priv->mc13xxx, MC13783_AUDIO_TX, 0x420000);
mc13xxx_reg_write(priv->mc13xxx, MC13783_SSI_NETWORK, 0x013060);
mc13xxx_reg_write(priv->mc13xxx, MC13783_AUDIO_CODEC, 0x180027);
mc13xxx_reg_write(priv->mc13xxx, MC13783_AUDIO_DAC, 0x0e0004);
if (priv->adc_ssi_port == MC13783_SSI1_PORT)
mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_CODEC,
AUDIO_SSI_SEL, 0);
else
mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_CODEC,
AUDIO_SSI_SEL, AUDIO_SSI_SEL);
if (priv->dac_ssi_port == MC13783_SSI1_PORT)
mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_DAC,
AUDIO_SSI_SEL, 0);
else
mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_DAC,
AUDIO_SSI_SEL, AUDIO_SSI_SEL);
return 0;
}
static void mc13783_remove(struct snd_soc_component *component)
{
struct mc13783_priv *priv = snd_soc_component_get_drvdata(component);
/* Make sure VAUDIOON is off */
mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_RX0, 0x3, 0);
}
#define MC13783_RATES_RECORD (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000)
#define MC13783_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
SNDRV_PCM_FMTBIT_S24_LE)
static const struct snd_soc_dai_ops mc13783_ops_dac = {
.hw_params = mc13783_pcm_hw_params_dac,
.set_fmt = mc13783_set_fmt_async,
.set_sysclk = mc13783_set_sysclk_dac,
.set_tdm_slot = mc13783_set_tdm_slot_dac,
};
static const struct snd_soc_dai_ops mc13783_ops_codec = {
.hw_params = mc13783_pcm_hw_params_codec,
.set_fmt = mc13783_set_fmt_async,
.set_sysclk = mc13783_set_sysclk_codec,
.set_tdm_slot = mc13783_set_tdm_slot_codec,
};
/*
* The mc13783 has two SSI ports, both of them can be routed either
* to the voice codec or the stereo DAC. When two different SSI ports
* are used for the voice codec and the stereo DAC we can do different
* formats and sysclock settings for playback and capture
* (mc13783-hifi-playback and mc13783-hifi-capture). Using the same port
* forces us to use symmetric rates (mc13783-hifi).
*/
static struct snd_soc_dai_driver mc13783_dai_async[] = {
{
.name = "mc13783-hifi-playback",
.id = MC13783_ID_STEREO_DAC,
.playback = {
.stream_name = "Playback",
.channels_min = 2,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_96000,
.formats = MC13783_FORMATS,
},
.ops = &mc13783_ops_dac,
}, {
.name = "mc13783-hifi-capture",
.id = MC13783_ID_STEREO_CODEC,
.capture = {
.stream_name = "Capture",
.channels_min = 2,
.channels_max = 2,
.rates = MC13783_RATES_RECORD,
.formats = MC13783_FORMATS,
},
.ops = &mc13783_ops_codec,
},
};
static const struct snd_soc_dai_ops mc13783_ops_sync = {
.hw_params = mc13783_pcm_hw_params_sync,
.set_fmt = mc13783_set_fmt_sync,
.set_sysclk = mc13783_set_sysclk_sync,
.set_tdm_slot = mc13783_set_tdm_slot_sync,
};
static struct snd_soc_dai_driver mc13783_dai_sync[] = {
{
.name = "mc13783-hifi",
.id = MC13783_ID_SYNC,
.playback = {
.stream_name = "Playback",
.channels_min = 2,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_96000,
.formats = MC13783_FORMATS,
},
.capture = {
.stream_name = "Capture",
.channels_min = 2,
.channels_max = 2,
.rates = MC13783_RATES_RECORD,
.formats = MC13783_FORMATS,
},
.ops = &mc13783_ops_sync,
.symmetric_rates = 1,
}
};
static const struct snd_soc_component_driver soc_component_dev_mc13783 = {
.probe = mc13783_probe,
.remove = mc13783_remove,
.controls = mc13783_control_list,
.num_controls = ARRAY_SIZE(mc13783_control_list),
.dapm_widgets = mc13783_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(mc13783_dapm_widgets),
.dapm_routes = mc13783_routes,
.num_dapm_routes = ARRAY_SIZE(mc13783_routes),
.idle_bias_on = 1,
.use_pmdown_time = 1,
.endianness = 1,
.non_legacy_dai_naming = 1,
};
static int __init mc13783_codec_probe(struct platform_device *pdev)
{
struct mc13783_priv *priv;
struct mc13xxx_codec_platform_data *pdata = pdev->dev.platform_data;
struct device_node *np;
int ret;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
if (pdata) {
priv->adc_ssi_port = pdata->adc_ssi_port;
priv->dac_ssi_port = pdata->dac_ssi_port;
} else {
np = of_get_child_by_name(pdev->dev.parent->of_node, "codec");
if (!np)
return -ENOSYS;
ret = of_property_read_u32(np, "adc-port", &priv->adc_ssi_port);
if (ret) {
of_node_put(np);
return ret;
}
ret = of_property_read_u32(np, "dac-port", &priv->dac_ssi_port);
if (ret) {
of_node_put(np);
return ret;
}
of_node_put(np);
}
dev_set_drvdata(&pdev->dev, priv);
priv->mc13xxx = dev_get_drvdata(pdev->dev.parent);
if (priv->adc_ssi_port == priv->dac_ssi_port)
ret = devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_mc13783,
mc13783_dai_sync, ARRAY_SIZE(mc13783_dai_sync));
else
ret = devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_mc13783,
mc13783_dai_async, ARRAY_SIZE(mc13783_dai_async));
return ret;
}
static int mc13783_codec_remove(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver mc13783_codec_driver = {
.driver = {
.name = "mc13783-codec",
},
.remove = mc13783_codec_remove,
};
module_platform_driver_probe(mc13783_codec_driver, mc13783_codec_probe);
MODULE_DESCRIPTION("ASoC MC13783 driver");
MODULE_AUTHOR("Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>");
MODULE_AUTHOR("Philippe Retornaz <philippe.retornaz@epfl.ch>");
MODULE_LICENSE("GPL");
|
{
"pile_set_name": "Github"
}
|
openapi: 3.0.2
info:
title: ...
version: 0.0.0
paths:
/foo:
get:
responses:
200:
description: ...
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Bar'
components:
schemas:
Bar:
type: string
enum:
- Foo
- Bar
- Foo Bar
- Foo-Bar
- 1Foo
- Bar
- ' Foo'
- ' Foo '
- _Foo_
|
{
"pile_set_name": "Github"
}
|
method bar()java.lang.Integer in class Foo has a different result type in new version, where it is java.lang.Long rather than java.lang.Integer
|
{
"pile_set_name": "Github"
}
|
#--
#
# Author:: Nathaniel Talbott.
# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
# License:: Ruby license.
require 'test/unit/util/procwrapper'
module Test
module Unit
module Util
# This is a utility class that allows anything mixing
# it in to notify a set of listeners about interesting
# events.
module Observable
# We use this for defaults since nil might mean something
NOTHING = "NOTHING/#{__id__}"
# Adds the passed proc as a listener on the
# channel indicated by channel_name. listener_key
# is used to remove the listener later; if none is
# specified, the proc itself is used.
#
# Whatever is used as the listener_key is
# returned, making it very easy to use the proc
# itself as the listener_key:
#
# listener = add_listener("Channel") { ... }
# remove_listener("Channel", listener)
def add_listener(channel_name, listener_key=NOTHING, &listener) # :yields: value
unless(block_given?)
raise ArgumentError.new("No callback was passed as a listener")
end
key = listener_key
if (listener_key == NOTHING)
listener_key = listener
key = ProcWrapper.new(listener)
end
channels[channel_name] ||= {}
channels[channel_name][key] = listener
return listener_key
end
# Removes the listener indicated by listener_key
# from the channel indicated by
# channel_name. Returns the registered proc, or
# nil if none was found.
def remove_listener(channel_name, listener_key)
channel = channels[channel_name]
return nil unless (channel)
key = listener_key
if (listener_key.instance_of?(Proc))
key = ProcWrapper.new(listener_key)
end
if (channel.has_key?(key))
return channel.delete(key)
end
return nil
end
# Calls all the procs registered on the channel
# indicated by channel_name. If value is
# specified, it is passed in to the procs,
# otherwise they are called with no arguments.
#
#--
#
# Perhaps this should be private? Would it ever
# make sense for an external class to call this
# method directly?
def notify_listeners(channel_name, *arguments)
channel = channels[channel_name]
return 0 unless (channel)
listeners = channel.values
listeners.each { |listener| listener.call(*arguments) }
return listeners.size
end
private
def channels
@channels ||= {}
return @channels
end
end
end
end
end
|
{
"pile_set_name": "Github"
}
|
(executable
(name main)
(libraries num)
(modes native js)
(flags (:standard -linkall -w -3-7-33-35-37
-safe-string
-no-strict-sequence))
)
(rule
(target main.referencejs)
(deps main.bc.js)
(action (with-stdout-to %{target} (run node ./main.bc.js))))
(rule
(target main.reference)
(deps main.exe)
(action (with-stdout-to %{target} (run ./main.exe))))
(rule
(alias runtest)
(deps main.reference main.referencejs)
(action (diff main.reference main.referencejs)))
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.internal.net.http;
import java.util.Iterator;
import java.util.concurrent.Flow;
import jdk.internal.net.http.common.Demand;
import jdk.internal.net.http.common.SequentialScheduler;
/**
* A Publisher that publishes items obtained from the given Iterable. Each new
* subscription gets a new Iterator.
*/
class PullPublisher<T> implements Flow.Publisher<T> {
// Only one of `iterable` and `throwable` can be non-null. throwable is
// non-null when an error has been encountered, by the creator of
// PullPublisher, while subscribing the subscriber, but before subscribe has
// completed.
private final Iterable<T> iterable;
private final Throwable throwable;
PullPublisher(Iterable<T> iterable, Throwable throwable) {
this.iterable = iterable;
this.throwable = throwable;
}
PullPublisher(Iterable<T> iterable) {
this(iterable, null);
}
@Override
public void subscribe(Flow.Subscriber<? super T> subscriber) {
Subscription sub;
if (throwable != null) {
assert iterable == null : "non-null iterable: " + iterable;
sub = new Subscription(subscriber, null, throwable);
} else {
assert throwable == null : "non-null exception: " + throwable;
sub = new Subscription(subscriber, iterable.iterator(), null);
}
subscriber.onSubscribe(sub);
if (throwable != null) {
sub.pullScheduler.runOrSchedule();
}
}
private class Subscription implements Flow.Subscription {
private final Flow.Subscriber<? super T> subscriber;
private final Iterator<T> iter;
private volatile boolean completed;
private volatile boolean cancelled;
private volatile Throwable error;
final SequentialScheduler pullScheduler = new SequentialScheduler(new PullTask());
private final Demand demand = new Demand();
Subscription(Flow.Subscriber<? super T> subscriber,
Iterator<T> iter,
Throwable throwable) {
this.subscriber = subscriber;
this.iter = iter;
this.error = throwable;
}
final class PullTask extends SequentialScheduler.CompleteRestartableTask {
@Override
protected void run() {
if (completed || cancelled) {
return;
}
Throwable t = error;
if (t != null) {
completed = true;
pullScheduler.stop();
subscriber.onError(t);
return;
}
while (demand.tryDecrement() && !cancelled) {
T next;
try {
if (!iter.hasNext()) {
break;
}
next = iter.next();
} catch (Throwable t1) {
completed = true;
pullScheduler.stop();
subscriber.onError(t1);
return;
}
subscriber.onNext(next);
}
if (!iter.hasNext() && !cancelled) {
completed = true;
pullScheduler.stop();
subscriber.onComplete();
}
}
}
@Override
public void request(long n) {
if (cancelled)
return; // no-op
if (n <= 0) {
error = new IllegalArgumentException("non-positive subscription request: " + n);
} else {
demand.increase(n);
}
pullScheduler.runOrSchedule();
}
@Override
public void cancel() {
cancelled = true;
}
}
}
|
{
"pile_set_name": "Github"
}
|
/**mine.wxss**/
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
background-color: #fff;
margin-bottom: 20rpx;
}
.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 30rpx;
border-radius: 50%;
}
.userinfo-nickname {
margin: 20rpx;
color: #300e0e;
}
.userinfo-dig {
margin: 15rpx auto;
padding: 20rpx 25rpx;
border-radius: 10rpx;
background-color: #f85f48;
color: #fff;
letter-spacing: 1px;
}
.userinfo-desc {
color: #bbb;
font-size: 14rpx;
margin-bottom: 20rpx;
}
.profile-wrapper, .account-wrapper {
background-color: #fff;
margin-bottom: 20rpx;
}
.profile, .account {
display: flex;
padding: 30rpx;
align-items: center;
flex-direction: row;
border-bottom: 1rpx solid #f0f0f0;
}
.profile-item, .account-item {
flex: 1;
font-size: 24rpx;
}
.profile-arrow, .account-arrow {
width: 32rpx;
height: 32rpx;
}
.btn-quit {
margin: 15rpx;
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
#pragma once
#include <CrySerialization/yasli/Config.h>
namespace yasli {
class Archive;
struct FileOpen
{
string* pathPointer;
string path;
string filter;
string relativeToFolder;
int flags;
enum {
STRIP_EXTENSION = 1
};
// filter is defined in the following format:
// "All Images (*.bmp *.jpg *.tga);; Bitmap (*.bmp);; Targa (*.tga)"
FileOpen(string& path, const char* filter, const char* relativeToFolder = "", int flags = 0)
: pathPointer(&path)
, filter(filter)
, relativeToFolder(relativeToFolder)
, flags(flags)
{
this->path = path;
}
FileOpen() : pathPointer(0), flags(0) { }
FileOpen& operator=(const FileOpen& rhs)
{
path = rhs.path;
flags = rhs.flags;
if (rhs.pathPointer) {
filter = rhs.filter;
relativeToFolder = rhs.relativeToFolder;
}
return *this;
}
~FileOpen()
{
if (pathPointer)
*pathPointer = path;
}
void YASLI_SERIALIZE_METHOD(Archive& ar);
};
bool YASLI_SERIALIZE_OVERRIDE(Archive& ar, FileOpen& value, const char* name, const char* label);
}
#if YASLI_INLINE_IMPLEMENTATION
#include <CrySerialization/yasli/decorators/FileOpenImpl.h>
#endif
|
{
"pile_set_name": "Github"
}
|
/*
* json_parser.c - JSON parser for TinyG
* This file is part of the TinyG project
*
* Copyright (c) 2011 - 2015 Alden S. Hart, Jr.
*
* This file ("the software") 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. You should have received a copy of the GNU General Public
* License, version 2 along with the software. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, you may use this file as part of a software library without
* restriction. Specifically, if other files instantiate templates or use macros or
* inline functions from this file, or you compile this file and link it with other
* files to produce an executable, this file does not by itself cause the resulting
* executable to be covered by the GNU General Public License. This exception does not
* however invalidate any other reasons why the executable file might be covered by the
* GNU General Public License.
*
* THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY
* 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.
*/
#include "tinyg.h"
#include "config.h" // JSON sits on top of the config system
#include "controller.h"
#include "json_parser.h"
#include "text_parser.h"
#include "canonical_machine.h"
#include "report.h"
#include "util.h"
#include "xio.h" // for char definitions
#ifdef __cplusplus
extern "C"{
#endif
/**** Allocation ****/
jsSingleton_t js;
/**** local scope stuff ****/
static stat_t _json_parser_kernal(char_t *str);
static stat_t _get_nv_pair(nvObj_t *nv, char_t **pstr, int8_t *depth);
static stat_t _normalize_json_string(char_t *str, uint16_t size);
/****************************************************************************
* json_parser() - exposed part of JSON parser
* _json_parser_kernal()
* _normalize_json_string()
* _get_nv_pair_strict()
*
* This is a dumbed down JSON parser to fit in limited memory with no malloc
* or practical way to do recursion ("depth" tracks parent/child levels).
*
* This function will parse the following forms up to the JSON_MAX limits:
* {"name":"value"}
* {"name":12345}
* {"name1":"value1", "n2":"v2", ... "nN":"vN"}
* {"parent_name":""}
* {"parent_name":{"name":"value"}}
* {"parent_name":{"name1":"value1", "n2":"v2", ... "nN":"vN"}}
*
* "value" can be a string, number, true, false, or null (2 types)
*
* Numbers
* - number values are not quoted and can start with a digit or -.
* - numbers cannot start with + or . (period)
* - exponentiated numbers are handled OK.
* - hexadecimal or other non-decimal number bases are not supported
*
* The parser:
* - extracts an array of one or more JSON object structs from the input string
* - once the array is built it executes the object(s) in order in the array
* - passes the executed array to the response handler to generate the response string
* - returns the status and the JSON response string
*
* Separation of concerns
* json_parser() is the only exposed part. It does parsing, display, and status reports.
* _get_nv_pair() only does parsing and syntax; no semantic validation or group handling
* _json_parser_kernal() does index validation and group handling and executes sets and gets
* in an application agnostic way. It should work for other apps than TinyG
*/
void json_parser(char_t *str)
{
stat_t status = _json_parser_kernal(str);
nv_print_list(status, TEXT_NO_PRINT, JSON_RESPONSE_FORMAT);
sr_request_status_report(SR_IMMEDIATE_REQUEST); // generate incremental status report to show any changes
}
static stat_t _json_parser_kernal(char_t *str)
{
stat_t status;
int8_t depth;
nvObj_t *nv = nv_reset_nv_list(); // get a fresh nvObj list
char_t group[GROUP_LEN+1] = {""}; // group identifier - starts as NUL
int8_t i = NV_BODY_LEN;
ritorno(_normalize_json_string(str, JSON_OUTPUT_STRING_MAX)); // return if error
// parse the JSON command into the nv body
do {
if (--i == 0)
return (STAT_JSON_TOO_MANY_PAIRS); // length error
// Use relaxed parser. Will read eitehr strict or relaxed mode. To use strict-only parser refer
// to build earlier than 407.03. Substitute _get_nv_pair_strict() for _get_nv_pair()
if ((status = _get_nv_pair(nv, &str, &depth)) > STAT_EAGAIN) { // erred out
return (status);
}
// propagate the group from previous NV pair (if relevant)
if (group[0] != NUL) {
strncpy(nv->group, group, GROUP_LEN); // copy the parent's group to this child
}
// validate the token and get the index
if ((nv->index = nv_get_index(nv->group, nv->token)) == NO_MATCH) {
return (STAT_UNRECOGNIZED_NAME);
}
if ((nv_index_is_group(nv->index)) && (nv_group_is_prefixed(nv->token))) {
strncpy(group, nv->token, GROUP_LEN); // record the group ID
}
if ((nv = nv->nx) == NULL)
return (STAT_JSON_TOO_MANY_PAIRS); // Not supposed to encounter a NULL
} while (status != STAT_OK); // breaks when parsing is complete
// execute the command
nv = nv_body;
if (nv->valuetype == TYPE_NULL){ // means GET the value
ritorno(nv_get(nv)); // ritorno returns w/status on any errors
} else {
if (cm.machine_state == MACHINE_ALARM)
return (STAT_MACHINE_ALARMED);
ritorno(nv_set(nv)); // set value or call a function (e.g. gcode)
nv_persist(nv);
}
return (STAT_OK); // only successful commands exit through this point
}
/*
* _normalize_json_string - normalize a JSON string in place
*
* Validate string size limits, remove all whitespace and convert
* to lower case, with the exception of gcode comments
*/
static stat_t _normalize_json_string(char_t *str, uint16_t size)
{
char_t *wr; // write pointer
uint8_t in_comment = false;
if (strlen(str) > size)
return (STAT_INPUT_EXCEEDS_MAX_LENGTH);
for (wr = str; *str != NUL; str++) {
if (!in_comment) { // normal processing
if (*str == '(') in_comment = true;
if ((*str <= ' ') || (*str == DEL)) continue; // toss ctrls, WS & DEL
*wr++ = tolower(*str);
} else { // Gcode comment processing
if (*str == ')') in_comment = false;
*wr++ = *str;
}
}
*wr = NUL;
return (STAT_OK);
}
/*
* _get_nv_pair() - get the next name-value pair w/relaxed JSON rules. Also parses strict JSON.
*
* Parse the next statement and populate the command object (nvObj).
*
* Leaves string pointer (str) on the first character following the object.
* Which is the character just past the ',' separator if it's a multi-valued
* object or the terminating NUL if single object or the last in a multi.
*
* Keeps track of tree depth and closing braces as much as it has to.
* If this were to be extended to track multiple parents or more than two
* levels deep it would have to track closing curlies - which it does not.
*
* ASSUMES INPUT STRING HAS FIRST BEEN NORMALIZED BY _normalize_json_string()
*
* If a group prefix is passed in it will be pre-pended to any name parsed
* to form a token string. For example, if "x" is provided as a group and
* "fr" is found in the name string the parser will search for "xfr" in the
* cfgArray.
*/
/* RELAXED RULES
*
* Quotes are accepted but not needed on names
* Quotes are required for string values
*
* See build 406.xx or earlier for strict JSON parser - deleted in 407.03
*/
#define MAX_PAD_CHARS 8
#define MAX_NAME_CHARS 32
static stat_t _get_nv_pair(nvObj_t *nv, char_t **pstr, int8_t *depth)
{
uint8_t i;
char_t *tmp;
char_t leaders[] = {"{,\""}; // open curly, quote and leading comma
char_t separators[] = {":\""}; // colon and quote
char_t terminators[] = {"},\""}; // close curly, comma and quote
char_t value[] = {"{\".-+"}; // open curly, quote, period, minus and plus
nv_reset_nv(nv); // wipes the object and sets the depth
// --- Process name part ---
// Find, terminate and set pointers for the name. Allow for leading and trailing name quotes.
char_t * name = *pstr;
for (i=0; true; i++, (*pstr)++) {
if (strchr(leaders, (int)**pstr) == NULL) { // find leading character of name
name = (*pstr)++;
break;
}
if (i == MAX_PAD_CHARS)
return (STAT_JSON_SYNTAX_ERROR);
}
// Find the end of name, NUL terminate and copy token
for (i=0; true; i++, (*pstr)++) {
if (strchr(separators, (int)**pstr) != NULL) {
*(*pstr)++ = NUL;
strncpy(nv->token, name, TOKEN_LEN+1); // copy the string to the token
break;
}
if (i == MAX_NAME_CHARS)
return (STAT_JSON_SYNTAX_ERROR);
}
// --- Process value part --- (organized from most to least frequently encountered)
// Find the start of the value part
for (i=0; true; i++, (*pstr)++) {
if (isalnum((int)**pstr)) break;
if (strchr(value, (int)**pstr) != NULL) break;
if (i == MAX_PAD_CHARS)
return (STAT_JSON_SYNTAX_ERROR);
}
// nulls (gets)
if ((**pstr == 'n') || ((**pstr == '\"') && (*(*pstr+1) == '\"'))) { // process null value
nv->valuetype = TYPE_NULL;
nv->value = TYPE_NULL;
// numbers
} else if (isdigit(**pstr) || (**pstr == '-')) {// value is a number
nv->value = (float)strtod(*pstr, &tmp); // tmp is the end pointer
if(tmp == *pstr)
return (STAT_BAD_NUMBER_FORMAT);
nv->valuetype = TYPE_FLOAT;
// object parent
} else if (**pstr == '{') {
nv->valuetype = TYPE_PARENT;
// *depth += 1; // nv_reset_nv() sets the next object's level so this is redundant
(*pstr)++;
return(STAT_EAGAIN); // signal that there is more to parse
// strings
} else if (**pstr == '\"') { // value is a string
(*pstr)++;
nv->valuetype = TYPE_STRING;
if ((tmp = strchr(*pstr, '\"')) == NULL)
return (STAT_JSON_SYNTAX_ERROR); // find the end of the string
*tmp = NUL;
// if string begins with 0x it might be data, needs to be at least 3 chars long
if( strlen(*pstr)>=3 && (*pstr)[0]=='0' && (*pstr)[1]=='x')
{
uint32_t *v = (uint32_t*)&nv->value;
*v = strtoul((const char *)*pstr, 0L, 0);
nv->valuetype = TYPE_DATA;
} else {
ritorno(nv_copy_string(nv, *pstr));
}
*pstr = ++tmp;
// boolean true/false
} else if (**pstr == 't') {
nv->valuetype = TYPE_BOOL;
nv->value = true;
} else if (**pstr == 'f') {
nv->valuetype = TYPE_BOOL;
nv->value = false;
// arrays
} else if (**pstr == '[') {
nv->valuetype = TYPE_ARRAY;
ritorno(nv_copy_string(nv, *pstr)); // copy array into string for error displays
return (STAT_UNSUPPORTED_TYPE); // return error as the parser doesn't do input arrays yet
// general error condition
} else {
return (STAT_JSON_SYNTAX_ERROR); // ill-formed JSON
}
// process comma separators and end curlies
if ((*pstr = strpbrk(*pstr, terminators)) == NULL) { // advance to terminator or err out
return (STAT_JSON_SYNTAX_ERROR);
}
if (**pstr == '}') {
*depth -= 1; // pop up a nesting level
(*pstr)++; // advance to comma or whatever follows
}
if (**pstr == ',')
return (STAT_EAGAIN); // signal that there is more to parse
(*pstr)++;
return (STAT_OK); // signal that parsing is complete
}
/****************************************************************************
* json_serialize() - make a JSON object string from JSON object array
*
* *nv is a pointer to the first element in the nv list to serialize
* *out_buf is a pointer to the output string - usually what was the input string
* Returns the character count of the resulting string
*
* Operation:
* - The nvObj list is processed start to finish with no recursion
*
* - Assume the first object is depth 0 or greater (the opening curly)
*
* - Assume remaining depths have been set correctly; but might not achieve closure;
* e.g. list starts on 0, and ends on 3, in which case provide correct closing curlies
*
* - Assume there can be multiple, independent, non-contiguous JSON objects at a
* given depth value. These are processed correctly - e.g. 0,1,1,0,1,1,0,1,1
*
* - The list must have a terminating nvObj where nv->nx == NULL.
* The terminating object may or may not have data (empty or not empty).
*
* Returns:
* Returns length of string
*
* Desired behaviors:
* - Allow self-referential elements that would otherwise cause a recursive loop
* - Skip over empty objects (TYPE_EMPTY)
* - If a JSON object is empty represent it as {}
* --- OR ---
* - If a JSON object is empty omit the object altogether (no curlies)
*/
#define BUFFER_MARGIN 8 // safety margin to avoid buffer overruns during footer checksum generation
uint16_t json_serialize(nvObj_t *nv, char_t *out_buf, uint16_t size)
{
#ifdef __SILENCE_JSON_RESPONSES
return (0);
#else
char_t *str = out_buf;
char_t *str_max = out_buf + size - BUFFER_MARGIN;
int8_t initial_depth = nv->depth;
int8_t prev_depth = 0;
uint8_t need_a_comma = false;
*str++ = '{'; // write opening curly
while (true) {
if (nv->valuetype != TYPE_EMPTY) {
if (need_a_comma) { *str++ = ',';}
need_a_comma = true;
if (js.json_syntax == JSON_SYNTAX_RELAXED) { // write name
str += sprintf((char *)str, "%s:", nv->token);
} else {
str += sprintf((char *)str, "\"%s\":", nv->token);
}
// check for illegal float values
if (nv->valuetype == TYPE_FLOAT) {
if (isnan((double)nv->value) || isinf((double)nv->value)) { nv->value = 0;}
}
// serialize output value
if (nv->valuetype == TYPE_NULL) { str += (char_t)sprintf((char *)str, "null");} // Note that that "" is NOT null.
else if (nv->valuetype == TYPE_INTEGER) {
str += (char_t)sprintf((char *)str, "%1.0f", (double)nv->value);
}
else if (nv->valuetype == TYPE_DATA) {
uint32_t *v = (uint32_t*)&nv->value;
str += (char_t)sprintf((char *)str, "\"0x%lx\"", *v);
}
else if (nv->valuetype == TYPE_STRING) { str += (char_t)sprintf((char *)str, "\"%s\"",(char *)*nv->stringp);}
else if (nv->valuetype == TYPE_ARRAY) { str += (char_t)sprintf((char *)str, "[%s]", (char *)*nv->stringp);}
else if (nv->valuetype == TYPE_FLOAT) { preprocess_float(nv);
// str += fntoa((char *)str, nv->value, nv->precision);
str += fntoa(str, nv->value, nv->precision);
}
else if (nv->valuetype == TYPE_BOOL) {
if (fp_FALSE(nv->value)) { str += sprintf((char *)str, "false");}
else { str += (char_t)sprintf((char *)str, "true"); }
}
if (nv->valuetype == TYPE_PARENT) {
*str++ = '{';
need_a_comma = false;
}
}
if (str >= str_max) { return (-1);} // signal buffer overrun
if ((nv = nv->nx) == NULL) { break;} // end of the list
while (nv->depth < prev_depth--) { // iterate the closing curlies
need_a_comma = true;
*str++ = '}';
}
prev_depth = nv->depth;
}
// closing curlies and NEWLINE
while (prev_depth-- > initial_depth) { *str++ = '}';}
str += sprintf((char *)str, "}\n"); // using sprintf for this last one ensures a NUL termination
if (str > out_buf + size) { return (-1);}
return (str - out_buf);
#endif
}
/*
* json_print_object() - serialize and print the nvObj array directly (w/o header & footer)
*
* Ignores JSON verbosity settings and everything else - just serializes the list & prints
* Useful for reports and other simple output.
* Object list should be terminated by nv->nx == NULL
*/
void json_print_object(nvObj_t *nv)
{
#ifdef __SILENCE_JSON_RESPONSES
return;
#endif
json_serialize(nv, cs.out_buf, sizeof(cs.out_buf));
fprintf(stderr, "%s", (char *)cs.out_buf);
}
/*
* json_print_list() - command to select and produce a JSON formatted output
*/
void json_print_list(stat_t status, uint8_t flags)
{
switch (flags) {
case JSON_NO_PRINT: { break; }
case JSON_OBJECT_FORMAT: { json_print_object(nv_body); break; }
case JSON_RESPONSE_FORMAT: { json_print_response(status); break; }
}
}
/*
* json_print_response() - JSON responses with headers, footers and observing JSON verbosity
*
* A footer is returned for every setting except $jv=0
*
* JV_SILENT = 0, // no response is provided for any command
* JV_FOOTER, // responses contain footer only; no command echo, gcode blocks or messages
* JV_CONFIGS, // echo configs; gcode blocks are not echoed; messages are not echoed
* JV_MESSAGES, // echo configs; gcode messages only (if present); no block echo or line numbers
* JV_LINENUM, // echo configs; gcode blocks return messages and line numbers as present
* JV_VERBOSE // echos all configs and gcode blocks, line numbers and messages
*
* This gets a bit complicated. The first nvObj is the header, which must be set by reset_nv_list().
* The first object in the body will always have the gcode block or config command in it,
* which you may or may not want to display. This is followed by zero or more displayable objects.
* Then if you want a gcode line number you add that here to the end. Finally, a footer goes
* on all the (non-silent) responses.
*/
#define MAX_TAIL_LEN 8
void json_print_response(uint8_t status)
{
#ifdef __SILENCE_JSON_RESPONSES
return;
#endif
if (js.json_verbosity == JV_SILENT) return; // silent responses
// Body processing
nvObj_t *nv = nv_body;
if (status == STAT_JSON_SYNTAX_ERROR) {
nv_reset_nv_list();
nv_add_string((const char_t *)"err", escape_string(cs.in_buf, cs.saved_buf));
} else if (cm.machine_state != MACHINE_INITIALIZING) { // always do full echo during startup
uint8_t nv_type;
do {
if ((nv_type = nv_get_type(nv)) == NV_TYPE_NULL) break;
if (nv_type == NV_TYPE_GCODE) {
if (js.echo_json_gcode_block == false) { // kill command echo if not enabled
nv->valuetype = TYPE_EMPTY;
}
//++++ } else if (nv_type == NV_TYPE_CONFIG) { // kill config echo if not enabled
//fix me if (js.echo_json_configs == false) {
// nv->valuetype = TYPE_EMPTY;
// }
} else if (nv_type == NV_TYPE_MESSAGE) { // kill message echo if not enabled
if (js.echo_json_messages == false) {
nv->valuetype = TYPE_EMPTY;
}
} else if (nv_type == NV_TYPE_LINENUM) { // kill line number echo if not enabled
if ((js.echo_json_linenum == false) || (fp_ZERO(nv->value))) { // do not report line# 0
nv->valuetype = TYPE_EMPTY;
}
}
} while ((nv = nv->nx) != NULL);
}
// Footer processing
while(nv->valuetype != TYPE_EMPTY) { // find a free nvObj at end of the list...
if ((nv = nv->nx) == NULL) { //...or hit the NULL and return w/o a footer
json_serialize(nv_header, cs.out_buf, sizeof(cs.out_buf));
return;
}
}
char_t footer_string[NV_FOOTER_LEN];
sprintf((char *)footer_string, "%d,%d,%d,0", FOOTER_REVISION, status, cs.linelen);
cs.linelen = 0; // reset linelen so it's only reported once
nv_copy_string(nv, footer_string); // link string to nv object
// nv->depth = 0; // footer 'f' is a peer to response 'r' (hard wired to 0)
nv->depth = js.json_footer_depth; // 0=footer is peer to response 'r', 1=child of response 'r'
nv->valuetype = TYPE_ARRAY;
strcpy(nv->token, "f"); // terminate the list
nv->nx = NULL;
// do all this to avoid having to serialize it twice
int16_t strcount = json_serialize(nv_header, cs.out_buf, sizeof(cs.out_buf));// make JSON string w/o checksum
if (strcount < 0) { return;} // encountered an overrun during serialization
if (strcount > OUTPUT_BUFFER_LEN - MAX_TAIL_LEN) { return;} // would overrun during checksum generation
int16_t strcount2 = strcount;
char tail[MAX_TAIL_LEN];
while (cs.out_buf[strcount] != '0') { strcount--; } // find end of checksum
strcpy(tail, cs.out_buf + strcount + 1); // save the json termination
while (cs.out_buf[strcount2] != ',') { strcount2--; }// find start of checksum
sprintf((char *)cs.out_buf + strcount2 + 1, "%d%s", compute_checksum(cs.out_buf, strcount2), tail);
fprintf(stderr, "%s", cs.out_buf);
}
/***********************************************************************************
* CONFIGURATION AND INTERFACE FUNCTIONS
* Functions to get and set variables from the cfgArray table
***********************************************************************************/
/*
* json_set_jv()
*/
stat_t json_set_jv(nvObj_t *nv)
{
if (nv->value > JV_VERBOSE)
return (STAT_INPUT_VALUE_RANGE_ERROR);
js.json_verbosity = nv->value;
js.echo_json_footer = false;
js.echo_json_messages = false;
js.echo_json_configs = false;
js.echo_json_linenum = false;
js.echo_json_gcode_block = false;
if (nv->value >= JV_FOOTER) { js.echo_json_footer = true;}
if (nv->value >= JV_MESSAGES) { js.echo_json_messages = true;}
if (nv->value >= JV_CONFIGS) { js.echo_json_configs = true;}
if (nv->value >= JV_LINENUM) { js.echo_json_linenum = true;}
if (nv->value >= JV_VERBOSE) { js.echo_json_gcode_block = true;}
return(STAT_OK);
}
/***********************************************************************************
* TEXT MODE SUPPORT
* Functions to print variables from the cfgArray table
***********************************************************************************/
#ifdef __TEXT_MODE
/*
* js_print_ej()
* js_print_jv()
* js_print_j2()
* js_print_fs()
*/
static const char fmt_ej[] PROGMEM = "[ej] enable json mode%13d [0=text,1=JSON]\n";
static const char fmt_jv[] PROGMEM = "[jv] json verbosity%15d [0=silent,1=footer,2=messages,3=configs,4=linenum,5=verbose]\n";
static const char fmt_js[] PROGMEM = "[js] json serialize style%9d [0=relaxed,1=strict]\n";
static const char fmt_fs[] PROGMEM = "[fs] footer style%17d [0=new,1=old]\n";
void js_print_ej(nvObj_t *nv) { text_print_ui8(nv, fmt_ej);}
void js_print_jv(nvObj_t *nv) { text_print_ui8(nv, fmt_jv);}
void js_print_js(nvObj_t *nv) { text_print_ui8(nv, fmt_js);}
void js_print_fs(nvObj_t *nv) { text_print_ui8(nv, fmt_fs);}
#endif // __TEXT_MODE
#ifdef __cplusplus
}
#endif // __cplusplus
|
{
"pile_set_name": "Github"
}
|
// Avisynth C Interface Version 0.20
// Copyright 2003 Kevin Atkinson
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
// http://www.gnu.org/copyleft/gpl.html .
//
// As a special exception, I give you permission to link to the
// Avisynth C interface with independent modules that communicate with
// the Avisynth C interface solely through the interfaces defined in
// avisynth_c.h, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting combined work
// under terms of your choice, provided that every copy of the
// combined work is accompanied by a complete copy of the source code
// of the Avisynth C interface and Avisynth itself (with the version
// used to produce the combined work), being distributed under the
// terms of the GNU General Public License plus this exception. An
// independent module is a module which is not derived from or based
// on Avisynth C Interface, such as 3rd-party filters, import and
// export plugins, or graphical user interfaces.
#ifndef AVS_ALIGNMENT_H
#define AVS_ALIGNMENT_H
// Functions and macros to help work with alignment requirements.
// Tells if a number is a power of two.
#define IS_POWER2(n) ((n) && !((n) & ((n) - 1)))
// Tells if the pointer "ptr" is aligned to "align" bytes.
#define IS_PTR_ALIGNED(ptr, align) (((uintptr_t)ptr & ((uintptr_t)(align-1))) == 0)
// Rounds up the number "n" to the next greater multiple of "align"
#define ALIGN_NUMBER(n, align) (((n) + (align)-1) & (~((align)-1)))
// Rounds up the pointer address "ptr" to the next greater multiple of "align"
#define ALIGN_POINTER(ptr, align) (((uintptr_t)(ptr) + (align)-1) & (~(uintptr_t)((align)-1)))
#ifdef __cplusplus
#include <cassert>
#include <cstdlib>
#include <cstdint>
#include <avs/config.h>
#if defined(MSVC)
// needed for VS2013, otherwise C++11 'alignas' works
#define avs_alignas(x) __declspec(align(x))
#else
// assumes C++11 support
#define avs_alignas(x) alignas(x)
#endif
template<typename T>
static bool IsPtrAligned(T* ptr, size_t align)
{
assert(IS_POWER2(align));
return (bool)IS_PTR_ALIGNED(ptr, align);
}
template<typename T>
static T AlignNumber(T n, T align)
{
assert(IS_POWER2(align));
return ALIGN_NUMBER(n, align);
}
template<typename T>
static T* AlignPointer(T* ptr, size_t align)
{
assert(IS_POWER2(align));
return (T*)ALIGN_POINTER(ptr, align);
}
extern "C"
{
#else
#include <stdlib.h>
#endif // __cplusplus
// Returns a new buffer that is at least the size "nbytes".
// The buffer will be aligned to "align" bytes.
// Returns NULL on error. On successful allocation,
// the returned buffer must be freed using "avs_free".
inline void* avs_malloc(size_t nbytes, size_t align)
{
if (!IS_POWER2(align))
return NULL;
size_t offset = sizeof(void*) + align - 1;
void *orig = malloc(nbytes + offset);
if (orig == NULL)
return NULL;
void **aligned = (void**)(((uintptr_t)orig + (uintptr_t)offset) & (~(uintptr_t)(align-1)));
aligned[-1] = orig;
return aligned;
}
// Buffers allocated using "avs_malloc" must be freed
// using "avs_free" instead of "free".
inline void avs_free(void *ptr)
{
// Mirroring free()'s semantic requires us to accept NULLs
if (ptr == NULL)
return;
free(((void**)ptr)[-1]);
}
#ifdef __cplusplus
} // extern "C"
// The point of these undef's is to force using the template functions
// if we are in C++ mode. For C, the user can rely only on the macros.
#undef IS_PTR_ALIGNED
#undef ALIGN_NUMBER
#undef ALIGN_POINTER
#endif // __cplusplus
#endif //AVS_ALIGNMENT_H
|
{
"pile_set_name": "Github"
}
|
@model SimpleSSO.DTO.System.AppDTO
@{
ViewBag.Title = "SimpleSSO 授权";
}
<style>
body {
background-color: #fff;
}
.box-header.with-border {
background-color: #51b7ec;
}
.box.box-primary {
border-top: 5px solid #51b7ec;
}
div > .pull-right {
font-size: 14px;
color: #fff;
}
</style>
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">
<img class="profile-user-img img-responsive img-circle" src="~/Content/image/FreeBird.jpg" alt="User profile picture">
</h3>
<div class="pull-right">
SimpleSSO授权登录
</div>
</div>
<div class="box-body">
<div style="margin:0% auto;width:370px">
<div class="box box-primary">
<div class="box-body box-profile">
<img class="profile-user-img img-responsive img-circle" src="../..@Model.IconUrl" alt="User profile picture">
<h3 class="profile-username text-center">@Model.Name</h3>
<p class="text-muted text-center">一个友好的网站</p>
<ul class="list-group list-group-unbordered">
<li class="list-group-item">
@if (ViewBag.Scope == "user_all")
{
<b style="color:red"> 用户全部信息获取</b>
<span class="pull-right" style="color:red">√   </span>
}
else
{
<b> 用户基础信息获取</b>
<span class="pull-right">√   </span>
}
</li>
<li class="list-group-item">
<b> 用户隐私查看</b> <span class="pull-right" style="color:red">X   </span>
</li>
<li class="list-group-item">
<b>  Scope</b> <span class="pull-right">@ViewBag.Scope</span>
</li>
</ul>
<a href="@ViewBag.AccessUrl" class="btn btn-primary btn-block"><b>授权进入</b></a>
</div>
<!-- /.box-body -->
</div>
</div>
</div>
</div>
|
{
"pile_set_name": "Github"
}
|
# Changes to Examples
This log is meant to help example authors track changes to the main C
example set. You can also use the GitHub logs.
## 2012-11-09
* All "LRU" changed to "load-balancing" in comments.
* bstar: changed 'master' and 'slave' to 'active' and 'passive'.
## 2012-11-07
* identity.c: changed 'Hello' address to 'PEER2' to be more expressive.
* rtpapa.c: example deleted as it shows an invalid socket combination.
* rtmama.c: renamed to 'rtreq.c' for clarity.
* rtreq.c: mostly rewritten
* rtdealer.c: entirely rewritten
|
{
"pile_set_name": "Github"
}
|
MODULE := src/emucore/tia/frame-manager
MODULE_OBJS := \
src/emucore/tia/frame-manager/FrameManager.o \
src/emucore/tia/frame-manager/AbstractFrameManager.o \
src/emucore/tia/frame-manager/FrameLayoutDetector.o \
src/emucore/tia/frame-manager/JitterEmulation.o
MODULE_DIRS += \
src/emucore/tia/frame-manager
# Include common rules
include $(srcdir)/common.rules
|
{
"pile_set_name": "Github"
}
|
/** @file ikmeans.h
** @brief Integer K-Means clustering
** @author Brian Fulkerson
** @author Andrea Vedaldi
**/
/*
Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
All rights reserved.
This file is part of the VLFeat library and is made available under
the terms of the BSD license (see the COPYING file).
*/
#ifndef VL_IKMEANS_H
#define VL_IKMEANS_H
#include "generic.h"
#include "random.h"
typedef vl_int32 vl_ikm_acc ; /**< IKM accumulator data type */
/** ------------------------------------------------------------------
** @brief IKM algorithms
**/
enum VlIKMAlgorithms {
VL_IKM_LLOYD, /**< Lloyd algorithm */
VL_IKM_ELKAN /**< Elkan algorithm */
} ;
/** ------------------------------------------------------------------
** @brief IKM quantizer
**/
typedef struct _VlIKMFilt
{
int M ; /**< data dimensionality */
int K ; /**< number of centers */
int method ; /**< Learning method */
int max_niters ; /**< Lloyd: maximum number of iterations */
int verb ; /**< verbosity level */
vl_ikm_acc *centers ; /**< centers */
vl_ikm_acc *inter_dist ; /**< centers inter-distances */
} VlIKMFilt ;
/** @name Create and destroy
** @{
**/
VL_EXPORT VlIKMFilt *vl_ikm_new (int method) ;
VL_EXPORT void vl_ikm_delete (VlIKMFilt *f) ;
/** @} */
/** @name Process data
** @{
**/
VL_EXPORT void vl_ikm_init (VlIKMFilt *f, vl_ikm_acc const *centers, int M, int K) ;
VL_EXPORT void vl_ikm_init_rand (VlIKMFilt *f, int M, int K) ;
VL_EXPORT void vl_ikm_init_rand_data (VlIKMFilt *f, vl_uint8 const *data, int M, int N, int K) ;
VL_EXPORT int vl_ikm_train (VlIKMFilt *f, vl_uint8 const *data, int N) ;
VL_EXPORT void vl_ikm_push (VlIKMFilt *f, vl_uint *asgn, vl_uint8 const *data, int N) ;
VL_EXPORT
vl_uint vl_ikm_push_one (vl_ikm_acc const *centers,
vl_uint8 const *data,
int M, int K) ;
/** @} */
/** @name Retrieve data and parameters
** @{
**/
VL_INLINE int vl_ikm_get_ndims (VlIKMFilt const *f) ;
VL_INLINE int vl_ikm_get_K (VlIKMFilt const *f) ;
VL_INLINE int vl_ikm_get_verbosity (VlIKMFilt const *f) ;
VL_INLINE int vl_ikm_get_max_niters (VlIKMFilt const *f) ;
VL_INLINE vl_ikm_acc const * vl_ikm_get_centers (VlIKMFilt const *f) ;
/** @} */
/** @name Set parameters
** @{
**/
VL_INLINE void vl_ikm_set_verbosity (VlIKMFilt *f, int verb) ;
VL_INLINE void vl_ikm_set_max_niters (VlIKMFilt *f, int max_niters) ;
/** @} */
/** ------------------------------------------------------------------
** @brief Get data dimensionality
** @param f IKM filter.
** @return data dimensionality.
**/
VL_INLINE int
vl_ikm_get_ndims (VlIKMFilt const* f)
{
return f-> M ;
}
/** ------------------------------------------------------------------
** @brief Get the number of centers K
** @param f IKM filter.
** @return number of centers K.
**/
VL_INLINE int
vl_ikm_get_K (VlIKMFilt const* f)
{
return f-> K ;
}
/** ------------------------------------------------------------------
** @brief Get verbosity level
** @param f IKM filter.
** @return verbosity level.
**/
VL_INLINE int
vl_ikm_get_verbosity (VlIKMFilt const* f)
{
return f-> verb ;
}
/** ------------------------------------------------------------------
** @brief Get maximum number of iterations
** @param f IKM filter.
** @return maximum number of iterations.
**/
VL_INLINE int
vl_ikm_get_max_niters (VlIKMFilt const* f)
{
return f-> max_niters ;
}
/** ------------------------------------------------------------------
** @brief Get maximum number of iterations
** @param f IKM filter.
** @return maximum number of iterations.
**/
VL_INLINE vl_ikm_acc const *
vl_ikm_get_centers (VlIKMFilt const* f)
{
return f-> centers ;
}
/** ------------------------------------------------------------------
** @brief Set verbosity level
** @param f IKM filter.
** @param verb verbosity level.
**/
VL_INLINE void
vl_ikm_set_verbosity (VlIKMFilt *f, int verb)
{
f-> verb = VL_MAX(0,verb) ;
}
/** ------------------------------------------------------------------
** @brief Set maximum number of iterations
** @param f IKM filter.
** @param max_niters maximum number of iterations.
**/
VL_INLINE void
vl_ikm_set_max_niters (VlIKMFilt *f, int max_niters)
{
f-> max_niters = max_niters ;
}
/* VL_IKMEANS_H */
#endif
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smobiler.Core;
using Smobiler.Core.Controls;
using SMOWMS.CommLib;
using SMOWMS.DTOs.Enum;
using SMOWMS.DTOs.InputDTO;
using SMOWMS.UI.AssetsManager;
namespace SMOWMS.UI.Layout
{
////ToolboxItem用于控制是否添加自定义控件到工具箱,true添加,false不添加
//[System.ComponentModel.ToolboxItem(true)]
partial class frmAssInventoryLayout : Smobiler.Core.Controls.MobileUserControl
{
private AutofacConfig _autofacConfig = new AutofacConfig();//调用配置类
/// <summary>
/// 编辑盘点单
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnEdit_Press(object sender, EventArgs e)
{
try
{
frmAssInventoryEdit edit = new frmAssInventoryEdit {IID = lblName.BindDataValue.ToString() };
Form.Show(edit, (MobileForm sender1, object args) =>
{
if (edit.ShowResult == ShowResult.Yes)
{
((frmAssInventory)Form).Bind();
}
}
);
}
catch (Exception ex)
{
Toast(ex.Message);
}
}
/// <summary>
/// 删除盘点单
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnDelete_Press(object sender, EventArgs e)
{
try
{
MessageBox.Show("你确定要该盘点单吗?", "系统提醒", MessageBoxButtons.OKCancel, (object sender1, MessageBoxHandlerArgs args) =>
{
try
{
if (args.Result == ShowResult.OK) //删除该盘点单
{
ReturnInfo rInfo = _autofacConfig.AssInventoryService.DeleteInventory(lblName.BindDataValue.ToString());
if (rInfo.IsSuccess)
{
Toast("删除盘点单成功.");
((frmAssInventory)Form).Bind();
}
else
{
throw new Exception(rInfo.ErrorInfo);
}
}
}
catch (Exception ex)
{
Form.Toast(ex.Message);
}
});
}
catch (Exception ex)
{
Toast(ex.Message);
}
}
/// <summary>
/// 开始盘点
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnStart_Press(object sender, EventArgs e)
{
try
{
AddAIResultInputDto inputDto = new AddAIResultInputDto {IID = lblName.BindDataValue.ToString()};
var inventory=_autofacConfig.AssInventoryService.GetAssInventoryById(lblName.BindDataValue.ToString());
ReturnInfo returnInfo = _autofacConfig.AssInventoryService.AddAssInventoryResult(inputDto);
if (returnInfo.IsSuccess)
{
frmAssInventory assets = (frmAssInventory)Form;
assets.Bind();
frmAssInventoryResult result = new frmAssInventoryResult {IID = lblName.BindDataValue.ToString(), WAREID = inventory.WAREID,DepartmentId = inventory.SLID,typeId = inventory.TYPEID};
assets.Show(result, (MobileForm sender1, object args) =>
{
if (result.ShowResult == ShowResult.Yes|| result.ShowResult == ShowResult.None)
{
assets.Bind();
}
});
}
else
{
Toast(returnInfo.ErrorInfo);
}
}
catch (Exception ex)
{
Toast(ex.Message);
}
}
/// <summary>
/// 点击,查看盘点单详情
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void panel1_Press(object sender, EventArgs e)
{
try
{
var inventory = _autofacConfig.AssInventoryService.GetAssInventoryById(lblName.BindDataValue.ToString());
frmAssInventoryResult result = new frmAssInventoryResult { IID = lblName.BindDataValue.ToString(), WAREID = inventory.WAREID, DepartmentId = inventory.SLID, typeId = inventory.TYPEID};
frmAssInventory frmAssInventory = (frmAssInventory)Form;
frmAssInventory.Show(result, (MobileForm sender1, object args) =>
{
if (result.ShowResult == ShowResult.Yes|| result.ShowResult == ShowResult.None)
{
frmAssInventory.Bind();
}
});
}
catch (Exception ex)
{
Toast(ex.Message);
}
}
/// <summary>
/// 编辑盘点单
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ibEdit_Press(object sender, EventArgs e)
{
try
{
frmAssInventoryEdit edit = new frmAssInventoryEdit { IID = lblName.BindDataValue.ToString() };
Form.Show(edit, (MobileForm sender1, object args) =>
{
if (edit.ShowResult == ShowResult.Yes)
{
((frmAssInventory)Form).Bind();
}
}
);
}
catch (Exception ex)
{
Toast(ex.Message);
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
{ foo:bar }
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2006 - 2016
* Stefan Balev <stefan.balev@graphstream-project.org>
* Julien Baudry <julien.baudry@graphstream-project.org>
* Antoine Dutot <antoine.dutot@graphstream-project.org>
* Yoann Pigné <yoann.pigne@graphstream-project.org>
* Guilhelm Savin <guilhelm.savin@graphstream-project.org>
*
* This file is part of GraphStream <http://graphstream-project.org>.
*
* GraphStream is a library whose purpose is to handle static or dynamic
* graph, create them from scratch, file or any source and display them.
*
* This program is free software distributed under the terms of two licenses, the
* CeCILL-C license that fits European law, and the GNU Lesser General Public
* License. You can use, modify and/ or redistribute the software under the terms
* of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following
* URL <http://www.cecill.info> or under the terms of the GNU LGPL 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-C and LGPL licenses and that you accept their terms.
*/
package msi.gama.ext.graphstream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.net.URL;
import java.util.HashSet;
/**
* Reader for the "edge" graph format.
*
* <p>
* The edge graph format is a very simple and lightweight format where each line
* describes an edge by giving two node names. The nodes are created implicitly.
* </p>
*
* <p>
* This reader also understands the derivative format where a line contains a
* first node name, followed by several node names separated by spaces. In this
* case it links the first node with all other node name following on the line.
* </p>
*
* <p>
* Also, the format does not specify any direction for edges. By default all
* edges are undirected. You can choose to make all edges directed by passing
* "true" as the first arguments to constructors
* {@link #FileSourceEdge(boolean)} or {@link #FileSourceEdge(boolean, boolean)}
* . The direction of edges goes from the first node name on each line toward
* the second (or more) node names on each line.
* </p>
*
* <p>
* This format only contains edges. To ensure the "add node" events are sent
* before an edge referencing two nodes is created via an "add edge" event, this
* reader has a hash set of already encountered nodes. The hash set allows to
* issue "add node" events only when a node is encountered for the first time.
* </p>
*
* </p> This hash set consumes memory, but is the only way to ensure "add node"
* events are correctly issued. If this input is directly connected to a graph,
* as graphs can create non-existing nodes automatically, you can disable the
* hash set of nodes using the constructor
* {@link #FileSourceEdge(boolean, boolean)}, and giving "false" for the second
* argument. </p>
*
* The usual file name extension for this format is ".edge".
*/
public class FileSourceEdge extends FileSourceBase {
// Attribute
/**
* Allocator for edge identifiers.
*/
protected int edgeid = 0;
/**
* By default, consider edges as undirected.
*/
protected boolean directed = false;
/**
* Set of existing nodes (if nodes are declared).
*/
protected HashSet<String> nodes;
protected String graphName = "EDGE_";
// Construction
/**
* New reader for the "edge" format.
*/
public FileSourceEdge() {
this(false);
}
/**
* New reader for the "edge" format.
*
* @param edgesAreDirected
* If true (default=false) edges are considered directed.
*/
public FileSourceEdge(boolean edgesAreDirected) {
this(edgesAreDirected, true);
}
/**
* New reader for the "edge" format.
*
* @param edgesAreDirected
* If true (default=false) edges are considered directed.
* @param declareNodes
* If true (default=true) this reader outputs nodeAdded events.
*/
public FileSourceEdge(boolean edgesAreDirected, boolean declareNodes) {
directed = edgesAreDirected;
nodes = declareNodes ? new HashSet<String>() : null;
}
// Commands
@Override
protected void continueParsingInInclude() throws IOException {
// Should not happen, EDGE files cannot be nested.
}
@Override
public boolean nextEvents() throws IOException {
String id1 = getWordOrNumberOrStringOrEolOrEof();
if (id1.equals("EOL")) {
// Empty line.
} else if (id1.equals("EOF")) {
return false;
} else {
declareNode(id1);
String id2 = getWordOrNumberOrStringOrEolOrEof();
while (!id2.equals("EOL")) {
if (!id1.equals(id2)) {
String edgeId = Integer.toString(edgeid++);
declareNode(id2);
sendEdgeAdded(graphName, edgeId, id1, id2, directed);
}
id2 = getWordOrNumberOrStringOrEolOrEof();
}
}
return true;
}
protected void declareNode(String id) {
if (nodes != null) {
if (!nodes.contains(id)) {
sendNodeAdded(graphName, id);
nodes.add(id);
}
}
}
@Override
public void begin(String filename) throws IOException {
super.begin(filename);
init();
}
@Override
public void begin(URL url) throws IOException {
super.begin(url);
init();
}
@Override
public void begin(InputStream stream) throws IOException {
super.begin(stream);
init();
}
@Override
public void begin(Reader reader) throws IOException {
super.begin(reader);
init();
}
protected void init() throws IOException {
st.eolIsSignificant(true);
st.commentChar('#');
graphName = String.format("%s_%d", graphName,
System.currentTimeMillis() + ((long) Math.random() * 10));
}
public boolean nextStep() throws IOException {
return nextEvents();
}
@Override
public void end() throws IOException {
super.end();
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8" ?>
<!--
eXist-db Open Source Native XML Database
Copyright (C) 2001 The eXist-db Authors
info@exist-db.org
http://www.exist-db.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-->
<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Container class="javax.swing.JPopupMenu" name="pmUsers">
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="miNewUser">
<Properties>
<Property name="text" type="java.lang.String" value="New User..."/>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="New User"/>
</AccessibilityProperties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="miNewUserActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="miEditUser">
<Properties>
<Property name="text" type="java.lang.String" value="Edit User..."/>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Edit User"/>
</AccessibilityProperties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="miEditUserActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="miRemoveUser">
<Properties>
<Property name="text" type="java.lang.String" value="Remove User"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="miRemoveUserActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Container>
<Container class="javax.swing.JPopupMenu" name="pmGroups">
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="miNewGroup">
<Properties>
<Property name="text" type="java.lang.String" value="New Group..."/>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="New Group"/>
</AccessibilityProperties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="miNewGroupActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="miEditGroup">
<Properties>
<Property name="text" type="java.lang.String" value="Edit Group..."/>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Edit Group"/>
</AccessibilityProperties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="miEditGroupActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="miRemoveGroup">
<Properties>
<Property name="text" type="java.lang.String" value="Remove Group"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="miRemoveGroupActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Container>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="title" type="java.lang.String" value="User Manager"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="250" max="32767" attributes="0"/>
<Component id="btnClose" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnCreate" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jSeparator1" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="tpUserManager" alignment="0" pref="439" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="291" max="32767" attributes="0"/>
<Component id="jSeparator1" min="-2" pref="10" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="btnCreate" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="btnClose" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="tpUserManager" min="-2" pref="291" max="-2" attributes="0"/>
<EmptySpace min="0" pref="51" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JTabbedPane" name="tpUserManager">
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Users"/>
</AccessibilityProperties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="spUsers">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Users">
<Property name="tabTitle" type="java.lang.String" value="Users"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="tblUsers">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="getUsersTableModel()" type="code"/>
</Property>
<Property name="autoCreateRowSorter" type="boolean" value="true"/>
<Property name="componentPopupMenu" type="javax.swing.JPopupMenu" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="pmUsers"/>
</Property>
<Property name="showGrid" type="boolean" value="true"/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tblUsersMouseClicked"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JScrollPane" name="spGroups">
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Groups"/>
</AccessibilityProperties>
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Groups">
<Property name="tabTitle" type="java.lang.String" value="Groups"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="tblGroups">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="getGroupsTableModel()" type="code"/>
</Property>
<Property name="autoCreateRowSorter" type="boolean" value="true"/>
<Property name="componentPopupMenu" type="javax.swing.JPopupMenu" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="pmGroups"/>
</Property>
<Property name="showGrid" type="boolean" value="true"/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tblGroupsMouseClicked"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Component class="javax.swing.JSeparator" name="jSeparator1">
</Component>
<Component class="javax.swing.JButton" name="btnCreate">
<Properties>
<Property name="text" type="java.lang.String" value="Create"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCreateActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnClose">
<Properties>
<Property name="text" type="java.lang.String" value="Close"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCloseActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
|
{
"pile_set_name": "Github"
}
|
// (C) Copyright Edward Diener 2011-2015
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
#if !defined(BOOST_VMD_DETAIL_IDENTIFIER_CONCAT_HPP)
#define BOOST_VMD_DETAIL_IDENTIFIER_CONCAT_HPP
#include <boost/preprocessor/cat.hpp>
#include <boost/vmd/detail/idprefix.hpp>
#define BOOST_VMD_DETAIL_IDENTIFIER_CONCATENATE(vseq) \
BOOST_PP_CAT \
( \
BOOST_VMD_DETAIL_IDENTIFIER_REGISTRATION_PREFIX, \
vseq \
) \
/**/
#endif /* BOOST_VMD_DETAIL_IDENTIFIER_CONCAT_HPP */
|
{
"pile_set_name": "Github"
}
|
// For Komodo 6
if (ko.views.manager.currentView &&
ko.views.manager.currentView.scimoz) {
// Set the number of completions shown in the list.
ko.views.manager.currentView.scimoz.autoCMaxHeight = 10;
}
// For Komodo 7
if (ko.prefs) {
ko.prefs.setLongPref("codeintel_autocomplete_max_rows", 10);
}
|
{
"pile_set_name": "Github"
}
|
/*
* Union to access IEEE float memory representation.
*/
#if !defined(DUK_FLTUNION_H_INCLUDED)
#define DUK_FLTUNION_H_INCLUDED
#include "duk_internal.h"
union duk_float_union {
float f;
duk_uint32_t ui[1];
duk_uint16_t us[2];
duk_uint8_t uc[4];
};
typedef union duk_float_union duk_float_union;
#if defined(DUK_USE_DOUBLE_LE) || defined(DUK_USE_DOUBLE_ME)
#define DUK_FLT_IDX_UI0 0
#define DUK_FLT_IDX_US0 1
#define DUK_FLT_IDX_US1 0
#define DUK_FLT_IDX_UC0 3
#define DUK_FLT_IDX_UC1 2
#define DUK_FLT_IDX_UC2 1
#define DUK_FLT_IDX_UC3 0
#elif defined(DUK_USE_DOUBLE_BE)
#define DUK_FLT_IDX_UI0 0
#define DUK_FLT_IDX_US0 0
#define DUK_FLT_IDX_US1 1
#define DUK_FLT_IDX_UC0 0
#define DUK_FLT_IDX_UC1 1
#define DUK_FLT_IDX_UC2 2
#define DUK_FLT_IDX_UC3 3
#else
#error internal error
#endif
#endif /* DUK_FLTUNION_H_INCLUDED */
|
{
"pile_set_name": "Github"
}
|
This directory contains scripts that will run on the target.
The target uses the Ash shell so no bashisms can live in here,
the scripts should be self contained and use only resources
available on the target.
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2015, Michael Mitterer (office@mikemitterer.at),
* IT-Consulting and Development Limited.
*
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
library mdldialog;
import 'dart:html' as dom;
import 'dart:async';
import 'package:intl/intl.dart';
import 'package:intl/date_symbol_data_local.dart';
import 'package:logging/logging.dart';
import 'package:mustache/mustache.dart';
import 'package:validate/validate.dart';
import 'package:dryice/dryice.dart' as di;
import 'package:mdl/mdlcore.dart';
import 'package:mdl/mdlcomponents.dart';
import 'package:mdl/mdlapplication.dart';
import 'package:mdl/mdltemplate.dart';
import 'package:mdl/mdlanimation.dart';
part "src/dialog/MaterialDialog.dart";
part "src/dialog/MaterialAlertDialog.dart";
part "src/dialog/MaterialConfirmDialog.dart";
part "src/dialog/MaterialSnackbar.dart";
part "src/dialog/MaterialNotification.dart";
part "src/dialog/MaterialDatePicker.dart";
part "src/dialog/MaterialTimePicker.dart";
part "src/dialog/components/MaterialDialogComponent.dart";
void registerMdlDialogComponents() {
_registerMaterialDialogComponent();
}
|
{
"pile_set_name": "Github"
}
|
/******************************************************************
*
* Copyright 2014 Samsung Electronics All Rights Reserved.
*
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************/
#include <jni.h>
#include <stdio.h>
#include <android/log.h>
#include "caleutils.h"
#include "logger.h"
#include "oic_malloc.h"
#include "cathreadpool.h"
#include "uarraylist.h"
#include "caadapterutils.h"
#define TAG PCF("CA_LE_UTILS")
#define METHODID_OBJECTNONPARAM "()Landroid/bluetooth/BluetoothAdapter;"
#define METHODID_STRINGNONPARAM "()Ljava/lang/String;"
#define CLASSPATH_BT_ADPATER "android/bluetooth/BluetoothAdapter"
jobject CALEGetUuidFromString(JNIEnv *env, const char* uuid)
{
VERIFY_NON_NULL_RET(uuid, TAG, "uuid is null", NULL);
VERIFY_NON_NULL_RET(env, TAG, "env is null", NULL);
OIC_LOG(DEBUG, TAG, "CALEGetUuidFromString");
jclass jni_cid_UUID = (*env)->FindClass(env, "java/util/UUID");
if (!jni_cid_UUID)
{
OIC_LOG(ERROR, TAG, "jni_cid_UUID is not available");
return NULL;
}
jmethodID jni_mid_fromString = (*env)->GetStaticMethodID(env, jni_cid_UUID, "fromString",
"(Ljava/lang/String;)"
"Ljava/util/UUID;");
if (!jni_mid_fromString)
{
OIC_LOG(ERROR, TAG, "jni_mid_fromString is not available");
return NULL;
}
jstring str_uuid = (*env)->NewStringUTF(env, uuid);
if (!str_uuid)
{
OIC_LOG(ERROR, TAG, "str_uuid is not available");
return NULL;
}
jobject jni_obj_uuid = (*env)->CallStaticObjectMethod(env, jni_cid_UUID, jni_mid_fromString,
str_uuid);
if (!jni_obj_uuid)
{
OIC_LOG(ERROR, TAG, "Fail to get jni uuid object");
return NULL;
}
return jni_obj_uuid;
}
jobject CALEGetParcelUuid(JNIEnv *env, jobject uuid)
{
OIC_LOG(DEBUG, TAG, "CALEGetParcelUuid");
VERIFY_NON_NULL_RET(env, TAG, "env is null", NULL);
VERIFY_NON_NULL_RET(uuid, TAG, "uuid is null", NULL);
jclass jni_cid_ParcelUuid = (*env)->FindClass(env, "android/os/ParcelUuid");
if (!jni_cid_ParcelUuid)
{
OIC_LOG(ERROR, TAG, "jni_cid_ParcelUuid is not available");
return NULL;
}
jmethodID jni_mid_ParcelUuid = (*env)->GetMethodID(env, jni_cid_ParcelUuid, "<init>",
"(Ljava/util/UUID;)V");
if (!jni_mid_ParcelUuid)
{
OIC_LOG(ERROR, TAG, "jni_mid_ParcelUuid is not available");
return NULL;
}
jobject jni_ParcelUuid = (*env)->NewObject(env, jni_cid_ParcelUuid, jni_mid_ParcelUuid, uuid);
if (!jni_ParcelUuid)
{
OIC_LOG(ERROR, TAG, "Fail to get jni ParcelUuid");
return NULL;
}
return jni_ParcelUuid;
}
bool CALEIsBondedDevice(JNIEnv *env, jobject bluetoothDevice)
{
VERIFY_NON_NULL_RET(env, TAG, "env is null", false);
VERIFY_NON_NULL_RET(bluetoothDevice, TAG, "bluetoothDevice is null", false);
jclass jni_cid_device_list = (*env)->FindClass(env, "android/bluetooth/BluetoothDevice");
if (!jni_cid_device_list)
{
OIC_LOG(ERROR, TAG, "jni_cid_device_list is null");
return false;
}
jmethodID jni_mid_getBondState = (*env)->GetMethodID(env, jni_cid_device_list, "getBondState",
"()I");
if (!jni_mid_getBondState)
{
OIC_LOG(ERROR, TAG, "jni_mid_getBondState is null");
return false;
}
jint jni_bondState = (jint)(*env)->CallIntMethod(env, bluetoothDevice, jni_mid_getBondState);
OIC_LOG_V(DEBUG, TAG, "bond state is %d", jni_bondState);
if (BOND_BONDED == jni_bondState)
{
OIC_LOG(DEBUG, TAG, "remote device is bonded");
return true;
}
else
{
OIC_LOG(DEBUG, TAG, "remote device is not bonded");
return false;
}
return false;
}
jobjectArray CALEGetBondedDevices(JNIEnv *env)
{
VERIFY_NON_NULL_RET(env, TAG, "env is null", NULL);
jclass jni_cid_BTAdapter = (*env)->FindClass(env, CLASSPATH_BT_ADPATER);
if (!jni_cid_BTAdapter)
{
OIC_LOG(ERROR, TAG, "getBondedDevices: jni_cid_BTAdapter is null");
return NULL;
}
jmethodID jni_mid_getDefaultAdapter = (*env)->GetStaticMethodID(env, jni_cid_BTAdapter,
"getDefaultAdapter",
METHODID_OBJECTNONPARAM);
jobject jni_obj_BTAdapter = (*env)->CallStaticObjectMethod(env, jni_cid_BTAdapter,
jni_mid_getDefaultAdapter);
if (!jni_obj_BTAdapter)
{
OIC_LOG(ERROR, TAG, "getBondedDevices: bluetooth adapter is null");
return NULL;
}
// Get a list of currently paired devices
jmethodID jni_mid_getBondedDevices = (*env)->GetMethodID(env, jni_cid_BTAdapter,
"getBondedDevices",
"()Ljava/util/Set;");
if (!jni_mid_getBondedDevices)
{
OIC_LOG(ERROR, TAG, "getBondedDevices: jni_mid_getBondedDevicesr is null");
return NULL;
}
jobject jni_obj_setPairedDevices = (*env)->CallObjectMethod(env, jni_obj_BTAdapter,
jni_mid_getBondedDevices);
if (!jni_obj_setPairedDevices)
{
OIC_LOG(ERROR, TAG, "getBondedDevices: jni_obj_setPairedDevices is null");
return NULL;
}
jclass jni_cid_Set = (*env)->FindClass(env, "java/util/Set");
if (!jni_cid_Set)
{
OIC_LOG(ERROR, TAG, "getBondedDevices : jni_cid_Set is null");
return NULL;
}
jmethodID jni_mid_toArray = (*env)->GetMethodID(env, jni_cid_Set, "toArray",
"()[Ljava/lang/Object;");
if (!jni_mid_toArray)
{
OIC_LOG(ERROR, TAG, "getBondedDevices: jni_mid_toArray is null");
return NULL;
}
jobjectArray jni_arrayPairedDevices = (jobjectArray)(
(*env)->CallObjectMethod(env, jni_obj_setPairedDevices, jni_mid_toArray));
if (!jni_arrayPairedDevices)
{
OIC_LOG(ERROR, TAG, "getBondedDevices: jni_arrayPairedDevices is null");
return NULL;
}
return jni_arrayPairedDevices;
}
jint CALEGetBTStateOnInfo(JNIEnv *env)
{
VERIFY_NON_NULL_RET(env, TAG, "env is null", -1);
jclass jni_cid_BTAdapter = (*env)->FindClass(env, CLASSPATH_BT_ADPATER);
if (!jni_cid_BTAdapter)
{
OIC_LOG(ERROR, TAG, "getBTStateOnInfo: jni_cid_BTAdapter is null");
return -1;
}
jfieldID jni_fid_stateon = (*env)->GetStaticFieldID(env, jni_cid_BTAdapter, "STATE_ON", "I");
if (!jni_fid_stateon)
{
OIC_LOG(ERROR, TAG, "get_field_state is not available");
return -1;
}
jint jni_int_val = (*env)->GetStaticIntField(env, jni_cid_BTAdapter, jni_fid_stateon);
OIC_LOG_V(DEBUG, TAG, "bluetooth.STATE_ON state integer value : %d", jni_int_val);
return jni_int_val;
}
CAResult_t CALECheckPlatformVersion(JNIEnv *env, uint16_t level)
{
jint jni_int_sdk = CALEGetBuildVersion(env);
if (jni_int_sdk < level)
{
OIC_LOG(ERROR, TAG, "it is not supported");
return CA_NOT_SUPPORTED;
}
return CA_STATUS_OK;
}
jint CALEGetBuildVersion(JNIEnv *env)
{
VERIFY_NON_NULL_RET(env, TAG, "env is null", -1);
// VERSION is a nested class within android.os.Build (hence "$" rather than "/")
jclass jni_cls_version = (*env)->FindClass(env, "android/os/Build$VERSION");
if (!jni_cls_version)
{
OIC_LOG(ERROR, TAG, "jni_cls_version is null");
return -1;
}
jfieldID jni_fid_sdk = (*env)->GetStaticFieldID(env, jni_cls_version, "SDK_INT", "I");
if (!jni_fid_sdk)
{
OIC_LOG(ERROR, TAG, "jni_fid_sdk is null");
return -1;
}
jint jni_int_sdk = (*env)->GetStaticIntField(env, jni_cls_version, jni_fid_sdk);
OIC_LOG_V(DEBUG, TAG, "sdk version is %d", jni_int_sdk);
return jni_int_sdk;
}
jint CALEGetBuildVersionCodeForName(JNIEnv *env, const char* versionName)
{
VERIFY_NON_NULL_RET(env, TAG, "env is null", -1);
VERIFY_NON_NULL_RET(versionName, TAG, "versionName is null", -1);
// VERSION is a nested class within android.os.Build (hence "$" rather than "/")
jclass jni_cls_version = (*env)->FindClass(env, "android/os/Build$VERSION_CODES");
if (!jni_cls_version)
{
OIC_LOG(ERROR, TAG, "jni_cls_version is null");
return -1;
}
jfieldID jni_fid_version = (*env)->GetStaticFieldID(env, jni_cls_version, versionName, "I");
if (!jni_fid_version)
{
OIC_LOG(ERROR, TAG, "jni_fid_version is null");
return -1;
}
jint jni_int_version = (*env)->GetStaticIntField(env, jni_cls_version, jni_fid_version);
OIC_LOG_V(DEBUG, TAG, "version [%s] is %d",versionName, jni_int_version);
return jni_int_version;
}
jboolean CALEIsEnableBTAdapter(JNIEnv *env)
{
VERIFY_NON_NULL_RET(env, TAG, "env is null", JNI_FALSE);
jclass jni_cid_BTAdapter = (*env)->FindClass(env, CLASSPATH_BT_ADPATER);
if (!jni_cid_BTAdapter)
{
OIC_LOG(ERROR, TAG, "jni_cid_BTAdapter: jni_cid_BTAdapter is null");
return JNI_FALSE;
}
jmethodID jni_mid_getDefaultAdapter = (*env)->GetStaticMethodID(env, jni_cid_BTAdapter,
"getDefaultAdapter",
METHODID_OBJECTNONPARAM);
if (!jni_mid_getDefaultAdapter)
{
OIC_LOG(ERROR, TAG, "jni_mid_getDefaultAdapter is null");
return JNI_FALSE;
}
jobject jni_obj_BTAdapter = (*env)->CallStaticObjectMethod(env, jni_cid_BTAdapter,
jni_mid_getDefaultAdapter);
if (!jni_obj_BTAdapter)
{
OIC_LOG(ERROR, TAG, "jni_obj_BTAdapter is null");
return JNI_FALSE;
}
// isEnable()
jmethodID jni_mid_isEnable = (*env)->GetMethodID(env, jni_cid_BTAdapter, "isEnabled", "()Z");
if (!jni_mid_isEnable)
{
OIC_LOG(ERROR, TAG, "jni_mid_isEnable is null");
return JNI_FALSE;
}
jboolean jni_isEnable = (*env)->CallBooleanMethod(env, jni_obj_BTAdapter, jni_mid_isEnable);
OIC_LOG_V(DEBUG, TAG, "adapter state is %d", jni_isEnable);
return jni_isEnable;
}
jstring CALEGetAddressFromBTDevice(JNIEnv *env, jobject bluetoothDevice)
{
OIC_LOG(DEBUG, TAG, "IN - CALEGetAddressFromBTDevice");
VERIFY_NON_NULL_RET(env, TAG, "env is null", NULL);
VERIFY_NON_NULL_RET(bluetoothDevice, TAG, "bluetoothDevice is null", NULL);
jclass jni_cid_device_list = (*env)->FindClass(env, "android/bluetooth/BluetoothDevice");
if (!jni_cid_device_list)
{
OIC_LOG(ERROR, TAG, "jni_cid_device_list is null");
return NULL;
}
jmethodID jni_mid_getAddress = (*env)->GetMethodID(env, jni_cid_device_list, "getAddress",
"()Ljava/lang/String;");
if (!jni_mid_getAddress)
{
OIC_LOG(ERROR, TAG, "jni_mid_getAddress is null");
return NULL;
}
jstring jni_address = (jstring)(*env)->CallObjectMethod(env, bluetoothDevice,
jni_mid_getAddress);
if (!jni_address)
{
OIC_LOG(ERROR, TAG, "jni_address is null");
return NULL;
}
OIC_LOG(DEBUG, TAG, "OUT - CALEGetAddressFromBTDevice");
return jni_address;
}
|
{
"pile_set_name": "Github"
}
|
### 小故事 大道理 说透人生(图)
------------------------
#### [首页](https://github.com/gfw-breaker/banned-news/blob/master/README.md) | [手把手翻墙教程](https://github.com/gfw-breaker/guides/wiki) | [禁闻聚合安卓版](https://github.com/gfw-breaker/bn-android) | [网门安卓版](https://github.com/oGate2/oGate) | [神州正道安卓版](https://github.com/SzzdOgate/update)
<div class="article_right" style="fone-color:#000">
<p style="text-align:center">
<img alt="小故事 ,大道理 ,说透人生。" src="http://img2.secretchina.com/pic/2019/11-15/p2563212a283180905-ss.jpg"/>
<br>
小故事,大启示,说透人生。(图片来源:Adobe Stock)
<span id="hideid" name="hideid" style="color:red;display:none;">
<span href="https://www.secretchina.com">
</span>
</span>
</br>
</p>
<div id="txt-mid1-t21-2017">
<ins class="adsbygoogle" data-ad-client="ca-pub-1276641434651360" data-ad-slot="2451032099" style="display:inline-block;width:336px;height:280px">
</ins>
<div id="SC-22xxx">
</div>
</div>
<p>
<strong>
01
</strong>
<span id="hideid" name="hideid" style="color:red;display:none;">
<span href="https://www.secretchina.com">
</span>
</span>
</p>
<p>
一个卖瓷碗的老人挑着扁担在路上走着,突然一个瓷碗掉到地上、摔碎了,老人继续向前走,头也不回。
</p>
<p>
路人看到很奇怪,便问:为什么你的碗摔碎了你却不看一下呢?老人答道:我再怎么回头看,碗也是碎的。还耽误了赶路!
</p>
<p>
启示:失去东西时,要学着接受,学着放下。很多事不会因为你的悲伤就会被改变的。
</p>
<p>
<strong>
02
</strong>
</p>
<p>
鹦鹉遇到乌鸦,笼中的鹦鹉安逸,野外的乌鸦自由。鹦鹉羡慕乌鸦自由,乌鸦羡慕鹦鹉安逸。二只鸟便商议互换。
</p>
<p>
乌鸦得到安逸,但难得主人欢喜,最后抑郁而死;鹦鹉得到自由,但长期安逸,不能独立生存,最终饥饿而死。
</p>
<p>
启示:不要盲目羡慕他人,人家的幸福也许不适合你。不去攀比,过好自己的日子,享受自己的生活才是王道。
</p>
<p>
<strong>
03
</strong>
</p>
<p>
老师问:有个人要烧壶开水,生火到一半时发现柴不够,他该怎么办?有的同学说赶快去找,有的说去借、去买。
</p>
<p>
老师说:为什么不把壶里的水倒掉一些呢?同学顿悟……
</p>
<p>
启示:世事不能万般如意,有舍才有得。人的精力总会有限,不如“倒掉一些水”,只专注在喜欢的人和事吧。
</p>
<p>
<strong>
04
</strong>
</p>
<p>
猫和猪是好朋友。一天猫掉进大坑,猪拿来绳子,猫叫猪把绳子扔下来,结果它整捆扔了下去。
</p>
<p>
猫很郁闷的说:这样扔下来,怎么拉我上去?猪说:不然怎么做?猫说:你应该拉住一头绳子啊!
</p>
<p>
猪就跳下去,拿了绳子的一头,说:现在可以了!
</p>
<p>
猫哭了,哭得很幸福......
</p>
<p>
启示:有的人不是很聪明,却值得你终生拥有。
</p>
<p style="text-align: center;">
<img alt="有的人不是很聪明,却值得你终生拥有。" src="//img3.secretchina.com/pic/2019/12-30/p2593283a64903979-ss.jpg"/>
<br>
有的人不是很聪明,却值得你终生拥有。(图片来源:Adobe Stock)
</br>
</p>
<center>
<div style="max-width: 632px;height:180px; display: none; text-align: center; margin: 0 auto; overflow: hidden;overflow-x: hidden;">
<div id="taboola-midarticle-thumbnails" style="max-width: 632px;height:180px;overflow: hidden;overflow-x: hidden;">
</div>
</div>
<div>
<ins class="adsbygoogle" data-ad-client="ca-pub-1276641434651360" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="5164544770" style="display:block; text-align:center;">
</ins>
</div>
</center>
<p>
<strong>
05
</strong>
</p>
<p>
老和尚问小和尚:如果你前进一步是死,后退一步则亡,你该怎么办?
</p>
<p>
小和尚毫不犹豫地说:我往旁边去。
</p>
<p>
启示:人生路上遭遇
<span href="https://www.secretchina.com/news/gb/tag/进退" target="_blank">
进退
</span>
两难的境况时,换个角度思考:路的旁边,还是路。天无绝人之路。
</p>
<p>
<strong>
06
</strong>
</p>
<p>
第一天,小白兔去钓鱼,一无所获。第二天,它又去钓鱼,还是如此。第三天它刚到,一条大鱼从河里跳出来,大叫:“你要是再敢用胡萝卜当鱼饵,我就扁死你。”
</p>
<center>
<ins class="adsbygoogle" data-ad-client="ca-pub-1276641434651360" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="3646767294" style="display:block; text-align:center;">
</ins>
</center>
<p>
启示:你给的都是你自己“想”给的,而不是对方想要的。站在自己所需的角度上给予,只会让对方厌烦。
</p>
<p>
<strong>
07
</strong>
</p>
<p>
穷人问高僧:我为什么这样穷?
</p>
<p>
高僧说:你没有学会给予别人。
</p>
<p>
穷人:我一无所有如何给予?
</p>
<p>
高僧:可以给予别人七种东西。颜施:微笑处事;言施:说赞美安慰的话;心施:敞开心扉对人和蔼;眼施:善意的眼光给予别人;身施:以行动帮助别人;座施:即谦让座位;房施:有容人之心。
</p>
<p>
启示:舍得舍得,有舍有得,给予别人,你就会
<span href="https://www.secretchina.com/news/gb/tag/收获" target="_blank">
收获
</span>
意想不到的财富和快乐。
</p>
<p>
<strong>
08
</strong>
</p>
<p>
有人问农夫:种了麦子了吗?农夫:没,我担心天不下雨。
</p>
<p>
那人又问:那你种棉花没?农夫:没,我担心虫子吃了棉花。
</p>
<p>
那人再问:那你种了什么?农夫:什么也没种,我要确保安全。
</p>
<p>
启示:顾虑太多,思虑太多,反而一事无成。
<center>
<div>
<div id="txt-mid2-t22-2017" style="display: block; max-height: 351px; overflow: hidden;">
<div id="SC-21xxx">
</div>
<ins class="adsbygoogle" data-ad-client="ca-pub-1276641434651360" data-ad-format="auto" data-ad-slot="4301710469" data-full-width-responsive="true" style="display:block">
</ins>
</div>
</div>
</center>
<div style="padding-top:5px;">
</div>
</p>
</div>
<hr/>
手机上长按并复制下列链接或二维码分享本文章:<br/>
https://github.com/gfw-breaker/banned-news/blob/master/pages/p8/918999.md <br/>
<a href='https://github.com/gfw-breaker/banned-news/blob/master/pages/p8/918999.md'><img src='https://github.com/gfw-breaker/banned-news/blob/master/pages/p8/918999.md.png'/></a> <br/>
原文地址(需翻墙访问):https://www.secretchina.com/news/gb/2020/01/09/918999.html
------------------------
#### [首页](https://github.com/gfw-breaker/banned-news/blob/master/README.md) | [一键翻墙软件](https://github.com/gfw-breaker/nogfw/blob/master/README.md) | [《九评共产党》](https://github.com/gfw-breaker/9ping.md/blob/master/README.md#九评之一评共产党是什么) | [《解体党文化》](https://github.com/gfw-breaker/jtdwh.md/blob/master/README.md) | [《共产主义的终极目的》](https://github.com/gfw-breaker/gczydzjmd.md/blob/master/README.md)
<img src='http://gfw-breaker.win/banned-news/pages/p8/918999.md' width='0px' height='0px'/>
|
{
"pile_set_name": "Github"
}
|
Truck 0.00 0 -1.637672127285276 590.09 161.18 617.52 190.88 3.134235066789646 2.639767911331384 11.511453229401017 -0.69 1.80 76.16 -1.6467317533649375 0.92465276
Car 0.00 0 2.338599101701055 45.06 202.08 117.75 233.86 1.3921282741992187 1.5875245884717846 3.483428346119919 -26.64 2.95 36.43 1.7071963212290409 0.99929535
Car 0.00 1 -2.557626978554998 927.95 174.61 996.08 198.34 1.5572205785481643 1.6886907213093185 4.384424286089935 21.80 1.55 44.84 -2.105101982265644 0.82235724
DontCare -1 -1 -1.7555997977640967 400.24 181.83 429.64 198.30 1.546271741744728 1.6451684746616924 4.083742173515358 -1000 -1000 -1000 -0.9702016343666484 0.9960375
DontCare -1 -1 -1.5829545064505677 254.69 185.71 295.74 201.53 1.5721423666743946 1.6490328249247217 3.818148961417475 -1000 -1000 -1000 -0.7975563430531194 0.9990766
DontCare -1 -1 1.432099730768476 490.15 170.83 518.26 189.24 1.4506351504294586 1.6344915966228986 4.005098687611618 -1000 -1000 -1000 2.2174978941659242 0.83255285
DontCare -1 -1 -1.594725170233522 561.31 170.18 581.66 189.88 1.5298217370925855 1.674448591908946 4.207145737610855 -1000 -1000 -1000 -0.8093270068360736 0.9971288
DontCare -1 -1 0.7495781342175345 1014.10 166.95 1239.98 193.12 1.407469682749958 1.691170427268877 4.252892749510803 -1000 -1000 -1000 1.5349762976149828 0.9974463
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test proper accounting with an equivalent malleability clone
#
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class TxnMallTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup_clean_chain = False
def add_options(self, parser):
parser.add_option("--mineblock", dest="mine_block", default=False, action="store_true",
help="Test double-spend of 1-confirmed transaction")
def setup_network(self):
# Start with split network:
return super(TxnMallTest, self).setup_network(True)
def run_test(self):
# All nodes should start with 1,250 BTC:
starting_balance = 1250
for i in range(4):
assert_equal(self.nodes[i].getbalance(), starting_balance)
self.nodes[i].getnewaddress("") # bug workaround, coins generated assigned to first getnewaddress!
# Assign coins to foo and bar accounts:
self.nodes[0].settxfee(.001)
node0_address_foo = self.nodes[0].getnewaddress("foo")
fund_foo_txid = self.nodes[0].sendfrom("", node0_address_foo, 1219)
fund_foo_tx = self.nodes[0].gettransaction(fund_foo_txid)
node0_address_bar = self.nodes[0].getnewaddress("bar")
fund_bar_txid = self.nodes[0].sendfrom("", node0_address_bar, 29)
fund_bar_tx = self.nodes[0].gettransaction(fund_bar_txid)
assert_equal(self.nodes[0].getbalance(""),
starting_balance - 1219 - 29 + fund_foo_tx["fee"] + fund_bar_tx["fee"])
# Coins are sent to node1_address
node1_address = self.nodes[1].getnewaddress("from0")
# Send tx1, and another transaction tx2 that won't be cloned
txid1 = self.nodes[0].sendfrom("foo", node1_address, 40, 0)
txid2 = self.nodes[0].sendfrom("bar", node1_address, 20, 0)
# Construct a clone of tx1, to be malleated
rawtx1 = self.nodes[0].getrawtransaction(txid1,1)
clone_inputs = [{"txid":rawtx1["vin"][0]["txid"],"vout":rawtx1["vin"][0]["vout"]}]
clone_outputs = {rawtx1["vout"][0]["scriptPubKey"]["addresses"][0]:rawtx1["vout"][0]["value"],
rawtx1["vout"][1]["scriptPubKey"]["addresses"][0]:rawtx1["vout"][1]["value"]}
clone_locktime = rawtx1["locktime"]
clone_raw = self.nodes[0].createrawtransaction(clone_inputs, clone_outputs, clone_locktime)
# createrawtransaction randomizes the order of its outputs, so swap them if necessary.
# output 0 is at version+#inputs+input+sigstub+sequence+#outputs
# 40 BTC serialized is 00286bee00000000
pos0 = 2*(4+1+36+1+4+1)
hex40 = "00286bee00000000"
output_len = 16 + 2 + 2 * int("0x" + clone_raw[pos0 + 16 : pos0 + 16 + 2], 0)
if (rawtx1["vout"][0]["value"] == 40 and clone_raw[pos0 : pos0 + 16] != hex40 or
rawtx1["vout"][0]["value"] != 40 and clone_raw[pos0 : pos0 + 16] == hex40):
output0 = clone_raw[pos0 : pos0 + output_len]
output1 = clone_raw[pos0 + output_len : pos0 + 2 * output_len]
clone_raw = clone_raw[:pos0] + output1 + output0 + clone_raw[pos0 + 2 * output_len:]
# Use a different signature hash type to sign. This creates an equivalent but malleated clone.
# Don't send the clone anywhere yet
tx1_clone = self.nodes[0].signrawtransaction(clone_raw, None, None, "ALL|ANYONECANPAY")
assert_equal(tx1_clone["complete"], True)
# Have node0 mine a block, if requested:
if (self.options.mine_block):
self.nodes[0].generate(1)
sync_blocks(self.nodes[0:2])
tx1 = self.nodes[0].gettransaction(txid1)
tx2 = self.nodes[0].gettransaction(txid2)
# Node0's balance should be starting balance, plus 50BTC for another
# matured block, minus tx1 and tx2 amounts, and minus transaction fees:
expected = starting_balance + fund_foo_tx["fee"] + fund_bar_tx["fee"]
if self.options.mine_block: expected += 50
expected += tx1["amount"] + tx1["fee"]
expected += tx2["amount"] + tx2["fee"]
assert_equal(self.nodes[0].getbalance(), expected)
# foo and bar accounts should be debited:
assert_equal(self.nodes[0].getbalance("foo", 0), 1219 + tx1["amount"] + tx1["fee"])
assert_equal(self.nodes[0].getbalance("bar", 0), 29 + tx2["amount"] + tx2["fee"])
if self.options.mine_block:
assert_equal(tx1["confirmations"], 1)
assert_equal(tx2["confirmations"], 1)
# Node1's "from0" balance should be both transaction amounts:
assert_equal(self.nodes[1].getbalance("from0"), -(tx1["amount"] + tx2["amount"]))
else:
assert_equal(tx1["confirmations"], 0)
assert_equal(tx2["confirmations"], 0)
# Send clone and its parent to miner
self.nodes[2].sendrawtransaction(fund_foo_tx["hex"])
txid1_clone = self.nodes[2].sendrawtransaction(tx1_clone["hex"])
# ... mine a block...
self.nodes[2].generate(1)
# Reconnect the split network, and sync chain:
connect_nodes(self.nodes[1], 2)
self.nodes[2].sendrawtransaction(fund_bar_tx["hex"])
self.nodes[2].sendrawtransaction(tx2["hex"])
self.nodes[2].generate(1) # Mine another block to make sure we sync
sync_blocks(self.nodes)
# Re-fetch transaction info:
tx1 = self.nodes[0].gettransaction(txid1)
tx1_clone = self.nodes[0].gettransaction(txid1_clone)
tx2 = self.nodes[0].gettransaction(txid2)
# Verify expected confirmations
assert_equal(tx1["confirmations"], -2)
assert_equal(tx1_clone["confirmations"], 2)
assert_equal(tx2["confirmations"], 1)
# Check node0's total balance; should be same as before the clone, + 100 BTC for 2 matured,
# less possible orphaned matured subsidy
expected += 100
if (self.options.mine_block):
expected -= 50
assert_equal(self.nodes[0].getbalance(), expected)
assert_equal(self.nodes[0].getbalance("*", 0), expected)
# Check node0's individual account balances.
# "foo" should have been debited by the equivalent clone of tx1
assert_equal(self.nodes[0].getbalance("foo"), 1219 + tx1["amount"] + tx1["fee"])
# "bar" should have been debited by (possibly unconfirmed) tx2
assert_equal(self.nodes[0].getbalance("bar", 0), 29 + tx2["amount"] + tx2["fee"])
# "" should have starting balance, less funding txes, plus subsidies
assert_equal(self.nodes[0].getbalance("", 0), starting_balance
- 1219
+ fund_foo_tx["fee"]
- 29
+ fund_bar_tx["fee"]
+ 100)
# Node1's "from0" account balance
assert_equal(self.nodes[1].getbalance("from0", 0), -(tx1["amount"] + tx2["amount"]))
if __name__ == '__main__':
TxnMallTest().main()
|
{
"pile_set_name": "Github"
}
|
S0001 XX 2000.00000 2000.00000 10000.00000 10000.00000
S0002 XX 3000.00000 2000.00000 10000.00000 10000.00000
S0003 XX 4000.00000 2000.00000 10000.00000 10000.00000
S0004 XX 5000.00000 2000.00000 10000.00000 10000.00000
S0005 XX 6000.00000 2000.00000 10000.00000 10000.00000
S0006 XX 7000.00000 2000.00000 10000.00000 10000.00000
S0007 XX 8000.00000 2000.00000 10000.00000 10000.00000
S0008 XX 9000.00000 2000.00000 10000.00000 10000.00000
S0009 XX 10000.00000 2000.00000 10000.00000 10000.00000
S0010 XX 11000.00000 2000.00000 10000.00000 10000.00000
S0011 XX 12000.00000 2000.00000 10000.00000 10000.00000
S0012 XX 13000.00000 2000.00000 10000.00000 10000.00000
S0013 XX 14000.00000 2000.00000 10000.00000 10000.00000
S0014 XX 15000.00000 2000.00000 10000.00000 10000.00000
S0015 XX 16000.00000 2000.00000 10000.00000 10000.00000
S0016 XX 17000.00000 2000.00000 10000.00000 10000.00000
S0017 XX 18000.00000 2000.00000 10000.00000 10000.00000
S0018 XX 19000.00000 2000.00000 10000.00000 10000.00000
S0019 XX 20000.00000 2000.00000 10000.00000 10000.00000
S0020 XX 21000.00000 2000.00000 10000.00000 10000.00000
S0021 XX 22000.00000 2000.00000 10000.00000 10000.00000
S0022 XX 23000.00000 2000.00000 10000.00000 10000.00000
S0023 XX 24000.00000 2000.00000 10000.00000 10000.00000
S0024 XX 25000.00000 2000.00000 10000.00000 10000.00000
S0025 XX 26000.00000 2000.00000 10000.00000 10000.00000
S0026 XX 27000.00000 2000.00000 10000.00000 10000.00000
S0027 XX 28000.00000 2000.00000 10000.00000 10000.00000
S0028 XX 29000.00000 2000.00000 10000.00000 10000.00000
S0029 XX 30000.00000 2000.00000 10000.00000 10000.00000
S0030 XX 2000.00000 3000.00000 10000.00000 10000.00000
S0031 XX 3000.00000 3000.00000 10000.00000 10000.00000
S0032 XX 4000.00000 3000.00000 10000.00000 10000.00000
S0033 XX 5000.00000 3000.00000 10000.00000 10000.00000
S0034 XX 6000.00000 3000.00000 10000.00000 10000.00000
S0035 XX 7000.00000 3000.00000 10000.00000 10000.00000
S0036 XX 8000.00000 3000.00000 10000.00000 10000.00000
S0037 XX 9000.00000 3000.00000 10000.00000 10000.00000
S0038 XX 10000.00000 3000.00000 10000.00000 10000.00000
S0039 XX 11000.00000 3000.00000 10000.00000 10000.00000
S0040 XX 12000.00000 3000.00000 10000.00000 10000.00000
S0041 XX 13000.00000 3000.00000 10000.00000 10000.00000
S0042 XX 14000.00000 3000.00000 10000.00000 10000.00000
S0043 XX 15000.00000 3000.00000 10000.00000 10000.00000
S0044 XX 16000.00000 3000.00000 10000.00000 10000.00000
S0045 XX 17000.00000 3000.00000 10000.00000 10000.00000
S0046 XX 18000.00000 3000.00000 10000.00000 10000.00000
S0047 XX 19000.00000 3000.00000 10000.00000 10000.00000
S0048 XX 20000.00000 3000.00000 10000.00000 10000.00000
S0049 XX 21000.00000 3000.00000 10000.00000 10000.00000
S0050 XX 22000.00000 3000.00000 10000.00000 10000.00000
S0051 XX 23000.00000 3000.00000 10000.00000 10000.00000
S0052 XX 24000.00000 3000.00000 10000.00000 10000.00000
S0053 XX 25000.00000 3000.00000 10000.00000 10000.00000
S0054 XX 26000.00000 3000.00000 10000.00000 10000.00000
S0055 XX 27000.00000 3000.00000 10000.00000 10000.00000
S0056 XX 28000.00000 3000.00000 10000.00000 10000.00000
S0057 XX 29000.00000 3000.00000 10000.00000 10000.00000
S0058 XX 30000.00000 3000.00000 10000.00000 10000.00000
S0059 XX 2000.00000 4000.00000 10000.00000 10000.00000
S0060 XX 3000.00000 4000.00000 10000.00000 10000.00000
S0061 XX 4000.00000 4000.00000 10000.00000 10000.00000
S0062 XX 5000.00000 4000.00000 10000.00000 10000.00000
S0063 XX 6000.00000 4000.00000 10000.00000 10000.00000
S0064 XX 7000.00000 4000.00000 10000.00000 10000.00000
S0065 XX 8000.00000 4000.00000 10000.00000 10000.00000
S0066 XX 9000.00000 4000.00000 10000.00000 10000.00000
S0067 XX 10000.00000 4000.00000 10000.00000 10000.00000
S0068 XX 11000.00000 4000.00000 10000.00000 10000.00000
S0069 XX 12000.00000 4000.00000 10000.00000 10000.00000
S0070 XX 13000.00000 4000.00000 10000.00000 10000.00000
S0071 XX 14000.00000 4000.00000 10000.00000 10000.00000
S0072 XX 15000.00000 4000.00000 10000.00000 10000.00000
S0073 XX 16000.00000 4000.00000 10000.00000 10000.00000
S0074 XX 17000.00000 4000.00000 10000.00000 10000.00000
S0075 XX 18000.00000 4000.00000 10000.00000 10000.00000
S0076 XX 19000.00000 4000.00000 10000.00000 10000.00000
S0077 XX 20000.00000 4000.00000 10000.00000 10000.00000
S0078 XX 21000.00000 4000.00000 10000.00000 10000.00000
S0079 XX 22000.00000 4000.00000 10000.00000 10000.00000
S0080 XX 23000.00000 4000.00000 10000.00000 10000.00000
S0081 XX 24000.00000 4000.00000 10000.00000 10000.00000
S0082 XX 25000.00000 4000.00000 10000.00000 10000.00000
S0083 XX 26000.00000 4000.00000 10000.00000 10000.00000
S0084 XX 27000.00000 4000.00000 10000.00000 10000.00000
S0085 XX 28000.00000 4000.00000 10000.00000 10000.00000
S0086 XX 29000.00000 4000.00000 10000.00000 10000.00000
S0087 XX 30000.00000 4000.00000 10000.00000 10000.00000
S0088 XX 2000.00000 5000.00000 10000.00000 10000.00000
S0089 XX 3000.00000 5000.00000 10000.00000 10000.00000
S0090 XX 4000.00000 5000.00000 10000.00000 10000.00000
S0091 XX 5000.00000 5000.00000 10000.00000 10000.00000
S0092 XX 6000.00000 5000.00000 10000.00000 10000.00000
S0093 XX 7000.00000 5000.00000 10000.00000 10000.00000
S0094 XX 8000.00000 5000.00000 10000.00000 10000.00000
S0095 XX 9000.00000 5000.00000 10000.00000 10000.00000
S0096 XX 10000.00000 5000.00000 10000.00000 10000.00000
S0097 XX 11000.00000 5000.00000 10000.00000 10000.00000
S0098 XX 12000.00000 5000.00000 10000.00000 10000.00000
S0099 XX 13000.00000 5000.00000 10000.00000 10000.00000
S0100 XX 14000.00000 5000.00000 10000.00000 10000.00000
S0101 XX 15000.00000 5000.00000 10000.00000 10000.00000
S0102 XX 16000.00000 5000.00000 10000.00000 10000.00000
S0103 XX 17000.00000 5000.00000 10000.00000 10000.00000
S0104 XX 18000.00000 5000.00000 10000.00000 10000.00000
S0105 XX 19000.00000 5000.00000 10000.00000 10000.00000
S0106 XX 20000.00000 5000.00000 10000.00000 10000.00000
S0107 XX 21000.00000 5000.00000 10000.00000 10000.00000
S0108 XX 22000.00000 5000.00000 10000.00000 10000.00000
S0109 XX 23000.00000 5000.00000 10000.00000 10000.00000
S0110 XX 24000.00000 5000.00000 10000.00000 10000.00000
S0111 XX 25000.00000 5000.00000 10000.00000 10000.00000
S0112 XX 26000.00000 5000.00000 10000.00000 10000.00000
S0113 XX 27000.00000 5000.00000 10000.00000 10000.00000
S0114 XX 28000.00000 5000.00000 10000.00000 10000.00000
S0115 XX 29000.00000 5000.00000 10000.00000 10000.00000
S0116 XX 30000.00000 5000.00000 10000.00000 10000.00000
S0117 XX 2000.00000 6000.00000 10000.00000 10000.00000
S0118 XX 3000.00000 6000.00000 10000.00000 10000.00000
S0119 XX 4000.00000 6000.00000 10000.00000 10000.00000
S0120 XX 5000.00000 6000.00000 10000.00000 10000.00000
S0121 XX 6000.00000 6000.00000 10000.00000 10000.00000
S0122 XX 7000.00000 6000.00000 10000.00000 10000.00000
S0123 XX 8000.00000 6000.00000 10000.00000 10000.00000
S0124 XX 9000.00000 6000.00000 10000.00000 10000.00000
S0125 XX 10000.00000 6000.00000 10000.00000 10000.00000
S0126 XX 11000.00000 6000.00000 10000.00000 10000.00000
S0127 XX 12000.00000 6000.00000 10000.00000 10000.00000
S0128 XX 13000.00000 6000.00000 10000.00000 10000.00000
S0129 XX 14000.00000 6000.00000 10000.00000 10000.00000
S0130 XX 15000.00000 6000.00000 10000.00000 10000.00000
S0131 XX 16000.00000 6000.00000 10000.00000 10000.00000
S0132 XX 17000.00000 6000.00000 10000.00000 10000.00000
S0133 XX 18000.00000 6000.00000 10000.00000 10000.00000
S0134 XX 19000.00000 6000.00000 10000.00000 10000.00000
S0135 XX 20000.00000 6000.00000 10000.00000 10000.00000
S0136 XX 21000.00000 6000.00000 10000.00000 10000.00000
S0137 XX 22000.00000 6000.00000 10000.00000 10000.00000
S0138 XX 23000.00000 6000.00000 10000.00000 10000.00000
S0139 XX 24000.00000 6000.00000 10000.00000 10000.00000
S0140 XX 25000.00000 6000.00000 10000.00000 10000.00000
S0141 XX 26000.00000 6000.00000 10000.00000 10000.00000
S0142 XX 27000.00000 6000.00000 10000.00000 10000.00000
S0143 XX 28000.00000 6000.00000 10000.00000 10000.00000
S0144 XX 29000.00000 6000.00000 10000.00000 10000.00000
S0145 XX 30000.00000 6000.00000 10000.00000 10000.00000
S0146 XX 2000.00000 7000.00000 10000.00000 10000.00000
S0147 XX 3000.00000 7000.00000 10000.00000 10000.00000
S0148 XX 4000.00000 7000.00000 10000.00000 10000.00000
S0149 XX 5000.00000 7000.00000 10000.00000 10000.00000
S0150 XX 6000.00000 7000.00000 10000.00000 10000.00000
S0151 XX 7000.00000 7000.00000 10000.00000 10000.00000
S0152 XX 8000.00000 7000.00000 10000.00000 10000.00000
S0153 XX 9000.00000 7000.00000 10000.00000 10000.00000
S0154 XX 10000.00000 7000.00000 10000.00000 10000.00000
S0155 XX 11000.00000 7000.00000 10000.00000 10000.00000
S0156 XX 12000.00000 7000.00000 10000.00000 10000.00000
S0157 XX 13000.00000 7000.00000 10000.00000 10000.00000
S0158 XX 14000.00000 7000.00000 10000.00000 10000.00000
S0159 XX 15000.00000 7000.00000 10000.00000 10000.00000
S0160 XX 16000.00000 7000.00000 10000.00000 10000.00000
S0161 XX 17000.00000 7000.00000 10000.00000 10000.00000
S0162 XX 18000.00000 7000.00000 10000.00000 10000.00000
S0163 XX 19000.00000 7000.00000 10000.00000 10000.00000
S0164 XX 20000.00000 7000.00000 10000.00000 10000.00000
S0165 XX 21000.00000 7000.00000 10000.00000 10000.00000
S0166 XX 22000.00000 7000.00000 10000.00000 10000.00000
S0167 XX 23000.00000 7000.00000 10000.00000 10000.00000
S0168 XX 24000.00000 7000.00000 10000.00000 10000.00000
S0169 XX 25000.00000 7000.00000 10000.00000 10000.00000
S0170 XX 26000.00000 7000.00000 10000.00000 10000.00000
S0171 XX 27000.00000 7000.00000 10000.00000 10000.00000
S0172 XX 28000.00000 7000.00000 10000.00000 10000.00000
S0173 XX 29000.00000 7000.00000 10000.00000 10000.00000
S0174 XX 30000.00000 7000.00000 10000.00000 10000.00000
S0175 XX 2000.00000 8000.00000 10000.00000 10000.00000
S0176 XX 3000.00000 8000.00000 10000.00000 10000.00000
S0177 XX 4000.00000 8000.00000 10000.00000 10000.00000
S0178 XX 5000.00000 8000.00000 10000.00000 10000.00000
S0179 XX 6000.00000 8000.00000 10000.00000 10000.00000
S0180 XX 7000.00000 8000.00000 10000.00000 10000.00000
S0181 XX 8000.00000 8000.00000 10000.00000 10000.00000
S0182 XX 9000.00000 8000.00000 10000.00000 10000.00000
S0183 XX 10000.00000 8000.00000 10000.00000 10000.00000
S0184 XX 11000.00000 8000.00000 10000.00000 10000.00000
S0185 XX 12000.00000 8000.00000 10000.00000 10000.00000
S0186 XX 13000.00000 8000.00000 10000.00000 10000.00000
S0187 XX 14000.00000 8000.00000 10000.00000 10000.00000
S0188 XX 15000.00000 8000.00000 10000.00000 10000.00000
S0189 XX 16000.00000 8000.00000 10000.00000 10000.00000
S0190 XX 17000.00000 8000.00000 10000.00000 10000.00000
S0191 XX 18000.00000 8000.00000 10000.00000 10000.00000
S0192 XX 19000.00000 8000.00000 10000.00000 10000.00000
S0193 XX 20000.00000 8000.00000 10000.00000 10000.00000
S0194 XX 21000.00000 8000.00000 10000.00000 10000.00000
S0195 XX 22000.00000 8000.00000 10000.00000 10000.00000
S0196 XX 23000.00000 8000.00000 10000.00000 10000.00000
S0197 XX 24000.00000 8000.00000 10000.00000 10000.00000
S0198 XX 25000.00000 8000.00000 10000.00000 10000.00000
S0199 XX 26000.00000 8000.00000 10000.00000 10000.00000
S0200 XX 27000.00000 8000.00000 10000.00000 10000.00000
S0201 XX 28000.00000 8000.00000 10000.00000 10000.00000
S0202 XX 29000.00000 8000.00000 10000.00000 10000.00000
S0203 XX 30000.00000 8000.00000 10000.00000 10000.00000
S0204 XX 2000.00000 9000.00000 10000.00000 10000.00000
S0205 XX 3000.00000 9000.00000 10000.00000 10000.00000
S0206 XX 4000.00000 9000.00000 10000.00000 10000.00000
S0207 XX 5000.00000 9000.00000 10000.00000 10000.00000
S0208 XX 6000.00000 9000.00000 10000.00000 10000.00000
S0209 XX 7000.00000 9000.00000 10000.00000 10000.00000
S0210 XX 8000.00000 9000.00000 10000.00000 10000.00000
S0211 XX 9000.00000 9000.00000 10000.00000 10000.00000
S0212 XX 10000.00000 9000.00000 10000.00000 10000.00000
S0213 XX 11000.00000 9000.00000 10000.00000 10000.00000
S0214 XX 12000.00000 9000.00000 10000.00000 10000.00000
S0215 XX 13000.00000 9000.00000 10000.00000 10000.00000
S0216 XX 14000.00000 9000.00000 10000.00000 10000.00000
S0217 XX 15000.00000 9000.00000 10000.00000 10000.00000
S0218 XX 16000.00000 9000.00000 10000.00000 10000.00000
S0219 XX 17000.00000 9000.00000 10000.00000 10000.00000
S0220 XX 18000.00000 9000.00000 10000.00000 10000.00000
S0221 XX 19000.00000 9000.00000 10000.00000 10000.00000
S0222 XX 20000.00000 9000.00000 10000.00000 10000.00000
S0223 XX 21000.00000 9000.00000 10000.00000 10000.00000
S0224 XX 22000.00000 9000.00000 10000.00000 10000.00000
S0225 XX 23000.00000 9000.00000 10000.00000 10000.00000
S0226 XX 24000.00000 9000.00000 10000.00000 10000.00000
S0227 XX 25000.00000 9000.00000 10000.00000 10000.00000
S0228 XX 26000.00000 9000.00000 10000.00000 10000.00000
S0229 XX 27000.00000 9000.00000 10000.00000 10000.00000
S0230 XX 28000.00000 9000.00000 10000.00000 10000.00000
S0231 XX 29000.00000 9000.00000 10000.00000 10000.00000
S0232 XX 30000.00000 9000.00000 10000.00000 10000.00000
S0233 XX 2000.00000 10000.00000 10000.00000 10000.00000
S0234 XX 3000.00000 10000.00000 10000.00000 10000.00000
S0235 XX 4000.00000 10000.00000 10000.00000 10000.00000
S0236 XX 5000.00000 10000.00000 10000.00000 10000.00000
S0237 XX 6000.00000 10000.00000 10000.00000 10000.00000
S0238 XX 7000.00000 10000.00000 10000.00000 10000.00000
S0239 XX 8000.00000 10000.00000 10000.00000 10000.00000
S0240 XX 9000.00000 10000.00000 10000.00000 10000.00000
S0241 XX 10000.00000 10000.00000 10000.00000 10000.00000
S0242 XX 11000.00000 10000.00000 10000.00000 10000.00000
S0243 XX 12000.00000 10000.00000 10000.00000 10000.00000
S0244 XX 13000.00000 10000.00000 10000.00000 10000.00000
S0245 XX 14000.00000 10000.00000 10000.00000 10000.00000
S0246 XX 15000.00000 10000.00000 10000.00000 10000.00000
S0247 XX 16000.00000 10000.00000 10000.00000 10000.00000
S0248 XX 17000.00000 10000.00000 10000.00000 10000.00000
S0249 XX 18000.00000 10000.00000 10000.00000 10000.00000
S0250 XX 19000.00000 10000.00000 10000.00000 10000.00000
S0251 XX 20000.00000 10000.00000 10000.00000 10000.00000
S0252 XX 21000.00000 10000.00000 10000.00000 10000.00000
S0253 XX 22000.00000 10000.00000 10000.00000 10000.00000
S0254 XX 23000.00000 10000.00000 10000.00000 10000.00000
S0255 XX 24000.00000 10000.00000 10000.00000 10000.00000
S0256 XX 25000.00000 10000.00000 10000.00000 10000.00000
S0257 XX 26000.00000 10000.00000 10000.00000 10000.00000
S0258 XX 27000.00000 10000.00000 10000.00000 10000.00000
S0259 XX 28000.00000 10000.00000 10000.00000 10000.00000
S0260 XX 29000.00000 10000.00000 10000.00000 10000.00000
S0261 XX 30000.00000 10000.00000 10000.00000 10000.00000
S0262 XX 2000.00000 11000.00000 10000.00000 10000.00000
S0263 XX 3000.00000 11000.00000 10000.00000 10000.00000
S0264 XX 4000.00000 11000.00000 10000.00000 10000.00000
S0265 XX 5000.00000 11000.00000 10000.00000 10000.00000
S0266 XX 6000.00000 11000.00000 10000.00000 10000.00000
S0267 XX 7000.00000 11000.00000 10000.00000 10000.00000
S0268 XX 8000.00000 11000.00000 10000.00000 10000.00000
S0269 XX 9000.00000 11000.00000 10000.00000 10000.00000
S0270 XX 10000.00000 11000.00000 10000.00000 10000.00000
S0271 XX 11000.00000 11000.00000 10000.00000 10000.00000
S0272 XX 12000.00000 11000.00000 10000.00000 10000.00000
S0273 XX 13000.00000 11000.00000 10000.00000 10000.00000
S0274 XX 14000.00000 11000.00000 10000.00000 10000.00000
S0275 XX 15000.00000 11000.00000 10000.00000 10000.00000
S0276 XX 16000.00000 11000.00000 10000.00000 10000.00000
S0277 XX 17000.00000 11000.00000 10000.00000 10000.00000
S0278 XX 18000.00000 11000.00000 10000.00000 10000.00000
S0279 XX 19000.00000 11000.00000 10000.00000 10000.00000
S0280 XX 20000.00000 11000.00000 10000.00000 10000.00000
S0281 XX 21000.00000 11000.00000 10000.00000 10000.00000
S0282 XX 22000.00000 11000.00000 10000.00000 10000.00000
S0283 XX 23000.00000 11000.00000 10000.00000 10000.00000
S0284 XX 24000.00000 11000.00000 10000.00000 10000.00000
S0285 XX 25000.00000 11000.00000 10000.00000 10000.00000
S0286 XX 26000.00000 11000.00000 10000.00000 10000.00000
S0287 XX 27000.00000 11000.00000 10000.00000 10000.00000
S0288 XX 28000.00000 11000.00000 10000.00000 10000.00000
S0289 XX 29000.00000 11000.00000 10000.00000 10000.00000
S0290 XX 30000.00000 11000.00000 10000.00000 10000.00000
S0291 XX 2000.00000 12000.00000 10000.00000 10000.00000
S0292 XX 3000.00000 12000.00000 10000.00000 10000.00000
S0293 XX 4000.00000 12000.00000 10000.00000 10000.00000
S0294 XX 5000.00000 12000.00000 10000.00000 10000.00000
S0295 XX 6000.00000 12000.00000 10000.00000 10000.00000
S0296 XX 7000.00000 12000.00000 10000.00000 10000.00000
S0297 XX 8000.00000 12000.00000 10000.00000 10000.00000
S0298 XX 9000.00000 12000.00000 10000.00000 10000.00000
S0299 XX 10000.00000 12000.00000 10000.00000 10000.00000
S0300 XX 11000.00000 12000.00000 10000.00000 10000.00000
S0301 XX 12000.00000 12000.00000 10000.00000 10000.00000
S0302 XX 13000.00000 12000.00000 10000.00000 10000.00000
S0303 XX 14000.00000 12000.00000 10000.00000 10000.00000
S0304 XX 15000.00000 12000.00000 10000.00000 10000.00000
S0305 XX 16000.00000 12000.00000 10000.00000 10000.00000
S0306 XX 17000.00000 12000.00000 10000.00000 10000.00000
S0307 XX 18000.00000 12000.00000 10000.00000 10000.00000
S0308 XX 19000.00000 12000.00000 10000.00000 10000.00000
S0309 XX 20000.00000 12000.00000 10000.00000 10000.00000
S0310 XX 21000.00000 12000.00000 10000.00000 10000.00000
S0311 XX 22000.00000 12000.00000 10000.00000 10000.00000
S0312 XX 23000.00000 12000.00000 10000.00000 10000.00000
S0313 XX 24000.00000 12000.00000 10000.00000 10000.00000
S0314 XX 25000.00000 12000.00000 10000.00000 10000.00000
S0315 XX 26000.00000 12000.00000 10000.00000 10000.00000
S0316 XX 27000.00000 12000.00000 10000.00000 10000.00000
S0317 XX 28000.00000 12000.00000 10000.00000 10000.00000
S0318 XX 29000.00000 12000.00000 10000.00000 10000.00000
S0319 XX 30000.00000 12000.00000 10000.00000 10000.00000
S0320 XX 2000.00000 13000.00000 10000.00000 10000.00000
S0321 XX 3000.00000 13000.00000 10000.00000 10000.00000
S0322 XX 4000.00000 13000.00000 10000.00000 10000.00000
S0323 XX 5000.00000 13000.00000 10000.00000 10000.00000
S0324 XX 6000.00000 13000.00000 10000.00000 10000.00000
S0325 XX 7000.00000 13000.00000 10000.00000 10000.00000
S0326 XX 8000.00000 13000.00000 10000.00000 10000.00000
S0327 XX 9000.00000 13000.00000 10000.00000 10000.00000
S0328 XX 10000.00000 13000.00000 10000.00000 10000.00000
S0329 XX 11000.00000 13000.00000 10000.00000 10000.00000
S0330 XX 12000.00000 13000.00000 10000.00000 10000.00000
S0331 XX 13000.00000 13000.00000 10000.00000 10000.00000
S0332 XX 14000.00000 13000.00000 10000.00000 10000.00000
S0333 XX 15000.00000 13000.00000 10000.00000 10000.00000
S0334 XX 16000.00000 13000.00000 10000.00000 10000.00000
S0335 XX 17000.00000 13000.00000 10000.00000 10000.00000
S0336 XX 18000.00000 13000.00000 10000.00000 10000.00000
S0337 XX 19000.00000 13000.00000 10000.00000 10000.00000
S0338 XX 20000.00000 13000.00000 10000.00000 10000.00000
S0339 XX 21000.00000 13000.00000 10000.00000 10000.00000
S0340 XX 22000.00000 13000.00000 10000.00000 10000.00000
S0341 XX 23000.00000 13000.00000 10000.00000 10000.00000
S0342 XX 24000.00000 13000.00000 10000.00000 10000.00000
S0343 XX 25000.00000 13000.00000 10000.00000 10000.00000
S0344 XX 26000.00000 13000.00000 10000.00000 10000.00000
S0345 XX 27000.00000 13000.00000 10000.00000 10000.00000
S0346 XX 28000.00000 13000.00000 10000.00000 10000.00000
S0347 XX 29000.00000 13000.00000 10000.00000 10000.00000
S0348 XX 30000.00000 13000.00000 10000.00000 10000.00000
S0349 XX 2000.00000 14000.00000 10000.00000 10000.00000
S0350 XX 3000.00000 14000.00000 10000.00000 10000.00000
S0351 XX 4000.00000 14000.00000 10000.00000 10000.00000
S0352 XX 5000.00000 14000.00000 10000.00000 10000.00000
S0353 XX 6000.00000 14000.00000 10000.00000 10000.00000
S0354 XX 7000.00000 14000.00000 10000.00000 10000.00000
S0355 XX 8000.00000 14000.00000 10000.00000 10000.00000
S0356 XX 9000.00000 14000.00000 10000.00000 10000.00000
S0357 XX 10000.00000 14000.00000 10000.00000 10000.00000
S0358 XX 11000.00000 14000.00000 10000.00000 10000.00000
S0359 XX 12000.00000 14000.00000 10000.00000 10000.00000
S0360 XX 13000.00000 14000.00000 10000.00000 10000.00000
S0361 XX 14000.00000 14000.00000 10000.00000 10000.00000
S0362 XX 15000.00000 14000.00000 10000.00000 10000.00000
S0363 XX 16000.00000 14000.00000 10000.00000 10000.00000
S0364 XX 17000.00000 14000.00000 10000.00000 10000.00000
S0365 XX 18000.00000 14000.00000 10000.00000 10000.00000
S0366 XX 19000.00000 14000.00000 10000.00000 10000.00000
S0367 XX 20000.00000 14000.00000 10000.00000 10000.00000
S0368 XX 21000.00000 14000.00000 10000.00000 10000.00000
S0369 XX 22000.00000 14000.00000 10000.00000 10000.00000
S0370 XX 23000.00000 14000.00000 10000.00000 10000.00000
S0371 XX 24000.00000 14000.00000 10000.00000 10000.00000
S0372 XX 25000.00000 14000.00000 10000.00000 10000.00000
S0373 XX 26000.00000 14000.00000 10000.00000 10000.00000
S0374 XX 27000.00000 14000.00000 10000.00000 10000.00000
S0375 XX 28000.00000 14000.00000 10000.00000 10000.00000
S0376 XX 29000.00000 14000.00000 10000.00000 10000.00000
S0377 XX 30000.00000 14000.00000 10000.00000 10000.00000
S0378 XX 2000.00000 15000.00000 10000.00000 10000.00000
S0379 XX 3000.00000 15000.00000 10000.00000 10000.00000
S0380 XX 4000.00000 15000.00000 10000.00000 10000.00000
S0381 XX 5000.00000 15000.00000 10000.00000 10000.00000
S0382 XX 6000.00000 15000.00000 10000.00000 10000.00000
S0383 XX 7000.00000 15000.00000 10000.00000 10000.00000
S0384 XX 8000.00000 15000.00000 10000.00000 10000.00000
S0385 XX 9000.00000 15000.00000 10000.00000 10000.00000
S0386 XX 10000.00000 15000.00000 10000.00000 10000.00000
S0387 XX 11000.00000 15000.00000 10000.00000 10000.00000
S0388 XX 12000.00000 15000.00000 10000.00000 10000.00000
S0389 XX 13000.00000 15000.00000 10000.00000 10000.00000
S0390 XX 14000.00000 15000.00000 10000.00000 10000.00000
S0391 XX 15000.00000 15000.00000 10000.00000 10000.00000
S0392 XX 16000.00000 15000.00000 10000.00000 10000.00000
S0393 XX 17000.00000 15000.00000 10000.00000 10000.00000
S0394 XX 18000.00000 15000.00000 10000.00000 10000.00000
S0395 XX 19000.00000 15000.00000 10000.00000 10000.00000
S0396 XX 20000.00000 15000.00000 10000.00000 10000.00000
S0397 XX 21000.00000 15000.00000 10000.00000 10000.00000
S0398 XX 22000.00000 15000.00000 10000.00000 10000.00000
S0399 XX 23000.00000 15000.00000 10000.00000 10000.00000
S0400 XX 24000.00000 15000.00000 10000.00000 10000.00000
S0401 XX 25000.00000 15000.00000 10000.00000 10000.00000
S0402 XX 26000.00000 15000.00000 10000.00000 10000.00000
S0403 XX 27000.00000 15000.00000 10000.00000 10000.00000
S0404 XX 28000.00000 15000.00000 10000.00000 10000.00000
S0405 XX 29000.00000 15000.00000 10000.00000 10000.00000
S0406 XX 30000.00000 15000.00000 10000.00000 10000.00000
S0407 XX 2000.00000 16000.00000 10000.00000 10000.00000
S0408 XX 3000.00000 16000.00000 10000.00000 10000.00000
S0409 XX 4000.00000 16000.00000 10000.00000 10000.00000
S0410 XX 5000.00000 16000.00000 10000.00000 10000.00000
S0411 XX 6000.00000 16000.00000 10000.00000 10000.00000
S0412 XX 7000.00000 16000.00000 10000.00000 10000.00000
S0413 XX 8000.00000 16000.00000 10000.00000 10000.00000
S0414 XX 9000.00000 16000.00000 10000.00000 10000.00000
S0415 XX 10000.00000 16000.00000 10000.00000 10000.00000
S0416 XX 11000.00000 16000.00000 10000.00000 10000.00000
S0417 XX 12000.00000 16000.00000 10000.00000 10000.00000
S0418 XX 13000.00000 16000.00000 10000.00000 10000.00000
S0419 XX 14000.00000 16000.00000 10000.00000 10000.00000
S0420 XX 15000.00000 16000.00000 10000.00000 10000.00000
S0421 XX 16000.00000 16000.00000 10000.00000 10000.00000
S0422 XX 17000.00000 16000.00000 10000.00000 10000.00000
S0423 XX 18000.00000 16000.00000 10000.00000 10000.00000
S0424 XX 19000.00000 16000.00000 10000.00000 10000.00000
S0425 XX 20000.00000 16000.00000 10000.00000 10000.00000
S0426 XX 21000.00000 16000.00000 10000.00000 10000.00000
S0427 XX 22000.00000 16000.00000 10000.00000 10000.00000
S0428 XX 23000.00000 16000.00000 10000.00000 10000.00000
S0429 XX 24000.00000 16000.00000 10000.00000 10000.00000
S0430 XX 25000.00000 16000.00000 10000.00000 10000.00000
S0431 XX 26000.00000 16000.00000 10000.00000 10000.00000
S0432 XX 27000.00000 16000.00000 10000.00000 10000.00000
S0433 XX 28000.00000 16000.00000 10000.00000 10000.00000
S0434 XX 29000.00000 16000.00000 10000.00000 10000.00000
S0435 XX 30000.00000 16000.00000 10000.00000 10000.00000
S0436 XX 2000.00000 17000.00000 10000.00000 10000.00000
S0437 XX 3000.00000 17000.00000 10000.00000 10000.00000
S0438 XX 4000.00000 17000.00000 10000.00000 10000.00000
S0439 XX 5000.00000 17000.00000 10000.00000 10000.00000
S0440 XX 6000.00000 17000.00000 10000.00000 10000.00000
S0441 XX 7000.00000 17000.00000 10000.00000 10000.00000
S0442 XX 8000.00000 17000.00000 10000.00000 10000.00000
S0443 XX 9000.00000 17000.00000 10000.00000 10000.00000
S0444 XX 10000.00000 17000.00000 10000.00000 10000.00000
S0445 XX 11000.00000 17000.00000 10000.00000 10000.00000
S0446 XX 12000.00000 17000.00000 10000.00000 10000.00000
S0447 XX 13000.00000 17000.00000 10000.00000 10000.00000
S0448 XX 14000.00000 17000.00000 10000.00000 10000.00000
S0449 XX 15000.00000 17000.00000 10000.00000 10000.00000
S0450 XX 16000.00000 17000.00000 10000.00000 10000.00000
S0451 XX 17000.00000 17000.00000 10000.00000 10000.00000
S0452 XX 18000.00000 17000.00000 10000.00000 10000.00000
S0453 XX 19000.00000 17000.00000 10000.00000 10000.00000
S0454 XX 20000.00000 17000.00000 10000.00000 10000.00000
S0455 XX 21000.00000 17000.00000 10000.00000 10000.00000
S0456 XX 22000.00000 17000.00000 10000.00000 10000.00000
S0457 XX 23000.00000 17000.00000 10000.00000 10000.00000
S0458 XX 24000.00000 17000.00000 10000.00000 10000.00000
S0459 XX 25000.00000 17000.00000 10000.00000 10000.00000
S0460 XX 26000.00000 17000.00000 10000.00000 10000.00000
S0461 XX 27000.00000 17000.00000 10000.00000 10000.00000
S0462 XX 28000.00000 17000.00000 10000.00000 10000.00000
S0463 XX 29000.00000 17000.00000 10000.00000 10000.00000
S0464 XX 30000.00000 17000.00000 10000.00000 10000.00000
S0465 XX 2000.00000 18000.00000 10000.00000 10000.00000
S0466 XX 3000.00000 18000.00000 10000.00000 10000.00000
S0467 XX 4000.00000 18000.00000 10000.00000 10000.00000
S0468 XX 5000.00000 18000.00000 10000.00000 10000.00000
S0469 XX 6000.00000 18000.00000 10000.00000 10000.00000
S0470 XX 7000.00000 18000.00000 10000.00000 10000.00000
S0471 XX 8000.00000 18000.00000 10000.00000 10000.00000
S0472 XX 9000.00000 18000.00000 10000.00000 10000.00000
S0473 XX 10000.00000 18000.00000 10000.00000 10000.00000
S0474 XX 11000.00000 18000.00000 10000.00000 10000.00000
S0475 XX 12000.00000 18000.00000 10000.00000 10000.00000
S0476 XX 13000.00000 18000.00000 10000.00000 10000.00000
S0477 XX 14000.00000 18000.00000 10000.00000 10000.00000
S0478 XX 15000.00000 18000.00000 10000.00000 10000.00000
S0479 XX 16000.00000 18000.00000 10000.00000 10000.00000
S0480 XX 17000.00000 18000.00000 10000.00000 10000.00000
S0481 XX 18000.00000 18000.00000 10000.00000 10000.00000
S0482 XX 19000.00000 18000.00000 10000.00000 10000.00000
S0483 XX 20000.00000 18000.00000 10000.00000 10000.00000
S0484 XX 21000.00000 18000.00000 10000.00000 10000.00000
S0485 XX 22000.00000 18000.00000 10000.00000 10000.00000
S0486 XX 23000.00000 18000.00000 10000.00000 10000.00000
S0487 XX 24000.00000 18000.00000 10000.00000 10000.00000
S0488 XX 25000.00000 18000.00000 10000.00000 10000.00000
S0489 XX 26000.00000 18000.00000 10000.00000 10000.00000
S0490 XX 27000.00000 18000.00000 10000.00000 10000.00000
S0491 XX 28000.00000 18000.00000 10000.00000 10000.00000
S0492 XX 29000.00000 18000.00000 10000.00000 10000.00000
S0493 XX 30000.00000 18000.00000 10000.00000 10000.00000
S0494 XX 2000.00000 19000.00000 10000.00000 10000.00000
S0495 XX 3000.00000 19000.00000 10000.00000 10000.00000
S0496 XX 4000.00000 19000.00000 10000.00000 10000.00000
S0497 XX 5000.00000 19000.00000 10000.00000 10000.00000
S0498 XX 6000.00000 19000.00000 10000.00000 10000.00000
S0499 XX 7000.00000 19000.00000 10000.00000 10000.00000
S0500 XX 8000.00000 19000.00000 10000.00000 10000.00000
S0501 XX 9000.00000 19000.00000 10000.00000 10000.00000
S0502 XX 10000.00000 19000.00000 10000.00000 10000.00000
S0503 XX 11000.00000 19000.00000 10000.00000 10000.00000
S0504 XX 12000.00000 19000.00000 10000.00000 10000.00000
S0505 XX 13000.00000 19000.00000 10000.00000 10000.00000
S0506 XX 14000.00000 19000.00000 10000.00000 10000.00000
S0507 XX 15000.00000 19000.00000 10000.00000 10000.00000
S0508 XX 16000.00000 19000.00000 10000.00000 10000.00000
S0509 XX 17000.00000 19000.00000 10000.00000 10000.00000
S0510 XX 18000.00000 19000.00000 10000.00000 10000.00000
S0511 XX 19000.00000 19000.00000 10000.00000 10000.00000
S0512 XX 20000.00000 19000.00000 10000.00000 10000.00000
S0513 XX 21000.00000 19000.00000 10000.00000 10000.00000
S0514 XX 22000.00000 19000.00000 10000.00000 10000.00000
S0515 XX 23000.00000 19000.00000 10000.00000 10000.00000
S0516 XX 24000.00000 19000.00000 10000.00000 10000.00000
S0517 XX 25000.00000 19000.00000 10000.00000 10000.00000
S0518 XX 26000.00000 19000.00000 10000.00000 10000.00000
S0519 XX 27000.00000 19000.00000 10000.00000 10000.00000
S0520 XX 28000.00000 19000.00000 10000.00000 10000.00000
S0521 XX 29000.00000 19000.00000 10000.00000 10000.00000
S0522 XX 30000.00000 19000.00000 10000.00000 10000.00000
S0523 XX 2000.00000 20000.00000 10000.00000 10000.00000
S0524 XX 3000.00000 20000.00000 10000.00000 10000.00000
S0525 XX 4000.00000 20000.00000 10000.00000 10000.00000
S0526 XX 5000.00000 20000.00000 10000.00000 10000.00000
S0527 XX 6000.00000 20000.00000 10000.00000 10000.00000
S0528 XX 7000.00000 20000.00000 10000.00000 10000.00000
S0529 XX 8000.00000 20000.00000 10000.00000 10000.00000
S0530 XX 9000.00000 20000.00000 10000.00000 10000.00000
S0531 XX 10000.00000 20000.00000 10000.00000 10000.00000
S0532 XX 11000.00000 20000.00000 10000.00000 10000.00000
S0533 XX 12000.00000 20000.00000 10000.00000 10000.00000
S0534 XX 13000.00000 20000.00000 10000.00000 10000.00000
S0535 XX 14000.00000 20000.00000 10000.00000 10000.00000
S0536 XX 15000.00000 20000.00000 10000.00000 10000.00000
S0537 XX 16000.00000 20000.00000 10000.00000 10000.00000
S0538 XX 17000.00000 20000.00000 10000.00000 10000.00000
S0539 XX 18000.00000 20000.00000 10000.00000 10000.00000
S0540 XX 19000.00000 20000.00000 10000.00000 10000.00000
S0541 XX 20000.00000 20000.00000 10000.00000 10000.00000
S0542 XX 21000.00000 20000.00000 10000.00000 10000.00000
S0543 XX 22000.00000 20000.00000 10000.00000 10000.00000
S0544 XX 23000.00000 20000.00000 10000.00000 10000.00000
S0545 XX 24000.00000 20000.00000 10000.00000 10000.00000
S0546 XX 25000.00000 20000.00000 10000.00000 10000.00000
S0547 XX 26000.00000 20000.00000 10000.00000 10000.00000
S0548 XX 27000.00000 20000.00000 10000.00000 10000.00000
S0549 XX 28000.00000 20000.00000 10000.00000 10000.00000
S0550 XX 29000.00000 20000.00000 10000.00000 10000.00000
S0551 XX 30000.00000 20000.00000 10000.00000 10000.00000
S0552 XX 2000.00000 21000.00000 10000.00000 10000.00000
S0553 XX 3000.00000 21000.00000 10000.00000 10000.00000
S0554 XX 4000.00000 21000.00000 10000.00000 10000.00000
S0555 XX 5000.00000 21000.00000 10000.00000 10000.00000
S0556 XX 6000.00000 21000.00000 10000.00000 10000.00000
S0557 XX 7000.00000 21000.00000 10000.00000 10000.00000
S0558 XX 8000.00000 21000.00000 10000.00000 10000.00000
S0559 XX 9000.00000 21000.00000 10000.00000 10000.00000
S0560 XX 10000.00000 21000.00000 10000.00000 10000.00000
S0561 XX 11000.00000 21000.00000 10000.00000 10000.00000
S0562 XX 12000.00000 21000.00000 10000.00000 10000.00000
S0563 XX 13000.00000 21000.00000 10000.00000 10000.00000
S0564 XX 14000.00000 21000.00000 10000.00000 10000.00000
S0565 XX 15000.00000 21000.00000 10000.00000 10000.00000
S0566 XX 16000.00000 21000.00000 10000.00000 10000.00000
S0567 XX 17000.00000 21000.00000 10000.00000 10000.00000
S0568 XX 18000.00000 21000.00000 10000.00000 10000.00000
S0569 XX 19000.00000 21000.00000 10000.00000 10000.00000
S0570 XX 20000.00000 21000.00000 10000.00000 10000.00000
S0571 XX 21000.00000 21000.00000 10000.00000 10000.00000
S0572 XX 22000.00000 21000.00000 10000.00000 10000.00000
S0573 XX 23000.00000 21000.00000 10000.00000 10000.00000
S0574 XX 24000.00000 21000.00000 10000.00000 10000.00000
S0575 XX 25000.00000 21000.00000 10000.00000 10000.00000
S0576 XX 26000.00000 21000.00000 10000.00000 10000.00000
S0577 XX 27000.00000 21000.00000 10000.00000 10000.00000
S0578 XX 28000.00000 21000.00000 10000.00000 10000.00000
S0579 XX 29000.00000 21000.00000 10000.00000 10000.00000
S0580 XX 30000.00000 21000.00000 10000.00000 10000.00000
S0581 XX 2000.00000 22000.00000 10000.00000 10000.00000
S0582 XX 3000.00000 22000.00000 10000.00000 10000.00000
S0583 XX 4000.00000 22000.00000 10000.00000 10000.00000
S0584 XX 5000.00000 22000.00000 10000.00000 10000.00000
S0585 XX 6000.00000 22000.00000 10000.00000 10000.00000
S0586 XX 7000.00000 22000.00000 10000.00000 10000.00000
S0587 XX 8000.00000 22000.00000 10000.00000 10000.00000
S0588 XX 9000.00000 22000.00000 10000.00000 10000.00000
S0589 XX 10000.00000 22000.00000 10000.00000 10000.00000
S0590 XX 11000.00000 22000.00000 10000.00000 10000.00000
S0591 XX 12000.00000 22000.00000 10000.00000 10000.00000
S0592 XX 13000.00000 22000.00000 10000.00000 10000.00000
S0593 XX 14000.00000 22000.00000 10000.00000 10000.00000
S0594 XX 15000.00000 22000.00000 10000.00000 10000.00000
S0595 XX 16000.00000 22000.00000 10000.00000 10000.00000
S0596 XX 17000.00000 22000.00000 10000.00000 10000.00000
S0597 XX 18000.00000 22000.00000 10000.00000 10000.00000
S0598 XX 19000.00000 22000.00000 10000.00000 10000.00000
S0599 XX 20000.00000 22000.00000 10000.00000 10000.00000
S0600 XX 21000.00000 22000.00000 10000.00000 10000.00000
S0601 XX 22000.00000 22000.00000 10000.00000 10000.00000
S0602 XX 23000.00000 22000.00000 10000.00000 10000.00000
S0603 XX 24000.00000 22000.00000 10000.00000 10000.00000
S0604 XX 25000.00000 22000.00000 10000.00000 10000.00000
S0605 XX 26000.00000 22000.00000 10000.00000 10000.00000
S0606 XX 27000.00000 22000.00000 10000.00000 10000.00000
S0607 XX 28000.00000 22000.00000 10000.00000 10000.00000
S0608 XX 29000.00000 22000.00000 10000.00000 10000.00000
S0609 XX 30000.00000 22000.00000 10000.00000 10000.00000
S0610 XX 2000.00000 23000.00000 10000.00000 10000.00000
S0611 XX 3000.00000 23000.00000 10000.00000 10000.00000
S0612 XX 4000.00000 23000.00000 10000.00000 10000.00000
S0613 XX 5000.00000 23000.00000 10000.00000 10000.00000
S0614 XX 6000.00000 23000.00000 10000.00000 10000.00000
S0615 XX 7000.00000 23000.00000 10000.00000 10000.00000
S0616 XX 8000.00000 23000.00000 10000.00000 10000.00000
S0617 XX 9000.00000 23000.00000 10000.00000 10000.00000
S0618 XX 10000.00000 23000.00000 10000.00000 10000.00000
S0619 XX 11000.00000 23000.00000 10000.00000 10000.00000
S0620 XX 12000.00000 23000.00000 10000.00000 10000.00000
S0621 XX 13000.00000 23000.00000 10000.00000 10000.00000
S0622 XX 14000.00000 23000.00000 10000.00000 10000.00000
S0623 XX 15000.00000 23000.00000 10000.00000 10000.00000
S0624 XX 16000.00000 23000.00000 10000.00000 10000.00000
S0625 XX 17000.00000 23000.00000 10000.00000 10000.00000
S0626 XX 18000.00000 23000.00000 10000.00000 10000.00000
S0627 XX 19000.00000 23000.00000 10000.00000 10000.00000
S0628 XX 20000.00000 23000.00000 10000.00000 10000.00000
S0629 XX 21000.00000 23000.00000 10000.00000 10000.00000
S0630 XX 22000.00000 23000.00000 10000.00000 10000.00000
S0631 XX 23000.00000 23000.00000 10000.00000 10000.00000
S0632 XX 24000.00000 23000.00000 10000.00000 10000.00000
S0633 XX 25000.00000 23000.00000 10000.00000 10000.00000
S0634 XX 26000.00000 23000.00000 10000.00000 10000.00000
S0635 XX 27000.00000 23000.00000 10000.00000 10000.00000
S0636 XX 28000.00000 23000.00000 10000.00000 10000.00000
S0637 XX 29000.00000 23000.00000 10000.00000 10000.00000
S0638 XX 30000.00000 23000.00000 10000.00000 10000.00000
S0639 XX 2000.00000 24000.00000 10000.00000 10000.00000
S0640 XX 3000.00000 24000.00000 10000.00000 10000.00000
S0641 XX 4000.00000 24000.00000 10000.00000 10000.00000
S0642 XX 5000.00000 24000.00000 10000.00000 10000.00000
S0643 XX 6000.00000 24000.00000 10000.00000 10000.00000
S0644 XX 7000.00000 24000.00000 10000.00000 10000.00000
S0645 XX 8000.00000 24000.00000 10000.00000 10000.00000
S0646 XX 9000.00000 24000.00000 10000.00000 10000.00000
S0647 XX 10000.00000 24000.00000 10000.00000 10000.00000
S0648 XX 11000.00000 24000.00000 10000.00000 10000.00000
S0649 XX 12000.00000 24000.00000 10000.00000 10000.00000
S0650 XX 13000.00000 24000.00000 10000.00000 10000.00000
S0651 XX 14000.00000 24000.00000 10000.00000 10000.00000
S0652 XX 15000.00000 24000.00000 10000.00000 10000.00000
S0653 XX 16000.00000 24000.00000 10000.00000 10000.00000
S0654 XX 17000.00000 24000.00000 10000.00000 10000.00000
S0655 XX 18000.00000 24000.00000 10000.00000 10000.00000
S0656 XX 19000.00000 24000.00000 10000.00000 10000.00000
S0657 XX 20000.00000 24000.00000 10000.00000 10000.00000
S0658 XX 21000.00000 24000.00000 10000.00000 10000.00000
S0659 XX 22000.00000 24000.00000 10000.00000 10000.00000
S0660 XX 23000.00000 24000.00000 10000.00000 10000.00000
S0661 XX 24000.00000 24000.00000 10000.00000 10000.00000
S0662 XX 25000.00000 24000.00000 10000.00000 10000.00000
S0663 XX 26000.00000 24000.00000 10000.00000 10000.00000
S0664 XX 27000.00000 24000.00000 10000.00000 10000.00000
S0665 XX 28000.00000 24000.00000 10000.00000 10000.00000
S0666 XX 29000.00000 24000.00000 10000.00000 10000.00000
S0667 XX 30000.00000 24000.00000 10000.00000 10000.00000
S0668 XX 2000.00000 25000.00000 10000.00000 10000.00000
S0669 XX 3000.00000 25000.00000 10000.00000 10000.00000
S0670 XX 4000.00000 25000.00000 10000.00000 10000.00000
S0671 XX 5000.00000 25000.00000 10000.00000 10000.00000
S0672 XX 6000.00000 25000.00000 10000.00000 10000.00000
S0673 XX 7000.00000 25000.00000 10000.00000 10000.00000
S0674 XX 8000.00000 25000.00000 10000.00000 10000.00000
S0675 XX 9000.00000 25000.00000 10000.00000 10000.00000
S0676 XX 10000.00000 25000.00000 10000.00000 10000.00000
S0677 XX 11000.00000 25000.00000 10000.00000 10000.00000
S0678 XX 12000.00000 25000.00000 10000.00000 10000.00000
S0679 XX 13000.00000 25000.00000 10000.00000 10000.00000
S0680 XX 14000.00000 25000.00000 10000.00000 10000.00000
S0681 XX 15000.00000 25000.00000 10000.00000 10000.00000
S0682 XX 16000.00000 25000.00000 10000.00000 10000.00000
S0683 XX 17000.00000 25000.00000 10000.00000 10000.00000
S0684 XX 18000.00000 25000.00000 10000.00000 10000.00000
S0685 XX 19000.00000 25000.00000 10000.00000 10000.00000
S0686 XX 20000.00000 25000.00000 10000.00000 10000.00000
S0687 XX 21000.00000 25000.00000 10000.00000 10000.00000
S0688 XX 22000.00000 25000.00000 10000.00000 10000.00000
S0689 XX 23000.00000 25000.00000 10000.00000 10000.00000
S0690 XX 24000.00000 25000.00000 10000.00000 10000.00000
S0691 XX 25000.00000 25000.00000 10000.00000 10000.00000
S0692 XX 26000.00000 25000.00000 10000.00000 10000.00000
S0693 XX 27000.00000 25000.00000 10000.00000 10000.00000
S0694 XX 28000.00000 25000.00000 10000.00000 10000.00000
S0695 XX 29000.00000 25000.00000 10000.00000 10000.00000
S0696 XX 30000.00000 25000.00000 10000.00000 10000.00000
S0697 XX 2000.00000 26000.00000 10000.00000 10000.00000
S0698 XX 3000.00000 26000.00000 10000.00000 10000.00000
S0699 XX 4000.00000 26000.00000 10000.00000 10000.00000
S0700 XX 5000.00000 26000.00000 10000.00000 10000.00000
S0701 XX 6000.00000 26000.00000 10000.00000 10000.00000
S0702 XX 7000.00000 26000.00000 10000.00000 10000.00000
S0703 XX 8000.00000 26000.00000 10000.00000 10000.00000
S0704 XX 9000.00000 26000.00000 10000.00000 10000.00000
S0705 XX 10000.00000 26000.00000 10000.00000 10000.00000
S0706 XX 11000.00000 26000.00000 10000.00000 10000.00000
S0707 XX 12000.00000 26000.00000 10000.00000 10000.00000
S0708 XX 13000.00000 26000.00000 10000.00000 10000.00000
S0709 XX 14000.00000 26000.00000 10000.00000 10000.00000
S0710 XX 15000.00000 26000.00000 10000.00000 10000.00000
S0711 XX 16000.00000 26000.00000 10000.00000 10000.00000
S0712 XX 17000.00000 26000.00000 10000.00000 10000.00000
S0713 XX 18000.00000 26000.00000 10000.00000 10000.00000
S0714 XX 19000.00000 26000.00000 10000.00000 10000.00000
S0715 XX 20000.00000 26000.00000 10000.00000 10000.00000
S0716 XX 21000.00000 26000.00000 10000.00000 10000.00000
S0717 XX 22000.00000 26000.00000 10000.00000 10000.00000
S0718 XX 23000.00000 26000.00000 10000.00000 10000.00000
S0719 XX 24000.00000 26000.00000 10000.00000 10000.00000
S0720 XX 25000.00000 26000.00000 10000.00000 10000.00000
S0721 XX 26000.00000 26000.00000 10000.00000 10000.00000
S0722 XX 27000.00000 26000.00000 10000.00000 10000.00000
S0723 XX 28000.00000 26000.00000 10000.00000 10000.00000
S0724 XX 29000.00000 26000.00000 10000.00000 10000.00000
S0725 XX 30000.00000 26000.00000 10000.00000 10000.00000
S0726 XX 2000.00000 27000.00000 10000.00000 10000.00000
S0727 XX 3000.00000 27000.00000 10000.00000 10000.00000
S0728 XX 4000.00000 27000.00000 10000.00000 10000.00000
S0729 XX 5000.00000 27000.00000 10000.00000 10000.00000
S0730 XX 6000.00000 27000.00000 10000.00000 10000.00000
S0731 XX 7000.00000 27000.00000 10000.00000 10000.00000
S0732 XX 8000.00000 27000.00000 10000.00000 10000.00000
S0733 XX 9000.00000 27000.00000 10000.00000 10000.00000
S0734 XX 10000.00000 27000.00000 10000.00000 10000.00000
S0735 XX 11000.00000 27000.00000 10000.00000 10000.00000
S0736 XX 12000.00000 27000.00000 10000.00000 10000.00000
S0737 XX 13000.00000 27000.00000 10000.00000 10000.00000
S0738 XX 14000.00000 27000.00000 10000.00000 10000.00000
S0739 XX 15000.00000 27000.00000 10000.00000 10000.00000
S0740 XX 16000.00000 27000.00000 10000.00000 10000.00000
S0741 XX 17000.00000 27000.00000 10000.00000 10000.00000
S0742 XX 18000.00000 27000.00000 10000.00000 10000.00000
S0743 XX 19000.00000 27000.00000 10000.00000 10000.00000
S0744 XX 20000.00000 27000.00000 10000.00000 10000.00000
S0745 XX 21000.00000 27000.00000 10000.00000 10000.00000
S0746 XX 22000.00000 27000.00000 10000.00000 10000.00000
S0747 XX 23000.00000 27000.00000 10000.00000 10000.00000
S0748 XX 24000.00000 27000.00000 10000.00000 10000.00000
S0749 XX 25000.00000 27000.00000 10000.00000 10000.00000
S0750 XX 26000.00000 27000.00000 10000.00000 10000.00000
S0751 XX 27000.00000 27000.00000 10000.00000 10000.00000
S0752 XX 28000.00000 27000.00000 10000.00000 10000.00000
S0753 XX 29000.00000 27000.00000 10000.00000 10000.00000
S0754 XX 30000.00000 27000.00000 10000.00000 10000.00000
S0755 XX 2000.00000 28000.00000 10000.00000 10000.00000
S0756 XX 3000.00000 28000.00000 10000.00000 10000.00000
S0757 XX 4000.00000 28000.00000 10000.00000 10000.00000
S0758 XX 5000.00000 28000.00000 10000.00000 10000.00000
S0759 XX 6000.00000 28000.00000 10000.00000 10000.00000
S0760 XX 7000.00000 28000.00000 10000.00000 10000.00000
S0761 XX 8000.00000 28000.00000 10000.00000 10000.00000
S0762 XX 9000.00000 28000.00000 10000.00000 10000.00000
S0763 XX 10000.00000 28000.00000 10000.00000 10000.00000
S0764 XX 11000.00000 28000.00000 10000.00000 10000.00000
S0765 XX 12000.00000 28000.00000 10000.00000 10000.00000
S0766 XX 13000.00000 28000.00000 10000.00000 10000.00000
S0767 XX 14000.00000 28000.00000 10000.00000 10000.00000
S0768 XX 15000.00000 28000.00000 10000.00000 10000.00000
S0769 XX 16000.00000 28000.00000 10000.00000 10000.00000
S0770 XX 17000.00000 28000.00000 10000.00000 10000.00000
S0771 XX 18000.00000 28000.00000 10000.00000 10000.00000
S0772 XX 19000.00000 28000.00000 10000.00000 10000.00000
S0773 XX 20000.00000 28000.00000 10000.00000 10000.00000
S0774 XX 21000.00000 28000.00000 10000.00000 10000.00000
S0775 XX 22000.00000 28000.00000 10000.00000 10000.00000
S0776 XX 23000.00000 28000.00000 10000.00000 10000.00000
S0777 XX 24000.00000 28000.00000 10000.00000 10000.00000
S0778 XX 25000.00000 28000.00000 10000.00000 10000.00000
S0779 XX 26000.00000 28000.00000 10000.00000 10000.00000
S0780 XX 27000.00000 28000.00000 10000.00000 10000.00000
S0781 XX 28000.00000 28000.00000 10000.00000 10000.00000
S0782 XX 29000.00000 28000.00000 10000.00000 10000.00000
S0783 XX 30000.00000 28000.00000 10000.00000 10000.00000
S0784 XX 2000.00000 29000.00000 10000.00000 10000.00000
S0785 XX 3000.00000 29000.00000 10000.00000 10000.00000
S0786 XX 4000.00000 29000.00000 10000.00000 10000.00000
S0787 XX 5000.00000 29000.00000 10000.00000 10000.00000
S0788 XX 6000.00000 29000.00000 10000.00000 10000.00000
S0789 XX 7000.00000 29000.00000 10000.00000 10000.00000
S0790 XX 8000.00000 29000.00000 10000.00000 10000.00000
S0791 XX 9000.00000 29000.00000 10000.00000 10000.00000
S0792 XX 10000.00000 29000.00000 10000.00000 10000.00000
S0793 XX 11000.00000 29000.00000 10000.00000 10000.00000
S0794 XX 12000.00000 29000.00000 10000.00000 10000.00000
S0795 XX 13000.00000 29000.00000 10000.00000 10000.00000
S0796 XX 14000.00000 29000.00000 10000.00000 10000.00000
S0797 XX 15000.00000 29000.00000 10000.00000 10000.00000
S0798 XX 16000.00000 29000.00000 10000.00000 10000.00000
S0799 XX 17000.00000 29000.00000 10000.00000 10000.00000
S0800 XX 18000.00000 29000.00000 10000.00000 10000.00000
S0801 XX 19000.00000 29000.00000 10000.00000 10000.00000
S0802 XX 20000.00000 29000.00000 10000.00000 10000.00000
S0803 XX 21000.00000 29000.00000 10000.00000 10000.00000
S0804 XX 22000.00000 29000.00000 10000.00000 10000.00000
S0805 XX 23000.00000 29000.00000 10000.00000 10000.00000
S0806 XX 24000.00000 29000.00000 10000.00000 10000.00000
S0807 XX 25000.00000 29000.00000 10000.00000 10000.00000
S0808 XX 26000.00000 29000.00000 10000.00000 10000.00000
S0809 XX 27000.00000 29000.00000 10000.00000 10000.00000
S0810 XX 28000.00000 29000.00000 10000.00000 10000.00000
S0811 XX 29000.00000 29000.00000 10000.00000 10000.00000
S0812 XX 30000.00000 29000.00000 10000.00000 10000.00000
S0813 XX 2000.00000 30000.00000 10000.00000 10000.00000
S0814 XX 3000.00000 30000.00000 10000.00000 10000.00000
S0815 XX 4000.00000 30000.00000 10000.00000 10000.00000
S0816 XX 5000.00000 30000.00000 10000.00000 10000.00000
S0817 XX 6000.00000 30000.00000 10000.00000 10000.00000
S0818 XX 7000.00000 30000.00000 10000.00000 10000.00000
S0819 XX 8000.00000 30000.00000 10000.00000 10000.00000
S0820 XX 9000.00000 30000.00000 10000.00000 10000.00000
S0821 XX 10000.00000 30000.00000 10000.00000 10000.00000
S0822 XX 11000.00000 30000.00000 10000.00000 10000.00000
S0823 XX 12000.00000 30000.00000 10000.00000 10000.00000
S0824 XX 13000.00000 30000.00000 10000.00000 10000.00000
S0825 XX 14000.00000 30000.00000 10000.00000 10000.00000
S0826 XX 15000.00000 30000.00000 10000.00000 10000.00000
S0827 XX 16000.00000 30000.00000 10000.00000 10000.00000
S0828 XX 17000.00000 30000.00000 10000.00000 10000.00000
S0829 XX 18000.00000 30000.00000 10000.00000 10000.00000
S0830 XX 19000.00000 30000.00000 10000.00000 10000.00000
S0831 XX 20000.00000 30000.00000 10000.00000 10000.00000
S0832 XX 21000.00000 30000.00000 10000.00000 10000.00000
S0833 XX 22000.00000 30000.00000 10000.00000 10000.00000
S0834 XX 23000.00000 30000.00000 10000.00000 10000.00000
S0835 XX 24000.00000 30000.00000 10000.00000 10000.00000
S0836 XX 25000.00000 30000.00000 10000.00000 10000.00000
S0837 XX 26000.00000 30000.00000 10000.00000 10000.00000
S0838 XX 27000.00000 30000.00000 10000.00000 10000.00000
S0839 XX 28000.00000 30000.00000 10000.00000 10000.00000
S0840 XX 29000.00000 30000.00000 10000.00000 10000.00000
S0841 XX 30000.00000 30000.00000 10000.00000 10000.00000
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0"?>
<!--
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.
-->
<reposinfo>
<latest>./hdp.json</latest>
<os family="centos6">
<repo>
<baseurl>http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.2.0.0</baseurl>
<repoid>HDP-2.2.0</repoid>
<reponame>HDP</reponame>
<unique>true</unique>
</repo>
</os>
<os family="centos5">
<repo>
<baseurl>http://public-repo-1.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0</baseurl>
<repoid>HDP-2.2.0</repoid>
<reponame>HDP</reponame>
<unique>true</unique>
</repo>
</os>
<os family="redhat6">
<repo>
<baseurl>http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.2.0.0</baseurl>
<repoid>HDP-2.2.0</repoid>
<reponame>HDP</reponame>
<unique>true</unique>
</repo>
</os>
<os family="redhat5">
<repo>
<baseurl>http://public-repo-1.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0</baseurl>
<repoid>HDP-2.2.0</repoid>
<reponame>HDP</reponame>
<unique>true</unique>
</repo>
</os>
<os family="suse11">
<repo>
<baseurl>http://public-repo-1.hortonworks.com/HDP/suse11/2.x/updates/2.2.0.0</baseurl>
<repoid>HDP-2.2.0</repoid>
<reponame>HDP</reponame>
<unique>true</unique>
</repo>
</os>
<os family="sles11">
<repo>
<baseurl>http://public-repo-1.hortonworks.com/HDP/suse11/2.x/updates/2.2.0.0</baseurl>
<repoid>HDP-2.2.0</repoid>
<reponame>HDP</reponame>
<unique>true</unique>
</repo>
</os>
</reposinfo>
|
{
"pile_set_name": "Github"
}
|
# -*- coding: utf-8 -*-
#
# BitcoinLib - Python Cryptocurrency Library
# Cache DataBase - SqlAlchemy database definitions for caching
# © 2020 February - 1200 Web Development <http://1200wd.com/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
try:
import enum
except ImportError:
import enum34 as enum
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, BigInteger, String, Boolean, ForeignKey, DateTime, Numeric, Text, LargeBinary
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from bitcoinlib.main import *
_logger = logging.getLogger(__name__)
_logger.info("Using Cache Database %s" % DEFAULT_DATABASE_CACHE)
Base = declarative_base()
class DbInit:
"""
Initialize database and open session
Create new database if is doesn't exist yet
"""
def __init__(self, db_uri=None):
self.engine = None
self.session = None
if db_uri is None:
db_uri = DEFAULT_DATABASE_CACHE
elif not db_uri:
return
o = urlparse(db_uri)
if not o.scheme or len(o.scheme) < 2:
db_uri = 'sqlite:///%s' % db_uri
if db_uri.startswith("sqlite://") and ALLOW_DATABASE_THREADS:
if "?" in db_uri:
db_uri += "&"
else:
db_uri += "?"
db_uri += "check_same_thread=False"
self.engine = create_engine(db_uri, isolation_level='READ UNCOMMITTED')
Session = sessionmaker(bind=self.engine)
Base.metadata.create_all(self.engine)
self.session = Session()
class DbCacheTransactionNode(Base):
"""
Link table for cache transactions and addresses
"""
__tablename__ = 'cache_transactions_node'
txid = Column(String(64), ForeignKey('cache_transactions.txid'), primary_key=True)
transaction = relationship("DbCacheTransaction", back_populates='nodes', doc="Related transaction object")
# TODO: Add fields to allow to create full transaction (+ split input / output?)
# index_n = Column(BigInteger, primary_key=True,
# doc="Output_n of previous transaction output that is spent in this input")
# prev_hash = Column(String(64),
# doc="Transaction hash of previous transaction. Previous unspent outputs (UTXO) is spent "
# "in this input")
output_n = Column(BigInteger, primary_key=True,
doc="Output_n of previous transaction output that is spent in this input")
value = Column(Numeric(25, 0, asdecimal=False), default=0, doc="Value of transaction input")
is_input = Column(Boolean, primary_key=True, doc="True if input, False if output")
address = Column(String(255), doc="Address string base32 or base58 encoded", index=True)
# script = Column(Text, doc="Unlocking script to unlock previous locked output")
# sequence = Column(BigInteger, doc="Transaction sequence number. Used for timelock transaction inputs")
spent = Column(Boolean, default=None, doc="Is output spent?")
spending_txid = Column(String(64), doc="Transaction hash of input which spends this output")
spending_index_n = Column(Integer, doc="Index number of transaction input which spends this output")
class DbCacheTransaction(Base):
"""
Transaction Cache Table
Database which stores transactions received from service providers as cache
"""
__tablename__ = 'cache_transactions'
txid = Column(String(64), primary_key=True, doc="Hexadecimal representation of transaction hash or transaction ID")
date = Column(DateTime, default=datetime.utcnow,
doc="Date when transaction was confirmed and included in a block. "
"Or when it was created when transaction is not send or confirmed")
# TODO: Add fields to allow to create full transaction
# witness_type = Column(String(20), default='legacy', doc="Is this a legacy or segwit transaction?")
# version = Column(Integer, default=1,
# doc="Tranaction version. Default is 1 but some wallets use another version number")
# locktime = Column(Integer, default=0,
# doc="Transaction level locktime. Locks the transaction until a specified block "
# "(value from 1 to 5 million) or until a certain time (Timestamp in seconds after 1-jan-1970)."
# " Default value is 0 for transactions without locktime")
# coinbase = Column(Boolean, default=False, doc="Is True when this is a coinbase transaction, default is False")
confirmations = Column(Integer, default=0,
doc="Number of confirmation when this transaction is included in a block. "
"Default is 0: unconfirmed")
block_height = Column(Integer, index=True, doc="Height of block this transaction is included in")
block_hash = Column(String(64), index=True, doc="Hash of block this transaction is included in") # TODO: Remove, is redundant
network_name = Column(String(20), doc="Blockchain network name of this transaction")
fee = Column(BigInteger, doc="Transaction fee")
raw = Column(Text(),
doc="Raw transaction hexadecimal string. Transaction is included in raw format on the blockchain")
nodes = relationship("DbCacheTransactionNode", cascade="all,delete",
doc="List of all inputs and outputs as DbCacheTransactionNode objects")
order_n = Column(Integer, doc="Order of transaction in block")
class DbCacheAddress(Base):
"""
Address Cache Table
Stores transactions and unspent outputs (UTXO's) per address
"""
__tablename__ = 'cache_address'
address = Column(String(255), primary_key=True, doc="Address string base32 or base58 encoded")
network_name = Column(String(20), doc="Blockchain network name of this transaction")
balance = Column(Numeric(25, 0, asdecimal=False), default=0, doc="Total balance of UTXO's linked to this key")
last_block = Column(Integer, doc="Number of last updated block")
last_txid = Column(String(64), doc="Transaction ID of latest transaction in cache")
n_utxos = Column(Integer, doc="Total number of UTXO's for this address")
n_txs = Column(Integer, doc="Total number of transactions for this address")
class DbCacheBlock(Base):
"""
Block Cache Table
Stores block headers
"""
__tablename__ = 'cache_blocks'
height = Column(Integer, primary_key=True, doc="Height or sequence number for this block")
block_hash = Column(LargeBinary(32), index=True, doc="Hash of this block")
network_name = Column(String(20), doc="Blockchain network name")
version = Column(BigInteger, doc="Block version to specify which features are used (hex)")
prev_block = Column(LargeBinary(32), doc="Block hash of previous block")
merkle_root = Column(LargeBinary(32), doc="Merkle root used to validate transaction in block")
time = Column(BigInteger, doc="Timestamp to indicated when block was created")
bits = Column(BigInteger, doc="Encoding for proof-of-work, used to determine target and difficulty")
nonce = Column(BigInteger, doc="Nonce (number used only once or n-once) is used to create different block hashes")
tx_count = Column(Integer, doc="Number of transactions included in this block")
class DbCacheVars(Base):
"""
Table to store various blockchain related variables
"""
__tablename__ = 'cache_variables'
varname = Column(String(50), primary_key=True, doc="Variable unique name")
network_name = Column(String(20), primary_key=True, doc="Blockchain network name of this transaction")
value = Column(String(255), doc="Value of variable")
type = Column(String(20), doc="Type of variable: int, string or float")
expires = Column(DateTime, doc="Datetime value when variable expires")
if __name__ == '__main__':
DbInit()
|
{
"pile_set_name": "Github"
}
|
*******************************************************
Freescale i.MX6Q and i.MX6DL SABRESD development boards
*******************************************************
This file documents the Buildroot support for the Freescale SABRE Board for
Smart Devices Based on the i.MX 6 Series (SABRESD).
Read the SABRESD Quick Start Guide for an introduction to the board:
http://cache.freescale.com/files/32bit/doc/quick_start_guide/SABRESDB_IMX6_QSG.pdf
Build
=====
First, configure Buildroot for your SABRESD board.
For i.MX6Q:
make freescale_imx6qsabresd_defconfig
For i.MX6DL:
make freescale_imx6dlsabresd_defconfig
Build all components:
make
You will find in ./output/images/ the following files:
- imx6dl-sabresd.dtb or imx6q-sabresd.dtb
- rootfs.ext2
- rootfs.tar
- u-boot.imx
- uImage
Create a bootable SD card
=========================
To determine the device associated to the SD card have a look in the
/proc/partitions file:
cat /proc/partitions
Run the following script as root on your SD card. This will partition the card
and copy the bootloader, kernel, DTBs and root filesystem as needed.
*** WARNING! The script will destroy all the card content. Use with care! ***
./board/freescale/imx6sabresd/create-boot-sd.sh <your-sd-device>
Boot the SABRESD board
======================
To boot your newly created system (refer to the SABRESD Quick Start Guide for
guidance):
- insert the SD card in the SD3 slot of the board;
- locate the BOOT dip switches (SW6), set dips 2 and 7 to ON, all others to OFF;
- connect a Micro USB cable to Debug Port and connect using a terminal emulator
at 115200 bps, 8n1;
- power on the board.
Enjoy!
References
==========
https://community.freescale.com/docs/DOC-95015
https://community.freescale.com/docs/DOC-95017
https://community.freescale.com/docs/DOC-99218
|
{
"pile_set_name": "Github"
}
|
require('../../modules/es6.array.fill');
module.exports = require('../../modules/_core').Array.fill;
|
{
"pile_set_name": "Github"
}
|
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_ALGORITHMS_PERIMETER_HPP
#define BOOST_GEOMETRY_ALGORITHMS_PERIMETER_HPP
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/core/closure.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/strategies/default_length_result.hpp>
#include <boost/geometry/algorithms/length.hpp>
#include <boost/geometry/algorithms/detail/calculate_null.hpp>
#include <boost/geometry/algorithms/detail/calculate_sum.hpp>
// #include <boost/geometry/algorithms/detail/throw_on_empty_input.hpp>
namespace boost { namespace geometry
{
#ifndef DOXYGEN_NO_DISPATCH
namespace dispatch
{
// Default perimeter is 0.0, specializations implement calculated values
template <typename Tag, typename Geometry, typename Strategy>
struct perimeter : detail::calculate_null
<
typename default_length_result<Geometry>::type,
Geometry,
Strategy
>
{};
template <typename Geometry, typename Strategy>
struct perimeter<ring_tag, Geometry, Strategy>
: detail::length::range_length
<
Geometry,
Strategy,
closure<Geometry>::value
>
{};
template <typename Polygon, typename Strategy>
struct perimeter<polygon_tag, Polygon, Strategy>
: detail::calculate_polygon_sum
<
typename default_length_result<Polygon>::type,
Polygon,
Strategy,
detail::length::range_length
<
typename ring_type<Polygon>::type,
Strategy,
closure<Polygon>::value
>
>
{};
// box,n-sphere: to be implemented
} // namespace dispatch
#endif // DOXYGEN_NO_DISPATCH
/*!
\brief \brief_calc{perimeter}
\ingroup perimeter
\details The function perimeter returns the perimeter of a geometry,
using the default distance-calculation-strategy
\tparam Geometry \tparam_geometry
\param geometry \param_geometry
\return \return_calc{perimeter}
\qbk{[include reference/algorithms/perimeter.qbk]}
*/
template<typename Geometry>
inline typename default_length_result<Geometry>::type perimeter(
Geometry const& geometry)
{
concept::check<Geometry const>();
typedef typename point_type<Geometry>::type point_type;
typedef typename strategy::distance::services::default_strategy
<
point_tag, point_type
>::type strategy_type;
// detail::throw_on_empty_input(geometry);
return dispatch::perimeter
<
typename tag<Geometry>::type,
Geometry,
strategy_type
>::apply(geometry, strategy_type());
}
/*!
\brief \brief_calc{perimeter} \brief_strategy
\ingroup perimeter
\details The function perimeter returns the perimeter of a geometry,
using specified strategy
\tparam Geometry \tparam_geometry
\tparam Strategy \tparam_strategy{distance}
\param geometry \param_geometry
\param strategy strategy to be used for distance calculations.
\return \return_calc{perimeter}
\qbk{distinguish,with strategy}
\qbk{[include reference/algorithms/perimeter.qbk]}
*/
template<typename Geometry, typename Strategy>
inline typename default_length_result<Geometry>::type perimeter(
Geometry const& geometry, Strategy const& strategy)
{
concept::check<Geometry const>();
// detail::throw_on_empty_input(geometry);
return dispatch::perimeter
<
typename tag<Geometry>::type,
Geometry,
Strategy
>::apply(geometry, strategy);
}
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_ALGORITHMS_PERIMETER_HPP
|
{
"pile_set_name": "Github"
}
|
<html>
<body>
JSR303 Bean Validation相关工具类,当然JSR303主要实现是Hibernate Validator
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
{
"name": "@datafire/wmata_rail_station",
"version": "5.0.0",
"main": "index.js",
"description": "DataFire integration for Rail Station Information",
"repository": {
"type": "git",
"url": "git+https://github.com/DataFire/integrations.git"
},
"author": "DataFire",
"license": "MIT",
"bugs": {
"url": "https://github.com/DataFire/integrations/issues"
},
"homepage": "https://github.com/DataFire/integrations#readme",
"datafire": {
"origin": "https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/swagger.json",
"type": "openapi"
},
"peerDependencies": {
"datafire": "^2.0.0"
},
"dependencies": {
"datafire": "^2.0.0"
}
}
|
{
"pile_set_name": "Github"
}
|
/*******************************************************************************
* Copyright © 2016 NFine.Framework 版权所有
* Author: NFine
* Description: NFine快速开发平台
* Website:http://www.nfine.cn
*********************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
namespace NFine.Code
{
public static partial class Ext
{
#region 数值转换
/// <summary>
/// 转换为整型
/// </summary>
/// <param name="data">数据</param>
public static int ToInt(this object data)
{
if (data == null)
return 0;
int result;
var success = int.TryParse(data.ToString(), out result);
if (success)
return result;
try
{
return Convert.ToInt32(ToDouble(data, 0));
}
catch (Exception)
{
return 0;
}
}
/// <summary>
/// 转换为可空整型
/// </summary>
/// <param name="data">数据</param>
public static int? ToIntOrNull(this object data)
{
if (data == null)
return null;
int result;
bool isValid = int.TryParse(data.ToString(), out result);
if (isValid)
return result;
return null;
}
/// <summary>
/// 转换为双精度浮点数
/// </summary>
/// <param name="data">数据</param>
public static double ToDouble(this object data)
{
if (data == null)
return 0;
double result;
return double.TryParse(data.ToString(), out result) ? result : 0;
}
/// <summary>
/// 转换为双精度浮点数,并按指定的小数位4舍5入
/// </summary>
/// <param name="data">数据</param>
/// <param name="digits">小数位数</param>
public static double ToDouble(this object data, int digits)
{
return Math.Round(ToDouble(data), digits);
}
/// <summary>
/// 转换为可空双精度浮点数
/// </summary>
/// <param name="data">数据</param>
public static double? ToDoubleOrNull(this object data)
{
if (data == null)
return null;
double result;
bool isValid = double.TryParse(data.ToString(), out result);
if (isValid)
return result;
return null;
}
/// <summary>
/// 转换为高精度浮点数
/// </summary>
/// <param name="data">数据</param>
public static decimal ToDecimal(this object data)
{
if (data == null)
return 0;
decimal result;
return decimal.TryParse(data.ToString(), out result) ? result : 0;
}
/// <summary>
/// 转换为高精度浮点数,并按指定的小数位4舍5入
/// </summary>
/// <param name="data">数据</param>
/// <param name="digits">小数位数</param>
public static decimal ToDecimal(this object data, int digits)
{
return Math.Round(ToDecimal(data), digits);
}
/// <summary>
/// 转换为可空高精度浮点数
/// </summary>
/// <param name="data">数据</param>
public static decimal? ToDecimalOrNull(this object data)
{
if (data == null)
return null;
decimal result;
bool isValid = decimal.TryParse(data.ToString(), out result);
if (isValid)
return result;
return null;
}
/// <summary>
/// 转换为可空高精度浮点数,并按指定的小数位4舍5入
/// </summary>
/// <param name="data">数据</param>
/// <param name="digits">小数位数</param>
public static decimal? ToDecimalOrNull(this object data, int digits)
{
var result = ToDecimalOrNull(data);
if (result == null)
return null;
return Math.Round(result.Value, digits);
}
#endregion
#region 日期转换
/// <summary>
/// 转换为日期
/// </summary>
/// <param name="data">数据</param>
public static DateTime ToDate(this object data)
{
if (data == null)
return DateTime.MinValue;
DateTime result;
return DateTime.TryParse(data.ToString(), out result) ? result : DateTime.MinValue;
}
/// <summary>
/// 转换为可空日期
/// </summary>
/// <param name="data">数据</param>
public static DateTime? ToDateOrNull(this object data)
{
if (data == null)
return null;
DateTime result;
bool isValid = DateTime.TryParse(data.ToString(), out result);
if (isValid)
return result;
return null;
}
#endregion
#region 布尔转换
/// <summary>
/// 转换为布尔值
/// </summary>
/// <param name="data">数据</param>
public static bool ToBool(this object data)
{
if (data == null)
return false;
bool? value = GetBool(data);
if (value != null)
return value.Value;
bool result;
return bool.TryParse(data.ToString(), out result) && result;
}
/// <summary>
/// 获取布尔值
/// </summary>
private static bool? GetBool(this object data)
{
switch (data.ToString().Trim().ToLower())
{
case "0":
return false;
case "1":
return true;
case "是":
return true;
case "否":
return false;
case "yes":
return true;
case "no":
return false;
default:
return null;
}
}
/// <summary>
/// 转换为可空布尔值
/// </summary>
/// <param name="data">数据</param>
public static bool? ToBoolOrNull(this object data)
{
if (data == null)
return null;
bool? value = GetBool(data);
if (value != null)
return value.Value;
bool result;
bool isValid = bool.TryParse(data.ToString(), out result);
if (isValid)
return result;
return null;
}
#endregion
#region 字符串转换
/// <summary>
/// 转换为字符串
/// </summary>
/// <param name="data">数据</param>
public static string ToString(this object data)
{
return data == null ? string.Empty : data.ToString().Trim();
}
#endregion
/// <summary>
/// 安全返回值
/// </summary>
/// <param name="value">可空值</param>
public static T SafeValue<T>(this T? value) where T : struct
{
return value ?? default(T);
}
/// <summary>
/// 是否为空
/// </summary>
/// <param name="value">值</param>
public static bool IsEmpty(this string value)
{
return string.IsNullOrWhiteSpace(value);
}
/// <summary>
/// 是否为空
/// </summary>
/// <param name="value">值</param>
public static bool IsEmpty(this Guid? value)
{
if (value == null)
return true;
return IsEmpty(value.Value);
}
/// <summary>
/// 是否为空
/// </summary>
/// <param name="value">值</param>
public static bool IsEmpty(this Guid value)
{
if (value == Guid.Empty)
return true;
return false;
}
/// <summary>
/// 是否为空
/// </summary>
/// <param name="value">值</param>
public static bool IsEmpty(this object value)
{
if (value != null && !string.IsNullOrEmpty(value.ToString()))
{
return false;
}
else
{
return true;
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
/* Copyright 2017 R. Thomas
* Copyright 2017 Quarkslab
*
* 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.
*/
#include "LIEF/DEX/hash.hpp"
#include "LIEF/DEX.hpp"
namespace LIEF {
namespace DEX {
Hash::~Hash(void) = default;
size_t Hash::hash(const Object& obj) {
return LIEF::Hash::hash<LIEF::DEX::Hash>(obj);
}
void Hash::visit(const File& file) {
this->process(file.location());
this->process(file.header());
this->process(std::begin(file.classes()), std::end(file.classes()));
this->process(std::begin(file.methods()), std::end(file.methods()));
this->process(std::begin(file.strings()), std::end(file.strings()));
}
void Hash::visit(const Header& header) {
this->process(header.magic());
this->process(header.checksum());
this->process(header.signature());
this->process(header.file_size());
this->process(header.header_size());
this->process(header.endian_tag());
this->process(header.strings());
this->process(header.link());
this->process(header.types());
this->process(header.prototypes());
this->process(header.fields());
this->process(header.methods());
this->process(header.classes());
this->process(header.data());
}
void Hash::visit(const CodeInfo& /*code_info*/) {
}
void Hash::visit(const Class& cls) {
it_const_methods methods = cls.methods();
this->process(cls.fullname());
this->process(cls.source_filename());
this->process(cls.access_flags());
this->process(std::begin(methods), std::end(methods));
}
void Hash::visit(const Method& method) {
this->process(method.name());
this->process(method.bytecode());
this->process(method.prototype());
}
void Hash::visit(const Type& type) {
switch (type.type()) {
case Type::TYPES::ARRAY:
{
this->process(type.dim());
this->process(type.underlying_array_type());
break;
}
case Type::TYPES::PRIMITIVE:
{
this->process(type.primitive());
break;
}
case Type::TYPES::CLASS:
{
this->process(type.cls().fullname());
break;
}
case Type::TYPES::UNKNOWN:
default:
{
this->process(Type::TYPES::UNKNOWN);
}
}
}
void Hash::visit(const Prototype& type) {
this->process(type.return_type());
this->process(
std::begin(type.parameters_type()),
std::end(type.parameters_type()));
}
void Hash::visit(const MapItem& item) {
this->process(item.size());
this->process(item.offset());
this->process(item.reserved());
this->process(item.type());
}
void Hash::visit(const MapList& list) {
this->process(std::begin(list.items()), std::end(list.items()));
}
} // namespace DEX
} // namespace LIEF
|
{
"pile_set_name": "Github"
}
|
# Copyright 2007 The Apache Software Foundation
#
# 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.
# Set environment variables here.
# This script sets variables multiple times over the course of starting an hbase process,
# so try to keep things idempotent unless you want to take an even deeper look
# into the startup scripts (bin/hbase, etc.)
# The java implementation to use. Java 1.6 required.
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
# Extra Java CLASSPATH elements. Optional.
# export HBASE_CLASSPATH=
# The maximum amount of heap to use, in MB. Default is 1000.
# export HBASE_HEAPSIZE=1000
# Extra Java runtime options.
# Below are what we set by default. May only work with SUN JVM.
# For more on why as well as other possible settings,
# see http://wiki.apache.org/hadoop/PerformanceTuning
export HBASE_OPTS="-XX:+UseConcMarkSweepGC"
# Uncomment one of the below three options to enable java garbage collection logging for the server-side processes.
# This enables basic gc logging to the .out file.
# export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps"
# This enables basic gc logging to its own file.
# If FILE-PATH is not replaced, the log file(.gc) would still be generated in the HBASE_LOG_DIR .
# export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<FILE-PATH>"
# This enables basic GC logging to its own file with automatic log rolling. Only applies to jdk 1.6.0_34+ and 1.7.0_2+.
# If FILE-PATH is not replaced, the log file(.gc) would still be generated in the HBASE_LOG_DIR .
# export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<FILE-PATH> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=512M"
# Uncomment one of the below three options to enable java garbage collection logging for the client processes.
# This enables basic gc logging to the .out file.
# export CLIENT_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps"
# This enables basic gc logging to its own file.
# If FILE-PATH is not replaced, the log file(.gc) would still be generated in the HBASE_LOG_DIR .
# export CLIENT_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<FILE-PATH>"
# This enables basic GC logging to its own file with automatic log rolling. Only applies to jdk 1.6.0_34+ and 1.7.0_2+.
# If FILE-PATH is not replaced, the log file(.gc) would still be generated in the HBASE_LOG_DIR .
# export CLIENT_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<FILE-PATH> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=512M"
# Uncomment below if you intend to use the EXPERIMENTAL off heap cache.
# export HBASE_OPTS="$HBASE_OPTS -XX:MaxDirectMemorySize="
# Set hbase.offheapcache.percentage in hbase-site.xml to a nonzero value.
# Uncomment and adjust to enable JMX exporting
# See jmxremote.password and jmxremote.access in $JRE_HOME/lib/management to configure remote password access.
# More details at: http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html
# NOTE: HBase provides an alternative JMX implementation to fix the random ports issue, please see JMX
# section in HBase Reference Guide for instructions.
# export HBASE_JMX_BASE="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
# export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10101"
# export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10102"
# export HBASE_THRIFT_OPTS="$HBASE_THRIFT_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10103"
# export HBASE_ZOOKEEPER_OPTS="$HBASE_ZOOKEEPER_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10104"
# export HBASE_REST_OPTS="$HBASE_REST_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10105"
# File naming hosts on which HRegionServers will run. $HBASE_HOME/conf/regionservers by default.
# export HBASE_REGIONSERVERS=${HBASE_HOME}/conf/regionservers
# Uncomment and adjust to keep all the Region Server pages mapped to be memory resident
#HBASE_REGIONSERVER_MLOCK=true
#HBASE_REGIONSERVER_UID="hbase"
# File naming hosts on which backup HMaster will run. $HBASE_HOME/conf/backup-masters by default.
# export HBASE_BACKUP_MASTERS=${HBASE_HOME}/conf/backup-masters
# Extra ssh options. Empty by default.
# export HBASE_SSH_OPTS="-o ConnectTimeout=1 -o SendEnv=HBASE_CONF_DIR"
# Where log files are stored. $HBASE_HOME/logs by default.
# export HBASE_LOG_DIR=${HBASE_HOME}/logs
# Enable remote JDWP debugging of major HBase processes. Meant for Core Developers
# export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8070"
# export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8071"
# export HBASE_THRIFT_OPTS="$HBASE_THRIFT_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8072"
# export HBASE_ZOOKEEPER_OPTS="$HBASE_ZOOKEEPER_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8073"
# A string representing this instance of hbase. $USER by default.
# export HBASE_IDENT_STRING=$USER
# The scheduling priority for daemon processes. See 'man nice'.
# export HBASE_NICENESS=10
# The directory where pid files are stored. /tmp by default.
# export HBASE_PID_DIR=/var/hadoop/pids
# Seconds to sleep between slave commands. Unset by default. This
# can be useful in large clusters, where, e.g., slave rsyncs can
# otherwise arrive faster than the master can service them.
# export HBASE_SLAVE_SLEEP=0.1
# Tell HBase whether it should manage it's own instance of Zookeeper or not.
# export HBASE_MANAGES_ZK=true
# The default log rolling policy is RFA, where the log file is rolled as per the size defined for the
# RFA appender. Please refer to the log4j.properties file to see more details on this appender.
# In case one needs to do log rolling on a date change, one should set the environment property
# HBASE_ROOT_LOGGER to "<DESIRED_LOG LEVEL>,DRFA".
# For example:
# HBASE_ROOT_LOGGER=INFO,DRFA
# The reason for changing default to RFA is to avoid the boundary case of filling out disk space as
# DRFA doesn't put any cap on the log size. Please refer to HBase-5655 for more context.
|
{
"pile_set_name": "Github"
}
|
// Copyright 2009 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 386,darwin
package unix
import (
"syscall"
)
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
func setTimespec(sec, nsec int64) Timespec {
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
}
func setTimeval(sec, usec int64) Timeval {
return Timeval{Sec: int32(sec), Usec: int32(usec)}
}
func SetKevent(k *Kevent_t, fd, mode, flags int) {
k.Ident = uint32(fd)
k.Filter = int16(mode)
k.Flags = uint16(flags)
}
func (iov *Iovec) SetLen(length int) {
iov.Len = uint32(length)
}
func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
func (msghdr *Msghdr) SetIovlen(length int) {
msghdr.Iovlen = int32(length)
}
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
// of darwin/386 the syscall is called sysctl instead of __sysctl.
const SYS___SYSCTL = SYS_SYSCTL
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
|
{
"pile_set_name": "Github"
}
|
import getLatestNewsItems from './get-latest-news-items';
describe('getLatestNewsItems', () => {
const response = {
items: [
{
url: '/_news/news-item-1',
date_modified: '2020-04-29T00:00:00.000Z',
},
{
url: '/_news/news-item-2',
date_modified: '2020-04-28T00:00:00.000Z',
},
{
url: '/_news/news-item-3',
date_modified: '2020-04-27T00:00:00.000Z',
},
],
};
it('should return all newsItems from response when newsLastUpdated is undefined.', () => {
const newsLastUpdated = undefined;
const output = getLatestNewsItems({ newsLastUpdated, response });
expect(output).toEqual([
{
url: '/news/news-item-1',
date_modified: '2020-04-29T00:00:00.000Z',
},
{
url: '/news/news-item-2',
date_modified: '2020-04-28T00:00:00.000Z',
},
{
url: '/news/news-item-3',
date_modified: '2020-04-27T00:00:00.000Z',
},
]);
});
it('should return a subset of newsItems from response when newsLastUpdated is a date before the latest item in the newsItems list.', () => {
const newsLastUpdated = '2020-04-27T00:00:00.000Z';
const output = getLatestNewsItems({ newsLastUpdated, response });
expect(output).toEqual([
{
url: '/news/news-item-1',
date_modified: '2020-04-29T00:00:00.000Z',
},
{
url: '/news/news-item-2',
date_modified: '2020-04-28T00:00:00.000Z',
},
]);
});
it('should return an empty newsItems from response when newsLastUpdated matches the date of the latest item.', () => {
const newsLastUpdated = '2020-04-29T00:00:00.000Z';
const output = getLatestNewsItems({ newsLastUpdated, response });
expect(output).toEqual([]);
});
});
|
{
"pile_set_name": "Github"
}
|
<!--
Copyright World Wide Web Consortium, (Massachusetts Institute of
Technology, Institut National de Recherche en Informatique et en
Automatique, Keio University).
All Rights Reserved.
Please see the full Copyright clause at
<http://www.w3.org/Consortium/Legal/copyright-software.html>
$Id: test016.rdf,v 1.1 2002/07/26 04:26:56 jcarroll Exp $
-->
<!--
Description:
Like test001.rdf but with a processing instruction
as the only content of the otherwise empty element.
Author: Jeremy Carroll
-->
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:random="http://random.ioctl.org/#">
<rdf:Description rdf:about="http://random.ioctl.org/#bar">
<random:someProperty rdf:resource="http://random.ioctl.org/#foo"><?a
processing instruction?></random:someProperty>
</rdf:Description>
</rdf:RDF>
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html>
<head>
<title>F.VERT.RE-Funktion</title>
<meta charset="utf-8" />
<meta name="description" content="" />
<link type="text/css" rel="stylesheet" href="../editor.css" />
<script type="text/javascript" src="../callback.js"></script>
<script type="text/javascript" src="../search/js/page-search.js"></script>
</head>
<body>
<div class="mainpart">
<div class="search-field">
<input id="search" class="searchBar" placeholder="Suche" type="text" onkeypress="doSearch(event)">
</div>
<h1>F.VERT.RE-Funktion</h1>
<p>Die Funktion <b>F.VERT.RE</b> gehört zur Gruppe der statistischen Funktionen. Sie wird verwendet, um die (rechtsseitige) F-Wahrscheinlichkeitsverteilung (Grad der Diversität) für zwei Datensätze zurückzugeben. Mit dieser Funktion können Sie feststellen, ob zwei Datenmengen unterschiedlichen Streuungen unterliegen.</p>
<p>Die Formelsyntax der Funktion <b>F.VERT.RE</b> ist:</p>
<p style="text-indent: 150px;"><b><em>F.VERT.RE(x;Freiheitsgrade1;Freiheitsgrade2)</em></b></p>
<p><em>Dabei gilt:</em></p>
<p style="text-indent: 50px;"><b><em>x</em></b> ist der Wert, für den die Funktion ausgewertet werden soll. Ein nummerischer Wert, der größer ist als 0.</p>
<p style="text-indent: 50px;"><b><em>Freiheitsgrade1</em></b> ist die Anzahl der Freiheitsgrade im Zähler. Ein nummerischer Wert, der größer ist als 1 und kleiner als 10^10.</p>
<p style="text-indent: 50px;"><b><em>Freiheitsgrade2</em></b> ist die Anzahl der Freiheitsgrade im Nenner. Ein nummerischer Wert, der größer ist als 1 und kleiner als 10^10.</p>
<p>Die Argumente werden manuell eingegeben oder sind in die Zelle eingeschlossen, auf die Sie Bezug nehmen.</p>
<p>Anwendung der Funktion <b>F.VERT.RE</b>:</p>
<ol>
<li>Wählen Sie die gewünschte Zelle für die Ergebnisanzeige aus.</li>
<li>Klicken Sie auf das Symbol <b>Funktion einfügen</b> <img alt="Funktion einfügen" src="../images/insertfunction.png" /> auf der oberen Symbolleiste <br />oder klicken Sie mit der rechten Maustaste in die gewünschte Zelle und wählen Sie die Option <b>Funktion einfügen</b> aus dem Kontextenü aus <br />oder klicken Sie auf das Symbol <img alt="Funktion" src="../images/function.png" /> auf der Formelleiste.</li>
<li>Wählen Sie die Gruppe <b>Statistische</b> Funktionen aus der Liste aus.</li>
<li>Klicken Sie auf die Funktion <b>F.VERT.RE</b>.</li>
<li>Geben Sie die erforderlichen Argumente ein und trennen Sie diese durch Kommas.</li>
<li>Drücken Sie die <b>Eingabetaste</b>.</li>
</ol>
<p>Das Ergebnis wird in der gewählten Zelle angezeigt.</p>
<p style="text-indent: 150px;"><img alt="F.VERT.RE-Funktion" src="../images/f-dist-rt.png" /></p>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
export * from './src/public_api';
|
{
"pile_set_name": "Github"
}
|
// Copyright 2007-2008 The Apache Software Foundation.
//
// 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.
namespace Magnum.FileSystem
{
using System.Reflection;
public class DotNetInstallationDirectory :
DotNetDirectory,
InstallationDirectory
{
public DotNetInstallationDirectory()
: base(GetInstallPath())
{
}
static DirectoryName GetInstallPath()
{
return FileName.GetFileName(Assembly.GetEntryAssembly().Location).GetDirectoryName();
}
}
}
|
{
"pile_set_name": "Github"
}
|
//
// Copyright (c) 2017-present, ViroMedia, Inc.
// All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package com.viro.core;
/**
* Callback interface for responding to click events, which occur when any Controller button is
* clicked.
*/
public interface ClickListener {
/**
* Callback when a click event is registered over the given {@link Node}.
*
* @param source The platform specific source ID, which indicates what button or
* component on the Controller triggered the event. See the Controller's
* Guide for information.
* @param node The {@link Node} that was clicked.
* @param location The location of the event in world coordinates.
*/
void onClick(int source, Node node, Vector location);
/**
* Callback when the {@link ClickState} is changed over the given {@link Node}. This callback is
* for receiving fine-grained information about a click: when the pointer goes down, when it
* goes up, and if/when the 'click' itself is registered. For a completed click, this callback
* is invoked <i>three</i> times: on {@link ClickState#CLICK_DOWN}, {@link ClickState#CLICK_UP},
* and then for {@link ClickState#CLICKED}.
* <p>
* To simply listen for click events, use {@link #onClick(int, Node, Vector)}.
*
* @param source The platform specific source ID, which indicates what button or component
* on the Controller triggered the event. See the Controller's Guide for
* information.
* @param node The {@link Node} that was clicked.
* @param clickState The status of the click event.
* @param location The location of the event in world coordinates.
*/
void onClickState(int source, Node node, ClickState clickState, Vector location);
}
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. "$scriptroot/tools.sh"
version='Latest'
architecture=''
runtime='dotnet'
runtimeSourceFeed=''
runtimeSourceFeedKey=''
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
case "$opt" in
-version|-v)
shift
version="$1"
;;
-architecture|-a)
shift
architecture="$1"
;;
-runtime|-r)
shift
runtime="$1"
;;
-runtimesourcefeed)
shift
runtimeSourceFeed="$1"
;;
-runtimesourcefeedkey)
shift
runtimeSourceFeedKey="$1"
;;
*)
Write-PipelineTelemetryError -Category 'Build' -Message "Invalid argument: $1"
exit 1
;;
esac
shift
done
# Use uname to determine what the CPU is.
cpuname=$(uname -p)
# Some Linux platforms report unknown for platform, but the arch for machine.
if [[ "$cpuname" == "unknown" ]]; then
cpuname=$(uname -m)
fi
case $cpuname in
aarch64)
buildarch=arm64
;;
amd64|x86_64)
buildarch=x64
;;
armv*l)
buildarch=arm
;;
i686)
buildarch=x86
;;
*)
echo "Unknown CPU $cpuname detected, treating it as x64"
buildarch=x64
;;
esac
dotnetRoot="$repo_root/.dotnet"
if [[ $architecture != "" ]] && [[ $architecture != $buildarch ]]; then
dotnetRoot="$dotnetRoot/$architecture"
fi
InstallDotNet $dotnetRoot $version "$architecture" $runtime true $runtimeSourceFeed $runtimeSourceFeedKey || {
local exit_code=$?
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2
ExitWithExitCode $exit_code
}
ExitWithExitCode 0
|
{
"pile_set_name": "Github"
}
|
(ns bootleg.core-test
(:require [clojure.test :refer :all]
[bootleg.core :refer :all]
[bootleg.hiccup :refer :all]
[bootleg.yaml :refer :all]
[bootleg.json :refer :all]))
(deftest slurp-test
(testing "test slurp returns string"
(is (= (slurp "test/files/simple.md")
(process-hiccup-data []
"./"
"(slurp \"test/files/simple.md\")")))
(is (= (slurp "test/files/simple.md")
(process-hiccup-data []
"./test/files/"
"(slurp \"simple.md\")")))
(is (= (slurp "test/files/simple.md")
(process-hiccup-data []
"./test/files/"
"(slurp \"https://raw.githubusercontent.com/retrogradeorbit/bootleg/master/test/files/simple.md\")")))))
(deftest yaml-test
(testing "test yaml function"
(is (= (yaml "
foo: bar
baz:
- one
- two
" :data)
{:foo "bar"
:baz ["one" "two"]}))))
(deftest json-test
(testing "test json function"
(is (= (json "
{
\"foo\": \"bar\",
\"baz\": [\"one\", \"two\"]
}
" :data)
{:foo "bar"
:baz ["one" "two"]}))))
|
{
"pile_set_name": "Github"
}
|
#!/bin/sh
(
echo "extern const char QUEUE_DIR[]=\"$1\";"
echo "extern const char CONFIG_DIR[]=\"$2\";"
echo "extern const char PROTOCOLS_DIR[]=\"$3\";"
echo "extern const char BIN_DIR[]=\"$4\";"
echo "extern const char SBIN_DIR[]=\"$5\";"
) > defines.cc
|
{
"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 v1
import (
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
// PodsGetter has a method to return a PodInterface.
// A group's client should implement this interface.
type PodsGetter interface {
Pods(namespace string) PodInterface
}
// PodInterface has methods to work with Pod resources.
type PodInterface interface {
Create(*v1.Pod) (*v1.Pod, error)
Update(*v1.Pod) (*v1.Pod, error)
UpdateStatus(*v1.Pod) (*v1.Pod, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.Pod, error)
List(opts metav1.ListOptions) (*v1.PodList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Pod, err error)
GetEphemeralContainers(podName string, options metav1.GetOptions) (*v1.EphemeralContainers, error)
UpdateEphemeralContainers(podName string, ephemeralContainers *v1.EphemeralContainers) (*v1.EphemeralContainers, error)
PodExpansion
}
// pods implements PodInterface
type pods struct {
client rest.Interface
ns string
}
// newPods returns a Pods
func newPods(c *CoreV1Client, namespace string) *pods {
return &pods{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the pod, and returns the corresponding pod object, and an error if there is any.
func (c *pods) Get(name string, options metav1.GetOptions) (result *v1.Pod, err error) {
result = &v1.Pod{}
err = c.client.Get().
Namespace(c.ns).
Resource("pods").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of Pods that match those selectors.
func (c *pods) List(opts metav1.ListOptions) (result *v1.PodList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.PodList{}
err = c.client.Get().
Namespace(c.ns).
Resource("pods").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested pods.
func (c *pods) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("pods").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a pod and creates it. Returns the server's representation of the pod, and an error, if there is any.
func (c *pods) Create(pod *v1.Pod) (result *v1.Pod, err error) {
result = &v1.Pod{}
err = c.client.Post().
Namespace(c.ns).
Resource("pods").
Body(pod).
Do().
Into(result)
return
}
// Update takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any.
func (c *pods) Update(pod *v1.Pod) (result *v1.Pod, err error) {
result = &v1.Pod{}
err = c.client.Put().
Namespace(c.ns).
Resource("pods").
Name(pod.Name).
Body(pod).
Do().
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *pods) UpdateStatus(pod *v1.Pod) (result *v1.Pod, err error) {
result = &v1.Pod{}
err = c.client.Put().
Namespace(c.ns).
Resource("pods").
Name(pod.Name).
SubResource("status").
Body(pod).
Do().
Into(result)
return
}
// Delete takes name of the pod and deletes it. Returns an error if one occurs.
func (c *pods) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("pods").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *pods) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("pods").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched pod.
func (c *pods) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Pod, err error) {
result = &v1.Pod{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("pods").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
// GetEphemeralContainers takes name of the pod, and returns the corresponding v1.EphemeralContainers object, and an error if there is any.
func (c *pods) GetEphemeralContainers(podName string, options metav1.GetOptions) (result *v1.EphemeralContainers, err error) {
result = &v1.EphemeralContainers{}
err = c.client.Get().
Namespace(c.ns).
Resource("pods").
Name(podName).
SubResource("ephemeralcontainers").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateEphemeralContainers takes the top resource name and the representation of a ephemeralContainers and updates it. Returns the server's representation of the ephemeralContainers, and an error, if there is any.
func (c *pods) UpdateEphemeralContainers(podName string, ephemeralContainers *v1.EphemeralContainers) (result *v1.EphemeralContainers, err error) {
result = &v1.EphemeralContainers{}
err = c.client.Put().
Namespace(c.ns).
Resource("pods").
Name(podName).
SubResource("ephemeralcontainers").
Body(ephemeralContainers).
Do().
Into(result)
return
}
|
{
"pile_set_name": "Github"
}
|
X-Account-Key: account5
X-UIDL: GmailId128877bcfcbafeb1
X-Mozilla-Status: 0000
X-Mozilla-Status2: 00000000
X-Mozilla-Keys:
Delivered-To: mlsubscriber.tech@csmining.org
Received: by 10.142.81.20 with SMTP id e20cs62883wfb;
Tue, 11 May 2010 06:09:18 -0700 (PDT)
Received: by 10.223.64.194 with SMTP id f2mr6351950fai.2.1273583357923;
Tue, 11 May 2010 06:09:17 -0700 (PDT)
Return-Path: <bounce-debian-user=mlsubscriber.tech=csmining.org@lists.debian.org>
Received: from liszt.debian.org (liszt.debian.org [82.195.75.100])
by mx.google.com with ESMTP id g5si11239206fai.85.2010.05.11.06.09.17;
Tue, 11 May 2010 06:09:17 -0700 (PDT)
Received-SPF: pass (google.com: manual fallback record for domain of bounce-debian-user=mlsubscriber.tech=csmining.org@lists.debian.org designates 82.195.75.100 as permitted sender) client-ip=82.195.75.100;
Authentication-Results: mx.google.com; spf=pass (google.com: manual fallback record for domain of bounce-debian-user=mlsubscriber.tech=csmining.org@lists.debian.org designates 82.195.75.100 as permitted sender) smtp.mail=bounce-debian-user=mlsubscriber.tech=csmining.org@lists.debian.org
Received: from localhost (localhost [127.0.0.1])
by liszt.debian.org (Postfix) with QMQP
id 604526C8441; Tue, 11 May 2010 13:09:07 +0000 (UTC)
Old-Return-Path: <jmperez@i2basque.es>
XChecker-Version: SpamAssassin 3.2.5 (2008-06-10) on liszt.debian.org
XLevel:
XStatus: No, score=0.0 required=4.0 tests=none autolearn=no version=3.2.5
X-Original-To: lists-debian-user@liszt.debian.org
Delivered-To: lists-debian-user@liszt.debian.org
Received: from localhost (localhost [127.0.0.1])
by liszt.debian.org (Postfix) with ESMTP id 5E28B6C844F
for <lists-debian-user@liszt.debian.org>; Tue, 11 May 2010 12:52:50 +0000 (UTC)
X-Virus-Scanned: at lists.debian.org with policy bank en-ht
X-AmavisStatus: No, score=-0.01 tagged_above=-10000 required=5.3
tests=[BAYES_40=-0.01] autolearn=no
Received: from liszt.debian.org ([127.0.0.1])
by localhost (lists.debian.org [127.0.0.1]) (amavisd-new, port 2525)
with ESMTP id 0bX-EDrK0kRz for <lists-debian-user@liszt.debian.org>;
Tue, 11 May 2010 12:52:43 +0000 (UTC)
X-policyd-weight: using cached result; rate: -6.1
X-Greylist: delayed 1039 seconds by postgrey-1.31 at liszt; Tue, 11 May 2010 12:52:43 UTC
Received: from mail.i2basque.es (server002.i2basque.es [150.241.254.2])
by liszt.debian.org (Postfix) with ESMTP id 4DA436C844D
for <debian-user@lists.debian.org>; Tue, 11 May 2010 12:52:43 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
by mail.i2basque.es (Postfix) with ESMTP id 5E97B74D1B1
for <debian-user@lists.debian.org>; Tue, 11 May 2010 14:35:21 +0200 (CEST)
Received: from mail.i2basque.es ([127.0.0.1])
by localhost (server002.i2bask.es [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 04102-07 for <debian-user@lists.debian.org>;
Tue, 11 May 2010 14:35:21 +0200 (CEST)
Received: from desktop005.i2basque.es (desktop005.i2basque.es [150.241.254.5])
by mail.i2basque.es (Postfix) with ESMTP id 031D974D1A2
for <debian-user@lists.debian.org>; Tue, 11 May 2010 14:35:21 +0200 (CEST)
From: =?iso-8859-1?Q?Jose_Manuel_P=E9rez?= <jmperez@i2basque.es>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Subject: Debian and touch-screens
Date: Tue, 11 May 2010 14:35:23 +0200
Message-Id: <01C59D38-A97C-4794-AFB6-4370245E2F8E@i2basque.es>
To: debian-user@lists.debian.org
Mime-Version: 1.0 (Apple Message framework v1078)
X-Mailer: Apple Mail (2.1078)
X-Rc-Spam: 2008-11-04_01
X-Rc-Virus: 2007-09-13_01
X-Rc-Spam: 2008-11-04_01
Resent-Message-ID: <1Osyfs_BswK.A.-5G.zbV6LB@liszt>
Resent-From: debian-user@lists.debian.org
X-Mailing-List: <debian-user@lists.debian.org> archive/latest/576499
X-Loop: debian-user@lists.debian.org
List-Id: <debian-user.lists.debian.org>
List-Post: <mailto:debian-user@lists.debian.org>
List-Help: <mailto:debian-user-request@lists.debian.org?subject=help>
List-Subscribe: <mailto:debian-user-request@lists.debian.org?subject=subscribe>
List-Unsubscribe: <mailto:debian-user-request@lists.debian.org?subject=unsubscribe>
Precedence: list
Resent-Sender: debian-user-request@lists.debian.org
Resent-Date: Tue, 11 May 2010 13:09:07 +0000 (UTC)
Hi all.
I=B4m working in a project that we would like to install in a =
touch-screen compact computer. My intention is to use Debian as the OS, =
and i'm searching for that kind of hardware with support for =
Debian/Linux. Most of them support Windows but it=B4s not clear if =
Debian will work as well. I've found some support for touch screens =
(some models), but not clear for integrated/compact systems. Someone =
knows where to look for?, or has some experience?, some URL?
Thanks in advance,
--
Jose Manuel P=E9rez (+34 943 018705)
Redes y Sistemas / Sarea eta Sistemak
Red Acad=E9mica i2basque Sare Akademikoa
--
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/01C59D38-A97C-4794-AFB6-4370245E2F8E@i2basque.es
|
{
"pile_set_name": "Github"
}
|
#!/bin/sh
# description: pass-case example
return 0
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5" xmlns:oval-def="http://oval.mitre.org/XMLSchema/oval-definitions-5" xmlns:aix-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#aix" xmlns:sch="http://purl.oclc.org/dsdl/schematron" targetNamespace="http://oval.mitre.org/XMLSchema/oval-definitions-5#aix" elementFormDefault="qualified" version="5.11.1">
<xsd:import namespace="http://oval.mitre.org/XMLSchema/oval-definitions-5" schemaLocation="oval-definitions-schema.xsd"/>
<xsd:annotation>
<xsd:documentation>The following is a description of the elements, types, and attributes that compose the AIX specific tests found in Open Vulnerability and Assessment Language (OVAL). Each test is an extension of the standard test element defined in the Core Definition Schema. Through extension, each test inherits a set of elements and attributes that are shared amongst all OVAL tests. Each test is described in detail and should provide the information necessary to understand what each element and attribute represents. This document is intended for developers and assumes some familiarity with XML. A high level description of the interaction between the different tests and their relationship to the Core Definition Schema is not outlined here.</xsd:documentation>
<xsd:documentation>This schema was originally developed by Yuzheng Zhou and Todd Dolinsky at Hewlett-Packard. The OVAL Schema is maintained by The MITRE Corporation and developed by the public OVAL Community. For more information, including how to get involved in the project and how to submit change requests, please visit the OVAL website at http://oval.mitre.org.</xsd:documentation>
<xsd:appinfo>
<schema>AIX Definition</schema>
<version>5.11.1:1.0</version>
<date>4/22/2015 09:00:00 AM</date>
<terms_of_use>Copyright (c) 2002-2015, The MITRE Corporation. All rights reserved. The contents of this file are subject to the terms of the OVAL License located at http://oval.mitre.org/oval/about/termsofuse.html. See the OVAL License for the specific language governing permissions and limitations for use of this schema. When distributing copies of the OVAL Schema, this license header must be included.</terms_of_use>
<sch:ns prefix="oval-def" uri="http://oval.mitre.org/XMLSchema/oval-definitions-5"/>
<sch:ns prefix="aix-def" uri="http://oval.mitre.org/XMLSchema/oval-definitions-5#aix"/>
<sch:ns prefix="xsi" uri="http://www.w3.org/2001/XMLSchema-instance"/>
</xsd:appinfo>
</xsd:annotation>
<!-- =============================================================================== -->
<!-- ================================ INTERIM FIX TEST =========================== -->
<!-- =============================================================================== -->
<xsd:element name="interim_fix_test" substitutionGroup="oval-def:test">
<xsd:annotation>
<xsd:documentation>The interim fix test is used to check information associated with different interim or emergency fixes installed on the system. The information being tested is based off the emgr -l -u VUID command. It extends the standard TestType as defined in the oval-definitions-schema and one should refer to the TestType description for more information. The required object element references an interim_fix_object and the optional state element specifies the information to check.</xsd:documentation>
<xsd:appinfo>
<oval:element_mapping>
<oval:test>interim_fix_test</oval:test>
<oval:object>interim_fix_object</oval:object>
<oval:state>interim_fix_state</oval:state>
<oval:item target_namespace="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#aix">interim_fix_item</oval:item>
</oval:element_mapping>
</xsd:appinfo>
<xsd:appinfo>
<sch:pattern id="aix-def_interimfixtst">
<sch:rule context="aix-def:interim_fix_test/aix-def:object">
<sch:assert test="@object_ref=ancestor::oval-def:oval_definitions/oval-def:objects/aix-def:interim_fix_object/@id"><sch:value-of select="../@id"/> - the object child element of a <sch:name path=".."/> must reference a interim_fix_object</sch:assert>
</sch:rule>
<sch:rule context="aix-def:interim_fix_test/aix-def:state">
<sch:assert test="@state_ref=ancestor::oval-def:oval_definitions/oval-def:states/aix-def:interim_fix_state/@id"><sch:value-of select="../@id"/> - the state child element of a <sch:name path=".."/> must reference a interim_fix_state</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:TestType">
<xsd:sequence>
<xsd:element name="object" type="oval-def:ObjectRefType" />
<xsd:element name="state" type="oval-def:StateRefType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="interim_fix_object" substitutionGroup="oval-def:object">
<xsd:annotation>
<xsd:documentation>The interim_fix_object element is used by a interim_fix_test to define the specific fix to be evaluated. Each object extends the standard ObjectType as defined in the oval-definitions-schema and one should refer to the ObjectType description for more information. The common set element allows complex objects to be created using filters and set logic. Again, please refer to the description of the set element in the oval-definitions-schema.</xsd:documentation>
<xsd:documentation>An interim_fix_object consists of a single vuid entity that identifies the fix to be used.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="aix-def_interim_fix_object_verify_filter_state">
<sch:rule context="aix-def:interim_fix_object//oval-def:filter">
<sch:let name="parent_object" value="ancestor::aix-def:interim_fix_object"/>
<sch:let name="parent_object_id" value="$parent_object/@id"/>
<sch:let name="state_ref" value="."/>
<sch:let name="reffed_state" value="ancestor::oval-def:oval_definitions/oval-def:states/*[@id=$state_ref]"/>
<sch:let name="state_name" value="local-name($reffed_state)"/>
<sch:let name="state_namespace" value="namespace-uri($reffed_state)"/>
<sch:assert test="(($state_namespace='http://oval.mitre.org/XMLSchema/oval-definitions-5#aix') and ($state_name='interim_fix_state'))">State referenced in filter for <sch:value-of select="name($parent_object)"/> '<sch:value-of select="$parent_object_id"/>' is of the wrong type. </sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:ObjectType">
<xsd:sequence>
<xsd:choice>
<xsd:element ref="oval-def:set"/>
<xsd:sequence>
<xsd:element name="vuid" type="oval-def:EntityObjectStringType">
<xsd:annotation>
<xsd:documentation>Virtually Unique ID. A combination of time and cpuid, this ID can be used to differentiate fixes that are otherwise identical.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="oval-def:filter" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:choice>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="interim_fix_state" substitutionGroup="oval-def:state">
<xsd:annotation>
<xsd:documentation>The interim_fix_state element defines the different information associated with a specific interim fix installed on the system. Please refer to the individual elements in the schema for more details about what each represents.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:StateType">
<xsd:sequence>
<xsd:element name="vuid" type="oval-def:EntityStateStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Virtually Unique ID. A combination of time and cpuid, this ID can be used to differentiate fixes that are otherwise identical.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="label" type="oval-def:EntityStateStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Each efix that is installed on a given system has a unique efix label.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="abstract" type="oval-def:EntityStateStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Describes the efix package.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="state" type="aix-def:EntityStateInterimFixStateType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>The the emergency fix state.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<!-- =============================================================================== -->
<!-- =============================== FILESET TEST ================================ -->
<!-- =============================================================================== -->
<xsd:element name="fileset_test" substitutionGroup="oval-def:test">
<xsd:annotation>
<xsd:documentation>The fileset_test is used to check information associated with different filesets installed on the system. The information used by this test is modeled after the /usr/bin/lslpp -l command. It extends the standard TestType as defined in the oval-definitions-schema and one should refer to the TestType description for more information. The required object element references an inetd_object and the optional state element specifies the information to check.</xsd:documentation>
<xsd:appinfo>
<oval:element_mapping>
<oval:test>fileset_test</oval:test>
<oval:object>fileset_object</oval:object>
<oval:state>fileset_state</oval:state>
<oval:item target_namespace="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#aix">fileset_item</oval:item>
</oval:element_mapping>
</xsd:appinfo>
<xsd:appinfo>
<sch:pattern id="aix-def_filesettst">
<sch:rule context="aix-def:fileset_test/aix-def:object">
<sch:assert test="@object_ref=ancestor::oval-def:oval_definitions/oval-def:objects/aix-def:fileset_object/@id"><sch:value-of select="../@id"/> - the object child element of a fileset_test must reference a fileset_object</sch:assert>
</sch:rule>
<sch:rule context="aix-def:fileset_test/aix-def:state">
<sch:assert test="@state_ref=ancestor::oval-def:oval_definitions/oval-def:states/aix-def:fileset_state/@id"><sch:value-of select="../@id"/> - the state child element of a fileset_test must reference a fileset_state</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:TestType">
<xsd:sequence>
<xsd:element name="object" type="oval-def:ObjectRefType" />
<xsd:element name="state" type="oval-def:StateRefType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="fileset_object" substitutionGroup="oval-def:object">
<xsd:annotation>
<xsd:documentation>The fileset_object element is used by a fileset_test to define the fileset to be evaluated. Each object extends the standard ObjectType as defined in the oval-definitions-schema and one should refer to the ObjectType description for more information. The common set element allows complex objects to be created using filters and set logic. Again, please refer to the description of the set element in the oval-definitions-schema.</xsd:documentation>
<xsd:documentation>A fileset_object consists of a single flstinst entity that identifies the fileset to be used.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="aix-def_fileset_object_verify_filter_state">
<sch:rule context="aix-def:fileset_object//oval-def:filter">
<sch:let name="parent_object" value="ancestor::aix-def:fileset_object"/>
<sch:let name="parent_object_id" value="$parent_object/@id"/>
<sch:let name="state_ref" value="."/>
<sch:let name="reffed_state" value="ancestor::oval-def:oval_definitions/oval-def:states/*[@id=$state_ref]"/>
<sch:let name="state_name" value="local-name($reffed_state)"/>
<sch:let name="state_namespace" value="namespace-uri($reffed_state)"/>
<sch:assert test="(($state_namespace='http://oval.mitre.org/XMLSchema/oval-definitions-5#aix') and ($state_name='fileset_state'))">State referenced in filter for <sch:value-of select="name($parent_object)"/> '<sch:value-of select="$parent_object_id"/>' is of the wrong type. </sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:ObjectType">
<xsd:sequence>
<xsd:choice>
<xsd:element ref="oval-def:set"/>
<xsd:sequence>
<xsd:element name="flstinst" type="oval-def:EntityObjectStringType">
<xsd:annotation>
<xsd:documentation>The flstinst entity represents the fileset name we want to check. For example, if we want to check the status of the fileset 'bos.rte', we can use fileset test and the flstinst entity will be 'bos.rte' or 'bot.*' or etc.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="oval-def:filter" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:choice>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="fileset_state" substitutionGroup="oval-def:state">
<xsd:annotation>
<xsd:documentation>The fileset_state element defines the different information associated with filesets installed on the system. Please refer to the individual elements in the schema for more details about what each represents.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:StateType">
<xsd:sequence>
<xsd:element name="flstinst" type="oval-def:EntityStateStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Represents the name of a fileset.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="level" type="oval-def:EntityStateVersionType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Maintenance level (also known as version in Solaris or Linux) of a fileset. For example, "5.3.0.10" is the level for 'bos.txt.tfs' fileset in one AIX machine.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="state" type="aix-def:EntityStateFilesetStateType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>This gives the state of a fileset. The state can be 'APPLIED', 'APPLYING','BROKEN', 'COMMITTED', 'EFIX LOCKED', 'OBSOLETE', 'COMMITTING','REJECTING'. See the manpage of the 'lslpp' command more information.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="description" type="oval-def:EntityStateStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Short description of a fileset.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<!-- =============================================================================== -->
<!-- ================================ FIX TEST =================================== -->
<!-- =============================================================================== -->
<xsd:element name="fix_test" substitutionGroup="oval-def:test">
<xsd:annotation>
<xsd:documentation>The fix test is used to check information associated with different fixes installed on the system. The information being tested is based off the /usr/sbin/instfix -iavk command. It extends the standard TestType as defined in the oval-definitions-schema and one should refer to the TestType description for more information. The required object element references an fix_object and the optional state element specifies the information to check.</xsd:documentation>
<xsd:appinfo>
<oval:element_mapping>
<oval:test>fix_test</oval:test>
<oval:object>fix_object</oval:object>
<oval:state>fix_state</oval:state>
<oval:item target_namespace="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#aix">fix_item</oval:item>
</oval:element_mapping>
</xsd:appinfo>
<xsd:appinfo>
<sch:pattern id="aix-def_fixtst">
<sch:rule context="aix-def:fix_test/aix-def:object">
<sch:assert test="@object_ref=ancestor::oval-def:oval_definitions/oval-def:objects/aix-def:fix_object/@id"><sch:value-of select="../@id"/> - the object child element of a fix_test must reference a fix_object</sch:assert>
</sch:rule>
<sch:rule context="aix-def:fix_test/aix-def:state">
<sch:assert test="@state_ref=ancestor::oval-def:oval_definitions/oval-def:states/aix-def:fix_state/@id"><sch:value-of select="../@id"/> - the state child element of a fix_test must reference a fix_state</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:TestType">
<xsd:sequence>
<xsd:element name="object" type="oval-def:ObjectRefType" />
<xsd:element name="state" type="oval-def:StateRefType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="fix_object" substitutionGroup="oval-def:object">
<xsd:annotation>
<xsd:documentation>The fix_object element is used by a fix test to define the specific fix to be evaluated. Each object extends the standard ObjectType as defined in the oval-definitions-schema and one should refer to the ObjectType description for more information. The common set element allows complex objects to be created using filters and set logic. Again, please refer to the description of the set element in the oval-definitions-schema.</xsd:documentation>
<xsd:documentation>A fix object consists of a single apar_number entity that identifies the fix to be used.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="aix-def_fix_object_verify_filter_state">
<sch:rule context="aix-def:fix_object//oval-def:filter">
<sch:let name="parent_object" value="ancestor::aix-def:fix_object"/>
<sch:let name="parent_object_id" value="$parent_object/@id"/>
<sch:let name="state_ref" value="."/>
<sch:let name="reffed_state" value="ancestor::oval-def:oval_definitions/oval-def:states/*[@id=$state_ref]"/>
<sch:let name="state_name" value="local-name($reffed_state)"/>
<sch:let name="state_namespace" value="namespace-uri($reffed_state)"/>
<sch:assert test="(($state_namespace='http://oval.mitre.org/XMLSchema/oval-definitions-5#aix') and ($state_name='fix_state'))">State referenced in filter for <sch:value-of select="name($parent_object)"/> '<sch:value-of select="$parent_object_id"/>' is of the wrong type. </sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:ObjectType">
<xsd:sequence>
<xsd:choice>
<xsd:element ref="oval-def:set"/>
<xsd:sequence>
<xsd:element name="apar_number" type="oval-def:EntityObjectStringType">
<xsd:annotation>
<xsd:documentation>APAR is the short for 'Authorized Program Analysis Report'. APAR identifies and describes a software product defect. An APAR number can obtain a PTF (Program Temporary Fix) for the defect, if a PTF is available. An example of an apar_number is 'IY78751', it includes two alphabetic characters and a 5-digit integer.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="oval-def:filter" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:choice>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="fix_state" substitutionGroup="oval-def:state">
<xsd:annotation>
<xsd:documentation>The fix_state element defines the different information associated with a specific fix installed on the system. Please refer to the individual elements in the schema for more details about what each represents.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:StateType">
<xsd:sequence>
<xsd:element name="apar_number" type="oval-def:EntityStateStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>APAR is the short for 'Authorized Program Analysis Report'. APAR identifies and describes a software product defect. An APAR number can obtain a PTF (Program Temporary Fix) for the defect, if a PTF is available. An example of an apar_number is 'IY78751', it includes two alphabetic characters and a 5-digit integer.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="abstract" type="oval-def:EntityStateStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>The abstract of an APAR. For instance, 'LL syas rXct are available even when not susea' is the abstract of APAR 'IY78751'.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="symptom" type="oval-def:EntityStateStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>The symptom text related to an APAR. For example, the symptom text for 'IY75211' is 'Daylight savings change for year 2007 and beyond'.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="installation_status" type="aix-def:EntityStateFixInstallationStatusType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>The installation status of files associated with the APAR. This cannot be got from the output of the instfix command directly. The last line of the output is 'All filesets for XXXXXXX were found', or 'Not all filesets for XXXXXXX were found' or 'No filesets which have fixes for XXXXXXX are currently installed.'. These can be translated to the correct value as defined by the EntityStateFixInstallationStatusType.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<!-- =============================================================================== -->
<!-- =================================== NO TEST ================================= -->
<!-- =============================================================================== -->
<xsd:element name="no_test" substitutionGroup="oval-def:test">
<xsd:annotation>
<xsd:documentation>The no test is used to check information related to the /usr/sbin/no command and the parameters it manages. The no command sets or displays current or next boot values for network tuning parameters. The information being tested is based off the /usr/sbin/no -o command. It extends the standard TestType as defined in the oval-definitions-schema and one should refer to the TestType description for more information. The required object element references a no_object and the optional state element specifies the value to check for.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="aix-def_notst">
<sch:rule context="aix-def:no_test/aix-def:object">
<sch:assert test="@object_ref=ancestor::oval-def:oval_definitions/oval-def:objects/aix-def:no_object/@id"><sch:value-of select="../@id"/> - the object child element of a <sch:name path=".."/> must reference a no_object</sch:assert>
</sch:rule>
<sch:rule context="aix-def:no_test/aix-def:state">
<sch:assert test="@state_ref=ancestor::oval-def:oval_definitions/oval-def:states/aix-def:no_state/@id"><sch:value-of select="../@id"/> - the state child element of a <sch:name path=".."/> must reference a no_state</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:TestType">
<xsd:sequence>
<xsd:element name="object" type="oval-def:ObjectRefType" />
<xsd:element name="state" type="oval-def:StateRefType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="no_object" substitutionGroup="oval-def:object">
<xsd:annotation>
<xsd:documentation>The no_object element is used by a no_test to define the specific parameter to be evaluated. Each object extends the standard ObjectType as defined in the oval-definitions-schema and one should refer to the ObjectType description for more information. The common set element allows complex objects to be created using filters and set logic. Again, please refer to the description of the set element in the oval-definitions-schema.</xsd:documentation>
<xsd:documentation>A no_object consists of a single tunable entity that identifies the parameter to be looked at.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:ObjectType">
<xsd:sequence>
<xsd:choice>
<xsd:element ref="oval-def:set"/>
<xsd:sequence>
<xsd:element name="tunable" type="oval-def:EntityObjectStringType">
<xsd:annotation>
<xsd:documentation>The tunable entity holds the name of the tunable parameter to be queried by the /usr/sbin/no command. Examples include ip_forwarding and tcp_keepalive_interval.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="oval-def:filter" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:choice>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="no_state" substitutionGroup="oval-def:state">
<xsd:annotation>
<xsd:documentation>The no_state element defines the different information associated with a specific call to /usr/sbin/no. Please refer to the individual elements in the schema for more details about what each represents.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:StateType">
<xsd:sequence>
<xsd:element name="tunable" type="oval-def:EntityStateStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>The tunable entity is used to check the name of the tunable parameter that was used by the /usr/sbin/no command. Examples include ip_forwarding and tcp_keepalive_interval.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="value" type="oval-def:EntityStateAnySimpleType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>The value entity defines the value to check against the tunable parameter being examined.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<!-- =============================================================================== -->
<!-- =============================== OSLEVEL TEST ================================ -->
<!-- =============================================================================== -->
<xsd:element name="oslevel_test" substitutionGroup="oval-def:test">
<xsd:annotation>
<xsd:documentation>The oslevel test reveals information about the release and maintenance level of AIX operating system. This information can be retrieved by the /usr/bin/oslevel -r command. It extends the standard TestType as defined in the oval-definitions-schema and one should refer to the TestType description for more information. The required object element references an oslevel_object and the optional state element specifies the metadata to check.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="aix-def_osleveltst">
<sch:rule context="aix-def:oslevel_test/aix-def:object">
<sch:assert test="@object_ref=ancestor::oval-def:oval_definitions/oval-def:objects/aix-def:oslevel_object/@id"><sch:value-of select="../@id"/> - the object child element of a oslevel_test must reference a oslevel_object</sch:assert>
</sch:rule>
<sch:rule context="aix-def:oslevel_test/aix-def:state">
<sch:assert test="@state_ref=ancestor::oval-def:oval_definitions/oval-def:states/aix-def:oslevel_state/@id"><sch:value-of select="../@id"/> - the state child element of a oslevel_test must reference a oslevel_state</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:TestType">
<xsd:sequence>
<xsd:element name="object" type="oval-def:ObjectRefType" />
<xsd:element name="state" type="oval-def:StateRefType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="oslevel_object" substitutionGroup="oval-def:object">
<xsd:annotation>
<xsd:documentation>The oslevel_object element is used by an oslevel test to define those objects to be evaluated based on a specified state. There is actually only one object relating to oslevel and this is the system as a whole. Therefore, there are no child entities defined. Any OVAL Test written to check oslevel will reference the same oslevel_object which is basically an empty object element.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:ObjectType"/>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="oslevel_state" substitutionGroup="oval-def:state">
<xsd:annotation>
<xsd:documentation>The oslevel_state element defines the information about maintenance level (system version). Please refer to the individual elements in the schema for more details about what each represents.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:StateType">
<xsd:sequence>
<xsd:element name="maintenance_level" type="oval-def:EntityStateVersionType">
<xsd:annotation>
<xsd:documentation>This is the maintenance level (system version) of current AIX operating system.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<!-- =============================================================================== -->
<!-- =============================================================================== -->
<!-- =============================================================================== -->
<xsd:complexType name="EntityStateFilesetStateType">
<xsd:annotation>
<xsd:documentation>The EntityStateFilesetStateType complex type defines the different values that are valid for the state entity of a fileset state. The empty string is also allowed as a valid value to support an empty element that is found when a variable reference is used within the state entity. Note that when using pattern matches and variables care must be taken to ensure that the regular expression and variable values align with the enumerated values.</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="oval-def:EntityStateStringType">
<xsd:enumeration value="APPLIED">
<xsd:annotation>
<xsd:documentation>The specified fileset is installed on the system. The APPLIED state means that the fileset can be rejected with the installp command and the previous level of the fileset restored. This state is only valid for Version 4 fileset updates and 3.2 migrated filesets.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="APPLYING">
<xsd:annotation>
<xsd:documentation>An attempt was made to apply the specified fileset, but it did not complete successfully, and cleanup was not performed.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="BROKEN">
<xsd:annotation>
<xsd:documentation>The specified fileset or fileset update is broken and should be reinstalled before being used.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="COMMITTED">
<xsd:annotation>
<xsd:documentation>The specified fileset is installed on the system. The COMMITTED state means that a commitment has been made to this level of the software. A committed fileset update cannot be rejected, but a committed fileset base level and its updates (regardless of state) can be removed or deinstalled by the installp command.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="COMMITTING">
<xsd:annotation>
<xsd:documentation>An attempt was made to commit the specified fileset, but it did not complete successfully, and cleanup was not performed.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="EFIX LOCKED">
<xsd:annotation>
<xsd:documentation>The specified fileset was installed sucessfully and locked by the interim fix (interim fix) manager.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="OBSOLETE">
<xsd:annotation>
<xsd:documentation>The specified fileset was installed with an earlier version of the operating system but has been replaced by a repackaged (renamed) newer version. Some of the files that belonged to this fileset have been replaced by versions from the repackaged fileset.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="REJECTING">
<xsd:annotation>
<xsd:documentation>An attempt was made to reject the specified fileset, but it did not complete successfully, and cleanup was not performed.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="">
<xsd:annotation>
<xsd:documentation>The empty string value is permitted here to allow for empty elements associated with variable references.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="EntityStateFixInstallationStatusType">
<xsd:annotation>
<xsd:documentation>The EntityStateFixInstallationStatusType complex type defines the different values that are valid for the installation_status entity of a fix_state state. The empty string is also allowed as a valid value to support an empty element that is found when a variable reference is used within the installation_status entity. Note that when using pattern matches and variables care must be taken to ensure that the regular expression and variable values align with the enumerated values.</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="oval-def:EntityStateStringType">
<xsd:enumeration value="ALL_INSTALLED">
<xsd:annotation>
<xsd:documentation>All filesets for XXXXXXX were found</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="SOME_INSTALLED">
<xsd:annotation>
<xsd:documentation>Not all filesets for XXXXXXX were found</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="NONE_INSTALLED">
<xsd:annotation>
<xsd:documentation>No filesets which have fixes for XXXXXXX are currently installed.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="">
<xsd:annotation>
<xsd:documentation>The empty string value is permitted here to allow for empty elements associated with variable references.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="EntityStateInterimFixStateType">
<xsd:annotation>
<xsd:documentation>The EntityStateInterimFixStateType complex type defines the different values that are valid for the state entity of a interim_fix_state state. Please refer to the AIX documentation of Emergency Fix States. The empty string is also allowed as a valid value to support an empty element that is found when a variable reference is used within the state entity. Note that when using pattern matches and variables care must be taken to ensure that the regular expression and variable values align with the enumerated values.</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="oval-def:EntityStateStringType">
<xsd:enumeration value="STABLE">
<xsd:annotation>
<xsd:documentation>The efix was installed with a standard installation, and successfully completed the last installation operation.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="MOUNTED">
<xsd:annotation>
<xsd:documentation>The efix was installed with a mount installation operation, and successfully completed the last installation or mount operation.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="UNMOUNTED">
<xsd:annotation>
<xsd:documentation>The efix was installed with a mount installation operation and one or more efix files were unmounted in a previous emgr command operation.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="BROKEN">
<xsd:annotation>
<xsd:documentation>An unrecoverable error occurred during an installation or removal operation. The status of the efix is unreliable.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="INSTALLING">
<xsd:annotation>
<xsd:documentation>The efix is in the process of installing.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="REBOOT_REQUIRED">
<xsd:annotation>
<xsd:documentation>The efix was installed successfully and requires a reboot to fully integrate into the target system.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="REMOVING">
<xsd:annotation>
<xsd:documentation>The efix is in the process of being removed.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="">
<xsd:annotation>
<xsd:documentation>The empty string value is permitted here to allow for empty elements associated with variable references.</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
</xsd:schema>
|
{
"pile_set_name": "Github"
}
|
class IssuableSubscriptionClass {
}
|
{
"pile_set_name": "Github"
}
|
echo done
|
{
"pile_set_name": "Github"
}
|
/* Copyright (C) 2002-2006 Jean-Marc Valin
File: cb_search.c
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "cb_search.h"
#include "filters.h"
#include "stack_alloc.h"
#include "vq.h"
#include "arch.h"
#include "math_approx.h"
#include "os_support.h"
#ifdef _USE_SSE
#include "cb_search_sse.h"
#elif defined(ARM4_ASM) || defined(ARM5E_ASM)
#include "cb_search_arm4.h"
#elif defined(BFIN_ASM)
#include "cb_search_bfin.h"
#endif
#ifndef OVERRIDE_COMPUTE_WEIGHTED_CODEBOOK
static void compute_weighted_codebook(const signed char *shape_cb, const spx_word16_t *r, spx_word16_t *resp, spx_word16_t *resp2, spx_word32_t *E, int shape_cb_size, int subvect_size, char *stack)
{
int i, j, k;
VARDECL(spx_word16_t *shape);
ALLOC(shape, subvect_size, spx_word16_t);
for (i=0;i<shape_cb_size;i++)
{
spx_word16_t *res;
res = resp+i*subvect_size;
for (k=0;k<subvect_size;k++)
shape[k] = (spx_word16_t)shape_cb[i*subvect_size+k];
E[i]=0;
/* Compute codeword response using convolution with impulse response */
for(j=0;j<subvect_size;j++)
{
spx_word32_t resj=0;
spx_word16_t res16;
for (k=0;k<=j;k++)
resj = MAC16_16(resj,shape[k],r[j-k]);
#ifdef FIXED_POINT
res16 = EXTRACT16(SHR32(resj, 13));
#else
res16 = 0.03125f*resj;
#endif
/* Compute codeword energy */
E[i]=MAC16_16(E[i],res16,res16);
res[j] = res16;
/*printf ("%d\n", (int)res[j]);*/
}
}
}
#endif
#ifndef OVERRIDE_TARGET_UPDATE
static inline void target_update(spx_word16_t *t, spx_word16_t g, spx_word16_t *r, int len)
{
int n;
for (n=0;n<len;n++)
t[n] = SUB16(t[n],PSHR32(MULT16_16(g,r[n]),13));
}
#endif
static void split_cb_search_shape_sign_N1(
spx_word16_t target[], /* target vector */
spx_coef_t ak[], /* LPCs for this subframe */
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
const void *par, /* Codebook/search parameters*/
int p, /* number of LPC coeffs */
int nsf, /* number of samples in subframe */
spx_sig_t *exc,
spx_word16_t *r,
SpeexBits *bits,
char *stack,
int update_target
)
{
int i,j,m,q;
VARDECL(spx_word16_t *resp);
#ifdef _USE_SSE
VARDECL(__m128 *resp2);
VARDECL(__m128 *E);
#else
spx_word16_t *resp2;
VARDECL(spx_word32_t *E);
#endif
VARDECL(spx_word16_t *t);
VARDECL(spx_sig_t *e);
const signed char *shape_cb;
int shape_cb_size, subvect_size, nb_subvect;
const split_cb_params *params;
int best_index;
spx_word32_t best_dist;
int have_sign;
params = (const split_cb_params *) par;
subvect_size = params->subvect_size;
nb_subvect = params->nb_subvect;
shape_cb_size = 1<<params->shape_bits;
shape_cb = params->shape_cb;
have_sign = params->have_sign;
ALLOC(resp, shape_cb_size*subvect_size, spx_word16_t);
#ifdef _USE_SSE
ALLOC(resp2, (shape_cb_size*subvect_size)>>2, __m128);
ALLOC(E, shape_cb_size>>2, __m128);
#else
resp2 = resp;
ALLOC(E, shape_cb_size, spx_word32_t);
#endif
ALLOC(t, nsf, spx_word16_t);
ALLOC(e, nsf, spx_sig_t);
/* FIXME: Do we still need to copy the target? */
SPEEX_COPY(t, target, nsf);
compute_weighted_codebook(shape_cb, r, resp, resp2, E, shape_cb_size, subvect_size, stack);
for (i=0;i<nb_subvect;i++)
{
spx_word16_t *x=t+subvect_size*i;
/*Find new n-best based on previous n-best j*/
if (have_sign)
vq_nbest_sign(x, resp2, subvect_size, shape_cb_size, E, 1, &best_index, &best_dist, stack);
else
vq_nbest(x, resp2, subvect_size, shape_cb_size, E, 1, &best_index, &best_dist, stack);
speex_bits_pack(bits,best_index,params->shape_bits+have_sign);
{
int rind;
spx_word16_t *res;
spx_word16_t sign=1;
rind = best_index;
if (rind>=shape_cb_size)
{
sign=-1;
rind-=shape_cb_size;
}
res = resp+rind*subvect_size;
if (sign>0)
for (m=0;m<subvect_size;m++)
t[subvect_size*i+m] = SUB16(t[subvect_size*i+m], res[m]);
else
for (m=0;m<subvect_size;m++)
t[subvect_size*i+m] = ADD16(t[subvect_size*i+m], res[m]);
#ifdef FIXED_POINT
if (sign==1)
{
for (j=0;j<subvect_size;j++)
e[subvect_size*i+j]=SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5);
} else {
for (j=0;j<subvect_size;j++)
e[subvect_size*i+j]=NEG32(SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5));
}
#else
for (j=0;j<subvect_size;j++)
e[subvect_size*i+j]=sign*0.03125*shape_cb[rind*subvect_size+j];
#endif
}
for (m=0;m<subvect_size;m++)
{
spx_word16_t g;
int rind;
spx_word16_t sign=1;
rind = best_index;
if (rind>=shape_cb_size)
{
sign=-1;
rind-=shape_cb_size;
}
q=subvect_size-m;
#ifdef FIXED_POINT
g=sign*shape_cb[rind*subvect_size+m];
#else
g=sign*0.03125*shape_cb[rind*subvect_size+m];
#endif
target_update(t+subvect_size*(i+1), g, r+q, nsf-subvect_size*(i+1));
}
}
/* Update excitation */
/* FIXME: We could update the excitation directly above */
for (j=0;j<nsf;j++)
exc[j]=ADD32(exc[j],e[j]);
/* Update target: only update target if necessary */
if (update_target)
{
VARDECL(spx_word16_t *r2);
ALLOC(r2, nsf, spx_word16_t);
for (j=0;j<nsf;j++)
r2[j] = EXTRACT16(PSHR32(e[j] ,6));
syn_percep_zero16(r2, ak, awk1, awk2, r2, nsf,p, stack);
for (j=0;j<nsf;j++)
target[j]=SUB16(target[j],PSHR16(r2[j],2));
}
}
void split_cb_search_shape_sign(
spx_word16_t target[], /* target vector */
spx_coef_t ak[], /* LPCs for this subframe */
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
const void *par, /* Codebook/search parameters*/
int p, /* number of LPC coeffs */
int nsf, /* number of samples in subframe */
spx_sig_t *exc,
spx_word16_t *r,
SpeexBits *bits,
char *stack,
int complexity,
int update_target
)
{
int i,j,k,m,n,q;
VARDECL(spx_word16_t *resp);
#ifdef _USE_SSE
VARDECL(__m128 *resp2);
VARDECL(__m128 *E);
#else
spx_word16_t *resp2;
VARDECL(spx_word32_t *E);
#endif
VARDECL(spx_word16_t *t);
VARDECL(spx_sig_t *e);
VARDECL(spx_word16_t *tmp);
VARDECL(spx_word32_t *ndist);
VARDECL(spx_word32_t *odist);
VARDECL(int *itmp);
VARDECL(spx_word16_t **ot2);
VARDECL(spx_word16_t **nt2);
spx_word16_t **ot, **nt;
VARDECL(int **nind);
VARDECL(int **oind);
VARDECL(int *ind);
const signed char *shape_cb;
int shape_cb_size, subvect_size, nb_subvect;
const split_cb_params *params;
int N=2;
VARDECL(int *best_index);
VARDECL(spx_word32_t *best_dist);
VARDECL(int *best_nind);
VARDECL(int *best_ntarget);
int have_sign;
N=complexity;
if (N>10)
N=10;
/* Complexity isn't as important for the codebooks as it is for the pitch */
N=(2*N)/3;
if (N<1)
N=1;
if (N==1)
{
split_cb_search_shape_sign_N1(target,ak,awk1,awk2,par,p,nsf,exc,r,bits,stack,update_target);
return;
}
ALLOC(ot2, N, spx_word16_t*);
ALLOC(nt2, N, spx_word16_t*);
ALLOC(oind, N, int*);
ALLOC(nind, N, int*);
params = (const split_cb_params *) par;
subvect_size = params->subvect_size;
nb_subvect = params->nb_subvect;
shape_cb_size = 1<<params->shape_bits;
shape_cb = params->shape_cb;
have_sign = params->have_sign;
ALLOC(resp, shape_cb_size*subvect_size, spx_word16_t);
#ifdef _USE_SSE
ALLOC(resp2, (shape_cb_size*subvect_size)>>2, __m128);
ALLOC(E, shape_cb_size>>2, __m128);
#else
resp2 = resp;
ALLOC(E, shape_cb_size, spx_word32_t);
#endif
ALLOC(t, nsf, spx_word16_t);
ALLOC(e, nsf, spx_sig_t);
ALLOC(ind, nb_subvect, int);
ALLOC(tmp, 2*N*nsf, spx_word16_t);
for (i=0;i<N;i++)
{
ot2[i]=tmp+2*i*nsf;
nt2[i]=tmp+(2*i+1)*nsf;
}
ot=ot2;
nt=nt2;
ALLOC(best_index, N, int);
ALLOC(best_dist, N, spx_word32_t);
ALLOC(best_nind, N, int);
ALLOC(best_ntarget, N, int);
ALLOC(ndist, N, spx_word32_t);
ALLOC(odist, N, spx_word32_t);
ALLOC(itmp, 2*N*nb_subvect, int);
for (i=0;i<N;i++)
{
nind[i]=itmp+2*i*nb_subvect;
oind[i]=itmp+(2*i+1)*nb_subvect;
}
SPEEX_COPY(t, target, nsf);
for (j=0;j<N;j++)
SPEEX_COPY(&ot[j][0], t, nsf);
/* Pre-compute codewords response and energy */
compute_weighted_codebook(shape_cb, r, resp, resp2, E, shape_cb_size, subvect_size, stack);
for (j=0;j<N;j++)
odist[j]=0;
/*For all subvectors*/
for (i=0;i<nb_subvect;i++)
{
/*"erase" nbest list*/
for (j=0;j<N;j++)
ndist[j]=VERY_LARGE32;
/* This is not strictly necessary, but it provides an additonal safety
to prevent crashes in case something goes wrong in the previous
steps (e.g. NaNs) */
for (j=0;j<N;j++)
best_nind[j] = best_ntarget[j] = 0;
/*For all n-bests of previous subvector*/
for (j=0;j<N;j++)
{
spx_word16_t *x=ot[j]+subvect_size*i;
spx_word32_t tener = 0;
for (m=0;m<subvect_size;m++)
tener = MAC16_16(tener, x[m],x[m]);
#ifdef FIXED_POINT
tener = SHR32(tener,1);
#else
tener *= .5;
#endif
/*Find new n-best based on previous n-best j*/
if (have_sign)
vq_nbest_sign(x, resp2, subvect_size, shape_cb_size, E, N, best_index, best_dist, stack);
else
vq_nbest(x, resp2, subvect_size, shape_cb_size, E, N, best_index, best_dist, stack);
/*For all new n-bests*/
for (k=0;k<N;k++)
{
/* Compute total distance (including previous sub-vectors */
spx_word32_t err = ADD32(ADD32(odist[j],best_dist[k]),tener);
/*update n-best list*/
if (err<ndist[N-1])
{
for (m=0;m<N;m++)
{
if (err < ndist[m])
{
for (n=N-1;n>m;n--)
{
ndist[n] = ndist[n-1];
best_nind[n] = best_nind[n-1];
best_ntarget[n] = best_ntarget[n-1];
}
/* n is equal to m here, so they're interchangeable */
ndist[m] = err;
best_nind[n] = best_index[k];
best_ntarget[n] = j;
break;
}
}
}
}
if (i==0)
break;
}
for (j=0;j<N;j++)
{
/*previous target (we don't care what happened before*/
for (m=(i+1)*subvect_size;m<nsf;m++)
nt[j][m]=ot[best_ntarget[j]][m];
/* New code: update the rest of the target only if it's worth it */
for (m=0;m<subvect_size;m++)
{
spx_word16_t g;
int rind;
spx_word16_t sign=1;
rind = best_nind[j];
if (rind>=shape_cb_size)
{
sign=-1;
rind-=shape_cb_size;
}
q=subvect_size-m;
#ifdef FIXED_POINT
g=sign*shape_cb[rind*subvect_size+m];
#else
g=sign*0.03125*shape_cb[rind*subvect_size+m];
#endif
target_update(nt[j]+subvect_size*(i+1), g, r+q, nsf-subvect_size*(i+1));
}
for (q=0;q<nb_subvect;q++)
nind[j][q]=oind[best_ntarget[j]][q];
nind[j][i]=best_nind[j];
}
/*update old-new data*/
/* just swap pointers instead of a long copy */
{
spx_word16_t **tmp2;
tmp2=ot;
ot=nt;
nt=tmp2;
}
for (j=0;j<N;j++)
for (m=0;m<nb_subvect;m++)
oind[j][m]=nind[j][m];
for (j=0;j<N;j++)
odist[j]=ndist[j];
}
/*save indices*/
for (i=0;i<nb_subvect;i++)
{
ind[i]=nind[0][i];
speex_bits_pack(bits,ind[i],params->shape_bits+have_sign);
}
/* Put everything back together */
for (i=0;i<nb_subvect;i++)
{
int rind;
spx_word16_t sign=1;
rind = ind[i];
if (rind>=shape_cb_size)
{
sign=-1;
rind-=shape_cb_size;
}
#ifdef FIXED_POINT
if (sign==1)
{
for (j=0;j<subvect_size;j++)
e[subvect_size*i+j]=SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5);
} else {
for (j=0;j<subvect_size;j++)
e[subvect_size*i+j]=NEG32(SHL32(EXTEND32(shape_cb[rind*subvect_size+j]),SIG_SHIFT-5));
}
#else
for (j=0;j<subvect_size;j++)
e[subvect_size*i+j]=sign*0.03125*shape_cb[rind*subvect_size+j];
#endif
}
/* Update excitation */
for (j=0;j<nsf;j++)
exc[j]=ADD32(exc[j],e[j]);
/* Update target: only update target if necessary */
if (update_target)
{
VARDECL(spx_word16_t *r2);
ALLOC(r2, nsf, spx_word16_t);
for (j=0;j<nsf;j++)
r2[j] = EXTRACT16(PSHR32(e[j] ,6));
syn_percep_zero16(r2, ak, awk1, awk2, r2, nsf,p, stack);
for (j=0;j<nsf;j++)
target[j]=SUB16(target[j],PSHR16(r2[j],2));
}
}
void split_cb_shape_sign_unquant(
spx_sig_t *exc,
const void *par, /* non-overlapping codebook */
int nsf, /* number of samples in subframe */
SpeexBits *bits,
char *stack,
spx_int32_t *seed
)
{
int i,j;
VARDECL(int *ind);
VARDECL(int *signs);
const signed char *shape_cb;
int shape_cb_size, subvect_size, nb_subvect;
const split_cb_params *params;
int have_sign;
params = (const split_cb_params *) par;
subvect_size = params->subvect_size;
nb_subvect = params->nb_subvect;
shape_cb_size = 1<<params->shape_bits;
shape_cb = params->shape_cb;
have_sign = params->have_sign;
ALLOC(ind, nb_subvect, int);
ALLOC(signs, nb_subvect, int);
/* Decode codewords and gains */
for (i=0;i<nb_subvect;i++)
{
if (have_sign)
signs[i] = speex_bits_unpack_unsigned(bits, 1);
else
signs[i] = 0;
ind[i] = speex_bits_unpack_unsigned(bits, params->shape_bits);
}
/* Compute decoded excitation */
for (i=0;i<nb_subvect;i++)
{
spx_word16_t s=1;
if (signs[i])
s=-1;
#ifdef FIXED_POINT
if (s==1)
{
for (j=0;j<subvect_size;j++)
exc[subvect_size*i+j]=SHL32(EXTEND32(shape_cb[ind[i]*subvect_size+j]),SIG_SHIFT-5);
} else {
for (j=0;j<subvect_size;j++)
exc[subvect_size*i+j]=NEG32(SHL32(EXTEND32(shape_cb[ind[i]*subvect_size+j]),SIG_SHIFT-5));
}
#else
for (j=0;j<subvect_size;j++)
exc[subvect_size*i+j]+=s*0.03125*shape_cb[ind[i]*subvect_size+j];
#endif
}
}
void noise_codebook_quant(
spx_word16_t target[], /* target vector */
spx_coef_t ak[], /* LPCs for this subframe */
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
const void *par, /* Codebook/search parameters*/
int p, /* number of LPC coeffs */
int nsf, /* number of samples in subframe */
spx_sig_t *exc,
spx_word16_t *r,
SpeexBits *bits,
char *stack,
int complexity,
int update_target
)
{
int i;
VARDECL(spx_word16_t *tmp);
ALLOC(tmp, nsf, spx_word16_t);
residue_percep_zero16(target, ak, awk1, awk2, tmp, nsf, p, stack);
for (i=0;i<nsf;i++)
exc[i]+=SHL32(EXTEND32(tmp[i]),8);
SPEEX_MEMSET(target, 0, nsf);
}
void noise_codebook_unquant(
spx_sig_t *exc,
const void *par, /* non-overlapping codebook */
int nsf, /* number of samples in subframe */
SpeexBits *bits,
char *stack,
spx_int32_t *seed
)
{
int i;
/* FIXME: This is bad, but I don't think the function ever gets called anyway */
for (i=0;i<nsf;i++)
exc[i]=SHL32(EXTEND32(speex_rand(1, seed)),SIG_SHIFT);
}
|
{
"pile_set_name": "Github"
}
|
/* NOTICE: This file has been changed by Plutext Pty Ltd for use in docx4j.
* The package name has been changed; there may also be other changes.
*
* This notice is included to meet the condition in clause 4(b) of the License.
*/
/* ====================================================================
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.docx4j.org.apache.poi.poifs.property;
import java.util.Iterator;
import java.io.IOException;
/**
* Behavior for parent (directory) properties
*
* @author Marc Johnson27591@hotmail.com
*/
public interface Parent
extends Child
{
/**
* Get an iterator over the children of this Parent; all elements
* are instances of Property.
*
* @return Iterator of children; may refer to an empty collection
*/
public Iterator getChildren();
/**
* Add a new child to the collection of children
*
* @param property the new child to be added; must not be null
*
* @exception IOException if the Parent already has a child with
* the same name
*/
public void addChild(final Property property)
throws IOException;
/**
* Set the previous Child
*
* @param child the new 'previous' child; may be null, which has
* the effect of saying there is no 'previous' child
*/
public void setPreviousChild(final Child child);
/**
* Set the next Child
*
* @param child the new 'next' child; may be null, which has the
* effect of saying there is no 'next' child
*/
public void setNextChild(final Child child);
/** *** end methods from interface Child *** */
} // end public interface Parent
|
{
"pile_set_name": "Github"
}
|
package main
// Copyright 2019 Rancher Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
import (
"os"
"path/filepath"
"github.com/docker/docker/pkg/mount"
"github.com/docker/docker/pkg/reexec"
"github.com/rancher/k3os/pkg/cli/app"
"github.com/rancher/k3os/pkg/enterchroot"
"github.com/rancher/k3os/pkg/transferroot"
"github.com/sirupsen/logrus"
)
func main() {
reexec.Register("/init", initrd) // mode=live
reexec.Register("/sbin/init", initrd) // mode=local
reexec.Register("enter-root", enterchroot.Enter)
if !reexec.Init() {
app := app.New()
args := []string{app.Name}
path := filepath.Base(os.Args[0])
if path != app.Name && app.Command(path) != nil {
args = append(args, path)
}
args = append(args, os.Args[1:]...)
// this will bomb if the app has any non-defaulted, required flags
err := app.Run(args)
if err != nil {
logrus.Fatal(err)
}
}
}
func initrd() {
enterchroot.DebugCmdline = "k3os.debug"
transferroot.Relocate()
if err := mount.Mount("", "/", "none", "rw,remount"); err != nil {
logrus.Errorf("failed to remount root as rw: %v", err)
}
if err := enterchroot.Mount("./k3os/data", os.Args, os.Stdout, os.Stderr); err != nil {
logrus.Fatalf("failed to enter root: %v", err)
}
}
|
{
"pile_set_name": "Github"
}
|
//
// checkTimeOptionsNoConstant.H
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Foam::label startTime = 0;
Foam::label endTime = Times.size();
// check -time and -latestTime options
# include "checkTimeOption.H"
|
{
"pile_set_name": "Github"
}
|
<?php
defined('C5_EXECUTE') or die("Access Denied.");
class Concrete5_Controller_Dashboard_System_BackupRestore_Database extends DashboardBaseController {
public function view(){
}
public function export_database_schema() {
if (!ENABLE_DEVELOPER_OPTIONS) {
return false;
}
$db = Loader::db();
$ab = Database::getADOSChema();
$xml = $ab->ExtractSchema();
$this->set('schema', $xml);
}
public function refresh_database_schema() {
if ($this->token->validate("refresh_database_schema")) {
$msg = '';
if ($this->post('refresh_global_schema')) {
// refresh concrete/config/db.xml and all installed blocks
$cnt = Loader::controller("/upgrade");
try {
$cnt->refresh_schema();
$msg .= t('Core database files and installed blocks refreshed.');
} catch(Exception $e) {
$this->set('error', $e);
}
}
if ($this->post('refresh_local_schema')) {
// refresh concrete/config/db.xml and all installed blocks
if (file_exists('config/' . FILENAME_LOCAL_DB)) {
try {
Package::installDB(DIR_BASE . '/config/' . FILENAME_LOCAL_DB);
$msg .= ' ' . t('Local database file refreshed.');
} catch(Exception $e) {
$this->set('error', $e);
}
}
}
if (!$this->post('refresh_local_schema') && !$this->post('refresh_global_schema')) {
$e = Loader::helper('validation/error');
$e->add(t('You must choose an option to refresh.'));
$this->set('error', $e);
}
$msg = trim($msg);
$this->set('message', $msg);
} else {
$this->set('error', array($this->token->getErrorMessage()));
}
}
}
|
{
"pile_set_name": "Github"
}
|
define({
zh: {
'Allowed values:' : '允許值:',
'Compare all with predecessor': '預先比較所有',
'compare changes to:' : '比較變更:',
'compared to' : '對比',
'Default value:' : '默認值:',
'Description' : '描述',
'Field' : '字段',
'General' : '概括',
'Generated with' : '生成工具',
'Name' : '名稱',
'No response values.' : '無對應資料.',
'optional' : '選項',
'Parameter' : '參數',
'Permission:' : '允許:',
'Response' : '回應',
'Send' : '發送',
'Send a Sample Request' : '發送試用需求',
'show up to version:' : '顯示到版本:',
'Size range:' : '尺寸範圍:',
'Type' : '類型',
'url' : '網址'
}
});
|
{
"pile_set_name": "Github"
}
|
%%%=============================================================================
%%% @copyright (C) 2018, Aeternity Anstalt
%%% @doc
%%% ADT for keeping the state of State Channels
%%% @end
%%%=============================================================================
-module(aesc_state_tree).
%% API
-export([commit_to_db/1,
delete/2,
empty/0,
empty_with_backend/0,
enter/2,
get/2,
lookup/2,
mtree_iterator/1,
new_with_backend/1,
root_hash/1]).
-export([ from_binary_without_backend/1
, to_binary_without_backend/1
]).
%%%===================================================================
%%% Types
%%%===================================================================
-type channel() :: aesc_channels:channel().
-type chkey() :: aesc_channels:pubkey().
-type chvalue() :: aesc_channels:serialized().
-opaque tree() :: aeu_mtrees:mtree(chkey(), chvalue()).
-export_type([tree/0]).
-define(VSN, 1).
%%%===================================================================
%%% API
%%%===================================================================
-spec commit_to_db(tree()) -> tree().
commit_to_db(Tree) ->
aeu_mtrees:commit_to_db(Tree).
-spec delete(aesc_channels:pubkey(), tree()) -> tree().
delete(PubKey, Tree) ->
aeu_mtrees:delete(PubKey, Tree).
-spec empty() -> tree().
empty() ->
aeu_mtrees:empty().
-spec empty_with_backend() -> tree().
empty_with_backend() ->
aeu_mtrees:empty_with_backend(aec_db_backends:channels_backend()).
-spec new_with_backend(aeu_mtrees:root_hash() | 'empty') -> tree().
new_with_backend(Hash) ->
aeu_mtrees:new_with_backend(Hash, aec_db_backends:channels_backend()).
-spec enter(channel(), tree()) -> tree().
enter(Channel, Tree) ->
PubKey = aesc_channels:pubkey(Channel),
Serialized = aesc_channels:serialize(Channel),
aeu_mtrees:enter(PubKey, Serialized, Tree).
-spec get(chkey(), tree()) -> aesc_channels:channel().
get(Id, Tree) ->
aesc_channels:deserialize(Id, aeu_mtrees:get(Id, Tree)).
-spec lookup(chkey(), tree()) -> {value, channel()} | none.
lookup(PubKey, Tree) ->
case aeu_mtrees:lookup(PubKey, Tree) of
{value, Val} -> {value, aesc_channels:deserialize(PubKey, Val)};
none -> none
end.
-spec root_hash(tree()) -> {ok, aeu_mtrees:root_hash()} | {error, empty}.
root_hash(Tree) ->
aeu_mtrees:root_hash(Tree).
-spec to_binary_without_backend(tree()) -> binary().
to_binary_without_backend(Tree) ->
Bin = aeu_mtrees:serialize(Tree),
aeser_chain_objects:serialize(
channels_mtree,
?VSN,
serialization_template(?VSN),
[{channels, Bin}]).
-spec from_binary_without_backend(binary()) -> tree().
from_binary_without_backend(Bin) ->
[{channels, ChannelsBin}] =
aeser_chain_objects:deserialize(channels_mtree, ?VSN,
serialization_template(?VSN), Bin),
aeu_mtrees:deserialize(ChannelsBin).
serialization_template(?VSN) ->
[{channels, binary}].
-spec mtree_iterator(tree()) -> aeu_mtrees:iterator().
mtree_iterator(Tree) ->
aeu_mtrees:iterator(Tree).
|
{
"pile_set_name": "Github"
}
|
{
"Name": "The .NET Core ORM Cookbook",
"Source": ".",
"Destination": "..\\..\\docs",
"IncludeSource": "Includes",
"Theme": "Light",
"Footer": "The ORM Cookbook. <a href='https://github.com/Grauenwolf/DotNet-ORM-Cookbook' target='_blank'>Visit us at GitHub</a>.",
"ConvertLocalLinks": "true",
"Pages": {
"__index": "index.md",
"ORMs": {
"ADO.NET": "ADO.md",
"Chain": "Chain.md",
"Dapper": "Dapper.md",
"DbConnector": "DbConnector.md",
"Entity Framework 6": "EF6.md",
"Entity Framework Core": "EFCore.md",
"LINQ to DB": "LinqToDB.md",
"LLBLGen Pro": "LLBLGenPro.md",
"NHibernate": "NHibernate.md",
"RepoDb": "RepoDb.md",
"ServiceStack": "ServiceStack.md"
},
"FAQ": "FAQ.md",
"Standard CRUD scenarios": {
"Operations on a single entity type": "SingleModelCrud.md",
"Operations on sets": "MultipleCrud.md",
"Operations on a graph of multiple entity types": "ModelWithChildren.md",
"Operations on immutable entities": "Immutable.md",
"Handling failures and exceptions": "TryCrud.md",
"Operations with a Foreign Key based Lookup Table": {
"FK Lookup table using an integer-based Foreign Key": "ModelWithLookupSimple.md",
"FK Lookup table using an object-based Foreign Key": "ModelWithLookupComplex.md"
}
},
"Fetching data scenarios": {
"Projecting with a Join": "Joins.md",
"Reading from Views": "Views.md",
"Row Counts": "RowCount.md",
"Paging Results": "Pagination.md",
"Populate DataTable": "PopulateDataTable.md",
"Reading a Salar Value from a Row": "ScalarValue.md",
"Reading a Single Column from a Table": "SingleColumn.md"
},
"Advanced scenarios": {
"Async Operations": "SingleModelCrudAsync.md",
"Batch Inserts with Large Collections": "LargeBatch.md",
"Bulk Inserts": "BulkInsert.md",
"Connection Sharing": "ConnectionSharing.md",
"Multiple Databases": "MultipleDB.md",
"Partial Updates": "PartialUpdate.md",
"Transactions": "Transactions.md",
"Upsert": "Upsert.md"
},
"Sorting scenarios": {
"Basic Sorting": "Sorting.md",
"Sorting by Dynamically Chosen Columns": "DynamicSorting.md"
},
"Stored procedure scenarios": {
"Basic Stored Procedures": "BasicStoredProc.md"
},
"Auditing and history scenarios": {
"Audit Columns": "AuditColumns.md",
"Soft Delete": "SoftDelete.md"
},
"Multi-Tenancy scenarios": {
"Query Filter": "QueryFilter.md"
}
}
}
|
{
"pile_set_name": "Github"
}
|
cheats = 12
cheat0_desc = "Player 1: All Stuff Available"
cheat0_code = "50003802 0000+810F4230 FFFF"
cheat0_enable = false
cheat1_desc = "All Multiplayer Stages (Except Final 3 - You Get Those Through Solo)"
cheat1_code = "810F429A 03FF+810F429C FFFF+810F429E FFFF+810F42A0 FFFF"
cheat1_enable = false
cheat2_desc = "All Equipment Unlocked"
cheat2_code = "50001402 0000+810F40B0 FFFF"
cheat2_enable = false
cheat3_desc = "All Equipment Registered"
cheat3_code = "50001402 0000+810F40D8 FFFF"
cheat3_enable = false
cheat4_desc = "All Equipment Unhighlighted"
cheat4_code = "50001402 0000+810F4100 FFFF"
cheat4_enable = false
cheat5_desc = "Player 1: All Help/Notes Available"
cheat5_code = "50000602 0000+810F409C FFFF"
cheat5_enable = false
cheat6_desc = "Have All Three Final Arenas"
cheat6_code = "810F429A 03FF+810F429C FFFF+810F429E FFFF+810F42A0 FFFF+800F426F 00FF+800F42AF 00FF"
cheat6_enable = false
cheat7_desc = "Jameson, Not Dark Ray II"
cheat7_code = "8115A452 379C+8015A55B 00BC"
cheat7_enable = false
cheat8_desc = "Dark Ray II, Not Ray II"
cheat8_code = "8015A355 0006+8115A356 1C64+8115A45E 2AAC"
cheat8_enable = false
cheat9_desc = "Player 1's Side Invincible"
cheat9_code = "811FC00C 447A"
cheat9_enable = false
cheat10_desc = "Player 2's Side Invincible"
cheat10_code = "811FC034 447A"
cheat10_enable = false
cheat11_desc = "Master Code"
cheat11_code = "F105ED10 2400"
cheat11_enable = false
|
{
"pile_set_name": "Github"
}
|
/* general.h -- defines that everybody likes to use. */
/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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.
Bash 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 Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (_GENERAL_H_)
#define _GENERAL_H_
#include "stdc.h"
#include "bashtypes.h"
#include "chartypes.h"
#if defined (HAVE_SYS_RESOURCE_H) && defined (RLIMTYPE)
# if defined (HAVE_SYS_TIME_H)
# include <sys/time.h>
# endif
# include <sys/resource.h>
#endif
#if defined (HAVE_STRING_H)
# include <string.h>
#else
# include <strings.h>
#endif /* !HAVE_STRING_H */
#if defined (HAVE_LIMITS_H)
# include <limits.h>
#endif
#include "xmalloc.h"
/* NULL pointer type. */
#if !defined (NULL)
# if defined (__STDC__)
# define NULL ((void *) 0)
# else
# define NULL 0x0
# endif /* !__STDC__ */
#endif /* !NULL */
/* Hardly used anymore */
#define pointer_to_int(x) (int)((char *)x - (char *)0)
#if defined (alpha) && defined (__GNUC__) && !defined (strchr) && !defined (__STDC__)
extern char *strchr (), *strrchr ();
#endif
#if !defined (strcpy) && (defined (HAVE_DECL_STRCPY) && !HAVE_DECL_STRCPY)
extern char *strcpy __P((char *, const char *));
#endif
#if !defined (savestring)
# define savestring(x) (char *)strcpy (xmalloc (1 + strlen (x)), (x))
#endif
#ifndef member
# define member(c, s) ((c) ? ((char *)mbschr ((s), (c)) != (char *)NULL) : 0)
#endif
#ifndef whitespace
#define whitespace(c) (((c) == ' ') || ((c) == '\t'))
#endif
#ifndef CHAR_MAX
# ifdef __CHAR_UNSIGNED__
# define CHAR_MAX 0xff
# else
# define CHAR_MAX 0x7f
# endif
#endif
#ifndef CHAR_BIT
# define CHAR_BIT 8
#endif
/* Nonzero if the integer type T is signed. */
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
/* The width in bits of the integer type or expression T.
Padding bits are not supported; this is checked at compile-time below. */
#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
/* Bound on length of the string representing an unsigned integer
value representable in B bits. log10 (2.0) < 146/485. The
smallest value of B where this bound is not tight is 2621. */
#define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)
/* Bound on length of the string representing an integer value of type T.
Subtract one for the sign bit if T is signed;
302 / 1000 is log10 (2) rounded up;
add one for integer division truncation;
add one more for a minus sign if t is signed. */
#define INT_STRLEN_BOUND(t) \
((TYPE_WIDTH (t) - TYPE_SIGNED (t)) * 302 / 1000 \
+ 1 + TYPE_SIGNED (t))
/* Updated version adapted from gnulib/intprops.h, not used right now.
Changes the approximation of log10(2) from 302/1000 to 146/485. */
#if 0
#define INT_STRLEN_BOUND(t) \
(INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - TYPE_SIGNED (t)) + TYPE_SIGNED(t))
#endif
/* Bound on buffer size needed to represent an integer type or expression T,
including the terminating null. */
#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
/* Define exactly what a legal shell identifier consists of. */
#define legal_variable_starter(c) (ISALPHA(c) || (c == '_'))
#define legal_variable_char(c) (ISALNUM(c) || c == '_')
/* Definitions used in subst.c and by the `read' builtin for field
splitting. */
#define spctabnl(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
/* All structs which contain a `next' field should have that field
as the first field in the struct. This means that functions
can be written to handle the general case for linked lists. */
typedef struct g_list {
struct g_list *next;
} GENERIC_LIST;
/* Here is a generic structure for associating character strings
with integers. It is used in the parser for shell tokenization. */
typedef struct {
char *word;
int token;
} STRING_INT_ALIST;
/* A macro to avoid making an unnecessary function call. */
#define REVERSE_LIST(list, type) \
((list && list->next) ? (type)list_reverse ((GENERIC_LIST *)list) \
: (type)(list))
#if __GNUC__ > 1
# define FASTCOPY(s, d, n) __builtin_memcpy ((d), (s), (n))
#else /* !__GNUC__ */
# if !defined (HAVE_BCOPY)
# if !defined (HAVE_MEMMOVE)
# define FASTCOPY(s, d, n) memcpy ((d), (s), (n))
# else
# define FASTCOPY(s, d, n) memmove ((d), (s), (n))
# endif /* !HAVE_MEMMOVE */
# else /* HAVE_BCOPY */
# define FASTCOPY(s, d, n) bcopy ((s), (d), (n))
# endif /* HAVE_BCOPY */
#endif /* !__GNUC__ */
/* String comparisons that possibly save a function call each. */
#define STREQ(a, b) ((a)[0] == (b)[0] && strcmp(a, b) == 0)
#define STREQN(a, b, n) ((n == 0) ? (1) \
: ((a)[0] == (b)[0] && strncmp(a, b, n) == 0))
/* More convenience definitions that possibly save system or libc calls. */
#define STRLEN(s) (((s) && (s)[0]) ? ((s)[1] ? ((s)[2] ? strlen(s) : 2) : 1) : 0)
#define FREE(s) do { if (s) free (s); } while (0)
#define MEMBER(c, s) (((c) && c == (s)[0] && !(s)[1]) || (member(c, s)))
/* A fairly hairy macro to check whether an allocated string has more room,
and to resize it using xrealloc if it does not.
STR is the string (char *)
CIND is the current index into the string (int)
ROOM is the amount of additional room we need in the string (int)
CSIZE is the currently-allocated size of STR (int)
SINCR is how much to increment CSIZE before calling xrealloc (int) */
#define RESIZE_MALLOCED_BUFFER(str, cind, room, csize, sincr) \
do { \
if ((cind) + (room) >= csize) \
{ \
while ((cind) + (room) >= csize) \
csize += (sincr); \
str = xrealloc (str, csize); \
} \
} while (0)
/* Function pointers can be declared as (Function *)foo. */
#if !defined (_FUNCTION_DEF)
# define _FUNCTION_DEF
typedef int Function ();
typedef void VFunction ();
typedef char *CPFunction (); /* no longer used */
typedef char **CPPFunction (); /* no longer used */
#endif /* _FUNCTION_DEF */
#ifndef SH_FUNCTION_TYPEDEF
# define SH_FUNCTION_TYPEDEF
/* Shell function typedefs with prototypes */
/* `Generic' function pointer typedefs */
typedef int sh_intfunc_t __P((int));
typedef int sh_ivoidfunc_t __P((void));
typedef int sh_icpfunc_t __P((char *));
typedef int sh_icppfunc_t __P((char **));
typedef int sh_iptrfunc_t __P((PTR_T));
typedef void sh_voidfunc_t __P((void));
typedef void sh_vintfunc_t __P((int));
typedef void sh_vcpfunc_t __P((char *));
typedef void sh_vcppfunc_t __P((char **));
typedef void sh_vptrfunc_t __P((PTR_T));
typedef int sh_wdesc_func_t __P((WORD_DESC *));
typedef int sh_wlist_func_t __P((WORD_LIST *));
typedef int sh_glist_func_t __P((GENERIC_LIST *));
typedef char *sh_string_func_t __P((char *)); /* like savestring, et al. */
typedef int sh_msg_func_t __P((const char *, ...)); /* printf(3)-like */
typedef void sh_vmsg_func_t __P((const char *, ...)); /* printf(3)-like */
/* Specific function pointer typedefs. Most of these could be done
with #defines. */
typedef void sh_sv_func_t __P((char *)); /* sh_vcpfunc_t */
typedef void sh_free_func_t __P((PTR_T)); /* sh_vptrfunc_t */
typedef void sh_resetsig_func_t __P((int)); /* sh_vintfunc_t */
typedef int sh_ignore_func_t __P((const char *)); /* sh_icpfunc_t */
typedef int sh_assign_func_t __P((const char *));
typedef int sh_wassign_func_t __P((WORD_DESC *, int));
typedef int sh_load_func_t __P((char *));
typedef void sh_unload_func_t __P((char *));
typedef int sh_builtin_func_t __P((WORD_LIST *)); /* sh_wlist_func_t */
#endif /* SH_FUNCTION_TYPEDEF */
#define NOW ((time_t) time ((time_t *) 0))
/* Some defines for calling file status functions. */
#define FS_EXISTS 0x1
#define FS_EXECABLE 0x2
#define FS_EXEC_PREFERRED 0x4
#define FS_EXEC_ONLY 0x8
#define FS_DIRECTORY 0x10
#define FS_NODIRS 0x20
#define FS_READABLE 0x40
/* Default maximum for move_to_high_fd */
#define HIGH_FD_MAX 256
/* The type of function passed as the fourth argument to qsort(3). */
#ifdef __STDC__
typedef int QSFUNC (const void *, const void *);
#else
typedef int QSFUNC ();
#endif
/* Some useful definitions for Unix pathnames. Argument convention:
x == string, c == character */
#if !defined (__CYGWIN__)
# define ABSPATH(x) ((x)[0] == '/')
# define RELPATH(x) ((x)[0] != '/')
#else /* __CYGWIN__ */
# define ABSPATH(x) (((x)[0] && ISALPHA((unsigned char)(x)[0]) && (x)[1] == ':') || ISDIRSEP((x)[0]))
# define RELPATH(x) (ABSPATH(x) == 0)
#endif /* __CYGWIN__ */
#define ROOTEDPATH(x) (ABSPATH(x))
#define DIRSEP '/'
#if !defined (__CYGWIN__)
# define ISDIRSEP(c) ((c) == '/')
#else
# define ISDIRSEP(c) ((c) == '/' || (c) == '\\')
#endif /* __CYGWIN__ */
#define PATHSEP(c) (ISDIRSEP(c) || (c) == 0)
#if 0
/* Declarations for functions defined in xmalloc.c */
extern PTR_T xmalloc __P((size_t));
extern PTR_T xrealloc __P((void *, size_t));
extern void xfree __P((void *));
#endif
/* Declarations for functions defined in general.c */
extern void posix_initialize __P((int));
extern int num_posix_options __P((void));
extern char *get_posix_options __P((char *));
extern void set_posix_options __P((const char *));
#if defined (RLIMTYPE)
extern RLIMTYPE string_to_rlimtype __P((char *));
extern void print_rlimtype __P((RLIMTYPE, int));
#endif
extern int all_digits __P((const char *));
extern int legal_number __P((const char *, intmax_t *));
extern int legal_identifier __P((const char *));
extern int importable_function_name __P((const char *, size_t));
extern int exportable_function_name __P((const char *));
extern int check_identifier __P((WORD_DESC *, int));
extern int valid_nameref_value __P((const char *, int));
extern int check_selfref __P((const char *, char *, int));
extern int legal_alias_name __P((const char *, int));
extern int line_isblank __P((const char *));
extern int assignment __P((const char *, int));
extern int sh_unset_nodelay_mode __P((int));
extern int sh_setclexec __P((int));
extern int sh_validfd __P((int));
extern int fd_ispipe __P((int));
extern void check_dev_tty __P((void));
extern int move_to_high_fd __P((int, int, int));
extern int check_binary_file __P((const char *, int));
#ifdef _POSIXSTAT_H_
extern int same_file __P((const char *, const char *, struct stat *, struct stat *));
#endif
extern int sh_openpipe __P((int *));
extern int sh_closepipe __P((int *));
extern int file_exists __P((const char *));
extern int file_isdir __P((const char *));
extern int file_iswdir __P((const char *));
extern int path_dot_or_dotdot __P((const char *));
extern int absolute_pathname __P((const char *));
extern int absolute_program __P((const char *));
extern char *make_absolute __P((const char *, const char *));
extern char *base_pathname __P((char *));
extern char *full_pathname __P((char *));
extern char *polite_directory_format __P((char *));
extern char *trim_pathname __P((char *, int));
extern char *printable_filename __P((char *, int));
extern char *extract_colon_unit __P((char *, int *));
extern void tilde_initialize __P((void));
extern char *bash_tilde_find_word __P((const char *, int, int *));
extern char *bash_tilde_expand __P((const char *, int));
extern int group_member __P((gid_t));
extern char **get_group_list __P((int *));
extern int *get_group_array __P((int *));
extern char *conf_standard_path __P((void));
extern int default_columns __P((void));
#endif /* _GENERAL_H_ */
|
{
"pile_set_name": "Github"
}
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/allocation_description.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "tensorflow/core/framework/allocation_description.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
namespace tensorflow {
namespace {
const ::google::protobuf::Descriptor* AllocationDescription_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
AllocationDescription_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto() GOOGLE_ATTRIBUTE_COLD;
void protobuf_AssignDesc_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto() {
protobuf_AddDesc_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"tensorflow/core/framework/allocation_description.proto");
GOOGLE_CHECK(file != NULL);
AllocationDescription_descriptor_ = file->message_type(0);
static const int AllocationDescription_offsets_[6] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AllocationDescription, requested_bytes_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AllocationDescription, allocated_bytes_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AllocationDescription, allocator_name_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AllocationDescription, allocation_id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AllocationDescription, has_single_reference_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AllocationDescription, ptr_),
};
AllocationDescription_reflection_ =
::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
AllocationDescription_descriptor_,
AllocationDescription::internal_default_instance(),
AllocationDescription_offsets_,
-1,
-1,
-1,
sizeof(AllocationDescription),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AllocationDescription, _internal_metadata_));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
AllocationDescription_descriptor_, AllocationDescription::internal_default_instance());
}
} // namespace
void protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto() {
AllocationDescription_default_instance_.Shutdown();
delete AllocationDescription_reflection_;
}
void protobuf_InitDefaults_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_impl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::internal::GetEmptyString();
AllocationDescription_default_instance_.DefaultConstruct();
AllocationDescription_default_instance_.get_mutable()->InitAsDefaultInstance();
}
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_once_);
void protobuf_InitDefaults_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto() {
::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_once_,
&protobuf_InitDefaults_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_impl);
}
void protobuf_AddDesc_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_impl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
protobuf_InitDefaults_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto();
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n6tensorflow/core/framework/allocation_d"
"escription.proto\022\ntensorflow\"\243\001\n\025Allocat"
"ionDescription\022\027\n\017requested_bytes\030\001 \001(\003\022"
"\027\n\017allocated_bytes\030\002 \001(\003\022\026\n\016allocator_na"
"me\030\003 \001(\t\022\025\n\rallocation_id\030\004 \001(\003\022\034\n\024has_s"
"ingle_reference\030\005 \001(\010\022\013\n\003ptr\030\006 \001(\004B<\n\030or"
"g.tensorflow.frameworkB\033AllocationDescri"
"ptionProtosP\001\370\001\001b\006proto3", 304);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"tensorflow/core/framework/allocation_description.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto);
}
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_once_);
void protobuf_AddDesc_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto() {
::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_once_,
&protobuf_AddDesc_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_impl);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto {
StaticDescriptorInitializer_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto() {
protobuf_AddDesc_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto();
}
} static_descriptor_initializer_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_;
namespace {
static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN;
static void MergeFromFail(int line) {
::google::protobuf::internal::MergeFromFail(__FILE__, line);
}
} // namespace
// ===================================================================
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int AllocationDescription::kRequestedBytesFieldNumber;
const int AllocationDescription::kAllocatedBytesFieldNumber;
const int AllocationDescription::kAllocatorNameFieldNumber;
const int AllocationDescription::kAllocationIdFieldNumber;
const int AllocationDescription::kHasSingleReferenceFieldNumber;
const int AllocationDescription::kPtrFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
AllocationDescription::AllocationDescription()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (this != internal_default_instance()) protobuf_InitDefaults_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto();
SharedCtor();
// @@protoc_insertion_point(constructor:tensorflow.AllocationDescription)
}
AllocationDescription::AllocationDescription(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_InitDefaults_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto();
#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:tensorflow.AllocationDescription)
}
void AllocationDescription::InitAsDefaultInstance() {
}
AllocationDescription::AllocationDescription(const AllocationDescription& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL) {
SharedCtor();
UnsafeMergeFrom(from);
// @@protoc_insertion_point(copy_constructor:tensorflow.AllocationDescription)
}
void AllocationDescription::SharedCtor() {
allocator_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(&requested_bytes_, 0, reinterpret_cast<char*>(&has_single_reference_) -
reinterpret_cast<char*>(&requested_bytes_) + sizeof(has_single_reference_));
_cached_size_ = 0;
}
AllocationDescription::~AllocationDescription() {
// @@protoc_insertion_point(destructor:tensorflow.AllocationDescription)
SharedDtor();
}
void AllocationDescription::SharedDtor() {
::google::protobuf::Arena* arena = GetArenaNoVirtual();
if (arena != NULL) {
return;
}
allocator_name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena);
}
void AllocationDescription::ArenaDtor(void* object) {
AllocationDescription* _this = reinterpret_cast< AllocationDescription* >(object);
(void)_this;
}
void AllocationDescription::RegisterArenaDtor(::google::protobuf::Arena* arena) {
}
void AllocationDescription::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* AllocationDescription::descriptor() {
protobuf_AssignDescriptorsOnce();
return AllocationDescription_descriptor_;
}
const AllocationDescription& AllocationDescription::default_instance() {
protobuf_InitDefaults_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto();
return *internal_default_instance();
}
::google::protobuf::internal::ExplicitlyConstructed<AllocationDescription> AllocationDescription_default_instance_;
AllocationDescription* AllocationDescription::New(::google::protobuf::Arena* arena) const {
return ::google::protobuf::Arena::CreateMessage<AllocationDescription>(arena);
}
void AllocationDescription::Clear() {
// @@protoc_insertion_point(message_clear_start:tensorflow.AllocationDescription)
#if defined(__clang__)
#define ZR_HELPER_(f) \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
__builtin_offsetof(AllocationDescription, f) \
_Pragma("clang diagnostic pop")
#else
#define ZR_HELPER_(f) reinterpret_cast<char*>(\
&reinterpret_cast<AllocationDescription*>(16)->f)
#endif
#define ZR_(first, last) do {\
::memset(&(first), 0,\
ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0)
ZR_(requested_bytes_, has_single_reference_);
allocator_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
#undef ZR_HELPER_
#undef ZR_
}
bool AllocationDescription::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:tensorflow.AllocationDescription)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// optional int64 requested_bytes = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
input, &requested_bytes_)));
} else {
goto handle_unusual;
}
if (input->ExpectTag(16)) goto parse_allocated_bytes;
break;
}
// optional int64 allocated_bytes = 2;
case 2: {
if (tag == 16) {
parse_allocated_bytes:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
input, &allocated_bytes_)));
} else {
goto handle_unusual;
}
if (input->ExpectTag(26)) goto parse_allocator_name;
break;
}
// optional string allocator_name = 3;
case 3: {
if (tag == 26) {
parse_allocator_name:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_allocator_name()));
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->allocator_name().data(), this->allocator_name().length(),
::google::protobuf::internal::WireFormatLite::PARSE,
"tensorflow.AllocationDescription.allocator_name"));
} else {
goto handle_unusual;
}
if (input->ExpectTag(32)) goto parse_allocation_id;
break;
}
// optional int64 allocation_id = 4;
case 4: {
if (tag == 32) {
parse_allocation_id:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
input, &allocation_id_)));
} else {
goto handle_unusual;
}
if (input->ExpectTag(40)) goto parse_has_single_reference;
break;
}
// optional bool has_single_reference = 5;
case 5: {
if (tag == 40) {
parse_has_single_reference:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &has_single_reference_)));
} else {
goto handle_unusual;
}
if (input->ExpectTag(48)) goto parse_ptr;
break;
}
// optional uint64 ptr = 6;
case 6: {
if (tag == 48) {
parse_ptr:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
input, &ptr_)));
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:tensorflow.AllocationDescription)
return true;
failure:
// @@protoc_insertion_point(parse_failure:tensorflow.AllocationDescription)
return false;
#undef DO_
}
void AllocationDescription::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:tensorflow.AllocationDescription)
// optional int64 requested_bytes = 1;
if (this->requested_bytes() != 0) {
::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->requested_bytes(), output);
}
// optional int64 allocated_bytes = 2;
if (this->allocated_bytes() != 0) {
::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->allocated_bytes(), output);
}
// optional string allocator_name = 3;
if (this->allocator_name().size() > 0) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->allocator_name().data(), this->allocator_name().length(),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.AllocationDescription.allocator_name");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
3, this->allocator_name(), output);
}
// optional int64 allocation_id = 4;
if (this->allocation_id() != 0) {
::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->allocation_id(), output);
}
// optional bool has_single_reference = 5;
if (this->has_single_reference() != 0) {
::google::protobuf::internal::WireFormatLite::WriteBool(5, this->has_single_reference(), output);
}
// optional uint64 ptr = 6;
if (this->ptr() != 0) {
::google::protobuf::internal::WireFormatLite::WriteUInt64(6, this->ptr(), output);
}
// @@protoc_insertion_point(serialize_end:tensorflow.AllocationDescription)
}
::google::protobuf::uint8* AllocationDescription::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:tensorflow.AllocationDescription)
// optional int64 requested_bytes = 1;
if (this->requested_bytes() != 0) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->requested_bytes(), target);
}
// optional int64 allocated_bytes = 2;
if (this->allocated_bytes() != 0) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->allocated_bytes(), target);
}
// optional string allocator_name = 3;
if (this->allocator_name().size() > 0) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->allocator_name().data(), this->allocator_name().length(),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.AllocationDescription.allocator_name");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->allocator_name(), target);
}
// optional int64 allocation_id = 4;
if (this->allocation_id() != 0) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->allocation_id(), target);
}
// optional bool has_single_reference = 5;
if (this->has_single_reference() != 0) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->has_single_reference(), target);
}
// optional uint64 ptr = 6;
if (this->ptr() != 0) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(6, this->ptr(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:tensorflow.AllocationDescription)
return target;
}
size_t AllocationDescription::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:tensorflow.AllocationDescription)
size_t total_size = 0;
// optional int64 requested_bytes = 1;
if (this->requested_bytes() != 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int64Size(
this->requested_bytes());
}
// optional int64 allocated_bytes = 2;
if (this->allocated_bytes() != 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int64Size(
this->allocated_bytes());
}
// optional string allocator_name = 3;
if (this->allocator_name().size() > 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->allocator_name());
}
// optional int64 allocation_id = 4;
if (this->allocation_id() != 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int64Size(
this->allocation_id());
}
// optional bool has_single_reference = 5;
if (this->has_single_reference() != 0) {
total_size += 1 + 1;
}
// optional uint64 ptr = 6;
if (this->ptr() != 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt64Size(
this->ptr());
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = cached_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void AllocationDescription::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.AllocationDescription)
if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
const AllocationDescription* source =
::google::protobuf::internal::DynamicCastToGenerated<const AllocationDescription>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.AllocationDescription)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.AllocationDescription)
UnsafeMergeFrom(*source);
}
}
void AllocationDescription::MergeFrom(const AllocationDescription& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.AllocationDescription)
if (GOOGLE_PREDICT_TRUE(&from != this)) {
UnsafeMergeFrom(from);
} else {
MergeFromFail(__LINE__);
}
}
void AllocationDescription::UnsafeMergeFrom(const AllocationDescription& from) {
GOOGLE_DCHECK(&from != this);
if (from.requested_bytes() != 0) {
set_requested_bytes(from.requested_bytes());
}
if (from.allocated_bytes() != 0) {
set_allocated_bytes(from.allocated_bytes());
}
if (from.allocator_name().size() > 0) {
set_allocator_name(from.allocator_name());
}
if (from.allocation_id() != 0) {
set_allocation_id(from.allocation_id());
}
if (from.has_single_reference() != 0) {
set_has_single_reference(from.has_single_reference());
}
if (from.ptr() != 0) {
set_ptr(from.ptr());
}
}
void AllocationDescription::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.AllocationDescription)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void AllocationDescription::CopyFrom(const AllocationDescription& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.AllocationDescription)
if (&from == this) return;
Clear();
UnsafeMergeFrom(from);
}
bool AllocationDescription::IsInitialized() const {
return true;
}
void AllocationDescription::Swap(AllocationDescription* other) {
if (other == this) return;
if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
InternalSwap(other);
} else {
AllocationDescription temp;
temp.UnsafeMergeFrom(*this);
CopyFrom(*other);
other->CopyFrom(temp);
}
}
void AllocationDescription::UnsafeArenaSwap(AllocationDescription* other) {
if (other == this) return;
GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
InternalSwap(other);
}
void AllocationDescription::InternalSwap(AllocationDescription* other) {
std::swap(requested_bytes_, other->requested_bytes_);
std::swap(allocated_bytes_, other->allocated_bytes_);
allocator_name_.Swap(&other->allocator_name_);
std::swap(allocation_id_, other->allocation_id_);
std::swap(has_single_reference_, other->has_single_reference_);
std::swap(ptr_, other->ptr_);
_internal_metadata_.Swap(&other->_internal_metadata_);
std::swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata AllocationDescription::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = AllocationDescription_descriptor_;
metadata.reflection = AllocationDescription_reflection_;
return metadata;
}
#if PROTOBUF_INLINE_NOT_IN_HEADERS
// AllocationDescription
// optional int64 requested_bytes = 1;
void AllocationDescription::clear_requested_bytes() {
requested_bytes_ = GOOGLE_LONGLONG(0);
}
::google::protobuf::int64 AllocationDescription::requested_bytes() const {
// @@protoc_insertion_point(field_get:tensorflow.AllocationDescription.requested_bytes)
return requested_bytes_;
}
void AllocationDescription::set_requested_bytes(::google::protobuf::int64 value) {
requested_bytes_ = value;
// @@protoc_insertion_point(field_set:tensorflow.AllocationDescription.requested_bytes)
}
// optional int64 allocated_bytes = 2;
void AllocationDescription::clear_allocated_bytes() {
allocated_bytes_ = GOOGLE_LONGLONG(0);
}
::google::protobuf::int64 AllocationDescription::allocated_bytes() const {
// @@protoc_insertion_point(field_get:tensorflow.AllocationDescription.allocated_bytes)
return allocated_bytes_;
}
void AllocationDescription::set_allocated_bytes(::google::protobuf::int64 value) {
allocated_bytes_ = value;
// @@protoc_insertion_point(field_set:tensorflow.AllocationDescription.allocated_bytes)
}
// optional string allocator_name = 3;
void AllocationDescription::clear_allocator_name() {
allocator_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
const ::std::string& AllocationDescription::allocator_name() const {
// @@protoc_insertion_point(field_get:tensorflow.AllocationDescription.allocator_name)
return allocator_name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
void AllocationDescription::set_allocator_name(const ::std::string& value) {
allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:tensorflow.AllocationDescription.allocator_name)
}
void AllocationDescription::set_allocator_name(const char* value) {
allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:tensorflow.AllocationDescription.allocator_name)
}
void AllocationDescription::set_allocator_name(const char* value,
size_t size) {
allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:tensorflow.AllocationDescription.allocator_name)
}
::std::string* AllocationDescription::mutable_allocator_name() {
// @@protoc_insertion_point(field_mutable:tensorflow.AllocationDescription.allocator_name)
return allocator_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
::std::string* AllocationDescription::release_allocator_name() {
// @@protoc_insertion_point(field_release:tensorflow.AllocationDescription.allocator_name)
return allocator_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
::std::string* AllocationDescription::unsafe_arena_release_allocator_name() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AllocationDescription.allocator_name)
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
return allocator_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
void AllocationDescription::set_allocated_allocator_name(::std::string* allocator_name) {
if (allocator_name != NULL) {
} else {
}
allocator_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), allocator_name,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:tensorflow.AllocationDescription.allocator_name)
}
void AllocationDescription::unsafe_arena_set_allocated_allocator_name(
::std::string* allocator_name) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (allocator_name != NULL) {
} else {
}
allocator_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
allocator_name, GetArenaNoVirtual());
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AllocationDescription.allocator_name)
}
// optional int64 allocation_id = 4;
void AllocationDescription::clear_allocation_id() {
allocation_id_ = GOOGLE_LONGLONG(0);
}
::google::protobuf::int64 AllocationDescription::allocation_id() const {
// @@protoc_insertion_point(field_get:tensorflow.AllocationDescription.allocation_id)
return allocation_id_;
}
void AllocationDescription::set_allocation_id(::google::protobuf::int64 value) {
allocation_id_ = value;
// @@protoc_insertion_point(field_set:tensorflow.AllocationDescription.allocation_id)
}
// optional bool has_single_reference = 5;
void AllocationDescription::clear_has_single_reference() {
has_single_reference_ = false;
}
bool AllocationDescription::has_single_reference() const {
// @@protoc_insertion_point(field_get:tensorflow.AllocationDescription.has_single_reference)
return has_single_reference_;
}
void AllocationDescription::set_has_single_reference(bool value) {
has_single_reference_ = value;
// @@protoc_insertion_point(field_set:tensorflow.AllocationDescription.has_single_reference)
}
// optional uint64 ptr = 6;
void AllocationDescription::clear_ptr() {
ptr_ = GOOGLE_ULONGLONG(0);
}
::google::protobuf::uint64 AllocationDescription::ptr() const {
// @@protoc_insertion_point(field_get:tensorflow.AllocationDescription.ptr)
return ptr_;
}
void AllocationDescription::set_ptr(::google::protobuf::uint64 value) {
ptr_ = value;
// @@protoc_insertion_point(field_set:tensorflow.AllocationDescription.ptr)
}
inline const AllocationDescription* AllocationDescription::internal_default_instance() {
return &AllocationDescription_default_instance_.get();
}
#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// @@protoc_insertion_point(namespace_scope)
} // namespace tensorflow
// @@protoc_insertion_point(global_scope)
|
{
"pile_set_name": "Github"
}
|
Geomodeller Persistance V1.0, (c) BRGM 1993-2005
Name Default
Precision 0.001000000000
Shapes 0
Points 0
Edges 0
Wires 0
Faces 0
Compounds 0
|
{
"pile_set_name": "Github"
}
|
--------------------------------
-- @module TransitionScene
-- @extend Scene
--------------------------------
-- @function [parent=#TransitionScene] finish
-- @param self
--------------------------------
-- @function [parent=#TransitionScene] hideOutShowIn
-- @param self
--------------------------------
-- @function [parent=#TransitionScene] create
-- @param self
-- @param #float float
-- @param #cc.Scene scene
-- @return TransitionScene#TransitionScene ret (return value: cc.TransitionScene)
--------------------------------
-- @function [parent=#TransitionScene] draw
-- @param self
-- @param #cc.Renderer renderer
-- @param #mat4_table mat4
-- @param #unsigned int int
--------------------------------
-- @function [parent=#TransitionScene] cleanup
-- @param self
return nil
|
{
"pile_set_name": "Github"
}
|
/******************************************************************************
*
* Copyright(c) 2009-2014 Realtek Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License 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.
*
* The full GNU General Public License is included in this distribution in the
* file called LICENSE.
*
* Contact Information:
* wlanfae <wlanfae@realtek.com>
* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
* Hsinchu 300, Taiwan.
*
* Larry Finger <Larry.Finger@lwfinger.net>
*
*****************************************************************************/
#ifndef __RTL8723BE_PWRSEQ_H__
#define __RTL8723BE_PWRSEQ_H__
#include "../pwrseqcmd.h"
/**
* Check document WM-20130425-JackieLau-RTL8723B_Power_Architecture v05.vsd
* There are 6 HW Power States:
* 0: POFF--Power Off
* 1: PDN--Power Down
* 2: CARDEMU--Card Emulation
* 3: ACT--Active Mode
* 4: LPS--Low Power State
* 5: SUS--Suspend
*
* The transision from different states are defined below
* TRANS_CARDEMU_TO_ACT
* TRANS_ACT_TO_CARDEMU
* TRANS_CARDEMU_TO_SUS
* TRANS_SUS_TO_CARDEMU
* TRANS_CARDEMU_TO_PDN
* TRANS_ACT_TO_LPS
* TRANS_LPS_TO_ACT
*
* TRANS_END
*/
#define RTL8723B_TRANS_CARDEMU_TO_ACT_STEPS 23
#define RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS 15
#define RTL8723B_TRANS_CARDEMU_TO_SUS_STEPS 15
#define RTL8723B_TRANS_SUS_TO_CARDEMU_STEPS 15
#define RTL8723B_TRANS_CARDEMU_TO_PDN_STEPS 15
#define RTL8723B_TRANS_PDN_TO_CARDEMU_STEPS 15
#define RTL8723B_TRANS_ACT_TO_LPS_STEPS 15
#define RTL8723B_TRANS_LPS_TO_ACT_STEPS 15
#define RTL8723B_TRANS_END_STEPS 1
#define RTL8723B_TRANS_CARDEMU_TO_ACT \
/* format */ \
/* comments here */ \
/* {offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value}, */\
/*0x20[0] = 1b'1 enable LDOA12 MACRO block for all interface*/ \
{0x0020, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)}, \
/*0x67[0] = 0 to disable BT_GPS_SEL pins*/ \
{0x0067, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, \
/*Delay 1ms*/ \
{0x0001, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_DELAY, 1, PWRSEQ_DELAY_MS}, \
/*0x00[5] = 1b'0 release analog Ips to digital ,1:isolation*/ \
{0x0000, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(5), 0}, \
/* disable SW LPS 0x04[10]=0 and WLSUS_EN 0x04[11]=0*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, (BIT(4)|BIT(3)|BIT(2)), 0}, \
/* Disable USB suspend */ \
{0x0075, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0) , BIT(0)}, \
/* wait till 0x04[17] = 1 power ready*/ \
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), BIT(1)}, \
/* Enable USB suspend */ \
{0x0075, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0) , 0}, \
/* release WLON reset 0x04[16]=1*/ \
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)}, \
/* disable HWPDN 0x04[15]=0*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0}, \
/* disable WL suspend*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, (BIT(4)|BIT(3)), 0}, \
/* polling until return 0*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)}, \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(0), 0}, \
/* Enable WL control XTAL setting*/ \
{0x0010, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(6), BIT(6)}, \
/*Enable falling edge triggering interrupt*/ \
{0x0049, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, \
/*Enable GPIO9 interrupt mode*/ \
{0x0063, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, \
/*Enable GPIO9 input mode*/ \
{0x0062, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), 0}, \
/*Enable HSISR GPIO[C:0] interrupt*/ \
{0x0058, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)}, \
/*Enable HSISR GPIO9 interrupt*/ \
{0x005A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, \
/*For GPIO9 internal pull high setting by test chip*/ \
{0x0068, PWR_CUT_TESTCHIP_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,\
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3), BIT(3)}, \
/*For GPIO9 internal pull high setting*/ \
{0x0069, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(6), BIT(6)},
#define RTL8723B_TRANS_ACT_TO_CARDEMU \
/* format */ \
/* comments here */ \
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
/*0x1F[7:0] = 0 turn off RF*/ \
{0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0}, \
/*0x4C[24] = 0x4F[0] = 0, */ \
/*switch DPDT_SEL_P output from register 0x65[2] */ \
{0x004F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0}, \
/*Enable rising edge triggering interrupt*/ \
{0x0049, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), 0}, \
/*0x04[9] = 1 turn off MAC by HW state machine*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, \
/*wait till 0x04[9] = 0 polling until return 0 to disable*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), 0}, \
/* Enable BT control XTAL setting*/ \
{0x0010, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(6), 0}, \
/*0x00[5] = 1b'1 analog Ips to digital ,1:isolation*/ \
{0x0000, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, \
PWR_CMD_WRITE, BIT(5), BIT(5)}, \
/*0x20[0] = 1b'0 disable LDOA12 MACRO block*/ \
{0x0020, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, \
PWR_CMD_WRITE, BIT(0), 0},
#define RTL8723B_TRANS_CARDEMU_TO_SUS \
/* format */ \
/* comments here */ \
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },*/\
/*0x04[12:11] = 2b'11 enable WL suspend for PCIe*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4) | BIT(3), (BIT(4) | BIT(3))}, \
/*0x04[12:11] = 2b'01 enable WL suspend*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, \
PWR_CMD_WRITE, BIT(3) | BIT(4), BIT(3)}, \
/*0x23[4] = 1b'1 12H LDO enter sleep mode*/ \
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)}, \
/*0x07[7:0] = 0x20 SDIO SOP option to disable BG/MB/ACK/SWR*/ \
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x20}, \
/*0x04[12:11] = 2b'11 enable WL suspend for PCIe*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3) | BIT(4), BIT(3) | BIT(4)},\
/*Set SDIO suspend local register*/ \
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0)}, \
/*wait power state to suspend*/ \
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0},
#define RTL8723B_TRANS_SUS_TO_CARDEMU \
/* format */ \
/* comments here */ \
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
/*clear suspend enable and power down enable*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3) | BIT(7), 0}, \
/*Set SDIO suspend local register*/ \
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), 0}, \
/*wait power state to suspend*/ \
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1)}, \
/*0x23[4] = 1b'0 12H LDO enter normal mode*/ \
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, \
/*0x04[12:11] = 2b'01enable WL suspend*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), 0},
#define RTL8723B_TRANS_CARDEMU_TO_CARDDIS \
/* format */ \
/* comments here */ \
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
/*0x07=0x20 , SOP option to disable BG/MB*/ \
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x20}, \
/*0x04[12:11] = 2b'01 enable WL suspend*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
PWR_INTF_USB_MSK | PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)}, \
/*0x04[10] = 1, enable SW LPS*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(2), BIT(2)}, \
/*0x48[16] = 1 to enable GPIO9 as EXT WAKEUP*/ \
{0x004A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 1}, \
/*0x23[4] = 1b'1 12H LDO enter sleep mode*/ \
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)}, \
/*Set SDIO suspend local register*/ \
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0)}, \
/*wait power state to suspend*/ \
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0},
#define RTL8723B_TRANS_CARDDIS_TO_CARDEMU \
/* format */ \
/* comments here */ \
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
/*clear suspend enable and power down enable*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3) | BIT(7), 0}, \
/*Set SDIO suspend local register*/ \
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), 0}, \
/*wait power state to suspend*/ \
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1)}, \
/*0x48[16] = 0 to disable GPIO9 as EXT WAKEUP*/ \
{0x004A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0}, \
/*0x04[12:11] = 2b'01enable WL suspend*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), 0}, \
/*0x23[4] = 1b'0 12H LDO enter normal mode*/ \
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, \
/*PCIe DMA start*/ \
{0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0},
#define RTL8723B_TRANS_CARDEMU_TO_PDN \
/* format */ \
/* comments here */ \
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
/*0x23[4] = 1b'1 12H LDO enter sleep mode*/ \
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)}, \
/*0x07[7:0] = 0x20 SOP option to disable BG/MB/ACK/SWR*/ \
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, \
PWR_INTF_SDIO_MSK | PWR_INTF_USB_MSK, PWR_BASEADDR_MAC, \
PWR_CMD_WRITE, 0xFF, 0x20}, \
/* 0x04[16] = 0*/ \
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0}, \
/* 0x04[15] = 1*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7)},
#define RTL8723B_TRANS_PDN_TO_CARDEMU \
/* format */ \
/* comments here */ \
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
/* 0x04[15] = 0*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0},
#define RTL8723B_TRANS_ACT_TO_LPS \
/* format */ \
/* comments here */ \
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
/*PCIe DMA stop*/ \
{0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0xFF}, \
/*Tx Pause*/ \
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0xFF}, \
/*Should be zero if no packet is transmitting*/ \
{0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0}, \
/*Should be zero if no packet is transmitting*/ \
{0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0}, \
/*Should be zero if no packet is transmitting*/ \
{0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0}, \
/*Should be zero if no packet is transmitting*/ \
{0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0}, \
/*CCK and OFDM are disabled,and clock are gated*/ \
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0}, \
/*Delay 1us*/ \
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US}, \
/*Whole BB is reset*/ \
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), 0}, \
/*Reset MAC TRX*/ \
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x03}, \
/*check if removed later*/ \
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), 0}, \
/*When driver enter Sus/ Disable, enable LOP for BT*/ \
{0x0093, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x00}, \
/*Respond TxOK to scheduler*/ \
{0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(5), BIT(5)},
#define RTL8723B_TRANS_LPS_TO_ACT \
/* format */ \
/* comments here */ \
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
/*SDIO RPWM*/ \
{0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, \
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, 0xFF, 0x84}, \
/*USB RPWM*/ \
{0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x84}, \
/*PCIe RPWM*/ \
{0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x84}, \
/*Delay*/ \
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS}, \
/*. 0x08[4] = 0 switch TSF to 40M*/ \
{0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, \
/*Polling 0x109[7]=0 TSF in 40M*/ \
{0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(7), 0}, \
/*. 0x29[7:6] = 2b'00 enable BB clock*/ \
{0x0029, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(6)|BIT(7), 0}, \
/*. 0x101[1] = 1*/ \
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, \
/*. 0x100[7:0] = 0xFF enable WMAC TRX*/ \
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0xFF}, \
/*. 0x02[1:0] = 2b'11 enable BB macro*/ \
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1) | BIT(0), BIT(1) | BIT(0)}, \
/*. 0x522 = 0*/ \
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, \
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0},
#define RTL8723B_TRANS_END \
/* format */ \
/* comments here */ \
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, */\
{0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 0, \
PWR_CMD_END, 0, 0},
extern struct wlan_pwr_cfg rtl8723B_power_on_flow
[RTL8723B_TRANS_CARDEMU_TO_ACT_STEPS +
RTL8723B_TRANS_END_STEPS];
extern struct wlan_pwr_cfg rtl8723B_radio_off_flow
[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS +
RTL8723B_TRANS_END_STEPS];
extern struct wlan_pwr_cfg rtl8723B_card_disable_flow
[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS +
RTL8723B_TRANS_CARDEMU_TO_PDN_STEPS +
RTL8723B_TRANS_END_STEPS];
extern struct wlan_pwr_cfg rtl8723B_card_enable_flow
[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS +
RTL8723B_TRANS_CARDEMU_TO_PDN_STEPS +
RTL8723B_TRANS_END_STEPS];
extern struct wlan_pwr_cfg rtl8723B_suspend_flow
[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS +
RTL8723B_TRANS_CARDEMU_TO_SUS_STEPS +
RTL8723B_TRANS_END_STEPS];
extern struct wlan_pwr_cfg rtl8723B_resume_flow
[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS +
RTL8723B_TRANS_CARDEMU_TO_SUS_STEPS +
RTL8723B_TRANS_END_STEPS];
extern struct wlan_pwr_cfg rtl8723B_hwpdn_flow
[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS +
RTL8723B_TRANS_CARDEMU_TO_PDN_STEPS +
RTL8723B_TRANS_END_STEPS];
extern struct wlan_pwr_cfg rtl8723B_enter_lps_flow
[RTL8723B_TRANS_ACT_TO_LPS_STEPS +
RTL8723B_TRANS_END_STEPS];
extern struct wlan_pwr_cfg rtl8723B_leave_lps_flow
[RTL8723B_TRANS_LPS_TO_ACT_STEPS +
RTL8723B_TRANS_END_STEPS];
/* RTL8723 Power Configuration CMDs for PCIe interface */
#define RTL8723_NIC_PWR_ON_FLOW rtl8723B_power_on_flow
#define RTL8723_NIC_RF_OFF_FLOW rtl8723B_radio_off_flow
#define RTL8723_NIC_DISABLE_FLOW rtl8723B_card_disable_flow
#define RTL8723_NIC_ENABLE_FLOW rtl8723B_card_enable_flow
#define RTL8723_NIC_SUSPEND_FLOW rtl8723B_suspend_flow
#define RTL8723_NIC_RESUME_FLOW rtl8723B_resume_flow
#define RTL8723_NIC_PDN_FLOW rtl8723B_hwpdn_flow
#define RTL8723_NIC_LPS_ENTER_FLOW rtl8723B_enter_lps_flow
#define RTL8723_NIC_LPS_LEAVE_FLOW rtl8723B_leave_lps_flow
#endif
|
{
"pile_set_name": "Github"
}
|
from .lib_template import *
class OpensshSeeker(Seeker):
"""Seeker (Identifier) for the OpenSSH open source library."""
# Library Name
NAME = "OpenSSH"
# version string marker
VERSION_STRING = "OpenSSH_"
# Overridden base function
def searchLib(self, logger):
"""Check if the open source library is located somewhere in the binary.
Args:
logger (logger): elementals logger instance
Return Value:
number of library instances that were found in the binary
"""
self._version_strings = []
# Now search
for bin_str in self._all_strings:
# we have a match
if self.VERSION_STRING in str(bin_str):
version_string = str(bin_str)
# catch false / duplicates
if "*" in version_string or \
(self._version_string is not None and version_string in self._version_string) or \
(self._version_string is not None and self._version_string in version_string):
continue
# valid match
logger.debug(f"Located a version string of {self.NAME} in address 0x{bin_str.ea:x}")
# save the string for later
self._version_strings.append(version_string)
# return the result
return len(self._version_strings)
# Overridden base function
def identifyVersions(self, logger):
"""Identify the version(s) of the library (assuming it was already found).
Assumptions:
1. searchLib() was called before calling identifyVersions()
2. The call to searchLib() returned a number > 0
Args:
logger (logger): elementals logger instance
Return Value:
list of Textual ID(s) of the library's version(s)
"""
results = []
# extract the version from the copyright string
for work_str in self._version_strings:
results.append(self.extractVersion(work_str, start_index=work_str.find(self.VERSION_STRING) + len(self.VERSION_STRING)))
# return the result
return results
# Register our class
OpensshSeeker.register(OpensshSeeker.NAME, OpensshSeeker)
|
{
"pile_set_name": "Github"
}
|
/*
** $Id: lundump.c,v 2.7.1.4 2008/04/04 19:51:41 roberto Exp $
** load precompiled Lua chunks
** See Copyright Notice in lua.h
*/
#include <string.h>
#define lundump_c
#define LUA_CORE
#include "lua.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lmem.h"
#include "lobject.h"
#include "lstring.h"
#include "lundump.h"
#include "lzio.h"
typedef struct {
lua_State* L;
ZIO* Z;
Mbuffer* b;
const char* name;
} LoadState;
#ifdef LUAC_TRUST_BINARIES
#define IF(c,s)
#define error(S,s)
#else
#define IF(c,s) if (c) error(S,s)
static void error(LoadState* S, const char* why)
{
luaO_pushfstring(S->L,"%s: %s in precompiled chunk",S->name,why);
luaD_throw(S->L,LUA_ERRSYNTAX);
}
#endif
#define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size))
#define LoadByte(S) (lu_byte)LoadChar(S)
#define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x))
#define LoadVector(S,b,n,size) LoadMem(S,b,n,size)
static void LoadBlock(LoadState* S, void* b, size_t size)
{
size_t r=luaZ_read(S->Z,b,size);
IF (r!=0, "unexpected end");
}
static int LoadChar(LoadState* S)
{
char x;
LoadVar(S,x);
return x;
}
static int LoadInt(LoadState* S)
{
int x;
LoadVar(S,x);
IF (x<0, "bad integer");
return x;
}
static lua_Number LoadNumber(LoadState* S)
{
lua_Number x;
LoadVar(S,x);
return x;
}
static TString* LoadString(LoadState* S)
{
size_t size;
LoadVar(S,size);
if (size==0)
return NULL;
else
{
char* s=luaZ_openspace(S->L,S->b,size);
LoadBlock(S,s,size);
return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */
}
}
static void LoadCode(LoadState* S, Proto* f)
{
int n=LoadInt(S);
f->code=luaM_newvector(S->L,n,Instruction);
f->sizecode=n;
LoadVector(S,f->code,n,sizeof(Instruction));
}
static Proto* LoadFunction(LoadState* S, TString* p);
static void LoadConstants(LoadState* S, Proto* f)
{
int i,n;
n=LoadInt(S);
f->k=luaM_newvector(S->L,n,TValue);
f->sizek=n;
for (i=0; i<n; i++) setnilvalue(&f->k[i]);
for (i=0; i<n; i++)
{
TValue* o=&f->k[i];
int t=LoadChar(S);
switch (t)
{
case LUA_TNIL:
setnilvalue(o);
break;
case LUA_TBOOLEAN:
setbvalue(o,LoadChar(S)!=0);
break;
case LUA_TNUMBER:
setnvalue(o,LoadNumber(S));
break;
case LUA_TSTRING:
setsvalue2n(S->L,o,LoadString(S));
break;
default:
error(S,"bad constant");
break;
}
}
n=LoadInt(S);
f->p=luaM_newvector(S->L,n,Proto*);
f->sizep=n;
for (i=0; i<n; i++) f->p[i]=NULL;
for (i=0; i<n; i++) f->p[i]=LoadFunction(S,f->source);
}
static void LoadDebug(LoadState* S, Proto* f)
{
int i,n;
n=LoadInt(S);
f->lineinfo=luaM_newvector(S->L,n,int);
f->sizelineinfo=n;
LoadVector(S,f->lineinfo,n,sizeof(int));
n=LoadInt(S);
f->locvars=luaM_newvector(S->L,n,LocVar);
f->sizelocvars=n;
for (i=0; i<n; i++) f->locvars[i].varname=NULL;
for (i=0; i<n; i++)
{
f->locvars[i].varname=LoadString(S);
f->locvars[i].startpc=LoadInt(S);
f->locvars[i].endpc=LoadInt(S);
}
n=LoadInt(S);
f->upvalues=luaM_newvector(S->L,n,TString*);
f->sizeupvalues=n;
for (i=0; i<n; i++) f->upvalues[i]=NULL;
for (i=0; i<n; i++) f->upvalues[i]=LoadString(S);
}
static Proto* LoadFunction(LoadState* S, TString* p)
{
Proto* f;
if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep");
f=luaF_newproto(S->L);
setptvalue2s(S->L,S->L->top,f); incr_top(S->L);
f->source=LoadString(S); if (f->source==NULL) f->source=p;
f->linedefined=LoadInt(S);
f->lastlinedefined=LoadInt(S);
f->nups=LoadByte(S);
f->numparams=LoadByte(S);
f->is_vararg=LoadByte(S);
f->maxstacksize=LoadByte(S);
LoadCode(S,f);
LoadConstants(S,f);
LoadDebug(S,f);
IF (!luaG_checkcode(f), "bad code");
S->L->top--;
S->L->nCcalls--;
return f;
}
static void LoadHeader(LoadState* S)
{
char h[LUAC_HEADERSIZE];
char s[LUAC_HEADERSIZE];
luaU_header(h);
LoadBlock(S,s,LUAC_HEADERSIZE);
IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header");
}
/*
** load precompiled chunk
*/
Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name)
{
LoadState S;
if (*name=='@' || *name=='=')
S.name=name+1;
else if (*name==LUA_SIGNATURE[0])
S.name="binary string";
else
S.name=name;
S.L=L;
S.Z=Z;
S.b=buff;
LoadHeader(&S);
return LoadFunction(&S,luaS_newliteral(L,"=?"));
}
/*
* make header
*/
void luaU_header (char* h)
{
int x=1;
memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1);
h+=sizeof(LUA_SIGNATURE)-1;
*h++=(char)LUAC_VERSION;
*h++=(char)LUAC_FORMAT;
*h++=(char)*(char*)&x; /* endianness */
*h++=(char)sizeof(int);
*h++=(char)sizeof(size_t);
*h++=(char)sizeof(Instruction);
*h++=(char)sizeof(lua_Number);
*h++=(char)(((lua_Number)0.5)==0); /* is lua_Number integral? */
}
|
{
"pile_set_name": "Github"
}
|
define([
'dojo/_base/declare',
'dojo/_base/array',
'dojo/dom-construct',
'dojo/on',
'dojo/aspect',
'dijit/Dialog',
'dijit/form/Button',
'dijit/form/TextBox',
'dijit/focus',
'JBrowse/View/LocationList',
'JBrowse/Util'
],
function (
declare,
array,
dom,
on,
aspect,
Dialog,
Button,
TextBox,
dijitFocus,
LocationListView,
Util
) {
return declare(null, {
constructor: function (args) {
this.browser = args.browser;
this.config = dojo.clone(args.config || {});
this.locationChoices = [{label: 'Search results...', description: ' ', start: 0, end: 100, ref: 'chr'}];
this.title = args.title || 'Choose location';
this.prompt = args.prompt || 'Search for features';
this.goCallback = args.goCallback;
this.showCallback = args.showCallback;
},
show: function () {
var dialog = this.dialog = new Dialog({
title: this.title,
className: 'locationChoiceDialog',
style: { width: '70%' }
});
var container = dom.create('div', {});
if (this.prompt) {
dom.create('div', {
className: 'prompt',
innerHTML: this.prompt
}, container);
var subcontainer = dojo.create('div', { style: { 'padding': '20px' } }, container);
dojo.create('img', { width: '16px', src: 'img/search.png', style: { 'padding-right': '5px' } }, subcontainer);
this.searchBox = new TextBox({intermediateChanges: true}).placeAt(subcontainer);
dojo.create('label', {style: {marginLeft: '20px'}, for: 'exact_match', innerHTML: 'Exact?'}, subcontainer);
this.exactCheckbox = dojo.create('input', {type: 'checkbox', id: 'exact_match'}, subcontainer);
on(this.searchBox, 'change', dojo.hitch(this, 'searchBoxProcess'));
on(this.exactCheckbox, 'change', dojo.hitch(this, 'searchBoxProcess'));
}
var browser = this.browser;
this.locationListView = new LocationListView(
{
browser: browser,
locations: this.locationChoices,
buttons: [{
className: 'show',
innerHTML: 'Show',
onClick: this.showCallback || function (location) {
browser.showRegionAfterSearch(location);
}
},
{
className: 'go',
innerHTML: 'Go',
onClick: this.goCallback || function (location) {
dialog.hide();
browser.showRegionAfterSearch(location);
}
}]
},
dom.create('div', {
className: 'locationList',
style: { maxHeight: 0.5 * this.browser.container.offsetHeight + 'px'}
}, container)
);
this.actionBar = dojo.create('div', { className: 'infoDialogActionBar dijitDialogPaneActionBar' });
new Button({
iconClass: 'dijitIconDelete',
label: 'Cancel',
onClick: dojo.hitch(dialog, 'hide')
}).placeAt(this.actionBar);
this.numResults = dojo.create('div', { id: 'numResults', style: {margin: '10px'} }, container);
this.errResults = dojo.create('div', { id: 'errResults', style: {margin: '10px', color: 'red'} }, container);
dialog.set('content', [ container, this.actionBar ]);
var g = this.locationListView.grid;
(g.store || g.collection).setData([]);
g.refresh();
dialog.show();
aspect.after(dialog, 'hide', dojo.hitch(this, function () {
if (dijitFocus.curNode) {
dijitFocus.curNode.blur();
}
setTimeout(function () {
dialog.destroyRecursive();
}, 500);
}));
},
searchBoxProcess: function() {
var loc = this.searchBox.get('value');
this.numResults.innerHTML = '';
if (!this.exactCheckbox.checked) {
loc += "*";
}
function handleError(error) {
console.error(error);
var g = this.locationListView.grid;
(g.store || g.collection).setData([]);
g.refresh();
this.errResults.innerHTML = 'Error: failed to load results';
this.numResults.innerHTML = '';
}
this.browser.nameStore.query({ name: loc }).then((nameMatches) => {
var promises = nameMatches.map((match) => this.browser.nameStore.query({ name: match.name }));
Promise.all(promises).then((res) => {
var grid = [];
for(var i = 0; i < res.length; i++) {
var elt = res[i];
if(elt.length) {
elt = elt[0];
if(elt.multipleLocations) {
for(var j = 0; j < elt.multipleLocations.length; j++) {
var track = elt.multipleLocations[j].tracks.length ? elt.multipleLocations[j].tracks[0] : {};
grid.push({
locstring: Util.assembleLocString(elt.multipleLocations[j]),
location: elt.multipleLocations[j],
label: elt.name,
description: track.key || track.label || 'Unknown track',
tracks: track
});
}
} else {
var track = (elt.location.tracks||[]).length ? elt.location.tracks[0] : {};
grid.push({
locstring: Util.assembleLocString(elt.location),
location: elt.location,
label: elt.location.objectName,
description: track.key || track.label || 'Unknown track',
tracks: track
});
}
}
}
this.numResults.innerHTML = "Num. results: " + grid.length;
var g = this.locationListView.grid;
(g.store || g.collection).setData(grid);
g.refresh();
this.errResults.innerHTML = '';
}, dojo.hitch(this, handleError));
}, dojo.hitch(this, handleError));
}
});
});
|
{
"pile_set_name": "Github"
}
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_WAYLAND
#define DEBUG_DYNAMIC_WAYLAND 0
#include "SDL_waylanddyn.h"
#if DEBUG_DYNAMIC_WAYLAND
#include "SDL_log.h"
#endif
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC
#include "SDL_name.h"
#include "SDL_loadso.h"
typedef struct
{
void *lib;
const char *libname;
} waylanddynlib;
#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC
#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC NULL
#endif
#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL NULL
#endif
#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR NULL
#endif
#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON NULL
#endif
static waylanddynlib waylandlibs[] = {
{NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC},
{NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL},
{NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR},
{NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON}
};
static void *
WAYLAND_GetSym(const char *fnname, int *pHasModule)
{
int i;
void *fn = NULL;
for (i = 0; i < SDL_TABLESIZE(waylandlibs); i++) {
if (waylandlibs[i].lib != NULL) {
fn = SDL_LoadFunction(waylandlibs[i].lib, fnname);
if (fn != NULL)
break;
}
}
#if DEBUG_DYNAMIC_WAYLAND
if (fn != NULL)
SDL_Log("WAYLAND: Found '%s' in %s (%p)\n", fnname, waylandlibs[i].libname, fn);
else
SDL_Log("WAYLAND: Symbol '%s' NOT FOUND!\n", fnname);
#endif
if (fn == NULL)
*pHasModule = 0; /* kill this module. */
return fn;
}
#endif /* SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC */
/* Define all the function pointers and wrappers... */
#define SDL_WAYLAND_MODULE(modname) int SDL_WAYLAND_HAVE_##modname = 0;
#define SDL_WAYLAND_SYM(rc,fn,params) SDL_DYNWAYLANDFN_##fn WAYLAND_##fn = NULL;
#define SDL_WAYLAND_INTERFACE(iface) const struct wl_interface *WAYLAND_##iface = NULL;
#include "SDL_waylandsym.h"
#undef SDL_WAYLAND_MODULE
#undef SDL_WAYLAND_SYM
#undef SDL_WAYLAND_INTERFACE
static int wayland_load_refcount = 0;
void
SDL_WAYLAND_UnloadSymbols(void)
{
/* Don't actually unload if more than one module is using the libs... */
if (wayland_load_refcount > 0) {
if (--wayland_load_refcount == 0) {
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC
int i;
#endif
/* set all the function pointers to NULL. */
#define SDL_WAYLAND_MODULE(modname) SDL_WAYLAND_HAVE_##modname = 0;
#define SDL_WAYLAND_SYM(rc,fn,params) WAYLAND_##fn = NULL;
#define SDL_WAYLAND_INTERFACE(iface) WAYLAND_##iface = NULL;
#include "SDL_waylandsym.h"
#undef SDL_WAYLAND_MODULE
#undef SDL_WAYLAND_SYM
#undef SDL_WAYLAND_INTERFACE
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC
for (i = 0; i < SDL_TABLESIZE(waylandlibs); i++) {
if (waylandlibs[i].lib != NULL) {
SDL_UnloadObject(waylandlibs[i].lib);
waylandlibs[i].lib = NULL;
}
}
#endif
}
}
}
/* returns non-zero if all needed symbols were loaded. */
int
SDL_WAYLAND_LoadSymbols(void)
{
int rc = 1; /* always succeed if not using Dynamic WAYLAND stuff. */
/* deal with multiple modules (dga, wayland, etc) needing these symbols... */
if (wayland_load_refcount++ == 0) {
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC
int i;
int *thismod = NULL;
for (i = 0; i < SDL_TABLESIZE(waylandlibs); i++) {
if (waylandlibs[i].libname != NULL) {
waylandlibs[i].lib = SDL_LoadObject(waylandlibs[i].libname);
}
}
#define SDL_WAYLAND_MODULE(modname) SDL_WAYLAND_HAVE_##modname = 1; /* default yes */
#define SDL_WAYLAND_SYM(rc,fn,params)
#define SDL_WAYLAND_INTERFACE(iface)
#include "SDL_waylandsym.h"
#undef SDL_WAYLAND_MODULE
#undef SDL_WAYLAND_SYM
#undef SDL_WAYLAND_INTERFACE
#define SDL_WAYLAND_MODULE(modname) thismod = &SDL_WAYLAND_HAVE_##modname;
#define SDL_WAYLAND_SYM(rc,fn,params) WAYLAND_##fn = (SDL_DYNWAYLANDFN_##fn) WAYLAND_GetSym(#fn,thismod);
#define SDL_WAYLAND_INTERFACE(iface) WAYLAND_##iface = (struct wl_interface *) WAYLAND_GetSym(#iface,thismod);
#include "SDL_waylandsym.h"
#undef SDL_WAYLAND_MODULE
#undef SDL_WAYLAND_SYM
#undef SDL_WAYLAND_INTERFACE
if (SDL_WAYLAND_HAVE_WAYLAND_CLIENT) {
/* all required symbols loaded. */
SDL_ClearError();
} else {
/* in case something got loaded... */
SDL_WAYLAND_UnloadSymbols();
rc = 0;
}
#else /* no dynamic WAYLAND */
#define SDL_WAYLAND_MODULE(modname) SDL_WAYLAND_HAVE_##modname = 1; /* default yes */
#define SDL_WAYLAND_SYM(rc,fn,params) WAYLAND_##fn = fn;
#define SDL_WAYLAND_INTERFACE(iface) WAYLAND_##iface = &iface;
#include "SDL_waylandsym.h"
#undef SDL_WAYLAND_MODULE
#undef SDL_WAYLAND_SYM
#undef SDL_WAYLAND_INTERFACE
#endif
}
return rc;
}
#endif /* SDL_VIDEO_DRIVER_WAYLAND */
/* vi: set ts=4 sw=4 expandtab: */
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2017-present Open Networking Foundation
*
* 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 io.atomix.utils.concurrent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.time.Duration;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import static com.google.common.base.Preconditions.checkState;
import static io.atomix.utils.concurrent.Threads.namedThreads;
/**
* Single threaded context.
* <p>
* This is a basic {@link ThreadContext} implementation that uses a
* {@link ScheduledExecutorService} to schedule events on the context thread.
*
* @author <a href="http://github.com/kuujo">Jordan Halterman</a>
*/
public class SingleThreadContext extends AbstractThreadContext {
protected static final Logger LOGGER = LoggerFactory.getLogger(SingleThreadContext.class);
private final ScheduledExecutorService executor;
private final Executor wrappedExecutor = new Executor() {
@Override
public void execute(Runnable command) {
try {
executor.execute(() -> {
try {
command.run();
} catch (Exception e) {
LOGGER.error("An uncaught exception occurred", e);
}
});
} catch (RejectedExecutionException e) {
}
}
};
/**
* Creates a new single thread context.
* <p>
* The provided context name will be passed to {@link AtomixThreadFactory} and used
* when instantiating the context thread.
*
* @param nameFormat The context nameFormat which will be formatted with a thread number.
*/
public SingleThreadContext(String nameFormat) {
this(namedThreads(nameFormat, LOGGER));
}
/**
* Creates a new single thread context.
*
* @param factory The thread factory.
*/
public SingleThreadContext(ThreadFactory factory) {
this(new ScheduledThreadPoolExecutor(1, factory));
}
/**
* Creates a new single thread context.
*
* @param executor The executor on which to schedule events. This must be a single thread scheduled executor.
*/
protected SingleThreadContext(ScheduledExecutorService executor) {
this(getThread(executor), executor);
}
private SingleThreadContext(Thread thread, ScheduledExecutorService executor) {
this.executor = executor;
checkState(thread instanceof AtomixThread, "not a Catalyst thread");
((AtomixThread) thread).setContext(this);
}
/**
* Gets the thread from a single threaded executor service.
*/
protected static AtomixThread getThread(ExecutorService executor) {
final AtomicReference<AtomixThread> thread = new AtomicReference<>();
try {
executor.submit(() -> {
thread.set((AtomixThread) Thread.currentThread());
}).get();
} catch (InterruptedException | ExecutionException e) {
throw new IllegalStateException("failed to initialize thread state", e);
}
return thread.get();
}
@Override
public void execute(Runnable command) {
wrappedExecutor.execute(command);
}
@Override
public Scheduled schedule(Duration delay, Runnable runnable) {
ScheduledFuture<?> future = executor.schedule(runnable, delay.toMillis(), TimeUnit.MILLISECONDS);
return () -> future.cancel(false);
}
@Override
public Scheduled schedule(Duration delay, Duration interval, Runnable runnable) {
ScheduledFuture<?> future = executor.scheduleAtFixedRate(runnable, delay.toMillis(), interval.toMillis(), TimeUnit.MILLISECONDS);
return () -> future.cancel(false);
}
@Override
public void close() {
executor.shutdownNow();
}
}
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Collections.Generic;
using System.Management.Automation;
namespace MS.Dbg.Formatting.Commands
{
[Cmdlet( VerbsCommon.Format, "AltSingleLine" )]
public class FormatAltSingleLineCommand : FormatBaseCommand< AltSingleLineViewDefinition >
{
private static readonly ScriptBlock sm_DefaultScript = ScriptBlock.Create( "$_" );
protected override void BeginProcessing()
{
base.BeginProcessing();
// We want to do this in BeginProcessing to help catch the case where you
// accidentally typed "Format-AltSingleLine $blah". (The correct command would
// be "$blah | Format-AltSingleLine" OR "Format-AltSingleLine -InputObject
// $blah". (We won't ever make it to ApplyViewToInputObject because there is
// no input object.)
if( (null != Property) && (0 != Property.Length) )
{
throw new InvalidOperationException( "The Format-AltSingleLine command does not support selecting properties. Did you forget to use -InputObject or use the pipeline?" );
}
} // end BeginProcessing()
protected override AltSingleLineViewDefinition GenerateView()
{
Util.Assert( null != InputObject );
return new AltSingleLineViewDefinition( sm_DefaultScript );
} // end GenerateView()
protected override void ApplyViewToInputObject()
{
string val = RenderScriptValue( InputObject, m_view.Script, false );
// TODO: What to do if it spans more than a line? Just truncate? Issue a
// warning? Add "..."? Also, consider that the view definition might have been
// generated.
if( null == val )
{
WriteObject( String.Empty );
}
else
{
//int idx = val.IndexOf( '\n' );
// TODO: Now we pass 'false' for dontGroupMultipleResults, so I think this
// won't ever get hit unless we are formatting a string that contains a
// newline. Perhaps in that case we should escape it.
int idx = CaStringUtil.ApparentIndexOf( val, '\n' );
if( idx < 0 )
{
WriteObject( val );
}
else
{
WriteObject( CaStringUtil.Truncate( val, idx, false ) );
}
}
} // end ApplyViewToInputObject()
protected override void ResetState( bool newViewChosen )
{
// nothing to do
} // end ResetState()
internal static string FormatSingleLineDirect( object obj )
{
return FormatSingleLineDirect( obj, allowMultipleLines: false );
}
internal static string FormatSingleLineDirect( object obj,
bool allowMultipleLines )
{
if( null == obj )
return String.Empty;
PSObject pso = obj as PSObject;
if( null == pso )
pso = new PSObject( obj );
var view = AltFormattingManager.ChooseFormatInfoForPSObject< AltSingleLineViewDefinition >( pso );
ScriptBlock script;
if( null != view )
{
script = view.Script;
}
else
{
script = sm_DefaultScript;
}
return FormatSingleLineDirect( pso, script, allowMultipleLines );
}
internal static string FormatSingleLineDirect( PSObject obj,
ScriptBlock script,
bool allowMultipleLines )
{
#if DEBUG
sm_renderScriptCallDepth++;
if( sm_renderScriptCallDepth > 10 )
{
// Helps to catch runaway rendering /before/ gobbling tons of memory
System.Diagnostics.Debugger.Break();
// Maybe I should just throw?
}
#endif
var ctxVars = new List<PSVariable> { new PSVariable( "_", obj ), new PSVariable( "PSItem", obj ) };
var results = script.InvokeWithContext( null, ctxVars );
#if DEBUG
sm_renderScriptCallDepth--;
#endif
string val = null;
if( results?.Count > 0)
val = ObjectsToMarkedUpString( results,
"{0}", // <-- IMPORTANT: this prevents infinite recursion via Format-AltSingleLine
null,
false, 4 ).ToString();
// TODO: What to do if it spans more than a line? Just truncate? Issue a
// warning? Add "..."? Also, consider that the view definition might have been
// generated.
if( null == val )
{
return String.Empty;
}
// Q. Why might an alleged single-line view generate multiple lines?
//
// A. Could be buggy. Could be a generated view, and somebody's ToString()
// generates multiple lines. In short: it's not necessarily "weird", or
// unusual.
//
// Q. Why would we want to allow multiple lines? Doesn't the name of this
// class / method say "format SINGLE LINE"?
//
// A. Sometimes multi-line views can not only be accommodated, they are
// desirable, such as for compatibility with the built-in Format-List
// command.
if( allowMultipleLines )
{
return val;
}
int idx = CaStringUtil.ApparentIndexOf( val, '\n' );
if( idx < 0 )
{
return val;
}
return CaStringUtil.Truncate( val, idx );
} // end FormatSingleLineDirect
} // end class FormatAltSingleLineCommand
}
|
{
"pile_set_name": "Github"
}
|
<image>
<filename>image_001724.jpg</filename>
<folder></folder>
<size>
<width>341</width>
<height>256</height>
</size>
<origSize>
<width>800</width>
<height>600</height>
</origSize>
<generated>1</generated>
</image>
<file>
<filename>image_001724.xml</filename>
<folder></folder>
</file>
<object>
<objectId>1</objectId>
<name>car rear az60deg</name>
<masks>
<filename>masks/image_001724.mat</filename>
</masks>
<keyword>car</keyword>
</object>
<objImgSrc>
<filename>img_2265.jpg</filename>
<folder>static_palma_outdoor_august_2005_set4</folder>
<size>
<width>800</width>
<height>600</height>
</size>
<origSize>
<width>2592</width>
<height>1944</height>
</origSize>
</objImgSrc>
<bgImgSrc>
<filename>img_1450.jpg</filename>
<folder>static_palma_outdoor_august_2005_set2</folder>
<size>
<width>800</width>
<height>600</height>
</size>
<origSize>
<width>2592</width>
<height>1944</height>
</origSize>
</bgImgSrc>
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/fish
# Makes command and binaries from SDKMAN! available in fish.
# Delegates to bash for the `sdk` command.
# Copyright (c) 2018 Raphael Reitzig
# MIT License (MIT)
# https://github.com/reitzig/sdkman-for-fish
set __fish_sdkman_init "$HOME/.sdkman/bin/sdkman-init.sh"
set __fish_sdkman_noexport_init "$HOME/.config/fisher/github.com/reitzig/sdkman-for-fish/sdkman-noexport-init.sh"
# Guard: SDKMAN! needs to be installed
if not test -f "$__fish_sdkman_init"
exit 0
end
# Hack for issue #19:
# Create version of sdkman-init that doesn't export any environment variables.
# Refresh if sdkman-init changed.
if begin not test -f "$__fish_sdkman_noexport_init";
or env test "$__fish_sdkman_init" -nt "$__fish_sdkman_noexport_init"
end
mkdir -p (dirname $__fish_sdkman_noexport_init)
sed -E -e 's/^(\s*).*(export|to_path).*$/\1:/g' "$__fish_sdkman_init" \
> "$__fish_sdkman_noexport_init"
end
# Runs the given command in bash, capturing some side effects
# and repeating them on the current fish shell.
# Returns the same status code as the given command.
function __fish_sdkman_run_in_bash
# We need to leave stdin and stdout of sdk free for user interaction.
# So, pipe relevant environment variables (which might have changed)
# through a file.
# But since now getting the exit code of sdk itself is a hassle,
# pipe it as well.
#
# TODO: Can somebody get this to work without the overhead of a file?
set pipe (mktemp)
bash -c "$argv[1];
echo -e \"\$?\" > $pipe;
env | grep -e '^SDKMAN_\|^PATH' >> $pipe;
env | grep -i -E \"^(`echo \${SDKMAN_CANDIDATES_CSV} | sed 's/,/|/g'`)_HOME\" >> $pipe;
echo \"SDKMAN_OFFLINE_MODE=\${SDKMAN_OFFLINE_MODE}\" >> $pipe" # it's not an environment variable!
set bashDump (cat $pipe; rm $pipe)
set sdkStatus $bashDump[1]
set bashEnv $bashDump[2..-1]
# If SDKMAN! succeeded, copy relevant environment variables
# to the current shell (they might have changed)
if [ $sdkStatus = 0 ]
for line in $bashEnv
set parts (string split "=" $line)
set var $parts[1]
set value (string join "=" $parts[2..-1])
switch "$var"
case "PATH"
# Special treatment: need fish list instead
# of colon-separated list.
set value (string split : "$value")
end
if test -n value
set -gx $var $value
# Note: This makes SDKMAN_OFFLINE_MODE an environment variable.
# That gives it the behaviour we _want_!
end
end
end
return $sdkStatus
end
# If this is a subshell of a(n initialized) fish owned by the same user,
# no initialization necessary.
# Otherwise:
if not set -q SDKMAN_DIR; or test (ls -ld "$SDKMAN_DIR" | awk '{print $3}') != (whoami)
set -e SDKMAN_DIR
__fish_sdkman_run_in_bash "source $__fish_sdkman_init"
end
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.