text
stringlengths 2
100k
| meta
dict |
---|---|
package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.MyriadAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
/**
*
* @author LevelX2
*/
public final class WarchiefGiant extends CardImpl {
public WarchiefGiant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}{R}");
this.subtype.add(SubType.GIANT);
this.subtype.add(SubType.WARRIOR);
this.power = new MageInt(5);
this.toughness = new MageInt(3);
// Haste
this.addAbility(HasteAbility.getInstance());
// Myriad
this.addAbility(new MyriadAbility());
}
public WarchiefGiant(final WarchiefGiant card) {
super(card);
}
@Override
public WarchiefGiant copy() {
return new WarchiefGiant(this);
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* This header is generated by class-dump-z 0.2a.
* class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3.
*
* Source: (null)
*/
#import "DVTPlaygroundCommunication-Structs.h"
|
{
"pile_set_name": "Github"
}
|
{
"assignee": null,
"assignees": [],
"author_association": "MEMBER",
"body": "#19 子问题\r\n`Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist.`",
"closed_at": "2018-11-06T07:26:27Z",
"comment_data": [],
"comments": 0,
"comments_url": "https://api.github.com/repos/program-in-chinese/webextension_github_code_translator/issues/21/comments",
"created_at": "2018-11-06T03:28:30Z",
"event_data": [
{
"actor": {
"avatar_url": "https://avatars1.githubusercontent.com/u/392497?v=4",
"events_url": "https://api.github.com/users/nobodxbodon/events{/privacy}",
"followers_url": "https://api.github.com/users/nobodxbodon/followers",
"following_url": "https://api.github.com/users/nobodxbodon/following{/other_user}",
"gists_url": "https://api.github.com/users/nobodxbodon/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nobodxbodon",
"id": 392497,
"login": "nobodxbodon",
"node_id": "MDQ6VXNlcjM5MjQ5Nw==",
"organizations_url": "https://api.github.com/users/nobodxbodon/orgs",
"received_events_url": "https://api.github.com/users/nobodxbodon/received_events",
"repos_url": "https://api.github.com/users/nobodxbodon/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nobodxbodon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nobodxbodon/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nobodxbodon"
},
"commit_id": "7a8539e1893f8d93c420241a32f29476d61e3f0d",
"commit_url": "https://api.github.com/repos/program-in-chinese/webextension_github_code_translator/commits/7a8539e1893f8d93c420241a32f29476d61e3f0d",
"created_at": "2018-11-06T07:25:58Z",
"event": "referenced",
"id": 1948183858,
"node_id": "MDE1OlJlZmVyZW5jZWRFdmVudDE5NDgxODM4NTg=",
"url": "https://api.github.com/repos/program-in-chinese/webextension_github_code_translator/issues/events/1948183858"
},
{
"actor": {
"avatar_url": "https://avatars1.githubusercontent.com/u/392497?v=4",
"events_url": "https://api.github.com/users/nobodxbodon/events{/privacy}",
"followers_url": "https://api.github.com/users/nobodxbodon/followers",
"following_url": "https://api.github.com/users/nobodxbodon/following{/other_user}",
"gists_url": "https://api.github.com/users/nobodxbodon/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nobodxbodon",
"id": 392497,
"login": "nobodxbodon",
"node_id": "MDQ6VXNlcjM5MjQ5Nw==",
"organizations_url": "https://api.github.com/users/nobodxbodon/orgs",
"received_events_url": "https://api.github.com/users/nobodxbodon/received_events",
"repos_url": "https://api.github.com/users/nobodxbodon/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nobodxbodon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nobodxbodon/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nobodxbodon"
},
"commit_id": null,
"commit_url": null,
"created_at": "2018-11-06T07:26:27Z",
"event": "closed",
"id": 1948184608,
"node_id": "MDExOkNsb3NlZEV2ZW50MTk0ODE4NDYwOA==",
"url": "https://api.github.com/repos/program-in-chinese/webextension_github_code_translator/issues/events/1948184608"
}
],
"events_url": "https://api.github.com/repos/program-in-chinese/webextension_github_code_translator/issues/21/events",
"html_url": "https://github.com/program-in-chinese/webextension_github_code_translator/issues/21",
"id": 377677933,
"labels": [],
"labels_url": "https://api.github.com/repos/program-in-chinese/webextension_github_code_translator/issues/21/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "MDU6SXNzdWUzNzc2Nzc5MzM=",
"number": 21,
"repository_url": "https://api.github.com/repos/program-in-chinese/webextension_github_code_translator",
"state": "closed",
"title": "移植到火狐-sendMessage接口问题",
"updated_at": "2018-11-06T07:26:27Z",
"url": "https://api.github.com/repos/program-in-chinese/webextension_github_code_translator/issues/21",
"user": {
"avatar_url": "https://avatars1.githubusercontent.com/u/392497?v=4",
"events_url": "https://api.github.com/users/nobodxbodon/events{/privacy}",
"followers_url": "https://api.github.com/users/nobodxbodon/followers",
"following_url": "https://api.github.com/users/nobodxbodon/following{/other_user}",
"gists_url": "https://api.github.com/users/nobodxbodon/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nobodxbodon",
"id": 392497,
"login": "nobodxbodon",
"node_id": "MDQ6VXNlcjM5MjQ5Nw==",
"organizations_url": "https://api.github.com/users/nobodxbodon/orgs",
"received_events_url": "https://api.github.com/users/nobodxbodon/received_events",
"repos_url": "https://api.github.com/users/nobodxbodon/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nobodxbodon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nobodxbodon/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nobodxbodon"
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2009-2020 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#import "OCMNonRetainingObjectReturnValueProvider.h"
@interface OCMObjectReturnValueProvider : OCMNonRetainingObjectReturnValueProvider
@end
|
{
"pile_set_name": "Github"
}
|
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1000011713906408}
m_IsPrefabParent: 1
--- !u!1 &1000010121767078
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4000010675212776}
- component: {fileID: 33000013320244746}
- component: {fileID: 65000012970724804}
- component: {fileID: 23000013866804616}
- component: {fileID: 114672892898193146}
- component: {fileID: 114000010601737356}
m_Layer: 0
m_Name: SliderBar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000011042864930
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4000012498519616}
- component: {fileID: 33000010600070742}
- component: {fileID: 23000012779802454}
- component: {fileID: 114980341250394410}
- component: {fileID: 114000012235487670}
m_Layer: 0
m_Name: RadialDot
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000011061344986
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4000012298272130}
- component: {fileID: 23000012509494062}
- component: {fileID: 102000012231550748}
- component: {fileID: 114321418761329558}
- component: {fileID: 114623199245567628}
m_Layer: 0
m_Name: Label
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000011534470254
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4000014133338102}
- component: {fileID: 33000012126784930}
- component: {fileID: 23000012600065236}
- component: {fileID: 114769760815125994}
- component: {fileID: 114000013916789966}
m_Layer: 0
m_Name: SliderFill
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000011713906408
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4000011864058216}
- component: {fileID: 65000010555128124}
- component: {fileID: 114000013549609426}
- component: {fileID: 114832887752031510}
m_Layer: 0
m_Name: ThresholdFilter
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000012031565074
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4000010414788424}
- component: {fileID: 33000012419677878}
- component: {fileID: 23000010337410676}
- component: {fileID: 114198075660001614}
- component: {fileID: 114000012151299866}
- component: {fileID: 114396711802821738}
m_Layer: 0
m_Name: SliderKnob
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1011959923585164
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4038079255161038}
m_Layer: 0
m_Name: Fill
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1095681604968566
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4455063696493408}
- component: {fileID: 114922840319301710}
m_Layer: 0
m_Name: Bar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1106716950969414
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4566048139154272}
- component: {fileID: 114240541300402256}
- component: {fileID: 114451379618091290}
m_Layer: 0
m_Name: Label
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!1 &1430815934634814
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4633890879316520}
- component: {fileID: 23619300927663390}
- component: {fileID: 102548528768681692}
m_Layer: 0
m_Name: ThresholdFilterMinLabel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1652165976381776
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4376527360170534}
- component: {fileID: 33653214736067886}
- component: {fileID: 23549216339498824}
- component: {fileID: 114055675703727026}
- component: {fileID: 114571738148586272}
- component: {fileID: 114786579803321616}
m_Layer: 0
m_Name: SliderKnob
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1674507656696820
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4270623259448474}
- component: {fileID: 114606406977787976}
- component: {fileID: 114425133298623510}
m_Layer: 0
m_Name: Knob
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1696105059646474
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4419550589043952}
- component: {fileID: 23742236937478772}
- component: {fileID: 102610020375770110}
m_Layer: 0
m_Name: ThresholdFilterLabel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1793365000655526
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4441277567044794}
- component: {fileID: 23626013555151742}
- component: {fileID: 102256055155150630}
- component: {fileID: 114956078592679088}
- component: {fileID: 114130697557592718}
m_Layer: 0
m_Name: Label
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1955551686510036
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4384348759388260}
- component: {fileID: 114039196419911652}
m_Layer: 0
m_Name: SliderThemes
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1988873229188306
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4984588785767286}
- component: {fileID: 23453706296202282}
- component: {fileID: 102477725371406470}
m_Layer: 0
m_Name: ThresholdFilterMaxLabel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4000010414788424
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000012031565074}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.010159969}
m_LocalScale: {x: 1, y: 1, z: 1.5}
m_Children:
- {fileID: 4000012298272130}
m_Father: {fileID: 4000010675212776}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4000010675212776
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010121767078}
m_LocalRotation: {x: 0.00000008146034, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.25, y: 0.25, z: 0.25}
m_Children:
- {fileID: 4000014133338102}
- {fileID: 4000012498519616}
- {fileID: 4000010414788424}
- {fileID: 4376527360170534}
m_Father: {fileID: 4000011864058216}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4000011864058216
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011713906408}
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: 4384348759388260}
- {fileID: 4000010675212776}
- {fileID: 4633890879316520}
- {fileID: 4984588785767286}
- {fileID: 4419550589043952}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4000012298272130
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011061344986}
m_LocalRotation: {x: 0.00000008146034, y: -0, z: -0, w: -1}
m_LocalPosition: {x: 0, y: 0.13, z: -0.007}
m_LocalScale: {x: 0.02, y: 0.020000014, z: 0.013333341}
m_Children: []
m_Father: {fileID: 4000010414788424}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!4 &4000012498519616
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011042864930}
m_LocalRotation: {x: -0, y: 1, z: -0.00000008146034, w: 0}
m_LocalPosition: {x: 0, y: -0.0005999753, z: 0.031000137}
m_LocalScale: {x: 0.6, y: 0.6, z: 3.5}
m_Children: []
m_Father: {fileID: 4000010675212776}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4000014133338102
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011534470254}
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: 4000010675212776}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4038079255161038
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1011959923585164}
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: 4384348759388260}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4270623259448474
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1674507656696820}
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: 4384348759388260}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4376527360170534
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1652165976381776}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.010159969}
m_LocalScale: {x: 1, y: 1, z: 1.5}
m_Children:
- {fileID: 4441277567044794}
m_Father: {fileID: 4000010675212776}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4384348759388260
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1955551686510036}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.096509546, y: 0.18570408, z: 0.041978717}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4038079255161038}
- {fileID: 4455063696493408}
- {fileID: 4566048139154272}
- {fileID: 4270623259448474}
m_Father: {fileID: 4000011864058216}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4419550589043952
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1696105059646474}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.0578, z: 0}
m_LocalScale: {x: 0.005, y: 0.005, z: 0.005}
m_Children: []
m_Father: {fileID: 4000011864058216}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4441277567044794
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1793365000655526}
m_LocalRotation: {x: 0.00000008146034, y: -0, z: -0, w: -1}
m_LocalPosition: {x: 0, y: 0.13, z: -0.007}
m_LocalScale: {x: 0.02, y: 0.020000014, z: 0.013333341}
m_Children: []
m_Father: {fileID: 4376527360170534}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!4 &4455063696493408
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1095681604968566}
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: 4384348759388260}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4566048139154272
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1106716950969414}
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: 4384348759388260}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4633890879316520
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1430815934634814}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.1422, y: 0.0019, z: 0}
m_LocalScale: {x: 0.005, y: 0.005, z: 0.005}
m_Children: []
m_Father: {fileID: 4000011864058216}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4984588785767286
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1988873229188306}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.1445, y: 0.0019, z: 0}
m_LocalScale: {x: 0.005, y: 0.005, z: 0.005}
m_Children: []
m_Father: {fileID: 4000011864058216}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &23000010337410676
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000012031565074}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: ab4e6ac398d56bd47a9b077bebd667b6, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23000012509494062
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011061344986}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 636cd3603c4bfcd4e8a12d4f6fb90c89, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23000012600065236
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011534470254}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: dbdaa5ab3d62f9f49956382f1f0bb408, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23000012779802454
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011042864930}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 691f49469a961fa46b668c6ce062cd63, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23000013866804616
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010121767078}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 48421763f41687f4ba29fc323c69abd0, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23453706296202282
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1988873229188306}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 1017ef825d041c749bab30bf03aca0d3, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23549216339498824
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1652165976381776}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: ab4e6ac398d56bd47a9b077bebd667b6, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23619300927663390
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1430815934634814}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 1017ef825d041c749bab30bf03aca0d3, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23626013555151742
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1793365000655526}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 636cd3603c4bfcd4e8a12d4f6fb90c89, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23742236937478772
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1696105059646474}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 1017ef825d041c749bab30bf03aca0d3, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &33000010600070742
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011042864930}
m_Mesh: {fileID: 4300014, guid: 61a6f0d3d48e97148991dd176179e9ca, type: 3}
--- !u!33 &33000012126784930
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011534470254}
m_Mesh: {fileID: 4300026, guid: 61a6f0d3d48e97148991dd176179e9ca, type: 3}
--- !u!33 &33000012419677878
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000012031565074}
m_Mesh: {fileID: 4300024, guid: 61a6f0d3d48e97148991dd176179e9ca, type: 3}
--- !u!33 &33000013320244746
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010121767078}
m_Mesh: {fileID: 4300022, guid: 61a6f0d3d48e97148991dd176179e9ca, type: 3}
--- !u!33 &33653214736067886
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1652165976381776}
m_Mesh: {fileID: 4300024, guid: 61a6f0d3d48e97148991dd176179e9ca, type: 3}
--- !u!65 &65000010555128124
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011713906408}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.24, y: 0.05, z: 0.025}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65000012970724804
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010121767078}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.88, y: 0.18, z: 0.08}
m_Center: {x: 0, y: 4.656613e-10, z: 0.01016}
--- !u!102 &102000012231550748
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011061344986}
m_Text: 50
m_OffsetZ: 0
m_CharacterSize: 1
m_LineSpacing: 1
m_Anchor: 4
m_Alignment: 1
m_TabSize: 4
m_FontSize: 42
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 12800000, guid: 86574c70442309b45be5a1c37a37a40b, type: 3}
m_Color:
serializedVersion: 2
rgba: 4292335575
--- !u!102 &102256055155150630
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1793365000655526}
m_Text: 50
m_OffsetZ: 0
m_CharacterSize: 1
m_LineSpacing: 1
m_Anchor: 4
m_Alignment: 1
m_TabSize: 4
m_FontSize: 42
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 12800000, guid: 86574c70442309b45be5a1c37a37a40b, type: 3}
m_Color:
serializedVersion: 2
rgba: 4292335575
--- !u!102 &102477725371406470
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1988873229188306}
m_Text: max
m_OffsetZ: 0
m_CharacterSize: 1
m_LineSpacing: 1
m_Anchor: 4
m_Alignment: 1
m_TabSize: 4
m_FontSize: 48
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 12800000, guid: 86574c70442309b45be5a1c37a37a40b, type: 3}
m_Color:
serializedVersion: 2
rgba: 4294967295
--- !u!102 &102548528768681692
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1430815934634814}
m_Text: min
m_OffsetZ: 0
m_CharacterSize: 1
m_LineSpacing: 1
m_Anchor: 4
m_Alignment: 1
m_TabSize: 4
m_FontSize: 48
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 12800000, guid: 86574c70442309b45be5a1c37a37a40b, type: 3}
m_Color:
serializedVersion: 2
rgba: 4294967295
--- !u!102 &102610020375770110
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1696105059646474}
m_Text: Threshold Filter
m_OffsetZ: 0
m_CharacterSize: 1
m_LineSpacing: 1
m_Anchor: 4
m_Alignment: 1
m_TabSize: 4
m_FontSize: 48
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 12800000, guid: 86574c70442309b45be5a1c37a37a40b, type: 3}
m_Color:
serializedVersion: 2
rgba: 4294967295
--- !u!114 &114000010601737356
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010121767078}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c76a36955929b694bb2433ceb5357980, type: 3}
m_Name:
m_EditorClassIdentifier:
TargetObject: {fileID: 0}
TransitionTime: 0.25
SmoothTransition: 1
--- !u!114 &114000012151299866
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000012031565074}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c76a36955929b694bb2433ceb5357980, type: 3}
m_Name:
m_EditorClassIdentifier:
TargetObject: {fileID: 0}
TransitionTime: 0.25
SmoothTransition: 1
--- !u!114 &114000012235487670
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011042864930}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c76a36955929b694bb2433ceb5357980, type: 3}
m_Name:
m_EditorClassIdentifier:
TargetObject: {fileID: 0}
TransitionTime: 0.25
SmoothTransition: 1
--- !u!114 &114000013549609426
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011713906408}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 71b5c94b2db7fb646b5a369ac83cf7aa, type: 3}
m_Name:
m_EditorClassIdentifier:
ParentObject: {fileID: 0}
IsEnabled: 0
DetectHold: 0
HoldTime: 0.5
RollOffTime: 0.02
Keyword:
KeywordRequiresGaze: 0
OnSelectEvents:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
OnDownEvent:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
OnHoldEvent:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
StartDelay: 0
Control: {fileID: 114832887752031510}
HideCursorOnManipulation: 0
--- !u!114 &114000013916789966
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011534470254}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c76a36955929b694bb2433ceb5357980, type: 3}
m_Name:
m_EditorClassIdentifier:
TargetObject: {fileID: 0}
TransitionTime: 0.25
SmoothTransition: 1
--- !u!114 &114039196419911652
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1955551686510036}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9bd20823c70902f4a9d1d7a7daaf96f2, type: 3}
m_Name:
m_EditorClassIdentifier:
Tag: defaultColor
Default: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
Focus: {r: 0.9019608, g: 0.9019608, b: 0.9019608, a: 1}
Press: {r: 0.7019608, g: 0.7019608, b: 0.7019608, a: 1}
Selected: {r: 0.06666667, g: 0.6117647, b: 0.8745098, a: 1}
FocusSelected: {r: 0.29411766, g: 0.7607843, b: 0.9843137, a: 1}
PressSelected: {r: 0.14509805, g: 0.5058824, b: 0.68235296, a: 1}
Disabled: {r: 0.3529412, g: 0.3529412, b: 0.3529412, a: 1}
DisabledSelected: {r: 0.3529412, g: 0.3529412, b: 0.3529412, a: 1}
CurrentValue: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
Button: {fileID: 0}
--- !u!114 &114055675703727026
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1652165976381776}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9c6c86add047f7e498462872cc4a1979, type: 3}
m_Name:
m_EditorClassIdentifier:
InteractiveHost: {fileID: 0}
ColorThemeTag: sliderKnobColor
PositionThemeTag:
ScaleThemeTag: sliderKnobScale
ColorBlender: {fileID: 114571738148586272}
MovePosition: {fileID: 0}
ScaleSize: {fileID: 114786579803321616}
--- !u!114 &114130697557592718
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1793365000655526}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f2b03bcc7db83ce4d8233fcc4ae4ec2a, type: 3}
m_Name:
m_EditorClassIdentifier:
TargetObject: {fileID: 0}
TargetValue: {x: 0, y: 0, z: 0}
LerpType: 0
LerpTime: 0.25
IsRunning: 0
ToLocalTransform: 1
OnComplete:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &114198075660001614
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000012031565074}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9c6c86add047f7e498462872cc4a1979, type: 3}
m_Name:
m_EditorClassIdentifier:
InteractiveHost: {fileID: 0}
ColorThemeTag: sliderKnobColor
PositionThemeTag:
ScaleThemeTag: sliderKnobScale
ColorBlender: {fileID: 114000012151299866}
MovePosition: {fileID: 0}
ScaleSize: {fileID: 114396711802821738}
--- !u!114 &114240541300402256
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1106716950969414}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9bd20823c70902f4a9d1d7a7daaf96f2, type: 3}
m_Name:
m_EditorClassIdentifier:
Tag: sliderLabelColor
Default: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
Focus: {r: 0.9019608, g: 0.9019608, b: 0.9019608, a: 1}
Press: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
Selected: {r: 0.9019608, g: 0.9019608, b: 0.9019608, a: 1}
FocusSelected: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
PressSelected: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
Disabled: {r: 0.5882353, g: 0.5882353, b: 0.5882353, a: 1}
DisabledSelected: {r: 0.5882353, g: 0.5882353, b: 0.5882353, a: 1}
CurrentValue: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
Button: {fileID: 0}
--- !u!114 &114321418761329558
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011061344986}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2511acdefd075154eb81faf90c1ae164, type: 3}
m_Name:
m_EditorClassIdentifier:
InteractiveHost: {fileID: 0}
ButtonLabels: {fileID: 0}
ColorThemeTag: sliderLabelColor
PositionThemeTag: sliderLabelPosition
MovePosition: {fileID: 114623199245567628}
--- !u!114 &114396711802821738
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000012031565074}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 520ececd0ff1e964894362e9a885b962, type: 3}
m_Name:
m_EditorClassIdentifier:
TargetObject: {fileID: 0}
TargetValue: {x: 0, y: 0, z: 0}
LerpType: 0
LerpTime: 0.25
IsRunning: 0
OnComplete:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &114425133298623510
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1674507656696820}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 08fb64812c09ab9448331612dd7c6f8d, type: 3}
m_Name:
m_EditorClassIdentifier:
Tag: sliderKnobScale
Default: {x: 1, y: 1, z: 1.5}
Focus: {x: 1, y: 1, z: 1.5}
Press: {x: 1, y: 1, z: 1}
Selected: {x: 1, y: 1, z: 1.5}
FocusSelected: {x: 1, y: 1, z: 1.5}
PressSelected: {x: 1, y: 1, z: 1}
Disabled: {x: 1, y: 1, z: 1.5}
DisabledSelected: {x: 1, y: 1, z: 1.5}
CurrentValue: {x: 1, y: 1, z: 1}
Button: {fileID: 0}
--- !u!114 &114451379618091290
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1106716950969414}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 08fb64812c09ab9448331612dd7c6f8d, type: 3}
m_Name:
m_EditorClassIdentifier:
Tag: sliderLabelPosition
Default: {x: -0.0071, y: 0.1445, z: 0.01}
Focus: {x: -0.0071, y: 0.1445, z: -0.02}
Press: {x: -0.0071, y: 0.1445, z: 0.02}
Selected: {x: -0.0071, y: 0.1445, z: 0.01}
FocusSelected: {x: -0.0071, y: 0.1445, z: -0.02}
PressSelected: {x: -0.0071, y: 0.1445, z: 0.02}
Disabled: {x: -0.0071, y: 0.1445, z: 0.01}
DisabledSelected: {x: -0.0071, y: 0.1445, z: 0.01}
CurrentValue: {x: 0, y: 0, z: 0}
Button: {fileID: 0}
--- !u!114 &114571738148586272
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1652165976381776}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c76a36955929b694bb2433ceb5357980, type: 3}
m_Name:
m_EditorClassIdentifier:
TargetObject: {fileID: 0}
TransitionTime: 0.25
SmoothTransition: 1
--- !u!114 &114606406977787976
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1674507656696820}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9bd20823c70902f4a9d1d7a7daaf96f2, type: 3}
m_Name:
m_EditorClassIdentifier:
Tag: sliderKnobColor
Default: {r: 0.7294118, g: 0.16078432, b: 0.16078432, a: 1}
Focus: {r: 0.7294118, g: 0.19607843, b: 0.19607843, a: 1}
Press: {r: 0.7294118, g: 0.27450982, b: 0.27450982, a: 1}
Selected: {r: 0.7294118, g: 0.16078432, b: 0.16078432, a: 1}
FocusSelected: {r: 0.7294118, g: 0.19607843, b: 0.19607843, a: 1}
PressSelected: {r: 0.7294118, g: 0.27450982, b: 0.27450982, a: 1}
Disabled: {r: 0.7294118, g: 0.16078432, b: 0.16078432, a: 1}
DisabledSelected: {r: 0.7294118, g: 0.16078432, b: 0.16078432, a: 1}
CurrentValue: {r: 0.7294118, g: 0.16078432, b: 0.16078432, a: 1}
Button: {fileID: 0}
--- !u!114 &114623199245567628
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011061344986}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f2b03bcc7db83ce4d8233fcc4ae4ec2a, type: 3}
m_Name:
m_EditorClassIdentifier:
TargetObject: {fileID: 0}
TargetValue: {x: 0, y: 0, z: 0}
LerpType: 0
LerpTime: 0.25
IsRunning: 0
ToLocalTransform: 1
OnComplete:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &114672892898193146
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010121767078}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9c6c86add047f7e498462872cc4a1979, type: 3}
m_Name:
m_EditorClassIdentifier:
InteractiveHost: {fileID: 0}
ColorThemeTag: sliderBarColor
PositionThemeTag:
ScaleThemeTag:
ColorBlender: {fileID: 114000010601737356}
MovePosition: {fileID: 0}
ScaleSize: {fileID: 0}
--- !u!114 &114769760815125994
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011534470254}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9c6c86add047f7e498462872cc4a1979, type: 3}
m_Name:
m_EditorClassIdentifier:
InteractiveHost: {fileID: 0}
ColorThemeTag: sliderFillColor
PositionThemeTag:
ScaleThemeTag:
ColorBlender: {fileID: 114000013916789966}
MovePosition: {fileID: 0}
ScaleSize: {fileID: 0}
--- !u!114 &114786579803321616
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1652165976381776}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 520ececd0ff1e964894362e9a885b962, type: 3}
m_Name:
m_EditorClassIdentifier:
TargetObject: {fileID: 0}
TargetValue: {x: 0, y: 0, z: 0}
LerpType: 0
LerpTime: 0.25
IsRunning: 0
OnComplete:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &114832887752031510
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011713906408}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 78b3d817d5ff52548a5f061721f575d0, type: 3}
m_Name:
m_EditorClassIdentifier:
GestureData: 1
MaxGestureDistance: 0.25
AlignmentVector: {x: 1, y: 1, z: 1}
FlipDirectionOnCameraForward: 0
SliderBar: {fileID: 1000010121767078}
first_Knob: {fileID: 1000012031565074}
second_Knob: {fileID: 1652165976381776}
SliderFill: {fileID: 1000011534470254}
Label1: {fileID: 102000012231550748}
Label2: {fileID: 102256055155150630}
CenteredDot: {fileID: 1000011042864930}
OnUpdateEvent:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
MinSliderValue: 0
MaxSliderValue: 10
Centered: 0
LabelFormat: 000
--- !u!114 &114922840319301710
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1095681604968566}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9bd20823c70902f4a9d1d7a7daaf96f2, type: 3}
m_Name:
m_EditorClassIdentifier:
Tag: sliderBarColor
Default: {r: 0.3529412, g: 0.3529412, b: 0.3529412, a: 1}
Focus: {r: 0.7019608, g: 0.7019608, b: 0.7019608, a: 1}
Press: {r: 0.5882353, g: 0.5882353, b: 0.5882353, a: 1}
Selected: {r: 0.50980395, g: 0.50980395, b: 0.50980395, a: 1}
FocusSelected: {r: 0.7019608, g: 0.7019608, b: 0.7019608, a: 1}
PressSelected: {r: 0.5882353, g: 0.5882353, b: 0.5882353, a: 1}
Disabled: {r: 0.3529412, g: 0.3529412, b: 0.3529412, a: 1}
DisabledSelected: {r: 0.3529412, g: 0.3529412, b: 0.3529412, a: 1}
CurrentValue: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
Button: {fileID: 0}
--- !u!114 &114956078592679088
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1793365000655526}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2511acdefd075154eb81faf90c1ae164, type: 3}
m_Name:
m_EditorClassIdentifier:
InteractiveHost: {fileID: 0}
ButtonLabels: {fileID: 0}
ColorThemeTag: sliderLabelColor
PositionThemeTag: sliderLabelPosition
MovePosition: {fileID: 114130697557592718}
--- !u!114 &114980341250394410
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011042864930}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9c6c86add047f7e498462872cc4a1979, type: 3}
m_Name:
m_EditorClassIdentifier:
InteractiveHost: {fileID: 0}
ColorThemeTag: sliderKnobColor
PositionThemeTag:
ScaleThemeTag:
ColorBlender: {fileID: 114000012235487670}
MovePosition: {fileID: 0}
ScaleSize: {fileID: 0}
|
{
"pile_set_name": "Github"
}
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef SHERLOCK_SCALPEL_TSAGE_LOGO_H
#define SHERLOCK_SCALPEL_TSAGE_LOGO_H
#include "common/scummsys.h"
#include "common/array.h"
#include "common/file.h"
#include "common/list.h"
#include "common/str.h"
#include "common/str-array.h"
#include "common/util.h"
#include "graphics/surface.h"
#include "sherlock/scalpel/tsage/resources.h"
#include "sherlock/screen.h"
namespace Sherlock {
namespace Scalpel {
class ScalpelEngine;
namespace TsAGE {
class ObjectSurface : public Surface {
public:
Common::Point _centroid;
public:
ObjectSurface() : Surface() {}
~ObjectSurface() override {}
};
class Visage {
private:
Common::SeekableReadStream *_stream;
/**
* Translates a raw image resource into a graphics surface
*/
void surfaceFromRes(ObjectSurface &s);
public:
static TLib *_tLib;
int _resNum;
int _rlbNum;
public:
Visage();
~Visage();
/**
* Set the visage number
*/
void setVisage(int resNum, int rlbNum = 9999);
/**
* Clear the visage
*/
void clear();
/**
* Get a frame from the visage
*/
void getFrame(ObjectSurface &s, int frameNum);
/**
* Return the number of frames
*/
int getFrameCount() const;
/**
* Returns whether the visage is loaded
*/
bool isLoaded() const;
};
class Object {
private:
Visage _visage;
uint32 _updateStartFrame;
bool _isAnimating;
bool _finished;
uint32 _walkStartFrame;
int _angle;
int _changeCtr;
int _majorDiff, _minorDiff;
Common::Point _moveDelta;
Common::Point _moveSign;
/**
* Return the next frame when the object is animating
*/
int changeFrame();
/**
* Gets the next frame in the sequence
*/
int getNewFrame();
/**
* Calculate the angle between the current position and a designated destination
*/
void calculateMoveAngle();
/**
* Handle any object movement
*/
void move();
/**
* Returns whether not to make any movement
*/
bool dontMove() const;
/**
* Ends any current movement
*/
void endMove();
public:
static ScalpelEngine *_vm;
Common::Point _position;
Common::Point _destination;
Common::Rect _oldBounds;
int _frame;
int _numFrames;
int _frameChange;
public:
Object();
/**
* Load the data for the object
*/
void setVisage(int visage, int strip);
/**
* Sets whether the object is animating
*/
void setAnimMode(bool isAnimating);
/**
* Starts an object moving to a given destination
*/
void setDestination(const Common::Point &pt);
/**
* Returns true if an animation is ended
*/
bool isAnimEnded() const;
/**
* Return true if object is moving
*/
bool isMoving() const;
/**
* Erase the area the object was previously drawn at, by restoring the background
*/
void erase();
/**
* Update the frame
*/
void update();
/**
* Remove an object from being displayed
*/
void remove() { _visage.clear(); }
};
struct AnimationFrame {
int frame;
int x;
int y;
};
class Logo {
private:
ScalpelEngine *_vm;
TLib _lib;
int _counter, _frameCounter;
bool _finished;
byte _originalPalette[PALETTE_SIZE];
byte _palette1[PALETTE_SIZE];
byte _palette2[PALETTE_SIZE];
byte _palette3[PALETTE_SIZE];
Object _objects[4];
uint _waitFrames;
uint32 _waitStartFrame;
int _animateObject;
uint32 _animateStartFrame;
uint _animateFrameDelay;
const AnimationFrame *_animateFrames;
uint _animateFrame;
Logo(ScalpelEngine *vm);
~Logo();
void nextFrame();
bool finished() const;
/**
* Wait for a number of frames. Note that the frame count in _events is
* not the same as the number of calls to nextFrame().
*/
void waitFrames(uint frames);
/**
* Start an animation sequence. Used for sequences that are described
* one frame at a time because they do unusual things, or run at
* unusual rates.
*/
void startAnimation(uint object, uint frameDelay, const AnimationFrame *frames);
/**
* Load the background for the scene
*/
void loadBackground();
/**
* Fade from the current palette to a new one
*/
void fade(const byte palette[PALETTE_SIZE], int step = 6);
public:
static bool show(ScalpelEngine *vm);
};
} // end of namespace TsAGE
} // end of namespace Scalpel
} // end of namespace Sherlock
#endif
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright Terracotta, 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.
*/
package org.ehcache.transactions.xa.internal.journal;
import org.ehcache.CachePersistenceException;
import org.ehcache.core.spi.service.DiskResourceService;
import org.ehcache.spi.persistence.PersistableResourceService;
import org.ehcache.spi.service.ServiceDependencies;
import org.ehcache.spi.service.ServiceProvider;
import org.ehcache.spi.serialization.Serializer;
import org.ehcache.core.spi.service.FileBasedPersistenceContext;
import org.ehcache.spi.service.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Ludovic Orban
*/
@ServiceDependencies(DiskResourceService.class)
public class DefaultJournalProvider implements JournalProvider {
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultJournalProvider.class);
private volatile DiskResourceService diskResourceService;
@Override
public void start(ServiceProvider<Service> serviceProvider) {
this.diskResourceService = serviceProvider.getService(DiskResourceService.class);
}
@Override
public void stop() {
this.diskResourceService = null;
}
@Override
public <K> Journal<K> getJournal(PersistableResourceService.PersistenceSpaceIdentifier<?> persistentSpaceId, Serializer<K> keySerializer) {
if (persistentSpaceId == null) {
LOGGER.info("Using transient XAStore journal");
return new TransientJournal<>();
}
try {
LOGGER.info("Using persistent XAStore journal");
FileBasedPersistenceContext persistenceContext = diskResourceService.createPersistenceContextWithin(persistentSpaceId, "XAJournal");
return new PersistentJournal<>(persistenceContext.getDirectory(), keySerializer);
} catch (CachePersistenceException cpe) {
throw new RuntimeException(cpe);
}
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* linux/net/sunrpc/sunrpc_syms.c
*
* Symbols exported by the sunrpc module.
*
* Copyright (C) 1997 Olaf Kirch <[email protected]>
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/uio.h>
#include <linux/unistd.h>
#include <linux/init.h>
#include <linux/sunrpc/sched.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/svcsock.h>
#include <linux/sunrpc/auth.h>
#include <linux/workqueue.h>
#include <linux/sunrpc/rpc_pipe_fs.h>
#include <linux/sunrpc/xprtsock.h>
extern struct cache_detail ip_map_cache, unix_gid_cache;
extern void cleanup_rpcb_clnt(void);
static int __init
init_sunrpc(void)
{
int err = register_rpc_pipefs();
if (err)
goto out;
err = rpc_init_mempool();
if (err) {
unregister_rpc_pipefs();
goto out;
}
#ifdef RPC_DEBUG
rpc_register_sysctl();
#endif
#ifdef CONFIG_PROC_FS
rpc_proc_init();
#endif
cache_register(&ip_map_cache);
cache_register(&unix_gid_cache);
svc_init_xprt_sock(); /* svc sock transport */
init_socket_xprt(); /* clnt sock transport */
rpcauth_init_module();
out:
return err;
}
static void __exit
cleanup_sunrpc(void)
{
cleanup_rpcb_clnt();
rpcauth_remove_module();
cleanup_socket_xprt();
svc_cleanup_xprt_sock();
unregister_rpc_pipefs();
rpc_destroy_mempool();
cache_unregister(&ip_map_cache);
cache_unregister(&unix_gid_cache);
#ifdef RPC_DEBUG
rpc_unregister_sysctl();
#endif
#ifdef CONFIG_PROC_FS
rpc_proc_exit();
#endif
rcu_barrier(); /* Wait for completion of call_rcu()'s */
}
MODULE_LICENSE("GPL");
fs_initcall(init_sunrpc); /* Ensure we're initialised before nfs */
module_exit(cleanup_sunrpc);
|
{
"pile_set_name": "Github"
}
|
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
class A {
protocol A
func e(x: A
where
protocol A : Array a
protocol A : d {
func d
|
{
"pile_set_name": "Github"
}
|
// A Squeak VM for RiscOS machines
// Suited to RISC OS > 4, preferably > 5
// See www.squeak.org for much more information
//
// tim Rowledge [email protected]
//
// License: MIT License -
// Copyright (C) <2013> <tim rowledge>
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
#include <stdio.h>
/* duh ... this is ugly */
#define XFN(export) {"", #export, (void*)export},
#define XFND(export,depth) {"", #export "\000" depth, (void*)export},
extern void setSocketPollFunction(int spf );
void *os_exports[][3] = {
XFN(setSocketPollFunction)
{NULL, NULL, NULL}
};
|
{
"pile_set_name": "Github"
}
|
{
"kind": "webfonts#webfont",
"family": "M PLUS Rounded 1c",
"category": "sans-serif",
"variants": ["100", "300", "regular", "500", "700", "800", "900"],
"subsets": [
"cyrillic",
"cyrillic-ext",
"greek",
"greek-ext",
"hebrew",
"japanese",
"latin",
"latin-ext",
"vietnamese"
],
"version": "v10",
"lastModified": "2019-11-05",
"files": {
"100": "http://fonts.gstatic.com/s/mplusrounded1c/v10/VdGCAYIAV6gnpUpoWwNkYvrugw9RuM3ixLsg6-av1x0.ttf",
"300": "http://fonts.gstatic.com/s/mplusrounded1c/v10/VdGBAYIAV6gnpUpoWwNkYvrugw9RuM0q5psKxeqmzgRK.ttf",
"500": "http://fonts.gstatic.com/s/mplusrounded1c/v10/VdGBAYIAV6gnpUpoWwNkYvrugw9RuM1y55sKxeqmzgRK.ttf",
"700": "http://fonts.gstatic.com/s/mplusrounded1c/v10/VdGBAYIAV6gnpUpoWwNkYvrugw9RuM064ZsKxeqmzgRK.ttf",
"800": "http://fonts.gstatic.com/s/mplusrounded1c/v10/VdGBAYIAV6gnpUpoWwNkYvrugw9RuM0m4psKxeqmzgRK.ttf",
"900": "http://fonts.gstatic.com/s/mplusrounded1c/v10/VdGBAYIAV6gnpUpoWwNkYvrugw9RuM0C45sKxeqmzgRK.ttf",
"regular": "http://fonts.gstatic.com/s/mplusrounded1c/v10/VdGEAYIAV6gnpUpoWwNkYvrugw9RuPWGzr8C7vav.ttf"
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright 2013-2019 the original author or authors from the Jeddict project (https://jeddict.github.io/).
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package io.github.jeddict.orm.generator.compiler.constraints;
import io.github.jeddict.bv.constraints.Valid;
import io.github.jeddict.orm.generator.compiler.InvalidDataException;
import java.util.Collection;
import static java.util.Collections.singleton;
/**
*
* @author Gaurav Gupta
*/
public class ValidSnippet extends ConstraintSnippet<Valid> {
public ValidSnippet(Valid valid) {
super(valid);
}
@Override
protected String getAPI() {
return "Valid";
}
@Override
public Collection<String> getImportSnippets() throws InvalidDataException {
return singleton("javax.validation." + getAPI());
}
}
|
{
"pile_set_name": "Github"
}
|
/****************************************************************************
**
** https://www.qxorm.com/
** Copyright (C) 2013 Lionel Marty ([email protected])
**
** This file is part of the QxOrm library
**
** This software is provided 'as-is', without any express or implied
** warranty. In no event will the authors be held liable for any
** damages arising from the use of this software
**
** Commercial Usage
** Licensees holding valid commercial QxOrm licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Lionel Marty
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file 'license.gpl3.txt' included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met : http://www.gnu.org/copyleft/gpl.html
**
** If you are unsure which license is appropriate for your use, or
** if you have questions regarding the use of this file, please contact :
** [email protected]
**
****************************************************************************/
#ifndef _QX_IS_STD_UNORDERED_SET_H_
#define _QX_IS_STD_UNORDERED_SET_H_
#ifdef _MSC_VER
#pragma once
#endif
/*!
* \file is_std_unordered_set.h
* \author Lionel Marty
* \ingroup QxTraits
* \brief qx::trait::is_std_unordered_set<T>::value : return true if T is a std::unordered_set<> or std::unordered_multiset<> container, otherwise return false
*/
#include <unordered_set>
namespace qx {
namespace trait {
/*!
* \ingroup QxTraits
* \brief qx::trait::is_std_unordered_set<T>::value : return true if T is a std::unordered_set<> or std::unordered_multiset<> container, otherwise return false
*/
template <typename T>
struct is_std_unordered_set : public std::false_type { ; };
template <typename T>
struct is_std_unordered_set< std::unordered_set<T> > : public std::true_type { ; };
template <typename T>
struct is_std_unordered_set< std::unordered_set<T> & > : public std::true_type { ; };
template <typename T>
struct is_std_unordered_set< const std::unordered_set<T> > : public std::true_type { ; };
template <typename T>
struct is_std_unordered_set< const std::unordered_set<T> & > : public std::true_type { ; };
template <typename T>
struct is_std_unordered_set< std::unordered_multiset<T> > : public std::true_type { ; };
template <typename T>
struct is_std_unordered_set< std::unordered_multiset<T> & > : public std::true_type { ; };
template <typename T>
struct is_std_unordered_set< const std::unordered_multiset<T> > : public std::true_type { ; };
template <typename T>
struct is_std_unordered_set< const std::unordered_multiset<T> & > : public std::true_type { ; };
} // namespace trait
} // namespace qx
#endif // _QX_IS_STD_UNORDERED_SET_H_
|
{
"pile_set_name": "Github"
}
|
#!/bin/bash
#
# $Id: transactionLogArchiver.sh 1375 2009-04-30 13:53:06Z rdempsey $
DATE=`date +'%s'`
CDATA=/var/log/Calpont/data
if [ ! -d $CDATA/archive ]; then
echo "Installation error: $CDATA/archive is not a directory." 1>&2
exit 1
fi
if [ -f $CDATA/data_mods.log ]; then
# Don't bother rotating an empty log
if [ ! -s $CDATA/data_mods.log ]; then
exit 0
fi
cp $CDATA/data_mods.log $CDATA/archive >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Could not copy $CDATA/data_mods.log to $CDATA/archive" 1>&2
exit 1
fi
else
# Is this a reportable/fatal error?
echo "No such file: $CDATA/data_mods.log" 1>&2
fi
rm -f $CDATA/data_mods.log >/dev/null 2>&1
touch $CDATA/data_mods.log >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Could not create $CDATA/data_mods.log" 1>&2
exit 1
fi
chmod 666 $CDATA/data_mods.log >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Could not set the perms on $CDATA/data_mods.log" 1>&2
exit 1
fi
pkill -HUP syslog >/dev/null 2>&1
mv $CDATA/archive/data_mods.log $CDATA/archive/data_mods.log.$DATE >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Could not move $CDATA/archive/data_mods.log to $CDATA/archive/data_mods.log.$DATE" 1>&2
exit 1
fi
|
{
"pile_set_name": "Github"
}
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';
enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);
|
{
"pile_set_name": "Github"
}
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["gzip.go"],
importpath = "google.golang.org/grpc/encoding/gzip",
visibility = ["//visibility:public"],
deps = ["//encoding:go_default_library"],
)
|
{
"pile_set_name": "Github"
}
|
#
# BUG#12400313 / BUG#64503 test case
#
#
# Description
# -----------
#
# This test case starts the slave server with:
# --relay-log-space-limit=8192 --relay-log-purge --max-relay-log-size=4096
#
# Then it issues some queries that will cause the slave to reach
# relay-log-space-limit. We lock the table so that the SQL thread is
# not able to purge the log and then we issue some more statements.
#
# The purpose is to show that the IO thread will honor the limits
# while the SQL thread is not able to purge the relay logs, which did
# not happen before this patch. In addition we assert that while
# ignoring the limit (SQL thread needs to rotate before purging), the
# IO thread does not do it in an uncontrolled manner.
--source include/have_binlog_format_statement.inc
--source include/master-slave.inc
--source include/have_innodb.inc
--disable_query_log
CREATE TABLE t1 (c1 TEXT) engine=InnoDB;
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
--sync_slave_with_master
# wait for the SQL thread to sleep
--let $show_statement= SHOW PROCESSLIST
--let $field= State
--let $condition= = 'Slave has read all relay log; waiting for the slave I/O thread to update it'
--source include/wait_show_condition.inc
# now the io thread has set rli->ignore_space_limit
# lets lock the table so that once the SQL thread awakes
# it blocks there and does not set rli->ignore_space_limit
# back to zero
LOCK TABLE t1 WRITE;
# now issue more statements that will overflow the
# rli->log_space_limit (in this case ~10K)
--connection master
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
--connection slave
# ASSERT that the IO thread waits for the SQL thread to release some
# space before continuing
--let $show_statement= SHOW PROCESSLIST
--let $field= State
--let $condition= LIKE 'Waiting for %'
# before the patch (IO would have transfered everything)
#--let $condition= = 'Waiting for master to send event'
# after the patch (now it waits for space to be freed)
#--let $condition= = 'Waiting for the slave SQL thread to free enough relay log space'
--source include/wait_show_condition.inc
# without the patch we can uncomment the following two lines and
# watch the IO thread synchronize with the master, thus writing
# relay logs way over the space limit
#--connection master
#--source include/sync_slave_io_with_master.inc
## ASSERT that the IO thread has honored the limit+few bytes required to be able to purge
--let $relay_log_space_while_sql_is_executing = query_get_value(SHOW SLAVE STATUS, Relay_Log_Space, 1)
--let $relay_log_space_limit = query_get_value(SHOW VARIABLES LIKE "relay_log_space_limit", Value, 1)
--let $assert_text= Assert that relay log space is close to the limit
--let $assert_cond= $relay_log_space_while_sql_is_executing <= $relay_log_space_limit * 1.15
--source include/assert.inc
# unlock the table and let SQL thread continue applying events
UNLOCK TABLES;
--connection master
--sync_slave_with_master
--let $diff_tables=master:test.t1,slave:test.t1
--source include/diff_tables.inc
--connection master
DROP TABLE t1;
--enable_query_log
--sync_slave_with_master
--source include/rpl_end.inc
|
{
"pile_set_name": "Github"
}
|
package cn.cie.mapper;
import cn.cie.entity.Game;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* Created by RojerAlone on 2017/6/14.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(value = {"classpath:spring-dao.xml", "classpath:spring-service.xml"})
public class GameMapperTest {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private GameMapper gameMapper;
@Test
public void selectByStat() throws Exception {
logger.info("games={}" + gameMapper.selectByStat(Game.STAT_OK));
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2018 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
package ads1x15
import (
"reflect"
"testing"
"periph.io/x/periph/conn/i2c/i2ctest"
"periph.io/x/periph/conn/physic"
"periph.io/x/periph/conn/pin"
"periph.io/x/periph/experimental/conn/analog"
)
func TestChannel_String(t *testing.T) {
// Mainly to increase test coverage...
data := []struct {
c Channel
expected string
}{
{Channel0, "0"},
{Channel1, "1"},
{Channel2, "2"},
{Channel3, "3"},
{Channel0Minus1, "0-1"},
{Channel0Minus3, "0-3"},
{Channel1Minus3, "1-3"},
{Channel2Minus3, "2-3"},
{Channel(-1), "Invalid"},
}
for _, line := range data {
if actual := line.c.String(); actual != line.expected {
t.Fatalf("%s != %s", line.expected, actual)
}
}
}
func TestChannel_number(t *testing.T) {
// Mainly to increase test coverage...
data := []struct {
c Channel
expected int
}{
{Channel0, 0},
{Channel1, 1},
{Channel2, 2},
{Channel3, 3},
{Channel0Minus1, 4},
{Channel0Minus3, 5},
{Channel1Minus3, 6},
{Channel2Minus3, 7},
{Channel(-1), -1},
}
for _, line := range data {
if actual := line.c.number(); actual != line.expected {
t.Fatalf("%d != %d", line.expected, actual)
}
}
}
func TestDev_String(t *testing.T) {
b := i2ctest.Playback{}
defer b.Close()
d, err := NewADS1115(&b, &DefaultOpts)
if err != nil {
t.Fatal(err)
}
if s := d.String(); s != "ADS1115" {
t.Fatal(s)
}
if err := d.Halt(); err != nil {
t.Fatal(err)
}
}
func TestPinADC(t *testing.T) {
b := i2ctest.Playback{}
defer b.Close()
d, err := NewADS1015(&b, &DefaultOpts)
if err != nil {
t.Fatal(err)
}
// Obtain an analog pin from the ADC
p, err := d.PinForChannel(Channel0Minus3, 5*physic.Volt, 1*physic.Hertz, BestQuality)
if err != nil {
t.Fatal(err)
}
if v := p.String(); v != "ADS1015(0-3)" {
t.Fatal(v)
}
if v := p.Name(); v != "ADS1015(0-3)" {
t.Fatal(v)
}
if v := p.Number(); v != 5 {
t.Fatal(v)
}
if v := p.Function(); v != "ADC" {
t.Fatal(v)
}
if v := p.(pin.PinFunc).Func(); v != analog.ADC {
t.Fatal(v)
}
if v := p.(pin.PinFunc).SupportedFuncs(); !reflect.DeepEqual(v, []pin.Func{analog.ADC}) {
t.Fatal(v)
}
if err := p.(pin.PinFunc).SetFunc(analog.ADC); err != nil {
t.Fatal(err)
}
if err := p.(pin.PinFunc).SetFunc(pin.FuncNone); err == nil {
t.Fatal("expected failure")
}
}
func TestPinADC_Read(t *testing.T) {
b := i2ctest.Playback{
Ops: []i2ctest.IO{
{
Addr: 0x48,
W: []byte{0x1, 0x91, 0x3},
R: []byte{},
},
{
Addr: 0x48,
W: []byte{0x0},
R: []byte{0xff, 0x50},
},
},
}
defer b.Close()
d, err := NewADS1015(&b, &DefaultOpts)
if err != nil {
t.Fatal(err)
}
// Obtain an analog pin from the ADC
p, err := d.PinForChannel(Channel0Minus3, 5*physic.Volt, 1*physic.Hertz, BestQuality)
if err != nil {
t.Fatal(err)
}
// Read values from ADC.
reading, err := p.Read()
if err != nil {
t.Fatal(err)
}
if reading.Raw != -176 {
t.Fatalf("Found %d, expected %d", reading.Raw, -176)
}
if reading.V != -33*physic.MilliVolt {
t.Fatalf("Found %s, expected %s", reading.V, -33*physic.MilliVolt)
}
if err := p.Halt(); err != nil {
t.Fatal(err)
}
if err := d.Halt(); err != nil {
t.Fatal(err)
}
}
func TestPinADC_ReadContinous(t *testing.T) {
b := i2ctest.Playback{
Ops: []i2ctest.IO{
{
Addr: 0x48,
W: []byte{0x1, 0x91, 0xc3},
R: []byte{},
},
{
Addr: 0x48,
W: []byte{0x0},
R: []byte{0x52, 0xd0},
},
{
Addr: 0x48,
W: []byte{0x1, 0x91, 0xc3},
R: []byte{},
},
{
Addr: 0x48,
W: []byte{0x0},
R: []byte{0x52, 0xc0},
},
// We add 2 extra exchanges, as halting the polling is not instant
{
Addr: 0x48,
W: []byte{0x1, 0x91, 0xc3},
R: []byte{},
},
{
Addr: 0x48,
W: []byte{0x0},
R: []byte{0x52, 0xc0},
},
{
Addr: 0x48,
W: []byte{0x1, 0x91, 0xc3},
R: []byte{},
},
{
Addr: 0x48,
W: []byte{0x0},
R: []byte{0x52, 0xc0},
},
},
DontPanic: true,
}
defer b.Close()
rawValues := []int32{21200, 21184}
voltValues := []physic.ElectricPotential{3975 * physic.MilliVolt, 3972 * physic.MilliVolt}
d, err := NewADS1015(&b, &DefaultOpts)
if err != nil {
t.Fatal(err)
}
// Obtain an analog pin from the ADC
p, err := d.PinForChannel(Channel0Minus3, 5*physic.Volt, 100*physic.Hertz, SaveEnergy)
if err != nil {
t.Fatal(err)
}
// Read values from ADC.
c := p.ReadContinuous()
var i = 0
for reading := range c {
if reading.Raw != rawValues[i] {
t.Fatalf("Found %d, expected %d", reading.Raw, rawValues[i])
}
if reading.V != voltValues[i] {
t.Fatalf("Found %s, expected %s", reading.V, voltValues[i])
}
i++
if i >= len(rawValues) {
break
}
}
if err := p.Halt(); err != nil {
t.Fatal(err)
}
if err := d.Halt(); err != nil {
t.Fatal(err)
}
}
|
{
"pile_set_name": "Github"
}
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (coll, iteratee, callback) {
var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric;
eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback);
};
var _isArrayLike = require('lodash/isArrayLike');
var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
var _breakLoop = require('./internal/breakLoop');
var _breakLoop2 = _interopRequireDefault(_breakLoop);
var _eachOfLimit = require('./eachOfLimit');
var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
var _doLimit = require('./internal/doLimit');
var _doLimit2 = _interopRequireDefault(_doLimit);
var _noop = require('lodash/noop');
var _noop2 = _interopRequireDefault(_noop);
var _once = require('./internal/once');
var _once2 = _interopRequireDefault(_once);
var _onlyOnce = require('./internal/onlyOnce');
var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
var _wrapAsync = require('./internal/wrapAsync');
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// eachOf implementation optimized for array-likes
function eachOfArrayLike(coll, iteratee, callback) {
callback = (0, _once2.default)(callback || _noop2.default);
var index = 0,
completed = 0,
length = coll.length;
if (length === 0) {
callback(null);
}
function iteratorCallback(err, value) {
if (err) {
callback(err);
} else if (++completed === length || value === _breakLoop2.default) {
callback(null);
}
}
for (; index < length; index++) {
iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback));
}
}
// a generic version of eachOf which can handle array, object, and iterator cases.
var eachOfGeneric = (0, _doLimit2.default)(_eachOfLimit2.default, Infinity);
/**
* Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument
* to the iteratee.
*
* @name eachOf
* @static
* @memberOf module:Collections
* @method
* @alias forEachOf
* @category Collection
* @see [async.each]{@link module:Collections.each}
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {AsyncFunction} iteratee - A function to apply to each
* item in `coll`.
* The `key` is the item's key, or index in the case of an array.
* Invoked with (item, key, callback).
* @param {Function} [callback] - A callback which is called when all
* `iteratee` functions have finished, or an error occurs. Invoked with (err).
* @example
*
* var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
* var configs = {};
*
* async.forEachOf(obj, function (value, key, callback) {
* fs.readFile(__dirname + value, "utf8", function (err, data) {
* if (err) return callback(err);
* try {
* configs[key] = JSON.parse(data);
* } catch (e) {
* return callback(e);
* }
* callback();
* });
* }, function (err) {
* if (err) console.error(err.message);
* // configs is now a map of JSON data
* doSomethingWith(configs);
* });
*/
module.exports = exports['default'];
|
{
"pile_set_name": "Github"
}
|
# content-type
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Create and parse HTTP Content-Type header according to RFC 7231
## Installation
```sh
$ npm install content-type
```
## API
```js
var contentType = require('content-type')
```
### contentType.parse(string)
```js
var obj = contentType.parse('image/svg+xml; charset=utf-8')
```
Parse a content type string. This will return an object with the following
properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`):
- `type`: The media type (the type and subtype, always lower case).
Example: `'image/svg+xml'`
- `parameters`: An object of the parameters in the media type (name of parameter
always lower case). Example: `{charset: 'utf-8'}`
Throws a `TypeError` if the string is missing or invalid.
### contentType.parse(req)
```js
var obj = contentType.parse(req)
```
Parse the `content-type` header from the given `req`. Short-cut for
`contentType.parse(req.headers['content-type'])`.
Throws a `TypeError` if the `Content-Type` header is missing or invalid.
### contentType.parse(res)
```js
var obj = contentType.parse(res)
```
Parse the `content-type` header set on the given `res`. Short-cut for
`contentType.parse(res.getHeader('content-type'))`.
Throws a `TypeError` if the `Content-Type` header is missing or invalid.
### contentType.format(obj)
```js
var str = contentType.format({type: 'image/svg+xml'})
```
Format an object into a content type string. This will return a string of the
content type for the given object with the following properties (examples are
shown that produce the string `'image/svg+xml; charset=utf-8'`):
- `type`: The media type (will be lower-cased). Example: `'image/svg+xml'`
- `parameters`: An object of the parameters in the media type (name of the
parameter will be lower-cased). Example: `{charset: 'utf-8'}`
Throws a `TypeError` if the object contains an invalid type or parameter names.
## License
[MIT](LICENSE)
[npm-image]: https://img.shields.io/npm/v/content-type.svg
[npm-url]: https://npmjs.org/package/content-type
[node-version-image]: https://img.shields.io/node/v/content-type.svg
[node-version-url]: http://nodejs.org/download/
[travis-image]: https://img.shields.io/travis/jshttp/content-type/master.svg
[travis-url]: https://travis-ci.org/jshttp/content-type
[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-type/master.svg
[coveralls-url]: https://coveralls.io/r/jshttp/content-type
[downloads-image]: https://img.shields.io/npm/dm/content-type.svg
[downloads-url]: https://npmjs.org/package/content-type
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Car Lease Scenario
* composer Language File
*
* Author: Billy Blockchain
* Version: 1.0
* Last Updates: 2016-09-22
*/
// define the namespace for this model
namespace org.acme
enum State {
o CREATED
o REGISTERED
o SOLD
}
|
{
"pile_set_name": "Github"
}
|
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LUExpandableTableView
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
|
{
"pile_set_name": "Github"
}
|
require('../../../modules/core.number.iterator');
module.exports = require('../../../modules/_iterators').Number;
|
{
"pile_set_name": "Github"
}
|
[Rank]
S. Joannis Apostoli ante portam Latinam;;Duplex majus;;4;;ex C1
[Rule]
Gloria
CredoDA
Prefatio=Apostolis
[Introitus]
!Ps 63:3
v. Thou hast protected me from the assembly of the malignant; from the~
multitude of the workers of iniquity, allelúja, allelúja.
!Ps 63:2
v. Hear, O God, my prayer, when I make supplication to thee : deliver my soul~
from the fear of the enemy.
&Gloria
v. Thou hast protected me from the assembly of the malignant; from the~
multitude of the workers of iniquity, allelúja, allelúja.
[Oratio]
O God, Which seest that sins and sufferings do on every side rise up to trouble~
us, grant, we beseech thee, that we may find a shield in time of need through~
the glorious intercession of thy blessed Apostle and Evangelist John.
$Per Dominum.
[Lectio]
Lesson from the book of Wisdom
!Wis 5:1-5
v. Then shall the just stand with great constancy against those that have afflicted them, and taken away their labours. These seeing it, shall be troubled with terrible fear, and shall be amazed at the suddenness of their unexpected salvation. Saying within themselves, repenting, and groaning for anguish of spirit: These are they, whom we had some time in derision, and for a parable of reproach. We fools esteemed their life madness, and their end without honour. Behold how they are numbered among the children of God, and their lot is among the saints.
[Graduale]
Allelúja, allelúja
!Ps 91:13
v. The just shall flourish like the palm tree: he shall grow up like the cedar~
of Libanus. Allelúja
!Hos 14:6
v. The just shall spring as the lily, and flourish forever before the Lord.~
Allelúja.
[Evangelium]
Continuation + of the Holy Gospel according to Matthew
!Matt 20:20-23
In that time: came to him the mother of the sons of Zebedee with her sons,~
adoring and asking something of him. Who said to her: What wilt thou? She saith~
to him: Say that these my two sons may sit, the one on thy right hand, and the~
other on thy left, in thy kingdom. And Jesus answering, said: You know not what~
you ask. Can you drink the chalice that I shall drink? They say to him: We can.~
He saith to them: My chalice indeed you shall drink; but to sit on my right or~
left hand, is not mine to give to you, but to them for whom it is prepared by my~
Father.
[Offertorium]
!Ps 88:6
v. The heavens shall confess thy wonders, O Lord: and thy truth in the church~
of the saints, allelúja, allelúja.
[Secreta]
Accept O lord, we pray, our gifts and prayers: purify us through these heavenly~
mysteries, and gratiously hear us.
$Per Dominum
[Communio]
!Ps 63:11
v. The just shall rejoice in the Lord, and shall hope in him: and all the~
upright in heart shall be praised, allelúja, allelúja.
[Postcommunio]
Fed with bread from heaven, we ask O Lord, that it may be our nourishment unto~
life eternal.
$Per Dominum
|
{
"pile_set_name": "Github"
}
|
// RUN: %clang_cc1 -verify %s
template <class T> struct Base { // expected-note 4 {{member found by ambiguous name lookup}}
static void f();
};
struct X0 { };
template <class T> struct Derived: Base<int>, Base<char> {
typename Derived::Base b; // expected-error{{member 'Base' found in multiple base classes of different types}}
typename Derived::Base<double> d; // OK
void g(X0 *t) {
t->Derived::Base<T>::f();
t->Base<T>::f();
t->Base::f(); // expected-error{{member 'Base' found in multiple base classes of different types}} \
// expected-error{{no member named 'f' in 'X0'}}
}
};
namespace PR6717 {
template <typename T>
class WebVector {
} // expected-error {{expected ';' after class}}
WebVector(const WebVector<T>& other) { } // expected-error{{undeclared identifier 'T'}} \
expected-error{{requires a type specifier}}
template <typename C>
WebVector<T>& operator=(const C& other) { } // expected-error{{undeclared identifier 'T'}}
}
|
{
"pile_set_name": "Github"
}
|
/*
* This project is licensed under the open source MPL V2.
* See https://github.com/openMF/android-client/blob/master/LICENSE.md
*/
package com.mifos.mifosxdroid.adapters;
import android.content.Context;
import android.graphics.Color;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.mifos.mifosxdroid.R;
import com.mifos.mifosxdroid.core.SelectableAdapter;
import com.mifos.objects.group.Group;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
public class GroupNameListAdapter extends SelectableAdapter<RecyclerView.ViewHolder> {
private List<Group> groups;
private Context context;
@Inject
public GroupNameListAdapter() {
this.groups = new ArrayList<>();
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
RecyclerView.ViewHolder vh;
View v = LayoutInflater.from(parent.getContext()).inflate(
R.layout.row_group_name, parent, false);
vh = new ViewHolder(v);
return vh;
}
@Override
public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {
if (holder instanceof ViewHolder) {
Group group = groups.get(position);
((ViewHolder) holder).tv_groupsName.setText(group.getName());
((ViewHolder) holder).tv_groupsId.setText(String.valueOf(group.getId()));
//Changing the Color of Selected Groups
((ViewHolder) holder).view_selectedOverlay
.setBackgroundColor(isSelected(position) ? ContextCompat.getColor(context,
R.color.gray_light) : Color.WHITE);
((ViewHolder) holder).iv_sync_status
.setVisibility(group.isSync() ? View.VISIBLE : View.INVISIBLE);
}
}
public void setGroups(List<Group> groups) {
this.groups = groups;
notifyDataSetChanged();
}
public void setContext(Context context) {
this.context = context;
}
@Override
public int getItemCount() {
return groups.size();
}
public Group getItem(int position) {
return groups.get(position);
}
@Override
public long getItemId(int i) {
return 0;
}
public static class ViewHolder extends RecyclerView.ViewHolder {
@BindView(R.id.tv_group_name)
TextView tv_groupsName;
@BindView(R.id.tv_group_id)
TextView tv_groupsId;
@BindView(R.id.linearLayout)
LinearLayout view_selectedOverlay;
@BindView(R.id.iv_sync_status)
ImageView iv_sync_status;
public ViewHolder(View v) {
super(v);
ButterKnife.bind(this, v);
}
}
}
|
{
"pile_set_name": "Github"
}
|
Ron Wein <[email protected]>
Efi Fogel <[email protected]>
Eric Berberich <[email protected]>
|
{
"pile_set_name": "Github"
}
|
/***********************************************************************************
*
* Copyright (c) 2012 Olivier Halligon
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
***********************************************************************************/
#if ! __has_feature(objc_arc)
#error This file is expected to be compiled with ARC turned ON
#endif
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Imports
#import "OHHTTPStubsResponse.h"
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Defines & Constants
const double OHHTTPStubsDownloadSpeed1KBPS =- 8 / 8; // kbps -> KB/s
const double OHHTTPStubsDownloadSpeedSLOW =- 12 / 8; // kbps -> KB/s
const double OHHTTPStubsDownloadSpeedGPRS =- 56 / 8; // kbps -> KB/s
const double OHHTTPStubsDownloadSpeedEDGE =- 128 / 8; // kbps -> KB/s
const double OHHTTPStubsDownloadSpeed3G =- 3200 / 8; // kbps -> KB/s
const double OHHTTPStubsDownloadSpeed3GPlus =- 7200 / 8; // kbps -> KB/s
const double OHHTTPStubsDownloadSpeedWifi =- 12000 / 8; // kbps -> KB/s
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Implementation
@implementation OHHTTPStubsResponse
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Commodity Constructors
#pragma mark > Building response from NSData
+(instancetype)responseWithData:(NSData*)data
statusCode:(int)statusCode
headers:(nullable NSDictionary*)httpHeaders
{
OHHTTPStubsResponse* response = [[self alloc] initWithData:data
statusCode:statusCode
headers:httpHeaders];
return response;
}
#pragma mark > Building response from a file
+(instancetype)responseWithFileAtPath:(NSString *)filePath
statusCode:(int)statusCode
headers:(nullable NSDictionary *)httpHeaders
{
OHHTTPStubsResponse* response = [[self alloc] initWithFileAtPath:filePath
statusCode:statusCode
headers:httpHeaders];
return response;
}
+(instancetype)responseWithFileURL:(NSURL *)fileURL
statusCode:(int)statusCode
headers:(nullable NSDictionary *)httpHeaders
{
OHHTTPStubsResponse* response = [[self alloc] initWithFileURL:fileURL
statusCode:statusCode
headers:httpHeaders];
return response;
}
#pragma mark > Building an error response
+(instancetype)responseWithError:(NSError*)error
{
OHHTTPStubsResponse* response = [[self alloc] initWithError:error];
return response;
}
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Commotidy Setters
-(instancetype)responseTime:(NSTimeInterval)responseTime
{
_responseTime = responseTime;
return self;
}
-(instancetype)requestTime:(NSTimeInterval)requestTime responseTime:(NSTimeInterval)responseTime
{
_requestTime = requestTime;
_responseTime = responseTime;
return self;
}
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Initializers
-(instancetype)init
{
self = [super init];
return self;
}
-(instancetype)initWithInputStream:(NSInputStream*)inputStream
dataSize:(unsigned long long)dataSize
statusCode:(int)statusCode
headers:(nullable NSDictionary*)httpHeaders
{
self = [super init];
if (self)
{
_inputStream = inputStream;
_dataSize = dataSize;
_statusCode = statusCode;
NSMutableDictionary * headers = [NSMutableDictionary dictionaryWithDictionary:httpHeaders];
static NSString *const ContentLengthHeader = @"Content-Length";
if (!headers[ContentLengthHeader])
{
headers[ContentLengthHeader] = [NSString stringWithFormat:@"%llu",_dataSize];
}
_httpHeaders = [NSDictionary dictionaryWithDictionary:headers];
}
return self;
}
-(instancetype)initWithFileAtPath:(NSString*)filePath
statusCode:(int)statusCode
headers:(nullable NSDictionary*)httpHeaders
{
NSURL *fileURL = filePath ? [NSURL fileURLWithPath:filePath] : nil;
self = [self initWithFileURL:fileURL
statusCode:statusCode
headers:httpHeaders];
return self;
}
-(instancetype)initWithFileURL:(NSURL *)fileURL
statusCode:(int)statusCode
headers:(nullable NSDictionary *)httpHeaders {
if (!fileURL) {
NSLog(@"%s: nil file path. Returning empty data", __PRETTY_FUNCTION__);
return [self initWithInputStream:[NSInputStream inputStreamWithData:[NSData data]]
dataSize:0
statusCode:statusCode
headers:httpHeaders];
}
// [NSURL -isFileURL] is only available on iOS 8+
NSAssert([fileURL.scheme isEqualToString:NSURLFileScheme], @"%s: Only file URLs may be passed to this method.",__PRETTY_FUNCTION__);
NSNumber *fileSize;
NSError *error;
const BOOL success __unused = [fileURL getResourceValue:&fileSize forKey:NSURLFileSizeKey error:&error];
NSAssert(success && fileSize, @"%s Couldn't get the file size for URL. \
The URL was: %@. \
The operation to retrieve the file size was %@. \
The error associated with that operation was: %@",
__PRETTY_FUNCTION__, fileURL, success ? @"successful" : @"unsuccessful", error);
return [self initWithInputStream:[NSInputStream inputStreamWithURL:fileURL]
dataSize:[fileSize unsignedLongLongValue]
statusCode:statusCode
headers:httpHeaders];
}
-(instancetype)initWithData:(NSData*)data
statusCode:(int)statusCode
headers:(nullable NSDictionary*)httpHeaders
{
NSInputStream* inputStream = [NSInputStream inputStreamWithData:data?:[NSData data]];
self = [self initWithInputStream:inputStream
dataSize:data.length
statusCode:statusCode
headers:httpHeaders];
return self;
}
-(instancetype)initWithError:(NSError*)error
{
self = [super init];
if (self) {
_error = error;
}
return self;
}
-(NSString*)debugDescription
{
return [NSString stringWithFormat:@"<%@ %p requestTime:%f responseTime:%f status:%d dataSize:%llu>",
self.class, self, self.requestTime, self.responseTime, self.statusCode, self.dataSize];
}
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Accessors
-(void)setRequestTime:(NSTimeInterval)requestTime
{
NSAssert(requestTime >= 0, @"Invalid Request Time (%f) for OHHTTPStubResponse. Request time must be greater than or equal to zero",requestTime);
_requestTime = requestTime;
}
@end
|
{
"pile_set_name": "Github"
}
|
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Property.rc
//
#define IDS_AUDIO_PROPS_TITLE 3
#define IDS_AUDIO_ADVANCED_TITLE 4
#define IDS_ABOUT 5
#define IDD_AUDIOENCPROPS 100
#define IDD_ADVPROPS 102
#define IDD_ABOUT 105
#define IDI_ICON2 106
#define IDC_COMBO_CBR 1004
#define IDC_CHECK_COPYRIGHT 1007
#define IDC_CHECK_ORIGINAL 1008
#define IDC_CHECK_CRC 1009
#define IDC_CHECK_PES 1010
#define IDC_COMBO_VBRMIN 1013
#define IDC_TITLE_TEXT 1016
#define IDC_RADIO_CBR 1019
#define IDC_RADIO_VBR 1020
#define IDC_SLIDER_QUALITY 1021
#define IDC_TEXT_QUALITY 1023
#define IDC_COMBO_VBRMAX 1024
#define IDC_COMBO_SAMPLE_RATE 1025
#define IDC_COMBO_VBRq 1026
#define IDC_RADIO_STEREO 1027
#define IDC_RADIO_JSTEREO 1028
#define IDC_RADIO_DUAL 1029
#define IDC_RADIO_MONO 1030
#define IDC_CHECK_ENFORCE_MIN 1031
#define IDC_CHECK_VOICE 1032
#define IDC_CHECK_KEEP_ALL_FREQ 1033
#define IDC_CHECK_STRICT_ISO 1034
#define IDC_CHECK_DISABLE_SHORT_BLOCK 1035
#define IDC_CHECK_XING_TAG 1036
#define IDC_CHECK_FORCE_MS 1037
#define IDC_CHECK_MODE_FIXED 1038
#define IDC_RICHEDIT_LAME 1039
#define IDC_CHECK_OVERLAP 1039
#define IDC_CHECK_STOP 1040
#define IDC_EDIT_TEXT 1044
#define IDC_LAME_LA 1044
#define IDC_FORCE_MONO 1045
#define IDC_LAME_VER 1046
#define IDC_LAME_URL 1047
#define IDC_SET_DURATION 1048
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 107
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1049
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|
{
"pile_set_name": "Github"
}
|
// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
// You may push code into the target .java compilation unit if you wish to edit any member(s).
package nl.bzk.brp.model.data.kern;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;
import nl.bzk.brp.model.data.kern.HisPersverblijfstitel;
import nl.bzk.brp.model.data.kern.Pers;
import nl.bzk.brp.model.data.kern.Verblijfstitel;
privileged aspect Verblijfstitel_Roo_DbManaged {
@OneToMany(mappedBy = "verblijfstitel")
private Set<HisPersverblijfstitel> Verblijfstitel.hisPersverblijfstitels;
@OneToMany(mappedBy = "verblijfstitel")
private Set<Pers> Verblijfstitel.perss;
@Column(name = "code", columnDefinition = "int2")
@NotNull
private Short Verblijfstitel.code;
@Column(name = "oms", columnDefinition = "varchar", length = 250, unique = true)
@NotNull
private String Verblijfstitel.oms;
@Column(name = "dataanvgel", columnDefinition = "int4")
private Integer Verblijfstitel.dataanvgel;
@Column(name = "dateindegel", columnDefinition = "int4")
private Integer Verblijfstitel.dateindegel;
public Set<HisPersverblijfstitel> Verblijfstitel.getHisPersverblijfstitels() {
return hisPersverblijfstitels;
}
public void Verblijfstitel.setHisPersverblijfstitels(Set<HisPersverblijfstitel> hisPersverblijfstitels) {
this.hisPersverblijfstitels = hisPersverblijfstitels;
}
public Set<Pers> Verblijfstitel.getPerss() {
return perss;
}
public void Verblijfstitel.setPerss(Set<Pers> perss) {
this.perss = perss;
}
public Short Verblijfstitel.getCode() {
return code;
}
public void Verblijfstitel.setCode(Short code) {
this.code = code;
}
public String Verblijfstitel.getOms() {
return oms;
}
public void Verblijfstitel.setOms(String oms) {
this.oms = oms;
}
public Integer Verblijfstitel.getDataanvgel() {
return dataanvgel;
}
public void Verblijfstitel.setDataanvgel(Integer dataanvgel) {
this.dataanvgel = dataanvgel;
}
public Integer Verblijfstitel.getDateindegel() {
return dateindegel;
}
public void Verblijfstitel.setDateindegel(Integer dateindegel) {
this.dateindegel = dateindegel;
}
}
|
{
"pile_set_name": "Github"
}
|
# GDG DEVFEST APP [](https://codemagic.io/apps/5d4af19b36524a001caa407a/5d4af19b36524a001caa4079/latest_build) [](https://travis-ci.org/iampawan/GDG-DevFest-App)
<p align="center">
<img width="800px" src="https://i.imgur.com/P21Hk0u.png">
</p>
<p align="center">
<a target="_blank" href='http://bit.ly/2GDr18N'><img alt='Get it on Google Play' src='https://goldtonemusicgroup.com/img/goldtone/main-page/news/playstore-badge.png' height='48px'/></a>
<a target="_blank" href='https://apple.co/2YC0Zgb'><img alt='Get it on the App Store' src='https://upload.wikimedia.org/wikipedia/commons/thumb/3/3c/Download_on_the_App_Store_Badge.svg/1280px-Download_on_the_App_Store_Badge.svg.png' height='48px'/></a>
</p>
<p align="center"><a href="#getting-started">:rocket: Get Started</a></p>
## 📸 ScreenShots
| Light Theme | Dark Theme |
| :----------------------------------: | :----------------------------------: |
|  |  |
|  |  |
|  |  |
### Show some :heart: and star the repo to support the project
## Overview
DevFest Mobile application is for all the GDG Devfests around the world. You can see the agenda in the app as well as the speakers and other updates regarding the devfest.
## Technology Stack
- Flutter
- Flutter Bloc
- Firebase (Upcoming)
## Getting Started
1. [Fork repository](https://github.com/iampawan/GDG-DevFest-App/fork) and clone your fork locally
1. Install [Flutter 1.7.8](https://flutter.dev/docs/get-started/install)
1. Install [Android Studio / IntelliJ / VSCode](https://flutter.dev/docs/development/tools/android-studio)
1. [Preparing Release for Android](https://flutter.dev/docs/deployment/android)
1. [Preparing Release for iOS](https://flutter.dev/docs/deployment/ios)
## Building the project
### Missing Key.Properties file
If you try to build the project straight away, you'll get an error complaining that a `key.properties` file is missing and Exit code 1 from: /GDG-DevFest-App-master/android/gradlew app:properties:. To resolve that,
1. Open [GDG-DevFest-App-master\android\app\build.gradle](https://github.com/iampawan/GDG-DevFest-App/blob/master/android/app/build.gradle) file and comment following lines-
```
//keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
signingConfigs {
// release {
// keyAlias keystoreProperties['keyAlias']
// keyPassword keystoreProperties['keyPassword']
// storeFile file(keystoreProperties['storeFile'])
// storePassword keystoreProperties['storePassword']
// }
}
buildTypes {
// release {
// signingConfig signingConfigs.release
// }
}
```
1. Open [GDG-DevFest-App-master\lib\utils\devfest.dart](https://github.com/iampawan/GDG-DevFest-App/blob/master/lib/utils/devfest.dart) file and customise the texts according to your needs. Eg-
```
static const String app_name = “Devfest”;
static const String app_version = “Version 1.0.4”;
static const int app_version_code = 1;
//* Texts
static const String welcomeText = “Welcome to GDG DevFest”;
static const String descText =
‘’’DevFests are community-led, developer events hosted by GDG chapters around the globe focused on community building & learning about Google’s technologies. Each DevFest is inspired by and uniquely tailored to the needs of the developer community and region that hosts it.’’’;
//* ActionTexts
static const String agenda_text = “Agenda”;
static const String speakers_text = “Speakers”;
static const String team_text = “Team”;
static const String sponsor_text = “Sponsors”;
static const String faq_text = “FAQ”;
static const String map_text = “Locate Us”;
```
1. Open [GDG-DevFest-App-master\lib\home\session.dart](https://github.com/iampawan/GDG-DevFest-App/blob/master/lib/home/session.dart) file and customise the sessions according to your needs. Eg-
```
List<Session> sessions = [
Session(
sessionId: “1”,
sessionStartTime: “9:00 AM”,
sessionTotalTime: “30 Mins”,
sessionTitle: “DevByte: From Zero to ML on Google Cloud Platform”,
speakerImage:
“https://avatars1.githubusercontent.com/u/12619420?s=400&u=eac38b075e4e4463edfb0f0a8972825cf7803d4c&v=4”,
speakerName: “Max Saltonstall”,
speakerDesc: “Cloud Developer Advocate, Google DevByte speaker”,
track: "cloud"
),
]
```
1. Open [GDG-DevFest-App-master\lib\home\speaker.dart](https://github.com/iampawan/GDG-DevFest-App/blob/master/lib/home/speaker.dart) file and customise the speakers according to your needs. Eg-
```
List<Speaker> speakers = [
Speaker(
speakerImage:
“https://avatars1.githubusercontent.com/u/12619420?s=400&u=eac38b075e4e4463edfb0f0a8972825cf7803d4c&v=4”,
speakerName: “Pawan Kumar”,
speakerDesc: “Google Developer Expert, Flutter”,
speakerSession: “Talk: Getting Started With Flutter For Web”,
fbUrl: “https://facebook.com/imthepk”,
githubUrl: “https://github.com/iampawan”,
linkedinUrl: “https://linkedin.com/in/imthepk”,
twitterUrl: “https://twitter.com/imthepk”,
),
]
```
1. Open [GDG-DevFest-App-master\lib\home\team.dart](https://github.com/iampawan/GDG-DevFest-App/blob/master/lib/home/team.dart) file and customise the teams according to your needs. Eg-
```
List<Team> teams = [
Team(
name: “Sundar Pichai”,
desc: “Organizer”,
contribution: “Google CEO”,
image:
“https://pbs.twimg.com/profile_images/864282616597405701/M-FEJMZ0_400x400.jpg”,
),
]
```
1. Open [GDG-DevFest-App-master\lib\map\map_page.dart](https://github.com/iampawan/GDG-DevFest-App/blob/master/lib/map/map_page.dart) file and customise the lat long according to your needs. Eg-
```
static final LatLng myLocation = LatLng(37.42796133580664, -122.085749655962);
```
1. Open [GDG-DevFest-App-master\lib\sponsors\sponsor_page.dart](https://github.com/iampawan/GDG-DevFest-App/blob/master/lib/sponsors/sponsor_page.dart) file and customise the sponsors data according to your needs. Eg-
```
SponsorImage(
imgUrl: “https://devfest.gdgkolkata.org/assets/img/logos/gd.png”,
)
```
## Contributing
Awesome! Contributions of all kinds are greatly appreciated. To help smoothen the process we have a few non-exhaustive guidelines to follow which should get you going in no time.
### Using GitHub Issues
- Feel free to use GitHub issues for questions, bug reports, and feature requests
- Use the search feature to check for an existing issue
- Include as much information as possible and provide any relevant resources (Eg. screenshots)
- For bug reports ensure you have a reproducible test case
- A pull request with a breaking test would be super preferable here but isn't required
### Submitting a Pull Request
- Squash commits
- Lint your code with eslint (config provided)
- Include relevant test updates/additions
## Contributors
**Maintainer:** [Pawan Kumar](https://github.com/iampawan)
## License
Project is published under the [MIT license](/LICENSE.md).
Feel free to clone and modify repo as you want, but don't forget to add reference to authors :)
_GDG DevFest App is not endorsed and/or supported by Google, the corporation._
|
{
"pile_set_name": "Github"
}
|
<?php
namespace Drupal\fb_messenger_bot\Bot;
use Drupal\fb_messenger_bot\FacebookService;
use Drupal\fb_messenger_bot\Conversation\ConversationFactoryInterface;
use Drupal\fb_messenger_bot\Workflow\BotWorkflowInterface;
/**
* Facebook Bot Implementation.
*
* @package Drupal\fb_messenger_bot\Bot
*/
class FBBot implements BotInterface {
use BotTrait;
/**
* FBBot constructor.
*
* @param FacebookService $fbService
* The facebook service.
* @param ConversationFactoryInterface $conversationFactory
* The conversation factory.
* @param BotWorkflowInterface $workflow
* The workflow associated with this bot.
*/
public function __construct(FacebookService $fbService, ConversationFactoryInterface $conversationFactory, BotWorkflowInterface $workflow = NULL) {
$this->fbService = $fbService;
$this->conversationFactory = $conversationFactory;
if ($workflow) {
$this->setWorkflow($workflow);
}
}
}
|
{
"pile_set_name": "Github"
}
|
package client // import "github.com/docker/docker/client"
import (
"context"
"encoding/json"
"net/url"
"github.com/docker/docker/api/types/filters"
volumetypes "github.com/docker/docker/api/types/volume"
)
// VolumeList returns the volumes configured in the docker host.
func (cli *Client) VolumeList(ctx context.Context, filter filters.Args) (volumetypes.VolumeListOKBody, error) {
var volumes volumetypes.VolumeListOKBody
query := url.Values{}
if filter.Len() > 0 {
//lint:ignore SA1019 for old code
filterJSON, err := filters.ToParamWithVersion(cli.version, filter)
if err != nil {
return volumes, err
}
query.Set("filters", filterJSON)
}
resp, err := cli.get(ctx, "/volumes", query, nil)
defer ensureReaderClosed(resp)
if err != nil {
return volumes, err
}
err = json.NewDecoder(resp.body).Decode(&volumes)
return volumes, err
}
|
{
"pile_set_name": "Github"
}
|
var class_d_f_s_test =
[
[ "ActionType", "class_d_f_s_test.html#ac4c131b9b4f9de55192b1c634dc1c37f", null ],
[ "GType", "class_d_f_s_test.html#a32b63a9c79f6f7e7021daacf076a1512", null ],
[ "SetUp", "class_d_f_s_test.html#aa8af56e0d079eb7c2b0ba7b6535d7d61", null ],
[ "TearDown", "class_d_f_s_test.html#afbe32ab6557cbca62368b480e1df593a", null ],
[ "_1e_graph", "class_d_f_s_test.html#ae5351e523345888ffc64aa892d93d3c2", null ],
[ "_1v_graph", "class_d_f_s_test.html#a4dbae7784992bee522457b53da2141c2", null ],
[ "_list_graph", "class_d_f_s_test.html#a9607eac5350c4cdd449c353fed482efc", null ],
[ "_rlist_graph", "class_d_f_s_test.html#a93a79d0654eb82517990c8f5419148a8", null ]
];
|
{
"pile_set_name": "Github"
}
|
"""
@brief file writer to write decoded objects into files
This file writer takes in decoded data and writes the data
to the correct log files and destination filse
@date Created August 8, 2019
@author Blake A. Harriman
@bug No known bugs
"""
from __future__ import print_function
import logging
import fprime.constants
from fprime_gds.common.decoders import decoder
import fprime_gds.common.handlers
from fprime_gds.common.files.helpers import *
from fprime_gds.common.data_types.file_data import *
LOGGER = logging.getLogger("downlink")
LOGGER.setLevel(logging.INFO)
class FileDownlinker(fprime_gds.common.handlers.DataHandler):
"""File writer class for decoded packets"""
def __init__(self, directory, timeout = 20.0, log_dir=None):
"""
FileWriter class constructor
Args:
directory: directory in which to write downlinked files
timeout: This is used to keep track of how long the program should wait before throwing
a timeout exception:
Returns:
An initialized FileWriter object.
"""
super().__init__()
self.__directory = directory
self.__log_dir = log_dir if log_dir is not None else directory
self.active = None
self.files = []
self.state = FileStates.IDLE
self.sequence = 0 #Keeps track of what the current sequence ID should be
self.timer = fprime_gds.common.files.helpers.Timeout()
self.timer.setup(self.timeout, timeout)
os.makedirs(self.__directory, exist_ok=True)
def data_callback(self, data, sender=None):
"""
Function called to pass data to the writer class
Args:
data: Binary data that has been decoded and passed to the correct consumer
"""
self.timer.restart() # Start or restart the timer
packet_type = data.packetType
# Check the packet type, and route to the appropriate sub-function
if packet_type == FilePacketType.START:
self.handle_start(data)
elif packet_type == FilePacketType.DATA:
self.handle_data(data)
elif packet_type == FilePacketType.END:
self.handle_end(data)
elif packet_type == FilePacketType.CANCEL:
self.handle_cancel(data)
else:
LOGGER.warning("Invalid file detected descriptor detected: %d", packet_type)
def handle_start(self, data):
"""
Handle a start packet data type.
:param data: data packet that is a start packet
"""
# Initialize all relevant START packet attributes into variables from file_data
size = data.size
source_path = data.sourcePath.decode(fprime.constants.DATA_ENCODING)
dest_path = data.destPath.decode(fprime.constants.DATA_ENCODING)
if self.state != FileStates.IDLE:
LOGGER.warning("File transfer already inprogress. Aborting original.")
self.finish()
# Create the destination file where the DATA packet data will be stored
assert self.active is None, "File is already open, something went wrong"
self.active = TransmitFile(source_path, os.path.join(self.__directory, self.sanitize(dest_path)), self.__log_dir)
self.active.open("wb+")
LOGGER.addHandler(self.active.log_handler)
message = "Received START packet with metadata:\n"
message += "\tSize: %d\n"
message += "\tSource: %s\n"
message += "\tDestination: %s"
LOGGER.info(message, size, source_path, dest_path)
self.files.append(self.active)
self.state = FileStates.RUNNING
self.sequence += 1
def handle_data(self, data):
"""
Handle the data packet.
:param data: data packet
"""
# Initialize all relevant DATA packet attributes into variables from file_data
offset = data.offset
data_bytes = data.dataVar
if self.state != FileStates.RUNNING:
LOGGER.warning("Received unexpected data packet for offset: %d", offset)
else:
if data.seqID != self.sequence:
LOGGER.warning("Data packet has unexpected sequence id. Expected: %d got %d", self.sequence, data.seqID)
# Write the data information to the file
self.active.write(data_bytes, offset)
self.active.seek = offset + len(data_bytes)
LOGGER.info("Received DATA packet writing %d bytes to offset %s", len(data_bytes), offset)
self.sequence += 1
def handle_cancel(self, data):
"""
Handle cancel packet.
:param data: cancel packet, ignored.
:return:
"""
# CANCEL Packets have no data
if self.state != FileStates.RUNNING:
LOGGER.warning("Received unexpected cancel packet")
else:
LOGGER.info("Received CANCEL packet, stopping downlink")
self.finish()
def handle_end(self, data):
"""
Handle the end packet.
:param data: end packet
"""
# Initialize all relevant END packet attributes into varibles from file_data
# hashValue attribute is not relevent right now, but might be in the future
if self.state != FileStates.RUNNING:
LOGGER.warning("Received unexpected END packet")
else:
if data.seqID != self.sequence:
LOGGER.warning("End packet has unexpected sequence id. Expected: %d got %d", self.sequence, data.seqID)
LOGGER.info("Received END packet, finishing downlink")
self.finish()
def timeout(self):
""" Timeout the current downlink """
LOGGER.warning("Timeout while downlinking file, aborting")
self.finish()
def finish(self):
""" Finish the file downlink """
self.timer.stop()
self.state = FileStates.IDLE
self.sequence = 0
self.active.state = "FINISHED"
LOGGER.removeHandler(self.active.log_handler)
self.active.close()
self.active = None
def current_files(self):
""" Return the current list of downlinked files"""
return file_to_dict(self.files, uplink=False)
@staticmethod
def sanitize(filename):
"""
Sannitize the given filename by removing slashes that would make new directories.
:param filename: filename to sanitize
:return: sanitized filename
"""
return filename.replace(os.sep, "_")
@property
def directory(self):
return self.__directory
if __name__ == "__main__":
pass
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2019 Google
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import "FIRInstanceIDTokenOperation.h"
#import "FIRInstanceIDCheckinPreferences.h"
#import "FIRInstanceIDDefines.h"
#import "FIRInstanceIDKeyPair.h"
#import "FIRInstanceIDKeyPairUtilities.h"
#import "FIRInstanceIDLogger.h"
#import "FIRInstanceIDURLQueryItem.h"
#import "FIRInstanceIDUtilities.h"
#import "NSError+FIRInstanceID.h"
static const NSInteger kFIRInstanceIDPlatformVersionIOS = 2;
static NSString *const kFIRInstanceIDParamInstanceID = @"appid";
// Scope parameter that defines the service using the token
static NSString *const kFIRInstanceIDParamScope = @"X-scope";
// Defines the SDK version
static NSString *const kFIRInstanceIDParamFCMLibVersion = @"X-cliv";
@interface FIRInstanceIDTokenOperation () {
BOOL _isFinished;
BOOL _isExecuting;
}
@property(nonatomic, readwrite, strong) FIRInstanceIDCheckinPreferences *checkinPreferences;
@property(nonatomic, readwrite, strong) FIRInstanceIDKeyPair *keyPair;
@property(atomic, strong) NSURLSessionDataTask *dataTask;
@property(readonly, strong)
NSMutableArray<FIRInstanceIDTokenOperationCompletion> *completionHandlers;
// For testing only
@property(nonatomic, readwrite, copy) FIRInstanceIDURLRequestTestBlock testBlock;
@end
@implementation FIRInstanceIDTokenOperation
+ (NSURLSession *)sharedURLSession {
static NSURLSession *tokenOperationSharedSession;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
config.timeoutIntervalForResource = 60.0f; // 1 minute
tokenOperationSharedSession = [NSURLSession sessionWithConfiguration:config];
tokenOperationSharedSession.sessionDescription = @"com.google.iid.tokens.session";
});
return tokenOperationSharedSession;
}
- (instancetype)initWithAction:(FIRInstanceIDTokenAction)action
forAuthorizedEntity:(NSString *)authorizedEntity
scope:(NSString *)scope
options:(NSDictionary<NSString *, NSString *> *)options
checkinPreferences:(FIRInstanceIDCheckinPreferences *)checkinPreferences
keyPair:(FIRInstanceIDKeyPair *)keyPair {
self = [super init];
if (self) {
_action = action;
_authorizedEntity = [authorizedEntity copy];
_scope = [scope copy];
_options = [options copy];
_checkinPreferences = checkinPreferences;
_keyPair = keyPair;
_completionHandlers = [NSMutableArray array];
_isExecuting = NO;
_isFinished = NO;
}
return self;
}
- (void)dealloc {
_testBlock = nil;
_authorizedEntity = nil;
_scope = nil;
_options = nil;
_checkinPreferences = nil;
_keyPair = nil;
[_completionHandlers removeAllObjects];
_completionHandlers = nil;
}
- (void)addCompletionHandler:(FIRInstanceIDTokenOperationCompletion)handler {
[self.completionHandlers addObject:handler];
}
- (BOOL)isAsynchronous {
return YES;
}
- (BOOL)isExecuting {
return _isExecuting;
}
- (void)setExecuting:(BOOL)executing {
[self willChangeValueForKey:@"isExecuting"];
_isExecuting = executing;
[self didChangeValueForKey:@"isExecuting"];
}
- (BOOL)isFinished {
return _isFinished;
}
- (void)setFinished:(BOOL)finished {
[self willChangeValueForKey:@"isFinished"];
_isFinished = finished;
[self didChangeValueForKey:@"isFinished"];
}
- (void)start {
if (self.isCancelled) {
[self finishWithResult:FIRInstanceIDTokenOperationCancelled token:nil error:nil];
return;
}
// Quickly validate whether or not the operation has all it needs to begin
BOOL checkinfoAvailable = [self.checkinPreferences hasCheckinInfo];
_FIRInstanceIDDevAssert(checkinfoAvailable, @"Cannot fetch token invalid checkin state");
if (!checkinfoAvailable) {
FIRInstanceIDErrorCode errorCode = kFIRInstanceIDErrorCodeRegistrarFailedToCheckIn;
[self finishWithResult:FIRInstanceIDTokenOperationError
token:nil
error:[NSError errorWithFIRInstanceIDErrorCode:errorCode]];
return;
}
[self setExecuting:YES];
[self performTokenOperation];
}
- (void)finishWithResult:(FIRInstanceIDTokenOperationResult)result
token:(nullable NSString *)token
error:(nullable NSError *)error {
// Add a check to prevent this finish from being called more than once.
if (self.isFinished) {
return;
}
self.dataTask = nil;
_result = result;
// TODO(chliangGoogle): Call these in the main thread?
for (FIRInstanceIDTokenOperationCompletion completionHandler in self.completionHandlers) {
completionHandler(result, token, error);
}
[self setExecuting:NO];
[self setFinished:YES];
}
- (void)cancel {
[super cancel];
[self.dataTask cancel];
[self finishWithResult:FIRInstanceIDTokenOperationCancelled token:nil error:nil];
}
- (void)performTokenOperation {
}
#pragma mark - Request Construction
+ (NSMutableURLRequest *)requestWithAuthHeader:(NSString *)authHeaderString {
NSURL *url = [NSURL URLWithString:FIRInstanceIDRegisterServer()];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
// Add HTTP headers
[request setValue:authHeaderString forHTTPHeaderField:@"Authorization"];
[request setValue:FIRInstanceIDAppIdentifier() forHTTPHeaderField:@"app"];
request.HTTPMethod = @"POST";
return request;
}
+ (NSMutableArray<FIRInstanceIDURLQueryItem *> *)standardQueryItemsWithDeviceID:(NSString *)deviceID
scope:(NSString *)scope {
NSMutableArray<FIRInstanceIDURLQueryItem *> *queryItems = [NSMutableArray arrayWithCapacity:8];
// E.g. X-osv=10.2.1
NSString *systemVersion = FIRInstanceIDOperatingSystemVersion();
[queryItems addObject:[FIRInstanceIDURLQueryItem queryItemWithName:@"X-osv" value:systemVersion]];
// E.g. device=
if (deviceID) {
[queryItems addObject:[FIRInstanceIDURLQueryItem queryItemWithName:@"device" value:deviceID]];
}
// E.g. X-scope=fcm
if (scope) {
[queryItems addObject:[FIRInstanceIDURLQueryItem queryItemWithName:kFIRInstanceIDParamScope
value:scope]];
}
// E.g. plat=2
NSString *platform = [NSString stringWithFormat:@"%ld", (long)kFIRInstanceIDPlatformVersionIOS];
[queryItems addObject:[FIRInstanceIDURLQueryItem queryItemWithName:@"plat" value:platform]];
// E.g. app=com.myapp.foo
NSString *appIdentifier = FIRInstanceIDAppIdentifier();
[queryItems addObject:[FIRInstanceIDURLQueryItem queryItemWithName:@"app" value:appIdentifier]];
// E.g. app_ver=1.5
NSString *appVersion = FIRInstanceIDCurrentAppVersion();
[queryItems addObject:[FIRInstanceIDURLQueryItem queryItemWithName:@"app_ver" value:appVersion]];
// E.g. X-cliv=fiid-1.2.3
NSString *fcmLibraryVersion =
[NSString stringWithFormat:@"fiid-%@", FIRInstanceIDCurrentGCMVersion()];
if (fcmLibraryVersion.length) {
FIRInstanceIDURLQueryItem *gcmLibVersion =
[FIRInstanceIDURLQueryItem queryItemWithName:kFIRInstanceIDParamFCMLibVersion
value:fcmLibraryVersion];
[queryItems addObject:gcmLibVersion];
}
return queryItems;
}
- (NSArray<FIRInstanceIDURLQueryItem *> *)queryItemsWithKeyPair:(FIRInstanceIDKeyPair *)keyPair {
NSMutableArray<FIRInstanceIDURLQueryItem *> *items = [NSMutableArray arrayWithCapacity:3];
// appid=
NSString *instanceID = FIRInstanceIDAppIdentity(keyPair);
[items addObject:[FIRInstanceIDURLQueryItem queryItemWithName:kFIRInstanceIDParamInstanceID
value:instanceID]];
return items;
}
#pragma mark - HTTP Header
+ (NSString *)HTTPAuthHeaderFromCheckin:(FIRInstanceIDCheckinPreferences *)checkin {
NSString *deviceID = checkin.deviceID;
NSString *secret = checkin.secretToken;
return [NSString stringWithFormat:@"AidLogin %@:%@", deviceID, secret];
}
@end
|
{
"pile_set_name": "Github"
}
|
(flymake-ruby :repo "purcell/flymake-ruby" :fetcher github)
|
{
"pile_set_name": "Github"
}
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* 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 .
*/
#ifndef INCLUDED_WRITERFILTER_SOURCE_OOXML_OOXMLDOCUMENTIMPL_HXX
#define INCLUDED_WRITERFILTER_SOURCE_OOXML_OOXMLDOCUMENTIMPL_HXX
#include <ooxml/OOXMLDocument.hxx>
#include <com/sun/star/xml/dom/XDocument.hpp>
#include <com/sun/star/graphic/XGraphicMapper.hpp>
#include "OOXMLPropertySet.hxx"
#include <vector>
#include <stack>
namespace writerfilter::ooxml
{
class OOXMLDocumentImpl : public OOXMLDocument
{
OOXMLStream::Pointer_t mpStream;
css::uno::Reference<css::task::XStatusIndicator> mxStatusIndicator;
sal_Int32 mnXNoteId;
css::uno::Reference<css::frame::XModel> mxModel;
css::uno::Reference<css::drawing::XDrawPage> mxDrawPage;
css::uno::Reference<css::xml::dom::XDocument> mxGlossaryDocDom;
css::uno::Sequence < css::uno::Sequence< css::uno::Any > > mxGlossaryDomList;
/// Stack of shape contexts, 1 element for VML, 1 element / nesting level for drawingML.
std::stack< css::uno::Reference<css::xml::sax::XFastShapeContextHandler> > maShapeContexts;
css::uno::Reference<css::xml::dom::XDocument> mxThemeDom;
css::uno::Sequence<css::uno::Reference<css::xml::dom::XDocument> > mxCustomXmlDomList;
css::uno::Sequence<css::uno::Reference<css::xml::dom::XDocument> > mxCustomXmlDomPropsList;
css::uno::Reference<css::xml::dom::XDocument> mxCustomXmlProsDom;
css::uno::Reference<css::io::XInputStream> mxEmbeddings;
css::uno::Sequence < css::beans::PropertyValue > mxEmbeddingsList;
std::vector<css::beans::PropertyValue> aEmbeddings;
bool mbIsSubstream;
bool mbSkipImages;
/// How many paragraphs equal to 1 percent?
sal_Int32 mnPercentSize;
/// Position progress when it was last updated, possibly not after every paragraph in case of large documents.
sal_Int32 mnProgressLastPos;
/// Current position progress, updated after every paragraph.
sal_Int32 mnProgressCurrentPos;
/// End position, i.e. the estimated number of paragraphs.
sal_Int32 mnProgressEndPos;
/// DocumentBaseURL
OUString m_rBaseURL;
css::uno::Sequence<css::beans::PropertyValue> maMediaDescriptor;
/// Graphic mapper
css::uno::Reference<css::graphic::XGraphicMapper> mxGraphicMapper;
private:
void resolveFastSubStream(Stream & rStream,
OOXMLStream::StreamType_t nType);
static void resolveFastSubStreamWithId(Stream & rStream,
const writerfilter::Reference<Stream>::Pointer_t& pStream,
sal_uInt32 nId);
css::uno::Reference<css::xml::dom::XDocument> importSubStream(OOXMLStream::StreamType_t nType);
void importSubStreamRelations(const OOXMLStream::Pointer_t& pStream, OOXMLStream::StreamType_t nType);
writerfilter::Reference<Stream>::Pointer_t
getSubStream(const OUString & rId);
writerfilter::Reference<Stream>::Pointer_t
getXNoteStream(OOXMLStream::StreamType_t nType, const sal_Int32 nNoteId);
void resolveCustomXmlStream(Stream & rStream);
void resolveGlossaryStream(Stream & rStream);
void resolveEmbeddingsStream(const OOXMLStream::Pointer_t& pStream);
public:
OOXMLDocumentImpl(OOXMLStream::Pointer_t const & pStream, const css::uno::Reference<css::task::XStatusIndicator>& xStatusIndicator, bool bSkipImages, const css::uno::Sequence<css::beans::PropertyValue>& rDescriptor);
virtual ~OOXMLDocumentImpl() override;
virtual void resolve(Stream & rStream) override;
virtual void resolveFootnote(Stream & rStream,
Id aType,
const sal_Int32 nNoteId) override;
virtual void resolveEndnote(Stream & rStream,
Id aType,
const sal_Int32 nNoteId) override;
virtual void resolveHeader(Stream & rStream,
const sal_Int32 type,
const OUString & rId) override;
virtual void resolveFooter(Stream & rStream,
const sal_Int32 type,
const OUString & rId) override;
virtual void resolveComment(Stream & rStream, const sal_Int32 nId) override;
OOXMLPropertySet * getPicturePropSet(const OUString & rId);
virtual void resolvePicture(Stream & rStream, const OUString & rId) override;
virtual OUString getTargetForId(const OUString & rId) override;
virtual void setModel(css::uno::Reference<css::frame::XModel> xModel) override;
virtual css::uno::Reference<css::frame::XModel> getModel() override;
virtual void setDrawPage(css::uno::Reference<css::drawing::XDrawPage> xDrawPage) override;
virtual css::uno::Reference<css::drawing::XDrawPage> getDrawPage() override;
virtual css::uno::Reference<css::io::XInputStream> getInputStreamForId(const OUString & rId) override;
virtual void setXNoteId(const sal_Int32 nId) override;
virtual sal_Int32 getXNoteId() const override;
virtual const OUString & getTarget() const override;
virtual css::uno::Reference<css::xml::sax::XFastShapeContextHandler> getShapeContext( ) override;
virtual void setShapeContext( css::uno::Reference<css::xml::sax::XFastShapeContextHandler> xContext ) override;
void pushShapeContext() override;
void popShapeContext() override;
virtual css::uno::Reference<css::xml::dom::XDocument> getThemeDom() override;
virtual css::uno::Sequence<css::uno::Reference<css::xml::dom::XDocument> > getCustomXmlDomList() override;
virtual css::uno::Sequence<css::uno::Reference<css::xml::dom::XDocument> > getCustomXmlDomPropsList() override;
virtual css::uno::Reference<css::xml::dom::XDocument> getGlossaryDocDom() override;
virtual css::uno::Sequence<css::uno::Sequence< css::uno::Any> > getGlossaryDomList() override;
virtual css::uno::Sequence<css::beans::PropertyValue > getEmbeddingsList() override;
void incrementProgress();
bool IsSkipImages() const { return mbSkipImages; };
OUString const& GetDocumentBaseURL() const { return m_rBaseURL; };
const css::uno::Sequence<css::beans::PropertyValue>& getMediaDescriptor() const;
const css::uno::Reference<css::graphic::XGraphicMapper>& getGraphicMapper() const
{
return mxGraphicMapper;
}
};
}
#endif // OOXML_DOCUMENT_IMPL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
{
"pile_set_name": "Github"
}
|
.jvectormap-label {
position: absolute;
display: none;
border: solid 1px #CDCDCD;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background: #292929;
color: white;
font-size: 10px!important;
padding: 3px;
z-index: 9999;
}
.jvectormap-zoomin, .jvectormap-zoomout {
position: absolute;
top: 100%;
margin-top: -25px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background: #d2d6de;//rgba(0,0,0,0.4);
padding: 5px;
color: #444;
cursor: pointer;
line-height: 10px;
text-align: center;
font-weight: bold;
box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.jvectormap-zoomin {
left: 100%;
margin-left: -50px;
}
.jvectormap-zoomout {
left: 100%;
margin-left: -30px;
}
|
{
"pile_set_name": "Github"
}
|
// File implement/oglplus/enums/ext/debug_output_severity_names.ipp
//
// Automatically generated file, DO NOT modify manually.
// Edit the source 'source/enums/oglplus/ext/debug_output_severity.txt'
// or the 'source/enums/make_enum.py' script instead.
//
// Copyright 2010-2019 Matus Chochlik.
// 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
//
namespace enums {
OGLPLUS_LIB_FUNC StrCRef ValueName_(
DebugOutputARBSeverity*,
GLenum value
)
#if (!OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)) && \
!defined(OGLPLUS_IMPL_EVN_DEBUGOUTPUTARBSEVERITY)
#define OGLPLUS_IMPL_EVN_DEBUGOUTPUTARBSEVERITY
{
switch(value)
{
#if defined GL_DEBUG_SEVERITY_HIGH_ARB
case GL_DEBUG_SEVERITY_HIGH_ARB: return StrCRef("DEBUG_SEVERITY_HIGH_ARB");
#endif
#if defined GL_DEBUG_SEVERITY_MEDIUM_ARB
case GL_DEBUG_SEVERITY_MEDIUM_ARB: return StrCRef("DEBUG_SEVERITY_MEDIUM_ARB");
#endif
#if defined GL_DEBUG_SEVERITY_LOW_ARB
case GL_DEBUG_SEVERITY_LOW_ARB: return StrCRef("DEBUG_SEVERITY_LOW_ARB");
#endif
#if defined GL_DONT_CARE
case GL_DONT_CARE: return StrCRef("DONT_CARE");
#endif
default:;
}
OGLPLUS_FAKE_USE(value);
return StrCRef();
}
#else
;
#endif
} // namespace enums
|
{
"pile_set_name": "Github"
}
|
import 'react-native';
import React from 'react';
import renderer from 'react-test-renderer';
import List from './../List';
test('renders AddressPicker', () => {
const tree = renderer
.create(
<List
selected="test"
onSelect={() => {}}
ranges={['10-20']}
title="test"
field="type"
updateListing={() => {}}
/>,
)
.toJSON();
expect(tree).toMatchSnapshot();
});
|
{
"pile_set_name": "Github"
}
|
---
margin-left: 6cm
margin-right: 3cm
---
|
{
"pile_set_name": "Github"
}
|
/*
* Zoran zr36057/zr36067 PCI controller driver, for the
* Pinnacle/Miro DC10/DC10+/DC30/DC30+, Iomega Buz, Linux
* Media Labs LML33/LML33R10.
*
* This part handles card-specific data and detection
*
* Copyright (C) 2000 Serguei Miridonov <[email protected]>
*
* Currently maintained by:
* Ronald Bultje <[email protected]>
* Laurent Pinchart <[email protected]>
* Mailinglist <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __ZORAN_CARD_H__
#define __ZORAN_CARD_H__
extern int zr36067_debug;
#define dprintk(num, format, args...) \
do { \
if (zr36067_debug >= num) \
printk(format, ##args); \
} while (0)
/* Anybody who uses more than four? */
#define BUZ_MAX 4
extern struct video_device zoran_template;
extern int zoran_check_jpg_settings(struct zoran *zr,
struct zoran_jpg_settings *settings,
int try);
extern void zoran_open_init_params(struct zoran *zr);
extern void zoran_vdev_release(struct video_device *vdev);
void zr36016_write(struct videocodec *codec, u16 reg, u32 val);
#endif /* __ZORAN_CARD_H__ */
|
{
"pile_set_name": "Github"
}
|
<app-child #child1></app-child>
<app-child #child2></app-child>
<button (click)="child2.greeting('Jeery')">调用child2的greeting </button><br>
{{message}}
|
{
"pile_set_name": "Github"
}
|
//===- llvm/CallingConvLower.h - Calling Conventions ------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file declares the CCState and CCValAssign classes, used for lowering
// and implementing calling conventions.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CODEGEN_CALLINGCONVLOWER_H
#define LLVM_CODEGEN_CALLINGCONVLOWER_H
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/TargetCallingConv.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Support/Alignment.h"
namespace llvm {
class CCState;
class MVT;
class TargetMachine;
class TargetRegisterInfo;
/// CCValAssign - Represent assignment of one arg/retval to a location.
class CCValAssign {
public:
enum LocInfo {
Full, // The value fills the full location.
SExt, // The value is sign extended in the location.
ZExt, // The value is zero extended in the location.
AExt, // The value is extended with undefined upper bits.
SExtUpper, // The value is in the upper bits of the location and should be
// sign extended when retrieved.
ZExtUpper, // The value is in the upper bits of the location and should be
// zero extended when retrieved.
AExtUpper, // The value is in the upper bits of the location and should be
// extended with undefined upper bits when retrieved.
BCvt, // The value is bit-converted in the location.
Trunc, // The value is truncated in the location.
VExt, // The value is vector-widened in the location.
// FIXME: Not implemented yet. Code that uses AExt to mean
// vector-widen should be fixed to use VExt instead.
FPExt, // The floating-point value is fp-extended in the location.
Indirect // The location contains pointer to the value.
// TODO: a subset of the value is in the location.
};
private:
/// ValNo - This is the value number begin assigned (e.g. an argument number).
unsigned ValNo;
/// Loc is either a stack offset or a register number.
unsigned Loc;
/// isMem - True if this is a memory loc, false if it is a register loc.
unsigned isMem : 1;
/// isCustom - True if this arg/retval requires special handling.
unsigned isCustom : 1;
/// Information about how the value is assigned.
LocInfo HTP : 6;
/// ValVT - The type of the value being assigned.
MVT ValVT;
/// LocVT - The type of the location being assigned to.
MVT LocVT;
public:
static CCValAssign getReg(unsigned ValNo, MVT ValVT,
unsigned RegNo, MVT LocVT,
LocInfo HTP) {
CCValAssign Ret;
Ret.ValNo = ValNo;
Ret.Loc = RegNo;
Ret.isMem = false;
Ret.isCustom = false;
Ret.HTP = HTP;
Ret.ValVT = ValVT;
Ret.LocVT = LocVT;
return Ret;
}
static CCValAssign getCustomReg(unsigned ValNo, MVT ValVT,
unsigned RegNo, MVT LocVT,
LocInfo HTP) {
CCValAssign Ret;
Ret = getReg(ValNo, ValVT, RegNo, LocVT, HTP);
Ret.isCustom = true;
return Ret;
}
static CCValAssign getMem(unsigned ValNo, MVT ValVT,
unsigned Offset, MVT LocVT,
LocInfo HTP) {
CCValAssign Ret;
Ret.ValNo = ValNo;
Ret.Loc = Offset;
Ret.isMem = true;
Ret.isCustom = false;
Ret.HTP = HTP;
Ret.ValVT = ValVT;
Ret.LocVT = LocVT;
return Ret;
}
static CCValAssign getCustomMem(unsigned ValNo, MVT ValVT,
unsigned Offset, MVT LocVT,
LocInfo HTP) {
CCValAssign Ret;
Ret = getMem(ValNo, ValVT, Offset, LocVT, HTP);
Ret.isCustom = true;
return Ret;
}
// There is no need to differentiate between a pending CCValAssign and other
// kinds, as they are stored in a different list.
static CCValAssign getPending(unsigned ValNo, MVT ValVT, MVT LocVT,
LocInfo HTP, unsigned ExtraInfo = 0) {
return getReg(ValNo, ValVT, ExtraInfo, LocVT, HTP);
}
void convertToReg(unsigned RegNo) {
Loc = RegNo;
isMem = false;
}
void convertToMem(unsigned Offset) {
Loc = Offset;
isMem = true;
}
unsigned getValNo() const { return ValNo; }
MVT getValVT() const { return ValVT; }
bool isRegLoc() const { return !isMem; }
bool isMemLoc() const { return isMem; }
bool needsCustom() const { return isCustom; }
Register getLocReg() const { assert(isRegLoc()); return Loc; }
unsigned getLocMemOffset() const { assert(isMemLoc()); return Loc; }
unsigned getExtraInfo() const { return Loc; }
MVT getLocVT() const { return LocVT; }
LocInfo getLocInfo() const { return HTP; }
bool isExtInLoc() const {
return (HTP == AExt || HTP == SExt || HTP == ZExt);
}
bool isUpperBitsInLoc() const {
return HTP == AExtUpper || HTP == SExtUpper || HTP == ZExtUpper;
}
};
/// Describes a register that needs to be forwarded from the prologue to a
/// musttail call.
struct ForwardedRegister {
ForwardedRegister(unsigned VReg, MCPhysReg PReg, MVT VT)
: VReg(VReg), PReg(PReg), VT(VT) {}
unsigned VReg;
MCPhysReg PReg;
MVT VT;
};
/// CCAssignFn - This function assigns a location for Val, updating State to
/// reflect the change. It returns 'true' if it failed to handle Val.
typedef bool CCAssignFn(unsigned ValNo, MVT ValVT,
MVT LocVT, CCValAssign::LocInfo LocInfo,
ISD::ArgFlagsTy ArgFlags, CCState &State);
/// CCCustomFn - This function assigns a location for Val, possibly updating
/// all args to reflect changes and indicates if it handled it. It must set
/// isCustom if it handles the arg and returns true.
typedef bool CCCustomFn(unsigned &ValNo, MVT &ValVT,
MVT &LocVT, CCValAssign::LocInfo &LocInfo,
ISD::ArgFlagsTy &ArgFlags, CCState &State);
/// CCState - This class holds information needed while lowering arguments and
/// return values. It captures which registers are already assigned and which
/// stack slots are used. It provides accessors to allocate these values.
class CCState {
private:
CallingConv::ID CallingConv;
bool IsVarArg;
bool AnalyzingMustTailForwardedRegs = false;
MachineFunction &MF;
const TargetRegisterInfo &TRI;
SmallVectorImpl<CCValAssign> &Locs;
LLVMContext &Context;
unsigned StackOffset;
Align MaxStackArgAlign;
SmallVector<uint32_t, 16> UsedRegs;
SmallVector<CCValAssign, 4> PendingLocs;
SmallVector<ISD::ArgFlagsTy, 4> PendingArgFlags;
// ByValInfo and SmallVector<ByValInfo, 4> ByValRegs:
//
// Vector of ByValInfo instances (ByValRegs) is introduced for byval registers
// tracking.
// Or, in another words it tracks byval parameters that are stored in
// general purpose registers.
//
// For 4 byte stack alignment,
// instance index means byval parameter number in formal
// arguments set. Assume, we have some "struct_type" with size = 4 bytes,
// then, for function "foo":
//
// i32 foo(i32 %p, %struct_type* %r, i32 %s, %struct_type* %t)
//
// ByValRegs[0] describes how "%r" is stored (Begin == r1, End == r2)
// ByValRegs[1] describes how "%t" is stored (Begin == r3, End == r4).
//
// In case of 8 bytes stack alignment,
// ByValRegs may also contain information about wasted registers.
// In function shown above, r3 would be wasted according to AAPCS rules.
// And in that case ByValRegs[1].Waste would be "true".
// ByValRegs vector size still would be 2,
// while "%t" goes to the stack: it wouldn't be described in ByValRegs.
//
// Supposed use-case for this collection:
// 1. Initially ByValRegs is empty, InRegsParamsProcessed is 0.
// 2. HandleByVal fillups ByValRegs.
// 3. Argument analysis (LowerFormatArguments, for example). After
// some byval argument was analyzed, InRegsParamsProcessed is increased.
struct ByValInfo {
ByValInfo(unsigned B, unsigned E, bool IsWaste = false) :
Begin(B), End(E), Waste(IsWaste) {}
// First register allocated for current parameter.
unsigned Begin;
// First after last register allocated for current parameter.
unsigned End;
// Means that current range of registers doesn't belong to any
// parameters. It was wasted due to stack alignment rules.
// For more information see:
// AAPCS, 5.5 Parameter Passing, Stage C, C.3.
bool Waste;
};
SmallVector<ByValInfo, 4 > ByValRegs;
// InRegsParamsProcessed - shows how many instances of ByValRegs was proceed
// during argument analysis.
unsigned InRegsParamsProcessed;
public:
CCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF,
SmallVectorImpl<CCValAssign> &locs, LLVMContext &C);
void addLoc(const CCValAssign &V) {
Locs.push_back(V);
}
LLVMContext &getContext() const { return Context; }
MachineFunction &getMachineFunction() const { return MF; }
CallingConv::ID getCallingConv() const { return CallingConv; }
bool isVarArg() const { return IsVarArg; }
/// getNextStackOffset - Return the next stack offset such that all stack
/// slots satisfy their alignment requirements.
unsigned getNextStackOffset() const {
return StackOffset;
}
/// getAlignedCallFrameSize - Return the size of the call frame needed to
/// be able to store all arguments and such that the alignment requirement
/// of each of the arguments is satisfied.
unsigned getAlignedCallFrameSize() const {
return alignTo(StackOffset, MaxStackArgAlign);
}
/// isAllocated - Return true if the specified register (or an alias) is
/// allocated.
bool isAllocated(unsigned Reg) const {
return UsedRegs[Reg/32] & (1 << (Reg&31));
}
/// AnalyzeFormalArguments - Analyze an array of argument values,
/// incorporating info about the formals into this state.
void AnalyzeFormalArguments(const SmallVectorImpl<ISD::InputArg> &Ins,
CCAssignFn Fn);
/// The function will invoke AnalyzeFormalArguments.
void AnalyzeArguments(const SmallVectorImpl<ISD::InputArg> &Ins,
CCAssignFn Fn) {
AnalyzeFormalArguments(Ins, Fn);
}
/// AnalyzeReturn - Analyze the returned values of a return,
/// incorporating info about the result values into this state.
void AnalyzeReturn(const SmallVectorImpl<ISD::OutputArg> &Outs,
CCAssignFn Fn);
/// CheckReturn - Analyze the return values of a function, returning
/// true if the return can be performed without sret-demotion, and
/// false otherwise.
bool CheckReturn(const SmallVectorImpl<ISD::OutputArg> &Outs,
CCAssignFn Fn);
/// AnalyzeCallOperands - Analyze the outgoing arguments to a call,
/// incorporating info about the passed values into this state.
void AnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArg> &Outs,
CCAssignFn Fn);
/// AnalyzeCallOperands - Same as above except it takes vectors of types
/// and argument flags.
void AnalyzeCallOperands(SmallVectorImpl<MVT> &ArgVTs,
SmallVectorImpl<ISD::ArgFlagsTy> &Flags,
CCAssignFn Fn);
/// The function will invoke AnalyzeCallOperands.
void AnalyzeArguments(const SmallVectorImpl<ISD::OutputArg> &Outs,
CCAssignFn Fn) {
AnalyzeCallOperands(Outs, Fn);
}
/// AnalyzeCallResult - Analyze the return values of a call,
/// incorporating info about the passed values into this state.
void AnalyzeCallResult(const SmallVectorImpl<ISD::InputArg> &Ins,
CCAssignFn Fn);
/// A shadow allocated register is a register that was allocated
/// but wasn't added to the location list (Locs).
/// \returns true if the register was allocated as shadow or false otherwise.
bool IsShadowAllocatedReg(unsigned Reg) const;
/// AnalyzeCallResult - Same as above except it's specialized for calls which
/// produce a single value.
void AnalyzeCallResult(MVT VT, CCAssignFn Fn);
/// getFirstUnallocated - Return the index of the first unallocated register
/// in the set, or Regs.size() if they are all allocated.
unsigned getFirstUnallocated(ArrayRef<MCPhysReg> Regs) const {
for (unsigned i = 0; i < Regs.size(); ++i)
if (!isAllocated(Regs[i]))
return i;
return Regs.size();
}
/// AllocateReg - Attempt to allocate one register. If it is not available,
/// return zero. Otherwise, return the register, marking it and any aliases
/// as allocated.
unsigned AllocateReg(unsigned Reg) {
if (isAllocated(Reg)) return 0;
MarkAllocated(Reg);
return Reg;
}
/// Version of AllocateReg with extra register to be shadowed.
unsigned AllocateReg(unsigned Reg, unsigned ShadowReg) {
if (isAllocated(Reg)) return 0;
MarkAllocated(Reg);
MarkAllocated(ShadowReg);
return Reg;
}
/// AllocateReg - Attempt to allocate one of the specified registers. If none
/// are available, return zero. Otherwise, return the first one available,
/// marking it and any aliases as allocated.
unsigned AllocateReg(ArrayRef<MCPhysReg> Regs) {
unsigned FirstUnalloc = getFirstUnallocated(Regs);
if (FirstUnalloc == Regs.size())
return 0; // Didn't find the reg.
// Mark the register and any aliases as allocated.
unsigned Reg = Regs[FirstUnalloc];
MarkAllocated(Reg);
return Reg;
}
/// AllocateRegBlock - Attempt to allocate a block of RegsRequired consecutive
/// registers. If this is not possible, return zero. Otherwise, return the first
/// register of the block that were allocated, marking the entire block as allocated.
unsigned AllocateRegBlock(ArrayRef<MCPhysReg> Regs, unsigned RegsRequired) {
if (RegsRequired > Regs.size())
return 0;
for (unsigned StartIdx = 0; StartIdx <= Regs.size() - RegsRequired;
++StartIdx) {
bool BlockAvailable = true;
// Check for already-allocated regs in this block
for (unsigned BlockIdx = 0; BlockIdx < RegsRequired; ++BlockIdx) {
if (isAllocated(Regs[StartIdx + BlockIdx])) {
BlockAvailable = false;
break;
}
}
if (BlockAvailable) {
// Mark the entire block as allocated
for (unsigned BlockIdx = 0; BlockIdx < RegsRequired; ++BlockIdx) {
MarkAllocated(Regs[StartIdx + BlockIdx]);
}
return Regs[StartIdx];
}
}
// No block was available
return 0;
}
/// Version of AllocateReg with list of registers to be shadowed.
unsigned AllocateReg(ArrayRef<MCPhysReg> Regs, const MCPhysReg *ShadowRegs) {
unsigned FirstUnalloc = getFirstUnallocated(Regs);
if (FirstUnalloc == Regs.size())
return 0; // Didn't find the reg.
// Mark the register and any aliases as allocated.
unsigned Reg = Regs[FirstUnalloc], ShadowReg = ShadowRegs[FirstUnalloc];
MarkAllocated(Reg);
MarkAllocated(ShadowReg);
return Reg;
}
/// AllocateStack - Allocate a chunk of stack space with the specified size
/// and alignment.
unsigned AllocateStack(unsigned Size, unsigned Alignment) {
const Align CheckedAlignment(Alignment);
StackOffset = alignTo(StackOffset, CheckedAlignment);
unsigned Result = StackOffset;
StackOffset += Size;
MaxStackArgAlign = std::max(CheckedAlignment, MaxStackArgAlign);
ensureMaxAlignment(CheckedAlignment);
return Result;
}
void ensureMaxAlignment(Align Alignment) {
if (!AnalyzingMustTailForwardedRegs)
MF.getFrameInfo().ensureMaxAlignment(Alignment.value());
}
/// Version of AllocateStack with extra register to be shadowed.
unsigned AllocateStack(unsigned Size, unsigned Align, unsigned ShadowReg) {
MarkAllocated(ShadowReg);
return AllocateStack(Size, Align);
}
/// Version of AllocateStack with list of extra registers to be shadowed.
/// Note that, unlike AllocateReg, this shadows ALL of the shadow registers.
unsigned AllocateStack(unsigned Size, unsigned Align,
ArrayRef<MCPhysReg> ShadowRegs) {
for (unsigned i = 0; i < ShadowRegs.size(); ++i)
MarkAllocated(ShadowRegs[i]);
return AllocateStack(Size, Align);
}
// HandleByVal - Allocate a stack slot large enough to pass an argument by
// value. The size and alignment information of the argument is encoded in its
// parameter attribute.
void HandleByVal(unsigned ValNo, MVT ValVT,
MVT LocVT, CCValAssign::LocInfo LocInfo,
int MinSize, int MinAlign, ISD::ArgFlagsTy ArgFlags);
// Returns count of byval arguments that are to be stored (even partly)
// in registers.
unsigned getInRegsParamsCount() const { return ByValRegs.size(); }
// Returns count of byval in-regs arguments proceed.
unsigned getInRegsParamsProcessed() const { return InRegsParamsProcessed; }
// Get information about N-th byval parameter that is stored in registers.
// Here "ByValParamIndex" is N.
void getInRegsParamInfo(unsigned InRegsParamRecordIndex,
unsigned& BeginReg, unsigned& EndReg) const {
assert(InRegsParamRecordIndex < ByValRegs.size() &&
"Wrong ByVal parameter index");
const ByValInfo& info = ByValRegs[InRegsParamRecordIndex];
BeginReg = info.Begin;
EndReg = info.End;
}
// Add information about parameter that is kept in registers.
void addInRegsParamInfo(unsigned RegBegin, unsigned RegEnd) {
ByValRegs.push_back(ByValInfo(RegBegin, RegEnd));
}
// Goes either to next byval parameter (excluding "waste" record), or
// to the end of collection.
// Returns false, if end is reached.
bool nextInRegsParam() {
unsigned e = ByValRegs.size();
if (InRegsParamsProcessed < e)
++InRegsParamsProcessed;
return InRegsParamsProcessed < e;
}
// Clear byval registers tracking info.
void clearByValRegsInfo() {
InRegsParamsProcessed = 0;
ByValRegs.clear();
}
// Rewind byval registers tracking info.
void rewindByValRegsInfo() {
InRegsParamsProcessed = 0;
}
// Get list of pending assignments
SmallVectorImpl<CCValAssign> &getPendingLocs() {
return PendingLocs;
}
// Get a list of argflags for pending assignments.
SmallVectorImpl<ISD::ArgFlagsTy> &getPendingArgFlags() {
return PendingArgFlags;
}
/// Compute the remaining unused register parameters that would be used for
/// the given value type. This is useful when varargs are passed in the
/// registers that normal prototyped parameters would be passed in, or for
/// implementing perfect forwarding.
void getRemainingRegParmsForType(SmallVectorImpl<MCPhysReg> &Regs, MVT VT,
CCAssignFn Fn);
/// Compute the set of registers that need to be preserved and forwarded to
/// any musttail calls.
void analyzeMustTailForwardedRegisters(
SmallVectorImpl<ForwardedRegister> &Forwards, ArrayRef<MVT> RegParmTypes,
CCAssignFn Fn);
/// Returns true if the results of the two calling conventions are compatible.
/// This is usually part of the check for tailcall eligibility.
static bool resultsCompatible(CallingConv::ID CalleeCC,
CallingConv::ID CallerCC, MachineFunction &MF,
LLVMContext &C,
const SmallVectorImpl<ISD::InputArg> &Ins,
CCAssignFn CalleeFn, CCAssignFn CallerFn);
/// The function runs an additional analysis pass over function arguments.
/// It will mark each argument with the attribute flag SecArgPass.
/// After running, it will sort the locs list.
template <class T>
void AnalyzeArgumentsSecondPass(const SmallVectorImpl<T> &Args,
CCAssignFn Fn) {
unsigned NumFirstPassLocs = Locs.size();
/// Creates similar argument list to \p Args in which each argument is
/// marked using SecArgPass flag.
SmallVector<T, 16> SecPassArg;
// SmallVector<ISD::InputArg, 16> SecPassArg;
for (auto Arg : Args) {
Arg.Flags.setSecArgPass();
SecPassArg.push_back(Arg);
}
// Run the second argument pass
AnalyzeArguments(SecPassArg, Fn);
// Sort the locations of the arguments according to their original position.
SmallVector<CCValAssign, 16> TmpArgLocs;
TmpArgLocs.swap(Locs);
auto B = TmpArgLocs.begin(), E = TmpArgLocs.end();
std::merge(B, B + NumFirstPassLocs, B + NumFirstPassLocs, E,
std::back_inserter(Locs),
[](const CCValAssign &A, const CCValAssign &B) -> bool {
return A.getValNo() < B.getValNo();
});
}
private:
/// MarkAllocated - Mark a register and all of its aliases as allocated.
void MarkAllocated(unsigned Reg);
};
} // end namespace llvm
#endif // LLVM_CODEGEN_CALLINGCONVLOWER_H
|
{
"pile_set_name": "Github"
}
|
// -------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
// -------------------------------------------------------------------------------------------------------
#include "unixasmmacros.inc"
.syntax unified
.thumb
.global C_FUNC(_ZN2Js13ScriptContext31ProfileModeDeferredParsingThunkEPNS_16RecyclableObjectENS_8CallInfoEz)
.global C_FUNC(_ZN2Js13ScriptContext35ProfileModeDeferredDeserializeThunkEPNS_16RecyclableObjectENS_8CallInfoEz)
NESTED_ENTRY _ZN2Js13ScriptContext31ProfileModeDeferredParsingThunkEPNS_16RecyclableObjectENS_8CallInfoEz, _TEXT, NoHandler
PROLOG_PUSH {r0-r3}
PROLOG_PUSH {r11}
PROLOG_PUSH {lr} // save volatile registers
mov r0, sp // Pass the address of the function at the saved r0 in case it need to be boxed
bl C_FUNC(_ZN2Js13ScriptContext24ProfileModeDeferredParseEPPNS_14ScriptFunctionE)
mov r12, r0 // back up entry point
EPILOG_POP {lr}
EPILOG_POP {r11}
EPILOG_POP {r0-r3} // restore arguments and return address
bx r12 // jump (tail call) to new entryPoint
NESTED_END _ZN2Js13ScriptContext31ProfileModeDeferredParsingThunkEPNS_16RecyclableObjectENS_8CallInfoEz, _TEXT
NESTED_ENTRY _ZN2Js13ScriptContext35ProfileModeDeferredDeserializeThunkEPNS_16RecyclableObjectENS_8CallInfoEz, _TEXT, NoHandler
PROLOG_PUSH {r0-r3}
PROLOG_PUSH {r11}
PROLOG_PUSH {lr} // save volatile registers
bl C_FUNC(_ZN2Js13ScriptContext30ProfileModeDeferredDeserializeEPNS_14ScriptFunctionE)
mov r12, r0 // backup entry point
EPILOG_POP {lr}
EPILOG_POP {r11}
EPILOG_POP {r0-r3} // restore arguments and return address
bx r12 // jump (tail call) to new entryPoint
NESTED_END _ZN2Js13ScriptContext35ProfileModeDeferredDeserializeThunkEPNS_16RecyclableObjectENS_8CallInfoEz, _TEXT
|
{
"pile_set_name": "Github"
}
|
namespace System.Windows.Controls
{
public class SelectionSingle
{
}
}
|
{
"pile_set_name": "Github"
}
|
Thread 1.
Thread 2.
Finished.
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
|
{
"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.bookkeeper.tls;
import org.apache.bookkeeper.common.util.ReflectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A factory to manage security provider factories.
*/
public abstract class SecurityProviderFactoryFactory {
private static final Logger LOG = LoggerFactory.getLogger(SecurityProviderFactoryFactory.class);
public static SecurityHandlerFactory getSecurityProviderFactory(String securityHandler)
throws SecurityException {
if ((securityHandler == null) || (securityHandler.equals(""))) {
return null;
}
SecurityHandlerFactory shFactory;
try {
Class<? extends SecurityHandlerFactory> shFactoryClass =
ReflectionUtils.forName(securityHandler, SecurityHandlerFactory.class);
shFactory = ReflectionUtils.newInstance(shFactoryClass);
LOG.info("Loaded security handler for {}", securityHandler);
} catch (RuntimeException re) {
LOG.error("Unable to load security handler for {}: ", securityHandler, re.getCause());
throw new SecurityException(re.getCause());
}
return shFactory;
}
}
|
{
"pile_set_name": "Github"
}
|
/*******************************************************************************
* HellFirePvP / Astral Sorcery 2020
*
* All rights reserved.
* The source code is available on github: https://github.com/HellFirePvP/AstralSorcery
* For further details, see the License file there.
******************************************************************************/
package hellfirepvp.astralsorcery.common.integration;
import hellfirepvp.astralsorcery.AstralSorcery;
import hellfirepvp.astralsorcery.common.container.ContainerAltarAttunement;
import hellfirepvp.astralsorcery.common.container.ContainerAltarConstellation;
import hellfirepvp.astralsorcery.common.container.ContainerAltarDiscovery;
import hellfirepvp.astralsorcery.common.container.ContainerAltarTrait;
import hellfirepvp.astralsorcery.common.integration.jei.*;
import hellfirepvp.astralsorcery.common.lib.BlocksAS;
import hellfirepvp.astralsorcery.common.lib.ItemsAS;
import mezz.jei.api.IModPlugin;
import mezz.jei.api.JeiPlugin;
import mezz.jei.api.helpers.IGuiHelper;
import mezz.jei.api.helpers.IStackHelper;
import mezz.jei.api.recipe.transfer.IRecipeTransferHandlerHelper;
import mezz.jei.api.registration.*;
import mezz.jei.api.runtime.IJeiRuntime;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import java.util.ArrayList;
import java.util.List;
/**
* This class is part of the Astral Sorcery Mod
* The complete source code for this mod can be found on github.
* Class: IntegrationJEI
* Created by HellFirePvP
* Date: 25.07.2020 / 09:23
*/
@JeiPlugin
public class IntegrationJEI implements IModPlugin {
public static final List<JEICategory<?>> CATEGORIES = new ArrayList<>();
public static final ResourceLocation CATEGORY_ALTAR_ATTUNEMENT = AstralSorcery.key("altar_attunement");
public static final ResourceLocation CATEGORY_ALTAR_CONSTELLATION = AstralSorcery.key("altar_constellation");
public static final ResourceLocation CATEGORY_ALTAR_DISCOVERY = AstralSorcery.key("altar_discovery");
public static final ResourceLocation CATEGORY_ALTAR_TRAIT = AstralSorcery.key("altar_trait");
public static final ResourceLocation CATEGORY_INFUSER = AstralSorcery.key("infuser");
public static final ResourceLocation CATEGORY_TRANSMUTATION = AstralSorcery.key("transmutation");
public static final ResourceLocation CATEGORY_WELL = AstralSorcery.key("well");
public static IJeiRuntime runtime = null;
@Override
public void registerItemSubtypes(ISubtypeRegistration registry) {
registry.useNbtForSubtypes(
ItemsAS.ATTUNED_ROCK_CRYSTAL,
ItemsAS.ATTUNED_CELESTIAL_CRYSTAL,
BlocksAS.ROCK_COLLECTOR_CRYSTAL.asItem(),
BlocksAS.CELESTIAL_COLLECTOR_CRYSTAL.asItem(),
BlocksAS.CELESTIAL_CRYSTAL_CLUSTER.asItem(),
BlocksAS.GEM_CRYSTAL_CLUSTER.asItem(),
ItemsAS.MANTLE,
ItemsAS.RESONATOR
);
}
@Override
public void registerCategories(IRecipeCategoryRegistration registry) {
IGuiHelper guiHelper = registry.getJeiHelpers().getGuiHelper();
if (CATEGORIES.isEmpty()) {
CATEGORIES.add(new CategoryAltar(CATEGORY_ALTAR_DISCOVERY, "altar_discovery", BlocksAS.ALTAR_DISCOVERY, guiHelper));
CATEGORIES.add(new CategoryAltar(CATEGORY_ALTAR_ATTUNEMENT, "altar_attunement", BlocksAS.ALTAR_ATTUNEMENT, guiHelper));
CATEGORIES.add(new CategoryAltar(CATEGORY_ALTAR_CONSTELLATION, "altar_constellation", BlocksAS.ALTAR_CONSTELLATION, guiHelper));
CATEGORIES.add(new CategoryAltar(CATEGORY_ALTAR_TRAIT, "altar_trait", BlocksAS.ALTAR_RADIANCE, guiHelper));
CATEGORIES.add(new CategoryInfuser(guiHelper));
CATEGORIES.add(new CategoryTransmutation(guiHelper));
CATEGORIES.add(new CategoryWell(guiHelper));
}
CATEGORIES.forEach(registry::addRecipeCategories);
}
@Override
public void registerRecipes(IRecipeRegistration registry) {
CATEGORIES.forEach(category -> registry.addRecipes(category.getRecipes(), category.getUid()));
}
@Override
public void registerRecipeCatalysts(IRecipeCatalystRegistration registry) {
registry.addRecipeCatalyst(new ItemStack(BlocksAS.ALTAR_DISCOVERY), CATEGORY_ALTAR_DISCOVERY);
registry.addRecipeCatalyst(new ItemStack(BlocksAS.ALTAR_ATTUNEMENT), CATEGORY_ALTAR_ATTUNEMENT);
registry.addRecipeCatalyst(new ItemStack(BlocksAS.ALTAR_CONSTELLATION), CATEGORY_ALTAR_CONSTELLATION);
registry.addRecipeCatalyst(new ItemStack(BlocksAS.ALTAR_RADIANCE), CATEGORY_ALTAR_TRAIT);
registry.addRecipeCatalyst(new ItemStack(BlocksAS.INFUSER), CATEGORY_INFUSER);
registry.addRecipeCatalyst(new ItemStack(BlocksAS.LENS), CATEGORY_TRANSMUTATION);
registry.addRecipeCatalyst(new ItemStack(BlocksAS.WELL), CATEGORY_WELL);
}
@Override
public void registerRecipeTransferHandlers(IRecipeTransferRegistration registry) {
IStackHelper stackHelper = registry.getJeiHelpers().getStackHelper();
IRecipeTransferHandlerHelper transferHelper = registry.getTransferHelper();
// T1 recipes
registry.addRecipeTransferHandler(new TieredAltarRecipeTransferHandler<>(ContainerAltarDiscovery.class,
stackHelper, transferHelper, 9), CATEGORY_ALTAR_DISCOVERY);
registry.addRecipeTransferHandler(new TieredAltarRecipeTransferHandler<>(ContainerAltarAttunement.class,
stackHelper, transferHelper, 13), CATEGORY_ALTAR_DISCOVERY);
registry.addRecipeTransferHandler(new TieredAltarRecipeTransferHandler<>(ContainerAltarConstellation.class,
stackHelper, transferHelper, 21), CATEGORY_ALTAR_DISCOVERY);
registry.addRecipeTransferHandler(new TieredAltarRecipeTransferHandler<>(ContainerAltarTrait.class,
stackHelper, transferHelper, 25), CATEGORY_ALTAR_DISCOVERY);
// T2 recipes
registry.addRecipeTransferHandler(new TieredAltarRecipeTransferHandler<>(ContainerAltarAttunement.class,
stackHelper, transferHelper, 13), CATEGORY_ALTAR_ATTUNEMENT);
registry.addRecipeTransferHandler(new TieredAltarRecipeTransferHandler<>(ContainerAltarConstellation.class,
stackHelper, transferHelper, 21), CATEGORY_ALTAR_ATTUNEMENT);
registry.addRecipeTransferHandler(new TieredAltarRecipeTransferHandler<>(ContainerAltarTrait.class,
stackHelper, transferHelper, 25), CATEGORY_ALTAR_ATTUNEMENT);
// T3 recipes
registry.addRecipeTransferHandler(new TieredAltarRecipeTransferHandler<>(ContainerAltarConstellation.class,
stackHelper, transferHelper, 21), CATEGORY_ALTAR_CONSTELLATION);
registry.addRecipeTransferHandler(new TieredAltarRecipeTransferHandler<>(ContainerAltarTrait.class,
stackHelper, transferHelper, 25), CATEGORY_ALTAR_CONSTELLATION);
// T4 recipes
registry.addRecipeTransferHandler(new TieredAltarRecipeTransferHandler<>(ContainerAltarTrait.class,
stackHelper, transferHelper, 25), CATEGORY_ALTAR_TRAIT);
}
@Override
public void onRuntimeAvailable(IJeiRuntime jeiRuntime) {
runtime = jeiRuntime;
}
@Override
public ResourceLocation getPluginUid() {
return AstralSorcery.key("jei_integration");
}
}
|
{
"pile_set_name": "Github"
}
|
/* SPDX-License-Identifier: GPL-2.0-only */
/* Hardware definitions for SSI.
*
* Copyright (C) 2010 Nokia Corporation. All rights reserved.
*
* Contact: Carlos Chinea <[email protected]>
*/
#ifndef __OMAP_SSI_REGS_H__
#define __OMAP_SSI_REGS_H__
/*
* SSI SYS registers
*/
#define SSI_REVISION_REG 0
# define SSI_REV_MAJOR 0xf0
# define SSI_REV_MINOR 0xf
#define SSI_SYSCONFIG_REG 0x10
# define SSI_AUTOIDLE (1 << 0)
# define SSI_SOFTRESET (1 << 1)
# define SSI_SIDLEMODE_FORCE 0
# define SSI_SIDLEMODE_NO (1 << 3)
# define SSI_SIDLEMODE_SMART (1 << 4)
# define SSI_SIDLEMODE_MASK 0x18
# define SSI_MIDLEMODE_FORCE 0
# define SSI_MIDLEMODE_NO (1 << 12)
# define SSI_MIDLEMODE_SMART (1 << 13)
# define SSI_MIDLEMODE_MASK 0x3000
#define SSI_SYSSTATUS_REG 0x14
# define SSI_RESETDONE 1
#define SSI_MPU_STATUS_REG(port, irq) (0x808 + ((port) * 0x10) + ((irq) * 2))
#define SSI_MPU_ENABLE_REG(port, irq) (0x80c + ((port) * 0x10) + ((irq) * 8))
# define SSI_DATAACCEPT(channel) (1 << (channel))
# define SSI_DATAAVAILABLE(channel) (1 << ((channel) + 8))
# define SSI_DATAOVERRUN(channel) (1 << ((channel) + 16))
# define SSI_ERROROCCURED (1 << 24)
# define SSI_BREAKDETECTED (1 << 25)
#define SSI_GDD_MPU_IRQ_STATUS_REG 0x0800
#define SSI_GDD_MPU_IRQ_ENABLE_REG 0x0804
# define SSI_GDD_LCH(channel) (1 << (channel))
#define SSI_WAKE_REG(port) (0xc00 + ((port) * 0x10))
#define SSI_CLEAR_WAKE_REG(port) (0xc04 + ((port) * 0x10))
#define SSI_SET_WAKE_REG(port) (0xc08 + ((port) * 0x10))
# define SSI_WAKE(channel) (1 << (channel))
# define SSI_WAKE_MASK 0xff
/*
* SSI SST registers
*/
#define SSI_SST_ID_REG 0
#define SSI_SST_MODE_REG 4
# define SSI_MODE_VAL_MASK 3
# define SSI_MODE_SLEEP 0
# define SSI_MODE_STREAM 1
# define SSI_MODE_FRAME 2
# define SSI_MODE_MULTIPOINTS 3
#define SSI_SST_FRAMESIZE_REG 8
# define SSI_FRAMESIZE_DEFAULT 31
#define SSI_SST_TXSTATE_REG 0xc
# define SSI_TXSTATE_IDLE 0
#define SSI_SST_BUFSTATE_REG 0x10
# define SSI_FULL(channel) (1 << (channel))
#define SSI_SST_DIVISOR_REG 0x18
# define SSI_MAX_DIVISOR 127
#define SSI_SST_BREAK_REG 0x20
#define SSI_SST_CHANNELS_REG 0x24
# define SSI_CHANNELS_DEFAULT 4
#define SSI_SST_ARBMODE_REG 0x28
# define SSI_ARBMODE_ROUNDROBIN 0
# define SSI_ARBMODE_PRIORITY 1
#define SSI_SST_BUFFER_CH_REG(channel) (0x80 + ((channel) * 4))
#define SSI_SST_SWAPBUF_CH_REG(channel) (0xc0 + ((channel) * 4))
/*
* SSI SSR registers
*/
#define SSI_SSR_ID_REG 0
#define SSI_SSR_MODE_REG 4
#define SSI_SSR_FRAMESIZE_REG 8
#define SSI_SSR_RXSTATE_REG 0xc
#define SSI_SSR_BUFSTATE_REG 0x10
# define SSI_NOTEMPTY(channel) (1 << (channel))
#define SSI_SSR_BREAK_REG 0x1c
#define SSI_SSR_ERROR_REG 0x20
#define SSI_SSR_ERRORACK_REG 0x24
#define SSI_SSR_OVERRUN_REG 0x2c
#define SSI_SSR_OVERRUNACK_REG 0x30
#define SSI_SSR_TIMEOUT_REG 0x34
# define SSI_TIMEOUT_DEFAULT 0
#define SSI_SSR_CHANNELS_REG 0x28
#define SSI_SSR_BUFFER_CH_REG(channel) (0x80 + ((channel) * 4))
#define SSI_SSR_SWAPBUF_CH_REG(channel) (0xc0 + ((channel) * 4))
/*
* SSI GDD registers
*/
#define SSI_GDD_HW_ID_REG 0
#define SSI_GDD_PPORT_ID_REG 0x10
#define SSI_GDD_MPORT_ID_REG 0x14
#define SSI_GDD_PPORT_SR_REG 0x20
#define SSI_GDD_MPORT_SR_REG 0x24
# define SSI_ACTIVE_LCH_NUM_MASK 0xff
#define SSI_GDD_TEST_REG 0x40
# define SSI_TEST 1
#define SSI_GDD_GCR_REG 0x100
# define SSI_CLK_AUTOGATING_ON (1 << 3)
# define SSI_FREE (1 << 2)
# define SSI_SWITCH_OFF (1 << 0)
#define SSI_GDD_GRST_REG 0x200
# define SSI_SWRESET 1
#define SSI_GDD_CSDP_REG(channel) (0x800 + ((channel) * 0x40))
# define SSI_DST_BURST_EN_MASK 0xc000
# define SSI_DST_SINGLE_ACCESS0 0
# define SSI_DST_SINGLE_ACCESS (1 << 14)
# define SSI_DST_BURST_4x32_BIT (2 << 14)
# define SSI_DST_BURST_8x32_BIT (3 << 14)
# define SSI_DST_MASK 0x1e00
# define SSI_DST_MEMORY_PORT (8 << 9)
# define SSI_DST_PERIPHERAL_PORT (9 << 9)
# define SSI_SRC_BURST_EN_MASK 0x180
# define SSI_SRC_SINGLE_ACCESS0 0
# define SSI_SRC_SINGLE_ACCESS (1 << 7)
# define SSI_SRC_BURST_4x32_BIT (2 << 7)
# define SSI_SRC_BURST_8x32_BIT (3 << 7)
# define SSI_SRC_MASK 0x3c
# define SSI_SRC_MEMORY_PORT (8 << 2)
# define SSI_SRC_PERIPHERAL_PORT (9 << 2)
# define SSI_DATA_TYPE_MASK 3
# define SSI_DATA_TYPE_S32 2
#define SSI_GDD_CCR_REG(channel) (0x802 + ((channel) * 0x40))
# define SSI_DST_AMODE_MASK (3 << 14)
# define SSI_DST_AMODE_CONST 0
# define SSI_DST_AMODE_POSTINC (1 << 12)
# define SSI_SRC_AMODE_MASK (3 << 12)
# define SSI_SRC_AMODE_CONST 0
# define SSI_SRC_AMODE_POSTINC (1 << 12)
# define SSI_CCR_ENABLE (1 << 7)
# define SSI_CCR_SYNC_MASK 0x1f
#define SSI_GDD_CICR_REG(channel) (0x804 + ((channel) * 0x40))
# define SSI_BLOCK_IE (1 << 5)
# define SSI_HALF_IE (1 << 2)
# define SSI_TOUT_IE (1 << 0)
#define SSI_GDD_CSR_REG(channel) (0x806 + ((channel) * 0x40))
# define SSI_CSR_SYNC (1 << 6)
# define SSI_CSR_BLOCK (1 << 5)
# define SSI_CSR_HALF (1 << 2)
# define SSI_CSR_TOUR (1 << 0)
#define SSI_GDD_CSSA_REG(channel) (0x808 + ((channel) * 0x40))
#define SSI_GDD_CDSA_REG(channel) (0x80c + ((channel) * 0x40))
#define SSI_GDD_CEN_REG(channel) (0x810 + ((channel) * 0x40))
#define SSI_GDD_CSAC_REG(channel) (0x818 + ((channel) * 0x40))
#define SSI_GDD_CDAC_REG(channel) (0x81a + ((channel) * 0x40))
#define SSI_GDD_CLNK_CTRL_REG(channel) (0x828 + ((channel) * 0x40))
# define SSI_ENABLE_LNK (1 << 15)
# define SSI_STOP_LNK (1 << 14)
# define SSI_NEXT_CH_ID_MASK 0xf
#endif /* __OMAP_SSI_REGS_H__ */
|
{
"pile_set_name": "Github"
}
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="8dp"
android:height="12dp"
android:viewportWidth="8"
android:viewportHeight="12">
<path
android:pathData="M2,0L0.59,1.41L5.17,6L0.59,10.59L2,12L8,6L2,0Z"
android:fillColor="@color/grey_400"/>
</vector>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef __NVKM_SECBOOT_LS_UCODE_H__
#define __NVKM_SECBOOT_LS_UCODE_H__
#include <core/os.h>
#include <core/subdev.h>
#include <subdev/secboot.h>
struct nvkm_acr;
/**
* struct ls_ucode_img_desc - descriptor of firmware image
* @descriptor_size: size of this descriptor
* @image_size: size of the whole image
* @bootloader_start_offset: start offset of the bootloader in ucode image
* @bootloader_size: size of the bootloader
* @bootloader_imem_offset: start off set of the bootloader in IMEM
* @bootloader_entry_point: entry point of the bootloader in IMEM
* @app_start_offset: start offset of the LS firmware
* @app_size: size of the LS firmware's code and data
* @app_imem_offset: offset of the app in IMEM
* @app_imem_entry: entry point of the app in IMEM
* @app_dmem_offset: offset of the data in DMEM
* @app_resident_code_offset: offset of app code from app_start_offset
* @app_resident_code_size: size of the code
* @app_resident_data_offset: offset of data from app_start_offset
* @app_resident_data_size: size of data
*
* A firmware image contains the code, data, and bootloader of a given LS
* falcon in a single blob. This structure describes where everything is.
*
* This can be generated from a (bootloader, code, data) set if they have
* been loaded separately, or come directly from a file.
*/
struct ls_ucode_img_desc {
u32 descriptor_size;
u32 image_size;
u32 tools_version;
u32 app_version;
char date[64];
u32 bootloader_start_offset;
u32 bootloader_size;
u32 bootloader_imem_offset;
u32 bootloader_entry_point;
u32 app_start_offset;
u32 app_size;
u32 app_imem_offset;
u32 app_imem_entry;
u32 app_dmem_offset;
u32 app_resident_code_offset;
u32 app_resident_code_size;
u32 app_resident_data_offset;
u32 app_resident_data_size;
u32 nb_overlays;
struct {u32 start; u32 size; } load_ovl[64];
u32 compressed;
};
/**
* struct ls_ucode_img - temporary storage for loaded LS firmwares
* @node: to link within lsf_ucode_mgr
* @falcon_id: ID of the falcon this LS firmware is for
* @ucode_desc: loaded or generated map of ucode_data
* @ucode_data: firmware payload (code and data)
* @ucode_size: size in bytes of data in ucode_data
* @ucode_off: offset of the ucode in ucode_data
* @sig: signature for this firmware
* @sig:size: size of the signature in bytes
*
* Preparing the WPR LS blob requires information about all the LS firmwares
* (size, etc) to be known. This structure contains all the data of one LS
* firmware.
*/
struct ls_ucode_img {
struct list_head node;
enum nvkm_secboot_falcon falcon_id;
struct ls_ucode_img_desc ucode_desc;
u8 *ucode_data;
u32 ucode_size;
u32 ucode_off;
u8 *sig;
u32 sig_size;
};
/**
* struct fw_bin_header - header of firmware files
* @bin_magic: always 0x3b1d14f0
* @bin_ver: version of the bin format
* @bin_size: entire image size including this header
* @header_offset: offset of the firmware/bootloader header in the file
* @data_offset: offset of the firmware/bootloader payload in the file
* @data_size: size of the payload
*
* This header is located at the beginning of the HS firmware and HS bootloader
* files, to describe where the headers and data can be found.
*/
struct fw_bin_header {
u32 bin_magic;
u32 bin_ver;
u32 bin_size;
u32 header_offset;
u32 data_offset;
u32 data_size;
};
/**
* struct fw_bl_desc - firmware bootloader descriptor
* @start_tag: starting tag of bootloader
* @desc_dmem_load_off: DMEM offset of flcn_bl_dmem_desc
* @code_off: offset of code section
* @code_size: size of code section
* @data_off: offset of data section
* @data_size: size of data section
*
* This structure is embedded in bootloader firmware files at to describe the
* IMEM and DMEM layout expected by the bootloader.
*/
struct fw_bl_desc {
u32 start_tag;
u32 dmem_load_off;
u32 code_off;
u32 code_size;
u32 data_off;
u32 data_size;
};
int acr_ls_ucode_load_fecs(const struct nvkm_secboot *, struct ls_ucode_img *);
int acr_ls_ucode_load_gpccs(const struct nvkm_secboot *, struct ls_ucode_img *);
int acr_ls_ucode_load_pmu(const struct nvkm_secboot *, struct ls_ucode_img *);
int acr_ls_pmu_post_run(const struct nvkm_acr *, const struct nvkm_secboot *);
int acr_ls_ucode_load_sec2(const struct nvkm_secboot *, struct ls_ucode_img *);
int acr_ls_sec2_post_run(const struct nvkm_acr *, const struct nvkm_secboot *);
#endif
|
{
"pile_set_name": "Github"
}
|
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
|
{
"pile_set_name": "Github"
}
|
#Process Declaration File for Cloud Provider Heroku.
# Knabe 2018-01-15
web: java -jar target/spring-ddd-bank-0.1-SNAPSHOT.jar
|
{
"pile_set_name": "Github"
}
|
/* button list */
.button-group { display:inline-block; overflow:hidden; border:1px solid #d4d4d4; border-radius:3px; border-bottom-color:#bcbcbc; background:#f5f5f5; background:-moz-linear-gradient(#f5f5f5,#e5e5e5); background:-webkit-linear-gradient(#f5f5f5,#e5e5e5); -ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5',endColorstr='#e5e5e5')";}
.button-group li{ margin:0!important; float:left; }
.button-group li:first-child .grouped-button { border-left:none; border-bottom-left-radius:2px; border-top-left-radius:2px; }
.button-group li:last-child .grouped-button { border-right:none; border-bottom-right-radius:2px; border-bottom-left-radius:2px; }
.button-group .grouped-button { float:left;background:none; border-bottom:none; border-top:none; border-left:1px solid rgba(0,0,0,0.1); border-right:1px solid rgba(255,255,255,0.5); border-radius:0; cursor:pointer; }
.button-group .minibutton {position:relative;display:inline-block;padding:0 10px 0 10px;color:#333;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13px;font-weight:bold;line-height:24px;text-shadow:0 1px 0 #fff;white-space:nowrap;border-bottom-color:#bcbcbc;border-radius:3px;background:#fafafa;background:-moz-linear-gradient(#fafafa,#eaeaea);background:-webkit-linear-gradient(#fafafa,#eaeaea);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#eaeaea')";cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
/* line-no */
#blob .file { min-height:78px; position:relative; overflow:auto }
#blob .file .rawfile { text-align: center; background-color: #ddd; padding: 30px; position: relative; }
.file table { width:100%; border-collapse:collapse; border-spacing:0; }
.file table td, .file table th { vertical-align:top; padding:0; }
.file .data { overflow:auto }
.code { width:100%; }
.code .highlight pre { margin:0; padding:8px; border:none; background-color:#FFF; white-space:pre; }
.code .highlight pre a { display:block; }
// linenos
.linenos .linenodiv pre { background-color:#ECECEC; padding:8px; border:none; border-right: 1px solid #DDD; text-align:right; white-space:pre; }
.linenos .linenodiv pre a { color:#AAA; text-decoration:none; white-space:nowrap; line-height:18px }
.code .highlight pre, .linenos .linenodiv pre {
margin:0;
line-height: 18px;
-webkit-border-radius:0;
-moz-border-radius:0;
border-radius:0;
}
.linenos { padding:0; }
|
{
"pile_set_name": "Github"
}
|
/* pthread_attr_setdetachstate with error checking.
Copyright (C) 2017-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C 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.
The GNU C 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 the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <support/xthread.h>
void
xpthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate)
{
xpthread_check_return ("pthread_attr_setdetachstate",
pthread_attr_setdetachstate (attr,
detachstate));
}
|
{
"pile_set_name": "Github"
}
|
// +build windows
package prereqs
import (
"fmt"
"regexp"
"github.com/itchio/headway/state"
"github.com/pkg/errors"
"golang.org/x/sys/windows/registry"
)
var regkeyRegexp = regexp.MustCompile(`^([^\\]+)\\(.*)$`)
func RegistryKeyExists(consumer *state.Consumer, path string) bool {
matches := regkeyRegexp.FindAllStringSubmatch(path, 1)
if len(matches) != 1 {
consumer.Warnf("Could not parse registry key (%s), skipping check...", path)
return false
}
rootKeyName := matches[0][1]
pathName := matches[0][2]
rootKey, err := getRootKey(rootKeyName)
if err != nil {
consumer.Warnf("%s, skipping check...", err.Error())
return false
}
key, err := registry.OpenKey(rootKey, pathName, registry.QUERY_VALUE)
if err != nil {
if errors.Cause(err) == registry.ErrNotExist {
// cool, the key does not exist!
return false
}
consumer.Warnf("%s, skipping check...", err.Error())
return false
}
defer key.Close()
return true
}
func getRootKey(name string) (registry.Key, error) {
switch name {
case "HKEY_LOCAL_MACHINE", "HKLM":
return registry.LOCAL_MACHINE, nil
case "HKEY_CURRENT_USER", "HKCU":
return registry.CURRENT_USER, nil
}
return 0, fmt.Errorf("Unknown root key (%s)", name)
}
|
{
"pile_set_name": "Github"
}
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*
* Copyright (C) 2014,2017 Jorgen Lundman <[email protected]>
*
* A thread will call tsd_create(&key, dtor) to allocate a new
* "variable" placement, called a "key". In IllumOS, this is the index
* into an array of dtors. (If dtor is passed as NULL, TSD internally
* set it to an empty function). So if the dtor array[i] is NULL, it
* is "free" and can be allocated. (returned as *key = i).
* IllumOS will grow this dtor array with realloc when required.
* Then Any Thread can set a value on this "key index", and this value
* is specific to each thread by calling tsd_set(key, value).
* And can be retrieved with tsd_get(key).
* When tsd_destroy(key) is called, we need to loop through all
* threads different "values", and call the dtor on each one.
* Likewise, we need to know when a thread exists, so we can clean up
* the values (by calling dtor for each one) so we patch into the
* thread_exit() call, to also call tsd_thread_exit().
*
* In OsX, we build an array of the dtors, and return the key index,
* this is to store the dtor, and know which "key" values are valid.
* Then we build an AVL tree, indexed by <key,threadid>, to store
* each thread's value. This allows us to do key access quick.
* On thread_exit, we iterate the dtor array, and for each key
* remove <key,current_thread>.
* On tsd_destroy(key), we use AVL find nearest with <key,0>, then
* avl_next as long as key remains the same, to remove each thread value.
*
* Note a key of "0" is considered "invalid" in IllumOS, so we return
* a "1" based index, even though internally it is 0 based.
*
*/
#include <sys/kmem.h>
#include <sys/thread.h>
#include <sys/tsd.h>
#include <sys/avl.h>
#include <spl-debug.h>
#include <Trace.h>
/* Initial size of array, and realloc growth size */
#define TSD_ALLOC_SIZE 5
/* array of dtors, allocated in init */
static dtor_func_t *tsd_dtor_array = NULL;
static uint32_t tsd_dtor_size = 0;
static avl_tree_t tsd_tree;
struct spl_tsd_node_s
{
/* The index/key */
uint_t tsd_key;
thread_t *tsd_thread;
/* The payload */
void *tsd_value;
/* Internal mumbo */
avl_node_t tsd_link_node;
};
typedef struct spl_tsd_node_s spl_tsd_node_t;
static kmutex_t spl_tsd_mutex;
/*
* tsd_set - set thread specific data
* @key: lookup key
* @value: value to set
*
* Caller must prevent racing tsd_create() or tsd_destroy(), protected
* from racing tsd_get() or tsd_set() because it is thread specific.
* This function has been optimized to be fast for the update case.
* When setting the tsd initially it will be slower due to additional
* required locking and potential memory allocations.
* If the value is set to NULL, we also release it.
*/
int
tsd_set(uint_t key, void *value)
{
spl_tsd_node_t *entry = NULL;
spl_tsd_node_t search;
avl_index_t loc;
uint_t i;
/* Invalid key values? */
if ((key < 1) ||
(key >= tsd_dtor_size)) {
return EINVAL;
}
i = key - 1;
/* First handle the easy case, <key,thread> already has a node/value
* so we just need to find it, update it.
*/
search.tsd_key = i;
search.tsd_thread = current_thread();
mutex_enter(&spl_tsd_mutex);
entry = avl_find(&tsd_tree, &search, &loc);
mutex_exit(&spl_tsd_mutex);
if (entry) {
/* If value is set to NULL, release it as well */
if (value == NULL) {
mutex_enter(&spl_tsd_mutex);
avl_remove(&tsd_tree, entry);
mutex_exit(&spl_tsd_mutex);
kmem_free(entry, sizeof(*entry));
return 0;
}
entry->tsd_value = value;
return 0;
}
/* No node, we need to create a new one and insert it. */
/* But if the value is NULL, then why create one eh? */
if (value == NULL)
return 0;
entry = kmem_alloc(sizeof(spl_tsd_node_t), KM_SLEEP);
entry->tsd_key = i;
entry->tsd_thread = current_thread();
entry->tsd_value = value;
mutex_enter(&spl_tsd_mutex);
avl_add(&tsd_tree, entry);
mutex_exit(&spl_tsd_mutex);
return 0;
}
/*
* tsd_get - get thread specific data
* @key: lookup key
*
* Caller must prevent racing tsd_create() or tsd_destroy(). This
* implementation is designed to be fast and scalable, it does not
* lock the entire table only a single hash bin.
*/
void *
tsd_get(uint_t key)
{
spl_tsd_node_t *entry = NULL;
spl_tsd_node_t search;
avl_index_t loc;
uint_t i;
/* Invalid key values? */
if ((key < 1) ||
(key >= tsd_dtor_size)) {
return NULL;
}
i = key - 1;
search.tsd_key = i;
search.tsd_thread = current_thread();
mutex_enter(&spl_tsd_mutex);
entry = avl_find(&tsd_tree, &search, &loc);
mutex_exit(&spl_tsd_mutex);
return entry ? entry->tsd_value : NULL;
}
static void
tsd_internal_dtor(void *value)
{
}
/*
* Create TSD for a pid and fill in key with unique value, remember the dtor
*
* We cheat and create an entry with pid=0, to keep the dtor.
*/
void
tsd_create(uint_t *keyp, dtor_func_t dtor)
{
uint_t i;
if (*keyp) return; // Should be 0
// Iterate the dtor_array, looking for first NULL
for (i = 0; i < TSD_ALLOC_SIZE; i++) {
if (tsd_dtor_array[i] == NULL) break;
}
/* Do we need to grow the list? */
if (i >= tsd_dtor_size) {
dprintf("SPL: tsd list growing not implemented\n");
return;
}
if (dtor == NULL)
dtor = tsd_internal_dtor;
tsd_dtor_array[i] = dtor;
*keyp = i + 1;
}
void
tsd_destroy(uint_t *keyp)
{
spl_tsd_node_t *entry = NULL, *next = NULL;
spl_tsd_node_t search;
avl_index_t loc;
dtor_func_t dtor = NULL;
uint_t i;
/* Invalid key values? */
if ((*keyp < 1) ||
(*keyp >= tsd_dtor_size)) {
return;
}
i = *keyp - 1;
*keyp = 0;
ASSERT(tsd_dtor_array[i] != NULL);
dtor = tsd_dtor_array[i];
tsd_dtor_array[i] = NULL;
/*
* For each thread;
* if it has a value
* call the dtor
*/
search.tsd_key = i;
search.tsd_thread = NULL;
mutex_enter(&spl_tsd_mutex);
entry = avl_find(&tsd_tree, &search, &loc);
/* "entry" should really be NULL here, as we searched for the
* NULL thread */
if (entry == NULL)
entry = avl_nearest(&tsd_tree, loc, AVL_AFTER);
/* Now, free node, and go to next, as long as the key matches */
while (entry && (entry->tsd_key == i)) {
next = AVL_NEXT(&tsd_tree, entry);
/* If we have a value, call the dtor for this thread */
if (entry->tsd_value)
dtor(entry->tsd_value);
avl_remove(&tsd_tree, entry);
kmem_free(entry, sizeof(*entry));
entry = next;
}
mutex_exit(&spl_tsd_mutex);
}
/*
* A thread is exiting, clear out any tsd values it might have.
*/
void tsd_thread_exit(void)
{
spl_tsd_node_t *entry = NULL;
spl_tsd_node_t search;
avl_index_t loc;
int i;
search.tsd_thread = current_thread();
/* For all defined dtor/values */
for (i = 0; i < tsd_dtor_size; i++) {
/* If not allocated, skip */
if (tsd_dtor_array[i] == NULL) continue;
/* Find out of this thread has a value */
search.tsd_key = i;
mutex_enter(&spl_tsd_mutex);
entry = avl_find(&tsd_tree, &search, &loc);
if (entry) avl_remove(&tsd_tree, entry);
mutex_exit(&spl_tsd_mutex);
if (entry == NULL) continue;
/* If we have a value, call dtor */
if (entry->tsd_value)
tsd_dtor_array[i](entry->tsd_value);
kmem_free(entry, sizeof(*entry));
} // for all i
}
static int tsd_tree_cmp(const void *arg1, const void *arg2)
{
const spl_tsd_node_t *node1 = arg1;
const spl_tsd_node_t *node2 = arg2;
if (node1->tsd_key > node2->tsd_key)
return 1;
if (node1->tsd_key < node2->tsd_key)
return -1;
if (node1->tsd_thread > node2->tsd_thread)
return 1;
if (node1->tsd_thread < node2->tsd_thread)
return -1;
return 0;
}
int
spl_tsd_init(void)
{
tsd_dtor_array = kmem_zalloc(sizeof(dtor_func_t) * TSD_ALLOC_SIZE,
KM_SLEEP);
tsd_dtor_size = TSD_ALLOC_SIZE;
mutex_init(&spl_tsd_mutex, NULL, MUTEX_DEFAULT, NULL);
avl_create(&tsd_tree, tsd_tree_cmp,
sizeof (spl_tsd_node_t),
offsetof(spl_tsd_node_t, tsd_link_node));
return 0;
}
uint64_t spl_tsd_size(void)
{
return avl_numnodes(&tsd_tree);
}
void
spl_tsd_fini(void)
{
spl_tsd_node_t *entry = NULL;
void *cookie = NULL;
dprintf("SPL: tsd unloading %llu\n", spl_tsd_size() );
mutex_enter(&spl_tsd_mutex);
cookie = NULL;
while((entry = avl_destroy_nodes(&tsd_tree, &cookie))) {
kmem_free(entry, sizeof(*entry));
}
mutex_exit(&spl_tsd_mutex);
avl_destroy(&tsd_tree);
mutex_destroy(&spl_tsd_mutex);
kmem_free(tsd_dtor_array, sizeof(dtor_func_t) * tsd_dtor_size);
tsd_dtor_size = 0;
}
|
{
"pile_set_name": "Github"
}
|
%% start of file `moderncvstyleclassic.sty'.
%% Copyright 2006-2012 Xavier Danaux ([email protected]).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.
%-------------------------------------------------------------------------------
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvstyleclassic}[2012/10/31 v1.2.0 modern curriculum vitae and letter style scheme: classic]
%-------------------------------------------------------------------------------
% required packages
%-------------------------------------------------------------------------------
%-------------------------------------------------------------------------------
% package options
%-------------------------------------------------------------------------------
%-------------------------------------------------------------------------------
% overall style definition
%-------------------------------------------------------------------------------
% fonts
%\ifxetexorluatex
% \setmainfont{Latin Modern Roman}
% \setsansfont{Latin Modern Sans}
% \setmathfont{Latin Modern Math}
%\else
\IfFileExists{lmodern.sty}%
{\RequirePackage{lmodern}}%
{}
%\fi
% symbols
\renewcommand*{\mobilesymbol}{\marvosymbol{72}~}
\renewcommand*{\phonesymbol}{\marvosymbol{84}~}
\renewcommand*{\faxsymbol}{\marvosymbol{117}~}
\renewcommand*{\emailsymbol}{\marvosymbol{66}~}
\renewcommand*{\homepagesymbol}{{\Large\marvosymbol{205}}~}
%-------------------------------------------------------------------------------
% resume style definition
%-------------------------------------------------------------------------------
% fonts
\renewcommand*{\namefont}{\fontsize{34}{36}\mdseries\upshape}
\renewcommand*{\titlefont}{\LARGE\mdseries\slshape}
\renewcommand*{\addressfont}{\small\mdseries\slshape}
\renewcommand*{\quotefont}{\large\slshape}
\renewcommand*{\sectionfont}{\Large\mdseries\upshape}
\renewcommand*{\subsectionfont}{\large\mdseries\upshape}
\renewcommand*{\hintfont}{}
% styles
\renewcommand*{\namestyle}[1]{{\namefont\textcolor{color0}{#1}}}
\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2}{#1}}}
\renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color1}{#1}}}
\renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}}
\renewcommand*{\sectionstyle}[1]{{\sectionfont\textcolor{color1}{#1}}}
\renewcommand*{\subsectionstyle}[1]{{\subsectionfont\textcolor{color1}{#1}}}
\renewcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}}
% lengths
\newlength{\quotewidth}
\newlength{\hintscolumnwidth}
\setlength{\hintscolumnwidth}{0.175\textwidth}
\newlength{\separatorcolumnwidth}
\setlength{\separatorcolumnwidth}{0.025\textwidth}
\newlength{\maincolumnwidth}
\newlength{\doubleitemmaincolumnwidth}
\newlength{\listitemsymbolwidth}
\settowidth{\listitemsymbolwidth}{\listitemsymbol}
\newlength{\listitemmaincolumnwidth}
\newlength{\listdoubleitemmaincolumnwidth}
% commands
\renewcommand*{\recomputecvlengths}{%
\setlength{\quotewidth}{0.65\textwidth}%
% main lenghts
\setlength{\maincolumnwidth}{\textwidth-\separatorcolumnwidth-\hintscolumnwidth}%
% listitem lengths
\setlength{\listitemmaincolumnwidth}{\maincolumnwidth-\listitemsymbolwidth}%
% doubleitem lengths
\setlength{\doubleitemmaincolumnwidth}{\maincolumnwidth-\hintscolumnwidth-\separatorcolumnwidth-\separatorcolumnwidth}%
\setlength{\doubleitemmaincolumnwidth}{0.5\doubleitemmaincolumnwidth}%
% listdoubleitem lengths
\setlength{\listdoubleitemmaincolumnwidth}{\maincolumnwidth-\listitemsymbolwidth-\separatorcolumnwidth-\listitemsymbolwidth}%
\setlength{\listdoubleitemmaincolumnwidth}{0.5\listdoubleitemmaincolumnwidth}%
% fancyhdr lengths
\renewcommand{\headwidth}{\textwidth}%
% regular lengths
\setlength{\parskip}{0\p@}}
% optional maketitle width to force a certain width (if set to 0pt, the width is calculated automatically)
\newlength{\makecvtitlenamewidth}
\setlength{\makecvtitlenamewidth}{0pt}% dummy value
\renewcommand*{\makecvtitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
% optional detailed information box
\newbox{\makecvtitledetailsbox}%
\savebox{\makecvtitledetailsbox}{%
\addressfont\color{color2}%
\begin{tabular}[b]{@{}r@{}}%
\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}}% if \addresstreet is defined, \addresscity will always be defined but could be empty
\ifthenelse{\isundefined{\@mobile}}{}{\makenewline\mobilesymbol\@mobile}%
\ifthenelse{\isundefined{\@phone}}{}{\makenewline\phonesymbol\@phone}%
\ifthenelse{\isundefined{\@fax}}{}{\makenewline\faxsymbol\@fax}%
\ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{%
\ifthenelse{\equal{\@homepagetitle}{}}% \homepagetitle could be empty
{\makenewline\homepagesymbol\httplink{\@homepage}}%
{\makenewline\homepagesymbol\httplink[\@homepagetitle]{\@homepage}}}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
\end{tabular}
}%
% optional photo (pre-rendering)
\newbox{\makecvtitlepicturebox}%
\savebox{\makecvtitlepicturebox}{%
\ifthenelse{\isundefined{\@photo}}%
{}%
{%
\hspace*{\separatorcolumnwidth}%
\color{color1}%
\setlength{\fboxrule}{\@photoframewidth}%
\ifdim\@photoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%
% name and title
\newlength{\makecvtitledetailswidth}\settowidth{\makecvtitledetailswidth}{\usebox{\makecvtitledetailsbox}}%
\newlength{\makecvtitlepicturewidth}\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
\ifthenelse{\lengthtest{\makecvtitlenamewidth=0pt}}% check for dummy value (equivalent to \ifdim\makecvtitlenamewidth=0pt)
{\setlength{\makecvtitlenamewidth}{\textwidth-\makecvtitledetailswidth-\makecvtitlepicturewidth}}%
{}%
\begin{minipage}[b]{\makecvtitlenamewidth}%
\namestyle{\@firstname\ \@familyname}%
\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
\end{minipage}%
\hfill%
% detailed information
\llap{\usebox{\makecvtitledetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvtitlenamewidth is forced
% optional photo (rendering)
\usebox{\makecvtitlepicturebox}\\[2.5em]%
% optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
\par}% to avoid weird spacing bug at the first section if no blank line is left after \makecvtitle
\newlength{\baseletterheight}
\settoheight{\baseletterheight}{\sectionstyle{o}}
\setlength{\baseletterheight}{\baseletterheight-0.95ex}
\renewcommand*{\section}[1]{%
\par\addvspace{2.5ex}%
\phantomsection{}% reset the anchor for hyperrefs
\addcontentsline{toc}{section}{#1}%
\parbox[t]{\hintscolumnwidth}{\strut\raggedleft\raisebox{\baseletterheight}{\color{color1}\rule{\hintscolumnwidth}{0.95ex}}}%
\hspace{\separatorcolumnwidth}%
\parbox[t]{\maincolumnwidth}{\strut\sectionstyle{#1}}%
\par\nobreak\addvspace{1ex}\@afterheading}% to avoid a pagebreak after the heading
\renewcommand*{\subsection}[1]{%
\par\addvspace{1ex}%
\phantomsection{}% reset the anchor for hyperrefs
\addcontentsline{toc}{subsection}{#1}%
\begin{tabular}{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\maincolumnwidth}@{}}%
\raggedleft\hintstyle{} &{\strut\subsectionstyle{#1}}%
\end{tabular}%
\par\nobreak\addvspace{0.5ex}\@afterheading}% to avoid a pagebreak after the heading
\renewcommand*{\cvitem}[3][.25em]{%
\begin{tabular}{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\maincolumnwidth}@{}}%
\raggedleft\hintstyle{#2} &{#3}%
\end{tabular}%
\par\addvspace{#1}}
\renewcommand*{\cvdoubleitem}[5][.25em]{%
\cvitem[#1]{#2}{%
\begin{minipage}[t]{\doubleitemmaincolumnwidth}#3\end{minipage}%
\hfill% fill of \separatorcolumnwidth
\begin{minipage}[t]{\hintscolumnwidth}\raggedleft\hintstyle{#4}\end{minipage}%
\hspace*{\separatorcolumnwidth}%
\begin{minipage}[t]{\doubleitemmaincolumnwidth}#5\end{minipage}}}
\renewcommand*{\cvlistitem}[2][.25em]{%
\cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{\listitemmaincolumnwidth}#2\end{minipage}}}
\renewcommand*{\cvlistdoubleitem}[3][.25em]{%
\cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#2\end{minipage}%
\hfill% fill of \separatorcolumnwidth
\ifthenelse{\equal{#3}{}}%
{}%
{\listitemsymbol\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#3\end{minipage}}}}
\renewcommand*{\cventry}[7][.25em]{%
\cvitem[#1]{#2}{%
{\bfseries#3}%
\ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}%
\ifthenelse{\equal{#5}{}}{}{, #5}%
\ifthenelse{\equal{#6}{}}{}{, #6}%
.\strut%
\ifx&%
\else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi}}
\newbox{\cvitemwithcommentmainbox}
\newlength{\cvitemwithcommentmainlength}
\newlength{\cvitemwithcommentcommentlength}
\renewcommand*{\cvitemwithcomment}[4][.25em]{%
\savebox{\cvitemwithcommentmainbox}{{\bfseries#3}}%
\setlength{\cvitemwithcommentmainlength}{\widthof{\usebox{\cvitemwithcommentmainbox}}}%
\setlength{\cvitemwithcommentcommentlength}{\maincolumnwidth-\separatorcolumnwidth-\cvitemwithcommentmainlength}%
\cvitem[#1]{#2}{%
\begin{minipage}[t]{\cvitemwithcommentmainlength}\bfseries#3\end{minipage}%
\hfill% fill of \separatorcolumnwidth
\begin{minipage}[t]{\cvitemwithcommentcommentlength}\raggedleft\small\itshape#4\end{minipage}}}
\renewenvironment{thebibliography}[1]%
{%
\bibliographyhead{\refname}%
% \small%
\begin{list}{\bibliographyitemlabel}%
{%
\setlength{\topsep}{0pt}%
\setlength{\labelwidth}{\hintscolumnwidth}%
\setlength{\labelsep}{\separatorcolumnwidth}%
\leftmargin\labelwidth%
\advance\leftmargin\labelsep%
\@openbib@code%
\usecounter{enumiv}%
\let\p@enumiv\@empty%
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy\clubpenalty4000\widowpenalty4000%
% \sfcode`\.\@m%
% \sfcode `\=1000\relax%
}%
{%
\def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
\end{list}%
}
%-------------------------------------------------------------------------------
% letter style definition
%-------------------------------------------------------------------------------
% commands
\renewcommand*{\recomputeletterlengths}{%
\recomputecvlengths%
\setlength{\parskip}{6\p@}}
\renewcommand*{\makelettertitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputeletterlengths%
% sender contact info
\hfill%
\begin{minipage}{.5\textwidth}%
\raggedleft%
\addressfont\textcolor{color2}{%
{\bfseries\upshape\@firstname~\@familyname}\@firstdetailselementfalse%
\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}}%
\ifthenelse{\isundefined{\@mobile}}{}{\makenewline\mobilesymbol\@mobile}%
\ifthenelse{\isundefined{\@phone}}{}{\makenewline\phonesymbol\@phone}%
\ifthenelse{\isundefined{\@fax}}{}{\makenewline\faxsymbol\@fax}%
\ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{%
\ifthenelse{\equal{\@homepagetitle}{}}% \homepagetitle could be empty
{\makenewline\homepagesymbol\httplink{\@homepage}}%
{\makenewline\homepagesymbol\httplink[\@homepagetitle]{\@homepage}}}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}%
\end{minipage}\\[1em]
% recipient block
\begin{minipage}[t]{.5\textwidth}
\raggedright%
\addressfont%
{\bfseries\upshape\@recipientname}\\%
\@recipientaddress%
\end{minipage}
% date
\hfill% US style
% \\[1em]% UK style
\@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900"
% opening
\raggedright%
\@opening\\[1.5em]%
% ensure no extra spacing after \makelettertitle due to a possible blank line
% \ignorespacesafterend% not working
\hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}}
\renewcommand*{\makeletterclosing}{
\@closing\\[3em]%
{\bfseries \@firstname~\@familyname}%
\ifthenelse{\isundefined{\@enclosure}}{}{%
\\%
\vfill%
{\color{color2}\itshape\enclname: \@enclosure}}}
\endinput
%% end of file `moderncvstyleclassic.sty'.
|
{
"pile_set_name": "Github"
}
|
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* lib/krb5/os/gen_port.c - Generate full address from IP address and port */
/*
* Copyright 1991 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. Furthermore if you modify this software you must label
* your software as modified software and not distribute it in such a
* fashion that it might be confused with the original M.I.T. software.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*/
#include "k5-int.h"
#include "os-proto.h"
krb5_error_code
krb5_gen_portaddr(krb5_context context, const krb5_address *addr, krb5_const_pointer ptr, krb5_address **outaddr)
{
#ifdef HAVE_NETINET_IN_H
krb5_int32 adr;
krb5_int16 port;
if (addr->addrtype != ADDRTYPE_INET)
return KRB5_PROG_ATYPE_NOSUPP;
port = *(const krb5_int16 *)ptr;
memcpy(&adr, addr->contents, sizeof(adr));
return krb5_make_full_ipaddr(context, adr, port, outaddr);
#else
return KRB5_PROG_ATYPE_NOSUPP;
#endif
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2009-2010 Appcelerator, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "MenuItem.h"
#include <string>
#include <vector>
#include <kroll/kroll.h>
#include "Menu.h"
#include "UI.h"
using namespace std;
namespace Titanium {
MenuItem::MenuItem(MenuItemType type)
: KEventObject("UI.MenuItem")
, type(type)
, enabled(true)
, label("")
, submenu(0)
, state(false)
, autoCheck(true)
{
this->SetMethod("isSeparator", &MenuItem::_IsSeparator);
this->SetMethod("isCheck", &MenuItem::_IsCheck);
if (this->type == NORMAL || this->type == CHECK)
{
this->SetMethod("setLabel", &MenuItem::_SetLabel);
this->SetMethod("getLabel", &MenuItem::_GetLabel);
this->SetMethod("setSubmenu", &MenuItem::_SetSubmenu);
this->SetMethod("getSubmenu", &MenuItem::_GetSubmenu);
this->SetMethod("enable", &MenuItem::_Enable);
this->SetMethod("disable", &MenuItem::_Disable);
this->SetMethod("isEnabled", &MenuItem::_IsEnabled);
this->SetMethod("addItem", &MenuItem::_AddItem);
this->SetMethod("addSeparatorItem", &MenuItem::_AddSeparatorItem);
this->SetMethod("addCheckItem", &MenuItem::_AddCheckItem);
// This is only for testing and should remain undocumented
this->SetMethod("click", &MenuItem::_Click);
}
if (this->type == NORMAL)
{
this->SetMethod("setIcon", &MenuItem::_SetIcon);
this->SetMethod("getIcon", &MenuItem::_GetIcon);
}
if (this->type == CHECK)
{
this->SetMethod("setState", &MenuItem::_SetState);
this->SetMethod("getState", &MenuItem::_GetState);
this->SetMethod("setAutoCheck", &MenuItem::_SetAutoCheck);
this->SetMethod("isAutoCheck", &MenuItem::_IsAutoCheck);
}
}
MenuItem::~MenuItem()
{
}
void MenuItem::_IsSeparator(const ValueList& args, KValueRef result)
{
result->SetBool(this->type == SEPARATOR);
}
void MenuItem::_IsCheck(const ValueList& args, KValueRef result)
{
result->SetBool(this->type == CHECK);
}
void MenuItem::_SetLabel(const ValueList& args, KValueRef result)
{
args.VerifyException("setLabel", "s|0");
string newLabel = args.GetString(0, "");
this->SetLabel(newLabel);
}
void MenuItem::_GetLabel(const ValueList& args, KValueRef result)
{
result->SetString(this->label);
}
void MenuItem::_SetIcon(const ValueList& args, KValueRef result)
{
args.VerifyException("setIcon", "s|0");
std::string newIcon = "";
if (args.size() > 0) {
newIcon = args.GetString(0);
}
this->SetIcon(newIcon);
}
void MenuItem::_GetIcon(const ValueList& args, KValueRef result)
{
result->SetString(this->iconURL);
}
void MenuItem::_SetState(const ValueList& args, KValueRef result)
{
args.VerifyException("setState", "b");
this->SetState(args.GetBool(0));
}
void MenuItem::_GetState(const ValueList& args, KValueRef result)
{
result->SetBool(this->state);
}
void MenuItem::_SetSubmenu(const ValueList& args, KValueRef result)
{
args.VerifyException("setSubmenu", "o|0");
AutoPtr<Menu> newSubmenu = NULL;
if (args.at(0)->IsObject())
{
KObjectRef o = args.at(0)->ToObject();
o = KObject::Unwrap(o);
newSubmenu = o.cast<Menu>();
}
if (!newSubmenu.isNull() && newSubmenu->ContainsItem(this))
{
throw ValueException::FromString("Tried to construct a recursive menu");
}
this->submenu = newSubmenu;
this->SetSubmenuImpl(newSubmenu);
}
void MenuItem::_GetSubmenu(const ValueList& args, KValueRef result)
{
if (this->submenu.isNull())
{
result->SetNull();
}
else
{
result->SetObject(this->submenu);
}
}
void MenuItem::_Enable(const ValueList& args, KValueRef result)
{
this->enabled = true;
this->SetEnabledImpl(true);
}
void MenuItem::_Disable(const ValueList& args, KValueRef result)
{
this->enabled = false;
this->SetEnabledImpl(false);
}
void MenuItem::_SetAutoCheck(const ValueList& args, KValueRef result)
{
args.VerifyException("setAutoCheck", "b");
this->autoCheck = args.GetBool(0);
}
void MenuItem::_IsAutoCheck(const ValueList& args, KValueRef result)
{
result->SetBool(this->autoCheck);
}
void MenuItem::_IsEnabled(const ValueList& args, KValueRef result)
{
result->SetBool(this->enabled);
}
void MenuItem::_Click(const ValueList& args, KValueRef result)
{
this->HandleClickEvent(0);
}
void MenuItem::_AddItem(const ValueList& args, KValueRef result)
{
args.VerifyException("addItem", "?s m|0 s|0");
UI* binding = UI::GetInstance();
// Create a menu item object and add it to this item's submenu
AutoPtr<MenuItem> newItem = binding->__CreateMenuItem(args);
this->EnsureHasSubmenu();
this->submenu->AppendItem(newItem);
result->SetObject(newItem);
}
void MenuItem::_AddSeparatorItem(const ValueList& args, KValueRef result)
{
UI* binding = UI::GetInstance();
AutoPtr<MenuItem> newItem = binding->__CreateSeparatorMenuItem(args);
this->EnsureHasSubmenu();
this->submenu->AppendItem(newItem);
result->SetObject(newItem);
}
void MenuItem::_AddCheckItem(const ValueList& args, KValueRef result)
{
UI* binding = UI::GetInstance();
// Create a menu item object
AutoPtr<MenuItem> newItem = binding->__CreateCheckMenuItem(args);
this->EnsureHasSubmenu();
this->submenu->AppendItem(newItem);
result->SetObject(newItem);
}
void MenuItem::HandleClickEvent(KObjectRef source)
{
if (this->FireEvent(Event::CLICKED)
&& this->IsCheck() && this->autoCheck)
{
// Execute this later on the main thread
RunOnMainThread(this->Get("setState")->ToMethod(),
ValueList(Value::NewBool(!this->GetState())), false);
}
}
void MenuItem::SetState(bool newState)
{
this->state = newState;
this->SetStateImpl(newState);
}
void MenuItem::SetLabel(string& newLabel)
{
this->label = newLabel;
this->SetLabelImpl(newLabel);
}
void MenuItem::SetIcon(string& iconURL)
{
this->iconPath = this->iconURL = iconURL;
if (!iconURL.empty()) {
this->iconPath = URLUtils::URLToPath(this->iconURL);
}
this->SetIconImpl(this->iconPath); // platform-specific impl
}
bool MenuItem::GetState()
{
return this->state;
}
std::string& MenuItem::GetLabel()
{
return this->label;
}
bool MenuItem::IsSeparator()
{
return this->type == SEPARATOR;
}
bool MenuItem::IsCheck()
{
return this->type == CHECK;
}
bool MenuItem::IsEnabled()
{
return this->enabled;
}
void MenuItem::EnsureHasSubmenu()
{
if (this->submenu.isNull())
{
UI* binding = UI::GetInstance();
AutoPtr<Menu> newSubmenu = binding->CreateMenu();
this->SetSubmenuImpl(newSubmenu);
this->submenu = newSubmenu;
}
}
bool MenuItem::ContainsItem(MenuItem* item)
{
return !this->submenu.isNull() &&
this->submenu->ContainsItem(item);
}
bool MenuItem::ContainsSubmenu(Menu* submenu)
{
return !this->submenu.isNull() &&
(this->submenu.get() == submenu ||
this->submenu->ContainsSubmenu(submenu));
}
} // namespace Titanium
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* The base abstract factory used by all PasswordLib factories
*
* PHP version 5.3
*
* @category PHPPasswordLib
* @package Core
* @author Anthony Ferrara <[email protected]>
* @copyright 2011 The Authors
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version Build @@version@@
*/
namespace SecurityLib;
/**
* The base abstract factory used by all PasswordLib factories
*
* @category PHPPasswordLib
* @package Core
* @author Anthony Ferrara <[email protected]>
*/
abstract class AbstractFactory {
/**
* Register a type with the factory by name
*
* This is an internal method to check if a provided class name implements
* an interface, and if it does to append that class to an internal array
* by name.
*
* @param string $type The name of the variable to store the class
* @param string $implements The interface to validate against
* @param string $name The name of this particular class
* @param string $class The fully qualified class name
* @param boolean $instantiate Should the class be stored instantiated
*
* @return void
* @throws InvalidArgumentException If class does not implement interface
*/
protected function registerType(
$type,
$implements,
$name,
$class,
$instantiate = false
) {
$name = strtolower($name);
$refl = new \ReflectionClass($class);
if (!$refl->implementsInterface($implements)) {
$message = sprintf('Class must implement %s', $implements);
throw new \InvalidArgumentException($message);
}
if ($instantiate) {
$class = new $class;
}
$this->{$type}[$name] = $class;
}
/**
* Load a set of classes from a directory into the factory
*
* @param string $directory The directory to search for classes in
* @param string $namespace The namespace prefix for any found classes
* @param callable $callback The callback with which to register the class
*
* @return void
*/
protected function loadFiles($directory, $namespace, $callback) {
foreach (new \DirectoryIterator($directory) as $file) {
$filename = $file->getBasename();
if ($file->isFile() && substr($filename, -4) == '.php') {
$name = substr($filename, 0, -4);
$class = $namespace . $name;
call_user_func($callback, $name, $class);
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
pymongo
requests
requesocks
gevent
jieba
wordcloud
Pillow
|
{
"pile_set_name": "Github"
}
|
/*
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
/**
* @fileOverview Defines the {@link CKEDITOR.lang} object, for the
* Norwegian language.
*/
/**#@+
@type String
@example
*/
/**
* Contains the dictionary of language entries.
* @namespace
*/
CKEDITOR.lang['no'] =
{
/**
* The language reading direction. Possible values are "rtl" for
* Right-To-Left languages (like Arabic) and "ltr" for Left-To-Right
* languages (like English).
* @default 'ltr'
*/
dir : 'ltr',
/*
* Screenreader titles. Please note that screenreaders are not always capable
* of reading non-English words. So be careful while translating it.
*/
editorTitle : 'Rikteksteditor, %1',
editorHelp : 'Trykk ALT 0 for hjelp',
// ARIA descriptions.
toolbars : 'Verktøylinjer for editor',
editor : 'Rikteksteditor',
// Toolbar buttons without dialogs.
source : 'Kilde',
newPage : 'Ny side',
save : 'Lagre',
preview : 'Forhåndsvis',
cut : 'Klipp ut',
copy : 'Kopier',
paste : 'Lim inn',
print : 'Skriv ut',
underline : 'Understreking',
bold : 'Fet',
italic : 'Kursiv',
selectAll : 'Merk alt',
removeFormat : 'Fjern formatering',
strike : 'Gjennomstreking',
subscript : 'Senket skrift',
superscript : 'Hevet skrift',
horizontalrule : 'Sett inn horisontal linje',
pagebreak : 'Sett inn sideskift for utskrift',
pagebreakAlt : 'Sideskift',
unlink : 'Fjern lenke',
undo : 'Angre',
redo : 'Gjør om',
// Common messages and labels.
common :
{
browseServer : 'Bla igjennom server',
url : 'URL',
protocol : 'Protokoll',
upload : 'Last opp',
uploadSubmit : 'Send det til serveren',
image : 'Bilde',
flash : 'Flash',
form : 'Skjema',
checkbox : 'Avmerkingsboks',
radio : 'Alternativknapp',
textField : 'Tekstboks',
textarea : 'Tekstområde',
hiddenField : 'Skjult felt',
button : 'Knapp',
select : 'Rullegardinliste',
imageButton : 'Bildeknapp',
notSet : '<ikke satt>',
id : 'Id',
name : 'Navn',
langDir : 'Språkretning',
langDirLtr : 'Venstre til høyre (VTH)',
langDirRtl : 'Høyre til venstre (HTV)',
langCode : 'Språkkode',
longDescr : 'Utvidet beskrivelse',
cssClass : 'Stilarkklasser',
advisoryTitle : 'Tittel',
cssStyle : 'Stil',
ok : 'OK',
cancel : 'Avbryt',
close : 'Lukk',
preview : 'Forhåndsvis',
generalTab : 'Generelt',
advancedTab : 'Avansert',
validateNumberFailed : 'Denne verdien er ikke et tall.',
confirmNewPage : 'Alle ulagrede endringer som er gjort i dette innholdet vil bli tapt. Er du sikker på at du vil laste en ny side?',
confirmCancel : 'Noen av valgene har blitt endret. Er du sikker på at du vil lukke dialogen?',
options : 'Valg',
target : 'Mål',
targetNew : 'Nytt vindu (_blank)',
targetTop : 'Hele vindu (_top)',
targetSelf : 'Samme vindu (_self)',
targetParent : 'Foreldrevindu (_parent)',
langDirLTR : 'Venstre til høyre (VTH)',
langDirRTL : 'Høyre til venstre (HTV)',
styles : 'Stil',
cssClasses : 'Stilarkklasser',
width : 'Bredde',
height : 'Høyde',
align : 'Juster',
alignLeft : 'Venstre',
alignRight : 'Høyre',
alignCenter : 'Midtjuster',
alignTop : 'Topp',
alignMiddle : 'Midten',
alignBottom : 'Bunn',
invalidHeight : 'Høyde må være et tall.',
invalidWidth : 'Bredde må være et tall.',
invalidCssLength : 'Den angitte verdien for feltet "%1" må være et positivt tall med eller uten en gyldig CSS-målingsenhet (px, %, in, cm, mm, em, ex, pt, eller pc).',
invalidHtmlLength : 'Den angitte verdien for feltet "%1" må være et positivt tall med eller uten en gyldig HTML-målingsenhet (px eller %).',
invalidInlineStyle : 'Verdi angitt for inline stil må bestå av en eller flere sett med formatet "navn : verdi", separert med semikolon',
cssLengthTooltip : 'Skriv inn et tall for en piksel-verdi eller et tall med en gyldig CSS-enhet (px, %, in, cm, mm, em, ex, pt, eller pc).',
// Put the voice-only part of the label in the span.
unavailable : '%1<span class="cke_accessibility">, utilgjenglig</span>'
},
contextmenu :
{
options : 'Alternativer for høyreklikkmeny'
},
// Special char dialog.
specialChar :
{
toolbar : 'Sett inn spesialtegn',
title : 'Velg spesialtegn',
options : 'Alternativer for spesialtegn'
},
// Link dialog.
link :
{
toolbar : 'Sett inn/Rediger lenke',
other : '<annen>',
menu : 'Rediger lenke',
title : 'Lenke',
info : 'Lenkeinfo',
target : 'Mål',
upload : 'Last opp',
advanced : 'Avansert',
type : 'Lenketype',
toUrl : 'URL',
toAnchor : 'Lenke til anker i teksten',
toEmail : 'E-post',
targetFrame : '<ramme>',
targetPopup : '<popup-vindu>',
targetFrameName : 'Målramme',
targetPopupName : 'Navn på popup-vindu',
popupFeatures : 'Egenskaper for popup-vindu',
popupResizable : 'Skalerbar',
popupStatusBar : 'Statuslinje',
popupLocationBar: 'Adresselinje',
popupToolbar : 'Verktøylinje',
popupMenuBar : 'Menylinje',
popupFullScreen : 'Fullskjerm (IE)',
popupScrollBars : 'Scrollbar',
popupDependent : 'Avhenging (Netscape)',
popupLeft : 'Venstre posisjon',
popupTop : 'Topp-posisjon',
id : 'Id',
langDir : 'Språkretning',
langDirLTR : 'Venstre til høyre (VTH)',
langDirRTL : 'Høyre til venstre (HTV)',
acccessKey : 'Aksessknapp',
name : 'Navn',
langCode : 'Språkkode',
tabIndex : 'Tabindeks',
advisoryTitle : 'Tittel',
advisoryContentType : 'Type',
cssClasses : 'Stilarkklasser',
charset : 'Lenket tegnsett',
styles : 'Stil',
rel : 'Relasjon (rel)',
selectAnchor : 'Velg et anker',
anchorName : 'Anker etter navn',
anchorId : 'Element etter ID',
emailAddress : 'E-postadresse',
emailSubject : 'Meldingsemne',
emailBody : 'Melding',
noAnchors : '(Ingen anker i dokumentet)',
noUrl : 'Vennligst skriv inn lenkens URL',
noEmail : 'Vennligst skriv inn e-postadressen'
},
// Anchor dialog
anchor :
{
toolbar : 'Sett inn/Rediger anker',
menu : 'Egenskaper for anker',
title : 'Egenskaper for anker',
name : 'Ankernavn',
errorName : 'Vennligst skriv inn ankernavnet',
remove : 'Fjern anker'
},
// List style dialog
list:
{
numberedTitle : 'Egenskaper for nummerert liste',
bulletedTitle : 'Egenskaper for punktmerket liste',
type : 'Type',
start : 'Start',
validateStartNumber :'Starten på listen må være et heltall.',
circle : 'Sirkel',
disc : 'Disk',
square : 'Firkant',
none : 'Ingen',
notset : '<ikke satt>',
armenian : 'Armensk nummerering',
georgian : 'Georgisk nummerering (an, ban, gan, osv.)',
lowerRoman : 'Romertall, små (i, ii, iii, iv, v, osv.)',
upperRoman : 'Romertall, store (I, II, III, IV, V, osv.)',
lowerAlpha : 'Alfabetisk, små (a, b, c, d, e, osv.)',
upperAlpha : 'Alfabetisk, store (A, B, C, D, E, osv.)',
lowerGreek : 'Gresk, små (alpha, beta, gamma, osv.)',
decimal : 'Tall (1, 2, 3, osv.)',
decimalLeadingZero : 'Tall, med førstesiffer null (01, 02, 03, osv.)'
},
// Find And Replace Dialog
findAndReplace :
{
title : 'Søk og erstatt',
find : 'Søk',
replace : 'Erstatt',
findWhat : 'Søk etter:',
replaceWith : 'Erstatt med:',
notFoundMsg : 'Fant ikke søketeksten.',
findOptions : 'Søkealternativer',
matchCase : 'Skill mellom store og små bokstaver',
matchWord : 'Bare hele ord',
matchCyclic : 'Søk i hele dokumentet',
replaceAll : 'Erstatt alle',
replaceSuccessMsg : '%1 tilfelle(r) erstattet.'
},
// Table Dialog
table :
{
toolbar : 'Tabell',
title : 'Egenskaper for tabell',
menu : 'Egenskaper for tabell',
deleteTable : 'Slett tabell',
rows : 'Rader',
columns : 'Kolonner',
border : 'Rammestørrelse',
widthPx : 'piksler',
widthPc : 'prosent',
widthUnit : 'Bredde-enhet',
cellSpace : 'Cellemarg',
cellPad : 'Cellepolstring',
caption : 'Tittel',
summary : 'Sammendrag',
headers : 'Overskrifter',
headersNone : 'Ingen',
headersColumn : 'Første kolonne',
headersRow : 'Første rad',
headersBoth : 'Begge',
invalidRows : 'Antall rader må være et tall større enn 0.',
invalidCols : 'Antall kolonner må være et tall større enn 0.',
invalidBorder : 'Rammestørrelse må være et tall.',
invalidWidth : 'Tabellbredde må være et tall.',
invalidHeight : 'Tabellhøyde må være et tall.',
invalidCellSpacing : 'Cellemarg må være et positivt tall.',
invalidCellPadding : 'Cellepolstring må være et positivt tall.',
cell :
{
menu : 'Celle',
insertBefore : 'Sett inn celle før',
insertAfter : 'Sett inn celle etter',
deleteCell : 'Slett celler',
merge : 'Slå sammen celler',
mergeRight : 'Slå sammen høyre',
mergeDown : 'Slå sammen ned',
splitHorizontal : 'Del celle horisontalt',
splitVertical : 'Del celle vertikalt',
title : 'Celleegenskaper',
cellType : 'Celletype',
rowSpan : 'Radspenn',
colSpan : 'Kolonnespenn',
wordWrap : 'Tekstbrytning',
hAlign : 'Horisontal justering',
vAlign : 'Vertikal justering',
alignBaseline : 'Grunnlinje',
bgColor : 'Bakgrunnsfarge',
borderColor : 'Rammefarge',
data : 'Data',
header : 'Overskrift',
yes : 'Ja',
no : 'Nei',
invalidWidth : 'Cellebredde må være et tall.',
invalidHeight : 'Cellehøyde må være et tall.',
invalidRowSpan : 'Radspenn må være et heltall.',
invalidColSpan : 'Kolonnespenn må være et heltall.',
chooseColor : 'Velg'
},
row :
{
menu : 'Rader',
insertBefore : 'Sett inn rad før',
insertAfter : 'Sett inn rad etter',
deleteRow : 'Slett rader'
},
column :
{
menu : 'Kolonne',
insertBefore : 'Sett inn kolonne før',
insertAfter : 'Sett inn kolonne etter',
deleteColumn : 'Slett kolonner'
}
},
// Button Dialog.
button :
{
title : 'Egenskaper for knapp',
text : 'Tekst (verdi)',
type : 'Type',
typeBtn : 'Knapp',
typeSbm : 'Send',
typeRst : 'Nullstill'
},
// Checkbox and Radio Button Dialogs.
checkboxAndRadio :
{
checkboxTitle : 'Egenskaper for avmerkingsboks',
radioTitle : 'Egenskaper for alternativknapp',
value : 'Verdi',
selected : 'Valgt'
},
// Form Dialog.
form :
{
title : 'Egenskaper for skjema',
menu : 'Egenskaper for skjema',
action : 'Handling',
method : 'Metode',
encoding : 'Encoding'
},
// Select Field Dialog.
select :
{
title : 'Egenskaper for rullegardinliste',
selectInfo : 'Info',
opAvail : 'Tilgjenglige alternativer',
value : 'Verdi',
size : 'Størrelse',
lines : 'Linjer',
chkMulti : 'Tillat flervalg',
opText : 'Tekst',
opValue : 'Verdi',
btnAdd : 'Legg til',
btnModify : 'Endre',
btnUp : 'Opp',
btnDown : 'Ned',
btnSetValue : 'Sett som valgt',
btnDelete : 'Slett'
},
// Textarea Dialog.
textarea :
{
title : 'Egenskaper for tekstområde',
cols : 'Kolonner',
rows : 'Rader'
},
// Text Field Dialog.
textfield :
{
title : 'Egenskaper for tekstfelt',
name : 'Navn',
value : 'Verdi',
charWidth : 'Tegnbredde',
maxChars : 'Maks antall tegn',
type : 'Type',
typeText : 'Tekst',
typePass : 'Passord'
},
// Hidden Field Dialog.
hidden :
{
title : 'Egenskaper for skjult felt',
name : 'Navn',
value : 'Verdi'
},
// Image Dialog.
image :
{
title : 'Bildeegenskaper',
titleButton : 'Egenskaper for bildeknapp',
menu : 'Bildeegenskaper',
infoTab : 'Bildeinformasjon',
btnUpload : 'Send det til serveren',
upload : 'Last opp',
alt : 'Alternativ tekst',
lockRatio : 'Lås forhold',
resetSize : 'Tilbakestill størrelse',
border : 'Ramme',
hSpace : 'HMarg',
vSpace : 'VMarg',
alertUrl : 'Vennligst skriv bilde-urlen',
linkTab : 'Lenke',
button2Img : 'Vil du endre den valgte bildeknappen til et vanlig bilde?',
img2Button : 'Vil du endre det valgte bildet til en bildeknapp?',
urlMissing : 'Bildets adresse mangler.',
validateBorder : 'Ramme må være et heltall.',
validateHSpace : 'HMarg må være et heltall.',
validateVSpace : 'VMarg må være et heltall.'
},
// Flash Dialog
flash :
{
properties : 'Egenskaper for Flash-objekt',
propertiesTab : 'Egenskaper',
title : 'Flash-egenskaper',
chkPlay : 'Autospill',
chkLoop : 'Loop',
chkMenu : 'Slå på Flash-meny',
chkFull : 'Tillat fullskjerm',
scale : 'Skaler',
scaleAll : 'Vis alt',
scaleNoBorder : 'Ingen ramme',
scaleFit : 'Skaler til å passe',
access : 'Scripttilgang',
accessAlways : 'Alltid',
accessSameDomain: 'Samme domene',
accessNever : 'Aldri',
alignAbsBottom : 'Abs bunn',
alignAbsMiddle : 'Abs midten',
alignBaseline : 'Bunnlinje',
alignTextTop : 'Tekst topp',
quality : 'Kvalitet',
qualityBest : 'Best',
qualityHigh : 'Høy',
qualityAutoHigh : 'Auto høy',
qualityMedium : 'Medium',
qualityAutoLow : 'Auto lav',
qualityLow : 'Lav',
windowModeWindow: 'Vindu',
windowModeOpaque: 'Opaque',
windowModeTransparent : 'Gjennomsiktig',
windowMode : 'Vindumodus',
flashvars : 'Variabler for flash',
bgcolor : 'Bakgrunnsfarge',
hSpace : 'HMarg',
vSpace : 'VMarg',
validateSrc : 'Vennligst skriv inn lenkens url.',
validateHSpace : 'HMarg må være et tall.',
validateVSpace : 'VMarg må være et tall.'
},
// Speller Pages Dialog
spellCheck :
{
toolbar : 'Stavekontroll',
title : 'Stavekontroll',
notAvailable : 'Beklager, tjenesten er utilgjenglig nå.',
errorLoading : 'Feil under lasting av applikasjonstjenestetjener: %s.',
notInDic : 'Ikke i ordboken',
changeTo : 'Endre til',
btnIgnore : 'Ignorer',
btnIgnoreAll : 'Ignorer alle',
btnReplace : 'Erstatt',
btnReplaceAll : 'Erstatt alle',
btnUndo : 'Angre',
noSuggestions : '- Ingen forslag -',
progress : 'Stavekontroll pågår...',
noMispell : 'Stavekontroll fullført: ingen feilstavinger funnet',
noChanges : 'Stavekontroll fullført: ingen ord endret',
oneChange : 'Stavekontroll fullført: Ett ord endret',
manyChanges : 'Stavekontroll fullført: %1 ord endret',
ieSpellDownload : 'Stavekontroll er ikke installert. Vil du laste den ned nå?'
},
smiley :
{
toolbar : 'Smil',
title : 'Sett inn smil',
options : 'Alternativer for smil'
},
elementsPath :
{
eleLabel : 'Element-sti',
eleTitle : '%1 element'
},
numberedlist : 'Legg til/Fjern nummerert liste',
bulletedlist : 'Legg til/Fjern punktmerket liste',
indent : 'Øk innrykk',
outdent : 'Reduser innrykk',
justify :
{
left : 'Venstrejuster',
center : 'Midtstill',
right : 'Høyrejuster',
block : 'Blokkjuster'
},
blockquote : 'Sitatblokk',
clipboard :
{
title : 'Lim inn',
cutError : 'Din nettlesers sikkerhetsinstillinger tillater ikke automatisk utklipping av tekst. Vennligst bruk snarveien (Ctrl/Cmd+X).',
copyError : 'Din nettlesers sikkerhetsinstillinger tillater ikke automatisk kopiering av tekst. Vennligst bruk snarveien (Ctrl/Cmd+C).',
pasteMsg : 'Vennligst lim inn i følgende boks med tastaturet (<STRONG>Ctrl/Cmd+V</STRONG>) og trykk <STRONG>OK</STRONG>.',
securityMsg : 'Din nettlesers sikkerhetsinstillinger gir ikke redigeringsverktøyet direkte tilgang til utklippstavlen. Du må derfor lime det inn på nytt i dette vinduet.',
pasteArea : 'Innlimingsområde'
},
pastefromword :
{
confirmCleanup : 'Teksten du limer inn ser ut til å være kopiert fra Word. Vil du renske den før du limer den inn?',
toolbar : 'Lim inn fra Word',
title : 'Lim inn fra Word',
error : 'Det var ikke mulig å renske den innlimte teksten på grunn av en intern feil'
},
pasteText :
{
button : 'Lim inn som ren tekst',
title : 'Lim inn som ren tekst'
},
templates :
{
button : 'Maler',
title : 'Innholdsmaler',
options : 'Alternativer for mal',
insertOption : 'Erstatt gjeldende innhold',
selectPromptMsg : 'Velg malen du vil åpne i redigeringsverktøyet:',
emptyListMsg : '(Ingen maler definert)'
},
showBlocks : 'Vis blokker',
stylesCombo :
{
label : 'Stil',
panelTitle : 'Stilformater',
panelTitle1 : 'Blokkstiler',
panelTitle2 : 'Inlinestiler',
panelTitle3 : 'Objektstiler'
},
format :
{
label : 'Format',
panelTitle : 'Avsnittsformat',
tag_p : 'Normal',
tag_pre : 'Formatert',
tag_address : 'Adresse',
tag_h1 : 'Overskrift 1',
tag_h2 : 'Overskrift 2',
tag_h3 : 'Overskrift 3',
tag_h4 : 'Overskrift 4',
tag_h5 : 'Overskrift 5',
tag_h6 : 'Overskrift 6',
tag_div : 'Normal (DIV)'
},
div :
{
title : 'Sett inn Div Container',
toolbar : 'Sett inn Div Container',
cssClassInputLabel : 'Stilark-klasser',
styleSelectLabel : 'Stil',
IdInputLabel : 'Id',
languageCodeInputLabel : ' Språkkode',
inlineStyleInputLabel : 'Inlinestiler',
advisoryTitleInputLabel : 'Tittel',
langDirLabel : 'Språkretning',
langDirLTRLabel : 'Venstre til høyre (VTH)',
langDirRTLLabel : 'Høyre til venstre (HTV)',
edit : 'Rediger Div',
remove : 'Fjern Div'
},
iframe :
{
title : 'Egenskaper for IFrame',
toolbar : 'IFrame',
noUrl : 'Vennligst skriv inn URL for iframe',
scrolling : 'Aktiver scrollefelt',
border : 'Viss ramme rundt iframe'
},
font :
{
label : 'Skrift',
voiceLabel : 'Font',
panelTitle : 'Skrift'
},
fontSize :
{
label : 'Størrelse',
voiceLabel : 'Font Størrelse',
panelTitle : 'Størrelse'
},
colorButton :
{
textColorTitle : 'Tekstfarge',
bgColorTitle : 'Bakgrunnsfarge',
panelTitle : 'Farger',
auto : 'Automatisk',
more : 'Flere farger...'
},
colors :
{
'000' : 'Svart',
'800000' : 'Rødbrun',
'8B4513' : 'Salbrun',
'2F4F4F' : 'Grønnsvart',
'008080' : 'Blågrønn',
'000080' : 'Marineblått',
'4B0082' : 'Indigo',
'696969' : 'Mørk grå',
'B22222' : 'Mørkerød',
'A52A2A' : 'Brun',
'DAA520' : 'Lys brun',
'006400' : 'Mørk grønn',
'40E0D0' : 'Turkis',
'0000CD' : 'Medium blå',
'800080' : 'Purpur',
'808080' : 'Grå',
'F00' : 'Rød',
'FF8C00' : 'Mørk oransje',
'FFD700' : 'Gull',
'008000' : 'Grønn',
'0FF' : 'Cyan',
'00F' : 'Blå',
'EE82EE' : 'Fiolett',
'A9A9A9' : 'Svak grå',
'FFA07A' : 'Rosa-oransje',
'FFA500' : 'Oransje',
'FFFF00' : 'Gul',
'00FF00' : 'Lime',
'AFEEEE' : 'Svak turkis',
'ADD8E6' : 'Lys Blå',
'DDA0DD' : 'Plomme',
'D3D3D3' : 'Lys grå',
'FFF0F5' : 'Svak lavendelrosa',
'FAEBD7' : 'Antikk-hvit',
'FFFFE0' : 'Lys gul',
'F0FFF0' : 'Honningmelon',
'F0FFFF' : 'Svakt asurblått',
'F0F8FF' : 'Svak cyan',
'E6E6FA' : 'Lavendel',
'FFF' : 'Hvit'
},
scayt :
{
title : 'Stavekontroll mens du skriver',
opera_title : 'Ikke støttet av Opera',
enable : 'Slå på SCAYT',
disable : 'Slå av SCAYT',
about : 'Om SCAYT',
toggle : 'Veksle SCAYT',
options : 'Valg',
langs : 'Språk',
moreSuggestions : 'Flere forslag',
ignore : 'Ignorer',
ignoreAll : 'Ignorer Alle',
addWord : 'Legg til ord',
emptyDic : 'Ordboknavn bør ikke være tom.',
optionsTab : 'Valg',
allCaps : 'Ikke kontroller ord med kun store bokstaver',
ignoreDomainNames : 'Ikke kontroller domenenavn',
mixedCase : 'Ikke kontroller ord med blandet små og store bokstaver',
mixedWithDigits : 'Ikke kontroller ord som inneholder tall',
languagesTab : 'Språk',
dictionariesTab : 'Ordbøker',
dic_field_name : 'Ordboknavn',
dic_create : 'Opprett',
dic_restore : 'Gjenopprett',
dic_delete : 'Slett',
dic_rename : 'Gi nytt navn',
dic_info : 'Brukerordboken lagres først i en informasjonskapsel på din maskin, men det er en begrensning på hvor mye som kan lagres her. Når ordboken blir for stor til å lagres i en informasjonskapsel, vil vi i stedet lagre ordboken på vår server. For å lagre din personlige ordbok på vår server, burde du velge et navn for ordboken din. Hvis du allerede har lagret en ordbok, vennligst skriv inn ordbokens navn og klikk på Gjenopprett-knappen.',
aboutTab : 'Om'
},
about :
{
title : 'Om CKEditor',
dlgTitle : 'Om CKEditor',
help : 'Se $1 for hjelp.',
userGuide : 'CKEditors brukerveiledning',
moreInfo : 'For lisensieringsinformasjon, vennligst besøk vårt nettsted:',
copy : 'Copyright © $1. Alle rettigheter reservert.'
},
maximize : 'Maksimer',
minimize : 'Minimer',
fakeobjects :
{
anchor : 'Anker',
flash : 'Flash-animasjon',
iframe : 'IFrame',
hiddenfield : 'Skjult felt',
unknown : 'Ukjent objekt'
},
resize : 'Dra for å skalere',
colordialog :
{
title : 'Velg farge',
options : 'Alternativer for farge',
highlight : 'Merk',
selected : 'Valgt',
clear : 'Tøm'
},
toolbarCollapse : 'Skjul verktøylinje',
toolbarExpand : 'Vis verktøylinje',
toolbarGroups :
{
document : 'Dokument',
clipboard : 'Utklippstavle/Angre',
editing : 'Redigering',
forms : 'Skjema',
basicstyles : 'Basisstiler',
paragraph : 'Avsnitt',
links : 'Lenker',
insert : 'Innsetting',
styles : 'Stiler',
colors : 'Farger',
tools : 'Verktøy'
},
bidi :
{
ltr : 'Tekstretning fra venstre til høyre',
rtl : 'Tekstretning fra høyre til venstre'
},
docprops :
{
label : 'Dokumentegenskaper',
title : 'Dokumentegenskaper',
design : 'Design',
meta : 'Meta-data',
chooseColor : 'Velg',
other : '<annen>',
docTitle : 'Sidetittel',
charset : 'Tegnsett',
charsetOther : 'Annet tegnsett',
charsetASCII : 'ASCII',
charsetCE : 'Sentraleuropeisk',
charsetCT : 'Tradisonell kinesisk(Big5)',
charsetCR : 'Kyrillisk',
charsetGR : 'Gresk',
charsetJP : 'Japansk',
charsetKR : 'Koreansk',
charsetTR : 'Tyrkisk',
charsetUN : 'Unicode (UTF-8)',
charsetWE : 'Vesteuropeisk',
docType : 'Dokumenttype header',
docTypeOther : 'Annet dokumenttype header',
xhtmlDec : 'Inkluder XHTML-deklarasjon',
bgColor : 'Bakgrunnsfarge',
bgImage : 'URL for bakgrunnsbilde',
bgFixed : 'Lås bakgrunnsbilde',
txtColor : 'Tekstfarge',
margin : 'Sidemargin',
marginTop : 'Topp',
marginLeft : 'Venstre',
marginRight : 'Høyre',
marginBottom : 'Bunn',
metaKeywords : 'Dokument nøkkelord (kommaseparert)',
metaDescription : 'Dokumentbeskrivelse',
metaAuthor : 'Forfatter',
metaCopyright : 'Kopirett',
previewHtml : '<p>Dette er en <strong>eksempeltekst</strong>. Du bruker <a href="javascript:void(0)">CKEditor</a>.</p>'
}
};
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">768</int>
<string key="IBDocument.SystemVersion">10A288</string>
<string key="IBDocument.InterfaceBuilderVersion">715</string>
<string key="IBDocument.AppKitVersion">1010</string>
<string key="IBDocument.HIToolboxVersion">411.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">46</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="10"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="841351856">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
</object>
<object class="IBProxyObject" id="427554174">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
</object>
<object class="IBUICustomObject" id="664661524"/>
<object class="IBUIViewController" id="943309135">
<string key="IBUINibName">TestAppViewController</string>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
</object>
<object class="IBUIWindow" id="117978783">
<nil key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 480}</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="664661524"/>
</object>
<int key="connectionID">4</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">viewController</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="943309135"/>
</object>
<int key="connectionID">11</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="117978783"/>
</object>
<int key="connectionID">14</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="664661524"/>
<reference key="parent" ref="0"/>
<string key="objectName">TestApp App Delegate</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="427554174"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">10</int>
<reference key="object" ref="943309135"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="117978783"/>
<reference key="parent" ref="0"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>10.CustomClassName</string>
<string>10.IBEditorWindowLastContentRect</string>
<string>10.IBPluginDependency</string>
<string>12.IBEditorWindowLastContentRect</string>
<string>12.IBPluginDependency</string>
<string>3.CustomClassName</string>
<string>3.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIApplication</string>
<string>UIResponder</string>
<string>TestAppViewController</string>
<string>{{512, 351}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>{{525, 346}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>TestAppAppDelegate</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">14</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">TestAppAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>viewController</string>
<string>window</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>TestAppViewController</string>
<string>UIWindow</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/TestAppAppDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">TestAppAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">TestAppViewController</string>
<string key="superclassName">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/TestAppViewController.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3100" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">TestApp.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>
|
{
"pile_set_name": "Github"
}
|
OUTPUT=result
hub autofinetune text_cls.py \
--param_file=hparam.yaml \
--gpu=0 \
--popsize=15 \
--round=10 \
--output_dir=${OUTPUT} \
--evaluator=fulltrail \
--tuning_strategy=pshe2
|
{
"pile_set_name": "Github"
}
|
// +build !windows
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package redirfd
import (
"fmt"
"os"
"syscall"
)
type RedirectMode int
const (
Read RedirectMode = iota // open file for reading
Write // open file for writing, truncating if it exists
Update // open file for read & write
Append // open file for append, create if it does not exist
AppendExisting // open file for append, do not create if it does not already exist
WriteNew // open file for writing, creating it, failing if it already exists
)
// see https://github.com/skarnet/execline/blob/master/src/execline/redirfd.c
func (mode RedirectMode) Redirect(nonblock, changemode bool, fd FileDescriptor, name string) (*os.File, error) {
flags := 0
what := -1
switch mode {
case Read:
what = syscall.O_RDONLY
flags &= ^(syscall.O_APPEND | syscall.O_CREAT | syscall.O_TRUNC | syscall.O_EXCL)
case Write:
what = syscall.O_WRONLY
flags |= syscall.O_CREAT | syscall.O_TRUNC
flags &= ^(syscall.O_APPEND | syscall.O_EXCL)
case Update:
what = syscall.O_RDWR
flags &= ^(syscall.O_APPEND | syscall.O_CREAT | syscall.O_TRUNC | syscall.O_EXCL)
case Append:
what = syscall.O_WRONLY
flags |= syscall.O_CREAT | syscall.O_APPEND
flags &= ^(syscall.O_TRUNC | syscall.O_EXCL)
case AppendExisting:
what = syscall.O_WRONLY
flags |= syscall.O_APPEND
flags &= ^(syscall.O_CREAT | syscall.O_TRUNC | syscall.O_EXCL)
case WriteNew:
what = syscall.O_WRONLY
flags |= syscall.O_CREAT | syscall.O_EXCL
flags &= ^(syscall.O_APPEND | syscall.O_TRUNC)
default:
return nil, fmt.Errorf("unexpected mode %d", mode)
}
if nonblock {
flags |= syscall.O_NONBLOCK
}
flags |= what
fd2, e := open(name, flags, 0666)
if (what == syscall.O_WRONLY) && (e == syscall.ENXIO) {
// Opens file in read-only, non-blocking mode. Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails.
fdr, e2 := open(name, syscall.O_RDONLY|syscall.O_NONBLOCK, 0)
if e2 != nil {
return nil, &os.PathError{Op: "open_read", Path: name, Err: e2}
}
fd2, e = open(name, flags, 0666)
fd_close(fdr)
}
if e != nil {
return nil, &os.PathError{Op: "open", Path: name, Err: e}
}
if e = fd_move(fd, fd2); e != nil {
return nil, &os.PathError{Op: "fd_move", Path: name, Err: e}
}
if changemode {
if nonblock {
e = ndelay_off(fd)
} else {
e = ndelay_on(fd)
}
if e != nil {
return nil, &os.PathError{Op: "ndelay", Path: name, Err: e}
}
}
return os.NewFile(uintptr(fd2), name), nil
}
// proxy to return a FileDescriptor
func open(path string, openmode int, perm uint32) (FileDescriptor, error) {
fdint, err := syscall.Open(path, openmode, perm)
return FileDescriptor(fdint), err
}
// see https://github.com/skarnet/skalibs/blob/master/src/libstddjb/fd_move.c
func fd_move(to, from FileDescriptor) (err error) {
if to == from {
return
}
for {
_, _, e1 := syscall.RawSyscall(syscall.SYS_DUP2, uintptr(from), uintptr(to), 0)
if e1 != syscall.EINTR {
if e1 != 0 {
err = e1
}
break
}
}
if err != nil {
err = fd_close(from)
}
return
/*
do
r = dup2(from, to) ;
while ((r == -1) && (errno == EINTR)) ;
return (r == -1) ? -1 : fd_close(from) ;
*/
}
// see https://github.com/skarnet/skalibs/blob/master/src/libstddjb/fd_close.c
func fd_close(fd FileDescriptor) (err error) {
i := 0
var e error
for {
if e = syscall.Close(int(fd)); e != nil {
return nil
}
i++
if e != syscall.EINTR {
break
}
}
if e == syscall.EBADF && i > 1 {
return nil
}
return e
}
/*
int fd_close (int fd)
{
register unsigned int i = 0 ;
doit:
if (!close(fd)) return 0 ;
i++ ;
if (errno == EINTR) goto doit ;
return ((errno == EBADF) && (i > 1)) ? 0 : -1 ;
}
*/
// see https://github.com/skarnet/skalibs/blob/master/src/libstddjb/ndelay_on.c
func ndelay_on(fd FileDescriptor) error {
// 32-bit will likely break because it needs SYS_FCNTL64
got, _, e := syscall.Syscall(syscall.SYS_FCNTL, uintptr(fd), uintptr(syscall.F_GETFL), 0)
if e != 0 {
return e
}
_, _, e = syscall.Syscall(syscall.SYS_FCNTL, uintptr(fd), uintptr(syscall.F_SETFL), uintptr(got|syscall.O_NONBLOCK))
if e != 0 {
return e
}
return nil
}
/*
int ndelay_on (int fd)
{
register int got = fcntl(fd, F_GETFL) ;
return (got == -1) ? -1 : fcntl(fd, F_SETFL, got | O_NONBLOCK) ;
}
*/
// see https://github.com/skarnet/skalibs/blob/master/src/libstddjb/ndelay_off.c
func ndelay_off(fd FileDescriptor) error {
// 32-bit will likely break because it needs SYS_FCNTL64
got, _, e := syscall.Syscall(syscall.SYS_FCNTL, uintptr(fd), uintptr(syscall.F_GETFL), 0)
if e != 0 {
return e
}
_, _, e = syscall.Syscall(syscall.SYS_FCNTL, uintptr(fd), uintptr(syscall.F_SETFL), uintptr(int(got) & ^syscall.O_NONBLOCK))
if e != 0 {
return e
}
return nil
}
/*
int ndelay_off (int fd)
{
register int got = fcntl(fd, F_GETFL) ;
return (got == -1) ? -1 : fcntl(fd, F_SETFL, got & ^O_NONBLOCK) ;
}
*/
|
{
"pile_set_name": "Github"
}
|
---
- name: Enable and Start Kafka
service: name=kafka state=started enabled=yes
- name: wait for kafka port
wait_for: host={{kafka_listen_address| default('localhost')}} port={{kafka_port}} state=started timeout={{ kafka_wait_for_period }}
when: verify
|
{
"pile_set_name": "Github"
}
|
#
# ATM device configuration
#
menuconfig ATM_DRIVERS
bool "ATM drivers"
depends on NETDEVICES && ATM
default y
---help---
Say Y here to get to see options for Asynchronous Transfer Mode
device drivers. This option alone does not add any kernel code.
If you say N, all options in this submenu will be skipped and disabled.
if ATM_DRIVERS && NETDEVICES && ATM
config ATM_DUMMY
tristate "Dummy ATM driver"
help
Dummy ATM driver. Useful for proxy signalling, testing,
and development. If unsure, say N.
config ATM_TCP
tristate "ATM over TCP"
depends on INET
help
ATM over TCP driver. Useful mainly for development and for
experiments. If unsure, say N.
config ATM_LANAI
tristate "Efficient Networks Speedstream 3010"
depends on PCI && ATM
help
Supports ATM cards based on the Efficient Networks "Lanai"
chipset such as the Speedstream 3010 and the ENI-25p. The
Speedstream 3060 is currently not supported since we don't
have the code to drive the on-board Alcatel DSL chipset (yet).
config ATM_ENI
tristate "Efficient Networks ENI155P"
depends on PCI
---help---
Driver for the Efficient Networks ENI155p series and SMC ATM
Power155 155 Mbps ATM adapters. Both, the versions with 512KB and
2MB on-board RAM (Efficient calls them "C" and "S", respectively),
and the FPGA and the ASIC Tonga versions of the board are supported.
The driver works with MMF (-MF or ...F) and UTP-5 (-U5 or ...D)
adapters.
To compile this driver as a module, choose M here: the module will
be called eni.
config ATM_ENI_DEBUG
bool "Enable extended debugging"
depends on ATM_ENI
help
Extended debugging records various events and displays that list
when an inconsistency is detected. This mechanism is faster than
generally using printks, but still has some impact on performance.
Note that extended debugging may create certain race conditions
itself. Enable this ONLY if you suspect problems with the driver.
config ATM_ENI_TUNE_BURST
bool "Fine-tune burst settings"
depends on ATM_ENI
---help---
In order to obtain good throughput, the ENI NIC can transfer
multiple words of data per PCI bus access cycle. Such a multi-word
transfer is called a burst.
The default settings for the burst sizes are suitable for most PCI
chipsets. However, in some cases, large bursts may overrun buffers
in the PCI chipset and cause data corruption. In such cases, large
bursts must be disabled and only (slower) small bursts can be used.
The burst sizes can be set independently in the send (TX) and
receive (RX) direction.
Note that enabling many different burst sizes in the same direction
may increase the cost of setting up a transfer such that the
resulting throughput is lower than when using only the largest
available burst size.
Also, sometimes larger bursts lead to lower throughput, e.g. on an
Intel 440FX board, a drop from 135 Mbps to 103 Mbps was observed
when going from 8W to 16W bursts.
config ATM_ENI_BURST_TX_16W
bool "Enable 16W TX bursts (discouraged)"
depends on ATM_ENI_TUNE_BURST
help
Burst sixteen words at once in the send direction. This may work
with recent PCI chipsets, but is known to fail with older chipsets.
config ATM_ENI_BURST_TX_8W
bool "Enable 8W TX bursts (recommended)"
depends on ATM_ENI_TUNE_BURST
help
Burst eight words at once in the send direction. This is the default
setting.
config ATM_ENI_BURST_TX_4W
bool "Enable 4W TX bursts (optional)"
depends on ATM_ENI_TUNE_BURST
help
Burst four words at once in the send direction. You may want to try
this if you have disabled 8W bursts. Enabling 4W if 8W is also set
may or may not improve throughput.
config ATM_ENI_BURST_TX_2W
bool "Enable 2W TX bursts (optional)"
depends on ATM_ENI_TUNE_BURST
help
Burst two words at once in the send direction. You may want to try
this if you have disabled 4W and 8W bursts. Enabling 2W if 4W or 8W
are also set may or may not improve throughput.
config ATM_ENI_BURST_RX_16W
bool "Enable 16W RX bursts (discouraged)"
depends on ATM_ENI_TUNE_BURST
help
Burst sixteen words at once in the receive direction. This may work
with recent PCI chipsets, but is known to fail with older chipsets.
config ATM_ENI_BURST_RX_8W
bool "Enable 8W RX bursts (discouraged)"
depends on ATM_ENI_TUNE_BURST
help
Burst eight words at once in the receive direction. This may work
with recent PCI chipsets, but is known to fail with older chipsets,
such as the Intel Neptune series.
config ATM_ENI_BURST_RX_4W
bool "Enable 4W RX bursts (recommended)"
depends on ATM_ENI_TUNE_BURST
help
Burst four words at once in the receive direction. This is the
default setting. Enabling 4W if 8W is also set may or may not
improve throughput.
config ATM_ENI_BURST_RX_2W
bool "Enable 2W RX bursts (optional)"
depends on ATM_ENI_TUNE_BURST
help
Burst two words at once in the receive direction. You may want to
try this if you have disabled 4W and 8W bursts. Enabling 2W if 4W or
8W are also set may or may not improve throughput.
config ATM_FIRESTREAM
tristate "Fujitsu FireStream (FS50/FS155) "
depends on PCI && VIRT_TO_BUS
help
Driver for the Fujitsu FireStream 155 (MB86697) and
FireStream 50 (MB86695) ATM PCI chips.
To compile this driver as a module, choose M here: the module will
be called firestream.
config ATM_ZATM
tristate "ZeitNet ZN1221/ZN1225"
depends on PCI && VIRT_TO_BUS
help
Driver for the ZeitNet ZN1221 (MMF) and ZN1225 (UTP-5) 155 Mbps ATM
adapters.
To compile this driver as a module, choose M here: the module will
be called zatm.
config ATM_ZATM_DEBUG
bool "Enable extended debugging"
depends on ATM_ZATM
help
Extended debugging records various events and displays that list
when an inconsistency is detected. This mechanism is faster than
generally using printks, but still has some impact on performance.
Note that extended debugging may create certain race conditions
itself. Enable this ONLY if you suspect problems with the driver.
config ATM_NICSTAR
tristate "IDT 77201 (NICStAR) (ForeRunnerLE)"
depends on PCI
help
The NICStAR chipset family is used in a large number of ATM NICs for
25 and for 155 Mbps, including IDT cards and the Fore ForeRunnerLE
series. Say Y if you have one of those.
To compile this driver as a module, choose M here: the module will
be called nicstar.
config ATM_NICSTAR_USE_SUNI
bool "Use suni PHY driver (155Mbps)"
depends on ATM_NICSTAR
help
Support for the S-UNI and compatible PHYsical layer chips. These are
found in most 155Mbps NICStAR based ATM cards, namely in the
ForeRunner LE155 cards. This driver provides detection of cable~
removal and reinsertion and provides some statistics. This driver
doesn't have removal capability when compiled as a module, so if you
need that capability don't include S-UNI support (it's not needed to
make the card work).
config ATM_NICSTAR_USE_IDT77105
bool "Use IDT77015 PHY driver (25Mbps)"
depends on ATM_NICSTAR
help
Support for the PHYsical layer chip in ForeRunner LE25 cards. In
addition to cable removal/reinsertion detection, this driver allows
you to control the loopback mode of the chip via a dedicated IOCTL.
This driver is required for proper handling of temporary carrier
loss, so if you have a 25Mbps NICStAR based ATM card you must say Y.
config ATM_IDT77252
tristate "IDT 77252 (NICStAR II)"
depends on PCI
help
Driver for the IDT 77252 ATM PCI chips.
To compile this driver as a module, choose M here: the module will
be called idt77252.
config ATM_IDT77252_DEBUG
bool "Enable debugging messages"
depends on ATM_IDT77252
help
Somewhat useful debugging messages are available. The choice of
messages is controlled by a bitmap. This may be specified as a
module argument. See the file <file:drivers/atm/idt77252.h> for
the meanings of the bits in the mask.
When active, these messages can have a significant impact on the
speed of the driver, and the size of your syslog files! When
inactive, they will have only a modest impact on performance.
config ATM_IDT77252_RCV_ALL
bool "Receive ALL cells in raw queue"
depends on ATM_IDT77252
help
Enable receiving of all cells on the ATM link, that do not match
an open connection in the raw cell queue of the driver. Useful
for debugging or special applications only, so the safe answer is N.
config ATM_IDT77252_USE_SUNI
bool
depends on ATM_IDT77252
default y
config ATM_AMBASSADOR
tristate "Madge Ambassador (Collage PCI 155 Server)"
depends on PCI && VIRT_TO_BUS
select BITREVERSE
help
This is a driver for ATMizer based ATM card produced by Madge
Networks Ltd. Say Y (or M to compile as a module named ambassador)
here if you have one of these cards.
config ATM_AMBASSADOR_DEBUG
bool "Enable debugging messages"
depends on ATM_AMBASSADOR
---help---
Somewhat useful debugging messages are available. The choice of
messages is controlled by a bitmap. This may be specified as a
module argument (kernel command line argument as well?), changed
dynamically using an ioctl (not yet) or changed by sending the
string "Dxxxx" to VCI 1023 (where x is a hex digit). See the file
<file:drivers/atm/ambassador.h> for the meanings of the bits in the
mask.
When active, these messages can have a significant impact on the
speed of the driver, and the size of your syslog files! When
inactive, they will have only a modest impact on performance.
config ATM_HORIZON
tristate "Madge Horizon [Ultra] (Collage PCI 25 and Collage PCI 155 Client)"
depends on PCI && VIRT_TO_BUS
help
This is a driver for the Horizon chipset ATM adapter cards once
produced by Madge Networks Ltd. Say Y (or M to compile as a module
named horizon) here if you have one of these cards.
config ATM_HORIZON_DEBUG
bool "Enable debugging messages"
depends on ATM_HORIZON
---help---
Somewhat useful debugging messages are available. The choice of
messages is controlled by a bitmap. This may be specified as a
module argument (kernel command line argument as well?), changed
dynamically using an ioctl (not yet) or changed by sending the
string "Dxxxx" to VCI 1023 (where x is a hex digit). See the file
<file:drivers/atm/horizon.h> for the meanings of the bits in the
mask.
When active, these messages can have a significant impact on the
speed of the driver, and the size of your syslog files! When
inactive, they will have only a modest impact on performance.
config ATM_IA
tristate "Interphase ATM PCI x575/x525/x531"
depends on PCI
---help---
This is a driver for the Interphase (i)ChipSAR adapter cards
which include a variety of variants in term of the size of the
control memory (128K-1KVC, 512K-4KVC), the size of the packet
memory (128K, 512K, 1M), and the PHY type (Single/Multi mode OC3,
UTP155, UTP25, DS3 and E3). Go to:
<http://www.iphase.com/>
for more info about the cards. Say Y (or M to compile as a module
named iphase) here if you have one of these cards.
See the file <file:Documentation/networking/iphase.txt> for further
details.
config ATM_IA_DEBUG
bool "Enable debugging messages"
depends on ATM_IA
---help---
Somewhat useful debugging messages are available. The choice of
messages is controlled by a bitmap. This may be specified as a
module argument (kernel command line argument as well?), changed
dynamically using an ioctl (Get the debug utility, iadbg, from
<ftp://ftp.iphase.com/pub/atm/pci/>).
See the file <file:drivers/atm/iphase.h> for the meanings of the
bits in the mask.
When active, these messages can have a significant impact on the
speed of the driver, and the size of your syslog files! When
inactive, they will have only a modest impact on performance.
config ATM_FORE200E
tristate "FORE Systems 200E-series"
depends on (PCI || SBUS)
select FW_LOADER
---help---
This is a driver for the FORE Systems 200E-series ATM adapter
cards. It simultaneously supports PCA-200E and SBA-200E models
on PCI and SBUS hosts. Say Y (or M to compile as a module
named fore_200e) here if you have one of these ATM adapters.
See the file <file:Documentation/networking/fore200e.txt> for
further details.
config ATM_FORE200E_USE_TASKLET
bool "Defer interrupt work to a tasklet"
depends on ATM_FORE200E
default n
help
This defers work to be done by the interrupt handler to a
tasklet instead of handling everything at interrupt time. This
may improve the responsive of the host.
config ATM_FORE200E_TX_RETRY
int "Maximum number of tx retries"
depends on ATM_FORE200E
default "16"
---help---
Specifies the number of times the driver attempts to transmit
a message before giving up, if the transmit queue of the ATM card
is transiently saturated.
Saturation of the transmit queue may occur only under extreme
conditions, e.g. when a fast host continuously submits very small
frames (<64 bytes) or raw AAL0 cells (48 bytes) to the ATM adapter.
Note that under common conditions, it is unlikely that you encounter
a saturation of the transmit queue, so the retry mechanism never
comes into play.
config ATM_FORE200E_DEBUG
int "Debugging level (0-3)"
depends on ATM_FORE200E
default "0"
help
Specifies the level of debugging messages issued by the driver.
The verbosity of the driver increases with the value of this
parameter.
When active, these messages can have a significant impact on
the performances of the driver, and the size of your syslog files!
Keep the debugging level to 0 during normal operations.
config ATM_HE
tristate "ForeRunner HE Series"
depends on PCI
help
This is a driver for the Marconi ForeRunner HE-series ATM adapter
cards. It simultaneously supports the 155 and 622 versions.
config ATM_HE_USE_SUNI
bool "Use S/UNI PHY driver"
depends on ATM_HE
help
Support for the S/UNI-Ultra and S/UNI-622 found in the ForeRunner
HE cards. This driver provides carrier detection some statistics.
config ATM_SOLOS
tristate "Solos ADSL2+ PCI Multiport card driver"
depends on PCI
select FW_LOADER
help
Support for the Solos multiport ADSL2+ card.
endif # ATM
|
{
"pile_set_name": "Github"
}
|
# Generated by Django 2.2.10 on 2020-04-18 21:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('papers', '0024_auto_20200123_2008'),
]
operations = [
migrations.AlterModelOptions(
name='paper',
options={'get_latest_by': 'updated'},
),
migrations.AlterField(
model_name='paper',
name='updated',
field=models.DateTimeField(db_index=True),
),
]
|
{
"pile_set_name": "Github"
}
|
@value fade-duration from './values.module.css';
.backdrop {
composes: clip from '../utils.module.css';
position: absolute;
/* We only want to clip the backdrop at the top. Extend it by the
height of one viewport to ensure it is still visible when the fade
is happening. */
height: calc(100% + 100vh);
}
.backdropInner {
position: fixed;
top: 0;
height: 100vh;
width: 100%;
transform: translateZ(0);
backface-visibility: hidden;
}
.foreground {
transition: opacity fade-duration ease, visibility fade-duration;
}
.foreground-above {
opacity: 0;
visibility: hidden;
}
|
{
"pile_set_name": "Github"
}
|
# Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
"""
This is test module for properties.
>>> r = properties.ret_type()
>>> r.i = 22.5
>>> r.i
22.5
>>> c = properties.crash_me()
>>> c.i.i
42.5
>>> X = properties.X
>>> x1 = X(1)
value read only
>>> x1.value_r
1
value read - write
>>> x1.value_rw
1
value direct access
>>> x1.value_direct
1
class instance count read - only
>>> X.instance_count
1
class instance count direct
>>> X.instance_count_direct
1
class instance count injected
>>> X.instance_count_injected
1
class instance count from object
>>> x1.instance_count
1
class instance count from object
>>> x1.instance_count_direct
1
class instance count from object:
>>> x1.instance_count_injected
1
as expected you can't assign new value to read only property
>>> x1.value_r = 2
Traceback (most recent call last):
File "properties.py", line 49, in ?
x1.value_r = 2
AttributeError: can't set attribute
setting value_rw to 2. value_direct:
>>> x1.value_rw = 2
>>> x1.value_rw
2
setting value_direct to 3. value_direct:
>>> x1.value_direct = 3
>>> x1.value_direct
3
>>> assert x1.value_r == 3
>>> x2 = X(2)
after creating second intstance of X instances count is 2
>>> x2.instance_count
2
>>> del x2
>>> assert x1.instance_count == 1
>>> assert properties.X.value_r_ds.__doc__ == "value_r_ds is read-only"
>>> assert properties.X.value_rw_ds.__doc__ == "value_rw_ds is read-write"
"""
#import sys; sys.path.append(r'P:\Actimize4.0\smart_const\py_smart_const___Win32_Debug')
import properties_ext as properties
def run(args = None):
import sys
import doctest
if args is not None:
sys.argv = args
return doctest.testmod(sys.modules.get(__name__))
if __name__ == '__main__':
print "running..."
import sys
status = run()[0]
if (status == 0): print "Done."
sys.exit(status)
|
{
"pile_set_name": "Github"
}
|
import { WorkspaceResults } from '@nrwl/workspace/src/command-line/workspace-results';
export type ImplicitDependencyEntry<T = '*' | string[]> = {
[key: string]: T | ImplicitJsonSubsetDependency<T>;
};
export interface ImplicitJsonSubsetDependency<T = '*' | string[]> {
[key: string]: T | ImplicitJsonSubsetDependency<T>;
}
export interface NxAffectedConfig {
defaultBase?: string;
}
export interface NxJson<T = '*' | string[]> {
implicitDependencies?: ImplicitDependencyEntry<T>;
npmScope: string;
affected?: NxAffectedConfig;
projects: {
[projectName: string]: NxJsonProjectConfig;
};
workspaceLayout?: {
libsDir?: string;
appsDir?: string;
};
tasksRunnerOptions?: {
[tasksRunnerName: string]: {
runner: string;
options?: object;
};
};
}
export interface NxJsonProjectConfig {
implicitDependencies?: string[];
tags?: string[];
}
export interface Environment {
nxJson: NxJson;
workspaceJson: any;
workspaceResults: WorkspaceResults;
}
|
{
"pile_set_name": "Github"
}
|
# This option enables LTO for stage4 and LTO for generators in stage3 with profiledbootstrap.
# Otherwise, LTO is used in only stage3.
STAGE3_CFLAGS += -flto=jobserver
override STAGEtrain_CFLAGS := $(filter-out -flto=jobserver,$(STAGEtrain_CFLAGS))
STAGEtrain_GENERATOR_CFLAGS += -flto=jobserver
STAGEfeedback_CFLAGS += -flto=jobserver
# assumes the host supports the linker plugin
LTO_AR = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-ar$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
LTO_RANLIB = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-ranlib$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
LTO_EXPORTS = AR="$(LTO_AR)"; export AR; \
RANLIB="$(LTO_RANLIB)"; export RANLIB;
LTO_FLAGS_TO_PASS = AR="$(LTO_AR)" RANLIB="$(LTO_RANLIB)"
do-compare = /bin/true
|
{
"pile_set_name": "Github"
}
|
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package javascript
import (
"context"
"sync"
"testing"
"time"
"github.com/elastic/beats/v7/libbeat/beat"
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/logp"
"github.com/stretchr/testify/assert"
)
func TestSessionTagOnException(t *testing.T) {
const script = `throw "this tags the event";`
p, err := NewFromConfig(Config{
Source: header + script + footer,
TagOnException: defaultConfig().TagOnException,
}, nil)
if err != nil {
t.Fatal(err)
}
evt, err := p.Run(testEvent())
assert.Error(t, err)
tags, _ := evt.GetValue("tags")
assert.Equal(t, []string{"_js_exception"}, tags)
}
func TestSessionScriptParams(t *testing.T) {
t.Run("register method is optional", func(t *testing.T) {
_, err := NewFromConfig(Config{
Source: header + footer,
}, nil)
if err != nil {
t.Fatal(err)
}
})
t.Run("register required for params", func(t *testing.T) {
_, err := NewFromConfig(Config{
Source: header + footer,
Params: map[string]interface{}{
"threshold": 42,
},
}, nil)
if assert.Error(t, err) {
assert.Contains(t, err.Error(), "params were provided")
}
})
t.Run("register params", func(t *testing.T) {
const script = `
function register(params) {
if (params["threshold"] !== 42) {
throw "invalid threshold";
}
}
function process(event) {}
`
_, err := NewFromConfig(Config{
Source: script,
Params: map[string]interface{}{
"threshold": 42,
},
}, nil)
assert.NoError(t, err)
})
}
func TestSessionTestFunction(t *testing.T) {
const script = `
var fail = false;
function register(params) {
fail = params["fail"];
}
function process(event) {
if (fail) {
throw "intentional failure";
}
event.Put("hello", "world");
return event;
}
function test() {
var event = process(new Event({"hello": "earth"}));
if (event.fields.hello !== "world") {
throw "invalid hello world";
}
}
`
t.Run("test method is optional", func(t *testing.T) {
_, err := NewFromConfig(Config{
Source: header + footer,
}, nil)
if err != nil {
t.Fatal(err)
}
})
t.Run("test success", func(t *testing.T) {
_, err := NewFromConfig(Config{
Source: script,
Params: map[string]interface{}{
"fail": false,
},
}, nil)
assert.NoError(t, err)
})
t.Run("test failure", func(t *testing.T) {
_, err := NewFromConfig(Config{
Source: script,
Params: map[string]interface{}{
"fail": true,
},
}, nil)
assert.Error(t, err)
})
}
func TestSessionTimeout(t *testing.T) {
logp.TestingSetup()
const runawayLoop = `
while (!evt.fields.stop) {
evt.Put("hello", "world");
}
`
p, err := NewFromConfig(Config{
Source: header + runawayLoop + footer,
Timeout: 500 * time.Millisecond,
TagOnException: "_js_exception",
}, nil)
if err != nil {
t.Fatal(err)
}
evt := &beat.Event{
Fields: common.MapStr{
"stop": false,
},
}
// Execute and expect a timeout.
evt, err = p.Run(evt)
if assert.Error(t, err) {
assert.Contains(t, err.Error(), timeoutError)
tags, _ := evt.GetValue("tags")
assert.Equal(t, []string{"_js_exception"}, tags)
errorMessage, _ := evt.GetValue("error.message")
assert.Contains(t, errorMessage, timeoutError)
}
// Verify that any internal runtime interrupt state has been cleared.
evt.PutValue("stop", true)
_, err = p.Run(evt)
assert.NoError(t, err)
}
func TestSessionParallel(t *testing.T) {
const script = `
evt.Put("host.name", "workstation");
`
p, err := NewFromConfig(Config{
Source: header + script + footer,
TagOnException: "_js_exception",
}, nil)
if err != nil {
t.Fatal(err)
}
const goroutines = 10
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
var wg sync.WaitGroup
wg.Add(goroutines)
for i := 0; i < goroutines; i++ {
go func() {
defer wg.Done()
for ctx.Err() == nil {
evt := &beat.Event{
Fields: common.MapStr{
"host": common.MapStr{"name": "computer"},
},
}
_, err := p.Run(evt)
assert.NoError(t, err)
}
}()
}
time.AfterFunc(time.Second, cancel)
wg.Wait()
}
|
{
"pile_set_name": "Github"
}
|
# Lint as: python3
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Parser for video and label datasets."""
from typing import Dict, Optional, Tuple
from absl import logging
import tensorflow as tf
from official.vision.beta.configs import video_classification as exp_cfg
from official.vision.beta.dataloaders import decoder
from official.vision.beta.dataloaders import parser
from official.vision.beta.ops import preprocess_ops_3d
IMAGE_KEY = 'image/encoded'
LABEL_KEY = 'clip/label/index'
def _process_image(image: tf.Tensor,
is_training: bool = True,
num_frames: int = 32,
stride: int = 1,
num_test_clips: int = 1,
min_resize: int = 224,
crop_size: int = 200,
zero_centering_image: bool = False,
seed: Optional[int] = None) -> tf.Tensor:
"""Processes a serialized image tensor.
Args:
image: Input Tensor of shape [timesteps] and type tf.string of serialized
frames.
is_training: Whether or not in training mode. If True, random sample, crop
and left right flip is used.
num_frames: Number of frames per subclip.
stride: Temporal stride to sample frames.
num_test_clips: Number of test clips (1 by default). If more than 1, this
will sample multiple linearly spaced clips within each video at test time.
If 1, then a single clip in the middle of the video is sampled. The clips
are aggreagated in the batch dimension.
min_resize: Frames are resized so that min(height, width) is min_resize.
crop_size: Final size of the frame after cropping the resized frames. Both
height and width are the same.
zero_centering_image: If True, frames are normalized to values in [-1, 1].
If False, values in [0, 1].
seed: A deterministic seed to use when sampling.
Returns:
Processed frames. Tensor of shape
[num_frames * num_test_clips, crop_size, crop_size, 3].
"""
# Validate parameters.
if is_training and num_test_clips != 1:
logging.warning(
'`num_test_clips` %d is ignored since `is_training` is `True`.',
num_test_clips)
# Temporal sampler.
if is_training:
# Sample random clip.
image = preprocess_ops_3d.sample_sequence(image, num_frames, True, stride,
seed)
elif num_test_clips > 1:
# Sample linspace clips.
image = preprocess_ops_3d.sample_linspace_sequence(image, num_test_clips,
num_frames, stride)
else:
# Sample middle clip.
image = preprocess_ops_3d.sample_sequence(image, num_frames, False, stride)
# Decode JPEG string to tf.uint8.
image = preprocess_ops_3d.decode_jpeg(image, 3)
# Resize images (resize happens only if necessary to save compute).
image = preprocess_ops_3d.resize_smallest(image, min_resize)
if is_training:
# Standard image data augmentation: random crop and random flip.
image = preprocess_ops_3d.crop_image(image, crop_size, crop_size, True,
seed)
image = preprocess_ops_3d.random_flip_left_right(image, seed)
else:
# Central crop of the frames.
image = preprocess_ops_3d.crop_image(image, crop_size, crop_size, False)
# Cast the frames in float32, normalizing according to zero_centering_image.
return preprocess_ops_3d.normalize_image(image, zero_centering_image)
def _postprocess_image(image: tf.Tensor,
is_training: bool = True,
num_frames: int = 32,
num_test_clips: int = 1) -> tf.Tensor:
"""Processes a batched Tensor of frames.
The same parameters used in process should be used here.
Args:
image: Input Tensor of shape [batch, timesteps, height, width, 3].
is_training: Whether or not in training mode. If True, random sample, crop
and left right flip is used.
num_frames: Number of frames per subclip.
num_test_clips: Number of test clips (1 by default). If more than 1, this
will sample multiple linearly spaced clips within each video at test time.
If 1, then a single clip in the middle of the video is sampled. The clips
are aggreagated in the batch dimension.
Returns:
Processed frames. Tensor of shape
[batch * num_test_clips, num_frames, height, width, 3].
"""
if num_test_clips > 1 and not is_training:
# In this case, multiple clips are merged together in batch dimenstion which
# will be B * num_test_clips.
image = tf.reshape(
image, (-1, num_frames, image.shape[2], image.shape[3], image.shape[4]))
return image
def _process_label(label: tf.Tensor,
one_hot_label: bool = True,
num_classes: Optional[int] = None) -> tf.Tensor:
"""Processes label Tensor."""
# Validate parameters.
if one_hot_label and not num_classes:
raise ValueError(
'`num_classes` should be given when requesting one hot label.')
# Cast to tf.int32.
label = tf.cast(label, dtype=tf.int32)
if one_hot_label:
# Replace label index by one hot representation.
label = tf.one_hot(label, num_classes)
return label
class Decoder(decoder.Decoder):
"""A tf.Example decoder for classification task."""
def __init__(self, image_key: str = IMAGE_KEY, label_key: str = LABEL_KEY):
self._image_key = IMAGE_KEY
self._label_key = LABEL_KEY
self._context_description = {
# One integer stored in context.
self._label_key: tf.io.FixedLenFeature((), tf.int64),
}
self._sequence_description = {
# Each image is a string encoding JPEG.
self._image_key: tf.io.FixedLenSequenceFeature((), tf.string),
}
def decode(self, serialized_example):
"""Parses a single tf.Example into image and label tensors."""
context, sequences = tf.io.parse_single_sequence_example(
serialized_example, self._context_description,
self._sequence_description)
return {
self._image_key: sequences[self._image_key],
self._label_key: context[self._label_key]
}
class Parser(parser.Parser):
"""Parses a video and label dataset."""
def __init__(self,
input_params: exp_cfg.DataConfig,
image_key: str = IMAGE_KEY,
label_key: str = LABEL_KEY):
self._num_frames = input_params.feature_shape[0]
self._stride = input_params.temporal_stride
self._num_test_clips = input_params.num_test_clips
self._min_resize = input_params.min_image_size
self._crop_size = input_params.feature_shape[1]
self._one_hot_label = input_params.one_hot
self._num_classes = input_params.num_classes
self._image_key = image_key
self._label_key = label_key
def _parse_train_data(
self, decoded_tensors: Dict[str, tf.Tensor]
) -> Tuple[Dict[str, tf.Tensor], tf.Tensor]:
"""Parses data for training."""
# Process image and label.
image = decoded_tensors[self._image_key]
label = decoded_tensors[self._label_key]
image = _process_image(
image=image,
is_training=True,
num_frames=self._num_frames,
stride=self._stride,
num_test_clips=self._num_test_clips,
min_resize=self._min_resize,
crop_size=self._crop_size)
label = _process_label(label, self._one_hot_label, self._num_classes)
return {'image': image}, label
def _parse_eval_data(
self, decoded_tensors: Dict[str, tf.Tensor]
) -> Tuple[Dict[str, tf.Tensor], tf.Tensor]:
"""Parses data for evaluation."""
image = decoded_tensors[self._image_key]
label = decoded_tensors[self._label_key]
image = _process_image(
image=image,
is_training=False,
num_frames=self._num_frames,
stride=self._stride,
num_test_clips=self._num_test_clips,
min_resize=self._min_resize,
crop_size=self._crop_size)
label = _process_label(label, self._one_hot_label, self._num_classes)
return {'image': image}, label
class PostBatchProcessor(object):
"""Processes a video and label dataset which is batched."""
def __init__(self, input_params: exp_cfg.DataConfig):
self._is_training = input_params.is_training
self._num_frames = input_params.feature_shape[0]
self._num_test_clips = input_params.num_test_clips
def __call__(
self,
image: Dict[str, tf.Tensor],
label: tf.Tensor) -> Tuple[Dict[str, tf.Tensor], tf.Tensor]:
"""Parses a single tf.Example into image and label tensors."""
image = image['image']
image = _postprocess_image(
image=image,
is_training=self._is_training,
num_frames=self._num_frames,
num_test_clips=self._num_test_clips)
return {'image': image}, label
|
{
"pile_set_name": "Github"
}
|
// ResultsPagingUtility.cs
// Copyright Jamie Kurtz, Brian Wortman 2014.
using System;
using WebApi2Book.Common;
namespace WebApi2Book.Data
{
/// <summary>
/// Utility supporting paging of results.
/// </summary>
public static class ResultsPagingUtility
{
private const string ValueLessThanOneErrorMessage = "Value may not be less than 1.";
private const string ValueLessThanZeroErrorMessage = "Value may not be less than 0.";
public static int CalculatePageSize(int requestedValue, int maxValue)
{
if (requestedValue < 1)
throw new ArgumentOutOfRangeException("requestedValue", requestedValue, ValueLessThanOneErrorMessage);
if (maxValue < 1)
throw new ArgumentOutOfRangeException("maxValue", maxValue, ValueLessThanOneErrorMessage);
var boundedPageSize = Math.Min(requestedValue, maxValue);
return boundedPageSize;
}
public static int CalculateStartIndex(int pageNumber, int pageSize)
{
if (pageNumber < 1)
throw new ArgumentOutOfRangeException(Constants.CommonParameterNames.PageNumber, pageNumber,
ValueLessThanOneErrorMessage);
if (pageSize < 1)
throw new ArgumentOutOfRangeException(Constants.CommonParameterNames.PageSize, pageSize,
ValueLessThanOneErrorMessage);
var startIndex = (pageNumber - 1)*pageSize;
return startIndex;
}
public static int CalculatePageCount(int totalItemCount, int pageSize)
{
if (totalItemCount < 0)
throw new ArgumentOutOfRangeException("totalItemCount", totalItemCount, ValueLessThanZeroErrorMessage);
if (pageSize < 1)
throw new ArgumentOutOfRangeException(Constants.CommonParameterNames.PageSize, pageSize,
ValueLessThanOneErrorMessage);
var totalPageCount = (totalItemCount + pageSize - 1)/pageSize;
return totalPageCount;
}
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2013-2018 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
*
* 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.
*/
package com.alibaba.cloud.nacos.discovery;
import com.alibaba.cloud.nacos.ConditionalOnNacosDiscoveryEnabled;
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
import com.alibaba.cloud.nacos.NacosServiceManager;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.client.CommonsClientAutoConfiguration;
import org.springframework.cloud.client.ConditionalOnBlockingDiscoveryEnabled;
import org.springframework.cloud.client.ConditionalOnDiscoveryEnabled;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClientAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
/**
* @author xiaojing
* @author echooymxq
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnDiscoveryEnabled
@ConditionalOnBlockingDiscoveryEnabled
@ConditionalOnNacosDiscoveryEnabled
@AutoConfigureBefore({ SimpleDiscoveryClientAutoConfiguration.class,
CommonsClientAutoConfiguration.class })
@AutoConfigureAfter(NacosDiscoveryAutoConfiguration.class)
public class NacosDiscoveryClientConfiguration {
@Bean
public DiscoveryClient nacosDiscoveryClient(
NacosServiceDiscovery nacosServiceDiscovery) {
return new NacosDiscoveryClient(nacosServiceDiscovery);
}
@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty(value = "spring.cloud.nacos.discovery.watch.enabled",
matchIfMissing = true)
public NacosWatch nacosWatch(NacosServiceManager nacosServiceManager,
NacosDiscoveryProperties nacosDiscoveryProperties,
ObjectProvider<TaskScheduler> taskExecutorObjectProvider) {
return new NacosWatch(nacosServiceManager, nacosDiscoveryProperties,
taskExecutorObjectProvider);
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Add To DownTube</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIcons</key>
<dict/>
<key>CFBundleIcons~ipad</key>
<dict/>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.4.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
</dict>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
</dict>
</plist>
|
{
"pile_set_name": "Github"
}
|
package weavetest
import (
"reflect"
"testing"
"github.com/iov-one/weave"
"github.com/iov-one/weave/errors"
)
func TestHandlerWithError(t *testing.T) {
h := Handler{
CheckErr: errors.ErrUnauthorized,
DeliverErr: errors.ErrNotFound,
}
_, err := h.Check(nil, nil, nil)
if want := errors.ErrUnauthorized; !want.Is(err) {
t.Errorf("want %q, got %q", want, err)
}
_, err = h.Deliver(nil, nil, nil)
if want := errors.ErrNotFound; !want.Is(err) {
t.Errorf("want %q, got %q", want, err)
}
}
//nolint
func TestHandlerCallCount(t *testing.T) {
var h Handler
assertHCounts(t, &h, 0, 0)
h.Check(nil, nil, nil)
assertHCounts(t, &h, 1, 0)
h.Check(nil, nil, nil)
assertHCounts(t, &h, 2, 0)
h.Deliver(nil, nil, nil)
assertHCounts(t, &h, 2, 1)
h.Deliver(nil, nil, nil)
assertHCounts(t, &h, 2, 2)
// Failing counter must increment as well.
h.CheckErr = errors.ErrNotFound
h.DeliverErr = errors.ErrNotFound
h.Check(nil, nil, nil)
assertHCounts(t, &h, 3, 2)
h.Deliver(nil, nil, nil)
assertHCounts(t, &h, 3, 3)
}
func assertHCounts(t *testing.T, h *Handler, wantCheck, wantDeliver int) {
t.Helper()
if got := h.CheckCallCount(); got != wantCheck {
t.Errorf("want %d checks, got %d", wantCheck, got)
}
if got := h.DeliverCallCount(); got != wantDeliver {
t.Errorf("want %d delivers, got %d", wantDeliver, got)
}
wantTotal := wantCheck + wantDeliver
if got := h.CallCount(); got != wantTotal {
t.Errorf("want %d total, got %d", wantTotal, got)
}
}
func TestHandlerResult(t *testing.T) {
wantCres := weave.CheckResult{
Data: []byte("foo"),
GasAllocated: 5,
}
wantDres := weave.DeliverResult{
Data: []byte("bar"),
GasUsed: 824,
}
h := Handler{
CheckResult: wantCres,
DeliverResult: wantDres,
}
gotCres, _ := h.Check(nil, nil, nil)
if !reflect.DeepEqual(&wantCres, gotCres) {
t.Fatalf("got check result: %+v", gotCres)
}
gotDres, _ := h.Deliver(nil, nil, nil)
if !reflect.DeepEqual(&wantDres, gotDres) {
t.Fatalf("got deliver result: %+v", gotDres)
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* @file
* Sequential API External module
*
*/
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <[email protected]>
*
*/
/* This is the part of the API that is linked with
the application */
#include "lwip/opt.h"
#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
#include "lwip/api.h"
#include "lwip/tcpip.h"
#include "lwip/memp.h"
#include "lwip/ip.h"
#include "lwip/raw.h"
#include "lwip/udp.h"
#include "lwip/tcp.h"
#include <string.h>
/**
* Create a new netconn (of a specific type) that has a callback function.
* The corresponding pcb is also created.
*
* @param t the type of 'connection' to create (@see enum netconn_type)
* @param proto the IP protocol for RAW IP pcbs
* @param callback a function to call on status changes (RX available, TX'ed)
* @return a newly allocated struct netconn or
* NULL on memory error
*/
struct netconn*
netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto, netconn_callback callback)
{
struct netconn *conn;
struct api_msg msg;
conn = netconn_alloc(t, callback);
if (conn != NULL) {
msg.function = do_newconn;
msg.msg.msg.n.proto = proto;
msg.msg.conn = conn;
if (TCPIP_APIMSG(&msg) != ERR_OK) {
LWIP_ASSERT("freeing conn without freeing pcb", conn->pcb.tcp == NULL);
LWIP_ASSERT("conn has no op_completed", sys_sem_valid(&conn->op_completed));
LWIP_ASSERT("conn has no recvmbox", sys_mbox_valid(&conn->recvmbox));
#if LWIP_TCP
LWIP_ASSERT("conn->acceptmbox shouldn't exist", !sys_mbox_valid(&conn->acceptmbox));
#endif /* LWIP_TCP */
sys_sem_free(&conn->op_completed);
sys_mbox_free(&conn->recvmbox);
memp_free(MEMP_NETCONN, conn);
return NULL;
}
}
return conn;
}
/**
* Close a netconn 'connection' and free its resources.
* UDP and RAW connection are completely closed, TCP pcbs might still be in a waitstate
* after this returns.
*
* @param conn the netconn to delete
* @return ERR_OK if the connection was deleted
*/
err_t
netconn_delete(struct netconn *conn)
{
struct api_msg msg;
/* No ASSERT here because possible to get a (conn == NULL) if we got an accept error */
if (conn == NULL) {
return ERR_OK;
}
msg.function = do_delconn;
msg.msg.conn = conn;
tcpip_apimsg(&msg);
netconn_free(conn);
/* don't care for return value of do_delconn since it only calls void functions */
return ERR_OK;
}
/**
* Get the local or remote IP address and port of a netconn.
* For RAW netconns, this returns the protocol instead of a port!
*
* @param conn the netconn to query
* @param addr a pointer to which to save the IP address
* @param port a pointer to which to save the port (or protocol for RAW)
* @param local 1 to get the local IP address, 0 to get the remote one
* @return ERR_CONN for invalid connections
* ERR_OK if the information was retrieved
*/
err_t
netconn_getaddr(struct netconn *conn, ip_addr_t *addr, u16_t *port, u8_t local)
{
struct api_msg msg;
err_t err;
LWIP_ERROR("netconn_getaddr: invalid conn", (conn != NULL), return ERR_ARG;);
LWIP_ERROR("netconn_getaddr: invalid addr", (addr != NULL), return ERR_ARG;);
LWIP_ERROR("netconn_getaddr: invalid port", (port != NULL), return ERR_ARG;);
msg.function = do_getaddr;
msg.msg.conn = conn;
msg.msg.msg.ad.ipaddr = addr;
msg.msg.msg.ad.port = port;
msg.msg.msg.ad.local = local;
err = TCPIP_APIMSG(&msg);
NETCONN_SET_SAFE_ERR(conn, err);
return err;
}
/**
* Bind a netconn to a specific local IP address and port.
* Binding one netconn twice might not always be checked correctly!
*
* @param conn the netconn to bind
* @param addr the local IP address to bind the netconn to (use IP_ADDR_ANY
* to bind to all addresses)
* @param port the local port to bind the netconn to (not used for RAW)
* @return ERR_OK if bound, any other err_t on failure
*/
err_t
netconn_bind(struct netconn *conn, ip_addr_t *addr, u16_t port)
{
struct api_msg msg;
err_t err;
LWIP_ERROR("netconn_bind: invalid conn", (conn != NULL), return ERR_ARG;);
msg.function = do_bind;
msg.msg.conn = conn;
msg.msg.msg.bc.ipaddr = addr;
msg.msg.msg.bc.port = port;
err = TCPIP_APIMSG(&msg);
NETCONN_SET_SAFE_ERR(conn, err);
return err;
}
/**
* Connect a netconn to a specific remote IP address and port.
*
* @param conn the netconn to connect
* @param addr the remote IP address to connect to
* @param port the remote port to connect to (no used for RAW)
* @return ERR_OK if connected, return value of tcp_/udp_/raw_connect otherwise
*/
err_t
netconn_connect(struct netconn *conn, ip_addr_t *addr, u16_t port)
{
struct api_msg msg;
err_t err;
LWIP_ERROR("netconn_connect: invalid conn", (conn != NULL), return ERR_ARG;);
msg.function = do_connect;
msg.msg.conn = conn;
msg.msg.msg.bc.ipaddr = addr;
msg.msg.msg.bc.port = port;
/* This is the only function which need to not block tcpip_thread */
err = tcpip_apimsg(&msg);
NETCONN_SET_SAFE_ERR(conn, err);
return err;
}
/**
* Disconnect a netconn from its current peer (only valid for UDP netconns).
*
* @param conn the netconn to disconnect
* @return TODO: return value is not set here...
*/
err_t
netconn_disconnect(struct netconn *conn)
{
struct api_msg msg;
err_t err;
LWIP_ERROR("netconn_disconnect: invalid conn", (conn != NULL), return ERR_ARG;);
msg.function = do_disconnect;
msg.msg.conn = conn;
err = TCPIP_APIMSG(&msg);
NETCONN_SET_SAFE_ERR(conn, err);
return err;
}
/**
* Set a TCP netconn into listen mode
*
* @param conn the tcp netconn to set to listen mode
* @param backlog the listen backlog, only used if TCP_LISTEN_BACKLOG==1
* @return ERR_OK if the netconn was set to listen (UDP and RAW netconns
* don't return any error (yet?))
*/
err_t
netconn_listen_with_backlog(struct netconn *conn, u8_t backlog)
{
#if LWIP_TCP
struct api_msg msg;
err_t err;
/* This does no harm. If TCP_LISTEN_BACKLOG is off, backlog is unused. */
LWIP_UNUSED_ARG(backlog);
LWIP_ERROR("netconn_listen: invalid conn", (conn != NULL), return ERR_ARG;);
msg.function = do_listen;
msg.msg.conn = conn;
#if TCP_LISTEN_BACKLOG
msg.msg.msg.lb.backlog = backlog;
#endif /* TCP_LISTEN_BACKLOG */
err = TCPIP_APIMSG(&msg);
NETCONN_SET_SAFE_ERR(conn, err);
return err;
#else /* LWIP_TCP */
LWIP_UNUSED_ARG(conn);
LWIP_UNUSED_ARG(backlog);
return ERR_ARG;
#endif /* LWIP_TCP */
}
/**
* Accept a new connection on a TCP listening netconn.
*
* @param conn the TCP listen netconn
* @param new_conn pointer where the new connection is stored
* @return ERR_OK if a new connection has been received or an error
* code otherwise
*/
err_t
netconn_accept(struct netconn *conn, struct netconn **new_conn)
{
#if LWIP_TCP
struct netconn *newconn;
err_t err;
#if TCP_LISTEN_BACKLOG
struct api_msg msg;
#endif /* TCP_LISTEN_BACKLOG */
LWIP_ERROR("netconn_accept: invalid pointer", (new_conn != NULL), return ERR_ARG;);
*new_conn = NULL;
LWIP_ERROR("netconn_accept: invalid conn", (conn != NULL), return ERR_ARG;);
LWIP_ERROR("netconn_accept: invalid acceptmbox", sys_mbox_valid(&conn->acceptmbox), return ERR_ARG;);
err = conn->last_err;
if (ERR_IS_FATAL(err)) {
/* don't recv on fatal errors: this might block the application task
waiting on acceptmbox forever! */
return err;
}
#if LWIP_SO_RCVTIMEO
if (sys_arch_mbox_fetch(&conn->acceptmbox, (void **)&newconn, conn->recv_timeout) == SYS_ARCH_TIMEOUT) {
NETCONN_SET_SAFE_ERR(conn, ERR_TIMEOUT);
return ERR_TIMEOUT;
}
#else
sys_arch_mbox_fetch(&conn->acceptmbox, (void **)&newconn, 0);
#endif /* LWIP_SO_RCVTIMEO*/
/* Register event with callback */
API_EVENT(conn, NETCONN_EVT_RCVMINUS, 0);
if (newconn == NULL) {
/* connection has been closed */
NETCONN_SET_SAFE_ERR(conn, ERR_CLSD);
return ERR_CLSD;
}
#if TCP_LISTEN_BACKLOG
/* Let the stack know that we have accepted the connection. */
msg.function = do_recv;
msg.msg.conn = conn;
/* don't care for the return value of do_recv */
TCPIP_APIMSG(&msg);
#endif /* TCP_LISTEN_BACKLOG */
*new_conn = newconn;
/* don't set conn->last_err: it's only ERR_OK, anyway */
return ERR_OK;
#else /* LWIP_TCP */
LWIP_UNUSED_ARG(conn);
LWIP_UNUSED_ARG(new_conn);
return ERR_ARG;
#endif /* LWIP_TCP */
}
/**
* Receive data: actual implementation that doesn't care whether pbuf or netbuf
* is received
*
* @param conn the netconn from which to receive data
* @param new_buf pointer where a new pbuf/netbuf is stored when received data
* @return ERR_OK if data has been received, an error code otherwise (timeout,
* memory error or another error)
*/
static err_t
netconn_recv_data(struct netconn *conn, void **new_buf)
{
void *buf = NULL;
u16_t len;
err_t err;
#if LWIP_TCP
struct api_msg msg;
#endif /* LWIP_TCP */
LWIP_ERROR("netconn_recv: invalid pointer", (new_buf != NULL), return ERR_ARG;);
*new_buf = NULL;
LWIP_ERROR("netconn_recv: invalid conn", (conn != NULL), return ERR_ARG;);
LWIP_ERROR("netconn_accept: invalid recvmbox", sys_mbox_valid(&conn->recvmbox), return ERR_CONN;);
err = conn->last_err;
if (ERR_IS_FATAL(err)) {
/* don't recv on fatal errors: this might block the application task
waiting on recvmbox forever! */
/* @todo: this does not allow us to fetch data that has been put into recvmbox
before the fatal error occurred - is that a problem? */
return err;
}
#if LWIP_SO_RCVTIMEO
if (sys_arch_mbox_fetch(&conn->recvmbox, &buf, conn->recv_timeout) == SYS_ARCH_TIMEOUT) {
NETCONN_SET_SAFE_ERR(conn, ERR_TIMEOUT);
return ERR_TIMEOUT;
}
#else
sys_arch_mbox_fetch(&conn->recvmbox, &buf, 0);
#endif /* LWIP_SO_RCVTIMEO*/
#if LWIP_TCP
if (conn->type == NETCONN_TCP) {
if (!netconn_get_noautorecved(conn) || (buf == NULL)) {
/* Let the stack know that we have taken the data. */
/* TODO: Speedup: Don't block and wait for the answer here
(to prevent multiple thread-switches). */
msg.function = do_recv;
msg.msg.conn = conn;
if (buf != NULL) {
msg.msg.msg.r.len = ((struct pbuf *)buf)->tot_len;
} else {
msg.msg.msg.r.len = 1;
}
/* don't care for the return value of do_recv */
TCPIP_APIMSG(&msg);
}
/* If we are closed, we indicate that we no longer wish to use the socket */
if (buf == NULL) {
API_EVENT(conn, NETCONN_EVT_RCVMINUS, 0);
/* Avoid to lose any previous error code */
NETCONN_SET_SAFE_ERR(conn, ERR_CLSD);
return ERR_CLSD;
}
len = ((struct pbuf *)buf)->tot_len;
}
#endif /* LWIP_TCP */
#if LWIP_TCP && (LWIP_UDP || LWIP_RAW)
else
#endif /* LWIP_TCP && (LWIP_UDP || LWIP_RAW) */
#if (LWIP_UDP || LWIP_RAW)
{
LWIP_ASSERT("buf != NULL", buf != NULL);
len = netbuf_len((struct netbuf *)buf);
}
#endif /* (LWIP_UDP || LWIP_RAW) */
#if LWIP_SO_RCVBUF
SYS_ARCH_DEC(conn->recv_avail, len);
#endif /* LWIP_SO_RCVBUF */
/* Register event with callback */
API_EVENT(conn, NETCONN_EVT_RCVMINUS, len);
LWIP_DEBUGF(API_LIB_DEBUG, ("netconn_recv_data: received %p, len=%"U16_F"\n", buf, len));
*new_buf = buf;
/* don't set conn->last_err: it's only ERR_OK, anyway */
return ERR_OK;
}
/**
* Receive data (in form of a pbuf) from a TCP netconn
*
* @param conn the netconn from which to receive data
* @param new_buf pointer where a new pbuf is stored when received data
* @return ERR_OK if data has been received, an error code otherwise (timeout,
* memory error or another error)
* ERR_ARG if conn is not a TCP netconn
*/
err_t
netconn_recv_tcp_pbuf(struct netconn *conn, struct pbuf **new_buf)
{
LWIP_ERROR("netconn_recv: invalid conn", (conn != NULL) &&
netconn_type(conn) == NETCONN_TCP, return ERR_ARG;);
return netconn_recv_data(conn, (void **)new_buf);
}
/**
* Receive data (in form of a netbuf containing a packet buffer) from a netconn
*
* @param conn the netconn from which to receive data
* @param new_buf pointer where a new netbuf is stored when received data
* @return ERR_OK if data has been received, an error code otherwise (timeout,
* memory error or another error)
*/
err_t
netconn_recv(struct netconn *conn, struct netbuf **new_buf)
{
#if LWIP_TCP
struct netbuf *buf = NULL;
err_t err;
#endif /* LWIP_TCP */
LWIP_ERROR("netconn_recv: invalid pointer", (new_buf != NULL), return ERR_ARG;);
*new_buf = NULL;
LWIP_ERROR("netconn_recv: invalid conn", (conn != NULL), return ERR_ARG;);
LWIP_ERROR("netconn_accept: invalid recvmbox", sys_mbox_valid(&conn->recvmbox), return ERR_CONN;);
#if LWIP_TCP
if (conn->type == NETCONN_TCP) {
struct pbuf *p = NULL;
/* This is not a listening netconn, since recvmbox is set */
buf = (struct netbuf *)memp_malloc(MEMP_NETBUF);
if (buf == NULL) {
NETCONN_SET_SAFE_ERR(conn, ERR_MEM);
return ERR_MEM;
}
err = netconn_recv_data(conn, (void **)&p);
if (err != ERR_OK) {
memp_free(MEMP_NETBUF, buf);
return err;
}
LWIP_ASSERT("p != NULL", p != NULL);
buf->p = p;
buf->ptr = p;
buf->port = 0;
ip_addr_set_any(&buf->addr);
*new_buf = buf;
/* don't set conn->last_err: it's only ERR_OK, anyway */
return ERR_OK;
} else
#endif /* LWIP_TCP */
{
#if (LWIP_UDP || LWIP_RAW)
return netconn_recv_data(conn, (void **)new_buf);
#endif /* (LWIP_UDP || LWIP_RAW) */
}
}
/**
* TCP: update the receive window: by calling this, the application
* tells the stack that it has processed data and is able to accept
* new data.
* ATTENTION: use with care, this is mainly used for sockets!
* Can only be used when calling netconn_set_noautorecved(conn, 1) before.
*
* @param conn the netconn for which to update the receive window
* @param length amount of data processed (ATTENTION: this must be accurate!)
*/
void
netconn_recved(struct netconn *conn, u32_t length)
{
#if LWIP_TCP
if ((conn != NULL) && (conn->type == NETCONN_TCP) &&
(netconn_get_noautorecved(conn))) {
struct api_msg msg;
/* Let the stack know that we have taken the data. */
/* TODO: Speedup: Don't block and wait for the answer here
(to prevent multiple thread-switches). */
msg.function = do_recv;
msg.msg.conn = conn;
msg.msg.msg.r.len = length;
/* don't care for the return value of do_recv */
TCPIP_APIMSG(&msg);
}
#else /* LWIP_TCP */
LWIP_UNUSED_ARG(conn);
LWIP_UNUSED_ARG(length);
#endif /* LWIP_TCP */
}
/**
* Send data (in form of a netbuf) to a specific remote IP address and port.
* Only to be used for UDP and RAW netconns (not TCP).
*
* @param conn the netconn over which to send data
* @param buf a netbuf containing the data to send
* @param addr the remote IP address to which to send the data
* @param port the remote port to which to send the data
* @return ERR_OK if data was sent, any other err_t on error
*/
err_t
netconn_sendto(struct netconn *conn, struct netbuf *buf, ip_addr_t *addr, u16_t port)
{
if (buf != NULL) {
ip_addr_set(&buf->addr, addr);
buf->port = port;
return netconn_send(conn, buf);
}
return ERR_VAL;
}
/**
* Send data over a UDP or RAW netconn (that is already connected).
*
* @param conn the UDP or RAW netconn over which to send data
* @param buf a netbuf containing the data to send
* @return ERR_OK if data was sent, any other err_t on error
*/
err_t
netconn_send(struct netconn *conn, struct netbuf *buf)
{
struct api_msg msg;
err_t err;
LWIP_ERROR("netconn_send: invalid conn", (conn != NULL), return ERR_ARG;);
LWIP_DEBUGF(API_LIB_DEBUG, ("netconn_send: sending %"U16_F" bytes\n", buf->p->tot_len));
msg.function = do_send;
msg.msg.conn = conn;
msg.msg.msg.b = buf;
err = TCPIP_APIMSG(&msg);
NETCONN_SET_SAFE_ERR(conn, err);
return err;
}
/**
* Send data over a TCP netconn.
*
* @param conn the TCP netconn over which to send data
* @param dataptr pointer to the application buffer that contains the data to send
* @param size size of the application data to send
* @param apiflags combination of following flags :
* - NETCONN_COPY: data will be copied into memory belonging to the stack
* - NETCONN_MORE: for TCP connection, PSH flag will be set on last segment sent
* - NETCONN_DONTBLOCK: only write the data if all dat can be written at once
* @return ERR_OK if data was sent, any other err_t on error
*/
err_t
netconn_write(struct netconn *conn, const void *dataptr, size_t size, u8_t apiflags)
{
struct api_msg msg;
err_t err;
LWIP_ERROR("netconn_write: invalid conn", (conn != NULL), return ERR_ARG;);
LWIP_ERROR("netconn_write: invalid conn->type", (conn->type == NETCONN_TCP), return ERR_VAL;);
if (size == 0) {
return ERR_OK;
}
/* @todo: for non-blocking write, check if 'size' would ever fit into
snd_queue or snd_buf */
msg.function = do_write;
msg.msg.conn = conn;
msg.msg.msg.w.dataptr = dataptr;
msg.msg.msg.w.apiflags = apiflags;
msg.msg.msg.w.len = size;
/* For locking the core: this _can_ be delayed on low memory/low send buffer,
but if it is, this is done inside api_msg.c:do_write(), so we can use the
non-blocking version here. */
err = TCPIP_APIMSG(&msg);
NETCONN_SET_SAFE_ERR(conn, err);
return err;
}
/**
* Close ot shutdown a TCP netconn (doesn't delete it).
*
* @param conn the TCP netconn to close or shutdown
* @param how fully close or only shutdown one side?
* @return ERR_OK if the netconn was closed, any other err_t on error
*/
static err_t
netconn_close_shutdown(struct netconn *conn, u8_t how)
{
struct api_msg msg;
err_t err;
LWIP_ERROR("netconn_close: invalid conn", (conn != NULL), return ERR_ARG;);
msg.function = do_close;
msg.msg.conn = conn;
/* shutting down both ends is the same as closing */
msg.msg.msg.sd.shut = how;
/* because of the LWIP_TCPIP_CORE_LOCKING implementation of do_close,
don't use TCPIP_APIMSG here */
err = tcpip_apimsg(&msg);
NETCONN_SET_SAFE_ERR(conn, err);
return err;
}
/**
* Close a TCP netconn (doesn't delete it).
*
* @param conn the TCP netconn to close
* @return ERR_OK if the netconn was closed, any other err_t on error
*/
err_t
netconn_close(struct netconn *conn)
{
/* shutting down both ends is the same as closing */
return netconn_close_shutdown(conn, NETCONN_SHUT_RDWR);
}
/**
* Shut down one or both sides of a TCP netconn (doesn't delete it).
*
* @param conn the TCP netconn to shut down
* @return ERR_OK if the netconn was closed, any other err_t on error
*/
err_t
netconn_shutdown(struct netconn *conn, u8_t shut_rx, u8_t shut_tx)
{
return netconn_close_shutdown(conn, (shut_rx ? NETCONN_SHUT_RD : 0) | (shut_tx ? NETCONN_SHUT_WR : 0));
}
#if LWIP_IGMP
/**
* Join multicast groups for UDP netconns.
*
* @param conn the UDP netconn for which to change multicast addresses
* @param multiaddr IP address of the multicast group to join or leave
* @param netif_addr the IP address of the network interface on which to send
* the igmp message
* @param join_or_leave flag whether to send a join- or leave-message
* @return ERR_OK if the action was taken, any err_t on error
*/
err_t
netconn_join_leave_group(struct netconn *conn,
ip_addr_t *multiaddr,
ip_addr_t *netif_addr,
enum netconn_igmp join_or_leave)
{
struct api_msg msg;
err_t err;
LWIP_ERROR("netconn_join_leave_group: invalid conn", (conn != NULL), return ERR_ARG;);
msg.function = do_join_leave_group;
msg.msg.conn = conn;
msg.msg.msg.jl.multiaddr = multiaddr;
msg.msg.msg.jl.netif_addr = netif_addr;
msg.msg.msg.jl.join_or_leave = join_or_leave;
err = TCPIP_APIMSG(&msg);
NETCONN_SET_SAFE_ERR(conn, err);
return err;
}
#endif /* LWIP_IGMP */
#if LWIP_DNS
/**
* Execute a DNS query, only one IP address is returned
*
* @param name a string representation of the DNS host name to query
* @param addr a preallocated ip_addr_t where to store the resolved IP address
* @return ERR_OK: resolving succeeded
* ERR_MEM: memory error, try again later
* ERR_ARG: dns client not initialized or invalid hostname
* ERR_VAL: dns server response was invalid
*/
err_t
netconn_gethostbyname(const char *name, ip_addr_t *addr)
{
struct dns_api_msg msg;
err_t err;
sys_sem_t sem;
LWIP_ERROR("netconn_gethostbyname: invalid name", (name != NULL), return ERR_ARG;);
LWIP_ERROR("netconn_gethostbyname: invalid addr", (addr != NULL), return ERR_ARG;);
err = sys_sem_new(&sem, 0);
if (err != ERR_OK) {
return err;
}
msg.name = name;
msg.addr = addr;
msg.err = &err;
msg.sem = &sem;
tcpip_callback(do_gethostbyname, &msg);
sys_sem_wait(&sem);
sys_sem_free(&sem);
return err;
}
#endif /* LWIP_DNS*/
#endif /* LWIP_NETCONN */
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:collection';
import 'package:analyzer/dart/analysis/context_locator.dart';
import 'package:analyzer/dart/analysis/context_root.dart';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/file_system/physical_file_system.dart'
show PhysicalResourceProvider;
import 'package:analyzer/src/dart/analysis/context_root.dart';
import 'package:analyzer/src/task/options.dart';
import 'package:analyzer/src/util/yaml.dart';
import 'package:glob/glob.dart';
import 'package:meta/meta.dart';
import 'package:path/path.dart';
import 'package:yaml/yaml.dart';
/// An implementation of a context locator.
class ContextLocatorImpl implements ContextLocator {
/// The name of the analysis options file.
static const String ANALYSIS_OPTIONS_NAME = 'analysis_options.yaml';
/// The name of the `.dart_tool` directory.
static const String DOT_DART_TOOL_NAME = '.dart_tool';
/// The name of the packages file.
static const String PACKAGE_CONFIG_JSON_NAME = 'package_config.json';
/// The name of the packages file.
static const String DOT_PACKAGES_NAME = '.packages';
/// The resource provider used to access the file system.
final ResourceProvider resourceProvider;
/// Initialize a newly created context locator. If a [resourceProvider] is
/// supplied, it will be used to access the file system. Otherwise the default
/// resource provider will be used.
ContextLocatorImpl({ResourceProvider resourceProvider})
: resourceProvider =
resourceProvider ?? PhysicalResourceProvider.INSTANCE;
@override
List<ContextRoot> locateRoots(
{@required List<String> includedPaths,
List<String> excludedPaths,
String optionsFile,
String packagesFile}) {
//
// Compute the list of folders and files that are to be included.
//
List<Folder> includedFolders = <Folder>[];
List<File> includedFiles = <File>[];
_resourcesFromPaths(
includedPaths ?? const <String>[], includedFolders, includedFiles);
//
// Compute the list of folders and files that are to be excluded.
//
List<Folder> excludedFolders = <Folder>[];
List<File> excludedFiles = <File>[];
_resourcesFromPaths(
excludedPaths ?? const <String>[], excludedFolders, excludedFiles);
//
// Use the excluded folders and files to filter the included folders and
// files.
//
includedFolders = includedFolders
.where((Folder includedFolder) =>
!_containedInAny(excludedFolders, includedFolder) &&
!_containedInAny(includedFolders, includedFolder))
.toList();
includedFiles = includedFiles
.where((File includedFile) =>
!_containedInAny(excludedFolders, includedFile) &&
!excludedFiles.contains(includedFile) &&
!_containedInAny(includedFolders, includedFile))
.toList();
//
// We now have a list of all of the files and folders that need to be
// analyzed. For each, walk the directory structure and figure out where to
// create context roots.
//
File defaultOptionsFile;
if (optionsFile != null) {
defaultOptionsFile = resourceProvider.getFile(optionsFile);
if (!defaultOptionsFile.exists) {
defaultOptionsFile = null;
}
}
File defaultPackagesFile;
if (packagesFile != null) {
defaultPackagesFile = resourceProvider.getFile(packagesFile);
if (!defaultPackagesFile.exists) {
defaultPackagesFile = null;
}
}
List<ContextRoot> roots = <ContextRoot>[];
for (Folder folder in includedFolders) {
ContextRootImpl root = ContextRootImpl(resourceProvider, folder);
root.packagesFile = defaultPackagesFile ?? _findPackagesFile(folder);
root.optionsFile = defaultOptionsFile ?? _findOptionsFile(folder);
root.included.add(folder);
roots.add(root);
_createContextRootsIn(roots, folder, excludedFolders, root,
_getExcludedFiles(root), defaultOptionsFile, defaultPackagesFile);
}
Map<Folder, ContextRoot> rootMap = <Folder, ContextRoot>{};
for (File file in includedFiles) {
Folder parent = file.parent;
ContextRoot root = rootMap.putIfAbsent(parent, () {
ContextRootImpl root = ContextRootImpl(resourceProvider, parent);
root.packagesFile = defaultPackagesFile ?? _findPackagesFile(parent);
root.optionsFile = defaultOptionsFile ?? _findOptionsFile(parent);
roots.add(root);
return root;
});
root.included.add(file);
}
return roots;
}
/// Return `true` if the given [resource] is contained in one or more of the
/// given [folders].
bool _containedInAny(Iterable<Folder> folders, Resource resource) =>
folders.any((Folder folder) => folder.contains(resource.path));
/// If the given [folder] should be the root of a new analysis context, then
/// create a new context root for it and add it to the list of context
/// [roots]. The [containingRoot] is the context root from an enclosing
/// directory and is used to inherit configuration information that isn't
/// overridden.
///
/// If either the [optionsFile] or [packagesFile] is non-`null` then the given
/// file will be used even if there is a local version of the file.
///
/// For each directory within the given [folder] that is neither in the list
/// of [excludedFolders] nor excluded by the [excludedFilePatterns],
/// recursively search for nested context roots.
void _createContextRoots(
List<ContextRoot> roots,
Folder folder,
List<Folder> excludedFolders,
ContextRoot containingRoot,
List<Glob> excludedFilePatterns,
File optionsFile,
File packagesFile) {
//
// If the options and packages files are allowed to be locally specified,
// then look to see whether they are.
//
File localOptionsFile;
if (optionsFile == null) {
localOptionsFile = _getOptionsFile(folder);
}
File localPackagesFile;
if (packagesFile == null) {
localPackagesFile = _getPackagesFile(folder);
}
//
// Create a context root for the given [folder] if at least one of the
// options and packages file is locally specified.
//
if (localPackagesFile != null || localOptionsFile != null) {
if (optionsFile != null) {
localOptionsFile = optionsFile;
}
if (packagesFile != null) {
localPackagesFile = packagesFile;
}
ContextRootImpl root = ContextRootImpl(resourceProvider, folder);
root.packagesFile = localPackagesFile ?? containingRoot.packagesFile;
root.optionsFile = localOptionsFile ?? containingRoot.optionsFile;
root.included.add(folder);
containingRoot.excluded.add(folder);
roots.add(root);
containingRoot = root;
excludedFilePatterns = _getExcludedFiles(root);
}
_createContextRootsIn(roots, folder, excludedFolders, containingRoot,
excludedFilePatterns, optionsFile, packagesFile);
}
/// For each directory within the given [folder] that is neither in the list
/// of [excludedFolders] nor excluded by the [excludedFilePatterns],
/// recursively search for nested context roots and add them to the list of
/// [roots].
///
/// If either the [optionsFile] or [packagesFile] is non-`null` then the given
/// file will be used even if there is a local version of the file.
void _createContextRootsIn(
List<ContextRoot> roots,
Folder folder,
List<Folder> excludedFolders,
ContextRoot containingRoot,
List<Glob> excludedFilePatterns,
File optionsFile,
File packagesFile) {
bool isExcluded(Folder folder) {
if (excludedFolders.contains(folder) ||
folder.shortName.startsWith('.')) {
return true;
}
for (Glob pattern in excludedFilePatterns) {
if (pattern.matches(folder.path)) {
return true;
}
}
return false;
}
//
// Check each of the subdirectories to see whether a context root needs to
// be added for it.
//
try {
for (Resource child in folder.getChildren()) {
if (child is Folder) {
if (isExcluded(child)) {
containingRoot.excluded.add(child);
} else {
_createContextRoots(roots, child, excludedFolders, containingRoot,
excludedFilePatterns, optionsFile, packagesFile);
}
}
}
} on FileSystemException {
// The directory either doesn't exist or cannot be read. Either way, there
// are no subdirectories that need to be added.
}
}
/// Return the analysis options file to be used to analyze files in the given
/// [folder], or `null` if there is no analysis options file in the given
/// folder or any parent folder.
File _findOptionsFile(Folder folder) {
while (folder != null) {
File packagesFile = _getOptionsFile(folder);
if (packagesFile != null) {
return packagesFile;
}
folder = folder.parent;
}
return null;
}
/// Return the packages file to be used to analyze files in the given
/// [folder], or `null` if there is no packages file in the given folder or
/// any parent folder.
File _findPackagesFile(Folder folder) {
while (folder != null) {
File packagesFile = _getPackagesFile(folder);
if (packagesFile != null) {
return packagesFile;
}
folder = folder.parent;
}
return null;
}
/// Return a list containing the glob patterns used to exclude files from the
/// given context [root]. The patterns are extracted from the analysis options
/// file associated with the context root. The list will be empty if there are
/// no exclusion patterns in the options file, or if there is no options file
/// associated with the context root.
List<Glob> _getExcludedFiles(ContextRootImpl root) {
List<Glob> patterns = [];
File optionsFile = root.optionsFile;
if (optionsFile != null) {
try {
String content = optionsFile.readAsStringSync();
YamlNode doc = loadYamlNode(content);
if (doc is YamlMap) {
YamlNode analyzerOptions = getValue(doc, AnalyzerOptions.analyzer);
if (analyzerOptions is YamlMap) {
YamlNode excludeOptions =
getValue(analyzerOptions, AnalyzerOptions.exclude);
if (excludeOptions is YamlList) {
List<String> excludeList = toStringList(excludeOptions);
if (excludeList != null) {
for (String excludedPath in excludeList) {
Context context = resourceProvider.pathContext;
if (context.isRelative(excludedPath)) {
excludedPath =
context.join(optionsFile.parent.path, excludedPath);
}
patterns.add(Glob(excludedPath, context: context));
}
}
}
}
}
} catch (exception) {
// If we can't read and parse the analysis options file, then there
// aren't any excluded files that need to be read.
}
}
return patterns;
}
/// If the given [directory] contains a file with the given [name], then
/// return the file. Otherwise, return `null`.
File _getFile(Folder directory, String name) {
Resource resource = directory.getChild(name);
if (resource is File && resource.exists) {
return resource;
}
return null;
}
/// Return the analysis options file in the given [folder], or `null` if the
/// folder does not contain an analysis options file.
File _getOptionsFile(Folder folder) =>
_getFile(folder, ANALYSIS_OPTIONS_NAME);
/// Return the packages file in the given [folder], or `null` if the folder
/// does not contain a packages file.
File _getPackagesFile(Folder folder) {
var file = folder
.getChildAssumingFolder(DOT_DART_TOOL_NAME)
.getChildAssumingFile(PACKAGE_CONFIG_JSON_NAME);
if (file.exists) {
return file;
}
return _getFile(folder, DOT_PACKAGES_NAME);
}
/// Add to the given lists of [folders] and [files] all of the resources in
/// the given list of [paths] that exist and are not contained within one of
/// the folders.
void _resourcesFromPaths(
List<String> paths, List<Folder> folders, List<File> files) {
for (String path in _uniqueSortedPaths(paths)) {
Resource resource = resourceProvider.getResource(path);
if (resource.exists && !_containedInAny(folders, resource)) {
if (resource is Folder) {
folders.add(resource);
} else if (resource is File) {
files.add(resource);
} else {
// Internal error: unhandled kind of resource.
}
}
}
}
/// Return a list of paths that contains all of the unique elements from the
/// given list of [paths], sorted such that shorter paths are first.
List<String> _uniqueSortedPaths(List<String> paths) {
Set<String> uniquePaths = HashSet<String>.from(paths);
List<String> sortedPaths = uniquePaths.toList();
sortedPaths.sort((a, b) => a.length - b.length);
return sortedPaths;
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.verification.checkers;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import java.util.ArrayList;
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.ArgumentMatcher;
import org.mockito.Mock;
import org.mockito.exceptions.verification.WantedButNotInvoked;
import org.mockito.exceptions.verification.opentest4j.ArgumentsAreDifferent;
import org.mockito.internal.invocation.*;
import org.mockito.internal.invocation.mockref.MockReference;
import org.mockito.invocation.Invocation;
import org.mockito.invocation.Location;
import org.mockitousage.IMethods;
import org.mockitoutil.TestBase;
public class MissingInvocationCheckerTest extends TestBase {
private InvocationMatcher wanted;
private List<Invocation> invocations;
@Mock private IMethods mock;
@Rule public ExpectedException exception = ExpectedException.none();
@Test
public void shouldPassBecauseActualInvocationFound() {
wanted = buildSimpleMethod().toInvocationMatcher();
invocations = asList(buildSimpleMethod().toInvocation());
MissingInvocationChecker.checkMissingInvocation(invocations, wanted);
}
@Test
public void shouldReportWantedButNotInvoked() {
wanted = buildSimpleMethod().toInvocationMatcher();
invocations = asList(buildDifferentMethod().toInvocation());
exception.expect(WantedButNotInvoked.class);
exception.expectMessage("Wanted but not invoked:");
exception.expectMessage("mock.simpleMethod()");
exception.expectMessage("However, there was exactly 1 interaction with this mock:");
exception.expectMessage("mock.differentMethod();");
MissingInvocationChecker.checkMissingInvocation(invocations, wanted);
}
@Test
public void shouldReportWantedInvocationDiffersFromActual() {
wanted = buildIntArgMethod(new InvocationBuilder()).arg(2222).toInvocationMatcher();
invocations = asList(buildIntArgMethod(new InvocationBuilder()).arg(1111).toInvocation());
exception.expect(ArgumentsAreDifferent.class);
exception.expectMessage("Argument(s) are different! Wanted:");
exception.expectMessage("mock.intArgumentMethod(2222);");
exception.expectMessage("Actual invocations have different arguments:");
exception.expectMessage("mock.intArgumentMethod(1111);");
MissingInvocationChecker.checkMissingInvocation(invocations, wanted);
}
@Test
public void shouldReportUsingInvocationDescription() {
wanted = buildIntArgMethod(new CustomInvocationBuilder()).arg(2222).toInvocationMatcher();
invocations =
singletonList(
buildIntArgMethod(new CustomInvocationBuilder()).arg(1111).toInvocation());
exception.expect(ArgumentsAreDifferent.class);
exception.expectMessage("Argument(s) are different! Wanted:");
exception.expectMessage("mock.intArgumentMethod(MyCoolPrint(2222));");
exception.expectMessage("Actual invocations have different arguments:");
exception.expectMessage("mock.intArgumentMethod(MyCoolPrint(1111));");
MissingInvocationChecker.checkMissingInvocation(invocations, wanted);
}
private InvocationBuilder buildIntArgMethod(InvocationBuilder invocationBuilder) {
return invocationBuilder.mock(mock).method("intArgumentMethod").argTypes(int.class);
}
private InvocationBuilder buildSimpleMethod() {
return new InvocationBuilder().mock(mock).simpleMethod();
}
private InvocationBuilder buildDifferentMethod() {
return new InvocationBuilder().mock(mock).differentMethod();
}
static class CustomInvocationBuilder extends InvocationBuilder {
@Override
protected Invocation createInvocation(
MockReference<Object> mockRef,
MockitoMethod mockitoMethod,
final Object[] arguments,
RealMethod realMethod,
Location location,
int sequenceNumber) {
return new InterceptedInvocation(
mockRef, mockitoMethod, arguments, realMethod, location, sequenceNumber) {
@Override
public List<ArgumentMatcher> getArgumentsAsMatchers() {
List<ArgumentMatcher> matchers = new ArrayList<ArgumentMatcher>();
for (final Object argument : getRawArguments()) {
matchers.add(
new ArgumentMatcher() {
@Override
public boolean matches(Object a) {
return a == argument;
}
@Override
public String toString() {
return "MyCoolPrint(" + argument + ")";
}
});
}
return matchers;
}
};
}
}
}
|
{
"pile_set_name": "Github"
}
|
id: dsq-747529977
date: 2009-09-10T23:34:00.0000000-07:00
name: John Sheehan
avatar: https://disqus.com/api/users/avatars/John Sheehan.jpg
message: <p>I keep reading "Get involved" but no one seems to quantify that with anything actionable. How exactly does the foundation want people to get involved?</p>
|
{
"pile_set_name": "Github"
}
|
/*<FILE_LICENSE>
* NFX (.NET Framework Extension) Unistack Library
* Copyright 2003-2018 Agnicore Inc. portions ITAdapter Corp. 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.
</FILE_LICENSE>*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading.Tasks;
using NFX.Serialization.Slim;
namespace NFX.Log.Bin
{
/// <summary>
/// Reads bin log in Slim format. The format does not support object versioning however it is
/// very efficient in both space and speed
/// </summary>
public class SlimLogReader : LogReader
{
public SlimLogReader(Stream stream) : base(stream)
{
}
}
}
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env python3
#
# Copyright 2011-2015 Jeff Bush
#
# 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.
#
"""Test load_sync/store_sync instructions.
This uses four threads to update variables round-robin.
"""
import os
import struct
import sys
sys.path.insert(0, '../..')
import test_harness
MEM_DUMP_FILE = os.path.join(test_harness.WORK_DIR, 'vmem.bin')
@test_harness.test(['verilator'])
def atomic(_, target):
hex_file = test_harness.build_program(['atomic.S'])
test_harness.run_program(
hex_file,
target,
dump_file=MEM_DUMP_FILE,
dump_base=0x100000,
dump_length=0x800,
flush_l2=True)
with open(MEM_DUMP_FILE, 'rb') as memfile:
for _ in range(512):
val = memfile.read(4)
if len(val) < 4:
raise test_harness.TestException('output file is truncated')
num_val, = struct.unpack('<L', val)
if num_val != 10:
raise test_harness.TestException(
'FAIL: mismatch: ' + str(num_val))
test_harness.execute_tests()
|
{
"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 com.qihoo.qsql.org.apache.calcite.linq4j;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.BigDecimalFunction1;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.DoubleFunction1;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.EqualityComparer;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.FloatFunction1;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.Function0;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.Function1;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.Function2;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.IntegerFunction1;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.LongFunction1;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.NullableBigDecimalFunction1;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.NullableDoubleFunction1;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.NullableFloatFunction1;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.NullableIntegerFunction1;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.NullableLongFunction1;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.Predicate1;
import com.qihoo.qsql.org.apache.calcite.linq4j.function.Predicate2;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
/**
* Extension methods in {@link Enumerable}.
*
* @param <TSource> Element type
*/
public interface ExtendedEnumerable<TSource> {
/**
* Performs an operation for each member of this enumeration.
*
* <p>Returns the value returned by the function for the last element in
* this enumeration, or null if this enumeration is empty.</p>
*
* @param func Operation
* @param <R> Return type
*/
<R> R foreach(Function1<TSource, R> func);
/**
* Applies an accumulator function over a
* sequence.
*/
TSource aggregate(Function2<TSource, TSource, TSource> func);
/**
* Applies an accumulator function over a
* sequence. The specified seed value is used as the initial
* accumulator value.
*/
<TAccumulate> TAccumulate aggregate(TAccumulate seed,
Function2<TAccumulate, TSource, TAccumulate> func);
/**
* Applies an accumulator function over a
* sequence. The specified seed value is used as the initial
* accumulator value, and the specified function is used to select
* the result value.
*/
<TAccumulate, TResult> TResult aggregate(TAccumulate seed,
Function2<TAccumulate, TSource, TAccumulate> func,
Function1<TAccumulate, TResult> selector);
/**
* Determines whether all elements of a sequence
* satisfy a condition.
*/
boolean all(Predicate1<TSource> predicate);
/**
* Determines whether a sequence contains any
* elements. (Defined by Enumerable.)
*/
boolean any();
/**
* Determines whether any element of a sequence
* satisfies a condition.
*/
boolean any(Predicate1<TSource> predicate);
/**
* Returns the input typed as {@code Enumerable<TSource>}.
*
* <p>This method has no effect
* other than to change the compile-time type of source from a type that
* implements {@code Enumerable<TSource>} to {@code Enumerable<TSource>}
* itself.
*
* <p>{@code asEnumerable<TSource>(Enumerable<TSource>)} can be used to choose
* between query implementations when a sequence implements
* {@code Enumerable<TSource>} but also has a different set of public query
* methods available. For example, given a generic class Table that implements
* {@code Enumerable<TSource>} and has its own methods such as {@code where},
* {@code select}, and {@code selectMany}, a call to {@code where} would
* invoke the public {@code where} method of {@code Table}. A {@code Table}
* type that represents a database table could have a {@code where} method
* that takes the predicate argument as an expression tree and converts the
* tree to SQL for remote execution. If remote execution is not desired, for
* example because the predicate invokes a local method, the
* {@code asEnumerable<TSource>} method can be used to hide the custom methods
* and instead make the standard query operators available.
*/
Enumerable<TSource> asEnumerable();
/**
* Converts an Enumerable to a {@link Queryable}.
*
* <p>If the type of source implements {@code Queryable}, this method
* returns it directly. Otherwise, it returns a {@code Queryable} that
* executes queries by calling the equivalent query operator methods in
* {@code Enumerable} instead of those in {@code Queryable}.</p>
*
* <p>Analogous to the LINQ's Enumerable.AsQueryable extension method.</p>
*
* @return A queryable
*/
Queryable<TSource> asQueryable();
/**
* Computes the average of a sequence of Decimal
* values that are obtained by invoking a transform function on
* each element of the input sequence.
*/
BigDecimal average(BigDecimalFunction1<TSource> selector);
/**
* Computes the average of a sequence of nullable
* Decimal values that are obtained by invoking a transform
* function on each element of the input sequence.
*/
BigDecimal average(NullableBigDecimalFunction1<TSource> selector);
/**
* Computes the average of a sequence of Double
* values that are obtained by invoking a transform function on
* each element of the input sequence.
*/
double average(DoubleFunction1<TSource> selector);
/**
* Computes the average of a sequence of nullable
* Double values that are obtained by invoking a transform
* function on each element of the input sequence.
*/
Double average(NullableDoubleFunction1<TSource> selector);
/**
* Computes the average of a sequence of int values
* that are obtained by invoking a transform function on each
* element of the input sequence.
*/
int average(IntegerFunction1<TSource> selector);
/**
* Computes the average of a sequence of nullable
* int values that are obtained by invoking a transform function
* on each element of the input sequence.
*/
Integer average(NullableIntegerFunction1<TSource> selector);
/**
* Computes the average of a sequence of long values
* that are obtained by invoking a transform function on each
* element of the input sequence.
*/
long average(LongFunction1<TSource> selector);
/**
* Computes the average of a sequence of nullable
* long values that are obtained by invoking a transform function
* on each element of the input sequence.
*/
Long average(NullableLongFunction1<TSource> selector);
/**
* Computes the average of a sequence of Float
* values that are obtained by invoking a transform function on
* each element of the input sequence.
*/
float average(FloatFunction1<TSource> selector);
/**
* Computes the average of a sequence of nullable
* Float values that are obtained by invoking a transform
* function on each element of the input sequence.
*/
Float average(NullableFloatFunction1<TSource> selector);
/**
* Converts the elements of this Enumerable to the specified type.
*
* <p>This method is implemented by using deferred execution. The immediate
* return value is an object that stores all the information that is
* required to perform the action. The query represented by this method is
* not executed until the object is enumerated either by calling its
* {@link Enumerable#enumerator} method directly or by using
* {@code for (... in ...)}.
*
* <p>If an element cannot be cast to type TResult, the
* {@link Enumerator#current()} method will throw a
* {@link ClassCastException} a exception when the element it accessed. To
* obtain only those elements that can be cast to type TResult, use the
* {@link #ofType(Class)} method instead.
*
* @see EnumerableDefaults#cast
* @see #ofType(Class)
*/
<T2> Enumerable<T2> cast(Class<T2> clazz);
/**
* Concatenates two sequences.
*/
Enumerable<TSource> concat(Enumerable<TSource> enumerable1);
/**
* Determines whether a sequence contains a specified
* element by using the default equality comparer.
*/
boolean contains(TSource element);
/**
* Determines whether a sequence contains a specified
* element by using a specified {@code EqualityComparer<TSource>}.
*/
boolean contains(TSource element, EqualityComparer<TSource> comparer);
/**
* Returns the number of elements in a
* sequence.
*/
int count();
/**
* Returns a number that represents how many elements
* in the specified sequence satisfy a condition.
*/
int count(Predicate1<TSource> predicate);
/**
* Returns the elements of the specified sequence or
* the type parameter's default value in a singleton collection if
* the sequence is empty.
*/
Enumerable<TSource> defaultIfEmpty();
/**
* Returns the elements of the specified sequence or
* the specified value in a singleton collection if the sequence
* is empty.
*/
Enumerable<TSource> defaultIfEmpty(TSource value);
/**
* Returns distinct elements from a sequence by using
* the default equality comparer to compare values.
*/
Enumerable<TSource> distinct();
/**
* Returns distinct elements from a sequence by using
* a specified {@code EqualityComparer<TSource>} to compare values.
*/
Enumerable<TSource> distinct(EqualityComparer<TSource> comparer);
/**
* Returns the element at a specified index in a
* sequence.
*/
TSource elementAt(int index);
/**
* Returns the element at a specified index in a
* sequence or a default value if the index is out of
* range.
*/
TSource elementAtOrDefault(int index);
/**
* Produces the set difference of two sequences by
* using the default equality comparer to compare values. (Defined
* by Enumerable.)
*/
Enumerable<TSource> except(Enumerable<TSource> enumerable1);
/**
* Produces the set difference of two sequences by
* using the specified {@code EqualityComparer<TSource>} to compare
* values.
*/
Enumerable<TSource> except(Enumerable<TSource> enumerable1,
EqualityComparer<TSource> comparer);
/**
* Returns the first element of a sequence. (Defined
* by Enumerable.)
*/
TSource first();
/**
* Returns the first element in a sequence that
* satisfies a specified condition.
*/
TSource first(Predicate1<TSource> predicate);
/**
* Returns the first element of a sequence, or a
* default value if the sequence contains no elements.
*/
TSource firstOrDefault();
/**
* Returns the first element of the sequence that
* satisfies a condition or a default value if no such element is
* found.
*/
TSource firstOrDefault(Predicate1<TSource> predicate);
/**
* Groups the elements of a sequence according to a
* specified key selector function.
*/
<TKey> Enumerable<Grouping<TKey, TSource>> groupBy(
Function1<TSource, TKey> keySelector);
/**
* Groups the elements of a sequence according to a
* specified key selector function and compares the keys by using
* a specified comparer.
*/
<TKey> Enumerable<Grouping<TKey, TSource>> groupBy(
Function1<TSource, TKey> keySelector, EqualityComparer<TKey> comparer);
/**
* Groups the elements of a sequence according to a
* specified key selector function and projects the elements for
* each group by using a specified function.
*/
<TKey, TElement> Enumerable<Grouping<TKey, TElement>> groupBy(
Function1<TSource, TKey> keySelector,
Function1<TSource, TElement> elementSelector);
/**
* Groups the elements of a sequence according to a
* key selector function. The keys are compared by using a
* comparer and each group's elements are projected by using a
* specified function.
*/
<TKey, TElement> Enumerable<Grouping<TKey, TElement>> groupBy(
Function1<TSource, TKey> keySelector,
Function1<TSource, TElement> elementSelector, EqualityComparer<TKey> comparer);
/**
* Groups the elements of a sequence according to a
* specified key selector function and creates a result value from
* each group and its key.
*/
<TKey, TResult> Enumerable<TResult> groupBy(
Function1<TSource, TKey> keySelector,
Function2<TKey, Enumerable<TSource>, TResult> resultSelector);
/**
* Groups the elements of a sequence according to a
* specified key selector function and creates a result value from
* each group and its key. The keys are compared by using a
* specified comparer.
*/
<TKey, TResult> Enumerable<TResult> groupBy(
Function1<TSource, TKey> keySelector,
Function2<TKey, Enumerable<TSource>, TResult> resultSelector,
EqualityComparer<TKey> comparer);
/**
* Groups the elements of a sequence according to a
* specified key selector function and creates a result value from
* each group and its key. The elements of each group are
* projected by using a specified function.
*/
<TKey, TElement, TResult> Enumerable<TResult> groupBy(
Function1<TSource, TKey> keySelector,
Function1<TSource, TElement> elementSelector,
Function2<TKey, Enumerable<TElement>, TResult> resultSelector);
/**
* Groups the elements of a sequence according to a
* specified key selector function and creates a result value from
* each group and its key. Key values are compared by using a
* specified comparer, and the elements of each group are
* projected by using a specified function.
*/
<TKey, TElement, TResult> Enumerable<TResult> groupBy(
Function1<TSource, TKey> keySelector,
Function1<TSource, TElement> elementSelector,
Function2<TKey, Enumerable<TElement>, TResult> resultSelector,
EqualityComparer<TKey> comparer);
/**
* Groups the elements of a sequence according to a
* specified key selector function, initializing an accumulator for each
* group and adding to it each time an element with the same key is seen.
* Creates a result value from each accumulator and its key using a
* specified function.
*/
<TKey, TAccumulate, TResult> Enumerable<TResult> groupBy(
Function1<TSource, TKey> keySelector,
Function0<TAccumulate> accumulatorInitializer,
Function2<TAccumulate, TSource, TAccumulate> accumulatorAdder,
Function2<TKey, TAccumulate, TResult> resultSelector);
/**
* Groups the elements of a sequence according to a
* specified key selector function, initializing an accumulator for each
* group and adding to it each time an element with the same key is seen.
* Creates a result value from each accumulator and its key using a
* specified function. Key values are compared by using a
* specified comparer.
*/
<TKey, TAccumulate, TResult> Enumerable<TResult> groupBy(
Function1<TSource, TKey> keySelector,
Function0<TAccumulate> accumulatorInitializer,
Function2<TAccumulate, TSource, TAccumulate> accumulatorAdder,
Function2<TKey, TAccumulate, TResult> resultSelector,
EqualityComparer<TKey> comparer);
/**
* Correlates the elements of two sequences based on
* equality of keys and groups the results. The default equality
* comparer is used to compare keys.
*/
<TInner, TKey, TResult> Enumerable<TResult> groupJoin(
Enumerable<TInner> inner, Function1<TSource, TKey> outerKeySelector,
Function1<TInner, TKey> innerKeySelector,
Function2<TSource, Enumerable<TInner>, TResult> resultSelector);
/**
* Correlates the elements of two sequences based on
* key equality and groups the results. A specified
* {@code EqualityComparer<TSource>} is used to compare keys.
*/
<TInner, TKey, TResult> Enumerable<TResult> groupJoin(
Enumerable<TInner> inner, Function1<TSource, TKey> outerKeySelector,
Function1<TInner, TKey> innerKeySelector,
Function2<TSource, Enumerable<TInner>, TResult> resultSelector,
EqualityComparer<TKey> comparer);
/**
* Produces the set intersection of two sequences by
* using the default equality comparer to compare values. (Defined
* by Enumerable.)
*/
Enumerable<TSource> intersect(Enumerable<TSource> enumerable1);
/**
* Produces the set intersection of two sequences by
* using the specified {@code EqualityComparer<TSource>} to compare
* values.
*/
Enumerable<TSource> intersect(Enumerable<TSource> enumerable1,
EqualityComparer<TSource> comparer);
/**
* Copies the contents of this sequence into a collection.
*/
<C extends Collection<? super TSource>> C into(C sink);
/**
* Removes the contents of this sequence from a collection.
*/
<C extends Collection<? super TSource>> C removeAll(C sink);
/**
* Correlates the elements of two sequences based on
* matching keys. The default equality comparer is used to compare
* keys.
*/
<TInner, TKey, TResult> Enumerable<TResult> hashJoin(Enumerable<TInner> inner,
Function1<TSource, TKey> outerKeySelector,
Function1<TInner, TKey> innerKeySelector,
Function2<TSource, TInner, TResult> resultSelector);
/**
* Correlates the elements of two sequences based on
* matching keys. A specified {@code EqualityComparer<TSource>} is used to
* compare keys.
*/
<TInner, TKey, TResult> Enumerable<TResult> hashJoin(Enumerable<TInner> inner,
Function1<TSource, TKey> outerKeySelector,
Function1<TInner, TKey> innerKeySelector,
Function2<TSource, TInner, TResult> resultSelector,
EqualityComparer<TKey> comparer);
/**
* Correlates the elements of two sequences based on matching keys, with
* optional outer join semantics. A specified
* {@code EqualityComparer<TSource>} is used to compare keys.
*
* <p>A left join generates nulls on right, and vice versa:</p>
*
* <table>
* <caption>Join types</caption>
* <tr>
* <td>Join type</td>
* <td>generateNullsOnLeft</td>
* <td>generateNullsOnRight</td>
* </tr>
* <tr><td>INNER</td><td>false</td><td>false</td></tr>
* <tr><td>LEFT</td><td>false</td><td>true</td></tr>
* <tr><td>RIGHT</td><td>true</td><td>false</td></tr>
* <tr><td>FULL</td><td>true</td><td>true</td></tr>
* </table>
*/
<TInner, TKey, TResult> Enumerable<TResult> hashJoin(Enumerable<TInner> inner,
Function1<TSource, TKey> outerKeySelector,
Function1<TInner, TKey> innerKeySelector,
Function2<TSource, TInner, TResult> resultSelector,
EqualityComparer<TKey> comparer,
boolean generateNullsOnLeft, boolean generateNullsOnRight);
/**
* Correlates the elements of two sequences based on matching keys, with
* optional outer join semantics. A specified
* {@code EqualityComparer<TSource>} is used to compare keys.
*
* <p>A left join generates nulls on right, and vice versa:</p>
*
* <table>
* <caption>Join types</caption>
* <tr>
* <td>Join type</td>
* <td>generateNullsOnLeft</td>
* <td>generateNullsOnRight</td>
* </tr>
* <tr><td>INNER</td><td>false</td><td>false</td></tr>
* <tr><td>LEFT</td><td>false</td><td>true</td></tr>
* <tr><td>RIGHT</td><td>true</td><td>false</td></tr>
* <tr><td>FULL</td><td>true</td><td>true</td></tr>
* </table>
*
* <p>A predicate is used to filter the join result per-row</p>
*/
<TInner, TKey, TResult> Enumerable<TResult> hashJoin(Enumerable<TInner> inner,
Function1<TSource, TKey> outerKeySelector,
Function1<TInner, TKey> innerKeySelector,
Function2<TSource, TInner, TResult> resultSelector,
EqualityComparer<TKey> comparer,
boolean generateNullsOnLeft, boolean generateNullsOnRight,
Predicate2<TSource, TInner> predicate);
/**
* For each row of the current enumerable returns the correlated rows
* from the {@code inner} enumerable (nested loops join).
*
* @param joinType inner, left, semi or anti join type
* @param inner generator of inner enumerable
* @param resultSelector selector of the result. For semi/anti join
* inner argument is always null.
*/
<TInner, TResult> Enumerable<TResult> correlateJoin(
JoinType joinType, Function1<TSource, Enumerable<TInner>> inner,
Function2<TSource, TInner, TResult> resultSelector);
/**
* Returns the last element of a sequence. (Defined
* by Enumerable.)
*/
TSource last();
/**
* Returns the last element of a sequence that
* satisfies a specified condition.
*/
TSource last(Predicate1<TSource> predicate);
/**
* Returns the last element of a sequence, or a
* default value if the sequence contains no elements.
*/
TSource lastOrDefault();
/**
* Returns the last element of a sequence that
* satisfies a condition or a default value if no such element is
* found.
*/
TSource lastOrDefault(Predicate1<TSource> predicate);
/**
* Returns an long that represents the total number
* of elements in a sequence.
*/
long longCount();
/**
* Returns an long that represents how many elements
* in a sequence satisfy a condition.
*/
long longCount(Predicate1<TSource> predicate);
/**
* Returns the maximum value in a generic
* sequence.
*/
TSource max();
/**
* Invokes a transform function on each element of a
* sequence and returns the maximum Decimal value.
*/
BigDecimal max(BigDecimalFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the maximum nullable Decimal
* value.
*/
BigDecimal max(NullableBigDecimalFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the maximum Double value.
*/
double max(DoubleFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the maximum nullable Double
* value.
*/
Double max(NullableDoubleFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the maximum int value.
*/
int max(IntegerFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the maximum nullable int value. (Defined
* by Enumerable.)
*/
Integer max(NullableIntegerFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the maximum long value.
*/
long max(LongFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the maximum nullable long value. (Defined
* by Enumerable.)
*/
Long max(NullableLongFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the maximum Float value.
*/
float max(FloatFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the maximum nullable Float
* value.
*/
Float max(NullableFloatFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* generic sequence and returns the maximum resulting
* value.
*/
<TResult extends Comparable<TResult>> TResult max(
Function1<TSource, TResult> selector);
/**
* Returns the minimum value in a generic
* sequence.
*/
TSource min();
/**
* Invokes a transform function on each element of a
* sequence and returns the minimum Decimal value.
*/
BigDecimal min(BigDecimalFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the minimum nullable Decimal
* value.
*/
BigDecimal min(NullableBigDecimalFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the minimum Double value.
*/
double min(DoubleFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the minimum nullable Double
* value.
*/
Double min(NullableDoubleFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the minimum int value.
*/
int min(IntegerFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the minimum nullable int value. (Defined
* by Enumerable.)
*/
Integer min(NullableIntegerFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the minimum long value.
*/
long min(LongFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the minimum nullable long value. (Defined
* by Enumerable.)
*/
Long min(NullableLongFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the minimum Float value.
*/
float min(FloatFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* sequence and returns the minimum nullable Float
* value.
*/
Float min(NullableFloatFunction1<TSource> selector);
/**
* Invokes a transform function on each element of a
* generic sequence and returns the minimum resulting
* value.
*/
<TResult extends Comparable<TResult>> TResult min(
Function1<TSource, TResult> selector);
/**
* Filters the elements of an Enumerable based on a
* specified type.
*
* <p>Analogous to LINQ's Enumerable.OfType extension method.</p>
*
* @param clazz Target type
* @param <TResult> Target type
*
* @return Collection of T2
*/
<TResult> Enumerable<TResult> ofType(Class<TResult> clazz);
/**
* Sorts the elements of a sequence in ascending
* order according to a key.
*/
<TKey extends Comparable> Enumerable<TSource> orderBy(
Function1<TSource, TKey> keySelector);
/**
* Sorts the elements of a sequence in ascending
* order by using a specified comparer.
*/
<TKey> Enumerable<TSource> orderBy(Function1<TSource, TKey> keySelector,
Comparator<TKey> comparator);
/**
* Sorts the elements of a sequence in descending
* order according to a key.
*/
<TKey extends Comparable> Enumerable<TSource> orderByDescending(
Function1<TSource, TKey> keySelector);
/**
* Sorts the elements of a sequence in descending
* order by using a specified comparer.
*/
<TKey> Enumerable<TSource> orderByDescending(
Function1<TSource, TKey> keySelector, Comparator<TKey> comparator);
/**
* Inverts the order of the elements in a
* sequence.
*/
Enumerable<TSource> reverse();
/**
* Projects each element of a sequence into a new
* form.
*/
<TResult> Enumerable<TResult> select(Function1<TSource, TResult> selector);
/**
* Projects each element of a sequence into a new
* form by incorporating the element's index.
*/
<TResult> Enumerable<TResult> select(
Function2<TSource, Integer, TResult> selector);
/**
* Projects each element of a sequence to an
* {@code Enumerable<TSource>} and flattens the resulting sequences into one
* sequence.
*/
<TResult> Enumerable<TResult> selectMany(
Function1<TSource, Enumerable<TResult>> selector);
/**
* Projects each element of a sequence to an
* {@code Enumerable<TSource>}, and flattens the resulting sequences into one
* sequence. The index of each source element is used in the
* projected form of that element.
*/
<TResult> Enumerable<TResult> selectMany(
Function2<TSource, Integer, Enumerable<TResult>> selector);
/**
* Projects each element of a sequence to an
* {@code Enumerable<TSource>}, flattens the resulting sequences into one
* sequence, and invokes a result selector function on each
* element therein. The index of each source element is used in
* the intermediate projected form of that element.
*/
<TCollection, TResult> Enumerable<TResult> selectMany(
Function2<TSource, Integer, Enumerable<TCollection>> collectionSelector,
Function2<TSource, TCollection, TResult> resultSelector);
/**
* Projects each element of a sequence to an
* {@code Enumerable<TSource>}, flattens the resulting sequences into one
* sequence, and invokes a result selector function on each
* element therein.
*/
<TCollection, TResult> Enumerable<TResult> selectMany(
Function1<TSource, Enumerable<TCollection>> collectionSelector,
Function2<TSource, TCollection, TResult> resultSelector);
/**
* Determines whether two sequences are equal by
* comparing the elements by using the default equality comparer
* for their type.
*/
boolean sequenceEqual(Enumerable<TSource> enumerable1);
/**
* Determines whether two sequences are equal by
* comparing their elements by using a specified
* {@code EqualityComparer<TSource>}.
*/
boolean sequenceEqual(Enumerable<TSource> enumerable1,
EqualityComparer<TSource> comparer);
/**
* Returns the only element of a sequence, and throws
* an exception if there is not exactly one element in the
* sequence.
*/
TSource single();
/**
* Returns the only element of a sequence that
* satisfies a specified condition, and throws an exception if
* more than one such element exists.
*/
TSource single(Predicate1<TSource> predicate);
/**
* Returns the only element of a sequence, or a
* default value if the sequence is empty; this method throws an
* exception if there is more than one element in the
* sequence.
*/
TSource singleOrDefault();
/**
* Returns the only element of a sequence that
* satisfies a specified condition or a default value if no such
* element exists; this method throws an exception if more than
* one element satisfies the condition.
*/
TSource singleOrDefault(Predicate1<TSource> predicate);
/**
* Bypasses a specified number of elements in a
* sequence and then returns the remaining elements.
*/
Enumerable<TSource> skip(int count);
/**
* Bypasses elements in a sequence as long as a
* specified condition is true and then returns the remaining
* elements.
*/
Enumerable<TSource> skipWhile(Predicate1<TSource> predicate);
/**
* Bypasses elements in a sequence as long as a
* specified condition is true and then returns the remaining
* elements. The element's index is used in the logic of the
* predicate function.
*/
Enumerable<TSource> skipWhile(Predicate2<TSource, Integer> predicate);
/**
* Computes the sum of the sequence of Decimal values
* that are obtained by invoking a transform function on each
* element of the input sequence.
*/
BigDecimal sum(BigDecimalFunction1<TSource> selector);
/**
* Computes the sum of the sequence of nullable
* Decimal values that are obtained by invoking a transform
* function on each element of the input sequence.
*/
BigDecimal sum(NullableBigDecimalFunction1<TSource> selector);
/**
* Computes the sum of the sequence of Double values
* that are obtained by invoking a transform function on each
* element of the input sequence.
*/
double sum(DoubleFunction1<TSource> selector);
/**
* Computes the sum of the sequence of nullable
* Double values that are obtained by invoking a transform
* function on each element of the input sequence.
*/
Double sum(NullableDoubleFunction1<TSource> selector);
/**
* Computes the sum of the sequence of int values
* that are obtained by invoking a transform function on each
* element of the input sequence.
*/
int sum(IntegerFunction1<TSource> selector);
/**
* Computes the sum of the sequence of nullable int
* values that are obtained by invoking a transform function on
* each element of the input sequence.
*/
Integer sum(NullableIntegerFunction1<TSource> selector);
/**
* Computes the sum of the sequence of long values
* that are obtained by invoking a transform function on each
* element of the input sequence.
*/
long sum(LongFunction1<TSource> selector);
/**
* Computes the sum of the sequence of nullable long
* values that are obtained by invoking a transform function on
* each element of the input sequence.
*/
Long sum(NullableLongFunction1<TSource> selector);
/**
* Computes the sum of the sequence of Float values
* that are obtained by invoking a transform function on each
* element of the input sequence.
*/
float sum(FloatFunction1<TSource> selector);
/**
* Computes the sum of the sequence of nullable
* Float values that are obtained by invoking a transform
* function on each element of the input sequence.
*/
Float sum(NullableFloatFunction1<TSource> selector);
/**
* Returns a specified number of contiguous elements
* from the start of a sequence.
*/
Enumerable<TSource> take(int count);
/**
* Returns elements from a sequence as long as a
* specified condition is true.
*/
Enumerable<TSource> takeWhile(Predicate1<TSource> predicate);
/**
* Returns elements from a sequence as long as a
* specified condition is true. The element's index is used in the
* logic of the predicate function.
*/
Enumerable<TSource> takeWhile(Predicate2<TSource, Integer> predicate);
/**
* Creates a {@code Map<TKey, TValue>} from an
* {@code Enumerable<TSource>} according to a specified key selector
* function.
*
* <p>NOTE: Called {@code toDictionary} in LINQ.NET.</p>
*/
<TKey> Map<TKey, TSource> toMap(Function1<TSource, TKey> keySelector);
/**
* Creates a {@code Map<TKey, TValue>} from an
* {@code Enumerable<TSource>} according to a specified key selector function
* and key comparer.
*/
<TKey> Map<TKey, TSource> toMap(Function1<TSource, TKey> keySelector,
EqualityComparer<TKey> comparer);
/**
* Creates a {@code Map<TKey, TValue>} from an
* {@code Enumerable<TSource>} according to specified key selector and element
* selector functions.
*/
<TKey, TElement> Map<TKey, TElement> toMap(
Function1<TSource, TKey> keySelector,
Function1<TSource, TElement> elementSelector);
/**
* Creates a {@code Map<TKey, TValue>} from an
* {@code Enumerable<TSource>} according to a specified key selector function,
* a comparer, and an element selector function.
*/
<TKey, TElement> Map<TKey, TElement> toMap(
Function1<TSource, TKey> keySelector,
Function1<TSource, TElement> elementSelector,
EqualityComparer<TKey> comparer);
/**
* Creates a {@code List<TSource>} from an {@code Enumerable<TSource>}.
*/
List<TSource> toList();
/**
* Creates a {@code Lookup<TKey, TElement>} from an
* {@code Enumerable<TSource>} according to a specified key selector
* function.
*/
<TKey> Lookup<TKey, TSource> toLookup(Function1<TSource, TKey> keySelector);
/**
* Creates a {@code Lookup<TKey, TElement>} from an
* {@code Enumerable<TSource>} according to a specified key selector function
* and key comparer.
*/
<TKey> Lookup<TKey, TSource> toLookup(Function1<TSource, TKey> keySelector,
EqualityComparer<TKey> comparer);
/**
* Creates a {@code Lookup<TKey, TElement>} from an
* {@code Enumerable<TSource>} according to specified key selector and element
* selector functions.
*/
<TKey, TElement> Lookup<TKey, TElement> toLookup(
Function1<TSource, TKey> keySelector,
Function1<TSource, TElement> elementSelector);
/**
* Creates a {@code Lookup<TKey, TElement>} from an
* {@code Enumerable<TSource>} according to a specified key selector function,
* a comparer and an element selector function.
*/
<TKey, TElement> Lookup<TKey, TElement> toLookup(
Function1<TSource, TKey> keySelector,
Function1<TSource, TElement> elementSelector,
EqualityComparer<TKey> comparer);
/**
* Produces the set union of two sequences by using
* the default equality comparer.
*/
Enumerable<TSource> union(Enumerable<TSource> source1);
/**
* Produces the set union of two sequences by using a
* specified {@code EqualityComparer<TSource>}.
*/
Enumerable<TSource> union(Enumerable<TSource> source1,
EqualityComparer<TSource> comparer);
/**
* Filters a sequence of values based on a
* predicate.
*/
Enumerable<TSource> where(Predicate1<TSource> predicate);
/**
* Filters a sequence of values based on a
* predicate. Each element's index is used in the logic of the
* predicate function.
*/
Enumerable<TSource> where(Predicate2<TSource, Integer> predicate);
/**
* Applies a specified function to the corresponding
* elements of two sequences, producing a sequence of the
* results.
*/
<T1, TResult> Enumerable<TResult> zip(Enumerable<T1> source1,
Function2<TSource, T1, TResult> resultSelector);
}
// End ExtendedEnumerable.java
|
{
"pile_set_name": "Github"
}
|
{
"Assemblies": [
],
"Types": [
{
"Name": " System.IFormattable"
},
{
"Name": " System.IConvertible"
},
{
"Name": " System.IComparable"
},
{
"Name": "System.IEquatable`1",
"GenericParams": [
{
"Types": [
"System.Boolean"
]
},
{
"Types": [
"System.Char"
]
},
{
"Types": [
"System.SByte"
]
},
{
"Types": [
"System.Byte"
]
},
{
"Types": [
"System.Int16"
]
},
{
"Types": [
"System.UInt16"
]
},
{
"Types": [
"System.Int32"
]
},
{
"Types": [
"System.UInt32"
]
},
{
"Types": [
"System.Int64"
]
},
{
"Types": [
"System.UInt64"
]
},
{
"Types": [
"System.Single"
]
},
{
"Types": [
"System.Double"
]
},
{
"Types": [
"System.Decimal"
]
},
{
"Types": [
"UnityEngine.Vector3"
]
}
]
},
{
"Name": "System.IComparable`1",
"GenericParams": [
{
"Types": [
"System.Boolean"
]
},
{
"Types": [
"System.Char"
]
},
{
"Types": [
"System.SByte"
]
},
{
"Types": [
"System.Byte"
]
},
{
"Types": [
"System.Int16"
]
},
{
"Types": [
"System.UInt16"
]
},
{
"Types": [
"System.Int32"
]
},
{
"Types": [
"System.UInt32"
]
},
{
"Types": [
"System.Int64"
]
},
{
"Types": [
"System.UInt64"
]
},
{
"Types": [
"System.Single"
]
},
{
"Types": [
"System.Double"
]
},
{
"Types": [
"System.Decimal"
]
}
]
},
{
"Name": " System.Runtime.Serialization.IDeserializationCallback"
},
{
"Name": "System.Decimal",
"Constructors": [
{
"ParamTypes": [
"System.Double"
]
},
{
"ParamTypes": [
"System.UInt64"
]
}
]
},
{
"Name": "UnityEngine.Vector3",
"Constructors": [
{
"ParamTypes": [
"System.Single",
"System.Single",
"System.Single"
]
}
],
"Methods": [
{
"Name": "x+y",
"ParamTypes": [
"UnityEngine.Vector3",
"UnityEngine.Vector3"
]
}
]
},
{
"Name": "UnityEngine.Object",
"Properties": [
{
"Name": "name",
"Get": {},
"Set": {}
}
]
},
{
"Name": "UnityEngine.Component",
"Properties": [
{
"Name": "transform",
"Get": {}
}
]
},
{
"Name": "UnityEngine.Transform",
"Properties": [
{
"Name": "position",
"Get": {},
"Set": {
"Exceptions": [
"System.NullReferenceException"
]
}
}
]
},
{
"Name": "System.Collections.IEnumerator",
"Methods": [
{
"Name": "MoveNext",
"ParamTypes": []
}
],
"Properties": [
{
"Name": "Current",
"Get": {},
"Set": {}
}
]
},
{
"Name": "System.Runtime.Serialization.ISerializable"
},
{
"Name": "System.Runtime.InteropServices._Exception"
},
{
"Name": "UnityEngine.GameObject",
"Constructors": [
],
"Methods": [
{
"Name": "AddComponent",
"ParamTypes": [],
"GenericParams": [
{
"Types": [
"MyGame.BaseBallScript"
]
}
]
},
{
"Name": "CreatePrimitive",
"ParamTypes": [
"UnityEngine.PrimitiveType"
]
}
]
},
{
"Name": "UnityEngine.Debug",
"Methods": [
{
"Name": "Log",
"ParamTypes": [
"System.Object"
]
}
]
},
{
"Name": "UnityEngine.Behaviour"
},
{
"Name": "UnityEngine.MonoBehaviour",
"Properties": [
{
"Name": "transform",
"Get": {},
"Set": {}
}
]
},
{
"Name": "System.Exception",
"Constructors": [
{
"ParamTypes": [
"System.String"
]
}
]
},
{
"Name": "System.SystemException"
},
{
"Name": "System.NullReferenceException"
},
{
"Name": "UnityEngine.PrimitiveType"
},
{
"Name": "UnityEngine.Time",
"Properties": [
{
"Name": "deltaTime",
"Get": {},
"Set": {}
}
]
},
{
"Name": "MyGame.AbstractBaseBallScript",
"BaseTypes": [
{
"BaseName": "MyGame.BaseBallScript",
"DerivedName": "MyGame.BallScript"
}
]
}
],
"Arrays": [
],
"Delegates": [
]
}
|
{
"pile_set_name": "Github"
}
|
--TEST--
mb_substr_count()
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--INI--
output_handler=
--FILE--
<?php
mb_internal_encoding("EUC-JP");
try {
var_dump(mb_substr_count("", ""));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
var_dump(mb_substr_count("鐃緒申", ""));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
var_dump(mb_substr_count("", "あ"));
var_dump(mb_substr_count("", "あ"));
var_dump(mb_substr_count("", chr(0)));
$a = str_repeat("abcacba", 100);
var_dump(@mb_substr_count($a, "bca"));
$a = str_repeat("あいうあういあ", 100);
$b = "いうあ";
var_dump(@mb_substr_count($a, $b));
$to_enc = "UTF-8";
var_dump(@mb_substr_count(mb_convert_encoding($a, $to_enc),
mb_convert_encoding($b, $to_enc), $to_enc));
$to_enc = "Shift_JIS";
var_dump(@mb_substr_count(mb_convert_encoding($a, $to_enc),
mb_convert_encoding($b, $to_enc), $to_enc));
$a = str_repeat("abcacbabca", 100);
var_dump(@mb_substr_count($a, "bca"));
?>
--EXPECT--
mb_substr_count(): Argument #2 ($needle) must not be empty
mb_substr_count(): Argument #2 ($needle) must not be empty
int(0)
int(0)
int(0)
int(100)
int(100)
int(100)
int(100)
int(200)
|
{
"pile_set_name": "Github"
}
|
/*
* BioJava development code
*
* This code may be freely distributed and modified under the
* terms of the GNU Lesser General Public Licence. This should
* be distributed with the code. If you do not have a copy,
* see:
*
* http://www.gnu.org/copyleft/lesser.html
*
* Copyright for this code is held jointly by the individual
* authors. These should be listed in @author doc comments.
*
* For more information on the BioJava project and its aims,
* or to join the biojava-l mailing list, visit the home page
* at:
*
* http://www.biojava.org/
*
* Created on Jun 30, 2010
* Author: ap3
*
*/
package org.biojava.nbio.structure.scop;
import java.io.Serializable;
/** The various categories provided by SCOP.
*
* The SCOP node types are 'cl' (Class),
* 'cf' (Fold), 'sf' (Superfamily), 'fa' (Family), 'dm' (Domain),
* 'sp' (Species), 'px' (protein).
*
* @author Andreas Prlic
*
*/
public enum ScopCategory implements Serializable
{
Class,Fold, Superfamily, Family, Domain, Species, Px;
public static ScopCategory fromString(String type){
if ( type.equals("cl"))
return Class;
else if ( type.equals("cf"))
return Fold;
else if ( type.equals("sf"))
return Superfamily;
else if ( type.equals("fa"))
return Family;
else if ( type.equals("dm"))
return Domain;
else if ( type.equals("sp"))
return Species;
else
return Px;
}
@Override
public String toString(){
switch (this) {
case Class:
return "cl";
case Fold:
return "cf";
case Superfamily:
return "sf";
case Family:
return "fa";
case Domain:
return "dm";
case Species:
return "sp";
default:
return "px";
}
}
}
|
{
"pile_set_name": "Github"
}
|
#import <UIKit/UIKit.h>
#import <Matcha/Matcha.h>
//! Project version number for CustomView.
FOUNDATION_EXPORT double CustomViewVersionNumber;
//! Project version string for CustomView.
FOUNDATION_EXPORT const unsigned char CustomViewVersionString[];
@interface CustomView : UISwitch <MatchaChildView>
@property (nonatomic, strong) MatchaViewNode *viewNode;
@end
|
{
"pile_set_name": "Github"
}
|
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
one:
country_id: 1
name: MyString
two:
country_id: 1
name: MyString
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2012, Michael Lehn
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1) Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2) Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3) Neither the name of the FLENS development group nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CXXLAPACK_INTERFACE_LARF_H
#define CXXLAPACK_INTERFACE_LARF_H 1
#include <complex>
namespace cxxlapack {
template <typename IndexType>
void
larf(char side,
IndexType m,
IndexType n,
const float *V,
IndexType incV,
const float &tau,
float *C,
IndexType ldC,
float *work);
template <typename IndexType>
void
larf(char side,
IndexType m,
IndexType n,
const double *V,
IndexType incV,
const double &tau,
double *C,
IndexType ldC,
double *work);
template <typename IndexType>
void
larf(char side,
IndexType m,
IndexType n,
const std::complex<float > *V,
IndexType incV,
const std::complex<float > &tau,
std::complex<float > *C,
IndexType ldC,
std::complex<float > *work);
template <typename IndexType>
void
larf(char side,
IndexType m,
IndexType n,
const std::complex<double> *V,
IndexType incV,
const std::complex<double> &tau,
std::complex<double> *C,
IndexType ldC,
std::complex<double> *work);
} // namespace cxxlapack
#endif // CXXLAPACK_INTERFACE_LARF_H
|
{
"pile_set_name": "Github"
}
|
// Copyright © 2019 Banzai Cloud
//
// 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 ctxutil
type contextKey string
func (c contextKey) String() string {
return "ctxutils context key " + string(c)
}
|
{
"pile_set_name": "Github"
}
|
/*
* H.264/HEVC common parsing code
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_H2645_PARSE_H
#define AVCODEC_H2645_PARSE_H
#include <stdint.h>
#include "avcodec.h"
#include "get_bits.h"
#define MAX_MBPAIR_SIZE (256*1024) // a tighter bound could be calculated if someone cares about a few bytes
typedef struct H2645NAL {
uint8_t *rbsp_buffer;
int size;
const uint8_t *data;
/**
* Size, in bits, of just the data, excluding the stop bit and any trailing
* padding. I.e. what HEVC calls SODB.
*/
int size_bits;
int raw_size;
const uint8_t *raw_data;
GetBitContext gb;
/**
* NAL unit type
*/
int type;
/**
* HEVC only, nuh_temporal_id_plus_1 - 1
*/
int temporal_id;
int skipped_bytes;
int skipped_bytes_pos_size;
int *skipped_bytes_pos;
/**
* H.264 only, nal_ref_idc
*/
int ref_idc;
} H2645NAL;
typedef struct H2645RBSP {
uint8_t *rbsp_buffer;
int rbsp_buffer_alloc_size;
int rbsp_buffer_size;
} H2645RBSP;
/* an input packet split into unescaped NAL units */
typedef struct H2645Packet {
H2645NAL *nals;
H2645RBSP rbsp;
int nb_nals;
int nals_allocated;
} H2645Packet;
/**
* Extract the raw (unescaped) bitstream.
*/
int ff_h2645_extract_rbsp(const uint8_t *src, int length, H2645RBSP *rbsp,
H2645NAL *nal, int small_padding);
/**
* Split an input packet into NAL units.
*/
int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
void *logctx, int is_nalff, int nal_length_size,
enum AVCodecID codec_id, int small_padding);
/**
* Free all the allocated memory in the packet.
*/
void ff_h2645_packet_uninit(H2645Packet *pkt);
static inline int get_nalsize(int nal_length_size, const uint8_t *buf,
int buf_size, int *buf_index, void *logctx)
{
int i, nalsize = 0;
if (*buf_index >= buf_size - nal_length_size) {
// the end of the buffer is reached, refill it
return AVERROR(EAGAIN);
}
for (i = 0; i < nal_length_size; i++)
nalsize = ((unsigned)nalsize << 8) | buf[(*buf_index)++];
if (nalsize <= 0 || nalsize > buf_size - *buf_index) {
av_log(logctx, AV_LOG_ERROR,
"Invalid NAL unit size (%d > %d).\n", nalsize, buf_size - *buf_index);
return AVERROR_INVALIDDATA;
}
return nalsize;
}
#endif /* AVCODEC_H2645_PARSE_H */
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.1 (2020-05-27)
*/
(function (domGlobals) {
'use strict';
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
return {
get: get,
set: set
};
};
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var hasProPlugin = function (editor) {
if (/(^|[ ,])tinymcespellchecker([, ]|$)/.test(editor.settings.plugins) && global.get('tinymcespellchecker')) {
if (typeof domGlobals.window.console !== 'undefined' && domGlobals.window.console.log) {
domGlobals.window.console.log('Spell Checker Pro is incompatible with Spell Checker plugin! ' + 'Remove \'spellchecker\' from the \'plugins\' option.');
}
return true;
} else {
return false;
}
};
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.URI');
var global$3 = tinymce.util.Tools.resolve('tinymce.util.XHR');
var fireSpellcheckStart = function (editor) {
return editor.fire('SpellcheckStart');
};
var fireSpellcheckEnd = function (editor) {
return editor.fire('SpellcheckEnd');
};
var getLanguages = function (editor) {
var defaultLanguages = 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv';
return editor.getParam('spellchecker_languages', defaultLanguages);
};
var getLanguage = function (editor) {
var defaultLanguage = editor.getParam('language', 'en');
return editor.getParam('spellchecker_language', defaultLanguage);
};
var getRpcUrl = function (editor) {
return editor.getParam('spellchecker_rpc_url');
};
var getSpellcheckerCallback = function (editor) {
return editor.getParam('spellchecker_callback');
};
var getSpellcheckerWordcharPattern = function (editor) {
var defaultPattern = new RegExp('[^' + '\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`' + '\xA7\xA9\xAB\xAE\xB1\xB6\xB7\xB8\xBB' + '\xBC\xBD\xBE\xBF\xD7\xF7\xA4\u201D\u201C\u201E\xA0\u2002\u2003\u2009' + ']+', 'g');
return editor.getParam('spellchecker_wordchar_pattern', defaultPattern);
};
function isContentEditableFalse(node) {
return node && node.nodeType === 1 && node.contentEditable === 'false';
}
var DomTextMatcher = function (node, editor) {
var m, matches = [], text;
var dom = editor.dom;
var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap;
blockElementsMap = editor.schema.getBlockElements();
hiddenTextElementsMap = editor.schema.getWhiteSpaceElements();
shortEndedElementsMap = editor.schema.getShortEndedElements();
function createMatch(m, data) {
if (!m[0]) {
throw new Error('findAndReplaceDOMText cannot handle zero-length matches');
}
return {
start: m.index,
end: m.index + m[0].length,
text: m[0],
data: data
};
}
function getText(node) {
var txt;
if (node.nodeType === 3) {
return node.data;
}
if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) {
return '';
}
if (isContentEditableFalse(node)) {
return '\n';
}
txt = '';
if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) {
txt += '\n';
}
if (node = node.firstChild) {
do {
txt += getText(node);
} while (node = node.nextSibling);
}
return txt;
}
function stepThroughMatches(node, matches, replaceFn) {
var startNode, endNode, startNodeIndex, endNodeIndex, innerNodes = [], atIndex = 0, curNode = node, matchLocation, matchIndex = 0;
matches = matches.slice(0);
matches.sort(function (a, b) {
return a.start - b.start;
});
matchLocation = matches.shift();
out:
while (true) {
if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName] || isContentEditableFalse(curNode)) {
atIndex++;
}
if (curNode.nodeType === 3) {
if (!endNode && curNode.length + atIndex >= matchLocation.end) {
endNode = curNode;
endNodeIndex = matchLocation.end - atIndex;
} else if (startNode) {
innerNodes.push(curNode);
}
if (!startNode && curNode.length + atIndex > matchLocation.start) {
startNode = curNode;
startNodeIndex = matchLocation.start - atIndex;
}
atIndex += curNode.length;
}
if (startNode && endNode) {
curNode = replaceFn({
startNode: startNode,
startNodeIndex: startNodeIndex,
endNode: endNode,
endNodeIndex: endNodeIndex,
innerNodes: innerNodes,
match: matchLocation.text,
matchIndex: matchIndex
});
atIndex -= endNode.length - endNodeIndex;
startNode = null;
endNode = null;
innerNodes = [];
matchLocation = matches.shift();
matchIndex++;
if (!matchLocation) {
break;
}
} else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) {
if (!isContentEditableFalse(curNode)) {
curNode = curNode.firstChild;
continue;
}
} else if (curNode.nextSibling) {
curNode = curNode.nextSibling;
continue;
}
while (true) {
if (curNode.nextSibling) {
curNode = curNode.nextSibling;
break;
} else if (curNode.parentNode !== node) {
curNode = curNode.parentNode;
} else {
break out;
}
}
}
}
function genReplacer(callback) {
function makeReplacementNode(fill, matchIndex) {
var match = matches[matchIndex];
if (!match.stencil) {
match.stencil = callback(match);
}
var clone = match.stencil.cloneNode(false);
clone.setAttribute('data-mce-index', matchIndex);
if (fill) {
clone.appendChild(dom.doc.createTextNode(fill));
}
return clone;
}
return function (range) {
var before;
var after;
var parentNode;
var startNode = range.startNode;
var endNode = range.endNode;
var matchIndex = range.matchIndex;
var doc = dom.doc;
if (startNode === endNode) {
var node_1 = startNode;
parentNode = node_1.parentNode;
if (range.startNodeIndex > 0) {
before = doc.createTextNode(node_1.data.substring(0, range.startNodeIndex));
parentNode.insertBefore(before, node_1);
}
var el = makeReplacementNode(range.match, matchIndex);
parentNode.insertBefore(el, node_1);
if (range.endNodeIndex < node_1.length) {
after = doc.createTextNode(node_1.data.substring(range.endNodeIndex));
parentNode.insertBefore(after, node_1);
}
node_1.parentNode.removeChild(node_1);
return el;
}
before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex));
after = doc.createTextNode(endNode.data.substring(range.endNodeIndex));
var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);
for (var i = 0, l = range.innerNodes.length; i < l; ++i) {
var innerNode = range.innerNodes[i];
var innerEl = makeReplacementNode(innerNode.data, matchIndex);
innerNode.parentNode.replaceChild(innerEl, innerNode);
}
var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);
parentNode = startNode.parentNode;
parentNode.insertBefore(before, startNode);
parentNode.insertBefore(elA, startNode);
parentNode.removeChild(startNode);
parentNode = endNode.parentNode;
parentNode.insertBefore(elB, endNode);
parentNode.insertBefore(after, endNode);
parentNode.removeChild(endNode);
return elB;
};
}
function unwrapElement(element) {
var parentNode = element.parentNode;
while (element.childNodes.length > 0) {
parentNode.insertBefore(element.childNodes[0], element);
}
parentNode.removeChild(element);
}
function hasClass(elm) {
return elm.className.indexOf('mce-spellchecker-word') !== -1;
}
function getWrappersByIndex(index) {
var elements = node.getElementsByTagName('*'), wrappers = [];
index = typeof index === 'number' ? '' + index : null;
for (var i = 0; i < elements.length; i++) {
var element = elements[i], dataIndex = element.getAttribute('data-mce-index');
if (dataIndex !== null && dataIndex.length && hasClass(element)) {
if (dataIndex === index || index === null) {
wrappers.push(element);
}
}
}
return wrappers;
}
function indexOf(match) {
var i = matches.length;
while (i--) {
if (matches[i] === match) {
return i;
}
}
return -1;
}
function filter(callback) {
var filteredMatches = [];
each(function (match, i) {
if (callback(match, i)) {
filteredMatches.push(match);
}
});
matches = filteredMatches;
return this;
}
function each(callback) {
for (var i = 0, l = matches.length; i < l; i++) {
if (callback(matches[i], i) === false) {
break;
}
}
return this;
}
function wrap(callback) {
if (matches.length) {
stepThroughMatches(node, matches, genReplacer(callback));
}
return this;
}
function find(regex, data) {
if (text && regex.global) {
while (m = regex.exec(text)) {
matches.push(createMatch(m, data));
}
}
return this;
}
function unwrap(match) {
var i;
var elements = getWrappersByIndex(match ? indexOf(match) : null);
i = elements.length;
while (i--) {
unwrapElement(elements[i]);
}
return this;
}
function matchFromElement(element) {
return matches[element.getAttribute('data-mce-index')];
}
function elementFromMatch(match) {
return getWrappersByIndex(indexOf(match))[0];
}
function add(start, length, data) {
matches.push({
start: start,
end: start + length,
text: text.substr(start, length),
data: data
});
return this;
}
function rangeFromMatch(match) {
var wrappers = getWrappersByIndex(indexOf(match));
var rng = editor.dom.createRng();
rng.setStartBefore(wrappers[0]);
rng.setEndAfter(wrappers[wrappers.length - 1]);
return rng;
}
function replace(match, text) {
var rng = rangeFromMatch(match);
rng.deleteContents();
if (text.length > 0) {
rng.insertNode(editor.dom.doc.createTextNode(text));
}
return rng;
}
function reset() {
matches.splice(0, matches.length);
unwrap();
return this;
}
text = getText(node);
return {
text: text,
matches: matches,
each: each,
filter: filter,
reset: reset,
matchFromElement: matchFromElement,
elementFromMatch: elementFromMatch,
find: find,
add: add,
wrap: wrap,
unwrap: unwrap,
replace: replace,
rangeFromMatch: rangeFromMatch,
indexOf: indexOf
};
};
var hasOwnProperty = Object.hasOwnProperty;
var isEmpty = function (r) {
for (var x in r) {
if (hasOwnProperty.call(r, x)) {
return false;
}
}
return true;
};
var getTextMatcher = function (editor, textMatcherState) {
if (!textMatcherState.get()) {
var textMatcher = DomTextMatcher(editor.getBody(), editor);
textMatcherState.set(textMatcher);
}
return textMatcherState.get();
};
var defaultSpellcheckCallback = function (editor, pluginUrl, currentLanguageState) {
return function (method, text, doneCallback, errorCallback) {
var data = {
method: method,
lang: currentLanguageState.get()
};
var postData = '';
data[method === 'addToDictionary' ? 'word' : 'text'] = text;
global$1.each(data, function (value, key) {
if (postData) {
postData += '&';
}
postData += key + '=' + encodeURIComponent(value);
});
global$3.send({
url: new global$2(pluginUrl).toAbsolute(getRpcUrl(editor)),
type: 'post',
content_type: 'application/x-www-form-urlencoded',
data: postData,
success: function (result) {
var parseResult = JSON.parse(result);
if (!parseResult) {
var message = editor.translate('Server response wasn\'t proper JSON.');
errorCallback(message);
} else if (parseResult.error) {
errorCallback(parseResult.error);
} else {
doneCallback(parseResult);
}
},
error: function () {
var message = editor.translate('The spelling service was not found: (') + getRpcUrl(editor) + editor.translate(')');
errorCallback(message);
}
});
};
};
var sendRpcCall = function (editor, pluginUrl, currentLanguageState, name, data, successCallback, errorCallback) {
var userSpellcheckCallback = getSpellcheckerCallback(editor);
var spellCheckCallback = userSpellcheckCallback ? userSpellcheckCallback : defaultSpellcheckCallback(editor, pluginUrl, currentLanguageState);
spellCheckCallback.call(editor.plugins.spellchecker, name, data, successCallback, errorCallback);
};
var spellcheck = function (editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState) {
if (finish(editor, startedState, textMatcherState)) {
return;
}
var errorCallback = function (message) {
editor.notificationManager.open({
text: message,
type: 'error'
});
editor.setProgressState(false);
finish(editor, startedState, textMatcherState);
};
var successCallback = function (data) {
markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data);
};
editor.setProgressState(true);
sendRpcCall(editor, pluginUrl, currentLanguageState, 'spellcheck', getTextMatcher(editor, textMatcherState).text, successCallback, errorCallback);
editor.focus();
};
var checkIfFinished = function (editor, startedState, textMatcherState) {
if (!editor.dom.select('span.mce-spellchecker-word').length) {
finish(editor, startedState, textMatcherState);
}
};
var addToDictionary = function (editor, pluginUrl, startedState, textMatcherState, currentLanguageState, word, spans) {
editor.setProgressState(true);
sendRpcCall(editor, pluginUrl, currentLanguageState, 'addToDictionary', word, function () {
editor.setProgressState(false);
editor.dom.remove(spans, true);
checkIfFinished(editor, startedState, textMatcherState);
}, function (message) {
editor.notificationManager.open({
text: message,
type: 'error'
});
editor.setProgressState(false);
});
};
var ignoreWord = function (editor, startedState, textMatcherState, word, spans, all) {
editor.selection.collapse();
if (all) {
global$1.each(editor.dom.select('span.mce-spellchecker-word'), function (span) {
if (span.getAttribute('data-mce-word') === word) {
editor.dom.remove(span, true);
}
});
} else {
editor.dom.remove(spans, true);
}
checkIfFinished(editor, startedState, textMatcherState);
};
var finish = function (editor, startedState, textMatcherState) {
var bookmark = editor.selection.getBookmark();
getTextMatcher(editor, textMatcherState).reset();
editor.selection.moveToBookmark(bookmark);
textMatcherState.set(null);
if (startedState.get()) {
startedState.set(false);
fireSpellcheckEnd(editor);
return true;
}
};
var getElmIndex = function (elm) {
var value = elm.getAttribute('data-mce-index');
if (typeof value === 'number') {
return '' + value;
}
return value;
};
var findSpansByIndex = function (editor, index) {
var nodes;
var spans = [];
nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
if (nodes.length) {
for (var i = 0; i < nodes.length; i++) {
var nodeIndex = getElmIndex(nodes[i]);
if (nodeIndex === null || !nodeIndex.length) {
continue;
}
if (nodeIndex === index.toString()) {
spans.push(nodes[i]);
}
}
}
return spans;
};
var markErrors = function (editor, startedState, textMatcherState, lastSuggestionsState, data) {
var hasDictionarySupport = !!data.dictionary;
var suggestions = data.words;
editor.setProgressState(false);
if (isEmpty(suggestions)) {
var message = editor.translate('No misspellings found.');
editor.notificationManager.open({
text: message,
type: 'info'
});
startedState.set(false);
return;
}
lastSuggestionsState.set({
suggestions: suggestions,
hasDictionarySupport: hasDictionarySupport
});
var bookmark = editor.selection.getBookmark();
getTextMatcher(editor, textMatcherState).find(getSpellcheckerWordcharPattern(editor)).filter(function (match) {
return !!suggestions[match.text];
}).wrap(function (match) {
return editor.dom.create('span', {
'class': 'mce-spellchecker-word',
'aria-invalid': 'spelling',
'data-mce-bogus': 1,
'data-mce-word': match.text
});
});
editor.selection.moveToBookmark(bookmark);
startedState.set(true);
fireSpellcheckStart(editor);
};
var get = function (editor, startedState, lastSuggestionsState, textMatcherState, currentLanguageState, _url) {
var getLanguage = function () {
return currentLanguageState.get();
};
var getWordCharPattern = function () {
return getSpellcheckerWordcharPattern(editor);
};
var markErrors$1 = function (data) {
markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data);
};
var getTextMatcher = function () {
return textMatcherState.get();
};
return {
getTextMatcher: getTextMatcher,
getWordCharPattern: getWordCharPattern,
markErrors: markErrors$1,
getLanguage: getLanguage
};
};
var register = function (editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState) {
editor.addCommand('mceSpellCheck', function () {
spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState);
});
};
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var spellcheckerEvents = 'SpellcheckStart SpellcheckEnd';
var buildMenuItems = function (listName, languageValues) {
var items = [];
global$1.each(languageValues, function (languageValue) {
items.push({
selectable: true,
text: languageValue.name,
data: languageValue.value
});
});
return items;
};
var getItems = function (editor) {
return global$1.map(getLanguages(editor).split(','), function (langPair) {
langPair = langPair.split('=');
return {
name: langPair[0],
value: langPair[1]
};
});
};
var register$1 = function (editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState) {
var languageMenuItems = buildMenuItems('Language', getItems(editor));
var startSpellchecking = function () {
spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState);
};
var buttonArgs = {
tooltip: 'Spellcheck',
onAction: startSpellchecking,
icon: 'spell-check',
onSetup: function (buttonApi) {
var setButtonState = function () {
buttonApi.setActive(startedState.get());
};
editor.on(spellcheckerEvents, setButtonState);
return function () {
editor.off(spellcheckerEvents, setButtonState);
};
}
};
var splitButtonArgs = __assign(__assign({}, buttonArgs), {
type: 'splitbutton',
select: function (value) {
return value === currentLanguageState.get();
},
fetch: function (callback) {
var items = global$1.map(languageMenuItems, function (languageItem) {
return {
type: 'choiceitem',
value: languageItem.data,
text: languageItem.text
};
});
callback(items);
},
onItemAction: function (splitButtonApi, value) {
currentLanguageState.set(value);
}
});
if (languageMenuItems.length > 1) {
editor.ui.registry.addSplitButton('spellchecker', splitButtonArgs);
} else {
editor.ui.registry.addToggleButton('spellchecker', buttonArgs);
}
editor.ui.registry.addToggleMenuItem('spellchecker', {
text: 'Spellcheck',
icon: 'spell-check',
onSetup: function (menuApi) {
menuApi.setActive(startedState.get());
var setMenuItemCheck = function () {
menuApi.setActive(startedState.get());
};
editor.on(spellcheckerEvents, setMenuItemCheck);
return function () {
editor.off(spellcheckerEvents, setMenuItemCheck);
};
},
onAction: startSpellchecking
});
};
var ignoreAll = true;
var getSuggestions = function (editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState, word, spans) {
var items = [];
var suggestions = lastSuggestionsState.get().suggestions[word];
global$1.each(suggestions, function (suggestion) {
items.push({
text: suggestion,
onAction: function () {
editor.insertContent(editor.dom.encode(suggestion));
editor.dom.remove(spans);
checkIfFinished(editor, startedState, textMatcherState);
}
});
});
var hasDictionarySupport = lastSuggestionsState.get().hasDictionarySupport;
if (hasDictionarySupport) {
items.push({ type: 'separator' });
items.push({
text: 'Add to dictionary',
onAction: function () {
addToDictionary(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, word, spans);
}
});
}
items.push.apply(items, [
{ type: 'separator' },
{
text: 'Ignore',
onAction: function () {
ignoreWord(editor, startedState, textMatcherState, word, spans);
}
},
{
text: 'Ignore all',
onAction: function () {
ignoreWord(editor, startedState, textMatcherState, word, spans, ignoreAll);
}
}
]);
return items;
};
var setup = function (editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState) {
var update = function (element) {
var target = element;
if (target.className === 'mce-spellchecker-word') {
var spans = findSpansByIndex(editor, getElmIndex(target));
if (spans.length > 0) {
var rng = editor.dom.createRng();
rng.setStartBefore(spans[0]);
rng.setEndAfter(spans[spans.length - 1]);
editor.selection.setRng(rng);
return getSuggestions(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState, target.getAttribute('data-mce-word'), spans);
}
} else {
return [];
}
};
editor.ui.registry.addContextMenu('spellchecker', { update: update });
};
function Plugin () {
global.add('spellchecker', function (editor, pluginUrl) {
if (hasProPlugin(editor) === false) {
var startedState = Cell(false);
var currentLanguageState = Cell(getLanguage(editor));
var textMatcherState = Cell(null);
var lastSuggestionsState = Cell(null);
register$1(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState);
setup(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState);
register(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState);
return get(editor, startedState, lastSuggestionsState, textMatcherState, currentLanguageState);
}
});
}
Plugin();
}(window));
|
{
"pile_set_name": "Github"
}
|
gcr.io/google_containers/kube-addon-manager-arm64:v2
|
{
"pile_set_name": "Github"
}
|
#include "../../../rexlib/inc/compiler.h"
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.