text
stringlengths
2
99k
meta
dict
/* PICCANTE The hottest HDR imaging library! http://vcg.isti.cnr.it/piccante Copyright (C) 2014 Visual Computing Laboratory - ISTI CNR http://vcg.isti.cnr.it First author: Francesco Banterle 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 PIC_FILTERING_FILTER_SAMPLER_2D_HPP #define PIC_FILTERING_FILTER_SAMPLER_2D_HPP #include "../filtering/filter.hpp" #include "../image_samplers/image_sampler_bilinear.hpp" #include "../image_samplers/image_sampler_bsplines.hpp" #include "../image_samplers/image_sampler_gaussian.hpp" #include "../image_samplers/image_sampler_nearest.hpp" namespace pic { /** * @brief The FilterSampler2D class */ class FilterSampler2D: public Filter { protected: ImageSamplerNearest isb_default; ImageSampler *isb; float scaleX, scaleY; int width, height; bool swh; /** * @brief ProcessBBox * @param dst * @param src * @param box */ void ProcessBBox(Image *dst, ImageVec src, BBox *box); public: /** * @brief FilterSample2D */ FilterSampler2D() : Filter() { scaleX = -1.0f; scaleY = -1.0f; width = -1; height = -1; isb = NULL; } /** * @brief FilterSampler2D * @param scale * @param isb */ FilterSampler2D(float scale, ImageSampler *isb); /** * @brief FilterSampler2D * @param scaleX * @param scaleY * @param isb */ FilterSampler2D(float scaleX, float scaleY, ImageSampler *isb); /** * @brief FilterSampler2D * @param width * @param height * @param isb */ FilterSampler2D(int width, int height, ImageSampler *isb); /** * @brief OutputSize * @param imgIn * @param width * @param height * @param channels * @param frames */ void OutputSize(ImageVec imgIn, int &width, int &height, int &channels, int &frames) { if(imgIn.empty()) { width = -2; height = -2; channels = -2; frames = -2; return; } if(imgIn.size() == 1) { if(swh) { width = int(imgIn[0]->widthf * scaleX); height = int(imgIn[0]->heightf * scaleY); } else { width = this->width; height = this->height; } } else { width = imgIn[1]->width; height = imgIn[1]->height; } channels = imgIn[0]->channels; frames = imgIn[0]->frames; } /** * @brief update * @param width * @param height * @param isb */ void update(int width, int height, ImageSampler *isb) { this->width = width; this->height = height; this->swh = false; if(isb == NULL) { this->isb = new ImageSamplerNearest(); } else { this->isb = isb; } } /** * @brief execute * @param imgIn * @param imgOut * @param scale * @param isb * @return */ static Image *execute(Image *imgIn, Image *imgOut, float scale, ImageSampler *isb = NULL) { FilterSampler2D filter(scale, isb); return filter.Process(Single(imgIn), imgOut); } /** * @brief execute * @param imgIn * @param imgOut * @param scaleX * @param scaleY * @param isb * @return */ static Image *execute(Image *imgIn, Image *imgOut, float scaleX, float scaleY, ImageSampler *isb = NULL) { FilterSampler2D filter(scaleX, scaleY, isb); return filter.Process(Single(imgIn), imgOut); } /** * @brief execute * @param imgIn * @param imgOut * @param width * @param height * @param isb * @return */ static Image *execute(Image *imgIn, Image *imgOut, int width, int height, ImageSampler *isb = NULL) { FilterSampler2D filter(width, height, isb); return filter.Process(Single(imgIn), imgOut); } }; PIC_INLINE FilterSampler2D::FilterSampler2D(float scale, ImageSampler *isb = NULL): Filter() { this->scale = scale; this->scaleX = scale; this->scaleY = scale; this->swh = true; if(isb == NULL) { this->isb = new ImageSamplerNearest(); } else { this->isb = isb; } } PIC_INLINE FilterSampler2D::FilterSampler2D(float scaleX, float scaleY, ImageSampler *isb = NULL): Filter() { this->scaleX = scaleX; this->scaleY = scaleY; this->swh = true; if(isb == NULL) { this->isb = &isb_default; } else { this->isb = isb; } } PIC_INLINE FilterSampler2D::FilterSampler2D(int width, int height, ImageSampler *isb = NULL): Filter() { update(width, height, isb); } PIC_INLINE void FilterSampler2D::ProcessBBox(Image *dst, ImageVec src, BBox *box) { float height1f = float(box->height - 1); float width1f = float(box->width - 1); for(int j = box->y0; j < box->y1; j++) { float y = float(j) / height1f; for(int i = box->x0; i < box->x1; i++) { float x = float(i) / width1f; float *tmp_dst = (*dst)(i, j); isb->SampleImage(src[0], x, y, tmp_dst); } } } } // end namespace pic #endif /* PIC_FILTERING_FILTER_SAMPLER_2D_HPP */
{ "pile_set_name": "Github" }
// This closes the scope started in preamble.js }(Module)); // When this file is loaded in, the high level object is "Module";
{ "pile_set_name": "Github" }
#include <iostream> #include <vector> using std::vector; using std::cout; using std::endl; using std::begin; using std::end; int main() { vector<int> ivec{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int int_arr[10]; for (int* i = begin(int_arr); i != end(int_arr); ++i) *i = ivec[i - begin(int_arr)]; for (auto i : int_arr) cout << i << " "; cout << endl; return 0; }
{ "pile_set_name": "Github" }
import test from 'ava'; import { isMutable, unwrap } from '@collectable/core'; import { empty, set, updateMap } from '../src'; test('returns the same map if no changes are made', t => { var map = empty(); var map1 = updateMap(m => {}, map); var map2 = updateMap(m => m, map); t.is(map, map1); t.is(map, map2); }); test('creates a mutable copy of the original map, then freezes and returns it', t => { var map = set('x', 3, empty()); var map1a: any = void 0; var map1 = updateMap(m => { set('y', 5, m); set('z', 7, m); t.true(isMutable(m)); map1a = m; }, map); var map2a: any = void 0; var map2 = updateMap(m => { var m1 = set('x', 9, m); var m2 = m = set('k', 1, m); t.is(m, m1); t.is(m, m2); map2a = m2; t.true(isMutable(m)); return m2; }, map1); t.is(map1, map1a); t.is(map2, map2a); t.false(isMutable(map)); t.false(isMutable(map1)); t.false(isMutable(map2)); t.deepEqual(unwrap(map), { x: 3 }); t.deepEqual(unwrap(map1), { x: 3, y: 5, z: 7 }); t.deepEqual(unwrap(map2), { x: 9, y: 5, z: 7, k: 1 }); });
{ "pile_set_name": "Github" }
// Copyright Daniel Wallin 2006. // 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) #ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPECIFICATION_HPP #define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPECIFICATION_HPP #include <boost/parameter/optional.hpp> // Helper macros for BOOST_PARAMETER_SPECIFICATION_ELEM_R. #define BOOST_PARAMETER_QUALIFIED_TAG_optional(tag) \ optional<tag /**/ #include <boost/parameter/required.hpp> #define BOOST_PARAMETER_QUALIFIED_TAG_required(tag) \ required<tag /**/ #include <boost/parameter/deduced.hpp> #define BOOST_PARAMETER_QUALIFIED_TAG_deduced_optional(tag) \ optional< ::boost::parameter::deduced<tag> /**/ #define BOOST_PARAMETER_QUALIFIED_TAG_deduced_required(tag) \ required< ::boost::parameter::deduced<tag> /**/ #include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp> #include <boost/parameter/config.hpp> #include <boost/preprocessor/punctuation/comma_if.hpp> #include <boost/preprocessor/cat.hpp> #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) #include <boost/parameter/aux_/use_default.hpp> #define BOOST_PARAMETER_SPECIFICATION_ELEM_R(r, tag_namespace, i, elem) \ BOOST_PP_COMMA_IF(i) ::boost::parameter::BOOST_PP_CAT( \ BOOST_PARAMETER_QUALIFIED_TAG_ \ , BOOST_PARAMETER_FN_ARG_QUALIFIER(elem) \ )(tag_namespace::BOOST_PARAMETER_FN_ARG_NAME(elem)) \ , ::boost::parameter::aux::use_default \ > /**/ #else // !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) #include <boost/parameter/aux_/pp_impl/unwrap_predicate.hpp> // Expands to each boost::parameter::parameters<> element type. #define BOOST_PARAMETER_SPECIFICATION_ELEM_R(r, tag_namespace, i, elem) \ BOOST_PP_COMMA_IF(i) ::boost::parameter::BOOST_PP_CAT( \ BOOST_PARAMETER_QUALIFIED_TAG_ \ , BOOST_PARAMETER_FN_ARG_QUALIFIER(elem) \ )(tag_namespace::BOOST_PARAMETER_FN_ARG_NAME(elem)) \ , typename ::boost::parameter::aux::unwrap_predicate< \ void BOOST_PARAMETER_FN_ARG_PRED(elem) \ >::type \ > /**/ #endif // Borland workarounds needed. #include <boost/parameter/parameters.hpp> #include <boost/parameter/aux_/preprocessor/impl/function_name.hpp> #include <boost/preprocessor/control/if.hpp> #include <boost/preprocessor/seq/for_each_i.hpp> // Expands to a boost::parameter::parameters<> specialization for the // function named base. Used by BOOST_PARAMETER_CONSTRUCTOR_AUX and // BOOST_PARAMETER_FUNCTION_HEAD for their respective ParameterSpec models. #define BOOST_PARAMETER_SPECIFICATION(tag_ns, base, split_args, is_const) \ template <typename BoostParameterDummy> \ struct BOOST_PP_CAT( \ BOOST_PP_CAT( \ BOOST_PP_IF( \ is_const \ , boost_param_params_const_ \ , boost_param_params_ \ ) \ , __LINE__ \ ) \ , BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \ ) : ::boost::parameter::parameters< \ BOOST_PP_SEQ_FOR_EACH_I( \ BOOST_PARAMETER_SPECIFICATION_ELEM_R, tag_ns, split_args \ ) \ > \ { \ }; \ typedef BOOST_PP_CAT( \ BOOST_PP_CAT( \ BOOST_PP_IF( \ is_const \ , boost_param_params_const_ \ , boost_param_params_ \ ) \ , __LINE__ \ ) \ , BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \ )<int> /**/ #endif // include guard
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!DOCTYPE funcs SYSTEM '../../../clonk.dtd'> <?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?> <funcs> <func> <title>GetDefHeight</title> <category>Objects</category> <subcat>Status</subcat> <version>7.0 OC</version> <syntax><rtype>int</rtype></syntax> <desc>Determines the height of the object or definition as specified in its DefCore.</desc> </func> <author>Sven2</author><date>2015-09</date> </funcs>
{ "pile_set_name": "Github" }
/****************************************************************************** * Spine Runtimes License Agreement * Last updated January 1, 2020. Replaces all prior versions. * * Copyright (c) 2013-2020, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and * conditions of Section 2 of the Spine Editor License Agreement: * http://esotericsoftware.com/spine-editor-license * * Otherwise, it is permitted to integrate the Spine Runtimes into software * or otherwise create derivative works of the Spine Runtimes (collectively, * "Products"), provided that each user of the Products must obtain their own * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "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 ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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 * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #ifdef SPINE_UE4 #include "SpinePluginPrivatePCH.h" #endif #include <spine/SkeletonClipping.h> #include <spine/Slot.h> #include <spine/ClippingAttachment.h> using namespace spine; SkeletonClipping::SkeletonClipping() : _clipAttachment(NULL) { _clipOutput.ensureCapacity(128); _clippedVertices.ensureCapacity(128); _clippedTriangles.ensureCapacity(128); _clippedUVs.ensureCapacity(128); } size_t SkeletonClipping::clipStart(Slot &slot, ClippingAttachment *clip) { if (_clipAttachment != NULL) { return 0; } _clipAttachment = clip; int n = clip->getWorldVerticesLength(); _clippingPolygon.setSize(n, 0); clip->computeWorldVertices(slot, 0, n, _clippingPolygon, 0, 2); makeClockwise(_clippingPolygon); _clippingPolygons = &_triangulator.decompose(_clippingPolygon, _triangulator.triangulate(_clippingPolygon)); for (size_t i = 0; i < _clippingPolygons->size(); ++i) { Vector<float> *polygonP = (*_clippingPolygons)[i]; Vector<float> &polygon = *polygonP; makeClockwise(polygon); polygon.add(polygon[0]); polygon.add(polygon[1]); } return (*_clippingPolygons).size(); } void SkeletonClipping::clipEnd(Slot &slot) { if (_clipAttachment != NULL && _clipAttachment->_endSlot == &slot._data) { clipEnd(); } } void SkeletonClipping::clipEnd() { if (_clipAttachment == NULL) return; _clipAttachment = NULL; _clippingPolygons = NULL; _clippedVertices.clear(); _clippedUVs.clear(); _clippedTriangles.clear(); _clippingPolygon.clear(); } void SkeletonClipping::clipTriangles(Vector<float> &vertices, Vector<unsigned short> &triangles, Vector<float> &uvs, size_t stride) { clipTriangles(vertices.buffer(), triangles.buffer(), triangles.size(), uvs.buffer(), stride); } void SkeletonClipping::clipTriangles(float *vertices, unsigned short *triangles, size_t trianglesLength, float *uvs, size_t stride ) { Vector<float> &clipOutput = _clipOutput; Vector<float> &clippedVertices = _clippedVertices; Vector<unsigned short> &clippedTriangles = _clippedTriangles; Vector<Vector<float> *> &polygons = *_clippingPolygons; size_t polygonsCount = (*_clippingPolygons).size(); size_t index = 0; clippedVertices.clear(); _clippedUVs.clear(); clippedTriangles.clear(); size_t i = 0; continue_outer: for (; i < trianglesLength; i += 3) { int vertexOffset = triangles[i] * stride; float x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; float u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; vertexOffset = triangles[i + 1] * stride; float x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; float u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; vertexOffset = triangles[i + 2] * stride; float x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; float u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; for (size_t p = 0; p < polygonsCount; p++) { size_t s = clippedVertices.size(); if (clip(x1, y1, x2, y2, x3, y3, &(*polygons[p]), &clipOutput)) { size_t clipOutputLength = clipOutput.size(); if (clipOutputLength == 0) continue; float d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; float d = 1 / (d0 * d2 + d1 * (y1 - y3)); size_t clipOutputCount = clipOutputLength >> 1; clippedVertices.setSize(s + clipOutputCount * 2, 0); _clippedUVs.setSize(s + clipOutputCount * 2, 0); for (size_t ii = 0; ii < clipOutputLength; ii += 2) { float x = clipOutput[ii], y = clipOutput[ii + 1]; clippedVertices[s] = x; clippedVertices[s + 1] = y; float c0 = x - x3, c1 = y - y3; float a = (d0 * c0 + d1 * c1) * d; float b = (d4 * c0 + d2 * c1) * d; float c = 1 - a - b; _clippedUVs[s] = u1 * a + u2 * b + u3 * c; _clippedUVs[s + 1] = v1 * a + v2 * b + v3 * c; s += 2; } s = clippedTriangles.size(); clippedTriangles.setSize(s + 3 * (clipOutputCount - 2), 0); clipOutputCount--; for (size_t ii = 1; ii < clipOutputCount; ii++) { clippedTriangles[s] = (unsigned short)(index); clippedTriangles[s + 1] = (unsigned short)(index + ii); clippedTriangles[s + 2] = (unsigned short)(index + ii + 1); s += 3; } index += clipOutputCount + 1; } else { clippedVertices.setSize(s + 3 * 2, 0); _clippedUVs.setSize(s + 3 * 2, 0); clippedVertices[s] = x1; clippedVertices[s + 1] = y1; clippedVertices[s + 2] = x2; clippedVertices[s + 3] = y2; clippedVertices[s + 4] = x3; clippedVertices[s + 5] = y3; _clippedUVs[s] = u1; _clippedUVs[s + 1] = v1; _clippedUVs[s + 2] = u2; _clippedUVs[s + 3] = v2; _clippedUVs[s + 4] = u3; _clippedUVs[s + 5] = v3; s = clippedTriangles.size(); clippedTriangles.setSize(s + 3, 0); clippedTriangles[s] = (unsigned short)index; clippedTriangles[s + 1] = (unsigned short)(index + 1); clippedTriangles[s + 2] = (unsigned short)(index + 2); index += 3; i += 3; goto continue_outer; } } } } bool SkeletonClipping::isClipping() { return _clipAttachment != NULL; } Vector<float> &SkeletonClipping::getClippedVertices() { return _clippedVertices; } Vector<unsigned short> &SkeletonClipping::getClippedTriangles() { return _clippedTriangles; } Vector<float> &SkeletonClipping::getClippedUVs() { return _clippedUVs; } bool SkeletonClipping::clip(float x1, float y1, float x2, float y2, float x3, float y3, Vector<float> *clippingArea, Vector<float> *output ) { Vector<float> *originalOutput = output; bool clipped = false; // Avoid copy at the end. Vector<float> *input; if (clippingArea->size() % 4 >= 2) { input = output; output = &_scratch; } else input = &_scratch; input->clear(); input->add(x1); input->add(y1); input->add(x2); input->add(y2); input->add(x3); input->add(y3); input->add(x1); input->add(y1); output->clear(); Vector<float> &clippingVertices = *clippingArea; size_t clippingVerticesLast = clippingArea->size() - 4; for (size_t i = 0;; i += 2) { float edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; float edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3]; float deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2; Vector<float> &inputVertices = *input; size_t inputVerticesLength = input->size() - 2, outputStart = output->size(); for (size_t ii = 0; ii < inputVerticesLength; ii += 2) { float inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; float inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3]; bool side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0; if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) { if (side2) { // v1 inside, v2 inside output->add(inputX2); output->add(inputY2); continue; } // v1 inside, v2 outside float c0 = inputY2 - inputY, c2 = inputX2 - inputX; float s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); if (MathUtil::abs(s) > 0.000001f) { float ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; output->add(edgeX + (edgeX2 - edgeX) * ua); output->add(edgeY + (edgeY2 - edgeY) * ua); } else { output->add(edgeX); output->add(edgeY); } } else if (side2) { // v1 outside, v2 inside float c0 = inputY2 - inputY, c2 = inputX2 - inputX; float s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); if (MathUtil::abs(s) > 0.000001f) { float ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; output->add(edgeX + (edgeX2 - edgeX) * ua); output->add(edgeY + (edgeY2 - edgeY) * ua); } else { output->add(edgeX); output->add(edgeY); } output->add(inputX2); output->add(inputY2); } clipped = true; } if (outputStart == output->size()) { // All edges outside. originalOutput->clear(); return true; } output->add((*output)[0]); output->add((*output)[1]); if (i == clippingVerticesLast) { break; } Vector<float> *temp = output; output = input; output->clear(); input = temp; } if (originalOutput != output) { originalOutput->clear(); for (size_t i = 0, n = output->size() - 2; i < n; ++i) originalOutput->add((*output)[i]); } else originalOutput->setSize(originalOutput->size() - 2, 0); return clipped; } void SkeletonClipping::makeClockwise(Vector<float> &polygon) { size_t verticeslength = polygon.size(); float area = polygon[verticeslength - 2] * polygon[1] - polygon[0] * polygon[verticeslength - 1]; float p1x, p1y, p2x, p2y; for (size_t i = 0, n = verticeslength - 3; i < n; i += 2) { p1x = polygon[i]; p1y = polygon[i + 1]; p2x = polygon[i + 2]; p2y = polygon[i + 3]; area += p1x * p2y - p2x * p1y; } if (area < 0) return; for (size_t i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { float x = polygon[i], y = polygon[i + 1]; int other = lastX - i; polygon[i] = polygon[other]; polygon[i + 1] = polygon[other + 1]; polygon[other] = x; polygon[other + 1] = y; } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencentcloudapi.cmq.v20190304.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class ModifySubscriptionAttributeRequest extends AbstractModel{ /** * 主题名字,在单个地域同一帐号下唯一。主题名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。 */ @SerializedName("TopicName") @Expose private String TopicName; /** * 订阅名字,在单个地域同一帐号的同一主题下唯一。订阅名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。 */ @SerializedName("SubscriptionName") @Expose private String SubscriptionName; /** * 向 Endpoint 推送消息出现错误时,CMQ 推送服务器的重试策略。取值如下: (1)BACKOFF_RETRY,退避重试。每隔一定时间重试一次,重试够一定次数后,就把该消息丢弃,继续推送下一条消息。 (2)EXPONENTIAL_DECAY_RETRY,指数衰退重试。每次重试的间隔是指数递增的,例如开始1s,后面是2s,4s,8s···由于 Topic 消息的周期是一天,所以最多重试一天就把消息丢弃。默认值是 EXPONENTIAL_DECAY_RETRY。 */ @SerializedName("NotifyStrategy") @Expose private String NotifyStrategy; /** * 推送内容的格式。取值:(1)JSON;(2)SIMPLIFIED,即 raw 格式。如果 Protocol 是 queue,则取值必须为 SIMPLIFIED。如果 Protocol 是 HTTP,两个值均可以,默认值是 JSON。 */ @SerializedName("NotifyContentFormat") @Expose private String NotifyContentFormat; /** * 消息正文。消息标签(用于消息过滤)。标签数量不能超过5个,每个标签不超过16个字符。与(Batch)PublishMessage的MsgTag参数配合使用,规则:1)如果FilterTag没有设置,则无论MsgTag是否有设置,订阅接收所有发布到Topic的消息;2)如果FilterTag数组有值,则只有数组中至少有一个值在MsgTag数组中也存在时(即FilterTag和MsgTag有交集),订阅才接收该发布到Topic的消息;3)如果FilterTag数组有值,但MsgTag没设置,则不接收任何发布到Topic的消息,可以认为是2)的一种特例,此时FilterTag和MsgTag没有交集。规则整体的设计思想是以订阅者的意愿为主。 */ @SerializedName("FilterTags") @Expose private String [] FilterTags; /** * BindingKey数量不超过5个, 每个BindingKey长度不超过64字节,该字段表示订阅接收消息的过滤策略,每个BindingKey最多含有15个“.”, 即最多16个词组。 */ @SerializedName("BindingKey") @Expose private String [] BindingKey; /** * Get 主题名字,在单个地域同一帐号下唯一。主题名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。 * @return TopicName 主题名字,在单个地域同一帐号下唯一。主题名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。 */ public String getTopicName() { return this.TopicName; } /** * Set 主题名字,在单个地域同一帐号下唯一。主题名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。 * @param TopicName 主题名字,在单个地域同一帐号下唯一。主题名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。 */ public void setTopicName(String TopicName) { this.TopicName = TopicName; } /** * Get 订阅名字,在单个地域同一帐号的同一主题下唯一。订阅名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。 * @return SubscriptionName 订阅名字,在单个地域同一帐号的同一主题下唯一。订阅名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。 */ public String getSubscriptionName() { return this.SubscriptionName; } /** * Set 订阅名字,在单个地域同一帐号的同一主题下唯一。订阅名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。 * @param SubscriptionName 订阅名字,在单个地域同一帐号的同一主题下唯一。订阅名称是一个不超过64个字符的字符串,必须以字母为首字符,剩余部分可以包含字母、数字和横划线(-)。 */ public void setSubscriptionName(String SubscriptionName) { this.SubscriptionName = SubscriptionName; } /** * Get 向 Endpoint 推送消息出现错误时,CMQ 推送服务器的重试策略。取值如下: (1)BACKOFF_RETRY,退避重试。每隔一定时间重试一次,重试够一定次数后,就把该消息丢弃,继续推送下一条消息。 (2)EXPONENTIAL_DECAY_RETRY,指数衰退重试。每次重试的间隔是指数递增的,例如开始1s,后面是2s,4s,8s···由于 Topic 消息的周期是一天,所以最多重试一天就把消息丢弃。默认值是 EXPONENTIAL_DECAY_RETRY。 * @return NotifyStrategy 向 Endpoint 推送消息出现错误时,CMQ 推送服务器的重试策略。取值如下: (1)BACKOFF_RETRY,退避重试。每隔一定时间重试一次,重试够一定次数后,就把该消息丢弃,继续推送下一条消息。 (2)EXPONENTIAL_DECAY_RETRY,指数衰退重试。每次重试的间隔是指数递增的,例如开始1s,后面是2s,4s,8s···由于 Topic 消息的周期是一天,所以最多重试一天就把消息丢弃。默认值是 EXPONENTIAL_DECAY_RETRY。 */ public String getNotifyStrategy() { return this.NotifyStrategy; } /** * Set 向 Endpoint 推送消息出现错误时,CMQ 推送服务器的重试策略。取值如下: (1)BACKOFF_RETRY,退避重试。每隔一定时间重试一次,重试够一定次数后,就把该消息丢弃,继续推送下一条消息。 (2)EXPONENTIAL_DECAY_RETRY,指数衰退重试。每次重试的间隔是指数递增的,例如开始1s,后面是2s,4s,8s···由于 Topic 消息的周期是一天,所以最多重试一天就把消息丢弃。默认值是 EXPONENTIAL_DECAY_RETRY。 * @param NotifyStrategy 向 Endpoint 推送消息出现错误时,CMQ 推送服务器的重试策略。取值如下: (1)BACKOFF_RETRY,退避重试。每隔一定时间重试一次,重试够一定次数后,就把该消息丢弃,继续推送下一条消息。 (2)EXPONENTIAL_DECAY_RETRY,指数衰退重试。每次重试的间隔是指数递增的,例如开始1s,后面是2s,4s,8s···由于 Topic 消息的周期是一天,所以最多重试一天就把消息丢弃。默认值是 EXPONENTIAL_DECAY_RETRY。 */ public void setNotifyStrategy(String NotifyStrategy) { this.NotifyStrategy = NotifyStrategy; } /** * Get 推送内容的格式。取值:(1)JSON;(2)SIMPLIFIED,即 raw 格式。如果 Protocol 是 queue,则取值必须为 SIMPLIFIED。如果 Protocol 是 HTTP,两个值均可以,默认值是 JSON。 * @return NotifyContentFormat 推送内容的格式。取值:(1)JSON;(2)SIMPLIFIED,即 raw 格式。如果 Protocol 是 queue,则取值必须为 SIMPLIFIED。如果 Protocol 是 HTTP,两个值均可以,默认值是 JSON。 */ public String getNotifyContentFormat() { return this.NotifyContentFormat; } /** * Set 推送内容的格式。取值:(1)JSON;(2)SIMPLIFIED,即 raw 格式。如果 Protocol 是 queue,则取值必须为 SIMPLIFIED。如果 Protocol 是 HTTP,两个值均可以,默认值是 JSON。 * @param NotifyContentFormat 推送内容的格式。取值:(1)JSON;(2)SIMPLIFIED,即 raw 格式。如果 Protocol 是 queue,则取值必须为 SIMPLIFIED。如果 Protocol 是 HTTP,两个值均可以,默认值是 JSON。 */ public void setNotifyContentFormat(String NotifyContentFormat) { this.NotifyContentFormat = NotifyContentFormat; } /** * Get 消息正文。消息标签(用于消息过滤)。标签数量不能超过5个,每个标签不超过16个字符。与(Batch)PublishMessage的MsgTag参数配合使用,规则:1)如果FilterTag没有设置,则无论MsgTag是否有设置,订阅接收所有发布到Topic的消息;2)如果FilterTag数组有值,则只有数组中至少有一个值在MsgTag数组中也存在时(即FilterTag和MsgTag有交集),订阅才接收该发布到Topic的消息;3)如果FilterTag数组有值,但MsgTag没设置,则不接收任何发布到Topic的消息,可以认为是2)的一种特例,此时FilterTag和MsgTag没有交集。规则整体的设计思想是以订阅者的意愿为主。 * @return FilterTags 消息正文。消息标签(用于消息过滤)。标签数量不能超过5个,每个标签不超过16个字符。与(Batch)PublishMessage的MsgTag参数配合使用,规则:1)如果FilterTag没有设置,则无论MsgTag是否有设置,订阅接收所有发布到Topic的消息;2)如果FilterTag数组有值,则只有数组中至少有一个值在MsgTag数组中也存在时(即FilterTag和MsgTag有交集),订阅才接收该发布到Topic的消息;3)如果FilterTag数组有值,但MsgTag没设置,则不接收任何发布到Topic的消息,可以认为是2)的一种特例,此时FilterTag和MsgTag没有交集。规则整体的设计思想是以订阅者的意愿为主。 */ public String [] getFilterTags() { return this.FilterTags; } /** * Set 消息正文。消息标签(用于消息过滤)。标签数量不能超过5个,每个标签不超过16个字符。与(Batch)PublishMessage的MsgTag参数配合使用,规则:1)如果FilterTag没有设置,则无论MsgTag是否有设置,订阅接收所有发布到Topic的消息;2)如果FilterTag数组有值,则只有数组中至少有一个值在MsgTag数组中也存在时(即FilterTag和MsgTag有交集),订阅才接收该发布到Topic的消息;3)如果FilterTag数组有值,但MsgTag没设置,则不接收任何发布到Topic的消息,可以认为是2)的一种特例,此时FilterTag和MsgTag没有交集。规则整体的设计思想是以订阅者的意愿为主。 * @param FilterTags 消息正文。消息标签(用于消息过滤)。标签数量不能超过5个,每个标签不超过16个字符。与(Batch)PublishMessage的MsgTag参数配合使用,规则:1)如果FilterTag没有设置,则无论MsgTag是否有设置,订阅接收所有发布到Topic的消息;2)如果FilterTag数组有值,则只有数组中至少有一个值在MsgTag数组中也存在时(即FilterTag和MsgTag有交集),订阅才接收该发布到Topic的消息;3)如果FilterTag数组有值,但MsgTag没设置,则不接收任何发布到Topic的消息,可以认为是2)的一种特例,此时FilterTag和MsgTag没有交集。规则整体的设计思想是以订阅者的意愿为主。 */ public void setFilterTags(String [] FilterTags) { this.FilterTags = FilterTags; } /** * Get BindingKey数量不超过5个, 每个BindingKey长度不超过64字节,该字段表示订阅接收消息的过滤策略,每个BindingKey最多含有15个“.”, 即最多16个词组。 * @return BindingKey BindingKey数量不超过5个, 每个BindingKey长度不超过64字节,该字段表示订阅接收消息的过滤策略,每个BindingKey最多含有15个“.”, 即最多16个词组。 */ public String [] getBindingKey() { return this.BindingKey; } /** * Set BindingKey数量不超过5个, 每个BindingKey长度不超过64字节,该字段表示订阅接收消息的过滤策略,每个BindingKey最多含有15个“.”, 即最多16个词组。 * @param BindingKey BindingKey数量不超过5个, 每个BindingKey长度不超过64字节,该字段表示订阅接收消息的过滤策略,每个BindingKey最多含有15个“.”, 即最多16个词组。 */ public void setBindingKey(String [] BindingKey) { this.BindingKey = BindingKey; } /** * Internal implementation, normal users should not use it. */ public void toMap(HashMap<String, String> map, String prefix) { this.setParamSimple(map, prefix + "TopicName", this.TopicName); this.setParamSimple(map, prefix + "SubscriptionName", this.SubscriptionName); this.setParamSimple(map, prefix + "NotifyStrategy", this.NotifyStrategy); this.setParamSimple(map, prefix + "NotifyContentFormat", this.NotifyContentFormat); this.setParamArraySimple(map, prefix + "FilterTags.", this.FilterTags); this.setParamArraySimple(map, prefix + "BindingKey.", this.BindingKey); } }
{ "pile_set_name": "Github" }
RUN: llvm-symbolizer --no-demangle --default-arch=i386 --obj=%p/Inputs/macho-universal 0x1f84 | FileCheck %s --check-prefix=DEFAULT RUN: llvm-symbolizer --no-demangle --obj=%p/Inputs/macho-universal:i386 0x1f67 | FileCheck %s --check-prefix=I386 RUN: llvm-symbolizer --no-demangle --obj=%p/Inputs/macho-universal:x86_64 0x100000f05 | FileCheck %s --check-prefix=X86-64 DEFAULT: main I386: _Z3inci X86-64: _Z3inci
{ "pile_set_name": "Github" }
msgid "" msgstr "" "Project-Id-Version: launchpad\n" "POT-Creation-Date: 2016-07-28 21:06+0200\n" "PO-Revision-Date: 2017-01-25 12:49-0500\n" "Last-Translator: JarlGullberg <jarl.gullberg@gmail.com>\n" "Language-Team: Danish\n" "Language: da_DK\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: crowdin.com\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: GetString\n" "X-Poedit-Basepath: ..\n" "X-Poedit-SearchPath-0: Launchpad.Launcher\n" "X-Poedit-SearchPath-1: Launchpad.Utilities\n" "X-Poedit-SearchPathExcluded-0: Launchpad.Launcher/Interface/gtk3/Launchpad.glade\n" "X-Crowdin-Project: launchpad\n" "X-Crowdin-Language: da\n" "X-Crowdin-File: messages.po\n" #: Launchpad.Launcher/Handlers/Protocols/ManifestBasedProtocolHandler.cs:625 #, csharp-format msgid "Verifying file {0} ({1} of {2})" msgstr "" #: Launchpad.Launcher/Handlers/Protocols/ManifestBasedProtocolHandler.cs:637 #, csharp-format msgid "Updating file {0} ({1} of {2})" msgstr "" #: Launchpad.Launcher/Handlers/Protocols/ManifestBasedProtocolHandler.cs:649 #, csharp-format msgid "Downloading file {0} ({1} of {2})" msgstr "" #: Launchpad.Launcher/Handlers/Protocols/ManifestBasedProtocolHandler.cs:661 #, csharp-format msgid "Downloading {0}: {1} out of {2}" msgstr "" #: Launchpad.Launcher/Interface/MainWindow.cs:108 #: Launchpad.Launcher/gtk-gui/Launchpad.Launcher.Interface.MainWindow.cs:90 #, csharp-format msgid "Launchpad - {0}" msgstr "" #: Launchpad.Launcher/Interface/MainWindow.cs:114 #: Launchpad.Launcher/Interface/MainWindow.cs:435 #: Launchpad.Launcher/Interface/MainWindow.cs:551 #: Launchpad.Launcher/gtk-gui/Launchpad.Launcher.Interface.MainWindow.cs:215 #: Launchpad.Utilities/Interface/MainWindow.cs:57 msgid "Idle" msgstr "Slumre" #: Launchpad.Launcher/Interface/MainWindow.cs:124 msgid "Failed to connect to the patch server. Please check your settings." msgstr "Kunne ikke forbinde til patchserveren. Venligst tjek dine indstillinger." #: Launchpad.Launcher/Interface/MainWindow.cs:129 msgid "Could not connect to server." msgstr "Kunne ikke forbinde til serveren." #: Launchpad.Launcher/Interface/MainWindow.cs:160 msgid "This appears to be the first time you're starting the launcher.\n" "Is this the location where you would like to install the game?" msgstr "" #: Launchpad.Launcher/Interface/MainWindow.cs:269 msgid "Installing..." msgstr "Installerer..." #: Launchpad.Launcher/Interface/MainWindow.cs:274 msgid "Install" msgstr "Installer" #: Launchpad.Launcher/Interface/MainWindow.cs:283 msgid "Updating..." msgstr "Opdaterer..." #: Launchpad.Launcher/Interface/MainWindow.cs:288 msgid "Update" msgstr "Opdater" #: Launchpad.Launcher/Interface/MainWindow.cs:297 msgid "Repairing..." msgstr "Reparerer..." #: Launchpad.Launcher/Interface/MainWindow.cs:302 msgid "Repair" msgstr "Reparere" #: Launchpad.Launcher/Interface/MainWindow.cs:311 msgid "Launching..." msgstr "Starter..." #: Launchpad.Launcher/Interface/MainWindow.cs:316 msgid "Launch" msgstr "Start" #: Launchpad.Launcher/Interface/MainWindow.cs:325 #: Launchpad.Launcher/gtk-gui/Launchpad.Launcher.Interface.MainWindow.cs:272 msgid "Inactive" msgstr "Inaktiv" #: Launchpad.Launcher/Interface/MainWindow.cs:386 msgid "The server does not provide the game for the selected platform." msgstr "Serveren tilegner ikke spillet for denne platform." #: Launchpad.Launcher/Interface/MainWindow.cs:489 msgid "The game failed to launch. Try repairing the installation." msgstr "Spillet kunne ikke starte. Prøv at reparere installationen." #: Launchpad.Launcher/Interface/MainWindow.cs:557 msgid "Installation finished" msgstr "" #: Launchpad.Launcher/Interface/MainWindow.cs:562 msgid "Update finished" msgstr "" #: Launchpad.Launcher/Interface/MainWindow.cs:567 msgid "Repair finished" msgstr "" #: Launchpad.Launcher/Interface/MainWindow.cs:595 msgid "Whoops! The game appears to have crashed.\n" "Would you like the launcher to verify the installation?" msgstr "Hovsa! Spillet ser ud til at have styrtede. \n" "Vil du lide Launchpad til at kontrollere installationen?" #: Launchpad.Launcher/Interface/MainWindow.cs:627 msgid "Reinstalling the game will delete all local files and download the entire game again.\n" "Are you sure you want to reinstall the game?" msgstr "" #: Launchpad.Launcher/gtk-gui/Launchpad.Launcher.Interface.MainWindow.cs:61 #: Launchpad.Launcher/gtk-gui/Launchpad.Launcher.Interface.MainWindow.cs:63 msgid "Menu" msgstr "" #: Launchpad.Launcher/gtk-gui/Launchpad.Launcher.Interface.MainWindow.cs:69 #: Launchpad.Launcher/gtk-gui/Launchpad.Launcher.Interface.MainWindow.cs:73 msgid "Repair Game" msgstr "Reparer spil" #: Launchpad.Launcher/gtk-gui/Launchpad.Launcher.Interface.MainWindow.cs:70 msgid "Starts a repair process for the installed game." msgstr "" #: Launchpad.Launcher/gtk-gui/Launchpad.Launcher.Interface.MainWindow.cs:79 #: Launchpad.Launcher/gtk-gui/Launchpad.Launcher.Interface.MainWindow.cs:83 msgid "Reinstall Game" msgstr "" #: Launchpad.Launcher/gtk-gui/Launchpad.Launcher.Interface.MainWindow.cs:80 msgid "Reinstalls the installed game." msgstr "" #: Launchpad.Utilities/Interface/MainWindow.cs:84 msgid "No GameVersion.txt file could be found in the target directory. This file is required.\n" "Would you like to add one? The version will be \"1.0.0\"." msgstr "" #: Launchpad.Utilities/Interface/MainWindow.cs:124 #, csharp-format msgid "{0} : {1} out of {2}" msgstr "{0} : {1} ud af {2}" #: Launchpad.Utilities/Interface/MainWindow.cs:140 msgid "Finished" msgstr "Færdig" #: Launchpad.Utilities/gtk-gui/Launchpad.Utilities.Interface.MainWindow.cs:61 msgid "Launchpad Utilities - Manifest" msgstr "Launchpad Utilities - Manifest" #: Launchpad.Utilities/gtk-gui/Launchpad.Utilities.Interface.MainWindow.cs:128 msgid "Progress: " msgstr "Status: " #: Launchpad.Utilities/gtk-gui/Launchpad.Utilities.Interface.MainWindow.cs:146 msgid "/some/file/path : 1 out of 100" msgstr "/någen/file/: 1 ud af 100" #: Launchpad.Utilities/gtk-gui/Launchpad.Utilities.Interface.MainWindow.cs:196 msgid "Generate Game Manifest" msgstr "Generere spilmanifest" #: Launchpad.Utilities/gtk-gui/Launchpad.Utilities.Interface.MainWindow.cs:218 msgid "Generate Launchpad Manifest" msgstr "Generere Launchpad-manifest"
{ "pile_set_name": "Github" }
describe Fastlane do describe Fastlane::FastFile do before do # Force FastlaneCore::CommandExecutor.execute to return command allow(FastlaneCore::CommandExecutor).to receive(:execute).and_wrap_original do |m, *args| args[0][:command] end end describe "SPM Integration" do it "raises an error if command is invalid" do expect do Fastlane::FastFile.new.parse("lane :test do spm(command: 'invalid_command') end").runner.execute(:test) end.to raise_error("Please pass a valid command. Use one of the following: build, test, clean, reset, update, resolve, generate-xcodeproj, init") end # Commands it "default use case is build" do result = Fastlane::FastFile.new.parse("lane :test do spm end").runner.execute(:test) expect(result).to eq("swift build") end it "sets the command to build" do result = Fastlane::FastFile.new.parse("lane :test do spm(command: 'build') end").runner.execute(:test) expect(result).to eq("swift build") end it "sets the command to test" do result = Fastlane::FastFile.new.parse("lane :test do spm(command: 'test') end").runner.execute(:test) expect(result).to eq("swift test") end it "sets the command to update" do result = Fastlane::FastFile.new.parse("lane :test do spm(command: 'update') end").runner.execute(:test) expect(result).to eq("swift package update") end it "sets the command to clean" do result = Fastlane::FastFile.new.parse("lane :test do spm(command: 'clean') end").runner.execute(:test) expect(result).to eq("swift package clean") end it "sets the command to reset" do result = Fastlane::FastFile.new.parse("lane :test do spm(command: 'reset') end").runner.execute(:test) expect(result).to eq("swift package reset") end it "sets the command to generate-xcodeproj" do result = Fastlane::FastFile.new.parse("lane :test do spm(command: 'generate-xcodeproj') end").runner.execute(:test) expect(result).to eq("swift package generate-xcodeproj") end it "sets the command to resolve" do result = Fastlane::FastFile.new.parse("lane :test do spm(command: 'resolve') end").runner.execute(:test) expect(result).to eq("swift package resolve") end # Arguments context "when command is not package related" do it "adds verbose flag to command if verbose is set to true" do result = Fastlane::FastFile.new.parse("lane :test do spm(verbose: true) end").runner.execute(:test) expect(result).to eq("swift build --verbose") end it "doesn't add a verbose flag to command if verbose is set to false" do result = Fastlane::FastFile.new.parse("lane :test do spm(verbose: false) end").runner.execute(:test) expect(result).to eq("swift build") end it "adds build-path flag to command if build_path is set" do result = Fastlane::FastFile.new.parse("lane :test do spm(build_path: 'foobar') end").runner.execute(:test) expect(result).to eq("swift build --build-path foobar") end it "adds package-path flag to command if package_path is set" do result = Fastlane::FastFile.new.parse("lane :test do spm(package_path: 'foobar') end").runner.execute(:test) expect(result).to eq("swift build --package-path foobar") end it "adds configuration flag to command if configuration is set" do result = Fastlane::FastFile.new.parse("lane :test do spm(configuration: 'release') end").runner.execute(:test) expect(result).to eq("swift build --configuration release") end it "raises an error if configuration is invalid" do expect do Fastlane::FastFile.new.parse("lane :test do spm(configuration: 'foobar') end").runner.execute(:test) end.to raise_error("Please pass a valid configuration: (debug|release)") end it "adds disable-sandbox flag to command if disable_sandbox is set to true" do result = Fastlane::FastFile.new.parse("lane :test do spm(disable_sandbox: true) end").runner.execute(:test) expect(result).to eq("swift build --disable-sandbox") end it "doesn't add a disable-sandbox flag to command if disable_sandbox is set to false" do result = Fastlane::FastFile.new.parse("lane :test do spm(disable_sandbox: false) end").runner.execute(:test) expect(result).to eq("swift build") end it "works with no parameters" do expect do Fastlane::FastFile.new.parse("lane :test do spm end").runner.execute(:test) end.not_to(raise_error) end end context "when command is package related" do let(:command) { 'update' } it "adds verbose flag to package command if verbose is set to true" do result = Fastlane::FastFile.new.parse("lane :test do spm( command: '#{command}', verbose: true ) end").runner.execute(:test) expect(result).to eq("swift package --verbose #{command}") end it "doesn't add a verbose flag to package command if verbose is set to false" do result = Fastlane::FastFile.new.parse("lane :test do spm( command: '#{command}', verbose: false ) end").runner.execute(:test) expect(result).to eq("swift package #{command}") end it "adds build-path flag to package command if package_path is set to true" do result = Fastlane::FastFile.new.parse("lane :test do spm( command: '#{command}', build_path: 'foobar' ) end").runner.execute(:test) expect(result).to eq("swift package --build-path foobar #{command}") end it "adds package-path flag to package command if package_path is set" do result = Fastlane::FastFile.new.parse("lane :test do spm( command: '#{command}', package_path: 'foobar' ) end").runner.execute(:test) expect(result).to eq("swift package --package-path foobar #{command}") end it "adds configuration flag to package command if configuration is set" do result = Fastlane::FastFile.new.parse("lane :test do spm( command: '#{command}', configuration: 'release' ) end").runner.execute(:test) expect(result).to eq("swift package --configuration release #{command}") end it "raises an error if configuration is invalid" do expect do Fastlane::FastFile.new.parse("lane :test do spm( command: '#{command}', configuration: 'foobar' ) end").runner.execute(:test) end.to raise_error("Please pass a valid configuration: (debug|release)") end it "raises an error if xcpretty output type is invalid" do expect do Fastlane::FastFile.new.parse("lane :test do spm( command: '#{command}', xcpretty_output: 'foobar' ) end").runner.execute(:test) end.to raise_error(/^Please pass a valid xcpretty output type: /) end it "passes additional arguments to xcpretty if specified" do result = Fastlane::FastFile.new.parse("lane :test do spm( command: '#{command}', xcpretty_output: 'simple', xcpretty_args: '--tap --no-utf' ) end").runner.execute(:test) expect(result).to eq("set -o pipefail && swift package #{command} 2>&1 | xcpretty --simple --tap --no-utf") end it "set pipefail with xcpretty" do result = Fastlane::FastFile.new.parse("lane :test do spm( command: '#{command}', xcpretty_output: 'simple' ) end").runner.execute(:test) expect(result).to eq("set -o pipefail && swift package #{command} 2>&1 | xcpretty --simple") end end context "when command is generate-xcodeproj" do it "adds xcconfig-overrides with :xcconfig is set and command is package command" do result = Fastlane::FastFile.new.parse("lane :test do spm( command: 'generate-xcodeproj', xcconfig: 'Package.xcconfig', ) end").runner.execute(:test) expect(result).to eq("swift package generate-xcodeproj --xcconfig-overrides Package.xcconfig") end it "adds --verbose and xcpretty options correctly as well" do result = Fastlane::FastFile.new.parse("lane :test do spm( command: 'generate-xcodeproj', xcconfig: 'Package.xcconfig', verbose: true, xcpretty_output: 'simple' ) end").runner.execute(:test) expect(result).to eq("set -o pipefail && swift package --verbose generate-xcodeproj --xcconfig-overrides Package.xcconfig 2>&1 | xcpretty --simple") end end end end end
{ "pile_set_name": "Github" }
package com.designPattern.abtractFactory; public class AndroidPad implements IPad{ protected AndroidPad(){}; @Override public void getOS() { // TODO Auto-generated method stub System.out.println("i am android pad"); } }
{ "pile_set_name": "Github" }
use super::{InitialMapBuilder, BuilderMap, Rect }; use rltk::RandomNumberGenerator; pub struct SimpleMapBuilder {} impl InitialMapBuilder for SimpleMapBuilder { #[allow(dead_code)] fn build_map(&mut self, rng: &mut rltk::RandomNumberGenerator, build_data : &mut BuilderMap) { self.build_rooms(rng, build_data); } } impl SimpleMapBuilder { #[allow(dead_code)] pub fn new() -> Box<SimpleMapBuilder> { Box::new(SimpleMapBuilder{}) } fn build_rooms(&mut self, rng : &mut RandomNumberGenerator, build_data : &mut BuilderMap) { const MAX_ROOMS : i32 = 30; const MIN_SIZE : i32 = 6; const MAX_SIZE : i32 = 10; let mut rooms : Vec<Rect> = Vec::new(); for _ in 0..MAX_ROOMS { let w = rng.range(MIN_SIZE, MAX_SIZE); let h = rng.range(MIN_SIZE, MAX_SIZE); let x = rng.roll_dice(1, build_data.map.width - w - 1) - 1; let y = rng.roll_dice(1, build_data.map.height - h - 1) - 1; let new_room = Rect::new(x, y, w, h); let mut ok = true; for other_room in rooms.iter() { if new_room.intersect(other_room) { ok = false } } if ok { rooms.push(new_room); } } build_data.rooms = Some(rooms); } }
{ "pile_set_name": "Github" }
// -*- C++ -*- forwarding header. // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library 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, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software // library without restriction. Specifically, if other files instantiate // templates or use macros or inline functions from this file, or you compile // this file and link it with other files to produce an executable, this // file does not by itself cause the resulting executable to be covered by // the GNU General Public License. This exception does not however // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. /** @file include/cstdlib * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c stdlib.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 20.4.6 C library // #ifndef _GLIBCXX_CSTDLIB #define _GLIBCXX_CSTDLIB 1 #pragma GCC system_header #include <bits/c++config.h> #include <cstddef> #if !_GLIBCXX_HOSTED // The C standard does not require a freestanding implementation to // provide <stdlib.h>. However, the C++ standard does still require // <cstdlib> -- but only the functionality mentioned in // [lib.support.start.term]. #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 _GLIBCXX_BEGIN_NAMESPACE(std) extern "C" void abort(void); extern "C" int atexit(void (*)()); extern "C" void exit(int); _GLIBCXX_END_NAMESPACE #else #include <stdlib.h> // Get rid of those macros defined in <stdlib.h> in lieu of real functions. #undef abort #undef abs #undef atexit #undef atof #undef atoi #undef atol #undef bsearch #undef calloc #undef div #undef exit #undef free #undef getenv #undef labs #undef ldiv #undef malloc #undef mblen #undef mbstowcs #undef mbtowc #undef qsort #undef rand #undef realloc #undef srand #undef strtod #undef strtol #undef strtoul #undef system #undef wcstombs #undef wctomb _GLIBCXX_BEGIN_NAMESPACE(std) using ::div_t; using ::ldiv_t; using ::abort; using ::abs; using ::atexit; using ::atof; using ::atoi; using ::atol; using ::bsearch; using ::calloc; using ::div; using ::exit; using ::free; using ::getenv; using ::labs; using ::ldiv; using ::malloc; #ifdef _GLIBCXX_HAVE_MBSTATE_T using ::mblen; using ::mbstowcs; using ::mbtowc; #endif // _GLIBCXX_HAVE_MBSTATE_T using ::qsort; using ::rand; using ::realloc; using ::srand; using ::strtod; using ::strtol; using ::strtoul; using ::system; #ifdef _GLIBCXX_USE_WCHAR_T using ::wcstombs; using ::wctomb; #endif // _GLIBCXX_USE_WCHAR_T inline long abs(long __i) { return labs(__i); } inline ldiv_t div(long __i, long __j) { return ldiv(__i, __j); } _GLIBCXX_END_NAMESPACE #if _GLIBCXX_USE_C99 #undef _Exit #undef llabs #undef lldiv #undef atoll #undef strtoll #undef strtoull #undef strtof #undef strtold _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::lldiv_t; #endif #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" void (_Exit)(int); #endif #if !_GLIBCXX_USE_C99_DYNAMIC using ::_Exit; #endif inline long long abs(long long __x) { return __x >= 0 ? __x : -__x; } #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::llabs; inline lldiv_t div(long long __n, long long __d) { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } using ::lldiv; #endif #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC extern "C" long long int (atoll)(const char *); extern "C" long long int (strtoll)(const char * restrict, char ** restrict, int); extern "C" unsigned long long int (strtoull)(const char * restrict, char ** restrict, int); #endif #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::atoll; using ::strtoll; using ::strtoull; #endif using ::strtof; using ::strtold; _GLIBCXX_END_NAMESPACE _GLIBCXX_BEGIN_NAMESPACE(std) #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::__gnu_cxx::lldiv_t; #endif using ::__gnu_cxx::_Exit; using ::__gnu_cxx::abs; #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::__gnu_cxx::llabs; using ::__gnu_cxx::div; using ::__gnu_cxx::lldiv; #endif using ::__gnu_cxx::atoll; using ::__gnu_cxx::strtof; using ::__gnu_cxx::strtoll; using ::__gnu_cxx::strtoull; using ::__gnu_cxx::strtold; _GLIBCXX_END_NAMESPACE #endif // _GLIBCXX_USE_C99 #endif // !_GLIBCXX_HOSTED #endif
{ "pile_set_name": "Github" }
// @target: es5 function foo<T>() { return '' } class C<T> { bar() { return 0; } [foo<T>()]() { } }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="de"> <head> <!-- Generated by javadoc --> <title>Negative (documentation 1.2.5 API)</title> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Negative (documentation 1.2.5 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../net/jqwik/api/constraints/LowerChars.html" title="annotation in net.jqwik.api.constraints"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../net/jqwik/api/constraints/NotEmpty.html" title="annotation in net.jqwik.api.constraints"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?net/jqwik/api/constraints/Negative.html" target="_top">Frames</a></li> <li><a href="Negative.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Required&nbsp;|&nbsp;</li> <li>Optional</li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Element</li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">net.jqwik.api.constraints</div> <h2 title="Annotation Type Negative" class="title">Annotation Type Negative</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>@Target(value={ANNOTATION_TYPE,PARAMETER,TYPE_USE}) @Retention(value=RUNTIME) @Documented @API(status=MAINTAINED, since="1.0") public @interface <span class="memberNameLabel">Negative</span></pre> <div class="block">Constrain the range of a generated number to be less than 0. Applies to numeric parameters which are also annotated with <code>@ForAll</code>.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../net/jqwik/api/ForAll.html" title="annotation in net.jqwik.api"><code>ForAll</code></a>, <a href="../../../../net/jqwik/api/constraints/Positive.html" title="annotation in net.jqwik.api.constraints"><code>Positive</code></a></dd> </dl> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../net/jqwik/api/constraints/LowerChars.html" title="annotation in net.jqwik.api.constraints"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../net/jqwik/api/constraints/NotEmpty.html" title="annotation in net.jqwik.api.constraints"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?net/jqwik/api/constraints/Negative.html" target="_top">Frames</a></li> <li><a href="Negative.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Required&nbsp;|&nbsp;</li> <li>Optional</li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Element</li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "pile_set_name": "Github" }
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM 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. OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class Foam::ManualInjection Description Manual injection. User specifies: - Total mass to inject - Parcel positions in file \c positionsFile - Initial parcel velocity Properties: - Parcel diameters obtained by distribution model - All parcels introduced at SOI SourceFiles ManualInjection.C \*---------------------------------------------------------------------------*/ #ifndef ManualInjection_H #define ManualInjection_H #include "InjectionModel.H" #include "distributionModel.H" #include "Switch.H" #include "GlobalIOField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Class ManualInjection Declaration \*---------------------------------------------------------------------------*/ template<class CloudType> class ManualInjection : public InjectionModel<CloudType> { // Private Data //- Name of file containing positions data const word positionsFile_; //- Field of parcel positions GlobalIOField<vector> positions_; //- Field of parcel diameters scalarList diameters_; //- List of cell labels corresponding to injector positions labelList injectorCells_; //- List of tetFace labels corresponding to injector positions labelList injectorTetFaces_; //- List of tetPt labels corresponding to injector positions labelList injectorTetPts_; //- Initial parcel velocity const vector U0_; //- Parcel size distribution model const autoPtr<distributionModel> sizeDistribution_; //- Flag to suppress errors if particle injection site is out-of-bounds Switch ignoreOutOfBounds_; public: //- Runtime type information TypeName("manualInjection"); // Constructors //- Construct from dictionary ManualInjection ( const dictionary& dict, CloudType& owner, const word& modelName ); //- Construct copy ManualInjection(const ManualInjection<CloudType>& im); //- Construct and return a clone virtual autoPtr<InjectionModel<CloudType>> clone() const { return autoPtr<InjectionModel<CloudType>> ( new ManualInjection<CloudType>(*this) ); } //- Destructor virtual ~ManualInjection(); // Member Functions //- Set injector locations when mesh is updated virtual void updateMesh(); //- Return the end-of-injection time scalar timeEnd() const; //- Number of parcels to introduce relative to SOI virtual label parcelsToInject(const scalar time0, const scalar time1); //- Volume of parcels to introduce relative to SOI virtual scalar volumeToInject(const scalar time0, const scalar time1); // Injection geometry //- Set the injection position and owner cell, tetFace and tetPt virtual void setPositionAndCell ( const label parcelI, const label nParcels, const scalar time, vector& position, label& cellOwner, label& tetFacei, label& tetPti ); //- Set the parcel properties virtual void setProperties ( const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType& parcel ); //- Flag to identify whether model fully describes the parcel virtual bool fullyDescribed() const; //- Return flag to identify whether or not injection of parcelI is // permitted virtual bool validInjection(const label parcelI); }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository #include "ManualInjection.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- /* ** ** Copyright 2008, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ --> <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_input_options" msgid="3909945612939668554">"Sisestusvalikud"</string> <string name="use_contacts_for_spellchecking_option_title" msgid="5374120998125353898">"Kontakti nimede kontroll."</string> <string name="use_contacts_for_spellchecking_option_summary" msgid="8754413382543307713">"Õigekirjakontroll kasutab teie kontaktisikute loendi sissekandeid"</string> <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibreeri klahvivajutusel"</string> <string name="sound_on_keypress" msgid="6093592297198243644">"Heli klahvivajutusel"</string> <string name="popup_on_keypress" msgid="123894815723512944">"Klahvivajutusel kuva hüpik"</string> <string name="settings_screen_preferences" msgid="2696713156722014624">"Eelistused"</string> <string name="settings_screen_accounts" msgid="2786418968536696670">"Kontod ja privaatsus"</string> <string name="settings_screen_appearance" msgid="7358046399111611615">"Välimus ja paigutused"</string> <string name="settings_screen_gesture" msgid="8826372746901183556">"Joonistusega sisestamine"</string> <string name="settings_screen_correction" msgid="1616818407747682955">"Teksti korrigeerimine"</string> <string name="settings_screen_advanced" msgid="7472408607625972994">"Täpsemad"</string> <string name="settings_screen_theme" msgid="2137262503543943871">"Teema"</string> <string name="enable_split_keyboard" msgid="4177264923999493614">"Luba kaheks jaotatud klaviatuur"</string> <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Vaheta sisestusmeetodit"</string> <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Keelevahetuse võti hõlmab ka muid sisestusmeetodeid"</string> <string name="show_language_switch_key" msgid="5915478828318774384">"Keelevahetuse nupp"</string> <string name="show_language_switch_key_summary" msgid="7343403647474265713">"Kuva, kui lubatud on mitu sisendkeelt"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Hüpiku loobumisviivitus"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Viivituseta"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Vaikeseade"</string> <string name="abbreviation_unit_milliseconds" msgid="8700286094028323363">"<xliff:g id="MILLISECONDS">%s</xliff:g> ms"</string> <string name="settings_system_default" msgid="6268225104743331821">"Süsteemi vaikeväärt."</string> <string name="use_contacts_dict" msgid="4435317977804180815">"Soovita kontakti nimesid"</string> <string name="use_contacts_dict_summary" msgid="6599983334507879959">"Kasuta soovitusteks ja parandusteks nimesid kontaktiloendist"</string> <string name="use_personalized_dicts" msgid="5167396352105467626">"Isikupärast. soovitused"</string> <string name="enable_metrics_logging" msgid="5506372337118822837">"Aita rakendust <xliff:g id="APPLICATION_NAME">%s</xliff:g> täiustada"</string> <string name="use_double_space_period" msgid="8781529969425082860">"Punkt tühikuklahviga"</string> <string name="use_double_space_period_summary" msgid="6532892187247952799">"Tühikuklahvi kaks korda puudutades sisestatakse punkt ja tühik"</string> <string name="auto_cap" msgid="1719746674854628252">"Automaatne suurtähtede kasutamine"</string> <string name="auto_cap_summary" msgid="7934452761022946874">"Iga lause esimese sõna kirjutamine suure algustähega"</string> <string name="edit_personal_dictionary" msgid="3996910038952940420">"Isiklik sõnastik"</string> <string name="configure_dictionaries_title" msgid="4238652338556902049">"Pistiksõnaraamatud"</string> <string name="main_dictionary" msgid="4798763781818361168">"Peamine sõnaraamat"</string> <string name="prefs_show_suggestions" msgid="8026799663445531637">"Kuva korrigeerimise soovitused"</string> <string name="prefs_show_suggestions_summary" msgid="1583132279498502825">"Kuva sisestamise ajal sõnasoovitusi"</string> <string name="prefs_block_potentially_offensive_title" msgid="5078480071057408934">"Blokeeri solvavad sõnad"</string> <string name="prefs_block_potentially_offensive_summary" msgid="2371835479734991364">"Ära soovita potentsiaalselt solvavaid sõnu"</string> <string name="auto_correction" msgid="7630720885194996950">"Automaatne korrigeerimine"</string> <string name="auto_correction_summary" msgid="5625751551134658006">"Tühik ja kirjavahemärgid parand. autom. kirjavigadega sõnad"</string> <string name="auto_correction_threshold_mode_off" msgid="8470882665417944026">"Väljas"</string> <string name="auto_correction_threshold_mode_modest" msgid="8788366690620799097">"Mõõdukas"</string> <string name="auto_correction_threshold_mode_aggressive" msgid="7319007299148899623">"Agressiivne"</string> <string name="auto_correction_threshold_mode_very_aggressive" msgid="1853309024129480416">"Väga agressiivne"</string> <string name="bigram_prediction" msgid="1084449187723948550">"Järgmise sõna soovitused"</string> <string name="bigram_prediction_summary" msgid="3896362682751109677">"Soovituste tegemisel eelmise sõna kasutamine"</string> <string name="gesture_input" msgid="826951152254563827">"Luba joonistusega sisestamine"</string> <string name="gesture_input_summary" msgid="9180350639305731231">"Sõna sisestamine tähtede lohistamisega"</string> <string name="gesture_preview_trail" msgid="3802333369335722221">"Näita liigutuse jälge"</string> <string name="gesture_floating_preview_text" msgid="4443240334739381053">"Dünaamiline ujuv eelvaade"</string> <string name="gesture_floating_preview_text_summary" msgid="4472696213996203533">"Soovitatud sõna vaatamine joonistusega sisestamise ajal"</string> <string name="gesture_space_aware" msgid="2078291600664682496">"Fraasi liigutus"</string> <string name="gesture_space_aware_summary" msgid="4371385818348528538">"Sisestage liigutuste kasutamisel tühikuid, libistades tühikuklahvile"</string> <string name="voice_input" msgid="3583258583521397548">"Häälesisendi klahv"</string> <string name="voice_input_disabled_summary" msgid="6323489602945135165">"Ühtegi häälsisendmeetodit pole lubatud. Kontrollige keele- ja sisendiseadeid."</string> <string name="configure_input_method" msgid="373356270290742459">"Sisestusmeetodite seadistamine"</string> <string name="language_selection_title" msgid="3666971864764478269">"Keeled"</string> <string name="help_and_feedback" msgid="5328219371839879161">"Abi ja tagasiside"</string> <string name="select_language" msgid="5709487854987078367">"Keeled"</string> <string name="hint_add_to_dictionary" msgid="2645988432867033007">"Salvestamiseks puudutage uuesti"</string> <string name="hint_add_to_dictionary_without_word" msgid="6710206006427574423">"Salvestamiseks puudutage siin"</string> <string name="has_dictionary" msgid="6071847973466625007">"Sõnastik saadaval"</string> <string name="keyboard_layout" msgid="8451164783510487501">"Klaviatuuri teema"</string> <string name="switch_accounts" msgid="3321216593719006162">"Konto vahetamine"</string> <string name="no_accounts_selected" msgid="2073821619103904330">"Ühtegi kontot pole valitud"</string> <string name="account_selected" msgid="2846876462199625974">"Praegu kasutatakse e-posti aadressi <xliff:g id="EMAIL_ADDRESS">%1$s</xliff:g>"</string> <string name="account_select_ok" msgid="9141195141763227797">"OK"</string> <string name="account_select_cancel" msgid="5181012062618504340">"Tühista"</string> <string name="account_select_sign_out" msgid="3299651159390187933">"Logi välja"</string> <string name="account_select_title" msgid="6279711684772922649">"Kasutatava konto valimine"</string> <string name="subtype_en_GB" msgid="88170601942311355">"Inglise (UK)"</string> <string name="subtype_en_US" msgid="6160452336634534239">"Inglise (USA)"</string> <string name="subtype_es_US" msgid="5583145191430180200">"hispaania (USA)"</string> <string name="subtype_hi_ZZ" msgid="8860448146262798623">"Hindi-inglise"</string> <string name="subtype_sr_ZZ" msgid="9059219552986034343">"Serbia (ladina)"</string> <string name="subtype_with_layout_en_GB" msgid="1931018968641592304">"Inglise (Ühendk.) (<xliff:g id="KEYBOARD_LAYOUT">%s</xliff:g>)"</string> <string name="subtype_with_layout_en_US" msgid="8809311287529805422">"Inglise (USA) (<xliff:g id="KEYBOARD_LAYOUT">%s</xliff:g>)"</string> <string name="subtype_with_layout_es_US" msgid="510930471167541338">"Hispaania (USA) (<xliff:g id="KEYBOARD_LAYOUT">%s</xliff:g>)"</string> <string name="subtype_with_layout_hi_ZZ" msgid="6827402953860547044">"Hindi-inglise (<xliff:g id="KEYBOARD_LAYOUT">%s</xliff:g>)"</string> <string name="subtype_with_layout_sr_ZZ" msgid="2859024772719772407">"Serbia (<xliff:g id="KEYBOARD_LAYOUT">%s</xliff:g>)"</string> <string name="subtype_generic_traditional" msgid="8584594350973800586">"<xliff:g id="LANGUAGE_NAME">%s</xliff:g> (traditsiooniline)"</string> <string name="subtype_generic_compact" msgid="3353673321203202922">"<xliff:g id="LANGUAGE_NAME">%s</xliff:g> (kompaktne)"</string> <string name="subtype_no_language" msgid="7137390094240139495">"Keel puudub (tähestik)"</string> <string name="subtype_no_language_qwerty" msgid="244337630616742604">"Tähestik (QWERTY)"</string> <string name="subtype_no_language_qwertz" msgid="443066912507547976">"Tähestik (QWERTZ)"</string> <string name="subtype_no_language_azerty" msgid="8144348527575640087">"Tähestik (AZERTY)"</string> <string name="subtype_no_language_dvorak" msgid="1564494667584718094">"Tähestik (Dvorak)"</string> <string name="subtype_no_language_colemak" msgid="5837418400010302623">"Tähestik (Colemak)"</string> <string name="subtype_no_language_pcqwerty" msgid="5354918232046200018">"Tähestik (PC)"</string> <string name="subtype_emoji" msgid="7483586578074549196">"Emotikon"</string> <string name="keyboard_theme" msgid="4909551808526178852">"Klaviatuuriteema"</string> <string name="custom_input_styles_title" msgid="8429952441821251512">"Kohandage sisendlaadid"</string> <string name="add_style" msgid="6163126614514489951">"Lisage laad"</string> <string name="add" msgid="8299699805688017798">"Lisa"</string> <string name="remove" msgid="4486081658752944606">"Eemalda"</string> <string name="save" msgid="7646738597196767214">"Salvesta"</string> <string name="subtype_locale" msgid="8576443440738143764">"Keel"</string> <string name="keyboard_layout_set" msgid="4309233698194565609">"Paigutus"</string> <string name="custom_input_style_note_message" msgid="8826731320846363423">"Kohandatud sisendi laad tuleb enne kasutamist lubada. Lubada?"</string> <string name="enable" msgid="5031294444630523247">"Luba"</string> <string name="not_now" msgid="6172462888202790482">"Mitte kohe"</string> <string name="custom_input_style_already_exists" msgid="8008728952215449707">"Sama sisendstiil on juba olemas: <xliff:g id="INPUT_STYLE_NAME">%s</xliff:g>"</string> <string name="prefs_keypress_vibration_duration_settings" msgid="7918341459947439226">"Klahvivajutuse vibreerimise kestus"</string> <string name="prefs_keypress_sound_volume_settings" msgid="6027007337036891623">"Klahvivajutuse helitugevus"</string> <string name="prefs_key_longpress_timeout_settings" msgid="6102240298932897873">"Pika klahvivajutuse viide"</string> <string name="prefs_enable_emoji_alt_physical_key" msgid="5963640002335470112">"Füüsilise klaviatuuri emotikon"</string> <string name="prefs_enable_emoji_alt_physical_key_summary" msgid="5259484820941627827">"Füüsiline klahv Alt kuvab emotikonide paleti"</string> <string name="button_default" msgid="3988017840431881491">"Vaikeväärtus"</string> <string name="setup_welcome_title" msgid="6112821709832031715">"Tere tulemast rakendusse <xliff:g id="APPLICATION_NAME">%s</xliff:g>"</string> <string name="setup_welcome_additional_description" msgid="8150252008545768953">"joonistusega sisestamisega"</string> <string name="setup_start_action" msgid="8936036460897347708">"Alustamine"</string> <string name="setup_next_action" msgid="371821437915144603">"Järgmine toiming"</string> <string name="setup_steps_title" msgid="6400373034871816182">"Rakenduse <xliff:g id="APPLICATION_NAME">%s</xliff:g> seadistamine"</string> <string name="setup_step1_title" msgid="3147967630253462315">"Lubage <xliff:g id="APPLICATION_NAME">%s</xliff:g>"</string> <string name="setup_step1_instruction" msgid="4295448056733329661">"Märkige oma keele- ja sisendiseadetes rakendus „<xliff:g id="APPLICATION_NAME">%s</xliff:g>”. See lubab rakenduse käitamise teie seadmes."</string> <string name="setup_step1_finished_instruction" msgid="8701441895377434947">"<xliff:g id="APPLICATION_NAME">%s</xliff:g> on teie keele- ja sisendiseadetes juba lubatud, seega on see toiming tehtud. Asuge järgmise toimingu juurde."</string> <string name="setup_step1_action" msgid="4366513534999901728">"Luba seadetes"</string> <string name="setup_step2_title" msgid="6860725447906690594">"Minge üle rakendusele <xliff:g id="APPLICATION_NAME">%s</xliff:g>"</string> <string name="setup_step2_instruction" msgid="9141481964870023336">"Järgmisena valige aktiivseks tekstisisestusmeetodiks rakendus „<xliff:g id="APPLICATION_NAME">%s</xliff:g>”."</string> <string name="setup_step2_action" msgid="1660330307159824337">"Vaheta sisestusmeetodeid"</string> <string name="setup_step3_title" msgid="3154757183631490281">"Õnnitleme. Kõik on valmis!"</string> <string name="setup_step3_instruction" msgid="8025981829605426000">"Nüüd saate rakendusega <xliff:g id="APPLICATION_NAME">%s</xliff:g> sisestada kõikides oma lemmikrakendustes."</string> <string name="setup_step3_action" msgid="600879797256942259">"Seadista lisakeeled"</string> <string name="setup_finish_action" msgid="276559243409465389">"Lõpetatud"</string> <string name="show_setup_wizard_icon" msgid="5008028590593710830">"Kuva rakenduse ikoon"</string> <string name="show_setup_wizard_icon_summary" msgid="4119998322536880213">"Rakenduse ikooni kuvamine käivitajas"</string> <string name="app_name" msgid="6320102637491234792">"Sõnastikupakkuja"</string> <string name="dictionary_provider_name" msgid="3027315045397363079">"Sõnastikupakkuja"</string> <string name="dictionary_service_name" msgid="6237472350693511448">"Sõnastikuteenus"</string> <string name="download_description" msgid="6014835283119198591">"Sõnastiku värskendamisteave"</string> <string name="dictionary_settings_title" msgid="8091417676045693313">"Pistiksõnastikud"</string> <string name="dictionary_settings_summary" msgid="5305694987799824349">"Sõnastike seaded"</string> <string name="user_dictionaries" msgid="3582332055892252845">"Kasutaja sõnastikud"</string> <string name="default_user_dict_pref_name" msgid="1625055720489280530">"Kasutaja sõnastik"</string> <string name="dictionary_available" msgid="4728975345815214218">"Sõnastik on saadaval"</string> <string name="dictionary_downloading" msgid="2982650524622620983">"Praegu allalaadimisel"</string> <string name="dictionary_installed" msgid="8081558343559342962">"Installitud"</string> <string name="dictionary_disabled" msgid="8950383219564621762">"Installitud, keelatud"</string> <string name="cannot_connect_to_dict_service" msgid="9216933695765732398">"Probleem sõnastikuga ühendumisel"</string> <string name="no_dictionaries_available" msgid="8039920716566132611">"Sõnastikke pole"</string> <string name="check_for_updates_now" msgid="8087688440916388581">"Värskenda"</string> <string name="last_update" msgid="730467549913588780">"Viimati värskendatud"</string> <string name="message_updating" msgid="4457761393932375219">"Värskenduste otsimine"</string> <string name="message_loading" msgid="5638680861387748936">"Laadimine …"</string> <string name="main_dict_description" msgid="3072821352793492143">"Peamine sõnastik"</string> <string name="cancel" msgid="6830980399865683324">"Tühista"</string> <string name="go_to_settings" msgid="3876892339342569259">"Seaded"</string> <string name="install_dict" msgid="180852772562189365">"Installi"</string> <string name="cancel_download_dict" msgid="7843340278507019303">"Tühista"</string> <string name="delete_dict" msgid="756853268088330054">"Kustuta"</string> <string name="version_text" msgid="2715354215568469385">"Versioon <xliff:g id="VERSION_NUMBER">%1$s</xliff:g>"</string> <string name="user_dict_settings_add_menu_title" msgid="1254195365689387076">"Lisa"</string> <string name="user_dict_settings_add_dialog_title" msgid="4096700390211748168">"Sõnaraamatusse lisamine"</string> <string name="user_dict_settings_add_screen_title" msgid="5818914331629278758">"Fraas"</string> <string name="user_dict_settings_add_dialog_more_options" msgid="5671682004887093112">"Rohkem valikuid"</string> <string name="user_dict_settings_add_dialog_less_options" msgid="2716586567241724126">"Vähem valikuid"</string> <string name="user_dict_settings_add_dialog_confirm" msgid="4703129507388332950">"OK"</string> <string name="user_dict_settings_add_word_option_name" msgid="6665558053408962865">"Sõna:"</string> <string name="user_dict_settings_add_shortcut_option_name" msgid="3094731590655523777">"Otsetee:"</string> <string name="user_dict_settings_add_locale_option_name" msgid="4738643440987277705">"Keel:"</string> <string name="user_dict_settings_add_word_hint" msgid="4902434148985906707">"Sisestage sõna"</string> <string name="user_dict_settings_add_shortcut_hint" msgid="2265453012555060178">"Valikuline otsetee"</string> <string name="user_dict_settings_edit_dialog_title" msgid="3765774633869590352">"Sõna muutmine"</string> <string name="user_dict_settings_context_menu_edit_title" msgid="6812255903472456302">"Muuda"</string> <string name="user_dict_settings_context_menu_delete_title" msgid="8142932447689461181">"Kustuta"</string> <string name="user_dict_settings_empty_text" msgid="6889278304342592383">"Kasutaja sõnaraamatus ei ole ühtki sõna. Sõna lisamiseks puudutage nuppu Lisa (+)."</string> <string name="user_dict_settings_all_languages" msgid="8276126583216298886">"Kõikides keeltes"</string> <string name="user_dict_settings_more_languages" msgid="7131268499685180461">"Rohkem keeli ..."</string> <string name="user_dict_settings_delete" msgid="110413335187193859">"Kustuta"</string> <string name="user_dict_fast_scroll_alphabet" msgid="5431919401558285473">" ABCDEFGHIJKLMNOPQRSŠZŽTUVWÕÄÖÜXY"</string> </resources>
{ "pile_set_name": "Github" }
<?php return array( /* |-------------------------------------------------------------------------- | Default Queue Driver |-------------------------------------------------------------------------- | | The Laravel queue API supports a variety of back-ends via an unified | API, giving you convenient access to each back-end using the same | syntax for each one. Here you may set the default queue driver. | | Supported: "sync", "beanstalkd", "sqs", "iron" | */ 'default' => 'sync', /* |-------------------------------------------------------------------------- | Queue Connections |-------------------------------------------------------------------------- | | Here you may configure the connection information for each server that | is used by your application. A default configuration has been added | for each back-end shipped with Laravel. You are free to add more. | */ 'connections' => array( 'sync' => array( 'driver' => 'sync', ), 'beanstalkd' => array( 'driver' => 'beanstalkd', 'host' => 'localhost', 'queue' => 'default', 'ttr' => 60, ), 'sqs' => array( 'driver' => 'sqs', 'key' => 'your-public-key', 'secret' => 'your-secret-key', 'queue' => 'your-queue-url', 'region' => 'us-east-1', ), 'iron' => array( 'driver' => 'iron', 'host' => 'mq-aws-us-east-1.iron.io', 'token' => 'your-token', 'project' => 'your-project-id', 'queue' => 'your-queue-name', 'encrypt' => false ), 'redis' => array( 'driver' => 'redis', 'queue' => 'default', ), ), /* |-------------------------------------------------------------------------- | Failed Queue Jobs |-------------------------------------------------------------------------- | | These options configure the behavior of failed queue job logging so you | can control which database and table are used to store the jobs that | have failed. You may change them to any database / table you wish. | */ 'failed' => array( 'database' => 'mysql', 'table' => 'failed_jobs', ), );
{ "pile_set_name": "Github" }
#ifndef _SYS_PRCTL_H #define _SYS_PRCTL_H #ifdef __cplusplus extern "C" { #endif #include <stdint.h> #define PR_SET_PDEATHSIG 1 #define PR_GET_PDEATHSIG 2 #define PR_GET_DUMPABLE 3 #define PR_SET_DUMPABLE 4 #define PR_GET_UNALIGN 5 #define PR_SET_UNALIGN 6 #define PR_UNALIGN_NOPRINT 1 #define PR_UNALIGN_SIGBUS 2 #define PR_GET_KEEPCAPS 7 #define PR_SET_KEEPCAPS 8 #define PR_GET_FPEMU 9 #define PR_SET_FPEMU 10 #define PR_FPEMU_NOPRINT 1 #define PR_FPEMU_SIGFPE 2 #define PR_GET_FPEXC 11 #define PR_SET_FPEXC 12 #define PR_FP_EXC_SW_ENABLE 0x80 #define PR_FP_EXC_DIV 0x010000 #define PR_FP_EXC_OVF 0x020000 #define PR_FP_EXC_UND 0x040000 #define PR_FP_EXC_RES 0x080000 #define PR_FP_EXC_INV 0x100000 #define PR_FP_EXC_DISABLED 0 #define PR_FP_EXC_NONRECOV 1 #define PR_FP_EXC_ASYNC 2 #define PR_FP_EXC_PRECISE 3 #define PR_GET_TIMING 13 #define PR_SET_TIMING 14 #define PR_TIMING_STATISTICAL 0 #define PR_TIMING_TIMESTAMP 1 #define PR_SET_NAME 15 #define PR_GET_NAME 16 #define PR_GET_ENDIAN 19 #define PR_SET_ENDIAN 20 #define PR_ENDIAN_BIG 0 #define PR_ENDIAN_LITTLE 1 #define PR_ENDIAN_PPC_LITTLE 2 #define PR_GET_SECCOMP 21 #define PR_SET_SECCOMP 22 #define PR_CAPBSET_READ 23 #define PR_CAPBSET_DROP 24 #define PR_GET_TSC 25 #define PR_SET_TSC 26 #define PR_TSC_ENABLE 1 #define PR_TSC_SIGSEGV 2 #define PR_GET_SECUREBITS 27 #define PR_SET_SECUREBITS 28 #define PR_SET_TIMERSLACK 29 #define PR_GET_TIMERSLACK 30 #define PR_TASK_PERF_EVENTS_DISABLE 31 #define PR_TASK_PERF_EVENTS_ENABLE 32 #define PR_MCE_KILL 33 #define PR_MCE_KILL_CLEAR 0 #define PR_MCE_KILL_SET 1 #define PR_MCE_KILL_LATE 0 #define PR_MCE_KILL_EARLY 1 #define PR_MCE_KILL_DEFAULT 2 #define PR_MCE_KILL_GET 34 #define PR_SET_MM 35 #define PR_SET_MM_START_CODE 1 #define PR_SET_MM_END_CODE 2 #define PR_SET_MM_START_DATA 3 #define PR_SET_MM_END_DATA 4 #define PR_SET_MM_START_STACK 5 #define PR_SET_MM_START_BRK 6 #define PR_SET_MM_BRK 7 #define PR_SET_MM_ARG_START 8 #define PR_SET_MM_ARG_END 9 #define PR_SET_MM_ENV_START 10 #define PR_SET_MM_ENV_END 11 #define PR_SET_MM_AUXV 12 #define PR_SET_MM_EXE_FILE 13 #define PR_SET_MM_MAP 14 #define PR_SET_MM_MAP_SIZE 15 struct prctl_mm_map { uint64_t start_code; uint64_t end_code; uint64_t start_data; uint64_t end_data; uint64_t start_brk; uint64_t brk; uint64_t start_stack; uint64_t arg_start; uint64_t arg_end; uint64_t env_start; uint64_t env_end; uint64_t *auxv; uint32_t auxv_size; uint32_t exe_fd; }; #define PR_SET_PTRACER 0x59616d61 #define PR_SET_PTRACER_ANY (-1UL) #define PR_SET_CHILD_SUBREAPER 36 #define PR_GET_CHILD_SUBREAPER 37 #define PR_SET_NO_NEW_PRIVS 38 #define PR_GET_NO_NEW_PRIVS 39 #define PR_GET_TID_ADDRESS 40 #define PR_SET_THP_DISABLE 41 #define PR_GET_THP_DISABLE 42 #define PR_MPX_ENABLE_MANAGEMENT 43 #define PR_MPX_DISABLE_MANAGEMENT 44 #define PR_SET_FP_MODE 45 #define PR_GET_FP_MODE 46 #define PR_FP_MODE_FR (1 << 0) #define PR_FP_MODE_FRE (1 << 1) #define PR_CAP_AMBIENT 47 #define PR_CAP_AMBIENT_IS_SET 1 #define PR_CAP_AMBIENT_RAISE 2 #define PR_CAP_AMBIENT_LOWER 3 #define PR_CAP_AMBIENT_CLEAR_ALL 4 #define PR_SVE_SET_VL 50 #define PR_SVE_SET_VL_ONEXEC (1 << 18) #define PR_SVE_GET_VL 51 #define PR_SVE_VL_LEN_MASK 0xffff #define PR_SVE_VL_INHERIT (1 << 17) #define PR_GET_SPECULATION_CTRL 52 #define PR_SET_SPECULATION_CTRL 53 #define PR_SPEC_STORE_BYPASS 0 #define PR_SPEC_INDIRECT_BRANCH 1 #define PR_SPEC_NOT_AFFECTED 0 #define PR_SPEC_PRCTL (1UL << 0) #define PR_SPEC_ENABLE (1UL << 1) #define PR_SPEC_DISABLE (1UL << 2) #define PR_SPEC_FORCE_DISABLE (1UL << 3) #define PR_SPEC_DISABLE_NOEXEC (1UL << 4) #define PR_PAC_RESET_KEYS 54 #define PR_PAC_APIAKEY (1UL << 0) #define PR_PAC_APIBKEY (1UL << 1) #define PR_PAC_APDAKEY (1UL << 2) #define PR_PAC_APDBKEY (1UL << 3) #define PR_PAC_APGAKEY (1UL << 4) #define PR_SET_TAGGED_ADDR_CTRL 55 #define PR_GET_TAGGED_ADDR_CTRL 56 #define PR_TAGGED_ADDR_ENABLE (1UL << 0) int prctl (int, ...); #ifdef __cplusplus } #endif #endif
{ "pile_set_name": "Github" }
class:: BufAllpassL summary:: Buffer based all pass delay line with linear interpolation. related:: Classes/BufAllpassC, Classes/BufAllpassN, Classes/AllpassL categories:: UGens>Delays>Buffer Description:: All pass delay line with linear interpolation which uses a buffer for its internal memory. See also link::Classes/BufAllpassN:: which uses no interpolation, and which link::Classes/BufAllpassC:: uses cubic interpolation. Cubic interpolation is more computationally expensive than linear, but more accurate. classmethods:: method::ar argument::buf Buffer number. argument::in The input signal. argument::delaytime Delay time in seconds. argument::decaytime Time for the echoes to decay by 60 decibels. If this time is negative then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower. discussion:: warning:: For reasons of efficiency, the effective buffer size is limited to the previous power of two. So, if 44100 samples are allocated, the maximum delay would be 32768 samples. :: Examples:: code:: // allocate buffer b = Buffer.alloc(s,44100,1); // Since the allpass delay has no audible effect as a resonator on // steady state sound ... { BufAllpassC.ar(b.bufnum, WhiteNoise.ar(0.1), XLine.kr(0.0001, 0.01, 20), 0.2) }.play; // ...these examples add the input to the effected sound and compare variants so that you can hear // the effect of the phase comb: ( { z = WhiteNoise.ar(0.2); z + BufAllpassN.ar(b.bufnum, z, XLine.kr(0.0001, 0.01, 20), 0.2) }.play) ( { z = WhiteNoise.ar(0.2); z + BufAllpassL.ar(b.bufnum, z, XLine.kr(0.0001, 0.01, 20), 0.2) }.play) ( { z = WhiteNoise.ar(0.2); z + BufAllpassC.ar(b.bufnum, z, XLine.kr(0.0001, 0.01, 20), 0.2) }.play) // used as an echo - doesn't really sound different than Comb, // but it outputs the input signal immediately (inverted) and the echoes // are lower in amplitude. { BufAllpassL.ar(b.bufnum, Decay.ar(Dust.ar(1,0.5), 0.2, WhiteNoise.ar), 0.2, 3) }.play; ::
{ "pile_set_name": "Github" }
/* * make KOI8->ISO8859-5 and ISO8859-5->KOI8 translation table * from koi-iso.tab. * * Tatsuo Ishii * * src/backend/utils/mb/iso.c */ #include <stdio.h> main() { int i; char koitab[128], isotab[128]; char buf[4096]; int koi, iso; for (i = 0; i < 128; i++) koitab[i] = isotab[i] = 0; while (fgets(buf, sizeof(buf), stdin) != NULL) { if (*buf == '#') continue; sscanf(buf, "%d %x", &koi, &iso); if (koi < 128 || koi > 255 || iso < 128 || iso > 255) { fprintf(stderr, "invalid value %d\n", koi); exit(1); } koitab[koi - 128] = iso; isotab[iso - 128] = koi; } i = 0; printf("static char koi2iso[] = {\n"); while (i < 128) { int j = 0; while (j < 8) { printf("0x%02x", koitab[i++]); j++; if (i >= 128) break; printf(", "); } printf("\n"); } printf("};\n"); i = 0; printf("static char iso2koi[] = {\n"); while (i < 128) { int j = 0; while (j < 8) { printf("0x%02x", isotab[i++]); j++; if (i >= 128) break; printf(", "); } printf("\n"); } printf("};\n"); }
{ "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><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.13"/> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="enums_8.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
{ "pile_set_name": "Github" }
/* 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/. */ #include "mpi.h" #define CHECK_SEC_OK(func) \ if (SECSuccess != (rv = func)) \ goto cleanup #define CHECK_MPI_OK(func) \ if (MP_OKAY > (err = func)) \ goto cleanup #define OCTETS_TO_MPINT(oc, mp, len) \ CHECK_MPI_OK(mp_read_unsigned_octets((mp), oc, len)) #define SECITEM_TO_MPINT(it, mp) \ CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len)) #define MPINT_TO_SECITEM(mp, it, arena) \ do { \ int mpintLen = mp_unsigned_octet_size(mp); \ if (mpintLen <= 0) { \ err = MP_RANGE; \ goto cleanup; \ } \ SECITEM_AllocItem(arena, (it), mpintLen); \ if ((it)->data == NULL) { \ err = MP_MEM; \ goto cleanup; \ } \ err = mp_to_unsigned_octets(mp, (it)->data, (it)->len); \ if (err < 0) \ goto cleanup; \ else \ err = MP_OKAY; \ } while (0) #define MP_TO_SEC_ERROR(err) \ switch (err) { \ case MP_MEM: \ PORT_SetError(SEC_ERROR_NO_MEMORY); \ break; \ case MP_RANGE: \ PORT_SetError(SEC_ERROR_BAD_DATA); \ break; \ case MP_BADARG: \ PORT_SetError(SEC_ERROR_INVALID_ARGS); \ break; \ default: \ PORT_SetError(SEC_ERROR_LIBRARY_FAILURE); \ break; \ }
{ "pile_set_name": "Github" }
/* * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.ide.util.gotoByName; import com.intellij.psi.PsiElement; import com.intellij.util.Processor; import com.intellij.util.indexing.FindSymbolParameters; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public interface ChooseByNameModelEx extends ChooseByNameModel { /** @deprecated use {@link #processNames(Processor, FindSymbolParameters)} instead */ @Deprecated default void processNames(@NotNull Processor<? super String> processor, @NotNull boolean inLibraries) { } default void processNames(@NotNull Processor<? super String> processor, @NotNull FindSymbolParameters parameters) { processNames(processor, parameters.isSearchInLibraries()); } @NotNull default ChooseByNameItemProvider getItemProvider(@Nullable PsiElement context) { return new DefaultChooseByNameItemProvider(context); } @NotNull static ChooseByNameItemProvider getItemProvider(@NotNull ChooseByNameModel model, @Nullable PsiElement context) { return model instanceof ChooseByNameModelEx ? ((ChooseByNameModelEx)model).getItemProvider(context) : new DefaultChooseByNameItemProvider(context); } }
{ "pile_set_name": "Github" }
running 84 tests test dense::ac_one_byte ... bench: 349 ns/iter (+/- 4) = 28653 MB/s test dense::ac_one_prefix_byte_every_match ... bench: 112,957 ns/iter (+/- 1,490) = 88 MB/s test result: ok. 0 passed; 0 failed; 0 ignored; 2 measured
{ "pile_set_name": "Github" }
using CommandDotNet.Builders; namespace CommandDotNet.Execution { /// <summary> /// Specifies whether <see cref="IDependencyResolver.Resolve"/> or <see cref="IDependencyResolver.TryResolve"/> is used. /// When Resolve is used, if the the Resolve method returns null instead of throwing an exception, /// the framework will attempt to instantiate an instance of the type. /// </summary> public enum ResolveStrategy { /// <summary>Call resolve on container.</summary> Resolve, /// <summary>Call resolve on container. If the container returns null, throw an</summary> ResolveOrThrow, TryResolve } }
{ "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 array import ( "sync/atomic" "github.com/apache/arrow/go/arrow/bitutil" "github.com/apache/arrow/go/arrow/internal/debug" "github.com/apache/arrow/go/arrow/memory" ) // A bufferBuilder provides common functionality for populating memory with a sequence of type-specific values. // Specialized implementations provide type-safe APIs for appending and accessing the memory. type bufferBuilder struct { refCount int64 mem memory.Allocator buffer *memory.Buffer length int capacity int bytes []byte } // Retain increases the reference count by 1. // Retain may be called simultaneously from multiple goroutines. func (b *bufferBuilder) Retain() { atomic.AddInt64(&b.refCount, 1) } // Release decreases the reference count by 1. // When the reference count goes to zero, the memory is freed. // Release may be called simultaneously from multiple goroutines. func (b *bufferBuilder) Release() { debug.Assert(atomic.LoadInt64(&b.refCount) > 0, "too many releases") if atomic.AddInt64(&b.refCount, -1) == 0 { if b.buffer != nil { b.buffer.Release() b.buffer, b.bytes = nil, nil } } } // Len returns the length of the memory buffer in bytes. func (b *bufferBuilder) Len() int { return b.length } // Cap returns the total number of bytes that can be stored without allocating additional memory. func (b *bufferBuilder) Cap() int { return b.capacity } // Bytes returns a slice of length b.Len(). // The slice is only valid for use until the next buffer modification. That is, until the next call // to Advance, Reset, Finish or any Append function. The slice aliases the buffer content at least until the next // buffer modification. func (b *bufferBuilder) Bytes() []byte { return b.bytes[:b.length] } func (b *bufferBuilder) resize(elements int) { if b.buffer == nil { b.buffer = memory.NewResizableBuffer(b.mem) } b.buffer.Resize(elements) oldCapacity := b.capacity b.capacity = b.buffer.Cap() b.bytes = b.buffer.Buf() if b.capacity > oldCapacity { memory.Set(b.bytes[oldCapacity:], 0) } } // Advance increases the buffer by length and initializes the skipped bytes to zero. func (b *bufferBuilder) Advance(length int) { if b.capacity < b.length+length { newCapacity := bitutil.NextPowerOf2(b.length + length) b.resize(newCapacity) } b.length += length } // Append appends the contents of v to the buffer, resizing it if necessary. func (b *bufferBuilder) Append(v []byte) { if b.capacity < b.length+len(v) { newCapacity := bitutil.NextPowerOf2(b.length + len(v)) b.resize(newCapacity) } b.unsafeAppend(v) } // Reset returns the buffer to an empty state. Reset releases the memory and sets the length and capacity to zero. func (b *bufferBuilder) Reset() { if b.buffer != nil { b.buffer.Release() } b.buffer, b.bytes = nil, nil b.capacity, b.length = 0, 0 } // Finish TODO(sgc) func (b *bufferBuilder) Finish() (buffer *memory.Buffer) { if b.length > 0 { b.buffer.ResizeNoShrink(b.length) } buffer = b.buffer b.buffer = nil b.Reset() return } func (b *bufferBuilder) unsafeAppend(data []byte) { copy(b.bytes[b.length:], data) b.length += len(data) }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at * http://www.eclipse.org/legal/epl-2.0. * * This Source Code may also be made available under the following Secondary * Licenses when the conditions for such availability set forth in the * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, * version 2 with the GNU Classpath Exception, which is available at * https://www.gnu.org/software/classpath/license.html. * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ package org.glassfish.loadbalancer.admin.cli; import java.util.logging.Logger; import java.util.Map; import java.util.Iterator; import java.beans.PropertyVetoException; import org.jvnet.hk2.annotations.*; import org.jvnet.hk2.component.*; import org.jvnet.hk2.config.*; import org.glassfish.api.Param; import org.glassfish.api.I18n; import org.glassfish.api.ActionReport; import com.sun.enterprise.util.LocalStringManagerImpl; import com.sun.enterprise.config.serverbeans.Server; import com.sun.enterprise.config.serverbeans.Cluster; import org.glassfish.api.admin.*; import org.glassfish.hk2.api.PerLookup; /** * This is a remote command that enables lb-enabled attribute of an application * for cluster or instance * @author Yamini K B */ @Service(name = "configure-lb-weight") @PerLookup @I18n("configure.lb.weight") @org.glassfish.api.admin.ExecuteOn(RuntimeType.DAS) @RestEndpoints({ @RestEndpoint(configBean=Cluster.class, opType=RestEndpoint.OpType.POST, path="configure-lb-weight", description="Configure LB Weight", params={ @RestParam(name="target", value="$parent") }), @RestEndpoint(configBean=Server.class, opType=RestEndpoint.OpType.POST, path="configure-lb-weight", description="Configure LB Weight", params={ @RestParam(name="target", value="$parent") }) }) public final class ConfigureLBWeightCommand extends LBCommandsBase implements AdminCommand { @Param(optional=false) String cluster; @Param(primary=true) String weights; final private static LocalStringManagerImpl localStrings = new LocalStringManagerImpl(ConfigureLBWeightCommand.class); @Override public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); final Logger logger = context.getLogger(); report.setActionExitCode(ActionReport.ExitCode.SUCCESS); Map<String,Integer> instanceWeights = null; try { instanceWeights = getInstanceWeightsMap(weights); } catch (CommandException ce) { report.setMessage(localStrings.getLocalString("InvalidWeightValue", "Invalid weight value")); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(ce); return; } Cluster cl = domain.getClusterNamed(cluster); if ( cl == null){ String msg = localStrings.getLocalString("NoSuchCluster", "No such cluster {0}", cluster); logger.warning(msg); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setMessage(msg); return; } for (Iterator it = instanceWeights.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); String instance = (String)entry.getKey(); try { Server s = domain.getServerNamed(instance); if (s == null) { String msg = localStrings.getLocalString("NoSuchInstance", "No such instance {0}", instance); logger.warning(msg); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setMessage(msg); return; } Cluster c = domain.getClusterForInstance(s.getName()); if (c == null) { String msg = localStrings.getLocalString("InstanceDoesNotBelongToCluster", "Instance {0} does not belong to cluster {1}.", instance,cluster); logger.warning(msg); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setMessage(msg); return; } if (!c.getName().equals(cluster)) { String msg = localStrings.getLocalString("InstanceDoesNotBelongToCluster", "Instance {0} does not belong to cluster {1}.", instance,cluster); logger.warning(msg); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setMessage(msg); return; } updateLBWeight(s, entry.getValue().toString()); } catch (TransactionFailure ex) { report.setMessage(ex.getMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE); report.setFailureCause(ex); return; } } } private void updateLBWeight(final Server s, final String w) throws TransactionFailure { ConfigSupport.apply(new SingleConfigCode<Server>() { @Override public Object run(Server param) throws PropertyVetoException, TransactionFailure { param.setLbWeight(w); return Boolean.TRUE; } }, s); } }
{ "pile_set_name": "Github" }
package org.zalando.opentracing.spring.web.extension; import io.opentracing.contrib.spring.web.interceptor.HandlerInterceptorSpanDecorator; import org.apiguardian.api.API; import java.util.ServiceLoader; import static java.util.ServiceLoader.load; import static org.apiguardian.api.API.Status.EXPERIMENTAL; import static org.zalando.opentracing.spring.web.extension.CompositeSpanDecorator.composite; /** * @see ServiceLoader */ @API(status = EXPERIMENTAL) public final class ServiceLoaderSpanDecorator extends ForwardingSpanDecorator { public ServiceLoaderSpanDecorator() { super(composite(load(HandlerInterceptorSpanDecorator.class))); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright 2019, The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="com.example.android.navigationadvancedsample.MainActivity"> <androidx.fragment.app.FragmentContainerView android:id="@+id/nav_host_container" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" /> <com.google.android.material.bottomnavigation.BottomNavigationView android:id="@+id/bottom_nav" android:layout_width="match_parent" android:layout_height="wrap_content" app:menu="@menu/bottom_nav"/> </LinearLayout>
{ "pile_set_name": "Github" }
div.dataTables_length label { font-weight: normal; text-align: left; white-space: nowrap; } div.dataTables_length select { width: 75px; display: inline-block; } div.dataTables_filter { text-align: right; } div.dataTables_filter label { font-weight: normal; white-space: nowrap; text-align: left; } div.dataTables_filter input { margin-left: 0.5em; display: inline-block; } div.dataTables_info { padding-top: 8px; white-space: nowrap; } div.dataTables_paginate { margin: 0; white-space: nowrap; text-align: right; } div.dataTables_paginate ul.pagination { margin: 2px 0; white-space: nowrap; } @media screen and (max-width: 767px) { div.dataTables_length, div.dataTables_filter, div.dataTables_info, div.dataTables_paginate { text-align: center; } } table.dataTable td, table.dataTable th { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; } table.dataTable { clear: both; margin-top: 6px !important; margin-bottom: 6px !important; max-width: none !important; } table.dataTable thead .sorting, table.dataTable thead .sorting_asc, table.dataTable thead .sorting_desc, table.dataTable thead .sorting_asc_disabled, table.dataTable thead .sorting_desc_disabled { cursor: pointer; } table.dataTable thead .sorting { background: url('../images/sort_both.png') no-repeat center right; } table.dataTable thead .sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; } table.dataTable thead .sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; } table.dataTable thead .sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; } table.dataTable thead .sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; } table.dataTable thead > tr > th { padding-left: 18px; padding-right: 18px; } table.dataTable th:active { outline: none; } /* Scrolling */ div.dataTables_scrollHead table { margin-bottom: 0 !important; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } div.dataTables_scrollHead table thead tr:last-child th:first-child, div.dataTables_scrollHead table thead tr:last-child td:first-child { border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important; } div.dataTables_scrollBody table { border-top: none; margin-top: 0 !important; margin-bottom: 0 !important; } div.dataTables_scrollBody tbody tr:first-child th, div.dataTables_scrollBody tbody tr:first-child td { border-top: none; } div.dataTables_scrollFoot table { margin-top: 0 !important; border-top: none; } /* Frustratingly the border-collapse:collapse used by Bootstrap makes the column width calculations when using scrolling impossible to align columns. We have to use separate */ table.table-bordered.dataTable { border-collapse: separate !important; } table.table-bordered thead th, table.table-bordered thead td { border-left-width: 0; border-top-width: 0; } table.table-bordered tbody th, table.table-bordered tbody td { border-left-width: 0; border-bottom-width: 0; } table.table-bordered th:last-child, table.table-bordered td:last-child { border-right-width: 0; } div.dataTables_scrollHead table.table-bordered { border-bottom-width: 0; } /* * TableTools styles */ .table.dataTable tbody tr.active td, .table.dataTable tbody tr.active th { background-color: #08C; color: white; } .table.dataTable tbody tr.active:hover td, .table.dataTable tbody tr.active:hover th { background-color: #0075b0 !important; } .table.dataTable tbody tr.active th > a, .table.dataTable tbody tr.active td > a { color: white; } .table-striped.dataTable tbody tr.active:nth-child(odd) td, .table-striped.dataTable tbody tr.active:nth-child(odd) th { background-color: #017ebc; } table.DTTT_selectable tbody tr { cursor: pointer; } div.DTTT .btn:hover { text-decoration: none !important; } ul.DTTT_dropdown.dropdown-menu { z-index: 2003; } ul.DTTT_dropdown.dropdown-menu a { color: #333 !important; /* needed only when demo_page.css is included */ } ul.DTTT_dropdown.dropdown-menu li { position: relative; } ul.DTTT_dropdown.dropdown-menu li:hover a { background-color: #0088cc; color: white !important; } div.DTTT_collection_background { z-index: 2002; } /* TableTools information display */ div.DTTT_print_info { position: fixed; top: 50%; left: 50%; width: 400px; height: 150px; margin-left: -200px; margin-top: -75px; text-align: center; color: #333; padding: 10px 30px; opacity: 0.95; background-color: white; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5); box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5); } div.DTTT_print_info h6 { font-weight: normal; font-size: 28px; line-height: 28px; margin: 1em; } div.DTTT_print_info p { font-size: 14px; line-height: 20px; } div.dataTables_processing { position: absolute; top: 50%; left: 50%; width: 100%; height: 60px; margin-left: -50%; margin-top: -25px; padding-top: 20px; padding-bottom: 20px; text-align: center; font-size: 1.2em; background-color: white; background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0))); background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%); background: -moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%); background: -ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%); background: -o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%); background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%); } /* * FixedColumns styles */ div.DTFC_LeftHeadWrapper table, div.DTFC_LeftFootWrapper table, div.DTFC_RightHeadWrapper table, div.DTFC_RightFootWrapper table, table.DTFC_Cloned tr.even { background-color: white; margin-bottom: 0; } div.DTFC_RightHeadWrapper table , div.DTFC_LeftHeadWrapper table { border-bottom: none !important; margin-bottom: 0 !important; border-top-right-radius: 0 !important; border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important; } div.DTFC_RightHeadWrapper table thead tr:last-child th:first-child, div.DTFC_RightHeadWrapper table thead tr:last-child td:first-child, div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child, div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child { border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important; } div.DTFC_RightBodyWrapper table, div.DTFC_LeftBodyWrapper table { border-top: none; margin: 0 !important; } div.DTFC_RightBodyWrapper tbody tr:first-child th, div.DTFC_RightBodyWrapper tbody tr:first-child td, div.DTFC_LeftBodyWrapper tbody tr:first-child th, div.DTFC_LeftBodyWrapper tbody tr:first-child td { border-top: none; } div.DTFC_RightFootWrapper table, div.DTFC_LeftFootWrapper table { border-top: none; margin-top: 0 !important; } /* * FixedHeader styles */ div.FixedHeader_Cloned table { margin: 0 !important }
{ "pile_set_name": "Github" }
## DESCRIPTION ## Calculus: The Fundamental Theorem of Calculus ## ENDDESCRIPTION ## DBsubject(Calculus - single variable) ## DBchapter(Integrals) ## DBsection(Fundamental theorem of calculus) ## Date(6/2/2005) ## Institution(UVA) ## Author(Jeff Holt) ## MLT(FTC_01) ## Level(3) ## TitleText1('Calculus: Early Transcendentals') ## AuthorText1('Stewart') ## EditionText1('5') ## Section1('5.3') ## Problem1('49') ## TitleText2('Calculus: Early Transcendentals') ## AuthorText2('Stewart') ## EditionText2('6') ## Section2('5.3') ## Problem2('') ## KEYWORDS('calculus', 'integrals', 'fundamental theorem of calculus') DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGstandard.pl", "PGcourse.pl", "MathObjects.pl", "AnswerFormatHelp.pl" ); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; Context("Numeric"); $halfp1 = random(1,4,1); $p1 = 2*$halfp1; $halfp2 = random(1,3,1); $p2 = 2*$halfp2; BEGIN_TEXT Find the derivative of the function: \[ y = \int_{\sqrt{x}}^{x^$p1} {\sqrt{t} \sin t^{$p2}} dt \] $BR \( \displaystyle{\frac{dy}{dx}} \) = \{ans_rule(80)\} $BR ${BBOLD}NOTE:$EBOLD Enter a function as your answer. \{AnswerFormatHelp("formulas")\} END_TEXT $p1p2 = $p1*$p2; $p11 = $p1-1; $exp1 = $halfp1+$p1-1; $f = Compute("$p1*x^$exp1*sin(x^($p1p2))-sin(x^($halfp2))/(2*x^(1/4))"); $f->{limits}=[0,2]; #@ans=(fun_cmp("$p1*x**($p1-1)*x**($p1/2)*sin(x**($p1*$p2))-1/2*x**(-.25)*sin(x**($p2/2))", vars=>"x")); ANS($f->cmp()); ENDDOCUMENT(); # This should be the last executable line in the problem.
{ "pile_set_name": "Github" }
Path = require 'path' Codo = require './codo' Optimist = require 'optimist' Theme = require '../themes/default/lib/theme' Table = require 'cli-table' colors = require 'colors/safe' module.exports = class Command options: [ {name: 'help', alias: 'h', describe: 'Show this help'} {name: 'version', describe: 'Show version'} {name: 'extension', alias: 'x', describe: 'Coffee files extension', default: 'coffee'} {name: 'output', alias: 'o', describe: 'The output directory', default: './doc'} {name: 'min-coverage', alias: 'm', describe: 'Require a minimum percentage to be documented or fail', default: '0'} {name: 'output-dir'} {name: 'theme', describe: 'The theme to be used', default: 'default'} {name: 'name', alias: 'n', describe: 'The project name used'} {name: 'readme', alias: 'r', describe: 'The readme file used'} {name: 'quiet', alias: 'q', describe: 'Supress warnings', boolean: true, default: false} {name: 'verbose', alias: 'v', describe: 'Show parsing errors', boolean: true, default: false} {name: 'undocumented', alias: 'u', describe: 'List undocumented objects', boolean: true, default: false} {name: 'closure', describe: 'Try to parse closure-like block comments', boolean: true, default: false} {name: 'debug', alias: 'd', boolean: true} ] @run: -> new @().run (code) -> process.exit code extendOptimist: (optimist, defaults={}, options={}) -> for option in options optimist.options option.name, alias: option.alias, describe: option.describe, boolean: option.boolean, default: defaults[option.name] || defaults[option.alias] || option.default lookupTheme: (name) -> if name == 'default' @theme = Theme else try @theme = require "codo-theme-#{name}" catch try @theme = require Path.resolve("node_modules/codo-theme-#{name}") catch console.log "Error loading theme #{name}: are you sure you have codo-theme-#{name} package installed?" process.exit() prepareOptions: (optimist, defaults) -> options = optimist.argv options._.push entry for entry in defaults._ keyword = 'inputs' for entry in options._ if entry == '-' keyword = 'extras' else options[keyword] ?= [] options[keyword].push entry delete options._ options run: (cb) -> defaults = Codo.detectDefaults(process.cwd()) optimist = Optimist.usage('Usage: $0 [options] [source_files [- extra_files]]') @extendOptimist(optimist, defaults, @options) @theme = @lookupTheme(optimist.argv.theme) @extendOptimist(optimist, defaults, @theme::options) @options = @prepareOptions(optimist, defaults) if @options['output-dir'] console.log "The usage of outdated `--output-dir` option detected. Please switch to `--output`." process.exit() if @options.help console.log optimist.help() else if @options.version console.log Codo.version() else @generate(process.cwd(), @options, cb) collectStats: (environment) -> sections = Classes: total: environment.allClasses().length undocumented: environment.allClasses().filter((e) -> !e.documentation?).map (x) -> [x.name, x.file.path] Mixins: total: environment.allMixins().length undocumented: environment.allMixins().filter((e) -> !e.documentation?).map (x) -> [x.name, x.file.path] Methods: total: environment.allMethods().length undocumented: environment.allMethods().filter((e) -> !e.entity.documentation?).map (x) -> ["#{x.entity.name} (#{x.owner.name})", x.owner.file.path] sections generate: (dir = process.cwd(), options = @options, cb) -> for option in @options if option.default? options[option.name] ?= option.default @theme ?= @lookupTheme(options.theme) for option in @theme::options if option.default? options[option.name] ?= option.default environment = Codo.parseProject(dir, options) sections = @collectStats(environment) unless options.test @theme.compile(environment) overall = 0 undocumented = 0 for section, data of sections overall += data.total undocumented += data.undocumented.length if options.undocumented for section, data of sections when data.undocumented.length != 0 table = new Table head: [section, 'Path'] table.push(entry) for entry in data.undocumented unless options.test console.log table.toString() console.log '' else table = new Table head: ['', 'Total', 'Undocumented'] undocumented_percent = 100/overall*undocumented || 0 table.push( ['Files', environment.allFiles().length, ''], ['Extras', environment.allExtras().length, ''], ['Classes', sections['Classes'].total, sections['Classes'].undocumented.length], ['Mixins', sections['Mixins'].total, sections['Mixins'].undocumented.length], ['Methods', sections['Methods'].total, sections['Methods'].undocumented.length] ) unless options.test console.log table.toString() console.log '' console.log " Totally documented: #{(100 - undocumented_percent).toFixed(2)}%" console.log '' documentedRatio = 100 - (100*undocumented/overall).toFixed(2) if documentedRatio < options["min-coverage"] unless options.test console.error colors.red(" Expected " + options["min-coverage"] + "% to be documented, but only " + documentedRatio + "% were.") cb 1 if cb else cb() if cb
{ "pile_set_name": "Github" }
#tb 0: 1/1000 0, 0, 0, 0, 152064, b208eac12f0ae74a812bc9e314bdfac7 0, 33, 33, 0, 152064, ebb2259451c3acf3ad6379d1f4092efb 0, 66, 66, 0, 152064, 33de46060afd14aa359b7bd0d9ff1be8 0, 100, 100, 0, 152064, 33de46060afd14aa359b7bd0d9ff1be8 0, 133, 133, 0, 152064, 5d087d8df10fd406d59172710ea0341a 0, 166, 166, 0, 152064, 3570ed7fb90ac9b5335b97adf0539e94 0, 200, 200, 0, 152064, 68a8c56b889a3befc75c9ec4293c7fda 0, 233, 233, 0, 152064, f871f7c0456f644cfb0ec896132a097f 0, 266, 266, 0, 152064, 14e939bfeb2b878e0782a7ce68ecd214 0, 300, 300, 0, 152064, bd3e97881ebece0f876d46d067c6a7ff 0, 333, 333, 0, 152064, a20529c091ef3e68a901c574371224b3 0, 367, 367, 0, 152064, 5253f16c8b0329d33d38d275124487fb 0, 400, 400, 0, 152064, c9c2f7d8835e620709a53ff8adfe72bf 0, 433, 433, 0, 152064, dc8f1df0d7ab8e4f9daf2ccfd96de855 0, 467, 467, 0, 152064, d09d43208d4de7f81d54f48cff310b6f 0, 500, 500, 0, 152064, 0dcf7212075c1f15219690ad6ffe2940 0, 533, 533, 0, 152064, 3b52e3eb4f972318c6912dd29a95dcf3 0, 567, 567, 0, 152064, aa1414343067749fbd743ace93553492 0, 600, 600, 0, 152064, 6951cb7a78e0a03f9a3f6264084de6dc 0, 633, 633, 0, 152064, 5324f2f03c4d5fe35446561af654e9ec 0, 667, 667, 0, 152064, dff11b046a02ca34c6b1aecc857632ec 0, 700, 700, 0, 152064, 971182c013c1524d4864fd946b8c1550 0, 734, 734, 0, 152064, 3306f1dcd5760ba92dd9cec8bfc21b08 0, 767, 767, 0, 152064, f1f7b13c33332fece576b4d175f91832 0, 800, 800, 0, 152064, 9e66573fbfe847149eb32e8a9c242c18
{ "pile_set_name": "Github" }
#pragma checksum "..\..\..\App\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1451C7875825CA795D3191A35A338686EB96E950A97F0CC6C75168994A5DC628" //------------------------------------------------------------------------------ // <auto-generated> // 此代码由工具生成。 // 运行时版本:4.0.30319.42000 // // 对此文件的更改可能会导致不正确的行为,并且如果 // 重新生成代码,这些更改将会丢失。 // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Diagnostics; using System.Windows; using System.Windows.Automation; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Markup; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Effects; using System.Windows.Media.Imaging; using System.Windows.Media.Media3D; using System.Windows.Media.TextFormatting; using System.Windows.Navigation; using System.Windows.Shapes; using System.Windows.Shell; using WpfApp1; namespace WpfApp1 { /// <summary> /// App /// </summary> public partial class App : System.Windows.Application, System.Windows.Markup.IComponentConnector { private bool _contentLoaded; /// <summary> /// InitializeComponent /// </summary> [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] public void InitializeComponent() { #line 5 "..\..\..\App\App.xaml" this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(this.Application_DispatcherUnhandledException); #line default #line hidden #line 5 "..\..\..\App\App.xaml" this.StartupUri = new System.Uri("AppWindow.xaml", System.UriKind.Relative); #line default #line hidden if (_contentLoaded) { return; } _contentLoaded = true; System.Uri resourceLocater = new System.Uri("/QTests;component/app/app.xaml", System.UriKind.Relative); #line 1 "..\..\..\App\App.xaml" System.Windows.Application.LoadComponent(this, resourceLocater); #line default #line hidden } [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { this._contentLoaded = true; } } }
{ "pile_set_name": "Github" }
From 575ef199984ae4e8510ed36f8b1ae1babdff8ea9 Mon Sep 17 00:00:00 2001 From: James Hilliard <james.hilliard1@gmail.com> Date: Thu, 26 Mar 2020 07:48:19 -0600 Subject: [PATCH] fdo: ensure xkb_data.state is not null before calling xkb_state_key_get_one_sym (#192) [james.hilliard1@gmail.com: backport from upstream commit 575ef199984ae4e8510ed36f8b1ae1babdff8ea9] Signed-off-by: James Hilliard <james.hilliard1@gmail.com> --- platform/cog-platform-fdo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/cog-platform-fdo.c b/platform/cog-platform-fdo.c index 043f91d..93ff255 100644 --- a/platform/cog-platform-fdo.c +++ b/platform/cog-platform-fdo.c @@ -919,6 +919,9 @@ capture_app_key_bindings (uint32_t keysym, static void handle_key_event (uint32_t key, uint32_t state, uint32_t time) { + if (xkb_data.state == NULL) + return; + uint32_t keysym = xkb_state_key_get_one_sym (xkb_data.state, key); uint32_t unicode = xkb_state_key_get_utf32 (xkb_data.state, key); -- 2.20.1
{ "pile_set_name": "Github" }
use Toolshed
{ "pile_set_name": "Github" }
/* * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.actuate.context; import java.net.URL; import java.net.URLClassLoader; import java.util.Map; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.Test; import org.springframework.boot.WebApplicationType; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.context.ApplicationListener; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.event.ContextClosedEvent; import static org.assertj.core.api.Assertions.assertThat; /** * Tests for {@link ShutdownEndpoint}. * * @author Phillip Webb * @author Dave Syer * @author Andy Wilkinson */ class ShutdownEndpointTests { @Test void shutdown() { ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withUserConfiguration(EndpointConfig.class); contextRunner.run((context) -> { EndpointConfig config = context.getBean(EndpointConfig.class); ClassLoader previousTccl = Thread.currentThread().getContextClassLoader(); Map<String, String> result; Thread.currentThread().setContextClassLoader(new URLClassLoader(new URL[0], getClass().getClassLoader())); try { result = context.getBean(ShutdownEndpoint.class).shutdown(); } finally { Thread.currentThread().setContextClassLoader(previousTccl); } assertThat(result.get("message")).startsWith("Shutting down"); assertThat(((ConfigurableApplicationContext) context).isActive()).isTrue(); assertThat(config.latch.await(10, TimeUnit.SECONDS)).isTrue(); assertThat(config.threadContextClassLoader).isEqualTo(getClass().getClassLoader()); }); } @Test void shutdownChild() throws Exception { ConfigurableApplicationContext context = new SpringApplicationBuilder(EmptyConfig.class) .child(EndpointConfig.class).web(WebApplicationType.NONE).run(); CountDownLatch latch = context.getBean(EndpointConfig.class).latch; assertThat(context.getBean(ShutdownEndpoint.class).shutdown().get("message")).startsWith("Shutting down"); assertThat(context.isActive()).isTrue(); assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue(); } @Test void shutdownParent() throws Exception { ConfigurableApplicationContext context = new SpringApplicationBuilder(EndpointConfig.class) .child(EmptyConfig.class).web(WebApplicationType.NONE).run(); CountDownLatch parentLatch = context.getBean(EndpointConfig.class).latch; CountDownLatch childLatch = context.getBean(EmptyConfig.class).latch; assertThat(context.getBean(ShutdownEndpoint.class).shutdown().get("message")).startsWith("Shutting down"); assertThat(context.isActive()).isTrue(); assertThat(parentLatch.await(10, TimeUnit.SECONDS)).isTrue(); assertThat(childLatch.await(10, TimeUnit.SECONDS)).isTrue(); } @Configuration(proxyBeanMethods = false) static class EndpointConfig { private final CountDownLatch latch = new CountDownLatch(1); private volatile ClassLoader threadContextClassLoader; @Bean ShutdownEndpoint endpoint() { return new ShutdownEndpoint(); } @Bean ApplicationListener<ContextClosedEvent> listener() { return (event) -> { EndpointConfig.this.threadContextClassLoader = Thread.currentThread().getContextClassLoader(); EndpointConfig.this.latch.countDown(); }; } } @Configuration(proxyBeanMethods = false) static class EmptyConfig { private final CountDownLatch latch = new CountDownLatch(1); @Bean ApplicationListener<ContextClosedEvent> listener() { return (event) -> EmptyConfig.this.latch.countDown(); } } }
{ "pile_set_name": "Github" }
import { handleActions } from 'redux-actions' import objectAssign from 'UTILS/object-assign' import dateHelper from 'UTILS/date' import { DEFAULT_GITHUB_SECTIONS } from 'UTILS/constant/github' import { DEFAULT_RESUME_SECTIONS } from 'UTILS/constant/resume' const initialState = { loading: true, login: window.login, updateTime: null, refreshEnable: false, resumeInfo: { url: '', loading: true, useGithub: false, openShare: false, reminder: {}, disabled: true, simplifyUrl: true, githubSections: [], resumeSections: [], }, githubInfo: { url: '', loading: true, openShare: true, disabled: true } } const reducers = handleActions({ // github TOGGLE_SETTING_LOADING(state, action) { return ({ ...state, loading: action.payload }) }, SET_UPDATE_STATUS(state, action) { const { refreshEnable, lastUpdateTime, } = action.payload const updateTime = lastUpdateTime ? dateHelper.relative.secondsBefore(lastUpdateTime) : state.updateTime return ({ ...state, updateTime, refreshEnable, loading: false }) }, INITIAL_GITHUB_SHARE_INFO(state, action) { const { githubInfo } = state return ({ ...state, githubInfo: objectAssign({}, githubInfo, action.payload, { loading: false, disabled: false, }) }) }, // resume INITIAL_RESUME_SHARE_INFO(state, action) { const { resumeInfo = {} } = state const payload = action.payload || {} return ({ ...state, resumeInfo: objectAssign({}, resumeInfo, payload, { loading: false, disabled: false, githubSections: payload.githubSections || [...DEFAULT_GITHUB_SECTIONS], resumeSections: payload.resumeSections || [...DEFAULT_RESUME_SECTIONS] }), }) } }, initialState) export default reducers
{ "pile_set_name": "Github" }
/* Copyright (c) 2014 eBay Software Foundation Licensed under the MIT License */ #ifndef maxdnn_Random_h #define maxdnn_Random_h #include <cstdlib> namespace maxdnn { class Random { public: Random() { } Random(unsigned seed) { _seed = seed; } void setSeed(unsigned seed) { _seed = seed; } double uniform() { return rand_r(&_seed) / (RAND_MAX+1.); } double uniform(double min, double max) { return min + uniform()*(max - min); } private: unsigned _seed; }; } #endif
{ "pile_set_name": "Github" }
#ifndef D_ClassName_H #define D_ClassName_H /////////////////////////////////////////////////////////////////////////////// // // ClassName is responsible for ... // /////////////////////////////////////////////////////////////////////////////// typedef struct _ClassName ClassnamePiml; ClassName* ClassName_Create(void); void ClassName_Destroy(ClassName*); void ClassName_VirtualFunction_impl(ClassName*); #endif // D_ClassName_H
{ "pile_set_name": "Github" }
package util import ( "bytes" "encoding/xml" "fmt" "go/format" "io" "reflect" "regexp" "strings" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" ) // GoFmt returns the Go formated string of the input. // // Panics if the format fails. func GoFmt(buf string) string { formatted, err := format.Source([]byte(buf)) if err != nil { panic(fmt.Errorf("%s\nOriginal code:\n%s", err.Error(), buf)) } return string(formatted) } var reTrim = regexp.MustCompile(`\s{2,}`) // Trim removes all leading and trailing white space. // // All consecutive spaces will be reduced to a single space. func Trim(s string) string { return strings.TrimSpace(reTrim.ReplaceAllString(s, " ")) } // Capitalize capitalizes the first character of the string. func Capitalize(s string) string { if len(s) == 1 { return strings.ToUpper(s) } return strings.ToUpper(s[0:1]) + s[1:] } // SortXML sorts the reader's XML elements func SortXML(r io.Reader) string { var buf bytes.Buffer d := xml.NewDecoder(r) root, _ := xmlutil.XMLToStruct(d, nil) e := xml.NewEncoder(&buf) xmlutil.StructToXML(e, root, true) return buf.String() } // PrettyPrint generates a human readable representation of the value v. // All values of v are recursively found and pretty printed also. func PrettyPrint(v interface{}) string { value := reflect.ValueOf(v) switch value.Kind() { case reflect.Struct: str := fullName(value.Type()) + "{\n" for i := 0; i < value.NumField(); i++ { l := string(value.Type().Field(i).Name[0]) if strings.ToUpper(l) == l { str += value.Type().Field(i).Name + ": " str += PrettyPrint(value.Field(i).Interface()) str += ",\n" } } str += "}" return str case reflect.Map: str := "map[" + fullName(value.Type().Key()) + "]" + fullName(value.Type().Elem()) + "{\n" for _, k := range value.MapKeys() { str += "\"" + k.String() + "\": " str += PrettyPrint(value.MapIndex(k).Interface()) str += ",\n" } str += "}" return str case reflect.Ptr: if e := value.Elem(); e.IsValid() { return "&" + PrettyPrint(e.Interface()) } return "nil" case reflect.Slice: str := "[]" + fullName(value.Type().Elem()) + "{\n" for i := 0; i < value.Len(); i++ { str += PrettyPrint(value.Index(i).Interface()) str += ",\n" } str += "}" return str default: return fmt.Sprintf("%#v", v) } } func pkgName(t reflect.Type) string { pkg := t.PkgPath() c := strings.Split(pkg, "/") return c[len(c)-1] } func fullName(t reflect.Type) string { if pkg := pkgName(t); pkg != "" { return pkg + "." + t.Name() } return t.Name() }
{ "pile_set_name": "Github" }
<HTML><HEAD> <TITLE>Access Denied</TITLE> </HEAD><BODY> <H1>Access Denied</H1> You don't have permission to access "&#47;T&#47;16382&#47;154041&#47;000&#47;origin&#45;in&#46;united&#46;com&#47;web&#47;en&#45;US&#47;default&#46;aspx&#63;pos&#61;IN" on this server.<P> Reference&#32;&#35;18&#46;426cd417&#46;1507270884&#46;b086238 </BODY> </HTML>
{ "pile_set_name": "Github" }
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _from = require('babel-runtime/core-js/array/from'); var _from2 = _interopRequireDefault(_from); exports.default = patchParagraphElements; var _ParagraphNodeSpec = require('./ParagraphNodeSpec'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function patchParagraphElements(doc) { (0, _from2.default)(doc.querySelectorAll('p')).forEach(patchParagraphElement); } function patchParagraphElement(pElement) { var marginLeft = pElement.style.marginLeft; if (marginLeft) { var indent = (0, _ParagraphNodeSpec.convertMarginLeftToIndentValue)(marginLeft); if (indent) { pElement.setAttribute(_ParagraphNodeSpec.ATTRIBUTE_INDENT, String(indent)); } } }
{ "pile_set_name": "Github" }
#<<<<<<< master #这是一个实现打印"Hello world!"的实例 print('Hello world!') #======= print('Hello world') #>>>>>>> master print('如果出现这段文字代表打印成功!')
{ "pile_set_name": "Github" }
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. //! Utilities related to FFI bindings. #![stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")] pub use self::c_str::{CString, CStr, NulError, IntoStringError}; #[stable(feature = "cstr_from_bytes", since = "1.10.0")] pub use self::c_str::{FromBytesWithNulError}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::os_str::{OsString, OsStr}; mod c_str; mod os_str;
{ "pile_set_name": "Github" }
services: _defaults: public: true prestashop.adapter.module.self_configurator: class: PrestaShop\PrestaShop\Adapter\Module\Configuration\ModuleSelfConfigurator arguments: - "@prestashop.core.admin.module.repository" - "@prestashop.adapter.legacy.configuration" - "@doctrine.dbal.default_connection" - "@filesystem" # MODULE TAB MANAGEMENT prestashop.adapter.module.tab.register: class: PrestaShop\PrestaShop\Adapter\Module\Tab\ModuleTabRegister arguments: - "@prestashop.core.admin.tab.repository" - "@prestashop.core.admin.lang.repository" - "@logger" - "@translator" - "@filesystem" - "@=service('prestashop.adapter.legacy.context').getLanguages()" - "@routing.loader.yml" prestashop.adapter.module.tab.unregister: class: PrestaShop\PrestaShop\Adapter\Module\Tab\ModuleTabUnregister arguments: - "@prestashop.core.admin.tab.repository" - "@prestashop.core.admin.lang.repository" - "@logger" - "@translator" prestashop.adapter.module.tab.eventsubscriber: class: PrestaShop\PrestaShop\Adapter\Module\Tab\ModuleTabManagementSubscriber arguments: - "@prestashop.adapter.module.tab.register" - "@prestashop.adapter.module.tab.unregister" tags: - { name: kernel.event_subscriber } prestashop.module.manager: class: PrestaShop\PrestaShop\Core\Addon\Module\ModuleManager arguments: - "@prestashop.adapter.admin.data_provider.module" - "@prestashop.adapter.data_provider.module" - "@prestashop.core.module.updater" - "@prestashop.core.admin.module.repository" - "@prestashop.module.zip.manager" - "@translator" - "@event_dispatcher" - "@prestashop.adapter.cache.clearer.symfony_cache_clearer" prestashop.module.zip.manager: class: PrestaShop\PrestaShop\Adapter\Module\ModuleZipManager arguments: - "@filesystem" - "@translator" - "@event_dispatcher" prestashop.adapter.presenter.module: class: PrestaShop\PrestaShop\Adapter\Presenter\Module\ModulePresenter arguments: ["@=service('prestashop.adapter.legacy.context').getContext().currency", "@prestashop.adapter.formatter.price"] prestashop.adapter.module.data_provider.tab_module_list: class: PrestaShop\PrestaShop\Adapter\Module\TabModuleListProvider prestashop.adapter.module.presenter.payment: class: PrestaShop\PrestaShop\Adapter\Module\Presenter\PaymentModulesPresenter arguments: - '@prestashop.adapter.module.data_provider.tab_module_list' - '@prestashop.adapter.data_provider.module' - '@prestashop.adapter.presenter.module' - '@prestashop.core.admin.module.repository' prestashop.adapter.module.payment_module_provider: class: PrestaShop\PrestaShop\Adapter\Module\PaymentModuleListProvider arguments: - '@prestashop.core.admin.module.repository' - '@prestashop.bundle.repository.module' - '@=service("prestashop.adapter.legacy.context").getContext().shop.id' prestashop.adapter.legacy.module: class: PrestaShop\PrestaShop\Adapter\Module\Module
{ "pile_set_name": "Github" }
/** * */ package org.hamster.weixinmp.gson; import java.lang.reflect.Type; import org.hamster.weixinmp.constant.WxMenuBtnTypeEnum; import org.hamster.weixinmp.dao.entity.menu.WxMenuBtnEntity; import org.springframework.util.CollectionUtils; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; /** * @author grossopaforever@gmail.com * @version Jan 4, 2014 * */ public class WxMenuBtnSerializer implements JsonSerializer<WxMenuBtnEntity> { /* * (non-Javadoc) * * @see com.google.gson.JsonSerializer#serialize(java.lang.Object, * java.lang.reflect.Type, com.google.gson.JsonSerializationContext) */ public JsonElement serialize(WxMenuBtnEntity src, Type typeOfSrc, JsonSerializationContext context) { return recursiveParse(src); } public JsonObject recursiveParse(WxMenuBtnEntity parentEntity) { JsonObject parent = new JsonObject(); parent.addProperty("type", parentEntity.getType()); parent.addProperty("name", parentEntity.getName()); WxMenuBtnTypeEnum type = WxMenuBtnTypeEnum.valueOf(parentEntity .getType()); switch (type) { case CLICK: parent.addProperty("key", parentEntity.getKey()); break; case VIEW: parent.addProperty("url", parentEntity.getUrl()); break; default: break; } if (!CollectionUtils.isEmpty(parentEntity.getSubButtons())) { JsonArray children = new JsonArray(); for (WxMenuBtnEntity child : parentEntity.getSubButtons()) { children.add(recursiveParse(child)); } parent.add("sub_button", children); } return parent; } }
{ "pile_set_name": "Github" }
// Copyright (c) 2011 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. // // This file's dependencies should be kept to a minimum so that it can be // included in WebKit code that doesn't rely on much of common. #ifndef NET_URL_REQUEST_URL_REQUEST_STATUS_H_ #define NET_URL_REQUEST_URL_REQUEST_STATUS_H_ #pragma once namespace net { // Represents the result of a URL request. It encodes errors and various // types of success. class URLRequestStatus { public: enum Status { // Request succeeded, |error_| will be 0. SUCCESS = 0, // An IO request is pending, and the caller will be informed when it is // completed. IO_PENDING, // Request was successful but was handled by an external program, so there // is no response data. This usually means the current page should not be // navigated, but no error should be displayed. |error_| will be 0. HANDLED_EXTERNALLY, // Request was cancelled programatically. CANCELED, // The request failed for some reason. |error_| may have more information. FAILED, }; URLRequestStatus() : status_(SUCCESS), error_(0) {} URLRequestStatus(Status s, int e) : status_(s), error_(e) {} Status status() const { return status_; } void set_status(Status s) { status_ = s; } int error() const { return error_; } void set_error(int e) { error_ = e; } // Returns true if the status is success, which makes some calling code more // convenient because this is the most common test. Note that we do NOT treat // HANDLED_EXTERNALLY as success. For everything except user notifications, // this value should be handled like an error (processing should stop). bool is_success() const { return status_ == SUCCESS || status_ == IO_PENDING; } // Returns true if the request is waiting for IO. bool is_io_pending() const { return status_ == IO_PENDING; } private: // Application level status. Status status_; // Error code from the network layer if an error was encountered. int error_; }; } // namespace net #endif // NET_URL_REQUEST_URL_REQUEST_STATUS_H_
{ "pile_set_name": "Github" }
export default { data: () => ({ id: '' }), async created () { await this.$store.dispatch('getProductsByUser', this.user) }, computed: { fields: { get () { return { title: { label: this.t('productsget.mixin.field.first') }, description: { label: this.t('productsget.mixin.field.second') }, price: { label: this.t('productsget.mixin.field.third') }, actions: { label: this.t('productsget.mixin.field.fourth') } } } }, products: { get () { return this.$store.state.Products.products } }, user: { get () { return this.$store.state.User.user } }, isVisibleProductPatch: { get () { return this.$store.state.isVisibleProductPatch }, set (isVisibleProductPatch) { this.$store.commit('SET_IS_VISIBLE_PRODUCT_PATCH', isVisibleProductPatch) } } } }
{ "pile_set_name": "Github" }
package rotatelogs import ( "os" "sync" "time" strftime "github.com/lestrrat/go-strftime" ) // RotateLogs represents a log file that gets // automatically rotated as you write to it. type RotateLogs struct { clock Clock curFn string globPattern string linkName string maxAge time.Duration mutex sync.RWMutex outFh *os.File pattern *strftime.Strftime rotationTime time.Duration } // Clock is the interface used by the RotateLogs // object to determine the current time type Clock interface { Now() time.Time } type clockFn func() time.Time // UTC is an object satisfying the Clock interface, which // returns the current time in UTC var UTC = clockFn(func() time.Time { return time.Now().UTC() }) // Local is an object satisfying the Clock interface, which // returns the current time in the local timezone var Local = clockFn(time.Now) // Option is used to pass optional arguments to // the RotateLogs constructor type Option interface { Configure(*RotateLogs) error } // OptionFn is a type of Option that is represented // by a single function that gets called for Configure() type OptionFn func(*RotateLogs) error
{ "pile_set_name": "Github" }
function [ hex ] = rgb2hex(rgb) % rgb2hex converts rgb color values to hex color format. % % This function assumes rgb values are in [r g b] format on the 0 to 1 % scale. If, however, any value r, g, or b exceed 1, the function assumes % [r g b] are scaled between 0 and 255. % % * * * * * * * * * * * * * * * * * * * * % SYNTAX: % hex = rgb2hex(rgb) returns the hexadecimal color value of the n x 3 rgb % values. rgb can be an array. % % * * * * * * * * * * * * * * * * * * * * % EXAMPLES: % % myhexvalue = rgb2hex([0 1 0]) % = #00FF00 % % myhexvalue = rgb2hex([0 255 0]) % = #00FF00 % % myrgbvalues = [.2 .3 .4; % .5 .6 .7; % .8 .6 .2; % .2 .2 .9]; % myhexvalues = rgb2hex(myrgbvalues) % = #334D66 % #8099B3 % #CC9933 % #3333E6 % % * * * * * * * * * * * * * * * * * * * * % Chad A. Greene, April 2014 % % Updated August 2014: Functionality remains exactly the same, but it's a % little more efficient and more robust. Thanks to Stephen Cobeldick for % his suggestions. % % * * * * * * * * * * * * * * * * * * * * % See also hex2rgb, dec2hex, hex2num, and ColorSpec. %% Check inputs: assert(nargin==1,'This function requires an RGB input.') assert(isnumeric(rgb)==1,'Function input must be numeric.') sizergb = size(rgb); assert(sizergb(2)==3,'rgb value must have three components in the form [r g b].') assert(max(rgb(:))<=255& min(rgb(:))>=0,'rgb values must be on a scale of 0 to 1 or 0 to 255') %% If no value in RGB exceeds unity, scale from 0 to 255: if max(rgb(:))<=1 rgb = round(rgb*255); else rgb = round(rgb); end %% Convert (Thanks to Stephen Cobeldick for this clever, efficient solution): hex(:,2:7) = reshape(sprintf('%02X',rgb.'),6,[]).'; hex(:,1) = '#'; end
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html class="type--{{filetype}}" style="height: 100vh;"> <head> <meta charset="utf-8" /> <style type="text/css"> {{ style }} </style> </head> <body style="height: 100vh;"> <div class="cover"> <div class="cover__content"> <h1 class="cover__title">{{ title }}</h1> <p class="cover__subtitle"> <time class="cover__date" datetime="{{ date }}" >{{ date }}</time > </p> </div> </div> </body> </html>
{ "pile_set_name": "Github" }
// // UIViewAnimationTests.swift // UIKitTests // // Created by Michael Knoch on 11.08.17. // Copyright © 2017 flowkey. All rights reserved. // import XCTest @testable import UIKit class UIViewAnimationTests: XCTestCase { var view = UIView() override func tearDown() { // reset animation state UIView.layersWithAnimations = Set<UIKit.CALayer>() } override func setUp() { view = UIView() view.layer.hasBeenRenderedInThisPartOfOverallLayerHierarchy = true } func testCanAnimateFrame() { let frameToStartFrom = CGRect(x: 10, y: 10, width: 10, height: 10) let expectedFrame = CGRect(x: 20, y: 20, width: 20, height: 20) view.frame = frameToStartFrom UIView.animate(withDuration: 5.0, delay: 0, options: [.curveLinear], animations: { view.frame = expectedFrame }) XCTAssertEqual(view.frame, expectedFrame) UIView.animateIfNeeded(at: Timer(startingAt: 2500)) guard let presentation = view.layer._presentation else { return XCTFail("presentation must be defined") } XCTAssertEqual( presentation.frame.rounded(accuracy: 0.01), CGRect(x: 15, y: 15, width: 15, height: 15) ) } func testCanAnimateOpacity() { UIView.animate(withDuration: 5, delay: 0, options: [.curveLinear], animations: { view.alpha = 0.2 }) XCTAssertEqual(view.alpha, 0.2, accuracy: 0.001) XCTAssertEqual(view.layer.animations.count, 1) UIView.animateIfNeeded(at: Timer(startingAt: 2500)) if let presentation = view.layer._presentation { XCTAssertEqual(presentation.opacity, 0.6, accuracy: 0.01) } else { XCTFail("presentation must be defined") } } func testCanAnimateBounds() { let boundsToStartFrom = CGRect(x: 10, y: 10, width: 10, height: 10) let expectedBounds = CGRect(x: 20, y: 20, width: 20, height: 20) view.bounds = boundsToStartFrom UIView.animate(withDuration: 5, delay: 0, options: [.curveLinear], animations: { view.bounds = expectedBounds }) XCTAssertEqual(view.bounds, expectedBounds) // animating bounds consists of bounds.origin and frame.size animation // because mutating frame mutates bounds and vice versa XCTAssertEqual(view.layer.animations.count, 1) UIView.animateIfNeeded(at: Timer(startingAt: 2500)) if let presentation = view.layer._presentation { XCTAssertEqual( presentation.bounds.rounded(accuracy: 0.01), CGRect(x: 15, y: 15, width: 15, height: 15) ) } else { XCTFail("presentation must be defined") } } func testDelay() { UIView.animate(withDuration: 2, delay: 2, options: [.curveLinear], animations: { view.alpha = 0 }) UIView.animateIfNeeded(at: Timer(startingAt: 3000)) if let presentation = view.layer._presentation { XCTAssertEqual(Double(presentation.opacity), 0.5, accuracy: 0.01) } else { XCTFail("presentation must be defined") } } func testCompletion() { let view = UIView() var animationDidFinish = false UIView.animate(withDuration: 5, delay: 0, options: [], animations: { view.frame = CGRect(x: 20, y: 20, width: 20, height: 20) view.alpha = 0.3 view.bounds.origin.x += 10 }, completion: { animationDidFinish = $0 }) UIView.animateIfNeeded(at: Timer(startingAt: 5000)) XCTAssertTrue(animationDidFinish) } func testCompletionWhenCancelingAnimations() { var firstAnimationDidFinish: Bool? var secondAnimationDidFinish: Bool? UIView.animate(withDuration: 1, delay: 0, options: [], animations: { view.alpha = 0.3 }, completion: { firstAnimationDidFinish = $0 }) UIView.animate(withDuration: 1, delay: 0.2, options: [], animations: { view.alpha = 0 }, completion: { secondAnimationDidFinish = $0 }) UIView.animateIfNeeded(at: Timer(startingAt: 200)) UIView.animateIfNeeded(at: Timer(startingAt: 5000)) if let firstAnimationDidFinish = firstAnimationDidFinish, let secondAnimationDidFinish = secondAnimationDidFinish { XCTAssertFalse(firstAnimationDidFinish) XCTAssertTrue(secondAnimationDidFinish) } else { XCTFail("completion callback never called") } } func testCompletionWhenQueingAnimationsOfSameType() { var firstAnimationDidFinish: Bool? var secondAnimationDidFinish: Bool? UIView.animate(withDuration: 1, delay: 0, options: [], animations: { view.alpha = 0.3 }, completion: { firstAnimationDidFinish = $0 }) UIView.animate(withDuration: 1, delay: 2, options: [], animations: { view.alpha = 0 }, completion: { secondAnimationDidFinish = $0 }) UIView.animateIfNeeded(at: Timer(startingAt: 5000)) if let firstAnimationDidFinish = firstAnimationDidFinish, let secondAnimationDidFinish = secondAnimationDidFinish { XCTAssertFalse(firstAnimationDidFinish) XCTAssertTrue(secondAnimationDidFinish) } else { XCTFail("completion callback never called") } } func testPresentationLayerIsSet() { let expectedFrame = CGRect(x: 20, y: 20, width: 20, height: 20) XCTAssertNil(view.layer._presentation) UIView.animate(withDuration: 5, delay: 0, options: [], animations: { view.frame = expectedFrame view.alpha = 0.1 }) UIView.animateIfNeeded(at: Timer(startingAt: 2500)) XCTAssertNotNil(view.layer._presentation) } func testPresentationIsRemovedWhenAnimationCompletes() { let view = UIView() let expectedFrame = CGRect(x: 20, y: 20, width: 20, height: 20) UIView.animate(withDuration: 5, delay: 0, options: [], animations: { view.frame = expectedFrame view.alpha = 0.1 }) UIView.animateIfNeeded(at: Timer(startingAt: 6000)) XCTAssertNil(view.layer._presentation) } func testLayersWithAnimations() { let firstView = UIView() firstView.layer.hasBeenRenderedInThisPartOfOverallLayerHierarchy = true let secondView = UIView() secondView.layer.hasBeenRenderedInThisPartOfOverallLayerHierarchy = true let thirdView = UIView() thirdView.layer.hasBeenRenderedInThisPartOfOverallLayerHierarchy = true UIView.animate(withDuration: 10, delay: 0, options: [], animations: { firstView.frame.origin.x += 10 firstView.alpha = 0.1 }) XCTAssertEqual(UIView.layersWithAnimations.count, 1) UIView.animate(withDuration: 15, delay: 0, options: [], animations: { secondView.alpha = 0.5 thirdView.alpha = 0.3 }) XCTAssertEqual(UIView.layersWithAnimations.count, 3) // finish first animation UIView.animateIfNeeded(at: Timer(startingAt: 10000)) XCTAssertEqual(UIView.layersWithAnimations.count, 2) // finish second animation UIView.animateIfNeeded(at: Timer(startingAt: 15000)) XCTAssertEqual(UIView.layersWithAnimations.count, 0) } func testBeginFromCurrentState() { UIView.animate(withDuration: 10, delay: 0, options: [.curveLinear], animations: { view.bounds.origin.x = 10 }) UIView.animateIfNeeded(at: Timer(startingAt: 5000)) UIView.animate(withDuration: 10, delay: 5, options: [.beginFromCurrentState], animations: { view.bounds.origin.x = 20 }) guard let fromValue = view.layer.animations["bounds"]?.fromValue as? CGRect else { return XCTFail("fromValue must not be nil!") } XCTAssertEqual(fromValue.origin.x, CGFloat(5.0), accuracy: 0.01) } func testModifyLayerWhileAnimationIsInFlight() { UIView.animate(withDuration: 10, delay: 0, options: [.curveLinear], animations: { view.frame.origin.x = 200 }) view.alpha = 0 UIView.animateIfNeeded(at: Timer(startingAt: 5000)) if let presentation = view.layer._presentation { XCTAssertEqual(presentation.opacity, 0) XCTAssertEqual(presentation.frame.origin.x, 100, accuracy: 0.01) } else { XCTFail("presentation must be defined") } } func testModifyPropertyWhichIsCurrentlyAnimating() { UIView.animate(withDuration: 10, delay: 0, options: [.curveLinear], animations: { view.frame.origin.x = 200 }) view.frame.origin.x = 0 UIView.animateIfNeeded(at: Timer(startingAt: 5000)) if let presentation = view.layer._presentation { XCTAssertEqual(presentation.frame.origin.x, 0) } else { XCTFail("presentation must be defined") } XCTAssertEqual(view.frame.origin.x, 0) } func testAllowUserInteraction() { UIView.animate(withDuration: 10, delay: 0, options: [.allowUserInteraction], animations: { view.frame.origin.x = 200 }) XCTAssertTrue((view.layer.animations["position"]?.animationGroup? .options.contains(.allowUserInteraction) ?? false)) XCTAssertTrue(view.anyCurrentlyRunningAnimationsAllowUserInteraction) } func testCreateAnimationsOnlyWhenPropertiesDiffer() { view.frame.origin.x = 100 var firstAnimationDidFinish = false UIView.animate(withDuration: 10, delay: 0, options: [], animations: { view.frame.origin.x = 100 }) { finished in if firstAnimationDidFinish { XCTFail("completion should be called only once")} firstAnimationDidFinish = finished } UIView.animateIfNeeded(at: Timer(startingAt: 10000)) XCTAssertTrue(view.layer.animations.isEmpty) // nevertheless completion should be called XCTAssertTrue(firstAnimationDidFinish) } func testCompletionIsCalledOnlyOnce() { var completionCounter = 0 UIView.animate(withDuration: 5, delay: 0, options: [], animations: { view.frame.origin.x = 100 }) { _ in completionCounter += 1 } UIView.animateIfNeeded(at: Timer(startingAt: 10000)) XCTAssertEqual(completionCounter, 1) } } fileprivate extension CGRect { func rounded(accuracy: CGFloat) -> CGRect { return CGRect( x: self.origin.x.rounded(accuracy: accuracy), y: self.origin.y.rounded(accuracy: accuracy), width: self.size.width.rounded(accuracy: accuracy), height: self.size.height.rounded(accuracy: accuracy) ) } } fileprivate extension CGFloat { func rounded(accuracy: CGFloat) -> CGFloat { let inverseAccuracy = 1 / accuracy return (self * inverseAccuracy).rounded() / inverseAccuracy } }
{ "pile_set_name": "Github" }
package com.bewitchment.common.item.tool; import com.bewitchment.registry.ModObjects; import net.minecraft.client.resources.I18n; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; import java.util.Set; @SuppressWarnings({"NullableProblems", "ConstantConditions"}) public class ItemJuniperKeyRing extends ItemJuniperKey { public ItemJuniperKeyRing() { super(); } public static List<NBTTagCompound> getKeyTags(NBTTagCompound keyRingData) { List<NBTTagCompound> tags = new ArrayList<>(); keyRingData.getTagList("Keys", Constants.NBT.TAG_COMPOUND).forEach(nbt -> { tags.add((NBTTagCompound) nbt); }); return tags; } public static ItemStack addKeyTag(ItemStack keyRing, NBTTagCompound keyTag) { if (keyRing.getItem() instanceof ItemJuniperKeyRing) { keyRing.getTagCompound().getTagList("Keys", Constants.NBT.TAG_COMPOUND).appendTag(keyTag); } return keyRing; } public static ItemStack createKeyRing(ItemStack keyRing, Set<NBTTagCompound> keys) { keyRing.setTagCompound(new NBTTagCompound()); keyRing.getTagCompound().setTag("Keys", new NBTTagList()); keys.forEach(tag -> addKeyTag(keyRing, tag)); return keyRing; } @Override public boolean canAccess(IBlockAccess world, BlockPos pos, int dimension, ItemStack stack, NBTTagCompound data) { return getKeyTags(data).stream().anyMatch(tag -> ((ItemJuniperKey) ModObjects.juniper_key).canAccess(world, pos, dimension, stack, tag)); } @Override public ItemStack setTags(World world, BlockPos pos, ItemStack stack) { stack.setTagCompound(new NBTTagCompound()); stack.getTagCompound().setTag("Keys", new NBTTagList()); return stack; } @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag advanced) { if (stack.hasTagCompound()) { tooltip.add(I18n.format("tooltip." + getTranslationKey().substring(5) + ".header")); getKeyTags(stack.getTagCompound()).forEach(tag -> { if (tag.hasKey("location")) { BlockPos pos = BlockPos.fromLong(tag.getLong("location")); tooltip.add(I18n.format("tooltip." + getTranslationKey().substring(5), pos.getX(), pos.getY(), pos.getZ(), tag.getString("dimensionName"))); } }); } } }
{ "pile_set_name": "Github" }
#include <GameEnginePCH.h> #include <GameEngine/GameState/GameStateWindow.h> ezGameStateWindow::ezGameStateWindow(const ezWindowCreationDesc& windowdesc, ezDelegate<void()> onClickClose) : m_OnClickClose(onClickClose) { m_CreationDescription = windowdesc; m_CreationDescription.AdjustWindowSizeAndPosition(); Initialize(); } ezGameStateWindow::~ezGameStateWindow() { Destroy(); } void ezGameStateWindow::ResetOnClickClose(ezDelegate<void()> onClickClose) { m_OnClickClose = onClickClose; } void ezGameStateWindow::OnClickClose() { if (m_OnClickClose.IsValid()) { m_OnClickClose(); } } void ezGameStateWindow::OnResize(const ezSizeU32& newWindowSize) { ezLog::Info("Resolution changed to {0} * {1}", newWindowSize.width, newWindowSize.height); m_CreationDescription.m_Resolution = newWindowSize; } EZ_STATICLINK_FILE(GameEngine, GameEngine_GameState_Implementation_GameStateWindow);
{ "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 fake import ( "context" "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" restclient "k8s.io/client-go/rest" core "k8s.io/client-go/testing" ) func (c *FakePods) Bind(ctx context.Context, binding *v1.Binding, opts metav1.CreateOptions) error { action := core.CreateActionImpl{} action.Verb = "create" action.Namespace = binding.Namespace action.Resource = podsResource action.Subresource = "binding" action.Object = binding _, err := c.Fake.Invokes(action, binding) return err } func (c *FakePods) GetBinding(name string) (result *v1.Binding, err error) { obj, err := c.Fake. Invokes(core.NewGetSubresourceAction(podsResource, c.ns, "binding", name), &v1.Binding{}) if obj == nil { return nil, err } return obj.(*v1.Binding), err } func (c *FakePods) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Request { action := core.GenericActionImpl{} action.Verb = "get" action.Namespace = c.ns action.Resource = podsResource action.Subresource = "log" action.Value = opts _, _ = c.Fake.Invokes(action, &v1.Pod{}) return &restclient.Request{} } func (c *FakePods) Evict(ctx context.Context, eviction *policy.Eviction) error { action := core.CreateActionImpl{} action.Verb = "create" action.Namespace = c.ns action.Resource = podsResource action.Subresource = "eviction" action.Object = eviction _, err := c.Fake.Invokes(action, eviction) return err }
{ "pile_set_name": "Github" }
/* * This file is part of Adblock Plus <https://adblockplus.org/>, * Copyright (C) 2006-present eyeo GmbH * * Adblock Plus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * Adblock Plus 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 Adblock Plus. If not, see <http://www.gnu.org/licenses/>. */ #include <future> #include <gtest/gtest.h> #include <AdblockPlus/AsyncExecutor.h> using namespace AdblockPlus; // For present gtest does not provide public API to have value- and type- // parameterized tests, so the approach is to accumalte the common code in // BaseAsyncExecutorTest, then define it with different types and then for each // type instantiate value-parameterized tests and call the common test body. template<typename Executor> struct BaseAsyncExecutorTestTraits; typedef ::testing::tuple<uint16_t, // number of procucers uint16_t // number of tasks issued by each producer > BaseAsyncExecutorTestParams; template<typename TExecutor> class BaseAsyncExecutorTest : public ::testing::TestWithParam<BaseAsyncExecutorTestParams> { public: typedef typename ::testing::tuple_element<0, ParamType>::type ProducersNumber; typedef typename ::testing::tuple_element<1, ParamType>::type ProducerTasksNumber; typedef BaseAsyncExecutorTestTraits<TExecutor> Traits; typedef typename Traits::Executor Executor; protected: void SetUp() override { testThreadID = std::this_thread::get_id(); } void MultithreadedCallsTest(); std::thread::id testThreadID; }; template<> struct BaseAsyncExecutorTestTraits<ActiveObject> { typedef ActiveObject Executor; typedef std::vector<uint32_t> PayloadResults; static void Dispatch(typename BaseAsyncExecutorTest<Executor>::Executor& executor, std::function<void()> call) { executor.Post(std::move(call)); } }; template<> struct BaseAsyncExecutorTestTraits<AsyncExecutor> { typedef AsyncExecutor Executor; // The API of this class is not thread-safe! It's merely a helper to // generalize particular tests, don't use it anywhere else. class PayloadResults : public SynchronizedCollection<std::vector<uint32_t>> { public: typename Container::size_type size() const { return collection.size(); } typename Container::iterator begin() { return collection.begin(); } typename Container::iterator end() { return collection.end(); } typename Container::const_reference operator[](typename Container::size_type pos) const { return collection[pos]; } }; static void Dispatch(typename BaseAsyncExecutorTest<Executor>::Executor& executor, std::function<void()> call) { executor.Dispatch(std::move(call)); } }; template<typename Executor> void BaseAsyncExecutorTest<Executor>::MultithreadedCallsTest() { typename Traits::PayloadResults results; std::promise<void> prepare; std::shared_future<void> asyncPrepared = prepare.get_future(); const ProducersNumber producersNumber = ::testing::get<0>(GetParam()); const ProducerTasksNumber producerTasksNumber = ::testing::get<1>(GetParam()); const uint32_t totalTasksNumber = producersNumber * producerTasksNumber; { Executor executor; { // Defining AsyncExecutor (async) after tested Executor ensures that all // producers finish before destroying the Executor. Otherwise there could // be cases when the Executor is already destroyed but payload task is not // dispatched yet, what would result in a data race. // It seems at least strange to use AsyncExecutor in the test of // AsyncExecutor, but perhaps it can be considered as addition testing. AsyncExecutor async; for (ProducersNumber producer = 0; producer < producersNumber; ++producer) { auto producerTask = [producerTasksNumber, this, &executor, producer, &results]( std::thread::id producerThreadID) { for (ProducerTasksNumber task = 0; task < producerTasksNumber; ++task) { auto id = producer * producerTasksNumber + task; Traits::Dispatch(executor, /*payload task*/ [this, id, &results, producerThreadID] { results.push_back(id); EXPECT_NE(producerThreadID, std::this_thread::get_id()); EXPECT_NE(testThreadID, std::this_thread::get_id()); }); } }; async.Dispatch([this, producerTask, asyncPrepared] { const auto producerThreadID = std::this_thread::get_id(); EXPECT_NE(testThreadID, producerThreadID); asyncPrepared.wait(); producerTask(producerThreadID); }); std::this_thread::yield(); } // it's not ideal because some threads can still have not reached // asyncPrepared.wait() but it's good enough, in particular yield should // be helpful there. prepare.set_value(); } } std::sort(results.begin(), results.end()); // ensure that all tasks are executed by finding their IDs ASSERT_EQ(totalTasksNumber, results.size()); for (uint16_t id = 0; id < totalTasksNumber; ++id) { EXPECT_EQ(id, results[id]); } } namespace { std::string humanReadbleParams(const ::testing::TestParamInfo<BaseAsyncExecutorTestParams> paramInfo) { std::stringstream ss; ss << "producers_" << ::testing::get<0>(paramInfo.param) << "_tasks_" << ::testing::get<1>(paramInfo.param); return ss.str(); } // The reason for such splitting for different implementations and different // platforms is the limited number of threads and time to run tests on // travis-ci. // E.g. 100 x 1000 is already too much, so the generators are split. // 0 - 10 1 - 100, 1000 const auto MultithreadedCallsGenerator1 = ::testing::Combine( ::testing::Values(0, 1, 2, 3, 5, 10), ::testing::Values(1, 2, 3, 5, 10, 100, 1000)); // 100, 1 - 100 const auto MultithreadedCallsGenerator2 = ::testing::Combine(::testing::Values(100), ::testing::Values(1, 2, 3, 5, 10, 100)); // 0 - 10 2000|4000 const auto MultithreadedCallsGenerator3 = ::testing::Combine(::testing::Values(0, 1, 2, 3, 5, 10), #ifdef WIN32 ::testing::Values(4000) #else ::testing::Values(2000) #endif ); typedef BaseAsyncExecutorTest<ActiveObject> ActiveObjectTest; INSTANTIATE_TEST_SUITE_P(DifferentProducersNumber1, ActiveObjectTest, MultithreadedCallsGenerator1, humanReadbleParams); INSTANTIATE_TEST_SUITE_P(DifferentProducersNumber2, ActiveObjectTest, MultithreadedCallsGenerator2, humanReadbleParams); INSTANTIATE_TEST_SUITE_P(DifferentProducersNumber3, ActiveObjectTest, MultithreadedCallsGenerator3, humanReadbleParams); TEST_P(ActiveObjectTest, MultithreadedCalls) { MultithreadedCallsTest(); } typedef BaseAsyncExecutorTest<AsyncExecutor> AsyncExecutorTest; INSTANTIATE_TEST_SUITE_P(DifferentProducersNumber1, AsyncExecutorTest, MultithreadedCallsGenerator1, humanReadbleParams); INSTANTIATE_TEST_SUITE_P(DifferentProducersNumber2, AsyncExecutorTest, MultithreadedCallsGenerator2, humanReadbleParams); INSTANTIATE_TEST_SUITE_P(DifferentProducersNumber3, AsyncExecutorTest, MultithreadedCallsGenerator3, humanReadbleParams); TEST_P(AsyncExecutorTest, MultithreadedCalls) { MultithreadedCallsTest(); } }
{ "pile_set_name": "Github" }
/* * fs/kernfs/file.c - kernfs file implementation * * Copyright (c) 2001-3 Patrick Mochel * Copyright (c) 2007 SUSE Linux Products GmbH * Copyright (c) 2007, 2013 Tejun Heo <tj@kernel.org> * * This file is released under the GPLv2. */ #include <linux/fs.h> #include <linux/seq_file.h> #include <linux/slab.h> #include <linux/poll.h> #include <linux/pagemap.h> #include <linux/sched/mm.h> #include <linux/fsnotify.h> #include "kernfs-internal.h" /* * There's one kernfs_open_file for each open file and one kernfs_open_node * for each kernfs_node with one or more open files. * * kernfs_node->attr.open points to kernfs_open_node. attr.open is * protected by kernfs_open_node_lock. * * filp->private_data points to seq_file whose ->private points to * kernfs_open_file. kernfs_open_files are chained at * kernfs_open_node->files, which is protected by kernfs_open_file_mutex. */ static DEFINE_SPINLOCK(kernfs_open_node_lock); static DEFINE_MUTEX(kernfs_open_file_mutex); struct kernfs_open_node { atomic_t refcnt; atomic_t event; wait_queue_head_t poll; struct list_head files; /* goes through kernfs_open_file.list */ }; /* * kernfs_notify() may be called from any context and bounces notifications * through a work item. To minimize space overhead in kernfs_node, the * pending queue is implemented as a singly linked list of kernfs_nodes. * The list is terminated with the self pointer so that whether a * kernfs_node is on the list or not can be determined by testing the next * pointer for NULL. */ #define KERNFS_NOTIFY_EOL ((void *)&kernfs_notify_list) static DEFINE_SPINLOCK(kernfs_notify_lock); static struct kernfs_node *kernfs_notify_list = KERNFS_NOTIFY_EOL; static struct kernfs_open_file *kernfs_of(struct file *file) { return ((struct seq_file *)file->private_data)->private; } /* * Determine the kernfs_ops for the given kernfs_node. This function must * be called while holding an active reference. */ static const struct kernfs_ops *kernfs_ops(struct kernfs_node *kn) { if (kn->flags & KERNFS_LOCKDEP) lockdep_assert_held(kn); return kn->attr.ops; } /* * As kernfs_seq_stop() is also called after kernfs_seq_start() or * kernfs_seq_next() failure, it needs to distinguish whether it's stopping * a seq_file iteration which is fully initialized with an active reference * or an aborted kernfs_seq_start() due to get_active failure. The * position pointer is the only context for each seq_file iteration and * thus the stop condition should be encoded in it. As the return value is * directly visible to userland, ERR_PTR(-ENODEV) is the only acceptable * choice to indicate get_active failure. * * Unfortunately, this is complicated due to the optional custom seq_file * operations which may return ERR_PTR(-ENODEV) too. kernfs_seq_stop() * can't distinguish whether ERR_PTR(-ENODEV) is from get_active failure or * custom seq_file operations and thus can't decide whether put_active * should be performed or not only on ERR_PTR(-ENODEV). * * This is worked around by factoring out the custom seq_stop() and * put_active part into kernfs_seq_stop_active(), skipping it from * kernfs_seq_stop() if ERR_PTR(-ENODEV) while invoking it directly after * custom seq_file operations fail with ERR_PTR(-ENODEV) - this ensures * that kernfs_seq_stop_active() is skipped only after get_active failure. */ static void kernfs_seq_stop_active(struct seq_file *sf, void *v) { struct kernfs_open_file *of = sf->private; const struct kernfs_ops *ops = kernfs_ops(of->kn); if (ops->seq_stop) ops->seq_stop(sf, v); kernfs_put_active(of->kn); } static void *kernfs_seq_start(struct seq_file *sf, loff_t *ppos) { struct kernfs_open_file *of = sf->private; const struct kernfs_ops *ops; /* * @of->mutex nests outside active ref and is primarily to ensure that * the ops aren't called concurrently for the same open file. */ mutex_lock(&of->mutex); if (!kernfs_get_active(of->kn)) return ERR_PTR(-ENODEV); ops = kernfs_ops(of->kn); if (ops->seq_start) { void *next = ops->seq_start(sf, ppos); /* see the comment above kernfs_seq_stop_active() */ if (next == ERR_PTR(-ENODEV)) kernfs_seq_stop_active(sf, next); return next; } else { /* * The same behavior and code as single_open(). Returns * !NULL if pos is at the beginning; otherwise, NULL. */ return NULL + !*ppos; } } static void *kernfs_seq_next(struct seq_file *sf, void *v, loff_t *ppos) { struct kernfs_open_file *of = sf->private; const struct kernfs_ops *ops = kernfs_ops(of->kn); if (ops->seq_next) { void *next = ops->seq_next(sf, v, ppos); /* see the comment above kernfs_seq_stop_active() */ if (next == ERR_PTR(-ENODEV)) kernfs_seq_stop_active(sf, next); return next; } else { /* * The same behavior and code as single_open(), always * terminate after the initial read. */ ++*ppos; return NULL; } } static void kernfs_seq_stop(struct seq_file *sf, void *v) { struct kernfs_open_file *of = sf->private; if (v != ERR_PTR(-ENODEV)) kernfs_seq_stop_active(sf, v); mutex_unlock(&of->mutex); } static int kernfs_seq_show(struct seq_file *sf, void *v) { struct kernfs_open_file *of = sf->private; of->event = atomic_read(&of->kn->attr.open->event); return of->kn->attr.ops->seq_show(sf, v); } static const struct seq_operations kernfs_seq_ops = { .start = kernfs_seq_start, .next = kernfs_seq_next, .stop = kernfs_seq_stop, .show = kernfs_seq_show, }; /* * As reading a bin file can have side-effects, the exact offset and bytes * specified in read(2) call should be passed to the read callback making * it difficult to use seq_file. Implement simplistic custom buffering for * bin files. */ static ssize_t kernfs_file_direct_read(struct kernfs_open_file *of, char __user *user_buf, size_t count, loff_t *ppos) { ssize_t len = min_t(size_t, count, PAGE_SIZE); const struct kernfs_ops *ops; char *buf; buf = of->prealloc_buf; if (buf) mutex_lock(&of->prealloc_mutex); else buf = kmalloc(len, GFP_KERNEL); if (!buf) return -ENOMEM; /* * @of->mutex nests outside active ref and is used both to ensure that * the ops aren't called concurrently for the same open file. */ mutex_lock(&of->mutex); if (!kernfs_get_active(of->kn)) { len = -ENODEV; mutex_unlock(&of->mutex); goto out_free; } of->event = atomic_read(&of->kn->attr.open->event); ops = kernfs_ops(of->kn); if (ops->read) len = ops->read(of, buf, len, *ppos); else len = -EINVAL; kernfs_put_active(of->kn); mutex_unlock(&of->mutex); if (len < 0) goto out_free; if (copy_to_user(user_buf, buf, len)) { len = -EFAULT; goto out_free; } *ppos += len; out_free: if (buf == of->prealloc_buf) mutex_unlock(&of->prealloc_mutex); else kfree(buf); return len; } /** * kernfs_fop_read - kernfs vfs read callback * @file: file pointer * @user_buf: data to write * @count: number of bytes * @ppos: starting offset */ static ssize_t kernfs_fop_read(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { struct kernfs_open_file *of = kernfs_of(file); if (of->kn->flags & KERNFS_HAS_SEQ_SHOW) return seq_read(file, user_buf, count, ppos); else return kernfs_file_direct_read(of, user_buf, count, ppos); } /** * kernfs_fop_write - kernfs vfs write callback * @file: file pointer * @user_buf: data to write * @count: number of bytes * @ppos: starting offset * * Copy data in from userland and pass it to the matching kernfs write * operation. * * There is no easy way for us to know if userspace is only doing a partial * write, so we don't support them. We expect the entire buffer to come on * the first write. Hint: if you're writing a value, first read the file, * modify only the the value you're changing, then write entire buffer * back. */ static ssize_t kernfs_fop_write(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { struct kernfs_open_file *of = kernfs_of(file); const struct kernfs_ops *ops; size_t len; char *buf; if (of->atomic_write_len) { len = count; if (len > of->atomic_write_len) return -E2BIG; } else { len = min_t(size_t, count, PAGE_SIZE); } buf = of->prealloc_buf; if (buf) mutex_lock(&of->prealloc_mutex); else buf = kmalloc(len + 1, GFP_KERNEL); if (!buf) return -ENOMEM; if (copy_from_user(buf, user_buf, len)) { len = -EFAULT; goto out_free; } buf[len] = '\0'; /* guarantee string termination */ /* * @of->mutex nests outside active ref and is used both to ensure that * the ops aren't called concurrently for the same open file. */ mutex_lock(&of->mutex); if (!kernfs_get_active(of->kn)) { mutex_unlock(&of->mutex); len = -ENODEV; goto out_free; } ops = kernfs_ops(of->kn); if (ops->write) len = ops->write(of, buf, len, *ppos); else len = -EINVAL; kernfs_put_active(of->kn); mutex_unlock(&of->mutex); if (len > 0) *ppos += len; out_free: if (buf == of->prealloc_buf) mutex_unlock(&of->prealloc_mutex); else kfree(buf); return len; } static void kernfs_vma_open(struct vm_area_struct *vma) { struct file *file = vma->vm_file; struct kernfs_open_file *of = kernfs_of(file); if (!of->vm_ops) return; if (!kernfs_get_active(of->kn)) return; if (of->vm_ops->open) of->vm_ops->open(vma); kernfs_put_active(of->kn); } static int kernfs_vma_fault(struct vm_fault *vmf) { struct file *file = vmf->vma->vm_file; struct kernfs_open_file *of = kernfs_of(file); int ret; if (!of->vm_ops) return VM_FAULT_SIGBUS; if (!kernfs_get_active(of->kn)) return VM_FAULT_SIGBUS; ret = VM_FAULT_SIGBUS; if (of->vm_ops->fault) ret = of->vm_ops->fault(vmf); kernfs_put_active(of->kn); return ret; } static int kernfs_vma_page_mkwrite(struct vm_fault *vmf) { struct file *file = vmf->vma->vm_file; struct kernfs_open_file *of = kernfs_of(file); int ret; if (!of->vm_ops) return VM_FAULT_SIGBUS; if (!kernfs_get_active(of->kn)) return VM_FAULT_SIGBUS; ret = 0; if (of->vm_ops->page_mkwrite) ret = of->vm_ops->page_mkwrite(vmf); else file_update_time(file); kernfs_put_active(of->kn); return ret; } static int kernfs_vma_access(struct vm_area_struct *vma, unsigned long addr, void *buf, int len, int write) { struct file *file = vma->vm_file; struct kernfs_open_file *of = kernfs_of(file); int ret; if (!of->vm_ops) return -EINVAL; if (!kernfs_get_active(of->kn)) return -EINVAL; ret = -EINVAL; if (of->vm_ops->access) ret = of->vm_ops->access(vma, addr, buf, len, write); kernfs_put_active(of->kn); return ret; } #ifdef CONFIG_NUMA static int kernfs_vma_set_policy(struct vm_area_struct *vma, struct mempolicy *new) { struct file *file = vma->vm_file; struct kernfs_open_file *of = kernfs_of(file); int ret; if (!of->vm_ops) return 0; if (!kernfs_get_active(of->kn)) return -EINVAL; ret = 0; if (of->vm_ops->set_policy) ret = of->vm_ops->set_policy(vma, new); kernfs_put_active(of->kn); return ret; } static struct mempolicy *kernfs_vma_get_policy(struct vm_area_struct *vma, unsigned long addr) { struct file *file = vma->vm_file; struct kernfs_open_file *of = kernfs_of(file); struct mempolicy *pol; if (!of->vm_ops) return vma->vm_policy; if (!kernfs_get_active(of->kn)) return vma->vm_policy; pol = vma->vm_policy; if (of->vm_ops->get_policy) pol = of->vm_ops->get_policy(vma, addr); kernfs_put_active(of->kn); return pol; } #endif static const struct vm_operations_struct kernfs_vm_ops = { .open = kernfs_vma_open, .fault = kernfs_vma_fault, .page_mkwrite = kernfs_vma_page_mkwrite, .access = kernfs_vma_access, #ifdef CONFIG_NUMA .set_policy = kernfs_vma_set_policy, .get_policy = kernfs_vma_get_policy, #endif }; static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma) { struct kernfs_open_file *of = kernfs_of(file); const struct kernfs_ops *ops; int rc; /* * mmap path and of->mutex are prone to triggering spurious lockdep * warnings and we don't want to add spurious locking dependency * between the two. Check whether mmap is actually implemented * without grabbing @of->mutex by testing HAS_MMAP flag. See the * comment in kernfs_file_open() for more details. */ if (!(of->kn->flags & KERNFS_HAS_MMAP)) return -ENODEV; mutex_lock(&of->mutex); rc = -ENODEV; if (!kernfs_get_active(of->kn)) goto out_unlock; ops = kernfs_ops(of->kn); rc = ops->mmap(of, vma); if (rc) goto out_put; /* * PowerPC's pci_mmap of legacy_mem uses shmem_zero_setup() * to satisfy versions of X which crash if the mmap fails: that * substitutes a new vm_file, and we don't then want bin_vm_ops. */ if (vma->vm_file != file) goto out_put; rc = -EINVAL; if (of->mmapped && of->vm_ops != vma->vm_ops) goto out_put; /* * It is not possible to successfully wrap close. * So error if someone is trying to use close. */ rc = -EINVAL; if (vma->vm_ops && vma->vm_ops->close) goto out_put; rc = 0; of->mmapped = true; of->vm_ops = vma->vm_ops; vma->vm_ops = &kernfs_vm_ops; out_put: kernfs_put_active(of->kn); out_unlock: mutex_unlock(&of->mutex); return rc; } /** * kernfs_get_open_node - get or create kernfs_open_node * @kn: target kernfs_node * @of: kernfs_open_file for this instance of open * * If @kn->attr.open exists, increment its reference count; otherwise, * create one. @of is chained to the files list. * * LOCKING: * Kernel thread context (may sleep). * * RETURNS: * 0 on success, -errno on failure. */ static int kernfs_get_open_node(struct kernfs_node *kn, struct kernfs_open_file *of) { struct kernfs_open_node *on, *new_on = NULL; retry: mutex_lock(&kernfs_open_file_mutex); spin_lock_irq(&kernfs_open_node_lock); if (!kn->attr.open && new_on) { kn->attr.open = new_on; new_on = NULL; } on = kn->attr.open; if (on) { atomic_inc(&on->refcnt); list_add_tail(&of->list, &on->files); } spin_unlock_irq(&kernfs_open_node_lock); mutex_unlock(&kernfs_open_file_mutex); if (on) { kfree(new_on); return 0; } /* not there, initialize a new one and retry */ new_on = kmalloc(sizeof(*new_on), GFP_KERNEL); if (!new_on) return -ENOMEM; atomic_set(&new_on->refcnt, 0); atomic_set(&new_on->event, 1); init_waitqueue_head(&new_on->poll); INIT_LIST_HEAD(&new_on->files); goto retry; } /** * kernfs_put_open_node - put kernfs_open_node * @kn: target kernfs_nodet * @of: associated kernfs_open_file * * Put @kn->attr.open and unlink @of from the files list. If * reference count reaches zero, disassociate and free it. * * LOCKING: * None. */ static void kernfs_put_open_node(struct kernfs_node *kn, struct kernfs_open_file *of) { struct kernfs_open_node *on = kn->attr.open; unsigned long flags; mutex_lock(&kernfs_open_file_mutex); spin_lock_irqsave(&kernfs_open_node_lock, flags); if (of) list_del(&of->list); if (atomic_dec_and_test(&on->refcnt)) kn->attr.open = NULL; else on = NULL; spin_unlock_irqrestore(&kernfs_open_node_lock, flags); mutex_unlock(&kernfs_open_file_mutex); kfree(on); } static int kernfs_fop_open(struct inode *inode, struct file *file) { struct kernfs_node *kn = file->f_path.dentry->d_fsdata; struct kernfs_root *root = kernfs_root(kn); const struct kernfs_ops *ops; struct kernfs_open_file *of; bool has_read, has_write, has_mmap; int error = -EACCES; if (!kernfs_get_active(kn)) return -ENODEV; ops = kernfs_ops(kn); has_read = ops->seq_show || ops->read || ops->mmap; has_write = ops->write || ops->mmap; has_mmap = ops->mmap; /* see the flag definition for details */ if (root->flags & KERNFS_ROOT_EXTRA_OPEN_PERM_CHECK) { if ((file->f_mode & FMODE_WRITE) && (!(inode->i_mode & S_IWUGO) || !has_write)) goto err_out; if ((file->f_mode & FMODE_READ) && (!(inode->i_mode & S_IRUGO) || !has_read)) goto err_out; } /* allocate a kernfs_open_file for the file */ error = -ENOMEM; of = kzalloc(sizeof(struct kernfs_open_file), GFP_KERNEL); if (!of) goto err_out; /* * The following is done to give a different lockdep key to * @of->mutex for files which implement mmap. This is a rather * crude way to avoid false positive lockdep warning around * mm->mmap_sem - mmap nests @of->mutex under mm->mmap_sem and * reading /sys/block/sda/trace/act_mask grabs sr_mutex, under * which mm->mmap_sem nests, while holding @of->mutex. As each * open file has a separate mutex, it's okay as long as those don't * happen on the same file. At this point, we can't easily give * each file a separate locking class. Let's differentiate on * whether the file has mmap or not for now. * * Both paths of the branch look the same. They're supposed to * look that way and give @of->mutex different static lockdep keys. */ if (has_mmap) mutex_init(&of->mutex); else mutex_init(&of->mutex); of->kn = kn; of->file = file; /* * Write path needs to atomic_write_len outside active reference. * Cache it in open_file. See kernfs_fop_write() for details. */ of->atomic_write_len = ops->atomic_write_len; error = -EINVAL; /* * ->seq_show is incompatible with ->prealloc, * as seq_read does its own allocation. * ->read must be used instead. */ if (ops->prealloc && ops->seq_show) goto err_free; if (ops->prealloc) { int len = of->atomic_write_len ?: PAGE_SIZE; of->prealloc_buf = kmalloc(len + 1, GFP_KERNEL); error = -ENOMEM; if (!of->prealloc_buf) goto err_free; mutex_init(&of->prealloc_mutex); } /* * Always instantiate seq_file even if read access doesn't use * seq_file or is not requested. This unifies private data access * and readable regular files are the vast majority anyway. */ if (ops->seq_show) error = seq_open(file, &kernfs_seq_ops); else error = seq_open(file, NULL); if (error) goto err_free; of->seq_file = file->private_data; of->seq_file->private = of; /* seq_file clears PWRITE unconditionally, restore it if WRITE */ if (file->f_mode & FMODE_WRITE) file->f_mode |= FMODE_PWRITE; /* make sure we have open node struct */ error = kernfs_get_open_node(kn, of); if (error) goto err_seq_release; if (ops->open) { /* nobody has access to @of yet, skip @of->mutex */ error = ops->open(of); if (error) goto err_put_node; } /* open succeeded, put active references */ kernfs_put_active(kn); return 0; err_put_node: kernfs_put_open_node(kn, of); err_seq_release: seq_release(inode, file); err_free: kfree(of->prealloc_buf); kfree(of); err_out: kernfs_put_active(kn); return error; } /* used from release/drain to ensure that ->release() is called exactly once */ static void kernfs_release_file(struct kernfs_node *kn, struct kernfs_open_file *of) { /* * @of is guaranteed to have no other file operations in flight and * we just want to synchronize release and drain paths. * @kernfs_open_file_mutex is enough. @of->mutex can't be used * here because drain path may be called from places which can * cause circular dependency. */ lockdep_assert_held(&kernfs_open_file_mutex); if (!of->released) { /* * A file is never detached without being released and we * need to be able to release files which are deactivated * and being drained. Don't use kernfs_ops(). */ kn->attr.ops->release(of); of->released = true; } } static int kernfs_fop_release(struct inode *inode, struct file *filp) { struct kernfs_node *kn = filp->f_path.dentry->d_fsdata; struct kernfs_open_file *of = kernfs_of(filp); if (kn->flags & KERNFS_HAS_RELEASE) { mutex_lock(&kernfs_open_file_mutex); kernfs_release_file(kn, of); mutex_unlock(&kernfs_open_file_mutex); } kernfs_put_open_node(kn, of); seq_release(inode, filp); kfree(of->prealloc_buf); kfree(of); return 0; } void kernfs_drain_open_files(struct kernfs_node *kn) { struct kernfs_open_node *on; struct kernfs_open_file *of; if (!(kn->flags & (KERNFS_HAS_MMAP | KERNFS_HAS_RELEASE))) return; spin_lock_irq(&kernfs_open_node_lock); on = kn->attr.open; if (on) atomic_inc(&on->refcnt); spin_unlock_irq(&kernfs_open_node_lock); if (!on) return; mutex_lock(&kernfs_open_file_mutex); list_for_each_entry(of, &on->files, list) { struct inode *inode = file_inode(of->file); if (kn->flags & KERNFS_HAS_MMAP) unmap_mapping_range(inode->i_mapping, 0, 0, 1); if (kn->flags & KERNFS_HAS_RELEASE) kernfs_release_file(kn, of); } mutex_unlock(&kernfs_open_file_mutex); kernfs_put_open_node(kn, NULL); } /* * Kernfs attribute files are pollable. The idea is that you read * the content and then you use 'poll' or 'select' to wait for * the content to change. When the content changes (assuming the * manager for the kobject supports notification), poll will * return POLLERR|POLLPRI, and select will return the fd whether * it is waiting for read, write, or exceptions. * Once poll/select indicates that the value has changed, you * need to close and re-open the file, or seek to 0 and read again. * Reminder: this only works for attributes which actively support * it, and it is not possible to test an attribute from userspace * to see if it supports poll (Neither 'poll' nor 'select' return * an appropriate error code). When in doubt, set a suitable timeout value. */ static unsigned int kernfs_fop_poll(struct file *filp, poll_table *wait) { struct kernfs_open_file *of = kernfs_of(filp); struct kernfs_node *kn = filp->f_path.dentry->d_fsdata; struct kernfs_open_node *on = kn->attr.open; if (!kernfs_get_active(kn)) goto trigger; poll_wait(filp, &on->poll, wait); kernfs_put_active(kn); if (of->event != atomic_read(&on->event)) goto trigger; return DEFAULT_POLLMASK; trigger: return DEFAULT_POLLMASK|POLLERR|POLLPRI; } static void kernfs_notify_workfn(struct work_struct *work) { struct kernfs_node *kn; struct kernfs_open_node *on; struct kernfs_super_info *info; repeat: /* pop one off the notify_list */ spin_lock_irq(&kernfs_notify_lock); kn = kernfs_notify_list; if (kn == KERNFS_NOTIFY_EOL) { spin_unlock_irq(&kernfs_notify_lock); return; } kernfs_notify_list = kn->attr.notify_next; kn->attr.notify_next = NULL; spin_unlock_irq(&kernfs_notify_lock); /* kick poll */ spin_lock_irq(&kernfs_open_node_lock); on = kn->attr.open; if (on) { atomic_inc(&on->event); wake_up_interruptible(&on->poll); } spin_unlock_irq(&kernfs_open_node_lock); /* kick fsnotify */ mutex_lock(&kernfs_mutex); list_for_each_entry(info, &kernfs_root(kn)->supers, node) { struct kernfs_node *parent; struct inode *inode; /* * We want fsnotify_modify() on @kn but as the * modifications aren't originating from userland don't * have the matching @file available. Look up the inodes * and generate the events manually. */ inode = ilookup(info->sb, kn->ino); if (!inode) continue; parent = kernfs_get_parent(kn); if (parent) { struct inode *p_inode; p_inode = ilookup(info->sb, parent->ino); if (p_inode) { fsnotify(p_inode, FS_MODIFY | FS_EVENT_ON_CHILD, inode, FSNOTIFY_EVENT_INODE, kn->name, 0); iput(p_inode); } kernfs_put(parent); } fsnotify(inode, FS_MODIFY, inode, FSNOTIFY_EVENT_INODE, kn->name, 0); iput(inode); } mutex_unlock(&kernfs_mutex); kernfs_put(kn); goto repeat; } /** * kernfs_notify - notify a kernfs file * @kn: file to notify * * Notify @kn such that poll(2) on @kn wakes up. Maybe be called from any * context. */ void kernfs_notify(struct kernfs_node *kn) { static DECLARE_WORK(kernfs_notify_work, kernfs_notify_workfn); unsigned long flags; if (WARN_ON(kernfs_type(kn) != KERNFS_FILE)) return; spin_lock_irqsave(&kernfs_notify_lock, flags); if (!kn->attr.notify_next) { kernfs_get(kn); kn->attr.notify_next = kernfs_notify_list; kernfs_notify_list = kn; schedule_work(&kernfs_notify_work); } spin_unlock_irqrestore(&kernfs_notify_lock, flags); } EXPORT_SYMBOL_GPL(kernfs_notify); const struct file_operations kernfs_file_fops = { .read = kernfs_fop_read, .write = kernfs_fop_write, .llseek = generic_file_llseek, .mmap = kernfs_fop_mmap, .open = kernfs_fop_open, .release = kernfs_fop_release, .poll = kernfs_fop_poll, .fsync = noop_fsync, }; /** * __kernfs_create_file - kernfs internal function to create a file * @parent: directory to create the file in * @name: name of the file * @mode: mode of the file * @size: size of the file * @ops: kernfs operations for the file * @priv: private data for the file * @ns: optional namespace tag of the file * @key: lockdep key for the file's active_ref, %NULL to disable lockdep * * Returns the created node on success, ERR_PTR() value on error. */ struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent, const char *name, umode_t mode, loff_t size, const struct kernfs_ops *ops, void *priv, const void *ns, struct lock_class_key *key) { struct kernfs_node *kn; unsigned flags; int rc; flags = KERNFS_FILE; kn = kernfs_new_node(parent, name, (mode & S_IALLUGO) | S_IFREG, flags); if (!kn) return ERR_PTR(-ENOMEM); kn->attr.ops = ops; kn->attr.size = size; kn->ns = ns; kn->priv = priv; #ifdef CONFIG_DEBUG_LOCK_ALLOC if (key) { lockdep_init_map(&kn->dep_map, "s_active", key, 0); kn->flags |= KERNFS_LOCKDEP; } #endif /* * kn->attr.ops is accesible only while holding active ref. We * need to know whether some ops are implemented outside active * ref. Cache their existence in flags. */ if (ops->seq_show) kn->flags |= KERNFS_HAS_SEQ_SHOW; if (ops->mmap) kn->flags |= KERNFS_HAS_MMAP; if (ops->release) kn->flags |= KERNFS_HAS_RELEASE; rc = kernfs_add_one(kn); if (rc) { kernfs_put(kn); return ERR_PTR(rc); } return kn; }
{ "pile_set_name": "Github" }
#ifndef _err_syntax12__defines_h_ #define _err_syntax12__defines_h_ #define text 456 #endif /* _err_syntax12__defines_h_ */
{ "pile_set_name": "Github" }
from hue import Hue from st2actions.runners.pythonrunner import Action class BaseAction(Action): def __init__(self, config): super(BaseAction, self).__init__(config) self.hue = self._get_client() def _get_client(self): hue = Hue() hue.station_ip = self.config['station_ip'] hue.client_identifier = self.config['client_identifier'] hue.get_state() return hue
{ "pile_set_name": "Github" }
1. Need to figure out why PCI writes to the IOC3 hang, and if it is okay not to write to the IOC3 ever. 2. Need to figure out RRB allocation in bridge_startup(). 3. Need to figure out why address swaizzling is needed in inw/outw for Qlogic scsi controllers. 4. Need to integrate ip27-klconfig.c:find_lboard and ip27-init.c:find_lbaord_real. DONE 5. Is it okay to set calias space on all nodes as 0, instead of 8k as in irix? 6. Investigate why things do not work without the setup_test() call being invoked on all nodes in ip27-memory.c. 8. Too many do_page_faults invoked - investigate. 9. start_thread must turn off UX64 ... and define tlb_refill_debug. 10. Need a bad pmd table, bad pte table. __bad_pmd_table/__bad_pagetable does not agree with pgd_bad/pmd_bad. 11. All intrs (ip27_do_irq handlers) are targeted at cpu A on the node. This might need to change later. Only the timer intr is set up to be received on both Cpu A and B. (ip27_do_irq()/bridge_startup()) 13. Cache flushing (specially the SMP version) has to be investigated.
{ "pile_set_name": "Github" }
In order to use the C code in these directories, you should first modify / setup the file config/LocalMakefileConfig.mk, which is included by the main Makefiles and allows you to overwrite the settings from config/Makefile.mk. Once this is done, run make. You must then use the install targets to copy / link the resulting shared libraries with their full paths into the "luatex/lib" subdirectory of the directory where your TeX executable resides. For instance, if the luatex program is in /usr/texbin then you would put SimpleDemoC.so into /usr/texbin/lib/luatex/lua/pgf/gd/examples/c Due to bugs in the LuaTeX code, you currently need to append the paths of the libraries to their name as done in the Makefiles. Note that, currently, the Makefile will link the Lua library statically into the shared graph drawing library (at least on MacOS). This is conceptually wrong and, indeed, a lot of effort was need to avoid having LuaTeX crash on a TeX run because of two Lua libraries being used simultaneously. It works, but hopefully, in the fututure, this will be fixed.
{ "pile_set_name": "Github" }
# # PHASE: collect srcjars # # DOCUMENT THIS # def phase_collect_srcjars(ctx, p): # This will be used to pick up srcjars from non-scala library # targets (like thrift code generation) srcjars = [] for target in ctx.attr.deps: if hasattr(target, "srcjars"): srcjars.append(target.srcjars.srcjar) return depset(srcjars)
{ "pile_set_name": "Github" }
#import "StatusMessageText.h" #import "PreferencesModel.h" #include "bridge.h" enum StatusMessageTextType { StatusMessageTextTypeExtra, StatusMessageTextTypeModifierLock, StatusMessageTextTypeCapsLock, StatusMessageTextTypeModifierSticky, StatusMessageTextTypePointingButtonLock, StatusMessageTextType_End_, }; @interface StatusMessageText () @property(weak) IBOutlet PreferencesModel* preferencesModel; @property NSMutableArray* texts; @end @implementation StatusMessageText - (instancetype)init { self = [super init]; if (self) { _texts = [NSMutableArray new]; NSDictionary* dictionary = @{ @"name" : @"", @"symbol" : @"", }; for (int i = 0; i < StatusMessageTextType_End_; ++i) { [_texts addObject:[dictionary mutableCopy]]; } } return self; } - (void)reset { for (int i = 0; i < StatusMessageTextType_End_; ++i) { self.texts[i][@"name"] = @""; self.texts[i][@"symbol"] = @""; } } - (void)updateText:(NSInteger)index text:(NSString*)text { switch (index) { case BRIDGE_USERCLIENT_STATUS_MESSAGE_EXTRA: self.texts[StatusMessageTextTypeExtra][@"name"] = text; break; case BRIDGE_USERCLIENT_STATUS_MESSAGE_MODIFIER_LOCK_NAME: self.texts[StatusMessageTextTypeModifierLock][@"name"] = text; break; case BRIDGE_USERCLIENT_STATUS_MESSAGE_MODIFIER_LOCK_SYMBOL: self.texts[StatusMessageTextTypeModifierLock][@"symbol"] = text; break; case BRIDGE_USERCLIENT_STATUS_MESSAGE_MODIFIER_CAPS_LOCK_NAME: self.texts[StatusMessageTextTypeCapsLock][@"name"] = text; break; case BRIDGE_USERCLIENT_STATUS_MESSAGE_MODIFIER_CAPS_LOCK_SYMBOL: self.texts[StatusMessageTextTypeCapsLock][@"symbol"] = text; break; case BRIDGE_USERCLIENT_STATUS_MESSAGE_MODIFIER_STICKY_NAME: self.texts[StatusMessageTextTypeModifierSticky][@"name"] = text; break; case BRIDGE_USERCLIENT_STATUS_MESSAGE_MODIFIER_STICKY_SYMBOL: self.texts[StatusMessageTextTypeModifierSticky][@"symbol"] = text; break; case BRIDGE_USERCLIENT_STATUS_MESSAGE_POINTING_BUTTON_LOCK: self.texts[StatusMessageTextTypePointingButtonLock][@"name"] = text; break; default: NSLog(@"Error: Invalid index in [StatusMessageText updateText:%d text:%@]", (int)(index), text); break; } } - (NSString*)extraText { return self.texts[StatusMessageTextTypeExtra][@"name"]; } - (NSString*)modifierLockText { if (self.preferencesModel.useModifierSymbolsInStatusWindow) { if (self.preferencesModel.showCapsLockStateInStatusWindow) { return [NSString stringWithFormat:@"%@%@", self.texts[StatusMessageTextTypeCapsLock][@"symbol"], self.texts[StatusMessageTextTypeModifierLock][@"symbol"]]; } else { return self.texts[StatusMessageTextTypeModifierLock][@"symbol"]; } } else { if (self.preferencesModel.showCapsLockStateInStatusWindow) { return [NSString stringWithFormat:@"%@%@", self.texts[StatusMessageTextTypeCapsLock][@"name"], self.texts[StatusMessageTextTypeModifierLock][@"name"]]; } else { return self.texts[StatusMessageTextTypeModifierLock][@"name"]; } } } - (NSString*)modifierStickyText { if (!self.preferencesModel.showStickyModifiersStateInStatusWindow) { return @""; } if (self.preferencesModel.useModifierSymbolsInStatusWindow) { return self.texts[StatusMessageTextTypeModifierSticky][@"symbol"]; } else { return self.texts[StatusMessageTextTypeModifierSticky][@"name"]; } } - (NSString*)pointingButtonLockText { if (!self.preferencesModel.showPointingButtonLockStateInStatusWindow) { return @""; } return self.texts[StatusMessageTextTypePointingButtonLock][@"name"]; } @end
{ "pile_set_name": "Github" }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. /// /// Simple occlusion shader that can be used to hide other objects. /// This prevents other objects from being rendered by drawing invisible 'opaque' pixels to the depth buffer. /// Shader "MixedRealityToolkit/WindowOcclusion" { Properties { } SubShader { Tags { "RenderType" = "Opaque" "Queue" = "Geometry-1" } Pass { ColorMask 0 // Color will not be rendered. CGPROGRAM #pragma vertex vert #pragma fragment frag // We only target the HoloLens (and the Unity editor), so take advantage of shader model 5. #pragma target 5.0 #pragma only_renderers d3d11 #include "UnityCG.cginc" struct v2f { float4 pos : SV_POSITION; UNITY_VERTEX_OUTPUT_STEREO }; v2f vert(appdata_base v) { UNITY_SETUP_INSTANCE_ID(v); v2f o; o.pos = UnityObjectToClipPos(v.vertex); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); return o; } half4 frag(v2f i) : COLOR { return float4(1,1,1,1); } ENDCG } } }
{ "pile_set_name": "Github" }
/* ---------------------------------------------------------------------------- */ /* Atmel Microcontroller Software Support */ /* SAM Software Package License */ /* ---------------------------------------------------------------------------- */ /* Copyright (c) 2015, Atmel Corporation */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following condition is met: */ /* */ /* - Redistributions of source code must retain the above copyright notice, */ /* this list of conditions and the disclaimer below. */ /* */ /* Atmel's name may not be used to endorse or promote products derived from */ /* this software without specific prior written permission. */ /* */ /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* ---------------------------------------------------------------------------- */ #ifndef _SAMA5D2_CLASSD_COMPONENT_ #define _SAMA5D2_CLASSD_COMPONENT_ /* ============================================================================= */ /** SOFTWARE API DEFINITION FOR Audio Class D Amplifier */ /* ============================================================================= */ /** \addtogroup SAMA5D2_CLASSD Audio Class D Amplifier */ /*@{*/ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) /** \brief Classd hardware registers */ typedef struct { __O uint32_t CLASSD_CR; /**< \brief (Classd Offset: 0x00) Control Register */ __IO uint32_t CLASSD_MR; /**< \brief (Classd Offset: 0x04) Mode Register */ __IO uint32_t CLASSD_INTPMR; /**< \brief (Classd Offset: 0x08) Interpolator Mode Register */ __I uint32_t CLASSD_INTSR; /**< \brief (Classd Offset: 0x0C) Interpolator Status Register */ __IO uint32_t CLASSD_THR; /**< \brief (Classd Offset: 0x10) Transmit Holding Register */ __O uint32_t CLASSD_IER; /**< \brief (Classd Offset: 0x14) Interrupt Enable Register */ __O uint32_t CLASSD_IDR; /**< \brief (Classd Offset: 0x18) Interrupt Disable Register */ __IO uint32_t CLASSD_IMR; /**< \brief (Classd Offset: 0x1C) Interrupt Mask Register */ __I uint32_t CLASSD_ISR; /**< \brief (Classd Offset: 0x20) Interrupt Status Register */ __I uint32_t Reserved1[48]; __IO uint32_t CLASSD_WPMR; /**< \brief (Classd Offset: 0xE4) Write Protection Mode Register */ __I uint32_t Reserved2[5]; __I uint32_t CLASSD_VERSION; /**< \brief (Classd Offset: 0xFC) IP Version Register */ } Classd; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ /* -------- CLASSD_CR : (CLASSD Offset: 0x00) Control Register -------- */ #define CLASSD_CR_SWRST (0x1u << 0) /**< \brief (CLASSD_CR) Software Reset */ /* -------- CLASSD_MR : (CLASSD Offset: 0x04) Mode Register -------- */ #define CLASSD_MR_LEN (0x1u << 0) /**< \brief (CLASSD_MR) Left Channel Enable */ #define CLASSD_MR_LMUTE (0x1u << 1) /**< \brief (CLASSD_MR) Left Channel Mute */ #define CLASSD_MR_REN (0x1u << 4) /**< \brief (CLASSD_MR) Right Channel Enable */ #define CLASSD_MR_RMUTE (0x1u << 5) /**< \brief (CLASSD_MR) Right Channel Mute */ #define CLASSD_MR_PWMTYP (0x1u << 8) /**< \brief (CLASSD_MR) PWM Modulation Type */ #define CLASSD_MR_NON_OVERLAP (0x1u << 16) /**< \brief (CLASSD_MR) Non-Overlapping Enable */ #define CLASSD_MR_NOVRVAL_Pos 20 #define CLASSD_MR_NOVRVAL_Msk (0x3u << CLASSD_MR_NOVRVAL_Pos) /**< \brief (CLASSD_MR) Non-Overlapping Value */ #define CLASSD_MR_NOVRVAL(value) ((CLASSD_MR_NOVRVAL_Msk & ((value) << CLASSD_MR_NOVRVAL_Pos))) #define CLASSD_MR_NOVRVAL_5NS (0x0u << 20) /**< \brief (CLASSD_MR) Non-overlapping time is 5 ns */ #define CLASSD_MR_NOVRVAL_10NS (0x1u << 20) /**< \brief (CLASSD_MR) Non-overlapping time is 10 ns */ #define CLASSD_MR_NOVRVAL_15NS (0x2u << 20) /**< \brief (CLASSD_MR) Non-overlapping time is 15 ns */ #define CLASSD_MR_NOVRVAL_20NS (0x3u << 20) /**< \brief (CLASSD_MR) Non-overlapping time is 20 ns */ /* -------- CLASSD_INTPMR : (CLASSD Offset: 0x08) Interpolator Mode Register -------- */ #define CLASSD_INTPMR_ATTL_Pos 0 #define CLASSD_INTPMR_ATTL_Msk (0x7fu << CLASSD_INTPMR_ATTL_Pos) /**< \brief (CLASSD_INTPMR) Left Channel Attenuation */ #define CLASSD_INTPMR_ATTL(value) ((CLASSD_INTPMR_ATTL_Msk & ((value) << CLASSD_INTPMR_ATTL_Pos))) #define CLASSD_INTPMR_ATTR_Pos 8 #define CLASSD_INTPMR_ATTR_Msk (0x7fu << CLASSD_INTPMR_ATTR_Pos) /**< \brief (CLASSD_INTPMR) Right Channel Attenuation */ #define CLASSD_INTPMR_ATTR(value) ((CLASSD_INTPMR_ATTR_Msk & ((value) << CLASSD_INTPMR_ATTR_Pos))) #define CLASSD_INTPMR_DSPCLKFREQ (0x1u << 16) /**< \brief (CLASSD_INTPMR) DSP Clock Frequency */ #define CLASSD_INTPMR_DSPCLKFREQ_12M288 (0x0u << 16) /**< \brief (CLASSD_INTPMR) DSP Clock (DSPCLK) is 12.288 MHz */ #define CLASSD_INTPMR_DSPCLKFREQ_11M2896 (0x1u << 16) /**< \brief (CLASSD_INTPMR) DSP Clock (DSPCLK) is 11.2896 MHz */ #define CLASSD_INTPMR_DEEMP (0x1u << 18) /**< \brief (CLASSD_INTPMR) Enable De-emphasis Filter */ #define CLASSD_INTPMR_DEEMP_DISABLED (0x0u << 18) /**< \brief (CLASSD_INTPMR) De-emphasis filter is disabled */ #define CLASSD_INTPMR_DEEMP_ENABLED (0x1u << 18) /**< \brief (CLASSD_INTPMR) De-emphasis filter is enabled */ #define CLASSD_INTPMR_SWAP (0x1u << 19) /**< \brief (CLASSD_INTPMR) Swap Left and Right Channels */ #define CLASSD_INTPMR_SWAP_LEFT_ON_LSB (0x0u << 19) /**< \brief (CLASSD_INTPMR) Left channel is on CLASSD_THR[15:0], right channel is on CLASSD_THR[31:16] */ #define CLASSD_INTPMR_SWAP_RIGHT_ON_LSB (0x1u << 19) /**< \brief (CLASSD_INTPMR) Right channel is on CLASSD_THR[15:0], left channel is on CLASSD_THR[31:16] */ #define CLASSD_INTPMR_FRAME_Pos 20 #define CLASSD_INTPMR_FRAME_Msk (0x7u << CLASSD_INTPMR_FRAME_Pos) /**< \brief (CLASSD_INTPMR) CLASSD Incoming Data Sampling Frequency */ #define CLASSD_INTPMR_FRAME(value) ((CLASSD_INTPMR_FRAME_Msk & ((value) << CLASSD_INTPMR_FRAME_Pos))) #define CLASSD_INTPMR_FRAME_FRAME_8K (0x0u << 20) /**< \brief (CLASSD_INTPMR) 8 kHz */ #define CLASSD_INTPMR_FRAME_FRAME_16K (0x1u << 20) /**< \brief (CLASSD_INTPMR) 16 kHz */ #define CLASSD_INTPMR_FRAME_FRAME_32K (0x2u << 20) /**< \brief (CLASSD_INTPMR) 32 kHz */ #define CLASSD_INTPMR_FRAME_FRAME_48K (0x3u << 20) /**< \brief (CLASSD_INTPMR) 48 kHz */ #define CLASSD_INTPMR_FRAME_FRAME_96K (0x4u << 20) /**< \brief (CLASSD_INTPMR) 96 kHz */ #define CLASSD_INTPMR_FRAME_FRAME_22K (0x5u << 20) /**< \brief (CLASSD_INTPMR) 22.05 kHz */ #define CLASSD_INTPMR_FRAME_FRAME_44K (0x6u << 20) /**< \brief (CLASSD_INTPMR) 44.1 kHz */ #define CLASSD_INTPMR_FRAME_FRAME_88K (0x7u << 20) /**< \brief (CLASSD_INTPMR) 88.2 kHz */ #define CLASSD_INTPMR_EQCFG_Pos 24 #define CLASSD_INTPMR_EQCFG_Msk (0xfu << CLASSD_INTPMR_EQCFG_Pos) /**< \brief (CLASSD_INTPMR) Equalization Selection */ #define CLASSD_INTPMR_EQCFG(value) ((CLASSD_INTPMR_EQCFG_Msk & ((value) << CLASSD_INTPMR_EQCFG_Pos))) #define CLASSD_INTPMR_EQCFG_FLAT (0x0u << 24) /**< \brief (CLASSD_INTPMR) Flat Response */ #define CLASSD_INTPMR_EQCFG_BBOOST12 (0x1u << 24) /**< \brief (CLASSD_INTPMR) Bass boost +12 dB */ #define CLASSD_INTPMR_EQCFG_BBOOST6 (0x2u << 24) /**< \brief (CLASSD_INTPMR) Bass boost +6 dB */ #define CLASSD_INTPMR_EQCFG_BCUT12 (0x3u << 24) /**< \brief (CLASSD_INTPMR) Bass cut -12 dB */ #define CLASSD_INTPMR_EQCFG_BCUT6 (0x4u << 24) /**< \brief (CLASSD_INTPMR) Bass cut -6 dB */ #define CLASSD_INTPMR_EQCFG_MBOOST3 (0x5u << 24) /**< \brief (CLASSD_INTPMR) Medium boost +3 dB */ #define CLASSD_INTPMR_EQCFG_MBOOST8 (0x6u << 24) /**< \brief (CLASSD_INTPMR) Medium boost +8 dB */ #define CLASSD_INTPMR_EQCFG_MCUT3 (0x7u << 24) /**< \brief (CLASSD_INTPMR) Medium cut -3 dB */ #define CLASSD_INTPMR_EQCFG_MCUT8 (0x8u << 24) /**< \brief (CLASSD_INTPMR) Medium cut -8 dB */ #define CLASSD_INTPMR_EQCFG_TBOOST12 (0x9u << 24) /**< \brief (CLASSD_INTPMR) Treble boost +12 dB */ #define CLASSD_INTPMR_EQCFG_TBOOST6 (0xAu << 24) /**< \brief (CLASSD_INTPMR) Treble boost +6 dB */ #define CLASSD_INTPMR_EQCFG_TCUT12 (0xBu << 24) /**< \brief (CLASSD_INTPMR) Treble cut -12 dB */ #define CLASSD_INTPMR_EQCFG_TCUT6 (0xCu << 24) /**< \brief (CLASSD_INTPMR) Treble cut -6 dB */ #define CLASSD_INTPMR_MONO (0x1u << 28) /**< \brief (CLASSD_INTPMR) Mono Signal */ #define CLASSD_INTPMR_MONO_DISABLED (0x0u << 28) /**< \brief (CLASSD_INTPMR) The signal is sent stereo to the left and right channels. */ #define CLASSD_INTPMR_MONO_ENABLED (0x1u << 28) /**< \brief (CLASSD_INTPMR) The same signal is sent on both left and right channels. The sent signal is defined by the MONOMODE field value. */ #define CLASSD_INTPMR_MONOMODE_Pos 29 #define CLASSD_INTPMR_MONOMODE_Msk (0x3u << CLASSD_INTPMR_MONOMODE_Pos) /**< \brief (CLASSD_INTPMR) Mono Mode Selection */ #define CLASSD_INTPMR_MONOMODE(value) ((CLASSD_INTPMR_MONOMODE_Msk & ((value) << CLASSD_INTPMR_MONOMODE_Pos))) #define CLASSD_INTPMR_MONOMODE_MONOMIX (0x0u << 29) /**< \brief (CLASSD_INTPMR) (left + right) / 2 is sent on both channels */ #define CLASSD_INTPMR_MONOMODE_MONOSAT (0x1u << 29) /**< \brief (CLASSD_INTPMR) (left + right) is sent to both channels. If the sum is too high, the result is saturated. */ #define CLASSD_INTPMR_MONOMODE_MONOLEFT (0x2u << 29) /**< \brief (CLASSD_INTPMR) THR[15:0] is sent on both left and right channels */ #define CLASSD_INTPMR_MONOMODE_MONORIGHT (0x3u << 29) /**< \brief (CLASSD_INTPMR) THR[31:16] is sent on both left and right channels */ /* -------- CLASSD_INTSR : (CLASSD Offset: 0x0C) Interpolator Status Register -------- */ #define CLASSD_INTSR_CFGERR (0x1u << 0) /**< \brief (CLASSD_INTSR) Configuration Error */ /* -------- CLASSD_THR : (CLASSD Offset: 0x10) Transmit Holding Register -------- */ #define CLASSD_THR_LDATA_Pos 0 #define CLASSD_THR_LDATA_Msk (0xffffu << CLASSD_THR_LDATA_Pos) /**< \brief (CLASSD_THR) Left Channel Data */ #define CLASSD_THR_LDATA(value) ((CLASSD_THR_LDATA_Msk & ((value) << CLASSD_THR_LDATA_Pos))) #define CLASSD_THR_RDATA_Pos 16 #define CLASSD_THR_RDATA_Msk (0xffffu << CLASSD_THR_RDATA_Pos) /**< \brief (CLASSD_THR) Right Channel Data */ #define CLASSD_THR_RDATA(value) ((CLASSD_THR_RDATA_Msk & ((value) << CLASSD_THR_RDATA_Pos))) /* -------- CLASSD_IER : (CLASSD Offset: 0x14) Interrupt Enable Register -------- */ #define CLASSD_IER_DATRDY (0x1u << 0) /**< \brief (CLASSD_IER) Data Ready */ /* -------- CLASSD_IDR : (CLASSD Offset: 0x18) Interrupt Disable Register -------- */ #define CLASSD_IDR_DATRDY (0x1u << 0) /**< \brief (CLASSD_IDR) Data Ready */ /* -------- CLASSD_IMR : (CLASSD Offset: 0x1C) Interrupt Mask Register -------- */ #define CLASSD_IMR_DATRDY (0x1u << 0) /**< \brief (CLASSD_IMR) Data Ready */ /* -------- CLASSD_ISR : (CLASSD Offset: 0x20) Interrupt Status Register -------- */ #define CLASSD_ISR_DATRDY (0x1u << 0) /**< \brief (CLASSD_ISR) Data Ready */ /* -------- CLASSD_WPMR : (CLASSD Offset: 0xE4) Write Protection Mode Register -------- */ #define CLASSD_WPMR_WPEN (0x1u << 0) /**< \brief (CLASSD_WPMR) Write Protection Enable */ #define CLASSD_WPMR_WPKEY_Pos 8 #define CLASSD_WPMR_WPKEY_Msk (0xffffffu << CLASSD_WPMR_WPKEY_Pos) /**< \brief (CLASSD_WPMR) Write Protection Key */ #define CLASSD_WPMR_WPKEY(value) ((CLASSD_WPMR_WPKEY_Msk & ((value) << CLASSD_WPMR_WPKEY_Pos))) #define CLASSD_WPMR_WPKEY_PASSWD (0x434C44u << 8) /**< \brief (CLASSD_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ /* -------- CLASSD_VERSION : (CLASSD Offset: 0xFC) IP Version Register -------- */ #define CLASSD_VERSION_VERSION_Pos 0 #define CLASSD_VERSION_VERSION_Msk (0xfffu << CLASSD_VERSION_VERSION_Pos) /**< \brief (CLASSD_VERSION) Version of the Hardware Module */ #define CLASSD_VERSION_MFN_Pos 16 #define CLASSD_VERSION_MFN_Msk (0x7u << CLASSD_VERSION_MFN_Pos) /**< \brief (CLASSD_VERSION) Metal Fix Number */ /*@}*/ #endif /* _SAMA5D2_CLASSD_COMPONENT_ */
{ "pile_set_name": "Github" }
/* * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package sun.tools.tree; import sun.tools.java.*; import sun.tools.asm.Assembler; import sun.tools.asm.Label; /** * WARNING: The contents of this source file are not part of any * supported API. Code that depends on them does so at its own risk: * they are subject to change or removal without notice. */ public class NotEqualExpression extends BinaryEqualityExpression { /** * constructor */ public NotEqualExpression(long where, Expression left, Expression right) { super(NE, where, left, right); } /** * Evaluate */ Expression eval(int a, int b) { return new BooleanExpression(where, a != b); } Expression eval(long a, long b) { return new BooleanExpression(where, a != b); } Expression eval(float a, float b) { return new BooleanExpression(where, a != b); } Expression eval(double a, double b) { return new BooleanExpression(where, a != b); } Expression eval(boolean a, boolean b) { return new BooleanExpression(where, a != b); } /** * Simplify */ Expression simplify() { if (left.isConstant() && !right.isConstant()) { return new NotEqualExpression(where, right, left); } return this; } /** * Code */ void codeBranch(Environment env, Context ctx, Assembler asm, Label lbl, boolean whenTrue) { left.codeValue(env, ctx, asm); switch (left.type.getTypeCode()) { case TC_BOOLEAN: case TC_INT: if (!right.equals(0)) { right.codeValue(env, ctx, asm); asm.add(where, whenTrue ? opc_if_icmpne : opc_if_icmpeq, lbl, whenTrue); return; } break; case TC_LONG: right.codeValue(env, ctx, asm); asm.add(where, opc_lcmp); break; case TC_FLOAT: right.codeValue(env, ctx, asm); asm.add(where, opc_fcmpl); break; case TC_DOUBLE: right.codeValue(env, ctx, asm); asm.add(where, opc_dcmpl); break; case TC_ARRAY: case TC_CLASS: case TC_NULL: if (right.equals(0)) { asm.add(where, whenTrue ? opc_ifnonnull : opc_ifnull, lbl, whenTrue); } else { right.codeValue(env, ctx, asm); asm.add(where, whenTrue ? opc_if_acmpne : opc_if_acmpeq, lbl, whenTrue); } return; default: throw new CompilerError("Unexpected Type"); } asm.add(where, whenTrue ? opc_ifne : opc_ifeq, lbl, whenTrue); } }
{ "pile_set_name": "Github" }
#~ Copyright 2002-2007 Rene Rivera. #~ 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) # Clean env vars of any "extra" empty values. for local v in ARGV CC CFLAGS LIBS { local values ; for local x in $($(v)) { if $(x) != "" { values += $(x) ; } } $(v) = $(values) ; } # Platform related specifics. if $(OS) = NT { rule .path { return "$(<:J=\\)" ; } ./ = "/" ; } else { rule .path { return "$(<:J=/)" ; } } . = "." ; ./ ?= "" ; # Info about what we are building. _VERSION_ = 3 1 19 ; NAME = boost-jam ; VERSION = $(_VERSION_:J=$(.)) ; RELEASE = 1 ; LICENSE = LICENSE_1_0 ; # Generate development debug binaries? if --debug in $(ARGV) { debug = true ; } if --profile in $(ARGV) { profile = true ; } # Attempt to generate and/or build the grammar? if --grammar in $(ARGV) { grammar = true ; } # Do we need to add a default build type argument? if ! ( --release in $(ARGV) ) && ! ( --debug in $(ARGV) ) && ! ( --profile in $(ARGV) ) { ARGV += --release ; } # Enable, and configure, Python hooks. with-python = ; python-location = [ MATCH --with-python=(.*) : $(ARGV) ] ; if $(python-location) { with-python = true ; } if $(with-python) { if $(OS) = NT { --python-include = [ .path $(python-location) include ] ; --python-lib = ; for local v in 27 26 25 24 23 22 { --python-lib ?= [ GLOB [ .path $(python-location) libs ] : "python$(v).lib" ] [ GLOB $(python-location) [ .path $(python-location) libs ] $(Path) $(PATH) $(path) : "python$(v).dll" ] ; if ! $(--python-lib[2]) { --python-lib = ; } } --python-lib = $(--python-lib[1]) ; } else if $(OS) = MACOSX { --python-include = [ .path $(python-location) Headers ] ; --python-lib = $(python-location) Python ; } else { --python-include = ; --python-lib = ; for local v in 2.7 2.6 2.5 2.4 2.3 2.2 { local inc = [ GLOB [ .path $(python-location) include ] : python$(v) ] ; local lib = [ GLOB [ .path $(python-location) lib ] : libpython$(v)* ] ; if $(inc) && $(lib) { --python-include ?= $(inc) ; --python-lib ?= $(lib[1]:D) python$(v) ; } } } } if $(--python-include) || $(--python-lib) { ECHO "Python includes: $(--python-include:J=)" ; ECHO "Python includes: $(--python-lib:J=)" ; } # Boehm GC? if --gc in $(ARGV) { --boehm-gc = true ; } if $(--boehm-gc) { --extra-include += [ .path [ PWD ] "boehm_gc" "include" ] ; } # Duma? if --duma in $(ARGV) { --duma = true ; } if $(--duma) { --extra-include += [ .path [ PWD ] "duma" ] ; } # An explicit root for the toolset? (trim spaces) toolset-root = [ MATCH --toolset-root=(.*) : $(ARGV) ] ; { local t = [ MATCH "[ ]*(.*)" : $(toolset-root:J=" ") ] ; toolset-root = ; while $(t) { t = [ MATCH "([^ ]+)([ ]*)(.*)" : $(t) ] ; toolset-root += $(t[1]) ; if $(t[3]) { toolset-root += $(t[2]) ; } t = $(t[3]) ; } toolset-root = $(toolset-root:J="") ; } # Configure the implemented toolsets. These are minimal commands and options to # compile the full Jam. When adding new toolsets make sure to add them to the # "known" list also. rule toolset ( name command .type ? : opt.out + : opt.define * : flags * : linklibs * ) { .type ?= "" ; tool.$(name)$(.type).cc ?= $(command) ; tool.$(name)$(.type).opt.out ?= $(opt.out) ; tool.$(name)$(.type).opt.define ?= $(opt.define) ; tool.$(name)$(.type).flags ?= $(flags) ; tool.$(name)$(.type).linklibs ?= $(linklibs) ; if ! $(name) in $(toolsets) { toolsets += $(name) ; } } rule if-os ( os + : yes-opt * : no-opt * ) { if $(os) in $(OS) { return $(yes-opt) ; } else { return $(no-opt) ; } } rule opt ( type : yes-opt * : no-opt * ) { if $(type) in $(ARGV) { return $(yes-opt) ; } else { return $(no-opt) ; } } ## HP-UX aCC compiler toolset acc cc : "-o " : -D : -Ae [ opt --release : -s -O3 ] [ opt --debug : -g -pg ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Borland C++ 5.5.x toolset borland bcc32 : -e -n : /D : -WC -w- -q "-I$(toolset-root)Include" "-L$(toolset-root)Lib" [ opt --release : -O2 -vi -w-inl ] [ opt --debug : -v -Od -vi- ] -I$(--python-include) -I$(--extra-include) : $(--python-lib[1]) ; ## Generic Unix cc if ! $(CC) { CC = cc ; } toolset cc $(CC) : "-o " : -D : $(CFLAGS) [ opt --release : -s -O ] [ opt --debug : -g ] -I$(--python-include) -I$(--extra-include) : $(LIBS) -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Comeau C/C++ 4.x toolset como como : "-o " : -D : --c [ opt --release : --inlining ] [ opt --debug : --no_inlining ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Clang Linux 2.8+ toolset clang clang : "-o " : -D : -Wno-unused -Wno-format [ opt --release : -Os ] [ opt --debug : -g -O0 -fno-inline ] [ opt --profile : -finline-functions -g ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## MacOSX Darwin, using GCC 2.9.x, 3.x toolset darwin cc : "-o " : -D : [ opt --release : -Wl,-x -O3 -finline-functions ] [ opt --debug : -g -O0 -fno-inline -pg ] [ opt --profile : -Wl,-x -O3 -finline-functions -g -pg ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## GCC 2.x, 3.x, 4.x toolset gcc gcc : "-o " : -D : -pedantic -fno-strict-aliasing [ opt --release : [ opt --symbols : -g : -s ] -O3 ] [ opt --debug : -g -O0 -fno-inline ] [ opt --profile : -O3 -g -pg ] -I$(--python-include) -I$(--extra-include) -Wno-long-long : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## GCC 2.x, 3.x on CYGWIN but without cygwin1.dll toolset gcc-nocygwin gcc : "-o " : -D : -s -O3 -mno-cygwin [ opt --release : -finline-functions ] [ opt --debug : -s -O3 -fno-inline -pg ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Intel C/C++ for Darwin toolset intel-darwin icc : "-o " : -D : [ opt --release : -O3 ] [ opt --debug : -g -O0 -p ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Intel C/C++ for Linux toolset intel-linux icc : "-o " : -D : [ opt --release : -Xlinker -s -O3 ] [ opt --debug : -g -O0 -p ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Intel C/C++ for Win32 toolset intel-win32 icl : /Fe : -D : /nologo [ opt --release : /MT /O2 /Ob2 /Gy /GF /GA /GB ] [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 ] -I$(--python-include) -I$(--extra-include) : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; ## KCC ? toolset kcc KCC : "-o " : -D : [ opt --release : -s +K2 ] [ opt --debug : -g +K0 ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Borland Kylix toolset kylix bc++ : -o : -D : -tC -q [ opt --release : -O2 -vi -w-inl ] [ opt --debug : -v -Od -vi- ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Metrowerks CodeWarrior 8.x { # Even though CW can compile all files at once, it crashes if it tries in # the bjam case. local mwcc ; if $(OS) != NT { mwcc = mwc$(OSPLAT:L) ; } mwcc ?= mwcc ; toolset metrowerks $(mwcc) : "-o " : -D : -c -lang c -subsystem console -cwd include [ opt --release : -runtime ss -opt full -inline all ] [ opt --debug : -runtime ssd -opt none -inline off ] -I$(--python-include) -I$(--extra-include) ; toolset metrowerks $(mwcc) .link : "-o " : : -subsystem console -lkernel32.lib -ladvapi32.lib -luser32.lib [ opt --release : -runtime ss ] [ opt --debug : -runtime ssd ] : $(--python-lib[1]) ; } ## MINGW GCC toolset mingw gcc : "-o " : -D : [ opt --release : -s -O3 -finline-functions ] [ opt --debug : -g -O0 -fno-inline -pg ] -I$(--python-include) -I$(--extra-include) : $(--python-lib[2]) ; ## MIPS Pro toolset mipspro cc : "-o " : -D : [ opt --release : -s -O3 -g0 -INLINE:none ] [ opt --debug : -g -O0 -INLINE ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Microsoft Visual Studio C++ 6.x toolset msvc cl : /Fe /Fe /Fd /Fo : -D : /nologo [ opt --release : /ML /O2 /Ob2 /Gy /GF /GA /GB ] [ opt --debug : /MLd /DEBUG /Z7 /Od /Ob0 ] -I$(--python-include) -I$(--extra-include) : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; ## QNX 6.x GCC 3.x/2.95.3 toolset qcc qcc : "-o " : -D : -Wc,-pedantic -Wc,-fno-strict-aliasing [ opt --release : [ opt --symbols : -g ] -O3 -Wc,-finline-functions ] [ opt --debug : -g -O0 -Wc,-fno-inline ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Qlogic Pathscale 2.4 toolset pathscale pathcc : "-o " : -D : [ opt --release : -s -Ofast -O3 ] [ opt --debug : -g ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Portland Group Pgi 6.2 toolset pgi pgcc : "-o " : -D : [ opt --release : -s -O3 ] [ opt --debug : -g ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Sun Workshop 6 C++ toolset sun cc : "-o " : -D : [ opt --release : -s -xO3 ] [ opt --debug : -g ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Sun Workshop 6 C++ (old alias) toolset sunpro cc : "-o " : -D : [ opt --release : -s -xO3 ] [ opt --debug : -g ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Compaq Alpha CXX toolset tru64cxx cc : "-o " : -D : [ opt --release : -s -O5 -inline speed ] [ opt --debug : -g -O0 -pg ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## IBM VisualAge C++ or IBM XL C/C++ for Aix or IBM XL C/C++ for Linux (Big endian) toolset vacpp xlc : "-o " : -D : [ opt --release : -s -O3 -qstrict -qinline ] [ opt --debug : -g -qNOOPTimize -qnoinline -pg ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) [ if-os AIX : -bmaxdata:0x40000000 ] ; ## IBM XL C/C++ for Linux (little endian) toolset xlcpp xlC : "-o " : -D : -Wno-unused -Wno-format [ opt --release : -s ] [ opt --debug : -g -qNOOPTimize -qnoinline -pg ] -I$(--python-include) -I$(--extra-include) : -L$(--python-lib[1]) -l$(--python-lib[2]) ; ## Microsoft Visual C++ .NET 7.x toolset vc7 cl : /Fe /Fe /Fd /Fo : -D : /nologo [ opt --release : /ML /O2 /Ob2 /Gy /GF /GA /GB ] [ opt --debug : /MLd /DEBUG /Z7 /Od /Ob0 ] -I$(--python-include) -I$(--extra-include) : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; ## Microsoft Visual C++ 2005 toolset vc8 cl : /Fe /Fe /Fd /Fo : -D : /nologo [ opt --release : /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ] [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ] -I$(--python-include) -I$(--extra-include) : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; ## Microsoft Visual C++ 2008 toolset vc9 cl : /Fe /Fe /Fd /Fo : -D : /nologo [ opt --release : /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ] [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ] -I$(--python-include) -I$(--extra-include) : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; ## Microsoft Visual C++ 2010 toolset vc10 cl : /Fe /Fe /Fd /Fo : -D : /nologo [ opt --release : /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ] [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ] -I$(--python-include) -I$(--extra-include) : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; ## Microsoft Visual C++ 2012 toolset vc11 cl : /Fe /Fe /Fd /Fo : -D : /nologo [ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ] [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ] -I$(--python-include) -I$(--extra-include) : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; ## Microsoft Visual C++ 2013 toolset vc12 cl : /Fe /Fe /Fd /Fo : -D : /nologo [ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ] [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ] -I$(--python-include) -I$(--extra-include) : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; toolset vc14 cl : /Fe /Fe /Fd /Fo : -D : /nologo [ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ] [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ] -I$(--python-include) -I$(--extra-include) : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; # First set the build commands and options according to the # preset toolset. toolset = [ MATCH --toolset=(.*) : $(ARGV) ] ; if ! $(toolset) { # For some reason, the following test does not catch empty toolset. ECHO "###" ; ECHO "###" No toolset specified. Please use --toolset option. ; ECHO "###" ; ECHO "###" Known toolsets are: $(toolsets:J=", ") ; EXIT "###" ; } if ! $(toolset) in $(toolsets) { ECHO "###" ; ECHO "###" Unknown toolset: $(toolset) ; ECHO "###" ; ECHO "###" Known toolsets are: $(toolsets:J=", ") ; EXIT "###" ; } --cc = $(tool.$(toolset).cc) ; if $(tool.$(toolset).opt.out[2]) { if $(tool.$(toolset).opt.out[1]) = $(tool.$(toolset).opt.out[2]) { --out = $(tool.$(toolset).opt.out[1]) ; --dir = $(tool.$(toolset).opt.out[3-]) ; } else { --bin = $(tool.$(toolset).opt.out[1]) ; --dir = $(tool.$(toolset).opt.out[2-]) ; } } else { --out = $(tool.$(toolset).opt.out) ; } --def = $(tool.$(toolset).opt.define) ; --flags = $(tool.$(toolset).flags) ; --defs = $(tool.$(toolset).defines) ; --libs = $(tool.$(toolset).linklibs) ; if $(tool.$(toolset).link.cc) { --link = $(tool.$(toolset).link.cc) ; if $(tool.$(toolset).link.opt.out[2]) { if $(tool.$(toolset).link.opt.out[1]) = $(tool.$(toolset).link.opt.out[2]) { --link-out = $(tool.$(toolset).link.opt.out[1]) ; --link-dir = $(tool.$(toolset).link.opt.out[3-]) ; } else { --link-bin = $(tool.$(toolset).link.opt.out[1]) ; --link-dir = $(tool.$(toolset).link.opt.out[2-]) ; } } else { --link-out = $(tool.$(toolset).link.opt.out) ; } --link-def = $(tool.$(toolset).link.opt.define) ; --link-flags = $(tool.$(toolset).link.flags) ; --link-defs = $(tool.$(toolset).link.defines) ; --link-libs = $(tool.$(toolset).link.linklibs) ; } # Put executables in platform-specific subdirectory. locate-target = $(LOCATE_TARGET) ; if $(OSPLAT) { locate-target ?= bin$(.)$(OS:L)$(OSPLAT:L) ; platform = $(OS:L)$(OSPLAT:L) ; } else { locate-target ?= bin$(.)$(OS:L) ; platform = $(OS:L) ; } if $(debug) { locate-target = [ .path $(locate-target)$(.)debug ] ; } if $(profile) { locate-target = [ .path $(locate-target)$(.)profile ] ; } else { locate-target = [ .path $(locate-target) ] ; } if --show-locate-target in $(ARGV) { ECHO $(locate-target) ; } # We have some different files for UNIX, and NT. jam.source = command.c compile.c constants.c debug.c execcmd.c frames.c function.c glob.c hash.c hcache.c headers.c hdrmacro.c jam.c jambase.c jamgram.c lists.c make.c make1.c mem.c object.c option.c output.c parse.c pathsys.c regexp.c rules.c scan.c search.c subst.c w32_getreg.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c class.c cwd.c native.c md5.c [ .path modules set.c ] [ .path modules path.c ] [ .path modules regex.c ] [ .path modules property-set.c ] [ .path modules sequence.c ] [ .path modules order.c ] ; if $(OS) = NT { jam.source += execnt.c filent.c pathnt.c ; } else { jam.source += execunix.c fileunix.c pathunix.c ; } # Debug assertions, or not. if ! $(debug) || --noassert in $(ARGV) { --defs += NDEBUG ; } # Enable some optional features. --defs += OPT_HEADER_CACHE_EXT ; --defs += OPT_GRAPH_DEBUG_EXT ; --defs += OPT_SEMAPHORE ; --defs += OPT_AT_FILES ; --defs += OPT_DEBUG_PROFILE ; # Bug fixes --defs += OPT_FIX_TARGET_VARIABLES_EXT ; #~ --defs += OPT_NO_EXTERNAL_VARIABLE_SPLIT ; # Improvements --defs += OPT_IMPROVED_PATIENCE_EXT ; # Use Boehm GC memory allocator? if $(--boehm-gc) { --defs += OPT_BOEHM_GC ; if $(debug) { --defs += GC_DEBUG ; } } if $(--duma) { --defs += OPT_DUMA ; } if ( $(OS) = NT ) && ! NT in $(--defs) { --defs += NT ; } --defs += YYSTACKSIZE=5000 ; if $(with-python) { --defs += HAVE_PYTHON ; } if $(debug) { --defs += BJAM_NEWSTR_NO_ALLOCATE ; } # The basic symbolic targets... NOTFILE all clean dist ; ALWAYS clean ; # Utility rules and actions... rule .clean { [DELETE] clean : $(<) ; } if $(OS) = NT { actions piecemeal together existing [DELETE] { del /F /Q "$(>)" } } if $(UNIX) = true { actions piecemeal together existing [DELETE] { rm -f "$(>)" } } if $(OS) = NT { --chmod+w = "attrib -r " ; } if $(UNIX) = true { --chmod+w = "chmod +w " ; } rule .mkdir { NOUPDATE $(<) ; if $(<:P) { DEPENDS $(<) : $(<:P) ; .mkdir $(<:P) ; } if ! $(md<$(<)>) { [MKDIR] $(<) ; md<$(<)> = - ; } } if $(OS) = NT { actions [MKDIR] { md "$(<)" } } if $(UNIX) = true { actions [MKDIR] { mkdir "$(<)" } } rule .exe { local exe = $(<) ; if $(OS) = NT || ( $(UNIX) = true && $(OS) = CYGWIN ) { exe = $(exe:S=.exe) ; } LOCATE on $(exe) = $(locate-target) ; DEPENDS all : $(exe) ; .mkdir $(locate-target) ; if $(--link) { local objs ; for local s in $(>) { # Translate any subdir elements into a simple file name. local o = [ MATCH "([^/]+)[/]?(.+)" : $(s) ] ; o = $(o:J=_) ; o = $(o:S=.o) ; objs += $(o) ; LOCATE on $(o) = $(locate-target) ; DEPENDS $(exe) : $(o) ; DEPENDS $(o) : $(s) ; DEPENDS $(o) : $(locate-target) ; [COMPILE] $(o) : $(s) ; .clean $(o) ; } DEPENDS $(exe) : $(objs) ; DEPENDS $(exe) : $(locate-target) ; [COMPILE.LINK] $(exe) : $(objs) ; .clean $(exe) ; } else { DEPENDS $(exe) : $(>) ; DEPENDS $(exe) : $(locate-target) ; [COMPILE] $(exe) : $(>) ; .clean $(exe) ; } return $(exe) ; } if ! $(--def[2]) { actions [COMPILE] { "$(--cc)" "$(--bin)$(<:D=)" "$(--dir)$(<:D)$(./)" $(--out)$(<) "$(--def)$(--defs)" "$(--flags)" "$(>)" "$(--libs)" } } else { actions [COMPILE] { "$(--cc)" "$(--bin)$(<:D=)" "$(--dir)$(<:D)$(./)" $(--out)$(<) "$(--def[1])$(--defs:J=$(--def[2]))$(--def[3])" "$(--flags)" "$(>)" "$(--libs)" } } actions [COMPILE.LINK] { "$(--link)" "$(--link-bin)$(<:D=)" "$(--link-dir)$(<:D)$(./)" "$(--link-out)$(<)" "$(--link-def)$(--link-defs)" "$(--link-flags)" "$(>)" "$(--link-libs)" } rule .link { DEPENDS all : $(<) ; DEPENDS $(<) : $(>) ; [LINK] $(<) : $(>) ; .clean $(<) ; } if $(OS) = NT { actions [LINK] { copy "$(>)" "$(<)" } } if $(UNIX) = true { actions [LINK] { ln -fs "$(>)" "$(<)" } } rule .copy { DEPENDS all : $(<) ; DEPENDS $(<) : $(>) ; [COPY] $(<) : $(>) ; .clean $(<) ; } # Will be redefined later. actions [COPY] { } rule .move { DEPENDS $(<) : $(>) ; [MOVE] $(<) : $(>) ; } if $(OS) = NT { actions [MOVE] { del /f "$(<)" rename "$(>)" "$(<)" } } if $(UNIX) = true { actions [MOVE] { mv -f "$(>)" "$(<)" } } # Generate the grammar tokens table, and the real yacc grammar. rule .yyacc { local exe = [ .exe yyacc : yyacc.c ] ; NOUPDATE $(exe) ; DEPENDS $(<) : $(exe) $(>) ; LEAVES $(<) ; yyacc.exe on $(<) = $(exe:R=$(locate-target)) ; [YYACC] $(<) : $(>) ; } actions [YYACC] { $(--chmod+w)$(<[1]) $(--chmod+w)$(<[2]) "$(yyacc.exe)" "$(<)" "$(>)" } if $(grammar) { .yyacc jamgram.y jamgramtab.h : jamgram.yy ; } else if $(debug) { .exe yyacc : yyacc.c ; } # How to build the grammar. if $(OS) = NT { SUFEXE = .exe ; # try some other likely spellings... PATH ?= $(Path) ; PATH ?= $(path) ; } SUFEXE ?= "" ; yacc ?= [ GLOB $(PATH) : yacc$(SUFEXE) ] ; yacc ?= [ GLOB $(PATH) : bison$(SUFEXE) ] ; yacc ?= [ GLOB "$(ProgramFiles:J= )\\GnuWin32\\bin" "C:\\Program Files\\GnuWin32\\bin" : bison$(SUFEXE) ] ; yacc = $(yacc[1]) ; switch $(yacc:D=:S=) { case bison : yacc += -d --yacc ; case yacc : yacc += -d ; } if $(debug) && $(yacc) { yacc += -t -v ; } yacc += $(YACCFLAGS) ; rule .yacc { DEPENDS $(<) : $(>) ; LEAVES $(<) ; [YACC] $(<) : $(>) ; } if $(OS) = NT { actions [YACC] { "$(yacc)" "$(>)" if not errorlevel 1 ( del /f "$(<[1])" rename y.tab$(<[1]:S) "$(<[1])" del /f $(<[2]) rename y.tab$(<[2]:S) "$(<[2])" ) else set _error_ = } } if $(UNIX) = true { actions [YACC] { if ` "$(yacc)" "$(>)" ` ; then mv -f y.tab$(<[1]:S) "$(<[1])" mv -f y.tab$(<[2]:S) "$(<[2])" else exit 1 fi } } if $(grammar) && ! $(yacc) { EXIT Could not find the 'yacc' tool, and therefore can not build the grammar. ; } if $(grammar) && $(yacc) { .yacc jamgram.c jamgram.h : jamgram.y ; } # How to build the compiled in jambase. rule .mkjambase { local exe = [ .exe mkjambase : mkjambase.c ] ; DEPENDS $(<) : $(exe) $(>) ; LEAVES $(<) ; mkjambase.exe on $(<) = $(exe:R=$(locate-target)) ; [MKJAMBASE] $(<) : $(>) ; } actions [MKJAMBASE] { $(--chmod+w)$(<) $(mkjambase.exe) "$(<)" "$(>)" } if $(debug) { .mkjambase jambase.c : Jambase ; } # How to build Jam. rule .jam { $(>).exe = [ .exe $(>) : $(jam.source) ] ; DEPENDS all : $($(>).exe) ; # Make a copy under the old name. $(<).exe = $(<:S=$($(>).exe:S)) ; LOCATE on $($(<).exe) = $(locate-target) ; .copy $($(<).exe) : $($(>).exe) ; DEPENDS all : $($(<).exe) ; } .jam bjam : b2 ; # Scan sources for header dependencies. # # In order to keep things simple, we made a slight compromise here - we only # detect changes in headers included relative to the current folder as opposed # to those included from somewhere on the include path. rule .scan ( targets + ) { HDRRULE on $(targets) = .hdr.scan ; HDRSCAN on $(targets) = "^[ \t]*#[ \t]*include[ \t]*\"([^\"]*)\".*$" ; } rule .hdr.scan ( target : includes * : binding ) { local target-path = [ NORMALIZE_PATH $(binding:D) ] ; # Extra grist provides target name uniqueness when referencing same name # header files from different folders. local include-targets = <$(target-path)>$(includes) ; NOCARE $(include-targets) ; INCLUDES $(target) : $(include-targets) ; SEARCH on $(include-targets) = $(target-path) ; ISFILE $(include-targets) ; .scan $(include-targets) ; } .scan $(jam.source) ; # Distribution making from here on out. Assumes that the docs are already built # as HTML at ../doc/html. Otherwise they will not be included in the built # distribution archive. dist.license = [ GLOB . : $(LICENSE).txt ] ; dist.license = $(dist.license:D=) [ GLOB [ .path .. .. .. ] : $(LICENSE).txt ] [ GLOB [ .path .. boost ] : $(LICENSE).txt ] ; dist.docs = [ GLOB . : *.png *.css *.html ] ; dist.docs = $(dist.docs:D=) [ GLOB [ .path images ] : *.png ] [ GLOB [ .path jam ] : *.html ] ; dist.source = [ GLOB . : *.c *.h ] ; dist.source = $(dist.source:D=) $(dist.license[1]) $(dist.docs) build.jam build.bat build.sh Jambase jamgram.y jamgram.yy [ .path modules set.c ] [ .path modules path.c ] [ .path modules regex.c ] [ .path modules property-set.c ] [ .path modules sequence.c ] [ .path modules order.c ] [ GLOB [ .path boehm_gc ] : * ] [ GLOB [ .path boehm_gc include ] : * ] [ GLOB [ .path boehm_gc include private ] : * ] [ GLOB [ .path boehm_gc cord ] : * ] [ GLOB [ .path boehm_gc Mac_files ] : * ] [ GLOB [ .path boehm_gc tests ] : * ] [ GLOB [ .path boehm_gc doc ] : * ] ; dist.bin = bjam ; dist.bin = $(dist.license[1]) $(dist.bin:S=$(bjam.exe:S)) ; if $(OS) = NT { zip ?= [ GLOB "$(ProgramFiles:J= )\\7-ZIP" "C:\\Program Files\\7-ZIP" : "7z.exe" ] ; zip ?= [ GLOB "$(ProgramFiles:J= )\\7-ZIP" "C:\\Program Files\\7-ZIP" : "7zn.exe" ] ; zip ?= [ GLOB $(PATH) : zip.exe ] ; zip ?= zip ; zip = $(zip[1]) ; switch $(zip:D=:S=) { case 7z* : zip += a -r -tzip -mx=9 ; case zip : zip += -9r ; } actions piecemeal [PACK] { "$(zip)" "$(<)" "$(>)" } actions piecemeal [ZIP] { "$(zip)" "$(<)" "$(>)" } actions piecemeal [COPY] { copy /Y "$(>)" "$(<)" >NUL: } } if $(UNIX) = true { tar ?= [ GLOB $(PATH) : star bsdtar tar ] ; tar = $(tar[1]) ; switch $(tar:D=:S=) { case star : tar += -c artype=pax -D -d -to-stdout ; case * : tar += -c -f - ; } actions [PACK] { "$(tar)" "$(>)" | gzip -c9 > "$(<)" } #~ actions [PACK] { #~ tar cf "$(<:S=.tar)" "$(>)" #~ } actions [ZIP] { gzip -c9 "$(>)" > "$(<)" } actions [COPY] { cp -Rpf "$(>)" "$(<)" } } # The single binary, compressed. rule .binary { local zip ; if $(OS) = NT { zip = $($(<).exe:S=.zip) ; } if $(UNIX) = true { zip = $($(<).exe:S=.tgz) ; } zip = $(zip:S=)-$(VERSION)-$(RELEASE)-$(platform)$(zip:S) ; DEPENDS $(zip) : $($(<).exe) ; DEPENDS dist : $(zip) ; #~ LOCATE on $(zip) = $(locate-target) ; if $(OS) = NT { [ZIP] $(zip) : $($(<).exe) ; } if $(UNIX) = true { [PACK] $(zip) : $($(<).exe) ; } .clean $(zip) ; } # Package some file. rule .package ( dst-dir : src-files + ) { local dst-files ; local src-files-actual ; for local src-path in $(src-files) { if ! [ GLOB $(src-path:P) : $(src-path:B) ] || [ CHECK_IF_FILE $(src-path) ] { local src-subdir = $(src-path:D) ; local src-file = $(src-path) ; while $(src-subdir:D) { src-subdir = $(src-subdir:D) ; } if $(src-subdir) = ".." { src-file = $(src-file:D=) ; } dst-files += $(src-file:R=$(dst-dir)) ; src-files-actual += $(src-path) ; } } local pack ; if $(OS) = NT { pack = $(dst-dir).zip ; } if $(UNIX) = true { pack = $(dst-dir).tgz ; } DEPENDS dist : $(pack) ; DEPENDS $(pack) : $(dst-files) ; local dst-files-queue = $(dst-files) ; for local src-path in $(src-files-actual) { local dst-file = $(dst-files-queue[1]) ; dst-files-queue = $(dst-files-queue[2-]) ; DEPENDS $(dst-file) : $(src-path) $(dst-file:D) ; .mkdir $(dst-file:D) ; [COPY] $(dst-file) : $(src-path) ; .clean $(dst-file) ; } [PACK] $(pack) : $(dst-files) ; .clean $(pack) ; } # RPM distro file. rpm-tool = [ GLOB $(PATH) : "rpmbuild" ] ; rpm-tool ?= [ GLOB $(PATH) : "rpm" ] ; rpm-tool = $(rpm-tool[1]) ; rule .rpm ( name : source ) { local rpm-arch ; switch $(OSPLAT) { case X86 : rpm-arch ?= i386 ; case PPC : rpm-arch ?= ppc ; case AXP : rpm-arch ?= alpha ; # no guaranty for these: case IA64 : rpm-arch ?= ia64 ; case ARM : rpm-arch ?= arm ; case SPARC : rpm-arch ?= sparc ; case * : rpm-arch ?= other ; } local target = $(name)-rpm ; NOTFILE $(target) ; DEPENDS dist : $(target) ; DEPENDS $(target) : $(name).$(rpm-arch).rpm $(name).src.rpm ; DEPENDS $(name).$(rpm-arch).rpm : $(source) ; DEPENDS $(name).src.rpm : $(name).$(rpm-arch).rpm ; docs on $(target) = $(dist.docs:J=" ") ; arch on $(target) = $(rpm-arch) ; if $(rpm-arch) = ppc { target-opt on $(target) = --target= ; } else { target-opt on $(target) = "--target " ; } [RPM] $(target) : $(source) ; .clean $(name).$(rpm-arch).rpm $(name).src.rpm ; } actions [RPM] { set -e export BOOST_JAM_TOOLSET="$(toolset)" $(rpm-tool) -ta $(target-opt)$(arch) $(>) | tee rpm.out cp `grep -e '^Wrote:' rpm.out | sed 's/^Wrote: //'` . rm -f rpm.out } # The distribution targets. Do not bother with them unless this is a # distribution build. if dist in $(ARGV) { #~ .binary bjam ; .package $(NAME)-$(VERSION) : $(dist.source) ; .package $(NAME)-$(VERSION)-$(RELEASE)-$(platform) : $(dist.bin) ; if $(rpm-tool) { #~ .rpm $(NAME)-$(VERSION)-$(RELEASE) : $(NAME)-$(VERSION).tgz ; } }
{ "pile_set_name": "Github" }
--- title: SqlStreamChars.SetLength(Int64) Method (System.Data.SqlTypes) author: stevestein ms.author: sstein ms.date: 12/20/2018 ms.technology: "dotnet-data" topic_type: - "apiref" api_name: - "System.Data.SqlTypes.SqlStreamChars.SetLength" api_location: - "System.Data.dll" api_type: - "Assembly" --- # SqlStreamChars.SetLength(Int64) Method When overridden in a derived class, releases the resources used by the stream. The assembly that contains this method has a friend relationship with SQLAccess.dll. It's intended for use by SQL Server. For other databases, use the hosting mechanism provided by that database. ```csharp public abstract void SetLength (long value); ``` ## Parameters `value`\ The desired length of the current stream in bytes. ## Remarks > [!WARNING] > The `SqlStreamChars.SetLength` method is private and is not meant to be used directly in your code. > > Microsoft does not support the use of this method in a production application under any circumstance. ## Requirements **Namespace:** <xref:System.Data.SqlTypes> **Assembly:** System.Data (in System.Data.dll) **.NET Framework versions:** Available since 2.0.
{ "pile_set_name": "Github" }
package astits import ( "fmt" "github.com/asticode/go-astikit" ) // Stream types const ( StreamTypeLowerBitrateVideo = 27 // ITU-T Rec. H.264 and ISO/IEC 14496-10 StreamTypeMPEG1Audio = 3 // ISO/IEC 11172-3 StreamTypeMPEG2HalvedSampleRateAudio = 4 // ISO/IEC 13818-3 StreamTypeMPEG2PacketizedData = 6 // ITU-T Rec. H.222 and ISO/IEC 13818-1 i.e., DVB subtitles/VBI and AC-3 ) // PMTData represents a PMT data // https://en.wikipedia.org/wiki/Program-specific_information type PMTData struct { ElementaryStreams []*PMTElementaryStream PCRPID uint16 // The packet identifier that contains the program clock reference used to improve the random access accuracy of the stream's timing that is derived from the program timestamp. If this is unused. then it is set to 0x1FFF (all bits on). ProgramDescriptors []*Descriptor // Program descriptors ProgramNumber uint16 } // PMTElementaryStream represents a PMT elementary stream type PMTElementaryStream struct { ElementaryPID uint16 // The packet identifier that contains the stream type data. ElementaryStreamDescriptors []*Descriptor // Elementary stream descriptors StreamType uint8 // This defines the structure of the data contained within the elementary packet identifier. } // parsePMTSection parses a PMT section func parsePMTSection(i *astikit.BytesIterator, offsetSectionsEnd int, tableIDExtension uint16) (d *PMTData, err error) { // Create data d = &PMTData{ProgramNumber: tableIDExtension} // Get next bytes var bs []byte if bs, err = i.NextBytes(2); err != nil { err = fmt.Errorf("astits: fetching next bytes failed: %w", err) return } // PCR PID d.PCRPID = uint16(bs[0]&0x1f)<<8 | uint16(bs[1]) // Program descriptors if d.ProgramDescriptors, err = parseDescriptors(i); err != nil { err = fmt.Errorf("astits: parsing descriptors failed: %w", err) return } // Loop until end of section data is reached for i.Offset() < offsetSectionsEnd { // Create stream e := &PMTElementaryStream{} // Get next byte var b byte if b, err = i.NextByte(); err != nil { err = fmt.Errorf("astits: fetching next byte failed: %w", err) return } // Stream type e.StreamType = uint8(b) // Get next bytes if bs, err = i.NextBytes(2); err != nil { err = fmt.Errorf("astits: fetching next bytes failed: %w", err) return } // Elementary PID e.ElementaryPID = uint16(bs[0]&0x1f)<<8 | uint16(bs[1]) // Elementary descriptors if e.ElementaryStreamDescriptors, err = parseDescriptors(i); err != nil { err = fmt.Errorf("astits: parsing descriptors failed: %w", err) return } // Add elementary stream d.ElementaryStreams = append(d.ElementaryStreams, e) } return }
{ "pile_set_name": "Github" }
from collections import namedtuple, OrderedDict import pandas as pd from .metergroup import MeterGroup from .datastore.datastore import join_key from .hashable import Hashable BuildingID = namedtuple('BuildingID', ['instance', 'dataset']) class Building(Hashable): """ Attributes ---------- elec : MeterGroup metadata : dict Metadata just about this building (e.g. geo location etc). See http://nilm-metadata.readthedocs.org/en/latest/dataset_metadata.html#building Has these additional keys: dataset : string """ def __init__(self): self.elec = MeterGroup() self.metadata = {} def import_metadata(self, store, key, dataset_name): self.metadata = store.load_metadata(key) if 'dataset' not in self.metadata: self.metadata['dataset'] = dataset_name elec_meters = self.metadata.pop('elec_meters', {}) appliances = self.metadata.pop('appliances', []) self.elec.import_metadata(store, elec_meters, appliances, self.identifier) def save(self, destination, key): destination.write_metadata(key, self.metadata) self.elec.save(destination, join_key(key, 'elec')) @property def identifier(self): md = self.metadata return BuildingID(instance=md.get('instance'), dataset=md.get('dataset')) def describe(self, **kwargs): """Returns a Series describing this building.""" md = self.metadata series = pd.Series(name=self.identifier.instance) for key in ['instance', 'building_type', 'construction_year', 'energy_improvements', 'heating', 'ownership', 'n_occupants', 'description_of_occupants']: series[key] = md.get(key) series = pd.concat([series, self.elec.describe(**kwargs)]) return series
{ "pile_set_name": "Github" }
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = isISRC; var _assertString = require('./util/assertString'); var _assertString2 = _interopRequireDefault(_assertString); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // see http://isrc.ifpi.org/en/isrc-standard/code-syntax var isrc = /^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/; function isISRC(str) { (0, _assertString2.default)(str); return isrc.test(str); } module.exports = exports['default'];
{ "pile_set_name": "Github" }
/* * Copyright (C) 2005-2013 Team XBMC * http://xbmc.org * * 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, 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 XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include "DVDFileInfo.h" #include "threads/SystemClock.h" #include "FileItem.h" #include "settings/AdvancedSettings.h" #include "pictures/Picture.h" #include "video/VideoInfoTag.h" #include "filesystem/StackDirectory.h" #include "utils/log.h" #include "utils/URIUtils.h" #include "DVDStreamInfo.h" #include "DVDInputStreams/DVDInputStream.h" #ifdef HAVE_LIBBLURAY #include "DVDInputStreams/DVDInputStreamBluray.h" #endif #include "DVDInputStreams/DVDFactoryInputStream.h" #include "DVDDemuxers/DVDDemux.h" #include "DVDDemuxers/DVDDemuxUtils.h" #include "DVDDemuxers/DVDFactoryDemuxer.h" #include "DVDDemuxers/DVDDemuxFFmpeg.h" #include "DVDCodecs/DVDCodecs.h" #include "DVDCodecs/DVDFactoryCodec.h" #include "DVDCodecs/Video/DVDVideoCodec.h" #include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h" #include "DVDDemuxers/DVDDemuxVobsub.h" #include "Process/ProcessInfo.h" #include "libavcodec/avcodec.h" #include "libswscale/swscale.h" #include "filesystem/File.h" #include "cores/FFmpeg.h" #include "TextureCache.h" #include "Util.h" #include "utils/LangCodeExpander.h" #include <cstdlib> #include <memory> bool CDVDFileInfo::GetFileDuration(const std::string &path, int& duration) { std::unique_ptr<CDVDInputStream> input; std::unique_ptr<CDVDDemux> demux; CFileItem item(path, false); input.reset(CDVDFactoryInputStream::CreateInputStream(NULL, item)); if (!input.get()) return false; if (!input->Open()) return false; demux.reset(CDVDFactoryDemuxer::CreateDemuxer(input.get(), true)); if (!demux.get()) return false; duration = demux->GetStreamLength(); if (duration > 0) return true; else return false; } int DegreeToOrientation(int degrees) { switch(degrees) { case 90: return 5; case 180: return 2; case 270: return 7; default: return 0; } } bool CDVDFileInfo::ExtractThumb(const std::string &strPath, CTextureDetails &details, CStreamDetails *pStreamDetails, int pos) { std::string redactPath = CURL::GetRedacted(strPath); unsigned int nTime = XbmcThreads::SystemClockMillis(); CFileItem item(strPath, false); item.SetMimeTypeForInternetFile(); CDVDInputStream *pInputStream = CDVDFactoryInputStream::CreateInputStream(NULL, item); if (!pInputStream) { CLog::Log(LOGERROR, "InputStream: Error creating stream for %s", redactPath.c_str()); return false; } if (!pInputStream->Open()) { CLog::Log(LOGERROR, "InputStream: Error opening, %s", redactPath.c_str()); if (pInputStream) delete pInputStream; return false; } CDVDDemux *pDemuxer = NULL; try { pDemuxer = CDVDFactoryDemuxer::CreateDemuxer(pInputStream, true); if(!pDemuxer) { delete pInputStream; CLog::Log(LOGERROR, "%s - Error creating demuxer", __FUNCTION__); return false; } } catch(...) { CLog::Log(LOGERROR, "%s - Exception thrown when opening demuxer", __FUNCTION__); if (pDemuxer) delete pDemuxer; delete pInputStream; return false; } if (pStreamDetails) { DemuxerToStreamDetails(pInputStream, pDemuxer, *pStreamDetails, strPath); //extern subtitles std::vector<std::string> filenames; std::string video_path; if (strPath.empty()) video_path = pInputStream->GetFileName(); else video_path = strPath; CUtil::ScanForExternalSubtitles(video_path, filenames); for(unsigned int i=0;i<filenames.size();i++) { // if vobsub subtitle: if (URIUtils::GetExtension(filenames[i]) == ".idx") { std::string strSubFile; if ( CUtil::FindVobSubPair(filenames, filenames[i], strSubFile) ) AddExternalSubtitleToDetails(video_path, *pStreamDetails, filenames[i], strSubFile); } else { if ( !CUtil::IsVobSub(filenames, filenames[i]) ) { AddExternalSubtitleToDetails(video_path, *pStreamDetails, filenames[i]); } } } } int nVideoStream = -1; int64_t demuxerId = -1; for (CDemuxStream* pStream : pDemuxer->GetStreams()) { if (pStream) { // ignore if it's a picture attachment (e.g. jpeg artwork) if (pStream->type == STREAM_VIDEO && !(pStream->flags & AV_DISPOSITION_ATTACHED_PIC)) { nVideoStream = pStream->uniqueId; demuxerId = pStream->demuxerId; } else pDemuxer->EnableStream(pStream->demuxerId, pStream->uniqueId, false); } } bool bOk = false; int packetsTried = 0; if (nVideoStream != -1) { CDVDVideoCodec *pVideoCodec; std::unique_ptr<CProcessInfo> pProcessInfo(CProcessInfo::CreateInstance()); CDVDStreamInfo hint(*pDemuxer->GetStream(demuxerId, nVideoStream), true); hint.software = true; pVideoCodec = CDVDFactoryCodec::CreateVideoCodec(hint, *pProcessInfo); if (pVideoCodec) { int nTotalLen = pDemuxer->GetStreamLength(); int nSeekTo = (pos==-1) ? nTotalLen / 3 : pos; CLog::Log(LOGDEBUG,"%s - seeking to pos %dms (total: %dms) in %s", __FUNCTION__, nSeekTo, nTotalLen, redactPath.c_str()); if (pDemuxer->SeekTime(nSeekTo, true)) { int iDecoderState = VC_ERROR; DVDVideoPicture picture; memset(&picture, 0, sizeof(picture)); // num streams * 160 frames, should get a valid frame, if not abort. int abort_index = pDemuxer->GetNrOfStreams() * 160; do { DemuxPacket* pPacket = pDemuxer->Read(); packetsTried++; if (!pPacket) break; if (pPacket->iStreamId != nVideoStream) { CDVDDemuxUtils::FreeDemuxPacket(pPacket); continue; } iDecoderState = pVideoCodec->Decode(pPacket->pData, pPacket->iSize, pPacket->dts, pPacket->pts); CDVDDemuxUtils::FreeDemuxPacket(pPacket); if (iDecoderState & VC_ERROR) break; if (iDecoderState & VC_PICTURE) { memset(&picture, 0, sizeof(DVDVideoPicture)); if (pVideoCodec->GetPicture(&picture)) { if(!(picture.iFlags & DVP_FLAG_DROPPED)) break; } } } while (abort_index--); if (iDecoderState & VC_PICTURE && !(picture.iFlags & DVP_FLAG_DROPPED)) { { unsigned int nWidth = g_advancedSettings.m_imageRes; double aspect = (double)picture.iDisplayWidth / (double)picture.iDisplayHeight; if(hint.forced_aspect && hint.aspect != 0) aspect = hint.aspect; unsigned int nHeight = (unsigned int)((double)g_advancedSettings.m_imageRes / aspect); uint8_t *pOutBuf = (uint8_t*)av_malloc(nWidth * nHeight * 4); struct SwsContext *context = sws_getContext(picture.iWidth, picture.iHeight, AV_PIX_FMT_YUV420P, nWidth, nHeight, AV_PIX_FMT_BGRA, SWS_FAST_BILINEAR, NULL, NULL, NULL); if (context) { uint8_t *src[] = { picture.data[0], picture.data[1], picture.data[2], 0 }; int srcStride[] = { picture.iLineSize[0], picture.iLineSize[1], picture.iLineSize[2], 0 }; uint8_t *dst[] = { pOutBuf, 0, 0, 0 }; int dstStride[] = { (int)nWidth*4, 0, 0, 0 }; int orientation = DegreeToOrientation(hint.orientation); sws_scale(context, src, srcStride, 0, picture.iHeight, dst, dstStride); sws_freeContext(context); details.width = nWidth; details.height = nHeight; CPicture::CacheTexture(pOutBuf, nWidth, nHeight, nWidth * 4, orientation, nWidth, nHeight, CTextureCache::GetCachedPath(details.file)); bOk = true; } av_free(pOutBuf); } } else { CLog::Log(LOGDEBUG,"%s - decode failed in %s after %d packets.", __FUNCTION__, redactPath.c_str(), packetsTried); } } delete pVideoCodec; } } if (pDemuxer) delete pDemuxer; delete pInputStream; if(!bOk) { XFILE::CFile file; if(file.OpenForWrite(CTextureCache::GetCachedPath(details.file))) file.Close(); } unsigned int nTotalTime = XbmcThreads::SystemClockMillis() - nTime; CLog::Log(LOGDEBUG,"%s - measured %u ms to extract thumb from file <%s> in %d packets. ", __FUNCTION__, nTotalTime, redactPath.c_str(), packetsTried); return bOk; } /** * \brief Open the item pointed to by pItem and extact streamdetails * \return true if the stream details have changed */ bool CDVDFileInfo::GetFileStreamDetails(CFileItem *pItem) { if (!pItem) return false; std::string strFileNameAndPath; if (pItem->HasVideoInfoTag()) strFileNameAndPath = pItem->GetVideoInfoTag()->m_strFileNameAndPath; if (strFileNameAndPath.empty()) strFileNameAndPath = pItem->GetPath(); std::string playablePath = strFileNameAndPath; if (URIUtils::IsStack(playablePath)) playablePath = XFILE::CStackDirectory::GetFirstStackedFile(playablePath); CFileItem item(playablePath, false); item.SetMimeTypeForInternetFile(); CDVDInputStream *pInputStream = CDVDFactoryInputStream::CreateInputStream(NULL, item); if (!pInputStream) return false; if (pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER)) { delete pInputStream; return false; } if (pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD) || !pInputStream->Open()) { delete pInputStream; return false; } CDVDDemux *pDemuxer = CDVDFactoryDemuxer::CreateDemuxer(pInputStream, true); if (pDemuxer) { bool retVal = DemuxerToStreamDetails(pInputStream, pDemuxer, pItem->GetVideoInfoTag()->m_streamDetails, strFileNameAndPath); delete pDemuxer; delete pInputStream; return retVal; } else { delete pInputStream; return false; } } bool CDVDFileInfo::DemuxerToStreamDetails(CDVDInputStream *pInputStream, CDVDDemux *pDemuxer, const std::vector<CStreamDetailSubtitle> &subs, CStreamDetails &details) { bool result = DemuxerToStreamDetails(pInputStream, pDemuxer, details); for (unsigned int i = 0; i < subs.size(); i++) { CStreamDetailSubtitle* sub = new CStreamDetailSubtitle(); sub->m_strLanguage = subs[i].m_strLanguage; details.AddStream(sub); result = true; } return result; } /* returns true if details have been added */ bool CDVDFileInfo::DemuxerToStreamDetails(CDVDInputStream *pInputStream, CDVDDemux *pDemux, CStreamDetails &details, const std::string &path) { bool retVal = false; details.Reset(); const CURL pathToUrl(path); for (CDemuxStream* stream : pDemux->GetStreams()) { if (stream->type == STREAM_VIDEO && !(stream->flags & AV_DISPOSITION_ATTACHED_PIC)) { CStreamDetailVideo *p = new CStreamDetailVideo(); p->m_iWidth = ((CDemuxStreamVideo *)stream)->iWidth; p->m_iHeight = ((CDemuxStreamVideo *)stream)->iHeight; p->m_fAspect = ((CDemuxStreamVideo *)stream)->fAspect; if (p->m_fAspect == 0.0f) p->m_fAspect = (float)p->m_iWidth / p->m_iHeight; p->m_strCodec = pDemux->GetStreamCodecName(stream->demuxerId, stream->uniqueId); p->m_iDuration = pDemux->GetStreamLength(); p->m_strStereoMode = ((CDemuxStreamVideo *)stream)->stereo_mode; p->m_strLanguage = ((CDemuxStreamVideo *)stream)->language; // stack handling if (URIUtils::IsStack(path)) { CFileItemList files; XFILE::CStackDirectory stack; stack.GetDirectory(pathToUrl, files); // skip first path as we already know the duration for (int i = 1; i < files.Size(); i++) { int duration = 0; if (CDVDFileInfo::GetFileDuration(files[i]->GetPath(), duration)) p->m_iDuration = p->m_iDuration + duration; } } // finally, calculate seconds if (p->m_iDuration > 0) p->m_iDuration = p->m_iDuration / 1000; details.AddStream(p); retVal = true; } else if (stream->type == STREAM_AUDIO) { CStreamDetailAudio *p = new CStreamDetailAudio(); p->m_iChannels = ((CDemuxStreamAudio *)stream)->iChannels; p->m_strLanguage = stream->language; p->m_strCodec = pDemux->GetStreamCodecName(stream->demuxerId, stream->uniqueId); details.AddStream(p); retVal = true; } else if (stream->type == STREAM_SUBTITLE) { CStreamDetailSubtitle *p = new CStreamDetailSubtitle(); p->m_strLanguage = stream->language; details.AddStream(p); retVal = true; } } /* for iStream */ details.DetermineBestStreams(); #ifdef HAVE_LIBBLURAY // correct bluray runtime. we need the duration from the input stream, not the demuxer. if (pInputStream->IsStreamType(DVDSTREAM_TYPE_BLURAY)) { if(((CDVDInputStreamBluray*)pInputStream)->GetTotalTime() > 0) { CStreamDetailVideo* detailVideo = (CStreamDetailVideo*)details.GetNthStream(CStreamDetail::VIDEO, 0); if (detailVideo) detailVideo->m_iDuration = ((CDVDInputStreamBluray*)pInputStream)->GetTotalTime() / 1000; } } #endif return retVal; } bool CDVDFileInfo::AddExternalSubtitleToDetails(const std::string &path, CStreamDetails &details, const std::string& filename, const std::string& subfilename) { std::string ext = URIUtils::GetExtension(filename); std::string vobsubfile = subfilename; if(ext == ".idx") { if (vobsubfile.empty()) vobsubfile = URIUtils::ReplaceExtension(filename, ".sub"); CDVDDemuxVobsub v; if (!v.Open(filename, STREAM_SOURCE_NONE, vobsubfile)) return false; for(CDemuxStream* stream : v.GetStreams()) { CStreamDetailSubtitle *dsub = new CStreamDetailSubtitle(); std::string lang = stream->language; dsub->m_strLanguage = g_LangCodeExpander.ConvertToISO6392T(lang); details.AddStream(dsub); } return true; } if(ext == ".sub") { std::string strReplace(URIUtils::ReplaceExtension(filename,".idx")); if (XFILE::CFile::Exists(strReplace)) return false; } CStreamDetailSubtitle *dsub = new CStreamDetailSubtitle(); ExternalStreamInfo info = CUtil::GetExternalStreamDetailsFromFilename(path, filename); dsub->m_strLanguage = g_LangCodeExpander.ConvertToISO6392T(info.language); details.AddStream(dsub); return true; }
{ "pile_set_name": "Github" }
## @file # Description file for the Embedded MMC (eMMC) Peim driver. # # Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # # ## [Defines] INF_VERSION = 0x00010005 BASE_NAME = EmmcBlockIoPei MODULE_UNI_FILE = EmmcBlockIoPei.uni FILE_GUID = 7F06A90F-AE0D-4887-82C0-FEC7F4F68B29 MODULE_TYPE = PEIM VERSION_STRING = 1.0 ENTRY_POINT = InitializeEmmcBlockIoPeim # # The following information is for reference only and not required by the build tools. # # VALID_ARCHITECTURES = IA32 X64 EBC # [Sources] EmmcBlockIoPei.c EmmcBlockIoPei.h EmmcHci.c EmmcHci.h EmmcHcMem.c EmmcHcMem.h DmaMem.c [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] IoLib TimerLib BaseMemoryLib PeimEntryPoint PeiServicesLib DebugLib [Ppis] gEfiPeiVirtualBlockIoPpiGuid ## PRODUCES gEfiPeiVirtualBlockIo2PpiGuid ## PRODUCES gEdkiiPeiSdMmcHostControllerPpiGuid ## CONSUMES gEdkiiIoMmuPpiGuid ## CONSUMES gEfiEndOfPeiSignalPpiGuid ## CONSUMES [Depex] gEfiPeiMemoryDiscoveredPpiGuid AND gEdkiiPeiSdMmcHostControllerPpiGuid [UserExtensions.TianoCore."ExtraFiles"] EmmcBlockIoPeiExtra.uni
{ "pile_set_name": "Github" }
langcode: en status: true dependencies: module: - views_test_data id: test_view_display_template label: test_view_display_template module: views description: '' tag: '' base_table: views_test_data base_field: id display: default: display_plugin: default id: default display_title: Master position: 1 display_options: access: { } query: { } pager: { } style: type: test_template_style row: type: fields options: { } fields: id: id: id table: views_test_data field: id relationship: none group_type: group admin_label: '' label: '' exclude: false alter: { } filters: { } sorts: { } header: { } footer: { } empty: { } relationships: { } arguments: { }
{ "pile_set_name": "Github" }
############################################################################### # # Copyright (c) 2011-2019 Talend Inc. - www.talend.com # All rights reserved. # # This program and the accompanying materials are made available # under the terms of the Apache License v2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 # ############################################################################### WS-Trust (JAX-WS CXF STS sample) ================================= Provides an example of a CXF SOAP client (WSC) accessing a CXF STS for a SAML assertion and then subsequently making a call to a CXF web service provider (WSP). X.509 authentication is used for the WSC->STS call. Sample keystores and truststores for the WSC, WSP, and STS are provided in this project but are of course not meant for production use. Important Note: By default, this example uses strong encryption which is recommended for use in production systems. To run this example "out of the box", you MUST have the "Java(TM) Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files" installed into your JRE. Note that the unlimited strength policies are installed by default from the 1.8.0_161 release. For prior java releases, the unlimited strength policy files can be obtained from [1]: [1] http://www.oracle.com/technetwork/java/javase/downloads/index.html Alternatively, you can change to using a lower end encyption algorithm by editing the security policies in: client/src/main/resources/DoubleItSTSService.wsdl client/src/main/resources/DoubleIt.wsdl service/src/main/resources/DoubleIt.wsdl sts-war/src/main/webapp/WEB-INF/wsdl/DoubleItSTSService.wsdl to change from "Basic256" to "Basic128". If you receive an error like "Illegal key length" when running the demo, you need to change to Basic128 or install the Unlimited Strength encryption libraries. Usage =============================================================================== Note: Please follow the parent README.txt first for common build and container setup instructions. How to Deploy: 1.) The STS and WSP run on either Tomcat 7.x (default) or Tomcat 6.x. If not already done, configure Maven to be able to install and uninstall the WSP and the STS by following this section: https://glenmazza.net/blog/entry/web-service-tutorial#maventomcat. Also start up Tomcat. Note: If you wish to use Tomcat 6, use the -PTomcat6 flag when running the mvn tomcat commands (tomcat:deploy, tomcat:redeploy, tomcat:undeploy). (-PTomcat7 is active by default so does not need to be explicitly specified.) 2.) From the root jaxws-cxf-sts folder, run "mvn clean install". If no errors, run "mvn tomcat:deploy" (or tomcat:undeploy or tomcat:redeploy on subsequent runs as appropriate) in the "sts" folder to deploy the STS. Note:"Cannot invoke Tomcat manager: Server returned HTTP response code: 401 error" as result of deployment on Tomcat appears due to credential misconfiguration in Tomcat and deployment script.Please check conf/tomcat-users.xml and war/pom.xml for credential configuration. Before proceeding to the next step, make sure you can view the following WSDL: CXF STS WSDL located at: http://localhost:8080/DoubleItSTS/X509?wsdl 3.) Next we need to deploy the WSP, for which three options are provided: * To run the service in a standalone manner on port 9000, run mvn exec:java from the service folder. Make sure you can view the WSP WSDL at http://localhost:9000/doubleit/services/doubleit?wsdl before proceeding. * To run the service from Tomcat, go to the WAR folder and run mvn tomcat:deploy (can also use mvn tomcat:undeploy and mvn tomcat:redeploy for subsequent installs) Make sure you can view the WSP WSDL at http://localhost:8080/doubleit/services/doubleit?wsdl before proceeding. * To run the WSP from within the OSGi container. One thing to be aware of is that the default port for Tomcat (8080) will conflict with Karaf's OPS4J Pax Web - Jetty bundle. Therefore, best to stop Tomcat, start Karaf, and stop Karaf's Pax Jetty bundle before restarting Tomcat (to activate the STS). From the OSGi command line, run: karaf@trun> feature:install talend-cxf-example-jaxws-cxf-sts-service (Make sure you've first installed the examples features repository as described in the parent README.) Make sure you can view the WSP WSDL at http://localhost:9000/doubleit/services/doubleit?wsdl before proceeding. 4.) Navigate to the client folder: Note: If you've selected standalone or OSGi deployment of the WSP in the preceding step, the WSP address in the client WSDL (client/src/main/resources/DoubleIt.wsdl) must be updated before invoking the WSP to "http://localhost:9000/doubleit/services/doubleit". (run mvn clean install after done) This is because the WSP runs on port 9000 when run in a standalone manner, or in Karaf, to avoid clashing with the port that Tomcat is using (8080). * To run the client in a standalone manner, run mvn exec:exec. * From the OSGi command line, run: karaf@trun> feature:install talend-cxf-example-jaxws-cxf-sts-client You should see the results of the web service call. For DEBUGGING: 1.) Activate client-side logging by uncommenting the logging feature in the client's resources/cxf.xml file. The logging.properties file in the same folder can be used to adjust the amount of logging received. 2.) Check the logs directory under your Tomcat (catalina.log, catalina(date).log in particular) or Karaf (data/log) folder for any errors reported by the STS. 3.) Use Wireshark to view messages: https://glenmazza.net/blog/entry/soap-calls-over-wireshark
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>UserDialog</class> <widget class="QDialog" name="UserDialog"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>316</width> <height>253</height> </rect> </property> <property name="windowTitle"> <string>User Properties</string> </property> <property name="modal"> <bool>true</bool> </property> <layout class="QVBoxLayout" name="verticalLayout_3"> <item> <layout class="QHBoxLayout" name="horizontalLayout"> <item> <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QLabel" name="label_username"> <property name="text"> <string>Name:</string> </property> </widget> </item> <item> <widget class="QLabel" name="label_password"> <property name="text"> <string>Password:</string> </property> </widget> </item> <item> <widget class="QLabel" name="label_password_retry"> <property name="text"> <string>Password (retry):</string> </property> </widget> </item> </layout> </item> <item> <layout class="QVBoxLayout" name="verticalLayout_2"> <item> <widget class="QLineEdit" name="edit_username"/> </item> <item> <widget class="QLineEdit" name="edit_password"> <property name="echoMode"> <enum>QLineEdit::Password</enum> </property> </widget> </item> <item> <widget class="QLineEdit" name="edit_password_retry"> <property name="echoMode"> <enum>QLineEdit::Password</enum> </property> </widget> </item> </layout> </item> </layout> </item> <item> <widget class="QCheckBox" name="checkbox_disable"> <property name="text"> <string>Disable User Account</string> </property> </widget> </item> <item> <widget class="QLabel" name="label"> <property name="text"> <string>Allowed Session Types:</string> </property> </widget> </item> <item> <widget class="QTreeWidget" name="tree_sessions"> <property name="indentation"> <number>0</number> </property> <attribute name="headerVisible"> <bool>false</bool> </attribute> <column> <property name="text"> <string notr="true">1</string> </property> </column> </widget> </item> <item> <widget class="QDialogButtonBox" name="buttonbox"> <property name="standardButtons"> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> </property> </widget> </item> </layout> </widget> <resources/> <connections/> </ui>
{ "pile_set_name": "Github" }
/* * Faraday FTMAC100 10/100 Ethernet * * (C) Copyright 2009-2011 Faraday Technology * Po-Yu Chuang <ratbert@faraday-tech.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __FTMAC100_H #define __FTMAC100_H #define FTMAC100_OFFSET_ISR 0x00 #define FTMAC100_OFFSET_IMR 0x04 #define FTMAC100_OFFSET_MAC_MADR 0x08 #define FTMAC100_OFFSET_MAC_LADR 0x0c #define FTMAC100_OFFSET_MAHT0 0x10 #define FTMAC100_OFFSET_MAHT1 0x14 #define FTMAC100_OFFSET_TXPD 0x18 #define FTMAC100_OFFSET_RXPD 0x1c #define FTMAC100_OFFSET_TXR_BADR 0x20 #define FTMAC100_OFFSET_RXR_BADR 0x24 #define FTMAC100_OFFSET_ITC 0x28 #define FTMAC100_OFFSET_APTC 0x2c #define FTMAC100_OFFSET_DBLAC 0x30 #define FTMAC100_OFFSET_MACCR 0x88 #define FTMAC100_OFFSET_MACSR 0x8c #define FTMAC100_OFFSET_PHYCR 0x90 #define FTMAC100_OFFSET_PHYWDATA 0x94 #define FTMAC100_OFFSET_FCR 0x98 #define FTMAC100_OFFSET_BPR 0x9c #define FTMAC100_OFFSET_TS 0xc4 #define FTMAC100_OFFSET_DMAFIFOS 0xc8 #define FTMAC100_OFFSET_TM 0xcc #define FTMAC100_OFFSET_TX_MCOL_SCOL 0xd4 #define FTMAC100_OFFSET_RPF_AEP 0xd8 #define FTMAC100_OFFSET_XM_PG 0xdc #define FTMAC100_OFFSET_RUNT_TLCC 0xe0 #define FTMAC100_OFFSET_CRCER_FTL 0xe4 #define FTMAC100_OFFSET_RLC_RCC 0xe8 #define FTMAC100_OFFSET_BROC 0xec #define FTMAC100_OFFSET_MULCA 0xf0 #define FTMAC100_OFFSET_RP 0xf4 #define FTMAC100_OFFSET_XP 0xf8 /* * Interrupt status register & interrupt mask register */ #define FTMAC100_INT_RPKT_FINISH (1 << 0) #define FTMAC100_INT_NORXBUF (1 << 1) #define FTMAC100_INT_XPKT_FINISH (1 << 2) #define FTMAC100_INT_NOTXBUF (1 << 3) #define FTMAC100_INT_XPKT_OK (1 << 4) #define FTMAC100_INT_XPKT_LOST (1 << 5) #define FTMAC100_INT_RPKT_SAV (1 << 6) #define FTMAC100_INT_RPKT_LOST (1 << 7) #define FTMAC100_INT_AHB_ERR (1 << 8) #define FTMAC100_INT_PHYSTS_CHG (1 << 9) /* * Interrupt timer control register */ #define FTMAC100_ITC_RXINT_CNT(x) (((x) & 0xf) << 0) #define FTMAC100_ITC_RXINT_THR(x) (((x) & 0x7) << 4) #define FTMAC100_ITC_RXINT_TIME_SEL (1 << 7) #define FTMAC100_ITC_TXINT_CNT(x) (((x) & 0xf) << 8) #define FTMAC100_ITC_TXINT_THR(x) (((x) & 0x7) << 12) #define FTMAC100_ITC_TXINT_TIME_SEL (1 << 15) /* * Automatic polling timer control register */ #define FTMAC100_APTC_RXPOLL_CNT(x) (((x) & 0xf) << 0) #define FTMAC100_APTC_RXPOLL_TIME_SEL (1 << 4) #define FTMAC100_APTC_TXPOLL_CNT(x) (((x) & 0xf) << 8) #define FTMAC100_APTC_TXPOLL_TIME_SEL (1 << 12) /* * DMA burst length and arbitration control register */ #define FTMAC100_DBLAC_INCR4_EN (1 << 0) #define FTMAC100_DBLAC_INCR8_EN (1 << 1) #define FTMAC100_DBLAC_INCR16_EN (1 << 2) #define FTMAC100_DBLAC_RXFIFO_LTHR(x) (((x) & 0x7) << 3) #define FTMAC100_DBLAC_RXFIFO_HTHR(x) (((x) & 0x7) << 6) #define FTMAC100_DBLAC_RX_THR_EN (1 << 9) /* * MAC control register */ #define FTMAC100_MACCR_XDMA_EN (1 << 0) #define FTMAC100_MACCR_RDMA_EN (1 << 1) #define FTMAC100_MACCR_SW_RST (1 << 2) #define FTMAC100_MACCR_LOOP_EN (1 << 3) #define FTMAC100_MACCR_CRC_DIS (1 << 4) #define FTMAC100_MACCR_XMT_EN (1 << 5) #define FTMAC100_MACCR_ENRX_IN_HALFTX (1 << 6) #define FTMAC100_MACCR_RCV_EN (1 << 8) #define FTMAC100_MACCR_HT_MULTI_EN (1 << 9) #define FTMAC100_MACCR_RX_RUNT (1 << 10) #define FTMAC100_MACCR_RX_FTL (1 << 11) #define FTMAC100_MACCR_RCV_ALL (1 << 12) #define FTMAC100_MACCR_CRC_APD (1 << 14) #define FTMAC100_MACCR_FULLDUP (1 << 15) #define FTMAC100_MACCR_RX_MULTIPKT (1 << 16) #define FTMAC100_MACCR_RX_BROADPKT (1 << 17) /* * PHY control register */ #define FTMAC100_PHYCR_MIIRDATA 0xffff #define FTMAC100_PHYCR_PHYAD(x) (((x) & 0x1f) << 16) #define FTMAC100_PHYCR_REGAD(x) (((x) & 0x1f) << 21) #define FTMAC100_PHYCR_MIIRD (1 << 26) #define FTMAC100_PHYCR_MIIWR (1 << 27) /* * PHY write data register */ #define FTMAC100_PHYWDATA_MIIWDATA(x) ((x) & 0xffff) /* * Transmit descriptor, aligned to 16 bytes */ struct ftmac100_txdes { unsigned int txdes0; unsigned int txdes1; unsigned int txdes2; /* TXBUF_BADR */ unsigned int txdes3; /* not used by HW */ } __attribute__ ((aligned(16))); #define FTMAC100_TXDES0_TXPKT_LATECOL (1 << 0) #define FTMAC100_TXDES0_TXPKT_EXSCOL (1 << 1) #define FTMAC100_TXDES0_TXDMA_OWN (1 << 31) #define FTMAC100_TXDES1_TXBUF_SIZE(x) ((x) & 0x7ff) #define FTMAC100_TXDES1_LTS (1 << 27) #define FTMAC100_TXDES1_FTS (1 << 28) #define FTMAC100_TXDES1_TX2FIC (1 << 29) #define FTMAC100_TXDES1_TXIC (1 << 30) #define FTMAC100_TXDES1_EDOTR (1 << 31) /* * Receive descriptor, aligned to 16 bytes */ struct ftmac100_rxdes { unsigned int rxdes0; unsigned int rxdes1; unsigned int rxdes2; /* RXBUF_BADR */ unsigned int rxdes3; /* not used by HW */ } __attribute__ ((aligned(16))); #define FTMAC100_RXDES0_RFL 0x7ff #define FTMAC100_RXDES0_MULTICAST (1 << 16) #define FTMAC100_RXDES0_BROADCAST (1 << 17) #define FTMAC100_RXDES0_RX_ERR (1 << 18) #define FTMAC100_RXDES0_CRC_ERR (1 << 19) #define FTMAC100_RXDES0_FTL (1 << 20) #define FTMAC100_RXDES0_RUNT (1 << 21) #define FTMAC100_RXDES0_RX_ODD_NB (1 << 22) #define FTMAC100_RXDES0_LRS (1 << 28) #define FTMAC100_RXDES0_FRS (1 << 29) #define FTMAC100_RXDES0_RXDMA_OWN (1 << 31) #define FTMAC100_RXDES1_RXBUF_SIZE(x) ((x) & 0x7ff) #define FTMAC100_RXDES1_EDORR (1 << 31) #endif /* __FTMAC100_H */
{ "pile_set_name": "Github" }
<component name="libraryTable"> <library name="Maven: org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1.1"> <CLASSES> <root url="jar://$MAVEN_REPOSITORY$/org/apache/geronimo/specs/geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1.jar!/" /> </CLASSES> <JAVADOC> <root url="jar://$MAVEN_REPOSITORY$/org/apache/geronimo/specs/geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1-javadoc.jar!/" /> </JAVADOC> <SOURCES> <root url="jar://$MAVEN_REPOSITORY$/org/apache/geronimo/specs/geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1-sources.jar!/" /> </SOURCES> </library> </component>
{ "pile_set_name": "Github" }
open React open Lwt open LTerm_text module Interpreter = struct let eval ~impl:(module I : Impl.M) ?default_index ~options s = match s, default_index with | "", Some index -> Ok index | _ -> let index_opt = Option.bind (int_of_string_opt s) (fun c -> if c > 0 && c <= List.length options then Some c else None) in (match index_opt with | Some index -> Ok index | None -> Error (Printf.sprintf "Enter a number between 1 and %d" (List.length options))) end let make_prompt ?default ~impl:(module I : Impl.M) ~options message = let default_str = match Utils.index_of_default_opt ?default options with | None -> "" | Some v -> Printf.sprintf "[%d] " (v + 1) in let prompt = I.make_prompt message in let options_string = List.mapi options ~f:(fun i opt -> " " ^ Int.to_string (i + 1) ^ ") " ^ opt ^ "\n") |> String.concat ~sep:"" in Array.concat [ prompt ; LTerm_text.eval [ S "\n"; S options_string; S " Answer: "; S default_str ] ] class read_line ~term prompt = object (self) inherit LTerm_read_line.read_line () inherit [Zed_string.t] LTerm_read_line.term term method! show_box = false initializer self#set_prompt (S.const prompt) end let rec loop ~term ~impl:(module I : Impl.M) ?default ~options message = let prompt = make_prompt message ?default ~options ~impl:(module I) in let rl = new read_line prompt ~term in rl#run >>= fun command -> let command_utf8 = Zed_string.to_utf8 command in let default_index = Utils.index_of_default_opt ?default options |> Option.map (( + ) 1) in match Interpreter.eval command_utf8 ~options ?default_index ~impl:(module I) with | Error e -> let error_str = I.make_error e in LTerm.fprintls term error_str >>= fun () -> loop message ?default ~options ~term ~impl:(module I) | Ok v -> Lwt.return (List.nth options (v - 1)) let prompt ~impl:(module I : Impl.M) ?default ~options message = LTerm_inputrc.load () >>= fun () -> Lazy.force LTerm.stdout >>= fun term -> loop message ?default ~options ~term ~impl:(module I)
{ "pile_set_name": "Github" }
/* * VF610 pinctrl driver based on imx pinmux and pinconf core * * Copyright 2013 Freescale Semiconductor, Inc. * * 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. */ #include <linux/err.h> #include <linux/init.h> #include <linux/io.h> #include <linux/module.h> #include <linux/of.h> #include <linux/of_device.h> #include <linux/pinctrl/pinctrl.h> #include "pinctrl-imx.h" enum vf610_pads { VF610_PAD_PTA6 = 0, VF610_PAD_PTA8 = 1, VF610_PAD_PTA9 = 2, VF610_PAD_PTA10 = 3, VF610_PAD_PTA11 = 4, VF610_PAD_PTA12 = 5, VF610_PAD_PTA16 = 6, VF610_PAD_PTA17 = 7, VF610_PAD_PTA18 = 8, VF610_PAD_PTA19 = 9, VF610_PAD_PTA20 = 10, VF610_PAD_PTA21 = 11, VF610_PAD_PTA22 = 12, VF610_PAD_PTA23 = 13, VF610_PAD_PTA24 = 14, VF610_PAD_PTA25 = 15, VF610_PAD_PTA26 = 16, VF610_PAD_PTA27 = 17, VF610_PAD_PTA28 = 18, VF610_PAD_PTA29 = 19, VF610_PAD_PTA30 = 20, VF610_PAD_PTA31 = 21, VF610_PAD_PTB0 = 22, VF610_PAD_PTB1 = 23, VF610_PAD_PTB2 = 24, VF610_PAD_PTB3 = 25, VF610_PAD_PTB4 = 26, VF610_PAD_PTB5 = 27, VF610_PAD_PTB6 = 28, VF610_PAD_PTB7 = 29, VF610_PAD_PTB8 = 30, VF610_PAD_PTB9 = 31, VF610_PAD_PTB10 = 32, VF610_PAD_PTB11 = 33, VF610_PAD_PTB12 = 34, VF610_PAD_PTB13 = 35, VF610_PAD_PTB14 = 36, VF610_PAD_PTB15 = 37, VF610_PAD_PTB16 = 38, VF610_PAD_PTB17 = 39, VF610_PAD_PTB18 = 40, VF610_PAD_PTB19 = 41, VF610_PAD_PTB20 = 42, VF610_PAD_PTB21 = 43, VF610_PAD_PTB22 = 44, VF610_PAD_PTC0 = 45, VF610_PAD_PTC1 = 46, VF610_PAD_PTC2 = 47, VF610_PAD_PTC3 = 48, VF610_PAD_PTC4 = 49, VF610_PAD_PTC5 = 50, VF610_PAD_PTC6 = 51, VF610_PAD_PTC7 = 52, VF610_PAD_PTC8 = 53, VF610_PAD_PTC9 = 54, VF610_PAD_PTC10 = 55, VF610_PAD_PTC11 = 56, VF610_PAD_PTC12 = 57, VF610_PAD_PTC13 = 58, VF610_PAD_PTC14 = 59, VF610_PAD_PTC15 = 60, VF610_PAD_PTC16 = 61, VF610_PAD_PTC17 = 62, VF610_PAD_PTD31 = 63, VF610_PAD_PTD30 = 64, VF610_PAD_PTD29 = 65, VF610_PAD_PTD28 = 66, VF610_PAD_PTD27 = 67, VF610_PAD_PTD26 = 68, VF610_PAD_PTD25 = 69, VF610_PAD_PTD24 = 70, VF610_PAD_PTD23 = 71, VF610_PAD_PTD22 = 72, VF610_PAD_PTD21 = 73, VF610_PAD_PTD20 = 74, VF610_PAD_PTD19 = 75, VF610_PAD_PTD18 = 76, VF610_PAD_PTD17 = 77, VF610_PAD_PTD16 = 78, VF610_PAD_PTD0 = 79, VF610_PAD_PTD1 = 80, VF610_PAD_PTD2 = 81, VF610_PAD_PTD3 = 82, VF610_PAD_PTD4 = 83, VF610_PAD_PTD5 = 84, VF610_PAD_PTD6 = 85, VF610_PAD_PTD7 = 86, VF610_PAD_PTD8 = 87, VF610_PAD_PTD9 = 88, VF610_PAD_PTD10 = 89, VF610_PAD_PTD11 = 90, VF610_PAD_PTD12 = 91, VF610_PAD_PTD13 = 92, VF610_PAD_PTB23 = 93, VF610_PAD_PTB24 = 94, VF610_PAD_PTB25 = 95, VF610_PAD_PTB26 = 96, VF610_PAD_PTB27 = 97, VF610_PAD_PTB28 = 98, VF610_PAD_PTC26 = 99, VF610_PAD_PTC27 = 100, VF610_PAD_PTC28 = 101, VF610_PAD_PTC29 = 102, VF610_PAD_PTC30 = 103, VF610_PAD_PTC31 = 104, VF610_PAD_PTE0 = 105, VF610_PAD_PTE1 = 106, VF610_PAD_PTE2 = 107, VF610_PAD_PTE3 = 108, VF610_PAD_PTE4 = 109, VF610_PAD_PTE5 = 110, VF610_PAD_PTE6 = 111, VF610_PAD_PTE7 = 112, VF610_PAD_PTE8 = 113, VF610_PAD_PTE9 = 114, VF610_PAD_PTE10 = 115, VF610_PAD_PTE11 = 116, VF610_PAD_PTE12 = 117, VF610_PAD_PTE13 = 118, VF610_PAD_PTE14 = 119, VF610_PAD_PTE15 = 120, VF610_PAD_PTE16 = 121, VF610_PAD_PTE17 = 122, VF610_PAD_PTE18 = 123, VF610_PAD_PTE19 = 124, VF610_PAD_PTE20 = 125, VF610_PAD_PTE21 = 126, VF610_PAD_PTE22 = 127, VF610_PAD_PTE23 = 128, VF610_PAD_PTE24 = 129, VF610_PAD_PTE25 = 130, VF610_PAD_PTE26 = 131, VF610_PAD_PTE27 = 132, VF610_PAD_PTE28 = 133, VF610_PAD_PTA7 = 134, }; /* Pad names for the pinmux subsystem */ static const struct pinctrl_pin_desc vf610_pinctrl_pads[] = { IMX_PINCTRL_PIN(VF610_PAD_PTA6), IMX_PINCTRL_PIN(VF610_PAD_PTA8), IMX_PINCTRL_PIN(VF610_PAD_PTA9), IMX_PINCTRL_PIN(VF610_PAD_PTA10), IMX_PINCTRL_PIN(VF610_PAD_PTA11), IMX_PINCTRL_PIN(VF610_PAD_PTA12), IMX_PINCTRL_PIN(VF610_PAD_PTA16), IMX_PINCTRL_PIN(VF610_PAD_PTA17), IMX_PINCTRL_PIN(VF610_PAD_PTA18), IMX_PINCTRL_PIN(VF610_PAD_PTA19), IMX_PINCTRL_PIN(VF610_PAD_PTA20), IMX_PINCTRL_PIN(VF610_PAD_PTA21), IMX_PINCTRL_PIN(VF610_PAD_PTA22), IMX_PINCTRL_PIN(VF610_PAD_PTA23), IMX_PINCTRL_PIN(VF610_PAD_PTA24), IMX_PINCTRL_PIN(VF610_PAD_PTA25), IMX_PINCTRL_PIN(VF610_PAD_PTA26), IMX_PINCTRL_PIN(VF610_PAD_PTA27), IMX_PINCTRL_PIN(VF610_PAD_PTA28), IMX_PINCTRL_PIN(VF610_PAD_PTA29), IMX_PINCTRL_PIN(VF610_PAD_PTA30), IMX_PINCTRL_PIN(VF610_PAD_PTA31), IMX_PINCTRL_PIN(VF610_PAD_PTB0), IMX_PINCTRL_PIN(VF610_PAD_PTB1), IMX_PINCTRL_PIN(VF610_PAD_PTB2), IMX_PINCTRL_PIN(VF610_PAD_PTB3), IMX_PINCTRL_PIN(VF610_PAD_PTB4), IMX_PINCTRL_PIN(VF610_PAD_PTB5), IMX_PINCTRL_PIN(VF610_PAD_PTB6), IMX_PINCTRL_PIN(VF610_PAD_PTB7), IMX_PINCTRL_PIN(VF610_PAD_PTB8), IMX_PINCTRL_PIN(VF610_PAD_PTB9), IMX_PINCTRL_PIN(VF610_PAD_PTB10), IMX_PINCTRL_PIN(VF610_PAD_PTB11), IMX_PINCTRL_PIN(VF610_PAD_PTB12), IMX_PINCTRL_PIN(VF610_PAD_PTB13), IMX_PINCTRL_PIN(VF610_PAD_PTB14), IMX_PINCTRL_PIN(VF610_PAD_PTB15), IMX_PINCTRL_PIN(VF610_PAD_PTB16), IMX_PINCTRL_PIN(VF610_PAD_PTB17), IMX_PINCTRL_PIN(VF610_PAD_PTB18), IMX_PINCTRL_PIN(VF610_PAD_PTB19), IMX_PINCTRL_PIN(VF610_PAD_PTB20), IMX_PINCTRL_PIN(VF610_PAD_PTB21), IMX_PINCTRL_PIN(VF610_PAD_PTB22), IMX_PINCTRL_PIN(VF610_PAD_PTC0), IMX_PINCTRL_PIN(VF610_PAD_PTC1), IMX_PINCTRL_PIN(VF610_PAD_PTC2), IMX_PINCTRL_PIN(VF610_PAD_PTC3), IMX_PINCTRL_PIN(VF610_PAD_PTC4), IMX_PINCTRL_PIN(VF610_PAD_PTC5), IMX_PINCTRL_PIN(VF610_PAD_PTC6), IMX_PINCTRL_PIN(VF610_PAD_PTC7), IMX_PINCTRL_PIN(VF610_PAD_PTC8), IMX_PINCTRL_PIN(VF610_PAD_PTC9), IMX_PINCTRL_PIN(VF610_PAD_PTC10), IMX_PINCTRL_PIN(VF610_PAD_PTC11), IMX_PINCTRL_PIN(VF610_PAD_PTC12), IMX_PINCTRL_PIN(VF610_PAD_PTC13), IMX_PINCTRL_PIN(VF610_PAD_PTC14), IMX_PINCTRL_PIN(VF610_PAD_PTC15), IMX_PINCTRL_PIN(VF610_PAD_PTC16), IMX_PINCTRL_PIN(VF610_PAD_PTC17), IMX_PINCTRL_PIN(VF610_PAD_PTD31), IMX_PINCTRL_PIN(VF610_PAD_PTD30), IMX_PINCTRL_PIN(VF610_PAD_PTD29), IMX_PINCTRL_PIN(VF610_PAD_PTD28), IMX_PINCTRL_PIN(VF610_PAD_PTD27), IMX_PINCTRL_PIN(VF610_PAD_PTD26), IMX_PINCTRL_PIN(VF610_PAD_PTD25), IMX_PINCTRL_PIN(VF610_PAD_PTD24), IMX_PINCTRL_PIN(VF610_PAD_PTD23), IMX_PINCTRL_PIN(VF610_PAD_PTD22), IMX_PINCTRL_PIN(VF610_PAD_PTD21), IMX_PINCTRL_PIN(VF610_PAD_PTD20), IMX_PINCTRL_PIN(VF610_PAD_PTD19), IMX_PINCTRL_PIN(VF610_PAD_PTD18), IMX_PINCTRL_PIN(VF610_PAD_PTD17), IMX_PINCTRL_PIN(VF610_PAD_PTD16), IMX_PINCTRL_PIN(VF610_PAD_PTD0), IMX_PINCTRL_PIN(VF610_PAD_PTD1), IMX_PINCTRL_PIN(VF610_PAD_PTD2), IMX_PINCTRL_PIN(VF610_PAD_PTD3), IMX_PINCTRL_PIN(VF610_PAD_PTD4), IMX_PINCTRL_PIN(VF610_PAD_PTD5), IMX_PINCTRL_PIN(VF610_PAD_PTD6), IMX_PINCTRL_PIN(VF610_PAD_PTD7), IMX_PINCTRL_PIN(VF610_PAD_PTD8), IMX_PINCTRL_PIN(VF610_PAD_PTD9), IMX_PINCTRL_PIN(VF610_PAD_PTD10), IMX_PINCTRL_PIN(VF610_PAD_PTD11), IMX_PINCTRL_PIN(VF610_PAD_PTD12), IMX_PINCTRL_PIN(VF610_PAD_PTD13), IMX_PINCTRL_PIN(VF610_PAD_PTB23), IMX_PINCTRL_PIN(VF610_PAD_PTB24), IMX_PINCTRL_PIN(VF610_PAD_PTB25), IMX_PINCTRL_PIN(VF610_PAD_PTB26), IMX_PINCTRL_PIN(VF610_PAD_PTB27), IMX_PINCTRL_PIN(VF610_PAD_PTB28), IMX_PINCTRL_PIN(VF610_PAD_PTC26), IMX_PINCTRL_PIN(VF610_PAD_PTC27), IMX_PINCTRL_PIN(VF610_PAD_PTC28), IMX_PINCTRL_PIN(VF610_PAD_PTC29), IMX_PINCTRL_PIN(VF610_PAD_PTC30), IMX_PINCTRL_PIN(VF610_PAD_PTC31), IMX_PINCTRL_PIN(VF610_PAD_PTE0), IMX_PINCTRL_PIN(VF610_PAD_PTE1), IMX_PINCTRL_PIN(VF610_PAD_PTE2), IMX_PINCTRL_PIN(VF610_PAD_PTE3), IMX_PINCTRL_PIN(VF610_PAD_PTE4), IMX_PINCTRL_PIN(VF610_PAD_PTE5), IMX_PINCTRL_PIN(VF610_PAD_PTE6), IMX_PINCTRL_PIN(VF610_PAD_PTE7), IMX_PINCTRL_PIN(VF610_PAD_PTE8), IMX_PINCTRL_PIN(VF610_PAD_PTE9), IMX_PINCTRL_PIN(VF610_PAD_PTE10), IMX_PINCTRL_PIN(VF610_PAD_PTE11), IMX_PINCTRL_PIN(VF610_PAD_PTE12), IMX_PINCTRL_PIN(VF610_PAD_PTE13), IMX_PINCTRL_PIN(VF610_PAD_PTE14), IMX_PINCTRL_PIN(VF610_PAD_PTE15), IMX_PINCTRL_PIN(VF610_PAD_PTE16), IMX_PINCTRL_PIN(VF610_PAD_PTE17), IMX_PINCTRL_PIN(VF610_PAD_PTE18), IMX_PINCTRL_PIN(VF610_PAD_PTE19), IMX_PINCTRL_PIN(VF610_PAD_PTE20), IMX_PINCTRL_PIN(VF610_PAD_PTE21), IMX_PINCTRL_PIN(VF610_PAD_PTE22), IMX_PINCTRL_PIN(VF610_PAD_PTE23), IMX_PINCTRL_PIN(VF610_PAD_PTE24), IMX_PINCTRL_PIN(VF610_PAD_PTE25), IMX_PINCTRL_PIN(VF610_PAD_PTE26), IMX_PINCTRL_PIN(VF610_PAD_PTE27), IMX_PINCTRL_PIN(VF610_PAD_PTE28), IMX_PINCTRL_PIN(VF610_PAD_PTA7), }; static struct imx_pinctrl_soc_info vf610_pinctrl_info = { .pins = vf610_pinctrl_pads, .npins = ARRAY_SIZE(vf610_pinctrl_pads), .flags = SHARE_MUX_CONF_REG, }; static struct of_device_id vf610_pinctrl_of_match[] = { { .compatible = "fsl,vf610-iomuxc", }, { /* sentinel */ } }; static int vf610_pinctrl_probe(struct platform_device *pdev) { return imx_pinctrl_probe(pdev, &vf610_pinctrl_info); } static struct platform_driver vf610_pinctrl_driver = { .driver = { .name = "vf610-pinctrl", .owner = THIS_MODULE, .of_match_table = vf610_pinctrl_of_match, }, .probe = vf610_pinctrl_probe, .remove = imx_pinctrl_remove, }; static int __init vf610_pinctrl_init(void) { return platform_driver_register(&vf610_pinctrl_driver); } arch_initcall(vf610_pinctrl_init); static void __exit vf610_pinctrl_exit(void) { platform_driver_unregister(&vf610_pinctrl_driver); } module_exit(vf610_pinctrl_exit); MODULE_DESCRIPTION("Freescale VF610 pinctrl driver"); MODULE_LICENSE("GPL v2");
{ "pile_set_name": "Github" }
namespace PascalABCCompiler.SyntaxTree { public interface IVisitor { ///<summary> ///Method to visit expression. ///</summary> ///<param name="_expression">Node to visit</param> ///<returns> Return value is void </returns> void visit(expression _expression); ///<summary> ///Method to visit syntax_tree_node. ///</summary> ///<param name="_syntax_tree_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(syntax_tree_node _syntax_tree_node); ///<summary> ///Method to visit statement. ///</summary> ///<param name="_statement">Node to visit</param> ///<returns> Return value is void </returns> void visit(statement _statement); ///<summary> ///Method to visit statement_list. ///</summary> ///<param name="_statement_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(statement_list _statement_list); ///<summary> ///Method to visit ident. ///</summary> ///<param name="_ident">Node to visit</param> ///<returns> Return value is void </returns> void visit(ident _ident); ///<summary> ///Method to visit assign. ///</summary> ///<param name="_assign">Node to visit</param> ///<returns> Return value is void </returns> void visit(assign _assign); ///<summary> ///Method to visit bin_expr. ///</summary> ///<param name="_bin_expr">Node to visit</param> ///<returns> Return value is void </returns> void visit(bin_expr _bin_expr); ///<summary> ///Method to visit un_expr. ///</summary> ///<param name="_un_expr">Node to visit</param> ///<returns> Return value is void </returns> void visit(un_expr _un_expr); ///<summary> ///Method to visit const_node. ///</summary> ///<param name="_const_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(const_node _const_node); ///<summary> ///Method to visit bool_const. ///</summary> ///<param name="_bool_const">Node to visit</param> ///<returns> Return value is void </returns> void visit(bool_const _bool_const); ///<summary> ///Method to visit int32_const. ///</summary> ///<param name="_int32_const">Node to visit</param> ///<returns> Return value is void </returns> void visit(int32_const _int32_const); ///<summary> ///Method to visit double_const. ///</summary> ///<param name="_double_const">Node to visit</param> ///<returns> Return value is void </returns> void visit(double_const _double_const); ///<summary> ///Method to visit subprogram_body. ///</summary> ///<param name="_subprogram_body">Node to visit</param> ///<returns> Return value is void </returns> void visit(subprogram_body _subprogram_body); ///<summary> ///Method to visit addressed_value. ///</summary> ///<param name="_addressed_value">Node to visit</param> ///<returns> Return value is void </returns> void visit(addressed_value _addressed_value); ///<summary> ///Method to visit type_definition. ///</summary> ///<param name="_type_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(type_definition _type_definition); ///<summary> ///Method to visit roof_dereference. ///</summary> ///<param name="_roof_dereference">Node to visit</param> ///<returns> Return value is void </returns> void visit(roof_dereference _roof_dereference); ///<summary> ///Method to visit named_type_reference. ///</summary> ///<param name="_named_type_reference">Node to visit</param> ///<returns> Return value is void </returns> void visit(named_type_reference _named_type_reference); ///<summary> ///Method to visit variable_definitions. ///</summary> ///<param name="_variable_definitions">Node to visit</param> ///<returns> Return value is void </returns> void visit(variable_definitions _variable_definitions); ///<summary> ///Method to visit ident_list. ///</summary> ///<param name="_ident_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(ident_list _ident_list); ///<summary> ///Method to visit var_def_statement. ///</summary> ///<param name="_var_def_statement">Node to visit</param> ///<returns> Return value is void </returns> void visit(var_def_statement _var_def_statement); ///<summary> ///Method to visit declaration. ///</summary> ///<param name="_declaration">Node to visit</param> ///<returns> Return value is void </returns> void visit(declaration _declaration); ///<summary> ///Method to visit declarations. ///</summary> ///<param name="_declarations">Node to visit</param> ///<returns> Return value is void </returns> void visit(declarations _declarations); ///<summary> ///Method to visit program_tree. ///</summary> ///<param name="_program_tree">Node to visit</param> ///<returns> Return value is void </returns> void visit(program_tree _program_tree); ///<summary> ///Method to visit program_name. ///</summary> ///<param name="_program_name">Node to visit</param> ///<returns> Return value is void </returns> void visit(program_name _program_name); ///<summary> ///Method to visit string_const. ///</summary> ///<param name="_string_const">Node to visit</param> ///<returns> Return value is void </returns> void visit(string_const _string_const); ///<summary> ///Method to visit expression_list. ///</summary> ///<param name="_expression_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(expression_list _expression_list); ///<summary> ///Method to visit dereference. ///</summary> ///<param name="_dereference">Node to visit</param> ///<returns> Return value is void </returns> void visit(dereference _dereference); ///<summary> ///Method to visit indexer. ///</summary> ///<param name="_indexer">Node to visit</param> ///<returns> Return value is void </returns> void visit(indexer _indexer); ///<summary> ///Method to visit for_node. ///</summary> ///<param name="_for_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(for_node _for_node); ///<summary> ///Method to visit repeat_node. ///</summary> ///<param name="_repeat_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(repeat_node _repeat_node); ///<summary> ///Method to visit while_node. ///</summary> ///<param name="_while_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(while_node _while_node); ///<summary> ///Method to visit if_node. ///</summary> ///<param name="_if_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(if_node _if_node); ///<summary> ///Method to visit ref_type. ///</summary> ///<param name="_ref_type">Node to visit</param> ///<returns> Return value is void </returns> void visit(ref_type _ref_type); ///<summary> ///Method to visit diapason. ///</summary> ///<param name="_diapason">Node to visit</param> ///<returns> Return value is void </returns> void visit(diapason _diapason); ///<summary> ///Method to visit indexers_types. ///</summary> ///<param name="_indexers_types">Node to visit</param> ///<returns> Return value is void </returns> void visit(indexers_types _indexers_types); ///<summary> ///Method to visit array_type. ///</summary> ///<param name="_array_type">Node to visit</param> ///<returns> Return value is void </returns> void visit(array_type _array_type); ///<summary> ///Method to visit label_definitions. ///</summary> ///<param name="_label_definitions">Node to visit</param> ///<returns> Return value is void </returns> void visit(label_definitions _label_definitions); ///<summary> ///Method to visit procedure_attribute. ///</summary> ///<param name="_procedure_attribute">Node to visit</param> ///<returns> Return value is void </returns> void visit(procedure_attribute _procedure_attribute); ///<summary> ///Method to visit typed_parameters. ///</summary> ///<param name="_typed_parameters">Node to visit</param> ///<returns> Return value is void </returns> void visit(typed_parameters _typed_parameters); ///<summary> ///Method to visit formal_parameters. ///</summary> ///<param name="_formal_parameters">Node to visit</param> ///<returns> Return value is void </returns> void visit(formal_parameters _formal_parameters); ///<summary> ///Method to visit procedure_attributes_list. ///</summary> ///<param name="_procedure_attributes_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(procedure_attributes_list _procedure_attributes_list); ///<summary> ///Method to visit procedure_header. ///</summary> ///<param name="_procedure_header">Node to visit</param> ///<returns> Return value is void </returns> void visit(procedure_header _procedure_header); ///<summary> ///Method to visit function_header. ///</summary> ///<param name="_function_header">Node to visit</param> ///<returns> Return value is void </returns> void visit(function_header _function_header); ///<summary> ///Method to visit procedure_definition. ///</summary> ///<param name="_procedure_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(procedure_definition _procedure_definition); ///<summary> ///Method to visit type_declaration. ///</summary> ///<param name="_type_declaration">Node to visit</param> ///<returns> Return value is void </returns> void visit(type_declaration _type_declaration); ///<summary> ///Method to visit type_declarations. ///</summary> ///<param name="_type_declarations">Node to visit</param> ///<returns> Return value is void </returns> void visit(type_declarations _type_declarations); ///<summary> ///Method to visit simple_const_definition. ///</summary> ///<param name="_simple_const_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(simple_const_definition _simple_const_definition); ///<summary> ///Method to visit typed_const_definition. ///</summary> ///<param name="_typed_const_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(typed_const_definition _typed_const_definition); ///<summary> ///Method to visit const_definition. ///</summary> ///<param name="_const_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(const_definition _const_definition); ///<summary> ///Method to visit consts_definitions_list. ///</summary> ///<param name="_consts_definitions_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(consts_definitions_list _consts_definitions_list); ///<summary> ///Method to visit unit_name. ///</summary> ///<param name="_unit_name">Node to visit</param> ///<returns> Return value is void </returns> void visit(unit_name _unit_name); ///<summary> ///Method to visit unit_or_namespace. ///</summary> ///<param name="_unit_or_namespace">Node to visit</param> ///<returns> Return value is void </returns> void visit(unit_or_namespace _unit_or_namespace); ///<summary> ///Method to visit uses_unit_in. ///</summary> ///<param name="_uses_unit_in">Node to visit</param> ///<returns> Return value is void </returns> void visit(uses_unit_in _uses_unit_in); ///<summary> ///Method to visit uses_list. ///</summary> ///<param name="_uses_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(uses_list _uses_list); ///<summary> ///Method to visit program_body. ///</summary> ///<param name="_program_body">Node to visit</param> ///<returns> Return value is void </returns> void visit(program_body _program_body); ///<summary> ///Method to visit compilation_unit. ///</summary> ///<param name="_compilation_unit">Node to visit</param> ///<returns> Return value is void </returns> void visit(compilation_unit _compilation_unit); ///<summary> ///Method to visit unit_module. ///</summary> ///<param name="_unit_module">Node to visit</param> ///<returns> Return value is void </returns> void visit(unit_module _unit_module); ///<summary> ///Method to visit program_module. ///</summary> ///<param name="_program_module">Node to visit</param> ///<returns> Return value is void </returns> void visit(program_module _program_module); ///<summary> ///Method to visit hex_constant. ///</summary> ///<param name="_hex_constant">Node to visit</param> ///<returns> Return value is void </returns> void visit(hex_constant _hex_constant); ///<summary> ///Method to visit get_address. ///</summary> ///<param name="_get_address">Node to visit</param> ///<returns> Return value is void </returns> void visit(get_address _get_address); ///<summary> ///Method to visit case_variant. ///</summary> ///<param name="_case_variant">Node to visit</param> ///<returns> Return value is void </returns> void visit(case_variant _case_variant); ///<summary> ///Method to visit case_node. ///</summary> ///<param name="_case_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(case_node _case_node); ///<summary> ///Method to visit method_name. ///</summary> ///<param name="_method_name">Node to visit</param> ///<returns> Return value is void </returns> void visit(method_name _method_name); ///<summary> ///Method to visit dot_node. ///</summary> ///<param name="_dot_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(dot_node _dot_node); ///<summary> ///Method to visit empty_statement. ///</summary> ///<param name="_empty_statement">Node to visit</param> ///<returns> Return value is void </returns> void visit(empty_statement _empty_statement); ///<summary> ///Method to visit goto_statement. ///</summary> ///<param name="_goto_statement">Node to visit</param> ///<returns> Return value is void </returns> void visit(goto_statement _goto_statement); ///<summary> ///Method to visit labeled_statement. ///</summary> ///<param name="_labeled_statement">Node to visit</param> ///<returns> Return value is void </returns> void visit(labeled_statement _labeled_statement); ///<summary> ///Method to visit with_statement. ///</summary> ///<param name="_with_statement">Node to visit</param> ///<returns> Return value is void </returns> void visit(with_statement _with_statement); ///<summary> ///Method to visit method_call. ///</summary> ///<param name="_method_call">Node to visit</param> ///<returns> Return value is void </returns> void visit(method_call _method_call); ///<summary> ///Method to visit pascal_set_constant. ///</summary> ///<param name="_pascal_set_constant">Node to visit</param> ///<returns> Return value is void </returns> void visit(pascal_set_constant _pascal_set_constant); ///<summary> ///Method to visit array_const. ///</summary> ///<param name="_array_const">Node to visit</param> ///<returns> Return value is void </returns> void visit(array_const _array_const); ///<summary> ///Method to visit write_accessor_name. ///</summary> ///<param name="_write_accessor_name">Node to visit</param> ///<returns> Return value is void </returns> void visit(write_accessor_name _write_accessor_name); ///<summary> ///Method to visit read_accessor_name. ///</summary> ///<param name="_read_accessor_name">Node to visit</param> ///<returns> Return value is void </returns> void visit(read_accessor_name _read_accessor_name); ///<summary> ///Method to visit property_accessors. ///</summary> ///<param name="_property_accessors">Node to visit</param> ///<returns> Return value is void </returns> void visit(property_accessors _property_accessors); ///<summary> ///Method to visit simple_property. ///</summary> ///<param name="_simple_property">Node to visit</param> ///<returns> Return value is void </returns> void visit(simple_property _simple_property); ///<summary> ///Method to visit index_property. ///</summary> ///<param name="_index_property">Node to visit</param> ///<returns> Return value is void </returns> void visit(index_property _index_property); ///<summary> ///Method to visit class_members. ///</summary> ///<param name="_class_members">Node to visit</param> ///<returns> Return value is void </returns> void visit(class_members _class_members); ///<summary> ///Method to visit access_modifer_node. ///</summary> ///<param name="_access_modifer_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(access_modifer_node _access_modifer_node); ///<summary> ///Method to visit class_body_list. ///</summary> ///<param name="_class_body_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(class_body_list _class_body_list); ///<summary> ///Method to visit class_definition. ///</summary> ///<param name="_class_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(class_definition _class_definition); ///<summary> ///Method to visit default_indexer_property_node. ///</summary> ///<param name="_default_indexer_property_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(default_indexer_property_node _default_indexer_property_node); ///<summary> ///Method to visit known_type_definition. ///</summary> ///<param name="_known_type_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(known_type_definition _known_type_definition); ///<summary> ///Method to visit set_type_definition. ///</summary> ///<param name="_set_type_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(set_type_definition _set_type_definition); ///<summary> ///Method to visit record_const_definition. ///</summary> ///<param name="_record_const_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(record_const_definition _record_const_definition); ///<summary> ///Method to visit record_const. ///</summary> ///<param name="_record_const">Node to visit</param> ///<returns> Return value is void </returns> void visit(record_const _record_const); ///<summary> ///Method to visit record_type. ///</summary> ///<param name="_record_type">Node to visit</param> ///<returns> Return value is void </returns> void visit(record_type _record_type); ///<summary> ///Method to visit enum_type_definition. ///</summary> ///<param name="_enum_type_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(enum_type_definition _enum_type_definition); ///<summary> ///Method to visit char_const. ///</summary> ///<param name="_char_const">Node to visit</param> ///<returns> Return value is void </returns> void visit(char_const _char_const); ///<summary> ///Method to visit raise_statement. ///</summary> ///<param name="_raise_statement">Node to visit</param> ///<returns> Return value is void </returns> void visit(raise_statement _raise_statement); ///<summary> ///Method to visit sharp_char_const. ///</summary> ///<param name="_sharp_char_const">Node to visit</param> ///<returns> Return value is void </returns> void visit(sharp_char_const _sharp_char_const); ///<summary> ///Method to visit literal_const_line. ///</summary> ///<param name="_literal_const_line">Node to visit</param> ///<returns> Return value is void </returns> void visit(literal_const_line _literal_const_line); ///<summary> ///Method to visit string_num_definition. ///</summary> ///<param name="_string_num_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(string_num_definition _string_num_definition); ///<summary> ///Method to visit variant. ///</summary> ///<param name="_variant">Node to visit</param> ///<returns> Return value is void </returns> void visit(variant _variant); ///<summary> ///Method to visit variant_list. ///</summary> ///<param name="_variant_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(variant_list _variant_list); ///<summary> ///Method to visit variant_type. ///</summary> ///<param name="_variant_type">Node to visit</param> ///<returns> Return value is void </returns> void visit(variant_type _variant_type); ///<summary> ///Method to visit variant_types. ///</summary> ///<param name="_variant_types">Node to visit</param> ///<returns> Return value is void </returns> void visit(variant_types _variant_types); ///<summary> ///Method to visit variant_record_type. ///</summary> ///<param name="_variant_record_type">Node to visit</param> ///<returns> Return value is void </returns> void visit(variant_record_type _variant_record_type); ///<summary> ///Method to visit procedure_call. ///</summary> ///<param name="_procedure_call">Node to visit</param> ///<returns> Return value is void </returns> void visit(procedure_call _procedure_call); ///<summary> ///Method to visit class_predefinition. ///</summary> ///<param name="_class_predefinition">Node to visit</param> ///<returns> Return value is void </returns> void visit(class_predefinition _class_predefinition); ///<summary> ///Method to visit nil_const. ///</summary> ///<param name="_nil_const">Node to visit</param> ///<returns> Return value is void </returns> void visit(nil_const _nil_const); ///<summary> ///Method to visit file_type_definition. ///</summary> ///<param name="_file_type_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(file_type_definition _file_type_definition); ///<summary> ///Method to visit constructor. ///</summary> ///<param name="_constructor">Node to visit</param> ///<returns> Return value is void </returns> void visit(constructor _constructor); ///<summary> ///Method to visit destructor. ///</summary> ///<param name="_destructor">Node to visit</param> ///<returns> Return value is void </returns> void visit(destructor _destructor); ///<summary> ///Method to visit inherited_method_call. ///</summary> ///<param name="_inherited_method_call">Node to visit</param> ///<returns> Return value is void </returns> void visit(inherited_method_call _inherited_method_call); ///<summary> ///Method to visit typecast_node. ///</summary> ///<param name="_typecast_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(typecast_node _typecast_node); ///<summary> ///Method to visit interface_node. ///</summary> ///<param name="_interface_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(interface_node _interface_node); ///<summary> ///Method to visit implementation_node. ///</summary> ///<param name="_implementation_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(implementation_node _implementation_node); ///<summary> ///Method to visit diap_expr. ///</summary> ///<param name="_diap_expr">Node to visit</param> ///<returns> Return value is void </returns> void visit(diap_expr _diap_expr); ///<summary> ///Method to visit block. ///</summary> ///<param name="_block">Node to visit</param> ///<returns> Return value is void </returns> void visit(block _block); ///<summary> ///Method to visit proc_block. ///</summary> ///<param name="_proc_block">Node to visit</param> ///<returns> Return value is void </returns> void visit(proc_block _proc_block); ///<summary> ///Method to visit array_of_named_type_definition. ///</summary> ///<param name="_array_of_named_type_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(array_of_named_type_definition _array_of_named_type_definition); ///<summary> ///Method to visit array_of_const_type_definition. ///</summary> ///<param name="_array_of_const_type_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(array_of_const_type_definition _array_of_const_type_definition); ///<summary> ///Method to visit literal. ///</summary> ///<param name="_literal">Node to visit</param> ///<returns> Return value is void </returns> void visit(literal _literal); ///<summary> ///Method to visit case_variants. ///</summary> ///<param name="_case_variants">Node to visit</param> ///<returns> Return value is void </returns> void visit(case_variants _case_variants); ///<summary> ///Method to visit diapason_expr. ///</summary> ///<param name="_diapason_expr">Node to visit</param> ///<returns> Return value is void </returns> void visit(diapason_expr _diapason_expr); ///<summary> ///Method to visit var_def_list_for_record. ///</summary> ///<param name="_var_def_list_for_record">Node to visit</param> ///<returns> Return value is void </returns> void visit(var_def_list_for_record _var_def_list_for_record); ///<summary> ///Method to visit record_type_parts. ///</summary> ///<param name="_record_type_parts">Node to visit</param> ///<returns> Return value is void </returns> void visit(record_type_parts _record_type_parts); ///<summary> ///Method to visit property_array_default. ///</summary> ///<param name="_property_array_default">Node to visit</param> ///<returns> Return value is void </returns> void visit(property_array_default _property_array_default); ///<summary> ///Method to visit property_interface. ///</summary> ///<param name="_property_interface">Node to visit</param> ///<returns> Return value is void </returns> void visit(property_interface _property_interface); ///<summary> ///Method to visit property_parameter. ///</summary> ///<param name="_property_parameter">Node to visit</param> ///<returns> Return value is void </returns> void visit(property_parameter _property_parameter); ///<summary> ///Method to visit property_parameter_list. ///</summary> ///<param name="_property_parameter_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(property_parameter_list _property_parameter_list); ///<summary> ///Method to visit inherited_ident. ///</summary> ///<param name="_inherited_ident">Node to visit</param> ///<returns> Return value is void </returns> void visit(inherited_ident _inherited_ident); ///<summary> ///Method to visit format_expr. ///</summary> ///<param name="_format_expr">Node to visit</param> ///<returns> Return value is void </returns> void visit(format_expr _format_expr); ///<summary> ///Method to visit initfinal_part. ///</summary> ///<param name="_initfinal_part">Node to visit</param> ///<returns> Return value is void </returns> void visit(initfinal_part _initfinal_part); ///<summary> ///Method to visit token_info. ///</summary> ///<param name="_token_info">Node to visit</param> ///<returns> Return value is void </returns> void visit(token_info _token_info); ///<summary> ///Method to visit raise_stmt. ///</summary> ///<param name="_raise_stmt">Node to visit</param> ///<returns> Return value is void </returns> void visit(raise_stmt _raise_stmt); ///<summary> ///Method to visit op_type_node. ///</summary> ///<param name="_op_type_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(op_type_node _op_type_node); ///<summary> ///Method to visit file_type. ///</summary> ///<param name="_file_type">Node to visit</param> ///<returns> Return value is void </returns> void visit(file_type _file_type); ///<summary> ///Method to visit known_type_ident. ///</summary> ///<param name="_known_type_ident">Node to visit</param> ///<returns> Return value is void </returns> void visit(known_type_ident _known_type_ident); ///<summary> ///Method to visit exception_handler. ///</summary> ///<param name="_exception_handler">Node to visit</param> ///<returns> Return value is void </returns> void visit(exception_handler _exception_handler); ///<summary> ///Method to visit exception_ident. ///</summary> ///<param name="_exception_ident">Node to visit</param> ///<returns> Return value is void </returns> void visit(exception_ident _exception_ident); ///<summary> ///Method to visit exception_handler_list. ///</summary> ///<param name="_exception_handler_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(exception_handler_list _exception_handler_list); ///<summary> ///Method to visit exception_block. ///</summary> ///<param name="_exception_block">Node to visit</param> ///<returns> Return value is void </returns> void visit(exception_block _exception_block); ///<summary> ///Method to visit try_handler. ///</summary> ///<param name="_try_handler">Node to visit</param> ///<returns> Return value is void </returns> void visit(try_handler _try_handler); ///<summary> ///Method to visit try_handler_finally. ///</summary> ///<param name="_try_handler_finally">Node to visit</param> ///<returns> Return value is void </returns> void visit(try_handler_finally _try_handler_finally); ///<summary> ///Method to visit try_handler_except. ///</summary> ///<param name="_try_handler_except">Node to visit</param> ///<returns> Return value is void </returns> void visit(try_handler_except _try_handler_except); ///<summary> ///Method to visit try_stmt. ///</summary> ///<param name="_try_stmt">Node to visit</param> ///<returns> Return value is void </returns> void visit(try_stmt _try_stmt); ///<summary> ///Method to visit inherited_message. ///</summary> ///<param name="_inherited_message">Node to visit</param> ///<returns> Return value is void </returns> void visit(inherited_message _inherited_message); ///<summary> ///Method to visit external_directive. ///</summary> ///<param name="_external_directive">Node to visit</param> ///<returns> Return value is void </returns> void visit(external_directive _external_directive); ///<summary> ///Method to visit using_list. ///</summary> ///<param name="_using_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(using_list _using_list); ///<summary> ///Method to visit jump_stmt. ///</summary> ///<param name="_jump_stmt">Node to visit</param> ///<returns> Return value is void </returns> void visit(jump_stmt _jump_stmt); ///<summary> ///Method to visit loop_stmt. ///</summary> ///<param name="_loop_stmt">Node to visit</param> ///<returns> Return value is void </returns> void visit(loop_stmt _loop_stmt); ///<summary> ///Method to visit foreach_stmt. ///</summary> ///<param name="_foreach_stmt">Node to visit</param> ///<returns> Return value is void </returns> void visit(foreach_stmt _foreach_stmt); ///<summary> ///Method to visit addressed_value_funcname. ///</summary> ///<param name="_addressed_value_funcname">Node to visit</param> ///<returns> Return value is void </returns> void visit(addressed_value_funcname _addressed_value_funcname); ///<summary> ///Method to visit named_type_reference_list. ///</summary> ///<param name="_named_type_reference_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(named_type_reference_list _named_type_reference_list); ///<summary> ///Method to visit template_param_list. ///</summary> ///<param name="_template_param_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(template_param_list _template_param_list); ///<summary> ///Method to visit template_type_reference. ///</summary> ///<param name="_template_type_reference">Node to visit</param> ///<returns> Return value is void </returns> void visit(template_type_reference _template_type_reference); ///<summary> ///Method to visit int64_const. ///</summary> ///<param name="_int64_const">Node to visit</param> ///<returns> Return value is void </returns> void visit(int64_const _int64_const); ///<summary> ///Method to visit uint64_const. ///</summary> ///<param name="_uint64_const">Node to visit</param> ///<returns> Return value is void </returns> void visit(uint64_const _uint64_const); ///<summary> ///Method to visit new_expr. ///</summary> ///<param name="_new_expr">Node to visit</param> ///<returns> Return value is void </returns> void visit(new_expr _new_expr); ///<summary> ///Method to visit where_type_specificator_list. ///</summary> ///<param name="_where_type_specificator_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(where_type_specificator_list _where_type_specificator_list); ///<summary> ///Method to visit where_definition. ///</summary> ///<param name="_where_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(where_definition _where_definition); ///<summary> ///Method to visit where_definition_list. ///</summary> ///<param name="_where_definition_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(where_definition_list _where_definition_list); ///<summary> ///Method to visit sizeof_operator. ///</summary> ///<param name="_sizeof_operator">Node to visit</param> ///<returns> Return value is void </returns> void visit(sizeof_operator _sizeof_operator); ///<summary> ///Method to visit typeof_operator. ///</summary> ///<param name="_typeof_operator">Node to visit</param> ///<returns> Return value is void </returns> void visit(typeof_operator _typeof_operator); ///<summary> ///Method to visit compiler_directive. ///</summary> ///<param name="_compiler_directive">Node to visit</param> ///<returns> Return value is void </returns> void visit(compiler_directive _compiler_directive); ///<summary> ///Method to visit operator_name_ident. ///</summary> ///<param name="_operator_name_ident">Node to visit</param> ///<returns> Return value is void </returns> void visit(operator_name_ident _operator_name_ident); ///<summary> ///Method to visit var_statement. ///</summary> ///<param name="_var_statement">Node to visit</param> ///<returns> Return value is void </returns> void visit(var_statement _var_statement); ///<summary> ///Method to visit question_colon_expression. ///</summary> ///<param name="_question_colon_expression">Node to visit</param> ///<returns> Return value is void </returns> void visit(question_colon_expression _question_colon_expression); ///<summary> ///Method to visit expression_as_statement. ///</summary> ///<param name="_expression_as_statement">Node to visit</param> ///<returns> Return value is void </returns> void visit(expression_as_statement _expression_as_statement); ///<summary> ///Method to visit c_scalar_type. ///</summary> ///<param name="_c_scalar_type">Node to visit</param> ///<returns> Return value is void </returns> void visit(c_scalar_type _c_scalar_type); ///<summary> ///Method to visit c_module. ///</summary> ///<param name="_c_module">Node to visit</param> ///<returns> Return value is void </returns> void visit(c_module _c_module); ///<summary> ///Method to visit declarations_as_statement. ///</summary> ///<param name="_declarations_as_statement">Node to visit</param> ///<returns> Return value is void </returns> void visit(declarations_as_statement _declarations_as_statement); ///<summary> ///Method to visit array_size. ///</summary> ///<param name="_array_size">Node to visit</param> ///<returns> Return value is void </returns> void visit(array_size _array_size); ///<summary> ///Method to visit enumerator. ///</summary> ///<param name="_enumerator">Node to visit</param> ///<returns> Return value is void </returns> void visit(enumerator _enumerator); ///<summary> ///Method to visit enumerator_list. ///</summary> ///<param name="_enumerator_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(enumerator_list _enumerator_list); ///<summary> ///Method to visit c_for_cycle. ///</summary> ///<param name="_c_for_cycle">Node to visit</param> ///<returns> Return value is void </returns> void visit(c_for_cycle _c_for_cycle); ///<summary> ///Method to visit switch_stmt. ///</summary> ///<param name="_switch_stmt">Node to visit</param> ///<returns> Return value is void </returns> void visit(switch_stmt _switch_stmt); ///<summary> ///Method to visit type_definition_attr_list. ///</summary> ///<param name="_type_definition_attr_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(type_definition_attr_list _type_definition_attr_list); ///<summary> ///Method to visit type_definition_attr. ///</summary> ///<param name="_type_definition_attr">Node to visit</param> ///<returns> Return value is void </returns> void visit(type_definition_attr _type_definition_attr); ///<summary> ///Method to visit lock_stmt. ///</summary> ///<param name="_lock_stmt">Node to visit</param> ///<returns> Return value is void </returns> void visit(lock_stmt _lock_stmt); ///<summary> ///Method to visit compiler_directive_list. ///</summary> ///<param name="_compiler_directive_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(compiler_directive_list _compiler_directive_list); ///<summary> ///Method to visit compiler_directive_if. ///</summary> ///<param name="_compiler_directive_if">Node to visit</param> ///<returns> Return value is void </returns> void visit(compiler_directive_if _compiler_directive_if); ///<summary> ///Method to visit documentation_comment_list. ///</summary> ///<param name="_documentation_comment_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(documentation_comment_list _documentation_comment_list); ///<summary> ///Method to visit documentation_comment_tag. ///</summary> ///<param name="_documentation_comment_tag">Node to visit</param> ///<returns> Return value is void </returns> void visit(documentation_comment_tag _documentation_comment_tag); ///<summary> ///Method to visit documentation_comment_tag_param. ///</summary> ///<param name="_documentation_comment_tag_param">Node to visit</param> ///<returns> Return value is void </returns> void visit(documentation_comment_tag_param _documentation_comment_tag_param); ///<summary> ///Method to visit documentation_comment_section. ///</summary> ///<param name="_documentation_comment_section">Node to visit</param> ///<returns> Return value is void </returns> void visit(documentation_comment_section _documentation_comment_section); ///<summary> ///Method to visit token_taginfo. ///</summary> ///<param name="_token_taginfo">Node to visit</param> ///<returns> Return value is void </returns> void visit(token_taginfo _token_taginfo); ///<summary> ///Method to visit declaration_specificator. ///</summary> ///<param name="_declaration_specificator">Node to visit</param> ///<returns> Return value is void </returns> void visit(declaration_specificator _declaration_specificator); ///<summary> ///Method to visit ident_with_templateparams. ///</summary> ///<param name="_ident_with_templateparams">Node to visit</param> ///<returns> Return value is void </returns> void visit(ident_with_templateparams _ident_with_templateparams); ///<summary> ///Method to visit template_type_name. ///</summary> ///<param name="_template_type_name">Node to visit</param> ///<returns> Return value is void </returns> void visit(template_type_name _template_type_name); ///<summary> ///Method to visit default_operator. ///</summary> ///<param name="_default_operator">Node to visit</param> ///<returns> Return value is void </returns> void visit(default_operator _default_operator); ///<summary> ///Method to visit bracket_expr. ///</summary> ///<param name="_bracket_expr">Node to visit</param> ///<returns> Return value is void </returns> void visit(bracket_expr _bracket_expr); ///<summary> ///Method to visit attribute. ///</summary> ///<param name="_attribute">Node to visit</param> ///<returns> Return value is void </returns> void visit(attribute _attribute); ///<summary> ///Method to visit simple_attribute_list. ///</summary> ///<param name="_simple_attribute_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(simple_attribute_list _simple_attribute_list); ///<summary> ///Method to visit attribute_list. ///</summary> ///<param name="_attribute_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(attribute_list _attribute_list); ///<summary> ///Method to visit function_lambda_definition. ///</summary> ///<param name="_function_lambda_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(function_lambda_definition _function_lambda_definition); ///<summary> ///Method to visit function_lambda_call. ///</summary> ///<param name="_function_lambda_call">Node to visit</param> ///<returns> Return value is void </returns> void visit(function_lambda_call _function_lambda_call); ///<summary> ///Method to visit semantic_check. ///</summary> ///<param name="_semantic_check">Node to visit</param> ///<returns> Return value is void </returns> void visit(semantic_check _semantic_check); ///<summary> ///Method to visit lambda_inferred_type. ///</summary> ///<param name="_lambda_inferred_type">Node to visit</param> ///<returns> Return value is void </returns> void visit(lambda_inferred_type _lambda_inferred_type); ///<summary> ///Method to visit same_type_node. ///</summary> ///<param name="_same_type_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(same_type_node _same_type_node); ///<summary> ///Method to visit name_assign_expr. ///</summary> ///<param name="_name_assign_expr">Node to visit</param> ///<returns> Return value is void </returns> void visit(name_assign_expr _name_assign_expr); ///<summary> ///Method to visit name_assign_expr_list. ///</summary> ///<param name="_name_assign_expr_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(name_assign_expr_list _name_assign_expr_list); ///<summary> ///Method to visit unnamed_type_object. ///</summary> ///<param name="_unnamed_type_object">Node to visit</param> ///<returns> Return value is void </returns> void visit(unnamed_type_object _unnamed_type_object); ///<summary> ///Method to visit semantic_type_node. ///</summary> ///<param name="_semantic_type_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(semantic_type_node _semantic_type_node); ///<summary> ///Method to visit short_func_definition. ///</summary> ///<param name="_short_func_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(short_func_definition _short_func_definition); ///<summary> ///Method to visit no_type_foreach. ///</summary> ///<param name="_no_type_foreach">Node to visit</param> ///<returns> Return value is void </returns> void visit(no_type_foreach _no_type_foreach); ///<summary> ///Method to visit matching_expression. ///</summary> ///<param name="_matching_expression">Node to visit</param> ///<returns> Return value is void </returns> void visit(matching_expression _matching_expression); ///<summary> ///Method to visit closure_substituting_node. ///</summary> ///<param name="_closure_substituting_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(closure_substituting_node _closure_substituting_node); ///<summary> ///Method to visit sequence_type. ///</summary> ///<param name="_sequence_type">Node to visit</param> ///<returns> Return value is void </returns> void visit(sequence_type _sequence_type); ///<summary> ///Method to visit modern_proc_type. ///</summary> ///<param name="_modern_proc_type">Node to visit</param> ///<returns> Return value is void </returns> void visit(modern_proc_type _modern_proc_type); ///<summary> ///Method to visit yield_node. ///</summary> ///<param name="_yield_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(yield_node _yield_node); ///<summary> ///Method to visit template_operator_name. ///</summary> ///<param name="_template_operator_name">Node to visit</param> ///<returns> Return value is void </returns> void visit(template_operator_name _template_operator_name); ///<summary> ///Method to visit semantic_addr_value. ///</summary> ///<param name="_semantic_addr_value">Node to visit</param> ///<returns> Return value is void </returns> void visit(semantic_addr_value _semantic_addr_value); ///<summary> ///Method to visit pair_type_stlist. ///</summary> ///<param name="_pair_type_stlist">Node to visit</param> ///<returns> Return value is void </returns> void visit(pair_type_stlist _pair_type_stlist); ///<summary> ///Method to visit assign_tuple. ///</summary> ///<param name="_assign_tuple">Node to visit</param> ///<returns> Return value is void </returns> void visit(assign_tuple _assign_tuple); ///<summary> ///Method to visit addressed_value_list. ///</summary> ///<param name="_addressed_value_list">Node to visit</param> ///<returns> Return value is void </returns> void visit(addressed_value_list _addressed_value_list); ///<summary> ///Method to visit tuple_node. ///</summary> ///<param name="_tuple_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(tuple_node _tuple_node); ///<summary> ///Method to visit uses_closure. ///</summary> ///<param name="_uses_closure">Node to visit</param> ///<returns> Return value is void </returns> void visit(uses_closure _uses_closure); ///<summary> ///Method to visit dot_question_node. ///</summary> ///<param name="_dot_question_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(dot_question_node _dot_question_node); ///<summary> ///Method to visit slice_expr. ///</summary> ///<param name="_slice_expr">Node to visit</param> ///<returns> Return value is void </returns> void visit(slice_expr _slice_expr); ///<summary> ///Method to visit no_type. ///</summary> ///<param name="_no_type">Node to visit</param> ///<returns> Return value is void </returns> void visit(no_type _no_type); ///<summary> ///Method to visit yield_unknown_ident. ///</summary> ///<param name="_yield_unknown_ident">Node to visit</param> ///<returns> Return value is void </returns> void visit(yield_unknown_ident _yield_unknown_ident); ///<summary> ///Method to visit yield_unknown_expression_type. ///</summary> ///<param name="_yield_unknown_expression_type">Node to visit</param> ///<returns> Return value is void </returns> void visit(yield_unknown_expression_type _yield_unknown_expression_type); ///<summary> ///Method to visit yield_unknown_foreach_type. ///</summary> ///<param name="_yield_unknown_foreach_type">Node to visit</param> ///<returns> Return value is void </returns> void visit(yield_unknown_foreach_type _yield_unknown_foreach_type); ///<summary> ///Method to visit yield_sequence_node. ///</summary> ///<param name="_yield_sequence_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(yield_sequence_node _yield_sequence_node); ///<summary> ///Method to visit assign_var_tuple. ///</summary> ///<param name="_assign_var_tuple">Node to visit</param> ///<returns> Return value is void </returns> void visit(assign_var_tuple _assign_var_tuple); ///<summary> ///Method to visit slice_expr_question. ///</summary> ///<param name="_slice_expr_question">Node to visit</param> ///<returns> Return value is void </returns> void visit(slice_expr_question _slice_expr_question); ///<summary> ///Method to visit semantic_check_sugared_statement_node. ///</summary> ///<param name="_semantic_check_sugared_statement_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(semantic_check_sugared_statement_node _semantic_check_sugared_statement_node); ///<summary> ///Method to visit sugared_expression. ///</summary> ///<param name="_sugared_expression">Node to visit</param> ///<returns> Return value is void </returns> void visit(sugared_expression _sugared_expression); ///<summary> ///Method to visit sugared_addressed_value. ///</summary> ///<param name="_sugared_addressed_value">Node to visit</param> ///<returns> Return value is void </returns> void visit(sugared_addressed_value _sugared_addressed_value); ///<summary> ///Method to visit double_question_node. ///</summary> ///<param name="_double_question_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(double_question_node _double_question_node); ///<summary> ///Method to visit pattern_node. ///</summary> ///<param name="_pattern_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(pattern_node _pattern_node); ///<summary> ///Method to visit type_pattern. ///</summary> ///<param name="_type_pattern">Node to visit</param> ///<returns> Return value is void </returns> void visit(type_pattern _type_pattern); ///<summary> ///Method to visit is_pattern_expr. ///</summary> ///<param name="_is_pattern_expr">Node to visit</param> ///<returns> Return value is void </returns> void visit(is_pattern_expr _is_pattern_expr); ///<summary> ///Method to visit match_with. ///</summary> ///<param name="_match_with">Node to visit</param> ///<returns> Return value is void </returns> void visit(match_with _match_with); ///<summary> ///Method to visit pattern_case. ///</summary> ///<param name="_pattern_case">Node to visit</param> ///<returns> Return value is void </returns> void visit(pattern_case _pattern_case); ///<summary> ///Method to visit pattern_cases. ///</summary> ///<param name="_pattern_cases">Node to visit</param> ///<returns> Return value is void </returns> void visit(pattern_cases _pattern_cases); ///<summary> ///Method to visit deconstructor_pattern. ///</summary> ///<param name="_deconstructor_pattern">Node to visit</param> ///<returns> Return value is void </returns> void visit(deconstructor_pattern _deconstructor_pattern); ///<summary> ///Method to visit pattern_parameter. ///</summary> ///<param name="_pattern_parameter">Node to visit</param> ///<returns> Return value is void </returns> void visit(pattern_parameter _pattern_parameter); ///<summary> ///Method to visit desugared_deconstruction. ///</summary> ///<param name="_desugared_deconstruction">Node to visit</param> ///<returns> Return value is void </returns> void visit(desugared_deconstruction _desugared_deconstruction); ///<summary> ///Method to visit var_deconstructor_parameter. ///</summary> ///<param name="_var_deconstructor_parameter">Node to visit</param> ///<returns> Return value is void </returns> void visit(var_deconstructor_parameter _var_deconstructor_parameter); ///<summary> ///Method to visit recursive_deconstructor_parameter. ///</summary> ///<param name="_recursive_deconstructor_parameter">Node to visit</param> ///<returns> Return value is void </returns> void visit(recursive_deconstructor_parameter _recursive_deconstructor_parameter); ///<summary> ///Method to visit deconstruction_variables_definition. ///</summary> ///<param name="_deconstruction_variables_definition">Node to visit</param> ///<returns> Return value is void </returns> void visit(deconstruction_variables_definition _deconstruction_variables_definition); ///<summary> ///Method to visit var_tuple_def_statement. ///</summary> ///<param name="_var_tuple_def_statement">Node to visit</param> ///<returns> Return value is void </returns> void visit(var_tuple_def_statement _var_tuple_def_statement); ///<summary> ///Method to visit semantic_check_sugared_var_def_statement_node. ///</summary> ///<param name="_semantic_check_sugared_var_def_statement_node">Node to visit</param> ///<returns> Return value is void </returns> void visit(semantic_check_sugared_var_def_statement_node _semantic_check_sugared_var_def_statement_node); ///<summary> ///Method to visit const_pattern. ///</summary> ///<param name="_const_pattern">Node to visit</param> ///<returns> Return value is void </returns> void visit(const_pattern _const_pattern); ///<summary> ///Method to visit tuple_pattern_wild_card. ///</summary> ///<param name="_tuple_pattern_wild_card">Node to visit</param> ///<returns> Return value is void </returns> void visit(tuple_pattern_wild_card _tuple_pattern_wild_card); ///<summary> ///Method to visit const_pattern_parameter. ///</summary> ///<param name="_const_pattern_parameter">Node to visit</param> ///<returns> Return value is void </returns> void visit(const_pattern_parameter _const_pattern_parameter); ///<summary> ///Method to visit wild_card_deconstructor_parameter. ///</summary> ///<param name="_wild_card_deconstructor_parameter">Node to visit</param> ///<returns> Return value is void </returns> void visit(wild_card_deconstructor_parameter _wild_card_deconstructor_parameter); ///<summary> ///Method to visit collection_pattern. ///</summary> ///<param name="_collection_pattern">Node to visit</param> ///<returns> Return value is void </returns> void visit(collection_pattern _collection_pattern); ///<summary> ///Method to visit collection_pattern_gap_parameter. ///</summary> ///<param name="_collection_pattern_gap_parameter">Node to visit</param> ///<returns> Return value is void </returns> void visit(collection_pattern_gap_parameter _collection_pattern_gap_parameter); ///<summary> ///Method to visit collection_pattern_wild_card. ///</summary> ///<param name="_collection_pattern_wild_card">Node to visit</param> ///<returns> Return value is void </returns> void visit(collection_pattern_wild_card _collection_pattern_wild_card); ///<summary> ///Method to visit collection_pattern_var_parameter. ///</summary> ///<param name="_collection_pattern_var_parameter">Node to visit</param> ///<returns> Return value is void </returns> void visit(collection_pattern_var_parameter _collection_pattern_var_parameter); ///<summary> ///Method to visit recursive_collection_parameter. ///</summary> ///<param name="_recursive_collection_parameter">Node to visit</param> ///<returns> Return value is void </returns> void visit(recursive_collection_parameter _recursive_collection_parameter); ///<summary> ///Method to visit recursive_pattern_parameter. ///</summary> ///<param name="_recursive_pattern_parameter">Node to visit</param> ///<returns> Return value is void </returns> void visit(recursive_pattern_parameter _recursive_pattern_parameter); ///<summary> ///Method to visit tuple_pattern. ///</summary> ///<param name="_tuple_pattern">Node to visit</param> ///<returns> Return value is void </returns> void visit(tuple_pattern _tuple_pattern); ///<summary> ///Method to visit tuple_pattern_var_parameter. ///</summary> ///<param name="_tuple_pattern_var_parameter">Node to visit</param> ///<returns> Return value is void </returns> void visit(tuple_pattern_var_parameter _tuple_pattern_var_parameter); ///<summary> ///Method to visit recursive_tuple_parameter. ///</summary> ///<param name="_recursive_tuple_parameter">Node to visit</param> ///<returns> Return value is void </returns> void visit(recursive_tuple_parameter _recursive_tuple_parameter); ///<summary> ///Method to visit diapason_expr_new. ///</summary> ///<param name="_diapason_expr_new">Node to visit</param> ///<returns> Return value is void </returns> void visit(diapason_expr_new _diapason_expr_new); ///<summary> ///Method to visit if_expr_new. ///</summary> ///<param name="_if_expr_new">Node to visit</param> ///<returns> Return value is void </returns> void visit(if_expr_new _if_expr_new); ///<summary> ///Method to visit simple_expr_with_deref. ///</summary> ///<param name="_simple_expr_with_deref">Node to visit</param> ///<returns> Return value is void </returns> void visit(simple_expr_with_deref _simple_expr_with_deref); ///<summary> ///Method to visit index. ///</summary> ///<param name="_index">Node to visit</param> ///<returns> Return value is void </returns> void visit(index _index); ///<summary> ///Method to visit array_const_new. ///</summary> ///<param name="_array_const_new">Node to visit</param> ///<returns> Return value is void </returns> void visit(array_const_new _array_const_new); ///<summary> ///Method to visit semantic_ith_element_of. ///</summary> ///<param name="_semantic_ith_element_of">Node to visit</param> ///<returns> Return value is void </returns> void visit(semantic_ith_element_of _semantic_ith_element_of); } }
{ "pile_set_name": "Github" }
package com.xcompany.xproject.auth.server.controller; import java.util.List; import org.springframework.validation.FieldError; import org.springframework.validation.ObjectError; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class GenericResponse { private String message; private String error; public GenericResponse(final String message) { super(); this.message = message; } public GenericResponse(final String message, final String error) { super(); this.message = message; this.error = error; } public GenericResponse(final List<FieldError> fieldErrors, final List<ObjectError> globalErrors) { super(); final ObjectMapper mapper = new ObjectMapper(); try { this.message = mapper.writeValueAsString(fieldErrors); this.error = mapper.writeValueAsString(globalErrors); } catch (final JsonProcessingException e) { this.message = ""; this.error = ""; } } public String getMessage() { return message; } public void setMessage(final String message) { this.message = message; } public String getError() { return error; } public void setError(final String error) { this.error = error; } }
{ "pile_set_name": "Github" }
# Load the Rails application. require_relative 'application' # Initialize the Rails application. Rails.application.initialize!
{ "pile_set_name": "Github" }
--TEST-- Variables --INPUT-- SELECT @ --EXPECTED-- E SELECT v @
{ "pile_set_name": "Github" }
//@testable import BartyCrouchKit //import XCTest // //class CommandLineParserTests: XCTestCase { // func testIfCommentCommandIsAdded() { // CommandLineParser(arguments: ["bartycrouch", "code", "-p", ".", "-l", ".", "--override-comments"]).parse { _, subCommandOptions in // switch subCommandOptions { // case let .codeOptions(_, _, _, overrideComments, _, _, _, _, _): // XCTAssertTrue(overrideComments.value) // // default: // XCTAssertTrue(false) // } // } // // CommandLineParser(arguments: ["bartycrouch", "code", "-p", ".", "-l", ".", "-c"]).parse { _, subCommandOptions in // switch subCommandOptions { // case let .codeOptions(_, _, _, overrideComments, _, _, _, _, _): // XCTAssertTrue(overrideComments.value) // // default: // XCTAssertTrue(false) // } // } // } // // func testIfCommentCommandIsNotAdded() { // CommandLineParser( // arguments: ["bartycrouch", "translate", "-p", ".", "-i", "no", "-s", "abc", "-l", ".", "--override-comments"] // ).parse { _, subCommandOptions in // switch subCommandOptions { // case let .codeOptions(_, _, _, overrideComments, _, _, _, _, _): // XCTAssertTrue(!overrideComments.value) // // default: // XCTAssertTrue(true) // } // } // // CommandLineParser( // arguments: ["bartycrouch", "translate", "-p", ".", "-i", "no", "-s", "abc", "-l", ".", "-c"] // ).parse { _, subCommandOptions in // switch subCommandOptions { // case let .codeOptions(_, _, _, overrideComments, _, _, _, _, _): // XCTAssertTrue(!overrideComments.value) // // default: // XCTAssertTrue(true) // } // } // // CommandLineParser( // arguments: ["bartycrouch", "interfaces", "-p", ".", "-i", "no", "--override-comments"] // ).parse { _, subCommandOptions in // switch subCommandOptions { // case let .codeOptions(_, _, _, overrideComments, _, _, _, _, _): // XCTAssertTrue(!overrideComments.value) // // default: // XCTAssertTrue(true) // } // } // // CommandLineParser( // arguments: ["bartycrouch", "interfaces", "-p", ".", "-c"] // ).parse { _, subCommandOptions in // switch subCommandOptions { // case let .codeOptions(_, _, _, overrideComments, _, _, _, _, _): // XCTAssertTrue(!overrideComments.value) // // default: // XCTAssertTrue(true) // } // } // // CommandLineParser( // arguments: ["bartycrouch", "code", "-p", ".", "-l", "."] // ).parse { _, subCommandOptions in // switch subCommandOptions { // case let .codeOptions(_, _, _, overrideComments, _, _, _, _, _): // XCTAssertTrue(!overrideComments.value) // // default: // XCTAssertTrue(true) // } // } // } //}
{ "pile_set_name": "Github" }
[{000214A0-0000-0000-C000-000000000046}] Prop3=19,2 [InternetShortcut] URL=http://www.ecs.csus.edu/pc2/ IDList=
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-unknown-linux-gnu %s // Correct cases. typedef int __attribute__((mode(byte))) __attribute__((vector_size(256))) vec_t1; typedef int __attribute__((mode(QI))) __attribute__((vector_size(256))) vec_t2; typedef int __attribute__((mode(SI))) __attribute__((vector_size(256))) vec_t3; typedef int __attribute__((mode(DI))) __attribute__((vector_size(256)))vec_t4; typedef float __attribute__((mode(SF))) __attribute__((vector_size(256))) vec_t5; typedef float __attribute__((mode(DF))) __attribute__((vector_size(256))) vec_t6; typedef float __attribute__((mode(XF))) __attribute__((vector_size(256))) vec_t7; typedef int v8qi __attribute__ ((mode(QI))) __attribute__ ((vector_size(8))); typedef int v8qi __attribute__ ((mode(V8QI))); // expected-warning@-1{{specifying vector types with the 'mode' attribute is deprecated; use the 'vector_size' attribute instead}} typedef float v4sf __attribute__((mode(V4SF))); // expected-warning@-1{{specifying vector types with the 'mode' attribute is deprecated; use the 'vector_size' attribute instead}} typedef float v4sf __attribute__((mode(SF))) __attribute__ ((vector_size(16))); // Incorrect cases. typedef float __attribute__((mode(QC))) __attribute__((vector_size(256))) vec_t8; // expected-error@-1{{unsupported machine mode 'QC'}} // expected-error@-2{{type of machine mode does not match type of base type}} typedef _Complex float __attribute__((mode(HC))) __attribute__((vector_size(256))) vec_t9; // expected-error@-1{{unsupported machine mode 'HC'}} // expected-error@-2{{invalid vector element type '_Complex float'}} typedef int __attribute__((mode(SC))) __attribute__((vector_size(256))) vec_t10; // expected-error@-1{{type of machine mode does not match type of base type}} // expected-error@-2{{type of machine mode does not support base vector types}} typedef float __attribute__((mode(DC))) __attribute__((vector_size(256))) vec_t11; // expected-error@-1{{type of machine mode does not match type of base type}} // expected-error@-2{{type of machine mode does not support base vector types}} typedef _Complex float __attribute__((mode(XC))) __attribute__((vector_size(256))) vec_t12; // expected-error@-1{{invalid vector element type '_Complex float'}} typedef int __attribute__((mode(V3QI))) v3qi; // expected-error@-1{{unknown machine mode 'V3QI'}}
{ "pile_set_name": "Github" }
/* * Copyright (c) 2015 The WebM 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. */ #include "vpx_dsp/mips/common_dspr2.h" #if HAVE_DSPR2 uint8_t vpx_ff_cropTbl_a[256 + 2 * CROP_WIDTH]; uint8_t *vpx_ff_cropTbl; void vpx_dsputil_static_init(void) { int i; for (i = 0; i < 256; i++) vpx_ff_cropTbl_a[i + CROP_WIDTH] = i; for (i = 0; i < CROP_WIDTH; i++) { vpx_ff_cropTbl_a[i] = 0; vpx_ff_cropTbl_a[i + CROP_WIDTH + 256] = 255; } vpx_ff_cropTbl = &vpx_ff_cropTbl_a[CROP_WIDTH]; } #endif
{ "pile_set_name": "Github" }
# Test IShellItem and related interfaces from win32com.shell import shell, shellcon, knownfolders import unittest class TestShellItem(unittest.TestCase): def assertShellItemsEqual(self, i1, i2): n1 = i1.GetDisplayName(shellcon.SHGDN_FORPARSING) n2 = i2.GetDisplayName(shellcon.SHGDN_FORPARSING) self.assertEqual(n1, n2) def test_idlist_roundtrip(self): pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP) item = shell.SHCreateItemFromIDList(pidl, shell.IID_IShellItem) pidl_back = shell.SHGetIDListFromObject(item) self.assertEqual(pidl, pidl_back) def test_parsing_name(self): sf = shell.SHGetDesktopFolder() flags = shellcon.SHCONTF_FOLDERS | shellcon.SHCONTF_NONFOLDERS children = sf.EnumObjects(0, flags) child_pidl = children.next() name = sf.GetDisplayNameOf(child_pidl, shellcon.SHGDN_FORPARSING) item = shell.SHCreateItemFromParsingName(name, None, shell.IID_IShellItem) # test the name we get from the item is the same as from the folder. self.assertEqual(name, item.GetDisplayName(shellcon.SHGDN_FORPARSING)) def test_parsing_relative(self): desktop_pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP) desktop_item = shell.SHCreateItemFromIDList(desktop_pidl, shell.IID_IShellItem) sf = shell.SHGetDesktopFolder() flags = shellcon.SHCONTF_FOLDERS | shellcon.SHCONTF_NONFOLDERS children = sf.EnumObjects(0, flags) child_pidl = children.next() name_flags = shellcon.SHGDN_FORPARSING | shellcon.SHGDN_INFOLDER name = sf.GetDisplayNameOf(child_pidl, name_flags) item = shell.SHCreateItemFromRelativeName(desktop_item, name, None, shell.IID_IShellItem) # test the name we get from the item is the same as from the folder. self.assertEqual(name, item.GetDisplayName(name_flags)) def test_create_in_known_folder(self): item = shell.SHCreateItemInKnownFolder(knownfolders.FOLDERID_Desktop, 0, None, shell.IID_IShellItem) # this will do for now :) def test_create_item_with_parent(self): desktop_pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP) desktop_item = shell.SHCreateItemFromIDList(desktop_pidl, shell.IID_IShellItem) sf = shell.SHGetDesktopFolder() flags = shellcon.SHCONTF_FOLDERS | shellcon.SHCONTF_NONFOLDERS children = sf.EnumObjects(0, flags) child_pidl = children.next() item1 = shell.SHCreateItemWithParent(desktop_pidl, None, child_pidl, shell.IID_IShellItem) item2 = shell.SHCreateItemWithParent(None, sf, child_pidl, shell.IID_IShellItem) self.assertShellItemsEqual(item1, item2) if __name__=='__main__': unittest.main()
{ "pile_set_name": "Github" }
<?php /* +---------------------------------------------------------------------------+ | Revive Adserver | | http://www.revive-adserver.com | | | | Copyright: See the COPYRIGHT.txt file. | | License: GPLv2 or later, see the LICENSE.txt file. | +---------------------------------------------------------------------------+ */ require_once MAX_PATH . '/lib/OA/Maintenance/Priority/DeliveryLimitation.php'; require_once MAX_PATH . '/lib/pear/Date.php'; /** * @package OpenXMaintenance * @subpackage TestSuite */ class Test_OA_Maintenance_Priority_DeliveryLimitation_Date extends UnitTestCase { function setUp() { // Install the openXDeliveryLog plugin TestEnv::uninstallPluginPackage('openXDeliveryLimitations', false); TestEnv::installPluginPackage('openXDeliveryLimitations', false); } function tearDown() { // Uninstall the openXDeliveryLog plugin TestEnv::uninstallPluginPackage('openXDeliveryLimitations', false); } /** * A method to test the deliveryBlocked() method. * * Test 1: Test date == delivery requirement * Test 2: Test date != delivery requirement * Test 3: Test date <= delivery requirement * Test 4: Test date >= delivery requirement * Test 5: Test date < delivery requirement * Test 6: Test date > delivery requirement * Test 7: Bad input, no date object passed to method */ function testDeliveryBlocked() { // Set timezone to UTC OA_setTimeZoneUTC(); $oDate = new Date('2005-04-03'); $oEarlierDate = new Date('2005-04-02'); $oLaterDate = new Date('2005-04-04'); $limitationData = $oDate->format('%Y%m%d@%Z'); // Test 1 $aDeliveryLimitation = array( 'ad_id' => 1, 'logical' => 'and', 'type' => 'deliveryLimitations:Time:Date', 'comparison' => '==', 'data' => $limitationData, 'executionorder' => 1 ); $oLimitationDate = OA_Maintenance_Priority_DeliveryLimitation_Factory::factory($aDeliveryLimitation); // Test with same date: false, ad is active $this->assertFalse($oLimitationDate->deliveryBlocked($oDate)); // Test with ealier date: true, ad is inactive $this->assertTrue($oLimitationDate->deliveryBlocked($oEarlierDate)); // Test with later date: true, ad is inactive $this->assertTrue($oLimitationDate->deliveryBlocked($oLaterDate)); // Test 2 $aDeliveryLimitation = array( 'ad_id' => 1, 'logical' => 'and', 'type' => 'deliveryLimitations:Time:Date', 'comparison' => '!=', 'data' => $limitationData, 'executionorder' => 1 ); $oLimitationDate = OA_Maintenance_Priority_DeliveryLimitation_Factory::factory($aDeliveryLimitation); // Test with same date: true, ad is inactive $this->assertTrue($oLimitationDate->deliveryBlocked($oDate)); // Test with ealier date: false, ad is active $this->assertFalse($oLimitationDate->deliveryBlocked($oEarlierDate)); // Test with later date: false, ad is active $this->assertFalse($oLimitationDate->deliveryBlocked($oLaterDate)); // Test 3 $aDeliveryLimitation = array( 'ad_id' => 1, 'logical' => 'and', 'type' => 'deliveryLimitations:Time:Date', 'comparison' => '<=', 'data' => $limitationData, 'executionorder' => 1 ); $oLimitationDate = OA_Maintenance_Priority_DeliveryLimitation_Factory::factory($aDeliveryLimitation); // Test with same date: false, ad is active $this->assertFalse($oLimitationDate->deliveryBlocked($oDate)); // Test with ealier date: false, ad is active $this->assertFalse($oLimitationDate->deliveryBlocked($oEarlierDate)); // Test with later date: true, ad is inactive $this->assertTrue($oLimitationDate->deliveryBlocked($oLaterDate)); // Test 4 $aDeliveryLimitation = array( 'ad_id' => 1, 'logical' => 'and', 'type' => 'deliveryLimitations:Time:Date', 'comparison' => '>=', 'data' => $limitationData, 'executionorder' => 1 ); $oLimitationDate = OA_Maintenance_Priority_DeliveryLimitation_Factory::factory($aDeliveryLimitation); // Test with same date: false, ad is active $this->assertFalse($oLimitationDate->deliveryBlocked($oDate)); // Test with ealier date: true, ad is inactive $this->assertTrue($oLimitationDate->deliveryBlocked($oEarlierDate)); // Test with later date: false, ad is active $this->assertFalse($oLimitationDate->deliveryBlocked($oLaterDate)); // Test 5 $aDeliveryLimitation = array( 'ad_id' => 1, 'logical' => 'and', 'type' => 'deliveryLimitations:Time:Date', 'comparison' => '<', 'data' => $limitationData, 'executionorder' => 1 ); $oLimitationDate = OA_Maintenance_Priority_DeliveryLimitation_Factory::factory($aDeliveryLimitation); // Test with same date: true, ad is inactive $this->assertTrue($oLimitationDate->deliveryBlocked($oDate)); // Test with ealier date: false, ad is active $this->assertFalse($oLimitationDate->deliveryBlocked($oEarlierDate)); // Test with later date: true, ad is inactive $this->assertTrue($oLimitationDate->deliveryBlocked($oLaterDate)); // Test 6 $aDeliveryLimitation = array( 'ad_id' => 1, 'logical' => 'and', 'type' => 'deliveryLimitations:Time:Date', 'comparison' => '>', 'data' => $limitationData, 'executionorder' => 1 ); $oLimitationDate = OA_Maintenance_Priority_DeliveryLimitation_Factory::factory($aDeliveryLimitation); // Test with same date: true, ad is inactive $this->assertTrue($oLimitationDate->deliveryBlocked($oDate)); // Test with ealier date: true, ad is inactive $this->assertTrue($oLimitationDate->deliveryBlocked($oEarlierDate)); // Test with later date: false, ad is active $this->assertFalse($oLimitationDate->deliveryBlocked($oLaterDate)); // Test 7 $aDeliveryLimitation = array( 'ad_id' => 1, 'logical' => 'and', 'type' => 'deliveryLimitations:Time:Date', 'comparison' => '>', 'data' => $limitationData, 'executionorder' => 1 ); $oLimitationDate = OA_Maintenance_Priority_DeliveryLimitation_Factory::factory($aDeliveryLimitation); PEAR::pushErrorHandling(null); $this->assertTrue(is_a($oLimitationDate->deliveryBlocked('not a date'), 'pear_error')); PEAR::popErrorHandling(); // Test with PST timezone $limitationData = $oDate->format('%Y%m%d').'@America/New_York'; $aDeliveryLimitation = array( 'ad_id' => 1, 'logical' => 'and', 'type' => 'deliveryLimitations:Time:Date', 'comparison' => '==', 'data' => $limitationData, 'executionorder' => 1 ); $oLimitationDate = OA_Maintenance_Priority_DeliveryLimitation_Factory::factory($aDeliveryLimitation); // Test with same date (-1 day, 19pm in EST): true, ad is inactive $this->assertTrue($oLimitationDate->deliveryBlocked($oDate)); // Test with ealier date (-2 days, 19pm in EST): true, ad is inactive $this->assertTrue($oLimitationDate->deliveryBlocked($oEarlierDate)); // Test with later date (-0 days, 19pm in EST): false, ad is active $this->assertFalse($oLimitationDate->deliveryBlocked($oLaterDate)); // Reset timezone OA_setTimeZoneLocal(); } } ?>
{ "pile_set_name": "Github" }
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, install, // copy or use the software. // // // License Agreement // For Open Source Computer Vision Library // // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights reserved. // Third party copyrights are property of their respective owners. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistribution's of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * Redistribution's 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. // // * The name of the copyright holders may not 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 Intel Corporation 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. // //M*/ /* //////////////////////////////////////////////////////////////////// // // Filling CvMat/IplImage instances with random numbers // // */ #include "precomp.hpp" #if defined WIN32 || defined WINCE #include <windows.h> #undef small #undef min #undef max #undef abs #endif #if defined __SSE2__ || (defined _M_IX86_FP && 2 == _M_IX86_FP) #include "emmintrin.h" #endif namespace cv { ///////////////////////////// Functions Declaration ////////////////////////////////////// /* Multiply-with-carry generator is used here: temp = ( A*X(n) + carry ) X(n+1) = temp mod (2^32) carry = temp / (2^32) */ #define RNG_NEXT(x) ((uint64)(unsigned)(x)*CV_RNG_COEFF + ((x) >> 32)) /***************************************************************************************\ * Pseudo-Random Number Generators (PRNGs) * \***************************************************************************************/ template<typename T> static void randBits_( T* arr, int len, uint64* state, const Vec2i* p, bool small_flag ) { uint64 temp = *state; int i; if( !small_flag ) { for( i = 0; i <= len - 4; i += 4 ) { int t0, t1; temp = RNG_NEXT(temp); t0 = ((int)temp & p[i][0]) + p[i][1]; temp = RNG_NEXT(temp); t1 = ((int)temp & p[i+1][0]) + p[i+1][1]; arr[i] = saturate_cast<T>(t0); arr[i+1] = saturate_cast<T>(t1); temp = RNG_NEXT(temp); t0 = ((int)temp & p[i+2][0]) + p[i+2][1]; temp = RNG_NEXT(temp); t1 = ((int)temp & p[i+3][0]) + p[i+3][1]; arr[i+2] = saturate_cast<T>(t0); arr[i+3] = saturate_cast<T>(t1); } } else { for( i = 0; i <= len - 4; i += 4 ) { int t0, t1, t; temp = RNG_NEXT(temp); t = (int)temp; t0 = (t & p[i][0]) + p[i][1]; t1 = ((t >> 8) & p[i+1][0]) + p[i+1][1]; arr[i] = saturate_cast<T>(t0); arr[i+1] = saturate_cast<T>(t1); t0 = ((t >> 16) & p[i+2][0]) + p[i+2][1]; t1 = ((t >> 24) & p[i+3][0]) + p[i+3][1]; arr[i+2] = saturate_cast<T>(t0); arr[i+3] = saturate_cast<T>(t1); } } for( ; i < len; i++ ) { int t0; temp = RNG_NEXT(temp); t0 = ((int)temp & p[i][0]) + p[i][1]; arr[i] = saturate_cast<T>(t0); } *state = temp; } struct DivStruct { unsigned d; unsigned M; int sh1, sh2; int delta; }; template<typename T> static void randi_( T* arr, int len, uint64* state, const DivStruct* p ) { uint64 temp = *state; int i = 0; unsigned t0, t1, v0, v1; for( i = 0; i <= len - 4; i += 4 ) { temp = RNG_NEXT(temp); t0 = (unsigned)temp; temp = RNG_NEXT(temp); t1 = (unsigned)temp; v0 = (unsigned)(((uint64)t0 * p[i].M) >> 32); v1 = (unsigned)(((uint64)t1 * p[i+1].M) >> 32); v0 = (v0 + ((t0 - v0) >> p[i].sh1)) >> p[i].sh2; v1 = (v1 + ((t1 - v1) >> p[i+1].sh1)) >> p[i+1].sh2; v0 = t0 - v0*p[i].d + p[i].delta; v1 = t1 - v1*p[i+1].d + p[i+1].delta; arr[i] = saturate_cast<T>((int)v0); arr[i+1] = saturate_cast<T>((int)v1); temp = RNG_NEXT(temp); t0 = (unsigned)temp; temp = RNG_NEXT(temp); t1 = (unsigned)temp; v0 = (unsigned)(((uint64)t0 * p[i+2].M) >> 32); v1 = (unsigned)(((uint64)t1 * p[i+3].M) >> 32); v0 = (v0 + ((t0 - v0) >> p[i+2].sh1)) >> p[i+2].sh2; v1 = (v1 + ((t1 - v1) >> p[i+3].sh1)) >> p[i+3].sh2; v0 = t0 - v0*p[i+2].d + p[i+2].delta; v1 = t1 - v1*p[i+3].d + p[i+3].delta; arr[i+2] = saturate_cast<T>((int)v0); arr[i+3] = saturate_cast<T>((int)v1); } for( ; i < len; i++ ) { temp = RNG_NEXT(temp); t0 = (unsigned)temp; v0 = (unsigned)(((uint64)t0 * p[i].M) >> 32); v0 = (v0 + ((t0 - v0) >> p[i].sh1)) >> p[i].sh2; v0 = t0 - v0*p[i].d + p[i].delta; arr[i] = saturate_cast<T>((int)v0); } *state = temp; } #define DEF_RANDI_FUNC(suffix, type) \ static void randBits_##suffix(type* arr, int len, uint64* state, \ const Vec2i* p, bool small_flag) \ { randBits_(arr, len, state, p, small_flag); } \ \ static void randi_##suffix(type* arr, int len, uint64* state, \ const DivStruct* p, bool ) \ { randi_(arr, len, state, p); } DEF_RANDI_FUNC(8u, uchar) DEF_RANDI_FUNC(8s, schar) DEF_RANDI_FUNC(16u, ushort) DEF_RANDI_FUNC(16s, short) DEF_RANDI_FUNC(32s, int) static void randf_32f( float* arr, int len, uint64* state, const Vec2f* p, bool ) { uint64 temp = *state; int i = 0; for( ; i <= len - 4; i += 4 ) { float f[4]; f[0] = (float)(int)(temp = RNG_NEXT(temp)); f[1] = (float)(int)(temp = RNG_NEXT(temp)); f[2] = (float)(int)(temp = RNG_NEXT(temp)); f[3] = (float)(int)(temp = RNG_NEXT(temp)); // handwritten SSE is required not for performance but for numerical stability! // both 32-bit gcc and MSVC compilers trend to generate double precision SSE // while 64-bit compilers generate single precision SIMD instructions // so manual vectorisation forces all compilers to the single precision #if defined __SSE2__ || (defined _M_IX86_FP && 2 == _M_IX86_FP) __m128 q0 = _mm_loadu_ps((const float*)(p + i)); __m128 q1 = _mm_loadu_ps((const float*)(p + i + 2)); __m128 q01l = _mm_unpacklo_ps(q0, q1); __m128 q01h = _mm_unpackhi_ps(q0, q1); __m128 p0 = _mm_unpacklo_ps(q01l, q01h); __m128 p1 = _mm_unpackhi_ps(q01l, q01h); _mm_storeu_ps(arr + i, _mm_add_ps(_mm_mul_ps(_mm_loadu_ps(f), p0), p1)); #else arr[i+0] = f[0]*p[i+0][0] + p[i+0][1]; arr[i+1] = f[1]*p[i+1][0] + p[i+1][1]; arr[i+2] = f[2]*p[i+2][0] + p[i+2][1]; arr[i+3] = f[3]*p[i+3][0] + p[i+3][1]; #endif } for( ; i < len; i++ ) { temp = RNG_NEXT(temp); #if defined __SSE2__ || (defined _M_IX86_FP && 2 == _M_IX86_FP) _mm_store_ss(arr + i, _mm_add_ss( _mm_mul_ss(_mm_set_ss((float)(int)temp), _mm_set_ss(p[i][0])), _mm_set_ss(p[i][1])) ); #else arr[i] = (int)temp*p[i][0] + p[i][1]; #endif } *state = temp; } static void randf_64f( double* arr, int len, uint64* state, const Vec2d* p, bool ) { uint64 temp = *state; int64 v = 0; int i; for( i = 0; i <= len - 4; i += 4 ) { double f0, f1; temp = RNG_NEXT(temp); v = (temp >> 32)|(temp << 32); f0 = v*p[i][0] + p[i][1]; temp = RNG_NEXT(temp); v = (temp >> 32)|(temp << 32); f1 = v*p[i+1][0] + p[i+1][1]; arr[i] = f0; arr[i+1] = f1; temp = RNG_NEXT(temp); v = (temp >> 32)|(temp << 32); f0 = v*p[i+2][0] + p[i+2][1]; temp = RNG_NEXT(temp); v = (temp >> 32)|(temp << 32); f1 = v*p[i+3][0] + p[i+3][1]; arr[i+2] = f0; arr[i+3] = f1; } for( ; i < len; i++ ) { temp = RNG_NEXT(temp); v = (temp >> 32)|(temp << 32); arr[i] = v*p[i][0] + p[i][1]; } *state = temp; } typedef void (*RandFunc)(uchar* arr, int len, uint64* state, const void* p, bool small_flag); static RandFunc randTab[][8] = { { (RandFunc)randi_8u, (RandFunc)randi_8s, (RandFunc)randi_16u, (RandFunc)randi_16s, (RandFunc)randi_32s, (RandFunc)randf_32f, (RandFunc)randf_64f, 0 }, { (RandFunc)randBits_8u, (RandFunc)randBits_8s, (RandFunc)randBits_16u, (RandFunc)randBits_16s, (RandFunc)randBits_32s, 0, 0, 0 } }; /* The code below implements the algorithm described in "The Ziggurat Method for Generating Random Variables" by Marsaglia and Tsang, Journal of Statistical Software. */ static void randn_0_1_32f( float* arr, int len, uint64* state ) { const float r = 3.442620f; // The start of the right tail const float rng_flt = 2.3283064365386962890625e-10f; // 2^-32 static unsigned kn[128]; static float wn[128], fn[128]; uint64 temp = *state; static bool initialized=false; int i; if( !initialized ) { const double m1 = 2147483648.0; double dn = 3.442619855899, tn = dn, vn = 9.91256303526217e-3; // Set up the tables double q = vn/std::exp(-.5*dn*dn); kn[0] = (unsigned)((dn/q)*m1); kn[1] = 0; wn[0] = (float)(q/m1); wn[127] = (float)(dn/m1); fn[0] = 1.f; fn[127] = (float)std::exp(-.5*dn*dn); for(i=126;i>=1;i--) { dn = std::sqrt(-2.*std::log(vn/dn+std::exp(-.5*dn*dn))); kn[i+1] = (unsigned)((dn/tn)*m1); tn = dn; fn[i] = (float)std::exp(-.5*dn*dn); wn[i] = (float)(dn/m1); } initialized = true; } for( i = 0; i < len; i++ ) { float x, y; for(;;) { int hz = (int)temp; temp = RNG_NEXT(temp); int iz = hz & 127; x = hz*wn[iz]; if( (unsigned)std::abs(hz) < kn[iz] ) break; if( iz == 0) // iz==0, handles the base strip { do { x = (unsigned)temp*rng_flt; temp = RNG_NEXT(temp); y = (unsigned)temp*rng_flt; temp = RNG_NEXT(temp); x = (float)(-std::log(x+FLT_MIN)*0.2904764); y = (float)-std::log(y+FLT_MIN); } // .2904764 is 1/r while( y + y < x*x ); x = hz > 0 ? r + x : -r - x; break; } // iz > 0, handle the wedges of other strips y = (unsigned)temp*rng_flt; temp = RNG_NEXT(temp); if( fn[iz] + y*(fn[iz - 1] - fn[iz]) < std::exp(-.5*x*x) ) break; } arr[i] = x; } *state = temp; } double RNG::gaussian(double sigma) { float temp; randn_0_1_32f( &temp, 1, &state ); return temp*sigma; } template<typename T, typename PT> static void randnScale_( const float* src, T* dst, int len, int cn, const PT* mean, const PT* stddev, bool stdmtx ) { int i, j, k; if( !stdmtx ) { if( cn == 1 ) { PT b = mean[0], a = stddev[0]; for( i = 0; i < len; i++ ) dst[i] = saturate_cast<T>(src[i]*a + b); } else { for( i = 0; i < len; i++, src += cn, dst += cn ) for( k = 0; k < cn; k++ ) dst[k] = saturate_cast<T>(src[k]*stddev[k] + mean[k]); } } else { for( i = 0; i < len; i++, src += cn, dst += cn ) { for( j = 0; j < cn; j++ ) { PT s = mean[j]; for( k = 0; k < cn; k++ ) s += src[k]*stddev[j*cn + k]; dst[j] = saturate_cast<T>(s); } } } } static void randnScale_8u( const float* src, uchar* dst, int len, int cn, const float* mean, const float* stddev, bool stdmtx ) { randnScale_(src, dst, len, cn, mean, stddev, stdmtx); } static void randnScale_8s( const float* src, schar* dst, int len, int cn, const float* mean, const float* stddev, bool stdmtx ) { randnScale_(src, dst, len, cn, mean, stddev, stdmtx); } static void randnScale_16u( const float* src, ushort* dst, int len, int cn, const float* mean, const float* stddev, bool stdmtx ) { randnScale_(src, dst, len, cn, mean, stddev, stdmtx); } static void randnScale_16s( const float* src, short* dst, int len, int cn, const float* mean, const float* stddev, bool stdmtx ) { randnScale_(src, dst, len, cn, mean, stddev, stdmtx); } static void randnScale_32s( const float* src, int* dst, int len, int cn, const float* mean, const float* stddev, bool stdmtx ) { randnScale_(src, dst, len, cn, mean, stddev, stdmtx); } static void randnScale_32f( const float* src, float* dst, int len, int cn, const float* mean, const float* stddev, bool stdmtx ) { randnScale_(src, dst, len, cn, mean, stddev, stdmtx); } static void randnScale_64f( const float* src, double* dst, int len, int cn, const double* mean, const double* stddev, bool stdmtx ) { randnScale_(src, dst, len, cn, mean, stddev, stdmtx); } typedef void (*RandnScaleFunc)(const float* src, uchar* dst, int len, int cn, const uchar*, const uchar*, bool); static RandnScaleFunc randnScaleTab[] = { (RandnScaleFunc)randnScale_8u, (RandnScaleFunc)randnScale_8s, (RandnScaleFunc)randnScale_16u, (RandnScaleFunc)randnScale_16s, (RandnScaleFunc)randnScale_32s, (RandnScaleFunc)randnScale_32f, (RandnScaleFunc)randnScale_64f, 0 }; void RNG::fill( InputOutputArray _mat, int disttype, InputArray _param1arg, InputArray _param2arg, bool saturateRange ) { Mat mat = _mat.getMat(), _param1 = _param1arg.getMat(), _param2 = _param2arg.getMat(); int depth = mat.depth(), cn = mat.channels(); AutoBuffer<double> _parambuf; int j, k, fast_int_mode = 0, smallFlag = 1; RandFunc func = 0; RandnScaleFunc scaleFunc = 0; CV_Assert(_param1.channels() == 1 && (_param1.rows == 1 || _param1.cols == 1) && (_param1.rows + _param1.cols - 1 == cn || _param1.rows + _param1.cols - 1 == 1 || (_param1.size() == Size(1, 4) && _param1.type() == CV_64F && cn <= 4))); CV_Assert( _param2.channels() == 1 && (((_param2.rows == 1 || _param2.cols == 1) && (_param2.rows + _param2.cols - 1 == cn || _param2.rows + _param2.cols - 1 == 1 || (_param1.size() == Size(1, 4) && _param1.type() == CV_64F && cn <= 4))) || (_param2.rows == cn && _param2.cols == cn && disttype == NORMAL))); Vec2i* ip = 0; Vec2d* dp = 0; Vec2f* fp = 0; DivStruct* ds = 0; uchar* mean = 0; uchar* stddev = 0; bool stdmtx = false; int n1 = (int)_param1.total(); int n2 = (int)_param2.total(); if( disttype == UNIFORM ) { _parambuf.allocate(cn*8 + n1 + n2); double* parambuf = _parambuf; double* p1 = (double*)_param1.data; double* p2 = (double*)_param2.data; if( !_param1.isContinuous() || _param1.type() != CV_64F || n1 != cn ) { Mat tmp(_param1.size(), CV_64F, parambuf); _param1.convertTo(tmp, CV_64F); p1 = parambuf; if( n1 < cn ) for( j = n1; j < cn; j++ ) p1[j] = p1[j-n1]; } if( !_param2.isContinuous() || _param2.type() != CV_64F || n2 != cn ) { Mat tmp(_param2.size(), CV_64F, parambuf + cn); _param2.convertTo(tmp, CV_64F); p2 = parambuf + cn; if( n2 < cn ) for( j = n2; j < cn; j++ ) p2[j] = p2[j-n2]; } if( depth <= CV_32S ) { ip = (Vec2i*)(parambuf + cn*2); for( j = 0, fast_int_mode = 1; j < cn; j++ ) { double a = min(p1[j], p2[j]); double b = max(p1[j], p2[j]); if( saturateRange ) { a = max(a, depth == CV_8U || depth == CV_16U ? 0. : depth == CV_8S ? -128. : depth == CV_16S ? -32768. : (double)INT_MIN); b = min(b, depth == CV_8U ? 256. : depth == CV_16U ? 65536. : depth == CV_8S ? 128. : depth == CV_16S ? 32768. : (double)INT_MAX); } ip[j][1] = cvCeil(a); int idiff = ip[j][0] = cvFloor(b) - ip[j][1] - 1; double diff = b - a; fast_int_mode &= diff <= 4294967296. && (idiff & (idiff+1)) == 0; if( fast_int_mode ) smallFlag &= idiff <= 255; else { if( diff > INT_MAX ) ip[j][0] = INT_MAX; if( a < INT_MIN/2 ) ip[j][1] = INT_MIN/2; } } if( !fast_int_mode ) { ds = (DivStruct*)(ip + cn); for( j = 0; j < cn; j++ ) { ds[j].delta = ip[j][1]; unsigned d = ds[j].d = (unsigned)(ip[j][0]+1); int l = 0; while(((uint64)1 << l) < d) l++; ds[j].M = (unsigned)(((uint64)1 << 32)*(((uint64)1 << l) - d)/d) + 1; ds[j].sh1 = min(l, 1); ds[j].sh2 = max(l - 1, 0); } } func = randTab[fast_int_mode][depth]; } else { double scale = depth == CV_64F ? 5.4210108624275221700372640043497e-20 : // 2**-64 2.3283064365386962890625e-10; // 2**-32 double maxdiff = saturateRange ? (double)FLT_MAX : DBL_MAX; // for each channel i compute such dparam[0][i] & dparam[1][i], // so that a signed 32/64-bit integer X is transformed to // the range [param1.val[i], param2.val[i]) using // dparam[1][i]*X + dparam[0][i] if( depth == CV_32F ) { fp = (Vec2f*)(parambuf + cn*2); for( j = 0; j < cn; j++ ) { fp[j][0] = (float)(std::min(maxdiff, p2[j] - p1[j])*scale); fp[j][1] = (float)((p2[j] + p1[j])*0.5); } } else { dp = (Vec2d*)(parambuf + cn*2); for( j = 0; j < cn; j++ ) { dp[j][0] = std::min(DBL_MAX, p2[j] - p1[j])*scale; dp[j][1] = ((p2[j] + p1[j])*0.5); } } func = randTab[0][depth]; } CV_Assert( func != 0 ); } else if( disttype == CV_RAND_NORMAL ) { _parambuf.allocate(MAX(n1, cn) + MAX(n2, cn)); double* parambuf = _parambuf; int ptype = depth == CV_64F ? CV_64F : CV_32F; int esz = (int)CV_ELEM_SIZE(ptype); if( _param1.isContinuous() && _param1.type() == ptype && n1 >= cn) mean = _param1.data; else { Mat tmp(_param1.size(), ptype, parambuf); _param1.convertTo(tmp, ptype); mean = (uchar*)parambuf; } if( n1 < cn ) for( j = n1*esz; j < cn*esz; j++ ) mean[j] = mean[j - n1*esz]; if( _param2.isContinuous() && _param2.type() == ptype && n2 >= cn) stddev = _param2.data; else { Mat tmp(_param2.size(), ptype, parambuf + MAX(n1, cn)); _param2.convertTo(tmp, ptype); stddev = (uchar*)(parambuf + MAX(n1, cn)); } if( n2 < cn ) for( j = n2*esz; j < cn*esz; j++ ) stddev[j] = stddev[j - n2*esz]; stdmtx = _param2.rows == cn && _param2.cols == cn; scaleFunc = randnScaleTab[depth]; CV_Assert( scaleFunc != 0 ); } else CV_Error( CV_StsBadArg, "Unknown distribution type" ); const Mat* arrays[] = {&mat, 0}; uchar* ptr; NAryMatIterator it(arrays, &ptr); int total = (int)it.size, blockSize = std::min((BLOCK_SIZE + cn - 1)/cn, total); size_t esz = mat.elemSize(); AutoBuffer<double> buf; uchar* param = 0; float* nbuf = 0; if( disttype == UNIFORM ) { buf.allocate(blockSize*cn*4); param = (uchar*)(double*)buf; if( ip ) { if( ds ) { DivStruct* p = (DivStruct*)param; for( j = 0; j < blockSize*cn; j += cn ) for( k = 0; k < cn; k++ ) p[j + k] = ds[k]; } else { Vec2i* p = (Vec2i*)param; for( j = 0; j < blockSize*cn; j += cn ) for( k = 0; k < cn; k++ ) p[j + k] = ip[k]; } } else if( fp ) { Vec2f* p = (Vec2f*)param; for( j = 0; j < blockSize*cn; j += cn ) for( k = 0; k < cn; k++ ) p[j + k] = fp[k]; } else { Vec2d* p = (Vec2d*)param; for( j = 0; j < blockSize*cn; j += cn ) for( k = 0; k < cn; k++ ) p[j + k] = dp[k]; } } else { buf.allocate((blockSize*cn+1)/2); nbuf = (float*)(double*)buf; } for( size_t i = 0; i < it.nplanes; i++, ++it ) { for( j = 0; j < total; j += blockSize ) { int len = std::min(total - j, blockSize); if( disttype == CV_RAND_UNI ) func( ptr, len*cn, &state, param, smallFlag != 0 ); else { randn_0_1_32f(nbuf, len*cn, &state); scaleFunc(nbuf, ptr, len, cn, mean, stddev, stdmtx); } ptr += len*esz; } } } #ifdef WIN32 #ifdef HAVE_WINRT // using C++11 thread attribute for local thread data __declspec( thread ) RNG* rng = NULL; void deleteThreadRNGData() { if (rng) delete rng; } RNG& theRNG() { if (!rng) { rng = new RNG; } return *rng; } #else #ifdef WINCE # define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF) #endif static DWORD tlsRNGKey = TLS_OUT_OF_INDEXES; void deleteThreadRNGData() { if( tlsRNGKey != TLS_OUT_OF_INDEXES ) delete (RNG*)TlsGetValue( tlsRNGKey ); } RNG& theRNG() { if( tlsRNGKey == TLS_OUT_OF_INDEXES ) { tlsRNGKey = TlsAlloc(); CV_Assert(tlsRNGKey != TLS_OUT_OF_INDEXES); } RNG* rng = (RNG*)TlsGetValue( tlsRNGKey ); if( !rng ) { rng = new RNG; TlsSetValue( tlsRNGKey, rng ); } return *rng; } #endif //HAVE_WINRT #else static pthread_key_t tlsRNGKey = 0; static pthread_once_t tlsRNGKeyOnce = PTHREAD_ONCE_INIT; static void deleteRNG(void* data) { delete (RNG*)data; } static void makeRNGKey() { int errcode = pthread_key_create(&tlsRNGKey, deleteRNG); CV_Assert(errcode == 0); } RNG& theRNG() { pthread_once(&tlsRNGKeyOnce, makeRNGKey); RNG* rng = (RNG*)pthread_getspecific(tlsRNGKey); if( !rng ) { rng = new RNG; pthread_setspecific(tlsRNGKey, rng); } return *rng; } #endif } void cv::setRNGSeed(int seed) { theRNG() = RNG(static_cast<uint64>(seed)); } void cv::randu(InputOutputArray dst, InputArray low, InputArray high) { theRNG().fill(dst, RNG::UNIFORM, low, high); } void cv::randn(InputOutputArray dst, InputArray mean, InputArray stddev) { theRNG().fill(dst, RNG::NORMAL, mean, stddev); } namespace cv { template<typename T> static void randShuffle_( Mat& _arr, RNG& rng, double iterFactor ) { int sz = _arr.rows*_arr.cols, iters = cvRound(iterFactor*sz); if( _arr.isContinuous() ) { T* arr = (T*)_arr.data; for( int i = 0; i < iters; i++ ) { int j = (unsigned)rng % sz, k = (unsigned)rng % sz; std::swap( arr[j], arr[k] ); } } else { uchar* data = _arr.data; size_t step = _arr.step; int cols = _arr.cols; for( int i = 0; i < iters; i++ ) { int j1 = (unsigned)rng % sz, k1 = (unsigned)rng % sz; int j0 = j1/cols, k0 = k1/cols; j1 -= j0*cols; k1 -= k0*cols; std::swap( ((T*)(data + step*j0))[j1], ((T*)(data + step*k0))[k1] ); } } } typedef void (*RandShuffleFunc)( Mat& dst, RNG& rng, double iterFactor ); } void cv::randShuffle( InputOutputArray _dst, double iterFactor, RNG* _rng ) { RandShuffleFunc tab[] = { 0, randShuffle_<uchar>, // 1 randShuffle_<ushort>, // 2 randShuffle_<Vec<uchar,3> >, // 3 randShuffle_<int>, // 4 0, randShuffle_<Vec<ushort,3> >, // 6 0, randShuffle_<Vec<int,2> >, // 8 0, 0, 0, randShuffle_<Vec<int,3> >, // 12 0, 0, 0, randShuffle_<Vec<int,4> >, // 16 0, 0, 0, 0, 0, 0, 0, randShuffle_<Vec<int,6> >, // 24 0, 0, 0, 0, 0, 0, 0, randShuffle_<Vec<int,8> > // 32 }; Mat dst = _dst.getMat(); RNG& rng = _rng ? *_rng : theRNG(); CV_Assert( dst.elemSize() <= 32 ); RandShuffleFunc func = tab[dst.elemSize()]; CV_Assert( func != 0 ); func( dst, rng, iterFactor ); } void cv::randShuffle_( InputOutputArray _dst, double iterFactor ) { randShuffle(_dst, iterFactor); } CV_IMPL void cvRandArr( CvRNG* _rng, CvArr* arr, int disttype, CvScalar param1, CvScalar param2 ) { cv::Mat mat = cv::cvarrToMat(arr); // !!! this will only work for current 64-bit MWC RNG !!! cv::RNG& rng = _rng ? (cv::RNG&)*_rng : cv::theRNG(); rng.fill(mat, disttype == CV_RAND_NORMAL ? cv::RNG::NORMAL : cv::RNG::UNIFORM, cv::Scalar(param1), cv::Scalar(param2) ); } CV_IMPL void cvRandShuffle( CvArr* arr, CvRNG* _rng, double iter_factor ) { cv::Mat dst = cv::cvarrToMat(arr); cv::RNG& rng = _rng ? (cv::RNG&)*_rng : cv::theRNG(); cv::randShuffle( dst, iter_factor, &rng ); } // Mersenne Twister random number generator. // Inspired by http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c /* A C-program for MT19937, with initialization improved 2002/1/26. Coded by Takuji Nishimura and Makoto Matsumoto. Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of its contributors may not 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. Any feedback is very welcome. http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) */ cv::RNG_MT19937::RNG_MT19937(unsigned s) { seed(s); } cv::RNG_MT19937::RNG_MT19937() { seed(5489U); } void cv::RNG_MT19937::seed(unsigned s) { state[0]= s; for (mti = 1; mti < N; mti++) { /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ state[mti] = (1812433253U * (state[mti - 1] ^ (state[mti - 1] >> 30)) + mti); } } unsigned cv::RNG_MT19937::next() { /* mag01[x] = x * MATRIX_A for x=0,1 */ static unsigned mag01[2] = { 0x0U, /*MATRIX_A*/ 0x9908b0dfU}; const unsigned UPPER_MASK = 0x80000000U; const unsigned LOWER_MASK = 0x7fffffffU; /* generate N words at one time */ if (mti >= N) { int kk = 0; for (; kk < N - M; ++kk) { unsigned y = (state[kk] & UPPER_MASK) | (state[kk + 1] & LOWER_MASK); state[kk] = state[kk + M] ^ (y >> 1) ^ mag01[y & 0x1U]; } for (; kk < N - 1; ++kk) { unsigned y = (state[kk] & UPPER_MASK) | (state[kk + 1] & LOWER_MASK); state[kk] = state[kk + (M - N)] ^ (y >> 1) ^ mag01[y & 0x1U]; } unsigned y = (state[N - 1] & UPPER_MASK) | (state[0] & LOWER_MASK); state[N - 1] = state[M - 1] ^ (y >> 1) ^ mag01[y & 0x1U]; mti = 0; } unsigned y = state[mti++]; /* Tempering */ y ^= (y >> 11); y ^= (y << 7) & 0x9d2c5680U; y ^= (y << 15) & 0xefc60000U; y ^= (y >> 18); return y; } cv::RNG_MT19937::operator unsigned() { return next(); } cv::RNG_MT19937::operator int() { return (int)next();} cv::RNG_MT19937::operator float() { return next() * (1.f / 4294967296.f); } cv::RNG_MT19937::operator double() { unsigned a = next() >> 5; unsigned b = next() >> 6; return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0); } int cv::RNG_MT19937::uniform(int a, int b) { return (int)(next() % (b - a) + a); } float cv::RNG_MT19937::uniform(float a, float b) { return ((float)*this)*(b - a) + a; } double cv::RNG_MT19937::uniform(double a, double b) { return ((double)*this)*(b - a) + a; } unsigned cv::RNG_MT19937::operator ()(unsigned b) { return next() % b; } unsigned cv::RNG_MT19937::operator ()() { return next(); } /* End of file. */
{ "pile_set_name": "Github" }
/* * Copyright (c) 2014, Oculus VR, 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. * */ #ifndef __UDP_PROXY_COMMON_H #define __UDP_PROXY_COMMON_H // System flow: /* UDPProxyClient: End user UDPProxyServer: open server, to route messages from end users that can't connect to each other using UDPForwarder class. UDPProxyCoordinator: Server somewhere, connected to by RakNet, to maintain a list of UDPProxyServer UDPProxyServer On startup, log into UDPProxyCoordinator and register self UDPProxyClient Wish to open route to X Send message to UDPProxyCoordinator containing X, desired timeout Wait for success or failure UDPProxyCoordinator: * Get openRouteRequest If no servers registered, return failure Add entry to memory chooseBestUDPProxyServer() (overridable, chooses at random by default) Query this server to StartForwarding(). Return success or failure If failure, choose another server from the remaining list. If none remaining, return failure. Else return success. * Disconnect: If disconnected system is pending client on openRouteRequest, delete that request If disconnected system is UDPProxyServer, remove from list. For each pending client for this server, choose from remaining servers. * Login: Add to UDPProxyServer list, validating password if set */ // Stored in the second byte after ID_UDP_PROXY_GENERAL // Otherwise MessageIdentifiers.h is too cluttered and will hit the limit on enumerations in a single byte enum UDPProxyMessages { ID_UDP_PROXY_FORWARDING_SUCCEEDED, ID_UDP_PROXY_FORWARDING_NOTIFICATION, ID_UDP_PROXY_NO_SERVERS_ONLINE, ID_UDP_PROXY_RECIPIENT_GUID_NOT_CONNECTED_TO_COORDINATOR, ID_UDP_PROXY_ALL_SERVERS_BUSY, ID_UDP_PROXY_IN_PROGRESS, ID_UDP_PROXY_FORWARDING_REQUEST_FROM_CLIENT_TO_COORDINATOR, ID_UDP_PROXY_PING_SERVERS_FROM_COORDINATOR_TO_CLIENT, ID_UDP_PROXY_PING_SERVERS_REPLY_FROM_CLIENT_TO_COORDINATOR, ID_UDP_PROXY_FORWARDING_REQUEST_FROM_COORDINATOR_TO_SERVER, ID_UDP_PROXY_FORWARDING_REPLY_FROM_SERVER_TO_COORDINATOR, ID_UDP_PROXY_LOGIN_REQUEST_FROM_SERVER_TO_COORDINATOR, ID_UDP_PROXY_LOGIN_SUCCESS_FROM_COORDINATOR_TO_SERVER, ID_UDP_PROXY_ALREADY_LOGGED_IN_FROM_COORDINATOR_TO_SERVER, ID_UDP_PROXY_NO_PASSWORD_SET_FROM_COORDINATOR_TO_SERVER, ID_UDP_PROXY_WRONG_PASSWORD_FROM_COORDINATOR_TO_SERVER }; #define UDP_FORWARDER_MAXIMUM_TIMEOUT (60000 * 10) #endif
{ "pile_set_name": "Github" }
/* ---------------------------------------------------------------------- * Copyright (C) 2010-2014 ARM Limited. All rights reserved. * * $Date: 19. March 2015 * $Revision: V.1.4.5 * * Project: CMSIS DSP Library * Title: arm_fir_q31.c * * Description: Q31 FIR filter processing function. * * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 * * 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 ARM LIMITED 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 "arm_math.h" /** * @ingroup groupFilters */ /** * @addtogroup FIR * @{ */ /** * @param[in] *S points to an instance of the Q31 FIR filter structure. * @param[in] *pSrc points to the block of input data. * @param[out] *pDst points to the block of output data. * @param[in] blockSize number of samples to process per call. * @return none. * * @details * <b>Scaling and Overflow Behavior:</b> * \par * The function is implemented using an internal 64-bit accumulator. * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. * Thus, if the accumulator result overflows it wraps around rather than clip. * In order to avoid overflows completely the input signal must be scaled down by log2(numTaps) bits. * After all multiply-accumulates are performed, the 2.62 accumulator is right shifted by 31 bits and saturated to 1.31 format to yield the final result. * * \par * Refer to the function <code>arm_fir_fast_q31()</code> for a faster but less precise implementation of this filter for Cortex-M3 and Cortex-M4. */ void arm_fir_q31( const arm_fir_instance_q31 * S, q31_t * pSrc, q31_t * pDst, uint32_t blockSize) { q31_t *pState = S->pState; /* State pointer */ q31_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */ q31_t *pStateCurnt; /* Points to the current sample of the state */ #ifndef ARM_MATH_CM0_FAMILY /* Run the below code for Cortex-M4 and Cortex-M3 */ q31_t x0, x1, x2; /* Temporary variables to hold state */ q31_t c0; /* Temporary variable to hold coefficient value */ q31_t *px; /* Temporary pointer for state */ q31_t *pb; /* Temporary pointer for coefficient buffer */ q63_t acc0, acc1, acc2; /* Accumulators */ uint32_t numTaps = S->numTaps; /* Number of filter coefficients in the filter */ uint32_t i, tapCnt, blkCnt, tapCntN3; /* Loop counters */ /* S->pState points to state array which contains previous frame (numTaps - 1) samples */ /* pStateCurnt points to the location where the new input data should be written */ pStateCurnt = &(S->pState[(numTaps - 1u)]); /* Apply loop unrolling and compute 4 output values simultaneously. * The variables acc0 ... acc3 hold output values that are being computed: * * acc0 = b[numTaps-1] * x[n-numTaps-1] + b[numTaps-2] * x[n-numTaps-2] + b[numTaps-3] * x[n-numTaps-3] +...+ b[0] * x[0] * acc1 = b[numTaps-1] * x[n-numTaps] + b[numTaps-2] * x[n-numTaps-1] + b[numTaps-3] * x[n-numTaps-2] +...+ b[0] * x[1] * acc2 = b[numTaps-1] * x[n-numTaps+1] + b[numTaps-2] * x[n-numTaps] + b[numTaps-3] * x[n-numTaps-1] +...+ b[0] * x[2] * acc3 = b[numTaps-1] * x[n-numTaps+2] + b[numTaps-2] * x[n-numTaps+1] + b[numTaps-3] * x[n-numTaps] +...+ b[0] * x[3] */ blkCnt = blockSize / 3; blockSize = blockSize - (3 * blkCnt); tapCnt = numTaps / 3; tapCntN3 = numTaps - (3 * tapCnt); /* First part of the processing with loop unrolling. Compute 4 outputs at a time. ** a second loop below computes the remaining 1 to 3 samples. */ while(blkCnt > 0u) { /* Copy three new input samples into the state buffer */ *pStateCurnt++ = *pSrc++; *pStateCurnt++ = *pSrc++; *pStateCurnt++ = *pSrc++; /* Set all accumulators to zero */ acc0 = 0; acc1 = 0; acc2 = 0; /* Initialize state pointer */ px = pState; /* Initialize coefficient pointer */ pb = pCoeffs; /* Read the first two samples from the state buffer: * x[n-numTaps], x[n-numTaps-1] */ x0 = *(px++); x1 = *(px++); /* Loop unrolling. Process 3 taps at a time. */ i = tapCnt; while(i > 0u) { /* Read the b[numTaps] coefficient */ c0 = *pb; /* Read x[n-numTaps-2] sample */ x2 = *(px++); /* Perform the multiply-accumulates */ acc0 += ((q63_t) x0 * c0); acc1 += ((q63_t) x1 * c0); acc2 += ((q63_t) x2 * c0); /* Read the coefficient and state */ c0 = *(pb + 1u); x0 = *(px++); /* Perform the multiply-accumulates */ acc0 += ((q63_t) x1 * c0); acc1 += ((q63_t) x2 * c0); acc2 += ((q63_t) x0 * c0); /* Read the coefficient and state */ c0 = *(pb + 2u); x1 = *(px++); /* update coefficient pointer */ pb += 3u; /* Perform the multiply-accumulates */ acc0 += ((q63_t) x2 * c0); acc1 += ((q63_t) x0 * c0); acc2 += ((q63_t) x1 * c0); /* Decrement the loop counter */ i--; } /* If the filter length is not a multiple of 3, compute the remaining filter taps */ i = tapCntN3; while(i > 0u) { /* Read coefficients */ c0 = *(pb++); /* Fetch 1 state variable */ x2 = *(px++); /* Perform the multiply-accumulates */ acc0 += ((q63_t) x0 * c0); acc1 += ((q63_t) x1 * c0); acc2 += ((q63_t) x2 * c0); /* Reuse the present sample states for next sample */ x0 = x1; x1 = x2; /* Decrement the loop counter */ i--; } /* Advance the state pointer by 3 to process the next group of 3 samples */ pState = pState + 3; /* The results in the 3 accumulators are in 2.30 format. Convert to 1.31 ** Then store the 3 outputs in the destination buffer. */ *pDst++ = (q31_t) (acc0 >> 31u); *pDst++ = (q31_t) (acc1 >> 31u); *pDst++ = (q31_t) (acc2 >> 31u); /* Decrement the samples loop counter */ blkCnt--; } /* If the blockSize is not a multiple of 3, compute any remaining output samples here. ** No loop unrolling is used. */ while(blockSize > 0u) { /* Copy one sample at a time into state buffer */ *pStateCurnt++ = *pSrc++; /* Set the accumulator to zero */ acc0 = 0; /* Initialize state pointer */ px = pState; /* Initialize Coefficient pointer */ pb = (pCoeffs); i = numTaps; /* Perform the multiply-accumulates */ do { acc0 += (q63_t) * (px++) * (*(pb++)); i--; } while(i > 0u); /* The result is in 2.62 format. Convert to 1.31 ** Then store the output in the destination buffer. */ *pDst++ = (q31_t) (acc0 >> 31u); /* Advance state pointer by 1 for the next sample */ pState = pState + 1; /* Decrement the samples loop counter */ blockSize--; } /* Processing is complete. ** Now copy the last numTaps - 1 samples to the satrt of the state buffer. ** This prepares the state buffer for the next function call. */ /* Points to the start of the state buffer */ pStateCurnt = S->pState; tapCnt = (numTaps - 1u) >> 2u; /* copy data */ while(tapCnt > 0u) { *pStateCurnt++ = *pState++; *pStateCurnt++ = *pState++; *pStateCurnt++ = *pState++; *pStateCurnt++ = *pState++; /* Decrement the loop counter */ tapCnt--; } /* Calculate remaining number of copies */ tapCnt = (numTaps - 1u) % 0x4u; /* Copy the remaining q31_t data */ while(tapCnt > 0u) { *pStateCurnt++ = *pState++; /* Decrement the loop counter */ tapCnt--; } #else /* Run the below code for Cortex-M0 */ q31_t *px; /* Temporary pointer for state */ q31_t *pb; /* Temporary pointer for coefficient buffer */ q63_t acc; /* Accumulator */ uint32_t numTaps = S->numTaps; /* Length of the filter */ uint32_t i, tapCnt, blkCnt; /* Loop counters */ /* S->pState buffer contains previous frame (numTaps - 1) samples */ /* pStateCurnt points to the location where the new input data should be written */ pStateCurnt = &(S->pState[(numTaps - 1u)]); /* Initialize blkCnt with blockSize */ blkCnt = blockSize; while(blkCnt > 0u) { /* Copy one sample at a time into state buffer */ *pStateCurnt++ = *pSrc++; /* Set the accumulator to zero */ acc = 0; /* Initialize state pointer */ px = pState; /* Initialize Coefficient pointer */ pb = pCoeffs; i = numTaps; /* Perform the multiply-accumulates */ do { /* acc = b[numTaps-1] * x[n-numTaps-1] + b[numTaps-2] * x[n-numTaps-2] + b[numTaps-3] * x[n-numTaps-3] +...+ b[0] * x[0] */ acc += (q63_t) * px++ * *pb++; i--; } while(i > 0u); /* The result is in 2.62 format. Convert to 1.31 ** Then store the output in the destination buffer. */ *pDst++ = (q31_t) (acc >> 31u); /* Advance state pointer by 1 for the next sample */ pState = pState + 1; /* Decrement the samples loop counter */ blkCnt--; } /* Processing is complete. ** Now copy the last numTaps - 1 samples to the starting of the state buffer. ** This prepares the state buffer for the next function call. */ /* Points to the start of the state buffer */ pStateCurnt = S->pState; /* Copy numTaps number of values */ tapCnt = numTaps - 1u; /* Copy the data */ while(tapCnt > 0u) { *pStateCurnt++ = *pState++; /* Decrement the loop counter */ tapCnt--; } #endif /* #ifndef ARM_MATH_CM0_FAMILY */ } /** * @} end of FIR group */
{ "pile_set_name": "Github" }
/**************************************************************************** ** Copyright (c) 2000-2003 Wayne Roth ** Copyright (c) 2004-2007 Stefan Sander ** Copyright (c) 2007 Michal Policht ** Copyright (c) 2008 Brandon Fosdick ** Copyright (c) 2009-2010 Liam Staskawicz ** Copyright (c) 2011 Debao Zhang ** All right reserved. ** Web: http://code.google.com/p/qextserialport/ ** ** Permission is hereby granted, free of charge, to any person obtaining ** a copy of this software and associated documentation files (the ** "Software"), to deal in the Software without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Software, and to ** permit persons to whom the Software is furnished to do so, subject to ** the following conditions: ** ** The above copyright notice and this permission notice shall be ** included in all copies or substantial portions of the Software. ** ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ** ****************************************************************************/ #ifndef _QEXTSERIALPORT_P_H_ #define _QEXTSERIALPORT_P_H_ // // W A R N I N G // ------------- // // This file is not part of the QESP API. It exists for the convenience // of other QESP classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include "qextserialport.h" #include <QtCore/QReadWriteLock> #ifdef Q_OS_UNIX # include <termios.h> #elif (defined Q_OS_WIN) # include <QtCore/qt_windows.h> #endif #include <stdlib.h> // This is QextSerialPort's read buffer, needed by posix system. // ref: QRingBuffer & QIODevicePrivateLinearBuffer class QextReadBuffer { public: inline QextReadBuffer(size_t growth=4096) : len(0), first(0), buf(0), capacity(0), basicBlockSize(growth) { } ~QextReadBuffer() { delete [] buf; } inline void clear() { first = buf; len = 0; } inline int size() const { return len; } inline bool isEmpty() const { return len == 0; } inline int read(char *target, int size) { int r = qMin(size, len); if (r == 1) { *target = *first; --len; ++first; } else { memcpy(target, first, r); len -= r; first += r; } return r; } inline char *reserve(size_t size) { if ((first - buf) + len + size > capacity) { size_t newCapacity = qMax(capacity, basicBlockSize); while (newCapacity < len + size) newCapacity *= 2; if (newCapacity > capacity) { // allocate more space char *newBuf = new char[newCapacity]; memmove(newBuf, first, len); delete [] buf; buf = newBuf; capacity = newCapacity; } else { // shift any existing data to make space memmove(buf, first, len); } first = buf; } char *writePtr = first + len; len += (int)size; return writePtr; } inline void chop(int size) { if (size >= len) { clear(); } else { len -= size; } } inline void squeeze() { if (first != buf) { memmove(buf, first, len); first = buf; } size_t newCapacity = basicBlockSize; while (newCapacity < size_t(len)) newCapacity *= 2; if (newCapacity < capacity) { char *tmp = static_cast<char *>(realloc(buf, newCapacity)); if (tmp) { buf = tmp; capacity = newCapacity; } } } inline QByteArray readAll() { char *f = first; int l = len; clear(); return QByteArray(f, l); } inline int readLine(char *target, int size) { int r = qMin(size, len); char *eol = static_cast<char *>(memchr(first, '\n', r)); if (eol) r = 1+(eol-first); memcpy(target, first, r); len -= r; first += r; return int(r); } inline bool canReadLine() const { return memchr(first, '\n', len); } private: int len; char *first; char *buf; size_t capacity; size_t basicBlockSize; }; class QWinEventNotifier; class QReadWriteLock; class QSocketNotifier; class QextSerialPortPrivate { Q_DECLARE_PUBLIC(QextSerialPort) public: QextSerialPortPrivate(QextSerialPort *q); ~QextSerialPortPrivate(); enum DirtyFlagEnum { DFE_BaudRate = 0x0001, DFE_Parity = 0x0002, DFE_StopBits = 0x0004, DFE_DataBits = 0x0008, DFE_Flow = 0x0010, DFE_TimeOut = 0x0100, DFE_ALL = 0x0fff, DFE_Settings_Mask = 0x00ff //without TimeOut }; mutable QReadWriteLock lock; QString port; PortSettings settings; QextReadBuffer readBuffer; int settingsDirtyFlags; ulong lastErr; QextSerialPort::QueryMode queryMode; // platform specific members #ifdef Q_OS_UNIX int fd; QSocketNotifier *readNotifier; struct termios currentTermios; struct termios oldTermios; #elif (defined Q_OS_WIN) HANDLE handle; OVERLAPPED overlap; COMMCONFIG commConfig; COMMTIMEOUTS commTimeouts; QWinEventNotifier *winEventNotifier; DWORD eventMask; QList<OVERLAPPED *> pendingWrites; QReadWriteLock *bytesToWriteLock; #endif /*fill PortSettings*/ void setBaudRate(BaudRateType baudRate, bool update=true); void setDataBits(DataBitsType dataBits, bool update=true); void setParity(ParityType parity, bool update=true); void setStopBits(StopBitsType stopbits, bool update=true); void setFlowControl(FlowType flow, bool update=true); void setTimeout(long millisec, bool update=true); void setPortSettings(const PortSettings &settings, bool update=true); void platformSpecificDestruct(); void platformSpecificInit(); void translateError(ulong error); void updatePortSettings(); qint64 readData_sys(char *data, qint64 maxSize); qint64 writeData_sys(const char *data, qint64 maxSize); void setDtr_sys(bool set=true); void setRts_sys(bool set=true); bool open_sys(QIODevice::OpenMode mode); bool close_sys(); bool flush_sys(); ulong lineStatus_sys(); qint64 bytesAvailable_sys() const; #ifdef Q_OS_WIN void _q_onWinEvent(HANDLE h); #endif void _q_canRead(); QextSerialPort *q_ptr; }; #endif //_QEXTSERIALPORT_P_H_
{ "pile_set_name": "Github" }
/*! jQuery UI - v1.11.4+CommonJS - 2015-08-28 * http://jqueryui.com * Includes: widget.js * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ (function( factory ) { if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define([ "jquery" ], factory ); } else if ( typeof exports === "object" ) { // Node/CommonJS factory( require( "jquery" ) ); } else { // Browser globals factory( jQuery ); } }(function( $ ) { /*! * jQuery UI Widget 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/jQuery.widget/ */ var widget_uuid = 0, widget_slice = Array.prototype.slice; $.cleanData = (function( orig ) { return function( elems ) { var events, elem, i; for ( i = 0; (elem = elems[i]) != null; i++ ) { try { // Only trigger remove when necessary to save time events = $._data( elem, "events" ); if ( events && events.remove ) { $( elem ).triggerHandler( "remove" ); } // http://bugs.jquery.com/ticket/8235 } catch ( e ) {} } orig( elems ); }; })( $.cleanData ); $.widget = function( name, base, prototype ) { var fullName, existingConstructor, constructor, basePrototype, // proxiedPrototype allows the provided prototype to remain unmodified // so that it can be used as a mixin for multiple widgets (#8876) proxiedPrototype = {}, namespace = name.split( "." )[ 0 ]; name = name.split( "." )[ 1 ]; fullName = namespace + "-" + name; if ( !prototype ) { prototype = base; base = $.Widget; } // create selector for plugin $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { return !!$.data( elem, fullName ); }; $[ namespace ] = $[ namespace ] || {}; existingConstructor = $[ namespace ][ name ]; constructor = $[ namespace ][ name ] = function( options, element ) { // allow instantiation without "new" keyword if ( !this._createWidget ) { return new constructor( options, element ); } // allow instantiation without initializing for simple inheritance // must use "new" keyword (the code above always passes args) if ( arguments.length ) { this._createWidget( options, element ); } }; // extend with the existing constructor to carry over any static properties $.extend( constructor, existingConstructor, { version: prototype.version, // copy the object used to create the prototype in case we need to // redefine the widget later _proto: $.extend( {}, prototype ), // track widgets that inherit from this widget in case this widget is // redefined after a widget inherits from it _childConstructors: [] }); basePrototype = new base(); // we need to make the options hash a property directly on the new instance // otherwise we'll modify the options hash on the prototype that we're // inheriting from basePrototype.options = $.widget.extend( {}, basePrototype.options ); $.each( prototype, function( prop, value ) { if ( !$.isFunction( value ) ) { proxiedPrototype[ prop ] = value; return; } proxiedPrototype[ prop ] = (function() { var _super = function() { return base.prototype[ prop ].apply( this, arguments ); }, _superApply = function( args ) { return base.prototype[ prop ].apply( this, args ); }; return function() { var __super = this._super, __superApply = this._superApply, returnValue; this._super = _super; this._superApply = _superApply; returnValue = value.apply( this, arguments ); this._super = __super; this._superApply = __superApply; return returnValue; }; })(); }); constructor.prototype = $.widget.extend( basePrototype, { // TODO: remove support for widgetEventPrefix // always use the name + a colon as the prefix, e.g., draggable:start // don't prefix for widgets that aren't DOM-based widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name }, proxiedPrototype, { constructor: constructor, namespace: namespace, widgetName: name, widgetFullName: fullName }); // If this widget is being redefined then we need to find all widgets that // are inheriting from it and redefine all of them so that they inherit from // the new version of this widget. We're essentially trying to replace one // level in the prototype chain. if ( existingConstructor ) { $.each( existingConstructor._childConstructors, function( i, child ) { var childPrototype = child.prototype; // redefine the child widget using the same prototype that was // originally used, but inherit from the new version of the base $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); }); // remove the list of existing child constructors from the old constructor // so the old child constructors can be garbage collected delete existingConstructor._childConstructors; } else { base._childConstructors.push( constructor ); } $.widget.bridge( name, constructor ); return constructor; }; $.widget.extend = function( target ) { var input = widget_slice.call( arguments, 1 ), inputIndex = 0, inputLength = input.length, key, value; for ( ; inputIndex < inputLength; inputIndex++ ) { for ( key in input[ inputIndex ] ) { value = input[ inputIndex ][ key ]; if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { // Clone objects if ( $.isPlainObject( value ) ) { target[ key ] = $.isPlainObject( target[ key ] ) ? $.widget.extend( {}, target[ key ], value ) : // Don't extend strings, arrays, etc. with objects $.widget.extend( {}, value ); // Copy everything else by reference } else { target[ key ] = value; } } } } return target; }; $.widget.bridge = function( name, object ) { var fullName = object.prototype.widgetFullName || name; $.fn[ name ] = function( options ) { var isMethodCall = typeof options === "string", args = widget_slice.call( arguments, 1 ), returnValue = this; if ( isMethodCall ) { this.each(function() { var methodValue, instance = $.data( this, fullName ); if ( options === "instance" ) { returnValue = instance; return false; } if ( !instance ) { return $.error( "cannot call methods on " + name + " prior to initialization; " + "attempted to call method '" + options + "'" ); } if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) { return $.error( "no such method '" + options + "' for " + name + " widget instance" ); } methodValue = instance[ options ].apply( instance, args ); if ( methodValue !== instance && methodValue !== undefined ) { returnValue = methodValue && methodValue.jquery ? returnValue.pushStack( methodValue.get() ) : methodValue; return false; } }); } else { // Allow multiple hashes to be passed on init if ( args.length ) { options = $.widget.extend.apply( null, [ options ].concat(args) ); } this.each(function() { var instance = $.data( this, fullName ); if ( instance ) { instance.option( options || {} ); if ( instance._init ) { instance._init(); } } else { $.data( this, fullName, new object( options, this ) ); } }); } return returnValue; }; }; $.Widget = function( /* options, element */ ) {}; $.Widget._childConstructors = []; $.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", defaultElement: "<div>", options: { disabled: false, // callbacks create: null }, _createWidget: function( options, element ) { element = $( element || this.defaultElement || this )[ 0 ]; this.element = $( element ); this.uuid = widget_uuid++; this.eventNamespace = "." + this.widgetName + this.uuid; this.bindings = $(); this.hoverable = $(); this.focusable = $(); if ( element !== this ) { $.data( element, this.widgetFullName, this ); this._on( true, this.element, { remove: function( event ) { if ( event.target === element ) { this.destroy(); } } }); this.document = $( element.style ? // element within the document element.ownerDocument : // element is window or document element.document || element ); this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); } this.options = $.widget.extend( {}, this.options, this._getCreateOptions(), options ); this._create(); this._trigger( "create", null, this._getCreateEventData() ); this._init(); }, _getCreateOptions: $.noop, _getCreateEventData: $.noop, _create: $.noop, _init: $.noop, destroy: function() { this._destroy(); // we can probably remove the unbind calls in 2.0 // all event bindings should go through this._on() this.element .unbind( this.eventNamespace ) .removeData( this.widgetFullName ) // support: jquery <1.6.3 // http://bugs.jquery.com/ticket/9413 .removeData( $.camelCase( this.widgetFullName ) ); this.widget() .unbind( this.eventNamespace ) .removeAttr( "aria-disabled" ) .removeClass( this.widgetFullName + "-disabled " + "ui-state-disabled" ); // clean up events and states this.bindings.unbind( this.eventNamespace ); this.hoverable.removeClass( "ui-state-hover" ); this.focusable.removeClass( "ui-state-focus" ); }, _destroy: $.noop, widget: function() { return this.element; }, option: function( key, value ) { var options = key, parts, curOption, i; if ( arguments.length === 0 ) { // don't return a reference to the internal hash return $.widget.extend( {}, this.options ); } if ( typeof key === "string" ) { // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } options = {}; parts = key.split( "." ); key = parts.shift(); if ( parts.length ) { curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); for ( i = 0; i < parts.length - 1; i++ ) { curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; curOption = curOption[ parts[ i ] ]; } key = parts.pop(); if ( arguments.length === 1 ) { return curOption[ key ] === undefined ? null : curOption[ key ]; } curOption[ key ] = value; } else { if ( arguments.length === 1 ) { return this.options[ key ] === undefined ? null : this.options[ key ]; } options[ key ] = value; } } this._setOptions( options ); return this; }, _setOptions: function( options ) { var key; for ( key in options ) { this._setOption( key, options[ key ] ); } return this; }, _setOption: function( key, value ) { this.options[ key ] = value; if ( key === "disabled" ) { this.widget() .toggleClass( this.widgetFullName + "-disabled", !!value ); // If the widget is becoming disabled, then nothing is interactive if ( value ) { this.hoverable.removeClass( "ui-state-hover" ); this.focusable.removeClass( "ui-state-focus" ); } } return this; }, enable: function() { return this._setOptions({ disabled: false }); }, disable: function() { return this._setOptions({ disabled: true }); }, _on: function( suppressDisabledCheck, element, handlers ) { var delegateElement, instance = this; // no suppressDisabledCheck flag, shuffle arguments if ( typeof suppressDisabledCheck !== "boolean" ) { handlers = element; element = suppressDisabledCheck; suppressDisabledCheck = false; } // no element argument, shuffle and use this.element if ( !handlers ) { handlers = element; element = this.element; delegateElement = this.widget(); } else { element = delegateElement = $( element ); this.bindings = this.bindings.add( element ); } $.each( handlers, function( event, handler ) { function handlerProxy() { // allow widgets to customize the disabled handling // - disabled as an array instead of boolean // - disabled class as method for disabling individual parts if ( !suppressDisabledCheck && ( instance.options.disabled === true || $( this ).hasClass( "ui-state-disabled" ) ) ) { return; } return ( typeof handler === "string" ? instance[ handler ] : handler ) .apply( instance, arguments ); } // copy the guid so direct unbinding works if ( typeof handler !== "string" ) { handlerProxy.guid = handler.guid = handler.guid || handlerProxy.guid || $.guid++; } var match = event.match( /^([\w:-]*)\s*(.*)$/ ), eventName = match[1] + instance.eventNamespace, selector = match[2]; if ( selector ) { delegateElement.delegate( selector, eventName, handlerProxy ); } else { element.bind( eventName, handlerProxy ); } }); }, _off: function( element, eventName ) { eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace; element.unbind( eventName ).undelegate( eventName ); // Clear the stack to avoid memory leaks (#10056) this.bindings = $( this.bindings.not( element ).get() ); this.focusable = $( this.focusable.not( element ).get() ); this.hoverable = $( this.hoverable.not( element ).get() ); }, _delay: function( handler, delay ) { function handlerProxy() { return ( typeof handler === "string" ? instance[ handler ] : handler ) .apply( instance, arguments ); } var instance = this; return setTimeout( handlerProxy, delay || 0 ); }, _hoverable: function( element ) { this.hoverable = this.hoverable.add( element ); this._on( element, { mouseenter: function( event ) { $( event.currentTarget ).addClass( "ui-state-hover" ); }, mouseleave: function( event ) { $( event.currentTarget ).removeClass( "ui-state-hover" ); } }); }, _focusable: function( element ) { this.focusable = this.focusable.add( element ); this._on( element, { focusin: function( event ) { $( event.currentTarget ).addClass( "ui-state-focus" ); }, focusout: function( event ) { $( event.currentTarget ).removeClass( "ui-state-focus" ); } }); }, _trigger: function( type, event, data ) { var prop, orig, callback = this.options[ type ]; data = data || {}; event = $.Event( event ); event.type = ( type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type ).toLowerCase(); // the original event may come from any element // so we need to reset the target on the new event event.target = this.element[ 0 ]; // copy original event properties over to the new event orig = event.originalEvent; if ( orig ) { for ( prop in orig ) { if ( !( prop in event ) ) { event[ prop ] = orig[ prop ]; } } } this.element.trigger( event, data ); return !( $.isFunction( callback ) && callback.apply( this.element[0], [ event ].concat( data ) ) === false || event.isDefaultPrevented() ); } }; $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { if ( typeof options === "string" ) { options = { effect: options }; } var hasOptions, effectName = !options ? method : options === true || typeof options === "number" ? defaultEffect : options.effect || defaultEffect; options = options || {}; if ( typeof options === "number" ) { options = { duration: options }; } hasOptions = !$.isEmptyObject( options ); options.complete = callback; if ( options.delay ) { element.delay( options.delay ); } if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { element[ method ]( options ); } else if ( effectName !== method && element[ effectName ] ) { element[ effectName ]( options.duration, options.easing, callback ); } else { element.queue(function( next ) { $( this )[ method ](); if ( callback ) { callback.call( element[ 0 ] ); } next(); }); } }; }); var widget = $.widget; }));
{ "pile_set_name": "Github" }
{ "action": { "misuse": { "variety": [ "Privilege abuse" ], "vector": [ "LAN access" ] } }, "actor": { "internal": { "motive": [ "Unknown", "Financial" ], "variety": [ "End-user" ] } }, "asset": { "assets": [ { "variety": "S - Database" } ], "cloud": [ "Unknown" ] }, "attribute": { "confidentiality": { "data": [ { "variety": "Personal" } ], "data_disclosure": "Yes", "data_victim": [ "Customer" ], "state": [ "Unknown" ] }, "integrity": { "notes": " misrepresented information on over 100 auto and homeowner policies by \"manipulating the company database and falsifying insurance applications", "variety": [ "Fraudulent transaction", "Misrepresentation" ] } }, "discovery_method": { "other": true }, "discovery_notes": "The California Department of Insurance began to investigate McGinley after receiving a complaint from her previous employer.", "impact": { "overall_rating": "Unknown" }, "incident_id": "848F849B-322C-4DCB-BC89-B8963C6C6A8A", "plus": { "analysis_status": "Finalized", "analyst": "Robert-Topper", "attribute": { "confidentiality": { "credit_monitoring": "Unknown", "data_abuse": "Yes" } }, "created": "2016-09-07T14:17:00Z", "dbir_year": 2017, "github": "8357", "master_id": "0FE312FE-390A-42F5-8D76-34E5F7D38E23", "modified": "2016-11-10T21:28:00Z", "timeline": { "notification": { "day": 28, "month": 8, "year": 2016 } } }, "reference": "http://www.kerngoldenempire.com/news/local-insurance-agent-arrested-on-counts-of-identity-theft-and-insurance-fraud; http://bakersfieldnow.com/news/local/bakersfield-insurance-agent-arrested-on-14-counts-of-id-theft-and-fraud", "schema_version": "1.3.4", "security_incident": "Confirmed", "source_id": "vcdb", "summary": "misrepresented information on over 100 auto and homeowner policies by \"manipulating the company database and falsifying insurance applications", "timeline": { "discovery": { "unit": "Years", "value": 7.0 }, "incident": { "year": 2016 } }, "victim": { "country": [ "US" ], "employee_count": "25001 to 50000", "industry": "5241", "locations_affected": 2, "region": [ "019021" ], "state": "CA", "victim_id": "Allstate Insurance" } }
{ "pile_set_name": "Github" }
/* * Axelor Business Solutions * * Copyright (C) 2020 Axelor (<http://axelor.com>). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * 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 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/>. */ package com.axelor.apps.hr.service.batch; import com.axelor.apps.base.db.Company; import com.axelor.apps.base.db.Period; import com.axelor.apps.base.db.repo.CompanyRepository; import com.axelor.apps.base.db.repo.PeriodRepository; import com.axelor.apps.hr.db.Employee; import com.axelor.apps.hr.db.HrBatch; import com.axelor.apps.hr.db.PayrollPreparation; import com.axelor.apps.hr.db.repo.EmploymentContractRepository; import com.axelor.apps.hr.db.repo.HrBatchRepository; import com.axelor.apps.hr.db.repo.PayrollPreparationRepository; import com.axelor.apps.hr.exception.IExceptionMessage; import com.axelor.apps.hr.service.PayrollPreparationService; import com.axelor.db.JPA; import com.axelor.exception.AxelorException; import com.axelor.exception.db.repo.ExceptionOriginRepository; import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.exception.service.TraceBackService; import com.axelor.i18n.I18n; import com.google.common.base.Joiner; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.inject.Inject; import com.google.inject.persist.Transactional; import java.lang.invoke.MethodHandles; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class BatchPayrollPreparationGeneration extends BatchStrategy { protected final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected int duplicateAnomaly; protected int configurationAnomaly; protected int total; protected HrBatch hrBatch; protected Company company; protected PayrollPreparationService payrollPreparationService; protected PayrollPreparationRepository payrollPreparationRepository; protected CompanyRepository companyRepository; protected PeriodRepository periodRepository; protected HrBatchRepository hrBatchRepository; @Inject public BatchPayrollPreparationGeneration( PayrollPreparationService payrollPreparationService, CompanyRepository companyRepository, PeriodRepository periodRepository, HrBatchRepository hrBatchRepository) { super(); this.payrollPreparationService = payrollPreparationService; this.companyRepository = companyRepository; this.periodRepository = periodRepository; this.hrBatchRepository = hrBatchRepository; } @Override protected void start() throws IllegalAccessException { super.start(); duplicateAnomaly = 0; configurationAnomaly = 0; total = 0; hrBatch = hrBatchRepository.find(batch.getHrBatch().getId()); if (hrBatch.getCompany() != null) { company = companyRepository.find(hrBatch.getCompany().getId()); } checkPoint(); } @Override protected void process() { List<Employee> employeeList = this.getEmployees(hrBatch); generatePayrollPreparations(employeeList); } public List<Employee> getEmployees(HrBatch hrBatch) { List<String> query = Lists.newArrayList(); if (!hrBatch.getEmployeeSet().isEmpty()) { String employeeIds = Joiner.on(',') .join(Iterables.transform(hrBatch.getEmployeeSet(), obj -> obj.getId().toString())); query.add("self.id IN (" + employeeIds + ")"); } if (!hrBatch.getPlanningSet().isEmpty()) { String planningIds = Joiner.on(',') .join(Iterables.transform(hrBatch.getPlanningSet(), obj -> obj.getId().toString())); query.add("self.weeklyPlanning.id IN (" + planningIds + ")"); } String liaison = query.isEmpty() ? "" : " AND"; if (hrBatch.getCompany() != null) { return JPA.all(Employee.class) .filter( Joiner.on(" AND ").join(query) + liaison + " self.mainEmploymentContract.payCompany = :company") .bind("company", hrBatch.getCompany()) .fetch(); } else { return JPA.all(Employee.class).filter(Joiner.on(" AND ").join(query)).fetch(); } } public void generatePayrollPreparations(List<Employee> employeeList) { for (Employee employee : employeeList) { try { employee = employeeRepository.find(employee.getId()); hrBatch = hrBatchRepository.find(batch.getHrBatch().getId()); if (hrBatch.getCompany() != null) { company = companyRepository.find(hrBatch.getCompany().getId()); } if (employee.getMainEmploymentContract() != null && employee.getMainEmploymentContract().getStatus() != EmploymentContractRepository.STATUS_CLOSED) { createPayrollPreparation(employee); } } catch (AxelorException e) { TraceBackService.trace(e, ExceptionOriginRepository.LEAVE_MANAGEMENT, batch.getId()); incrementAnomaly(); if (e.getCategory() == TraceBackRepository.CATEGORY_NO_UNIQUE_KEY) { duplicateAnomaly++; } else if (e.getCategory() == TraceBackRepository.CATEGORY_CONFIGURATION_ERROR) { configurationAnomaly++; } } finally { total++; JPA.clear(); } } } @Transactional(rollbackOn = {Exception.class}) public void createPayrollPreparation(Employee employee) throws AxelorException { String filter = "self.period = ?1 AND self.employee = ?2"; String companyFilter = filter + " AND self.company = ?3"; List<PayrollPreparation> payrollPreparationList = payrollPreparationRepository .all() .filter( (company != null) ? companyFilter : filter, hrBatch.getPeriod(), employee, company) .fetch(); log.debug("list : " + payrollPreparationList); if (!payrollPreparationList.isEmpty()) { throw new AxelorException( employee, TraceBackRepository.CATEGORY_NO_UNIQUE_KEY, I18n.get(IExceptionMessage.PAYROLL_PREPARATION_DUPLICATE), employee.getName(), (company != null) ? hrBatch.getCompany().getName() : null, hrBatch.getPeriod().getName()); } PayrollPreparation payrollPreparation = new PayrollPreparation(); if (company != null) { Company currentCompany = companyRepository.find(company.getId()); payrollPreparation.setCompany(currentCompany); } else { payrollPreparation.setCompany(employee.getMainEmploymentContract().getPayCompany()); } Period period = periodRepository.find(hrBatch.getPeriod().getId()); payrollPreparation.setEmployee(employee); payrollPreparation.setEmploymentContract(employee.getMainEmploymentContract()); payrollPreparation.setPeriod(period); payrollPreparationService.fillInPayrollPreparation(payrollPreparation); payrollPreparationRepository.save(payrollPreparation); updateEmployee(employee); } @Override protected void stop() { String comment = String.format( I18n.get(IExceptionMessage.BATCH_PAYROLL_PREPARATION_GENERATION_RECAP) + '\n', total); comment += String.format( I18n.get(IExceptionMessage.BATCH_PAYROLL_PREPARATION_SUCCESS_RECAP) + '\n', batch.getDone()); if (duplicateAnomaly > 0) { comment += String.format( I18n.get(IExceptionMessage.BATCH_PAYROLL_PREPARATION_DUPLICATE_RECAP) + '\n', duplicateAnomaly); } if (configurationAnomaly > 0) { comment += String.format( I18n.get(IExceptionMessage.BATCH_PAYROLL_PREPARATION_CONFIGURATION_RECAP) + '\n', configurationAnomaly); } addComment(comment); super.stop(); } }
{ "pile_set_name": "Github" }