text
stringlengths
2
100k
meta
dict
# Event 10 - ReadContainerInfo ###### Version: 0 ## Description None ## Data Dictionary |Standard Name|Field Name|Type|Description|Sample Value| |---|---|---|---|---| |TBD|ProcessName|UnicodeString|None|`None`| |TBD|ProviderType|UInt32|None|`None`| |TBD|ContainerName|AnsiString|None|`None`| |TBD|MachineKeyset|Boolean|None|`None`| |TBD|Status|UInt32|None|`None`| |TBD|ErrorDescription|UnicodeString|None|`None`| ## Tags * etw_level_Always * etw_task_ReadContainerInfo
{ "pile_set_name": "Github" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!1 &5417053016401900264 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 5417053016401900247} - component: {fileID: 5417053016401900245} - component: {fileID: 5417053016401900246} m_Layer: 5 m_Name: GameObject m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!224 &5417053016401900247 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016401900264} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 3010041089604644097} - {fileID: 5417053018035381816} m_Father: {fileID: 5417053016824185910} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 416, y: 0} m_SizeDelta: {x: 384, y: 0} m_Pivot: {x: 0, y: 1} --- !u!114 &5417053016401900245 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016401900264} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} m_Name: m_EditorClassIdentifier: m_Padding: m_Left: 0 m_Right: 0 m_Top: 0 m_Bottom: 0 m_ChildAlignment: 4 m_Spacing: 16 m_ChildForceExpandWidth: 0 m_ChildForceExpandHeight: 0 m_ChildControlWidth: 0 m_ChildControlHeight: 0 m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 --- !u!114 &5417053016401900246 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016401900264} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} m_Name: m_EditorClassIdentifier: m_HorizontalFit: 0 m_VerticalFit: 2 --- !u!1 &5417053016815448995 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 5417053016815448994} - component: {fileID: 5417053016815449006} - component: {fileID: 5417053016815449007} - component: {fileID: 5417053016815448992} - component: {fileID: 5417053016815448993} m_Layer: 5 m_Name: Description m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!224 &5417053016815448994 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016815448995} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 5417053017758573656} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0, y: -72} m_SizeDelta: {x: 512, y: 0} m_Pivot: {x: 0, y: 1} --- !u!222 &5417053016815449006 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016815448995} m_CullTransparentMesh: 0 --- !u!114 &5417053016815449007 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016815448995} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 0.5019608} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_FontData: m_Font: {fileID: 12800000, guid: 7a6b59cdd73e04e37b341fa45c996f42, type: 3} m_FontSize: 28 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 2 m_MaxSize: 40 m_Alignment: 0 m_AlignByGeometry: 0 m_RichText: 0 m_HorizontalOverflow: 0 m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: sdfsdf --- !u!114 &5417053016815448992 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016815448995} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} m_Name: m_EditorClassIdentifier: m_HorizontalFit: 0 m_VerticalFit: 2 --- !u!114 &5417053016815448993 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016815448995} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 97bc2ebab6563400c95b036136d26ea6, type: 3} m_Name: m_EditorClassIdentifier: m_Inverse: 0 m_MaskInteraction: 85 m_UseStencil: 0 --- !u!1 &5417053016824185911 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 5417053016824185910} - component: {fileID: 5417053016824185908} - component: {fileID: 5417053016824185909} - component: {fileID: 1768076760616490064} - component: {fileID: -895715441551669406} - component: {fileID: -6514255099567271695} - component: {fileID: 4921708648284386754} m_Layer: 5 m_Name: InputPreferenceElement m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!224 &5417053016824185910 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016824185911} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 5417053017758573656} - {fileID: 5417053016401900247} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 928, y: 0} m_Pivot: {x: 0, y: 1} --- !u!114 &5417053016824185908 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016824185911} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} m_Name: m_EditorClassIdentifier: m_Padding: m_Left: 0 m_Right: 0 m_Top: 0 m_Bottom: 0 m_ChildAlignment: 4 m_Spacing: 32 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 1 m_ChildControlWidth: 0 m_ChildControlHeight: 0 m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 --- !u!114 &5417053016824185909 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016824185911} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} m_Name: m_EditorClassIdentifier: m_HorizontalFit: 0 m_VerticalFit: 2 --- !u!114 &1768076760616490064 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016824185911} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 14b87ede40564f05b71148188b5caebf, type: 3} m_Name: m_EditorClassIdentifier: title: {fileID: 5417053017546194813} description: {fileID: 5417053016815449007} saveSettingsOnChange: 0 inputField: {fileID: 3010041090148477667} unit: {fileID: 5417053018035381797} placeholder: {fileID: 3010041090037029357} --- !u!114 &-895715441551669406 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016824185911} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 31f6a0ba801343f3a4a9d3fb3a8022d4, type: 3} m_Name: m_EditorClassIdentifier: --- !u!223 &-6514255099567271695 Canvas: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016824185911} m_Enabled: 1 serializedVersion: 3 m_RenderMode: 2 m_Camera: {fileID: 0} m_PlaneDistance: 100 m_PixelPerfect: 0 m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 m_AdditionalShaderChannelsFlag: 0 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 --- !u!114 &4921708648284386754 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053016824185911} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} m_Name: m_EditorClassIdentifier: m_IgnoreReversedGraphics: 1 m_BlockingObjects: 0 m_BlockingMask: serializedVersion: 2 m_Bits: 4294967295 --- !u!1 &5417053017546194801 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 5417053017546194800} - component: {fileID: 5417053017546194812} - component: {fileID: 5417053017546194813} - component: {fileID: 5417053017546194814} - component: {fileID: 5417053017546194815} m_Layer: 5 m_Name: Name m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!224 &5417053017546194800 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053017546194801} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 5417053017758573656} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0, y: -24} m_SizeDelta: {x: 512, y: 0} m_Pivot: {x: 0, y: 1} --- !u!222 &5417053017546194812 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053017546194801} m_CullTransparentMesh: 0 --- !u!114 &5417053017546194813 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053017546194801} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_FontData: m_Font: {fileID: 12800000, guid: 5c2f1ea2249b645bbaa8638ed1c82b34, type: 3} m_FontSize: 36 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 3 m_MaxSize: 40 m_Alignment: 0 m_AlignByGeometry: 0 m_RichText: 0 m_HorizontalOverflow: 0 m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: Base note offset --- !u!114 &5417053017546194814 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053017546194801} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} m_Name: m_EditorClassIdentifier: m_HorizontalFit: 0 m_VerticalFit: 2 --- !u!114 &5417053017546194815 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053017546194801} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 97bc2ebab6563400c95b036136d26ea6, type: 3} m_Name: m_EditorClassIdentifier: m_Inverse: 0 m_MaskInteraction: 85 m_UseStencil: 0 --- !u!1 &5417053017758573657 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 5417053017758573656} - component: {fileID: 5417053017758573638} - component: {fileID: 5417053017758573639} - component: {fileID: 8771048921060398939} m_Layer: 5 m_Name: Texts m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!224 &5417053017758573656 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053017758573657} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 5417053017546194800} - {fileID: 5417053016815448994} m_Father: {fileID: 5417053016824185910} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} --- !u!114 &5417053017758573638 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053017758573657} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} m_Name: m_EditorClassIdentifier: m_Padding: m_Left: 0 m_Right: 0 m_Top: 0 m_Bottom: 0 m_ChildAlignment: 4 m_Spacing: 0 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 1 m_ChildControlWidth: 0 m_ChildControlHeight: 0 m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 --- !u!114 &5417053017758573639 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053017758573657} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} m_Name: m_EditorClassIdentifier: m_HorizontalFit: 2 m_VerticalFit: 2 --- !u!114 &8771048921060398939 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053017758573657} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} m_Name: m_EditorClassIdentifier: m_IgnoreLayout: 0 m_MinWidth: -1 m_MinHeight: 96 m_PreferredWidth: -1 m_PreferredHeight: -1 m_FlexibleWidth: -1 m_FlexibleHeight: -1 m_LayoutPriority: 1 --- !u!1 &5417053018035381817 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 5417053018035381816} - component: {fileID: 5417053018035381796} - component: {fileID: 5417053018035381797} - component: {fileID: 5417053018035381798} - component: {fileID: 5417053018035381799} m_Layer: 5 m_Name: Unit m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!224 &5417053018035381816 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053018035381817} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 5417053016401900247} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 266, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5417053018035381796 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053018035381817} m_CullTransparentMesh: 0 --- !u!114 &5417053018035381797 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053018035381817} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_FontData: m_Font: {fileID: 12800000, guid: 7a6b59cdd73e04e37b341fa45c996f42, type: 3} m_FontSize: 36 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 2 m_MaxSize: 40 m_Alignment: 0 m_AlignByGeometry: 0 m_RichText: 0 m_HorizontalOverflow: 0 m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: seconds --- !u!114 &5417053018035381798 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053018035381817} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} m_Name: m_EditorClassIdentifier: m_HorizontalFit: 2 m_VerticalFit: 2 --- !u!114 &5417053018035381799 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5417053018035381817} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 97bc2ebab6563400c95b036136d26ea6, type: 3} m_Name: m_EditorClassIdentifier: m_Inverse: 0 m_MaskInteraction: 85 m_UseStencil: 0 --- !u!1001 &5417053017034761068 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 5417053016401900247} m_Modifications: - target: {fileID: 7127207444520647297, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_Text value: '#000000' objectReference: {fileID: 0} - target: {fileID: 7127207444877511054, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207444877511054, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207444877511054, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207444877511054, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207444877511054, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_SizeDelta.x value: 132 objectReference: {fileID: 0} - target: {fileID: 7127207445079723955, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_Name value: Text objectReference: {fileID: 0} - target: {fileID: 7127207445422034540, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_Name value: InputField objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_LocalRotation.x value: -0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_LocalRotation.y value: -0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_LocalRotation.z value: -0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_RootOrder value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_AnchoredPosition.x value: 118.5 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_AnchoredPosition.y value: -48 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_SizeDelta.y value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_AnchorMin.x value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_AnchorMin.y value: 1 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_AnchorMax.x value: 0 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_AnchorMax.y value: 1 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_Pivot.x value: 0.5 objectReference: {fileID: 0} - target: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} propertyPath: m_Pivot.y value: 0.5 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: e389d791780bd45419f1818454246d65, type: 3} --- !u!224 &3010041089604644097 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 7127207445422034541, guid: e389d791780bd45419f1818454246d65, type: 3} m_PrefabInstance: {fileID: 5417053017034761068} m_PrefabAsset: {fileID: 0} --- !u!114 &3010041090148477667 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 7127207444877511055, guid: e389d791780bd45419f1818454246d65, type: 3} m_PrefabInstance: {fileID: 5417053017034761068} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d199490a83bb2b844b9695cbf13b01ef, type: 3} m_Name: m_EditorClassIdentifier: --- !u!114 &3010041090037029357 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 7127207444520647297, guid: e389d791780bd45419f1818454246d65, type: 3} m_PrefabInstance: {fileID: 5417053017034761068} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} m_Name: m_EditorClassIdentifier:
{ "pile_set_name": "Github" }
/* GIO - GLib Input, Output and Streaming Library * * Copyright (C) 2006-2007 Red Hat, Inc. * * 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 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., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * * Author: Alexander Larsson <[email protected]> */ #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) #error "Only <gio/gio.h> can be included directly." #endif #ifndef __G_FILE_ATTRIBUTE_H__ #define __G_FILE_ATTRIBUTE_H__ #include <gio/giotypes.h> G_BEGIN_DECLS /** * GFileAttributeInfo: * @name: the name of the attribute. * @type: the #GFileAttributeType type of the attribute. * @flags: a set of #GFileAttributeInfoFlags. * * Information about a specific attribute. **/ struct _GFileAttributeInfo { char *name; GFileAttributeType type; GFileAttributeInfoFlags flags; }; /** * GFileAttributeInfoList: * @infos: an array of #GFileAttributeInfo<!-- -->s. * @n_infos: the number of values in the array. * * Acts as a lightweight registry for possible valid file attributes. * The registry stores Key-Value pair formats as #GFileAttributeInfo<!-- -->s. **/ struct _GFileAttributeInfoList { GFileAttributeInfo *infos; int n_infos; }; GType g_file_attribute_info_list_get_type (void); GFileAttributeInfoList * g_file_attribute_info_list_new (void); GFileAttributeInfoList * g_file_attribute_info_list_ref (GFileAttributeInfoList *list); void g_file_attribute_info_list_unref (GFileAttributeInfoList *list); GFileAttributeInfoList * g_file_attribute_info_list_dup (GFileAttributeInfoList *list); const GFileAttributeInfo *g_file_attribute_info_list_lookup (GFileAttributeInfoList *list, const char *name); void g_file_attribute_info_list_add (GFileAttributeInfoList *list, const char *name, GFileAttributeType type, GFileAttributeInfoFlags flags); G_END_DECLS #endif /* __G_FILE_INFO_H__ */
{ "pile_set_name": "Github" }
Metadata-Version: 2.1 Name: pyobjc-framework-ContactsUI Version: 5.2 Summary: Wrappers for the framework ContactsUI on macOS Home-page: https://bitbucket.org/ronaldoussoren/pyobjc Author: Ronald Oussoren Author-email: [email protected] License: MIT License Keywords: PyObjC,ContactsUI Platform: MacOS X (>=10.11) Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Console Classifier: Environment :: MacOS X :: Cocoa Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Natural Language :: English Classifier: Operating System :: MacOS :: MacOS X Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Objective C Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Software Development :: User Interfaces Description-Content-Type: text/x-rst; charset=UTF-8 Project-URL: Documentation, https://pyobjc.readthedocs.io/en/latest/ Project-URL: Issue tracker, https://bitbucket.org/ronaldoussoren/pyobjc/issues?status=new&status=open Requires-Dist: pyobjc-core (>=5.2) Requires-Dist: pyobjc-framework-Cocoa (>=5.2) Requires-Dist: pyobjc-framework-Contacts (>=5.2) Wrappers for the "ContactsUI" framework on macOS 10.11. These wrappers don't include documentation, please check Apple's documention for information on how to use this framework and PyObjC's documentation for general tips and tricks regarding the translation between Python and (Objective-)C frameworks Project links ------------- * `Documentation <https://pyobjc.readthedocs.io/en/latest/>`_ * `Issue Tracker <https://bitbucket.org/ronaldoussoren/pyobjc/issues?status=new&status=open>`_ * `Repository <https://bitbucket.org/ronaldoussoren/pyobjc/>`_
{ "pile_set_name": "Github" }
package com.plugin.gcm; import android.app.NotificationManager; import android.content.Context; import android.os.Bundle; import android.util.Log; import com.google.android.gcm.GCMRegistrar; import org.apache.cordova.CallbackContext; import org.apache.cordova.CordovaInterface; import org.apache.cordova.CordovaPlugin; import org.apache.cordova.CordovaWebView; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.Iterator; /** * @author awysocki */ public class PushPlugin extends CordovaPlugin { public static final String TAG = "PushPlugin"; public static final String REGISTER = "register"; public static final String UNREGISTER = "unregister"; public static final String EXIT = "exit"; private static CordovaWebView gWebView; private static String gECB; private static String gSenderID; private static Bundle gCachedExtras = null; private static boolean gForeground = false; /** * Gets the application context from cordova's main activity. * @return the application context */ private Context getApplicationContext() { return this.cordova.getActivity().getApplicationContext(); } @Override public boolean execute(String action, JSONArray data, CallbackContext callbackContext) { boolean result = false; Log.v(TAG, "execute: action=" + action); if (REGISTER.equals(action)) { Log.v(TAG, "execute: data=" + data.toString()); try { JSONObject jo = data.getJSONObject(0); gWebView = this.webView; Log.v(TAG, "execute: jo=" + jo.toString()); gECB = (String) jo.get("ecb"); gSenderID = (String) jo.get("senderID"); Log.v(TAG, "execute: ECB=" + gECB + " senderID=" + gSenderID); GCMRegistrar.register(getApplicationContext(), gSenderID); result = true; callbackContext.success(); } catch (JSONException e) { Log.e(TAG, "execute: Got JSON Exception " + e.getMessage()); result = false; callbackContext.error(e.getMessage()); } if ( gCachedExtras != null) { Log.v(TAG, "sending cached extras"); sendExtras(gCachedExtras); gCachedExtras = null; } } else if (UNREGISTER.equals(action)) { GCMRegistrar.unregister(getApplicationContext()); Log.v(TAG, "UNREGISTER"); result = true; callbackContext.success(); } else { result = false; Log.e(TAG, "Invalid action : " + action); callbackContext.error("Invalid action : " + action); } return result; } /* * Sends a json object to the client as parameter to a method which is defined in gECB. */ public static void sendJavascript(JSONObject _json) { String _d = "javascript:" + gECB + "(" + _json.toString() + ")"; Log.v(TAG, "sendJavascript: " + _d); if (gECB != null && gWebView != null) { gWebView.sendJavascript(_d); } } /* * Sends the pushbundle extras to the client application. * If the client application isn't currently active, it is cached for later processing. */ public static void sendExtras(Bundle extras) { if (extras != null) { if (gECB != null && gWebView != null) { sendJavascript(convertBundleToJson(extras)); } else { Log.v(TAG, "sendExtras: caching extras to send at a later time."); gCachedExtras = extras; } } } @Override public void initialize(CordovaInterface cordova, CordovaWebView webView) { super.initialize(cordova, webView); gForeground = true; } @Override public void onPause(boolean multitasking) { super.onPause(multitasking); gForeground = false; final NotificationManager notificationManager = (NotificationManager) cordova.getActivity().getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); } @Override public void onResume(boolean multitasking) { super.onResume(multitasking); gForeground = true; } @Override public void onDestroy() { super.onDestroy(); gForeground = false; gECB = null; gWebView = null; } /* * serializes a bundle to JSON. */ private static JSONObject convertBundleToJson(Bundle extras) { try { JSONObject json; json = new JSONObject().put("event", "message"); JSONObject jsondata = new JSONObject(); Iterator<String> it = extras.keySet().iterator(); while (it.hasNext()) { String key = it.next(); Object value = extras.get(key); // System data from Android if (key.equals("from") || key.equals("collapse_key")) { json.put(key, value); } else if (key.equals("foreground")) { json.put(key, extras.getBoolean("foreground")); } else if (key.equals("coldstart")) { json.put(key, extras.getBoolean("coldstart")); } else { // Maintain backwards compatibility if (key.equals("message") || key.equals("msgcnt") || key.equals("soundname")) { json.put(key, value); } if ( value instanceof String ) { // Try to figure out if the value is another JSON object String strValue = (String)value; if (strValue.startsWith("{")) { try { JSONObject json2 = new JSONObject(strValue); jsondata.put(key, json2); } catch (Exception e) { jsondata.put(key, value); } // Try to figure out if the value is another JSON array } else if (strValue.startsWith("[")) { try { JSONArray json2 = new JSONArray(strValue); jsondata.put(key, json2); } catch (Exception e) { jsondata.put(key, value); } } else { jsondata.put(key, value); } } } } // while json.put("payload", jsondata); Log.v(TAG, "extrasToJSON: " + json.toString()); return json; } catch( JSONException e) { Log.e(TAG, "extrasToJSON: JSON exception"); } return null; } public static boolean isInForeground() { return gForeground; } public static boolean isActive() { return gWebView != null; } }
{ "pile_set_name": "Github" }
// Listing 5.11 Using the noteUp and noteDown functions in a main loop // global variables Mandolin mand => dac; // (1) Makes and connects a Mandolin instrument UGen. 60 => int note; // (2) Global note variable // functions fun void noteUp() // (3) noteUp function definition { 1 +=> note; // note half-step up, (4) Adds 1 to global note variable <<< note >>>; // (5) Prints it out play(); // call play function // (6) Plays it } fun void noteDown() // (7) noteDown function { // (8) Subtracts 1 from global note variable 1 -=> note; // note half-step down <<< note >>>; // print new note value play(); // call play function } // play global note on global mand UG fun void play() // (9) Defines play function { Std.mtof(note) => mand.freq; // (10) Sets global Mandolin frequency using global note 1 => mand.noteOn; // (11) Plays note on Mandolin second => now; // (12) Hangs out for a second before returning to main loop } // Main Program, gradually rising "melody" while (true) { // (1) Main program to test noteUp and noteDown functions. noteUp(); // (2) Calls noteUp, and when it's done noteDown(); // (3) Calls noteDown, and so on noteUp(); // Then calls noteUp twice. noteUp(); noteDown(); // Then calls noteDown and loops. }
{ "pile_set_name": "Github" }
RSpec.describe TTY::ProgressBar::Multi, '#line_inset' do let(:output) { StringIO.new('', 'w+') } it "doesn't create inset when no top level bar" do bars = TTY::ProgressBar::Multi.new(output: output) bar = bars.register 'example' expect(bars.line_inset(bar)).to eq('') end it "defaults to the empty string for the top level bar" do bars = TTY::ProgressBar::Multi.new("Top level spinner", output: output) expect(bars.line_inset(bars.top_bar)) .to eq(TTY::ProgressBar::Multi::DEFAULT_INSET[:top]) end it "returns middle character for a top level bar" do bars = TTY::ProgressBar::Multi.new("Top level bar", output: output) bar = bars.register 'middle', total: 10 bar2 = bars.register 'bottom', total: 10 bar.start bar2.start expect(bars.line_inset(bar)) .to eq(TTY::ProgressBar::Multi::DEFAULT_INSET[:middle]) end it "decorates last bar" do bars = TTY::ProgressBar::Multi.new("Top spinner", output: output) bar1 = bars.register 'middle', total: 10 bar = bars.register 'bottom', total: 10 bar1.start bar.start expect(bars.line_inset(bar)) .to eq(TTY::ProgressBar::Multi::DEFAULT_INSET[:bottom]) end it "allows customization" do opts = { output: output, style: { top: ". ", middle: "--", bottom: "---", } } bars = TTY::ProgressBar::Multi.new("Top level spinner", opts) middle_bar = bars.register "", total: 10 bottom_bar = bars.register "", total: 10 middle_bar.start bottom_bar.start expect(bars.line_inset(bars.top_bar)).to eq(". ") expect(bars.line_inset(middle_bar)).to eq("--") expect(bars.line_inset(bottom_bar)).to eq("---") end end
{ "pile_set_name": "Github" }
//: ---------------------------------------------------------------------------- //: Copyright (C) 2015 Verizon. 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. //: //: ---------------------------------------------------------------------------- package knobs final case class ValueError(name: String, value: CfgValue) extends Exception(s"Key '$name' found but value '${value.pretty}' isn't the expected type.")
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_202) on Fri Jul 24 11:53:29 GMT 2020 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>RDFWriterBase (Eclipse RDF4J 3.3.0 API)</title> <meta name="date" content="2020-07-24"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="RDFWriterBase (Eclipse RDF4J 3.3.0 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/RDFWriterBase.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/eclipse/rdf4j/rio/helpers/RDFStarUtil.html" title="class in org.eclipse.rdf4j.rio.helpers"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../org/eclipse/rdf4j/rio/helpers/RioConfigurationException.html" title="class in org.eclipse.rdf4j.rio.helpers"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/eclipse/rdf4j/rio/helpers/RDFWriterBase.html" target="_top">Frames</a></li> <li><a href="RDFWriterBase.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#fields.inherited.from.class.org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#methods.inherited.from.class.org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.eclipse.rdf4j.rio.helpers</div> <h2 title="Class RDFWriterBase" class="title">Class RDFWriterBase</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li><a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html" title="class in org.eclipse.rdf4j.rio.helpers">org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter</a></li> <li> <ul class="inheritance"> <li>org.eclipse.rdf4j.rio.helpers.RDFWriterBase</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="../../../../../org/eclipse/rdf4j/rio/RDFHandler.html" title="interface in org.eclipse.rdf4j.rio">RDFHandler</a>, <a href="../../../../../org/eclipse/rdf4j/rio/RDFWriter.html" title="interface in org.eclipse.rdf4j.rio">RDFWriter</a></dd> </dl> <hr> <div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp; <div class="block"><span class="deprecationComment">since 2.0. Use <a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html" title="class in org.eclipse.rdf4j.rio.helpers"><code>AbstractRDFWriter</code></a> instead.</span></div> </div> <br> <pre><a href="http://download.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a> public abstract class <span class="typeNameLabel">RDFWriterBase</span> extends <a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html" title="class in org.eclipse.rdf4j.rio.helpers">AbstractRDFWriter</a></pre> <dl> <dt><span class="simpleTagLabel">Author:</span></dt> <dd>Jeen Broekstra</dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field.summary"> <!-- --> </a> <h3>Field Summary</h3> <ul class="blockList"> <li class="blockList"><a name="fields.inherited.from.class.org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter"> <!-- --> </a> <h3>Fields inherited from class&nbsp;org.eclipse.rdf4j.rio.helpers.<a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html" title="class in org.eclipse.rdf4j.rio.helpers">AbstractRDFWriter</a></h3> <code><a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html#namespaceTable">namespaceTable</a>, <a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html#statementConsumer">statementConsumer</a></code></li> </ul> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier</th> <th class="colLast" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>protected </code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/rdf4j/rio/helpers/RDFWriterBase.html#RDFWriterBase--">RDFWriterBase</a></span>()</code> <div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div> &nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.eclipse.rdf4j.rio.helpers.<a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html" title="class in org.eclipse.rdf4j.rio.helpers">AbstractRDFWriter</a></h3> <code><a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html#checkWritingStarted--">checkWritingStarted</a>, <a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html#consumeStatement-org.eclipse.rdf4j.model.Statement-">consumeStatement</a>, <a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html#getOutputStream--">getOutputStream</a>, <a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html#getSupportedSettings--">getSupportedSettings</a>, <a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html#getWriterConfig--">getWriterConfig</a>, <a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html#handleNamespace-java.lang.String-java.lang.String-">handleNamespace</a>, <a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html#handleStatement-org.eclipse.rdf4j.model.Statement-">handleStatement</a>, <a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html#isWritingStarted--">isWritingStarted</a>, <a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html#set-org.eclipse.rdf4j.rio.RioSetting-T-">set</a>, <a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html#setWriterConfig-org.eclipse.rdf4j.rio.WriterConfig-">setWriterConfig</a>, <a href="../../../../../org/eclipse/rdf4j/rio/helpers/AbstractRDFWriter.html#startRDF--">startRDF</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.<a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> <code><a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.org.eclipse.rdf4j.rio.RDFWriter"> <!-- --> </a> <h3>Methods inherited from interface&nbsp;org.eclipse.rdf4j.rio.<a href="../../../../../org/eclipse/rdf4j/rio/RDFWriter.html" title="interface in org.eclipse.rdf4j.rio">RDFWriter</a></h3> <code><a href="../../../../../org/eclipse/rdf4j/rio/RDFWriter.html#getRDFFormat--">getRDFFormat</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.org.eclipse.rdf4j.rio.RDFHandler"> <!-- --> </a> <h3>Methods inherited from interface&nbsp;org.eclipse.rdf4j.rio.<a href="../../../../../org/eclipse/rdf4j/rio/RDFHandler.html" title="interface in org.eclipse.rdf4j.rio">RDFHandler</a></h3> <code><a href="../../../../../org/eclipse/rdf4j/rio/RDFHandler.html#endRDF--">endRDF</a>, <a href="../../../../../org/eclipse/rdf4j/rio/RDFHandler.html#handleComment-java.lang.String-">handleComment</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="RDFWriterBase--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>RDFWriterBase</h4> <pre>protected&nbsp;RDFWriterBase()</pre> <div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/RDFWriterBase.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/eclipse/rdf4j/rio/helpers/RDFStarUtil.html" title="class in org.eclipse.rdf4j.rio.helpers"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../org/eclipse/rdf4j/rio/helpers/RioConfigurationException.html" title="class in org.eclipse.rdf4j.rio.helpers"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/eclipse/rdf4j/rio/helpers/RDFWriterBase.html" target="_top">Frames</a></li> <li><a href="RDFWriterBase.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#fields.inherited.from.class.org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#methods.inherited.from.class.org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2015-2020 <a href="https://www.eclipse.org/">Eclipse Foundation</a>. All Rights Reserved.</small></p> </body> </html>
{ "pile_set_name": "Github" }
// Copyright 2015 TiDB Author. 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. package orm import ( "fmt" ) // mysql dbBaser implementation. type dbBaseTidb struct { dbBase } var _ dbBaser = new(dbBaseTidb) // get mysql operator. func (d *dbBaseTidb) OperatorSQL(operator string) string { return mysqlOperators[operator] } // get mysql table field types. func (d *dbBaseTidb) DbTypes() map[string]string { return mysqlTypes } // show table sql for mysql. func (d *dbBaseTidb) ShowTablesQuery() string { return "SELECT table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE' AND table_schema = DATABASE()" } // show columns sql of table for mysql. func (d *dbBaseTidb) ShowColumnsQuery(table string) string { return fmt.Sprintf("SELECT COLUMN_NAME, COLUMN_TYPE, IS_NULLABLE FROM information_schema.columns "+ "WHERE table_schema = DATABASE() AND table_name = '%s'", table) } // execute sql to check index exist. func (d *dbBaseTidb) IndexExists(db dbQuerier, table string, name string) bool { row := db.QueryRow("SELECT count(*) FROM information_schema.statistics "+ "WHERE table_schema = DATABASE() AND table_name = ? AND index_name = ?", table, name) var cnt int row.Scan(&cnt) return cnt > 0 } // create new mysql dbBaser. func newdbBaseTidb() dbBaser { b := new(dbBaseTidb) b.ins = b return b }
{ "pile_set_name": "Github" }
INIT WANTSCREEN RESET !Plain PUSH "A" ?screen_cell 0,0 = {0x41} width=1 attrs={} fg=rgb(240,240,240) bg=rgb(0,0,0) !Bold PUSH "\e[1mB" ?screen_cell 0,1 = {0x42} width=1 attrs={B} fg=rgb(240,240,240) bg=rgb(0,0,0) !Italic PUSH "\e[3mC" ?screen_cell 0,2 = {0x43} width=1 attrs={BI} fg=rgb(240,240,240) bg=rgb(0,0,0) !Underline PUSH "\e[4mD" ?screen_cell 0,3 = {0x44} width=1 attrs={BU1I} fg=rgb(240,240,240) bg=rgb(0,0,0) !Reset PUSH "\e[mE" ?screen_cell 0,4 = {0x45} width=1 attrs={} fg=rgb(240,240,240) bg=rgb(0,0,0) !Font PUSH "\e[11mF\e[m" ?screen_cell 0,5 = {0x46} width=1 attrs={F1} fg=rgb(240,240,240) bg=rgb(0,0,0) !Foreground PUSH "\e[31mG\e[m" ?screen_cell 0,6 = {0x47} width=1 attrs={} fg=rgb(224,0,0) bg=rgb(0,0,0) !Background PUSH "\e[42mH\e[m" ?screen_cell 0,7 = {0x48} width=1 attrs={} fg=rgb(240,240,240) bg=rgb(0,224,0) !EL sets reverse and colours to end of line PUSH "\e[H\e[7;33;44m\e[K" ?screen_cell 0,0 = {} width=1 attrs={R} fg=rgb(224,224,0) bg=rgb(0,0,224) ?screen_cell 0,79 = {} width=1 attrs={R} fg=rgb(224,224,0) bg=rgb(0,0,224) !DECSCNM xors reverse for entire screen PUSH "\e[?5h" ?screen_cell 0,0 = {} width=1 attrs={} fg=rgb(224,224,0) bg=rgb(0,0,224) ?screen_cell 0,79 = {} width=1 attrs={} fg=rgb(224,224,0) bg=rgb(0,0,224) ?screen_cell 1,0 = {} width=1 attrs={R} fg=rgb(240,240,240) bg=rgb(0,0,0) PUSH "\e[?5l" ?screen_cell 0,0 = {} width=1 attrs={R} fg=rgb(224,224,0) bg=rgb(0,0,224) ?screen_cell 0,79 = {} width=1 attrs={R} fg=rgb(224,224,0) bg=rgb(0,0,224) ?screen_cell 1,0 = {} width=1 attrs={} fg=rgb(240,240,240) bg=rgb(0,0,0)
{ "pile_set_name": "Github" }
/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package androidx.core.os import android.content.Context import android.view.View import androidx.test.core.app.ApplicationProvider import androidx.test.filters.SdkSuppress import androidx.test.filters.SmallTest import androidx.testutils.assertThrows import com.google.common.truth.Truth.assertThat import org.junit.Assert.assertArrayEquals import org.junit.Assert.assertEquals import org.junit.Assert.assertNull import org.junit.Test @SdkSuppress(minSdkVersion = 21) @SmallTest class PersistableBundleTest { @Test fun persistableBundleOfValid() { val bundle = persistableBundleOf( "null" to null, "double" to 1.0, "int" to 1, "long" to 1L, "string" to "hey", "doubleArray" to doubleArrayOf(), "intArray" to intArrayOf(), "longArray" to longArrayOf(), "stringArray" to arrayOf("hey") ) assertEquals(9, bundle.size()) assertNull(bundle["null"]) assertEquals(1.0, bundle["double"]) assertEquals(1, bundle["int"]) assertEquals(1L, bundle["long"]) assertEquals("hey", bundle["string"]) assertArrayEquals(doubleArrayOf(), bundle["doubleArray"] as DoubleArray, 0.0) assertArrayEquals(intArrayOf(), bundle["intArray"] as IntArray) assertArrayEquals(longArrayOf(), bundle["longArray"] as LongArray) assertThat(bundle["stringArray"] as Array<*>).asList().containsExactly("hey") } @SdkSuppress(minSdkVersion = 22) @Test fun persistableBundleOfValidApi22() { val bundle = persistableBundleOf( "boolean" to true, "booleanArray" to booleanArrayOf() ) assertEquals(true, bundle["boolean"]) assertArrayEquals(booleanArrayOf(), bundle["booleanArray"] as BooleanArray) } @Test fun persistableBundleOfInvalid() { assertThrows<IllegalArgumentException> { persistableBundleOf( "nope" to View(ApplicationProvider.getApplicationContext() as Context) ) }.hasMessageThat().isEqualTo("Illegal value type android.view.View for key \"nope\"") assertThrows<IllegalArgumentException> { persistableBundleOf( "nopes" to arrayOf(View(ApplicationProvider.getApplicationContext() as Context)) ) }.hasMessageThat().isEqualTo("Illegal value array type android.view.View for key \"nopes\"") } }
{ "pile_set_name": "Github" }
# frozen_string_literal: true # Copyright 2020 Google LLC # # 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 # # https://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. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Cloud module Trace module V2 VERSION = "0.1.2" end end end end
{ "pile_set_name": "Github" }
/* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-2010 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #ifndef ZCONF_H #define ZCONF_H #cmakedefine Z_PREFIX #cmakedefine Z_HAVE_UNISTD_H /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. * Even better than compiling with -DZ_PREFIX would be to use configure to set * this permanently in zconf.h using "./configure --zprefix". */ #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ /* all linked symbols */ # define _dist_code z__dist_code # define _length_code z__length_code # define _tr_align z__tr_align # define _tr_flush_block z__tr_flush_block # define _tr_init z__tr_init # define _tr_stored_block z__tr_stored_block # define _tr_tally z__tr_tally # define adler32 z_adler32 # define adler32_combine z_adler32_combine # define adler32_combine64 z_adler32_combine64 # define compress z_compress # define compress2 z_compress2 # define compressBound z_compressBound # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 # define deflate z_deflate # define deflateBound z_deflateBound # define deflateCopy z_deflateCopy # define deflateEnd z_deflateEnd # define deflateInit2_ z_deflateInit2_ # define deflateInit_ z_deflateInit_ # define deflateParams z_deflateParams # define deflatePrime z_deflatePrime # define deflateReset z_deflateReset # define deflateSetDictionary z_deflateSetDictionary # define deflateSetHeader z_deflateSetHeader # define deflateTune z_deflateTune # define deflate_copyright z_deflate_copyright # define get_crc_table z_get_crc_table # define gz_error z_gz_error # define gz_intmax z_gz_intmax # define gz_strwinerror z_gz_strwinerror # define gzbuffer z_gzbuffer # define gzclearerr z_gzclearerr # define gzclose z_gzclose # define gzclose_r z_gzclose_r # define gzclose_w z_gzclose_w # define gzdirect z_gzdirect # define gzdopen z_gzdopen # define gzeof z_gzeof # define gzerror z_gzerror # define gzflush z_gzflush # define gzgetc z_gzgetc # define gzgets z_gzgets # define gzoffset z_gzoffset # define gzoffset64 z_gzoffset64 # define gzopen z_gzopen # define gzopen64 z_gzopen64 # define gzprintf z_gzprintf # define gzputc z_gzputc # define gzputs z_gzputs # define gzread z_gzread # define gzrewind z_gzrewind # define gzseek z_gzseek # define gzseek64 z_gzseek64 # define gzsetparams z_gzsetparams # define gztell z_gztell # define gztell64 z_gztell64 # define gzungetc z_gzungetc # define gzwrite z_gzwrite # define inflate z_inflate # define inflateBack z_inflateBack # define inflateBackEnd z_inflateBackEnd # define inflateBackInit_ z_inflateBackInit_ # define inflateCopy z_inflateCopy # define inflateEnd z_inflateEnd # define inflateGetHeader z_inflateGetHeader # define inflateInit2_ z_inflateInit2_ # define inflateInit_ z_inflateInit_ # define inflateMark z_inflateMark # define inflatePrime z_inflatePrime # define inflateReset z_inflateReset # define inflateReset2 z_inflateReset2 # define inflateSetDictionary z_inflateSetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateUndermine z_inflateUndermine # define inflate_copyright z_inflate_copyright # define inflate_fast z_inflate_fast # define inflate_table z_inflate_table # define uncompress z_uncompress # define zError z_zError # define zcalloc z_zcalloc # define zcfree z_zcfree # define zlibCompileFlags z_zlibCompileFlags # define zlibVersion z_zlibVersion /* all zlib typedefs in zlib.h and zconf.h */ # define Byte z_Byte # define Bytef z_Bytef # define alloc_func z_alloc_func # define charf z_charf # define free_func z_free_func # define gzFile z_gzFile # define gz_header z_gz_header # define gz_headerp z_gz_headerp # define in_func z_in_func # define intf z_intf # define out_func z_out_func # define uInt z_uInt # define uIntf z_uIntf # define uLong z_uLong # define uLongf z_uLongf # define voidp z_voidp # define voidpc z_voidpc # define voidpf z_voidpf /* all zlib structs in zlib.h and zconf.h */ # define gz_header_s z_gz_header_s # define internal_state z_internal_state #endif #if defined(__MSDOS__) && !defined(MSDOS) # define MSDOS #endif #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) # define OS2 #endif #if defined(_WINDOWS) && !defined(WINDOWS) # define WINDOWS #endif #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) # ifndef WIN32 # define WIN32 # endif #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) # ifndef SYS16BIT # define SYS16BIT # endif # endif #endif /* * Compile with -DMAXSEG_64K if the alloc function cannot allocate more * than 64k bytes at a time (needed on systems with 16-bit int). */ #ifdef SYS16BIT # define MAXSEG_64K #endif #ifdef MSDOS # define UNALIGNED_OK #endif #ifdef __STDC_VERSION__ # ifndef STDC # define STDC # endif # if __STDC_VERSION__ >= 199901L # ifndef STDC99 # define STDC99 # endif # endif #endif #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) # define STDC #endif #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) # define STDC #endif #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) # define STDC #endif #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) # define STDC #endif #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ # define STDC #endif #ifndef STDC # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ # define const /* note: need a more gentle solution here */ # endif #endif /* Some Mac compilers merge all .h files incorrectly: */ #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) # define NO_DUMMY_DECL #endif /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL # ifdef MAXSEG_64K # define MAX_MEM_LEVEL 8 # else # define MAX_MEM_LEVEL 9 # endif #endif /* Maximum value for windowBits in deflateInit2 and inflateInit2. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files * created by gzip. (Files created by minigzip can still be extracted by * gzip.) */ #ifndef MAX_WBITS # define MAX_WBITS 15 /* 32K LZ77 window */ #endif /* The memory requirements for deflate are (in bytes): (1 << (windowBits+2)) + (1 << (memLevel+9)) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) plus a few kilobytes for small objects. For example, if you want to reduce the default memory requirements from 256K to 128K, compile with make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits that is, 32K for windowBits=15 (default value) plus a few kilobytes for small objects. */ /* Type declarations */ #ifndef OF /* function prototypes */ # ifdef STDC # define OF(args) args # else # define OF(args) () # endif #endif /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, * just define FAR to be empty. */ #ifdef SYS16BIT # if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */ # define SMALL_MEDIUM # ifdef _MSC_VER # define FAR _far # else # define FAR far # endif # endif # if (defined(__SMALL__) || defined(__MEDIUM__)) /* Turbo C small or medium model */ # define SMALL_MEDIUM # ifdef __BORLANDC__ # define FAR _far # else # define FAR far # endif # endif #endif #if defined(WINDOWS) || defined(WIN32) /* If building or using zlib as a DLL, define ZLIB_DLL. * This is not mandatory, but it offers a little performance increase. */ # ifdef ZLIB_DLL # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) # ifdef ZLIB_INTERNAL # define ZEXTERN extern __declspec(dllexport) # else # define ZEXTERN extern __declspec(dllimport) # endif # endif # endif /* ZLIB_DLL */ /* If building or using zlib with the WINAPI/WINAPIV calling convention, * define ZLIB_WINAPI. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. */ # ifdef ZLIB_WINAPI # ifdef FAR # undef FAR # endif # include <windows.h> /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ # define ZEXPORT WINAPI # ifdef WIN32 # define ZEXPORTVA WINAPIV # else # define ZEXPORTVA FAR CDECL # endif # endif #endif #if defined (__BEOS__) # ifdef ZLIB_DLL # ifdef ZLIB_INTERNAL # define ZEXPORT __declspec(dllexport) # define ZEXPORTVA __declspec(dllexport) # else # define ZEXPORT __declspec(dllimport) # define ZEXPORTVA __declspec(dllimport) # endif # endif #endif #ifndef ZEXTERN # define ZEXTERN extern #endif #ifndef ZEXPORT # define ZEXPORT #endif #ifndef ZEXPORTVA # define ZEXPORTVA #endif #ifndef FAR # define FAR #endif #if !defined(__MACTYPES__) typedef unsigned char Byte; /* 8 bits */ #endif typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ #ifdef SMALL_MEDIUM /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ # define Bytef Byte FAR #else typedef Byte FAR Bytef; #endif typedef char FAR charf; typedef int FAR intf; typedef uInt FAR uIntf; typedef uLong FAR uLongf; #ifdef STDC typedef void const *voidpc; typedef void FAR *voidpf; typedef void *voidp; #else typedef Byte const *voidpc; typedef Byte FAR *voidpf; typedef Byte *voidp; #endif #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ # define Z_HAVE_UNISTD_H #endif #ifdef STDC # include <sys/types.h> /* for off_t */ #endif /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even * though the former does not conform to the LFS document), but considering * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as * equivalently requesting no 64-bit operations */ #if -_LARGEFILE64_SOURCE - -1 == 1 # undef _LARGEFILE64_SOURCE #endif #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) # include <unistd.h> /* for SEEK_* and off_t */ # ifdef VMS # include <unixio.h> /* for off_t */ # endif # ifndef z_off_t # define z_off_t off_t # endif #endif #ifndef SEEK_SET # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif #ifndef z_off_t # define z_off_t long #endif #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 # define z_off64_t off64_t #else # define z_off64_t z_off_t #endif #if defined(__OS400__) # define NO_vsnprintf #endif #if defined(__MVS__) # define NO_vsnprintf #endif /* MVS linker does not support external names larger than 8 bytes */ #if defined(__MVS__) #pragma map(deflateInit_,"DEIN") #pragma map(deflateInit2_,"DEIN2") #pragma map(deflateEnd,"DEEND") #pragma map(deflateBound,"DEBND") #pragma map(inflateInit_,"ININ") #pragma map(inflateInit2_,"ININ2") #pragma map(inflateEnd,"INEND") #pragma map(inflateSync,"INSY") #pragma map(inflateSetDictionary,"INSEDI") #pragma map(compressBound,"CMBND") #pragma map(inflate_table,"INTABL") #pragma map(inflate_fast,"INFA") #pragma map(inflate_copyright,"INCOPY") #endif #endif /* ZCONF_H */
{ "pile_set_name": "Github" }
using System; using Composite.Plugins.Forms.WebChannel.UiControlFactories; namespace CompositeFunctionCallsDesigner { public partial class FunctionCallsDesigner : FunctionCallsDesignerTemplateUserControlBase { public override string SessionStateProvider { get { return ViewState["SessionStateProvider"] as string; } set { ViewState["SessionStateProvider"] = value; } } public override Guid SessionStateId { get { return (Guid)ViewState["SessionStateId"]; } set { ViewState["SessionStateId"] = value; } } public bool HasBasic { get; set; } } }
{ "pile_set_name": "Github" }
// Copyright (c) 2007-09 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org). // // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Laurent Saboret and Nader Salman and Pierre Alliez #ifndef CGAL_REMOVE_OUTLIERS_H #define CGAL_REMOVE_OUTLIERS_H #include <CGAL/license/Point_set_processing_3.h> #include <CGAL/disable_warnings.h> #include <CGAL/Point_set_processing_3/internal/Neighbor_query.h> #include <CGAL/Point_set_processing_3/internal/Callback_wrapper.h> #include <CGAL/for_each.h> #include <CGAL/property_map.h> #include <CGAL/point_set_processing_assertions.h> #include <functional> #include <CGAL/boost/graph/Named_function_parameters.h> #include <CGAL/boost/graph/named_params_helper.h> #include <boost/iterator/zip_iterator.hpp> #include <iterator> #include <algorithm> #include <map> namespace CGAL { // ---------------------------------------------------------------------------- // Private section // ---------------------------------------------------------------------------- /// \cond SKIP_IN_MANUAL namespace internal { /// Utility function for remove_outliers(): /// Computes average squared distance to the K nearest neighbors. /// /// \pre `k >= 2` /// /// @tparam Kernel Geometric traits class. /// @tparam Tree KD-tree. /// /// @return computed distance. template <typename NeighborQuery> typename NeighborQuery::Kernel::FT compute_avg_knn_sq_distance_3( const typename NeighborQuery::Kernel::Point_3& query, ///< 3D point to project NeighborQuery& neighbor_query, ///< KD-tree unsigned int k, ///< number of neighbors typename NeighborQuery::Kernel::FT neighbor_radius) { // geometric types typedef typename NeighborQuery::Kernel Kernel; typedef typename Kernel::FT FT; typedef typename Kernel::Point_3 Point; std::vector<Point> points; neighbor_query.get_points (query, k, neighbor_radius, std::back_inserter(points)); // compute average squared distance typename Kernel::Compute_squared_distance_3 sqd; FT sq_distance = (FT)0.0; for(typename std::vector<Point>::iterator neighbor = points.begin(); neighbor != points.end(); neighbor++) sq_distance += sqd(*neighbor, query); sq_distance /= FT(points.size()); return sq_distance; } } /* namespace internal */ /// \endcond // ---------------------------------------------------------------------------- // Public section // ---------------------------------------------------------------------------- /** \ingroup PkgPointSetProcessing3Algorithms Removes outliers: - computes average squared distance to the nearest neighbors, - and partitions the points either using a threshold on the of average distance or selecting a fixed percentage of points with the highest average distances This method modifies the order of input points so as to pack all remaining points first, and returns an iterator over the first point to remove (see erase-remove idiom). For this reason it should not be called on sorted containers. \pre `k >= 2` \tparam ConcurrencyTag enables sequential versus parallel algorithm. Possible values are `Sequential_tag`, `Parallel_tag`, and `Parallel_if_available_tag`. \tparam PointRange is a model of `Range`. The value type of its iterator is the key type of the named parameter `point_map`. \param points input point range. \param k number of neighbors \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below \cgalNamedParamsBegin \cgalParamNBegin{point_map} \cgalParamDescription{a property map associating points to the elements of the point set `points`} \cgalParamType{a model of `ReadablePropertyMap` whose key type is the value type of the iterator of `PointRange` and whose value type is `geom_traits::Point_3`} \cgalParamDefault{`CGAL::Identity_property_map<geom_traits::Point_3>`} \cgalParamNEnd \cgalParamNBegin{neighbor_radius} \cgalParamDescription{the spherical neighborhood radius} \cgalParamType{floating scalar value} \cgalParamDefault{`0` (no limit)} \cgalParamExtra{If provided, the neighborhood of a query point is computed with a fixed spherical radius instead of a fixed number of neighbors. In that case, the parameter `k` is used as a limit on the number of points returned by each spherical query (to avoid overly large number of points in high density areas).} \cgalParamNEnd \cgalParamNBegin{threshold_percent} \cgalParamDescription{the maximum percentage of points to remove} \cgalParamType{double} \cgalParamDefault{`10`} \cgalParamNEnd \cgalParamNBegin{threshold_distance} \cgalParamDescription{the minimum distance for a point to be considered as outlier} \cgalParamType{double} \cgalParamDefault{`0`} \cgalParamExtra{Distance here is the square root of the average squared distance to K-nearest neighbors} \cgalParamNEnd \cgalParamNBegin{callback} \cgalParamDescription{a mechanism to get feedback on the advancement of the algorithm while it's running and to interrupt it if needed} \cgalParamType{an instance of `std::function<bool(double)>`.} \cgalParamDefault{unused} \cgalParamExtra{It is called regularly when the algorithm is running: the current advancement (between 0. and 1.) is passed as parameter. If it returns `true`, then the algorithm continues its execution normally; if it returns `false`, the algorithm is stopped, all points are left unchanged and the function return `points.size()`.} \cgalParamExtra{The callback will be copied and therefore needs to be lightweight.} \cgalParamNEnd \cgalParamNBegin{geom_traits} \cgalParamDescription{an instance of a geometric traits class} \cgalParamType{a model of `Kernel`} \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} \cgalParamNEnd\cgalNamedParamsEnd \return iterator over the first point to remove. \note There are two thresholds that can be used: `threshold_percent` and `threshold_distance`. This function returns the smallest number of outliers such that at least one of these threshold is fulfilled. This means that if `threshold_percent=100`, only `threshold_distance` is taken into account; if `threshold_distance=0` only `threshold_percent` is taken into account. */ template <typename ConcurrencyTag, typename PointRange, typename NamedParameters > typename PointRange::iterator remove_outliers( PointRange& points, unsigned int k, const NamedParameters& np) { using parameters::choose_parameter; using parameters::get_parameter; // geometric types typedef typename CGAL::GetPointMap<PointRange, NamedParameters>::type PointMap; typedef typename Point_set_processing_3::GetK<PointRange, NamedParameters>::Kernel Kernel; PointMap point_map = choose_parameter<PointMap>(get_parameter(np, internal_np::point_map)); typename Kernel::FT neighbor_radius = choose_parameter(get_parameter(np, internal_np::neighbor_radius), typename Kernel::FT(0)); double threshold_percent = choose_parameter(get_parameter(np, internal_np::threshold_percent), 10.); double threshold_distance = choose_parameter(get_parameter(np, internal_np::threshold_distance), 0.); const std::function<bool(double)>& callback = choose_parameter(get_parameter(np, internal_np::callback), std::function<bool(double)>()); typedef typename Kernel::FT FT; // basic geometric types typedef typename PointRange::iterator iterator; typedef typename iterator::value_type value_type; // types for K nearest neighbors search structure typedef Point_set_processing_3::internal::Neighbor_query<Kernel, PointRange&, PointMap> Neighbor_query; // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check CGAL_point_set_processing_precondition(points.begin() != points.end()); // precondition: at least 2 nearest neighbors CGAL_point_set_processing_precondition(k >= 2); CGAL_point_set_processing_precondition(threshold_percent >= 0 && threshold_percent <= 100); Neighbor_query neighbor_query (points, point_map); std::size_t nb_points = points.size(); // iterate over input points and add them to multimap sorted by distance to k std::vector<std::pair<FT, value_type> > sorted_points; sorted_points.reserve (nb_points); for (const value_type& p : points) sorted_points.push_back(std::make_pair (FT(0), p)); Point_set_processing_3::internal::Callback_wrapper<ConcurrencyTag> callback_wrapper (callback, nb_points); CGAL::for_each<ConcurrencyTag> (sorted_points, [&](std::pair<FT, value_type>& p) -> bool { if (callback_wrapper.interrupted()) return false; p.first = internal::compute_avg_knn_sq_distance_3( get(point_map, p.second), neighbor_query, k, neighbor_radius); ++ callback_wrapper.advancement(); return true; }); std::size_t first_index_to_remove = std::size_t(double(sorted_points.size()) * ((100.0-threshold_percent)/100.0)); typename std::vector<std::pair<FT, value_type> >::iterator f2r = sorted_points.begin(); if (threshold_distance != FT(0)) f2r = std::partition (sorted_points.begin(), sorted_points.end(), [&threshold_distance](const std::pair<FT, value_type>& p) -> bool { return p.first < threshold_distance * threshold_distance; }); if (static_cast<std::size_t>(std::distance (sorted_points.begin(), f2r)) < first_index_to_remove) { std::nth_element (f2r, sorted_points.begin() + first_index_to_remove, sorted_points.end()); f2r = sorted_points.begin() + first_index_to_remove; } // Replaces [points.begin(), points.end()) range by the sorted content. iterator pit = points.begin(); iterator out = points.begin(); for (auto sit = sorted_points.begin(); sit != sorted_points.end(); ++ sit) { *pit = sit->second; if (sit == f2r) out = pit; ++ pit; } callback_wrapper.join(); // Returns the iterator on the first point to remove return out; } /// \cond SKIP_IN_MANUAL // variant with default NP template <typename ConcurrencyTag, typename PointRange> typename PointRange::iterator remove_outliers( PointRange& points, unsigned int k) ///< number of neighbors. { return remove_outliers<ConcurrencyTag> (points, k, CGAL::Point_set_processing_3::parameters::all_default(points)); } /// \endcond } //namespace CGAL #include <CGAL/enable_warnings.h> #endif // CGAL_REMOVE_OUTLIERS_H
{ "pile_set_name": "Github" }
##### Python Requirements See requirements.txt [Optional]: Install [pyflann](https://github.com/nashory/pyflann) to get first neighbours from Kd-tree for large data ## Usage: Run from command line by providing path to csv data files ``` python3 finch.py --data-path [Your-path-to-data-csv] --output-path [path-to-write-the result] ``` or typically you would run: ``` from finch import FINCH c, num_clust, req_c = FINCH(data) ``` You can set options e.g., required number of cluster [optional] or distance etc, ``` c, num_clust, req_c = FINCH(data, initial_rank=None, req_clust=None, distance='cosine', ensure_early_exit=False, verbose=True) ``` Input: * data: numpy array (feature vectors in rows) * [OPTIONAL] * req_c: specify required number of cluster * distance: One of ['cityblock', 'cosine', 'euclidean', 'l1', 'l2', 'manhattan'] Recommended: 'cosine (default)' and 'euclidean (for 2D toy data)' * initial_rank: Nx1 vector of 1-neighbour indices * ensure_early_exit: (default: True) if set it may help for Unbalanced or large datasets, ensure purity of merges and helps early exit * verbos : for printing some output Output: * c: N x P array, each column vector contains cluster labels for each partition P * num_clust: shows total number of cluster in each partition P * req_c: Labels of required clusters (Nx1). Only set if `req_clust` is not None.
{ "pile_set_name": "Github" }
// Copyright Aleksey Gurtovoy 2000-2004 // Copyright Jaap Suter 2003 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // *Preprocessed* version of the main "bitand.hpp" header // -- DO NOT modify by hand! namespace boost { namespace mpl { template< typename Tag1 , typename Tag2 > struct bitand_impl : if_c< ( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1) > BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2) ) , aux::cast2nd_impl< bitand_impl< Tag1,Tag1 >,Tag1, Tag2 > , aux::cast1st_impl< bitand_impl< Tag2,Tag2 >,Tag1, Tag2 > >::type { }; /// for Digital Mars C++/compilers with no CTPS/TTP support template<> struct bitand_impl< na,na > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template< typename Tag > struct bitand_impl< na,Tag > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template< typename Tag > struct bitand_impl< Tag,na > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template< typename T > struct bitand_tag { typedef typename T::tag type; }; template< typename BOOST_MPL_AUX_NA_PARAM(N1) , typename BOOST_MPL_AUX_NA_PARAM(N2) , typename N3 = na, typename N4 = na, typename N5 = na > struct bitand_ : bitand_< bitand_< bitand_< bitand_< N1,N2 >, N3>, N4>, N5> { BOOST_MPL_AUX_LAMBDA_SUPPORT( 5 , bitand_ , ( N1, N2, N3, N4, N5 ) ) }; template< typename N1, typename N2, typename N3, typename N4 > struct bitand_< N1,N2,N3,N4,na > : bitand_< bitand_< bitand_< N1,N2 >, N3>, N4> { BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC( 5 , bitand_ , ( N1, N2, N3, N4, na ) ) }; template< typename N1, typename N2, typename N3 > struct bitand_< N1,N2,N3,na,na > : bitand_< bitand_< N1,N2 >, N3> { BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC( 5 , bitand_ , ( N1, N2, N3, na, na ) ) }; template< typename N1, typename N2 > struct bitand_< N1,N2,na,na,na > : bitand_impl< typename bitand_tag<N1>::type , typename bitand_tag<N2>::type >::template apply< N1,N2 >::type { BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC( 5 , bitand_ , ( N1, N2, na, na, na ) ) }; BOOST_MPL_AUX_NA_SPEC2(2, 5, bitand_) }} namespace boost { namespace mpl { template<> struct bitand_impl< integral_c_tag,integral_c_tag > { template< typename N1, typename N2 > struct apply : integral_c< typename aux::largest_int< typename N1::value_type , typename N2::value_type >::type , ( BOOST_MPL_AUX_VALUE_WKND(N1)::value & BOOST_MPL_AUX_VALUE_WKND(N2)::value ) > { }; }; }}
{ "pile_set_name": "Github" }
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -primary-file %s -O -module-name=test -disable-llvm-optzns -emit-ir | %FileCheck %s enum NoPayload { case E0 case E1 case E2 case E3 } // Check if the code of a select_num is a simple int cast and not a switch. // CHECK-LABEL: define {{.*}}selectDirect // CHECK: %1 = zext i8 %0 to i32 // CHECK: ret i32 %1 @inline(never) func selectDirect(e: NoPayload) -> Int32 { switch e { case .E0: return 0 case .E1: return 1 case .E2: return 2 case .E3: return 3 } } // CHECK-LABEL: define {{.*}}selectNegOffset // CHECK: %1 = zext i8 %0 to i32 // CHECK: %2 = add i32 %1, -6 // CHECK: ret i32 %2 @inline(never) func selectNegOffset(e: NoPayload) -> Int32 { switch e { case .E0: return -6 case .E1: return -5 case .E2: return -4 case .E3: return -3 } } // CHECK-LABEL: define {{.*}}selectPosOffset // CHECK: %1 = zext i8 %0 to i32 // CHECK: %2 = add i32 %1, 3 // CHECK: ret i32 %2 @inline(never) func selectPosOffset(e: NoPayload) -> Int32 { switch e { case .E0: return 3 case .E1: return 4 case .E2: return 5 case .E3: return 6 } } // Following functions contain select_enums, which cannot be generated as a // simple conversion. // CHECK-LABEL: define {{.*}}selectWithDefault // CHECK: switch i8 // CHECK: ret @inline(never) func selectWithDefault(e: NoPayload) -> Int32 { switch e { case .E0: return 0 case .E1: return 1 default: return 2 } } // CHECK-LABEL: define {{.*}}selectNonContiguous // CHECK: switch i8 // CHECK: ret @inline(never) func selectNonContiguous(e: NoPayload) -> Int32 { switch e { case .E0: return 0 case .E1: return 1 case .E2: return 3 case .E3: return 4 } } var gg : Int32 = 10 // CHECK-LABEL: define {{.*}}selectNonConstant // CHECK: switch i8 // CHECK: ret @inline(never) func selectNonConstant(e: NoPayload) -> Int32 { switch e { case .E0: return 0 case .E1: return 1 case .E2: return gg case .E3: return 4 } } // CHECK-LABEL: define {{.*}}selectTuple // CHECK: switch i8 // CHECK: ret @inline(never) func selectTuple(e: NoPayload) -> (Int32, Int32) { switch e { case .E0: return (0, 1) case .E1: return (1, 2) case .E2: return (2, 3) case .E3: return (3, 4) } } // CHECK-LABEL: define {{.*}}selectNonInt // CHECK: switch i8 // CHECK: ret @inline(never) func selectNonInt(e: NoPayload) -> String { switch e { case .E0: return "a" case .E1: return "ab" case .E2: return "abc" case .E3: return "abcd" } }
{ "pile_set_name": "Github" }
/* * Copyright 2005 Sun Microsystems, Inc. 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. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ package sun.awt.event; import java.awt.Component; import java.awt.Rectangle; import java.awt.event.PaintEvent; /** * PaintEvents that are effectively ignored. This class is used only for * tagging. If a heavy weight peer is asked to handle an event of this * class it'll ignore it. This class is used by Swing. * Look at <code>javax.swing.SwingPaintEventDispatcher</code> for more. * */ public class IgnorePaintEvent extends PaintEvent { public IgnorePaintEvent(Component source, int id, Rectangle updateRect) { super(source, id, updateRect); } }
{ "pile_set_name": "Github" }
var convert = require('./convert'), func = convert('sortBy', require('../sortBy')); func.placeholder = require('./placeholder'); module.exports = func;
{ "pile_set_name": "Github" }
using System; using System.IO; using System.Text; using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Utilities; using Org.BouncyCastle.X509; namespace Org.BouncyCastle.Pkix { /// <summary> /// A trust anchor or most-trusted Certification Authority (CA). /// /// This class represents a "most-trusted CA", which is used as a trust anchor /// for validating X.509 certification paths. A most-trusted CA includes the /// public key of the CA, the CA's name, and any constraints upon the set of /// paths which may be validated using this key. These parameters can be /// specified in the form of a trusted X509Certificate or as individual /// parameters. /// </summary> public class TrustAnchor { private readonly AsymmetricKeyParameter pubKey; private readonly string caName; private readonly X509Name caPrincipal; private readonly X509Certificate trustedCert; private byte[] ncBytes; private NameConstraints nc; /// <summary> /// Creates an instance of TrustAnchor with the specified X509Certificate and /// optional name constraints, which are intended to be used as additional /// constraints when validating an X.509 certification path. /// The name constraints are specified as a byte array. This byte array /// should contain the DER encoded form of the name constraints, as they /// would appear in the NameConstraints structure defined in RFC 2459 and /// X.509. The ASN.1 definition of this structure appears below. /// /// <pre> /// NameConstraints ::= SEQUENCE { /// permittedSubtrees [0] GeneralSubtrees OPTIONAL, /// excludedSubtrees [1] GeneralSubtrees OPTIONAL } /// /// GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree /// /// GeneralSubtree ::= SEQUENCE { /// base GeneralName, /// minimum [0] BaseDistance DEFAULT 0, /// maximum [1] BaseDistance OPTIONAL } /// /// BaseDistance ::= INTEGER (0..MAX) /// /// GeneralName ::= CHOICE { /// otherName [0] OtherName, /// rfc822Name [1] IA5String, /// dNSName [2] IA5String, /// x400Address [3] ORAddress, /// directoryName [4] Name, /// ediPartyName [5] EDIPartyName, /// uniformResourceIdentifier [6] IA5String, /// iPAddress [7] OCTET STRING, /// registeredID [8] OBJECT IDENTIFIER} /// </pre> /// /// Note that the name constraints byte array supplied is cloned to protect /// against subsequent modifications. /// </summary> /// <param name="trustedCert">a trusted X509Certificate</param> /// <param name="nameConstraints">a byte array containing the ASN.1 DER encoding of a /// NameConstraints extension to be used for checking name /// constraints. Only the value of the extension is included, not /// the OID or criticality flag. Specify null to omit the /// parameter.</param> /// <exception cref="ArgumentNullException">if the specified X509Certificate is null</exception> public TrustAnchor( X509Certificate trustedCert, byte[] nameConstraints) { if (trustedCert == null) throw new ArgumentNullException("trustedCert"); this.trustedCert = trustedCert; this.pubKey = null; this.caName = null; this.caPrincipal = null; setNameConstraints(nameConstraints); } /// <summary> /// Creates an instance of <c>TrustAnchor</c> where the /// most-trusted CA is specified as an X500Principal and public key. /// </summary> /// <remarks> /// <p> /// Name constraints are an optional parameter, and are intended to be used /// as additional constraints when validating an X.509 certification path. /// </p><p> /// The name constraints are specified as a byte array. This byte array /// contains the DER encoded form of the name constraints, as they /// would appear in the NameConstraints structure defined in RFC 2459 /// and X.509. The ASN.1 notation for this structure is supplied in the /// documentation for the other constructors. /// </p><p> /// Note that the name constraints byte array supplied here is cloned to /// protect against subsequent modifications. /// </p> /// </remarks> /// <param name="caPrincipal">the name of the most-trusted CA as X509Name</param> /// <param name="pubKey">the public key of the most-trusted CA</param> /// <param name="nameConstraints"> /// a byte array containing the ASN.1 DER encoding of a NameConstraints extension to /// be used for checking name constraints. Only the value of the extension is included, /// not the OID or criticality flag. Specify <c>null</c> to omit the parameter. /// </param> /// <exception cref="ArgumentNullException"> /// if <c>caPrincipal</c> or <c>pubKey</c> is null /// </exception> public TrustAnchor( X509Name caPrincipal, AsymmetricKeyParameter pubKey, byte[] nameConstraints) { if (caPrincipal == null) throw new ArgumentNullException("caPrincipal"); if (pubKey == null) throw new ArgumentNullException("pubKey"); this.trustedCert = null; this.caPrincipal = caPrincipal; this.caName = caPrincipal.ToString(); this.pubKey = pubKey; setNameConstraints(nameConstraints); } /// <summary> /// Creates an instance of <code>TrustAnchor</code> where the most-trusted /// CA is specified as a distinguished name and public key. Name constraints /// are an optional parameter, and are intended to be used as additional /// constraints when validating an X.509 certification path. /// <br/> /// The name constraints are specified as a byte array. This byte array /// contains the DER encoded form of the name constraints, as they would /// appear in the NameConstraints structure defined in RFC 2459 and X.509. /// </summary> /// <param name="caName">the X.500 distinguished name of the most-trusted CA in RFC /// 2253 string format</param> /// <param name="pubKey">the public key of the most-trusted CA</param> /// <param name="nameConstraints">a byte array containing the ASN.1 DER encoding of a /// NameConstraints extension to be used for checking name /// constraints. Only the value of the extension is included, not /// the OID or criticality flag. Specify null to omit the /// parameter.</param> /// throws NullPointerException, IllegalArgumentException public TrustAnchor( string caName, AsymmetricKeyParameter pubKey, byte[] nameConstraints) { if (caName == null) throw new ArgumentNullException("caName"); if (pubKey == null) throw new ArgumentNullException("pubKey"); if (caName.Length == 0) throw new ArgumentException("caName can not be an empty string"); this.caPrincipal = new X509Name(caName); this.pubKey = pubKey; this.caName = caName; this.trustedCert = null; setNameConstraints(nameConstraints); } /// <summary> /// Returns the most-trusted CA certificate. /// </summary> public X509Certificate TrustedCert { get { return this.trustedCert; } } /// <summary> /// Returns the name of the most-trusted CA as an X509Name. /// </summary> public X509Name CA { get { return this.caPrincipal; } } /// <summary> /// Returns the name of the most-trusted CA in RFC 2253 string format. /// </summary> public string CAName { get { return this.caName; } } /// <summary> /// Returns the public key of the most-trusted CA. /// </summary> public AsymmetricKeyParameter CAPublicKey { get { return this.pubKey; } } /// <summary> /// Decode the name constraints and clone them if not null. /// </summary> private void setNameConstraints( byte[] bytes) { if (bytes == null) { ncBytes = null; nc = null; } else { ncBytes = (byte[]) bytes.Clone(); // validate DER encoding //nc = new NameConstraintsExtension(Boolean.FALSE, bytes); nc = NameConstraints.GetInstance(Asn1Object.FromByteArray(bytes)); } } public byte[] GetNameConstraints { get { return Arrays.Clone(ncBytes); } } /// <summary> /// Returns a formatted string describing the <code>TrustAnchor</code>. /// </summary> /// <returns>a formatted string describing the <code>TrustAnchor</code></returns> public override string ToString() { // TODO Some of the sub-objects might not implement ToString() properly string nl = Platform.NewLine; StringBuilder sb = new StringBuilder(); sb.Append("["); sb.Append(nl); if (this.pubKey != null) { sb.Append(" Trusted CA Public Key: ").Append(this.pubKey).Append(nl); sb.Append(" Trusted CA Issuer Name: ").Append(this.caName).Append(nl); } else { sb.Append(" Trusted CA cert: ").Append(this.TrustedCert).Append(nl); } if (nc != null) { sb.Append(" Name Constraints: ").Append(nc).Append(nl); } return sb.ToString(); } } }
{ "pile_set_name": "Github" }
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?attr/colorControlNormal"> <path android:fillColor="@android:color/white" android:pathData="M21,1L7,1c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L23,3c0,-1.1 -0.9,-2 -2,-2zM21,17L7,17L7,3h14v14zM3,5L1,5v16c0,1.1 0.9,2 2,2h16v-2L3,21L3,5zM17,13v-2c0,-1.11 -0.9,-2 -2,-2h-2L13,7h4L17,5h-6v6h4v2h-4v2h4c1.1,0 2,-0.89 2,-2z"/> </vector>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{ED1C56E6-D78C-4F9A-A2C2-E0622FCF70F8}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>Xamarin.Flex.UnitTests</RootNamespace> <AssemblyName>Xamarin.Flex.UnitTests</AssemblyName> <TargetFrameworkVersion>v4.7</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath> <IsCodedUITest>False</IsCodedUITest> <TestProjectType>UnitTest</TestProjectType> <NuGetPackageImportStamp> </NuGetPackageImportStamp> <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <HintPath>..\packages\MSTest.TestFramework.1.2.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath> </Reference> <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <HintPath>..\packages\MSTest.TestFramework.1.2.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> </ItemGroup> <ItemGroup> <Compile Include="XamarinFlexTests.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> <None Include="packages.config" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Xamarin.Flex\Xamarin.Flex.csproj"> <Project>{e11a8aa2-85c4-4a97-83ae-24329b4a2081}</Project> <Name>Xamarin.Flex</Name> </ProjectReference> </ItemGroup> <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props'))" /> <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets'))" /> </Target> <Import Project="..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets')" /> <Import Project="..\nuget\Desktop\Xamarin.Flex.Debug.targets" /> </Project>
{ "pile_set_name": "Github" }
using Composite.Core.Xml; namespace Composite.Core.Localization { /// <summary> /// </summary> /// <exclude /> [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public static class LocalizationXmlConstants { /// <exclude /> public static string XmlNamespace { get { return Namespaces.Localization10.ToString(); } } } }
{ "pile_set_name": "Github" }
define([ "../core", "../var/support" ], function( jQuery, support ) { (function() { var pixelPositionVal, boxSizingReliableVal, docElem = document.documentElement, container = document.createElement( "div" ), div = document.createElement( "div" ); if ( !div.style ) { return; } // Support: IE9-11+ // Style of cloned element affects source element cloned (#8908) div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" + "position:absolute"; container.appendChild( div ); // Executing both pixelPosition & boxSizingReliable tests require only one layout // so they're executed at the same time to save the second computation. function computePixelPositionAndBoxSizingReliable() { div.style.cssText = // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + "box-sizing:border-box;display:block;margin-top:1%;top:1%;" + "border:1px;padding:1px;width:4px;position:absolute"; div.innerHTML = ""; docElem.appendChild( container ); var divStyle = window.getComputedStyle( div, null ); pixelPositionVal = divStyle.top !== "1%"; boxSizingReliableVal = divStyle.width === "4px"; docElem.removeChild( container ); } // Support: node.js jsdom // Don't assume that getComputedStyle is a property of the global object if ( window.getComputedStyle ) { jQuery.extend( support, { pixelPosition: function() { // This test is executed only once but we still do memoizing // since we can use the boxSizingReliable pre-computing. // No need to check if the test was already performed, though. computePixelPositionAndBoxSizingReliable(); return pixelPositionVal; }, boxSizingReliable: function() { if ( boxSizingReliableVal == null ) { computePixelPositionAndBoxSizingReliable(); } return boxSizingReliableVal; }, reliableMarginRight: function() { // Support: Android 2.3 // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // This support function is only executed once so no memoizing is needed. var ret, marginDiv = div.appendChild( document.createElement( "div" ) ); // Reset CSS: box-sizing; display; margin; border; padding marginDiv.style.cssText = div.style.cssText = // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; docElem.appendChild( container ); ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight ); docElem.removeChild( container ); div.removeChild( marginDiv ); return ret; } }); } })(); return support; });
{ "pile_set_name": "Github" }
CREATE TABLE list (id VARCHAR(10) NOT NULL, value VARCHAR(64) NOT NULL, PRIMARY KEY(id)); INSERT INTO "list" ("id", "value") VALUES ('ARM', 'Argentine Peso (1881–1970)'); INSERT INTO "list" ("id", "value") VALUES ('ARL', 'Argentine Peso Ley (1970–1983)'); INSERT INTO "list" ("id", "value") VALUES ('BOL', 'Bolivian Boliviano (1863–1963)'); INSERT INTO "list" ("id", "value") VALUES ('BAN', 'Bosnia-Herzegovina New Dinar (1994–1997)'); INSERT INTO "list" ("id", "value") VALUES ('BRZ', 'Brazilian Cruzeiro (1942–1967)'); INSERT INTO "list" ("id", "value") VALUES ('BGO', 'Bulgarian Lev (1879–1952)'); INSERT INTO "list" ("id", "value") VALUES ('BGM', 'Bulgarian Socialist Lev'); INSERT INTO "list" ("id", "value") VALUES ('CLE', 'Chilean Escudo'); INSERT INTO "list" ("id", "value") VALUES ('CNX', 'Chinese People’s Bank Dollar'); INSERT INTO "list" ("id", "value") VALUES ('ISJ', 'Icelandic Króna (1918–1981)'); INSERT INTO "list" ("id", "value") VALUES ('ILR', 'Israeli Shekel (1980–1985)'); INSERT INTO "list" ("id", "value") VALUES ('MKN', 'Macedonian Denar (1992–1993)'); INSERT INTO "list" ("id", "value") VALUES ('MVP', 'Maldivian Rupee (1947–1981)'); INSERT INTO "list" ("id", "value") VALUES ('MDC', 'Moldovan Cupon'); INSERT INTO "list" ("id", "value") VALUES ('MCF', 'Monegasque Franc'); INSERT INTO "list" ("id", "value") VALUES ('KRH', 'South Korean Hwan (1953–1962)'); INSERT INTO "list" ("id", "value") VALUES ('KRO', 'South Korean Won (1945–1953)'); INSERT INTO "list" ("id", "value") VALUES ('VNN', 'Vietnamese Dong (1978–1985)'); INSERT INTO "list" ("id", "value") VALUES ('YUR', 'Yugoslavian Reformed Dinar (1992–1993)'); INSERT INTO "list" ("id", "value") VALUES ('AFA', 'afghani (1927–2002)'); INSERT INTO "list" ("id", "value") VALUES ('AFN', 'afghani afghan'); INSERT INTO "list" ("id", "value") VALUES ('ROL', 'ancien leu roumain'); INSERT INTO "list" ("id", "value") VALUES ('MGA', 'ariary malgache'); INSERT INTO "list" ("id", "value") VALUES ('ARA', 'austral argentin'); INSERT INTO "list" ("id", "value") VALUES ('THB', 'baht thaïlandais'); INSERT INTO "list" ("id", "value") VALUES ('PAB', 'balboa panaméen'); INSERT INTO "list" ("id", "value") VALUES ('ETB', 'birr éthiopien'); INSERT INTO "list" ("id", "value") VALUES ('VEF', 'bolivar vénézuélien'); INSERT INTO "list" ("id", "value") VALUES ('VEB', 'bolivar vénézuélien (1871–2008)'); INSERT INTO "list" ("id", "value") VALUES ('BOB', 'boliviano bolivien'); INSERT INTO "list" ("id", "value") VALUES ('CRC', 'colón costaricain'); INSERT INTO "list" ("id", "value") VALUES ('SVC', 'colón salvadorien'); INSERT INTO "list" ("id", "value") VALUES ('NIC', 'cordoba'); INSERT INTO "list" ("id", "value") VALUES ('GEK', 'coupon de lari géorgien'); INSERT INTO "list" ("id", "value") VALUES ('DKK', 'couronne danoise'); INSERT INTO "list" ("id", "value") VALUES ('EEK', 'couronne estonienne'); INSERT INTO "list" ("id", "value") VALUES ('CSK', 'couronne forte tchécoslovaque'); INSERT INTO "list" ("id", "value") VALUES ('ISK', 'couronne islandaise'); INSERT INTO "list" ("id", "value") VALUES ('NOK', 'couronne norvégienne'); INSERT INTO "list" ("id", "value") VALUES ('SKK', 'couronne slovaque'); INSERT INTO "list" ("id", "value") VALUES ('SEK', 'couronne suédoise'); INSERT INTO "list" ("id", "value") VALUES ('CZK', 'couronne tchèque'); INSERT INTO "list" ("id", "value") VALUES ('BRC', 'cruzado brésilien (1986–1989)'); INSERT INTO "list" ("id", "value") VALUES ('BRR', 'cruzeiro'); INSERT INTO "list" ("id", "value") VALUES ('BRE', 'cruzeiro brésilien (1990–1993)'); INSERT INTO "list" ("id", "value") VALUES ('GHC', 'cédi'); INSERT INTO "list" ("id", "value") VALUES ('GHS', 'cédi ghanéen'); INSERT INTO "list" ("id", "value") VALUES ('NIO', 'córdoba oro nicaraguayen'); INSERT INTO "list" ("id", "value") VALUES ('GMD', 'dalasi gambien'); INSERT INTO "list" ("id", "value") VALUES ('MKD', 'denar macédonien'); INSERT INTO "list" ("id", "value") VALUES ('DZD', 'dinar algérien'); INSERT INTO "list" ("id", "value") VALUES ('BHD', 'dinar bahreïni'); INSERT INTO "list" ("id", "value") VALUES ('BAD', 'dinar bosniaque'); INSERT INTO "list" ("id", "value") VALUES ('HRD', 'dinar croate'); INSERT INTO "list" ("id", "value") VALUES ('YDD', 'dinar du Yémen'); INSERT INTO "list" ("id", "value") VALUES ('IQD', 'dinar irakien'); INSERT INTO "list" ("id", "value") VALUES ('JOD', 'dinar jordanien'); INSERT INTO "list" ("id", "value") VALUES ('KWD', 'dinar koweïtien'); INSERT INTO "list" ("id", "value") VALUES ('LYD', 'dinar libyen'); INSERT INTO "list" ("id", "value") VALUES ('RSD', 'dinar serbe'); INSERT INTO "list" ("id", "value") VALUES ('CSD', 'dinar serbo-monténégrin'); INSERT INTO "list" ("id", "value") VALUES ('SDD', 'dinar soudanais'); INSERT INTO "list" ("id", "value") VALUES ('TND', 'dinar tunisien'); INSERT INTO "list" ("id", "value") VALUES ('YUM', 'dinar yougoslave Noviy'); INSERT INTO "list" ("id", "value") VALUES ('YUN', 'dinar yougoslave convertible'); INSERT INTO "list" ("id", "value") VALUES ('AED', 'dirham des Émirats arabes unis'); INSERT INTO "list" ("id", "value") VALUES ('MAD', 'dirham marocain'); INSERT INTO "list" ("id", "value") VALUES ('STD', 'dobra santoméen'); INSERT INTO "list" ("id", "value") VALUES ('AUD', 'dollar australien'); INSERT INTO "list" ("id", "value") VALUES ('BSD', 'dollar bahaméen'); INSERT INTO "list" ("id", "value") VALUES ('BBD', 'dollar barbadien'); INSERT INTO "list" ("id", "value") VALUES ('BMD', 'dollar bermudien'); INSERT INTO "list" ("id", "value") VALUES ('BND', 'dollar brunéien'); INSERT INTO "list" ("id", "value") VALUES ('BZD', 'dollar bélizéen'); INSERT INTO "list" ("id", "value") VALUES ('CAD', 'dollar canadien'); INSERT INTO "list" ("id", "value") VALUES ('HKD', 'dollar de Hong Kong'); INSERT INTO "list" ("id", "value") VALUES ('SGD', 'dollar de Singapour'); INSERT INTO "list" ("id", "value") VALUES ('XCD', 'dollar des Caraïbes orientales'); INSERT INTO "list" ("id", "value") VALUES ('USS', 'dollar des Etats-Unis (jour même)'); INSERT INTO "list" ("id", "value") VALUES ('USN', 'dollar des Etats-Unis (jour suivant)'); INSERT INTO "list" ("id", "value") VALUES ('USD', 'dollar des États-Unis'); INSERT INTO "list" ("id", "value") VALUES ('KYD', 'dollar des îles Caïmans'); INSERT INTO "list" ("id", "value") VALUES ('SBD', 'dollar des îles Salomon'); INSERT INTO "list" ("id", "value") VALUES ('GYD', 'dollar du Guyana'); INSERT INTO "list" ("id", "value") VALUES ('FJD', 'dollar fidjien'); INSERT INTO "list" ("id", "value") VALUES ('JMD', 'dollar jamaïcain'); INSERT INTO "list" ("id", "value") VALUES ('LRD', 'dollar libérien'); INSERT INTO "list" ("id", "value") VALUES ('NAD', 'dollar namibien'); INSERT INTO "list" ("id", "value") VALUES ('NZD', 'dollar néo-zélandais'); INSERT INTO "list" ("id", "value") VALUES ('RHD', 'dollar rhodésien'); INSERT INTO "list" ("id", "value") VALUES ('SRD', 'dollar surinamais'); INSERT INTO "list" ("id", "value") VALUES ('TTD', 'dollar trinidadien'); INSERT INTO "list" ("id", "value") VALUES ('ZWD', 'dollar zimbabwéen'); INSERT INTO "list" ("id", "value") VALUES ('ZWR', 'dollar zimbabwéen (2008)'); INSERT INTO "list" ("id", "value") VALUES ('ZWL', 'dollar zimbabwéen (2009)'); INSERT INTO "list" ("id", "value") VALUES ('GRD', 'drachme grecque'); INSERT INTO "list" ("id", "value") VALUES ('AMD', 'dram arménien'); INSERT INTO "list" ("id", "value") VALUES ('VND', 'dông vietnamien'); INSERT INTO "list" ("id", "value") VALUES ('GQE', 'ekwélé équatoguinéen'); INSERT INTO "list" ("id", "value") VALUES ('CVE', 'escudo capverdien'); INSERT INTO "list" ("id", "value") VALUES ('GWE', 'escudo de Guinée portugaise'); INSERT INTO "list" ("id", "value") VALUES ('MZE', 'escudo mozambicain'); INSERT INTO "list" ("id", "value") VALUES ('PTE', 'escudo portugais'); INSERT INTO "list" ("id", "value") VALUES ('TPE', 'escudo timorais'); INSERT INTO "list" ("id", "value") VALUES ('EUR', 'euro'); INSERT INTO "list" ("id", "value") VALUES ('CHE', 'euro WIR'); INSERT INTO "list" ("id", "value") VALUES ('ANG', 'florin antillais'); INSERT INTO "list" ("id", "value") VALUES ('AWG', 'florin arubais'); INSERT INTO "list" ("id", "value") VALUES ('NLG', 'florin néerlandais'); INSERT INTO "list" ("id", "value") VALUES ('SRG', 'florin surinamais'); INSERT INTO "list" ("id", "value") VALUES ('HUF', 'forint hongrois'); INSERT INTO "list" ("id", "value") VALUES ('XOF', 'franc CFA (BCEAO)'); INSERT INTO "list" ("id", "value") VALUES ('XAF', 'franc CFA (BEAC)'); INSERT INTO "list" ("id", "value") VALUES ('XPF', 'franc CFP'); INSERT INTO "list" ("id", "value") VALUES ('XFU', 'franc UIC'); INSERT INTO "list" ("id", "value") VALUES ('CHW', 'franc WIR'); INSERT INTO "list" ("id", "value") VALUES ('BEF', 'franc belge'); INSERT INTO "list" ("id", "value") VALUES ('BEC', 'franc belge (convertible)'); INSERT INTO "list" ("id", "value") VALUES ('BEL', 'franc belge (financier)'); INSERT INTO "list" ("id", "value") VALUES ('BIF', 'franc burundais'); INSERT INTO "list" ("id", "value") VALUES ('KMF', 'franc comorien'); INSERT INTO "list" ("id", "value") VALUES ('CDF', 'franc congolais'); INSERT INTO "list" ("id", "value") VALUES ('LUC', 'franc convertible luxembourgeois'); INSERT INTO "list" ("id", "value") VALUES ('DJF', 'franc djiboutien'); INSERT INTO "list" ("id", "value") VALUES ('LUL', 'franc financier luxembourgeois'); INSERT INTO "list" ("id", "value") VALUES ('FRF', 'franc français'); INSERT INTO "list" ("id", "value") VALUES ('GNF', 'franc guinéen'); INSERT INTO "list" ("id", "value") VALUES ('LUF', 'franc luxembourgeois'); INSERT INTO "list" ("id", "value") VALUES ('MGF', 'franc malgache'); INSERT INTO "list" ("id", "value") VALUES ('MLF', 'franc malien'); INSERT INTO "list" ("id", "value") VALUES ('MAF', 'franc marocain'); INSERT INTO "list" ("id", "value") VALUES ('XFO', 'franc or'); INSERT INTO "list" ("id", "value") VALUES ('RWF', 'franc rwandais'); INSERT INTO "list" ("id", "value") VALUES ('CHF', 'franc suisse'); INSERT INTO "list" ("id", "value") VALUES ('HTG', 'gourde haïtienne'); INSERT INTO "list" ("id", "value") VALUES ('PYG', 'guaraní paraguayen'); INSERT INTO "list" ("id", "value") VALUES ('UAH', 'hryvnia ukrainienne'); INSERT INTO "list" ("id", "value") VALUES ('PEI', 'inti péruvien'); INSERT INTO "list" ("id", "value") VALUES ('UAK', 'karbovanetz'); INSERT INTO "list" ("id", "value") VALUES ('PGK', 'kina papouan-néo-guinéen'); INSERT INTO "list" ("id", "value") VALUES ('LAK', 'kip loatien'); INSERT INTO "list" ("id", "value") VALUES ('HRK', 'kuna croate'); INSERT INTO "list" ("id", "value") VALUES ('MWK', 'kwacha malawite'); INSERT INTO "list" ("id", "value") VALUES ('ZMW', 'kwacha zambien'); INSERT INTO "list" ("id", "value") VALUES ('ZMK', 'kwacha zambien (1968–2012)'); INSERT INTO "list" ("id", "value") VALUES ('AOA', 'kwanza angolais'); INSERT INTO "list" ("id", "value") VALUES ('AOK', 'kwanza angolais (1977–1990)'); INSERT INTO "list" ("id", "value") VALUES ('AOR', 'kwanza angolais réajusté (1995–1999)'); INSERT INTO "list" ("id", "value") VALUES ('BUK', 'kyat birman'); INSERT INTO "list" ("id", "value") VALUES ('MMK', 'kyat myanmarais'); INSERT INTO "list" ("id", "value") VALUES ('GEL', 'lari géorgien'); INSERT INTO "list" ("id", "value") VALUES ('LVL', 'lats letton'); INSERT INTO "list" ("id", "value") VALUES ('ALL', 'lek albanais'); INSERT INTO "list" ("id", "value") VALUES ('ALK', 'lek albanais (1947–1961)'); INSERT INTO "list" ("id", "value") VALUES ('HNL', 'lempira hondurien'); INSERT INTO "list" ("id", "value") VALUES ('SLL', 'leone sierra-léonais'); INSERT INTO "list" ("id", "value") VALUES ('MDL', 'leu moldave'); INSERT INTO "list" ("id", "value") VALUES ('RON', 'leu roumain'); INSERT INTO "list" ("id", "value") VALUES ('BGN', 'lev bulgare'); INSERT INTO "list" ("id", "value") VALUES ('BGL', 'lev bulgare (1962–1999)'); INSERT INTO "list" ("id", "value") VALUES ('SZL', 'lilangeni swazi'); INSERT INTO "list" ("id", "value") VALUES ('ITL', 'lire italienne'); INSERT INTO "list" ("id", "value") VALUES ('MTL', 'lire maltaise'); INSERT INTO "list" ("id", "value") VALUES ('LTL', 'litas lituanien'); INSERT INTO "list" ("id", "value") VALUES ('CYP', 'livre chypriote'); INSERT INTO "list" ("id", "value") VALUES ('GIP', 'livre de Gibraltar'); INSERT INTO "list" ("id", "value") VALUES ('SHP', 'livre de Sainte-Hélène'); INSERT INTO "list" ("id", "value") VALUES ('FKP', 'livre des îles Malouines'); INSERT INTO "list" ("id", "value") VALUES ('IEP', 'livre irlandaise'); INSERT INTO "list" ("id", "value") VALUES ('ILP', 'livre israélienne'); INSERT INTO "list" ("id", "value") VALUES ('LBP', 'livre libanaise'); INSERT INTO "list" ("id", "value") VALUES ('MTP', 'livre maltaise'); INSERT INTO "list" ("id", "value") VALUES ('SDG', 'livre soudanaise'); INSERT INTO "list" ("id", "value") VALUES ('SDP', 'livre soudanaise (1956–2007)'); INSERT INTO "list" ("id", "value") VALUES ('GBP', 'livre sterling'); INSERT INTO "list" ("id", "value") VALUES ('SSP', 'livre sud-soudanaise'); INSERT INTO "list" ("id", "value") VALUES ('SYP', 'livre syrienne'); INSERT INTO "list" ("id", "value") VALUES ('TRY', 'livre turque'); INSERT INTO "list" ("id", "value") VALUES ('TRL', 'livre turque (1844–2005)'); INSERT INTO "list" ("id", "value") VALUES ('EGP', 'livre égyptienne'); INSERT INTO "list" ("id", "value") VALUES ('LSL', 'loti lesothan'); INSERT INTO "list" ("id", "value") VALUES ('AZN', 'manat azéri'); INSERT INTO "list" ("id", "value") VALUES ('AZM', 'manat azéri (1993–2006)'); INSERT INTO "list" ("id", "value") VALUES ('TMM', 'manat turkmène'); INSERT INTO "list" ("id", "value") VALUES ('DEM', 'mark allemand'); INSERT INTO "list" ("id", "value") VALUES ('BAM', 'mark convertible bosniaque'); INSERT INTO "list" ("id", "value") VALUES ('DDM', 'mark est-allemand'); INSERT INTO "list" ("id", "value") VALUES ('FIM', 'mark finlandais'); INSERT INTO "list" ("id", "value") VALUES ('MZN', 'metical mozambicain'); INSERT INTO "list" ("id", "value") VALUES ('BOV', 'mvdol bolivien'); INSERT INTO "list" ("id", "value") VALUES ('MZM', 'métical'); INSERT INTO "list" ("id", "value") VALUES ('ERN', 'nafka érythréen'); INSERT INTO "list" ("id", "value") VALUES ('NGN', 'naira nigérian'); INSERT INTO "list" ("id", "value") VALUES ('BTN', 'ngultrum bouthanais'); INSERT INTO "list" ("id", "value") VALUES ('BRN', 'nouveau cruzado'); INSERT INTO "list" ("id", "value") VALUES ('BRB', 'nouveau cruzeiro brésilien (1967–1986)'); INSERT INTO "list" ("id", "value") VALUES ('YUD', 'nouveau dinar yougoslave'); INSERT INTO "list" ("id", "value") VALUES ('TWD', 'nouveau dollar taïwanais'); INSERT INTO "list" ("id", "value") VALUES ('AON', 'nouveau kwanza angolais (1990–2000)'); INSERT INTO "list" ("id", "value") VALUES ('TMT', 'nouveau manat turkmène'); INSERT INTO "list" ("id", "value") VALUES ('BYB', 'nouveau rouble biélorusse (1994–1999)'); INSERT INTO "list" ("id", "value") VALUES ('ILS', 'nouveau shekel israélien'); INSERT INTO "list" ("id", "value") VALUES ('ZRN', 'nouveau zaïre zaïrien'); INSERT INTO "list" ("id", "value") VALUES ('MRO', 'ouguiya mauritanien'); INSERT INTO "list" ("id", "value") VALUES ('MOP', 'pataca macanaise'); INSERT INTO "list" ("id", "value") VALUES ('TOP', 'pa’anga tongan'); INSERT INTO "list" ("id", "value") VALUES ('ADP', 'peseta andorrane'); INSERT INTO "list" ("id", "value") VALUES ('ESP', 'peseta espagnole'); INSERT INTO "list" ("id", "value") VALUES ('ESA', 'peseta espagnole (compte A)'); INSERT INTO "list" ("id", "value") VALUES ('ESB', 'peseta espagnole (compte convertible)'); INSERT INTO "list" ("id", "value") VALUES ('ARS', 'peso argentin'); INSERT INTO "list" ("id", "value") VALUES ('ARP', 'peso argentin (1983–1985)'); INSERT INTO "list" ("id", "value") VALUES ('GWP', 'peso bissau-guinéen'); INSERT INTO "list" ("id", "value") VALUES ('BOP', 'peso bolivien'); INSERT INTO "list" ("id", "value") VALUES ('CLP', 'peso chilien'); INSERT INTO "list" ("id", "value") VALUES ('COP', 'peso colombien'); INSERT INTO "list" ("id", "value") VALUES ('CUP', 'peso cubain'); INSERT INTO "list" ("id", "value") VALUES ('CUC', 'peso cubain convertible'); INSERT INTO "list" ("id", "value") VALUES ('DOP', 'peso dominicain'); INSERT INTO "list" ("id", "value") VALUES ('MXP', 'peso d’argent mexicain (1861–1992)'); INSERT INTO "list" ("id", "value") VALUES ('MXN', 'peso mexicain'); INSERT INTO "list" ("id", "value") VALUES ('PHP', 'peso philippin'); INSERT INTO "list" ("id", "value") VALUES ('UYU', 'peso uruguayen'); INSERT INTO "list" ("id", "value") VALUES ('UYP', 'peso uruguayen (1975–1993)'); INSERT INTO "list" ("id", "value") VALUES ('UYI', 'peso uruguayen (unités indexées)'); INSERT INTO "list" ("id", "value") VALUES ('BWP', 'pula botswanais'); INSERT INTO "list" ("id", "value") VALUES ('GTQ', 'quetzal guatémaltèque'); INSERT INTO "list" ("id", "value") VALUES ('ZAR', 'rand sud-africain'); INSERT INTO "list" ("id", "value") VALUES ('ZAL', 'rand sud-africain (financier)'); INSERT INTO "list" ("id", "value") VALUES ('IRR', 'rial iranien'); INSERT INTO "list" ("id", "value") VALUES ('OMR', 'rial omanais'); INSERT INTO "list" ("id", "value") VALUES ('QAR', 'rial qatari'); INSERT INTO "list" ("id", "value") VALUES ('SAR', 'rial saoudien'); INSERT INTO "list" ("id", "value") VALUES ('YER', 'rial yéménite'); INSERT INTO "list" ("id", "value") VALUES ('KHR', 'riel cambodgien'); INSERT INTO "list" ("id", "value") VALUES ('MYR', 'ringgit malais'); INSERT INTO "list" ("id", "value") VALUES ('BYN', 'rouble biélorusse'); INSERT INTO "list" ("id", "value") VALUES ('BYR', 'rouble biélorusse (2000–2016)'); INSERT INTO "list" ("id", "value") VALUES ('LVR', 'rouble letton'); INSERT INTO "list" ("id", "value") VALUES ('RUB', 'rouble russe'); INSERT INTO "list" ("id", "value") VALUES ('RUR', 'rouble russe (1991–1998)'); INSERT INTO "list" ("id", "value") VALUES ('SUR', 'rouble soviétique'); INSERT INTO "list" ("id", "value") VALUES ('TJR', 'rouble tadjik'); INSERT INTO "list" ("id", "value") VALUES ('SCR', 'roupie des Seychelles'); INSERT INTO "list" ("id", "value") VALUES ('INR', 'roupie indienne'); INSERT INTO "list" ("id", "value") VALUES ('IDR', 'roupie indonésienne'); INSERT INTO "list" ("id", "value") VALUES ('MUR', 'roupie mauricienne'); INSERT INTO "list" ("id", "value") VALUES ('NPR', 'roupie népalaise'); INSERT INTO "list" ("id", "value") VALUES ('PKR', 'roupie pakistanaise'); INSERT INTO "list" ("id", "value") VALUES ('LKR', 'roupie srilankaise'); INSERT INTO "list" ("id", "value") VALUES ('MVR', 'rufiyaa maldivien'); INSERT INTO "list" ("id", "value") VALUES ('BRL', 'réal brésilien'); INSERT INTO "list" ("id", "value") VALUES ('ATS', 'schilling autrichien'); INSERT INTO "list" ("id", "value") VALUES ('KES', 'shilling kényan'); INSERT INTO "list" ("id", "value") VALUES ('UGX', 'shilling ougandais'); INSERT INTO "list" ("id", "value") VALUES ('UGS', 'shilling ougandais (1966–1987)'); INSERT INTO "list" ("id", "value") VALUES ('SOS', 'shilling somalien'); INSERT INTO "list" ("id", "value") VALUES ('TZS', 'shilling tanzanien'); INSERT INTO "list" ("id", "value") VALUES ('PEN', 'sol péruvien'); INSERT INTO "list" ("id", "value") VALUES ('PES', 'sol péruvien (1863–1985)'); INSERT INTO "list" ("id", "value") VALUES ('KGS', 'som kirghize'); INSERT INTO "list" ("id", "value") VALUES ('TJS', 'somoni tadjik'); INSERT INTO "list" ("id", "value") VALUES ('ECS', 'sucre équatorien'); INSERT INTO "list" ("id", "value") VALUES ('UZS', 'sum ouzbek'); INSERT INTO "list" ("id", "value") VALUES ('GNS', 'syli guinéen'); INSERT INTO "list" ("id", "value") VALUES ('BDT', 'taka bangladeshi'); INSERT INTO "list" ("id", "value") VALUES ('WST', 'tala samoan'); INSERT INTO "list" ("id", "value") VALUES ('LTT', 'talonas lituanien'); INSERT INTO "list" ("id", "value") VALUES ('KZT', 'tenge kazakh'); INSERT INTO "list" ("id", "value") VALUES ('SIT', 'tolar slovène'); INSERT INTO "list" ("id", "value") VALUES ('MNT', 'tugrik mongol'); INSERT INTO "list" ("id", "value") VALUES ('XRE', 'type de fonds RINET'); INSERT INTO "list" ("id", "value") VALUES ('XEU', 'unité de compte européenne (ECU)'); INSERT INTO "list" ("id", "value") VALUES ('MXV', 'unité de conversion mexicaine (UDI)'); INSERT INTO "list" ("id", "value") VALUES ('ECV', 'unité de valeur constante équatoriale (UVC)'); INSERT INTO "list" ("id", "value") VALUES ('COU', 'unité de valeur réelle colombienne'); INSERT INTO "list" ("id", "value") VALUES ('CLF', 'unité d’investissement chilienne'); INSERT INTO "list" ("id", "value") VALUES ('VUV', 'vatu vanuatuan'); INSERT INTO "list" ("id", "value") VALUES ('KPW', 'won nord-coréen'); INSERT INTO "list" ("id", "value") VALUES ('KRW', 'won sud-coréen'); INSERT INTO "list" ("id", "value") VALUES ('JPY', 'yen japonais'); INSERT INTO "list" ("id", "value") VALUES ('CNY', 'yuan renminbi chinois'); INSERT INTO "list" ("id", "value") VALUES ('ZRZ', 'zaïre zaïrois'); INSERT INTO "list" ("id", "value") VALUES ('PLZ', 'zloty (1950–1995)'); INSERT INTO "list" ("id", "value") VALUES ('PLN', 'zloty polonais');
{ "pile_set_name": "Github" }
from time import sleep from settings import WATCHED_SOURCES, POLLING_SPEED from sources.logfile import gen_lines from sources.sockets import gen_conns all_source_generators = { # generator depends on whether source is a port number or file path source: gen_conns(source) if type(source) == int else gen_lines(source) for source in WATCHED_SOURCES.keys() } def get_new_lines(source_generators=all_source_generators, delay=POLLING_SPEED): """infinite runloop which reads lines out of their source generators""" while True: for source, generator in source_generators.iteritems(): next_line = next(generator) while next_line: yield (source, next_line) next_line = next(generator) sleep(delay)
{ "pile_set_name": "Github" }
@extends('themes.default.layouts.home') @section('content') <!-- Header --> <div class="header pb-8 pt-5 pt-lg-8 d-flex align-items-center" style="min-height: 600px; background-image: url({{asset('assets/themes/argon/img/computer-1149148.jpg')}}); background-size: cover; background-position: center top;"> <!-- Mask --> <span class="mask bg-gradient-default opacity-8"></span> <!-- Header container --> <div class="container-fluid d-flex align-items-center"> <div class="row"> <div class="col-lg-7 col-md-10"> <p class="text-white" style="font-size: 1rem">欢迎回来</p> <h1 class="display-2 text-white">{{Auth::user()->name}}</h1> <p class="text-white mt-0 mb-5">祝你开心每一天!</p> </div> </div> </div> </div> <!-- Page content --> @endsection @section('container-fluid') <div class="row"> <div class="col-xl-9 order-xl-1 mb-3"> <div class="card bg-secondary shadow"> <div class="card-header bg-white border-0"> <div class="row align-items-center"> <div class="col-12"> <h3 class="mb-0">订购商品</h3> </div> </div> </div> <div class="card-body"> <form> <h6 class="heading-small text-muted mb-4">订单信息</h6> <div class="pl-lg-4"> <div class="row"> <div class="col-lg-6"> <div class="form-group"> <label class="form-control-label" for="input-username">商品名称</label> <input type="text" id="input-username" class="form-control form-control-alternative" disabled value="{{$order->good ? $order->good->title:$order->no}}"> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label class="form-control-label" for="input-email">价格</label> <input type="text" id="input-email" class="form-control form-control-alternative" disabled value="{{$order->price?$order->price:$order->money}} {{$currencyUnit}}"> </div> </div> </div> <div class="row"> <div class="col-lg-6"> <div class="form-group"> <label class="form-control-label" for="input-first-name">优惠码</label> <input type="text" id="input-first-name" class="form-control form-control-alternative" disabled> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label class="form-control-label" for="input-last-name">推荐者</label> <input type="text" id="input-last-name" class="form-control form-control-alternative" disabled> </div> </div> </div> </div> </form> </div> </div> </div> <div class="col-xl-3 order-xl-2 mb-5 mb-xl-0"> <div class="card bg-secondary shadow"> <div class="text-center mt-5"> @switch($payPage['type']) @case('qrcode') {!! QrCode::size(200)->color(94, 114, 228)->generate($payPage['url']); !!} @break @case('redirect') {{-- {{redirect($payPage['url'])}}--}} @break @endswitch </div> <div class="card-body text-center"> <h5 class="card-title text-center">扫描二维码付款</h5> <p class="card-text text-center">支付完成<br>请点击下面按钮查询订单状态</p> <a href="" onclick="event.preventDefault(); document.getElementById('check-order-status').submit();" class="text-center btn btn-primary">刷新</a> <form id="check-order-status" action="{{ route('order.status') }}" method="POST" style="display: none;"> <input type="hidden" name="no" value="{{$order->no}}"> @csrf </form> </div> </div> </div> </div> @endsection
{ "pile_set_name": "Github" }
/* * Copyright 2017 the original author or 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 org.gradle.test.fixtures.server.http import javax.servlet.http.HttpServletResponse interface HttpPluginRepository { void expectPluginMarkerMissing(String pluginId, String pluginVersion) void expectPluginMarkerBroken(String pluginId, String pluginVersion) void expectPluginMarkerQuery(String pluginId, String pluginVersion, @DelegatesTo(value = HttpServletResponse, strategy = Closure.DELEGATE_FIRST) Closure<?> markerQueryConfigurer) void expectPluginResolution(String pluginId, String pluginVersion, String group, String artifactId, String version) void expectCachedPluginResolution(String pluginId, String pluginVersion, String group, String artifactId, String version) }
{ "pile_set_name": "Github" }
$(document).ready(function() { $.getJSON('static/js/sounds.json', function(sounds) { for (var key in sounds) { obj = sounds[key]; var link = $('<a/>').attr({ 'href': '#', 'class': 'play', 'data-mp3': key, }); link.html(" " + obj.label).addClass(obj.class); if (obj.data) { link.attr('data-'+obj.class, obj.data); } $('#soundlinks').append(link).append('<br/>'); $('body').append('<div id="'+key+'" class="player"></div>') }; $('.player').jPlayer({ ready: function() { var key = $(this).attr('id'); var sound = sounds[key]; $(this).jPlayer("setMedia", {mp3: "./sounds/"+key+'.mp3'}); if (sound.volume) { $(this).jPlayer("volume", sound.volume / 100.0); } }, play: function () { // right, this one is needed, or you can't play two sounds at the same time console.log('playing '+$(this).attr('id')); }, loop: true, preload: false, volume: .6 }); $('.play').on("click", function() { var player = $(this).data('mp3'); if ($(this).hasClass('playing')) { $("#"+player).jPlayer("pause"); } else { $('#'+player).jPlayer("play"); } $(this).toggleClass('playing'); }); }); });
{ "pile_set_name": "Github" }
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ui/ozone/platform/drm/gpu/drm_console_buffer.h" #include <sys/mman.h> #include <xf86drmMode.h> #include "ui/ozone/platform/drm/common/scoped_drm_types.h" #include "ui/ozone/platform/drm/gpu/drm_device.h" namespace ui { DrmConsoleBuffer::DrmConsoleBuffer(const scoped_refptr<DrmDevice>& drm, uint32_t framebuffer) : drm_(drm), framebuffer_(framebuffer) { } DrmConsoleBuffer::~DrmConsoleBuffer() { if (mmap_base_) if (munmap(mmap_base_, mmap_size_)) PLOG(ERROR) << "munmap"; if (handle_ && !drm_->CloseBufferHandle(handle_)) PLOG(ERROR) << "DrmConsoleBuffer: CloseBufferHandle: handle " << handle_; } bool DrmConsoleBuffer::Initialize() { ScopedDrmFramebufferPtr fb(drm_->GetFramebuffer(framebuffer_)); if (!fb) return false; handle_ = fb->handle; stride_ = fb->pitch; SkImageInfo info = SkImageInfo::MakeN32Premul(fb->width, fb->height); mmap_size_ = info.getSafeSize(stride_); if (!drm_->MapDumbBuffer(fb->handle, mmap_size_, &mmap_base_)) { mmap_base_ = NULL; return false; } surface_ = SkSurface::MakeRasterDirect(info, mmap_base_, stride_); if (!surface_) return false; return true; } } // namespace ui
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <script src="face-api.js"></script> <script src="js/commons.js"></script> <script src="js/faceDetectionControls.js"></script> <script src="js/imageSelectionControls.js"></script> <script src="js/bbt.js"></script> <link rel="stylesheet" href="styles.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.css"> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script> </head> <body> <div id="navbar"></div> <div class="center-content page-container"> <div class="progress" id="loader"> <div class="indeterminate"></div> </div> <div style="position: relative" class="margin"> <img id="inputImg" src="" style="max-width: 800px;" /> <canvas id="overlay" /> </div> <div class="row side-by-side"> <!-- face_detector_selection_control --> <div id="face_detector_selection_control" class="row input-field" style="margin-right: 20px;"> <select id="selectFaceDetector"> <option value="ssd_mobilenetv1">SSD Mobilenet V1</option> <option value="tiny_face_detector">Tiny Face Detector</option> </select> <label>Select Face Detector</label> </div> <!-- face_detector_selection_control --> <!-- image_selection_control --> <div id="image_selection_control"></div> <div id="selectList"></div> <div class="row"> <label for="imgUrlInput">Get image from URL:</label> <input id="imgUrlInput" type="text" class="bold"> </div> <button class="waves-effect waves-light btn" onclick="loadImageFromUrl()" > Ok </button> <input id="queryImgUploadInput" type="file" class="waves-effect btn bold" onchange="loadImageFromUpload()" accept=".jpg, .jpeg, .png"> <div id="image_selection_control"></div> <!-- image_selection_control --> </div> <!-- ssd_mobilenetv1_controls --> <span id="ssd_mobilenetv1_controls"> <div class="row side-by-side"> <div class="row"> <label for="minConfidence">Min Confidence:</label> <input disabled value="0.5" id="minConfidence" type="text" class="bold"> </div> <button class="waves-effect waves-light btn" onclick="onDecreaseMinConfidence()" > <i class="material-icons left">-</i> </button> <button class="waves-effect waves-light btn" onclick="onIncreaseMinConfidence()" > <i class="material-icons left">+</i> </button> </div> </span> <!-- ssd_mobilenetv1_controls --> <!-- tiny_face_detector_controls --> <span id="tiny_face_detector_controls"> <div class="row side-by-side"> <div class="row input-field" style="margin-right: 20px;"> <select id="inputSize"> <option value="" disabled selected>Input Size:</option> <option value="160">160 x 160</option> <option value="224">224 x 224</option> <option value="320">320 x 320</option> <option value="416">416 x 416</option> <option value="512">512 x 512</option> <option value="608">608 x 608</option> </select> <label>Input Size</label> </div> <div class="row"> <label for="scoreThreshold">Score Threshold:</label> <input disabled value="0.5" id="scoreThreshold" type="text" class="bold"> </div> <button class="waves-effect waves-light btn" onclick="onDecreaseScoreThreshold()" > <i class="material-icons left">-</i> </button> <button class="waves-effect waves-light btn" onclick="onIncreaseScoreThreshold()" > <i class="material-icons left">+</i> </button> </div> </span> <!-- tiny_face_detector_controls --> </body> <script> let faceMatcher = null async function updateResults() { if (!isFaceDetectionModelLoaded()) { return } const inputImgEl = $('#inputImg').get(0) const options = getFaceDetectorOptions() const results = await faceapi .detectAllFaces(inputImgEl, options) .withFaceLandmarks() .withFaceDescriptors() drawFaceRecognitionResults(results) } function drawFaceRecognitionResults(results) { const canvas = $('#overlay').get(0) const inputImgEl = $('#inputImg').get(0) faceapi.matchDimensions(canvas, inputImgEl) // resize detection and landmarks in case displayed image is smaller than // original size const resizedResults = faceapi.resizeResults(results, inputImgEl) resizedResults.forEach(({ detection, descriptor }) => { const label = faceMatcher.findBestMatch(descriptor).toString() const options = { label } const drawBox = new faceapi.draw.DrawBox(detection.box, options) drawBox.draw(canvas) }) } async function run() { // load face detection, face landmark model and face recognition models await changeFaceDetector(selectedFaceDetector) await faceapi.loadFaceLandmarkModel('/') await faceapi.loadFaceRecognitionModel('/') // initialize face matcher with 1 reference descriptor per bbt character faceMatcher = await createBbtFaceMatcher(1) // start processing image updateResults() } $(document).ready(function() { renderNavBar('#navbar', 'bbt_face_recognition') initImageSelectionControls() initFaceDetectionControls() run() }) </script> </body> </html>
{ "pile_set_name": "Github" }
// Greenshot - a free and open source screenshot tool // Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom // // For more information see: http://getgreenshot.org/ // The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot // // 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 1 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. using System; using System.Collections.Generic; namespace Greenshot.Addons.Components { /// <summary> /// Implement this interface to provide last-minute or dynamic IDestinations /// </summary> public interface IDestinationProvider { /// <summary> /// Provide destinations /// </summary> /// <returns>IEnumerable with lazy IDestinations</returns> IEnumerable<Lazy<IDestination, DestinationAttribute>> Provide(); } }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- **************************************************************** --> <!-- * PLEASE KEEP COMPLICATED EXPRESSIONS OUT OF THESE TEMPLATES, * --> <!-- * i.e. only iterate & print data where possible. Thanks, Jez. * --> <!-- **************************************************************** --> <html> <head> <!-- Generated by groovydoc (2.3.3) on Tue Jul 01 09:50:55 CEST 2014 --> <title>ArtifactIdentifier (Gradle API 2.0)</title> <meta name="date" content="2014-07-01"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link href="../../../../groovy.ico" type="image/x-icon" rel="shortcut icon"> <link href="../../../../groovy.ico" type="image/x-icon" rel="icon"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <body class="center"> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ArtifactIdentifier (Gradle API 2.0)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <div> <ul class="navList"> <li><a href="../../../../index.html?org/gradle/api/artifacts/ArtifactIdentifier" target="_top">Frames</a></li> <li><a href="ArtifactIdentifier.html" target="_top">No Frames</a></li> </ul> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> Nested&nbsp;&nbsp;&nbsp;Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#method_summary">Method</a></li>&nbsp;&nbsp;&nbsp; </ul> <ul class="subNavList"> <li>&nbsp;|&nbsp;Detail:&nbsp;</li> Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#method_detail">Method</a></li>&nbsp;&nbsp;&nbsp; </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">Package: <strong>org.gradle.api.artifacts</strong></div> <h2 title="[Java] Interface ArtifactIdentifier" class="title">[Java] Interface ArtifactIdentifier</h2> </div> <div class="contentContainer"> <ul class="inheritance"> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <p> The identifier for a module artifact. </p> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== NESTED CLASS SUMMARY =========== --> <!-- =========== ENUM CONSTANT SUMMARY =========== --> <!-- =========== FIELD SUMMARY =========== --> <!-- =========== PROPERTY SUMMARY =========== --> <!-- =========== ELEMENT SUMMARY =========== --> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"><!-- --></a> <h3>Methods Summary</h3> <ul class="blockList"> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Methods Summary table"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Type</th> <th class="colLast" scope="col">Name and description</th> </tr> <tr class="altColor"> <td class="colFirst"><code><a href='http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html' title='String'>String</a></strong></code></td> <td class="colLast"><code><strong><a href="#getClassifier()">getClassifier</a></strong>()</code><br>Returns the classifier of this artifact, if any.</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href='http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html' title='String'>String</a></strong></code></td> <td class="colLast"><code><strong><a href="#getExtension()">getExtension</a></strong>()</code><br>Returns the extension of this artifact. </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href='../../../../org/gradle/api/artifacts/ModuleVersionIdentifier.html'>ModuleVersionIdentifier</a></strong></code></td> <td class="colLast"><code><strong><a href="#getModuleVersionIdentifier()">getModuleVersionIdentifier</a></strong>()</code><br>Returns the identifier of the module that owns this artifact.</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href='http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html' title='String'>String</a></strong></code></td> <td class="colLast"><code><strong><a href="#getName()">getName</a></strong>()</code><br>Returns the name of this artifact.</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href='http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html' title='String'>String</a></strong></code></td> <td class="colLast"><code><strong><a href="#getType()">getType</a></strong>()</code><br>Returns the type of this artifact. </td> </tr> </table> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- =========== METHOD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getClassifier()"><!-- --></a> <ul class="blockListLast"> <li class="blockList"> <h4>public&nbsp;<a href='http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html' title='String'>String</a> <strong>getClassifier</strong>()</h4> <p> Returns the classifier of this artifact, if any. </p> </li> </ul> <a name="getExtension()"><!-- --></a> <ul class="blockListLast"> <li class="blockList"> <h4>public&nbsp;<a href='http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html' title='String'>String</a> <strong>getExtension</strong>()</h4> <p> Returns the extension of this artifact. Often the extension is the same as the type, but sometimes this is not the case. For example for an ivy XML module descriptor, the type is <em>ivy</em> and the extension is <em>xml</em>. <DL><DT><B>See Also:</B></DT><DD><a href='#getType()'>getType()</a></DD></DL></p> </li> </ul> <a name="getModuleVersionIdentifier()"><!-- --></a> <ul class="blockListLast"> <li class="blockList"> <h4>public&nbsp;<a href='../../../../org/gradle/api/artifacts/ModuleVersionIdentifier.html'>ModuleVersionIdentifier</a> <strong>getModuleVersionIdentifier</strong>()</h4> <p> Returns the identifier of the module that owns this artifact. </p> </li> </ul> <a name="getName()"><!-- --></a> <ul class="blockListLast"> <li class="blockList"> <h4>public&nbsp;<a href='http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html' title='String'>String</a> <strong>getName</strong>()</h4> <p> Returns the name of this artifact. </p> </li> </ul> <a name="getType()"><!-- --></a> <ul class="blockListLast"> <li class="blockList"> <h4>public&nbsp;<a href='http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html' title='String'>String</a> <strong>getType</strong>()</h4> <p> Returns the type of this artifact. Often the type is the same as the extension, but sometimes this is not the case. For example for an ivy XML module descriptor, the type is <em>ivy</em> and the extension is <em>xml</em>. <DL><DT><B>See Also:</B></DT><DD><a href='#getExtension()'>getExtension()</a></DD></DL></p> </li> </ul> </li> </ul> </li> </ul> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <div> <ul class="navList"> <li><a href="../../../../index.html?org/gradle/api/artifacts/ArtifactIdentifier" target="_top">Frames</a></li> <li><a href="ArtifactIdentifier.html" target="_top">No Frames</a></li> </ul> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> Nested&nbsp;&nbsp;&nbsp;Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#method_summary">Method</a></li>&nbsp;&nbsp;&nbsp; </ul> <ul class="subNavList"> <li>&nbsp;|&nbsp;Detail:&nbsp;</li> Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#method_detail">Method</a></li>&nbsp;&nbsp;&nbsp; </ul> </div> <p>Gradle API 2.0</p> <a name="skip-navbar_bottom"> <!-- --> </a> </div> </div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "pile_set_name": "Github" }
/* * GRUB -- GRand Unified Bootloader * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * GRUB is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ #include <grub/machine/memory.h> #include <grub/types.h> #include <grub/multiboot.h> #include <grub/err.h> #include <grub/misc.h> /* A pointer to the MBI in its initial location. */ struct multiboot_info *startup_multiboot_info; /* The MBI has to be copied to our BSS so that it won't be overwritten. This is its final location. */ static struct multiboot_info kern_multiboot_info; /* Unfortunately we can't use heap at this point. But 32 looks like a sane limit (used by memtest86). */ static grub_uint8_t mmap_entries[sizeof (struct multiboot_mmap_entry) * 32]; void grub_machine_mmap_init (void) { if (! startup_multiboot_info) grub_fatal ("Unable to find Multiboot Information (is CONFIG_MULTIBOOT disabled in coreboot?)"); /* Move MBI to a safe place. */ grub_memmove (&kern_multiboot_info, startup_multiboot_info, sizeof (struct multiboot_info)); if ((kern_multiboot_info.flags & MULTIBOOT_INFO_MEM_MAP) == 0) grub_fatal ("Missing Multiboot memory information"); /* Move the memory map to a safe place. */ if (kern_multiboot_info.mmap_length > sizeof (mmap_entries)) { grub_printf ("WARNING: Memory map size exceeds limit (0x%x > 0x%x); it will be truncated\n", kern_multiboot_info.mmap_length, sizeof (mmap_entries)); kern_multiboot_info.mmap_length = sizeof (mmap_entries); } grub_memmove (mmap_entries, (void *) kern_multiboot_info.mmap_addr, kern_multiboot_info.mmap_length); kern_multiboot_info.mmap_addr = (grub_uint32_t) mmap_entries; } grub_err_t grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) { struct multiboot_mmap_entry *entry = (void *) kern_multiboot_info.mmap_addr; while ((unsigned long) entry < kern_multiboot_info.mmap_addr + kern_multiboot_info.mmap_length) { if (hook (entry->addr, entry->len, entry->type, hook_data)) break; entry = (void *) ((grub_addr_t) entry + entry->size + sizeof (entry->size)); } return 0; }
{ "pile_set_name": "Github" }
user=User bot=Bot user:set language es-es user:Hola bot:message: Hello user:set language fr-fr user:Salut bot:message: Hello user:set language en-us user:Hello bot:message: Hello
{ "pile_set_name": "Github" }
// Rate-limited version of the mutex server // // Eli Bendersky [http://eli.thegreenplace.net] // This code is in the public domain. package main import ( "fmt" "log" "net/http" "os" "strconv" "sync" ) type CounterStore struct { sync.Mutex counters map[string]int } func (cs *CounterStore) get(w http.ResponseWriter, req *http.Request) { log.Printf("get %v", req) cs.Lock() defer cs.Unlock() name := req.URL.Query().Get("name") if val, ok := cs.counters[name]; ok { fmt.Fprintf(w, "%s: %d\n", name, val) } else { fmt.Fprintf(w, "%s not found\n", name) } } func (cs *CounterStore) set(w http.ResponseWriter, req *http.Request) { log.Printf("set %v", req) cs.Lock() defer cs.Unlock() name := req.URL.Query().Get("name") val := req.URL.Query().Get("val") intval, err := strconv.Atoi(val) if err != nil { fmt.Fprintf(w, "%s\n", err) } else { cs.counters[name] = intval fmt.Fprintf(w, "ok\n") } } // limitNumClients is HTTP handling middleware that ensures no more than // maxClients requests are passed concurrently to the given handler f. func limitNumClients(f http.HandlerFunc, maxClients int) http.HandlerFunc { sema := make(chan struct{}, maxClients) return func(w http.ResponseWriter, req *http.Request) { sema <- struct{}{} defer func() { <-sema }() f(w, req) } } func (cs *CounterStore) inc(w http.ResponseWriter, req *http.Request) { log.Printf("inc %v", req) cs.Lock() defer cs.Unlock() name := req.URL.Query().Get("name") if _, ok := cs.counters[name]; ok { cs.counters[name]++ fmt.Fprintf(w, "ok\n") } else { fmt.Fprintf(w, "%s not found\n", name) } } func main() { store := CounterStore{counters: map[string]int{"i": 0, "j": 0}} http.HandleFunc("/get", store.get) http.HandleFunc("/set", store.set) // Limit to max 10 connections for this handler. http.HandleFunc("/inc", limitNumClients(store.inc, 10)) portnum := 8000 if len(os.Args) > 1 { portnum, _ = strconv.Atoi(os.Args[1]) } log.Printf("Going to listen on port %d\n", portnum) log.Fatal(http.ListenAndServe("localhost:"+strconv.Itoa(portnum), nil)) }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3; import android.graphics.drawable.Drawable; import android.util.FloatProperty; import android.util.Property; import android.view.View; import android.view.ViewGroup.LayoutParams; public class LauncherAnimUtils { /** * Durations for various state animations. These are not defined in resources to allow * easier access from static classes and enums */ public static final int ALL_APPS_TRANSITION_MS = 320; public static final int OVERVIEW_TRANSITION_MS = 250; public static final int SPRING_LOADED_TRANSITION_MS = 150; public static final int SPRING_LOADED_EXIT_DELAY = 500; // The progress of an animation to all apps must be at least this far along to snap to all apps. public static final float MIN_PROGRESS_TO_ALL_APPS = 0.5f; public static final Property<Drawable, Integer> DRAWABLE_ALPHA = new Property<Drawable, Integer>(Integer.TYPE, "drawableAlpha") { @Override public Integer get(Drawable drawable) { return drawable.getAlpha(); } @Override public void set(Drawable drawable, Integer alpha) { drawable.setAlpha(alpha); } }; public static final FloatProperty<View> SCALE_PROPERTY = new FloatProperty<View>("scale") { @Override public Float get(View view) { return view.getScaleX(); } @Override public void setValue(View view, float scale) { view.setScaleX(scale); view.setScaleY(scale); } }; /** Increase the duration if we prevented the fling, as we are going against a high velocity. */ public static int blockedFlingDurationFactor(float velocity) { return (int) Utilities.boundToRange(Math.abs(velocity) / 2, 2f, 6f); } public static final Property<LayoutParams, Integer> LAYOUT_WIDTH = new Property<LayoutParams, Integer>(Integer.TYPE, "width") { @Override public Integer get(LayoutParams lp) { return lp.width; } @Override public void set(LayoutParams lp, Integer width) { lp.width = width; } }; public static final Property<LayoutParams, Integer> LAYOUT_HEIGHT = new Property<LayoutParams, Integer>(Integer.TYPE, "height") { @Override public Integer get(LayoutParams lp) { return lp.height; } @Override public void set(LayoutParams lp, Integer height) { lp.height = height; } }; public static final FloatProperty<View> VIEW_TRANSLATE_X = View.TRANSLATION_X instanceof FloatProperty ? (FloatProperty) View.TRANSLATION_X : new FloatProperty<View>("translateX") { @Override public void setValue(View view, float v) { view.setTranslationX(v); } @Override public Float get(View view) { return view.getTranslationX(); } }; public static final FloatProperty<View> VIEW_TRANSLATE_Y = View.TRANSLATION_Y instanceof FloatProperty ? (FloatProperty) View.TRANSLATION_Y : new FloatProperty<View>("translateY") { @Override public void setValue(View view, float v) { view.setTranslationY(v); } @Override public Float get(View view) { return view.getTranslationY(); } }; }
{ "pile_set_name": "Github" }
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type MutatingWebhookConfigurationExpansion interface{} type ValidatingWebhookConfigurationExpansion interface{}
{ "pile_set_name": "Github" }
{ "name": "example-example69", "files": [ "index-production.html" ] }
{ "pile_set_name": "Github" }
// BilinearInterpolation.cu // 实现图像的双线性插值 #include "BilinearInterpolation.h" #include <iostream> #include <cmath> using namespace std; // 宏:DEF_BLOCK_X 和 DEF_BLOCK_Y // 定义了默认的线程块的尺寸。 #define DEF_BLOCK_X 32 #define DEF_BLOCK_Y 8 // 全局变量:_bilInterInimgTex(作为输入图像的纹理内存引用) // 纹理内存只能用于全局变量,此处是为了使用纹理内存提供的硬件插值功能 static texture<unsigned char, 2, cudaReadModeNormalizedFloat> _bilInterInimgTex; // Host 函数:initTexture(初始化纹理内存) // 将输入图像数据绑定到纹理内存 static __host__ int // 返回值:若正确执行返回 NO_ERROR initTexture( Image* inimg // 输入图像 ); // Kernel 函数:_bilInterpolKer(使用 ImageCuda 实现的双边滤波) // 空域参数只影响高斯表,在调用该方法前初始化高斯表即可 static __global__ void // kernel 函数无返回值 _bilInterpolKer( ImageCuda outimg, // 输出图像 float scaleinverse // 双边滤波半径 ); // Host 函数:initTexture(初始化纹理内存) static __host__ int initTexture(Image* inimg) { cudaError_t cuerrcode; int errcode; // 局部变量,错误码 // 将输入图像拷贝到 Device 内存中。 errcode = ImageBasicOp::copyToCurrentDevice(inimg); if (errcode != NO_ERROR) return errcode; // 提取输入图像的 ROI 子图像。 ImageCuda insubimgCud; errcode = ImageBasicOp::roiSubImage(inimg, &insubimgCud); if (errcode != NO_ERROR) return errcode; // 设置数据通道描述符,因为只有一个颜色通道(灰度图),因此描述符中只有第一 // 个分量含有数据。概述据通道描述符用于纹理内存的绑定操作。 struct cudaChannelFormatDesc chndesc; chndesc = cudaCreateChannelDesc(sizeof (unsigned char) * 8, 0, 0, 0, cudaChannelFormatKindUnsigned); // 将输入图像数据绑定至纹理内存(texture) cuerrcode = cudaBindTexture2D( NULL, &_bilInterInimgTex, insubimgCud.imgMeta.imgData, &chndesc, insubimgCud.imgMeta.width, insubimgCud.imgMeta.height, insubimgCud.pitchBytes); // 将纹理内存(texture)的过滤模式设置为线性插值模式 // (cudaFilterModeLinear) _bilInterInimgTex.filterMode = cudaFilterModeLinear; if (cuerrcode != cudaSuccess) return CUDA_ERROR; return NO_ERROR; } // Kernel 函数:_bilInterpolKer(使用 ImageCuda 实现的双线性插值) static __global__ void _bilInterpolKer(ImageCuda outimg, float scaleinverse) { // 计算想成对应的输出点的位置,其中 dstc 和 dstr 分别表示线程处理的像素点的 // 坐标的 x 和 y 分量(其中,c 表示 column;r 表示 row)。由于我们采用了并 // 行度缩减的策略,令一个线程处理 4 个输出像素,这四个像素位于统一列的相邻 // 4 行上,因此,对于 dstr 需要进行乘 4 计算。 int dstc = blockIdx.x * blockDim.x + threadIdx.x; int dstr = (blockIdx.y * blockDim.y + threadIdx.y) * 4; // 检查第一个像素点是否越界,如果越界,则不进行处理,一方面节省计算资源,一 // 方面防止由于段错误导致的程序崩溃。 if (dstc >= outimg.imgMeta.width || dstr >= outimg.imgMeta.height) return; // 计算第一个输出坐标点对应的图像数据数组下标。 int dstidx = dstr * outimg.pitchBytes + dstc; // 将放大后图像的坐标点映射到源图像中的坐标点 float oldx = dstc * scaleinverse, oldy = dstr * scaleinverse; // 使用 texture 硬件插值得到归一化的 [0, 1] 的 float 归一化数据,再将数据转 // 换为对应的 8 位 unsigned char 数据 outimg.imgMeta.imgData[dstidx] = (unsigned char)0xFF * tex2D(_bilInterInimgTex, oldx, oldy); // 处理剩下的 3 个点 for (int i = 0; i <= 3; i++) { if (++dstr >= outimg.imgMeta.height) return ; // 由于只有纵坐标加 1,故映射左边只需加上 scale 的倒数即可 oldy += scaleinverse; // 将数据指针移至下一行像素点 dstidx += outimg.pitchBytes; // 使用 texture 进行硬件插值 outimg.imgMeta.imgData[dstidx] = (unsigned char) 0xFF * tex2D(_bilInterInimgTex, oldx, oldy); } } // Host 成员方法:doInterpolation(执行插值) __host__ int BilinearInterpolation::doInterpolation(Image *inimg, Image *outimg) { // 若图像的放大倍数为 0 ,则不进行插值返回正确执行 if (scale <= 0) return NO_ERROR; // 检查输入图像是否为 NULL,如果为 NULL 直接报错返回。 if (inimg == NULL) return NULL_POINTER; int errcode; // 局部变量,错误码 // 初始化纹理内存,将输入图像与之绑定 initTexture(inimg); // 将输出图像拷贝到 Device 内存中。 errcode = ImageBasicOp::copyToCurrentDevice(outimg); if (errcode != NO_ERROR) { // 拷贝失败时需要在host端创建放大后大小的图像空间 errcode = ImageBasicOp::makeAtCurrentDevice( outimg, scale * (inimg->roiX2 - inimg->roiX1), scale * (inimg->roiY2 - inimg->roiY1)); if (errcode != NO_ERROR) return errcode; } // 提取输出图像的 ROI 子图像。 ImageCuda outsubimgCud; errcode = ImageBasicOp::roiSubImage(outimg, &outsubimgCud); if (errcode != NO_ERROR) return errcode; // 由于输出图像是输入图像的 scale 倍,此处不进行 ROI 的大小调整 // 计算调用 Kernel 函数的线程块的尺寸和线程块的数量。 dim3 blocksize, gridsize; blocksize.x = DEF_BLOCK_X; blocksize.y = DEF_BLOCK_Y; // gridsize 由 blocksize 对应大小决定 gridsize.x = (outsubimgCud.imgMeta.width + blocksize.x - 1) / blocksize.x; gridsize.y = (outsubimgCud.imgMeta.height + blocksize.y * 4 - 1) / (blocksize.y * 4); // 放大倍数的倒数,将核函数内的除法运算变成乘法运算,同时减少除运算的次数 float scaleInverse = 1.0f / scale; // 调用核函数进行插值 _bilInterpolKer<<<gridsize, blocksize>>>(outsubimgCud, scaleInverse); return NO_ERROR; }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" ?> <Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> <Property name="undecorated" type="boolean" value="true"/> <Property name="resizable" type="boolean" value="false"/> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> <SyntheticProperty name="generateCenter" type="boolean" value="false"/> </SyntheticProperties> <Events> <EventHandler event="windowOpened" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowOpened"/> </Events> <AuxValues> <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/> <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"/> <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-79,0,0,3,13"/> </AuxValues> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> <SubComponents> <Container class="widget.InternalFrame" name="internalFrame1"> <Properties> <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> <TitledBorder title="::[ Tarif Tindakan Operasi di Inhealth ]::"> <Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> <LineBorder> <Color PropertyName="color" blue="eb" green="f5" red="f0" type="rgb"/> </LineBorder> </Border> <Font PropertyName="font" name="Tahoma" size="11" style="0"/> <Color PropertyName="color" blue="32" green="32" red="32" type="rgb"/> </TitledBorder> </Border> </Property> <Property name="name" type="java.lang.String" value="internalFrame1" noResource="true"/> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> <BorderConstraints direction="Center"/> </Constraint> </Constraints> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"> <Property name="horizontalGap" type="int" value="1"/> <Property name="verticalGap" type="int" value="1"/> </Layout> <SubComponents> <Container class="widget.ScrollPane" name="Scroll"> <Properties> <Property name="name" type="java.lang.String" value="Scroll" noResource="true"/> <Property name="opaque" type="boolean" value="true"/> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> <BorderConstraints direction="Center"/> </Constraint> </Constraints> <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <SubComponents> <Component class="widget.Table" name="tbJnsPerawatan"> <Properties> <Property name="autoCreateRowSorter" type="boolean" value="true"/> <Property name="toolTipText" type="java.lang.String" value="Silahkan klik untuk memilih data yang mau diedit ataupun dihapus"/> <Property name="name" type="java.lang.String" value="tbJnsPerawatan" noResource="true"/> </Properties> <Events> <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tbJnsPerawatanMouseClicked"/> <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="tbJnsPerawatanKeyPressed"/> </Events> </Component> </SubComponents> </Container> <Container class="javax.swing.JPanel" name="jPanel3"> <Properties> <Property name="name" type="java.lang.String" value="jPanel3" noResource="true"/> <Property name="opaque" type="boolean" value="false"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[44, 100]"/> </Property> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> <BorderConstraints direction="Last"/> </Constraint> </Constraints> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"> <Property name="horizontalGap" type="int" value="1"/> <Property name="verticalGap" type="int" value="1"/> </Layout> <SubComponents> <Container class="widget.panelisi" name="panelGlass8"> <Properties> <Property name="name" type="java.lang.String" value="panelGlass8" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[44, 44]"/> </Property> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> <BorderConstraints direction="Center"/> </Constraint> </Constraints> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"> <Property name="alignment" type="int" value="0"/> <Property name="verticalGap" type="int" value="9"/> </Layout> <SubComponents> <Component class="widget.Button" name="BtnSimpan"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/picture/save-16x16.png"/> </Property> <Property name="mnemonic" type="int" value="83"/> <Property name="text" type="java.lang.String" value="Simpan"/> <Property name="toolTipText" type="java.lang.String" value="Alt+S"/> <Property name="name" type="java.lang.String" value="BtnSimpan" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[100, 30]"/> </Property> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="BtnSimpanActionPerformed"/> <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="BtnSimpanKeyPressed"/> </Events> </Component> <Component class="widget.Button" name="BtnBatal"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/picture/Cancel-2-16x16.png"/> </Property> <Property name="mnemonic" type="int" value="66"/> <Property name="text" type="java.lang.String" value="Baru"/> <Property name="toolTipText" type="java.lang.String" value="Alt+B"/> <Property name="name" type="java.lang.String" value="BtnBatal" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[100, 30]"/> </Property> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="BtnBatalActionPerformed"/> <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="BtnBatalKeyPressed"/> </Events> </Component> <Component class="widget.Button" name="BtnHapus"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/picture/stop_f2.png"/> </Property> <Property name="mnemonic" type="int" value="72"/> <Property name="text" type="java.lang.String" value="Hapus"/> <Property name="toolTipText" type="java.lang.String" value="Alt+H"/> <Property name="name" type="java.lang.String" value="BtnHapus" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[100, 30]"/> </Property> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="BtnHapusActionPerformed"/> <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="BtnHapusKeyPressed"/> </Events> </Component> <Component class="widget.Button" name="BtnEdit"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/picture/inventaris.png"/> </Property> <Property name="mnemonic" type="int" value="71"/> <Property name="text" type="java.lang.String" value="Ganti"/> <Property name="toolTipText" type="java.lang.String" value="Alt+G"/> <Property name="name" type="java.lang.String" value="BtnEdit" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[100, 30]"/> </Property> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="BtnEditActionPerformed"/> <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="BtnEditKeyPressed"/> </Events> </Component> <Component class="widget.Button" name="BtnPrint"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/picture/b_print.png"/> </Property> <Property name="mnemonic" type="int" value="84"/> <Property name="text" type="java.lang.String" value="Cetak"/> <Property name="toolTipText" type="java.lang.String" value="Alt+T"/> <Property name="name" type="java.lang.String" value="BtnPrint" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[100, 30]"/> </Property> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="BtnPrintActionPerformed"/> <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="BtnPrintKeyPressed"/> </Events> </Component> <Component class="widget.Button" name="BtnAll"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/picture/Search-16x16.png"/> </Property> <Property name="mnemonic" type="int" value="77"/> <Property name="text" type="java.lang.String" value="Semua"/> <Property name="toolTipText" type="java.lang.String" value="Alt+M"/> <Property name="name" type="java.lang.String" value="BtnAll" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[100, 30]"/> </Property> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="BtnAllActionPerformed"/> <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="BtnAllKeyPressed"/> </Events> </Component> <Component class="widget.Button" name="BtnKeluar"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/picture/exit.png"/> </Property> <Property name="mnemonic" type="int" value="75"/> <Property name="text" type="java.lang.String" value="Keluar"/> <Property name="toolTipText" type="java.lang.String" value="Alt+K"/> <Property name="name" type="java.lang.String" value="BtnKeluar" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[100, 30]"/> </Property> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="BtnKeluarActionPerformed"/> <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="BtnKeluarKeyPressed"/> </Events> </Component> </SubComponents> </Container> <Container class="widget.panelisi" name="panelGlass9"> <Properties> <Property name="name" type="java.lang.String" value="panelGlass9" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[44, 44]"/> </Property> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> <BorderConstraints direction="First"/> </Constraint> </Constraints> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"> <Property name="alignment" type="int" value="0"/> <Property name="verticalGap" type="int" value="9"/> </Layout> <SubComponents> <Component class="widget.Label" name="jLabel6"> <Properties> <Property name="text" type="java.lang.String" value="Key Word :"/> <Property name="name" type="java.lang.String" value="jLabel6" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[70, 23]"/> </Property> </Properties> </Component> <Component class="widget.TextBox" name="TCari"> <Properties> <Property name="name" type="java.lang.String" value="TCari" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[450, 23]"/> </Property> </Properties> <Events> <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="TCariKeyPressed"/> </Events> </Component> <Component class="widget.Button" name="BtnCari"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/picture/accept.png"/> </Property> <Property name="mnemonic" type="int" value="50"/> <Property name="toolTipText" type="java.lang.String" value="Alt+2"/> <Property name="name" type="java.lang.String" value="BtnCari" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[28, 23]"/> </Property> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="BtnCariActionPerformed"/> <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="BtnCariKeyPressed"/> </Events> </Component> <Component class="widget.Label" name="jLabel7"> <Properties> <Property name="text" type="java.lang.String" value="Record :"/> <Property name="name" type="java.lang.String" value="jLabel7" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[75, 23]"/> </Property> </Properties> </Component> <Component class="widget.Label" name="LCount"> <Properties> <Property name="horizontalAlignment" type="int" value="2"/> <Property name="text" type="java.lang.String" value="0"/> <Property name="name" type="java.lang.String" value="LCount" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[80, 23]"/> </Property> </Properties> </Component> </SubComponents> </Container> </SubComponents> </Container> <Container class="widget.PanelBiasa" name="FormInput"> <Properties> <Property name="name" type="java.lang.String" value="FormInput" noResource="true"/> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Dimension value="[100, 44]"/> </Property> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> <BorderConstraints direction="First"/> </Constraint> </Constraints> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> <Property name="useNullLayout" type="boolean" value="true"/> </Layout> <SubComponents> <Component class="widget.Label" name="jLabel4"> <Properties> <Property name="text" type="java.lang.String" value="Tindakan Operasi :"/> <Property name="name" type="java.lang.String" value="jLabel4" noResource="true"/> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> <AbsoluteConstraints x="0" y="10" width="115" height="23"/> </Constraint> </Constraints> </Component> <Component class="widget.TextBox" name="kdtindakan"> <Properties> <Property name="editable" type="boolean" value="false"/> <Property name="highlighter" type="javax.swing.text.Highlighter" editor="org.netbeans.modules.form.ComponentChooserEditor"> <ComponentRef name="null"/> </Property> <Property name="name" type="java.lang.String" value="kdtindakan" noResource="true"/> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> <AbsoluteConstraints x="120" y="10" width="105" height="23"/> </Constraint> </Constraints> </Component> <Component class="widget.TextBox" name="TTindakan"> <Properties> <Property name="editable" type="boolean" value="false"/> <Property name="highlighter" type="javax.swing.text.Highlighter" editor="org.netbeans.modules.form.ComponentChooserEditor"> <ComponentRef name="null"/> </Property> <Property name="name" type="java.lang.String" value="TTindakan" noResource="true"/> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> <AbsoluteConstraints x="227" y="10" width="260" height="23"/> </Constraint> </Constraints> </Component> <Component class="widget.Button" name="btnPoliRS"> <Properties> <Property name="icon" type="javax.swing.Icon" noResource="true" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/picture/190.png"/> </Property> <Property name="mnemonic" type="int" value="49"/> <Property name="toolTipText" type="java.lang.String" value="Alt+1"/> <Property name="name" type="java.lang.String" value="btnPoliRS" noResource="true"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPoliRSActionPerformed"/> <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="btnPoliRSKeyPressed"/> </Events> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> <AbsoluteConstraints x="490" y="10" width="28" height="23"/> </Constraint> </Constraints> </Component> <Component class="widget.Label" name="jLabel19"> <Properties> <Property name="text" type="java.lang.String" value="Kode Inhealth :"/> <Property name="name" type="java.lang.String" value="jLabel19" noResource="true"/> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> <AbsoluteConstraints x="525" y="10" width="85" height="23"/> </Constraint> </Constraints> </Component> <Component class="widget.TextBox" name="KdTindakanInhealth"> <Properties> <Property name="highlighter" type="javax.swing.text.Highlighter" editor="org.netbeans.modules.form.ComponentChooserEditor"> <ComponentRef name="null"/> </Property> <Property name="name" type="java.lang.String" value="KdTindakanInhealth" noResource="true"/> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> <AbsoluteConstraints x="615" y="10" width="115" height="23"/> </Constraint> </Constraints> </Component> </SubComponents> </Container> </SubComponents> </Container> </SubComponents> </Form>
{ "pile_set_name": "Github" }
package com.alipay.api.response; import java.util.List; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; import com.alipay.api.domain.AlipayItemGoodsList; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.data.dataexchange.sfasdf response. * * @author auto create * @since 1.0, 2019-01-07 20:51:15 */ public class AlipayDataDataexchangeSfasdfResponse extends AlipayResponse { private static final long serialVersionUID = 7288273992246766417L; /** * dsfagshdj */ @ApiListField("azxfghd") @ApiField("string") private List<String> azxfghd; /** * asghdfsdas阿福故事、 */ @ApiListField("gfdhsdasafg") @ApiField("string") private List<String> gfdhsdasafg; /** * fgdhjdsfgh */ @ApiListField("gfhjfdsa") @ApiField("string") private List<String> gfhjfdsa; /** * sdfdhgjfdfsaghjfd */ @ApiListField("ghjfdsafgh") @ApiField("string") private List<String> ghjfdsafgh; /** * sadasff */ @ApiField("sdvsdv") private String sdvsdv; /** * hysasd */ @ApiListField("wrty") @ApiField("alipay_item_goods_list") private List<AlipayItemGoodsList> wrty; public void setAzxfghd(List<String> azxfghd) { this.azxfghd = azxfghd; } public List<String> getAzxfghd( ) { return this.azxfghd; } public void setGfdhsdasafg(List<String> gfdhsdasafg) { this.gfdhsdasafg = gfdhsdasafg; } public List<String> getGfdhsdasafg( ) { return this.gfdhsdasafg; } public void setGfhjfdsa(List<String> gfhjfdsa) { this.gfhjfdsa = gfhjfdsa; } public List<String> getGfhjfdsa( ) { return this.gfhjfdsa; } public void setGhjfdsafgh(List<String> ghjfdsafgh) { this.ghjfdsafgh = ghjfdsafgh; } public List<String> getGhjfdsafgh( ) { return this.ghjfdsafgh; } public void setSdvsdv(String sdvsdv) { this.sdvsdv = sdvsdv; } public String getSdvsdv( ) { return this.sdvsdv; } public void setWrty(List<AlipayItemGoodsList> wrty) { this.wrty = wrty; } public List<AlipayItemGoodsList> getWrty( ) { return this.wrty; } }
{ "pile_set_name": "Github" }
/** * * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. * * 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, see <http://www.gnu.org/licenses/>. * **/ /** * Implements the CFML Function bitshrn */ package lucee.runtime.functions.math; import lucee.runtime.PageContext; import lucee.runtime.exp.FunctionException; import lucee.runtime.ext.function.Function; public final class BitSHRN implements Function { public static double call(PageContext pc, double dnumber, double dcount) throws FunctionException { int number = (int) dnumber, count = (int) dcount; if (count > 31 || count < 0) throw new FunctionException(pc, "bitSHRN", 2, "count", "must be beetween 0 and 31 now " + count); return number >>> count; } }
{ "pile_set_name": "Github" }
.. include:: ../../roles/consul-template/README.rst
{ "pile_set_name": "Github" }
<?php namespace App\Http\Controllers\V3; use Jikan\Request\Seasonal\SeasonalRequest; use Jikan\Request\SeasonList\SeasonListRequest; class SeasonController extends Controller { private const VALID_SEASONS = [ 'summer', 'spring', 'winter', 'fall' ]; public function main(?int $year = null, ?string $season = null) { if (!is_null($season) && !\in_array(strtolower($season), self::VALID_SEASONS)) { return response()->json([ 'error' => 'Bad Request' ])->setStatusCode(400); } $season = $this->jikan->getSeasonal(new SeasonalRequest($year, $season)); return response($this->serializer->serialize($season, 'json')); } public function archive() { return response( $this->serializer->serialize( ['archive' => $this->jikan->getSeasonList(new SeasonListRequest())], 'json' ) ); } public function later() { $season = $this->jikan->getSeasonal(new SeasonalRequest(null, null, true)); return response($this->serializer->serialize($season, 'json')); } }
{ "pile_set_name": "Github" }
plan(21); class IsThisType { } class IsntThisType { } class TypeCheckTestHOW { has int $!type_check_called; method new_type() { nqp::newtype(self, 'P6opaque'); } method type_check($obj, $type) { $!type_check_called := $!type_check_called + 1; return 0 if nqp::eqaddr($type, IsntThisType); return 1 if nqp::eqaddr($type, IsThisType); ok(0, "unexpected argument passed to type_check"); } method type_check_called() { $!type_check_called; } } my $no_cache := TypeCheckTestHOW.new.new_type; ok(nqp::istype($no_cache, IsThisType), 'nqp::istype with no type check cache (+)'); ok(!nqp::istype($no_cache, IsntThisType), 'nqp::istype with no type check cache (-)'); is($no_cache.HOW.type_check_called, 2, "called type_check twice"); my $default := TypeCheckTestHOW.new.new_type; nqp::settypecache($default, nqp::list(IsThisType)); ok(nqp::istype($default, IsThisType), 'nqp::istype with cache and default mode (+)'); ok(!nqp::istype($default, IsntThisType), 'nqp::istype with cache and defaullt mode (-)'); is($default.HOW.type_check_called, 0, "didn't call type_check"); my $definitive := TypeCheckTestHOW.new.new_type; nqp::settypecache($definitive, nqp::list(IsThisType)); nqp::settypecheckmode($definitive, nqp::const::TYPE_CHECK_CACHE_DEFINITIVE); ok(nqp::istype($definitive, IsThisType), 'TYPE_CHECK_CACHE_DEFINITIVE istype (+)'); ok(!nqp::istype($definitive, IsntThisType), 'TYPE_CHECK_CACHE_DEFINITIVE istype (-)'); ok(!$definitive.HOW.type_check_called, "TYPE_CHECK_CACHE_DEFINITIVE didn't call type_check"); class TypeCheckConstant { has $!value; method new_type() { nqp::newtype(self, 'P6opaque'); } method type_check($obj, $type) { $!value; } } my $got_accepts_type_type; my $got_accepts_type_obj; class AcceptingType { has int $!accepts_type_called; has $!accepts; method accepts_type_called() { $!accepts_type_called; } method accepts_type($type, $obj) { $got_accepts_type_type := $type; $got_accepts_type_obj := $obj; $!accepts_type_called := $!accepts_type_called + 1; $!accepts; } method new_type() { nqp::newtype(self, 'P6opaque'); } } my $type_check_false := TypeCheckConstant.new(value => 0).new_type; my $type_check_true := TypeCheckConstant.new(value => 1).new_type; my $accepts_true := AcceptingType.new(accepts => 1).new_type; my $accepts_false := AcceptingType.new(accepts => 0).new_type; my $accepts_not_called := AcceptingType.new(accepts => 0).new_type; nqp::settypecheckmode($accepts_true, nqp::const::TYPE_CHECK_NEEDS_ACCEPTS); nqp::settypecheckmode($accepts_false, nqp::const::TYPE_CHECK_NEEDS_ACCEPTS); nqp::settypecheckmode($accepts_not_called, nqp::const::TYPE_CHECK_NEEDS_ACCEPTS); $got_accepts_type_obj := NQPMu; $got_accepts_type_type := NQPMu; ok(nqp::istype($type_check_false, $accepts_true), 'nqp::const::TYPE_CHECK_NEEDS_ACCEPTS: istype (+)'); ok(nqp::eqaddr($got_accepts_type_obj, $type_check_false), 'accepts_type got correct obj'); ok(nqp::eqaddr($got_accepts_type_type, $accepts_true), 'accepts_type got correct type'); $got_accepts_type_obj := NQPMu; $got_accepts_type_type := NQPMu; ok(!nqp::istype($type_check_false, $accepts_false), 'nqp::const::TYPE_CHECK_NEEDS_ACCEPTS: istype (-)'); ok(nqp::eqaddr($got_accepts_type_obj, $type_check_false), 'accepts_type got correct obj'); ok(nqp::eqaddr($got_accepts_type_type, $accepts_false), 'accepts_type got correct type'); my $not_really_accepting_type := AcceptingType.new(accepts => 1).new_type; nqp::settypecheckmode($not_really_accepting_type, nqp::const::TYPE_CHECK_CACHE_DEFINITIVE); ok(!nqp::istype($type_check_false, $not_really_accepting_type), "other flags don't count as nqp::const::TYPE_CHECK_NEEDS_ACCEPTS"); ok(nqp::istype($type_check_true, $accepts_not_called), 'nqp::const::TYPE_CHECK_NEEDS_ACCEPTS: istype where type_check is true'); is($accepts_not_called.HOW.accepts_type_called, 0, '...accept_type is not used'); my $type_check_false_with_cache := TypeCheckConstant.new(value => 0).new_type; nqp::settypecache($type_check_false_with_cache, nqp::list($accepts_not_called)); ok(nqp::istype($type_check_false_with_cache, $accepts_true), 'nqp::const::TYPE_CHECK_NEEDS_ACCEPTS: istype when the type is not in cache but accepts return true'); ok(nqp::istype($type_check_false_with_cache, $accepts_not_called), 'nqp::const::TYPE_CHECK_NEEDS_ACCEPTS: istype when the type is in cache'); is($accepts_not_called.HOW.accepts_type_called, 0, '...accept_type is not called');
{ "pile_set_name": "Github" }
FILE(GLOB LOCAL_SRC_FILES *.cpp) FILE(GLOB LOCAL_INC_FILES *.h) SET(SRC_FILES ${SRC_FILES} ${LOCAL_SRC_FILES} PARENT_SCOPE) SET(INC_FILES ${INC_FILES} ${LOCAL_INC_FILES} PARENT_SCOPE)
{ "pile_set_name": "Github" }
/* * drivers/s390/cio/device_fsm.c * finite state machine for device handling * * Copyright IBM Corp. 2002,2008 * Author(s): Cornelia Huck ([email protected]) * Martin Schwidefsky ([email protected]) */ #include <linux/module.h> #include <linux/init.h> #include <linux/jiffies.h> #include <linux/string.h> #include <asm/ccwdev.h> #include <asm/cio.h> #include <asm/chpid.h> #include "cio.h" #include "cio_debug.h" #include "css.h" #include "device.h" #include "chsc.h" #include "ioasm.h" #include "chp.h" static int timeout_log_enabled; static int __init ccw_timeout_log_setup(char *unused) { timeout_log_enabled = 1; return 1; } __setup("ccw_timeout_log", ccw_timeout_log_setup); static void ccw_timeout_log(struct ccw_device *cdev) { struct schib schib; struct subchannel *sch; struct io_subchannel_private *private; union orb *orb; int cc; sch = to_subchannel(cdev->dev.parent); private = to_io_private(sch); orb = &private->orb; cc = stsch_err(sch->schid, &schib); printk(KERN_WARNING "cio: ccw device timeout occurred at %llx, " "device information:\n", get_clock()); printk(KERN_WARNING "cio: orb:\n"); print_hex_dump(KERN_WARNING, "cio: ", DUMP_PREFIX_NONE, 16, 1, orb, sizeof(*orb), 0); printk(KERN_WARNING "cio: ccw device bus id: %s\n", dev_name(&cdev->dev)); printk(KERN_WARNING "cio: subchannel bus id: %s\n", dev_name(&sch->dev)); printk(KERN_WARNING "cio: subchannel lpm: %02x, opm: %02x, " "vpm: %02x\n", sch->lpm, sch->opm, sch->vpm); if (orb->tm.b) { printk(KERN_WARNING "cio: orb indicates transport mode\n"); printk(KERN_WARNING "cio: last tcw:\n"); print_hex_dump(KERN_WARNING, "cio: ", DUMP_PREFIX_NONE, 16, 1, (void *)(addr_t)orb->tm.tcw, sizeof(struct tcw), 0); } else { printk(KERN_WARNING "cio: orb indicates command mode\n"); if ((void *)(addr_t)orb->cmd.cpa == &private->sense_ccw || (void *)(addr_t)orb->cmd.cpa == cdev->private->iccws) printk(KERN_WARNING "cio: last channel program " "(intern):\n"); else printk(KERN_WARNING "cio: last channel program:\n"); print_hex_dump(KERN_WARNING, "cio: ", DUMP_PREFIX_NONE, 16, 1, (void *)(addr_t)orb->cmd.cpa, sizeof(struct ccw1), 0); } printk(KERN_WARNING "cio: ccw device state: %d\n", cdev->private->state); printk(KERN_WARNING "cio: store subchannel returned: cc=%d\n", cc); printk(KERN_WARNING "cio: schib:\n"); print_hex_dump(KERN_WARNING, "cio: ", DUMP_PREFIX_NONE, 16, 1, &schib, sizeof(schib), 0); printk(KERN_WARNING "cio: ccw device flags:\n"); print_hex_dump(KERN_WARNING, "cio: ", DUMP_PREFIX_NONE, 16, 1, &cdev->private->flags, sizeof(cdev->private->flags), 0); } /* * Timeout function. It just triggers a DEV_EVENT_TIMEOUT. */ static void ccw_device_timeout(unsigned long data) { struct ccw_device *cdev; cdev = (struct ccw_device *) data; spin_lock_irq(cdev->ccwlock); if (timeout_log_enabled) ccw_timeout_log(cdev); dev_fsm_event(cdev, DEV_EVENT_TIMEOUT); spin_unlock_irq(cdev->ccwlock); } /* * Set timeout */ void ccw_device_set_timeout(struct ccw_device *cdev, int expires) { if (expires == 0) { del_timer(&cdev->private->timer); return; } if (timer_pending(&cdev->private->timer)) { if (mod_timer(&cdev->private->timer, jiffies + expires)) return; } cdev->private->timer.function = ccw_device_timeout; cdev->private->timer.data = (unsigned long) cdev; cdev->private->timer.expires = jiffies + expires; add_timer(&cdev->private->timer); } /* * Cancel running i/o. This is called repeatedly since halt/clear are * asynchronous operations. We do one try with cio_cancel, two tries * with cio_halt, 255 tries with cio_clear. If everythings fails panic. * Returns 0 if device now idle, -ENODEV for device not operational and * -EBUSY if an interrupt is expected (either from halt/clear or from a * status pending). */ int ccw_device_cancel_halt_clear(struct ccw_device *cdev) { struct subchannel *sch; int ret; sch = to_subchannel(cdev->dev.parent); if (cio_update_schib(sch)) return -ENODEV; if (!sch->schib.pmcw.ena) /* Not operational -> done. */ return 0; /* Stage 1: cancel io. */ if (!(scsw_actl(&sch->schib.scsw) & SCSW_ACTL_HALT_PEND) && !(scsw_actl(&sch->schib.scsw) & SCSW_ACTL_CLEAR_PEND)) { if (!scsw_is_tm(&sch->schib.scsw)) { ret = cio_cancel(sch); if (ret != -EINVAL) return ret; } /* cancel io unsuccessful or not applicable (transport mode). * Continue with asynchronous instructions. */ cdev->private->iretry = 3; /* 3 halt retries. */ } if (!(scsw_actl(&sch->schib.scsw) & SCSW_ACTL_CLEAR_PEND)) { /* Stage 2: halt io. */ if (cdev->private->iretry) { cdev->private->iretry--; ret = cio_halt(sch); if (ret != -EBUSY) return (ret == 0) ? -EBUSY : ret; } /* halt io unsuccessful. */ cdev->private->iretry = 255; /* 255 clear retries. */ } /* Stage 3: clear io. */ if (cdev->private->iretry) { cdev->private->iretry--; ret = cio_clear (sch); return (ret == 0) ? -EBUSY : ret; } /* Function was unsuccessful */ CIO_MSG_EVENT(0, "0.%x.%04x: could not stop I/O\n", cdev->private->dev_id.ssid, cdev->private->dev_id.devno); return -EIO; } void ccw_device_update_sense_data(struct ccw_device *cdev) { memset(&cdev->id, 0, sizeof(cdev->id)); cdev->id.cu_type = cdev->private->senseid.cu_type; cdev->id.cu_model = cdev->private->senseid.cu_model; cdev->id.dev_type = cdev->private->senseid.dev_type; cdev->id.dev_model = cdev->private->senseid.dev_model; } int ccw_device_test_sense_data(struct ccw_device *cdev) { return cdev->id.cu_type == cdev->private->senseid.cu_type && cdev->id.cu_model == cdev->private->senseid.cu_model && cdev->id.dev_type == cdev->private->senseid.dev_type && cdev->id.dev_model == cdev->private->senseid.dev_model; } /* * The machine won't give us any notification by machine check if a chpid has * been varied online on the SE so we have to find out by magic (i. e. driving * the channel subsystem to device selection and updating our path masks). */ static void __recover_lost_chpids(struct subchannel *sch, int old_lpm) { int mask, i; struct chp_id chpid; chp_id_init(&chpid); for (i = 0; i<8; i++) { mask = 0x80 >> i; if (!(sch->lpm & mask)) continue; if (old_lpm & mask) continue; chpid.id = sch->schib.pmcw.chpid[i]; if (!chp_is_registered(chpid)) css_schedule_eval_all(); } } /* * Stop device recognition. */ static void ccw_device_recog_done(struct ccw_device *cdev, int state) { struct subchannel *sch; int old_lpm; sch = to_subchannel(cdev->dev.parent); if (cio_disable_subchannel(sch)) state = DEV_STATE_NOT_OPER; /* * Now that we tried recognition, we have performed device selection * through ssch() and the path information is up to date. */ old_lpm = sch->lpm; /* Check since device may again have become not operational. */ if (cio_update_schib(sch)) state = DEV_STATE_NOT_OPER; else sch->lpm = sch->schib.pmcw.pam & sch->opm; if (cdev->private->state == DEV_STATE_DISCONNECTED_SENSE_ID) /* Force reprobe on all chpids. */ old_lpm = 0; if (sch->lpm != old_lpm) __recover_lost_chpids(sch, old_lpm); if (cdev->private->state == DEV_STATE_DISCONNECTED_SENSE_ID && (state == DEV_STATE_NOT_OPER || state == DEV_STATE_BOXED)) { cdev->private->flags.recog_done = 1; cdev->private->state = DEV_STATE_DISCONNECTED; wake_up(&cdev->private->wait_q); return; } if (cdev->private->flags.resuming) { cdev->private->state = state; cdev->private->flags.recog_done = 1; wake_up(&cdev->private->wait_q); return; } switch (state) { case DEV_STATE_NOT_OPER: break; case DEV_STATE_OFFLINE: if (!cdev->online) { ccw_device_update_sense_data(cdev); break; } cdev->private->state = DEV_STATE_OFFLINE; cdev->private->flags.recog_done = 1; if (ccw_device_test_sense_data(cdev)) { cdev->private->flags.donotify = 1; ccw_device_online(cdev); wake_up(&cdev->private->wait_q); } else { ccw_device_update_sense_data(cdev); ccw_device_sched_todo(cdev, CDEV_TODO_REBIND); } return; case DEV_STATE_BOXED: if (cdev->id.cu_type != 0) { /* device was recognized before */ cdev->private->flags.recog_done = 1; cdev->private->state = DEV_STATE_BOXED; wake_up(&cdev->private->wait_q); return; } break; } cdev->private->state = state; io_subchannel_recog_done(cdev); wake_up(&cdev->private->wait_q); } /* * Function called from device_id.c after sense id has completed. */ void ccw_device_sense_id_done(struct ccw_device *cdev, int err) { switch (err) { case 0: ccw_device_recog_done(cdev, DEV_STATE_OFFLINE); break; case -ETIME: /* Sense id stopped by timeout. */ ccw_device_recog_done(cdev, DEV_STATE_BOXED); break; default: ccw_device_recog_done(cdev, DEV_STATE_NOT_OPER); break; } } /** * ccw_device_notify() - inform the device's driver about an event * @cdev: device for which an event occurred * @event: event that occurred * * Returns: * -%EINVAL if the device is offline or has no driver. * -%EOPNOTSUPP if the device's driver has no notifier registered. * %NOTIFY_OK if the driver wants to keep the device. * %NOTIFY_BAD if the driver doesn't want to keep the device. */ int ccw_device_notify(struct ccw_device *cdev, int event) { int ret = -EINVAL; if (!cdev->drv) goto out; if (!cdev->online) goto out; CIO_MSG_EVENT(2, "notify called for 0.%x.%04x, event=%d\n", cdev->private->dev_id.ssid, cdev->private->dev_id.devno, event); if (!cdev->drv->notify) { ret = -EOPNOTSUPP; goto out; } if (cdev->drv->notify(cdev, event)) ret = NOTIFY_OK; else ret = NOTIFY_BAD; out: return ret; } static void ccw_device_oper_notify(struct ccw_device *cdev) { struct subchannel *sch = to_subchannel(cdev->dev.parent); if (ccw_device_notify(cdev, CIO_OPER) == NOTIFY_OK) { /* Reenable channel measurements, if needed. */ ccw_device_sched_todo(cdev, CDEV_TODO_ENABLE_CMF); /* Save indication for new paths. */ cdev->private->path_new_mask = sch->vpm; return; } /* Driver doesn't want device back. */ ccw_device_set_notoper(cdev); ccw_device_sched_todo(cdev, CDEV_TODO_REBIND); } /* * Finished with online/offline processing. */ static void ccw_device_done(struct ccw_device *cdev, int state) { struct subchannel *sch; sch = to_subchannel(cdev->dev.parent); ccw_device_set_timeout(cdev, 0); if (state != DEV_STATE_ONLINE) cio_disable_subchannel(sch); /* Reset device status. */ memset(&cdev->private->irb, 0, sizeof(struct irb)); cdev->private->state = state; switch (state) { case DEV_STATE_BOXED: CIO_MSG_EVENT(0, "Boxed device %04x on subchannel %04x\n", cdev->private->dev_id.devno, sch->schid.sch_no); if (cdev->online && ccw_device_notify(cdev, CIO_BOXED) != NOTIFY_OK) ccw_device_sched_todo(cdev, CDEV_TODO_UNREG); cdev->private->flags.donotify = 0; break; case DEV_STATE_NOT_OPER: CIO_MSG_EVENT(0, "Device %04x gone on subchannel %04x\n", cdev->private->dev_id.devno, sch->schid.sch_no); if (ccw_device_notify(cdev, CIO_GONE) != NOTIFY_OK) ccw_device_sched_todo(cdev, CDEV_TODO_UNREG); else ccw_device_set_disconnected(cdev); cdev->private->flags.donotify = 0; break; case DEV_STATE_DISCONNECTED: CIO_MSG_EVENT(0, "Disconnected device %04x on subchannel " "%04x\n", cdev->private->dev_id.devno, sch->schid.sch_no); if (ccw_device_notify(cdev, CIO_NO_PATH) != NOTIFY_OK) { cdev->private->state = DEV_STATE_NOT_OPER; ccw_device_sched_todo(cdev, CDEV_TODO_UNREG); } else ccw_device_set_disconnected(cdev); cdev->private->flags.donotify = 0; break; default: break; } if (cdev->private->flags.donotify) { cdev->private->flags.donotify = 0; ccw_device_oper_notify(cdev); } wake_up(&cdev->private->wait_q); } /* * Start device recognition. */ void ccw_device_recognition(struct ccw_device *cdev) { struct subchannel *sch = to_subchannel(cdev->dev.parent); /* * We used to start here with a sense pgid to find out whether a device * is locked by someone else. Unfortunately, the sense pgid command * code has other meanings on devices predating the path grouping * algorithm, so we start with sense id and box the device after an * timeout (or if sense pgid during path verification detects the device * is locked, as may happen on newer devices). */ cdev->private->flags.recog_done = 0; cdev->private->state = DEV_STATE_SENSE_ID; if (cio_enable_subchannel(sch, (u32) (addr_t) sch)) { ccw_device_recog_done(cdev, DEV_STATE_NOT_OPER); return; } ccw_device_sense_id_start(cdev); } /* * Handle events for states that use the ccw request infrastructure. */ static void ccw_device_request_event(struct ccw_device *cdev, enum dev_event e) { switch (e) { case DEV_EVENT_NOTOPER: ccw_request_notoper(cdev); break; case DEV_EVENT_INTERRUPT: ccw_request_handler(cdev); break; case DEV_EVENT_TIMEOUT: ccw_request_timeout(cdev); break; default: break; } } static void ccw_device_report_path_events(struct ccw_device *cdev) { struct subchannel *sch = to_subchannel(cdev->dev.parent); int path_event[8]; int chp, mask; for (chp = 0, mask = 0x80; chp < 8; chp++, mask >>= 1) { path_event[chp] = PE_NONE; if (mask & cdev->private->path_gone_mask & ~(sch->vpm)) path_event[chp] |= PE_PATH_GONE; if (mask & cdev->private->path_new_mask & sch->vpm) path_event[chp] |= PE_PATH_AVAILABLE; if (mask & cdev->private->pgid_reset_mask & sch->vpm) path_event[chp] |= PE_PATHGROUP_ESTABLISHED; } if (cdev->online && cdev->drv->path_event) cdev->drv->path_event(cdev, path_event); } static void ccw_device_reset_path_events(struct ccw_device *cdev) { cdev->private->path_gone_mask = 0; cdev->private->path_new_mask = 0; cdev->private->pgid_reset_mask = 0; } static void create_fake_irb(struct irb *irb, int type) { memset(irb, 0, sizeof(*irb)); if (type == FAKE_CMD_IRB) { struct cmd_scsw *scsw = &irb->scsw.cmd; scsw->cc = 1; scsw->fctl = SCSW_FCTL_START_FUNC; scsw->actl = SCSW_ACTL_START_PEND; scsw->stctl = SCSW_STCTL_STATUS_PEND; } else if (type == FAKE_TM_IRB) { struct tm_scsw *scsw = &irb->scsw.tm; scsw->x = 1; scsw->cc = 1; scsw->fctl = SCSW_FCTL_START_FUNC; scsw->actl = SCSW_ACTL_START_PEND; scsw->stctl = SCSW_STCTL_STATUS_PEND; } } void ccw_device_verify_done(struct ccw_device *cdev, int err) { struct subchannel *sch; sch = to_subchannel(cdev->dev.parent); /* Update schib - pom may have changed. */ if (cio_update_schib(sch)) { err = -ENODEV; goto callback; } /* Update lpm with verified path mask. */ sch->lpm = sch->vpm; /* Repeat path verification? */ if (cdev->private->flags.doverify) { ccw_device_verify_start(cdev); return; } callback: switch (err) { case 0: ccw_device_done(cdev, DEV_STATE_ONLINE); /* Deliver fake irb to device driver, if needed. */ if (cdev->private->flags.fake_irb) { create_fake_irb(&cdev->private->irb, cdev->private->flags.fake_irb); cdev->private->flags.fake_irb = 0; if (cdev->handler) cdev->handler(cdev, cdev->private->intparm, &cdev->private->irb); memset(&cdev->private->irb, 0, sizeof(struct irb)); } ccw_device_report_path_events(cdev); break; case -ETIME: case -EUSERS: /* Reset oper notify indication after verify error. */ cdev->private->flags.donotify = 0; ccw_device_done(cdev, DEV_STATE_BOXED); break; case -EACCES: /* Reset oper notify indication after verify error. */ cdev->private->flags.donotify = 0; ccw_device_done(cdev, DEV_STATE_DISCONNECTED); break; default: /* Reset oper notify indication after verify error. */ cdev->private->flags.donotify = 0; ccw_device_done(cdev, DEV_STATE_NOT_OPER); break; } ccw_device_reset_path_events(cdev); } /* * Get device online. */ int ccw_device_online(struct ccw_device *cdev) { struct subchannel *sch; int ret; if ((cdev->private->state != DEV_STATE_OFFLINE) && (cdev->private->state != DEV_STATE_BOXED)) return -EINVAL; sch = to_subchannel(cdev->dev.parent); ret = cio_enable_subchannel(sch, (u32)(addr_t)sch); if (ret != 0) { /* Couldn't enable the subchannel for i/o. Sick device. */ if (ret == -ENODEV) dev_fsm_event(cdev, DEV_EVENT_NOTOPER); return ret; } /* Start initial path verification. */ cdev->private->state = DEV_STATE_VERIFY; ccw_device_verify_start(cdev); return 0; } void ccw_device_disband_done(struct ccw_device *cdev, int err) { switch (err) { case 0: ccw_device_done(cdev, DEV_STATE_OFFLINE); break; case -ETIME: ccw_device_done(cdev, DEV_STATE_BOXED); break; default: cdev->private->flags.donotify = 0; ccw_device_done(cdev, DEV_STATE_NOT_OPER); break; } } /* * Shutdown device. */ int ccw_device_offline(struct ccw_device *cdev) { struct subchannel *sch; /* Allow ccw_device_offline while disconnected. */ if (cdev->private->state == DEV_STATE_DISCONNECTED || cdev->private->state == DEV_STATE_NOT_OPER) { cdev->private->flags.donotify = 0; ccw_device_done(cdev, DEV_STATE_NOT_OPER); return 0; } if (cdev->private->state == DEV_STATE_BOXED) { ccw_device_done(cdev, DEV_STATE_BOXED); return 0; } if (ccw_device_is_orphan(cdev)) { ccw_device_done(cdev, DEV_STATE_OFFLINE); return 0; } sch = to_subchannel(cdev->dev.parent); if (cio_update_schib(sch)) return -ENODEV; if (scsw_actl(&sch->schib.scsw) != 0) return -EBUSY; if (cdev->private->state != DEV_STATE_ONLINE) return -EINVAL; /* Are we doing path grouping? */ if (!cdev->private->flags.pgroup) { /* No, set state offline immediately. */ ccw_device_done(cdev, DEV_STATE_OFFLINE); return 0; } /* Start Set Path Group commands. */ cdev->private->state = DEV_STATE_DISBAND_PGID; ccw_device_disband_start(cdev); return 0; } /* * Handle not operational event in non-special state. */ static void ccw_device_generic_notoper(struct ccw_device *cdev, enum dev_event dev_event) { if (ccw_device_notify(cdev, CIO_GONE) != NOTIFY_OK) ccw_device_sched_todo(cdev, CDEV_TODO_UNREG); else ccw_device_set_disconnected(cdev); } /* * Handle path verification event in offline state. */ static void ccw_device_offline_verify(struct ccw_device *cdev, enum dev_event dev_event) { struct subchannel *sch = to_subchannel(cdev->dev.parent); css_schedule_eval(sch->schid); } /* * Handle path verification event. */ static void ccw_device_online_verify(struct ccw_device *cdev, enum dev_event dev_event) { struct subchannel *sch; if (cdev->private->state == DEV_STATE_W4SENSE) { cdev->private->flags.doverify = 1; return; } sch = to_subchannel(cdev->dev.parent); /* * Since we might not just be coming from an interrupt from the * subchannel we have to update the schib. */ if (cio_update_schib(sch)) { ccw_device_verify_done(cdev, -ENODEV); return; } if (scsw_actl(&sch->schib.scsw) != 0 || (scsw_stctl(&sch->schib.scsw) & SCSW_STCTL_STATUS_PEND) || (scsw_stctl(&cdev->private->irb.scsw) & SCSW_STCTL_STATUS_PEND)) { /* * No final status yet or final status not yet delivered * to the device driver. Can't do path verification now, * delay until final status was delivered. */ cdev->private->flags.doverify = 1; return; } /* Device is idle, we can do the path verification. */ cdev->private->state = DEV_STATE_VERIFY; ccw_device_verify_start(cdev); } /* * Handle path verification event in boxed state. */ static void ccw_device_boxed_verify(struct ccw_device *cdev, enum dev_event dev_event) { struct subchannel *sch = to_subchannel(cdev->dev.parent); if (cdev->online) { if (cio_enable_subchannel(sch, (u32) (addr_t) sch)) ccw_device_done(cdev, DEV_STATE_NOT_OPER); else ccw_device_online_verify(cdev, dev_event); } else css_schedule_eval(sch->schid); } /* * Got an interrupt for a normal io (state online). */ static void ccw_device_irq(struct ccw_device *cdev, enum dev_event dev_event) { struct irb *irb; int is_cmd; irb = (struct irb *)&S390_lowcore.irb; is_cmd = !scsw_is_tm(&irb->scsw); /* Check for unsolicited interrupt. */ if (!scsw_is_solicited(&irb->scsw)) { if (is_cmd && (irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) && !irb->esw.esw0.erw.cons) { /* Unit check but no sense data. Need basic sense. */ if (ccw_device_do_sense(cdev, irb) != 0) goto call_handler_unsol; memcpy(&cdev->private->irb, irb, sizeof(struct irb)); cdev->private->state = DEV_STATE_W4SENSE; cdev->private->intparm = 0; return; } call_handler_unsol: if (cdev->handler) cdev->handler (cdev, 0, irb); if (cdev->private->flags.doverify) ccw_device_online_verify(cdev, 0); return; } /* Accumulate status and find out if a basic sense is needed. */ ccw_device_accumulate_irb(cdev, irb); if (is_cmd && cdev->private->flags.dosense) { if (ccw_device_do_sense(cdev, irb) == 0) { cdev->private->state = DEV_STATE_W4SENSE; } return; } /* Call the handler. */ if (ccw_device_call_handler(cdev) && cdev->private->flags.doverify) /* Start delayed path verification. */ ccw_device_online_verify(cdev, 0); } /* * Got an timeout in online state. */ static void ccw_device_online_timeout(struct ccw_device *cdev, enum dev_event dev_event) { int ret; ccw_device_set_timeout(cdev, 0); cdev->private->iretry = 255; ret = ccw_device_cancel_halt_clear(cdev); if (ret == -EBUSY) { ccw_device_set_timeout(cdev, 3*HZ); cdev->private->state = DEV_STATE_TIMEOUT_KILL; return; } if (ret) dev_fsm_event(cdev, DEV_EVENT_NOTOPER); else if (cdev->handler) cdev->handler(cdev, cdev->private->intparm, ERR_PTR(-ETIMEDOUT)); } /* * Got an interrupt for a basic sense. */ static void ccw_device_w4sense(struct ccw_device *cdev, enum dev_event dev_event) { struct irb *irb; irb = (struct irb *)&S390_lowcore.irb; /* Check for unsolicited interrupt. */ if (scsw_stctl(&irb->scsw) == (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) { if (scsw_cc(&irb->scsw) == 1) /* Basic sense hasn't started. Try again. */ ccw_device_do_sense(cdev, irb); else { CIO_MSG_EVENT(0, "0.%x.%04x: unsolicited " "interrupt during w4sense...\n", cdev->private->dev_id.ssid, cdev->private->dev_id.devno); if (cdev->handler) cdev->handler (cdev, 0, irb); } return; } /* * Check if a halt or clear has been issued in the meanwhile. If yes, * only deliver the halt/clear interrupt to the device driver as if it * had killed the original request. */ if (scsw_fctl(&irb->scsw) & (SCSW_FCTL_CLEAR_FUNC | SCSW_FCTL_HALT_FUNC)) { cdev->private->flags.dosense = 0; memset(&cdev->private->irb, 0, sizeof(struct irb)); ccw_device_accumulate_irb(cdev, irb); goto call_handler; } /* Add basic sense info to irb. */ ccw_device_accumulate_basic_sense(cdev, irb); if (cdev->private->flags.dosense) { /* Another basic sense is needed. */ ccw_device_do_sense(cdev, irb); return; } call_handler: cdev->private->state = DEV_STATE_ONLINE; /* In case sensing interfered with setting the device online */ wake_up(&cdev->private->wait_q); /* Call the handler. */ if (ccw_device_call_handler(cdev) && cdev->private->flags.doverify) /* Start delayed path verification. */ ccw_device_online_verify(cdev, 0); } static void ccw_device_killing_irq(struct ccw_device *cdev, enum dev_event dev_event) { ccw_device_set_timeout(cdev, 0); /* Start delayed path verification. */ ccw_device_online_verify(cdev, 0); /* OK, i/o is dead now. Call interrupt handler. */ if (cdev->handler) cdev->handler(cdev, cdev->private->intparm, ERR_PTR(-EIO)); } static void ccw_device_killing_timeout(struct ccw_device *cdev, enum dev_event dev_event) { int ret; ret = ccw_device_cancel_halt_clear(cdev); if (ret == -EBUSY) { ccw_device_set_timeout(cdev, 3*HZ); return; } /* Start delayed path verification. */ ccw_device_online_verify(cdev, 0); if (cdev->handler) cdev->handler(cdev, cdev->private->intparm, ERR_PTR(-EIO)); } void ccw_device_kill_io(struct ccw_device *cdev) { int ret; cdev->private->iretry = 255; ret = ccw_device_cancel_halt_clear(cdev); if (ret == -EBUSY) { ccw_device_set_timeout(cdev, 3*HZ); cdev->private->state = DEV_STATE_TIMEOUT_KILL; return; } /* Start delayed path verification. */ ccw_device_online_verify(cdev, 0); if (cdev->handler) cdev->handler(cdev, cdev->private->intparm, ERR_PTR(-EIO)); } static void ccw_device_delay_verify(struct ccw_device *cdev, enum dev_event dev_event) { /* Start verification after current task finished. */ cdev->private->flags.doverify = 1; } static void ccw_device_start_id(struct ccw_device *cdev, enum dev_event dev_event) { struct subchannel *sch; sch = to_subchannel(cdev->dev.parent); if (cio_enable_subchannel(sch, (u32)(addr_t)sch) != 0) /* Couldn't enable the subchannel for i/o. Sick device. */ return; cdev->private->state = DEV_STATE_DISCONNECTED_SENSE_ID; ccw_device_sense_id_start(cdev); } void ccw_device_trigger_reprobe(struct ccw_device *cdev) { struct subchannel *sch; if (cdev->private->state != DEV_STATE_DISCONNECTED) return; sch = to_subchannel(cdev->dev.parent); /* Update some values. */ if (cio_update_schib(sch)) return; /* * The pim, pam, pom values may not be accurate, but they are the best * we have before performing device selection :/ */ sch->lpm = sch->schib.pmcw.pam & sch->opm; /* * Use the initial configuration since we can't be shure that the old * paths are valid. */ io_subchannel_init_config(sch); if (cio_commit_config(sch)) return; /* We should also udate ssd info, but this has to wait. */ /* Check if this is another device which appeared on the same sch. */ if (sch->schib.pmcw.dev != cdev->private->dev_id.devno) css_schedule_eval(sch->schid); else ccw_device_start_id(cdev, 0); } static void ccw_device_disabled_irq(struct ccw_device *cdev, enum dev_event dev_event) { struct subchannel *sch; sch = to_subchannel(cdev->dev.parent); /* * An interrupt in a disabled state means a previous disable was not * successful - should not happen, but we try to disable again. */ cio_disable_subchannel(sch); } static void ccw_device_change_cmfstate(struct ccw_device *cdev, enum dev_event dev_event) { retry_set_schib(cdev); cdev->private->state = DEV_STATE_ONLINE; dev_fsm_event(cdev, dev_event); } static void ccw_device_update_cmfblock(struct ccw_device *cdev, enum dev_event dev_event) { cmf_retry_copy_block(cdev); cdev->private->state = DEV_STATE_ONLINE; dev_fsm_event(cdev, dev_event); } static void ccw_device_quiesce_done(struct ccw_device *cdev, enum dev_event dev_event) { ccw_device_set_timeout(cdev, 0); cdev->private->state = DEV_STATE_NOT_OPER; wake_up(&cdev->private->wait_q); } static void ccw_device_quiesce_timeout(struct ccw_device *cdev, enum dev_event dev_event) { int ret; ret = ccw_device_cancel_halt_clear(cdev); if (ret == -EBUSY) { ccw_device_set_timeout(cdev, HZ/10); } else { cdev->private->state = DEV_STATE_NOT_OPER; wake_up(&cdev->private->wait_q); } } /* * No operation action. This is used e.g. to ignore a timeout event in * state offline. */ static void ccw_device_nop(struct ccw_device *cdev, enum dev_event dev_event) { } /* * device statemachine */ fsm_func_t *dev_jumptable[NR_DEV_STATES][NR_DEV_EVENTS] = { [DEV_STATE_NOT_OPER] = { [DEV_EVENT_NOTOPER] = ccw_device_nop, [DEV_EVENT_INTERRUPT] = ccw_device_disabled_irq, [DEV_EVENT_TIMEOUT] = ccw_device_nop, [DEV_EVENT_VERIFY] = ccw_device_nop, }, [DEV_STATE_SENSE_PGID] = { [DEV_EVENT_NOTOPER] = ccw_device_request_event, [DEV_EVENT_INTERRUPT] = ccw_device_request_event, [DEV_EVENT_TIMEOUT] = ccw_device_request_event, [DEV_EVENT_VERIFY] = ccw_device_nop, }, [DEV_STATE_SENSE_ID] = { [DEV_EVENT_NOTOPER] = ccw_device_request_event, [DEV_EVENT_INTERRUPT] = ccw_device_request_event, [DEV_EVENT_TIMEOUT] = ccw_device_request_event, [DEV_EVENT_VERIFY] = ccw_device_nop, }, [DEV_STATE_OFFLINE] = { [DEV_EVENT_NOTOPER] = ccw_device_generic_notoper, [DEV_EVENT_INTERRUPT] = ccw_device_disabled_irq, [DEV_EVENT_TIMEOUT] = ccw_device_nop, [DEV_EVENT_VERIFY] = ccw_device_offline_verify, }, [DEV_STATE_VERIFY] = { [DEV_EVENT_NOTOPER] = ccw_device_request_event, [DEV_EVENT_INTERRUPT] = ccw_device_request_event, [DEV_EVENT_TIMEOUT] = ccw_device_request_event, [DEV_EVENT_VERIFY] = ccw_device_delay_verify, }, [DEV_STATE_ONLINE] = { [DEV_EVENT_NOTOPER] = ccw_device_generic_notoper, [DEV_EVENT_INTERRUPT] = ccw_device_irq, [DEV_EVENT_TIMEOUT] = ccw_device_online_timeout, [DEV_EVENT_VERIFY] = ccw_device_online_verify, }, [DEV_STATE_W4SENSE] = { [DEV_EVENT_NOTOPER] = ccw_device_generic_notoper, [DEV_EVENT_INTERRUPT] = ccw_device_w4sense, [DEV_EVENT_TIMEOUT] = ccw_device_nop, [DEV_EVENT_VERIFY] = ccw_device_online_verify, }, [DEV_STATE_DISBAND_PGID] = { [DEV_EVENT_NOTOPER] = ccw_device_request_event, [DEV_EVENT_INTERRUPT] = ccw_device_request_event, [DEV_EVENT_TIMEOUT] = ccw_device_request_event, [DEV_EVENT_VERIFY] = ccw_device_nop, }, [DEV_STATE_BOXED] = { [DEV_EVENT_NOTOPER] = ccw_device_generic_notoper, [DEV_EVENT_INTERRUPT] = ccw_device_nop, [DEV_EVENT_TIMEOUT] = ccw_device_nop, [DEV_EVENT_VERIFY] = ccw_device_boxed_verify, }, /* states to wait for i/o completion before doing something */ [DEV_STATE_TIMEOUT_KILL] = { [DEV_EVENT_NOTOPER] = ccw_device_generic_notoper, [DEV_EVENT_INTERRUPT] = ccw_device_killing_irq, [DEV_EVENT_TIMEOUT] = ccw_device_killing_timeout, [DEV_EVENT_VERIFY] = ccw_device_nop, //FIXME }, [DEV_STATE_QUIESCE] = { [DEV_EVENT_NOTOPER] = ccw_device_quiesce_done, [DEV_EVENT_INTERRUPT] = ccw_device_quiesce_done, [DEV_EVENT_TIMEOUT] = ccw_device_quiesce_timeout, [DEV_EVENT_VERIFY] = ccw_device_nop, }, /* special states for devices gone not operational */ [DEV_STATE_DISCONNECTED] = { [DEV_EVENT_NOTOPER] = ccw_device_nop, [DEV_EVENT_INTERRUPT] = ccw_device_start_id, [DEV_EVENT_TIMEOUT] = ccw_device_nop, [DEV_EVENT_VERIFY] = ccw_device_start_id, }, [DEV_STATE_DISCONNECTED_SENSE_ID] = { [DEV_EVENT_NOTOPER] = ccw_device_request_event, [DEV_EVENT_INTERRUPT] = ccw_device_request_event, [DEV_EVENT_TIMEOUT] = ccw_device_request_event, [DEV_EVENT_VERIFY] = ccw_device_nop, }, [DEV_STATE_CMFCHANGE] = { [DEV_EVENT_NOTOPER] = ccw_device_change_cmfstate, [DEV_EVENT_INTERRUPT] = ccw_device_change_cmfstate, [DEV_EVENT_TIMEOUT] = ccw_device_change_cmfstate, [DEV_EVENT_VERIFY] = ccw_device_change_cmfstate, }, [DEV_STATE_CMFUPDATE] = { [DEV_EVENT_NOTOPER] = ccw_device_update_cmfblock, [DEV_EVENT_INTERRUPT] = ccw_device_update_cmfblock, [DEV_EVENT_TIMEOUT] = ccw_device_update_cmfblock, [DEV_EVENT_VERIFY] = ccw_device_update_cmfblock, }, [DEV_STATE_STEAL_LOCK] = { [DEV_EVENT_NOTOPER] = ccw_device_request_event, [DEV_EVENT_INTERRUPT] = ccw_device_request_event, [DEV_EVENT_TIMEOUT] = ccw_device_request_event, [DEV_EVENT_VERIFY] = ccw_device_nop, }, }; EXPORT_SYMBOL_GPL(ccw_device_set_timeout);
{ "pile_set_name": "Github" }
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: miscellaneous prototypes last mod: $Id: misc.h 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ #ifndef _V_RANDOM_H_ #define _V_RANDOM_H_ #include "vorbis/codec.h" extern void *_vorbis_block_alloc(vorbis_block *vb,long bytes); extern void _vorbis_block_ripcord(vorbis_block *vb); #ifdef ANALYSIS extern int analysis_noisy; extern void _analysis_output(char *base,int i,float *v,int n,int bark,int dB, ogg_int64_t off); extern void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB, ogg_int64_t off); #endif #ifdef DEBUG_MALLOC #define _VDBG_GRAPHFILE "malloc.m" #undef _VDBG_GRAPHFILE extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line); extern void _VDBG_free(void *ptr,char *file,long line); #ifndef MISC_C #undef _ogg_malloc #undef _ogg_calloc #undef _ogg_realloc #undef _ogg_free #define _ogg_malloc(x) _VDBG_malloc(NULL,(x),__FILE__,__LINE__) #define _ogg_calloc(x,y) _VDBG_malloc(NULL,(x)*(y),__FILE__,__LINE__) #define _ogg_realloc(x,y) _VDBG_malloc((x),(y),__FILE__,__LINE__) #define _ogg_free(x) _VDBG_free((x),__FILE__,__LINE__) #endif #endif #endif
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width"> <meta name="description" content="SHA3-512 online hash file checksum function"> <title>SHA3-512 File Checksum Online </title> <script> if (location.hostname != 'localhost') { (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-44208259-6', 'auto'); ga('send', 'pageview'); } </script> <link rel="stylesheet" href="css/style.css"> <script src="https://code.jquery.com/jquery-1.10.1.min.js"></script> </head> <body> <div id="header"> <h1><a href="index.html">Online Tools</a></h1> </div> <div id="body"> <script src="js/main.js"></script> <div id="main"> <h1>SHA3-512 File Checksum </h1> <div class="description">SHA3-512 online hash file checksum function </div> <div class="input"> <div id="droppable-zone"> <div id="droppable-zone-wrapper"> <div id="droppable-zone-text">Drop File Here</div> </div> <input id="input" type="file" placeholder="Input2" class="droppable-file"> </div> </div> <div class="submit"> <input id="execute" type="button" value="Hash" class="btn btn-default"> <label> <input id="auto-update" type="checkbox" value="1" checked="checked">Auto Update </label> </div> <div class="output"> <textarea id="output" placeholder="Output"></textarea> </div> </div> <div id="sidebar"> <div class="col"> <ul class="menu"> <li> <div class="menu-group">Hash</div> </li> <li><a href="crc16.html">CRC-16</a></li> <li><a href="crc32.html">CRC-32</a></li> <li><a href="md2.html">MD2</a></li> <li><a href="md4.html">MD4</a></li> <li><a href="md5.html">MD5</a></li> <li><a href="sha1.html">SHA1</a></li> <li><a href="sha224.html">SHA224</a></li> <li><a href="sha256.html">SHA256</a></li> <li><a href="sha384.html">SHA384</a></li> <li><a href="sha512.html">SHA512</a></li> <li><a href="sha512_224.html">SHA512/224</a></li> <li><a href="sha512_256.html">SHA512/256</a></li> <li><a href="sha3_224.html">SHA3-224</a></li> <li><a href="sha3_256.html">SHA3-256</a></li> <li><a href="sha3_384.html">SHA3-384</a></li> <li><a href="sha3_512.html">SHA3-512</a></li> <li><a href="keccak_224.html">Keccak-224</a></li> <li><a href="keccak_256.html">Keccak-256</a></li> <li><a href="keccak_384.html">Keccak-384</a></li> <li><a href="keccak_512.html">Keccak-512</a></li> <li><a href="shake_128.html">Shake-128</a></li> <li><a href="shake_256.html">Shake-256</a></li> </ul> <ul class="menu"> <li> <div class="menu-group">Encode</div> </li> <li><a href="base32_encode.html">Base32</a></li> <li><a href="base32_encode_file.html">Base32 File</a></li> <li><a href="base64_encode.html">Base64</a></li> <li><a href="base64_encode_file.html">Base64 File</a></li> <li><a href="html_encode.html">HTML</a></li> <li><a href="url_encode.html">URL</a></li> </ul> <ul class="menu"> <li> <div class="menu-group">Misc</div> </li> <li><a href="syntax_highlight.html">Syntax Highlight</a></li> </ul> </div> <div class="col"> <ul class="menu"> <li> <div class="menu-group">File Hash</div> </li> <li><a href="crc16_checksum.html">CRC-16</a></li> <li><a href="crc32_checksum.html">CRC-32</a></li> <li><a href="md2_file_hash.html">MD2</a></li> <li><a href="md4_file_hash.html">MD4</a></li> <li><a href="md5_checksum.html">MD5</a></li> <li><a href="sha1_checksum.html">SHA1</a></li> <li><a href="sha224_checksum.html">SHA224</a></li> <li><a href="sha256_checksum.html">SHA256</a></li> <li><a href="sha384_file_hash.html">SHA384</a></li> <li><a href="sha512_file_hash.html">SHA512</a></li> <li><a href="sha512_224_file_hash.html">SHA512/224</a></li> <li><a href="sha512_256_file_hash.html">SHA512/256</a></li> <li><a href="sha3_224_checksum.html">SHA3-224</a></li> <li><a href="sha3_256_checksum.html">SHA3-256</a></li> <li><a href="sha3_384_checksum.html">SHA3-384</a></li> <li><a href="sha3_512_checksum.html">SHA3-512</a></li> <li><a href="keccak_224_checksum.html">Keccak-224</a></li> <li><a href="keccak_256_checksum.html">Keccak-256</a></li> <li><a href="keccak_384_checksum.html">Keccak-384</a></li> <li><a href="keccak_512_checksum.html">Keccak-512</a></li> <li><a href="shake_128_checksum.html">Shake-128</a></li> <li><a href="shake_256_checksum.html">Shake-256</a></li> </ul> <ul class="menu"> <li> <div class="menu-group">Decode</div> </li> <li><a href="base32_decode.html">Base32</a></li> <li><a href="base32_decode_file.html">Base32 File</a></li> <li><a href="base64_decode.html">Base64</a></li> <li><a href="base64_decode_file.html">Base64 File</a></li> <li><a href="html_decode.html">HTML</a></li> <li><a href="url_decode.html">URL</a></li> </ul> </div> <div class="clearfix"></div> </div> <script src="https://cdn.jsdelivr.net/gh/emn178/js-sha3/build/sha3.min.js"></script> <script>method = sha3_512;</script> </div> <div id="footer">&copy; 2015-2017 Online Tools</div> </body> </html>
{ "pile_set_name": "Github" }
// Copyright 2016 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package gitea import ( "bytes" "encoding/json" "fmt" ) // ListCollaboratorsOptions options for listing a repository's collaborators type ListCollaboratorsOptions struct { ListOptions } // ListCollaborators list a repository's collaborators func (c *Client) ListCollaborators(user, repo string, opt ListCollaboratorsOptions) ([]*User, error) { opt.setDefaults() collaborators := make([]*User, 0, opt.PageSize) return collaborators, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/collaborators?%s", user, repo, opt.getURLQuery().Encode()), nil, nil, &collaborators) } // IsCollaborator check if a user is a collaborator of a repository func (c *Client) IsCollaborator(user, repo, collaborator string) (bool, error) { status, err := c.getStatusCode("GET", fmt.Sprintf("/repos/%s/%s/collaborators/%s", user, repo, collaborator), nil, nil) if err != nil { return false, err } if status == 204 { return true, nil } return false, nil } // AddCollaboratorOption options when adding a user as a collaborator of a repository type AddCollaboratorOption struct { Permission *string `json:"permission"` } // AddCollaborator add some user as a collaborator of a repository func (c *Client) AddCollaborator(user, repo, collaborator string, opt AddCollaboratorOption) error { body, err := json.Marshal(&opt) if err != nil { return err } _, err = c.getResponse("PUT", fmt.Sprintf("/repos/%s/%s/collaborators/%s", user, repo, collaborator), jsonHeader, bytes.NewReader(body)) return err } // DeleteCollaborator remove a collaborator from a repository func (c *Client) DeleteCollaborator(user, repo, collaborator string) error { _, err := c.getResponse("DELETE", fmt.Sprintf("/repos/%s/%s/collaborators/%s", user, repo, collaborator), nil, nil) return err }
{ "pile_set_name": "Github" }
package onactivityresult; import com.google.common.base.Joiner; import com.google.testing.compile.JavaFileObjects; import java.util.ArrayList; import java.util.Collections; import java.util.List; import javax.tools.JavaFileObject; import onactivityresult.compiler.OnActivityResultProcessor; import static com.google.common.truth.Truth.assertAbout; import static com.google.testing.compile.JavaSourceSubjectFactory.javaSource; @SuppressWarnings("PMD.CyclomaticComplexity") final class TestActivity { public static Builder create() { return new Builder(); } static String stringArrayToString(final String... code) { final StringBuilder sb = new StringBuilder(); for (final String s : code) { sb.append(s); } return sb.toString(); } private TestActivity() {} public static final class Builder { private boolean hasIntentData; private boolean hasNullable; private boolean hasNotNull; private boolean hasIntent; private boolean hasActivity; private boolean hasExtra; private final List<String> imports = new ArrayList<>(); private boolean needsIntentHelper; private List<String> extraCode; private String packageName; public Builder hasIntentData() { hasIntentData = true; return this; } public Builder hasActivity() { hasActivity = true; return this; } public Builder hasIntent() { hasIntent = true; return this; } public Builder hasNullable() { hasNullable = true; needsIntentHelper = true; return this; } public Builder hasExtra() { hasExtra = true; needsIntentHelper = true; return this; } public Builder hasNotNull() { hasNotNull = true; needsIntentHelper = true; return this; } public Builder withExtraCode(final String... code) { this.extraCode = new ArrayList<>(); Collections.addAll(this.extraCode, code); return this; } @SuppressWarnings("PMD.NPathComplexity") public Source build(final String... functions) { final List<String> code = new ArrayList<>(); code.add("package test;"); code.add("import onactivityresult.OnActivityResult;"); if (hasIntentData) { code.add("import android.net.Uri;"); code.add("import onactivityresult.IntentData;"); } if (hasNullable) { code.add("import org.jetbrains.annotations.Nullable;"); } if (hasNotNull) { code.add("import org.jetbrains.annotations.NotNull;"); } if (hasActivity) { code.add("import android.app.Activity;"); } if (hasIntent) { code.add("import android.content.Intent;"); } if (hasExtra) { code.add("import onactivityresult.Extra;"); } for (final String name : imports) { if (name.length() > 0) { code.add("import " + name + ";"); } } code.add("public class TestActivity {"); final int headLines = code.size(); code.add(stringArrayToString(functions)); code.add("}"); if (extraCode != null) { for (final String s : extraCode) { code.add(s); } } final String packName = packageName != null ? packageName : "test"; return new Source(JavaFileObjects.forSourceString(packName + ".TestActivity", Joiner.on('\n').join(code.toArray(new String[0]))), hasIntentData, needsIntentHelper, headLines, packName); } Builder addImport(final String name) { if (name.startsWith("onactivityresult.Extra")) { needsIntentHelper = true; } imports.add(name); return this; } public Builder withPackageName(final String name) { this.packageName = name; return this; } } public static class Source { private final JavaFileObject source; private final boolean needsIntentHelper; private final boolean hasIntentData; private final int headLines; private final String packageName; private boolean needsBundle; private boolean needsSerializable; private boolean needsParcelable; Source(final JavaFileObject source, final boolean hasIntentData, final boolean needsIntentHelper, final int headLines, final String packageName) { this.source = source; this.needsIntentHelper = needsIntentHelper; this.hasIntentData = hasIntentData; this.headLines = headLines; this.packageName = packageName; } Source needsBundle() { needsBundle = true; return this; } Source needsSerializable() { needsSerializable = true; return this; } Source needsParcelable() { needsParcelable = true; return this; } public void generatesBody(final String... code) { //@formatter:off final JavaFileObject generation = JavaFileObjects.forSourceString(packageName + ".TestActivity$$OnActivityResult", Joiner.on('\n').join( "// Generated code from OnActivityResult. Do not modify!", "package test;", "import android.content.Intent;", needsBundle ? "import android.os.Bundle;" : "", needsParcelable ? "import android.os.Parcelable;" : "", hasIntentData ? "import android.net.Uri;" : "", needsSerializable ? "import java.io.Serializable;" : "", "import javax.annotation.Generated;", hasIntentData || needsIntentHelper ? "import onactivityresult.IntentHelper;" : "", "import onactivityresult.internal.IOnActivityResult;", "@Generated(\"onactivityresult.compiler.OnActivityResultProcessor\")", "public class TestActivity$$OnActivityResult<T extends TestActivity> implements IOnActivityResult<T> {", "@Override", "public boolean onResult(final T t, final int requestCode, final int resultCode, final Intent intent) {", "boolean didHandle = false;", stringArrayToString(code), "return didHandle;", "}", "}") ); //@formatter:on assertAbout(javaSource()).that(source).compilesWithoutError(); assertAbout(javaSource()).that(source).processedWith(new OnActivityResultProcessor()).compilesWithoutError().and().generatesSources(generation); } public void succeeds() { assertAbout(javaSource()).that(source).compilesWithoutError(); assertAbout(javaSource()).that(source).processedWith(new OnActivityResultProcessor()).compilesWithoutError(); } public void failsWithErrorMessage(final String errorMessage, final int lineNumber) { assertAbout(javaSource()).that(source).compilesWithoutError(); assertAbout(javaSource()).that(source).processedWith(new OnActivityResultProcessor()).failsToCompile().withErrorContaining(errorMessage).in(source).onLine(headLines + lineNumber); } } }
{ "pile_set_name": "Github" }
var mapping = require('./_mapping'), fallbackHolder = require('./placeholder'); /** Built-in value reference. */ var push = Array.prototype.push; /** * Creates a function, with an arity of `n`, that invokes `func` with the * arguments it receives. * * @private * @param {Function} func The function to wrap. * @param {number} n The arity of the new function. * @returns {Function} Returns the new function. */ function baseArity(func, n) { return n == 2 ? function(a, b) { return func.apply(undefined, arguments); } : function(a) { return func.apply(undefined, arguments); }; } /** * Creates a function that invokes `func`, with up to `n` arguments, ignoring * any additional arguments. * * @private * @param {Function} func The function to cap arguments for. * @param {number} n The arity cap. * @returns {Function} Returns the new function. */ function baseAry(func, n) { return n == 2 ? function(a, b) { return func(a, b); } : function(a) { return func(a); }; } /** * Creates a clone of `array`. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the cloned array. */ function cloneArray(array) { var length = array ? array.length : 0, result = Array(length); while (length--) { result[length] = array[length]; } return result; } /** * Creates a function that clones a given object using the assignment `func`. * * @private * @param {Function} func The assignment function. * @returns {Function} Returns the new cloner function. */ function createCloner(func) { return function(object) { return func({}, object); }; } /** * A specialized version of `_.spread` which flattens the spread array into * the arguments of the invoked `func`. * * @private * @param {Function} func The function to spread arguments over. * @param {number} start The start position of the spread. * @returns {Function} Returns the new function. */ function flatSpread(func, start) { return function() { var length = arguments.length, lastIndex = length - 1, args = Array(length); while (length--) { args[length] = arguments[length]; } var array = args[start], otherArgs = args.slice(0, start); if (array) { push.apply(otherArgs, array); } if (start != lastIndex) { push.apply(otherArgs, args.slice(start + 1)); } return func.apply(this, otherArgs); }; } /** * Creates a function that wraps `func` and uses `cloner` to clone the first * argument it receives. * * @private * @param {Function} func The function to wrap. * @param {Function} cloner The function to clone arguments. * @returns {Function} Returns the new immutable function. */ function wrapImmutable(func, cloner) { return function() { var length = arguments.length; if (!length) { return; } var args = Array(length); while (length--) { args[length] = arguments[length]; } var result = args[0] = cloner.apply(undefined, args); func.apply(undefined, args); return result; }; } /** * The base implementation of `convert` which accepts a `util` object of methods * required to perform conversions. * * @param {Object} util The util object. * @param {string} name The name of the function to convert. * @param {Function} func The function to convert. * @param {Object} [options] The options object. * @param {boolean} [options.cap=true] Specify capping iteratee arguments. * @param {boolean} [options.curry=true] Specify currying. * @param {boolean} [options.fixed=true] Specify fixed arity. * @param {boolean} [options.immutable=true] Specify immutable operations. * @param {boolean} [options.rearg=true] Specify rearranging arguments. * @returns {Function|Object} Returns the converted function or object. */ function baseConvert(util, name, func, options) { var isLib = typeof name == 'function', isObj = name === Object(name); if (isObj) { options = func; func = name; name = undefined; } if (func == null) { throw new TypeError; } options || (options = {}); var config = { 'cap': 'cap' in options ? options.cap : true, 'curry': 'curry' in options ? options.curry : true, 'fixed': 'fixed' in options ? options.fixed : true, 'immutable': 'immutable' in options ? options.immutable : true, 'rearg': 'rearg' in options ? options.rearg : true }; var defaultHolder = isLib ? func : fallbackHolder, forceCurry = ('curry' in options) && options.curry, forceFixed = ('fixed' in options) && options.fixed, forceRearg = ('rearg' in options) && options.rearg, pristine = isLib ? func.runInContext() : undefined; var helpers = isLib ? func : { 'ary': util.ary, 'assign': util.assign, 'clone': util.clone, 'curry': util.curry, 'forEach': util.forEach, 'isArray': util.isArray, 'isError': util.isError, 'isFunction': util.isFunction, 'isWeakMap': util.isWeakMap, 'iteratee': util.iteratee, 'keys': util.keys, 'rearg': util.rearg, 'toInteger': util.toInteger, 'toPath': util.toPath }; var ary = helpers.ary, assign = helpers.assign, clone = helpers.clone, curry = helpers.curry, each = helpers.forEach, isArray = helpers.isArray, isError = helpers.isError, isFunction = helpers.isFunction, isWeakMap = helpers.isWeakMap, keys = helpers.keys, rearg = helpers.rearg, toInteger = helpers.toInteger, toPath = helpers.toPath; var aryMethodKeys = keys(mapping.aryMethod); var wrappers = { 'castArray': function(castArray) { return function() { var value = arguments[0]; return isArray(value) ? castArray(cloneArray(value)) : castArray.apply(undefined, arguments); }; }, 'iteratee': function(iteratee) { return function() { var func = arguments[0], arity = arguments[1], result = iteratee(func, arity), length = result.length; if (config.cap && typeof arity == 'number') { arity = arity > 2 ? (arity - 2) : 1; return (length && length <= arity) ? result : baseAry(result, arity); } return result; }; }, 'mixin': function(mixin) { return function(source) { var func = this; if (!isFunction(func)) { return mixin(func, Object(source)); } var pairs = []; each(keys(source), function(key) { if (isFunction(source[key])) { pairs.push([key, func.prototype[key]]); } }); mixin(func, Object(source)); each(pairs, function(pair) { var value = pair[1]; if (isFunction(value)) { func.prototype[pair[0]] = value; } else { delete func.prototype[pair[0]]; } }); return func; }; }, 'nthArg': function(nthArg) { return function(n) { var arity = n < 0 ? 1 : (toInteger(n) + 1); return curry(nthArg(n), arity); }; }, 'rearg': function(rearg) { return function(func, indexes) { var arity = indexes ? indexes.length : 0; return curry(rearg(func, indexes), arity); }; }, 'runInContext': function(runInContext) { return function(context) { return baseConvert(util, runInContext(context), options); }; } }; /*--------------------------------------------------------------------------*/ /** * Casts `func` to a function with an arity capped iteratee if needed. * * @private * @param {string} name The name of the function to inspect. * @param {Function} func The function to inspect. * @returns {Function} Returns the cast function. */ function castCap(name, func) { if (config.cap) { var indexes = mapping.iterateeRearg[name]; if (indexes) { return iterateeRearg(func, indexes); } var n = !isLib && mapping.iterateeAry[name]; if (n) { return iterateeAry(func, n); } } return func; } /** * Casts `func` to a curried function if needed. * * @private * @param {string} name The name of the function to inspect. * @param {Function} func The function to inspect. * @param {number} n The arity of `func`. * @returns {Function} Returns the cast function. */ function castCurry(name, func, n) { return (forceCurry || (config.curry && n > 1)) ? curry(func, n) : func; } /** * Casts `func` to a fixed arity function if needed. * * @private * @param {string} name The name of the function to inspect. * @param {Function} func The function to inspect. * @param {number} n The arity cap. * @returns {Function} Returns the cast function. */ function castFixed(name, func, n) { if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { var data = mapping.methodSpread[name], start = data && data.start; return start === undefined ? ary(func, n) : flatSpread(func, start); } return func; } /** * Casts `func` to an rearged function if needed. * * @private * @param {string} name The name of the function to inspect. * @param {Function} func The function to inspect. * @param {number} n The arity of `func`. * @returns {Function} Returns the cast function. */ function castRearg(name, func, n) { return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name])) ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) : func; } /** * Creates a clone of `object` by `path`. * * @private * @param {Object} object The object to clone. * @param {Array|string} path The path to clone by. * @returns {Object} Returns the cloned object. */ function cloneByPath(object, path) { path = toPath(path); var index = -1, length = path.length, lastIndex = length - 1, result = clone(Object(object)), nested = result; while (nested != null && ++index < length) { var key = path[index], value = nested[key]; if (value != null && !(isFunction(value) || isError(value) || isWeakMap(value))) { nested[key] = clone(index == lastIndex ? value : Object(value)); } nested = nested[key]; } return result; } /** * Converts `lodash` to an immutable auto-curried iteratee-first data-last * version with conversion `options` applied. * * @param {Object} [options] The options object. See `baseConvert` for more details. * @returns {Function} Returns the converted `lodash`. */ function convertLib(options) { return _.runInContext.convert(options)(undefined); } /** * Create a converter function for `func` of `name`. * * @param {string} name The name of the function to convert. * @param {Function} func The function to convert. * @returns {Function} Returns the new converter function. */ function createConverter(name, func) { var realName = mapping.aliasToReal[name] || name, methodName = mapping.remap[realName] || realName, oldOptions = options; return function(options) { var newUtil = isLib ? pristine : helpers, newFunc = isLib ? pristine[methodName] : func, newOptions = assign(assign({}, oldOptions), options); return baseConvert(newUtil, realName, newFunc, newOptions); }; } /** * Creates a function that wraps `func` to invoke its iteratee, with up to `n` * arguments, ignoring any additional arguments. * * @private * @param {Function} func The function to cap iteratee arguments for. * @param {number} n The arity cap. * @returns {Function} Returns the new function. */ function iterateeAry(func, n) { return overArg(func, function(func) { return typeof func == 'function' ? baseAry(func, n) : func; }); } /** * Creates a function that wraps `func` to invoke its iteratee with arguments * arranged according to the specified `indexes` where the argument value at * the first index is provided as the first argument, the argument value at * the second index is provided as the second argument, and so on. * * @private * @param {Function} func The function to rearrange iteratee arguments for. * @param {number[]} indexes The arranged argument indexes. * @returns {Function} Returns the new function. */ function iterateeRearg(func, indexes) { return overArg(func, function(func) { var n = indexes.length; return baseArity(rearg(baseAry(func, n), indexes), n); }); } /** * Creates a function that invokes `func` with its first argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function() { var length = arguments.length; if (!length) { return func(); } var args = Array(length); while (length--) { args[length] = arguments[length]; } var index = config.rearg ? 0 : (length - 1); args[index] = transform(args[index]); return func.apply(undefined, args); }; } /** * Creates a function that wraps `func` and applys the conversions * rules by `name`. * * @private * @param {string} name The name of the function to wrap. * @param {Function} func The function to wrap. * @returns {Function} Returns the converted function. */ function wrap(name, func, placeholder) { var result, realName = mapping.aliasToReal[name] || name, wrapped = func, wrapper = wrappers[realName]; if (wrapper) { wrapped = wrapper(func); } else if (config.immutable) { if (mapping.mutate.array[realName]) { wrapped = wrapImmutable(func, cloneArray); } else if (mapping.mutate.object[realName]) { wrapped = wrapImmutable(func, createCloner(func)); } else if (mapping.mutate.set[realName]) { wrapped = wrapImmutable(func, cloneByPath); } } each(aryMethodKeys, function(aryKey) { each(mapping.aryMethod[aryKey], function(otherName) { if (realName == otherName) { var data = mapping.methodSpread[realName], afterRearg = data && data.afterRearg; result = afterRearg ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey); result = castCap(realName, result); result = castCurry(realName, result, aryKey); return false; } }); return !result; }); result || (result = wrapped); if (result == func) { result = forceCurry ? curry(result, 1) : function() { return func.apply(this, arguments); }; } result.convert = createConverter(realName, func); result.placeholder = func.placeholder = placeholder; return result; } /*--------------------------------------------------------------------------*/ if (!isObj) { return wrap(name, func, defaultHolder); } var _ = func; // Convert methods by ary cap. var pairs = []; each(aryMethodKeys, function(aryKey) { each(mapping.aryMethod[aryKey], function(key) { var func = _[mapping.remap[key] || key]; if (func) { pairs.push([key, wrap(key, func, _)]); } }); }); // Convert remaining methods. each(keys(_), function(key) { var func = _[key]; if (typeof func == 'function') { var length = pairs.length; while (length--) { if (pairs[length][0] == key) { return; } } func.convert = createConverter(key, func); pairs.push([key, func]); } }); // Assign to `_` leaving `_.prototype` unchanged to allow chaining. each(pairs, function(pair) { _[pair[0]] = pair[1]; }); _.convert = convertLib; _.placeholder = _; // Assign aliases. each(keys(_), function(key) { each(mapping.realToAlias[key] || [], function(alias) { _[alias] = _[key]; }); }); return _; } module.exports = baseConvert;
{ "pile_set_name": "Github" }
/* * Copyright(c) 2007 Intel Corporation. All rights reserved. * * 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. * * Maintained at www.Open-FCoE.org */ #ifndef _FC_FS_H_ #define _FC_FS_H_ #include <linux/types.h> /* * Fibre Channel Framing and Signalling definitions. * From T11 FC-FS-2 Rev 0.90 - 9 August 2005. */ /* * Frame header */ struct fc_frame_header { __u8 fh_r_ctl; /* routing control */ __u8 fh_d_id[3]; /* Destination ID */ __u8 fh_cs_ctl; /* class of service control / pri */ __u8 fh_s_id[3]; /* Source ID */ __u8 fh_type; /* see enum fc_fh_type below */ __u8 fh_f_ctl[3]; /* frame control */ __u8 fh_seq_id; /* sequence ID */ __u8 fh_df_ctl; /* data field control */ __be16 fh_seq_cnt; /* sequence count */ __be16 fh_ox_id; /* originator exchange ID */ __be16 fh_rx_id; /* responder exchange ID */ __be32 fh_parm_offset; /* parameter or relative offset */ }; #define FC_FRAME_HEADER_LEN 24 /* expected length of structure */ #define FC_MAX_PAYLOAD 2112U /* max payload length in bytes */ #define FC_MIN_MAX_PAYLOAD 256U /* lower limit on max payload */ #define FC_MAX_FRAME (FC_MAX_PAYLOAD + FC_FRAME_HEADER_LEN) #define FC_MIN_MAX_FRAME (FC_MIN_MAX_PAYLOAD + FC_FRAME_HEADER_LEN) /* * fh_r_ctl - Routing control definitions. */ /* * FC-4 device_data. */ enum fc_rctl { FC_RCTL_DD_UNCAT = 0x00, /* uncategorized information */ FC_RCTL_DD_SOL_DATA = 0x01, /* solicited data */ FC_RCTL_DD_UNSOL_CTL = 0x02, /* unsolicited control */ FC_RCTL_DD_SOL_CTL = 0x03, /* solicited control or reply */ FC_RCTL_DD_UNSOL_DATA = 0x04, /* unsolicited data */ FC_RCTL_DD_DATA_DESC = 0x05, /* data descriptor */ FC_RCTL_DD_UNSOL_CMD = 0x06, /* unsolicited command */ FC_RCTL_DD_CMD_STATUS = 0x07, /* command status */ #define FC_RCTL_ILS_REQ FC_RCTL_DD_UNSOL_CTL /* ILS request */ #define FC_RCTL_ILS_REP FC_RCTL_DD_SOL_CTL /* ILS reply */ /* * Extended Link_Data */ FC_RCTL_ELS_REQ = 0x22, /* extended link services request */ FC_RCTL_ELS_REP = 0x23, /* extended link services reply */ FC_RCTL_ELS4_REQ = 0x32, /* FC-4 ELS request */ FC_RCTL_ELS4_REP = 0x33, /* FC-4 ELS reply */ /* * Optional Extended Headers */ FC_RCTL_VFTH = 0x50, /* virtual fabric tagging header */ FC_RCTL_IFRH = 0x51, /* inter-fabric routing header */ FC_RCTL_ENCH = 0x52, /* encapsulation header */ /* * Basic Link Services fh_r_ctl values. */ FC_RCTL_BA_NOP = 0x80, /* basic link service NOP */ FC_RCTL_BA_ABTS = 0x81, /* basic link service abort */ FC_RCTL_BA_RMC = 0x82, /* remove connection */ FC_RCTL_BA_ACC = 0x84, /* basic accept */ FC_RCTL_BA_RJT = 0x85, /* basic reject */ FC_RCTL_BA_PRMT = 0x86, /* dedicated connection preempted */ /* * Link Control Information. */ FC_RCTL_ACK_1 = 0xc0, /* acknowledge_1 */ FC_RCTL_ACK_0 = 0xc1, /* acknowledge_0 */ FC_RCTL_P_RJT = 0xc2, /* port reject */ FC_RCTL_F_RJT = 0xc3, /* fabric reject */ FC_RCTL_P_BSY = 0xc4, /* port busy */ FC_RCTL_F_BSY = 0xc5, /* fabric busy to data frame */ FC_RCTL_F_BSYL = 0xc6, /* fabric busy to link control frame */ FC_RCTL_LCR = 0xc7, /* link credit reset */ FC_RCTL_END = 0xc9, /* end */ }; /* incomplete list of definitions */ /* * R_CTL names initializer. * Please keep this matching the above definitions. */ #define FC_RCTL_NAMES_INIT { \ [FC_RCTL_DD_UNCAT] = "uncat", \ [FC_RCTL_DD_SOL_DATA] = "sol data", \ [FC_RCTL_DD_UNSOL_CTL] = "unsol ctl", \ [FC_RCTL_DD_SOL_CTL] = "sol ctl/reply", \ [FC_RCTL_DD_UNSOL_DATA] = "unsol data", \ [FC_RCTL_DD_DATA_DESC] = "data desc", \ [FC_RCTL_DD_UNSOL_CMD] = "unsol cmd", \ [FC_RCTL_DD_CMD_STATUS] = "cmd status", \ [FC_RCTL_ELS_REQ] = "ELS req", \ [FC_RCTL_ELS_REP] = "ELS rep", \ [FC_RCTL_ELS4_REQ] = "FC-4 ELS req", \ [FC_RCTL_ELS4_REP] = "FC-4 ELS rep", \ [FC_RCTL_BA_NOP] = "BLS NOP", \ [FC_RCTL_BA_ABTS] = "BLS abort", \ [FC_RCTL_BA_RMC] = "BLS remove connection", \ [FC_RCTL_BA_ACC] = "BLS accept", \ [FC_RCTL_BA_RJT] = "BLS reject", \ [FC_RCTL_BA_PRMT] = "BLS dedicated connection preempted", \ [FC_RCTL_ACK_1] = "LC ACK_1", \ [FC_RCTL_ACK_0] = "LC ACK_0", \ [FC_RCTL_P_RJT] = "LC port reject", \ [FC_RCTL_F_RJT] = "LC fabric reject", \ [FC_RCTL_P_BSY] = "LC port busy", \ [FC_RCTL_F_BSY] = "LC fabric busy to data frame", \ [FC_RCTL_F_BSYL] = "LC fabric busy to link control frame",\ [FC_RCTL_LCR] = "LC link credit reset", \ [FC_RCTL_END] = "LC end", \ } /* * Well-known fabric addresses. */ enum fc_well_known_fid { FC_FID_NONE = 0x000000, /* No destination */ FC_FID_BCAST = 0xffffff, /* broadcast */ FC_FID_FLOGI = 0xfffffe, /* fabric login */ FC_FID_FCTRL = 0xfffffd, /* fabric controller */ FC_FID_DIR_SERV = 0xfffffc, /* directory server */ FC_FID_TIME_SERV = 0xfffffb, /* time server */ FC_FID_MGMT_SERV = 0xfffffa, /* management server */ FC_FID_QOS = 0xfffff9, /* QoS Facilitator */ FC_FID_ALIASES = 0xfffff8, /* alias server (FC-PH2) */ FC_FID_SEC_KEY = 0xfffff7, /* Security key dist. server */ FC_FID_CLOCK = 0xfffff6, /* clock synch server */ FC_FID_MCAST_SERV = 0xfffff5, /* multicast server */ }; #define FC_FID_WELL_KNOWN_MAX 0xffffff /* highest well-known fabric ID */ #define FC_FID_WELL_KNOWN_BASE 0xfffff5 /* start of well-known fabric ID */ /* * Other well-known addresses, outside the above contiguous range. */ #define FC_FID_DOM_MGR 0xfffc00 /* domain manager base */ /* * Fabric ID bytes. */ #define FC_FID_DOMAIN 0 #define FC_FID_PORT 1 #define FC_FID_LINK 2 /* * fh_type codes */ enum fc_fh_type { FC_TYPE_BLS = 0x00, /* basic link service */ FC_TYPE_ELS = 0x01, /* extended link service */ FC_TYPE_IP = 0x05, /* IP over FC, RFC 4338 */ FC_TYPE_FCP = 0x08, /* SCSI FCP */ FC_TYPE_CT = 0x20, /* Fibre Channel Services (FC-CT) */ FC_TYPE_ILS = 0x22, /* internal link service */ }; /* * FC_TYPE names initializer. * Please keep this matching the above definitions. */ #define FC_TYPE_NAMES_INIT { \ [FC_TYPE_BLS] = "BLS", \ [FC_TYPE_ELS] = "ELS", \ [FC_TYPE_IP] = "IP", \ [FC_TYPE_FCP] = "FCP", \ [FC_TYPE_CT] = "CT", \ [FC_TYPE_ILS] = "ILS", \ } /* * Exchange IDs. */ #define FC_XID_UNKNOWN 0xffff /* unknown exchange ID */ #define FC_XID_MIN 0x0 /* supported min exchange ID */ #define FC_XID_MAX 0xfffe /* supported max exchange ID */ /* * fh_f_ctl - Frame control flags. */ #define FC_FC_EX_CTX (1 << 23) /* sent by responder to exchange */ #define FC_FC_SEQ_CTX (1 << 22) /* sent by responder to sequence */ #define FC_FC_FIRST_SEQ (1 << 21) /* first sequence of this exchange */ #define FC_FC_LAST_SEQ (1 << 20) /* last sequence of this exchange */ #define FC_FC_END_SEQ (1 << 19) /* last frame of sequence */ #define FC_FC_END_CONN (1 << 18) /* end of class 1 connection pending */ #define FC_FC_RES_B17 (1 << 17) /* reserved */ #define FC_FC_SEQ_INIT (1 << 16) /* transfer of sequence initiative */ #define FC_FC_X_ID_REASS (1 << 15) /* exchange ID has been changed */ #define FC_FC_X_ID_INVAL (1 << 14) /* exchange ID invalidated */ #define FC_FC_ACK_1 (1 << 12) /* 13:12 = 1: ACK_1 expected */ #define FC_FC_ACK_N (2 << 12) /* 13:12 = 2: ACK_N expected */ #define FC_FC_ACK_0 (3 << 12) /* 13:12 = 3: ACK_0 expected */ #define FC_FC_RES_B11 (1 << 11) /* reserved */ #define FC_FC_RES_B10 (1 << 10) /* reserved */ #define FC_FC_RETX_SEQ (1 << 9) /* retransmitted sequence */ #define FC_FC_UNI_TX (1 << 8) /* unidirectional transmit (class 1) */ #define FC_FC_CONT_SEQ(i) ((i) << 6) #define FC_FC_ABT_SEQ(i) ((i) << 4) #define FC_FC_REL_OFF (1 << 3) /* parameter is relative offset */ #define FC_FC_RES2 (1 << 2) /* reserved */ #define FC_FC_FILL(i) ((i) & 3) /* 1:0: bytes of trailing fill */ /* * BA_ACC payload. */ struct fc_ba_acc { __u8 ba_seq_id_val; /* SEQ_ID validity */ #define FC_BA_SEQ_ID_VAL 0x80 __u8 ba_seq_id; /* SEQ_ID of seq last deliverable */ __u8 ba_resvd[2]; /* reserved */ __be16 ba_ox_id; /* OX_ID for aborted seq or exch */ __be16 ba_rx_id; /* RX_ID for aborted seq or exch */ __be16 ba_low_seq_cnt; /* low SEQ_CNT of aborted seq */ __be16 ba_high_seq_cnt; /* high SEQ_CNT of aborted seq */ }; /* * BA_RJT: Basic Reject payload. */ struct fc_ba_rjt { __u8 br_resvd; /* reserved */ __u8 br_reason; /* reason code */ __u8 br_explan; /* reason explanation */ __u8 br_vendor; /* vendor unique code */ }; /* * BA_RJT reason codes. * From FS-2. */ enum fc_ba_rjt_reason { FC_BA_RJT_NONE = 0, /* in software this means no reject */ FC_BA_RJT_INVL_CMD = 0x01, /* invalid command code */ FC_BA_RJT_LOG_ERR = 0x03, /* logical error */ FC_BA_RJT_LOG_BUSY = 0x05, /* logical busy */ FC_BA_RJT_PROTO_ERR = 0x07, /* protocol error */ FC_BA_RJT_UNABLE = 0x09, /* unable to perform request */ FC_BA_RJT_VENDOR = 0xff, /* vendor-specific (see br_vendor) */ }; /* * BA_RJT reason code explanations. */ enum fc_ba_rjt_explan { FC_BA_RJT_EXP_NONE = 0x00, /* no additional expanation */ FC_BA_RJT_INV_XID = 0x03, /* invalid OX_ID-RX_ID combination */ FC_BA_RJT_ABT = 0x05, /* sequence aborted, no seq info */ }; /* * P_RJT or F_RJT: Port Reject or Fabric Reject parameter field. */ struct fc_pf_rjt { __u8 rj_action; /* reserved */ __u8 rj_reason; /* reason code */ __u8 rj_resvd; /* reserved */ __u8 rj_vendor; /* vendor unique code */ }; /* * P_RJT and F_RJT reject reason codes. */ enum fc_pf_rjt_reason { FC_RJT_NONE = 0, /* non-reject (reserved by standard) */ FC_RJT_INVL_DID = 0x01, /* invalid destination ID */ FC_RJT_INVL_SID = 0x02, /* invalid source ID */ FC_RJT_P_UNAV_T = 0x03, /* port unavailable, temporary */ FC_RJT_P_UNAV = 0x04, /* port unavailable, permanent */ FC_RJT_CLS_UNSUP = 0x05, /* class not supported */ FC_RJT_DEL_USAGE = 0x06, /* delimiter usage error */ FC_RJT_TYPE_UNSUP = 0x07, /* type not supported */ FC_RJT_LINK_CTL = 0x08, /* invalid link control */ FC_RJT_R_CTL = 0x09, /* invalid R_CTL field */ FC_RJT_F_CTL = 0x0a, /* invalid F_CTL field */ FC_RJT_OX_ID = 0x0b, /* invalid originator exchange ID */ FC_RJT_RX_ID = 0x0c, /* invalid responder exchange ID */ FC_RJT_SEQ_ID = 0x0d, /* invalid sequence ID */ FC_RJT_DF_CTL = 0x0e, /* invalid DF_CTL field */ FC_RJT_SEQ_CNT = 0x0f, /* invalid SEQ_CNT field */ FC_RJT_PARAM = 0x10, /* invalid parameter field */ FC_RJT_EXCH_ERR = 0x11, /* exchange error */ FC_RJT_PROTO = 0x12, /* protocol error */ FC_RJT_LEN = 0x13, /* incorrect length */ FC_RJT_UNEXP_ACK = 0x14, /* unexpected ACK */ FC_RJT_FAB_CLASS = 0x15, /* class unsupported by fabric entity */ FC_RJT_LOGI_REQ = 0x16, /* login required */ FC_RJT_SEQ_XS = 0x17, /* excessive sequences attempted */ FC_RJT_EXCH_EST = 0x18, /* unable to establish exchange */ FC_RJT_FAB_UNAV = 0x1a, /* fabric unavailable */ FC_RJT_VC_ID = 0x1b, /* invalid VC_ID (class 4) */ FC_RJT_CS_CTL = 0x1c, /* invalid CS_CTL field */ FC_RJT_INSUF_RES = 0x1d, /* insuff. resources for VC (Class 4) */ FC_RJT_INVL_CLS = 0x1f, /* invalid class of service */ FC_RJT_PREEMT_RJT = 0x20, /* preemption request rejected */ FC_RJT_PREEMT_DIS = 0x21, /* preemption not enabled */ FC_RJT_MCAST_ERR = 0x22, /* multicast error */ FC_RJT_MCAST_ET = 0x23, /* multicast error terminate */ FC_RJT_PRLI_REQ = 0x24, /* process login required */ FC_RJT_INVL_ATT = 0x25, /* invalid attachment */ FC_RJT_VENDOR = 0xff, /* vendor specific reject */ }; /* default timeout values */ #define FC_DEF_E_D_TOV 2000UL #define FC_DEF_R_A_TOV 10000UL #endif /* _FC_FS_H_ */
{ "pile_set_name": "Github" }
package aws // JSONValue is a representation of a grab bag type that will be marshaled // into a json string. This type can be used just like any other map. // // Example: // // values := aws.JSONValue{ // "Foo": "Bar", // } // values["Baz"] = "Qux" type JSONValue map[string]interface{}
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_34) on Tue May 26 09:04:08 BST 2015 --> <TITLE> AbstractTextArea (Apache FOP 2.0 API) </TITLE> <META NAME="date" CONTENT="2015-05-26"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="AbstractTextArea (Apache FOP 2.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/AbstractTextArea.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> fop 2.0</EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV CLASS&nbsp; &nbsp;<A HREF="../../../../../org/apache/fop/area/inline/AbstractTextArea.TextAdjustingInfo.html" title="class in org.apache.fop.area.inline"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/fop/area/inline/AbstractTextArea.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="AbstractTextArea.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_org.apache.fop.area.inline.InlineParent">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.apache.fop.area.inline</FONT> <BR> Class AbstractTextArea</H2> <PRE> java.lang.Object <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/fop/area/AreaTreeObject.html" title="class in org.apache.fop.area">org.apache.fop.area.AreaTreeObject</A> <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/fop/area/Area.html" title="class in org.apache.fop.area">org.apache.fop.area.Area</A> <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html" title="class in org.apache.fop.area.inline">org.apache.fop.area.inline.InlineArea</A> <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/fop/area/inline/InlineParent.html" title="class in org.apache.fop.area.inline">org.apache.fop.area.inline.InlineParent</A> <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.fop.area.inline.AbstractTextArea</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, java.lang.Cloneable</DD> </DL> <DL> <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../org/apache/fop/area/inline/TextArea.html" title="class in org.apache.fop.area.inline">TextArea</A></DD> </DL> <HR> <DL> <DT><PRE>public abstract class <B>AbstractTextArea</B><DT>extends <A HREF="../../../../../org/apache/fop/area/inline/InlineParent.html" title="class in org.apache.fop.area.inline">InlineParent</A></DL> </PRE> <P> Abstract base class for both TextArea and Character. <P> <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../../serialized-form.html#org.apache.fop.area.inline.AbstractTextArea">Serialized Form</A></DL> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <A NAME="nested_class_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Nested Class Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/fop/area/inline/AbstractTextArea.TextAdjustingInfo.html" title="class in org.apache.fop.area.inline">AbstractTextArea.TextAdjustingInfo</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this class stores information about spaces and potential adjustments that can be used in order to re-compute adjustments when a page-number or a page-number-citation is resolved</TD> </TR> </TABLE> &nbsp;<A NAME="nested_classes_inherited_from_class_org.apache.fop.area.inline.InlineArea"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Nested classes/interfaces inherited from class org.apache.fop.area.inline.<A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html" title="class in org.apache.fop.area.inline">InlineArea</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/fop/area/inline/InlineArea.InlineAdjustingInfo.html" title="class in org.apache.fop.area.inline">InlineArea.InlineAdjustingInfo</A></CODE></TD> </TR> </TABLE> &nbsp; <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> </TABLE> &nbsp;<A NAME="fields_inherited_from_class_org.apache.fop.area.inline.InlineParent"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Fields inherited from class org.apache.fop.area.inline.<A HREF="../../../../../org/apache/fop/area/inline/InlineParent.html" title="class in org.apache.fop.area.inline">InlineParent</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/fop/area/inline/InlineParent.html#autoSize">autoSize</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineParent.html#inlines">inlines</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineParent.html#minChildOffset">minChildOffset</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="fields_inherited_from_class_org.apache.fop.area.inline.InlineArea"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Fields inherited from class org.apache.fop.area.inline.<A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html" title="class in org.apache.fop.area.inline">InlineArea</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#adjustingInfo">adjustingInfo</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#blockProgressionOffset">blockProgressionOffset</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="fields_inherited_from_class_org.apache.fop.area.Area"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Fields inherited from class org.apache.fop.area.<A HREF="../../../../../org/apache/fop/area/Area.html" title="class in org.apache.fop.area">Area</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/fop/area/Area.html#bidiLevel">bidiLevel</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#bpd">bpd</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#CLASS_ABSOLUTE">CLASS_ABSOLUTE</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#CLASS_BEFORE_FLOAT">CLASS_BEFORE_FLOAT</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#CLASS_FIXED">CLASS_FIXED</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#CLASS_FOOTNOTE">CLASS_FOOTNOTE</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#CLASS_MAX">CLASS_MAX</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#CLASS_NORMAL">CLASS_NORMAL</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#CLASS_SIDE_FLOAT">CLASS_SIDE_FLOAT</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#effectiveIPD">effectiveIPD</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#ipd">ipd</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#log">log</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#ORIENT_0">ORIENT_0</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#ORIENT_180">ORIENT_180</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#ORIENT_270">ORIENT_270</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#ORIENT_90">ORIENT_90</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#traits">traits</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="fields_inherited_from_class_org.apache.fop.area.AreaTreeObject"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Fields inherited from class org.apache.fop.area.<A HREF="../../../../../org/apache/fop/area/AreaTreeObject.html" title="class in org.apache.fop.area">AreaTreeObject</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/fop/area/AreaTreeObject.html#extensionAttachments">extensionAttachments</A>, <A HREF="../../../../../org/apache/fop/area/AreaTreeObject.html#foreignAttributes">foreignAttributes</A></CODE></TD> </TR> </TABLE> &nbsp; <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/fop/area/inline/AbstractTextArea.html#AbstractTextArea()">AbstractTextArea</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default constructor</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/fop/area/inline/AbstractTextArea.html#AbstractTextArea(int, int, int)">AbstractTextArea</A></B>(int&nbsp;stretch, int&nbsp;shrink, int&nbsp;adj)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor with extra parameters: create a TextAdjustingInfo object</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/fop/area/inline/AbstractTextArea.html#applyVariationFactor(double, int, int)">applyVariationFactor</A></B>(double&nbsp;variationFactor, int&nbsp;lineStretch, int&nbsp;lineShrink)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;recursively apply the variation factor to all descendant areas</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/fop/area/inline/AbstractTextArea.html#getBaselineOffset()">getBaselineOffset</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get baseline offset, i.e.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/fop/area/inline/AbstractTextArea.html#getTextLetterSpaceAdjust()">getTextLetterSpaceAdjust</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get text letter space adjust.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/fop/area/inline/AbstractTextArea.html#getTextWordSpaceAdjust()">getTextWordSpaceAdjust</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get text word space adjust.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/fop/area/inline/AbstractTextArea.html#setBaselineOffset(int)">setBaselineOffset</A></B>(int&nbsp;baselineOffset)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the baseline offset.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/fop/area/inline/AbstractTextArea.html#setSpaceDifference(int)">setSpaceDifference</A></B>(int&nbsp;spaceDiff)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the difference between optimal width of a space and default width of a space according to the font; this part of the space adjustment is fixed and must not be multiplied by the variation factor.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/fop/area/inline/AbstractTextArea.html#setTextLetterSpaceAdjust(int)">setTextLetterSpaceAdjust</A></B>(int&nbsp;textLetterSpaceAdjust)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set text letter space adjust.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/fop/area/inline/AbstractTextArea.html#setTextWordSpaceAdjust(int)">setTextWordSpaceAdjust</A></B>(int&nbsp;textWordSpaceAdjust)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set text word space adjust.</TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_org.apache.fop.area.inline.InlineParent"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class org.apache.fop.area.inline.<A HREF="../../../../../org/apache/fop/area/inline/InlineParent.html" title="class in org.apache.fop.area.inline">InlineParent</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/fop/area/inline/InlineParent.html#addChildArea(org.apache.fop.area.Area)">addChildArea</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineParent.html#collectInlineRuns(java.util.List)">collectInlineRuns</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineParent.html#getChildAreas()">getChildAreas</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineParent.html#resetChildrenLevel()">resetChildrenLevel</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_org.apache.fop.area.inline.InlineArea"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class org.apache.fop.area.inline.<A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html" title="class in org.apache.fop.area.inline">InlineArea</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#getAdjustingInfo()">getAdjustingInfo</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#getBlockProgressionOffset()">getBlockProgressionOffset</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#getParentArea()">getParentArea</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#handleIPDVariation(int)">handleIPDVariation</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#hasLineThrough()">hasLineThrough</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#hasOverline()">hasOverline</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#hasUnderline()">hasUnderline</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#increaseIPD(int)">increaseIPD</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#isAncestor(org.apache.fop.area.inline.InlineArea)">isAncestor</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#isAncestorOrSelf(org.apache.fop.area.inline.InlineArea)">isAncestorOrSelf</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#isBlinking()">isBlinking</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#notifyIPDVariation(int)">notifyIPDVariation</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#setAdjustingInfo(org.apache.fop.area.inline.InlineArea.InlineAdjustingInfo)">setAdjustingInfo</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#setAdjustingInfo(int, int, int)">setAdjustingInfo</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#setAdjustment(int)">setAdjustment</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#setBlockProgressionOffset(int)">setBlockProgressionOffset</A>, <A HREF="../../../../../org/apache/fop/area/inline/InlineArea.html#setParentArea(org.apache.fop.area.Area)">setParentArea</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_org.apache.fop.area.Area"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class org.apache.fop.area.<A HREF="../../../../../org/apache/fop/area/Area.html" title="class in org.apache.fop.area">Area</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/fop/area/Area.html#activateEffectiveIPD()">activateEffectiveIPD</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#addTrait(java.lang.Integer, java.lang.Object)">addTrait</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#clone()">clone</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getAllocBPD()">getAllocBPD</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getAllocIPD()">getAllocIPD</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getAreaClass()">getAreaClass</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getBidiLevel()">getBidiLevel</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getBorderAndPaddingWidthAfter()">getBorderAndPaddingWidthAfter</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getBorderAndPaddingWidthBefore()">getBorderAndPaddingWidthBefore</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getBorderAndPaddingWidthEnd()">getBorderAndPaddingWidthEnd</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getBorderAndPaddingWidthStart()">getBorderAndPaddingWidthStart</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getBPD()">getBPD</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getEffectiveAllocIPD()">getEffectiveAllocIPD</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getEffectiveIPD()">getEffectiveIPD</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getIPD()">getIPD</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getSpaceAfter()">getSpaceAfter</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getSpaceBefore()">getSpaceBefore</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getSpaceEnd()">getSpaceEnd</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getSpaceStart()">getSpaceStart</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getTrait(java.lang.Integer)">getTrait</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getTraitAsBoolean(java.lang.Integer)">getTraitAsBoolean</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getTraitAsInteger(java.lang.Integer)">getTraitAsInteger</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#getTraits()">getTraits</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#hasTrait(java.lang.Integer)">hasTrait</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#hasTraits()">hasTraits</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#resetBidiLevel()">resetBidiLevel</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#setAreaClass(int)">setAreaClass</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#setBidiLevel(int)">setBidiLevel</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#setBPD(int)">setBPD</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#setIPD(int)">setIPD</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#setTraits(java.util.Map)">setTraits</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#setWritingModeTraits(org.apache.fop.traits.WritingModeTraitsGetter)">setWritingModeTraits</A>, <A HREF="../../../../../org/apache/fop/area/Area.html#toString()">toString</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_org.apache.fop.area.AreaTreeObject"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class org.apache.fop.area.<A HREF="../../../../../org/apache/fop/area/AreaTreeObject.html" title="class in org.apache.fop.area">AreaTreeObject</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/fop/area/AreaTreeObject.html#addExtensionAttachment(org.apache.fop.fo.extensions.ExtensionAttachment)">addExtensionAttachment</A>, <A HREF="../../../../../org/apache/fop/area/AreaTreeObject.html#getExtensionAttachments()">getExtensionAttachments</A>, <A HREF="../../../../../org/apache/fop/area/AreaTreeObject.html#getForeignAttributes()">getForeignAttributes</A>, <A HREF="../../../../../org/apache/fop/area/AreaTreeObject.html#getForeignAttributeValue(org.apache.xmlgraphics.util.QName)">getForeignAttributeValue</A>, <A HREF="../../../../../org/apache/fop/area/AreaTreeObject.html#hasExtensionAttachments()">hasExtensionAttachments</A>, <A HREF="../../../../../org/apache/fop/area/AreaTreeObject.html#setExtensionAttachments(java.util.List)">setExtensionAttachments</A>, <A HREF="../../../../../org/apache/fop/area/AreaTreeObject.html#setForeignAttribute(org.apache.xmlgraphics.util.QName, java.lang.String)">setForeignAttribute</A>, <A HREF="../../../../../org/apache/fop/area/AreaTreeObject.html#setForeignAttributes(java.util.Map)">setForeignAttributes</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="AbstractTextArea()"><!-- --></A><H3> AbstractTextArea</H3> <PRE> public <B>AbstractTextArea</B>()</PRE> <DL> <DD>Default constructor <P> </DL> <HR> <A NAME="AbstractTextArea(int, int, int)"><!-- --></A><H3> AbstractTextArea</H3> <PRE> public <B>AbstractTextArea</B>(int&nbsp;stretch, int&nbsp;shrink, int&nbsp;adj)</PRE> <DL> <DD>Constructor with extra parameters: create a TextAdjustingInfo object <P> <DL> <DT><B>Parameters:</B><DD><CODE>stretch</CODE> - the available stretch of the text<DD><CODE>shrink</CODE> - the available shrink of the text<DD><CODE>adj</CODE> - the current adjustment of the area</DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="getTextWordSpaceAdjust()"><!-- --></A><H3> getTextWordSpaceAdjust</H3> <PRE> public int <B>getTextWordSpaceAdjust</B>()</PRE> <DL> <DD>Get text word space adjust. <P> <DD><DL> <DT><B>Returns:</B><DD>the text word space adjustment</DL> </DD> </DL> <HR> <A NAME="setTextWordSpaceAdjust(int)"><!-- --></A><H3> setTextWordSpaceAdjust</H3> <PRE> public void <B>setTextWordSpaceAdjust</B>(int&nbsp;textWordSpaceAdjust)</PRE> <DL> <DD>Set text word space adjust. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>textWordSpaceAdjust</CODE> - the text word space adjustment</DL> </DD> </DL> <HR> <A NAME="getTextLetterSpaceAdjust()"><!-- --></A><H3> getTextLetterSpaceAdjust</H3> <PRE> public int <B>getTextLetterSpaceAdjust</B>()</PRE> <DL> <DD>Get text letter space adjust. <P> <DD><DL> <DT><B>Returns:</B><DD>the text letter space adjustment</DL> </DD> </DL> <HR> <A NAME="setTextLetterSpaceAdjust(int)"><!-- --></A><H3> setTextLetterSpaceAdjust</H3> <PRE> public void <B>setTextLetterSpaceAdjust</B>(int&nbsp;textLetterSpaceAdjust)</PRE> <DL> <DD>Set text letter space adjust. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>textLetterSpaceAdjust</CODE> - the text letter space adjustment</DL> </DD> </DL> <HR> <A NAME="setSpaceDifference(int)"><!-- --></A><H3> setSpaceDifference</H3> <PRE> public void <B>setSpaceDifference</B>(int&nbsp;spaceDiff)</PRE> <DL> <DD>Set the difference between optimal width of a space and default width of a space according to the font; this part of the space adjustment is fixed and must not be multiplied by the variation factor. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>spaceDiff</CODE> - the space difference</DL> </DD> </DL> <HR> <A NAME="applyVariationFactor(double, int, int)"><!-- --></A><H3> applyVariationFactor</H3> <PRE> public boolean <B>applyVariationFactor</B>(double&nbsp;variationFactor, int&nbsp;lineStretch, int&nbsp;lineShrink)</PRE> <DL> <DD>recursively apply the variation factor to all descendant areas <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/fop/area/inline/InlineParent.html#applyVariationFactor(double, int, int)">applyVariationFactor</A></CODE> in class <CODE><A HREF="../../../../../org/apache/fop/area/inline/InlineParent.html" title="class in org.apache.fop.area.inline">InlineParent</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>variationFactor</CODE> - the variation factor that must be applied to adjustments<DD><CODE>lineStretch</CODE> - the total stretch of the line<DD><CODE>lineShrink</CODE> - the total shrink of the line <DT><B>Returns:</B><DD>true if there is an UnresolvedArea descendant</DL> </DD> </DL> <HR> <A NAME="getBaselineOffset()"><!-- --></A><H3> getBaselineOffset</H3> <PRE> public int <B>getBaselineOffset</B>()</PRE> <DL> <DD>Get baseline offset, i.e. the distance from the before edge of this area to the nominal baseline. <P> <DD><DL> <DT><B>Returns:</B><DD>the baseline offset</DL> </DD> </DL> <HR> <A NAME="setBaselineOffset(int)"><!-- --></A><H3> setBaselineOffset</H3> <PRE> public void <B>setBaselineOffset</B>(int&nbsp;baselineOffset)</PRE> <DL> <DD>Set the baseline offset. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>baselineOffset</CODE> - the baseline offset</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/AbstractTextArea.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> fop 2.0</EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV CLASS&nbsp; &nbsp;<A HREF="../../../../../org/apache/fop/area/inline/AbstractTextArea.TextAdjustingInfo.html" title="class in org.apache.fop.area.inline"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/fop/area/inline/AbstractTextArea.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="AbstractTextArea.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_org.apache.fop.area.inline.InlineParent">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright 1999-2015 The Apache Software Foundation. All Rights Reserved. </BODY> </HTML>
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\Output; use Symfony\Component\Console\Formatter\OutputFormatterInterface; /** * StreamOutput writes the output to a given stream. * * Usage: * * $output = new StreamOutput(fopen('php://stdout', 'w')); * * As `StreamOutput` can use any stream, you can also use a file: * * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false)); * * @author Fabien Potencier <[email protected]> * * @api */ class StreamOutput extends Output { private $stream; /** * Constructor. * * @param mixed $stream A stream resource * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) * * @throws \InvalidArgumentException When first argument is not a real stream * * @api */ public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null) { if (!is_resource($stream) || 'stream' !== get_resource_type($stream)) { throw new \InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); } $this->stream = $stream; if (null === $decorated) { $decorated = $this->hasColorSupport(); } parent::__construct($verbosity, $decorated, $formatter); } /** * Gets the stream attached to this StreamOutput instance. * * @return resource A stream resource */ public function getStream() { return $this->stream; } /** * {@inheritdoc} */ protected function doWrite($message, $newline) { if (false === @fwrite($this->stream, $message.($newline ? PHP_EOL : ''))) { // @codeCoverageIgnoreStart // should never happen throw new \RuntimeException('Unable to write output.'); // @codeCoverageIgnoreEnd } fflush($this->stream); } /** * Returns true if the stream supports colorization. * * Colorization is disabled if not supported by the stream: * * - Windows without Ansicon and ConEmu * - non tty consoles * * @return bool true if the stream supports colorization, false otherwise */ protected function hasColorSupport() { // @codeCoverageIgnoreStart if (DIRECTORY_SEPARATOR == '\\') { return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI'); } return function_exists('posix_isatty') && @posix_isatty($this->stream); // @codeCoverageIgnoreEnd } }
{ "pile_set_name": "Github" }
package complete import ( "io/ioutil" "log" "os" ) // Log is used for debugging purposes // since complete is running on tab completion, it is nice to // have logs to the stderr (when writing your own completer) // to write logs, set the COMP_DEBUG environment variable and // use complete.Log in the complete program var Log = getLogger() func getLogger() func(format string, args ...interface{}) { var logfile = ioutil.Discard if os.Getenv(envDebug) != "" { logfile = os.Stderr } return log.New(logfile, "complete ", log.Flags()).Printf }
{ "pile_set_name": "Github" }
#!/bin/sh export PATH=$PATH:/bin/:/sbin/:/usr/bin/:/usr/sbin:/usr/local/bin DIR=$( cd "$(dirname "$0")" ; pwd -P ) . $DIR/../scripts/env.sh while true do $SCRIPTDIR/scrape.sh done
{ "pile_set_name": "Github" }
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.distributedlog.common.rate; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; /** * Factory to create {@link MovingAverageRate} instances. */ public class MovingAverageRateFactory implements Runnable { private static final int DEFAULT_INTERVAL_SECS = 1; private final ScheduledExecutorService scheduler; private final ScheduledFuture<?> scheduledFuture; private final CopyOnWriteArrayList<SampledMovingAverageRate> avgs; public MovingAverageRateFactory(ScheduledExecutorService scheduler) { this.avgs = new CopyOnWriteArrayList<SampledMovingAverageRate>(); this.scheduler = scheduler; this.scheduledFuture = this.scheduler.scheduleAtFixedRate( this, DEFAULT_INTERVAL_SECS, DEFAULT_INTERVAL_SECS, TimeUnit.SECONDS); } public MovingAverageRate create(int intervalSecs) { SampledMovingAverageRate avg = new SampledMovingAverageRate(intervalSecs); avgs.add(avg); return avg; } public void close() { scheduledFuture.cancel(true); avgs.clear(); } @Override public void run() { sampleAll(); } private void sampleAll() { avgs.forEach(SampledMovingAverageRate::sample); } }
{ "pile_set_name": "Github" }
rm -f tests/root ln -s root1 tests/root LC_ALL=C TZ=GMT ./iostat -d -p ALL -j ID > tests/out.iostat-jID.tmp
{ "pile_set_name": "Github" }
// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 1E1D58BC1368D74F00D93743 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E1D58BB1368D74F00D93743 /* Foundation.framework */; }; 1E1D58BF1368D74F00D93743 /* AVFoundationExporter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E1D58BE1368D74F00D93743 /* AVFoundationExporter.m */; }; 1E1D58CF1368D7E600D93743 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E1D58CD1368D7E600D93743 /* CoreMedia.framework */; }; 1E1D58D01368D7E600D93743 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E1D58CE1368D7E600D93743 /* AVFoundation.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ 1E1D58B51368D74F00D93743 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = /usr/share/man/man1/; dstSubfolderSpec = 0; files = ( ); runOnlyForDeploymentPostprocessing = 1; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 1E1D58B71368D74F00D93743 /* AVFoundationExporter */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = AVFoundationExporter; sourceTree = BUILT_PRODUCTS_DIR; }; 1E1D58BB1368D74F00D93743 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 1E1D58BE1368D74F00D93743 /* AVFoundationExporter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AVFoundationExporter.m; sourceTree = "<group>"; }; 1E1D58CD1368D7E600D93743 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = "<group>"; }; 1E1D58CE1368D7E600D93743 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = "<group>"; }; 3EAA11C51B1B895500EC0006 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 1E1D58B41368D74F00D93743 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 1E1D58BC1368D74F00D93743 /* Foundation.framework in Frameworks */, 1E1D58CF1368D7E600D93743 /* CoreMedia.framework in Frameworks */, 1E1D58D01368D7E600D93743 /* AVFoundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 1E1D58AC1368D74F00D93743 = { isa = PBXGroup; children = ( 3EAA11C51B1B895500EC0006 /* README.md */, 1E1D58BD1368D74F00D93743 /* AVFoundationExporter */, 1E1D58BA1368D74F00D93743 /* Frameworks */, 1E1D58B81368D74F00D93743 /* Products */, ); sourceTree = "<group>"; }; 1E1D58B81368D74F00D93743 /* Products */ = { isa = PBXGroup; children = ( 1E1D58B71368D74F00D93743 /* AVFoundationExporter */, ); name = Products; sourceTree = "<group>"; }; 1E1D58BA1368D74F00D93743 /* Frameworks */ = { isa = PBXGroup; children = ( 1E1D58BB1368D74F00D93743 /* Foundation.framework */, 1E1D58CD1368D7E600D93743 /* CoreMedia.framework */, 1E1D58CE1368D7E600D93743 /* AVFoundation.framework */, ); name = Frameworks; sourceTree = "<group>"; }; 1E1D58BD1368D74F00D93743 /* AVFoundationExporter */ = { isa = PBXGroup; children = ( 1E1D58BE1368D74F00D93743 /* AVFoundationExporter.m */, ); path = AVFoundationExporter; sourceTree = "<group>"; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 1E1D58B61368D74F00D93743 /* AVFoundationExporter */ = { isa = PBXNativeTarget; buildConfigurationList = 1E1D58C61368D74F00D93743 /* Build configuration list for PBXNativeTarget "AVFoundationExporter" */; buildPhases = ( 1E1D58B31368D74F00D93743 /* Sources */, 1E1D58B41368D74F00D93743 /* Frameworks */, 1E1D58B51368D74F00D93743 /* CopyFiles */, ); buildRules = ( ); dependencies = ( ); name = AVFoundationExporter; productName = AVFoundationExporter; productReference = 1E1D58B71368D74F00D93743 /* AVFoundationExporter */; productType = "com.apple.product-type.tool"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 1E1D58AE1368D74F00D93743 /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Apple, Inc"; }; buildConfigurationList = 1E1D58B11368D74F00D93743 /* Build configuration list for PBXProject "AVFoundationExporter" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 1E1D58AC1368D74F00D93743; productRefGroup = 1E1D58B81368D74F00D93743 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 1E1D58B61368D74F00D93743 /* AVFoundationExporter */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ 1E1D58B31368D74F00D93743 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 1E1D58BF1368D74F00D93743 /* AVFoundationExporter.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ 1E1D58C41368D74F00D93743 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; }; 1E1D58C51368D74F00D93743 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; SDKROOT = macosx; }; name = Release; }; 1E1D58C71368D74F00D93743 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_MODULES = YES; COPY_PHASE_STRIP = NO; DEFINES_MODULE = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = ""; }; name = Debug; }; 1E1D58C81368D74F00D93743 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_MODULES = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = ""; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 1E1D58B11368D74F00D93743 /* Build configuration list for PBXProject "AVFoundationExporter" */ = { isa = XCConfigurationList; buildConfigurations = ( 1E1D58C41368D74F00D93743 /* Debug */, 1E1D58C51368D74F00D93743 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 1E1D58C61368D74F00D93743 /* Build configuration list for PBXNativeTarget "AVFoundationExporter" */ = { isa = XCConfigurationList; buildConfigurations = ( 1E1D58C71368D74F00D93743 /* Debug */, 1E1D58C81368D74F00D93743 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 1E1D58AE1368D74F00D93743 /* Project object */; }
{ "pile_set_name": "Github" }
#if INTERACTIVE #load "../src/ProvidedTypes.fsi" "../src/ProvidedTypes.fs" #load "../src/ProvidedTypesTesting.fs" #else module TPSDK.GeneratedOpTests #endif #if !NO_GENERATIVE open System open System.Reflection open Microsoft.FSharp.Core.CompilerServices open Xunit open ProviderImplementation.ProvidedTypes open ProviderImplementation.ProvidedTypesTesting open Microsoft.FSharp.Quotations #nowarn "760" // IDisposable needs new let testProvidedAssembly exprs = let asms = AppDomain.CurrentDomain.GetAssemblies() |> Array.filter (fun x -> not x.IsDynamic) |> Array.map (fun x -> x.Location) let runtimeAssemblyRefs = Array.toList asms let runtimeAssembly = asms |> Array.find (fun x -> match IO.Path.GetFileNameWithoutExtension(x).ToLower() with "mscorlib" | "system.runtime" -> true | _ -> false) let cfg = Testing.MakeSimulatedTypeProviderConfig (__SOURCE_DIRECTORY__, runtimeAssembly, runtimeAssemblyRefs) let tp = TypeProviderForNamespaces(cfg) //:> TypeProviderForNamespaces let ns = "Tests" let tempAssembly = ProvidedAssembly() let container = ProvidedTypeDefinition(tempAssembly, ns, "Container", Some typeof<obj>, isErased = false) let mutable counter = 0 let create (expr : Expr) = counter <- counter + 1 let name = sprintf "F%d" counter ProvidedMethod(name,[],expr.Type,invokeCode = (fun _args -> expr), isStatic = true) |> container.AddMember name let names = exprs |> List.map (fst >> create) do tempAssembly.AddTypes [container] do tp.AddNamespace(container.Namespace, [container]) let providedNamespace = tp.Namespaces.[0] let providedTypes = providedNamespace.GetTypes() let providedType = providedTypes.[0] let providedTypeDefinition = providedType :?> ProvidedTypeDefinition Assert.Equal("Container", providedTypeDefinition.Name) let test (container : Type) = let call name = container.GetMethod(name).Invoke(null,[||]) (names, exprs) ||> List.iter2 (fun name (_,f) -> f(call name)) let assemContents = (tp :> ITypeProvider).GetGeneratedAssemblyContents(providedTypeDefinition.Assembly) let assembly = Assembly.Load assemContents assembly.ExportedTypes |> Seq.find (fun ty -> ty.Name = "Container") |> test let check (e : Expr<'a>) expected = e.Raw, fun o -> let actual = Assert.IsType<'a>(o) let tolerate = match typeof<'a> with | ty when ty.FullName = "System.Single" -> abs ((box expected :?> single) - (box actual :?> single)) < 0.00001f | ty when ty.FullName = "System.Double" -> abs ((box expected :?> double) - (box actual :?> double)) < 0.00001 | _ -> (expected = actual) Assert.True(tolerate, sprintf "%A Expected %A got %A. (%A)" (expected.GetType(), actual.GetType(), expected = actual) expected actual e) let checkExpr (e : Expr<'a>) = let expected = FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation(e) :?> 'a check e expected [<Fact>] let ``sub execute correctly``() = testProvidedAssembly [ checkExpr <@ 50 - 30 @> checkExpr <@ 50.0 - 30.0 @> checkExpr <@ 50.f - 30.f @> checkExpr <@ 50L - 30L @> checkExpr <@ 50UL - 30UL @> checkExpr <@ 50l - 30l @> checkExpr <@ 50s - 30s @> checkExpr <@ 50us - 30us @> check <@ 50y - 30y @> 20y check <@ 50uy - 30uy @> 20uy checkExpr <@ 50m - 30m @> checkExpr <@ TimeSpan.FromMinutes 50.0 - TimeSpan.FromMinutes 30.0 @> ] [<Fact>] let ``add execute correctly``() = testProvidedAssembly [ checkExpr <@ 50 + 30 @> checkExpr <@ 50.0 + 30.0 @> checkExpr <@ 50.f + 30.f @> checkExpr <@ 50L + 30L @> checkExpr <@ 50UL + 30UL @> checkExpr <@ 50l + 30l @> checkExpr <@ 50s + 30s @> checkExpr <@ 50us + 30us @> check <@ 50y + 30y @> 80y check <@ 50uy + 30uy @> 80uy checkExpr <@ 50m + 30m @> checkExpr <@ "50m" + "30m" @> checkExpr <@ TimeSpan.FromMinutes 50.0 + TimeSpan.FromMinutes 30.0 @> ] [<Fact>] let ``mul execute correctly``() = testProvidedAssembly [ checkExpr <@ 50 * 30 @> checkExpr <@ 50.0 * 30.0 @> checkExpr <@ 50.f * 30.f @> checkExpr <@ 50L * 30L @> checkExpr <@ 50UL * 30UL @> checkExpr <@ 50l * 30l @> checkExpr <@ 50s * 30s @> checkExpr <@ 50us * 30us @> check <@ 5y * 3y @> 15y check <@ 5uy * 3uy @> 15uy checkExpr <@ 50m * 30m @> //TODO: mul method test ] [<Fact>] let ``div execute correctly``() = testProvidedAssembly [ checkExpr <@ 50 / 30 @> checkExpr <@ 50.0 / 30.0 @> checkExpr <@ 50.f / 30.f @> checkExpr <@ 50L / 30L @> checkExpr <@ 50UL / 30UL @> checkExpr <@ 50l / 30l @> checkExpr <@ 50s / 30s @> checkExpr <@ 50us / 30us @> checkExpr <@ 50 / 10 @> checkExpr <@ 50.0 / 10.0 @> checkExpr <@ 50.f / 10.f @> checkExpr <@ 50L / 30L @> checkExpr <@ 50UL / 10UL @> checkExpr <@ 50l / 10l @> checkExpr <@ 50s / 10s @> checkExpr <@ 50us / 10us @> check <@ 50y / 10y @> 5y check <@ 50uy / 10uy @> 5uy checkExpr <@ 50m / 30m @> //TODO: mul method test ] [<Fact>] let ``neg execute correctly``() = testProvidedAssembly [ checkExpr <@ (~-) 50 @> checkExpr <@ (~-) 30.0 @> checkExpr <@ (~-) 30.f @> checkExpr <@ (~-) 30L @> checkExpr <@ (~-) 30l @> checkExpr <@ (~-) 30s @> check <@ (~-) 30y @> -30y checkExpr <@ (~-) 30m @> checkExpr <@ (~-) (TimeSpan.FromMinutes 50.0) @> ] [<Fact>] let ``pos execute correctly``() = testProvidedAssembly [ check <@ (~+) 50 @> 50 check <@ (~+) 30.0 @> 30.0 check <@ (~+) 30.f @> 30.f check <@ (~+) 30L @> 30L check <@ (~+) 30l @> 30l check <@ (~+) 30s @> 30s check <@ (~+) 30y @> 30y check <@ (~+) 30m @> 30m check <@ (~+) (TimeSpan.FromMinutes 50.0) @> (TimeSpan.FromMinutes 50.0) ] [<Fact>] let ``rem execute correctly``() = testProvidedAssembly [ checkExpr <@ 50 % 30 @> checkExpr <@ 50.0 % 30.0 @> checkExpr <@ 50.f % 30.f @> checkExpr <@ 50L % 30L @> checkExpr <@ 50UL % 30UL @> checkExpr <@ 50l % 30l @> checkExpr <@ 50s % 30s @> checkExpr <@ 50us % 30us @> check <@ 50y % 30y @> 20y check <@ 50uy % 30uy @> 20uy checkExpr <@ 50m % 30m @> //TODO: rem method test ] [<Fact>] let ``shl execute correctly``() = testProvidedAssembly [ checkExpr <@ 2 <<< 3 @> checkExpr <@ 2L <<< 3 @> checkExpr <@ 5UL <<< 3 @> checkExpr <@ 5l <<< 3 @> checkExpr <@ 5s <<< 3 @> checkExpr <@ 5us <<< 3 @> checkExpr <@ 5y <<< 3 @> checkExpr <@ 5uy <<< 3 @> checkExpr <@ 2 <<< 1 @> checkExpr <@ 2L <<< 1 @> checkExpr <@ 5UL <<< 1 @> checkExpr <@ 5l <<< 1 @> checkExpr <@ 5s <<< 1 @> checkExpr <@ 5us <<< 1 @> checkExpr <@ 5y <<< 1 @> checkExpr <@ 5uy <<< 1 @> ] [<Fact>] let ``shr execute correctly``() = testProvidedAssembly [ checkExpr <@ 2 >>> 3 @> checkExpr <@ 2L >>> 3 @> checkExpr <@ 5UL >>> 3 @> checkExpr <@ 5l >>> 3 @> checkExpr <@ 5s >>> 3 @> checkExpr <@ 5us >>> 3 @> checkExpr <@ 5y >>> 3 @> checkExpr <@ 5uy >>> 3 @> checkExpr <@ 2 >>> 1 @> checkExpr <@ 2L >>> 1 @> checkExpr <@ 5UL >>> 1 @> checkExpr <@ 5l >>> 1 @> checkExpr <@ 5s >>> 1 @> checkExpr <@ 5us >>> 1 @> checkExpr <@ 5y >>> 1 @> checkExpr <@ 5uy >>> 1 @> ] [<Fact>] let ``int execute correctly``() = testProvidedAssembly [ check <@ int "50" @> 50 checkExpr <@ int 50 @> checkExpr <@ int 50.0 @> checkExpr <@ int 50.f @> checkExpr <@ int 50UL @> checkExpr <@ int 50l @> checkExpr <@ int 50s @> checkExpr <@ int 50us @> checkExpr <@ int 50y @> checkExpr <@ int 50uy @> checkExpr <@ int 50m @> checkExpr <@ int 50I @> ] [<Fact>] let ``int32 execute correctly``() = testProvidedAssembly [ check <@ int32 "50" @> 50 checkExpr <@ int32 50 @> checkExpr <@ int32 50.0 @> checkExpr <@ int32 50.f @> checkExpr <@ int32 50UL @> checkExpr <@ int32 50l @> checkExpr <@ int32 50s @> checkExpr <@ int32 50us @> checkExpr <@ int32 50y @> checkExpr <@ int32 50uy @> checkExpr <@ int32 50m @> checkExpr <@ int32 50I @> ] [<Fact>] let ``int64 execute correctly``() = testProvidedAssembly [ check <@ int64 "50" @> 50L checkExpr <@ int64 50 @> checkExpr <@ int64 50.0 @> checkExpr <@ int64 50.f @> checkExpr <@ int64 50UL @> checkExpr <@ int64 50l @> checkExpr <@ int64 50s @> checkExpr <@ int64 50us @> checkExpr <@ int64 50y @> checkExpr <@ int64 50uy @> checkExpr <@ int64 50m @> checkExpr <@ int64 50I @> ] [<Fact>] let ``int16 execute correctly``() = testProvidedAssembly [ check <@ int16 "50" @> 50s checkExpr <@ int16 50 @> checkExpr <@ int16 50.0 @> checkExpr <@ int16 50.f @> checkExpr <@ int16 50UL @> checkExpr <@ int16 50l @> checkExpr <@ int16 50s @> checkExpr <@ int16 50us @> checkExpr <@ int16 50y @> checkExpr <@ int16 50uy @> checkExpr <@ int16 50m @> checkExpr <@ int16 50I @> ] [<Fact>] let ``uint32 execute correctly``() = testProvidedAssembly [ check <@ uint32 "50" @> 50u checkExpr <@ uint32 50 @> checkExpr <@ uint32 50.0 @> checkExpr <@ uint32 50.f @> checkExpr <@ uint32 50UL @> checkExpr <@ uint32 50l @> checkExpr <@ uint32 50s @> checkExpr <@ uint32 50us @> checkExpr <@ uint32 50y @> checkExpr <@ uint32 50uy @> checkExpr <@ uint32 50m @> checkExpr <@ uint32 50I @> ] [<Fact>] let ``uint64 execute correctly``() = testProvidedAssembly [ check <@ uint64 "50" @> 50UL checkExpr <@ uint64 50 @> checkExpr <@ uint64 50.0 @> checkExpr <@ uint64 50.f @> checkExpr <@ uint64 50UL @> checkExpr <@ uint64 50l @> checkExpr <@ uint64 50s @> checkExpr <@ uint64 50us @> checkExpr <@ uint64 50y @> checkExpr <@ uint64 50uy @> checkExpr <@ uint64 50m @> checkExpr <@ uint64 50I @> ] [<Fact>] let ``uint16 execute correctly``() = testProvidedAssembly [ check <@ uint16 "50" @> 50us checkExpr <@ uint16 50 @> checkExpr <@ uint16 50.0 @> checkExpr <@ uint16 50.f @> checkExpr <@ uint16 50UL @> checkExpr <@ uint16 50l @> checkExpr <@ uint16 50s @> checkExpr <@ uint16 50us @> checkExpr <@ uint16 50y @> checkExpr <@ uint16 50uy @> checkExpr <@ uint16 50m @> checkExpr <@ uint16 50I @> ] [<Fact>] let ``byte execute correctly``() = testProvidedAssembly [ check <@ byte "50" @> 50uy checkExpr <@ byte 50 @> checkExpr <@ byte 50.0 @> checkExpr <@ byte 50.f @> checkExpr <@ byte 50UL @> checkExpr <@ byte 50l @> checkExpr <@ byte 50s @> checkExpr <@ byte 50us @> checkExpr <@ byte 50y @> checkExpr <@ byte 50uy @> checkExpr <@ byte 50m @> checkExpr <@ byte 50I @> ] [<Fact>] let ``sbyte execute correctly``() = testProvidedAssembly [ check <@ sbyte "50" @> 50y checkExpr <@ sbyte 50 @> checkExpr <@ sbyte 50.0 @> checkExpr <@ sbyte 50.f @> checkExpr <@ sbyte 50UL @> checkExpr <@ sbyte 50l @> checkExpr <@ sbyte 50s @> checkExpr <@ sbyte 50us @> checkExpr <@ sbyte 50y @> checkExpr <@ sbyte 50uy @> checkExpr <@ sbyte 50m @> checkExpr <@ sbyte 50I @> ] [<Fact>] let ``float32 execute correctly``() = testProvidedAssembly [ check <@ float32 "50" @> 50.f checkExpr <@ float32 50 @> checkExpr <@ float32 50.0 @> checkExpr <@ float32 50.f @> checkExpr <@ float32 50UL @> checkExpr <@ float32 50l @> checkExpr <@ float32 50s @> checkExpr <@ float32 50us @> checkExpr <@ float32 50y @> checkExpr <@ float32 50uy @> checkExpr <@ float32 50m @> checkExpr <@ float32 50I @> ] [<Fact>] let ``float execute correctly``() = testProvidedAssembly [ check <@ float "50" @> 50.0 checkExpr <@ float 50 @> checkExpr <@ float 50.0 @> checkExpr <@ float 50.f @> checkExpr <@ float 50UL @> checkExpr <@ float 50l @> checkExpr <@ float 50s @> checkExpr <@ float 50us @> checkExpr <@ float 50y @> checkExpr <@ float 50uy @> checkExpr <@ float 50m @> checkExpr <@ float 50I @> ] [<Fact>] let ``double execute correctly``() = testProvidedAssembly [ check <@ double "50" @> 50.0 checkExpr <@ double 50 @> checkExpr <@ double 50.0 @> checkExpr <@ double 50.f @> checkExpr <@ double 50UL @> checkExpr <@ double 50l @> checkExpr <@ double 50s @> checkExpr <@ double 50us @> checkExpr <@ double 50y @> checkExpr <@ double 50uy @> checkExpr <@ double 50m @> checkExpr <@ double 50I @> ] [<Fact>] let ``decimal execute correctly``() = testProvidedAssembly [ check <@ decimal "50" @> 50m checkExpr <@ decimal 50 @> checkExpr <@ decimal 50.0 @> checkExpr <@ decimal 50.f @> checkExpr <@ decimal 50UL @> checkExpr <@ decimal 50l @> checkExpr <@ decimal 50s @> checkExpr <@ decimal 50us @> checkExpr <@ decimal 50y @> checkExpr <@ decimal 50uy @> checkExpr <@ decimal 50m @> checkExpr <@ decimal 50I @> ] [<Fact>] let ``char execute correctly``() = testProvidedAssembly [ check <@ char "5" @> '5' checkExpr <@ char 50 @> checkExpr <@ char 50.0 @> checkExpr <@ char 50.f @> checkExpr <@ char 50UL @> checkExpr <@ char 50l @> checkExpr <@ char 50s @> checkExpr <@ char 50us @> checkExpr <@ char 50y @> checkExpr <@ char 50uy @> checkExpr <@ char 50m @> ] [<Fact>] let ``eq execute correctly``() = testProvidedAssembly [ checkExpr <@ true = true @> checkExpr <@ true = false @> checkExpr <@ false = false @> checkExpr <@ false = true @> checkExpr <@ 1y = 1y @> checkExpr <@ 2y = 1y @> checkExpr <@ 1y = 2y @> checkExpr <@ 1s = 1s @> checkExpr <@ 2s = 1s @> checkExpr <@ 1s = 2s @> checkExpr <@ 1 = 1 @> checkExpr <@ 2 = 1 @> checkExpr <@ 1 = 2 @> checkExpr <@ 1L = 1L @> checkExpr <@ 2L = 1L @> checkExpr <@ 1L = 2L @> checkExpr <@ 1uy = 1uy @> checkExpr <@ 2uy = 1uy @> checkExpr <@ 1uy = 2uy @> checkExpr <@ 1us = 1us @> checkExpr <@ 2us = 1us @> checkExpr <@ 1us = 2us @> checkExpr <@ 1u = 1u @> checkExpr <@ 2u = 1u @> checkExpr <@ 1u = 2u @> checkExpr <@ 1UL = 1UL @> checkExpr <@ 2UL = 1UL @> checkExpr <@ 1UL = 2UL @> checkExpr <@ 1.0 = 1.0 @> checkExpr <@ 2.0 = 1.0 @> checkExpr <@ 1.0 = 2.0 @> checkExpr <@ 1.0 = nan @> checkExpr <@ nan = nan @> checkExpr <@ nan = 1.0 @> checkExpr <@ 1.0f = nanf @> checkExpr <@ nanf = nanf @> checkExpr <@ nanf = 1.0f @> checkExpr <@ 1.f = 1.f @> checkExpr <@ 2.f = 1.f @> checkExpr <@ 1.f = 2.f @> checkExpr <@ '1' = '1' @> checkExpr <@ '2' = '1' @> checkExpr <@ '1' = '2' @> checkExpr <@ 1m = 1m @> checkExpr <@ 2m = 1m @> checkExpr <@ 1m = 2m @> checkExpr <@ "1" = "1" @> checkExpr <@ "2" = "1" @> checkExpr <@ "1" = "2" @> checkExpr <@ DateTime(2000,1,1) = DateTime(2000,1,1) @> checkExpr <@ DateTime(2000,1,1) = DateTime(2000,1,2) @> ] [<Fact>] let ``lt execute correctly``() = testProvidedAssembly [ check <@ true < true @> (true < true) check <@ true < false @> (true < false) check <@ false < false @> (false < false) check <@ false < true @> (false < true) checkExpr <@ 1y < 1y @> checkExpr <@ 2y < 1y @> checkExpr <@ 1y < 2y @> checkExpr <@ 1s < 1s @> checkExpr <@ 2s < 1s @> checkExpr <@ 1s < 2s @> checkExpr <@ 1 < 1 @> checkExpr <@ 2 < 1 @> checkExpr <@ 1 < 2 @> checkExpr <@ 1L < 1L @> checkExpr <@ 2L < 1L @> checkExpr <@ 1L < 2L @> checkExpr <@ 1uy < 1uy @> checkExpr <@ 2uy < 1uy @> checkExpr <@ 1uy < 2uy @> checkExpr <@ 1us < 1us @> checkExpr <@ 2us < 1us @> checkExpr <@ 1us < 2us @> checkExpr <@ 1u < 1u @> checkExpr <@ 2u < 1u @> checkExpr <@ 1u < 2u @> checkExpr <@ 1UL < 1UL @> checkExpr <@ 2UL < 1UL @> checkExpr <@ 1UL < 2UL @> checkExpr <@ 1.0 < 1.0 @> checkExpr <@ 2.0 < 1.0 @> checkExpr <@ 1.0 < 2.0 @> checkExpr <@ 1.0 < nan @> checkExpr <@ nan < nan @> checkExpr <@ nan < 1.0 @> checkExpr <@ 1.0f < nanf @> checkExpr <@ nanf < nanf @> checkExpr <@ nanf < 1.0f @> checkExpr <@ 1.f < 1.f @> checkExpr <@ 2.f < 1.f @> checkExpr <@ 1.f < 2.f @> checkExpr <@ '1' < '1' @> checkExpr <@ '2' < '1' @> checkExpr <@ '1' < '2' @> checkExpr <@ 1m < 1m @> checkExpr <@ 2m < 1m @> checkExpr <@ 1m < 2m @> check <@ "1" < "1" @> ("1" < "1") check <@ "2" < "1" @> ("2" < "1") check <@ "1" < "2" @> ("1" < "2") checkExpr <@ DateTime(2000,1,1) < DateTime(2000,1,1) @> checkExpr <@ DateTime(2000,1,1) < DateTime(2000,1,2) @> ] [<Fact>] let ``lte execute correctly``() = testProvidedAssembly [ check <@ true <= true @> (true <= true) check <@ true <= false @> (true <= false) check <@ false <= false @> (false <= false) check <@ false <= true @> (false <= true) checkExpr <@ 1y <= 1y @> checkExpr <@ 2y <= 1y @> checkExpr <@ 1y <= 2y @> checkExpr <@ 1s <= 1s @> checkExpr <@ 2s <= 1s @> checkExpr <@ 1s <= 2s @> checkExpr <@ 1 <= 1 @> checkExpr <@ 2 <= 1 @> checkExpr <@ 1 <= 2 @> checkExpr <@ 1L <= 1L @> checkExpr <@ 2L <= 1L @> checkExpr <@ 1L <= 2L @> checkExpr <@ 1uy <= 1uy @> checkExpr <@ 2uy <= 1uy @> checkExpr <@ 1uy <= 2uy @> checkExpr <@ 1us <= 1us @> checkExpr <@ 2us <= 1us @> checkExpr <@ 1us <= 2us @> checkExpr <@ 1u <= 1u @> checkExpr <@ 2u <= 1u @> checkExpr <@ 1u <= 2u @> checkExpr <@ 1UL <= 1UL @> checkExpr <@ 2UL <= 1UL @> checkExpr <@ 1UL <= 2UL @> checkExpr <@ 1.0 <= 1.0 @> checkExpr <@ 2.0 <= 1.0 @> checkExpr <@ 1.0 <= 2.0 @> checkExpr <@ 1.0 <= nan @> checkExpr <@ nan <= nan @> checkExpr <@ nan <= 1.0 @> checkExpr <@ 1.0f <= nanf @> checkExpr <@ nanf <= nanf @> checkExpr <@ nanf <= 1.0f @> checkExpr <@ 1.f <= 1.f @> checkExpr <@ 2.f <= 1.f @> checkExpr <@ 1.f <= 2.f @> checkExpr <@ '1' <= '1' @> checkExpr <@ '2' <= '1' @> checkExpr <@ '1' <= '2' @> checkExpr <@ 1m <= 1m @> checkExpr <@ 2m <= 1m @> checkExpr <@ 1m <= 2m @> check <@ "1" <= "1" @> ("1" <= "1") check <@ "2" <= "1" @> ("2" <= "1") check <@ "1" <= "2" @> ("1" <= "2") checkExpr <@ DateTime(2000,1,1) <= DateTime(2000,1,1) @> checkExpr <@ DateTime(2000,1,1) <= DateTime(2000,1,2) @> ] [<Fact>] let ``gt execute correctly``() = testProvidedAssembly [ check <@ true > true @> (true > true) check <@ true > false @> (true > false) check <@ false > false @> (false > false) check <@ false > true @> (false > true) checkExpr <@ 1y > 1y @> checkExpr <@ 2y > 1y @> checkExpr <@ 1y > 2y @> checkExpr <@ 1s > 1s @> checkExpr <@ 2s > 1s @> checkExpr <@ 1s > 2s @> checkExpr <@ 1 > 1 @> checkExpr <@ 2 > 1 @> checkExpr <@ 1 > 2 @> checkExpr <@ 1L > 1L @> checkExpr <@ 2L > 1L @> checkExpr <@ 1L > 2L @> checkExpr <@ 1uy > 1uy @> checkExpr <@ 2uy > 1uy @> checkExpr <@ 1uy > 2uy @> checkExpr <@ 1us > 1us @> checkExpr <@ 2us > 1us @> checkExpr <@ 1us > 2us @> checkExpr <@ 1u > 1u @> checkExpr <@ 2u > 1u @> checkExpr <@ 1u > 2u @> checkExpr <@ 1UL > 1UL @> checkExpr <@ 2UL > 1UL @> checkExpr <@ 1UL > 2UL @> checkExpr <@ 1.0 > 1.0 @> checkExpr <@ 2.0 > 1.0 @> checkExpr <@ 1.0 > 2.0 @> checkExpr <@ 1.0 > nan @> checkExpr <@ nan > nan @> checkExpr <@ nan > 1.0 @> checkExpr <@ 1.0f > nanf @> checkExpr <@ nanf > nanf @> checkExpr <@ nanf > 1.0f @> checkExpr <@ 1.f > 1.f @> checkExpr <@ 2.f > 1.f @> checkExpr <@ 1.f > 2.f @> checkExpr <@ '1' > '1' @> checkExpr <@ '2' > '1' @> checkExpr <@ '1' > '2' @> checkExpr <@ 1m > 1m @> checkExpr <@ 2m > 1m @> checkExpr <@ 1m > 2m @> check <@ "1" > "1" @> ("1" > "1") check <@ "2" > "1" @> ("2" > "1") check <@ "1" > "2" @> ("1" > "2") checkExpr <@ DateTime(2000,1,1) > DateTime(2000,1,1) @> checkExpr <@ DateTime(2000,1,1) > DateTime(2000,1,2) @> ] [<Fact>] let ``gte execute correctly``() = testProvidedAssembly [ check <@ true >= true @> (true >= true) check <@ true >= false @> (true >= false) check <@ false >= false @> (false >= false) check <@ false >= true @> (false >= true) checkExpr <@ 1y >= 1y @> checkExpr <@ 2y >= 1y @> checkExpr <@ 1y >= 2y @> checkExpr <@ 1s >= 1s @> checkExpr <@ 2s >= 1s @> checkExpr <@ 1s >= 2s @> checkExpr <@ 1 >= 1 @> checkExpr <@ 2 >= 1 @> checkExpr <@ 1 >= 2 @> checkExpr <@ 1L >= 1L @> checkExpr <@ 2L >= 1L @> checkExpr <@ 1L >= 2L @> checkExpr <@ 1uy >= 1uy @> checkExpr <@ 2uy >= 1uy @> checkExpr <@ 1uy >= 2uy @> checkExpr <@ 1us >= 1us @> checkExpr <@ 2us >= 1us @> checkExpr <@ 1us >= 2us @> checkExpr <@ 1u >= 1u @> checkExpr <@ 2u >= 1u @> checkExpr <@ 1u >= 2u @> checkExpr <@ 1UL >= 1UL @> checkExpr <@ 2UL >= 1UL @> checkExpr <@ 1UL >= 2UL @> checkExpr <@ 1.0 >= 1.0 @> checkExpr <@ 2.0 >= 1.0 @> checkExpr <@ 1.0 >= 2.0 @> checkExpr <@ 1.0 >= nan @> checkExpr <@ nan >= nan @> checkExpr <@ nan >= 1.0 @> checkExpr <@ 1.0f >= nanf @> checkExpr <@ nanf >= nanf @> checkExpr <@ nanf >= 1.0f @> checkExpr <@ 1.f >= 1.f @> checkExpr <@ 2.f >= 1.f @> checkExpr <@ 1.f >= 2.f @> checkExpr <@ '1' >= '1' @> checkExpr <@ '2' >= '1' @> checkExpr <@ '1' >= '2' @> checkExpr <@ 1m >= 1m @> checkExpr <@ 2m >= 1m @> checkExpr <@ 1m >= 2m @> check <@ "1" >= "1" @> ("1" >= "1") check <@ "2" >= "1" @> ("2" >= "1") check <@ "1" >= "2" @> ("1" >= "2") checkExpr <@ DateTime(2000,1,1) >= DateTime(2000,1,1) @> checkExpr <@ DateTime(2000,1,1) >= DateTime(2000,1,2) @> ] [<Fact>] let ``abs execute correctly``() = testProvidedAssembly [ checkExpr <@ abs 50 @> checkExpr <@ abs 50.0 @> checkExpr <@ abs 50.f @> checkExpr <@ abs 50l @> checkExpr <@ abs 50s @> checkExpr <@ abs 50y @> checkExpr <@ abs 50m @> checkExpr <@ abs 50I @> checkExpr <@ abs -50 @> checkExpr <@ abs -50.0 @> checkExpr <@ abs -50.f @> checkExpr <@ abs -50l @> checkExpr <@ abs -50s @> checkExpr <@ abs -50y @> checkExpr <@ abs -50m @> checkExpr <@ abs -50I @> ] [<Fact>] let ``acos execute correctly``() = testProvidedAssembly [ checkExpr <@ acos 0.1 @> checkExpr <@ acos 0.1f @> checkExpr <@ acos -0.1 @> checkExpr <@ acos -0.1f @> ] [<Fact>] let ``asin execute correctly``() = testProvidedAssembly [ checkExpr <@ asin 0.1 @> checkExpr <@ asin 0.1f @> checkExpr <@ asin -0.1 @> checkExpr <@ asin -0.1f @> ] [<Fact>] let ``atan execute correctly``() = testProvidedAssembly [ checkExpr <@ atan 0.1 @> checkExpr <@ atan 0.1f @> checkExpr <@ atan -0.1 @> checkExpr <@ atan -0.1f @> ] [<Fact>] let ``atan2 execute correctly``() = testProvidedAssembly [ checkExpr <@ atan2 0.1 0.3 @> checkExpr <@ atan2 0.1f 0.3f @> checkExpr <@ atan2 -0.1 0.3 @> checkExpr <@ atan2 -0.1f 0.3f @> ] [<Fact>] let ``ceil execute correctly``() = testProvidedAssembly [ checkExpr <@ ceil 0.1 @> checkExpr <@ ceil 0.1f @> checkExpr <@ ceil -0.1 @> checkExpr <@ ceil -0.1f @> ] [<Fact>] let ``exp execute correctly``() = testProvidedAssembly [ checkExpr <@ exp 0.1 @> checkExpr <@ exp 0.1f @> checkExpr <@ exp -0.1 @> checkExpr <@ exp -0.1f @> ] [<Fact>] let ``floor execute correctly``() = testProvidedAssembly [ checkExpr <@ floor 0.1 @> checkExpr <@ floor 0.1f @> checkExpr <@ floor -0.1 @> checkExpr <@ floor -0.1f @> ] [<Fact>] let ``truncate execute correctly``() = testProvidedAssembly [ checkExpr <@ truncate 0.1 @> checkExpr <@ truncate 0.1f @> checkExpr <@ truncate -0.1 @> checkExpr <@ truncate -0.1f @> ] [<Fact>] let ``round execute correctly``() = testProvidedAssembly [ checkExpr <@ round 0.1 @> checkExpr <@ round 0.1f @> checkExpr <@ round -0.1 @> checkExpr <@ round -0.1f @> ] [<Fact>] let ``sign execute correctly``() = testProvidedAssembly [ checkExpr <@ sign 0.1 @> checkExpr <@ sign 0.1f @> checkExpr <@ sign -0.1 @> checkExpr <@ sign -0.1f @> ] [<Fact>] let ``log execute correctly``() = testProvidedAssembly [ checkExpr <@ log 0.1 @> checkExpr <@ log 0.1f @> ] [<Fact>] let ``log10 execute correctly``() = testProvidedAssembly [ checkExpr <@ log10 0.1 @> checkExpr <@ log10 0.1f @> ] [<Fact>] let ``sqrt execute correctly``() = testProvidedAssembly [ checkExpr <@ sqrt 0.1 @> checkExpr <@ sqrt 0.1f @> ] [<Fact>] let ``cos execute correctly``() = testProvidedAssembly [ checkExpr <@ cos 0.1 @> checkExpr <@ cos 0.1f @> checkExpr <@ cos -0.1 @> checkExpr <@ cos -0.1f @> ] [<Fact>] let ``cosh execute correctly``() = testProvidedAssembly [ checkExpr <@ cosh 0.1 @> checkExpr <@ cosh 0.1f @> checkExpr <@ cosh -0.1 @> checkExpr <@ cosh -0.1f @> ] [<Fact>] let ``sin execute correctly``() = testProvidedAssembly [ checkExpr <@ sin 0.1 @> checkExpr <@ sin 0.1f @> checkExpr <@ sin -0.1 @> checkExpr <@ sin -0.1f @> ] [<Fact>] let ``sinh execute correctly``() = testProvidedAssembly [ checkExpr <@ sinh 0.1 @> checkExpr <@ sinh 0.1f @> checkExpr <@ sinh -0.1 @> checkExpr <@ sinh -0.1f @> ] [<Fact>] let ``tan execute correctly``() = testProvidedAssembly [ checkExpr <@ tan 0.1 @> checkExpr <@ tan 0.1f @> checkExpr <@ tan -0.1 @> checkExpr <@ tan -0.1f @> ] [<Fact>] let ``tanh execute correctly``() = testProvidedAssembly [ checkExpr <@ tanh 0.1 @> checkExpr <@ tanh 0.1f @> checkExpr <@ tanh -0.1 @> checkExpr <@ tanh -0.1f @> ] [<Fact>] let ``pow execute correctly``() = testProvidedAssembly [ checkExpr <@ 0.1**2.5 @> checkExpr <@ 0.1f**2.5f @> ] [<Fact>] let ``max execute correctly``() = testProvidedAssembly [ checkExpr <@ max 0.1 2.5 @> checkExpr <@ max 2.5 0.1 @> checkExpr <@ max 1 2 @> checkExpr <@ max 2 1 @> checkExpr <@ max 0.1f 2.5f @> checkExpr <@ max 2.5f 0.1f @> checkExpr <@ max 10I 20I @> check <@ let mutable a = 2 let mx = max (a <- a + 1; 2) (a <- a*7; 5) (mx,a) @> ( let mutable a = 2 let mx = max (a <- a + 1; 2) (a <- a*7; 5) (mx,a) ) ] [<Fact>] let ``min execute correctly``() = testProvidedAssembly [ checkExpr <@ min 0.1 2.5 @> checkExpr <@ min 2.5 0.1 @> checkExpr <@ min 1 2 @> checkExpr <@ min 2 1 @> checkExpr <@ min 0.1f 2.5f @> checkExpr <@ min 2.5f 0.1f @> checkExpr <@ min 10I 20I @> check <@ let mutable a = 2 let mn = min (a <- a + 1; 2) (a <- a*7; 5) (mn,a) @> ( let mutable a = 2 let mn = min (a <- a + 1; 2) (a <- a*7; 5) (mn,a) ) ] [<Fact>] let ``bitwise and execute correctly``() = testProvidedAssembly [ checkExpr <@ 123441 &&& 4125211 @> checkExpr <@ 123441L &&& 4125211L @> checkExpr <@ 1234s &&& 4125s @> checkExpr <@ 12y &&& 41y @> checkExpr <@ 123441u &&& 4125211u @> checkExpr <@ 123441UL &&& 4125211UL @> checkExpr <@ 1234us &&& 4125us @> checkExpr <@ 12uy &&& 41uy @> ] [<Fact>] let ``bitwise or execute correctly``() = testProvidedAssembly [ checkExpr <@ 123441 ||| 4125211 @> checkExpr <@ 123441L ||| 4125211L @> checkExpr <@ 1234s ||| 4125s @> checkExpr <@ 12y ||| 41y @> checkExpr <@ 123441u ||| 4125211u @> checkExpr <@ 123441UL ||| 4125211UL @> checkExpr <@ 1234us ||| 4125us @> checkExpr <@ 12uy ||| 41uy @> ] [<Fact>] let ``bitwise xor execute correctly``() = testProvidedAssembly [ checkExpr <@ 123441 ^^^ 4125211 @> checkExpr <@ 123441L ^^^ 4125211L @> checkExpr <@ 1234s ^^^ 4125s @> checkExpr <@ 12y ^^^ 41y @> checkExpr <@ 123441u ^^^ 4125211u @> checkExpr <@ 123441UL ^^^ 4125211UL @> checkExpr <@ 1234us ^^^ 4125us @> checkExpr <@ 12uy ^^^ 41uy @> ] [<Fact>] let ``bitwise not execute correctly``() = testProvidedAssembly [ checkExpr <@ ~~~123441 @> checkExpr <@ ~~~123441L @> checkExpr <@ ~~~1234s @> checkExpr <@ ~~~12y @> checkExpr <@ ~~~123441u @> checkExpr <@ ~~~123441UL @> checkExpr <@ ~~~1234us @> checkExpr <@ ~~~12uy @> ] #endif
{ "pile_set_name": "Github" }
#!/usr/bin/env ruby # # Copyright 2010 Twitter, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. $:.push(File.dirname($0)) require 'optparse' require 'socket' require 'simple' PACKAGE = "com.twitter.service.flock.edges" GRAPH_COUNT = 15 SHARD_CLASS = { :read_only => "ReadOnlyShard", :blocked => "BlockedShard", :write_only => "WriteOnlyShard", :black_hole => "BlackHoleShard", :replica => "ReplicatingShard" } SHARD_NAME = Hash[*SHARD_CLASS.map { |a, b| [ b, a ] }.flatten] DIRECTIONS = [ "backward", "forward" ] ShardInfo = ThriftClient::Simple.make_struct(:ShardInfo, ThriftClient::Simple::Field.new(:class_name, ThriftClient::Simple::STRING, 1), ThriftClient::Simple::Field.new(:table_prefix, ThriftClient::Simple::STRING, 2), ThriftClient::Simple::Field.new(:hostname, ThriftClient::Simple::STRING, 3), ThriftClient::Simple::Field.new(:source_type, ThriftClient::Simple::STRING, 4), ThriftClient::Simple::Field.new(:destination_type, ThriftClient::Simple::STRING, 5), ThriftClient::Simple::Field.new(:busy, ThriftClient::Simple::I32, 6), ThriftClient::Simple::Field.new(:shard_id, ThriftClient::Simple::I32, 7)) ShardChild = ThriftClient::Simple.make_struct(:ShardChild, ThriftClient::Simple::Field.new(:shard_id, ThriftClient::Simple::I32, 1), ThriftClient::Simple::Field.new(:weight, ThriftClient::Simple::I32, 2)) Forwarding = ThriftClient::Simple.make_struct(:Forwarding, ThriftClient::Simple::Field.new(:table_id, ThriftClient::Simple::I32, 1), ThriftClient::Simple::Field.new(:base_id, ThriftClient::Simple::I64, 2), ThriftClient::Simple::Field.new(:shard_id, ThriftClient::Simple::I32, 3)) ShardMigration = ThriftClient::Simple.make_struct(:ShardMigration, ThriftClient::Simple::Field.new(:source_shard_id, ThriftClient::Simple::I32, 1), ThriftClient::Simple::Field.new(:destination_shard_id, ThriftClient::Simple::I32, 2), ThriftClient::Simple::Field.new(:replicating_shard_id, ThriftClient::Simple::I32, 3), ThriftClient::Simple::Field.new(:write_only_shard_id, ThriftClient::Simple::I32, 4)) class ShardManager < ThriftClient::Simple::ThriftService thrift_method :create_shard, i32, field(:shard, struct(ShardInfo), 1) thrift_method :find_shard, i32, field(:shard, struct(ShardInfo), 1) thrift_method :get_shard, struct(ShardInfo), field(:shard_id, i32, 1) thrift_method :update_shard, void, field(:shard, struct(ShardInfo), 1) thrift_method :delete_shard, void, field(:shard_id, i32, 1) thrift_method :add_child_shard, void, field(:parent_shard_id, i32, 1), field(:child_shard_id, i32, 2), field(:weight, i32, 3) thrift_method :remove_child_shard, void, field(:parent_shard_id, i32, 1), field(:child_shard_id, i32, 2) thrift_method :replace_child_shard, void, field(:old_child_shard_id, i32, 1), field(:new_child_shard_id, i32, 2) thrift_method :list_shard_children, list(struct(ShardChild)), field(:shard_id, i32, 1) thrift_method :mark_shard_busy, void, field(:shard_id, i32, 1), field(:busy, i32, 2) thrift_method :copy_shard, void, field(:source_shard_id, i32, 1), field(:destination_shard_id, i32, 2) thrift_method :setup_migration, struct(ShardMigration), field(:source_shard_info, struct(ShardInfo), 1), field(:destination_shard_info, struct(ShardInfo), 2) thrift_method :migrate_shard, void, field(:migration, struct(ShardMigration), 1) thrift_method :set_forwarding, void, field(:forwarding, struct(Forwarding), 1) thrift_method :replace_forwarding, void, field(:old_shard_id, i32, 1), field(:new_shard_id, i32, 2) thrift_method :get_forwarding, struct(ShardInfo), field(:table_id, i32, 1), field(:base_id, i64, 2) thrift_method :get_forwarding_for_shard, struct(Forwarding), field(:shard_id, i32, 1) thrift_method :get_forwardings, list(struct(Forwarding)) thrift_method :reload_forwardings, void thrift_method :find_current_forwarding, struct(ShardInfo), field(:table_id, i32, 1), field(:id, i64, 2) thrift_method :shard_ids_for_hostname, list(i32), field(:hostname, string, 1), field(:class_name, string, 2) thrift_method :shards_for_hostname, list(struct(ShardInfo)), field(:hostname, string, 1), field(:class_name, string, 2) thrift_method :get_busy_shards, list(struct(ShardInfo)) thrift_method :get_parent_shard, struct(ShardInfo), field(:shard_id, i32, 1) thrift_method :get_root_shard, struct(ShardInfo), field(:shard_id, i32, 1) thrift_method :get_child_shards_of_class, list(struct(ShardInfo)), field(:parent_shard_id, i32, 1), field(:class_name, string, 2) thrift_method :rebuild_schema, void end class JobManager < ThriftClient::Simple::ThriftService thrift_method :retry_errors, void thrift_method :stop_writes, void thrift_method :resume_writes, void thrift_method :retry_errors_for, void, field(:priority, i32, 1) thrift_method :stop_writes_for, void, field(:priority, i32, 1) thrift_method :resume_writes_for, void, field(:priority, i32, 1) thrift_method :is_writing, bool, field(:priority, i32, 1) thrift_method :inject_job, void, field(:priority, i32, 1), field(:job, string, 2) end SHARD_PORT = 7917 JOB_PORT = 7919 # for use inside flocker: Shard = Struct.new("Shard", :id, :type, :faction, :hostname, :table_prefix, :busy, :children, :weight) # ruby 1.9 is incompatible with 1.8 :( def ord(char) char.ord rescue char[0] end def confirm(message, &block) return if $options[:force] print "#{message} [Y] " STDOUT.flush if [ "y", "Y", "" ].include?(STDIN.gets.chomp) return else yield if block exit 1 end end def get_shard(shard_info, weight=1) class_bits = shard_info.class_name.split(".") shard_type, faction = class_bits[-1], class_bits[-2] shard = Shard.new(shard_info.shard_id, shard_type, faction, shard_info.hostname, shard_info.table_prefix, shard_info.busy) shard.children = $service.list_shard_children(shard_info.shard_id).map { |child| get_shard($service.get_shard(child.shard_id), child.weight) } shard.weight = weight shard end def pp_children(shard) shard.children.map do |s| pp_shard(s) + (s.weight == 1 ? "" : "<#{s.weight}>") end.join(', ') end def pp_shard(shard) ($options[:show_ids] ? "[#{shard.id}]" : "") + if shard.type == "SqlShard" "#{shard.hostname}/#{shard.table_prefix}" + (shard.busy > 0 ? " (BUSY)" : "") else "#{shard.faction}-#{SHARD_NAME[shard.type]}(#{pp_children(shard)})" end end def with_each_shard_for_db(database_name, options={}, &block) shards = $service.shards_for_hostname(database_name, "#{PACKAGE}.SqlShard") if shards.size == 0 puts "No shards are using '#{database_name}'!" return end puts "Shards on #{database_name}: #{shards.size}" if options[:dots] count = 0 shards.each do |shard| yield shard if options[:dots] count += 1 STDOUT.print "." if count % 10 == 0 STDOUT.print "(#{count})" if count % 100 == 0 STDOUT.flush end end puts "done." if options[:dots] end def connect_shard_service(hostname) ShardManager.new(TCPSocket.new(hostname, SHARD_PORT)) end def connect_job_service(hostname) JobManager.new(TCPSocket.new(hostname, JOB_PORT)) end def parent_of_type(shard, shard_type) wanted_class = SHARD_CLASS[shard_type] parent = $service.get_parent_shard(shard.shard_id) while !parent.class_name.include?(wanted_class) && parent.shard_id != shard.shard_id shard = parent parent = $service.get_parent_shard(shard.shard_id) end if parent.class_name.include?(wanted_class) [ parent, shard ] else nil end end # inject a shard above a given one, for the purpose of making it readonly, etc def inject_shard(shard_type, shard) shard = $service.get_shard(shard) if shard.instance_of?(Fixnum) new_shard = ShardInfo.new("#{PACKAGE}.#{SHARD_CLASS[shard_type]}", "#{shard.table_prefix}_#{shard_type}_inject", shard.hostname, "", "") new_shard_id = $service.create_shard(new_shard) parent_shard = $service.get_parent_shard(shard.shard_id) if parent_shard.shard_id != shard.shard_id child_info = $service.list_shard_children(parent_shard.shard_id).select do |child| child.shard_id == shard.shard_id end.first $service.remove_child_shard(parent_shard.shard_id, shard.shard_id) $service.add_child_shard(parent_shard.shard_id, new_shard_id, child_info.weight) else forwarding = $service.get_forwarding_for_shard(shard.shard_id) if forwarding.nil? puts "*** Orphan shard: #{shard.inspect}" else forwarding.shard_id = new_shard_id $service.set_forwarding(forwarding) end end $service.add_child_shard(new_shard_id, shard.shard_id, $options[:weight]) end def uninject_shard(shard) shard = $service.get_shard(shard) if shard.instance_of?(Fixnum) children = $service.list_shard_children(shard.shard_id) children.each do |child| $service.remove_child_shard(shard.shard_id, child.shard_id) end parent_shard = $service.get_parent_shard(shard.shard_id) if parent_shard.shard_id != shard.shard_id $service.remove_child_shard(parent_shard.shard_id, shard.shard_id) children.each do |child| $service.add_child_shard(parent_shard.shard_id, child.shard_id, child.weight) end else forwarding = $service.get_forwarding_for_shard(shard.shard_id) if forwarding.nil? puts "*** Orphan shard: #{shard.inspect}" else forwarding.shard_id = children.first.shard_id $service.set_forwarding(forwarding) end end $service.delete_shard(shard.shard_id) end def setup_one_migration(source_shard_id, hostname) source_shard_info = $service.get_shard(source_shard_id) destination_shard_info = source_shard_info.dup destination_shard_info.hostname = hostname destination_shard_info.table_prefix += $options[:append_table_name] migration = $service.setup_migration(source_shard_info, destination_shard_info) puts "Setup migration: shard #{migration.source_shard_id} -> #{migration.destination_shard_id}" migration end def perform_migrations(migrating_shards, destination_db_hostname) puts "Migrating #{migrating_shards.size} shards." migrating_shards.each do |shard| puts " " + pp_shard(get_shard(shard)) end confirm("Is that okay?") puts migrations = migrating_shards.map do |shard| setup_one_migration(shard.shard_id, destination_db_hostname) end confirm("Ready to push new shard config to flapps (#{$options[:flapps].join(', ')})?") $options[:flapps].each do |hostname| puts "Reloading forwardings on #{hostname}" connect_shard_service(hostname).reload_forwardings() end confirm("Ready to start the migration?") puts migrations.each_with_index do |migration, i| server_hostname = $options[:flapps][i % $options[:flapps].size] puts "Migrating shard #{migration.source_shard_id} on #{server_hostname}" connect_shard_service(server_hostname).migrate_shard(migration) end puts puts "Migration underway!" puts show_busy puts end def find_migration(destination_shard_id, need_busy=true) destination_shard = $service.get_shard(destination_shard_id) unless destination_shard.busy > 0 or !need_busy puts "Shard #{destination_shard_id} is not busy." exit 1 end write_only_shard = $service.get_parent_shard(destination_shard_id) unless write_only_shard.class_name.include?("WriteOnly") puts "Shard #{write_only_shard.id} is not a write-only shard." exit 1 end replica_shard = $service.get_parent_shard(write_only_shard.shard_id) unless replica_shard.class_name.include?("Replica") puts "Shard #{replica_shard.id} is not a replica." exit 1 end children = $service.list_shard_children(replica_shard.shard_id).select { |child| child.shard_id != write_only_shard.shard_id } unless children.size == 1 puts "Should only be one source shard...?" exit 1 end source_shard_id = children[0].shard_id ShardMigration.new(source_shard_id, destination_shard_id, replica_shard.shard_id, write_only_shard.shard_id) end def make_shard(hostnames, lower_bound, num) table_ids = [] table_names = [] column_type = "INT UNSIGNED" $options[:graphs].each do |graph_id| [ 0, 1 ].each do |direction| table_ids << (direction == 1 ? graph_id : -graph_id) table_names << "edges_#{DIRECTIONS[direction]}_#{graph_id}_%03d" % num end end table_ids.zip(table_names).each do |table_id, table_name| distinct = "@" shard_id_set = hostnames.map do |hostname| distinct = (ord(distinct) + 1).chr shard = ShardInfo.new("#{PACKAGE}.SqlShard", "#{table_name}_#{distinct}", hostname, column_type, column_type, 0, 0) $service.create_shard(shard) end replica_shard = ShardInfo.new("#{PACKAGE}.#{SHARD_CLASS[:replica]}", "#{table_name}_replicating", "localhost", "", "", 0, 0) replica_id = $service.create_shard(replica_shard) shard_id_set.each_with_index { |shard_id, n| $service.add_child_shard(replica_id, shard_id, (n == 0) ? $options[:weight] : 1) } $service.set_forwarding(Forwarding.new(table_id, lower_bound, replica_id)) end end ## ----- commands: def show_forwardings puts "GRAPH BASE_USER_ID SHARD" $service.get_forwardings().sort_by do |f| [ ((f.table_id.abs << 1) + (f.table_id < 0 ? 1 : 0)), f.base_id ] end.each do |forwarding| if $options[:graphs] and !$options[:graphs].include?(forwarding.table_id) and !$options[:graphs].include?(-forwarding.table_id) next end shard = $service.get_shard(forwarding.shard_id) is_forward = forwarding.table_id > 0 puts "%3d %015x %s %s" % [forwarding.table_id.abs, forwarding.base_id, is_forward ? "->" : "<-", pp_shard(get_shard(shard)) ] end end def show_busy busy = $service.get_busy_shards busy.each do |shard| puts "Busy: #{pp_shard(get_shard(shard))}" end puts "No busy shards." if busy.empty? end def find(user_id) $options[:graphs].each do |graph_id| forward_si = $service.find_current_forwarding(graph_id, user_id) backward_si = $service.find_current_forwarding(-graph_id, user_id) puts "User_id #{user_id}, graph #{graph_id}" puts " Forward: #{pp_shard(get_shard(forward_si))}" puts " Backward: #{pp_shard(get_shard(backward_si))}" end end def dump_db(database_name) with_each_shard_for_db(database_name) do |shard| puts pp_shard(get_shard($service.get_root_shard(shard.shard_id))) end end def swap_db(old_database, new_database) with_each_shard_for_db(old_database, :dots => true) do |shard| shard.hostname = new_database $service.update_shard(shard) end end def rotate_db(database_name) missing = 0 with_each_shard_for_db(database_name, :dots => true) do |shard| replica, db_shard = parent_of_type(shard, :replica) if replica children = $service.list_shard_children(replica.shard_id) old_master = children[0] rotating_child_weight = nil children.each do |child| $service.remove_child_shard(replica.shard_id, child.shard_id) if child.shard_id == db_shard.shard_id rotating_child_weight = child.weight child.weight = old_master.weight end end old_master.weight = rotating_child_weight children.each do |child| $service.add_child_shard(replica.shard_id, child.shard_id, child.weight) end else missing += 1 end end puts "#{missing} shard(s) were NOT rotated because they're not replicating." if missing > 0 end def weight_db(database_name) missing = 0 with_each_shard_for_db(database_name, :dots => true) do |shard| replica, db_shard = parent_of_type(shard, :replica) if replica $service.list_shard_children(replica.shard_id).select { |child| child.shard_id == db_shard.shard_id }.each do |child| $service.remove_child_shard(replica.shard_id, child.shard_id) $service.add_child_shard(replica.shard_id, child.shard_id, $options[:weight]) end else missing += 1 end end puts "#{missing} shard(s) were NOT re-weigted because they're not replicating." if missing > 0 end def add_replica_db(current_database_name, new_database_name) missing = 0 with_each_shard_for_db(current_database_name, :dots => true) do |shard| replica, _ = parent_of_type(shard, :replica) if replica children = $service.list_shard_children(replica.shard_id) new_shard = ShardInfo.new(shard.class_name, shard.table_prefix, new_database_name, shard.source_type, shard.destination_type) new_shard_id = $service.create_shard(new_shard) $service.add_child_shard(replica.shard_id, new_shard_id, $options[:weight]) else missing += 1 end end puts "#{missing} shard(s) were NOT added because they're not replicating." if missing > 0 end def remove_replica_db(database_name) missing = 0 with_each_shard_for_db(database_name, :dots => true) do |shard| replica, db_shard = parent_of_type(shard, :replica) if replica children = $service.list_shard_children(replica.shard_id) $service.remove_child_shard(replica.shard_id, db_shard.shard_id) $service.delete_shard(db_shard.shard_id) else missing += 1 end end puts "#{missing} shard(s) were NOT removed because they're not replicating." if missing > 0 end def set_db(database_name, shard_type) missing = 0 with_each_shard_for_db(database_name, :dots => true) do |shard| parent, _ = parent_of_type(shard, shard_type) if parent missing += 1 else inject_shard(shard_type, shard.shard_id) end end puts "#{missing} shard(s) were ALREADY in state #{shard_type}." if missing > 0 end def unset_db(database_name, shard_type) missing = 0 with_each_shard_for_db(database_name, :dots => true) do |shard| undesired, _ = parent_of_type(shard, shard_type) if undesired uninject_shard(undesired.shard_id) else missing += 1 end end puts "#{missing} shard(s) were NOT in state #{shard_type}." if missing > 0 end def set_db_for(shard_id, shard_type) shard = $service.get_shard(shard_id) parent, _ = parent_of_type(shard, shard_type) if parent puts "Already in that state: #{pp_shard(get_shard(shard))}." else puts "Changing #{pp_shard(get_shard(shard))}" inject_shard(shard_type, shard.shard_id) end end def unset_db_for(shard_id, shard_type) shard = $service.get_shard(shard_id) undesired, _ = parent_of_type(shard, shard_type) if undesired puts "Changing #{pp_shard(get_shard(shard))}" uninject_shard(undesired.shard_id) else puts "Not in that state: #{pp_shard(get_shard(shard))}" end end def migrate(source_db_hostname, destination_db_hostname) shards = $service.shards_for_hostname(source_db_hostname, "#{PACKAGE}.SqlShard") # bucket by table_id so we get the same percentage of each. forwardings = Hash.new { |h, k| h[k] = [] } active_migrations = 0 shards.each do |shard| root_shard = $service.get_root_shard(shard.shard_id) forwarding = $service.get_forwarding_for_shard(root_shard.shard_id) if forwarding # make sure there's not an outstanding migration. if $service.get_child_shards_of_class(root_shard.shard_id, "#{PACKAGE}.SqlShard").any? { |s| s.busy != 0 } active_migrations += 1 else if $options[:graph] and $options[:graph].include?(forwarding.table_id.abs) # skip else forwardings[forwarding.table_id] << shard end end end end total_shards = forwardings.inject(0) { |sum, kv| sum + kv[1].size } puts "There are #{active_migrations} migrations in progress on #{source_db_hostname}." if active_migrations > 0 puts "There are #{total_shards} active shards using #{source_db_hostname}." migrating_shards = forwardings.map { |k, v| v.slice(0, $options[:percent] / 100.0 * v.size) }.flatten.compact perform_migrations(migrating_shards, destination_db_hostname) end def migrate_slaves(master_db_hostname, destination_db_hostname) shards = $service.shards_for_hostname(master_db_hostname, "#{PACKAGE}.SqlShard") active_shards = [] active_migrations = 0 shards.each do |shard| root = $service.get_root_shard(shard.shard_id) forwarding = $service.get_forwarding_for_shard(root.shard_id) if forwarding sql_children = $service.get_child_shards_of_class(root.shard_id, "#{PACKAGE}.SqlShard") # make sure there's not an outstanding migration. if sql_children.any? { |s| s.busy != 0 } active_migrations += 1 else active_shards << sql_children.select { |s| ![master_db_hostname, destination_db_hostname].include?(s.hostname) }.first end end end active_shards.reject! { |s| s.nil? } old_shard_hostnames = active_shards.map { |s| s.hostname }.sort.uniq puts "There are #{active_migrations} migrations in progress on #{master_db_hostname}." if active_migrations > 0 if active_shards.size == 0 puts "All slave shards of #{master_db_hostname} are using #{destination_db_hostname}." else puts "There are #{active_shards.size} active slave shards using #{old_shard_hostnames.join(", ")}." migrating_shards = active_shards.slice(0, $options[:percent] / 100.0 * active_shards.size) perform_migrations(migrating_shards, destination_db_hostname) end end def migrate_one(source_shard_id, hostname) migration = setup_one_migration(source_shard_id, hostname) confirm("Ready to push new shard config to flapps (#{$options[:flapps].join(', ')})?") do unmigrate(migration.destination_shard_id) end $options[:flapps].each do |hostname| puts "Reloading forwardings on #{hostname}" connect_shard_service(hostname).reload_forwardings() end confirm("Ready to start the migration?") $service.migrate_shard(migration) puts "Migration started!" show_busy end def copy_one(source_shard_id, hostname) destination_shard_id = hostname.to_i created_shard = false if destination_shard_id == 0 source_shard = $service.get_shard(source_shard_id) destination_shard = source_shard.dup destination_shard.hostname = hostname destination_shard.table_prefix += $options[:append_table_name] destination_shard_id = $service.create_shard(destination_shard) created_shard = true end puts "Setup copy: shard #{source_shard_id} -> #{destination_shard_id}" if created_shard confirm("Ready to push new shard config to flapps (#{$options[:flapps].join(', ')})?") do $service.delete_shard(destination_shard_id) end $options[:flapps].each do |hostname| puts "Reloading forwardings on #{hostname}" connect_shard_service(hostname).reload_forwardings() end end confirm("Ready to start the copy?") $service.copy_shard(source_shard_id, destination_shard_id) puts "Copying shard #{source_shard_id} -> #{destination_shard_id}" show_busy end def setup_dev_shards (1..GRAPH_COUNT).each do |graph_id| shards = [ "forward", "backward" ].map do |direction| $service.create_shard(ShardInfo.new("#{PACKAGE}.SqlShard", "#{direction}_#{graph_id}", "localhost", "INT UNSIGNED", "INT UNSIGNED", 0)) end $service.set_forwarding(Forwarding.new(graph_id, 0, shards[0])) $service.set_forwarding(Forwarding.new(-graph_id, 0, shards[1])) end $service.reload_forwardings() end # hostname_lists is a list of lists: #replicas x [ shard_hosts ] def make_shards(num_shards, hostname_lists) puts "Creating shards..." num_shards.times do |i| shard_hostnames = hostname_lists.map { |h| h[i % h.size] } lower_bound = (1 << 60) / num_shards * i make_shard(shard_hostnames, lower_bound, i) print "." print "#{i+1}" if (i + 1) % 100 == 0 STDOUT.flush end puts "Done." end def start_all_writes $options[:flapps].each do |hostname| connect_job_service(hostname).resume_writes puts "#{hostname}" end end def stop_all_writes $options[:flapps].each do |hostname| connect_job_service(hostname).stop_writes puts "#{hostname}" end end def start_writes(priority) $options[:flapps].each do |hostname| connect_job_service(hostname).resume_writes_for(priority) puts "#{hostname}" end end def stop_writes(priority) $options[:flapps].each do |hostname| connect_job_service(hostname).stop_writes_for(priority) puts "#{hostname}" end end def check_writes $options[:flapps].each do |hostname| service = connect_job_service(hostname) status = service.is_writing(1), service.is_writing(2), service.is_writing(3) puts "#{hostname}: " + [0, 1, 2].map { |s| "#{s + 1}=#{status[s] ? 'on' : 'off'}" }.join(" ") end end def reload_forwardings $options[:flapps].each do |hostname| puts "Reloading forwardings on #{hostname}" connect_shard_service(hostname).reload_forwardings() end end def flush_queues $options[:flapps].each do |hostname| puts "Flushing all error queues on #{hostname}" connect_job_service(hostname).retry_errors() end end def flush_queues_for(priority) $options[:flapps].each do |hostname| puts "Flushing queue #{priority} on #{hostname}" connect_job_service(hostname).retry_errors_for(priority) end end def kick_migration(destination_shard_id) migration = find_migration(destination_shard_id) puts "Migration: #{migration}" confirm("Ready to kick off that migration [again]?") $service.migrate_shard(migration) puts "Doing!" end def unmigrate(shard_id) migration = find_migration(shard_id, false) puts "Cancelling migration: #{migration}" $service.remove_child_shard(migration.replicating_shard_id, migration.source_shard_id) $service.remove_child_shard(migration.replicating_shard_id, migration.write_only_shard_id) $service.remove_child_shard(migration.write_only_shard_id, migration.destination_shard_id) $service.replace_child_shard(migration.replicating_shard_id, migration.source_shard_id) $service.replace_forwarding(migration.replicating_shard_id, migration.source_shard_id) $service.delete_shard(migration.destination_shard_id) $service.delete_shard(migration.write_only_shard_id) $service.delete_shard(migration.replicating_shard_id) end ## ----- cli def usage puts <<-USAGE Commands: --- SHARDS --- show show current forwarding tables busy show shards that are currently migrating/copying find <user-id> find the shard for a user and display its topology (requires --graph) dump-db <db-hostname> dump a list of all forwardings that refer to a database swap-db <old-db-hostname> <new-db-hostname> replace all shards pointing to one db with a new db rotate-db <db-hostname> move a db to the front (primary) of any replicating shards it's in weight-db <db-hostname> rebalance replica shards on the given db to have a new weight add-replica-db <current-db-hostname> <new-db-hostname> add a db to the replica list that an existing db is servicing remove-replica-db <db-hostname> remove a db from its replica list set-db <db-hostname> <shard-type> alter the shards on a database to add a filter unset-db <db-hostname> <shard-type> remove a filter from the shards on a database set-db-for <shard-id> <shard-type> alter a single shard to add a filter unset-db-for <shard-id> <shard-type> remove a filter from a single shard migrate <current-db-hostname> <new-db-hostname> migrate (a percentage) of shards from one db to another migrate-slaves <master-db-hostname> <slave-db-hostname> migrate (a percentage) of shards that are slaves to shards on the master db but are hosted somewhere else (in other words, rectify the slave shards to match the master/slave pairing listed) migrate-one <shard-id> <new-db-hostname> migrate one a specific shard to a new database copy-one <shard-id> <shard-id|db-hostname> copy an existing shard to another shard (possibly creating the new shard if db-hostname is provided) setup-dev create shards for graphs 1-10, for use in development mkshards <count> <host-lists> build N replicating shards (see below for host-lists format; requires --graph) --- WRITE QUEUES --- start-all-writes start/resume writing at all priorities stop-all-writes stop/pause writing at all priorities start-writes <priority> start/resume writing at priority (1-3) stop-writes <priority> stop/pause writing at priority (1-3) check-writes display on/off state for all write queues on the listed flapps push tell flapp servers to reload the forwarding/shard tables flush-all tell flapp servers to replay the error queue (postponed writes) flush <priority> tell flapp servers to replay any error queue migrations inject <priority> <job> inject a job (as json) into the work queue of the given priority USAGE common_usage end def common_usage puts puts "Shard types are: #{SHARD_CLASS.keys.join(', ')}" puts puts "Host lists for mkshards are lists of hostnames separated by ';', with " puts "individual hostnames separated by ','. For example:" puts " host1,host2,host3;host4,host5,host6" puts "creates a set of 3 shards with 2 replicas each: (host1 + host4), " puts " (host2 + host5), (host3 + host6)." puts end def parse_args options = { :flapps => [ "flapp001" ], :nameserver => "flockdb001", :database_name => "flock_production", :append_table_name => "", :percent => 100, :weight => 1, } # let ~/.flapps be a default set of flapp servers begin options[:flapps] = File.open("#{ENV['HOME']}/.flapps").readlines.map { |x| x.strip }.select { |x| x.size > 0 } rescue end # let ~/.flockdbs be a default set of databases begin options[:host_lists] = File.open("#{ENV['HOME']}/.flockdbs").readlines.map { |x| x.strip }.select { |x| x.size > 0 }.map { |h| h.split(",") } rescue end opts = OptionParser.new do |opts| opts.banner = "Usage: flocker.rb [options] <command>" opts.on("-N", "--nameserver HOSTNAME", "database host for nameserver (default: #{options[:nameserver]})") do |hostname| options[:nameserver] = hostname end opts.on("-E", "--environment NAME", "environment (default: #{options[:database_name]})") do |environment| options[:database_name] = environment end opts.on("-D", "--dev", "use localhost flapp and database, with development environment") do options[:flapps] = [ "localhost" ] options[:nameserver] = "localhost" options[:database_name] = "flock_development" options[:append_table_name] = "_copy" end opts.on("--ids", "show ids when dumping shard info") do options[:show_ids] = true end opts.on("--graph IDS", "limit to certain graph ids (separated by ',')") do |graphs| options[:graphs] = graphs.split(",").map { |g| g.to_i } end opts.on("-f", "--flapps HOSTNAMES", "flapp servers (separated by ',') (default: '#{options[:flapps].join(',')}')") do |flapps| options[:flapps] = flapps.split(",") end opts.on("-p", "--percent N", "migrate/copy only N percent of the eligible shards") do |percent| options[:percent] = percent.to_i end opts.on("-w", "--weight N", "weight of any new shards to be created") do |weight| options[:weight] = weight.to_i end opts.on("--force", "don't ask confirmation on copy/migrate") do options[:force] = true end opts.on_tail("--help", "Show this message") do puts opts puts usage exit end end opts.parse!(ARGV) options[:flapp] = options[:flapps].sort_by { rand }[0] if ARGV.size < 1 || ARGV[0] == "help" puts "Command is required." puts opts puts usage exit end options end options = parse_args $options = options $service = connect_shard_service($options[:flapp]) case ARGV[0] when "show" show_forwardings when "busy" show_busy when "find" (usage; exit) if ARGV.size < 2 || !options[:graphs] find(ARGV[1].to_i) when "dump-db" (usage; exit) if ARGV.size < 2 dump_db(ARGV[1]) when "swap-db" (usage; exit) if ARGV.size < 3 swap_db(ARGV[1], ARGV[2]) when "rotate-db" (usage; exit) if ARGV.size < 2 rotate_db(ARGV[1]) when "weight-db" (usage; exit) if ARGV.size < 2 weight_db(ARGV[1]) when "add-replica-db" (usage; exit) if ARGV.size < 3 add_replica_db(ARGV[1], ARGV[2]) when "remove-replica-db" (usage; exit) if ARGV.size < 2 remove_replica_db(ARGV[1]) when "set-db" (usage; exit) if ARGV.size < 3 type = ARGV[2].to_sym (usage; exit) unless SHARD_CLASS.keys.include?(type) set_db(ARGV[1], type) when "unset-db" (usage; exit) if ARGV.size < 3 type = ARGV[2].to_sym (usage; exit) unless SHARD_CLASS.keys.include?(type) unset_db(ARGV[1], type) when "set-db-for" (usage; exit) if ARGV.size < 3 type = ARGV[2].to_sym (usage; exit) unless SHARD_CLASS.keys.include?(type) set_db_for(ARGV[1].to_i, type) when "unset-db-for" (usage; exit) if ARGV.size < 3 type = ARGV[2].to_sym (usage; exit) unless SHARD_CLASS.keys.include?(type) unset_db_for(ARGV[1].to_i, type) when "migrate" (usage; exit) if ARGV.size < 3 migrate(ARGV[1],ARGV[2]) when "migrate-slaves" (usage; exit) if ARGV.size < 3 migrate_slaves(ARGV[1], ARGV[2]) when "migrate-one" (usage; exit) if ARGV.size < 3 migrate_one(ARGV[1].to_i, ARGV[2]) when "copy-one" (usage; exit) if ARGV.size < 3 copy_one(ARGV[1].to_i, ARGV[2]) when "setup-dev" if options[:database_name] != "flock_development" puts puts "HEY! Don't use setup-dev without -D" puts exit 1 end setup_dev_shards when "mkshards" (usage; exit) if ARGV.size < 2 || !options[:graphs] || (ARGV.size < 3 && !options[:host_lists]) num_shards = ARGV[1].to_i host_lists = $options[:host_lists] || ARGV[2].split(";").map { |h| h.split(",") } if host_lists.any? { |h| h.size != host_lists[0].size } puts "Host list sizes are not the same: #{host_lists.inspect}" exit 1 end make_shards(num_shards, host_lists) when "start-all-writes" start_all_writes when "stop-all-writes" stop_all_writes when "start-writes" (usage; exit) if ARGV.size < 2 start_writes(ARGV[1].to_i) when "stop-writes" (usage; exit) if ARGV.size < 2 stop_writes(ARGV[1].to_i) when "check-writes" check_writes when "push" reload_forwardings when "flush-all" flush_queues when "flush" (usage; exit) if ARGV.size < 2 flush_queues_for(ARGV[1].to_i) when "inject" (usage; exit) if ARGV.size < 3 priority = ARGV[1].to_i job = ARGV[2] connect_job_service($options[:flapp]).inject_job(priority, job) # undocumented: when "kick-migration" (usage; exit) if ARGV.size < 2 kick_migration(ARGV[1].to_i) when "unmigrate" (usage; exit) if ARGV.size < 2 unmigrate(ARGV[1].to_i) when "rebuild-schema" $service.rebuild_schema() else puts "I dunno that." puts usage exit end
{ "pile_set_name": "Github" }
//---------------------------------------------------------------------------// // Copyright (c) 2013-2014 Kyle Lutz <[email protected]> // // Distributed under the Boost Software License, Version 1.0 // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // // See http://boostorg.github.com/compute for more information. //---------------------------------------------------------------------------// #ifndef BOOST_COMPUTE_INTEROP_VTK_DATA_ARRAY_HPP #define BOOST_COMPUTE_INTEROP_VTK_DATA_ARRAY_HPP #include <vtkDataArray.h> #include <vtkDataArrayTemplate.h> #include <boost/compute/system.hpp> #include <boost/compute/command_queue.hpp> #include <boost/compute/algorithm/copy.hpp> #include <boost/compute/algorithm/copy_n.hpp> #include <boost/compute/iterator/buffer_iterator.hpp> namespace boost { namespace compute { /// Copies the values in \p data to \p buffer. template<class T> inline void vtk_copy_data_array_to_buffer(const vtkDataArray *data, buffer_iterator<T> buffer, command_queue &queue = system::default_queue()); /// \internal_ template<class T> inline void vtk_copy_data_array_to_buffer(const vtkDataArrayTemplate<T> *data, buffer_iterator<T> buffer, command_queue &queue = system::default_queue()) { vtkDataArrayTemplate<T> *data_ = const_cast<vtkDataArrayTemplate<T> *>(data); const T *data_ptr = static_cast<const T *>(data_->GetVoidPointer(0)); size_t data_size = data_->GetNumberOfComponents() * data_->GetNumberOfTuples(); ::boost::compute::copy_n(data_ptr, data_size, buffer, queue); } /// Copies the values in the range [\p first, \p last) to \p data. template<class T> inline void vtk_copy_buffer_to_data_array(buffer_iterator<T> first, buffer_iterator<T> last, vtkDataArray *data, command_queue &queue = system::default_queue()); /// \internal_ template<class T> inline void vtk_copy_buffer_to_data_array(buffer_iterator<T> first, buffer_iterator<T> last, vtkDataArrayTemplate<T> *data, command_queue &queue = system::default_queue()) { T *data_ptr = static_cast<T *>(data->GetVoidPointer(0)); ::boost::compute::copy(first, last, data_ptr, queue); } } // end compute namespace } // end boost namespace #endif // BOOST_COMPUTE_INTEROP_VTK_DATA_ARRAY_HPP
{ "pile_set_name": "Github" }
{ "ver": "1.0.1", "uuid": "3b389777-3217-436c-8a27-5a81aa681ba4", "isGroup": false, "subMetas": {} }
{ "pile_set_name": "Github" }
// Copyright 2012 Google, Inc. All rights reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the LICENSE file in the root of the source // tree. package reassembly import ( "encoding/binary" "fmt" "github.com/google/gopacket" "github.com/google/gopacket/layers" ) /* * Check TCP packet against options (window, MSS) */ type tcpStreamOptions struct { mss int scale int receiveWindow uint } // TCPOptionCheck contains options for the two directions type TCPOptionCheck struct { options [2]tcpStreamOptions } func (t *TCPOptionCheck) getOptions(dir TCPFlowDirection) *tcpStreamOptions { if dir == TCPDirClientToServer { return &t.options[0] } return &t.options[1] } // NewTCPOptionCheck creates default options func NewTCPOptionCheck() TCPOptionCheck { return TCPOptionCheck{ options: [2]tcpStreamOptions{ tcpStreamOptions{ mss: 0, scale: -1, receiveWindow: 0, }, tcpStreamOptions{ mss: 0, scale: -1, receiveWindow: 0, }, }, } } // Accept checks whether the packet should be accepted by checking TCP options func (t *TCPOptionCheck) Accept(tcp *layers.TCP, ci gopacket.CaptureInfo, dir TCPFlowDirection, nextSeq Sequence, start *bool) error { options := t.getOptions(dir) if tcp.SYN { mss := -1 scale := -1 for _, o := range tcp.Options { // MSS if o.OptionType == 2 { if len(o.OptionData) != 2 { return fmt.Errorf("MSS option data length expected 2, got %d", len(o.OptionData)) } mss = int(binary.BigEndian.Uint16(o.OptionData[:2])) } // Window scaling if o.OptionType == 3 { if len(o.OptionData) != 1 { return fmt.Errorf("Window scaling length expected: 1, got %d", len(o.OptionData)) } scale = int(o.OptionData[0]) } } options.mss = mss options.scale = scale } else { if nextSeq != invalidSequence { revOptions := t.getOptions(dir.Reverse()) length := len(tcp.Payload) // Check packet is in the correct window diff := nextSeq.Difference(Sequence(tcp.Seq)) if diff == -1 && (length == 1 || length == 0) { // This is probably a Keep-alive // TODO: check byte is ok } else if diff < 0 { return fmt.Errorf("Re-emitted packet (diff:%d,seq:%d,rev-ack:%d)", diff, tcp.Seq, nextSeq) } else if revOptions.mss > 0 && length > revOptions.mss { return fmt.Errorf("%d > mss (%d)", length, revOptions.mss) } else if revOptions.receiveWindow != 0 && revOptions.scale < 0 && diff > int(revOptions.receiveWindow) { return fmt.Errorf("%d > receiveWindow(%d)", diff, revOptions.receiveWindow) } } } // Compute receiveWindow options.receiveWindow = uint(tcp.Window) if options.scale > 0 { options.receiveWindow = options.receiveWindow << (uint(options.scale)) } return nil } // TCPSimpleFSM implements a very simple TCP state machine // // Usage: // When implementing a Stream interface and to avoid to consider packets that // would be rejected due to client/server's TCP stack, the Accept() can call // TCPSimpleFSM.CheckState(). // // Limitations: // - packet should be received in-order. // - no check on sequence number is performed // - no RST type TCPSimpleFSM struct { dir TCPFlowDirection state int options TCPSimpleFSMOptions } // TCPSimpleFSMOptions holds options for TCPSimpleFSM type TCPSimpleFSMOptions struct { SupportMissingEstablishment bool // Allow missing SYN, SYN+ACK, ACK } // Internal values of state machine const ( TCPStateClosed = 0 TCPStateSynSent = 1 TCPStateEstablished = 2 TCPStateCloseWait = 3 TCPStateLastAck = 4 TCPStateReset = 5 ) // NewTCPSimpleFSM creates a new TCPSimpleFSM func NewTCPSimpleFSM(options TCPSimpleFSMOptions) *TCPSimpleFSM { return &TCPSimpleFSM{ state: TCPStateClosed, options: options, } } func (t *TCPSimpleFSM) String() string { switch t.state { case TCPStateClosed: return "Closed" case TCPStateSynSent: return "SynSent" case TCPStateEstablished: return "Established" case TCPStateCloseWait: return "CloseWait" case TCPStateLastAck: return "LastAck" case TCPStateReset: return "Reset" } return "?" } // CheckState returns false if tcp is invalid wrt current state or update the state machine's state func (t *TCPSimpleFSM) CheckState(tcp *layers.TCP, dir TCPFlowDirection) bool { if t.state == TCPStateClosed && t.options.SupportMissingEstablishment && !(tcp.SYN && !tcp.ACK) { /* try to figure out state */ switch true { case tcp.SYN && tcp.ACK: t.state = TCPStateSynSent t.dir = dir.Reverse() case tcp.FIN && !tcp.ACK: t.state = TCPStateEstablished case tcp.FIN && tcp.ACK: t.state = TCPStateCloseWait t.dir = dir.Reverse() default: t.state = TCPStateEstablished } } switch t.state { /* openning connection */ case TCPStateClosed: if tcp.SYN && !tcp.ACK { t.dir = dir t.state = TCPStateSynSent return true } case TCPStateSynSent: if tcp.RST { t.state = TCPStateReset return true } if tcp.SYN && tcp.ACK && dir == t.dir.Reverse() { t.state = TCPStateEstablished return true } if tcp.SYN && !tcp.ACK && dir == t.dir { // re-transmission return true } /* established */ case TCPStateEstablished: if tcp.RST { t.state = TCPStateReset return true } if tcp.FIN { t.state = TCPStateCloseWait t.dir = dir return true } // accept any packet return true /* closing connection */ case TCPStateCloseWait: if tcp.RST { t.state = TCPStateReset return true } if tcp.FIN && tcp.ACK && dir == t.dir.Reverse() { t.state = TCPStateLastAck return true } if tcp.ACK { return true } case TCPStateLastAck: if tcp.RST { t.state = TCPStateReset return true } if tcp.ACK && t.dir == dir { t.state = TCPStateClosed return true } } return false }
{ "pile_set_name": "Github" }
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: -*- nil -*- #include <AP_HAL.h> #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX #include "UARTDriver.h" #include <stdio.h> #include <errno.h> #include <termios.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <poll.h> #include <assert.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <string.h> #include <arpa/inet.h> #include "../AP_HAL/utility/RingBuffer.h" extern const AP_HAL::HAL& hal; using namespace Linux; LinuxUARTDriver::LinuxUARTDriver(bool default_console) : device_path(NULL), _rd_fd(-1), _wr_fd(-1), _packetise(false), _flow_control(FLOW_CONTROL_DISABLE) { if (default_console) { _rd_fd = 0; _wr_fd = 1; _console = true; } } /* set the tty device to use for this UART */ void LinuxUARTDriver::set_device_path(char *path) { device_path = path; } /* open the tty */ void LinuxUARTDriver::begin(uint32_t b) { begin(b, 0, 0); } void LinuxUARTDriver::begin(uint32_t b, uint16_t rxS, uint16_t txS) { if (device_path == NULL && _console) { _rd_fd = 0; _wr_fd = 1; fcntl(_rd_fd, F_SETFL, fcntl(_rd_fd, F_GETFL, 0) | O_NONBLOCK); fcntl(_wr_fd, F_SETFL, fcntl(_wr_fd, F_GETFL, 0) | O_NONBLOCK); } else if (!_initialised) { if (device_path == NULL) { return; } switch (_parseDevicePath(device_path)){ case DEVICE_TCP: { _connected = false; if (_flag != NULL){ if (!strcmp(_flag, "wait")){ _tcp_start_connection(true); } else { _tcp_start_connection(false); } } else { _tcp_start_connection(false); } if (!_connected) { ::printf("LinuxUARTDriver TCP connection not established\n"); exit(1); } _flow_control = FLOW_CONTROL_ENABLE; break; } case DEVICE_UDP: { _udp_start_connection(); _flow_control = FLOW_CONTROL_ENABLE; break; } case DEVICE_SERIAL: { _rd_fd = open(device_path, O_RDWR); _wr_fd = _rd_fd; if (_rd_fd == -1) { ::fprintf(stdout, "Failed to open UART device %s - %s\n", device_path, strerror(errno)); return; } // always run the file descriptor non-blocking, and deal with // blocking IO in the higher level calls fcntl(_rd_fd, F_SETFL, fcntl(_rd_fd, F_GETFL, 0) | O_NONBLOCK); // TODO: add proper flow control support _flow_control = FLOW_CONTROL_DISABLE; break; } default: { // Notify that the option is not valid and select standart input and output ::printf("LinuxUARTDriver parsing failed, using default\n"); _rd_fd = 0; _wr_fd = 1; fcntl(_rd_fd, F_SETFL, fcntl(_rd_fd, F_GETFL, 0) | O_NONBLOCK); fcntl(_wr_fd, F_SETFL, fcntl(_wr_fd, F_GETFL, 0) | O_NONBLOCK); break; } } } // we have enough memory to have a larger transmit buffer for // all ports. This means we don't get delays while waiting to // write GPS config packets if (rxS < 1024) { rxS = 8192; } if (txS < 8192) { txS = 8192; } _initialised = false; while (_in_timer) hal.scheduler->delay(1); if (b != 0 && _rd_fd == _wr_fd) { // set the baud rate struct termios t; memset(&t, 0, sizeof(t)); tcgetattr(_rd_fd, &t); cfsetspeed(&t, b); // disable LF -> CR/LF t.c_iflag &= ~(BRKINT | ICRNL | IMAXBEL | IXON | IXOFF); t.c_oflag &= ~(OPOST | ONLCR); t.c_lflag &= ~(ISIG | ICANON | IEXTEN | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE); t.c_cc[VMIN] = 0; tcsetattr(_rd_fd, TCSANOW, &t); } /* allocate the read buffer */ if (rxS != 0 && rxS != _readbuf_size) { _readbuf_size = rxS; if (_readbuf != NULL) { free(_readbuf); } _readbuf = (uint8_t *)malloc(_readbuf_size); _readbuf_head = 0; _readbuf_tail = 0; } /* allocate the write buffer */ if (txS != 0 && txS != _writebuf_size) { _writebuf_size = txS; if (_writebuf != NULL) { free(_writebuf); } _writebuf = (uint8_t *)malloc(_writebuf_size); _writebuf_head = 0; _writebuf_tail = 0; } if (_writebuf_size != 0 && _readbuf_size != 0) { _initialised = true; } } /* Device path accepts the following syntaxes: - /dev/ttyO1 - tcp:*:1243:wait - udp:192.168.2.15:1243 */ LinuxUARTDriver::device_type LinuxUARTDriver::_parseDevicePath(const char *arg) { struct stat st; _flag = NULL; // init flag char *devstr = strdup(arg); if (devstr == NULL) { return DEVICE_UNKNOWN; } if (stat(devstr, &st) == 0 && S_ISCHR(st.st_mode)) { free(devstr); return DEVICE_SERIAL; } else if (strncmp(devstr, "tcp:", 4) == 0 || strncmp(devstr, "udp:", 4) == 0) { char *saveptr = NULL; // Parse the string char *protocol, *ip, *port, *flag; protocol = strtok_r(devstr, ":", &saveptr); ip = strtok_r(NULL, ":", &saveptr); port = strtok_r(NULL, ":", &saveptr); flag = strtok_r(NULL, ":", &saveptr); _base_port = (uint16_t) atoi(port); if (_ip) free(_ip); _ip = NULL; if (ip) { _ip = strdup(ip); } if (_flag) free(_flag); _flag = NULL; if (flag) { _flag = strdup(flag); } if (strcmp(protocol, "udp") == 0) { free(devstr); return DEVICE_UDP; } free(devstr); return DEVICE_TCP; } free(devstr); return DEVICE_UNKNOWN; } /* start a TCP connection for the serial port. If wait_for_connection is true then block until a client connects */ void LinuxUARTDriver::_tcp_start_connection(bool wait_for_connection) { int one=1; struct sockaddr_in sockaddr; int ret; int listen_fd = -1; // socket we are listening on int net_fd = -1; // network file descriptor, will be linked to wr_fd and rd_fd uint8_t portNumber = 0; // connecto to _base_port + portNumber if (net_fd != -1) { close(net_fd); } if (listen_fd == -1) { memset(&sockaddr,0,sizeof(sockaddr)); #ifdef HAVE_SOCK_SIN_LEN sockaddr.sin_len = sizeof(sockaddr); #endif sockaddr.sin_port = htons(_base_port + portNumber); sockaddr.sin_family = AF_INET; if (strcmp(_ip, "*") == 0) { // Bind to all interfaces sockaddr.sin_addr.s_addr = htonl(INADDR_ANY); } else { sockaddr.sin_addr.s_addr = inet_addr(_ip); } listen_fd = socket(AF_INET, SOCK_STREAM, 0); if (listen_fd == -1) { ::printf("socket failed - %s\n", strerror(errno)); exit(1); } /* we want to be able to re-use ports quickly */ setsockopt(listen_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); if (!wait_for_connection) { ret = connect(listen_fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)); if (ret < 0) { ::printf("connect failed on port %u - %s\n", (unsigned)ntohs(sockaddr.sin_port), strerror(errno)); exit(1); } fcntl(listen_fd, F_SETFL, fcntl(listen_fd, F_GETFL, 0) | O_NONBLOCK); _rd_fd = listen_fd; _connected = true; ::printf("Serial port %u on TCP port %u\n", portNumber, _base_port + portNumber); fflush(stdout); } else { ret = bind(listen_fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)); if (ret == -1) { ::printf("bind failed on port %u - %s\n", (unsigned)ntohs(sockaddr.sin_port), strerror(errno)); exit(1); } ret = listen(listen_fd, 5); if (ret == -1) { ::printf("listen failed - %s\n", strerror(errno)); exit(1); } ::printf("Serial port %u on TCP port %u\n", portNumber, _base_port + portNumber); ::fflush(stdout); ::printf("Waiting for connection ....\n"); ::fflush(stdout); net_fd = accept(listen_fd, NULL, NULL); if (net_fd == -1) { ::printf("accept() error - %s", strerror(errno)); exit(1); } setsockopt(net_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); setsockopt(net_fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)); // always run the file descriptor non-blocking, and deal with | // blocking IO in the higher level calls fcntl(net_fd, F_SETFL, fcntl(net_fd, F_GETFL, 0) | O_NONBLOCK); _connected = true; _rd_fd = net_fd; _wr_fd = net_fd; } } } /* start a UDP connection for the serial port */ void LinuxUARTDriver::_udp_start_connection(void) { struct sockaddr_in sockaddr; int ret; memset(&sockaddr,0,sizeof(sockaddr)); #ifdef HAVE_SOCK_SIN_LEN sockaddr.sin_len = sizeof(sockaddr); #endif sockaddr.sin_port = htons(_base_port); sockaddr.sin_family = AF_INET; sockaddr.sin_addr.s_addr = inet_addr(_ip); _rd_fd = socket(AF_INET, SOCK_DGRAM, 0); if (_rd_fd == -1) { ::printf("socket failed - %s\n", strerror(errno)); exit(1); } ret = connect(_rd_fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)); if (ret == -1) { ::printf("connect failed to %s:%u - %s\n", _ip, (unsigned)_base_port, strerror(errno)); exit(1); } // always run the file descriptor non-blocking, and deal with | // blocking IO in the higher level calls fcntl(_rd_fd, F_SETFL, fcntl(_rd_fd, F_GETFL, 0) | O_NONBLOCK); _wr_fd = _rd_fd; // try to write on MAVLink packet boundaries if possible _packetise = true; } /* shutdown a UART */ void LinuxUARTDriver::end() { _initialised = false; _connected = false; while (_in_timer) hal.scheduler->delay(1); if (_rd_fd == _wr_fd && _rd_fd != -1) { close(_rd_fd); } _rd_fd = -1; _wr_fd = -1; if (_readbuf) { free(_readbuf); _readbuf = NULL; } if (_writebuf) { free(_writebuf); _writebuf = NULL; } _readbuf_size = _writebuf_size = 0; _writebuf_head = 0; _writebuf_tail = 0; _readbuf_head = 0; _readbuf_tail = 0; } void LinuxUARTDriver::flush() { // we are not doing any buffering, so flush is a no-op } /* return true if the UART is initialised */ bool LinuxUARTDriver::is_initialized() { return _initialised; } /* enable or disable blocking writes */ void LinuxUARTDriver::set_blocking_writes(bool blocking) { _nonblocking_writes = !blocking; } /* do we have any bytes pending transmission? */ bool LinuxUARTDriver::tx_pending() { return !BUF_EMPTY(_writebuf); } /* return the number of bytes available to be read */ int16_t LinuxUARTDriver::available() { if (!_initialised) { return 0; } uint16_t _tail; return BUF_AVAILABLE(_readbuf); } /* how many bytes are available in the output buffer? */ int16_t LinuxUARTDriver::txspace() { if (!_initialised) { return 0; } uint16_t _head; return BUF_SPACE(_writebuf); } int16_t LinuxUARTDriver::read() { uint8_t c; if (!_initialised || _readbuf == NULL) { return -1; } if (BUF_EMPTY(_readbuf)) { return -1; } c = _readbuf[_readbuf_head]; BUF_ADVANCEHEAD(_readbuf, 1); return c; } /* Linux implementations of Print virtual methods */ size_t LinuxUARTDriver::write(uint8_t c) { if (!_initialised) { return 0; } uint16_t _head; while (BUF_SPACE(_writebuf) == 0) { if (_nonblocking_writes) { return 0; } hal.scheduler->delay(1); } _writebuf[_writebuf_tail] = c; BUF_ADVANCETAIL(_writebuf, 1); return 1; } /* write size bytes to the write buffer */ size_t LinuxUARTDriver::write(const uint8_t *buffer, size_t size) { if (!_initialised) { return 0; } if (!_nonblocking_writes) { /* use the per-byte delay loop in write() above for blocking writes */ size_t ret = 0; while (size--) { if (write(*buffer++) != 1) break; ret++; } return ret; } uint16_t _head, space; space = BUF_SPACE(_writebuf); if (space == 0) { return 0; } if (size > space) { size = space; } if (_writebuf_tail < _head) { // perform as single memcpy assert(_writebuf_tail+size <= _writebuf_size); memcpy(&_writebuf[_writebuf_tail], buffer, size); BUF_ADVANCETAIL(_writebuf, size); return size; } // perform as two memcpy calls uint16_t n = _writebuf_size - _writebuf_tail; if (n > size) n = size; assert(_writebuf_tail+n <= _writebuf_size); memcpy(&_writebuf[_writebuf_tail], buffer, n); BUF_ADVANCETAIL(_writebuf, n); buffer += n; n = size - n; if (n > 0) { assert(_writebuf_tail+n <= _writebuf_size); memcpy(&_writebuf[_writebuf_tail], buffer, n); BUF_ADVANCETAIL(_writebuf, n); } return size; } /* try writing n bytes, handling an unresponsive port */ int LinuxUARTDriver::_write_fd(const uint8_t *buf, uint16_t n) { int ret = 0; struct pollfd fds; fds.fd = _wr_fd; fds.events = POLLOUT; fds.revents = 0; if (poll(&fds, 1, 0) == 1) { ret = ::write(_wr_fd, buf, n); } if (ret > 0) { BUF_ADVANCEHEAD(_writebuf, ret); return ret; } return ret; } /* try reading n bytes, handling an unresponsive port */ int LinuxUARTDriver::_read_fd(uint8_t *buf, uint16_t n) { int ret; ret = ::read(_rd_fd, buf, n); if (ret > 0) { BUF_ADVANCETAIL(_readbuf, ret); } else { switch (errno) { case EAGAIN: /* Ignore EAGAIN that resulted from non-blocking read */ break; case EPIPE: /* Ignore EPIPE that resulted from peer shutdown */ break; default: ::fprintf(stdout, "read failed - %s\n", strerror(errno)); break; } } return ret; } /* push any pending bytes to/from the serial port. This is called at 1kHz in the timer thread. Doing it this way reduces the system call overhead in the main task enormously. */ void LinuxUARTDriver::_timer_tick(void) { uint16_t n; if (!_initialised) return; _in_timer = true; // write any pending bytes uint16_t _tail; n = BUF_AVAILABLE(_writebuf); if (_packetise && n > 0 && _writebuf[_writebuf_head] == 254) { // this looks like a MAVLink packet - try to write on // packet boundaries when possible if (n < 8) { n = 0; } else { // the length of the packet is the 2nd byte, and mavlink // packets have a 6 byte header plus 2 byte checksum, // giving len+8 bytes uint16_t ofs = (_writebuf_head + 1) % _writebuf_size; uint8_t len = _writebuf[ofs]; if (n < len+8) { // we don't have a full packet yet n = 0; } else if (n > len+8) { // send just 1 packet at a time (so MAVLink packets // are aligned on UDP boundaries) n = len+8; } } } if (n > 0) { uint16_t n1 = _writebuf_size - _writebuf_head; if (n1 >= n) { // do as a single write _write_fd(&_writebuf[_writebuf_head], n); } else { // split into two writes if (_packetise) { // keep as a single UDP packet uint8_t tmpbuf[n]; memcpy(tmpbuf, &_writebuf[_writebuf_head], n1); if (n > n1) { memcpy(&tmpbuf[n1], &_writebuf[0], n-n1); } _write_fd(tmpbuf, n); } else { int ret = _write_fd(&_writebuf[_writebuf_head], n1); if (ret == n1 && n > n1) { _write_fd(&_writebuf[_writebuf_head], n - n1); } } } } // try to fill the read buffer uint16_t _head; n = BUF_SPACE(_readbuf); if (n > 0) { uint16_t n1 = _readbuf_size - _readbuf_tail; if (n1 >= n) { // one read will do assert(_readbuf_tail+n <= _readbuf_size); _read_fd(&_readbuf[_readbuf_tail], n); } else { assert(_readbuf_tail+n1 <= _readbuf_size); int ret = _read_fd(&_readbuf[_readbuf_tail], n1); if (ret == n1 && n > n1) { assert(_readbuf_tail+(n-n1) <= _readbuf_size); _read_fd(&_readbuf[_readbuf_tail], n - n1); } } } _in_timer = false; } #endif // CONFIG_HAL_BOARD
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_222) on Wed Aug 14 11:24:50 AEST 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>org.eclipse.rdf4j.http.client.query Class Hierarchy (RDF4J 2.5.4 API)</title> <meta name="date" content="2019-08-14"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="org.eclipse.rdf4j.http.client.query Class Hierarchy (RDF4J 2.5.4 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/eclipse/rdf4j/http/client/package-tree.html">Prev</a></li> <li><a href="../../../../../../org/eclipse/rdf4j/http/client/util/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/eclipse/rdf4j/http/client/query/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 class="title">Hierarchy For Package org.eclipse.rdf4j.http.client.query</h1> <span class="packageHierarchyLabel">Package Hierarchies:</span> <ul class="horizontal"> <li><a href="../../../../../../overview-tree.html">All Packages</a></li> </ul> </div> <div class="contentContainer"> <h2 title="Class Hierarchy">Class Hierarchy</h2> <ul> <li type="circle">java.lang.<a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Object</span></a> <ul> <li type="circle">org.eclipse.rdf4j.query.impl.<a href="../../../../../../org/eclipse/rdf4j/query/impl/AbstractOperation.html" title="class in org.eclipse.rdf4j.query.impl"><span class="typeNameLink">AbstractOperation</span></a> (implements org.eclipse.rdf4j.query.<a href="../../../../../../org/eclipse/rdf4j/query/Operation.html" title="interface in org.eclipse.rdf4j.query">Operation</a>) <ul> <li type="circle">org.eclipse.rdf4j.query.impl.<a href="../../../../../../org/eclipse/rdf4j/query/impl/AbstractQuery.html" title="class in org.eclipse.rdf4j.query.impl"><span class="typeNameLink">AbstractQuery</span></a> (implements org.eclipse.rdf4j.query.<a href="../../../../../../org/eclipse/rdf4j/query/Query.html" title="interface in org.eclipse.rdf4j.query">Query</a>) <ul> <li type="circle">org.eclipse.rdf4j.http.client.query.<a href="../../../../../../org/eclipse/rdf4j/http/client/query/AbstractHTTPQuery.html" title="class in org.eclipse.rdf4j.http.client.query"><span class="typeNameLink">AbstractHTTPQuery</span></a></li> </ul> </li> <li type="circle">org.eclipse.rdf4j.query.impl.<a href="../../../../../../org/eclipse/rdf4j/query/impl/AbstractUpdate.html" title="class in org.eclipse.rdf4j.query.impl"><span class="typeNameLink">AbstractUpdate</span></a> (implements org.eclipse.rdf4j.query.<a href="../../../../../../org/eclipse/rdf4j/query/Update.html" title="interface in org.eclipse.rdf4j.query">Update</a>) <ul> <li type="circle">org.eclipse.rdf4j.http.client.query.<a href="../../../../../../org/eclipse/rdf4j/http/client/query/AbstractHTTPUpdate.html" title="class in org.eclipse.rdf4j.http.client.query"><span class="typeNameLink">AbstractHTTPUpdate</span></a></li> </ul> </li> </ul> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/eclipse/rdf4j/http/client/package-tree.html">Prev</a></li> <li><a href="../../../../../../org/eclipse/rdf4j/http/client/util/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/eclipse/rdf4j/http/client/query/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2015-2019 <a href="https://www.eclipse.org/">Eclipse Foundation</a>. All Rights Reserved.</small></p> </body> </html>
{ "pile_set_name": "Github" }
CHECK: Done 1000 runs in RUN: LLVMFuzzer-ThreadedTest -use_traces=1 -runs=1000 2>&1 | FileCheck %s RUN: LLVMFuzzer-ThreadedTest -use_traces=1 -runs=1000 2>&1 | FileCheck %s RUN: LLVMFuzzer-ThreadedTest -use_traces=1 -runs=1000 2>&1 | FileCheck %s RUN: LLVMFuzzer-ThreadedTest -use_traces=1 -runs=1000 2>&1 | FileCheck %s
{ "pile_set_name": "Github" }
/** * \file * * \brief Component description for PORT * * Copyright (c) 2016 Atmel Corporation, * a wholly owned subsidiary of Microchip Technology Inc. * * \asf_license_start * * \page License * * 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 Licence 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. * * \asf_license_stop * */ #ifndef _SAMC21_PORT_COMPONENT_ #define _SAMC21_PORT_COMPONENT_ /* ========================================================================== */ /** SOFTWARE API DEFINITION FOR PORT */ /* ========================================================================== */ /** \addtogroup SAMC21_PORT Port Module */ /*@{*/ #define PORT_U2210 #define REV_PORT 0x211 /* -------- PORT_DIR : (PORT Offset: 0x00) (R/W 32) GROUP Data Direction -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { uint32_t reg; /*!< Type used for register access */ } PORT_DIR_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_DIR_OFFSET 0x00 /**< \brief (PORT_DIR offset) Data Direction */ #define PORT_DIR_RESETVALUE _U(0x00000000); /**< \brief (PORT_DIR reset_value) Data Direction */ #define PORT_DIR_MASK _U(0xFFFFFFFF) /**< \brief (PORT_DIR) MASK Register */ /* -------- PORT_DIRCLR : (PORT Offset: 0x04) (R/W 32) GROUP Data Direction Clear -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { uint32_t reg; /*!< Type used for register access */ } PORT_DIRCLR_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_DIRCLR_OFFSET 0x04 /**< \brief (PORT_DIRCLR offset) Data Direction Clear */ #define PORT_DIRCLR_RESETVALUE _U(0x00000000); /**< \brief (PORT_DIRCLR reset_value) Data Direction Clear */ #define PORT_DIRCLR_MASK _U(0xFFFFFFFF) /**< \brief (PORT_DIRCLR) MASK Register */ /* -------- PORT_DIRSET : (PORT Offset: 0x08) (R/W 32) GROUP Data Direction Set -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { uint32_t reg; /*!< Type used for register access */ } PORT_DIRSET_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_DIRSET_OFFSET 0x08 /**< \brief (PORT_DIRSET offset) Data Direction Set */ #define PORT_DIRSET_RESETVALUE _U(0x00000000); /**< \brief (PORT_DIRSET reset_value) Data Direction Set */ #define PORT_DIRSET_MASK _U(0xFFFFFFFF) /**< \brief (PORT_DIRSET) MASK Register */ /* -------- PORT_DIRTGL : (PORT Offset: 0x0C) (R/W 32) GROUP Data Direction Toggle -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { uint32_t reg; /*!< Type used for register access */ } PORT_DIRTGL_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_DIRTGL_OFFSET 0x0C /**< \brief (PORT_DIRTGL offset) Data Direction Toggle */ #define PORT_DIRTGL_RESETVALUE _U(0x00000000); /**< \brief (PORT_DIRTGL reset_value) Data Direction Toggle */ #define PORT_DIRTGL_MASK _U(0xFFFFFFFF) /**< \brief (PORT_DIRTGL) MASK Register */ /* -------- PORT_OUT : (PORT Offset: 0x10) (R/W 32) GROUP Data Output Value -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { uint32_t reg; /*!< Type used for register access */ } PORT_OUT_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_OUT_OFFSET 0x10 /**< \brief (PORT_OUT offset) Data Output Value */ #define PORT_OUT_RESETVALUE _U(0x00000000); /**< \brief (PORT_OUT reset_value) Data Output Value */ #define PORT_OUT_MASK _U(0xFFFFFFFF) /**< \brief (PORT_OUT) MASK Register */ /* -------- PORT_OUTCLR : (PORT Offset: 0x14) (R/W 32) GROUP Data Output Value Clear -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { uint32_t reg; /*!< Type used for register access */ } PORT_OUTCLR_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_OUTCLR_OFFSET 0x14 /**< \brief (PORT_OUTCLR offset) Data Output Value Clear */ #define PORT_OUTCLR_RESETVALUE _U(0x00000000); /**< \brief (PORT_OUTCLR reset_value) Data Output Value Clear */ #define PORT_OUTCLR_MASK _U(0xFFFFFFFF) /**< \brief (PORT_OUTCLR) MASK Register */ /* -------- PORT_OUTSET : (PORT Offset: 0x18) (R/W 32) GROUP Data Output Value Set -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { uint32_t reg; /*!< Type used for register access */ } PORT_OUTSET_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_OUTSET_OFFSET 0x18 /**< \brief (PORT_OUTSET offset) Data Output Value Set */ #define PORT_OUTSET_RESETVALUE _U(0x00000000); /**< \brief (PORT_OUTSET reset_value) Data Output Value Set */ #define PORT_OUTSET_MASK _U(0xFFFFFFFF) /**< \brief (PORT_OUTSET) MASK Register */ /* -------- PORT_OUTTGL : (PORT Offset: 0x1C) (R/W 32) GROUP Data Output Value Toggle -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { uint32_t reg; /*!< Type used for register access */ } PORT_OUTTGL_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_OUTTGL_OFFSET 0x1C /**< \brief (PORT_OUTTGL offset) Data Output Value Toggle */ #define PORT_OUTTGL_RESETVALUE _U(0x00000000); /**< \brief (PORT_OUTTGL reset_value) Data Output Value Toggle */ #define PORT_OUTTGL_MASK _U(0xFFFFFFFF) /**< \brief (PORT_OUTTGL) MASK Register */ /* -------- PORT_IN : (PORT Offset: 0x20) (R/ 32) GROUP Data Input Value -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { uint32_t reg; /*!< Type used for register access */ } PORT_IN_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_IN_OFFSET 0x20 /**< \brief (PORT_IN offset) Data Input Value */ #define PORT_IN_RESETVALUE _U(0x00000000); /**< \brief (PORT_IN reset_value) Data Input Value */ #define PORT_IN_MASK _U(0xFFFFFFFF) /**< \brief (PORT_IN) MASK Register */ /* -------- PORT_CTRL : (PORT Offset: 0x24) (R/W 32) GROUP Control -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { struct { uint32_t SAMPLING:32; /*!< bit: 0..31 Input Sampling Mode */ } bit; /*!< Structure used for bit access */ uint32_t reg; /*!< Type used for register access */ } PORT_CTRL_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_CTRL_OFFSET 0x24 /**< \brief (PORT_CTRL offset) Control */ #define PORT_CTRL_RESETVALUE _U(0x00000000); /**< \brief (PORT_CTRL reset_value) Control */ #define PORT_CTRL_SAMPLING_Pos 0 /**< \brief (PORT_CTRL) Input Sampling Mode */ #define PORT_CTRL_SAMPLING_Msk (_U(0xFFFFFFFF) << PORT_CTRL_SAMPLING_Pos) #define PORT_CTRL_SAMPLING(value) (PORT_CTRL_SAMPLING_Msk & ((value) << PORT_CTRL_SAMPLING_Pos)) #define PORT_CTRL_MASK _U(0xFFFFFFFF) /**< \brief (PORT_CTRL) MASK Register */ /* -------- PORT_WRCONFIG : (PORT Offset: 0x28) ( /W 32) GROUP Write Configuration -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { struct { uint32_t PINMASK:16; /*!< bit: 0..15 Pin Mask for Multiple Pin Configuration */ uint32_t PMUXEN:1; /*!< bit: 16 Select Peripheral Multiplexer */ uint32_t INEN:1; /*!< bit: 17 Input Enable */ uint32_t PULLEN:1; /*!< bit: 18 Pull Enable */ uint32_t :3; /*!< bit: 19..21 Reserved */ uint32_t DRVSTR:1; /*!< bit: 22 Output Driver Strength Selection */ uint32_t :1; /*!< bit: 23 Reserved */ uint32_t PMUX:4; /*!< bit: 24..27 Peripheral Multiplexing Template */ uint32_t WRPMUX:1; /*!< bit: 28 Write PMUX Registers */ uint32_t :1; /*!< bit: 29 Reserved */ uint32_t WRPINCFG:1; /*!< bit: 30 Write PINCFG Registers */ uint32_t HWSEL:1; /*!< bit: 31 Half-Word Select */ } bit; /*!< Structure used for bit access */ uint32_t reg; /*!< Type used for register access */ } PORT_WRCONFIG_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_WRCONFIG_OFFSET 0x28 /**< \brief (PORT_WRCONFIG offset) Write Configuration */ #define PORT_WRCONFIG_RESETVALUE _U(0x00000000); /**< \brief (PORT_WRCONFIG reset_value) Write Configuration */ #define PORT_WRCONFIG_PINMASK_Pos 0 /**< \brief (PORT_WRCONFIG) Pin Mask for Multiple Pin Configuration */ #define PORT_WRCONFIG_PINMASK_Msk (_U(0xFFFF) << PORT_WRCONFIG_PINMASK_Pos) #define PORT_WRCONFIG_PINMASK(value) (PORT_WRCONFIG_PINMASK_Msk & ((value) << PORT_WRCONFIG_PINMASK_Pos)) #define PORT_WRCONFIG_PMUXEN_Pos 16 /**< \brief (PORT_WRCONFIG) Select Peripheral Multiplexer */ #define PORT_WRCONFIG_PMUXEN (_U(0x1) << PORT_WRCONFIG_PMUXEN_Pos) #define PORT_WRCONFIG_INEN_Pos 17 /**< \brief (PORT_WRCONFIG) Input Enable */ #define PORT_WRCONFIG_INEN (_U(0x1) << PORT_WRCONFIG_INEN_Pos) #define PORT_WRCONFIG_PULLEN_Pos 18 /**< \brief (PORT_WRCONFIG) Pull Enable */ #define PORT_WRCONFIG_PULLEN (_U(0x1) << PORT_WRCONFIG_PULLEN_Pos) #define PORT_WRCONFIG_DRVSTR_Pos 22 /**< \brief (PORT_WRCONFIG) Output Driver Strength Selection */ #define PORT_WRCONFIG_DRVSTR (_U(0x1) << PORT_WRCONFIG_DRVSTR_Pos) #define PORT_WRCONFIG_PMUX_Pos 24 /**< \brief (PORT_WRCONFIG) Peripheral Multiplexing Template */ #define PORT_WRCONFIG_PMUX_Msk (_U(0xF) << PORT_WRCONFIG_PMUX_Pos) #define PORT_WRCONFIG_PMUX(value) (PORT_WRCONFIG_PMUX_Msk & ((value) << PORT_WRCONFIG_PMUX_Pos)) #define PORT_WRCONFIG_WRPMUX_Pos 28 /**< \brief (PORT_WRCONFIG) Write PMUX Registers */ #define PORT_WRCONFIG_WRPMUX (_U(0x1) << PORT_WRCONFIG_WRPMUX_Pos) #define PORT_WRCONFIG_WRPINCFG_Pos 30 /**< \brief (PORT_WRCONFIG) Write PINCFG Registers */ #define PORT_WRCONFIG_WRPINCFG (_U(0x1) << PORT_WRCONFIG_WRPINCFG_Pos) #define PORT_WRCONFIG_HWSEL_Pos 31 /**< \brief (PORT_WRCONFIG) Half-Word Select */ #define PORT_WRCONFIG_HWSEL (_U(0x1) << PORT_WRCONFIG_HWSEL_Pos) #define PORT_WRCONFIG_MASK _U(0xDF47FFFF) /**< \brief (PORT_WRCONFIG) MASK Register */ /* -------- PORT_EVCTRL : (PORT Offset: 0x2C) (R/W 32) GROUP Event Input Control -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { struct { uint32_t PID0:5; /*!< bit: 0.. 4 Port Event Pin Identifier 0 */ uint32_t EVACT0:2; /*!< bit: 5.. 6 Port Event Action 0 */ uint32_t PORTEI0:1; /*!< bit: 7 Port Event Enable Input 0 */ uint32_t PID1:5; /*!< bit: 8..12 Port Event Pin Identifier 1 */ uint32_t EVACT1:2; /*!< bit: 13..14 Port Event Action 1 */ uint32_t PORTEI1:1; /*!< bit: 15 Port Event Enable Input 1 */ uint32_t PID2:5; /*!< bit: 16..20 Port Event Pin Identifier 2 */ uint32_t EVACT2:2; /*!< bit: 21..22 Port Event Action 2 */ uint32_t PORTEI2:1; /*!< bit: 23 Port Event Enable Input 2 */ uint32_t PID3:5; /*!< bit: 24..28 Port Event Pin Identifier 3 */ uint32_t EVACT3:2; /*!< bit: 29..30 Port Event Action 3 */ uint32_t PORTEI3:1; /*!< bit: 31 Port Event Enable Input 3 */ } bit; /*!< Structure used for bit access */ uint32_t reg; /*!< Type used for register access */ } PORT_EVCTRL_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_EVCTRL_OFFSET 0x2C /**< \brief (PORT_EVCTRL offset) Event Input Control */ #define PORT_EVCTRL_RESETVALUE _U(0x00000000); /**< \brief (PORT_EVCTRL reset_value) Event Input Control */ #define PORT_EVCTRL_PID0_Pos 0 /**< \brief (PORT_EVCTRL) Port Event Pin Identifier 0 */ #define PORT_EVCTRL_PID0_Msk (_U(0x1F) << PORT_EVCTRL_PID0_Pos) #define PORT_EVCTRL_PID0(value) (PORT_EVCTRL_PID0_Msk & ((value) << PORT_EVCTRL_PID0_Pos)) #define PORT_EVCTRL_EVACT0_Pos 5 /**< \brief (PORT_EVCTRL) Port Event Action 0 */ #define PORT_EVCTRL_EVACT0_Msk (_U(0x3) << PORT_EVCTRL_EVACT0_Pos) #define PORT_EVCTRL_EVACT0(value) (PORT_EVCTRL_EVACT0_Msk & ((value) << PORT_EVCTRL_EVACT0_Pos)) #define PORT_EVCTRL_EVACT0_OUT_Val _U(0x0) /**< \brief (PORT_EVCTRL) Event output to pin */ #define PORT_EVCTRL_EVACT0_SET_Val _U(0x1) /**< \brief (PORT_EVCTRL) Set output register of pin on event */ #define PORT_EVCTRL_EVACT0_CLR_Val _U(0x2) /**< \brief (PORT_EVCTRL) Clear output register of pin on event */ #define PORT_EVCTRL_EVACT0_TGL_Val _U(0x3) /**< \brief (PORT_EVCTRL) Toggle output register of pin on event */ #define PORT_EVCTRL_EVACT0_OUT (PORT_EVCTRL_EVACT0_OUT_Val << PORT_EVCTRL_EVACT0_Pos) #define PORT_EVCTRL_EVACT0_SET (PORT_EVCTRL_EVACT0_SET_Val << PORT_EVCTRL_EVACT0_Pos) #define PORT_EVCTRL_EVACT0_CLR (PORT_EVCTRL_EVACT0_CLR_Val << PORT_EVCTRL_EVACT0_Pos) #define PORT_EVCTRL_EVACT0_TGL (PORT_EVCTRL_EVACT0_TGL_Val << PORT_EVCTRL_EVACT0_Pos) #define PORT_EVCTRL_PORTEI0_Pos 7 /**< \brief (PORT_EVCTRL) Port Event Enable Input 0 */ #define PORT_EVCTRL_PORTEI0 (_U(0x1) << PORT_EVCTRL_PORTEI0_Pos) #define PORT_EVCTRL_PID1_Pos 8 /**< \brief (PORT_EVCTRL) Port Event Pin Identifier 1 */ #define PORT_EVCTRL_PID1_Msk (_U(0x1F) << PORT_EVCTRL_PID1_Pos) #define PORT_EVCTRL_PID1(value) (PORT_EVCTRL_PID1_Msk & ((value) << PORT_EVCTRL_PID1_Pos)) #define PORT_EVCTRL_EVACT1_Pos 13 /**< \brief (PORT_EVCTRL) Port Event Action 1 */ #define PORT_EVCTRL_EVACT1_Msk (_U(0x3) << PORT_EVCTRL_EVACT1_Pos) #define PORT_EVCTRL_EVACT1(value) (PORT_EVCTRL_EVACT1_Msk & ((value) << PORT_EVCTRL_EVACT1_Pos)) #define PORT_EVCTRL_PORTEI1_Pos 15 /**< \brief (PORT_EVCTRL) Port Event Enable Input 1 */ #define PORT_EVCTRL_PORTEI1 (_U(0x1) << PORT_EVCTRL_PORTEI1_Pos) #define PORT_EVCTRL_PID2_Pos 16 /**< \brief (PORT_EVCTRL) Port Event Pin Identifier 2 */ #define PORT_EVCTRL_PID2_Msk (_U(0x1F) << PORT_EVCTRL_PID2_Pos) #define PORT_EVCTRL_PID2(value) (PORT_EVCTRL_PID2_Msk & ((value) << PORT_EVCTRL_PID2_Pos)) #define PORT_EVCTRL_EVACT2_Pos 21 /**< \brief (PORT_EVCTRL) Port Event Action 2 */ #define PORT_EVCTRL_EVACT2_Msk (_U(0x3) << PORT_EVCTRL_EVACT2_Pos) #define PORT_EVCTRL_EVACT2(value) (PORT_EVCTRL_EVACT2_Msk & ((value) << PORT_EVCTRL_EVACT2_Pos)) #define PORT_EVCTRL_PORTEI2_Pos 23 /**< \brief (PORT_EVCTRL) Port Event Enable Input 2 */ #define PORT_EVCTRL_PORTEI2 (_U(0x1) << PORT_EVCTRL_PORTEI2_Pos) #define PORT_EVCTRL_PID3_Pos 24 /**< \brief (PORT_EVCTRL) Port Event Pin Identifier 3 */ #define PORT_EVCTRL_PID3_Msk (_U(0x1F) << PORT_EVCTRL_PID3_Pos) #define PORT_EVCTRL_PID3(value) (PORT_EVCTRL_PID3_Msk & ((value) << PORT_EVCTRL_PID3_Pos)) #define PORT_EVCTRL_EVACT3_Pos 29 /**< \brief (PORT_EVCTRL) Port Event Action 3 */ #define PORT_EVCTRL_EVACT3_Msk (_U(0x3) << PORT_EVCTRL_EVACT3_Pos) #define PORT_EVCTRL_EVACT3(value) (PORT_EVCTRL_EVACT3_Msk & ((value) << PORT_EVCTRL_EVACT3_Pos)) #define PORT_EVCTRL_PORTEI3_Pos 31 /**< \brief (PORT_EVCTRL) Port Event Enable Input 3 */ #define PORT_EVCTRL_PORTEI3 (_U(0x1) << PORT_EVCTRL_PORTEI3_Pos) #define PORT_EVCTRL_MASK _U(0xFFFFFFFF) /**< \brief (PORT_EVCTRL) MASK Register */ /* -------- PORT_PMUX : (PORT Offset: 0x30) (R/W 8) GROUP Peripheral Multiplexing n -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { struct { uint8_t PMUXE:4; /*!< bit: 0.. 3 Peripheral Multiplexing for Even-Numbered Pin */ uint8_t PMUXO:4; /*!< bit: 4.. 7 Peripheral Multiplexing for Odd-Numbered Pin */ } bit; /*!< Structure used for bit access */ uint8_t reg; /*!< Type used for register access */ } PORT_PMUX_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_PMUX_OFFSET 0x30 /**< \brief (PORT_PMUX offset) Peripheral Multiplexing n */ #define PORT_PMUX_RESETVALUE _U(0x00); /**< \brief (PORT_PMUX reset_value) Peripheral Multiplexing n */ #define PORT_PMUX_PMUXE_Pos 0 /**< \brief (PORT_PMUX) Peripheral Multiplexing for Even-Numbered Pin */ #define PORT_PMUX_PMUXE_Msk (_U(0xF) << PORT_PMUX_PMUXE_Pos) #define PORT_PMUX_PMUXE(value) (PORT_PMUX_PMUXE_Msk & ((value) << PORT_PMUX_PMUXE_Pos)) #define PORT_PMUX_PMUXO_Pos 4 /**< \brief (PORT_PMUX) Peripheral Multiplexing for Odd-Numbered Pin */ #define PORT_PMUX_PMUXO_Msk (_U(0xF) << PORT_PMUX_PMUXO_Pos) #define PORT_PMUX_PMUXO(value) (PORT_PMUX_PMUXO_Msk & ((value) << PORT_PMUX_PMUXO_Pos)) #define PORT_PMUX_MASK _U(0xFF) /**< \brief (PORT_PMUX) MASK Register */ /* -------- PORT_PINCFG : (PORT Offset: 0x40) (R/W 8) GROUP Pin Configuration n -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { struct { uint8_t PMUXEN:1; /*!< bit: 0 Select Peripheral Multiplexer */ uint8_t INEN:1; /*!< bit: 1 Input Enable */ uint8_t PULLEN:1; /*!< bit: 2 Pull Enable */ uint8_t :3; /*!< bit: 3.. 5 Reserved */ uint8_t DRVSTR:1; /*!< bit: 6 Output Driver Strength Selection */ uint8_t :1; /*!< bit: 7 Reserved */ } bit; /*!< Structure used for bit access */ uint8_t reg; /*!< Type used for register access */ } PORT_PINCFG_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #define PORT_PINCFG_OFFSET 0x40 /**< \brief (PORT_PINCFG offset) Pin Configuration n */ #define PORT_PINCFG_RESETVALUE _U(0x00); /**< \brief (PORT_PINCFG reset_value) Pin Configuration n */ #define PORT_PINCFG_PMUXEN_Pos 0 /**< \brief (PORT_PINCFG) Select Peripheral Multiplexer */ #define PORT_PINCFG_PMUXEN (_U(0x1) << PORT_PINCFG_PMUXEN_Pos) #define PORT_PINCFG_INEN_Pos 1 /**< \brief (PORT_PINCFG) Input Enable */ #define PORT_PINCFG_INEN (_U(0x1) << PORT_PINCFG_INEN_Pos) #define PORT_PINCFG_PULLEN_Pos 2 /**< \brief (PORT_PINCFG) Pull Enable */ #define PORT_PINCFG_PULLEN (_U(0x1) << PORT_PINCFG_PULLEN_Pos) #define PORT_PINCFG_DRVSTR_Pos 6 /**< \brief (PORT_PINCFG) Output Driver Strength Selection */ #define PORT_PINCFG_DRVSTR (_U(0x1) << PORT_PINCFG_DRVSTR_Pos) #define PORT_PINCFG_MASK _U(0x47) /**< \brief (PORT_PINCFG) MASK Register */ /** \brief PortGroup hardware registers */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef struct { __IO PORT_DIR_Type DIR; /**< \brief Offset: 0x00 (R/W 32) Data Direction */ __IO PORT_DIRCLR_Type DIRCLR; /**< \brief Offset: 0x04 (R/W 32) Data Direction Clear */ __IO PORT_DIRSET_Type DIRSET; /**< \brief Offset: 0x08 (R/W 32) Data Direction Set */ __IO PORT_DIRTGL_Type DIRTGL; /**< \brief Offset: 0x0C (R/W 32) Data Direction Toggle */ __IO PORT_OUT_Type OUT; /**< \brief Offset: 0x10 (R/W 32) Data Output Value */ __IO PORT_OUTCLR_Type OUTCLR; /**< \brief Offset: 0x14 (R/W 32) Data Output Value Clear */ __IO PORT_OUTSET_Type OUTSET; /**< \brief Offset: 0x18 (R/W 32) Data Output Value Set */ __IO PORT_OUTTGL_Type OUTTGL; /**< \brief Offset: 0x1C (R/W 32) Data Output Value Toggle */ __I PORT_IN_Type IN; /**< \brief Offset: 0x20 (R/ 32) Data Input Value */ __IO PORT_CTRL_Type CTRL; /**< \brief Offset: 0x24 (R/W 32) Control */ __O PORT_WRCONFIG_Type WRCONFIG; /**< \brief Offset: 0x28 ( /W 32) Write Configuration */ __IO PORT_EVCTRL_Type EVCTRL; /**< \brief Offset: 0x2C (R/W 32) Event Input Control */ __IO PORT_PMUX_Type PMUX[16]; /**< \brief Offset: 0x30 (R/W 8) Peripheral Multiplexing n */ __IO PORT_PINCFG_Type PINCFG[32]; /**< \brief Offset: 0x40 (R/W 8) Pin Configuration n */ RoReg8 Reserved1[0x20]; } PortGroup; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ /** \brief PORT hardware registers */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef struct { PortGroup Group[3]; /**< \brief Offset: 0x00 PortGroup groups [GROUPS] */ } Port; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ /*@}*/ #endif /* _SAMC21_PORT_COMPONENT_ */
{ "pile_set_name": "Github" }
/****************************************************************************** * Copyright 2019 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #pragma once #include <memory> #include "modules/localization/msf/local_pyramid_map/base_map/base_map_node_config.h" namespace apollo { namespace localization { namespace msf { namespace pyramid_map { class PyramidMapNodeConfig : public BaseMapNodeConfig { public: PyramidMapNodeConfig(); ~PyramidMapNodeConfig(); virtual std::shared_ptr<BaseMapNodeConfig> Clone(); }; } // namespace pyramid_map } // namespace msf } // namespace localization } // namespace apollo
{ "pile_set_name": "Github" }
<extend name="Public:common" /> <block name="main"> <div class="gallery"> <div class="col-md-offset-2"> <h2><strong>联系方式</strong></h2> <hr style="width:80%" class="col-md-offset-0"/> <h5><strong>请您准确填写您的联系方式,以便我们能够准确为您邮寄兑换的礼品。</strong></h5><br/> <form method="post" action="{:U('info/add')}"> <div class="form-group"> <label>姓名:</label> <input type="text" name="realname" class="form-control" style="width:50%" placeholder="请输入姓名"> </div> <div class="form-group"> <label>邮编:</label> <input type="text" name="zipcode" class="form-control" style="width:50%" placeholder="请输入邮编"> </div> <div class="form-group"> <label>住址:</label> <input type="text" name="location" class="form-control" style="width:50%" placeholder="请输入住址"> </div> <div class="form-group"> <label>电话:</label> <input type="text" name="tel" class="form-control" style="width:50%" placeholder="请输入电话"> </div> <div class="form-group"> <label>支付宝账号:</label> <input type="text" name="alipay" class="form-control" style="width:50%" placeholder="请输入支付宝账号"> </div> <!--<div class="form-group"> <input type="hidden" name="user_id" value=""> </div>--> <button type="submit" class="btn btn-default">提交</button> </form> </div> </block>
{ "pile_set_name": "Github" }
{ "numbering_system": "latn", "decimal_pattern": "#,##0.###", "percent_pattern": "#,##0%", "currency_pattern": "¤#,##0.00", "accounting_currency_pattern": "¤#,##0.00;(¤#,##0.00)" }
{ "pile_set_name": "Github" }
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2014 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ #ifndef __QLA_DMP27_H__ #define __QLA_DMP27_H__ #define IOBASE_ADDR offsetof(struct device_reg_24xx, iobase_addr) struct __packed qla27xx_fwdt_template { uint32_t template_type; uint32_t entry_offset; uint32_t template_size; uint32_t reserved_1; uint32_t entry_count; uint32_t template_version; uint32_t capture_timestamp; uint32_t template_checksum; uint32_t reserved_2; uint32_t driver_info[3]; uint32_t saved_state[16]; uint32_t reserved_3[8]; uint32_t firmware_version[5]; }; #define TEMPLATE_TYPE_FWDUMP 99 #define ENTRY_TYPE_NOP 0 #define ENTRY_TYPE_TMP_END 255 #define ENTRY_TYPE_RD_IOB_T1 256 #define ENTRY_TYPE_WR_IOB_T1 257 #define ENTRY_TYPE_RD_IOB_T2 258 #define ENTRY_TYPE_WR_IOB_T2 259 #define ENTRY_TYPE_RD_PCI 260 #define ENTRY_TYPE_WR_PCI 261 #define ENTRY_TYPE_RD_RAM 262 #define ENTRY_TYPE_GET_QUEUE 263 #define ENTRY_TYPE_GET_FCE 264 #define ENTRY_TYPE_PSE_RISC 265 #define ENTRY_TYPE_RST_RISC 266 #define ENTRY_TYPE_DIS_INTR 267 #define ENTRY_TYPE_GET_HBUF 268 #define ENTRY_TYPE_SCRATCH 269 #define ENTRY_TYPE_RDREMREG 270 #define ENTRY_TYPE_WRREMREG 271 #define ENTRY_TYPE_RDREMRAM 272 #define ENTRY_TYPE_PCICFG 273 #define ENTRY_TYPE_GET_SHADOW 274 #define ENTRY_TYPE_WRITE_BUF 275 #define CAPTURE_FLAG_PHYS_ONLY BIT_0 #define CAPTURE_FLAG_PHYS_VIRT BIT_1 #define DRIVER_FLAG_SKIP_ENTRY BIT_7 struct __packed qla27xx_fwdt_entry { struct __packed { uint32_t entry_type; uint32_t entry_size; uint32_t reserved_1; uint8_t capture_flags; uint8_t reserved_2[2]; uint8_t driver_flags; } hdr; union __packed { struct __packed { } t0; struct __packed { } t255; struct __packed { uint32_t base_addr; uint8_t reg_width; uint16_t reg_count; uint8_t pci_offset; } t256; struct __packed { uint32_t base_addr; uint32_t write_data; uint8_t pci_offset; uint8_t reserved[3]; } t257; struct __packed { uint32_t base_addr; uint8_t reg_width; uint16_t reg_count; uint8_t pci_offset; uint8_t banksel_offset; uint8_t reserved[3]; uint32_t bank; } t258; struct __packed { uint32_t base_addr; uint32_t write_data; uint8_t reserved[2]; uint8_t pci_offset; uint8_t banksel_offset; uint32_t bank; } t259; struct __packed { uint8_t pci_offset; uint8_t reserved[3]; } t260; struct __packed { uint8_t pci_offset; uint8_t reserved[3]; uint32_t write_data; } t261; struct __packed { uint8_t ram_area; uint8_t reserved[3]; uint32_t start_addr; uint32_t end_addr; } t262; struct __packed { uint32_t num_queues; uint8_t queue_type; uint8_t reserved[3]; } t263; struct __packed { uint32_t fce_trace_size; uint64_t write_pointer; uint64_t base_pointer; uint32_t fce_enable_mb0; uint32_t fce_enable_mb2; uint32_t fce_enable_mb3; uint32_t fce_enable_mb4; uint32_t fce_enable_mb5; uint32_t fce_enable_mb6; } t264; struct __packed { } t265; struct __packed { } t266; struct __packed { uint8_t pci_offset; uint8_t reserved[3]; uint32_t data; } t267; struct __packed { uint8_t buf_type; uint8_t reserved[3]; uint32_t buf_size; uint64_t start_addr; } t268; struct __packed { uint32_t scratch_size; } t269; struct __packed { uint32_t addr; uint32_t count; } t270; struct __packed { uint32_t addr; uint32_t data; } t271; struct __packed { uint32_t addr; uint32_t count; } t272; struct __packed { uint32_t addr; uint32_t count; } t273; struct __packed { uint32_t num_queues; uint8_t queue_type; uint8_t reserved[3]; } t274; struct __packed { uint32_t length; uint8_t buffer[]; } t275; }; }; #define T262_RAM_AREA_CRITICAL_RAM 1 #define T262_RAM_AREA_EXTERNAL_RAM 2 #define T262_RAM_AREA_SHARED_RAM 3 #define T262_RAM_AREA_DDR_RAM 4 #define T263_QUEUE_TYPE_REQ 1 #define T263_QUEUE_TYPE_RSP 2 #define T263_QUEUE_TYPE_ATIO 3 #define T268_BUF_TYPE_EXTD_TRACE 1 #define T268_BUF_TYPE_EXCH_BUFOFF 2 #define T268_BUF_TYPE_EXTD_LOGIN 3 #define T268_BUF_TYPE_REQ_MIRROR 4 #define T268_BUF_TYPE_RSP_MIRROR 5 #define T274_QUEUE_TYPE_REQ_SHAD 1 #define T274_QUEUE_TYPE_RSP_SHAD 2 #define T274_QUEUE_TYPE_ATIO_SHAD 3 #endif
{ "pile_set_name": "Github" }
package otto type _reference interface { invalid() bool // IsUnresolvableReference getValue() Value // getValue putValue(Value) string // PutValue delete() bool } // PropertyReference type _propertyReference struct { name string strict bool base *_object runtime *_runtime at _at } func newPropertyReference(rt *_runtime, base *_object, name string, strict bool, at _at) *_propertyReference { return &_propertyReference{ runtime: rt, name: name, strict: strict, base: base, at: at, } } func (self *_propertyReference) invalid() bool { return self.base == nil } func (self *_propertyReference) getValue() Value { if self.base == nil { panic(self.runtime.panicReferenceError("'%s' is not defined", self.name, self.at)) } return self.base.get(self.name) } func (self *_propertyReference) putValue(value Value) string { if self.base == nil { return self.name } self.base.put(self.name, value, self.strict) return "" } func (self *_propertyReference) delete() bool { if self.base == nil { // TODO Throw an error if strict return true } return self.base.delete(self.name, self.strict) } // ArgumentReference func newArgumentReference(runtime *_runtime, base *_object, name string, strict bool, at _at) *_propertyReference { if base == nil { panic(hereBeDragons()) } return newPropertyReference(runtime, base, name, strict, at) } type _stashReference struct { name string strict bool base _stash } func (self *_stashReference) invalid() bool { return false // The base (an environment) will never be nil } func (self *_stashReference) getValue() Value { return self.base.getBinding(self.name, self.strict) } func (self *_stashReference) putValue(value Value) string { self.base.setValue(self.name, value, self.strict) return "" } func (self *_stashReference) delete() bool { if self.base == nil { // This should never be reached, but just in case return false } return self.base.deleteBinding(self.name) } // getIdentifierReference func getIdentifierReference(runtime *_runtime, stash _stash, name string, strict bool, at _at) _reference { if stash == nil { return newPropertyReference(runtime, nil, name, strict, at) } if stash.hasBinding(name) { return stash.newReference(name, strict, at) } return getIdentifierReference(runtime, stash.outer(), name, strict, at) }
{ "pile_set_name": "Github" }
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/> // Copyright (C) 2010 Winch Gate Property Limited // // 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/>. #ifndef NL_VECTOR_2D_H #define NL_VECTOR_2D_H #include "types_nl.h" #include <cmath> #include <string> #include "stream.h" #include "vector_2f.h" namespace NLMISC { // *************************************************************************** /** * A 2D vector of double. * \author Lionel Berenguier * \author Nevrax France * \date 2001 */ class CVector2d { public: public: // Attributes. double x,y; public: // Methods. /// @name Object. //@{ /// Constructor which does nothing. CVector2d() {} /// Constructor . CVector2d(double _x, double _y) : x(_x), y(_y) {} /// Copy Constructor. CVector2d(const CVector2d &v) : x(v.x), y(v.y) {} /// Constructor with a CVector2f. CVector2d(const CVector2f &v) : x(v.x), y(v.y) {} //@} /// @name Base Maths. //@{ CVector2d &operator+=(const CVector2d &v) {x+=v.x; y+=v.y; return *this;} CVector2d &operator-=(const CVector2d &v) {x-=v.x; y-=v.y; return *this;} CVector2d &operator*=(double f) {x*=f; y*=f; return *this;} CVector2d &operator/=(double f) {x/=f; y/=f; return *this;} CVector2d operator+(const CVector2d &v) const {return CVector2d(x+v.x, y+v.y);} CVector2d operator-(const CVector2d &v) const {return CVector2d(x-v.x, y-v.y);} CVector2d operator*(double f) const {return CVector2d(x*f, y*f);} CVector2d operator/(double f) const {return CVector2d(x/f, y/f);} CVector2d operator-() const {return CVector2d(-x, -y);} //@} /// @name Advanced Maths. //@{ /// Dot product. double operator*(const CVector2d &v) const {return x*v.x + y*v.y;} /// Return the norm of the vector. double norm() const {return (double)sqrt(sqrnorm());} /// Return the square of the norm of the vector. double sqrnorm() const {return x*x + y*y;} /// Normalize the vector. void normalize() { double f= norm(); if(f>0) *this/=f; } /// Return the vector normalized. CVector2d normed() const { CVector2d v= *this; v.normalize(); return v; } //@} /// @name Misc. //@{ void set(double _x, double _y) {x= _x; y=_y;} bool operator==(const CVector2d &v) const {return x==v.x && y==v.y;} bool operator!=(const CVector2d &v) const {return !(*this==v);} bool isNull() const {return x==0.0f && y==0.0f;} /// Set all vector x/y/z as minimum of a/b x/y/z (respectively). void minof(const CVector2d &a, const CVector2d &b) { x= std::min(a.x, b.x); y= std::min(a.y, b.y); } /// Set all vector x/y/z as maximum of a/b x/y/z (respectively). void maxof(const CVector2d &a, const CVector2d &b) { x= std::max(a.x, b.x); y= std::max(a.y, b.y); } /// serial. void serial(NLMISC::IStream &f) {f.serial(x,y);} //@} // friends. friend CVector2d operator*(double f, const CVector2d &v0); }; inline CVector2d operator*(double f, const CVector2d &v) { return v*f; } } // NLMISC #endif // NL_VECTOR_2D_H /* End of vector_2d.h */
{ "pile_set_name": "Github" }
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyArgparse(PythonPackage): """Python command-line parsing library.""" homepage = "https://github.com/ThomasWaldmann/argparse/" url = "https://pypi.io/packages/source/a/argparse/argparse-1.4.0.tar.gz" version('1.4.0', sha256='62b089a55be1d8949cd2bc7e0df0bddb9e028faefc8c32038cc84862aefdd6e4') depends_on('py-setuptools', type='build')
{ "pile_set_name": "Github" }
/* * Copyright 2011-2012 Jason Rush and John Flanagan. All rights reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #import <Foundation/Foundation.h> #import "OutputStream.h" @interface HashedOutputStream : OutputStream { OutputStream *outputStream; uint32_t blockIndex; uint8_t *buffer; uint32_t bufferOffset; uint32_t bufferLength; } - (id)initWithOutputStream:(OutputStream *)stream blockSize:(uint32_t)blockSize; @end
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>RestConfig (operator-runtime 2.1 API)</title> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="RestConfig (operator-runtime 2.1 API)"; } } catch(err) { } //--> var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/RestConfig.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../oracle/kubernetes/operator/rest/RestBackendImpl.html" title="class in oracle.kubernetes.operator.rest"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../oracle/kubernetes/operator/rest/RestConfigImpl.html" title="class in oracle.kubernetes.operator.rest"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?oracle/kubernetes/operator/rest/RestConfig.html" target="_top">Frames</a></li> <li><a href="RestConfig.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">oracle.kubernetes.operator.rest</div> <h2 title="Interface RestConfig" class="title">Interface RestConfig</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Known Implementing Classes:</dt> <dd><a href="../../../../oracle/kubernetes/operator/rest/RestConfigImpl.html" title="class in oracle.kubernetes.operator.rest">RestConfigImpl</a></dd> </dl> <hr> <br> <pre>public interface <span class="typeNameLabel">RestConfig</span></pre> <div class="block">The RestConfig interface is used to pass the WebLogic Operator's REST configuration to the RestServer.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field.summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../oracle/kubernetes/operator/rest/RestConfig.html#REST_CONFIG_PROPERTY">REST_CONFIG_PROPERTY</a></span></code> <div class="block">This constant is used internally to pass the RestConfig instance from the RestServer to the filters and resources so that they can access it.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../../oracle/kubernetes/operator/rest/backend/RestBackend.html" title="interface in oracle.kubernetes.operator.rest.backend">RestBackend</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../oracle/kubernetes/operator/rest/RestConfig.html#getBackend-java.lang.String-">getBackend</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;accessToken)</code> <div class="block">Gets a RestBackend instance that does the real work behind a single WebLogic Operator REST api request.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../oracle/kubernetes/operator/rest/RestConfig.html#getExternalHttpsPort--">getExternalHttpsPort</a></span>()</code> <div class="block">Gets the external https port's in-pod port number.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../oracle/kubernetes/operator/rest/RestConfig.html#getHost--">getHost</a></span>()</code> <div class="block">Gets the in-pod hostname of the WebLogic operator REST api.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../oracle/kubernetes/operator/rest/RestConfig.html#getInternalHttpsPort--">getInternalHttpsPort</a></span>()</code> <div class="block">Gets the internal https port's in-pod port number.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../oracle/kubernetes/operator/rest/RestConfig.html#getOperatorExternalCertificateData--">getOperatorExternalCertificateData</a></span>()</code> <div class="block">Gets the external https port's certificate.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../oracle/kubernetes/operator/rest/RestConfig.html#getOperatorExternalCertificateFile--">getOperatorExternalCertificateFile</a></span>()</code> <div class="block">Gets external https port's certificate.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../oracle/kubernetes/operator/rest/RestConfig.html#getOperatorExternalKeyData--">getOperatorExternalKeyData</a></span>()</code> <div class="block">Gets the external https port's private key.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../oracle/kubernetes/operator/rest/RestConfig.html#getOperatorExternalKeyFile--">getOperatorExternalKeyFile</a></span>()</code> <div class="block">Gets external https port's private key.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../oracle/kubernetes/operator/rest/RestConfig.html#getOperatorInternalCertificateData--">getOperatorInternalCertificateData</a></span>()</code> <div class="block">Gets the internal https port's certificate.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../oracle/kubernetes/operator/rest/RestConfig.html#getOperatorInternalCertificateFile--">getOperatorInternalCertificateFile</a></span>()</code> <div class="block">Gets internal https port's certificate.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../oracle/kubernetes/operator/rest/RestConfig.html#getOperatorInternalKeyData--">getOperatorInternalKeyData</a></span>()</code> <div class="block">Gets the internal https port's private key.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../oracle/kubernetes/operator/rest/RestConfig.html#getOperatorInternalKeyFile--">getOperatorInternalKeyFile</a></span>()</code> <div class="block">Gets internal https port's private key.</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field.detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="REST_CONFIG_PROPERTY"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>REST_CONFIG_PROPERTY</h4> <pre>static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> REST_CONFIG_PROPERTY</pre> <div class="block">This constant is used internally to pass the RestConfig instance from the RestServer to the filters and resources so that they can access it.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../constant-values.html#oracle.kubernetes.operator.rest.RestConfig.REST_CONFIG_PROPERTY">Constant Field Values</a></dd> </dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getHost--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHost</h4> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getHost()</pre> <div class="block">Gets the in-pod hostname of the WebLogic operator REST api.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the in-pod hostname</dd> </dl> </li> </ul> <a name="getExternalHttpsPort--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getExternalHttpsPort</h4> <pre>int&nbsp;getExternalHttpsPort()</pre> <div class="block">Gets the external https port's in-pod port number.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the port number</dd> </dl> </li> </ul> <a name="getInternalHttpsPort--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getInternalHttpsPort</h4> <pre>int&nbsp;getInternalHttpsPort()</pre> <div class="block">Gets the internal https port's in-pod port number.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the port number</dd> </dl> </li> </ul> <a name="getOperatorExternalCertificateData--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOperatorExternalCertificateData</h4> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getOperatorExternalCertificateData()</pre> <div class="block">Gets the external https port's certificate.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>base64 encoded PEM containing the certificate, or null if getOperatorExternalCertificateFile should be used instead to get the certificate.</dd> </dl> </li> </ul> <a name="getOperatorInternalCertificateData--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOperatorInternalCertificateData</h4> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getOperatorInternalCertificateData()</pre> <div class="block">Gets the internal https port's certificate.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>base64 encoded PEM containing the certificate, or null if getOperatorInternalCertificateFile should be used instead to get the certificate.</dd> </dl> </li> </ul> <a name="getOperatorExternalCertificateFile--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOperatorExternalCertificateFile</h4> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getOperatorExternalCertificateFile()</pre> <div class="block">Gets external https port's certificate.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the pathname of a PEM file containing the certificate or null if getOperatorExternalCertificateData should be used instead to get the certificate.</dd> </dl> </li> </ul> <a name="getOperatorInternalCertificateFile--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOperatorInternalCertificateFile</h4> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getOperatorInternalCertificateFile()</pre> <div class="block">Gets internal https port's certificate.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the pathname of a PEM file containing the certificate or null if getOperatorInternalCertificateData should be used instead to get the certificate.</dd> </dl> </li> </ul> <a name="getOperatorExternalKeyData--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOperatorExternalKeyData</h4> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getOperatorExternalKeyData()</pre> <div class="block">Gets the external https port's private key.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>base64 encoded PEM containing the private key, or null if getOperatorExternalKeyFile should be used instead to get the private key.</dd> </dl> </li> </ul> <a name="getOperatorInternalKeyData--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOperatorInternalKeyData</h4> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getOperatorInternalKeyData()</pre> <div class="block">Gets the internal https port's private key.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>base64 encoded PEM containing the private key, or null if getOperatorInternalKeyFile should be used instead to get the private key.</dd> </dl> </li> </ul> <a name="getOperatorExternalKeyFile--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOperatorExternalKeyFile</h4> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getOperatorExternalKeyFile()</pre> <div class="block">Gets external https port's private key.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the pathname of a PEM file containing the private key or null if getOperatorExternalKeyData should be used instead to get the private key.</dd> </dl> </li> </ul> <a name="getOperatorInternalKeyFile--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOperatorInternalKeyFile</h4> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getOperatorInternalKeyFile()</pre> <div class="block">Gets internal https port's private key.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the pathname of a PEM file containing the private key or null if getOperatorInternalKeyData should be used instead to get the private key.</dd> </dl> </li> </ul> <a name="getBackend-java.lang.String-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getBackend</h4> <pre><a href="../../../../oracle/kubernetes/operator/rest/backend/RestBackend.html" title="interface in oracle.kubernetes.operator.rest.backend">RestBackend</a>&nbsp;getBackend(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;accessToken)</pre> <div class="block">Gets a RestBackend instance that does the real work behind a single WebLogic Operator REST api request.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>accessToken</code> - contains the Kubernetes service account token that should be used to authenticate and authorize this request.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a RestBackend instance that can be used to process this request (but not other requests).</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/RestConfig.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../oracle/kubernetes/operator/rest/RestBackendImpl.html" title="class in oracle.kubernetes.operator.rest"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../oracle/kubernetes/operator/rest/RestConfigImpl.html" title="class in oracle.kubernetes.operator.rest"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?oracle/kubernetes/operator/rest/RestConfig.html" target="_top">Frames</a></li> <li><a href="RestConfig.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><p>Copyright 2018, 2019, <a href="http://www.oracle.com">Oracle Corporation</a> and/or its affiliates. All rights reserved. <br />Licensed under the Universal Permissive License v 1.0 as shown at <a href="http://oss.oracle.com/licenses/upl">http://oss.oracle.com/licenses/upl</a>.<p></small></p> </body> </html>
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Validate XHTML</title> </head> <body> <div> <p>!$title$!</p> <p>!$text$!</p> </div> </body> </html>
{ "pile_set_name": "Github" }
/** * A specialized version of `_.forEachRight` for arrays without support for * callback shorthands and `this` binding. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEachRight(array, iteratee) { var length = array.length; while (length--) { if (iteratee(array[length], length, array) === false) { break; } } return array; } module.exports = arrayEachRight;
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class org.apache.sysds.runtime.compress.AbstractCompressedMatrixBlock (SystemDS 2.0.0-SNAPSHOT API)</title> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.sysds.runtime.compress.AbstractCompressedMatrixBlock (SystemDS 2.0.0-SNAPSHOT API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/sysds/runtime/compress/AbstractCompressedMatrixBlock.html" title="class in org.apache.sysds.runtime.compress">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-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/sysds/runtime/compress/class-use/AbstractCompressedMatrixBlock.html" target="_top">Frames</a></li> <li><a href="AbstractCompressedMatrixBlock.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.sysds.runtime.compress.AbstractCompressedMatrixBlock" class="title">Uses of Class<br>org.apache.sysds.runtime.compress.AbstractCompressedMatrixBlock</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../org/apache/sysds/runtime/compress/AbstractCompressedMatrixBlock.html" title="class in org.apache.sysds.runtime.compress">AbstractCompressedMatrixBlock</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.apache.sysds.runtime.compress">org.apache.sysds.runtime.compress</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.apache.sysds.runtime.compress"> <!-- --> </a> <h3>Uses of <a href="../../../../../../org/apache/sysds/runtime/compress/AbstractCompressedMatrixBlock.html" title="class in org.apache.sysds.runtime.compress">AbstractCompressedMatrixBlock</a> in <a href="../../../../../../org/apache/sysds/runtime/compress/package-summary.html">org.apache.sysds.runtime.compress</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation"> <caption><span>Subclasses of <a href="../../../../../../org/apache/sysds/runtime/compress/AbstractCompressedMatrixBlock.html" title="class in org.apache.sysds.runtime.compress">AbstractCompressedMatrixBlock</a> in <a href="../../../../../../org/apache/sysds/runtime/compress/package-summary.html">org.apache.sysds.runtime.compress</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sysds/runtime/compress/CompressedMatrixBlock.html" title="class in org.apache.sysds.runtime.compress">CompressedMatrixBlock</a></span></code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/sysds/runtime/compress/AbstractCompressedMatrixBlock.html" title="class in org.apache.sysds.runtime.compress">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-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/sysds/runtime/compress/class-use/AbstractCompressedMatrixBlock.html" target="_top">Frames</a></li> <li><a href="AbstractCompressedMatrixBlock.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> </body> </html>
{ "pile_set_name": "Github" }
@echo off "C:\Program Files (x86)\nant-0.92\bin\nant.exe" -buildfile:release.build pause
{ "pile_set_name": "Github" }
// File generated from our OpenAPI spec package com.stripe.param; import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import lombok.Getter; @Getter public class BitcoinReceiverListParams extends ApiRequestParams { /** Filter for active receivers. */ @SerializedName("active") Boolean active; /** * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place * in the list. For instance, if you make a list request and receive 100 objects, starting with * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to * fetch the previous page of the list. */ @SerializedName("ending_before") String endingBefore; /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List<String> expand; /** * Map of extra parameters for custom features not available in this client library. The content * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each * key/value pair is serialized as if the key is a root-level field (serialized) name in this * param object. Effectively, this map is flattened to its parent instance. */ @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map<String, Object> extraParams; /** Filter for filled receivers. */ @SerializedName("filled") Boolean filled; /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. */ @SerializedName("limit") Long limit; /** * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place * in the list. For instance, if you make a list request and receive 100 objects, ending with * {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in order to * fetch the next page of the list. */ @SerializedName("starting_after") String startingAfter; /** Filter for receivers with uncaptured funds. */ @SerializedName("uncaptured_funds") Boolean uncapturedFunds; private BitcoinReceiverListParams( Boolean active, String endingBefore, List<String> expand, Map<String, Object> extraParams, Boolean filled, Long limit, String startingAfter, Boolean uncapturedFunds) { this.active = active; this.endingBefore = endingBefore; this.expand = expand; this.extraParams = extraParams; this.filled = filled; this.limit = limit; this.startingAfter = startingAfter; this.uncapturedFunds = uncapturedFunds; } public static Builder builder() { return new Builder(); } public static class Builder { private Boolean active; private String endingBefore; private List<String> expand; private Map<String, Object> extraParams; private Boolean filled; private Long limit; private String startingAfter; private Boolean uncapturedFunds; /** Finalize and obtain parameter instance from this builder. */ public BitcoinReceiverListParams build() { return new BitcoinReceiverListParams( this.active, this.endingBefore, this.expand, this.extraParams, this.filled, this.limit, this.startingAfter, this.uncapturedFunds); } /** Filter for active receivers. */ public Builder setActive(Boolean active) { this.active = active; return this; } /** * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place * in the list. For instance, if you make a list request and receive 100 objects, starting with * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to * fetch the previous page of the list. */ public Builder setEndingBefore(String endingBefore) { this.endingBefore = endingBefore; return this; } /** * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link * BitcoinReceiverListParams#expand} for the field documentation. */ public Builder addExpand(String element) { if (this.expand == null) { this.expand = new ArrayList<>(); } this.expand.add(element); return this; } /** * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link * BitcoinReceiverListParams#expand} for the field documentation. */ public Builder addAllExpand(List<String> elements) { if (this.expand == null) { this.expand = new ArrayList<>(); } this.expand.addAll(elements); return this; } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` * call, and subsequent calls add additional key/value pairs to the original map. See {@link * BitcoinReceiverListParams#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.put(key, value); return this; } /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link BitcoinReceiverListParams#extraParams} for the field documentation. */ public Builder putAllExtraParam(Map<String, Object> map) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.putAll(map); return this; } /** Filter for filled receivers. */ public Builder setFilled(Boolean filled) { this.filled = filled; return this; } /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 10. */ public Builder setLimit(Long limit) { this.limit = limit; return this; } /** * A cursor for use in pagination. {@code starting_after} is an object ID that defines your * place in the list. For instance, if you make a list request and receive 100 objects, ending * with {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in * order to fetch the next page of the list. */ public Builder setStartingAfter(String startingAfter) { this.startingAfter = startingAfter; return this; } /** Filter for receivers with uncaptured funds. */ public Builder setUncapturedFunds(Boolean uncapturedFunds) { this.uncapturedFunds = uncapturedFunds; return this; } } }
{ "pile_set_name": "Github" }
// server/ssr_data.js // stolen from https://github.com/kadirahq/flow-router/blob/ssr/server/ssr_data.js export default function patchSubscribeData (VueSSR) { const originalSubscribe = Meteor.subscribe Meteor.subscribe = function (pubName, ...params) { const ssrContext = VueSSR.ssrContext.get() if (ssrContext) { VueSSR.inSubscription.withValue(true, () => { ssrContext.addSubscription(pubName, params) }) } if (originalSubscribe) { originalSubscribe.apply(this, arguments) } return { ready: () => true, } } const Mongo = Package.mongo.Mongo const originalFind = Mongo.Collection.prototype.find Mongo.Collection.prototype.find = function (selector = {}, options = {}) { selector = selector || {} const ssrContext = VueSSR.ssrContext.get() if (ssrContext && !VueSSR.inSubscription.get()) { const collName = this._name // this line is added just to make sure this works CollectionFS if (typeof this._transform === 'function') { options.transform = this._transform } const collection = ssrContext.getCollection(collName) const cursor = collection.find(selector, options) return cursor } return originalFind.call(this, selector, options) } // We must implement this. Otherwise, it'll call the origin prototype's // find method Mongo.Collection.prototype.findOne = function (selector, options) { options = options || {} options.limit = 1 return this.find(selector, options).fetch()[0] } const originalAutorun = Tracker.autorun Tracker.autorun = (fn) => { // if autorun is in the ssrContext, we need fake and run the callback // in the same eventloop if (VueSSR.ssrContext.get()) { const c = { firstRun: true, stop: () => {} } fn(c) return c } return originalAutorun.call(Tracker, fn) } // By default, Meteor[call,apply] also inherit SsrContext // So, they can't access the full MongoDB dataset because of that // Then, we need to remove the SsrContext within Method calls ['call', 'apply'].forEach((methodName) => { const original = Meteor[methodName] Meteor[methodName] = (...args) => { const response = VueSSR.ssrContext.withValue(null, () => { return original.apply(this, args) }) return response } }) // This is not available in the server. But to make it work with SSR // We need to have it. Meteor.loggingIn = () => { return false } }
{ "pile_set_name": "Github" }
import React from 'react'; import classNames from 'classnames/bind'; import TagSelect from '../../../TagSelect'; import styles from './common/Select.test.module.scss'; const cx = classNames.bind(styles); const IsTouchAccessibleTagSelect = () => ( <div className={cx('content-wrapper')}> <TagSelect placeholder="Select a color" id="tag" isTouchAccessible> <TagSelect.Option value="blue" display="Blue" /> <TagSelect.Option value="green" display="Green" /> <TagSelect.Option value="purple" display="Purple" /> <TagSelect.Option value="red" display="Red" /> <TagSelect.Option value="violet" display="Violet" /> </TagSelect> <p>Anim ad nulla est ipsum mollit mollit cillum consectetur.</p> </div> ); export default IsTouchAccessibleTagSelect;
{ "pile_set_name": "Github" }
// Copyright 2015 The Gemmlowp Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // multi_thread_gemv.h: Entry point to the multithreaded version of the // generated (meta) gemv library. #ifndef GEMMLOWP_META_MULTI_THREAD_GEMV_H_ #define GEMMLOWP_META_MULTI_THREAD_GEMV_H_ #ifdef GEMMLOWP_NEON #include "legacy_multi_thread_common.h" #include "legacy_operations_common.h" #include "legacy_single_thread_gemm.h" namespace gemmlowp { namespace meta { namespace internal { class GemvQuantized8BitOperation : public Quantized8BitOperation { public: GemvQuantized8BitOperation(std::int32_t lhs_offset, std::int32_t rhs_offset, std::int32_t sum_offset, std::int32_t multiplier, std::int32_t shift) : Quantized8BitOperation(lhs_offset, rhs_offset, sum_offset, multiplier, shift) {} void ExecuteMatrixMatrix(std::uint8_t* scratch, const std::uint8_t* lhs, const std::uint8_t* rhs, std::int32_t m, std::int32_t n, std::int32_t k, std::uint8_t* result, std::int32_t result_stride) const { gemv_q8(scratch, lhs, rhs, n, k, lhs_offset, rhs_offset, sum_offset, multiplier, shift, result); } static std::int32_t ScratchPerThread(std::int32_t m, std::int32_t n, std::int32_t k) { return 128 * 1024; } }; class GemvFloatOperation : public FloatOperation { public: GemvFloatOperation(std::int32_t lhs_offset, std::int32_t rhs_offset, float result_offset) : FloatOperation(lhs_offset, rhs_offset, result_offset) {} void ExecuteMatrixMatrix(std::uint8_t* scratch, const std::uint8_t* lhs, const std::uint8_t* rhs, std::int32_t m, std::int32_t n, std::int32_t k, float* result, std::int32_t result_stride) const { gemv_f(scratch, lhs, rhs, n, k, lhs_offset, rhs_offset, result_offset, result); } static std::int32_t ScratchPerThread(std::int32_t m, std::int32_t n, std::int32_t k) { return 128 * 1024; } }; class GemvInt32Operation : public Int32Operation { public: GemvInt32Operation(std::int32_t lhs_offset, std::int32_t rhs_offset) : Int32Operation(lhs_offset, rhs_offset) {} void ExecuteMatrixMatrix(std::uint8_t* scratch, const std::uint8_t* lhs, const std::uint8_t* rhs, std::int32_t m, std::int32_t n, std::int32_t k, std::int32_t* result, std::int32_t result_stride) const { gemv_i32(scratch, lhs, rhs, n, k, lhs_offset, rhs_offset, result); } static std::int32_t ScratchPerThread(std::int32_t m, std::int32_t n, std::int32_t k) { return 128 * 1024; } }; } // namespace internal std::int32_t gemv_q8_scratch(std::int32_t m, std::int32_t n, std::int32_t k, std::int32_t max_threads) { return internal::ResolveMaxThreads(max_threads) * internal::GemvQuantized8BitOperation::ScratchPerThread(m, n, k); } void multi_thread_gemv_q8(gemmlowp::WorkersPool* pool, std::int32_t max_threads, std::uint8_t* scratch, const std::uint8_t* lhs, const std::uint8_t* rhs, std::int32_t n, std::int32_t k, std::int32_t lhs_offset, std::int32_t rhs_offset, std::int32_t sum_offset, std::int32_t multiplier, std::int32_t shift, std::uint8_t* result) { max_threads = internal::ResolveMaxThreads(max_threads); internal::GemvQuantized8BitOperation operation(lhs_offset, rhs_offset, sum_offset, multiplier, shift); if (max_threads == 1) { operation.ExecuteMatrixMatrix(scratch, lhs, rhs, 1, n, k, result, n); } else { internal::MultiThreadedMatrixMatrix(pool, max_threads, scratch, lhs, rhs, 1, n, k, result, n, operation); } } std::int32_t gemv_f_scratch(std::int32_t m, std::int32_t n, std::int32_t k, std::int32_t max_threads) { return internal::ResolveMaxThreads(max_threads) * internal::GemvFloatOperation::ScratchPerThread(m, n, k); } void multi_thread_gemv_f(gemmlowp::WorkersPool* pool, std::int32_t max_threads, std::uint8_t* scratch, const std::uint8_t* lhs, const std::uint8_t* rhs, std::int32_t n, std::int32_t k, std::int32_t lhs_offset, std::int32_t rhs_offset, float result_offset, float* result) { max_threads = internal::ResolveMaxThreads(max_threads); internal::GemvFloatOperation operation(lhs_offset, rhs_offset, result_offset); if (max_threads == 1) { operation.ExecuteMatrixMatrix(scratch, lhs, rhs, 1, n, k, result, n); } else { internal::MultiThreadedMatrixMatrix(pool, max_threads, scratch, lhs, rhs, 1, n, k, result, n, operation); } } std::int32_t gemv_i32_scratch(std::int32_t m, std::int32_t n, std::int32_t k, std::int32_t max_threads) { return internal::ResolveMaxThreads(max_threads) * internal::GemvInt32Operation::ScratchPerThread(m, n, k); } void multi_thread_gemv_i32(gemmlowp::WorkersPool* pool, std::int32_t max_threads, std::uint8_t* scratch, const std::uint8_t* lhs, const std::uint8_t* rhs, std::int32_t n, std::int32_t k, std::int32_t lhs_offset, std::int32_t rhs_offset, std::int32_t* result) { max_threads = internal::ResolveMaxThreads(max_threads); internal::GemvInt32Operation operation(lhs_offset, rhs_offset); if (max_threads == 1) { operation.ExecuteMatrixMatrix(scratch, lhs, rhs, 1, n, k, result, n); } else { internal::MultiThreadedMatrixMatrix(pool, max_threads, scratch, lhs, rhs, 1, n, k, result, n, operation); } } } // namespace meta } // namespace gemmlowp #else #warning "Meta gemm fast-path requires GEMMLOWP_NEON_(32|64)!" #endif #endif // GEMMLOWP_META_MULTI_THREAD_GEMV_H_
{ "pile_set_name": "Github" }
/* * Copyright (c) 2007, 2011, 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. * * 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 com.sun.max.vm.monitor; import static com.sun.max.vm.hosted.WithoutAccessCheck.*; import java.util.*; import java.util.concurrent.locks.*; import com.sun.max.annotate.*; @HOSTED_ONLY public final class HostMonitor { private HostMonitor() { } private static final Map<Object, Monitor> monitorMap = new IdentityHashMap<Object, Monitor>(); private static class Monitor extends ReentrantLock { private static final long serialVersionUID = 5639860838632304748L; @Override public boolean isHeldByCurrentThread() { // Thank you java.util.concurrent; we override this method just to get access! return super.isHeldByCurrentThread(); } } private static Monitor getMonitor(Object object) { Monitor lock = monitorMap.get(object); if (lock == null) { lock = new Monitor(); monitorMap.put(object, lock); } return lock; } private static Monitor checkOwner(Monitor monitor) { if (!monitor.isHeldByCurrentThread()) { throw new IllegalMonitorStateException(); } return monitor; } @SuppressWarnings("deprecation") public static void enter(Object object) { if (unsafe != null) { unsafe.monitorEnter(object); } else { getMonitor(object).lock(); } } @SuppressWarnings("deprecation") public static void exit(Object object) { if (unsafe != null) { unsafe.monitorExit(object); } else { checkOwner(getMonitor(object)).unlock(); } } public static void wait(Object object, long timeout) throws InterruptedException { if (unsafe != null) { object.wait(timeout); } else { final Monitor monitor = checkOwner(getMonitor(object)); final int depth = monitor.getHoldCount(); synchronized (monitor) { unlock(monitor, depth); // reuse the java condition variable to implement our condition variable monitor.wait(timeout); } relock(monitor, depth); } } public static void notify(Object object) { if (unsafe != null) { object.notify(); } else { final Monitor monitor = checkOwner(getMonitor(object)); final int depth = monitor.getHoldCount(); synchronized (monitor) { unlock(monitor, depth); monitor.notify(); } relock(monitor, depth); } } public static void notifyAll(Object object) { if (unsafe != null) { object.notifyAll(); } else { final Monitor monitor = checkOwner(getMonitor(object)); final int depth = monitor.getHoldCount(); synchronized (monitor) { unlock(monitor, depth); monitor.notifyAll(); } relock(monitor, depth); } } private static void relock(final Monitor monitor, final int depth) { for (int i = 0; i < depth; i++) { monitor.lock(); } } private static void unlock(final Monitor monitor, final int depth) { for (int i = 0; i < depth; i++) { monitor.unlock(); } } }
{ "pile_set_name": "Github" }
-- tkt2927.test -- -- db eval { -- SELECT abs(a), b FROM t1 -- UNION -- SELECT a, abs(b) FROM t1 -- ORDER BY 1 -- } SELECT abs(a), b FROM t1 UNION SELECT a, abs(b) FROM t1 ORDER BY 1
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.flume.clients.log4jappender; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.Assert; import org.apache.flume.Channel; import org.apache.flume.ChannelSelector; import org.apache.flume.Context; import org.apache.flume.Event; import org.apache.flume.EventDeliveryException; import org.apache.flume.FlumeException; import org.apache.flume.Source; import org.apache.flume.Transaction; import org.apache.flume.channel.ChannelProcessor; import org.apache.flume.channel.MemoryChannel; import org.apache.flume.channel.ReplicatingChannelSelector; import org.apache.flume.conf.Configurables; import org.apache.flume.source.AvroSource; import org.apache.flume.source.avro.AvroFlumeEvent; import org.apache.flume.source.avro.Status; import org.apache.log4j.Level; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.google.common.collect.Lists; public class TestLoadBalancingLog4jAppender{ private final List<CountingAvroSource> sources = Lists.newArrayList(); private Channel ch; private ChannelSelector rcs; private Logger fixture; @Before public void initiate() throws InterruptedException{ ch = new MemoryChannel(); Configurables.configure(ch, new Context()); List<Channel> channels = new ArrayList<Channel>(); channels.add(ch); rcs = new ReplicatingChannelSelector(); rcs.setChannels(channels); } @After public void cleanUp() { for (Source source : sources) { source.stop(); } } @Test public void testLog4jAppenderRoundRobin() throws IOException { int numberOfMsgs = 1000; int expectedPerSource = 500; File TESTFILE = new File(TestLoadBalancingLog4jAppender.class .getClassLoader() .getResource("flume-loadbalancinglog4jtest.properties").getFile()); startSources(TESTFILE, new int[] { 25430, 25431 }); sendAndAssertMessages(numberOfMsgs); for (CountingAvroSource source : sources) { Assert.assertEquals(expectedPerSource, source.appendCount.get()); } } @Test public void testLog4jAppenderRandom() throws IOException { int numberOfMsgs = 1000; File TESTFILE = new File(TestLoadBalancingLog4jAppender.class .getClassLoader() .getResource("flume-loadbalancing-rnd-log4jtest.properties").getFile()); startSources(TESTFILE, new int[] { 25430, 25431, 25432, 25433, 25434, 25435, 25436, 25437, 25438, 25439 }); sendAndAssertMessages(numberOfMsgs); int total = 0; Set<Integer> counts = new HashSet<Integer>(); for (CountingAvroSource source : sources) { total += source.appendCount.intValue(); counts.add(source.appendCount.intValue()); } // We are not testing distribution this is tested in the client Assert.assertTrue("Very unusual distribution " + counts.size(), counts.size() > 2); Assert.assertTrue("Missing events", total == numberOfMsgs); } @Test public void testRandomBackoff() throws Exception { File TESTFILE = new File(TestLoadBalancingLog4jAppender.class .getClassLoader() .getResource("flume-loadbalancing-backoff-log4jtest.properties") .getFile()); startSources(TESTFILE, new int[] { 25430, 25431, 25432 }); sources.get(0).setFail(); sources.get(2).setFail(); sendAndAssertMessages(50); Assert.assertEquals(50, sources.get(1).appendCount.intValue()); Assert.assertEquals(0, sources.get(0).appendCount.intValue()); Assert.assertEquals(0, sources.get(2).appendCount.intValue()); sources.get(0).setOk(); sources.get(1).setFail(); // s0 should still be backed off try { send(1); // nothing should be able to process right now Assert.fail("Expected EventDeliveryException"); } catch (FlumeException e) { Assert.assertTrue(e.getCause() instanceof EventDeliveryException); } Thread.sleep(2500); // wait for s0 to no longer be backed off sendAndAssertMessages(50); Assert.assertEquals(50, sources.get(0).appendCount.intValue()); Assert.assertEquals(50, sources.get(1).appendCount.intValue()); Assert.assertEquals(0, sources.get(2).appendCount.intValue()); } private void send(int numberOfMsgs) throws EventDeliveryException { for (int count = 0; count < numberOfMsgs; count++) { int level = count % 5; String msg = "This is log message number" + String.valueOf(count); fixture.log(Level.toLevel(level), msg); } } private void sendAndAssertMessages(int numberOfMsgs) throws IOException { for (int count = 0; count < numberOfMsgs; count++) { int level = count % 5; String msg = "This is log message number" + String.valueOf(count); fixture.log(Level.toLevel(level), msg); Transaction transaction = ch.getTransaction(); transaction.begin(); Event event = ch.take(); Assert.assertNotNull(event); Assert.assertEquals(new String(event.getBody(), "UTF8"), msg); Map<String, String> hdrs = event.getHeaders(); Assert.assertNotNull(hdrs.get(Log4jAvroHeaders.TIMESTAMP.toString())); Assert.assertEquals(Level.toLevel(level), Level.toLevel(hdrs.get(Log4jAvroHeaders.LOG_LEVEL.toString()))); Assert.assertEquals(fixture.getName(), hdrs.get(Log4jAvroHeaders.LOGGER_NAME.toString())); Assert.assertEquals("UTF8", hdrs.get(Log4jAvroHeaders.MESSAGE_ENCODING.toString())); // To confirm on console we actually got the body System.out.println("Got body: " + new String(event.getBody(), "UTF8")); transaction.commit(); transaction.close(); } } private void startSources(File log4jProps, int... ports) throws IOException { for (int port : ports) { CountingAvroSource source = new CountingAvroSource(port); Context context = new Context(); context.put("port", String.valueOf(port)); context.put("bind", "0.0.0.0"); Configurables.configure(source, context); sources.add(source); source.setChannelProcessor(new ChannelProcessor(rcs)); } for (Source source : sources) { source.start(); } // The properties file having Avro port info should be loaded only // after the test begins, else log4j tries to connect to the source // before the source has started up in the above function, since // log4j setup is completed before the @Before calls also. // This will cause the test to fail even before it starts! FileReader reader = new FileReader(log4jProps); Properties props = new Properties(); props.load(reader); PropertyConfigurator.configure(props); fixture = LogManager.getLogger(TestLoadBalancingLog4jAppender.class); } static class CountingAvroSource extends AvroSource { AtomicInteger appendCount = new AtomicInteger(); volatile boolean isFail = false; private final int port2; public CountingAvroSource(int port) { port2 = port; } public void setOk() { this.isFail = false; } public void setFail() { this.isFail = true; } @Override public String getName() { return "testing..." + port2; } @Override public Status append(AvroFlumeEvent avroEvent) { if (isFail) { return Status.FAILED; } appendCount.incrementAndGet(); return super.append(avroEvent); } @Override public Status appendBatch(List<AvroFlumeEvent> events) { if (isFail) { return Status.FAILED; } appendCount.addAndGet(events.size()); return super.appendBatch(events); } } }
{ "pile_set_name": "Github" }
package headfirst.designpatterns.combined.djview; import com.sun.net.httpserver.HttpServer; import java.net.InetSocketAddress; public class DJViewHttpServer { public static void main(String[] args) { try { System.out.println("DJView Http Server Running"); BeatModel beatModel = new BeatModel(); beatModel.initialize(); // create a server on port 8080, with a backlog queue allowed of size 0 (ie, no queue) // most people will already have a web server running on 80, so we're using 8080 HttpServer server = HttpServer.create(new InetSocketAddress("localhost", 8080), 0); server.createContext("/djview", new DJViewHttpHandler(beatModel)); server.start(); System.out.println("DJView Server is running at http://localhost:8080/djview"); } catch (Exception e) { e.printStackTrace(); } } }
{ "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 grpc import ( "bytes" "errors" "fmt" "io" "net" "net/http" "reflect" "runtime" "strings" "sync" "time" "golang.org/x/net/context" "golang.org/x/net/http2" "golang.org/x/net/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" "google.golang.org/grpc/tap" "google.golang.org/grpc/transport" ) const ( defaultServerMaxReceiveMessageSize = 1024 * 1024 * 4 defaultServerMaxSendMessageSize = 1024 * 1024 * 4 ) type methodHandler func(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor UnaryServerInterceptor) (interface{}, error) // MethodDesc represents an RPC service's method specification. type MethodDesc struct { MethodName string Handler methodHandler } // ServiceDesc represents an RPC service's specification. type ServiceDesc struct { ServiceName string // The pointer to the service interface. Used to check whether the user // provided implementation satisfies the interface requirements. HandlerType interface{} Methods []MethodDesc Streams []StreamDesc Metadata interface{} } // service consists of the information of the server serving this service and // the methods in this service. type service struct { server interface{} // the server for service methods md map[string]*MethodDesc sd map[string]*StreamDesc mdata interface{} } // Server is a gRPC server to serve RPC requests. type Server struct { opts options mu sync.Mutex // guards following lis map[net.Listener]bool conns map[io.Closer]bool serve bool drain bool ctx context.Context cancel context.CancelFunc // A CondVar to let GracefulStop() blocks until all the pending RPCs are finished // and all the transport goes away. cv *sync.Cond m map[string]*service // service name -> service info events trace.EventLog } type options struct { creds credentials.TransportCredentials codec Codec cp Compressor dc Decompressor unaryInt UnaryServerInterceptor streamInt StreamServerInterceptor inTapHandle tap.ServerInHandle statsHandler stats.Handler maxConcurrentStreams uint32 maxReceiveMessageSize int maxSendMessageSize int useHandlerImpl bool // use http.Handler-based server unknownStreamDesc *StreamDesc keepaliveParams keepalive.ServerParameters keepalivePolicy keepalive.EnforcementPolicy initialWindowSize int32 initialConnWindowSize int32 } var defaultServerOptions = options{ maxReceiveMessageSize: defaultServerMaxReceiveMessageSize, maxSendMessageSize: defaultServerMaxSendMessageSize, } // A ServerOption sets options such as credentials, codec and keepalive parameters, etc. type ServerOption func(*options) // InitialWindowSize returns a ServerOption that sets window size for stream. // The lower bound for window size is 64K and any value smaller than that will be ignored. func InitialWindowSize(s int32) ServerOption { return func(o *options) { o.initialWindowSize = s } } // InitialConnWindowSize returns a ServerOption that sets window size for a connection. // The lower bound for window size is 64K and any value smaller than that will be ignored. func InitialConnWindowSize(s int32) ServerOption { return func(o *options) { o.initialConnWindowSize = s } } // KeepaliveParams returns a ServerOption that sets keepalive and max-age parameters for the server. func KeepaliveParams(kp keepalive.ServerParameters) ServerOption { return func(o *options) { o.keepaliveParams = kp } } // KeepaliveEnforcementPolicy returns a ServerOption that sets keepalive enforcement policy for the server. func KeepaliveEnforcementPolicy(kep keepalive.EnforcementPolicy) ServerOption { return func(o *options) { o.keepalivePolicy = kep } } // CustomCodec returns a ServerOption that sets a codec for message marshaling and unmarshaling. func CustomCodec(codec Codec) ServerOption { return func(o *options) { o.codec = codec } } // RPCCompressor returns a ServerOption that sets a compressor for outbound messages. func RPCCompressor(cp Compressor) ServerOption { return func(o *options) { o.cp = cp } } // RPCDecompressor returns a ServerOption that sets a decompressor for inbound messages. func RPCDecompressor(dc Decompressor) ServerOption { return func(o *options) { o.dc = dc } } // MaxMsgSize returns a ServerOption to set the max message size in bytes the server can receive. // If this is not set, gRPC uses the default limit. Deprecated: use MaxRecvMsgSize instead. func MaxMsgSize(m int) ServerOption { return MaxRecvMsgSize(m) } // MaxRecvMsgSize returns a ServerOption to set the max message size in bytes the server can receive. // If this is not set, gRPC uses the default 4MB. func MaxRecvMsgSize(m int) ServerOption { return func(o *options) { o.maxReceiveMessageSize = m } } // MaxSendMsgSize returns a ServerOption to set the max message size in bytes the server can send. // If this is not set, gRPC uses the default 4MB. func MaxSendMsgSize(m int) ServerOption { return func(o *options) { o.maxSendMessageSize = m } } // MaxConcurrentStreams returns a ServerOption that will apply a limit on the number // of concurrent streams to each ServerTransport. func MaxConcurrentStreams(n uint32) ServerOption { return func(o *options) { o.maxConcurrentStreams = n } } // Creds returns a ServerOption that sets credentials for server connections. func Creds(c credentials.TransportCredentials) ServerOption { return func(o *options) { o.creds = c } } // UnaryInterceptor returns a ServerOption that sets the UnaryServerInterceptor for the // server. Only one unary interceptor can be installed. The construction of multiple // interceptors (e.g., chaining) can be implemented at the caller. func UnaryInterceptor(i UnaryServerInterceptor) ServerOption { return func(o *options) { if o.unaryInt != nil { panic("The unary server interceptor was already set and may not be reset.") } o.unaryInt = i } } // StreamInterceptor returns a ServerOption that sets the StreamServerInterceptor for the // server. Only one stream interceptor can be installed. func StreamInterceptor(i StreamServerInterceptor) ServerOption { return func(o *options) { if o.streamInt != nil { panic("The stream server interceptor was already set and may not be reset.") } o.streamInt = i } } // InTapHandle returns a ServerOption that sets the tap handle for all the server // transport to be created. Only one can be installed. func InTapHandle(h tap.ServerInHandle) ServerOption { return func(o *options) { if o.inTapHandle != nil { panic("The tap handle was already set and may not be reset.") } o.inTapHandle = h } } // StatsHandler returns a ServerOption that sets the stats handler for the server. func StatsHandler(h stats.Handler) ServerOption { return func(o *options) { o.statsHandler = h } } // UnknownServiceHandler returns a ServerOption that allows for adding a custom // unknown service handler. The provided method is a bidi-streaming RPC service // handler that will be invoked instead of returning the "unimplemented" gRPC // error whenever a request is received for an unregistered service or method. // The handling function has full access to the Context of the request and the // stream, and the invocation passes through interceptors. func UnknownServiceHandler(streamHandler StreamHandler) ServerOption { return func(o *options) { o.unknownStreamDesc = &StreamDesc{ StreamName: "unknown_service_handler", Handler: streamHandler, // We need to assume that the users of the streamHandler will want to use both. ClientStreams: true, ServerStreams: true, } } } // NewServer creates a gRPC server which has no service registered and has not // started to accept requests yet. func NewServer(opt ...ServerOption) *Server { opts := defaultServerOptions for _, o := range opt { o(&opts) } if opts.codec == nil { // Set the default codec. opts.codec = protoCodec{} } s := &Server{ lis: make(map[net.Listener]bool), opts: opts, conns: make(map[io.Closer]bool), m: make(map[string]*service), } s.cv = sync.NewCond(&s.mu) s.ctx, s.cancel = context.WithCancel(context.Background()) if EnableTracing { _, file, line, _ := runtime.Caller(1) s.events = trace.NewEventLog("grpc.Server", fmt.Sprintf("%s:%d", file, line)) } return s } // printf records an event in s's event log, unless s has been stopped. // REQUIRES s.mu is held. func (s *Server) printf(format string, a ...interface{}) { if s.events != nil { s.events.Printf(format, a...) } } // errorf records an error in s's event log, unless s has been stopped. // REQUIRES s.mu is held. func (s *Server) errorf(format string, a ...interface{}) { if s.events != nil { s.events.Errorf(format, a...) } } // RegisterService registers a service and its implementation to the gRPC // server. It is called from the IDL generated code. This must be called before // invoking Serve. func (s *Server) RegisterService(sd *ServiceDesc, ss interface{}) { ht := reflect.TypeOf(sd.HandlerType).Elem() st := reflect.TypeOf(ss) if !st.Implements(ht) { grpclog.Fatalf("grpc: Server.RegisterService found the handler of type %v that does not satisfy %v", st, ht) } s.register(sd, ss) } func (s *Server) register(sd *ServiceDesc, ss interface{}) { s.mu.Lock() defer s.mu.Unlock() s.printf("RegisterService(%q)", sd.ServiceName) if s.serve { grpclog.Fatalf("grpc: Server.RegisterService after Server.Serve for %q", sd.ServiceName) } if _, ok := s.m[sd.ServiceName]; ok { grpclog.Fatalf("grpc: Server.RegisterService found duplicate service registration for %q", sd.ServiceName) } srv := &service{ server: ss, md: make(map[string]*MethodDesc), sd: make(map[string]*StreamDesc), mdata: sd.Metadata, } for i := range sd.Methods { d := &sd.Methods[i] srv.md[d.MethodName] = d } for i := range sd.Streams { d := &sd.Streams[i] srv.sd[d.StreamName] = d } s.m[sd.ServiceName] = srv } // MethodInfo contains the information of an RPC including its method name and type. type MethodInfo struct { // Name is the method name only, without the service name or package name. Name string // IsClientStream indicates whether the RPC is a client streaming RPC. IsClientStream bool // IsServerStream indicates whether the RPC is a server streaming RPC. IsServerStream bool } // ServiceInfo contains unary RPC method info, streaming RPC method info and metadata for a service. type ServiceInfo struct { Methods []MethodInfo // Metadata is the metadata specified in ServiceDesc when registering service. Metadata interface{} } // GetServiceInfo returns a map from service names to ServiceInfo. // Service names include the package names, in the form of <package>.<service>. func (s *Server) GetServiceInfo() map[string]ServiceInfo { ret := make(map[string]ServiceInfo) for n, srv := range s.m { methods := make([]MethodInfo, 0, len(srv.md)+len(srv.sd)) for m := range srv.md { methods = append(methods, MethodInfo{ Name: m, IsClientStream: false, IsServerStream: false, }) } for m, d := range srv.sd { methods = append(methods, MethodInfo{ Name: m, IsClientStream: d.ClientStreams, IsServerStream: d.ServerStreams, }) } ret[n] = ServiceInfo{ Methods: methods, Metadata: srv.mdata, } } return ret } var ( // ErrServerStopped indicates that the operation is now illegal because of // the server being stopped. ErrServerStopped = errors.New("grpc: the server has been stopped") ) func (s *Server) useTransportAuthenticator(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { if s.opts.creds == nil { return rawConn, nil, nil } return s.opts.creds.ServerHandshake(rawConn) } // Serve accepts incoming connections on the listener lis, creating a new // ServerTransport and service goroutine for each. The service goroutines // read gRPC requests and then call the registered handlers to reply to them. // Serve returns when lis.Accept fails with fatal errors. lis will be closed when // this method returns. // Serve always returns non-nil error. func (s *Server) Serve(lis net.Listener) error { s.mu.Lock() s.printf("serving") s.serve = true if s.lis == nil { s.mu.Unlock() lis.Close() return ErrServerStopped } s.lis[lis] = true s.mu.Unlock() defer func() { s.mu.Lock() if s.lis != nil && s.lis[lis] { lis.Close() delete(s.lis, lis) } s.mu.Unlock() }() var tempDelay time.Duration // how long to sleep on accept failure for { rawConn, err := lis.Accept() if err != nil { if ne, ok := err.(interface { Temporary() bool }); ok && ne.Temporary() { if tempDelay == 0 { tempDelay = 5 * time.Millisecond } else { tempDelay *= 2 } if max := 1 * time.Second; tempDelay > max { tempDelay = max } s.mu.Lock() s.printf("Accept error: %v; retrying in %v", err, tempDelay) s.mu.Unlock() timer := time.NewTimer(tempDelay) select { case <-timer.C: case <-s.ctx.Done(): } timer.Stop() continue } s.mu.Lock() s.printf("done serving; Accept = %v", err) s.mu.Unlock() return err } tempDelay = 0 // Start a new goroutine to deal with rawConn // so we don't stall this Accept loop goroutine. go s.handleRawConn(rawConn) } } // handleRawConn is run in its own goroutine and handles a just-accepted // connection that has not had any I/O performed on it yet. func (s *Server) handleRawConn(rawConn net.Conn) { conn, authInfo, err := s.useTransportAuthenticator(rawConn) if err != nil { s.mu.Lock() s.errorf("ServerHandshake(%q) failed: %v", rawConn.RemoteAddr(), err) s.mu.Unlock() grpclog.Printf("grpc: Server.Serve failed to complete security handshake from %q: %v", rawConn.RemoteAddr(), err) // If serverHandShake returns ErrConnDispatched, keep rawConn open. if err != credentials.ErrConnDispatched { rawConn.Close() } return } s.mu.Lock() if s.conns == nil { s.mu.Unlock() conn.Close() return } s.mu.Unlock() if s.opts.useHandlerImpl { s.serveUsingHandler(conn) } else { s.serveHTTP2Transport(conn, authInfo) } } // serveHTTP2Transport sets up a http/2 transport (using the // gRPC http2 server transport in transport/http2_server.go) and // serves streams on it. // This is run in its own goroutine (it does network I/O in // transport.NewServerTransport). func (s *Server) serveHTTP2Transport(c net.Conn, authInfo credentials.AuthInfo) { config := &transport.ServerConfig{ MaxStreams: s.opts.maxConcurrentStreams, AuthInfo: authInfo, InTapHandle: s.opts.inTapHandle, StatsHandler: s.opts.statsHandler, KeepaliveParams: s.opts.keepaliveParams, KeepalivePolicy: s.opts.keepalivePolicy, InitialWindowSize: s.opts.initialWindowSize, InitialConnWindowSize: s.opts.initialConnWindowSize, } st, err := transport.NewServerTransport("http2", c, config) if err != nil { s.mu.Lock() s.errorf("NewServerTransport(%q) failed: %v", c.RemoteAddr(), err) s.mu.Unlock() c.Close() grpclog.Println("grpc: Server.Serve failed to create ServerTransport: ", err) return } if !s.addConn(st) { st.Close() return } s.serveStreams(st) } func (s *Server) serveStreams(st transport.ServerTransport) { defer s.removeConn(st) defer st.Close() var wg sync.WaitGroup st.HandleStreams(func(stream *transport.Stream) { wg.Add(1) go func() { defer wg.Done() s.handleStream(st, stream, s.traceInfo(st, stream)) }() }, func(ctx context.Context, method string) context.Context { if !EnableTracing { return ctx } tr := trace.New("grpc.Recv."+methodFamily(method), method) return trace.NewContext(ctx, tr) }) wg.Wait() } var _ http.Handler = (*Server)(nil) // serveUsingHandler is called from handleRawConn when s is configured // to handle requests via the http.Handler interface. It sets up a // net/http.Server to handle the just-accepted conn. The http.Server // is configured to route all incoming requests (all HTTP/2 streams) // to ServeHTTP, which creates a new ServerTransport for each stream. // serveUsingHandler blocks until conn closes. // // This codepath is only used when Server.TestingUseHandlerImpl has // been configured. This lets the end2end tests exercise the ServeHTTP // method as one of the environment types. // // conn is the *tls.Conn that's already been authenticated. func (s *Server) serveUsingHandler(conn net.Conn) { if !s.addConn(conn) { conn.Close() return } defer s.removeConn(conn) h2s := &http2.Server{ MaxConcurrentStreams: s.opts.maxConcurrentStreams, } h2s.ServeConn(conn, &http2.ServeConnOpts{ Handler: s, }) } func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { st, err := transport.NewServerHandlerTransport(w, r) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } if !s.addConn(st) { st.Close() return } defer s.removeConn(st) s.serveStreams(st) } // traceInfo returns a traceInfo and associates it with stream, if tracing is enabled. // If tracing is not enabled, it returns nil. func (s *Server) traceInfo(st transport.ServerTransport, stream *transport.Stream) (trInfo *traceInfo) { tr, ok := trace.FromContext(stream.Context()) if !ok { return nil } trInfo = &traceInfo{ tr: tr, } trInfo.firstLine.client = false trInfo.firstLine.remoteAddr = st.RemoteAddr() if dl, ok := stream.Context().Deadline(); ok { trInfo.firstLine.deadline = dl.Sub(time.Now()) } return trInfo } func (s *Server) addConn(c io.Closer) bool { s.mu.Lock() defer s.mu.Unlock() if s.conns == nil || s.drain { return false } s.conns[c] = true return true } func (s *Server) removeConn(c io.Closer) { s.mu.Lock() defer s.mu.Unlock() if s.conns != nil { delete(s.conns, c) s.cv.Broadcast() } } func (s *Server) sendResponse(t transport.ServerTransport, stream *transport.Stream, msg interface{}, cp Compressor, opts *transport.Options) error { var ( cbuf *bytes.Buffer outPayload *stats.OutPayload ) if cp != nil { cbuf = new(bytes.Buffer) } if s.opts.statsHandler != nil { outPayload = &stats.OutPayload{} } p, err := encode(s.opts.codec, msg, cp, cbuf, outPayload) if err != nil { grpclog.Println("grpc: server failed to encode response: ", err) return err } if len(p) > s.opts.maxSendMessageSize { return status.Errorf(codes.ResourceExhausted, "grpc: trying to send message larger than max (%d vs. %d)", len(p), s.opts.maxSendMessageSize) } err = t.Write(stream, p, opts) if err == nil && outPayload != nil { outPayload.SentTime = time.Now() s.opts.statsHandler.HandleRPC(stream.Context(), outPayload) } return err } func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, md *MethodDesc, trInfo *traceInfo) (err error) { sh := s.opts.statsHandler if sh != nil { begin := &stats.Begin{ BeginTime: time.Now(), } sh.HandleRPC(stream.Context(), begin) defer func() { end := &stats.End{ EndTime: time.Now(), } if err != nil && err != io.EOF { end.Error = toRPCErr(err) } sh.HandleRPC(stream.Context(), end) }() } if trInfo != nil { defer trInfo.tr.Finish() trInfo.firstLine.client = false trInfo.tr.LazyLog(&trInfo.firstLine, false) defer func() { if err != nil && err != io.EOF { trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) trInfo.tr.SetError() } }() } if s.opts.cp != nil { // NOTE: this needs to be ahead of all handling, https://github.com/grpc/grpc-go/issues/686. stream.SetSendCompress(s.opts.cp.Type()) } p := &parser{r: stream} pf, req, err := p.recvMsg(s.opts.maxReceiveMessageSize) if err == io.EOF { // The entire stream is done (for unary RPC only). return err } if err == io.ErrUnexpectedEOF { err = Errorf(codes.Internal, io.ErrUnexpectedEOF.Error()) } if err != nil { if st, ok := status.FromError(err); ok { if e := t.WriteStatus(stream, st); e != nil { grpclog.Printf("grpc: Server.processUnaryRPC failed to write status %v", e) } } else { switch st := err.(type) { case transport.ConnectionError: // Nothing to do here. case transport.StreamError: if e := t.WriteStatus(stream, status.New(st.Code, st.Desc)); e != nil { grpclog.Printf("grpc: Server.processUnaryRPC failed to write status %v", e) } default: panic(fmt.Sprintf("grpc: Unexpected error (%T) from recvMsg: %v", st, st)) } } return err } if err := checkRecvPayload(pf, stream.RecvCompress(), s.opts.dc); err != nil { if st, ok := status.FromError(err); ok { if e := t.WriteStatus(stream, st); e != nil { grpclog.Printf("grpc: Server.processUnaryRPC failed to write status %v", e) } return err } if e := t.WriteStatus(stream, status.New(codes.Internal, err.Error())); e != nil { grpclog.Printf("grpc: Server.processUnaryRPC failed to write status %v", e) } // TODO checkRecvPayload always return RPC error. Add a return here if necessary. } var inPayload *stats.InPayload if sh != nil { inPayload = &stats.InPayload{ RecvTime: time.Now(), } } df := func(v interface{}) error { if inPayload != nil { inPayload.WireLength = len(req) } if pf == compressionMade { var err error req, err = s.opts.dc.Do(bytes.NewReader(req)) if err != nil { return Errorf(codes.Internal, err.Error()) } } if len(req) > s.opts.maxReceiveMessageSize { // TODO: Revisit the error code. Currently keep it consistent with // java implementation. return status.Errorf(codes.ResourceExhausted, "grpc: received message larger than max (%d vs. %d)", len(req), s.opts.maxReceiveMessageSize) } if err := s.opts.codec.Unmarshal(req, v); err != nil { return status.Errorf(codes.Internal, "grpc: error unmarshalling request: %v", err) } if inPayload != nil { inPayload.Payload = v inPayload.Data = req inPayload.Length = len(req) sh.HandleRPC(stream.Context(), inPayload) } if trInfo != nil { trInfo.tr.LazyLog(&payload{sent: false, msg: v}, true) } return nil } reply, appErr := md.Handler(srv.server, stream.Context(), df, s.opts.unaryInt) if appErr != nil { appStatus, ok := status.FromError(appErr) if !ok { // Convert appErr if it is not a grpc status error. appErr = status.Error(convertCode(appErr), appErr.Error()) appStatus, _ = status.FromError(appErr) } if trInfo != nil { trInfo.tr.LazyLog(stringer(appStatus.Message()), true) trInfo.tr.SetError() } if e := t.WriteStatus(stream, appStatus); e != nil { grpclog.Printf("grpc: Server.processUnaryRPC failed to write status: %v", e) } return appErr } if trInfo != nil { trInfo.tr.LazyLog(stringer("OK"), false) } opts := &transport.Options{ Last: true, Delay: false, } if err := s.sendResponse(t, stream, reply, s.opts.cp, opts); err != nil { if err == io.EOF { // The entire stream is done (for unary RPC only). return err } if s, ok := status.FromError(err); ok { if e := t.WriteStatus(stream, s); e != nil { grpclog.Printf("grpc: Server.processUnaryRPC failed to write status: %v", e) } } else { switch st := err.(type) { case transport.ConnectionError: // Nothing to do here. case transport.StreamError: if e := t.WriteStatus(stream, status.New(st.Code, st.Desc)); e != nil { grpclog.Printf("grpc: Server.processUnaryRPC failed to write status %v", e) } default: panic(fmt.Sprintf("grpc: Unexpected error (%T) from sendResponse: %v", st, st)) } } return err } if trInfo != nil { trInfo.tr.LazyLog(&payload{sent: true, msg: reply}, true) } // TODO: Should we be logging if writing status failed here, like above? // Should the logging be in WriteStatus? Should we ignore the WriteStatus // error or allow the stats handler to see it? return t.WriteStatus(stream, status.New(codes.OK, "")) } func (s *Server) processStreamingRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, sd *StreamDesc, trInfo *traceInfo) (err error) { sh := s.opts.statsHandler if sh != nil { begin := &stats.Begin{ BeginTime: time.Now(), } sh.HandleRPC(stream.Context(), begin) defer func() { end := &stats.End{ EndTime: time.Now(), } if err != nil && err != io.EOF { end.Error = toRPCErr(err) } sh.HandleRPC(stream.Context(), end) }() } if s.opts.cp != nil { stream.SetSendCompress(s.opts.cp.Type()) } ss := &serverStream{ t: t, s: stream, p: &parser{r: stream}, codec: s.opts.codec, cp: s.opts.cp, dc: s.opts.dc, maxReceiveMessageSize: s.opts.maxReceiveMessageSize, maxSendMessageSize: s.opts.maxSendMessageSize, trInfo: trInfo, statsHandler: sh, } if ss.cp != nil { ss.cbuf = new(bytes.Buffer) } if trInfo != nil { trInfo.tr.LazyLog(&trInfo.firstLine, false) defer func() { ss.mu.Lock() if err != nil && err != io.EOF { ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) ss.trInfo.tr.SetError() } ss.trInfo.tr.Finish() ss.trInfo.tr = nil ss.mu.Unlock() }() } var appErr error var server interface{} if srv != nil { server = srv.server } if s.opts.streamInt == nil { appErr = sd.Handler(server, ss) } else { info := &StreamServerInfo{ FullMethod: stream.Method(), IsClientStream: sd.ClientStreams, IsServerStream: sd.ServerStreams, } appErr = s.opts.streamInt(server, ss, info, sd.Handler) } if appErr != nil { appStatus, ok := status.FromError(appErr) if !ok { switch err := appErr.(type) { case transport.StreamError: appStatus = status.New(err.Code, err.Desc) default: appStatus = status.New(convertCode(appErr), appErr.Error()) } appErr = appStatus.Err() } if trInfo != nil { ss.mu.Lock() ss.trInfo.tr.LazyLog(stringer(appStatus.Message()), true) ss.trInfo.tr.SetError() ss.mu.Unlock() } t.WriteStatus(ss.s, appStatus) // TODO: Should we log an error from WriteStatus here and below? return appErr } if trInfo != nil { ss.mu.Lock() ss.trInfo.tr.LazyLog(stringer("OK"), false) ss.mu.Unlock() } return t.WriteStatus(ss.s, status.New(codes.OK, "")) } func (s *Server) handleStream(t transport.ServerTransport, stream *transport.Stream, trInfo *traceInfo) { sm := stream.Method() if sm != "" && sm[0] == '/' { sm = sm[1:] } pos := strings.LastIndex(sm, "/") if pos == -1 { if trInfo != nil { trInfo.tr.LazyLog(&fmtStringer{"Malformed method name %q", []interface{}{sm}}, true) trInfo.tr.SetError() } errDesc := fmt.Sprintf("malformed method name: %q", stream.Method()) if err := t.WriteStatus(stream, status.New(codes.ResourceExhausted, errDesc)); err != nil { if trInfo != nil { trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) trInfo.tr.SetError() } grpclog.Printf("grpc: Server.handleStream failed to write status: %v", err) } if trInfo != nil { trInfo.tr.Finish() } return } service := sm[:pos] method := sm[pos+1:] srv, ok := s.m[service] if !ok { if unknownDesc := s.opts.unknownStreamDesc; unknownDesc != nil { s.processStreamingRPC(t, stream, nil, unknownDesc, trInfo) return } if trInfo != nil { trInfo.tr.LazyLog(&fmtStringer{"Unknown service %v", []interface{}{service}}, true) trInfo.tr.SetError() } errDesc := fmt.Sprintf("unknown service %v", service) if err := t.WriteStatus(stream, status.New(codes.Unimplemented, errDesc)); err != nil { if trInfo != nil { trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) trInfo.tr.SetError() } grpclog.Printf("grpc: Server.handleStream failed to write status: %v", err) } if trInfo != nil { trInfo.tr.Finish() } return } // Unary RPC or Streaming RPC? if md, ok := srv.md[method]; ok { s.processUnaryRPC(t, stream, srv, md, trInfo) return } if sd, ok := srv.sd[method]; ok { s.processStreamingRPC(t, stream, srv, sd, trInfo) return } if trInfo != nil { trInfo.tr.LazyLog(&fmtStringer{"Unknown method %v", []interface{}{method}}, true) trInfo.tr.SetError() } if unknownDesc := s.opts.unknownStreamDesc; unknownDesc != nil { s.processStreamingRPC(t, stream, nil, unknownDesc, trInfo) return } errDesc := fmt.Sprintf("unknown method %v", method) if err := t.WriteStatus(stream, status.New(codes.Unimplemented, errDesc)); err != nil { if trInfo != nil { trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) trInfo.tr.SetError() } grpclog.Printf("grpc: Server.handleStream failed to write status: %v", err) } if trInfo != nil { trInfo.tr.Finish() } } // Stop stops the gRPC server. It immediately closes all open // connections and listeners. // It cancels all active RPCs on the server side and the corresponding // pending RPCs on the client side will get notified by connection // errors. func (s *Server) Stop() { s.mu.Lock() listeners := s.lis s.lis = nil st := s.conns s.conns = nil // interrupt GracefulStop if Stop and GracefulStop are called concurrently. s.cv.Broadcast() s.mu.Unlock() for lis := range listeners { lis.Close() } for c := range st { c.Close() } s.mu.Lock() s.cancel() if s.events != nil { s.events.Finish() s.events = nil } s.mu.Unlock() } // GracefulStop stops the gRPC server gracefully. It stops the server from // accepting new connections and RPCs and blocks until all the pending RPCs are // finished. func (s *Server) GracefulStop() { s.mu.Lock() defer s.mu.Unlock() if s.conns == nil { return } for lis := range s.lis { lis.Close() } s.lis = nil s.cancel() if !s.drain { for c := range s.conns { c.(transport.ServerTransport).Drain() } s.drain = true } for len(s.conns) != 0 { s.cv.Wait() } s.conns = nil if s.events != nil { s.events.Finish() s.events = nil } } func init() { internal.TestingCloseConns = func(arg interface{}) { arg.(*Server).testingCloseConns() } internal.TestingUseHandlerImpl = func(arg interface{}) { arg.(*Server).opts.useHandlerImpl = true } } // testingCloseConns closes all existing transports but keeps s.lis // accepting new connections. func (s *Server) testingCloseConns() { s.mu.Lock() for c := range s.conns { c.Close() delete(s.conns, c) } s.mu.Unlock() } // SetHeader sets the header metadata. // When called multiple times, all the provided metadata will be merged. // All the metadata will be sent out when one of the following happens: // - grpc.SendHeader() is called; // - The first response is sent out; // - An RPC status is sent out (error or success). func SetHeader(ctx context.Context, md metadata.MD) error { if md.Len() == 0 { return nil } stream, ok := transport.StreamFromContext(ctx) if !ok { return Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) } return stream.SetHeader(md) } // SendHeader sends header metadata. It may be called at most once. // The provided md and headers set by SetHeader() will be sent. func SendHeader(ctx context.Context, md metadata.MD) error { stream, ok := transport.StreamFromContext(ctx) if !ok { return Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) } t := stream.ServerTransport() if t == nil { grpclog.Fatalf("grpc: SendHeader: %v has no ServerTransport to send header metadata.", stream) } if err := t.WriteHeader(stream, md); err != nil { return toRPCErr(err) } return nil } // SetTrailer sets the trailer metadata that will be sent when an RPC returns. // When called more than once, all the provided metadata will be merged. func SetTrailer(ctx context.Context, md metadata.MD) error { if md.Len() == 0 { return nil } stream, ok := transport.StreamFromContext(ctx) if !ok { return Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) } return stream.SetTrailer(md) }
{ "pile_set_name": "Github" }
# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) > Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) ## Install ``` $ npm install --save strip-ansi ``` ## Usage ```js var stripAnsi = require('strip-ansi'); stripAnsi('\u001b[4mcake\u001b[0m'); //=> 'cake' ``` ## Related - [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module - [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes - [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right ## License MIT © [Sindre Sorhus](http://sindresorhus.com)
{ "pile_set_name": "Github" }
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * Screen shot take from app * @module lib/scripts/utils/screenshot */ // absolute imports /** * Class Screenshot to take screen copy * @class Screenshot */ export default class Screenshot { /** * Convert string into byte array */ static bytesFromBase64(str) { const binary = window.atob(str); const bytes = new Uint8Array(binary.length); for (let i = 0; i < bytes.length; ++i) { bytes[i] = binary[i].charCodeAt(0); } return bytes.buffer; } /** * Encode byte buffer into base64 */ static bytesToBase64(buffer) { const bytes = new Uint8Array(buffer); let binary = ''; for (let i = 0; i < bytes.byteLength; i++) { binary += String.fromCharCode(bytes[i]); } return window.btoa(binary); } /** * Convert data URI to blob (for further save) */ static dataUriToBlob(uri) { const parts = uri.split(/[:;,]/); const partsCount = parts.length; const MAX_PARTS = 3; const PART_OFFSET = 2; if (partsCount >= MAX_PARTS && parts[partsCount - PART_OFFSET] === 'base64') { return new Blob([Screenshot.bytesFromBase64(parts[partsCount - 1])]); } return null; } /** * Open new browser window and display screenshot in it */ static showScreenshotInNewWindow(imageUri) { // show image on screen // console.log(`imageUri = ${imageUri}`); const win = window.open('about:blank', 'Screenshot', 'width=800,height=600'); win.document.write(`<body style="margin:0"><img src="${imageUri}" alt="from canvas" /></body>`); } /** * Save screenshot in file */ static saveScreenShotToFile(imageUri, fileName) { // save image to file const blob = Screenshot.dataUriToBlob(imageUri); // window.saveAs(blob, fileName); if (typeof window !== 'undefined' && window.navigator && window.navigator.msSaveBlob) { window.navigator.msSaveBlob(blob, fileName); } else if (typeof document !== 'undefined') { const lnk = document.createElement('a'); lnk.download = fileName; lnk.innerHTML = 'download'; lnk.href = window.URL.createObjectURL(blob); document.body.appendChild(lnk); lnk.click(); document.body.removeChild(lnk); } } /** * Format value as a text with 2 digits. '2' -> '02', '34' -> '34' */ static formatTwoDigits(val) { const TEN = 10; if (val >= TEN) { return val; } return `0${val}`; } /** * Get current date + time in format YYMMDD-HHMMSS */ static getFormattedDateString() { const date = new Date(); const yy = date.getUTCFullYear(); const mn = Screenshot.formatTwoDigits(1 + date.getUTCMonth()); const dd = Screenshot.formatTwoDigits(date.getUTCDate()); const hh = Screenshot.formatTwoDigits(date.getHours()); const mi = Screenshot.formatTwoDigits(date.getMinutes()); const ss = Screenshot.formatTwoDigits(date.getSeconds()); const strDate = `${yy}${mn}${dd}-${hh}${mi}${ss}`; return strDate; } /** * Get screenshot */ static makeScreenshot(engineRender, shotW, shotH) { const imageUri = engineRender.screenshot(shotW, shotH); // const imageUri = engineRender3d.screenshot(); // show screen shot Screenshot.showScreenshotInNewWindow(imageUri); // TODO: create save as dialog instead of automatic save screen shot to file // save screen shot // const strFmtDate = Screenshot.getFormattedDateString(); // const fileName = `screenshot-${strFmtDate}.png`; // Screenshot.saveScreenShotToFile(imageUri, fileName); } }
{ "pile_set_name": "Github" }
from firedrake import * from .mesh import MeshHierarchy, HierarchyBase from .interface import prolong import numpy import subprocess import os import warnings __all__ = ("OpenCascadeMeshHierarchy",) def OpenCascadeMeshHierarchy(stepfile, element_size, levels, comm=COMM_WORLD, distribution_parameters=None, callbacks=None, order=1, mh_constructor=MeshHierarchy, cache=True, verbose=True, gmsh="gmsh", project_refinements_to_cad=True, reorder=None): # OpenCascade doesn't give a nice error message if stepfile # doesn't exist, it segfaults ... try: from OCC.Core.STEPControl import STEPControl_Reader from OCC.Extend.TopologyUtils import TopologyExplorer except ImportError: raise ImportError("To use OpenCascadeMeshHierarchy, you must install firedrake with the OpenCascade python bindings (firedrake-update --opencascade).") if not os.path.isfile(stepfile): raise OSError("%s does not exist" % stepfile) step_reader = STEPControl_Reader() step_reader.ReadFile(stepfile) step_reader.TransferRoot() shape = step_reader.Shape() cad = TopologyExplorer(shape) dim = 3 if cad.number_of_solids() > 0 else 2 coarse = make_coarse_mesh(stepfile, cad, element_size, dim, comm=comm, distribution_parameters=distribution_parameters, cache=cache, verbose=verbose, gmsh=gmsh) mh = mh_constructor(coarse, levels, distribution_parameters=distribution_parameters, callbacks=callbacks, reorder=reorder) project_to_cad = project_mesh_to_cad_2d if dim == 2 else project_mesh_to_cad_3d if project_refinements_to_cad: for mesh in mh: project_to_cad(mesh, cad) mh.nested = False if order > 1: VFS = VectorFunctionSpace Ts = [ Function(VFS(mesh, "CG", order)).interpolate(mesh.coordinates) for mesh in mh] ho_meshes = [Mesh(T) for T in Ts] from collections import defaultdict for i, m in enumerate(ho_meshes): m._shared_data_cache = defaultdict(dict) for k in mh[i]._shared_data_cache: if k != "hierarchy_physical_node_locations": m._shared_data_cache[k] = mh[i]._shared_data_cache[k] mh = HierarchyBase( ho_meshes, mh.coarse_to_fine_cells, mh.fine_to_coarse_cells, refinements_per_level=mh.refinements_per_level, nested=mh.nested ) if project_refinements_to_cad: for mesh in mh: project_to_cad(mesh, cad) else: project_to_cad(mh[0], cad) for i in range(1, len(mh)): prolong(Ts[i-1], Ts[i]) return mh def make_coarse_mesh(stepfile, cad, element_size, dim, comm=COMM_WORLD, distribution_parameters=None, cache=True, verbose=True, gmsh="gmsh"): curdir = os.path.dirname(stepfile) or os.getcwd() stepname = os.path.basename(os.path.splitext(stepfile)[0]) geopath = os.path.join(curdir, "coarse-%s.geo" % stepname) mshpath = os.path.join(curdir, "coarse-%s.msh" % stepname) if not os.path.isfile(mshpath) or not cache: if comm.rank == 0: geostr = 'SetFactory("OpenCASCADE");\n' geostr += 'a() = ShapeFromFile("%s");\n' % os.path.abspath(stepfile) if isinstance(element_size, tuple): assert len(element_size) == 2 geostr += """ Mesh.CharacteristicLengthMin = %s; Mesh.CharacteristicLengthMax = %s; """ % (element_size[0], element_size[1]) elif isinstance(element_size, int) or isinstance(element_size, float): geostr += """ Mesh.CharacteristicLengthMin = %s; Mesh.CharacteristicLengthMax = %s; """ % (element_size, element_size) elif isinstance(element_size, str): geostr += element_size else: raise NotImplementedError("element_size has to be a tuple, a number or a string") if dim == 2: for i in range(1, cad.number_of_edges()+1): geostr += "Physical Line(%d) = {%d};\n" % (i, i) for i in range(1, cad.number_of_faces()+1): geostr += ('Physical Surface(%d) = {%d};\n' % (i+cad.number_of_edges(), i)) if cad.number_of_faces() > 1: surfs = "".join(["Surface{%d}; " % i for i in range(2, cad.number_of_faces()+1)]) geostr += ('BooleanUnion{ Surface{1}; Delete;}{' + surfs + 'Delete;}') elif dim == 3: for i in range(1, cad.number_of_faces()+1): geostr += "Physical Surface(%d) = {%d};\n" % (i, i) geostr += ('Physical Volume("Combined volume", %d) = {a()};\n' % (cad.number_of_faces()+1)) logging.debug(geostr) with open(geopath, "w") as f: f.write(geostr) try: os.remove(mshpath) except OSError: pass if verbose: stdout = None else: stdout = subprocess.DEVNULL gmsh = subprocess.Popen(gmsh.split(" ") + ["-%d" % dim, geopath], stdout=stdout) gmsh.wait() comm.barrier() coarse = Mesh(mshpath, distribution_parameters=distribution_parameters, comm=comm) return coarse def project_mesh_to_cad_3d(mesh, cad): from OCC.Core.BRepAdaptor import BRepAdaptor_Surface, BRepAdaptor_Curve from OCC.Core.gp import gp_Pnt from OCC.Core.GeomAPI import GeomAPI_ProjectPointOnSurf, GeomAPI_ProjectPointOnCurve coorddata = mesh.coordinates.dat.data ids = mesh.exterior_facets.unique_markers filt = lambda arr: arr[numpy.where(arr < mesh.coordinates.dof_dset.size)[0]] boundary_nodes = {id: filt(mesh.coordinates.function_space().boundary_nodes(int(id), "topological")) for id in ids} for (id, face) in zip(ids, cad.faces()): owned_nodes = boundary_nodes[id] for other_id in ids: if id == other_id: continue owned_nodes = numpy.setdiff1d(owned_nodes, boundary_nodes[other_id]) surf = BRepAdaptor_Surface(face) for node in owned_nodes: pt = gp_Pnt(*coorddata[node, :]) proj = GeomAPI_ProjectPointOnSurf(pt, surf.Surface().Surface()) if proj.NbPoints() > 0: projpt = proj.NearestPoint() coorddata[node, :] = projpt.Coord() else: warnings.warn("Projection of point %s onto face %d failed" % (coorddata[node, :], id)) edges = set(cad.edges_from_face(face)) for (other_id, other_face) in zip(ids, cad.faces()): if other_id <= id: continue intersecting_nodes = numpy.intersect1d(boundary_nodes[id], boundary_nodes[other_id]) if len(intersecting_nodes) == 0: continue other_edges = set(cad.edges_from_face(other_face)) intersecting_edges = [] for edge in edges: s = str(edge) # FIXME: is there a more elegant way to get the OCC id? for other_edge in other_edges: other_s = str(other_edge) if s == other_s: intersecting_edges.append(edge) if len(intersecting_edges) == 0: warnings.warn("face: %s other_face: %s intersecting_edges: %s" % (face, other_face, intersecting_edges)) warnings.warn("Warning: no intersecting edges in CAD, even though vertices on both faces?") continue for node in intersecting_nodes: pt = gp_Pnt(*coorddata[node, :]) projections = [] for edge in intersecting_edges: curve = BRepAdaptor_Curve(edge) proj = GeomAPI_ProjectPointOnCurve(pt, curve.Curve().Curve()) if proj.NbPoints() > 0: projpt = proj.NearestPoint() sqdist = projpt.SquareDistance(pt) projections.append((projpt, sqdist)) else: warnings.warn("Projection of point %s onto curve failed" % coorddata[node, :]) (projpt, sqdist) = min(projections, key=lambda x: x[1]) coorddata[node, :] = projpt.Coord() def project_mesh_to_cad_2d(mesh, cad): from OCC.Core.BRepAdaptor import BRepAdaptor_Curve from OCC.Core.gp import gp_Pnt from OCC.Core.GeomAPI import GeomAPI_ProjectPointOnCurve coorddata = mesh.coordinates.dat.data ids = mesh.exterior_facets.unique_markers filt = lambda arr: arr[numpy.where(arr < mesh.coordinates.dof_dset.size)[0]] boundary_nodes = {id: filt(mesh.coordinates.function_space().boundary_nodes(int(id), "topological")) for id in ids} for (id, edge) in zip(ids, cad.edges()): owned_nodes = boundary_nodes[id] for other_id in ids: if id == other_id: continue owned_nodes = numpy.setdiff1d(owned_nodes, boundary_nodes[other_id]) curve = BRepAdaptor_Curve(edge) for node in owned_nodes: pt = gp_Pnt(*coorddata[node, :], 0) proj = GeomAPI_ProjectPointOnCurve(pt, curve.Curve().Curve()) if proj.NbPoints() > 0: projpt = proj.NearestPoint() coorddata[node, :] = projpt.Coord()[0:2] else: warnings.warn("Projection of point %s onto curve failed" % coorddata[node, :])
{ "pile_set_name": "Github" }
=pod =encoding utf8 =head1 NAME EVP_PKEY_print_public, EVP_PKEY_print_private, EVP_PKEY_print_params - public key algorithm printing routines =head1 SYNOPSIS #include <openssl/evp.h> int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx); int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx); int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx); =head1 DESCRIPTION The functions EVP_PKEY_print_public(), EVP_PKEY_print_private() and EVP_PKEY_print_params() print out the public, private or parameter components of key B<pkey> respectively. The key is sent to BIO B<out> in human readable form. The parameter B<indent> indicated how far the printout should be indented. The B<pctx> parameter allows the print output to be finely tuned by using ASN1 printing options. If B<pctx> is set to NULL then default values will be used. =head1 NOTES Currently no public key algorithms include any options in the B<pctx> parameter parameter. If the key does not include all the components indicated by the function then only those contained in the key will be printed. For example passing a public key to EVP_PKEY_print_private() will only print the public components. =head1 RETURN VALUES These functions all return 1 for success and 0 or a negative value for failure. In particular a return value of -2 indicates the operation is not supported by the public key algorithm. =head1 SEE ALSO L<EVP_PKEY_CTX_new(3)>, L<EVP_PKEY_keygen(3)> =head1 HISTORY These functions were first added to OpenSSL 1.0.0. =head1 COPYRIGHT Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at L<https://www.openssl.org/source/license.html>. =cut
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- This file is part of GtkSourceView Author: Fabio Zendhi Nagao <[email protected]> Copyright (C) 2009 Fabio Zendhi Nagao <[email protected]> GtkSourceView 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. GtkSourceView 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 St, Fifth Floor, Boston, MA 02110-1301 USA --> <language id="asp" _name="ASP" version="2.0" _section="Sources"> <metadata> <property name="mimetypes">text/x-asp;application/x-asp;application/x-asap</property> <property name="globs">*.asp</property> <property name="line-comment-start">'</property> </metadata> <styles> <style id="comment" _name="Comment" map-to="def:comment"/> <style id="string" _name="String" map-to="def:string"/> <style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/> <style id="keyword" _name="Keyword" map-to="def:keyword"/> <style id="function" _name="Function" map-to="def:function"/> <style id="operator" _name="Operator" map-to="def:operator"/> <style id="object" _name="ASP Object" map-to="def:type"/> <style id="constant" _name="VBScript and ADO constants" map-to="def:constant"/> <style id="type" _name="Data Type" map-to="def:type"/> <style id="special-constant" _name="Special constant" map-to="def:special-constant"/> <style id="boolean" _name="Boolean value" map-to="def:boolean"/> <style id="number" _name="Number" map-to="def:decimal"/> </styles> <default-regex-options case-sensitive="false"/> <definitions> <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check"> <start>'</start> <include> <context ref="def:in-line-comment"/> </include> </context> <context id="old-style-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check"> <start>^rem</start> <include> <context ref="def:in-line-comment"/> </include> </context> <context id="string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check"> <start>"</start> <end>"</end> </context> <context id="preprocessor" style-ref="preprocessor" end-at-line-end="true"> <start extended="true"> ^\s*@\s*(codepage|enablesessionstate|language|lcid|transaction)\b </start> <include> <context ref="line-comment"/> </include> </context> <context id="keywords" style-ref="keyword"> <!-- VBScript statements --> <keyword>call</keyword> <keyword>case</keyword> <keyword>class</keyword> <keyword>const</keyword> <keyword>dim</keyword> <keyword>do</keyword> <keyword>each</keyword> <keyword>else</keyword> <keyword>elseif</keyword> <keyword>end</keyword> <keyword>erase</keyword> <keyword>error</keyword> <keyword>executeGlobal</keyword> <keyword>execute</keyword> <keyword>exit</keyword> <keyword>explicit</keyword> <keyword>for</keyword> <keyword>function</keyword> <keyword>get</keyword> <keyword>goto</keyword> <keyword>if</keyword> <keyword>in</keyword> <keyword>let</keyword> <keyword>loop</keyword> <keyword>me</keyword> <keyword>new</keyword> <keyword>next</keyword> <keyword>on</keyword> <keyword>option</keyword> <keyword>private</keyword> <keyword>property</keyword> <keyword>public</keyword> <keyword>randomize</keyword> <keyword>redim</keyword> <keyword>rem</keyword> <keyword>resume</keyword> <keyword>select</keyword> <keyword>set</keyword> <keyword>stop</keyword> <keyword>sub</keyword> <keyword>then</keyword> <keyword>to</keyword> <keyword>wend</keyword> <keyword>while</keyword> <keyword>with</keyword> <!-- VBScript text operators --> <keyword>and</keyword> <keyword>mod</keyword> <keyword>not</keyword> <keyword>or</keyword> <keyword>xor</keyword> </context> <context id="functions" style-ref="function"> <keyword>abs</keyword> <keyword>array</keyword> <keyword>asc</keyword> <keyword>atn</keyword> <keyword>cbool</keyword> <keyword>cbyte</keyword> <keyword>ccur</keyword> <keyword>cdate</keyword> <keyword>cdbl</keyword> <keyword>chr</keyword> <keyword>cint</keyword> <keyword>clng</keyword> <keyword>cos</keyword> <keyword>createobject</keyword> <keyword>csng</keyword> <keyword>cstr</keyword> <keyword>date</keyword> <keyword>dateadd</keyword> <keyword>datediff</keyword> <keyword>datepart</keyword> <keyword>dateserial</keyword> <keyword>datevalue</keyword> <keyword>day</keyword> <keyword>escape</keyword> <keyword>eval</keyword> <keyword>exp</keyword> <keyword>filter</keyword> <keyword>formatcurrency</keyword> <keyword>formatdatetime</keyword> <keyword>formatnumber</keyword> <keyword>formatpercent</keyword> <keyword>getlocale</keyword> <keyword>getobject</keyword> <keyword>getref</keyword> <keyword>hex</keyword> <keyword>hour</keyword> <keyword>instr</keyword> <keyword>instrrev</keyword> <keyword>isarray</keyword> <keyword>isdate</keyword> <keyword>isempty</keyword> <keyword>isnull</keyword> <keyword>isnumeric</keyword> <keyword>isobject</keyword> <keyword>join</keyword> <keyword>lbound</keyword> <keyword>lcase</keyword> <keyword>left</keyword> <keyword>len</keyword> <keyword>log</keyword> <keyword>ltrim</keyword> <keyword>rtrim</keyword> <keyword>trim</keyword> <keyword>mid</keyword> <keyword>minute</keyword> <keyword>month</keyword> <keyword>monthname</keyword> <keyword>now</keyword> <keyword>oct</keyword> <keyword>replace</keyword> <keyword>rgb</keyword> <keyword>right</keyword> <keyword>rnd</keyword> <keyword>round</keyword> <keyword>scriptengine</keyword> <keyword>scriptenginebuildversion</keyword> <keyword>scriptenginemajorversion</keyword> <keyword>scriptengineminorversion</keyword> <keyword>second</keyword> <keyword>setlocale</keyword> <keyword>sgn</keyword> <keyword>sin</keyword> <keyword>space</keyword> <keyword>split</keyword> <keyword>sqr</keyword> <keyword>strcomp</keyword> <keyword>strreverse</keyword> <keyword>tan</keyword> <keyword>time</keyword> <keyword>timer</keyword> <keyword>timeserial</keyword> <keyword>timevalue</keyword> <keyword>typename</keyword> <keyword>ubound</keyword> <keyword>ucase</keyword> <keyword>unescape</keyword> <keyword>vartype</keyword> <keyword>weekday</keyword> <keyword>weekdayname</keyword> <keyword>year</keyword> <!-- ASP Response properties and Methods --> <keyword>\.buffer</keyword> <keyword>\.charset</keyword> <keyword>\.cachecontrol</keyword> <keyword>\.contenttype</keyword> <keyword>\.expires</keyword> <keyword>\.expiresabsolute</keyword> <keyword>\.isclientconnected</keyword> <keyword>\.pics</keyword> <keyword>\.status</keyword> <keyword>\.addheader</keyword> <keyword>\.appendtolog</keyword> <keyword>\.binarywrite</keyword> <keyword>\.clear</keyword> <keyword>\.end</keyword> <keyword>\.flush</keyword> <keyword>\.redirect</keyword> <keyword>\.write</keyword> <!-- ASP Request properties and Methods --> <keyword>\.totalbytes</keyword> <keyword>\.binaryread</keyword> <!-- ASP Application properties and Methods --> <keyword>\.remove</keyword> <keyword>\.removeAll</keyword> <keyword>\.lock</keyword> <keyword>\.unlock</keyword> <keyword>\.application_onstart</keyword> <keyword>\.application_onend</keyword> <!-- ASP Session properties and Methods --> <keyword>\.codepage</keyword> <keyword>\.lcid</keyword> <keyword>\.sessionid</keyword> <keyword>\.timeout</keyword> <keyword>\.abandon</keyword> <keyword>\.session_onstart</keyword> <keyword>\.session_onend</keyword> <!-- ASP Server properties and Methods --> <keyword>\.scripttimeout</keyword> <keyword>\.execute</keyword> <keyword>\.getlasterror</keyword> <keyword>\.htmlencode</keyword> <keyword>\.mappath</keyword> <keyword>\.transfer</keyword> <keyword>\.urlencode</keyword> <!-- ASP Error properties and Methods - won't implement this --> <keyword>\.aspcode</keyword> <keyword>\.aspdescription</keyword> <keyword>\.category</keyword> <keyword>\.column</keyword> <keyword>\.description</keyword> <keyword>\.file</keyword> <keyword>\.line</keyword> <keyword>\.number</keyword> <keyword>\.source</keyword> <!-- ASP FileSystem properties and Methods --> <keyword>\.drives</keyword> <keyword>\.buildpath</keyword> <keyword>\.copyfile</keyword> <keyword>\.copyfolder</keyword> <keyword>\.createfolder</keyword> <keyword>\.createtextfile</keyword> <keyword>\.deletefile</keyword> <keyword>\.deletefolder</keyword> <keyword>\.driveexists</keyword> <keyword>\.fileexists</keyword> <keyword>\.folderexists</keyword> <keyword>\.getabsolutepathname</keyword> <keyword>\.getbasename</keyword> <keyword>\.getdrive</keyword> <keyword>\.getdrivename</keyword> <keyword>\.getextensionname</keyword> <keyword>\.getfile</keyword> <keyword>\.getfilename</keyword> <keyword>\.getfolder</keyword> <keyword>\.getparentfoldername</keyword> <keyword>\.getspecialfolder</keyword> <keyword>\.gettempname</keyword> <keyword>\.movefile</keyword> <keyword>\.movefolder</keyword> <keyword>\.opentextfile</keyword> <!-- ASP TextStream properties and Methods --> <keyword>\.atendofline</keyword> <keyword>\.atendofstream</keyword> <keyword>\.close</keyword> <keyword>\.read</keyword> <keyword>\.readall</keyword> <keyword>\.readline</keyword> <keyword>\.skip</keyword> <keyword>\.skipline</keyword> <keyword>\.writeline</keyword> <keyword>\.writeblanklines</keyword> <!-- ASP Drive properties and Methods --> <keyword>\.availablespace</keyword> <keyword>\.driveletter</keyword> <keyword>\.drivetype</keyword> <keyword>\.filesystem</keyword> <keyword>\.freespace</keyword> <keyword>\.isready</keyword> <keyword>\.path</keyword> <keyword>\.rootfolder</keyword> <keyword>\.serialnumber</keyword> <keyword>\.sharename</keyword> <keyword>\.totalsize</keyword> <keyword>\.volumename</keyword> <!-- ASP Folder and File properties and Methods --> <keyword>\.attributes</keyword> <keyword>\.datecreated</keyword> <keyword>\.datelastaccessed</keyword> <keyword>\.datelastmodified</keyword> <keyword>\.drive</keyword> <keyword>\.name</keyword> <keyword>\.parentfolder</keyword> <keyword>\.shortname</keyword> <keyword>\.shortpath</keyword> <keyword>\.size</keyword> <keyword>\.type</keyword> <keyword>\.copy</keyword> <keyword>\.delete</keyword> <keyword>\.move</keyword> <keyword>\.openastextstream</keyword> <keyword>\.isrootfolder</keyword> <!-- ASP Dictionary properties and Methods --> <keyword>\.comparemode</keyword> <keyword>\.count</keyword> <keyword>\.item</keyword> <keyword>\.key</keyword> <keyword>\.add</keyword> <keyword>\.exists</keyword> <keyword>\.items</keyword> <keyword>\.keys</keyword> <!-- ADO Command properties and Methods --> <keyword>\.activeconnection</keyword> <keyword>\.commandtext</keyword> <keyword>\.commandtimeout</keyword> <keyword>\.commandtype</keyword> <keyword>\.prepared</keyword> <keyword>\.state</keyword> <keyword>\.cancel</keyword> <keyword>\.createparameter</keyword> <!-- ADO Connection properties and Methods --> <keyword>\.commadtimeout</keyword> <keyword>\.connectionstring</keyword> <keyword>\.connectiontimeout</keyword> <keyword>\.cursorlocation</keyword> <keyword>\.defaultdatabase</keyword> <keyword>\.isolationlevel</keyword> <keyword>\.mode</keyword> <keyword>\.provider</keyword> <keyword>\.version</keyword> <keyword>\.begintrans</keyword> <keyword>\.close</keyword> <keyword>\.committrans</keyword> <keyword>\.open</keyword> <keyword>\.openschema</keyword> <keyword>\.rollbacktrans</keyword> <!-- ADO Error properties and Methods --> <keyword>\.helpcontext</keyword> <keyword>\.helpfile</keyword> <keyword>\.nativeerror</keyword> <keyword>\.sqlstate</keyword> <!-- ADO Field properties and Methods --> <keyword>\.actualsize</keyword> <keyword>\.definedsize</keyword> <keyword>\.numericscale</keyword> <keyword>\.originalvalue</keyword> <keyword>\.precision</keyword> <keyword>\.underlyingvalue</keyword> <keyword>\.value</keyword> <keyword>\.appendChunk</keyword> <keyword>\.getChunk</keyword> <!-- ADO Parameter properties and Methods --> <keyword>\.direction</keyword> <!-- ADO Property (everything is already defined) --> <!-- ADO Record properties and Methods --> <keyword>\.parenturl</keyword> <keyword>\.recordtype</keyword> <keyword>\.copyrecord</keyword> <keyword>\.deleterecord</keyword> <keyword>\.getchildren</keyword> <keyword>\.moverecord</keyword> <!-- ADO Recordset properties and Methods --> <keyword>\.absolutepage</keyword> <keyword>\.absoluteposition</keyword> <keyword>\.activeCommand</keyword> <keyword>\.bof</keyword> <keyword>\.bookmark</keyword> <keyword>\.cachesize</keyword> <keyword>\.cursortype</keyword> <keyword>\.datamember</keyword> <keyword>\.editmode</keyword> <keyword>\.eof</keyword> <keyword>\.index</keyword> <keyword>\.locktype</keyword> <keyword>\.marshaloptions</keyword> <keyword>\.maxrecords</keyword> <keyword>\.pagecount</keyword> <keyword>\.pagesize</keyword> <keyword>\.recordcount</keyword> <keyword>\.sort</keyword> <keyword>\.stayinsync</keyword> <keyword>\.addnew</keyword> <keyword>\.cancelbatch</keyword> <keyword>\.cancelupdate</keyword> <keyword>\.clone</keyword> <keyword>\.comparebookmarks</keyword> <keyword>\.find</keyword> <keyword>\.getrows</keyword> <keyword>\.getstring</keyword> <keyword>\.movefirst</keyword> <keyword>\.movelast</keyword> <keyword>\.movenext</keyword> <keyword>\.moveprevious</keyword> <keyword>\.nextrecordset</keyword> <keyword>\.requery</keyword> <keyword>\.resync</keyword> <keyword>\.save</keyword> <keyword>\.seek</keyword> <keyword>\.supports</keyword> <keyword>\.update</keyword> <keyword>\.updatebatch</keyword> <!-- ADO Stream properties and Methods --> <keyword>\.eos</keyword> <keyword>\.lineseparator</keyword> <keyword>\.position</keyword> <keyword>\.copyto</keyword> <keyword>\.loadfromfile</keyword> <keyword>\.readtext</keyword> <keyword>\.savetofile</keyword> <keyword>\.seteos</keyword> <keyword>\.writetext</keyword> </context> <context id="operators" style-ref="operator" extend-parent="false"> <match>[-^:/\=\+\*&amp;&lt;&gt;]</match> </context> <context id="objects" style-ref="object"> <!-- ASP Objects --> <keyword>response</keyword> <keyword>request</keyword> <keyword>application</keyword> <keyword>session</keyword> <keyword>server</keyword> <!-- ASP Collections --> <keyword>\.querystring</keyword> <keyword>\.form</keyword> <keyword>\.cookies</keyword> <keyword>\.servervariables</keyword> <keyword>\.clientcertificate</keyword> <keyword>\.contents</keyword> <keyword>\.staticobjects</keyword> <keyword>\.files</keyword> <keyword>\.subfolders</keyword> <keyword>\.parameters</keyword> <keyword>\.properties</keyword> <keyword>\.errors</keyword> </context> <context id="constants" style-ref="constant"> <!-- VBScript constants --> <keyword>vbBlack</keyword> <keyword>vbRed</keyword> <keyword>vbGreen</keyword> <keyword>vbYellow</keyword> <keyword>vbBlue</keyword> <keyword>vbMagenta</keyword> <keyword>vbCyan</keyword> <keyword>vbWhite</keyword> <keyword>vbBinaryCompare</keyword> <keyword>vbTextCompare</keyword> <keyword>vbSunday</keyword> <keyword>vbMonday</keyword> <keyword>vbTuesday</keyword> <keyword>vbWednesday</keyword> <keyword>vbThursday</keyword> <keyword>vbFriday</keyword> <keyword>vbSaturday</keyword> <keyword>vbUseSystemDayOfWeek</keyword> <keyword>vbFirstJan1</keyword> <keyword>vbFirstFourDays</keyword> <keyword>vbFirstFullWeek</keyword> <keyword>vbGeneralDate</keyword> <keyword>vbLongDate</keyword> <keyword>vbShortDate</keyword> <keyword>vbLongTime</keyword> <keyword>vbShortTime</keyword> <keyword>vbObjectError</keyword> <keyword>vbOKOnly</keyword> <keyword>vbOKCancel</keyword> <keyword>vbAbortRetryIgnore</keyword> <keyword>vbYesNoCancel</keyword> <keyword>vbYesNo</keyword> <keyword>vbRetryCancel</keyword> <keyword>vbCritical</keyword> <keyword>vbQuestion</keyword> <keyword>vbExclamation</keyword> <keyword>vbInformation</keyword> <keyword>vbDefaultButton1</keyword> <keyword>vbDefaultButton2</keyword> <keyword>vbDefaultButton3</keyword> <keyword>vbDefaultButton4</keyword> <keyword>vbApplicationModal</keyword> <keyword>vbSystemModal</keyword> <keyword>vbCr</keyword> <keyword>vbCrLf</keyword> <keyword>vbFormFeed</keyword> <keyword>vbLf</keyword> <keyword>vbNewLine</keyword> <keyword>vbNullChar</keyword> <keyword>vbNullString</keyword> <keyword>vbTab</keyword> <keyword>vbVerticalTab</keyword> <keyword>vbUseDefault</keyword> <keyword>vbTrue</keyword> <keyword>vbFalse</keyword> <keyword>vbEmpty</keyword> <keyword>vbNull</keyword> <keyword>vbInteger</keyword> <keyword>vbLong</keyword> <keyword>vbSingle</keyword> <keyword>vbDouble</keyword> <keyword>vbCurrency</keyword> <keyword>vbDate</keyword> <keyword>vbString</keyword> <keyword>vbObject</keyword> <keyword>vbError</keyword> <keyword>vbBoolean</keyword> <keyword>vbVariant</keyword> <keyword>vbDataObject</keyword> <keyword>vbDecimal</keyword> <keyword>vbByte</keyword> <keyword>vbArray</keyword> <!-- ADO constants --> <!-- CursorTypeEnum Values --> <keyword>adOpenForwardOnly</keyword> <keyword>adOpenKeyset</keyword> <keyword>adOpenDynamic</keyword> <keyword>adOpenStatic</keyword> <!-- CursorOptionEnum Values --> <keyword>adHoldRecords</keyword> <keyword>adMovePrevious</keyword> <keyword>adAddNew</keyword> <keyword>adDelete</keyword> <keyword>adUpdate</keyword> <keyword>adBookmark</keyword> <keyword>adApproxPosition</keyword> <keyword>adUpdateBatch</keyword> <keyword>adResync</keyword> <keyword>adNotify</keyword> <keyword>adFind</keyword> <keyword>adSeek</keyword> <keyword>adIndex</keyword> <!-- LockTypeEnum Values --> <keyword>adLockReadOnly</keyword> <keyword>adLockPessimistic</keyword> <keyword>adLockOptimistic</keyword> <keyword>adLockBatchOptimistic</keyword> <!-- ExecuteOptionEnum Values --> <keyword>adAsyncExecute</keyword> <keyword>adAsyncFetch</keyword> <keyword>adAsyncFetchNonBlocking</keyword> <keyword>adExecuteNoRecords</keyword> <keyword>adExecuteStream</keyword> <!-- ConnectOptionEnum Values --> <keyword>adAsyncConnect</keyword> <!-- ObjectStateEnum Values --> <keyword>adStateClosed</keyword> <keyword>adStateOpen</keyword> <keyword>adStateConnecting</keyword> <keyword>adStateExecuting</keyword> <keyword>adStateFetching</keyword> <!-- CursorLocationEnum Values --> <keyword>adUseServer</keyword> <keyword>adUseClient</keyword> <!-- DataTypeEnum Values --> <keyword>adEmpty</keyword> <keyword>adTinyInt</keyword> <keyword>adSmallInt</keyword> <keyword>adInteger</keyword> <keyword>adBigInt</keyword> <keyword>adUnsignedTinyInt</keyword> <keyword>adUnsignedSmallInt</keyword> <keyword>adUnsignedInt</keyword> <keyword>adUnsignedBigInt</keyword> <keyword>adSingle</keyword> <keyword>adDouble</keyword> <keyword>adCurrency</keyword> <keyword>adDecimal</keyword> <keyword>adNumeric</keyword> <keyword>adBoolean</keyword> <keyword>adError</keyword> <keyword>adUserDefined</keyword> <keyword>adVariant</keyword> <keyword>adIDispatch</keyword> <keyword>adIUnknown</keyword> <keyword>adGUID</keyword> <keyword>adDate</keyword> <keyword>adDBDate</keyword> <keyword>adDBTime</keyword> <keyword>adDBTimeStamp</keyword> <keyword>adBSTR</keyword> <keyword>adChar</keyword> <keyword>adVarChar</keyword> <keyword>adLongVarChar</keyword> <keyword>adWChar</keyword> <keyword>adVarWChar</keyword> <keyword>adLongVarWChar</keyword> <keyword>adBinary</keyword> <keyword>adVarBinary</keyword> <keyword>adLongVarBinary</keyword> <keyword>adChapter</keyword> <keyword>adFileTime</keyword> <keyword>adPropVariant</keyword> <keyword>adVarNumeric</keyword> <keyword>adArray</keyword> <!-- FieldAttributeEnum Values --> <keyword>adFldMayDefer</keyword> <keyword>adFldUpdatable</keyword> <keyword>adFldUnknownUpdatable</keyword> <keyword>adFldFixed</keyword> <keyword>adFldIsNullable</keyword> <keyword>adFldMayBeNull</keyword> <keyword>adFldLong</keyword> <keyword>adFldRowID</keyword> <keyword>adFldRowVersion</keyword> <keyword>adFldCacheDeferred</keyword> <keyword>adFldIsChapter</keyword> <keyword>adFldNegativeScale</keyword> <keyword>adFldKeyColumn</keyword> <keyword>adFldIsRowURL</keyword> <keyword>adFldIsDefaultStream</keyword> <keyword>adFldIsCollection</keyword> <!-- EditModeEnum Values --> <keyword>adEditNone</keyword> <keyword>adEditInProgress</keyword> <keyword>adEditAdd</keyword> <keyword>adEditDelete</keyword> <!-- RecordStatusEnum Values --> <keyword>adRecOK</keyword> <keyword>adRecNew</keyword> <keyword>adRecModified</keyword> <keyword>adRecDeleted</keyword> <keyword>adRecUnmodified</keyword> <keyword>adRecInvalid</keyword> <keyword>adRecMultipleChanges</keyword> <keyword>adRecPendingChanges</keyword> <keyword>adRecCanceled</keyword> <keyword>adRecCantRelease</keyword> <keyword>adRecConcurrencyViolation</keyword> <keyword>adRecIntegrityViolation</keyword> <keyword>adRecMaxChangesExceeded</keyword> <keyword>adRecObjectOpen</keyword> <keyword>adRecOutOfMemory</keyword> <keyword>adRecPermissionDenied</keyword> <keyword>adRecSchemaViolation</keyword> <keyword>adRecDBDeleted</keyword> <!-- GetRowsOptionEnum Values --> <keyword>adGetRowsRest</keyword> <!-- PositionEnum Values --> <keyword>adPosUnknown</keyword> <keyword>adPosBOF</keyword> <keyword>adPosEOF</keyword> <!-- BookmarkEnum Values --> <keyword>adBookmarkCurrent</keyword> <keyword>adBookmarkFirst</keyword> <keyword>adBookmarkLast</keyword> <!-- MarshalOptionsEnum Values --> <keyword>adMarshalAll</keyword> <keyword>adMarshalModifiedOnly</keyword> <!-- AffectEnum Values --> <keyword>adAffectCurrent</keyword> <keyword>adAffectGroup</keyword> <keyword>adAffectAllChapters</keyword> <!-- ResyncEnum Values --> <keyword>adResyncUnderlyingValues</keyword> <keyword>adResyncAllValues</keyword> <!-- CompareEnum Values --> <keyword>adCompareLessThan</keyword> <keyword>adCompareEqual</keyword> <keyword>adCompareGreaterThan</keyword> <keyword>adCompareNotEqual</keyword> <keyword>adCompareNotComparable</keyword> <!-- FilterGroupEnum Values --> <keyword>adFilterNone</keyword> <keyword>adFilterPendingRecords</keyword> <keyword>adFilterAffectedRecords</keyword> <keyword>adFilterFetchedRecords</keyword> <keyword>adFilterConflictingRecords</keyword> <!-- SearchDirectionEnum Values --> <keyword>adSearchForward</keyword> <keyword>adSearchBackward</keyword> <!-- PersistFormatEnum Values --> <keyword>adPersistADTG</keyword> <keyword>adPersistXML</keyword> <!-- StringFormatEnum Values --> <keyword>adClipString</keyword> <!-- ConnectPromptEnum Values --> <keyword>adPromptAlways</keyword> <keyword>adPromptComplete</keyword> <keyword>adPromptCompleteRequired</keyword> <keyword>adPromptNever</keyword> <!-- ConnectModeEnum Values --> <keyword>adModeUnknown</keyword> <keyword>adModeRead</keyword> <keyword>adModeWrite</keyword> <keyword>adModeReadWrite</keyword> <keyword>adModeShareDenyRead</keyword> <keyword>adModeShareDenyWrite</keyword> <keyword>adModeShareExclusive</keyword> <keyword>adModeShareDenyNone</keyword> <keyword>adModeRecursive</keyword> <!-- RecordCreateOptionsEnum Values --> <keyword>adCreateCollection</keyword> <keyword>adCreateStructDoc</keyword> <keyword>adCreateNonCollection</keyword> <keyword>adOpenIfExists</keyword> <keyword>adCreateOverwrite</keyword> <keyword>adFailIfNotExists</keyword> <!-- RecordOpenOptionsEnum Values --> <keyword>adOpenRecordUnspecified</keyword> <keyword>adOpenOutput</keyword> <keyword>adOpenAsync</keyword> <keyword>adDelayFetchStream</keyword> <keyword>adDelayFetchFields</keyword> <keyword>adOpenExecuteCommand</keyword> <!-- IsolationLevelEnum Values --> <keyword>adXactUnspecified</keyword> <keyword>adXactChaos</keyword> <keyword>adXactReadUncommitted</keyword> <keyword>adXactBrowse</keyword> <keyword>adXactCursorStability</keyword> <keyword>adXactReadCommitted</keyword> <keyword>adXactRepeatableRead</keyword> <keyword>adXactSerializable</keyword> <keyword>adXactIsolated</keyword> <!-- XactAttributeEnum Values --> <keyword>adXactCommitRetaining</keyword> <keyword>adXactAbortRetaining</keyword> <!-- PropertyAttributesEnum Values --> <keyword>adPropNotSupported</keyword> <keyword>adPropRequired</keyword> <keyword>adPropOptional</keyword> <keyword>adPropRead</keyword> <keyword>adPropWrite</keyword> <!-- ErrorValueEnum Values --> <keyword>adErrProviderFailed</keyword> <keyword>adErrInvalidArgument</keyword> <keyword>adErrOpeningFile</keyword> <keyword>adErrReadFile</keyword> <keyword>adErrWriteFile</keyword> <keyword>adErrNoCurrentRecord</keyword> <keyword>adErrIllegalOperation</keyword> <keyword>adErrCantChangeProvider</keyword> <keyword>adErrInTransaction</keyword> <keyword>adErrFeatureNotAvailable</keyword> <keyword>adErrItemNotFound</keyword> <keyword>adErrObjectInCollection</keyword> <keyword>adErrObjectNotSet</keyword> <keyword>adErrDataConversion</keyword> <keyword>adErrObjectClosed</keyword> <keyword>adErrObjectOpen</keyword> <keyword>adErrProviderNotFound</keyword> <keyword>adErrBoundToCommand</keyword> <keyword>adErrInvalidParamInfo</keyword> <keyword>adErrInvalidConnection</keyword> <keyword>adErrNotReentrant</keyword> <keyword>adErrStillExecuting</keyword> <keyword>adErrOperationCancelled</keyword> <keyword>adErrStillConnecting</keyword> <keyword>adErrInvalidTransaction</keyword> <keyword>adErrUnsafeOperation</keyword> <keyword>adwrnSecurityDialog</keyword> <keyword>adwrnSecurityDialogHeader</keyword> <keyword>adErrIntegrityViolation</keyword> <keyword>adErrPermissionDenied</keyword> <keyword>adErrDataOverflow</keyword> <keyword>adErrSchemaViolation</keyword> <keyword>adErrSignMismatch</keyword> <keyword>adErrCantConvertvalue</keyword> <keyword>adErrCantCreate</keyword> <keyword>adErrColumnNotOnThisRow</keyword> <keyword>adErrURLIntegrViolSetColumns</keyword> <keyword>adErrURLDoesNotExist</keyword> <keyword>adErrTreePermissionDenied</keyword> <keyword>adErrInvalidURL</keyword> <keyword>adErrResourceLocked</keyword> <keyword>adErrResourceExists</keyword> <keyword>adErrCannotComplete</keyword> <keyword>adErrVolumeNotFound</keyword> <keyword>adErrOutOfSpace</keyword> <keyword>adErrResourceOutOfScope</keyword> <keyword>adErrUnavailable</keyword> <keyword>adErrURLNamedRowDoesNotExist</keyword> <keyword>adErrDelResOutOfScope</keyword> <keyword>adErrPropInvalidColumn</keyword> <keyword>adErrPropInvalidOption</keyword> <keyword>adErrPropInvalidValue</keyword> <keyword>adErrPropConflicting</keyword> <keyword>adErrPropNotAllSettable</keyword> <keyword>adErrPropNotSet</keyword> <keyword>adErrPropNotSettable</keyword> <keyword>adErrPropNotSupported</keyword> <keyword>adErrCatalogNotSet</keyword> <keyword>adErrCantChangeConnection</keyword> <keyword>adErrFieldsUpdateFailed</keyword> <keyword>adErrDenyNotSupported</keyword> <keyword>adErrDenyTypeNotSupported</keyword> <keyword>adErrProviderNotSpecified</keyword> <keyword>adErrConnectionStringTooLong</keyword> <!-- ParameterAttributesEnum Values --> <keyword>adParamSigned</keyword> <keyword>adParamNullable</keyword> <keyword>adParamLong</keyword> <!-- ParameterDirectionEnum Values --> <keyword>adParamUnknown</keyword> <keyword>adParamInput</keyword> <keyword>adParamOutput</keyword> <keyword>adParamInputOutput</keyword> <keyword>adParamReturnValue</keyword> <!-- CommandTypeEnum Values --> <keyword>adCmdUnknown</keyword> <keyword>adCmdText</keyword> <keyword>adCmdTable</keyword> <keyword>adCmdStoredProc</keyword> <keyword>adCmdFile</keyword> <keyword>adCmdTableDirect</keyword> <!-- EventStatusEnum Values --> <keyword>adStatusOK</keyword> <keyword>adStatusErrorsOccurred</keyword> <keyword>adStatusCantDeny</keyword> <keyword>adStatusCancel</keyword> <keyword>adStatusUnwantedEvent</keyword> <!-- EventReasonEnum Values --> <keyword>adRsnAddNew</keyword> <keyword>adRsnDelete</keyword> <keyword>adRsnUpdate</keyword> <keyword>adRsnUndoUpdate</keyword> <keyword>adRsnUndoAddNew</keyword> <keyword>adRsnUndoDelete</keyword> <keyword>adRsnRequery</keyword> <keyword>adRsnResynch</keyword> <keyword>adRsnClose</keyword> <keyword>adRsnMove</keyword> <keyword>adRsnFirstChange</keyword> <keyword>adRsnMoveFirst</keyword> <keyword>adRsnMoveNext</keyword> <keyword>adRsnMovePrevious</keyword> <keyword>adRsnMoveLast</keyword> <!-- SchemaEnum Values --> <keyword>adSchemaProviderSpecific</keyword> <keyword>adSchemaAsserts</keyword> <keyword>adSchemaCatalogs</keyword> <keyword>adSchemaCharacterSets</keyword> <keyword>adSchemaCollations</keyword> <keyword>adSchemaColumns</keyword> <keyword>adSchemaCheckConstraints</keyword> <keyword>adSchemaConstraintColumnUsage</keyword> <keyword>adSchemaConstraintTableUsage</keyword> <keyword>adSchemaKeyColumnUsage</keyword> <keyword>adSchemaReferentialConstraints</keyword> <keyword>adSchemaTableConstraints</keyword> <keyword>adSchemaColumnsDomainUsage</keyword> <keyword>adSchemaIndexes</keyword> <keyword>adSchemaColumnPrivileges</keyword> <keyword>adSchemaTablePrivileges</keyword> <keyword>adSchemaUsagePrivileges</keyword> <keyword>adSchemaProcedures</keyword> <keyword>adSchemaSchemata</keyword> <keyword>adSchemaSQLLanguages</keyword> <keyword>adSchemaStatistics</keyword> <keyword>adSchemaTables</keyword> <keyword>adSchemaTranslations</keyword> <keyword>adSchemaProviderTypes</keyword> <keyword>adSchemaViews</keyword> <keyword>adSchemaViewColumnUsage</keyword> <keyword>adSchemaViewTableUsage</keyword> <keyword>adSchemaProcedureParameters</keyword> <keyword>adSchemaForeignKeys</keyword> <keyword>adSchemaPrimaryKeys</keyword> <keyword>adSchemaProcedureColumns</keyword> <keyword>adSchemaDBInfoKeywords</keyword> <keyword>adSchemaDBInfoLiterals</keyword> <keyword>adSchemaCubes</keyword> <keyword>adSchemaDimensions</keyword> <keyword>adSchemaHierarchies</keyword> <keyword>adSchemaLevels</keyword> <keyword>adSchemaMeasures</keyword> <keyword>adSchemaProperties</keyword> <keyword>adSchemaMembers</keyword> <keyword>adSchemaTrustees</keyword> <keyword>adSchemaFunctions</keyword> <keyword>adSchemaActions</keyword> <keyword>adSchemaCommands</keyword> <keyword>adSchemaSets</keyword> <!-- FieldStatusEnum Values --> <keyword>adFieldOK</keyword> <keyword>adFieldCantConvertValue</keyword> <keyword>adFieldIsNull</keyword> <keyword>adFieldTruncated</keyword> <keyword>adFieldSignMismatch</keyword> <keyword>adFieldDataOverflow</keyword> <keyword>adFieldCantCreate</keyword> <keyword>adFieldUnavailable</keyword> <keyword>adFieldPermissionDenied</keyword> <keyword>adFieldIntegrityViolation</keyword> <keyword>adFieldSchemaViolation</keyword> <keyword>adFieldBadStatus</keyword> <keyword>adFieldDefault</keyword> <keyword>adFieldIgnore</keyword> <keyword>adFieldDoesNotExist</keyword> <keyword>adFieldInvalidURL</keyword> <keyword>adFieldResourceLocked</keyword> <keyword>adFieldResourceExists</keyword> <keyword>adFieldCannotComplete</keyword> <keyword>adFieldVolumeNotFound</keyword> <keyword>adFieldOutOfSpace</keyword> <keyword>adFieldCannotDeleteSource</keyword> <keyword>adFieldReadOnly</keyword> <keyword>adFieldResourceOutOfScope</keyword> <keyword>adFieldAlreadyExists</keyword> <keyword>adFieldPendingInsert</keyword> <keyword>adFieldPendingDelete</keyword> <keyword>adFieldPendingChange</keyword> <keyword>adFieldPendingUnknown</keyword> <keyword>adFieldPendingUnknownDelete</keyword> <!-- SeekEnum Values --> <keyword>adSeekFirstEQ</keyword> <keyword>adSeekLastEQ</keyword> <keyword>adSeekAfterEQ</keyword> <keyword>adSeekAfter</keyword> <keyword>adSeekBeforeEQ</keyword> <keyword>adSeekBefore</keyword> <!-- ADCPROP_UPDATECRITERIA_ENUM Values --> <keyword>adCriteriaKey</keyword> <keyword>adCriteriaAllCols</keyword> <keyword>adCriteriaUpdCols</keyword> <keyword>adCriteriaTimeStamp</keyword> <!-- ADCPROP_ASYNCTHREADPRIORITY_ENUM Values --> <keyword>adPriorityLowest</keyword> <keyword>adPriorityBelowNormal</keyword> <keyword>adPriorityNormal</keyword> <keyword>adPriorityAboveNormal</keyword> <keyword>adPriorityHighest</keyword> <!-- ADCPROP_AUTORECALC_ENUM Values --> <keyword>adRecalcUpFront</keyword> <keyword>adRecalcAlways</keyword> <!-- ADCPROP_UPDATERESYNC_ENUM Values --> <keyword>adResyncNone</keyword> <keyword>adResyncAutoIncrement</keyword> <keyword>adResyncConflicts</keyword> <keyword>adResyncUpdates</keyword> <keyword>adResyncInserts</keyword> <keyword>adResyncAll</keyword> <!-- MoveRecordOptionsEnum Values --> <keyword>adMoveUnspecified</keyword> <keyword>adMoveOverWrite</keyword> <keyword>adMoveDontUpdateLinks</keyword> <keyword>adMoveAllowEmulation</keyword> <!-- CopyRecordOptionsEnum Values --> <keyword>adCopyUnspecified</keyword> <keyword>adCopyOverWrite</keyword> <keyword>adCopyAllowEmulation</keyword> <keyword>adCopyNonRecursive</keyword> <!-- StreamTypeEnum Values --> <keyword>adTypeBinary</keyword> <keyword>adTypeText</keyword> <!-- LineSeparatorEnum Values --> <keyword>adLF</keyword> <keyword>adCR</keyword> <keyword>adCRLF</keyword> <!-- StreamOpenOptionsEnum Values --> <keyword>adOpenStreamUnspecified</keyword> <keyword>adOpenStreamAsync</keyword> <keyword>adOpenStreamFromRecord</keyword> <!-- StreamWriteEnum Values --> <keyword>adWriteChar</keyword> <keyword>adWriteLine</keyword> <!-- SaveOptionsEnum Values --> <keyword>adSaveCreateNotExist</keyword> <keyword>adSaveCreateOverWrite</keyword> <!-- FieldEnum Values --> <keyword>adDefaultStream</keyword> <keyword>adRecordURL</keyword> <!-- StreamReadEnum Values --> <keyword>adReadAll</keyword> <keyword>adReadLine</keyword> <!-- RecordTypeEnum Values --> <keyword>adSimpleRecord</keyword> <keyword>adCollectionRecord</keyword> <keyword>adStructDoc</keyword> </context> <context id="types" style-ref="type"> <keyword>boolean</keyword> <keyword>byte</keyword> <keyword>currency</keyword> <keyword>date</keyword> <keyword>double</keyword> <keyword>empty</keyword> <keyword>error</keyword> <keyword>integer</keyword> <keyword>long</keyword> <keyword>object</keyword> <keyword>single</keyword> <keyword>string</keyword> </context> <context id="special-constants" style-ref="special-constant"> <keyword>nothing</keyword> <keyword>null</keyword> </context> <context id="boolean" style-ref="boolean"> <keyword>false</keyword> <keyword>true</keyword> </context> <context id="numeric" style-ref="number"> <match extended="true"> (\b([0-9]+|0[xX][0-9a-fA-F]+)[Ll]?\b| \b(([0-9]+[Ee][-]?[0-9]+| ([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-]?[0-9]+)?)[fFdD]?| [0-9]+[FfDd])) </match> </context> <context id="asp-block"> <start>&lt;[%]</start> <end>[%]&gt;</end> <include> <context sub-pattern="0" where="start" style-ref="preprocessor"/> <context sub-pattern="0" where="end" style-ref="preprocessor"/> <context ref="line-comment"/> <context ref="old-style-comment"/> <context ref="string"/> <context ref="preprocessor"/> <context ref="keywords"/> <context ref="functions"/> <context ref="operators"/> <context ref="objects"/> <context ref="constants"/> <context ref="types"/> <context ref="special-constants"/> <context ref="boolean"/> <context ref="numeric"/> <!--// ASP(Active Server Pages) technology allows almost any programming language with support to ActiveScripting to be used with it, but including the languages below doesn't work as expected because of definitions conflicts between them. I've tested and recommend to just change the Syntax Highlighting to the desired language if it's another than VBScript. VBScript was chosen here because it's the standard language for ASP. <context ref="js:js"/> <context ref="perl:perl"/> <context ref="python:python"/> <context ref="tcl:tcl"/> <context ref="php:php"/> //--> </include> </context> <context id="asp" class="no-spell-check"> <include> <context ref="asp-block"/> <context ref="html:html"/> </include> </context> </definitions> </language>
{ "pile_set_name": "Github" }