text
stringlengths
2
14k
meta
dict
//---------------------------------------------------------------------------// // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com> // // Distributed under the Boost Software License, Version 1.0 // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // // See http://boostorg.github.com/compute for more information. //---------------------------------------------------------------------------// #ifndef BOOST_COMPUTE_ALGORITHM_REPLACE_COPY_HPP #define BOOST_COMPUTE_ALGORITHM_REPLACE_COPY_HPP #include <iterator> #include <boost/compute/system.hpp> #include <boost/compute/command_queue.hpp> #include <boost/compute/algorithm/copy.hpp> #include <boost/compute/algorithm/replace.hpp> namespace boost { namespace compute { /// Copies the value in the range [\p first, \p last) to the range /// beginning at \p result while replacing each instance of \p old_value /// with \p new_value. /// /// \see replace() template<class InputIterator, class OutputIterator, class T> inline OutputIterator replace_copy(InputIterator first, InputIterator last, OutputIterator result, const T &old_value, const T &new_value, command_queue &queue = system::default_queue()) { typedef typename std::iterator_traits<OutputIterator>::difference_type difference_type; difference_type count = std::distance(first, last); if(count == 0){ return result; } // copy data to result ::boost::compute::copy(first, last, result, queue); // replace in result ::boost::compute::replace(result, result + count, old_value, new_value, queue); // return iterator to the end of result return result + count; } } // end compute namespace } // end boost namespace #endif // BOOST_COMPUTE_ALGORITHM_REPLACE_COPY_HPP
{ "pile_set_name": "Github" }
/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package meta provides functions for retrieving API metadata from objects // belonging to the Kubernetes API package meta // import "k8s.io/apimachinery/pkg/api/meta"
{ "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. insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-03-31',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-04-11',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-04-12',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-04-15',5,5,0); insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-04-20',10,0,0); insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-04-23',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-04-24',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-05-03',11,0,0); insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-05-05',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-05-06',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-05-17',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-05-18',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-05-29',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1116',1,'2004-05-30',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-03-31',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-04-11',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-04-12',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-04-15',5,5,0); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-04-20',10,0,0); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-04-23',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-04-24',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-05-03',11,0,0); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-05-05',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-05-06',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-05-17',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-05-18',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-05-29',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1122',1,'2004-05-30',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-03-31',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-04-11',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-04-12',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-04-15',5,5,0); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-04-20',10,0,0); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-04-23',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-04-24',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-05-03',11,0,0); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-05-05',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-05-06',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-05-17',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-05-18',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-05-29',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1124',1,'2004-05-30',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-03-31',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-04-11',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-04-12',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-04-15',5,5,0); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-04-20',10,0,0); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-04-23',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-04-24',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-05-03',11,0,0); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-05-05',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-05-06',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-05-17',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-05-18',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-05-29',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1126',1,'2004-05-30',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1128',1,'2004-03-31',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1128',1,'2004-04-11',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1128',1,'2004-04-12',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1128',1,'2004-04-15',5,5,0); insert into FLIGHTAVAILABILITY values ('AA1128',1,'2004-04-20',10,0,0); insert into FLIGHTAVAILABILITY values ('AA1128',1,'2004-04-23',1,1,1); insert into FLIGHTAVAILABILITY values ('AA1128',1,'2004-04-24',2,2,2); insert into FLIGHTAVAILABILITY values ('AA1128',1,'2004-05-03',11,0,0); insert into FLIGHTAVAILABILITY values ('AA1128',1
{ "pile_set_name": "Github" }
<resources> <!-- Customize dimensions originally defined in res/values/dimens.xml (such as screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. --> <dimen name="activity_horizontal_margin">128dp</dimen> </resources>
{ "pile_set_name": "Github" }
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Local File Inclusion Test Case</title> </head> <body> <%@ include file="include.jsp"%> <% //*** Re-define Default Exposure Variables - Per Page *** //CONTEXT_STREAM, FILE_CLASS, URL_CLASS, FTP_CLASS, INCLUDE, REDIRECT, FORWARD fileAccessMethod = FileAccessMethod.FILE_CLASS; //NONE, WHITE_LIST, LOCAL_FOLDER_ONLY, PERMISSIONS, //UNIX_TRAVESAL_INPUT_VALIDATION, UNIX_TRAVESAL_INPUT_REMOVAL, //WINDOWS_TRAVESAL_INPUT_VALIDATION, WINDOWS_TRAVESAL_INPUT_REMOVAL, //SLASH_INPUT_VALIDATION, SLASH_INPUT_REMOVAL, //BACKSLASH_INPUT_VALIDATION, BACKSLASH_INPUT_REMOVAL, accessRestriction = FileAccessRestriction.SLASH_INPUT_REMOVAL; //FULL_PATH_INPUT, RELATIVE_INPUT, INVALID_INPUT , EMPTY_INPUT defaultInputType = DefaultInputType.FULL_PATH_INPUT; //FULL_FILENAME, FILENAME_ONLY, DIRECTORY, EXTENSION injectionContext = FileInjectionContext.FULL_FILENAME; //ANY, NONE, SLASH_PREFIX, BACKSLASH_PREFIX, //FTP_DIRECTIVE, HTTP_DIRECTIVE, prefixRequired = PrefixRequirement.ANY; //WINDOWS, UNIX //osSimulated = OsType.WINDOWS; //Use the default defined in include.jsp //ERROR_500, ERROR_404, REDIRECT_302, ERROR_200, VALID_200, Identical_200 //invalidResponseType = ResponseType.ERROR_200; //Use the default defined in include.jsp //CONTENT_TYPE_TEXT_HTML ("text/html"), CONTENT_TYPE_STREAM ("application/octet-stream") //validResposeStream = ContentConstants.CONTENT_TYPE_TEXT_HTML; //OS_PATH, FILE_DIRECTIVE_URL, FTP_URL, HTTP_URL pathType = PathType.OS_PATH; //LFI, RFI, DIRECTORY_TRAVERSAL, CODE_LFI, CODE_RFI, FALSE_POSITIVE vulnerability = VulnerabilityType.LFI; %> <%@ include file="inclusion-logic.jsp"%>
{ "pile_set_name": "Github" }
package releases import ( "fmt" "strings" "github.com/pkg/errors" "github.com/jenkins-x/jx/v2/pkg/gits" ) // ReleaseDownloadCount returns the total number of downloads for the given set of releases func ReleaseDownloadCount(releases []*gits.GitRelease) int { count := 0 for _, release := range releases { count += release.DownloadCount } return count } // GetRelease will find the GitRelease for the given owner/repo, looking for a tag called <version> or v<version> func GetRelease(version string, owner string, repo string, provider gits.GitProvider) (*gits.GitRelease, error) { release, err := provider.GetRelease(owner, repo, version) if err != nil { // normally tags are v<version> so try that tag := fmt.Sprintf("v%s", version) release, err = provider.GetRelease(owner, repo, tag) if err != nil { if ReleaseNotFoundError(err) { return nil, nil } return nil, errors.Wrapf(err, "getting release for %s (tried %s and %s)", version, version, tag) } } return release, nil } // ReleaseNotFoundError determines if the reason for the error is that the release is not found func ReleaseNotFoundError(err error) bool { return strings.HasSuffix(err.Error(), "404 Not Found []") }
{ "pile_set_name": "Github" }
<shapes name="mxgraph.gcp.extras"> <shape aspect="variable" h="113.97" name="Blue Hexagon" strokewidth="inherit" w="129.07"> <connections/> <foreground> <path> <move x="28.3" y="108.23"/> <line x="2.05" y="62.76"/> <arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="2.05" x-axis-rotation="0" y="51.26"/> <line x="28.3" y="5.79"/> <arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="38.26" x-axis-rotation="0" y="0.01"/> <line x="90.76" y="0.01"/> <arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="100.76" x-axis-rotation="0" y="5.76"/> <line x="127.01" y="51.23"/> <arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="127.01" x-axis-rotation="0" y="62.73"/> <line x="100.76" y="108.2"/> <arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="90.76" x-axis-rotation="0" y="113.95"/> <line x="38.26" y="113.95"/> <arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="28.3" x-axis-rotation="0" y="108.23"/> <close/> </path> <fillstroke/> </foreground> </shape> <shape aspect="variable" h="114.38" name="Generic GCP" strokewidth="inherit" w="129.07"> <connections/> <foreground> <save/> <path> <move x="28.3" y="108.23"/> <line x="2.05" y="62.76"/> <arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="2.05" x-axis-rotation="0" y="51.26"/> <line x="28.3" y="5.79"/> <arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="38.26" x-axis-rotation="0" y="0.01"/> <line x="90.76" y="0.01"/> <arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="100.76" x-axis-rotation="0" y="5.76"/> <line x="127.01" y="51.23"/> <arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="127.01" x-axis-rotation="0" y="62.73"/> <line x="100.76" y="108.2"/> <arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="90.76" x-axis-rotation="0" y="113.95"/> <line x="38.26" y="113.95"/> <arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="28.3" x-axis-rotation="0" y="108.23"/> <close/> </path> <fillstroke/> <fillcolor color="#000000"/> <alpha alpha="0.07"/> <path> <move x="81.26" y="32.26"/> <line x="53.51" y="36.01"/> <line x="48.28" y="52.44"/> <line x="40.19" y="45.44"/> <line x="48.7" y="82.02"/> <line x="82.15" y="114.35"/> <line x="91.15" y="114.38"/> <curve x1="95.14" x2="98.69" x3="100.71" y1="114.38" y2="112.3" y3="109.2"/> <line x="121.36" y="73.43"/> <close/> </path> <fill/> <restore/> <rect/> <stroke/> <fillcolor color="#ffffff"/> <path> <move x="72.29" y="57.06"/> <arc large-arc-flag="1" rx="7.93" ry="7.93" sweep-flag="1" x="64.36" x-axis-rotation="0" y="49.13"/> <arc large-arc-flag="0" rx="7.93" ry="7.93" sweep-flag="1" x="72.29" x-axis-rotation="0" y="57.06"/> <move x="93.73" y="55.01"/> <line x="87.79" y="44.67"/> <line x="75.67" y="44.67"/> <line x="82.77" y="57.01"/> <line x="80.86" y="60.34"/> <line x="73.64" y="72.88"/> <line x="71.41" y="76.75"/> <line x="67.51" y="83.45"/> <line x="77.35" y="83.45"/> <arc large-arc-flag="0" rx="4" ry="4" sweep-flag="0" x="80.79" x-axis-rotation="0" y="81.45"/> <line x="93.73" y="59.01"/> <arc large-arc-flag="0" rx="4" ry="4" sweep-flag="0" x="93.73" x-axis-rotation="0" y="55.06"/> <move x="55.38" y="72.88"/> <line x="46.25" y="57.01"/> <line x="40.19" y="46.49"/> <line x="35.29" y="55.01"/> <arc large-arc-flag="0" rx="4" ry="4" sweep-flag="0" x="35.29" x-axis-rotation="0" y="58.96"/> <line x="48.18" y="81.46"/> <arc large-arc-flag="0" rx="4" ry="4" sweep-flag="0" x="51.62" x-axis-rotation="0" y="83.46"/> <line x="63.46" y="83.46"/> <line x="69.57" y="72.88"/> <line x="55.38" y="72.88"/> <close/> <move x="85.77" y="41.14"/> <line x="80.85" y="32.56"/> <arc large-arc-flag="0" rx="4" ry="4" sweep-flag="0" x="77.41" x-axis-rotation="0" y="30.56"/> <line x="51.62" y="30.56"/> <arc large-arc-flag="0" rx="4" ry="4" sweep-flag="0" x="48.18" x-axis-rotation="0" y="32.56"/> <line x="42.2" y="43.01"/> <line x="48.27" y="53.52"/> <line x="55.37" y="41.18"/> <line x="85.77" y="41.18"/> <close/> </path> <fill/> </foreground> </shape> <shape aspect="variable"
{ "pile_set_name": "Github" }
/** * Copyright (C) 2018-2020 * All rights reserved, Designed By www.yixiang.co * 注意: * 本软件为www.yixiang.co开发研制 */ package co.yixiang.common.service.impl; import cn.hutool.core.collection.CollectionUtil; import co.yixiang.common.service.BaseService; import co.yixiang.common.web.param.OrderQueryParam; import co.yixiang.common.web.param.QueryParam; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; import org.springframework.data.domain.Pageable; import java.util.Arrays; import java.util.List; /** * @author hupeng * @since 2019-10-16 */ @Slf4j @SuppressWarnings("unchecked") public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<M, T> implements BaseService<T> { protected Page setPageParam(QueryParam queryParam) { return setPageParam(queryParam,null); } protected Page setPageParam(QueryParam queryParam, OrderItem defaultOrder) { Page page = new Page(); // 设置当前页码 page.setCurrent(queryParam.getPage()); // 设置页大小 page.setSize(queryParam.getLimit()); /** * 如果是queryParam是OrderQueryParam,并且不为空,则使用前端排序 * 否则使用默认排序 */ if (queryParam instanceof OrderQueryParam){ OrderQueryParam orderQueryParam = (OrderQueryParam) queryParam; List<OrderItem> orderItems = orderQueryParam.getOrders(); if (CollectionUtil.isEmpty(orderItems)){ page.setOrders(Arrays.asList(defaultOrder)); }else{ page.setOrders(orderItems); } }else{ page.setOrders(Arrays.asList(defaultOrder)); } return page; } protected void getPage(Pageable pageable) { String order=null; if(pageable.getSort()!=null){ order= pageable.getSort().toString(); order=order.replace(":",""); if("UNSORTED".equals(order)){ order="id desc"; } } PageHelper.startPage(pageable.getPageNumber()+1, pageable.getPageSize(),order); } }
{ "pile_set_name": "Github" }
-- misc1.test -- -- execsql {BEGIN} BEGIN
{ "pile_set_name": "Github" }
// Copyright Joyent, Inc. and other Node contributors. // // 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. // test compressing and uncompressing a string with zlib var tape = require('tape'); var zlib = require('../'); var inputString = '\u03A9\u03A9Lorem ipsum dolor sit amet, consectetur adipiscing el' + 'it. Morbi faucibus, purus at gravida dictum, libero arcu convallis la' + 'cus, in commodo libero metus eu nisi. Nullam commodo, neque nec porta' + ' placerat, nisi est fermentum augue, vitae gravida tellus sapien sit ' + 'amet tellus. Aenean non diam orci. Proin quis elit turpis. Suspendiss' + 'e non diam ipsum. Suspendisse nec ullamcorper odio. Vestibulum arcu m' + 'i, sodales non suscipit id, ultrices ut massa. Sed ac sem sit amet ar' + 'cu malesuada fermentum. Nunc sed. '; var expectedBase64Deflate = 'eJxdUUtOQzEMvMoc4OndgT0gJCT2buJWlpI4jePeqZfpm' + 'XAKLRKbLOzx/HK73q6vOrhCunlF1qIDJhNUeW5I2ozT5OkDlKWLJWkncJG5403HQXAkT3' + 'Jw29B9uIEmToMukglZ0vS6ociBh4JG8sV4oVLEUCitK2kxq1WzPnChHDzsaGKy491Lofo' + 'AbWh8do43oeuYhB5EPCjcLjzYJo48KrfQBvnJecNFJvHT1+RSQsGoC7dn2t/xjhduTA1N' + 'WyQIZR0pbHwMDatnD+crPqKSqGPHp1vnlsWM/07ubf7bheF7kqSj84Bm0R1fYTfaK8vqq' + 'qfKBtNMhe3OZh6N95CTvMX5HJJi4xOVzCgUOIMSLH7wmeOHaFE4RdpnGavKtrB5xzfO/Ll9'; var expectedBase64Gzip = 'H4sIAAAAAAAAA11RS05DMQy8yhzg6d2BPSAkJPZu4laWkjiN' + '496pl+mZcAotEpss7PH8crverq86uEK6eUXWogMmE1R5bkjajNPk6QOUpYslaSdwkbnjT' + 'cdBcCRPcnDb0H24gSZOgy6SCVnS9LqhyIGHgkbyxXihUsRQKK0raTGrVbM+cKEcPOxoYr' + 'Lj3Uuh+gBtaHx2jjeh65iEHkQ8KNwuPNgmjjwqt9AG+cl5w0Um8dPX5FJCwagLt2fa3/G' + 'OF25MDU1bJAhlHSlsfAwNq2cP5ys+opKoY8enW+eWxYz/Tu5t/tuF4XuSpKPzgGbRHV9h' + 'N9ory+qqp8oG00yF7c5mHo33kJO8xfkckmLjE5XMKBQ4gxIsfvCZ44doUThF2mcZq8q2s' + 'HnHNzRtagj5AQAA'; tape('deflate', function(t) { t.plan(1); zlib.deflate(inputString, function(err, buffer) { t.equal(buffer.toString('base64'), expectedBase64Deflate, 'deflate encoded string should match'); }); }); tape('gzip', function(t) { t.plan(1); zlib.gzip(inputString, function(err, buffer) { // Can't actually guarantee that we'll get exactly the same // deflated bytes when we compress a string, since the header // depends on stuff other than the input string itself. // However, decrypting it should definitely yield the same // result that we're expecting, and this should match what we get // from inflating the known valid deflate data. zlib.gunzip(buffer, function(err, gunzipped) { t.equal(gunzipped.toString(), inputString, 'Should get original string after gzip/gunzip'); }); }); }); tape('unzip deflate', function(t) { t.plan(1); var buffer = new Buffer(expectedBase64Deflate, 'base64'); zlib.unzip(buffer, function(err, buffer) { t.equal(buffer.toString(), inputString, 'decoded inflated string should match'); }); }); tape('unzip gzip', function(t) { t.plan(1); buffer = new Buffer(expectedBase64Gzip, 'base64'); zlib.unzip(buffer, function(err, buffer) { t.equal(buffer.toString(), inputString, 'decoded gunzipped string should match'); }); });
{ "pile_set_name": "Github" }
// // InterfaceTestViewController.m // InterfaceTest // // Created by Robbie Hanson on 10/15/10. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import "InterfaceTestViewController.h" @implementation InterfaceTestViewController /* // The designated initializer. Override to perform setup that is required before the view is loaded. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { // Custom initialization } return self; } */ /* // Implement loadView to create a view hierarchy programmatically, without using a nib. - (void)loadView { } */ /* // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; } */ /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } */ - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } @end
{ "pile_set_name": "Github" }
/********************************************************************* * NAN - Native Abstractions for Node.js * * Copyright (c) 2015 NAN contributors * * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md> ********************************************************************/ #ifndef NAN_OBJECT_WRAP_H_ #define NAN_OBJECT_WRAP_H_ class ObjectWrap { public: ObjectWrap() { refs_ = 0; } virtual ~ObjectWrap() { if (persistent().IsEmpty()) { return; } assert(persistent().IsNearDeath()); persistent().ClearWeak(); persistent().Reset(); } template <class T> static inline T* Unwrap(v8::Local<v8::Object> object) { assert(!object.IsEmpty()); assert(object->InternalFieldCount() > 0); // Cast to ObjectWrap before casting to T. A direct cast from void // to T won't work right when T has more than one base class. void* ptr = GetInternalFieldPointer(object, 0); ObjectWrap* wrap = static_cast<ObjectWrap*>(ptr); return static_cast<T*>(wrap); } inline v8::Local<v8::Object> handle() { return New(persistent()); } inline Persistent<v8::Object>& persistent() { return handle_; } protected: inline void Wrap(v8::Local<v8::Object> object) { assert(persistent().IsEmpty()); assert(object->InternalFieldCount() > 0); SetInternalFieldPointer(object, 0, this); persistent().Reset(object); MakeWeak(); } #if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) inline void MakeWeak() { persistent().v8::PersistentBase<v8::Object>::SetWeak( this, WeakCallback, v8::WeakCallbackType::kParameter); persistent().MarkIndependent(); } #elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION inline void MakeWeak() { persistent().v8::PersistentBase<v8::Object>::SetWeak(this, WeakCallback); persistent().MarkIndependent(); } #else inline void MakeWeak() { persistent().persistent.MakeWeak(this, WeakCallback); persistent().MarkIndependent(); } #endif /* Ref() marks the object as being attached to an event loop. * Refed objects will not be garbage collected, even if * all references are lost. */ virtual void Ref() { assert(!persistent().IsEmpty()); persistent().ClearWeak(); refs_++; } /* Unref() marks an object as detached from the event loop. This is its * default state. When an object with a "weak" reference changes from * attached to detached state it will be freed. Be careful not to access * the object after making this call as it might be gone! * (A "weak reference" means an object that only has a * persistant handle.) * * DO NOT CALL THIS FROM DESTRUCTOR */ virtual void Unref() { assert(!persistent().IsEmpty()); assert(!persistent().IsWeak()); assert(refs_ > 0); if (--refs_ == 0) MakeWeak(); } int refs_; // ro private: NAN_DISALLOW_ASSIGN_COPY_MOVE(ObjectWrap) #if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) static void WeakCallback(v8::WeakCallbackInfo<ObjectWrap> const& info) { ObjectWrap* wrap = info.GetParameter(); assert(wrap->refs_ == 0); assert(wrap->handle_.IsNearDeath()); wrap->handle_.Reset(); delete wrap; } #elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION static void WeakCallback(v8::WeakCallbackData<v8::Object, ObjectWrap> const& data) { ObjectWrap* wrap = data.GetParameter(); assert(wrap->refs_ == 0); assert(wrap->handle_.IsNearDeath()); wrap->handle_.Reset(); delete wrap; } #else static void WeakCallback(v8::Persistent<v8::Value> value, void *data) { ObjectWrap *wrap = static_cast<ObjectWrap*>(data); assert(wrap->refs_ == 0); assert(wrap->handle_.IsNearDeath()); wrap->handle_.Reset(); delete wrap; } #endif Persistent<v8::Object> handle_; }; #endif // NAN_OBJECT_WRAP_H_
{ "pile_set_name": "Github" }
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package hex import ( "bytes" "testing" ) type encDecTest struct { enc string dec []byte } var encDecTests = []encDecTest{ {"", []byte{}}, {"0001020304050607", []byte{0, 1, 2, 3, 4, 5, 6, 7}}, {"08090a0b0c0d0e0f", []byte{8, 9, 10, 11, 12, 13, 14, 15}}, {"f0f1f2f3f4f5f6f7", []byte{0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7}}, {"f8f9fafbfcfdfeff", []byte{0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff}}, {"67", []byte{'g'}}, {"e3a1", []byte{0xe3, 0xa1}}, } func TestEncode(t *testing.T) { for i, test := range encDecTests { dst := make([]byte, EncodedLen(len(test.dec))) n := Encode(dst, test.dec) if n != len(dst) { t.Errorf("#%d: bad return value: got: %d want: %d", i, n, len(dst)) } if string(dst) != test.enc { t.Errorf("#%d: got: %#v want: %#v", i, dst, test.enc) } } } func TestDecode(t *testing.T) { for i, test := range encDecTests { dst := make([]byte, DecodedLen(len(test.enc))) n, err := Decode(dst, []byte(test.enc)) if err != nil { t.Errorf("#%d: bad return value: got:%d want:%d", i, n, len(dst)) } else if !bytes.Equal(dst, test.dec) { t.Errorf("#%d: got: %#v want: %#v", i, dst, test.dec) } } } func TestEncodeToString(t *testing.T) { for i, test := range encDecTests { s := EncodeToString(test.dec) if s != test.enc { t.Errorf("#%d got:%s want:%s", i, s, test.enc) } } } func TestDecodeString(t *testing.T) { for i, test := range encDecTests { dst, err := DecodeString(test.enc) if err != nil { t.Errorf("#%d: unexpected err value: %s", i, err) continue } if !bytes.Equal(dst, test.dec) { t.Errorf("#%d: got: %#v want: #%v", i, dst, test.dec) } } } type errTest struct { in string err string } var errTests = []errTest{ {"0", "encoding/hex: odd length hex string"}, {"0g", "encoding/hex: invalid byte: U+0067 'g'"}, {"0\x01", "encoding/hex: invalid byte: U+0001"}, } func TestInvalidErr(t *testing.T) { for i, test := range errTests { dst := make([]byte, DecodedLen(len(test.in))) _, err := Decode(dst, []byte(test.in)) if err == nil { t.Errorf("#%d: expected error; got none", i) } else if err.Error() != test.err { t.Errorf("#%d: got: %v want: %v", i, err, test.err) } } } func TestInvalidStringErr(t *testing.T) { for i, test := range errTests { _, err := DecodeString(test.in) if err == nil { t.Errorf("#%d: expected error; got none", i) } else if err.Error() != test.err { t.Errorf("#%d: got: %v want: %v", i, err, test.err) } } } func TestDumper(t *testing.T) { var in [40]byte for i := range in { in[i] = byte(i + 30) } for stride := 1; stride < len(in); stride++ { var out bytes.Buffer dumper := Dumper(&out) done := 0 for done < len(in) { todo := done + stride if todo > len(in) { todo = len(in) } dumper.Write(in[done:todo]) done = todo } dumper.Close() if !bytes.Equal(out.Bytes(), expectedHexDump) { t.Errorf("stride: %d failed. got:\n%s\nwant:\n%s", stride, out.Bytes(), expectedHexDump) } } } func TestDump(t *testing.T) { var in [40]byte for i := range in { in[i] = byte(i + 30) } out := []byte(Dump(in[:])) if !bytes.Equal(out, expectedHexDump) { t.Errorf("got:\n%s\nwant:\n%s", out, expectedHexDump) } } var expectedHexDump = []byte(`00000000 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d |.. !"#$%&'()*+,-| 00000010 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d |./0123456789:;<=| 00000020 3e 3f 40 41 42 43 44 45 |>?@ABCDE| `)
{ "pile_set_name": "Github" }
<?xml version="1.0" standalone="no" ?> <!DOCTYPE pov SYSTEM "/usr/share/cgc-docs/replay.dtd"> <pov> <cbid>service</cbid> <replay> <write><data>new\x0a</data></write> <write><data>sd 1\x0a</data></write> <write><data>s1t3\x0a</data></write> <read><delim>\x0a</delim><match><data>move p7p5\x0a</data></match></read> <write><data>t1s1\x0a</data></write> <read><delim>\x0a</delim><match><data>move p8p6\x0a</data></match></read> <write><data>n1m3\x0a</data></write> <read><delim>\x0a</delim><match><data>move p6t2\x0a</data></match></read> <write><data>s1t1\x0a</data></write> <read><delim>\x0a</delim><match><data>move t2t1\x0a</data></match></read> <write><data>m1n1\x0a</data></write> <read><delim>\x0a</delim><match><data>move q7q5\x0a</data></match></read> <write><data>quit\x0a</data></write> <read><delim>\x0a</delim><match><data>bye\x0a</data></match></read> </replay> </pov>
{ "pile_set_name": "Github" }
Prometheus Server ================= One of Promgen's primary roles is to manage a list of targets for Prometheus to scrape. For high availability, it is generally prefered to have multiple Prometheus servers running together. There are multiple ways to deploy these targets to a Prometheus server. Worker Model (Push) ------------------- .. image:: /images/worker.png Promgen's Push mode relies on `celery <http://docs.celeryproject.org>`__ to push updates to Prometheus. A Promgen worker is run on each Prometheus server which subscribes to a named queue to signal when to write out an updated configuration file, and update Prometheus. .. code-block:: bash # Assuming we have a Prometheus shard named promshard and two servers we # may deploy the workers like this promgen register-server promshard prometheus001 9090 promgen register-server promshard prometheus002 9090 # Then on each Prometheus server, we would want to run a celery worker with # the queue name matching the name that we registered celery -A promgen -l info --queues prometheus001 # If running within docker, the same command would look like this docker run --rm \ -v ~/.config/promgen:/etc/promgen/ \ -v /etc/prometheus:/etc/prometheus \ line/promgen worker -l info --queues prometheus001 Cron Model (Pull) ----------------- .. image:: /images/cron.png In some cases it is not possible (or not desired) to install Promgen beside Prometheus. In this case, Promgne's pull mode can be used by trigging a small script running from cron or any other job framework. This only requires the server where Prometheus is running, to be able to access Promgen over HTTP. .. code-block:: bash #!/bin/sh set -e # Download all the targets from Promgen to a temporary file curl http://promgen/api/v1/targets --output /etc/prometheus/targets.tmp # Optionally you could download from a specific service or project # curl http://promgen/service/123/targets -o /etc/prometheus/targets.tmp # curl http://promgen/project/456/targets -o /etc/prometheus/targets.tmp # Move our file to make it more atomic mv /etc/prometheus/targets.tmp /etc/prometheus/targets.json # Tell Prometheus to reload curl -XPOST http://localhost:9090/-/reload If it's possible to install Promgen, then there is a Promgen helper command that handles the same basic steps as the above command. This will however require the Prometheus server to be able to access the same database as the Promgen web instance. .. code-block:: bash # Internally Promgen uses an atomic write function so you can give # it the path where you want to save it and have it --reload automatically promgen targets /etc/prometheus/targets.json --reload Filtering Targets (Both) ------------------------ In both models, you will want to ensure that the Prometheus server only scrapes the correct subset of targets. Ensure that the correct rewrite_labels is configured .. code-block:: yaml - job_name: 'promgen' file_sd_configs: - files: - "/etc/prometheus/promgen.json" relabel_configs: - source_labels: [__shard] # Our regex value here should match the shard name (exported as __shard) # that shows up in Promgen. In the case we want our Prometheus server to # scrape all targets, then we can ommit the relable config. regex: promshard action: keep
{ "pile_set_name": "Github" }
```jsx import { PlayerContextConsumer } from '@cassette/core'; <PlayerContextConsumer filterList={['currentTime', 'paused', 'onTogglePause']}> {({ currentTime, paused, onTogglePause }) => ( <React.Fragment> <div> The track is {paused ? 'paused' : 'playing'}. The time is {currentTime}. </div> <button onClick={onTogglePause}>Toggle pause!</button> </React.Fragment> )} </PlayerContextConsumer>; ```
{ "pile_set_name": "Github" }
#include "rpygen_wrapper.hpp" RPYBUILD_PYBIND11_MODULE(m) { initWrapper(m); }
{ "pile_set_name": "Github" }
tree 77fc9894c0904279fde93adc9c0ba231515ce68a parent 30e367cef2203eba2b341dc9050993b06fd1e108 parent 420eac97a826bfac8724b6b0eef35c20922124b7 author Tom Preston-Werner <tom@mojombo.com> 1208054148 -0700 committer Tom Preston-Werner <tom@mojombo.com> 1208054148 -0700 Merge branch 'master' of git://github.com/dustin/grit
{ "pile_set_name": "Github" }
/* * JBoss, Home of Professional Open Source * Copyright 2012, Red Hat, Inc., and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jboss.weld.tests.resolution.weld911; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.BeanArchive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.weld.test.util.Utils; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; /** * @author Christian Bauer * @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a> */ @RunWith(Arquillian.class) public class DependentScopeInjectionTest { @Deployment public static Archive getDeployment() { return ShrinkWrap.create(BeanArchive.class, Utils.getDeploymentNameAsHash(DependentScopeInjectionTest.class)) .addClasses(Bar.class, BarImpl.class, Foo.class, Holder.class); } @Test public void testFoo(Holder holder) { final Foo f1 = holder.foo(); Assert.assertNotNull(f1); final Foo f2 = f1.foo(); Assert.assertNotNull(f2); Assert.assertTrue(f1 != f2); } }
{ "pile_set_name": "Github" }
# Dont-Starve-Together-Docker-Cluster 根据配置文件快速建立饥荒联机版 (DST)Docker 集群 ## 运行状况 - 镜像大约 `580m`,包括底层 Ubuntu 镜像的话大约 `1G` - 大概每个实例(带洞穴的)占内存`1G`左右,CPU似乎不怎么占用 - 存档在生成的 `data/名字/Master/save` 里面,要备份的话,请用 `chown` 到自己的用户名,再进行备份 - Mod的话请查看 `./template/dedicated_server_mods_setup.lua` 文件,有具体说明,建议 PC 机先建立一个世界,再把 Mod 配置好,最后再复制到对应位置( `dedicated_server_mods_setup.lua` 文件需要自行整理) ## 运行环境配置 ### 不推荐使用 Windows 如果需要使用,则需要手动修改 Python 脚本文件中的对应 `mkdir cp` 等命令——因为这里是直接使用 `system(shell)` 脚本实现的。 ### Python3 环境配置 1. 在 [Python官网](https://www.python.org/downloads/)下载对应自己操作系统的安装包 2. 然后安装环境,再配置环境变量(如果没有自动配置的话) ### Docker环境配置 1. 请根据自己的操作系统,在 [Docker 官方网站](https://docs.docker.com/engine/installation/#server)选择适合的 **DockerCE** 2. 如果是 Linux 的话,最好把自己的管理员用户添加到 Docker 用户组里,以免每次打命令都得加入 sudo,命令:`sudo usermod -aG docker $USER` 3. 安装 `docker-compose` :如果你是 Ubuntu ,可以直接使用命令:`sudo apt install docker-compose`,如果不是,请前往 [Docker官方网站](https://docs.docker.com/compose/install/),并寻找自己的操作系统的安装方式 4. 至此,你应该有了一个正常的 Docker 环境,如果有问题可以根据 END 区的联系方式提交 ## 基本使用说明 ### 步骤介绍 1. Clone 项目:`git clone https://github.com/Thoxvi/Dont-Starve-Together-Docker-Cluster.git` 2. 进入目录:`cd ./Dont-Starve-Together-Docker-Cluster` 3. 根据模板修改 infos 文件,提供一个测试 Token (每一行对应一个实例,# 号注释,如果不需要密码的话请留空对应位置) 4. 执行生成脚本:`python3 makedata.py` 5. 转到工作目录:`cd data` 6. 启动容器:`docker-compose up` 7. 若不想查看 Log 的话,可以在`启动容器`步骤使用:`docker-compose up -d` 8. 更新,转到工作目录, `docker-compose stop` , 然后 `docker-compose up -d` ### 一套带走 ```shell git clone https://github.com/Thoxvi/Dont-Starve-Together-Docker-Cluster.git cd ./Dont-Starve-Together-Docker-Cluster python3 makedata.py cd ./data docker-compose up ``` ## END - 如果有任何建议或者 Bug 可以提 issue ,或者可以邮箱联系`A@Thoxvi.com` - (。・ω・。)ノ♡
{ "pile_set_name": "Github" }
var nativeCreate = require('./_nativeCreate'); /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } module.exports = hashClear;
{ "pile_set_name": "Github" }
//------------------------------------------------------------------------------ // GB_red: hard-coded functions for reductions //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http://suitesparse.com See GraphBLAS/Doc/License.txt for license. //------------------------------------------------------------------------------ // If this file is in the Generated/ folder, do not edit it (auto-generated). #include "GB.h" #ifndef GBCOMPACT #include "GB_atomics.h" #include "GB_ek_slice.h" #include "GB_control.h" #include "GB_red__include.h" // The reduction is defined by the following types and operators: // Assemble tuples: GB_red_build__eq_bool // Reduce to scalar: GB_red_scalar__eq_bool // Reduce each vector: GB_red_eachvec__eq_bool // Reduce each index: GB_red_eachindex__eq_bool // A type: bool // C type: bool // Reduce: s = (s == aij) // Identity: true // Terminal: ; #define GB_ATYPE \ bool #define GB_CTYPE \ bool // declare scalar #define GB_SCALAR(s) \ bool s // Array to array // W [k] = (ztype) S [i], with typecast #define GB_CAST_ARRAY_TO_ARRAY(W,k,S,i) \ W [k] = S [i] // W [k] += (ztype) S [i], with typecast #define GB_ADD_CAST_ARRAY_TO_ARRAY(W,k,S,i) \ W [k] = (W [k] == S [i]) // W [k] = S [i], no typecast #define GB_COPY_ARRAY_TO_ARRAY(W,k,S,i) \ W [k] = S [i] // W [k] += S [i], no typecast #define GB_ADD_ARRAY_TO_ARRAY(W,k,S,i) \ W [k] = (W [k] == S [i]) // Array to scalar // s = (ztype) Ax [p], with typecast #define GB_CAST_ARRAY_TO_SCALAR(s,Ax,p) \ s = Ax [p] // s = W [k], no typecast #define GB_COPY_ARRAY_TO_SCALAR(s,W,k) \ s = W [k] // s += (ztype) Ax [p], with typecast #define GB_ADD_CAST_ARRAY_TO_SCALAR(s,Ax,p) \ s = (s == Ax [p]) // s += S [i], no typecast #define GB_ADD_ARRAY_TO_SCALAR(s,S,i) \ s = (s == S [i]) // Scalar to array // W [k] = s, no typecast #define GB_COPY_SCALAR_TO_ARRAY(W,k,s) \ W [k] = s // W [k] += s, no typecast #define GB_ADD_SCALAR_TO_ARRAY(W,k,s) \ W [k] = (W [k] == s) // break the loop if terminal condition reached #define GB_HAS_TERMINAL \ 0 #define GB_TERMINAL_VALUE \ (none) #define GB_BREAK_IF_TERMINAL(t) \ ; // panel size for built-in operators #define GB_PANEL \ 8 // special case for the ANY monoid #define GB_IS_ANY_MONOID \ 0 // disable this operator and use the generic case if these conditions hold #define GB_DISABLE \ (GxB_NO_EQ || GxB_NO_BOOL || GxB_NO_EQ_BOOL) //------------------------------------------------------------------------------ // reduce to a scalar, for monoids only //------------------------------------------------------------------------------ GrB_Info GB_red_scalar__eq_bool ( bool *result, const GrB_Matrix A, GB_void *GB_RESTRICT W_space, int ntasks, int nthreads ) { #if GB_DISABLE return (GrB_NO_VALUE) ; #else bool s = (*result) ; #include "GB_reduce_panel.c" (*result) = s ; return (GrB_SUCCESS) ; #endif } //------------------------------------------------------------------------------ // reduce to each vector: each vector A(:,k) reduces to a scalar Tx (k) //------------------------------------------------------------------------------ GrB_Info GB_red_eachvec__eq_bool ( bool *GB_RESTRICT Tx, GrB_Matrix A, const int64_t *GB_RESTRICT kfirst_slice, const int64_t *GB_RESTRICT klast_slice, const int64_t *GB_RESTRICT pstart_slice, GB_void *Wfirst_space, GB_void *Wlast_space, int ntasks, int nthreads ) { #if GB_DISABLE return (GrB_NO_VALUE) ; #else #include "GB_reduce_each_vector.c" return (GrB_SUCCESS) ; #endif } //------------------------------------------------------------------------------ // reduce to each index: each A(i,:) reduces to a scalar T (i) //------------------------------------------------------------------------------ GrB_Info GB_red_eachindex__eq_bool ( GrB_Matrix *Thandle, GrB_Type ttype, GrB_Matrix A, const int64_t *GB_RESTRICT pstart_slice, int nth, int nthreads, GB_Context Context ) { #if GB_DISABLE return (GrB_NO_VALUE) ; #else GrB_Info info = GrB_SUCCESS ; GrB_Matrix T = NULL ; (*Thandle) = NULL ; #define GB_FREE_ALL ; #include "GB_reduce_each_index.c" (*Thandle) = T ; return (info) ; #endif } //------------------------------------------------------------------------------ // build matrix //------------------------------------------------------------------------------ GrB_Info GB_red_build__eq_bool ( bool *GB_RESTRICT Tx, int64_t *GB_RESTRICT Ti, const bool *GB_RESTRICT S, int64_t nvals, int64_t ndupl, const int64_t *GB_RESTRICT I_work, const int64_t *GB_RESTRICT K_work, const int64_t *GB_RESTRICT tstart_slice, const int64_t *GB_RESTRICT tnz_slice, int nthreads ) { #if GB_DISABLE return (GrB_NO_VALUE) ; #else #include "GB_reduce_build_template.c" return (GrB_SUCCESS) ; #endif } #endif
{ "pile_set_name": "Github" }
{ "name": "note-wrangler", "version": "0.0.0", "dependencies": { "body-parser": { "version": "1.12.0", "from": "body-parser@^1.4.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.12.0.tgz", "dependencies": { "bytes": { "version": "1.0.0", "from": "bytes@1.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz" }, "content-type": { "version": "1.0.1", "from": "content-type@~1.0.1", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.1.tgz" }, "debug": { "version": "2.1.1", "from": "debug@~2.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-2.1.1.tgz", "dependencies": { "ms": { "version": "0.6.2", "from": "ms@0.6.2", "resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz" } } }, "depd": { "version": "1.0.0", "from": "depd@~1.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-1.0.0.tgz" }, "iconv-lite": { "version": "0.4.7", "from": "iconv-lite@0.4.7", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.7.tgz" }, "on-finished": { "version": "2.2.0", "from": "on-finished@~2.2.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.2.0.tgz", "dependencies": { "ee-first": { "version": "1.1.0", "from": "ee-first@1.1.0", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz" } } }, "qs": { "version": "2.3.3", "from": "qs@2.3.3", "resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz" }, "raw-body": { "version": "1.3.3", "from": "raw-body@1.3.3", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.3.3.tgz" }, "type-is": { "version": "1.6.0", "from": "type-is@~1.6.0", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.0.tgz", "dependencies": { "media-typer": { "version": "0.3.0", "from": "media-typer@0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz" }, "mime-types": { "version": "2.0.9", "from": "mime-types@~2.0.9", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.9.tgz", "dependencies": { "mime-db": { "version": "1.7.0", "from": "mime-db@~1.7.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.7.0.tgz" } } } } } } }, "cookie-parser": { "version": "1.3.4", "from": "cookie-parser@^1.3.2", "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.3.4.tgz", "dependencies": { "cookie": { "version": "0.1.2", "from": "cookie@0.1.2", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.2.tgz" }, "cookie-signature": { "version": "1.0.6", "from": "cookie-signature@1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" } } }, "express": { "version": "4.4.5", "from": "express@~4.4.1", "resolved": "https://registry.npmjs.org/express/-/express-4.4.5.tgz", "dependencies": { "accepts": { "version": "1.0.7", "from": "accepts@~1.0.5", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.0.7.tgz", "dependencies": { "mime-types": { "version": "1.0.2", "from": "mime-types@~1.0.0", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz" }, "negotiator": { "version": "0.4.7", "from": "negotiator@0.4.7", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.4.7.tgz" } } }, "buffer-crc32": { "version": "0.2.3", "from": "buffer-crc32@0.2.3", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.3.tgz" }, "debug": { "version": "1.0.2", "from": "debug@1.0.2", "resolved": "https://registry.npmjs.org/debug/-/debug-1.0.2.tgz", "dependencies": { "ms": { "version": "0.6.2", "from": "ms@0.6.2", "resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz" } } }, "escape-html": { "version": "1.0.1", "from": "escape-html@1.0.1", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz" }, "methods": { "version": "1.0.1", "from": "methods@1.0.1", "resolved": "https://registry.npmjs.org/methods/-/methods-1.0.1.tgz" }, "parseurl": { "version": "1.0.1", "from": "parseurl@1.0.1", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.0.1.tgz" }, "proxy-addr": { "version": "1.0.1", "from": "proxy-addr@1.0.1", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.0.1.tgz", "dependencies
{ "pile_set_name": "Github" }
// // LUTheme.h // // Lunar Unity Mobile Console // https://github.com/SpaceMadness/lunar-unity-console // // Copyright 2019 Alex Lementuev, SpaceMadness. // // 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 <UIKit/UIKit.h> @interface LUCellSkin : NSObject + (instancetype)cellSkin; @property (nonatomic, readonly) UIImage *icon; @property (nonatomic, readonly) UIColor *textColor; @property (nonatomic, readonly) UIColor *backgroundColorLight; @property (nonatomic, readonly) UIColor *backgroundColorDark; @property (nonatomic, readonly) UIColor *overlayTextColor; @end @interface LUButtonSkin : NSObject + (instancetype)buttonSkin; @property (nonatomic, readonly) UIImage *normalImage; @property (nonatomic, readonly) UIImage *selectedImage; @property (nonatomic, readonly) UIFont *font; @end @interface LUTheme : NSObject @property (nonatomic, readonly) UIColor *statusBarColor; @property (nonatomic, readonly) UIColor *statusBarTextColor; @property (nonatomic, readonly) UIColor *tableColor; @property (nonatomic, readonly) UIColor *logButtonTitleColor; @property (nonatomic, readonly) UIColor *logButtonTitleSelectedColor; @property (nonatomic, readonly) LUCellSkin *cellLog; @property (nonatomic, readonly) LUCellSkin *cellError; @property (nonatomic, readonly) LUCellSkin *cellWarning; @property (nonatomic, readonly) UIColor *backgroundColorLight; @property (nonatomic, readonly) UIColor *backgroundColorDark; @property (nonatomic, readonly) UIFont *font; @property (nonatomic, readonly) UIFont *fontOverlay; @property (nonatomic, readonly) UIFont *fontSmall; @property (nonatomic, readonly) NSLineBreakMode lineBreakMode; @property (nonatomic, readonly) CGFloat cellHeight; @property (nonatomic, readonly) CGFloat indentHor; @property (nonatomic, readonly) CGFloat indentVer; @property (nonatomic, readonly) CGFloat cellHeightTiny; @property (nonatomic, readonly) CGFloat indentHorTiny; @property (nonatomic, readonly) CGFloat indentVerTiny; @property (nonatomic, readonly) CGFloat buttonWidth; @property (nonatomic, readonly) CGFloat buttonHeight; @property (nonatomic, readonly) LUButtonSkin *actionButtonLargeSkin; @property (nonatomic, readonly) UIImage *collapseBackgroundImage; @property (nonatomic, readonly) UIColor *collapseBackgroundColor; @property (nonatomic, readonly) UIColor *collapseTextColor; @property (nonatomic, readonly) UIFont *actionsWarningFont; @property (nonatomic, readonly) UIColor *actionsWarningTextColor; @property (nonatomic, readonly) UIFont *actionsFont; @property (nonatomic, readonly) UIColor *actionsTextColor; @property (nonatomic, readonly) UIColor *actionsBackgroundColorLight; @property (nonatomic, readonly) UIColor *actionsBackgroundColorDark; @property (nonatomic, readonly) UIFont *actionsGroupFont; @property (nonatomic, readonly) UIColor *actionsGroupTextColor; @property (nonatomic, readonly) UIColor *actionsGroupBackgroundColor; @property (nonatomic, readonly) UIFont *contextMenuFont; @property (nonatomic, readonly) UIColor *contextMenuBackgroundColor; @property (nonatomic, readonly) UIColor *contextMenuTextColor; @property (nonatomic, readonly) UIColor *contextMenuTextHighlightColor; @property (nonatomic, readonly) UIColor *contextMenuTextProColor; @property (nonatomic, readonly) UIColor *contextMenuTextProHighlightColor; @property (nonatomic, readonly) UIFont *variableEditFont; @property (nonatomic, readonly) UIColor *variableEditTextColor; @property (nonatomic, readonly) UIColor *variableEditBackground; @property (nonatomic, readonly) UIColor *variableTextColor; @property (nonatomic, readonly) UIColor *variableVolatileTextColor; @property (nonatomic, readonly) UIFont *enumButtonFont; @property (nonatomic, readonly) UIColor *enumButtonTitleColor; @property (nonatomic, readonly) UIColor *switchTintColor; @property (nonatomic, readonly) UIImage *settingsIconImage; @property (nonatomic, readonly) UIColor *settingsTextColorUnavailable; @property (nonatomic, readonly) UIFont *logMessageDetailFont; @property (nonatomic, readonly) UIColor *logMessageStacktraceColor; + (LUTheme *)mainTheme; @end
{ "pile_set_name": "Github" }
<html> <head> <title>motivation.html</title> <link rel="stylesheet" type="text/css" href="../styles.css"> </head> <body> <h4>Motivation</h4> <div> The C++ function and template parameter lists are special syntactic constructs, and it is impossible to directly manipulate or generate them using C++ constructs.&nbsp; This leads to unnecessary code repetition. </div> <div> Consider the implementation of the <code>is_function&lt;&gt;</code> metafunction is Boost.&nbsp; The implementation uses an overloaded <code>is_function_tester()</code> function that is used for testing if a type is convertible to a pointer to a function.&nbsp; Because of the special treatment of parameter lists, it is not possible to directly match a function with an arbitrary parameter list.&nbsp; Instead, the <code>is_function_tester()</code> must be overloaded for every distinct number of parameters that is to be supported.&nbsp; For example: </div> <div class="code"><pre> template&lt;class R&gt; yes_type is_function_tester(R (*)()); template&lt;class R, class A0&gt; yes_type is_function_tester(R (*)(A0)); template&lt;class R, class A0, class A1&gt; yes_type is_function_tester(R (*)(A0, A1)); template&lt;class R, class A0, class A1, class A2&gt; yes_type is_function_tester(R (*)(A0, A1, A2)); // ... </pre></div> <div> The need for this kind of repetition occurs particularly frequently while implementing generic components or metaprogramming facilities, but the need also manifests itself in many far simpler situations. </div> <h4>Typical Solutions</h4> <div> Typically the repetition is done manually.&nbsp; Manual code repetition is highly unproductive, but sometimes more readable to the untrained eye. </div> <div> Another solution is to write an external program for generating the repeated code or use some other extra linguistic means such as a smart editor.&nbsp; Unfortunately, using external code generators has many disadvantages: <ul> <li>Writing the generator takes time.&nbsp; (This could be helped by using a standard generator.)</li> <li>It is no longer productive to manipulate C++ code directly.</li> <li>Invoking the generator may be difficult.</li> <li>Automating the invocation of the generator can be difficult in certain environments.&nbsp; (Automatic invocation is desirable for active libraries.)</li> <li>Porting and distributing the generator may be difficult or simply takes precious time.</li> </ul> </div> <h4>What about the preprocessor?</h4> <div> Because C++ comes with a preprocessor, one would assume that it would support these kinds of needs directly.&nbsp; Using the preprocessor in this case is highly desirable because: <ul> <li>The preprocessor is highly portable.</li> <li>The preprocessor is automatically invoked as part of the compilation process.</li> <li>Preprocessor metacode can be directly embedded into the C++ source code.</li> <li>Compilers generally allow viewing or outputting the preprocessed code, which can be used for debugging or to copy and paste the generated code.</li> </ul> </div> <div> Most unfortunately, the preprocessor is a very low level preprocessor that specifically does not support repetition or recursive macros.&nbsp; Library support is needed! </div> <div> <i>For detailed information on the capabilities and limitations of the preprocessor, please refer to the C++ standard <a href="../bibliography.html#std">[Std]</a>.</i> </div> <h4>The Motivation Example Revisited</h4> <div> Using the primitives of the preprocessor library, the <code>is_function_tester()</code>'s could be implemented like this: </div> <div class="code"><pre> #include &lt;boost/preprocessor/arithmetic/inc.hpp&gt; #include &lt;boost/preprocessor/punctuation/comma_if.hpp&gt; #include &lt;boost/preprocessor/repetition.hpp&gt; #ifndef MAX_IS_FUNCTION_TESTER_PARAMS #define MAX_IS_FUNCTION_TESTER_PARAMS 15 #endif #define IS_FUNCTION_TESTER(Z, N, _) \ template&lt;class R BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_PARAMS(N, class A)&gt; \ yes_type is_function_tester(R (*)(BOOST_PP_ENUM_PARAMS(N, A))); \ /**/ BOOST_PP_REPEAT(BOOST_PP_INC(MAX_IS_FUNCTION_TESTER_PARAMS), IS_FUNCTION_TESTER, _) #undef IS_FUNCTION_TESTER </pre></div> <div> In order to change the maximum number of function parameters supported, you now simply change the <code>MAX_IS_FUNCTION_TESTER_PARAMS</code> definition and recompile. </div> <hr size="1"> <div style="margin-left: 0px;"> <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i> </div> <div style="margin-left: 0px;"> Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies.&nbsp; This document is provided "as is" without express or implied warranty and with no claim as to its suitability for any purpose. </div> <hr size="1"> <div style="margin-left: 0px;"> <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i> </br><i>© Copyright Paul Mensonides 2002</i> </div> <div style="margin-left: 0px;"> <p><small>Distributed under the Boost Software License, Version 1.0. (See accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or copy at <a href= "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p> </div> </body> </html>
{ "pile_set_name": "Github" }
#begin document (wb/sel/71/sel_7181); part 000 wb/sel/71/sel_7181 -1 0 [WORD] XX (TOP* - - - - * - wb/sel/71/sel_7181 -1 1 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 2 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 3 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 4 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 5 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 6 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 7 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 8 [WORD] VERB * muzzle - 1 - * - wb/sel/71/sel_7181 -1 9 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 10 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 11 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 12 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 13 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 14 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 15 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 16 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 17 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 18 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 19 [WORD] XX * - - - - * - wb/sel/71/sel_7181 -1 20 [WORD] XX *) - - - - * - #end document
{ "pile_set_name": "Github" }
int ibm_partition(struct parsed_partitions *);
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.camel.component.atmosphere.websocket; import org.apache.camel.test.AvailablePortFinder; import org.apache.camel.test.junit5.CamelTestSupport; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; public class WebsocketCamelRouterWithInitParamTestSupport extends CamelTestSupport { public static final String CONTEXT = "/mycontext"; public static final String CONTEXT_URL = "http://localhost/mycontext"; protected static final int PORT = AvailablePortFinder.getNextAvailable(); protected boolean startCamelContext = true; protected Server server; protected ServletHolder servletHolder; @Override @BeforeEach public void setUp() throws Exception { server = new Server(PORT); ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); context.setContextPath("/"); server.setHandler(context); if (startCamelContext) { super.setUp(); } servletHolder = new ServletHolder(new CamelWebSocketServlet()); servletHolder.setName("CamelWsServlet"); servletHolder.setInitParameter("events", "true"); context.addServlet(servletHolder, "/*"); server.start(); } @Override @AfterEach public void tearDown() throws Exception { if (startCamelContext) { super.tearDown(); } server.stop(); server.destroy(); } }
{ "pile_set_name": "Github" }
start = (bcv_hyphen_range / sequence / cb_range / range / ff / bcv_comma / bc_title / ps151_bcv / bcv / bcv_weak / ps151_bc / bc / cv_psalm / bv / c_psalm / b / cbv / cbv_ordinal / cb / cb_ordinal / translation_sequence_enclosed / translation_sequence / sequence_sep / c_title / integer_title / cv / cv_weak / v_letter / integer / c / v / word / word_parenthesis / context)+ /* Multiples */ sequence = val_1:(cb_range / bcv_hyphen_range / range / ff / bcv_comma / bc_title / ps151_bcv / bcv / bcv_weak / ps151_bc / bc / cv_psalm / bv / c_psalm / b / cbv / cbv_ordinal / cb / cb_ordinal / context) val_2:(sequence_sep? sequence_post)+ { val_2.unshift([val_1]); return {"type": "sequence", "value": val_2, "indices": [peg$savedPos, peg$currPos - 1]} } sequence_post_enclosed = "(" sp sequence_sep? val_1:(sequence_post) val_2:(sequence_sep? sequence_post)* sp ")" { if (typeof(val_2) === "undefined") val_2 = []; val_2.unshift([val_1]); return {"type": "sequence_post_enclosed", "value": val_2, "indices": [peg$savedPos, peg$currPos - 1]} } sequence_post = sequence_post_enclosed / cb_range / bcv_hyphen_range / range / ff / bcv_comma / bc_title / ps151_bcv / bcv / bcv_weak / ps151_bc / bc / cv_psalm / bv / c_psalm / b / cbv / cbv_ordinal / cb / cb_ordinal / c_title / integer_title / cv / cv_weak / v_letter / integer / c / v // `cv_weak` is after `integer` in `val_2` to avoid cases like "Mark 16:1-6 10". `b` is a special case to avoid oddities like "Ezekiel - 25:16". range = val_1:(bcv_comma / bc_title / ps151_bcv / bcv / bcv_weak / ps151_bc / bc / cv_psalm / bv / b &(range_sep (bcv_comma / bc_title / ps151_bcv / bcv / bcv_weak / ps151_bc / bc / bv / b)) / cbv / cbv_ordinal / c_psalm / cb / cb_ordinal / c_title / integer_title / cv / cv_weak / v_letter / integer / c / v) range_sep val_2:(ff / bcv_comma / bc_title / ps151_bcv / bcv / bcv_weak / ps151_bc / bc / cv_psalm / bv / b / cbv / cbv_ordinal / c_psalm / cb / cb_ordinal / c_title / integer_title / cv / v_letter / integer / cv_weak / c / v) { if (val_1.length && val_1.length === 2) val_1 = val_1[0]; // for `b`, which returns [object, undefined] return {"type": "range", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} } /* Singles */ b = "\x1f" val:any_integer ("/" [1-8])? "\x1f" { return {"type": "b", "value": val.value, "indices": [peg$savedPos, peg$currPos - 1]} } // `v_explicit` is OK only if we're sure it's a cv--otherwise, treat it as a bv. bc = val_1:b (v_explicit &(c cv_sep v) / cv_sep+ / cv_sep_weak+ / range_sep+ / sp) val_2:c { return {"type": "bc", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} } // Used only in bcv_comma. bc_comma = val_1:b sp "," sp val_2:c { return {"type": "bc", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} } bc_title = val_1:(ps151_bc / bc) val_2:title { return {"type": "bc_title", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} } bcv = val_1:(ps151_bc / bc) !("." v_explicit v / sequence_sep? v_explicit cv) ((cv_sep / sequence_sep)? v_explicit / cv_sep) val_2:(v_letter / v) { return {"type": "bcv", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} } bcv_weak = val_1:(ps151_bc / bc) cv_sep_weak val_2:(v_letter / v) !(cv_sep v) { return {"type": "bcv", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} } // A special case that happens with surprising frequency ("Matt, 5, 6" = "Matt 5:6"). bcv_comma = val_1:bc_comma sp "," sp val_2:(v_letter / v) !(cv_sep v) { return {"type": "bcv", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} } // A special case ("Matt 5-6-7") of a range that might otherwise get interpreted in a different way. bcv_hyphen_range = val_1:b ("-" / space)? val_2:c "-" val_3:v "-" val_4:v { return {"type": "range", "value": [{"type": "bcv", "value": [{"type": "bc", "value": [val_1, val_2], "indices": [val_1.indices[0], val_2.indices[1]]}, val_3], "indices": [val_1.indices[0], val_3.indices[1]]}, val_4], "indices": [peg$savedPos, peg$currPos - 1]} } // A sequence_sep is only OK if followed by an explicit verse indicator. bv = val_1:b (cv_sep+ / cv_sep_weak+ / range_sep+ / sequence_sep+ &v_explicit / sp) val_2:(v_letter / v) { return {"type": "bv", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} } cb = c_explicit val_1:c in_book_of? val_2:b { return {"type": "bc", "value": [val_2, val_1], "indices": [peg$savedPos, peg$currPos - 1]} } cb_range = c_explicit val_1:c range_sep val_2:c in_book_of? val_3:b { return {"type": "cb_range", "value": [val_3, val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} } cbv = val_1:cb sequence_sep? v_explicit val_2:v { return {"type": "bcv", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} } cb_ordinal = val_1:c ("th" / "nd" / "st") c_explicit in_book_of? val_2:b { return {"type": "bc", "value": [val_2, val_1], "indices": [peg$saved
{ "pile_set_name": "Github" }
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """ Orthogonal instrumental variable estimation of ATE. """ import numpy as np from econml.utilities import hstack from sklearn.model_selection import KFold, StratifiedKFold from sklearn.linear_model import LinearRegression import scipy.stats from sklearn.base import clone class DMLATEIV: """ Implementation of the orthogonal/double ml method for ATE estimation with IV as described in Double/Debiased Machine Learning for Treatment and Causal Parameters Victor Chernozhukov, Denis Chetverikov, Mert Demirer, Esther Duflo, Christian Hansen, Whitney Newey, James Robins https://arxiv.org/abs/1608.00060 Requires that either co-variance of T, Z is independent of X or that effect is not heterogeneous in X for correct recovery. Otherwise it estimates a biased ATE. """ def __init__(self, model_Y_X, model_T_X, model_Z_X, n_splits=2, binary_instrument=False, binary_treatment=False): """ Parameters ---------- model_Y_X : model to predict E[Y | X] model_T_X : model to predict E[T | X]. In alt_fit, this model is also used to predict E[T | X, Z] model_Z_X : model to predict E[Z | X] n_splits : number of splits to use in cross-fitting binary_instrument : whether to stratify cross-fitting splits by instrument binary_treatment : whether to stratify cross-fitting splits by treatment """ self.model_Y_X = [clone(model_Y_X, safe=False) for _ in range(n_splits)] self.model_T_X = [clone(model_T_X, safe=False) for _ in range(n_splits)] self.model_Z_X = [clone(model_Z_X, safe=False) for _ in range(n_splits)] self.n_splits = n_splits self.binary_instrument = binary_instrument self.binary_treatment = binary_treatment def fit(self, y, T, X, Z): """ Parameters ---------- y : outcome T : treatment (single dimensional) X : features/controls Z : instrument (single dimensional) """ if len(Z.shape) > 1 and Z.shape[1] > 1: raise AssertionError("Can only accept single dimensional instrument") if len(T.shape) > 1 and T.shape[1] > 1: raise AssertionError("Can only accept single dimensional treatment") if len(y.shape) > 1 and y.shape[1] > 1: raise AssertionError("Can only accept single dimensional outcome") Z = Z.flatten() T = T.flatten() y = y.flatten() n_samples = y.shape[0] res_t = np.zeros(n_samples) res_z = np.zeros(n_samples) res_y = np.zeros(n_samples) if self.n_splits == 1: splits = [(np.arange(X.shape[0]), np.arange(X.shape[0]))] elif self.binary_instrument or self.binary_treatment: group = 2*T*self.binary_treatment + Z.flatten()*self.binary_instrument splits = StratifiedKFold( n_splits=self.n_splits, shuffle=True).split(X, group) else: splits = KFold(n_splits=self.n_splits, shuffle=True).split(X) for idx, (train, test) in enumerate(splits): # Calculate residuals res_t[test] = T[test] - \ self.model_T_X[idx].fit(X[train], T[train]).predict(X[test]) res_z[test] = Z[test] - \ self.model_Z_X[idx].fit(X[train], Z[train]).predict(X[test]) res_y[test] = y[test] - \ self.model_Y_X[idx].fit(X[train], y[train]).predict(X[test]) # Estimate E[T_res | Z_res] self._effect = np.mean(res_y * res_z)/np.mean(res_t * res_z) self._std = np.std(res_y * res_z)/(np.sqrt(res_y.shape[0]) * np.abs(np.mean(res_t * res_z))) return self def effect(self, X=None): """ Parameters ---------- X : features """ if X is None: return self._effect else: return self._effect * np.ones(X.shape[0]) def normal_effect_interval(self, lower=5, upper=95): return (scipy.stats.norm.ppf(lower/100, loc=self._effect, scale=self._std), scipy.stats.norm.ppf(upper/100, loc=self._effect, scale=self._std)) @property def std(self): return self._std @property def fitted_nuisances(self): return {'model_Y_X': self.model_Y_X, 'model_T_X': self.model_T_X, 'model_Z_X': self.model_Z_X} class ProjectedDMLATEIV: """ Implementation of the orthogonal/double ml method for ATE estimation with IV as described in Double/Debiased Machine Learning for Treatment and Causal Parameters Victor Chernozhukov, Denis Chetverikov, Mert Demirer, Esther Duflo, Christian Hansen, Whitney Newey, James Robins https://arxiv.org/abs/1608.00060 Here we also project the insturment on the treatment and use E[T|X,Z] as the instrument. Requires that either co-variance of T, Z is independent of X or that effect is not heterogeneous in X for correct recovery. Otherwise it estimates a biased ATE. """ def __init__(self, model_Y_X, model_T_X, model_T_XZ, n_splits=2, binary_instrument=False, binary_treatment=False): """ Parameters ---------- model_Y_X : model to predict E[Y | X] model_T_X : model to predict E[T | X] model_T_XZ : model to predict E[T | X, Z] n_splits : number of splits to use in cross-fitting binary_instrument : whether to stratify cross-fitting splits by instrument binary_treatment : whether to stratify cross-fitting splits by treatment """ self.model_Y_X = [clone(model_Y_X, safe=False) for _ in range(n_splits)] self.model_T_X = [clone(model_T_X, safe=False) for _ in range(n_splits)] self.model_T_XZ = [clone(model_T_XZ, safe=False) for _ in range(n_splits)] self.n_splits = n_splits self.binary_instrument = binary_instrument self.binary_treatment = binary_treatment def fit(self, y, T, X, Z): """ Parameters ---------- y : outcome T : treatment (single dimensional) X : features/controls Z : instrument """ if len(T.shape) > 1 and T.shape[1] > 1: raise AssertionError("Can only accept single dimensional treatment") if len(y.shape) > 1 and y.shape[1] > 1: raise AssertionError("Can only accept single dimensional outcome") if len(Z.shape) == 1: Z = Z.
{ "pile_set_name": "Github" }
raise NotImplementedError("warnings is not yet implemented in Skulpt")
{ "pile_set_name": "Github" }
Description: Ensure IEEE compliant floating-point operations (overflow and division by zero). Files: m4/fpieee.m4 Depends-on: configure.ac-early: AC_REQUIRE([gl_FP_IEEE]) configure.ac: Makefile.am: Include: License: LGPLv2+ Maintainer: all
{ "pile_set_name": "Github" }
; RUN: opt < %s -add-discriminators -S | FileCheck %s ; RUN: opt < %s -passes=add-discriminators -S | FileCheck %s ; Discriminator support for multiple CFG paths on the same line. ; ; void foo(int i) { ; int x; ; if (i < 10) x = i; else x = -i; ; } ; ; The two stores inside the if-then-else line must have different discriminator ; values. define void @foo(i32 %i) #0 !dbg !4 { entry: %i.addr = alloca i32, align 4 %x = alloca i32, align 4 store i32 %i, i32* %i.addr, align 4 %0 = load i32, i32* %i.addr, align 4, !dbg !10 %cmp = icmp slt i32 %0, 10, !dbg !10 br i1 %cmp, label %if.then, label %if.else, !dbg !10 if.then: ; preds = %entry %1 = load i32, i32* %i.addr, align 4, !dbg !10 ; CHECK: %1 = load i32, i32* %i.addr, align 4, !dbg ![[THEN:[0-9]+]] store i32 %1, i32* %x, align 4, !dbg !10 ; CHECK: store i32 %1, i32* %x, align 4, !dbg ![[THEN]] br label %if.end, !dbg !10 ; CHECK: br label %if.end, !dbg ![[THEN]] if.else: ; preds = %entry %2 = load i32, i32* %i.addr, align 4, !dbg !10 ; CHECK: %2 = load i32, i32* %i.addr, align 4, !dbg ![[ELSE:[0-9]+]] %sub = sub nsw i32 0, %2, !dbg !10 ; CHECK: %sub = sub nsw i32 0, %2, !dbg ![[ELSE]] store i32 %sub, i32* %x, align 4, !dbg !10 ; CHECK: store i32 %sub, i32* %x, align 4, !dbg ![[ELSE]] br label %if.end if.end: ; preds = %if.else, %if.then ret void, !dbg !12 } attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 (trunk 199750) (llvm/trunk 199751)", isOptimized: false, emissionKind: NoDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2) !1 = !DIFile(filename: "multiple.c", directory: ".") !2 = !{} !4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "multiple.c", directory: ".") !6 = !DISubroutineType(types: !{null, !13}) !13 = !DIBasicType(encoding: DW_ATE_signed, name: "int", size: 32, align: 32) !7 = !{i32 2, !"Dwarf Version", i32 4} !8 = !{i32 1, !"Debug Info Version", i32 3} !9 = !{!"clang version 3.5 (trunk 199750) (llvm/trunk 199751)"} !10 = !DILocation(line: 3, scope: !11) !11 = distinct !DILexicalBlock(line: 3, column: 0, file: !1, scope: !4) !12 = !DILocation(line: 4, scope: !4) ; CHECK: ![[THEN]] = !DILocation(line: 3, scope: ![[THENBLOCK:[0-9]+]]) ; CHECK: ![[THENBLOCK]] = !DILexicalBlockFile(scope: ![[SCOPE:[0-9]+]],{{.*}} discriminator: 2) ; CHECK: ![[ELSE]] = !DILocation(line: 3, scope: ![[ELSEBLOCK:[0-9]+]]) ; CHECK: ![[ELSEBLOCK]] = !DILexicalBlockFile(scope: ![[SCOPE]],{{.*}} discriminator: 4)
{ "pile_set_name": "Github" }
{ "type": "bundle", "id": "bundle--6a7149d4-8100-4b19-a8ec-69b07ef00ae9", "spec_version": "2.0", "objects": [ { "type": "course-of-action", "id": "course-of-action--3e8c9442-1e01-4fc2-9f90-b009bf6612fa", "created_by_ref": "identity--e50ab59c-5c4f-4d40-bf6a-d58418d89bcd", "created": "2014-06-23T00:00:00.000Z", "modified": "2020-07-30T00:00:00.000Z", "name": "coa-76-3", "description": "Design: For interactive user applications, consider if direct file system interface is necessary, instead consider having the application proxy communication.", "object_marking_refs": [ "marking-definition--17d82bb2-eeeb-4898-bda5-3ddbcd2b799d" ], "x_capec_version": "3.3" } ] }
{ "pile_set_name": "Github" }
--- Description: Parental Controls Feature Set ms.assetid: 25b9d906-6e26-488c-9d5b-a0c27d6cfe76 title: Parental Controls Feature Set ms.topic: article ms.date: 05/31/2018 --- # Parental Controls Feature Set Information about the feature set in Parental Controls is organized as follows: - [Parental Controls Top-Level User Interface](parental-controls-top-level-user-interface.md) - [Parental Controls Activity Reporting](parental-controls-activity-reporting.md) - [Parental Controls In-Box Restrictions and User Interfaces](parental-controls-in-box-restrictions-and-user-interfaces.md) - [Parental Controls API Overview](parental-controls-api-overview.md) - [Parental Controls Extensibility Features Overview](parental-controls-extensibility-features-overview.md)    
{ "pile_set_name": "Github" }
sha256:fbcf0ef3bcd0249075ef53a42bdb475dad277992936b7f9b99ceae19c08a344a
{ "pile_set_name": "Github" }
<?php /** * PHPIDS * * Requirements: PHP5, SimpleXML * * Copyright (c) 2008 PHPIDS group (http://php-ids.org) * * PHPIDS 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, version 3 of the License, or * (at your option) any later version. * * PHPIDS 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 PHPIDS. If not, see <http://www.gnu.org/licenses/>. * * PHP version 5.1.6+ * * @category Security * @package PHPIDS * @author Mario Heiderich <mario.heiderich@gmail.com> * @author Christian Matthies <ch0012@gmail.com> * @author Lars Strojny <lars@strojny.net> * @license http://www.gnu.org/licenses/lgpl.html LGPL * @link http://php-ids.org/ */ require_once 'IDS/Caching/Interface.php'; /** * Needed SQL: * #create the database CREATE DATABASE IF NOT EXISTS `phpids` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; DROP TABLE IF EXISTS `cache`; #now select the created datbase and create the table CREATE TABLE `cache` ( `type` VARCHAR( 32 ) NOT null , `data` TEXT NOT null , `created` DATETIME NOT null , `modified` DATETIME NOT null ) ENGINE = MYISAM ; */ /** * Database caching wrapper * * This class inhabits functionality to get and set cache via a database. * * @category Security * @package PHPIDS * @author Christian Matthies <ch0012@gmail.com> * @author Mario Heiderich <mario.heiderich@gmail.com> * @author Lars Strojny <lars@strojny.net> * @copyright 2007 The PHPIDS Groupup * @license http://www.gnu.org/licenses/lgpl.html LGPL * @version Release: $Id:Database.php 517 2007-09-15 15:04:13Z mario $ * @link http://php-ids.org/ * @since Version 0.4 */ class IDS_Caching_Database implements IDS_Caching_Interface { /** * Caching type * * @var string */ private $type = null; /** * Cache configuration * * @var array */ private $config = null; /** * DBH * * @var object */ private $handle = null; /** * Holds an instance of this class * * @var object */ private static $cachingInstance = null; /** * Constructor * * Connects to database. * * @param string $type caching type * @param array $init the IDS_Init object * * @return void */ public function __construct($type, $init) { $this->type = $type; $this->config = $init->config['Caching']; $this->handle = $this->_connect(); } /** * Returns an instance of this class * * @param string $type caching type * @param array $init the IDS_Init object * * @return object $this */ public static function getInstance($type, $init) { if (!self::$cachingInstance) { self::$cachingInstance = new IDS_Caching_Database($type, $init); } return self::$cachingInstance; } /** * Writes cache data into the database * * @param array $data the caching data * * @throws PDOException if a db error occurred * @return object $this */ public function setCache(array $data) { $handle = $this->handle; $rows = $handle->query('SELECT created FROM `' . $handle->quote($this->config['table']).'`'); if (!$rows || $rows->rowCount() === 0) { $this->_write($handle, $data); } else { foreach ($rows as $row) { if ((time()-strtotime($row['created'])) > $this->config['expiration_time']) { $this->_write($handle, $data); } } } return $this; } /** * Returns the cached data * * Note that this method returns false if either type or file cache is * not set * * @throws PDOException if a db error occurred * @return mixed cache data or false */ public function getCache() { try{ $handle = $this->handle; $result = $handle->prepare('SELECT * FROM ' . $handle->quote($this->config['table']) . ' where type=?'); $result->execute(array($this->type)); foreach ($result as $row) { return unserialize($row['data']); } } catch (PDOException $e) { die('PDOException: ' . $e->getMessage()); } return false; } /** * Connect to database and return a handle * * @return object dbh * @throws PDOException if a db error occurred */ private function _connect() { // validate connection parameters if (!$this->config['wrapper'] || !$this->config['user'] || !$this->config['password'] || !$this->config['table']) { throw new Exception(' Insufficient connection parameters' ); } // try to connect try { $handle = new PDO( $this->config['wrapper'], $this->config['user'], $this->config['password'] ); } catch (PDOException $e) { die('PDOException: ' . $e->getMessage()); } return $handle; } /** * Write the cache data to the table * * @param object $handle the database handle * @param array $data the caching data * * @return object dbh * @throws PDOException if a db error occurred */ private function _write($handle, $data) { try { $handle->query('TRUNCATE ' . $this->config['table'].''); $statement = $handle->prepare(' INSERT INTO `' . $this->config['table'].'` ( type, data, created, modified ) VALUES ( :type, :data, now(), now() ) '); $statement->bindParam('type', $handle->quote($this->type)); $statement->bindParam('data', serialize($data)); if (!$statement->execute()) { throw new PDOException($statement->errorCode()); } } catch (PDOException $e) { die('PDOException: ' . $e->getMessage()); } } } /** * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 expandtab */
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 -fsyntax-only -verify %s // rdar://8191774 @protocol SomeProtocol @end @protocol SomeProtocol1 @end @interface SomeObject <SomeProtocol> @end int main () { Class <SomeProtocol> classA; Class <SomeProtocol> classB; Class <SomeProtocol, SomeProtocol1> classC; Class <SomeProtocol1> classD; void * pv = 0; Class c = (Class)0;; if (pv) return classA == pv; if (c) return classA == c; return classA == classB || classA == classC || classC == classA || classA == classD; // expected-warning {{comparison of distinct pointer types ('Class<SomeProtocol>' and 'Class<SomeProtocol1>')}} } // rdar://18491222 @protocol NSObject @end @interface NSObject @end @protocol ProtocolX <NSObject> @end @protocol ProtocolY <NSObject> @end @interface ClassA : NSObject @end @interface ClassB : ClassA <ProtocolY, ProtocolX> @end @interface OtherClass : NSObject @property (nonatomic, copy) ClassB<ProtocolX> *aProperty; - (ClassA<ProtocolY> *)aMethod; - (ClassA<ProtocolY> *)anotherMethod; @end @implementation OtherClass - (ClassA<ProtocolY> *)aMethod { // This does not work, even though ClassB subclasses from A and conforms to Y // because the property type explicity adds ProtocolX conformance // even though ClassB already conforms to ProtocolX return self.aProperty; } - (ClassA<ProtocolY> *)anotherMethod { // This works, even though all it is doing is removing an explicit // protocol conformance that ClassB already conforms to return (ClassB *)self.aProperty; } @end
{ "pile_set_name": "Github" }
'use strict'; // B.2.3.2 String.prototype.anchor(name) require('./_string-html')('anchor', function(createHTML){ return function anchor(name){ return createHTML(this, 'a', 'name', name); } });
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.renyu.scrolldeletelistview" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="21" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MyActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
{ "pile_set_name": "Github" }
class MassEdit extend ActiveModel::Naming include ActiveModel::Conversion attr_accessor :photograph_ids, :collection_ids, :action, :user def initialize(attributes = {}) attributes ||= {} attributes.each do |key, value| self.send("#{key}=", value) end end def photograph_ids @photograph_ids ||= [] @photograph_ids.map(&:to_i) end def collection_ids @collection_ids ||= [] @collection_ids.map(&:to_i) end def photographs user.photographs.where(id: photograph_ids) end def collections user.collections.where(id: collection_ids) end def persisted? false end def action case when @action.present? @action when collection_ids.size > 0 'collections' end end def self.actions [ ['Delete', 'delete'] ] end end
{ "pile_set_name": "Github" }
/* App General */ "Cancel" = "Cancelar"; "Never" = "Nunca"; "None" = "Nenhum"; "Unnamed" = "Sem nome"; "Unknown Language" = "Língua Desconhecida"; "Decoder" = "Decodificador"; "iTunes Movies" = "Filmes do iTunes"; "iTunes TV Shows" = "Programas de TV do iTunes"; "iTunes Video Podcasts" = "Podcasts em Vídeo do iTunes"; "No movie file" = "Sem arquivo de filme"; "Subtitle Font Not Found" = "Fonte da Legenda não Encontrada"; "\"%@\" not found\nSubtitle font setting will be restored to default." = "\"%@\" não encontrado\nConfiguração da fonte da legenda será restaurada para padrão."; "Cannot open file" = "Não é possível abrir arquivo"; /* Check for Updates */ "Checking for Updates..." = "Verificando por Atualizações..."; "Cannot check for update." = "Não é possível verificar por atualização."; "No update available." = "Sem atualização disponível."; "New version %@ is available." = "Nova versão %@ está disponível."; "Show Updates" = "Exibir Atualizações"; "Download" = "Baixar"; /* MainMenu: File */ "Opening with %@..." = "Abrindo com %@..."; /* MainMenu: Edit */ "Copy (Including Letter Box)" = "Copiar (Incluindo Letter Box)"; "Copy (Excluding Letter Box)" = "Copiar (Excluindo Letter Box)"; /* MainMenu: Controls */ "Play_space" = "Reproduzir"; "Pause_space" = "Pausar"; "Backward %d sec." = "Retroceder %d seg."; "Forward %d sec." = "Avançar %d seg."; "Volume Up" = "Aumentar Volume"; "Volume Down" = "Diminuir Volume"; "System Volume Up" = "Aumentar Volume do Sistema"; "System Volume Down" = "Diminuir Volume do Sistema"; /* MainMenu : Movie */ "Reopen With %@" = "Reabrir Com %@"; "No Sound Track" = "Sem Faixa de Áudio"; "Sound Track Rotation" = "Alternar Faixa de Áudio"; "Save Current Image (Including Letter Box)" = "Salvar Imagem Atual (Incluindo Letter Box)"; "Save Current Image (Excluding Letter Box)" = "Salvar Imagem Atual (Excluindo Letter Box)"; /* MainMenu : Subtitle */ "Show Subtitle" = "Exibir Legenda"; "Hide Subtitle" = "Ocultar Legenda"; "No Subtitle" = "Sem Legenda"; "Enable %@ - %@" = "Ativar %@ - %@"; "Disable %@ - %@" = "Desativar %@ - %@"; "Subtitle Rotation" = "Alternar Legenda"; /* Message : Playback */ "Play" = "Reproduzir"; "Pause" = "Pausar"; "Beginning" = "Começo"; "End" = "Final"; "Previous Subtitle" = "Legenda Anterior"; "Next Subtitle" = "Próxima Legenda"; "Previous Frame" = "Quadro Anterior"; "Next Frame" = "Próximo Quadro"; "Play Rate" = "Velocidade de Reprodução"; "Range Repeat Beginning %@" = "Início do Intervalo de Repetição %@"; "Range Repeat End %@" = "Final do Intervalo de Repetição %@"; "Range Repeat Clear" = "Limpar Intervalo de Repetição"; /* Message : common */ "%@ enabled" = "%@ ativado"; "%@ disabled" = "%@ desativado"; "%@ selected" = "%@ selecionado"; /* Message : Audio */ "Mute" = "Mudo"; "Unmute" = "Desativar Mudo"; "Volume" = "Volume"; "System Volume" = "Volume do Sistema"; "Volume cannot be changed in Digital-Out" = "Volume não pode ser mudado na Saída Digital"; "System Volume cannot be changed in Digital-Out Device" = "Volume do Sistema não pode ser mudado no dispositivo de Saída Digital"; /* Message : Video */ "Brightness" = "Brilho"; "Saturation" = "Saturação"; "Contrast" = "Contraste"; "Hue" = "Tonalidade"; /* Message: Subtitle */ "Cannot Read Subtitle" = "Legenda não pode ser Lida"; "Reopen with other encodings" = "Reabrir com outra codificação"; "Letter Box Height : Auto" = "Altura da Letter Box : Auto"; "Font Size" = "Tamanho da Fonte"; "HMargin" = "MargemH"; "VMargin" = "MargemV"; "Line Spacing" = "Espaçamento de Linha"; "Sync" = "Sinc"; "sec." = "seg."; "Subtitle %@ selected" = "Legenda %@ selecionada"; "Subtitle %@ enabled" = "Legenda %@ ativada"; "Subtitle %@ disabled" = "Legenda %@ desativada"; "Subtitle Screen Margin" = "Margem de Tela de Legenda"; "Subtitle Order" = "Ordem da Legenda"; /* Message : Window */ "Keep on Top of All Other Windows" = "Manter no Topo de Todas as Outras Janelas"; "Don't keep on Top of All Other Windows" = "Não manter no Topo de Todas as Outras Janelas"; "Apply on Playing Only" = "Aplicar Somente no Atual"; /* Control Panel */ "All Subtitles" = "Todas as Legendas"; "Video Track" = "Faixa de Vídeo"; "Sound Track" = "Faixa de Áudio"; "Subtitle Track" = "Faixa de Legenda"; "External Subtitle" = "Legenda Externa"; "Mono" = "Mono"; "Stereo" = "Stereo"; "5.1 Ch." = "5.1 Can."; "Digital" = "Digital"; "Analog" = "Analógico"; "Loading" = "Carregando"; "Not Supported Yet" = "Ainda Não Suportado"; /* Preferences */ "General" = "Geral"; "Video" = "Vídeo"; "Audio" = "Áudio"; "Subtitle" = "Legenda"; "Advanced" = "Avançado"; "SubtitleTestChar" = "*"; /* Preferences: advanced - codec binding */ "Set all to QuickTime" = "Ajustar todos para QuickTime"; "Set all to FFmpeg" = "Ajustar todos para FFmpeg"; "Set all MPEG-4 to QuickTime" = "Ajustar todos MPEG-4 para QuickTime"; "Set all MPEG-4 to FFmpeg" = "Ajustar todos para MPEG-4 para FFmpeg"; "Set to Movist default" = "Ajustar para padrão do Movist"; /* Preferences: advanced - details: general */ "Activate on Dragging over Main Window" = "Ativar ao Arrastar sobre a Janela Principal"; "Auto Show Dock in Full Screen" = "Autoexibir Dock em Tela Cheia"; "Use Play-Panel in Full Screen" = "Utilizar Painel de Reprodução em Tela Cheia"; "Floating Playlist" = "Lista de Reprodução Flutuante"; "Go to Beginning When Reopening Movie" = "Ir ao Começo Quando Reabrir Filme"; "Go to Beginning When Opening Subtitle" = "Ir ao Começo Quando Abrir Legenda"; "Movie Resize Center" = "Centralizar ao Redimencionar Filme"; "Title Center" = "Centralizar ao Título"; "Title Left" = "Esquerda do Título"; "Title Right" = "Direita do Título"; "Bottom Center" = "In
{ "pile_set_name": "Github" }
-----BEGIN RSA PRIVATE KEY----- MIICXAIBAAKBgQC+hsCqLGG9GHN0KNDrUFZQieNtPCHcNdYo/rdlubH2Gwopebck KI54RjNQiYRF8p0KV18IyibiHk0ApHlIm08hSmtG7PPpYthYhqCmG2+BvNaL56pJ hNog1W/BsN66zOM3mdGXRZ4zLAGWnPIevguLAf6UvQYjDqOqk5deUUJXCQIDAQAB AoGANu/CBA+SCyVOvRK70u4yRTzNMAUjukxnuSBhH1rg/pajYnwvG6T6F6IeT72n P0gKkh3JUE6B0bds+p9yPUZTFUXghxjcF33wlIY44H6gFE4K5WutsFJ9c450wtuu 8rXZTsIg7lAXWjTFVmdtOEPetcGlO2Hpi1O7ZzkzHgB2w9ECQQDksCCYx78or1zY ZSokm8jmpIjG3VLKdvI9HAoJRN40ldnwFoigrFa1AHwsFtWNe8bKyVRPDoLDUjpB dkPWgweVAkEA1UfgqguQ2KIkbtp9nDBionu3QaajksrRHwIa8vdfRfLxszfHk2fh NGY3dkRZF8HUAbzYLrd9poVhCBAEjWekpQJASOM6AHfpnXYHCZF01SYx6hEW5wsz kARJQODm8f1ZNTlttO/5q/xBxn7ZFNRSTD3fJlL05B2j380ddC/Vf1FT4QJAP1BC GliqnBSuGhZUWYxni3KMeTm9rzL0F29pjpzutHYlWB2D6ndY/FQnvL0XcZ0Bka58 womIDGnl3x3aLBwLXQJBAJv6h5CHbXHx7VyDJAcNfppAqZGcEaiVg8yf2F33iWy2 FLthhJucx7df7SO2aw5h06bRDRAhb9br0R9/3mLr7RE= -----END RSA PRIVATE KEY-----
{ "pile_set_name": "Github" }
/* * 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.jsmpp.bean; /** * @author uudashr * */ public class CancelSmResp extends Command { private static final long serialVersionUID = -8535074405458491134L; public CancelSmResp() { super(); } }
{ "pile_set_name": "Github" }
{ "name": "more-router-samples", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^9.1.9", "@angular/cdk": "^9.2.4", "@angular/common": "^9.1.9", "@angular/compiler": "^9.1.9", "@angular/core": "^9.1.9", "@angular/forms": "^9.1.9", "@angular/material": "^9.2.4", "@angular/platform-browser": "^9.1.9", "@angular/platform-browser-dynamic": "^9.1.9", "@angular/router": "^9.1.9", "core-js": "^3.6.5", "es-abstract": "^1.17.5", "rxjs": "6.5.5", "tslib": "^1.10.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-devkit/build-angular": "~0.901.7", "@angular/cli": "^9.1.7", "@angular/compiler-cli": "^9.1.9", "@angular/language-service": "^9.1.9", "@types/jasmine": "~3.5.10", "@types/jasminewd2": "~2.0.8", "@types/node": "^12.11.1", "codelyzer": "^5.1.2", "jasmine-core": "~3.5.0", "jasmine-spec-reporter": "~5.0.2", "karma": "~5.0.9", "karma-chrome-launcher": "~3.1.0", "karma-cli": "~2.0.0", "karma-coverage-istanbul-reporter": "^3.0.3", "karma-jasmine": "~3.3.0", "karma-jasmine-html-reporter": "^1.5.4", "protractor": "~7.0.0", "ts-node": "~8.10.2", "tslint": "~6.1.2", "typescript": "^3.8.2" } }
{ "pile_set_name": "Github" }
/* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #include <ngx_config.h> #include <ngx_core.h> #include <ngx_event.h> #include <ngx_channel.h> static void ngx_start_worker_processes(ngx_cycle_t *cycle, ngx_int_t n, ngx_int_t type); static void ngx_start_cache_manager_processes(ngx_cycle_t *cycle, ngx_uint_t respawn); static void ngx_pass_open_channel(ngx_cycle_t *cycle, ngx_channel_t *ch); static void ngx_signal_worker_processes(ngx_cycle_t *cycle, int signo); static ngx_uint_t ngx_reap_children(ngx_cycle_t *cycle); static void ngx_master_process_exit(ngx_cycle_t *cycle); static void ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data); static void ngx_worker_process_init(ngx_cycle_t *cycle, ngx_int_t worker); static void ngx_worker_process_exit(ngx_cycle_t *cycle); static void ngx_channel_handler(ngx_event_t *ev); static void ngx_cache_manager_process_cycle(ngx_cycle_t *cycle, void *data); static void ngx_cache_manager_process_handler(ngx_event_t *ev); static void ngx_cache_loader_process_handler(ngx_event_t *ev); ngx_uint_t ngx_process; ngx_uint_t ngx_worker; ngx_pid_t ngx_pid; sig_atomic_t ngx_reap; sig_atomic_t ngx_sigio; sig_atomic_t ngx_sigalrm; sig_atomic_t ngx_terminate; sig_atomic_t ngx_quit; sig_atomic_t ngx_debug_quit; ngx_uint_t ngx_exiting; sig_atomic_t ngx_reconfigure; sig_atomic_t ngx_reopen; sig_atomic_t ngx_change_binary; ngx_pid_t ngx_new_binary; ngx_uint_t ngx_inherited; ngx_uint_t ngx_daemonized; sig_atomic_t ngx_noaccept; ngx_uint_t ngx_noaccepting; ngx_uint_t ngx_restart; static u_char master_process[] = "master process"; static ngx_cache_manager_ctx_t ngx_cache_manager_ctx = { ngx_cache_manager_process_handler, "cache manager process", 0 }; static ngx_cache_manager_ctx_t ngx_cache_loader_ctx = { ngx_cache_loader_process_handler, "cache loader process", 60000 }; static ngx_cycle_t ngx_exit_cycle; static ngx_log_t ngx_exit_log; static ngx_open_file_t ngx_exit_log_file; void ngx_master_process_cycle(ngx_cycle_t *cycle) { char *title; u_char *p; size_t size; ngx_int_t i; ngx_uint_t n, sigio; sigset_t set; struct itimerval itv; ngx_uint_t live; ngx_msec_t delay; ngx_listening_t *ls; ngx_core_conf_t *ccf; sigemptyset(&set); sigaddset(&set, SIGCHLD); sigaddset(&set, SIGALRM); sigaddset(&set, SIGIO); sigaddset(&set, SIGINT); sigaddset(&set, ngx_signal_value(NGX_RECONFIGURE_SIGNAL)); sigaddset(&set, ngx_signal_value(NGX_REOPEN_SIGNAL)); sigaddset(&set, ngx_signal_value(NGX_NOACCEPT_SIGNAL)); sigaddset(&set, ngx_signal_value(NGX_TERMINATE_SIGNAL)); sigaddset(&set, ngx_signal_value(NGX_SHUTDOWN_SIGNAL)); sigaddset(&set, ngx_signal_value(NGX_CHANGEBIN_SIGNAL)); if (sigprocmask(SIG_BLOCK, &set, NULL) == -1) { ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, "sigprocmask() failed"); } sigemptyset(&set); size = sizeof(master_process); for (i = 0; i < ngx_argc; i++) { size += ngx_strlen(ngx_argv[i]) + 1; } title = ngx_pnalloc(cycle->pool, size); if (title == NULL) { /* fatal */ exit(2); } p = ngx_cpymem(title, master_process, sizeof(master_process) - 1); for (i = 0; i < ngx_argc; i++) { *p++ = ' '; p = ngx_cpystrn(p, (u_char *) ngx_argv[i], size); } ngx_setproctitle(title); ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module); ngx_start_worker_processes(cycle, ccf->worker_processes, NGX_PROCESS_RESPAWN); ngx_start_cache_manager_processes(cycle, 0); ngx_new_binary = 0; delay = 0; sigio = 0; live = 1; for ( ;; ) { if (delay) { if (ngx_sigalrm) { sigio = 0; delay *= 2; ngx_sigalrm = 0; } ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "termination cycle: %d", delay); itv.it_interval.tv_sec = 0; itv.it_interval.tv_usec = 0; itv.it_value.tv_sec = delay / 1000; itv.it_value.tv_usec = (delay % 1000 ) * 1000; if (setitimer(ITIMER_REAL, &itv, NULL) == -1) { ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, "setitimer() failed"); } } ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "sigsuspend"); sigsuspend(&set); ngx_time_update(); ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "wake up, sigio %i", sigio); if (ngx_reap) { ngx_reap = 0; ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "reap children"); live = ngx_reap_children(cycle); } if (!live && (ngx_terminate || ngx_quit)) { ngx_master_process_exit(cycle); } if (ngx_terminate) { if (delay == 0) { delay = 50; } if (sigio) { sigio--; continue; } sigio = ccf->worker_processes + 2 /* cache processes */;
{ "pile_set_name": "Github" }
import dsz import dsz.menu import os import re import xml.dom.minidom import tasking MaximumTasks = 'MaximumTasks' HostName = 'HostName' Domain = 'Domain' IpAddress = 'IpAddress' Mac = 'Mac' PcId = 'PcId' Guid = 'Guid' SuccessfulMatch = 0 QuestionableMatch = 1 NoMatch = 2 class Tasking(object, ): def __init__(self, name, metadata): self.bRan = False self.name = name self.id = list() self.mac = list() self.ip = list() self.hostname = list() self.domain = list() self.guid = list() self.tasks = list() self.runningTasks = list() self.Recommendation = None f = open(metadata, 'r') try: for line in f: line = line.strip() m = re.match('Implant ID: +(.*)', line) if m: self.id += [x.strip() for x in m.group(1).split(', ')] m = re.match('MAC: +(.*)', line) if m: self.mac += [unicode(x.strip(), 'utf_8') for x in m.group(1).split(', ')] m = re.match('IP: +(.*)', line) if m: self.ip += [unicode(x.strip(), 'utf_8') for x in m.group(1).split(', ')] m = re.match('Hostname: +(.*)', line) if m: self.hostname += [unicode(x.strip(), 'utf_8') for x in m.group(1).split(', ')] m = re.match('Domain: +(.*)', line) if m: self.domain += [unicode(x.strip(), 'utf_8') for x in m.group(1).split(', ')] finally: f.close() temp = list() for ip in self.ip: while ('%%' in ip): ip = ip.replace('%%', '%') temp.append(ip) self.ip = temp pass def Dump(self): dsz.ui.Echo('---------------------------------------------') dsz.ui.Echo(('Tasking for %s' % self.name)) for id in self.id: dsz.ui.Echo(('ID: %s' % id)) for mac in self.mac: dsz.ui.Echo(('MAC: %s' % mac)) for ip in self.ip: dsz.ui.Echo(('IP: %s' % ip)) dsz.ui.Echo(('Host:%s' % self.hostname)) dsz.ui.Echo(('Dom: %s' % self.domain)) for task in self.tasks: task.Display() dsz.ui.Echo('---------------------------------------------') def EvaluateThisTarget(self, info, bDisplay=False): self.PcMatch = compareData('PC Ids', set([long(x, 16) for x in self.id]), set([long(x, 16) for x in info[PcId]]), '0x%016x', align='', bDisplay=bDisplay) self.MacMatch = compareData('Mac', set([x.upper() for x in self.mac]), set([x.upper() for x in info[Mac]]), bDisplay=bDisplay) self.IpMatch = compareData('Ip Addresses', set([x.upper() for x in self.ip]), set([x.upper() for x in info[IpAddress]]), bDisplay=bDisplay) self.HostNameMatch = compareData('HostName', set([x.upper() for x in self.hostname]), set([x.upper() for x in info[HostName]]), bDisplay=bDisplay) self.DomainMatch = compareData('Domain', set([x.upper() for x in self.domain]), set([x.upper() for x in info[Domain]]), bDisplay=bDisplay) self.GuidMatch = compareData('GUID', set([x.upper() for x in self.guid]), set([x.upper() for x in info[Guid]]), bDisplay=bDisplay) self.Recommendation = makeRecommendation(self.PcMatch, self.MacMatch, self.IpMatch, self.HostNameMatch, self.DomainMatch, self.GuidMatch, self, info) def DisplayMatchAndConsiderStart(self, info, bAutomated, bForce=False): dsz.ui.Echo(printLine('-', 80)) dsz.ui.Echo(printHeader('Tasking Match Information', 80)) dsz.ui.Echo(printLine('-', 80)) if ((self.Recommendation == None) or bForce): self.EvaluateThisTarget(info, bDisplay=True) resultList = [displayResult('PC Id', self.PcMatch, 'Definately Match', 'Suspicious match', 'No Match'), displayResult('MAC', self.MacMatch, 'Match', 'Match', 'No Match', PartialType=dsz.GOOD), displayResult('IP', self.IpMatch, 'Match', 'Match', 'No Match', PartialType=dsz.GOOD), displayResult('HostName', self.HostNameMatch, 'Match', 'Suspicious match', 'No Match'), displayResult('Domain', self.DomainMatch, 'Match', 'Suspicious match', 'No Match'), displayResult('Guid', self.GuidMatch, 'Match', 'Match', 'No Match', PartialType=dsz.GOOD), displayResult('Recommendation', self.Recommendation, 'Go ahead', 'Consider carefully', 'Skip')] space = max([len(x[0]) for x in resultList]) for result in resultList: format = ('%%%ds : %%s' % space) dsz.ui.Echo((format % (result[0], result[1])), result[2]) if bAutomated: if (self.Recommendation == SuccessfulMatch): return True if (self.Recommendation == NoMatch): return False if (self.Recommendation == SuccessfulMatch): defaultAnswer = True else: defaultAnswer = False return dsz.ui.Prompt('Do you want to proceed with this tasking?', defaultAnswer) def DoTasking(self): self.bRan = True delayed = list() for task in sorted(self.tasks, key=(lambda task: int(task.Priority))): dsz.ui.Echo(('Preprocessing for %s task' % task.name)) task.Preprocessing() dsz.ui.Echo(' DONE', dsz.GOOD) if task.IsSkip(): continue if task.IsVerify(): if (not queryExecuteTask(delayed, task)): continue self.StartCommand(task) self.AreAnyCommandsRunning() if (len(delayed) > 0): dsz.ui.Echo(('You delayed execution of %d tasks.' % len(delayed))) if dsz.ui.Prompt('Do you want to try to run them now?'): self.tasks = delayed self.DoTasking() def StartCommand(self, task): cmds = task.CreateCommandLine() cmdData = list() for cmd in cmds: self.CanStartCommand() dsz.ui.Echo(('Starting task: %s' % cmd)) if dsz.cmd.Run(('task=%s background %s' % (task.TaskID, cmd))): dsz.ui.Echo(' STARTED', dsz.GOOD) self.runningTasks.append(dsz.cmd.LastId()) cmdData.append((cmd, dsz.cmd.LastId())) else: dsz.ui.Echo(' FAILED (Unable to create tasking!)', dsz.ERROR) RecordTask(task, cmdData) def CanStartCommand(self): while (self._currentNumberOfRunningCommands() >= dsz
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <resources> <string-array name="languages"> <item>English</item> <item>Russian</item> <item>Japanese</item> <item>Turkish</item> <item>Multilanguage</item> <item>Vietnamese</item> <item>French</item> </string-array> <string-array name="intervals_hours"> <item>4</item> <item>12</item> <item>24</item> <item>48</item> </string-array> <string-array name="sync_intervals_hours"> <item>0</item> <item>4</item> <item>12</item> <item>24</item> <item>48</item> <item>-1</item> </string-array> <string-array name="sections"> <item>-4</item> <item>-3</item> <item>-2</item> <item>-1</item> </string-array> <string-array name="section_names"> <item>@string/local_storage</item> <item>@string/action_recommendations</item> <item>@string/action_favourites</item> <item>@string/action_history</item> </string-array> <string-array name="directions_values"> <item>0</item> <item>1</item> <item>2</item> </string-array> <string-array name="directions"> <item>@string/direction_ltr</item> <item>@string/direction_ttb</item> <item>@string/direction_rtl</item> </string-array> <string-array name="intervals"> <item>@string/interval_4hours</item> <item>@string/interval_twice_day</item> <item>@string/interval_once_day</item> <item>@string/interval_two_days</item> </string-array> <string-array name="sync_intervals"> <item>@string/realtime</item> <item>@string/interval_4hours</item> <item>@string/interval_twice_day</item> <item>@string/interval_once_day</item> <item>@string/interval_two_days</item> <item>@string/manually</item> </string-array> <string-array name="themes"> <item>0</item> <item>1</item> <item>2</item> <item>3</item> <item>4</item> <item>5</item> <item>6</item> <item>7</item> <item>8</item> <item>9</item> <item>10</item> <item>11</item> <item>12</item> <item>13</item> <item>14</item> </string-array> <string-array name="themes_names"> <item>Default</item> <item>Classic</item> <item>Light Grey</item> <item>Light Teal</item> <item>Light Blue</item> <item>Light Purple</item> <item>Ambiance</item> <item>Indigo</item> <item>Dark Classic</item> <item>Dark Blue</item> <item>Dark Teal</item> <item>Dark Miku</item> <item>AMOLED Grey</item> <item>AMOLED Red</item> <item>AMOLED Black</item> </string-array> <string-array name="scale_values"> <item>0</item> <item>1</item> <item>2</item> <item>3</item> </string-array> <string-array name="scale_modes"> <item>@string/scale_fit</item> <item>@string/scale_fit_w</item> <item>@string/scale_fit_h</item> <item>@string/scale_source</item> </string-array> <string-array name="app_languages"> <item>@string/automatic</item> <item>English</item> <item>Русский</item> <item>Türk</item> <item>Українська</item> </string-array> <string-array name="app_languages_values"> <item /> <item>en</item> <item>ru</item> <item>tr</item> <item>uk</item> </string-array> <string-array name="r2_modes"> <item>@string/pages</item> <item>@string/scroll</item> </string-array> <string-array name="r2_modes_values"> <item>0</item> <item>1</item> </string-array> <string-array name="preloadings"> <item>@string/enabled</item> <item>@string/over_wifi_only</item> <item>@string/disabled</item> </string-array> <string-array name="preloadings_values"> <item>2</item> <item>1</item> <item>0</item> </string-array> </resources>
{ "pile_set_name": "Github" }
/*=auto========================================================================= Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved. See COPYRIGHT.txt or http://www.slicer.org/copyright/copyright.txt for details. Program: 3D Slicer Module: $RCSfile: vtkDiffusionTensorMathematics.h,v $ Date: $Date: 2006/12/19 17:14:44 $ Version: $Revision: 1.20 $ =========================================================================auto=*/ /// vtkDiffusionTensorMathematics - Trace, determinant, anisotropy measures /// /// Operates on input tensors and outputs image data scalars /// that describe some feature of the input tensors. // /// In future should optionally pass through input tensors, /// and also possibly output tensors with eigenvectors as columns. /// Currently a two-input filter like vtkImageMathematics, which /// may be useful someday. // #ifndef __vtkDiffusionTensorMathematics_h #define __vtkDiffusionTensorMathematics_h // vtkTeem includes #include "vtkTeemConfigure.h" // VTK includes #include <vtkThreadedImageAlgorithm.h> class vtkMatrix4x4; class vtkImageData; class VTK_Teem_EXPORT vtkDiffusionTensorMathematics : public vtkThreadedImageAlgorithm { public: static vtkDiffusionTensorMathematics *New(); vtkTypeMacro(vtkDiffusionTensorMathematics,vtkThreadedImageAlgorithm); void PrintSelf(ostream& os, vtkIndent indent) override; /// Operation options. enum { VTK_TENS_TRACE = 0, VTK_TENS_DETERMINANT = 1, VTK_TENS_RELATIVE_ANISOTROPY = 2, VTK_TENS_FRACTIONAL_ANISOTROPY = 3, VTK_TENS_MAX_EIGENVALUE = 4, VTK_TENS_MID_EIGENVALUE = 5, VTK_TENS_MIN_EIGENVALUE = 6, VTK_TENS_LINEAR_MEASURE = 7, VTK_TENS_PLANAR_MEASURE = 8, VTK_TENS_SPHERICAL_MEASURE = 9, VTK_TENS_COLOR_ORIENTATION = 10, VTK_TENS_D11 = 11, VTK_TENS_D22 = 12, VTK_TENS_D33 = 13, VTK_TENS_MODE = 14, VTK_TENS_COLOR_MODE =15, VTK_TENS_MAX_EIGENVALUE_PROJX = 16, VTK_TENS_MAX_EIGENVALUE_PROJY = 17, VTK_TENS_MAX_EIGENVALUE_PROJZ = 18, VTK_TENS_RAI_MAX_EIGENVEC_PROJX = 19, VTK_TENS_RAI_MAX_EIGENVEC_PROJY = 20, VTK_TENS_RAI_MAX_EIGENVEC_PROJZ = 21, VTK_TENS_MAX_EIGENVEC_PROJX = 22, VTK_TENS_MAX_EIGENVEC_PROJY = 23, VTK_TENS_MAX_EIGENVEC_PROJZ = 24, VTK_TENS_PARALLEL_DIFFUSIVITY = 25, VTK_TENS_PERPENDICULAR_DIFFUSIVITY = 26, VTK_TENS_COLOR_ORIENTATION_MIDDLE_EIGENVECTOR = 27, VTK_TENS_COLOR_ORIENTATION_MIN_EIGENVECTOR = 28, VTK_TENS_MEAN_DIFFUSIVITY = 29 }; /// /// Get the Operation to perform. vtkGetMacro(Operation,int); vtkSetClampMacro(Operation,int, VTK_TENS_TRACE, VTK_TENS_MEAN_DIFFUSIVITY); /// /// Output the trace (sum of eigenvalues = sum along diagonal) void SetOperationToTrace() {this->SetOperation(VTK_TENS_TRACE);}; /// /// Output the determinant void SetOperationToDeterminant() {this->SetOperation(VTK_TENS_DETERMINANT);}; /// /// Output various anisotropy and shape measures void SetOperationToRelativeAnisotropy() {this->SetOperation(VTK_TENS_RELATIVE_ANISOTROPY);}; void SetOperationToFractionalAnisotropy() {this->SetOperation(VTK_TENS_FRACTIONAL_ANISOTROPY);}; void SetOperationToLinearMeasure() {this->SetOperation(VTK_TENS_LINEAR_MEASURE);}; void SetOperationToPlanarMeasure() {this->SetOperation(VTK_TENS_PLANAR_MEASURE);}; void SetOperationToSphericalMeasure() {this->SetOperation(VTK_TENS_SPHERICAL_MEASURE);}; /// This is the skewness of the eigenvalues /// (thanks to Gordon Lothar (of the Hill People) Kindlmann) void SetOperationToMode() {this->SetOperation(VTK_TENS_MODE);}; void SetOperationToParallelDiffusivity() {this->SetOperation(VTK_TENS_PARALLEL_DIFFUSIVITY);}; void SetOperationToPerpendicularDiffusivity() {this->SetOperation(VTK_TENS_PERPENDICULAR_DIFFUSIVITY);}; void SetOperationToMeanDiffusivity() {this->SetOperation(VTK_TENS_MEAN_DIFFUSIVITY);}; /// /// Output a selected eigenvalue void SetOperationToMaxEigenvalue() {this->SetOperation(VTK_TENS_MAX_EIGENVALUE);}; void SetOperationToMiddleEigenvalue() {this->SetOperation(VTK_TENS_MID_EIGENVALUE);}; void SetOperationToMinEigenvalue() {this->SetOperation(VTK_TENS_MIN_EIGENVALUE);}; /// /// Output Maxeigenvalue*Maxeigenvec_projection also known as L1Z void SetOperationToMaxEigenvalueProjectionX() {this->SetOperation(VTK_TENS_MAX_EIGENVALUE_PROJX);}; void SetOperationToMaxEigenvalueProjectionY() {this->SetOperation(VTK_TENS_MAX_EIGENVALUE_PROJY);}; void SetOperationToMaxEigenvalueProjectionZ() {this->SetOperation(VTK_TENS_MAX_EIGENVALUE_PROJZ);}; /// /// Output Relative_anisotropy*Maxeigenvec_projection also known as L1z void SetOperationToRAIMaxEigenvecX() {this->SetOperation(VTK_TENS_RAI_MAX_EIGENVEC_PROJX);} void SetOperationToRAIMaxEigenvecY() {this->SetOperation(VTK_TENS_RAI_MAX_EIGENVEC_PROJY);} void SetOperationToRAIMaxEigenvecZ() {this->SetOperation(VTK_TENS_RAI_MAX_EIGENVEC_PROJZ);} /// /// Output Relative_anisotropy*Maxeigenvec_projection also known as L1z void SetOperationToMaxEigenvecX() {this->SetOperation(VTK_TENS_MAX_EIGENVEC_PROJX);} void SetOperationToMaxEigenvecY() {this->SetOperation(VTK_TENS_MAX_EIGENVEC_PROJY);} void SetOperationToMaxEigenvecZ() {this->SetOperation(VTK_TENS_MAX_EIGENVEC_PROJZ);} /// /// Output a matrix (tensor) component void SetOperationToD11() {this->SetOperation(VTK_TENS_D
{ "pile_set_name": "Github" }
import { Selector } from 'testcafe'; fixture `GH-2067` .page `http://localhost:3000/fixtures/regression/gh-2067/pages/index.html`; const radioWindows = Selector('#windows'); const radioMacos = Selector('#macos'); const radioLinux = Selector('#linux'); const radioAndroid = Selector('#android'); const radioFord = Selector('#ford'); const radioBmw = Selector('#bmw'); const radioMazda = Selector('#mazda'); const radioHonda = Selector('#honda'); async function checkRadio (t, radio, condition) { await t.expect(radio.focused).eql(condition); await t.expect(radio.checked).eql(condition); } const radioButtonsOS = [radioMacos, radioLinux, radioAndroid, radioWindows, radioMacos]; const radioButtonsCars = [radioBmw, radioMazda, radioHonda, radioFord, radioBmw]; async function testRadioButtons (t, key, radios) { await t.click(radios[0]); for (let i = 0; i < radios.length; i++) { await checkRadio(t, radios[i], true); await t.pressKey(key); } } async function testRadioButtonsNonamed (t, key, radios) { await t.click(radios[0]); for (let i = 1; i < radios.length - 1; i++) { await checkRadio(t, radios[0], true); await checkRadio(t, radios[i], false); await t.pressKey(key); } } test('named', async t => { await testRadioButtons(t, 'down', radioButtonsOS); await testRadioButtons(t, 'right', radioButtonsOS); await testRadioButtons(t, 'up', [...radioButtonsOS].reverse()); await testRadioButtons(t, 'up', [...radioButtonsOS].reverse()); }); test('nonamed - chrome', async t => { await testRadioButtons(t, 'down', radioButtonsCars); await testRadioButtons(t, 'right', radioButtonsCars); await testRadioButtons(t, 'up', [...radioButtonsCars].reverse()); await testRadioButtons(t, 'up', [...radioButtonsCars].reverse()); }); test('nonamed - ie, firefox', async t => { await testRadioButtonsNonamed(t, 'down', radioButtonsCars); await testRadioButtonsNonamed(t, 'right', radioButtonsCars); await testRadioButtonsNonamed(t, 'up', [...radioButtonsCars].reverse()); await testRadioButtonsNonamed(t, 'up', [...radioButtonsCars].reverse()); }); test('Should select the checked radio button by pressing the tab key', async t => { await t .click(Selector('#check1')) .pressKey('tab') .expect(radioWindows.focused).ok() .expect(radioWindows.checked).notOk() .pressKey('right') .expect(radioMacos.focused).ok() .expect(radioMacos.checked).ok() .click(Selector('#check1')) .pressKey('tab') .expect(radioMacos.focused).ok() .expect(radioMacos.checked).ok(); });
{ "pile_set_name": "Github" }
-----BEGIN DH PARAMETERS----- MIGHAoGBAKECDgU/s7GDh2vDd5A10bVlOTcs0e4u8sIsfzGL4kSNokoFqLD6OiVj 1z1QY1lZz464CSiXzM2A/UqppCsgiXSkjGtDQ87GJpB04fEojzXjxVnHNECJU1o1 DnW05efrrH8gLm6YxRawQ/aboJxsPdcaaI9CTF9zWYQlDhrpq1RTAgEC -----END DH PARAMETERS-----
{ "pile_set_name": "Github" }
#include "llvm/Transforms/Utils/VNCoercion.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/MemoryDependenceAnalysis.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/Support/Debug.h" #define DEBUG_TYPE "vncoerce" namespace llvm { namespace VNCoercion { /// Return true if coerceAvailableValueToLoadType will succeed. bool canCoerceMustAliasedValueToLoad(Value *StoredVal, Type *LoadTy, const DataLayout &DL) { // If the loaded or stored value is an first class array or struct, don't try // to transform them. We need to be able to bitcast to integer. if (LoadTy->isStructTy() || LoadTy->isArrayTy() || StoredVal->getType()->isStructTy() || StoredVal->getType()->isArrayTy()) return false; uint64_t StoreSize = DL.getTypeSizeInBits(StoredVal->getType()); // The store size must be byte-aligned to support future type casts. if (llvm::alignTo(StoreSize, 8) != StoreSize) return false; // The store has to be at least as big as the load. if (StoreSize < DL.getTypeSizeInBits(LoadTy)) return false; // Don't coerce non-integral pointers to integers or vice versa. if (DL.isNonIntegralPointerType(StoredVal->getType()) != DL.isNonIntegralPointerType(LoadTy)) return false; return true; } template <class T, class HelperClass> static T *coerceAvailableValueToLoadTypeHelper(T *StoredVal, Type *LoadedTy, HelperClass &Helper, const DataLayout &DL) { assert(canCoerceMustAliasedValueToLoad(StoredVal, LoadedTy, DL) && "precondition violation - materialization can't fail"); if (auto *C = dyn_cast<Constant>(StoredVal)) if (auto *FoldedStoredVal = ConstantFoldConstant(C, DL)) StoredVal = FoldedStoredVal; // If this is already the right type, just return it. Type *StoredValTy = StoredVal->getType(); uint64_t StoredValSize = DL.getTypeSizeInBits(StoredValTy); uint64_t LoadedValSize = DL.getTypeSizeInBits(LoadedTy); // If the store and reload are the same size, we can always reuse it. if (StoredValSize == LoadedValSize) { // Pointer to Pointer -> use bitcast. if (StoredValTy->isPtrOrPtrVectorTy() && LoadedTy->isPtrOrPtrVectorTy()) { StoredVal = Helper.CreateBitCast(StoredVal, LoadedTy); } else { // Convert source pointers to integers, which can be bitcast. if (StoredValTy->isPtrOrPtrVectorTy()) { StoredValTy = DL.getIntPtrType(StoredValTy); StoredVal = Helper.CreatePtrToInt(StoredVal, StoredValTy); } Type *TypeToCastTo = LoadedTy; if (TypeToCastTo->isPtrOrPtrVectorTy()) TypeToCastTo = DL.getIntPtrType(TypeToCastTo); if (StoredValTy != TypeToCastTo) StoredVal = Helper.CreateBitCast(StoredVal, TypeToCastTo); // Cast to pointer if the load needs a pointer type. if (LoadedTy->isPtrOrPtrVectorTy()) StoredVal = Helper.CreateIntToPtr(StoredVal, LoadedTy); } if (auto *C = dyn_cast<ConstantExpr>(StoredVal)) if (auto *FoldedStoredVal = ConstantFoldConstant(C, DL)) StoredVal = FoldedStoredVal; return StoredVal; } // If the loaded value is smaller than the available value, then we can // extract out a piece from it. If the available value is too small, then we // can't do anything. assert(StoredValSize >= LoadedValSize && "canCoerceMustAliasedValueToLoad fail"); // Convert source pointers to integers, which can be manipulated. if (StoredValTy->isPtrOrPtrVectorTy()) { StoredValTy = DL.getIntPtrType(StoredValTy); StoredVal = Helper.CreatePtrToInt(StoredVal, StoredValTy); } // Convert vectors and fp to integer, which can be manipulated. if (!StoredValTy->isIntegerTy()) { StoredValTy = IntegerType::get(StoredValTy->getContext(), StoredValSize); StoredVal = Helper.CreateBitCast(StoredVal, StoredValTy); } // If this is a big-endian system, we need to shift the value down to the low // bits so that a truncate will work. if (DL.isBigEndian()) { uint64_t ShiftAmt = DL.getTypeStoreSizeInBits(StoredValTy) - DL.getTypeStoreSizeInBits(LoadedTy); StoredVal = Helper.CreateLShr( StoredVal, ConstantInt::get(StoredVal->getType(), ShiftAmt)); } // Truncate the integer to the right size now. Type *NewIntTy = IntegerType::get(StoredValTy->getContext(), LoadedValSize); StoredVal = Helper.CreateTruncOrBitCast(StoredVal, NewIntTy); if (LoadedTy != NewIntTy) { // If the result is a pointer, inttoptr. if (LoadedTy->isPtrOrPtrVectorTy()) StoredVal = Helper.CreateIntToPtr(StoredVal, LoadedTy); else // Otherwise, bitcast. StoredVal = Helper.CreateBitCast(StoredVal, LoadedTy); } if (auto *C = dyn_cast<Constant>(StoredVal)) if (auto *FoldedStoredVal = ConstantFoldConstant(C, DL)) StoredVal = FoldedStoredVal; return StoredVal; } /// If we saw a store of a value to memory, and /// then a load from a must-aliased pointer of a different type, try to coerce /// the stored value. LoadedTy is the type of the load we want to replace. /// IRB is IRBuilder used to insert new instructions. /// /// If we can't do it, return null. Value *coerceAvailableValueToLoadType(Value *StoredVal, Type *LoadedTy, IRBuilder<> &IRB, const DataLayout &DL) { return coerceAvailableValueToLoadTypeHelper(StoredVal, LoadedTy, IRB, DL); } /// This function is called when we have a memdep query of a load that ends up /// being a clobbering memory write (store, memset, memcpy, memmove). This /// means that the write *may* provide bits used by the load but we can't be /// sure because the pointers don't must-alias. /// /// Check this case to see if there is anything more we can do before we give /// up. This returns -1 if we have to give up, or a byte number in the stored /// value of the piece that feeds the load. static int analyzeLoadFromClobberingWrite(Type *LoadTy, Value *LoadPtr, Value *WritePtr, uint64_t WriteSizeInBits, const DataLayout &DL) { // If the loaded or stored value is a first class array or struct, don't try // to transform them. We need to be able to bitcast to integer. if (LoadTy->isStructTy() || LoadTy->isArrayTy()) return -1; int64_t StoreOffset = 0, LoadOffset = 0; Value *StoreBase = GetPointerBaseWithConstantOffset(WritePtr, StoreOffset, DL
{ "pile_set_name": "Github" }
<Type Name="NSApplicationPrint" FullName="MonoMac.AppKit.NSApplicationPrint"> <TypeSignature Language="C#" Value="public delegate MonoMac.AppKit.NSApplicationPrintReply NSApplicationPrint(NSApplication application, string[] fileNames, NSDictionary printSettings, bool showPrintPanels);" /> <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed NSApplicationPrint extends System.MulticastDelegate" /> <AssemblyInfo> <AssemblyName>MonoMac</AssemblyName> <AssemblyVersion>0.0.0.0</AssemblyVersion> </AssemblyInfo> <Base> <BaseTypeName>System.Delegate</BaseTypeName> </Base> <Parameters> <Parameter Name="application" Type="MonoMac.AppKit.NSApplication" /> <Parameter Name="fileNames" Type="System.String[]" /> <Parameter Name="printSettings" Type="MonoMac.Foundation.NSDictionary" /> <Parameter Name="showPrintPanels" Type="System.Boolean" /> </Parameters> <ReturnValue> <ReturnType>MonoMac.AppKit.NSApplicationPrintReply</ReturnType> </ReturnValue> <Docs> <param name="application">To be added.</param> <param name="fileNames">To be added.</param> <param name="printSettings">To be added.</param> <param name="showPrintPanels">To be added.</param> <summary>To be added.</summary> <returns>To be added.</returns> <remarks>To be added.</remarks> </Docs> </Type>
{ "pile_set_name": "Github" }
<div style="background: repeating-radial-gradient(closest-side, black 100px, black 150px, white 150px, white 200px); width: 400px; height: 400px;"></div>
{ "pile_set_name": "Github" }
{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "eventViewerEndpoint": { "type": "string", "defaultValue": "https://storage-demo-event-grid-viewer.azurewebsites.net/api/updates", "metadata": { "description": "Endpoint of Event Viewer app" } } }, "functions": [ ], "variables": { "storageAccount": "[concat('st', uniqueString(resourceGroup().id))]", "applicationTag": "Azure Storage Demo" }, "resources": [ { "name": "[variables('storageAccount')]", "type": "Microsoft.Storage/storageAccounts", "apiVersion": "2019-06-01", "tags": { "ApplicationName": "[variables('applicationTag')]" }, "location": "[resourceGroup().location]", "kind": "StorageV2", "sku": { "name": "Standard_ZRS", "tier": "Standard" }, "properties": { "accessTier": "Hot" }, "resources": [ { "type": "blobServices/containers", "name": "[concat('default/', 'car-images')]", "dependsOn": [ "[variables('storageAccount')]" ], "apiVersion": "2019-06-01", "properties": { "publicAccess": "None", "metadata": { "ApplicationName": "[variables('applicationTag')]" } }, "resources": [ ] } ] }, { "type": "Microsoft.Storage/storageAccounts/providers/eventSubscriptions", "name": "[concat(variables('storageAccount'), '/Microsoft.EventGrid/', 'storage-event-subscription')]", "apiVersion": "2018-01-01", "dependsOn": [ "[variables('storageAccount')]" ], "tags": { "ApplicationName": "[variables('applicationTag')]" }, "properties": { "destination": { "endpointType": "WebHook", "properties": { "endpointUrl": "[parameters('eventViewerEndpoint')]" } }, "filter": { "subjectBeginsWith": "", "subjectEndsWith": "", "isSubjectCaseSensitive": false, "includedEventTypes": [ "All" ] } } } ], "outputs": { } }
{ "pile_set_name": "Github" }
set(LLVM_LINK_COMPONENTS TransformUtils BitWriter Core IRReader Support ) add_llvm_tool(llvm-split llvm-split.cpp DEPENDS intrinsics_gen )
{ "pile_set_name": "Github" }
<iframe src="http://notfound-static.fwebservices.be/404/index.html" width="100%" height="650" frameborder="0"></iframe> <p>This page doesn't exist or is not accessible at this time. Take a look at the sitemap:</p>
{ "pile_set_name": "Github" }
<?php // private class for unit testing class HTMLPurifier_Language_en_x_test extends HTMLPurifier_Language { } // vim: et sw=4 sts=4
{ "pile_set_name": "Github" }
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "ERANAMES": [ "Before Christ", "Anno Domini" ], "ERAS": [ "BC", "AD" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], "SHORTDAY": [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], "SHORTMONTH": [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], "STANDALONEMONTH": [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y h:mm:ss a", "mediumDate": "d MMM y", "mediumTime": "h:mm:ss a", "short": "dd/MM/y h:mm a", "shortDate": "dd/MM/y", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "$", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-\u00a4", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "en-io", "localeID": "en_IO", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
{ "pile_set_name": "Github" }
<?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>$(DEVELOPMENT_LANGUAGE)</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</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>BNDL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleVersion</key> <string>1</string> </dict> </plist>
{ "pile_set_name": "Github" }
<!doctype html> <title>CodeMirror: Jinja2 mode</title> <meta charset="utf-8"/> <link rel=stylesheet href="../../doc/docs.css"> <link rel="stylesheet" href="../../lib/codemirror.css"> <script src="../../lib/codemirror.js"></script> <script src="jinja2.js"></script> <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> <div id=nav> <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a> <ul> <li><a href="../../index.html">Home</a> <li><a href="../../doc/manual.html">Manual</a> <li><a href="https://github.com/marijnh/codemirror">Code</a> </ul> <ul> <li><a href="../index.html">Language modes</a> <li><a class=active href="#">Jinja2</a> </ul> </div> <article> <h2>Jinja2 mode</h2> <form><textarea id="code" name="code"> {# this is a comment #} {%- for item in li -%} &lt;li&gt;{{ item.label }}&lt;/li&gt; {% endfor -%} {{ item.sand == true and item.keyword == false ? 1 : 0 }} {{ app.get(55, 1.2, true) }} {% if app.get(&#39;_route&#39;) == (&#39;_home&#39;) %}home{% endif %} {% if app.session.flashbag.has(&#39;message&#39;) %} {% for message in app.session.flashbag.get(&#39;message&#39;) %} {{ message.content }} {% endfor %} {% endif %} {{ path(&#39;_home&#39;, {&#39;section&#39;: app.request.get(&#39;section&#39;)}) }} {{ path(&#39;_home&#39;, { &#39;section&#39;: app.request.get(&#39;section&#39;), &#39;boolean&#39;: true, &#39;number&#39;: 55.33 }) }} {% include (&#39;test.incl.html.twig&#39;) %} </textarea></form> <script> var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: {name: "jinja2", htmlMode: true}}); </script> </article>
{ "pile_set_name": "Github" }
<?php /* * Copyright 2014 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ /** * The "snapshots" collection of methods. * Typical usage is: * <code> * $computeService = new Google_Service_Compute(...); * $snapshots = $computeService->snapshots; * </code> */ class Google_Service_Compute_Resource_Snapshots extends Google_Service_Resource { /** * Deletes the specified Snapshot resource. Keep in mind that deleting a single * snapshot might not necessarily delete all the data on that snapshot. If any * data on the snapshot that is marked for deletion is needed for subsequent * snapshots, the data will be moved to the next corresponding snapshot. * * For more information, see Deleting snaphots. (snapshots.delete) * * @param string $project Project ID for this request. * @param string $snapshot Name of the Snapshot resource to delete. * @param array $optParams Optional parameters. * * @opt_param string requestId An optional request ID to identify requests. * Specify a unique request ID so that if you must retry your request, the * server will know to ignore the request if it has already been completed. * * For example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. * * The request ID must be a valid UUID with the exception that zero UUID is not * supported (00000000-0000-0000-0000-000000000000). * @return Google_Service_Compute_Operation */ public function delete($project, $snapshot, $optParams = array()) { $params = array('project' => $project, 'snapshot' => $snapshot); $params = array_merge($params, $optParams); return $this->call('delete', array($params), "Google_Service_Compute_Operation"); } /** * Returns the specified Snapshot resource. Get a list of available snapshots by * making a list() request. (snapshots.get) * * @param string $project Project ID for this request. * @param string $snapshot Name of the Snapshot resource to return. * @param array $optParams Optional parameters. * @return Google_Service_Compute_Snapshot */ public function get($project, $snapshot, $optParams = array()) { $params = array('project' => $project, 'snapshot' => $snapshot); $params = array_merge($params, $optParams); return $this->call('get', array($params), "Google_Service_Compute_Snapshot"); } /** * Retrieves the list of Snapshot resources contained within the specified * project. (snapshots.listSnapshots) * * @param string $project Project ID for this request. * @param array $optParams Optional parameters. * * @opt_param string filter A filter expression that filters resources listed in * the response. The expression must specify the field name, a comparison * operator, and the value that you want to use for filtering. The value must be * a string, a number, or a boolean. The comparison operator must be either =, * !=, >, or <. * * For example, if you are filtering Compute Engine instances, you can exclude * instances named example-instance by specifying name != example-instance. * * You can also filter nested fields. For example, you could specify * scheduling.automaticRestart = false to include instances only if they are not * scheduled for automatic restarts. You can use filtering on nested fields to * filter based on resource labels. * * To filter on multiple expressions, provide each separate expression within * parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = * "Intel Skylake"). By default, each expression is an AND expression. However, * you can include AND and OR expressions explicitly. For example, (cpuPlatform * = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND * (scheduling.automaticRestart = true). * @opt_param string maxResults The maximum number of results per page that * should be returned. If the number of available results is larger than * maxResults, Compute Engine returns a nextPageToken that can be used to get * the next page of results in subsequent list requests. Acceptable values are 0 * to 500, inclusive. (Default: 500) * @opt_param string orderBy Sorts list results by a certain order. By default, * results are returned in alphanumerical order based on the resource name. * * You can also sort results in descending order based on the creation timestamp * using orderBy="creationTimestamp desc". This sorts results based on the * creationTimestamp field in reverse chronological order (newest result first). * Use this to sort resources like operations so that the newest operation is * returned first. * * Currently, only sorting by name or creationTimestamp desc is supported. * @opt_param string pageToken Specifies a page token to use. Set pageToken to * the nextPageToken returned by a previous list request to get the next page of * results. * @return Google_Service_Compute_SnapshotList */ public function listSnapshots($project, $optParams = array()) { $params = array('project' => $project); $params = array_merge($params, $optParams); return $this->call('list', array($params), "Google_Service_Compute_SnapshotList"); } /** * Sets the labels on a snapshot. To learn more about labels, read the Labeling * Resources documentation. (snapshots.setLabels) * * @param string $project Project ID for this request. * @param string $resource Name of the resource for this request. * @param Google_Service_Compute_GlobalSetLabelsRequest $postBody * @param array $optParams Optional parameters. * @return Google_Service_Compute_Operation */ public function setLabels($project, $resource, Google_Service_Compute_GlobalSetLabelsRequest $postBody, $optParams = array()) { $params = array('project' => $project, 'resource' => $resource, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('setLabels', array($params), "Google_Service_Compute_Operation"); } }
{ "pile_set_name": "Github" }
package lion import ( "context" "encoding/json" "encoding/xml" "errors" "fmt" "net/http" "net/url" "time" "github.com/celrenheit/lion/internal/matcher" ) type ctxKeyType int // Context key to store *ctx const ctxKey ctxKeyType = 0 var ( // ErrInvalidRedirectStatusCode is used to notify when an invalid redirect status code is used on Context.Redirect() ErrInvalidRedirectStatusCode = errors.New("Invalid redirect status code") contentTypeJSON = "application/json; charset=utf-8" contentTypeXML = "application/xml; charset=utf-8" contentTypeTextPlain = "text/plain; charset=utf-8" contentTypeTextHTML = "text/html; charset=utf-8" ) // Check Context implements net.Context var _ context.Context = (*ctx)(nil) var _ Context = (*ctx)(nil) var _ http.ResponseWriter = (*ctx)(nil) // Context is used to store url params and is a convinient utility to read informations from the current *http.Request and render to the current http.ResponseWriter. // It implements the http.ResponseWriter interface. type Context interface { context.Context http.ResponseWriter Param(key string) string ParamOk(key string) (string, bool) Clone() Context Request() *http.Request // Request Cookie(name string) (*http.Cookie, error) Query(name string) string GetHeader(key string) string // Response WithStatus(code int) Context WithHeader(key, value string) Context WithCookie(cookie *http.Cookie) Context // Rendering JSON(data interface{}) error XML(data interface{}) error String(format string, a ...interface{}) error Error(err error) error File(path string) error Attachment(path, filename string) error Redirect(urlStr string) error } // Context implements context.Context and stores values of url parameters type ctx struct { http.ResponseWriter parent context.Context req *http.Request params []parameter code int statusWritten bool tags matcher.Tags searchHistory []string } // newContext creates a new context instance func newContext() *ctx { return newContextWithParent(context.Background()) } // newContextWithParent creates a new context with a parent context specified func newContextWithParent(c context.Context) *ctx { return newContextWithResReq(c, nil, nil) } func newContextWithResReq(c context.Context, w http.ResponseWriter, r *http.Request) *ctx { return &ctx{ parent: c, ResponseWriter: w, req: r, tags: make([]string, 1), searchHistory: make([]string, 0, 20), // Preallocate enough capacity. TODO: Make it depend on max nodes } } // Value returns the value for the passed key. If it is not found in the url params it returns parent's context Value func (c *ctx) Value(key interface{}) interface{} { if key == ctxKey { return c } if k, ok := key.(string); ok { if val, exist := c.ParamOk(k); exist { return val } } return c.parent.Value(key) } func (c *ctx) Deadline() (deadline time.Time, ok bool) { return c.parent.Deadline() } func (c *ctx) Done() <-chan struct{} { return c.parent.Done() } func (c *ctx) Err() error { return c.parent.Err() } func (c *ctx) AddParam(key, val string) { c.params = append(c.params, parameter{key, val}) } // Param returns the value of a param. // If it does not exist it returns an empty string func (c *ctx) Param(key string) string { val, _ := c.ParamOk(key) return val } // ParamOk returns the value of a param and a boolean that indicates if the param exists. func (c *ctx) ParamOk(key string) (string, bool) { for _, p := range c.params { if p.key == key { return p.val, true } } return "", false } func (c *ctx) Clone() Context { nc := newContext() nc.parent = c.parent nc.params = make([]parameter, len(c.params), cap(c.params)) copy(nc.params, c.params) // shallow copy of request nr := &c.req nc.req = *nr return nc } func (c *ctx) SearchHistory() []string { return c.searchHistory } ///////////// REQUEST UTILS //////////////// func (c *ctx) Request() *http.Request { return c.req } func (c *ctx) Cookie(name string) (*http.Cookie, error) { return c.Request().Cookie(name) } func (c *ctx) Query(name string) string { return c.urlQueries().Get(name) } func (c *ctx) urlQueries() url.Values { return c.Request().URL.Query() } func (c *ctx) GetHeader(key string) string { return c.Request().Header.Get(key) } ///////////// REQUEST UTILS //////////////// ///////////// RESPONSE MODIFIERS ///////////// // WithStatus sets the status code for the current request. // If the status has already been written it will not change the current status code func (c *ctx) WithStatus(code int) Context { c.code = code return c } func (c *ctx) writeHeader() { if !c.isStatusWritten() { c.WriteHeader(c.code) c.statusWritten = true } } func (c *ctx) isStatusWritten() bool { return c.statusWritten } // WithHeader is a convenient alias for http.ResponseWriter.Header().Set() func (c *ctx) WithHeader(key, value string) Context { c.Header().Set(key, value) return c } func (c *ctx) WithCookie(cookie *http.Cookie) Context { http.SetCookie(c, cookie) return c } ///////////// RESPONSE MODIFIERS ///////////// ///////////// RESPONSE RENDERING ///////////// func (c *ctx) JSON(data interface{}) error { b, err := json.Marshal(data) if err != nil { return err } return c.raw(b, contentTypeJSON) } func (c *ctx) String(format string, a ...interface{}) error { str := fmt.Sprintf(format, a...) return c.raw([]byte(str), contentTypeTextPlain) } func (c *ctx) Error(err error) error { if herr, ok := err.(HTTPError); ok { return c.WithStatus(herr.Status()). String(err.Error()) } return c.String(err.Error()) } func (c *ctx) XML(data interface{}) error { b, err := xml.Marshal(data) if err != nil { return err } return c.raw(b, contentTypeXML) } func (c *ctx) File(path string) error { http.ServeFile(c, c.Request(), path) return nil } func (c *ctx) Attachment(path, filename string) error { return c.WithHeader("Content-Disposition", "attachment; filename="+filename). File(path) } func (c *ctx) setContentType(ctype string) { c.Header().Set("Content-Type", ctype) } func (c *ctx) raw(b []byte, contentType
{ "pile_set_name": "Github" }
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. from __future__ import absolute_import, print_function, unicode_literals from corpuscrawler.util import crawl_bibleis def crawl(crawler): out = crawler.get_output(language='hus') crawl_bibleis(crawler, out, bible='HUSLLB')
{ "pile_set_name": "Github" }
/** BEGIN COPYRIGHT BLOCK * 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/>. * * Additional permission under GPLv3 section 7: * * In the following paragraph, "GPL" means the GNU General Public * License, version 3 or any later version, and "Non-GPL Code" means * code that is governed neither by the GPL nor a license * compatible with the GPL. * * You may link the code of this Program with Non-GPL Code and convey * linked combinations including the two, provided that such Non-GPL * Code only links to the code of this Program through those well * defined interfaces identified in the file named EXCEPTION found in * the source code files (the "Approved Interfaces"). The files of * Non-GPL Code may instantiate templates or use macros or inline * functions from the Approved Interfaces without causing the resulting * work to be covered by the GPL. Only the copyright holders of this * Program may make changes or additions to the list of Approved * Interfaces. * * Copyright (C) 2013-2017 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK **/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <sys/types.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #include <errno.h> #include <pwd.h> #include <grp.h> #include "back_extdom.h" /* SSSD only exposes *_timeout() variants if the following symbol is defined */ #define IPA_389DS_PLUGIN_HELPER_CALLS #include <sss_nss_idmap.h> struct nss_ops_ctx { unsigned int timeout; }; static enum nss_status __convert_sss_nss2nss_status(int errcode) { switch(errcode) { case 0: return NSS_STATUS_SUCCESS; case ENOENT: return NSS_STATUS_NOTFOUND; case ERANGE: return NSS_STATUS_TRYAGAIN; case ETIME: /* fall-through */ case ETIMEDOUT: /* fall-through */ default: return NSS_STATUS_UNAVAIL; } return NSS_STATUS_UNAVAIL; } int back_extdom_init_context(struct nss_ops_ctx **nss_context) { struct nss_ops_ctx *ctx = NULL; if (nss_context == NULL) { return EINVAL; } ctx = calloc(1, sizeof(struct nss_ops_ctx)); if (ctx == NULL) { return ENOMEM; } *nss_context = ctx; return 0; } void back_extdom_free_context(struct nss_ops_ctx **nss_context) { if ((nss_context == NULL) || (*nss_context == NULL)) { return; } free((*nss_context)); *nss_context = NULL; } void back_extdom_set_timeout(struct nss_ops_ctx *nss_context, unsigned int timeout) { if (nss_context == NULL) { return; } nss_context->timeout = timeout; } unsigned int back_extdom_get_timeout(struct nss_ops_ctx *nss_context) { if (nss_context == NULL) { return DEFAULT_MAX_NSS_TIMEOUT; } return nss_context->timeout; } void back_extdom_evict_user(struct nss_ops_ctx *nss_context, const char *name) { if (nss_context == NULL) { return; } (void) sss_nss_getpwnam_timeout(name, NULL, NULL, 0, NULL, SSS_NSS_EX_FLAG_INVALIDATE_CACHE, nss_context->timeout); } void back_extdom_evict_group(struct nss_ops_ctx *nss_context, const char *name) { if (nss_context == NULL) { return; } (void) sss_nss_getgrnam_timeout(name, NULL, NULL, 0, NULL, SSS_NSS_EX_FLAG_INVALIDATE_CACHE, nss_context->timeout); } enum nss_status back_extdom_getpwnam(struct nss_ops_ctx *nss_context, const char *name, struct passwd *pwd, char *buffer, size_t buflen, struct passwd **result, int *lerrno) { int ret = 0; if (nss_context == NULL) { return NSS_STATUS_UNAVAIL; } ret = sss_nss_getpwnam_timeout(name, pwd, buffer, buflen, result, SSS_NSS_EX_FLAG_NO_FLAGS, nss_context->timeout); /* SSSD uses the same infrastructure to handle sss_nss_get* calls * as nss_sss.so.2 module where 'int *errno' is passed to the helper * but writes down errno into return code so we propagate it in case * of error and translate the return code */ if (lerrno != NULL) { *lerrno = ret; } return __convert_sss_nss2nss_status(ret); } enum nss_status back_extdom_getpwuid(struct nss_ops_ctx *nss_context, uid_t uid, struct passwd *pwd, char *buffer, size_t buflen, struct passwd **result, int *lerrno) { int ret = 0; if (nss_context == NULL) { return NSS_STATUS_UNAVAIL; } ret = sss_nss_getpwuid_timeout(uid, pwd, buffer, buflen, result, SSS_NSS_EX_FLAG_NO_FLAGS, nss_context->timeout); /* SSSD uses the same infrastructure to handle sss_nss_get* calls * as nss_sss.so.2 module where 'int *errno' is passed to the helper * but writes down errno into return code so we propagate it in case * of error and translate the return code */ if (lerrno != NULL) { *lerrno = ret; } return __convert_sss_nss2nss_status(ret); } enum nss_status back_extdom_getgrnam(struct nss_ops_ctx *nss_context, const char *name, struct group *grp, char *buffer, size_t buflen, struct group **result, int *lerrno) { int ret = 0; if (nss_context == NULL) { return NSS_STATUS_UNAVAIL; } ret = sss_nss_getgrnam_timeout(name, grp, buffer, buflen, result, SSS_NSS_EX_FLAG_NO_FLAGS, nss_context->timeout); /* SSSD uses the same infrastructure to handle sss_nss_get* calls * as
{ "pile_set_name": "Github" }
[remap] importer="texture" type="StreamTexture" path="res://.import/icon_heightmap_smooth.svg-1216ccdd3a408b8769b0a0964b7bd3f9.stex" metadata={ "vram_texture": false } [deps] source_file="res://addons/zylann.hterrain/tools/icons/icon_heightmap_smooth.svg" dest_files=[ "res://.import/icon_heightmap_smooth.svg-1216ccdd3a408b8769b0a0964b7bd3f9.stex" ] [params] compress/mode=0 compress/lossy_quality=0.7 compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 flags/filter=true flags/mipmaps=false flags/anisotropic=false flags/srgb=2 process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false stream=false size_limit=0 detect_3d=true svg/scale=1.0
{ "pile_set_name": "Github" }
class AddTimeZoneToSites < ActiveRecord::Migration[4.2] def change add_column :sites, :time_zone, :string end end
{ "pile_set_name": "Github" }
(library (name lib) (wrapped false) (default_implementation lib.impl))
{ "pile_set_name": "Github" }
// ----------------------------------------------------------------------------------- // Functions for variables on startup #define initKey 59301350 // a code to identify the SHC #define EE_autoInitKey 0 #define EE_reticule 4 #define EE_dispMaxContrast 8 #define EE_dispDimTimeout 12 #define EE_dispBlankTimeout 16 void SmartHandController::initInitNvValues() { // EEPROM automatic initialization long autoInitKey = initKey; long thisAutoInitKey; thisAutoInitKey=nv.readLong(EE_autoInitKey); if (autoInitKey!=thisAutoInitKey) { // stop the init from happening again nv.writeLong(EE_autoInitKey,autoInitKey); nv.writeLong(EE_dispMaxContrast,(long)maxContrast); nv.writeLong(EE_dispDimTimeout,(long)display_dim_time); nv.writeLong(EE_dispBlankTimeout,(long)display_blank_time); } } void SmartHandController::initReadNvValues() { #ifndef DISABLE_EEPROM_COMMIT_ON maxContrast = nv.readLong(EE_dispMaxContrast); display_dim_time = nv.readLong(EE_dispDimTimeout); display_blank_time = nv.readLong(EE_dispBlankTimeout); #endif }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0"> <context> <name>ArduinoBTController</name> <message> <source>Unknown</source> <translation type="unfinished"></translation> </message> <message> <source>Bluetooth Devices Paired</source> <translation type="unfinished"></translation> </message> </context> <context> <name>MacAddressHandler</name> <message> <source>&lt;not set&gt;</source> <translation type="unfinished"></translation> </message> </context> </TS>
{ "pile_set_name": "Github" }
/* * Copyright 2014 Guidewire Software, Inc. */ package gw.lang.reflect.java; import gw.lang.reflect.module.IModule; public interface ITypeInfoResolver { IJavaClassType resolveType(String relativeName, int ignoreFlags); IJavaClassType resolveType(String relativeName, IJavaClassInfo whosAskin, int ignoreFlags); IJavaClassType resolveImport(String relativeName); IModule getModule(); }
{ "pile_set_name": "Github" }
/* This file is part of Magnum. Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Vladimír Vondruš <mosra@centrum.cz> 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 "AnySceneImporter.h" #include <Corrade/Containers/Optional.h> #include <Corrade/PluginManager/Manager.h> #include <Corrade/PluginManager/PluginMetadata.h> #include <Corrade/Utility/Assert.h> #include <Corrade/Utility/DebugStl.h> #include <Corrade/Utility/String.h> #include "Magnum/Trade/AnimationData.h" #include "Magnum/Trade/CameraData.h" #include "Magnum/Trade/ImageData.h" #include "Magnum/Trade/LightData.h" #include "Magnum/Trade/MaterialData.h" #include "Magnum/Trade/MeshData.h" #include "Magnum/Trade/ObjectData2D.h" #include "Magnum/Trade/ObjectData3D.h" #include "Magnum/Trade/SceneData.h" #include "Magnum/Trade/SkinData.h" #include "Magnum/Trade/TextureData.h" #ifdef MAGNUM_BUILD_DEPRECATED #define _MAGNUM_NO_DEPRECATED_MESHDATA /* So it doesn't yell here */ #include "Magnum/Trade/MeshData2D.h" #include "Magnum/Trade/MeshData3D.h" #endif namespace Magnum { namespace Trade { AnySceneImporter::AnySceneImporter(PluginManager::Manager<AbstractImporter>& manager): AbstractImporter{manager} {} AnySceneImporter::AnySceneImporter(PluginManager::AbstractManager& manager, const std::string& plugin): AbstractImporter{manager, plugin} {} AnySceneImporter::~AnySceneImporter() = default; ImporterFeatures AnySceneImporter::doFeatures() const { return {}; } bool AnySceneImporter::doIsOpened() const { return !!_in; } void AnySceneImporter::doClose() { _in = nullptr; } void AnySceneImporter::doOpenFile(const std::string& filename) { CORRADE_INTERNAL_ASSERT(manager()); /** @todo lowercase only the extension, once Directory::split() is done */ const std::string normalized = Utility::String::lowercase(filename); /* Detect the plugin from extension */ std::string plugin; if(Utility::String::endsWith(normalized, ".3ds") || Utility::String::endsWith(normalized, ".ase")) plugin = "3dsImporter"; else if(Utility::String::endsWith(normalized, ".ac")) plugin = "Ac3dImporter"; else if(Utility::String::endsWith(normalized, ".blend")) plugin = "BlenderImporter"; else if(Utility::String::endsWith(normalized, ".bvh")) plugin = "BvhImporter"; else if(Utility::String::endsWith(normalized, ".csm")) plugin = "CsmImporter"; else if(Utility::String::endsWith(normalized, ".dae")) plugin = "ColladaImporter"; else if(Utility::String::endsWith(normalized, ".x")) plugin = "DirectXImporter"; else if(Utility::String::endsWith(normalized, ".dxf")) plugin = "DxfImporter"; else if(Utility::String::endsWith(normalized, ".fbx")) plugin = "FbxImporter"; else if(Utility::String::endsWith(normalized, ".gltf") || Utility::String::endsWith(normalized, ".glb")) plugin = "GltfImporter"; else if(Utility::String::endsWith(normalized, ".ifc")) plugin = "IfcImporter"; else if(Utility::String::endsWith(normalized, ".irrmesh") || Utility::String::endsWith(normalized, ".irr")) plugin = "IrrlichtImporter"; else if(Utility::String::endsWith(normalized, ".lwo") || Utility::String::endsWith(normalized, ".lws")) plugin = "LightWaveImporter"; else if(Utility::String::endsWith(normalized, ".lxo")) plugin = "ModoImporter"; else if(Utility::String::endsWith(normalized, ".ms3d")) plugin = "MilkshapeImporter"; else if(Utility::String::endsWith(normalized, ".obj")) plugin = "ObjImporter"; else if(Utility::String::endsWith(normalized, ".xml")) plugin = "OgreImporter"; else if(Utility::String::endsWith(normalized, ".ogex")) plugin = "OpenGexImporter"; else if(Utility::String::endsWith(normalized, ".ply")) plugin = "StanfordImporter"; else if(Utility::String::endsWith(normalized, ".stl")) plugin = "StlImporter"; else if(Utility::String::endsWith(normalized, ".cob") || Utility::String::endsWith(normalized, ".scn")) plugin = "TrueSpaceImporter"; else if(Utility::String::endsWith(normalized, ".3d")) plugin = "UnrealImporter"; else if(Utility::String::endsWith(normalized, ".smd") || Utility::String::endsWith(normalized, ".vta")) plugin = "ValveImporter"; else if(Utility::String::endsWith(normalized, ".xgl") || Utility::String::endsWith(normalized, ".zgl")) plugin = "XglImporter"; else { Error{} << "Trade::AnySceneImporter::openFile(): cannot determine the format of" << filename; return; } /* Try to load the plugin */ if(!(manager()->load(plugin) & PluginManager::LoadState::Loaded)) { Error{} << "Trade::AnySceneImporter::openFile(): cannot load the" << plugin << "plugin"; return; } if(flags() & ImporterFlag::Verbose) { Debug d; d << "Trade::AnySceneImporter::openFile(): using" << plugin; PluginManager::PluginMetadata* metadata = manager()->metadata(plugin); CORRADE_INTERNAL_ASSERT(metadata); if(plugin != metadata->name()) d << "(provided by" << metadata->name() << Debug::nospace << ")"; } /* Instantiate the plugin, propagate flags */ Containers::Pointer<AbstractImporter> importer = static_cast<PluginManager::Manager<AbstractImporter>*>(manager())->instantiate(plugin); importer->setFlags(flags()); /* Try to open the file (error output should be printed by the plugin itself) */ if(!importer->openFile(filename)) return; /* Success, save the instance */ _in = std::move(importer); }
{ "pile_set_name": "Github" }
/* Copyright 2015 The TensorFlow Authors. 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. ==============================================================================*/ // The utility to read checkpoints for google brain tensor ops and v3 // checkpoints for dist_belief. // #ifndef TENSORFLOW_UTIL_TENSOR_SLICE_READER_CACHE_H_ #define TENSORFLOW_UTIL_TENSOR_SLICE_READER_CACHE_H_ #include <unordered_map> #include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/platform/mutex.h" #include "tensorflow/core/platform/types.h" #include "tensorflow/core/util/tensor_slice_reader.h" namespace tensorflow { namespace checkpoint { class TensorSliceReaderCache; // Wrapper to a lazily allocated TensorSliceReaderCache. class TensorSliceReaderCacheWrapper { public: TensorSliceReaderCacheWrapper(); ~TensorSliceReaderCacheWrapper(); // Same as TensorSliceReaderCache::GetReader(). const TensorSliceReader* GetReader( const string& filepattern, TensorSliceReader::OpenTableFunction open_function, int preferred_shard) const; private: mutable mutex mu_; mutable TensorSliceReaderCache* cache_ = nullptr; }; // A cache of TensorSliceReaders. class TensorSliceReaderCache { public: TensorSliceReaderCache(); ~TensorSliceReaderCache(); // Returns the TensorSliceReader corresponding to 'filepattern' and the // open_function. May return nullptr if we can not create a new // TensorSliceReader for the filepattern/open_function combination. const TensorSliceReader* GetReader( const string& filepattern, TensorSliceReader::OpenTableFunction open_function, int preferred_shard); private: // Need to use a regular function type in the key map as std::function does // not support ==. typedef Status (*OpenFuncType)(const string&, TensorSliceReader::Table**); // Protects attributes below. mutex mu_; // Maps of opened readers. std::unordered_map<string, std::pair<OpenFuncType, TensorSliceReader*>> readers_; // Set of keys that a previous GetReader() call is still trying to populate. std::set<string> still_opening_; // Condition variable to notify when a reader has been created. condition_variable cv_; }; } // namespace checkpoint } // namespace tensorflow #endif // TENSORFLOW_UTIL_TENSOR_SLICE_READER_CACHE_H_
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: c68099c0f6352614e8f3f941cc589177 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData:
{ "pile_set_name": "Github" }
/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package main import ( "flag" "fmt" "log" "time" "strings" gce "cloud.google.com/go/compute/metadata" "golang.org/x/net/context" "golang.org/x/oauth2" "golang.org/x/oauth2/google" monitoring "google.golang.org/api/monitoring/v3" ) // SD Dummy Exporter is a testing utility that exports a metric of constant value to Stackdriver // in a loop. Metric name and value can be specified with flags 'metric-name' and 'metric-value'. // SD Dummy Exporter assumes that it runs as a pod in GCE or GKE cluster, and the pod id, pod name // and namespace are passed to it with 'pod-id', 'pod-name' and 'namespace' flags. // Pod ID and pod name can be passed to a pod via Downward API. func main() { // Gather pod information podId := flag.String("pod-id", "", "pod id") namespace := flag.String("namespace", "", "namespace") podName := flag.String("pod-name", "", "pod name") metricName := flag.String("metric-name", "foo", "custom metric name") metricValue := flag.Int64("metric-value", 0, "custom metric value") metricLabelsArg := flag.String("metric-labels", "bar=1", "custom metric labels") // Whether to use old Stackdriver resource model - use monitored resource "gke_container" // For old resource model, podId flag has to be set. useOldResourceModel := flag.Bool("use-old-resource-model", true, "use old stackdriver resource model") // Whether to use new Stackdriver resource model - use monitored resource "k8s_pod" // For new resource model, podName and namespace flags have to be set. useNewResourceModel := flag.Bool("use-new-resource-model", false, "use new stackdriver resource model") flag.Parse() if *podId == "" && *useOldResourceModel { log.Fatalf("No pod id specified.") } if *podName == "" && *useNewResourceModel { log.Fatalf("No pod name specified.") } if *namespace == "" && *useNewResourceModel { log.Fatalf("No pod namespace specified.") } stackdriverService, err := getStackDriverService() if err != nil { log.Fatalf("Error getting Stackdriver service: %v", err) } metricLabels := make(map[string]string) for _, label := range strings.Split(*metricLabelsArg, ",") { labelParts := strings.Split(label, "=") metricLabels[labelParts[0]] = labelParts[1] } oldModelLabels := getResourceLabelsForOldModel(*podId) newModelLabels := getResourceLabelsForNewModel(*namespace, *podName) for { if *useOldResourceModel { err := exportMetric(stackdriverService, *metricName, *metricValue, metricLabels, "gke_container", oldModelLabels) if err != nil { log.Printf("Failed to write time series data for old resource model: %v\n", err) } else { log.Printf("Finished writing time series for new resource model with value: %v\n", metricValue) } } if *useNewResourceModel { err := exportMetric(stackdriverService, *metricName, *metricValue, metricLabels, "k8s_pod", newModelLabels) if err != nil { log.Printf("Failed to write time series data for new resource model: %v\n", err) } else { log.Printf("Finished writing time series for new resource model with value: %v\n", metricValue) } } time.Sleep(5000 * time.Millisecond) } } func getStackDriverService() (*monitoring.Service, error) { oauthClient := oauth2.NewClient(context.Background(), google.ComputeTokenSource("")) return monitoring.New(oauthClient) } // getResourceLabelsForOldModel returns resource labels needed to correctly label metric data // exported to StackDriver. Labels contain details on the cluster (project id, name) // and pod for which the metric is exported (zone, id). func getResourceLabelsForOldModel(podId string) map[string]string { projectId, _ := gce.ProjectID() zone, _ := gce.Zone() clusterName, _ := gce.InstanceAttributeValue("cluster-name") clusterName = strings.TrimSpace(clusterName) return map[string]string{ "project_id": projectId, "zone": zone, "cluster_name": clusterName, // container name doesn't matter here, because the metric is exported for // the pod, not the container "container_name": "", "pod_id": podId, // namespace_id and instance_id don't matter "namespace_id": "default", "instance_id": "", } } // getResourceLabelsForNewModel returns resource labels needed to correctly label metric data // exported to StackDriver. Labels contain details on the cluster (project id, location, name) // and pod for which the metric is exported (namespace, name). func getResourceLabelsForNewModel(namespace, name string) map[string]string { projectId, _ := gce.ProjectID() location, _ := gce.InstanceAttributeValue("cluster-location") location = strings.TrimSpace(location) clusterName, _ := gce.InstanceAttributeValue("cluster-name") clusterName = strings.TrimSpace(clusterName) return map[string]string{ "project_id": projectId, "location": location, "cluster_name": clusterName, "namespace_name": namespace, "pod_name": name, } } func exportMetric(stackdriverService *monitoring.Service, metricName string, metricValue int64, metricLabels map[string]string, monitoredResource string, resourceLabels map[string]string) error { dataPoint := &monitoring.Point{ Interval: &monitoring.TimeInterval{ EndTime: time.Now().Format(time.RFC3339), }, Value: &monitoring.TypedValue{ Int64Value: &metricValue, }, } // Write time series data. request := &monitoring.CreateTimeSeriesRequest{ TimeSeries: []*monitoring.TimeSeries{ { Metric: &monitoring.Metric{ Type: "custom.googleapis.com/" + metricName, Labels: metricLabels, }, Resource: &monitoring.MonitoredResource{ Type: monitoredResource, Labels: resourceLabels, }, Points: []*monitoring.Point{ dataPoint, }, }, }, } projectName := fmt.Sprintf("projects/%s", resourceLabels["project_id"]) _, err := stackdriverService.Projects.TimeSeries.Create(projectName, request).Do() return err }
{ "pile_set_name": "Github" }
--- version: 1 interactions: - request: body: login=test%2Buser%40example.com&name=test+user&role=engineer form: login: - test+user@example.com name: - test user role: - engineer headers: Content-Type: - application/x-www-form-urlencoded User-Agent: - FastlyGo/1.5.0 (+github.com/fastly/go-fastly; go1.13.5) url: https://api.fastly.com/user method: POST response: body: '{"id":"FoXUMd33uGfvJYLTqQ0d74","created_at":"2020-02-25T02:39:08Z","updated_at":"2020-02-25T02:39:08Z","name":"test user","customer_id":"qGfZo6FegmRT5XlvOLdsKy","require_new_password":false,"role":"engineer","login":"test+user@example.com","deleted_at":null,"locked":false,"two_factor_auth_enabled":false,"limit_services":false,"email_hash":"bebed43da3708b3360ad6aeb75adc7ae","two_factor_setup_required":true}' headers: Accept-Ranges: - bytes - bytes Cache-Control: - no-cache Content-Type: - application/json Date: - Tue, 25 Feb 2020 02:39:08 GMT Fastly-Ratelimit-Remaining: - "991" Fastly-Ratelimit-Reset: - "1582599600" Status: - 200 OK Strict-Transport-Security: - max-age=31536000 Vary: - Accept-Encoding Via: - 1.1 varnish - 1.1 varnish X-Cache: - MISS, MISS X-Cache-Hits: - 0, 0 X-Served-By: - cache-control-slwdc9037-CONTROL-SLWDC, cache-mdw17322-MDW X-Timer: - S1582598349.500241,VS0,VE212 status: 200 OK code: 200 duration: ""
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # Disable while we have Python 2.x compatability # pylint: disable=useless-object-inheritance """Exceptions that are used by SoCo.""" from __future__ import unicode_literals class SoCoException(Exception): """Base class for all SoCo exceptions.""" class UnknownSoCoException(SoCoException): """An unknown UPnP error. The exception object will contain the raw response sent back from the speaker as the first of its args. """ class SoCoUPnPException(SoCoException): """A UPnP Fault Code, raised in response to actions sent over the network. """ def __init__(self, message, error_code, error_xml, error_description=""): """ Args: message (str): The message from the server. error_code (str): The UPnP Error Code as a string. error_xml (str): The xml containing the error, as a utf-8 encoded string. error_description (str): A description of the error. Default is "" """ super(SoCoUPnPException, self).__init__() self.message = message self.error_code = error_code self.error_description = error_description self.error_xml = error_xml def __str__(self): return self.message class CannotCreateDIDLMetadata(SoCoException): """ .. deprecated:: 0.11 Use `DIDLMetadataError` instead. """ class DIDLMetadataError(CannotCreateDIDLMetadata): """Raised if a data container class cannot create the DIDL metadata due to missing information. For backward compatibility, this is currently a subclass of `CannotCreateDIDLMetadata`. In a future version, it will likely become a direct subclass of `SoCoException`. """ class MusicServiceException(SoCoException): """An error relating to a third party music service.""" class UnknownXMLStructure(SoCoException): """Raised if XML with an unknown or unexpected structure is returned.""" class SoCoSlaveException(SoCoException): """Raised when a master command is called on a slave.""" class NotSupportedException(SoCoException): """Raised when something is not supported by the device""" class EventParseException(SoCoException): """Raised when a parsing exception occurs during event handling. Attributes: tag (str): The tag for which the exception occured metadata (str): The metadata which failed to parse __cause__ (Exception): The original exception """ def __init__(self, tag, metadata, cause): """ Args: tag (str): The tag for which the exception occured metadata (str): The metadata which failed to parse cause (Exception): The original exception """ super(EventParseException, self).__init__() self.tag = tag self.metadata = metadata self.__cause__ = cause def __str__(self): return "Invalid metadata for '{}'".format(self.tag) class SoCoFault(object): """Class to represent a failed object instantiation. It rethrows the exception on common use. Attributes: exception: The exception which will be thrown on use """ def __init__(self, exception): """ Args: exception (Exception): The exception which should be thrown on use """ self.__dict__["exception"] = exception def __getattr__(self, name): raise self.exception def __setattr__(self, name, value): raise self.exception def __getitem__(self, item): raise self.exception def __setitem__(self, key, value): raise self.exception def __repr__(self): return "<{0}: {1} at {2}>".format( self.__class__.__name__, repr(self.exception), hex(id(self)) ) def __str__(self): return "<{0}: {1}>".format(self.__class__.__name__, repr(self.exception))
{ "pile_set_name": "Github" }
var convert = require('./convert'), func = convert('cloneDeepWith', require('../cloneDeepWith')); func.placeholder = require('./placeholder'); module.exports = func;
{ "pile_set_name": "Github" }
op { graph_op_name: "Stage" }
{ "pile_set_name": "Github" }
<?php /** * @link http://www.yiiframework.com/ * @copyright Copyright (c) 2008 Yii Software LLC * @license http://www.yiiframework.com/license/ */ namespace yii\mail; /** * MessageInterface is the interface that should be implemented by mail message classes. * * A message represents the settings and content of an email, such as the sender, recipient, * subject, body, etc. * * Messages are sent by a [[\yii\mail\MailerInterface|mailer]], like the following, * * ```php * Yii::$app->mailer->compose() * ->setFrom('from@domain.com') * ->setTo($form->email) * ->setSubject($form->subject) * ->setTextBody('Plain text content') * ->setHtmlBody('<b>HTML content</b>') * ->send(); * ``` * * @see MailerInterface * * @author Paul Klimov <klimov.paul@gmail.com> * @since 2.0 */ interface MessageInterface { /** * Returns the character set of this message. * @return string the character set of this message. */ public function getCharset(); /** * Sets the character set of this message. * @param string $charset character set name. * @return $this self reference. */ public function setCharset($charset); /** * Returns the message sender. * @return string|array the sender */ public function getFrom(); /** * Sets the message sender. * @param string|array $from sender email address. * You may pass an array of addresses if this message is from multiple people. * You may also specify sender name in addition to email address using format: * `[email => name]`. * @return $this self reference. */ public function setFrom($from); /** * Returns the message recipient(s). * @return string|array the message recipients */ public function getTo(); /** * Sets the message recipient(s). * @param string|array $to receiver email address. * You may pass an array of addresses if multiple recipients should receive this message. * You may also specify receiver name in addition to email address using format: * `[email => name]`. * @return $this self reference. */ public function setTo($to); /** * Returns the reply-to address of this message. * @return string|array the reply-to address of this message. */ public function getReplyTo(); /** * Sets the reply-to address of this message. * @param string|array $replyTo the reply-to address. * You may pass an array of addresses if this message should be replied to multiple people. * You may also specify reply-to name in addition to email address using format: * `[email => name]`. * @return $this self reference. */ public function setReplyTo($replyTo); /** * Returns the Cc (additional copy receiver) addresses of this message. * @return string|array the Cc (additional copy receiver) addresses of this message. */ public function getCc(); /** * Sets the Cc (additional copy receiver) addresses of this message. * @param string|array $cc copy receiver email address. * You may pass an array of addresses if multiple recipients should receive this message. * You may also specify receiver name in addition to email address using format: * `[email => name]`. * @return $this self reference. */ public function setCc($cc); /** * Returns the Bcc (hidden copy receiver) addresses of this message. * @return string|array the Bcc (hidden copy receiver) addresses of this message. */ public function getBcc(); /** * Sets the Bcc (hidden copy receiver) addresses of this message. * @param string|array $bcc hidden copy receiver email address. * You may pass an array of addresses if multiple recipients should receive this message. * You may also specify receiver name in addition to email address using format: * `[email => name]`. * @return $this self reference. */ public function setBcc($bcc); /** * Returns the message subject. * @return string the message subject */ public function getSubject(); /** * Sets the message subject. * @param string $subject message subject * @return $this self reference. */ public function setSubject($subject); /** * Sets message plain text content. * @param string $text message plain text content. * @return $this self reference. */ public function setTextBody($text); /** * Sets message HTML content. * @param string $html message HTML content. * @return $this self reference. */ public function setHtmlBody($html); /** * Attaches existing file to the email message. * @param string $fileName full file name * @param array $options options for embed file. Valid options are: * * - fileName: name, which should be used to attach file. * - contentType: attached file MIME type. * * @return $this self reference. */ public function attach($fileName, array $options = []); /** * Attach specified content as file for the email message. * @param string $content attachment file content. * @param array $options options for embed file. Valid options are: * * - fileName: name, which should be used to attach file. * - contentType: attached file MIME type. * * @return $this self reference. */ public function attachContent($content, array $options = []); /** * Attach a file and return it's CID source. * This method should be used when embedding images or other data in a message. * @param string $fileName file name. * @param array $options options for embed file. Valid options are: * * - fileName: name, which should be used to attach file. * - contentType: attached file MIME type. * * @return string attachment CID. */ public function embed($fileName, array $options = []); /** * Attach a content as file and return it's CID source. * This method should be used when embedding images or other data in a message. * @param string $content attachment file content. * @param array $options options for embed file. Valid options are: * * - fileName: name, which should be used to attach file. * - contentType: attached file MIME type. * * @return string attachment CID. */ public function embedContent($content, array $options = []); /** * Sends this email message. * @param MailerInterface $mailer the mailer that should be used to send this message. * If null, the "mailer" application component will be used instead. * @return bool whether this message is sent successfully. */ public function send(MailerInterface $mailer = null); /** * Returns string representation of this message. * @return string the string representation of this message. */ public function toString(); }
{ "pile_set_name": "Github" }
/** * jQuery.autotype - Simple, accurate, typing simulation for jQuery * * version 0.5.0 * * http://michaelmonteleone.net/projects/autotype * http://github.com/mmonteleone/jquery.autotype * * Copyright (c) 2009 Michael Monteleone * Licensed under terms of the MIT License (README.markdown) */ (function($){ // code type constants var CHARACTER = 1, NON_CHARACTER = 2, MODIFIER_BEGIN = 3, MODIFIER_END = 4, isNullOrEmpty = function(val) { return val === null || val.length === 0; }, isUpper = function(char) { return char.toUpperCase() === char; }, isLower = function(char) { return char.toLowerCase() === char; }, areDifferentlyCased = function(char1,char2) { return (isUpper(char1) && isLower(char2)) || (isLower(char1) && isUpper(char2)); }, convertCase = function(char) { return isUpper(char) ? char.toLowerCase() : char.toUpperCase(); }, parseCodes = function(value, codeMap) { // buffer to hold a collection of key/char code pairs corresponding to input string value var codes = [], // buffer to hold the name of a control key as it's being parsed definingControlKey = false, // hold a collection of currently pushed modifier keys activeModifiers = { alt: false, meta: false, shift: false, ctrl: false }, explicitModifiers = $.extend({}, activeModifiers), // buffer to hold construction of current control key currentControlKey = '', previousChar = '', pushCode = function(opts) { codes.push($.extend({}, opts, activeModifiers)); }, pushModifierBeginCode = function(modifierName) { activeModifiers[modifierName] = true; pushCode({ keyCode: codeMap[modifierName], charCode: 0, char: '', type: MODIFIER_BEGIN }); }, pushModifierEndCode = function(modifierName) { activeModifiers[modifierName] = false; pushCode({ keyCode: codeMap[modifierName], charCode: 0, char: '', type: MODIFIER_END }); }; for(var i=0;i<value.length;i++) { // if the character is about to define a control key if(!definingControlKey && i <= value.length - 5 && value.charAt(i) === '{' && value.charAt(i+1) === '{') { // skip the next "{" i++; definingControlKey = true; } // if the character is about to end definition of control key else if (definingControlKey && i <= value.length - 2 && value.charAt(i) === '}' && value.charAt(i+1) === '}') { // skip the next "}" i++; // check if this key is a modifier-opener (is a ctrl,alt,del,shift) if(activeModifiers[currentControlKey] !== undefined) { explicitModifiers[currentControlKey] = true; pushModifierBeginCode(currentControlKey); } // check if this key is a modifier-closer (is a /ctrl,/alt,/del,.shift) else if(activeModifiers[currentControlKey.substring(1)] !== undefined) { explicitModifiers[currentControlKey] = false; pushModifierEndCode(currentControlKey.substring(1)); } // otherwise is some other kind of non-modifier control key else { pushCode({ keyCode: codeMap[currentControlKey], charCode: 0, char: '', type: NON_CHARACTER, controlKeyName: currentControlKey }); } definingControlKey = false; currentControlKey = ''; } // currently defining control key else if (definingControlKey) { currentControlKey += value.charAt(i); } // otherwise is just a text character else { var character = value.charAt(i); // check for any implicitly changing of cases, and register presses/releases // of the shift key in accord with them. if( (!isNullOrEmpty(previousChar) && areDifferentlyCased(previousChar, character)) || (isNullOrEmpty(previousChar) && isUpper(character)) ) { if(isUpper(character) && !activeModifiers.shift) { pushModifierBeginCode("shift"); } else if (isLower(character) && activeModifiers.shift && !explicitModifiers.shift){ pushModifierEndCode("shift"); } } // modify the current character if there are active modifiers if((activeModifiers.shift && isLower(character)) || (!activeModifiers.shift && isUpper(character))) { // shift converts case character = convertCase(character); } var code = { // if can't identify a keycode, just fudge with the char code. // nope, this isn't ideal by any means. keyCode: codeMap[character] || character.charCodeAt(0), charCode: character.charCodeAt(0), char: character, type: CHARACTER }; // modify the current character if there are active modifiers if(activeModifiers.alt || activeModifiers.ctrl || activeModifiers.meta) { // alt, ctrl, meta make it so nothing is typed code.char = ''; } pushCode(code); if(code.char !== '') { previousChar = code.char; } } } return codes; }, triggerCodeOnField = function(code, field) { // build up base content that every event should contain // with information about whether certain chord keys are // simulated as being pressed var evnt = { altKey: code.alt, metaKey: code.meta, shiftKey: code.shift, ctrlKey: code.ctrl }; // build out 3 event instances for all the steps of a key entry var keyDownEvent = $.extend($.Event(), evnt, {type:'keydown', keyCode: code.keyCode, charCode: 0, which: code.keyCode}); var keyPressEvent = $.extend($.Event(), evnt, {type:'keypress', keyCode: 0, charCode: code.charCode, which: code.charCode || code.keyCode}); var keyUpEvent = $.extend($.Event(), evnt, {type:'keyup', keyCode: code.keyCode, charCode: 0, which: code.keyCode}); // go ahead and trigger the first 2 (down and press) // a keyup of a modifier shouldn't also re-trigger a keydown if(code.type !== MODIFIER_END) { field.trigger(keyDownEvent); } // modifier keys don't have a keypress event, only down or up if(code.type !== MODIFIER_BEGIN && code.type !== MODIFIER_END) { field.trigger(keyPressEvent); } // only actually add the new character to the input if the keydown or keypress events // weren't cancelled by any consuming event handlers if(!keyDownEvent.isPropagationStopped() && !keyPressEvent.isPropagationStopped()) { if(code.type === NON_CHARACTER) { switch(code.controlKeyName) { case 'enter': field.val(field.val() + "\n"); break; case 'back': field.val(field.val().substring(0,field.val().length-1)); break
{ "pile_set_name": "Github" }
""" Pure SciPy implementation of Locally Optimal Block Preconditioned Conjugate Gradient Method (LOBPCG), see http://www-math.cudenver.edu/~aknyazev/software/BLOPEX/ License: BSD Authors: Robert Cimrman, Andrew Knyazev Examples in tests directory contributed by Nils Wagner. """ from __future__ import division, print_function, absolute_import import sys import numpy as np from numpy.testing import assert_allclose from scipy._lib.six import xrange from scipy.linalg import inv, eigh, cho_factor, cho_solve, cholesky from scipy.sparse.linalg import aslinearoperator, LinearOperator __all__ = ['lobpcg'] @np.deprecate(new_name='eigh') def symeig(mtxA, mtxB=None, select=None): return eigh(mtxA, b=mtxB, eigvals=select) def pause(): # Used only when verbosity level > 10. input() def save(ar, fileName): # Used only when verbosity level > 10. from numpy import savetxt savetxt(fileName, ar, precision=8) def _assert_symmetric(M, rtol=1e-5, atol=1e-8): assert_allclose(M.T, M, rtol=rtol, atol=atol) ## # 21.05.2007, c def as2d(ar): """ If the input array is 2D return it, if it is 1D, append a dimension, making it a column vector. """ if ar.ndim == 2: return ar else: # Assume 1! aux = np.array(ar, copy=False) aux.shape = (ar.shape[0], 1) return aux def _makeOperator(operatorInput, expectedShape): """Takes a dense numpy array or a sparse matrix or a function and makes an operator performing matrix * blockvector products. Examples -------- >>> A = _makeOperator( arrayA, (n, n) ) >>> vectorB = A( vectorX ) """ if operatorInput is None: def ident(x): return x operator = LinearOperator(expectedShape, ident, matmat=ident) else: operator = aslinearoperator(operatorInput) if operator.shape != expectedShape: raise ValueError('operator has invalid shape') return operator def _applyConstraints(blockVectorV, factYBY, blockVectorBY, blockVectorY): """Changes blockVectorV in place.""" gramYBV = np.dot(blockVectorBY.T, blockVectorV) tmp = cho_solve(factYBY, gramYBV) blockVectorV -= np.dot(blockVectorY, tmp) def _b_orthonormalize(B, blockVectorV, blockVectorBV=None, retInvR=False): if blockVectorBV is None: if B is not None: blockVectorBV = B(blockVectorV) else: blockVectorBV = blockVectorV # Shared data!!! gramVBV = np.dot(blockVectorV.T, blockVectorBV) gramVBV = cholesky(gramVBV) gramVBV = inv(gramVBV, overwrite_a=True) # gramVBV is now R^{-1}. blockVectorV = np.dot(blockVectorV, gramVBV) if B is not None: blockVectorBV = np.dot(blockVectorBV, gramVBV) if retInvR: return blockVectorV, blockVectorBV, gramVBV else: return blockVectorV, blockVectorBV def lobpcg(A, X, B=None, M=None, Y=None, tol=None, maxiter=20, largest=True, verbosityLevel=0, retLambdaHistory=False, retResidualNormsHistory=False): """Locally Optimal Block Preconditioned Conjugate Gradient Method (LOBPCG) LOBPCG is a preconditioned eigensolver for large symmetric positive definite (SPD) generalized eigenproblems. Parameters ---------- A : {sparse matrix, dense matrix, LinearOperator} The symmetric linear operator of the problem, usually a sparse matrix. Often called the "stiffness matrix". X : array_like Initial approximation to the k eigenvectors. If A has shape=(n,n) then X should have shape shape=(n,k). B : {dense matrix, sparse matrix, LinearOperator}, optional the right hand side operator in a generalized eigenproblem. by default, B = Identity often called the "mass matrix" M : {dense matrix, sparse matrix, LinearOperator}, optional preconditioner to A; by default M = Identity M should approximate the inverse of A Y : array_like, optional n-by-sizeY matrix of constraints, sizeY < n The iterations will be performed in the B-orthogonal complement of the column-space of Y. Y must be full rank. Returns ------- w : array Array of k eigenvalues v : array An array of k eigenvectors. V has the same shape as X. Other Parameters ---------------- tol : scalar, optional Solver tolerance (stopping criterion) by default: tol=n*sqrt(eps) maxiter : integer, optional maximum number of iterations by default: maxiter=min(n,20) largest : bool, optional when True, solve for the largest eigenvalues, otherwise the smallest verbosityLevel : integer, optional controls solver output. default: verbosityLevel = 0. retLambdaHistory : boolean, optional whether to return eigenvalue history retResidualNormsHistory : boolean, optional whether to return history of residual norms Examples -------- Solve A x = lambda B x with constraints and preconditioning. >>> from scipy.sparse import spdiags, issparse >>> from scipy.sparse.linalg import lobpcg, LinearOperator >>> n = 100 >>> vals = [np.arange(n, dtype=np.float64) + 1] >>> A = spdiags(vals, 0, n, n) >>> A.toarray() array([[ 1., 0., 0., ..., 0., 0., 0.], [ 0., 2., 0., ..., 0., 0., 0.], [ 0., 0., 3., ..., 0., 0., 0.], ..., [ 0., 0., 0., ..., 98., 0., 0.], [ 0., 0., 0., ..., 0., 99., 0.], [ 0., 0., 0., ..., 0., 0., 100.]]) Constraints. >>> Y = np.eye(n, 3) Initial guess for eigenvectors, should have linearly independent columns. Column dimension = number of requested eigenvalues. >>> X = np.random.rand(n, 3) Preconditioner -- inverse of A (as an abstract linear operator). >>> invA = spdiags([1./vals[0]], 0, n, n) >>> def precond( x ): ... return invA * x >>> M = LinearOperator(matvec=precond, shape=(n, n), dtype=float) Here, ``invA`` could of course have been used directly as a preconditioner. Let us then solve the problem: >>> eigs, vecs = lobpcg(A, X, Y=Y, M=M, tol=1e-4, maxiter=40, largest=False) >>> eigs array([ 4., 5., 6.]) Note that the vectors passed in Y are the eigenvectors of the 3 smallest eigenvalues. The results returned are orthogonal to those. Notes ----- If both retLambdaHistory and retResidualNormsHistory are True, the return tuple has the following format (lambda, V, lambda history, residual norms history). In the following ``n`` denotes the matrix size and ``m``
{ "pile_set_name": "Github" }
#define OWL_PARSER_IMPLEMENTATION #include "1-parse.h"
{ "pile_set_name": "Github" }
package com.lukaslechner.coroutineusecasesonandroid.utils import com.google.gson.Gson import okhttp3.* class MockNetworkInterceptor : Interceptor { private val mockResponses = mutableListOf<MockResponse>() private val gson = Gson() override fun intercept(chain: Interceptor.Chain): Response { val request = chain.request() val mockResponse = findMockResponseInList(request) ?: return chain.proceed(request) removeResponseIfItShouldNotBePersisted(mockResponse) simulateNetworkDelay(mockResponse) return if (mockResponse.status < 400) { createSuccessResponse(mockResponse, request) } else { createErrorResponse(request) } } private fun findMockResponseInList(request: Request): MockResponse? { return mockResponses.find { mockResponse -> mockResponse.path == request.url().toString() } } private fun removeResponseIfItShouldNotBePersisted(mockResponse: MockResponse) { if (!mockResponse.persist) { mockResponses.remove(mockResponse) } } private fun simulateNetworkDelay(mockResponse: MockResponse) { Thread.sleep(mockResponse.delayInMs) } private fun createErrorResponse(request: Request): Response { return Response.Builder() .code(500) .request(request) .protocol(Protocol.HTTP_1_1) .message("Internal Server Error") .body( ResponseBody.create( MediaType.get("application/json"), gson.toJson(mapOf("cause" to "not sure")) ) ) .build() } private fun createSuccessResponse( mockResponse: MockResponse, request: Request ): Response { return Response.Builder() .code(mockResponse.status) .request(request) .protocol(Protocol.HTTP_1_1) .message("OK") .body( ResponseBody.create( MediaType.get("application/json"), mockResponse.body ) ) .build() } fun mock( path: String, body: String, status: Int, delayInMs: Long = 250, persist: Boolean = true ) = apply { val mockResponse = MockResponse( path, body, status, delayInMs, persist ) mockResponses.add(mockResponse) } companion object { const val INTERNAL_SERVER_ERROR_HTTP_CODE = 500 } } data class MockResponse( val path: String, val body: String, val status: Int, val delayInMs: Long, val persist: Boolean )
{ "pile_set_name": "Github" }
import React from 'react' import { AddExternalServicesPage, AddExternalServicesPageProps, } from '../components/externalServices/AddExternalServicesPage' import { codeHostExternalServices, nonCodeHostExternalServices } from '../components/externalServices/externalServices' export interface SiteAdminAddExternalServicesPageProps extends Omit< AddExternalServicesPageProps, 'routingPrefix' | 'afterCreateRoute' | 'codeHostExternalServices' | 'nonCodeHostExternalServices' > {} export const SiteAdminAddExternalServicesPage: React.FunctionComponent<SiteAdminAddExternalServicesPageProps> = props => ( <AddExternalServicesPage {...props} routingPrefix="/site-admin" afterCreateRoute="/site-admin/repositories?repositoriesUpdated" codeHostExternalServices={codeHostExternalServices} nonCodeHostExternalServices={nonCodeHostExternalServices} /> )
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2005-2020 Junjiro R. Okajima * * This program, aufs is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* * virtual or vertical directory */ #include <linux/iversion.h> #include "aufs.h" static unsigned int calc_size(int nlen) { return ALIGN(sizeof(struct au_vdir_de) + nlen, sizeof(ino_t)); } static int set_deblk_end(union au_vdir_deblk_p *p, union au_vdir_deblk_p *deblk_end) { if (calc_size(0) <= deblk_end->deblk - p->deblk) { p->de->de_str.len = 0; /* smp_mb(); */ return 0; } return -1; /* error */ } /* returns true or false */ static int is_deblk_end(union au_vdir_deblk_p *p, union au_vdir_deblk_p *deblk_end) { if (calc_size(0) <= deblk_end->deblk - p->deblk) return !p->de->de_str.len; return 1; } static unsigned char *last_deblk(struct au_vdir *vdir) { return vdir->vd_deblk[vdir->vd_nblk - 1]; } /* ---------------------------------------------------------------------- */ /* estimate the appropriate size for name hash table */ unsigned int au_rdhash_est(loff_t sz) { unsigned int n; n = UINT_MAX; sz >>= 10; if (sz < n) n = sz; if (sz < AUFS_RDHASH_DEF) n = AUFS_RDHASH_DEF; /* pr_info("n %u\n", n); */ return n; } /* * the allocated memory has to be freed by * au_nhash_wh_free() or au_nhash_de_free(). */ int au_nhash_alloc(struct au_nhash *nhash, unsigned int num_hash, gfp_t gfp) { struct hlist_head *head; unsigned int u; size_t sz; sz = sizeof(*nhash->nh_head) * num_hash; head = kmalloc(sz, gfp); if (head) { nhash->nh_num = num_hash; nhash->nh_head = head; for (u = 0; u < num_hash; u++) INIT_HLIST_HEAD(head++); return 0; /* success */ } return -ENOMEM; } static void nhash_count(struct hlist_head *head) { #if 0 /* debugging */ unsigned long n; struct hlist_node *pos; n = 0; hlist_for_each(pos, head) n++; pr_info("%lu\n", n); #endif } static void au_nhash_wh_do_free(struct hlist_head *head) { struct au_vdir_wh *pos; struct hlist_node *node; hlist_for_each_entry_safe(pos, node, head, wh_hash) au_kfree_rcu(pos); } static void au_nhash_de_do_free(struct hlist_head *head) { struct au_vdir_dehstr *pos; struct hlist_node *node; hlist_for_each_entry_safe(pos, node, head, hash) au_cache_free_vdir_dehstr(pos); } static void au_nhash_do_free(struct au_nhash *nhash, void (*free)(struct hlist_head *head)) { unsigned int n; struct hlist_head *head; n = nhash->nh_num; if (!n) return; head = nhash->nh_head; while (n-- > 0) { nhash_count(head); free(head++); } au_kfree_try_rcu(nhash->nh_head); } void au_nhash_wh_free(struct au_nhash *whlist) { au_nhash_do_free(whlist, au_nhash_wh_do_free); } static void au_nhash_de_free(struct au_nhash *delist) { au_nhash_do_free(delist, au_nhash_de_do_free); } /* ---------------------------------------------------------------------- */ int au_nhash_test_longer_wh(struct au_nhash *whlist, aufs_bindex_t btgt, int limit) { int num; unsigned int u, n; struct hlist_head *head; struct au_vdir_wh *pos; num = 0; n = whlist->nh_num; head = whlist->nh_head; for (u = 0; u < n; u++, head++) hlist_for_each_entry(pos, head, wh_hash) if (pos->wh_bindex == btgt && ++num > limit) return 1; return 0; } static struct hlist_head *au_name_hash(struct au_nhash *nhash, unsigned char *name, unsigned int len) { unsigned int v; /* const unsigned int magic_bit = 12; */ AuDebugOn(!nhash->nh_num || !nhash->nh_head); v = 0; if (len > 8) len = 8; while (len--) v += *name++; /* v = hash_long(v, magic_bit); */ v %= nhash->nh_num; return nhash->nh_head + v; } static int au_nhash_test_name(struct au_vdir_destr *str, const char *name, int nlen) { return str->len == nlen && !memcmp(str->name, name, nlen); } /* returns found or not */ int au_nhash_test_known_wh(struct au_nhash *whlist, char *name, int nlen) { struct hlist_head *head; struct au_vdir_wh *pos; struct au_vdir_destr *str; head = au_name_hash(whlist, name, nlen); hlist_for_each_entry(pos, head, wh_hash) { str = &pos->wh_str; AuDbg("%.*s\n", str->len, str->name); if (au_nhash_test_name(str, name, nlen)) return 1; } return 0; } /* returns found(true) or not */ static int test_known(struct au_nhash *delist, char *name, int nlen) { struct hlist_head *head; struct au_vdir_dehstr *pos; struct au_vdir_destr *str; head = au_name_hash(delist, name, nlen); hlist_for_each_entry(pos, head, hash) { str = pos->str; AuDbg("%.*s\n", str->len, str->name); if (au_nhash_test_
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright (c) 2009 IBM Corporation and others. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 * which is available at https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation * Zend Technologies *******************************************************************************/ package org.eclipse.php.internal.ui.preferences; import java.util.ArrayList; import java.util.List; import org.eclipse.jface.dialogs.StatusDialog; import org.eclipse.php.internal.core.PHPCoreConstants; import org.eclipse.php.internal.ui.PHPUIMessages; import org.eclipse.php.internal.ui.preferences.TodoTaskConfigurationBlock.TodoTask; import org.eclipse.php.internal.ui.util.StatusInfo; import org.eclipse.php.internal.ui.wizards.fields.*; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; /** * Dialog to enter a na new task tag */ public class TodoTaskInputDialog extends StatusDialog { private class CompilerTodoTaskInputAdapter implements IDialogFieldListener { @Override public void dialogFieldChanged(DialogField field) { doValidation(); } } private StringDialogField fNameDialogField; private ComboDialogField fPriorityDialogField; private List<String> fExistingNames; public TodoTaskInputDialog(Shell parent, TodoTask task, List<?> existingEntries) { super(parent); fExistingNames = new ArrayList<>(existingEntries.size()); for (int i = 0; i < existingEntries.size(); i++) { TodoTask curr = (TodoTask) existingEntries.get(i); if (!curr.equals(task)) { fExistingNames.add(curr.name); } } if (task == null) { setTitle(PHPUIMessages.TodoTaskInputDialog_new_title); } else { setTitle(PHPUIMessages.TodoTaskInputDialog_edit_title); } CompilerTodoTaskInputAdapter adapter = new CompilerTodoTaskInputAdapter(); fNameDialogField = new StringDialogField(); fNameDialogField.setLabelText(PHPUIMessages.TodoTaskInputDialog_name_label); fNameDialogField.setDialogFieldListener(adapter); fNameDialogField.setText((task != null) ? task.name : ""); //$NON-NLS-1$ String[] items = new String[] { PHPUIMessages.TodoTaskInputDialog_priority_high, PHPUIMessages.TodoTaskInputDialog_priority_normal, PHPUIMessages.TodoTaskInputDialog_priority_low }; fPriorityDialogField = new ComboDialogField(SWT.READ_ONLY); fPriorityDialogField.setLabelText(PHPUIMessages.TodoTaskInputDialog_priority_label); fPriorityDialogField.setItems(items); if (task != null) { if (PHPCoreConstants.TASK_PRIORITY_HIGH.equals(task.priority)) { fPriorityDialogField.selectItem(0); } else if (PHPCoreConstants.TASK_PRIORITY_NORMAL.equals(task.priority)) { fPriorityDialogField.selectItem(1); } else { fPriorityDialogField.selectItem(2); } } else { fPriorityDialogField.selectItem(1); } } public TodoTask getResult() { TodoTask task = new TodoTask(); task.name = fNameDialogField.getText().trim(); switch (fPriorityDialogField.getSelectionIndex()) { case 0: task.priority = PHPCoreConstants.TASK_PRIORITY_HIGH; break; case 1: task.priority = PHPCoreConstants.TASK_PRIORITY_NORMAL; break; default: task.priority = PHPCoreConstants.TASK_PRIORITY_LOW; break; } return task; } @Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); Composite inner = new Composite(composite, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; layout.numColumns = 2; inner.setLayout(layout); fNameDialogField.doFillIntoGrid(inner, 2); fPriorityDialogField.doFillIntoGrid(inner, 2); LayoutUtil.setHorizontalGrabbing(fNameDialogField.getTextControl(null)); LayoutUtil.setWidthHint(fNameDialogField.getTextControl(null), convertWidthInCharsToPixels(45)); fNameDialogField.postSetFocusOnDialogField(parent.getDisplay()); applyDialogFont(composite); return composite; } private void doValidation() { StatusInfo status = new StatusInfo(); String newText = fNameDialogField.getText(); if (newText.length() == 0) { status.setError(PHPUIMessages.TodoTaskInputDialog_error_enterName); } else { if (newText.indexOf(',') != -1) { status.setError(PHPUIMessages.TodoTaskInputDialog_error_comma); } else if (fExistingNames.contains(newText)) { status.setError(PHPUIMessages.TodoTaskInputDialog_error_entryExists); } else if (Character.isWhitespace(newText.charAt(0)) || Character.isWhitespace(newText.charAt(newText.length() - 1))) { status.setError(PHPUIMessages.TodoTaskInputDialog_error_noSpace); } } updateStatus(status); } /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); // TODO - Add the Help contex id // PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, // IPHPHelpContextIds.TODO_TASK_INPUT_DIALOG); } }
{ "pile_set_name": "Github" }
'use strict'; // B.2.3.8 String.prototype.fontsize(size) require('./_string-html')('fontsize', function(createHTML){ return function fontsize(size){ return createHTML(this, 'font', 'size', size); } });
{ "pile_set_name": "Github" }
#include <cmath> #include <iostream> #include <limits> #include <cstdio> #include <cassert> #include "chisquare.h" using namespace chisq; /* taken from numerical recipis 2007 third edition modified by thorfinn@binf.ku.dk 30 aug 2013 ppl on the internet complain that numerecial recp can't be used in academic gnu software, will need to check that and use a different impl. */ const double Gauleg18::y[18] = {0.0021695375159141994, 0.011413521097787704,0.027972308950302116,0.051727015600492421, 0.082502225484340941, 0.12007019910960293,0.16415283300752470, 0.21442376986779355, 0.27051082840644336, 0.33199876341447887, 0.39843234186401943, 0.46931971407375483, 0.54413605556657973, 0.62232745288031077, 0.70331500465597174, 0.78649910768313447, 0.87126389619061517, 0.95698180152629142}; const double Gauleg18::w[18] = {0.0055657196642445571, 0.012915947284065419,0.020181515297735382,0.027298621498568734, 0.034213810770299537,0.040875750923643261,0.047235083490265582, 0.053244713977759692,0.058860144245324798,0.064039797355015485, 0.068745323835736408,0.072941885005653087,0.076598410645870640, 0.079687828912071670,0.082187266704339706,0.084078218979661945, 0.085346685739338721,0.085983275670394821}; double chisq::gammln(const double xx) { int j; double x,tmp,y,ser; static const double cof[14]={57.1562356658629235,-59.5979603554754912, 14.1360979747417471,-0.491913816097620199,.339946499848118887e-4, .465236289270485756e-4,-.983744753048795646e-4,.158088703224912494e-3, -.210264441724104883e-3,.217439618115212643e-3,-.164318106536763890e-3, .844182239838527433e-4,-.261908384015814087e-4,.368991826595316234e-5}; if (xx <= 0) throw("bad arg in gammln"); y=x=xx; tmp = x+5.24218750000000000; tmp = (x+0.5)*log(tmp)-tmp; ser = 0.999999999999997092; for (j=0;j<14;j++) ser += cof[j]/++y; return tmp+log(2.5066282746310005*ser/x); } double Gamma::gammp(const double a, const double x) { if (x < 0.0 || a <= 0.0) throw("bad args in gammp"); if (x == 0.0) return 0.0; else if ((int)a >= ASWITCH) return gammpapprox(a,x,1); else if (x < a+1.0) return gser(a,x); else return 1.0-gcf(a,x); } double Gamma::gammq(const double a, const double x) { if (x < 0.0 || a <= 0.0) throw("bad args in gammq"); if (x == 0.0) return 1.0; else if ((int)a >= ASWITCH) return gammpapprox(a,x,0); else if (x < a+1.0) return 1.0-gser(a,x); else return gcf(a,x); } double Gamma::gser(const double a, const double x) { double sum,del,ap; gln=gammln(a); ap=a; del=sum=1.0/a; for (;;) { ++ap; del *= x/ap; sum += del; if (fabs(del) < fabs(sum)*EPS) { return sum*exp(-x+a*log(x)-gln); } } } double Gamma::gcf(const double a, const double x) { int i; double an,b,c,d,del,h; gln=gammln(a); b=x+1.0-a; c=1.0/FPMIN; d=1.0/b; h=d; for (i=1;;i++) { an = -i*(i-a); b += 2.0; d=an*d+b; if (fabs(d) < FPMIN) d=FPMIN; c=b+an/c; if (fabs(c) < FPMIN) c=FPMIN; d=1.0/d; del=d*c; h *= del; if (fabs(del-1.0) <= EPS) break; } return exp(-x+a*log(x)-gln)*h; } double Gamma::gammpapprox(double a, double x, int psig) { int j; double xu,t,sum,ans; double a1 = a-1.0, lna1 = log(a1), sqrta1 = sqrt(a1); gln = gammln(a); if (x > a1) xu = std::max(a1 + 11.5*sqrta1, x + 6.0*sqrta1); else xu = std::max(0.,std::min(a1 - 7.5*sqrta1, x - 5.0*sqrta1)); sum = 0; for (j=0;j<ngau;j++) { t = x + (xu-x)*y[j]; sum += w[j]*exp(-(t-a1)+a1*(log(t)-lna1)); } ans = sum*(xu-x)*exp(a1*(lna1-1.)-gln); return (psig?(ans>0.0? 1.0-ans:-ans):(ans>=0.0? ans:1.0+ans)); } double Gamma::invgammp(double p, double a) { int j; double x,err,t,u,pp,lna1,afac,a1=a-1; const double EPS=1.e-8; gln=gammln(a); if (a <= 0.) throw("a must be pos in invgammap"); if (p >= 1.) return std::max(100.,a + 100.*sqrt(a)); if (p <= 0.) return 0.0; if (a > 1.) { lna1=log(a1); afac = exp(a1*(lna1-1.)-gln); pp = (p < 0.5)? p : 1. - p; t = sqrt(-2.*log(pp)); x = (2.30753+t*0.27061)/(1.+t*(0.99229+t*0.04481)) - t; if (p < 0.5) x = -x; x = std::
{ "pile_set_name": "Github" }
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <meta name=ProgId content=Excel.Sheet> <meta name=Generator content="Microsoft Excel 14"> <link rel=File-List href="LTDetectSimilarity_files/filelist.xml"> <!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} x\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--> <style id="16550224 16ii32_978_Styles"> <!--table {mso-displayed-decimal-separator:"\."; mso-displayed-thousand-separator:"\,";} .xl6325262 {padding:0px; mso-ignore:padding; color:windowtext; font-size:10.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Arial, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:middle; border-top:none; border-right:.5pt solid black; border-bottom:none; border-left:none; background:#D9D9D9; mso-pattern:#D9D9D9 none; white-space:nowrap;} .xl6425262 {padding:0px; mso-ignore:padding; color:windowtext; font-size:10.0pt; font-weight:700; font-style:normal; text-decoration:none; font-family:Arial, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:normal;} .xl6525262 {padding:0px; mso-ignore:padding; color:windowtext; font-size:10.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Arial, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} .xl6625262 {padding:0px; mso-ignore:padding; color:windowtext; font-size:10.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Arial, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; border-top:none; border-right:.5pt solid black; border-bottom:none; border-left:none; background:#D9D9D9; mso-pattern:#D9D9D9 none; white-space:nowrap;} .xl6725262 {padding:0px; mso-ignore:padding; color:windowtext; font-size:10.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Arial, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:normal;} .xl6825262 {padding:0px; mso-ignore:padding; color:windowtext; font-size:10.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Arial, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:left; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:normal;} .xl6925262 {padding:0px; mso-ignore:padding; color:#006100; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; background:#C6EFCE; mso-pattern:black none; white-space:nowrap;} .xl7025262 {padding:0px; mso-ignore:padding; color:black; font-size:10.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Arial, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; background:white; mso-pattern:white none; white-space:nowrap;} .xl7125262 {padding:0px; mso-ignore:padding; color:#9C0006; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; background:#FFC7CE; mso-pattern:black none; white-space:nowrap;} .xl7225262 {padding:0px; mso-ignore:padding; color:windowtext; font-size:10.0pt; font-weight:700; font-style:normal; text-decoration:none; font-family:Arial, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:middle; border-top:none; border-right:.5pt solid black; border-bottom:none; border-left:none; background:#D9D9D9; mso-pattern:#D9D9D9 none; white-space:nowrap;} .xl7325262 {padding:0px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Arial, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} .xl7425262 {padding:0px; mso-ignore:padding; color:windowtext; font-size:10.0pt; font-weight:700; font-style:
{ "pile_set_name": "Github" }
require('../../modules/es7.math.degrees'); module.exports = require('../../modules/_core').Math.degrees;
{ "pile_set_name": "Github" }
Imports System.Web.Http Imports System.Web.Mvc Namespace Areas.HelpPage Public Class HelpPageAreaRegistration Inherits AreaRegistration Public Overrides ReadOnly Property AreaName As String Get Return "HelpPage" End Get End Property Public Overrides Sub RegisterArea(context As AreaRegistrationContext) context.MapRoute( "HelpPage_Default", "Help/{action}/{apiId}", New With {.Controller = "Help", .action = "Index", .apiId = UrlParameter.Optional}) HelpPageConfig.Register(GlobalConfiguration.Configuration) End Sub End Class End Namespace
{ "pile_set_name": "Github" }
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Example - example-example72-jquery</title> <script src="../../components/jquery-2.1.1/jquery.js"></script> <script src="../../../angular.js"></script> </head> <body ng-app=""> <button ng-mouseleave="count = count + 1" ng-init="count=0"> Increment (when mouse leaves) </button> count: {{count}} </body> </html>
{ "pile_set_name": "Github" }
config BR2_PACKAGE_LUA_STDLIB bool "lua-stdlib" help lua-stdlib is a library of modules for common programming tasks, including list, table and functional operations, objects, pickling, pretty-printing and command-line option parsing. https://github.com/lua-stdlib/lua-stdlib/
{ "pile_set_name": "Github" }
package balancer import ( "time" balancerpb "github.com/bsm/grpclb/grpclb_balancer_v1" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("service", func() { var subject *service BeforeEach(func() { var err error subject, err = newService("svcname", mockDiscovery{backendA.Address(), backendB.Address()}, time.Minute, time.Minute, 0) Expect(err).NotTo(HaveOccurred()) }) AfterEach(func() { subject.Close() }) It("should report servers", func() { Expect(subject.Servers()).To(ConsistOf([]*balancerpb.Server{ {Address: backendA.Address(), Score: 10}, {Address: backendB.Address(), Score: 40}, })) }) It("should update backends", func() { subject.discovery = mockDiscovery{backendA.Address()} Expect(subject.updateBackends()).To(Succeed()) Expect(subject.Servers()).To(ConsistOf([]*balancerpb.Server{ {Address: backendA.Address(), Score: 10}, })) }) })
{ "pile_set_name": "Github" }
{ "sdivNonConst" : { "_info" : { "comment" : "", "filledwith" : "testeth 1.6.0-alpha.0-11+commit.978e68d2", "lllcversion" : "Version: 0.5.0-develop.2018.11.9+commit.9709dfe0.Linux.g++", "source" : "src/GeneralStateTestsFiller/stArgsZeroOneBalance/sdivNonConstFiller.yml", "sourceHash" : "9bf508a872caa433975eb96e6692189d99753fc04232c5ef1d61096c79a4d72e" }, "env" : { "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", "currentDifficulty" : "0x20000", "currentGasLimit" : "0x0f4240", "currentNumber" : "0x01", "currentTimestamp" : "0x03e8", "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" }, "post" : { "Byzantium" : [ { "hash" : "0xae93f4e1f68a7b2e5c797d9344e6d1adec81f2b39a9a6a0584f3885ef943b49d", "indexes" : { "data" : 0, "gas" : 0, "value" : 0 }, "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, { "hash" : "0x33c8d0a962e33c4f0157541c3f4ace2c46d363fcf24ff0a40dece2cb340a9eba", "indexes" : { "data" : 0, "gas" : 0, "value" : 1 }, "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], "Constantinople" : [ { "hash" : "0xce503e8585fd9fb3bdbd06f3e35b5f6ae31805aa8a4d0fa031b2675c77ba27a5", "indexes" : { "data" : 0, "gas" : 0, "value" : 0 }, "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, { "hash" : "0x33c8d0a962e33c4f0157541c3f4ace2c46d363fcf24ff0a40dece2cb340a9eba", "indexes" : { "data" : 0, "gas" : 0, "value" : 1 }, "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], "ConstantinopleFix" : [ { "hash" : "0xae93f4e1f68a7b2e5c797d9344e6d1adec81f2b39a9a6a0584f3885ef943b49d", "indexes" : { "data" : 0, "gas" : 0, "value" : 0 }, "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, { "hash" : "0x33c8d0a962e33c4f0157541c3f4ace2c46d363fcf24ff0a40dece2cb340a9eba", "indexes" : { "data" : 0, "gas" : 0, "value" : 1 }, "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ] }, "pre" : { "0x095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "0x00", "code" : "0x73095e7baea6a6c7c4c2dfeb977efac326af552d873173095e7baea6a6c7c4c2dfeb977efac326af552d873105600055", "nonce" : "0x00", "storage" : { } }, "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "0x0de0b6b3a7640000", "code" : "", "nonce" : "0x00", "storage" : { } } }, "transaction" : { "data" : [ "0x" ], "gasLimit" : [ "0x061a80" ], "gasPrice" : "0x01", "nonce" : "0x00", "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "to" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87", "value" : [ "0x00", "0x01" ] } } }
{ "pile_set_name": "Github" }
class AddRolesUsersId < ActiveRecord::Migration[4.2] def self.up sql = 'alter table roles_users add id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT' ActiveRecord::Base.connection.execute(sql) end def self.down remove_column :roles_users, :id end end
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WF.Sample.Business.DataAccess; using System.Data.Entity; namespace WF.Sample.PostgreSql.Implementation { public class EmployeeRepository : IEmployeeRepository { private readonly SampleContext _sampleContext; public EmployeeRepository(SampleContext sampleContext) { _sampleContext = sampleContext; } public bool CheckRole(Guid employeeId, string roleName) { return _sampleContext.EmployeeRoles.Any(r => r.EmployeeId == employeeId && r.Role.Name == roleName); } public List<Business.Model.Employee> GetAll() { return _sampleContext.Employees .Include(x => x.StructDivision) .Include(x => x.EmployeeRoles.Select(er => er.Role)) .ToList().Select(e => Mappings.Mapper.Map<Business.Model.Employee>(e)) .OrderBy(c => c.Name).ToList(); } public IEnumerable<string> GetInRole(string roleName) { return _sampleContext.EmployeeRoles.Where(r => r.Role.Name == roleName).ToList() .Select(r => r.EmployeeId.ToString()).ToList(); } public string GetNameById(Guid id) { string res = "Unknown"; var item = _sampleContext.Employees.Find(id); if (item != null) res = item.Name; return res; } } }
{ "pile_set_name": "Github" }
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LBS_IF_USB_H #define _LBS_IF_USB_H #include <linux/wait.h> #include <linux/timer.h> struct lbs_private; /* * This file contains definition for USB interface. */ #define CMD_TYPE_REQUEST 0xF00DFACE #define CMD_TYPE_DATA 0xBEADC0DE #define CMD_TYPE_INDICATION 0xBEEFFACE #define IPFIELD_ALIGN_OFFSET 2 #define BOOT_CMD_FW_BY_USB 0x01 #define BOOT_CMD_FW_IN_EEPROM 0x02 #define BOOT_CMD_UPDATE_BOOT2 0x03 #define BOOT_CMD_UPDATE_FW 0x04 #define BOOT_CMD_MAGIC_NUMBER 0x4C56524D /* LVRM */ struct bootcmd { __le32 magic; uint8_t cmd; uint8_t pad[11]; }; #define BOOT_CMD_RESP_OK 0x0001 #define BOOT_CMD_RESP_FAIL 0x0000 #define BOOT_CMD_RESP_NOT_SUPPORTED 0x0002 struct bootcmdresp { __le32 magic; uint8_t cmd; uint8_t result; uint8_t pad[2]; }; /* USB card description structure*/ struct if_usb_card { struct usb_device *udev; uint32_t model; /* MODEL_* */ struct urb *rx_urb, *tx_urb; struct lbs_private *priv; struct sk_buff *rx_skb; uint8_t ep_in; uint8_t ep_out; /* bootcmdresp == 0 means command is pending * bootcmdresp < 0 means error * bootcmdresp > 0 is a BOOT_CMD_RESP_* from firmware */ int8_t bootcmdresp; int ep_in_size; void *ep_out_buf; int ep_out_size; const struct firmware *fw; struct timer_list fw_timeout; wait_queue_head_t fw_wq; uint32_t fwseqnum; uint32_t totalbytes; uint32_t fwlastblksent; uint8_t CRC_OK; uint8_t fwdnldover; uint8_t fwfinalblk; uint8_t surprise_removed; __le16 boot2_version; }; /* fwheader */ struct fwheader { __le32 dnldcmd; __le32 baseaddr; __le32 datalength; __le32 CRC; }; #define FW_MAX_DATA_BLK_SIZE 600 /* FWData */ struct fwdata { struct fwheader hdr; __le32 seqnum; uint8_t data[0]; }; /* fwsyncheader */ struct fwsyncheader { __le32 cmd; __le32 seqnum; }; #define FW_HAS_DATA_TO_RECV 0x00000001 #define FW_HAS_LAST_BLOCK 0x00000004 #endif
{ "pile_set_name": "Github" }
/* * Copyright 1998-2016 Linux.org.ru * 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 ru.org.linux.site.tags; import com.google.common.collect.Maps; import de.neuland.jade4j.JadeConfiguration; import de.neuland.jade4j.template.JadeTemplate; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; import ru.org.linux.comment.ApiCommentTopicInfo; import ru.org.linux.comment.PreparedComment; import ru.org.linux.topic.Topic; import javax.servlet.jsp.tagext.TagSupport; import java.util.Map; public class CommentTag extends TagSupport { private PreparedComment comment; private boolean enableSchema; private Topic topic; private boolean showMenu; private boolean commentsAllowed; public void setComment(PreparedComment comment) { this.comment = comment; } public void setEnableSchema(boolean enableSchema) { this.enableSchema = enableSchema; } public void setTopic(Topic topic) { this.topic = topic; } public void setShowMenu(boolean showMenu) { this.showMenu = showMenu; } public void setCommentsAllowed(boolean commentsAllowed) { this.commentsAllowed = commentsAllowed; } @Override public int doStartTag() { WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(pageContext.getServletContext()); JadeConfiguration jadeConfiguration = context.getBean(JadeConfiguration.class); JadeTemplate jadeTemplate = context.getBean("TemplateComment", JadeTemplate.class); Map<String, Object> data = Maps.newHashMap(); data.put("comment", comment); data.put("enableSchema", enableSchema); data.put("topic", new ApiCommentTopicInfo( topic.getId(), topic.getLink(), commentsAllowed )); data.put("showMenu", showMenu); // TODO: move to globals data.put("dateFormat", new SignTag.DateFormatHandler()); jadeConfiguration.renderTemplate(jadeTemplate, data, pageContext.getOut()); /* ObjectMapper mapper = new ObjectMapper(); try { pageContext.getOut().append(mapper.writer().writeValueAsString(data.get("user"))); } catch (Exception e) { e.printStackTrace(); // throw new RuntimeException(e); } */ return SKIP_BODY; } }
{ "pile_set_name": "Github" }