text
stringlengths 2
99.9k
| meta
dict |
---|---|
//---------------------------------------------------------------------------//
// Copyright (c) 2013 Kyle Lutz <[email protected]>
//
// 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,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1128',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1128',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1128',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1128',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1128',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1134',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1140',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1148',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1150',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1158',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1168',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1172',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1176',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1178',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1181',2,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1182',2,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1188',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1195',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1197',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1203',1,'2004-05-30',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-03-31',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-04-11',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-04-12',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-04-15',5,5,0);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-04-20',10,0,0);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-04-23',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-04-24',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-05-03',11,0,0);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-05-05',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-05-06',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-05-17',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-05-18',2,2,2);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-05-29',1,1,1);
insert into FLIGHTAVAILABILITY values ('AA1207',1,'2004-05-30',2,2,2);
| {
"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" h="104.3" name="Google Cloud Platform" strokewidth="inherit" w="118.02">
<connections/>
<foreground>
<fillcolor color="#fbbc05"/>
<path>
<move x="77.01" y="83.43"/>
<line x="65.01" y="104.29"/>
<line x="33.59" y="104.29"/>
<arc large-arc-flag="0" rx="7.82" ry="7.82" sweep-flag="1" x="26.8" x-axis-rotation="0" y="100.36"/>
<line x="1.38" y="56.04"/>
<arc large-arc-flag="0" rx="7.83" ry="7.83" sweep-flag="1" x="1.38" x-axis-rotation="0" y="48.26"/>
<line x="11.05" y="31.4"/>
<line x="22.99" y="52.15"/>
<line x="40.99" y="83.43"/>
<close/>
</path>
<fill/>
<fillcolor color="#ea4335"/>
<path>
<move x="116.63" y="56.04"/>
<line x="91.21" y="100.37"/>
<arc large-arc-flag="0" rx="7.82" ry="7.82" sweep-flag="1" x="84.43" x-axis-rotation="0" y="104.3"/>
<line x="65.01" y="104.3"/>
<line x="77.01" y="83.44"/>
<line x="95.02" y="52.15"/>
<line x="77.01" y="20.86"/>
<line x="100.91" y="20.86"/>
<line x="116.63" y="48.26"/>
<arc large-arc-flag="0" rx="7.78" ry="7.78" sweep-flag="1" x="116.63" x-axis-rotation="0" y="56.04"/>
<close/>
</path>
<fill/>
<fillcolor color="#4285f4"/>
<path>
<move x="100.92" y="20.86"/>
<line x="40.99" y="20.86"/>
<line x="22.99" y="52.15"/>
<line x="11.05" y="31.39"/>
<line x="26.8" y="3.93"/>
<arc large-arc-flag="0" rx="7.82" ry="7.82" sweep-flag="1" x="33.59" x-axis-rotation="0" y="0"/>
<line x="84.43" y="0"/>
<arc large-arc-flag="0" rx="7.83" ry="7.83" sweep-flag="1" x="91.22" x-axis-rotation="0" y="3.93"/>
<close/>
</path>
<fill/>
<fillcolor color="#e0e0e0"/>
<path>
<move x="77.01" y="20.86"/>
<line x="95.01" y="52.15"/>
<line x="77.01" y="83.43"/>
<line x="41" y="83.43"/>
<line x="22.99" y="52.15"/>
<line x="40.99" y="20.86"/>
<line x="77.01" y="20.86"/>
</path>
<fill/>
<fillcolor color="#fff"/>
<ellipse h="31.3" w="31.3" x="43.36" y="36.5"/>
<fillstroke/>
<alpha alpha="0.2"/>
<path>
<move x="26.8" y="4.58"/>
<arc large-arc-flag="0" rx="7.82" ry="7.82" sweep-flag="1" x="33.59" x-axis-rotation="0" y="0.65"/>
<line x="84.43" y="0.65"/>
<arc large-arc-flag="0" rx="7.83" ry="7.83" sweep-flag="1" x="91.22" x-axis-rotation="0" y="4.58"/>
<line x="100.55" y="20.86"/>
<line x="100.93" y="20.86"/>
<line x="91.22" y="3.93"/>
<arc large-arc-flag="0" rx="7.82" ry="7.82" sweep-flag="0" x="84.43" x-axis-rotation="0" y="0"/>
<line x="33.59" y="0"/>
<arc large-arc-flag="0" rx="7.82" ry="7.82" sweep-flag="0" x="26.8" x-axis-rotation="0" y="3.93"/>
<line x="11.05" y="31.39"/>
<line x="11.24" y="31.72"/>
<close/>
</path>
<fill/>
<fillcolor color="#1a237e"/>
<path>
<move x="22.99" y="52.15"/>
<line x="40.99" y="20.86"/>
<line x="100.92" y="20.86"/>
<line x="100.55" y="20.21"/>
<line x="40.99" y="20.21"/>
<line x="22.99" y="51.49"/>
</path>
<fill/>
<fillcolor color="#fff"/>
<path>
<move x="1.38" y="48.91"/>
<line x="11.05" y="32.04"/>
<line x="22.99" y="52.79"/>
<line x="40.99" y="84.08"/>
<line x="76.63" y="84.08"/>
<line x="77.01" y="83.43"/>
<line x="40.99" y="83.43"/>
<line x="22.99" y="52.15"/>
<line x="11.05" y="31.39"/>
<line x="1.38" y="48.25"/>
<arc large-arc-flag="0" rx="7.87" ry="7.87" sweep-flag="0" x="0.36" x-axis-rotation="0" y="52.47"/>
<arc large-arc-flag="0" rx="7.85" ry="7.85" sweep-flag="1" x="1.38" x-axis-rotation="0" y="48.91"/>
<close/>
</path>
<fill/>
<fillcolor color="#bf360c"/>
<path>
<move x="65.39" y="103.64"/>
<line x="33.59" y="103.64"/>
<arc large-arc-flag="0" rx="7.82" ry="7.82" sweep-flag="1" x="26.8" x-axis-rotation="0" y="99.71"/>
<line x="1.38" y="55.39"/>
<arc large-arc-flag="0" rx="7.85" ry="7.85" sweep-flag="1" x="0.36" x-axis-rotation="0" y="51.82"/>
<arc large-arc-flag="0" rx="7.77" ry="7.77" sweep-flag="0" x="1.38" x-axis-rotation="0" y="56.04"/>
<line x="26.8" y="100.37"/>
<arc large-arc-flag="0" rx="7.82" ry="7.82" sweep-flag="0" x="33.59" x-axis-rotation="0" y="104.3"/>
<line x="65.01" y="104.3"/>
<close/>
</path>
<fill/>
<fillcolor color="#3e2723"/>
<path>
<move x="95.39" y="52.15"/>
<line x="77.39" y="20.86"/>
<line x="77.01" y="20.86"/>
<line x="95.02" y="52.15"/>
<line x="95.39" y="52.15"/>
<close/>
</path>
<fill/>
<path>
<move x="116.63" y="55.39"/>
<line x="91.21" y="99.71"/>
<arc large-arc-flag="0" rx="7.82" ry="7.82" sweep-flag="1" x="84.43" x-axis-rotation="0" y="103.65"/>
<line x="65.39" y="103.65"/>
<line x="65.01" y="104.3"/>
<line x="84.43" y="104.3"/>
<arc large-arc-flag="0" rx="7.83" ry="7.83" sweep-flag="0" x="91.21" x-axis-rotation="0" y="100.37"/>
<line x="116.63" y="56.04"/>
<arc large-arc-flag="0" rx="7.83" ry="7.83" sweep-flag="0" x="117.65" x-axis-rotation="0" y="51.82"/>
<arc large-arc-flag="0" rx="7.85" ry="7.85" sweep-flag="1" x="116.63" x-axis-rotation="0" y="55.39"/>
<close/>
</path>
<fill/>
<fillcolor color="#fff"/>
<path>
<move x="100.92" y="21.51"/>
<line x="116.63" y="48.91"/>
<arc large-arc-flag="0" rx="7.85" ry="7.85" sweep-flag="1" x="117.65" x-axis-rotation="0" y="52.47"/>
<arc large-arc-flag="0" rx="7.77" ry="7.77" sweep-flag="0" x="116.63" x-axis-rotation="0" y="48.25"/>
<line x="100.92" y="20.85"/>
<line x="77.01" y="20.85"/>
<line x="77.39" y="21.51"/>
</path>
<fill/>
<path>
<move x="77.01" y="84.09"/>
<line x="95.39" y="52.15"/>
<line x="95.02" y="52.15"/>
<line x="77.01" y="83.43"/>
<line x="65.01" y="104.29"/>
<line x="65.39" y="104.29"/>
<line x="77.01" y="84.09"/>
<close/>
</path>
<fill/>
</foreground>
</shape>
<shape aspect="variable" h="25.07" name="Google Cloud Platform lockup" strokewidth="inherit" w="230.16">
<connections/>
<foreground>
<path>
<move x="35.79" y="12.11"/>
<arc large-arc-flag="0" rx="8.31" ry="8.31" sweep-flag="1" x="44.14" x-axis-rotation="0" y="3.92"/>
<arc large-arc-flag="0" rx="7.81" ry="7.81" sweep-flag="1" x="49.76" x-axis-rotation="0" y="6.18"/>
<line x="48.14" y="7.75"/>
<arc large-arc-flag="0" rx="5.71" ry="5.71" sweep-flag="0" x="44.14" x-axis-rotation="0" y="6.15"/>
<arc large-arc-flag="0" rx="5.88" ry="5.88" sweep-flag="0" x="38.26" x-axis-rotation="0" y="12.15"/>
<arc large-arc-flag="0" rx="5.88" ry="5.88" sweep-flag="0" x="44.14" x-axis-rotation="0" y="18.15"/>
<arc large-arc-flag="0" rx="5.48" ry="5.48" sweep-flag="0" x="48.28" x-axis-rotation="0" y="16.51"/>
<arc large-arc-flag="0" rx="4.67" ry="4.67" sweep-flag="0" x="49.5" x-axis-rotation="0" y="13.69"/>
<line x="44.14" y="13.69"/>
<line x="44.14" y="11.37"/>
<line x="51.64" y="11.37"/>
<arc large-arc-flag="0" rx="7.29" ry="7.29" sweep-flag="1" x="51.76" x-axis-rotation="0" y="12.77"/>
<arc large-arc-flag="0" rx="7.4" ry="7.4" sweep-flag="1" x="49.82" x-axis-rotation="0" y="18.01"/>
<arc large-arc-flag="0" rx="7.49" ry="7.49" sweep-flag="1" x="44.14" x-axis-rotation="0" y="20.31"/>
<arc large-arc-flag="0" rx="8.31" ry="8.31" sweep-flag="1" x="35.79" x-axis-rotation="0" y="12.11"/>
<close/>
<move x="57.85" y="9.75"/>
<arc large-arc-flag="1" rx="5.28" ry="5.28" sweep-flag="0" x="63.14" x-axis-rotation="0" y="15.03"/>
<arc large-arc-flag="0" rx="5.2" ry="5.2" sweep-flag="0" x="57.85" x-axis-rotation="0" y="9.75"/>
<close/>
<move x="57.85" y="18.22"/>
<arc large-arc-flag="0" rx="3.05" ry="3.05" sweep-flag="1" x="54.85" x-axis-rotation="0" y="15.02"/>
<arc large-arc-flag="1" rx="3" ry="3" sweep-flag="1" x="60.85" x-axis-rotation="0" y="15.02"/>
<arc large-arc-flag="0" rx="3.05" ry="3.05" sweep-flag="1" x="57.85" x-axis-rotation="0" y="18.23"/>
<close/>
<move x="69.41" y="9.75"/>
<arc large-arc-flag="1" rx="5.28" ry="5.28" sweep-flag="0" x="74.71" x-axis-rotation="0" y="15.03"/>
<arc large-arc-flag="0" rx="5.2" ry="5.2" sweep-flag="0" x="69.41" x-axis-rotation="0" y="9.75"/>
<close/>
<move x="69.41" y="18.22"/>
<arc large-arc-flag="0" rx="3.05" ry="3.05" sweep-flag="1" x="66.41" x-axis-rotation="0" y="15.02"/>
<arc large-arc-flag="1" rx="3" ry="3" sweep-flag="1" x="72.41" x-axis-rotation="0" y="15.02"/>
<arc large-arc-flag="0" rx="3.05" ry="3.05" sweep-flag="1" x="69.41" x-axis-rotation="0" y="18.23"/>
<close/>
<move x="83.59" y="10.07"/>
<line x="83.59" y="10.93"/>
<line x="83.51" y="10.93"/>
<arc large-arc-flag="0" rx="3.66" ry="3.66" sweep-flag="0" x="80.73" x-axis-rotation="0" y="9.75"/>
<arc large-arc-flag="0" rx="5.28" ry="5.28" sweep-flag="0" x="80.73" x-axis-rotation="0" y="20.3"/>
<arc large-arc-flag="0" rx="3.6" ry="3.6" sweep-flag="0" x="83.51" x-axis-rotation="0" y="19.1"/>
<line x="83.59" y="19.1"/>
<line x="83.59" y="19.86"/>
<curve x1="83.59" x2="82.51" x3="80.77" y1="21.86" y2="22.96" y3="22.96"/>
<arc large-arc-flag="0" rx="2.92" ry="2.92" sweep-flag="1" x="78.14" x-axis-rotation="0" y="21.09"/>
<line x="76.14" y="21.93"/>
<arc large-arc-flag="0" rx="5" ry="5" sweep-flag="0" x="80.82" x-axis-rotation="0" y="25.05"/>
<curve x1="83.54" x2="85.82" x3="85.82" y1="25.05" y2="23.45" y3="19.55"/>
<line x="85.82" y="10.07"/>
<line x="83.62" y="10.07"/>
<close/>
<move x="80.93" y="18.23"/>
<arc large-arc-flag="0" rx="3" ry="3" sweep-flag="1" x="77.99" x-axis-rotation="0" y="15.05"/>
<arc large-arc-flag="0" rx="3.05" ry="3.05" sweep-flag="1" x="80.93" x-axis-rotation="0" y="11.83"/>
<arc large-arc-flag="0" rx="3" ry="3" sweep-flag="1" x="83.75" x-axis-rotation="0" y="15.05"/>
<arc large-arc-flag="0" rx="3" ry="3" sweep-flag="1" x="80.93" x-axis-rotation="0" y="18.23"/>
<close/>
<move x="96.06" y="18.23"/>
<arc large-arc-flag="0" rx="2.68" ry="2.68" sweep-flag="1" x="93.5" x-axis-rotation="0" y="16.63"/>
<line x="100.56" y="13.71"/>
<line x="100.32" y="13.11"/>
<arc large-arc-flag="0" rx="4.9" ry="4.9" sweep-flag="0" x="95.8" x-axis-rotation="0" y="9.75"/>
<arc large-arc-flag="0" rx="5" ry="5" sweep-flag="0" x="90.8" x-axis-rotation="0" y="15.03"/>
<arc large-arc-flag="0" rx="5.16" ry="5.16" sweep-flag="0" x="96.04" x-axis-rotation="0" y="20.31"/>
<arc large-arc-flag="0" rx="5.25" ry="5.25" sweep-flag="0" x="100.44" x-axis-rotation="0" y="17.97"/>
<line x="98.64" y="16.77"/>
<arc large-arc-flag="0" rx="3" ry="3" sweep-flag="1" x="96.06" x-axis-rotation="0" y="18.23"/>
<close/>
<move x="95.88" y="11.79"/>
<arc large-arc-flag="0" rx="2" ry="2" sweep-flag="1" x="97.88" x-axis-rotation="0" y="12.91"/>
<line x="93.16" y="14.91"/>
<arc large-arc-flag="0" rx="2.89" ry="2.89" sweep-flag="1" x="95.88" x-axis-rotation="0" y="11.79"/>
<close/>
<move x="105.14" y="12.83"/>
<arc large-arc-flag="0" rx="7.31" ry="7.31" sweep-flag="1" x="112.58" x-axis-rotation="0" y="5.35"/>
<arc large-arc-flag="0" rx="6.77" ry="6.77" sweep-flag="1" x="117.84" x-axis-rotation="0" y="7.69"/>
<line x="116.56" y="8.93"/>
<arc large-arc-flag="0" rx="4.84" ry="4.84" sweep-flag="0" x="112.56" x-axis-rotation="0" y="7.11"/>
<arc large-arc-flag="0" rx="5.45" ry="5.45" sweep-flag="0" x="107" x-axis-rotation="0" y="12.83"/>
<arc large-arc-flag="0" rx="5.45" ry="5.45" sweep-flag="0" x="112.54" x-axis-rotation="0" y="18.5"/>
<arc large-arc-flag="0" rx="5.79" ry="5.79" sweep-flag="0" x="116.94" x-axis-rotation="0" y="16.5"/>
<line x="118.22" y="17.78"/>
<arc large-arc-flag="0" rx="7.48" ry="7.48" sweep-flag="1" x="105.14" x-axis-rotation="0" y="12.83"/>
<close/>
<move x="119.66" y="19.99"/>
<line x="119.66" y="5.67"/>
<line x="121.5" y="5.67"/>
<line x="121.5" y="19.99"/>
<line x="119.66" y="19.99"/>
<close/>
<move x="132.95" y="15.09"/>
<arc large-arc-flag="1" rx="5" ry="5" sweep-flag="1" x="122.88" x-axis-rotation="0" y="15.09"/>
<arc large-arc-flag="1" rx="5" ry="5" sweep-flag="1" x="132.95" x-axis-rotation="0" y="15.09"/>
<close/>
<move x="131.11" y="15.09"/>
<arc large-arc-flag="1" rx="3.21" ry="3.21" sweep-flag="0" x="124.71" x-axis-rotation="0" y="15.09"/>
<arc large-arc-flag="1" rx="3.21" ry="3.21" sweep-flag="0" x="131.14" x-axis-rotation="0" y="15.09"/>
<close/>
<move x="141.26" y="19.99"/>
<line x="141.26" y="18.63"/>
<line x="141.14" y="18.63"/>
<arc large-arc-flag="0" rx="3.74" ry="3.74" sweep-flag="1" x="138.04" x-axis-rotation="0" y="20.31"/>
<curve x1="135.52" x2="134.3" x3="134.3" y1="20.31" y2="18.61" y3="16.19"/>
<line x="134.3" y="10.19"/>
<line x="136.14" y="10.19"/>
<line x="136.14" y="15.89"/>
<curve x1="136.14" x2="137.14" x3="138.56" y1="17.89" y2="18.63" y3="18.63"/>
<arc large-arc-flag="0" rx="2.83" ry="2.83" sweep-flag="0" x="141.14" x-axis-rotation="0" y="15.63"/>
<line x="141.14" y="10.23"/>
<line x="142.98" y="10.23"/>
<line x="142.98" y="20.02"/>
<line x="141.22" y="20.02"/>
<close/>
<move x="144.5" y="15.09"/>
<arc large-arc-flag="0" rx="5" ry="5" sweep-flag="1" x="149.14" x-axis-rotation="0" y="9.87"/>
<arc large-arc-flag="0" rx="3.92" ry="3.92" sweep-flag="1" x="152.48" x-axis-rotation="0" y="11.55"/>
<line x="152.56" y="11.55"/>
<line x="152.48" y="10.19"/>
<line x="152.48" y="5.67"/>
<line x="154.32" y="5.67"/>
<line x="154.32" y="19.99"/>
<line x="152.56" y="19.99"/>
<line x="152.56" y="18.63"/>
<line x="152.48" y="18.63"/>
<arc large-arc-flag="0" rx="3.92" ry="3.92" sweep-flag="1" x="149.14" x-axis-rotation="0" y="20.31"/>
<arc large-arc-flag="0" rx="5" ry="5" sweep-flag="1" x="144.5" x-axis-rotation="0" y="15.09"/>
<close/>
<move x="152.58" y="15.09"/>
<arc large-arc-flag="1" rx="3.14" ry="3.14" sweep-flag="0" x="146.34" x-axis-rotation="0" y="15.09"/>
<arc large-arc-flag="1" rx="3.14" ry="3.14" sweep-flag="0" x="152.58" x-axis-rotation="0" y="15.09"/>
<close/>
<move x="159.35" y="19.99"/>
<line x="159.35" y="5.67"/>
<line x="164.23" y="5.67"/>
<arc large-arc-flag="0" rx="4.34" ry="4.34" sweep-flag="1" x="168.71" x-axis-rotation="0" y="9.93"/>
<arc large-arc-flag="0" rx="4.34" ry="4.34" sweep-flag="1" x="164.23" x-axis-rotation="0" y="14.19"/>
<line x="161.23" y="14.19"/>
<line x="161.23" y="19.99"/>
<line x="159.39" y="19.99"/>
<close/>
<move x="164.27" y="12.43"/>
<arc large-arc-flag="1" rx="2.5" ry="2.5" sweep-flag="0" x="164.27" x-axis-rotation="0" y="7.43"/>
<line x="161.14" y="7.43"/>
<line x="161.14" y="12.43"/>
<line x="164.22" y="12.43"/>
<close/>
<move x="170" y="19.99"/>
<line x="170" y="5.67"/>
<line x="171.84" y="5.67"/>
<line x="171.84" y="19.99"/>
<line x="170" y="19.99"/>
<close/>
<move x="173.42" y="17.03"/>
<curve x1="173.42" x2="175.42" x3="177.72" y1="14.81" y2="13.61" y3="13.61"/>
<arc large-arc-flag="0" rx="5.63" ry="5.63" sweep-flag="1" x="180.38" x-axis-rotation="0" y="14.21"/>
<line x="180.38" y="13.93"/>
<arc large-arc-flag="0" rx="2.59" ry="2.59" sweep-flag="0" x="175.48" x-axis-rotation="0" y="12.93"/>
<line x="173.8" y="12.21"/>
<arc large-arc-flag="0" rx="4.42" ry="4.42" sweep-flag="1" x="182.14" x-axis-rotation="0" y="14.07"/>
<line x="182.14" y="19.99"/>
<line x="180.38" y="19.99"/>
<line x="180.38" y="18.63"/>
<line x="180.3" y="18.63"/>
<arc large-arc-flag="0" rx="3.69" ry="3.69" sweep-flag="1" x="177.08" x-axis-rotation="0" y="20.31"/>
<arc large-arc-flag="0" rx="3.35" ry="3.35" sweep-flag="1" x="173.42" x-axis-rotation="0" y="17.03"/>
<close/>
<move x="180.42" y="15.77"/>
<arc large-arc-flag="0" rx="3.85" ry="3.85" sweep-flag="0" x="178.08" x-axis-rotation="0" y="15.13"/>
<curve x1="176.14" x2="175.38" x3="175.38" y1="15.13" y2="16.13" y3="17.07"/>
<arc large-arc-flag="0" rx="1.82" ry="1.82" sweep-flag="0" x="177.38" x-axis-rotation="0" y="18.63"/>
<arc large-arc-flag="0" rx="3" ry="3" sweep-flag="0" x="180.38" x-axis-rotation="0" y="15.77"/>
<close/>
<move x="184.79" y="17.01"/>
<line x="184.79" y="11.87"/>
<line x="183.07" y="11.87"/>
<line x="183.07" y="10.19"/>
<line x="184.79" y="10.19"/>
<line x="184.79" y="7.19"/>
<line x="186.63" y="7.19"/>
<line x="186.63" y="10.19"/>
<line x="189.03" y="10.19"/>
<line x="189.03" y="11.87"/>
<line x="186.63" y="11.87"/>
<line x="186.63" y="16.87"/>
<curve x1="186.63" x2="187.09" x3="187.95" y1="17.97" y2="18.47" y3="18.47"/>
<arc large-arc-flag="0" rx="1.85" ry="1.85" sweep-flag="0" x="188.79" x-axis-rotation="0" y="18.31"/>
<line x="189.43" y="19.89"/>
<arc large-arc-flag="0" rx="3.57" ry="3.57" sweep-flag="1" x="187.95" x-axis-rotation="0" y="20.15"/>
<arc large-arc-flag="0" rx="2.84" ry="2.84" sweep-flag="1" x="184.79" x-axis-rotation="0" y="17.01"/>
<close/>
<move x="196.75" y="5.85"/>
<line x="196.14" y="7.43"/>
<arc large-arc-flag="0" rx="1.8" ry="1.8" sweep-flag="0" x="195.3" x-axis-rotation="0" y="7.27"/>
<arc large-arc-flag="0" rx="1.53" ry="1.53" sweep-flag="0" x="193.66" x-axis-rotation="0" y="8.95"/>
<line x="193.66" y="10.19"/>
<line x="196.14" y="10.19"/>
<line x="196.14" y="11.87"/>
<line x="193.58" y="11.87"/>
<line x="193.58" y="19.99"/>
<line x="191.74" y="19.99"/>
<line x="191.74" y="11.87"/>
<line x="189.9" y="11.87"/>
<line x="189.9" y="10.19"/>
<line x="191.74" y="10.19"/>
<line x="191.74" y="8.89"/>
<arc large-arc-flag="0" rx="3.21" ry="3.21" sweep-flag="1" x="195.22" x-axis-rotation="0" y="5.59"/>
<arc large-arc-flag="0" rx="3.57" ry="3.57" sweep-flag="1" x="196.75" x-axis-rotation="0" y="5.85"/>
<close/>
<move x="206.76" y="15.09"/>
<arc large-arc-flag="1" rx="5" ry="5" sweep-flag="1" x="196.69" x-axis-rotation="0" y="15.09"/>
<arc large-arc-flag="1" rx="5" ry="5" sweep-flag="1" x="206.76" x-axis-rotation="0" y="15.09"/>
<close/>
<move x="204.92" y="15.09"/>
<arc large-arc-flag="1" rx="3.21" ry="3.21" sweep-flag="0" x="198.52" x-axis-rotation="0" y="15.09"/>
<arc large-arc-flag="1" rx="3.21" ry="3.21" sweep-flag="0" x="204.92" x-axis-rotation="0" y="15.09"/>
<close/>
<move x="208.24" y="19.99"/>
<line x="208.24" y="10.19"/>
<line x="210" y="10.19"/>
<line x="210" y="11.79"/>
<line x="210.08" y="11.79"/>
<arc large-arc-flag="0" rx="3.23" ry="3.23" sweep-flag="1" x="212.92" x-axis-rotation="0" y="9.95"/>
<arc large-arc-flag="0" rx="3.35" ry="3.35" sweep-flag="1" x="214.3" x-axis-rotation="0" y="10.19"/>
<line x="213.6" y="11.91"/>
<arc large-arc-flag="0" rx="2.75" ry="2.75" sweep-flag="0" x="212.6" x-axis-rotation="0" y="11.77"/>
<arc large-arc-flag="0" rx="2.66" ry="2.66" sweep-flag="0" x="210.06" x-axis-rotation="0" y="14.63"/>
<line x="210.06" y="19.99"/>
<line x="208.24" y="19.99"/>
<close/>
<move x="215.29" y="10.19"/>
<line x="217.05" y="10.19"/>
<line x="217.05" y="11.55"/>
<line x="217.14" y="11.55"/>
<arc large-arc-flag="0" rx="3.78" ry="3.78" sweep-flag="1" x="220.14" x-axis-rotation="0" y="9.87"/>
<arc large-arc-flag="0" rx="3.1" ry="3.1" sweep-flag="1" x="223.24" x-axis-rotation="0" y="11.75"/>
<arc large-arc-flag="0" rx="4" ry="4" sweep-flag="1" x="226.66" x-axis-rotation="0" y="9.87"/>
<curve x1="229.06" x2="230.16" x3="230.16" y1="9.87" y2="11.57" y3="13.99"/>
<line x="230.16" y="19.99"/>
<line x="228.32" y="19.99"/>
<line x="228.32" y="14.27"/>
<curve x1="228.32" x2="227.54" x3="226.14" y1="12.27" y2="11.55" y3="11.55"/>
<curve x1="224.74" x2="223.64" x3="223.64" y1="11.55" y2="13.07" y3="14.55"/>
<line x="223.64" y="19.97"/>
<line x="221.8" y="19.97"/>
<line x="221.8" y="14.27"/>
<curve x1="221.8" x2="221.02" x3="219.62" y1="12.27" y2="11.55" y3="11.55"/>
<curve x1="218.22" x2="217.12" x3="217.12" y1="11.55" y2="13.07" y3="14.55"/>
<line x="217.12" y="19.97"/>
<line x="215.28" y="19.97"/>
<line x="215.28" y="10.19"/>
<close/>
<move x="18.46" y="20"/>
<line x="15.58" y="25"/>
<line x="8.05" y="25"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="6.42" x-axis-rotation="0" y="24.06"/>
<line x="0.33" y="13.43"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="0.33" x-axis-rotation="0" y="11.56"/>
<line x="2.64" y="7.5"/>
<line x="5.5" y="12.5"/>
<line x="9.82" y="20"/>
<line x="18.45" y="20"/>
<close/>
<move x="27.95" y="13.43"/>
<line x="21.86" y="24.06"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="20.23" x-axis-rotation="0" y="25"/>
<line x="15.58" y="25"/>
<line x="18.46" y="20"/>
<line x="22.77" y="12.5"/>
<line x="18.46" y="5"/>
<line x="24.14" y="5"/>
<line x="27.91" y="11.57"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="27.95" x-axis-rotation="0" y="13.43"/>
<close/>
<move x="24.14" y="5"/>
<line x="9.82" y="5"/>
<line x="5.51" y="12.5"/>
<line x="2.64" y="7.5"/>
<line x="6.42" y="0.94"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="8.05" x-axis-rotation="0" y="0"/>
<line x="20.23" y="0"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="21.86" x-axis-rotation="0" y="0.94"/>
<close/>
<move x="18.46" y="5"/>
<line x="22.77" y="12.5"/>
<line x="18.45" y="20"/>
<line x="9.82" y="20"/>
<line x="5.51" y="12.5"/>
<line x="9.83" y="5"/>
<line x="18.46" y="5"/>
</path>
<fillstroke/>
<ellipse h="7.5" w="7.5" x="10.39" y="8.75"/>
<fillstroke/>
<path>
<move x="6.42" y="1.1"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="8.05" x-axis-rotation="0" y="0.16"/>
<line x="20.23" y="0.16"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="21.86" x-axis-rotation="0" y="1.1"/>
<line x="24.14" y="5"/>
<line x="24.14" y="5"/>
<line x="21.86" y="0.94"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="0" x="20.23" x-axis-rotation="0" y="0"/>
<line x="8.05" y="0"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="0" x="6.42" x-axis-rotation="0" y="0.94"/>
<line x="2.64" y="7.5"/>
<line x="2.64" y="7.58"/>
<close/>
<move x="5.51" y="12.5"/>
<line x="9.82" y="5"/>
<line x="24.19" y="5"/>
<line x="24.1" y="4.84"/>
<line x="9.82" y="4.84"/>
<line x="5.51" y="12.34"/>
<move x="0.33" y="11.72"/>
<line x="2.65" y="7.72"/>
<line x="5.51" y="12.72"/>
<line x="9.83" y="20.22"/>
<line x="18.37" y="20.22"/>
<line x="18.46" y="20.06"/>
<line x="9.82" y="20.06"/>
<line x="5.51" y="12.5"/>
<line x="2.64" y="7.5"/>
<line x="0.32" y="11.5"/>
<arc large-arc-flag="0" rx="1.87" ry="1.87" sweep-flag="0" x="0.08" x-axis-rotation="0" y="12.5"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="0.33" x-axis-rotation="0" y="11.72"/>
<close/>
<move x="15.67" y="24.84"/>
<line x="8.05" y="24.84"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="6.42" x-axis-rotation="0" y="23.9"/>
<line x="0.33" y="13.28"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="0.09" x-axis-rotation="0" y="12.43"/>
<arc large-arc-flag="0" rx="1.87" ry="1.87" sweep-flag="0" x="0.33" x-axis-rotation="0" y="13.43"/>
<line x="6.42" y="24.06"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="0" x="8.05" x-axis-rotation="0" y="25"/>
<line x="15.58" y="25"/>
<close/>
<move x="22.86" y="12.5"/>
<line x="18.55" y="5"/>
<line x="18.46" y="5"/>
<line x="22.77" y="12.5"/>
<line x="22.86" y="12.5"/>
<close/>
<move x="27.95" y="13.28"/>
<line x="21.86" y="23.9"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="20.23" x-axis-rotation="0" y="24.84"/>
<line x="15.67" y="24.84"/>
<line x="15.58" y="25"/>
<line x="20.23" y="25"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="0" x="21.86" x-axis-rotation="0" y="24.06"/>
<line x="27.95" y="13.44"/>
<arc large-arc-flag="0" rx="1.87" ry="1.87" sweep-flag="0" x="28.19" x-axis-rotation="0" y="12.44"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="27.95" x-axis-rotation="0" y="13.28"/>
<close/>
<move x="24.14" y="5.16"/>
<line x="27.91" y="11.73"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="1" x="28.15" x-axis-rotation="0" y="12.58"/>
<arc large-arc-flag="0" rx="1.87" ry="1.87" sweep-flag="0" x="27.91" x-axis-rotation="0" y="11.58"/>
<line x="24.14" y="5"/>
<line x="18.46" y="5"/>
<line x="18.55" y="5.16"/>
<move x="18.46" y="20.16"/>
<line x="22.86" y="12.5"/>
<line x="22.77" y="12.5"/>
<line x="18.46" y="20"/>
<line x="15.58" y="25"/>
<line x="15.67" y="25"/>
<line x="18.46" y="20.16"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="27.95" y="11.57"/>
<line x="24.14" y="5"/>
<line x="21.86" y="0.94"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="0" x="20.23" x-axis-rotation="0" y="0"/>
<line x="8.05" y="0"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="0" x="6.42" x-axis-rotation="0" y="0.94"/>
<line x="0.33" y="11.57"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="0" x="0.33" x-axis-rotation="0" y="13.44"/>
<line x="6.42" y="24.06"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="0" x="8.05" x-axis-rotation="0" y="25"/>
<line x="20.23" y="25"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="0" x="21.86" x-axis-rotation="0" y="24.06"/>
<line x="27.95" y="13.44"/>
<arc large-arc-flag="0" rx="1.88" ry="1.88" sweep-flag="0" x="27.95" x-axis-rotation="0" y="11.57"/>
<close/>
</path>
<fillstroke/>
<rect h="15.51" w="2.32" x="87.39" y="4.48"/>
<fillstroke/>
</foreground>
</shape>
<shape aspect="variable" h="113.93" name="Prediction API" strokewidth="inherit" w="129.03">
<connections/>
<foreground>
<save/>
<path>
<move x="28.3" y="108.18"/>
<line x="2.05" y="62.72"/>
<arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="2.05" x-axis-rotation="0" y="51.22"/>
<line x="28.3" y="5.75"/>
<arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="38.26" x-axis-rotation="0" y="0"/>
<line x="90.76" y="0"/>
<arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="100.72" x-axis-rotation="0" y="5.75"/>
<line x="126.97" y="51.22"/>
<arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="126.97" x-axis-rotation="0" y="62.72"/>
<line x="100.72" y="108.18"/>
<arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="90.76" x-axis-rotation="0" y="113.93"/>
<line x="38.26" y="113.93"/>
<arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="1" x="28.3" x-axis-rotation="0" y="108.18"/>
<close/>
</path>
<fillstroke/>
<strokecolor color="none"/>
<fillcolor color="#000000"/>
<alpha alpha="0.07"/>
<path>
<move x="95.13" y="28.29"/>
<line x="70.07" y="70.84"/>
<line x="56.64" y="46.81"/>
<line x="37.96" y="74.53"/>
<line x="77.36" y="113.93"/>
<line x="90.76" y="113.93"/>
<arc large-arc-flag="0" rx="11.5" ry="11.5" sweep-flag="0" x="100.72" x-axis-rotation="0" y="108.18"/>
<line x="126.97" y="62.72"/>
<arc large-arc-flag="0" rx="11.45" ry="11.45" sweep-flag="0" x="127.78" x-axis-rotation="0" y="60.95"/>
<close/>
</path>
<fill/>
<restore/>
<rect/>
<stroke/>
<strokecolor color="none"/>
<fillcolor color="#fff"/>
<path>
<move x="44.16" y="71.32"/>
<line x="40.48" y="69.11"/>
<line x="56.6" y="42.24"/>
<line x="72.08" y="68.37"/>
<line x="68.39" y="70.56"/>
<line x="56.58" y="50.62"/>
<line x="44.16" y="71.32"/>
<close/>
</path>
<fill/>
<ellipse h="12.9" w="12.9" x="63.62" y="62.74"/>
<fill/>
<ellipse h="12.9" w="12.9" x="36.04" y="63.49"/>
<fill/>
<path>
<move x="77.99" y="61.68"/>
<line x="74.29" y="59.51"/>
<line x="77.15" y="54.64"/>
<line x="80.85" y="56.82"/>
<close/>
<move x="83.19" y="52.84"/>
<line x="79.5" y="50.67"/>
<line x="82.36" y="45.8"/>
<line x="86.05" y="47.98"/>
<close/>
<move x="88.4" y="44"/>
<line x="84.7" y="41.83"/>
<line x="87.56" y="36.96"/>
<line x="91.26" y="39.14"/>
<close/>
<move x="95.08" y="41.5"/>
<line x="95.19" y="28.23"/>
<line x="83.65" y="34.77"/>
<line x="95.08" y="41.5"/>
<close/>
</path>
<fill/>
</foreground>
</shape>
</shapes> | {
"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 <[email protected]> 1208054148 -0700
committer Tom Preston-Werner <[email protected]> 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:[email protected]">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 ,或者可以邮箱联系`[email protected]`
- (。・ω・。)ノ♡
| {
"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": "[email protected]",
"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": "[email protected]",
"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": "[email protected]",
"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": "[email protected]",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz"
}
}
},
"qs": {
"version": "2.3.3",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz"
},
"raw-body": {
"version": "1.3.3",
"from": "[email protected]",
"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": "[email protected]",
"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": "[email protected]",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.2.tgz"
},
"cookie-signature": {
"version": "1.0.6",
"from": "[email protected]",
"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": "[email protected]",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.4.7.tgz"
}
}
},
"buffer-crc32": {
"version": "0.2.3",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.3.tgz"
},
"debug": {
"version": "1.0.2",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/debug/-/debug-1.0.2.tgz",
"dependencies": {
"ms": {
"version": "0.6.2",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
}
}
},
"escape-html": {
"version": "1.0.1",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz"
},
"methods": {
"version": "1.0.1",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.0.1.tgz"
},
"parseurl": {
"version": "1.0.1",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.0.1.tgz"
},
"proxy-addr": {
"version": "1.0.1",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.0.1.tgz",
"dependencies": {
"ipaddr.js": {
"version": "0.1.2",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-0.1.2.tgz"
}
}
},
"range-parser": {
"version": "1.0.0",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.0.tgz"
},
"send": {
"version": "0.4.3",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/send/-/send-0.4.3.tgz",
"dependencies": {
"finished": {
"version": "1.2.2",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/finished/-/finished-1.2.2.tgz",
"dependencies": {
"ee-first": {
"version": "1.0.3",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.3.tgz"
}
}
},
"mime": {
"version": "1.2.11",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
}
}
},
"serve-static": {
"version": "1.2.3",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.2.3.tgz"
},
"type-is": {
"version": "1.2.1",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.2.1.tgz",
"dependencies": {
"mime-types": {
"version": "1.0.0",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.0.tgz"
}
}
},
"vary": {
"version": "0.1.0",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/vary/-/vary-0.1.0.tgz"
},
"cookie": {
"version": "0.1.2",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.2.tgz"
},
"fresh": {
"version": "0.2.2",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.2.2.tgz"
},
"cookie-signature": {
"version": "1.0.4",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.4.tgz"
},
"merge-descriptors": {
"version": "0.0.2",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-0.0.2.tgz"
},
"utils-merge": {
"version": "1.0.0",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz"
},
"qs": {
"version": "0.6.6",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz"
},
"path-to-regexp": {
"version": "0.1.2",
"from": "[email protected]",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.2.tgz"
}
}
},
"lodash": {
"version": "3.3.0",
"from": "lodash@",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.3.0.tgz"
}
}
}
| {
"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.
This leads to unnecessary code repetition.
</div>
<div>
Consider the implementation of the <code>is_function<></code> metafunction is Boost.
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.
Because of the special treatment of parameter lists, it is not possible to directly match a function with an arbitrary parameter list.
Instead, the <code>is_function_tester()</code> must be overloaded for every distinct number of parameters that is to be supported.
For example:
</div>
<div class="code"><pre>
template<class R>
yes_type is_function_tester(R (*)());
template<class R, class A0>
yes_type is_function_tester(R (*)(A0));
template<class R, class A0, class A1>
yes_type is_function_tester(R (*)(A0, A1));
template<class R, class A0, class A1, class A2>
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.
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.
Unfortunately, using external code generators has many disadvantages:
<ul>
<li>Writing the generator takes time. (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. (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.
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.
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 <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/repetition.hpp>
#ifndef MAX_IS_FUNCTION_TESTER_PARAMS
#define MAX_IS_FUNCTION_TESTER_PARAMS 15
#endif
#define IS_FUNCTION_TESTER(Z, N, _) \
template<class R BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_PARAMS(N, class A)> \
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.
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$savedPos, peg$currPos - 1]} }
cbv_ordinal
= val_1:cb_ordinal sequence_sep? v_explicit val_2:v
{ return {"type": "bcv", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }
c_psalm
= "\x1f" val:any_integer "/1\x1f"
{ return {"type": "c_psalm", "value": val.value, "indices": [peg$savedPos, peg$currPos - 1]} }
cv_psalm
= val_1:c_psalm sequence_sep? v_explicit val_2:v
{ return {"type": "cv_psalm", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }
c_title
= c_explicit val_1:c val_2:title
{ return {"type": "c_title", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }
cv
= v_explicit? val_1:c !("." v_explicit v) (cv_sep? v_explicit / cv_sep) val_2:(v_letter / v)
{ return {"type": "cv", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }
cv_weak
= val_1:c cv_sep_weak val_2:(v_letter / v) !(cv_sep v)
{ return {"type": "cv", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }
c
= c_explicit? val:integer
{ return {"type": "c", "value": [val], "indices": [peg$savedPos, peg$currPos - 1]} }
// No `b` or `ps151`.
ff
= val_1:(bcv / bcv_weak / bc / bv / cv / cv_weak / integer / c / v) sp "kk" abbrev? ![a-z]
{ return {"type": "ff", "value": [val_1], "indices": [peg$savedPos, peg$currPos - 1]} }
integer_title
= val_1:integer val_2:title
{ return {"type": "integer_title", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }
context
= "\x1f" val:any_integer "/9\x1f"
{ return {"type": "context", "value": val.value, "indices": [peg$savedPos, peg$currPos - 1]} }
// The `ps151` rules should round-trip `Ps151.1` and `Ps151.1.\d+` OSIS references. Without these rules, `Ps151` gets interpreted as a `bc`, throwing off future verses.
ps151_b
= "\x1f" val:any_integer "/2\x1f"
{ return {"type": "b", "value": val.value, "indices": [peg$savedPos, peg$currPos - 1]} }
ps151_bc
= val:ps151_b ".1" ![0-9]
{ return {"type": "bc", "value": [val, {"type": "c", "value": [{"type": "integer", "value": 151, "indices": [peg$currPos - 2, peg$currPos - 1]}], "indices": [peg$currPos - 2, peg$currPos - 1]}], "indices": [peg$savedPos, peg$currPos - 1]} }
ps151_bcv
= val_1:ps151_bc "." val_2:integer
{ return {"type": "bcv", "value": [val_1, {"type": "v", "value": [val_2], "indices": [val_2.indices[0], val_2.indices[1]]}], "indices": [peg$savedPos, peg$currPos - 1]} }
v_letter
= v_explicit? val:integer sp !( "kk" ) [a-e] ![a-z]
{ return {"type": "v", "value": [val], "indices": [peg$savedPos, peg$currPos - 1]} }
v
= v_explicit? val:integer
{ return {"type": "v", "value": [val], "indices": [peg$savedPos, peg$currPos - 1]} }
/* BCV helpers */
c_explicit
= sp ( "fej" ( "ezet" [ée]i "ben" / "ezet" / abbrev? ) ) sp
{ return {"type": "c_explicit"} }
v_explicit
= sp ( "vers" ( "ekre" / "ek" / abbrev? ) ) ![a-z] sp
{ return {"type": "v_explicit"} }
cv_sep
= sp (":"+ / "." !(sp "." sp ".") ) sp
cv_sep_weak
= sp ["'] sp / space
/* The opening regexp is overwritten during post-processing to allow flexibility on including the comma. */
sequence_sep
= ([,;/:&\-\u2013\u2014~] / "." !(sp "." sp ".") / [ée]i "s" / "v" [öo]i / "vagy" / space)+
{ return "" }
range_sep
= sp ([\-\u2013\u2014] sp / "k" [öo]i "v" sp )+
title
= (cv_sep / sequence_sep)? val:"c" [íi]i "m"
{ return {type:"title", value: [val], "indices": [peg$savedPos, peg$currPos - 1]} }
in_book_of
= sp ("from" / "of" / "in") sp ("the" sp "book" sp "of" sp)?
abbrev
= sp "." !(sp "." sp ".")
/* EU-style separators, where "," is a cv separator and "." is a sequence separator. The sequence is post-processed into the grammar rather than specified here. */
eu_cv_sep
= sp "," sp
/* Translations */
// Prevents a reference entirely enclosed in parentheses from incorrectly grabbing the closing parenthesis of the reference rather than just the closing parenthesis of the translation.
translation_sequence_enclosed
= sp [\(\[] sp val:(translation (sequence_sep translation)*) sp [\)\]]
{ return {"type": "translation_sequence", "value": val, "indices": [peg$savedPos, peg$currPos - 1]} }
translation_sequence
= sp ("," sp)? val:(translation (sequence_sep translation)*)
{ return {"type": "translation_sequence", "value": val, "indices": [peg$savedPos, peg$currPos - 1]} }
translation
= "\x1e" val:any_integer "\x1e"
{ return {"type": "translation", "value": val.value, "indices": [peg$savedPos, peg$currPos - 1]} }
/* Base nodes */
// Integer is never four or more digits long or followed by, e.g., ",000". The build process overwrites this function with a faster version.
integer
= val:([0-9] [0-9]? [0-9]?) !([0-9] / ",000")
{ return {"type": "integer", "value": parseInt(val.join(""), 10), "indices": [peg$savedPos, peg$currPos - 1]} }
// The build process overwrites this function with a faster version.
any_integer
= val:([0-9]+)
{ return {"type": "integer", "value": parseInt(val.join(""), 10), "indices": [peg$savedPos, peg$currPos - 1]} }
word
= val:( [^\x1f\x1e\(\[]+ )
{ return {"type": "word", "value": val.join(""), "indices": [peg$savedPos, peg$currPos - 1]} }
// Don't gobble up opening parenthesis in an enclosed translation sequence--stop parsing when reaching an unmatched parenthesis.
word_parenthesis
= val:[\(\[]
{ return {"type": "stop", "value": val, "indices": [peg$savedPos, peg$currPos - 1]} }
sp
= space?
// Older IE doesn't consider `\xa0` part of the `\s` class. The build process overwrites this function with a faster version.
space
= [ \t\r\n\xa0\*]+ | {
"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.reshape(-1, 1)
if (Z.shape[1] > 1) and self.binary_instrument:
raise AssertionError("Binary instrument flag is True, but instrument is multi-dimensional")
T = T.flatten()
y = y.flatten()
n_samples = y.shape[0]
pred_t = np.zeros(n_samples)
proj_t = 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]))]
# TODO. Deal with multi-class instrument
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 nuisances
pred_t[test] = self.model_T_X[idx].fit(
X[train], T[train]).predict(X[test])
proj_t[test] = self.model_T_XZ[idx].fit(hstack([X[train], Z[train]]),
T[train]).predict(hstack([X[test], Z[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]
res_z = proj_t - pred_t
res_t = T - pred_t
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_T_XZ': self.model_T_XZ}
class SimpleATEIV:
"""
A non-doubly robust simple approach that predicts T from X,Z
and then runs a regression of Y on E[T | X, Z] and X. No cross-fitting
is used.
"""
def __init__(self, model_T_XZ, model_final):
"""
Parameters
----------
model_T_XZ : model to predict E[T | X, Z]
model_final : final model for predicting Y from E[T|X,Z], X
"""
self.model_T_XZ = model_T_XZ
self.model_final = model_final
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.reshape(-1, 1)
T = T.flatten()
y = y.flatten()
pred_t = self.model_T_XZ.fit(hstack([X, Z]), T).predict(hstack([X, Z]))
self.model_final.fit(hstack([pred_t.reshape(-1, 1), X]), y)
return self
def effect(self, X, T0=0, T1=1):
"""
Parameters
----------
X : features
"""
if not hasattr(T0, "__len__"):
T0 = np.ones(X.shape[0])*T0
if not hasattr(T1, "__len__"):
T1 = np.ones(X.shape[0])*T1
X0 = hstack([T0.reshape(-1, 1), X])
X1 = hstack([T1.reshape(-1, 1), X])
return self.model_final.predict(X1) - self.model_final.predict(X0)
@property
def coef_(self):
return self.model_final.coef_
| {
"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 <[email protected]>
* @author Christian Matthies <[email protected]>
* @author Lars Strojny <[email protected]>
* @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 <[email protected]>
* @author Mario Heiderich <[email protected]>
* @author Lars Strojny <[email protected]>
* @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" = "Inferior Centralizado";
"Bottom Left" = "Inferior Esquerda";
"Bottom Right" = "Inferior Direita";
"Window Resize Type" = "Tipo de Redimensionamento de Janela";
"Free" = "Livre";
"Adjust to Size" = "Ajustar ao Tamanho";
"Adjust to Width" = "Ajustar à Largura";
"Dragging Action on Movie Area" = "Ação ao Arrastar Área do Filme";
"Move Window" = "Mover Janela";
"Capture Movie" = "Capturar Filme";
/* Preferences: advanced - details: video */
"Capture Format" = "Formato de Captura";
"Include Letter Box on Capture" = "Incluir Letter Box na Captura";
"Remove Green Box" = "Remover Caixa Verde";
"Video Queue Capacity (8~99)" = "Capacidade da Fila de Vídeos (8~99)";
"Use Fast Decoding" = "Utilizar Decodificação Rápida";
/* Preferences: advanced - details: subtitle */
"Use QuickTime/Perian Subtitles" = "Utilizar Legendas QuickTime/Perian";
"Auto-Load Embedded Subtitles in MKV" = "Autocarregar Legendas Embutidas em MKV";
"Replace New-Line with <BR> for SAMI" = "Substituir Nova-Linha com <BR> para SAMI";
"Default Subtitle Language Identifiers" = "Identificadores padrões de Língua da Legenda";
"DefaultSubtitleLanguageIdentifiers" = "Portuguese Portuguese-Brazil Portuguese-BR pt br ptbr pt-br";
"Auto Letter Box Height Max Lines (1~3)" = "Auto Altura da Letter Box Máx de Linhas (1~3)";
/* Preferences: advanced - details: full-nav */
"Full Screen Navigation" = "Navegação em Tela Cheia";
"Default Navigation Path" = "Caminho padrão de Navegação";
"Show Actual Path for Alias or Symbolic-Link" = "Exibir Caminho Real para Apelido ou Link Simbólico";
/* Playlist */
"No Subtitle File" = "Sem Arquivo de Legenda";
"%d items" = "%d ítens";
/* Codec Desc. */
"etc." = "Etc.";
"etc. DESC." = "Etc.";
"MPEG1 DESC." = "MPEG-1";
"MPEG2 DESC." = "MPEG-2";
"MPEG4 DESC." = "MPEG-4";
"DIV1 DESC." = "DivX MPEG-4 V3.x";
"DIV2 DESC." = "DivX MPEG-4 V3.x";
"DIV3 DESC." = "DivX MPEG-4 V3.x";
"DIV4 DESC." = "DivX MPEG-4 V3.x";
"DIV5 DESC." = "DivX MPEG-4 V3.x";
"DIV6 DESC." = "DivX MPEG-4 V3.x";
"DIVX DESC." = "DivX MPEG-4 V4.x";
"DX50 DESC." = "DivX MPEG-4 V5.x";
"XVID DESC." = "Xvid MPEG-4";
"MP4V DESC." = "Apple MPEG-4";
"MPG4 DESC." = "Microsoft MPEG-4 V1";
"MP42 DESC." = "Microsoft MPEG-4 V2";
"MP43 DESC." = "Microsoft MPEG-4 V3";
"MP4S DESC." = "Microsoft ISO MPEG-4 V1";
"M4S2 DESC." = "Microsoft ISO MPEG-4 V1.1";
"AP41 DESC." = "AngelPotion Definitive";
"RMP4 DESC." = "REALmagic MPEG-4";
"SEDG DESC." = "Samsung MPEG-4";
"FMP4 DESC." = "FFmpeg MPEG-4";
"BLZ0 DESC." = "DivX for Blizzard";
"H263 DESC." = "H.263, H.263+";
"H264 DESC." = "H.264/MPEG-4 AVC";
"AVC1 DESC." = "Apple H.264";
"X264 DESC." = "Open Source H.264";
"VC1 DESC." = "VC-1 (SMPTE 421M)";
"WMV1 DESC." = "Windows Media Video 7";
"WMV2 DESC." = "Windows Media Video 8";
"WMV3 DESC." = "Windows Media Video 9";
"WVC1 DESC." = "Windows Media Video 9 Advanced Profile";
"SVQ1 DESC." = "Sorenson Video 1";
"SVQ3 DESC." = "Sorenson Video 3";
"VP3 DESC." = "On2 VP3";
"VP5 DESC." = "On2 VP5";
"VP6 DESC." = "TrueMotion VP6";
"VP6F DESC." = "TrueMotion VP6 Flash";
"RV10 DESC." = "RealVideo";
"RV20 DESC." = "RealVideo G2";
"RV30 DESC." = "RealVideo 8";
"RV40 DESC." = "RealVideo 9, 10";
"FLV DESC." = "Flash Video";
"THEORA DESC." = "Theora";
"HUFFYUV DESC." = "Huffyuv";
"CINEPAK DESC." = "Cinepak";
"INDEO2 DESC." = "Indeo Video 2";
"INDEO3 DESC." = "Indeo Video 3";
"MJPEG DESC." = "Motion-JPEG";
"DV DESC." = "DV";
"PCM DESC." = "PCM";
"DPCM DESC." = "DPCM";
"ADPCM DESC." = "ADPCM";
"MP2 DESC." = "MP2";
"MP3 DESC." = "MP3";
"AAC DESC." = "AAC";
"AC3 DESC." = "AC3";
"DTS DESC." = "DTS";
"VORBIS DESC." = "Vorbis";
"DVAUDIO DESC." = "DV Audio";
"WMAV1 DESC." = "Windows Media Audio V1";
"WMAV2 DESC." = "Windows Media Audio V2";
"RA DESC." = "RealAudio";
"AMR DESC." = "AMR";
"ALAC DESC." = "ALAC";
"FLAC DESC." = "FLAC";
"QDM2 DESC." = "QDM2";
"MACE DESC." = "MACE";
"SPEEX DESC." = "Speex";
"TTA DESC." = "TTA";
"WAVPACK DESC." = "WavPack";
| {
"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 */;
if (delay > 1000) {
ngx_signal_worker_processes(cycle, SIGKILL);
} else {
ngx_signal_worker_processes(cycle,
ngx_signal_value(NGX_TERMINATE_SIGNAL));
}
continue;
}
if (ngx_quit) {
ngx_signal_worker_processes(cycle,
ngx_signal_value(NGX_SHUTDOWN_SIGNAL));
ls = cycle->listening.elts;
for (n = 0; n < cycle->listening.nelts; n++) {
if (ngx_close_socket(ls[n].fd) == -1) {
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno,
ngx_close_socket_n " %V failed",
&ls[n].addr_text);
}
}
cycle->listening.nelts = 0;
continue;
}
if (ngx_reconfigure) {
ngx_reconfigure = 0;
if (ngx_new_binary) {
ngx_start_worker_processes(cycle, ccf->worker_processes,
NGX_PROCESS_RESPAWN);
ngx_start_cache_manager_processes(cycle, 0);
ngx_noaccepting = 0;
continue;
}
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "reconfiguring");
cycle = ngx_init_cycle(cycle);
if (cycle == NULL) {
cycle = (ngx_cycle_t *) ngx_cycle;
continue;
}
ngx_cycle = cycle;
ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx,
ngx_core_module);
ngx_start_worker_processes(cycle, ccf->worker_processes,
NGX_PROCESS_JUST_RESPAWN);
ngx_start_cache_manager_processes(cycle, 1);
/* allow new processes to start */
ngx_msleep(100);
live = 1;
ngx_signal_worker_processes(cycle,
ngx_signal_value(NGX_SHUTDOWN_SIGNAL));
}
if (ngx_restart) {
ngx_restart = 0;
ngx_start_worker_processes(cycle, ccf->worker_processes,
NGX_PROCESS_RESPAWN);
ngx_start_cache_manager_processes(cycle, 0);
live = 1;
}
if (ngx_reopen) {
ngx_reopen = 0;
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "reopening logs");
ngx_reopen_files(cycle, ccf->user);
ngx_signal_worker_processes(cycle,
ngx_signal_value(NGX_REOPEN_SIGNAL));
}
if (ngx_change_binary) {
ngx_change_binary = 0;
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "changing binary");
ngx_new_binary = ngx_exec_new_binary(cycle, ngx_argv);
}
if (ngx_noaccept) {
ngx_noaccept = 0;
ngx_noaccepting = 1;
ngx_signal_worker_processes(cycle,
ngx_signal_value(NGX_SHUTDOWN_SIGNAL));
}
}
}
void
ngx_single_process_cycle(ngx_cycle_t *cycle)
{
ngx_uint_t i;
if (ngx_set_environment(cycle, NULL) == NULL) {
/* fatal */
exit(2);
}
for (i = 0; ngx_modules[i]; i++) {
if (ngx_modules[i]->init_process) {
if (ngx_modules[i]->init_process(cycle) == NGX_ERROR) {
/* fatal */
exit(2);
}
}
}
for ( ;; ) {
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "worker cycle");
ngx_process_events_and_timers(cycle);
if (ngx_terminate || ngx_quit) {
for (i = 0; ngx_modules[i]; i++) {
if (ngx_modules[i]->exit_process) {
ngx_modules[i]->exit_process(cycle);
}
}
ngx_master_process_exit(cycle);
}
if (ngx_reconfigure) {
ngx_reconfigure = 0;
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "reconfiguring");
cycle = ngx_init_cycle(cycle);
if (cycle == NULL) {
cycle = (ngx_cycle_t *) ngx_cycle;
continue;
}
ngx_cycle = cycle;
}
if (ngx_reopen) {
ngx_reopen = 0;
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "reopening logs");
ngx_reopen_files(cycle, (ngx_uid_t) -1);
}
}
}
static void
ngx_start_worker_processes(ngx_cycle_t *cycle, ngx_int_t n, ngx_int_t type)
{
ngx_int_t i;
ngx_channel_t ch;
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "start worker processes");
ngx_memzero(&ch, sizeof(ngx_channel_t));
ch.command = NGX_CMD_OPEN_CHANNEL;
for (i = 0; i < n; i++) {
ngx_spawn_process(cycle, ngx_worker_process_cycle,
(void *) (intptr_t) i, "worker process", type);
ch.pid = ngx_processes[ngx_process_slot].pid;
ch.slot = ngx_process_slot;
ch.fd = ngx_processes[ngx_process_slot].channel[0];
ngx_pass_open_channel(cycle, &ch);
}
}
static void
ngx_start_cache_manager_processes(ngx_cycle_t *cycle, ngx_uint_t respawn)
{
ngx_uint_t i, manager, loader;
ngx_path_t **path;
ngx_channel_t ch;
manager = 0;
loader = 0;
path = ngx_cycle->paths.elts;
for (i = 0; i < ngx_cycle->paths.nelts; i++) {
if (path[i]->manager) {
manager = 1;
}
if (path[i]->loader) {
loader = 1;
}
}
if (manager == 0) {
return;
}
ngx_spawn_process(cycle, ngx_cache_manager_process_cycle,
&ngx_cache_manager_ctx, "cache manager process",
respawn ? NGX_PROCESS_JUST_RESPAWN : NGX_PROCESS_RESPAWN);
ngx_memzero(&ch, sizeof(ngx_channel_t));
ch.command = NGX_CMD_OPEN_CHANNEL;
ch.pid = ngx_processes[ngx_process_slot].pid;
ch.slot = ngx_process_slot;
ch.fd = ngx_processes[ngx_process_slot].channel[0];
ngx_pass_open_channel(cycle, &ch);
if (loader == 0) {
return;
}
ngx_spawn_process(cycle, ngx_cache_manager_process_cycle,
&ngx_cache_loader_ctx, "cache loader process",
respawn ? NGX_PROCESS_JUST_SPAWN : NGX_PROCESS_NORESPAWN);
ch.command = NGX_CMD_OPEN_CHANNEL;
ch.pid = ngx_processes[ngx_process_slot].pid;
ch.slot = ngx_process_slot;
ch.fd = ngx_processes[ngx_process_slot].channel[0];
ngx_pass_open_channel(cycle, &ch);
}
static void
ngx_pass_open_channel(ngx_cycle_t *cycle, ngx_channel_t *ch)
{
ngx_int_t i;
for (i = 0; i < ngx_last_process; i++) {
if (i == ngx_process_slot
|| ngx_processes[i].pid == -1
|| ngx_processes[i].channel[0] == -1)
{
continue;
}
ngx_log_debug6(NGX_LOG_DEBUG_CORE, cycle->log, 0,
"pass channel s:%d pid:%P fd:%d to s:%i pid:%P fd:%d",
ch->slot, ch->pid, ch->fd,
i, ngx_processes[i].pid,
ngx_processes[i].channel[0]);
/* TODO: NGX_AGAIN */
ngx_write_channel(ngx_processes[i].channel[0],
ch, sizeof(ngx_channel_t), cycle->log);
}
}
static void
ngx_signal_worker_processes(ngx_cycle_t *cycle, int signo)
{
ngx_int_t i;
ngx_err_t err;
ngx_channel_t ch;
ngx_memzero(&ch, sizeof(ngx_channel_t));
#if (NGX_BROKEN_SCM_RIGHTS)
ch.command = 0;
#else
switch (signo) {
case ngx_signal_value(NGX_SHUTDOWN_SIGNAL):
ch.command = NGX_CMD_QUIT;
break;
case ngx_signal_value(NGX_TERMINATE_SIGNAL):
ch.command = NGX_CMD_TERMINATE;
break;
case ngx_signal_value(NGX_REOPEN_SIGNAL):
ch.command = NGX_CMD_REOPEN;
break;
default:
ch.command = 0;
}
#endif
ch.fd = -1;
for (i = 0; i < ngx_last_process; i++) {
ngx_log_debug7(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
"child: %d %P e:%d t:%d d:%d r:%d j:%d",
i,
ngx_processes[i].pid,
ngx_processes[i].exiting,
ngx_processes[i].exited,
ngx_processes[i].detached,
ngx_processes[i].respawn,
ngx_processes[i].just_spawn);
if (ngx_processes[i].detached || ngx_processes[i].pid == -1) {
continue;
}
if (ngx_processes[i].just_spawn) {
ngx_processes[i].just_spawn = 0;
continue;
}
if (ngx_processes[i].exiting
&& signo == ngx_signal_value(NGX_SHUTDOWN_SIGNAL))
{
continue;
}
if (ch.command) {
if (ngx_write_channel(ngx_processes[i].channel[0],
&ch, sizeof(ngx_channel_t), cycle->log)
== NGX_OK)
{
if (signo != ngx_signal_value(NGX_REOPEN_SIGNAL)) {
ngx_processes[i].exiting = 1;
}
continue;
}
}
ngx_log_debug2(NGX_LOG_DEBUG_CORE, cycle->log, 0,
"kill (%P, %d)", ngx_processes[i].pid, signo);
if (kill(ngx_processes[i].pid, signo) == -1) {
err = ngx_errno;
ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
"kill(%P, %d) failed", ngx_processes[i].pid, signo);
if (err == NGX_ESRCH) {
ngx_processes[i].exited = 1;
ngx_processes[i].exiting = 0;
ngx_reap = 1;
}
continue;
}
if (signo != ngx_signal_value(NGX_REOPEN_SIGNAL)) {
ngx_processes[i].exiting = 1;
}
}
}
static ngx_uint_t
ngx_reap_children(ngx_cycle_t *cycle)
{
ngx_int_t i, n;
ngx_uint_t live;
ngx_channel_t ch;
ngx_core_conf_t *ccf;
ngx_memzero(&ch, sizeof(ngx_channel_t));
ch.command = NGX_CMD_CLOSE_CHANNEL;
ch.fd = -1;
live = 0;
for (i = 0; i < ngx_last_process; i++) {
ngx_log_debug7(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
"child: %d %P e:%d t:%d d:%d r:%d j:%d",
i,
ngx_processes[i].pid,
ngx_processes[i].exiting,
ngx_processes[i].exited,
ngx_processes[i].detached,
ngx_processes[i].respawn,
ngx_processes[i].just_spawn);
if (ngx_processes[i].pid == -1) {
continue;
}
if (ngx_processes[i].exited) {
if (!ngx_processes[i].detached) {
ngx_close_channel(ngx_processes[i].channel, cycle->log);
ngx_processes[i].channel[0] = -1;
ngx_processes[i].channel[1] = -1;
ch.pid = ngx_processes[i].pid;
ch.slot = i;
for (n = 0; n < ngx_last_process; n++) {
if (ngx_processes[n].exited
|| ngx_processes[n].pid == -1
|| ngx_processes[n].channel[0] == -1)
{
continue;
}
ngx_log_debug3(NGX_LOG_DEBUG_CORE, cycle->log, 0,
"pass close channel s:%i pid:%P to:%P",
ch.slot, ch.pid, ngx_processes[n].pid);
/* TODO: NGX_AGAIN */
ngx_write_channel(ngx_processes[n].channel[0],
&ch, sizeof(ngx_channel_t), cycle->log);
}
}
if (ngx_processes[i].respawn
&& !ngx_processes[i].exiting
&& !ngx_terminate
&& !ngx_quit)
{
if (ngx_spawn_process(cycle, ngx_processes[i].proc,
ngx_processes[i].data,
ngx_processes[i].name, i)
== NGX_INVALID_PID)
{
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
"could not respawn %s",
ngx_processes[i].name);
continue;
}
ch.command = NGX_CMD_OPEN_CHANNEL;
ch.pid = ngx_processes[ngx_process_slot].pid;
ch.slot = ngx_process_slot;
ch.fd = ngx_processes[ngx_process_slot].channel[0];
ngx_pass_open_channel(cycle, &ch);
live = 1;
continue;
}
if (ngx_processes[i].pid == ngx_new_binary) {
ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx,
ngx_core_module);
if (ngx_rename_file((char *) ccf->oldpid.data,
(char *) ccf->pid.data)
== NGX_FILE_ERROR)
{
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
ngx_rename_file_n " %s back to %s failed "
"after the new binary process \"%s\" exited",
ccf->oldpid.data, ccf->pid.data, ngx_argv[0]);
}
ngx_new_binary = 0;
if (ngx_noaccepting) {
ngx_restart = 1;
ngx_noaccepting = 0;
}
}
if (i == ngx_last_process - 1) {
ngx_last_process--;
} else {
ngx_processes[i].pid = -1;
}
} else if (ngx_processes[i].exiting || !ngx_processes[i].detached) {
live = 1;
}
}
return live;
}
static void
ngx_master_process_exit(ngx_cycle_t *cycle)
{
ngx_uint_t i;
ngx_delete_pidfile(cycle);
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exit");
for (i = 0; ngx_modules[i]; i++) {
if (ngx_modules[i]->exit_master) {
ngx_modules[i]->exit_master(cycle);
}
}
ngx_close_listening_sockets(cycle);
/*
* Copy ngx_cycle->log related data to the special static exit cycle,
* log, and log file structures enough to allow a signal handler to log.
* The handler may be called when standard ngx_cycle->log allocated from
* ngx_cycle->pool is already destroyed.
*/
ngx_exit_log = *ngx_log_get_file_log(ngx_cycle->log);
ngx_exit_log_file.fd = ngx_exit_log.file->fd;
ngx_exit_log.file = &ngx_exit_log_file;
ngx_exit_log.next = NULL;
ngx_exit_log.writer = NULL;
ngx_exit_cycle.log = &ngx_exit_log;
ngx_exit_cycle.files = ngx_cycle->files;
ngx_exit_cycle.files_n = ngx_cycle->files_n;
ngx_cycle = &ngx_exit_cycle;
ngx_destroy_pool(cycle->pool);
exit(0);
}
static void
ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data)
{
ngx_int_t worker = (intptr_t) data;
ngx_process = NGX_PROCESS_WORKER;
ngx_worker = worker;
ngx_worker_process_init(cycle, worker);
ngx_setproctitle("worker process");
for ( ;; ) {
if (ngx_exiting) {
ngx_event_cancel_timers();
if (ngx_event_timer_rbtree.root == ngx_event_timer_rbtree.sentinel)
{
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
ngx_worker_process_exit(cycle);
}
}
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "worker cycle");
ngx_process_events_and_timers(cycle);
if (ngx_terminate) {
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
ngx_worker_process_exit(cycle);
}
if (ngx_quit) {
ngx_quit = 0;
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0,
"gracefully shutting down");
ngx_setproctitle("worker process is shutting down");
if (!ngx_exiting) {
ngx_exiting = 1;
ngx_close_listening_sockets(cycle);
ngx_close_idle_connections(cycle);
}
}
if (ngx_reopen) {
ngx_reopen = 0;
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "reopening logs");
ngx_reopen_files(cycle, -1);
}
}
}
static void
ngx_worker_process_init(ngx_cycle_t *cycle, ngx_int_t worker)
{
sigset_t set;
uint64_t cpu_affinity;
ngx_int_t n;
ngx_uint_t i;
struct rlimit rlmt;
ngx_core_conf_t *ccf;
ngx_listening_t *ls;
if (ngx_set_environment(cycle, NULL) == NULL) {
/* fatal */
exit(2);
}
ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
if (worker >= 0 && ccf->priority != 0) {
if (setpriority(PRIO_PROCESS, 0, ccf->priority) == -1) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
"setpriority(%d) failed", ccf->priority);
}
}
if (ccf->rlimit_nofile != NGX_CONF_UNSET) {
rlmt.rlim_cur = (rlim_t) ccf->rlimit_nofile;
rlmt.rlim_max = (rlim_t) ccf->rlimit_nofile;
if (setrlimit(RLIMIT_NOFILE, &rlmt) == -1) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
"setrlimit(RLIMIT_NOFILE, %i) failed",
ccf->rlimit_nofile);
}
}
if (ccf->rlimit_core != NGX_CONF_UNSET) {
rlmt.rlim_cur = (rlim_t) ccf->rlimit_core;
rlmt.rlim_max = (rlim_t) ccf->rlimit_core;
if (setrlimit(RLIMIT_CORE, &rlmt) == -1) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
"setrlimit(RLIMIT_CORE, %O) failed",
ccf->rlimit_core);
}
}
if (geteuid() == 0) {
if (setgid(ccf->group) == -1) {
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
"setgid(%d) failed", ccf->group);
/* fatal */
exit(2);
}
if (initgroups(ccf->username, ccf->group) == -1) {
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
"initgroups(%s, %d) failed",
ccf->username, ccf->group);
}
if (setuid(ccf->user) == -1) {
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
"setuid(%d) failed", ccf->user);
/* fatal */
exit(2);
}
}
if (worker >= 0) {
cpu_affinity = ngx_get_cpu_affinity(worker);
if (cpu_affinity) {
ngx_setaffinity(cpu_affinity, cycle->log);
}
}
#if (NGX_HAVE_PR_SET_DUMPABLE)
/* allow coredump after setuid() in Linux 2.4.x */
if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
"prctl(PR_SET_DUMPABLE) failed");
}
#endif
if (ccf->working_directory.len) {
if (chdir((char *) ccf->working_directory.data) == -1) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
"chdir(\"%s\") failed", ccf->working_directory.data);
/* fatal */
exit(2);
}
}
sigemptyset(&set);
if (sigprocmask(SIG_SETMASK, &set, NULL) == -1) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
"sigprocmask() failed");
}
srandom((ngx_pid << 16) ^ ngx_time());
/*
* disable deleting previous events for the listening sockets because
* in the worker processes there are no events at all at this point
*/
ls = cycle->listening.elts;
for (i = 0; i < cycle->listening.nelts; i++) {
ls[i].previous = NULL;
}
for (i = 0; ngx_modules[i]; i++) {
if (ngx_modules[i]->init_process) {
if (ngx_modules[i]->init_process(cycle) == NGX_ERROR) {
/* fatal */
exit(2);
}
}
}
for (n = 0; n < ngx_last_process; n++) {
if (ngx_processes[n].pid == -1) {
continue;
}
if (n == ngx_process_slot) {
continue;
}
if (ngx_processes[n].channel[1] == -1) {
continue;
}
if (close(ngx_processes[n].channel[1]) == -1) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
"close() channel failed");
}
}
if (close(ngx_processes[ngx_process_slot].channel[0]) == -1) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
"close() channel failed");
}
#if 0
ngx_last_process = 0;
#endif
if (ngx_add_channel_event(cycle, ngx_channel, NGX_READ_EVENT,
ngx_channel_handler)
== NGX_ERROR)
{
/* fatal */
exit(2);
}
}
static void
ngx_worker_process_exit(ngx_cycle_t *cycle)
{
ngx_uint_t i;
ngx_connection_t *c;
for (i = 0; ngx_modules[i]; i++) {
if (ngx_modules[i]->exit_process) {
ngx_modules[i]->exit_process(cycle);
}
}
if (ngx_exiting) {
c = cycle->connections;
for (i = 0; i < cycle->connection_n; i++) {
if (c[i].fd != -1
&& c[i].read
&& !c[i].read->accept
&& !c[i].read->channel
&& !c[i].read->resolver)
{
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
"*%uA open socket #%d left in connection %ui",
c[i].number, c[i].fd, i);
ngx_debug_quit = 1;
}
}
if (ngx_debug_quit) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, "aborting");
ngx_debug_point();
}
}
/*
* Copy ngx_cycle->log related data to the special static exit cycle,
* log, and log file structures enough to allow a signal handler to log.
* The handler may be called when standard ngx_cycle->log allocated from
* ngx_cycle->pool is already destroyed.
*/
ngx_exit_log = *ngx_log_get_file_log(ngx_cycle->log);
ngx_exit_log_file.fd = ngx_exit_log.file->fd;
ngx_exit_log.file = &ngx_exit_log_file;
ngx_exit_log.next = NULL;
ngx_exit_log.writer = NULL;
ngx_exit_cycle.log = &ngx_exit_log;
ngx_exit_cycle.files = ngx_cycle->files;
ngx_exit_cycle.files_n = ngx_cycle->files_n;
ngx_cycle = &ngx_exit_cycle;
ngx_destroy_pool(cycle->pool);
ngx_log_error(NGX_LOG_NOTICE, ngx_cycle->log, 0, "exit");
exit(0);
}
static void
ngx_channel_handler(ngx_event_t *ev)
{
ngx_int_t n;
ngx_channel_t ch;
ngx_connection_t *c;
if (ev->timedout) {
ev->timedout = 0;
return;
}
c = ev->data;
ngx_log_debug0(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel handler");
for ( ;; ) {
n = ngx_read_channel(c->fd, &ch, sizeof(ngx_channel_t), ev->log);
ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel: %i", n);
if (n == NGX_ERROR) {
if (ngx_event_flags & NGX_USE_EPOLL_EVENT) {
ngx_del_conn(c, 0);
}
ngx_close_connection(c);
return;
}
if (ngx_event_flags & NGX_USE_EVENTPORT_EVENT) {
if (ngx_add_event(ev, NGX_READ_EVENT, 0) == NGX_ERROR) {
return;
}
}
if (n == NGX_AGAIN) {
return;
}
ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0,
"channel command: %d", ch.command);
switch (ch.command) {
case NGX_CMD_QUIT:
ngx_quit = 1;
break;
case NGX_CMD_TERMINATE:
ngx_terminate = 1;
break;
case NGX_CMD_REOPEN:
ngx_reopen = 1;
break;
case NGX_CMD_OPEN_CHANNEL:
ngx_log_debug3(NGX_LOG_DEBUG_CORE, ev->log, 0,
"get channel s:%i pid:%P fd:%d",
ch.slot, ch.pid, ch.fd);
ngx_processes[ch.slot].pid = ch.pid;
ngx_processes[ch.slot].channel[0] = ch.fd;
break;
case NGX_CMD_CLOSE_CHANNEL:
ngx_log_debug4(NGX_LOG_DEBUG_CORE, ev->log, 0,
"close channel s:%i pid:%P our:%P fd:%d",
ch.slot, ch.pid, ngx_processes[ch.slot].pid,
ngx_processes[ch.slot].channel[0]);
if (close(ngx_processes[ch.slot].channel[0]) == -1) {
ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
"close() channel failed");
}
ngx_processes[ch.slot].channel[0] = -1;
break;
}
}
}
static void
ngx_cache_manager_process_cycle(ngx_cycle_t *cycle, void *data)
{
ngx_cache_manager_ctx_t *ctx = data;
void *ident[4];
ngx_event_t ev;
/*
* Set correct process type since closing listening Unix domain socket
* in a master process also removes the Unix domain socket file.
*/
ngx_process = NGX_PROCESS_HELPER;
ngx_close_listening_sockets(cycle);
/* Set a moderate number of connections for a helper process. */
cycle->connection_n = 512;
ngx_worker_process_init(cycle, -1);
ngx_memzero(&ev, sizeof(ngx_event_t));
ev.handler = ctx->handler;
ev.data = ident;
ev.log = cycle->log;
ident[3] = (void *) -1;
ngx_use_accept_mutex = 0;
ngx_setproctitle(ctx->name);
ngx_add_timer(&ev, ctx->delay);
for ( ;; ) {
if (ngx_terminate || ngx_quit) {
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
exit(0);
}
if (ngx_reopen) {
ngx_reopen = 0;
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "reopening logs");
ngx_reopen_files(cycle, -1);
}
ngx_process_events_and_timers(cycle);
}
}
static void
ngx_cache_manager_process_handler(ngx_event_t *ev)
{
time_t next, n;
ngx_uint_t i;
ngx_path_t **path;
next = 60 * 60;
path = ngx_cycle->paths.elts;
for (i = 0; i < ngx_cycle->paths.nelts; i++) {
if (path[i]->manager) {
n = path[i]->manager(path[i]->data);
next = (n <= next) ? n : next;
ngx_time_update();
}
}
if (next == 0) {
next = 1;
}
ngx_add_timer(ev, next * 1000);
}
static void
ngx_cache_loader_process_handler(ngx_event_t *ev)
{
ngx_uint_t i;
ngx_path_t **path;
ngx_cycle_t *cycle;
cycle = (ngx_cycle_t *) ngx_cycle;
path = cycle->paths.elts;
for (i = 0; i < cycle->paths.nelts; i++) {
if (ngx_terminate || ngx_quit) {
break;
}
if (path[i]->loader) {
path[i]->loader(path[i]->data);
ngx_time_update();
}
}
exit(0);
}
| {
"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.script.Env[tasking.MaximumTasks]):
delay = 5
dsz.ui.Echo(('No room to start commands. Sleeping for %d seconds.' % delay))
dsz.Sleep((delay * 1000))
dsz.ui.Echo(' SLEPT', dsz.GOOD)
return True
def AreAnyCommandsRunning(self):
while (self._currentNumberOfRunningCommands() > 0):
delay = 5
dsz.ui.Echo(('Waiting for the completion of running tasks. Sleeping for %d seconds.' % delay))
dsz.Sleep((delay * 1000))
dsz.ui.Echo(' SLEPT', dsz.GOOD)
return True
def _currentNumberOfRunningCommands(self):
count = 0
dsz.ui.Echo('Counting running tasks')
for t in self.runningTasks:
if (not dsz.cmd.data.Get('CommandMetaData::IsRunning', dsz.TYPE_BOOL, t)[0]):
self.runningTasks.remove(t)
else:
count = (count + 1)
dsz.ui.Echo((' %d tasks running' % count), dsz.WARNING)
return count
def __str__(self):
match = 'Uncertain Match'
if (self.Recommendation == SuccessfulMatch):
match = 'Probable Match'
elif (self.Recommendation == NoMatch):
match = 'Not A Match'
state = ''
if self.bRan:
state = '(Already Ran)'
return ('%s: %s %s' % (self.name, match, state))
def RecordTask(task, cmdData):
resultsDir = ('%s/TaskResults' % dsz.script.Env['log_path'])
try:
os.mkdir(resultsDir)
except:
pass
outputFile = ('%s/%s_%s_%s.xml' % (resultsDir, task.Priority, task.name, dsz.Timestamp()))
doc = xml.dom.minidom.Document()
results = doc.createElement('TaskResults')
doc.appendChild(results)
results.setAttribute('taskID', task.TaskID)
results.setAttribute('targetID', task.TargetID)
commands = doc.createElement('Commands')
results.appendChild(commands)
commands.setAttribute('tool', 'DSZ')
for (cmd, id) in cmdData:
command = doc.createElement('Command')
commands.appendChild(command)
type = doc.createElement('Type')
command.appendChild(type)
type.appendChild(doc.createTextNode(cmd))
location = doc.createElement('DSZPayloadLocation')
command.appendChild(location)
location.appendChild(doc.createTextNode(dsz.cmd.data.Get('CommandMetaData::XmlLog', dsz.TYPE_STRING, id)[0]))
taskId = doc.createElement('TaskId')
command.appendChild(taskId)
taskId.appendChild(doc.createTextNode(dsz.cmd.data.Get('CommandMetaData::TaskId', dsz.TYPE_STRING, id)[0]))
output = open(outputFile, 'w')
try:
output.write(doc.toprettyxml(indent=' '))
finally:
output.close()
def queryExecuteTask(delayedQueue, task):
task.Display()
(text, selected) = dsz.menu.ExecuteSimpleMenu('Do you wish to execute this task?', ['Yes, execute the task', 'No, but ask me again after doing other tasks', 'No, do not execute the task at all'])
if (selected == (-1)):
exit((-1))
elif (selected == 0):
return True
elif (selected == 1):
delayedQueue.append(task)
return False
def makeRecommendation(PcMatch, MacMatch, IpMatch, HostNameMatch, DomainMatch, GuidMatch, TaskingInfo, HostInfo):
if (PcMatch == SuccessfulMatch):
return SuccessfulMatch
if ((PcMatch == NoMatch) and (len(HostInfo[PcId]) > 0) and len(TaskingInfo.id)):
return NoMatch
if (MacMatch in [SuccessfulMatch, QuestionableMatch]):
return SuccessfulMatch
if (GuidMatch in [SuccessfulMatch, QuestionableMatch]):
return SuccessfulMatch
if (IpMatch == SuccessfulMatch):
return SuccessfulMatch
if ((HostNameMatch == SuccessfulMatch) and (DomainMatch == SuccessfulMatch)):
return SuccessfulMatch
if ((PcMatch == QuestionableMatch) or (IpMatch == QuestionableMatch) or (HostNameMatch == QuestionableMatch) or (DomainMatch == QuestionableMatch)):
return QuestionableMatch
return NoMatch
def displayResult(name, result, Full, Partial, NoMatch, FullType=dsz.GOOD, PartialType=dsz.WARNING, NoMatchType=dsz.ERROR):
if (result == SuccessfulMatch):
return (name, Full, FullType)
elif (result == QuestionableMatch):
return (name, Partial, PartialType)
else:
return (name, NoMatch, NoMatchType)
def compareData(name, tasking, local, format='%s', align='-', bDisplay=False):
matches = (tasking & local)
task = list((tasking - matches))
loc = list((local - matches))
if bDisplay:
maxSize = max(15, max([len((format % x)) for x in ((tasking | local) | set([0]))]))
lineFormat = ('%%%s%ds %%%s%ds' % (align, maxSize, align, maxSize))
dsz.ui.Echo(printHeader(name, ((2 * maxSize) + 4)), dsz.WARNING)
dsz.ui.Echo((lineFormat % (printHeader('Tasking', maxSize), printHeader('Target', maxSize))), dsz.WARNING)
dsz.ui.Echo(printLine('-', ((2 * maxSize) + 4)))
matches = (tasking & local)
for item in matches:
dsz.ui.Echo((lineFormat % ((format % item), (format % item))), dsz.GOOD)
task = list((tasking - matches))
loc = list((local - matches))
for i in range(0, max(len(task), len(loc))):
left = ''
right = ''
if (i < len(task)):
left = (format % task[i])
if (i < len(loc)):
right = (format % loc[i])
dsz.ui.Echo((lineFormat % (left, right)))
dsz.ui.Echo('')
if ((len(matches) > 0) and (len(loc) > 0)):
return QuestionableMatch
elif (len(matches) > 0):
return SuccessfulMatch
else:
return NoMatch
def printHeader(string, size):
while (len(string) < (size - 1)):
string = (' %s ' % string)
return string
def printLine(ch, size):
str = ''
for i in range(0, size):
str = ('%s%s' % (str, ch))
return str | {
"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_D11);};
void SetOperationToD22()
{this->SetOperation(VTK_TENS_D22);};
void SetOperationToD33()
{this->SetOperation(VTK_TENS_D33);};
///
/// Output RGB color according to XYZ of eigenvectors.
/// Output A (alpha, or transparency) according to
/// anisotropy (1-spherical measure).
void SetOperationToColorByOrientation()
{this->SetOperation(VTK_TENS_COLOR_ORIENTATION);};
///
/// Output RGB color according to colormapping of mode, with
/// final RGB being a linear combination of gray and
/// this color. Amount of gray is determined by FA.
/// Thanks to Gordon Lothar Kindlmann for this method.
void SetOperationToColorByMode()
{this->SetOperation(VTK_TENS_COLOR_MODE);};
///
/// Specify scale factor to scale output (float) scalars by.
/// This is not used when the output is RGBA (char color data).
vtkSetMacro(ScaleFactor,double);
vtkGetMacro(ScaleFactor,double);
///
/// Turn on/off extraction of eigenvalues from tensor.
vtkSetMacro(ExtractEigenvalues,int);
vtkBooleanMacro(ExtractEigenvalues,int);
vtkGetMacro(ExtractEigenvalues,int);
/// Description
/// This matrix is only used for ColorByOrientation.
/// We transform the tensor orientation by this matrix
/// before setting the output RGB values.
//
/// This is useful to put the output colors into a standard
/// coordinate system (i.e. RAS) regardless of the data scan order.
//
/// Example usage is as follows:
/// 1) If tensors are to be displayed in a coordinate system
/// that is not IJK (array-based), and the whole volume is
/// being rotated, each tensor needs also to be rotated.
/// First find the matrix that positions your volume.
/// (This is how the entire volume is positioned, not
/// the matrix that positions an arbitrary reformatted slice.)
/// 2) Remove scaling and translation from this matrix; we
/// just need to rotate each tensor.
/// 3) Set TensorRotationMatrix to this rotation matrix.
//
virtual void SetTensorRotationMatrix(vtkMatrix4x4*);
vtkGetObjectMacro(TensorRotationMatrix, vtkMatrix4x4);
/// Description
/// Input scalars are a binary mask: 0 prevents display
/// of tensor quantity at that point
vtkBooleanMacro(MaskWithScalars, int);
vtkSetMacro(MaskWithScalars, int);
vtkGetMacro(MaskWithScalars, int);
vtkBooleanMacro(FixNegativeEigenvalues, int);
vtkSetMacro(FixNegativeEigenvalues, int);
vtkGetMacro(FixNegativeEigenvalues, int);
///
/// Scalar mask
virtual void SetScalarMask(vtkImageData*);
vtkGetObjectMacro(ScalarMask, vtkImageData);
///
/// Label value defining ROI for mask
vtkSetMacro(MaskLabelValue, int);
vtkGetMacro(MaskLabelValue, int);
/// Public for access from threads
static void ModeToRGB(double Mode, double FA,
double &R, double &G, double &B);
static void RGBToIndex(double R, double G,
double B, double &index);
///
/// Helper functions to perform operations pixel-wise
static int FixNegativeEigenvaluesMethod(double w[3]);
static double Determinant(double D[3][3]);
static double Trace(double D[3][3]);
static double Trace(double w[3]);
static double RelativeAnisotropy(double w[3]);
static double FractionalAnisotropy(double w[3]);
static double LinearMeasure(double w[3]);
static double PlanarMeasure(double w[3]);
static double SphericalMeasure(double w[3]);
static double MaxEigenvalue(double w[3]);
static double MiddleEigenvalue(double w[3]);
static double ParallelDiffusivity(double w[3]);
static double PerpendicularDiffusivity(double w[3]);
static double MeanDiffusivity(double w[3]);
static double MinEigenvalue(double w[3]);
static double RAIMaxEigenvecX(double **v, double w[3]);
static double RAIMaxEigenvecY(double **v, double w[3]);
static double RAIMaxEigenvecZ(double **v, double w[3]);
static double MaxEigenvecX(double **v, double w[3]);
static double MaxEigenvecY(double **v, double w[3]);
static double MaxEigenvecZ(double **v, double w[3]);
static double MaxEigenvalueProjectionX(double **v, double w[3]);
static double MaxEigenvalueProjectionY(double **v, double w[3]);
static double MaxEigenvalueProjectionZ(double **v, double w[3]);
static double Mode(double w[3]);
static void ColorByMode(double w[3], double &R,double &G, double &B);
//Description
//Wrap function to teem eigen solver
static int TeemEigenSolver(double **m, double *w, double **v);
void ComputeTensorIncrements(vtkImageData *imageData, vtkIdType incr[3]);
protected:
vtkDiffusionTensorMathematics();
~vtkDiffusionTensorMathematics() override;
int Operation; /// math operation to perform
double ScaleFactor; /// Scale factor for output scalars
int ExtractEigenvalues; /// Boolean controls eigenfunction extraction
int MaskWithScalars;
vtkImageData *ScalarMask;
int MaskLabelValue;
vtkMatrix4x4 *TensorRotationMatrix;
int FixNegativeEigenvalues;
int RequestInformation (vtkInformation*,
vtkInformationVector**,
vtkInformationVector*) override;
void ThreadedRequestData(vtkInformation *request,
vtkInformationVector **inputVector,
vtkInformationVector *outputVector,
vtkImageData ***inData,
vtkImageData **outData,
int extent[6], int threadId) override;
int FillInputPortInformation(int port, vtkInformation* info) override;
// Reimplemented to delete the tensor array of the output.
int RequestData(vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector) override;
private:
vtkDiffusionTensorMathematics(const vtkDiffusionTensorMathematics&) = delete;
void operator=(const vtkDiffusionTensorMathematics&) = delete;
};
#endif
| {
"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);
Value *LoadBase = GetPointerBaseWithConstantOffset(LoadPtr, LoadOffset, DL);
if (StoreBase != LoadBase)
return -1;
// If the load and store are to the exact same address, they should have been
// a must alias. AA must have gotten confused.
// FIXME: Study to see if/when this happens. One case is forwarding a memset
// to a load from the base of the memset.
// If the load and store don't overlap at all, the store doesn't provide
// anything to the load. In this case, they really don't alias at all, AA
// must have gotten confused.
uint64_t LoadSize = DL.getTypeSizeInBits(LoadTy);
if ((WriteSizeInBits & 7) | (LoadSize & 7))
return -1;
uint64_t StoreSize = WriteSizeInBits / 8; // Convert to bytes.
LoadSize /= 8;
bool isAAFailure = false;
if (StoreOffset < LoadOffset)
isAAFailure = StoreOffset + int64_t(StoreSize) <= LoadOffset;
else
isAAFailure = LoadOffset + int64_t(LoadSize) <= StoreOffset;
if (isAAFailure)
return -1;
// If the Load isn't completely contained within the stored bits, we don't
// have all the bits to feed it. We could do something crazy in the future
// (issue a smaller load then merge the bits in) but this seems unlikely to be
// valuable.
if (StoreOffset > LoadOffset ||
StoreOffset + StoreSize < LoadOffset + LoadSize)
return -1;
// Okay, we can do this transformation. Return the number of bytes into the
// store that the load is.
return LoadOffset - StoreOffset;
}
/// This function is called when we have a
/// memdep query of a load that ends up being a clobbering store.
int analyzeLoadFromClobberingStore(Type *LoadTy, Value *LoadPtr,
StoreInst *DepSI, const DataLayout &DL) {
// Cannot handle reading from store of first-class aggregate yet.
if (DepSI->getValueOperand()->getType()->isStructTy() ||
DepSI->getValueOperand()->getType()->isArrayTy())
return -1;
Value *StorePtr = DepSI->getPointerOperand();
uint64_t StoreSize =
DL.getTypeSizeInBits(DepSI->getValueOperand()->getType());
return analyzeLoadFromClobberingWrite(LoadTy, LoadPtr, StorePtr, StoreSize,
DL);
}
/// This function is called when we have a
/// memdep query of a load that ends up being clobbered by another load. See if
/// the other load can feed into the second load.
int analyzeLoadFromClobberingLoad(Type *LoadTy, Value *LoadPtr, LoadInst *DepLI,
const DataLayout &DL) {
// Cannot handle reading from store of first-class aggregate yet.
if (DepLI->getType()->isStructTy() || DepLI->getType()->isArrayTy())
return -1;
Value *DepPtr = DepLI->getPointerOperand();
uint64_t DepSize = DL.getTypeSizeInBits(DepLI->getType());
int R = analyzeLoadFromClobberingWrite(LoadTy, LoadPtr, DepPtr, DepSize, DL);
if (R != -1)
return R;
// If we have a load/load clobber an DepLI can be widened to cover this load,
// then we should widen it!
int64_t LoadOffs = 0;
const Value *LoadBase =
GetPointerBaseWithConstantOffset(LoadPtr, LoadOffs, DL);
unsigned LoadSize = DL.getTypeStoreSize(LoadTy);
unsigned Size = MemoryDependenceResults::getLoadLoadClobberFullWidthSize(
LoadBase, LoadOffs, LoadSize, DepLI);
if (Size == 0)
return -1;
// Check non-obvious conditions enforced by MDA which we rely on for being
// able to materialize this potentially available value
assert(DepLI->isSimple() && "Cannot widen volatile/atomic load!");
assert(DepLI->getType()->isIntegerTy() && "Can't widen non-integer load");
return analyzeLoadFromClobberingWrite(LoadTy, LoadPtr, DepPtr, Size * 8, DL);
}
int analyzeLoadFromClobberingMemInst(Type *LoadTy, Value *LoadPtr,
MemIntrinsic *MI, const DataLayout &DL) {
// If the mem operation is a non-constant size, we can't handle it.
ConstantInt *SizeCst = dyn_cast<ConstantInt>(MI->getLength());
if (!SizeCst)
return -1;
uint64_t MemSizeInBits = SizeCst->getZExtValue() * 8;
// If this is memset, we just need to see if the offset is valid in the size
// of the memset..
if (MI->getIntrinsicID() == Intrinsic::memset)
return analyzeLoadFromClobberingWrite(LoadTy, LoadPtr, MI->getDest(),
MemSizeInBits, DL);
// If we have a memcpy/memmove, the only case we can handle is if this is a
// copy from constant memory. In that case, we can read directly from the
// constant memory.
MemTransferInst *MTI = cast<MemTransferInst>(MI);
Constant *Src = dyn_cast<Constant>(MTI->getSource());
if (!Src)
return -1;
GlobalVariable *GV = dyn_cast<GlobalVariable>(GetUnderlyingObject(Src, DL));
if (!GV || !GV->isConstant())
return -1;
// See if the access is within the bounds of the transfer.
int Offset = analyzeLoadFromClobberingWrite(LoadTy, LoadPtr, MI->getDest(),
MemSizeInBits, DL);
if (Offset == -1)
return Offset;
unsigned AS = Src->getType()->getPointerAddressSpace();
// Otherwise, see if we can constant fold a load from the constant with the
// offset applied as appropriate.
Src =
ConstantExpr::getBitCast(Src, Type::getInt8PtrTy(Src->getContext(), AS));
Constant *OffsetCst =
ConstantInt::get(Type::getInt64Ty(Src->getContext()), (unsigned)Offset);
Src = ConstantExpr::getGetElementPtr(Type::getInt8Ty(Src->getContext()), Src,
OffsetCst);
Src = ConstantExpr::getBitCast(Src, PointerType::get(LoadTy, AS));
if (ConstantFoldLoadFromConstPtr(Src, LoadTy, DL))
return Offset;
return -1;
}
template <class T, class HelperClass>
static T *getStoreValueForLoadHelper(T *SrcVal, unsigned Offset, Type *LoadTy,
HelperClass &Helper,
const DataLayout &DL) {
LLVMContext &Ctx = SrcVal->getType()->getContext();
// If two pointers are in the same address space, they have the same size,
// so we don't need to do any truncation, etc. This avoids introducing
// ptrtoint instructions for pointers that may be non-integral.
if (SrcVal->getType()->isPointerTy() && LoadTy->isPointerTy() &&
cast<PointerType>(SrcVal->getType())->getAddressSpace() ==
cast<PointerType>(LoadTy)->getAddressSpace()) {
return SrcVal;
}
uint64_t StoreSize = (DL.getTypeSizeInBits(SrcVal->getType()) + 7) / 8;
uint64_t LoadSize = (DL.getTypeSizeInBits(LoadTy) + 7) / 8;
// Compute which bits of the stored value are being used by the load. Convert
// to an integer type to start with.
if (SrcVal->getType()->isPtrOrPtrVectorTy())
SrcVal = Helper.CreatePtrToInt(SrcVal, DL.getIntPtrType(SrcVal->getType()));
if (!SrcVal->getType()->isIntegerTy())
SrcVal = Helper.CreateBitCast(SrcVal, IntegerType::get(Ctx, StoreSize * 8));
// Shift the bits to the least significant depending on endianness.
unsigned ShiftAmt;
if (DL.isLittleEndian())
ShiftAmt = Offset * 8;
else
ShiftAmt = (StoreSize - LoadSize - Offset) * 8;
if (ShiftAmt)
SrcVal = Helper.CreateLShr(SrcVal,
ConstantInt::get(SrcVal->getType(), ShiftAmt));
if (LoadSize != StoreSize)
SrcVal = Helper.CreateTruncOrBitCast(SrcVal,
IntegerType::get(Ctx, LoadSize * 8));
return SrcVal;
}
/// This function is called when we have a memdep query of a load that ends up
/// being a clobbering store. This means that the store provides bits used by
/// the load but the pointers don't must-alias. Check this case to see if
/// there is anything more we can do before we give up.
Value *getStoreValueForLoad(Value *SrcVal, unsigned Offset, Type *LoadTy,
Instruction *InsertPt, const DataLayout &DL) {
IRBuilder<> Builder(InsertPt);
SrcVal = getStoreValueForLoadHelper(SrcVal, Offset, LoadTy, Builder, DL);
return coerceAvailableValueToLoadTypeHelper(SrcVal, LoadTy, Builder, DL);
}
Constant *getConstantStoreValueForLoad(Constant *SrcVal, unsigned Offset,
Type *LoadTy, const DataLayout &DL) {
ConstantFolder F;
SrcVal = getStoreValueForLoadHelper(SrcVal, Offset, LoadTy, F, DL);
return coerceAvailableValueToLoadTypeHelper(SrcVal, LoadTy, F, DL);
}
/// This function is called when we have a memdep query of a load that ends up
/// being a clobbering load. This means that the load *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.
Value *getLoadValueForLoad(LoadInst *SrcVal, unsigned Offset, Type *LoadTy,
Instruction *InsertPt, const DataLayout &DL) {
// If Offset+LoadTy exceeds the size of SrcVal, then we must be wanting to
// widen SrcVal out to a larger load.
unsigned SrcValStoreSize = DL.getTypeStoreSize(SrcVal->getType());
unsigned LoadSize = DL.getTypeStoreSize(LoadTy);
if (Offset + LoadSize > SrcValStoreSize) {
assert(SrcVal->isSimple() && "Cannot widen volatile/atomic load!");
assert(SrcVal->getType()->isIntegerTy() && "Can't widen non-integer load");
// If we have a load/load clobber an DepLI can be widened to cover this
// load, then we should widen it to the next power of 2 size big enough!
unsigned NewLoadSize = Offset + LoadSize;
if (!isPowerOf2_32(NewLoadSize))
NewLoadSize = NextPowerOf2(NewLoadSize);
Value *PtrVal = SrcVal->getPointerOperand();
// Insert the new load after the old load. This ensures that subsequent
// memdep queries will find the new load. We can't easily remove the old
// load completely because it is already in the value numbering table.
IRBuilder<> Builder(SrcVal->getParent(), ++BasicBlock::iterator(SrcVal));
Type *DestPTy = IntegerType::get(LoadTy->getContext(), NewLoadSize * 8);
DestPTy =
PointerType::get(DestPTy, PtrVal->getType()->getPointerAddressSpace());
Builder.SetCurrentDebugLocation(SrcVal->getDebugLoc());
PtrVal = Builder.CreateBitCast(PtrVal, DestPTy);
LoadInst *NewLoad = Builder.CreateLoad(PtrVal);
NewLoad->takeName(SrcVal);
NewLoad->setAlignment(SrcVal->getAlignment());
LLVM_DEBUG(dbgs() << "GVN WIDENED LOAD: " << *SrcVal << "\n");
LLVM_DEBUG(dbgs() << "TO: " << *NewLoad << "\n");
// Replace uses of the original load with the wider load. On a big endian
// system, we need to shift down to get the relevant bits.
Value *RV = NewLoad;
if (DL.isBigEndian())
RV = Builder.CreateLShr(RV, (NewLoadSize - SrcValStoreSize) * 8);
RV = Builder.CreateTrunc(RV, SrcVal->getType());
SrcVal->replaceAllUsesWith(RV);
SrcVal = NewLoad;
}
return getStoreValueForLoad(SrcVal, Offset, LoadTy, InsertPt, DL);
}
Constant *getConstantLoadValueForLoad(Constant *SrcVal, unsigned Offset,
Type *LoadTy, const DataLayout &DL) {
unsigned SrcValStoreSize = DL.getTypeStoreSize(SrcVal->getType());
unsigned LoadSize = DL.getTypeStoreSize(LoadTy);
if (Offset + LoadSize > SrcValStoreSize)
return nullptr;
return getConstantStoreValueForLoad(SrcVal, Offset, LoadTy, DL);
}
template <class T, class HelperClass>
T *getMemInstValueForLoadHelper(MemIntrinsic *SrcInst, unsigned Offset,
Type *LoadTy, HelperClass &Helper,
const DataLayout &DL) {
LLVMContext &Ctx = LoadTy->getContext();
uint64_t LoadSize = DL.getTypeSizeInBits(LoadTy) / 8;
// We know that this method is only called when the mem transfer fully
// provides the bits for the load.
if (MemSetInst *MSI = dyn_cast<MemSetInst>(SrcInst)) {
// memset(P, 'x', 1234) -> splat('x'), even if x is a variable, and
// independently of what the offset is.
T *Val = cast<T>(MSI->getValue());
if (LoadSize != 1)
Val =
Helper.CreateZExtOrBitCast(Val, IntegerType::get(Ctx, LoadSize * 8));
T *OneElt = Val;
// Splat the value out to the right number of bits.
for (unsigned NumBytesSet = 1; NumBytesSet != LoadSize;) {
// If we can double the number of bytes set, do it.
if (NumBytesSet * 2 <= LoadSize) {
T *ShVal = Helper.CreateShl(
Val, ConstantInt::get(Val->getType(), NumBytesSet * 8));
Val = Helper.CreateOr(Val, ShVal);
NumBytesSet <<= 1;
continue;
}
// Otherwise insert one byte at a time.
T *ShVal = Helper.CreateShl(Val, ConstantInt::get(Val->getType(), 1 * 8));
Val = Helper.CreateOr(OneElt, ShVal);
++NumBytesSet;
}
return coerceAvailableValueToLoadTypeHelper(Val, LoadTy, Helper, DL);
}
// Otherwise, this is a memcpy/memmove from a constant global.
MemTransferInst *MTI = cast<MemTransferInst>(SrcInst);
Constant *Src = cast<Constant>(MTI->getSource());
unsigned AS = Src->getType()->getPointerAddressSpace();
// Otherwise, see if we can constant fold a load from the constant with the
// offset applied as appropriate.
Src =
ConstantExpr::getBitCast(Src, Type::getInt8PtrTy(Src->getContext(), AS));
Constant *OffsetCst =
ConstantInt::get(Type::getInt64Ty(Src->getContext()), (unsigned)Offset);
Src = ConstantExpr::getGetElementPtr(Type::getInt8Ty(Src->getContext()), Src,
OffsetCst);
Src = ConstantExpr::getBitCast(Src, PointerType::get(LoadTy, AS));
return ConstantFoldLoadFromConstPtr(Src, LoadTy, DL);
}
/// This function is called when we have a
/// memdep query of a load that ends up being a clobbering mem intrinsic.
Value *getMemInstValueForLoad(MemIntrinsic *SrcInst, unsigned Offset,
Type *LoadTy, Instruction *InsertPt,
const DataLayout &DL) {
IRBuilder<> Builder(InsertPt);
return getMemInstValueForLoadHelper<Value, IRBuilder<>>(SrcInst, Offset,
LoadTy, Builder, DL);
}
Constant *getConstantMemInstValueForLoad(MemIntrinsic *SrcInst, unsigned Offset,
Type *LoadTy, const DataLayout &DL) {
// The only case analyzeLoadFromClobberingMemInst cannot be converted to a
// constant is when it's a memset of a non-constant.
if (auto *MSI = dyn_cast<MemSetInst>(SrcInst))
if (!isa<Constant>(MSI->getValue()))
return nullptr;
ConstantFolder F;
return getMemInstValueForLoadHelper<Constant, ConstantFolder>(SrcInst, Offset,
LoadTy, F, DL);
}
} // namespace VNCoercion
} // namespace llvm
| {
"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 -%}
<li>{{ item.label }}</li>
{% endfor -%}
{{ item.sand == true and item.keyword == false ? 1 : 0 }}
{{ app.get(55, 1.2, true) }}
{% if app.get('_route') == ('_home') %}home{% endif %}
{% if app.session.flashbag.has('message') %}
{% for message in app.session.flashbag.get('message') %}
{{ message.content }}
{% endfor %}
{% endif %}
{{ path('_home', {'section': app.request.get('section')}) }}
{{ path('_home', {
'section': app.request.get('section'),
'boolean': true,
'number': 55.33
})
}}
{% include ('test.incl.html.twig') %}
</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 string) error {
c.setContentType(contentType)
c.writeHeader()
_, err := c.Write(b)
return err
}
///////////// RESPONSE RENDERING /////////////
func (c *ctx) Redirect(urlStr string) error {
if c.code < 300 || c.code > 308 {
return ErrInvalidRedirectStatusCode
}
http.Redirect(c, c.Request(), urlStr, c.code)
return nil
}
func (c *ctx) Reset() {
c.params = c.params[:0]
c.parent = context.Background()
c.req = nil
c.ResponseWriter = nil
c.code = 0
c.statusWritten = false
c.searchHistory = c.searchHistory[:0]
}
func (c *ctx) Remove(key string) {
i := c.indexOf(key)
if i < 0 {
panicl("Cannot remove unknown key '%s' from context", key)
}
c.params = append(c.params[:i], c.params[i+1:]...)
}
func (c *ctx) indexOf(key string) int {
for i := len(c.params) - 1; i >= 0; i-- {
if c.params[i].key == key {
return i
}
}
return -1
}
// C returns a Context based on a context.Context passed. If it does not convert to Context, it creates a new one with the context passed as argument.
func C(req *http.Request) Context {
c := req.Context()
if val := c.Value(ctxKey); val != nil {
if ctx, ok := val.(*ctx); ok {
return ctx
}
}
return nil
}
// Param returns the value of a url param base on the passed context
func Param(req *http.Request, key string) string {
return C(req).Param(key)
}
func setParamContext(req *http.Request, c *ctx) *http.Request {
c.parent = req.Context()
return req.WithContext(context.WithValue(req.Context(), ctxKey, c))
}
type parameter struct {
key string
val string
}
// HTTPError allows to write an error to http.ResponseWriter.
// You can use it with Context. Like in the following example:
// func(c lion.Context) {
// c.Error(lion.ErrorUnauthorized)
// }
// This will return a response with status code 401 and a body of "Unauthorized".
// Check below for the available http error
type HTTPError interface {
error
Status() int
}
var (
// 4xx
// ErrorBadRequest returns a BadRequest response with the corresponding body
ErrorBadRequest HTTPError = httpError{http.StatusBadRequest}
// ErrorUnauthorized returns a Unauthorized response with the corresponding body
ErrorUnauthorized HTTPError = httpError{http.StatusUnauthorized}
// ErrorForbidden returns a Forbidden response with the corresponding body
ErrorForbidden HTTPError = httpError{http.StatusForbidden}
// ErrorNotFound returns a NotFound response with the corresponding body
ErrorNotFound HTTPError = httpError{http.StatusNotFound}
// ErrorMethodNotAllowed returns a MethodNotAllowed response with the corresponding body
ErrorMethodNotAllowed HTTPError = httpError{http.StatusMethodNotAllowed}
// 5xx
// ErrorInternalServer returns a InternalServerError response with the corresponding body
ErrorInternalServer HTTPError = httpError{http.StatusInternalServerError}
)
type httpError struct{ code int }
func (e httpError) Error() string {
return http.StatusText(e.code)
}
func (e httpError) Status() int {
return e.code
}
| {
"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 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_getgrgid(struct nss_ops_ctx *nss_context,
gid_t gid, 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_getgrgid_timeout(gid, 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 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_getgrouplist(struct nss_ops_ctx *nss_context,
const char *name, gid_t group,
gid_t *groups, int *ngroups,
int *lerrno) {
int ret = 0;
if (nss_context == NULL) {
return NSS_STATUS_UNAVAIL;
}
ret = sss_nss_getgrouplist_timeout(name, group,
groups, ngroups,
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);
}
| {
"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><not set></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š <[email protected]>
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);
}
UnsignedInt AnySceneImporter::doAnimationCount() const { return _in->animationCount(); }
Int AnySceneImporter::doAnimationForName(const std::string& name) { return _in->animationForName(name); }
std::string AnySceneImporter::doAnimationName(const UnsignedInt id) { return _in->animationName(id); }
Containers::Optional<AnimationData> AnySceneImporter::doAnimation(const UnsignedInt id) { return _in->animation(id); }
Int AnySceneImporter::doDefaultScene() const { return _in->defaultScene(); }
UnsignedInt AnySceneImporter::doSceneCount() const { return _in->sceneCount(); }
Int AnySceneImporter::doSceneForName(const std::string& name) { return _in->sceneForName(name); }
std::string AnySceneImporter::doSceneName(const UnsignedInt id) { return _in->sceneName(id); }
Containers::Optional<SceneData> AnySceneImporter::doScene(const UnsignedInt id) { return _in->scene(id); }
UnsignedInt AnySceneImporter::doLightCount() const { return _in->lightCount(); }
Int AnySceneImporter::doLightForName(const std::string& name) { return _in->lightForName(name); }
std::string AnySceneImporter::doLightName(const UnsignedInt id) { return _in->lightName(id); }
Containers::Optional<LightData> AnySceneImporter::doLight(const UnsignedInt id) { return _in->light(id); }
UnsignedInt AnySceneImporter::doCameraCount() const { return _in->cameraCount(); }
Int AnySceneImporter::doCameraForName(const std::string& name) { return _in->cameraForName(name); }
std::string AnySceneImporter::doCameraName(const UnsignedInt id) { return _in->cameraName(id); }
Containers::Optional<CameraData> AnySceneImporter::doCamera(const UnsignedInt id) { return _in->camera(id); }
UnsignedInt AnySceneImporter::doObject2DCount() const { return _in->object2DCount(); }
Int AnySceneImporter::doObject2DForName(const std::string& name) { return _in->object2DForName(name); }
std::string AnySceneImporter::doObject2DName(const UnsignedInt id) { return _in->object2DName(id); }
Containers::Pointer<ObjectData2D> AnySceneImporter::doObject2D(const UnsignedInt id) { return _in->object2D(id); }
UnsignedInt AnySceneImporter::doObject3DCount() const { return _in->object3DCount(); }
Int AnySceneImporter::doObject3DForName(const std::string& name) { return _in->object3DForName(name); }
std::string AnySceneImporter::doObject3DName(const UnsignedInt id) { return _in->object3DName(id); }
Containers::Pointer<ObjectData3D> AnySceneImporter::doObject3D(const UnsignedInt id) { return _in->object3D(id); }
UnsignedInt AnySceneImporter::doSkin2DCount() const { return _in->skin2DCount(); }
Int AnySceneImporter::doSkin2DForName(const std::string& name) { return _in->skin2DForName(name); }
std::string AnySceneImporter::doSkin2DName(const UnsignedInt id) { return _in->skin2DName(id); }
Containers::Optional<SkinData2D> AnySceneImporter::doSkin2D(const UnsignedInt id) { return _in->skin2D(id); }
UnsignedInt AnySceneImporter::doSkin3DCount() const { return _in->skin3DCount(); }
Int AnySceneImporter::doSkin3DForName(const std::string& name) { return _in->skin3DForName(name); }
std::string AnySceneImporter::doSkin3DName(const UnsignedInt id) { return _in->skin3DName(id); }
Containers::Optional<SkinData3D> AnySceneImporter::doSkin3D(const UnsignedInt id) { return _in->skin3D(id); }
UnsignedInt AnySceneImporter::doMeshCount() const { return _in->meshCount(); }
Int AnySceneImporter::doMeshForName(const std::string& name) { return _in->meshForName(name); }
std::string AnySceneImporter::doMeshName(const UnsignedInt id) { return _in->meshName(id); }
Containers::Optional<MeshData> AnySceneImporter::doMesh(const UnsignedInt id, const UnsignedInt level) { return _in->mesh(id, level); }
MeshAttribute AnySceneImporter::doMeshAttributeForName(const std::string& name) { return _in->meshAttributeForName(name); }
std::string AnySceneImporter::doMeshAttributeName(const UnsignedShort id) { return _in->meshAttributeName(meshAttributeCustom(id)); }
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_IGNORE_DEPRECATED_PUSH
UnsignedInt AnySceneImporter::doMesh2DCount() const { return _in->mesh2DCount(); }
Int AnySceneImporter::doMesh2DForName(const std::string& name) { return _in->mesh2DForName(name); }
std::string AnySceneImporter::doMesh2DName(const UnsignedInt id) { return _in->mesh2DName(id); }
Containers::Optional<MeshData2D> AnySceneImporter::doMesh2D(const UnsignedInt id) { return _in->mesh2D(id); }
UnsignedInt AnySceneImporter::doMesh3DCount() const { return _in->mesh3DCount(); }
Int AnySceneImporter::doMesh3DForName(const std::string& name) { return _in->mesh3DForName(name); }
std::string AnySceneImporter::doMesh3DName(const UnsignedInt id) { return _in->mesh3DName(id); }
Containers::Optional<MeshData3D> AnySceneImporter::doMesh3D(const UnsignedInt id) { return _in->mesh3D(id); }
CORRADE_IGNORE_DEPRECATED_POP
#endif
UnsignedInt AnySceneImporter::doMaterialCount() const { return _in->materialCount(); }
Int AnySceneImporter::doMaterialForName(const std::string& name) { return _in->materialForName(name); }
std::string AnySceneImporter::doMaterialName(const UnsignedInt id) { return _in->materialName(id); }
Containers::Optional<MaterialData> AnySceneImporter::doMaterial(const UnsignedInt id) { return _in->material(id); }
UnsignedInt AnySceneImporter::doTextureCount() const { return _in->textureCount(); }
Int AnySceneImporter::doTextureForName(const std::string& name) { return _in->textureForName(name); }
std::string AnySceneImporter::doTextureName(const UnsignedInt id) { return _in->textureName(id); }
Containers::Optional<TextureData> AnySceneImporter::doTexture(const UnsignedInt id) { return _in->texture(id); }
UnsignedInt AnySceneImporter::doImage1DCount() const { return _in->image1DCount(); }
UnsignedInt AnySceneImporter::doImage1DLevelCount(UnsignedInt id) { return _in->image1DLevelCount(id); }
Int AnySceneImporter::doImage1DForName(const std::string& name) { return _in->image1DForName(name); }
std::string AnySceneImporter::doImage1DName(const UnsignedInt id) { return _in->image1DName(id); }
Containers::Optional<ImageData1D> AnySceneImporter::doImage1D(const UnsignedInt id, const UnsignedInt level) { return _in->image1D(id, level); }
UnsignedInt AnySceneImporter::doImage2DCount() const { return _in->image2DCount(); }
UnsignedInt AnySceneImporter::doImage2DLevelCount(UnsignedInt id) { return _in->image2DLevelCount(id); }
Int AnySceneImporter::doImage2DForName(const std::string& name) { return _in->image2DForName(name); }
std::string AnySceneImporter::doImage2DName(const UnsignedInt id) { return _in->image2DName(id); }
Containers::Optional<ImageData2D> AnySceneImporter::doImage2D(const UnsignedInt id, const UnsignedInt level) { return _in->image2D(id, level); }
UnsignedInt AnySceneImporter::doImage3DCount() const { return _in->image3DCount(); }
UnsignedInt AnySceneImporter::doImage3DLevelCount(UnsignedInt id) { return _in->image3DLevelCount(id); }
Int AnySceneImporter::doImage3DForName(const std::string& name) { return _in->image3DForName(name); }
std::string AnySceneImporter::doImage3DName(const UnsignedInt id) { return _in->image3DName(id); }
Containers::Optional<ImageData3D> AnySceneImporter::doImage3D(const UnsignedInt id, const UnsignedInt level) { return _in->image3D(id, level); }
}}
CORRADE_PLUGIN_REGISTER(AnySceneImporter, Magnum::Trade::AnySceneImporter,
"cz.mosra.magnum.Trade.AbstractImporter/0.3.3")
| {
"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:
- [email protected]
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":"[email protected]","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('[email protected]')
* ->setTo($form->email)
* ->setSubject($form->subject)
* ->setTextBody('Plain text content')
* ->setHtmlBody('<b>HTML content</b>')
* ->send();
* ```
*
* @see MailerInterface
*
* @author Paul Klimov <[email protected]>
* @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;
}
} else {
field.val(field.val() + code.char);
}
}
// then also trigger the 3rd event (up)
// a keydown of a modifier shouldn't also trigger a keyup until coded
if(code.type !== MODIFIER_BEGIN) {
field.trigger(keyUpEvent);
}
},
triggerCodesOnField = function(codes, field, delay, global) {
if(delay > 0) {
codes = codes.reverse();
var keyInterval = global.setInterval(function(){
var code = codes.pop();
triggerCodeOnField(code, field);
if(codes.length === 0) {
global.clearInterval(keyInterval);
field.trigger('autotyped');
}
}, delay);
} else {
$.each(codes,function(){
triggerCodeOnField(this, field);
});
field.trigger('autotyped');
}
};
$.fn.autotype = function(value, options) {
if(value === undefined || value === null) { throw("Value is required by jQuery.autotype plugin"); }
var settings = $.extend({}, $.fn.autotype.defaults, options);
// 1st Pass
// step through the input string and convert it into
// a logical sequence of steps, key, and charcodes to apply to the inputs
var codes = parseCodes(value, settings.keyCodes[settings.keyBoard]);
// 2nd Pass
// Run the translated codes against each input through a realistic
// and cancelable series of key down/press/up events
return this.each(function(){ triggerCodesOnField(codes, $(this), settings.delay, settings.global); });
};
$.fn.autotype.defaults = {
version: '0.5.0',
keyBoard: 'enUs',
delay: 0,
global: window,
keyCodes: {
enUs: { 'back':8,'ins':45,'del':46,'enter':13,'shift':16,'ctrl':17,'meta':224,
'alt':18,'pause':19,'caps':20,'esc':27,'pgup':33,'pgdn':34,
'end':35,'home':36,'left':37,'up':38,'right':39,'down':40,
'printscr':44,'num0':96,'num1':97,'num2':98,'num3':99,'num4':100,
'num5':101,'num6':102,'num7':103,'num8':104,'num9':105,
'multiply':106,'add':107,'subtract':109,'decimal':110,
'divide':111,'f1':112,'f2':113,'f3':114,'f4':115,'f5':116,
'f6':117,'f7':118,'f8':119,'f9':120,'f10':121,'f11':122,
'f12':123,'numlock':144,'scrolllock':145,' ':9,' ':32,
'tab':9,'space':32,'0':48,'1':49,'2':50,'3':51,'4':52,
'5':53,'6':54,'7':55,'8':56,'9':57,')':48,'!':49,'@':50,
'#':51,'$':52,'%':53,'^':54,'&':55,'*':56,'(':57,';':186,
'=':187,',':188,'-':189,'.':190,'/':191,'[':219,'\\':220,
']':221,"'":222,':':186,'+':187,'<':188,'_':189,'>':190,
'?':191,'{':219,'|':220,'}':221,'"':222,'a':65,'b':66,'c':67,
'd':68,'e':69,'f':70,'g':71,'h':72,'i':73,'j':74,'k':75,
'l':76,'m':77,'n':78,'o':79,'p':80,'q':81,'r':82,'s':83,
't':84,'u':85,'v':86,'w':87,'x':88,'y':89,'z':90,'A':65,
'B':66,'C':67,'D':68,'E':69,'F':70,'G':71,'H':72,'I':73,
'J':74,'K':75,'L':76,'M':77,'N':78,'O':79,'P':80,'Q':81,
'R':82,'S':83,'T':84,'U':85,'V':86,'W':87,'X':88,'Y':89,'Z':90 }
}
};
})(jQuery);
| {
"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`` the number
of required eigenvalues (smallest or largest).
The LOBPCG code internally solves eigenproblems of the size 3``m`` on every
iteration by calling the "standard" dense eigensolver, so if ``m`` is not
small enough compared to ``n``, it does not make sense to call the LOBPCG
code, but rather one should use the "standard" eigensolver,
e.g. numpy or scipy function in this case.
If one calls the LOBPCG algorithm for 5``m``>``n``,
it will most likely break internally, so the code tries to call the standard
function instead.
It is not that n should be large for the LOBPCG to work, but rather the
ratio ``n``/``m`` should be large. It you call the LOBPCG code with ``m``=1
and ``n``=10, it should work, though ``n`` is small. The method is intended
for extremely large ``n``/``m``, see e.g., reference [28] in
http://arxiv.org/abs/0705.2626
The convergence speed depends basically on two factors:
1. How well relatively separated the seeking eigenvalues are
from the rest of the eigenvalues.
One can try to vary ``m`` to make this better.
2. How well conditioned the problem is. This can be changed by using proper
preconditioning. For example, a rod vibration test problem (under tests
directory) is ill-conditioned for large ``n``, so convergence will be
slow, unless efficient preconditioning is used.
For this specific problem, a good simple preconditioner function would
be a linear solve for A, which is easy to code since A is tridiagonal.
*Acknowledgements*
lobpcg.py code was written by Robert Cimrman.
Many thanks belong to Andrew Knyazev, the author of the algorithm,
for lots of advice and support.
References
----------
.. [1] A. V. Knyazev (2001),
Toward the Optimal Preconditioned Eigensolver: Locally Optimal
Block Preconditioned Conjugate Gradient Method.
SIAM Journal on Scientific Computing 23, no. 2,
pp. 517-541. http://dx.doi.org/10.1137/S1064827500366124
.. [2] A. V. Knyazev, I. Lashuk, M. E. Argentati, and E. Ovchinnikov (2007),
Block Locally Optimal Preconditioned Eigenvalue Xolvers (BLOPEX)
in hypre and PETSc. http://arxiv.org/abs/0705.2626
.. [3] A. V. Knyazev's C and MATLAB implementations:
http://www-math.cudenver.edu/~aknyazev/software/BLOPEX/
"""
blockVectorX = X
blockVectorY = Y
residualTolerance = tol
maxIterations = maxiter
if blockVectorY is not None:
sizeY = blockVectorY.shape[1]
else:
sizeY = 0
# Block size.
if len(blockVectorX.shape) != 2:
raise ValueError('expected rank-2 array for argument X')
n, sizeX = blockVectorX.shape
if sizeX > n:
raise ValueError('X column dimension exceeds the row dimension')
A = _makeOperator(A, (n,n))
B = _makeOperator(B, (n,n))
M = _makeOperator(M, (n,n))
if (n - sizeY) < (5 * sizeX):
# warn('The problem size is small compared to the block size.' \
# ' Using dense eigensolver instead of LOBPCG.')
if blockVectorY is not None:
raise NotImplementedError('The dense eigensolver '
'does not support constraints.')
# Define the closed range of indices of eigenvalues to return.
if largest:
eigvals = (n - sizeX, n-1)
else:
eigvals = (0, sizeX-1)
A_dense = A(np.eye(n))
B_dense = None if B is None else B(np.eye(n))
return eigh(A_dense, B_dense, eigvals=eigvals, check_finite=False)
if residualTolerance is None:
residualTolerance = np.sqrt(1e-15) * n
maxIterations = min(n, maxIterations)
if verbosityLevel:
aux = "Solving "
if B is None:
aux += "standard"
else:
aux += "generalized"
aux += " eigenvalue problem with"
if M is None:
aux += "out"
aux += " preconditioning\n\n"
aux += "matrix size %d\n" % n
aux += "block size %d\n\n" % sizeX
if blockVectorY is None:
aux += "No constraints\n\n"
else:
if sizeY > 1:
aux += "%d constraints\n\n" % sizeY
else:
aux += "%d constraint\n\n" % sizeY
print(aux)
##
# Apply constraints to X.
if blockVectorY is not None:
if B is not None:
blockVectorBY = B(blockVectorY)
else:
blockVectorBY = blockVectorY
# gramYBY is a dense array.
gramYBY = np.dot(blockVectorY.T, blockVectorBY)
try:
# gramYBY is a Cholesky factor from now on...
gramYBY = cho_factor(gramYBY)
except:
raise ValueError('cannot handle linearly dependent constraints')
_applyConstraints(blockVectorX, gramYBY, blockVectorBY, blockVectorY)
##
# B-orthonormalize X.
blockVectorX, blockVectorBX = _b_orthonormalize(B, blockVectorX)
##
# Compute the initial Ritz vectors: solve the eigenproblem.
blockVectorAX = A(blockVectorX)
gramXAX = np.dot(blockVectorX.T, blockVectorAX)
_lambda, eigBlockVector = eigh(gramXAX, check_finite=False)
ii = np.argsort(_lambda)[:sizeX]
if largest:
ii = ii[::-1]
_lambda = _lambda[ii]
eigBlockVector = np.asarray(eigBlockVector[:,ii])
blockVectorX = np.dot(blockVectorX, eigBlockVector)
blockVectorAX = np.dot(blockVectorAX, eigBlockVector)
if B is not None:
blockVectorBX = np.dot(blockVectorBX, eigBlockVector)
##
# Active index set.
activeMask = np.ones((sizeX,), dtype=bool)
lambdaHistory = [_lambda]
residualNormsHistory = []
previousBlockSize = sizeX
ident = np.eye(sizeX, dtype=A.dtype)
ident0 = np.eye(sizeX, dtype=A.dtype)
##
# Main iteration loop.
blockVectorP = None # set during iteration
blockVectorAP = None
blockVectorBP = None
for iterationNumber in xrange(maxIterations):
if verbosityLevel > 0:
print('iteration %d' % iterationNumber)
aux = blockVectorBX * _lambda[np.newaxis,:]
blockVectorR = blockVectorAX - aux
aux = np.sum(blockVectorR.conjugate() * blockVectorR, 0)
residualNorms = np.sqrt(aux)
residualNormsHistory.append(residualNorms)
ii = np.where(residualNorms > residualTolerance, True, False)
activeMask = activeMask & ii
if verbosityLevel > 2:
print(activeMask)
currentBlockSize = activeMask.sum()
if currentBlockSize != previousBlockSize:
previousBlockSize = currentBlockSize
ident = np.eye(currentBlockSize, dtype=A.dtype)
if currentBlockSize == 0:
break
if verbosityLevel > 0:
print('current block size:', currentBlockSize)
print('eigenvalue:', _lambda)
print('residual norms:', residualNorms)
if verbosityLevel > 10:
print(eigBlockVector)
activeBlockVectorR = as2d(blockVectorR[:,activeMask])
if iterationNumber > 0:
activeBlockVectorP = as2d(blockVectorP[:,activeMask])
activeBlockVectorAP = as2d(blockVectorAP[:,activeMask])
activeBlockVectorBP = as2d(blockVectorBP[:,activeMask])
if M is not None:
# Apply preconditioner T to the active residuals.
activeBlockVectorR = M(activeBlockVectorR)
##
# Apply constraints to the preconditioned residuals.
if blockVectorY is not None:
_applyConstraints(activeBlockVectorR,
gramYBY, blockVectorBY, blockVectorY)
##
# B-orthonormalize the preconditioned residuals.
aux = _b_orthonormalize(B, activeBlockVectorR)
activeBlockVectorR, activeBlockVectorBR = aux
activeBlockVectorAR = A(activeBlockVectorR)
if iterationNumber > 0:
aux = _b_orthonormalize(B, activeBlockVectorP,
activeBlockVectorBP, retInvR=True)
activeBlockVectorP, activeBlockVectorBP, invR = aux
activeBlockVectorAP = np.dot(activeBlockVectorAP, invR)
##
# Perform the Rayleigh Ritz Procedure:
# Compute symmetric Gram matrices:
xaw = np.dot(blockVectorX.T, activeBlockVectorAR)
waw = np.dot(activeBlockVectorR.T, activeBlockVectorAR)
xbw = np.dot(blockVectorX.T, activeBlockVectorBR)
if iterationNumber > 0:
xap = np.dot(blockVectorX.T, activeBlockVectorAP)
wap = np.dot(activeBlockVectorR.T, activeBlockVectorAP)
pap = np.dot(activeBlockVectorP.T, activeBlockVectorAP)
xbp = np.dot(blockVectorX.T, activeBlockVectorBP)
wbp = np.dot(activeBlockVectorR.T, activeBlockVectorBP)
gramA = np.bmat([[np.diag(_lambda), xaw, xap],
[xaw.T, waw, wap],
[xap.T, wap.T, pap]])
gramB = np.bmat([[ident0, xbw, xbp],
[xbw.T, ident, wbp],
[xbp.T, wbp.T, ident]])
else:
gramA = np.bmat([[np.diag(_lambda), xaw],
[xaw.T, waw]])
gramB = np.bmat([[ident0, xbw],
[xbw.T, ident]])
_assert_symmetric(gramA)
_assert_symmetric(gramB)
if verbosityLevel > 10:
save(gramA, 'gramA')
save(gramB, 'gramB')
# Solve the generalized eigenvalue problem.
_lambda, eigBlockVector = eigh(gramA, gramB, check_finite=False)
ii = np.argsort(_lambda)[:sizeX]
if largest:
ii = ii[::-1]
if verbosityLevel > 10:
print(ii)
_lambda = _lambda[ii].astype(np.float64)
eigBlockVector = np.asarray(eigBlockVector[:,ii].astype(np.float64))
lambdaHistory.append(_lambda)
if verbosityLevel > 10:
print('lambda:', _lambda)
## # Normalize eigenvectors!
## aux = np.sum( eigBlockVector.conjugate() * eigBlockVector, 0 )
## eigVecNorms = np.sqrt( aux )
## eigBlockVector = eigBlockVector / eigVecNorms[np.newaxis,:]
# eigBlockVector, aux = _b_orthonormalize( B, eigBlockVector )
if verbosityLevel > 10:
print(eigBlockVector)
pause()
##
# Compute Ritz vectors.
if iterationNumber > 0:
eigBlockVectorX = eigBlockVector[:sizeX]
eigBlockVectorR = eigBlockVector[sizeX:sizeX+currentBlockSize]
eigBlockVectorP = eigBlockVector[sizeX+currentBlockSize:]
pp = np.dot(activeBlockVectorR, eigBlockVectorR)
pp += np.dot(activeBlockVectorP, eigBlockVectorP)
app = np.dot(activeBlockVectorAR, eigBlockVectorR)
app += np.dot(activeBlockVectorAP, eigBlockVectorP)
bpp = np.dot(activeBlockVectorBR, eigBlockVectorR)
bpp += np.dot(activeBlockVectorBP, eigBlockVectorP)
else:
eigBlockVectorX = eigBlockVector[:sizeX]
eigBlockVectorR = eigBlockVector[sizeX:]
pp = np.dot(activeBlockVectorR, eigBlockVectorR)
app = np.dot(activeBlockVectorAR, eigBlockVectorR)
bpp = np.dot(activeBlockVectorBR, eigBlockVectorR)
if verbosityLevel > 10:
print(pp)
print(app)
print(bpp)
pause()
blockVectorX = np.dot(blockVectorX, eigBlockVectorX) + pp
blockVectorAX = np.dot(blockVectorAX, eigBlockVectorX) + app
blockVectorBX = np.dot(blockVectorBX, eigBlockVectorX) + bpp
blockVectorP, blockVectorAP, blockVectorBP = pp, app, bpp
aux = blockVectorBX * _lambda[np.newaxis,:]
blockVectorR = blockVectorAX - aux
aux = np.sum(blockVectorR.conjugate() * blockVectorR, 0)
residualNorms = np.sqrt(aux)
if verbosityLevel > 0:
print('final eigenvalue:', _lambda)
print('final residual norms:', residualNorms)
if retLambdaHistory:
if retResidualNormsHistory:
return _lambda, blockVectorX, lambdaHistory, residualNormsHistory
else:
return _lambda, blockVectorX, lambdaHistory
else:
if retResidualNormsHistory:
return _lambda, blockVectorX, residualNormsHistory
else:
return _lambda, blockVectorX
| {
"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_name(str, name, nlen))
return 1;
}
return 0;
}
static void au_shwh_init_wh(struct au_vdir_wh *wh, ino_t ino,
unsigned char d_type)
{
#ifdef CONFIG_AUFS_SHWH
wh->wh_ino = ino;
wh->wh_type = d_type;
#endif
}
/* ---------------------------------------------------------------------- */
int au_nhash_append_wh(struct au_nhash *whlist, char *name, int nlen, ino_t ino,
unsigned int d_type, aufs_bindex_t bindex,
unsigned char shwh)
{
int err;
struct au_vdir_destr *str;
struct au_vdir_wh *wh;
AuDbg("%.*s\n", nlen, name);
AuDebugOn(!whlist->nh_num || !whlist->nh_head);
err = -ENOMEM;
wh = kmalloc(sizeof(*wh) + nlen, GFP_NOFS);
if (unlikely(!wh))
goto out;
err = 0;
wh->wh_bindex = bindex;
if (shwh)
au_shwh_init_wh(wh, ino, d_type);
str = &wh->wh_str;
str->len = nlen;
memcpy(str->name, name, nlen);
hlist_add_head(&wh->wh_hash, au_name_hash(whlist, name, nlen));
/* smp_mb(); */
out:
return err;
}
static int append_deblk(struct au_vdir *vdir)
{
int err;
unsigned long ul;
const unsigned int deblk_sz = vdir->vd_deblk_sz;
union au_vdir_deblk_p p, deblk_end;
unsigned char **o;
err = -ENOMEM;
o = au_krealloc(vdir->vd_deblk, sizeof(*o) * (vdir->vd_nblk + 1),
GFP_NOFS, /*may_shrink*/0);
if (unlikely(!o))
goto out;
vdir->vd_deblk = o;
p.deblk = kmalloc(deblk_sz, GFP_NOFS);
if (p.deblk) {
ul = vdir->vd_nblk++;
vdir->vd_deblk[ul] = p.deblk;
vdir->vd_last.ul = ul;
vdir->vd_last.p.deblk = p.deblk;
deblk_end.deblk = p.deblk + deblk_sz;
err = set_deblk_end(&p, &deblk_end);
}
out:
return err;
}
static int append_de(struct au_vdir *vdir, char *name, int nlen, ino_t ino,
unsigned int d_type, struct au_nhash *delist)
{
int err;
unsigned int sz;
const unsigned int deblk_sz = vdir->vd_deblk_sz;
union au_vdir_deblk_p p, *room, deblk_end;
struct au_vdir_dehstr *dehstr;
p.deblk = last_deblk(vdir);
deblk_end.deblk = p.deblk + deblk_sz;
room = &vdir->vd_last.p;
AuDebugOn(room->deblk < p.deblk || deblk_end.deblk <= room->deblk
|| !is_deblk_end(room, &deblk_end));
sz = calc_size(nlen);
if (unlikely(sz > deblk_end.deblk - room->deblk)) {
err = append_deblk(vdir);
if (unlikely(err))
goto out;
p.deblk = last_deblk(vdir);
deblk_end.deblk = p.deblk + deblk_sz;
/* smp_mb(); */
AuDebugOn(room->deblk != p.deblk);
}
err = -ENOMEM;
dehstr = au_cache_alloc_vdir_dehstr();
if (unlikely(!dehstr))
goto out;
dehstr->str = &room->de->de_str;
hlist_add_head(&dehstr->hash, au_name_hash(delist, name, nlen));
room->de->de_ino = ino;
room->de->de_type = d_type;
room->de->de_str.len = nlen;
memcpy(room->de->de_str.name, name, nlen);
err = 0;
room->deblk += sz;
if (unlikely(set_deblk_end(room, &deblk_end)))
err = append_deblk(vdir);
/* smp_mb(); */
out:
return err;
}
/* ---------------------------------------------------------------------- */
void au_vdir_free(struct au_vdir *vdir)
{
unsigned char **deblk;
deblk = vdir->vd_deblk;
while (vdir->vd_nblk--)
au_kfree_try_rcu(*deblk++);
au_kfree_try_rcu(vdir->vd_deblk);
au_cache_free_vdir(vdir);
}
static struct au_vdir *alloc_vdir(struct file *file)
{
struct au_vdir *vdir;
struct super_block *sb;
int err;
sb = file->f_path.dentry->d_sb;
SiMustAnyLock(sb);
err = -ENOMEM;
vdir = au_cache_alloc_vdir();
if (unlikely(!vdir))
goto out;
vdir->vd_deblk = kzalloc(sizeof(*vdir->vd_deblk), GFP_NOFS);
if (unlikely(!vdir->vd_deblk))
goto out_free;
vdir->vd_deblk_sz = au_sbi(sb)->si_rdblk;
if (!vdir->vd_deblk_sz) {
/* estimate the appropriate size for deblk */
vdir->vd_deblk_sz = au_dir_size(file, /*dentry*/NULL);
/* pr_info("vd_deblk_sz %u\n", vdir->vd_deblk_sz); */
}
vdir->vd_nblk = 0;
vdir->vd_version = 0;
vdir->vd_jiffy = 0;
err = append_deblk(vdir);
if (!err)
return vdir; /* success */
au_kfree_try_rcu(vdir->vd_deblk);
out_free:
au_cache_free_vdir(vdir);
out:
vdir = ERR_PTR(err);
return vdir;
}
static int reinit_vdir(struct au_vdir *vdir)
{
int err;
union au_vdir_deblk_p p, deblk_end;
while (vdir->vd_nblk > 1) {
au_kfree_try_rcu(vdir->vd_deblk[vdir->vd_nblk - 1]);
/* vdir->vd_deblk[vdir->vd_nblk - 1] = NULL; */
vdir->vd_nblk--;
}
p.deblk = vdir->vd_deblk[0];
deblk_end.deblk = p.deblk + vdir->vd_deblk_sz;
err = set_deblk_end(&p, &deblk_end);
/* keep vd_dblk_sz */
vdir->vd_last.ul = 0;
vdir->vd_last.p.deblk = vdir->vd_deblk[0];
vdir->vd_version = 0;
vdir->vd_jiffy = 0;
/* smp_mb(); */
return err;
}
/* ---------------------------------------------------------------------- */
#define AuFillVdir_CALLED 1
#define AuFillVdir_WHABLE (1 << 1)
#define AuFillVdir_SHWH (1 << 2)
#define au_ftest_fillvdir(flags, name) ((flags) & AuFillVdir_##name)
#define au_fset_fillvdir(flags, name) \
do { (flags) |= AuFillVdir_##name; } while (0)
#define au_fclr_fillvdir(flags, name) \
do { (flags) &= ~AuFillVdir_##name; } while (0)
#ifndef CONFIG_AUFS_SHWH
#undef AuFillVdir_SHWH
#define AuFillVdir_SHWH 0
#endif
struct fillvdir_arg {
struct dir_context ctx;
struct file *file;
struct au_vdir *vdir;
struct au_nhash delist;
struct au_nhash whlist;
aufs_bindex_t bindex;
unsigned int flags;
int err;
};
static int fillvdir(struct dir_context *ctx, const char *__name, int nlen,
loff_t offset __maybe_unused, u64 h_ino,
unsigned int d_type)
{
struct fillvdir_arg *arg = container_of(ctx, struct fillvdir_arg, ctx);
char *name = (void *)__name;
struct super_block *sb;
ino_t ino;
const unsigned char shwh = !!au_ftest_fillvdir(arg->flags, SHWH);
arg->err = 0;
sb = arg->file->f_path.dentry->d_sb;
au_fset_fillvdir(arg->flags, CALLED);
/* smp_mb(); */
if (nlen <= AUFS_WH_PFX_LEN
|| memcmp(name, AUFS_WH_PFX, AUFS_WH_PFX_LEN)) {
if (test_known(&arg->delist, name, nlen)
|| au_nhash_test_known_wh(&arg->whlist, name, nlen))
goto out; /* already exists or whiteouted */
arg->err = au_ino(sb, arg->bindex, h_ino, d_type, &ino);
if (!arg->err) {
if (unlikely(nlen > AUFS_MAX_NAMELEN))
d_type = DT_UNKNOWN;
arg->err = append_de(arg->vdir, name, nlen, ino,
d_type, &arg->delist);
}
} else if (au_ftest_fillvdir(arg->flags, WHABLE)) {
name += AUFS_WH_PFX_LEN;
nlen -= AUFS_WH_PFX_LEN;
if (au_nhash_test_known_wh(&arg->whlist, name, nlen))
goto out; /* already whiteouted */
ino = 0; /* just to suppress a warning */
if (shwh)
arg->err = au_wh_ino(sb, arg->bindex, h_ino, d_type,
&ino);
if (!arg->err) {
if (nlen <= AUFS_MAX_NAMELEN + AUFS_WH_PFX_LEN)
d_type = DT_UNKNOWN;
arg->err = au_nhash_append_wh
(&arg->whlist, name, nlen, ino, d_type,
arg->bindex, shwh);
}
}
out:
if (!arg->err)
arg->vdir->vd_jiffy = jiffies;
/* smp_mb(); */
AuTraceErr(arg->err);
return arg->err;
}
static int au_handle_shwh(struct super_block *sb, struct au_vdir *vdir,
struct au_nhash *whlist, struct au_nhash *delist)
{
#ifdef CONFIG_AUFS_SHWH
int err;
unsigned int nh, u;
struct hlist_head *head;
struct au_vdir_wh *pos;
struct hlist_node *n;
char *p, *o;
struct au_vdir_destr *destr;
AuDebugOn(!au_opt_test(au_mntflags(sb), SHWH));
err = -ENOMEM;
o = p = (void *)__get_free_page(GFP_NOFS);
if (unlikely(!p))
goto out;
err = 0;
nh = whlist->nh_num;
memcpy(p, AUFS_WH_PFX, AUFS_WH_PFX_LEN);
p += AUFS_WH_PFX_LEN;
for (u = 0; u < nh; u++) {
head = whlist->nh_head + u;
hlist_for_each_entry_safe(pos, n, head, wh_hash) {
destr = &pos->wh_str;
memcpy(p, destr->name, destr->len);
err = append_de(vdir, o, destr->len + AUFS_WH_PFX_LEN,
pos->wh_ino, pos->wh_type, delist);
if (unlikely(err))
break;
}
}
free_page((unsigned long)o);
out:
AuTraceErr(err);
return err;
#else
return 0;
#endif
}
static int au_do_read_vdir(struct fillvdir_arg *arg)
{
int err;
unsigned int rdhash;
loff_t offset;
aufs_bindex_t bbot, bindex, btop;
unsigned char shwh;
struct file *hf, *file;
struct super_block *sb;
file = arg->file;
sb = file->f_path.dentry->d_sb;
SiMustAnyLock(sb);
rdhash = au_sbi(sb)->si_rdhash;
if (!rdhash)
rdhash = au_rdhash_est(au_dir_size(file, /*dentry*/NULL));
err = au_nhash_alloc(&arg->delist, rdhash, GFP_NOFS);
if (unlikely(err))
goto out;
err = au_nhash_alloc(&arg->whlist, rdhash, GFP_NOFS);
if (unlikely(err))
goto out_delist;
err = 0;
arg->flags = 0;
shwh = 0;
if (au_opt_test(au_mntflags(sb), SHWH)) {
shwh = 1;
au_fset_fillvdir(arg->flags, SHWH);
}
btop = au_fbtop(file);
bbot = au_fbbot_dir(file);
for (bindex = btop; !err && bindex <= bbot; bindex++) {
hf = au_hf_dir(file, bindex);
if (!hf)
continue;
offset = vfsub_llseek(hf, 0, SEEK_SET);
err = offset;
if (unlikely(offset))
break;
arg->bindex = bindex;
au_fclr_fillvdir(arg->flags, WHABLE);
if (shwh
|| (bindex != bbot
&& au_br_whable(au_sbr_perm(sb, bindex))))
au_fset_fillvdir(arg->flags, WHABLE);
do {
arg->err = 0;
au_fclr_fillvdir(arg->flags, CALLED);
/* smp_mb(); */
err = vfsub_iterate_dir(hf, &arg->ctx);
if (err >= 0)
err = arg->err;
} while (!err && au_ftest_fillvdir(arg->flags, CALLED));
/*
* dir_relax() may be good for concurrency, but aufs should not
* use it since it will cause a lockdep problem.
*/
}
if (!err && shwh)
err = au_handle_shwh(sb, arg->vdir, &arg->whlist, &arg->delist);
au_nhash_wh_free(&arg->whlist);
out_delist:
au_nhash_de_free(&arg->delist);
out:
return err;
}
static int read_vdir(struct file *file, int may_read)
{
int err;
unsigned long expire;
unsigned char do_read;
struct fillvdir_arg arg = {
.ctx = {
.actor = fillvdir
}
};
struct inode *inode;
struct au_vdir *vdir, *allocated;
err = 0;
inode = file_inode(file);
IMustLock(inode);
IiMustWriteLock(inode);
SiMustAnyLock(inode->i_sb);
allocated = NULL;
do_read = 0;
expire = au_sbi(inode->i_sb)->si_rdcache;
vdir = au_ivdir(inode);
if (!vdir) {
do_read = 1;
vdir = alloc_vdir(file);
err = PTR_ERR(vdir);
if (IS_ERR(vdir))
goto out;
err = 0;
allocated = vdir;
} else if (may_read
&& (!inode_eq_iversion(inode, vdir->vd_version)
|| time_after(jiffies, vdir->vd_jiffy + expire))) {
do_read = 1;
err = reinit_vdir(vdir);
if (unlikely(err))
goto out;
}
if (!do_read)
return 0; /* success */
arg.file = file;
arg.vdir = vdir;
err = au_do_read_vdir(&arg);
if (!err) {
/* file->f_pos = 0; */ /* todo: ctx->pos? */
vdir->vd_version = inode_query_iversion(inode);
vdir->vd_last.ul = 0;
vdir->vd_last.p.deblk = vdir->vd_deblk[0];
if (allocated)
au_set_ivdir(inode, allocated);
} else if (allocated)
au_vdir_free(allocated);
out:
return err;
}
static int copy_vdir(struct au_vdir *tgt, struct au_vdir *src)
{
int err, rerr;
unsigned long ul, n;
const unsigned int deblk_sz = src->vd_deblk_sz;
AuDebugOn(tgt->vd_nblk != 1);
err = -ENOMEM;
if (tgt->vd_nblk < src->vd_nblk) {
unsigned char **p;
p = au_krealloc(tgt->vd_deblk, sizeof(*p) * src->vd_nblk,
GFP_NOFS, /*may_shrink*/0);
if (unlikely(!p))
goto out;
tgt->vd_deblk = p;
}
if (tgt->vd_deblk_sz != deblk_sz) {
unsigned char *p;
tgt->vd_deblk_sz = deblk_sz;
p = au_krealloc(tgt->vd_deblk[0], deblk_sz, GFP_NOFS,
/*may_shrink*/1);
if (unlikely(!p))
goto out;
tgt->vd_deblk[0] = p;
}
memcpy(tgt->vd_deblk[0], src->vd_deblk[0], deblk_sz);
tgt->vd_version = src->vd_version;
tgt->vd_jiffy = src->vd_jiffy;
n = src->vd_nblk;
for (ul = 1; ul < n; ul++) {
tgt->vd_deblk[ul] = kmemdup(src->vd_deblk[ul], deblk_sz,
GFP_NOFS);
if (unlikely(!tgt->vd_deblk[ul]))
goto out;
tgt->vd_nblk++;
}
tgt->vd_nblk = n;
tgt->vd_last.ul = tgt->vd_last.ul;
tgt->vd_last.p.deblk = tgt->vd_deblk[tgt->vd_last.ul];
tgt->vd_last.p.deblk += src->vd_last.p.deblk
- src->vd_deblk[src->vd_last.ul];
/* smp_mb(); */
return 0; /* success */
out:
rerr = reinit_vdir(tgt);
BUG_ON(rerr);
return err;
}
int au_vdir_init(struct file *file)
{
int err;
struct inode *inode;
struct au_vdir *vdir_cache, *allocated;
/* test file->f_pos here instead of ctx->pos */
err = read_vdir(file, !file->f_pos);
if (unlikely(err))
goto out;
allocated = NULL;
vdir_cache = au_fvdir_cache(file);
if (!vdir_cache) {
vdir_cache = alloc_vdir(file);
err = PTR_ERR(vdir_cache);
if (IS_ERR(vdir_cache))
goto out;
allocated = vdir_cache;
} else if (!file->f_pos && vdir_cache->vd_version != file->f_version) {
/* test file->f_pos here instead of ctx->pos */
err = reinit_vdir(vdir_cache);
if (unlikely(err))
goto out;
} else
return 0; /* success */
inode = file_inode(file);
err = copy_vdir(vdir_cache, au_ivdir(inode));
if (!err) {
file->f_version = inode_query_iversion(inode);
if (allocated)
au_set_fvdir_cache(file, allocated);
} else if (allocated)
au_vdir_free(allocated);
out:
return err;
}
static loff_t calc_offset(struct au_vdir *vdir)
{
loff_t offset;
union au_vdir_deblk_p p;
p.deblk = vdir->vd_deblk[vdir->vd_last.ul];
offset = vdir->vd_last.p.deblk - p.deblk;
offset += vdir->vd_deblk_sz * vdir->vd_last.ul;
return offset;
}
/* returns true or false */
static int seek_vdir(struct file *file, struct dir_context *ctx)
{
int valid;
unsigned int deblk_sz;
unsigned long ul, n;
loff_t offset;
union au_vdir_deblk_p p, deblk_end;
struct au_vdir *vdir_cache;
valid = 1;
vdir_cache = au_fvdir_cache(file);
offset = calc_offset(vdir_cache);
AuDbg("offset %lld\n", offset);
if (ctx->pos == offset)
goto out;
vdir_cache->vd_last.ul = 0;
vdir_cache->vd_last.p.deblk = vdir_cache->vd_deblk[0];
if (!ctx->pos)
goto out;
valid = 0;
deblk_sz = vdir_cache->vd_deblk_sz;
ul = div64_u64(ctx->pos, deblk_sz);
AuDbg("ul %lu\n", ul);
if (ul >= vdir_cache->vd_nblk)
goto out;
n = vdir_cache->vd_nblk;
for (; ul < n; ul++) {
p.deblk = vdir_cache->vd_deblk[ul];
deblk_end.deblk = p.deblk + deblk_sz;
offset = ul;
offset *= deblk_sz;
while (!is_deblk_end(&p, &deblk_end) && offset < ctx->pos) {
unsigned int l;
l = calc_size(p.de->de_str.len);
offset += l;
p.deblk += l;
}
if (!is_deblk_end(&p, &deblk_end)) {
valid = 1;
vdir_cache->vd_last.ul = ul;
vdir_cache->vd_last.p = p;
break;
}
}
out:
/* smp_mb(); */
if (!valid)
AuDbg("valid %d\n", !valid);
return valid;
}
int au_vdir_fill_de(struct file *file, struct dir_context *ctx)
{
unsigned int l, deblk_sz;
union au_vdir_deblk_p deblk_end;
struct au_vdir *vdir_cache;
struct au_vdir_de *de;
if (!seek_vdir(file, ctx))
return 0;
vdir_cache = au_fvdir_cache(file);
deblk_sz = vdir_cache->vd_deblk_sz;
while (1) {
deblk_end.deblk = vdir_cache->vd_deblk[vdir_cache->vd_last.ul];
deblk_end.deblk += deblk_sz;
while (!is_deblk_end(&vdir_cache->vd_last.p, &deblk_end)) {
de = vdir_cache->vd_last.p.de;
AuDbg("%.*s, off%lld, i%lu, dt%d\n",
de->de_str.len, de->de_str.name, ctx->pos,
(unsigned long)de->de_ino, de->de_type);
if (unlikely(!dir_emit(ctx, de->de_str.name,
de->de_str.len, de->de_ino,
de->de_type))) {
/* todo: ignore the error caused by udba? */
/* return err; */
return 0;
}
l = calc_size(de->de_str.len);
vdir_cache->vd_last.p.deblk += l;
ctx->pos += l;
}
if (vdir_cache->vd_last.ul < vdir_cache->vd_nblk - 1) {
vdir_cache->vd_last.ul++;
vdir_cache->vd_last.p.deblk
= vdir_cache->vd_deblk[vdir_cache->vd_last.ul];
ctx->pos = deblk_sz * vdir_cache->vd_last.ul;
continue;
}
break;
}
/* smp_mb(); */
return 0;
}
| {
"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 [email protected] 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::max(1.e-3,a*pow(1.-1./(9.*a)-x/(3.*sqrt(a)),3));
} else {
t = 1.0 - a*(0.253+a*0.12);
if (p < t) x = pow(p/t,1./a);
else x = 1.-log(1.-(p-t)/(1.-t));
}
for (j=0;j<12;j++) {
if (x <= 0.0) return 0.0;
err = gammp(a,x) - p;
if (a > 1.) t = afac*exp(-(x-a1)+a1*(log(x)-lna1));
else t = exp(-x+a1*log(x)-gln);
u = err/t;
x -= (t = u/(1.-0.5*std::min(1.,u*((a-1.)/x - 1))));
if (x <= 0.) x = 0.5*(x + t);
if (fabs(t) < EPS*x ) break;
}
return x;
}
const double Gamma::EPS = std::numeric_limits<double>::epsilon();
const double Gamma::FPMIN = std::numeric_limits<double>::min()/EPS;
/*
//in .h now
struct Chisqdist : Gamma {
double nu,fac;
Chisqdist(double nnu) : nu(nnu) {
fac = 0.693147180559945309*(0.5*nu)+gammln(0.5*nu);
}
double p(double x2) {
if (x2 <= 0.) throw("bad x2 in Chisqdist");
return exp(-0.5*(x2-(nu-2.)*log(x2))-fac);
}
double cdf(double x2) {
if (x2 < 0.) throw("bad x2 in Chisqdist");
return gammp(0.5*nu,0.5*x2);
}
double invcdf(double p) {
if (p < 0. || p >= 1.) throw("bad p in Chisqdist");
return 2.*invgammp(p,0.5*nu);
}
};
*/
#ifdef __WITH_MAIN__
int main(int argc, char **argv){
fprintf(stderr,"Thorfinn chisquare function\n------------------\n");
double df;
std::cout << "Type degrees of freedom"<<std::endl;
std::cin >> df;
assert(df>0);
int type =0;
std::cout << "Type 1-3.\n\t1: density (R::dchisq)\n\t2: cdf (R::pchisq)\n\t3: invcdf (R::qchisq)"<<std::endl;
std::cin>>type;
if(type==0) return 0;
Chisqdist tmp(df);
while(1){
double val;
std::cout << "Type point for evaluation"<<std::endl;
std::cin >>val;
if(type==1)
fprintf(stderr,"Chisquare.p(%f,%f)=%e\n",val,df,tmp.p(val));
if(type==2)
fprintf(stderr,"Chisquare.cdf(%f,%f)=%e\n",val,df,tmp.cdf(val));
if(type==3)
fprintf(stderr,"Chisquare.invcdf(%f,%f)=%e\n",val,df,tmp.invcdf(val));
}
return 0;
}
#endif
| {
"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: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;}
.xl7525262
{padding:0px;
mso-ignore:padding;
color:#FF9900;
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:center;
vertical-align:bottom;
mso-background-source:auto;
mso-pattern:auto;
white-space:nowrap;}
.xl7625262
{padding:0px;
mso-ignore:padding;
color:#6AA84F;
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:center;
vertical-align:bottom;
mso-background-source:auto;
mso-pattern:auto;
white-space:nowrap;}
.xl7725262
{padding:0px;
mso-ignore:padding;
color:#6AA84F;
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;}
.xl7825262
{padding:0px;
mso-ignore:padding;
color:#FF9900;
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:center;
vertical-align:bottom;
background:white;
mso-pattern:white none;
white-space:nowrap;}
.xl7925262
{padding:0px;
mso-ignore:padding;
color:#FF9900;
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;}
.xl8025262
{padding:0px;
mso-ignore:padding;
color:#4A86E8;
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;}
-->
</style>
<title>LTDetectSimilarity</title>
</head>
<body>
<!--[if !excel]> <![endif]-->
<!--The following information was generated by Microsoft Excel's Publish as Web
Page wizard.-->
<!--If the same item is republished from Excel, all information between the DIV
tags will be replaced.-->
<!----------------------------->
<!--START OF OUTPUT FROM EXCEL PUBLISH AS WEB PAGE WIZARD -->
<!----------------------------->
<div id="16550224 16ii32_978" align=center x:publishsource="Excel">
<h1 style='color:black;font-family:Arial;font-size:14.0pt;font-weight:800;
font-style:normal'>LTDetectSimilarity</h1>
<table border=0 cellpadding=0 cellspacing=0 width=1392 class=xl6553525262
style='border-collapse:collapse;table-layout:fixed;width:1045pt'>
<col class=xl6553525262 width=219 style='mso-width-source:userset;mso-width-alt:
8009;width:164pt'>
<col class=xl6553525262 width=54 style='mso-width-source:userset;mso-width-alt:
1974;width:41pt'>
<col class=xl6553525262 width=451 style='mso-width-source:userset;mso-width-alt:
16493;width:338pt'>
<col class=xl6553525262 width=101 span=4 style='width:76pt'>
<col class=xl6553525262 width=163 style='mso-width-source:userset;mso-width-alt:
5961;width:122pt'>
<col class=xl6553525262 width=101 style='width:76pt'>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6325262 width=219 style='height:12.75pt;width:164pt'>Name</td>
<td colspan=2 class=xl6425262 width=505 style='width:379pt'>Detect similarity
in a set</td>
<td colspan=2 class=xl6525262 width=202 style='width:152pt'></td>
<td class=xl6553525262 width=101 style='width:76pt'></td>
<td class=xl6553525262 width=101 style='width:76pt'></td>
<td class=xl6553525262 width=163 style='width:122pt'></td>
<td class=xl6553525262 width=101 style='width:76pt'></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6325262 style='height:12.75pt'>Implementing class</td>
<td colspan=2 class=xl6525262>LTDetectSimilarity</td>
<td colspan=2 class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6625262 style='height:12.75pt'>Description</td>
<td colspan=2 class=xl6725262 width=505 style='width:379pt'>The agents learns
to identify whether there are similar objects in visual field</td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6625262 style='height:12.75pt'>Child equivalent</td>
<td colspan=2 class=xl6725262 width=505 style='width:379pt'>Find two similar
toys on carpet</td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6625262 style='height:12.75pt'>Child age</td>
<td colspan=2 class=xl6825262 width=505 style='width:379pt'>7 mths</td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6325262 style='height:12.75pt'>Prerequisites</td>
<td colspan=2 class=xl6725262 width=505 style='width:379pt'>LTDetectShape,
LTDetectDifference</td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6325262 style='height:12.75pt'>Fully observable world</td>
<td colspan=2 class=xl6725262 width=505 style='width:379pt'>yes</td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6325262 style='height:12.75pt'>Input modalities</td>
<td colspan=2 class=xl6725262 width=505 style='width:379pt'>Visual</td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6325262 style='height:12.75pt'>Actuators</td>
<td colspan=2 class=xl6525262>2 (0,1), both binary</td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl6325262 style='height:15.0pt'>Spatial patterns</td>
<td class=xl6925262>yes</td>
<td class=xl7025262> </td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl6325262 style='height:15.0pt'>Temporal patterns</td>
<td class=xl7125262>no</td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl6325262 style='height:15.0pt'>Amount of supervision</td>
<td class=xl6925262>RL</td>
<td class=xl6525262><span style='mso-spacerun:yes'> </span></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl6325262 style='height:15.0pt'>Distraction</td>
<td class=xl6925262>yes</td>
<td class=xl6725262 width=451 style='width:338pt'></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=38 style='mso-height-source:userset;height:28.5pt'>
<td height=38 class=xl7225262 style='height:28.5pt'>Training unit initial
state</td>
<td colspan=2 class=xl6725262 width=505 style='width:379pt'>There is a set of
objects at random position presented to the agent. The visual field consists
either from different objects or two of them are similar</td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=35 style='mso-height-source:userset;height:26.25pt'>
<td height=35 class=xl7225262 style='height:26.25pt'>Training unit goal state</td>
<td colspan=2 class=xl6725262 width=505 style='width:379pt'>Agents will learn
to detect obejct shapes in the visual fielad and detect presence of similar
objects.</td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6325262 style='height:12.75pt'>Reward</td>
<td colspan=2 class=xl6725262 width=505 style='width:379pt'>The succesfull
answer is rewarded</td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6325262 style='height:12.75pt'>Level success criterion</td>
<td colspan=2 class=xl6725262 width=505 style='width:379pt'>The pupil has not
made a mistake in the last 20 training units.</td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=322 style='mso-height-source:userset;height:241.5pt'>
<td height=322 class=xl6325262 style='height:241.5pt'>Illustration</td>
<td colspan=2 height=322 width=505 style='height:241.5pt;width:379pt'
align=left valign=top><!--[if gte vml 1]><v:shapetype id="_x0000_t75"
coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe"
filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="image17.png" o:spid="_x0000_s1025" type="#_x0000_t75"
style='position:absolute;margin-left:3pt;margin-top:4.5pt;width:366.75pt;
height:225pt;z-index:1;visibility:visible' o:gfxdata="UEsDBBQABgAIAAAAIQBamK3CDAEAABgCAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbJSRwU7DMAyG
70i8Q5QralM4IITW7kDhCBMaDxAlbhvROFGcle3tSdZNgokh7Rjb3+8vyWK5tSObIJBxWPPbsuIM
UDltsK/5x/qleOCMokQtR4dQ8x0QXzbXV4v1zgOxRCPVfIjRPwpBagArqXQeMHU6F6yM6Rh64aX6
lD2Iu6q6F8phBIxFzBm8WbTQyc0Y2fM2lWcTjz1nT/NcXlVzYzOf6+JPIsBIJ4j0fjRKxnQ3MaE+
8SoOTmUi9zM0GE83SfzMhtz57fRzwYF7S48ZjAa2kiG+SpvMhQ4kvFFxEyBNlf/nZFFLhes6o6Bs
A61m8ih2boF2XxhgujS9Tdg7TMd0sf/X5hsAAP//AwBQSwMEFAAGAAgAAAAhAAjDGKTUAAAAkwEA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EiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiA
BEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiA
BEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEiABEjANAScTFNMoqV4
SYphiaZiAhIgARJwTAITpNv+RnS9quRpaEQ+ZiEBEiABeydwVjq4PLqTllJ400qFD6Mr5ScJkAAJ
kMArBLLIX3deuaLtjwGSbJK2pExFAiRAAg5FYIP0tll0j52jT/hJAiRAAiRAAiRAAiRAAvZIwNXS
nerYsSNGjhxp6WpZHwmQAAlYFYHx48dj3rx5JmvTyZMnkSdPHpOVx4JIgARIwBYJ+Pn54dGjR280
3eIKb4oUKZA9e/Y3GsILJEACJOBIBNSz0JTi4+MDU5dpyvaxLBIgARKwBAEnp7itdWnSYAn6rIME
SIAESIAESIAESCDZCFDhTTb0rJgESIAESIAESIAESMASBKjwWoIy6yABEiABEiABEiABEkg2AlR4
kw09KyYBEiABEiABEiABErAEASq8lqDMOkiABEiABEiABEiABJKNABXeZEPPikmABEiABEiABEiA
BCxBgAqvJSizDhIgARIgARIgARIggWQjQIU32dCzYhIgARIgARIgARIgAUsQoMJrCcqsgwRIgARI
gARIgARIINkIUOFNNvSsmARIgARIgARIgAQ0ELi9A9Ulglj1MXs1JH4tScgFjOk2CVdCXrvuYH9S
4XWwAWd3SYAESIAESIAEbIvA2S2rsE+avG/EMpzVqriGPMaVC0ewfPSnGLFwBx6E21afTd1aKrym
JsrySIAEzEjgMRY0cYKTU19c0GmvRnf7CIa0bYLqTZpgzPKD0Pp7ob0GpiQBEiABcxG4gR+6r0TX
+fPRBiux8dB9TRWFXNqEvAXLosN4pSqnhJumXPabiAqv/Y4te0YCdkdAd+Mgum9S3ZqOzce1PfQh
y3mfZS2L8aiOgd2bYF+Hyigjy4IG6Mt2x5EdIgESsB0C/md3yPOrGnq274SPuwIjlu168dKuw/0b
V3DlymvHhSu476+DZ9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CXBFLgk71R+CSOvlUfLra7w+O48dqlEt0W4Fmzr/AoKBwps+ZE
Gj75XiPEP0mABEjAvgnwsW/f48vekQAJvCCQIkOWl54aSIUESIAESMChCDDwhEMNNztLAiRAAiRA
AiRAAo5HgAqv4405e0wCJEACJEACJEACDkWACq9DDTc7SwIkQAIkQAIkQAKOR4A2vI435uwxCZAA
CdgEgevXryNXrlzwTGm7PkRDnj3DxYsXkS9fPptgzkaSgL0SoMJrryPLfpEACZCAjRM4f/48UtWq
jac/rrHZnqTs1BEnT56kwmuzI8iG2wsBKrz2MpLsBwmQAAnYIQEnVxcgVSqb7Zm+/TbbejacBOyH
AG147Wcs2RMSIAESIAESIAESIIE4CFDhjQMKL5EACZAACZAACZAACdgPASq89jOW7AkJkAAJkAAJ
kAAJkEAcBKjwxgGFl0iABEiABEiABEiABOyHADet2c9YsickQAIkYFcEsmXLhifbt8M3dy6b7dfT
G9fh17+/zbafDScBeyFAhddeRpL9IAESIAE7I1CsWDHcunULoaGhNtszd3d3ZM2a1Wbbz4aTgL0Q
oMJrLyPJfpAACZCAHRLIkiWLHfaKXSIBErA0AdrwWpo46yMBEiABEiABEiABErAoASq8FsXNykiA
BEiABEiABEiABCxNgAqvpYmzPhIgARIgARIgARIgAYsSoMJrUdysjARIgARIgARIgARIwNIEqPBa
mjjrIwESIAESIAESIAESsCgBKrwWxc3KSIAESIAESIAESIAELE2ACq+libM+EiABEiABEiABEiAB
ixKgwmtR3KyMBEiABEiABEiABEjA0gSo8FqaOOsjARIgARIgARIgARKwKAEqvBbFzcpIgARIgARI
gARIgAQsTYChhS1N3Mbqq9GwEa7euAEnZycba/nz5j78918sWboUzRs1ssn2x9XoR48e4c6dOyhU
qBCcnGxzXOLqF6+RAAlYF4G9e/fi+OkzGNC3j3U1jK0hASMIUOE1ApojZdm7dQtw7AREs7LNbh8+
jBWrV9uVwjtsxAgsXLQIbh4eKFamDGrIUb5sWZQrVw7p0qWzzXFiq0mABKyOgL+/Pwb1+wJpU6ZE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gAAB
AgQIVFKgqCkN90LvzUoK6hQBAgTWL3BnjUV8HteZx7BGPJcRIFBpgbX8alZpEJ0jQIAAAQIECBAg
QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA
AQIECKwu8BeMuyR2HOggxgAAAABJRU5ErkJgglBLAQItABQABgAIAAAAIQBamK3CDAEAABgCAAAT
AAAAAAAAAAAAAAAAAAAAAABbQ29udGVudF9UeXBlc10ueG1sUEsBAi0AFAAGAAgAAAAhAAjDGKTU
AAAAkwEAAAsAAAAAAAAAAAAAAAAAPQEAAF9yZWxzLy5yZWxzUEsBAi0AFAAGAAgAAAAhACkViDUR
AgAABAUAABIAAAAAAAAAAAAAAAAAOgIAAGRycy9waWN0dXJleG1sLnhtbFBLAQItABQABgAIAAAA
IQCqJg6+vAAAACEBAAAdAAAAAAAAAAAAAAAAAHsEAABkcnMvX3JlbHMvcGljdHVyZXhtbC54bWwu
cmVsc1BLAQItABQABgAIAAAAIQB7EVsYFgEAAIsBAAAPAAAAAAAAAAAAAAAAAHIFAABkcnMvZG93
bnJldi54bWxQSwECLQAKAAAAAAAAACEAqwgHVr9iAAC/YgAAFAAAAAAAAAAAAAAAAAC1BgAAZHJz
L21lZGlhL2ltYWdlMS5wbmdQSwUGAAAAAAYABgCEAQAApmkAAAAA
">
<v:imagedata src="LTDetectSimilarity_files/16550224%2016ii32_978_image001.png"
o:title=""/>
<o:lock v:ext="edit" aspectratio="f"/>
<x:ClientData ObjectType="Pict">
<x:SizeWithCells/>
<x:Locked>False</x:Locked>
<x:CF>Bitmap</x:CF>
<x:AutoPict/>
</x:ClientData>
</v:shape><![endif]--><![if !vml]><span style='mso-ignore:vglayout;
position:absolute;z-index:1;margin-left:4px;margin-top:6px;width:489px;
height:300px'><img width=489 height=300
src="LTDetectSimilarity_files/16550224%2016ii32_978_image002.png" v:shapes="image17.png"></span><![endif]><span
style='mso-ignore:vglayout2'>
<table cellpadding=0 cellspacing=0>
<tr>
<td colspan=2 height=322 class=xl7325262 width=505 style='height:241.5pt;
width:379pt'></td>
</tr>
</table>
</span></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6553525262 style='height:12.75pt'></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6553525262 style='height:12.75pt'></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl7425262></td>
<td class=xl7425262></td>
<td class=xl7425262></td>
<td class=xl7425262></td>
<td class=xl7425262></td>
<td class=xl7425262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl7425262></td>
<td class=xl7425262></td>
<td class=xl7425262></td>
<td class=xl7425262></td>
<td class=xl7425262></td>
<td class=xl7425262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl7525262></td>
<td class=xl7625262></td>
<td class=xl7625262></td>
<td class=xl7725262></td>
<td class=xl7725262></td>
<td class=xl7725262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl7625262></td>
<td class=xl7625262></td>
<td class=xl7825262> </td>
<td class=xl7925262></td>
<td class=xl7925262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl7725262></td>
<td class=xl7725262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl8025262></td>
<td class=xl6525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl8025262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6525262></td>
<td class=xl6525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl6525262 style='height:12.75pt'></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
<td class=xl6553525262></td>
</tr>
<![if supportMisalignedColumns]>
<tr height=0 style='display:none'>
<td width=219 style='width:164pt'></td>
<td width=54 style='width:41pt'></td>
<td width=451 style='width:338pt'></td>
<td width=101 style='width:76pt'></td>
<td width=101 style='width:76pt'></td>
<td width=101 style='width:76pt'></td>
<td width=101 style='width:76pt'></td>
<td width=163 style='width:122pt'></td>
<td width=101 style='width:76pt'></td>
</tr>
<![endif]>
</table>
</div>
<!----------------------------->
<!--END OF OUTPUT FROM EXCEL PUBLISH AS WEB PAGE WIZARD-->
<!----------------------------->
</body>
</html>
| {
"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"
} |