text
stringlengths
2
100k
meta
dict
// wiki.ns_mgr.aliases.bgn ns_mgr.add_alias_bulk(" 6|Image 7|Image_talk 9|Obrolan_MediaWiki "); // wiki.ns_mgr.aliases.end // wiki.ns_mgr.subpages.bgn ns_mgr.get_by_id_or_new(1).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(2).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(3).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(4).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(5).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(7).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(8).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(9).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(10).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(11).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(12).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(13).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(15).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(828).subpages_enabled_('y'); ns_mgr.get_by_id_or_new(829).subpages_enabled_('y'); // wiki.ns_mgr.subpages.end
{ "pile_set_name": "Github" }
define(function (require) { var echarts = require('echarts'); echarts.dataTool = { version: '1.0.0', gexf: require('./gexf'), prepareBoxplotData: require('./prepareBoxplotData') }; return echarts.dataTool; });
{ "pile_set_name": "Github" }
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the email-2010-12-01.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.SimpleEmail.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; namespace Amazon.SimpleEmail.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for SetIdentityDkimEnabled operation /// </summary> public class SetIdentityDkimEnabledResponseUnmarshaller : XmlResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { SetIdentityDkimEnabledResponse response = new SetIdentityDkimEnabledResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.IsStartElement) { if(context.TestExpression("SetIdentityDkimEnabledResult", 2)) { UnmarshallResult(context, response); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context); } } } return response; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="response")] private static void UnmarshallResult(XmlUnmarshallerContext context, SetIdentityDkimEnabledResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) targetDepth += 2; while (context.ReadAtDepth(originalDepth)) { if (context.IsStartElement || context.IsAttribute) { } } return; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) { } return new AmazonSimpleEmailServiceException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode); } private static SetIdentityDkimEnabledResponseUnmarshaller _instance = new SetIdentityDkimEnabledResponseUnmarshaller(); internal static SetIdentityDkimEnabledResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static SetIdentityDkimEnabledResponseUnmarshaller Instance { get { return _instance; } } } }
{ "pile_set_name": "Github" }
############################################################################# # VLC-Qt - Qt and libvlc connector library # Copyright (C) 2016 Tadej Novak <[email protected]> # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, 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 Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see <http://www.gnu.org/licenses/>. ############################################################################# ADD_AUTO_TEST(Qml TestQml.cpp tst_video.qml )
{ "pile_set_name": "Github" }
# Tenko parser test case - Path: tests/testcases/operator_precedent/various_priority_checks_GENERATED/order_3_28generated_-_213d3d_7c_2a2a_2a_5e_7c7c_2626_3e_26_3e3e3e29.md > :: operator precedent : various priority checks GENERATED > > ::> order 3 28generated - 213d3d 7c 2a2a 2a 5e 7c7c 2626 3e 26 3e3e3e29 ## Input `````js a >>> b & c > d && e || f ^ g * h ** i | j !== k ````` ## Output _Note: the whole output block is auto-generated. Manual changes will be overwritten!_ Below follow outputs in five parsing modes: sloppy, sloppy+annexb, strict script, module, module+annexb. Note that the output parts are auto-generated by the test runner to reflect actual result. ### Sloppy mode Parsed with script goal and as if the code did not start with strict mode header. ````` ast: { type: 'Program', loc:{start:{line:1,column:0},end:{line:1,column:48},source:''}, body: [ { type: 'ExpressionStatement', loc:{start:{line:1,column:0},end:{line:1,column:48},source:''}, expression: { type: 'LogicalExpression', loc:{start:{line:1,column:0},end:{line:1,column:48},source:''}, left: { type: 'LogicalExpression', loc:{start:{line:1,column:0},end:{line:1,column:20},source:''}, left: { type: 'BinaryExpression', loc:{start:{line:1,column:0},end:{line:1,column:15},source:''}, left: { type: 'BinaryExpression', loc:{start:{line:1,column:0},end:{line:1,column:7},source:''}, left: { type: 'Identifier', loc:{start:{line:1,column:0},end:{line:1,column:1},source:''}, name: 'a' }, operator: '>>>', right: { type: 'Identifier', loc:{start:{line:1,column:6},end:{line:1,column:7},source:''}, name: 'b' } }, operator: '&', right: { type: 'BinaryExpression', loc:{start:{line:1,column:10},end:{line:1,column:15},source:''}, left: { type: 'Identifier', loc:{start:{line:1,column:10},end:{line:1,column:11},source:''}, name: 'c' }, operator: '>', right: { type: 'Identifier', loc:{start:{line:1,column:14},end:{line:1,column:15},source:''}, name: 'd' } } }, operator: '&&', right: { type: 'Identifier', loc:{start:{line:1,column:19},end:{line:1,column:20},source:''}, name: 'e' } }, operator: '||', right: { type: 'BinaryExpression', loc:{start:{line:1,column:24},end:{line:1,column:48},source:''}, left: { type: 'BinaryExpression', loc:{start:{line:1,column:24},end:{line:1,column:38},source:''}, left: { type: 'Identifier', loc:{start:{line:1,column:24},end:{line:1,column:25},source:''}, name: 'f' }, operator: '^', right: { type: 'BinaryExpression', loc:{start:{line:1,column:28},end:{line:1,column:38},source:''}, left: { type: 'Identifier', loc:{start:{line:1,column:28},end:{line:1,column:29},source:''}, name: 'g' }, operator: '*', right: { type: 'BinaryExpression', loc:{start:{line:1,column:32},end:{line:1,column:38},source:''}, left: { type: 'Identifier', loc:{start:{line:1,column:32},end:{line:1,column:33},source:''}, name: 'h' }, operator: '**', right: { type: 'Identifier', loc:{start:{line:1,column:37},end:{line:1,column:38},source:''}, name: 'i' } } } }, operator: '|', right: { type: 'BinaryExpression', loc:{start:{line:1,column:41},end:{line:1,column:48},source:''}, left: { type: 'Identifier', loc:{start:{line:1,column:41},end:{line:1,column:42},source:''}, name: 'j' }, operator: '!==', right: { type: 'Identifier', loc:{start:{line:1,column:47},end:{line:1,column:48},source:''}, name: 'k' } } } } } ] } tokens (23x): IDENT PUNC_GT_GT_GT IDENT PUNC_AND IDENT PUNC_GT IDENT PUNC_AND_AND IDENT PUNC_OR_OR IDENT PUNC_CARET IDENT PUNC_STAR IDENT PUNC_STAR_STAR IDENT PUNC_OR IDENT PUNC_EXCL_EQ_EQ IDENT ASI ````` ### Strict mode Parsed with script goal but as if it was starting with `"use strict"` at the top. _Output same as sloppy mode._ ### Module goal Parsed with the module goal. _Output same as sloppy mode._ ### Sloppy mode with AnnexB Parsed with script goal with AnnexB rules enabled and as if the code did not start with strict mode header. _Output same as sloppy mode._ ### Module goal with AnnexB Parsed with the module goal with AnnexB rules enabled. _Output same as sloppy mode._ ## AST Printer Printer output different from input [sloppy][annexb:no]: ````js (((((a >>> b) & (c > d)) && e)) || ((f ^ (g * (h ** i))) | (j !== k))); ```` Produces same AST
{ "pile_set_name": "Github" }
// Download the Node helper library from twilio.com/docs/node/install // These identifiers are your accountSid and authToken from // https://www.twilio.com/console const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; const authToken = 'your_auth_token'; const client = require('twilio')(accountSid, authToken); client.api.accounts.list().then(data => { return data.forEach(account => console.log(account.dateCreated)); });
{ "pile_set_name": "Github" }
//texture PrevFrameImage; //sampler2D sampler_main = sampler_state { Texture = <PrevFrameImage>; }; //float4 _c0; // source texsize (.xy), and inverse (.zw) //float4 _c5; // w1,w2,d1,d2 //float4 _c6; // w_div, edge_darken_c1, edge_darken_c2, edge_darken_c3 void PS( float2 uv : TEXCOORD, out float4 ret : COLOR0 ) { //SHORT VERTICAL PASS 2: //const float w1 = w[0]+w[1] + w[2]+w[3]; //const float w2 = w[4]+w[5] + w[6]+w[7]; //const float d1 = 0 + 2*((w[2]+w[3])/w1); //const float d2 = 2 + 2*((w[6]+w[7])/w2); //const float w_div = 1.0/((w1+w2)*2); #define srctexsize _c0 #define w1 _c5.x #define w2 _c5.y #define d1 _c5.z #define d2 _c5.w #define edge_darken_c1 _c6.y #define edge_darken_c2 _c6.z #define edge_darken_c3 _c6.w #define w_div _c6.x // note: if you just take one sample at exactly uv.xy, you get an avg of 4 pixels. //float2 uv2 = uv.xy;// + srctexsize.zw*float2(-0.5,-0.5); float2 uv2 = uv.xy + srctexsize.zw*float2(1,0); // + moves blur UP, LEFT by TWO-pixel increments! (since texture is 1/2 the size of blur1_ps) float3 blur = ( tex2D( sampler_main, uv2 + float2(0, d1*srctexsize.w) ).xyz + tex2D( sampler_main, uv2 + float2(0,-d1*srctexsize.w) ).xyz)*w1 + ( tex2D( sampler_main, uv2 + float2(0, d2*srctexsize.w) ).xyz + tex2D( sampler_main, uv2 + float2(0,-d2*srctexsize.w) ).xyz)*w2 ; blur.xyz *= w_div; // tone it down at the edges: (only happens on 1st X pass!) float t = min( min(uv.x, uv.y), 1-max(uv.x,uv.y) ); t = sqrt(t); t = edge_darken_c1 + edge_darken_c2*saturate(t*edge_darken_c3); blur.xyz *= t; ret.xyz = blur; ret.w = 1; //ret.xyzw = tex2D(sampler_main, uv + 0*srctexsize.zw); }
{ "pile_set_name": "Github" }
require 'test_helper' class ReportTest < MiniTest::Test def test_can_add_a_problem report = Pippi::Report.new report.add(Pippi::Problem.new(file_path: 'foo', line_number: 42, check_class: Pippi::Checks::SelectFollowedByFirst)) assert_equal 1, report.problems.size end def test_filters_duplicates report = Pippi::Report.new report.add(Pippi::Problem.new(file_path: 'foo', line_number: 42, check_class: Pippi::Checks::SelectFollowedByFirst)) report.add(Pippi::Problem.new(file_path: 'foo', line_number: 42, check_class: Pippi::Checks::SelectFollowedByFirst)) assert_equal 1, report.problems.size end def test_can_remove_problem report = Pippi::Report.new report.add(Pippi::Problem.new(file_path: 'foo', line_number: 42, check_class: Pippi::Checks::SelectFollowedByFirst)) report.remove 42, 'foo', Pippi::Checks::SelectFollowedByFirst assert report.problems.empty? end end
{ "pile_set_name": "Github" }
/* * Copyright (C) 2013 NVIDIA Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef DRM_TEGRA_SOR_H #define DRM_TEGRA_SOR_H #define SOR_CTXSW 0x00 #define SOR_SUPER_STATE0 0x01 #define SOR_SUPER_STATE1 0x02 #define SOR_SUPER_STATE_ATTACHED (1 << 3) #define SOR_SUPER_STATE_MODE_NORMAL (1 << 2) #define SOR_SUPER_STATE_HEAD_MODE_MASK (3 << 0) #define SOR_SUPER_STATE_HEAD_MODE_AWAKE (2 << 0) #define SOR_SUPER_STATE_HEAD_MODE_SNOOZE (1 << 0) #define SOR_SUPER_STATE_HEAD_MODE_SLEEP (0 << 0) #define SOR_STATE0 0x03 #define SOR_STATE1 0x04 #define SOR_STATE_ASY_PIXELDEPTH_MASK (0xf << 17) #define SOR_STATE_ASY_PIXELDEPTH_BPP_18_444 (0x2 << 17) #define SOR_STATE_ASY_PIXELDEPTH_BPP_24_444 (0x5 << 17) #define SOR_STATE_ASY_PIXELDEPTH_BPP_30_444 (0x6 << 17) #define SOR_STATE_ASY_PIXELDEPTH_BPP_36_444 (0x8 << 17) #define SOR_STATE_ASY_PIXELDEPTH_BPP_48_444 (0x9 << 17) #define SOR_STATE_ASY_VSYNCPOL (1 << 13) #define SOR_STATE_ASY_HSYNCPOL (1 << 12) #define SOR_STATE_ASY_PROTOCOL_MASK (0xf << 8) #define SOR_STATE_ASY_PROTOCOL_CUSTOM (0xf << 8) #define SOR_STATE_ASY_PROTOCOL_DP_A (0x8 << 8) #define SOR_STATE_ASY_PROTOCOL_DP_B (0x9 << 8) #define SOR_STATE_ASY_PROTOCOL_SINGLE_TMDS_A (0x1 << 8) #define SOR_STATE_ASY_PROTOCOL_LVDS (0x0 << 8) #define SOR_STATE_ASY_CRC_MODE_MASK (0x3 << 6) #define SOR_STATE_ASY_CRC_MODE_NON_ACTIVE (0x2 << 6) #define SOR_STATE_ASY_CRC_MODE_COMPLETE (0x1 << 6) #define SOR_STATE_ASY_CRC_MODE_ACTIVE (0x0 << 6) #define SOR_STATE_ASY_OWNER_MASK 0xf #define SOR_STATE_ASY_OWNER(x) (((x) & 0xf) << 0) #define SOR_HEAD_STATE0(x) (0x05 + (x)) #define SOR_HEAD_STATE_RANGECOMPRESS_MASK (0x1 << 3) #define SOR_HEAD_STATE_DYNRANGE_MASK (0x1 << 2) #define SOR_HEAD_STATE_DYNRANGE_VESA (0 << 2) #define SOR_HEAD_STATE_DYNRANGE_CEA (1 << 2) #define SOR_HEAD_STATE_COLORSPACE_MASK (0x3 << 0) #define SOR_HEAD_STATE_COLORSPACE_RGB (0 << 0) #define SOR_HEAD_STATE1(x) (0x07 + (x)) #define SOR_HEAD_STATE2(x) (0x09 + (x)) #define SOR_HEAD_STATE3(x) (0x0b + (x)) #define SOR_HEAD_STATE4(x) (0x0d + (x)) #define SOR_HEAD_STATE5(x) (0x0f + (x)) #define SOR_CRC_CNTRL 0x11 #define SOR_CRC_CNTRL_ENABLE (1 << 0) #define SOR_DP_DEBUG_MVID 0x12 #define SOR_CLK_CNTRL 0x13 #define SOR_CLK_CNTRL_DP_LINK_SPEED_MASK (0x1f << 2) #define SOR_CLK_CNTRL_DP_LINK_SPEED(x) (((x) & 0x1f) << 2) #define SOR_CLK_CNTRL_DP_LINK_SPEED_G1_62 (0x06 << 2) #define SOR_CLK_CNTRL_DP_LINK_SPEED_G2_70 (0x0a << 2) #define SOR_CLK_CNTRL_DP_LINK_SPEED_G5_40 (0x14 << 2) #define SOR_CLK_CNTRL_DP_CLK_SEL_MASK (3 << 0) #define SOR_CLK_CNTRL_DP_CLK_SEL_SINGLE_PCLK (0 << 0) #define SOR_CLK_CNTRL_DP_CLK_SEL_DIFF_PCLK (1 << 0) #define SOR_CLK_CNTRL_DP_CLK_SEL_SINGLE_DPCLK (2 << 0) #define SOR_CLK_CNTRL_DP_CLK_SEL_DIFF_DPCLK (3 << 0) #define SOR_CAP 0x14 #define SOR_PWR 0x15 #define SOR_PWR_TRIGGER (1 << 31) #define SOR_PWR_MODE_SAFE (1 << 28) #define SOR_PWR_NORMAL_STATE_PU (1 << 0) #define SOR_TEST 0x16 #define SOR_TEST_CRC_POST_SERIALIZE (1 << 23) #define SOR_TEST_ATTACHED (1 << 10) #define SOR_TEST_HEAD_MODE_MASK (3 << 8) #define SOR_TEST_HEAD_MODE_AWAKE (2 << 8) #define SOR_PLL0 0x17 #define SOR_PLL0_ICHPMP_MASK (0xf << 24) #define SOR_PLL0_ICHPMP(x) (((x) & 0xf) << 24) #define SOR_PLL0_FILTER_MASK (0xf << 16) #define SOR_PLL0_FILTER(x) (((x) & 0xf) << 16) #define SOR_PLL0_VCOCAP_MASK (0xf << 8) #define SOR_PLL0_VCOCAP(x) (((x) & 0xf) << 8) #define SOR_PLL0_VCOCAP_RST SOR_PLL0_VCOCAP(3) #define SOR_PLL0_PLLREG_MASK (0x3 << 6) #define SOR_PLL0_PLLREG_LEVEL(x) (((x) & 0x3) << 6) #define SOR_PLL0_PLLREG_LEVEL_V25 SOR_PLL0_PLLREG_LEVEL(0) #define SOR_PLL0_PLLREG_LEVEL_V15 SOR_PLL0_PLLREG_LEVEL(1) #define SOR_PLL0_PLLREG_LEVEL_V35 SOR_PLL0_PLLREG_LEVEL(2) #define SOR_PLL0_PLLREG_LEVEL_V45 SOR_PLL0_PLLREG_LEVEL(3) #define SOR_PLL0_PULLDOWN (1 << 5) #define SOR_PLL0_RESISTOR_EXT (1 << 4) #define SOR_PLL0_VCOPD (1 << 2) #define SOR_PLL0_PWR (1 << 0) #define SOR_PLL1 0x18 /* XXX: read-only bit? */ #define SOR_PLL1_LOADADJ_MASK (0xf << 20) #define SOR_PLL1_LOADADJ(x) (((x) & 0xf) << 20) #define SOR_PLL1_TERM_COMPOUT (1 << 15) #define SOR_PLL1_TMDS_TERMADJ_MASK (0xf << 9) #define SOR_PLL1_TMDS_TERMADJ(x) (((x) & 0xf) << 9) #define SOR_PLL1_TMDS_TERM (1 << 8) #define SOR_PLL2 0x19 #define SOR_PLL2_LVDS_ENABLE (1 << 25) #define SOR_PLL2_SEQ_PLLCAPPD_ENFORCE (1 << 24) #define SOR_PLL2_PORT_POWERDOWN (1 << 23) #define SOR_PLL2_BANDGAP_POWERDOWN (1 << 22) #define SOR_PLL2_POWERDOWN_OVERRIDE (1 << 18) #define SOR_PLL2_SEQ_PLLCAPPD (1 << 17) #define SOR_PLL2_SEQ_PLL_PULLDOWN (1 << 16) #define SOR_PLL3 0x1a #define SOR_PLL3_BG_TEMP_COEF_MASK (0xf << 28) #define SOR_PLL3_BG_TEMP_COEF(x) (((x) & 0xf) << 28) #define SOR_PLL3_BG_VREF_LEVEL_MASK (0xf << 24) #define SOR_PLL3_BG_VREF_LEVEL(x) (((x) & 0xf) << 24) #define SOR_PLL3_PLL_VDD_MODE_1V8 (0 << 13) #define SOR_PLL3_PLL_VDD_MODE_3V3 (1 << 13) #define SOR_PLL3_AVDD10_LEVEL_MASK (0xf << 8) #define SOR_PLL3_AVDD10_LEVEL(x) (((x) & 0xf) << 8) #define SOR_PLL3_AVDD14_LEVEL_MASK (0xf << 4) #define SOR_PLL3_AVDD14_LEVEL(x) (((x) & 0xf) << 4) #define SOR_CSTM 0x1b #define SOR_CSTM_ROTCLK_MASK (0xf << 24) #define SOR_CSTM_ROTCLK(x) (((x) & 0xf) << 24) #define SOR_CSTM_LVDS (1 << 16) #define SOR_CSTM_LINK_ACT_B (1 << 15) #define SOR_CSTM_LINK_ACT_A (1 << 14) #define SOR_CSTM_UPPER (1 << 11) #define SOR_LVDS 0x1c #define SOR_CRCA 0x1d #define SOR_CRCA_VALID (1 << 0) #define SOR_CRCA_RESET (1 << 0) #define SOR_CRCB 0x1e #define SOR_BLANK 0x1f #define SOR_SEQ_CTL 0x20 #define SOR_SEQ_CTL_PD_PC_ALT(x) (((x) & 0xf) << 12) #define SOR_SEQ_CTL_PD_PC(x) (((x) & 0xf) << 8) #define SOR_SEQ_CTL_PU_PC_ALT(x) (((x) & 0xf) << 4) #define SOR_SEQ_CTL_PU_PC(x) (((x) & 0xf) << 0) #define SOR_LANE_SEQ_CTL 0x21 #define SOR_LANE_SEQ_CTL_TRIGGER (1 << 31) #define SOR_LANE_SEQ_CTL_STATE_BUSY (1 << 28) #define SOR_LANE_SEQ_CTL_SEQUENCE_UP (0 << 20) #define SOR_LANE_SEQ_CTL_SEQUENCE_DOWN (1 << 20) #define SOR_LANE_SEQ_CTL_POWER_STATE_UP (0 << 16) #define SOR_LANE_SEQ_CTL_POWER_STATE_DOWN (1 << 16) #define SOR_LANE_SEQ_CTL_DELAY(x) (((x) & 0xf) << 12) #define SOR_SEQ_INST(x) (0x22 + (x)) #define SOR_SEQ_INST_PLL_PULLDOWN (1 << 31) #define SOR_SEQ_INST_POWERDOWN_MACRO (1 << 30) #define SOR_SEQ_INST_ASSERT_PLL_RESET (1 << 29) #define SOR_SEQ_INST_BLANK_V (1 << 28) #define SOR_SEQ_INST_BLANK_H (1 << 27) #define SOR_SEQ_INST_BLANK_DE (1 << 26) #define SOR_SEQ_INST_BLACK_DATA (1 << 25) #define SOR_SEQ_INST_TRISTATE_IOS (1 << 24) #define SOR_SEQ_INST_DRIVE_PWM_OUT_LO (1 << 23) #define SOR_SEQ_INST_PIN_B_LOW (0 << 22) #define SOR_SEQ_INST_PIN_B_HIGH (1 << 22) #define SOR_SEQ_INST_PIN_A_LOW (0 << 21) #define SOR_SEQ_INST_PIN_A_HIGH (1 << 21) #define SOR_SEQ_INST_SEQUENCE_UP (0 << 19) #define SOR_SEQ_INST_SEQUENCE_DOWN (1 << 19) #define SOR_SEQ_INST_LANE_SEQ_STOP (0 << 18) #define SOR_SEQ_INST_LANE_SEQ_RUN (1 << 18) #define SOR_SEQ_INST_PORT_POWERDOWN (1 << 17) #define SOR_SEQ_INST_PLL_POWERDOWN (1 << 16) #define SOR_SEQ_INST_HALT (1 << 15) #define SOR_SEQ_INST_WAIT_US (0 << 12) #define SOR_SEQ_INST_WAIT_MS (1 << 12) #define SOR_SEQ_INST_WAIT_VSYNC (2 << 12) #define SOR_SEQ_INST_WAIT(x) (((x) & 0x3ff) << 0) #define SOR_PWM_DIV 0x32 #define SOR_PWM_DIV_MASK 0xffffff #define SOR_PWM_CTL 0x33 #define SOR_PWM_CTL_TRIGGER (1 << 31) #define SOR_PWM_CTL_CLK_SEL (1 << 30) #define SOR_PWM_CTL_DUTY_CYCLE_MASK 0xffffff #define SOR_VCRC_A0 0x34 #define SOR_VCRC_A1 0x35 #define SOR_VCRC_B0 0x36 #define SOR_VCRC_B1 0x37 #define SOR_CCRC_A0 0x38 #define SOR_CCRC_A1 0x39 #define SOR_CCRC_B0 0x3a #define SOR_CCRC_B1 0x3b #define SOR_EDATA_A0 0x3c #define SOR_EDATA_A1 0x3d #define SOR_EDATA_B0 0x3e #define SOR_EDATA_B1 0x3f #define SOR_COUNT_A0 0x40 #define SOR_COUNT_A1 0x41 #define SOR_COUNT_B0 0x42 #define SOR_COUNT_B1 0x43 #define SOR_DEBUG_A0 0x44 #define SOR_DEBUG_A1 0x45 #define SOR_DEBUG_B0 0x46 #define SOR_DEBUG_B1 0x47 #define SOR_TRIG 0x48 #define SOR_MSCHECK 0x49 #define SOR_XBAR_CTRL 0x4a #define SOR_XBAR_CTRL_LINK1_XSEL(channel, value) ((((value) & 0x7) << ((channel) * 3)) << 17) #define SOR_XBAR_CTRL_LINK0_XSEL(channel, value) ((((value) & 0x7) << ((channel) * 3)) << 2) #define SOR_XBAR_CTRL_LINK_SWAP (1 << 1) #define SOR_XBAR_CTRL_BYPASS (1 << 0) #define SOR_XBAR_POL 0x4b #define SOR_DP_LINKCTL0 0x4c #define SOR_DP_LINKCTL_LANE_COUNT_MASK (0x1f << 16) #define SOR_DP_LINKCTL_LANE_COUNT(x) (((1 << (x)) - 1) << 16) #define SOR_DP_LINKCTL_ENHANCED_FRAME (1 << 14) #define SOR_DP_LINKCTL_TU_SIZE_MASK (0x7f << 2) #define SOR_DP_LINKCTL_TU_SIZE(x) (((x) & 0x7f) << 2) #define SOR_DP_LINKCTL_ENABLE (1 << 0) #define SOR_DP_LINKCTL1 0x4d #define SOR_LANE_DRIVE_CURRENT0 0x4e #define SOR_LANE_DRIVE_CURRENT1 0x4f #define SOR_LANE4_DRIVE_CURRENT0 0x50 #define SOR_LANE4_DRIVE_CURRENT1 0x51 #define SOR_LANE_DRIVE_CURRENT_LANE3(x) (((x) & 0xff) << 24) #define SOR_LANE_DRIVE_CURRENT_LANE2(x) (((x) & 0xff) << 16) #define SOR_LANE_DRIVE_CURRENT_LANE1(x) (((x) & 0xff) << 8) #define SOR_LANE_DRIVE_CURRENT_LANE0(x) (((x) & 0xff) << 0) #define SOR_LANE_PREEMPHASIS0 0x52 #define SOR_LANE_PREEMPHASIS1 0x53 #define SOR_LANE4_PREEMPHASIS0 0x54 #define SOR_LANE4_PREEMPHASIS1 0x55 #define SOR_LANE_PREEMPHASIS_LANE3(x) (((x) & 0xff) << 24) #define SOR_LANE_PREEMPHASIS_LANE2(x) (((x) & 0xff) << 16) #define SOR_LANE_PREEMPHASIS_LANE1(x) (((x) & 0xff) << 8) #define SOR_LANE_PREEMPHASIS_LANE0(x) (((x) & 0xff) << 0) #define SOR_LANE_POSTCURSOR0 0x56 #define SOR_LANE_POSTCURSOR1 0x57 #define SOR_LANE_POSTCURSOR_LANE3(x) (((x) & 0xff) << 24) #define SOR_LANE_POSTCURSOR_LANE2(x) (((x) & 0xff) << 16) #define SOR_LANE_POSTCURSOR_LANE1(x) (((x) & 0xff) << 8) #define SOR_LANE_POSTCURSOR_LANE0(x) (((x) & 0xff) << 0) #define SOR_DP_CONFIG0 0x58 #define SOR_DP_CONFIG_DISPARITY_NEGATIVE (1 << 31) #define SOR_DP_CONFIG_ACTIVE_SYM_ENABLE (1 << 26) #define SOR_DP_CONFIG_ACTIVE_SYM_POLARITY (1 << 24) #define SOR_DP_CONFIG_ACTIVE_SYM_FRAC_MASK (0xf << 16) #define SOR_DP_CONFIG_ACTIVE_SYM_FRAC(x) (((x) & 0xf) << 16) #define SOR_DP_CONFIG_ACTIVE_SYM_COUNT_MASK (0x7f << 8) #define SOR_DP_CONFIG_ACTIVE_SYM_COUNT(x) (((x) & 0x7f) << 8) #define SOR_DP_CONFIG_WATERMARK_MASK (0x3f << 0) #define SOR_DP_CONFIG_WATERMARK(x) (((x) & 0x3f) << 0) #define SOR_DP_CONFIG1 0x59 #define SOR_DP_MN0 0x5a #define SOR_DP_MN1 0x5b #define SOR_DP_PADCTL0 0x5c #define SOR_DP_PADCTL_PAD_CAL_PD (1 << 23) #define SOR_DP_PADCTL_TX_PU_ENABLE (1 << 22) #define SOR_DP_PADCTL_TX_PU_MASK (0xff << 8) #define SOR_DP_PADCTL_TX_PU(x) (((x) & 0xff) << 8) #define SOR_DP_PADCTL_CM_TXD_3 (1 << 7) #define SOR_DP_PADCTL_CM_TXD_2 (1 << 6) #define SOR_DP_PADCTL_CM_TXD_1 (1 << 5) #define SOR_DP_PADCTL_CM_TXD_0 (1 << 4) #define SOR_DP_PADCTL_PD_TXD_3 (1 << 3) #define SOR_DP_PADCTL_PD_TXD_0 (1 << 2) #define SOR_DP_PADCTL_PD_TXD_1 (1 << 1) #define SOR_DP_PADCTL_PD_TXD_2 (1 << 0) #define SOR_DP_PADCTL1 0x5d #define SOR_DP_DEBUG0 0x5e #define SOR_DP_DEBUG1 0x5f #define SOR_DP_SPARE0 0x60 #define SOR_DP_SPARE_DISP_VIDEO_PREAMBLE (1 << 3) #define SOR_DP_SPARE_MACRO_SOR_CLK (1 << 2) #define SOR_DP_SPARE_PANEL_INTERNAL (1 << 1) #define SOR_DP_SPARE_SEQ_ENABLE (1 << 0) #define SOR_DP_SPARE1 0x61 #define SOR_DP_AUDIO_CTRL 0x62 #define SOR_DP_AUDIO_HBLANK_SYMBOLS 0x63 #define SOR_DP_AUDIO_HBLANK_SYMBOLS_MASK (0x01ffff << 0) #define SOR_DP_AUDIO_VBLANK_SYMBOLS 0x64 #define SOR_DP_AUDIO_VBLANK_SYMBOLS_MASK (0x1fffff << 0) #define SOR_DP_GENERIC_INFOFRAME_HEADER 0x65 #define SOR_DP_GENERIC_INFOFRAME_SUBPACK0 0x66 #define SOR_DP_GENERIC_INFOFRAME_SUBPACK1 0x67 #define SOR_DP_GENERIC_INFOFRAME_SUBPACK2 0x68 #define SOR_DP_GENERIC_INFOFRAME_SUBPACK3 0x69 #define SOR_DP_GENERIC_INFOFRAME_SUBPACK4 0x6a #define SOR_DP_GENERIC_INFOFRAME_SUBPACK5 0x6b #define SOR_DP_GENERIC_INFOFRAME_SUBPACK6 0x6c #define SOR_DP_TPG 0x6d #define SOR_DP_TPG_CHANNEL_CODING (1 << 6) #define SOR_DP_TPG_SCRAMBLER_MASK (3 << 4) #define SOR_DP_TPG_SCRAMBLER_FIBONACCI (2 << 4) #define SOR_DP_TPG_SCRAMBLER_GALIOS (1 << 4) #define SOR_DP_TPG_SCRAMBLER_NONE (0 << 4) #define SOR_DP_TPG_PATTERN_MASK (0xf << 0) #define SOR_DP_TPG_PATTERN_HBR2 (0x8 << 0) #define SOR_DP_TPG_PATTERN_CSTM (0x7 << 0) #define SOR_DP_TPG_PATTERN_PRBS7 (0x6 << 0) #define SOR_DP_TPG_PATTERN_SBLERRRATE (0x5 << 0) #define SOR_DP_TPG_PATTERN_D102 (0x4 << 0) #define SOR_DP_TPG_PATTERN_TRAIN3 (0x3 << 0) #define SOR_DP_TPG_PATTERN_TRAIN2 (0x2 << 0) #define SOR_DP_TPG_PATTERN_TRAIN1 (0x1 << 0) #define SOR_DP_TPG_PATTERN_NONE (0x0 << 0) #define SOR_DP_TPG_CONFIG 0x6e #define SOR_DP_LQ_CSTM0 0x6f #define SOR_DP_LQ_CSTM1 0x70 #define SOR_DP_LQ_CSTM2 0x71 #define SOR_DP_PADCTL2 0x73 #define SOR_DP_PADCTL_SPAREPLL_MASK (0xff << 24) #define SOR_DP_PADCTL_SPAREPLL(x) (((x) & 0xff) << 24) #define SOR_HDMI_AUDIO_INFOFRAME_CTRL 0x9a #define SOR_HDMI_AUDIO_INFOFRAME_STATUS 0x9b #define SOR_HDMI_AUDIO_INFOFRAME_HEADER 0x9c #define SOR_HDMI_AVI_INFOFRAME_CTRL 0x9f #define INFOFRAME_CTRL_CHECKSUM_ENABLE (1 << 9) #define INFOFRAME_CTRL_SINGLE (1 << 8) #define INFOFRAME_CTRL_OTHER (1 << 4) #define INFOFRAME_CTRL_ENABLE (1 << 0) #define SOR_HDMI_AVI_INFOFRAME_STATUS 0xa0 #define INFOFRAME_STATUS_DONE (1 << 0) #define SOR_HDMI_AVI_INFOFRAME_HEADER 0xa1 #define INFOFRAME_HEADER_LEN(x) (((x) & 0xff) << 16) #define INFOFRAME_HEADER_VERSION(x) (((x) & 0xff) << 8) #define INFOFRAME_HEADER_TYPE(x) (((x) & 0xff) << 0) #define SOR_HDMI_CTRL 0xc0 #define SOR_HDMI_CTRL_ENABLE (1 << 30) #define SOR_HDMI_CTRL_MAX_AC_PACKET(x) (((x) & 0x1f) << 16) #define SOR_HDMI_CTRL_AUDIO_LAYOUT (1 << 10) #define SOR_HDMI_CTRL_REKEY(x) (((x) & 0x7f) << 0) #define SOR_REFCLK 0xe6 #define SOR_REFCLK_DIV_INT(x) ((((x) >> 2) & 0xff) << 8) #define SOR_REFCLK_DIV_FRAC(x) (((x) & 0x3) << 6) #define SOR_INPUT_CONTROL 0xe8 #define SOR_INPUT_CONTROL_ARM_VIDEO_RANGE_LIMITED (1 << 1) #define SOR_INPUT_CONTROL_HDMI_SRC_SELECT(x) (((x) & 0x1) << 0) #define SOR_HDMI_VSI_INFOFRAME_CTRL 0x123 #define SOR_HDMI_VSI_INFOFRAME_STATUS 0x124 #define SOR_HDMI_VSI_INFOFRAME_HEADER 0x125 #define SOR_HDMI2_CTRL 0x13e #define SOR_HDMI2_CTRL_CLOCK_MODE_DIV_BY_4 (1 << 1) #define SOR_HDMI2_CTRL_SCRAMBLE (1 << 0) #endif
{ "pile_set_name": "Github" }
// Pingus - A free Lemmings clone // Copyright (C) 2002 Ingo Ruhnke <[email protected]> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. #ifndef HEADER_PINGUS_PINGUS_WORLDMAP_PATH_HPP #define HEADER_PINGUS_PINGUS_WORLDMAP_PATH_HPP #include <algorithm> #include <vector> #include "math/vector3f.hpp" namespace WorldmapNS { /** a wrapper class around std::vector<Vector>, which can calculate the length of the path and a few other things */ class Path { private: typedef std::vector<Vector3f> Vec; Vec vec; bool path_length_valid; float path_length; private: float calc_length(); public: typedef Vec::iterator iterator; typedef Vec::reverse_iterator reverse_iterator; Path(); /** Return the number of nodes */ Vec::size_type size(); /** @return the length of the path in pixels */ float length(); /** walk a distance of vec_position on the path and return the position, positions between two Vectors are interpolated, if length is larger then path *back() will be returned */ Vector3f at(float vec_position); bool empty() { return vec.empty(); } void clear() { path_length_valid = false; vec.clear(); } iterator begin() { return vec.begin(); } iterator end() { return vec.end(); } reverse_iterator rbegin() { return vec.rbegin(); } reverse_iterator rend() { return vec.rend(); } void push_back(const Vector3f& v) { path_length_valid = false; vec.push_back(v); } void insert(Path& p) { path_length_valid = false; //vec.insert(vec.end(), p.vec.begin(), p.vec.end()); vec.reserve(vec.size() + p.vec.size ()); std::copy(p.vec.begin(), p.vec.end(), std::back_inserter(vec)); } void reverse_insert(Path& p) { path_length_valid = false; //vec.insert(vec.end(), p.vec.rbegin(), p.vec.rend()); vec.reserve(vec.size() + p.vec.size ()); std::copy(p.vec.rbegin(), p.vec.rend(), std::back_inserter(vec)); } void reverse(); }; } // namespace WorldmapNS #endif /* EOF */
{ "pile_set_name": "Github" }
"use strict"; exports.__esModule = true; exports.default = void 0; var _declaration = _interopRequireDefault(require("./declaration")); var _tokenize = _interopRequireDefault(require("./tokenize")); var _comment = _interopRequireDefault(require("./comment")); var _atRule = _interopRequireDefault(require("./at-rule")); var _root = _interopRequireDefault(require("./root")); var _rule = _interopRequireDefault(require("./rule")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Parser = /*#__PURE__*/ function () { function Parser(input) { this.input = input; this.root = new _root.default(); this.current = this.root; this.spaces = ''; this.semicolon = false; this.createTokenizer(); this.root.source = { input: input, start: { line: 1, column: 1 } }; } var _proto = Parser.prototype; _proto.createTokenizer = function createTokenizer() { this.tokenizer = (0, _tokenize.default)(this.input); }; _proto.parse = function parse() { var token; while (!this.tokenizer.endOfFile()) { token = this.tokenizer.nextToken(); switch (token[0]) { case 'space': this.spaces += token[1]; break; case ';': this.freeSemicolon(token); break; case '}': this.end(token); break; case 'comment': this.comment(token); break; case 'at-word': this.atrule(token); break; case '{': this.emptyRule(token); break; default: this.other(token); break; } } this.endFile(); }; _proto.comment = function comment(token) { var node = new _comment.default(); this.init(node, token[2], token[3]); node.source.end = { line: token[4], column: token[5] }; var text = token[1].slice(2, -2); if (/^\s*$/.test(text)) { node.text = ''; node.raws.left = text; node.raws.right = ''; } else { var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/); node.text = match[2]; node.raws.left = match[1]; node.raws.right = match[3]; } }; _proto.emptyRule = function emptyRule(token) { var node = new _rule.default(); this.init(node, token[2], token[3]); node.selector = ''; node.raws.between = ''; this.current = node; }; _proto.other = function other(start) { var end = false; var type = null; var colon = false; var bracket = null; var brackets = []; var tokens = []; var token = start; while (token) { type = token[0]; tokens.push(token); if (type === '(' || type === '[') { if (!bracket) bracket = token; brackets.push(type === '(' ? ')' : ']'); } else if (brackets.length === 0) { if (type === ';') { if (colon) { this.decl(tokens); return; } else { break; } } else if (type === '{') { this.rule(tokens); return; } else if (type === '}') { this.tokenizer.back(tokens.pop()); end = true; break; } else if (type === ':') { colon = true; } } else if (type === brackets[brackets.length - 1]) { brackets.pop(); if (brackets.length === 0) bracket = null; } token = this.tokenizer.nextToken(); } if (this.tokenizer.endOfFile()) end = true; if (brackets.length > 0) this.unclosedBracket(bracket); if (end && colon) { while (tokens.length) { token = tokens[tokens.length - 1][0]; if (token !== 'space' && token !== 'comment') break; this.tokenizer.back(tokens.pop()); } this.decl(tokens); } else { this.unknownWord(tokens); } }; _proto.rule = function rule(tokens) { tokens.pop(); var node = new _rule.default(); this.init(node, tokens[0][2], tokens[0][3]); node.raws.between = this.spacesAndCommentsFromEnd(tokens); this.raw(node, 'selector', tokens); this.current = node; }; _proto.decl = function decl(tokens) { var node = new _declaration.default(); this.init(node); var last = tokens[tokens.length - 1]; if (last[0] === ';') { this.semicolon = true; tokens.pop(); } if (last[4]) { node.source.end = { line: last[4], column: last[5] }; } else { node.source.end = { line: last[2], column: last[3] }; } while (tokens[0][0] !== 'word') { if (tokens.length === 1) this.unknownWord(tokens); node.raws.before += tokens.shift()[1]; } node.source.start = { line: tokens[0][2], column: tokens[0][3] }; node.prop = ''; while (tokens.length) { var type = tokens[0][0]; if (type === ':' || type === 'space' || type === 'comment') { break; } node.prop += tokens.shift()[1]; } node.raws.between = ''; var token; while (tokens.length) { token = tokens.shift(); if (token[0] === ':') { node.raws.between += token[1]; break; } else { if (token[0] === 'word' && /\w/.test(token[1])) { this.unknownWord([token]); } node.raws.between += token[1]; } } if (node.prop[0] === '_' || node.prop[0] === '*') { node.raws.before += node.prop[0]; node.prop = node.prop.slice(1); } node.raws.between += this.spacesAndCommentsFromStart(tokens); this.precheckMissedSemicolon(tokens); for (var i = tokens.length - 1; i > 0; i--) { token = tokens[i]; if (token[1].toLowerCase() === '!important') { node.important = true; var string = this.stringFrom(tokens, i); string = this.spacesFromEnd(tokens) + string; if (string !== ' !important') node.raws.important = string; break; } else if (token[1].toLowerCase() === 'important') { var cache = tokens.slice(0); var str = ''; for (var j = i; j > 0; j--) { var _type = cache[j][0]; if (str.trim().indexOf('!') === 0 && _type !== 'space') { break; } str = cache.pop()[1] + str; } if (str.trim().indexOf('!') === 0) { node.important = true; node.raws.important = str; tokens = cache; } } if (token[0] !== 'space' && token[0] !== 'comment') { break; } } this.raw(node, 'value', tokens); if (node.value.indexOf(':') !== -1) this.checkMissedSemicolon(tokens); }; _proto.atrule = function atrule(token) { var node = new _atRule.default(); node.name = token[1].slice(1); if (node.name === '') { this.unnamedAtrule(node, token); } this.init(node, token[2], token[3]); var prev; var shift; var last = false; var open = false; var params = []; while (!this.tokenizer.endOfFile()) { token = this.tokenizer.nextToken(); if (token[0] === ';') { node.source.end = { line: token[2], column: token[3] }; this.semicolon = true; break; } else if (token[0] === '{') { open = true; break; } else if (token[0] === '}') { if (params.length > 0) { shift = params.length - 1; prev = params[shift]; while (prev && prev[0] === 'space') { prev = params[--shift]; } if (prev) { node.source.end = { line: prev[4], column: prev[5] }; } } this.end(token); break; } else { params.push(token); } if (this.tokenizer.endOfFile()) { last = true; break; } } node.raws.between = this.spacesAndCommentsFromEnd(params); if (params.length) { node.raws.afterName = this.spacesAndCommentsFromStart(params); this.raw(node, 'params', params); if (last) { token = params[params.length - 1]; node.source.end = { line: token[4], column: token[5] }; this.spaces = node.raws.between; node.raws.between = ''; } } else { node.raws.afterName = ''; node.params = ''; } if (open) { node.nodes = []; this.current = node; } }; _proto.end = function end(token) { if (this.current.nodes && this.current.nodes.length) { this.current.raws.semicolon = this.semicolon; } this.semicolon = false; this.current.raws.after = (this.current.raws.after || '') + this.spaces; this.spaces = ''; if (this.current.parent) { this.current.source.end = { line: token[2], column: token[3] }; this.current = this.current.parent; } else { this.unexpectedClose(token); } }; _proto.endFile = function endFile() { if (this.current.parent) this.unclosedBlock(); if (this.current.nodes && this.current.nodes.length) { this.current.raws.semicolon = this.semicolon; } this.current.raws.after = (this.current.raws.after || '') + this.spaces; }; _proto.freeSemicolon = function freeSemicolon(token) { this.spaces += token[1]; if (this.current.nodes) { var prev = this.current.nodes[this.current.nodes.length - 1]; if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) { prev.raws.ownSemicolon = this.spaces; this.spaces = ''; } } } // Helpers ; _proto.init = function init(node, line, column) { this.current.push(node); node.source = { start: { line: line, column: column }, input: this.input }; node.raws.before = this.spaces; this.spaces = ''; if (node.type !== 'comment') this.semicolon = false; }; _proto.raw = function raw(node, prop, tokens) { var token, type; var length = tokens.length; var value = ''; var clean = true; var next, prev; var pattern = /^([.|#])?([\w])+/i; for (var i = 0; i < length; i += 1) { token = tokens[i]; type = token[0]; if (type === 'comment' && node.type === 'rule') { prev = tokens[i - 1]; next = tokens[i + 1]; if (prev[0] !== 'space' && next[0] !== 'space' && pattern.test(prev[1]) && pattern.test(next[1])) { value += token[1]; } else { clean = false; } continue; } if (type === 'comment' || type === 'space' && i === length - 1) { clean = false; } else { value += token[1]; } } if (!clean) { var raw = tokens.reduce(function (all, i) { return all + i[1]; }, ''); node.raws[prop] = { value: value, raw: raw }; } node[prop] = value; }; _proto.spacesAndCommentsFromEnd = function spacesAndCommentsFromEnd(tokens) { var lastTokenType; var spaces = ''; while (tokens.length) { lastTokenType = tokens[tokens.length - 1][0]; if (lastTokenType !== 'space' && lastTokenType !== 'comment') break; spaces = tokens.pop()[1] + spaces; } return spaces; }; _proto.spacesAndCommentsFromStart = function spacesAndCommentsFromStart(tokens) { var next; var spaces = ''; while (tokens.length) { next = tokens[0][0]; if (next !== 'space' && next !== 'comment') break; spaces += tokens.shift()[1]; } return spaces; }; _proto.spacesFromEnd = function spacesFromEnd(tokens) { var lastTokenType; var spaces = ''; while (tokens.length) { lastTokenType = tokens[tokens.length - 1][0]; if (lastTokenType !== 'space') break; spaces = tokens.pop()[1] + spaces; } return spaces; }; _proto.stringFrom = function stringFrom(tokens, from) { var result = ''; for (var i = from; i < tokens.length; i++) { result += tokens[i][1]; } tokens.splice(from, tokens.length - from); return result; }; _proto.colon = function colon(tokens) { var brackets = 0; var token, type, prev; for (var i = 0; i < tokens.length; i++) { token = tokens[i]; type = token[0]; if (type === '(') { brackets += 1; } if (type === ')') { brackets -= 1; } if (brackets === 0 && type === ':') { if (!prev) { this.doubleColon(token); } else if (prev[0] === 'word' && prev[1] === 'progid') { continue; } else { return i; } } prev = token; } return false; } // Errors ; _proto.unclosedBracket = function unclosedBracket(bracket) { throw this.input.error('Unclosed bracket', bracket[2], bracket[3]); }; _proto.unknownWord = function unknownWord(tokens) { throw this.input.error('Unknown word', tokens[0][2], tokens[0][3]); }; _proto.unexpectedClose = function unexpectedClose(token) { throw this.input.error('Unexpected }', token[2], token[3]); }; _proto.unclosedBlock = function unclosedBlock() { var pos = this.current.source.start; throw this.input.error('Unclosed block', pos.line, pos.column); }; _proto.doubleColon = function doubleColon(token) { throw this.input.error('Double colon', token[2], token[3]); }; _proto.unnamedAtrule = function unnamedAtrule(node, token) { throw this.input.error('At-rule without name', token[2], token[3]); }; _proto.precheckMissedSemicolon = function precheckMissedSemicolon() /* tokens */ {// Hook for Safe Parser }; _proto.checkMissedSemicolon = function checkMissedSemicolon(tokens) { var colon = this.colon(tokens); if (colon === false) return; var founded = 0; var token; for (var j = colon - 1; j >= 0; j--) { token = tokens[j]; if (token[0] !== 'space') { founded += 1; if (founded === 2) break; } } throw this.input.error('Missed semicolon', token[2], token[3]); }; return Parser; }(); exports.default = Parser; module.exports = exports.default; //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhcnNlci5lczYiXSwibmFtZXMiOlsiUGFyc2VyIiwiaW5wdXQiLCJyb290IiwiUm9vdCIsImN1cnJlbnQiLCJzcGFjZXMiLCJzZW1pY29sb24iLCJjcmVhdGVUb2tlbml6ZXIiLCJzb3VyY2UiLCJzdGFydCIsImxpbmUiLCJjb2x1bW4iLCJ0b2tlbml6ZXIiLCJwYXJzZSIsInRva2VuIiwiZW5kT2ZGaWxlIiwibmV4dFRva2VuIiwiZnJlZVNlbWljb2xvbiIsImVuZCIsImNvbW1lbnQiLCJhdHJ1bGUiLCJlbXB0eVJ1bGUiLCJvdGhlciIsImVuZEZpbGUiLCJub2RlIiwiQ29tbWVudCIsImluaXQiLCJ0ZXh0Iiwic2xpY2UiLCJ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c3RhcnQpIHtcbiAgICBsZXQgZW5kID0gZmFsc2VcbiAgICBsZXQgdHlwZSA9IG51bGxcbiAgICBsZXQgY29sb24gPSBmYWxzZVxuICAgIGxldCBicmFja2V0ID0gbnVsbFxuICAgIGxldCBicmFja2V0cyA9IFtdXG5cbiAgICBsZXQgdG9rZW5zID0gW11cbiAgICBsZXQgdG9rZW4gPSBzdGFydFxuICAgIHdoaWxlICh0b2tlbikge1xuICAgICAgdHlwZSA9IHRva2VuWzBdXG4gICAgICB0b2tlbnMucHVzaCh0b2tlbilcblxuICAgICAgaWYgKHR5cGUgPT09ICcoJyB8fCB0eXBlID09PSAnWycpIHtcbiAgICAgICAgaWYgKCFicmFja2V0KSBicmFja2V0ID0gdG9rZW5cbiAgICAgICAgYnJhY2tldHMucHVzaCh0eXBlID09PSAnKCcgPyAnKScgOiAnXScpXG4gICAgICB9IGVsc2UgaWYgKGJyYWNrZXRzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICBpZiAodHlwZSA9PT0gJzsnKSB7XG4gICAgICAgICAgaWYgKGNvbG9uKSB7XG4gICAgICAgICAgICB0aGlzLmRlY2wodG9rZW5zKVxuICAgICAgICAgICAgcmV0dXJuXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICd7Jykge1xuICAgICAgICAgIHRoaXMucnVsZSh0b2tlbnMpXG4gICAgICAgICAgcmV0dXJuXG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gJ30nKSB7XG4gICAgICAgICAgdGhpcy50b2tlbml6ZXIuYmFjayh0b2tlbnMucG9wKCkpXG4gICAgICAgICAgZW5kID0gdHJ1ZVxuICAgICAgICAgIGJyZWFrXG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gJzonKSB7XG4gICAgICAgICAgY29sb24gPSB0cnVlXG4gICAgICAgIH1cbiAgICAgIH0gZWxzZS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G5vZGUucmF3cy5iZXR3ZWVuID0gJydcblxuICAgIGxldCB0b2tlblxuICAgIHdoaWxlICh0b2tlbnMubGVuZ3RoKSB7XG4gICAgICB0b2tlbiA9IHRva2Vucy5zaGlmdCgpXG5cbiAgICAgIGlmICh0b2tlblswXSA9PT0gJzonKSB7XG4gICAgICAgIG5vZGUucmF3cy5iZXR3ZWVuICs9IHRva2VuWzFdXG4gICAgICAgIGJyZWFrXG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAodG9rZW5bMF0gPT09ICd3b3JkJyAmJiAvXFx3Ly50ZXN0KHRva2VuWzFdKSkge1xuICAgICAgICAgIHRoaXMudW5rbm93bldvcmQoW3Rva2VuXSlcbiAgICAgICAgfVxuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0b2tlblsxXVxuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChub2RlLnByb3BbMF0gPT09ICdfJyB8fCBub2RlLnByb3BbMF0gPT09ICcqJykge1xuICAgICAgbm9kZS5yYXdzLmJlZm9yZSArPSBub2RlLnByb3BbMF1cbiAgICAgIG5vZGUucHJvcCA9IG5vZGUucHJvcC5zbGljZSgxKVxuICAgIH1cbiAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0aGlzLnNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0KHRva2VucylcbiAgICB0aGlzLnByZWNoZWNrTWlzc2VkU2VtaWNvbG9uKHRva2VucylcblxuICAgIGZvciAobGV0IGkgPSB0b2tlbnMubGVuZ3RoIC0gMTsgaSA+IDA7IGktLSkge1xuICAgICAgdG9rZW4gPSB0b2tlbnNbaV1cbiAgICAgIGlmICh0b2tlblsxXS50b0xvd2VyQ2FzZSgpID09PSAnIWltcG9ydGFudCcpIHtcbiAgICAgICAgbm9kZS5pbXBvcnRhbnQgPSB0cnVlXG4gICAgICAgIGxldCBzdHJpbmcgPSB0aGlzLnN0cmluZ0Zyb20odG9rZW5zLCBpKVxuICAgICAgICBzdHJpbmcgPSB0aGlzLnNwYWNlc0Zyb21FbmQodG9rZW5zKSArIHN0cmluZ1xuICAgICAgICBpZiAoc3RyaW5nICE9PSAnICFpbXBvcnRhbnQnKSBub2RlLnJhd3MuaW1wb3J0YW50ID0gc3RyaW5nXG4gICAgICAgIGJyZWFrXG4gICAgICB9IGVsc2UgaWYgKHRva2VuWzFdLnRvTG93ZXJDYXNlKCkgPT09ICdpbXBvcnRhbnQnKSB7XG4gICAgICAgIGxldCBjYWNoZSA9IHRva2Vucy5zbGljZSgwKVxuICAgICAgICBsZXQgc3RyID0gJydcbiAgICAgICAgZm9yIChsZXQgaiA9IGk7IGogPiAwOyBqLS0pIHtcbiAgICAgICAgICBsZXQgdHlwZSA9IGNhY2hlW2pdWzBdXG4gICAgICAgICAgaWYgKHN0ci50cmltKCkuaW5kZXhPZignIScpID09PSAwICYmIHR5cGUgIT09ICdzcGFjZScpIHtcbiAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgfVxuICAgICAgICAgIHN0ciA9IGNhY2hlLnBvcCgpWzFdICsgc3RyXG4gICAgICAgIH1cbiAgICAgICAgaWYgKHN0ci50cmltKCkuaW5kZXhPZignIScpID09PSAwKSB7XG4gICAgICAgICAgbm9kZS5pbXBvcnRhbnQgPSB0cnVlXG4gICAgICAgICAgbm9kZS5yYXdzLmltcG9ydGFudCA9IHN0clxuICAgICAgICAgIHRva2VucyA9IGNhY2hlXG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKHRva2VuWzBdICE9PSAnc3BhY2UnICYmIHRva2VuWzBdICE9PSAnY29tbWVudCcpIHtcbiAgICAgICAgYnJlYWtcbiAgICAgIH1cbiAgICB9XG5cbiAgICB0aGlzLnJhdyhub2RlLCAndmFsdWUnLCB0b2tlbnMpXG5cbiAgICBpZiAobm9kZS52YWx1ZS5pbmRleE9mKCc6JykgIT09IC0xKSB0aGlzLmNoZWNrTWlzc2VkU2VtaWNvbG9uKHRva2VucylcbiAgfVxuXG4gIGF0cnVsZSAodG9rZW4pIHtcbiAgICBsZXQgbm9kZSA9IG5ldyBBdFJ1bGUoKVxuICAgIG5vZGUubmFtZSA9IHRva2VuWzFdLnNsaWNlKDEpXG4gICAgaWYgKG5vZGUubmFtZSA9PT0gJycpIHtcbiAgICAgIHRoaXMudW5uYW1lZEF0cnVsZShub2RlLCB0b2tlbilcbiAgICB9XG4gICAgdGhpcy5pbml0KG5vZGUsIHRva2VuWzJdLCB0b2tlblszXSlcblxuICAgIGxldCBwcmV2XG4gICAgbGV0IHNoaWZ0XG4gICAgbGV0IGxhc3QgPSBmYWxzZVxuICAgIGxldCBvcGVuID0gZmFsc2VcbiAgICBsZXQgcGFyYW1zID0gW11cblxuICAgIHdoaWxlICghdGhpcy50b2tlbml6ZXIuZW5kT2ZGaWxlKCkpIHtcbiAgICAgIHRva2VuID0gdGhpcy50b2tlbml6ZXIubmV4dFRva2VuKClcblxuICAgICAgaWYgKHRva2VuWzBdID09PSAnOycpIHtcbiAgICAgICAgbm9kZS5zb3VyY2UuZW5kID0geyBsaW5lOiB0b2tlblsyXSwgY29sdW1uOiB0b2tlblszXSB9XG4gICAgICAgIHRoaXMuc2VtaWNvbG9uID0gdHJ1ZVxuICAgICAgICBicmVha1xuICAgICAgfSBlbHNlIGlmICh0b2tlblswXSA9PT0gJ3snKSB7XG4gICAgICAgIG9wZW4gPSB0cnVlXG4gICAgICAgIGJyZWFrXG4gICAgICB9IGVsc2UgaWYgKHRva2VuWzBdID09PSAnfScpIHtcbiAgICAgICAgaWYgKHBhcmFtcy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgc2hpZnQgPSBwYXJhbXMubGVuZ3RoIC0gMVxuICAgICAgICAgIHByZXYgPSBwYXJhbXNbc2hpZnRdXG4gICAgICAgICAgd2hpbGUgKHByZXYgJiYgcHJldlswXSA9PT0gJ3NwYWNlJykge1xuICAgICAgICAgICAgcHJldiA9IHBhcmFtc1stLXNoaWZ0XVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiA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gICAgfVxuICAgIHRva2Vucy5zcGxpY2UoZnJvbSwgdG9rZW5zLmxlbmd0aCAtIGZyb20pXG4gICAgcmV0dXJuIHJlc3VsdFxuICB9XG5cbiAgY29sb24gKHRva2Vucykge1xuICAgIGxldCBicmFja2V0cyA9IDBcbiAgICBsZXQgdG9rZW4sIHR5cGUsIHByZXZcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRva2Vucy5sZW5ndGg7IGkrKykge1xuICAgICAgdG9rZW4gPSB0b2tlbnNbaV1cbiAgICAgIHR5cGUgPSB0b2tlblswXVxuXG4gICAgICBpZiAodHlwZSA9PT0gJygnKSB7XG4gICAgICAgIGJyYWNrZXRzICs9IDFcbiAgICAgIH1cbiAgICAgIGlmICh0eXBlID09PSAnKScpIHtcbiAgICAgICAgYnJhY2tldHMgLT0gMVxuICAgICAgfVxuICAgICAgaWYgKGJyYWNrZXRzID09PSAwICYmIHR5cGUgPT09ICc6Jykge1xuICAgICAgICBpZiAoIXByZXYpIHtcbiAgICAgICAgICB0aGlzLmRvdWJsZUNvbG9uKHRva2VuKVxuICAgICAgICB9IGVsc2UgaWYgKHByZXZbMF0gPT09ICd3b3JkJyAmJiBwcmV2WzFdID09PSAncHJvZ2lkJykge1xuICAgICAgICAgIGNvbnRpbnVlXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgcmV0dXJuIGlcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBwcmV2ID0gdG9rZW5cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlXG4gIH1cblxuICAvLyBFcnJvcnNcblxuICB1bmNsb3NlZEJyYWNrZXQgKGJyYWNrZXQpIHtcbiAgICB0aHJvdyB0aGlzLmlucHV0LmVycm9yKCdVbmNsb3NlZCBicmFja2V0JywgYnJhY2tldFsyXSwgYnJhY2tldFszXSlcbiAgfVxuXG4gIHVua25vd25Xb3JkICh0b2tlbnMpIHtcbiAgICB0aHJvdyB0aGlzLmlucHV0LmVycm9yKCdVbmtub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GVkICs9IDFcbiAgICAgICAgaWYgKGZvdW5kZWQgPT09IDIpIGJyZWFrXG4gICAgICB9XG4gICAgfVxuICAgIHRocm93IHRoaXMuaW5wdXQuZXJyb3IoJ01pc3NlZCBzZW1pY29sb24nLCB0b2tlblsyXSwgdG9rZW5bM10pXG4gIH1cbn1cbiJdLCJmaWxlIjoicGFyc2VyLmpzIn0=
{ "pile_set_name": "Github" }
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var prefix = 'fab'; var iconName = 'fedora'; var width = 448; var height = 512; var ligatures = []; var unicode = 'f798'; var svgPathData = 'M225 32C101.3 31.7.8 131.7.4 255.4L0 425.7a53.6 53.6 0 0 0 53.6 53.9l170.2.4c123.7.3 224.3-99.7 224.6-223.4S348.7 32.3 225 32zm169.8 157.2L333 126.6c2.3-4.7 3.8-9.2 3.8-14.3v-1.6l55.2 56.1a101 101 0 0 1 2.8 22.4zM331 94.3a106.06 106.06 0 0 1 58.5 63.8l-54.3-54.6a26.48 26.48 0 0 0-4.2-9.2zM118.1 247.2a49.66 49.66 0 0 0-7.7 11.4l-8.5-8.5a85.78 85.78 0 0 1 16.2-2.9zM97 251.4l11.8 11.9-.9 8a34.74 34.74 0 0 0 2.4 12.5l-27-27.2a80.6 80.6 0 0 1 13.7-5.2zm-18.2 7.4l38.2 38.4a53.17 53.17 0 0 0-14.1 4.7L67.6 266a107 107 0 0 1 11.2-7.2zm-15.2 9.8l35.3 35.5a67.25 67.25 0 0 0-10.5 8.5L53.5 278a64.33 64.33 0 0 1 10.1-9.4zm-13.3 12.3l34.9 35a56.84 56.84 0 0 0-7.7 11.4l-35.8-35.9c2.8-3.8 5.7-7.2 8.6-10.5zm-11 14.3l36.4 36.6a48.29 48.29 0 0 0-3.6 15.2l-39.5-39.8a99.81 99.81 0 0 1 6.7-12zm-8.8 16.3l41.3 41.8a63.47 63.47 0 0 0 6.7 26.2L25.8 326c1.4-4.9 2.9-9.6 4.7-14.5zm-7.9 43l61.9 62.2a31.24 31.24 0 0 0-3.6 14.3v1.1l-55.4-55.7a88.27 88.27 0 0 1-2.9-21.9zm5.3 30.7l54.3 54.6a28.44 28.44 0 0 0 4.2 9.2 106.32 106.32 0 0 1-58.5-63.8zm-5.3-37a80.69 80.69 0 0 1 2.1-17l72.2 72.5a37.59 37.59 0 0 0-9.9 8.7zm253.3-51.8l-42.6-.1-.1 56c-.2 69.3-64.4 115.8-125.7 102.9-5.7 0-19.9-8.7-19.9-24.2a24.89 24.89 0 0 1 24.5-24.6c6.3 0 6.3 1.6 15.7 1.6a55.91 55.91 0 0 0 56.1-55.9l.1-47c0-4.5-4.5-9-8.9-9l-33.6-.1c-32.6-.1-32.5-49.4.1-49.3l42.6.1.1-56a105.18 105.18 0 0 1 105.6-105 86.35 86.35 0 0 1 20.2 2.3c11.2 1.8 19.9 11.9 19.9 24 0 15.5-14.9 27.8-30.3 23.9-27.4-5.9-65.9 14.4-66 54.9l-.1 47a8.94 8.94 0 0 0 8.9 9l33.6.1c32.5.2 32.4 49.5-.2 49.4zm23.5-.3a35.58 35.58 0 0 0 7.6-11.4l8.5 8.5a102 102 0 0 1-16.1 2.9zm21-4.2L308.6 280l.9-8.1a34.74 34.74 0 0 0-2.4-12.5l27 27.2a74.89 74.89 0 0 1-13.7 5.3zm18-7.4l-38-38.4c4.9-1.1 9.6-2.4 13.7-4.7l36.2 35.9c-3.8 2.5-7.9 5-11.9 7.2zm15.5-9.8l-35.3-35.5a61.06 61.06 0 0 0 10.5-8.5l34.9 35a124.56 124.56 0 0 1-10.1 9zm13.2-12.3l-34.9-35a63.18 63.18 0 0 0 7.7-11.4l35.8 35.9a130.28 130.28 0 0 1-8.6 10.5zm11-14.3l-36.4-36.6a48.29 48.29 0 0 0 3.6-15.2l39.5 39.8a87.72 87.72 0 0 1-6.7 12zm13.5-30.9a140.63 140.63 0 0 1-4.7 14.3L345.6 190a58.19 58.19 0 0 0-7.1-26.2zm1-5.6l-71.9-72.1a32 32 0 0 0 9.9-9.2l64.3 64.7a90.93 90.93 0 0 1-2.3 16.6z'; exports.definition = { prefix: prefix, iconName: iconName, icon: [ width, height, ligatures, unicode, svgPathData ]}; exports.faFedora = exports.definition; exports.prefix = prefix; exports.iconName = iconName; exports.width = width; exports.height = height; exports.ligatures = ligatures; exports.unicode = unicode; exports.svgPathData = svgPathData;
{ "pile_set_name": "Github" }
<RCC> <qresource prefix="icons/default"> <file alias="index.theme">icons/index.theme</file> <file alias="16x16/checked.png">icons/16x16/checked.png</file> <file alias="16x16/failed.png">icons/16x16/failed.png</file> <file alias="16x16/connected.png">icons/16x16/connected.png</file> <file alias="16x16/disconnected.png">icons/16x16/disconnected.png</file> <file alias="16x16/connected_notification.png">icons/16x16/connected_notification.png</file> <file alias="16x16/lock.png">icons/16x16/lock.png</file> <file alias="48x48/bad_folder.png">icons/48x48/bad_folder.png</file> <file alias="48x48/chip.png">icons/48x48/chip.png</file> <file alias="48x48/folder.png">icons/48x48/folder.png</file> <file alias="48x48/no_avatar.png">icons/48x48/no_avatar.png</file> <file alias="48x48/plus.png">icons/48x48/plus.png</file> <file alias="48x48/sd_card.png">icons/48x48/sd_card.png</file> <file alias="256x256/citra.png">icons/256x256/citra.png</file> <file alias="256x256/plus_folder.png">icons/256x256/plus_folder.png</file> </qresource> </RCC>
{ "pile_set_name": "Github" }
/* * ControllerView.cpp - view-component for an controller * * Copyright (c) 2008-2009 Paul Giblock <drfaygo/at/gmail.com> * Copyright (c) 2011-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net> * * This file is part of LMMS - https://lmms.io * * 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 (see COPYING); if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * */ #include <QLabel> #include <QPushButton> #include <QMdiArea> #include <QMdiSubWindow> #include <QPainter> #include <QInputDialog> #include <QLayout> #include "ControllerView.h" #include "CaptionMenu.h" #include "ControllerDialog.h" #include "gui_templates.h" #include "embed.h" #include "GuiApplication.h" #include "LedCheckbox.h" #include "MainWindow.h" #include "ToolTip.h" ControllerView::ControllerView( Controller * _model, QWidget * _parent ) : QFrame( _parent ), ModelView( _model, this ), m_subWindow( NULL ), m_controllerDlg( NULL ), m_show( true ) { this->setFrameStyle( QFrame::StyledPanel ); this->setFrameShadow( QFrame::Raised ); QVBoxLayout *vBoxLayout = new QVBoxLayout(this); QHBoxLayout *hBox = new QHBoxLayout(); vBoxLayout->addLayout(hBox); QLabel *label = new QLabel( "<b>" + _model->displayName() + "</b>", this); QSizePolicy sizePolicy = label->sizePolicy(); sizePolicy.setHorizontalStretch(1); label->setSizePolicy(sizePolicy); hBox->addWidget(label); QPushButton * controlsButton = new QPushButton( tr( "Controls" ), this ); connect( controlsButton, SIGNAL( clicked() ), SLOT( editControls() ) ); hBox->addWidget(controlsButton); m_nameLabel = new QLabel(_model->name(), this); vBoxLayout->addWidget(m_nameLabel); m_controllerDlg = getController()->createDialog( gui->mainWindow()->workspace() ); m_subWindow = gui->mainWindow()->addWindowedWidget( m_controllerDlg ); Qt::WindowFlags flags = m_subWindow->windowFlags(); flags &= ~Qt::WindowMaximizeButtonHint; m_subWindow->setWindowFlags( flags ); m_subWindow->setFixedSize( m_subWindow->size() ); m_subWindow->setWindowIcon( m_controllerDlg->windowIcon() ); connect( m_controllerDlg, SIGNAL( closed() ), this, SLOT( closeControls() ) ); m_subWindow->hide(); setModel( _model ); } ControllerView::~ControllerView() { if (m_subWindow) { delete m_subWindow; } } void ControllerView::editControls() { if( m_show ) { m_subWindow->show(); m_subWindow->raise(); m_show = false; } else { m_subWindow->hide(); m_show = true; } } void ControllerView::closeControls() { m_subWindow->hide(); m_show = true; } void ControllerView::deleteController() { emit( deleteController( this ) ); } void ControllerView::renameController() { bool ok; Controller * c = castModel<Controller>(); QString new_name = QInputDialog::getText( this, tr( "Rename controller" ), tr( "Enter the new name for this controller" ), QLineEdit::Normal, c->name() , &ok ); if( ok && !new_name.isEmpty() ) { c->setName( new_name ); if( getController()->type() == Controller::LfoController ) { m_controllerDlg->setWindowTitle( tr( "LFO" ) + " (" + new_name + ")" ); } m_nameLabel->setText( new_name ); } } void ControllerView::mouseDoubleClickEvent( QMouseEvent * event ) { renameController(); } void ControllerView::modelChanged() { } void ControllerView::contextMenuEvent( QContextMenuEvent * ) { QPointer<CaptionMenu> contextMenu = new CaptionMenu( model()->displayName(), this ); contextMenu->addAction( embed::getIconPixmap( "cancel" ), tr( "&Remove this controller" ), this, SLOT( deleteController() ) ); contextMenu->addAction( tr("Re&name this controller"), this, SLOT( renameController() )); contextMenu->addSeparator(); contextMenu->exec( QCursor::pos() ); delete contextMenu; }
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "universal", "filename" : "onepiece.png", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
import torch import torch.nn.functional as F from mmdet.core import (bbox2result, bbox2roi, bbox_mapping, build_assigner, build_sampler, merge_aug_bboxes, merge_aug_masks, multiclass_nms) from .. import builder from ..registry import DETECTORS from .cascade_rcnn import CascadeRCNN @DETECTORS.register_module class HybridTaskCascade(CascadeRCNN): def __init__(self, num_stages, backbone, semantic_roi_extractor=None, semantic_head=None, semantic_fusion=('bbox', 'mask'), interleaved=True, mask_info_flow=True, **kwargs): super(HybridTaskCascade, self).__init__(num_stages, backbone, **kwargs) assert self.with_bbox and self.with_mask assert not self.with_shared_head # shared head not supported if semantic_head is not None: self.semantic_roi_extractor = builder.build_roi_extractor( semantic_roi_extractor) self.semantic_head = builder.build_head(semantic_head) self.semantic_fusion = semantic_fusion self.interleaved = interleaved self.mask_info_flow = mask_info_flow @property def with_semantic(self): if hasattr(self, 'semantic_head') and self.semantic_head is not None: return True else: return False def _bbox_forward_train(self, stage, x, sampling_results, gt_bboxes, gt_labels, rcnn_train_cfg, semantic_feat=None): rois = bbox2roi([res.bboxes for res in sampling_results]) bbox_roi_extractor = self.bbox_roi_extractor[stage] bbox_head = self.bbox_head[stage] bbox_feats = bbox_roi_extractor(x[:bbox_roi_extractor.num_inputs], rois) # semantic feature fusion # element-wise sum for original features and pooled semantic features if self.with_semantic and 'bbox' in self.semantic_fusion: bbox_semantic_feat = self.semantic_roi_extractor([semantic_feat], rois) if bbox_semantic_feat.shape[-2:] != bbox_feats.shape[-2:]: bbox_semantic_feat = F.adaptive_avg_pool2d( bbox_semantic_feat, bbox_feats.shape[-2:]) bbox_feats += bbox_semantic_feat cls_score, bbox_pred = bbox_head(bbox_feats) bbox_targets = bbox_head.get_target(sampling_results, gt_bboxes, gt_labels, rcnn_train_cfg) loss_bbox = bbox_head.loss(cls_score, bbox_pred, *bbox_targets) return loss_bbox, rois, bbox_targets, bbox_pred def _mask_forward_train(self, stage, x, sampling_results, gt_masks, rcnn_train_cfg, semantic_feat=None): mask_roi_extractor = self.mask_roi_extractor[stage] mask_head = self.mask_head[stage] pos_rois = bbox2roi([res.pos_bboxes for res in sampling_results]) mask_feats = mask_roi_extractor(x[:mask_roi_extractor.num_inputs], pos_rois) # semantic feature fusion # element-wise sum for original features and pooled semantic features if self.with_semantic and 'mask' in self.semantic_fusion: mask_semantic_feat = self.semantic_roi_extractor([semantic_feat], pos_rois) if mask_semantic_feat.shape[-2:] != mask_feats.shape[-2:]: mask_semantic_feat = F.adaptive_avg_pool2d( mask_semantic_feat, mask_feats.shape[-2:]) mask_feats += mask_semantic_feat # mask information flow # forward all previous mask heads to obtain last_feat, and fuse it # with the normal mask feature if self.mask_info_flow: last_feat = None for i in range(stage): last_feat = self.mask_head[i]( mask_feats, last_feat, return_logits=False) mask_pred = mask_head(mask_feats, last_feat, return_feat=False) else: mask_pred = mask_head(mask_feats) mask_targets = mask_head.get_target(sampling_results, gt_masks, rcnn_train_cfg) pos_labels = torch.cat([res.pos_gt_labels for res in sampling_results]) loss_mask = mask_head.loss(mask_pred, mask_targets, pos_labels) return loss_mask def _bbox_forward_test(self, stage, x, rois, semantic_feat=None): bbox_roi_extractor = self.bbox_roi_extractor[stage] bbox_head = self.bbox_head[stage] bbox_feats = bbox_roi_extractor( x[:len(bbox_roi_extractor.featmap_strides)], rois) if self.with_semantic and 'bbox' in self.semantic_fusion: bbox_semantic_feat = self.semantic_roi_extractor([semantic_feat], rois) if bbox_semantic_feat.shape[-2:] != bbox_feats.shape[-2:]: bbox_semantic_feat = F.adaptive_avg_pool2d( bbox_semantic_feat, bbox_feats.shape[-2:]) bbox_feats += bbox_semantic_feat cls_score, bbox_pred = bbox_head(bbox_feats) return cls_score, bbox_pred def _mask_forward_test(self, stage, x, bboxes, semantic_feat=None): mask_roi_extractor = self.mask_roi_extractor[stage] mask_head = self.mask_head[stage] mask_rois = bbox2roi([bboxes]) mask_feats = mask_roi_extractor( x[:len(mask_roi_extractor.featmap_strides)], mask_rois) if self.with_semantic and 'mask' in self.semantic_fusion: mask_semantic_feat = self.semantic_roi_extractor([semantic_feat], mask_rois) if mask_semantic_feat.shape[-2:] != mask_feats.shape[-2:]: mask_semantic_feat = F.adaptive_avg_pool2d( mask_semantic_feat, mask_feats.shape[-2:]) mask_feats += mask_semantic_feat if self.mask_info_flow: last_feat = None last_pred = None for i in range(stage): mask_pred, last_feat = self.mask_head[i](mask_feats, last_feat) if last_pred is not None: mask_pred = mask_pred + last_pred last_pred = mask_pred mask_pred = mask_head(mask_feats, last_feat, return_feat=False) if last_pred is not None: mask_pred = mask_pred + last_pred else: mask_pred = mask_head(mask_feats) return mask_pred def forward_dummy(self, img): outs = () # backbone x = self.extract_feat(img) # rpn if self.with_rpn: rpn_outs = self.rpn_head(x) outs = outs + (rpn_outs, ) proposals = torch.randn(1000, 4).cuda() # semantic head if self.with_semantic: _, semantic_feat = self.semantic_head(x) else: semantic_feat = None # bbox heads rois = bbox2roi([proposals]) for i in range(self.num_stages): cls_score, bbox_pred = self._bbox_forward_test( i, x, rois, semantic_feat=semantic_feat) outs = outs + (cls_score, bbox_pred) # mask heads if self.with_mask: mask_rois = rois[:100] mask_roi_extractor = self.mask_roi_extractor[-1] mask_feats = mask_roi_extractor( x[:len(mask_roi_extractor.featmap_strides)], mask_rois) if self.with_semantic and 'mask' in self.semantic_fusion: mask_semantic_feat = self.semantic_roi_extractor( [semantic_feat], mask_rois) mask_feats += mask_semantic_feat last_feat = None for i in range(self.num_stages): mask_head = self.mask_head[i] if self.mask_info_flow: mask_pred, last_feat = mask_head(mask_feats, last_feat) else: mask_pred = mask_head(mask_feats) outs = outs + (mask_pred, ) return outs def forward_train(self, img, img_meta, gt_bboxes, gt_labels, gt_bboxes_ignore=None, gt_masks=None, gt_semantic_seg=None, proposals=None): x = self.extract_feat(img) losses = dict() # RPN part, the same as normal two-stage detectors if self.with_rpn: rpn_outs = self.rpn_head(x) rpn_loss_inputs = rpn_outs + (gt_bboxes, img_meta, self.train_cfg.rpn) rpn_losses = self.rpn_head.loss( *rpn_loss_inputs, gt_bboxes_ignore=gt_bboxes_ignore) losses.update(rpn_losses) proposal_cfg = self.train_cfg.get('rpn_proposal', self.test_cfg.rpn) proposal_inputs = rpn_outs + (img_meta, proposal_cfg) proposal_list = self.rpn_head.get_bboxes(*proposal_inputs) else: proposal_list = proposals # semantic segmentation part # 2 outputs: segmentation prediction and embedded features if self.with_semantic: semantic_pred, semantic_feat = self.semantic_head(x) loss_seg = self.semantic_head.loss(semantic_pred, gt_semantic_seg) losses['loss_semantic_seg'] = loss_seg else: semantic_feat = None for i in range(self.num_stages): self.current_stage = i rcnn_train_cfg = self.train_cfg.rcnn[i] lw = self.train_cfg.stage_loss_weights[i] # assign gts and sample proposals sampling_results = [] bbox_assigner = build_assigner(rcnn_train_cfg.assigner) bbox_sampler = build_sampler(rcnn_train_cfg.sampler, context=self) num_imgs = img.size(0) if gt_bboxes_ignore is None: gt_bboxes_ignore = [None for _ in range(num_imgs)] for j in range(num_imgs): assign_result = bbox_assigner.assign(proposal_list[j], gt_bboxes[j], gt_bboxes_ignore[j], gt_labels[j]) sampling_result = bbox_sampler.sample( assign_result, proposal_list[j], gt_bboxes[j], gt_labels[j], feats=[lvl_feat[j][None] for lvl_feat in x]) sampling_results.append(sampling_result) # bbox head forward and loss loss_bbox, rois, bbox_targets, bbox_pred = \ self._bbox_forward_train( i, x, sampling_results, gt_bboxes, gt_labels, rcnn_train_cfg, semantic_feat) roi_labels = bbox_targets[0] for name, value in loss_bbox.items(): losses['s{}.{}'.format(i, name)] = ( value * lw if 'loss' in name else value) # mask head forward and loss if self.with_mask: # interleaved execution: use regressed bboxes by the box branch # to train the mask branch if self.interleaved: pos_is_gts = [res.pos_is_gt for res in sampling_results] with torch.no_grad(): proposal_list = self.bbox_head[i].refine_bboxes( rois, roi_labels, bbox_pred, pos_is_gts, img_meta) # re-assign and sample 512 RoIs from 512 RoIs sampling_results = [] for j in range(num_imgs): assign_result = bbox_assigner.assign( proposal_list[j], gt_bboxes[j], gt_bboxes_ignore[j], gt_labels[j]) sampling_result = bbox_sampler.sample( assign_result, proposal_list[j], gt_bboxes[j], gt_labels[j], feats=[lvl_feat[j][None] for lvl_feat in x]) sampling_results.append(sampling_result) loss_mask = self._mask_forward_train(i, x, sampling_results, gt_masks, rcnn_train_cfg, semantic_feat) for name, value in loss_mask.items(): losses['s{}.{}'.format(i, name)] = ( value * lw if 'loss' in name else value) # refine bboxes (same as Cascade R-CNN) if i < self.num_stages - 1 and not self.interleaved: pos_is_gts = [res.pos_is_gt for res in sampling_results] with torch.no_grad(): proposal_list = self.bbox_head[i].refine_bboxes( rois, roi_labels, bbox_pred, pos_is_gts, img_meta) return losses def simple_test(self, img, img_meta, proposals=None, rescale=False): x = self.extract_feat(img) proposal_list = self.simple_test_rpn( x, img_meta, self.test_cfg.rpn) if proposals is None else proposals if self.with_semantic: _, semantic_feat = self.semantic_head(x) else: semantic_feat = None img_shape = img_meta[0]['img_shape'] ori_shape = img_meta[0]['ori_shape'] scale_factor = img_meta[0]['scale_factor'] # "ms" in variable names means multi-stage ms_bbox_result = {} ms_segm_result = {} ms_scores = [] rcnn_test_cfg = self.test_cfg.rcnn rois = bbox2roi(proposal_list) for i in range(self.num_stages): bbox_head = self.bbox_head[i] cls_score, bbox_pred = self._bbox_forward_test( i, x, rois, semantic_feat=semantic_feat) ms_scores.append(cls_score) if self.test_cfg.keep_all_stages: det_bboxes, det_labels = bbox_head.get_det_bboxes( rois, cls_score, bbox_pred, img_shape, scale_factor, rescale=rescale, nms_cfg=rcnn_test_cfg) bbox_result = bbox2result(det_bboxes, det_labels, bbox_head.num_classes) ms_bbox_result['stage{}'.format(i)] = bbox_result if self.with_mask: mask_head = self.mask_head[i] if det_bboxes.shape[0] == 0: mask_classes = mask_head.num_classes - 1 segm_result = [[] for _ in range(mask_classes)] else: _bboxes = ( det_bboxes[:, :4] * scale_factor if rescale else det_bboxes) mask_pred = self._mask_forward_test( i, x, _bboxes, semantic_feat=semantic_feat) segm_result = mask_head.get_seg_masks( mask_pred, _bboxes, det_labels, rcnn_test_cfg, ori_shape, scale_factor, rescale) ms_segm_result['stage{}'.format(i)] = segm_result if i < self.num_stages - 1: bbox_label = cls_score.argmax(dim=1) rois = bbox_head.regress_by_class(rois, bbox_label, bbox_pred, img_meta[0]) cls_score = sum(ms_scores) / float(len(ms_scores)) det_bboxes, det_labels = self.bbox_head[-1].get_det_bboxes( rois, cls_score, bbox_pred, img_shape, scale_factor, rescale=rescale, cfg=rcnn_test_cfg) bbox_result = bbox2result(det_bboxes, det_labels, self.bbox_head[-1].num_classes) ms_bbox_result['ensemble'] = bbox_result if self.with_mask: if det_bboxes.shape[0] == 0: mask_classes = self.mask_head[-1].num_classes - 1 segm_result = [[] for _ in range(mask_classes)] else: _bboxes = ( det_bboxes[:, :4] * scale_factor if rescale else det_bboxes) mask_rois = bbox2roi([_bboxes]) aug_masks = [] mask_roi_extractor = self.mask_roi_extractor[-1] mask_feats = mask_roi_extractor( x[:len(mask_roi_extractor.featmap_strides)], mask_rois) if self.with_semantic and 'mask' in self.semantic_fusion: mask_semantic_feat = self.semantic_roi_extractor( [semantic_feat], mask_rois) mask_feats += mask_semantic_feat last_feat = None for i in range(self.num_stages): mask_head = self.mask_head[i] if self.mask_info_flow: mask_pred, last_feat = mask_head(mask_feats, last_feat) else: mask_pred = mask_head(mask_feats) aug_masks.append(mask_pred.sigmoid().cpu().numpy()) merged_masks = merge_aug_masks(aug_masks, [img_meta] * self.num_stages, self.test_cfg.rcnn) segm_result = self.mask_head[-1].get_seg_masks( merged_masks, _bboxes, det_labels, rcnn_test_cfg, ori_shape, scale_factor, rescale) ms_segm_result['ensemble'] = segm_result if not self.test_cfg.keep_all_stages: if self.with_mask: results = (ms_bbox_result['ensemble'], ms_segm_result['ensemble']) else: results = ms_bbox_result['ensemble'] else: if self.with_mask: results = { stage: (ms_bbox_result[stage], ms_segm_result[stage]) for stage in ms_bbox_result } else: results = ms_bbox_result return results def aug_test(self, imgs, img_metas, proposals=None, rescale=False): """Test with augmentations. If rescale is False, then returned bboxes and masks will fit the scale of imgs[0]. """ if self.with_semantic: semantic_feats = [ self.semantic_head(feat)[1] for feat in self.extract_feats(imgs) ] else: semantic_feats = [None] * len(img_metas) # recompute feats to save memory proposal_list = self.aug_test_rpn( self.extract_feats(imgs), img_metas, self.test_cfg.rpn) rcnn_test_cfg = self.test_cfg.rcnn aug_bboxes = [] aug_scores = [] for x, img_meta, semantic in zip( self.extract_feats(imgs), img_metas, semantic_feats): # only one image in the batch img_shape = img_meta[0]['img_shape'] scale_factor = img_meta[0]['scale_factor'] flip = img_meta[0]['flip'] proposals = bbox_mapping(proposal_list[0][:, :4], img_shape, scale_factor, flip) # "ms" in variable names means multi-stage ms_scores = [] rois = bbox2roi([proposals]) for i in range(self.num_stages): bbox_head = self.bbox_head[i] cls_score, bbox_pred = self._bbox_forward_test( i, x, rois, semantic_feat=semantic) ms_scores.append(cls_score) if i < self.num_stages - 1: bbox_label = cls_score.argmax(dim=1) rois = bbox_head.regress_by_class(rois, bbox_label, bbox_pred, img_meta[0]) cls_score = sum(ms_scores) / float(len(ms_scores)) bboxes, scores = self.bbox_head[-1].get_det_bboxes( rois, cls_score, bbox_pred, img_shape, scale_factor, rescale=False, cfg=None) aug_bboxes.append(bboxes) aug_scores.append(scores) # after merging, bboxes will be rescaled to the original image size merged_bboxes, merged_scores = merge_aug_bboxes( aug_bboxes, aug_scores, img_metas, rcnn_test_cfg) det_bboxes, det_labels = multiclass_nms(merged_bboxes, merged_scores, rcnn_test_cfg.score_thr, rcnn_test_cfg.nms, rcnn_test_cfg.max_per_img) bbox_result = bbox2result(det_bboxes, det_labels, self.bbox_head[-1].num_classes) if self.with_mask: if det_bboxes.shape[0] == 0: segm_result = [[] for _ in range(self.mask_head[-1].num_classes - 1)] else: aug_masks = [] aug_img_metas = [] for x, img_meta, semantic in zip( self.extract_feats(imgs), img_metas, semantic_feats): img_shape = img_meta[0]['img_shape'] scale_factor = img_meta[0]['scale_factor'] flip = img_meta[0]['flip'] _bboxes = bbox_mapping(det_bboxes[:, :4], img_shape, scale_factor, flip) mask_rois = bbox2roi([_bboxes]) mask_feats = self.mask_roi_extractor[-1]( x[:len(self.mask_roi_extractor[-1].featmap_strides)], mask_rois) if self.with_semantic: semantic_feat = semantic mask_semantic_feat = self.semantic_roi_extractor( [semantic_feat], mask_rois) if mask_semantic_feat.shape[-2:] != mask_feats.shape[ -2:]: mask_semantic_feat = F.adaptive_avg_pool2d( mask_semantic_feat, mask_feats.shape[-2:]) mask_feats += mask_semantic_feat last_feat = None for i in range(self.num_stages): mask_head = self.mask_head[i] if self.mask_info_flow: mask_pred, last_feat = mask_head( mask_feats, last_feat) else: mask_pred = mask_head(mask_feats) aug_masks.append(mask_pred.sigmoid().cpu().numpy()) aug_img_metas.append(img_meta) merged_masks = merge_aug_masks(aug_masks, aug_img_metas, self.test_cfg.rcnn) ori_shape = img_metas[0][0]['ori_shape'] segm_result = self.mask_head[-1].get_seg_masks( merged_masks, det_bboxes, det_labels, rcnn_test_cfg, ori_shape, scale_factor=1.0, rescale=False) return bbox_result, segm_result else: return bbox_result
{ "pile_set_name": "Github" }
// Mantid Repository : https://github.com/mantidproject/mantid // // Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, // NScD Oak Ridge National Laboratory, European Spallation Source, // Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS // SPDX - License - Identifier: GPL - 3.0 + /** See the developer documentation for Batch Widget at developer.mantidproject.org/BatchWidget/index.html */ #pragma once #include "MantidQtWidgets/Common/Batch/RowLocation.h" #include "MantidQtWidgets/Common/Batch/StrictQModelIndices.h" #include "MantidQtWidgets/Common/DllOption.h" #include <QStandardItemModel> namespace MantidQt { namespace MantidWidgets { namespace Batch { class EXPORT_OPT_MANTIDQT_COMMON RowLocationAdapter { public: RowLocationAdapter(QStandardItemModel const &model); RowLocation atIndex(QModelIndexForMainModel const &index) const; boost::optional<QModelIndexForMainModel> indexIfExistsAt(RowLocation const &location, int column = 0) const; QModelIndexForMainModel indexAt(RowLocation const &location, int column = 0) const; private: QModelIndex walkFromRootToParentIndexOf(RowLocation const &location) const; QStandardItemModel const &m_model; }; } // namespace Batch } // namespace MantidWidgets } // namespace MantidQt
{ "pile_set_name": "Github" }
--- /dev/null +++ b/Makefile.am @@ -0,0 +1,2 @@ +ACLOCAL_AMFLAGS = -I m4 +SUBDIRS = . --- /dev/null +++ b/libcharset/Makefile.am @@ -0,0 +1 @@ +ACLOCAL_AMFLAGS = -I m4 --- a/configure.ac +++ b/configure.ac @@ -54,7 +54,7 @@ AC_ISC_POSIX dnl checks for installer options -AC_RELOCATABLE +gl_RELOCATABLE AC_ARG_ENABLE([extra-encodings], [AC_HELP_STRING([--enable-extra-encodings], --- a/libcharset/configure.ac +++ b/libcharset/configure.ac @@ -41,7 +41,7 @@ AC_CANONICAL_HOST dnl checks for installer options -AC_RELOCATABLE_LIBRARY +gl_RELOCATABLE_LIBRARY dnl checks for programs
{ "pile_set_name": "Github" }
gcr.io/google_containers/cos-kernel-headers:20180720-R00-00
{ "pile_set_name": "Github" }
// divides.hpp // // (C) Copyright 2011 Vicente J. Botet Escriba // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). // #ifndef BOOST_RATIO_MPL_DIVIDES_HPP #define BOOST_RATIO_MPL_DIVIDES_HPP #include <boost/ratio/ratio.hpp> #include <boost/ratio/mpl/numeric_cast.hpp> #include <boost/mpl/divides.hpp> namespace boost { namespace mpl { template<> struct divides_impl< rational_c_tag,rational_c_tag > { template< typename R1, typename R2 > struct apply : ratio_divide<R1, R2> { }; }; } } #endif // BOOST_RATIO_MPL_DIVIDES_HPP
{ "pile_set_name": "Github" }
package core // (C) Copyright IBM Corp. 2019. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import ( "fmt" "net/http" ) // The BearerTokenAuthenticator will authenticate requests by adding // a "Bearer"-type Authorization header that contains the configured bearer token value. type BearerTokenAuthenticator struct { // [Required] - the bearer token value to be used to authenticate request. BearerToken string } // NewBearerTokenAuthenticator: Constructs a new BearerTokenAuthenticator instance. func NewBearerTokenAuthenticator(bearerToken string) (*BearerTokenAuthenticator, error) { obj := &BearerTokenAuthenticator{ BearerToken: bearerToken, } if err := obj.Validate(); err != nil { return nil, err } return obj, nil } // newBearerTokenAuthenticator : Constructs a new BearerTokenAuthenticator instance from a map. func newBearerTokenAuthenticatorFromMap(properties map[string]string) (*BearerTokenAuthenticator, error) { if properties == nil { return nil, fmt.Errorf(ERRORMSG_PROPS_MAP_NIL) } return NewBearerTokenAuthenticator(properties[PROPNAME_BEARER_TOKEN]) } func (BearerTokenAuthenticator) AuthenticationType() string { return AUTHTYPE_BEARER_TOKEN } // Authenticate: authenticates the specified request by adding an Authorization header // that contains the bearer token value. func (this BearerTokenAuthenticator) Authenticate(request *http.Request) error { request.Header.Set("Authorization", fmt.Sprintf(`Bearer %s`, this.BearerToken)) return nil } // Validate: validates the configuration func (this BearerTokenAuthenticator) Validate() error { if this.BearerToken == "" { return fmt.Errorf(ERRORMSG_PROP_MISSING, "BearerToken") } return nil }
{ "pile_set_name": "Github" }
package apimanagement // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // limitations under the License. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) // GroupClient is the apiManagement Client type GroupClient struct { BaseClient } // NewGroupClient creates an instance of the GroupClient client. func NewGroupClient(subscriptionID string) GroupClient { return NewGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewGroupClientWithBaseURI creates an instance of the GroupClient client using a custom endpoint. Use this when // interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). func NewGroupClientWithBaseURI(baseURI string, subscriptionID string) GroupClient { return GroupClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creates or Updates a group. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // groupID - group identifier. Must be unique in the current API Management service instance. // parameters - create parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. func (client GroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, groupID string, parameters GroupCreateParameters, ifMatch string) (result GroupContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GroupClient.CreateOrUpdate") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: serviceName, Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.GroupCreateParametersProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.GroupCreateParametersProperties.DisplayName", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.GroupCreateParametersProperties.DisplayName", Name: validation.MaxLength, Rule: 300, Chain: nil}, {Target: "parameters.GroupCreateParametersProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, groupID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. func (client GroupClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, parameters GroupCreateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "groupId": autorest.Encode("path", groupID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) if len(ifMatch) > 0 { preparer = autorest.DecoratePreparer(preparer, autorest.WithHeader("If-Match", autorest.String(ifMatch))) } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client GroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. func (client GroupClient) CreateOrUpdateResponder(resp *http.Response) (result GroupContract, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // Delete deletes specific group of the API Management service instance. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // groupID - group identifier. Must be unique in the current API Management service instance. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. func (client GroupClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GroupClient.Delete") defer func() { sc := -1 if result.Response != nil { sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: serviceName, Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, groupID, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. func (client GroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "groupId": autorest.Encode("path", groupID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}", pathParameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client GroupClient) DeleteSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. func (client GroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } // Get gets the details of the group specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // groupID - group identifier. Must be unique in the current API Management service instance. func (client GroupClient) Get(ctx context.Context, resourceGroupName string, serviceName string, groupID string) (result GroupContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GroupClient.Get") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: serviceName, Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, groupID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. func (client GroupClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "groupId": autorest.Encode("path", groupID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client GroupClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client GroupClient) GetResponder(resp *http.Response) (result GroupContract, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // GetEntityTag gets the entity state (Etag) version of the group specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // groupID - group identifier. Must be unique in the current API Management service instance. func (client GroupClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, groupID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GroupClient.GetEntityTag") defer func() { sc := -1 if result.Response != nil { sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: serviceName, Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "GetEntityTag", err.Error()) } req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, groupID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "GetEntityTag", nil, "Failure preparing request") return } resp, err := client.GetEntityTagSender(req) if err != nil { result.Response = resp err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "GetEntityTag", resp, "Failure sending request") return } result, err = client.GetEntityTagResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "GetEntityTag", resp, "Failure responding to request") } return } // GetEntityTagPreparer prepares the GetEntityTag request. func (client GroupClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "groupId": autorest.Encode("path", groupID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetEntityTagSender sends the GetEntityTag request. The method will close the // http.Response Body if it receives an error. func (client GroupClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetEntityTagResponder handles the response to the GetEntityTag request. The method always // closes the http.Response Body. func (client GroupClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp return } // ListByService lists a collection of groups defined within a service instance. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // filter - | Field | Usage | Supported operators | Supported functions // |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, ne, gt, lt // | substringof, contains, startswith, endswith | </br>| displayName | filter | ge, le, eq, ne, gt, lt | // substringof, contains, startswith, endswith | </br>| description | filter | ge, le, eq, ne, gt, lt | // substringof, contains, startswith, endswith | </br>| aadObjectId | filter | eq | | </br> // top - number of records to return. // skip - number of records to skip. func (client GroupClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result GroupCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GroupClient.ListByService") defer func() { sc := -1 if result.gc.Response.Response != nil { sc = result.gc.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: serviceName, Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "ListByService", err.Error()) } result.fn = client.listByServiceNextResults req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "ListByService", nil, "Failure preparing request") return } resp, err := client.ListByServiceSender(req) if err != nil { result.gc.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "ListByService", resp, "Failure sending request") return } result.gc, err = client.ListByServiceResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "ListByService", resp, "Failure responding to request") } if result.gc.hasNextLink() && result.gc.IsEmpty() { err = result.NextWithContext(ctx) } return } // ListByServicePreparer prepares the ListByService request. func (client GroupClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } if len(filter) > 0 { queryParameters["$filter"] = autorest.Encode("query", filter) } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client GroupClient) ListByServiceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. func (client GroupClient) ListByServiceResponder(resp *http.Response) (result GroupCollection, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // listByServiceNextResults retrieves the next set of results, if any. func (client GroupClient) listByServiceNextResults(ctx context.Context, lastResults GroupCollection) (result GroupCollection, err error) { req, err := lastResults.groupCollectionPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "apimanagement.GroupClient", "listByServiceNextResults", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListByServiceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "apimanagement.GroupClient", "listByServiceNextResults", resp, "Failure sending next results request") } result, err = client.ListByServiceResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "listByServiceNextResults", resp, "Failure responding to next results request") } return } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. func (client GroupClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result GroupCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GroupClient.ListByService") defer func() { sc := -1 if result.Response().Response.Response != nil { sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) return } // Update updates the details of the group specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // groupID - group identifier. Must be unique in the current API Management service instance. // parameters - update parameters. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. func (client GroupClient) Update(ctx context.Context, resourceGroupName string, serviceName string, groupID string, parameters GroupUpdateParameters, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GroupClient.Update") defer func() { sc := -1 if result.Response != nil { sc = result.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: serviceName, Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, groupID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = resp err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "Update", resp, "Failure responding to request") } return } // UpdatePreparer prepares the Update request. func (client GroupClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, parameters GroupUpdateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "groupId": autorest.Encode("path", groupID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client GroupClient) UpdateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. func (client GroupClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return }
{ "pile_set_name": "Github" }
/* * Copyright 2004-2009 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springmodules.validation.bean.rule; import org.springmodules.validation.bean.rule.resolver.ErrorArgumentsResolver; import org.springmodules.validation.util.condition.Condition; import org.springmodules.validation.util.condition.common.AlwaysTrueCondition; import org.springmodules.validation.bean.context.ValidationContextHolder; import org.springmodules.validation.bean.context.ValidationContext; import org.springmodules.validation.bean.context.ValidationContextUtils; /** * A super class for all specific validation rules. * * @author Uri Boness */ public abstract class AbstractValidationRule implements ValidationRule { private String errorCode; private String defaultErrorMessage; private ErrorArgumentsResolver errorArgumentsResolver; private Condition applicabilityCondition; private String[] contextTokens; /** * Constructs a new AbstractValidationRule with a default error code. By default, the error arguments * of this validation rule will only return the validated object itself. * * @param defaultErrorCode */ protected AbstractValidationRule(String defaultErrorCode) { this(defaultErrorCode, createErrorArgumentsResolver(new Object[0])); } /** * Constructs a new AbstractValidationRule with a default error code and error argument resolver. * * @param defaultErrorCode The default error code for this validation rule. * @param defaultErrorArgumentsResolver The argument resolver for this validation rule. */ protected AbstractValidationRule(String defaultErrorCode, ErrorArgumentsResolver defaultErrorArgumentsResolver) { this.errorCode = defaultErrorCode; this.defaultErrorMessage = this.errorCode; this.errorArgumentsResolver = defaultErrorArgumentsResolver; this.applicabilityCondition = new AlwaysTrueCondition(); this.contextTokens = null; } /** * Checks if this validation rule is applicable on a given object by performing the following two steps: * <ol> * <li>If the object is <code>null</code> and {@link #supportsNullValues()} returns <code>false</code> * then returning <code>false</code>.</li> * <li>Returning whatever the applicablity condition check returns for the given object * ({@link #setApplicabilityCondition(org.springmodules.validation.util.condition.Condition)})</li> * * @see ValidationRule#isApplicable(Object) */ public boolean isApplicable(Object obj) { if (contextTokens != null && !checkContexts(contextTokens)) { return false; } if (obj == null && !supportsNullValues()) { return false; } return applicabilityCondition.check(obj); } /** * @see org.springmodules.validation.bean.rule.ValidationRule#getErrorCode() */ public String getErrorCode() { return errorCode; } /** * Returns the error arguments for this validation rule based on the given validated object. The arguments are * determined by the associated {@link ErrorArgumentsResolver}. * * @see #setErrorArgumentsResolver(org.springmodules.validation.bean.rule.resolver.ErrorArgumentsResolver) * @see ValidationRule#getErrorArguments(Object) */ public Object[] getErrorArguments(Object obj) { return errorArgumentsResolver.resolveArguments(obj); } /** * @see org.springmodules.validation.bean.rule.ValidationRule#getDefaultErrorMessage() */ public String getDefaultErrorMessage() { return defaultErrorMessage; } /** * Determines whether this validation rule supports <code>null</code> values. This method by default returns false, * any sub-class that supports <code>null</code> values should override this method and return <code>true</code>. * * @return whether this validation rule supports <code>null</code> values. */ protected boolean supportsNullValues() { return false; } //================================================== Setters ======================================================= /** * Sets the error code of this validation rule. * * @param errorCode The error code of this validation rule. */ public void setErrorCode(String errorCode) { this.errorCode = errorCode; } /** * Sets the default error message of this validation rule. * * @param defaultErrorMessage The default error message of this validation rule. */ public void setDefaultErrorMessage(String defaultErrorMessage) { this.defaultErrorMessage = defaultErrorMessage; } /** * Sets the {@link ErrorArgumentsResolver} that will be used by this validation to extract the error arguments * based on the validated object. * * @param errorArgumentsResolver The error argument resolver that will be used by this validator. */ public void setErrorArgumentsResolver(ErrorArgumentsResolver errorArgumentsResolver) { this.errorArgumentsResolver = errorArgumentsResolver; } /** * Sets the applicability condition that along with the {@link #supportsNullValues()} method determines whether * this condition is applicable on a given object or not. * * @param applicabilityCondition The applicability condition that will be used by this validation rule when deciding * whether it is applicable on a given object. */ public void setApplicabilityCondition(Condition applicabilityCondition) { this.applicabilityCondition = applicabilityCondition; } /** * Sets the validation contexts names in which this validation rule is applicable. * * @param contextTokens The validation context names in which this validation rule is applicable. <code>null</code> * represents applicability in any context (even if one doesn't exsit). */ public void setContextTokens(String[] contextTokens) { this.contextTokens = contextTokens; } //=============================================== Helper Methods =================================================== /** * A helper method for sub-classes helping with the creation of error argument resolvers. The resolver created by * this method will return an array that contains the validated object and the given <code>arg</code> as the error * arguments. * * @param arg The error argument to be returned along with the validated object. * @return The created error arguments resolver. */ protected static ErrorArgumentsResolver createErrorArgumentsResolver(Object arg) { return createErrorArgumentsResolver(new Object[]{arg}); } /** * A helper method for sub-classes helping with the creation of error argument resolvers. The resolver created by * this method will return an array that contains the validated object and the given arguments as the error * arguments. * * @param arg1 The error argument to be returned in position {1} * @param arg2 The error argument to be returned in position {2} * @return The created error arguments resolver. */ protected static ErrorArgumentsResolver createErrorArgumentsResolver(Object arg1, Object arg2) { return createErrorArgumentsResolver(new Object[]{arg1, arg2}); } /** * A helper method for sub-classes helping with the creation of error argument resolvers. The resolver created by * this method will return an array that contains the validated object and the given arguments as the error * arguments. * * @param arg1 The error argument to be returned in position {1} * @param arg2 The error argument to be returned in position {2} * @param arg3 The error argument to be returned in position {3} * @return The created error arguments resolver. */ protected static ErrorArgumentsResolver createErrorArgumentsResolver(Object arg1, Object arg2, Object arg3) { return createErrorArgumentsResolver(new Object[]{arg1, arg2, arg3}); } /** * A helper method for sub-classes helping with the creation of error argument resolvers. The resolver created by * this method will return an array that contains the validated object and the given arguments as the error * arguments. * * @param arguments The error arguments that will be return along with the validated object, starting in position {1}. * @return The created error arguments resolver. */ protected static ErrorArgumentsResolver createErrorArgumentsResolver(final Object[] arguments) { return new ErrorArgumentsResolver() { public Object[] resolveArguments(Object obj) { Object[] result = new Object[arguments.length + 1]; System.arraycopy(arguments, 0, result, 1, arguments.length); result[0] = obj; return result; } }; } protected static boolean checkContexts(String[] contextTokens) { return ValidationContextUtils.tokensSupportedByCurrentContext(contextTokens); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- /** * Copyright (c) Codice Foundation * * This is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either * version 3 of the License, or 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 Lesser General Public License for more details. A copy of the GNU Lesser General Public License is distributed along with this program and can be found at * <http://www.gnu.org/licenses/lgpl.html>. * **/ --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>ddf.catalog.solr</groupId> <artifactId>catalog-solr</artifactId> <version>2.27.0-SNAPSHOT</version> </parent> <artifactId>catalog-solr-offline-gazetteer</artifactId> <version>2.27.0-SNAPSHOT</version> <packaging>bundle</packaging> <name>DDF :: Catalog :: Solr :: Offline Gazetteer</name> <dependencies> <dependency> <groupId>ddf.catalog.core</groupId> <artifactId>catalog-core-api</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>ddf.security.core</groupId> <artifactId>security-core-api</artifactId> </dependency> <dependency> <groupId>ddf.catalog.core</groupId> <artifactId>catalog-core-api-impl</artifactId> </dependency> <dependency> <groupId>org.codice.ddf.spatial</groupId> <artifactId>spatial-geocoding-api</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>ddf.platform.solr</groupId> <artifactId>solr-factory</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>ddf.platform.util</groupId> <artifactId>platform-util</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.solr</groupId> <artifactId>solr-solrj</artifactId> <version>${solr.version}</version> </dependency> <dependency> <groupId>org.locationtech.jts</groupId> <artifactId>jts-core</artifactId> <version>${jts.spatial4j.version}</version> </dependency> <dependency> <groupId>org.locationtech.spatial4j</groupId> <artifactId>spatial4j</artifactId> <version>0.7</version> </dependency> <dependency> <groupId>org.apache.karaf.shell</groupId> <artifactId>org.apache.karaf.shell.console</artifactId> <version>${karaf.version}</version> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> </dependency> <dependency> <groupId>net.jodah</groupId> <artifactId>failsafe</artifactId> <version>${jodah-failsafe.version}</version> </dependency> <!-- no-op slf4j impl so the tests expected exceptions don't puke to the logs --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-nop</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> <Export-Package/> <Embed-Dependency> catalog-core-api-impl, jts-core, failsafe </Embed-Dependency> <Karaf-Commands>*</Karaf-Commands> <Import-Package> !javax.activation, * </Import-Package> </instructions> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <executions> <execution> <id>check-artifact-size</id> <phase>verify</phase> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <ArtifactSizeEnforcerRule implementation="org.codice.maven.artifactsize.ArtifactSizeEnforcerRule"> <maxArtifactSize>3_MB</maxArtifactSize> </ArtifactSizeEnforcerRule> </rules> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <executions> <execution> <id>default-check</id> <goals> <goal>check</goal> </goals> <configuration> <haltOnFailure>true</haltOnFailure> <rules> <rule> <element>BUNDLE</element> <limits> <limit implementation="org.codice.jacoco.LenientLimit"> <counter>INSTRUCTION</counter> <value>COVEREDRATIO</value> <minimum>0.88</minimum> </limit> <limit implementation="org.codice.jacoco.LenientLimit"> <counter>BRANCH</counter> <value>COVEREDRATIO</value> <minimum>0.62</minimum> </limit> <limit implementation="org.codice.jacoco.LenientLimit"> <counter>COMPLEXITY</counter> <value>COVEREDRATIO</value> <minimum>0.72</minimum> </limit> </limits> </rule> </rules> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
{ "pile_set_name": "Github" }
name = "Cyclomatic Complexity"; description = "Calculate cyclomatic complexity for each methods, function, and closures."; clearphp = ""; severity = "S_MINOR"; ; from : S_NONE, S_MINOR, S_MAJOR, S_CRITICAL timetofix = "T_QUICK"; ; from : T_INSTANT, T_QUICK, T_SLOW exakatSince = "1.9.4"; ; Alternative to make this code go away. ; One by possible solution modifications[] = "" ; A PHP error that may be emitted by the target faulty code ;phpError[] = ""
{ "pile_set_name": "Github" }
-- Generated by Luapress v3.0 -- envs table added local config = { envs = { dev = { url = '/tests/envs/another_build', build_dir = 'another_build' }, default = { url = '/tests/envs/build', build_dir = 'build' } } } return config
{ "pile_set_name": "Github" }
a abban ahhoz ahogy ahol aki akik akkor alatt amely amelyek amelyekben amelyeket amelyet amelynek ami amikor amit amolyan amíg annak arra arról az azok azon azonban azt aztán azután azzal azért be belül benne bár cikk cikkek cikkeket csak de e ebben eddig egy egyes egyetlen egyik egyre egyéb egész ehhez ekkor el ellen elsõ elég elõ elõször elõtt emilyen ennek erre ez ezek ezen ezt ezzel ezért fel felé hanem hiszen hogy hogyan igen ill ill. illetve ilyen ilyenkor ismét ison itt jobban jó jól kell kellett keressünk keresztül ki kívül között közül legalább legyen lehet lehetett lenne lenni lesz lett maga magát majd majd meg mellett mely melyek mert mi mikor milyen minden mindenki mindent mindig mint mintha mit mivel miért most már más másik még míg nagy nagyobb nagyon ne nekem neki nem nincs néha néhány nélkül olyan ott pedig persze rá s saját sem semmi sok sokat sokkal szemben szerint szinte számára talán tehát teljes tovább továbbá több ugyanis utolsó után utána vagy vagyis vagyok valaki valami valamint való van vannak vele vissza viszont volna volt voltak voltam voltunk által általában át én éppen és így õ õk õket össze úgy új újabb újra
{ "pile_set_name": "Github" }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { MoreActionsMenuIcon } from 'common/icons/more-actions-menu-icon'; import { ActionButton } from 'office-ui-fabric-react'; import { DirectionalHint, IContextualMenuItem } from 'office-ui-fabric-react'; import * as React from 'react'; import { IssueDetailsTextGenerator } from '../../../background/issue-details-text-generator'; import { DetailsViewActionMessageCreator } from '../../../DetailsView/actions/details-view-action-message-creator'; import { IssueFilingDialog } from '../../../DetailsView/components/issue-filing-dialog'; import { IssueFilingService } from '../../../issue-filing/types/issue-filing-service'; import { NavigatorUtils } from '../../navigator-utils'; import { CreateIssueDetailsTextData } from '../../types/create-issue-details-text-data'; import { IssueFilingNeedsSettingsContentProps } from '../../types/issue-filing-needs-setting-content'; import { IssueFilingServiceProperties, UserConfigurationStoreData, } from '../../types/store-data/user-configuration-store'; import { IssueFilingButtonDeps } from '../issue-filing-button'; import { Toast, ToastDeps } from '../toast'; import { CardInteractionSupport } from './card-interaction-support'; import * as styles from './card-kebab-menu-button.scss'; export type CardKebabMenuButtonDeps = { issueDetailsTextGenerator: IssueDetailsTextGenerator; detailsViewActionMessageCreator: DetailsViewActionMessageCreator; navigatorUtils: NavigatorUtils; cardInteractionSupport: CardInteractionSupport; } & IssueFilingButtonDeps & ToastDeps; export interface CardKebabMenuButtonState { showNeedsSettingsContent: boolean; } export interface CardKebabMenuButtonProps { deps: CardKebabMenuButtonDeps; userConfigurationStoreData: UserConfigurationStoreData; issueDetailsData: CreateIssueDetailsTextData; kebabMenuAriaLabel?: string; } export class CardKebabMenuButton extends React.Component< CardKebabMenuButtonProps, CardKebabMenuButtonState > { private toastRef: React.RefObject<Toast>; constructor(props: CardKebabMenuButtonProps) { super(props); this.toastRef = React.createRef(); this.state = { showNeedsSettingsContent: false, }; } public render(): JSX.Element { const menuItems = this.getMenuItems(); if (menuItems.length === 0) { return null; } const handleKeyDown = (event: React.KeyboardEvent<any>) => { event.stopPropagation(); }; return ( // The wrapper has to be a real element, not a <>, because we want the placeholder elements // the dialog/toast involve to be considered as part of the button for the purposes of layout // calculation in this component's parent. <div onKeyDown={handleKeyDown}> <ActionButton className={styles.kebabMenuButton} ariaLabel={this.props.kebabMenuAriaLabel || 'More actions'} onRenderMenuIcon={MoreActionsMenuIcon} menuProps={{ className: styles.kebabMenu, directionalHint: DirectionalHint.bottomRightEdge, shouldFocusOnMount: true, items: this.getMenuItems(), calloutProps: { className: styles.kebabMenuCallout, }, }} /> {this.renderIssueFilingSettingContent()} {this.renderCopyFailureDetailsToast()} </div> ); } public renderCopyFailureDetailsToast(): JSX.Element { const { cardInteractionSupport } = this.props.deps; if (!cardInteractionSupport.supportsCopyFailureDetails) { return null; } return <Toast ref={this.toastRef} deps={this.props.deps} />; } private getMenuItems(): IContextualMenuItem[] { const { cardInteractionSupport } = this.props.deps; const items = []; if (cardInteractionSupport.supportsIssueFiling) { items.push({ key: 'fileissue', name: 'File issue', iconProps: { iconName: 'ladybugSolid', }, onClick: this.fileIssue, }); } if (cardInteractionSupport.supportsCopyFailureDetails) { items.push({ key: 'copyfailuredetails', name: `Copy failure details`, iconProps: { iconName: 'copy', }, onClick: this.copyFailureDetails, }); } return items; } private fileIssue = (event: React.MouseEvent<any>): void => { const { issueDetailsData, userConfigurationStoreData, deps } = this.props; const { issueFilingServiceProvider, issueFilingActionMessageCreator, toolData } = deps; const selectedBugFilingService = issueFilingServiceProvider.forKey( userConfigurationStoreData.bugService, ); const selectedBugFilingServiceData = selectedBugFilingService.getSettingsFromStoreData( userConfigurationStoreData.bugServicePropertiesMap, ); const isSettingValid = selectedBugFilingService.isSettingsValid( selectedBugFilingServiceData, ); if (isSettingValid) { issueFilingActionMessageCreator.fileIssue( event, userConfigurationStoreData.bugService, issueDetailsData, toolData, ); this.closeNeedsSettingsContent(); } else { this.openNeedsSettingsContent(); } }; private copyFailureDetails = async (event: React.MouseEvent<any>): Promise<void> => { const text = this.props.deps.issueDetailsTextGenerator.buildText( this.props.issueDetailsData, this.props.deps.toolData, ); this.props.deps.detailsViewActionMessageCreator.copyIssueDetailsClicked(event); try { await this.props.deps.navigatorUtils.copyToClipboard(text); } catch (error) { this.toastRef.current.show('Failed to copy failure details. Please try again.'); return; } this.toastRef.current.show('Failure details copied.'); }; public renderIssueFilingSettingContent(): JSX.Element { const { deps, userConfigurationStoreData, issueDetailsData } = this.props; const { issueFilingServiceProvider, cardInteractionSupport } = deps; if (!cardInteractionSupport.supportsIssueFiling) { return null; } const selectedIssueFilingService: IssueFilingService = issueFilingServiceProvider.forKey( userConfigurationStoreData.bugService, ); const selectedIssueFilingServiceData: IssueFilingServiceProperties = selectedIssueFilingService.getSettingsFromStoreData( userConfigurationStoreData.bugServicePropertiesMap, ); const needsSettingsContentProps: IssueFilingNeedsSettingsContentProps = { deps, isOpen: this.state.showNeedsSettingsContent, selectedIssueFilingService, selectedIssueData: issueDetailsData, selectedIssueFilingServiceData, onClose: this.closeNeedsSettingsContent, issueFilingServicePropertiesMap: userConfigurationStoreData.bugServicePropertiesMap, }; return <IssueFilingDialog {...needsSettingsContentProps} />; } private closeNeedsSettingsContent = (): void => { this.setState({ showNeedsSettingsContent: false }); }; private openNeedsSettingsContent(): void { this.setState({ showNeedsSettingsContent: true }); } }
{ "pile_set_name": "Github" }
.. --------------------------------------------------------------------------- .. Copyright 2017-2018 Intel Corporation .. .. 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. .. --------------------------------------------------------------------------- Noun Phrase Semantic Segmentation ################################### Overview ======== Noun-Phrase (NP) is a phrase which has a noun (or pronoun) as its head and zero or more dependent modifiers. Noun-Phrase is the most frequently occurring phrase type and its inner segmentation is critical for understanding the semantics of the Noun-Phrase. The most basic division of the semantic segmentation is to two classes: 1. Descriptive Structure - a structure where all dependent modifiers are not changing the semantic meaning of the Head. 2. Collocation Structure - a sequence of words or term that co-occur and change the semantic meaning of the Head. For example: - ``fresh hot dog`` - hot dog is a collocation, and changes the head (``dog``) semantic meaning. - ``fresh hot pizza`` - fresh and hot are descriptions for the pizza. Model ===== The :py:class:`NpSemanticSegClassifier <nlp_architect.models.np_semantic_segmentation.NpSemanticSegClassifier>` model is the first step in the Semantic Segmentation algorithm - the MLP classifier. The Semantic Segmentation algorithm takes the dependency relations between the Noun-Phrase words, and the MLP classifier inference as the input - and build a semantic hierarchy that represents the semantic meaning. The Semantic Segmentation algorithm eventually create a tree where each tier represent a semantic meaning -> if a sequence of words is a collocation then a collocation tier is created, else the elements are broken down and each one is mapped to different tier in the tree. This model trains MLP classifier and inference from such classifier in order to conclude the correct segmentation for the given NP. For the examples above the classifier will output 1 (==Collocation) for ``hot dog`` and output 0 (== not collocation) for ``hot pizza``. Files ===== - :py:class:`NpSemanticSegClassifier <nlp_architect.models.np_semantic_segmentation.NpSemanticSegClassifier>`: is the MLP classifier model. - **examples/np_semantic_segmentation/data.py**: Prepare string data for both ``train.py`` and ``inference.py`` using pre-trained word embedding, NLTKCollocations score, Wordnet and wikidata. - **examples/np_semantic_segmentation/feature_extraction.py**: contains the feature extraction services - **examples/np_semantic_segmentation/train.py**: train the MLP classifier. - **examples/np_semantic_segmentation/inference.py**: load the trained model and inference the input data by the model. Dataset ======= The expected dataset is a CSV file with 2 columns. the first column contains the Noun-Phrase string (a Noun-Phrase containing 2 words), and the second column contains the correct label (if the 2 word Noun-Phrase is a collocation - the label is 1, else 0) If you wish to use an existing dataset for training the model, you can download Tratz 2011 et al. dataset [1]_ [2]_ [3]_ [4]_ from the following link: `Tratz 2011 Dataset <https://vered1986.github.io/papers/Tratz2011_Dataset.tar.gz>`__. Is also available in `here <https://www.isi.edu/publications/licensed-sw/fanseparser/index.html>`__. (The terms and conditions of the data set license apply. Intel does not grant any rights to the data files or database. After downloading and unzipping the dataset, run ``preprocess_tratz2011.py`` in order to construct the labeled data and save it in a CSV file (as expected for the model). The scripts read 2 .tsv files ('tratz2011\_coarse\_grained\_random/train.tsv' and 'tratz2011\_coarse\_grained\_random/val.tsv') and outputs 2 .csv files accordingly to the same location. Quick example: :: python examples/np_semantic_segmentation/preprocess_tratz2011.py --data path_to_Tratz_2011_dataset_folder Pre-processing the data ----------------------- A feature vector is extracted from each Noun-Phrase string using the command ``python data.py`` - Word2Vec word embedding (300 size vector for each word in the Noun-Phrase) . - Pre-trained Google News Word2vec model can download `here <https://drive.google.com/file/d/0B7XkCwpI5KDYNlNUTTlSS21pQmM/edit?usp=sharing>`__ - The terms and conditions of the data set license apply. Intel does not grant any rights to the data files or database. - Cosine distance between 2 words in the Noun-Phrase. - NLTKCollocations score (PMI score (from Manning and Schutze 5.4) and Chi-square score (Manning and Schutze 5.3.3)). - A binary features whether the Noun-Phrase has existing entity in Wikidata. - A binary features whether the Noun-Phrase has existing entity in WordNet. Quick example: .. code:: python python data.py --data input_data_path.csv --output prepared_data_path.csv --w2v_path <path_to_w2v>/GoogleNews-vectors-negative300.bin Running Modalities ================== Training -------- The command ``python examples/np_semantic_segmentation/train.py`` will train the MLP classifier and evaluate it. After training is done, the model is saved automatically: Quick example: .. code:: python python examples/np_semantic_segmentation/train.py \ --data prepared_data_path.csv \ --model_path np_semantic_segmentation_path.h5 Inference --------- In order to run inference you need to have pre-trained ``<model_name>.h5`` & ``<model_name>.json`` files and data CSV file that was generated by ``prepare_data.py``. The result of ``python inference.py`` is a CSV file, each row contains the model's inference in respect to the input data. Quick example: .. code:: python python examples/np_semantic_segmentation/inference.py \ --model np_semantic_segmentation_path.h5 \ --data prepared_data_path.csv \ --output inference_data.csv \ --print_stats References ========== .. [1] Stephen Tratz and Eduard Hovy. 2011. A Fast, Accurate, Non-Projective, Semantically-Enriched Parser. In Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing. Edinburgh, Scotland, UK. .. [2] Dirk Hovy, Stephen Tratz, and Eduard Hovy. 2010. What’s in a Preposition? Dimensions of Sense Disambiguation for an Interesting Word Class. In Proceedings of COLING 2010: Poster Volume. Beijing, China. .. [3] Stephen Tratz and Dirk Hovy. 2009. Disambiguation of Preposition Sense using Linguistically Motivated Features. In Proceedings of Human Language Technologies: The 2009 Annual Conference of the North American Chapter of the Association for Computational Linguistics, Companion Volume: Student Research Workshop and Doctoral Consortium. Boulder, Colorado. .. [4] Stephen Tratz and Eduard Hovy. 2010. A Taxonomy, Dataset, and Classifier for Automatic Noun Compound Interpretation. In Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics. Uppsala, Sweden
{ "pile_set_name": "Github" }
commandlinefu_id: 4180 translator: weibo: '' hide: true command: |- some_command > >(/bin/cmd_for_stdout) 2> >(/bin/cmd_for_stderr) summary: |- Pipe stdout and stderr, etc., to separate commands
{ "pile_set_name": "Github" }
{if $mimeType === 'text/plain'} {capture assign='content'}{lang}wcf.user.register.needActivation.mail.plaintext{/lang}{/capture} {include file='email_plaintext'} {else} {capture assign='content'} <h2>{lang}wcf.user.register.needActivation.mail.html.headline{/lang}</h2> {lang}wcf.user.register.needActivation.mail.html.intro{/lang} {capture assign=button} <a href="{link controller='RegisterActivation' isHtmlEmail=true}u={@$mailbox->getUser()->userID}&a={@$mailbox->getUser()->emailConfirmed}{/link}"> {lang}wcf.user.register.needActivation.mail.html.activate{/lang} </a> {/capture} {include file='email_paddingHelper' class='button' content=$button sandbox=true} {lang}wcf.user.register.needActivation.mail.html.outro{/lang} {/capture} {include file='email_html'} {/if}
{ "pile_set_name": "Github" }
var arrayEach = require('./_arrayEach'), baseEach = require('./_baseEach'), castFunction = require('./_castFunction'), isArray = require('./isArray'); /** * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * * **Note:** As with other "Collections" methods, objects with a "length" * property are iterated like arrays. To avoid this behavior use `_.forIn` * or `_.forOwn` for object iteration. * * @static * @memberOf _ * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEachRight * @example * * _.forEach([1, 2], function(value) { * console.log(value); * }); * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, castFunction(iteratee)); } module.exports = forEach;
{ "pile_set_name": "Github" }
# TBD * Ability to send bug reports immediately. * Improve ability to attach extra files to bug report. * Now builds on Mono. * Handle invalid/corrupt report files gracefully. * Exception report sent to the developer is always in English rather than user's language. # 1.2.2 *November 16, 2013* * More elaborate fixes for serialization problems. * Fixes for memory dump issues. # 1.2.1 *November 13, 2013* * Fix for exception serialization bug. # 1.2 *November 9, 2013* * Bug fixes for Web apps. * Added more localizations. * Custom error reporting and attachments are now possible. # 1.1 *July 2, 2011* * Tons of bug fixes and stability improvements. Library is rock solid now and is in production with some great apps. * Added exception filters. # 1.0 *March 1, 2011* * Initial release of NBug.
{ "pile_set_name": "Github" }
[deb-all] packages= platform-config-x86-64-dell-s6000-s1220-r0 platform-config-x86-64-dell-s4000-c2338-r0 platform-config-x86-64-accton-as5712-54x-r0 platform-config-x86-64-accton-as5812-54x-r0 platform-config-x86-64-accton-as5812-54t-r0 platform-config-x86-64-accton-as6712-32x-r0 platform-config-x86-64-accton-as6812-32x-r0 platform-config-x86-64-accton-as7512-32x-r0 platform-config-x86-64-accton-as7712-32x-r0 platform-config-x86-64-accton-as7716-32x-r0 platform-config-x86-64-quanta-ly6-rangeley-r0 platform-config-x86-64-quanta-ly8-rangeley-r0 platform-config-x86-64-im-n29xx-t40n-r0 source=copy:__DIR__/all ./ omitdebsrc=true
{ "pile_set_name": "Github" }
# # Makefile for the linux journaling routines. # obj-$(CONFIG_JBD) += jbd.o jbd-objs := transaction.o commit.o recovery.o checkpoint.o revoke.o journal.o
{ "pile_set_name": "Github" }
/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( batchv1 "k8s.io/api/batch/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" ) // FakeJobs implements JobInterface type FakeJobs struct { Fake *FakeBatchV1 ns string } var jobsResource = schema.GroupVersionResource{Group: "batch", Version: "v1", Resource: "jobs"} var jobsKind = schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"} // Get takes name of the job, and returns the corresponding job object, and an error if there is any. func (c *FakeJobs) Get(name string, options v1.GetOptions) (result *batchv1.Job, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(jobsResource, c.ns, name), &batchv1.Job{}) if obj == nil { return nil, err } return obj.(*batchv1.Job), err } // List takes label and field selectors, and returns the list of Jobs that match those selectors. func (c *FakeJobs) List(opts v1.ListOptions) (result *batchv1.JobList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(jobsResource, jobsKind, c.ns, opts), &batchv1.JobList{}) if obj == nil { return nil, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &batchv1.JobList{ListMeta: obj.(*batchv1.JobList).ListMeta} for _, item := range obj.(*batchv1.JobList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested jobs. func (c *FakeJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(jobsResource, c.ns, opts)) } // Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any. func (c *FakeJobs) Create(job *batchv1.Job) (result *batchv1.Job, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(jobsResource, c.ns, job), &batchv1.Job{}) if obj == nil { return nil, err } return obj.(*batchv1.Job), err } // Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any. func (c *FakeJobs) Update(job *batchv1.Job) (result *batchv1.Job, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), &batchv1.Job{}) if obj == nil { return nil, err } return obj.(*batchv1.Job), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeJobs) UpdateStatus(job *batchv1.Job) (*batchv1.Job, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &batchv1.Job{}) if obj == nil { return nil, err } return obj.(*batchv1.Job), err } // Delete takes name of the job and deletes it. Returns an error if one occurs. func (c *FakeJobs) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(jobsResource, c.ns, name), &batchv1.Job{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOptions) _, err := c.Fake.Invokes(action, &batchv1.JobList{}) return err } // Patch applies the patch and returns the patched job. func (c *FakeJobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *batchv1.Job, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, pt, data, subresources...), &batchv1.Job{}) if obj == nil { return nil, err } return obj.(*batchv1.Job), err }
{ "pile_set_name": "Github" }
[general] name = 0.6mm E3D version = 4 definition = gmax15plus [metadata] author = gcreate setting_version = 16 type = variant hardware_type = nozzle [values] machine_nozzle_size = 0.6
{ "pile_set_name": "Github" }
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* * Main authors: * Guido Tack <[email protected]> * * Copyright: * Guido Tack, 2014 * * This file is part of Gecode, the generic constraint * development environment: * http://www.gecode.org * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #include "test/flatzinc.hh" namespace Test { namespace FlatZinc { namespace { /// Helper class to create and register tests class Create { public: /// Perform creation and registration Create(void) { (void) new FlatZincTest("perfect_square::2", "predicate bool_lin_ge(array [int] of int: a, array [int] of var bool: x, var int: c);\n\ predicate bool_lin_gt(array [int] of int: a, array [int] of var bool: x, var int: c);\n\ predicate bool_lin_lt(array [int] of int: a, array [int] of var bool: x, var int: c);\n\ predicate bool_lin_ne(array [int] of int: a, array [int] of var bool: x, var int: c);\n\ var 1..337561: INT____00001 :: is_defined_var :: var_is_introduced;\n\ var 1..337561: k :: output_var = INT____00001;\n\ array [1..100] of var 0..1: x;\n\ constraint int_lin_eq([-1, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1024, 1089, 1156, 1225, 1296, 1369, 1444, 1521, 1600, 1681, 1764, 1849, 1936, 2025, 2116, 2209, 2304, 2401, 2500, 2601, 2704, 2809, 2916, 3025, 3136, 3249, 3364, 3481, 3600, 3721, 3844, 3969, 4096, 4225, 4356, 4489, 4624, 4761, 4900, 5041, 5184, 5329, 5476, 5625, 5776, 5929, 6084, 6241, 6400, 6561, 6724, 6889, 7056, 7225, 7396, 7569, 7744, 7921, 8100, 8281, 8464, 8649, 8836, 9025, 9216, 9409, 9604, 9801, 10000], [INT____00001, x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24], x[25], x[26], x[27], x[28], x[29], x[30], x[31], x[32], x[33], x[34], x[35], x[36], x[37], x[38], x[39], x[40], x[41], x[42], x[43], x[44], x[45], x[46], x[47], x[48], x[49], x[50], x[51], x[52], x[53], x[54], x[55], x[56], x[57], x[58], x[59], x[60], x[61], x[62], x[63], x[64], x[65], x[66], x[67], x[68], x[69], x[70], x[71], x[72], x[73], x[74], x[75], x[76], x[77], x[78], x[79], x[80], x[81], x[82], x[83], x[84], x[85], x[86], x[87], x[88], x[89], x[90], x[91], x[92], x[93], x[94], x[95], x[96], x[97], x[98], x[99], x[100]], 0) :: defines_var(INT____00001);\n\ constraint set_in(k, {1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1024, 1089, 1156, 1225, 1296, 1369, 1444, 1521, 1600, 1681, 1764, 1849, 1936, 2025, 2116, 2209, 2304, 2401, 2500, 2601, 2704, 2809, 2916, 3025, 3136, 3249, 3364, 3481, 3600, 3721, 3844, 3969, 4096, 4225, 4356, 4489, 4624, 4761, 4900, 5041, 5184, 5329, 5476, 5625, 5776, 5929, 6084, 6241, 6400, 6561, 6724, 6889, 7056, 7225, 7396, 7569, 7744, 7921, 8100, 8281, 8464, 8649, 8836, 9025, 9216, 9409, 9604, 9801, 10000, 10201, 10404, 10609, 10816, 11025, 11236, 11449, 11664, 11881, 12100, 12321, 12544, 12769, 12996, 13225, 13456, 13689, 13924, 14161, 14400, 14641, 14884, 15129, 15376, 15625, 15876, 16129, 16384, 16641, 16900, 17161, 17424, 17689, 17956, 18225, 18496, 18769, 19044, 19321, 19600, 19881, 20164, 20449, 20736, 21025, 21316, 21609, 21904, 22201, 22500, 22801, 23104, 23409, 23716, 24025, 24336, 24649, 24964, 25281, 25600, 25921, 26244, 26569, 26896, 27225, 27556, 27889, 28224, 28561, 28900, 29241, 29584, 29929, 30276, 30625, 30976, 31329, 31684, 32041, 32400, 32761, 33124, 33489, 33856, 34225, 34596, 34969, 35344, 35721, 36100, 36481, 36864, 37249, 37636, 38025, 38416, 38809, 39204, 39601, 40000, 40401, 40804, 41209, 41616, 42025, 42436, 42849, 43264, 43681, 44100, 44521, 44944, 45369, 45796, 46225, 46656, 47089, 47524, 47961, 48400, 48841, 49284, 49729, 50176, 50625, 51076, 51529, 51984, 52441, 52900, 53361, 53824, 54289, 54756, 55225, 55696, 56169, 56644, 57121, 57600, 58081, 58564, 59049, 59536, 60025, 60516, 61009, 61504, 62001, 62500, 63001, 63504, 64009, 64516, 65025, 65536, 66049, 66564, 67081, 67600, 68121, 68644, 69169, 69696, 70225, 70756, 71289, 71824, 72361, 72900, 73441, 73984, 74529, 75076, 75625, 76176, 76729, 77284, 77841, 78400, 78961, 79524, 80089, 80656, 81225, 81796, 82369, 82944, 83521, 84100, 84681, 85264, 85849, 86436, 87025, 87616, 88209, 88804, 89401, 90000, 90601, 91204, 91809, 92416, 93025, 93636, 94249, 94864, 95481, 96100, 96721, 97344, 97969, 98596, 99225, 99856, 100489, 101124, 101761, 102400, 103041, 103684, 104329, 104976, 105625, 106276, 106929, 107584, 108241, 108900, 109561, 110224, 110889, 111556, 112225, 112896, 113569, 114244, 114921, 115600, 116281, 116964, 117649, 118336, 119025, 119716, 120409, 121104, 121801, 122500, 123201, 123904, 124609, 125316, 126025, 126736, 127449, 128164, 128881, 129600, 130321, 131044, 131769, 132496, 133225, 133956, 134689, 135424, 136161, 136900, 137641, 138384, 139129, 139876, 140625, 141376, 142129, 142884, 143641, 144400, 145161, 145924, 146689, 147456, 148225, 148996, 149769, 150544, 151321, 152100, 152881, 153664, 154449, 155236, 156025, 156816, 157609, 158404, 159201, 160000, 160801, 161604, 162409, 163216, 164025, 164836, 165649, 166464, 167281, 168100, 168921, 169744, 170569, 171396, 172225, 173056, 173889, 174724, 175561, 176400, 177241, 178084, 178929, 179776, 180625, 181476, 182329, 183184, 184041, 184900, 185761, 186624, 187489, 188356, 189225, 190096, 190969, 191844, 192721, 193600, 194481, 195364, 196249, 197136, 198025, 198916, 199809, 200704, 201601, 202500, 203401, 204304, 205209, 206116, 207025, 207936, 208849, 209764, 210681, 211600, 212521, 213444, 214369, 215296, 216225, 217156, 218089, 219024, 219961, 220900, 221841, 222784, 223729, 224676, 225625, 226576, 227529, 228484, 229441, 230400, 231361, 232324, 233289, 234256, 235225, 236196, 237169, 238144, 239121, 240100, 241081, 242064, 243049, 244036, 245025, 246016, 247009, 248004, 249001, 250000, 251001, 252004, 253009, 254016, 255025, 256036, 257049, 258064, 259081, 260100, 261121, 262144, 263169, 264196, 265225, 266256, 267289, 268324, 269361, 270400, 271441, 272484, 273529, 274576, 275625, 276676, 277729, 278784, 279841, 280900, 281961, 283024, 284089, 285156, 286225, 287296, 288369, 289444, 290521, 291600, 292681, 293764, 294849, 295936, 297025, 298116, 299209, 300304, 301401, 302500, 303601, 304704, 305809, 306916, 308025, 309136, 310249, 311364, 312481, 313600, 314721, 315844, 316969, 318096, 319225, 320356, 321489, 322624, 323761, 324900, 326041, 327184, 328329, 329476, 330625, 331776, 332929, 334084, 335241, 336400, 337561});\n\ solve maximize INT____00001;\n\ ", "k = 337561;\n\ ----------\n\ ==========\n\ "); } }; Create c; } }} // STATISTICS: test-flatzinc
{ "pile_set_name": "Github" }
//! Packet definitions and serializing use std::io::{self, Write, Read}; use delta_encode::{bitio, AlwaysVec}; use crate::command; use crate::player; use crate::notify; use crate::prelude::*; // Compat due to the move pub use delta_encode::bitio::{ write_len_bits, read_len_bits }; #[doc(hidden)] #[macro_export] macro_rules! create_ids { (prev($prev:ident), $name:ident) => ( #[allow(non_upper_case_globals)] pub const $name: usize = $prev + 1; ); (prev($prev:ident), $name:ident, $($n:ident),+) => ( #[allow(non_upper_case_globals)] pub const $name: usize = $prev + 1; create_ids!(prev($name), $($n),+); ); ($name:ident, $($n:ident),+) => ( #[allow(non_upper_case_globals)] pub const $name: usize = 0; create_ids!(prev($name), $($n),+); ); ($name:ident) => ( #[allow(non_upper_case_globals)] pub const $name: usize = 0; ); } macro_rules! define_packets { ( $( $(#[$pattr:meta])* packet $name:ident { $( $(#[$fattr:meta])* field $fname:ident : $ftype:ty, )* } )* ) => ( /// Contains every packet type #[derive(Debug, DeltaEncode)] pub enum Packet { $( $(#[$pattr])* $name($name), )* } $( $(#[$pattr])* #[derive(Debug, DeltaEncode)] pub struct $name { $( $(#[$fattr])* pub $fname : $ftype, )* } impl From<$name> for Packet { fn from(p: $name) -> Packet { Packet::$name(p) } } )* ) } define_packets! { /// A packet that must be received by the other side and /// cannot be dropped. packet Ensured { /// The id of this fragment. Used to ignore late/duplicate /// packets. field fragment_id: u16, /// The part id of this fragment field fragment_part: u16, /// The number of fragments minus 1 field fragment_max_parts: u16, /// The packet inside this packet or at least part of it. field internal_packet: Raw, } /// Ack used to tell the other side that the packet fragment /// was received packet EnsuredAck { /// The id of this fragment. Used to ignore late/duplicate /// packets. field fragment_id: u16, /// The part id of this fragment field fragment_part: u16, } /// Sent by the player to disconnect from the server. /// /// Due to udp there is a chance the server will never get this packet Disconnect {} /// Begins a local connection. Only works when in /// loopback mode packet LocalConnectionStart { /// The username of the client field name: String, /// The steam id of the connecting client #[cfg(feature = "steam")] field steam_id: u64, } /// Begins a remote connection packet RemoteConnectionStart { /// The username of the client field name: String, /// The steam id of the connecting client #[cfg(feature = "steam")] field steam_id: u64, /// The steam auth ticket to verify #[cfg(feature = "steam")] field ticket: Raw, } /// Sent by the server after one of the previous connection /// packets to begin the game. /// /// This sets some of the initial state of the game namely /// level size. The actual contents of the level will be sent /// after this due to its size. packet ServerConnectionStart { /// The unique id for the player field uid: i16, } /// Sent by the server if the player was blocked from connecting /// for some reason. packet ServerConnectionFail { /// The reason the connection failed, field reason: String, } /// Sent by the client when it has entered the /// lobby packet EnterLobby {} /// Sent to update clients to changes in the lobby packet UpdateLobby { /// The unique id for this change. Higher is newer field change_id: u32, /// List of players currently in the lobby field players: AlwaysVec<LobbyEntry>, /// Whether the game can be started field can_start: bool, } /// Sent by the client to request the game to begin /// when in the lobby. packet RequestGameBegin {} /// Sent by the server to make clients either exit /// the lobby or instantly join a game already in /// progress. packet GameBegin { /// The unique id for the player. /// Used if rejoining a started game field uid: i16, /// The width of the level field width: u32, /// The height of the level field height: u32, /// List of players in the game. /// At this point this cannot change field players: AlwaysVec<PlayerEntry>, /// The mission handler for the current game if any field mission_handler: Option<ResourceKey<'static>>, /// Strings used in the data field strings: AlwaysVec<String>, /// The serialized state of idle tasks field idle_state: AlwaysVec<IdleState>, /// The serialized state of the level field state: Raw, } /// Sent to keep the connection open packet KeepAlive {} /// Sets the pause state of the server. /// Only works in loopback mode. packet SetPauseGame { /// Whether the game is paused or not. field paused: bool, } /// Requests for the save to save the current game /// Only works in loopback mode packet SaveGame {} // Level packets /// Sent by the client when it has loaded the level packet LevelLoaded {} /// Sent by the server to let the client start playing packet GameStart {} // Command packets /// List of commands executed by the client packet ExecutedCommands { /// The first id of the command in the queue. field start_id: u32, /// The list of commands sent by the client field commands: AlwaysVec<command::Command>, } /// Sent by the server to accept that it received /// the commands up to the `accepted_id` and validated them. packet AckCommands { /// The id of the last command accepted field accepted_id: u32, } /// Sent by the server when one of the commands fails to validate packet RejectCommands { /// The id of the last command accepted field accepted_id: u32, /// The id of the first rejected command. /// All after this are ignored field rejected_id: u32, } /// List of commands executed by different client packet RemoteExecutedCommands { /// The first id of the command in the queue. field start_id: u32, /// The list of commands sent by the client field commands: Raw, } /// Sent by the server to accept that it received /// the commands up to the `accepted_id` and validated them. packet AckRemoteCommands { /// The id of the last command accepted field accepted_id: u32, } // Entity packets /// Contains a delta frame of entity state packet EntityFrame { /// Raw entity delta state field data: Raw, } /// Ack's a range of entities as having their /// state packet EntityAckFrame { /// The frame that is being ack'd #[delta_bits = "14"] field frame: u16, /// The first entity id being ack'd #[delta_bits = "20"] field entity_offset: u32, /// The number of entities being acked #[delta_bits = "14"] field entity_count: u16, } /// Ack's the player state from the server packet PlayerAckFrame { /// The frame that is being ack'd field frame: u16, } /// A collection of notifications sent by the server packet Notification { /// The notifications field notifications: AlwaysVec<notify::Notification>, } /// A message from the server packet Message { /// The formatted message from the server field messages: AlwaysVec<crate::msg::Message>, } /// A message to the server packet ChatMessage { /// The unformatted message from the client field message: String, } /// Updates the collected stats for the player packet UpdateStats { /// The update id. /// /// Used to ignore old/duplicate updates field update_id: u32, /// The last 28 minutes of the player's /// stat history. field history: AlwaysVec<HistoryEntry>, } /// Generic request container packet Request { /// The type of request field ty: [u8; 4], /// The request id field id: u32, /// The request data field data: Raw, } /// Generic reply container packet Reply { /// The type of request field ty: [u8; 4], /// The request id field id: u32, /// The reply data field data: Raw, } } /// Serialized state for an idle task #[derive(Debug, Clone, DeltaEncode)] pub struct IdleState { /// The player who this task is for pub player: PlayerId, /// The task id pub idx: u32, /// The serialized state pub state: Raw, } /// An entry containing one step of a player's history #[derive(Debug, Clone, DeltaEncode, Default, Serialize, Deserialize)] pub struct HistoryEntry { /// Total money (income/outcome) pub total: UniDollar, /// Current income pub income: UniDollar, /// Current outcome pub outcome: UniDollar, /// Current number of students pub students: u32, /// Current grade stats #[serde(default)] pub grades: [u32; 6], } /// Consumes the remainder of the packet if read. /// /// Writing sends the byte array without a prefix. #[derive(Debug, Clone)] pub struct Raw(pub Vec<u8>); impl delta_encode::DeltaEncodable for Raw { #[inline] fn encode<W>(&self, _base: Option<&Self>, w: &mut bitio::Writer<W>) -> io::Result<()> where W: Write { for b in &self.0 { w.write_unsigned(u64::from(*b), 8)?; } Ok(()) } #[inline] fn decode<R>(_base: Option<&Self>, r: &mut bitio::Reader<R>) -> io::Result<Self> where R: Read { let mut data = Vec::with_capacity(256); loop { let val = match r.read_unsigned(8) { Ok(val) => val as u8, Err(err) => if err.kind() == io::ErrorKind::UnexpectedEof { break } else { return Err(err); }, }; data.push(val); } Ok(Raw(data)) } } /// A player id/command pair that can be serialized in a packet #[derive(Debug, Clone, DeltaEncode)] #[delta_always] pub struct CommandPair { /// The id of the player executing the command #[delta_always] pub player_id: player::Id, /// The command to execute #[delta_always] pub command: command::Command, } /// A player in a lobby #[derive(Debug, Clone, DeltaEncode, PartialEq)] pub struct LobbyEntry { /// The player's steam id #[cfg(feature = "steam")] pub steam_id: u64, /// The player's uid pub uid: player::Id, /// Whether the player has finished connecting pub ready: bool, } /// A player in a lobby #[derive(Debug, Clone, DeltaEncode, PartialEq)] pub struct PlayerEntry { /// The player's username pub username: String, /// The player's uid pub uid: player::Id, /// The player's current state pub state: player::State, }
{ "pile_set_name": "Github" }
# this is the strings sample # copied from dingding 19100302 classmates group (thanks for coach and campmates) #text = ''' #愚公移山 #太行,王屋二山的北面,住了一個九十歲的老翁,名叫愚公。二山佔地廣闊,擋住去路,使他和家人往來極為不便。 #一天,愚公召集家人說:「讓我們各盡其力,剷平二山,開條道路,直通豫州,你們認為怎樣?」 #大家都異口同聲贊成,只有他的妻子表示懷疑,並說:「你連開鑿一個小丘的力量都沒有,怎可能剷平太行、王屋二山呢?況且,鑿出的土石又丟到哪裏去呢?」 #大家都熱烈地說:「把土石丟進渤海裏。」 #於是愚公就和兒孫,一起開挖土,把土石搬運到渤海去。 #愚公的鄰居是個寡婦,有個兒子八歲也興致勃勃地走來幫忙。 #寒來暑往,他們要一年才能往返渤海一次。 #住在黃河河畔的智叟,看見他們這樣辛苦,取笑愚公說:「你不是很愚蠢嗎?你已一把年紀了,就是用盡你的氣力,也不能挖去山的一角呢?」 #愚公歎息道:「你有這樣的成見,是不會明白的。你比那寡婦的小兒子還不如呢!就算我死了,還有我的兒子,我的孫子,我的曾孫子,他們一直傳下去。而這二山是不會加大的,總有一天,我們會把它們剷平。」 #智叟聽了,無話可說: #二山的守護神被愚公的堅毅精神嚇倒,便把此事奏知天帝。天帝佩服愚公的精神,就命兩位大力神揹走二山。 #How The Foolish Old Man Moved Mountains #Yugong was a ninety-year-old man who lived at the north of two high mountains, Mount Taixing and Mount Wangwu. #Stretching over a wide expanse of land, the mountains blocked yugong’s way making it inconvenient for him and his family to get around. #One day yugong gathered his family together and said,”Let’s do our best to level these two mountains. We shall open a road that leads to Yuzhou. What do you think?” #All but his wife agreed with him. #“You don’t have the strength to cut even a small mound,” muttered his wife. “How on earth do you suppose you can level Mount Taixin and Mount Wanwu? Moreover, where will all the earth and rubble go?” #“Dump them into the Sea of Bohai!” said everyone. #So Yugong, his sons, and his grandsons started to break up rocks and remove the earth. They transported the earth and rubble to the Sea of Bohai. #Now Yugong’s neighbour was a widow who had an only child eight years old. Evening the young boy offered his help eagerly. #Summer went by and winter came. It took Yugong and his crew a full year to travel back and forth once. #On the bank of the Yellow River dwelled an old man much respected for his wisdom. When he saw their back-breaking labour, he ridiculed Yugong saying,”Aren’t you foolish, my friend? You are very old now, and with whatever remains of your waning strength, you won’t be able to remove even a corner of the mountain.” #Yugong uttered a sigh and said,”A biased person like you will never understand. You can’t even compare with the widow’s little boy!” #“Even if I were dead, there will still be my children, my grandchildren, my great grandchildren, my great great grandchildren. They descendants will go on forever. But these mountains will not grow any taler. We shall level them one day!” he declared with confidence. #The wise old man was totally silenced. #When the guardian gods of the mountains saw how determined Yugong and his crew were, they were struck with fear and reported the incident to the Emperor of Heavens. #Filled with admiration for Yugong, the Emperor of Heavens ordered two mighty gods to carry the mountains away. #''' #text = [1,3,4,6,6] #using a list to check the exception handling. worked... #from mymodule import stats_word # whole text words frequence stats (en + cn) #try: # print('Day7全文词频统计结果: ', stats_word.stats_text(text)) #except ValueError: # print('Inappropriate argument value (of correct type)') import os import json from mymodule import stats_word # @wangrui thoughts copied and revised a little # with open("tang300.json","r+") as f: my thoughts not working with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'tang300.json')) as f: #''' day9 1. 导入json文件并读取文件内容''' '''Day10 top20词频统计:''' read_file = f.read() #if used f= open() ,then f.closed required, with here thus no f.closed try: ''' 1. 捕获传入非字符串参数异常。 2. day9调用stats_word.py中的stats_text_cn(),传入读取文件结果和输出限制参数。 3. day10使用jieba精准分词后统计。 ''' print('Day10 top100词频统计结果: ', stats_word.stats_text_cn(read_file,20)) except ValueError: print('Inappropriate argument value (of correct type)')
{ "pile_set_name": "Github" }
Drupal.behaviors.comment = function (context) { var parts = new Array("name", "homepage", "mail"); var cookie = ''; for (i=0;i<3;i++) { cookie = Drupal.comment.getCookie('comment_info_' + parts[i]); if (cookie != '') { $("#comment-form input[name=" + parts[i] + "]:not(.comment-processed)", context) .val(cookie) .addClass('comment-processed'); } } }; Drupal.comment = {}; Drupal.comment.getCookie = function(name) { var search = name + '='; var returnValue = ''; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; var end = document.cookie.indexOf(';', offset); if (end == -1) { end = document.cookie.length; } returnValue = decodeURIComponent(document.cookie.substring(offset, end).replace(/\+/g, '%20')); } } return returnValue; };
{ "pile_set_name": "Github" }
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:2.0.50727.1433 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace TvMCheck.Properties { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TvMCheck.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 46634ac69176c504294d6187d01ffcba timeCreated: 1465567247 licenseType: Pro NativeFormatImporter: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
module TemplateHelper def render_or_default(partial, default = partial) render :partial => partial rescue ActionView::MissingTemplate begin render :partial => "layouts/#{default}" rescue ActionView::MissingTemplate nil end end end
{ "pile_set_name": "Github" }
# This tests that the HTTP analyzer handles HTTP CONNECT proxying correctly # when the server include a header line into its response. # # @TEST-EXEC: zeek -b -C -r $TRACES/http/connect-with-header.trace %INPUT # @TEST-EXEC: btest-diff conn.log # @TEST-EXEC: btest-diff http.log # @TEST-EXEC: btest-diff tunnel.log @load base/protocols/conn @load base/protocols/http @load base/protocols/ssl @load base/protocols/tunnels @load base/frameworks/dpd
{ "pile_set_name": "Github" }
Shader "Hidden/ChromaticAberration" { Properties { _MainTex ("Base", 2D) = "" {} } CGINCLUDE #include "UnityCG.cginc" struct v2f { float4 pos : POSITION; float2 uv : TEXCOORD0; }; sampler2D _MainTex; float4 _MainTex_TexelSize; half _ChromaticAberration; half _AxialAberration; half _Luminance; half2 _BlurDistance; v2f vert( appdata_img v ) { v2f o; o.pos = mul(UNITY_MATRIX_MVP, v.vertex); o.uv = v.texcoord.xy; return o; } half4 fragDs(v2f i) : COLOR { half4 c = tex2D (_MainTex, i.uv.xy + _MainTex_TexelSize.xy * 0.5); c += tex2D (_MainTex, i.uv.xy - _MainTex_TexelSize.xy * 0.5); c += tex2D (_MainTex, i.uv.xy + _MainTex_TexelSize.xy * float2(0.5,-0.5)); c += tex2D (_MainTex, i.uv.xy - _MainTex_TexelSize.xy * float2(0.5,-0.5)); return c/4.0; } half4 frag(v2f i) : COLOR { half2 coords = i.uv; half2 uv = i.uv; coords = (coords - 0.5) * 2.0; half coordDot = dot (coords,coords); half2 uvG = uv - _MainTex_TexelSize.xy * _ChromaticAberration * coords * coordDot; half4 color = tex2D (_MainTex, uv); #if SHADER_API_D3D9 // Work around Cg's code generation bug for D3D9 pixel shaders :( color.g = color.g * 0.0001 + tex2D (_MainTex, uvG).g; #else color.g = tex2D (_MainTex, uvG).g; #endif return color; } // squeezing into SM2.0 with 9 samples: static const int SmallDiscKernelSamples = 9; static const half2 SmallDiscKernel[SmallDiscKernelSamples] = { half2(-0.926212,-0.40581), half2(-0.695914,0.457137), half2(-0.203345,0.820716), half2(0.96234,-0.194983), half2(0.473434,-0.480026), half2(0.519456,0.767022), half2(0.185461,-0.893124), half2(0.89642,0.412458), half2(-0.32194,-0.932615), }; half4 fragComplex(v2f i) : COLOR { half2 coords = i.uv; half2 uv = i.uv; // corner heuristic coords = (coords - 0.5h) * 2.0h; half coordDot = dot (coords,coords); half4 color = tex2D (_MainTex, uv); half tangentialStrength = _ChromaticAberration * coordDot * coordDot; half maxOfs = clamp(max(_AxialAberration, tangentialStrength), _BlurDistance.x, _BlurDistance.y); // we need a blurred sample tap for advanced aberration // NOTE: it's relatively important that input is HDR // and if you do have a proper HDR setup, lerping .rb might yield better results than .g // (see below) half4 blurredTap = color * 0.1h; for(int l=0; l < SmallDiscKernelSamples; l++) { half2 sampleUV = uv + SmallDiscKernel[l].xy * _MainTex_TexelSize.xy * maxOfs; half3 tap = tex2D(_MainTex, sampleUV).rgb; blurredTap.rgb += tap; } blurredTap.rgb /= (float)SmallDiscKernelSamples + 0.2h; // debug: //return blurredTap; half lumDiff = Luminance(abs(blurredTap.rgb-color.rgb)); half isEdge = saturate(_Luminance * lumDiff); // debug #2: //return isEdge; color.rb = lerp(color.rb, blurredTap.rb, isEdge); return color; } ENDCG Subshader { // 0: box downsample Pass { ZTest Always Cull Off ZWrite Off Fog { Mode off } CGPROGRAM #pragma vertex vert #pragma fragment fragDs ENDCG } // 1: simple chrom aberration Pass { ZTest Always Cull Off ZWrite Off Fog { Mode off } CGPROGRAM #pragma vertex vert #pragma fragment frag ENDCG } // 2: simulates more chromatic aberration effects Pass { ZTest Always Cull Off ZWrite Off Fog { Mode off } CGPROGRAM #pragma exclude_renderers flash #pragma vertex vert #pragma fragment fragComplex ENDCG } } Fallback off } // shader
{ "pile_set_name": "Github" }
/** * OWASP Enterprise Security API (ESAPI) * * This file is part of the Open Web Application Security Project (OWASP) * Enterprise Security API (ESAPI) project. For details, please see * <a href="http://www.owasp.org/index.php/ESAPI">http://www.owasp.org/index.php/ESAPI</a>. * * Copyright (c) 2007 - The OWASP Foundation * * The ESAPI is published by OWASP under the BSD license. You should read and accept the * LICENSE before you use, modify, and/or redistribute this software. * * @author Jeff Williams <a href="http://www.aspectsecurity.com">Aspect Security</a> * @created 2007 */ package org.owasp.esapi.reference.validation; import java.io.IOException; import java.io.InputStream; import java.util.List; import org.owasp.esapi.errors.ConfigurationException; import org.owasp.esapi.ESAPI; import org.owasp.esapi.Encoder; import org.owasp.esapi.Logger; import org.owasp.esapi.StringUtilities; import org.owasp.esapi.errors.ValidationException; import org.owasp.validator.html.AntiSamy; import org.owasp.validator.html.CleanResults; import org.owasp.validator.html.Policy; import org.owasp.validator.html.PolicyException; import org.owasp.validator.html.ScanException; import org.owasp.esapi.reference.DefaultSecurityConfiguration; /** * A validator performs syntax and possibly semantic validation of a single * piece of data from an untrusted source. * * @author Jeff Williams (jeff.williams .at. aspectsecurity.com) <a * href="http://www.aspectsecurity.com">Aspect Security</a> * @since June 1, 2007 * @see org.owasp.esapi.Validator */ public class HTMLValidationRule extends StringValidationRule { /** OWASP AntiSamy markup verification policy */ private static Policy antiSamyPolicy = null; private static final Logger LOGGER = ESAPI.getLogger( "HTMLValidationRule" ); private static final String ANTISAMYPOLICY_FILENAME = "antisamy-esapi.xml"; /** * Used to load antisamy-esapi.xml from a variety of different classpath locations. * The classpath locations are the same classpath locations as used to load esapi.properties. * See DefaultSecurityConfiguration.DefaultSearchPath. * * @param fileName The resource file filename. */ private static InputStream getResourceStreamFromClasspath(String fileName) { InputStream resourceStream = null; ClassLoader[] loaders = new ClassLoader[] { Thread.currentThread().getContextClassLoader(), ClassLoader.getSystemClassLoader(), ESAPI.securityConfiguration().getClass().getClassLoader() /* can't use just getClass.getClassLoader() in a static context, so using the DefaultSecurityConfiguration class. */ }; String[] classLoaderNames = { "current thread context class loader", "system class loader", "class loader for DefaultSecurityConfiguration class" }; int i = 0; for (ClassLoader loader : loaders) { // try root String currentClasspathSearchLocation = "/ (root)"; resourceStream = loader.getResourceAsStream(DefaultSecurityConfiguration.DefaultSearchPath.ROOT.value() + fileName); // try resourceDirectory folder if (resourceStream == null){ currentClasspathSearchLocation = DefaultSecurityConfiguration.DefaultSearchPath.RESOURCE_DIRECTORY.value(); resourceStream = loader.getResourceAsStream(currentClasspathSearchLocation + fileName); } // try .esapi folder. Look here first for backward compatibility. if (resourceStream == null){ currentClasspathSearchLocation = DefaultSecurityConfiguration.DefaultSearchPath.DOT_ESAPI.value(); resourceStream = loader.getResourceAsStream(currentClasspathSearchLocation + fileName); } // try esapi folder (new directory) if (resourceStream == null){ currentClasspathSearchLocation = DefaultSecurityConfiguration.DefaultSearchPath.ESAPI.value(); resourceStream = loader.getResourceAsStream(currentClasspathSearchLocation + fileName); } // try resources folder if (resourceStream == null){ currentClasspathSearchLocation = DefaultSecurityConfiguration.DefaultSearchPath.RESOURCES.value(); resourceStream = loader.getResourceAsStream(currentClasspathSearchLocation + fileName); } // try src/main/resources folder if (resourceStream == null){ currentClasspathSearchLocation = DefaultSecurityConfiguration.DefaultSearchPath.SRC_MAIN_RESOURCES.value(); resourceStream = loader.getResourceAsStream(currentClasspathSearchLocation + fileName); } if (resourceStream != null) { LOGGER.info(Logger.EVENT_FAILURE, "SUCCESSFULLY LOADED " + fileName + " via the CLASSPATH from '" + currentClasspathSearchLocation + "' using " + classLoaderNames[i] + "!"); break; // Outta here since we've found and loaded it. } i++; } return resourceStream; } static { InputStream resourceStream = null; String antisamyPolicyFilename = null; try { antisamyPolicyFilename = ESAPI.securityConfiguration().getStringProp( // Future: This will be moved to a new PropNames class org.owasp.esapi.reference.DefaultSecurityConfiguration.VALIDATOR_HTML_VALIDATION_CONFIGURATION_FILE ); } catch (ConfigurationException cex) { LOGGER.info(Logger.EVENT_FAILURE, "ESAPI property " + org.owasp.esapi.reference.DefaultSecurityConfiguration.VALIDATOR_HTML_VALIDATION_CONFIGURATION_FILE + " not set, using default value: " + ANTISAMYPOLICY_FILENAME); antisamyPolicyFilename = ANTISAMYPOLICY_FILENAME; } try { resourceStream = ESAPI.securityConfiguration().getResourceStream(antisamyPolicyFilename); } catch (IOException e) { LOGGER.info(Logger.EVENT_FAILURE, "Loading " + antisamyPolicyFilename + " from classpaths"); resourceStream = getResourceStreamFromClasspath(antisamyPolicyFilename); } if (resourceStream != null) { try { antiSamyPolicy = Policy.getInstance(resourceStream); } catch (PolicyException e) { throw new ConfigurationException("Couldn't parse " + antisamyPolicyFilename, e); } } else { throw new ConfigurationException("Couldn't find " + antisamyPolicyFilename); } } public HTMLValidationRule( String typeName ) { super( typeName ); } public HTMLValidationRule( String typeName, Encoder encoder ) { super( typeName, encoder ); } public HTMLValidationRule( String typeName, Encoder encoder, String whitelistPattern ) { super( typeName, encoder, whitelistPattern ); } /** * {@inheritDoc} */ @Override public String getValid( String context, String input ) throws ValidationException { return invokeAntiSamy( context, input ); } /** * {@inheritDoc} */ @Override public String sanitize( String context, String input ) { String safe = ""; try { safe = invokeAntiSamy( context, input ); } catch( ValidationException e ) { // just return safe } return safe; } /** * Check whether we want the legacy behavior ("clean") or the presumably intended * behavior of "throw" for how to treat unsafe HTML input when AntiSamy is invoked. * This admittedly is an UGLY hack to ensure that issue 509 and its corresponding * fix in PR #510 does not break existing developer's existing code. Full * details are described in GitHub issue 521. * * Checks new ESAPI property "Validator.HtmlValidationAction". A value of "clean" * means to revert to legacy behavior. A value of "throw" means to use the new * behavior as implemented in GitHub issue 509. * * @return false - If "Validator.HtmlValidationAction" is set to "throw". Otherwise {@code true}. * @since 2.2.1.0 */ private boolean legacyHtmlValidation() { boolean legacy = true; // Make legacy support the default behavior for backward compatibility. String propValue = "clean"; // For legacy support. try { // DISCUSS: // Hindsight: maybe we should have getBooleanProp(), getStringProp(), // getIntProp() methods that take a default arg as well? // At least for ESAPI 3.x. propValue = ESAPI.securityConfiguration().getStringProp( // Future: This will be moved to a new PropNames class org.owasp.esapi.reference.DefaultSecurityConfiguration.VALIDATOR_HTML_VALIDATION_ACTION ); switch ( propValue.toLowerCase() ) { case "throw": legacy = false; // New, presumably correct behavior, as addressed by GitHub issue 509 break; case "clean": legacy = true; // Give the caller that legacy behavior of sanitizing. break; default: LOGGER.warning(Logger.EVENT_FAILURE, "ESAPI property " + org.owasp.esapi.reference.DefaultSecurityConfiguration.VALIDATOR_HTML_VALIDATION_ACTION + " was set to \"" + propValue + "\". Must be set to either \"clean\"" + " (the default for legacy support) or \"throw\"; assuming \"clean\" for legacy behavior."); legacy = true; break; } } catch( ConfigurationException cex ) { // OPEN ISSUE: Should we log this? I think so. Convince me otherwise. But maybe // we should only log it once or every Nth time?? LOGGER.warning(Logger.EVENT_FAILURE, "ESAPI property " + org.owasp.esapi.reference.DefaultSecurityConfiguration.VALIDATOR_HTML_VALIDATION_ACTION + " must be set to either \"clean\" (the default for legacy support) or \"throw\"; assuming \"clean\"", cex); } return legacy; } private String invokeAntiSamy( String context, String input ) throws ValidationException { // CHECKME should this allow empty Strings? " " use IsBlank instead? if ( StringUtilities.isEmpty(input) ) { if (allowNull) { return null; } throw new ValidationException( context + " is required", "AntiSamy validation error: context=" + context + ", input=" + input, context ); } String canonical = super.getValid( context, input ); try { AntiSamy as = new AntiSamy(); CleanResults test = as.scan(canonical, antiSamyPolicy); List<String> errors = test.getErrorMessages(); if ( !errors.isEmpty() ) { if ( legacyHtmlValidation() ) { // See GitHub issues 509 and 521 LOGGER.info(Logger.SECURITY_FAILURE, "Cleaned up invalid HTML input: " + errors ); } else { throw new ValidationException( context + ": Invalid HTML input", "Invalid HTML input does not follow rules in antisamy-esapi.xml: context=" + context + " errors=" + errors.toString()); } } return test.getCleanHTML().trim(); } catch (ScanException e) { throw new ValidationException( context + ": Invalid HTML input", "Invalid HTML input: context=" + context + " error=" + e.getMessage(), e, context ); } catch (PolicyException e) { throw new ValidationException( context + ": Invalid HTML input", "Invalid HTML input does not follow rules in antisamy-esapi.xml: context=" + context + " error=" + e.getMessage(), e, context ); } } }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2009-2020 Lightbend Inc. <https://www.lightbend.com> */ package akka.actor.testkit.typed.javadsl import java.time.Duration import com.typesafe.config.Config import com.typesafe.config.ConfigFactory import org.junit.Rule import org.junit.rules.ExternalResource import akka.actor.DeadLetter import akka.actor.Dropped import akka.actor.UnhandledMessage import akka.actor.testkit.typed.TestKitSettings import akka.actor.testkit.typed.internal.TestKitUtils import akka.actor.typed.ActorRef import akka.actor.typed.ActorSystem import akka.actor.typed.Behavior import akka.actor.typed.Props import akka.actor.typed.Scheduler import akka.util.Timeout /** * A Junit external resource for the [[ActorTestKit]], making it possible to have Junit manage the lifecycle of the testkit. * The testkit will be automatically shut down when the test completes or fails. * * Note that Junit is not provided as a transitive dependency of the testkit module but must be added explicitly * to your project to use this. * * Example: * {{{ * public class MyActorTest { * @ClassRule * public static final TestKitResource testKit = new TestKitResource(); * * @Test * public void testBlah() throws Exception { * // spawn actors etc using the testKit * ActorRef<Message> ref = testKit.spawn(behavior); * } * } * }}} * * By default config is loaded from `application-test.conf` if that exists, otherwise * using default configuration from the reference.conf resources that ship with the Akka libraries. * The application.conf of your project is not used in this case. * A specific configuration can be passed as constructor parameter. */ final class TestKitJunitResource(_kit: ActorTestKit) extends ExternalResource { /** * Config loaded from `application-test.conf` if that exists, otherwise * using default configuration from the reference.conf resources that ship with the Akka libraries. * The application.conf of your project is not used in this case. */ def this() = this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJunitResource]))) /** * Use a custom [[akka.actor.typed.ActorSystem]] for the actor system. */ def this(system: ActorSystem[_]) = this(ActorTestKit.create(system)) /** * Use a custom config for the actor system. */ def this(customConfig: String) = this( ActorTestKit.create( TestKitUtils.testNameFromCallStack(classOf[TestKitJunitResource]), ConfigFactory.parseString(customConfig))) /** * Use a custom config for the actor system. */ def this(customConfig: Config) = this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJunitResource]), customConfig)) /** * Use a custom config for the actor system, and a custom [[akka.actor.testkit.typed.TestKitSettings]]. */ def this(customConfig: Config, settings: TestKitSettings) = this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJunitResource]), customConfig, settings)) @Rule val testKit: ActorTestKit = _kit // delegates of the TestKit api for minimum fuss /** * See corresponding method on [[ActorTestKit]] */ def system: ActorSystem[Void] = testKit.system /** * See corresponding method on [[ActorTestKit]] */ def testKitSettings: TestKitSettings = testKit.testKitSettings /** * See corresponding method on [[ActorTestKit]] */ def timeout: Timeout = testKit.timeout /** * See corresponding method on [[ActorTestKit]] */ def scheduler: Scheduler = testKit.scheduler /** * See corresponding method on [[ActorTestKit]] */ def spawn[T](behavior: Behavior[T]): ActorRef[T] = testKit.spawn(behavior) /** * See corresponding method on [[ActorTestKit]] */ def spawn[T](behavior: Behavior[T], name: String): ActorRef[T] = testKit.spawn(behavior, name) /** * See corresponding method on [[ActorTestKit]] */ def spawn[T](behavior: Behavior[T], props: Props): ActorRef[T] = testKit.spawn(behavior, props) /** * See corresponding method on [[ActorTestKit]] */ def spawn[T](behavior: Behavior[T], name: String, props: Props): ActorRef[T] = testKit.spawn(behavior, name, props) /** * See corresponding method on [[ActorTestKit]] */ def createTestProbe[M](): TestProbe[M] = testKit.createTestProbe[M]() /** * See corresponding method on [[ActorTestKit]] */ def createTestProbe[M](clazz: Class[M]): TestProbe[M] = testKit.createTestProbe(clazz) /** * See corresponding method on [[ActorTestKit]] */ def createTestProbe[M](name: String, clazz: Class[M]): TestProbe[M] = testKit.createTestProbe(name, clazz) /** * See corresponding method on [[ActorTestKit]] */ def createTestProbe[M](name: String): TestProbe[M] = testKit.createTestProbe(name) /** * See corresponding method on [[ActorTestKit]] */ def stop[T](ref: ActorRef[T], max: Duration): Unit = testKit.stop(ref, max) /** * See corresponding method on [[ActorTestKit]] */ def createUnhandledMessageProbe(): TestProbe[UnhandledMessage] = testKit.createUnhandledMessageProbe() /** * See corresponding method on [[ActorTestKit]] */ def createDeadLetterProbe(): TestProbe[DeadLetter] = testKit.createDeadLetterProbe() /** * See corresponding method on [[ActorTestKit]] */ def createDroppedMessageProbe(): TestProbe[Dropped] = testKit.createDroppedMessageProbe() /** * See corresponding method on [[ActorTestKit]] */ def stop[T](ref: ActorRef[T]): Unit = testKit.stop(ref) /** * Additional testing utilities for serialization. */ def serializationTestKit: SerializationTestKit = testKit.serializationTestKit override def after(): Unit = { testKit.shutdownTestKit() } }
{ "pile_set_name": "Github" }
// // ZSThirdLogin.h // ZSThirdPartSDK // // Created by caony on 2019/6/22. // Copyright © 2019 cj. All rights reserved. // #import <Foundation/Foundation.h> typedef void(^ZSLoginSuccess)(void); typedef void(^ZSThirdLoginResultHandler)(BOOL); @interface ZSThirdLogin : NSObject @property (nonatomic, copy) ZSLoginSuccess successHandler; @property (nonatomic, copy) ZSThirdLoginResultHandler loginResultHandler; + (instancetype)shared; - (void)loginWithType:(NSInteger)type; - (void)logout; - (NSString *)token; // 调起各种三方认证 - (void)QQAuth; - (void)WXAuth; - (void)WBAuth; @end FOUNDATION_EXTERN NSString * _Nullable const QQAppID; FOUNDATION_EXTERN NSString * _Nullable const WXAppID; FOUNDATION_EXTERN NSString * _Nullable const WXAppSecret; FOUNDATION_EXTERN NSString * _Nullable const WBAppID; FOUNDATION_EXTERN NSString * _Nullable const WBAppSecret; FOUNDATION_EXTERN NSString * _Nullable const WBRedirectURI;
{ "pile_set_name": "Github" }
/**************************************************************************** * * Copyright 2017 Samsung Electronics 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. * ****************************************************************************/ /**************************************************************************** * board/artik05x/src/artik05x_tash.c * * Copyright (C) 2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <[email protected]> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX 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. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ #include <tinyara/config.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <syslog.h> #include <errno.h> #include <sys/mount.h> #include <sys/types.h> #include <sys/stat.h> #include <tinyara/board.h> #include <tinyara/fs/mtd.h> #include <tinyara/fs/ioctl.h> #include <tinyara/fs/mksmartfs.h> #include <tinyara/rtc.h> #include <tinyara/analog/adc.h> #include <tinyara/configdata.h> #include <chip.h> #include "s5j_adc.h" #include "s5j_rtc.h" #include "s5j_mct.h" #include "up_internal.h" #include <apps/shell/tash.h> #include "artik05x.h" #include "common.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ #ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS #define ARTIK05X_AUTOMOUNT_USERFS_DEVNAME CONFIG_ARTIK05X_AUTOMOUNT_USERFS_DEVNAME"d1" #else #define ARTIK05X_AUTOMOUNT_USERFS_DEVNAME CONFIG_ARTIK05X_AUTOMOUNT_USERFS_DEVNAME #endif /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** * Name: artik05x_adc_setup * * Description: * Initialize ADC and register the ADC driver. * ****************************************************************************/ int artik05x_adc_setup(void) { #ifdef CONFIG_S5J_ADC int ret; struct adc_dev_s *adc; uint8_t chanlist[] = { adc_channel_0, adc_channel_1, adc_channel_2, adc_channel_3, }; /* Get an instance of the ADC interface */ adc = s5j_adc_initialize(chanlist, sizeof(chanlist)); if (adc == NULL) { return -ENODEV; } /* Register the ADC driver at "/dev/adc0" */ ret = adc_register("/dev/adc0", adc); if (ret < 0) { return ret; } #endif /* CONFIG_S5J_ADC */ return OK; } static void scsc_wpa_ctrl_iface_init(void) { #ifdef CONFIG_SCSC_WLAN int ret; ret = mkfifo("/dev/wpa_ctrl_req", 666); if (ret != 0 && ret != -EEXIST) { lldbg("mkfifo error ret:%d\n", ret); return; } ret = mkfifo("/dev/wpa_ctrl_cfm", 666); if (ret != 0 && ret != -EEXIST) { lldbg("mkfifo error ret:%d\n", ret); return; } ret = mkfifo("/dev/wpa_monitor", 666); if (ret != 0 && ret != -EEXIST) { lldbg("mkfifo error ret:%d\n", ret); return; } #endif } /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** * Name: board_app_initialize * * Description: * Perform architecture specific initialization * ****************************************************************************/ int board_app_initialize(void) { int ret; #ifdef CONFIG_FLASH_PARTITION struct mtd_dev_s *mtd; #if defined(CONFIG_ARTIK05X_AUTOMOUNT) && defined(CONFIG_RAMMTD) && defined(CONFIG_FS_SMARTFS) int bufsize; static uint8_t *rambuf; #endif /* CONFIG_RAMMTD */ mtd = (FAR struct mtd_dev_s *)mtd_initialize(); /* Configure mtd partitions */ configure_mtd_partitions(mtd, &g_flash_part_data); #ifdef CONFIG_ARTIK05X_AUTOMOUNT #ifdef CONFIG_ARTIK05X_AUTOMOUNT_USERFS /* Initialize and mount user partition (if we have) */ #ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS ret = mksmartfs(ARTIK05X_AUTOMOUNT_USERFS_DEVNAME, 1, false); #else ret = mksmartfs(ARTIK05X_AUTOMOUNT_USERFS_DEVNAME, false); #endif if (ret != OK) { lldbg("ERROR: mksmartfs on %s failed\n", ARTIK05X_AUTOMOUNT_USERFS_DEVNAME); } else { ret = mount(ARTIK05X_AUTOMOUNT_USERFS_DEVNAME, CONFIG_ARTIK05X_AUTOMOUNT_USERFS_MOUNTPOINT, "smartfs", 0, NULL); if (ret != OK) { lldbg("ERROR: mounting '%s' failed\n", ARTIK05X_AUTOMOUNT_USERFS_DEVNAME); } } #endif /* CONFIG_ARTIK05X_AUTOMOUNT_USERFS */ #ifdef CONFIG_ARTIK05X_AUTOMOUNT_SSSRW /* Initialize and mount secure storage partition (if we have) */ #ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS ret = mksmartfs(CONFIG_ARTIK05X_AUTOMOUNT_SSSRW_DEVNAME, 1, false); #else ret = mksmartfs(CONFIG_ARTIK05X_AUTOMOUNT_SSSRW_DEVNAME, false); #endif if (ret != OK) { lldbg("ERROR: mksmartfs on %s failed\n", CONFIG_ARTIK05X_AUTOMOUNT_SSSRW_DEVNAME); } else { ret = mount(CONFIG_ARTIK05X_AUTOMOUNT_SSSRW_DEVNAME, CONFIG_ARTIK05X_AUTOMOUNT_SSSRW_MOUNTPOINT, "smartfs", 0, NULL); if (ret != OK) { lldbg("ERROR: mounting '%s' failed\n", CONFIG_ARTIK05X_AUTOMOUNT_SSSRW_DEVNAME); } } #endif /* CONFIG_ARTIK05X_AUTOMOUNT_SSSRW */ #ifdef CONFIG_ARTIK05X_AUTOMOUNT_ROMFS ret = mount(CONFIG_ARTIK05X_AUTOMOUNT_ROMFS_DEVNAME, CONFIG_ARTIK05X_AUTOMOUNT_ROMFS_MOUNTPOINT, "romfs", 0, NULL); if (ret != OK) { lldbg("ERROR: mounting '%s'(ROMFS) failed\n", CONFIG_ARTIK05X_AUTOMOUNT_ROMFS_DEVNAME); } #endif #if defined(CONFIG_RAMMTD) && defined(CONFIG_FS_SMARTFS) bufsize = CONFIG_RAMMTD_ERASESIZE * CONFIG_ARTIK05X_RAMMTD_NEBLOCKS; rambuf = (uint8_t *)kmm_malloc(bufsize); if (!rambuf) { lldbg("ERROR: FAILED TO allocate RAMMTD\n"); } else { mtd = rammtd_initialize(rambuf, bufsize); if (!mtd) { lldbg("ERROR: FAILED TO CREATE RAM MTD INSTANCE\n"); kmm_free(rambuf); } else { ret = smart_initialize(CONFIG_ARTIK05X_RAMMTD_DEV_NUMBER, mtd, NULL); if (ret < 0) { lldbg("ERROR: FAILED TO smart_initialize\n"); kmm_free(rambuf); } else { #ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS ret = mksmartfs(CONFIG_ARTIK05X_RAMMTD_DEV_POINT, 1, false); #else ret = mksmartfs(CONFIG_ARTIK05X_RAMMTD_DEV_POINT, false); #endif if (ret != OK) { lldbg("ERROR: mksmartfs on %s failed\n", CONFIG_ARTIK05X_RAMMTD_DEV_POINT); kmm_free(rambuf); } else { ret = mount(CONFIG_ARTIK05X_RAMMTD_DEV_POINT, CONFIG_ARTIK05X_RAMMTD_MOUNT_POINT, "smartfs", 0, NULL); if (ret < 0) { lldbg("ERROR: Failed to mount the SMART volume: %d\n", errno); kmm_free(rambuf); } } } } } #endif /* CONFIG_RAMMTD */ #ifdef CONFIG_LIBC_ZONEINFO_ROMFS ret = mount(CONFIG_ARTIK05X_AUTOMOUNT_TZDEVNAME, CONFIG_LIBC_TZDIR, "romfs", MS_RDONLY, NULL); if (ret != OK) { lldbg("ROMFS ERROR: mounting failed"); } #endif /* CONFIG_LIBC_ZONEINFO_ROMFS */ #endif /* CONFIG_ARTIK05X_AUTOMOUNT */ #endif /* CONFIG_FLASH_PARTITION */ #if defined(CONFIG_RTC_DRIVER) { struct rtc_lowerhalf_s *rtclower; rtclower = s5j_rtc_lowerhalf(); if (rtclower) { ret = rtc_initialize(0, rtclower); if (ret < 0) { lldbg("Failed to register the RTC driver: %d\n", ret); } } } #endif /* CONFIG_RTC_DRIVER */ #ifdef CONFIG_TIMER { int i; char path[CONFIG_PATH_MAX]; for (i = 0; i < CONFIG_S5J_MCT_NUM; i++) { snprintf(path, sizeof(path), "/dev/timer%d", i); s5j_timer_initialize(path, i); } } #endif artik05x_adc_setup(); scsc_wpa_ctrl_iface_init(); UNUSED(ret); return OK; }
{ "pile_set_name": "Github" }
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Mozilla Communicator client code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Original Author: David W. Hyatt ([email protected]) * Alec Flett <[email protected]> * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #ifndef nsBindingManager_h_ #define nsBindingManager_h_ #include "nsIBindingManager.h" #include "nsIStyleRuleSupplier.h" #include "nsStubDocumentObserver.h" #include "pldhash.h" #include "nsInterfaceHashtable.h" #include "nsRefPtrHashtable.h" #include "nsURIHashKey.h" class nsIContent; class nsIXPConnectWrappedJS; class nsIAtom; class nsIDOMNodeList; class nsVoidArray; class nsIDocument; class nsIURI; class nsIXBLDocumentInfo; class nsIStreamListener; class nsStyleSet; class nsBindingManager : public nsIBindingManager, public nsIStyleRuleSupplier, public nsStubDocumentObserver { NS_DECL_ISUPPORTS public: nsBindingManager(); ~nsBindingManager(); virtual nsXBLBinding* GetBinding(nsIContent* aContent); NS_IMETHOD SetBinding(nsIContent* aContent, nsXBLBinding* aBinding); NS_IMETHOD GetInsertionParent(nsIContent* aContent, nsIContent** aResult); NS_IMETHOD SetInsertionParent(nsIContent* aContent, nsIContent* aResult); NS_IMETHOD GetWrappedJS(nsIContent* aContent, nsIXPConnectWrappedJS** aResult); NS_IMETHOD SetWrappedJS(nsIContent* aContent, nsIXPConnectWrappedJS* aResult); NS_IMETHOD ChangeDocumentFor(nsIContent* aContent, nsIDocument* aOldDocument, nsIDocument* aNewDocument); NS_IMETHOD ResolveTag(nsIContent* aContent, PRInt32* aNameSpaceID, nsIAtom** aResult); NS_IMETHOD GetContentListFor(nsIContent* aContent, nsIDOMNodeList** aResult); NS_IMETHOD SetContentListFor(nsIContent* aContent, nsVoidArray* aList); NS_IMETHOD HasContentListFor(nsIContent* aContent, PRBool* aResult); NS_IMETHOD GetAnonymousNodesFor(nsIContent* aContent, nsIDOMNodeList** aResult); NS_IMETHOD SetAnonymousNodesFor(nsIContent* aContent, nsVoidArray* aList); NS_IMETHOD GetXBLChildNodesFor(nsIContent* aContent, nsIDOMNodeList** aResult); virtual nsIContent* GetInsertionPoint(nsIContent* aParent, nsIContent* aChild, PRUint32* aIndex); virtual nsIContent* GetSingleInsertionPoint(nsIContent* aParent, PRUint32* aIndex, PRBool* aMultipleInsertionPoints); NS_IMETHOD AddLayeredBinding(nsIContent* aContent, nsIURI* aURL); NS_IMETHOD RemoveLayeredBinding(nsIContent* aContent, nsIURI* aURL); NS_IMETHOD LoadBindingDocument(nsIDocument* aBoundDoc, nsIURI* aURL, nsIDocument** aResult); NS_IMETHOD AddToAttachedQueue(nsXBLBinding* aBinding); NS_IMETHOD ClearAttachedQueue(); NS_IMETHOD ProcessAttachedQueue(); NS_IMETHOD ExecuteDetachedHandlers(); NS_IMETHOD PutXBLDocumentInfo(nsIXBLDocumentInfo* aDocumentInfo); NS_IMETHOD GetXBLDocumentInfo(nsIURI* aURI, nsIXBLDocumentInfo** aResult); NS_IMETHOD RemoveXBLDocumentInfo(nsIXBLDocumentInfo* aDocumentInfo); NS_IMETHOD PutLoadingDocListener(nsIURI* aURL, nsIStreamListener* aListener); NS_IMETHOD GetLoadingDocListener(nsIURI* aURL, nsIStreamListener** aResult); NS_IMETHOD RemoveLoadingDocListener(nsIURI* aURL); NS_IMETHOD FlushSkinBindings(); NS_IMETHOD GetBindingImplementation(nsIContent* aContent, REFNSIID aIID, void** aResult); NS_IMETHOD ShouldBuildChildFrames(nsIContent* aContent, PRBool* aResult); // nsIStyleRuleSupplier NS_IMETHOD WalkRules(nsStyleSet* aStyleSet, nsIStyleRuleProcessor::EnumFunc aFunc, RuleProcessorData* aData, PRBool* aCutOffInheritance); // nsIDocumentObserver virtual void ContentAppended(nsIDocument* aDocument, nsIContent* aContainer, PRInt32 aNewIndexInContainer); virtual void ContentInserted(nsIDocument* aDocument, nsIContent* aContainer, nsIContent* aChild, PRInt32 aIndexInContainer); virtual void ContentRemoved(nsIDocument* aDocument, nsIContent* aContainer, nsIContent* aChild, PRInt32 aIndexInContainer); protected: nsresult GetXBLChildNodesInternal(nsIContent* aContent, nsIDOMNodeList** aResult, PRBool* aIsAnonymousContentList); nsresult GetAnonymousNodesInternal(nsIContent* aContent, nsIDOMNodeList** aResult, PRBool* aIsAnonymousContentList); nsIContent* GetEnclosingScope(nsIContent* aContent) { return aContent->GetBindingParent(); } nsresult GetNestedInsertionPoint(nsIContent* aParent, nsIContent* aChild, nsIContent** aResult); // MEMBER VARIABLES protected: // A mapping from nsIContent* to the nsXBLBinding* that is // installed on that element. nsRefPtrHashtable<nsISupportsHashKey,nsXBLBinding> mBindingTable; // A mapping from nsIContent* to an nsIDOMNodeList* // (nsAnonymousContentList*). This list contains an accurate // reflection of our *explicit* children (once intermingled with // insertion points) in the altered DOM. PLDHashTable mContentListTable; // A mapping from nsIContent* to an nsIDOMNodeList* // (nsAnonymousContentList*). This list contains an accurate // reflection of our *anonymous* children (if and only if they are // intermingled with insertion points) in the altered DOM. This // table is not used if no insertion points were defined directly // underneath a <content> tag in a binding. The NodeList from the // <content> is used instead as a performance optimization. PLDHashTable mAnonymousNodesTable; // A mapping from nsIContent* to nsIContent*. The insertion parent // is our one true parent in the transformed DOM. This gives us a // more-or-less O(1) way of obtaining our transformed parent. PLDHashTable mInsertionParentTable; // A mapping from nsIContent* to nsIXPWrappedJS* (an XPConnect // wrapper for JS objects). For XBL bindings that implement XPIDL // interfaces, and that get referred to from C++, this table caches // the XPConnect wrapper for the binding. By caching it, I control // its lifetime, and I prevent a re-wrap of the same script object // (in the case where multiple bindings in an XBL inheritance chain // both implement an XPIDL interface). PLDHashTable mWrapperTable; // A mapping from a URL (a string) to nsIXBLDocumentInfo*. This table // is the cache of all binding documents that have been loaded by a // given bound document. nsInterfaceHashtable<nsURIHashKey,nsIXBLDocumentInfo> mDocumentTable; // A mapping from a URL (a string) to a nsIStreamListener. This // table is the currently loading binding docs. If they're in this // table, they have not yet finished loading. nsInterfaceHashtable<nsURIHashKey,nsIStreamListener> mLoadingDocTable; // A queue of binding attached event handlers that are awaiting execution. nsVoidArray mAttachedStack; PRBool mProcessingAttachedStack; }; PRBool PR_CALLBACK ReleaseInsertionPoint(void* aElement, void* aData); #endif
{ "pile_set_name": "Github" }
#include "u.h" #include "lib.h" #include "dat.h" #include "fns.h" #include "error.h" Proc *up; Conf conf = { 1, 100, 0, 1024*1024*1024, 1024*1024*1024, 1024*1024*1024, 1024*1024*1024, 1024*1024*1024, 1024*1024*1024, 1024*1024*1024, 1024*1024*1024, 1024*1024*1024, 1024*1024*1024, 1024*1024*1024, 1024*1024*1024, 0, }; char *eve = "eve"; ulong kerndate; int cpuserver; char hostdomain[] = "drawterm.net";
{ "pile_set_name": "Github" }
[Packed1 0.0# 1.0# 2# 3.0#,Packed1 1.0# 2.0# 3# 4.0#,Packed1 2.0# 3.0# 4# 5.0#] [Packed2 0.0 1.0 2 3.0,Packed2 1.0 2.0 3 4.0,Packed2 2.0 3.0 4 5.0] [Packed3 0 1 2 3.0 4 5 6.0 6.0,Packed3 1 2 3 4.0 5 6 7.0 7.0,Packed3 2 3 4 5.0 6 7 8.0 8.0]
{ "pile_set_name": "Github" }
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Ui\Test\Unit\Component\Form\Element; use Magento\Ui\Component\Form\Element\ActionDelete; class ActionDeleteTest extends AbstractElementTest { /** * @inheritdoc */ protected function getModelName() { return ActionDelete::class; } /** * @inheritdoc */ public function testGetComponentName() { $this->assertSame(ActionDelete::NAME, $this->getModel()->getComponentName()); } }
{ "pile_set_name": "Github" }
INTERFACE zif_abapgit_gui_event PUBLIC . DATA mv_action TYPE string READ-ONLY. DATA mv_getdata TYPE string READ-ONLY. DATA mt_postdata TYPE cnht_post_data_tab READ-ONLY. DATA mi_gui_services TYPE REF TO zif_abapgit_gui_services READ-ONLY. ENDINTERFACE.
{ "pile_set_name": "Github" }
/** * Copyright © 2002 Instituto Superior Técnico * * This file is part of FenixEdu Academic. * * FenixEdu Academic is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * FenixEdu Academic is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with FenixEdu Academic. If not, see <http://www.gnu.org/licenses/>. */ package org.fenixedu.academic.domain.phd.candidacy.feedbackRequest; import java.util.Collections; import java.util.List; import java.util.Locale; import org.fenixedu.academic.domain.phd.PhdProcessStateType; import org.fenixedu.academic.util.Bundle; import org.fenixedu.bennu.core.i18n.BundleUtil; import org.fenixedu.commons.i18n.I18N; public enum PhdCandidacyFeedbackStateType implements PhdProcessStateType { NEW, WAITING_FOR_FEEDBACK, CONCLUDED; @Override public String getName() { return name(); } @Override public String getLocalizedName() { return getLocalizedName(I18N.getLocale()); } @Override public String getLocalizedName(final Locale locale) { return BundleUtil.getString(Bundle.PHD, locale, getQualifiedName()); } private String getQualifiedName() { return getClass().getSimpleName() + "." + name(); } public static List<PhdCandidacyFeedbackStateType> getPossibleNextStates(PhdCandidacyFeedbackStateType type) { if (type == null) { return Collections.singletonList(NEW); } switch (type) { case NEW: return Collections.singletonList(WAITING_FOR_FEEDBACK); case WAITING_FOR_FEEDBACK: return Collections.singletonList(CONCLUDED); } return Collections.EMPTY_LIST; } }
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.NodeServices.HostingModels { /// <summary> /// Class responsible for launching a Node child process on the local machine, determining when it is ready to /// accept invocations, detecting if it dies on its own, and finally terminating it on disposal. /// /// This abstract base class uses the input/output streams of the child process to perform a simple handshake /// to determine when the child process is ready to accept invocations. This is agnostic to the mechanism that /// derived classes use to actually perform the invocations (e.g., they could use HTTP-RPC, or a binary TCP /// protocol, or any other RPC-type mechanism). /// </summary> /// <seealso cref="Microsoft.AspNetCore.NodeServices.HostingModels.INodeInstance" /> public abstract class OutOfProcessNodeInstance : INodeInstance { /// <summary> /// The <see cref="ILogger"/> to which the Node.js instance's stdout/stderr is being redirected. /// </summary> protected readonly ILogger OutputLogger; private const string ConnectionEstablishedMessage = "[Microsoft.AspNetCore.NodeServices:Listening]"; private readonly TaskCompletionSource<object> _connectionIsReadySource = new TaskCompletionSource<object>(); private bool _disposed; private readonly StringAsTempFile _entryPointScript; private FileSystemWatcher _fileSystemWatcher; private int _invocationTimeoutMilliseconds; private bool _launchWithDebugging; private readonly Process _nodeProcess; private int? _nodeDebuggingPort; private bool _nodeProcessNeedsRestart; private readonly string[] _watchFileExtensions; /// <summary> /// Creates a new instance of <see cref="OutOfProcessNodeInstance"/>. /// </summary> /// <param name="entryPointScript">The path to the entry point script that the Node instance should load and execute.</param> /// <param name="projectPath">The root path of the current project. This is used when resolving Node.js module paths relative to the project root.</param> /// <param name="watchFileExtensions">The filename extensions that should be watched within the project root. The Node instance will automatically shut itself down if any matching file changes.</param> /// <param name="commandLineArguments">Additional command-line arguments to be passed to the Node.js instance.</param> /// <param name="applicationStoppingToken">A token that indicates when the host application is stopping.</param> /// <param name="nodeOutputLogger">The <see cref="ILogger"/> to which the Node.js instance's stdout/stderr (and other log information) should be written.</param> /// <param name="environmentVars">Environment variables to be set on the Node.js process.</param> /// <param name="invocationTimeoutMilliseconds">The maximum duration, in milliseconds, to wait for RPC calls to complete.</param> /// <param name="launchWithDebugging">If true, passes a flag to the Node.js process telling it to accept V8 debugger connections.</param> /// <param name="debuggingPort">If debugging is enabled, the Node.js process should listen for V8 debugger connections on this port.</param> public OutOfProcessNodeInstance( string entryPointScript, string projectPath, string[] watchFileExtensions, string commandLineArguments, CancellationToken applicationStoppingToken, ILogger nodeOutputLogger, IDictionary<string, string> environmentVars, int invocationTimeoutMilliseconds, bool launchWithDebugging, int debuggingPort) { if (nodeOutputLogger == null) { throw new ArgumentNullException(nameof(nodeOutputLogger)); } OutputLogger = nodeOutputLogger; _entryPointScript = new StringAsTempFile(entryPointScript, applicationStoppingToken); _invocationTimeoutMilliseconds = invocationTimeoutMilliseconds; _launchWithDebugging = launchWithDebugging; var startInfo = PrepareNodeProcessStartInfo(_entryPointScript.FileName, projectPath, commandLineArguments, environmentVars, _launchWithDebugging, debuggingPort); _nodeProcess = LaunchNodeProcess(startInfo); _watchFileExtensions = watchFileExtensions; _fileSystemWatcher = BeginFileWatcher(projectPath); ConnectToInputOutputStreams(); } /// <summary> /// Asynchronously invokes code in the Node.js instance. /// </summary> /// <typeparam name="T">The JSON-serializable data type that the Node.js code will asynchronously return.</typeparam> /// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the invocation.</param> /// <param name="moduleName">The path to the Node.js module (i.e., JavaScript file) relative to your project root that contains the code to be invoked.</param> /// <param name="exportNameOrNull">If set, specifies the CommonJS export to be invoked. If not set, the module's default CommonJS export itself must be a function to be invoked.</param> /// <param name="args">Any sequence of JSON-serializable arguments to be passed to the Node.js function.</param> /// <returns>A <see cref="Task{TResult}"/> representing the completion of the RPC call.</returns> public async Task<T> InvokeExportAsync<T>( CancellationToken cancellationToken, string moduleName, string exportNameOrNull, params object[] args) { if (_nodeProcess.HasExited || _nodeProcessNeedsRestart) { // This special kind of exception triggers a transparent retry - NodeServicesImpl will launch // a new Node instance and pass the invocation to that one instead. // Note that if the Node process is listening for debugger connections, then we need it to shut // down immediately and not stay open for connection draining (because if it did, the new Node // instance wouldn't able to start, because the old one would still hold the debugging port). var message = _nodeProcess.HasExited ? "The Node process has exited" : "The Node process needs to restart"; throw new NodeInvocationException( message, details: null, nodeInstanceUnavailable: true, allowConnectionDraining: !_launchWithDebugging); } // Construct a new cancellation token that combines the supplied token with the configured invocation // timeout. Technically we could avoid wrapping the cancellationToken if no timeout is configured, // but that's not really a major use case, since timeouts are enabled by default. using (var timeoutSource = new CancellationTokenSource()) using (var combinedCancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutSource.Token)) { if (_invocationTimeoutMilliseconds > 0) { timeoutSource.CancelAfter(_invocationTimeoutMilliseconds); } // By overwriting the supplied cancellation token, we ensure that it isn't accidentally used // below. We only want to pass through the token that respects timeouts. cancellationToken = combinedCancellationTokenSource.Token; var connectionDidSucceed = false; try { // Wait until the connection is established. This will throw if the connection fails to initialize, // or if cancellation is requested first. Note that we can't really cancel the "establishing connection" // task because that's shared with all callers, but we can stop waiting for it if this call is cancelled. await _connectionIsReadySource.Task.OrThrowOnCancellation(cancellationToken); connectionDidSucceed = true; return await InvokeExportAsync<T>(new NodeInvocationInfo { ModuleName = moduleName, ExportedFunctionName = exportNameOrNull, Args = args }, cancellationToken); } catch (TaskCanceledException) { if (timeoutSource.IsCancellationRequested) { // It was very common for developers to report 'TaskCanceledException' when encountering almost any // trouble when using NodeServices. Now we have a default invocation timeout, and attempt to give // a more descriptive exception message if it happens. if (!connectionDidSucceed) { // This is very unlikely, but for debugging, it's still useful to differentiate it from the // case below. throw new NodeInvocationException( $"Attempt to connect to Node timed out after {_invocationTimeoutMilliseconds}ms.", string.Empty); } else { // Developers encounter this fairly often (if their Node code fails without invoking the callback, // all that the .NET side knows is that the invocation eventually times out). Previously, this surfaced // as a TaskCanceledException, but this led to a lot of issue reports. Now we throw the following // descriptive error. throw new NodeInvocationException( $"The Node invocation timed out after {_invocationTimeoutMilliseconds}ms.", $"You can change the timeout duration by setting the {NodeServicesOptions.TimeoutConfigPropertyName} " + $"property on {nameof(NodeServicesOptions)}.\n\n" + "The first debugging step is to ensure that your Node.js function always invokes the supplied " + "callback (or throws an exception synchronously), even if it encounters an error. Otherwise, " + "the .NET code has no way to know that it is finished or has failed." ); } } else { throw; } } } } /// <summary> /// Disposes this instance. /// </summary> public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } /// <summary> /// Asynchronously invokes code in the Node.js instance. /// </summary> /// <typeparam name="T">The JSON-serializable data type that the Node.js code will asynchronously return.</typeparam> /// <param name="invocationInfo">Specifies the Node.js function to be invoked and arguments to be passed to it.</param> /// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to cancel the invocation.</param> /// <returns>A <see cref="Task{TResult}"/> representing the completion of the RPC call.</returns> protected abstract Task<T> InvokeExportAsync<T>( NodeInvocationInfo invocationInfo, CancellationToken cancellationToken); /// <summary> /// Configures a <see cref="ProcessStartInfo"/> instance describing how to launch the Node.js process. /// </summary> /// <param name="entryPointFilename">The entrypoint JavaScript file that the Node.js process should execute.</param> /// <param name="projectPath">The root path of the project. This is used when locating Node.js modules relative to the project root.</param> /// <param name="commandLineArguments">Command-line arguments to be passed to the Node.js process.</param> /// <param name="environmentVars">Environment variables to be set on the Node.js process.</param> /// <param name="launchWithDebugging">If true, passes a flag to the Node.js process telling it to accept V8 Inspector connections.</param> /// <param name="debuggingPort">If debugging is enabled, the Node.js process should listen for V8 Inspector connections on this port.</param> /// <returns></returns> protected virtual ProcessStartInfo PrepareNodeProcessStartInfo( string entryPointFilename, string projectPath, string commandLineArguments, IDictionary<string, string> environmentVars, bool launchWithDebugging, int debuggingPort) { // This method is virtual, as it provides a way to override the NODE_PATH or the path to node.exe string debuggingArgs; if (launchWithDebugging) { debuggingArgs = debuggingPort != default(int) ? $"--inspect={debuggingPort} " : "--inspect "; _nodeDebuggingPort = debuggingPort; } else { debuggingArgs = string.Empty; } var thisProcessPid = Process.GetCurrentProcess().Id; var startInfo = new ProcessStartInfo("node") { Arguments = $"{debuggingArgs}\"{entryPointFilename}\" --parentPid {thisProcessPid} {commandLineArguments ?? string.Empty}", UseShellExecute = false, RedirectStandardInput = true, RedirectStandardOutput = true, RedirectStandardError = true, WorkingDirectory = projectPath }; // Append environment vars if (environmentVars != null) { foreach (var envVarKey in environmentVars.Keys) { var envVarValue = environmentVars[envVarKey]; if (envVarValue != null) { SetEnvironmentVariable(startInfo, envVarKey, envVarValue); } } } // Append projectPath to NODE_PATH so it can locate node_modules var existingNodePath = Environment.GetEnvironmentVariable("NODE_PATH") ?? string.Empty; if (existingNodePath != string.Empty) { existingNodePath += Path.PathSeparator; } var nodePathValue = existingNodePath + Path.Combine(projectPath, "node_modules"); SetEnvironmentVariable(startInfo, "NODE_PATH", nodePathValue); return startInfo; } /// <summary> /// Virtual method invoked whenever the Node.js process emits a line to its stdout. /// </summary> /// <param name="outputData">The line emitted to the Node.js process's stdout.</param> protected virtual void OnOutputDataReceived(string outputData) { OutputLogger.LogInformation(outputData); } /// <summary> /// Virtual method invoked whenever the Node.js process emits a line to its stderr. /// </summary> /// <param name="errorData">The line emitted to the Node.js process's stderr.</param> protected virtual void OnErrorDataReceived(string errorData) { OutputLogger.LogError(errorData); } /// <summary> /// Disposes the instance. /// </summary> /// <param name="disposing">True if the object is disposing or false if it is finalizing.</param> protected virtual void Dispose(bool disposing) { if (!_disposed) { if (disposing) { _entryPointScript.Dispose(); EnsureFileSystemWatcherIsDisposed(); } // Make sure the Node process is finished // TODO: Is there a more graceful way to end it? Or does this still let it perform any cleanup? if (_nodeProcess != null && !_nodeProcess.HasExited) { _nodeProcess.Kill(); } _disposed = true; } } private void EnsureFileSystemWatcherIsDisposed() { if (_fileSystemWatcher != null) { _fileSystemWatcher.Dispose(); _fileSystemWatcher = null; } } private static void SetEnvironmentVariable(ProcessStartInfo startInfo, string name, string value) { startInfo.Environment[name] = value; } private static Process LaunchNodeProcess(ProcessStartInfo startInfo) { try { var process = Process.Start(startInfo); // On Mac at least, a killed child process is left open as a zombie until the parent // captures its exit code. We don't need the exit code for this process, and don't want // to use process.WaitForExit() explicitly (we'd have to block the thread until it really // has exited), but we don't want to leave zombies lying around either. It's sufficient // to use process.EnableRaisingEvents so that .NET will grab the exit code and let the // zombie be cleaned away without having to block our thread. process.EnableRaisingEvents = true; return process; } catch (Exception ex) { var message = "Failed to start Node process. To resolve this:.\n\n" + "[1] Ensure that Node.js is installed and can be found in one of the PATH directories.\n" + $" Current PATH enviroment variable is: { Environment.GetEnvironmentVariable("PATH") }\n" + " Make sure the Node executable is in one of those directories, or update your PATH.\n\n" + "[2] See the InnerException for further details of the cause."; throw new InvalidOperationException(message, ex); } } private static string UnencodeNewlines(string str) { if (str != null) { // The token here needs to match the const in OverrideStdOutputs.ts. // See the comment there for why we're doing this. str = str.Replace("__ns_newline__", Environment.NewLine); } return str; } private void ConnectToInputOutputStreams() { var initializationIsCompleted = false; _nodeProcess.OutputDataReceived += (sender, evt) => { if (evt.Data == ConnectionEstablishedMessage && !initializationIsCompleted) { _connectionIsReadySource.SetResult(null); initializationIsCompleted = true; } else if (evt.Data != null) { OnOutputDataReceived(UnencodeNewlines(evt.Data)); } }; _nodeProcess.ErrorDataReceived += (sender, evt) => { if (evt.Data != null) { if (_launchWithDebugging && IsDebuggerMessage(evt.Data)) { OutputLogger.LogWarning(evt.Data); } else { OnErrorDataReceived(UnencodeNewlines(evt.Data)); } } }; _nodeProcess.BeginOutputReadLine(); _nodeProcess.BeginErrorReadLine(); } private static bool IsDebuggerMessage(string message) { return message.StartsWith("Debugger attached", StringComparison.Ordinal) || message.StartsWith("Debugger listening ", StringComparison.Ordinal) || message.StartsWith("To start debugging", StringComparison.Ordinal) || message.Equals("Warning: This is an experimental feature and could change at any time.", StringComparison.Ordinal) || message.Equals("For help see https://nodejs.org/en/docs/inspector", StringComparison.Ordinal) || message.Contains("chrome-devtools:"); } private FileSystemWatcher BeginFileWatcher(string rootDir) { if (_watchFileExtensions == null || _watchFileExtensions.Length == 0) { // Nothing to watch return null; } var watcher = new FileSystemWatcher(rootDir) { IncludeSubdirectories = true, NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName }; watcher.Changed += OnFileChanged; watcher.Created += OnFileChanged; watcher.Deleted += OnFileChanged; watcher.Renamed += OnFileRenamed; watcher.EnableRaisingEvents = true; return watcher; } private void OnFileChanged(object source, FileSystemEventArgs e) { if (IsFilenameBeingWatched(e.FullPath)) { RestartDueToFileChange(e.FullPath); } } private void OnFileRenamed(object source, RenamedEventArgs e) { if (IsFilenameBeingWatched(e.OldFullPath) || IsFilenameBeingWatched(e.FullPath)) { RestartDueToFileChange(e.OldFullPath); } } private bool IsFilenameBeingWatched(string fullPath) { if (string.IsNullOrEmpty(fullPath)) { return false; } else { var actualExtension = Path.GetExtension(fullPath) ?? string.Empty; return _watchFileExtensions.Any(actualExtension.Equals); } } private void RestartDueToFileChange(string fullPath) { OutputLogger.LogInformation($"Node will restart because file changed: {fullPath}"); _nodeProcessNeedsRestart = true; // There's no need to watch for any more changes, since we're already restarting, and if the // restart takes some time (e.g., due to connection draining), we could end up getting duplicate // notifications. EnsureFileSystemWatcherIsDisposed(); } /// <summary> /// Implements the finalization part of the IDisposable pattern by calling Dispose(false). /// </summary> ~OutOfProcessNodeInstance() { Dispose(false); } } }
{ "pile_set_name": "Github" }
import angular from 'angular'; import uiRoutes from 'ui/routes'; import sectionTemplate from './views/index.html'; import editTemplate from './views/edit.html'; import './controller'; import '../../directives/directives'; import 'ui/autoload/styles'; import 'plugins/opendistro_security/apps/configuration/configuration.less'; uiRoutes .when('/internalusers', { template: sectionTemplate }) .when('/internalusers/edit/:resourcename', { template: editTemplate }) .when('/internalusers/clone/:resourcename', { template: editTemplate }) .when('/internalusers/new', { template: editTemplate });
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0 extern int printf(const char *format, ...); extern char *cplus_demangle(const char *, int); int main(void) { char symbol[4096] = "FieldName__9ClassNameFd"; char *tmp; tmp = cplus_demangle(symbol, 0); printf("demangled symbol: {%s}\n", tmp); return 0; }
{ "pile_set_name": "Github" }
package function import ( "fmt" "github.com/zclconf/go-cty/cty" ) // Function represents a function. This is the main type in this package. type Function struct { spec *Spec } // Spec is the specification of a function, used to instantiate // a new Function. type Spec struct { // Params is a description of the positional parameters for the function. // The standard checking logic rejects any calls that do not provide // arguments conforming to this definition, freeing the function // implementer from dealing with such inconsistencies. Params []Parameter // VarParam is an optional specification of additional "varargs" the // function accepts. If this is non-nil then callers may provide an // arbitrary number of additional arguments (after those matching with // the fixed parameters in Params) that conform to the given specification, // which will appear as additional values in the slices of values // provided to the type and implementation functions. VarParam *Parameter // Type is the TypeFunc that decides the return type of the function // given its arguments, which may be Unknown. See the documentation // of TypeFunc for more information. // // Use StaticReturnType if the function's return type does not vary // depending on its arguments. Type TypeFunc // Impl is the ImplFunc that implements the function's behavior. // // Functions are expected to behave as pure functions, and not create // any visible side-effects. // // If a TypeFunc is also provided, the value returned from Impl *must* // conform to the type it returns, or a call to the function will panic. Impl ImplFunc } // New creates a new function with the given specification. // // After passing a Spec to this function, the caller must no longer read from // or mutate it. func New(spec *Spec) Function { f := Function{ spec: spec, } return f } // TypeFunc is a callback type for determining the return type of a function // given its arguments. // // Any of the values passed to this function may be unknown, even if the // parameters are not configured to accept unknowns. // // If any of the given values are *not* unknown, the TypeFunc may use the // values for pre-validation and for choosing the return type. For example, // a hypothetical JSON-unmarshalling function could return // cty.DynamicPseudoType if the given JSON string is unknown, but return // a concrete type based on the JSON structure if the JSON string is already // known. type TypeFunc func(args []cty.Value) (cty.Type, error) // ImplFunc is a callback type for the main implementation of a function. // // "args" are the values for the arguments, and this slice will always be at // least as long as the argument definition slice for the function. // // "retType" is the type returned from the Type callback, included as a // convenience to avoid the need to re-compute the return type for generic // functions whose return type is a function of the arguments. type ImplFunc func(args []cty.Value, retType cty.Type) (cty.Value, error) // StaticReturnType returns a TypeFunc that always returns the given type. // // This is provided as a convenience for defining a function whose return // type does not depend on the argument types. func StaticReturnType(ty cty.Type) TypeFunc { return func([]cty.Value) (cty.Type, error) { return ty, nil } } // ReturnType returns the return type of a function given a set of candidate // argument types, or returns an error if the given types are unacceptable. // // If the caller already knows values for at least some of the arguments // it can be better to call ReturnTypeForValues, since certain functions may // determine their return types from their values and return DynamicVal if // the values are unknown. func (f Function) ReturnType(argTypes []cty.Type) (cty.Type, error) { vals := make([]cty.Value, len(argTypes)) for i, ty := range argTypes { vals[i] = cty.UnknownVal(ty) } return f.ReturnTypeForValues(vals) } // ReturnTypeForValues is similar to ReturnType but can be used if the caller // already knows the values of some or all of the arguments, in which case // the function may be able to determine a more definite result if its // return type depends on the argument *values*. // // For any arguments whose values are not known, pass an Unknown value of // the appropriate type. func (f Function) ReturnTypeForValues(args []cty.Value) (ty cty.Type, err error) { var posArgs []cty.Value var varArgs []cty.Value if f.spec.VarParam == nil { if len(args) != len(f.spec.Params) { return cty.Type{}, fmt.Errorf( "wrong number of arguments (%d required; %d given)", len(f.spec.Params), len(args), ) } posArgs = args varArgs = nil } else { if len(args) < len(f.spec.Params) { return cty.Type{}, fmt.Errorf( "wrong number of arguments (at least %d required; %d given)", len(f.spec.Params), len(args), ) } posArgs = args[0:len(f.spec.Params)] varArgs = args[len(f.spec.Params):] } for i, spec := range f.spec.Params { val := posArgs[i] if val.IsNull() && !spec.AllowNull { return cty.Type{}, NewArgErrorf(i, "argument must not be null") } // AllowUnknown is ignored for type-checking, since we expect to be // able to type check with unknown values. We *do* still need to deal // with DynamicPseudoType here though, since the Type function might // not be ready to deal with that. if val.Type() == cty.DynamicPseudoType { if !spec.AllowDynamicType { return cty.DynamicPseudoType, nil } } else if errs := val.Type().TestConformance(spec.Type); errs != nil { // For now we'll just return the first error in the set, since // we don't have a good way to return the whole list here. // Would be good to do something better at some point... return cty.Type{}, NewArgError(i, errs[0]) } } if varArgs != nil { spec := f.spec.VarParam for i, val := range varArgs { realI := i + len(posArgs) if val.IsNull() && !spec.AllowNull { return cty.Type{}, NewArgErrorf(realI, "argument must not be null") } if val.Type() == cty.DynamicPseudoType { if !spec.AllowDynamicType { return cty.DynamicPseudoType, nil } } else if errs := val.Type().TestConformance(spec.Type); errs != nil { // For now we'll just return the first error in the set, since // we don't have a good way to return the whole list here. // Would be good to do something better at some point... return cty.Type{}, NewArgError(i, errs[0]) } } } // Intercept any panics from the function and return them as normal errors, // so a calling language runtime doesn't need to deal with panics. defer func() { if r := recover(); r != nil { ty = cty.NilType err = errorForPanic(r) } }() return f.spec.Type(args) } // Call actually calls the function with the given arguments, which must // conform to the function's parameter specification or an error will be // returned. func (f Function) Call(args []cty.Value) (val cty.Value, err error) { expectedType, err := f.ReturnTypeForValues(args) if err != nil { return cty.NilVal, err } // Type checking already dealt with most situations relating to our // parameter specification, but we still need to deal with unknown // values. posArgs := args[:len(f.spec.Params)] varArgs := args[len(f.spec.Params):] for i, spec := range f.spec.Params { val := posArgs[i] if !val.IsKnown() && !spec.AllowUnknown { return cty.UnknownVal(expectedType), nil } } if f.spec.VarParam != nil { spec := f.spec.VarParam for _, val := range varArgs { if !val.IsKnown() && !spec.AllowUnknown { return cty.UnknownVal(expectedType), nil } } } var retVal cty.Value { // Intercept any panics from the function and return them as normal errors, // so a calling language runtime doesn't need to deal with panics. defer func() { if r := recover(); r != nil { val = cty.NilVal err = errorForPanic(r) } }() retVal, err = f.spec.Impl(args, expectedType) if err != nil { return cty.NilVal, err } } // Returned value must conform to what the Type function expected, to // protect callers from having to deal with inconsistencies. if errs := retVal.Type().TestConformance(expectedType); errs != nil { panic(fmt.Errorf( "returned value %#v does not conform to expected return type %#v: %s", retVal, expectedType, errs[0], )) } return retVal, nil } // ProxyFunc the type returned by the method Function.Proxy. type ProxyFunc func(args ...cty.Value) (cty.Value, error) // Proxy returns a function that can be called with cty.Value arguments // to run the function. This is provided as a convenience for when using // a function directly within Go code. func (f Function) Proxy() ProxyFunc { return func(args ...cty.Value) (cty.Value, error) { return f.Call(args) } } // Params returns information about the function's fixed positional parameters. // This does not include information about any variadic arguments accepted; // for that, call VarParam. func (f Function) Params() []Parameter { new := make([]Parameter, len(f.spec.Params)) copy(new, f.spec.Params) return new } // VarParam returns information about the variadic arguments the function // expects, or nil if the function is not variadic. func (f Function) VarParam() *Parameter { if f.spec.VarParam == nil { return nil } ret := *f.spec.VarParam return &ret }
{ "pile_set_name": "Github" }
import React, { useCallback, useState } from 'react'; import { CheckSquare, Square } from 'react-feather'; import classes from './CheckboxInput.css'; const checkedIcon = <CheckSquare />; const uncheckedIcon = <Square />; const CheckboxInput = props => { const { children, initialChecked, value, ...restProps } = props; const [checked, setChecked] = useState(!!initialChecked); const icon = checked ? checkedIcon : uncheckedIcon; const handleChange = useCallback( event => { const { checked } = event.target; setChecked(!!checked); }, [setChecked] ); return ( <label className={classes.root}> <input {...restProps} className={classes.input} onChange={handleChange} type="checkbox" value={value} /> <span className={classes.icon}>{icon}</span> <span className={classes.label}>{children}</span> </label> ); }; export default CheckboxInput;
{ "pile_set_name": "Github" }
mkdir -p ./darknet53-swish CUDA_VISIBLE_DEVICES=3 ./darknet classifier train icfg/darknet53-swish.data icfg/darknet53-swish.cfg -gpus 0 -dont_show
{ "pile_set_name": "Github" }
-- -- Copyright (c) 2015 Davor Jadrijevic -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- 1. Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- 2. Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. -- -- $Id$ -- library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; use work.f32c_pack.all; entity ep4ce6mb_xram_acram_emu is generic ( -- ISA: either ARCH_MI32 or ARCH_RV32 C_arch: integer := ARCH_MI32; C_debug: boolean := false; -- Main clock: C_clk_freq: integer := 83; -- SoC configuration options C_bram_size: integer := 2; C_icache_size: integer := 0; C_dcache_size: integer := 0; C_acram: boolean := true; C_hdmi_out: boolean := true; C_dvid_ddr: boolean := true; C_vgahdmi: boolean := true; -- simple VGA bitmap with compositing C_vgahdmi_cache_size: integer := 0; -- KB (0 to disable, 2,4,8,16,32 to enable) -- normally this should be actual bits per pixel C_vgahdmi_fifo_data_width: integer range 8 to 32 := 8; -- width of FIFO address space -> size of fifo -- for 8bpp compositing use 11 -> 2048 bytes C_sio: integer := 1; C_gpio: integer := 32; C_simple_io: boolean := true ); port ( clk_50m: in std_logic; rs232_txd: out std_logic; rs232_rxd: in std_logic; ld: out std_logic_vector(8 downto 1); gpio: inout std_logic_vector(51 downto 0); hdmi_d: out std_logic_vector(2 downto 0); hdmi_clk: out std_logic; btn: in std_logic_vector(2 downto 1) ); end; architecture Behavioral of ep4ce6mb_xram_acram_emu is signal clk: std_logic; signal clk_pixel, clk_pixel_shift: std_logic; signal btns: std_logic_vector(1 downto 0); signal ram_en : std_logic; signal ram_byte_we : std_logic_vector(3 downto 0) := (others => '0'); signal ram_address : std_logic_vector(31 downto 0) := (others => '0'); signal ram_data_write : std_logic_vector(31 downto 0) := (others => '0'); signal ram_data_read : std_logic_vector(31 downto 0) := (others => '0'); signal ram_ready : std_logic := '1'; signal S_hdmi_pd0, S_hdmi_pd1, S_hdmi_pd2: std_logic_vector(9 downto 0); signal tx_in: std_logic_vector(29 downto 0); signal tmds_d: std_logic_vector(3 downto 0); begin G_83m333_clk: if C_clk_freq = 83 generate clkgen: entity work.clk_50M_125M_25M_83M333 port map( inclk0 => clk_50m, -- 50 MHz input from board c0 => clk_pixel_shift, -- 125 MHz c1 => clk_pixel, -- 25 MHz c2 => clk -- 83.333 MHz ); end generate; -- generic XRAM glue glue_xram: entity work.glue_xram generic map ( C_arch => C_arch, C_clk_freq => C_clk_freq, C_bram_size => C_bram_size, C_icache_size => C_icache_size, C_dcache_size => C_dcache_size, C_acram => C_acram, -- vga simple bitmap C_dvid_ddr => C_dvid_ddr, C_vgahdmi => C_vgahdmi, C_vgahdmi_cache_size => C_vgahdmi_cache_size, C_vgahdmi_fifo_data_width => C_vgahdmi_fifo_data_width, C_debug => C_debug ) port map ( clk => clk, clk_pixel => clk_pixel, clk_pixel_shift => clk_pixel_shift, sio_txd(0) => rs232_txd, sio_rxd(0) => rs232_rxd, spi_sck => open, spi_ss => open, spi_mosi => open, spi_miso => "", acram_en => ram_en, acram_addr(29 downto 2) => ram_address(29 downto 2), acram_byte_we(3 downto 0) => ram_byte_we(3 downto 0), acram_data_rd(31 downto 0) => ram_data_read(31 downto 0), acram_data_wr(31 downto 0) => ram_data_write(31 downto 0), acram_ready => ram_ready, -- ***** HDMI ***** dvi_r => S_hdmi_pd2, dvi_g => S_hdmi_pd1, dvi_b => S_hdmi_pd0, gpio(31 downto 0) => gpio(31 downto 0), gpio(127 downto 32) => open, simple_out(7 downto 0) => ld, simple_out(31 downto 8) => open, simple_in(1 downto 0) => btn, simple_in(31 downto 2) => open ); acram_emulation: entity work.acram_emu generic map ( C_addr_width => 12 ) port map ( clk => clk, acram_a => ram_address(13 downto 2), acram_d_wr => ram_data_write, acram_d_rd => ram_data_read, acram_byte_we => ram_byte_we, acram_en => ram_en ); -- generic "differential" output buffering for HDMI clock and video --hdmi_output1: entity work.hdmi_out -- port map -- ( -- tmds_in_rgb => tmds_rgb, -- tmds_out_rgb_p => hdmi_dp, -- D2+ red D1+ green D0+ blue -- tmds_out_rgb_n => hdmi_dn, -- D2- red D1- green D0+ blue -- tmds_in_clk => tmds_clk, -- tmds_out_clk_p => hdmi_clkp, -- CLK+ clock -- tmds_out_clk_n => hdmi_clkn -- CLK- clock -- ); -- true differential, vendor-specific -- tx_in <= S_HDMI_PD2 & S_HDMI_PD1 & S_HDMI_PD0; -- this would be normal bit order, but -- generic serializer follows vendor specific serializer style tx_in <= S_HDMI_PD2(0) & S_HDMI_PD2(1) & S_HDMI_PD2(2) & S_HDMI_PD2(3) & S_HDMI_PD2(4) & S_HDMI_PD2(5) & S_HDMI_PD2(6) & S_HDMI_PD2(7) & S_HDMI_PD2(8) & S_HDMI_PD2(9) & S_HDMI_PD1(0) & S_HDMI_PD1(1) & S_HDMI_PD1(2) & S_HDMI_PD1(3) & S_HDMI_PD1(4) & S_HDMI_PD1(5) & S_HDMI_PD1(6) & S_HDMI_PD1(7) & S_HDMI_PD1(8) & S_HDMI_PD1(9) & S_HDMI_PD0(0) & S_HDMI_PD0(1) & S_HDMI_PD0(2) & S_HDMI_PD0(3) & S_HDMI_PD0(4) & S_HDMI_PD0(5) & S_HDMI_PD0(6) & S_HDMI_PD0(7) & S_HDMI_PD0(8) & S_HDMI_PD0(9); vendorspec_serializer_inst: entity work.serializer PORT MAP ( tx_in => tx_in, tx_inclock => CLK_PIXEL_SHIFT, -- NOTE: vendor-specific serializer needs CLK_PIXEL x5 tx_syncclock => CLK_PIXEL, tx_out => tmds_d(2 downto 0) ); hdmi_clk <= CLK_PIXEL; hdmi_d <= tmds_d(2 downto 0); end Behavioral;
{ "pile_set_name": "Github" }
# Operational/Administrator Manual ## Architecture and Components ![Zally Architecture](assets/architecture.png) ### Server Zally Server is the core of Zally tools and also the only component of the minimal setup. It provides a [well-defined RESTful API](../server/src/main/resources/api/zally-api.yaml) to lint APIs, get information about past lintings, as well as provide information about implemented rules and statistics. Optionally, you can connect Zally Server to a persistence layer, e.g. a PostgreSQL database. Per default, a in-memory database is provided automatically. ### Web UI The most intuitive and easy way to use Zally is to set up and run Zally Web UI. It provides a web interface to lint APIs and uses Zally Server to do the actual linting. ### CLI Zally CLI is a tiny tool written in Go which wraps HTTP calls to Zally Server. It's a tiny binary which can be distributed easily to use in different environments like local developer's machine, continuous delivery platforms, etc. ## Technical Dependencies - JDK 1.8+ for Server - Golang 1.7+ for CLI - Node.js 7.6+ for Web UI - (Optional) PostgreSQL database for Server - (Optional) Docker if you want to containerize ## Build and Run Please see the respective readmes for more details on how to build the components: - [Server](../server/README.md) - [Web UI](../web-ui/README.md) - [CLI](../cli/README.md) In general, there are 3 options to start a component: 1. With the build tool (Gradle, Yarn) 2. Build the source > start the bundle/jar/binary 3. Build the source > build Docker image > run Docker container
{ "pile_set_name": "Github" }
using Newtonsoft.Json; namespace Nethereum.Quorum.RPC.DTOs { public class NodeInfo { [JsonProperty(PropertyName = "blockMakerAccount")] public string BlockMakerAccount { get; set; } [JsonProperty(PropertyName = "voteAccount")] public string VoteAccount { get; set; } [JsonProperty(PropertyName = "blockmakestrategy")] public BlockMakeStratregy BlockMakeStratregy { get; set; } [JsonProperty(PropertyName = "canCreateBlocks")] public bool CanCreateBlocks { get; set; } [JsonProperty(PropertyName = "canVote")] public bool CanVote { get; set; } } }
{ "pile_set_name": "Github" }
<?php return [ 'issue-077-G' => [ 'ua' => 'SAMSUNG-SGH-E250/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/6.2.3.3.c.1.101 (GUI) MMP/2.0 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)', 'properties' => [ 'Comment' => 'Googlebot', 'Browser' => 'Google Bot Mobile', 'Browser_Type' => 'Bot/Crawler', 'Browser_Bits' => '32', 'Browser_Maker' => 'Google Inc', 'Browser_Modus' => 'unknown', 'Version' => '2.1', 'Platform' => 'JAVA', 'Platform_Version' => 'unknown', 'Platform_Description' => 'unknown', 'Platform_Bits' => '32', 'Platform_Maker' => 'Oracle', 'Alpha' => false, 'Beta' => false, 'Frames' => false, 'IFrames' => false, 'Tables' => false, 'Cookies' => false, 'JavaScript' => false, 'VBScript' => false, 'JavaApplets' => false, 'isSyndicationReader' => false, 'isFake' => false, 'isAnonymized' => false, 'isModified' => false, 'CssVersion' => '0', 'Device_Name' => 'SGH-E250', 'Device_Maker' => 'Samsung', 'Device_Type' => 'Mobile Phone', 'Device_Pointing_Method' => 'unknown', 'Device_Code_Name' => 'SGH-E250', 'Device_Brand_Name' => 'Samsung', 'RenderingEngine_Name' => 'unknown', 'RenderingEngine_Version' => 'unknown', 'RenderingEngine_Maker' => 'unknown', ], 'lite' => false, 'standard' => false, 'full' => true, ], 'issue-077-F' => [ 'ua' => 'DoCoMo/2.0 N905i(c100;TB;W24H16) (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)', 'properties' => [ 'Comment' => 'Googlebot', 'Browser' => 'Google Bot Mobile', 'Browser_Type' => 'Bot/Crawler', 'Browser_Bits' => '32', 'Browser_Maker' => 'Google Inc', 'Browser_Modus' => 'unknown', 'Version' => '2.1', 'Platform' => 'Maemo', 'Platform_Version' => 'unknown', 'Platform_Description' => 'Maemo', 'Platform_Bits' => '32', 'Platform_Maker' => 'Linux Foundation', 'Alpha' => false, 'Beta' => false, 'Frames' => false, 'IFrames' => false, 'Tables' => false, 'Cookies' => false, 'JavaScript' => false, 'VBScript' => false, 'JavaApplets' => false, 'isSyndicationReader' => false, 'isFake' => false, 'isAnonymized' => false, 'isModified' => false, 'CssVersion' => '0', 'Device_Name' => 'N905i', 'Device_Maker' => 'NEC', 'Device_Type' => 'Mobile Phone', 'Device_Pointing_Method' => 'unknown', 'Device_Code_Name' => 'N905i', 'Device_Brand_Name' => 'NEC', 'RenderingEngine_Name' => 'unknown', 'RenderingEngine_Version' => 'unknown', 'RenderingEngine_Maker' => 'unknown', ], 'lite' => false, 'standard' => true, 'full' => true, ], 'issue-077-E' => [ 'ua' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)', 'properties' => [ 'Comment' => 'Googlebot 2.1', 'Browser' => 'Google Bot', 'Browser_Type' => 'Bot/Crawler', 'Browser_Bits' => '32', 'Browser_Maker' => 'Google Inc', 'Browser_Modus' => 'unknown', 'Version' => '2.1', 'Platform' => 'iOS', 'Platform_Version' => '6.0', 'Platform_Description' => 'iPod, iPhone & iPad', 'Platform_Bits' => '32', 'Platform_Maker' => 'Apple Inc', 'Alpha' => false, 'Beta' => false, 'Frames' => true, 'IFrames' => true, 'Tables' => true, 'Cookies' => true, 'JavaScript' => true, 'VBScript' => false, 'JavaApplets' => true, 'isSyndicationReader' => false, 'isFake' => false, 'isAnonymized' => false, 'isModified' => false, 'CssVersion' => '3', 'Device_Name' => 'iPhone', 'Device_Maker' => 'Apple Inc', 'Device_Type' => 'Mobile Phone', 'Device_Pointing_Method' => 'touchscreen', 'Device_Code_Name' => 'iPhone', 'Device_Brand_Name' => 'Apple', 'RenderingEngine_Name' => 'WebKit', 'RenderingEngine_Version' => 'unknown', 'RenderingEngine_Maker' => 'Apple Inc', ], 'lite' => false, 'standard' => false, 'full' => true, ], 'issue-077-E (standard)' => [ 'ua' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)', 'properties' => [ 'Comment' => 'Googlebot 2.1', 'Browser' => 'Google Bot', 'Browser_Maker' => 'Google Inc', 'Version' => '2.1', 'Platform' => 'iOS', 'Device_Type' => 'Mobile Device', 'Device_Pointing_Method' => 'touchscreen', ], 'lite' => false, 'standard' => true, 'full' => false, ], 'issue-077-D' => [ 'ua' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)', 'properties' => [ 'Comment' => 'Googlebot', 'Browser' => 'Google Bot Mobile', 'Browser_Type' => 'Bot/Crawler', 'Browser_Bits' => '32', 'Browser_Maker' => 'Google Inc', 'Browser_Modus' => 'unknown', 'Version' => '2.1', 'Platform' => 'iOS', 'Platform_Version' => '6.0', 'Platform_Description' => 'iPod, iPhone & iPad', 'Platform_Bits' => '32', 'Platform_Maker' => 'Apple Inc', 'Alpha' => false, 'Beta' => false, 'Frames' => true, 'IFrames' => true, 'Tables' => true, 'Cookies' => true, 'JavaScript' => true, 'VBScript' => false, 'JavaApplets' => true, 'isSyndicationReader' => false, 'isFake' => false, 'isAnonymized' => false, 'isModified' => false, 'CssVersion' => '3', 'Device_Name' => 'iPhone', 'Device_Maker' => 'Apple Inc', 'Device_Type' => 'Mobile Phone', 'Device_Pointing_Method' => 'touchscreen', 'Device_Code_Name' => 'iPhone', 'Device_Brand_Name' => 'Apple', 'RenderingEngine_Name' => 'WebKit', 'RenderingEngine_Version' => 'unknown', 'RenderingEngine_Maker' => 'Apple Inc', ], 'lite' => false, 'standard' => false, 'full' => true, ], 'issue-077-D (standard)' => [ 'ua' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)', 'properties' => [ 'Comment' => 'Googlebot', 'Browser' => 'Google Bot Mobile', 'Browser_Maker' => 'Google Inc', 'Version' => '2.1', 'Platform' => 'iOS', 'Device_Type' => 'Mobile Device', 'Device_Pointing_Method' => 'touchscreen', ], 'lite' => false, 'standard' => true, 'full' => false, ], 'issue-077-C' => [ 'ua' => 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)', 'properties' => [ 'Comment' => 'Googlebot 2.1', 'Browser' => 'Google Bot', 'Browser_Type' => 'Bot/Crawler', 'Browser_Bits' => '0', 'Browser_Maker' => 'Google Inc', 'Browser_Modus' => 'unknown', 'Version' => '2.1', 'Platform' => 'unknown', 'Platform_Version' => 'unknown', 'Platform_Description' => 'unknown', 'Platform_Bits' => '0', 'Platform_Maker' => 'unknown', 'Alpha' => false, 'Beta' => false, 'Frames' => false, 'IFrames' => false, 'Tables' => false, 'Cookies' => false, 'JavaScript' => false, 'VBScript' => false, 'JavaApplets' => false, 'isSyndicationReader' => false, 'isFake' => false, 'isAnonymized' => false, 'isModified' => false, 'CssVersion' => '0', 'Device_Name' => 'unknown', 'Device_Maker' => 'unknown', 'Device_Type' => 'unknown', 'Device_Pointing_Method' => 'unknown', 'Device_Code_Name' => 'unknown', 'Device_Brand_Name' => 'unknown', 'RenderingEngine_Name' => 'unknown', 'RenderingEngine_Version' => 'unknown', 'RenderingEngine_Maker' => 'unknown', ], 'lite' => false, 'standard' => true, 'full' => true, ], 'issue-077-B' => [ 'ua' => 'integrity/4', 'properties' => [ 'Comment' => 'Link Checkers', 'Browser' => 'Integrity', 'Browser_Type' => 'Bot/Crawler', 'Browser_Bits' => '32', 'Browser_Maker' => 'unknown', 'Browser_Modus' => 'unknown', 'Version' => '0.0', 'Platform' => 'MacOSX', 'Platform_Version' => '10', 'Platform_Description' => 'Mac OS X', 'Platform_Bits' => '32', 'Platform_Maker' => 'Apple Inc', 'Alpha' => false, 'Beta' => false, 'Frames' => false, 'IFrames' => false, 'Tables' => false, 'Cookies' => false, 'JavaScript' => false, 'VBScript' => false, 'JavaApplets' => false, 'isSyndicationReader' => false, 'isFake' => false, 'isAnonymized' => false, 'isModified' => false, 'CssVersion' => '0', 'Device_Name' => 'Macintosh', 'Device_Maker' => 'Apple Inc', 'Device_Type' => 'Desktop', 'Device_Pointing_Method' => 'mouse', 'Device_Code_Name' => 'Macintosh', 'Device_Brand_Name' => 'Apple', 'RenderingEngine_Name' => 'unknown', 'RenderingEngine_Version' => 'unknown', 'RenderingEngine_Maker' => 'unknown', ], 'lite' => false, 'standard' => true, 'full' => true, ], 'issue-077-A' => [ 'ua' => 'Mozilla/5.0 (Linux; U; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.11 Safari/535.19 Silk-Accelerated=true', 'properties' => [ 'Comment' => 'Silk 3.11', 'Browser' => 'Silk', 'Browser_Type' => 'Browser', 'Browser_Bits' => '32', 'Browser_Maker' => 'Amazon.com, Inc.', 'Browser_Modus' => 'Desktop Mode', 'Version' => '3.11', 'Platform' => 'Android', 'Platform_Version' => 'unknown', 'Platform_Description' => 'Android OS', 'Platform_Bits' => '32', 'Platform_Maker' => 'Google Inc', 'Alpha' => false, 'Beta' => false, 'Frames' => true, 'IFrames' => true, 'Tables' => true, 'Cookies' => true, 'JavaScript' => true, 'VBScript' => false, 'JavaApplets' => true, 'isSyndicationReader' => false, 'isFake' => false, 'isAnonymized' => false, 'isModified' => false, 'CssVersion' => '3', 'Device_Name' => 'Kindle Fire HD 7', 'Device_Maker' => 'Amazon.com, Inc.', 'Device_Type' => 'Tablet', 'Device_Pointing_Method' => 'touchscreen', 'Device_Code_Name' => 'KFTT', 'Device_Brand_Name' => 'Amazon', 'RenderingEngine_Name' => 'WebKit', 'RenderingEngine_Version' => 'unknown', 'RenderingEngine_Maker' => 'Apple Inc', ], 'lite' => false, 'standard' => true, 'full' => true, ], ];
{ "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. */ import React from 'react'; import { shallow } from 'enzyme'; import WithPopoverMenu from 'src/dashboard/components/menu/WithPopoverMenu'; describe('WithPopoverMenu', () => { const props = { children: <div id="child" />, disableClick: false, menuItems: [<div id="menu1" />, <div id="menu2" />], onChangeFocus() {}, shouldFocus: () => true, // needed for mock isFocused: false, editMode: false, }; function setup(overrideProps) { const wrapper = shallow(<WithPopoverMenu {...props} {...overrideProps} />); return wrapper; } it('should render a div with class "with-popover-menu"', () => { const wrapper = setup(); expect(wrapper.find('.with-popover-menu')).toExist(); }); it('should render the passed children', () => { const wrapper = setup(); expect(wrapper.find('#child')).toExist(); }); it('should focus on click in editMode', () => { const wrapper = setup(); expect(wrapper.state('isFocused')).toBe(false); wrapper.simulate('click'); expect(wrapper.state('isFocused')).toBe(false); wrapper.setProps({ ...props, editMode: true }); wrapper.simulate('click'); expect(wrapper.state('isFocused')).toBe(true); }); it('should render menuItems when focused', () => { const wrapper = setup({ editMode: true }); expect(wrapper.find('#menu1')).not.toExist(); expect(wrapper.find('#menu2')).not.toExist(); wrapper.simulate('click'); expect(wrapper.find('#menu1')).toExist(); expect(wrapper.find('#menu2')).toExist(); }); it('should not focus when disableClick=true', () => { const wrapper = setup({ disableClick: true, editMode: true }); expect(wrapper.state('isFocused')).toBe(false); wrapper.simulate('click'); expect(wrapper.state('isFocused')).toBe(false); }); it('should use the passed shouldFocus func to determine if it should focus', () => { const wrapper = setup({ editMode: true, shouldFocus: () => false }); expect(wrapper.state('isFocused')).toBe(false); wrapper.simulate('click'); expect(wrapper.state('isFocused')).toBe(false); }); });
{ "pile_set_name": "Github" }
package controllers.adminapi import actions.ApiAction import env.Env import otoroshi.tcp.TcpService import play.api.Logger import play.api.libs.json.{JsObject, JsValue, Json} import play.api.mvc.{AbstractController, ControllerComponents, RequestHeader} import utils._ import scala.concurrent.{ExecutionContext, Future} class TcpServiceApiController(val ApiAction: ApiAction, val cc: ControllerComponents)(implicit val env: Env) extends AbstractController(cc) with BulkControllerHelper[TcpService, JsValue] with CrudControllerHelper[TcpService, JsValue] { implicit lazy val ec = env.otoroshiExecutionContext implicit lazy val mat = env.otoroshiMaterializer val logger = Logger("otoroshi-tcp-service-api") override def buildError(status: Int, message: String): ApiError[JsValue] = JsonApiError(status, play.api.libs.json.JsString(message)) override def extractId(entity: TcpService): String = entity.id override def readEntity(json: JsValue): Either[String, TcpService] = TcpService.fmt.reads(json).asEither match { case Left(e) => Left(e.toString()) case Right(r) => Right(r) } override def writeEntity(entity: TcpService): JsValue = TcpService.fmt.writes(entity) override def findByIdOps(id: String)(implicit env: Env, ec: ExecutionContext): Future[Either[ApiError[JsValue], OptionalEntityAndContext[TcpService]]] = { env.datastores.tcpServiceDataStore.findById(id).map { opt => Right(OptionalEntityAndContext( entity = opt, action = "ACCESS_TCP_SERVICE", message = "User accessed a tcp service", metadata = Json.obj("TcpServiceId" -> id), alert = "TcpServiceAccessed" )) } } override def findAllOps(req: RequestHeader)(implicit env: Env, ec: ExecutionContext): Future[Either[ApiError[JsValue], SeqEntityAndContext[TcpService]]] = { env.datastores.tcpServiceDataStore.findAll().map { seq => Right(SeqEntityAndContext( entity = seq, action = "ACCESS_ALL_TCP_SERVICES", message = "User accessed all tcp services", metadata = Json.obj(), alert = "TcpServicesAccessed" )) } } override def createEntityOps(entity: TcpService)(implicit env: Env, ec: ExecutionContext): Future[Either[ApiError[JsValue], EntityAndContext[TcpService]]] = { env.datastores.tcpServiceDataStore.set(entity).map { case true => { Right(EntityAndContext( entity = entity, action = "CREATE_TCP_SERVICE", message = "User created a tcp service", metadata = entity.json.as[JsObject], alert = "TcpServiceCreatedAlert" )) } case false => { Left(JsonApiError( 500, Json.obj("error" -> "Tcp service not stored ...") )) } } } override def updateEntityOps(entity: TcpService)(implicit env: Env, ec: ExecutionContext): Future[Either[ApiError[JsValue], EntityAndContext[TcpService]]] = { env.datastores.tcpServiceDataStore.set(entity).map { case true => { Right(EntityAndContext( entity = entity, action = "UPDATE_TCP_SERVICE", message = "User updated a tcp service", metadata = entity.json.as[JsObject], alert = "TcpServiceUpdatedAlert" )) } case false => { Left(JsonApiError( 500, Json.obj("error" -> "Tcp service not stored ...") )) } } } override def deleteEntityOps(id: String)(implicit env: Env, ec: ExecutionContext): Future[Either[ApiError[JsValue], NoEntityAndContext[TcpService]]] = { env.datastores.tcpServiceDataStore.delete(id).map { case true => { Right(NoEntityAndContext( action = "DELETE_TCP_SERVICE", message = "User deleted a tcp service", metadata = Json.obj("TcpServiceId" -> id), alert = "TcpServiceDeletedAlert" )) } case false => { Left(JsonApiError( 500, Json.obj("error" -> "Tcp service not deleted ...") )) } } } }
{ "pile_set_name": "Github" }
--- license: > 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. title: Nadgradnjo operacijskega sistema Windows 8 --- # Nadgradnjo operacijskega sistema Windows 8 Ta vodič pokaže, kako spremeniti Windows 8 projektov za nadgradnjo iz starejše različice Cordova. Večina teh navodil, ki se uporablja za projekte, ustvarjene s starejši nabor orodij ukazne vrstice, ki pred je `cordova` CLI korist. Glej The vmesnik ukazne vrstice za informacije kako modernizirati prevod od CLI. ## Vzpenjajoč se v 3.2.0 od 3.1.0 Za projekte, ki so bile ustvarjene z cordova CLI: 1. Update na `cordova` CLI različico. Glej vmesnik ukazne vrstice. 2. Teči`cordova platform update windows8`. Za projekte, ki niso ustvarjene z cordova CLI, teči: bin\update <project_path> ## Nadgradite 3.1.0 Cordova CLI podporo za Windows 8 je bil uveden v Cordova 3.1.0. Za nadgradnjo, predlagamo, da ustvarja nove Cordova CLI projekta in se gibljejo do vseh potrebnih sredstev. ## Vzpenjajoč se v 2.9.0 iz 2.8.0 Naslednje ukaze je treba narediti iz znotraj Visual Studio prepričati se da vse sklice v projektu so posodobljena/izbrisati. 1. Odstraniti `cordova-2.8.0.js` iz projekta `www` imenik. 2. Dodaj `cordova.js` datoteko iz vira projekta `www` imenik. (Upoštevajte, da datoteka ne vsebuje številko različice v ime datoteke.) 3. Zgradite in preizkusite! ## Vzpenjajoč se v 2.8.0 iz 2.7.0 Naslednje ukaze je treba narediti iz znotraj Visual Studio prepričati se da vse sklice v projektu so posodobljena/izbrisati. 1. Odstraniti `cordova-2.7.0.js` iz projekta `www` imenik. 2. Dodaj `cordova.js` datoteko iz vira projekta `www` imenik. (Upoštevajte, da datoteka ne vsebuje številko različice v ime datoteke.) 3. Zgradite in preizkusite!
{ "pile_set_name": "Github" }
# # gowalla_spot.rb # AroundMe # # Created by Matt Aimonetti on 5/16/11. # Copyright 2011 m|a agile Consulting. All rights reserved. # class GowallaSpot attr_reader :name attr_reader :url attr_reader :description attr_reader :highlights_url attr_reader :lat, :lgn attr_reader :image attr_reader :items_count attr_reader :radius_meters attr_reader :users, :checkins def initialize(spot_hash) @name = spot_hash['name'] @url = NSURL.URLWithString( "http://gowalla.com#{spot_hash['url']}") @description = spot_hash['description'] @highlights_url = 'http://gowalla.com' \ + spot_hash['highlights_url'] @lat = spot_hash['lat'] @lgn = spot_hash['lgn'] @image = spot_hash['_image_url_50'] @items_count = spot_hash['items_count'] @radius_meters = spot_hash['radius_meters'] @users = spot_hash['users_count'] @checkins = spot_hash['checkins_count'] end end
{ "pile_set_name": "Github" }
<?php final class PhabricatorAuthMessageTextTransaction extends PhabricatorAuthMessageTransactionType { const TRANSACTIONTYPE = 'text'; public function generateOldValue($object) { return $object->getMessageText(); } public function applyInternalEffects($object, $value) { $object->setMessageText($value); } public function getTitle() { return pht( '%s updated the message text.', $this->renderAuthor()); } public function hasChangeDetailView() { return true; } public function getMailDiffSectionHeader() { return pht('CHANGES TO MESSAGE'); } public function newChangeDetailView() { $viewer = $this->getViewer(); return id(new PhabricatorApplicationTransactionTextDiffDetailView()) ->setViewer($viewer) ->setOldText($this->getOldValue()) ->setNewText($this->getNewValue()); } }
{ "pile_set_name": "Github" }
// Copyright 2017, OpenCensus 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 view import "sync" var ( exportersMu sync.RWMutex // guards exporters exporters = make(map[Exporter]struct{}) ) // Exporter exports the collected records as view data. // // The ExportView method should return quickly; if an // Exporter takes a significant amount of time to // process a Data, that work should be done on another goroutine. // // It is safe to assume that ExportView will not be called concurrently from // multiple goroutines. // // The Data should not be modified. type Exporter interface { ExportView(viewData *Data) } // RegisterExporter registers an exporter. // Collected data will be reported via all the // registered exporters. Once you no longer // want data to be exported, invoke UnregisterExporter // with the previously registered exporter. // // Binaries can register exporters, libraries shouldn't register exporters. func RegisterExporter(e Exporter) { exportersMu.Lock() defer exportersMu.Unlock() exporters[e] = struct{}{} } // UnregisterExporter unregisters an exporter. func UnregisterExporter(e Exporter) { exportersMu.Lock() defer exportersMu.Unlock() delete(exporters, e) }
{ "pile_set_name": "Github" }
package org.nustaq.offheap.bytez.bytesource; import org.nustaq.offheap.bytez.ByteSource; import org.nustaq.serialization.util.FSTUtil; import java.io.UnsupportedEncodingException; /** * Created by ruedi on 05/08/15. */ public class UTFStringByteSource implements ByteSource { byte bytes[]; public UTFStringByteSource(String key) { try { bytes = key.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { FSTUtil.<RuntimeException>rethrow(e); } } @Override public byte get(long index) { return bytes[((int) index)]; } @Override public long length() { return bytes.length; } public UTFStringByteSource padLeft(int keyLen) { if ( bytes.length < keyLen ) { byte newBytes[] = new byte[keyLen]; System.arraycopy(bytes,0,newBytes,keyLen-bytes.length,bytes.length); bytes = newBytes; } return this; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIconFile</key> <string></string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleVersion</key> <string>1</string> <key>LSMinimumSystemVersion</key> <string>$(MACOSX_DEPLOYMENT_TARGET)</string> <key>NSHumanReadableCopyright</key> <string>Copyright © 2017 XueYu. All rights reserved.</string> <key>NSMainStoryboardFile</key> <string>Main</string> <key>NSPrincipalClass</key> <string>NSApplication</string> <key>LSUIElement</key> <true/> </dict> </plist>
{ "pile_set_name": "Github" }
#include "sim_objects/default_trick_sys.sm" ##include "ros_comm/ros_framework.hh" ##include "ros_comm/ros_subscribe.hh" class RosSubscribeSimObject : public Trick::SimObject { public: RosFramework rf ; RosSubscribe rp ; RosSubscribeSimObject() : rf("trick_listener") , rp() { ("initialization") rp.init() ; C1 (0.5, "scheduled") rp.process() ; ("shutdown") rf.shutdown() ; } } ; RosSubscribeSimObject rs_so ;
{ "pile_set_name": "Github" }
var gleak = require('gleak')(); gleak.ignore('AssertionError'); gleak.ignore('testFullSpec_param_found'); gleak.ignore('events'); gleak.ignore('Uint8Array'); gleak.ignore('Uint8ClampedArray'); gleak.ignore('TAP_Global_Harness'); gleak.ignore('setImmediate'); gleak.ignore('clearImmediate'); gleak.ignore('DTRACE_NET_SERVER_CONNECTION'); gleak.ignore('DTRACE_NET_STREAM_END'); gleak.ignore('DTRACE_NET_SOCKET_READ'); gleak.ignore('DTRACE_NET_SOCKET_WRITE'); gleak.ignore('DTRACE_HTTP_SERVER_REQUEST'); gleak.ignore('DTRACE_HTTP_SERVER_RESPONSE'); gleak.ignore('DTRACE_HTTP_CLIENT_REQUEST'); gleak.ignore('DTRACE_HTTP_CLIENT_RESPONSE'); module.exports = gleak;
{ "pile_set_name": "Github" }
/* Flot plugin for stacking data sets rather than overlyaing them. Copyright (c) 2007-2014 IOLA and Ole Laursen. Licensed under the MIT license. The plugin assumes the data is sorted on x (or y if stacking horizontally). For line charts, it is assumed that if a line has an undefined gap (from a null point), then the line above it should have the same gap - insert zeros instead of "null" if you want another behaviour. This also holds for the start and end of the chart. Note that stacking a mix of positive and negative values in most instances doesn't make sense (so it looks weird). Two or more series are stacked when their "stack" attribute is set to the same key (which can be any number or string or just "true"). To specify the default stack, you can set the stack option like this: series: { stack: null/false, true, or a key (number/string) } You can also specify it for a single series, like this: $.plot( $("#placeholder"), [{ data: [ ... ], stack: true }]) The stacking order is determined by the order of the data series in the array (later series end up on top of the previous). Internally, the plugin modifies the datapoints in each series, adding an offset to the y value. For line series, extra data points are inserted through interpolation. If there's a second y value, it's also adjusted (e.g for bar charts or filled areas). */ (function ($) { var options = { series: { stack: null } // or number/string }; function init(plot) { function findMatchingSeries(s, allseries) { var res = null; for (var i = 0; i < allseries.length; ++i) { if (s == allseries[i]) break; if (allseries[i].stack == s.stack) res = allseries[i]; } return res; } function stackData(plot, s, datapoints) { if (s.stack == null || s.stack === false) return; var other = findMatchingSeries(s, plot.getData()); if (!other) return; var ps = datapoints.pointsize, points = datapoints.points, otherps = other.datapoints.pointsize, otherpoints = other.datapoints.points, newpoints = [], px, py, intery, qx, qy, bottom, withlines = s.lines.show, horizontal = s.bars.horizontal, withbottom = ps > 2 && (horizontal ? datapoints.format[2].x : datapoints.format[2].y), withsteps = withlines && s.lines.steps, fromgap = true, keyOffset = horizontal ? 1 : 0, accumulateOffset = horizontal ? 0 : 1, i = 0, j = 0, l, m; while (true) { if (i >= points.length) break; l = newpoints.length; if (points[i] == null) { // copy gaps for (m = 0; m < ps; ++m) newpoints.push(points[i + m]); i += ps; } else if (j >= otherpoints.length) { // for lines, we can't use the rest of the points if (!withlines) { for (m = 0; m < ps; ++m) newpoints.push(points[i + m]); } i += ps; } else if (otherpoints[j] == null) { // oops, got a gap for (m = 0; m < ps; ++m) newpoints.push(null); fromgap = true; j += otherps; } else { // cases where we actually got two points px = points[i + keyOffset]; py = points[i + accumulateOffset]; qx = otherpoints[j + keyOffset]; qy = otherpoints[j + accumulateOffset]; bottom = 0; if (px == qx) { for (m = 0; m < ps; ++m) newpoints.push(points[i + m]); newpoints[l + accumulateOffset] += qy; bottom = qy; i += ps; j += otherps; } else if (px > qx) { // we got past point below, might need to // insert interpolated extra point if (withlines && i > 0 && points[i - ps] != null) { intery = py + (points[i - ps + accumulateOffset] - py) * (qx - px) / (points[i - ps + keyOffset] - px); newpoints.push(qx); newpoints.push(intery + qy); for (m = 2; m < ps; ++m) newpoints.push(points[i + m]); bottom = qy; } j += otherps; } else { // px < qx if (fromgap && withlines) { // if we come from a gap, we just skip this point i += ps; continue; } for (m = 0; m < ps; ++m) newpoints.push(points[i + m]); // we might be able to interpolate a point below, // this can give us a better y if (withlines && j > 0 && otherpoints[j - otherps] != null) bottom = qy + (otherpoints[j - otherps + accumulateOffset] - qy) * (px - qx) / (otherpoints[j - otherps + keyOffset] - qx); newpoints[l + accumulateOffset] += bottom; i += ps; } fromgap = false; if (l != newpoints.length && withbottom) newpoints[l + 2] += bottom; } // maintain the line steps invariant if (withsteps && l != newpoints.length && l > 0 && newpoints[l] != null && newpoints[l] != newpoints[l - ps] && newpoints[l + 1] != newpoints[l - ps + 1]) { for (m = 0; m < ps; ++m) newpoints[l + ps + m] = newpoints[l + m]; newpoints[l + 1] = newpoints[l - ps + 1]; } } datapoints.points = newpoints; } plot.hooks.processDatapoints.push(stackData); } $.plot.plugins.push({ init: init, options: options, name: 'stack', version: '1.2' }); })(jQuery);
{ "pile_set_name": "Github" }
# frozen_string_literal: true class Form::TwoFactorConfirmation include ActiveModel::Model attr_accessor :otp_attempt end
{ "pile_set_name": "Github" }
/* * Vortex OpenSplice * * This software and documentation are Copyright 2006 to TO_YEAR ADLINK * Technology Limited, its affiliated companies and licensors. 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. * */ #ifndef OS_MACROSTRINGIFY_H #define OS_MACROSTRINGIFY_H #define OSPL_STRINGIFY(S) OSPL_STRINGIFY_INTERNAL(S) #define OSPL_STRINGIFY_INTERNAL(S) #S #endif
{ "pile_set_name": "Github" }
@model IEnumerable<PartsUnlimited.Models.Category> @{ ViewBag.Title = "Store"; } <section class="section-alt product-list"> <h2>Browse Categories</h2> <div class="row"> @foreach (var category in Model) { <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12"> <div class="list-item-part"> <a href="@Url.Action("Browse", "Store", new { categoryId = category.CategoryId })" title="@category.Name"> <div class="product-image-container hidden-xs"> <div class="image"> <img src="/images/@category.ImageUrl" alt="@category.Name" /> </div> <div class="detail"> <h5>@category.Name</h5> </div> </div> <div class="row visible-xs"> <div class="col-xs-4 col-sm-12 col-md-12 no-gutter-sm no-gutter image"> <img src="/images/@category.ImageUrl" alt="@category.Name" /> </div> <div class="col-xs-8 col-sm-12 col-md-12 detail"> <h4>@category.Name</h4> </div> </div> </a> </div> </div> } </div> </section>
{ "pile_set_name": "Github" }
# Add project specific ProGuard rules here. # By default, the flags in this file are appended to flags specified # in /Users/le/Library/Android/sdk/tools/proguard/proguard-android.txt # You can edit the include path and order by changing the proguardFiles # directive in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html # Add any project specific keep options here: # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -allowaccessmodification -verbose -optimizations !code/simplification/arithmetic,!field/*,field/propagation/value,!class/merging/*,!code/allocation/variable -ignorewarnings -keepattributes EnclosingMethod -keepattributes InnerClasses -dontoptimize -keep class com.ksyun.** { *; } -keep class com.ksy.statlibrary.** { *; } -keep class com.ksyun.media.shortvideo.** { *; } -keep class com.ksyun.media.kmcfilter.** { *; } -keep class com.sensetime.sensear.** { *; } -keep class com.sensetime.sensear.** { *; } -keep class com.googlecode.mp4parser.** { *; } -keep class com.mp4parser.** { *; } -keep class com.coremedia.iso.** { *; }
{ "pile_set_name": "Github" }
# KIS - How to build a binary and make a release ## WINDOWS users ### Prerequisites - For building: - Get C# runtime of version 4.0 or higher. - Create a virtual drive pointing to KSP installation: `subst q: <path to KSP root>`. I.e. if `KSP.exe` lives in `S:\Steam\Kerbal Space Program\` then this is the root. - If you choose not to do that or the drive letter is different then you also need to change `KAS.csproj` project file to correct references and post-build actions. - For making releases: - Python 2.7 or greater. - Owner or collaborator permissions in [Github repository](https://github.com/ihsoft/KAS). - Owner or maintainer permissions on [Curseforge project](http://kerbal.curseforge.com/projects/kerbal-attachment-system-kas). - Owner or maintainer permissions on [Spacedock](https://spacedock.info/mod/1987/Kerbal%20Attachment%20System%20%28KAS%29). - For development do one of the following things: - Install an open source [SharpDevelop](https://en.wikipedia.org/wiki/SharpDevelop). It will pickup existing project settings just fine but at the same time can add some new changes. Please, don't submit them into the trunk until they are really needed to build the project. - Get a free copy of [Visual Studio Express](https://www.visualstudio.com/en-US/products/visual-studio-express-vs). It should work but was not tested. ### Versioning explained Version number consists of three numbers - X.Y.Z: - X - MAJOR. A really huge change is required to affect this number. Like releasing a first version: it's always a huge change. - Y - MINOR. Adding a new functionality or removing an old one (highly discouraged) is that kind of changes. - Z - PATCH. Bugfixes, small feature requests, and internal cleanup changes. ### Building - Review file `Tools\make_binary.cmd` and ensure the path to `MSBuild` is right. - Run `Tools\make_binary.cmd` having folder `Tools` as current. - Given there were no compile errors the new DLL file can be found in `.\KAS\Plugins\Source\bin\Release\`. ### Releasing - Review file `Tools\make_binary.cmd` and ensure the path to `MSBuild` is right. - Verify that file `KAS\Plugins\Source\Properties\AssemblyInfo.cs` has correct version number. This will be the release number! - Check if file `KAS\Plugins\CHANGES.txt` has relevant information and the current version/date is properly set. This information will be used as description by the publishing scripts. - Open command-line console with folder `Tools` set as current. - Run command `KspReleaseBuilder.py -Jp`: - If it reports any errors, check them! - If no errors reported, there will be an archive created: `KAS_vX.Y.zip`. - Update release configs for every target: - See files `publish_*_args.txt`. - Ensure that authentication information is set correctly. It depends on the target. - Fix the release archive name. For now it's not handled automatically. - Commit the changes made so far into the `next` branch and create a release pull request. - ATTENTION! Make sure you're not comitting the authentication information from the publishing configs! - When ready to release, merge the PR created above. - Run the publishing scripts. The order and timing are important! 1. Run `publish_github.cmd`. It'll create draft reelase on GitHub. Go there, review, and submit it. 2. Run `publish_curseforge.cmd`. Wait for at least 3 hours before proceeding to the step #3. CurseForge is a source for the `CKAN` repository, it's best to wait till it's indexing job picks up the new version. Doing it overnight is an obvious choice. Use [this link](http://status.ksp-ckan.space/) to verify if the new version is picked up by `CKAN`. 3. Run `publish_spacedock.cmd`. This will ping all the subscribers immedeately.
{ "pile_set_name": "Github" }
// +build !appengine package app import "gnd.la/log" func (c *Context) logger() log.Interface { if c == nil || c.app.Logger == nil { return nullLogger{} } return c.app.Logger }
{ "pile_set_name": "Github" }
/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * * This source code is subject to terms and conditions of the Apache License, Version 2.0. A * copy of the license can be found in the License.html file at the root of this distribution. If * you cannot locate the Apache License, Version 2.0, please send an email to * [email protected]. By using this source code in any fashion, you are agreeing to be bound * by the terms of the Apache License, Version 2.0. * * You must not remove this notice, or any other, from this software. * * * ***************************************************************************/ #if FEATURE_FULL_CONSOLE using System.Collections.Generic; using Microsoft.Scripting.Utils; using System.Reflection; namespace Microsoft.Scripting.Hosting.Shell { public class ConsoleHostOptions { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] // TODO: fix public enum Action { None, RunConsole, RunFile, DisplayHelp } private readonly List<string> _ignoredArgs = new List<string>(); private readonly List<string> _environmentVars = new List<string>(); public List<string> IgnoredArgs { get { return _ignoredArgs; } } public string RunFile { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] // TODO: fix public string[] SourceUnitSearchPaths { get; set; } public Action RunAction { get; set; } public List<string> EnvironmentVars { get { return _environmentVars; } } public string LanguageProvider { get; set; } public bool HasLanguageProvider { get; set; } public ConsoleHostOptions() { } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1814:PreferJaggedArraysOverMultidimensional")] // TODO: fix public string[,] GetHelp() { return new string[,] { { "/help", "Displays this help." }, { "/lang:<extension>", "Specify language by the associated extension (py, js, vb, rb). Determined by an extension of the first file. Defaults to IronPython." }, { "/paths:<file-path-list>", "Semicolon separated list of import paths (/run only)." }, { "/setenv:<var1=value1;...>", "Sets specified environment variables for the console process. Not available on Silverlight." }, }; } } } #endif
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # ################################################################### # # # # BigBrotherBot(B3) (www.bigbrotherbot.net) # # Copyright (C) 2005 Michael "ThorN" Thornton # # # # This program is free software; you can redistribute it and/or # # modify it under the terms of the GNU General Public License # # as published by the Free Software Foundation; either version 2 # # of the License, or (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # # 02110-1301, USA. # # # # ################################################################### # __author__ = 'xlr8or' __version__ = '1.4.2' import b3.functions import b3.parsers.cod2 import string from b3.events import Event class Cod5Parser(b3.parsers.cod2.Cod2Parser): gameName = 'cod5' IpsOnly = False _guidLength = 8 _commands = { 'message': 'tell %(cid)s %(message)s', 'say': 'say %(message)s', 'set': 'set %(name)s "%(value)s"', 'kick': 'clientkick %(cid)s', 'ban': 'banclient %(cid)s', 'unban': 'unbanuser %(name)s', 'tempban': 'clientkick %(cid)s', 'kickbyfullname': 'kick %(cid)s' } # Next actions need translation to the EVT_CLIENT_ACTION (Treyarch has a # different approach on actions). While IW put all EVT_CLIENT_ACTION in the A; # action, Treyarch creates a different action for each EVT_CLIENT_ACTION. _actionMap = ( 'ad', # Actor Damage (dogs) 'vd', # Vehicle Damage 'bd', # Bomb Defused 'bp', # Bomb Planted 'fc', # Flag Captured 'fr', # Flag Returned 'ft', # Flag Taken 'rc', # Radio Captured 'rd' # Radio Destroyed ) #################################################################################################################### # # # PARSER INITIALIZATION # # # #################################################################################################################### def pluginsStarted(self): """ Called after the parser loaded and started all plugins. """ self.patch_b3_admin_plugin() self.debug('Admin plugin has been patched') if self.config.has_option('b3', 'guid_length'): self._guidLength = self.config.getint('b3', 'guid_length') self.info('Min guid length has been set to %s', self._guidLength) #################################################################################################################### # # # PARSING # # # #################################################################################################################### def parse_line(self, line): """ Parse a log line creating necessary events. :param line: The log line to be parsed """ m = self.getLineParts(line) if not m: return False match, action, data, client, target = m func = 'On%s' % string.capwords(action).replace(' ','') if hasattr(self, func): func = getattr(self, func) event = func(action, data, match) if event: self.queueEvent(event) elif action in self._eventMap: self.queueEvent(self.getEvent(self._eventMap[action], data=data, client=client, target=target)) elif action in self._actionMap: # addition for cod5 actionMapping self.translateAction(action, data, match) else: self.queueEvent(self.getEvent('EVT_UNKNOWN', str(action) + ': ' + str(data), client, target)) def translateAction(self, action, data, match=None): client = self.getClient(match) if not client: self.debug('No client - attempt join') self.OnJ(action, data, match) client = self.getClient(match) if not client: return None self.debug('Queueing action (translated) for %s: %s' % (client.name, action) ) self.queueEvent(self.getEvent('EVT_CLIENT_ACTION', data=action, client=client)) #################################################################################################################### # # # EVENT HANDLERS # # # #################################################################################################################### def OnK(self, action, data, match=None): victim = self.getClient(victim=match) if not victim: self.debug('No victim %s' % match.groupdict()) self.OnJ(action, data, match) return None attacker = self.getClient(attacker=match) if not attacker: self.debug('No attacker %s' % match.groupdict()) return None # COD5 first version doesn't report the team on kill, only use it if it's set # Hopefully the team has been set on another event if match.group('ateam'): attacker.team = self.getTeam(match.group('ateam')) if match.group('team'): victim.team = self.getTeam(match.group('team')) attacker.name = match.group('aname') victim.name = match.group('name') event_key = 'EVT_CLIENT_KILL' if attacker.cid == victim.cid or attacker.cid == '-1': event_key = 'EVT_CLIENT_SUICIDE' elif attacker.team != b3.TEAM_UNKNOWN and attacker.team and \ victim.team and attacker.team == victim.team and \ match.group('aweap') != 'briefcase_bomb_mp': event_key = 'EVT_CLIENT_KILL_TEAM' victim.state = b3.STATE_DEAD data = (float(match.group('damage')), match.group('aweap'), match.group('dlocation'), match.group('dtype')) return self.getEvent(event_key, data=data, client=attacker, target=victim) def OnJt(self, action, data, match=None): client = self.getClient(match) if not client: self.debug('No client - attempt join') self.OnJ(action, data, match) client = self.getClient(match) if not client: return None client.team = self.getTeam(match.group('team')) #################################################################################################################### # # # B3 PARSER INTERFACE IMPLEMENTATION # # # #################################################################################################################### def sync(self): """ For all connected players returned by self.get_player_list(), get the matching Client object from self.clients (with self.clients.get_by_cid(cid) or similar methods) and look for inconsistencies. If required call the client.disconnect() method to remove a client from self.clients. """ self.debug('Synchronizing clients') plist = self.getPlayerList(maxRetries=4) mlist = {} for cid, c in plist.iteritems(): cid = str(cid) client = self.clients.getByCID(cid) if client: if client.guid and 'guid' in c and not self.IpsOnly: if b3.functions.fuzzyGuidMatch(client.guid, c['guid']): # player matches self.debug('in-sync %s == %s', client.guid, c['guid']) mlist[str(cid)] = client else: self.debug('no-sync %s <> %s', client.guid, c['guid']) client.disconnect() elif client.ip and 'ip' in c: if client.ip == c['ip']: # player matches self.debug('in-sync %s == %s', client.ip, c['ip']) mlist[str(cid)] = client else: self.debug('no-sync %s <> %s', client.ip, c['ip']) client.disconnect() else: self.debug('no-sync: no guid or ip found') return mlist
{ "pile_set_name": "Github" }
/* * Copyright 2014, Michael Ellerman, IBM Corp. * Licensed under GPLv2. */ #include <stdio.h> #include <stdlib.h> #include "ebb.h" /* * Test basic access to the EBB regs, they should be user accessible with no * kernel interaction required. */ int reg_access(void) { uint64_t val, expected; SKIP_IF(!ebb_is_supported()); expected = 0x8000000100000000ull; mtspr(SPRN_BESCR, expected); val = mfspr(SPRN_BESCR); FAIL_IF(val != expected); expected = 0x0000000001000000ull; mtspr(SPRN_EBBHR, expected); val = mfspr(SPRN_EBBHR); FAIL_IF(val != expected); return 0; } int main(void) { return test_harness(reg_access, "reg_access"); }
{ "pile_set_name": "Github" }
--- title: Dashboard tiles in Power BI service for consumers description: All about dashboard tiles in Power BI for consumers. This includes tiles that are created from SQL Server Reporting Services (SSRS). author: mihart ms.reviewer: mihart ms.service: powerbi ms.subservice: powerbi-consumer ms.topic: how-to ms.date: 03/11/2020 ms.author: mihart LocalizationGroup: Dashboards --- # Dashboard tiles in Power BI [!INCLUDE[consumer-appliesto-yyny](../includes/consumer-appliesto-ynny.md)] [!INCLUDE [power-bi-service-new-look-include](../includes/power-bi-service-new-look-include.md)] A tile is a snapshot of your data, pinned to the dashboard by a *designer*. *Designers* can create tiles from a report, dataset, dashboard, the Q&A question box, Excel, SQL Server Reporting Services (SSRS), and more. This screenshot shows many different tiles pinned to a dashboard. ![Power BI dashboard](./media/end-user-tiles/power-bi-dash.png) Besides tiles pinned from reports, *designers* can add standalone tiles directly on the dashboard using **Add tile**. Standalone tiles include: text boxes, images, videos, streaming data, and web content. Need help understanding the building blocks that make up Power BI? See [Power BI - Basic Concepts](end-user-basic-concepts.md). ## Interacting with tiles on a dashboard 1. Hover over the tile to display the ellipses. ![tile ellipses](./media/end-user-tiles/ellipses_new.png) 2. Select the ellipses to open the tile action menu. The options available vary by visual type and method used to create the tile. Here are a few examples of what you may see. - tile created using Q&A ![ellipses icon](./media/end-user-tiles/power-bi-options-1.png) - tile created from a workbook ![ellipses icon](./media/end-user-tiles/power-bi-options-2.png) - tile created from a report ![ellipses icon](./media/end-user-tiles/power-bi-options-3.png) From here you can: * [Open the report that was used to create this tile ](end-user-reports.md) ![report icon](./media/end-user-tiles/chart-icon.jpg) * [Open the Q&A question that was used to create the tile ](end-user-reports.md) ![Q&A icon](./media/end-user-tiles/qna-icon.png) * [Open the workbook that was used to create this tile ](end-user-reports.md) ![worksheet icon](./media/end-user-tiles/power-bi-open-worksheet.png) * [View the tile in focus mode ](end-user-focus.md) ![focus icon](./media/end-user-tiles/fullscreen-icon.jpg) * [View insights ](end-user-insights.md) ![insights icon](./media/end-user-tiles/power-bi-insights.png) * [Add a comment and start a discussion](end-user-comment.md) ![comment icon](./media/end-user-tiles/comment-icons.png) * [Manage alerts set on a dashboard tile](end-user-alerts.md) ![alert icon](./media/end-user-tiles/power-bi-alert-icon.png) * [Open the data in Excel](end-user-export.md) ![export icon](./media/end-user-tiles/power-bi-export-icon.png) 3. To close the action menu, select a blank area in the canvas. ### Select (click) a tile When you select a tile, what happens next depends on how the tile was created and if it has a [custom link](../create-reports/service-dashboard-edit-tile.md). If it has a custom link, selecting the tile takes you to that link. Otherwise, selecting the tile takes you to the report, Excel Online workbook, SSRS report that is on-premises, or Q&A question that was used to create the tile. > [!NOTE] > The exception to this is video tiles created directly on the dashboard using **Add tile**. Selecting a video tile (that was created this way) causes the video to play right there on the dashboard. > > ## Considerations and troubleshooting * If the report that was used to create the visualization was not saved, then selecting the tile produces no action. * If the tile was created from a workbook in Excel Online, and you do not have at least Read permissions for that workbook, selecting the tile will not open the workbook in Excel Online. * For tiles created directly on the dashboard using **Add tile**, if a custom hyperlink has been set, selecting the title, subtitle, and or tile will open that URL. Otherwise, by default, selecting one of these tiles created directly on the dashboard for an image, web code, or text box produces no action. * If you don't have permission to the report within SSRS, selecting a tile created from SSRS will produce a page indicating you don't have access (rsAccessDenied). * If you don't have access to the network where the SSRS server is located, selecting a tile created from SSRS will product a page that will indicate it cannot locate the server (HTTP 404). Your device needs to have network access to the report server to view the report. * If the original visualization used to create the tile changes, the tile doesn't change. For example, if the *designer* pinned a line chart from a report and then changed the line chart to a bar chart, the dashboard tile continues to show a line chart. The data refreshes, but the visualization type does not. ## Next steps [Data refresh](../connect-data/refresh-data.md) [Power BI - Basic Concepts](end-user-basic-concepts.md)
{ "pile_set_name": "Github" }
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation ([email protected]) ** ** This file is part of the QtScript module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL-ONLY$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at [email protected]. ** $QT_END_LICENSE$ ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of other Qt classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // // This file was generated by qlalr - DO NOT EDIT! #ifndef QSCRIPTGRAMMAR_P_H #define QSCRIPTGRAMMAR_P_H #include <QtCore/qglobal.h> QT_BEGIN_NAMESPACE class QScriptGrammar { public: enum { EOF_SYMBOL = 0, T_AND = 1, T_AND_AND = 2, T_AND_EQ = 3, T_AUTOMATIC_SEMICOLON = 62, T_BREAK = 4, T_CASE = 5, T_CATCH = 6, T_COLON = 7, T_COMMA = 8, T_CONST = 81, T_CONTINUE = 9, T_DEBUGGER = 82, T_DEFAULT = 10, T_DELETE = 11, T_DIVIDE_ = 12, T_DIVIDE_EQ = 13, T_DO = 14, T_DOT = 15, T_ELSE = 16, T_EQ = 17, T_EQ_EQ = 18, T_EQ_EQ_EQ = 19, T_FALSE = 80, T_FINALLY = 20, T_FOR = 21, T_FUNCTION = 22, T_GE = 23, T_GT = 24, T_GT_GT = 25, T_GT_GT_EQ = 26, T_GT_GT_GT = 27, T_GT_GT_GT_EQ = 28, T_IDENTIFIER = 29, T_IF = 30, T_IN = 31, T_INSTANCEOF = 32, T_LBRACE = 33, T_LBRACKET = 34, T_LE = 35, T_LPAREN = 36, T_LT = 37, T_LT_LT = 38, T_LT_LT_EQ = 39, T_MINUS = 40, T_MINUS_EQ = 41, T_MINUS_MINUS = 42, T_NEW = 43, T_NOT = 44, T_NOT_EQ = 45, T_NOT_EQ_EQ = 46, T_NULL = 78, T_NUMERIC_LITERAL = 47, T_OR = 48, T_OR_EQ = 49, T_OR_OR = 50, T_PLUS = 51, T_PLUS_EQ = 52, T_PLUS_PLUS = 53, T_QUESTION = 54, T_RBRACE = 55, T_RBRACKET = 56, T_REMAINDER = 57, T_REMAINDER_EQ = 58, T_RESERVED_WORD = 83, T_RETURN = 59, T_RPAREN = 60, T_SEMICOLON = 61, T_STAR = 63, T_STAR_EQ = 64, T_STRING_LITERAL = 65, T_SWITCH = 66, T_THIS = 67, T_THROW = 68, T_TILDE = 69, T_TRUE = 79, T_TRY = 70, T_TYPEOF = 71, T_VAR = 72, T_VOID = 73, T_WHILE = 74, T_WITH = 75, T_XOR = 76, T_XOR_EQ = 77, ACCEPT_STATE = 237, RULE_COUNT = 269, STATE_COUNT = 468, TERMINAL_COUNT = 84, NON_TERMINAL_COUNT = 88, GOTO_INDEX_OFFSET = 468, GOTO_INFO_OFFSET = 1562, GOTO_CHECK_OFFSET = 1562 }; static const char *const spell []; static const short lhs []; static const short rhs []; #ifndef QLALR_NO_QSCRIPTGRAMMAR_DEBUG_INFO static const int rule_index []; static const int rule_info []; #endif // QLALR_NO_QSCRIPTGRAMMAR_DEBUG_INFO static const short goto_default []; static const short action_default []; static const short action_index []; static const short action_info []; static const short action_check []; static inline int nt_action (int state, int nt) { const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt; if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt) return goto_default [nt]; return action_info [GOTO_INFO_OFFSET + yyn]; } static inline int t_action (int state, int token) { const int yyn = action_index [state] + token; if (yyn < 0 || action_check [yyn] != token) return - action_default [state]; return action_info [yyn]; } }; QT_END_NAMESPACE #endif // QSCRIPTGRAMMAR_P_H
{ "pile_set_name": "Github" }
//<?php $class = e107::getBB()->getClass('color'); $aColors = array( "black" => "#000000", "blue" => "#0000FF", "brown" => "#A52A2A", "cyan" => "#00FFFF", "darkblue" => "#00008B", "darkred" => "#8B0000", "green" => "#008000", "indigo" => "#4B0082", "olive" => "#808000", "orange" => "#FFA500", "red" => "#FF0000", "violet" => "#EE82EE", "white" => "#FFFFFF", "yellow" => "#FFFF00", "aqua" => "#00FFFF", "fuchsia" => "#FF00FF", "gray" => "#808080", "lime" => "#00FF00", "maroon" => "#800000", "navy" => "#000080", "purple" => "#800080", "silver" => "#C0C0C0", "teal" => "#008080" ); if(array_key_exists($parm, $aColors)) { return "<span class='{$class}' style='color:{$aColors[$parm]}'>$code_text</span>"; } else { if(preg_match("/(#[a-fA-F0-9]{3,12})/", $parm, $matches)) { return "<span class='{$class}' style='color:{$matches[1]};'>$code_text</span>"; } if(preg_match("/([a-zA-Z]{3,20})/", $parm, $matches)) // support color names http://www.w3schools.com/colors/colors_names.asp { return "<span class='{$class}' style='color:{$matches[1]};'>$code_text</span>"; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <ArrayOfTransponder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Transponder> <CarrierFrequency>3644000</CarrierFrequency> <Polarisation>CircularR</Polarisation> <SymbolRate>8545</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate2_3</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>3654000</CarrierFrequency> <Polarisation>CircularR</Polarisation> <SymbolRate>5632</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate3_4</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>3760000</CarrierFrequency> <Polarisation>CircularL</Polarisation> <SymbolRate>2790</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate7_8</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>3775000</CarrierFrequency> <Polarisation>CircularR</Polarisation> <SymbolRate>1438</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate2_3</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>3884000</CarrierFrequency> <Polarisation>CircularL</Polarisation> <SymbolRate>4900</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate1_2</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>3893000</CarrierFrequency> <Polarisation>CircularL</Polarisation> <SymbolRate>3072</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate1_2</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>3900000</CarrierFrequency> <Polarisation>CircularL</Polarisation> <SymbolRate>3800</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate1_2</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>4039000</CarrierFrequency> <Polarisation>CircularL</Polarisation> <SymbolRate>2034</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate2_3</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>4044000</CarrierFrequency> <Polarisation>CircularL</Polarisation> <SymbolRate>2848</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate3_4</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>4066000</CarrierFrequency> <Polarisation>CircularL</Polarisation> <SymbolRate>2848</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate2_3</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>4094000</CarrierFrequency> <Polarisation>CircularL</Polarisation> <SymbolRate>3680</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate2_3</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>4185000</CarrierFrequency> <Polarisation>CircularR</Polarisation> <SymbolRate>2532</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate3_4</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>11127000</CarrierFrequency> <Polarisation>LinearV</Polarisation> <SymbolRate>4000</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate3_4</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>11134000</CarrierFrequency> <Polarisation>LinearV</Polarisation> <SymbolRate>4000</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate3_4</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>11140000</CarrierFrequency> <Polarisation>LinearV</Polarisation> <SymbolRate>4000</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate3_4</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>11146000</CarrierFrequency> <Polarisation>LinearV</Polarisation> <SymbolRate>4000</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate3_4</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>11152000</CarrierFrequency> <Polarisation>LinearV</Polarisation> <SymbolRate>4000</SymbolRate> <Modulation>ModNotSet</Modulation> <InnerFecRate>Rate3_4</InnerFecRate> <Pilot>NotSet</Pilot> <Rolloff>NotSet</Rolloff> </Transponder> <Transponder> <CarrierFrequency>10990000</CarrierFrequency> <Polarisation>LinearV</Polarisation> <SymbolRate>53000</SymbolRate> <Modulation>ModQpsk</Modulation> <InnerFecRate>Rate3_4</InnerFecRate> <Pilot>Off</Pilot> <Rolloff>ThirtyFive</Rolloff> </Transponder> </ArrayOfTransponder>
{ "pile_set_name": "Github" }
/* jsTree default dark theme */ .jstree-node, .jstree-children, .jstree-container-ul { display: block; margin: 0; padding: 0; list-style-type: none; list-style-image: none; } .jstree-node { white-space: nowrap; } .jstree-anchor { display: inline-block; color: black; white-space: nowrap; padding: 0 4px 0 1px; margin: 0; vertical-align: top; } .jstree-anchor:focus { outline: 0; } .jstree-anchor, .jstree-anchor:link, .jstree-anchor:visited, .jstree-anchor:hover, .jstree-anchor:active { text-decoration: none; color: inherit; } .jstree-icon { display: inline-block; text-decoration: none; margin: 0; padding: 0; vertical-align: top; text-align: center; } .jstree-icon:empty { display: inline-block; text-decoration: none; margin: 0; padding: 0; vertical-align: top; text-align: center; } .jstree-ocl { cursor: pointer; } .jstree-leaf > .jstree-ocl { cursor: default; } .jstree .jstree-open > .jstree-children { display: block; } .jstree .jstree-closed > .jstree-children, .jstree .jstree-leaf > .jstree-children { display: none; } .jstree-anchor > .jstree-themeicon { margin-right: 2px; } .jstree-no-icons .jstree-themeicon, .jstree-anchor > .jstree-themeicon-hidden { display: none; } .jstree-hidden { display: none; } .jstree-rtl .jstree-anchor { padding: 0 1px 0 4px; } .jstree-rtl .jstree-anchor > .jstree-themeicon { margin-left: 2px; margin-right: 0; } .jstree-rtl .jstree-node { margin-left: 0; } .jstree-rtl .jstree-container-ul > .jstree-node { margin-right: 0; } .jstree-wholerow-ul { position: relative; display: inline-block; min-width: 100%; } .jstree-wholerow-ul .jstree-leaf > .jstree-ocl { cursor: pointer; } .jstree-wholerow-ul .jstree-anchor, .jstree-wholerow-ul .jstree-icon { position: relative; } .jstree-wholerow-ul .jstree-wholerow { width: 100%; cursor: pointer; position: absolute; left: 0; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .vakata-context { display: none; } .vakata-context, .vakata-context ul { margin: 0; padding: 2px; position: absolute; background: #f5f5f5; border: 1px solid #979797; box-shadow: 2px 2px 2px #999999; } .vakata-context ul { list-style: none; left: 100%; margin-top: -2.7em; margin-left: -4px; } .vakata-context .vakata-context-right ul { left: auto; right: 100%; margin-left: auto; margin-right: -4px; } .vakata-context li { list-style: none; display: inline; } .vakata-context li > a { display: block; padding: 0 2em 0 2em; text-decoration: none; width: auto; color: black; white-space: nowrap; line-height: 2.4em; text-shadow: 1px 1px 0 white; border-radius: 1px; } .vakata-context li > a:hover { position: relative; background-color: #e8eff7; box-shadow: 0 0 2px #0a6aa1; } .vakata-context li > a.vakata-context-parent { background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw=="); background-position: right center; background-repeat: no-repeat; } .vakata-context li > a:focus { outline: 0; } .vakata-context .vakata-context-hover > a { position: relative; background-color: #e8eff7; box-shadow: 0 0 2px #0a6aa1; } .vakata-context .vakata-context-separator > a, .vakata-context .vakata-context-separator > a:hover { background: white; border: 0; border-top: 1px solid #e2e3e3; height: 1px; min-height: 1px; max-height: 1px; padding: 0; margin: 0 0 0 2.4em; border-left: 1px solid #e0e0e0; text-shadow: 0 0 0 transparent; box-shadow: 0 0 0 transparent; border-radius: 0; } .vakata-context .vakata-contextmenu-disabled a, .vakata-context .vakata-contextmenu-disabled a:hover { color: silver; background-color: transparent; border: 0; box-shadow: 0 0 0; } .vakata-context li > a > i { text-decoration: none; display: inline-block; width: 2.4em; height: 2.4em; background: transparent; margin: 0 0 0 -2em; vertical-align: top; text-align: center; line-height: 2.4em; } .vakata-context li > a > i:empty { width: 2.4em; line-height: 2.4em; } .vakata-context li > a .vakata-contextmenu-sep { display: inline-block; width: 1px; height: 2.4em; background: white; margin: 0 0.5em 0 0; border-left: 1px solid #e2e3e3; } .vakata-context .vakata-contextmenu-shortcut { font-size: 0.8em; color: silver; opacity: 0.5; display: none; } .vakata-context-rtl ul { left: auto; right: 100%; margin-left: auto; margin-right: -4px; } .vakata-context-rtl li > a.vakata-context-parent { background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7"); background-position: left center; background-repeat: no-repeat; } .vakata-context-rtl .vakata-context-separator > a { margin: 0 2.4em 0 0; border-left: 0; border-right: 1px solid #e2e3e3; } .vakata-context-rtl .vakata-context-left ul { right: auto; left: 100%; margin-left: -4px; margin-right: auto; } .vakata-context-rtl li > a > i { margin: 0 -2em 0 0; } .vakata-context-rtl li > a .vakata-contextmenu-sep { margin: 0 0 0 0.5em; border-left-color: white; background: #e2e3e3; } #jstree-marker { position: absolute; top: 0; left: 0; margin: -5px 0 0 0; padding: 0; border-right: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 5px solid; width: 0; height: 0; font-size: 0; line-height: 0; } #jstree-dnd { line-height: 16px; margin: 0; padding: 4px; } #jstree-dnd .jstree-icon, #jstree-dnd .jstree-copy { display: inline-block; text-decoration: none; margin: 0 2px 0 0; padding: 0; width: 16px; height: 16px; } #jstree-dnd .jstree-ok { background: green; } #jstree-dnd .jstree-er { background: red; } #jstree-dnd .jstree-copy { margin: 0 2px 0 2px; } .jstree-default-dark .jstree-node, .jstree-default-dark .jstree-icon { background-repeat: no-repeat; background-color: transparent; } .jstree-default-dark .jstree-anchor, .jstree-default-dark .jstree-wholerow { transition: background-color 0.15s, box-shadow 0.15s; } .jstree-default-dark .jstree-hovered { background: #555555; border-radius: 2px; box-shadow: inset 0 0 1px #555555; } .jstree-default-dark .jstree-clicked { background: #5fa2db; border-radius: 2px; box-shadow: inset 0 0 1px #666666; } .jstree-default-dark .jstree-no-icons .jstree-anchor > .jstree-themeicon { display: none; } .jstree-default-dark .jstree-disabled { background: transparent; color: #666666; } .jstree-default-dark .jstree-disabled.jstree-hovered { background: transparent; box-shadow: none; } .jstree-default-dark .jstree-disabled.jstree-clicked { background: #333333; } .jstree-default-dark .jstree-disabled > .jstree-icon { opacity: 0.8; filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'jstree-grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#jstree-grayscale"); /* Firefox 10+ */ filter: gray; /* IE6-9 */ -webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */ } .jstree-default-dark .jstree-search { font-style: italic; color: #ffffff; font-weight: bold; } .jstree-default-dark .jstree-no-checkboxes .jstree-checkbox { display: none !important; } .jstree-default-dark.jstree-checkbox-no-clicked .jstree-clicked { background: transparent; box-shadow: none; } .jstree-default-dark.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered { background: #555555; } .jstree-default-dark.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked { background: transparent; } .jstree-default-dark.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered { background: #555555; } .jstree-default-dark > .jstree-striped { min-width: 100%; display: inline-block; background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==") left top repeat; } .jstree-default-dark > .jstree-wholerow-ul .jstree-hovered, .jstree-default-dark > .jstree-wholerow-ul .jstree-clicked { background: transparent; box-shadow: none; border-radius: 0; } .jstree-default-dark .jstree-wholerow { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .jstree-default-dark .jstree-wholerow-hovered { background: #555555; } .jstree-default-dark .jstree-wholerow-clicked { background: #5fa2db; background: -webkit-linear-gradient(top, #5fa2db 0%, #5fa2db 100%); background: linear-gradient(to bottom, #5fa2db 0%, #5fa2db 100%); } .jstree-default-dark .jstree-node { min-height: 24px; line-height: 24px; margin-left: 24px; min-width: 24px; } .jstree-default-dark .jstree-anchor { line-height: 24px; height: 24px; } .jstree-default-dark .jstree-icon { width: 24px; height: 24px; line-height: 24px; } .jstree-default-dark .jstree-icon:empty { width: 24px; height: 24px; line-height: 24px; } .jstree-default-dark.jstree-rtl .jstree-node { margin-right: 24px; } .jstree-default-dark .jstree-wholerow { height: 24px; } .jstree-default-dark .jstree-node, .jstree-default-dark .jstree-icon { background-image: url("32px.png"); } .jstree-default-dark .jstree-node { background-position: -292px -4px; background-repeat: repeat-y; } .jstree-default-dark .jstree-last { background: transparent; } .jstree-default-dark .jstree-open > .jstree-ocl { background-position: -132px -4px; } .jstree-default-dark .jstree-closed > .jstree-ocl { background-position: -100px -4px; } .jstree-default-dark .jstree-leaf > .jstree-ocl { background-position: -68px -4px; } .jstree-default-dark .jstree-themeicon { background-position: -260px -4px; } .jstree-default-dark > .jstree-no-dots .jstree-node, .jstree-default-dark > .jstree-no-dots .jstree-leaf > .jstree-ocl { background: transparent; } .jstree-default-dark > .jstree-no-dots .jstree-open > .jstree-ocl { background-position: -36px -4px; } .jstree-default-dark > .jstree-no-dots .jstree-closed > .jstree-ocl { background-position: -4px -4px; } .jstree-default-dark .jstree-disabled { background: transparent; } .jstree-default-dark .jstree-disabled.jstree-hovered { background: transparent; } .jstree-default-dark .jstree-disabled.jstree-clicked { background: #efefef; } .jstree-default-dark .jstree-checkbox { background-position: -164px -4px; } .jstree-default-dark .jstree-checkbox:hover { background-position: -164px -36px; } .jstree-default-dark.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, .jstree-default-dark .jstree-checked > .jstree-checkbox { background-position: -228px -4px; } .jstree-default-dark.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, .jstree-default-dark .jstree-checked > .jstree-checkbox:hover { background-position: -228px -36px; } .jstree-default-dark .jstree-anchor > .jstree-undetermined { background-position: -196px -4px; } .jstree-default-dark .jstree-anchor > .jstree-undetermined:hover { background-position: -196px -36px; } .jstree-default-dark .jstree-checkbox-disabled { opacity: 0.8; filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'jstree-grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#jstree-grayscale"); /* Firefox 10+ */ filter: gray; /* IE6-9 */ -webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */ } .jstree-default-dark > .jstree-striped { background-size: auto 48px; } .jstree-default-dark.jstree-rtl .jstree-node { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); background-position: 100% 1px; background-repeat: repeat-y; } .jstree-default-dark.jstree-rtl .jstree-last { background: transparent; } .jstree-default-dark.jstree-rtl .jstree-open > .jstree-ocl { background-position: -132px -36px; } .jstree-default-dark.jstree-rtl .jstree-closed > .jstree-ocl { background-position: -100px -36px; } .jstree-default-dark.jstree-rtl .jstree-leaf > .jstree-ocl { background-position: -68px -36px; } .jstree-default-dark.jstree-rtl > .jstree-no-dots .jstree-node, .jstree-default-dark.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { background: transparent; } .jstree-default-dark.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { background-position: -36px -36px; } .jstree-default-dark.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { background-position: -4px -36px; } .jstree-default-dark .jstree-themeicon-custom { background-color: transparent; background-image: none; background-position: 0 0; } .jstree-default-dark > .jstree-container-ul .jstree-loading > .jstree-ocl { background: url("throbber.gif") center center no-repeat; } .jstree-default-dark .jstree-file { background: url("32px.png") -100px -68px no-repeat; } .jstree-default-dark .jstree-folder { background: url("32px.png") -260px -4px no-repeat; } .jstree-default-dark > .jstree-container-ul > .jstree-node { margin-left: 0; margin-right: 0; } #jstree-dnd.jstree-default-dark { line-height: 24px; padding: 0 4px; } #jstree-dnd.jstree-default-dark .jstree-ok, #jstree-dnd.jstree-default-dark .jstree-er { background-image: url("32px.png"); background-repeat: no-repeat; background-color: transparent; } #jstree-dnd.jstree-default-dark i { background: transparent; width: 24px; height: 24px; line-height: 24px; } #jstree-dnd.jstree-default-dark .jstree-ok { background-position: -4px -68px; } #jstree-dnd.jstree-default-dark .jstree-er { background-position: -36px -68px; } .jstree-default-dark.jstree-rtl .jstree-node { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); } .jstree-default-dark.jstree-rtl .jstree-last { background: transparent; } .jstree-default-dark-small .jstree-node { min-height: 18px; line-height: 18px; margin-left: 18px; min-width: 18px; } .jstree-default-dark-small .jstree-anchor { line-height: 18px; height: 18px; } .jstree-default-dark-small .jstree-icon { width: 18px; height: 18px; line-height: 18px; } .jstree-default-dark-small .jstree-icon:empty { width: 18px; height: 18px; line-height: 18px; } .jstree-default-dark-small.jstree-rtl .jstree-node { margin-right: 18px; } .jstree-default-dark-small .jstree-wholerow { height: 18px; } .jstree-default-dark-small .jstree-node, .jstree-default-dark-small .jstree-icon { background-image: url("32px.png"); } .jstree-default-dark-small .jstree-node { background-position: -295px -7px; background-repeat: repeat-y; } .jstree-default-dark-small .jstree-last { background: transparent; } .jstree-default-dark-small .jstree-open > .jstree-ocl { background-position: -135px -7px; } .jstree-default-dark-small .jstree-closed > .jstree-ocl { background-position: -103px -7px; } .jstree-default-dark-small .jstree-leaf > .jstree-ocl { background-position: -71px -7px; } .jstree-default-dark-small .jstree-themeicon { background-position: -263px -7px; } .jstree-default-dark-small > .jstree-no-dots .jstree-node, .jstree-default-dark-small > .jstree-no-dots .jstree-leaf > .jstree-ocl { background: transparent; } .jstree-default-dark-small > .jstree-no-dots .jstree-open > .jstree-ocl { background-position: -39px -7px; } .jstree-default-dark-small > .jstree-no-dots .jstree-closed > .jstree-ocl { background-position: -7px -7px; } .jstree-default-dark-small .jstree-disabled { background: transparent; } .jstree-default-dark-small .jstree-disabled.jstree-hovered { background: transparent; } .jstree-default-dark-small .jstree-disabled.jstree-clicked { background: #efefef; } .jstree-default-dark-small .jstree-checkbox { background-position: -167px -7px; } .jstree-default-dark-small .jstree-checkbox:hover { background-position: -167px -39px; } .jstree-default-dark-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, .jstree-default-dark-small .jstree-checked > .jstree-checkbox { background-position: -231px -7px; } .jstree-default-dark-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, .jstree-default-dark-small .jstree-checked > .jstree-checkbox:hover { background-position: -231px -39px; } .jstree-default-dark-small .jstree-anchor > .jstree-undetermined { background-position: -199px -7px; } .jstree-default-dark-small .jstree-anchor > .jstree-undetermined:hover { background-position: -199px -39px; } .jstree-default-dark-small .jstree-checkbox-disabled { opacity: 0.8; filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'jstree-grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#jstree-grayscale"); /* Firefox 10+ */ filter: gray; /* IE6-9 */ -webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */ } .jstree-default-dark-small > .jstree-striped { background-size: auto 36px; } .jstree-default-dark-small.jstree-rtl .jstree-node { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); background-position: 100% 1px; background-repeat: repeat-y; } .jstree-default-dark-small.jstree-rtl .jstree-last { background: transparent; } .jstree-default-dark-small.jstree-rtl .jstree-open > .jstree-ocl { background-position: -135px -39px; } .jstree-default-dark-small.jstree-rtl .jstree-closed > .jstree-ocl { background-position: -103px -39px; } .jstree-default-dark-small.jstree-rtl .jstree-leaf > .jstree-ocl { background-position: -71px -39px; } .jstree-default-dark-small.jstree-rtl > .jstree-no-dots .jstree-node, .jstree-default-dark-small.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { background: transparent; } .jstree-default-dark-small.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { background-position: -39px -39px; } .jstree-default-dark-small.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { background-position: -7px -39px; } .jstree-default-dark-small .jstree-themeicon-custom { background-color: transparent; background-image: none; background-position: 0 0; } .jstree-default-dark-small > .jstree-container-ul .jstree-loading > .jstree-ocl { background: url("throbber.gif") center center no-repeat; } .jstree-default-dark-small .jstree-file { background: url("32px.png") -103px -71px no-repeat; } .jstree-default-dark-small .jstree-folder { background: url("32px.png") -263px -7px no-repeat; } .jstree-default-dark-small > .jstree-container-ul > .jstree-node { margin-left: 0; margin-right: 0; } #jstree-dnd.jstree-default-dark-small { line-height: 18px; padding: 0 4px; } #jstree-dnd.jstree-default-dark-small .jstree-ok, #jstree-dnd.jstree-default-dark-small .jstree-er { background-image: url("32px.png"); background-repeat: no-repeat; background-color: transparent; } #jstree-dnd.jstree-default-dark-small i { background: transparent; width: 18px; height: 18px; line-height: 18px; } #jstree-dnd.jstree-default-dark-small .jstree-ok { background-position: -7px -71px; } #jstree-dnd.jstree-default-dark-small .jstree-er { background-position: -39px -71px; } .jstree-default-dark-small.jstree-rtl .jstree-node { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg=="); } .jstree-default-dark-small.jstree-rtl .jstree-last { background: transparent; } .jstree-default-dark-large .jstree-node { min-height: 32px; line-height: 32px; margin-left: 32px; min-width: 32px; } .jstree-default-dark-large .jstree-anchor { line-height: 32px; height: 32px; } .jstree-default-dark-large .jstree-icon { width: 32px; height: 32px; line-height: 32px; } .jstree-default-dark-large .jstree-icon:empty { width: 32px; height: 32px; line-height: 32px; } .jstree-default-dark-large.jstree-rtl .jstree-node { margin-right: 32px; } .jstree-default-dark-large .jstree-wholerow { height: 32px; } .jstree-default-dark-large .jstree-node, .jstree-default-dark-large .jstree-icon { background-image: url("32px.png"); } .jstree-default-dark-large .jstree-node { background-position: -288px 0px; background-repeat: repeat-y; } .jstree-default-dark-large .jstree-last { background: transparent; } .jstree-default-dark-large .jstree-open > .jstree-ocl { background-position: -128px 0px; } .jstree-default-dark-large .jstree-closed > .jstree-ocl { background-position: -96px 0px; } .jstree-default-dark-large .jstree-leaf > .jstree-ocl { background-position: -64px 0px; } .jstree-default-dark-large .jstree-themeicon { background-position: -256px 0px; } .jstree-default-dark-large > .jstree-no-dots .jstree-node, .jstree-default-dark-large > .jstree-no-dots .jstree-leaf > .jstree-ocl { background: transparent; } .jstree-default-dark-large > .jstree-no-dots .jstree-open > .jstree-ocl { background-position: -32px 0px; } .jstree-default-dark-large > .jstree-no-dots .jstree-closed > .jstree-ocl { background-position: 0px 0px; } .jstree-default-dark-large .jstree-disabled { background: transparent; } .jstree-default-dark-large .jstree-disabled.jstree-hovered { background: transparent; } .jstree-default-dark-large .jstree-disabled.jstree-clicked { background: #efefef; } .jstree-default-dark-large .jstree-checkbox { background-position: -160px 0px; } .jstree-default-dark-large .jstree-checkbox:hover { background-position: -160px -32px; } .jstree-default-dark-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, .jstree-default-dark-large .jstree-checked > .jstree-checkbox { background-position: -224px 0px; } .jstree-default-dark-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, .jstree-default-dark-large .jstree-checked > .jstree-checkbox:hover { background-position: -224px -32px; } .jstree-default-dark-large .jstree-anchor > .jstree-undetermined { background-position: -192px 0px; } .jstree-default-dark-large .jstree-anchor > .jstree-undetermined:hover { background-position: -192px -32px; } .jstree-default-dark-large .jstree-checkbox-disabled { opacity: 0.8; filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'jstree-grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#jstree-grayscale"); /* Firefox 10+ */ filter: gray; /* IE6-9 */ -webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */ } .jstree-default-dark-large > .jstree-striped { background-size: auto 64px; } .jstree-default-dark-large.jstree-rtl .jstree-node { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); background-position: 100% 1px; background-repeat: repeat-y; } .jstree-default-dark-large.jstree-rtl .jstree-last { background: transparent; } .jstree-default-dark-large.jstree-rtl .jstree-open > .jstree-ocl { background-position: -128px -32px; } .jstree-default-dark-large.jstree-rtl .jstree-closed > .jstree-ocl { background-position: -96px -32px; } .jstree-default-dark-large.jstree-rtl .jstree-leaf > .jstree-ocl { background-position: -64px -32px; } .jstree-default-dark-large.jstree-rtl > .jstree-no-dots .jstree-node, .jstree-default-dark-large.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { background: transparent; } .jstree-default-dark-large.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { background-position: -32px -32px; } .jstree-default-dark-large.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { background-position: 0px -32px; } .jstree-default-dark-large .jstree-themeicon-custom { background-color: transparent; background-image: none; background-position: 0 0; } .jstree-default-dark-large > .jstree-container-ul .jstree-loading > .jstree-ocl { background: url("throbber.gif") center center no-repeat; } .jstree-default-dark-large .jstree-file { background: url("32px.png") -96px -64px no-repeat; } .jstree-default-dark-large .jstree-folder { background: url("32px.png") -256px 0px no-repeat; } .jstree-default-dark-large > .jstree-container-ul > .jstree-node { margin-left: 0; margin-right: 0; } #jstree-dnd.jstree-default-dark-large { line-height: 32px; padding: 0 4px; } #jstree-dnd.jstree-default-dark-large .jstree-ok, #jstree-dnd.jstree-default-dark-large .jstree-er { background-image: url("32px.png"); background-repeat: no-repeat; background-color: transparent; } #jstree-dnd.jstree-default-dark-large i { background: transparent; width: 32px; height: 32px; line-height: 32px; } #jstree-dnd.jstree-default-dark-large .jstree-ok { background-position: 0px -64px; } #jstree-dnd.jstree-default-dark-large .jstree-er { background-position: -32px -64px; } .jstree-default-dark-large.jstree-rtl .jstree-node { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg=="); } .jstree-default-dark-large.jstree-rtl .jstree-last { background: transparent; } @media (max-width: 768px) { #jstree-dnd.jstree-dnd-responsive { line-height: 40px; font-weight: bold; font-size: 1.1em; text-shadow: 1px 1px white; } #jstree-dnd.jstree-dnd-responsive > i { background: transparent; width: 40px; height: 40px; } #jstree-dnd.jstree-dnd-responsive > .jstree-ok { background-image: url("40px.png"); background-position: 0 -200px; background-size: 120px 240px; } #jstree-dnd.jstree-dnd-responsive > .jstree-er { background-image: url("40px.png"); background-position: -40px -200px; background-size: 120px 240px; } #jstree-marker.jstree-dnd-responsive { border-left-width: 10px; border-top-width: 10px; border-bottom-width: 10px; margin-top: -10px; } } @media (max-width: 768px) { .jstree-default-dark-responsive { /* .jstree-open > .jstree-ocl, .jstree-closed > .jstree-ocl { border-radius:20px; background-color:white; } */ } .jstree-default-dark-responsive .jstree-icon { background-image: url("40px.png"); } .jstree-default-dark-responsive .jstree-node, .jstree-default-dark-responsive .jstree-leaf > .jstree-ocl { background: transparent; } .jstree-default-dark-responsive .jstree-node { min-height: 40px; line-height: 40px; margin-left: 40px; min-width: 40px; white-space: nowrap; } .jstree-default-dark-responsive .jstree-anchor { line-height: 40px; height: 40px; } .jstree-default-dark-responsive .jstree-icon, .jstree-default-dark-responsive .jstree-icon:empty { width: 40px; height: 40px; line-height: 40px; } .jstree-default-dark-responsive > .jstree-container-ul > .jstree-node { margin-left: 0; } .jstree-default-dark-responsive.jstree-rtl .jstree-node { margin-left: 0; margin-right: 40px; } .jstree-default-dark-responsive.jstree-rtl .jstree-container-ul > .jstree-node { margin-right: 0; } .jstree-default-dark-responsive .jstree-ocl, .jstree-default-dark-responsive .jstree-themeicon, .jstree-default-dark-responsive .jstree-checkbox { background-size: 120px 240px; } .jstree-default-dark-responsive .jstree-leaf > .jstree-ocl { background: transparent; } .jstree-default-dark-responsive .jstree-open > .jstree-ocl { background-position: 0 0px !important; } .jstree-default-dark-responsive .jstree-closed > .jstree-ocl { background-position: 0 -40px !important; } .jstree-default-dark-responsive.jstree-rtl .jstree-closed > .jstree-ocl { background-position: -40px 0px !important; } .jstree-default-dark-responsive .jstree-themeicon { background-position: -40px -40px; } .jstree-default-dark-responsive .jstree-checkbox, .jstree-default-dark-responsive .jstree-checkbox:hover { background-position: -40px -80px; } .jstree-default-dark-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, .jstree-default-dark-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, .jstree-default-dark-responsive .jstree-checked > .jstree-checkbox, .jstree-default-dark-responsive .jstree-checked > .jstree-checkbox:hover { background-position: 0 -80px; } .jstree-default-dark-responsive .jstree-anchor > .jstree-undetermined, .jstree-default-dark-responsive .jstree-anchor > .jstree-undetermined:hover { background-position: 0 -120px; } .jstree-default-dark-responsive .jstree-anchor { font-weight: bold; font-size: 1.1em; text-shadow: 1px 1px white; } .jstree-default-dark-responsive > .jstree-striped { background: transparent; } .jstree-default-dark-responsive .jstree-wholerow { border-top: 1px solid #666666; border-bottom: 1px solid #000000; background: #333333; height: 40px; } .jstree-default-dark-responsive .jstree-wholerow-hovered { background: #555555; } .jstree-default-dark-responsive .jstree-wholerow-clicked { background: #5fa2db; } .jstree-default-dark-responsive .jstree-children .jstree-last > .jstree-wholerow { box-shadow: inset 0 -6px 3px -5px #111111; } .jstree-default-dark-responsive .jstree-children .jstree-open > .jstree-wholerow { box-shadow: inset 0 6px 3px -5px #111111; border-top: 0; } .jstree-default-dark-responsive .jstree-children .jstree-open + .jstree-open { box-shadow: none; } .jstree-default-dark-responsive .jstree-node, .jstree-default-dark-responsive .jstree-icon, .jstree-default-dark-responsive .jstree-node > .jstree-ocl, .jstree-default-dark-responsive .jstree-themeicon, .jstree-default-dark-responsive .jstree-checkbox { background-image: url("40px.png"); background-size: 120px 240px; } .jstree-default-dark-responsive .jstree-node { background-position: -80px 0; background-repeat: repeat-y; } .jstree-default-dark-responsive .jstree-last { background: transparent; } .jstree-default-dark-responsive .jstree-leaf > .jstree-ocl { background-position: -40px -120px; } .jstree-default-dark-responsive .jstree-last > .jstree-ocl { background-position: -40px -160px; } .jstree-default-dark-responsive .jstree-themeicon-custom { background-color: transparent; background-image: none; background-position: 0 0; } .jstree-default-dark-responsive .jstree-file { background: url("40px.png") 0 -160px no-repeat; background-size: 120px 240px; } .jstree-default-dark-responsive .jstree-folder { background: url("40px.png") -40px -40px no-repeat; background-size: 120px 240px; } .jstree-default-dark-responsive > .jstree-container-ul > .jstree-node { margin-left: 0; margin-right: 0; } } .jstree-default-dark { background: #333; } .jstree-default-dark .jstree-anchor { color: #999; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5); } .jstree-default-dark .jstree-clicked, .jstree-default-dark .jstree-checked { color: white; } .jstree-default-dark .jstree-hovered { color: white; } #jstree-marker.jstree-default-dark { border-left-color: #999; background: transparent; } .jstree-default-dark .jstree-anchor > .jstree-icon { opacity: 0.75; } .jstree-default-dark .jstree-clicked > .jstree-icon, .jstree-default-dark .jstree-hovered > .jstree-icon, .jstree-default-dark .jstree-checked > .jstree-icon { opacity: 1; } .jstree-default-dark.jstree-rtl .jstree-node { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); } .jstree-default-dark.jstree-rtl .jstree-last { background: transparent; } .jstree-default-dark-small.jstree-rtl .jstree-node { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg=="); } .jstree-default-dark-small.jstree-rtl .jstree-last { background: transparent; } .jstree-default-dark-large.jstree-rtl .jstree-node { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg=="); } .jstree-default-dark-large.jstree-rtl .jstree-last { background: transparent; }
{ "pile_set_name": "Github" }
<?php /** * Smarty Internal Plugin Filter Handler * * Smarty filter handler class * * @package Smarty * @subpackage PluginsInternal * @author Uwe Tews */ /** * Class for filter processing * * @package Smarty * @subpackage PluginsInternal */ class Smarty_Internal_Filter_Handler { /** * Run filters over content * * The filters will be lazy loaded if required * class name format: Smarty_FilterType_FilterName * plugin filename format: filtertype.filtername.php * Smarty2 filter plugins could be used * * @param string $type the type of filter ('pre','post','output') which shall run * @param string $content the content which shall be processed by the filters * @param Smarty_Internal_Template $template template object * @return string the filtered content */ public static function runFilter($type, $content, Smarty_Internal_Template $template) { $output = $content; // loop over autoload filters of specified type if (!empty($template->smarty->autoload_filters[$type])) { foreach ((array)$template->smarty->autoload_filters[$type] as $name) { $plugin_name = "Smarty_{$type}filter_{$name}"; if ($template->smarty->loadPlugin($plugin_name)) { if (function_exists($plugin_name)) { // use loaded Smarty2 style plugin $output = $plugin_name($output, $template); } elseif (class_exists($plugin_name, false)) { // loaded class of filter plugin $output = call_user_func(array($plugin_name, 'execute'), $output, $template); } } else { // nothing found, throw exception throw new SmartyException("Unable to load filter {$plugin_name}"); } } } // loop over registerd filters of specified type if (!empty($template->smarty->registered_filters[$type])) { foreach ($template->smarty->registered_filters[$type] as $key => $name) { if (is_array($template->smarty->registered_filters[$type][$key])) { $output = call_user_func($template->smarty->registered_filters[$type][$key], $output, $template); } else { $output = $template->smarty->registered_filters[$type][$key]($output, $template); } } } // return filtered output return $output; } } ?>
{ "pile_set_name": "Github" }
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/unisims/FDE.v,v 1.8.38.1 2005/11/02 19:31:18 yanx Exp $ /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 1995/2004 Xilinx, Inc. // All Right Reserved. /////////////////////////////////////////////////////////////////////////////// // ____ ____ // / /\/ / // /___/ \ / Vendor : Xilinx // \ \ \/ Version : 8.1i (I.24) // \ \ Description : Xilinx Functional Simulation Library Component // / / D Flip-Flop with Clock Enable // /___/ /\ Filename : FDE.v // \ \ / \ Timestamp : Thu Mar 25 16:42:17 PST 2004 // \___\/\___\ // // Revision: // 03/23/04 - Initial version. // 02/04/05 - Rev 0.0.1 Remove input/output bufs; Seperate GSR from clock block. // 10/20/05 - Add set & reset check to main block. (CR219794) // End Revision `timescale 1 ps / 1 ps module FDE (Q, C, CE, D); parameter INIT = 1'b0; output Q; reg Q; input C, CE, D; tri0 GSR = glbl.GSR; initial Q = 0; always @(GSR) if (GSR) assign Q = INIT; else deassign Q; always @(posedge C) if (GSR== 0 && CE ==1) if (CE) Q <= #100 D; endmodule
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <!-- 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. --> <?xml-stylesheet type="text/xsl" href="./xdoc.xsl"?> <!-- $Revision$ $Date$ --> <document url="utilities.html"> <properties> <title>The Commons Math User Guide - Utilites</title> </properties> <body> <section name="6 Utilities"> <subsection name="6.1 Overview" href="overview"> <p> The <a href="../apidocs/org/apache/commons/math/util/package-summary.html"> org.apache.commons.math.util</a> package collects a group of array utilities, value transformers, and numerical routines used by implementation classes in commons-math. </p> </subsection> <subsection name="6.2 Double array utilities" href="arrays"> <p> To maintain statistics based on a "rolling" window of values, a resizable array implementation was developed and is provided for reuse in the <code>util</code> package. The core functionality provided is described in the documentation for the interface, <a href="../apidocs/org/apache/commons/math/util/DoubleArray.html"> DoubleArray</a>. This interface adds one method, <code>addElementRolling(double)</code> to basic list accessors. The <code>addElementRolling</code> method adds an element (the actual parameter) to the end of the list and removes the first element in the list. </p> <p> The <a href="../apidocs/org/apache/commons/math/util/ResizableDoubleArray.html"> ResizableDoubleArray</a> class provides a configurable, array-backed implementation of the <code>DoubleArray</code> interface. When <code>addElementRolling</code> is invoked, the underlying array is expanded if necessary, the new element is added to the end of the array and the "usable window" of the array is moved forward, so that the first element is effectively discarded, what was the second becomes the first, and so on. To efficiently manage storage, two maintenance operations need to be periodically performed -- orphaned elements at the beginning of the array need to be reclaimed and space for new elements at the end needs to be created. Both of these operations are handled automatically, with frequency / effect driven by the configuration properties <code>expansionMode</code>, <code>expansionFactor</code> and <code>contractionCriteria.</code> See <a href="../apidocs/org/apache/commons/math/util/ResizableDoubleArray.html"> ResizableDoubleArray</a> for details. </p> </subsection> <subsection name="6.3 int/double hash map" href="int_double_hash_map"> <p> The <a href="../apidocs/org/apache/commons/math/util/OpenIntToDoubleHashMap.html"> OpenIntToDoubleHashMap</a> class provides a specialized hash map implementation for int/double. This implementation has a much smaller memory overhead than standard <code>java.util.HashMap</code> class. It uses open addressing and primitive arrays, which greatly reduces the number of intermediate objects and improve data locality. </p> </subsection> <subsection name="6.4 Continued Fractions" href="continued_fractions"> <p> The <a href="../apidocs/org/apache/commons/math/util/ContinuedFraction.html"> ContinuedFraction</a> class provides a generic way to create and evaluate continued fractions. The easiest way to create a continued fraction is to subclass <code>ContinuedFraction</code> and override the <code>getA</code> and <code>getB</code> methods which return the continued fraction terms. The precise definition of these terms is explained in <a href="http://mathworld.wolfram.com/ContinuedFraction.html"> Continued Fraction, equation (1)</a> from MathWorld. </p> <p> As an example, the constant Pi can be computed using a <a href="http://functions.wolfram.com/Constants/Pi/10/0002/">continued fraction</a>. The following anonymous class provides the implementation: <source>ContinuedFraction c = new ContinuedFraction() { public double getA(int n, double x) { switch(n) { case 0: return 3.0; default: return 6.0; } } public double getB(int n, double x) { double y = (2.0 * n) - 1.0; return y * y; } }</source> </p> <p> Then, to evalute Pi, simply call any of the <code>evalute</code> methods (Note, the point of evalution in this example is meaningless since Pi is a constant). </p> <p> For a more practical use of continued fractions, consider the <a href="http://functions.wolfram.com/ElementaryFunctions/Exp/10/">exponential function</a>. The following anonymous class provides its implementation: <source>ContinuedFraction c = new ContinuedFraction() { public double getA(int n, double x) { if (n % 2 == 0) { switch(n) { case 0: return 1.0; default: return 2.0; } } else { return n; } } public double getB(int n, double x) { if (n % 2 == 0) { return -x; } else { return x; } } }</source> </p> <p> Then, to evalute <i>e</i><sup>x</sup> for any value x, simply call any of the <code>evalute</code> methods. </p> </subsection> <subsection name="6.5 binomial coefficients, factorials and other common math functions" href="math_utils"> <p> A collection of reusable math functions is provided in the <a href="../apidocs/org/apache/commons/math/util/MathUtils.html">MathUtils</a> utility class. MathUtils currently includes methods to compute the following: <ul> <li> Binomial coefficients -- "n choose k" available as an (exact) long value, <code>binomialCoefficient(int, int)</code> for small n, k; as a double, <code>binomialCoefficientDouble(int, int)</code> for larger values; and in a "super-sized" version, <code>binomialCoefficientLog(int, int)</code> that returns the natural logarithm of the value.</li> <li> Factorials -- like binomial coefficients, these are available as exact long values, <code>factorial(int)</code>; doubles, <code>factorialDouble(int)</code>; or logs, <code>factorialLog(int)</code>. </li> <li> Hyperbolic sine and cosine functions -- <code>cosh(double), sinh(double)</code></li> <li> sign (+1 if argument &gt; 0, 0 if x = 0, and -1 if x &lt; 0) and indicator (+1.0 if argument &gt;= 0 and -1.0 if argument &lt; 0) functions for variables of all primitive numeric types.</li> <li> a hash function, <code>hash(double),</code> returning a long-valued hash code for a double value. </li> <li> Convience methods to round floating-point number to arbitrary precision. </li> <li> Least common multiple and greatest common denominator functions. </li> </ul> </p> </subsection> <subsection name="6.7 Miscellaneous" href="math_utils"> The <a href="../apidocs/org/apache/commons/math/util/MultidimensionalCounter.html"> MultidimensionalCounter</a> is a utility class that converts a set of indices (identifying points in a multidimensional space) to a single index (e.g. identifying a location in a one-dimensional array. </subsection> </section> </body> </document>
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- ############################################################################## # Taobao OpenERP Connector # Copyright 2012 wangbuke <[email protected]> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU 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/>. ############################################################################## from osv import osv, fields from taobao_base import TaobaoMixin import datetime import time from .taobao_top import TOP from crm import crm class taobao_shop(osv.osv, TaobaoMixin): _inherit = "taobao.shop" _columns = { #taobao rate 'enable_auto_check_rate': fields.boolean(u'自动检查中差评'), 'rate_helpdesk_user_id': fields.many2one('res.users', u'默认负责人'), 'rate_helpdesk_section_id': fields.many2one('crm.case.section', u'默认销售团队'), 'rate_helpdesk_channel_id': fields.many2one('crm.case.channel', u'途径'), 'rate_helpdesk_priority': fields.selection(crm.AVAILABLE_PRIORITIES, u'优先级'), 'rate_helpdesk_categ_id': fields.many2one('crm.case.categ', 'Category', \ domain="['|',('section_id','=',False),('section_id','=',section_id),\ ('object_id.model', '=', 'crm.helpdesk')]"), 'rate_remind_user': fields.boolean(u'发送邮件'), } _defaults = { 'enable_auto_check_rate': True, } class taobao_rate(osv.osv, TaobaoMixin): _name = "taobao.rate" _description = "Taobao Trade Rate" _columns = { 'taobao_app_key': fields.char('App Key', size=256), 'start_date': fields.char('Start Date', size=256), 'end_date': fields.char('End Date', size=256), 'name': fields.char(u'名字', size=256), 'tid': fields.char(u'交易ID', size=256), 'oid': fields.char(u'子订单ID', size=256), 'valid_score': fields.boolean(u'评价信息是否用于记分'), 'role': fields.selection([ ('seller', u'卖家'), ('buyer', u'买家'), ], u'评价者角色', ), 'nick': fields.char(u'评价者昵称', size=256), 'result': fields.selection([ ('good', u'好评'), ('neutral', u'中评'), ('bad', u'差评'), ], u'评价结果', ), 'created': fields.datetime(u'评价创建时间'), 'rated_nick': fields.char(u'被评价者昵称', size=256), 'item_title': fields.char(u'商品标题', size=256), 'item_price': fields.float(u'商品价格'), 'content': fields.text(u'评价内容'), 'reply': fields.text(u'评价解释'), } _sql_constraints = [('taobao_tid_oid_uniq','unique(tid, oid)', 'Taobao Order must be unique!')] _order = 'id DESC' def _top_trade_rate_add(self, top, tid, result = 'good', role = 'seller', content = None, anony = False ): trade_fullinfo = self.pool.get('sale.order')._top_trade_fullinfo_get(top, tid) for order in trade_fullinfo.orders.order: top('taobao.traderate.add', tid = tid, oid = order.oid, result = result, role = role, content = content, anony = anony ) def rate_ticket_new(self, cr, uid, shop, top, rate, remind_user = True): res_partner_obj = self.pool.get('res.partner') partner = res_partner_obj._get(cr, uid, args = [('taobao_nick','=',rate.nick)]) if not partner: tbbuyer = res_partner_obj._top_user_get(top, nick=rate.nick) try: partner = res_partner_obj._save(cr, uid, args=[('taobao_nick','=', tbbuyer.nick), ('ref','=', '%s' % tbbuyer.nick)], **{'name':tbbuyer.nick, 'ref':'%s' % tbbuyer.nick, 'category_id': [shop.taobao_user_category_id.id], 'customer': True, 'taobao_user_id':tbbuyer.get('user_id', None), 'taobao_nick':tbbuyer.nick}) except: #IntegrityError: duplicate key value violates unique constraint "res_partner_taobao_user_id_uniq" pass partner_address_id = res_partner_obj.address_get(cr, uid, [partner.id]).get('default', None) order = self.pool.get('sale.order')._get(cr, uid, args = [('taobao_trade_id','=',rate.tid)]) desc = u""" 买家昵称: %s 卖家昵称: %s 评价日期: %s 评价类型: %s 交易编号: %s 子订单编号: %s 商品标题: %s 商品价格: %s 评价内容: %s """ % (rate.nick, rate.rated_nick, rate.created, rate.result, rate.tid, rate.oid, rate.item_title, rate.item_price, rate.content ) helpdesk_obj = self.pool.get('crm.helpdesk') helpdesk_id = helpdesk_obj.create(cr, uid, { 'name': u'%s | %s | %s' % (rate.created, rate.nick, u'中评' if rate.result == 'neutral' else u'差评'), 'active': True, 'description': desc, 'user_id': shop.rate_helpdesk_user_id.id, 'section_id': shop.rate_helpdesk_section_id.id, 'partner_id': partner.id, 'partner_address_id':partner_address_id if partner_address_id else None, 'ref' : '%s,%s' % ('sale.order', str(order.id)) if order else None, 'channel_id': shop.rate_helpdesk_channel_id.id, 'priority': shop.rate_helpdesk_priority, 'categ_id': shop.rate_helpdesk_categ_id.id, }) if remind_user: helpdesk_obj.remind_user(cr, uid, [helpdesk_id]) cr.commit() def _top_traderates_get(self, top, start_date = None, end_date = None): rates = [] #中评 page_no = 0 page_size = 50 total_results = 999 while(total_results > page_no*page_size): rsp =top('taobao.traderates.get', fields = ['tid','oid','role','nick','result','created','rated_nick','item_title','item_price','content','reply'], rate_type = 'get', role = 'buyer', result = 'neutral', start_date = start_date, end_date = end_date, page_no = page_no + 1, page_size = page_size) if rsp and rsp.get('trade_rates', False): rates = rates + rsp.trade_rates.trade_rate if rsp and rsp.has_key('total_results'): total_results = int(rsp.get('total_results', 0)) else: total_results = 0 page_no += 1 time.sleep(1/1000) #差评 page_no = 0 page_size = 50 total_results = 999 while(total_results > page_no*page_size): rsp =top('taobao.traderates.get', fields = ['tid','oid','role','nick','result','created','rated_nick','item_title','item_price','content','reply'], rate_type = 'get', role = 'buyer', result = 'bad', start_date = start_date, end_date = end_date, page_no = page_no + 1, page_size = page_size) if rsp and rsp.get('trade_rates', False): rates = rates + rsp.trade_rates.trade_rate if rsp and rsp.has_key('total_results'): total_results = int(rsp.get('total_results', 0)) else: total_results = 0 page_no += 1 time.sleep(1/1000) return rates def cron_check_rate(self, cr, uid, ids=False, context=None): shop_obj = self.pool.get('taobao.shop') shops = shop_obj.browse(cr, uid, shop_obj.search(cr, uid, [])) for shop in shops: if not shop.enable_auto_check_rate: continue top = TOP(shop.taobao_app_key, shop.taobao_app_secret, shop.taobao_session_key) end = datetime.datetime.utcnow() + datetime.timedelta(hours = 8) rate_ids = self.search(cr, uid, [('taobao_app_key','=', shop.taobao_app_key)], limit =1) if rate_ids and rate_ids[0]: start = datetime.datetime.strptime(self.browse(cr, uid, rate_ids[0]).end_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(seconds = 1) else: start = end - datetime.timedelta(days = 30) top_rates = self._top_traderates_get(top, start_date = start.strftime('%Y-%m-%d %H:%M:%S'), end_date = end.strftime('%Y-%m-%d %H:%M:%S')) #add ticket for rate in top_rates: self.rate_ticket_new(cr, uid, shop, top, rate, remind_user = shop.rate_remind_user) time.sleep(1) self.create(cr, uid, { 'taobao_app_key': shop.taobao_app_key, 'start_date': start.strftime('%Y-%m-%d %H:%M:%S'), 'end_date': end.strftime('%Y-%m-%d %H:%M:%S'), }) time.sleep(1) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
{ "pile_set_name": "Github" }
#!/bin/bash # Archived program command-line for experiment # Copyright 2016 Xiang Zhang # # Usage: bash {this_file} [additional_options] set -x; set -e; th main.lua -driver_location models/jointfull/wordbagroman -train_data_file data/joint/full_train_roman_wordbag.t7b -test_data_file data/joint/full_test_roman_wordbag.t7b "$@";
{ "pile_set_name": "Github" }
{ "farms": [] }
{ "pile_set_name": "Github" }
/* This file is part of IanniX, a graphical real-time open-source sequencer for digital art Copyright (C) 2010-2015 — IanniX Association Project Manager: Thierry Coduys (http://www.le-hub.org) Development: Guillaume Jacquemin (https://www.buzzinglight.com) This file was written by Guillaume Jacquemin. IanniX is a 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 any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MESSAGEMANAGERLOG_H #define MESSAGEMANAGERLOG_H #include <QWidget> #include "messagemanagerloginterface.h" namespace Ui { class MessageManagerLog; } class MessageManagerLog : public QWidget, public MessageManagerLogInterface { Q_OBJECT private: MessageManagerLog *log; public: explicit MessageManagerLog(QLayout *layout = 0); ~MessageManagerLog(); public: bool enable; void logSend (const MessageLog &log, QStringList *sentMessage = 0); void logReceive(const MessageLog &log, QStringList *sentMessage = 0); public slots: void action(); private: Ui::MessageManagerLog *ui; }; #endif // MESSAGEMANAGERLOG_H
{ "pile_set_name": "Github" }
const app = new Vue({ el: "#app", data: { bobby: { name: "Bobby Boone", age: 25 }, john: { name: "John Boby", age: 35, } }, template: ` <div> <h2>Name: {{john.name}}</h2> <h2>Age: {{john.age}}</h2> <h2>Name: {{bobby.name}}</h2> <h2>Age: {{bobby.age}}</h2> </div> ` })
{ "pile_set_name": "Github" }
package com.sanshengshui.server.service.state; import lombok.Builder; import lombok.Data; /** * @Author: 穆书伟 * @Date: 19-4-8 下午1:33 * @Version 1.0 */ @Data @Builder public class DeviceState { private boolean active; private long lastConnectTime; private long lastActivityTime; private long lastDisconnectTime; private long lastInactivityAlarmTime; private long inactivityTimeout; }
{ "pile_set_name": "Github" }