text
stringlengths 2
14k
| meta
dict |
|---|---|
# This contains libraries that a) do not change frequently or b) require c code compilation to work
# We install these libraries as a single layer in our base docker image
# To decode JWT tokens.
# cryptography is actually a transitive dependency, and only needed because PyJWT needs it
PyJWT==1.7.1
cryptography==2.9
# Postgres driver
psycopg2==2.8.4
# Mysql driver
mysqlclient==1.4.6
# MS SQL Server Driver
pymssql==2.1.4
# Oracle Driver
cx-Oracle==7.3.0
# For running flask in production
uwsgi==2.0.18
|
{
"pile_set_name": "Github"
}
|
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Using TensorFlow backend.\n"
]
}
],
"source": [
"import numpy as np\n",
"import json\n",
"from keras.models import Model\n",
"from keras.layers import Input\n",
"from keras.layers.convolutional import Conv2D\n",
"from keras import backend as K\n",
"from collections import OrderedDict"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def format_decimal(arr, places=6):\n",
" return [round(x * 10**places) / 10**places for x in arr]"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"DATA = OrderedDict()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### pipeline 1"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"random_seed = 1000\n",
"data_in_shape = (17, 17, 2)\n",
"\n",
"layers = [\n",
" Conv2D(5, (3,3), activation='relu', padding='same', strides=(2, 2), data_format='channels_last', use_bias=True),\n",
" Conv2D(4, (3,3), activation='linear', padding='same', strides=(1, 1), data_format='channels_last', use_bias=True),\n",
" Conv2D(2, (3,3), activation='relu', padding='valid', strides=(1, 1), data_format='channels_last', use_bias=True),\n",
" Conv2D(3, (5,5), activation='relu', padding='valid', strides=(1, 1), data_format='channels_last', use_bias=True),\n",
" Conv2D(2, (3,3), activation='linear', padding='valid', strides=(1, 1), data_format='channels_last', use_bias=True)\n",
"]\n",
"\n",
"input_layer = Input(shape=data_in_shape)\n",
"x = layers[0](input_layer)\n",
"for layer in layers[1:-1]:\n",
" x = layer(x)\n",
"output_layer = layers[-1](x)\n",
"model = Model(inputs=input_layer, outputs=output_layer)\n",
"\n",
"np.random.seed(random_seed)\n",
"data_in = 2 * np.random.random(data_in_shape) - 1\n",
"\n",
"# set weights to random (use seed for reproducibility)\n",
"weights = []\n",
"for i, w in enumerate(model.get_weights()):\n",
" np.random.seed(random_seed + i)\n",
" weights.append(2 * np.random.random(w.shape) - 1)\n",
"model.set_weights(weights)\n",
"\n",
"result = model.predict(np.array([data_in]))\n",
"data_out_shape = result[0].shape\n",
"data_in_formatted = format_decimal(data_in.ravel().tolist())\n",
"data_out_formatted = format_decimal(result[0].ravel().tolist())\n",
"\n",
"DATA['pipeline_01'] = {\n",
" 'input': {'data': data_in_formatted, 'shape': data_in_shape},\n",
" 'weights': [{'data': format_decimal(w.ravel().tolist()), 'shape': w.shape} for w in weights],\n",
" 'expected': {'data': data_out_formatted, 'shape': data_out_shape}\n",
"}"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### export for Keras.js tests"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import os\n",
"\n",
"filename = '../../test/data/pipeline/01.json'\n",
"if not os.path.exists(os.path.dirname(filename)):\n",
" os.makedirs(os.path.dirname(filename))\n",
"with open(filename, 'w') as f:\n",
" json.dump(DATA, f)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\"pipeline_01\": {\"input\": {\"data\": [0.307179, -0.769986, 0.900566, -0.035617, 0.744949, -0.575335, -0.918581, -0.205611, -0.533736, 0.683481, -0.585835, 0.484939, -0.215692, -0.635487, 0.487079, -0.860836, 0.770674, 0.905289, 0.862287, -0.169138, -0.942037, 0.964055, -0.320725, 0.413374, -0.276246, -0.929788, 0.710117, 0.314507, 0.531366, 0.108174, 0.770186, 0.808395, -0.979157, -0.850887, -0.510742, -0.73339, 0.39585, -0.20359, 0.766244, -0.637985, -0.135002, -0.963714, 0.382876, -0.060619, -0.743556, 0.782674, 0.836407, -0.853758, -0.909104, -0.122854, 0.203442, -0.379546, 0.363816, -0.581974, 0.039209, 0.131978, -0.117665, -0.724888, -0.572914, -0.733256, -0.355407, -0.532226, 0.054996, 0.131942, -0.123549, -0.356255, 0.119282, 0.730691, 0.694566, -0.784366, -0.367361, -0.181043, 0.374178, 0.404471, -0.107604, -0.159356, 0.605261, 0.077235, 0.847001, -0.876185, -0.264833, 0.940798, 0.398208, 0.781951, -0.492895, 0.451054, -0.593011, 0.075024, -0.526114, -0.127016, 0.596049, -0.383182, 0.243033, -0.120704, 0.826647, 0.317372, 0.
|
{
"pile_set_name": "Github"
}
|
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <stdio.h>
struct auth {
char name[32];
int auth;
};
struct auth *auth;
char *service;
int main(int argc, char **argv)
{
char line[128];
while(1) {
printf("[ auth = %p, service = %p ]\n", auth, service);
if(fgets(line, sizeof(line), stdin) == NULL) break;
if(strncmp(line, "auth ", 5) == 0) {
auth = malloc(sizeof(auth));
memset(auth, 0, sizeof(auth));
if(strlen(line + 5) < 31) {
strcpy(auth->name, line + 5);
}
}
if(strncmp(line, "reset", 5) == 0) {
free(auth);
}
if(strncmp(line, "service", 6) == 0) {
service = strdup(line + 7);
}
if(strncmp(line, "login", 5) == 0) {
if(auth->auth) {
printf("you have logged in already!\n");
} else {
printf("please enter your password\n");
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
namespace phpbu\App\Backup\Cleaner;
use phpbu\App\Backup\Cleaner;
use phpbu\App\Backup\Collector;
use phpbu\App\Result;
use phpbu\App\Backup\Target;
/**
* Simulator interface.
*
* @package phpbu
* @subpackage Backup
* @author Sebastian Feldmann <sebastian@phpbu.de>
* @copyright Sebastian Feldmann <sebastian@phpbu.de>
* @license https://opensource.org/licenses/MIT The MIT License (MIT)
* @link http://phpbu.de/
* @since Class available since Release 3.0.0
*/
interface Simulator extends Cleaner
{
/**
* Simulate the cleanup execution.
*
* @param \phpbu\App\Backup\Target $target
* @param \phpbu\App\Backup\Collector $collector
* @param \phpbu\App\Result $result
*/
public function simulate(Target $target, Collector $collector, Result $result);
}
|
{
"pile_set_name": "Github"
}
|
framework module Pods_DemoApp {
umbrella header "Pods-DemoApp-umbrella.h"
export *
module * { export * }
}
|
{
"pile_set_name": "Github"
}
|
@file:Suppress("NOTHING_TO_INLINE")
package io.ktor.utils.io.bits
import io.ktor.utils.io.core.internal.*
import java.nio.*
@Suppress("ACTUAL_WITHOUT_EXPECT", "EXPERIMENTAL_FEATURE_WARNING")
public actual inline class Memory @DangerousInternalIoApi constructor(public val buffer: ByteBuffer) {
/**
* Size of memory range in bytes.
*/
public actual inline val size: Long get() = buffer.limit().toLong()
/**
* Size of memory range in bytes represented as signed 32bit integer
* @throws IllegalStateException when size doesn't fit into a signed 32bit integer
*/
public actual inline val size32: Int get() = buffer.limit()
/**
* Returns byte at [index] position.
*/
public actual inline fun loadAt(index: Int): Byte = buffer.get(index)
/**
* Returns byte at [index] position.
*/
public actual inline fun loadAt(index: Long): Byte = buffer.get(index.toIntOrFail("index"))
/**
* Write [value] at the specified [index].
*/
public actual inline fun storeAt(index: Int, value: Byte) {
buffer.put(index, value)
}
/**
* Write [value] at the specified [index]
*/
public actual inline fun storeAt(index: Long, value: Byte) {
buffer.put(index.toIntOrFail("index"), value)
}
public actual fun slice(offset: Int, length: Int): Memory =
Memory(buffer.sliceSafe(offset, length))
public actual fun slice(offset: Long, length: Long): Memory {
return slice(offset.toIntOrFail("offset"), length.toIntOrFail("length"))
}
/**
* Copies bytes from this memory range from the specified [offset] and [length]
* to the [destination] at [destinationOffset].
* Copying bytes from a memory to itself is allowed.
*/
public actual fun copyTo(destination: Memory, offset: Int, length: Int, destinationOffset: Int) {
if (buffer.hasArray() && destination.buffer.hasArray() &&
!buffer.isReadOnly && !destination.buffer.isReadOnly
) {
System.arraycopy(
buffer.array(), buffer.arrayOffset() + offset,
destination.buffer.array(), destination.buffer.arrayOffset() + destinationOffset,
length
)
return
}
// NOTE: it is ok here to make copy since it will be escaped by JVM
// while temporary moving position/offset makes memory concurrent unsafe that is unacceptable
val srcCopy = buffer.duplicate().apply {
position(offset)
limit(offset + length)
}
val dstCopy = destination.buffer.duplicate().apply {
position(destinationOffset)
}
dstCopy.put(srcCopy)
}
/**
* Copies bytes from this memory range from the specified [offset] and [length]
* to the [destination] at [destinationOffset].
* Copying bytes from a memory to itself is allowed.
*/
public actual fun copyTo(destination: Memory, offset: Long, length: Long, destinationOffset: Long) {
copyTo(
destination, offset.toIntOrFail("offset"),
length.toIntOrFail("length"),
destinationOffset.toIntOrFail("destinationOffset")
)
}
public actual companion object {
public actual val Empty: Memory = Memory(ByteBuffer.allocate(0).order(ByteOrder.BIG_ENDIAN))
}
}
/**
* Copies bytes from this memory range from the specified [offset] and [length]
* to the [destination] at [destinationOffset].
*/
public actual fun Memory.copyTo(
destination: ByteArray,
offset: Int,
length: Int,
destinationOffset: Int
) {
if (buffer.hasArray() && !buffer.isReadOnly) {
System.arraycopy(
buffer.array(), buffer.arrayOffset() + offset,
destination, destinationOffset, length
)
return
}
// we need to make a copy to prevent moving position
buffer.duplicate().get(destination, destinationOffset, length)
}
/**
* Copies bytes from this memory range from the specified [offset] and [length]
* to the [destination] at [destinationOffset].
*/
public actual fun Memory.copyTo(
destination: ByteArray,
offset: Long,
length: Int,
destinationOffset: Int
) {
copyTo(destination, offset.toIntOrFail("offset"), length, destinationOffset)
}
/**
* Copies bytes from this memory range from the specified [offset]
* to the [destination] buffer.
*/
public fun Memory.copyTo(
destination: ByteBuffer,
offset: Int
) {
val size = destination.remaining()
if (buffer.hasArray() && !buffer.isReadOnly &&
destination.hasArray() && !destination.isReadOnly) {
val dstPosition = destination.position()
System.arraycopy(
buffer.array(), buffer.arrayOffset() + offset,
destination.array(), destination.arrayOffset() + dstPosition,
size
)
destination.position(dstPosition + size)
return
}
// we need to make a copy to prevent moving position
val source = buffer.duplicate().apply {
limit(offset + size)
position(offset)
}
destination.put(source)
}
/**
* Copies bytes from this memory range from the specified [offset]
* to the [destination] buffer.
*/
public fun Memory.copyTo(destination: ByteBuffer, offset: Long) {
copyTo(destination, offset.toIntOrFail("offset"))
}
/**
* Copy byte from this buffer moving it's position to the [destination] at [offset].
*/
public fun ByteBuffer.copyTo(destination: Memory, offset: Int) {
if (hasArray() && !isReadOnly) {
destination.storeByteArray(offset, array(), arrayOffset() + position(), remaining())
position(limit())
return
}
destination.buffer.sliceSafe(offset, remaining()).put(this)
}
private inline fun ByteBuffer.myDuplicate(): ByteBuffer {
duplicate().apply { return suppressNullCheck() }
}
private inline fun ByteBuffer.mySlice(): ByteBuffer {
slice().apply { return suppressNullCheck() }
}
private inline fun ByteBuffer.suppressNullCheck(): ByteBuffer {
return this
}
internal fun ByteBuffer.sliceSafe(offset: Int, length: Int): ByteBuffer {
return myDuplicate().apply { position(offset); limit(offset + length) }.mySlice()
}
/**
* Fill memory range starting at the specified [offset] with [value] repeated [count] times.
*/
public actual fun Memory.fill(offset: Long, count: Long, value: Byte) {
fill(offset.toIntOrFail("offset"), count.toIntOrFail("count"), value)
}
/**
* Fill memory range starting at the specified [offset] with [value] repeated [count] times.
*/
public actual fun Memory.fill(offset: Int, count: Int, value: Byte) {
for (index in offset until offset + count) {
buffer.put(index, value)
}
}
|
{
"pile_set_name": "Github"
}
|
"use strict";
module.exports = exports = build;
exports.usage = 'Attempts to compile the module by dispatching to node-gyp or nw-gyp';
var compile = require('./util/compile.js');
var handle_gyp_opts = require('./util/handle_gyp_opts.js');
var configure = require('./configure.js');
function do_build(gyp,argv,callback) {
handle_gyp_opts(gyp,argv,function(err,result) {
var final_args = ['build'].concat(result.gyp).concat(result.pre);
if (result.unparsed.length > 0) {
final_args = final_args.
concat(['--']).
concat(result.unparsed);
}
compile.run_gyp(final_args,result.opts,function(err) {
return callback(err);
});
});
}
function build(gyp, argv, callback) {
// Form up commands to pass to node-gyp:
// We map `node-pre-gyp build` to `node-gyp configure build` so that we do not
// trigger a clean and therefore do not pay the penalty of a full recompile
if (argv.length && (argv.indexOf('rebuild') > -1)) {
// here we map `node-pre-gyp rebuild` to `node-gyp rebuild` which internally means
// "clean + configure + build" and triggers a full recompile
compile.run_gyp(['clean'],{},function(err) {
if (err) return callback(err);
configure(gyp,argv,function(err) {
if (err) return callback(err);
return do_build(gyp,argv,callback);
});
});
} else {
return do_build(gyp,argv,callback);
}
}
|
{
"pile_set_name": "Github"
}
|
# DM Reader
<a name="2lzA4"></a>
## 一、插件名称
名称:**dmreader**
<a name="jVb3v"></a>
## 二、支持的数据源版本
**DM7、DM8**<br />
<a name="4lw0x"></a>
## 三、参数说明
- **jdbcUrl**
- 描述:针对关系型数据库的jdbc连接字符串
<br />jdbcUrl参考文档:[达梦官方文档](http://www.dameng.com/down.aspx?TypeId=12&FId=t14:12:14)
- 必选:是
- 默认值:无
- **username**
- 描述:数据源的用户名
- 必选:是
- 默认值:无
- **password**
- 描述:数据源指定用户名的密码
- 必选:是
- 默认值:无
- **where**
- 描述:筛选条件,reader插件根据指定的column、table、where条件拼接SQL,并根据这个SQL进行数据抽取。在实际业务场景中,往往会选择当天的数据进行同步,可以将where条件指定为gmt_create > time。
- 注意:不可以将where条件指定为limit 10,limit不是SQL的合法where子句。
- 必选:否
- 默认值:无
- **splitPk**
- 描述:当speed配置中的channel大于1时指定此参数,Reader插件根据并发数和此参数指定的字段拼接sql,使每个并发读取不同的数据,提升读取速率。
- 注意:
- 推荐splitPk使用表主键,因为表主键通常情况下比较均匀,因此切分出来的分片也不容易出现数据热点。
- 目前splitPk仅支持整形数据切分,`不支持浮点、字符串、日期等其他类型`。如果用户指定其他非支持类型,FlinkX将报错!
- 如果channel大于1但是没有配置此参数,任务将置为失败。
- 必选:否
- 默认值:无
- **queryTimeOut**
- 描述:查询超时时间,单位秒。
- 注意:当数据量很大,或者从视图查询,或者自定义sql查询时,可通过此参数指定超时时间。
- 必选:否
- 默认值:3000
- **customSql**
- 描述:自定义的查询语句,如果只指定字段不能满足需求时,可通过此参数指定查询的sql,可以是任意复杂的查询语句。
- 注意:
- 只能是查询语句,否则会导致任务失败;
- 查询语句返回的字段需要和column列表里的字段对应;
- 当指定了此参数时,connection里指定的table无效;
- 当指定此参数时,column必须指定具体字段信息,不能以*号代替;
- 必选:否
- 默认值:无
- **column**
- 描述:需要读取的字段。
- 格式:支持3种格式
<br />1.读取全部字段,如果字段数量很多,可以使用下面的写法:
```bash
"column":["*"]
```
2.只指定字段名称:
```json
"column":["ID","NAME"]
```
3.指定具体信息:
```json
"column": [{
"name": "COL",
"type": "datetime",
"format": "yyyy-MM-dd hh:mm:ss",
"value": "value"
}]
```
- 属性说明:
- name:字段名称,注意应该为大写,否则可能会出错
- type:字段类型,可以和数据库里的字段类型不一样,程序会做一次类型转换
- format:如果字段是时间字符串,可以指定时间的格式,将字段类型转为日期格式返回
- value:如果数据库里不存在指定的字段,则会把value的值作为常量列返回,如果指定的字段存在,当指定字段的值为null时,会以此value值作为默认值返回
- 必选:是
- 默认值:无
- **polling**
- 描述:是否开启间隔轮询,开启后会根据`pollingInterval`轮询间隔时间周期性的从数据库拉取数据。开启间隔轮询还需配置参数`pollingInterval`,`increColumn`,可以选择配置参数`startLocation`。若不配置参数`startLocation`,任务启动时将会从数据库中查询增量字段最大值作为轮询的开始位置。
- 必选:否
- 默认值:false
- **pollingInterval**
- 描述:轮询间隔时间,从数据库中拉取数据的间隔时间,默认为5000毫秒。
- 必选:否
- 默认值:5000
- **requestAccumulatorInterval**
- 描述:发送查询累加器请求的间隔时间。
- 必选:否
- 默认值:2
<a name="1LBc2"></a>
## 四、配置示例
<a name="xhLRp"></a>
#### 1、基础配置
```json
{
"job": {
"content": [
{
"reader": {
"name": "dmreader",
"parameter": {
"column": [
{
"name": "ID",
"type": "int"
},
{
"name": "AGE",
"type": "int"
}
],
"increColumn": "",
"startLocation": "",
"username": "SYSDBA",
"password": "SYSDBA",
"connection": [
{
"jdbcUrl": [
"jdbc:dm://localhost:5236"
],
"table": [
"PERSON.STUDENT"
]
}
],
"where": ""
}
},
"writer": {
"name": "streamwriter",
"parameter": {
"print": true
}
}
}
],
"setting": {
"speed": {
"channel": 1,
"bytes": 0
},
|
{
"pile_set_name": "Github"
}
|
/*
*************************************************************************************
* Copyright 2013 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In accordance with the terms of section 7 (7. Additional Terms.) of
* the GNU General Public License version 3, the copyright holders add
* the following Additional permissions:
* Notwithstanding to the terms of section 5 (5. Conveying Modified Source
* Versions) and 6 (6. Conveying Non-Source Forms.) of the GNU General
* Public License version 3, when you create a Related Module, this
* Related Module is not considered as a part of the work and may be
* distributed under the license agreement of your choice.
* A "Related Module" means a set of sources files including their
* documentation that, without modification of the Source Code, enables
* supplementary functions or services in addition to those offered by
* the Software.
*
* Rudder 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 Rudder. If not, see <http://www.gnu.org/licenses/>.
*
*************************************************************************************
*/
package bootstrap.liftweb
package checks
import java.io.File
import com.normation.eventlog.ModificationId
import com.normation.rudder.batch.{AsyncDeploymentActor, AutomaticStartDeployment}
import com.normation.rudder.domain.eventlog.RudderEventActor
import com.normation.utils.StringUuidGenerator
/**
* Check at webapp startup if a policy update was requested when webapp was stopped
* If flag file is present then start a new policy update
* This needs to be achieved after all tasks that could modify configuration
*/
class TriggerPolicyUpdate(
asyncGeneration : AsyncDeploymentActor
, uuidGen : StringUuidGenerator
) extends BootstrapChecks {
override val description = "Trigger policy update if it was requested during shutdown"
override def checks() : Unit = {
val filePath = asyncGeneration.triggerPolicyUpdateFlagPath
// Check if the flag file is present, and start a new policy update if needed
val file = new File(filePath)
try {
if (file.exists) {
// File exists, update policies
BootstrapLogger.logEffect.info(s"Flag file '${filePath}' found, Start a new policy update now")
asyncGeneration ! AutomaticStartDeployment(ModificationId(uuidGen.newUuid), RudderEventActor)
} else {
BootstrapLogger.logEffect.debug(s"Flag file '${filePath}' does not exist, No need to start a new policy update")
}
} catch {
// Exception while checking the file existence
case e : Exception =>
BootstrapLogger.logEffect.error(s"An error occurred while accessing flag file '${filePath}', cause is: ${e.getMessage}")
}
}
}
|
{
"pile_set_name": "Github"
}
|
/******************************************************************************
*
* Copyright(c) 2009-2012 Realtek Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* The full GNU General Public License is included in this distribution in the
* file called LICENSE.
*
* Contact Information:
* wlanfae <wlanfae@realtek.com>
* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
* Hsinchu 300, Taiwan.
*
* Larry Finger <Larry.Finger@lwfinger.net>
*
*****************************************************************************/
#ifndef __RTL92DE_SW_H__
#define __RTL92DE_SW_H__
extern spinlock_t globalmutex_power;
extern spinlock_t globalmutex_for_fwdownload;
extern spinlock_t globalmutex_for_power_and_efuse;
#endif
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2019 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/questions"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</layout>
|
{
"pile_set_name": "Github"
}
|
[
{
"category": "``apigateway``",
"description": "Update apigateway command to latest version",
"type": "api-change"
},
{
"category": "``ssm``",
"description": "Update ssm command to latest version",
"type": "api-change"
},
{
"category": "``apigatewayv2``",
"description": "Update apigatewayv2 command to latest version",
"type": "api-change"
},
{
"category": "``elbv2``",
"description": "Update elbv2 command to latest version",
"type": "api-change"
},
{
"category": "``application-insights``",
"description": "Update application-insights command to latest version",
"type": "api-change"
},
{
"category": "``fsx``",
"description": "Update fsx command to latest version",
"type": "api-change"
},
{
"category": "``service-quotas``",
"description": "Update service-quotas command to latest version",
"type": "api-change"
},
{
"category": "``resourcegroupstaggingapi``",
"description": "Update resourcegroupstaggingapi command to latest version",
"type": "api-change"
},
{
"category": "``securityhub``",
"description": "Update securityhub command to latest version",
"type": "api-change"
}
]
|
{
"pile_set_name": "Github"
}
|
/* GNU Ocrad - Optical Character Recognition program
Copyright (C) 2003-2015 Antonio Diaz Diaz.
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, see <http://www.gnu.org/licenses/>.
*/
#include <climits>
#include <cstdlib>
#include <vector>
#include "rectangle.h"
#include "segment.h"
#include "mask.h"
int Mask::left( const int row ) const
{
if( top() <= row && row <= bottom() && data[row-top()].valid() )
return data[row-top()].left;
return -1;
}
int Mask::right( const int row ) const
{
if( top() <= row && row <= bottom() && data[row-top()].valid() )
return data[row-top()].right;
return -1;
}
void Mask::top( const int t )
{
if( t == top() ) return;
if( t < top() ) data.insert( data.begin(), top() - t, Csegment() );
else data.erase( data.begin(), data.begin() + ( t - top() ) );
Rectangle::top( t );
}
void Mask::bottom( const int b )
{
if( b != bottom() ) { Rectangle::bottom( b ); data.resize( height() ); }
}
void Mask::add_mask( const Mask & m )
{
if( m.top() < top() ) top( m.top() );
if( m.bottom() > bottom() ) bottom( m.bottom() );
for( int i = m.top(); i <= m.bottom(); ++i )
{
Csegment & seg = data[i-top()];
seg.add_csegment( m.data[i-m.top()] );
if( seg.left < left() ) left( seg.left );
if( seg.right > right() ) right( seg.right );
}
}
void Mask::add_point( const int row, const int col )
{
if( row < top() ) top( row ); else if( row > bottom() ) bottom( row );
data[row-top()].add_point( col );
if( col < left() ) left( col ); else if( col > right() ) right( col );
}
void Mask::add_rectangle( const Rectangle & re )
{
if( re.top() < top() ) top( re.top() );
if( re.bottom() > bottom() ) bottom( re.bottom() );
const Csegment rseg( re.left(), re.right() );
for( int i = re.top(); i <= re.bottom(); ++i )
{
Csegment & seg = data[i-top()];
seg.add_csegment( rseg );
if( seg.left < left() ) left( seg.left );
if( seg.right > right() ) right( seg.right );
}
}
bool Mask::includes( const Rectangle & re ) const
{
if( re.top() < top() || re.bottom() > bottom() ) return false;
const Csegment seg( re.left(), re.right() );
for( int i = re.top(); i <= re.bottom(); ++i )
if( !data[i-top()].includes( seg ) ) return false;
return true;
}
bool Mask::includes( const int row, const int col ) const
{
return ( row >= top() && row <= bottom() && data[row-top()].includes( col ) );
}
int Mask::distance( const Rectangle & re ) const
{
const Csegment seg( re.left(), re.right() );
int mindist = INT_MAX;
for( int i = bottom(); i >= top(); --i )
{
const int vd = re.v_distance( i );
if( vd >= mindist ) { if( i < re.top() ) break; else continue; }
const int hd = data[i-top()].distance( seg );
if( hd >= mindist ) continue;
const int d = Rectangle::hypoti( hd, vd );
if( d < mindist ) mindist = d;
}
return mindist;
}
int Mask::distance( const int row, const int col ) const
{
int mindist = INT_MAX;
for( int i = bottom(); i >= top(); --i )
{
const int vd = std::abs( i - row );
if( vd >= mindist ) { if( i < row ) break; else continue; }
const int hd = data[i-top()].distance( col );
if( hd >= mindist ) continue;
const int d = Rectangle::hypoti( hd, vd );
if( d < mindist ) mindist = d;
}
return mindist;
}
|
{
"pile_set_name": "Github"
}
|
"""
Base class with plot generating commands.
Does not define any special non-GMT methods (savefig, show, etc).
"""
import contextlib
import numpy as np
import pandas as pd
from .clib import Session
from .exceptions import GMTError, GMTInvalidInput
from .helpers import (
build_arg_string,
dummy_context,
data_kind,
fmt_docstring,
use_alias,
kwargs_to_strings,
)
class BasePlotting:
"""
Base class for Figure and Subplot.
Defines the plot generating methods and a hook for subclasses to insert
special arguments (the _preprocess method).
"""
def _preprocess(self, **kwargs): # pylint: disable=no-self-use
"""
Make any changes to kwargs or required actions before plotting.
This method is run before all plotting commands and can be used to
insert special arguments into the kwargs or make any actions that are
required before ``call_module``.
For example, the :class:`pygmt.Figure` needs this to tell the GMT
modules to plot to a specific figure.
This is a dummy method that does nothing.
Returns
-------
kwargs : dict
The same input kwargs dictionary.
Examples
--------
>>> base = BasePlotting()
>>> base._preprocess(resolution='low')
{'resolution': 'low'}
"""
return kwargs
@fmt_docstring
@use_alias(
R="region",
J="projection",
A="area_thresh",
B="frame",
D="resolution",
I="rivers",
L="map_scale",
N="borders",
W="shorelines",
G="land",
S="water",
U="timestamp",
X="xshift",
Y="yshift",
p="perspective",
t="transparency",
)
@kwargs_to_strings(R="sequence", p="sequence")
def coast(self, **kwargs):
"""
Plot continents, shorelines, rivers, and borders on maps
Plots grayshaded, colored, or textured land-masses [or water-masses] on
maps and [optionally] draws coastlines, rivers, and political
boundaries. Alternatively, it can (1) issue clip paths that will
contain all land or all water areas, or (2) dump the data to an ASCII
table. The data files come in 5 different resolutions: (**f**)ull,
(**h**)igh, (**i**)ntermediate, (**l**)ow, and (**c**)rude. The full
resolution files amount to more than 55 Mb of data and provide great
detail; for maps of larger geographical extent it is more economical to
use one of the other resolutions. If the user selects to paint the
land-areas and does not specify fill of water-areas then the latter
will be transparent (i.e., earlier graphics drawn in those areas will
not be overwritten). Likewise, if the water-areas are painted and no
land fill is set then the land-areas will be transparent.
A map projection must be supplied.
Full option list at :gmt-docs:`coast.html`
{aliases}
Parameters
----------
{J}
{R}
area_thresh : int, float, or str
``'min_area[/min_level/max_level][+ag|i|s|S][+r|l][+ppercent]'``
Features with an area smaller than min_area in km^2 or of
hierarchical level that is lower than min_level or higher than
max_level will not be plotted.
{B}
C : str
Set the shade, color, or pattern for lakes and river-lakes.
resolution : str
Selects the resolution of the data set to use ((f)ull, (h)igh,
(i)ntermediate, (l)ow, and (c)rude).
land : str
Select filling or clipping of “dry” areas.
rivers : str
``'river[/pen]'``
Draw rivers. Specify the type of rivers and [optionally] append pen
attributes.
map_scale : str
``'[g|j|J|n|x]refpoint'``
Draws a simple map scale centered on the reference point specified.
borders : str
``'border[/pen]'``
Draw political boundaries. Specify the type of boundary and
[optionally] append pen attributes
water : str
Select filling or clipping of “wet” areas.
{U}
shorelines : str
``'[level/]pen'``
Draw shorelines [Default is no shorelines]. Append pen attributes.
{XY}
{p}
{t}
"""
kwargs = self._preprocess(**kwargs)
with Session() as lib:
lib.call_module("coast", build_arg_string(kwargs))
@fmt_docstring
@use_alias(
R="region",
J="projection",
B="frame",
C="cmap",
D="position",
F="box",
G="truncate",
W="scale",
X="xshift",
Y="yshift",
p="perspective",
t="transparency",
)
@kwargs_to_strings(R="sequence", G="sequence", p="sequence")
def colorbar(self, **kwargs):
"""
Plot a gray or color scale-bar on maps.
Both horizontal and vertical scales are supported. For CPTs with
gradational colors (i.e., the lower and upper boundary of an interval
have different colors) we will interpolate to give a continuous scale.
Variations in intensity due to shading/illumination may be displayed by
setting the option -I. Colors may be spaced according to a linear
scale, all be equal size, or by providing a file with individual tile
widths.
Full option list at :gmt-docs:`colorbar.html`
{aliases}
Parameters
----------
position : str
``[g|j|J|n|x]refpoint[+wlength[/width]][+e[b|f][length]][+h|v]
[+jjustify][+m[a|c|l|u]][+n[txt]][+odx[/dy]]``. Defines the
reference point on the map for the color scale using one of four
coordinate systems: (1) Use *g* for map (user) coordinates, (2) use
*j* or *J* for setting refpoint via a 2-char justification code
that refers to the (invisible) map domain rectangle, (3) use *n*
for normalized (0-1) coordinates, or (4) use *x* for plot
coordinates (inches, cm, etc.). All but *x* requires both *region*
and *projection* to be specified. Append +w followed by the length
and width of the color bar. If width is not specified then it is
set to 4% of the given length. Give a negative length to reverse
the scale bar. Append +h to get a horizontal scale
[Default is vertical (+v)]. By default, the anchor point on the
scale is assumed to be the bottom left corner (BL), but this can be
changed by appending +j followed by a 2-char justification code
*justify*.
box : bool or str
``[+cclearances][+gfill][+i[[gap/]pen]][+p[pen]][+r[radius]]
[+s[[dx/dy/][shade]]]``. If set to True, draws a rectangular
border around the color scale. Alternatively, specify a different
pen with +ppen. Add +gfill to fill the scale panel [no fill].
Append +cclearance where clearance is either gap, xgap/ygap, or
lgap/rgap/bgap/tgap where these items are uniform, separate in x-
and y-direction, or individual side spacings between scale and
border. Append +i to draw a secondary, inner border as well. We use
a uniform gap between borders of 2p and the MAP_DEFAULTS_PEN unless
other values are specified. Append +r to draw rounded rectangular
|
{
"pile_set_name": "Github"
}
|
.. _multigraph:
=================================================================
MultiGraph---Undirected graphs with self loops and parallel edges
=================================================================
Overview
========
.. currentmodule:: networkx
.. autoclass:: MultiGraph
Methods
=======
Adding and removing nodes and edges
-----------------------------------
.. autosummary::
:toctree: generated/
MultiGraph.__init__
MultiGraph.add_node
MultiGraph.add_nodes_from
MultiGraph.remove_node
MultiGraph.remove_nodes_from
MultiGraph.add_edge
MultiGraph.add_edges_from
MultiGraph.add_weighted_edges_from
MultiGraph.new_edge_key
MultiGraph.remove_edge
MultiGraph.remove_edges_from
MultiGraph.update
MultiGraph.clear
MultiGraph.clear_edges
Reporting nodes edges and neighbors
-----------------------------------
.. autosummary::
:toctree: generated/
MultiGraph.nodes
MultiGraph.__iter__
MultiGraph.has_node
MultiGraph.__contains__
MultiGraph.edges
MultiGraph.has_edge
MultiGraph.get_edge_data
MultiGraph.neighbors
MultiGraph.adj
MultiGraph.__getitem__
MultiGraph.adjacency
MultiGraph.nbunch_iter
Counting nodes edges and neighbors
----------------------------------
.. autosummary::
:toctree: generated/
MultiGraph.order
MultiGraph.number_of_nodes
MultiGraph.__len__
MultiGraph.degree
MultiGraph.size
MultiGraph.number_of_edges
Making copies and subgraphs
---------------------------
.. autosummary::
:toctree: generated/
MultiGraph.copy
MultiGraph.to_undirected
MultiGraph.to_directed
MultiGraph.subgraph
MultiGraph.edge_subgraph
|
{
"pile_set_name": "Github"
}
|
<?php
// Heading
$_['heading_title'] = 'Latest Orders';
// Text
$_['text_extension'] = 'Extensions';
$_['text_success'] = 'Success: You have modified dashboard recent orders!';
$_['text_edit'] = 'Edit Dashboard Recent Orders';
// Column
$_['column_order_id'] = 'Order ID';
$_['column_customer'] = 'Customer';
$_['column_status'] = 'Status';
$_['column_total'] = 'Total';
$_['column_date_added'] = 'Date Added';
$_['column_action'] = 'Action';
// Entry
$_['entry_status'] = 'Status';
$_['entry_sort_order'] = 'Sort Order';
$_['entry_width'] = 'Width';
// Error
$_['error_permission'] = 'Warning: You do not have permission to modify dashboard recent orders!';
|
{
"pile_set_name": "Github"
}
|
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.models.generated;
/**
* The Enum Signin Frequency Type.
*/
public enum SigninFrequencyType
{
/**
* days
*/
DAYS,
/**
* hours
*/
HOURS,
/**
* For SigninFrequencyType values that were not expected from the service
*/
UNEXPECTED_VALUE
}
|
{
"pile_set_name": "Github"
}
|
:
^a
^b
^c
^d
^e
^f
^g
^h
^i
^j
^k
^l
^m
^n
^o
^p
^q
^r
^s
^t
^u
^v
^w
^x
^y
^z
^0
^1
^2
^3
^4
^5
^6
^7
^8
^9
^A
^B
^C
^D
^E
^F
^G
^H
^I
^J
^K
^L
^M
^N
^O
^P
^Q
^R
^S
^T
^U
^V
^W
^X
^Y
^Z
|
{
"pile_set_name": "Github"
}
|
protocol NSLocking {
func lock()
func unlock()
}
class NSLock : NSObject, NSLocking {
func tryLock() -> Bool
func lock(before limit: NSDate) -> Bool
@available(iOS 2.0, *)
var name: String?
func lock()
func unlock()
}
class NSConditionLock : NSObject, NSLocking {
init(condition condition: Int)
var condition: Int { get }
func lock(whenCondition condition: Int)
func tryLock() -> Bool
func tryWhenCondition(_ condition: Int) -> Bool
func unlock(withCondition condition: Int)
func lock(before limit: NSDate) -> Bool
func lock(whenCondition condition: Int, before limit: NSDate) -> Bool
@available(iOS 2.0, *)
var name: String?
func lock()
func unlock()
}
class NSRecursiveLock : NSObject, NSLocking {
func tryLock() -> Bool
func lock(before limit: NSDate) -> Bool
@available(iOS 2.0, *)
var name: String?
func lock()
func unlock()
}
@available(iOS 2.0, *)
class NSCondition : NSObject, NSLocking {
func wait()
func wait(until limit: NSDate) -> Bool
func signal()
func broadcast()
@available(iOS 2.0, *)
var name: String?
@available(iOS 2.0, *)
func lock()
@available(iOS 2.0, *)
func unlock()
}
|
{
"pile_set_name": "Github"
}
|
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'name' => env('APP_NAME', 'HackIT'),
'description' => env("Algiers's big student hackathon"),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Fedeisas\LaravelMailCssInliner\LaravelMailCssInlinerServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Fac
|
{
"pile_set_name": "Github"
}
|
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-cache-factory</title>
<link href="style.css" rel="stylesheet" type="text/css">
<script src="../../../angular.min.js"></script>
<script src="script.js"></script>
</head>
<body ng-app="cacheExampleApp">
<div ng-controller="CacheController">
<input ng-model="newCacheKey" placeholder="Key">
<input ng-model="newCacheValue" placeholder="Value">
<button ng-click="put(newCacheKey, newCacheValue)">Cache</button>
<p ng-if="keys.length">Cached Values</p>
<div ng-repeat="key in keys">
<span ng-bind="key"></span>
<span>: </span>
<b ng-bind="cache.get(key)"></b>
</div>
<p>Cache Info</p>
<div ng-repeat="(key, value) in cache.info()">
<span ng-bind="key"></span>
<span>: </span>
<b ng-bind="value"></b>
</div>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
///////////////////////////////////////////////////////////////////////////////
// Name: src/generic/fontpickerg.cpp
// Purpose: wxGenericFontButton class implementation
// Author: Francesco Montorsi
// Modified by:
// Created: 15/04/2006
// Copyright: (c) Francesco Montorsi
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#if wxUSE_FONTPICKERCTRL
#include "wx/fontpicker.h"
#include "wx/fontdlg.h"
// ============================================================================
// implementation
// ============================================================================
wxIMPLEMENT_DYNAMIC_CLASS(wxGenericFontButton, wxButton);
// ----------------------------------------------------------------------------
// wxGenericFontButton
// ----------------------------------------------------------------------------
bool wxGenericFontButton::Create( wxWindow *parent, wxWindowID id,
const wxFont &initial, const wxPoint &pos,
const wxSize &size, long style,
const wxValidator& validator, const wxString &name)
{
wxString label = (style & wxFNTP_FONTDESC_AS_LABEL) ?
wxString() : // label will be updated by UpdateFont
_("Choose font");
// create this button
if (!wxButton::Create( parent, id, label, pos,
size, style, validator, name ))
{
wxFAIL_MSG( wxT("wxGenericFontButton creation failed") );
return false;
}
// and handle user clicks on it
Connect(GetId(), wxEVT_BUTTON,
wxCommandEventHandler(wxGenericFontButton::OnButtonClick),
NULL, this);
InitFontData();
m_selectedFont = initial.IsOk() ? initial : *wxNORMAL_FONT;
UpdateFont();
return true;
}
void wxGenericFontButton::InitFontData()
{
m_data.SetAllowSymbols(true);
m_data.SetColour(*wxBLACK);
m_data.EnableEffects(true);
}
void wxGenericFontButton::OnButtonClick(wxCommandEvent& WXUNUSED(ev))
{
// update the wxFontData to be shown in the dialog
m_data.SetInitialFont(m_selectedFont);
// create the font dialog and display it
wxFontDialog dlg(this, m_data);
if (dlg.ShowModal() == wxID_OK)
{
m_data = dlg.GetFontData();
SetSelectedFont(m_data.GetChosenFont());
// fire an event
wxFontPickerEvent event(this, GetId(), m_selectedFont);
GetEventHandler()->ProcessEvent(event);
}
}
void wxGenericFontButton::UpdateFont()
{
if ( !m_selectedFont.IsOk() )
return;
SetForegroundColour(m_data.GetColour());
if (HasFlag(wxFNTP_USEFONT_FOR_LABEL))
{
// use currently selected font for the label...
wxButton::SetFont(m_selectedFont);
}
if (HasFlag(wxFNTP_FONTDESC_AS_LABEL))
{
SetLabel(wxString::Format(wxT("%s, %d"),
m_selectedFont.GetFaceName().c_str(),
m_selectedFont.GetPointSize()));
}
}
#endif // wxUSE_FONTPICKERCTRL
|
{
"pile_set_name": "Github"
}
|
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2017 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See docs/COPYRIGHT.rdoc for more details.
#++
require 'spec_helper'
describe Queries::WorkPackages::Filter::WatcherFilter, type: :model do
let(:user) { FactoryBot.build_stubbed(:user) }
it_behaves_like 'basic query filter' do
let(:type) { :list }
let(:class_key) { :watcher_id }
let(:principal_loader) do
loader = double('principal_loader')
allow(loader)
.to receive(:user_values)
.and_return([])
loader
end
before do
allow(Queries::WorkPackages::Filter::PrincipalLoader)
.to receive(:new)
.with(project)
.and_return(principal_loader)
end
describe '#available?' do
it 'is true if the user is logged in' do
allow(User)
.to receive_message_chain(:current, :logged?)
.and_return true
expect(instance).to be_available
end
it 'is true if the user is allowed to see watchers and if there are users' do
allow(User)
.to receive_message_chain(:current, :logged?)
.and_return false
allow(User)
.to receive_message_chain(:current, :allowed_to?)
.and_return true
allow(principal_loader)
.to receive(:user_values)
.and_return([user])
expect(instance).to be_available
end
it 'is false if the user is allowed to see watchers but there are no users' do
allow(User)
.to receive_message_chain(:current, :logged?)
.and_return false
allow(User)
.to receive_message_chain(:current, :allowed_to?)
.and_return true
allow(principal_loader)
.to receive(:user_values)
.and_return([])
expect(instance).to_not be_available
end
it 'is false if the user is not allowed to see watchers but there are users' do
allow(User)
.to receive_message_chain(:current, :logged?)
.and_return false
allow(User)
.to receive_message_chain(:current, :allowed_to?)
.and_return false
allow(principal_loader)
.to receive(:user_values)
.and_return([user])
expect(instance).to_not be_available
end
end
describe '#allowed_values' do
context 'contains the me value if the user is logged in' do
before do
allow(User)
.to receive_message_chain(:current, :logged?)
.and_return true
expect(instance.allowed_values)
.to match_array [[I18n.t(:label_me), 'me']]
end
end
context 'contains the user values loaded if the user is allowed to see them' do
before do
allow(User)
.to receive_message_chain(:current, :logged?)
.and_return true
allow(User)
.to receive_message_chain(:current, :allowed_to?)
.and_return true
allow(principal_loader)
.to receive(:user_values)
.and_return([user])
expect(instance.allowed_values)
.to match_array [[I18n.t(:label_me), 'me'],
[user.name, user.id.to_s]]
end
end
end
describe '#ar_object_filter?' do
it 'is true' do
expect(instance)
.to be_ar_object_filter
end
end
describe '#value_objects' do
let(:user1) { FactoryBot.build_stubbed(:user) }
before do
allow(Principal)
.to receive(:where)
.with(id: [user1.id.to_s])
.and_return([user1])
instance.values = [user1.id.to_s]
end
it 'returns an array of users' do
expect(instance.value_objects)
.to match_array([user1])
end
end
end
end
|
{
"pile_set_name": "Github"
}
|
/* gzlib.c -- zlib functions common to reading and writing gzip files
* Copyright (C) 2004-2017 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "gzguts.h"
#if defined(_WIN32) && !defined(__BORLANDC__) && !defined(__MINGW32__)
# define LSEEK _lseeki64
#else
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
# define LSEEK lseek64
#else
# define LSEEK lseek
#endif
#endif
/* Local functions */
local void gz_reset OF((gz_statep));
local gzFile gz_open OF((const void *, int, const char *));
#if defined UNDER_CE
/* Map the Windows error number in ERROR to a locale-dependent error message
string and return a pointer to it. Typically, the values for ERROR come
from GetLastError.
The string pointed to shall not be modified by the application, but may be
overwritten by a subsequent call to gz_strwinerror
The gz_strwinerror function does not change the current setting of
GetLastError. */
char ZLIB_INTERNAL *gz_strwinerror (error)
DWORD error;
{
static char buf[1024];
wchar_t *msgbuf;
DWORD lasterr = GetLastError();
DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
| FORMAT_MESSAGE_ALLOCATE_BUFFER,
NULL,
error,
0, /* Default language */
(LPVOID)&msgbuf,
0,
NULL);
if (chars != 0) {
/* If there is an \r\n appended, zap it. */
if (chars >= 2
&& msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') {
chars -= 2;
msgbuf[chars] = 0;
}
if (chars > sizeof (buf) - 1) {
chars = sizeof (buf) - 1;
msgbuf[chars] = 0;
}
wcstombs(buf, msgbuf, chars + 1);
LocalFree(msgbuf);
}
else {
sprintf(buf, "unknown win32 error (%ld)", error);
}
SetLastError(lasterr);
return buf;
}
#endif /* UNDER_CE */
/* Reset gzip file state */
local void gz_reset(state)
gz_statep state;
{
state->x.have = 0; /* no output data available */
if (state->mode == GZ_READ) { /* for reading ... */
state->eof = 0; /* not at end of file */
state->past = 0; /* have not read past end yet */
state->how = LOOK; /* look for gzip header */
}
state->seek = 0; /* no seek request pending */
gz_error(state, Z_OK, NULL); /* clear error */
state->x.pos = 0; /* no uncompressed data yet */
state->strm.avail_in = 0; /* no input data yet */
}
/* Open a gzip file either by name or file descriptor. */
local gzFile gz_open(path, fd, mode)
const void *path;
int fd;
const char *mode;
{
gz_statep state;
z_size_t len;
int oflag;
#ifdef O_CLOEXEC
int cloexec = 0;
#endif
#ifdef O_EXCL
int exclusive = 0;
#endif
/* check input */
if (path == NULL)
return NULL;
/* allocate gzFile structure to return */
state = (gz_statep)malloc(sizeof(gz_state));
if (state == NULL)
return NULL;
state->size = 0; /* no buffers allocated yet */
state->want = GZBUFSIZE; /* requested buffer size */
state->msg = NULL; /* no error message yet */
/* interpret mode */
state->mode = GZ_NONE;
state->level = Z_DEFAULT_COMPRESSION;
state->strategy = Z_DEFAULT_STRATEGY;
state->direct = 0;
while (*mode) {
if (*mode >= '0' && *mode <= '9')
state->level = *mode - '0';
else
switch (*mode) {
case 'r':
state->mode = GZ_READ;
break;
#ifndef NO_GZCOMPRESS
case 'w':
state->mode = GZ_WRITE;
break;
case 'a':
state->mode = GZ_APPEND;
break;
#endif
case '+': /* can't read and write at the same time */
free(state);
return NULL;
case 'b': /* ignore -- will request binary anyway */
break;
#ifdef O_CLOEXEC
case 'e':
cloexec = 1;
break;
#endif
#ifdef O_EXCL
case 'x':
exclusive = 1;
break;
#endif
case 'f':
state->strategy = Z_FILTERED;
break;
case 'h':
state->strategy = Z_HUFFMAN_ONLY;
break;
case 'R':
state->strategy = Z_RLE;
break;
case 'F':
state->strategy = Z_FIXED;
break;
case 'T':
state->direct = 1;
break;
default: /* could consider as an error, but just ignore */
;
}
mode++;
}
/* must provide an "r", "w", or "a" */
if (state->mode == GZ_NONE) {
free(state);
return NULL;
}
/* can't force transparent read */
if (state->mode == GZ_READ) {
if (state->direct) {
free(state);
return NULL;
}
state->direct = 1; /* for empty file */
}
/* save the path name for error messages */
#ifdef WIDECHAR
if (fd == -2) {
len = wcstombs(NULL, path, 0);
if (len == (z_size_t)-1)
len = 0;
}
else
#endif
len = strlen((const char *)path);
state->path = (char *)malloc(len + 1);
if (state->path == NULL) {
free(state);
return NULL;
}
#ifdef WIDECHAR
if (fd == -2)
if (len)
wcstombs(state->path, path, len + 1);
else
*(state->path) = 0;
else
#endif
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
(void)snprintf(state->path, len + 1, "%s", (const char *)path);
#else
strcpy(state->path, path);
#endif
/* compute the flags for open() */
oflag =
#ifdef O_LARGEFILE
O_LARGEFILE |
#endif
#ifdef O_BINARY
O_BINARY |
#endif
#ifdef O_CLOEXEC
(cloexec ? O_CLOEXEC : 0) |
#endif
(state->mode == GZ_READ ?
O_RDONLY :
(O_WRONLY | O_CREAT |
#ifdef O_EXCL
(exclusive ? O_EXCL : 0) |
#endif
(state->mode == GZ_WRITE ?
O_TRUNC :
O_APPEND)));
/* open the file with the appropriate flags (or just use fd) */
state->fd = fd > -1 ? fd : (
#ifdef WIDECHAR
fd == -2 ? _wopen(path, oflag, 0666) :
#endif
open((const char *)path, oflag, 0666));
if (state->fd == -1) {
|
{
"pile_set_name": "Github"
}
|
############################################################
# <bsn.cl fy=2013 v=none>
#
# Copyright 2013, 2014 BigSwitch Networks, Inc.
#
#
#
# </bsn.cl>
############################################################
ARCH := amd64
PACKAGE_NAMES=onlp-x86-64-accton-as7716-32x-r0
include ../../../../../make/debuild.mk
|
{
"pile_set_name": "Github"
}
|
/*global doSweep */
$(document).ready(function() {
"use strict";
var arr = [20, 30, 44, 54, 55, 11, 78, 14, 13, 79, 12, 98];
doSweep("shellsortCON2", arr, 8);
});
|
{
"pile_set_name": "Github"
}
|
module network {
export class PlayCardsResolver extends IResolver{
public constructor() {
super();
}
/**
* 发送消息封包
*/
protected Package(data:any):any{
let event = {
action:131,
data:data
};
event = data;
return event;
}
/**
* 接收消息解包
*/
protected Parse(data:any){
return data;
}
}
}
|
{
"pile_set_name": "Github"
}
|
#coding=utf-8
#coding=utf-8
'''
Created on 2014-12-16
@author: Devuser
'''
import os
from gatesidelib.filehelper import FileHelper
from gatesidelib.common.simplelogger import SimpleLogger
class GitHelper(object):
'''
git command helper
'''
git_clonecommand="git clone -b {BRANCHNAME} {REPERTORY} {PROJECTPATH} >> "
git_pullcommand="git --git-dir={PROJECTPATH} pull {REPERTORY} >> "
git_logcommand="git --git-dir={PROJECTPATH} log {REVERSIONRANGE} >> "
git_diffcommand="git --git-dir={PROJECTPATH} diff {STARTVERSION} {ENDVERSION} --stat >> "
def __init__(self,giturl,projectpath,logfilepath):
'''
giturl: git repertory address
username: username for git repretory
password: password for git repertory
'''
self.project=projectpath
self.url=giturl
self.templog=logfilepath
def get_changecode_lines(self,startversion,endversion):
gitcommandtext=self.get_gitcommand(GitHelper.git_diffcommand, startversion, endversion,"","")
os.popen(gitcommandtext)
linecounts=self.get_linecounts(self.templog)
return linecounts
def clone_project(self,branchname):
if os.path.exists(self.project):
FileHelper.delete_dir_all(self.project)
gitcommandtext=self.get_gitcommand(GitHelper.git_clonecommand,"","","",branchname)
SimpleLogger.info(gitcommandtext)
os.popen(gitcommandtext)
def pull_project(self):
gitcommandtext=self.get_gitcommand(GitHelper.git_pullcommand,"","","","")
SimpleLogger.info(gitcommandtext)
os.popen(gitcommandtext)
def get_commitlog(self,reversionNumber):
gitcommandtext=self.get_gitcommand(GitHelper.git_logcommand,"","",reversionNumber,"")
FileHelper.delete_file(self.templog)
os.popen(gitcommandtext)
return FileHelper.read_lines(self.templog)
def save_commitlog(self,reversionNumber):
gitcommandtext=self.get_gitcommand(GitHelper.git_logcommand,"","",reversionNumber,"")
FileHelper.delete_file(self.templog)
os.popen(gitcommandtext)
def get_allcodelines(self,startversion,endversion):
gitcommandtext=self.get_gitcommand(GitHelper.git_diffcommand,startversion,endversion,"","")
FileHelper.delete_file(self.templog)
os.popen(gitcommandtext)
linecounts=FileHelper.get_linecounts(self.templog)
return linecounts
def get_gitcommand(self,command,startversion,endversion,versionNumber,branchname):
commandtext=command.replace("{STARTVERSION}",startversion)
commandtext=commandtext.replace("{ENDVERSION}",endversion)
commandtext=commandtext.replace("{REPERTORY}",self.url)
commandtext=commandtext.replace("{PROJECTPATH}",self.project)
commandtext=commandtext.replace("{REVERSIONRANGE}",versionNumber)
commandtext=commandtext.replace("{BRANCHNAME}",branchname)
return commandtext+self.templog
def get_linecounts(self,filename):
filehandler=open(filename,'r')
linelist=[line for line in filehandler]
linelist.reverse()
if linelist[0]:
if "," in linelist[0]:
changeinfos=linelist[0].split(',')
if len(changeinfos)==2:
new_codeline_counts=self.get_number_from_string(changeinfos[1])
deleted_codeline_counts=0
if len(changeinfos)==3:
new_codeline_counts=self.get_number_from_string(changeinfos[1])
deleted_codeline_counts=self.get_number_from_string(changeinfos[2])
else:
new_codeline_counts=0
deleted_codeline_counts=0
return [new_codeline_counts,deleted_codeline_counts]
def get_number_from_string(self,str_contains_num):
tempstr=str_contains_num.strip()
number=""
for char in tempstr:
if char.isdigit():
number=number+char
return number
|
{
"pile_set_name": "Github"
}
|
<html>
<head>
<title>CSS background/foreground images</title>
<style type="text/css">
body {
font-family:Verdana; font-size:10pt;
width:100%%; height:100%%;
background-color: window;
padding:10px;
margin:0;
}
header { font-size:150%; }
#c1
{
background-color: threedface;
}
img
{
margin: 6px;
}
img:hover
{
foreground-image-transformation: contrast-brightness-gamma(0.5,0.5, 1.3);
}
img:active
{
foreground-image-transformation: contrast-brightness-gamma(0.25,0.95, 1.0);
}
</style>
</head>
<body>
<header>Image color transformation. Move mouse over the block below. Image will change gamma. On press image will change contrast and brightness.</header>
<p id="c1"><img src="images/flowers.jpg" /> <img src="images/icon.png" /></p>
<pre>
:hover -> foreground-image-transformation: contrast-brightness-gamma(0.5,0.5, 1.3);
:active -> foreground-image-transformation: contrast-brightness-gamma(0.25,0.95, 1.0);
</pre>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
#
# Copyright (c) 2008-2020 the Urho3D project.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# Find DirectFB development library
#
# DIRECTFB_FOUND
# DIRECTFB_INCLUDE_DIRS
# DIRECTFB_LIBRARIES
# DIRECTFB_VERSION
#
find_path (DIRECTFB_INCLUDE_DIRS NAMES directfb.h PATH_SUFFIXES directfb DOC "DirectFB include directory")
find_library (DIRECTFB_LIBRARIES NAMES directfb DOC "DirectFB library")
if (NOT DIRECTFB_VERSION AND DIRECTFB_INCLUDE_DIRS AND EXISTS ${DIRECTFB_INCLUDE_DIRS}/directfb_version.h) # Only do this once
file (STRINGS ${DIRECTFB_INCLUDE_DIRS}/directfb_version.h DIRECTFB_VERSION REGEX "^.*DIRECTFB_(MAJOR|MINOR|MACRO)_VERSION.+\([^\)]*\).*$")
string (REGEX REPLACE "^.*DIRECTFB_MAJOR_VERSION.+\(([^\)]*)\).*$" \\1 DIRECTFB_MAJOR_VERSION "${DIRECTFB_VERSION}") # Stringify to guard against empty variable
string (REGEX REPLACE "^.*DIRECTFB_MINOR_VERSION.+\(([^\)]*)\).*$" \\1 DIRECTFB_MINOR_VERSION "${DIRECTFB_VERSION}")
string (REGEX REPLACE "^.*DIRECTFB_MICRO_VERSION.+\(([^\)]*)\).*$" \\1 DIRECTFB_MICRO_VERSION "${DIRECTFB_VERSION}")
set (DIRECTFB_VERSION "${DIRECTFB_MAJOR_VERSION}.${DIRECTFB_MINOR_VERSION}.${DIRECTFB_MICRO_VERSION}" CACHE INTERNAL "DirectFB version")
endif ()
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (DirectFB REQUIRED_VARS DIRECTFB_LIBRARIES DIRECTFB_INCLUDE_DIRS VERSION_VAR DIRECTFB_VERSION FAIL_MESSAGE "Could NOT find DirectFB development library")
mark_as_advanced (DIRECTFB_INCLUDE_DIRS DIRECTFB_LIBRARIES)
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2016 Cavium, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
*/
#ifndef __REQUEST_MANAGER_H
#define __REQUEST_MANAGER_H
#include "cpt_common.h"
#define TIME_IN_RESET_COUNT 5
#define COMPLETION_CODE_SIZE 8
#define COMPLETION_CODE_INIT 0
#define PENDING_THOLD 100
#define MAX_SG_IN_CNT 12
#define MAX_SG_OUT_CNT 13
#define SG_LIST_HDR_SIZE 8
#define MAX_BUF_CNT 16
union ctrl_info {
u32 flags;
struct {
#if defined(__BIG_ENDIAN_BITFIELD)
u32 reserved0:26;
u32 grp:3; /* Group bits */
u32 dma_mode:2; /* DMA mode */
u32 se_req:1;/* To SE core */
#else
u32 se_req:1; /* To SE core */
u32 dma_mode:2; /* DMA mode */
u32 grp:3; /* Group bits */
u32 reserved0:26;
#endif
} s;
};
union opcode_info {
u16 flags;
struct {
u8 major;
u8 minor;
} s;
};
struct cptvf_request {
union opcode_info opcode;
u16 param1;
u16 param2;
u16 dlen;
};
struct buf_ptr {
u8 *vptr;
dma_addr_t dma_addr;
u16 size;
};
struct cpt_request_info {
u8 incnt; /* Number of input buffers */
u8 outcnt; /* Number of output buffers */
u16 rlen; /* Output length */
union ctrl_info ctrl; /* User control information */
struct cptvf_request req; /* Request Information (Core specific) */
struct buf_ptr in[MAX_BUF_CNT];
struct buf_ptr out[MAX_BUF_CNT];
void (*callback)(int, void *); /* Kernel ASYNC request callabck */
void *callback_arg; /* Kernel ASYNC request callabck arg */
};
struct sglist_component {
union {
u64 len;
struct {
u16 len0;
u16 len1;
u16 len2;
u16 len3;
} s;
} u;
u64 ptr0;
u64 ptr1;
u64 ptr2;
u64 ptr3;
};
struct cpt_info_buffer {
struct cpt_vf *cptvf;
unsigned long time_in;
u8 extra_time;
struct cpt_request_info *req;
dma_addr_t dptr_baddr;
u32 dlen;
dma_addr_t rptr_baddr;
dma_addr_t comp_baddr;
u8 *in_buffer;
u8 *out_buffer;
u8 *gather_components;
u8 *scatter_components;
struct pending_entry *pentry;
volatile u64 *completion_addr;
volatile u64 *alternate_caddr;
};
/*
* CPT_INST_S software command definitions
* Words EI (0-3)
*/
union vq_cmd_word0 {
u64 u64;
struct {
u16 opcode;
u16 param1;
u16 param2;
u16 dlen;
} s;
};
union vq_cmd_word3 {
u64 u64;
struct {
#if defined(__BIG_ENDIAN_BITFIELD)
u64 grp:3;
u64 cptr:61;
#else
u64 cptr:61;
u64 grp:3;
#endif
} s;
};
struct cpt_vq_command {
union vq_cmd_word0 cmd;
u64 dptr;
u64 rptr;
union vq_cmd_word3 cptr;
};
void vq_post_process(struct cpt_vf *cptvf, u32 qno);
int process_request(struct cpt_vf *cptvf, struct cpt_request_info *req);
#endif /* __REQUEST_MANAGER_H */
|
{
"pile_set_name": "Github"
}
|
<?php
namespace GuzzleHttp\Exception;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
/**
* HTTP Request exception
*/
class RequestException extends TransferException
{
/** @var RequestInterface */
private $request;
/** @var ResponseInterface|null */
private $response;
/** @var array */
private $handlerContext;
public function __construct(
$message,
RequestInterface $request,
ResponseInterface $response = null,
\Exception $previous = null,
array $handlerContext = []
) {
// Set the code of the exception if the response is set and not future.
$code = $response && !($response instanceof PromiseInterface)
? $response->getStatusCode()
: 0;
parent::__construct($message, $code, $previous);
$this->request = $request;
$this->response = $response;
$this->handlerContext = $handlerContext;
}
/**
* Wrap non-RequestExceptions with a RequestException
*
* @param RequestInterface $request
* @param \Exception $e
*
* @return RequestException
*/
public static function wrapException(RequestInterface $request, \Exception $e)
{
return $e instanceof RequestException
? $e
: new RequestException($e->getMessage(), $request, null, $e);
}
/**
* Factory method to create a new exception with a normalized error message
*
* @param RequestInterface $request Request
* @param ResponseInterface $response Response received
* @param \Exception $previous Previous exception
* @param array $ctx Optional handler context.
*
* @return self
*/
public static function create(
RequestInterface $request,
ResponseInterface $response = null,
\Exception $previous = null,
array $ctx = []
) {
if (!$response) {
return new self(
'Error completing request',
$request,
null,
$previous,
$ctx
);
}
$level = (int) floor($response->getStatusCode() / 100);
if ($level === 4) {
$label = 'Client error';
$className = ClientException::class;
} elseif ($level === 5) {
$label = 'Server error';
$className = ServerException::class;
} else {
$label = 'Unsuccessful request';
$className = __CLASS__;
}
$uri = $request->getUri();
$uri = static::obfuscateUri($uri);
// Client Error: `GET /` resulted in a `404 Not Found` response:
// <html> ... (truncated)
$message = sprintf(
'%s: `%s %s` resulted in a `%s %s` response',
$label,
$request->getMethod(),
$uri,
$response->getStatusCode(),
$response->getReasonPhrase()
);
$summary = static::getResponseBodySummary($response);
if ($summary !== null) {
$message .= ":\n{$summary}\n";
}
return new $className($message, $request, $response, $previous, $ctx);
}
/**
* Get a short summary of the response
*
* Will return `null` if the response is not printable.
*
* @param ResponseInterface $response
*
* @return string|null
*/
public static function getResponseBodySummary(ResponseInterface $response)
{
return \GuzzleHttp\Psr7\get_message_body_summary($response);
}
/**
* Obfuscates URI if there is a username and a password present
*
* @param UriInterface $uri
*
* @return UriInterface
*/
private static function obfuscateUri(UriInterface $uri)
{
$userInfo = $uri->getUserInfo();
if (false !== ($pos = strpos($userInfo, ':'))) {
return $uri->withUserInfo(substr($userInfo, 0, $pos), '***');
}
return $uri;
}
/**
* Get the request that caused the exception
*
* @return RequestInterface
*/
public function getRequest()
{
return $this->request;
}
/**
* Get the associated response
*
* @return ResponseInterface|null
*/
public function getResponse()
{
return $this->response;
}
/**
* Check if a response was received
*
* @return bool
*/
public function hasResponse()
{
return $this->response !== null;
}
/**
* Get contextual information about the error from the underlying handler.
*
* The contents of this array will vary depending on which handler you are
* using. It may also be just an empty array. Relying on this data will
* couple you to a specific handler, but can give more debug information
* when needed.
*
* @return array
*/
public function getHandlerContext()
{
return $this->handlerContext;
}
}
|
{
"pile_set_name": "Github"
}
|
# SPDX-License-Identifier: GPL-2.0+
#
# Makefile for the HISILICON network device drivers.
#
ccflags-y := -I $(srctree)/drivers/net/ethernet/hisilicon/hns3
obj-$(CONFIG_HNS3_HCLGE) += hclge.o
hclge-objs = hclge_main.o hclge_cmd.o hclge_mdio.o hclge_tm.o hclge_mbx.o
hclge-$(CONFIG_HNS3_DCB) += hclge_dcb.o
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using AudioBand.AudioSource;
namespace AudioBand.TextFormatting
{
/// <summary>
/// A placeholder text that has values based on the current song.
/// </summary>
public abstract class TextPlaceholder
{
private readonly HashSet<string> _propertyFilter = new HashSet<string>();
/// <summary>
/// Initializes a new instance of the <see cref="TextPlaceholder"/> class.
/// </summary>
/// <param name="parameters">The parameters passed to the text format.</param>
/// <param name="audioSession">The audio session to use for the placeholder value.</param>
protected TextPlaceholder(IEnumerable<TextPlaceholderParameter> parameters, IAudioSession audioSession)
{
Session = audioSession;
Session.PropertyChanged += AudioSessionOnPropertyChanged;
// TODO parameters
}
/// <summary>
/// Occurs when the placeholders text has changed.
/// </summary>
public event EventHandler TextChanged;
/// <summary>
/// Gets the audio session.
/// </summary>
protected IAudioSession Session { get; private set; }
/// <summary>
/// Gets the current text value for the placeholder.
/// </summary>
/// <returns>The value.</returns>
public abstract string GetText();
/// <summary>
/// Raises the <see cref="TextChanged"/> event.
/// </summary>
protected void RaiseTextChanged()
{
TextChanged?.Invoke(this, EventArgs.Empty);
}
/// <summary>
/// Gets the parameter from the name.
/// </summary>
/// <param name="parameterName">The parameter name.</param>
/// <returns>The value of the parameter or null if not passed in.</returns>
protected string GetParameter(string parameterName)
{
return null;
}
/// <summary>
/// Adds a filter for <see cref="OnAudioSessionPropertyChanged"/>.
/// </summary>
/// <param name="audioSessionPropertyName">The property name to filter.</param>
protected void AddSessionPropertyFilter(string audioSessionPropertyName)
{
_propertyFilter.Add(audioSessionPropertyName);
}
/// <summary>
/// Called when the audio session property value changes.
/// </summary>
/// <param name="propertyName">The name of the property that changed.</param>
protected virtual void OnAudioSessionPropertyChanged(string propertyName)
{
}
private void AudioSessionOnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (_propertyFilter.Contains(e.PropertyName) || _propertyFilter.Count == 0)
{
OnAudioSessionPropertyChanged(e.PropertyName);
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
import decimalAdjust from "discourse/lib/decimal-adjust";
export default function (value, exp) {
return decimalAdjust("round", value, exp);
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2016 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.syndesis.server.api.generator;
import io.syndesis.common.model.api.APISummary;
import io.syndesis.common.model.connection.ConfigurationProperty;
import io.syndesis.common.model.connection.Connector;
import io.syndesis.common.model.connection.ConnectorGroup;
import io.syndesis.common.model.connection.ConnectorSettings;
import io.syndesis.common.model.connection.ConnectorTemplate;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class ConnectorGeneratorTest {
private final ConnectorGenerator generator = new ConnectorGenerator(new Connector.Builder()
.addTags("from-connector")
.build()) {
@Override
public Connector generate(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) {
return null;
}
@Override
public APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) {
return null;
}
@Override
protected String determineConnectorDescription(final ConnectorTemplate connectorTemplate,
final ConnectorSettings connectorSettings) {
return "test-description";
}
@Override
protected String determineConnectorName(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) {
return "test-name";
}
};
private final ConnectorTemplate template = new ConnectorTemplate.Builder()
.id("template-id")
.connectorGroup(new ConnectorGroup.Builder().id("template-group").build())
.putProperty("property1", new ConfigurationProperty.Builder().build())
.putProperty("property2", new ConfigurationProperty.Builder().build())
.build();
@Test
public void shouldCreateBaseConnectors() {
final ConnectorSettings settings = new ConnectorSettings.Builder().putConfiguredProperty("property2", "value2").build();
final Connector connector = generator.baseConnectorFrom(template, settings);
assertThat(connector).isEqualToIgnoringGivenFields(
new Connector.Builder()
.name("test-name")
.description("test-description")
.addTags("from-connector")
.connectorGroup(template.getConnectorGroup())
.connectorGroupId("template-group")
.properties(template.getConnectorProperties())
.putConfiguredProperty("property2", "value2")
.build(),
"id", "icon");
assertThat(connector.getIcon()).isEqualTo("data:image/svg+xml,dummy");
}
@Test
public void shouldCreateBaseConnectorsWithGivenNameAndDescription() {
final ConnectorSettings settings = new ConnectorSettings.Builder().name("given-name").description("given-description")
.putConfiguredProperty("property2", "value2").build();
final Connector connector = generator.baseConnectorFrom(template, settings);
assertThat(connector).isEqualToIgnoringGivenFields(
new Connector.Builder()
.name("given-name")
.description("given-description")
.addTags("from-connector")
.connectorGroup(template.getConnectorGroup())
.connectorGroupId("template-group")
.properties(template.getConnectorProperties())
.putConfiguredProperty("property2", "value2").build(),
"id", "icon");
assertThat(connector.getIcon()).isEqualTo("data:image/svg+xml,dummy");
}
}
|
{
"pile_set_name": "Github"
}
|
---
alias: iquaecuj6b
description: Upgrade to 1.7
---
# Upgrade to 1.7
## Overview
The [1.7 release](https://github.com/graphcool/prisma/releases/tag/1.7.0) of Prisma introduces a few major changes for the deployment process of a Prisma API. These changes mainly concern the service configuration within [`prisma.yml`](!alias-ufeshusai8) and a few commands of the Prisma CLI.
All changes are **backwards-compatible**, meaning there is no necessity to incorporate the changes right away. In general, the CLI will help you perform the required changes automatically where possible.
There are two main cases for how the CLI is helping you with the migration:
- **Your API is deployed to a [Prisma Cloud](https://www.prisma.io/cloud) server**: The CLI _automatically_ adjusts `prisma.yml` and writes the new `endpoint` property into it (while removing `service`, `stage` and `cluster`).
- **Your API is _NOT_ deployed to a [Prisma Cloud](https://www.prisma.io/cloud) server**: The CLI prints a warning and provides hints how to perform the updates (see below for more info).
## Terminology
- **Prisma Clusters** are renamed to **Prisma Servers**
- **Development Clusters** are renamed to **Prisma Sandbox**
## Service configuration in `prisma.yml`
### New YAML structure
The service configuration inside `prisma.yml` is based on a new YAML structure (find the updated docs [here](https://www.prisma.io/docs/reference/service-configuration/prisma.yml/yaml-structure-ufeshusai8)):
- The `service`, `stage` and `cluster` properties have been removed.
- A new property called `endpoint` has been added. The new `endpoint` effectively encodes the information of the three removed properties.
- A new property called `post-deploy` has been added (see [Post deployment hooks](#post-deployment-hooks) for more info).
- The `disableAuth` property has been removed. If you don't want your Prisma API to require authentication, simply omit the `secret` property.
- The `schema` property has been removed. Note that the Prisma CLI will not by default download the GraphQL schema (commonly called `prisma.graphql`) for your Prisma API any more! If you want to get access to the GraphQL schema of your Prisma API, you need to configure a [post deploment hook](#post-deployment-hooks) accordingly.
#### Example: Local deployment
Consider this **outdated** version of `prisma.yml`:
```yml
service: myservice
stage: dev
cluster: local
datamodel: datamodel.graphql
```
After migrated to **Prisma 1.7**, the file will have the following structure:
```yml
endpoint: http://localhost:4466/myservice/dev
datamodel: datamodel.graphql
```
### Example: Deploying to a Prisma Sandbox in the Cloud
Consider this **outdated** version of `prisma.yml`:
```yml
service: myservice
stage: dev
cluster: public-crocusraccoon-3/prisma-eu1
datamodel: datamodel.graphql
```
After migrated to **Prisma 1.7**, the file will have the following structure:
```yml
endpoint: https://eu1.prisma.sh/public-crocusraccoon-3/myservice/dev
datamodel: datamodel.graphql
```
### Introducing `default` service name and `default` stage
For convenience, two special values for the _service name_ and _stage_ parts of the Prisma `endpoint` have been introduced. Both values are called `default`. If not explicitly provided, the CLI will automatically infer them.
Concretely, this means that whenever the _service name_ and _stage_ are called `default`, you can omit them in the `endpoint` property of `prisma.yml`.
For example:
- `http://localhost:4466/default/default` can be written as `http://localhost:4466/`
- `https://eu1.prisma.sh/public-helixgoose-752/default/default` can be written as `https://eu1.prisma.sh/public-helixgoose-752/`
This is also relevant for the `/import` and `/export` endpoints of your API.
For example:
- `http://localhost:4466/default/default/import` can be written as `http://localhost:4466/import`
- `https://eu1.prisma.sh/public-helixgoose-752/default/default/export` can be written as `https://eu1.prisma.sh/public-helixgoose-752/export`
### Post deployment hooks
In Prisma 1.7, you can specify arbitrary terminal commands to be executed by the Prisma CLI after a deployment (i.e. after `prisma deploy` has terminated).
Here is an example that performs three tasks after a deployment:
1. Print "Deployment finished"
1. Download the GraphQL schema for the `db` project specified in `.graphqlconfig.yml`
1. Invoke code generation as specified in `.graphqlconfig.yml`
```yml
# in database/prisma.yml
hooks:
post-deploy:
- echo "Deployment finished"
- graphql get-schema --project db
- graphql prepare
```
## Prisma CLI
### Deprecating `local` commands
The `prisma local` commands are being deprecated in favor of using Docker commands directly. `prisma local` provided a convenient abstraction for certain Docker workflows. In 1.7, everything related to these Docker worfklows can be done manually using the [Docker CLI](https://docs.docker.com/engine/reference/commandline/cli/).
When running `prisma init` in Prisma 1.7, the CLI generates a `docker-compose.yml` file that specifies the images for two Docker containers:
- `prisma`: This is the image for the Prisma API that turns your database into a GraphQL API.
- `db`: This is the image for the connected database, e.g. `mysql`.
Here's what the raw version of this generated `docker-compose.yml` file:
```yml
version: '3'
services:
prisma:
image: prismagraphql/prisma:1.7
restart: always
ports:
- "4466:4466"
environment:
PRISMA_CONFIG: |
managementApiSecret: my-server-secret-123
port: 4466
databases:
default:
connector: mysql # or `postgres`
active: true
host: db
port: 3306 # or `5432` for `postgres`
user: root
password: prisma
db:
container_name: prisma-db
image: mysql:5.7
restart: always
environment:
MYSQL_USER: root
MYSQL_ROOT_PASSWORD: prisma
```
> **Note**: You can learn more about the different properties of the `docker-compose.yml` file in the [reference](!alias-aira9zama5) or directly in the [Docker documentation](https://docs.docker.com/compose/compose-file/).
### Authenticating against Prisma servers running on Docker
When using the Prisma CLI to deploy and manage your Prisma APIs against a Docker-based [Prisma server](!alias-eu2ood0she), the CLI needs to authenticate its interactions (otherwise anyone with access to the endpoint of the server would be able to arbitrarily modify your Prisma APIs).
In previous Prisma versions, the CLI used an _asymmetric_ authentication approach based on a public/private-keypair. The public key was deployed along with the Prisma cluster and the private key was stored in the _cluster registry_ as the `clusterSecret`. This `clusterSecret` was used by the CLI to authenticate its requests.
With Prisma 1.7, a _symmetric_ authentication approach is introduced. This means the key stored on the deployed Prisma server is identical to the key used by the CLI.
#### Providing the key to the Prisma server
Prisma servers running on Docker receive their keys via the `managementApiSecret` key in `docker-compose.yml`. When deploying the Prisma server using `docker-compose up -d`, the key will be stored on the server
|
{
"pile_set_name": "Github"
}
|
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build windows
package main
import (
"fmt"
"time"
"golang.org/x/sys/windows/svc"
"golang.org/x/sys/windows/svc/mgr"
)
func startService(name string) error {
m, err := mgr.Connect()
if err != nil {
return err
}
defer m.Disconnect()
s, err := m.OpenService(name)
if err != nil {
return fmt.Errorf("could not access service: %v", err)
}
defer s.Close()
err = s.Start("is", "manual-started")
if err != nil {
return fmt.Errorf("could not start service: %v", err)
}
return nil
}
func controlService(name string, c svc.Cmd, to svc.State) error {
m, err := mgr.Connect()
if err != nil {
return err
}
defer m.Disconnect()
s, err := m.OpenService(name)
if err != nil {
return fmt.Errorf("could not access service: %v", err)
}
defer s.Close()
status, err := s.Control(c)
if err != nil {
return fmt.Errorf("could not send control=%d: %v", c, err)
}
timeout := time.Now().Add(10 * time.Second)
for status.State != to {
if timeout.Before(time.Now()) {
return fmt.Errorf("timeout waiting for service to go to state=%d", to)
}
time.Sleep(300 * time.Millisecond)
status, err = s.Query()
if err != nil {
return fmt.Errorf("could not retrieve service status: %v", err)
}
}
return nil
}
|
{
"pile_set_name": "Github"
}
|
<Ticket_ProcessEDocReply xmlns="http://xml.amadeus.com/TATRES_15_2_1A">
<msgActionDetails>
<messageFunctionDetails>
<messageFunction>131</messageFunction>
</messageFunctionDetails>
<responseType>7</responseType>
</msgActionDetails>
<error>
<errorDetails>
<errorCode>118</errorCode>
</errorDetails>
</error>
<textInfo>
<freeTextQualification>
<textSubjectQualifier>4</textSubjectQualifier>
<informationType>23</informationType>
</freeTextQualification>
<freeText>SYSTEM UNABLE TO PROCESS</freeText>
</textInfo>
</Ticket_ProcessEDocReply>
|
{
"pile_set_name": "Github"
}
|
find $SRC_DIR -type f
if [[ ! -f "$SRC_DIR/mypkg/awesomeheader.h" ]]; then
exit 1
fi
# when a file shadows the parent directory name
if [[ ! -f "$SRC_DIR/mypkg/mypkg" ]]; then
exit 1
fi
echo "found source files OK"
exit 0
|
{
"pile_set_name": "Github"
}
|
0:01 A key design feature for working with classes and object-oriented programming
0:04 is modeling and layers, going from the most general to the most specific.
0:09 So, we started with a creature class,
0:12 and a creature class has a name and a level and it's just a generic creature,
0:16 it could be anything, so it could be a squirrel as we saw,
0:20 it could be a dragon, it could be a toad.
0:23 Any kind of creature we can think of, we could model with the original creature class,
0:26 and that's great because it's very applicable but there are differences
0:30 between a dragon and a toad, for example,
0:33 maybe the dragon breathes fire, not too many toads breed fire,
0:36 and so we can use inheritance to add additional specializations to our more specific types,
0:43 so we can have a specific dragon class, which can stand in for a creature,
0:47 it is a creature but it also has more behaviors and more variables.
0:51 Here we have our initializer, the __init__
0:54 and you see we take the required parameters
0:57 and data to pass along to the creature class,
1:00 in order to create a creature, in order for the dragon to be a creature,
1:03 it has to supply a name and a level,
1:05 so we can get to the creature's initializer saying super().__init__
1:09 and pass name and level and that allows the creature to do
1:12 whatever sort of setup it does when it gets created,
1:14 but we also want to have a scale thickness for our dragon,
1:17 so we create another field specific only to dragons,
1:20 and we say self.scale_thickness = whatever they passed in.
1:23 So in addition to having name and level we get from Creature,
1:26 we also have a scale thickness,
1:28 so that adds more data we can also add additional behaviors,
1:30 here we have added a breed_fire method.
1:33 So the way we create a derived type in Python,
1:36 is we just say class, because it is a class, the name of the class, Dragon,
1:40 and in parenthesis the name of the base type.
1:44 And then, other than that, and using "super",
1:46 this is basically the same as creating any other class.
|
{
"pile_set_name": "Github"
}
|
/*******************************************************************************
* Copyright 2012-2019 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.
* *****************************************************************************
*
* AWS Tools for Windows (TM) PowerShell (TM)
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Text;
using Amazon.PowerShell.Common;
using Amazon.Runtime;
using Amazon.GroundStation;
using Amazon.GroundStation.Model;
namespace Amazon.PowerShell.Cmdlets.GS
{
/// <summary>
/// Returns a mission profile.
/// </summary>
[Cmdlet("Get", "GSMissionProfile")]
[OutputType("Amazon.GroundStation.Model.GetMissionProfileResponse")]
[AWSCmdlet("Calls the AWS Ground Station GetMissionProfile API operation.", Operation = new[] {"GetMissionProfile"}, SelectReturnType = typeof(Amazon.GroundStation.Model.GetMissionProfileResponse))]
[AWSCmdletOutput("Amazon.GroundStation.Model.GetMissionProfileResponse",
"This cmdlet returns an Amazon.GroundStation.Model.GetMissionProfileResponse object containing multiple properties. The object can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack."
)]
public partial class GetGSMissionProfileCmdlet : AmazonGroundStationClientCmdlet, IExecutor
{
#region Parameter MissionProfileId
/// <summary>
/// <para>
/// <para>UUID of a mission profile.</para>
/// </para>
/// </summary>
#if !MODULAR
[System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)]
#else
[System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, Mandatory = true)]
[System.Management.Automation.AllowEmptyString]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
public System.String MissionProfileId { get; set; }
#endregion
#region Parameter Select
/// <summary>
/// Use the -Select parameter to control the cmdlet output. The default value is '*'.
/// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.GroundStation.Model.GetMissionProfileResponse).
/// Specifying the name of a property of type Amazon.GroundStation.Model.GetMissionProfileResponse will result in that property being returned.
/// Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public string Select { get; set; } = "*";
#endregion
#region Parameter PassThru
/// <summary>
/// Changes the cmdlet behavior to return the value passed to the MissionProfileId parameter.
/// The -PassThru parameter is deprecated, use -Select '^MissionProfileId' instead. This parameter will be removed in a future version.
/// </summary>
[System.Obsolete("The -PassThru parameter is deprecated, use -Select '^MissionProfileId' instead. This parameter will be removed in a future version.")]
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public SwitchParameter PassThru { get; set; }
#endregion
protected override void ProcessRecord()
{
base.ProcessRecord();
var context = new CmdletContext();
// allow for manipulation of parameters prior to loading into context
PreExecutionContextLoad(context);
#pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute
if (ParameterWasBound(nameof(this.Select)))
{
context.Select = CreateSelectDelegate<Amazon.GroundStation.Model.GetMissionProfileResponse, GetGSMissionProfileCmdlet>(Select) ??
throw new System.ArgumentException("Invalid value for -Select parameter.", nameof(this.Select));
if (this.PassThru.IsPresent)
{
throw new System.ArgumentException("-PassThru cannot be used when -Select is specified.", nameof(this.Select));
}
}
else if (this.PassThru.IsPresent)
{
context.Select = (response, cmdlet) => this.MissionProfileId;
}
#pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute
context.MissionProfileId = this.MissionProfileId;
#if MODULAR
if (this.MissionProfileId == null && ParameterWasBound(nameof(this.MissionProfileId)))
{
WriteWarning("You are passing $null as a value for parameter MissionProfileId which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.");
}
#endif
// allow further manipulation of loaded context prior to processing
PostExecutionContextLoad(context);
var output = Execute(context) as CmdletOutput;
ProcessOutput(output);
}
#region IExecutor Members
public object Execute(ExecutorContext context)
{
var cmdletContext = context as CmdletContext;
// create request
var request = new Amazon.GroundStation.Model.GetMissionProfileRequest();
if (cmdletContext.MissionProfileId != null)
{
request.MissionProfileId = cmdletContext.MissionProfileId;
}
CmdletOutput output;
// issue call
var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);
try
{
var response = CallAWSServiceOperation(client, request);
object pipelineOutput = null;
pipelineOutput = cmdletContext.Select(response, this);
output = new CmdletOutput
{
PipelineOutput = pipelineOutput,
ServiceResponse = response
};
}
catch (Exception e)
{
output = new CmdletOutput { ErrorResponse = e };
}
return output;
}
public ExecutorContext CreateContext()
{
return new CmdletContext();
}
#endregion
#region AWS Service Operation Call
private Amazon.GroundStation.Model.GetMissionProfileResponse CallAWSServiceOperation(IAmazonGroundStation client, Amazon.GroundStation.Model.GetMissionProfileRequest request)
{
Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Ground Station", "GetMissionProfile");
try
{
#if DESKTOP
return client.GetMissionProfile(request);
#elif CORECLR
return client.GetMissionProfileAsync(request).GetAwaiter().GetResult();
#else
#error "Unknown build edition"
#endif
}
catch (AmazonServiceException exc)
{
var webException = exc.InnerException as System.Net.WebException;
if (webException != null)
{
throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
}
throw;
}
}
#endregion
internal partial class CmdletContext : ExecutorContext
{
public System.String MissionProfileId { get; set; }
public System.Func<Amazon.GroundStation.Model.GetMissionProfileResponse, GetGSMissionProfileCmdlet, object> Select { get; set; }
|
{
"pile_set_name": "Github"
}
|
---
-api-id: E:Windows.UI.Xaml.Controls.SwipeItem.Invoked
-api-type: winrt event
---
<!-- Event syntax.
public event TypedEventHandler Invoked<SwipeItem, SwipeItemInvokedEventArgs>
-->
# Windows.UI.Xaml.Controls.SwipeItem.Invoked
## -description
Occurs when user interaction indicates that the command represented by this item should execute.
## -xaml-syntax
```xaml
<SwipeItem Invoked="eventhandler"/>
```
## -remarks
## -see-also
## -examples
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0"?>
<entity_profile>
<profile id="Logistician">
<name>Logistician</name>
</profile>
<profile id="Translator">
<name>Translator</name>
</profile>
<profile id="Salesman">
<name>Salesman</name>
</profile>
</entity_profile>
|
{
"pile_set_name": "Github"
}
|
/// Copyright (c) 2012 Ecma International. All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms"). Any redistribution of this code must retain the above
/// copyright and this notice and otherwise comply with the Use Terms.
/**
* @path ch15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-267.js
* @description Object.defineProperty - 'O' is an Array, 'name' is an array index named property, name is accessor property and 'desc' is accessor descriptor, test updating the [[Get]] attribute value of 'name' from undefined to function object (15.4.5.1 step 4.c)
*/
function testcase() {
var arrObj = [];
function getFunc() {
return 12;
}
Object.defineProperty(arrObj, "0", {
get: undefined,
configurable: true
});
Object.defineProperty(arrObj, "0", {
get: getFunc
});
return accessorPropertyAttributesAreCorrect(arrObj, "0", getFunc, undefined, undefined, false, true);
}
runTestCase(testcase);
|
{
"pile_set_name": "Github"
}
|
xof 0303txt 0032
Material Material_1 {
1.000000;1.000000;1.000000;1.000000;;
3.200000;
0.000000;0.000000;0.000000;;
0.000000;0.000000;0.000000;;
TextureFilename {
"C:\WORK\FPS Creator\MAPS2\texturebank\ww2\walls\concrete\W_b_ALL_01_D2.tga";
}
}
Frame wall_ALL_a_E {
FrameTransformMatrix {
1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000;;
}
Mesh {
216;
-50.000004;50.000004;0.000000;,
50.000004;50.000004;-6.600000;,
-50.000004;50.000004;-6.600000;,
-50.000004;50.000004;0.000000;,
50.000004;50.000004;0.000000;,
50.000004;50.000004;-6.600000;,
-50.000004;50.000004;0.000000;,
-50.000004;50.000004;-6.600000;,
-50.000004;48.500004;-8.000001;,
-50.000004;50.000004;-6.600000;,
50.000004;48.500004;-8.000001;,
-50.000004;48.500004;-8.000001;,
-50.000004;50.000004;-6.600000;,
50.000004;50.000004;-6.600000;,
50.000004;48.500004;-8.000001;,
50.000004;50.000004;-6.600000;,
50.000004;50.000004;0.000000;,
50.000004;48.500004;-8.000001;,
-50.000004;50.000004;0.000000;,
-50.000004;48.500004;-8.000001;,
-50.000004;36.900002;-8.000001;,
-50.000004;48.500004;-8.000001;,
50.000004;36.900002;-8.000001;,
-50.000004;36.900002;-8.000001;,
-50.000004;48.500004;-8.000001;,
50.000004;48.500004;-8.000001;,
50.000004;36.900002;-8.000001;,
50.000004;48.500004;-8.000001;,
50.000004;50.000004;0.000000;,
50.000004;36.900002;-8.000001;,
-50.000004;50.000004;0.000000;,
-50.000004;-38.500004;-5.000000;,
-50.000004;-50.000004;0.000000;,
-50.000004;50.000004;0.000000;,
-50.000004;32.100002;-5.000000;,
-50.000004;-38.500004;-5.000000;,
50.000004;32.100002;-5.000000;,
50.000004;-50.000004;0.000000;,
50.000004;-38.500004;-5.000000;,
50.000004;32.100002;-5.000000;,
50.000004;50.000004;0.000000;,
50.000004;-50.000004;0.000000;,
-50.000004;-50.000004;0.000000;,
-50.000004;-38.500004;-5.000000;,
-50.000004;-42.300003;-8.000001;,
50.000004;-38.500004;-5.000000;,
50.000004;-50.000004;0.000000;,
50.000004;-42.300003;-8.000001;,
-50.000004;-50.000004;0.000000;,
-50.000004;-42.300003;-8.000001;,
-50.000004;-50.000004;-8.000001;,
50.000004;-42.300003;-8.000001;,
50.000004;-50.000004;0.000000;,
50.000004;-50.000004;-8.000001;,
-50.000004;-50.000004;0.000000;,
-50.000004;-50.000004;-8.000001;,
-37.700001;-50.000004;-8.000001;,
-37.700001;-42.300003;-8.000001;,
-50.000004;-42.300003;-8.000001;,
-50.000004;-38.500004;-5.000000;,
-37.700001;-50.000004;-8.000001;,
-50.000004;-42.300003;-8.000001;,
-37.700001;-42.300003;-8.000001;,
-37.700001;-50.000004;-8.000001;,
-50.000004;-50.000004;-8.000001;,
-50.000004;-42.300003;-8.000001;,
-50.000004;-50.000004;0.000000;,
-12.800001;-50.000004;-8.000001;,
0.000000;-50.000004;0.000000;,
-50.000004;-50.000004;0.000000;,
-37.700001;-50.000004;-8.000001;,
-12.800001;-50.000004;-8.000001;,
-37.700001;-42.300003;-8.000001;,
0.000000;-38.500004;-5.000000;,
-12.800001;-42.300003;-8.000001;,
-37.700001;-42.300003;-8.000001;,
-50.000004;-38.500004;-5.000000;,
0.000000;-38.500004;-5.000000;,
-37.700001;-47.200001;-12.036000;,
-12.800001;-42.300003;-8.000001;,
-12.800001;-47.200001;-12.036000;,
-37.700001;-47.200001;-12.036000;,
-37.700001;-42.300003;-8.000001;,
-12.800001;-42.300003;-8.000001;,
-12.800001;-50.000004;-12.036000;,
-37.700001;-47.200001;-12.036000;,
-12.800001;-47.200001;-12.036000;,
-12.800001;-50.000004;-12.036000;,
-37.700001;-50.000004;-12.036000;,
-37.700001;-47.200001;-12.036000;,
0.000000;-50.000004;0.000000;,
-12.800001;-50.000004;-8.000001;,
12.800001;-50.000004;-8.000001;,
-12.800001;-42.300003;-8.000001;,
0.000000;-38.500004;-5.000000;,
12.800001;-42.300003;-8.000001;,
-12.800001;-50.000004;-8.000001;,
12.800001;-42.300003;-8.000001;,
12.800001;-50.000004;-8.000001
|
{
"pile_set_name": "Github"
}
|
---
id: design-principles
title: Design Principles
---
:::caution
This section is a work in progress.
:::
- **Little to learn** - Docusaurus should be easy to learn and use as the API is quite small. Most things will still be achievable by users, even if it takes them more code and more time to write. Not having abstractions is better than having the wrong abstractions, and we don't want users to have to hack around the wrong abstractions. Mandatory talk - [Minimal API Surface Area](https://www.youtube.com/watch?v=4anAwXYqLG8).
- **Intuitive** - Users will not feel overwhelmed when looking at the project directory of a Docusaurus project or adding new features. It should look intuitive and easy to build on top of, using approaches they are familiar with.
- **Layered architecture** - The separations of concerns between each layer of our stack (content/theming/styling) should be clear - well-abstracted and modular.
- **Sensible defaults** - Common and popular performance optimizations and configurations will be done for users but they are given the option to override them.
- **No vendor-lock in** - Users are not required to use the default plugins or CSS, although they are highly encouraged to. Certain core lower-level infra level pieces like React Loadable, React Router cannot be swapped because we do default performance optimization on them. But not higher level ones, such as choice of Markdown engines, CSS frameworks, CSS methodology will be entirely up to users.
## How Docusaurus works
<!-- moved in from how Docusaurus works @yangshun -->
We believe that as developers, knowing how a library works is helpful in allowing us to become better at using it. Hence we're dedicating effort into explaining the architecture and various components of Docusaurus with the hope that users reading it will gain a deeper understanding of the tool and be even more proficient in using it.
<!--
Explain the principles that guide the development of Docusaurus.
References
---
- https://www.gatsbyjs.org/docs/behind-the-scenes/
- https://reactjs.org/docs/design-principles.html
- https://v1.vuepress.vuejs.org/miscellaneous/design-concepts.html
-->
|
{
"pile_set_name": "Github"
}
|
// Configure enzyme adapter
const enzyme = require('enzyme');
const Adapter = require('enzyme-adapter-react-16');
enzyme.configure({ adapter: new Adapter() });
// require all modules ending in ".spec" from the
// current directory and all subdirectories
const testsContext = require.context('./src', true, /.spec$/);
testsContext.keys().forEach(testsContext);
const componentsContext = require.context('./src', true, /.ts$/);
componentsContext.keys().forEach(componentsContext);
|
{
"pile_set_name": "Github"
}
|
export * from './styles'
export * from './accessibility'
export * from './common'
export * from './strings'
export * from './window'
export * from './isFixed'
|
{
"pile_set_name": "Github"
}
|
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: luofei614<weibo.com/luofei614>
// +----------------------------------------------------------------------
namespace Think\Upload\Driver;
class Sae{
/**
* Storage的Domain
* @var string
*/
private $domain = '';
private $rootPath = '';
/**
* 本地上传错误信息
* @var string
*/
private $error = '';
/**
* 构造函数,设置storage的domain, 如果有传配置,则domain为配置项,如果没有传domain为第一个路径的目录名称。
* @param mixed $config 上传配置
*/
public function __construct($config = null){
if(is_array($config) && !empty($config['domain'])){
$this->domain = strtolower($config['domain']);
}
}
/**
* 检测上传根目录
* @param string $rootpath 根目录
* @return boolean true-检测通过,false-检测失败
*/
public function checkRootPath($rootpath){
$rootpath = trim($rootpath,'./');
if(!$this->domain){
$rootpath = explode('/', $rootpath);
$this->domain = strtolower(array_shift($rootpath));
$rootpath = implode('/', $rootpath);
}
$this->rootPath = $rootpath;
$st = new \SaeStorage();
if(false===$st->getDomainCapacity($this->domain)){
$this->error = '您好像没有建立Storage的domain['.$this->domain.']';
return false;
}
return true;
}
/**
* 检测上传目录
* @param string $savepath 上传目录
* @return boolean 检测结果,true-通过,false-失败
*/
public function checkSavePath($savepath){
return true;
}
/**
* 保存指定文件
* @param array $file 保存的文件信息
* @param boolean $replace 同名文件是否覆盖
* @return boolean 保存状态,true-成功,false-失败
*/
public function save(&$file, $replace=true) {
$filename = ltrim($this->rootPath .'/'. $file['savepath'] . $file['savename'],'/');
$st = new \SaeStorage();
/* 不覆盖同名文件 */
if (!$replace && $st->fileExists($this->domain,$filename)) {
$this->error = '存在同名文件' . $file['savename'];
return false;
}
/* 移动文件 */
if (!$st->upload($this->domain,$filename,$file['tmp_name'])) {
$this->error = '文件上传保存错误!['.$st->errno().']:'.$st->errmsg();
return false;
}else{
$file['url'] = $st->getUrl($this->domain, $filename);
}
return true;
}
public function mkdir(){
return true;
}
/**
* 获取最后一次上传错误信息
* @return string 错误信息
*/
public function getError(){
return $this->error;
}
}
|
{
"pile_set_name": "Github"
}
|
OUTPUT := ./
ifeq ("$(origin O)", "command line")
ifneq ($(O),)
OUTPUT := $(O)/
endif
endif
ifeq ($(strip $(STATIC)),true)
LIBS = -L../ -L$(OUTPUT) -lm
OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o \
$(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/sysfs.o
else
LIBS = -L../ -L$(OUTPUT) -lm -lcpupower
OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o
endif
CFLAGS += -D_GNU_SOURCE -I../lib -DDEFAULT_CONFIG_FILE=\"$(confdir)/cpufreq-bench.conf\"
$(OUTPUT)%.o : %.c
$(ECHO) " CC " $@
$(QUIET) $(CC) -c $(CFLAGS) $< -o $@
$(OUTPUT)cpufreq-bench: $(OBJS)
$(ECHO) " CC " $@
$(QUIET) $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
all: $(OUTPUT)cpufreq-bench
install:
mkdir -p $(DESTDIR)/$(sbindir)
mkdir -p $(DESTDIR)/$(bindir)
mkdir -p $(DESTDIR)/$(docdir)
mkdir -p $(DESTDIR)/$(confdir)
install -m 755 $(OUTPUT)cpufreq-bench $(DESTDIR)/$(sbindir)/cpufreq-bench
install -m 755 cpufreq-bench_plot.sh $(DESTDIR)/$(bindir)/cpufreq-bench_plot.sh
install -m 644 README-BENCH $(DESTDIR)/$(docdir)/README-BENCH
install -m 755 cpufreq-bench_script.sh $(DESTDIR)/$(docdir)/cpufreq-bench_script.sh
install -m 644 example.cfg $(DESTDIR)/$(confdir)/cpufreq-bench.conf
clean:
rm -f $(OUTPUT)*.o
rm -f $(OUTPUT)cpufreq-bench
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>EtoApp.1</string>
<key>CFBundleIdentifier</key>
<string>com.example.EtoApp.1</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>CFBundleIconFile</key>
<string>Icon.icns</string>
</dict>
</plist>
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#include "leveldb/options.h"
#include "leveldb/comparator.h"
#include "leveldb/env.h"
namespace leveldb {
Options::Options()
: comparator(BytewiseComparator()),
create_if_missing(false),
error_if_exists(false),
paranoid_checks(false),
env(Env::Default()),
info_log(NULL),
write_buffer_size(4<<20),
max_open_files(1000),
block_cache(NULL),
block_size(4096),
block_restart_interval(16),
max_file_size(2<<20),
compression(kSnappyCompression),
reuse_logs(false),
filter_policy(NULL) {
}
} // namespace leveldb
|
{
"pile_set_name": "Github"
}
|
# KDU
## Kernel Driver Utility
#### System Requirements
+ x64 Windows 7/8/8.1/10;
+ Administrative privilege is required.
# Purpose and Features
The purpose of this tool is to give a simple way to explore Windows kernel/components without doing a lot of additional work or setting up local debugger.
It features:
+ Protected Processes Hijacking via Process object modification;
+ Driver Signature Enforcement Overrider (similar to DSEFIx);
+ Driver loader for bypassing Driver Signature Enforcement (similar to TDL/Stryker);
+ Support of various vulnerable drivers use as functionality "providers".
#### Usage
###### KDU -ps ProcessID
###### KDU -map filename
###### KDU -dse value
###### KDU -prv ProviderID
###### KDU -list
* -prv - optional, select vulnerability driver provider;
* -ps - modify process object of given ProcessID;
* -map - load input file as code buffer to kernel mode and run it;
* -dse - write user defined value to the system DSE state flags;
* -list - list currently available providers.
Example:
+ kdu -ps 1234
+ kdu -map c:\driverless\mysuperhack.sys
+ kdu -prv 1 -ps 1234
+ kdu -prv 1 -map c:\driverless\mysuperhack.sys
+ kdu -dse 0
+ kdu -dse 6
Run on Windows 10 20H2 (precomplied version)
<img src="https://raw.githubusercontent.com/hfiref0x/kdu/master/Help/kdu1.png" width="600" />
Compiled and run on Windows 8.1
<img src="https://raw.githubusercontent.com/hfiref0x/kdu/master/Help/kdu2.png" width="600" />
Run on Windows 7 SP1 fully patched (precomplied version)
<img src="https://raw.githubusercontent.com/hfiref0x/kdu/master/Help/kdu3.png" width="600" />
Run on Windows 10 19H2 (precompiled version, SecureBoot enabled)
<img src="https://raw.githubusercontent.com/hfiref0x/kdu/master/Help/kdu4.png" width="600" />
#### Limitations of -map command
Due to unusual way of loading that is not involving standard kernel loader, but uses overwriting already loaded modules with shellcode, there are some limitations:
+ Loaded drivers MUST BE specially designed to run as "driverless";
That mean you cannot use parameters specified at your DriverEntry as they won't be valid. That also mean you can not load *any* drivers but only specially designed or you need to alter shellcode responsible for driver mapping.
+ No SEH support for target drivers;
There is no SEH code in x64. Instead of this you have table of try/except/finally regions which must be in the executable image described by pointer in PE header. If there is an exception occured system handler will first look in which module that happened. Mapped drivers are not inside Windows controlled list of drivers (PsLoadedModulesList - PatchGuard protected), so nothing will be found and system will simple crash.
+ No driver unloading;
Mapped code can't unload itself, however you still can release all resources allocated by your mapped code.
DRIVER_OBJECT->DriverUnload should be set to NULL.
+ Only ntoskrnl import resolved, everything else is up to you;
If your project need another module dependency then you have to rewrite this loader part.
+ Several Windows primitives are banned by PatchGuard from usage from the dynamic code.
Because of unsual way of loading mapped driver won't be inside PsLoadedModulesList. That mean any callback registered by such code will have handler located in memory outside this list. PatchGuard has ability to check whatever the registered callbacks point to valid loaded modules or not and BSOD with "Kernel notification callout modification" if such dynamic code detected.
In general if you want to know what you *should not do* in kernel look at https://github.com/hfiref0x/KDU/tree/master/Source/Examples/BadRkDemo which contain a few examples of forbidden things.
#### Kernel traces note
This tool does not change (and this won't change in future) internal Windows structures of MmUnloadedDrivers and/or PiDDBCacheTable. That's because:
+ KDU is not designed to circumvent third-party security software or various dubious crapware (e.g. anti-cheats);
+ These data can be a target for PatchGuard protection in the next major Windows 10 update.
You use it at your own risk. Some lazy AV may flag this tool as hacktool/malware.
# Currently Supported Providers
+ Intel Network Adapter Diagnostic Driver of version 1.03.0.7;
+ RTCore64 driver from MSI Afterburner of version 4.6.2 build 15658 and below;
+ Gdrv driver from various Gigabyte TOOLS of undefined version;
+ ATSZIO64 driver from ASUSTeK WinFlash utility of various versions;
+ MICSYS MsIo (WinIo) driver from Patriot Viper RGB utility of version 1.0;
+ GLCKIO2 (WinIo) driver from ASRock Polychrome RGB of version 1.0.4;
+ EneIo (WinIo) driver from G.SKILL Trident Z Lighting Control of version 1.00.08;
+ WinRing0x64 driver from EVGA Precision X1 of version 1.0.2.0;
+ EneTechIo (WinIo) driver from Thermaltake TOUGHRAM software of version 1.0.3.
More providers maybe added in the future.
# How it work
It uses known to be vulnerable driver from legitimate software to access arbitrary kernel memory with read/write primitives.
Depending on command KDU will either work as TDL/DSEFix or modify kernel mode process objects (EPROCESS).
When in -map mode KDU will use 3rd party signed driver from SysInternals Process Explorer and hijack it by placing a small loader shellcode inside it IRP_MJ_DEVICE_CONTROL/IRP_MJ_CREATE/IRP_MJ_CLOSE handler. This is done by overwriting physical memory where Process Explorer dispatch handler located and triggering it by calling driver IRP_MJ_CREATE handler (CreateFile call). Next shellcode will map input driver as code buffer to kernel mode and run it with current IRQL be PASSIVE_LEVEL. After that hijacked Process Explorer driver will be unloaded together with vulnerable provider driver. This entire idea comes from malicious software of the middle of 200x known as rootkits.
# Build
KDU comes with full source code.
In order to build from source you need Microsoft Visual Studio 2019 and later versions. For driver builds you need Microsoft Windows Driver Kit 10 and/or above.
# Support and Warranties
Using this program might render your computer into BSOD. Compiled binary and source code provided AS-IS in help it will be useful BUT WITHOUT WARRANTY OF ANY KIND.
# Third party code usage
* TinyAES, https://github.com/kokke/tiny-AES-c
# References
* DSEFix, https://github.com/hfiref0x/DSEFix
* Turla Driver Loader, https://github.com/hfiref0x/TDL
* Stryker, https://github.com/hfiref0x/Stryker
* Unwinding RTCore, https://swapcontext.blogspot.com/2020/01/unwinding-rtcore.html
* CVE-2019-16098, https://github.com/Barakat/CVE-2019-16098
* CVE-2015-2291, https://www.exploit-db.com/exploits/36392
* CVE-2018-19320, https://seclists.org/fulldisclosure/2018/Dec/39
* ATSZIO64 headers and libs, https://github.com/DOGSHITD/SciDetectorApp/tree/master/DetectSciApp
* ATSZIO64 ASUS Drivers Privilege Escalation, https://github.com/LimiQS/AsusDriversPrivEscala
* CVE-2019-18845, https://www.activecyber.us/activelabs/viper-rgb-driver-local-privilege-escalation-cve-2019-18845
* DEFCON27: Get off the kernel if you cant drive, https://eclypsium.com/wp-content/uploads/2019/08/EXTERNAL-Get-off-the-kernel-if-you-cant-drive-DEFCON27.pdf
|
{
"pile_set_name": "Github"
}
|
/**
* Alternate Sphinx design
* Originally created by Armin Ronacher for Werkzeug, adapted by Georg Brandl.
*/
body {
font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', 'Verdana', sans-serif;
font-size: 14px;
letter-spacing: -0.01em;
line-height: 150%;
text-align: center;
/*background-color: #AFC1C4; */
background-color: #BFD1D4;
color: black;
padding: 0;
border: 1px solid #aaa;
margin: 0px 80px 0px 80px;
min-width: 740px;
}
a {
color: #CA7900;
text-decoration: none;
}
a:hover {
color: #2491CF;
}
pre {
font-family: 'Consolas', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
font-size: 0.95em;
letter-spacing: 0.015em;
padding: 0.5em;
border: 1px solid #ccc;
background-color: #f8f8f8;
}
td.linenos pre {
padding: 0.5em 0;
border: 0;
background-color: transparent;
color: #aaa;
}
table.highlighttable {
margin-left: 0.5em;
}
table.highlighttable td {
padding: 0 0.5em 0 0.5em;
}
cite, code, tt {
font-family: 'Consolas', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
font-size: 0.95em;
letter-spacing: 0.01em;
}
hr {
border: 1px solid #abc;
margin: 2em;
}
tt {
background-color: #f2f2f2;
border-bottom: 1px solid #ddd;
color: #333;
}
tt.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
border: 0;
}
tt.descclassname {
background-color: transparent;
border: 0;
}
tt.xref {
background-color: transparent;
font-weight: bold;
border: 0;
}
a tt {
background-color: transparent;
font-weight: bold;
border: 0;
color: #CA7900;
}
a tt:hover {
color: #2491CF;
}
dl {
margin-bottom: 15px;
}
dd p {
margin-top: 0px;
}
dd ul, dd table {
margin-bottom: 10px;
}
dd {
margin-top: 3px;
margin-bottom: 10px;
margin-left: 30px;
}
.refcount {
color: #060;
}
dt:target,
.highlight {
background-color: #fbe54e;
}
dl.class, dl.function {
border-top: 2px solid #888;
}
dl.method, dl.attribute {
border-top: 1px solid #aaa;
}
dl.glossary dt {
font-weight: bold;
font-size: 1.1em;
}
pre {
line-height: 120%;
}
pre a {
color: inherit;
text-decoration: underline;
}
.first {
margin-top: 0 !important;
}
div.document {
background-color: white;
text-align: left;
background-image: url(contents.png);
background-repeat: repeat-x;
}
/*
div.documentwrapper {
width: 100%;
}
*/
div.clearer {
clear: both;
}
div.related h3 {
display: none;
}
div.related ul {
background-image: url(navigation.png);
height: 2em;
list-style: none;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 0;
padding-left: 10px;
}
div.related ul li {
margin: 0;
padding: 0;
height: 2em;
float: left;
}
div.related ul li.right {
float: right;
margin-right: 5px;
}
div.related ul li a {
margin: 0;
padding: 0 5px 0 5px;
line-height: 1.75em;
color: #EE9816;
}
div.related ul li a:hover {
color: #3CA8E7;
}
div.body {
margin: 0;
padding: 0.5em 20px 20px 20px;
}
div.bodywrapper {
margin: 0 240px 0 0;
border-right: 1px solid #ccc;
}
div.body a {
text-decoration: underline;
}
div.sphinxsidebar {
margin: 0;
padding: 0.5em 15px 15px 0;
width: 210px;
float: right;
text-align: left;
/* margin-left: -100%; */
}
div.sphinxsidebar h4, div.sphinxsidebar h3 {
margin: 1em 0 0.5em 0;
font-size: 0.9em;
padding: 0.1em 0 0.1em 0.5em;
color: white;
border: 1px solid #86989B;
background-color: #AFC1C4;
}
div.sphinxsidebar ul {
padding-left: 1.5em;
margin-top: 7px;
list-style: none;
padding: 0;
line-height: 130%;
}
div.sphinxsidebar ul ul {
list-style: square;
margin-left: 20px;
}
p {
margin: 0.8em 0 0.5em 0;
}
p.rubric {
font-weight: bold;
}
h1 {
margin: 0;
padding: 0.7em 0 0.3em 0;
font-size: 1.5em;
color: #11557C;
}
h2 {
margin: 1.3em 0 0.2em 0;
font-size: 1.35em;
padding: 0;
}
h3 {
margin: 1em 0 -0.3em 0;
font-size: 1.2em;
}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
color: black!important;
}
h1 a.anchor, h2 a.anchor, h3 a.anchor, h4 a.anchor, h5 a.anchor, h6 a.anchor {
display: none;
margin: 0 0 0 0.3em;
padding: 0 0.2em 0 0.2em;
color: #aaa!important;
}
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor,
h5:hover a.anchor, h6:hover a.anchor {
display: inline;
}
h1 a.anchor:hover, h2 a.anchor:hover, h3 a.anchor:hover, h4 a.anchor:hover,
h5 a.anchor:hover, h6 a.anchor:hover {
color: #777;
background-color: #eee;
}
table {
border-collapse: collapse;
margin: 0 -0.5em 0 -0.5em;
}
table td, table th {
padding: 0.2em 0.5em 0.2em 0.5em;
}
div.footer {
background-color: #E3EFF1;
color: #86989B;
padding: 3
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env python
"""
Artificial Intelligence for Humans
Volume 3: Deep Learning and Neural Networks
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2015 by Jeff Heaton
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.
For more information on Heaton Research copyrights, licenses
and trademarks visit:
http://www.heatonresearch.com/copyright
"""
__author__ = 'jheaton'
class AIFHError(Exception):
"""An error was raised. This is used for several purposes, see individual error messages."""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
|
{
"pile_set_name": "Github"
}
|
// RUN: llvm-mc -triple i686-elf -filetype asm -o - %s | FileCheck %s
.type TYPE STT_FUNC
// CHECK: .type TYPE,@function
.type comma_TYPE, STT_FUNC
// CHECK: .type comma_TYPE,@function
.type at_TYPE, @STT_FUNC
// CHECK: .type at_TYPE,@function
.type percent_TYPE, %STT_FUNC
// CHECK: .type percent_TYPE,@function
.type string_TYPE, "STT_FUNC"
// CHECK: .type string_TYPE,@function
.type type function
// CHECK: .type type,@function
.type comma_type, function
// CHECK: .type comma_type,@function
.type at_type, @function
// CHECK: .type at_type,@function
.type percent_type, %function
// CHECK: .type percent_type,@function
.type string_type, "function"
// CHECK: .type string_type,@function
.type special gnu_unique_object
// CHECK: .type special,@gnu_unique_object
.type comma_special, gnu_unique_object
// CHECK: .type comma_special,@gnu_unique_object
|
{
"pile_set_name": "Github"
}
|
<b:style src="./Node.css"/>
<b:style src="./Node_Expander.css"/>
<b:style src="./Folder.css"/>
<b:define name="selected" type="bool"/>
<b:define name="collapsed" type="bool"/>
<b:define name="disabled" type="bool"/>
<li class="Basis-TreeNode">
<div{content} class="Basis-TreeNode-Title">
<div class="Basis-TreeNode_Expander Basis-TreeNode_Expander__{collapsed}" event-click="toggle" />
<span class="Basis-TreeNode-Caption Basis-TreeNode-FolderCaption Basis-TreeNode-FolderCaption_{collapsed} Basis-TreeNode-Caption__{disabled} Basis-TreeNode-Caption__{selected}" event-click="select">
{title}
</span>
</div>
<ul{childNodesElement} class="Basis-TreeNode-Content Basis-TreeNode-Content__{collapsed}"/>
</li>
|
{
"pile_set_name": "Github"
}
|
// Copyright Oliver Kowalke 2009.
// 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)
#include <boost/config.hpp>
#if defined(BOOST_USE_SEGMENTED_STACKS)
# if defined(BOOST_WINDOWS)
# error "segmented stacks are not supported by Windows"
# else
# include <boost/coroutine/posix/segmented_stack_allocator.hpp>
# endif
#endif
|
{
"pile_set_name": "Github"
}
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "MotionOrientation.h"
FOUNDATION_EXPORT double MotionOrientation_PTEzVersionNumber;
FOUNDATION_EXPORT const unsigned char MotionOrientation_PTEzVersionString[];
|
{
"pile_set_name": "Github"
}
|
/*
* This file is part of the SDWebImage package.
* (c) Olivier Poitrey <rs@dailymotion.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
#import <Foundation/Foundation.h>
#import "SDWebImageCompat.h"
#import "SDImageCoder.h"
/// A player to control the playback of animated image, which can be used to drive Animated ImageView or any rendering usage, like CALayer/WatchKit/SwiftUI rendering.
@interface SDAnimatedImagePlayer : NSObject
/// Current playing frame image. This value is KVO Compliance.
@property (nonatomic, readonly, nullable) UIImage *currentFrame;
/// Current frame index, zero based. This value is KVO Compliance.
@property (nonatomic, readonly) NSUInteger currentFrameIndex;
/// Current loop count since its latest animating. This value is KVO Compliance.
@property (nonatomic, readonly) NSUInteger currentLoopCount;
/// Total frame count for niamted image rendering. Defaults is animated image's frame count.
/// @note For progressive animation, you can update this value when your provider receive more frames.
@property (nonatomic, assign) NSUInteger totalFrameCount;
/// Total loop count for animated image rendering. Default is animated image's loop count.
@property (nonatomic, assign) NSUInteger totalLoopCount;
/// The animation playback rate. Default is 1.0
/// `1.0` means the normal speed.
/// `0.0` means stopping the animation.
/// `0.0-1.0` means the slow speed.
/// `> 1.0` means the fast speed.
/// `< 0.0` is not supported currently and stop animation. (may support reverse playback in the future)
@property (nonatomic, assign) double playbackRate;
/// Provide a max buffer size by bytes. This is used to adjust frame buffer count and can be useful when the decoding cost is expensive (such as Animated WebP software decoding). Default is 0.
/// `0` means automatically adjust by calculating current memory usage.
/// `1` means without any buffer cache, each of frames will be decoded and then be freed after rendering. (Lowest Memory and Highest CPU)
/// `NSUIntegerMax` means cache all the buffer. (Lowest CPU and Highest Memory)
@property (nonatomic, assign) NSUInteger maxBufferSize;
/// You can specify a runloop mode to let it rendering.
/// Default is NSRunLoopCommonModes on multi-core device, NSDefaultRunLoopMode on single-core device
@property (nonatomic, copy, nonnull) NSRunLoopMode runLoopMode;
/// Create a player with animated image provider. If the provider's `animatedImageFrameCount` is less than 1, returns nil.
/// The provider can be any protocol implementation, like `SDAnimatedImage`, `SDImageGIFCoder`, etc.
/// @note This provider can represent mutable content, like prorgessive animated loading. But you need to update the frame count by yourself
/// @param provider The animated provider
- (nullable instancetype)initWithProvider:(nonnull id<SDAnimatedImageProvider>)provider;
/// Create a player with animated image provider. If the provider's `animatedImageFrameCount` is less than 1, returns nil.
/// The provider can be any protocol implementation, like `SDAnimatedImage` or `SDImageGIFCoder`, etc.
/// @note This provider can represent mutable content, like prorgessive animated loading. But you need to update the frame count by yourself
/// @param provider The animated provider
+ (nullable instancetype)playerWithProvider:(nonnull id<SDAnimatedImageProvider>)provider;
/// The handler block when current frame and index changed.
@property (nonatomic, copy, nullable) void (^animationFrameHandler)(NSUInteger index, UIImage * _Nonnull frame);
/// The handler block when one loop count finished.
@property (nonatomic, copy, nullable) void (^animationLoopHandler)(NSUInteger loopCount);
/// Return the status whehther animation is playing.
@property (nonatomic, readonly) BOOL isPlaying;
/// Start the animation. Or resume the previously paused animation.
- (void)startPlaying;
/// Pause the aniamtion. Keep the current frame index and loop count.
- (void)pausePlaying;
/// Stop the animation. Reset the current frame index and loop count.
- (void)stopPlaying;
/// Seek to the desired frame index and loop count.
/// @note This can be used for advanced control like progressive loading, or skipping specify frames.
/// @param index The frame index
/// @param loopCount The loop count
- (void)seekToFrameAtIndex:(NSUInteger)index loopCount:(NSUInteger)loopCount;
/// Clear the frame cache buffer. The frame cache buffer size can be controled by `maxBufferSize`.
/// By default, when stop or pause the animation, the frame buffer is still kept to ready for the next restart
- (void)clearFrameBuffer;
@end
|
{
"pile_set_name": "Github"
}
|
/**
* The MIT License
* Copyright (c) 2015 Estonian Information System Authority (RIA), Population Register Centre (VRK)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package ee.ria.xroad.proxy.testsuite.testcases;
import ee.ria.xroad.proxy.testsuite.Message;
import ee.ria.xroad.proxy.testsuite.MessageTestCase;
import org.apache.commons.io.IOUtils;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import static ee.ria.xroad.common.ErrorCodes.SERVER_CLIENTPROXY_X;
import static ee.ria.xroad.common.ErrorCodes.X_IO_ERROR;
import static ee.ria.xroad.common.ErrorCodes.X_SERVICE_FAILED_X;
/**
* Client sends normal message, SP aborts connection (content type: text/xml).
* Result: CP responds with RequestFailed
*/
public class ServerProxyConnectionAborted2 extends MessageTestCase {
/**
* Constructs the test case.
*/
public ServerProxyConnectionAborted2() {
requestFileName = "getstate.query";
}
@Override
public String getProviderAddress(String providerName) {
return "127.0.0.2";
}
@Override
public AbstractHandler getServerProxyHandler() {
return new AbstractHandler() {
@Override
public void handle(String target, Request baseRequest,
HttpServletRequest request, HttpServletResponse response)
throws IOException {
// Read all of the request.
IOUtils.readLines(request.getInputStream());
response.setContentType("text/xml");
response.setContentLength(1000);
response.getOutputStream().close();
response.flushBuffer();
baseRequest.setHandled(true);
}
};
}
@Override
protected void validateFaultResponse(Message receivedResponse) {
assertErrorCode(SERVER_CLIENTPROXY_X, X_SERVICE_FAILED_X, X_IO_ERROR);
}
}
|
{
"pile_set_name": "Github"
}
|
from __future__ import absolute_import
from builtins import str
from .base_monitor import BaseMonitor
from kafka import KafkaProducer
from kafka.common import KafkaUnavailableError
from scutils.method_timer import MethodTimer
from retrying import retry
import json
import sys
import traceback
class KafkaBaseMonitor(BaseMonitor):
'''
Base monitor for handling outbound Kafka results
'''
def setup(self, settings):
'''
Setup the handler
@param settings: The loaded settings file
'''
self.producer = self._create_producer(settings)
self.topic_prefix = settings['KAFKA_TOPIC_PREFIX']
self.use_appid_topics = settings['KAFKA_APPID_TOPICS']
self.logger.debug("Successfully connected to Kafka in {name}"
.format(name=self.__class__.__name__))
@retry(wait_exponential_multiplier=500, wait_exponential_max=10000)
def _create_producer(self, settings):
"""Tries to establish a Kafka consumer connection"""
try:
brokers = settings['KAFKA_HOSTS']
self.logger.debug("Creating new kafka producer using brokers: " +
str(brokers))
return KafkaProducer(bootstrap_servers=brokers,
value_serializer=lambda m: json.dumps(m),
retries=3,
linger_ms=settings['KAFKA_PRODUCER_BATCH_LINGER_MS'],
buffer_memory=settings['KAFKA_PRODUCER_BUFFER_BYTES'])
except KeyError as e:
self.logger.error('Missing setting named ' + str(e),
{'ex': traceback.format_exc()})
except:
self.logger.error("Couldn't initialize kafka producer in plugin.",
{'ex': traceback.format_exc()})
raise
def _kafka_success(self, response):
'''
Callback for successful send
'''
self.logger.debug("Sent message to Kafka")
def _kafka_failure(self, response):
'''
Callback for failed send
'''
self.logger.error("Failed to send message to Kafka")
def _send_to_kafka(self, master):
'''
Sends the message back to Kafka
@param master: the final dict to send
@returns: True if successfully sent to kafka
'''
appid_topic = "{prefix}.outbound_{appid}".format(
prefix=self.topic_prefix,
appid=master['appid'])
firehose_topic = "{prefix}.outbound_firehose".format(
prefix=self.topic_prefix)
try:
# dont want logger in outbound kafka message
if self.use_appid_topics:
f1 = self.producer.send(appid_topic, master)
f1.add_callback(self._kafka_success)
f1.add_errback(self._kafka_failure)
f2 = self.producer.send(firehose_topic, master)
f2.add_callback(self._kafka_success)
f2.add_errback(self._kafka_failure)
return True
except Exception as ex:
message = "An exception '{0}' occured while sending a message " \
"to kafka. Arguments:\n{1!r}" \
.format(type(ex).__name__, ex.args)
self.logger.error(message)
return False
def close(self):
self.producer.flush()
self.producer.close(timeout=10)
|
{
"pile_set_name": "Github"
}
|
f.lux-xcode
===========
This installs the f.lux iOS app on your device without requiring a jailbreak.
Learn more about f.lux at <https://justgetflux.com/>
Why isn't this in the app store?
--------------------------------
This app changes the color of all running apps on your phone, even when f.lux is
not directly open. Such functionality is not allowed in the [App Store Review
Guidelines](<https://developer.apple.com/app-store/review/guidelines/>), however
this type of app is possible.
How do I get this on my phone?
------------------------------
1. Download (click releases above for file), then open with XCode
2. Plug in your phone
3. Select your phone from the device menu (next to the "Play" and "Stop"
buttons)
4. Click "Play"
How does it work?
-----------------
There is an opaque, non-open-source app called `iflux` in this project. We trick
Xcode into signing and installing this app on your phone by:
1. Building a dummy app "just an app"
2. Splicing in the opaque binary during the build process
3. Letting Xcode sign and install the app as normal
There are build errors
----------------------
We are building the binary twice, once using source code, and again by splicing.
This duplication is reported as an error by XCode.
|
{
"pile_set_name": "Github"
}
|
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof _yuitest_coverage == "undefined"){
_yuitest_coverage = {};
_yuitest_coverline = function(src, line){
var coverage = _yuitest_coverage[src];
if (!coverage.lines[line]){
coverage.calledLines++;
}
coverage.lines[line]++;
};
_yuitest_coverfunc = function(src, name, line){
var coverage = _yuitest_coverage[src],
funcId = name + ":" + line;
if (!coverage.functions[funcId]){
coverage.calledFunctions++;
}
coverage.functions[funcId]++;
};
}
_yuitest_coverage["build/yui-later/yui-later.js"] = {
lines: {},
functions: {},
coveredLines: 0,
calledLines: 0,
coveredFunctions: 0,
calledFunctions: 0,
path: "build/yui-later/yui-later.js",
code: []
};
_yuitest_coverage["build/yui-later/yui-later.js"].code=["YUI.add('yui-later', function (Y, NAME) {","","/**"," * Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module, <a href=\"../classes/YUI.html#method_later\">it's documentation is located under the YUI class</a>."," *"," * @module yui"," * @submodule yui-later"," */","","var NO_ARGS = [];","","/**"," * Executes the supplied function in the context of the supplied"," * object 'when' milliseconds later. Executes the function a"," * single time unless periodic is set to true."," * @for YUI"," * @method later"," * @param when {int} the number of milliseconds to wait until the fn"," * is executed."," * @param o the context object."," * @param fn {Function|String} the function to execute or the name of"," * the method in the 'o' object to execute."," * @param data [Array] data that is provided to the function. This"," * accepts either a single item or an array. If an array is provided,"," * the function is executed with one parameter for each array item."," * If you need to pass a single array parameter, it needs to be wrapped"," * in an array [myarray]."," *"," * Note: native methods in IE may not have the call and apply methods."," * In this case, it will work, but you are limited to four arguments."," *"," * @param periodic {boolean} if true, executes continuously at supplied"," * interval until canceled."," * @return {object} a timer object. Call the cancel() method on this"," * object to stop the timer."," */","Y.later = function(when, o, fn, data, periodic) {"," when = when || 0;"," data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS;"," o = o || Y.config.win || Y;",""," var cancelled = false,"," method = (o && Y.Lang.isString(fn)) ? o[fn] : fn,"," wrapper = function() {"," // IE 8- may execute a setInterval callback one last time"," // after clearInterval was called, so in order to preserve"," // the cancel() === no more runny-run, we have to jump through"," // an extra hoop."," if (!cancelled) {"," if (!method.apply) {"," method(data[0], data[1], data[2], data[3]);"," } else {"," method.apply(o, data || NO_ARGS);"," }"," }"," },"," id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when);",""," return {"," id: id,"," interval: periodic,"," cancel: function() {"," cancelled = true;"," if (this.interval) {"," clearInterval(id);"," } else {"," clearTimeout(id);"," }"," }"," };","};","","Y.Lang.later = Y.later;","","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"];
_yuitest_coverage["build/yui-later/yui-later.js"].lines = {"1":0,"10":0,"37":0,"38":0,"39":0,"40":0,"42":0,"49":0,"50":0,"51":0,"53":0,"59":0,"63":0,"64":0,"65":0,"67":0,"73":0};
_yuitest_coverage["build/yui-later/yui-later.js"].functions = {"wrapper:44":0,"cancel:62":0,"later:37":0,"(anonymous 1):1":0};
_yuitest_coverage["build/yui-later/yui-later.js"].coveredLines = 17;
_yuitest_coverage["build/yui-later/yui-later.js"].coveredFunctions = 4;
_yuitest_coverline("build/yui-later/yui-later.js", 1);
YUI.add('yui-later', function (Y, NAME) {
/**
* Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module, <a href="../classes/YUI.html#method_later">it's documentation is located under the YUI class</a>.
*
* @module yui
* @submodule yui-later
*/
_yuitest_coverfunc("build/yui-later/yui-later.js", "(anonymous 1)", 1);
_yuitest_coverline("build/yui-later/yui-later.js", 10);
var NO_ARGS = [];
/**
* Executes the supplied function in the context of the supplied
* object 'when' milliseconds later. Executes the function a
* single time unless periodic is set to true.
* @for YUI
* @method later
* @param when {int} the number of milliseconds to wait until the fn
* is executed.
* @param o the context object.
* @param fn {Function|String} the function to execute or the name of
* the method in the 'o' object to execute.
* @param data [Array] data that is provided to the function. This
* accepts either a single item or an array. If an array is provided,
* the function is executed with one parameter for each array item.
* If you need to pass a single array parameter, it needs to be wrapped
* in an array [myarray].
*
* Note: native methods in IE may not have the call and apply methods.
* In this case, it will work, but you are limited to four arguments.
*
* @param periodic {boolean} if true, executes continuously at supplied
* interval until canceled.
* @return {object} a timer object. Call the cancel() method on this
* object to stop the timer.
*/
_yuitest_coverline("build/yui-later/yui-later.js", 37);
Y.later = function(when, o, fn, data, periodic) {
_yuitest_coverfunc("build/yui-later/yui-later.js", "later", 37);
_yuitest_coverline("build/yui-later/yui-later.js", 38);
when = when || 0;
_yuitest_coverline("build/yui-later/yui-later.js", 39);
data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS;
_yuitest_coverline("build/yui-later/yui-later.js", 40);
o = o || Y.config.win || Y;
_yuitest_coverline("build/yui-later/yui-later.js", 42);
var cancelled = false,
method = (o && Y.Lang.isString(fn)) ? o[fn] : fn,
wrapper = function() {
// IE 8- may execute a setInterval callback one last time
// after clearInterval was called, so in order to preserve
// the cancel() === no more runny-run, we have to jump through
// an extra hoop.
_y
|
{
"pile_set_name": "Github"
}
|
package br.com.swconsultoria.nfe.schema_4.retConsReciNFe;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
* <p>Classe Java de KeyInfoType complex type.
*
* <p>O seguinte fragmento do esquema especifica o contedo esperado contido dentro desta classe.
*
* <pre>
* <complexType name="KeyInfoType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="X509Data" type="{http://www.w3.org/2000/09/xmldsig#}X509DataType"/>
* </sequence>
* <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "KeyInfoType", namespace = "http://www.w3.org/2000/09/xmldsig#", propOrder = {
"x509Data"
})
public class KeyInfoType {
@XmlElement(name = "X509Data", namespace = "http://www.w3.org/2000/09/xmldsig#", required = true)
protected X509DataType x509Data;
@XmlAttribute(name = "Id")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@XmlSchemaType(name = "ID")
protected String id;
/**
* Obtm o valor da propriedade x509Data.
*
* @return
* possible object is
* {@link X509DataType }
*
*/
public X509DataType getX509Data() {
return x509Data;
}
/**
* Define o valor da propriedade x509Data.
*
* @param value
* allowed object is
* {@link X509DataType }
*
*/
public void setX509Data(X509DataType value) {
this.x509Data = value;
}
/**
* Obtm o valor da propriedade id.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Define o valor da propriedade id.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
}
|
{
"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": [
"AM",
"PM"
],
"DAY": [
"\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435",
"\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a",
"\u0432\u0442\u043e\u0440\u043d\u0438\u043a",
"\u0441\u0440\u0435\u0434\u0430",
"\u0447\u0435\u0442\u0432\u0435\u0440\u0433",
"\u043f\u044f\u0442\u043d\u0438\u0446\u0430",
"\u0441\u0443\u0431\u0431\u043e\u0442\u0430"
],
"ERANAMES": [
"\u0434\u043e \u043d. \u044d.",
"\u043d. \u044d."
],
"ERAS": [
"\u0434\u043e \u043d. \u044d.",
"\u043d. \u044d."
],
"FIRSTDAYOFWEEK": 0,
"MONTH": [
"\u044f\u043d\u0432\u0430\u0440\u044f",
"\u0444\u0435\u0432\u0440\u0430\u043b\u044f",
"\u043c\u0430\u0440\u0442\u0430",
"\u0430\u043f\u0440\u0435\u043b\u044f",
"\u043c\u0430\u044f",
"\u0438\u044e\u043d\u044f",
"\u0438\u044e\u043b\u044f",
"\u0430\u0432\u0433\u0443\u0441\u0442\u0430",
"\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f",
"\u043e\u043a\u0442\u044f\u0431\u0440\u044f",
"\u043d\u043e\u044f\u0431\u0440\u044f",
"\u0434\u0435\u043a\u0430\u0431\u0440\u044f"
],
"SHORTDAY": [
"\u0432\u0441",
"\u043f\u043d",
"\u0432\u0442",
"\u0441\u0440",
"\u0447\u0442",
"\u043f\u0442",
"\u0441\u0431"
],
"SHORTMONTH": [
"\u044f\u043d\u0432.",
"\u0444\u0435\u0432\u0440.",
"\u043c\u0430\u0440\u0442\u0430",
"\u0430\u043f\u0440.",
"\u043c\u0430\u044f",
"\u0438\u044e\u043d\u044f",
"\u0438\u044e\u043b\u044f",
"\u0430\u0432\u0433.",
"\u0441\u0435\u043d\u0442.",
"\u043e\u043a\u0442.",
"\u043d\u043e\u044f\u0431.",
"\u0434\u0435\u043a."
],
"STANDALONEMONTH": [
"\u044f\u043d\u0432\u0430\u0440\u044c",
"\u0444\u0435\u0432\u0440\u0430\u043b\u044c",
"\u043c\u0430\u0440\u0442",
"\u0430\u043f\u0440\u0435\u043b\u044c",
"\u043c\u0430\u0439",
"\u0438\u044e\u043d\u044c",
"\u0438\u044e\u043b\u044c",
"\u0430\u0432\u0433\u0443\u0441\u0442",
"\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c",
"\u043e\u043a\u0442\u044f\u0431\u0440\u044c",
"\u043d\u043e\u044f\u0431\u0440\u044c",
"\u0434\u0435\u043a\u0430\u0431\u0440\u044c"
],
"WEEKENDRANGE": [
5,
6
],
"fullDate": "EEEE, d MMMM y '\u0433'.",
"longDate": "d MMMM y '\u0433'.",
"medium": "d MMM y '\u0433'. H:mm:ss",
"mediumDate": "d MMM y '\u0433'.",
"mediumTime": "H:mm:ss",
"short": "dd.MM.yy H:mm",
"shortDate": "dd.MM.yy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u0440\u0443\u0431.",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"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": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "ru",
"localeID": "ru",
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (vf.v == 0 && i % 10 == 1 && i % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (vf
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2012, 2013 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.
*
*/
#ifndef SHARE_VM_TRACE_TRACEDATATYPES_HPP
#define SHARE_VM_TRACE_TRACEDATATYPES_HPP
#include <stddef.h>
#include "utilities/globalDefinitions.hpp"
enum {
CONTENT_TYPE_NONE = 0,
CONTENT_TYPE_BYTES = 1,
CONTENT_TYPE_EPOCHMILLIS = 2,
CONTENT_TYPE_MILLIS = 3,
CONTENT_TYPE_NANOS = 4,
CONTENT_TYPE_TICKS = 5,
CONTENT_TYPE_ADDRESS = 6,
CONTENT_TYPE_OSTHREAD,
CONTENT_TYPE_JAVALANGTHREAD,
CONTENT_TYPE_STACKTRACE,
CONTENT_TYPE_CLASS,
CONTENT_TYPE_PERCENTAGE,
JVM_CONTENT_TYPES_START = 30,
JVM_CONTENT_TYPES_END = 100
};
enum ReservedEvent {
EVENT_PRODUCERS,
EVENT_CHECKPOINT,
EVENT_BUFFERLOST,
NUM_RESERVED_EVENTS
};
typedef enum ReservedEvent ReservedEvent;
typedef u8 classid;
typedef u8 stacktraceid;
typedef u8 methodid;
typedef u8 fieldid;
class TraceUnicodeString;
#endif // SHARE_VM_TRACE_TRACEDATATYPES_HPP
|
{
"pile_set_name": "Github"
}
|
// Copyright 2008, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Tests for Google Test itself. This verifies that the basic constructs of
// Google Test work.
#include "gtest/gtest.h"
#include "test/googletest-param-test-test.h"
using ::testing::Values;
using ::testing::internal::ParamGenerator;
// Tests that generators defined in a different translation unit
// are functional. The test using extern_gen is defined
// in googletest-param-test-test.cc.
ParamGenerator<int> extern_gen = Values(33);
// Tests that a parameterized test case can be defined in one translation unit
// and instantiated in another. The test is defined in
// googletest-param-test-test.cc and ExternalInstantiationTest fixture class is
// defined in gtest-param-test_test.h.
INSTANTIATE_TEST_SUITE_P(MultiplesOf33,
ExternalInstantiationTest,
Values(33, 66));
// Tests that a parameterized test case can be instantiated
// in multiple translation units. Another instantiation is defined
// in googletest-param-test-test.cc and
// InstantiationInMultipleTranslationUnitsTest fixture is defined in
// gtest-param-test_test.h
INSTANTIATE_TEST_SUITE_P(Sequence2,
InstantiationInMultipleTranslationUnitsTest,
Values(42*3, 42*4, 42*5));
|
{
"pile_set_name": "Github"
}
|
# `lisk account`
Commands relating to Lisk accounts.
* [`lisk account:create`](#lisk-account-create)
* [`lisk account:get ADDRESSES`](#lisk-account-get-addresses)
* [`lisk account:show`](#lisk-account-show)
## `lisk account:create`
Returns a randomly-generated mnemonic passphrase with its corresponding public/private key pair and Lisk address.
```
USAGE
$ lisk account:create
OPTIONS
-j, --[no-]json Prints output in JSON format. You can change the default behaviour in your config.json file.
-n, --number=number [default: 1] Number of accounts to create.
--[no-]pretty Prints JSON in pretty format rather than condensed. Has no effect if the output is set to table.
You can change the default behaviour in your config.json file.
DESCRIPTION
Returns a randomly-generated mnemonic passphrase with its corresponding public/private key pair and Lisk address.
EXAMPLES
account:create
account:create --number=3
```
## `lisk account:get ADDRESSES`
Gets account information from the blockchain.
```
USAGE
$ lisk account:get ADDRESSES
ARGUMENTS
ADDRESSES Comma-separated address(es) to get information about.
OPTIONS
-j, --[no-]json Prints output in JSON format. You can change the default behaviour in your config.json file.
--[no-]pretty Prints JSON in pretty format rather than condensed. Has no effect if the output is set to table. You
can change the default behaviour in your config.json file.
DESCRIPTION
Gets account information from the blockchain.
EXAMPLES
account:get 3520445367460290306L
account:get 3520445367460290306L,2802325248134221536L
```
## `lisk account:show`
Shows account information for a given passphrase.
```
USAGE
$ lisk account:show
OPTIONS
-j, --[no-]json
Prints output in JSON format. You can change the default behaviour in your config.json file.
-p, --passphrase=passphrase
Specifies a source for your secret passphrase. Lisk Commander will prompt you for input if this option is not set.
Source must be one of `prompt`, `pass`, `env`, `file` or `stdin`. For `pass`, `env` and `file` a corresponding
identifier must also be provided.
Examples:
- --passphrase=prompt (default behaviour)
- --passphrase='pass:my secret passphrase' (should only be used where security is not important)
- --passphrase=env:SECRET_PASSPHRASE
- --passphrase=file:/path/to/my/passphrase.txt (takes the first line only)
- --passphrase=stdin (takes one line only)
--[no-]pretty
Prints JSON in pretty format rather than condensed. Has no effect if the output is set to table. You can change the
default behaviour in your config.json file.
DESCRIPTION
Shows account information for a given passphrase.
EXAMPLE
account:show
```
|
{
"pile_set_name": "Github"
}
|
#include <rosePublicConfig.h>
#ifdef ROSE_BUILD_BINARY_ANALYSIS_SUPPORT
#include <sage3basic.h>
#include <BinarySmtCommandLine.h>
#include <BinarySmtSolver.h>
namespace Rose {
namespace BinaryAnalysis {
bool
listSmtSolverNames(std::ostream &out) {
BinaryAnalysis::SmtSolver::Availability solvers = BinaryAnalysis::SmtSolver::availability();
bool foundSolver = false;
out <<"solver \"none\" is available\n";
BOOST_FOREACH (BinaryAnalysis::SmtSolver::Availability::value_type &node, solvers) {
out <<"solver \"" <<node.first <<"\" is " <<(node.second?"":"not ") <<"available\n";
if (node.second)
foundSolver = true;
}
return foundSolver;
}
std::string
validateSmtSolverName(const std::string &name) {
BinaryAnalysis::SmtSolver::Availability solvers = BinaryAnalysis::SmtSolver::availability();
if (solvers.find(name) != solvers.end())
return "";
return "SMT solver \"" + StringUtility::cEscape(name) + "\" is not recognized";
}
std::string
bestSmtSolverName() {
std::string name;
if (const BinaryAnalysis::SmtSolverPtr &solver = BinaryAnalysis::SmtSolver::bestAvailable())
name = solver->name();
return name;
}
void
checkSmtCommandLineArg(const std::string &arg, const std::string &listSwitch, std::ostream &out) {
if ("list" == arg) {
listSmtSolverNames(std::cout);
std::cout <<"solver \"best\" is an alias for \"" <<bestSmtSolverName() <<"\"\n";
exit(0);
} else if ("" == arg || "none" == arg || "best" == arg) {
// no solver
} else {
std::string err = validateSmtSolverName(arg);
if (!err.empty()) {
out <<err <<"\n";
if (!listSwitch.empty())
out <<"use \"" <<listSwitch <<"\" to get a list of supported solvers.\n";
exit(1);
}
}
}
std::string
smtSolverDocumentationString(const std::string &dfltValue) {
using namespace StringUtility;
std::string docstr = "Specifies which connection is used to interface to an SMT solver for analyses that don't "
"otherwise specify a solver. The choices are names of solver interfaces, \"none\" "
"(or the empty string), \"best\", or \"list\".";
SmtSolver::Availability solvers = SmtSolver::availability();
std::vector<std::string> enabled, disabled;
BOOST_FOREACH (const SmtSolver::Availability::value_type &node, solvers) {
if (node.second) {
enabled.push_back("\"" + cEscape(node.first) + "\"");
} else {
disabled.push_back("\"" + cEscape(node.first) + "\"");
}
}
if (enabled.empty()) {
docstr += " ROSE was not configured with any SMT solvers.";
} else {
docstr += " The following solvers are available in this configuration: " + joinEnglish(enabled) + ".";
}
if (!disabled.empty()) {
docstr += " These solvers would be available, but were not configured: " + joinEnglish(disabled) + ".";
}
docstr += " In general, solvers ending with \"-exe\" translate the ROSE internal representation to text, send the "
"text to a solver executable program which then parses it to another internal representation, solves, "
"converts its internal representation to text, which ROSE then reads and parses. These \"-exe\" parsers "
"are therefore quite slow, but work well for debugging. On the other hand, the \"-lib\" parsers use "
"a solver library and can avoid two of the four translation steps, but don't produce much debugging "
"output. To debug solvers, enable the " + SmtSolver::mlog.name() + " diagnostic facility (see @s{log}).";
docstr += " The default is \"" + dfltValue + "\"";
if ("best" == dfltValue) {
if (SmtSolverPtr solver = SmtSolver::bestAvailable()) {
docstr += ", which currently means \"" + solver->name() + "\".";
} else {
docstr += ", which currently mean \"none\".";
}
} else {
docstr += ".";
}
return docstr;
}
void
SmtSolverValidator::operator()(const Sawyer::CommandLine::ParserResult &cmdline) {
ASSERT_require(cmdline.have("smt-solver"));
std::string arg = cmdline.parsed("smt-solver", 0).as<std::string>();
if (cmdline.parser().errorStream().get()) {
checkSmtCommandLineArg(arg, "--smt-solver=list", *cmdline.parser().errorStream().get());
} else {
checkSmtCommandLineArg(arg, "--smt-solver=list", std::cerr);
}
}
} // namespace
} // namespace
#endif
|
{
"pile_set_name": "Github"
}
|
org.slf4j.simpleLogger.defaultLogLevel=warn
|
{
"pile_set_name": "Github"
}
|
//===--- ParallelUtilities.cpp -------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//===----------------------------------------------------------------------===//
#include "ParallelUtilities.h"
#include "llvm/Support/Timer.h"
#include <mutex>
#include <shared_mutex>
#define DEBUG_TYPE "par-utils"
namespace opts {
extern cl::OptionCategory BoltCategory;
cl::opt<unsigned>
ThreadCount("thread-count",
cl::desc("number of threads"),
cl::init(hardware_concurrency()),
cl::cat(BoltCategory));
cl::opt<bool>
NoThreads("no-threads",
cl::desc("disable multithreading"),
cl::init(false),
cl::cat(BoltCategory));
cl::opt<unsigned>
TaskCount("tasks-per-thread",
cl::desc("number of tasks to be created per thread"),
cl::init(20),
cl::cat(BoltCategory));
} // namespace opts
namespace llvm {
namespace bolt {
namespace ParallelUtilities {
namespace {
/// A single thread pool that is used to run parallel tasks
std::unique_ptr<ThreadPool> ThreadPoolPtr;
unsigned computeCostFor(const BinaryFunction &BF,
const PredicateTy &SkipPredicate,
const SchedulingPolicy &SchedPolicy) {
if (SchedPolicy == SchedulingPolicy::SP_TRIVIAL)
return 1;
if (SkipPredicate && SkipPredicate(BF))
return 0;
switch (SchedPolicy) {
case SchedulingPolicy::SP_CONSTANT:
return 1;
case SchedulingPolicy::SP_INST_LINEAR:
return BF.getSize();
case SchedulingPolicy::SP_INST_QUADRATIC:
return BF.getSize() * BF.getSize();
case SchedulingPolicy::SP_BB_LINEAR:
return BF.size();
case SchedulingPolicy::SP_BB_QUADRATIC:
return BF.size() * BF.size();
default:
llvm_unreachable("unsupported scheduling policy");
}
}
inline unsigned estimateTotalCost(const BinaryContext &BC,
const PredicateTy &SkipPredicate,
SchedulingPolicy &SchedPolicy) {
if (SchedPolicy == SchedulingPolicy::SP_TRIVIAL)
return BC.getBinaryFunctions().size();
unsigned TotalCost = 0;
for (auto &BFI : BC.getBinaryFunctions()) {
auto &BF = BFI.second;
TotalCost += computeCostFor(BF, SkipPredicate, SchedPolicy);
}
// Switch to trivial scheduling if total estimated work is zero
if (TotalCost == 0) {
outs() << "BOLT-WARNING: Running parallel work of 0 estimated cost, will "
"switch to trivial scheduling.\n";
SchedPolicy = SP_TRIVIAL;
TotalCost = BC.getBinaryFunctions().size();
}
return TotalCost;
}
} // namespace
ThreadPool &getThreadPool() {
if (ThreadPoolPtr.get())
return *ThreadPoolPtr;
ThreadPoolPtr = std::make_unique<ThreadPool>(opts::ThreadCount);
return *ThreadPoolPtr;
}
void runOnEachFunction(BinaryContext &BC, SchedulingPolicy SchedPolicy,
WorkFuncTy WorkFunction, PredicateTy SkipPredicate,
std::string LogName, bool ForceSequential,
unsigned TasksPerThread) {
if (BC.getBinaryFunctions().size() == 0)
return;
auto runBlock = [&](std::map<uint64_t, BinaryFunction>::iterator BlockBegin,
std::map<uint64_t, BinaryFunction>::iterator BlockEnd) {
Timer T(LogName, LogName);
DEBUG(T.startTimer());
for (auto It = BlockBegin; It != BlockEnd; ++It) {
auto &BF = It->second;
if (SkipPredicate && SkipPredicate(BF))
continue;
WorkFunction(BF);
}
DEBUG(T.stopTimer());
};
if (opts::NoThreads || ForceSequential) {
runBlock(BC.getBinaryFunctions().begin(), BC.getBinaryFunctions().end());
return;
}
// Estimate the overall runtime cost using the scheduling policy
const unsigned TotalCost = estimateTotalCost(BC, SkipPredicate, SchedPolicy);
const unsigned BlocksCount = TasksPerThread * opts::ThreadCount;
const unsigned BlockCost =
TotalCost > BlocksCount ? TotalCost / BlocksCount : 1;
// Divide work into blocks of equal cost
ThreadPool &Pool = getThreadPool();
auto BlockBegin = BC.getBinaryFunctions().begin();
unsigned CurrentCost = 0;
for (auto It = BC.getBinaryFunctions().begin();
It != BC.getBinaryFunctions().end(); ++It) {
auto &BF = It->second;
CurrentCost += computeCostFor(BF, SkipPredicate, SchedPolicy);
if (CurrentCost >= BlockCost) {
Pool.async(runBlock, BlockBegin, std::next(It));
BlockBegin = std::next(It);
CurrentCost = 0;
}
}
Pool.async(runBlock, BlockBegin, BC.getBinaryFunctions().end());
Pool.wait();
}
void runOnEachFunctionWithUniqueAllocId(
BinaryContext &BC, SchedulingPolicy SchedPolicy,
WorkFuncWithAllocTy WorkFunction, PredicateTy SkipPredicate,
std::string LogName, bool ForceSequential, unsigned TasksPerThread) {
if (BC.getBinaryFunctions().size() == 0)
return;
std::shared_timed_mutex MainLock;
auto runBlock = [&](std::map<uint64_t, BinaryFunction>::iterator BlockBegin,
std::map<uint64_t, BinaryFunction>::iterator BlockEnd,
MCPlusBuilder::AllocatorIdTy AllocId) {
Timer T(LogName, LogName);
DEBUG(T.startTimer());
std::shared_lock<std::shared_timed_mutex> Lock(MainLock);
for (auto It = BlockBegin; It != BlockEnd; ++It) {
auto &BF = It->second;
if (SkipPredicate && SkipPredicate(BF))
continue;
WorkFunction(BF, AllocId);
}
DEBUG(T.stopTimer());
};
if (opts::NoThreads || ForceSequential) {
runBlock(BC.getBinaryFunctions().begin(), BC.getBinaryFunctions().end(), 0);
return;
}
// This lock is used to postpone task execution
std::unique_lock<std::shared_timed_mutex> Lock(MainLock);
// Estimate the overall runtime cost using the scheduling policy
const unsigned TotalCost = estimateTotalCost(BC, SkipPredicate, SchedPolicy);
const unsigned BlocksCount = TasksPerThread * opts::ThreadCount;
const unsigned BlockCost =
TotalCost > BlocksCount ? TotalCost / BlocksCount : 1;
// Divide work into blocks of equal cost
ThreadPool &Pool = getThreadPool();
auto BlockBegin = BC.getBinaryFunctions().begin();
unsigned CurrentCost = 0;
unsigned AllocId = 1;
for (auto It = BC.getBinaryFunctions().begin();
It != BC.getBinaryFunctions().end(); ++It) {
auto &BF = It->second;
CurrentCost += computeCostFor(BF, SkipPredicate, SchedPolicy);
if (CurrentCost >= BlockCost) {
if (!BC.MIB->checkAllocatorExists(AllocId)) {
auto Id = BC.MIB->initializeNewAnnotationAllocator();
assert(AllocId == Id && "unexpected allocator id created");
}
Pool.async(runBlock, BlockBegin, std::next(It), AllocId);
AllocId++;
BlockBegin = std::next(It);
CurrentCost = 0;
}
}
if (!BC.MIB->checkAllocatorExists(AllocId)) {
auto Id = BC.MIB->initializeNewAnnotationAllocator();
assert(AllocId == Id && "unexpected allocator id created");
}
|
{
"pile_set_name": "Github"
}
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineMode("commonlisp", function (config) {
var assumeBody = /^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/;
var numLiteral = /^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/;
var symbol = /[^\s'`,@()\[\]";]/;
var type;
function readSym(stream) {
var ch;
while (ch = stream.next()) {
if (ch == "\\") stream.next();
else if (!symbol.test(ch)) { stream.backUp(1); break; }
}
return stream.current();
}
function base(stream, state) {
if (stream.eatSpace()) {type = "ws"; return null;}
if (stream.match(numLiteral)) return "number";
var ch = stream.next();
if (ch == "\\") ch = stream.next();
if (ch == '"') return (state.tokenize = inString)(stream, state);
else if (ch == "(") { type = "open"; return "bracket"; }
else if (ch == ")" || ch == "]") { type = "close"; return "bracket"; }
else if (ch == ";") { stream.skipToEnd(); type = "ws"; return "comment"; }
else if (/['`,@]/.test(ch)) return null;
else if (ch == "|") {
if (stream.skipTo("|")) { stream.next(); return "symbol"; }
else { stream.skipToEnd(); return "error"; }
} else if (ch == "#") {
var ch = stream.next();
if (ch == "[") { type = "open"; return "bracket"; }
else if (/[+\-=\.']/.test(ch)) return null;
else if (/\d/.test(ch) && stream.match(/^\d*#/)) return null;
else if (ch == "|") return (state.tokenize = inComment)(stream, state);
else if (ch == ":") { readSym(stream); return "meta"; }
else return "error";
} else {
var name = readSym(stream);
if (name == ".") return null;
type = "symbol";
if (name == "nil" || name == "t") return "atom";
if (name.charAt(0) == ":") return "keyword";
if (name.charAt(0) == "&") return "variable-2";
return "variable";
}
}
function inString(stream, state) {
var escaped = false, next;
while (next = stream.next()) {
if (next == '"' && !escaped) { state.tokenize = base; break; }
escaped = !escaped && next == "\\";
}
return "string";
}
function inComment(stream, state) {
var next, last;
while (next = stream.next()) {
if (next == "#" && last == "|") { state.tokenize = base; break; }
last = next;
}
type = "ws";
return "comment";
}
return {
startState: function () {
return {ctx: {prev: null, start: 0, indentTo: 0}, tokenize: base};
},
token: function (stream, state) {
if (stream.sol() && typeof state.ctx.indentTo != "number")
state.ctx.indentTo = state.ctx.start + 1;
type = null;
var style = state.tokenize(stream, state);
if (type != "ws") {
if (state.ctx.indentTo == null) {
if (type == "symbol" && assumeBody.test(stream.current()))
state.ctx.indentTo = state.ctx.start + config.indentUnit;
else
state.ctx.indentTo = "next";
} else if (state.ctx.indentTo == "next") {
state.ctx.indentTo = stream.column();
}
}
if (type == "open") state.ctx = {prev: state.ctx, start: stream.column(), indentTo: null};
else if (type == "close") state.ctx = state.ctx.prev || state.ctx;
return style;
},
indent: function (state, _textAfter) {
var i = state.ctx.indentTo;
return typeof i == "number" ? i : state.ctx.start + 1;
},
lineComment: ";;",
blockCommentStart: "#|",
blockCommentEnd: "|#"
};
});
CodeMirror.defineMIME("text/x-common-lisp", "commonlisp");
});
|
{
"pile_set_name": "Github"
}
|
import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M14.59 8L12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" />
, 'HighlightOffSharp');
|
{
"pile_set_name": "Github"
}
|
<%inherit file="/template.html" />
<%namespace name="badge_index" file="/badge/index.html"/>
<%namespace name="components" file="/components.html"/>
<%def name="title()">${_("Global badges")}</%def>
<%def name="breadcrumbs()">
${h.badge.breadcrumbs(None)|n}
</%def>
<%block name="main_content">
${components.flashmessages()}
%for (type_, data) in c.badge_tables.items():
${badge_index.render_tables(data['global_badges'], data['instance_badges'], data['badge_base_url'], data['badge_header'], data['badge_type'])}
%endfor
</%block>
|
{
"pile_set_name": "Github"
}
|
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
// Generated using tools/cldr/cldr-to-icu/build-icu-data.xml
en_NZ{
%%Parent{"en_001"}
calendar{
generic{
DateTimePatterns{
"h:mm:ss a zzzz",
"h:mm:ss a z",
"h:mm:ss a",
"h:mm a",
"EEEE, d MMMM y G",
"d MMMM y G",
"d/MM/y G",
"d/MM/y GGGGG",
"{1}, {0}",
"{1} 'at' {0}",
"{1} 'at' {0}",
"{1}, {0}",
"{1}, {0}",
}
availableFormats{
Md{"d/M"}
yyyyMd{"d/MM/y G"}
}
intervalFormats{
MEd{
M{"E, d/MM – E, d/MM"}
d{"E, d/MM – E, d/MM"}
}
MMMEd{
M{"E, d MMM – E, d MMM"}
d{"E, d – E, d MMM"}
}
Md{
M{"d/MM – d/MM"}
d{"d/MM – d/MM"}
}
yM{
M{"MM/y – MM/y G"}
y{"MM/y – MM/y G"}
}
yMEd{
M{"E, d/MM/y – E, d/MM/y G"}
d{"E, d/MM/y – E, d/MM/y G"}
y{"E, d/MM/y – E, d/MM/y G"}
}
yMd{
M{"d/MM/y – d/MM/y G"}
d{"d/MM/y – d/MM/y G"}
y{"d/MM/y – d/MM/y G"}
}
}
}
gregorian{
DateTimePatterns{
"h:mm:ss a zzzz",
"h:mm:ss a z",
"h:mm:ss a",
"h:mm a",
"EEEE, d MMMM y",
"d MMMM y",
"d/MM/y",
"d/MM/yy",
"{1}, {0}",
"{1} 'at' {0}",
"{1} 'at' {0}",
"{1}, {0}",
"{1}, {0}",
}
availableFormats{
Md{"d/M"}
yMd{"d/MM/y"}
}
intervalFormats{
MEd{
M{"E, d/MM – E, d/MM"}
d{"E, d/MM – E, d/MM"}
}
MMMEd{
M{"E, d MMM – E, d MMM"}
d{"E, d – E, d MMM"}
}
Md{
M{"d/MM – d/MM"}
d{"d/MM – d/MM"}
}
yMEd{
M{"E, d/MM/y – E, d/MM/y"}
d{"E, d/MM/y – E, d/MM/y"}
y{"E, d/MM/y – E, d/MM/y"}
}
yMd{
M{"d/MM/y – d/MM/y"}
d{"d/MM/y – d/MM/y"}
y{"d/MM/y – d/MM/y"}
}
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* cocos2d for iPhone: http://www.cocos2d-iphone.org
*
* Copyright (c) 2008-2010 Ricardo Quesada
* Copyright (c) 2011 Zynga Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#import "CCActionInstant.h"
#import "CCNode.h"
#import "CCSprite.h"
//
// InstantAction
//
#pragma mark CCActionInstant
@implementation CCActionInstant
-(id) init
{
if( (self=[super init]) )
duration_ = 0;
return self;
}
-(id) copyWithZone: (NSZone*) zone
{
CCActionInstant *copy = [[[self class] allocWithZone: zone] init];
return copy;
}
- (BOOL) isDone
{
return YES;
}
-(void) step: (ccTime) dt
{
[self update: 1];
}
-(void) update: (ccTime) t
{
// nothing
}
-(CCFiniteTimeAction*) reverse
{
return [[self copy] autorelease];
}
@end
//
// Show
//
#pragma mark CCShow
@implementation CCShow
-(void) update:(ccTime)time
{
((CCNode *)target_).visible = YES;
}
-(CCFiniteTimeAction*) reverse
{
return [CCHide action];
}
@end
//
// Hide
//
#pragma mark CCHide
@implementation CCHide
-(void) update:(ccTime)time
{
((CCNode *)target_).visible = NO;
}
-(CCFiniteTimeAction*) reverse
{
return [CCShow action];
}
@end
//
// ToggleVisibility
//
#pragma mark CCToggleVisibility
@implementation CCToggleVisibility
-(void) update:(ccTime)time
{
((CCNode *)target_).visible = !((CCNode *)target_).visible;
}
@end
//
// FlipX
//
#pragma mark CCFlipX
@implementation CCFlipX
+(id) actionWithFlipX:(BOOL)x
{
return [[[self alloc] initWithFlipX:x] autorelease];
}
-(id) initWithFlipX:(BOOL)x
{
if(( self=[super init]))
flipX = x;
return self;
}
-(void) update:(ccTime)time
{
[(CCSprite*)target_ setFlipX:flipX];
}
-(CCFiniteTimeAction*) reverse
{
return [CCFlipX actionWithFlipX:!flipX];
}
-(id) copyWithZone: (NSZone*) zone
{
CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithFlipX:flipX];
return copy;
}
@end
//
// FlipY
//
#pragma mark CCFlipY
@implementation CCFlipY
+(id) actionWithFlipY:(BOOL)y
{
return [[[self alloc] initWithFlipY:y] autorelease];
}
-(id) initWithFlipY:(BOOL)y
{
if(( self=[super init]))
flipY = y;
return self;
}
-(void) update:(ccTime)time
{
[(CCSprite*)target_ setFlipY:flipY];
}
-(CCFiniteTimeAction*) reverse
{
return [CCFlipY actionWithFlipY:!flipY];
}
-(id) copyWithZone: (NSZone*) zone
{
CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithFlipY:flipY];
return copy;
}
@end
//
// Place
//
#pragma mark CCPlace
@implementation CCPlace
+(id) actionWithPosition: (CGPoint) pos
{
return [[[self alloc]initWithPosition:pos]autorelease];
}
-(id) initWithPosition: (CGPoint) pos
{
if( (self=[super init]) )
position = pos;
return self;
}
-(id) copyWithZone: (NSZone*) zone
{
CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithPosition: position];
return copy;
}
-(void) update:(ccTime)time
{
((CCNode *)target_).position = position;
}
@end
//
// CallFunc
//
#pragma mark CCCallFunc
@implementation CCCallFunc
@synthesize targetCallback = targetCallback_;
+(id) actionWithTarget: (id) t selector:(SEL) s
{
return [[[self alloc] initWithTarget: t selector: s] autorelease];
}
-(id) initWithTarget: (id) t selector:(SEL) s
{
if( (self=[super init]) ) {
self.targetCallback = t;
selector_ = s;
}
return self;
}
-(NSString*) description
{
return [NSString stringWithFormat:@"<%@ = %p | Tag = %ld | selector = %@>",
[self class],
self,
(long)tag_,
NSStringFromSelector(selector_)
];
}
-(void) dealloc
{
[targetCallback_ release];
[super dealloc];
}
-(id) copyWithZone: (NSZone*) zone
{
CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithTarget:targetCallback_ selector:selector_];
return copy;
}
-(void) update:(ccTime)time
{
[self execute];
}
-(void) execute
{
[targetCallback_ performSelector:selector_];
}
@end
//
// CallFuncN
//
#pragma mark CCCallFuncN
@implementation CCCallFuncN
-(void) execute
{
[targetCallback_ performSelector:selector_ withObject:target_];
}
@end
//
// CallFuncND
//
#pragma mark CCCallFuncND
@implementation CCCallFuncND
@synthesize callbackMethod = callbackMethod_;
+(id) actionWithTarget:(id)t selector:(SEL)s data:(void*)d
{
return [[[self alloc] initWithTarget:t selector:s data:d] autorelease];
}
-(id) initWithTarget:(id)t selector:(SEL)s data:(void*)d
{
if( (self=[super initWithTarget:t selector:s]) ) {
data_ = d;
#if COCOS2D_DEBUG
NSMethodSignature * sig = [t methodSignatureForSelector:s]; // added
NSAssert(sig !=0 , @"Signature not found for selector - does it have the following form? -(void)name:(id)sender data:(void*)data");
#endif
callbackMethod_ = (CC_CALLBACK_ND) [t methodForSelector:s];
}
return self;
}
-(id) copyWithZone: (NSZone*) zone
{
CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithTarget:targetCallback_ selector:selector_ data:data_];
return copy;
}
-(void) dealloc
{
// nothing to dealloc really. Everything is dealloc on super (CCCallFuncN)
[super dealloc];
}
-(void) execute
|
{
"pile_set_name": "Github"
}
|
function test() {
class C {
constructor() { this.x = 1; }
}
return C.prototype.constructor === C
&& new C().x === 1;
}
if (!test())
throw new Error("Test failed");
|
{
"pile_set_name": "Github"
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Runtime.InteropServices;
namespace Microsoft.Diagnostics.Runtime.DacInterface
{
[StructLayout(LayoutKind.Sequential)]
public readonly struct GenerationData
{
public readonly ClrDataAddress StartSegment;
public readonly ClrDataAddress AllocationStart;
// These are examined only for generation 0, otherwise NULL
public readonly ClrDataAddress AllocationContextPointer;
public readonly ClrDataAddress AllocationContextLimit;
}
}
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Collections.Generic;
public static class Program {
public static void Main () {
var str = "abcdefgh";
var strChars = (str as IEnumerable<char>);
foreach (var ch in strChars)
Console.WriteLine(ch);
}
}
|
{
"pile_set_name": "Github"
}
|
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodPreset is a policy resource that defines additional runtime
// requirements for a Pod.
type PodPreset struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// +optional
Spec PodPresetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
}
// PodPresetSpec is a description of a pod preset.
type PodPresetSpec struct {
// Selector is a label query over a set of resources, in this case pods.
// Required.
Selector metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,1,opt,name=selector"`
// Env defines the collection of EnvVar to inject into containers.
// +optional
Env []v1.EnvVar `json:"env,omitempty" protobuf:"bytes,2,rep,name=env"`
// EnvFrom defines the collection of EnvFromSource to inject into containers.
// +optional
EnvFrom []v1.EnvFromSource `json:"envFrom,omitempty" protobuf:"bytes,3,rep,name=envFrom"`
// Volumes defines the collection of Volume to inject into the pod.
// +optional
Volumes []v1.Volume `json:"volumes,omitempty" protobuf:"bytes,4,rep,name=volumes"`
// VolumeMounts defines the collection of VolumeMount to inject into containers.
// +optional
VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty" protobuf:"bytes,5,rep,name=volumeMounts"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodPresetList is a list of PodPreset objects.
type PodPresetList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is a list of schema objects.
Items []PodPreset `json:"items" protobuf:"bytes,2,rep,name=items"`
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package proto
import (
"fmt"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/runtime/protoiface"
)
// Merge merges src into dst, which must be a message with the same descriptor.
//
// Populated scalar fields in src are copied to dst, while populated
// singular messages in src are merged into dst by recursively calling Merge.
// The elements of every list field in src is appended to the corresponded
// list fields in dst. The entries of every map field in src is copied into
// the corresponding map field in dst, possibly replacing existing entries.
// The unknown fields of src are appended to the unknown fields of dst.
//
// It is semantically equivalent to unmarshaling the encoded form of src
// into dst with the UnmarshalOptions.Merge option specified.
func Merge(dst, src Message) {
// TODO: Should nil src be treated as semantically equivalent to a
// untyped, read-only, empty message? What about a nil dst?
dstMsg, srcMsg := dst.ProtoReflect(), src.ProtoReflect()
if dstMsg.Descriptor() != srcMsg.Descriptor() {
if got, want := dstMsg.Descriptor().FullName(), srcMsg.Descriptor().FullName(); got != want {
panic(fmt.Sprintf("descriptor mismatch: %v != %v", got, want))
}
panic("descriptor mismatch")
}
mergeOptions{}.mergeMessage(dstMsg, srcMsg)
}
// Clone returns a deep copy of m.
// If the top-level message is invalid, it returns an invalid message as well.
func Clone(m Message) Message {
// NOTE: Most usages of Clone assume the following properties:
// t := reflect.TypeOf(m)
// t == reflect.TypeOf(m.ProtoReflect().New().Interface())
// t == reflect.TypeOf(m.ProtoReflect().Type().Zero().Interface())
//
// Embedding protobuf messages breaks this since the parent type will have
// a forwarded ProtoReflect method, but the Interface method will return
// the underlying embedded message type.
if m == nil {
return nil
}
src := m.ProtoReflect()
if !src.IsValid() {
return src.Type().Zero().Interface()
}
dst := src.New()
mergeOptions{}.mergeMessage(dst, src)
return dst.Interface()
}
// mergeOptions provides a namespace for merge functions, and can be
// exported in the future if we add user-visible merge options.
type mergeOptions struct{}
func (o mergeOptions) mergeMessage(dst, src protoreflect.Message) {
methods := protoMethods(dst)
if methods != nil && methods.Merge != nil {
in := protoiface.MergeInput{
Destination: dst,
Source: src,
}
out := methods.Merge(in)
if out.Flags&protoiface.MergeComplete != 0 {
return
}
}
if !dst.IsValid() {
panic(fmt.Sprintf("cannot merge into invalid %v message", dst.Descriptor().FullName()))
}
src.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {
switch {
case fd.IsList():
o.mergeList(dst.Mutable(fd).List(), v.List(), fd)
case fd.IsMap():
o.mergeMap(dst.Mutable(fd).Map(), v.Map(), fd.MapValue())
case fd.Message() != nil:
o.mergeMessage(dst.Mutable(fd).Message(), v.Message())
case fd.Kind() == protoreflect.BytesKind:
dst.Set(fd, o.cloneBytes(v))
default:
dst.Set(fd, v)
}
return true
})
if len(src.GetUnknown()) > 0 {
dst.SetUnknown(append(dst.GetUnknown(), src.GetUnknown()...))
}
}
func (o mergeOptions) mergeList(dst, src protoreflect.List, fd protoreflect.FieldDescriptor) {
// Merge semantics appends to the end of the existing list.
for i, n := 0, src.Len(); i < n; i++ {
switch v := src.Get(i); {
case fd.Message() != nil:
dstv := dst.NewElement()
o.mergeMessage(dstv.Message(), v.Message())
dst.Append(dstv)
case fd.Kind() == protoreflect.BytesKind:
dst.Append(o.cloneBytes(v))
default:
dst.Append(v)
}
}
}
func (o mergeOptions) mergeMap(dst, src protoreflect.Map, fd protoreflect.FieldDescriptor) {
// Merge semantics replaces, rather than merges into existing entries.
src.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool {
switch {
case fd.Message() != nil:
dstv := dst.NewValue()
o.mergeMessage(dstv.Message(), v.Message())
dst.Set(k, dstv)
case fd.Kind() == protoreflect.BytesKind:
dst.Set(k, o.cloneBytes(v))
default:
dst.Set(k, v)
}
return true
})
}
func (o mergeOptions) cloneBytes(v protoreflect.Value) protoreflect.Value {
return protoreflect.ValueOfBytes(append([]byte{}, v.Bytes()...))
}
|
{
"pile_set_name": "Github"
}
|
/*
*
* Support for audio capture for tm5600/6000/6010
* (c) 2007-2008 Mauro Carvalho Chehab
*
* Based on cx88-alsa.c
*
* 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.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/usb.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/delay.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/control.h>
#include <sound/initval.h>
#include "tm6000.h"
#include "tm6000-regs.h"
#undef dprintk
#define dprintk(level, fmt, arg...) do { \
if (debug >= level) \
printk(KERN_INFO "%s/1: " fmt, chip->core->name , ## arg); \
} while (0)
/****************************************************************************
Module global static vars
****************************************************************************/
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable tm6000x soundcard. default enabled.");
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for tm6000x capture interface(s).");
/****************************************************************************
Module macros
****************************************************************************/
MODULE_DESCRIPTION("ALSA driver module for tm5600/tm6000/tm6010 based TV cards");
MODULE_AUTHOR("Mauro Carvalho Chehab");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{Trident,tm5600},"
"{{Trident,tm6000},"
"{{Trident,tm6010}");
static unsigned int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "enable debug messages");
/****************************************************************************
Module specific funtions
****************************************************************************/
/*
* BOARD Specific: Sets audio DMA
*/
static int _tm6000_start_audio_dma(struct snd_tm6000_card *chip)
{
struct tm6000_core *core = chip->core;
dprintk(1, "Starting audio DMA\n");
/* Enables audio */
tm6000_set_reg_mask(core, TM6010_REQ07_RCC_ACTIVE_IF, 0x40, 0x40);
tm6000_set_audio_bitrate(core, 48000);
return 0;
}
/*
* BOARD Specific: Resets audio DMA
*/
static int _tm6000_stop_audio_dma(struct snd_tm6000_card *chip)
{
struct tm6000_core *core = chip->core;
dprintk(1, "Stopping audio DMA\n");
/* Disables audio */
tm6000_set_reg_mask(core, TM6010_REQ07_RCC_ACTIVE_IF, 0x00, 0x40);
return 0;
}
static void dsp_buffer_free(struct snd_pcm_substream *substream)
{
struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream);
dprintk(2, "Freeing buffer\n");
vfree(substream->runtime->dma_area);
substream->runtime->dma_area = NULL;
substream->runtime->dma_bytes = 0;
}
static int dsp_buffer_alloc(struct snd_pcm_substream *substream, int size)
{
struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream);
dprintk(2, "Allocating buffer\n");
if (substream->runtime->dma_area) {
if (substream->runtime->dma_bytes > size)
return 0;
dsp_buffer_free(substream);
}
substream->runtime->dma_area = vmalloc(size);
if (!substream->runtime->dma_area)
return -ENOMEM;
substream->runtime->dma_bytes = size;
return 0;
}
/****************************************************************************
ALSA PCM Interface
****************************************************************************/
/*
* Digital hardware definition
*/
#define DEFAULT_FIFO_SIZE 4096
static struct snd_pcm_hardware snd_tm6000_digital_hw = {
.info = SNDRV_PCM_INFO_BATCH |
SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_KNOT,
.rate_min = 48000,
.rate_max = 48000,
.channels_min = 2,
.channels_max = 2,
.period_bytes_min = 64,
.period_bytes_max = 12544,
.periods_min = 2,
.periods_max = 98,
.buffer_bytes_max = 62720 * 8,
};
/*
* audio pcm capture open callback
*/
static int snd_tm6000_pcm_open(struct snd_pcm_substream *substream)
{
struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
int err;
err = snd_pcm_hw_constraint_pow2(runtime, 0,
SNDRV_PCM_HW_PARAM_PERIODS);
if (err < 0)
goto _error;
chip->substream = substream;
runtime->hw = snd_tm6000_digital_hw;
snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
return 0;
_error:
dprintk(1, "Error opening PCM!\n");
return err;
}
/*
* audio close callback
*/
static int snd_tm6000_close(struct snd_pcm_substream *substream)
{
struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream);
struct tm6000_core *core = chip->core;
if (atomic_read(&core->stream_started) > 0) {
atomic_set(&core->stream_started, 0);
schedule_work(&core->wq_trigger);
}
return 0;
}
static int tm6000_fillbuf(struct tm6000_core *core, char *buf, int size)
{
struct snd_tm6000_card *chip = core->adev;
struct snd_pcm_substream *substream = chip->substream;
struct snd_pcm_runtime *runtime;
int period_elapsed = 0;
unsigned int stride, buf_pos;
int length;
if (atomic_read(&core->stream_started) == 0)
return 0;
if (!size || !substream) {
dprintk(1, "substream was NULL\n");
return -EINVAL;
}
runtime = substream->runtime;
if (!runtime || !runtime->dma_area) {
dprintk(1, "runtime was NULL\n");
return -EINVAL;
}
buf_pos = chip->buf_pos;
stride = runtime->frame_bits >> 3;
if (stride == 0) {
dprintk(1, "stride is zero\n");
return -EINVAL;
}
length = size / stride;
if (length == 0) {
dprintk(1, "%s: length was zero\n",
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 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.
*/
/*
* Do not modify this file. This file is generated from the ssm-2014-11-06.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.SimpleSystemsManagement.Model
{
/// <summary>
/// The filters to describe or get information about your managed instances.
/// </summary>
public partial class InstanceInformationStringFilter
{
private string _key;
private List<string> _values = new List<string>();
/// <summary>
/// Gets and sets the property Key.
/// <para>
/// The filter key name to describe your instances. For example:
/// </para>
///
/// <para>
/// "InstanceIds"|"AgentVersion"|"PingStatus"|"PlatformTypes"|"ActivationIds"|"IamRole"|"ResourceType"|"AssociationStatus"|"Tag
/// Key"
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1)]
public string Key
{
get { return this._key; }
set { this._key = value; }
}
// Check to see if Key property is set
internal bool IsSetKey()
{
return this._key != null;
}
/// <summary>
/// Gets and sets the property Values.
/// <para>
/// The filter values.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=100)]
public List<string> Values
{
get { return this._values; }
set { this._values = value; }
}
// Check to see if Values property is set
internal bool IsSetValues()
{
return this._values != null && this._values.Count > 0;
}
}
}
|
{
"pile_set_name": "Github"
}
|
import React from 'react';
import PropTypes from 'prop-types';
const UilNavigator = (props) => {
const { color, size, ...otherProps } = props
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
height: size,
viewBox: '0 0 24 24',
fill: color,
...otherProps
}, React.createElement('path', {
d: 'M20.17,9.23l-14-5.78a3,3,0,0,0-4,3.7L3.71,12,2.13,16.85A3,3,0,0,0,2.94,20a3,3,0,0,0,2,.8,3,3,0,0,0,1.15-.23l14.05-5.78a3,3,0,0,0,0-5.54ZM5.36,18.7a1,1,0,0,1-1.06-.19,1,1,0,0,1-.27-1L5.49,13H19.22ZM5.49,11,4,6.53a1,1,0,0,1,.27-1A1,1,0,0,1,5,5.22a1,1,0,0,1,.39.08L19.22,11Z'
}));
};
UilNavigator.propTypes = {
color: PropTypes.string,
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};
UilNavigator.defaultProps = {
color: 'currentColor',
size: '24',
};
export default UilNavigator;
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using System.Threading.Tasks;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
namespace Admin.UWP
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class Admin_App4 : Page
{
public Admin_App4()
{
this.InitializeComponent();
NavigateNext();
}
private async void NavigateNext()
{
await Task.Delay(3000);
this.Frame.Navigate(typeof(Admin_App5));
}
}
}
|
{
"pile_set_name": "Github"
}
|
var arrayCopy = require('./arrayCopy'),
isArguments = require('../lang/isArguments'),
isArray = require('../lang/isArray'),
isArrayLike = require('./isArrayLike'),
isPlainObject = require('../lang/isPlainObject'),
isTypedArray = require('../lang/isTypedArray'),
toPlainObject = require('../lang/toPlainObject');
/**
* A specialized version of `baseMerge` for arrays and objects which performs
* deep merges and tracks traversed objects enabling objects with circular
* references to be merged.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {string} key The key of the value to merge.
* @param {Function} mergeFunc The function to merge values.
* @param {Function} [customizer] The function to customize merged values.
* @param {Array} [stackA=[]] Tracks traversed source objects.
* @param {Array} [stackB=[]] Associates values with source counterparts.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
var length = stackA.length,
srcValue = source[key];
while (length--) {
if (stackA[length] == srcValue) {
object[key] = stackB[length];
return;
}
}
var value = object[key],
result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
isCommon = result === undefined;
if (isCommon) {
result = srcValue;
if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
result = isArray(value)
? value
: (isArrayLike(value) ? arrayCopy(value) : []);
}
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
result = isArguments(value)
? toPlainObject(value)
: (isPlainObject(value) ? value : {});
}
else {
isCommon = false;
}
}
// Add the source value to the stack of traversed objects and associate
// it with its merged value.
stackA.push(srcValue);
stackB.push(result);
if (isCommon) {
// Recursively merge objects and arrays (susceptible to call stack limits).
object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
} else if (result === result ? (result !== value) : (value === value)) {
object[key] = result;
}
}
module.exports = baseMergeDeep;
|
{
"pile_set_name": "Github"
}
|
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1999, 2011 Oracle and/or its affiliates. All rights reserved.
*
* $Id$
*/
#include "db_config.h"
#include "db_int.h"
#pragma hdrstop
// @v9.5.5 #include "dbinc/db_verify.h"
static int __bam_safe_getdata __P((DB*, DB_THREAD_INFO*,PAGE*, uint32, int, DBT*, int *));
static int __bam_vrfy_inp __P((DB*, VRFY_DBINFO*, PAGE*, db_pgno_t, db_indx_t*, uint32));
static int __bam_vrfy_treeorder __P((DB*, DB_THREAD_INFO*, PAGE*, BINTERNAL*, BINTERNAL*, int (*)(DB *, const DBT *, const DBT *), uint32));
static int __ram_vrfy_inp __P((DB*, VRFY_DBINFO*, PAGE*, db_pgno_t, db_indx_t*, uint32));
/*
* __bam_vrfy_meta --
* Verify the btree-specific part of a metadata page.
*
* PUBLIC: int __bam_vrfy_meta __P((DB *, VRFY_DBINFO *, BTMETA *,
* PUBLIC: db_pgno_t, uint32));
*/
int __bam_vrfy_meta(DB * dbp, VRFY_DBINFO * vdp, BTMETA * meta, db_pgno_t pgno, uint32 flags)
{
VRFY_PAGEINFO * pip;
int t_ret, ret;
db_indx_t ovflsize;
ENV * env = dbp->env;
int isbad = 0;
if((ret = __db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0)
return ret;
/*
* If VRFY_INCOMPLETE is not set, then we didn't come through
* __db_vrfy_pagezero and didn't incompletely
* check this page--we haven't checked it at all.
* Thus we need to call __db_vrfy_meta and check the common fields.
*
* If VRFY_INCOMPLETE is set, we've already done all the same work
* in __db_vrfy_pagezero, so skip the check.
*/
if(!F_ISSET(pip, VRFY_INCOMPLETE) && (ret = __db_vrfy_meta(dbp, vdp, &meta->dbmeta, pgno, flags)) != 0) {
if(ret == DB_VERIFY_BAD)
isbad = 1;
else
goto err;
}
/* bt_minkey: must be >= 2; must produce sensible ovflsize */
/* avoid division by zero */
ovflsize = meta->minkey > 0 ?
B_MINKEY_TO_OVFLSIZE(dbp, meta->minkey, dbp->pgsize) : 0;
if(meta->minkey < 2 ||
ovflsize > B_MINKEY_TO_OVFLSIZE(dbp, DEFMINKEYPAGE, dbp->pgsize)) {
pip->bt_minkey = 0;
isbad = 1;
EPRINT((env, DB_STR_A("1034", "Page %lu: nonsensical bt_minkey value %lu on metadata page", "%lu %lu"), (ulong)pgno, (ulong)meta->minkey));
}
else
pip->bt_minkey = meta->minkey;
/* re_len: no constraints on this (may be zero or huge--we make rope) */
pip->re_pad = meta->re_pad;
pip->re_len = meta->re_len;
/*
* The root must not be current page or 0 and it must be within
* database. If this metadata page is the master meta data page
* of the file, then the root page had better be page 1.
*/
pip->root = 0;
if(meta->root == PGNO_INVALID || meta->root == pgno || !IS_VALID_PGNO(meta->root) || (pgno == PGNO_BASE_MD && meta->root != 1)) {
isbad = 1;
EPRINT((env, DB_STR_A("1035", "Page %lu: nonsensical root page %lu on metadata page", "%lu %lu"), (ulong)pgno, (ulong)meta->root));
}
else
pip->root = meta->root;
/* Flags. */
if(F_ISSET(&meta->dbmeta, BTM_RENUMBER))
F_SET(pip, VRFY_IS_RRECNO);
if(F_ISSET(&meta->dbmeta, BTM_SUBDB)) {
/*
* If this is a master db meta page, it had better not have
* duplicates.
*/
if(F_ISSET(&meta->dbmeta, BTM_DUP) && pgno == PGNO_BASE_MD) {
isbad = 1;
EPRINT((env, DB_STR_A("1036", "Page %lu: Btree metadata page has both duplicates and multiple databases", "%lu"), (ulong)pgno));
}
F_SET(pip, VRFY_HAS_SUBDBS);
}
if(F_ISSET(&meta->dbmeta, BTM_DUP))
F_SET(pip, VRFY_HAS_DUPS);
if(F_ISSET(&meta->dbmeta, BTM_DUPSORT))
F_SET(pip, VRFY_HAS_DUPSORT);
if(F_ISSET(&meta->dbmeta, BTM_RECNUM))
F_SET(pip, VRFY_HAS_RECNUMS);
if(F_ISSET(pip, VRFY_HAS_RECNUMS) && F_ISSET(pip, VRFY_HAS_DUPS)) {
EPRINT((env, DB_STR_A("1037", "Page %lu: Btree metadata page illegally has both recnums and dups", "%lu"), (ulong)pgno));
isbad = 1;
}
if(F_ISSET(&meta->dbmeta, BTM_RECNO)) {
F_SET(pip, VRFY_IS_RECNO);
dbp->type = DB_RECNO;
}
else if(F_ISSET(pip, VRFY_IS_RRECNO)) {
isbad = 1;
EPRINT((env, DB_STR_A("1038", "Page %lu: metadata page has renumber flag set but is not recno", "%lu"), (ulong)pgno));
}
#ifdef HAVE_COMPRESSION
if(F_ISSET(&meta->dbmeta, BTM_COMPRESS)) {
F_SET(pip, VRFY_HAS_COMPRESS);
if(!DB_IS_COMPRESSED(dbp)) {
static_cast<BTREE *>(dbp->bt_internal)->bt_compress = __bam_defcompress;
static_cast<BTREE *>(dbp->bt_internal)->bt_decompress = __bam_defdecompress;
}
/*
* Copy dup_compare to compress_dup_compare, and use the
* compression duplicate compare.
*/
if(F_ISSET(pip, VRFY_HAS_DUPSORT)) {
SETIFZ(dbp->dup_compare, __bam_defcmp);
if(static_cast<BTREE *>(dbp->bt_internal)->compress_dup_compare == NULL) {
static_cast<BTREE *>(dbp->bt_internal)->compress_dup_compare = dbp->dup_compare;
dbp->dup_compare = __bam_compress_dupcmp;
}
}
}
if(F_ISSET(pip, VRFY_HAS_RECNUMS) && F_ISSET(pip, VRFY_HAS_COMPRESS)) {
EPRINT((env, DB_STR_A("1039", "Page %lu: Btree metadata page illegally has both recnums and compression", "%lu"), (ulong)pgno));
isbad = 1;
}
if(F_ISSET(pip, VRFY_HAS_DUPS) && !F_ISSET(pip, VRFY_HAS
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Folders Access Control Lists Management (RFC4314, RFC2086)
*
* @version @package_version@
* @author Aleksander Machniak <alec@alec.pl>
*
*
* Copyright (C) 2011-2012, Kolab Systems AG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
class acl extends rcube_plugin
{
public $task = 'settings|addressbook|calendar';
private $rc;
private $supported = null;
private $mbox;
private $ldap;
private $specials = array('anyone', 'anonymous');
/**
* Plugin initialization
*/
function init()
{
$this->rc = rcmail::get_instance();
// Register hooks
$this->add_hook('folder_form', array($this, 'folder_form'));
// kolab_addressbook plugin
$this->add_hook('addressbook_form', array($this, 'folder_form'));
$this->add_hook('calendar_form_kolab', array($this, 'folder_form'));
// Plugin actions
$this->register_action('plugin.acl', array($this, 'acl_actions'));
$this->register_action('plugin.acl-autocomplete', array($this, 'acl_autocomplete'));
}
/**
* Handler for plugin actions (AJAX)
*/
function acl_actions()
{
$action = trim(rcube_utils::get_input_value('_act', rcube_utils::INPUT_GPC));
// Connect to IMAP
$this->rc->storage_init();
// Load localization and configuration
$this->add_texts('localization/');
$this->load_config();
if ($action == 'save') {
$this->action_save();
}
else if ($action == 'delete') {
$this->action_delete();
}
else if ($action == 'list') {
$this->action_list();
}
// Only AJAX actions
$this->rc->output->send();
}
/**
* Handler for user login autocomplete request
*/
function acl_autocomplete()
{
$this->load_config();
$search = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC, true);
$sid = rcube_utils::get_input_value('_id', rcube_utils::INPUT_GPC);
$users = array();
if ($this->init_ldap()) {
$max = (int) $this->rc->config->get('autocomplete_max', 15);
$mode = (int) $this->rc->config->get('addressbook_search_mode');
$this->ldap->set_pagesize($max);
$result = $this->ldap->search('*', $search, $mode);
foreach ($result->records as $record) {
$user = $record['uid'];
if (is_array($user)) {
$user = array_filter($user);
$user = $user[0];
}
if ($user) {
if ($record['name'])
$user = $record['name'] . ' (' . $user . ')';
$users[] = $user;
}
}
}
sort($users, SORT_LOCALE_STRING);
$this->rc->output->command('ksearch_query_results', $users, $search, $sid);
$this->rc->output->send();
}
/**
* Handler for 'folder_form' hook
*
* @param array $args Hook arguments array (form data)
*
* @return array Hook arguments array
*/
function folder_form($args)
{
$mbox_imap = $args['options']['name'];
$myrights = $args['options']['rights'];
// Edited folder name (empty in create-folder mode)
if (!strlen($mbox_imap)) {
return $args;
}
/*
// Do nothing on protected folders (?)
if ($args['options']['protected']) {
return $args;
}
*/
// Get MYRIGHTS
if (empty($myrights)) {
return $args;
}
// Load localization and include scripts
$this->load_config();
$this->specials = $this->rc->config->get('acl_specials', $this->specials);
$this->add_texts('localization/', array('deleteconfirm', 'norights',
'nouser', 'deleting', 'saving', 'newuser', 'editperms'));
$this->rc->output->add_label('save', 'cancel');
$this->include_script('acl.js');
$this->rc->output->include_script('list.js');
$this->include_stylesheet($this->local_skin_path().'/acl.css');
// add Info fieldset if it doesn't exist
if (!isset($args['form']['props']['fieldsets']['info']))
$args['form']['props']['fieldsets']['info'] = array(
'name' => $this->rc->gettext('info'),
'content' => array());
// Display folder rights to 'Info' fieldset
$args['form']['props']['fieldsets']['info']['content']['myrights'] = array(
'label' => rcube::Q($this->gettext('myrights')),
'value' => $this->acl2text($myrights)
);
// Return if not folder admin
if (!in_array('a', $myrights)) {
return $args;
}
// The 'Sharing' tab
$this->mbox = $mbox_imap;
$this->rc->output->set_env('acl_users_source', (bool) $this->rc->config->get('acl_users_source'));
$this->rc->output->set_env('mailbox', $mbox_imap);
$this->rc->output->add_handlers(array(
'acltable' => array($this, 'templ_table'),
'acluser' => array($this, 'templ_user'),
'aclrights' => array($this, 'templ_rights'),
));
$this->rc->output->set_env('autocomplete_max', (int)$this->rc->config->get('autocomplete_max', 15));
$this->rc->output->set_env('autocomplete_min_length', $this->rc->config->get('autocomplete_min_length'));
$this->rc->output->add_label('autocompletechars', 'autocompletemore');
$args['form']['sharing'] = array(
'name' => rcube::Q($this->gettext('sharing')),
'content' => $this->rc->output->parse('acl.table', false, false),
);
return $args;
}
/**
* Creates ACL rights table
*
* @param array $attrib Template object attributes
*
* @return string HTML Content
*/
function templ_table($attrib)
{
if (empty($attrib['id']))
$attrib['id'] = 'acl-table';
$out = $this->list_rights($attrib);
$this->rc->output->add_gui_object('acltable', $attrib['id']);
return $out;
}
/**
* Creates ACL rights form (rights list part)
*
* @param array $attrib Template object attributes
*
* @return string HTML Content
*/
function templ_rights($attrib)
|
{
"pile_set_name": "Github"
}
|
/*--------------------------------------------------------------
# Illustrations
--------------------------------------------------------------*/
@import "illustrations/illustrations";
/*--------------------------------------------------------------
# Fonts
--------------------------------------------------------------*/
@import "base/fonts";
/*--------------------------------------------------------------
# Scroll reveal
--------------------------------------------------------------*/
@import "base/scroll-reveal";
/*--------------------------------------------------------------
# Base
--------------------------------------------------------------*/
@import "base/base";
/*--------------------------------------------------------------
# Typography
--------------------------------------------------------------*/
@import "base/typography";
/*--------------------------------------------------------------
# Containers
--------------------------------------------------------------*/
@import "elements/containers";
/*--------------------------------------------------------------
# Buttons
--------------------------------------------------------------*/
@import "elements/buttons";
/*--------------------------------------------------------------
# Forms
--------------------------------------------------------------*/
@import "elements/forms";
/*--------------------------------------------------------------
# Hamburger
--------------------------------------------------------------*/
@import "elements/hamburger";
/*--------------------------------------------------------------
# Modal
--------------------------------------------------------------*/
@import "elements/modal";
/*--------------------------------------------------------------
# Split pattern
--------------------------------------------------------------*/
@import "patterns/split";
/*--------------------------------------------------------------
# Tiles pattern
--------------------------------------------------------------*/
@import "patterns/tiles";
/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
@import "layout/header";
/*--------------------------------------------------------------
# Site content
--------------------------------------------------------------*/
@import "layout/main";
/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
@import "layout/footer";
/*--------------------------------------------------------------
# Section
--------------------------------------------------------------*/
@import "sections/section";
/*--------------------------------------------------------------
# Hero
--------------------------------------------------------------*/
@import "sections/hero";
/*--------------------------------------------------------------
# Features split
--------------------------------------------------------------*/
@import "sections/features-split";
/*--------------------------------------------------------------
# Features tiles
--------------------------------------------------------------*/
@import "sections/features-tiles";
/*--------------------------------------------------------------
# Testimonial
--------------------------------------------------------------*/
@import "sections/testimonial";
/*--------------------------------------------------------------
# Call to action
--------------------------------------------------------------*/
@import "sections/cta";
|
{
"pile_set_name": "Github"
}
|
import java.io.{File}
import scalaxb.compiler.{Config}
class UnqualifiedLocalTest extends TestBase {
val inFile = new File("integration/src/test/resources/unqualified.xsd")
lazy val generated = module.process(inFile, "unqualified", tmp)
"unqualified.scala file must compile so that Foo can be used" in {
(List("""scalaxb.toXML[unqualified.Foo](scalaxb.fromXML[unqualified.Foo](""" +
"""<unq:foo xmlns:unq="http://www.example.com/unqualified" attribute1="bar">""" +
"<string1></string1>" +
"""<unq:bar>bar</unq:bar>""" +
"""</unq:foo>), """ +
"""Some("http://www.example.com/unqualified"), "foo", """ +
"""scalaxb.toScope(Some("unq") -> "http://www.example.com/unqualified") ).toString"""),
generated) must evaluateTo("""<unq:foo attribute1="bar" xmlns:unq="http://www.example.com/unqualified">""" +
"<string1></string1>" +
"""<unq:bar>bar</unq:bar>""" +
"</unq:foo>", outdir = "./tmp")
}
"unqualified.scala file must compiled with an alternative toXML" in {
(List("""scalaxb.toXML[unqualified.Foo](scalaxb.fromXML[unqualified.Foo](""" +
"""<unq:foo xmlns:unq="http://www.example.com/unqualified" attribute1="bar">""" +
"<string1></string1>" +
"""<unq:bar>bar</unq:bar>""" +
"""</unq:foo>), """ +
"""Some("http://www.example.com/unqualified"), Some("foo"), """ +
"""scalaxb.toScope(Some("unq") -> "http://www.example.com/unqualified") ).toString"""),
generated) must evaluateTo("""<unq:foo attribute1="bar" xmlns:unq="http://www.example.com/unqualified">""" +
"<string1></string1>" +
"""<unq:bar>bar</unq:bar>""" +
"</unq:foo>", outdir = "./tmp")
}
"unqualified.scala file must compile so that Foo can be used without toplevel prefix" in {
(List("""scalaxb.toXML[unqualified.Foo](scalaxb.fromXML[unqualified.Foo](""" +
"""<unq:foo xmlns:unq="http://www.example.com/unqualified" attribute1="bar">""" +
"<string1></string1>" +
"""<unq:bar>bar</unq:bar>""" +
"""</unq:foo>), "foo", """ +
"""scalaxb.toScope(Some("unq") -> "http://www.example.com/unqualified") ).toString"""),
generated) must evaluateTo("""<foo attribute1="bar" xmlns:unq="http://www.example.com/unqualified">""" +
"<string1></string1>" +
"""<unq:bar>bar</unq:bar>""" +
"</foo>", outdir = "./tmp")
}
"unqualified.scala file must compile so that USAddress can roundtrip" in {
(List("""val usaddress = unqualified.USAddress("123", "New York", "NY", 10000, Map())""",
"""val xml = scalaxb.toXML[unqualified.Addressable](usaddress, None, Some("shipTo"), unqualified.defaultScope)""",
"""val x = scalaxb.fromXML[unqualified.Addressable](xml).toString""",
"""x"""),
generated) must evaluateTo ("""USAddress(123,New York,NY,10000,Map(@{http://www.w3.org/2001/XMLSchema-instance}type -> DataRecord({http://www.w3.org/2001/XMLSchema-instance}type,tns:USAddress)))""",
outdir = "./tmp")
}
/*
val inFile2 = new File("integration/src/test/resources/qualified.xsd")
lazy val generated2 = (new Driver).process(inFile2, "qualified", tmp)
"qualified.scala file must compile so that Foo can be used" in {
(List("""scalaxb.toXML[qualified.Foo](scalaxb.fromXML[qualified.Foo](""" +
"""<q:foo xmlns:q="http://www.example.com/qualified" q:attribute1="bar">""" +
"<q:string1></q:string1>" +
"""</q:foo>), """ +
"""Some("http://www.example.com/qualified"), "foo", """ +
"""scalaxb.toScope(Some("q") -> "http://www.example.com/qualified") ).toString"""),
generated2) must evaluateTo("""<q:foo q:attribute1="bar" xmlns:q="http://www.example.com/qualified">""" +
"<q:string1></q:string1>" +
"</q:foo>", outdir = "./tmp")
}
*/
}
|
{
"pile_set_name": "Github"
}
|
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><la:message key="labels.admin_brand_title"/> | <la:message key="labels.search_list_configuration"/></title>
<jsp:include page="/WEB-INF/view/common/admin/head.jsp"></jsp:include>
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
<jsp:include page="/WEB-INF/view/common/admin/header.jsp"></jsp:include>
<jsp:include page="/WEB-INF/view/common/admin/sidebar.jsp">
<jsp:param name="menuCategoryType" value="log"/>
<jsp:param name="menuType" value="searchList"/>
</jsp:include>
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>
<la:message key="labels.search_list_configuration"/>
</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item active"><la:link href="/admin/searchlist/search?q=${f:u(q)}">
<la:message key="labels.search_list_configuration"/>
</la:link></li>
</ol>
</div>
</div>
</div>
</div>
<section class="content">
<la:form action="/admin/searchlist/">
<la:hidden property="crudMode"/>
<la:hidden property="q"/>
<c:if test="${crudMode==2}">
<la:hidden property="id"/>
<la:hidden property="seqNo"/>
<la:hidden property="primaryTerm"/>
</c:if>
<div class="row">
<div class="col-md-12">
<div class="card card-outline <c:if test="${crudMode == 1 || crudMode == 2}">card-success</c:if>">
<div class="card-header">
<h3 class="card-title">
<c:if test="${crudMode == null}">
<la:message key="labels.crud_title_list"/>
</c:if>
<c:if test="${crudMode == 1}">
<la:message key="labels.crud_title_create"/>
</c:if>
<c:if test="${crudMode == 2}">
<la:message key="labels.crud_title_edit"/>
</c:if>
<c:if test="${crudMode == 3}">
<la:message key="labels.crud_title_delete"/>
</c:if>
<c:if test="${crudMode == 4}">
<la:message key="labels.crud_title_details"/>
</c:if>
</h3>
<div class="card-tools">
<div class="btn-group">
<c:choose>
<c:when test="${crudMode == null}">
<la:link href="createnew" styleClass="btn btn-success btn-xs">
<em class="fa fa-plus"></em>
<la:message key="labels.crud_link_create"/>
</la:link>
</c:when>
<c:otherwise>
<la:link href="/admin/searchlist/search?q=${f:u(q)}"
styleClass="btn btn-primary btn-xs">
<em class="fa fa-th-list"></em>
<la:message key="labels.crud_link_list"/>
</la:link>
</c:otherwise>
</c:choose>
</div>
</div>
</div>
<div class="card-body">
<div>
<la:info id="msg" message="true">
<div class="alert alert-info">${msg}</div>
</la:info>
<la:errors property="_global"/>
</div>
<c:if test="${crudMode==2}">
<div class="form-group row">
<label class="col-sm-3 text-sm-right col-form-label">_id</label>
<div class="col-sm-9">${f:h(id)}</div>
</div>
<div class="form-group row">
<label for="doc.doc_id" class="col-sm-3 text-sm-right col-form-label">doc_id</label>
<div class="col-sm-9">
${f:h(doc.doc_id)}
<la:hidden styleId="doc.doc_id" property="doc.doc_id"/>
</div>
</div>
</c:if>
<div class="form-group row">
<label for="doc.url" class="col-sm-3 text-sm-right col-form-label">url</label>
<div class="col-sm-9">
<la:errors property="doc.url"/>
<la:text styleId="doc.url"
property="doc.url" styleClass="form-control"
required="required" data-validation="required"/>
</div>
</div>
<div class="form-group row">
<label for="doc.title" class="col-sm-3 text-sm-right col-form-label">title</label>
<div class="col-sm-9">
<la:errors property="doc.title"/>
<la:text styleId="doc.title"
property="doc.title" styleClass="form-control"
required="required" data-validation="required"/>
</div>
</div>
<div class="form-group row">
<label for="doc.role" class="col-sm-3 text-sm-right col-form-label">role</label>
<div class="col-sm-9">
<la:errors property="doc.role"/>
<la:textarea styleId="doc.role"
property="doc.role" styleClass="form-control"
data-validation-help="1(username) | 2(groupname) | R(rolename) e.g. Rguest"/>
</div>
</div>
<div class="form-group row">
<label for="doc.boost" class="col-sm-3 text-sm-right col-form-label">boost</label>
<div class="col-sm-9">
<la:errors property="doc.boost"/>
<la:text styleId="doc.boost"
property="doc.boost" styleClass="form-control"
title="Floating point number" required="required"
data-validation="custom"
data-validation-regexp="(\+|\-)?\d+(\.\d+)?((e|E)(\+|\-)?\d+)?"
data-validation-help="number (Float)"/>
</div>
</div>
<div class="form-group row">
<label for="doc.label" class="col-sm-3 text-sm-right col-form-label">label</label>
<div class="col-sm-9">
<la:errors property="doc.label"/>
<la:textarea styleId="doc.label" property="doc.label" styleClass="form-control"/>
</div>
</div>
<div class
|
{
"pile_set_name": "Github"
}
|
<?php
/*
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "containers" collection of methods.
* Typical usage is:
* <code>
* $tagmanagerService = new Google_Service_TagManager(...);
* $containers = $tagmanagerService->containers;
* </code>
*/
class Google_Service_TagManager_Resource_AccountsContainers extends Google_Service_Resource
{
/**
* Creates a Container. (containers.create)
*
* @param string $accountId The GTM Account ID.
* @param Google_Service_TagManager_Container $postBody
* @param array $optParams Optional parameters.
* @return Google_Service_TagManager_Container
*/
public function create($accountId, Google_Service_TagManager_Container $postBody, $optParams = array())
{
$params = array('accountId' => $accountId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
return $this->call('create', array($params), "Google_Service_TagManager_Container");
}
/**
* Deletes a Container. (containers.delete)
*
* @param string $accountId The GTM Account ID.
* @param string $containerId The GTM Container ID.
* @param array $optParams Optional parameters.
*/
public function delete($accountId, $containerId, $optParams = array())
{
$params = array('accountId' => $accountId, 'containerId' => $containerId);
$params = array_merge($params, $optParams);
return $this->call('delete', array($params));
}
/**
* Gets a Container. (containers.get)
*
* @param string $accountId The GTM Account ID.
* @param string $containerId The GTM Container ID.
* @param array $optParams Optional parameters.
* @return Google_Service_TagManager_Container
*/
public function get($accountId, $containerId, $optParams = array())
{
$params = array('accountId' => $accountId, 'containerId' => $containerId);
$params = array_merge($params, $optParams);
return $this->call('get', array($params), "Google_Service_TagManager_Container");
}
/**
* Lists all Containers that belongs to a GTM Account.
* (containers.listAccountsContainers)
*
* @param string $accountId The GTM Account ID.
* @param array $optParams Optional parameters.
* @return Google_Service_TagManager_ListContainersResponse
*/
public function listAccountsContainers($accountId, $optParams = array())
{
$params = array('accountId' => $accountId);
$params = array_merge($params, $optParams);
return $this->call('list', array($params), "Google_Service_TagManager_ListContainersResponse");
}
/**
* Updates a Container. (containers.update)
*
* @param string $accountId The GTM Account ID.
* @param string $containerId The GTM Container ID.
* @param Google_Service_TagManager_Container $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string fingerprint When provided, this fingerprint must match the
* fingerprint of the container in storage.
* @return Google_Service_TagManager_Container
*/
public function update($accountId, $containerId, Google_Service_TagManager_Container $postBody, $optParams = array())
{
$params = array('accountId' => $accountId, 'containerId' => $containerId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
return $this->call('update', array($params), "Google_Service_TagManager_Container");
}
}
|
{
"pile_set_name": "Github"
}
|
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for lib/spdy-transport/protocol/spdy/</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../../../prettify.css" />
<link rel="stylesheet" href="../../../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../../../index.html">all files</a> lib/spdy-transport/protocol/spdy/
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">90.65% </span>
<span class="quiet">Statements</span>
<span class='fraction'>475/524</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">79.67% </span>
<span class="quiet">Branches</span>
<span class='fraction'>196/246</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">93.24% </span>
<span class="quiet">Functions</span>
<span class='fraction'>69/74</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">91.94% </span>
<span class="quiet">Lines</span>
<span class='fraction'>468/509</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="constants.js"><a href="constants.js.html">constants.js</a></td>
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="18" class="abs high">18/18</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="18" class="abs high">18/18</td>
</tr>
<tr>
<td class="file high" data-value="dictionary.js"><a href="dictionary.js.html">dictionary.js</a></td>
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
</tr>
<tr>
<td class="file high" data-value="framer.js"><a href="framer.js.html">framer.js</a></td>
<td data-value="91.84" class="pic high"><div class="chart"><div class="cover-fill" style="width: 91%;"></div><div class="cover-empty" style="width:9%;"></div></div></td>
<td data-value="91.84" class="pct high">91.84%</td>
<td data-value="245" class="abs high">225/245</td>
<td data-value="81.55" class="pct high">81.55%</td>
<td data-value="103" class="abs high">84/103</td>
<td data-value="93.18" class="pct high">93.18%</td>
<td data-value="44" class="abs high">41/44</td>
<td data-value="92.05" class="pct high">92.05%</td>
<td data-value="239" class="abs high">220/239</td>
</tr>
<tr>
<td class="file high" data-value="index.js"><a href="index.js.html">index.js</a></td>
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
</tr>
<tr>
<td class="file high" data-value="parser.js"><a href="parser.js.html">parser.js</a></td>
<td data-value="88.05" class="pic high"><div class="chart"><div class="cover-fill" style="width: 88%;"></div><div class="cover-empty" style="width:12%;"></div></div></td
|
{
"pile_set_name": "Github"
}
|
/*
* C# Version Ported by Matt Bettcher and Ian Qvist 2009-2010
*
* Original C++ Version Copyright (c) 2007 Eric Jordan
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Microsoft.Xna.Framework;
namespace FarseerPhysics.Common.Decomposition
{
/// <summary>
/// Convex decomposition algorithm using ear clipping
///
/// Properties:
/// - Only works on simple polygons.
/// - Does not support holes.
/// - Running time is O(n^2), n = number of vertices.
///
/// Source: http://www.ewjordan.com/earClip/
/// </summary>
internal static class EarclipDecomposer
{
//box2D rev 32 - for details, see http://www.box2d.org/forum/viewtopic.php?f=4&t=83&start=50
/// <summary>
/// Decompose the polygon into several smaller non-concave polygon.
/// Each resulting polygon will have no more than Settings.MaxPolygonVertices vertices.
/// </summary>
/// <param name="vertices">The vertices.</param>
/// <param name="tolerance">The tolerance.</param>
public static List<Vertices> ConvexPartition(Vertices vertices, float tolerance = 0.001f)
{
Debug.Assert(vertices.Count > 3);
Debug.Assert(!vertices.IsCounterClockWise());
return TriangulatePolygon(vertices, tolerance);
}
/// <summary>
/// Triangulates a polygon using simple ear-clipping algorithm. Returns
/// size of Triangle array unless the polygon can't be triangulated.
/// This should only happen if the polygon self-intersects,
/// though it will not _always_ return null for a bad polygon - it is the
/// caller's responsibility to check for self-intersection, and if it
/// doesn't, it should at least check that the return value is non-null
/// before using. You're warned!
///
/// Triangles may be degenerate, especially if you have identical points
/// in the input to the algorithm. Check this before you use them.
///
/// This is totally unoptimized, so for large polygons it should not be part
/// of the simulation loop.
/// </summary>
/// <remarks>
/// Only works on simple polygons.
/// </remarks>
static List<Vertices> TriangulatePolygon(Vertices vertices, float tolerance)
{
//FPE note: Check is needed as invalid triangles can be returned in recursive calls.
if (vertices.Count < 3)
return new List<Vertices>();
var results = new List<Vertices>();
//Recurse and split on pinch points
Vertices pA, pB;
var pin = new Vertices(vertices);
if (ResolvePinchPoint(pin, out pA, out pB, tolerance))
{
var mergeA = TriangulatePolygon(pA, tolerance);
var mergeB = TriangulatePolygon(pB, tolerance);
if (mergeA.Count == -1 || mergeB.Count == -1)
throw new Exception("Can't triangulate your polygon.");
for (int i = 0; i < mergeA.Count; ++i)
results.Add(new Vertices(mergeA[i]));
for (int i = 0; i < mergeB.Count; ++i)
results.Add(new Vertices(mergeB[i]));
return results;
}
var buffer = new Vertices[vertices.Count - 2];
var bufferSize = 0;
var xrem = new float[vertices.Count];
var yrem = new float[vertices.Count];
for (int i = 0; i < vertices.Count; ++i)
{
xrem[i] = vertices[i].X;
yrem[i] = vertices[i].Y;
}
var vNum = vertices.Count;
while (vNum > 3)
{
// Find an ear
var earIndex = -1;
var earMaxMinCross = -10.0f;
for (int i = 0; i < vNum; ++i)
{
if (IsEar(i, xrem, yrem, vNum))
{
var lower = Remainder(i - 1, vNum);
var upper = Remainder(i + 1, vNum);
var d1 = new Vector2(xrem[upper] - xrem[i], yrem[upper] - yrem[i]);
var d2 = new Vector2(xrem[i] - xrem[lower], yrem[i] - yrem[lower]);
var d3 = new Vector2(xrem[lower] - xrem[upper], yrem[lower] - yrem[upper]);
Nez.Vector2Ext.Normalize(ref d1);
Nez.Vector2Ext.Normalize(ref d2);
Nez.Vector2Ext.Normalize(ref d3);
float cross12;
MathUtils.Cross(ref d1, ref d2, out cross12);
cross12 = Math.Abs(cross12);
float cross23;
MathUtils.Cross(ref d2, ref d3, out cross23);
cross23 = Math.Abs(cross23);
float cross31;
MathUtils.Cross(ref d3, ref d1, out cross31);
cross31 = Math.Abs(cross31);
//Find the maximum minimum angle
float minCross = Math.Min(cross12, Math.Min(cross23, cross31));
if (minCross > earMaxMinCross)
{
earIndex = i;
earMaxMinCross = minCross;
}
}
}
// If we still haven't found an ear, we're screwed.
// Note: sometimes this is happening because the
// remaining points are collinear. Really these
// should just be thrown out without halting triangulation.
if (earIndex == -1)
{
for (int i = 0; i < bufferSize; i++)
results.Add(buffer[i]);
return results;
}
// Clip off the ear:
// - remove the ear tip from the list
--vNum;
float[] newx = new float[vNum];
float[] newy = new float[vNum];
int currDest = 0;
for (int i = 0; i < vNum; ++i)
{
if (currDest == earIndex) ++currDest;
newx[i] = xrem[currDest];
newy[i] = yrem[currDest];
++currDest;
}
// - add the clipped triangle to the triangle list
int under = (earIndex == 0) ? (vNum) : (earIndex - 1);
int over = (earIndex == vNum) ? 0 : (earIndex + 1);
var toAdd = new Triangle(xrem[earIndex], yrem[earIndex], xrem[over], yrem[over], xrem[under],
yrem[under]);
buffer[bufferSize] = toAdd;
++bufferSize;
// - replace the old list with the new one
xrem = newx;
yrem = newy;
}
var tooAdd = new Triangle(xrem[1], yrem[1], xrem[2], yrem[2], xrem[0], yrem[0]);
buffer[bufferSize] = too
|
{
"pile_set_name": "Github"
}
|
package xiaofei.library.hermestest;
import android.content.Context;
import xiaofei.library.hermes.annotation.ClassId;
/**
* Created by Xiaofei on 16/4/28.
*/
@ClassId("FileUtils")
public interface IFileUtils {
String getExternalCacheDir(Context context);
}
|
{
"pile_set_name": "Github"
}
|
print(1 < 2 < 3)
print(1 < 2 < 3 < 4)
print(1 > 2 < 3)
print(1 < 2 > 3)
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'width' is 'auto' and 'left' and 'right' are not 'auto'</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height" title="10.6.4 Absolutely positioned, non-replaced elements" />
<link rel="match" href="abs-pos-non-replaced-vlr-007-ref.xht" />
<meta name="flags" content="ahem image" />
<meta name="assert" content="When 'direction' is 'ltr' and 'width' is 'auto' and 'left' and 'right' are not 'auto' and 'writing-mode' is 'vertical-lr', then solve for 'width'." />
<style type="text/css"><![CDATA[
@font-face {
font-family: Ahem;
src: url("../../../fonts/Ahem.ttf");
}
]]></style>
<style type="text/css"><![CDATA[
html
{
writing-mode: vertical-lr;
}
div#containing-block
{
background: red url("support/bg-red-2col-3row-320x320.png");
color: transparent;
direction: ltr;
font: 80px/1 Ahem;
height: 320px;
position: relative;
width: 320px;
}
div#containing-block > span
{
background-color: green;
height: 1em;
left: 1em;
position: absolute;
right: 2em;
width: auto;
}
/*
"
Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
"
7.1 Principles of Layout in Vertical Writing Modes
http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
So here, *left properties and *right properties are input into the §10.6.4 algorithms where *left properties refer to *top properties in the layout rules and where *right properties refer to *bottom properties in the layout rules.
"
5. 'height' is 'auto', 'top' and 'bottom' are not 'auto', then 'auto' values for 'margin-top' and 'margin-bottom' are set to 0 and solve for 'height'
"
'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
So:
160px : right
+
0px : margin-right
+
0px : border-right-width
+
0px : padding-right
+
(solve) : width: auto
+
0px : padding-left
+
0px : border-left-width
+
0px : margin-left
+
80px : left
=====================
320px : width of containing block
And so computed width value must be 80px .
*/
]]></style>
</head>
<body>
<p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
<div id="containing-block">1 2 34<span></span></div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
{
}
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.