text
stringlengths 2
14k
| meta
dict |
|---|---|
<?xml version="1.0" encoding="UTF-8"?>
<segment>
<name>PD1</name>
<description>Patient Additional Demographic</description>
<elements>
<field minOccurs="0" maxOccurs="0">
<name>PD1.1</name>
<description>Living Dependency</description>
<datatype>IS</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.2</name>
<description>Living Arrangement</description>
<datatype>IS</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.3</name>
<description>Patient Primary Facility</description>
<datatype>XON</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.4</name>
<description>Patient Primary Care Provider Name & ID No.</description>
<datatype>XCN</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.5</name>
<description>Student Indicator</description>
<datatype>IS</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.6</name>
<description>Handicap</description>
<datatype>IS</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.7</name>
<description>Living Will Code</description>
<datatype>IS</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.8</name>
<description>Organ Donor Code</description>
<datatype>IS</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.9</name>
<description>Separate Bill</description>
<datatype>ID</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.10</name>
<description>Duplicate Patient</description>
<datatype>CX</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.11</name>
<description>Publicity Code</description>
<datatype>CE</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.12</name>
<description>Protection Indicator</description>
<datatype>ID</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.13</name>
<description>Protection Indicator Effective Date</description>
<datatype>DT</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.14</name>
<description>Place of Worship</description>
<datatype>XON</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.15</name>
<description>Advance Directive Code</description>
<datatype>CE</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.16</name>
<description>Immunization Registry Status</description>
<datatype>IS</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.17</name>
<description>Immunization Registry Status Effective Date</description>
<datatype>DT</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.18</name>
<description>Publicity Code Effective Date</description>
<datatype>DT</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.19</name>
<description>Military Branch</description>
<datatype>IS</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.20</name>
<description>Military Rank/Grade</description>
<datatype>IS</datatype>
</field>
<field minOccurs="0" maxOccurs="0">
<name>PD1.21</name>
<description>Military Status</description>
<datatype>IS</datatype>
</field>
</elements>
</segment>
|
{
"pile_set_name": "Github"
}
|
{
"fpsLimit": 60,
"preset": "basic",
"background": {
"color": "#0d47a1",
"image": "",
"position": "50% 50%",
"repeat": "no-repeat",
"size": "cover"
}
}
|
{
"pile_set_name": "Github"
}
|
The two classes `KinesisRecorder` and `KinesisFirehoseRecorder` allow you to interface with Amazon Kinesis Data Streams and Amazon Kinesis Data Firehose to stream analytics data for real-time processing.
## What is Amazon Kinesis Data Streams?
[Amazon Kinesis Data Streams](http://aws.amazon.com/kinesis/) is a fully managed service for real-time processing of streaming data at massive scale. Amazon Kinesis can collect and process hundreds of terabytes of data per hour from hundreds of thousands of sources, so you can write applications that process information in real-time. With Amazon Kinesis applications, you can build real-time dashboards, capture exceptions and generate alerts, drive recommendations, and make other real-time business or operational decisions. You can also easily send data to other services such as Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Redshift.
The Kinesis Data Streams `KinesisRecorder` client lets you store your Kinesis requests on disk and then send them all at once using the [PutRecords](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecords.html) API call of Kinesis. This is useful because many mobile applications that use Kinesis Data Streams will create multiple requests per second. Sending an individual request under `PutRecord` action could adversely impact battery life. Moreover, the requests could be lost if the device goes offline. Thus, using the high-level Kinesis Data Streams client for batching can preserve both battery life and data.
## What is Amazon Kinesis Data Firehose?
[Amazon Kinesis Data Firehose](http://aws.amazon.com/kinesis/firehose/) is a fully managed service for delivering real-time streaming data to destinations such as Amazon Simple Storage Service (Amazon S3) and Amazon Redshift. With Kinesis Data Firehose, you do not need to write any applications or manage any resources. You configure your data producers to send data to Firehose and it automatically delivers the data to the destination that you specified.
The Amazon Kinesis Data Firehose `KinesisFirehoseRecorder` client lets you store your Kinesis Data Firehose requests on disk and then send them using the [PutRecordBatch](https://docs.aws.amazon.com/firehose/latest/APIReference/API_PutRecordBatch.html) API call of Kinesis Data Firehose.
For more information about Amazon Kinesis Data Firehose, see [Amazon Kinesis Data Firehose](http://docs.aws.amazon.com/firehose/latest/dev/what-is-this-service.html).
## Integrating Amazon Kinesis
Set up AWS Mobile SDK components by including the following libraries in your `app/build.gradle` dependencies list.
```groovy
dependencies {
implementation 'com.amazonaws:aws-android-sdk-kinesis:2.15.+'
implementation ('com.amazonaws:aws-android-sdk-mobile-client:2.15.+@aar') { transitive = true }
}
```
* `aws-android-sdk-kinesis` library enables sending analytics to Amazon Kinesis.
* `aws-android-sdk-mobile-client` library gives access to the AWS credentials provider and configurations.
Add the following imports to the main activity of your app.
```java
import com.amazonaws.mobileconnectors.kinesis.kinesisrecorder.*;
import com.amazonaws.mobile.client.AWSMobileClient;
import com.amazonaws.regions.Regions;
```
To use Kinesis Data Streams in an application, you must set the correct permissions. The following IAM policy allows the user to submit records to a specific data stream, which is identified by [ARN](http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
```json
{
"Statement": [{
"Effect": "Allow",
"Action": "kinesis:PutRecords",
"Resource": "arn:aws:kinesis:us-west-2:111122223333:stream/mystream"
}]
}
```
The following IAM policy allows the user to submit records to a specific Kinesis Data Firehose delivery stream.
```json
{
"Statement": [{
"Effect": "Allow",
"Action": "firehose:PutRecordBatch",
"Resource": "arn:aws:firehose:us-west-2:111122223333:deliverystream/mystream"
}]
}
```
This policy should be applied to roles assigned to the Amazon Cognito identity pool, but you need to replace the `Resource` value with the correct ARN for your Amazon Kinesis or Amazon Kinesis Data Firehose stream. You can apply policies at the [IAM console](https://console.aws.amazon.com/iam/). To learn more about IAM policies, see [Using IAM](http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_Introduction.html).
To learn more about Amazon Kinesis Data Streams policies, see [Controlling Access to Amazon Kinesis Data Streams Resources with IAM](http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-iam.html).
To learn more about Amazon Kinesis Data Firehose policies, see [Controlling Access with Amazon Kinesis Data Firehose](http://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html).
## Working with the API
You can use `AWSMobileClient` to setup the Cognito credentials that are required to authenticate your requests with Amazon Kinesis.
```java
AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() {
@Override
public void onResult(UserStateDetails userStateDetails) {
Log.i("INIT", userStateDetails.getUserState().toString());
}
@Override
public void onError(Exception e) {
Log.e("INIT", "Initialization error.", e);
}
}
);
```
Once you have credentials, you can use `KinesisRecorder` with Amazon Kinesis. The following snippet creates a directory and instantiates the `KinesisRecorder` client:
```java
String kinesisDirectory = "YOUR_UNIQUE_DIRECTORY";
KinesisRecorder recorder = new KinesisRecorder(
myActivity.getDir(kinesisDirectory, 0),
Regions.<YOUR-AWS-REGION>,
AWSMobileClient.getInstance()
);
// KinesisRecorder uses synchronous calls, so you shouldn't call KinesisRecorder methods on the main thread.
```
To use `KinesisFirehoseRecorder`, you need to pass the object in a directory where streaming data is saved. We recommend you use an app private directory because the data is not encrypted.
```java
KinesisFirehoseRecorder firehoseRecorder = new KinesisFirehoseRecorder(
context.getCachedDir(),
Regions.<YOUR-AWS-REGION>,
AWSMobileClient.getInstance());
```
Configure Kinesis:
You can configure `KinesisRecorder` or `KinesisFirehoseRecorder` through their properties:
You can configure the maximum allowed storage via the `withMaxStorageSize()` method of `KinesisRecorderConfig`.
You can retrieve the same information by getting the `KinesisRecorderConfig` object for the recorder and calling `getMaxStorageSize():`
```java
KinesisRecorderConfig kinesisRecorderConfig = recorder.getKinesisRecorderConfig();
Long maxStorageSize = kinesisRecorderConfig.getMaxStorageSize();
// Do something with maxStorageSize
```
To check the number of bytes currently stored in the directory passed in to the `KinesisRecorder` constructor, call `getDiskBytesUsed()`:
```java
Long bytesUsed = recorder.getDiskBytesUsed();
// Do something with bytesUsed
```
To see how much space the `KinesisRecorder` client is allowed to use, you can call `getDiskByteLimit()`.
```java
Long byteLimit = recorder.getDiskByteLimit();
// Do something with byteLimit
```
With `KinesisRecorder` created and configured, you can use `saveRecord()` to save records and then send them in a batch.
```java
recorder.saveRecord(
"MyData".getBytes(),
"MyStreamName");
recorder.submitAllRecords();
```
For the `saveRecord
|
{
"pile_set_name": "Github"
}
|
///
/// Copyright (c) 2016 Dropbox, Inc. All rights reserved.
///
/// Auto-generated by Stone, do not modify.
///
#import <Foundation/Foundation.h>
#import "DBSerializableProtocol.h"
@class DBTEAMPOLICIESSharedFolderJoinPolicy;
NS_ASSUME_NONNULL_BEGIN
#pragma mark - API Object
///
/// The `SharedFolderJoinPolicy` union.
///
/// Policy governing which shared folders a team member can join.
///
/// This class implements the `DBSerializable` protocol (serialize and
/// deserialize instance methods), which is required for all Obj-C SDK API route
/// objects.
///
@interface DBTEAMPOLICIESSharedFolderJoinPolicy : NSObject <DBSerializable, NSCopying>
#pragma mark - Instance fields
/// The `DBTEAMPOLICIESSharedFolderJoinPolicyTag` enum type represents the
/// possible tag states with which the `DBTEAMPOLICIESSharedFolderJoinPolicy`
/// union can exist.
typedef NS_CLOSED_ENUM(NSInteger, DBTEAMPOLICIESSharedFolderJoinPolicyTag){
/// Team members can only join folders shared by teammates.
DBTEAMPOLICIESSharedFolderJoinPolicyFromTeamOnly,
/// Team members can join any shared folder, including those shared by users
/// outside the team.
DBTEAMPOLICIESSharedFolderJoinPolicyFromAnyone,
/// (no description).
DBTEAMPOLICIESSharedFolderJoinPolicyOther,
};
/// Represents the union's current tag state.
@property (nonatomic, readonly) DBTEAMPOLICIESSharedFolderJoinPolicyTag tag;
#pragma mark - Constructors
///
/// Initializes union class with tag state of "from_team_only".
///
/// Description of the "from_team_only" tag state: Team members can only join
/// folders shared by teammates.
///
/// @return An initialized instance.
///
- (instancetype)initWithFromTeamOnly;
///
/// Initializes union class with tag state of "from_anyone".
///
/// Description of the "from_anyone" tag state: Team members can join any shared
/// folder, including those shared by users outside the team.
///
/// @return An initialized instance.
///
- (instancetype)initWithFromAnyone;
///
/// Initializes union class with tag state of "other".
///
/// @return An initialized instance.
///
- (instancetype)initWithOther;
- (instancetype)init NS_UNAVAILABLE;
#pragma mark - Tag state methods
///
/// Retrieves whether the union's current tag state has value "from_team_only".
///
/// @return Whether the union's current tag state has value "from_team_only".
///
- (BOOL)isFromTeamOnly;
///
/// Retrieves whether the union's current tag state has value "from_anyone".
///
/// @return Whether the union's current tag state has value "from_anyone".
///
- (BOOL)isFromAnyone;
///
/// Retrieves whether the union's current tag state has value "other".
///
/// @return Whether the union's current tag state has value "other".
///
- (BOOL)isOther;
///
/// Retrieves string value of union's current tag state.
///
/// @return A human-readable string representing the union's current tag state.
///
- (NSString *)tagName;
@end
#pragma mark - Serializer Object
///
/// The serialization class for the `DBTEAMPOLICIESSharedFolderJoinPolicy`
/// union.
///
@interface DBTEAMPOLICIESSharedFolderJoinPolicySerializer : NSObject
///
/// Serializes `DBTEAMPOLICIESSharedFolderJoinPolicy` instances.
///
/// @param instance An instance of the `DBTEAMPOLICIESSharedFolderJoinPolicy`
/// API object.
///
/// @return A json-compatible dictionary representation of the
/// `DBTEAMPOLICIESSharedFolderJoinPolicy` API object.
///
+ (nullable NSDictionary<NSString *, id> *)serialize:(DBTEAMPOLICIESSharedFolderJoinPolicy *)instance;
///
/// Deserializes `DBTEAMPOLICIESSharedFolderJoinPolicy` instances.
///
/// @param dict A json-compatible dictionary representation of the
/// `DBTEAMPOLICIESSharedFolderJoinPolicy` API object.
///
/// @return An instantiation of the `DBTEAMPOLICIESSharedFolderJoinPolicy`
/// object.
///
+ (DBTEAMPOLICIESSharedFolderJoinPolicy *)deserialize:(NSDictionary<NSString *, id> *)dict;
@end
NS_ASSUME_NONNULL_END
|
{
"pile_set_name": "Github"
}
|
/***********************************************************************
!!!!!! DO NOT MODIFY !!!!!!
GacGen.exe Resource.xml
This file is generated by Workflow compiler
https://github.com/vczh-libraries
***********************************************************************/
#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMOREFLECTION
#define VCZH_WORKFLOW_COMPILER_GENERATED_DEMOREFLECTION
#include "Demo.h"
#ifndef VCZH_DEBUG_NO_REFLECTION
#include "GacUIReflection.h"
#endif
#if defined( _MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wparentheses-equality"
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif
/***********************************************************************
Reflection
***********************************************************************/
namespace vl
{
namespace reflection
{
namespace description
{
#ifndef VCZH_DEBUG_NO_REFLECTION
DECL_TYPE_INFO(::demo::MainWindow)
DECL_TYPE_INFO(::demo::MainWindowConstructor)
#endif
extern bool LoadDemoTypes();
}
}
}
#if defined( _MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(__clang__)
#pragma clang diagnostic pop
#endif
#endif
|
{
"pile_set_name": "Github"
}
|
abcdef abc def hij
klm nop qrs
abcdef abc def hij
tuv wxy z
|
{
"pile_set_name": "Github"
}
|
cask "font-cormorant-sc" do
version :latest
sha256 :no_check
# github.com/google/fonts/ was verified as official when first introduced to the cask
url "https://github.com/google/fonts/trunk/ofl/cormorantsc",
using: :svn,
trust_cert: true
name "Cormorant SC"
homepage "https://fonts.google.com/specimen/Cormorant+SC"
font "CormorantSC-Bold.ttf"
font "CormorantSC-Light.ttf"
font "CormorantSC-Medium.ttf"
font "CormorantSC-Regular.ttf"
font "CormorantSC-SemiBold.ttf"
end
|
{
"pile_set_name": "Github"
}
|
@comment $NetBSD: PLIST,v 1.5 2017/06/21 08:28:43 markd Exp $
share/texmf-dist/scripts/luaotfload/luaotfload-tool.lua
share/texmf-dist/scripts/luaotfload/mkcharacters
share/texmf-dist/scripts/luaotfload/mkglyphlist
share/texmf-dist/scripts/luaotfload/mkimport
share/texmf-dist/scripts/luaotfload/mkstatus
share/texmf-dist/scripts/luaotfload/mktests
share/texmf-dist/tex/luatex/luaotfload/fontloader-2017-02-11.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-basics-gen.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-basics-nod.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-basics.tex
share/texmf-dist/tex/luatex/luaotfload/fontloader-data-con.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-afk.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-cff.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-cid.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-con.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-def.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-dsp.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-gbn.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-ini.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-lua.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-map.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-one.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-onr.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-osd.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-ota.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-otc.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-oti.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-otj.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-otl.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-oto.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-otr.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-ots.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-tfm.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-font-ttf.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-fonts-demo-vf-1.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-fonts-enc.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-fonts-ext.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-fonts-syn.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-fonts.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-fonts.tex
share/texmf-dist/tex/luatex/luaotfload/fontloader-l-boolean.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-l-file.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-l-function.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-l-io.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-l-lua.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-l-math.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-l-string.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-l-table.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-languages.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-languages.tex
share/texmf-dist/tex/luatex/luaotfload/fontloader-math.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-math.tex
share/texmf-dist/tex/luatex/luaotfload/fontloader-mplib.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-mplib.tex
share/texmf-dist/tex/luatex/luaotfload/fontloader-plain.tex
share/texmf-dist/tex/luatex/luaotfload/fontloader-preprocessor-test.tex
share/texmf-dist/tex/luatex/luaotfload/fontloader-preprocessor.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-preprocessor.tex
share/texmf-dist/tex/luatex/luaotfload/fontloader-reference.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-swiglib-test.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-swiglib-test.tex
share/texmf-dist/tex/luatex/luaotfload/fontloader-swiglib.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-swiglib.tex
share/texmf-dist/tex/luatex/luaotfload/fontloader-test.tex
share/texmf-dist/tex/luatex/luaotfload/fontloader-util-fil.lua
share/texmf-dist/tex/luatex/luaotfload/fontloader-util-str.lua
share/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua
share/texmf-dist/tex/luatex/luaotfload/luaotfload-blacklist.cnf
share/texmf-dist/tex/luatex/luaotfload/luaotfload-characters.lua
share/texmf-dist/tex/luatex/luaotfload/luaotfload-colors.lua
share/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua
share/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua
share/texmf-dist/tex/luatex/luaotfload/luaotfload-diagnostics.lua
share/texmf-dist/
|
{
"pile_set_name": "Github"
}
|
--- sandbox/linux/BUILD.gn.orig 2019-04-08 08:18:26 UTC
+++ sandbox/linux/BUILD.gn
@@ -12,12 +12,12 @@ if (is_android) {
}
declare_args() {
- compile_suid_client = is_linux
+ compile_suid_client = is_linux && !is_bsd
- compile_credentials = is_linux
+ compile_credentials = is_linux && !is_bsd
# On Android, use plain GTest.
- use_base_test_suite = is_linux
+ use_base_test_suite = is_linux && !is_bsd
}
if (is_nacl_nonsfi) {
@@ -379,7 +379,7 @@ component("sandbox_services") {
public_deps += [ ":sandbox_services_headers" ]
}
- if (is_nacl_nonsfi) {
+ if (is_nacl_nonsfi || is_bsd) {
cflags = [ "-fgnu-inline-asm" ]
sources -= [
@@ -387,6 +387,8 @@ component("sandbox_services") {
"services/init_process_reaper.h",
"services/scoped_process.cc",
"services/scoped_process.h",
+ "services/syscall_wrappers.cc",
+ "services/syscall_wrappers.h",
"services/yama.cc",
"services/yama.h",
"syscall_broker/broker_channel.cc",
@@ -405,6 +407,10 @@ component("sandbox_services") {
"syscall_broker/broker_process.h",
"syscall_broker/broker_simple_message.cc",
"syscall_broker/broker_simple_message.h",
+ ]
+ sources += [
+ "services/libc_interceptor.cc",
+ "services/libc_interceptor.h",
]
} else if (!is_android) {
sources += [
|
{
"pile_set_name": "Github"
}
|
--recursive
--require @babel/register
|
{
"pile_set_name": "Github"
}
|
<HTML><HEAD>
<TITLE>Invalid URL</TITLE>
</HEAD><BODY>
<H1>Invalid URL</H1>
The requested URL "[no URL]", is invalid.<p>
Reference #9.44952317.1507271057.135fad8
</BODY></HTML>
|
{
"pile_set_name": "Github"
}
|
var config = {
type: Phaser.AUTO,
parent: 'phaser-example',
width: 800,
height: 600,
scene: {
create: create
},
};
var game = new Phaser.Game(config);
function create() {
var graphics = this.add.graphics();
drawStar(graphics, 100, 300, 4, 50, 50 / 2, 0xffff00, 0xff0000);
drawStar(graphics, 400, 300, 5, 100, 100 / 2, 0xffff00, 0xff0000);
drawStar(graphics, 700, 300, 6, 50, 50 / 2, 0xffff00, 0xff0000);
}
function drawStar (graphics, cx, cy, spikes, outerRadius, innerRadius, color, lineColor)
{
var rot = Math.PI / 2 * 3;
var x = cx;
var y = cy;
var step = Math.PI / spikes;
graphics.lineStyle(4, lineColor, 1);
graphics.fillStyle(color, 1);
graphics.beginPath();
graphics.moveTo(cx, cy - outerRadius);
for (i = 0; i < spikes; i++)
{
x = cx + Math.cos(rot) * outerRadius;
y = cy + Math.sin(rot) * outerRadius;
graphics.lineTo(x, y);
rot += step;
x = cx + Math.cos(rot) * innerRadius;
y = cy + Math.sin(rot) * innerRadius;
graphics.lineTo(x, y);
rot += step;
}
graphics.lineTo(cx, cy - outerRadius);
graphics.closePath();
graphics.fillPath();
graphics.strokePath();
}
|
{
"pile_set_name": "Github"
}
|
.theme-dusk,.theme-midnight {
.hljs {
display: block;
overflow-x: auto;
background: #232323;
color: #e6e1dc;
}
.hljs-comment,
.hljs-quote {
color: #bc9458;
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag {
color: #c26230;
}
.hljs-string,
.hljs-number,
.hljs-regexp,
.hljs-variable,
.hljs-template-variable {
color: #a5c261;
}
.hljs-subst {
color: #519f50;
}
.hljs-tag,
.hljs-name {
color: #e8bf6a;
}
.hljs-type {
color: #da4939;
}
.hljs-symbol,
.hljs-bullet,
.hljs-built_in,
.hljs-builtin-name,
.hljs-attr,
.hljs-link {
color: #6d9cbe;
}
.hljs-params {
color: #d0d0ff;
}
.hljs-attribute {
color: #cda869;
}
.hljs-meta {
color: #9b859d;
}
.hljs-title,
.hljs-section {
color: #ffc66d;
}
.hljs-addition {
background-color: #144212;
color: #e6e1dc;
display: inline-block;
width: 100%;
}
.hljs-deletion {
background-color: #600;
color: #e6e1dc;
display: inline-block;
width: 100%;
}
.hljs-selector-class {
color: #9b703f;
}
.hljs-selector-id {
color: #8b98ab;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
.hljs-link {
text-decoration: underline;
}
}
|
{
"pile_set_name": "Github"
}
|
#ifndef CREATE_EMPTY_DIRECTED_GRAPH_WITH_GRAPH_NAME_H
#define CREATE_EMPTY_DIRECTED_GRAPH_WITH_GRAPH_NAME_H
#include <boost/graph/adjacency_list.hpp>
boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
boost::no_property, boost::no_property,
boost::property<boost::graph_name_t, std::string>>
create_empty_directed_graph_with_graph_name() noexcept;
#endif // CREATE_EMPTY_DIRECTED_GRAPH_WITH_GRAPH_NAME_H
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.stanbol.entityhub.web.reader;
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.ServletContext;
import javax.ws.rs.Consumes;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.ext.MessageBodyReader;
import javax.ws.rs.ext.Provider;
import org.apache.clerezza.commons.rdf.Graph;
import org.apache.clerezza.commons.rdf.BlankNodeOrIRI;
import org.apache.clerezza.commons.rdf.Triple;
import org.apache.clerezza.commons.rdf.IRI;
import org.apache.clerezza.rdf.core.serializedform.Parser;
import org.apache.clerezza.rdf.core.serializedform.SupportedFormat;
import org.apache.clerezza.rdf.core.serializedform.UnsupportedParsingFormatException;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.stanbol.commons.indexedgraph.IndexedGraph;
import org.apache.stanbol.entityhub.jersey.utils.JerseyUtils;
import org.apache.stanbol.entityhub.jersey.utils.MessageBodyReaderUtils;
import org.apache.stanbol.entityhub.jersey.utils.MessageBodyReaderUtils.RequestData;
import org.apache.stanbol.entityhub.model.clerezza.RdfValueFactory;
import org.apache.stanbol.entityhub.servicesapi.model.Representation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Provides support for reading Representation form Requests. This implementation
* supports all RDF supports as well as {@link MediaType#APPLICATION_FORM_URLENCODED}
* - in case the data are sent from an HTML form - and
* {@link MediaType#MULTIPART_FORM_DATA} - mime encoded data.
* In case of an HTML form the encoding need to be specified by the parameter
* "encoding" for the entity data the parameters "entity" or "content" can be
* used.
* @author Rupert Westenthaler
*
*/
@Component
@Service(Object.class)
@Property(name="javax.ws.rs", boolValue=true)
@Provider
@Consumes({ //First the data types directly supported for parsing representations
MediaType.APPLICATION_JSON, SupportedFormat.N3, SupportedFormat.N_TRIPLE,
SupportedFormat.RDF_XML, SupportedFormat.TURTLE, SupportedFormat.X_TURTLE,
SupportedFormat.RDF_JSON,
//finally this also supports sending the data as form and mime multipart
MediaType.APPLICATION_FORM_URLENCODED,
MediaType.MULTIPART_FORM_DATA})
public class RepresentationReader implements MessageBodyReader<Map<String,Representation>> {
private static final Logger log = LoggerFactory.getLogger(RepresentationReader.class);
public static final Set<String> supportedMediaTypes;
private static final MediaType DEFAULT_ACCEPTED_MEDIA_TYPE = MediaType.TEXT_PLAIN_TYPE;
static {
Set<String> types = new HashSet<String>();
//ensure everything is lower case
types.add(MediaType.APPLICATION_JSON.toLowerCase());
types.add(SupportedFormat.N3.toLowerCase());
types.add(SupportedFormat.N_TRIPLE.toLowerCase());
types.add(SupportedFormat.RDF_JSON.toLowerCase());
types.add(SupportedFormat.RDF_XML.toLowerCase());
types.add(SupportedFormat.TURTLE.toLowerCase());
types.add(SupportedFormat.X_TURTLE.toLowerCase());
supportedMediaTypes = Collections.unmodifiableSet(types);
}
@Reference
private Parser parser;
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
String mediaTypeWithoutParameter =
mediaType.getType().toLowerCase()+'/'+
mediaType.getSubtype().toLowerCase();
log.debug("isreadable: [genericType: {}| mediaType {}]",
genericType,mediaTypeWithoutParameter);
//second the media type
boolean mediaTypeOK = (//the MimeTypes of Representations
supportedMediaTypes.contains(mediaTypeWithoutParameter) ||
//as well as URL encoded
MediaType.APPLICATION_FORM_URLENCODED.equals(mediaTypeWithoutParameter) ||
//and mime multipart
MediaType.MULTIPART_FORM_DATA.equals(mediaTypeWithoutParameter));
boolean typeOk = JerseyUtils.testParameterizedType(Map.class,
new Class[]{String.class,Representation.class}, genericType);
log.debug("type is {} for {} against Map<String,Representation>",
typeOk ? "compatible" : "incompatible" ,genericType);
return typeOk && mediaTypeOK;
}
@Override
public Map<String,Representation> readFrom(Class<Map<String,Representation>> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String,String> httpHeaders,
InputStream entityStream) throws IOException, WebApplicationException {
log.info("Read Representations from Request Data");
long start = System.currentTimeMillis();
//(1) get the charset and the acceptedMediaType
String charset = "UTF-8";
if(mediaType.getParameters().containsKey("charset")){
charset = mediaType.getParameters().get("charset");
}
MediaType acceptedMediaType = getAcceptedMediaType(httpHeaders);
log.info("readFrom: mediaType {} | accepted {} | charset {}",
new Object[]{mediaType,acceptedMediaType,charset});
// (2) read the Content from the request (this needs to deal with
// MediaType.APPLICATION_FORM_URLENCODED_TYPE and
// MediaType.MULTIPART_FORM_DATA_TYPE requests!
RequestData content;
if(mediaType.isCompatible(MediaType.APPLICATION_FORM_URLENCODED_TYPE)) {
try {
content = MessageBodyReaderUtils.formForm(entityStream, charset,
"encoding",Arrays.asList("entity","content"));
} catch (IllegalArgumentException e) {
log.info("Bad Request: {}",e);
throw new WebApplicationException(
Response.status(Status.BAD_REQUEST).entity(e.toString()).
header(HttpHeaders.ACCEPT, acceptedMediaType).build());
}
if(content
|
{
"pile_set_name": "Github"
}
|
///
/// Massively by HTML5 UP
/// html5up.net | @ajlkn
/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
///
/* Wrapper */
#wrapper {
@include vendor('transition', 'opacity #{_duration(menu)} ease');
position: relative;
z-index: 1;
overflow: hidden;
> .bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: _palette(wrapper-bg);
background-image: url('../../images/overlay.png'), linear-gradient(0deg, rgba(0,0,0,0.1), rgba(0,0,0,0.1)), url('../../images/bg.jpg');
background-size: auto, auto, 100% auto;
background-position: center, center, top center;
background-repeat: repeat, no-repeat, no-repeat;
background-attachment: scroll, scroll, scroll;
z-index: -1;
&.fixed {
position: fixed;
width: 100vw;
height: 100vh;
}
}
&.fade-in {
&:before {
@include vendor('pointer-events', 'none');
@include vendor('transition', 'opacity 1s ease-in-out');
@include vendor('transition-delay', '0.75s');
background: _palette(invert, bg);
content: '';
display: block;
height: 100%;
left: 0;
opacity: 0;
position: fixed;
top: 0;
width: 100%;
}
body.is-loading & {
&:before {
opacity: 1;
}
}
}
@include orientation(portrait) {
> .bg {
background-size: auto, auto, auto 175%;
}
}
}
|
{
"pile_set_name": "Github"
}
|
# frozen_string_literal: true
require File.expand_path('lib/jekyll-last-modified-at/version.rb', __dir__)
Gem::Specification.new do |s|
s.name = 'jekyll-last-modified-at'
s.version = Jekyll::LastModifiedAt::VERSION
s.summary = 'A liquid tag for Jekyll to indicate the last time a file was modified.'
s.authors = 'Garen J. Torikian'
s.homepage = 'https://github.com/gjtorikian/jekyll-last-modified-at'
s.license = 'MIT'
s.files = Dir['lib/**/*.rb']
s.add_dependency 'jekyll', '>= 3.7', ' < 5.0'
s.add_dependency 'posix-spawn', '~> 0.3.9'
s.add_development_dependency 'rake'
s.add_development_dependency 'rspec', '~> 3.4'
s.add_development_dependency 'rubocop'
s.add_development_dependency 'rubocop-performance'
s.add_development_dependency 'rubocop-standard'
s.add_development_dependency 'spork'
end
|
{
"pile_set_name": "Github"
}
|
#if !defined(BOOST_PP_IS_ITERATING)
///// header body
#ifndef BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
#define BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
# include <boost/mpl/prior.hpp>
# include <boost/mpl/apply_wrap.hpp>
#endif
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER advance_backward.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#else
# include <boost/mpl/limits/unrolling.hpp>
# include <boost/mpl/aux_/nttp_decl.hpp>
# include <boost/mpl/aux_/config/eti.hpp>
# include <boost/preprocessor/iterate.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/inc.hpp>
namespace boost { namespace mpl { namespace aux {
// forward declaration
template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct advance_backward;
# define BOOST_PP_ITERATION_PARAMS_1 \
(3,(0, BOOST_MPL_LIMIT_UNROLLING, <boost/mpl/aux_/advance_backward.hpp>))
# include BOOST_PP_ITERATE()
// implementation for N that exceeds BOOST_MPL_LIMIT_UNROLLING
template< BOOST_MPL_AUX_NTTP_DECL(long, N) >
struct advance_backward
{
template< typename Iterator > struct apply
{
typedef typename apply_wrap1<
advance_backward<BOOST_MPL_LIMIT_UNROLLING>
, Iterator
>::type chunk_result_;
typedef typename apply_wrap1<
advance_backward<(
(N - BOOST_MPL_LIMIT_UNROLLING) < 0
? 0
: N - BOOST_MPL_LIMIT_UNROLLING
)>
, chunk_result_
>::type type;
};
};
}}}
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
///// iteration, depth == 1
// For gcc 4.4 compatability, we must include the
// BOOST_PP_ITERATION_DEPTH test inside an #else clause.
#else // BOOST_PP_IS_ITERATING
#if BOOST_PP_ITERATION_DEPTH() == 1
#define i_ BOOST_PP_FRAME_ITERATION(1)
template<>
struct advance_backward< BOOST_PP_FRAME_ITERATION(1) >
{
template< typename Iterator > struct apply
{
typedef Iterator iter0;
#if i_ > 0
# define BOOST_PP_ITERATION_PARAMS_2 \
(3,(1, BOOST_PP_FRAME_ITERATION(1), <boost/mpl/aux_/advance_backward.hpp>))
# include BOOST_PP_ITERATE()
#endif
typedef BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(1)) type;
};
#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
/// ETI workaround
template<> struct apply<int>
{
typedef int type;
};
#endif
};
#undef i_
///// iteration, depth == 2
#elif BOOST_PP_ITERATION_DEPTH() == 2
# define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
# define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
typedef typename prior<AUX778076_ITER_0>::type AUX778076_ITER_1;
# undef AUX778076_ITER_1
# undef AUX778076_ITER_0
#endif // BOOST_PP_ITERATION_DEPTH()
#endif // BOOST_PP_IS_ITERATING
|
{
"pile_set_name": "Github"
}
|
<UIView; frame = (0 0; 1112 834); autoresize = W+H; layer = <CALayer>>
| <UILabel; frame = (528.333 20; 55.6667 20.3333); text = 'What's'; userInteractionEnabled = NO; layer = <_UILabelLayer>>
| <UILabel; frame = (0 417; 25 20.3333); text = 'the'; userInteractionEnabled = NO; layer = <_UILabelLayer>>
| <UILabel; frame = (1073 417; 39 20.3333); text = 'point'; userInteractionEnabled = NO; layer = <_UILabelLayer>>
| <UILabel; frame = (552.333 816; 7.66667 18); text = '?'; userInteractionEnabled = NO; layer = <_UILabelLayer>>
|
{
"pile_set_name": "Github"
}
|
package x509util
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"testing"
)
func TestCreateCertificateRequest(t *testing.T) {
r := rand.Reader
priv, err := rsa.GenerateKey(r, 1024)
if err != nil {
t.Fatal(err)
}
template := CertificateRequest{
CertificateRequest: x509.CertificateRequest{
Subject: pkix.Name{
CommonName: "test.acme.co",
Country: []string{"US"},
},
},
ChallengePassword: "foobar",
}
derBytes, err := CreateCertificateRequest(r, &template, priv)
if err != nil {
t.Fatal(err)
}
out, err := x509.ParseCertificateRequest(derBytes)
if err != nil {
t.Fatalf("failed to create certificate request: %s", err)
}
if err := out.CheckSignature(); err != nil {
t.Errorf("failed to check certificate request signature: %s", err)
}
challenge, err := ParseChallengePassword(derBytes)
if err != nil {
t.Fatalf("failed to parse challengePassword attribute: %s", err)
}
if have, want := challenge, template.ChallengePassword; have != want {
t.Errorf("have %s, want %s", have, want)
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.vcs.impl
import com.intellij.ProjectTopics
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.components.service
import com.intellij.openapi.extensions.ExtensionNotApplicableException
import com.intellij.openapi.module.Module
import com.intellij.openapi.module.ModuleManager
import com.intellij.openapi.project.ModuleListener
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.rootManager
import com.intellij.openapi.roots.ModuleRootEvent
import com.intellij.openapi.roots.ModuleRootListener
import com.intellij.openapi.startup.StartupActivity
import com.intellij.openapi.vcs.AbstractVcs
import com.intellij.openapi.vcs.ProjectLevelVcsManager
import com.intellij.openapi.vcs.VcsDirectoryMapping
import com.intellij.openapi.vfs.VirtualFile
internal class ModuleVcsDetector(private val project: Project) {
private val vcsManager by lazy(LazyThreadSafetyMode.NONE) {
(ProjectLevelVcsManager.getInstance(project) as ProjectLevelVcsManagerImpl)
}
internal class MyPostStartUpActivity : StartupActivity.DumbAware {
init {
if (ApplicationManager.getApplication().isUnitTestMode) {
throw ExtensionNotApplicableException.INSTANCE
}
}
override fun runActivity(project: Project) {
val vcsDetector = project.service<ModuleVcsDetector>()
val listener = vcsDetector.MyModulesListener()
val busConnection = project.messageBus.connect()
busConnection.subscribe(ProjectTopics.MODULES, listener)
busConnection.subscribe(ProjectTopics.PROJECT_ROOTS, listener)
if (vcsDetector.vcsManager.needAutodetectMappings()) {
vcsDetector.autoDetectVcsMappings(true)
}
}
}
private inner class MyModulesListener : ModuleRootListener, ModuleListener {
private val myMappingsForRemovedModules: MutableList<VcsDirectoryMapping> = mutableListOf()
override fun beforeRootsChange(event: ModuleRootEvent) {
myMappingsForRemovedModules.clear()
}
override fun rootsChanged(event: ModuleRootEvent) {
myMappingsForRemovedModules.forEach { mapping -> vcsManager.removeDirectoryMapping(mapping) }
// the check calculates to true only before user has done any change to mappings, i.e. in case modules are detected/added automatically
// on start etc (look inside)
if (vcsManager.needAutodetectMappings()) {
autoDetectVcsMappings(false)
}
}
override fun moduleAdded(project: Project, module: Module) {
myMappingsForRemovedModules.removeAll(getMappings(module))
autoDetectModuleVcsMapping(module)
}
override fun beforeModuleRemoved(project: Project, module: Module) {
myMappingsForRemovedModules.addAll(getMappings(module))
}
}
private fun autoDetectVcsMappings(tryMapPieces: Boolean) {
if (vcsManager.haveDefaultMapping() != null) return
val usedVcses = mutableSetOf<AbstractVcs?>()
val detectedRoots = mutableSetOf<Pair<VirtualFile, AbstractVcs>>()
val roots = ModuleManager.getInstance(project).modules.flatMap { it.rootManager.contentRoots.asIterable() }.distinct()
for (root in roots) {
val moduleVcs = vcsManager.findVersioningVcs(root)
if (moduleVcs != null) {
detectedRoots.add(Pair(root, moduleVcs))
}
usedVcses.add(moduleVcs) // put 'null' for unmapped module
}
val commonVcs = usedVcses.singleOrNull()
if (commonVcs != null) {
// Remove existing mappings that will duplicate added <Project> mapping.
val rootPaths = roots.map { it.path }.toSet()
val additionalMappings = vcsManager.directoryMappings.filter { it.directory !in rootPaths }
vcsManager.setAutoDirectoryMappings(additionalMappings + VcsDirectoryMapping.createDefault(commonVcs.name))
}
else if (tryMapPieces) {
val newMappings = detectedRoots.map { (root, vcs) -> VcsDirectoryMapping(root.path, vcs.name) }
vcsManager.setAutoDirectoryMappings(vcsManager.directoryMappings + newMappings)
}
}
private fun autoDetectModuleVcsMapping(module: Module) {
if (vcsManager.haveDefaultMapping() != null) return
val newMappings = mutableListOf<VcsDirectoryMapping>()
for (file in module.rootManager.contentRoots) {
val vcs = vcsManager.findVersioningVcs(file)
if (vcs != null && vcs !== vcsManager.getVcsFor(file)) {
newMappings.add(VcsDirectoryMapping(file.path, vcs.name))
}
}
if (newMappings.isNotEmpty()) {
vcsManager.setAutoDirectoryMappings(vcsManager.directoryMappings + newMappings)
}
}
private fun getMappings(module: Module): List<VcsDirectoryMapping> {
return module.rootManager.contentRoots
.mapNotNull { root -> vcsManager.directoryMappings.firstOrNull { it.directory == root.path } }
}
}
|
{
"pile_set_name": "Github"
}
|
package io.gitlab.arturbosch.detekt.generator.collection
import io.gitlab.arturbosch.detekt.api.DetektVisitor
import io.gitlab.arturbosch.detekt.generator.collection.exception.InvalidDocumentationException
import io.gitlab.arturbosch.detekt.rules.isOverride
import org.jetbrains.kotlin.psi.KtCallExpression
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtProperty
import org.jetbrains.kotlin.psi.KtReferenceExpression
import org.jetbrains.kotlin.psi.KtSuperTypeList
import org.jetbrains.kotlin.psi.KtValueArgumentList
import org.jetbrains.kotlin.psi.psiUtil.containingClass
import org.jetbrains.kotlin.psi.psiUtil.referenceExpression
data class MultiRule(
val name: String,
val rules: List<String> = listOf()
) {
operator fun contains(ruleName: String) = ruleName in this.rules
}
private val multiRule = io.gitlab.arturbosch.detekt.api.MultiRule::class.simpleName ?: ""
class MultiRuleCollector : Collector<MultiRule> {
override val items = mutableListOf<MultiRule>()
override fun visit(file: KtFile) {
val visitor = MultiRuleVisitor()
file.accept(visitor)
if (visitor.containsMultiRule) {
items.add(visitor.getMultiRule())
}
}
}
class MultiRuleVisitor : DetektVisitor() {
val containsMultiRule
get() = classesMap.any { it.value }
private var classesMap = mutableMapOf<String, Boolean>()
private var name = ""
private val rulesVisitor = RuleListVisitor()
private val properties: MutableMap<String, String> = mutableMapOf()
fun getMultiRule(): MultiRule {
val rules = mutableListOf<String>()
val ruleProperties = rulesVisitor.ruleProperties
.mapNotNull { properties[it] }
rules.addAll(ruleProperties)
rules.addAll(rulesVisitor.ruleNames)
if (name.isEmpty()) {
throw InvalidDocumentationException("MultiRule without name found.")
}
if (rules.isEmpty()) {
throw InvalidDocumentationException("MultiRule $name contains no rules.")
}
return MultiRule(name, rules)
}
override fun visitSuperTypeList(list: KtSuperTypeList) {
val isMultiRule = list.entries
?.mapNotNull { it.typeAsUserType?.referencedName }
?.any { it == multiRule } ?: false
val containingClass = list.containingClass()
val className = containingClass?.name
if (containingClass != null && className != null && !classesMap.containsKey(className)) {
classesMap[className] = isMultiRule
}
super.visitSuperTypeList(list)
}
override fun visitClassOrObject(classOrObject: KtClassOrObject) {
super.visitClassOrObject(classOrObject)
if (classesMap[classOrObject.name] != true) {
return
}
name = classOrObject.name?.trim() ?: ""
}
override fun visitProperty(property: KtProperty) {
super.visitProperty(property)
if (classesMap[property.containingClass()?.name] != true) {
return
}
if (property.isOverride() && property.name != null && property.name == "rules") {
property.accept(rulesVisitor)
} else {
val name = property.name
val initializer = property.initializer?.referenceExpression()?.text
if (name != null && initializer != null) {
properties[name] = initializer
}
}
}
}
class RuleListVisitor : DetektVisitor() {
var ruleNames: MutableSet<String> = mutableSetOf()
private set
var ruleProperties: MutableSet<String> = mutableSetOf()
private set
override fun visitValueArgumentList(list: KtValueArgumentList) {
super.visitValueArgumentList(list)
val argumentExpressions = list.arguments.map { it.getArgumentExpression() }
// Call Expression = Constructor of rule
ruleNames.addAll(argumentExpressions
.filterIsInstance<KtCallExpression>()
.map { it.calleeExpression?.text ?: "" })
// Reference Expression = variable we need to search for
ruleProperties.addAll(argumentExpressions
.filterIsInstance<KtReferenceExpression>()
.map { it.text ?: "" })
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* ScriptDev2 is an extension for mangos providing enhanced features for
* area triggers, creatures, game objects, instances, items, and spells beyond
* the default database scripting in mangos.
*
* Copyright (C) 2006-2013 ScriptDev2 <http://www.scriptdev2.com/>
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* World of Warcraft, and all World of Warcraft or Warcraft art, images,
* and lore are copyrighted by Blizzard Entertainment, Inc.
*/
/**
* ScriptData
* SDName: bug_trio
* SD%Complete: 75
* SDComment: Summon Player spell NYI; Poison Cloud damage spell NYI; Timers need adjustments
* SDCategory: Temple of Ahn'Qiraj
* EndScriptData
*/
#include "precompiled.h"
#include "temple_of_ahnqiraj.h"
enum
{
// kri
SPELL_CLEAVE = 26350,
SPELL_TOXIC_VOLLEY = 25812,
SPELL_SUMMON_CLOUD = 26590, // summons 15933
// vem
SPELL_CHARGE = 26561,
SPELL_VENGEANCE = 25790,
SPELL_KNOCKBACK = 26027,
// yauj
SPELL_HEAL = 25807,
SPELL_FEAR = 26580,
NPC_YAUJ_BROOD = 15621
};
struct MANGOS_DLL_DECL boss_kriAI : public ScriptedAI
{
boss_kriAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
Reset();
}
ScriptedInstance* m_pInstance;
uint32 m_uiCleaveTimer;
uint32 m_uiToxicVolleyTimer;
void Reset() override
{
m_uiCleaveTimer = urand(4000, 8000);
m_uiToxicVolleyTimer = urand(6000, 12000);
}
void JustDied(Unit* /*pKiller*/) override
{
// poison cloud on death
DoCastSpellIfCan(m_creature, SPELL_SUMMON_CLOUD, CAST_TRIGGERED);
if (!m_pInstance)
{
return;
}
// If the other 2 bugs are still alive, make unlootable
if (m_pInstance->GetData(TYPE_BUG_TRIO) != DONE)
{
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
m_pInstance->SetData(TYPE_BUG_TRIO, SPECIAL);
}
}
void JustReachedHome() override
{
if (m_pInstance)
{
m_pInstance->SetData(TYPE_BUG_TRIO, FAIL);
}
}
void UpdateAI(const uint32 uiDiff) override
{
// Return since we have no target
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
{
return;
}
// Cleave_Timer
if (m_uiCleaveTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE) == CAST_OK)
{
m_uiCleaveTimer = urand(5000, 12000);
}
}
else
{ m_uiCleaveTimer -= uiDiff; }
// ToxicVolley_Timer
if (m_uiToxicVolleyTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_TOXIC_VOLLEY) == CAST_OK)
{
m_uiToxicVolleyTimer = urand(10000, 15000);
}
}
else
{ m_uiToxicVolleyTimer -= uiDiff; }
DoMeleeAttackIfReady();
}
};
struct MANGOS_DLL_DECL boss_vemAI : public ScriptedAI
{
boss_vemAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
Reset();
}
ScriptedInstance* m_pInstance;
uint32 m_uiChargeTimer;
uint32 m_uiKnockBackTimer;
void Reset() override
{
m_uiChargeTimer = urand(15000, 27000);
m_uiKnockBackTimer = urand(8000, 20000);
}
void JustDied(Unit* /*pKiller*/) override
{
// Enrage the other bugs
DoCastSpellIfCan(m_creature, SPELL_VENGEANCE, CAST_TRIGGERED);
if (!m_pInstance)
{
return;
}
// If the other 2 bugs are still alive, make unlootable
if (m_pInstance->GetData(TYPE_BUG_TRIO) != DONE)
{
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
m_pInstance->SetData(TYPE_BUG_TRIO, SPECIAL);
}
}
void JustReachedHome() override
{
if (m_pInstance)
{
m_pInstance->SetData(TYPE_BUG_TRIO, FAIL);
}
}
void UpdateAI(const uint32 uiDiff) override
{
// Return since we have no target
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
{
return;
}
// Charge_Timer
if (m_uiChargeTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
if (DoCastSpellIfCan(pTarget, SPELL_CHARGE) == CAST_OK)
{
m_uiChargeTimer = urand(8000, 16000);
}
}
}
else
{ m_uiChargeTimer -= uiDiff; }
// KnockBack_Timer
if (m_uiKnockBackTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_KNOCKBACK) == CAST_OK)
{
if (m_creature->GetThreatManager().getThreat(m_creature->getVictim()))
{
m_creature->GetThreatManager().modifyThreatPercent(m_creature->getVictim(), -80);
}
m_uiKnockBackTimer = urand(15000, 25000);
}
}
else
{ m_uiKnockBackTimer -= uiDiff; }
DoMeleeAttackIfReady();
}
};
struct MANGOS_DLL_DECL boss_yaujAI : public ScriptedAI
{
boss_yaujAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
Reset();
}
ScriptedInstance* m_pInstance;
uint32 m_uiHealTimer;
uint32 m_
|
{
"pile_set_name": "Github"
}
|
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1024m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
|
{
"pile_set_name": "Github"
}
|
<html>
<body>
<h1>Directory listing</h1>
<hr/>
<pre>
<a href="management-core-3.0.4-javadoc.jar">management-core-3.0.4-javadoc.jar</a>
<a href="management-core-3.0.4-javadoc.jar.md5">management-core-3.0.4-javadoc.jar.md5</a>
<a href="management-core-3.0.4-javadoc.jar.sha1">management-core-3.0.4-javadoc.jar.sha1</a>
<a href="management-core-3.0.4-sources.jar">management-core-3.0.4-sources.jar</a>
<a href="management-core-3.0.4-sources.jar.md5">management-core-3.0.4-sources.jar.md5</a>
<a href="management-core-3.0.4-sources.jar.sha1">management-core-3.0.4-sources.jar.sha1</a>
<a href="management-core-3.0.4.jar">management-core-3.0.4.jar</a>
<a href="management-core-3.0.4.jar.md5">management-core-3.0.4.jar.md5</a>
<a href="management-core-3.0.4.jar.sha1">management-core-3.0.4.jar.sha1</a>
<a href="management-core-3.0.4.pom">management-core-3.0.4.pom</a>
<a href="management-core-3.0.4.pom.md5">management-core-3.0.4.pom.md5</a>
<a href="management-core-3.0.4.pom.sha1">management-core-3.0.4.pom.sha1</a>
</pre>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
package tk.woppo.sunday.model;
import android.database.Cursor;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import java.util.HashMap;
import tk.woppo.sunday.dao.WeatherDataHelper;
import tk.woppo.sunday.dao.WeatherTodayDataHelper;
/**
* Created by Ho on 2014/7/4.
*/
public class WeatherTodayModel extends BaseModel {
private static final HashMap<String, WeatherTodayModel> CACHE = new HashMap<String, WeatherTodayModel>();
/** 城市ID */
@SerializedName("cityid")
public String id;
/** 城市名称 */
@SerializedName("city")
public String cityName;
/** 温度 */
public String temp;
/** 天气 */
public String weather;
/** 风向 */
@SerializedName("WD")
public String wind;
/** 风力 */
@SerializedName("WS")
public String ws;
/** 湿度 */
@SerializedName("SD")
public String sd;
/** 发布时间 */
public String time;
private static void addToCache(WeatherTodayModel model) {
CACHE.put(model.id, model);
}
private static WeatherTodayModel getFromCache(String id) {
return CACHE.get(id);
}
public static WeatherTodayModel fromJson(String json) {
return new Gson().fromJson(json, WeatherTodayModel.class);
}
public static WeatherTodayModel fromCursor(Cursor cursor) {
String id = cursor.getString(cursor.getColumnIndex(WeatherDataHelper.WeatherDBInfo.ID));
WeatherTodayModel model = getFromCache(id);
if (model != null) {
return model;
}
model = new Gson().fromJson(cursor.getString(cursor.getColumnIndex(WeatherTodayDataHelper.WeatherTodayDBInfo.JSON)), WeatherTodayModel.class);
addToCache(model);
return model;
}
public static class WeatherTodayRequestData {
public WeatherTodayModel weatherinfo;
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 "SimpleDBMissingParameterException.h"
@implementation SimpleDBMissingParameterException
@synthesize boxUsage;
-(id)initWithMessage:(NSString *)theMessage
{
if (self = [super initWithMessage:theMessage]) {
}
return self;
}
-(void)setPropertiesWithException:(AmazonServiceException *)theException
{
[super setPropertiesWithException:theException];
if ([theException.additionalFields valueForKey:@"BoxUsage"] != nil) {
self.boxUsage = [AmazonSDKUtil convertStringToNumber:[theException.additionalFields valueForKey:@"BoxUsage"]];
}
}
-(NSString *)description
{
NSMutableString *buffer = [[NSMutableString alloc] initWithCapacity:256];
[buffer appendString:@"{"];
[buffer appendString:[[[NSString alloc] initWithFormat:@"BoxUsage: %@,", boxUsage] autorelease]];
[buffer appendString:[super description]];
[buffer appendString:@"}"];
return [buffer autorelease];
}
-(void)dealloc
{
[boxUsage release];
[super dealloc];
}
@end
|
{
"pile_set_name": "Github"
}
|
<?php
/*
* 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.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\ORM\Internal\Hydration;
use Doctrine\DBAL\Connection;
/**
* Hydrator that produces flat, rectangular results of scalar data.
* The created result is almost the same as a regular SQL result set, except
* that column names are mapped to field names and data type conversions take place.
*
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
class ScalarHydrator extends AbstractHydrator
{
/** @override */
protected function _hydrateAll()
{
$result = array();
$cache = array();
while ($data = $this->_stmt->fetch(\PDO::FETCH_ASSOC)) {
$result[] = $this->_gatherScalarRowData($data, $cache);
}
return $result;
}
/** @override */
protected function _hydrateRow(array $data, array &$cache, array &$result)
{
$result[] = $this->_gatherScalarRowData($data, $cache);
}
}
|
{
"pile_set_name": "Github"
}
|
package network
// Copyright (c) Microsoft and contributors. 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.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// VpnSitesClient is the network Client
type VpnSitesClient struct {
BaseClient
}
// NewVpnSitesClient creates an instance of the VpnSitesClient client.
func NewVpnSitesClient(subscriptionID string) VpnSitesClient {
return NewVpnSitesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVpnSitesClientWithBaseURI creates an instance of the VpnSitesClient client.
func NewVpnSitesClientWithBaseURI(baseURI string, subscriptionID string) VpnSitesClient {
return VpnSitesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate creates a VpnSite resource if it doesn't exist else updates the existing VpnSite.
// Parameters:
// resourceGroupName - the resource group name of the VpnSite.
// vpnSiteName - the name of the VpnSite being created or updated.
// vpnSiteParameters - parameters supplied to create or update VpnSite.
func (client VpnSitesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (result VpnSitesCreateOrUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.CreateOrUpdate")
defer func() {
sc := -1
if result.Response() != nil {
sc = result.Response().StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
result, err = client.CreateOrUpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", result.Response(), "Failure sending request")
return
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client VpnSitesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vpnSiteName": autorest.Encode("path", vpnSiteName),
}
const APIVersion = "2018-10-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters),
autorest.WithJSON(vpnSiteParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client VpnSitesClient) CreateOrUpdateSender(req *http.Request) (future VpnSitesCreateOrUpdateFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client VpnSitesClient) CreateOrUpdateResponder(resp *http.Response) (result VpnSite, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete deletes a VpnSite.
// Parameters:
// resourceGroupName - the resource group name of the VpnSite.
// vpnSiteName - the name of the VpnSite being deleted.
func (client VpnSitesClient) Delete(ctx context.Context, resourceGroupName string, vpnSiteName string) (result VpnSitesDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.Delete")
defer func() {
sc := -1
if result.Response() != nil {
sc = result.Response().StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.DeletePreparer(ctx, resourceGroupName, vpnSiteName)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", nil, "Failure preparing request")
return
}
result, err = client.DeleteSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", result.Response(), "Failure sending request")
return
}
return
}
// DeletePreparer prepares the Delete request.
func (client VpnSitesClient) DeletePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vpnSiteName": autorest.Encode("path", vpnSiteName),
}
const APIVersion = "2018-10-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VpnSitesClient) DeleteSender(req *http.Request) (future VpnSitesDeleteFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender
|
{
"pile_set_name": "Github"
}
|
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
return (i == -1) ? 0 : n.length - i - 1;
}
function getVF(n, opt_precision) {
var v = opt_precision;
if (undefined === v) {
v = Math.min(getDecimals(n), 3);
}
var base = Math.pow(10, v);
var f = ((n * base) | 0) % base;
return {v: v, f: f};
}
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"Dinda",
"Dilolo"
],
"DAY": [
"Lumingu",
"Nkodya",
"Nd\u00e0ay\u00e0",
"Ndang\u00f9",
"Nj\u00f2wa",
"Ng\u00f2vya",
"Lubingu"
],
"MONTH": [
"Ciongo",
"L\u00f9ishi",
"Lus\u00f2lo",
"M\u00f9uy\u00e0",
"Lum\u00f9ng\u00f9l\u00f9",
"Lufuimi",
"Kab\u00e0l\u00e0sh\u00ecp\u00f9",
"L\u00f9sh\u00eck\u00e0",
"Lutongolo",
"Lung\u00f9di",
"Kasw\u00e8k\u00e8s\u00e8",
"Cisw\u00e0"
],
"SHORTDAY": [
"Lum",
"Nko",
"Ndy",
"Ndg",
"Njw",
"Ngv",
"Lub"
],
"SHORTMONTH": [
"Cio",
"Lui",
"Lus",
"Muu",
"Lum",
"Luf",
"Kab",
"Lush",
"Lut",
"Lun",
"Kas",
"Cis"
],
"fullDate": "EEEE d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y HH:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss",
"short": "d/M/y HH:mm",
"shortDate": "d/M/y",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "FrCD",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a4",
"posPre": "",
"posSuf": "\u00a4"
}
]
},
"id": "lu-cd",
"pluralCat": function (n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
|
{
"pile_set_name": "Github"
}
|
package com.android.inputmethodcommon;
class InputMethodSettingsInterface {
}
class InputMethodSettingsImpl {
int mContext;
int mImi;
int mImm;
int mSubtypeEnablerIcon;
int mSubtypeEnablerIconRes;
int mSubtypeEnablerTitle;
int mSubtypeEnablerTitleRes;
int mInputMethodSettingsCategoryTitle;
int mInputMethodSettingsCategoryTitleRes;
int mSubtypeEnablerPreference;
}
class InputMethodSettingsFragment {
int mSettings;
}
class InputMethodSettingsActivity {
int mSettings;
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/appBackground"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingBottom="15dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="15dp">
<ImageView
android:id="@+id/song_item_img"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_weight="0" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/song_item_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="#000"
android:textSize="16sp" />
<TextView
android:id="@+id/song_item_artist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="#989898"
android:textSize="14sp" />
</LinearLayout>
<ImageView
android:id="@+id/song_item_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_weight="0"
android:background="@drawable/unbounded_ripple"
android:foregroundTint="#434343"
android:padding="5dp"
android:src="@drawable/abc_ic_menu_moreoverflow_mtrl_alpha"
android:theme="@style/Theme.AppCompat.Light" />
</LinearLayout>
|
{
"pile_set_name": "Github"
}
|
/*#######################################################
* Copyright (c) 2014 Jeff Martin
* Copyright (c) 2015 Pedro Lafuente
* Copyright (c) 2017-2019 Gregor Santner
*
* Licensed under the MIT license.
* You can get a copy of the license text here:
* https://opensource.org/licenses/MIT
###########################################################*/
package other.writeily.ui;
import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.text.TextUtils;
import net.gsantner.markor.R;
import net.gsantner.markor.util.AppSettings;
import java.io.Serializable;
public class WrConfirmDialog extends DialogFragment {
public static final String FRAGMENT_TAG = "WrConfirmDialog";
private static final String EXTRA_TITLE = "EXTRA_TITLE";
private static final String EXTRA_MESSAGE = "EXTRA_MESSAGE";
public static final String EXTRA_DATA = "EXTRA_DATA";
private Serializable _data;
private ConfirmDialogCallback[] _callbacks;
private String _summary;
public static WrConfirmDialog newInstance(String title, String message,
Serializable data, ConfirmDialogCallback... callbacks) {
WrConfirmDialog confirmDialog = new WrConfirmDialog();
Bundle args = new Bundle();
args.putSerializable(EXTRA_DATA, data);
args.putString(EXTRA_TITLE, title);
args.putString(EXTRA_MESSAGE, message);
confirmDialog.setArguments(args);
confirmDialog.setCallbacks(callbacks);
return confirmDialog;
}
public void setCallbacks(ConfirmDialogCallback[] callbacks) {
_callbacks = callbacks;
}
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
String title = getArguments().getString(EXTRA_TITLE);
String message = getArguments().getString(EXTRA_MESSAGE);
_data = getArguments().getSerializable(EXTRA_DATA);
AlertDialog.Builder dialogBuilder;
boolean darkTheme = AppSettings.get().isDarkThemeEnabled();
dialogBuilder = new AlertDialog.Builder(getActivity(), darkTheme ?
R.style.Theme_AppCompat_Dialog : R.style.Theme_AppCompat_Light_Dialog);
dialogBuilder.setTitle(title);
if (!TextUtils.isEmpty(message)) {
dialogBuilder.setMessage(message);
}
dialogBuilder.setPositiveButton(getString(android.R.string.ok), (dialog, which) -> {
if (_callbacks != null) {
for (ConfirmDialogCallback cdc : _callbacks) {
if (cdc != null) {
cdc.onConfirmDialogAnswer(true, _data);
}
}
}
});
dialogBuilder.setNegativeButton(getString(R.string.cancel), (dialog, which) -> {
dialog.dismiss();
for (ConfirmDialogCallback cdc : _callbacks) {
cdc.onConfirmDialogAnswer(false, _data);
}
});
return dialogBuilder.show();
}
public interface ConfirmDialogCallback {
void onConfirmDialogAnswer(boolean confirmed, Serializable data);
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2004-present Facebook. All Rights Reserved.
#include "SamplingProfilerJniMethod.h"
#include <JavaScriptCore/JSProfilerPrivate.h>
#include <jschelpers/JSCHelpers.h>
#include <jni.h>
#include <string>
using namespace facebook::jni;
namespace facebook {
namespace react {
/* static */ jni::local_ref<SamplingProfilerJniMethod::jhybriddata>
SamplingProfilerJniMethod::initHybrid(jni::alias_ref<jclass>,
jlong javaScriptContext) {
return makeCxxInstance(javaScriptContext);
}
/* static */ void SamplingProfilerJniMethod::registerNatives() {
registerHybrid(
{makeNativeMethod("initHybrid", SamplingProfilerJniMethod::initHybrid),
makeNativeMethod("poke", SamplingProfilerJniMethod::poke)});
}
SamplingProfilerJniMethod::SamplingProfilerJniMethod(jlong javaScriptContext) {
context_ = reinterpret_cast<JSGlobalContextRef>(javaScriptContext);
}
void SamplingProfilerJniMethod::poke(
jni::alias_ref<JSPackagerClientResponder::javaobject> responder) {
if (!JSC_JSSamplingProfilerEnabled(context_)) {
responder->error("The JSSamplingProfiler is disabled. See this "
"https://fburl.com/u4lw7xeq for some help");
return;
}
JSValueRef jsResult = JSC_JSPokeSamplingProfiler(context_);
if (JSC_JSValueGetType(context_, jsResult) == kJSTypeNull) {
responder->respond("started");
} else {
JSStringRef resultStrRef = JSValueToStringCopy(context_, jsResult, nullptr);
size_t length = JSStringGetLength(resultStrRef);
char buffer[length + 1];
JSStringGetUTF8CString(resultStrRef, buffer, length + 1);
JSStringRelease(resultStrRef);
responder->respond(buffer);
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
def extractStartlingSurprisesAtEveryStep(item):
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
if 'bu bu jing xin' in item['tags']:
return buildReleaseMessageWithType(item, 'Bu Bu Jing Xin', vol, chp, frag=frag, postfix=postfix)
return False
|
{
"pile_set_name": "Github"
}
|
'use strict';
var dbm;
var type;
var seed;
/**
* We receive the dbmigrate dependency from dbmigrate initially.
* This enables us to not have to rely on NODE_PATH.
*/
exports.setup = function (options, seedLink) {
dbm = options.dbmigrate;
type = dbm.dataType;
seed = seedLink;
};
exports.up = function (db) {
return Promise.all([
db.runSql('UPDATE office SET name = \'Office of Brazil and Southern Cone (WHA/BSC)\' where name=\'Office of Brail and Southern Cone (WHA/BSC)\''),
db.runSql('UPDATE office SET name = \'U.S. Embassy La Paz\' where name=\'U.S. Embassy LaPaz\''),
]);
};
exports.down = function (db) {
return Promise.all([
db.runSql('UPDATE office SET name = \'Office of Brail and Southern Cone (WHA/BSC)\' where name=\'Office of Brazil and Southern Cone (WHA/BSC)\''),
db.runSql('UPDATE office SET name = \'U.S. Embassy LaPaz\' where name=\'U.S. Embassy La Paz\''),
]);
};
|
{
"pile_set_name": "Github"
}
|
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
mojom = "//url/mojo/url.mojom"
public_headers = [ "//url/gurl.h" ]
traits_headers = [ "//url/mojo/url_gurl_struct_traits.h" ]
deps = [
"//url",
]
type_mappings = [ "url.mojom.Url=GURL" ]
|
{
"pile_set_name": "Github"
}
|
require_relative '../../../spec_helper'
require 'cgi'
describe "CGI::QueryExtension#from" do
before :each do
ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD']
@cgi = CGI.new
end
after :each do
ENV['REQUEST_METHOD'] = @old_request_method
end
it "returns ENV['HTTP_FROM']" do
old_value, ENV['HTTP_FROM'] = ENV['HTTP_FROM'], "googlebot(at)googlebot.com"
begin
@cgi.from.should == "googlebot(at)googlebot.com"
ensure
ENV['HTTP_FROM'] = old_value
end
end
end
|
{
"pile_set_name": "Github"
}
|
package org.basex.query.func.validate;
import org.basex.query.*;
import org.basex.query.func.*;
import org.basex.query.value.item.*;
import org.basex.util.*;
/**
* Function implementation.
*
* @author BaseX Team 2005-20, BSD License
* @author Christian Gruen
*/
public final class ValidateXsdProcessor extends StandardFunc {
@Override
public Item item(final QueryContext qc, final InputInfo ii) {
return Str.get(ValidateXsd.IMPL[ValidateXsd.OFFSET + 1]);
}
}
|
{
"pile_set_name": "Github"
}
|
<html>
<head>
<title>Path test</title>
<style type="text/css">
.pixel {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
background: #000;
}
.red { background: red; }
.blue { background: blue; }
</style>
<script language="JavaScript" type="text/javascript">
// Dojo configuration
djConfig = {
isDebug: true
};
</script>
<script language="JavaScript" type="text/javascript"
src="../../dojo.js"></script>
<script language="JavaScript" type="text/javascript">
dojo.require("dojo.math.*");
function drawCurve(curve,steps,className) {
if(!className) className = "pixel";
if(!steps) steps = 100;
this.pixels = new Array(steps)
for(var i=0;i<steps;i++) {
var pt = curve.getValue(i/steps);
this.pixels[i] = document.createElement("div");
this.pixels[i].className = className;
this.pixels[i].style.left = pt[0];
this.pixels[i].style.top = pt[1];
document.body.appendChild(this.pixels[i]);
}
}
function init(){
var c = dojo.math.curves;
var p = new c.Path();
p.add(new c.Line([10,10], [100,100]), 5);
p.add(new c.Line([0,0], [20,0]), 2);
p.add(new c.CatmullRom([[0,0], [400,400], [200,200], [500,50]]), 50);
p.add(new c.Arc([0,0], [100,100]), 20);
p.add(new c.Arc([0,0], [100,100], true), 20);
drawCurve(p, 200, "pixel");
//drawCurve(new c.Line([0,250], [800,250]), 50, "pixel red");
//drawCurve(new c.Line([500,0], [500,600]), 50, "pixel red");
//drawCurve(new c.Arc([300,300], [700,200]), 50, "pixel");
//drawCurve(new c.Arc([200,200], [100,100], false), 50, "pixel blue");
}
dojo.addOnLoad(init);
</script>
</head>
<body>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
id: dsq-747531936
date: 2010-04-05T22:49:24.0000000-07:00
name: DonSleza4e
avatar: https://disqus.com/api/users/avatars/DonSleza4e.jpg
message: <p>Awesome<br>Integrated lib with my <a href="http://asp.net" rel="nofollow noopener" title="asp.net">asp.net</a> mvc project ^^</p>
|
{
"pile_set_name": "Github"
}
|
#include <bits/stdc++.h>
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define LET(x, a) __typeof(a) x(a)
#define foreach(it, v) for(LET(it, v.begin()); it != v.end(); it++)
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define __ freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define func __FUNCTION__
#define line __LINE__
using namespace std;
template<typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p){out<<'('<<p.fi<<", "<<p.se<<')'; return out;}
template<typename T>
ostream& operator<<(ostream& out, vector<T> const & v){
int l = v.size(); for(int i = 0; i < l-1; i++) out<<v[i]<<' '; if(l>0) out<<v[l-1]; return out;}
void tr(){cout << endl;}
template<typename S, typename ... Strings>
void tr(S x, const Strings&... rest){cout<<x<<' ';tr(rest...);}
const int N = 100100;
int n, p;
int l[N], r[N];
int main(){
sd2(n,p);
for(int i = 0; i < n; i++){
sd2(l[i], r[i]);
}
l[n] = l[0];
r[n] = r[0];
long double res = 0;
for(int i = 1; i <= n; i++){
long long v1 = (r[i]/p) - ((l[i]-1)/p);
long long v2 = (r[i-1]/p) - ((l[i-1]-1)/p);
long long l1 = r[i]-l[i]+1;
long long l2 = r[i-1]-l[i-1]+1;
long long t = (l1-v1)*(l2-v2);
long double p = (long double) t / (long double) (l1*l2);
p = 1.0f-p;
res += p*2000;
}
printf("%.9lf\n", (double)res);
return 0;
}
|
{
"pile_set_name": "Github"
}
|
// RUN: %clang_cc1 -emit-llvm -triple i386-apple-macosx10.7.2 < %s | FileCheck %s
// The preferred alignment for a long long on x86-32 is 8; make sure the
// alloca for x uses that alignment.
int test (long long x) {
return (int)x;
}
// CHECK-LABEL: define i32 @test
// CHECK: alloca i64, align 8
// Make sure we honor the aligned attribute.
struct X { int x,y,z,a; };
int test2(struct X x __attribute((aligned(16)))) {
return x.z;
}
// CHECK-LABEL: define i32 @test2
// CHECK: alloca %struct._Z1X, align 16
|
{
"pile_set_name": "Github"
}
|
export const environment = {
production: true
};
|
{
"pile_set_name": "Github"
}
|
import { Component, Inject, Input } from '@angular/core';
import { MediaObserver } from '@angular/flex-layout';
import { Observable } from 'rxjs';
import { map, startWith } from 'rxjs/operators';
import { API_BASE_URL } from '../../app.tokens';
import { Product } from '../../shared/services';
@Component({
selector: 'nga-product-suggestion',
styleUrls: [ './product-suggestion.component.scss' ],
templateUrl: './product-suggestion.component.html'
})
export class ProductSuggestionComponent {
@Input() products: Product[];
readonly columns$: Observable<number>;
readonly breakpointsToColumnsNumber = new Map([
[ 'xs', 2 ],
[ 'sm', 3 ],
[ 'md', 5 ],
[ 'lg', 2 ],
[ 'xl', 3 ],
]);
constructor(
@Inject(API_BASE_URL) private readonly baseUrl: string,
private readonly media: MediaObserver
) {
// If the initial screen size is xs ObservableMedia doesn't emit an event
// In the older versions of flex-layout we used ObservableMedia, which is deprecated.
// Use MediaObserver instead
this.columns$ = this.media.media$
.pipe(
map(mc => <number>this.breakpointsToColumnsNumber.get(mc.mqAlias)),
startWith(3)
);
}
urlFor(product: Product): string {
return `${this.baseUrl}/${product.imageUrl}`;
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android" >
<Button
android:id="@+id/btn_crash_restart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="重启App"
android:layout_alignParentTop="true"
/>
<TextView
android:id="@+id/tv_crash_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="false"
android:ellipsize="none"
android:gravity="left"
android:inputType="textMultiLine"
android:layout_below="@id/btn_crash_restart"
/>
</RelativeLayout>
|
{
"pile_set_name": "Github"
}
|
SET UTF-8
LANG tr
|
{
"pile_set_name": "Github"
}
|
f := function()
local l;
l := 0 * [1..6];
l[[1..3]] := 1;
end;
f();
Where();
WhereWithVars();
quit;
f:=function() if true = 1/0 then return 1; fi; return 2; end;;
f();
Where();
WhereWithVars();
quit;
f:=function() local x; if x then return 1; fi; return 2; end;;
f();
Where();
WhereWithVars();
quit;
f:=function() if 1 then return 1; fi; return 2; end;;
f();
Where();
WhereWithVars();
quit;
f:=function() if 1 < 0 then return 1; elif 1 then return 2; fi; return 3; end;;
f();
Where();
WhereWithVars();
quit;
f:=function() while 1 do return 1; od; return 2; end;;
f();
Where();
WhereWithVars();
quit;
f:=function() local i; for i in 1 do return 1; od; return 2; end;;
f();
Where();
WhereWithVars();
quit;
f:=function() local i; for i in true do return 1; od; return 2; end;;
f();
Where();
WhereWithVars();
quit;
f:=function(x) local i,j; for i in true do return 1; od; return 2; end;;
f([1,2,3]);
Where();
WhereWithVars();
quit;
f:=function(x) local i,j; Unbind(x); for i in true do return 1; od; return 2; end;;
f([1,2,3]);
Where();
WhereWithVars();
quit;
f:=function(x) local i,j; Unbind(x); j := 4; for i in true do return 1; od; return 2; end;;
f([1,2,3]);
Where();
WhereWithVars();
quit;
f:=function() local x; repeat x:=1; until 1; return 2; end;;
f();
Where();
WhereWithVars();
quit;
f:=function() local x; Assert(0, 1); return 2; end;;
f();
Where();
WhereWithVars();
quit;
f:=function() local x; Assert(0, 1, "hello"); return 2; end;;
f();
Where();
WhereWithVars();
quit;
# Verify issue #2656 is fixed
InstallMethod( \[\,\], [ IsMatrixObj, IsPosInt, IsPosInt ],
{ m, row, col } -> ELM_LIST( m, row, col ) );
l := [[1]];; f := {} -> l[2,1];;
f();
Where();
WhereWithVars();
quit;
# verify issue #1373 is fixed
InstallMethod( Matrix, [IsFilter, IsSemiring, IsMatrixObj], {a,b,c} -> fail );
|
{
"pile_set_name": "Github"
}
|
package org.jetbrains.dokka.base.transformers.documentables
import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer
import org.jetbrains.dokka.transformers.documentation.perPackageOptions
import org.jetbrains.dokka.transformers.documentation.source
import org.jetbrains.dokka.transformers.documentation.sourceSet
import java.io.File
class SuppressedDocumentableFilterTransformer(val context: DokkaContext) : PreMergeDocumentableTransformer {
override fun invoke(modules: List<DModule>): List<DModule> {
return modules.mapNotNull(::filterModule)
}
private fun filterModule(module: DModule): DModule? {
val packages = module.packages.mapNotNull { pkg -> filterPackage(pkg) }
return when {
packages == module.packages -> module
packages.isEmpty() -> null
else -> module.copy(packages = packages)
}
}
private fun filterPackage(pkg: DPackage): DPackage? {
val options = perPackageOptions(pkg)
if (options?.suppress == true) {
return null
}
val filteredChildren = pkg.children.filterNot(::isSuppressed)
return when {
filteredChildren == pkg.children -> pkg
filteredChildren.isEmpty() -> null
else -> pkg.copy(
functions = filteredChildren.filterIsInstance<DFunction>(),
classlikes = filteredChildren.filterIsInstance<DClasslike>(),
typealiases = filteredChildren.filterIsInstance<DTypeAlias>(),
properties = filteredChildren.filterIsInstance<DProperty>()
)
}
}
private fun isSuppressed(documentable: Documentable): Boolean {
if (documentable !is WithSources) return false
val sourceFile = File(source(documentable).path).absoluteFile
return sourceSet(documentable).suppressedFiles.any { suppressedFile ->
sourceFile.startsWith(suppressedFile.absoluteFile)
}
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>
|
{
"pile_set_name": "Github"
}
|
/*
* linux/include/asm-arm/proc-armv/processor.h
*
* Copyright (C) 1996-1999 Russell King.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Changelog:
* 20-09-1996 RMK Created
* 26-09-1996 RMK Added 'EXTRA_THREAD_STRUCT*'
* 28-09-1996 RMK Moved start_thread into the processor dependencies
* 09-09-1998 PJB Delete redundant `wp_works_ok'
* 30-05-1999 PJB Save sl across context switches
* 31-07-1999 RMK Added 'domain' stuff
*/
#ifndef __ASM_PROC_PROCESSOR_H
#define __ASM_PROC_PROCESSOR_H
#include <asm/proc/domain.h>
#define KERNEL_STACK_SIZE PAGE_SIZE
struct context_save_struct {
unsigned long cpsr;
unsigned long r4;
unsigned long r5;
unsigned long r6;
unsigned long r7;
unsigned long r8;
unsigned long r9;
unsigned long sl;
unsigned long fp;
unsigned long pc;
};
#define INIT_CSS (struct context_save_struct){ SVC_MODE, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
#define EXTRA_THREAD_STRUCT \
unsigned int domain;
#define EXTRA_THREAD_STRUCT_INIT \
domain: domain_val(DOMAIN_USER, DOMAIN_CLIENT) | \
domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \
domain_val(DOMAIN_IO, DOMAIN_CLIENT)
#define start_thread(regs,pc,sp) \
({ \
unsigned long *stack = (unsigned long *)sp; \
set_fs(USER_DS); \
memzero(regs->uregs, sizeof(regs->uregs)); \
if (current->personality & ADDR_LIMIT_32BIT) \
regs->ARM_cpsr = USR_MODE; \
else \
regs->ARM_cpsr = USR26_MODE; \
regs->ARM_pc = pc; /* pc */ \
regs->ARM_sp = sp; /* sp */ \
regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
regs->ARM_r1 = stack[1]; /* r1 (argv) */ \
regs->ARM_r0 = stack[0]; /* r0 (argc) */ \
})
#define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1019])
#define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1017])
/* Allocation and freeing of basic task resources. */
/*
* NOTE! The task struct and the stack go together
*/
#define ll_alloc_task_struct() ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
#define ll_free_task_struct(p) free_pages((unsigned long)(p),1)
#endif
|
{
"pile_set_name": "Github"
}
|
if (global.GENTLY) require = GENTLY.hijack(require);
var crypto = require('crypto');
var fs = require('fs');
var util = require('util'),
path = require('path'),
File = require('./file'),
MultipartParser = require('./multipart_parser').MultipartParser,
QuerystringParser = require('./querystring_parser').QuerystringParser,
OctetParser = require('./octet_parser').OctetParser,
JSONParser = require('./json_parser').JSONParser,
StringDecoder = require('string_decoder').StringDecoder,
EventEmitter = require('events').EventEmitter,
Stream = require('stream').Stream,
os = require('os');
function IncomingForm(opts) {
if (!(this instanceof IncomingForm)) return new IncomingForm(opts);
EventEmitter.call(this);
opts=opts||{};
this.error = null;
this.ended = false;
this.maxFields = opts.maxFields || 1000;
this.maxFieldsSize = opts.maxFieldsSize || 2 * 1024 * 1024;
this.keepExtensions = opts.keepExtensions || false;
this.uploadDir = opts.uploadDir || os.tmpDir();
this.encoding = opts.encoding || 'utf-8';
this.headers = null;
this.type = null;
this.hash = opts.hash || false;
this.multiples = opts.multiples || false;
this.bytesReceived = null;
this.bytesExpected = null;
this._parser = null;
this._flushing = 0;
this._fieldsSize = 0;
this.openedFiles = [];
return this;
}
util.inherits(IncomingForm, EventEmitter);
exports.IncomingForm = IncomingForm;
IncomingForm.prototype.parse = function(req, cb) {
this.pause = function() {
try {
req.pause();
} catch (err) {
// the stream was destroyed
if (!this.ended) {
// before it was completed, crash & burn
this._error(err);
}
return false;
}
return true;
};
this.resume = function() {
try {
req.resume();
} catch (err) {
// the stream was destroyed
if (!this.ended) {
// before it was completed, crash & burn
this._error(err);
}
return false;
}
return true;
};
// Setup callback first, so we don't miss anything from data events emitted
// immediately.
if (cb) {
var fields = {}, files = {};
this
.on('field', function(name, value) {
fields[name] = value;
})
.on('file', function(name, file) {
if (this.multiples) {
if (files[name]) {
if (!Array.isArray(files[name])) {
files[name] = [files[name]];
}
files[name].push(file);
} else {
files[name] = file;
}
} else {
files[name] = file;
}
})
.on('error', function(err) {
cb(err, fields, files);
})
.on('end', function() {
cb(null, fields, files);
});
}
// Parse headers and setup the parser, ready to start listening for data.
this.writeHeaders(req.headers);
// Start listening for data.
var self = this;
req
.on('error', function(err) {
self._error(err);
})
.on('aborted', function() {
self.emit('aborted');
self._error(new Error('Request aborted'));
})
.on('data', function(buffer) {
self.write(buffer);
})
.on('end', function() {
if (self.error) {
return;
}
var err = self._parser.end();
if (err) {
self._error(err);
}
});
return this;
};
IncomingForm.prototype.writeHeaders = function(headers) {
this.headers = headers;
this._parseContentLength();
this._parseContentType();
};
IncomingForm.prototype.write = function(buffer) {
if (this.error) {
return;
}
if (!this._parser) {
this._error(new Error('uninitialized parser'));
return;
}
this.bytesReceived += buffer.length;
this.emit('progress', this.bytesReceived, this.bytesExpected);
var bytesParsed = this._parser.write(buffer);
if (bytesParsed !== buffer.length) {
this._error(new Error('parser error, '+bytesParsed+' of '+buffer.length+' bytes parsed'));
}
return bytesParsed;
};
IncomingForm.prototype.pause = function() {
// this does nothing, unless overwritten in IncomingForm.parse
return false;
};
IncomingForm.prototype.resume = function() {
// this does nothing, unless overwritten in IncomingForm.parse
return false;
};
IncomingForm.prototype.onPart = function(part) {
// this method can be overwritten by the user
this.handlePart(part);
};
IncomingForm.prototype.handlePart = function(part) {
var self = this;
if (part.filename === undefined) {
var value = ''
, decoder = new StringDecoder(this.encoding);
part.on('data', function(buffer) {
self._fieldsSize += buffer.length;
if (self._fieldsSize > self.maxFieldsSize) {
self._error(new Error('maxFieldsSize exceeded, received '+self._fieldsSize+' bytes of field data'));
return;
}
value += decoder.write(buffer);
});
part.on('end', function() {
self.emit('field', part.name, value);
});
return;
}
this._flushing++;
var file = new File({
path: this._uploadPath(part.filename),
name: part.filename,
type: part.mime,
hash: self.hash
});
this.emit('fileBegin', part.name, file);
file.open();
this.openedFiles.push(file);
part.on('data', function(buffer) {
if (buffer.length == 0) {
return;
}
self.pause();
file.write(buffer, function() {
self.resume();
});
});
part.on('end', function() {
file.end(function() {
self._flushing--;
self.emit('file', part.name, file);
self._maybeEnd();
});
});
};
function dummyParser(self) {
return {
end: function () {
self.ended = true;
self._maybeEnd();
return null;
}
};
}
IncomingForm.prototype._parseContentType = function() {
if (this.bytesExpected === 0) {
this._parser = dummyParser(this);
return;
}
if (!this.headers['content-type']) {
this._error(new Error('bad content-type header, no content-type'));
return;
}
if (this.headers['content-type'].match(/octet-stream/i)) {
this._initOctetStream();
return;
}
if (this.headers['content-type'].match(/urlencoded/i)) {
this._initUrlencoded();
return;
}
if (this.headers['content-type'].match(/multipart/i)) {
var m = this.headers['content-type'].match(/boundary=(?:"([^"]+)"|([^;]+))/i);
if (m) {
this._initMultipart(m[1] || m[2]);
} else {
this._error(new Error('bad content-type header, no multipart boundary'));
}
return;
}
|
{
"pile_set_name": "Github"
}
|
<!-- ============ PROGRESS -->
<!-- ====================== -->
<h1>Progress</h1>
<!-- ============ VARIABLES -->
<!-- ====================== -->
<p>
<h4>Global variables</h4>
<div><pre hljs class="prettyprint lang-sass">$progress-class: "-progress" !global
$progress-bar-class: "-bar" !global
$progress-bar-padding-vertical: $base-padding-vertical / 3
$progress-bar-padding-horizontal: $base-padding-horizontal / 1.5
$progress-font-weight: 600 !global
$progress-border-radius: 4px !global
$progress-border-width: 0px !global
$progress-border-style: solid !global
$progress-padding: 3px !global
$progress-background: #fff !global</pre></div>
</p>
<p>
Use widget class <code>-progress</code>. Apply themes and sizes. Append <code>-bar</code> inside <code>-progress</code>.
</p>
<div class="-row example-block">
<div class="-col12 view">
<div class="-progress -primary-">
<div class="-bar" style="width: 12%">12 %</div><div class="-bar -warning-" style="width: 25%">25 %</div><div class="-bar -error-" style="width: 5%">Something goes wrong</div>
</div>
<br>
<div class="-progress _divine -primary-">
<div class="-bar" style="width: 12%">12 %</div>
</div>
<br>
<div class="-progress -primary- -shadow-curve-">
<div class="-bar" style="width: 42%">progress with shadow 42 %</div><div class="-bar -warning-" style="width: 25%">25 %</div>
</div>
<br>
<div class="-progress -primary- -shadow-lifted-">
<div class="-bar" style="width: 42%">progress with shadow 42 %</div>
</div>
</div>
<div class="-col12 example"><pre hljs class="prettyprint lang-html"><div class="-progress -primary-">
<div class="-bar" style="width: 12%">12 %</div>
<div class="-bar -warning-" style="width: 25%">25 %</div>
<div class="-bar -error-" style="width: 5%">Something goes wrong</div>
</div>
<div class="-progress _divine -primary-">
<div class="-bar" style="width: 12%">12 %</div>
</div>
</pre></div>
</div>
|
{
"pile_set_name": "Github"
}
|
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2012 Gael Guennebaud <gael.guennebaud@inria.fr>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_REF_H
#define EIGEN_REF_H
namespace Eigen {
template<typename Derived> class RefBase;
template<typename PlainObjectType, int Options = 0,
typename StrideType = typename internal::conditional<PlainObjectType::IsVectorAtCompileTime,InnerStride<1>,OuterStride<> >::type > class Ref;
/** \class Ref
* \ingroup Core_Module
*
* \brief A matrix or vector expression mapping an existing expressions
*
* \tparam PlainObjectType the equivalent matrix type of the mapped data
* \tparam Options specifies whether the pointer is \c #Aligned, or \c #Unaligned.
* The default is \c #Unaligned.
* \tparam StrideType optionally specifies strides. By default, Ref implies a contiguous storage along the inner dimension (inner stride==1),
* but accept a variable outer stride (leading dimension).
* This can be overridden by specifying strides.
* The type passed here must be a specialization of the Stride template, see examples below.
*
* This class permits to write non template functions taking Eigen's object as parameters while limiting the number of copies.
* A Ref<> object can represent either a const expression or a l-value:
* \code
* // in-out argument:
* void foo1(Ref<VectorXf> x);
*
* // read-only const argument:
* void foo2(const Ref<const VectorXf>& x);
* \endcode
*
* In the in-out case, the input argument must satisfies the constraints of the actual Ref<> type, otherwise a compilation issue will be triggered.
* By default, a Ref<VectorXf> can reference any dense vector expression of float having a contiguous memory layout.
* Likewise, a Ref<MatrixXf> can reference any column major dense matrix expression of float whose column's elements are contiguously stored with
* the possibility to have a constant space inbetween each column, i.e.: the inner stride mmust be equal to 1, but the outer-stride (or leading dimension),
* can be greater than the number of rows.
*
* In the const case, if the input expression does not match the above requirement, then it is evaluated into a temporary before being passed to the function.
* Here are some examples:
* \code
* MatrixXf A;
* VectorXf a;
* foo1(a.head()); // OK
* foo1(A.col()); // OK
* foo1(A.row()); // compilation error because here innerstride!=1
* foo2(A.row()); // The row is copied into a contiguous temporary
* foo2(2*a); // The expression is evaluated into a temporary
* foo2(A.col().segment(2,4)); // No temporary
* \endcode
*
* The range of inputs that can be referenced without temporary can be enlarged using the last two template parameter.
* Here is an example accepting an innerstride!=1:
* \code
* // in-out argument:
* void foo3(Ref<VectorXf,0,InnerStride<> > x);
* foo3(A.row()); // OK
* \endcode
* The downside here is that the function foo3 might be significantly slower than foo1 because it won't be able to exploit vectorization, and will involved more
* expensive address computations even if the input is contiguously stored in memory. To overcome this issue, one might propose to overloads internally calling a
* template function, e.g.:
* \code
* // in the .h:
* void foo(const Ref<MatrixXf>& A);
* void foo(const Ref<MatrixXf,0,Stride<> >& A);
*
* // in the .cpp:
* template<typename TypeOfA> void foo_impl(const TypeOfA& A) {
* ... // crazy code goes here
* }
* void foo(const Ref<MatrixXf>& A) { foo_impl(A); }
* void foo(const Ref<MatrixXf,0,Stride<> >& A) { foo_impl(A); }
* \endcode
*
*
* \sa PlainObjectBase::Map(), \ref TopicStorageOrders
*/
namespace internal {
template<typename _PlainObjectType, int _Options, typename _StrideType>
struct traits<Ref<_PlainObjectType, _Options, _StrideType> >
: public traits<Map<_PlainObjectType, _Options, _StrideType> >
{
typedef _PlainObjectType PlainObjectType;
typedef _StrideType StrideType;
enum {
Options = _Options,
Flags = traits<Map<_PlainObjectType, _Options, _StrideType> >::Flags | NestByRefBit
};
template<typename Derived> struct match {
enum {
HasDirectAccess = internal::has_direct_access<Derived>::ret,
StorageOrderMatch = PlainObjectType::IsVectorAtCompileTime || ((PlainObjectType::Flags&RowMajorBit)==(Derived::Flags&RowMajorBit)),
InnerStrideMatch = int(StrideType::InnerStrideAtCompileTime)==int(Dynamic)
|| int(StrideType::InnerStrideAtCompileTime)==int(Derived::InnerStrideAtCompileTime)
|| (int(StrideType::InnerStrideAtCompileTime)==0 && int(Derived::InnerStrideAtCompileTime)==1),
OuterStrideMatch = Derived::IsVectorAtCompileTime
|| int(StrideType::OuterStrideAtCompileTime)==int(Dynamic) || int(StrideType::OuterStrideAtCompileTime)==int(Derived::OuterStrideAtCompileTime),
AlignmentMatch = (_Options!=Aligned) || ((PlainObjectType::Flags&AlignedBit)==0) || ((traits<Derived>::Flags&AlignedBit)==AlignedBit),
MatchAtCompileTime = HasDirectAccess && StorageOrderMatch && InnerStrideMatch && OuterStrideMatch && AlignmentMatch
};
typedef typename internal::conditional<MatchAtCompileTime,internal::true_type,internal::false_type>::type type;
};
};
template<typename Derived>
struct traits<RefBase<Derived> > : public traits<Derived> {};
}
template<typename Derived> class RefBase
: public MapBase<Derived>
{
typedef typename internal::traits<Derived>::PlainObjectType PlainObjectType;
typedef typename internal::traits<Derived>::StrideType StrideType;
public:
typedef MapBase<Derived> Base;
EIGEN_DENSE_PUBLIC_INTERFACE(RefBase)
inline Index innerStride() const
{
return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1;
}
inline Index outerStride() const
{
return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer()
: IsVectorAtCompileTime ? this->size()
: int(Flags)&RowMajorBit ? this->cols()
: this->rows();
}
RefBase()
: Base(0,RowsAtCompileTime==Dynamic?0:RowsAtCompileTime,ColsAtCompileTime==Dynamic?0:ColsAtCompileTime),
// Stride<> does not allow default ctor for Dynamic strides, so let' initialize it with dummy values:
m_stride(StrideType::OuterStrideAtCompileTime==Dynamic?0:StrideType::OuterStrideAtCompileTime,
StrideType::InnerStrideAtCompileTime==Dynamic?0:StrideType::InnerStrideAtCompileTime)
{}
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(RefBase)
protected:
typedef Stride<StrideType::OuterStrideAtCompileTime,StrideType::InnerStrideAtCompileTime> StrideBase;
template<typename Expression
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: c6be551879cd14d739b0188844ef2c60
timeCreated: 1447582131
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: e1e5ef31262d242ce8efe2020a27425e, type: 3}
userData:
assetBundleName:
assetBundleVariant:
|
{
"pile_set_name": "Github"
}
|
{
"images" : [
{
"idiom" : "watch",
"scale" : "2x",
"screen-width" : "<=145"
},
{
"idiom" : "watch",
"scale" : "2x",
"screen-width" : ">161"
},
{
"idiom" : "watch",
"scale" : "2x",
"screen-width" : ">145"
},
{
"idiom" : "watch",
"scale" : "2x",
"screen-width" : ">183"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
|
{
"pile_set_name": "Github"
}
|
<import src="../../../common/head.wxml"/>
<import src="../../../common/foot.wxml"/>
<view class="container">
<template is="head" data="{{title: 'sendMessage'}}"/>
<view class="page-body">
<view class="weui-cells__title">发送内容(以下字段可自由适配)</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">实例字段</view>
</view>
<view class="weui-cell__bd">
<input class="weui-input" type="text" placeholder="请输入"></input>
</view>
</view>
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">实例字段</view>
</view>
<view class="weui-cell__bd">
<input class="weui-input" type="text" placeholder="请输入"></input>
</view>
</view>
</view>
<view class="weui-cells">
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">跳转链接</view>
</view>
<view class="weui-cell__bd">
<input class="weui-input" type="text" placeholder="请输入" value="{{shareData.path}}"></input>
</view>
</view>
</view>
<view class="btn-area">
<button type="primary">发送模板消息</button>
</view>
</view>
<template is="foot"/>
</view>
|
{
"pile_set_name": "Github"
}
|
// Copyright (C) 2005-2006 The Trustees of Indiana University.
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Authors: Douglas Gregor
// Andrew Lumsdaine
#ifndef BOOST_GRAPH_DETAIL_REMOTE_UPDATE_SET_HPP
#define BOOST_GRAPH_DETAIL_REMOTE_UPDATE_SET_HPP
#ifndef BOOST_GRAPH_USE_MPI
#error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included"
#endif
#include <boost/graph/parallel/process_group.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <vector>
#include <boost/assert.hpp>
#include <boost/optional.hpp>
#include <queue>
namespace boost { namespace graph { namespace detail {
template<typename ProcessGroup>
void do_synchronize(ProcessGroup& pg)
{
using boost::parallel::synchronize;
synchronize(pg);
}
struct remote_set_queued {};
struct remote_set_immediate {};
template<typename ProcessGroup>
class remote_set_semantics
{
BOOST_STATIC_CONSTANT
(bool,
queued = (is_convertible<
typename ProcessGroup::communication_category,
boost::parallel::bsp_process_group_tag>::value));
public:
typedef typename mpl::if_c<queued,
remote_set_queued,
remote_set_immediate>::type type;
};
template<typename Derived, typename ProcessGroup, typename Value,
typename OwnerMap,
typename Semantics = typename remote_set_semantics<ProcessGroup>::type>
class remote_update_set;
/**********************************************************************
* Remote updating set that queues messages until synchronization *
**********************************************************************/
template<typename Derived, typename ProcessGroup, typename Value,
typename OwnerMap>
class remote_update_set<Derived, ProcessGroup, Value, OwnerMap,
remote_set_queued>
{
typedef typename property_traits<OwnerMap>::key_type Key;
typedef std::vector<std::pair<Key, Value> > Updates;
typedef typename Updates::size_type updates_size_type;
typedef typename Updates::value_type updates_pair_type;
public:
private:
typedef typename ProcessGroup::process_id_type process_id_type;
enum message_kind {
/** Message containing the number of updates that will be sent in
* a msg_updates message that will immediately follow. This
* message will contain a single value of type
* updates_size_type.
*/
msg_num_updates,
/** Contains (key, value) pairs with all of the updates from a
* particular source. The number of updates is variable, but will
* be provided in a msg_num_updates message that immediately
* preceeds this message.
*
*/
msg_updates
};
struct handle_messages
{
explicit
handle_messages(remote_update_set* self, const ProcessGroup& pg)
: self(self), update_sizes(num_processes(pg), 0) { }
void operator()(process_id_type source, int tag)
{
switch(tag) {
case msg_num_updates:
{
// Receive the # of updates
updates_size_type num_updates;
receive(self->process_group, source, tag, num_updates);
update_sizes[source] = num_updates;
}
break;
case msg_updates:
{
updates_size_type num_updates = update_sizes[source];
BOOST_ASSERT(num_updates);
// Receive the actual updates
std::vector<updates_pair_type> updates(num_updates);
receive(self->process_group, source, msg_updates, &updates[0],
num_updates);
// Send updates to derived "receive_update" member
Derived* derived = static_cast<Derived*>(self);
for (updates_size_type u = 0; u < num_updates; ++u)
derived->receive_update(source, updates[u].first, updates[u].second);
update_sizes[source] = 0;
}
break;
};
}
private:
remote_update_set* self;
std::vector<updates_size_type> update_sizes;
};
friend struct handle_messages;
protected:
remote_update_set(const ProcessGroup& pg, const OwnerMap& owner)
: process_group(pg, handle_messages(this, pg)),
updates(num_processes(pg)), owner(owner) {
}
void update(const Key& key, const Value& value)
{
if (get(owner, key) == process_id(process_group)) {
Derived* derived = static_cast<Derived*>(this);
derived->receive_update(get(owner, key), key, value);
}
else {
updates[get(owner, key)].push_back(std::make_pair(key, value));
}
}
void collect() { }
void synchronize()
{
// Emit all updates and then remove them
process_id_type num_processes = updates.size();
for (process_id_type p = 0; p < num_processes; ++p) {
if (!updates[p].empty()) {
send(process_group, p, msg_num_updates, updates[p].size());
send(process_group, p, msg_updates,
&updates[p].front(), updates[p].size());
updates[p].clear();
}
}
do_synchronize(process_group);
}
ProcessGroup process_group;
private:
std::vector<Updates> updates;
OwnerMap owner;
};
/**********************************************************************
* Remote updating set that sends messages immediately *
**********************************************************************/
template<typename Derived, typename ProcessGroup, typename Value,
typename OwnerMap>
class remote_update_set<Derived, ProcessGroup, Value, OwnerMap,
remote_set_immediate>
{
typedef typename property_traits<OwnerMap>::key_type Key;
typedef std::pair<Key, Value> update_pair_type;
typedef typename std::vector<update_pair_type>::size_type updates_size_type;
public:
typedef typename ProcessGroup::process_id_type process_id_type;
private:
enum message_kind {
/** Contains a (key, value) pair that will be updated. */
msg_update
};
struct handle_messages
{
explicit handle_messages(remote_update_set* self, const ProcessGroup& pg)
: self(self)
{ update_sizes.resize(num_processes(pg), 0); }
void operator()(process_id_type source, int tag)
{
// Receive the # of updates
BOOST_ASSERT(tag == msg_update);
update_pair_type update;
receive(self->process_group, source, tag, update);
// Send update to derived "receive_update" member
Derived* derived = static_cast<Derived*>(self);
derived->receive_update(source, update.first, update.second);
}
private:
std::vector<updates_size_type> update_sizes;
remote_update_set* self;
};
friend struct handle_messages;
protected:
remote_update_set(const ProcessGroup& pg, const OwnerMap& owner)
: process_group(pg, handle_messages(this, pg)), owner(owner) { }
void update(const Key& key,
|
{
"pile_set_name": "Github"
}
|
<a href="https://www.buymeacoffee.com/7eDr4fv" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/lato-orange.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;" ></a>
# 2019-ncov-frontend
> Coronavirus (COVID-19) Frontend
Backend setup can be found here [2019-ncov-api](https://github.com/sorxrob/2019-ncov-api).
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
## License & copyright
© Robert C Soriano
Licensed under the [MIT License](LICENSE).
## Acknowledgments
- Hat tip to anyone who's module was used
- Richard Matsen for radius scale calculation
|
{
"pile_set_name": "Github"
}
|
type=driver
plumed_needs=boost_serialization
plumed_modules=drr
arg="--plumed plumed.dat --trajectory-stride 1 --timestep 0.005 --ixyz ala12_trajectory.xyz --dump-forces forces --dump-forces-fmt=%10.6f"
|
{
"pile_set_name": "Github"
}
|
Lets sing!
♫♪♬♩
Eat food
🍅🍕
|
{
"pile_set_name": "Github"
}
|
import sqlite3
import time
import datetime
conn = sqlite3.connect('master.db')
c = conn.cursor()
def create_table():
c.execute('CREATE TABLE IF NOT EXISTS tennis(player TEXT, Pinnacle REAL, WillHill REAL, betThreeSixFive REAL, Bookmaker REAL, BetOnline REAL, TheGreekSportsbook REAL, JustBet REAL, SportsInteraction REAL, WagerWeb REAL, FiveDimes REAL)')
"""
Columns are:
player
betfairBack
betfairLay
williamhill
ladbrokes
"""
def dynamic_data_entry(column,entry):
c.execute("INSERT INTO tennis(" + column + ") VALUES(?)",
(str(entry),))
conn.commit()
#The real function will have to be "updating"
def update(player,column,entry):
c.execute('SELECT * FROM tennis')
c.execute("UPDATE tennis SET " + column + " = " + str(entry) + " WHERE player = '" + player + "'")
conn.commit()
def read_from_db(player):
c.execute("SELECT * FROM tennis WHERE player = '" + player + "'")
# data = c.fetchone()
# print data
#for row in c.fetchall():
# print row[1:]
return list(c.fetchall())
create_table()
#c.close()
#conn.close()
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Dapper" version="1.50.4-alpha1-00070" targetFramework="net452" />
<package id="Dapper.Contrib" version="1.50.0" targetFramework="net452" />
<package id="Dapper.Extension" version="1.0.0.1" targetFramework="net452" />
<package id="EntityFramework" version="6.1.3" targetFramework="net452" />
<package id="SyntacticSugar" version="2.4.1" targetFramework="net452" />
</packages>
|
{
"pile_set_name": "Github"
}
|
package com.tencent.mm.ui.chatting;
import android.view.View;
import android.view.ViewStub;
import android.view.animation.AnimationUtils;
import android.widget.ListView;
import com.tencent.mm.e.a.nq;
import com.tencent.mm.plugin.sight.encode.ui.ChattingSightContainerView.a;
import com.tencent.mm.sdk.c.a;
import com.tencent.mm.sdk.platformtools.ac;
import com.tencent.mm.ui.j;
import com.tencent.mm.ui.o;
final class ChattingUI$a$84$2
implements ChattingSightContainerView.a
{
View lBB = null;
ChattingUI$a$84$2(ChattingUI.a.84 param84) {}
public final void azd()
{
nq localnq = new nq();
avS.type = 6;
a.kug.y(localnq);
lBA.lAY.setRequestedOrientation(1);
lBA.lAY.Xk();
lBA.lAY.bkT();
lBA.lAY.blj();
if (lBB == null) {
lBB = ((ViewStub)lBA.lAY.findViewById(2131755932)).inflate();
}
lBB.setVisibility(0);
lBB.startAnimation(AnimationUtils.loadAnimation(lBA.lAY.kNN.kOg, 2130968612));
}
public final void onHide()
{
lBA.lAY.setRequestedOrientation(-1);
lBA.lAY.bkT();
if ((lBB != null) && (lBB.getVisibility() == 0))
{
lBB.setVisibility(8);
lBB.startAnimation(AnimationUtils.loadAnimation(lBA.lAY.kNN.kOg, 2130968613));
}
new ac().post(new Runnable()
{
public final void run()
{
nq localnq = new nq();
avS.type = 7;
avS.avT = ChattingUI.a.e(lBA.lAY).getFirstVisiblePosition();
avS.avU = ChattingUI.a.e(lBA.lAY).getLastVisiblePosition();
avS.avV = ChattingUI.a.e(lBA.lAY).getHeaderViewsCount();
a.kug.y(localnq);
}
});
}
}
/* Location:
* Qualified Name: com.tencent.mm.ui.chatting.ChattingUI.a.84.2
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
{
"pile_set_name": "Github"
}
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=4 sw=4 et tw=99:
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla SpiderMonkey JavaScript 1.9 code, released
* May 28, 2008.
*
* The Initial Developer of the Original Code is
* Brendan Eich <brendan@mozilla.org>
*
* Contributor(s):
* David Anderson <danderson@mozilla.com>
* David Mandelin <dmandelin@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#if !defined jsjaeger_methodjit_inl_h__ && defined JS_METHODJIT
#define jsjaeger_methodjit_inl_h__
namespace js {
namespace mjit {
enum CompileRequest
{
CompileRequest_Interpreter,
CompileRequest_JIT
};
/* Number of times a script must be called before we run it in the methodjit. */
static const size_t CALLS_BEFORE_COMPILE = 16;
/* Number of loop back-edges we execute in the interpreter before methodjitting. */
static const size_t BACKEDGES_BEFORE_COMPILE = 16;
static inline CompileStatus
CanMethodJIT(JSContext *cx, JSScript *script, JSStackFrame *fp, CompileRequest request)
{
if (!cx->methodJitEnabled)
return Compile_Abort;
JITScriptStatus status = script->getJITStatus(fp->isConstructing());
if (status == JITScript_Invalid)
return Compile_Abort;
if (request == CompileRequest_Interpreter &&
status == JITScript_None &&
!cx->hasRunOption(JSOPTION_METHODJIT_ALWAYS) &&
script->incCallCount() <= CALLS_BEFORE_COMPILE)
{
return Compile_Skipped;
}
if (status == JITScript_None)
return TryCompile(cx, fp);
return Compile_Okay;
}
/*
* Called from a backedge in the interpreter to decide if we should transition to the
* methodjit. If so, we compile the given function.
*/
static inline CompileStatus
CanMethodJITAtBranch(JSContext *cx, JSScript *script, JSStackFrame *fp, jsbytecode *pc)
{
if (!cx->methodJitEnabled)
return Compile_Abort;
JITScriptStatus status = script->getJITStatus(fp->isConstructing());
if (status == JITScript_Invalid)
return Compile_Abort;
if (status == JITScript_None &&
!cx->hasRunOption(JSOPTION_METHODJIT_ALWAYS) &&
cx->compartment->incBackEdgeCount(pc) <= BACKEDGES_BEFORE_COMPILE)
{
return Compile_Skipped;
}
if (status == JITScript_None)
return TryCompile(cx, fp);
return Compile_Okay;
}
}
}
#endif
|
{
"pile_set_name": "Github"
}
|
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// RegistrationViaAPIResponse The Response for Registration Flows via API
//
// swagger:model registrationViaApiResponse
type RegistrationViaAPIResponse struct {
// identity
// Required: true
Identity *Identity `json:"identity"`
// session
Session *Session `json:"session,omitempty"`
// The Session Token
//
// This field is only set when the session hook is configured as a post-registration hook.
//
// A session token is equivalent to a session cookie, but it can be sent in the HTTP Authorization
// Header:
//
// Authorization: bearer ${session-token}
//
// The session token is only issued for API flows, not for Browser flows!
// Required: true
SessionToken *string `json:"session_token"`
}
// Validate validates this registration via Api response
func (m *RegistrationViaAPIResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIdentity(formats); err != nil {
res = append(res, err)
}
if err := m.validateSession(formats); err != nil {
res = append(res, err)
}
if err := m.validateSessionToken(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *RegistrationViaAPIResponse) validateIdentity(formats strfmt.Registry) error {
if err := validate.Required("identity", "body", m.Identity); err != nil {
return err
}
if m.Identity != nil {
if err := m.Identity.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("identity")
}
return err
}
}
return nil
}
func (m *RegistrationViaAPIResponse) validateSession(formats strfmt.Registry) error {
if swag.IsZero(m.Session) { // not required
return nil
}
if m.Session != nil {
if err := m.Session.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("session")
}
return err
}
}
return nil
}
func (m *RegistrationViaAPIResponse) validateSessionToken(formats strfmt.Registry) error {
if err := validate.Required("session_token", "body", m.SessionToken); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *RegistrationViaAPIResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RegistrationViaAPIResponse) UnmarshalBinary(b []byte) error {
var res RegistrationViaAPIResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
|
{
"pile_set_name": "Github"
}
|
s [ ]
w [a-z0-9A-Z]
W [^a-z0-9A-Z]
d [0-9]
%%
((MERGE.*USING{s}*\()|(EXECUTE{s}*IMMEDIATE{s}*\")|({W}+{d}{s}+HAVING{s}+{d})|(MATCH{s}*[a-zA-Z\\(\\),+\-]+{s}*AGAINST{s}*\()) printf('attack detected');
%%
|
{
"pile_set_name": "Github"
}
|
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX ns: <http://example.org/ns#>
SELECT ?title ?price
{ ?x ns:price ?p .
?x ns:discount ?discount
BIND (?p*(1-?discount) AS ?price)
FILTER(?price < 20)
?x dc:title ?title .
}
|
{
"pile_set_name": "Github"
}
|
package volumes
var _ ResizeService = (*LinuxResizeService)(nil)
|
{
"pile_set_name": "Github"
}
|
/*
* TupleTypeUtil.java
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2015-2019 Apple Inc. and the FoundationDB project 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 com.apple.foundationdb.record.metadata;
import com.apple.foundationdb.record.provider.foundationdb.FDBRecordVersion;
import com.apple.foundationdb.tuple.Tuple;
import com.google.protobuf.ByteString;
import com.google.protobuf.Descriptors;
import com.google.protobuf.ProtocolMessageEnum;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
/**
* Utility class for dealing with {@link Tuple} types. In theory, these methods should live in
* {@link com.apple.foundationdb.tuple.TupleHelpers TupleHelpers} except that they use some Protobuf specific things
* like the {@link ByteString} class, and {@code TupleHelpers} is defined in the
* <a href="https://javadoc.io/doc/org.foundationdb/fdb-extensions/">fdb-extensions</a> sub-project
* which does not (and probably should not) take Protobuf as a dependency.
*/
class TupleTypeUtil {
@Nonnull
private static final BigInteger BIG_INT_MAX_LONG = BigInteger.valueOf(Long.MAX_VALUE);
@Nonnull
private static final BigInteger BIG_INT_MIN_LONG = BigInteger.valueOf(Long.MIN_VALUE);
/**
* Normalize a list of values so that it can be checked for equality with other lists sharing
* the same {@link Tuple} representation. In other words, it should be the case that:
*
* <pre> {@code
* toTupleEquivalentValue(list1).equals(toTupleEquivalentValue)
* == Arrays.equals(Tuple.fromList(toTupleAppropriateList(list1)).pack(), Tuple.fromList(toTupleAppropriateList(list2)).pack())
* }</pre>
*
* <p>
* for any two lists {@code list1} and {@code list2}.
* </p>
*
* @param values the list of values to normalized
* @return a new list containing the normalized elements of {@code values}
*/
@Nonnull
static List<Object> toTupleEquivalentList(@Nonnull List<?> values) {
List<Object> tupleEquivalentList = new ArrayList<>(values.size());
for (Object o : values) {
tupleEquivalentList.add(toTupleEquivalentValue(o));
}
return tupleEquivalentList;
}
/**
* Normalize a value so that it compares equal to anything with the same {@link Tuple} representation.
* The value that is returned cannot necessarily be packed by a {@code Tuple} (for example,
* a <code>byte[]</code> is returned as a {@link ByteString}), but it does implement {@link Object#equals(Object)}
* and {@link Object#hashCode()}, so the value can be used in hash-based data structures like
* {@link java.util.HashSet HashSet}s and {@link java.util.HashMap HashMap}s. In other words, it should
* bethe case that:
*
* <pre> {@code
* Objects.equals(toTupleEquivalentValue(value1), toTupleEquivalentValue(value2))
* == Arrays.equals(Tuple.from(value1).pack(), Tuple.from(value2).pack())
* }</pre>
*
* <p>
* for any two values {@code value1} and {@code value2}.
* </p>
*
* <p>
* This will only return {@code null} if {@link #toTupleAppropriateValue(Object)} would return {@code null}
* on the same input. If the object is already in
* </p>
*
* @param obj the value to normalize
* @return a value that has the same representation when {@link Tuple}-encoded
*/
@Nullable
static Object toTupleEquivalentValue(@Nullable Object obj) {
if (obj == null || obj instanceof Key.Evaluated.NullStandin) {
return null;
} else if (obj instanceof List<?>) {
List<?> list = (List<?>)obj;
return toTupleEquivalentList(list);
} else if (obj instanceof Tuple) {
return toTupleEquivalentList(((Tuple)obj).getItems());
} else if (obj instanceof byte[]) {
return ByteString.copyFrom((byte[]) obj);
} else if ((obj instanceof Byte) || (obj instanceof Short) || (obj instanceof Integer)) {
return ((Number)obj).longValue();
} else if (obj instanceof BigInteger) {
BigInteger bigInt = (BigInteger)obj;
if (bigInt.compareTo(BIG_INT_MIN_LONG) > 0 && bigInt.compareTo(BIG_INT_MAX_LONG) < 0) {
return bigInt.longValue();
} else {
return bigInt;
}
} else if (obj instanceof ProtocolMessageEnum) {
return (long)((ProtocolMessageEnum)obj).getNumber();
} else if (obj instanceof Descriptors.EnumValueDescriptor) {
return (long)((Descriptors.EnumValueDescriptor)obj).getNumber();
} else if (obj instanceof FDBRecordVersion) {
return ((FDBRecordVersion)obj).toVersionstamp(false);
} else {
return obj;
}
}
/**
* Convert a list of values into items that can all be stored within a {@link Tuple}.
*
* @param values a list of values
* @return a new list with {@link Tuple}-encodable versions of the elements of {@code values}
*/
@Nonnull
static List<Object> toTupleAppropriateList(@Nonnull List<?> values) {
List<Object> tupleAppropriateList = new ArrayList<>(values.size());
for (Object o : values) {
tupleAppropriateList.add(toTupleAppropriateValue(o));
}
return tupleAppropriateList;
}
/**
* Convert a value into a type that can be stored within a {@link Tuple}.
*
* @param obj the value to convert
* @return the value converted to some {@link Tuple}-encodable type
*/
@Nullable
static Object toTupleAppropriateValue(@Nullable Object obj) {
if (obj instanceof Key.Evaluated.NullStandin) {
return null;
} else if (obj instanceof ByteString) {
return ((ByteString) obj).toByteArray();
} else if (obj instanceof List) {
return toTupleAppropriateList((List<?>) obj);
// Following two are both Internal.EnumLite, so could use that, too.
} else if (obj instanceof ProtocolMessageEnum) {
return ((ProtocolMessageEnum) obj).getNumber();
} else if (obj instanceof Descriptors.EnumValueDescriptor) {
return ((Descriptors.EnumValueDescriptor) obj).getNumber();
} else if (obj instanceof FDBRecordVersion) {
return ((FDBRecordVersion) obj).toVersionstamp(false);
} else {
return obj;
}
}
private TupleTypeUtil() {
}
}
|
{
"pile_set_name": "Github"
}
|
---
"Missing document with catch":
- do:
catch: missing
get:
index: test_1
id: 1
---
"Missing document with ignore":
- do:
get:
index: test_1
id: 1
ignore: 404
|
{
"pile_set_name": "Github"
}
|
# coding=utf-8
import typing
from pyramid.config import Configurator
import transaction
from tracim_backend.app_models.contents import FOLDER_TYPE
from tracim_backend.app_models.contents import content_type_list
from tracim_backend.config import CFG
from tracim_backend.exceptions import ContentFilenameAlreadyUsedInFolder
from tracim_backend.exceptions import EmptyLabelNotAllowed
from tracim_backend.extensions import hapic
from tracim_backend.lib.core.content import ContentApi
from tracim_backend.lib.utils.authorization import ContentTypeChecker
from tracim_backend.lib.utils.authorization import check_right
from tracim_backend.lib.utils.authorization import is_contributor
from tracim_backend.lib.utils.authorization import is_reader
from tracim_backend.lib.utils.request import TracimRequest
from tracim_backend.lib.utils.utils import generate_documentation_swagger_tag
from tracim_backend.models.context_models import ContentInContext
from tracim_backend.models.context_models import RevisionInContext
from tracim_backend.models.revision_protection import new_revision
from tracim_backend.views.controllers import Controller
from tracim_backend.views.core_api.schemas import FolderContentModifySchema
from tracim_backend.views.core_api.schemas import NoContentSchema
from tracim_backend.views.core_api.schemas import SetContentStatusSchema
from tracim_backend.views.core_api.schemas import TextBasedContentSchema
from tracim_backend.views.core_api.schemas import TextBasedRevisionSchema
from tracim_backend.views.core_api.schemas import WorkspaceAndContentIdPathSchema
from tracim_backend.views.swagger_generic_section import SWAGGER_TAG__CONTENT_ENDPOINTS
try: # Python 3.5+
from http import HTTPStatus
except ImportError:
from http import client as HTTPStatus
SWAGGER_TAG__CONTENT_FOLDER_SECTION = "Folders"
SWAGGER_TAG__CONTENT_FOLDER_ENDPOINTS = generate_documentation_swagger_tag(
SWAGGER_TAG__CONTENT_ENDPOINTS, SWAGGER_TAG__CONTENT_FOLDER_SECTION
)
is_folder_content = ContentTypeChecker([FOLDER_TYPE])
class FolderController(Controller):
@hapic.with_api_doc(tags=[SWAGGER_TAG__CONTENT_FOLDER_ENDPOINTS])
@check_right(is_reader)
@check_right(is_folder_content)
@hapic.input_path(WorkspaceAndContentIdPathSchema())
@hapic.output_body(TextBasedContentSchema())
def get_folder(self, context, request: TracimRequest, hapic_data=None) -> ContentInContext:
"""
Get folder info
"""
app_config = request.registry.settings["CFG"] # type: CFG
api = ContentApi(
show_archived=True,
show_deleted=True,
current_user=request.current_user,
session=request.dbsession,
config=app_config,
)
content = api.get_one(hapic_data.path.content_id, content_type=content_type_list.Any_SLUG)
return api.get_content_in_context(content)
@hapic.with_api_doc(tags=[SWAGGER_TAG__CONTENT_FOLDER_ENDPOINTS])
@hapic.handle_exception(EmptyLabelNotAllowed, HTTPStatus.BAD_REQUEST)
@hapic.handle_exception(ContentFilenameAlreadyUsedInFolder, HTTPStatus.BAD_REQUEST)
@check_right(is_contributor)
@check_right(is_folder_content)
@hapic.input_path(WorkspaceAndContentIdPathSchema())
@hapic.input_body(FolderContentModifySchema())
@hapic.output_body(TextBasedContentSchema())
def update_folder(self, context, request: TracimRequest, hapic_data=None) -> ContentInContext:
"""
update folder
"""
app_config = request.registry.settings["CFG"] # type: CFG
api = ContentApi(
show_archived=True,
show_deleted=True,
current_user=request.current_user,
session=request.dbsession,
config=app_config,
)
content = api.get_one(hapic_data.path.content_id, content_type=content_type_list.Any_SLUG)
with new_revision(session=request.dbsession, tm=transaction.manager, content=content):
api.update_container_content(
item=content,
new_label=hapic_data.body.label,
new_content=hapic_data.body.raw_content,
allowed_content_type_slug_list=hapic_data.body.sub_content_types,
)
api.save(content)
api.execute_update_content_actions(content)
return api.get_content_in_context(content)
@hapic.with_api_doc(tags=[SWAGGER_TAG__CONTENT_FOLDER_ENDPOINTS])
@check_right(is_reader)
@check_right(is_folder_content)
@hapic.input_path(WorkspaceAndContentIdPathSchema())
@hapic.output_body(TextBasedRevisionSchema(many=True))
def get_folder_revisions(
self, context, request: TracimRequest, hapic_data=None
) -> typing.List[RevisionInContext]:
"""
get folder revisions
"""
app_config = request.registry.settings["CFG"] # type: CFG
api = ContentApi(
show_archived=True,
show_deleted=True,
current_user=request.current_user,
session=request.dbsession,
config=app_config,
)
content = api.get_one(hapic_data.path.content_id, content_type=content_type_list.Any_SLUG)
revisions = content.revisions
return [api.get_revision_in_context(revision) for revision in revisions]
@hapic.with_api_doc(tags=[SWAGGER_TAG__CONTENT_FOLDER_ENDPOINTS])
@check_right(is_contributor)
@check_right(is_folder_content)
@hapic.input_path(WorkspaceAndContentIdPathSchema())
@hapic.input_body(SetContentStatusSchema())
@hapic.output_body(NoContentSchema(), default_http_code=HTTPStatus.NO_CONTENT)
def set_folder_status(self, context, request: TracimRequest, hapic_data=None) -> None:
"""
set folder status
"""
app_config = request.registry.settings["CFG"] # type: CFG
api = ContentApi(
show_archived=True,
show_deleted=True,
current_user=request.current_user,
session=request.dbsession,
config=app_config,
)
content = api.get_one(hapic_data.path.content_id, content_type=content_type_list.Any_SLUG)
with new_revision(session=request.dbsession, tm=transaction.manager, content=content):
api.set_status(content, hapic_data.body.status)
api.save(content)
api.execute_update_content_actions(content)
return
def bind(self, configurator: Configurator) -> None:
# Get folder
configurator.add_route(
"folder", "/workspaces/{workspace_id}/folders/{content_id}", request_method="GET"
)
configurator.add_view(self.get_folder, route_name="folder")
# update folder
configur
|
{
"pile_set_name": "Github"
}
|
#coding=utf-8
'''
Created on 2015-11-4
@author: zhangtiande
'''
from django.shortcuts import HttpResponse
from teamvision.project.models import Project,Tag
from django.contrib.auth.models import User
from business.ucenter.account_service import AccountService
class VM_AdminUser(object):
'''
classdocs
'''
def __init__(self,user,is_create=False):
self.user=user
self.is_create=is_create
self.admin=""
self.manager=""
self.default_group=""
self.set_user_group()
def user_active(self):
result="finished-check fa-check-square"
if not self.user.is_active:
result="fa-square-o unfinished-check"
return result
def user_name(self):
return self.user.email
def user_full_name(self):
result=self.user.username
if self.user.last_name and self.user.first_name:
result=self.user.last_name+self.user.first_name
return result
def user_avatar(self):
result="/static/global/images/fruit-avatar/Fruit-1.png"
if self.user.extend_info:
result=AccountService.get_avatar_url(self.user)
return result
def user_groups(self):
return self.user.groups.all()
def form_id(self):
result="user_edit_form"
if self.is_create:
result="user_create_form"
return result
def set_user_group(self):
if self.user:
if self.user.groups.all().filter(id=27):
self.admin="checked"
elif self.user.groups.all().filter(id=28):
self.manager="checked"
else:
self.default_group="checked"
|
{
"pile_set_name": "Github"
}
|
/** @file
Intel Processor Power Management ACPI Code.
Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "CpuPowerMgmt.h"
DefinitionBlock (
"CPU0PSD.aml",
"SSDT",
0x02,
"PmRef",
"Cpu0Psd",
0x3000
)
{
External(\PC00, IntObj)
External(\TCNT, FieldUnitObj)
External(\_SB.CFGD, FieldUnitObj)
External(\_SB.PR00, DeviceObj)
Scope(\_SB.PR00)
{
Name(HPSD,Package() // HW_ALL
{
Package() {5, // NumEntries. Current Value is 5.
0, // Revision. Current Value is 0.
0, // Domain.
0xFE, // Coordination type 0xFE = HW_ALL
0x80 // Number of processors.
}
})
Name(SPSD,Package() // SW_ALL
{
Package() {5, // NumEntries. Current Value is 5.
0, // Revision. Current Value is 0.
0, // Domain.
0xFC, // Coordination type 0xFC = SW_ALL
0x80 // Number of processors.
}
})
//
// The _PSD object provides information to the OSPM related
// to P-State coordination between processors in a multi-processor
// configurations.
//
Method(_PSD,0)
{
If (And(\_SB.CFGD, PPM_TURBO_BOOST_MAX)) // Intel Turbo Boost Max 3.0
{
Store (0, Index(DerefOf(Index(HPSD, 0)),2)) // Domain
Store (1, Index(DerefOf(Index(HPSD, 0)),4)) // Number of processors belonging to the domain.
} Else {
Store (TCNT, Index(DerefOf(Index(HPSD, 0)),4))
Store (TCNT, Index(DerefOf(Index(SPSD, 0)),4))
}
If(And(PC00,0x0800)) // If Hardware co-ordination of P states
{
Return(HPSD)
}
Return(SPSD)
}
} // End of Scope(\_SB.PR00)
} // End of Definition Block
|
{
"pile_set_name": "Github"
}
|
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1
type JobExpansion interface{}
|
{
"pile_set_name": "Github"
}
|
using System;
using ModuleManager.Progress;
namespace ModuleManager.Patches.PassSpecifiers
{
public class LegacyPassSpecifier : IPassSpecifier
{
public bool CheckNeeds(INeedsChecker needsChecker, IPatchProgress progress)
{
if (needsChecker == null) throw new ArgumentNullException(nameof(needsChecker));
if (progress == null) throw new ArgumentNullException(nameof(progress));
return true;
}
public string Descriptor => ":LEGACY (default)";
}
}
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html lang="en" data-navbar="/account/navbar-profile.html">
<head>
<meta charset="utf-8" />
<title translate="yes">Establecer o perfil predeterminado</title>
<link href="/public/pure-min.css" rel="stylesheet">
<link href="/public/content.css" rel="stylesheet">
<link href="/public/content-additional.css" rel="stylesheet">
<base target="_top" href="/">
</head>
<body>
<h1 translate="yes">Establecer o perfil predeterminado</h1>
<p translate="yes">O teu perfil predeterminado serve como principal punto de contacto da túa conta.</p>
<div id="message-container"></div>
<form id="submit-form" method="post" class="pure-form" action="/account/set-default-profile" name="submit-form">
<fieldset>
<div class="pure-control-group">
<select id="profileid" name="profileid">
<option value="" translate="yes">
Selecciona perfil
</option>
</select>
</div>
<button id="submit-button" type="submit" class="pure-button pure-button-primary" translate="yes">Establecer o perfil predeterminado</button>
</fieldset>
</form>
<template id="success">
<div class="success message" translate="yes">
Éxito! O perfil é o teu estándar
</div>
</template>
<template id="unknown-error">
<div class="error message" translate="yes">
Erro! Produciuse un erro descoñecido
</div>
</template>
<template id="default-profile">
<div class="error message" translate="yes">
Erro! Este é xa o teu perfil predeterminado
</div>
</template>
<template id="profile-option">
<option value="${profile.profileid}">
${profile.contactEmail}, ${profile.firstName} ${profile.lastName}
</option>
</template>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
require([
'gitbook'
], function (gitbook) {
gitbook.events.bind('page.change', function () {
mermaid.init();
});
});
|
{
"pile_set_name": "Github"
}
|
TODO: Implement depth-major-sources packing paths for NEON
Platforms: ARM NEON
Coding time: M
Experimentation time: M
Skill required: M
Prerequisite reading:
doc/kernels.txt
doc/packing.txt
Model to follow/adapt:
internal/pack_neon.h
At the moment we have NEON optimized packing paths for WidthMajor sources.
We also need paths for DepthMajor sources.
This is harder because for DepthMajor sources, the size of each slice that
we have to load is the kernel's width, which is typically 12 (for the LHS)
or 4 (for the RHS). That's not very friendly to NEON vector-load instructions
which would allow us to load 8 or 16 entries, but not 4 or 12.
So you will have to load 4 entries at a time only. For that, the
vld1q_lane_u32 seems to be as good as you'll get. The other possible
approach would be to load (with plain scalar C++) four uint32's into a
temporary local buffer, and use vld1q_u8 on that. Some experimentation
will be useful here. For that, you can generate assembly with -save-temps
and make assembly easier to inspect by inserting inline assembly comments
such as
asm volatile("#hello");
|
{
"pile_set_name": "Github"
}
|
package de.peeeq.wurstscript.utils;
import de.peeeq.wurstscript.WLogger;
public class ExecutiontimeMeasure implements AutoCloseable {
private String message;
private long startTime;
public ExecutiontimeMeasure(String message) {
this.message = message;
this.startTime = System.currentTimeMillis();
}
@Override
public void close() {
long time = System.currentTimeMillis() - startTime;
WLogger.info("Executed " + message + " in " + time + "ms.");
}
}
|
{
"pile_set_name": "Github"
}
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by AsyncGenerator.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Collections.Generic;
using NUnit.Framework;
using NHibernate.Criterion;
namespace NHibernate.Test.NHSpecificTest.NH2546
{
using System.Threading.Tasks;
[TestFixture]
public class SetCommandParameterSizesFalseFixtureAsync : BugTestCase
{
protected override bool AppliesTo(Dialect.Dialect dialect)
{
return dialect is Dialect.MsSql2008Dialect;
}
protected override void OnSetUp()
{
using (ISession session = Sfi.OpenSession())
{
session.Persist(new Student() { StringTypeWithLengthDefined = "Julian Maughan" });
session.Persist(new Student() { StringTypeWithLengthDefined = "Bill Clinton" });
session.Flush();
}
}
protected override void OnTearDown()
{
using (ISession session = Sfi.OpenSession())
{
session.CreateQuery("delete from Student").ExecuteUpdate();
session.Flush();
}
base.OnTearDown();
}
[Test]
public async Task LikeExpressionWithinDefinedTypeSizeAsync()
{
using (ISession session = Sfi.OpenSession())
{
ICriteria criteria = session
.CreateCriteria<Student>()
.Add(Restrictions.Like("StringTypeWithLengthDefined", "Julian%"));
IList<Student> list = await (criteria.ListAsync<Student>());
Assert.That(list.Count, Is.EqualTo(1));
}
}
[Test]
public async Task LikeExpressionExceedsDefinedTypeSizeAsync()
{
// In this case we are forcing the usage of LikeExpression class where the length of the associated property is ignored
using (ISession session = Sfi.OpenSession())
{
ICriteria criteria = session
.CreateCriteria<Student>()
.Add(Restrictions.Like("StringTypeWithLengthDefined", "[a-z][a-z][a-z]ian%", MatchMode.Exact, null));
IList<Student> list = await (criteria.ListAsync<Student>());
Assert.That(list.Count, Is.EqualTo(1));
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
AxisControlBus
ControlBus
PathPlanning1
PathPlanning6
PathToAxisControlBus
GearType1
GearType2
Motor
Controller
AxisType1
AxisType2
MechanicalStructure
|
{
"pile_set_name": "Github"
}
|
文件说明:
1、base_dic_full.dic
hash索引 -- 字典带有词频和词性标志。
2、words_addons.dic
s 开头的表示停止词 u 后缀词(地名后缀、数学单位等) n 前导词(姓、汉字数词等) a 后导词(地区,部门等)
3、 not-build/base_dic_full.txt
没编译过的词典源码
4、重新编译词典的方法:
<?php
header('Content-Type: text/html; charset=utf-8');
require_once('phpanalysis.class.php');
$pa = new PhpAnalysis('utf-8', 'utf-8', false);
$pa->MakeDict( sourcefile, 16 , 'dict/base_dic_full.dic');
echo "OK";
?>
|
{
"pile_set_name": "Github"
}
|
DataverseUse test
Set import-private-functions=true
Query:
Let Variable [ Name=$txt ]
:=
LiteralExpr [STRING] [Hello World, I would like to inform you of the importance of Foo Bar. Yes, Foo Bar. Jürgen.]
Let Variable [ Name=$tokens ]
:=
FunctionCall asterix.hashed-word-tokens@1[
Variable [ Name=$txt ]
]
SELECT ELEMENT [
Variable [ Name=$token ]
]
FROM [ Variable [ Name=$tokens ]
AS Variable [ Name=$token ]
]
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" ?>
<component id="root" name="root">
<component id="system" name="system">
<!--McPAT will skip the components if number is set to 0 -->
<param name="number_of_cores" value="64"/>
<param name="number_of_L1Directories" value="0"/>
<param name="number_of_L2Directories" value="0"/>
<param name="number_of_L2s" value="64"/> <!-- This number means how many L2 clusters in each cluster there can be multiple banks/ports -->
<param name="number_of_L3s" value="0"/> <!-- This number means how many L3 clusters -->
<param name="number_of_NoCs" value="1"/>
<param name="homogeneous_cores" value="1"/><!--1 means homo -->
<param name="homogeneous_L2s" value="1"/>
<param name="homogeneous_L1Directorys" value="1"/>
<param name="homogeneous_L2Directorys" value="1"/>
<param name="homogeneous_L3s" value="1"/>
<param name="homogeneous_ccs" value="1"/><!--cache coherece hardware -->
<param name="homogeneous_NoCs" value="1"/>
<param name="core_tech_node" value="22"/><!-- nm -->
<param name="target_core_clockrate" value="3500"/><!--MHz -->
<param name="temperature" value="360"/> <!-- Kelvin -->
<param name="number_cache_levels" value="2"/>
<param name="interconnect_projection_type" value="0"/><!--0: agressive wire technology; 1: conservative wire technology -->
<param name="device_type" value="0"/><!--0: HP(High Performance Type); 1: LSTP(Low standby power) 2: LOP (Low Operating Power) -->
<param name="longer_channel_device" value="1"/><!-- 0 no use; 1 use when possible -->
<param name="machine_bits" value="64"/>
<param name="virtual_address_width" value="64"/>
<param name="physical_address_width" value="52"/>
<param name="virtual_memory_page_size" value="4096"/>
<stat name="total_cycles" value="100000"/>
<stat name="idle_cycles" value="0"/>
<stat name="busy_cycles" value="100000"/>
<!--This page size(B) is complete different from the page size in Main memo secction. this page size is the size of
virtual memory from OS/Archi perspective; the page size in Main memo secction is the actuall physical line in a DRAM bank -->
<!-- *********************** cores ******************* -->
<component id="system.core0" name="core0">
<!-- Core property -->
<param name="clock_rate" value="3500"/>
<param name="instruction_length" value="32"/>
<param name="opcode_width" value="9"/>
<!-- address width determins the tag_width in Cache, LSQ and buffers in cache controller
default value is machine_bits, if not set -->
<param name="machine_type" value="1"/><!-- 1 inorder; 0 OOO-->
<!-- inorder/OoO -->
<param name="number_hardware_threads" value="4"/>
<!-- number_instruction_fetch_ports(icache ports) is always 1 in single-thread processor,
it only may be more than one in SMT processors. BTB ports always equals to fetch ports since
branch information in consective branch instructions in the same fetch group can be read out from BTB once.-->
<param name="fetch_width" value="1"/>
<!-- fetch_width determins the size of cachelines of L1 cache block -->
<param name="number_instruction_fetch_ports" value="1"/>
<param name="decode_width" value="1"/>
<!-- decode_width determins the number of ports of the
renaming table (both RAM and CAM) scheme -->
<param name="issue_width" value="1"/>
<!-- issue_width determins the number of ports of Issue window and other logic
as in the complexity effective proccessors paper; issue_width==dispatch_width -->
<param name="commit_width" value="1"/>
<!-- commit_width determins the number of ports of register files -->
<param name="fp_issue_width" value="1"/>
<param name="prediction_width" value="0"/>
<!-- number of branch instructions can be predicted simultannouesl-->
<!-- Current version of McPAT does not distinguish int and floating point pipelines
Theses parameters are reserved for future use.-->
<param name="pipelines_per_core" value="1,1"/>
<!--integer_pipeline and floating_pipelines, if the floating_pipelines is 0, then the pipeline is shared-->
<param name="pipeline_depth" value="6,6"/>
<!-- pipeline depth of int and fp, if pipeline is shared, the second number is the average cycles of fp ops -->
<!-- issue and exe unit-->
<param name="ALU_per_core" value="1"/>
<!-- contains an adder, a shifter, and a logical unit -->
<param name="MUL_per_core" value="1"/>
<!-- For MUL and Div -->
<param name="FPU_per_core" value="0.125"/>
<!-- buffer between IF and ID stage -->
<param name="instruction_buffer_size" value="16"/>
<!-- buffer between ID and sche/exe stage -->
<param name="decoded_stream_buffer_size" value="16"/>
<param name="instruction_window_scheme" value="0"/><!-- 0 PHYREG based, 1 RSBASED-->
<!-- McPAT support 2 types of OoO cores, RS based and physical reg based-->
<param name="instruction_window_size" value="16"/>
<param name="fp_instruction_window_size" value="16"/>
<!-- the instruction issue Q as in Alpha 21264; The RS as in Intel P6 -->
<param name="ROB_size" value="80"/>
<!-- each in-flight instruction has an entry in ROB -->
<!-- registers -->
<param name="archi_Regs_IRF_size" value="32"/>
<param name="archi_Regs_FRF_size" value="32"/>
<!-- if OoO processor, phy_reg number is needed for renaming logic,
renaming logic is for both integer and floating point insts. -->
<param name="phy_Regs_IRF_size" value="80"/>
<param name="phy_Regs_FRF_size" value="80"/>
<!-- rename logic -->
<param name="rename_scheme" value="0"/>
<!-- can be RAM based(0) or CAM based(1) rename scheme
RAM-based scheme will have free list, status table;
CAM-based scheme have the valid bit in the data field of the CAM
both RAM and CAM need RAM-based checkpoint table, checkpoint_depth=# of in_flight instructions;
Detailed RAT Implementation see TR -->
<param name="register_windows_size" value="8"/>
<!-- how many windows in the windowed register file, sun processors;
no register windowing is used when this number is 0 -->
<!-- In OoO cores, loads and stores can be issued whether inorder(Pentium Pro) or (OoO)out-of-order(Alpha),
They will always try to exeute out-of-order though. -->
<param name="LSU_order" value="inorder"/>
<param name="store_buffer_size" value="32"/>
<!-- By default, in-order cores do not have load buffers -->
<param name="load_buffer_size" value="32"/>
<!-- number of ports refer to sustainable concurrent memory accesses -->
<param name="memory_ports" value="1"/>
<!-- max_allowed_in_flight_memo_instructions determins the # of ports of load and store buffer
as well as the ports of Dcache which is connected to LSU -->
<!-- dual-pumped Dcache can be used to save the extra read/write ports -->
<param name="RAS_size" value="32"/>
<!-- general
|
{
"pile_set_name": "Github"
}
|
log.level=${log.level}
log.path=${log.path}
dubbo.registry.address=${dubbo.registry.address}
dubbo.protocal.port=${dubbo.protocal.port}
dubbo.service.version=${dubbo.service.version}
ws.connect.path=${ws.connect.path}
ws.connect.port=${ws.connect.port}
ws.connect.bus.port=${ws.connect.bus.port}
service.name=ws_server
service.version=1.0
service.bus.name=bus_ws_server
service.bus.version=1.0
consul.host=${consul.host}
consul.port=${consul.port}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "jfr/recorder/checkpoint/types/jfrTypeSetUtils.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
static JfrSymbolId::CStringEntry* bootstrap = NULL;
JfrSymbolId::JfrSymbolId() :
_sym_table(new SymbolTable(this)),
_cstring_table(new CStringTable(this)),
_sym_list(NULL),
_cstring_list(NULL),
_sym_query(NULL),
_cstring_query(NULL),
_symbol_id_counter(1),
_class_unload(false) {
assert(_sym_table != NULL, "invariant");
assert(_cstring_table != NULL, "invariant");
bootstrap = new CStringEntry(0, (const char*)&BOOTSTRAP_LOADER_NAME);
assert(bootstrap != NULL, "invariant");
bootstrap->set_id(1);
_cstring_list = bootstrap;
}
JfrSymbolId::~JfrSymbolId() {
clear();
delete _sym_table;
delete _cstring_table;
delete bootstrap;
}
void JfrSymbolId::clear() {
assert(_sym_table != NULL, "invariant");
if (_sym_table->has_entries()) {
_sym_table->clear_entries();
}
assert(!_sym_table->has_entries(), "invariant");
assert(_cstring_table != NULL, "invariant");
if (_cstring_table->has_entries()) {
_cstring_table->clear_entries();
}
assert(!_cstring_table->has_entries(), "invariant");
_sym_list = NULL;
_symbol_id_counter = 1;
_sym_query = NULL;
_cstring_query = NULL;
assert(bootstrap != NULL, "invariant");
bootstrap->reset();
_cstring_list = bootstrap;
}
void JfrSymbolId::set_class_unload(bool class_unload) {
_class_unload = class_unload;
}
void JfrSymbolId::on_link(const SymbolEntry* entry) {
assert(entry != NULL, "invariant");
const_cast<Symbol*>(entry->literal())->increment_refcount();
assert(entry->id() == 0, "invariant");
entry->set_id(++_symbol_id_counter);
entry->set_list_next(_sym_list);
_sym_list = entry;
}
bool JfrSymbolId::on_equals(uintptr_t hash, const SymbolEntry* entry) {
assert(entry != NULL, "invariant");
assert(entry->hash() == hash, "invariant");
assert(_sym_query != NULL, "invariant");
return _sym_query == entry->literal();
}
void JfrSymbolId::on_unlink(const SymbolEntry* entry) {
assert(entry != NULL, "invariant");
const_cast<Symbol*>(entry->literal())->decrement_refcount();
}
static const char* resource_to_cstring(const char* resource_str) {
assert(resource_str != NULL, "invariant");
const size_t length = strlen(resource_str);
char* const c_string = JfrCHeapObj::new_array<char>(length + 1);
assert(c_string != NULL, "invariant");
strncpy(c_string, resource_str, length + 1);
return c_string;
}
void JfrSymbolId::on_link(const CStringEntry* entry) {
assert(entry != NULL, "invariant");
assert(entry->id() == 0, "invariant");
entry->set_id(++_symbol_id_counter);
const_cast<CStringEntry*>(entry)->set_literal(resource_to_cstring(entry->literal()));
entry->set_list_next(_cstring_list);
_cstring_list = entry;
}
static bool string_compare(const char* query, const char* candidate) {
assert(query != NULL, "invariant");
assert(candidate != NULL, "invariant");
const size_t length = strlen(query);
return strncmp(query, candidate, length) == 0;
}
bool JfrSymbolId::on_equals(uintptr_t hash, const CStringEntry* entry) {
assert(entry != NULL, "invariant");
assert(entry->hash() == hash, "invariant");
assert(_cstring_query != NULL, "invariant");
return string_compare(_cstring_query, entry->literal());
}
void JfrSymbolId::on_unlink(const CStringEntry* entry) {
assert(entry != NULL, "invariant");
JfrCHeapObj::free(const_cast<char*>(entry->literal()), strlen(entry->literal() + 1));
}
traceid JfrSymbolId::bootstrap_name(bool leakp) {
assert(bootstrap != NULL, "invariant");
if (leakp) {
bootstrap->set_leakp();
}
return 1;
}
traceid JfrSymbolId::mark(const Symbol* symbol, bool leakp) {
assert(symbol != NULL, "invariant");
return mark((uintptr_t)symbol->identity_hash(), symbol, leakp);
}
traceid JfrSymbolId::mark(uintptr_t hash, const Symbol* data, bool leakp) {
assert(data != NULL, "invariant");
assert(_sym_table != NULL, "invariant");
_sym_query = data;
const SymbolEntry& entry = _sym_table->lookup_put(hash, data);
if (_class_unload) {
entry.set_unloading();
}
if (leakp) {
entry.set_leakp();
}
return entry.id();
}
traceid JfrSymbolId::mark(uintptr_t hash, const char* str, bool leakp) {
assert(str != NULL, "invariant");
assert(_cstring_table != NULL, "invariant");
_cstring_query = str;
const CStringEntry& entry = _cstring_table->lookup_put(hash, str);
if (_class_unload) {
entry.set_unloading();
}
if (leakp) {
entry.set_leakp();
}
return entry.id();
}
/*
* jsr292 anonymous classes symbol is the external name +
* the identity_hashcode slash appended:
* java.lang.invoke.LambdaForm$BMH/22626602
*
* caller needs ResourceMark
*/
uintptr_t JfrSymbolId::unsafe_anonymous_klass_name_hash(const InstanceKlass* ik) {
assert(ik != NULL, "invariant");
assert(ik->is_anonymous(), "invariant");
const oop mirror = ik->java_mirror_no_keepalive();
assert(mirror != NULL, "invariant");
return (uintptr_t)mirror->identity_hash();
}
static const char* create_unsafe_anonymous_klass_symbol
|
{
"pile_set_name": "Github"
}
|
goog.module('nested.exported.enums');
/** @const */
exports = {
/** @const @enum {string} */
A: {
A1: 'a1',
},
// The structure of the AST changes if this extra property is present.
B: 0,
};
|
{
"pile_set_name": "Github"
}
|
/* Copyright 2019 Google 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.
==============================================================================*/
import {Polygon} from '/lib/math/polygon2d.js';
import * as moduleInterface from '/lib/module_interface.js';
import * as moduleTicker from '/client/modules/module_ticker.js';
import * as network from '/client/network/network.js';
import * as peerNetwork from '/client/network/peer.js';
import {easyLog} from '/lib/log.js';
import assert from '/lib/assert.js';
import asset from '/client/asset/asset.js';
import conform from '/lib/conform.js';
import inject from '/lib/inject.js';
import * as stateManager from '/client/state/state_manager.js';
import {TitleCard} from '/client/title_card.js';
import * as time from '/client/util/time.js';
import {delay} from '/lib/promise.js';
function createNewContainer(name) {
var newContainer = document.createElement('div');
newContainer.className = 'container';
newContainer.id = 't-' + time.now();
newContainer.setAttribute('moduleName', name);
return newContainer;
}
export const FadeTransition = {
start(container) {
if (container) {
container.style.opacity = 0.001;
document.querySelector('#containers').appendChild(container);
}
},
async perform(oldModule, newModule, deadline) {
if (newModule.name == '_empty') {
// Fading out.. so fade *out* the *old* container.
oldModule.container.style.transition =
'opacity ' + time.until(deadline).toFixed(0) + 'ms';
oldModule.container.style.opacity = 0.0;
} else {
newModule.container.style.transition =
'opacity ' + time.until(deadline).toFixed(0) + 'ms';
newModule.container.style.opacity = 1.0;
}
// TODO(applmak): Maybe wait until css says that the transition is done?
await delay(time.until(deadline));
}
}
export class ClientModule {
constructor(name, path, config, titleCard, deadline, geo, transition) {
// The module name.
this.name = name;
// The path to the main file of this module.
this.path = path;
// The module config.
this.config = config;
// The title card instance for this module.
this.titleCard = titleCard;
// Absolute time when this module is supposed to be visible. Module will
// actually be faded in by deadline + 5000ms.
this.deadline = deadline;
// The wall geometry.
this.geo = geo;
// The transition to use to transition to this module.
this.transition = transition;
// The dom container for the module's content.
this.container = null;
// Module class instance.
this.instance = null;
// Network instance for this module.
this.network = null;
}
// Deserializes from the json serialized form of ModuleDef in the server.
static deserialize(bits) {
if (bits.module.name == '_empty') {
return ClientModule.newEmptyModule(bits.time);
}
return new ClientModule(
bits.module.name,
bits.module.path,
bits.module.config,
new TitleCard(bits.module.credit),
bits.time,
new Polygon(bits.geo),
FadeTransition,
);
}
static newEmptyModule(deadline = 0, transition = FadeTransition) {
return new ClientModule(
'_empty',
'',
{},
new TitleCard({}),
deadline,
new Polygon([{x: 0, y:0}]),
transition
);
}
// Extracted out for testing purposes.
static async loadPath(path) {
return await import(path);
}
async instantiate() {
this.container = createNewContainer(this.name);
if (!this.path) {
return;
}
const INSTANTIATION_ID =
`${this.geo.extents.serialize()}-${this.deadline}`;
this.network = network.forModule(INSTANTIATION_ID);
let openNetwork = this.network.open();
this.stateManager = stateManager.forModule(network, INSTANTIATION_ID);
const fakeEnv = {
asset,
debug: easyLog('wall:module:' + this.name),
game: undefined,
network: openNetwork,
titleCard: this.titleCard.getModuleAPI(),
state: this.stateManager.open(),
wallGeometry: this.geo,
peerNetwork,
assert,
};
try {
const {load} = await ClientModule.loadPath(this.path);
if (!load) {
throw new Error(`${this.name} did not export a 'load' function!`);
}
const {client} = inject(load, fakeEnv);
conform(client, moduleInterface.Client);
this.instance = new client(this.config);
} catch (e) {
// something went very wrong. Wind everything down.!
this.network.close();
this.network = null;
throw e;
}
}
// Returns true if module is still OK.
async willBeShownSoon() {
if (!this.path) {
return;
}
// Prep the container for transition.
// TODO(applmak): Move the transition smarts out of ClientModule.
this.transition.start(this.container);
try {
await this.instance.willBeShownSoon(this.container, this.deadline);
} catch(e) {
this.dispose();
throw e;
}
}
// Returns true if module is still OK.
beginTransitionIn(deadline) {
if (!this.path) {
return;
}
moduleTicker.add(this.name, this.instance);
try {
this.instance.beginFadeIn(deadline);
} catch (e) {
this.dispose();
throw e;
}
}
finishTransitionIn() {
if (!this.path) {
return;
}
this.titleCard.enter();
this.instance.finishFadeIn();
}
beginTransitionOut(deadline) {
if (!this.path) {
return;
}
this.titleCard.exit();
this.instance.beginFadeOut(deadline);
}
finishTransitionOut() {
if (!this.path) {
return;
}
this.instance.finishFadeOut();
}
async performTransition(otherModule, transitionFinishDeadline) {
await this.transition.perform(otherModule, this, transitionFinishDeadline);
}
dispose() {
if (this.container) {
this.container.remove();
this.container = null;
}
if (!this.path) {
return;
}
this.titleCard.exit(); // Just in case.
moduleTicker.remove(this.instance);
if (this.network) {
this.stateManager.close();
this.stateManager = null;
this.network.close();
this.network = null;
}
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
namespace System.Data.Entity.TestModels.ProviderAgnosticModel
{
using System;
public enum AllTypesEnum
{
EnumValue0 = 0,
EnumValue1 = 1,
EnumValue2 = 2,
EnumValue3 = 3,
};
public class AllTypes
{
public int Id { get; set; }
public bool BooleanProperty { get; set; }
public byte ByteProperty { get; set; }
public DateTime DateTimeProperty { get; set; }
public decimal DecimalProperty { get; set; }
public double DoubleProperty { get; set; }
public byte[] FixedLengthBinaryProperty { get; set; }
public string FixedLengthStringProperty { get; set; }
public string FixedLengthUnicodeStringProperty { get; set; }
public float FloatProperty { get; set; }
public Guid GuidProperty { get; set; }
public short Int16Property { get; set; }
public int Int32Property { get; set; }
public long Int64Property { get; set; }
public byte[] MaxLengthBinaryProperty { get; set; }
public string MaxLengthStringProperty { get; set; }
public string MaxLengthUnicodeStringProperty { get; set; }
public TimeSpan TimeSpanProperty { get; set; }
public string VariableLengthStringProperty { get; set; }
public byte[] VariableLengthBinaryProperty { get; set; }
public string VariableLengthUnicodeStringProperty { get; set; }
public AllTypesEnum EnumProperty { get; set; }
}
}
|
{
"pile_set_name": "Github"
}
|
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 1