text
stringlengths 2
99.9k
| meta
dict |
|---|---|
package com.gupaoedu.pay;
/**
* description:
*
* @author shuangling.mao 1015952139
* @date 2019-08-09 01:01:40
*/
public interface IEnum {
String getCode();
String getDesc();
}
|
{
"pile_set_name": "Github"
}
|
'use strict';
const nconf = require('nconf');
const winston = require('winston');
const validator = require('validator');
const meta = require('../meta');
const plugins = require('../plugins');
const middleware = require('../middleware');
exports.handle404 = function handle404(req, res) {
const relativePath = nconf.get('relative_path');
const isClientScript = new RegExp('^' + relativePath + '\\/assets\\/src\\/.+\\.js(\\?v=\\w+)?$');
if (plugins.hasListeners('action:meta.override404')) {
return plugins.fireHook('action:meta.override404', {
req: req,
res: res,
error: {},
});
}
if (isClientScript.test(req.url)) {
res.type('text/javascript').status(404).send('Not Found');
} else if (req.path.startsWith(relativePath + '/assets/uploads') || (req.get('accept') && !req.get('accept').includes('text/html')) || req.path === '/favicon.ico') {
meta.errors.log404(req.path || '');
res.sendStatus(404);
} else if (req.accepts('html')) {
if (process.env.NODE_ENV === 'development') {
winston.warn('Route requested but not found: ' + req.url);
}
meta.errors.log404(req.path.replace(/^\/api/, '') || '');
exports.send404(req, res);
} else {
res.status(404).type('txt').send('Not found');
}
};
exports.send404 = async function (req, res) {
res.status(404);
const path = String(req.path || '');
if (res.locals.isAPI) {
return res.json({ path: validator.escape(path.replace(/^\/api/, '')), title: '[[global:404.title]]' });
}
await middleware.buildHeaderAsync(req, res);
res.render('404', { path: validator.escape(path), title: '[[global:404.title]]' });
};
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2012 - present Instructure, Inc.
*
* This file is part of Canvas.
*
* Canvas is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, version 3 of the License.
*
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import $ from 'jquery'
import Backbone from 'Backbone'
class TestCollection extends Backbone.Collection {}
TestCollection.prototype.defaults = {
foo: 'bar',
params: {
multi: ['foos', 'bars'],
single: 1
}
}
TestCollection.optionProperty('foo')
TestCollection.prototype.url = '/fake'
TestCollection.prototype.model = Backbone.Model.extend()
QUnit.module('Backbone.Collection', {
setup() {
this.xhr = sinon.useFakeXMLHttpRequest()
this.ajaxSpy = sandbox.spy($, 'ajax')
},
teardown() {
this.xhr.restore
}
})
test('default options', () => {
const collection = new TestCollection()
equal(typeof collection.options, 'object', 'sets options property')
equal(collection.options.foo, 'bar', 'sets default options')
const collection2 = new TestCollection(null, {foo: 'baz'})
equal(collection2.options.foo, 'baz', 'overrides default options with instance options')
})
test('optionProperty', () => {
const collection = new TestCollection({foo: 'bar'})
equal(collection.foo, 'bar')
})
test('sends @params in request', () => {
const collection = new TestCollection()
collection.fetch()
deepEqual(
$.ajax.getCall(0).args[0].data,
collection.options.params,
'sends default parameters with request'
)
collection.options.params = {a: 'b', c: ['d']}
collection.fetch()
deepEqual(
$.ajax.getCall(1).args[0].data,
collection.options.params,
'sends dynamic parameters with request'
)
})
test('uses conventional default url', () => {
let assetString
const FakeModel = Backbone.Model.extend(
{resourceName: 'discussion_topics'},
(assetString = 'course_1')
)
const FakeCollection = Backbone.Collection.extend({
model: FakeModel
})
const collection = new FakeCollection()
collection.contextAssetString = assetString
equal(
collection.url(),
'/api/v1/courses/1/discussion_topics',
'used conventional URL with specific contextAssetString'
)
})
test('triggers setParam event', () => {
const collection = new Backbone.Collection()
const spy = sinon.spy()
collection.on('setParam', spy)
collection.setParam('foo', 'bar')
ok(spy.calledOnce, 'event triggered')
equal(spy.args[0][0], 'foo')
equal(spy.args[0][1], 'bar')
})
test('setParams', () => {
const collection = new Backbone.Collection()
ok(!collection.options.params, 'no params')
collection.setParams({
foo: 'bar',
baz: 'qux'
})
deepEqual(collection.options.params, {foo: 'bar', baz: 'qux'})
})
test('triggers setParams event', () => {
const collection = new Backbone.Collection()
const spy = sinon.spy()
collection.on('setParams', spy)
const params = {
foo: 'bar',
baz: 'qux'
}
collection.setParams(params)
ok(spy.calledOnce, 'event triggered')
equal(spy.args[0][0], params)
})
test('parse', () => {
class SideLoader extends Backbone.Collection {}
const collection = new SideLoader()
// boolean
SideLoader.prototype.sideLoad = {author: true}
let document = [1, 2, 3]
equal(collection.parse(document), document, 'passes through simple documents')
document = {a: 1, b: 2}
equal(collection.parse(document), document, 'passes through without meta key')
document = {
meta: {},
posts: [{id: 1, links: {author: 1}}, {id: 2, links: {author: 1}}]
}
equal(collection.parse(document), document.posts, 'extracts primary collection')
const john = {id: 1, name: 'John Doe'}
document = {
posts: [{id: 1, links: {author: 1}}, {id: 2, links: {author: 1}}],
linked: {
authors: [john]
}
}
let expected = [{id: 1, author: john}, {id: 2, author: john}]
deepEqual(collection.parse(document), expected, 'extracts primary collection')
// string
SideLoader.prototype.sideLoad = {author: 'users'}
document = {
posts: [{id: 1, links: {author: 1}}, {id: 2, links: {author: 1}}],
linked: {
users: [john]
}
}
deepEqual(collection.parse(document), expected, 'recognizes string side load as collection name')
// complex
SideLoader.prototype.sideLoad = {
author: {
collection: 'users',
foreignKey: 'user_id'
}
}
document = {
posts: [{id: 1, links: {user_id: 1}}, {id: 2, links: {user_id: 1}}],
linked: {
users: [john]
}
}
deepEqual(collection.parse(document), expected, 'recognizes complex side load declaration')
// multiple
SideLoader.prototype.sideLoad = {
author: 'users',
editor: 'users'
}
let jane = {id: 2, name: 'Jane Doe'}
document = {
posts: [{id: 1, links: {author: 1, editor: 2}}, {id: 2, links: {author: 2, editor: 1}}],
linked: {
users: [john, jane]
}
}
expected = [{id: 1, author: john, editor: jane}, {id: 2, author: jane, editor: john}]
deepEqual(collection.parse(document), expected, 'recognizes multiple side load declarations')
// keeps links attributes that are not found or not defined
SideLoader.prototype.sideLoad = {author: 'users'}
jane = {id: 2, name: 'Jane Doe'}
document = {
posts: [
{id: 1, links: {author: 1, editor: 2}},
{id: 2, links: {author: 2, editor: 1}},
{id: 3, links: {author: 5, editor: 1}}
],
linked: {
users: [john, jane]
}
}
expected = [
{id: 1, author: john, links: {editor: 2}},
{id: 2, author: jane, links: {editor: 1}},
{id: 3, links: {author: 5, editor: 1}}
]
deepEqual(
collection.parse(document),
expected,
'retains links when sideload relation is not found'
)
// to_many simple
SideLoader.prototype.sideLoad = {authors: true}
document = {
posts: [{id: 1, links: {authors: ['1', '2']}}, {id: 2, links: {authors: ['1']}}],
linked: {
authors: [john, jane]
}
}
expected = [{id: 1, authors: [john, jane]}, {id: 2, authors: [john]}]
deepEqual(
collection.parse(document),
expected,
'extracts links with simple to_many relationships'
)
// to_many string
SideLoader.prototype.sideLoad = {authors: 'users'}
document = {
posts: [{id: 1, links: {authors: ['1', '2']}}, {id: 2, links: {authors: ['1']}}],
linked: {
users: [john, jane]
}
}
expected = [{id: 1, authors: [john, jane]}, {id: 2, authors: [john]}]
deepEqual(
collection.parse(document),
expected,
'extracts links with string to_many relationships'
)
// to_many complex
SideLoader.prototype.sideLoad = {
authors: {
collection: 'users',
foreignKey: 'author_ids'
}
}
document = {
posts: [{id: 1, links: {author_ids: ['1', '2']}}, {id: 2, links: {author_ids: ['1']}}],
linked: {
users: [john, jane]
}
}
expected = [{id: 1, authors: [john, jane]}, {id: 2, authors: [john]}]
deepEqual(
collection.parse(document),
expected,
'extracts links with complex to_many relationships'
)
// to_many complex
SideLoader.prototype.sideLoad = {
authors: {
collection: 'authors',
foreignKey: 'author_ids'
}
}
document = {
posts: [{id: 1, links: {author_ids: ['1', '2']}}, {id: 2, links: {author_ids: ['1']}}],
linked: {
users: [john, jane]
}
}
expected = "Could not find linked collection for 'authors' using 'author_ids'."
throws(
() => collection.parse(document),
expected,
'should throw error when a to_many relationship is not found'
)
SideLoader.prototype.sideLoad = {authors: true}
// Links attribute
document = {
links: {
'posts.author': 'http://example.com/authors/{posts.author}'
},
posts: [{id: 1, links: {authors: ['1', '2']}}, {id: 2, links: {authors: ['1']}}],
linked: {
authors: [john, jane]
}
}
expected = [{id: 1, authors: [john, jane]}, {id: 2, authors: [john]}]
deepEqual(collection.parse(document), expected, 'extracts links with links root')
})
|
{
"pile_set_name": "Github"
}
|
/* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/StoreKitUI.framework/StoreKitUI
*/
@interface SKUIShareTemplateActivityViewController : UIActivityViewController {
SKUIClientContext * _clientContext;
SKUIShareTemplateViewElement * _templateElement;
}
- (void).cxx_destruct;
- (id)_activityItemsWithTemplateElement:(id)arg1 clientContext:(id)arg2;
- (id)_applicationActivitiesWithTemplateElement:(id)arg1 clientContext:(id)arg2;
- (id)_titleForActivity:(id)arg1;
- (id)initWithTemplateElement:(id)arg1 clientContext:(id)arg2;
@end
|
{
"pile_set_name": "Github"
}
|
use crate::*;
// -----------------------------------------------------------------------------
#[derive(Clone, Debug, PartialEq, Node)]
pub struct PreprocessorText {
pub nodes: (Vec<SourceDescription>,),
}
|
{
"pile_set_name": "Github"
}
|
package com.gavin.apmtools.frame;
import android.view.Gravity;
import java.io.Serializable;
import java.util.concurrent.TimeUnit;
/**
* Created by gavin
* date 2018/5/30
*/
public class FPSConfig implements Serializable
{
public static int DEFAULT_GRAVITY = Gravity.TOP | Gravity.START;
public float redFlagPercentage = 0.2f; //
public float yellowFlagPercentage = 0.05f; //
public float refreshRate = 60; //60fps
public float deviceRefreshRateInMs = 16.6f; //value from device ex 16.6 ms
// client facing callback that provides frame info
public FrameDataCallback frameDataCallback = null;
// making final for now.....want to be solid on the math before we allow an
// arbitrary value
public final long sampleTimeInMs = 1000;//928;//736; // default sample time
public FPSConfig()
{}
public long getSampleTimeInNs()
{
return TimeUnit.NANOSECONDS.convert(sampleTimeInMs, TimeUnit.MILLISECONDS);
}
public long getDeviceRefreshRateInNs()
{
float value = deviceRefreshRateInMs * 1000000f;
return (long) value;
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/>
* Build: `lodash modularize underscore exports="node" -o ./underscore/`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <http://lodash.com/license>
*/
var objectTypes = require('./objectTypes');
/** Used for native method references */
var objectProto = Object.prototype;
/** Native method shortcuts */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A fallback implementation of `Object.keys` which produces an array of the
* given object's own enumerable property names.
*
* @private
* @type Function
* @param {Object} object The object to inspect.
* @returns {Array} Returns an array of property names.
*/
var shimKeys = function(object) {
var index, iterable = object, result = [];
if (!iterable) return result;
if (!(objectTypes[typeof object])) return result;
for (index in iterable) {
if (hasOwnProperty.call(iterable, index)) {
result.push(index);
}
}
return result
};
module.exports = shimKeys;
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
use Magento\Config\Model\ResourceModel\Config;
use Magento\Store\Model\ScopeInterface;
use Magento\Store\Model\Store;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\TestFramework\Workaround\Override\Fixture\Resolver;
$objectManager = Bootstrap::getObjectManager();
$store = $objectManager->create(Store::class);
$storeId = $store->load('fixture_second_store', 'code')->getId();
if ($storeId) {
$configResource = $objectManager->get(Config::class);
$configResource->deleteConfig(
'trans_email/ident_general/name',
ScopeInterface::SCOPE_STORES,
$storeId
);
$configResource->deleteConfig(
'trans_email/ident_general/email',
ScopeInterface::SCOPE_STORES,
$storeId
);
}
Resolver::getInstance()->requireDataFixture('Magento/Store/_files/second_store_rollback.php');
|
{
"pile_set_name": "Github"
}
|
# Strata + Hadoop World, San Jose 2016
This directory contains demo notebooks used for the "Introduction to Recommender Systems", the second session of **Machine Learning 101**, an all-day tutorial at [Strata + Hadoop World, New York City, 2015](http://strataconf.com/big-data-conference-ny-2015/public/schedule/detail/43217).
In this session we
- give an introduction to recommendation systems,
- show how easy it is to get started
- provide examples and slides
Along the way, we also cover feature engineering and deploying machine learning models as a predictive service.
## Setup Instructions
You can browse the notebooks using Github IPython notebook viewer. Note that some images may not be rendered correctly. If you'd like to run it, follow these steps to set up your machine.
- [Download](https://turi.com/download/) GraphLab Create and then follow instructions to [install](https://turi.com/download/install.html).
- Download and unzip the datasets
## Handy references
- [GraphLab Create User Guide](https://turi.com/learn/userguide)
- [GraphLab Forum](http://forum.turi.com/categories/graphlab-create)
|
{
"pile_set_name": "Github"
}
|
import numpy as np
from test.runtime.frontend_test.onnx_test.util import make_node, make_tensor_value_info, make_model
from test.util import wrap_template, generate_kernel_test_case
from webdnn.frontend.onnx import ONNXConverter
@wrap_template
def template(x_shape, alpha, gamma, description: str = ""):
np_alpha = 1.6732 if alpha is None else alpha
np_gamma = 1.0507 if gamma is None else gamma
vx = np.random.rand(*x_shape) - 0.5
vy = vx.copy()
vy[vx <= 0] = np_gamma * (np_alpha * np.exp(vx[vx <= 0]) - np_alpha)
vy[vx > 0] = np_gamma * vx[vx > 0]
x = make_tensor_value_info("x", vx.shape)
y = make_tensor_value_info("y", vy.shape)
kwargs = {}
if alpha is not None:
kwargs["alpha"] = alpha
if gamma is not None:
kwargs["gamma"] = gamma
operator = make_node("Selu", ["x"], ["y"], **kwargs)
model = make_model([operator], [x], [y])
graph = ONNXConverter().convert(model)
generate_kernel_test_case(
description=f"[ONNX] Selu {description}",
graph=graph,
inputs={graph.inputs[0]: vx},
expected={graph.outputs[0]: vy},
EPS=1e-2
)
def test():
template(x_shape=[2, 3, 4, 5], alpha=None, gamma=None)
def test_alpha():
template(x_shape=[2, 3, 4, 5], alpha=2.0, gamma=None)
def test_beta():
template(x_shape=[2, 3, 4, 5], alpha=None, gamma=2.0)
|
{
"pile_set_name": "Github"
}
|
var asciiToArray = require('./_asciiToArray'),
hasUnicode = require('./_hasUnicode'),
unicodeToArray = require('./_unicodeToArray');
/**
* Converts `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function stringToArray(string) {
return hasUnicode(string)
? unicodeToArray(string)
: asciiToArray(string);
}
module.exports = stringToArray;
|
{
"pile_set_name": "Github"
}
|
#ifndef CRC_H
#define CRC_H
#include "comm/crc_8.hpp"
#include "comm/crc_16.hpp"
#endif /* CRC_H */
|
{
"pile_set_name": "Github"
}
|
# Generated by makeXDC.ulp developed by Sven Raiser, Tuebingen, Germany
#
# Board: ESA11-7A35i-V0.1.brd
# Part Name: FPGA XC7A35T-FGG484, Speedgrade: -2
# Part pkg: BGA484
# Memory Device: DDR3_SDRAM-]Components-]MT41J128M16XX-125
# Created: 31.03.2015 10:47:48
# Edited: 2015-05-27, by emu
set_property CFGBVS VCCO [current_design]
#where value1 is either VCCO or GND
set_property CONFIG_VOLTAGE 3.3 [current_design]
#where value2 is the voltage provided to configuration bank 0
# set_property PACKAGE_PIN N14 [get_ports RESET_N]
# set_property IOSTANDARD LVTTL [get_ports RESET_N]
# set_property DRIVE 4 [get_ports RESET_N]
# set_property PACKAGE_PIN W20 [get_ports i_50MHz]
# set_property IOSTANDARD LVTTL [get_ports i_50MHz]
# set_property DRIVE 4 [get_ports 50MHZ]
# set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets clk100.clkgen100/clkin1]
set_property PACKAGE_PIN Y19 [get_ports i_100MHz_N]
set_property IOSTANDARD LVDS_25 [get_ports i_100MHz_N]
set_property PACKAGE_PIN Y18 [get_ports i_100MHz_P]
set_property IOSTANDARD LVDS_25 [get_ports i_100MHz_P]
#
# On board LEDs
#
set_property PACKAGE_PIN N15 [get_ports FPGA_LED3]
set_property IOSTANDARD LVTTL [get_ports FPGA_LED3]
set_property DRIVE 4 [get_ports FPGA_LED1]
set_property PACKAGE_PIN C13 [get_ports FPGA_LED2]
set_property IOSTANDARD LVTTL [get_ports FPGA_LED2]
set_property DRIVE 4 [get_ports FPGA_LED2]
#
# UARTs
#
# set_property PACKAGE_PIN F16 [get_ports UART1_CTS_N]
# set_property IOSTANDARD LVTTL [get_ports UART1_CTS_N]
# set_property DRIVE 4 [get_ports UART1_CTS_N]
# set_property PACKAGE_PIN F15 [get_ports UART1_RTS_N]
# set_property IOSTANDARD LVTTL [get_ports UART1_RTS_N]
# set_property DRIVE 4 [get_ports UART1_RTS_N]
set_property PACKAGE_PIN E13 [get_ports UART1_RXD]
set_property IOSTANDARD LVTTL [get_ports UART1_RXD]
set_property DRIVE 4 [get_ports UART1_RXD]
set_property PACKAGE_PIN F13 [get_ports UART1_TXD]
set_property IOSTANDARD LVTTL [get_ports UART1_TXD]
set_property DRIVE 4 [get_ports UART1_TXD]
# set_property PACKAGE_PIN M17 [get_ports UART2_CTS_N]
# set_property IOSTANDARD LVTTL [get_ports UART2_CTS_N]
# set_property DRIVE 4 [get_ports UART2_CTS_N]
# set_property PACKAGE_PIN L16 [get_ports UART2_RTS_N]
# set_property IOSTANDARD LVTTL [get_ports UART2_RTS_N]
# set_property DRIVE 4 [get_ports UART2_RTS_N]
# set_property PACKAGE_PIN M18 [get_ports UART2_RXD]
# set_property IOSTANDARD LVTTL [get_ports UART2_RXD]
# set_property DRIVE 4 [get_ports UART2_RXD]
# set_property PACKAGE_PIN L18 [get_ports UART2_TXD]
# set_property IOSTANDARD LVTTL [get_ports UART2_TXD]
# set_property DRIVE 4 [get_ports UART2_TXD]
#
# SD-Flash on FPGA
#
set_property PACKAGE_PIN H14 [get_ports FPGA_SD_CMD]
set_property IOSTANDARD LVTTL [get_ports FPGA_SD_CMD]
set_property DRIVE 4 [get_ports FPGA_SD_CMD]
set_property PACKAGE_PIN G15 [get_ports FPGA_SD_D0]
set_property IOSTANDARD LVTTL [get_ports FPGA_SD_D0]
set_property DRIVE 4 [get_ports FPGA_SD_D0]
# set_property PACKAGE_PIN G16 [get_ports FPGA_SD_D1]
# set_property IOSTANDARD LVTTL [get_ports FPGA_SD_D1]
# set_property DRIVE 4 [get_ports FPGA_SD_D1]
# set_property PACKAGE_PIN G13 [get_ports FPGA_SD_D2]
# set_property IOSTANDARD LVTTL [get_ports FPGA_SD_D2]
# set_property DRIVE 4 [get_ports FPGA_SD_D2]
set_property PACKAGE_PIN H13 [get_ports FPGA_SD_D3]
set_property IOSTANDARD LVTTL [get_ports FPGA_SD_D3]
set_property DRIVE 4 [get_ports FPGA_SD_D3]
set_property PACKAGE_PIN H15 [get_ports FPGA_SD_SCLK]
set_property IOSTANDARD LVTTL [get_ports FPGA_SD_SCLK]
set_property DRIVE 4 [get_ports FPGA_SD_SCLK]
# set_property PACKAGE_PIN J14 [get_ports FPGA_SD_CDET_N]
# set_property IOSTANDARD LVTTL [get_ports FPGA_SD_CDET_N]
# set_property DRIVE 4 [get_ports FPGA_SD_CDET_N]
#
# Other constraints ........................................................
#
create_clock -name {clk100} [get_ports {i_100MHz_P}] -period {10.000} -add
#eof
|
{
"pile_set_name": "Github"
}
|
Text_TextChanged on role=document
|
{
"pile_set_name": "Github"
}
|
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/default.css"/>
<link rel="stylesheet" type="text/css" href="css/mobile.css"/>
<link rel='stylesheet' href='css/jquery-ui.css'>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,maximum-scale=1.0,user-scalable=no">
<title>大数据智慧能力 - 网络能力 </title>
</head>
<body>
<div id="wrapper">
<h1>大数据智慧能力 - 网络能力 </h1>
<h2><strong>重点关注</strong><sub>Focus on the indicators</sub><b class="logoline"></b><b class="logoline1"></b><b class="logoline2"></b><b class="logoline3"></b><b class="logoline4"></b></h2>
<!--时间区-->
<div class="date-timer">
<p>
<strong id="H"></strong>
<strong>:</strong>
<strong id="M"></strong>
<strong id="S" class="hide"></strong>
</p>
<em id="D"></em>
<ul>
<li id="Y"></li>
<li id="MH"></li>
<li id="TD"></li>
</ul>
</div>
<div class="big-index-1">
<ul>
<li>
<b class="animation-1"></b><b class="animation-2"></b><b class="animation-3"></b>
<p>VLR登记用户数</p>
<strong>174.6069</strong>
</li>
<li>
<b class="animation-1"></b><b class="animation-2"></b><b class="animation-3"></b>
<p>VLR登记用户数</p>
<strong>174.6069</strong>
</li>
<li>
<b class="animation-1"></b><b class="animation-2"></b><b class="animation-3"></b>
<p>VLR登记用户数</p>
<strong>174.6069</strong>
</li>
<li>
<b class="animation-1"></b><b class="animation-2"></b><b class="animation-3"></b>
<p>VLR登记用户数</p>
<strong>174.6069</strong>
</li>
<li>
<b class="animation-1"></b><b class="animation-2"></b><b class="animation-3"></b>
<p>VLR登记用户数</p>
<strong>174.6069</strong>
</li>
<li>
<b class="animation-1"></b><b class="animation-2"></b><b class="animation-3"></b>
<p>VLR登记用户数</p>
<strong>174.6069</strong>
</li>
</ul>
</div>
<div class="submenu">
<ul>
<li><a href="#this"><b>68</b><span>无线专业<em></em></span></a> </li>
<li><a href="#this" class="active"><b>69</b><span>交换专业<em></em></span></a> </li>
<li><a href="#this"><b>70</b><span>数据专业<em></em></span></a> </li>
<li><a href="#this"><b>71</b><span>输出专业<em></em></span></a> </li>
</ul>
</div>
<div class="center-area">
<div class="pandect-area">
<h3>
<p>当前08时<sub>8 points</sub></p>
<strong>总览</strong>
<em> 11时:29.742 Erl</em>
</h3>
<span class="pandect-area-left">
<b></b>
</span>
<div class="pandect-area-center">
<img src="images/charts.png" />
</div>
<span class="pandect-area-right">
<b></b>
</span>
</div>
<div class="details1-area">
<span class="detailsl-area-left"></span>
<div class="details1-area-center">
<h3>VLR登录用户数</h3>
<dl>
<dt>上月平均值</dt>
<dd>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li class="red"></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
448875
</dd>
<dt>昨日语音网络接通率</dt>
<dd>
<ul>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
</ul>
448875
</dd>
<dt>今日语音网络接通率 </dt>
<dd>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
448875
</dd>
</dl>
<b></b>
</div>
<span class="detailsl-area-right"></span>
</div>
<div class="details2-area">
<span class="details2-area-left"></span>
<div class="details2-area-center">
<h3>A口话务量</h3>
<dl>
<dt>上月平均值</dt>
<dd>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li class="red"></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
448875
</dd>
<dt>昨日语音网络接通率</dt>
<dd>
<ul>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="yellow"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
</ul>
448875
</dd>
<dt>今日语音网络接通率 </dt>
<dd>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li class="red"></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
448875
</dd>
</dl>
<b></b>
</div>
<span class="details2-area-right"></span>
</div>
</div>
<div class="right-area">
<h3>语音网络接通率 <b></b></h3>
<div class="area-inbox-1">
<dl>
<dt>上月平均值</dt>
<dd class="font12"><span>76.525%</span><b></b></dd>
<dt class="ml-20">今日语音网络接通率</dt>
<dd class="font-red ml-20"><span>74.113%</span><b></b></dd>
<dt>今日语音网络接通率</dt>
<dd><span>68.113%</span><b></b></dd>
</dl>
<div class="round-1"></div>
<div class="round-2"></div>
<div class="round-3">30%</div>
<div class="round-4"></div>
</div>
<div class="area-inbox-2">
<ul>
<li><strong>12</strong>74.23%<b></b><em></em></li>
<li><strong>16</strong>71.19%<b></b><em></em></li>
<li><strong>18</strong>68.02%<b></b><em></em></li>
</ul>
<div class="area-text">
<b class="animation-line1"></b>
<h4>口径说明:</h4>
<p class="text_container">
<script>var s = '(当日VLR登记用户数、昨日VLR登记用户数、上月平均值当日语音网络接通率、昨日语音网络接通'; var con = $('.text_container'); var index = 0; var length = s.length; var tId = null; function start(){ con.text(''); tId=setInterval(function(){ con.append(s.charAt(index)); if(index++ === length){ clearInterval(tId); index = 0; start() } },100); } start();</script>
</p>
<b class="animation-line2"></b>
</div>
</div>
</div>
<div class="time-base-outer">
<b class="line1"></b>
<div class="time-base">
<div class="slider2"></div>
<script src="js/jquery_and_jqueryui.js"></script>
<script src="js/index.js"></script>
</div>
<b class="line2"></b>
</div>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
/*
*
* * ******************************************************************************
* * Copyright (C) 2014-2020 Dennis Sheirer
* *
* * 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/>
* * *****************************************************************************
*
*
*/
package io.github.dsheirer.gui.playlist.record;
import io.github.dsheirer.gui.playlist.Editor;
import io.github.dsheirer.record.RecorderType;
import io.github.dsheirer.record.config.RecordConfiguration;
import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.scene.control.Label;
import javafx.scene.layout.GridPane;
import org.controlsfx.control.ToggleSwitch;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* Editor for event logging configuration objects using a VBox to visually display a vertical list of boolean toggle
* switches to turn on/off event logging for a custom set of event log types.
*/
public class RecordConfigurationEditor extends Editor<RecordConfiguration>
{
private List<RecorderControl> mControls = new ArrayList<>();
public RecordConfigurationEditor(Collection<RecorderType> types)
{
for(RecorderType type: types)
{
RecorderControl control = new RecorderControl(type);
mControls.add(control);
getChildren().add(control);
}
}
@Override
public void setItem(RecordConfiguration item)
{
if(item == null)
{
item = new RecordConfiguration();
}
super.setItem(item);
for(RecorderControl control: mControls)
{
control.getToggleSwitch().setDisable(false);
control.getToggleSwitch().setSelected(item.getRecorders().contains(control.getRecorderType()));
}
modifiedProperty().set(false);
}
@Override
public void save()
{
RecordConfiguration config = getItem();
if(config == null)
{
config = new RecordConfiguration();
}
config.clearRecorders();
for(RecorderControl control: mControls)
{
if(control.getToggleSwitch().isSelected())
{
config.addRecorder(control.getRecorderType());
}
}
setItem(config);
}
@Override
public void dispose()
{
}
public class RecorderControl extends GridPane
{
private RecorderType mRecorderType;
private ToggleSwitch mToggleSwitch;
public RecorderControl(RecorderType type)
{
mRecorderType = type;
setPadding(new Insets(5,5,5,0));
setHgap(10);
GridPane.setConstraints(getToggleSwitch(), 0, 0);
getChildren().add(getToggleSwitch());
Label label = new Label(mRecorderType.getDisplayString());
GridPane.setHalignment(label, HPos.LEFT);
GridPane.setConstraints(label, 1, 0);
getChildren().add(label);
}
private ToggleSwitch getToggleSwitch()
{
if(mToggleSwitch == null)
{
mToggleSwitch = new ToggleSwitch();
mToggleSwitch.setDisable(true);
mToggleSwitch.selectedProperty().addListener((observable, oldValue, newValue) -> modifiedProperty().set(true));
}
return mToggleSwitch;
}
public RecorderType getRecorderType()
{
return mRecorderType;
}
}
}
|
{
"pile_set_name": "Github"
}
|
# Painless Linux
Boot Linux on the Switch without imx_usb_loader - Windows, Linux, Mac OS & Android
## Disclaimer
I am not reponsible in case you brick or blow up your Switch, its LCD screen or its battery. Use this at your own risks, as Linux is known to cause **battery calibration** and **RTC** desync as well as potential **damage to the LCD display**.
**You have been warned.**
## What am I booting ?
### The system
It's Arch Linux ARM (ALARM) with the GNOME desktop manager and some utilities :
* `sudo`
* chromium browser
* scripts to manage GPU clock profiles
* SSH server enabled by default
* automatic root filesystem expand to fit your SD card
The default user is `alarm`, its password is `alarm`. The root password is `root`.
### How to see and select the current GPU clock profile
The system comes with two scripts to see and select the current GPU clock profile. There are currently three profiles which can be enabled :
* `low` (`03`) : normal undockedspeed
* **(default)** `normal` (`0a`) : normal docked speed
* `high` (`0d`) : (not recommended) maximum speed, will cause power failures
The system will reset to the normal profile at each reboot.
To see the current clock profile, run the `get-gpu-clock-profile` command as root. It will list all the available profiles, with a star next to the one currently activated.
To set the current clock profile, use the `set-gpu-clock-profile` command.
### First boot
When booting for the first time, the system will expand the root partition to fill your entire SD card, and then reboot (like a Raspberry Pi). You will need to run the exploit again once the screen turns black to finalize the reboot process, like when enabling Wi-Fi.
### Good practices
When shutting down the Switch from Linux, **it doesn't actually power it off**. Press the power button for 10 seconds and reboot into Horizon before shutting down from there.
## How to use it
### Step 0 : what you'll need
* A first-gen Switch
* A way to run the exploit (the host machine) :
* A PC on Windows or Linux
* A Mac
* An Android device with Android 4.3 or newer, USB OTG support and a XHCI controller (you can't really know that before trying)
* A way to plug your Switch in the host machine :
* If using a computer, an USB A-to-C or C-to-C cable
* If using an Android device with a Micro USB port, find a Micro USB cable (often labelled "OTG") and chain it to a Type-C cable
* If using an Android device with a Type-C port, find a C-to-C cable or a C-to-A chained to a A-to-C cable
* A SD card for you Switch (of at least 8Gb)
* 128Gb cards are currently not supported by the Switch, a Linux kernel patch is required
* A way to put your Switch in RCM mode (a jig, a paperclip, a wire, a Joy-Con mod, a screwdriver, a soldering iron...)
### Step 1 : downloading things
1. Clone or download this repository ([here](https://github.com/natinusala/switch-linux/archive/master.zip))
2. Download the latest image file :
* [from mega.co.gz](https://mega.nz/#!CPBEFARA!eZ2Ylhjz6kkSt14H_tPi2xZPJ0G0-a-6fLdMR7u0qNQ)
* [from Google Drive (thanks to kevandkkim)](https://drive.google.com/file/d/1rO8XmusLBG6UnB2FfRp13_cL6t_0CsOM/view?usp=sharing)
### Step 2 : SD card preparation
Follow [this guide](https://www.raspberrypi.org/documentation/installation/installing-images/) with your SD card and the image file you downloaded.
TL;DR : on Windows use Etcher, on Linux & Mac OS use `dd`
### Step 3 : booting Linux
#### From a Windows PC
On Windows, you will first need to install the required driver :
1. Get your Switch in RCM mode and plug it into your PC
* It should appear as "APX" in Windows
2. Download and run the Zadig Driver Installer from here : https://zadig.akeo.ie/
3. In the list, choose the device "APX"
* If it's not showing up, check "List all devices" in the options
4. At the right end of the green arrow, choose "libusbK (v3.0.7.0)"
5. Click on the big "Install driver" button
Then, make sure that your Switch is plugged in your PC and in RCM mode. Open the folder of this repository (the one you downloaded and extracted) and run `windows-boot.bat` (or `windows-win32-boot.bat` on a 32bit machine). Voilà !
_Having a Win32 error 31 is normal._
#### From a Linux PC or a Mac
Install Python 3 (usually already installed). Open a terminal to install the required package : `pip3 install pyusb==1.0.0`. I let you deal with permissions issues (hint : `sudo` works on Linux).
Then, plug your switch in your PC and put it in RCM mode. You should use a blue "SS" port as these have a greater chance of success (EHCI controller doesn't work, XHCI controller works, blue ports have a greater chance of using XHCI).
Once ready, run the `linux-macos-boot.sh` script from this repository's folder. Again, I let you deal with permissions issues (if it cannot find the module `usb` it means that you have insufficient permissions). Voilà !
#### From an Android device
1. Download and install the latest release of this app : https://github.com/natinusala/switch_linux_launcher/releases/latest
2. Run it - it will tell you that some files are missing, remember the folder in the dialog, it should look like one of these :
* `/storage/emulated/0/Android/data/io.mrarm.switchlinuxlauncher.noimx/files/shofel2`
* `/sdcard/Android/data/io.mrarm.switchlinuxlauncher.noimx/files/shofel2`
4. Exit the app (if you can close the task using the multitask button it's better)
5. From the `payloads` folder of the repository, copy the `cbfs.bin` and `coreboot.rom` files to the `shofel2` folder on your Android device (the folder of the previous step)
6. Run the app again - if the dialog doesn't show up then you can go on, otherwise you did something wrong
7. (Optional) Depending on your device, you might need to enable "OTG" or "OTG Storage" in the Android settings
8. Plug your Switch in your Android device
* If the Switch is charging from your phone, you can go on
* If your phone is charging from the Switch, try to reverse the cabling so that your phone charges the Switch instead
* If nothing happens, I'm afraid your phone doesn't have OTG (or it's not enabled) - the exploit might now work
9. Put your Switch in RCM mode
10. Voilà !
## Troubleshooting
* Having a black screen despite the fact that the exploit worked ? Just shut down the Switch (10 seconds power button press) and try again, it happens sometimes.
* Wi-Fi doesn't work ? Make sure you reboot properly :
1. Plug your Switch back into your host machine
2. Using the touchscreen, open the top-right menu and click on the power button
3. Click on the `Restart` button
4. Wait for the full reboot of the console
5. Launch the exploit again so that Linux boots
## What works / what doesn't work
* **Wi-Fi** : works after a reboot
* After each cold boot, you should reboot (it will reboot to RCM) and run the exploit again to enable Wi-Fi
* **Bluetooth** : works partially
* Keyboards and mice work
* Joy-Cons, speakers and headphones don't
* **Touch screen** : works
* **Audio** : not working, even through Bluetooth headphones or speakers
* **Hardware graphics acceleration** : works
* You have to select a power profile manually at each reboot using the `switchpower` script
* **Wired Joy-Cons** : to be implemented
* **Volume buttons** : recognized but don't do anything since there is no audio device
* **Power button** : only works to halt the system with a long-press
* no graceful shutdown
* no sleep mode
* **USB** : not working
* **Dock** : to be implemented
* **Power management** : works partially
* No graceful shutdown
* No reboot to Linux, only reboot to RCM
* GPU profile has to be selected by hand
* Battery level correctly recognized
* Be careful as staying for a long time in Linux desyncs the battery calibration on Horizon and _can_ cause the console to shutdown unexpectedly (at 50%)
* **Gnome-terminal** : Tofix ! It crash use xterm instead .
## How to build it yourself
Follow the steps on fail0verflow's repository, but instead of using their fork of u-boot, use [mine](https://github.com/natinusala/switch-u-boot). If you already built everything, you will need to rebuild u-boot using my fork and _then_ rebuild coreboot.
Then, make sure that the first partition of the console's SD card is FAT32 and create a `boot` folder. Inside, put :
* `Image.gz` : the zipped Linux kernel
* `tegra210-nintendo-switch.dtb` : the DTB
* `boot.scr` : you can generate it by using the `make.sh` script in the `src` folder of this repository
Put the SD card in the console.
Then, use shofel2 to run the coreboot you recompiled, like usual. Linux should boot immediately without the need to run `imx_usb` !
_You should probably put a rootfs in mmcblk0p2._
## Credits
* kombos for the pre-built kernel and DTB
* rajkosto for TegraRcmSmash
* MCMrARM for the Switch Linux Launcher app
* Gigaa for the GPU clock speed service
* 00cancer for the initial GNOME image
* ctyler for the rootfs-resize script
* fail0verflow for shofel2 and their coreboot, u-boot & Linux port
* Everyone else who participated !
|
{
"pile_set_name": "Github"
}
|
/*-
* BSD LICENSE
*
* Copyright (c) Intel Corporation.
* 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 Intel Corporation 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.
*/
#include "spdk_cunit.h"
#include "common/lib/ut_multithread.c"
#include "unit/lib/json_mock.c"
#include "spdk_internal/thread.h"
#include "bdev/pmem/bdev_pmem.c"
DEFINE_STUB(spdk_conf_find_section, struct spdk_conf_section *,
(struct spdk_conf *cp, const char *name), NULL);
DEFINE_STUB(spdk_conf_section_get_nval, char *,
(struct spdk_conf_section *sp, const char *key, int idx), NULL);
DEFINE_STUB(spdk_conf_section_get_nmval, char *,
(struct spdk_conf_section *sp, const char *key, int idx1, int idx2), NULL);
static struct spdk_bdev_module *g_bdev_pmem_module;
static int g_bdev_module_cnt;
struct pmemblk {
const char *name;
bool is_open;
bool is_consistent;
size_t bsize;
long long nblock;
uint8_t *buffer;
};
static const char *g_bdev_name = "pmem0";
/* PMEMblkpool is a typedef of struct pmemblk */
static PMEMblkpool g_pool_ok = {
.name = "/pools/ok_pool",
.is_open = false,
.is_consistent = true,
.bsize = 4096,
.nblock = 150
};
static PMEMblkpool g_pool_nblock_0 = {
.name = "/pools/nblock_0",
.is_open = false,
.is_consistent = true,
.bsize = 4096,
.nblock = 0
};
static PMEMblkpool g_pool_bsize_0 = {
.name = "/pools/nblock_0",
.is_open = false,
.is_consistent = true,
.bsize = 0,
.nblock = 100
};
static PMEMblkpool g_pool_inconsistent = {
.name = "/pools/inconsistent",
.is_open = false,
.is_consistent = false,
.bsize = 512,
.nblock = 1
};
static int g_opened_pools;
static struct spdk_bdev *g_bdev;
static const char *g_check_version_msg;
static bool g_pmemblk_open_allow_open = true;
static PMEMblkpool *
find_pmemblk_pool(const char *path)
{
if (path == NULL) {
errno = EINVAL;
return NULL;
} else if (strcmp(g_pool_ok.name, path) == 0) {
return &g_pool_ok;
} else if (strcmp(g_pool_nblock_0.name, path) == 0) {
return &g_pool_nblock_0;
} else if (strcmp(g_pool_bsize_0.name, path) == 0) {
return &g_pool_bsize_0;
} else if (strcmp(g_pool_inconsistent.name, path) == 0) {
return &g_pool_inconsistent;
}
errno = ENOENT;
return NULL;
}
PMEMblkpool *
pmemblk_open(const char *path, size_t bsize)
{
PMEMblkpool *pool;
if (!g_pmemblk_open_allow_open) {
errno = EIO;
return NULL;
}
pool = find_pmemblk_pool(path);
if (!pool) {
errno = ENOENT;
return NULL;
}
CU_ASSERT_TRUE_FATAL(pool->is_consistent);
CU_ASSERT_FALSE(pool->is_open);
if (pool->is_open == false) {
pool->is_open = true;
g_opened_pools++;
} else {
errno = EBUSY;
pool = NULL;
}
return pool;
}
void
spdk_bdev_io_get_buf(struct spdk_bdev_io *bdev_io, spdk_bdev_io_get_buf_cb cb, uint64_t len)
{
cb(NULL, bdev_io, true);
}
static void
check_open_pool_fatal(PMEMblkpool *pool)
{
SPDK_CU_ASSERT_FATAL(pool != NULL);
SPDK_CU_ASSERT_FATAL(find_pmemblk_pool(pool->name) == pool);
SPDK_CU_ASSERT_FATAL(pool->is_open == true);
}
void
pmemblk_close(PMEMblkpool *pool)
{
check_open_pool_fatal(pool);
pool->is_open = false;
CU_ASSERT(g_opened_pools > 0);
g_opened_pools--;
}
size_t
pmemblk_bsize(PMEMblkpool *pool)
{
check_open_pool_fatal(pool);
return pool->bsize;
}
size_t
pmemblk_nblock(PMEMblkpool *pool)
{
check_open_pool_fatal(pool);
return pool->nblock;
}
int
pmemblk_read(PMEMblkpool *pool, void *buf, long long blockno)
{
check_open_pool_fatal(pool);
if (blockno >= pool->nblock) {
errno = EINVAL;
return -1;
}
memcpy(buf, &pool->buffer[blockno * pool->bsize], pool->bsize);
return 0;
}
int
pmemblk_write(PMEMblkpool *pool, const void *buf, long long blockno)
{
check_open_pool_fatal(pool);
if (blockno >= pool->nblock) {
errno = EINVAL;
return -1;
}
memcpy(&pool->buffer[blockno * pool->bsize], buf, pool->bsize);
return 0;
}
int
pmemblk_set_zero(PMEMblkpool *pool, long long blockno)
{
check_open_pool_fatal(pool);
if (blockno >= pool->nblock) {
errno = EINVAL;
return -1;
}
memset(&pool->buffer[blockno * pool->bsize], 0, pool->bsize);
return 0;
}
const char *
pmemblk_errormsg(void)
{
return strerror(errno);
}
const char *
pmemblk_check_version(unsigned major_required, unsigned minor_required)
{
return g_check_version_msg;
}
int
pmemblk_check(const char *path, size_t bsize)
{
PMEMblkpool *pool = find_pmemblk_pool(path);
if (!pool) {
errno = ENOENT;
return -1;
}
if (!pool->is_consistent) {
/* errno ? */
return 0;
}
if (bsize != 0 && pool->bsize != bsize) {
/* errno ? */
return 0;
}
return 1;
}
void
spdk_bdev_io_complete(struct spdk_bdev_io *bdev_io, enum spdk_bdev_io_status status)
{
bdev_io->internal.status = status;
}
int
spdk_bdev_register(struct spdk_bdev *bdev)
{
CU_ASSERT_PTR_NULL(g_bdev);
g_bdev = bdev;
return 0;
}
void
spdk_bdev_unregister(struct spdk_bdev *bdev, spdk_bdev_unregister_cb cb_fn, void *cb_arg)
{
}
void
spdk_bdev_module_finish_done(void)
{
}
int
spdk_bdev_notify_blockcnt_change(struct spdk_bdev *bdev, uint64_t size)
{
bdev->blockcnt = size;
return 0;
}
static void
ut_bdev_pmem_destruct(struct spdk_bdev *bdev)
{
SPDK_CU_ASSERT_FATAL(g_bdev != NULL);
CU_ASSERT_EQUAL(bdev_pmem_destruct(bdev->ctxt), 0);
g_bdev = NULL;
}
void
spdk_bdev_module_list_add(struct spdk_bdev_module *bdev_module)
{
g_bdev_pmem_module = bdev_module;
g_bdev_module_cnt++;
}
static int
bdev_submit_request(struct spdk_bdev *bdev, int16_t io_type, uint64_t offset_blocks,
uint64_t num_blocks, struct iovec *iovs, size_t iov_cnt)
{
struct spdk_bdev_io bio = { 0 };
switch (io_type) {
case SPDK_BDEV_IO_TYPE_READ:
bio.u.bdev.iovs = iovs;
bio.u.bdev.iovcnt = iov_cnt;
bio.u.bdev.offset_blocks = offset_blocks;
bio.u.bdev.num_blocks = num_blocks;
break;
case SPDK_BDEV_IO_TYPE_WRITE:
bio.u.bdev.iovs = iovs;
bio.u.bdev.iovcnt = iov_cnt;
bio.u.bdev.offset_blocks = offset_blocks;
bio.u.bdev.num_blocks = num_blocks;
break;
case SPDK_BDEV_IO_TYPE_FLUSH:
bio.u.bdev.offset_blocks = offset_blocks;
bio.u.bdev.num_blocks = num_blocks;
break;
case SPDK_BDEV_IO_TYPE_RESET:
break;
case SPDK_BDEV_IO_TYPE_UNMAP:
bio.u.bdev.offset_blocks = offset_blocks;
bio.u.bdev.num_blocks = num_blocks;
break;
case SPDK_BDEV_IO_TYPE_WRITE_ZEROES:
bio.u.bdev.offset_blocks = offset_blocks;
bio.u.bdev.num_blocks = num_blocks;
break;
default:
CU_FAIL_FATAL("BUG:Unexpected IO type");
break;
}
/*
* Set status to value that shouldn't be returned
*/
bio.type = io_type;
bio.internal.status = SPDK_BDEV_IO_STATUS_PENDING;
bio.bdev = bdev;
bdev_pmem_submit_request(NULL, &bio);
return bio.internal.status;
}
static int
ut_pmem_blk_clean(void)
{
free(g_pool_ok.buffer);
g_pool_ok.buffer = NULL;
/* Unload module to free IO channel */
g_bdev_pmem_module->module_fini();
poll_threads();
free_threads();
return 0;
}
static int
ut_pmem_blk_init(void)
{
errno = 0;
allocate_threads(1);
set_thread(0);
g_pool_ok.buffer = calloc(g_pool_ok.nblock, g_pool_ok.bsize);
if (g_pool_ok.buffer == NULL) {
ut_pmem_blk_clean();
return -1;
}
return 0;
}
static void
ut_pmem_init(void)
{
SPDK_CU_ASSERT_FATAL(g_bdev_pmem_module != NULL);
CU_ASSERT_EQUAL(g_bdev_module_cnt, 1);
/* Make pmemblk_check_version fail with provided error message */
g_check_version_msg = "TEST FAIL MESSAGE";
CU_ASSERT_NOT_EQUAL(g_bdev_pmem_module->module_init(), 0);
/* This init must success */
g_check_version_msg = NULL;
CU_ASSERT_EQUAL(g_bdev_pmem_module->module_init(), 0);
}
static void
ut_pmem_open_close(void)
{
struct spdk_bdev *bdev = NULL;
int pools_cnt;
int rc;
pools_cnt = g_opened_pools;
/* Try opening with NULL name */
rc = create_pmem_disk(NULL, NULL, &bdev);
CU_ASSERT_PTR_NULL(bdev);
CU_ASSERT_EQUAL(pools_cnt, g_opened_pools);
CU_ASSERT_NOT_EQUAL(rc, 0);
/* Open non-existent pool */
rc = create_pmem_disk("non existent pool", NULL, &bdev);
CU_ASSERT_PTR_NULL(bdev);
CU_ASSERT_EQUAL(pools_cnt, g_opened_pools);
CU_ASSERT_NOT_EQUAL(rc, 0);
/* Open inconsistent pool */
rc = create_pmem_disk(g_pool_inconsistent.name, NULL, &bdev);
CU_ASSERT_PTR_NULL(bdev);
CU_ASSERT_EQUAL(pools_cnt, g_opened_pools);
CU_ASSERT_NOT_EQUAL(rc, 0);
/* Open consistent pool fail the open from unknown reason. */
g_pmemblk_open_allow_open = false;
rc = create_pmem_disk(g_pool_inconsistent.name, NULL, &bdev);
g_pmemblk_open_allow_open = true;
CU_ASSERT_PTR_NULL(bdev);
CU_ASSERT_EQUAL(pools_cnt, g_opened_pools);
CU_ASSERT_NOT_EQUAL(rc, 0);
/* Open pool with nblocks = 0 */
rc = create_pmem_disk(g_pool_nblock_0.name, NULL, &bdev);
CU_ASSERT_PTR_NULL(bdev);
CU_ASSERT_EQUAL(pools_cnt, g_opened_pools);
CU_ASSERT_NOT_EQUAL(rc, 0);
/* Open pool with bsize = 0 */
rc = create_pmem_disk(g_pool_bsize_0.name, NULL, &bdev);
CU_ASSERT_PTR_NULL(bdev);
CU_ASSERT_EQUAL(pools_cnt, g_opened_pools);
CU_ASSERT_NOT_EQUAL(rc, 0);
/* Open pool with NULL name */
rc = create_pmem_disk(g_pool_ok.name, NULL, &bdev);
CU_ASSERT_PTR_NULL(bdev);
CU_ASSERT_EQUAL(pools_cnt, g_opened_pools);
CU_ASSERT_NOT_EQUAL(rc, 0);
/* Open good pool */
rc = create_pmem_disk(g_pool_ok.name, g_bdev_name, &bdev);
SPDK_CU_ASSERT_FATAL(bdev != NULL);
CU_ASSERT_TRUE(g_pool_ok.is_open);
CU_ASSERT_EQUAL(pools_cnt + 1, g_opened_pools);
CU_ASSERT_EQUAL(rc, 0);
/* Now remove this bdev */
ut_bdev_pmem_destruct(bdev);
CU_ASSERT_FALSE(g_pool_ok.is_open);
CU_ASSERT_EQUAL(pools_cnt, g_opened_pools);
}
static void
ut_pmem_write_read(void)
{
uint8_t *write_buf, *read_buf;
struct spdk_bdev *bdev;
int rc;
size_t unaligned_aligned_size = 100;
size_t buf_size = g_pool_ok.bsize * g_pool_ok.nblock;
size_t i;
const uint64_t nblock_offset = 10;
uint64_t offset;
size_t io_size, nblock, total_io_size, bsize;
bsize = 4096;
struct iovec iov[] = {
{ 0, 2 * bsize },
{ 0, 3 * bsize },
{ 0, 4 * bsize },
};
rc = create_pmem_disk(g_pool_ok.name, g_bdev_name, &bdev);
CU_ASSERT_EQUAL(rc, 0);
SPDK_CU_ASSERT_FATAL(g_pool_ok.nblock > 40);
write_buf = calloc(1, buf_size);
read_buf = calloc(1, buf_size);
SPDK_CU_ASSERT_FATAL(bdev != NULL);
SPDK_CU_ASSERT_FATAL(write_buf != NULL);
SPDK_CU_ASSERT_FATAL(read_buf != NULL);
total_io_size = 0;
offset = nblock_offset * g_pool_ok.bsize;
for (i = 0; i < 3; i++) {
iov[i].iov_base = &write_buf[offset + total_io_size];
total_io_size += iov[i].iov_len;
}
for (i = 0; i < total_io_size + unaligned_aligned_size; i++) {
write_buf[offset + i] = 0x42 + i;
}
SPDK_CU_ASSERT_FATAL(total_io_size < buf_size);
/*
* Write outside pool.
*/
rc = bdev_submit_request(bdev, SPDK_BDEV_IO_TYPE_WRITE, g_pool_ok.nblock, 1, &iov[0], 2);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_FAILED);
/*
* Write with insufficient IOV buffers length.
*/
rc = bdev_submit_request(bdev, SPDK_BDEV_IO_TYPE_WRITE, 0, g_pool_ok.nblock, &iov[0], 2);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_FAILED);
/*
* Try to write two IOV with first one iov_len % bsize != 0.
*/
io_size = iov[0].iov_len + iov[1].iov_len;
nblock = io_size / g_pool_ok.bsize;
iov[0].iov_len += unaligned_aligned_size;
rc = bdev_submit_request(bdev, SPDK_BDEV_IO_TYPE_WRITE, 0, nblock, &iov[0], 2);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_FAILED);
iov[0].iov_len -= unaligned_aligned_size;
/*
* Try to write one IOV.
*/
nblock = iov[0].iov_len / g_pool_ok.bsize;
rc = bdev_submit_request(bdev, SPDK_BDEV_IO_TYPE_WRITE, nblock_offset, nblock, &iov[0], 1);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_SUCCESS);
/*
* Try to write 2 IOV.
* Sum of IOV length is larger than IO size and last IOV is larger and iov_len % bsize != 0
*/
offset = iov[0].iov_len / g_pool_ok.bsize;
io_size = iov[1].iov_len + iov[2].iov_len;
nblock = io_size / g_pool_ok.bsize;
iov[2].iov_len += unaligned_aligned_size;
rc = bdev_submit_request(bdev, SPDK_BDEV_IO_TYPE_WRITE, nblock_offset + offset, nblock,
&iov[1], 2);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_SUCCESS);
iov[2].iov_len -= unaligned_aligned_size;
/*
* Examine pool state:
* 1. Written area should have expected values.
* 2. Anything else should contain zeros.
*/
offset = nblock_offset * g_pool_ok.bsize + total_io_size;
rc = memcmp(&g_pool_ok.buffer[0], write_buf, offset);
CU_ASSERT_EQUAL(rc, 0);
for (i = offset; i < buf_size; i++) {
if (g_pool_ok.buffer[i] != 0) {
CU_ASSERT_EQUAL(g_pool_ok.buffer[i], 0);
break;
}
}
/* Setup IOV for reads */
memset(read_buf, 0xAB, buf_size);
offset = nblock_offset * g_pool_ok.bsize;
for (i = 0; i < 3; i++) {
iov[i].iov_base = &read_buf[offset];
offset += iov[i].iov_len;
}
/*
* Write outside pool.
*/
rc = bdev_submit_request(bdev, SPDK_BDEV_IO_TYPE_READ, g_pool_ok.nblock, 1, &iov[0], 2);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_FAILED);
/*
* Read with insufficient IOV buffers length.
*/
rc = bdev_submit_request(bdev, SPDK_BDEV_IO_TYPE_READ, 0, g_pool_ok.nblock, &iov[0], 2);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_FAILED);
/*
* Try to read two IOV with first one iov_len % bsize != 0.
*/
io_size = iov[0].iov_len + iov[1].iov_len;
nblock = io_size / g_pool_ok.bsize;
iov[0].iov_len += unaligned_aligned_size;
rc = bdev_submit_request(bdev, SPDK_BDEV_IO_TYPE_READ, 0, nblock, &iov[0], 2);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_FAILED);
iov[0].iov_len -= unaligned_aligned_size;
/*
* Try to write one IOV.
*/
nblock = iov[0].iov_len / g_pool_ok.bsize;
rc = bdev_submit_request(bdev, SPDK_BDEV_IO_TYPE_READ, nblock_offset, nblock, &iov[0], 1);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_SUCCESS);
/*
* Try to read 2 IOV.
* Sum of IOV length is larger than IO size and last IOV is larger and iov_len % bsize != 0
*/
offset = iov[0].iov_len / g_pool_ok.bsize;
io_size = iov[1].iov_len + iov[2].iov_len;
nblock = io_size / g_pool_ok.bsize;
iov[2].iov_len += unaligned_aligned_size;
rc = bdev_submit_request(bdev, SPDK_BDEV_IO_TYPE_READ, nblock_offset + offset, nblock,
&iov[1], 2);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_SUCCESS);
iov[2].iov_len -= unaligned_aligned_size;
/*
* Examine what we read state:
* 1. Written area should have expected values.
* 2. Anything else should contain zeros.
*/
offset = nblock_offset * g_pool_ok.bsize;
for (i = 0; i < offset; i++) {
if (read_buf[i] != 0xAB) {
CU_ASSERT_EQUAL(read_buf[i], 0xAB);
break;
}
}
rc = memcmp(&read_buf[offset], &write_buf[offset], total_io_size);
CU_ASSERT_EQUAL(rc, 0);
offset += total_io_size;
for (i = offset; i < buf_size; i++) {
if (read_buf[i] != 0xAB) {
CU_ASSERT_EQUAL(read_buf[i], 0xAB);
break;
}
}
memset(g_pool_ok.buffer, 0, g_pool_ok.bsize * g_pool_ok.nblock);
free(write_buf);
free(read_buf);
/* Now remove this bdev */
ut_bdev_pmem_destruct(bdev);
CU_ASSERT_FALSE(g_pool_ok.is_open);
CU_ASSERT_EQUAL(g_opened_pools, 0);
}
static void
ut_pmem_reset(void)
{
struct spdk_bdev *bdev;
int rc;
rc = create_pmem_disk(g_pool_ok.name, g_bdev_name, &bdev);
CU_ASSERT_EQUAL(rc, 0);
SPDK_CU_ASSERT_FATAL(bdev != NULL);
rc = bdev_submit_request(bdev, SPDK_BDEV_IO_TYPE_RESET, 0, 0, NULL, 0);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_SUCCESS);
ut_bdev_pmem_destruct(bdev);
}
static void
ut_pmem_unmap_write_zero(int16_t io_type)
{
struct spdk_bdev *bdev;
size_t buff_size = g_pool_ok.nblock * g_pool_ok.bsize;
size_t i;
uint8_t *buffer;
int rc;
CU_ASSERT(io_type == SPDK_BDEV_IO_TYPE_UNMAP || io_type == SPDK_BDEV_IO_TYPE_WRITE_ZEROES);
rc = create_pmem_disk(g_pool_ok.name, g_bdev_name, &bdev);
CU_ASSERT_EQUAL(rc, 0);
SPDK_CU_ASSERT_FATAL(bdev != NULL);
SPDK_CU_ASSERT_FATAL(g_pool_ok.nblock > 40);
buffer = calloc(1, buff_size);
SPDK_CU_ASSERT_FATAL(buffer != NULL);
for (i = 10 * g_pool_ok.bsize; i < 30 * g_pool_ok.bsize; i++) {
buffer[i] = 0x30 + io_type + i;
}
memcpy(g_pool_ok.buffer, buffer, buff_size);
/*
* Block outside of pool.
*/
rc = bdev_submit_request(bdev, io_type, g_pool_ok.nblock, 1, NULL, 0);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_FAILED);
rc = memcmp(buffer, g_pool_ok.buffer, buff_size);
CU_ASSERT_EQUAL(rc, 0);
/*
* Blocks 15 to 25
*/
memset(&buffer[15 * g_pool_ok.bsize], 0, 10 * g_pool_ok.bsize);
rc = bdev_submit_request(bdev, io_type, 15, 10, NULL, 0);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_SUCCESS);
rc = memcmp(buffer, g_pool_ok.buffer, buff_size);
CU_ASSERT_EQUAL(rc, 0);
/*
* All blocks.
*/
memset(buffer, 0, buff_size);
rc = bdev_submit_request(bdev, io_type, 0, g_pool_ok.nblock, NULL, 0);
CU_ASSERT_EQUAL(rc, SPDK_BDEV_IO_STATUS_SUCCESS);
rc = memcmp(buffer, g_pool_ok.buffer, buff_size);
CU_ASSERT_EQUAL(rc, 0);
/* Now remove this bdev */
ut_bdev_pmem_destruct(bdev);
CU_ASSERT_FALSE(g_pool_ok.is_open);
CU_ASSERT_EQUAL(g_opened_pools, 0);
free(buffer);
}
static void
ut_pmem_write_zero(void)
{
ut_pmem_unmap_write_zero(SPDK_BDEV_IO_TYPE_WRITE_ZEROES);
}
static void
ut_pmem_unmap(void)
{
ut_pmem_unmap_write_zero(SPDK_BDEV_IO_TYPE_UNMAP);
}
int
main(int argc, char **argv)
{
CU_pSuite suite = NULL;
unsigned int num_failures;
CU_set_error_action(CUEA_ABORT);
CU_initialize_registry();
suite = CU_add_suite("bdev_pmem", ut_pmem_blk_init, ut_pmem_blk_clean);
CU_ADD_TEST(suite, ut_pmem_init);
CU_ADD_TEST(suite, ut_pmem_open_close);
CU_ADD_TEST(suite, ut_pmem_write_read);
CU_ADD_TEST(suite, ut_pmem_reset);
CU_ADD_TEST(suite, ut_pmem_write_zero);
CU_ADD_TEST(suite, ut_pmem_unmap);
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
num_failures = CU_get_number_of_failures();
CU_cleanup_registry();
return num_failures;
}
|
{
"pile_set_name": "Github"
}
|
/*Body*/
body {
background-image:url(bg1.gif);
background-repeat:no-repeat;
background-size:cover;
}
/* -------------------------------------------------------------------------------- */
/*Header section*/
#logo {
background-repeat:no-repeat;
}
#heading
{
font-family: Papyrus, fantasy;
font-size: 80px;
text-align: center;
color:white;
height:140px;
display:block;
}
/* -------------------------------------------------------------------------------- */
/*Text */
#intro{
display:inline;
font-family: "Times New Roman", Times, serif;
font-size: 30px;
font-style: italic;
text-align: center;
color:white;
text-align:center;
height:326px;
}
/* -------------------------------------------------------------------------------- */
/* Navigation section*/
#container{
width:250px;
}
#nav{
width:250px;
height:400px;
display:inline;
float:left;
}
a{
text-decoration:none;
color:white;
padding:20px;
padding-right:100px;
font-size:25px;
}
ul li{
list-style-type:none;
display:block;
padding: 15px
}
/* Hover effect for navigation */
ul li:hover{
background:#4097AD;
transition:linear all 0.40s;
margin-left:10px;
}
ul li a:hover{
color:black;
}
/* Shows what page you are on */
.selected{
background:white;
}
.selected a{
color:black;
}
/* -------------------------------------------------------------------------------- */
/* Form section*/
h1{
color: white;
text-align:center;
display:block;
position:absolute-center;
float:center;
}
p{
color:white;
text-align:center;
display:inline-block;
position:fixed-center;
float:right;
}
/* Inputs */
input[type=text], input[type=password]
{
width: 25%;
padding: 12px 50px;
margin: 10px auto;
display:block;
border: 1px solid #ccc;
box-sizing: border-box;
text-align:center;
position:fixed-center;
}
/* Button */
button {
background-color: red;
color: white;
padding: 14px 20px;
margin: 8px auto;
border: none;
cursor: pointer;
width: 15%;
display:block;
border-radius:90%;
position:fixed-center;
}
/* Hover effect for button */
button:hover {
opacity: 0.8;
}
/* padding for formcontainer */
.formcontainer {
padding: 26px;
}
/* -------------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------------- */
/* table */
th
{
padding:0 30px 0 10px;
color:white;
font-size:35px;
width: 25%;
margin: 10px auto;
border-style:double;
border-width: 15px;
border-color:red;
}
td
{
padding:0 30px 0 10px;
color:white;
font-size:35px;
width: 25%;
margin: 10px auto;
text-align: center;
border-style:inset;
border-width: 5px;
}
* -------------------------------------------------------------------------------- */
/* Game */
#game-base{
width:640px;
margin:0 auto;
padding-top:60px;
}
#game-table{
width:434px;
height:374px;
margin:0 auto;
border-style:double;
border-width: 15px;
border-color:red;
position:relative;
border-radius:10px;
display:block;
}
.disc{
position:absolute;
z-index:-1;
top:-55px;
left:14px;
width:46px;
height:46px;
border-radius:46px;
transition:all .3s;
}
.disc.red{
background:red;
}
.disc.yellow{
background:yellow;
}
|
{
"pile_set_name": "Github"
}
|
/*++
Copyright (c) 1998-2001 Klaus P. Gerlicher
Module Name:
shared.h
Abstract:
shared stuff between module and loader
Environment:
LINUX 2.2.X
Kernel mode only
Author:
Klaus P. Gerlicher
reactos port by:
Eugene Ingerman
Revision History:
13-Nov-1999: created
15-Nov-2000: general cleanup of source files
10/20/2001: porting to reactos begins
Copyright notice:
This file may be distributed under the terms of the GNU Public License.
--*/
//#include <ntddk.h>
//#include <winnt.h>
//temporary
#ifndef CTL_CODE
#define CTL_CODE(Dev, Func, Meth, Acc) ( ((Dev)<<16) | ((Acc)<<14) | ((Func)<<2) | (Meth))
// IOCTL Parameter buffering methods
#define METHOD_BUFFERED 0
#define METHOD_IN_DIRECT 1
#define METHOD_OUT_DIRECT 2
#define METHOD_NEITHER 3
// IOCTL File access type
#define FILE_ANY_ACCESS 0
#define FILE_READ_ACCESS 1
#define FILE_WRITE_ACCESS 2
#endif
// define custom device type
#define PICE_DEVICE_DEBUGGER 64787
#define PICE_IOCTL_LOAD CTL_CODE(PICE_DEVICE_DEBUGGER, 2049, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define PICE_IOCTL_UNLOAD CTL_CODE(PICE_DEVICE_DEBUGGER, 2050, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define PICE_IOCTL_RELOAD CTL_CODE(PICE_DEVICE_DEBUGGER, 2051, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define PICE_IOCTL_BREAK CTL_CODE(PICE_DEVICE_DEBUGGER, 2052, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define PICE_IOCTL_STATUS CTL_CODE(PICE_DEVICE_DEBUGGER, 2053, METHOD_BUFFERED, FILE_ANY_ACCESS)
typedef struct _DEBUGGER_STATUS_BLOCK
{
char filename[256];
}DEBUGGER_STATUS_BLOCK,*PDEBUGGER_STATUS_BLOCK;
#define MAGIC_ULONG( ch0, ch1, ch2, ch3 ) \
( (ULONG)(UCHAR)(ch0) | \
( (ULONG)(UCHAR)(ch1) << 8 ) | \
( (ULONG)(UCHAR)(ch2) << 16 ) | \
( (ULONG)(UCHAR)(ch3) << 24 ) )
#define PICE_MAGIC MAGIC_ULONG('P','I','C','E')
#define DEBUG_MODULE_NAME_LEN 32
typedef struct _PICE_SYMBOLFILE_HEADER
{
ULONG magic;
WCHAR name[DEBUG_MODULE_NAME_LEN];
ULONG ulOffsetToHeaders,ulSizeOfHeader;
ULONG ulOffsetToGlobals,ulSizeOfGlobals;
ULONG ulOffsetToGlobalsStrings,ulSizeOfGlobalsStrings;
ULONG ulOffsetToStabs,ulSizeOfStabs;
ULONG ulOffsetToStabsStrings,ulSizeOfStabsStrings;
ULONG ulOffsetToSrcFiles,ulNumberOfSrcFiles;
}PICE_SYMBOLFILE_HEADER;
typedef struct _STAB_ENTRY
{
unsigned long n_strx;
unsigned char n_type;
unsigned char n_other;
unsigned short n_desc;
unsigned long n_value;
}STAB_ENTRY,*PSTAB_ENTRY;
typedef struct _PICE_SYMBOLFILE_SOURCE
{
char filename[256];
ULONG ulOffsetToNext;
}PICE_SYMBOLFILE_SOURCE;
///////////////////////////////////////////////////////////////////////////////////
// serial stuff
typedef struct _SERIAL_PACKET_HEADER
{
ULONG packet_size;
ULONG packet_header_chksum;
ULONG packet_chksum;
}SERIAL_PACKET_HEADER,*PSERIAL_PACKET_HEADER;
typedef struct _SERIAL_PACKET
{
SERIAL_PACKET_HEADER header;
UCHAR data[1];
}SERIAL_PACKET,*PSERIAL_PACKET;
#define ACK (0)
typedef enum _ECOLORS
{
BLACK = 0,
BLUE,
GREEN,
TURK,
RED,
VIOLET,
BROWN,
LTGRAY,
GRAY,
LTBLUE,
LT_GREEN,
LTTURK,
LTRED,
LTVIOLET,
YELLOW,
WHITE
}ECOLORS;
typedef struct _SERIAL_DATA_PACKET
{
UCHAR type;
UCHAR data[1];
}SERIAL_DATA_PACKET,*PSERIAL_DATA_PACKET;
#define PACKET_TYPE_CLRLINE (0)
typedef struct _SERIAL_DATA_PACKET_CLRLINE
{
UCHAR type;
ECOLORS fgcol,bkcol;
UCHAR line;
}SERIAL_DATA_PACKET_CLRLINE,*PSERIAL_DATA_PACKET_CLRLINE;
#define PACKET_TYPE_PRINT (1)
typedef struct _SERIAL_DATA_PACKET_PRINT
{
UCHAR type;
UCHAR x;
UCHAR y;
ECOLORS fgcol,bkcol;
UCHAR string[1];
}SERIAL_DATA_PACKET_PRINT,*PSERIAL_DATA_PACKET_PRINT;
#define PACKET_TYPE_CONNECT (2)
typedef struct _SERIAL_DATA_PACKET_CONNECT
{
UCHAR type;
UCHAR xsize,ysize;
}SERIAL_DATA_PACKET_CONNECT,*PSERIAL_DATA_PACKET_CONNECT;
#define PACKET_TYPE_CURSOR (3)
typedef struct _SERIAL_DATA_PACKET_CURSOR
{
UCHAR type;
UCHAR state,x,y;
}SERIAL_DATA_PACKET_CURSOR,*PSERIAL_DATA_PACKET_CURSOR;
#define PACKET_TYPE_INVERTLINE (4)
typedef struct _SERIAL_DATA_PACKET_INVERTLINE
{
UCHAR type;
UCHAR line;
}SERIAL_DATA_PACKET_INVERTLINE,*PSERIAL_DATA_PACKET_INVERTLINE;
#define PACKET_TYPE_POLL (5)
typedef struct _SERIAL_DATA_PACKET_POLL
{
UCHAR type;
USHORT major_version,minor_version,build_number;
}SERIAL_DATA_PACKET_POLL,*PSERIAL_DATA_PACKET_POLL;
// END of serial stuff
///////////////////////////////////////////////////////////////////////////////////
// EOF
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
xmlns:math="http://www.w3.org/1998/Math/MathML"
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
xmlns:ooo="http://openoffice.org/2004/office"
xmlns:ooow="http://openoffice.org/2004/writer"
xmlns:oooc="http://openoffice.org/2004/calc"
xmlns:dom="http://www.w3.org/2001/xml-events"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rpt="http://openoffice.org/2005/report"
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:grddl="http://www.w3.org/2003/g/data-view#"
xmlns:officeooo="http://openoffice.org/2009/office"
xmlns:tableooo="http://openoffice.org/2009/table"
xmlns:drawooo="http://openoffice.org/2010/draw"
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
xmlns:css3t="http://www.w3.org/TR/css3-text/"
office:version="1.2"
office:mimetype="application/vnd.oasis.opendocument.text">
<office:font-face-decls>
<style:font-face style:name="Courier New" svg:font-family="'Courier New'"
style:font-adornments="Regular"
style:font-family-generic="modern"
style:font-pitch="fixed"/>
</office:font-face-decls>
<office:styles>
<style:style style:name="Standard" style:family="paragraph" style:class="text">
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.15in" fo:text-align="justify" style:justify-single-word="false"/>
</style:style>
<style:style style:name="Preformatted_20_Text" style:display-name="Preformatted Text"
style:family="paragraph"
style:parent-style-name="Standard"
style:class="html">
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" fo:text-align="start"
style:justify-single-word="false"/>
<style:text-properties style:font-name="Courier New" fo:font-size="11pt"
style:font-name-asian="Courier New"
style:font-size-asian="11pt"
style:font-name-complex="Courier New"
style:font-size-complex="11pt"/>
</style:style>
<style:style style:name="Source_20_Text" style:display-name="Source Text"
style:family="text">
<style:text-properties style:font-name="Courier New" style:font-name-asian="Courier New"
style:font-name-complex="Courier New"
fo:font-size="11pt"/>
</style:style>
<style:style style:name="List" style:family="paragraph"
style:parent-style-name="Standard"
style:class="list">
<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
<style:text-properties style:font-size-asian="12pt"/>
</style:style>
<style:style style:name="Quotations" style:family="paragraph"
style:parent-style-name="Standard"
style:class="html">
<style:paragraph-properties fo:margin-left="0.3937in" fo:margin-right="0.3937in" fo:margin-top="0in"
fo:margin-bottom="0.1965in"
fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0in"
style:auto-text-indent="false"/>
</style:style>
<style:style style:name="Table_20_Heading" style:display-name="Table Heading"
style:family="paragraph"
style:parent-style-name="Table_20_Contents"
style:class="extra">
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"
text:number-lines="false"
text:line-number="0"/>
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold"
style:font-weight-complex="bold"/>
</style:style>
<style:style style:name="Horizontal_20_Line" style:display-name="Horizontal Line"
style:family="paragraph"
style:parent-style-name="Standard"
style:class="html">
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.1965in"
style:border-line-width-bottom="0.0008in 0.0138in 0.0008in"
fo:padding="0in"
fo:border-left="none"
fo:border-right="none"
fo:border-top="none"
fo:border-bottom="0.0154in double #808080"
text:number-lines="false"
text:line-number="0"
style:join-border="false"/>
<style:text-properties fo:font-size="6pt" style:font-size-asian="6pt" style:font-size-complex="6pt"/>
</style:style>
<style:style style:name="Footnote_20_anchor" style:display-name="Footnote anchor" style:family="text"> <style:text-properties style:text-position="super 58%"/> </style:style>
<style:style style:name="TOC_Item" style:family="paragraph" style:parent-style-name="Standard">
<style:paragraph-properties>
<style:tab-stops>
<style:tab-stop style:position="6.7283in" style:type="right" style:leader-style="dotted" style:leader-text="."/>
</style:tab-stops>
</style:paragraph-properties>
</style:style>
<text:notes-configuration text:note-class="footnote" text:default-style-name="Footnote" text:citation-style-name="Footnote_20_Symbol" text:citation-body-style-name="Footnote_20_anchor" text:master-page-name="Footnote" style:num-format="a" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="page"/>
<text:notes-configuration text:note-class="endnote" text:default-style-name="Endnote" text:citation-style-name="Endnote_20_Symbol" text:citation-body-style-name="Endnote_20_anchor" text:master-page-name="Endnote" style:num-format="1" text:start-value="0"/>
</office:styles>
<office:automatic-styles> <style:style style:name="MMD-Italic" style:family="text">
<style:text-properties fo:font-style="italic" style:font-style-asian="italic"
style:font-style-complex="italic"/>
</style:style>
<style:style style:name="MMD-Bold" style:family="text">
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold"
style:font-weight-complex="bold"/>
</style:style>
<style:style style:name="MMD-Superscript" style:family="text">
<style:text-properties style:text-position="super 58%"/>
</style:style>
<style:style style:name="MMD-Subscript" style:family="text">
<style:text-properties style:text-position="sub 58%"/>
</style:style>
<style:style style:name="Strike" style:family="text">
<style:text-properties style:text-line-through-style="solid" />
</style:style>
<style:style style:name="Underline" style:family="text">
<style:text-properties style:text-underline-style="solid" style:text-underline-color="font-color"/>
</style:style>
<style:style style:name="Highlight" style:family="text">
<style:text-properties fo:background-color="#FFFF00" />
</style:style>
<style:style style:name="Comment" style:family="text">
<style:text-properties fo:color="#0000BB" />
</style:style>
<style:style style:name="MMD-Table" style:family="paragraph" style:parent-style-name="Standard">
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.05in"/>
</style:style>
<style:style style:name="MMD-Table-Center" style:family="paragraph" style:parent-style-name="MMD-Table">
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
</style:style>
<style:style style:name="MMD-Table-Right" style:family="paragraph" style:parent-style-name="MMD-Table">
<style:paragraph-properties fo:text-align="right" style:justify-single-word="false"/>
</style:style>
<style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard"
style:list-style-name="L2">
<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
</style:style>
<style:style style:name="fr1" style:family="graphic" style:parent-style-name="Frame">
<style:graphic-properties style:print-content="true" style:vertical-pos="top"
style:vertical-rel="baseline"
fo:padding="0in"
fo:border="none"
style:shadow="none"/>
</style:style>
<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"
style:list-style-name="L1"/>
<text:list-style style:name="L1">
<text:list-level-style-bullet text:level="1" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="•">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.25in" fo:margin-left="0.5in"/>
</style:list-level-properties>
</text:list-level-style-bullet>
<text:list-level-style-bullet text:level="2" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="◦">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.75in" fo:text-indent="-0.25in" fo:margin-left="0.75in"/>
</style:list-level-properties>
</text:list-level-style-bullet>
<text:list-level-style-bullet text:level="3" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="▪">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1in" fo:text-indent="-0.25in" fo:margin-left="1in"/>
</style:list-level-properties>
</text:list-level-style-bullet>
<text:list-level-style-number text:level="4" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.25in" fo:text-indent="-0.25in" fo:margin-left="1.25in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="5" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.5in" fo:text-indent="-0.25in" fo:margin-left="1.5in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="6" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.75in" fo:text-indent="-0.25in" fo:margin-left="1.75in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="7" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2in" fo:text-indent="-0.25in" fo:margin-left="2in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="8" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.25in" fo:text-indent="-0.25in" fo:margin-left="2.25in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="9" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.5in" fo:text-indent="-0.25in" fo:margin-left="2.5in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="10" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.75in" fo:text-indent="-0.25in" fo:margin-left="2.75in"/>
</style:list-level-properties>
</text:list-level-style-number>
</text:list-style>
<text:list-style style:name="L2">
<text:list-level-style-number text:level="1" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.25in" fo:margin-left="0.5in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="2" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.75in" fo:text-indent="-0.25in" fo:margin-left="0.75in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="3" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1in" fo:text-indent="-0.25in" fo:margin-left="1in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="4" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.25in" fo:text-indent="-0.25in" fo:margin-left="1.25in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="5" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.5in" fo:text-indent="-0.25in" fo:margin-left="1.5in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="6" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.75in" fo:text-indent="-0.25in" fo:margin-left="1.75in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="7" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2in" fo:text-indent="-0.25in" fo:margin-left="2in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="8" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.25in" fo:text-indent="-0.25in" fo:margin-left="2.25in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="9" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.5in" fo:text-indent="-0.25in" fo:margin-left="2.5in"/>
</style:list-level-properties>
</text:list-level-style-number>
<text:list-level-style-number text:level="10" text:style-name="Standard" style:num-suffix="." style:num-format="1">
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.75in" fo:text-indent="-0.25in" fo:margin-left="2.75in"/>
</style:list-level-properties>
</text:list-level-style-number>
</text:list-style>
</office:automatic-styles>
<office:master-styles>
<style:master-page style:name="Endnote" >
<style:header><text:h text:outline-level="2">Bibliography</text:h></style:header></style:master-page>
<style:master-page style:name="Footnote" style:page-layout-name="pm2"/>
</office:master-styles>
<office:meta>
<dc:title>Setext Headers</dc:title>
</office:meta>
<office:body>
<office:text>
<text:h text:outline-level="1"><text:bookmark text:name="foobar"/>foo bar</text:h>
<text:h text:outline-level="2"><text:bookmark text:name="foobar"/>foo <text:span text:style-name="MMD-Italic">bar</text:span></text:h>
<text:h text:outline-level="1"><text:bookmark text:name="foobar"/>foo
bar</text:h>
<text:h text:outline-level="2"><text:bookmark text:name="foobar"/>foo
bar</text:h>
<text:h text:outline-level="1"><text:bookmark text:name="foo"/>foo</text:h>
<text:p text:style-name="Standard">bar</text:p>
<text:p text:style-name="Standard">5</text:p>
<text:h text:outline-level="2"><text:bookmark text:name="foo"/>foo</text:h>
<text:p text:style-name="Standard">bar</text:p>
<text:p text:style-name="Preformatted Text">foo<text:line-break/>====<text:line-break/></text:p>
<text:p text:style-name="Horizontal_20_Line"/>
<text:p text:style-name="Horizontal_20_Line"/>
</office:text>
</office:body>
</office:document>
|
{
"pile_set_name": "Github"
}
|
/* valid adjtimex test
* by: John Stultz <john.stultz@linaro.org>
* (C) Copyright Linaro 2015
* Licensed under the GPLv2
*
* This test validates adjtimex interface with valid
* and invalid test data.
*
* Usage: valid-adjtimex
*
* To build:
* $ gcc valid-adjtimex.c -o valid-adjtimex -lrt
*
* 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.
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
#include <sys/timex.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
#include "../kselftest.h"
#define NSEC_PER_SEC 1000000000LL
#define USEC_PER_SEC 1000000LL
#define ADJ_SETOFFSET 0x0100
#include <sys/syscall.h>
static int clock_adjtime(clockid_t id, struct timex *tx)
{
return syscall(__NR_clock_adjtime, id, tx);
}
/* clear NTP time_status & time_state */
int clear_time_state(void)
{
struct timex tx;
int ret;
tx.modes = ADJ_STATUS;
tx.status = 0;
ret = adjtimex(&tx);
return ret;
}
#define NUM_FREQ_VALID 32
#define NUM_FREQ_OUTOFRANGE 4
#define NUM_FREQ_INVALID 2
long valid_freq[NUM_FREQ_VALID] = {
-499<<16,
-450<<16,
-400<<16,
-350<<16,
-300<<16,
-250<<16,
-200<<16,
-150<<16,
-100<<16,
-75<<16,
-50<<16,
-25<<16,
-10<<16,
-5<<16,
-1<<16,
-1000,
1<<16,
5<<16,
10<<16,
25<<16,
50<<16,
75<<16,
100<<16,
150<<16,
200<<16,
250<<16,
300<<16,
350<<16,
400<<16,
450<<16,
499<<16,
};
long outofrange_freq[NUM_FREQ_OUTOFRANGE] = {
-1000<<16,
-550<<16,
550<<16,
1000<<16,
};
#define LONG_MAX (~0UL>>1)
#define LONG_MIN (-LONG_MAX - 1)
long invalid_freq[NUM_FREQ_INVALID] = {
LONG_MAX,
LONG_MIN,
};
int validate_freq(void)
{
struct timex tx;
int ret, pass = 0;
int i;
clear_time_state();
memset(&tx, 0, sizeof(struct timex));
/* Set the leap second insert flag */
printf("Testing ADJ_FREQ... ");
for (i = 0; i < NUM_FREQ_VALID; i++) {
tx.modes = ADJ_FREQUENCY;
tx.freq = valid_freq[i];
ret = adjtimex(&tx);
if (ret < 0) {
printf("[FAIL]\n");
printf("Error: adjtimex(ADJ_FREQ, %ld - %ld ppm\n",
valid_freq[i], valid_freq[i]>>16);
pass = -1;
goto out;
}
tx.modes = 0;
ret = adjtimex(&tx);
if (tx.freq != valid_freq[i]) {
printf("Warning: freq value %ld not what we set it (%ld)!\n",
tx.freq, valid_freq[i]);
}
}
for (i = 0; i < NUM_FREQ_OUTOFRANGE; i++) {
tx.modes = ADJ_FREQUENCY;
tx.freq = outofrange_freq[i];
ret = adjtimex(&tx);
if (ret < 0) {
printf("[FAIL]\n");
printf("Error: adjtimex(ADJ_FREQ, %ld - %ld ppm\n",
outofrange_freq[i], outofrange_freq[i]>>16);
pass = -1;
goto out;
}
tx.modes = 0;
ret = adjtimex(&tx);
if (tx.freq == outofrange_freq[i]) {
printf("[FAIL]\n");
printf("ERROR: out of range value %ld actually set!\n",
tx.freq);
pass = -1;
goto out;
}
}
if (sizeof(long) == 8) { /* this case only applies to 64bit systems */
for (i = 0; i < NUM_FREQ_INVALID; i++) {
tx.modes = ADJ_FREQUENCY;
tx.freq = invalid_freq[i];
ret = adjtimex(&tx);
if (ret >= 0) {
printf("[FAIL]\n");
printf("Error: No failure on invalid ADJ_FREQUENCY %ld\n",
invalid_freq[i]);
pass = -1;
goto out;
}
}
}
printf("[OK]\n");
out:
/* reset freq to zero */
tx.modes = ADJ_FREQUENCY;
tx.freq = 0;
ret = adjtimex(&tx);
return pass;
}
int set_offset(long long offset, int use_nano)
{
struct timex tmx = {};
int ret;
tmx.modes = ADJ_SETOFFSET;
if (use_nano) {
tmx.modes |= ADJ_NANO;
tmx.time.tv_sec = offset / NSEC_PER_SEC;
tmx.time.tv_usec = offset % NSEC_PER_SEC;
if (offset < 0 && tmx.time.tv_usec) {
tmx.time.tv_sec -= 1;
tmx.time.tv_usec += NSEC_PER_SEC;
}
} else {
tmx.time.tv_sec = offset / USEC_PER_SEC;
tmx.time.tv_usec = offset % USEC_PER_SEC;
if (offset < 0 && tmx.time.tv_usec) {
tmx.time.tv_sec -= 1;
tmx.time.tv_usec += USEC_PER_SEC;
}
}
ret = clock_adjtime(CLOCK_REALTIME, &tmx);
if (ret < 0) {
printf("(sec: %ld usec: %ld) ", tmx.time.tv_sec, tmx.time.tv_usec);
printf("[FAIL]\n");
return -1;
}
return 0;
}
int set_bad_offset(long sec, long usec, int use_nano)
{
struct timex tmx = {};
int ret;
tmx.modes = ADJ_SETOFFSET;
if (use_nano)
tmx.modes |= ADJ_NANO;
tmx.time.tv_sec = sec;
tmx.time.tv_usec = usec;
ret = clock_adjtime(CLOCK_REALTIME, &tmx);
if (ret >= 0) {
printf("Invalid (sec: %ld usec: %ld) did not fail! ", tmx.time.tv_sec, tmx.time.tv_usec);
printf("[FAIL]\n");
return -1;
}
return 0;
}
int validate_set_offset(void)
{
printf("Testing ADJ_SETOFFSET... ");
/* Test valid values */
if (set_offset(NSEC_PER_SEC - 1, 1))
return -1;
if (set_offset(-NSEC_PER_SEC + 1, 1))
return -1;
if (set_offset(-NSEC_PER_SEC - 1, 1))
return -1;
if (set_offset(5 * NSEC_PER_SEC, 1))
return -1;
if (set_offset(-5 * NSEC_PER_SEC, 1))
return -1;
if (set_offset(5 * NSEC_PER_SEC + NSEC_PER_SEC / 2, 1))
return -1;
if (set_offset(-5 * NSEC_PER_SEC - NSEC_PER_SEC / 2, 1))
return -1;
if (set_offset(USEC_PER_SEC - 1, 0))
return -1;
if (set_offset(-USEC_PER_SEC + 1, 0))
return -1;
if (set_offset(-USEC_PER_SEC - 1, 0))
return -1;
if (set_offset(5 * USEC_PER_SEC, 0))
return -1;
if (set_offset(-5 * USEC_PER_SEC, 0))
return -1;
if (set_offset(5 * USEC_PER_SEC + USEC_PER_SEC / 2, 0))
return -1;
if (set_offset(-5 * USEC_PER_SEC - USEC_PER_SEC / 2, 0))
return -1;
/* Test invalid values */
if (set_bad_offset(0, -1, 1))
return -1;
if (set_bad_offset(0, -1, 0))
return -1;
if (set_bad_offset(0, 2 * NSEC_PER_SEC, 1))
return -1;
if (set_bad_offset(0, 2 * USEC_PER_SEC, 0))
return -1;
if (set_bad_offset(0, NSEC_PER_SEC, 1))
return -1;
if (set_bad_offset(0, USEC_PER_SEC, 0))
return -1;
if (set_bad_offset(0, -NSEC_PER_SEC, 1))
return -1;
if (set_bad_offset(0, -USEC_PER_SEC, 0))
return -1;
printf("[OK]\n");
return 0;
}
int main(int argc, char **argv)
{
if (validate_freq())
return ksft_exit_fail();
if (validate_set_offset())
return ksft_exit_fail();
return ksft_exit_pass();
}
|
{
"pile_set_name": "Github"
}
|
/*!
* jQuery UI Effects Scale 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/scale-effect/
*/
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define([
"jquery",
"./effect",
"./effect-size"
], factory );
} else {
// Browser globals
factory( jQuery );
}
}(function( $ ) {
return $.effects.effect.scale = function( o, done ) {
// Create element
var el = $( this ),
options = $.extend( true, {}, o ),
mode = $.effects.setMode( el, o.mode || "effect" ),
percent = parseInt( o.percent, 10 ) ||
( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
direction = o.direction || "both",
origin = o.origin,
original = {
height: el.height(),
width: el.width(),
outerHeight: el.outerHeight(),
outerWidth: el.outerWidth()
},
factor = {
y: direction !== "horizontal" ? (percent / 100) : 1,
x: direction !== "vertical" ? (percent / 100) : 1
};
// We are going to pass this effect to the size effect:
options.effect = "size";
options.queue = false;
options.complete = done;
// Set default origin and restore for show/hide
if ( mode !== "effect" ) {
options.origin = origin || [ "middle", "center" ];
options.restore = true;
}
options.from = o.from || ( mode === "show" ? {
height: 0,
width: 0,
outerHeight: 0,
outerWidth: 0
} : original );
options.to = {
height: original.height * factor.y,
width: original.width * factor.x,
outerHeight: original.outerHeight * factor.y,
outerWidth: original.outerWidth * factor.x
};
// Fade option to support puff
if ( options.fade ) {
if ( mode === "show" ) {
options.from.opacity = 0;
options.to.opacity = 1;
}
if ( mode === "hide" ) {
options.from.opacity = 1;
options.to.opacity = 0;
}
}
// Animate
el.effect( options );
};
}));
|
{
"pile_set_name": "Github"
}
|
import "compat2.bond"
namespace unittest.compat
enum EnumType1
{
EnumValue1 = 5,
EnumValue2 = 10,
EnumValue3 = -10,
};
enum EnumType2
{
EnumValue1,
EnumValue2 = 3,
EnumValue3 = -3,
EnumValue4,
EnumValue5,
EnumValue6 = 100
};
struct BasicTypesUninitialized
{
10: bool m_bool;
12: int8 m_int8;
23: int16 m_int16;
34: int32 m_int32;
45: int64 m_int64;
56: uint8 m_uint8;
67: uint16 m_uint16;
78: uint32 m_uint32;
89: uint64 m_uint64;
99: double m_double;
100: float m_float;
101: string m_string;
102: wstring m_wstring;
};
struct BasicTypes : unittest.compat.another.Another
{
[foo("bar")]
0: bool m_bool = true;
2: string m_str = "foo";
3: wstring m_wstr = L"bar";
14: int8 m_int8 = -14;
15: int16 m_int16 = nothing;
16: required int32 m_int32 = -16;
17: optional int64 m_int64 = -17;
13: required_optional uint8 m_uint8 = 13;
11: uint16 m_uint16 = 11;
12: uint32 m_uint32 = 12;
10: uint64 m_uint64 = 10;
18: double m_double = 18;
20: float m_float = 20;
21: EnumType1 m_enum1 = EnumValue3;
22: unittest.compat.another.EnumType m_enum2 = EnumValue1;
23: unittest.compat.another.EnumType m_enum3 = nothing;
};
struct Containers
{
0: list<bool> l_bool;
1: list<string> l_str;
2: list<int8> l_int8;
3: list<int16> l_int16;
4: list<int32> l_int32;
5: list<int64> l_int64;
6: list<uint8> l_uint8;
7: list<uint16> l_uint16;
8: list<uint32> l_uint32;
9: list<uint64> l_uint64;
10: list<double> l_double;
11: list<float> l_float;
12: list<EnumType1> l_enum1;
13: list<BasicTypes> l_basic;
14: list<unittest.compat.another.EnumType> l_another_enum;
15: list<unittest.compat.another.Another> l_another_struct;
20: set<bool> s_bool;
21: set<string> s_str;
22: set<int8> s_int8;
23: set<int16> s_int16;
24: set<int32> s_int32;
25: set<int64> s_int64 = nothing;
26: set<uint8> s_uint8;
27: set<uint16> s_uint16;
28: set<uint32> s_uint32;
29: set<uint64> s_uint64;
30: set<double> s_double;
31: set<float> s_float;
32: set<EnumType1> s_enum1;
40: map<string, bool> m_bool;
41: map<string, string> m_str;
42: map<string, int8> m_int8;
43: map<string, int16> m_int16;
44: map<string, int32> m_int32;
45: map<string, int64> m_int64;
46: map<string, uint8> m_uint8 = nothing;
47: map<string, uint16> m_uint16;
48: map<string, uint32> m_uint32;
49: map<string, uint64> m_uint64;
50: map<string, double> m_double;
51: map<string, float> m_float;
52: map<string, EnumType1> m_enum1;
60: map<bool, double> n_bool;
61: map<string, double> n_str;
62: map<int8, double> n_int8;
63: map<int16, double> n_int16;
64: map<int32, double> n_int32;
65: map<int64, double> n_int64;
66: map<uint8, double> n_uint8;
67: map<uint16, double> n_uint16;
68: map<uint32, double> n_uint32;
69: map<uint64, double> n_uint64;
70: map<double, double> n_double;
71: map<float, double> n_float;
72: map<EnumType1, double> n_enum1;
73: map<EnumType1, BasicTypes> n_basic;
80: list<vector<uint64>> lv_uint64;
81: vector<set<uint64>> vs_uint64;
82: vector<map<string, set<uint64>>> vm_uint64 = nothing;
[bar("foo")]
[qux("baz")]
83: map<int8, map<uint8, list<float>>> mml_float;
90: blob m_blob;
91: list<blob> l_blob;
92: map<string, blob> n_blob;
};
struct WithBase : BasicTypes
{
};
|
{
"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 v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// GroupName is the group name use in this package
const GroupName = "networking.k8s.io"
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
localSchemeBuilder = &SchemeBuilder
AddToScheme = localSchemeBuilder.AddToScheme
)
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&NetworkPolicy{},
&NetworkPolicyList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright 2015, GeoSolutions Sas.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
var React = require('react');
var ReactDOM = require('react-dom');
var ReactTestUtils = require('react-dom/test-utils');
var FeatureInfoFormat = require('../FeatureInfoFormat');
var expect = require('expect');
describe('test Layer Properties FeatureInfoFormat module component', () => {
beforeEach((done) => {
document.body.innerHTML = '<div id="container"></div>';
setTimeout(done);
});
afterEach((done) => {
ReactDOM.unmountComponentAtNode(document.getElementById("container"));
document.body.innerHTML = '';
setTimeout(done);
});
it('tests FeatureInfoFormat component', () => {
const l = {
name: 'layer00',
title: 'Layer',
visibility: true,
storeIndex: 9,
type: 'shapefile',
url: 'fakeurl'
};
const label = "label";
// wrap in a stateful component, stateless components render return null
// see: https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
const comp = ReactDOM.render(<FeatureInfoFormat element={l} label={label}/>, document.getElementById("container"));
expect(comp).toExist();
const span = ReactTestUtils.scryRenderedDOMComponentsWithTag( comp, "span" );
expect(span).toExist();
expect(span.length).toBe(0);
});
it('tests FeatureInfoFormat component for wms', () => {
const l = {
name: 'layer00',
title: 'Layer',
visibility: true,
storeIndex: 9,
type: 'wms',
url: 'fakeurl',
featureInfo: {
format: 'JSON'
}
};
const label = "label";
const handlers = {
onChange() {}
};
let spy = expect.spyOn(handlers, "onChange");
// wrap in a stateful component, stateless components render return null
// see: https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
const comp = ReactDOM.render(<FeatureInfoFormat element={l} label={label} onChange={handlers.onChange}/>, document.getElementById("container"));
expect(comp).toExist();
const span = ReactTestUtils.scryRenderedDOMComponentsWithTag( comp, "span" );
expect(span).toExist();
expect(span.length).toBe(2);
span[1].click();
const li = ReactTestUtils.scryRenderedDOMComponentsWithTag( comp, "li" );
expect(li).toExist();
li[0].click();
expect(spy.calls.length).toBe(1);
});
it('tests FeatureInfoFormat component for wms using generalInfoFormat', () => {
const l = {
name: 'layer00',
title: 'Layer',
visibility: true,
storeIndex: 9,
type: 'wms',
url: 'fakeurl'
};
const generalInfoFormat = "text/html";
const label = "label";
const comp = ReactDOM.render(<FeatureInfoFormat element={l} label={label} generalInfoFormat={generalInfoFormat} onChange={() => {}}/>, document.getElementById("container"));
expect(comp).toExist();
const div = ReactTestUtils.scryRenderedDOMComponentsWithTag( comp, "div" );
expect(div[2]).toExist();
expect(div[2].textContent).toBe("HTML");
});
});
|
{
"pile_set_name": "Github"
}
|
package emissary.kff;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A java port of the ssdeep code for "fuzzy hashing". http://ssdeep.sourceforge.net There are a number of ports out
* there that all look basically the same. This one is from
* https://opensourceprojects.eu/p/triplecheck/code/23/tree/tool/src/ssdeep/
*
* A new ssdeep hash gets calculated and saved at each level of unwrapping.
*/
public final class Ssdeep {
private static final Logger logger = LoggerFactory.getLogger(Ssdeep.class);
private static final int SPAMSUM_LENGTH = 64;
private static final int MIN_BLOCKSIZE = 3;
public final int FUZZY_MAX_RESULT = (SPAMSUM_LENGTH + (SPAMSUM_LENGTH / 2 + 20));
/** The window size for the rolling hash. */
private static final int ROLLING_WINDOW_SIZE = 7;
/** The buffer size to use when reading data from a file. */
private static final int BUFFER_SIZE = 8192;
/** FNV hash initial value, 32-bit unsigned. */
private static final long HASH_INIT = 0x28021967;
/** FNV hash prime multiplier, 32-bit unsigned. */
private static final long HASH_PRIME = 0x01000193;
/** Used to mask long values to 32 bits unsigned. */
private static final long MASK32 = 0xffffffffL;
/**
* Base64 encoding table. Given a 5-bit value {@code n}, position {@code n} in the array is the code point (expressed as
* a byte) that should appear.
*/
private static final byte[] b64Table = SpamSumSignature.GetBytes("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
/**
* Get the base64 encoding of the low 6 bits of the given value.
*
* @param v The value to encode.
* @return The base64 encoding of the low 6 bits of {@code v}. The returned value is a code point expressed as a byte.
*/
private static byte b64EncodeLowBits(final long v) {
return b64Table[((int) v) & 0x3f];
}
private static final class SsContext {
/** A buffer for the main hash output. */
private final byte[] fuzzHash1 = new byte[SPAMSUM_LENGTH + 1];
/** A buffer for the secondary hash output. */
private final byte[] fuzzHash2 = new byte[SPAMSUM_LENGTH / 2 + 1];
/** The count of output bytes currently stored in {@link #fuzzHash1}, initially zero. */
private int fuzzLen1;
/** The count of output bytes currently stored in {@link #fuzzHash2}, initially zero. */
private int fuzzLen2;
private long sumHash1; // Initially zero.
private long sumHash2; // Initially zero.
private long blockSize; // Initialized by constructor.
/**
* Estimate the block size to use.
*
* @param expectedInputLength The expected amount of data to be processed, in bytes. A 0 value can be used if the length
* is unknown, in which case a default block size is returned.
* @return The estimated block size to use.
*/
private static long estimateBlockSize(final long expectedInputLength) {
long blockSize = MIN_BLOCKSIZE;
while ((blockSize * SPAMSUM_LENGTH) < expectedInputLength) {
blockSize *= 2;
}
return blockSize;
}
/**
* Construct a spam sum context to process a file.
*
* @param f The file that will be processed, if known. If non-{@code null}, the length of the file is used to guess the
* hash block size to use.
*/
public SsContext(final File f) {
final long expectedInputLength = (f != null) ? f.length() : 0;
this.blockSize = estimateBlockSize(expectedInputLength);
}
/**
* Construct a spam sum context to process a byte array.
*
* @param data The bytes that will be processed, if known. If non-{@code null}, the length of the array is used to guess
* the hash block size to use.
*/
public SsContext(final byte[] data) {
final long expectedInputLength = (data != null) ? data.length : 0;
this.blockSize = estimateBlockSize(expectedInputLength);
}
/**
* A simple non-rolling hash, based on the FNV hash
*
* @param b The next byte value, assumed to be in the range 0..255.
* @param h The existing hash value, 32-bit unsigned.
* @return The updated hash value, 32-bit unsigned.
*/
private static long updateSumHash(final int b, final long h) {
return ((h * HASH_PRIME) ^ b) & MASK32;
}
/**
* Apply some bytes to a SpamSum context.
*
* @param rollState The rolling hash state to use.
* @param buffer A buffer containing the input bytes.
* @param start The starting offset in {@code buffer}, inclusive.
* @param end The ending offset in {@code buffer}, exclusive.
*/
private void applyBytes(final RollingState rollState, final byte[] buffer, final int start, final int end) {
// At each byte we update the rolling hash and the normal
// hash. When the rolling hash hits the reset value, we
// emit the normal hash as an element of the signature and
// reset both hashes.
for (int i = start; i < end; i++) {
// Get the next input byte and normalize to 0..255.
final int nextByte = ((int) buffer[i]) & 0xff;
// Apply the next byte to the hashes.
this.sumHash1 = updateSumHash(nextByte, this.sumHash1);
this.sumHash2 = updateSumHash(nextByte, this.sumHash2);
final long rollingHash = rollState.roll(nextByte);
if ((rollingHash % this.blockSize) == (this.blockSize - 1)) {
// We have hit a reset point. We now emit a hash
// which is based on all bytes in the input
// between the last reset point and this one.
if (this.fuzzLen1 < (SPAMSUM_LENGTH - 1)) {
// We can have a problem with the tail
// overflowing. The easiest way to cope with
// this is to only reset the second hash if we
// have room for more characters in our
// signature. This has the effect of combining
// the last few pieces of the message into a
// single piece
this.fuzzHash1[this.fuzzLen1++] = b64EncodeLowBits(this.sumHash1);
this.sumHash1 = HASH_INIT;
}
// This produces a second signature with a block size
// of blockSize*2. By producing dual signatures in
// this way the effect of small changes in the message
// size near a block size boundary is greatly reduced.
//
// NOTE: we only have to check this when the main
// signature has hit a reset point, because
// mathematically:
//
// [ h === -1 (mod 2*bs) ] --implies--> [ h === -1 (mod bs) ]
//
// In other words, if this condition is true then the
// main signature condition must always also be true.
// Therefore this secondary signature condition can
// only potentially be true if the main signature
// condition (which we've already checked) is true.
if ((rollingHash % (this.blockSize * 2)) == ((this.blockSize * 2) - 1)) {
if (this.fuzzLen2 < (SPAMSUM_LENGTH / 2 - 1)) {
this.fuzzHash2[this.fuzzLen2++] = b64EncodeLowBits(this.sumHash2);
this.sumHash2 = HASH_INIT;
}
}
}
}
}
/**
* Discard any existing hash state and prepare to compute a new hash. This should be followed by calls to
* {@link #applyBytes(RollingState, byte[], int, int)} to provide the data, and then
* {@link #finishHashing(RollingState)} to complete the computations.
*/
private void beginHashing() {
this.fuzzLen1 = 0;
this.fuzzLen2 = 0;
this.sumHash1 = HASH_INIT;
this.sumHash2 = HASH_INIT;
}
/**
* Truncate an array if larger than the given length.
*
* @param input The input array.
* @param maxLength The desired maximum array length.
* @return If {@code input} is no larger than {@code maxLength}, this just returns {@code input}. Otherwise this returns
* a new array with the same content as {@code input} but with the length truncated to {@code maxLength}.
*/
private static byte[] truncateArray(final byte[] input, final int maxLength) {
if (input.length == maxLength) {
return input;
} else {
return Arrays.copyOf(input, maxLength);
}
}
/**
* Finish hashing and generate the final signature. This should be done after all bytes have been applied with
* {@link #applyBytes(RollingState, byte[], int, int)}.
*
* @param rollState The rolling hash state used during hashing.
* @return The final signature.
*/
private SpamSumSignature finishHashing(final RollingState rollState) {
if (rollState.getHash() != 0) {
this.fuzzHash1[this.fuzzLen1++] = b64EncodeLowBits(this.sumHash1);
this.fuzzHash2[this.fuzzLen2++] = b64EncodeLowBits(this.sumHash2);
}
final byte[] finalHash1 = truncateArray(this.fuzzHash1, this.fuzzLen1);
final byte[] finalHash2 = truncateArray(this.fuzzHash2, this.fuzzLen2);
return new SpamSumSignature(this.blockSize, finalHash1, finalHash2);
}
/**
* Generate the hash for some input.
*
* <p>
* The computations will use the current block size from the context, but any other existing hash state will be
* discarded.
*
* @param data The bytes to hash.
* @return The signature for the given data.
*/
public SpamSumSignature generateHash(final byte[] data) {
beginHashing();
final RollingState rollState = new RollingState();
if (data != null) {
applyBytes(rollState, data, 0, data.length);
}
return finishHashing(rollState);
}
/**
* Generate the hash for some input.
*
* <p>
* The computations will use the current block size from the context, but any other existing hash state will be
* discarded.
*
* @param stream A file containing the bytes to hash. Assumed non-{@code null}. The processing will start reading at the
* current file position and hash all of the data from there to the end of the file. The file position when this
* returns is unspecified. The file is not closed by this operation.
* @return The signature for the given stream content.
* @throws IOException If there is some I/O problem while reading the stream.
*/
public SpamSumSignature generateHash(final RandomAccessFile stream) throws IOException {
beginHashing();
final RollingState rollState = new RollingState();
final byte[] buffer = new byte[BUFFER_SIZE];
while (true) {
final int bytesRead = stream.read(buffer, 0, buffer.length);
if (bytesRead <= 0) {
break; // No more input.
}
applyBytes(rollState, buffer, 0, bytesRead);
}
return finishHashing(rollState);
}
}
/**
* A rolling hash, based on the Adler checksum. By using a rolling hash we can perform auto resynchronisation after
* inserts/deletes.
*/
private static final class RollingState {
/** Rolling window. Each value is in the range 0..255. Initially all 0. */
private final int[] window = new int[ROLLING_WINDOW_SIZE];
/** An index into {@link #window}. Initially 0. */
private int windowPosition;
/** The sum of the values in {@link #window}. Initially 0. */
private long h1;
/**
* The original documentation says this is the sum of the bytes times the index, but I'm not sure about that. 32-bit
* unsigned, initially 0.
*/
private long h2;
/**
* A shift/xor based rolling hash, mostly needed to ensure that we can cope with large blocksize values. 32-bit
* unsigned, initially 0.
*/
private long h3;
/**
* Construct a new rolling hash state.
*/
public RollingState() {}
/**
* Get the current hash value.
*
* @return The current 32-bit unsigned hash value.
*/
public long getHash() {
return (this.h1 + this.h2 + this.h3) & MASK32;
}
/**
* Update the rolling hash state with another input byte.
*
* @param b The byte value to apply. Assumed to be in the range 0..255.
* @return The state is updated and the resulting unsigned 32-bit hash value is returned.
*/
public long roll(final int b) {
this.h2 = (this.h2 - this.h1 + (ROLLING_WINDOW_SIZE * b)) & MASK32;
this.h1 = (this.h1 + b - this.window[this.windowPosition]) & MASK32;
this.window[this.windowPosition] = b;
// Advance the window position, wrappping around at the end.
if (this.windowPosition == (ROLLING_WINDOW_SIZE - 1)) {
this.windowPosition = 0;
} else {
this.windowPosition++;
}
this.h3 = ((this.h3 << 5) & MASK32) ^ b;
return (this.h1 + this.h2 + this.h3) & MASK32;
}
}
public Ssdeep() {}
/**
* Calculate the SpamSum hash for a byte array.
*
* @param data The bytes to be hashed.
* @return The SpamSum signature for the bytes.
*/
public String fuzzy_hash(final byte[] data) {
final SsContext ctx = new SsContext(data);
while (true) {
final SpamSumSignature signature = ctx.generateHash(data);
// Our blocksize guess may have been way off, repeat with
// a smaller block size if necessary.
if ((ctx.blockSize > MIN_BLOCKSIZE) && (ctx.fuzzLen1 < (SPAMSUM_LENGTH / 2))) {
ctx.blockSize = ctx.blockSize / 2;
} else {
return signature.toString();
}
}
}
/**
* Calculates the SpamSum hash for specified stream.
*
* @param file The input file to be hashed.
* @return The SpamSum signature for the file.
* @throws IOException If there is some I/O problem accessing the file.
*/
public String fuzzy_hash_file(final File file) throws IOException {
final RandomAccessFile stream = new RandomAccessFile(file, "r");
try {
final SsContext ctx = new SsContext(file);
while (true) {
stream.seek(0);
final SpamSumSignature signature = ctx.generateHash(stream);
// Our blocksize guess may have been way off, repeat with
// a smaller block size if necessary.
if ((ctx.blockSize > MIN_BLOCKSIZE) && (ctx.fuzzLen1 < (SPAMSUM_LENGTH / 2))) {
ctx.blockSize = ctx.blockSize / 2;
} else {
return signature.toString();
}
}
} finally {
stream.close();
}
}
/**
* Calculates the SpamSum hash for specified file.
*
* @param fileName The path to the file to be hashed.
* @return The SpamSum signature for the file.
* @throws IOException If there is some I/O problem accessing the file.
*/
public String fuzzy_hash_file(final String fileName) throws IOException {
return this.fuzzy_hash_file(new File(fileName));
}
/**
* Search an array for a subsequence of another array.
*
* @param haystack The array to search.
* @param needle The array containing the sequence to search for.
* @param needleStart The starting offset of the sequence to search for, inclusive. Assumed to be in range for
* {@code needle}.
* @param length The length of the sequence to search for. Assumed to be in range for {@code needle}. Assumed greater
* than zero.
* @return If the subsequence of {@code needle} is present in {@code haystack}, this returns the least offset where the
* subsequence occurs. Otherwise -1.
*/
private static int indexOfSubSequence(final byte[] haystack, final byte[] needle, final int needleStart, final int length) {
final int lastCandidatePos = haystack.length - length;
final byte firstNeedleByte = needle[needleStart];
NEXT_CANDIDATE: for (int candidatePos = 0; candidatePos <= lastCandidatePos; candidatePos++) {
if (haystack[candidatePos] == firstNeedleByte) {
// The first needle byte matches at this candidate
// position, so look for the rest of the needle
// following it.
for (int needlePos = 1; needlePos < length; needlePos++) {
if (haystack[candidatePos + needlePos] != needle[needleStart + needlePos]) {
continue NEXT_CANDIDATE; // Needle mismatch.
}
}
// If we reach here, the entire needle subsequence
// matched in the haystack at the candidate position.
return candidatePos;
}
}
return -1;
}
/**
* Search two arrays for a common subsequence of the given length.
*
* @param s1 The first byte array for comparison.
* @param s2 The second byte array for comparison.
* @param length The substring length to look for. Assumed greater than zero.
* @return {@code true} iff {@code s1} and {@code s2} have at least one byte sequence of length {@code length} in common
* at arbitrary offsets.
*/
private static boolean hasCommonSequence(final byte[] s1, final byte[] s2, final int length) {
if ((s1.length < length) || (s2.length < length)) {
return false; // The strings are not large enough.
}
// This is just a brute-force approach. We move a window of
// the specified length through s1 and check whether it exists
// anywhere in s2.
final int lastS1Pos = s1.length - length;
for (int s1Pos = 0; s1Pos <= lastS1Pos; s1Pos++) {
final int s2Pos = indexOfSubSequence(s2, s1, s1Pos, length);
if (s2Pos != -1) {
if (logger.isDebugEnabled()) {
logger.debug("found common sequence " + new String(s1, s1Pos, length) + " in " + new String(s1) + " at " + s1Pos + " and "
+ new String(s2) + " at " + s2Pos);
}
return true;
}
}
return false;
}
/**
* Truncate sequences of longer than 3 identical bytes. These sequences contain very little information so they tend to
* just bias the result unfairly.
*
* @param in The input bytes.
* @return An array containing the same content as {@code in}, except that any sequences of more than 3 identical bytes
* are truncated to 3 bytes. For example "aaabbbbcddddd" becomes "aaabbbcddd".
*/
private static byte[] eliminateLongSequences(final byte[] in) {
if (in.length < 4) {
return in; // There is not enough input to require any change.
}
// We just need to initialize prev to something other than in[0].
byte prev = (in[0] != 0) ? 0 : (byte) 1;
int repeatCount = 0;
// Scan the input looking for the index of the first byte that
// will need to be removed.
int inPos = 0;
while (true) {
if (inPos == in.length) {
// We didn't find anything that needed to be removed.
return in;
} else if (in[inPos] == prev) {
// This is a repeat of the previous byte.
repeatCount++;
if (repeatCount == 3) {
break; // inPos needs to be removed.
}
} else {
// This is not a repeat of the previous byte.
prev = in[inPos];
repeatCount = 0;
}
inPos++;
}
// At this point inPos is the first index that needs to be
// removed, prev is set to its byte value, and repeatCount is
// set to 3. Start an output array and copy everything up to
// but not including inPos.
final byte[] out = new byte[in.length - 1];
System.arraycopy(in, 0, out, 0, inPos);
int outPos = inPos;
// Continue scanning and copying to output.
while (++inPos < in.length) {
if (in[inPos] == prev) {
repeatCount++;
} else {
prev = in[inPos];
repeatCount = 0;
}
if (repeatCount < 3) {
out[outPos++] = in[inPos];
}
}
return (outPos == out.length) ? out : Arrays.copyOf(out, outPos);
}
/**
* This is the low level string scoring algorithm. It takes two strings and scores them on a scale of 0-100 where 0 is a
* terrible match and 100 is a great match. The blockSize is used to cope with very small messages.
*/
private static long scoreStrings(final byte[] s1, final byte[] s2, final long blockSize) {
final int len1 = s1.length;
final int len2 = s2.length;
if ((len1 > SPAMSUM_LENGTH) || (len2 > SPAMSUM_LENGTH)) {
// not a real spamsum signature?
return 0;
}
// The two strings must have a common substring of length
// ROLLING_WINDOW_SIZE to be candidates.
if (!hasCommonSequence(s1, s2, ROLLING_WINDOW_SIZE)) {
if (logger.isDebugEnabled()) {
logger.debug("no common substring for '" + new String(s1) + "' and '" + new String(s2) + "'");
}
return 0;
}
// Compute the edit distance between the two strings. The edit
// distance gives us a pretty good idea of how closely related
// the two strings are.
long score = EditDistance.edit_distn(s1, len1, s2, len2);
if (logger.isDebugEnabled()) {
logger.debug("edit_dist: " + score);
}
// Scale the edit distance by the lengths of the two
// strings. This changes the score to be a measure of the
// proportion of the message that has changed rather than an
// absolute quantity. It also copes with the variability of
// the string lengths.
score = (score * SPAMSUM_LENGTH) / (len1 + len2);
// At this stage the score occurs roughly on a 0-64 scale,
// with 0 being a good match and 64 being a complete mismatch.
// Rescale to a 0-100 scale (friendlier to humans).
score = (100 * score) / 64;
// It is possible to get a score above 100 here, but it is a
// really terrible match.
if (score >= 100) {
return 0;
}
// Now re-scale on a 0-100 scale with 0 being a poor match and
// 100 being a excellent match.
score = 100 - score;
// When the blocksize is small we don't want to exaggerate the
// match size.
if (score > (blockSize / MIN_BLOCKSIZE * Math.min(len1, len2))) {
score = blockSize / MIN_BLOCKSIZE * Math.min(len1, len2);
}
return score;
}
/**
* Given two spamsum signature return a value indicating the degree to which they match.
*
* @param signature1 The first signature.
* @param signature2 The second signature.
* @return The score for the two signatures. The value is in the range 0..100, where 0 is a terrible match and 100 is a
* great match.
*/
public int Compare(final SpamSumSignature signature1, final SpamSumSignature signature2) {
if ((null == signature1) || (null == signature2)) {
return -1;
}
final long blockSize1 = signature1.getBlockSize();
final long blockSize2 = signature2.getBlockSize();
// We require the block sizes to either be equal, or for one
// to be twice the other. If the blocksizes don't match then
// we are comparing apples to oranges. This isn't an 'error'
// per se. We could have two valid signatures, but they can't
// be compared.
if ((blockSize1 != blockSize2) && (blockSize1 != (blockSize2 * 2)) && (blockSize2 != (blockSize1 * 2))) {
if (logger.isDebugEnabled()) {
logger.debug("block sizes too different: " + blockSize1 + " " + blockSize2);
}
return 0;
}
// There is very little information content is sequences of
// the same character like 'LLLLL'. Eliminate any sequences
// longer than 3. This is especially important when combined
// with the hasCommonSequence() test.
final byte[] s1First = eliminateLongSequences(signature1.getHashPart1());
final byte[] s1Second = eliminateLongSequences(signature1.getHashPart2());
final byte[] s2First = eliminateLongSequences(signature2.getHashPart1());
final byte[] s2Second = eliminateLongSequences(signature2.getHashPart2());
// Each signature has a string for two block sizes. We now
// choose how to combine the two block sizes. We checked above
// that they have at least one block size in common.
final long score;
if (blockSize1 == blockSize2) {
// The signature block sizes are equal.
final long score1 = scoreStrings(s1First, s2First, blockSize1);
final long score2 = scoreStrings(s1Second, s2Second, blockSize2);
score = Math.max(score1, score2);
} else if (blockSize1 == (blockSize2 * 2)) {
// The first signature has twice the block size of the second.
score = scoreStrings(s1First, s2Second, blockSize1);
} else {
// The second signature has twice the block size of the first.
score = scoreStrings(s1Second, s2First, blockSize2);
}
return (int) score;
}
public static void main(final String[] args) throws Exception {
final Ssdeep ss = new Ssdeep();
for (final String f : args) {
final FileInputStream is = new FileInputStream(f);
final byte[] buffer = new byte[is.available()];
is.read(buffer);
is.close();
// output format matches the original ssdeep program
System.out.println(ss.fuzzy_hash(buffer) + ",\"" + f + "\"");
}
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_CODING_NETEQ_TOOLS_AUDIO_SINK_H_
#define MODULES_AUDIO_CODING_NETEQ_TOOLS_AUDIO_SINK_H_
#include "api/audio/audio_frame.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
namespace test {
// Interface class for an object receiving raw output audio from test
// applications.
class AudioSink {
public:
AudioSink() {}
virtual ~AudioSink() {}
// Writes |num_samples| from |audio| to the AudioSink. Returns true if
// successful, otherwise false.
virtual bool WriteArray(const int16_t* audio, size_t num_samples) = 0;
// Writes |audio_frame| to the AudioSink. Returns true if successful,
// otherwise false.
bool WriteAudioFrame(const AudioFrame& audio_frame) {
return WriteArray(audio_frame.data(), audio_frame.samples_per_channel_ *
audio_frame.num_channels_);
}
private:
RTC_DISALLOW_COPY_AND_ASSIGN(AudioSink);
};
// Forks the output audio to two AudioSink objects.
class AudioSinkFork : public AudioSink {
public:
AudioSinkFork(AudioSink* left, AudioSink* right)
: left_sink_(left), right_sink_(right) {}
bool WriteArray(const int16_t* audio, size_t num_samples) override;
private:
AudioSink* left_sink_;
AudioSink* right_sink_;
RTC_DISALLOW_COPY_AND_ASSIGN(AudioSinkFork);
};
// An AudioSink implementation that does nothing.
class VoidAudioSink : public AudioSink {
public:
VoidAudioSink() = default;
bool WriteArray(const int16_t* audio, size_t num_samples) override;
private:
RTC_DISALLOW_COPY_AND_ASSIGN(VoidAudioSink);
};
} // namespace test
} // namespace webrtc
#endif // MODULES_AUDIO_CODING_NETEQ_TOOLS_AUDIO_SINK_H_
|
{
"pile_set_name": "Github"
}
|
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
/* Copyright (c) 2001 */
/* All Rights Reserved. */
/* */
/* Permission is hereby granted, free of charge, to use and distribute */
/* this software and its documentation without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of this work, and to */
/* permit persons to whom this work is furnished to do so, subject to */
/* the following conditions: */
/* 1. The code must retain the above copyright notice, this list of */
/* conditions and the following disclaimer. */
/* 2. Any modifications must be clearly marked as such. */
/* 3. Original authors' names are not deleted. */
/* 4. The authors' names are not used to endorse or promote products */
/* derived from this software without specific prior written */
/* permission. */
/* */
/* CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK */
/* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
/* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */
/* SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE */
/* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
/* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
/* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
/* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
/* THIS SOFTWARE. */
/* */
/*************************************************************************/
/* Author: Alan W Black (awb@cs.cmu.edu) */
/* Date: January 2001 */
/*************************************************************************/
/* */
/* Diphone specific functions */
/* */
/*************************************************************************/
#include "cst_math.h"
#include "cst_hrg.h"
#include "cst_utt_utils.h"
#include "cst_wave.h"
#include "cst_track.h"
#include "cst_diphone.h"
#include "cst_units.h"
#include "cst_sigpr.h"
CST_VAL_REGISTER_TYPE_NODEL(diphone_db,cst_diphone_db)
static int get_diphone_entry(cst_diphone_db *udb,const char *name);
static int get_diphone_entry_bsearch(const cst_diphone_entry *entries,
int start, int end,
const char *key);
cst_utterance* diphone_synth(cst_utterance *utt)
{
get_diphone_units(utt);
join_units(utt);
return utt;
}
cst_utterance *get_diphone_units(cst_utterance *utt)
{
/* Select units from db with times etc */
cst_relation *units;
cst_item *s0, *s1, *u;
float end0,end1;
char diphone_name[22];
cst_diphone_db *udb;
int unit_entry;
udb = val_diphone_db(utt_feat_val(utt,"diphone_db"));
utt_set_feat(utt,"sts_list",sts_list_val(udb->sts));
units = utt_relation_create(utt,"Unit");
for (s0=relation_head(utt_relation(utt,"Segment"));
s0 && item_next(s0); s0=s1)
{
s1 = item_next(s0);
cst_sprintf(diphone_name,
"%.10s-%.10s",
item_name(s0),
item_name(s1));
unit_entry = get_diphone_entry(udb,diphone_name);
if (unit_entry == -1)
{
cst_errmsg("flite: udb failed to find entry for: %s\n",
diphone_name);
unit_entry = 0;
}
/* first half of diphone */
u = relation_append(units,NULL);
item_add_daughter(s0,u);
item_set_string(u,"name",diphone_name);
end0 = item_feat_float(s0,"end");
item_set_int(u,"target_end", (int)(end0*udb->sts->sample_rate));
item_set_int(u,"unit_entry",unit_entry);
item_set_int(u,"unit_start",udb->diphones[unit_entry].start_pm);
item_set_int(u,"unit_end",
udb->diphones[unit_entry].start_pm +
udb->diphones[unit_entry].pb_pm);
/* second half of diphone */
u = relation_append(units,NULL);
item_add_daughter(s1,u);
item_set_string(u,"name",diphone_name);
end1 = item_feat_float(s1,"end");
item_set_int(u,"target_end",(int)(((end0+end1)/2.0)*udb->sts->sample_rate));
item_set_int(u,"unit_entry",unit_entry);
item_set_int(u,"unit_start",
udb->diphones[unit_entry].start_pm +
udb->diphones[unit_entry].pb_pm);
item_set_int(u,"unit_end",
udb->diphones[unit_entry].start_pm +
udb->diphones[unit_entry].pb_pm+
udb->diphones[unit_entry].end_pm);
}
return utt;
}
static int get_diphone_entry(cst_diphone_db *udb, const char *name)
{
return get_diphone_entry_bsearch(udb->diphones,0,
udb->num_entries,
name);
}
static int get_diphone_entry_bsearch(const cst_diphone_entry *entries,
int start, int end,
const char *key)
{
int mid,c;
while (start < end)
{
mid = (start+end)/2;
c = strcmp(entries[mid].name,key);
if (c == 0)
return mid;
else if (c > 0)
end = mid;
else
start = mid + 1;
}
return -1; /* can't find it */
}
|
{
"pile_set_name": "Github"
}
|
// Copyright (C) 2013 Vicente J. Botet Escriba
//
// 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)
//
// 2013/11 Vicente J. Botet Escriba
// first implementation of a simple serial scheduler.
#ifndef BOOST_THREAD_SERIAL_EXECUTOR_HPP
#define BOOST_THREAD_SERIAL_EXECUTOR_HPP
#include <boost/thread/detail/config.hpp>
#include <boost/thread/detail/delete.hpp>
#include <boost/thread/detail/move.hpp>
#include <boost/thread/concurrent_queues/sync_queue.hpp>
#include <boost/thread/executors/work.hpp>
#include <boost/thread/executors/generic_executor_ref.hpp>
#include <boost/thread/future.hpp>
#include <boost/thread/scoped_thread.hpp>
#include <boost/config/abi_prefix.hpp>
namespace boost
{
namespace executors
{
class serial_executor
{
public:
/// type-erasure to store the works to do
typedef executors::work work;
private:
typedef scoped_thread<> thread_t;
/// the thread safe work queue
concurrent::sync_queue<work > work_queue;
generic_executor_ref ex;
thread_t thr;
struct try_executing_one_task {
work& task;
boost::promise<void> &p;
try_executing_one_task(work& task, boost::promise<void> &p)
: task(task), p(p) {}
void operator()() {
try {
task();
p.set_value();
} catch (...)
{
p.set_exception(current_exception());
}
}
};
public:
/**
* \par Returns
* The underlying executor wrapped on a generic executor reference.
*/
generic_executor_ref& underlying_executor() BOOST_NOEXCEPT { return ex; }
/**
* Effects: try to execute one task.
* Returns: whether a task has been executed.
* Throws: whatever the current task constructor throws or the task() throws.
*/
bool try_executing_one()
{
work task;
try
{
if (work_queue.try_pull(task) == queue_op_status::success)
{
boost::promise<void> p;
try_executing_one_task tmp(task,p);
ex.submit(tmp);
p.get_future().wait();
return true;
}
return false;
}
catch (...)
{
std::terminate();
//return false;
}
}
private:
/**
* Effects: schedule one task or yields
* Throws: whatever the current task constructor throws or the task() throws.
*/
void schedule_one_or_yield()
{
if ( ! try_executing_one())
{
this_thread::yield();
}
}
/**
* The main loop of the worker thread
*/
void worker_thread()
{
while (!closed())
{
schedule_one_or_yield();
}
while (try_executing_one())
{
}
}
public:
/// serial_executor is not copyable.
BOOST_THREAD_NO_COPYABLE(serial_executor)
/**
* \b Effects: creates a thread pool that runs closures using one of its closure-executing methods.
*
* \b Throws: Whatever exception is thrown while initializing the needed resources.
*/
template <class Executor>
serial_executor(Executor& ex)
: ex(ex), thr(&serial_executor::worker_thread, this)
{
}
/**
* \b Effects: Destroys the thread pool.
*
* \b Synchronization: The completion of all the closures happen before the completion of the \c serial_executor destructor.
*/
~serial_executor()
{
// signal to the worker thread that there will be no more submissions.
close();
}
/**
* \b Effects: close the \c serial_executor for submissions.
* The loop will work until there is no more closures to run.
*/
void close()
{
work_queue.close();
}
/**
* \b Returns: whether the pool is closed for submissions.
*/
bool closed()
{
return work_queue.closed();
}
/**
* \b Requires: \c Closure is a model of \c Callable(void()) and a model of \c CopyConstructible/MoveConstructible.
*
* \b Effects: The specified \c closure will be scheduled for execution at some point in the future.
* If invoked closure throws an exception the \c serial_executor will call \c std::terminate, as is the case with threads.
*
* \b Synchronization: completion of \c closure on a particular thread happens before destruction of thread's thread local variables.
*
* \b Throws: \c sync_queue_is_closed if the thread pool is closed.
* Whatever exception that can be throw while storing the closure.
*/
void submit(BOOST_THREAD_RV_REF(work) closure)
{
work_queue.push(boost::move(closure));
}
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename Closure>
void submit(Closure & closure)
{
submit(work(closure));
}
#endif
void submit(void (*closure)())
{
submit(work(closure));
}
template <typename Closure>
void submit(BOOST_THREAD_FWD_REF(Closure) closure)
{
work w((boost::forward<Closure>(closure)));
submit(boost::move(w));
}
/**
* \b Requires: This must be called from an scheduled task.
*
* \b Effects: reschedule functions until pred()
*/
template <typename Pred>
bool reschedule_until(Pred const& pred)
{
do {
if ( ! try_executing_one())
{
return false;
}
} while (! pred());
return true;
}
};
}
using executors::serial_executor;
}
#include <boost/config/abi_suffix.hpp>
#endif
|
{
"pile_set_name": "Github"
}
|
cmake_minimum_required(VERSION 3.9)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
|
{
"pile_set_name": "Github"
}
|
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "ADDR2LINE 1"
.TH ADDR2LINE 1 "2008-09-10" "binutils-2.18.90" "GNU Development Tools"
.SH "NAME"
addr2line \- convert addresses into file names and line numbers.
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
addr2line [\fB\-b\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR]
[\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]]
[\fB\-e\fR \fIfilename\fR|\fB\-\-exe=\fR\fIfilename\fR]
[\fB\-f\fR|\fB\-\-functions\fR] [\fB\-s\fR|\fB\-\-basename\fR]
[\fB\-i\fR|\fB\-\-inlines\fR]
[\fB\-j\fR|\fB\-\-section=\fR\fIname\fR]
[\fB\-H\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR]
[addr addr ...]
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBaddr2line\fR translates addresses into file names and line numbers.
Given an address in an executable or an offset in a section of a relocatable
object, it uses the debugging information to figure out which file name and
line number are associated with it.
.PP
The executable or relocatable object to use is specified with the \fB\-e\fR
option. The default is the file \fIa.out\fR. The section in the relocatable
object to use is specified with the \fB\-j\fR option.
.PP
\&\fBaddr2line\fR has two modes of operation.
.PP
In the first, hexadecimal addresses are specified on the command line,
and \fBaddr2line\fR displays the file name and line number for each
address.
.PP
In the second, \fBaddr2line\fR reads hexadecimal addresses from
standard input, and prints the file name and line number for each
address on standard output. In this mode, \fBaddr2line\fR may be used
in a pipe to convert dynamically chosen addresses.
.PP
The format of the output is \fB\s-1FILENAME:LINENO\s0\fR. The file name and
line number for each address is printed on a separate line. If the
\&\fB\-f\fR option is used, then each \fB\s-1FILENAME:LINENO\s0\fR line is
preceded by a \fB\s-1FUNCTIONNAME\s0\fR line which is the name of the function
containing the address.
.PP
If the file name or function name can not be determined,
\&\fBaddr2line\fR will print two question marks in their place. If the
line number can not be determined, \fBaddr2line\fR will print 0.
.SH "OPTIONS"
.IX Header "OPTIONS"
The long and short forms of options, shown here as alternatives, are
equivalent.
.IP "\fB\-b\fR \fIbfdname\fR" 4
.IX Item "-b bfdname"
.PD 0
.IP "\fB\-\-target=\fR\fIbfdname\fR" 4
.IX Item "--target=bfdname"
.PD
Specify that the object-code format for the object files is
\&\fIbfdname\fR.
.IP "\fB\-C\fR" 4
.IX Item "-C"
.PD 0
.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4
.IX Item "--demangle[=style]"
.PD
Decode (\fIdemangle\fR) low-level symbol names into user-level names.
Besides removing any initial underscore prepended by the system, this
makes \*(C+ function names readable. Different compilers have different
mangling styles. The optional demangling style argument can be used to
choose an appropriate demangling style for your compiler.
.IP "\fB\-e\fR \fIfilename\fR" 4
.IX Item "-e filename"
.PD 0
.IP "\fB\-\-exe=\fR\fIfilename\fR" 4
.IX Item "--exe=filename"
.PD
Specify the name of the executable for which addresses should be
translated. The default file is \fIa.out\fR.
.IP "\fB\-f\fR" 4
.IX Item "-f"
.PD 0
.IP "\fB\-\-functions\fR" 4
.IX Item "--functions"
.PD
Display function names as well as file and line number information.
.IP "\fB\-s\fR" 4
.IX Item "-s"
.PD 0
.IP "\fB\-\-basenames\fR" 4
.IX Item "--basenames"
.PD
Display only the base of each file name.
.IP "\fB\-i\fR" 4
.IX Item "-i"
.PD 0
.IP "\fB\-\-inlines\fR" 4
.IX Item "--inlines"
.PD
If the address belongs to a function that was inlined, the source
information for all enclosing scopes back to the first non-inlined
function will also be printed. For example, if \f(CW\*(C`main\*(C'\fR inlines
\&\f(CW\*(C`callee1\*(C'\fR which inlines \f(CW\*(C`callee2\*(C'\fR, and address is from
\&\f(CW\*(C`callee2\*(C'\fR, the source information for \f(CW\*(C`callee1\*(C'\fR and \f(CW\*(C`main\*(C'\fR
will also be printed.
.IP "\fB\-j\fR" 4
.IX Item "-j"
.PD 0
.IP "\fB\-\-section\fR" 4
.IX Item "--section"
.PD
Read offsets relative to the specified section instead of absolute addresses.
.IP "\fB@\fR\fIfile\fR" 4
.IX Item "@file"
Read command-line options from \fIfile\fR. The options read are
inserted in place of the original @\fIfile\fR option. If \fIfile\fR
does not exist, or cannot be read, then the option will be treated
literally, and not removed.
.Sp
Options in \fIfile\fR are separated by whitespace. A whitespace
character may be included in an option by surrounding the entire
option in either single or double quotes. Any character (including a
backslash) may be included by prefixing the character to be included
with a backslash. The \fIfile\fR may itself contain additional
@\fIfile\fR options; any such options will be processed recursively.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Info entries for \fIbinutils\fR.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
.PP
Permission is granted to copy, distribute and/or modify this document
under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
|
{
"pile_set_name": "Github"
}
|
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms 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. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.compiere.impexp;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Properties;
import java.util.logging.Level;
import org.compiere.model.X_AD_ImpFormat;
import org.compiere.util.DB;
/**
* Import Format Model
*
* @author Jorg Janke
* @version $Id: MImpFormat.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
*/
public class MImpFormat extends X_AD_ImpFormat
{
/**
*
*/
private static final long serialVersionUID = -3768339618622673968L;
/**
* Standard Constructor
* @param ctx context
* @param AD_ImpFormat_ID id
* @param trxName transaction
*/
public MImpFormat (Properties ctx, int AD_ImpFormat_ID, String trxName)
{
super (ctx, AD_ImpFormat_ID, trxName);
} // MImpFormat
/**
* Load Constructor
* @param ctx context
* @param rs result set
* @param trxName transaction
*/
public MImpFormat (Properties ctx, ResultSet rs, String trxName)
{
super(ctx, rs, trxName);
} // MImpFormat
/**
* Get (all) Rows
* @return array of Rows
*/
public MImpFormatRow[] getRows()
{
ArrayList<MImpFormatRow> list = new ArrayList<MImpFormatRow>();
String sql = "SELECT * FROM AD_ImpFormat_Row "
+ "WHERE AD_ImpFormat_ID=? "
+ "ORDER BY SeqNo";
PreparedStatement pstmt = null;
try
{
pstmt = DB.prepareStatement (sql, get_TrxName());
pstmt.setInt (1, getAD_ImpFormat_ID());
ResultSet rs = pstmt.executeQuery ();
while (rs.next ())
list.add(new MImpFormatRow (getCtx(), rs, get_TrxName()));
rs.close ();
pstmt.close ();
pstmt = null;
}
catch (Exception e)
{
log.log(Level.SEVERE, "getRows", e);
}
try
{
if (pstmt != null)
pstmt.close ();
pstmt = null;
}
catch (Exception e)
{
pstmt = null;
}
MImpFormatRow[] retValue = new MImpFormatRow[list.size ()];
list.toArray (retValue);
return retValue;
} // getRows
} // MImpFormat
|
{
"pile_set_name": "Github"
}
|
title: RA_1604_get_ability_to_revoke_authentication_credentials
id: RA1604
description: >
Make sure you have the ability to revoke authentication credentials
author: your name/nickname/twitter
creation_date: YYYY/MM/DD
stage: preparation
references:
- https://example.com
requirements:
- DN_zeek_conn_log # placeholder
workflow: |
Description of the workflow for single Response Action in markdown format.
Here newlines will be saved.
|
{
"pile_set_name": "Github"
}
|
// Copyright 2017 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 freebsd
package unix
import (
errorspkg "errors"
"fmt"
)
// Go implementation of C mostly found in /usr/src/sys/kern/subr_capability.c
const (
// This is the version of CapRights this package understands. See C implementation for parallels.
capRightsGoVersion = CAP_RIGHTS_VERSION_00
capArSizeMin = CAP_RIGHTS_VERSION_00 + 2
capArSizeMax = capRightsGoVersion + 2
)
var (
bit2idx = []int{
-1, 0, 1, -1, 2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1,
4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
}
)
func capidxbit(right uint64) int {
return int((right >> 57) & 0x1f)
}
func rightToIndex(right uint64) (int, error) {
idx := capidxbit(right)
if idx < 0 || idx >= len(bit2idx) {
return -2, fmt.Errorf("index for right 0x%x out of range", right)
}
return bit2idx[idx], nil
}
func caprver(right uint64) int {
return int(right >> 62)
}
func capver(rights *CapRights) int {
return caprver(rights.Rights[0])
}
func caparsize(rights *CapRights) int {
return capver(rights) + 2
}
// CapRightsSet sets the permissions in setrights in rights.
func CapRightsSet(rights *CapRights, setrights []uint64) error {
// This is essentially a copy of cap_rights_vset()
if capver(rights) != CAP_RIGHTS_VERSION_00 {
return fmt.Errorf("bad rights version %d", capver(rights))
}
n := caparsize(rights)
if n < capArSizeMin || n > capArSizeMax {
return errorspkg.New("bad rights size")
}
for _, right := range setrights {
if caprver(right) != CAP_RIGHTS_VERSION_00 {
return errorspkg.New("bad right version")
}
i, err := rightToIndex(right)
if err != nil {
return err
}
if i >= n {
return errorspkg.New("index overflow")
}
if capidxbit(rights.Rights[i]) != capidxbit(right) {
return errorspkg.New("index mismatch")
}
rights.Rights[i] |= right
if capidxbit(rights.Rights[i]) != capidxbit(right) {
return errorspkg.New("index mismatch (after assign)")
}
}
return nil
}
// CapRightsClear clears the permissions in clearrights from rights.
func CapRightsClear(rights *CapRights, clearrights []uint64) error {
// This is essentially a copy of cap_rights_vclear()
if capver(rights) != CAP_RIGHTS_VERSION_00 {
return fmt.Errorf("bad rights version %d", capver(rights))
}
n := caparsize(rights)
if n < capArSizeMin || n > capArSizeMax {
return errorspkg.New("bad rights size")
}
for _, right := range clearrights {
if caprver(right) != CAP_RIGHTS_VERSION_00 {
return errorspkg.New("bad right version")
}
i, err := rightToIndex(right)
if err != nil {
return err
}
if i >= n {
return errorspkg.New("index overflow")
}
if capidxbit(rights.Rights[i]) != capidxbit(right) {
return errorspkg.New("index mismatch")
}
rights.Rights[i] &= ^(right & 0x01FFFFFFFFFFFFFF)
if capidxbit(rights.Rights[i]) != capidxbit(right) {
return errorspkg.New("index mismatch (after assign)")
}
}
return nil
}
// CapRightsIsSet checks whether all the permissions in setrights are present in rights.
func CapRightsIsSet(rights *CapRights, setrights []uint64) (bool, error) {
// This is essentially a copy of cap_rights_is_vset()
if capver(rights) != CAP_RIGHTS_VERSION_00 {
return false, fmt.Errorf("bad rights version %d", capver(rights))
}
n := caparsize(rights)
if n < capArSizeMin || n > capArSizeMax {
return false, errorspkg.New("bad rights size")
}
for _, right := range setrights {
if caprver(right) != CAP_RIGHTS_VERSION_00 {
return false, errorspkg.New("bad right version")
}
i, err := rightToIndex(right)
if err != nil {
return false, err
}
if i >= n {
return false, errorspkg.New("index overflow")
}
if capidxbit(rights.Rights[i]) != capidxbit(right) {
return false, errorspkg.New("index mismatch")
}
if (rights.Rights[i] & right) != right {
return false, nil
}
}
return true, nil
}
func capright(idx uint64, bit uint64) uint64 {
return ((1 << (57 + idx)) | bit)
}
// CapRightsInit returns a pointer to an initialised CapRights structure filled with rights.
// See man cap_rights_init(3) and rights(4).
func CapRightsInit(rights []uint64) (*CapRights, error) {
var r CapRights
r.Rights[0] = (capRightsGoVersion << 62) | capright(0, 0)
r.Rights[1] = capright(1, 0)
err := CapRightsSet(&r, rights)
if err != nil {
return nil, err
}
return &r, nil
}
// CapRightsLimit reduces the operations permitted on fd to at most those contained in rights.
// The capability rights on fd can never be increased by CapRightsLimit.
// See man cap_rights_limit(2) and rights(4).
func CapRightsLimit(fd uintptr, rights *CapRights) error {
return capRightsLimit(int(fd), rights)
}
// CapRightsGet returns a CapRights structure containing the operations permitted on fd.
// See man cap_rights_get(3) and rights(4).
func CapRightsGet(fd uintptr) (*CapRights, error) {
r, err := CapRightsInit(nil)
if err != nil {
return nil, err
}
err = capRightsGet(capRightsGoVersion, int(fd), r)
if err != nil {
return nil, err
}
return r, nil
}
|
{
"pile_set_name": "Github"
}
|
import numpy as np
import torch
import torch.nn as nn
from ..backbones_2d import BaseBEVBackbone
from .anchor_head_template import AnchorHeadTemplate
class SingleHead(BaseBEVBackbone):
def __init__(self, model_cfg, input_channels, num_class, num_anchors_per_location, code_size, rpn_head_cfg=None,
head_label_indices=None, separate_reg_config=None):
super().__init__(rpn_head_cfg, input_channels)
self.num_anchors_per_location = num_anchors_per_location
self.num_class = num_class
self.code_size = code_size
self.model_cfg = model_cfg
self.separate_reg_config = separate_reg_config
self.register_buffer('head_label_indices', head_label_indices)
if self.separate_reg_config is not None:
code_size_cnt = 0
self.conv_box = nn.ModuleDict()
self.conv_box_names = []
num_middle_conv = self.separate_reg_config.NUM_MIDDLE_CONV
num_middle_filter = self.separate_reg_config.NUM_MIDDLE_FILTER
conv_cls_list = []
c_in = input_channels
for k in range(num_middle_conv):
conv_cls_list.extend([
nn.Conv2d(
c_in, num_middle_filter,
kernel_size=3, stride=1, padding=1, bias=False
),
nn.BatchNorm2d(num_middle_filter),
nn.ReLU()
])
c_in = num_middle_filter
conv_cls_list.append(nn.Conv2d(
c_in, self.num_anchors_per_location * self.num_class,
kernel_size=3, stride=1, padding=1
))
self.conv_cls = nn.Sequential(*conv_cls_list)
for reg_config in self.separate_reg_config.REG_LIST:
reg_name, reg_channel = reg_config.split(':')
reg_channel = int(reg_channel)
cur_conv_list = []
c_in = input_channels
for k in range(num_middle_conv):
cur_conv_list.extend([
nn.Conv2d(
c_in, num_middle_filter,
kernel_size=3, stride=1, padding=1, bias=False
),
nn.BatchNorm2d(num_middle_filter),
nn.ReLU()
])
c_in = num_middle_filter
cur_conv_list.append(nn.Conv2d(
c_in, self.num_anchors_per_location * int(reg_channel),
kernel_size=3, stride=1, padding=1, bias=True
))
code_size_cnt += reg_channel
self.conv_box[f'conv_{reg_name}'] = nn.Sequential(*cur_conv_list)
self.conv_box_names.append(f'conv_{reg_name}')
for m in self.conv_box.modules():
if isinstance(m, nn.Conv2d):
nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu')
if m.bias is not None:
nn.init.constant_(m.bias, 0)
assert code_size_cnt == code_size, f'Code size does not match: {code_size_cnt}:{code_size}'
else:
self.conv_cls = nn.Conv2d(
input_channels, self.num_anchors_per_location * self.num_class,
kernel_size=1
)
self.conv_box = nn.Conv2d(
input_channels, self.num_anchors_per_location * self.code_size,
kernel_size=1
)
if self.model_cfg.get('USE_DIRECTION_CLASSIFIER', None) is not None:
self.conv_dir_cls = nn.Conv2d(
input_channels,
self.num_anchors_per_location * self.model_cfg.NUM_DIR_BINS,
kernel_size=1
)
else:
self.conv_dir_cls = None
self.use_multihead = self.model_cfg.get('USE_MULTIHEAD', False)
self.init_weights()
def init_weights(self):
pi = 0.01
if isinstance(self.conv_cls, nn.Conv2d):
nn.init.constant_(self.conv_cls.bias, -np.log((1 - pi) / pi))
else:
nn.init.constant_(self.conv_cls[-1].bias, -np.log((1 - pi) / pi))
def forward(self, spatial_features_2d):
ret_dict = {}
spatial_features_2d = super().forward({'spatial_features': spatial_features_2d})['spatial_features_2d']
cls_preds = self.conv_cls(spatial_features_2d)
if self.separate_reg_config is None:
box_preds = self.conv_box(spatial_features_2d)
else:
box_preds_list = []
for reg_name in self.conv_box_names:
box_preds_list.append(self.conv_box[reg_name](spatial_features_2d))
box_preds = torch.cat(box_preds_list, dim=1)
if not self.use_multihead:
box_preds = box_preds.permute(0, 2, 3, 1).contiguous()
cls_preds = cls_preds.permute(0, 2, 3, 1).contiguous()
else:
H, W = box_preds.shape[2:]
batch_size = box_preds.shape[0]
box_preds = box_preds.view(-1, self.num_anchors_per_location,
self.code_size, H, W).permute(0, 1, 3, 4, 2).contiguous()
cls_preds = cls_preds.view(-1, self.num_anchors_per_location,
self.num_class, H, W).permute(0, 1, 3, 4, 2).contiguous()
box_preds = box_preds.view(batch_size, -1, self.code_size)
cls_preds = cls_preds.view(batch_size, -1, self.num_class)
if self.conv_dir_cls is not None:
dir_cls_preds = self.conv_dir_cls(spatial_features_2d)
if self.use_multihead:
dir_cls_preds = dir_cls_preds.view(
-1, self.num_anchors_per_location, self.model_cfg.NUM_DIR_BINS, H, W).permute(0, 1, 3, 4,
2).contiguous()
dir_cls_preds = dir_cls_preds.view(batch_size, -1, self.model_cfg.NUM_DIR_BINS)
else:
dir_cls_preds = dir_cls_preds.permute(0, 2, 3, 1).contiguous()
else:
dir_cls_preds = None
ret_dict['cls_preds'] = cls_preds
ret_dict['box_preds'] = box_preds
ret_dict['dir_cls_preds'] = dir_cls_preds
return ret_dict
class AnchorHeadMulti(AnchorHeadTemplate):
def __init__(self, model_cfg, input_channels, num_class, class_names, grid_size, point_cloud_range,
predict_boxes_when_training=True):
super().__init__(
model_cfg=model_cfg, num_class=num_class, class_names=class_names, grid_size=grid_size,
point_cloud_range=point_cloud_range, predict_boxes_when_training=predict_boxes_when_training
)
self.model_cfg = model_cfg
self.separate_multihead = self.model_cfg.get('SEPARATE_MULTIHEAD', False)
if self.model_cfg.get('SHARED_CONV_NUM_FILTER', None) is not None:
shared_conv_num_filter = self.model_cfg.SHARED_CONV_NUM_FILTER
self.shared_conv = nn.Sequential(
nn.Conv2d(input_channels, shared_conv_num_filter, 3, stride=1, padding=1, bias=False),
nn.BatchNorm2d(shared_conv_num_filter, eps=1e-3, momentum=0.01),
nn.ReLU(),
)
else:
self.shared_conv = None
shared_conv_num_filter = input_channels
self.rpn_heads = None
self.make_multihead(shared_conv_num_filter)
def make_multihead(self, input_channels):
rpn_head_cfgs = self.model_cfg.RPN_HEAD_CFGS
rpn_heads = []
class_names = []
for rpn_head_cfg in rpn_head_cfgs:
class_names.extend(rpn_head_cfg['HEAD_CLS_NAME'])
for rpn_head_cfg in rpn_head_cfgs:
num_anchors_per_location = sum([self.num_anchors_per_location[class_names.index(head_cls)]
for head_cls in rpn_head_cfg['HEAD_CLS_NAME']])
head_label_indices = torch.from_numpy(np.array([
self.class_names.index(cur_name) + 1 for cur_name in rpn_head_cfg['HEAD_CLS_NAME']
]))
rpn_head = SingleHead(
self.model_cfg, input_channels,
len(rpn_head_cfg['HEAD_CLS_NAME']) if self.separate_multihead else self.num_class,
num_anchors_per_location, self.box_coder.code_size, rpn_head_cfg,
head_label_indices=head_label_indices,
separate_reg_config=self.model_cfg.get('SEPARATE_REG_CONFIG', None)
)
rpn_heads.append(rpn_head)
self.rpn_heads = nn.ModuleList(rpn_heads)
def forward(self, data_dict):
spatial_features_2d = data_dict['spatial_features_2d']
if self.shared_conv is not None:
spatial_features_2d = self.shared_conv(spatial_features_2d)
ret_dicts = []
for rpn_head in self.rpn_heads:
ret_dicts.append(rpn_head(spatial_features_2d))
cls_preds = [ret_dict['cls_preds'] for ret_dict in ret_dicts]
box_preds = [ret_dict['box_preds'] for ret_dict in ret_dicts]
ret = {
'cls_preds': cls_preds if self.separate_multihead else torch.cat(cls_preds, dim=1),
'box_preds': box_preds if self.separate_multihead else torch.cat(box_preds, dim=1),
}
if self.model_cfg.get('USE_DIRECTION_CLASSIFIER', False):
dir_cls_preds = [ret_dict['dir_cls_preds'] for ret_dict in ret_dicts]
ret['dir_cls_preds'] = dir_cls_preds if self.separate_multihead else torch.cat(dir_cls_preds, dim=1)
self.forward_ret_dict.update(ret)
if self.training:
targets_dict = self.assign_targets(
gt_boxes=data_dict['gt_boxes']
)
self.forward_ret_dict.update(targets_dict)
if not self.training or self.predict_boxes_when_training:
batch_cls_preds, batch_box_preds = self.generate_predicted_boxes(
batch_size=data_dict['batch_size'],
cls_preds=ret['cls_preds'], box_preds=ret['box_preds'], dir_cls_preds=ret.get('dir_cls_preds', None)
)
if isinstance(batch_cls_preds, list):
multihead_label_mapping = []
for idx in range(len(batch_cls_preds)):
multihead_label_mapping.append(self.rpn_heads[idx].head_label_indices)
data_dict['multihead_label_mapping'] = multihead_label_mapping
data_dict['batch_cls_preds'] = batch_cls_preds
data_dict['batch_box_preds'] = batch_box_preds
data_dict['cls_preds_normalized'] = False
return data_dict
def get_cls_layer_loss(self):
loss_weights = self.model_cfg.LOSS_CONFIG.LOSS_WEIGHTS
if 'pos_cls_weight' in loss_weights:
pos_cls_weight = loss_weights['pos_cls_weight']
neg_cls_weight = loss_weights['neg_cls_weight']
else:
pos_cls_weight = neg_cls_weight = 1.0
cls_preds = self.forward_ret_dict['cls_preds']
box_cls_labels = self.forward_ret_dict['box_cls_labels']
if not isinstance(cls_preds, list):
cls_preds = [cls_preds]
batch_size = int(cls_preds[0].shape[0])
cared = box_cls_labels >= 0 # [N, num_anchors]
positives = box_cls_labels > 0
negatives = box_cls_labels == 0
negative_cls_weights = negatives * 1.0 * neg_cls_weight
cls_weights = (negative_cls_weights + pos_cls_weight * positives).float()
reg_weights = positives.float()
if self.num_class == 1:
# class agnostic
box_cls_labels[positives] = 1
pos_normalizer = positives.sum(1, keepdim=True).float()
reg_weights /= torch.clamp(pos_normalizer, min=1.0)
cls_weights /= torch.clamp(pos_normalizer, min=1.0)
cls_targets = box_cls_labels * cared.type_as(box_cls_labels)
one_hot_targets = torch.zeros(
*list(cls_targets.shape), self.num_class + 1, dtype=cls_preds[0].dtype, device=cls_targets.device
)
one_hot_targets.scatter_(-1, cls_targets.unsqueeze(dim=-1).long(), 1.0)
one_hot_targets = one_hot_targets[..., 1:]
start_idx = c_idx = 0
cls_losses = 0
for idx, cls_pred in enumerate(cls_preds):
cur_num_class = self.rpn_heads[idx].num_class
cls_pred = cls_pred.view(batch_size, -1, cur_num_class)
if self.separate_multihead:
one_hot_target = one_hot_targets[:, start_idx:start_idx + cls_pred.shape[1],
c_idx:c_idx + cur_num_class]
c_idx += cur_num_class
else:
one_hot_target = one_hot_targets[:, start_idx:start_idx + cls_pred.shape[1]]
cls_weight = cls_weights[:, start_idx:start_idx + cls_pred.shape[1]]
cls_loss_src = self.cls_loss_func(cls_pred, one_hot_target, weights=cls_weight) # [N, M]
cls_loss = cls_loss_src.sum() / batch_size
cls_loss = cls_loss * loss_weights['cls_weight']
cls_losses += cls_loss
start_idx += cls_pred.shape[1]
assert start_idx == one_hot_targets.shape[1]
tb_dict = {
'rpn_loss_cls': cls_losses.item()
}
return cls_losses, tb_dict
def get_box_reg_layer_loss(self):
box_preds = self.forward_ret_dict['box_preds']
box_dir_cls_preds = self.forward_ret_dict.get('dir_cls_preds', None)
box_reg_targets = self.forward_ret_dict['box_reg_targets']
box_cls_labels = self.forward_ret_dict['box_cls_labels']
positives = box_cls_labels > 0
reg_weights = positives.float()
pos_normalizer = positives.sum(1, keepdim=True).float()
reg_weights /= torch.clamp(pos_normalizer, min=1.0)
if not isinstance(box_preds, list):
box_preds = [box_preds]
batch_size = int(box_preds[0].shape[0])
if isinstance(self.anchors, list):
if self.use_multihead:
anchors = torch.cat(
[anchor.permute(3, 4, 0, 1, 2, 5).contiguous().view(-1, anchor.shape[-1])
for anchor in self.anchors], dim=0
)
else:
anchors = torch.cat(self.anchors, dim=-3)
else:
anchors = self.anchors
anchors = anchors.view(1, -1, anchors.shape[-1]).repeat(batch_size, 1, 1)
start_idx = 0
box_losses = 0
tb_dict = {}
for idx, box_pred in enumerate(box_preds):
box_pred = box_pred.view(
batch_size, -1,
box_pred.shape[-1] // self.num_anchors_per_location if not self.use_multihead else box_pred.shape[-1]
)
box_reg_target = box_reg_targets[:, start_idx:start_idx + box_pred.shape[1]]
reg_weight = reg_weights[:, start_idx:start_idx + box_pred.shape[1]]
# sin(a - b) = sinacosb-cosasinb
if box_dir_cls_preds is not None:
box_pred_sin, reg_target_sin = self.add_sin_difference(box_pred, box_reg_target)
loc_loss_src = self.reg_loss_func(box_pred_sin, reg_target_sin, weights=reg_weight) # [N, M]
else:
loc_loss_src = self.reg_loss_func(box_pred, box_reg_target, weights=reg_weight) # [N, M]
loc_loss = loc_loss_src.sum() / batch_size
loc_loss = loc_loss * self.model_cfg.LOSS_CONFIG.LOSS_WEIGHTS['loc_weight']
box_losses += loc_loss
tb_dict['rpn_loss_loc'] = tb_dict.get('rpn_loss_loc', 0) + loc_loss.item()
if box_dir_cls_preds is not None:
if not isinstance(box_dir_cls_preds, list):
box_dir_cls_preds = [box_dir_cls_preds]
dir_targets = self.get_direction_target(
anchors, box_reg_targets,
dir_offset=self.model_cfg.DIR_OFFSET,
num_bins=self.model_cfg.NUM_DIR_BINS
)
box_dir_cls_pred = box_dir_cls_preds[idx]
dir_logit = box_dir_cls_pred.view(batch_size, -1, self.model_cfg.NUM_DIR_BINS)
weights = positives.type_as(dir_logit)
weights /= torch.clamp(weights.sum(-1, keepdim=True), min=1.0)
weight = weights[:, start_idx:start_idx + box_pred.shape[1]]
dir_target = dir_targets[:, start_idx:start_idx + box_pred.shape[1]]
dir_loss = self.dir_loss_func(dir_logit, dir_target, weights=weight)
dir_loss = dir_loss.sum() / batch_size
dir_loss = dir_loss * self.model_cfg.LOSS_CONFIG.LOSS_WEIGHTS['dir_weight']
box_losses += dir_loss
tb_dict['rpn_loss_dir'] = tb_dict.get('rpn_loss_dir', 0) + dir_loss.item()
start_idx += box_pred.shape[1]
return box_losses, tb_dict
|
{
"pile_set_name": "Github"
}
|
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Jun 9 2015 22:53:21).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2014 by Steve Nygard.
//
#import <Cocoa/NSObject.h>
@interface IPAnimationAction : NSObject
{
int _type;
id _target;
SEL _selector;
CDUnknownBlockType _block;
}
+ (id)withBlock:(CDUnknownBlockType)arg1;
+ (id)withTarget:(id)arg1 selector:(SEL)arg2;
- (id)description;
- (void)perform;
- (void)_setBlock:(CDUnknownBlockType)arg1;
@end
|
{
"pile_set_name": "Github"
}
|
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright 2018 Google LLC
* Written by Simon Glass <sjg@chromium.org>
*/
#ifndef __TEGRA_I2S_PRIV_H
#define __TEGRA_I2S_PRIV_H
enum {
/* Set i2s device (in buf) */
AHUB_MISCOP_SET_I2S,
};
/*
* tegra_i2s_set_cif_tx_ctrl() - Set the I2C port to send to
*
* The CIF is not really part of I2S -- it's for Audio Hub to control
* the interface between I2S and Audio Hub. However since it's put in
* the I2S registers domain instead of the Audio Hub, we need to export
* this as a function.
*
* @dev: I2S device
* @value: Value to write to CIF_TX_CTRL register
* @return 0
*/
int tegra_i2s_set_cif_tx_ctrl(struct udevice *dev, u32 value);
#endif
|
{
"pile_set_name": "Github"
}
|
##sK1 2 0
obj('Document')
set_field('styles',{'Default Style': [[], [0, 0.28346456692913385, ['CMYK', [0.0, 0.0, 0.0, 1.0], 1.0, 'Black'], [], 1, 0, -2.0526525391269526, 0, 0, []], [], []]})
set_field('doc_units','px')
set_field('metainfo',None)
set_field('doc_origin',2)
set_field('resources',{})
obj('Pages')
set_field('page_counter',1)
set_field('page_format',['Custom', (16.0, 16.0), 0])
obj('Page')
set_field('name','Page 1')
set_field('page_format',['Custom', (16.0, 16.0), 0])
set_field('layer_counter',1)
obj('Layer')
set_field('style',[[], [0, 0.28346456692913385, ['RGB', [0.19607843137254902, 0.3215686274509804, 0.6352941176470588, 1.0], 1.0, ''], [], 1, 0, -2.0526525391269526, 0, 0, []], [], []])
set_field('name','Layer 1')
set_field('color',[0.19607843137254902, 0.3215686274509804, 0.6352941176470588, 1.0])
set_field('properties',[1, 1, 1])
obj('Curve')
set_field('paths',[[[-8.0, -7.0], [[-8.0, -3.0], [-1.0, -3.0], [-1.0, -7.0]], 1], [[-8.0, -7.0], [], 0], [[-7.0, -2.0], [[-8.0, -2.0], [-8.0, 2.0], [4.0, 2.0], [4.0, -7.0], [0.0, -7.0], [0.0, -6.0], [3.0, -6.0], [3.0, 1.0], [-7.0, 1.0]], 1], [[-7.0, -2.0], [], 0], [[-7.0, 3.0], [[-8.0, 3.0], [-8.0, 6.0], [8.0, 6.0], [8.0, -7.0], [5.0, -7.0], [5.0, -6.0], [7.0, -6.0], [7.0, 5.0], [-7.0, 5.0]], 1], [[-7.0, 3.0], [], 0]])
set_field('style',[[1, 0, ['CMYK', [0.0, 0.0, 0.0, 1.0], 1.0, 'Black', 'Default CMYK palette']], [], [], []])
set_field('trafo',[1.0, 0.0, 0.0, 1.0, 0.0, 0.0])
obj_end()
obj_end()
obj_end()
obj_end()
obj('DesktopLayers')
obj_end()
obj('MasterLayers')
obj_end()
obj('GridLayer')
set_field('style',[[], [0, 0.28346456692913385, ['RGB', [0.0, 0.0, 1.0, 0.15], 1.0, ''], [], 1, 0, -2.0526525391269526, 0, 0, []], [], []])
set_field('name','GridLayer')
set_field('color',[0.0, 0.0, 1.0, 0.15])
set_field('grid',[0, 0, 1.0, 1.0])
set_field('properties',[1, 0, 0])
obj_end()
obj('GuideLayer')
set_field('style',[[], [0, 0.28346456692913385, ['RGB', [0.0, 0.3176470588235294, 1.0, 1.0], 1.0, ''], [], 1, 0, -2.0526525391269526, 0, 0, []], [], []])
set_field('name','GuideLayer')
set_field('color',[0.0, 0.3176470588235294, 1.0, 1.0])
set_field('properties',[1, 1, 0])
obj_end()
obj_end()
|
{
"pile_set_name": "Github"
}
|
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"noWorkspace": "当前没有打开的文件夹。",
"pleaseRestart": "通过 GIT 存储库打开文件夹以访问 GIT 功能。"
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* DO NOT EDIT THIS FILE!
*
* This file was automatically generated from external sources.
*
* Any manual change here will be lost the next time the SDK
* is updated. You've been warned!
*/
namespace DTS\eBaySDK\Test\Marketing\Types;
use DTS\eBaySDK\Marketing\Types\AdResponse;
class AdResponseTest extends \PHPUnit_Framework_TestCase
{
private $obj;
protected function setUp()
{
$this->obj = new AdResponse();
}
public function testCanBeCreated()
{
$this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\AdResponse', $this->obj);
}
public function testExtendsBaseType()
{
$this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj);
}
}
|
{
"pile_set_name": "Github"
}
|
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#pragma clang diagnostic ignored "-Wmissing-braces"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
template<typename T, size_t Num>
struct spvUnsafeArray
{
T elements[Num ? Num : 1];
thread T& operator [] (size_t pos) thread
{
return elements[pos];
}
constexpr const thread T& operator [] (size_t pos) const thread
{
return elements[pos];
}
device T& operator [] (size_t pos) device
{
return elements[pos];
}
constexpr const device T& operator [] (size_t pos) const device
{
return elements[pos];
}
constexpr const constant T& operator [] (size_t pos) const constant
{
return elements[pos];
}
threadgroup T& operator [] (size_t pos) threadgroup
{
return elements[pos];
}
constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
{
return elements[pos];
}
};
struct type_View
{
float4x4 View_TranslatedWorldToClip;
float4x4 View_WorldToClip;
float4x4 View_ClipToWorld;
float4x4 View_TranslatedWorldToView;
float4x4 View_ViewToTranslatedWorld;
float4x4 View_TranslatedWorldToCameraView;
float4x4 View_CameraViewToTranslatedWorld;
float4x4 View_ViewToClip;
float4x4 View_ViewToClipNoAA;
float4x4 View_ClipToView;
float4x4 View_ClipToTranslatedWorld;
float4x4 View_SVPositionToTranslatedWorld;
float4x4 View_ScreenToWorld;
float4x4 View_ScreenToTranslatedWorld;
packed_float3 View_ViewForward;
float PrePadding_View_908;
packed_float3 View_ViewUp;
float PrePadding_View_924;
packed_float3 View_ViewRight;
float PrePadding_View_940;
packed_float3 View_HMDViewNoRollUp;
float PrePadding_View_956;
packed_float3 View_HMDViewNoRollRight;
float PrePadding_View_972;
float4 View_InvDeviceZToWorldZTransform;
float4 View_ScreenPositionScaleBias;
packed_float3 View_WorldCameraOrigin;
float PrePadding_View_1020;
packed_float3 View_TranslatedWorldCameraOrigin;
float PrePadding_View_1036;
packed_float3 View_WorldViewOrigin;
float PrePadding_View_1052;
packed_float3 View_PreViewTranslation;
float PrePadding_View_1068;
float4x4 View_PrevProjection;
float4x4 View_PrevViewProj;
float4x4 View_PrevViewRotationProj;
float4x4 View_PrevViewToClip;
float4x4 View_PrevClipToView;
float4x4 View_PrevTranslatedWorldToClip;
float4x4 View_PrevTranslatedWorldToView;
float4x4 View_PrevViewToTranslatedWorld;
float4x4 View_PrevTranslatedWorldToCameraView;
float4x4 View_PrevCameraViewToTranslatedWorld;
packed_float3 View_PrevWorldCameraOrigin;
float PrePadding_View_1724;
packed_float3 View_PrevWorldViewOrigin;
float PrePadding_View_1740;
packed_float3 View_PrevPreViewTranslation;
float PrePadding_View_1756;
float4x4 View_PrevInvViewProj;
float4x4 View_PrevScreenToTranslatedWorld;
float4x4 View_ClipToPrevClip;
float4 View_TemporalAAJitter;
float4 View_GlobalClippingPlane;
float2 View_FieldOfViewWideAngles;
float2 View_PrevFieldOfViewWideAngles;
float4 View_ViewRectMin;
float4 View_ViewSizeAndInvSize;
float4 View_BufferSizeAndInvSize;
float4 View_BufferBilinearUVMinMax;
int View_NumSceneColorMSAASamples;
float View_PreExposure;
float View_OneOverPreExposure;
float PrePadding_View_2076;
float4 View_DiffuseOverrideParameter;
float4 View_SpecularOverrideParameter;
float4 View_NormalOverrideParameter;
float2 View_RoughnessOverrideParameter;
float View_PrevFrameGameTime;
float View_PrevFrameRealTime;
float View_OutOfBoundsMask;
float PrePadding_View_2148;
float PrePadding_View_2152;
float PrePadding_View_2156;
packed_float3 View_WorldCameraMovementSinceLastFrame;
float View_CullingSign;
float View_NearPlane;
float View_AdaptiveTessellationFactor;
float View_GameTime;
float View_RealTime;
float View_DeltaTime;
float View_MaterialTextureMipBias;
float View_MaterialTextureDerivativeMultiply;
uint View_Random;
uint View_FrameNumber;
uint View_StateFrameIndexMod8;
uint View_StateFrameIndex;
float View_CameraCut;
float View_UnlitViewmodeMask;
float PrePadding_View_2228;
float PrePadding_View_2232;
float PrePadding_View_2236;
float4 View_DirectionalLightColor;
packed_float3 View_DirectionalLightDirection;
float PrePadding_View_2268;
float4 View_TranslucencyLightingVolumeMin[2];
float4 View_TranslucencyLightingVolumeInvSize[2];
float4 View_TemporalAAParams;
float4 View_CircleDOFParams;
float View_DepthOfFieldSensorWidth;
float View_DepthOfFieldFocalDistance;
float View_DepthOfFieldScale;
float View_DepthOfFieldFocalLength;
float View_DepthOfFieldFocalRegion;
float View_DepthOfFieldNearTransitionRegion;
float View_DepthOfFieldFarTransitionRegion;
float View_MotionBlurNormalizedToPixel;
float View_bSubsurfacePostprocessEnabled;
float View_GeneralPurposeTweak;
float View_DemosaicVposOffset;
float PrePadding_View_2412;
packed_float3 View_IndirectLightingColorScale;
float View_HDR32bppEncodingMode;
packed_float3 View_AtmosphericFogSunDirection;
float View_AtmosphericFogSunPower;
float View_AtmosphericFogPower;
float View_AtmosphericFogDensityScale;
float View_AtmosphericFogDensityOffset;
float View_AtmosphericFogGroundOffset;
float View_AtmosphericFogDistanceScale;
float View_AtmosphericFogAltitudeScale;
float View_AtmosphericFogHeightScaleRayleigh;
float View_AtmosphericFogStartDistance;
float View_AtmosphericFogDistanceOffset;
float View_AtmosphericFogSunDiscScale;
float View_AtmosphericFogSunDiscHalfApexAngleRadian;
float PrePadding_View_2492;
float4 View_AtmosphericFogSunDiscLuminance;
uint View_AtmosphericFogRenderMask;
uint View_AtmosphericFogInscatterAltitudeSampleNum;
uint PrePadding_View_2520;
uint PrePadding_View_2524;
float4 View_AtmosphericFogSunColor;
packed_float3 View_NormalCurvatureToRoughnessScaleBias;
float View_RenderingReflectionCaptureMask;
float4 View_AmbientCubemapTint;
float View_AmbientCubemapIntensity;
float View_SkyLightParameters;
float PrePadding_View_2584;
float PrePadding_View_2588;
float4 View_SkyLightColor;
float4 View_SkyIrradianceEnvironmentMap[7];
float View_MobilePreviewMode;
float View_HMDEyePaddingOffset;
float View_ReflectionCubemapMaxMip;
float View_ShowDecalsMask;
uint View_DistanceFieldAOSpecularOcclusionMode;
float View_IndirectCapsuleSelfShadowingIntensity;
float PrePadding_View_2744;
float PrePadding_View_2748;
packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
int View_StereoPassIndex;
float4 View_GlobalVolumeCenterAndExtent[4];
float4 View_GlobalVolumeWorldToUVAddAndMul[4];
float View_GlobalVolumeDimension;
float View_GlobalVolumeTexelSize;
float View_MaxGlobalDistance;
float PrePadding_View_2908;
int2 View_CursorPosition;
float View_bCheckerboardSubsurfaceProfileRendering;
float PrePadding_View_2924;
packed_float3 View_VolumetricFogInvGridSize;
float PrePadding_View_2940;
packed_float3 View_VolumetricFogGridZParams;
float PrePadding_View_2956;
float2 View_VolumetricFogSVPosToVolumeUV;
float View_VolumetricFogMaxDistance;
float PrePadding_View_2972;
packed_float3 View_VolumetricLightmapWorldToUVScale;
float PrePadding_View_2988;
packed_float3 View_VolumetricLightmapWorldToUVAdd;
float PrePadding_View_3004;
packed_float3 View_VolumetricLightmapIndirectionTextureSize;
float View_VolumetricLightmapBrickSize;
packed_float3 View_VolumetricLightmapBrickTexelSize;
float View_StereoIPD;
float View_IndirectLightingCacheShowFlag;
float View_EyeToPixelSpreadAngle;
float PrePadding_View_3048;
float PrePadding_View_3052;
float4x4 View_WorldToVirtualTexture;
float4 View_VirtualTextureParams;
float4 View_XRPassthroughCameraUVs[2];
};
constant float4 _68 = {};
struct main0_out
{
float4 out_var_TEXCOORD10_centroid [[user(locn0)]];
float4 out_var_TEXCOORD11_centroid [[user(locn1)]];
float4 out_var_TEXCOORD0_0 [[user(locn2)]];
float4 out_var_COLOR1 [[user(locn3)]];
float4 out_var_COLOR2 [[user(locn4)]];
float4 out_var_TEXCOORD6 [[user(locn5)]];
float3 out_var_TEXCOORD7 [[user(locn6)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float4 in_var_COLOR1 [[attribute(0)]];
float4 in_var_COLOR2 [[attribute(1)]];
float4 in_var_TEXCOORD0_0 [[attribute(5)]];
float4 in_var_TEXCOORD10_centroid [[attribute(6)]];
float4 in_var_TEXCOORD11_centroid [[attribute(7)]];
float3 in_var_TEXCOORD7 [[attribute(8)]];
float4 in_var_VS_To_DS_Position [[attribute(9)]];
};
struct main0_patchIn
{
patch_control_point<main0_in> gl_in;
};
[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], constant type_View& View [[buffer(0)]], float3 gl_TessCoord [[position_in_patch]])
{
main0_out out = {};
spvUnsafeArray<float4, 1> out_var_TEXCOORD0 = {};
spvUnsafeArray<float4, 3> _77 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD10_centroid, patchIn.gl_in[1].in_var_TEXCOORD10_centroid, patchIn.gl_in[2].in_var_TEXCOORD10_centroid });
spvUnsafeArray<float4, 3> _78 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD11_centroid, patchIn.gl_in[1].in_var_TEXCOORD11_centroid, patchIn.gl_in[2].in_var_TEXCOORD11_centroid });
spvUnsafeArray<spvUnsafeArray<float4, 1>, 3> _79 = spvUnsafeArray<spvUnsafeArray<float4, 1>, 3>({ spvUnsafeArray<float4, 1>({ patchIn.gl_in[0].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ patchIn.gl_in[1].in_var_TEXCOORD0_0 }), spvUnsafeArray<float4, 1>({ patchIn.gl_in[2].in_var_TEXCOORD0_0 }) });
spvUnsafeArray<float4, 3> _80 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_COLOR1, patchIn.gl_in[1].in_var_COLOR1, patchIn.gl_in[2].in_var_COLOR1 });
spvUnsafeArray<float4, 3> _81 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_COLOR2, patchIn.gl_in[1].in_var_COLOR2, patchIn.gl_in[2].in_var_COLOR2 });
spvUnsafeArray<float4, 3> _97 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_VS_To_DS_Position, patchIn.gl_in[1].in_var_VS_To_DS_Position, patchIn.gl_in[2].in_var_VS_To_DS_Position });
spvUnsafeArray<float3, 3> _98 = spvUnsafeArray<float3, 3>({ patchIn.gl_in[0].in_var_TEXCOORD7, patchIn.gl_in[1].in_var_TEXCOORD7, patchIn.gl_in[2].in_var_TEXCOORD7 });
float4 _111 = float4(gl_TessCoord.x);
float4 _113 = float4(gl_TessCoord.y);
float4 _116 = float4(gl_TessCoord.z);
float4 _118 = ((_97[0] * _111) + (_97[1] * _113)) + (_97[2] * _116);
spvUnsafeArray<float4, 1> _72;
_72 = _79[0];
spvUnsafeArray<float4, 1> _71;
_71 = _79[1];
float3 _120 = float3(gl_TessCoord.x);
float3 _123 = float3(gl_TessCoord.y);
spvUnsafeArray<float4, 1> _73;
for (int _133 = 0; _133 < 1; )
{
_73[_133] = (_72[_133] * _111) + (_71[_133] * _113);
_133++;
continue;
}
spvUnsafeArray<float4, 1> _75;
_75 = _73;
spvUnsafeArray<float4, 1> _74;
_74 = _79[2];
float3 _155 = float3(gl_TessCoord.z);
float3 _157 = ((_77[0].xyz * _120) + (_77[1].xyz * _123)).xyz + (_77[2].xyz * _155);
spvUnsafeArray<float4, 1> _76;
for (int _164 = 0; _164 < 1; )
{
_76[_164] = _75[_164] + (_74[_164] * _116);
_164++;
continue;
}
float4 _181 = float4(_118.x, _118.y, _118.z, _118.w);
out.out_var_TEXCOORD10_centroid = float4(_157.x, _157.y, _157.z, _68.w);
out.out_var_TEXCOORD11_centroid = ((_78[0] * _111) + (_78[1] * _113)) + (_78[2] * _116);
out_var_TEXCOORD0 = _76;
out.out_var_COLOR1 = ((_80[0] * _111) + (_80[1] * _113)) + (_80[2] * _116);
out.out_var_COLOR2 = ((_81[0] * _111) + (_81[1] * _113)) + (_81[2] * _116);
out.out_var_TEXCOORD6 = _181;
out.out_var_TEXCOORD7 = ((_98[0] * _120) + (_98[1] * _123)) + (_98[2] * _155);
out.gl_Position = View.View_TranslatedWorldToClip * _181;
out.out_var_TEXCOORD0_0 = out_var_TEXCOORD0[0];
return out;
}
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.component.sip;
import java.util.Properties;
import javax.sip.ClientTransaction;
import javax.sip.Dialog;
import javax.sip.ListeningPoint;
import javax.sip.SipProvider;
import javax.sip.SipStack;
import javax.sip.message.Request;
import org.apache.camel.Processor;
import org.apache.camel.component.sip.listener.SipSubscriptionListener;
import org.apache.camel.support.DefaultConsumer;
public class SipSubscriber extends DefaultConsumer {
private SipConfiguration configuration;
private SipSubscriptionListener sipSubscriptionListener;
private SipProvider provider;
private Dialog subscriberDialog;
private SipStack sipStack;
public SipSubscriber(SipEndpoint sipEndpoint, Processor processor, SipConfiguration configuration) {
super(sipEndpoint, processor);
this.configuration = configuration;
this.configuration.setConsumer(true);
}
@Override
protected void doStart() throws Exception {
super.doStart();
Properties properties = configuration.createInitialProperties();
sipStack = configuration.getSipFactory().createSipStack(properties);
configuration.parseURI();
sipSubscriptionListener = new SipSubscriptionListener(this);
ListeningPoint listeningPoint = sipStack.createListeningPoint(configuration.getFromHost(),
Integer.valueOf(configuration.getFromPort()).intValue(), configuration.getTransport());
configuration.setListeningPoint(listeningPoint);
provider = sipStack.createSipProvider(configuration.getListeningPoint());
provider.addSipListener(sipSubscriptionListener);
if (configuration.getCallIdHeader() == null) {
configuration.setCallIdHeader(provider.getNewCallId());
}
// Create the Subscription request to register with the presence agent and receive notifications.
configuration.setCallIdHeader(provider.getNewCallId());
Request request = configuration.createSipRequest(1, Request.SUBSCRIBE, configuration.getEventHeaderName());
// Create the subscriber transaction from request.
ClientTransaction subscriberTransactionId = provider.getNewClientTransaction(request);
// Add an Event header for the subscription.
request.addHeader(configuration.getEventHeader());
subscriberDialog = subscriberTransactionId.getDialog();
// Send the outgoing subscription request.
subscriberTransactionId.sendRequest();
}
@Override
protected void doStop() throws Exception {
super.doStop();
}
public SipConfiguration getConfiguration() {
return configuration;
}
public void setConfiguration(SipConfiguration configuration) {
this.configuration = configuration;
}
public void setSipSubscriptionListener(SipSubscriptionListener sipSubscriptionListener) {
this.sipSubscriptionListener = sipSubscriptionListener;
}
public SipSubscriptionListener getSipSubscriptionListener() {
return sipSubscriptionListener;
}
public void setSipStack(SipStack sipStack) {
this.sipStack = sipStack;
}
public SipStack getSipStack() {
return sipStack;
}
public SipProvider getProvider() {
return provider;
}
public void setProvider(SipProvider provider) {
this.provider = provider;
}
public Dialog getSubscriberDialog() {
return subscriberDialog;
}
}
|
{
"pile_set_name": "Github"
}
|
if ##|operation()##|:
print "success!"
##r
extracted_variable = operation()
if extracted_variable:
print "success!"
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.spark.sql.catalyst.expressions.aggregate
import org.apache.spark.sql.catalyst.analysis.TypeCheckResult
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.util.TypeUtils
import org.apache.spark.sql.types._
@ExpressionDescription(
usage = "_FUNC_(expr) - Returns the minimum value of `expr`.")
case class Min(child: Expression) extends DeclarativeAggregate {
override def children: Seq[Expression] = child :: Nil
override def nullable: Boolean = true
// Return data type.
override def dataType: DataType = child.dataType
// Expected input data type.
override def inputTypes: Seq[AbstractDataType] = Seq(AnyDataType)
override def checkInputDataTypes(): TypeCheckResult =
TypeUtils.checkForOrderingExpr(child.dataType, "function min")
private lazy val min = AttributeReference("min", child.dataType)()
override lazy val aggBufferAttributes: Seq[AttributeReference] = min :: Nil
override lazy val initialValues: Seq[Expression] = Seq(
/* min = */ Literal.create(null, child.dataType)
)
override lazy val updateExpressions: Seq[Expression] = Seq(
/* min = */ Least(Seq(min, child))
)
override lazy val mergeExpressions: Seq[Expression] = {
Seq(
/* min = */ Least(Seq(min.left, min.right))
)
}
override lazy val evaluateExpression: AttributeReference = min
}
|
{
"pile_set_name": "Github"
}
|
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
|
{
"pile_set_name": "Github"
}
|
/*
* w1_ds2431.c - w1 family 2d (DS2431) driver
*
* Copyright (c) 2008 Bernhard Weirich <bernhard.weirich@riedel.net>
*
* Heavily inspired by w1_DS2433 driver from Ben Gardner <bgardner@wabtec.com>
*
* This source code is licensed under the GNU General Public License,
* Version 2. See the file COPYING for more details.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/device.h>
#include <linux/types.h>
#include <linux/delay.h>
#include "../w1.h"
#include "../w1_int.h"
#include "../w1_family.h"
#define W1_F2D_EEPROM_SIZE 128
#define W1_F2D_PAGE_COUNT 4
#define W1_F2D_PAGE_BITS 5
#define W1_F2D_PAGE_SIZE (1<<W1_F2D_PAGE_BITS)
#define W1_F2D_PAGE_MASK 0x1F
#define W1_F2D_SCRATCH_BITS 3
#define W1_F2D_SCRATCH_SIZE (1<<W1_F2D_SCRATCH_BITS)
#define W1_F2D_SCRATCH_MASK (W1_F2D_SCRATCH_SIZE-1)
#define W1_F2D_READ_EEPROM 0xF0
#define W1_F2D_WRITE_SCRATCH 0x0F
#define W1_F2D_READ_SCRATCH 0xAA
#define W1_F2D_COPY_SCRATCH 0x55
#define W1_F2D_TPROG_MS 11
#define W1_F2D_READ_RETRIES 10
#define W1_F2D_READ_MAXLEN 8
char color = 'E';
/*
* Check the file size bounds and adjusts count as needed.
* This would not be needed if the file size didn't reset to 0 after a write.
*/
static inline size_t w1_f2d_fix_count(loff_t off, size_t count, size_t size)
{
if (off > size)
return 0;
if ((off + count) > size)
return size - off;
return count;
}
/*
* Read a block from W1 ROM two times and compares the results.
* If they are equal they are returned, otherwise the read
* is repeated W1_F2D_READ_RETRIES times.
*
* count must not exceed W1_F2D_READ_MAXLEN.
*/
static int w1_f2d_readblock(struct w1_slave *sl, int off, int count, char *buf)
{
u8 wrbuf[3];
u8 cmp[W1_F2D_READ_MAXLEN];
int tries = W1_F2D_READ_RETRIES;
do {
wrbuf[0] = W1_F2D_READ_EEPROM;
wrbuf[1] = off & 0xff;
wrbuf[2] = off >> 8;
if (w1_reset_select_slave(sl))
return -1;
w1_write_block(sl->master, wrbuf, 3);
w1_read_block(sl->master, buf, count);
if (w1_reset_select_slave(sl))
return -1;
w1_write_block(sl->master, wrbuf, 3);
w1_read_block(sl->master, cmp, count);
if (!memcmp(cmp, buf, count))
return 0;
} while (--tries);
dev_err(&sl->dev, "proof reading failed %d times\n",
W1_F2D_READ_RETRIES);
return -1;
}
static ssize_t w1_f2d_read_bin(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{
struct w1_slave *sl = kobj_to_w1_slave(kobj);
int todo = count;
count = w1_f2d_fix_count(off, count, W1_F2D_EEPROM_SIZE);
if (count == 0)
return 0;
mutex_lock(&sl->master->mutex);
/* read directly from the EEPROM in chunks of W1_F2D_READ_MAXLEN */
while (todo > 0) {
int block_read;
if (todo >= W1_F2D_READ_MAXLEN)
block_read = W1_F2D_READ_MAXLEN;
else
block_read = todo;
if (w1_f2d_readblock(sl, off, block_read, buf) < 0)
count = -EIO;
todo -= W1_F2D_READ_MAXLEN;
buf += W1_F2D_READ_MAXLEN;
off += W1_F2D_READ_MAXLEN;
}
mutex_unlock(&sl->master->mutex);
return count;
}
static ssize_t w1_slave_attribute_show_color(struct device *dev, struct device_attribute *attr, char *buf)
{
struct w1_slave *sl = dev_to_w1_slave(dev);
int i = 0;
ssize_t count;
char data_buf[25]={0},tmp;
data_buf[1]=0xAA;
if(color == 'E'){
if (w1_f2d_readblock(sl, 0, 8, data_buf) < 0){
}
for(; i <8 ;i++)
printk("%02x ",data_buf[i]);
#if 0
if (w1_f2d_readblock(sl, 8, 8, data_buf+8) < 0){
count = -EIO;
printk("lgy w1_slave_attribute_show_data \n");
}
for(i=8; i <16 ;i++)
printk("%02x ",data_buf[i]);
if (w1_f2d_readblock(sl, 16, 8, data_buf+16) < 0){
count = -EIO;
printk("lgy w1_slave_attribute_show_data \n");
}
for(i=16; i <24 ;i++)
printk("%02x ",data_buf[i]);
#endif
printk("\n");
//only "0~9"
tmp = data_buf[1]%16+0x30;
if((tmp >= '0' && tmp <= '9'))
color = tmp;
else
color = 'E';
}
count = sprintf(buf, "%c\n", color);
return count;
}
#define W1_SLAVE_ATTR_RO(_name, _mode) \
struct device_attribute w1_slave_attribute_##_name = \
__ATTR(w1_slave_##_name, _mode, \
w1_slave_attribute_show_##_name, NULL)
static W1_SLAVE_ATTR_RO(color, S_IRUGO);
static struct attribute *w1_slave_default_attrs[] = {
&w1_slave_attribute_color.attr,
NULL
};
static struct attribute_group w1_slave_defattr_group = {
.attrs = w1_slave_default_attrs,
};
int w1_create_slave_attributes(struct w1_slave *slave)
{
return sysfs_create_group(&slave->dev.kobj, &w1_slave_defattr_group);
}
void w1_destroy_slave_attributes(struct w1_slave *slave)
{
color = 'E';
sysfs_remove_group(&slave->dev.kobj, &w1_slave_defattr_group);
}
/*
* Writes to the scratchpad and reads it back for verification.
* Then copies the scratchpad to EEPROM.
* The data must be aligned at W1_F2D_SCRATCH_SIZE bytes and
* must be W1_F2D_SCRATCH_SIZE bytes long.
* The master must be locked.
*
* @param sl The slave structure
* @param addr Address for the write
* @param len length must be <= (W1_F2D_PAGE_SIZE - (addr & W1_F2D_PAGE_MASK))
* @param data The data to write
* @return 0=Success -1=failure
*/
static int w1_f2d_write(struct w1_slave *sl, int addr, int len, const u8 *data)
{
int tries = W1_F2D_READ_RETRIES;
u8 wrbuf[4];
u8 rdbuf[W1_F2D_SCRATCH_SIZE + 3];
u8 es = (addr + len - 1) % W1_F2D_SCRATCH_SIZE;
retry:
/* Write the data to the scratchpad */
if (w1_reset_select_slave(sl))
return -1;
wrbuf[0] = W1_F2D_WRITE_SCRATCH;
wrbuf[1] = addr & 0xff;
wrbuf[2] = addr >> 8;
w1_write_block(sl->master, wrbuf, 3);
w1_write_block(sl->master, data, len);
/* Read the scratchpad and verify */
if (w1_reset_select_slave(sl))
return -1;
w1_write_8(sl->master, W1_F2D_READ_SCRATCH);
w1_read_block(sl->master, rdbuf, len + 3);
/* Compare what was read against the data written */
if ((rdbuf[0] != wrbuf[1]) || (rdbuf[1] != wrbuf[2]) ||
(rdbuf[2] != es) || (memcmp(data, &rdbuf[3], len) != 0)) {
if (--tries)
goto retry;
dev_err(&sl->dev,
"could not write to eeprom, scratchpad compare failed %d times\n",
W1_F2D_READ_RETRIES);
return -1;
}
/* Copy the scratchpad to EEPROM */
if (w1_reset_select_slave(sl))
return -1;
wrbuf[0] = W1_F2D_COPY_SCRATCH;
wrbuf[3] = es;
w1_write_block(sl->master, wrbuf, 4);
/* Sleep for tprog ms to wait for the write to complete */
msleep(W1_F2D_TPROG_MS);
/* Reset the bus to wake up the EEPROM */
w1_reset_bus(sl->master);
return 0;
}
static ssize_t w1_f2d_write_bin(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{
struct w1_slave *sl = kobj_to_w1_slave(kobj);
int addr, len;
int copy;
count = w1_f2d_fix_count(off, count, W1_F2D_EEPROM_SIZE);
if (count == 0)
return 0;
mutex_lock(&sl->master->mutex);
/* Can only write data in blocks of the size of the scratchpad */
addr = off;
len = count;
while (len > 0) {
/* if len too short or addr not aligned */
if (len < W1_F2D_SCRATCH_SIZE || addr & W1_F2D_SCRATCH_MASK) {
char tmp[W1_F2D_SCRATCH_SIZE];
/* read the block and update the parts to be written */
if (w1_f2d_readblock(sl, addr & ~W1_F2D_SCRATCH_MASK,
W1_F2D_SCRATCH_SIZE, tmp)) {
count = -EIO;
goto out_up;
}
/* copy at most to the boundary of the PAGE or len */
copy = W1_F2D_SCRATCH_SIZE -
(addr & W1_F2D_SCRATCH_MASK);
if (copy > len)
copy = len;
memcpy(&tmp[addr & W1_F2D_SCRATCH_MASK], buf, copy);
if (w1_f2d_write(sl, addr & ~W1_F2D_SCRATCH_MASK,
W1_F2D_SCRATCH_SIZE, tmp) < 0) {
count = -EIO;
goto out_up;
}
} else {
copy = W1_F2D_SCRATCH_SIZE;
if (w1_f2d_write(sl, addr, copy, buf) < 0) {
count = -EIO;
goto out_up;
}
}
buf += copy;
addr += copy;
len -= copy;
}
out_up:
mutex_unlock(&sl->master->mutex);
return count;
}
static struct bin_attribute w1_f2d_bin_attr = {
.attr = {
.name = "eeprom",
.mode = S_IRUGO | S_IWUSR,
},
.size = W1_F2D_EEPROM_SIZE,
.read = w1_f2d_read_bin,
.write = w1_f2d_write_bin,
};
static int w1_f2d_add_slave(struct w1_slave *sl)
{
//printk("[DYC] w1_f2d_add_slave\n");
w1_create_slave_attributes(sl);
return sysfs_create_bin_file(&sl->dev.kobj, &w1_f2d_bin_attr);
}
static void w1_f2d_remove_slave(struct w1_slave *sl)
{
w1_destroy_slave_attributes(sl);
sysfs_remove_bin_file(&sl->dev.kobj, &w1_f2d_bin_attr);
}
static struct w1_family_ops w1_f2d_fops = {
.add_slave = w1_f2d_add_slave,
.remove_slave = w1_f2d_remove_slave,
};
static struct w1_family w1_family_2d = {
.fid = W1_EEPROM_DS2431,
.fops = &w1_f2d_fops,
};
static int __init w1_f2d_init(void)
{
//printk("[DYC] w1_ds2431 w1_register_family\n");
return w1_register_family(&w1_family_2d);
}
static void __exit w1_f2d_fini(void)
{
w1_unregister_family(&w1_family_2d);
}
module_init(w1_f2d_init);
module_exit(w1_f2d_fini);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Bernhard Weirich <bernhard.weirich@riedel.net>");
MODULE_DESCRIPTION("w1 family 2d driver for DS2431, 1kb EEPROM");
|
{
"pile_set_name": "Github"
}
|
/***************************************************************************
qgsserverlogger.h
-----------------
begin : May 5, 2014
copyright : (C) 2014 by Marco Hugentobler
email : marco dot hugentobler at sourcepole dot ch
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef QGSSERVERLOGGER_H
#define QGSSERVERLOGGER_H
#include "qgsmessagelog.h"
#include <QFile>
#include <QObject>
#include <QString>
#include <QTextStream>
#include "qgis_server.h"
/**
* \ingroup server
* \brief Writes message log into server logfile
* \since QGIS 2.8
*/
class SERVER_EXPORT QgsServerLogger : public QgsMessageLogConsole
{
Q_OBJECT
public:
/**
* Gets the singleton instance
*/
static QgsServerLogger *instance();
/**
* Gets the current log level
* \returns the log level
* \since QGIS 3.0
*/
Qgis::MessageLevel logLevel() const { return mLogLevel; }
/**
* Set the current log level
* \param level the log level
* \since QGIS 3.0
*/
void setLogLevel( Qgis::MessageLevel level );
/**
* Set the current log file
*/
void setLogFile( const QString &filename = QString() );
/**
* Activates logging to stderr.
* \since QGIS 3.4
*/
void setLogStderr();
public slots:
/**
* Log a message from the server context
*
* \param message the message
* \param tag tag of the message
* \param level log level of the message
*/
void logMessage( const QString &message, const QString &tag, Qgis::MessageLevel level ) override;
protected:
QgsServerLogger();
private:
static QgsServerLogger *sInstance;
QFile mLogFile;
bool mLogStderr = false;
QTextStream mTextStream;
Qgis::MessageLevel mLogLevel = Qgis::None;
};
#endif // QGSSERVERLOGGER_H
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Objective Chipmunk: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>ChipmunkRatchetJoint Member List</h1> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="interface_chipmunk_ratchet_joint.html">ChipmunkRatchetJoint</a>, including all inherited members.<table>
<tr bgcolor="#f0f0f0"><td>- </td><td><b>addToSpace:</b> (defined in <a class="el" href="protocol_chipmunk_base_object-p.html"><ChipmunkBaseObject></a>)</td><td><a class="el" href="protocol_chipmunk_base_object-p.html"><ChipmunkBaseObject></a></td><td></td></tr>
<tr class="memlist"><td></td><td><a class="el" href="interface_chipmunk_ratchet_joint.html#a423f5b8859a5cb31c2ae973be2b66f6e">angle</a></td><td><a class="el" href="interface_chipmunk_ratchet_joint.html">ChipmunkRatchetJoint</a></td><td></td></tr>
<tr class="memlist"><td></td><td><a class="el" href="interface_chipmunk_constraint.html#a8e639de970eba3b86c58bbe9fabe9016">biasCoef</a></td><td><a class="el" href="interface_chipmunk_constraint.html">ChipmunkConstraint</a></td><td></td></tr>
<tr class="memlist"><td></td><td><a class="el" href="interface_chipmunk_constraint.html#aae60654a9744d40d272c77d41a781203">bodyA</a></td><td><a class="el" href="interface_chipmunk_constraint.html">ChipmunkConstraint</a></td><td></td></tr>
<tr class="memlist"><td></td><td><a class="el" href="interface_chipmunk_constraint.html#ab3b008f612c712a3dce2e48c1a32f0c5">bodyB</a></td><td><a class="el" href="interface_chipmunk_constraint.html">ChipmunkConstraint</a></td><td></td></tr>
<tr class="memlist"><td>- </td><td><a class="el" href="protocol_chipmunk_object-p.html#a2307fc572cad7a49a9ed0fdfa63a92d7">chipmunkObjects</a></td><td><a class="el" href="protocol_chipmunk_object-p.html"><ChipmunkObject></a></td><td></td></tr>
<tr class="memlist"><td></td><td><a class="el" href="interface_chipmunk_constraint.html#a78ffbfb6a51f7742b9c084abca8778f0">constraint</a></td><td><a class="el" href="interface_chipmunk_constraint.html">ChipmunkConstraint</a></td><td></td></tr>
<tr class="memlist"><td></td><td><a class="el" href="interface_chipmunk_constraint.html#a0dc9b49b787eab446b58e2dc94680f2a">data</a></td><td><a class="el" href="interface_chipmunk_constraint.html">ChipmunkConstraint</a></td><td></td></tr>
<tr class="memlist"><td>- </td><td><a class="el" href="interface_chipmunk_ratchet_joint.html#a1ad7e86368d09483f47296c16501498e">initWithBodyA:bodyB:phase:ratchet:</a></td><td><a class="el" href="interface_chipmunk_ratchet_joint.html">ChipmunkRatchetJoint</a></td><td></td></tr>
<tr class="memlist"><td></td><td><a class="el" href="interface_chipmunk_constraint.html#a45acd3f4ab2c7633167a55280ab60042">maxBias</a></td><td><a class="el" href="interface_chipmunk_constraint.html">ChipmunkConstraint</a></td><td></td></tr>
<tr class="memlist"><td></td><td><a class="el" href="interface_chipmunk_constraint.html#ad6294d2fd2c320f9a1912c48464860f0">maxForce</a></td><td><a class="el" href="interface_chipmunk_constraint.html">ChipmunkConstraint</a></td><td></td></tr>
<tr class="memlist"><td></td><td><a class="el" href="interface_chipmunk_ratchet_joint.html#a886382c2bc6686836cfab67c173e09f1">phase</a></td><td><a class="el" href="interface_chipmunk_ratchet_joint.html">ChipmunkRatchetJoint</a></td><td></td></tr>
<tr class="memlist"><td></td><td><a class="el" href="interface_chipmunk_ratchet_joint.html#a3b44ef314fc0675509b4742a7042fb3f">ratchet</a></td><td><a class="el" href="interface_chipmunk_ratchet_joint.html">ChipmunkRatchetJoint</a></td><td></td></tr>
<tr class="memlist"><td>+ </td><td><a class="el" href="interface_chipmunk_ratchet_joint.html#ae1a4310cfd19857f0155944e700540ca">ratchetJointWithBodyA:bodyB:phase:ratchet:</a></td><td><a class="el" href="interface_chipmunk_ratchet_joint.html">ChipmunkRatchetJoint</a></td><td><code> [static]</code></td></tr>
<tr bgcolor="#f0f0f0"><td>- </td><td><b>removeFromSpace:</b> (defined in <a class="el" href="protocol_chipmunk_base_object-p.html"><ChipmunkBaseObject></a>)</td><td><a class="el" href="protocol_chipmunk_base_object-p.html"><ChipmunkBaseObject></a></td><td></td></tr>
</table></div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Properties</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Mon Dec 13 2010 18:43:39 for Objective Chipmunk by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
<?php
namespace Flynt\Components\BlockNotFound;
use Flynt\Utils\Options;
Options::addTranslatable('BlockNotFound', [
[
'label' => __('General', 'flynt'),
'name' => 'general',
'type' => 'tab',
'placement' => 'top',
'endpoint' => 0,
],
[
'label' => __('Content', 'flynt'),
'name' => 'contentHtml',
'instructions' => __('Content to be displayed on the 404 Not Found Page', 'flynt'),
'type' => 'wysiwyg',
'media_upload' => 0,
'default_value' => '<h1>Not Found</h1><p>The page you are looking for does not exist.</p>',
'required' => 1,
'delay' => 1,
],
[
'label' => __('Back to Homepage Label', 'flynt'),
'name' => 'backLinkLabel',
'instructions' => __('Leave empty to remove back to home link below the content area.', 'flynt'),
'type' => 'text',
'default_value' => 'Back to homepage'
]
]);
|
{
"pile_set_name": "Github"
}
|
/*
Copyright 2014 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 recognizer
import (
"bufio"
"bytes"
"fmt"
"io"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
type RecognizingDecoder interface {
runtime.Decoder
// RecognizesData should return true if the input provided in the provided reader
// belongs to this decoder, or an error if the data could not be read or is ambiguous.
// Unknown is true if the data could not be determined to match the decoder type.
// Decoders should assume that they can read as much of peek as they need (as the caller
// provides) and may return unknown if the data provided is not sufficient to make a
// a determination. When peek returns EOF that may mean the end of the input or the
// end of buffered input - recognizers should return the best guess at that time.
RecognizesData(peek io.Reader) (ok, unknown bool, err error)
}
// NewDecoder creates a decoder that will attempt multiple decoders in an order defined
// by:
//
// 1. The decoder implements RecognizingDecoder and identifies the data
// 2. All other decoders, and any decoder that returned true for unknown.
//
// The order passed to the constructor is preserved within those priorities.
func NewDecoder(decoders ...runtime.Decoder) runtime.Decoder {
return &decoder{
decoders: decoders,
}
}
type decoder struct {
decoders []runtime.Decoder
}
var _ RecognizingDecoder = &decoder{}
func (d *decoder) RecognizesData(peek io.Reader) (bool, bool, error) {
var (
lastErr error
anyUnknown bool
)
data, _ := bufio.NewReaderSize(peek, 1024).Peek(1024)
for _, r := range d.decoders {
switch t := r.(type) {
case RecognizingDecoder:
ok, unknown, err := t.RecognizesData(bytes.NewBuffer(data))
if err != nil {
lastErr = err
continue
}
anyUnknown = anyUnknown || unknown
if !ok {
continue
}
return true, false, nil
}
}
return false, anyUnknown, lastErr
}
func (d *decoder) Decode(data []byte, gvk *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) {
var (
lastErr error
skipped []runtime.Decoder
)
// try recognizers, record any decoders we need to give a chance later
for _, r := range d.decoders {
switch t := r.(type) {
case RecognizingDecoder:
buf := bytes.NewBuffer(data)
ok, unknown, err := t.RecognizesData(buf)
if err != nil {
lastErr = err
continue
}
if unknown {
skipped = append(skipped, t)
continue
}
if !ok {
continue
}
return r.Decode(data, gvk, into)
default:
skipped = append(skipped, t)
}
}
// try recognizers that returned unknown or didn't recognize their data
for _, r := range skipped {
out, actual, err := r.Decode(data, gvk, into)
if err != nil {
lastErr = err
continue
}
return out, actual, nil
}
if lastErr == nil {
lastErr = fmt.Errorf("no serialization format matched the provided data")
}
return nil, nil, lastErr
}
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Data;
namespace ServiceStack.OrmLite.Dapper
{
public static partial class SqlMapper
{
/// <summary>
/// Base-class for simple type-handlers
/// </summary>
/// <typeparam name="T">This <see cref="Type"/> this handler is for.</typeparam>
public abstract class TypeHandler<T> : ITypeHandler
{
/// <summary>
/// Assign the value of a parameter before a command executes
/// </summary>
/// <param name="parameter">The parameter to configure</param>
/// <param name="value">Parameter value</param>
public abstract void SetValue(IDbDataParameter parameter, T value);
/// <summary>
/// Parse a database value back to a typed value
/// </summary>
/// <param name="value">The value from the database</param>
/// <returns>The typed value</returns>
public abstract T Parse(object value);
void ITypeHandler.SetValue(IDbDataParameter parameter, object value)
{
if (value is DBNull)
{
parameter.Value = value;
}
else
{
SetValue(parameter, (T)value);
}
}
object ITypeHandler.Parse(Type destinationType, object value)
{
return Parse(value);
}
}
/// <summary>
/// Base-class for simple type-handlers that are based around strings
/// </summary>
/// <typeparam name="T">This <see cref="Type"/> this handler is for.</typeparam>
public abstract class StringTypeHandler<T> : TypeHandler<T>
{
/// <summary>
/// Parse a string into the expected type (the string will never be null)
/// </summary>
/// <param name="xml">The string to parse.</param>
protected abstract T Parse(string xml);
/// <summary>
/// Format an instace into a string (the instance will never be null)
/// </summary>
/// <param name="xml">The string to format.</param>
protected abstract string Format(T xml);
/// <summary>
/// Assign the value of a parameter before a command executes
/// </summary>
/// <param name="parameter">The parameter to configure</param>
/// <param name="value">Parameter value</param>
public override void SetValue(IDbDataParameter parameter, T value)
{
parameter.Value = value == null ? (object)DBNull.Value : Format(value);
}
/// <summary>
/// Parse a database value back to a typed value
/// </summary>
/// <param name="value">The value from the database</param>
/// <returns>The typed value</returns>
public override T Parse(object value)
{
if (value == null || value is DBNull) return default(T);
return Parse((string)value);
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
/****************************************************************************
* MeshLab o o *
* An extendible mesh processor o o *
* _ O _ *
* Copyright(C) 2005, 2009 \/)\/ *
* Visual Computing Lab /\/| *
* ISTI - Italian National Research Council | *
* \ *
* All rights reserved. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 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 (http://www.gnu.org/licenses/gpl.txt) *
* for more details. *
* *
****************************************************************************/
#include "edit_fit_factory.h"
#include "editfit.h"
EditFitFactory::EditFitFactory()
{
editFit = new QAction(QIcon(":/images/icon_measure.png"),"Fitting Tool", this);
actionList << editFit;
foreach(QAction *editAction, actionList)
editAction->setCheckable(true);
}
//gets a list of actions available from this plugin
QList<QAction *> EditFitFactory::actions() const
{
return actionList;
}
//get the edit tool for the given action
MeshEditInterface* EditFitFactory::getMeshEditInterface(QAction *action)
{
if(action == editFit)
{
return new EditFitPlugin();
} else assert(0); //should never be asked for an action that isnt here
}
const QString getEditToolDescription(QAction *)
{
return EditFitPlugin::Info();
}
Q_EXPORT_PLUGIN(EditFitFactory)
|
{
"pile_set_name": "Github"
}
|
'use strict';
const get = require('lodash.get');
/*!
* Like `schema.path()`, except with a document, because impossible to
* determine path type without knowing the embedded discriminator key.
*/
module.exports = function getEmbeddedDiscriminatorPath(schema, update, filter, path) {
const parts = path.split('.');
let schematype = null;
let type = 'adhocOrUndefined';
filter = filter || {};
update = update || {};
for (let i = 0; i < parts.length; ++i) {
const subpath = parts.slice(0, i + 1).join('.').
replace(/\.\$\./i, '.0.').replace(/\.\$$/, '.0');
schematype = schema.path(subpath);
if (schematype == null) {
continue;
}
type = schema.pathType(subpath);
if ((schematype.$isSingleNested || schematype.$isMongooseDocumentArrayElement) &&
schematype.schema.discriminators != null) {
const discriminators = schematype.schema.discriminators;
const discriminatorValuePath = subpath + '.' +
get(schematype, 'schema.options.discriminatorKey');
const discriminatorFilterPath =
discriminatorValuePath.replace(/\.\d+\./, '.');
let discriminatorKey = null;
if (discriminatorValuePath in filter) {
discriminatorKey = filter[discriminatorValuePath];
}
if (discriminatorFilterPath in filter) {
discriminatorKey = filter[discriminatorFilterPath];
}
if (discriminatorKey == null || discriminators[discriminatorKey] == null) {
continue;
}
const rest = parts.slice(i + 1).join('.');
schematype = discriminators[discriminatorKey].path(rest);
if (schematype != null) {
type = discriminators[discriminatorKey]._getPathType(rest);
break;
}
}
}
return { type: type, schematype: schematype };
};
|
{
"pile_set_name": "Github"
}
|
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1
import (
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
// ConfigMapsGetter has a method to return a ConfigMapInterface.
// A group's client should implement this interface.
type ConfigMapsGetter interface {
ConfigMaps(namespace string) ConfigMapInterface
}
// ConfigMapInterface has methods to work with ConfigMap resources.
type ConfigMapInterface interface {
Create(*v1.ConfigMap) (*v1.ConfigMap, error)
Update(*v1.ConfigMap) (*v1.ConfigMap, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.ConfigMap, error)
List(opts metav1.ListOptions) (*v1.ConfigMapList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error)
ConfigMapExpansion
}
// configMaps implements ConfigMapInterface
type configMaps struct {
client rest.Interface
ns string
}
// newConfigMaps returns a ConfigMaps
func newConfigMaps(c *CoreV1Client, namespace string) *configMaps {
return &configMaps{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the configMap, and returns the corresponding configMap object, and an error if there is any.
func (c *configMaps) Get(name string, options metav1.GetOptions) (result *v1.ConfigMap, err error) {
result = &v1.ConfigMap{}
err = c.client.Get().
Namespace(c.ns).
Resource("configmaps").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of ConfigMaps that match those selectors.
func (c *configMaps) List(opts metav1.ListOptions) (result *v1.ConfigMapList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ConfigMapList{}
err = c.client.Get().
Namespace(c.ns).
Resource("configmaps").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested configMaps.
func (c *configMaps) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("configmaps").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any.
func (c *configMaps) Create(configMap *v1.ConfigMap) (result *v1.ConfigMap, err error) {
result = &v1.ConfigMap{}
err = c.client.Post().
Namespace(c.ns).
Resource("configmaps").
Body(configMap).
Do().
Into(result)
return
}
// Update takes the representation of a configMap and updates it. Returns the server's representation of the configMap, and an error, if there is any.
func (c *configMaps) Update(configMap *v1.ConfigMap) (result *v1.ConfigMap, err error) {
result = &v1.ConfigMap{}
err = c.client.Put().
Namespace(c.ns).
Resource("configmaps").
Name(configMap.Name).
Body(configMap).
Do().
Into(result)
return
}
// Delete takes name of the configMap and deletes it. Returns an error if one occurs.
func (c *configMaps) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("configmaps").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *configMaps) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("configmaps").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched configMap.
func (c *configMaps) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error) {
result = &v1.ConfigMap{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("configmaps").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
|
{
"pile_set_name": "Github"
}
|
/**
* @file main.cpp
*
* This template application shows how to extend the
* functionality in HTML5/JS with custom code in C++.
*/
#include <Wormhole/HybridMoblet.h>
#include "MAHeaders.h" // Defines BEEP_WAV
// Namespaces we want to access.
using namespace MAUtil;
using namespace NativeUI;
using namespace Wormhole;
/**
* The application class.
*/
class MyMoblet : public HybridMoblet
{
public:
MyMoblet()
{
// Show the start page.
showPage("index.html");
// Set the sound used by the PhoneGap beep notification API.
// BEEP_WAV is defined in file Resources/Resources.lst.
// Below we add our own beep message, to illustrate how to
// invoke custom C++ code from JavaScript. Do not confuse these
// two ways of playing a beep sound.
setBeepSound(BEEP_WAV);
// Register functions to handle custom messages sent
// from JavaScript.
addMessageFun(
"Vibrate",
(FunTable::MessageHandlerFun)&MyMoblet::vibrate);
addMessageFun(
"Beep",
(FunTable::MessageHandlerFun)&MyMoblet::beep);
}
void vibrate(Wormhole::MessageStream& message)
{
int duration = MAUtil::stringToInteger(message.getNext());
maVibrate(duration);
}
void beep(Wormhole::MessageStream& message)
{
// This is how to play a sound using MoSync API.
maSoundPlay(BEEP_WAV, 0, maGetDataSize(BEEP_WAV));
}
};
/**
* Main function that is called when the program starts.
* Here an instance of the MyMoblet class is created and
* the program enters the main event loop.
*/
extern "C" int MAMain()
{
(new MyMoblet())->enterEventLoop();
return 0;
}
|
{
"pile_set_name": "Github"
}
|
# Event 1634 - task_0
###### Version: 0
## Description
None
## Data Dictionary
|Standard Name|Field Name|Type|Description|Sample Value|
|---|---|---|---|---|
|TBD|dwValue|UInt32|None|`None`|
## Tags
* etw_level_Informational
* etw_task_task_0
|
{
"pile_set_name": "Github"
}
|
include(SipQtTargetFunctions)
set(COMMON_INC_DIR ${CMAKE_CURRENT_LIST_DIR}/../../widgets/common/inc)
set(COMMON_SIP_DIR ${CMAKE_CURRENT_LIST_DIR}/../common_sip)
set(
_header_depends
${COMMON_SIP_DIR}/SIPVector.h
${COMMON_SIP_DIR}/string.sip
${COMMON_SIP_DIR}/vector.sip
${COMMON_INC_DIR}/MantidQtWidgets/Common/AlgorithmDialog.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/Message.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/MessageDisplay.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/WorkspacePresenter/WorkspaceTreeWidget.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/HintStrategy.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/Hint.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/Batch/Row.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/Batch/RowLocation.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/Batch/JobTreeView.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/Batch/JobTreeViewSignalAdapter.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/InstrumentSelector.h)
list(APPEND common_link_libs
${CORE_MANTIDLIBS}
${POCO_LIBRARIES}
PythonInterfaceCore)
# Wrapper module linked against Qt4
if(ENABLE_MANTIDPLOT)
mtd_add_sip_module(MODULE_NAME _commonqt4
TARGET_NAME mantidqt_commonqt4
SIP_SRCS _common.sip
HEADER_DEPS
${_header_depends}
PYQT_VERSION 4
INCLUDE_DIRS
${CMAKE_CURRENT_LIST_DIR}
${COMMON_SIP_DIR}
LINK_LIBS
${common_link_libs}
MantidQtWidgetsCommonQt4
Qt4::QtCore
Qt4::QtGui
Qt4::Qscintilla
API
INSTALL_DIR
${SITE_PACKAGES}/mantidqt
LINUX_INSTALL_RPATH
"\$ORIGIN/.."
OSX_INSTALL_RPATH
"@loader_path/.."
FOLDER Qt4)
endif()
# Wrapper module linked against Qt5
if(ENABLE_WORKBENCH)
mtd_add_sip_module(MODULE_NAME _commonqt5
TARGET_NAME mantidqt_commonqt5
HEADER_DEPS
${_header_depends}
SIP_SRCS _common.sip
PYQT_VERSION 5
INCLUDE_DIRS
${CMAKE_CURRENT_LIST_DIR}
${COMMON_SIP_DIR}
LINK_LIBS
MantidQtWidgetsCommonQt5
${common_link_libs}
Qt5::Core
Qt5::Widgets
Qt5::Gui
Qt5::Qscintilla
API
INSTALL_DIR
${WORKBENCH_SITE_PACKAGES}/mantidqt
LINUX_INSTALL_RPATH
"\$ORIGIN/.."
OSX_INSTALL_RPATH
"@loader_path/.."
FOLDER Qt5)
endif()
add_subdirectory(icons)
add_subdirectory(widgets/instrumentview)
|
{
"pile_set_name": "Github"
}
|
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2016 Rasmus Munk Larsen (rmlarsen@google.com)
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_CONDITIONESTIMATOR_H
#define EIGEN_CONDITIONESTIMATOR_H
namespace Eigen {
namespace internal {
template <typename Vector, typename RealVector, bool IsComplex>
struct rcond_compute_sign {
static inline Vector run(const Vector& v) {
const RealVector v_abs = v.cwiseAbs();
return (v_abs.array() == static_cast<typename Vector::RealScalar>(0))
.select(Vector::Ones(v.size()), v.cwiseQuotient(v_abs));
}
};
// Partial specialization to avoid elementwise division for real vectors.
template <typename Vector>
struct rcond_compute_sign<Vector, Vector, false> {
static inline Vector run(const Vector& v) {
return (v.array() < static_cast<typename Vector::RealScalar>(0))
.select(-Vector::Ones(v.size()), Vector::Ones(v.size()));
}
};
/**
* \returns an estimate of ||inv(matrix)||_1 given a decomposition of
* \a matrix that implements .solve() and .adjoint().solve() methods.
*
* This function implements Algorithms 4.1 and 5.1 from
* http://www.maths.manchester.ac.uk/~higham/narep/narep135.pdf
* which also forms the basis for the condition number estimators in
* LAPACK. Since at most 10 calls to the solve method of dec are
* performed, the total cost is O(dims^2), as opposed to O(dims^3)
* needed to compute the inverse matrix explicitly.
*
* The most common usage is in estimating the condition number
* ||matrix||_1 * ||inv(matrix)||_1. The first term ||matrix||_1 can be
* computed directly in O(n^2) operations.
*
* Supports the following decompositions: FullPivLU, PartialPivLU, LDLT, and
* LLT.
*
* \sa FullPivLU, PartialPivLU, LDLT, LLT.
*/
template <typename Decomposition>
typename Decomposition::RealScalar rcond_invmatrix_L1_norm_estimate(const Decomposition& dec)
{
typedef typename Decomposition::MatrixType MatrixType;
typedef typename Decomposition::Scalar Scalar;
typedef typename Decomposition::RealScalar RealScalar;
typedef typename internal::plain_col_type<MatrixType>::type Vector;
typedef typename internal::plain_col_type<MatrixType, RealScalar>::type RealVector;
const bool is_complex = (NumTraits<Scalar>::IsComplex != 0);
eigen_assert(dec.rows() == dec.cols());
const Index n = dec.rows();
if (n == 0)
return 0;
// Disable Index to float conversion warning
#ifdef __INTEL_COMPILER
#pragma warning push
#pragma warning ( disable : 2259 )
#endif
Vector v = dec.solve(Vector::Ones(n) / Scalar(n));
#ifdef __INTEL_COMPILER
#pragma warning pop
#endif
// lower_bound is a lower bound on
// ||inv(matrix)||_1 = sup_v ||inv(matrix) v||_1 / ||v||_1
// and is the objective maximized by the ("super-") gradient ascent
// algorithm below.
RealScalar lower_bound = v.template lpNorm<1>();
if (n == 1)
return lower_bound;
// Gradient ascent algorithm follows: We know that the optimum is achieved at
// one of the simplices v = e_i, so in each iteration we follow a
// super-gradient to move towards the optimal one.
RealScalar old_lower_bound = lower_bound;
Vector sign_vector(n);
Vector old_sign_vector;
Index v_max_abs_index = -1;
Index old_v_max_abs_index = v_max_abs_index;
for (int k = 0; k < 4; ++k)
{
sign_vector = internal::rcond_compute_sign<Vector, RealVector, is_complex>::run(v);
if (k > 0 && !is_complex && sign_vector == old_sign_vector) {
// Break if the solution stagnated.
break;
}
// v_max_abs_index = argmax |real( inv(matrix)^T * sign_vector )|
v = dec.adjoint().solve(sign_vector);
v.real().cwiseAbs().maxCoeff(&v_max_abs_index);
if (v_max_abs_index == old_v_max_abs_index) {
// Break if the solution stagnated.
break;
}
// Move to the new simplex e_j, where j = v_max_abs_index.
v = dec.solve(Vector::Unit(n, v_max_abs_index)); // v = inv(matrix) * e_j.
lower_bound = v.template lpNorm<1>();
if (lower_bound <= old_lower_bound) {
// Break if the gradient step did not increase the lower_bound.
break;
}
if (!is_complex) {
old_sign_vector = sign_vector;
}
old_v_max_abs_index = v_max_abs_index;
old_lower_bound = lower_bound;
}
// The following calculates an independent estimate of ||matrix||_1 by
// multiplying matrix by a vector with entries of slowly increasing
// magnitude and alternating sign:
// v_i = (-1)^{i} (1 + (i / (dim-1))), i = 0,...,dim-1.
// This improvement to Hager's algorithm above is due to Higham. It was
// added to make the algorithm more robust in certain corner cases where
// large elements in the matrix might otherwise escape detection due to
// exact cancellation (especially when op and op_adjoint correspond to a
// sequence of backsubstitutions and permutations), which could cause
// Hager's algorithm to vastly underestimate ||matrix||_1.
Scalar alternating_sign(RealScalar(1));
for (Index i = 0; i < n; ++i) {
// The static_cast is needed when Scalar is a complex and RealScalar implements expression templates
v[i] = alternating_sign * static_cast<RealScalar>(RealScalar(1) + (RealScalar(i) / (RealScalar(n - 1))));
alternating_sign = -alternating_sign;
}
v = dec.solve(v);
const RealScalar alternate_lower_bound = (2 * v.template lpNorm<1>()) / (3 * RealScalar(n));
return numext::maxi(lower_bound, alternate_lower_bound);
}
/** \brief Reciprocal condition number estimator.
*
* Computing a decomposition of a dense matrix takes O(n^3) operations, while
* this method estimates the condition number quickly and reliably in O(n^2)
* operations.
*
* \returns an estimate of the reciprocal condition number
* (1 / (||matrix||_1 * ||inv(matrix)||_1)) of matrix, given ||matrix||_1 and
* its decomposition. Supports the following decompositions: FullPivLU,
* PartialPivLU, LDLT, and LLT.
*
* \sa FullPivLU, PartialPivLU, LDLT, LLT.
*/
template <typename Decomposition>
typename Decomposition::RealScalar
rcond_estimate_helper(typename Decomposition::RealScalar matrix_norm, const Decomposition& dec)
{
typedef typename Decomposition::RealScalar RealScalar;
eigen_assert(dec.rows() == dec.cols());
if (dec.rows() == 0) return NumTraits<RealScalar>::infinity();
if (matrix_norm == RealScalar(0)) return RealScalar(0);
if (dec.rows() == 1) return RealScalar(1);
const RealScalar inverse_matrix_norm = rcond_invmatrix_L1_norm_estimate(dec);
return (inverse_matrix_norm == RealScalar(0) ? RealScalar(0)
: (RealScalar(1) / inverse_matrix_norm) / matrix_norm);
}
} // namespace internal
} // namespace Eigen
#endif
|
{
"pile_set_name": "Github"
}
|
; RUN: true
; DISABLED: llc -march=hexagon -mcpu=hexagonv4 < %s | FileCheck %s
; CHECK: __hexagon_addsf3
; CHECK: __hexagon_subsf3
define void @foo(float* %acc, float %num, float %num2) nounwind {
entry:
%acc.addr = alloca float*, align 4
%num.addr = alloca float, align 4
%num2.addr = alloca float, align 4
store float* %acc, float** %acc.addr, align 4
store float %num, float* %num.addr, align 4
store float %num2, float* %num2.addr, align 4
%0 = load float** %acc.addr, align 4
%1 = load float* %0
%2 = load float* %num.addr, align 4
%add = fadd float %1, %2
%3 = load float* %num2.addr, align 4
%sub = fsub float %add, %3
%4 = load float** %acc.addr, align 4
store float %sub, float* %4
ret void
}
|
{
"pile_set_name": "Github"
}
|
#!/bin/sh
. $TOP_SRCDIR/tests/eglenv.sh
./testegldisplay
|
{
"pile_set_name": "Github"
}
|
var assert = require('assert'),
fs = require('fs'),
path = require('path'),
glob = require('wildglob'),
pi = require('pipe-iterators'),
fixture = require('file-fixture');
var stream = require('../index.js').stream,
md = require('../index.js').md;
var meta = {
authors: {
'default': {
'name': 'AUTHOR NAME',
'bio': 'AUTHOR BIO',
'website': 'http://localhost:5000/author/foo',
'image': 'http://lorempixel.com/155/155/people/',
'cover': 'http://lorempixel.com/1100/425/animals/',
'slug': 'foo'
}
}
};
describe('test metadata defaults', function() {
function pipeline() {
return pi.pipeline(
stream.read(),
md.parseHeader(),
md.parseMd(),
md.annotateMdHeadings(),
md.highlightJs(),
md.convertMd(),
stream.fileToPost(meta),
stream.parsePublishedAt(),
stream.parseTags()
);
}
it('if title is not set, the first heading will be used', function(done) {
var tmpFile = fixture.file([ '# Hello world', 'YOLO' ], { ext: '.md'});
pi.fromArray(tmpFile)
.pipe(pipeline())
.pipe(pi.toArray(function(results) {
var result = results[0];
// console.log(require('util').inspect(result, null, 20, true));
assert.equal(result.title, 'Hello world');
assert.equal(result.page, false);
assert.equal(result.draft, false);
done();
}));
});
it('if title is not set, and there are no headings, the file name will be used', function(done) {
var tmpFile = fixture.file([ 'YOLO' ], { ext: '.md'});
pi.fromArray(tmpFile)
.pipe(pipeline())
.pipe(pi.toArray(function(results) {
var result = results[0];
assert.equal(result.title, path.basename(tmpFile, path.extname(tmpFile)));
done();
}));
});
it('if published_at is set, it is used', function(done) {
var tmpFile = fixture.file([
'---',
'published_at: 2014-01-30 11:26:04',
'---',
' ',
'YOLO'
], { ext: '.md'});
pi.fromArray(tmpFile)
.pipe(pipeline())
.pipe(pi.toArray(function(results) {
var result = results[0];
assert.equal(result.published_at.getTime(), new Date('2014-01-30 11:26:04').getTime());
done();
}));
});
it('if published_at is not set, and the file path has no date, ' +
'the creation time of the file is used', function(done) {
var tmpFile = fixture.file([ 'YOLO' ], { ext: '.md'});
pi.fromArray(tmpFile)
.pipe(pipeline())
.pipe(pi.toArray(function(results) {
var result = results[0];
assert.equal(result.published_at.getTime(), fs.statSync(tmpFile).ctime.getTime());
done();
}));
});
it('if published_at is not set and the file path has a date, ' +
'set the date from the file path', function(done) {
var tmpDir = fixture.dir({
'2014-01-30-hello.md': 'YOLO',
'2014/02/30/foo.md': 'YOLO',
'30-03-2014-bar.md': 'YOLO',
'30/04/2014/baz.md': 'YOLO'
});
var files = glob.sync(tmpDir + '/**');
pi.fromArray(files)
.pipe(pipeline())
.pipe(stream.sortByPublishedAt())
.pipe(pi.toArray(function(results) {
// console.log(require('util').inspect(results, null, 20, true));
assert.equal(results[0].published_at.getTime(), new Date(2014, 3, 30).getTime());
assert.equal(results[1].published_at.getTime(), new Date(2014, 2, 30).getTime());
assert.equal(results[2].published_at.getTime(), new Date(2014, 1, 30).getTime());
assert.equal(results[3].published_at.getTime(), new Date(2014, 0, 30).getTime());
done();
}));
});
it('if author is not set, the default author is used', function(done) {
var tmpFile = fixture.file([ '# Hello world', 'YOLO' ], { ext: '.md'});
pi.fromArray(tmpFile)
.pipe(pipeline())
.pipe(pi.toArray(function(results) {
var result = results[0];
// console.log(require('util').inspect(result, null, 20, true));
assert.equal(result.author, meta.authors['default']);
done();
}));
});
it('parses space-separated tags', function(done) {
var tmpFile = fixture.file([
'---',
'tags: foo bar baz',
'---',
' ',
'YOLO'
], { ext: '.md'});
pi.fromArray(tmpFile)
.pipe(pipeline())
.pipe(pi.toArray(function(results) {
var result = results[0];
assert.deepEqual(result.tags.map(function(t) { return t.name; }), [ 'foo', 'bar', 'baz' ]);
done();
}));
});
it('parses comma-separated tags', function(done) {
var tmpFile = fixture.file([
'---',
'tags: foo,bar,baz',
'---',
' ',
'YOLO'
], { ext: '.md'});
pi.fromArray(tmpFile)
.pipe(pipeline())
.pipe(pi.toArray(function(results) {
var result = results[0];
assert.deepEqual(result.tags.map(function(t) { return t.name; }), [ 'foo', 'bar', 'baz' ]);
done();
}));
});
it('if tags are not set, the tags property is an empty array', function(done) {
var tmpFile = fixture.file([
'YOLO'
], { ext: '.md'});
pi.fromArray(tmpFile)
.pipe(pipeline())
.pipe(pi.toArray(function(results
) {
var result = results[0];
assert.deepEqual(result.tags.map(function(t) { return t.name; }), [ ]);
done();
}));
});
it('parses metadata blocks even if they have no --- block, but newlines instead');
it('parses metadata blocks even if they only have the ending ---');
it('parses metadata blocks even if they only have the beginning --- and a newline');
});
|
{
"pile_set_name": "Github"
}
|
require('../../modules/es6.regexp.constructor');
require('../../modules/es6.regexp.flags');
require('../../modules/es6.regexp.match');
require('../../modules/es6.regexp.replace');
require('../../modules/es6.regexp.search');
require('../../modules/es6.regexp.split');
require('../../modules/es7.regexp.escape');
module.exports = require('../../modules/$.core').RegExp;
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.oval.interceptor;
import net.sf.oval.constraint.AssertValid;
import org.apache.struts2.oval.interceptor.domain.Person;
import com.opensymphony.xwork2.ActionSupport;
public class MemberObject extends ActionSupport {
@AssertValid
private Person person = new Person();
public Person getPerson() {
return person;
}
}
|
{
"pile_set_name": "Github"
}
|
org.kaazing.gateway.resource.address.sse.SseResourceAddressFactorySpi
org.kaazing.gateway.resource.address.sse.SseSslResourceAddressFactorySpi
org.kaazing.gateway.resource.address.sse.SseHttpxeResourceAddressFactorySpi
org.kaazing.gateway.resource.address.sse.SseHttpxeSslResourceAddressFactorySpi
|
{
"pile_set_name": "Github"
}
|
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Validator\Tests\Util;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Validator\Util\PropertyPath;
class PropertyPathTest extends TestCase
{
/**
* @dataProvider provideAppendPaths
*/
public function testAppend($basePath, $subPath, $expectedPath, $message)
{
$this->assertSame($expectedPath, PropertyPath::append($basePath, $subPath), $message);
}
public function provideAppendPaths()
{
return [
['foo', '', 'foo', 'It returns the basePath if subPath is empty'],
['', 'bar', 'bar', 'It returns the subPath if basePath is empty'],
['foo', 'bar', 'foo.bar', 'It append the subPath to the basePath'],
['foo', '[bar]', 'foo[bar]', 'It does not include the dot separator if subPath uses the array notation'],
['0', 'bar', '0.bar', 'Leading zeros are kept.'],
['0', 1, '0.1', 'Numeric subpaths do not cause PHP 7.4 errors.'],
];
}
}
|
{
"pile_set_name": "Github"
}
|
<?js
var data = obj;
?>
<section>
<article>
<pre
class="sunlight-highlight-javascript <?js= this.navOptions.linenums ? 'linenums' : '' ?>"><?js= data.code ?></pre>
</article>
</section>
|
{
"pile_set_name": "Github"
}
|
----------------------------------------------------------------------------
-- LuaJIT PPC disassembler module.
--
-- Copyright (C) 2005-2017 Mike Pall. All rights reserved.
-- Released under the MIT/X license. See Copyright Notice in luajit.h
----------------------------------------------------------------------------
-- This is a helper module used by the LuaJIT machine code dumper module.
--
-- It disassembles all common, non-privileged 32/64 bit PowerPC instructions
-- plus the e500 SPE instructions and some Cell/Xenon extensions.
--
-- NYI: VMX, VMX128
------------------------------------------------------------------------------
local type = type
local byte, format = string.byte, string.format
local match, gmatch, gsub = string.match, string.gmatch, string.gsub
local concat = table.concat
local bit = require("bit")
local band, bor, tohex = bit.band, bit.bor, bit.tohex
local lshift, rshift, arshift = bit.lshift, bit.rshift, bit.arshift
------------------------------------------------------------------------------
-- Primary and extended opcode maps
------------------------------------------------------------------------------
local map_crops = {
shift = 1, mask = 1023,
[0] = "mcrfXX",
[33] = "crnor|crnotCCC=", [129] = "crandcCCC",
[193] = "crxor|crclrCCC%", [225] = "crnandCCC",
[257] = "crandCCC", [289] = "creqv|crsetCCC%",
[417] = "crorcCCC", [449] = "cror|crmoveCCC=",
[16] = "b_lrKB", [528] = "b_ctrKB",
[150] = "isync",
}
local map_rlwinm = setmetatable({
shift = 0, mask = -1,
},
{ __index = function(t, x)
local rot = band(rshift(x, 11), 31)
local mb = band(rshift(x, 6), 31)
local me = band(rshift(x, 1), 31)
if mb == 0 and me == 31-rot then
return "slwiRR~A."
elseif me == 31 and mb == 32-rot then
return "srwiRR~-A."
else
return "rlwinmRR~AAA."
end
end
})
local map_rld = {
shift = 2, mask = 7,
[0] = "rldiclRR~HM.", "rldicrRR~HM.", "rldicRR~HM.", "rldimiRR~HM.",
{
shift = 1, mask = 1,
[0] = "rldclRR~RM.", "rldcrRR~RM.",
},
}
local map_ext = setmetatable({
shift = 1, mask = 1023,
[0] = "cmp_YLRR", [32] = "cmpl_YLRR",
[4] = "twARR", [68] = "tdARR",
[8] = "subfcRRR.", [40] = "subfRRR.",
[104] = "negRR.", [136] = "subfeRRR.",
[200] = "subfzeRR.", [232] = "subfmeRR.",
[520] = "subfcoRRR.", [552] = "subfoRRR.",
[616] = "negoRR.", [648] = "subfeoRRR.",
[712] = "subfzeoRR.", [744] = "subfmeoRR.",
[9] = "mulhduRRR.", [73] = "mulhdRRR.", [233] = "mulldRRR.",
[457] = "divduRRR.", [489] = "divdRRR.",
[745] = "mulldoRRR.",
[969] = "divduoRRR.", [1001] = "divdoRRR.",
[10] = "addcRRR.", [138] = "addeRRR.",
[202] = "addzeRR.", [234] = "addmeRR.", [266] = "addRRR.",
[522] = "addcoRRR.", [650] = "addeoRRR.",
[714] = "addzeoRR.", [746] = "addmeoRR.", [778] = "addoRRR.",
[11] = "mulhwuRRR.", [75] = "mulhwRRR.", [235] = "mullwRRR.",
[459] = "divwuRRR.", [491] = "divwRRR.",
[747] = "mullwoRRR.",
[971] = "divwouRRR.", [1003] = "divwoRRR.",
[15] = "iselltRRR", [47] = "iselgtRRR", [79] = "iseleqRRR",
[144] = { shift = 20, mask = 1, [0] = "mtcrfRZ~", "mtocrfRZ~", },
[19] = { shift = 20, mask = 1, [0] = "mfcrR", "mfocrfRZ", },
[371] = { shift = 11, mask = 1023, [392] = "mftbR", [424] = "mftbuR", },
[339] = {
shift = 11, mask = 1023,
[32] = "mferR", [256] = "mflrR", [288] = "mfctrR", [16] = "mfspefscrR",
},
[467] = {
shift = 11, mask = 1023,
[32] = "mtxerR", [256] = "mtlrR", [288] = "mtctrR", [16] = "mtspefscrR",
},
[20] = "lwarxRR0R", [84] = "ldarxRR0R",
[21] = "ldxRR0R", [53] = "lduxRRR",
[149] = "stdxRR0R", [181] = "stduxRRR",
[341] = "lwaxRR0R", [373] = "lwauxRRR",
[23] = "lwzxRR0R", [55] = "lwzuxRRR",
[87] = "lbzxRR0R", [119] = "lbzuxRRR",
[151] = "stwxRR0R", [183] = "stwuxRRR",
[215] = "stbxRR0R", [247] = "stbuxRRR",
[279] = "lhzxRR0R", [311] = "lhzuxRRR",
[343] = "lhaxRR0R", [375] = "lhauxRRR",
[407] = "sthxRR0R", [439] = "sthuxRRR",
[54] = "dcbst-R0R", [86] = "dcbf-R0R",
[150] = "stwcxRR0R.", [214] = "stdcxRR0R.",
[246] = "dcbtst-R0R", [278] = "dcbt-R0R",
[310] = "eciwxRR0R", [438] = "ecowxRR0R",
[470] = "dcbi-RR",
[598] = {
shift = 21, mask = 3,
[0] = "sync", "lwsync", "ptesync",
},
[758] = "dcba-RR",
[854] = "eieio", [982] = "icbi-R0R", [1014] = "dcbz-R0R",
[26] = "cntlzwRR~", [58] = "cntlzdRR~",
[122] = "popcntbRR~",
[154] = "prtywRR~", [186] = "prtydRR~",
[28] = "andRR~R.", [60] = "andcRR~R.", [124] = "nor|notRR~R=.",
[284] = "eqvRR~R.", [316] = "xorRR~R.",
[412] = "orcRR~R.", [444] = "or|mrRR~R=.", [476] = "nandRR~R.",
[508] = "cmpbRR~R",
[512] = "mcrxrX",
[532] = "ldbrxRR0R", [660] = "stdbrxRR0R",
[533] = "lswxRR0R", [597] = "lswiRR0A",
[661] = "stswxRR0R", [725] = "stswiRR0A",
[534] = "lwbrxRR0R", [662] = "stwbrxRR0R",
[790] = "lhbrxRR0R", [918] = "sthbrxRR0R",
[535] = "lfsxFR0R", [567] = "lfsuxFRR",
[599] = "lfdxFR0R", [631] = "lfduxFRR",
[663] = "stfsxFR0R", [695] = "stfsuxFRR",
[727] = "stfdxFR0R", [759] = "stfduxFR0R",
[855] = "lfiwaxFR0R",
[983] = "stfiwxFR0R",
[24] = "slwRR~R.",
[27] = "sldRR~R.", [536] = "srwRR~R.",
[792] = "srawRR~R.", [824] = "srawiRR~A.",
[794] = "sradRR~R.", [826] = "sradiRR~H.", [827] = "sradiRR~H.",
[922] = "extshRR~.", [954] = "extsbRR~.", [986] = "extswRR~.",
[539] = "srdRR~R.",
},
{ __index = function(t, x)
if band(x, 31) == 15 then return "iselRRRC" end
end
})
local map_ld = {
shift = 0, mask = 3,
[0] = "ldRRE", "lduRRE", "lwaRRE",
}
local map_std = {
shift = 0, mask = 3,
[0] = "stdRRE", "stduRRE",
}
local map_fps = {
shift = 5, mask = 1,
{
shift = 1, mask = 15,
[0] = false, false, "fdivsFFF.", false,
"fsubsFFF.", "faddsFFF.", "fsqrtsF-F.", false,
"fresF-F.", "fmulsFF-F.", "frsqrtesF-F.", false,
"fmsubsFFFF~.", "fmaddsFFFF~.", "fnmsubsFFFF~.", "fnmaddsFFFF~.",
}
}
local map_fpd = {
shift = 5, mask = 1,
[0] = {
shift = 1, mask = 1023,
[0] = "fcmpuXFF", [32] = "fcmpoXFF", [64] = "mcrfsXX",
[38] = "mtfsb1A.", [70] = "mtfsb0A.", [134] = "mtfsfiA>>-A>",
[8] = "fcpsgnFFF.", [40] = "fnegF-F.", [72] = "fmrF-F.",
[136] = "fnabsF-F.", [264] = "fabsF-F.",
[12] = "frspF-F.",
[14] = "fctiwF-F.", [15] = "fctiwzF-F.",
[583] = "mffsF.", [711] = "mtfsfZF.",
[392] = "frinF-F.", [424] = "frizF-F.",
[456] = "fripF-F.", [488] = "frimF-F.",
[814] = "fctidF-F.", [815] = "fctidzF-F.", [846] = "fcfidF-F.",
},
{
shift = 1, mask = 15,
[0] = false, false, "fdivFFF.", false,
"fsubFFF.", "faddFFF.", "fsqrtF-F.", "fselFFFF~.",
"freF-F.", "fmulFF-F.", "frsqrteF-F.", false,
"fmsubFFFF~.", "fmaddFFFF~.", "fnmsubFFFF~.", "fnmaddFFFF~.",
}
}
local map_spe = {
shift = 0, mask = 2047,
[512] = "evaddwRRR", [514] = "evaddiwRAR~",
[516] = "evsubwRRR~", [518] = "evsubiwRAR~",
[520] = "evabsRR", [521] = "evnegRR",
[522] = "evextsbRR", [523] = "evextshRR", [524] = "evrndwRR",
[525] = "evcntlzwRR", [526] = "evcntlswRR",
[527] = "brincRRR",
[529] = "evandRRR", [530] = "evandcRRR", [534] = "evxorRRR",
[535] = "evor|evmrRRR=", [536] = "evnor|evnotRRR=",
[537] = "eveqvRRR", [539] = "evorcRRR", [542] = "evnandRRR",
[544] = "evsrwuRRR", [545] = "evsrwsRRR",
[546] = "evsrwiuRRA", [547] = "evsrwisRRA",
[548] = "evslwRRR", [550] = "evslwiRRA",
[552] = "evrlwRRR", [553] = "evsplatiRS",
[554] = "evrlwiRRA", [555] = "evsplatfiRS",
[556] = "evmergehiRRR", [557] = "evmergeloRRR",
[558] = "evmergehiloRRR", [559] = "evmergelohiRRR",
[560] = "evcmpgtuYRR", [561] = "evcmpgtsYRR",
[562] = "evcmpltuYRR", [563] = "evcmpltsYRR",
[564] = "evcmpeqYRR",
[632] = "evselRRR", [633] = "evselRRRW",
[634] = "evselRRRW", [635] = "evselRRRW",
[636] = "evselRRRW", [637] = "evselRRRW",
[638] = "evselRRRW", [639] = "evselRRRW",
[640] = "evfsaddRRR", [641] = "evfssubRRR",
[644] = "evfsabsRR", [645] = "evfsnabsRR", [646] = "evfsnegRR",
[648] = "evfsmulRRR", [649] = "evfsdivRRR",
[652] = "evfscmpgtYRR", [653] = "evfscmpltYRR", [654] = "evfscmpeqYRR",
[656] = "evfscfuiR-R", [657] = "evfscfsiR-R",
[658] = "evfscfufR-R", [659] = "evfscfsfR-R",
[660] = "evfsctuiR-R", [661] = "evfsctsiR-R",
[662] = "evfsctufR-R", [663] = "evfsctsfR-R",
[664] = "evfsctuizR-R", [666] = "evfsctsizR-R",
[668] = "evfststgtYRR", [669] = "evfststltYRR", [670] = "evfststeqYRR",
[704] = "efsaddRRR", [705] = "efssubRRR",
[708] = "efsabsRR", [709] = "efsnabsRR", [710] = "efsnegRR",
[712] = "efsmulRRR", [713] = "efsdivRRR",
[716] = "efscmpgtYRR", [717] = "efscmpltYRR", [718] = "efscmpeqYRR",
[719] = "efscfdR-R",
[720] = "efscfuiR-R", [721] = "efscfsiR-R",
[722] = "efscfufR-R", [723] = "efscfsfR-R",
[724] = "efsctuiR-R", [725] = "efsctsiR-R",
[726] = "efsctufR-R", [727] = "efsctsfR-R",
[728] = "efsctuizR-R", [730] = "efsctsizR-R",
[732] = "efststgtYRR", [733] = "efststltYRR", [734] = "efststeqYRR",
[736] = "efdaddRRR", [737] = "efdsubRRR",
[738] = "efdcfuidR-R", [739] = "efdcfsidR-R",
[740] = "efdabsRR", [741] = "efdnabsRR", [742] = "efdnegRR",
[744] = "efdmulRRR", [745] = "efddivRRR",
[746] = "efdctuidzR-R", [747] = "efdctsidzR-R",
[748] = "efdcmpgtYRR", [749] = "efdcmpltYRR", [750] = "efdcmpeqYRR",
[751] = "efdcfsR-R",
[752] = "efdcfuiR-R", [753] = "efdcfsiR-R",
[754] = "efdcfufR-R", [755] = "efdcfsfR-R",
[756] = "efdctuiR-R", [757] = "efdctsiR-R",
[758] = "efdctufR-R", [759] = "efdctsfR-R",
[760] = "efdctuizR-R", [762] = "efdctsizR-R",
[764] = "efdtstgtYRR", [765] = "efdtstltYRR", [766] = "efdtsteqYRR",
[768] = "evlddxRR0R", [769] = "evlddRR8",
[770] = "evldwxRR0R", [771] = "evldwRR8",
[772] = "evldhxRR0R", [773] = "evldhRR8",
[776] = "evlhhesplatxRR0R", [777] = "evlhhesplatRR2",
[780] = "evlhhousplatxRR0R", [781] = "evlhhousplatRR2",
[782] = "evlhhossplatxRR0R", [783] = "evlhhossplatRR2",
[784] = "evlwhexRR0R", [785] = "evlwheRR4",
[788] = "evlwhouxRR0R", [789] = "evlwhouRR4",
[790] = "evlwhosxRR0R", [791] = "evlwhosRR4",
[792] = "evlwwsplatxRR0R", [793] = "evlwwsplatRR4",
[796] = "evlwhsplatxRR0R", [797] = "evlwhsplatRR4",
[800] = "evstddxRR0R", [801] = "evstddRR8",
[802] = "evstdwxRR0R", [803] = "evstdwRR8",
[804] = "evstdhxRR0R", [805] = "evstdhRR8",
[816] = "evstwhexRR0R", [817] = "evstwheRR4",
[820] = "evstwhoxRR0R", [821] = "evstwhoRR4",
[824] = "evstwwexRR0R", [825] = "evstwweRR4",
[828] = "evstwwoxRR0R", [829] = "evstwwoRR4",
[1027] = "evmhessfRRR", [1031] = "evmhossfRRR", [1032] = "evmheumiRRR",
[1033] = "evmhesmiRRR", [1035] = "evmhesmfRRR", [1036] = "evmhoumiRRR",
[1037] = "evmhosmiRRR", [1039] = "evmhosmfRRR", [1059] = "evmhessfaRRR",
[1063] = "evmhossfaRRR", [1064] = "evmheumiaRRR", [1065] = "evmhesmiaRRR",
[1067] = "evmhesmfaRRR", [1068] = "evmhoumiaRRR", [1069] = "evmhosmiaRRR",
[1071] = "evmhosmfaRRR", [1095] = "evmwhssfRRR", [1096] = "evmwlumiRRR",
[1100] = "evmwhumiRRR", [1101] = "evmwhsmiRRR", [1103] = "evmwhsmfRRR",
[1107] = "evmwssfRRR", [1112] = "evmwumiRRR", [1113] = "evmwsmiRRR",
[1115] = "evmwsmfRRR", [1127] = "evmwhssfaRRR", [1128] = "evmwlumiaRRR",
[1132] = "evmwhumiaRRR", [1133] = "evmwhsmiaRRR", [1135] = "evmwhsmfaRRR",
[1139] = "evmwssfaRRR", [1144] = "evmwumiaRRR", [1145] = "evmwsmiaRRR",
[1147] = "evmwsmfaRRR",
[1216] = "evaddusiaawRR", [1217] = "evaddssiaawRR",
[1218] = "evsubfusiaawRR", [1219] = "evsubfssiaawRR",
[1220] = "evmraRR",
[1222] = "evdivwsRRR", [1223] = "evdivwuRRR",
[1224] = "evaddumiaawRR", [1225] = "evaddsmiaawRR",
[1226] = "evsubfumiaawRR", [1227] = "evsubfsmiaawRR",
[1280] = "evmheusiaawRRR", [1281] = "evmhessiaawRRR",
[1283] = "evmhessfaawRRR", [1284] = "evmhousiaawRRR",
[1285] = "evmhossiaawRRR", [1287] = "evmhossfaawRRR",
[1288] = "evmheumiaawRRR", [1289] = "evmhesmiaawRRR",
[1291] = "evmhesmfaawRRR", [1292] = "evmhoumiaawRRR",
[1293] = "evmhosmiaawRRR", [1295] = "evmhosmfaawRRR",
[1320] = "evmhegumiaaRRR", [1321] = "evmhegsmiaaRRR",
[1323] = "evmhegsmfaaRRR", [1324] = "evmhogumiaaRRR",
[1325] = "evmhogsmiaaRRR", [1327] = "evmhogsmfaaRRR",
[1344] = "evmwlusiaawRRR", [1345] = "evmwlssiaawRRR",
[1352] = "evmwlumiaawRRR", [1353] = "evmwlsmiaawRRR",
[1363] = "evmwssfaaRRR", [1368] = "evmwumiaaRRR",
[1369] = "evmwsmiaaRRR", [1371] = "evmwsmfaaRRR",
[1408] = "evmheusianwRRR", [1409] = "evmhessianwRRR",
[1411] = "evmhessfanwRRR", [1412] = "evmhousianwRRR",
[1413] = "evmhossianwRRR", [1415] = "evmhossfanwRRR",
[1416] = "evmheumianwRRR", [1417] = "evmhesmianwRRR",
[1419] = "evmhesmfanwRRR", [1420] = "evmhoumianwRRR",
[1421] = "evmhosmianwRRR", [1423] = "evmhosmfanwRRR",
[1448] = "evmhegumianRRR", [1449] = "evmhegsmianRRR",
[1451] = "evmhegsmfanRRR", [1452] = "evmhogumianRRR",
[1453] = "evmhogsmianRRR", [1455] = "evmhogsmfanRRR",
[1472] = "evmwlusianwRRR", [1473] = "evmwlssianwRRR",
[1480] = "evmwlumianwRRR", [1481] = "evmwlsmianwRRR",
[1491] = "evmwssfanRRR", [1496] = "evmwumianRRR",
[1497] = "evmwsmianRRR", [1499] = "evmwsmfanRRR",
}
local map_pri = {
[0] = false, false, "tdiARI", "twiARI",
map_spe, false, false, "mulliRRI",
"subficRRI", false, "cmpl_iYLRU", "cmp_iYLRI",
"addicRRI", "addic.RRI", "addi|liRR0I", "addis|lisRR0I",
"b_KBJ", "sc", "bKJ", map_crops,
"rlwimiRR~AAA.", map_rlwinm, false, "rlwnmRR~RAA.",
"oriNRR~U", "orisRR~U", "xoriRR~U", "xorisRR~U",
"andi.RR~U", "andis.RR~U", map_rld, map_ext,
"lwzRRD", "lwzuRRD", "lbzRRD", "lbzuRRD",
"stwRRD", "stwuRRD", "stbRRD", "stbuRRD",
"lhzRRD", "lhzuRRD", "lhaRRD", "lhauRRD",
"sthRRD", "sthuRRD", "lmwRRD", "stmwRRD",
"lfsFRD", "lfsuFRD", "lfdFRD", "lfduFRD",
"stfsFRD", "stfsuFRD", "stfdFRD", "stfduFRD",
false, false, map_ld, map_fps,
false, false, map_std, map_fpd,
}
------------------------------------------------------------------------------
local map_gpr = {
[0] = "r0", "sp", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
}
local map_cond = { [0] = "lt", "gt", "eq", "so", "ge", "le", "ne", "ns", }
-- Format a condition bit.
local function condfmt(cond)
if cond <= 3 then
return map_cond[band(cond, 3)]
else
return format("4*cr%d+%s", rshift(cond, 2), map_cond[band(cond, 3)])
end
end
------------------------------------------------------------------------------
-- Output a nicely formatted line with an opcode and operands.
local function putop(ctx, text, operands)
local pos = ctx.pos
local extra = ""
if ctx.rel then
local sym = ctx.symtab[ctx.rel]
if sym then extra = "\t->"..sym end
end
if ctx.hexdump > 0 then
ctx.out(format("%08x %s %-7s %s%s\n",
ctx.addr+pos, tohex(ctx.op), text, concat(operands, ", "), extra))
else
ctx.out(format("%08x %-7s %s%s\n",
ctx.addr+pos, text, concat(operands, ", "), extra))
end
ctx.pos = pos + 4
end
-- Fallback for unknown opcodes.
local function unknown(ctx)
return putop(ctx, ".long", { "0x"..tohex(ctx.op) })
end
-- Disassemble a single instruction.
local function disass_ins(ctx)
local pos = ctx.pos
local b0, b1, b2, b3 = byte(ctx.code, pos+1, pos+4)
local op = bor(lshift(b0, 24), lshift(b1, 16), lshift(b2, 8), b3)
local operands = {}
local last = nil
local rs = 21
ctx.op = op
ctx.rel = nil
local opat = map_pri[rshift(b0, 2)]
while type(opat) ~= "string" do
if not opat then return unknown(ctx) end
opat = opat[band(rshift(op, opat.shift), opat.mask)]
end
local name, pat = match(opat, "^([a-z0-9_.]*)(.*)")
local altname, pat2 = match(pat, "|([a-z0-9_.]*)(.*)")
if altname then pat = pat2 end
for p in gmatch(pat, ".") do
local x = nil
if p == "R" then
x = map_gpr[band(rshift(op, rs), 31)]
rs = rs - 5
elseif p == "F" then
x = "f"..band(rshift(op, rs), 31)
rs = rs - 5
elseif p == "A" then
x = band(rshift(op, rs), 31)
rs = rs - 5
elseif p == "S" then
x = arshift(lshift(op, 27-rs), 27)
rs = rs - 5
elseif p == "I" then
x = arshift(lshift(op, 16), 16)
elseif p == "U" then
x = band(op, 0xffff)
elseif p == "D" or p == "E" then
local disp = arshift(lshift(op, 16), 16)
if p == "E" then disp = band(disp, -4) end
if last == "r0" then last = "0" end
operands[#operands] = format("%d(%s)", disp, last)
elseif p >= "2" and p <= "8" then
local disp = band(rshift(op, rs), 31) * p
if last == "r0" then last = "0" end
operands[#operands] = format("%d(%s)", disp, last)
elseif p == "H" then
x = band(rshift(op, rs), 31) + lshift(band(op, 2), 4)
rs = rs - 5
elseif p == "M" then
x = band(rshift(op, rs), 31) + band(op, 0x20)
elseif p == "C" then
x = condfmt(band(rshift(op, rs), 31))
rs = rs - 5
elseif p == "B" then
local bo = rshift(op, 21)
local cond = band(rshift(op, 16), 31)
local cn = ""
rs = rs - 10
if band(bo, 4) == 0 then
cn = band(bo, 2) == 0 and "dnz" or "dz"
if band(bo, 0x10) == 0 then
cn = cn..(band(bo, 8) == 0 and "f" or "t")
end
if band(bo, 0x10) == 0 then x = condfmt(cond) end
name = name..(band(bo, 1) == band(rshift(op, 15), 1) and "-" or "+")
elseif band(bo, 0x10) == 0 then
cn = map_cond[band(cond, 3) + (band(bo, 8) == 0 and 4 or 0)]
if cond > 3 then x = "cr"..rshift(cond, 2) end
name = name..(band(bo, 1) == band(rshift(op, 15), 1) and "-" or "+")
end
name = gsub(name, "_", cn)
elseif p == "J" then
x = arshift(lshift(op, 27-rs), 29-rs)*4
if band(op, 2) == 0 then x = ctx.addr + pos + x end
ctx.rel = x
x = "0x"..tohex(x)
elseif p == "K" then
if band(op, 1) ~= 0 then name = name.."l" end
if band(op, 2) ~= 0 then name = name.."a" end
elseif p == "X" or p == "Y" then
x = band(rshift(op, rs+2), 7)
if x == 0 and p == "Y" then x = nil else x = "cr"..x end
rs = rs - 5
elseif p == "W" then
x = "cr"..band(op, 7)
elseif p == "Z" then
x = band(rshift(op, rs-4), 255)
rs = rs - 10
elseif p == ">" then
operands[#operands] = rshift(operands[#operands], 1)
elseif p == "0" then
if last == "r0" then
operands[#operands] = nil
if altname then name = altname end
end
elseif p == "L" then
name = gsub(name, "_", band(op, 0x00200000) ~= 0 and "d" or "w")
elseif p == "." then
if band(op, 1) == 1 then name = name.."." end
elseif p == "N" then
if op == 0x60000000 then name = "nop"; break end
elseif p == "~" then
local n = #operands
operands[n-1], operands[n] = operands[n], operands[n-1]
elseif p == "=" then
local n = #operands
if last == operands[n-1] then
operands[n] = nil
name = altname
end
elseif p == "%" then
local n = #operands
if last == operands[n-1] and last == operands[n-2] then
operands[n] = nil
operands[n-1] = nil
name = altname
end
elseif p == "-" then
rs = rs - 5
else
assert(false)
end
if x then operands[#operands+1] = x; last = x end
end
return putop(ctx, name, operands)
end
------------------------------------------------------------------------------
-- Disassemble a block of code.
local function disass_block(ctx, ofs, len)
if not ofs then ofs = 0 end
local stop = len and ofs+len or #ctx.code
stop = stop - stop % 4
ctx.pos = ofs - ofs % 4
ctx.rel = nil
while ctx.pos < stop do disass_ins(ctx) end
end
-- Extended API: create a disassembler context. Then call ctx:disass(ofs, len).
local function create(code, addr, out)
local ctx = {}
ctx.code = code
ctx.addr = addr or 0
ctx.out = out or io.write
ctx.symtab = {}
ctx.disass = disass_block
ctx.hexdump = 8
return ctx
end
-- Simple API: disassemble code (a string) at address and output via out.
local function disass(code, addr, out)
create(code, addr, out):disass()
end
-- Return register name for RID.
local function regname(r)
if r < 32 then return map_gpr[r] end
return "f"..(r-32)
end
-- Public module functions.
return {
create = create,
disass = disass,
regname = regname
}
|
{
"pile_set_name": "Github"
}
|
//
// SPComboPopupButton.h
// sequel-pro
//
// Created by Rowan Beentje (rowan.beent.je) on March 22, 2013
// Copyright (c) 2013 Rowan Beentje. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
// More info at <https://github.com/sequelpro/sequelpro>
#import <Cocoa/Cocoa.h>
@interface SPComboPopupButton : NSPopUpButton <NSMenuDelegate> {
BOOL menuIsOpen;
BOOL shouldDrawNonHighlightState;
NSUInteger lineOffset;
SEL actionSelector;
id actionTarget;
}
@property(readonly, assign) BOOL shouldDrawNonHighlightState;
@property(readonly, assign) NSUInteger lineOffset;
@end
|
{
"pile_set_name": "Github"
}
|
GL_ARB_texture_rgb10_a2ui
http://www.opengl.org/registry/specs/ARB/texture_rgb10_a2ui.txt
GL_ARB_texture_rgb10_a2ui
GL_RGB10_A2UI 0x906F
|
{
"pile_set_name": "Github"
}
|
import React, { useEffect, useRef, useState } from 'react';
const ImageToggleOnScroll = ({ primaryImg, secondaryImg }) => {
const imageRef = useRef(null);
const [isLoading, setIsLoading] = useState(true);
const isInView = () => {
const rect = imageRef.current.getBoundingClientRect();
return rect.top >= 0 && rect.bottom <= window.innerHeight;
};
const [inView, setInView] = useState(false);
useEffect(() => {
setIsLoading(false);
setInView(isInView());
window.addEventListener('scroll', scrollHandler);
return () => {
window.removeEventListener('scroll', scrollHandler);
};
}, []);
const scrollHandler = () => {
setInView(isInView());
};
return (
<img
src={
isLoading
? 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==' // 1x1gif
: inView
? secondaryImg
: primaryImg
}
alt=""
ref={imageRef}
width="200"
height="200"
/>
);
};
export default ImageToggleOnScroll;
|
{
"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', 'Laravel'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services your 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'),
/*
|--------------------------------------------------------------------------
| 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',
/*
|--------------------------------------------------------------------------
| 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',
/*
|--------------------------------------------------------------------------
| Logging Configuration
|--------------------------------------------------------------------------
|
| Here you may configure the log settings for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Settings: "single", "daily", "syslog", "errorlog"
|
*/
'log' => env('APP_LOG', 'single'),
'log_level' => env('APP_LOG_LEVEL', 'debug'),
/*
|--------------------------------------------------------------------------
| 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,
/*
* 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,
Laravel\Passport\PassportServiceProvider::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,
'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\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
],
'cdn' => [
'bypass' => env('CDN_BYPASS', false),
'url' => env('CDN_URL')
]
];
|
{
"pile_set_name": "Github"
}
|
// (C) Copyright Gennadiy Rozental 2001.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//
// File : $RCSfile$
//
// Version : $Revision: 74248 $
//
// Description : test tools context interfaces
// ***************************************************************************
#ifndef BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER
#define BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER
// Boost.Test
#include <boost/test/utils/lazy_ostream.hpp>
#include <boost/test/detail/suppress_warnings.hpp>
//____________________________________________________________________________//
namespace boost {
namespace test_tools {
namespace tt_detail {
// ************************************************************************** //
// ************** context_frame ************** //
// ************************************************************************** //
struct BOOST_TEST_DECL context_frame {
explicit context_frame( ::boost::unit_test::lazy_ostream const& context_descr );
~context_frame();
operator bool();
private:
// Data members
int m_frame_id;
};
//____________________________________________________________________________//
#define BOOST_TEST_INFO( context_descr ) \
::boost::unit_test::framework::add_context( BOOST_TEST_LAZY_MSG( context_descr ) , false ) \
/**/
//____________________________________________________________________________//
#define BOOST_TEST_CONTEXT( context_descr ) \
if( ::boost::test_tools::tt_detail::context_frame BOOST_JOIN( context_frame_, __LINE__ ) = \
::boost::test_tools::tt_detail::context_frame( BOOST_TEST_LAZY_MSG( context_descr ) ) ) \
/**/
//____________________________________________________________________________//
} // namespace tt_detail
} // namespace test_tools
} // namespace boost
#include <boost/test/detail/enable_warnings.hpp>
#endif // BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER
|
{
"pile_set_name": "Github"
}
|
\documentclass[12pt]{article}
\input{preamble/preamble}
\input{preamble/preamble_acronyms}
\input{preamble/preamble_math}
\input{preamble/preamble_tikz}
\title{%
\textbf{Validating Causal Models}
}
\author{
Dustin Tran \\
Columbia University \\
\\
Francisco J.~R.~Ruiz \\
Columbia University \\
\\
Susan Athey \\
Stanford University \\
\\
David M.~Blei \\
Columbia University \\
}
\begin{document}
\maketitle
\bigskip
\begin{abstract}
The goal of causal inference is to understand the outcome of
alternative courses of action. However, all causal inference
requires assumptions---more so than for standard tasks in
probabilistic modeling---and testing those assumptions is important
to assess the validity of a causal model. We develop Bayesian model
criticism for causal inference, building on the idea of posterior
predictive checks to assess model fit. Our approach involves
decomposing the problem, separately criticizing the model of
treatment assignments and the model of outcomes. Further we
discuss how and when we can check the central assumption of
unconfoundedness, which enables causal statements from observational
data. Our approach provides a foundation for diagnosing causal
inferences from observational data.
\end{abstract}
\emph{Keywords:}
Causal Inference;
Probabilistic Models;
Bayesian Analysis;
Model Checking.
\clearpage
\glsresetall{}
%\input{sec_intro}
\clearpage
\bibliographystyle{apalike}
\bibliography{bib}
\clearpage
\appendix
%\input{sec_appendix}
\end{document}
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title></title>
<link rel="Stylesheet" href="../css/analysis.css" />
<script type="text/javascript">
function init() {
if (window.location.hash) {
var parentDiv, nodes, i, helpInfo, helpId, helpInfoArr, helpEnvFilter, envContent, hideEnvClass, hideNodes;
helpInfo = window.location.hash.substring(1);
if(helpInfo.indexOf("-")) {
helpInfoArr = helpInfo.split("-");
helpId = helpInfoArr[0];
helpEnvFilter = helpInfoArr[1];
}
else {
helpId = helpInfo;
}
parentDiv = document.getElementById("topics");
nodes = parentDiv.children;
hideEnvClass = (helpEnvFilter === "OnlineOnly"? "PortalOnly": "OnlineOnly");
if(document.getElementsByClassName) {
hideNodes = document.getElementsByClassName(hideEnvClass);
}
else {
hideNodes = document.querySelectorAll(hideEnvClass);
}
for(i=0; i < nodes.length; i++) {
if(nodes[i].id !== helpId) {
nodes[i].style.display ="none";
}
}
for(i=0; i < hideNodes.length; i++) {
hideNodes[i].style.display ="none";
}
}
}
</script>
</head>
<body onload="init()">
<div id="topics">
<div id="toolDescription" class="largesize">
<h2>Hot spotok keresése</h2><p/>
<h2><img src="../images/GUID-6D600155-AA9B-4F02-AD8B-2E84150AB743-web.png" alt="Hot spotok keresése"></h2>
<hr/>
<p>A Hot spot-ok keresése eszközzel meghatározható, hogy léteznek-e statisztikailag szignifikáns klaszterek az adatok térbeli mintázatában.
<ul>
<li>Valóban klaszterezettek a kiválasztott pontok (bűntények, fák, közlekedési balesetek)? Hogyan tudhatja biztosan?
</li>
<li>Valóban statisztikailag szignifikáns hot spot-ra bukkant, vagy mást sugallna a térkép, ha megváltoztatná a megjelenítés módját?
</li>
</ul>
A Hot spot-ok keresése eszköz segít megbízható választ találni az ilyen kérdésekre.
</p>
<p>Még a véletlenszerű térbeli minták is mutatnak bizonyos fokú klaszterezést. Ezenkívül szemünk és agyunk természetes módon mintázatokat kezd keresni, ott is, ahol nem léteznek ilyenek. Ebből adódóan nehéz megítélni, hogy az adatok mintázata valóban működő térbeli folyamatok, vagy pusztán egy véletlenszerű választás eredményei. A kutatók és elemzők ezért használják a Hot spot-ok keresése eszközhöz hasonló statisztikai módszereket (Getis-Ord Gi*) a térbeli mintázatok mennyiségi meghatározására. Az adatok között talált, statisztikailag szignifikáns klaszterek értékes információt képviselnek. A klaszterek előfordulásának helye és ideje a látható mintázatokat előidéző folyamatokkal kapcsolatos, fontos információ az elemzések során. Lényeges információ annak ismerete, hogy a lakásbetörések száma például egy adott környéken következetesen magasabb: ekkor hatékony megelőzési stratégiákat kell kidolgozni, szűkös rendőri erőforrásokat kell beosztani, lakossági figyelőszolgálatot kell megszervezni, bűncselekmények mélyreható nyomozását kell engedélyezni, vagy potenciális gyanúsítottakat kell azonosítani.
</p>
</div>
<!--Parameter divs for each param-->
<div id="analysisLayer">
<div><h2>A réteg kiválasztása, amelynek hot spotjait ki szeretné számítani</h2></div>
<hr/>
<div>
<p>A pontréteg, amelyeknek hot spot-jait és cold spot-jait („meleg” és „hideg” pontjait) az eszköz megtalálja.
</p>
<p>Ez az elemzés gyűjtőket használ, és vetületi koordináta-rendszert igényel. A feldolgozási koordináta-rendszert az Elemzési környezetekben állíthatja be. Ha a feldolgozási koordináta-rendszer nem vetületi koordináta-rendszerre van állítva, az eszköz ennek beállítását kéri az elemzés futtatásakor .
</p>
<p>Ahelyett, hogy egy réteget választ a térképéről, választhatja a legördülő lista alján lévő <b>Eredményréteg kiválasztása</b> lehetőséget is, ha a saját tartalomban szeretne big data-fájlmegosztó adathalmazt vagy vektoros réteget keresni. A bemenő rétegen lehetősége van szűrőt is használni, vagy kijelöléseket is megadhat a térképhez adott központilag tárolt rétegeken. A szűrők és kijelölések csak az elemzésekre érvényesek.
</p>
</div>
</div>
<div id="analysisField">
<div><h2>Magas és alacsony értékek klasztereinek keresése</h2></div>
<hr/>
<div>
<p>Ez az elemzés arra a kérdésre ad választ, hogy: Hol találhatók a magas és alacsony értékek térbeli klaszterei?
</p>
<p>Ha pont adatok esetén a <b>Pontok száma </b>lehetőséget választja, az eszköz a pontszerű vektor elemek térbeli elrendezésének értékelésével válaszol a kérdésre: Hol csoportosulnak nem várt módon illetve helyezkednek el szétszórtan az adatok?
</p>
<p>Ha kiválaszt egy mezőt, az eszköz az egyes vektoros elemekhez társított értékek térbeli elrendezését értékelve válaszol a következő kérdésre: Hol találhatók magas és alacsony értékklaszterek?
</p>
</div>
</div>
<div id="inputBins">
<div><h2>Válassza ki az összevonási gyűjtőméretet</h2></div>
<hr/>
<div>
<p>A bemenő pontok elemzésénél alkalmazott négyszög alakú gyűjtők létrehozásához használt távolság.
</p>
</div>
</div>
<div id="timeSlicing">
<div><h2>Hot spotok keresése időbeli lépésekkel (opcionális)</h2></div>
<hr/>
<div>
<p>Ha az idő engedélyezve van a pontrétegen, és azonnali típusú, akkor időbeli lépéseket használva is elemezhet.
</p>
</div>
</div>
<div id="timeInterval">
<div><h2>Időbeli lépés intervalluma</h2></div>
<hr/>
<div>
<p>Az időbeli lépések létrehozásához használt időintervallum. Az idő a bemeneti adatok kezdési vagy befejezési idejéhez, vagy egy meghatározott referenciaidőhöz igazítható.
</p>
</div>
</div>
<div id="timeStep">
<div><h2>Időbeli lépés intervalluma</h2></div>
<hr/>
<div>
<p>Az időbeli lépések létrehozásához használt időintervallum. Az idő a bemeneti adatok kezdési vagy befejezési idejéhez, vagy egy meghatározott referenciaidőhöz igazítható.
</p>
</div>
</div>
<div id="timeStepAlignment">
<div><h2>Válassza ki az időbeli lépések igazításának módját</h2></div>
<hr/>
<div>
<p>Az időbeli lépések igazításának módja. Az időbeli lépések háromféleképpen igazíthatók:
<ul>
<li> <b>Kezdési idő</b> – az időbeli lépéseket az időben első vektoros elemhez igazítja.
</li>
<li> <b>Befejezési idő</b> – az időbeli lépéseket az időben utolsó vektoros elemhez igazítja.
</li>
<li> <b>Referenciaidő</b> – az időbeli lépéseket egy meghatározott időponthoz igazítja.
</li>
</ul>
</p>
</div>
</div>
<div id="timeReference">
<div><h2>Az időbeli lépések igazításához használt referenciaidő</h2></div>
<hr/>
<div>
<p>Az időbeli lépések igazításához használt dátum és időpont.
</p>
</div>
</div>
<div id="neighborhood">
<div><h2>Válassza ki a szomszédság méretét a hotspot-számításokhoz</h2></div>
<hr/>
<div>
<p>A hotspot-számításokhoz használt szomszédság meghatározásához használt távolság. A szomszédságnak nagyobbnak kell lennie a gyűjtő méreténél, hogy mindegyik gyűjtő rendelkezzen legalább egy szomszéddal. Mindegyik gyűjtőt elemzi és összehasonlítja a szomszédos gyűjtőkkel.
</p>
</div>
</div>
<div id="spatialReference">
<div><h2>SpatialReference (WKID)</h2></div>
<hr/>
<div>
<p>Ez az előzetes kiadás egy ideiglenes paramétere az alkalmazott térbeli referencia beállításához. Számos big data eszköz vetületi koordináta-rendszer alkalmazását kívánja meg térbeli referenciaként a feldolgozáshoz. Az eszköz alapértelmezés szerint a bemeneti koordináta-rendszert használja, de eredménytelen lesz, ha az földrajzi koordináta-rendszer. Vetületi koordináta-rendszer beállításához adja meg a WKID-t. A <b>Web Mercator</b> esetén például <code>3857</code>-et kell beírni.
</p>
</div>
</div>
<div id="dataStore">
<div><h2>ArcGIS Data Store adattár kiválasztása az eredmények mentéséhez</h2></div>
<hr/>
<div>
<p>A geoanalitikai eredmények mentése egy adattárban történik, és a(z) Portal for ArcGIS vektoros rétegeiként szerepelnek. Az eredményeket többnyire a térbeli-időbeli adattárban ajánlott tárolni, és az alapértelmezett beállítás is ez. Egyes esetekben jó választás lehet az eredmények mentése a relációs adattárban. Az alábbi érvek szólnak az eredmények relációs adattárban történő tárolása mellett:
<ul>
<li>Az eredmények portálok közötti együttműködésre használhatók.
</li>
<li>Engedélyezheti az eredményekkel való szinkronizálási lehetőségeket.
</li>
</ul>
</p>
<p>Nem ajánlott a relációs adattár használata, ha a geoanalitikai eredmények mennyiségének növekedése várható, és ki kell használni a térbeli-időbeli big data-adattár képességeit a nagy adatmennyiség kezelésére.
</p>
</div>
</div>
<div id="outputName">
<div><h2>Eredmény réteg neve</h2></div>
<hr/>
<div>
<p> A létrejövő réteg neve. Ha egy ArcGIS Data Store helyre ír, akkor eredményei a <b>Saját tartalom</b> alatt lesznek elmentve, és hozzá lesznek adva a térképhez. Ha egy big data fájlmegosztóba ír, akkor eredményei a big data fájlmegosztóba lesznek elmentve, és hozzá lesznek adva annak jegyzékfájljához. Nem lesznek hozzáadva a térképhez. Az alapértelmezett név az eszköz nevétől és a bemenő réteg nevétől függ. Ha a réteg már létezik, akkor a művelet sikertelen lesz.
</p>
<p>Az eredmény réteg megjeleníti a magas és alacsony értékek vagy pontszámok statisztikailag szignifikáns klasztereit. Ha az eredmény réteg neve már létezik, akkor a program megkéri, hogy nevezze át.
</p>
<p>Ha ArcGIS Data Store (relációs vagy térbeli-időbeli big data) adattárba ír az <b>Eredmény mentési helye</b> legördülő mező használatával, akkor megadhatja a <b>Saját tartalom</b> mappájának nevét, ahová az eszköz menti az eredményt.
</p>
</div>
</div>
</div>
</html>
|
{
"pile_set_name": "Github"
}
|
# name lanes alias index speed fec
Ethernet0 0,1 etp1a 1 50000 none
Ethernet2 2,3 etp1b 1 50000 none
Ethernet8 8,9 etp2a 2 50000 none
Ethernet10 10,11 etp2b 2 50000 none
Ethernet16 16,17 etp3a 3 50000 none
Ethernet18 18,19 etp3b 3 50000 none
Ethernet24 24,25,26,27 etp4 4 100000 rs
Ethernet32 32,33 etp5a 5 50000 none
Ethernet34 34,35 etp5b 5 50000 none
Ethernet40 40,41 etp6a 6 50000 none
Ethernet42 42,43 etp6b 6 50000 none
Ethernet48 48,49 etp7a 7 50000 none
Ethernet50 50,51 etp7b 7 50000 none
Ethernet56 56,57,58,59 etp8 8 100000 rs
Ethernet64 64,65 etp9a 9 50000 none
Ethernet66 66,67 etp9b 9 50000 none
Ethernet72 72,73 etp10a 10 50000 none
Ethernet74 74,75 etp10b 10 50000 none
Ethernet80 80,81 etp11a 11 50000 none
Ethernet82 82,83 etp11b 11 50000 none
Ethernet88 88,89,90,91 etp12 12 100000 rs
Ethernet96 96,97 etp13a 13 50000 none
Ethernet98 98,99 etp13b 13 50000 none
Ethernet104 104,105 etp14a 14 50000 none
Ethernet106 106,107 etp14b 14 50000 none
Ethernet112 112,113 etp15a 15 50000 none
Ethernet114 114,115 etp15b 15 50000 none
Ethernet120 120,121,122,123 etp16 16 100000 rs
Ethernet128 128,129 etp17a 17 50000 none
Ethernet130 130,131 etp17b 17 50000 none
Ethernet136 136,137 etp18a 18 50000 none
Ethernet138 138,139 etp18b 18 50000 none
Ethernet144 144,145 etp19a 19 50000 none
Ethernet146 146,147 etp19b 19 50000 none
Ethernet152 152,153,154,155 etp20 20 100000 rs
Ethernet160 160,161 etp21a 21 50000 none
Ethernet162 162,163 etp21b 21 50000 none
Ethernet168 168,169 etp22a 22 50000 none
Ethernet170 170,171 etp22b 22 50000 none
Ethernet176 176,177 etp23a 23 50000 none
Ethernet178 178,179 etp23b 23 50000 none
Ethernet184 184,185,186,187 etp24 24 100000 rs
Ethernet192 192,193,194,195 etp25 25 100000 rs
Ethernet200 200,201,202,203 etp26 26 100000 rs
Ethernet208 208,209 etp27a 27 50000 none
Ethernet210 210,211 etp27b 27 50000 none
Ethernet216 216,217,218,219 etp28 28 100000 rs
Ethernet224 224,225,226,227 etp29 29 100000 rs
Ethernet232 232,233,234,235 etp30 30 100000 rs
Ethernet240 240,241 etp31a 31 50000 none
Ethernet242 242,243 etp31b 31 50000 none
Ethernet248 248,249,250,251 etp32 32 100000 rs
Ethernet256 256,257,258,259 etp33 33 100000 rs
Ethernet264 264,265,266,267 etp34 34 100000 rs
Ethernet272 272,273 etp35a 35 50000 none
Ethernet274 274,275 etp35b 35 50000 none
Ethernet280 280,281,282,283 etp36 36 100000 rs
Ethernet288 288,289,290,291 etp37 37 100000 rs
Ethernet296 296,297,298,299 etp38 38 100000 rs
Ethernet304 304,305 etp39a 39 50000 none
Ethernet306 306,307 etp39b 39 50000 none
Ethernet312 312,313,314,315 etp40 40 100000 rs
Ethernet320 320,321 etp41a 41 50000 none
Ethernet322 322,323 etp41b 41 50000 none
Ethernet328 328,329 etp42a 42 50000 none
Ethernet330 330,331 etp42b 42 50000 none
Ethernet336 336,337 etp43a 43 50000 none
Ethernet338 338,339 etp43b 43 50000 none
Ethernet344 344,345,346,347 etp44 44 100000 rs
Ethernet352 352,353 etp45a 45 50000 none
Ethernet354 354,355 etp45b 45 50000 none
Ethernet360 360,361 etp46a 46 50000 none
Ethernet362 362,363 etp46b 46 50000 none
Ethernet368 368,369 etp47a 47 50000 none
Ethernet370 370,371 etp47b 47 50000 none
Ethernet376 376,377,378,379 etp48 48 100000 rs
Ethernet384 384,385 etp49a 49 50000 none
Ethernet386 386,387 etp49b 49 50000 none
Ethernet392 392,393 etp50a 50 50000 none
Ethernet394 394,395 etp50b 50 50000 none
Ethernet400 400,401 etp51a 51 50000 none
Ethernet402 402,403 etp51b 51 50000 none
Ethernet408 408,409,410,411 etp52 52 100000 rs
Ethernet416 416,417 etp53a 53 50000 none
Ethernet418 418,419 etp53b 53 50000 none
Ethernet424 424,425 etp54a 54 50000 none
Ethernet426 426,427 etp54b 54 50000 none
Ethernet432 432,433 etp55a 55 50000 none
Ethernet434 434,435 etp55b 55 50000 none
Ethernet440 440,441,442,443 etp56 56 100000 rs
Ethernet448 448,449 etp57a 57 50000 none
Ethernet450 450,451 etp57b 57 50000 none
Ethernet456 456,457 etp58a 58 50000 none
Ethernet458 458,459 etp58b 58 50000 none
Ethernet464 464,465 etp59a 59 50000 none
Ethernet466 466,467 etp59b 59 50000 none
Ethernet472 472,473,474,475 etp60 60 100000 rs
Ethernet480 480,481 etp61a 61 50000 none
Ethernet482 482,483 etp61b 61 50000 none
Ethernet488 488,489 etp62a 62 50000 none
Ethernet490 490,491 etp62b 62 50000 none
Ethernet496 496,497 etp63a 63 50000 none
Ethernet498 498,499 etp63b 63 50000 none
Ethernet504 504,505,506,507 etp64 64 100000 rs
|
{
"pile_set_name": "Github"
}
|
package com.alibaba.json.bvt.parser.deser.array;
import com.alibaba.fastjson.JSON;
import junit.framework.TestCase;
/**
* Created by wenshao on 11/01/2017.
*/
public class FieldIntArrayTest extends TestCase {
public void test_intArray() throws Exception {
Model model = JSON.parseObject("{\"value\":[1,2,3]}", Model.class);
assertNotNull(model.value);
assertEquals(3, model.value.length);
assertEquals(1, model.value[0]);
assertEquals(2, model.value[1]);
assertEquals(3, model.value[2]);
}
public static class Model {
public int[] value;
}
}
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: c0e973f8a9f03bd4797c63767e7a18ed
timeCreated: 1498379782
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
{
"pile_set_name": "Github"
}
|
#!/bin/bash
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Script for printing recent commits in a buildbot run.
# Return the sha1 of the given tag. If not present, return "".
# $1: path to repo
# $2: tag name
tt_sha1_for_tag() {
oneline=$(cd $1 && git log -1 $2 --format='%H' 2>/dev/null)
if [ $? -eq 0 ] ; then
echo $oneline
fi
}
# Return the sha1 of HEAD, or ""
# $1: path to repo
tt_sha1_for_head() {
( cd $1 && git log HEAD -n1 --format='%H' | cat )
}
# For the given repo, set tag to HEAD.
# $1: path to repo
# $2: tag name
tt_tag_head() {
( cd $1 && git tag -f $2 )
}
# For the given repo, delete the tag.
# $1: path to repo
# $2: tag name
tt_delete_tag() {
( cd $1 && git tag -d $2 )
}
# For the given repo, set tag to "three commits ago" (for testing).
# $1: path to repo
# $2: tag name
tt_tag_three_ago() {
local sh=$(cd $1 && git log --pretty=oneline -n 3 | tail -1 | awk '{print $1}')
( cd $1 && git tag -f $2 $sh )
}
# List the commits between the given tag and HEAD.
# If the tag does not exist, only list the last few.
# If the tag is at HEAD, list nothing.
# Output format has distinct build steps for repos with changes.
# $1: path to repo
# $2: tag name
# $3: simple/short repo name to use for display
tt_list_commits() {
local tag_sha1=$(tt_sha1_for_tag $1 $2)
local head_sha1=$(tt_sha1_for_head $1)
local display_name=$(echo $3 | sed 's#/#_#g')
if [ "${tag_sha1}" = "${head_sha1}" ] ; then
return
fi
if [ "${tag_sha1}" = "" ] ; then
echo "@@@BUILD_STEP Recent commits in repo $display_name@@@"
echo "NOTE: git tag was not found so we have no baseline."
echo "Here are some recent commits, but they may not be new for this build."
( cd $1 && git log -n 10 --stat | cat)
else
echo "@@@BUILD_STEP New commits in repo $display_name@@@"
( cd $1 && git log -n 500 $2..HEAD --stat | cat)
fi
}
# Clean out the tree truth tags in all repos. For testing.
tt_clean_all() {
for project in $@; do
tt_delete_tag $CHROME_SRC/../$project tree_truth
done
}
# Print tree truth for all clank repos.
tt_print_all() {
for project in $@; do
local full_path=$CHROME_SRC/../$project
tt_list_commits $full_path tree_truth $project
tt_tag_head $full_path tree_truth
done
}
# Print a summary of the last 10 commits for each repo.
tt_brief_summary() {
echo "@@@BUILD_STEP Brief summary of recent CLs in every branch@@@"
for project in $@; do
echo $project:
local full_path=$CHROME_SRC/../$project
(cd $full_path && git log -n 10 --format=" %H %s %an, %ad" | cat)
echo "================================================================="
done
}
CHROME_SRC=$1
shift
PROJECT_LIST=$@
tt_brief_summary $PROJECT_LIST
tt_print_all $PROJECT_LIST
|
{
"pile_set_name": "Github"
}
|
@import 'public/less/variables.less';
.staging {
background: #643a44;
box-shadow: 0 -1px 15px #252833;
color: #b8a5a5;
z-index: 5;
position: relative;
.form-control {
&:disabled {
background-color: rgba(64, 36, 43, 0.75);
}
}
textarea.commit-body {
resize: vertical;
}
.arrow {
border-top-color: #643a44;
left: (@log-width-small + 45px);
bottom: -30px;
}
.commitnpush.disabled {
pointer-events: none;
opacity: 0.5;
}
.file-area {
position: relative;
}
.validationError {
display: none;
color: #d6542d;
padding: 0.25em;
}
&:hover .validationError {
display: inline-block;
}
.diffContainer {
margin-top: 0;
border-radius: 3px;
background: rgba(255, 255, 255, 0.1);
}
.discard {
background: transparent;
color: rgba(255, 255, 255, 0.3);
border-radius: 3px;
padding: 3px;
padding-left: 5px;
padding-right: 5px;
cursor: pointer;
&:focus,
&:hover {
background: #000000;
color: rgba(255, 255, 255, 0.9);
}
}
.ignore {
background: transparent;
color: rgba(255, 255, 255, 0.3);
border-radius: 3px;
padding: 3px;
padding-left: 5px;
padding-right: 5px;
cursor: pointer;
font-weight: bold;
&:focus,
&:hover {
background: #5555ff;
color: rgba(255, 255, 255, 0.9);
}
}
.patch {
background: #279124;
color: rgba(255, 255, 255, 0.9);
border-radius: 3px;
padding: 3px;
padding-left: 5px;
padding-right: 5px;
cursor: pointer;
font-weight: bold;
&:focus,
&:hover {
background: #279124;
color: rgba(255, 255, 255, 0.9);
}
}
.d2h-code-line-prefix input[type='checkbox'] {
margin: 0;
margin-right: -6px;
vertical-align: sub;
}
.files {
position: relative;
.file {
padding: 0.3em;
&.showingDiffs {
.name {
background: rgba(255, 255, 255, 0.1);
color: #000000;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
}
.checkmark {
span {
top: 5px;
}
}
.name {
background: transparent;
font-size: 1.3em;
cursor: pointer;
padding: 3px;
border: 0;
border-radius: 3px;
color: rgba(255, 255, 255, 0.8);
}
.new,
.deleted,
.conflict,
.markresolved,
.launchmergetool {
padding: 3px;
padding-left: 5px;
padding-right: 5px;
}
.new,
.additions {
color: #949494;
vertical-align: middle;
}
.deleted,
.deletions {
color: #7b7b7b;
vertical-align: middle;
}
.conflict {
color: #db12c0;
.explanation {
display: none;
}
&:hover {
.explanation {
display: inline;
}
.temporary {
display: none;
}
}
}
.markresolved {
color: #db12c0;
cursor: pointer;
.explanation {
display: none;
}
&:hover {
background: #a445ed;
color: #000000;
border-radius: 3px;
.explanation {
display: inline;
}
}
}
.launchmergetool {
color: #db55ff;
cursor: pointer;
.explanation {
display: none;
}
&:hover {
background: #a477ff;
color: #000000;
border-radius: 3px;
.explanation {
display: inline;
}
}
}
}
}
}
@media (min-width: @screen-md-min) {
.staging {
.arrow {
left: (@log-width-large + 45px);
}
}
}
.commit-message-title-counter {
right: 20px;
position: absolute;
}
.amend-button {
padding: 0;
&:active,
&:focus,
&:hover {
text-decoration: none;
}
}
.checkmark {
color: #ffffff;
display: inline-block;
opacity: 0.3;
cursor: pointer;
&.checked {
opacity: 0.8;
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.sun.org.apache.xerces.internal.impl.dtd;
import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter;
/**
* Defines a DTD Validator filter to allow
* components to query the DTD validator.
*
* @xerces.internal
*
* @author Elena Litani, IBM
*
*/
public interface XMLDTDValidatorFilter
extends XMLDocumentFilter {
/**
* Returns true if the validator has a DTD grammar
*
* @return true if the validator has a DTD grammar
*/
public boolean hasGrammar();
/**
* Return true if validator must validate the document
*
* @return true if validator must validate the document
*/
public boolean validate();
} // interface XMLDTDValidatorFilter
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2012-2019 Apple 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:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
*/
#pragma once
#include "JSObject.h"
namespace JSC {
struct ClassInfo;
class JSDestructibleObject : public JSNonFinalObject {
public:
typedef JSNonFinalObject Base;
static const bool needsDestruction = true;
template<typename CellType, SubspaceAccess>
static CompleteSubspace* subspaceFor(VM& vm)
{
return &vm.destructibleObjectSpace;
}
const ClassInfo* classInfo() const { return m_classInfo; }
static ptrdiff_t classInfoOffset() { return OBJECT_OFFSETOF(JSDestructibleObject, m_classInfo); }
protected:
JSDestructibleObject(VM& vm, Structure* structure, Butterfly* butterfly = 0)
: JSNonFinalObject(vm, structure, butterfly)
, m_classInfo(structure->classInfo())
{
ASSERT(m_classInfo);
}
private:
const ClassInfo* m_classInfo;
};
} // namespace JSC
|
{
"pile_set_name": "Github"
}
|
@import url('widgets.css');
/* FORM ROWS */
.form-row {
overflow: hidden;
padding: 10px;
font-size: 13px;
border-bottom: 1px solid #eee;
}
.form-row img, .form-row input {
vertical-align: middle;
}
.form-row label input[type="checkbox"] {
margin-top: 0;
vertical-align: 0;
}
form .form-row p {
padding-left: 0;
}
.hidden {
display: none;
}
/* FORM LABELS */
label {
font-weight: normal;
color: #666;
font-size: 13px;
}
.required label, label.required {
font-weight: bold;
color: #333;
}
/* RADIO BUTTONS */
form ul.radiolist li {
list-style-type: none;
}
form ul.radiolist label {
float: none;
display: inline;
}
form ul.radiolist input[type="radio"] {
margin: -2px 4px 0 0;
padding: 0;
}
form ul.inline {
margin-left: 0;
padding: 0;
}
form ul.inline li {
float: left;
padding-right: 7px;
}
/* ALIGNED FIELDSETS */
.aligned label {
display: block;
padding: 4px 10px 0 0;
float: left;
width: 160px;
word-wrap: break-word;
line-height: 1;
}
.aligned label:not(.vCheckboxLabel):after {
content: '';
display: inline-block;
vertical-align: middle;
height: 26px;
}
.aligned label + p, .aligned label + div.help, .aligned label + div.readonly {
padding: 6px 0;
margin-top: 0;
margin-bottom: 0;
margin-left: 170px;
}
.aligned ul label {
display: inline;
float: none;
width: auto;
}
.aligned .form-row input {
margin-bottom: 0;
}
.colMS .aligned .vLargeTextField, .colMS .aligned .vXMLLargeTextField {
width: 350px;
}
form .aligned ul {
margin-left: 160px;
padding-left: 10px;
}
form .aligned ul.radiolist {
display: inline-block;
margin: 0;
padding: 0;
}
form .aligned p.help,
form .aligned div.help {
clear: left;
margin-top: 0;
margin-left: 160px;
padding-left: 10px;
}
form .aligned label + p.help,
form .aligned label + div.help {
margin-left: 0;
padding-left: 0;
}
form .aligned p.help:last-child,
form .aligned div.help:last-child {
margin-bottom: 0;
padding-bottom: 0;
}
form .aligned input + p.help,
form .aligned textarea + p.help,
form .aligned select + p.help,
form .aligned input + div.help,
form .aligned textarea + div.help,
form .aligned select + div.help {
margin-left: 160px;
padding-left: 10px;
}
form .aligned ul li {
list-style: none;
}
form .aligned table p {
margin-left: 0;
padding-left: 0;
}
.aligned .vCheckboxLabel {
float: none;
width: auto;
display: inline-block;
vertical-align: -3px;
padding: 0 0 5px 5px;
}
.aligned .vCheckboxLabel + p.help,
.aligned .vCheckboxLabel + div.help {
margin-top: -4px;
}
.colM .aligned .vLargeTextField, .colM .aligned .vXMLLargeTextField {
width: 610px;
}
.checkbox-row p.help,
.checkbox-row div.help {
margin-left: 0;
padding-left: 0;
}
fieldset .field-box {
float: left;
margin-right: 20px;
}
/* WIDE FIELDSETS */
.wide label {
width: 200px;
}
form .wide p,
form .wide input + p.help,
form .wide input + div.help {
margin-left: 200px;
}
form .wide p.help,
form .wide div.help {
padding-left: 38px;
}
form div.help ul {
padding-left: 0;
margin-left: 0;
}
.colM fieldset.wide .vLargeTextField, .colM fieldset.wide .vXMLLargeTextField {
width: 450px;
}
/* COLLAPSED FIELDSETS */
fieldset.collapsed * {
display: none;
}
fieldset.collapsed h2, fieldset.collapsed {
display: block;
}
fieldset.collapsed {
border: 1px solid #eee;
border-radius: 4px;
overflow: hidden;
}
fieldset.collapsed h2 {
background: #f8f8f8;
color: #666;
}
fieldset .collapse-toggle {
color: #fff;
}
fieldset.collapsed .collapse-toggle {
background: transparent;
display: inline;
color: #447e9b;
}
/* MONOSPACE TEXTAREAS */
fieldset.monospace textarea {
font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
}
/* SUBMIT ROW */
.submit-row {
padding: 12px 14px;
margin: 0 0 20px;
background: #f8f8f8;
border: 1px solid #eee;
border-radius: 4px;
text-align: right;
overflow: hidden;
}
body.popup .submit-row {
overflow: auto;
}
.submit-row input {
height: 35px;
line-height: 15px;
margin: 0 0 0 5px;
}
.submit-row input.default {
margin: 0 0 0 8px;
text-transform: uppercase;
}
.submit-row p {
margin: 0.3em;
}
.submit-row p.deletelink-box {
float: left;
margin: 0;
}
.submit-row a.deletelink {
display: block;
background: #ba2121;
border-radius: 4px;
padding: 10px 15px;
height: 15px;
line-height: 15px;
color: #fff;
}
.submit-row a.deletelink:focus,
.submit-row a.deletelink:hover,
.submit-row a.deletelink:active {
background: #a41515;
}
/* CUSTOM FORM FIELDS */
.vSelectMultipleField {
vertical-align: top;
}
.vCheckboxField {
border: none;
}
.vDateField, .vTimeField {
margin-right: 2px;
margin-bottom: 4px;
}
.vDateField {
min-width: 6.85em;
}
.vTimeField {
min-width: 4.7em;
}
.vURLField {
width: 30em;
}
.vLargeTextField, .vXMLLargeTextField {
width: 48em;
}
.flatpages-flatpage #id_content {
height: 40.2em;
}
.module table .vPositiveSmallIntegerField {
width: 2.2em;
}
.vTextField {
width: 20em;
}
.vIntegerField {
width: 5em;
}
.vBigIntegerField {
width: 10em;
}
.vForeignKeyRawIdAdminField {
width: 5em;
}
/* INLINES */
.inline-group {
padding: 0;
margin: 0 0 30px;
}
.inline-group thead th {
padding: 8px 10px;
}
.inline-group .aligned label {
width: 160px;
}
.inline-related {
position: relative;
}
.inline-related h3 {
margin: 0;
color: #666;
padding: 5px;
font-size: 13px;
background: #f8f8f8;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
}
.inline-related h3 span.delete {
float: right;
}
.inline-related h3 span.delete label {
margin-left: 2px;
font-size: 11px;
}
.inline-related fieldset {
margin: 0;
background: #fff;
border: none;
width: 100%;
}
.inline-related fieldset.module h3 {
margin: 0;
padding: 2px 5px 3px 5px;
font-size: 11px;
text-align: left;
font-weight: bold;
background: #bcd;
color: #fff;
}
.inline-group .tabular fieldset.module {
border: none;
}
.inline-related.tabular fieldset.module table {
width: 100%;
}
.last-related fieldset {
border: none;
}
.inline-group .tabular tr.has_original td {
padding-top: 2em;
}
.inline-group .tabular tr td.original {
padding: 2px 0 0 0;
width: 0;
_position: relative;
}
.inline-group .tabular th.original {
width: 0px;
padding: 0;
}
.inline-group .tabular td.original p {
position: absolute;
left: 0;
height: 1.1em;
padding: 2px 9px;
overflow: hidden;
font-size: 9px;
font-weight: bold;
color: #666;
_width: 700px;
}
.inline-group ul.tools {
padding: 0;
margin: 0;
list-style: none;
}
.inline-group ul.tools li {
display: inline;
padding: 0 5px;
}
.inline-group div.add-row,
.inline-group .tabular tr.add-row td {
color: #666;
background: #f8f8f8;
padding: 8px 10px;
border-bottom: 1px solid #eee;
}
.inline-group .tabular tr.add-row td {
padding: 8px 10px;
border-bottom: 1px solid #eee;
}
.inline-group ul.tools a.add,
.inline-group div.add-row a,
.inline-group .tabular tr.add-row td a {
background: url(../img/icon-addlink.svg) 0 1px no-repeat;
padding-left: 16px;
font-size: 12px;
}
.empty-form {
display: none;
}
/* RELATED FIELD ADD ONE / LOOKUP */
.add-another, .related-lookup {
margin-left: 5px;
display: inline-block;
vertical-align: middle;
background-repeat: no-repeat;
background-size: 14px;
}
.add-another {
width: 16px;
height: 16px;
background-image: url(../img/icon-addlink.svg);
}
.related-lookup {
width: 16px;
height: 16px;
background-image: url(../img/search.svg);
}
form .related-widget-wrapper ul {
display: inline-block;
margin-left: 0;
padding-left: 0;
}
.clearable-file-input input {
margin-top: 0;
}
|
{
"pile_set_name": "Github"
}
|
MIME-Version: 1.0
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----691EE3D80E414D8952A0FC56F7302C22"
This is an S/MIME signed message
------691EE3D80E414D8952A0FC56F7302C22
Content-Type: text/plain
<?xml version="1.0"?>
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.omg.org/spec/DDS-SECURITY/20160303/omg_shared_ca_permissions.xsd">
<permissions>
<grant name="factory_grant_read_domain_0">
<!-- only allow join domain 0 and read protected topics. No explicit permission to write any topic -->
<subject_name>/C=GB/ST=JQ/O=Bob's Magical Widget Factory/CN=Roberto Gonzales/emailAddress=bob@magicalwidgets.com</subject_name>
<validity>
<!-- Format is CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm] in GMT -->
<not_before>2015-09-15T01:00:00</not_before>
<not_after>2025-09-15T01:00:00</not_after>
</validity>
<allow_rule>
<domains>
<id>0</id>
</domains>
<!-- Naming for Topics (see governance xml files)
OD / PD : Open / Protected Discovery
OL / PL : Open / Protected Liveliness
OA / RA / WA / RWA : Open / Read / Write / ReadWrite Access
OM / SM / EM / SOM / EOM : Open / Signed / Encrypted / Signed with Origin authentication / Encrypted with Origin authentication Meta-data
OD / SD / ED : Open / Signed / Encrypted Data
-->
<subscribe>
<topics>
<topic>OD_OL_OA_OM_OD</topic>
<topic>OD_OL_OA_OM_SD</topic>
<topic>OD_OL_OA_OM_ED</topic>
<topic>OD_OL_OA_SM_OD</topic>
<topic>OD_OL_OA_SM_SD</topic>
<topic>OD_OL_OA_SM_ED</topic>
<topic>OD_OL_OA_EM_OD</topic>
<topic>OD_OL_OA_EM_SD</topic>
<topic>OD_OL_OA_EM_ED</topic>
<topic>OD_OL_OA_SOM_OD</topic>
<topic>OD_OL_OA_SOM_SD</topic>
<topic>OD_OL_OA_SOM_ED</topic>
<topic>OD_OL_OA_EOM_OD</topic>
<topic>OD_OL_OA_EOM_SD</topic>
<topic>OD_OL_OA_EOM_ED</topic>
<topic>OD_OL_WA_OM_OD</topic>
<topic>OD_OL_WA_OM_SD</topic>
<topic>OD_OL_WA_OM_ED</topic>
<topic>OD_OL_WA_SM_OD</topic>
<topic>OD_OL_WA_SM_SD</topic>
<topic>OD_OL_WA_SM_ED</topic>
<topic>OD_OL_WA_EM_OD</topic>
<topic>OD_OL_WA_EM_SD</topic>
<topic>OD_OL_WA_EM_ED</topic>
<topic>OD_OL_WA_SOM_OD</topic>
<topic>OD_OL_WA_SOM_SD</topic>
<topic>OD_OL_WA_SOM_ED</topic>
<topic>OD_OL_WA_EOM_OD</topic>
<topic>OD_OL_WA_EOM_SD</topic>
<topic>OD_OL_WA_EOM_ED</topic>
<topic>OD_OL_RA_OM_OD</topic>
<topic>OD_OL_RA_OM_SD</topic>
<topic>OD_OL_RA_OM_ED</topic>
<topic>OD_OL_RA_SM_OD</topic>
<topic>OD_OL_RA_SM_SD</topic>
<topic>OD_OL_RA_SM_ED</topic>
<topic>OD_OL_RA_EM_OD</topic>
<topic>OD_OL_RA_EM_SD</topic>
<topic>OD_OL_RA_EM_ED</topic>
<topic>OD_OL_RA_SOM_OD</topic>
<topic>OD_OL_RA_SOM_SD</topic>
<topic>OD_OL_RA_SOM_ED</topic>
<topic>OD_OL_RA_EOM_OD</topic>
<topic>OD_OL_RA_EOM_SD</topic>
<topic>OD_OL_RA_EOM_ED</topic>
<topic>OD_OL_RWA_OM_OD</topic>
<topic>OD_OL_RWA_OM_SD</topic>
<topic>OD_OL_RWA_OM_ED</topic>
<topic>OD_OL_RWA_SM_OD</topic>
<topic>OD_OL_RWA_SM_SD</topic>
<topic>OD_OL_RWA_SM_ED</topic>
<topic>OD_OL_RWA_EM_OD</topic>
<topic>OD_OL_RWA_EM_SD</topic>
<topic>OD_OL_RWA_EM_ED</topic>
<topic>OD_OL_RWA_SOM_OD</topic>
<topic>OD_OL_RWA_SOM_SD</topic>
<topic>OD_OL_RWA_SOM_ED</topic>
<topic>OD_OL_RWA_EOM_OD</topic>
<topic>OD_OL_RWA_EOM_SD</topic>
<topic>OD_OL_RWA_EOM_ED</topic>
<topic>OD_PL_OA_OM_OD</topic>
<topic>OD_PL_OA_OM_SD</topic>
<topic>OD_PL_OA_OM_ED</topic>
<topic>OD_PL_OA_SM_OD</topic>
<topic>OD_PL_OA_SM_SD</topic>
<topic>OD_PL_OA_SM_ED</topic>
<topic>OD_PL_OA_EM_OD</topic>
<topic>OD_PL_OA_EM_SD</topic>
<topic>OD_PL_OA_EM_ED</topic>
<topic>OD_PL_OA_SOM_OD</topic>
<topic>OD_PL_OA_SOM_SD</topic>
<topic>OD_PL_OA_SOM_ED</topic>
<topic>OD_PL_OA_EOM_OD</topic>
<topic>OD_PL_OA_EOM_SD</topic>
<topic>OD_PL_OA_EOM_ED</topic>
<topic>OD_PL_WA_OM_OD</topic>
<topic>OD_PL_WA_OM_SD</topic>
<topic>OD_PL_WA_OM_ED</topic>
<topic>OD_PL_WA_SM_OD</topic>
<topic>OD_PL_WA_SM_SD</topic>
<topic>OD_PL_WA_SM_ED</topic>
<topic>OD_PL_WA_EM_OD</topic>
<topic>OD_PL_WA_EM_SD</topic>
<topic>OD_PL_WA_EM_ED</topic>
<topic>OD_PL_WA_SOM_OD</topic>
<topic>OD_PL_WA_SOM_SD</topic>
<topic>OD_PL_WA_SOM_ED</topic>
<topic>OD_PL_WA_EOM_OD</topic>
<topic>OD_PL_WA_EOM_SD</topic>
<topic>OD_PL_WA_EOM_ED</topic>
<topic>OD_PL_RA_OM_OD</topic>
<topic>OD_PL_RA_OM_SD</topic>
<topic>OD_PL_RA_OM_ED</topic>
<topic>OD_PL_RA_SM_OD</topic>
<topic>OD_PL_RA_SM_SD</topic>
<topic>OD_PL_RA_SM_ED</topic>
<topic>OD_PL_RA_EM_OD</topic>
<topic>OD_PL_RA_EM_SD</topic>
<topic>OD_PL_RA_EM_ED</topic>
<topic>OD_PL_RA_SOM_OD</topic>
<topic>OD_PL_RA_SOM_SD</topic>
<topic>OD_PL_RA_SOM_ED</topic>
<topic>OD_PL_RA_EOM_OD</topic>
<topic>OD_PL_RA_EOM_SD</topic>
<topic>OD_PL_RA_EOM_ED</topic>
<topic>OD_PL_RWA_OM_OD</topic>
<topic>OD_PL_RWA_OM_SD</topic>
<topic>OD_PL_RWA_OM_ED</topic>
<topic>OD_PL_RWA_SM_OD</topic>
<topic>OD_PL_RWA_SM_SD</topic>
<topic>OD_PL_RWA_SM_ED</topic>
<topic>OD_PL_RWA_EM_OD</topic>
<topic>OD_PL_RWA_EM_SD</topic>
<topic>OD_PL_RWA_EM_ED</topic>
<topic>OD_PL_RWA_SOM_OD</topic>
<topic>OD_PL_RWA_SOM_SD</topic>
<topic>OD_PL_RWA_SOM_ED</topic>
<topic>OD_PL_RWA_EOM_OD</topic>
<topic>OD_PL_RWA_EOM_SD</topic>
<topic>OD_PL_RWA_EOM_ED</topic>
<topic>PD_OL_OA_OM_OD</topic>
<topic>PD_OL_OA_OM_SD</topic>
<topic>PD_OL_OA_OM_ED</topic>
<topic>PD_OL_OA_SM_OD</topic>
<topic>PD_OL_OA_SM_SD</topic>
<topic>PD_OL_OA_SM_ED</topic>
<topic>PD_OL_OA_EM_OD</topic>
<topic>PD_OL_OA_EM_SD</topic>
<topic>PD_OL_OA_EM_ED</topic>
<topic>PD_OL_OA_SOM_OD</topic>
<topic>PD_OL_OA_SOM_SD</topic>
<topic>PD_OL_OA_SOM_ED</topic>
<topic>PD_OL_OA_EOM_OD</topic>
<topic>PD_OL_OA_EOM_SD</topic>
<topic>PD_OL_OA_EOM_ED</topic>
<topic>PD_OL_WA_OM_OD</topic>
<topic>PD_OL_WA_OM_SD</topic>
<topic>PD_OL_WA_OM_ED</topic>
<topic>PD_OL_WA_SM_OD</topic>
<topic>PD_OL_WA_SM_SD</topic>
<topic>PD_OL_WA_SM_ED</topic>
<topic>PD_OL_WA_EM_OD</topic>
<topic>PD_OL_WA_EM_SD</topic>
<topic>PD_OL_WA_EM_ED</topic>
<topic>PD_OL_WA_SOM_OD</topic>
<topic>PD_OL_WA_SOM_SD</topic>
<topic>PD_OL_WA_SOM_ED</topic>
<topic>PD_OL_WA_EOM_OD</topic>
<topic>PD_OL_WA_EOM_SD</topic>
<topic>PD_OL_WA_EOM_ED</topic>
<topic>PD_OL_RA_OM_OD</topic>
<topic>PD_OL_RA_OM_SD</topic>
<topic>PD_OL_RA_OM_ED</topic>
<topic>PD_OL_RA_SM_OD</topic>
<topic>PD_OL_RA_SM_SD</topic>
<topic>PD_OL_RA_SM_ED</topic>
<topic>PD_OL_RA_EM_OD</topic>
<topic>PD_OL_RA_EM_SD</topic>
<topic>PD_OL_RA_EM_ED</topic>
<topic>PD_OL_RA_SOM_OD</topic>
<topic>PD_OL_RA_SOM_SD</topic>
<topic>PD_OL_RA_SOM_ED</topic>
<topic>PD_OL_RA_EOM_OD</topic>
<topic>PD_OL_RA_EOM_SD</topic>
<topic>PD_OL_RA_EOM_ED</topic>
<topic>PD_OL_RWA_OM_OD</topic>
<topic>PD_OL_RWA_OM_SD</topic>
<topic>PD_OL_RWA_OM_ED</topic>
<topic>PD_OL_RWA_SM_OD</topic>
<topic>PD_OL_RWA_SM_SD</topic>
<topic>PD_OL_RWA_SM_ED</topic>
<topic>PD_OL_RWA_EM_OD</topic>
<topic>PD_OL_RWA_EM_SD</topic>
<topic>PD_OL_RWA_EM_ED</topic>
<topic>PD_OL_RWA_SOM_OD</topic>
<topic>PD_OL_RWA_SOM_SD</topic>
<topic>PD_OL_RWA_SOM_ED</topic>
<topic>PD_OL_RWA_EOM_OD</topic>
<topic>PD_OL_RWA_EOM_SD</topic>
<topic>PD_OL_RWA_EOM_ED</topic>
<topic>PD_PL_OA_OM_OD</topic>
<topic>PD_PL_OA_OM_SD</topic>
<topic>PD_PL_OA_OM_ED</topic>
<topic>PD_PL_OA_SM_OD</topic>
<topic>PD_PL_OA_SM_SD</topic>
<topic>PD_PL_OA_SM_ED</topic>
<topic>PD_PL_OA_EM_OD</topic>
<topic>PD_PL_OA_EM_SD</topic>
<topic>PD_PL_OA_EM_ED</topic>
<topic>PD_PL_OA_SOM_OD</topic>
<topic>PD_PL_OA_SOM_SD</topic>
<topic>PD_PL_OA_SOM_ED</topic>
<topic>PD_PL_OA_EOM_OD</topic>
<topic>PD_PL_OA_EOM_SD</topic>
<topic>PD_PL_OA_EOM_ED</topic>
<topic>PD_PL_WA_OM_OD</topic>
<topic>PD_PL_WA_OM_SD</topic>
<topic>PD_PL_WA_OM_ED</topic>
<topic>PD_PL_WA_SM_OD</topic>
<topic>PD_PL_WA_SM_SD</topic>
<topic>PD_PL_WA_SM_ED</topic>
<topic>PD_PL_WA_EM_OD</topic>
<topic>PD_PL_WA_EM_SD</topic>
<topic>PD_PL_WA_EM_ED</topic>
<topic>PD_PL_WA_SOM_OD</topic>
<topic>PD_PL_WA_SOM_SD</topic>
<topic>PD_PL_WA_SOM_ED</topic>
<topic>PD_PL_WA_EOM_OD</topic>
<topic>PD_PL_WA_EOM_SD</topic>
<topic>PD_PL_WA_EOM_ED</topic>
<topic>PD_PL_RA_OM_OD</topic>
<topic>PD_PL_RA_OM_SD</topic>
<topic>PD_PL_RA_OM_ED</topic>
<topic>PD_PL_RA_SM_OD</topic>
<topic>PD_PL_RA_SM_SD</topic>
<topic>PD_PL_RA_SM_ED</topic>
<topic>PD_PL_RA_EM_OD</topic>
<topic>PD_PL_RA_EM_SD</topic>
<topic>PD_PL_RA_EM_ED</topic>
<topic>PD_PL_RA_SOM_OD</topic>
<topic>PD_PL_RA_SOM_SD</topic>
<topic>PD_PL_RA_SOM_ED</topic>
<topic>PD_PL_RA_EOM_OD</topic>
<topic>PD_PL_RA_EOM_SD</topic>
<topic>PD_PL_RA_EOM_ED</topic>
<topic>PD_PL_RWA_OM_OD</topic>
<topic>PD_PL_RWA_OM_SD</topic>
<topic>PD_PL_RWA_OM_ED</topic>
<topic>PD_PL_RWA_SM_OD</topic>
<topic>PD_PL_RWA_SM_SD</topic>
<topic>PD_PL_RWA_SM_ED</topic>
<topic>PD_PL_RWA_EM_OD</topic>
<topic>PD_PL_RWA_EM_SD</topic>
<topic>PD_PL_RWA_EM_ED</topic>
<topic>PD_PL_RWA_SOM_OD</topic>
<topic>PD_PL_RWA_SOM_SD</topic>
<topic>PD_PL_RWA_SOM_ED</topic>
<topic>PD_PL_RWA_EOM_OD</topic>
<topic>PD_PL_RWA_EOM_SD</topic>
<topic>PD_PL_RWA_EOM_ED</topic>
</topics>
</subscribe>
</allow_rule>
<default>DENY</default>
</grant>
</permissions>
</dds>
------691EE3D80E414D8952A0FC56F7302C22
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
MIIHEAYJKoZIhvcNAQcCoIIHATCCBv0CAQExDzANBglghkgBZQMEAgEFADALBgkq
hkiG9w0BBwGgggP4MIID9DCCAtwCCQCkjopvwK438jANBgkqhkiG9w0BAQsFADCB
uzELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk1PMRQwEgYDVQQHDAtTYWludCBMb3Vp
czEvMC0GA1UECgwmT2JqZWN0IENvbXB1dGluZyAoVGVzdCBQZXJtaXNzaW9ucyBD
QSkxLzAtBgNVBAMMJk9iamVjdCBDb21wdXRpbmcgKFRlc3QgUGVybWlzc2lvbnMg
Q0EpMScwJQYJKoZIhvcNAQkBFhhpbmZvQG9iamVjdGNvbXB1dGluZy5jb20wHhcN
MTgwNjEzMDQyMDEzWhcNMjgwNjEwMDQyMDEzWjCBuzELMAkGA1UEBhMCVVMxCzAJ
BgNVBAgMAk1PMRQwEgYDVQQHDAtTYWludCBMb3VpczEvMC0GA1UECgwmT2JqZWN0
IENvbXB1dGluZyAoVGVzdCBQZXJtaXNzaW9ucyBDQSkxLzAtBgNVBAMMJk9iamVj
dCBDb21wdXRpbmcgKFRlc3QgUGVybWlzc2lvbnMgQ0EpMScwJQYJKoZIhvcNAQkB
FhhpbmZvQG9iamVjdGNvbXB1dGluZy5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQCd3osCHskwiWPkgQ+FiUJEPj9lGAV6gqnG9XcTHPzOsv+hrWck
lq4WcTcu5ERxjvwzrfB9MV2Jj1mhnAQfp0sIuTJe4QoXigyf0IyezsSA1oeofkJu
BlA6cR+5ATzfNEcJJG3sVaEaa0L92CXb147LczMMY+6I/jD9H/Kamoph1hCgdh2l
GnYN97ETMxX5qINthO17/qZ55R+H5nE2Op1f4Y0LhjKu3WztEjIZeAJDgAksoYRy
nVhfDsshdZWUMSO0jHJGPwEvxwhTsAknWdthuE/xgZQqDP3aXj3MFJcZkydS+8xv
nX0cuHsr/7MqVK0oOmjWS7pi7cMBY9DtB3KVAgMBAAEwDQYJKoZIhvcNAQELBQAD
ggEBAE9QWa1xNjxLWIw88eVrQxOBCIlqCkAiTx2pAurEdiDtz8ZQdDMQQmoAuppT
6LWVVtOWc1bP3a+IHBolNAimXOm+B9fMSvQnqRbriJZ8Hc5+Y5TXlJ3iyqJDEyPi
WhUFLfQfnjE8hRL5oKPkhk2gRC6K5x+10cZMclgEmZONANtAuSJurMhwgqLxwgGw
51aIpL6LTxtdZ33LIPM8AN51Tgj5t2VM/49iNq9HdqAl7VQuyHEc/eCAIp7p69nq
cpS9VBJAJoHN8lmDDHYxM+pYtQAgmBKLBxTyDrgJZ+3j3FVOp0orRxarE3XjJ+0b
IVnO6yhjunPOpgsyEcxH9/7Enm8xggLcMIIC2AIBATCByTCBuzELMAkGA1UEBhMC
VVMxCzAJBgNVBAgMAk1PMRQwEgYDVQQHDAtTYWludCBMb3VpczEvMC0GA1UECgwm
T2JqZWN0IENvbXB1dGluZyAoVGVzdCBQZXJtaXNzaW9ucyBDQSkxLzAtBgNVBAMM
Jk9iamVjdCBDb21wdXRpbmcgKFRlc3QgUGVybWlzc2lvbnMgQ0EpMScwJQYJKoZI
hvcNAQkBFhhpbmZvQG9iamVjdGNvbXB1dGluZy5jb20CCQCkjopvwK438jANBglg
hkgBZQMEAgEFAKCB5DAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3
DQEJBTEPFw0xODA3MjMxNjUwMTJaMC8GCSqGSIb3DQEJBDEiBCCLQks5LHZdSCoF
s0BAml0kCsoprPfqhKiW6v/AvmHNOTB5BgkqhkiG9w0BCQ8xbDBqMAsGCWCGSAFl
AwQBKjALBglghkgBZQMEARYwCwYJYIZIAWUDBAECMAoGCCqGSIb3DQMHMA4GCCqG
SIb3DQMCAgIAgDANBggqhkiG9w0DAgIBQDAHBgUrDgMCBzANBggqhkiG9w0DAgIB
KDANBgkqhkiG9w0BAQEFAASCAQB5W8C7EiIeWlJ0TTmt1wYg8QpnT8Bh/+doRkAe
K3eHyG+dloXaubwtbza0kCna7PjrzjciFqe86GTEWWKl8yzNZO4EhXtwXAM+T42X
tPE31aFzH7AeJBIeyKVe8qz3Bsj3k5uFE1ftsRlzCDk/DsdEN9gfShC4vKLflMUg
afLzyaWXKO+KWhZikR9Jm0njMU4il/AzScnrhjYHzfRCtC+wsysoPdqoGTD/kT6x
Dxfa+51q+RmWn8BHim9IGUCslL8xRfRxGc35OOcEETI52fa/1jNhPF3LLOPpL6D3
tde76C+xnVb+82xGOJqCm9LirKzbuFvFpw1STv3Y74EOpK05
------691EE3D80E414D8952A0FC56F7302C22--
|
{
"pile_set_name": "Github"
}
|
<map id="examples/CompDualStateButton" name="examples/CompDualStateButton">
<area shape="rect" id="node1" href="dir_3a828b7214103d705cc83e20f29bdad9.html" title="CompDualStateButton" alt="" coords="27,52,181,100"/>
<area shape="rect" id="clust1" href="dir_d28a4824dc47e487b107a5db32ef43c4.html" title="examples" alt="" coords="16,16,192,111"/>
</map>
|
{
"pile_set_name": "Github"
}
|
// Copyright 2013-2015 Serilog Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace Serilog.Configuration
{
/// <summary>
/// Implemented on types that apply settings to a logger configuration.
/// </summary>
public interface ILoggerSettings
{
/// <summary>
/// Apply the settings to the logger configuration.
/// </summary>
/// <param name="loggerConfiguration">The logger configuration to apply settings to.</param>
void Configure(LoggerConfiguration loggerConfiguration);
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
module.exports = isHostObject;
|
{
"pile_set_name": "Github"
}
|
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DesignProject", "DesignProject\DesignProject.csproj", "{E3E203B8-59C1-4F9B-9166-45C129A1B253}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E3E203B8-59C1-4F9B-9166-45C129A1B253}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E3E203B8-59C1-4F9B-9166-45C129A1B253}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E3E203B8-59C1-4F9B-9166-45C129A1B253}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E3E203B8-59C1-4F9B-9166-45C129A1B253}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1A778FED-5F87-48AF-845C-F8FE202DC43A}
EndGlobalSection
EndGlobal
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Model - Customer
*
* Models WooCommerce post-type data
*
* @package WPGraphQL\WooCommerce\Model
* @since 0.0.1
*/
namespace WPGraphQL\WooCommerce\Model;
use GraphQLRelay\Relay;
use WPGraphQL\Model\Model;
use WC_Customer;
/**
* Class Customer
*/
class Customer extends Model {
/**
* Customer constructor
*
* @param WC_Customer|int $id - User ID.
*/
public function __construct( $id = 'session' ) {
$this->data = 'session' === $id ? \WC()->customer : new WC_Customer( $id );
$allowed_restricted_fields = array(
'isRestricted',
'isPrivate',
'isPublic',
'id',
'customerId',
);
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
$restricted_cap = apply_filters( 'customer_restricted_cap', 'session' === $id ? '' : 'list_users' );
parent::__construct( $restricted_cap, $allowed_restricted_fields, $id );
}
/**
* Forwards function calls to WC_Data sub-class instance.
*
* @param string $method - function name.
* @param array $args - function call arguments.
* @return mixed
*/
public function __call( $method, $args ) {
return $this->data->$method( ...$args );
}
/**
* Initializes the Customer field resolvers.
*/
protected function init() {
if ( empty( $this->fields ) ) {
$this->fields = array(
'ID' => function() {
return ( ! empty( $this->data->get_id() ) ) ? $this->data->get_id() : \WC()->session->_customer_id;
},
'id' => function() {
return ( ! empty( $this->data->get_id() ) )
? Relay::toGlobalId( 'customer', $this->data->get_id() )
: 'new_customer';
},
'customerId' => function() {
return ( ! empty( $this->data->get_id() ) ) ? $this->data->get_id() : null;
},
'isVatExempt' => function() {
return ! is_null( $this->data->get_is_vat_exempt() ) ? $this->data->get_is_vat_exempt() : null;
},
'hasCalculatedShipping' => function() {
return ! is_null( $this->data->has_calculated_shipping() ) ? $this->data->has_calculated_shipping() : null;
},
'calculatedShipping' => function() {
return ! is_null( $this->data->get_calculated_shipping() ) ? $this->data->get_calculated_shipping() : null;
},
'orderCount' => function() {
return ! is_null( $this->data->get_order_count() ) ? $this->data->get_order_count() : null;
},
'totalSpent' => function() {
return ! is_null( $this->data->get_total_spent() ) ? $this->data->get_total_spent() : null;
},
'username' => function() {
return ( ! empty( $this->data->get_username() ) ) ? $this->data->get_username() : null;
},
'email' => function() {
return ( ! empty( $this->data->get_email() ) ) ? $this->data->get_email() : null;
},
'firstName' => function() {
return ( ! empty( $this->data->get_first_name() ) ) ? $this->data->get_first_name() : null;
},
'lastName' => function() {
return ( ! empty( $this->data->get_last_name() ) ) ? $this->data->get_last_name() : null;
},
'displayName' => function() {
return ( ! empty( $this->data->get_display_name() ) ) ? $this->data->get_display_name() : null;
},
'role' => function() {
return ( ! empty( $this->data->get_role() ) ) ? $this->data->get_role() : null;
},
'date' => function() {
return ( ! empty( $this->data->get_date_created() ) ) ? $this->data->get_date_created() : null;
},
'modified' => function() {
return ( ! empty( $this->data->get_date_modified() ) ) ? $this->data->get_date_modified() : null;
},
'billing' => function() {
return ( ! empty( $this->data->get_billing() ) ) ? $this->data->get_billing() : null;
},
'shipping' => function() {
return ( ! empty( $this->data->get_shipping() ) ) ? $this->data->get_shipping() : null;
},
'isPayingCustomer' => function() {
return ( ! is_null( $this->data->get_is_paying_customer() ) ) ? $this->data->get_is_paying_customer() : null;
},
/**
* Connection resolvers fields
*
* These field resolvers are used in connection resolvers to define WP_Query argument
* Note: underscore naming style is used as a quick identifier
*/
'last_order_id' => function() {
return ( ! empty( $this->data->get_last_order() ) ) ? $this->data->get_last_order()->get_id() : null;
},
);
}
parent::prepare_fields();
}
}
|
{
"pile_set_name": "Github"
}
|
//entirely neutral or internal status effects go here
/datum/status_effect/crusher_damage //tracks the damage dealt to this mob by kinetic crushers
id = "crusher_damage"
duration = -1
tick_interval = -1
status_type = STATUS_EFFECT_UNIQUE
alert_type = null
var/total_damage = 0
/datum/status_effect/syphon_mark
id = "syphon_mark"
duration = 50
status_type = STATUS_EFFECT_MULTIPLE
alert_type = null
on_remove_on_mob_delete = TRUE
var/obj/item/borg/upgrade/modkit/bounty/reward_target
/datum/status_effect/syphon_mark/on_creation(mob/living/new_owner, obj/item/borg/upgrade/modkit/bounty/new_reward_target)
. = ..()
if(.)
reward_target = new_reward_target
/datum/status_effect/syphon_mark/on_apply()
if(owner.stat == DEAD)
return FALSE
return ..()
/datum/status_effect/syphon_mark/proc/get_kill()
if(!QDELETED(reward_target))
reward_target.get_kill(owner)
/datum/status_effect/syphon_mark/tick()
if(owner.stat == DEAD)
get_kill()
qdel(src)
/datum/status_effect/syphon_mark/on_remove()
get_kill()
. = ..()
/obj/screen/alert/status_effect/in_love
name = "In Love"
desc = "You feel so wonderfully in love!"
icon_state = "in_love"
/datum/status_effect/in_love
id = "in_love"
duration = -1
status_type = STATUS_EFFECT_UNIQUE
alert_type = /obj/screen/alert/status_effect/in_love
var/mob/living/date
/datum/status_effect/in_love/on_creation(mob/living/new_owner, mob/living/love_interest)
. = ..()
if(.)
date = love_interest
linked_alert.desc = "You're in love with [date.real_name]! How lovely."
/datum/status_effect/in_love/tick()
if(date)
new /obj/effect/temp_visual/love_heart/invisible(date.drop_location(), owner)
/datum/status_effect/throat_soothed
id = "throat_soothed"
duration = 60 SECONDS
status_type = STATUS_EFFECT_REFRESH
alert_type = null
/datum/status_effect/throat_soothed/on_apply()
. = ..()
ADD_TRAIT(owner, TRAIT_SOOTHED_THROAT, "[STATUS_EFFECT_TRAIT]_[id]")
/datum/status_effect/throat_soothed/on_remove()
. = ..()
REMOVE_TRAIT(owner, TRAIT_SOOTHED_THROAT, "[STATUS_EFFECT_TRAIT]_[id]")
/datum/status_effect/bounty
id = "bounty"
status_type = STATUS_EFFECT_UNIQUE
var/mob/living/rewarded
/datum/status_effect/bounty/on_creation(mob/living/new_owner, mob/living/caster)
. = ..()
if(.)
rewarded = caster
/datum/status_effect/bounty/on_apply()
to_chat(owner, "<span class='boldnotice'>You hear something behind you talking...</span> <span class='notice'>You have been marked for death by [rewarded]. If you die, they will be rewarded.</span>")
playsound(owner, 'sound/weapons/gun/shotgun/rack.ogg', 75, FALSE)
return ..()
/datum/status_effect/bounty/tick()
if(owner.stat == DEAD)
rewards()
qdel(src)
/datum/status_effect/bounty/proc/rewards()
if(rewarded && rewarded.mind && rewarded.stat != DEAD)
to_chat(owner, "<span class='boldnotice'>You hear something behind you talking...</span> <span class='notice'>Bounty claimed.</span>")
playsound(owner, 'sound/weapons/gun/shotgun/shot.ogg', 75, FALSE)
to_chat(rewarded, "<span class='greentext'>You feel a surge of mana flow into you!</span>")
for(var/obj/effect/proc_holder/spell/spell in rewarded.mind.spell_list)
spell.charge_counter = spell.charge_max
spell.recharging = FALSE
spell.update_icon()
rewarded.adjustBruteLoss(-25)
rewarded.adjustFireLoss(-25)
rewarded.adjustToxLoss(-25)
rewarded.adjustOxyLoss(-25)
rewarded.adjustCloneLoss(-25)
// heldup is for the person being aimed at
/datum/status_effect/heldup
id = "heldup"
duration = -1
tick_interval = -1
status_type = STATUS_EFFECT_MULTIPLE
alert_type = /obj/screen/alert/status_effect/heldup
/obj/screen/alert/status_effect/heldup
name = "Held Up"
desc = "Making any sudden moves would probably be a bad idea!"
icon_state = "aimed"
// holdup is for the person aiming
/datum/status_effect/holdup
id = "holdup"
duration = -1
tick_interval = -1
status_type = STATUS_EFFECT_UNIQUE
alert_type = /obj/screen/alert/status_effect/holdup
/obj/screen/alert/status_effect/holdup
name = "Holding Up"
desc = "You're currently pointing a gun at someone."
icon_state = "aimed"
|
{
"pile_set_name": "Github"
}
|
# Copyright (C) 2018 WPSSO Schema Breadcrumbs Markup
# This file is distributed under the same license as the WPSSO Schema Breadcrumbs Markup package.
msgid ""
msgstr ""
"Project-Id-Version: WPSSO Schema Breadcrumbs Markup 1.1.3\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wpsso-"
"breadcrumbs\n"
"POT-Creation-Date: 2018-MO-DA HO:MI+ZONE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
#: lib/config-gettext-extract.php:3
msgctxt "lib file description"
msgid "Breadcrumbs"
msgstr ""
#: lib/config-gettext-extract.php:4
msgctxt "plugin description"
msgid ""
"WPSSO Core add-on to provide JSON-LD formatted Schema BreadcrumbList markup "
"for Google and Search Engine Optimization (SEO)."
msgstr ""
#: lib/submenu/bc-general.php:34
msgctxt "metabox title"
msgid "Breadcrumbs Settings"
msgstr ""
#: lib/submenu/bc-general.php:66
msgctxt "option label"
msgid "Breadcrumbs for Post Types"
msgstr ""
#: wpsso-breadcrumbs.php:97
msgid ""
"%1$s is an add-on for the %2$s plugin — please install and activate "
"the %3$s plugin before activating %4$s."
msgstr ""
#: wpsso-breadcrumbs.php:98
msgid ""
"The %1$s add-on requires the %2$s plugin — install and activate the "
"%3$s plugin or <a href=\"%4$s\">deactivate the %5$s add-on</a>."
msgstr ""
#: wpsso-breadcrumbs.php:138
msgid "%1$s requires %2$s version %3$s or higher and has been deactivated."
msgstr ""
#: wpsso-breadcrumbs.php:140
msgid "Please upgrade %1$s before trying to re-activate the %2$s plugin."
msgstr ""
#: wpsso-breadcrumbs.php:215
msgid ""
"The %1$s version %2$s add-on requires %3$s version %4$s or newer (version "
"%5$s is currently installed)."
msgstr ""
#. translators: %s is the short plugin name
#: wpsso-breadcrumbs.php:227
msgid "%s warning:"
msgstr ""
#. Plugin Name of the plugin/theme
msgid "WPSSO Schema Breadcrumbs Markup"
msgstr ""
#. Plugin URI of the plugin/theme
msgid "https://wpsso.com/extend/plugins/wpsso-breadcrumbs/"
msgstr ""
#. Description of the plugin/theme
msgid ""
"WPSSO Core add-on to provide JSON-LD formatted Schema BreadcrumbList markup "
"for Google and Search Engine Optimization (SEO)."
msgstr ""
#. Author of the plugin/theme
msgid "JS Morisset"
msgstr ""
#. Author URI of the plugin/theme
msgid "https://wpsso.com/"
msgstr ""
|
{
"pile_set_name": "Github"
}
|
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# As parts of components/safe_browsing become buildable on iOS, they will
# be added here.
source_set("unit_tests") {
testonly = true
deps = [
"//components/safe_browsing/core:ping_manager_unittest",
"//components/safe_browsing/core:verdict_cache_manager_unittest",
"//components/safe_browsing/core/browser",
"//components/safe_browsing/core/common",
"//components/safe_browsing/core/common:unit_tests",
"//components/safe_browsing/core/db:unit_tests_local_db",
"//components/safe_browsing/core/realtime:unit_tests",
]
}
|
{
"pile_set_name": "Github"
}
|
/*
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2008,2009,2010,2013,2014 by the GROMACS development team.
* Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*
* GROMACS is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* GROMACS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with GROMACS; if not, see
* http://www.gnu.org/licenses, or write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* If you want to redistribute modifications to GROMACS, please
* consider that scientific software is very special. Version
* control is crucial - bugs must be traceable. We will be happy to
* consider code for inclusion in the official distribution, but
* derived work must not be called official GROMACS. Details are found
* in the README & COPYING files - if they are missing, get the
* official version at http://www.gromacs.org.
*
* To help us fund GROMACS development, we humbly ask that you cite
* the research papers on the package. Check out http://www.gromacs.org.
*/
#ifndef GMX_TOPOLOGY_TOPSORT_H
#define GMX_TOPOLOGY_TOPSORT_H
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
struct gmx_mtop_t;
class InteractionDefinitions;
/* Returns if there are perturbed bonded interactions */
gmx_bool gmx_mtop_bondeds_free_energy(const struct gmx_mtop_t* mtop);
/* Sort all the bonded ilists in idef to have the perturbed ones at the end
* and set nr_nr_nonperturbed in ilist.
*/
void gmx_sort_ilist_fe(InteractionDefinitions* idef, const real* qA, const real* qB);
#endif
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*
*/
/**
* Basic (stateless) API for text direction detection
*
* Part of our implementation of Unicode Bidirectional Algorithm (UBA)
* Unicode Standard Annex #9 (UAX9)
* http://www.unicode.org/reports/tr9/
*/
'use strict';
var UnicodeBidiDirection = require('./UnicodeBidiDirection');
var invariant = require('./invariant');
/**
* RegExp ranges of characters with a *Strong* Bidi_Class value.
*
* Data is based on DerivedBidiClass.txt in UCD version 7.0.0.
*
* NOTE: For performance reasons, we only support Unicode's
* Basic Multilingual Plane (BMP) for now.
*/
var RANGE_BY_BIDI_TYPE = {
L: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BB' + '\u01BC-\u01BF\u01C0-\u01C3\u01C4-\u0293\u0294\u0295-\u02AF\u02B0-\u02B8' + '\u02BB-\u02C1\u02D0-\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376-\u0377' + '\u037A\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1' + '\u03A3-\u03F5\u03F7-\u0481\u0482\u048A-\u052F\u0531-\u0556\u0559' + '\u055A-\u055F\u0561-\u0587\u0589\u0903\u0904-\u0939\u093B\u093D' + '\u093E-\u0940\u0949-\u094C\u094E-\u094F\u0950\u0958-\u0961\u0964-\u0965' + '\u0966-\u096F\u0970\u0971\u0972-\u0980\u0982-\u0983\u0985-\u098C' + '\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD' + '\u09BE-\u09C0\u09C7-\u09C8\u09CB-\u09CC\u09CE\u09D7\u09DC-\u09DD' + '\u09DF-\u09E1\u09E6-\u09EF\u09F0-\u09F1\u09F4-\u09F9\u09FA\u0A03' + '\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33' + '\u0A35-\u0A36\u0A38-\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F' + '\u0A72-\u0A74\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0' + '\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0ABE-\u0AC0\u0AC9\u0ACB-\u0ACC\u0AD0' + '\u0AE0-\u0AE1\u0AE6-\u0AEF\u0AF0\u0B02-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10' + '\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40' + '\u0B47-\u0B48\u0B4B-\u0B4C\u0B57\u0B5C-\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F' + '\u0B70\u0B71\u0B72-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95' + '\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9' + '\u0BBE-\u0BBF\u0BC1-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7' + '\u0BE6-\u0BEF\u0BF0-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10' + '\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C59\u0C60-\u0C61' + '\u0C66-\u0C6F\u0C7F\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8' + '\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CBE\u0CBF\u0CC0-\u0CC4\u0CC6' + '\u0CC7-\u0CC8\u0CCA-\u0CCB\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE1\u0CE6-\u0CEF' + '\u0CF1-\u0CF2\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D' + '\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D57\u0D60-\u0D61' + '\u0D66-\u0D6F\u0D70-\u0D75\u0D79\u0D7A-\u0D7F\u0D82-\u0D83\u0D85-\u0D96' + '\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF' + '\u0DE6-\u0DEF\u0DF2-\u0DF3\u0DF4\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E45' + '\u0E46\u0E4F\u0E50-\u0E59\u0E5A-\u0E5B\u0E81-\u0E82\u0E84\u0E87-\u0E88' + '\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7' + '\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6' + '\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F01-\u0F03\u0F04-\u0F12\u0F13\u0F14' + '\u0F15-\u0F17\u0F1A-\u0F1F\u0F20-\u0F29\u0F2A-\u0F33\u0F34\u0F36\u0F38' + '\u0F3E-\u0F3F\u0F40-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C' + '\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FCF\u0FD0-\u0FD4\u0FD5-\u0FD8' + '\u0FD9-\u0FDA\u1000-\u102A\u102B-\u102C\u1031\u1038\u103B-\u103C\u103F' + '\u1040-\u1049\u104A-\u104F\u1050-\u1055\u1056-\u1057\u105A-\u105D\u1061' + '\u1062-\u1064\u1065-\u1066\u1067-\u106D\u106E-\u1070\u1075-\u1081' + '\u1083-\u1084\u1087-\u108C\u108E\u108F\u1090-\u1099\u109A-\u109C' + '\u109E-\u109F\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FB\u10FC' + '\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288' + '\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5' + '\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u1368' + '\u1369-\u137C\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166D-\u166E' + '\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EB-\u16ED\u16EE-\u16F0' + '\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1735-\u1736' + '\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5' + '\u17C7-\u17C8\u17D4-\u17D6\u17D7\u17D8-\u17DA\u17DC\u17E0-\u17E9' + '\u1810-\u1819\u1820-\u1842\u1843\u1844-\u1877\u1880-\u18A8\u18AA' + '\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930-\u1931' + '\u1933-\u1938\u1946-\u194F\u1950-\u196D\u1970-\u1974\u1980-\u19AB' + '\u19B0-\u19C0\u19C1-\u19C7\u19C8-\u19C9\u19D0-\u19D9\u19DA\u1A00-\u1A16' + '\u1A19-\u1A1A\u1A1E-\u1A1F\u1A20-\u1A54\u1A55\u1A57\u1A61\u1A63-\u1A64' + '\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AA6\u1AA7\u1AA8-\u1AAD' + '\u1B04\u1B05-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B44\u1B45-\u1B4B' + '\u1B50-\u1B59\u1B5A-\u1B60\u1B61-\u1B6A\u1B74-\u1B7C\u1B82\u1B83-\u1BA0' + '\u1BA1\u1BA6-\u1BA7\u1BAA\u1BAE-\u1BAF\u1BB0-\u1BB9\u1BBA-\u1BE5\u1BE7' + '\u1BEA-\u1BEC\u1BEE\u1BF2-\u1BF3\u1BFC-\u1BFF\u1C00-\u1C23\u1C24-\u1C2B' + '\u1C34-\u1C35\u1C3B-\u1C3F\u1C40-\u1C49\u1C4D-\u1C4F\u1C50-\u1C59' + '\u1C5A-\u1C77\u1C78-\u1C7D\u1C7E-\u1C7F\u1CC0-\u1CC7\u1CD3\u1CE1' + '\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF2-\u1CF3\u1CF5-\u1CF6\u1D00-\u1D2B' + '\u1D2C-\u1D6A\u1D6B-\u1D77\u1D78\u1D79-\u1D9A\u1D9B-\u1DBF\u1E00-\u1F15' + '\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D' + '\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC' + '\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E' + '\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D' + '\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2135-\u2138\u2139' + '\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2182\u2183-\u2184' + '\u2185-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF' + '\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7C-\u2C7D\u2C7E-\u2CE4' + '\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F' + '\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE' + '\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005\u3006\u3007' + '\u3021-\u3029\u302E-\u302F\u3031-\u3035\u3038-\u303A\u303B\u303C' + '\u3041-\u3096\u309D-\u309E\u309F\u30A1-\u30FA\u30FC-\u30FE\u30FF' + '\u3105-\u312D\u3131-\u318E\u3190-\u3191\u3192-\u3195\u3196-\u319F' + '\u31A0-\u31BA\u31F0-\u31FF\u3200-\u321C\u3220-\u3229\u322A-\u3247' + '\u3248-\u324F\u3260-\u327B\u327F\u3280-\u3289\u328A-\u32B0\u32C0-\u32CB' + '\u32D0-\u32FE\u3300-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DB5' + '\u4E00-\u9FCC\uA000-\uA014\uA015\uA016-\uA48C\uA4D0-\uA4F7\uA4F8-\uA4FD' + '\uA4FE-\uA4FF\uA500-\uA60B\uA60C\uA610-\uA61F\uA620-\uA629\uA62A-\uA62B' + '\uA640-\uA66D\uA66E\uA680-\uA69B\uA69C-\uA69D\uA6A0-\uA6E5\uA6E6-\uA6EF' + '\uA6F2-\uA6F7\uA722-\uA76F\uA770\uA771-\uA787\uA789-\uA78A\uA78B-\uA78E' + '\uA790-\uA7AD\uA7B0-\uA7B1\uA7F7\uA7F8-\uA7F9\uA7FA\uA7FB-\uA801' + '\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA823-\uA824\uA827\uA830-\uA835' + '\uA836-\uA837\uA840-\uA873\uA880-\uA881\uA882-\uA8B3\uA8B4-\uA8C3' + '\uA8CE-\uA8CF\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8F8-\uA8FA\uA8FB\uA900-\uA909' + '\uA90A-\uA925\uA92E-\uA92F\uA930-\uA946\uA952-\uA953\uA95F\uA960-\uA97C' + '\uA983\uA984-\uA9B2\uA9B4-\uA9B5\uA9BA-\uA9BB\uA9BD-\uA9C0\uA9C1-\uA9CD' + '\uA9CF\uA9D0-\uA9D9\uA9DE-\uA9DF\uA9E0-\uA9E4\uA9E6\uA9E7-\uA9EF' + '\uA9F0-\uA9F9\uA9FA-\uA9FE\uAA00-\uAA28\uAA2F-\uAA30\uAA33-\uAA34' + '\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F\uAA60-\uAA6F' + '\uAA70\uAA71-\uAA76\uAA77-\uAA79\uAA7A\uAA7B\uAA7D\uAA7E-\uAAAF\uAAB1' + '\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADC\uAADD\uAADE-\uAADF' + '\uAAE0-\uAAEA\uAAEB\uAAEE-\uAAEF\uAAF0-\uAAF1\uAAF2\uAAF3-\uAAF4\uAAF5' + '\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + '\uAB30-\uAB5A\uAB5B\uAB5C-\uAB5F\uAB64-\uAB65\uABC0-\uABE2\uABE3-\uABE4' + '\uABE6-\uABE7\uABE9-\uABEA\uABEB\uABEC\uABF0-\uABF9\uAC00-\uD7A3' + '\uD7B0-\uD7C6\uD7CB-\uD7FB\uE000-\uF8FF\uF900-\uFA6D\uFA70-\uFAD9' + '\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFF6F\uFF70' + '\uFF71-\uFF9D\uFF9E-\uFF9F\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF' + '\uFFD2-\uFFD7\uFFDA-\uFFDC',
R: '\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05D0-\u05EA\u05EB-\u05EF' + '\u05F0-\u05F2\u05F3-\u05F4\u05F5-\u05FF\u07C0-\u07C9\u07CA-\u07EA' + '\u07F4-\u07F5\u07FA\u07FB-\u07FF\u0800-\u0815\u081A\u0824\u0828' + '\u082E-\u082F\u0830-\u083E\u083F\u0840-\u0858\u085C-\u085D\u085E' + '\u085F-\u089F\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB37\uFB38-\uFB3C' + '\uFB3D\uFB3E\uFB3F\uFB40-\uFB41\uFB42\uFB43-\uFB44\uFB45\uFB46-\uFB4F',
AL: '\u0608\u060B\u060D\u061B\u061C\u061D\u061E-\u061F\u0620-\u063F\u0640' + '\u0641-\u064A\u066D\u066E-\u066F\u0671-\u06D3\u06D4\u06D5\u06E5-\u06E6' + '\u06EE-\u06EF\u06FA-\u06FC\u06FD-\u06FE\u06FF\u0700-\u070D\u070E\u070F' + '\u0710\u0712-\u072F\u074B-\u074C\u074D-\u07A5\u07B1\u07B2-\u07BF' + '\u08A0-\u08B2\u08B3-\u08E3\uFB50-\uFBB1\uFBB2-\uFBC1\uFBC2-\uFBD2' + '\uFBD3-\uFD3D\uFD40-\uFD4F\uFD50-\uFD8F\uFD90-\uFD91\uFD92-\uFDC7' + '\uFDC8-\uFDCF\uFDF0-\uFDFB\uFDFC\uFDFE-\uFDFF\uFE70-\uFE74\uFE75' + '\uFE76-\uFEFC\uFEFD-\uFEFE'
};
var REGEX_STRONG = new RegExp('[' + RANGE_BY_BIDI_TYPE.L + RANGE_BY_BIDI_TYPE.R + RANGE_BY_BIDI_TYPE.AL + ']');
var REGEX_RTL = new RegExp('[' + RANGE_BY_BIDI_TYPE.R + RANGE_BY_BIDI_TYPE.AL + ']');
/**
* Returns the first strong character (has Bidi_Class value of L, R, or AL).
*
* @param str A text block; e.g. paragraph, table cell, tag
* @return A character with strong bidi direction, or null if not found
*/
function firstStrongChar(str) {
var match = REGEX_STRONG.exec(str);
return match == null ? null : match[0];
}
/**
* Returns the direction of a block of text, based on the direction of its
* first strong character (has Bidi_Class value of L, R, or AL).
*
* @param str A text block; e.g. paragraph, table cell, tag
* @return The resolved direction
*/
function firstStrongCharDir(str) {
var strongChar = firstStrongChar(str);
if (strongChar == null) {
return UnicodeBidiDirection.NEUTRAL;
}
return REGEX_RTL.exec(strongChar) ? UnicodeBidiDirection.RTL : UnicodeBidiDirection.LTR;
}
/**
* Returns the direction of a block of text, based on the direction of its
* first strong character (has Bidi_Class value of L, R, or AL), or a fallback
* direction, if no strong character is found.
*
* This function is supposed to be used in respect to Higher-Level Protocol
* rule HL1. (http://www.unicode.org/reports/tr9/#HL1)
*
* @param str A text block; e.g. paragraph, table cell, tag
* @param fallback Fallback direction, used if no strong direction detected
* for the block (default = NEUTRAL)
* @return The resolved direction
*/
function resolveBlockDir(str, fallback) {
fallback = fallback || UnicodeBidiDirection.NEUTRAL;
if (!str.length) {
return fallback;
}
var blockDir = firstStrongCharDir(str);
return blockDir === UnicodeBidiDirection.NEUTRAL ? fallback : blockDir;
}
/**
* Returns the direction of a block of text, based on the direction of its
* first strong character (has Bidi_Class value of L, R, or AL), or a fallback
* direction, if no strong character is found.
*
* NOTE: This function is similar to resolveBlockDir(), but uses the global
* direction as the fallback, so it *always* returns a Strong direction,
* making it useful for integration in places that you need to make the final
* decision, like setting some CSS class.
*
* This function is supposed to be used in respect to Higher-Level Protocol
* rule HL1. (http://www.unicode.org/reports/tr9/#HL1)
*
* @param str A text block; e.g. paragraph, table cell
* @param strongFallback Fallback direction, used if no strong direction
* detected for the block (default = global direction)
* @return The resolved Strong direction
*/
function getDirection(str, strongFallback) {
if (!strongFallback) {
strongFallback = UnicodeBidiDirection.getGlobalDir();
}
!UnicodeBidiDirection.isStrong(strongFallback) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Fallback direction must be a strong direction') : invariant(false) : void 0;
return resolveBlockDir(str, strongFallback);
}
/**
* Returns true if getDirection(arguments...) returns LTR.
*
* @param str A text block; e.g. paragraph, table cell
* @param strongFallback Fallback direction, used if no strong direction
* detected for the block (default = global direction)
* @return True if the resolved direction is LTR
*/
function isDirectionLTR(str, strongFallback) {
return getDirection(str, strongFallback) === UnicodeBidiDirection.LTR;
}
/**
* Returns true if getDirection(arguments...) returns RTL.
*
* @param str A text block; e.g. paragraph, table cell
* @param strongFallback Fallback direction, used if no strong direction
* detected for the block (default = global direction)
* @return True if the resolved direction is RTL
*/
function isDirectionRTL(str, strongFallback) {
return getDirection(str, strongFallback) === UnicodeBidiDirection.RTL;
}
var UnicodeBidi = {
firstStrongChar: firstStrongChar,
firstStrongCharDir: firstStrongCharDir,
resolveBlockDir: resolveBlockDir,
getDirection: getDirection,
isDirectionLTR: isDirectionLTR,
isDirectionRTL: isDirectionRTL
};
module.exports = UnicodeBidi;
|
{
"pile_set_name": "Github"
}
|
# What: Google Chrome Extension
# Why: To allow apps to (work) be served with the right content type header.
# http://codereview.chromium.org/2830017
# Added by: niftylettuce
application/x-chrome-extension crx
# What: OTF Message Silencer
# Why: To silence the "Resource interpreted as font but transferred with MIME
# type font/otf" message that occurs in Google Chrome
# Added by: niftylettuce
font/opentype otf
# What: HTC support
# Why: To properly render .htc files such as CSS3PIE
# Added by: niftylettuce
text/x-component htc
# What: HTML5 application cache manifest
# Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps
# per https://developer.mozilla.org/en/offline_resources_in_firefox
# Added by: louisremi
text/cache-manifest appcache manifest
# What: node binary buffer format
# Why: semi-standard extension w/in the node community
# Added by: tootallnate
application/octet-stream buffer
# What: The "protected" MP-4 formats used by iTunes.
# Why: Required for streaming music to browsers (?)
# Added by: broofa
application/mp4 m4p
audio/mp4 m4a
# What: Music playlist format (http://en.wikipedia.org/wiki/M3U)
# Why: See https://github.com/bentomas/node-mime/pull/6
# Added by: mjrusso
application/x-mpegURL m3u8
# What: Video format, Part of RFC1890
# Why: See https://github.com/bentomas/node-mime/pull/6
# Added by: mjrusso
video/MP2T ts
# What: The FLAC lossless codec format
# Why: Streaming and serving FLAC audio
# Added by: jacobrask
audio/flac flac
# What: EventSource mime type
# Why: mime type of Server-Sent Events stream
# http://www.w3.org/TR/eventsource/#text-event-stream
# Added by: francois2metz
text/event-stream event-stream
# What: Mozilla App manifest mime type
# Why: https://developer.mozilla.org/en/Apps/Manifest#Serving_manifests
# Added by: ednapiranha
application/x-web-app-manifest+json webapp
# What: Matroska Mime Types
# Why: http://en.wikipedia.org/wiki/Matroska
# Added by: aduncan88
video/x-matroska mkv
audio/x-matroska mka
|
{
"pile_set_name": "Github"
}
|
#
# Boolean 3-majority on
#
# From John Koza's Lisp implementation
# ftp://cs.ucl.ac.uk/genetic/ftp.io.com/code/koza-book-gp-implementation.lisp
#
# Note: In the Lisp code the following parameters is used:
#
# Maximum number of Generations: 1
# Size of Population: 1
# Maximum depth of new individuals: 6
# Maximum depth of new subtrees for mutants: 4
# Maximum depth of individuals after crossover: 17
# Fitness-proportionate reproduction fraction: 0.1
# Crossover at any point fraction: 0.2
# Crossover at function points fraction: 0.7
# Number of fitness cases: 8
# Selection method: FITNESS-PROPORTIONATE
# Generation method: RAMPED-HALF-AND-HALF
# Randomizer seed: 1.0d0
#
# But we use some more generation and larger population.
#
presentation: Majority on
num_input_variables: 3
variable_names: D0 D1 D2 T
functions: AndD,NotD,OrD
# functions: Add,Subtract,Multiply,Divide
terminal_range: 0 1
terminal_wholenumbers: true
max_init_depth: 4
population_size: 10
max_crossover_depth: 4
num_evolutions: 100
max_nodes: 17
show_similiar: true
mutation_prob: 0.0
crossover_prob: 0.7
reproduction_prob: 0.10
show_all_generations: true
data
1 1 1 1
1 1 0 1
1 0 1 1
1 0 0 0
0 1 1 1
0 1 0 0
0 0 1 0
0 0 0 0
|
{
"pile_set_name": "Github"
}
|
// Package api defines the data structure to be used in the request/response
// messages between libnetwork and the remote ipam plugin
package api
import "github.com/docker/libnetwork/ipamapi"
// Response is the basic response structure used in all responses
type Response struct {
Error string
}
// IsSuccess returns whether the plugin response is successful
func (r *Response) IsSuccess() bool {
return r.Error == ""
}
// GetError returns the error from the response, if any.
func (r *Response) GetError() string {
return r.Error
}
// GetCapabilityResponse is the response of GetCapability request
type GetCapabilityResponse struct {
Response
RequiresMACAddress bool
RequiresRequestReplay bool
}
// ToCapability converts the capability response into the internal ipam driver capability structure
func (capRes GetCapabilityResponse) ToCapability() *ipamapi.Capability {
return &ipamapi.Capability{
RequiresMACAddress: capRes.RequiresMACAddress,
RequiresRequestReplay: capRes.RequiresRequestReplay,
}
}
// GetAddressSpacesResponse is the response to the ``get default address spaces`` request message
type GetAddressSpacesResponse struct {
Response
LocalDefaultAddressSpace string
GlobalDefaultAddressSpace string
}
// RequestPoolRequest represents the expected data in a ``request address pool`` request message
type RequestPoolRequest struct {
AddressSpace string
Pool string
SubPool string
Options map[string]string
V6 bool
}
// RequestPoolResponse represents the response message to a ``request address pool`` request
type RequestPoolResponse struct {
Response
PoolID string
Pool string // CIDR format
Data map[string]string
}
// ReleasePoolRequest represents the expected data in a ``release address pool`` request message
type ReleasePoolRequest struct {
PoolID string
}
// ReleasePoolResponse represents the response message to a ``release address pool`` request
type ReleasePoolResponse struct {
Response
}
// RequestAddressRequest represents the expected data in a ``request address`` request message
type RequestAddressRequest struct {
PoolID string
Address string
Options map[string]string
}
// RequestAddressResponse represents the expected data in the response message to a ``request address`` request
type RequestAddressResponse struct {
Response
Address string // in CIDR format
Data map[string]string
}
// ReleaseAddressRequest represents the expected data in a ``release address`` request message
type ReleaseAddressRequest struct {
PoolID string
Address string
}
// ReleaseAddressResponse represents the response message to a ``release address`` request
type ReleaseAddressResponse struct {
Response
}
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=struct.CFArrayIterator.html">
</head>
<body>
<p>Redirecting to <a href="struct.CFArrayIterator.html">struct.CFArrayIterator.html</a>...</p>
<script>location.replace("struct.CFArrayIterator.html" + location.search + location.hash);</script>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <Foundation/NSArray.h>
@interface NSArray (UICollectionAdditions)
- (id)_nextToLastObject;
@end
|
{
"pile_set_name": "Github"
}
|
package main
import (
"encoding/json"
"fmt"
"log"
)
// You can choose to only unmarshal some of the json data
// Create a data structure that only has fields for some of the data
type city struct {
Latitude, Longitude float64
City string
}
type cities []city
func main() {
var data cities
rcvd := `[{"precision":"zip","Latitude":37.7668,"Longitude":-122.3959,"Address":"","City":"SAN FRANCISCO","State":"CA","Zip":"94107","Country":"US"},{"precision":"zip","Latitude":37.371991,"Longitude":-122.02602,"Address":"","City":"SUNNYVALE","State":"CA","Zip":"94085","Country":"US"}]`
err := json.Unmarshal([]byte(rcvd), &data)
if err != nil {
log.Println(err)
}
fmt.Println(data)
}
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.