text
stringlengths 2
99k
| meta
dict |
---|---|
(library (name ui_incr) (public_name incr_dom.ui_incr)
(preprocess (pps ppx_jane))
(libraries core_kernel incremental incr_map incr_select)) | {
"pile_set_name": "Github"
} |
/********************************************************************
created: 2011/04/11
filename: IMenuManager.h
author: Crazii
purpose:
*********************************************************************/
#ifndef __Blade_IMenuManager_h__
#define __Blade_IMenuManager_h__
#include <interface/InterfaceSingleton.h>
namespace Blade
{
class IMenu;
class IUIWindow;
class IMenuManager : public InterfaceSingleton<IMenuManager>
{
public:
virtual ~IMenuManager() {}
/** @brief */
virtual IMenu* addRootMenu(const TString& name,tchar accessKey = tchar()) = 0;
/** @brief */
virtual size_t getRootMenuCount() const = 0;
/** @brief */
virtual IMenu* getRootMenu(index_t index) const = 0;
/** @brief */
virtual IMenu* getRootMenu(const TString& name) const = 0;
/** @brief */
virtual IMenu* findMenu(const TString& name) const = 0;
/** @brief */
virtual IMenu* createExtraMenu(const TString& name) = 0;
/** @brief */
virtual bool destroyExtraMenu(IMenu* menu) = 0;
/** @brief */
virtual IMenu* getExtraMenu(const TString& name) = 0;
/** @brief popup a menu for a window in window coordinates */
virtual bool popupMenu(IMenu* menu, int x, int y, IUIWindow* window) = 0;
};
extern template class BLADE_FRAMEWORK_API Factory<IMenuManager>;
}//namespace Blade
#endif // __Blade_IMenuManager_h__ | {
"pile_set_name": "Github"
} |
StartChar: uni0649.medi_BaaMemFina
Encoding: 1115071 -1 1243
Width: 337
Flags: HW
AnchorPoint: "HamzaBelow" 218 -283 basechar 0
AnchorPoint: "AlefAbove" 186 479 basechar 0
AnchorPoint: "TashkilAbove" 146 801 basechar 0
AnchorPoint: "TashkilBelow" 220 -327 basechar 0
LayerCount: 2
Fore
Refer: 77 -1 N 1 0 0 1 0 0 3
EndChar
| {
"pile_set_name": "Github"
} |
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2009-2010, Jesse Eichar **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
package scalax.file
import scala.util.control.ControlThrowable
import java.io.IOException
/**
* This is a control exception that indicates the underlying filesystem object cannot be treated as a File.
* <p>
* IE a symbolic link maybe treated as a file in some cases but a Directory cannot. So
* if a file operation is attempted on a Directory a NotFileException will be thrown
* <p>
* To safely use {@link File} one should use the following code:
* <pre>
* <code>
* import scala.util.control.Exception._
* catching(classOf[NotFileException]) opt {
* file.lines foreach (println _)
* } match {
* case None => println ("Oh no the path is not a file")
* case Some(names) => println ("oh everything went as planned and we got all the lines: "+lines)
* }
* </code>
* </pre>
*
* @author Jesse Eichar
* @since 1.0
*/
case class NotFileException(path:String) extends IOException with ControlThrowable {
override lazy val toString = path + "is not a file"
}
/**
* This is a control exception that indicates the underlying filesystem object either does not exist or is not a Directory
* <p>
* To safely use {@link PathSet} one should use the following code:
* <pre>
* <code>
* import scala.util.control.Exception._
* catching(classOf[NotDirectoryException]) opt {
* ds map (_.name)
* } match {
* case None => println ("Oh no the path is not a directory!")
* case Some(names) => println ("oh everything went as planned and we got all the names: "+names)
* }
* </code>
* </pre>
*
* @author Jesse Eichar
* @since 1.0
*/
case class NotDirectoryException(path:String) extends IOException with ControlThrowable{
override lazy val toString = path + " is not a directory"
}
| {
"pile_set_name": "Github"
} |
The MIT License (MIT)
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
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.
| {
"pile_set_name": "Github"
} |
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org/libs/multi_index for library home page.
*/
#ifndef BOOST_MULTI_INDEX_DETAIL_SERIALIZATION_VERSION_HPP
#define BOOST_MULTI_INDEX_DETAIL_SERIALIZATION_VERSION_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/serialization/split_member.hpp>
#include <boost/serialization/version.hpp>
namespace boost{
namespace multi_index{
namespace detail{
/* Helper class for storing and retrieving a given type serialization class
* version while avoiding saving the number multiple times in the same
* archive.
* Behavior undefined if template partial specialization is not supported.
*/
template<typename T>
struct serialization_version
{
serialization_version():
value(boost::serialization::version<serialization_version>::value){}
serialization_version& operator=(unsigned int x){value=x;return *this;};
operator unsigned int()const{return value;}
private:
friend class boost::serialization::access;
BOOST_SERIALIZATION_SPLIT_MEMBER()
template<class Archive>
void save(Archive&,const unsigned int)const{}
template<class Archive>
void load(Archive&,const unsigned int version)
{
this->value=version;
}
unsigned int value;
};
} /* namespace multi_index::detail */
} /* namespace multi_index */
namespace serialization {
template<typename T>
struct version<boost::multi_index::detail::serialization_version<T> >
{
BOOST_STATIC_CONSTANT(int,value=version<T>::value);
};
} /* namespace serialization */
} /* namespace boost */
#endif
| {
"pile_set_name": "Github"
} |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class DynamicLossScaler(object):
def __init__(
self, init_scale=2.**15, scale_factor=2., scale_window=2000,
tolerance=0.05, threshold=None, min_loss_scale=1e-4
):
self.loss_scale = init_scale
self.scale_factor = scale_factor
self.scale_window = scale_window
self.tolerance = tolerance
self.threshold = threshold
self._iter = 0
self._last_overflow_iter = -1
self._last_rescale_iter = -1
self._overflows_since_rescale = 0
self.min_loss_scale = min_loss_scale
def scale(self, outputs):
return self.loss_scale * outputs
def update(self):
if (self._iter - self._last_overflow_iter) % self.scale_window == 0:
self.loss_scale *= self.scale_factor
self._last_rescale_iter = self._iter
self._iter += 1
def _decrease_loss_scale(self):
self.loss_scale /= self.scale_factor
if self.threshold is not None:
self.loss_scale = max(self.loss_scale, self.threshold)
def check_overflow(self, grad_norm):
# detect inf and nan
if grad_norm == float('inf') or grad_norm != grad_norm:
# overflow has occured
prev_scale = self.loss_scale
iter_since_rescale = self._iter - self._last_rescale_iter
self._last_overflow_iter = self._iter
self._overflows_since_rescale += 1
pct_overflow = self._overflows_since_rescale / float(iter_since_rescale)
if pct_overflow >= self.tolerance:
self._decrease_loss_scale()
self._last_rescale_iter = self._iter
self._overflows_since_rescale = 0
if self.loss_scale <= self.min_loss_scale:
# Use FloatingPointError as an uncommon error that parent
# functions can safely catch to stop training.
self.loss_scale = prev_scale
raise FloatingPointError((
'Minimum loss scale reached ({}). Your loss is probably exploding. '
'Try lowering the learning rate, using gradient clipping or '
'increasing the batch size.'
).format(self.min_loss_scale))
self._iter += 1
raise OverflowError('setting loss scale to: ' + str(self.loss_scale))
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2013-2015 RoboVM AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.bugvm.apple.audiotoolbox;
import com.bugvm.rt.bro.Struct;
import com.bugvm.rt.bro.annotation.StructMember;
public class AudioQueueProcessingTapMutableFlags extends Struct<AudioQueueProcessingTapMutableFlags> {
public AudioQueueProcessingTapFlags get() {
return new AudioQueueProcessingTapFlags(getValue());
}
public void set(AudioQueueProcessingTapFlags flags) {
setValue((int)flags.value());
}
@StructMember(0)
private native int getValue();
@StructMember(0)
private native void setValue(int value);
}
| {
"pile_set_name": "Github"
} |
/**
* Copyright 2019 LinkedIn Corporation. All rights reserved.
* Licensed under the BSD 2-Clause License. See the LICENSE file in the project root for license information.
* See the NOTICE file in the project root for additional information regarding copyright ownership.
*/
package com.linkedin.datastream.testutil;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.linkedin.datastream.metrics.BrooklinMetricInfo;
import com.linkedin.datastream.server.DatastreamTask;
import com.linkedin.datastream.server.providers.CheckpointProvider;
/**
* An in-memory implementation of {@link CheckpointProvider}
*/
public class InMemoryCheckpointProvider implements CheckpointProvider {
private static final Logger LOG = LoggerFactory.getLogger(InMemoryCheckpointProvider.class);
private final Map<DatastreamTask, Map<Integer, String>> _cpMap = new HashMap<>();
@Override
public List<BrooklinMetricInfo> getMetricInfos() {
return null;
}
@Override
public void unassignDatastreamTask(DatastreamTask task) {
_cpMap.remove(task);
}
@Override
public void updateCheckpoint(DatastreamTask task, int partition, String checkpoint) {
if (!_cpMap.containsKey(task)) {
_cpMap.put(task, new HashMap<>());
}
_cpMap.get(task).put(partition, checkpoint);
}
@Override
public void flush() {
}
@Override
public Map<Integer, String> getSafeCheckpoints(DatastreamTask task) {
return _cpMap.get(task);
}
@Override
public Map<Integer, String> getCommitted(DatastreamTask datastreamTask) {
if (_cpMap.containsKey(datastreamTask)) {
return _cpMap.get(datastreamTask);
} else {
return new HashMap<>();
}
}
}
| {
"pile_set_name": "Github"
} |
// 20.2.2.7 Math.atanh(x)
var $export = require('./$.export');
$export($export.S, 'Math', {
atanh: function atanh(x){
return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
}
}); | {
"pile_set_name": "Github"
} |
# Generated by vio0 dhclient
search c.symbolic-datum-552.internal.
nameserver 169.254.169.254
nameserver 10.240.0.1
lookup file bind
| {
"pile_set_name": "Github"
} |
// Boost.Geometry (aka GGL, Generic Geometry Library)
// This file is manually converted from PROJ4
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2017, 2018.
// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// This file is converted from PROJ4, http://trac.osgeo.org/proj
// PROJ4 is originally written by Gerald Evenden (then of the USGS)
// PROJ4 is maintained by Frank Warmerdam
// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
// Original copyright notice:
// 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.
/* meridional distance for ellipsoid and inverse
** 8th degree - accurate to < 1e-5 meters when used in conjunction
** with typical major axis values.
** Inverse determines phi to EPS (1e-11) radians, about 1e-6 seconds.
*/
#ifndef BOOST_GEOMETRY_PROJECTIONS_PJ_MLFN_HPP
#define BOOST_GEOMETRY_PROJECTIONS_PJ_MLFN_HPP
#include <cstdlib>
#include <boost/geometry/srs/projections/exception.hpp>
#include <boost/geometry/srs/projections/impl/pj_strerrno.hpp>
#include <boost/geometry/util/math.hpp>
namespace boost { namespace geometry { namespace projections {
namespace detail {
template <typename T>
struct en
{
static const std::size_t size = 5;
T const& operator[](size_t i) const { return data[i]; }
T & operator[](size_t i) { return data[i]; }
private:
T data[5];
};
template <typename T>
inline en<T> pj_enfn(T const& es)
{
static const T C00 = 1.;
static const T C02 = .25;
static const T C04 = .046875;
static const T C06 = .01953125;
static const T C08 = .01068115234375;
static const T C22 = .75;
static const T C44 = .46875;
static const T C46 = .01302083333333333333;
static const T C48 = .00712076822916666666;
static const T C66 = .36458333333333333333;
static const T C68 = .00569661458333333333;
static const T C88 = .3076171875;
T t;
detail::en<T> en;
{
en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08)));
en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));
en[2] = (t = es * es) * (C44 - es * (C46 + es * C48));
en[3] = (t *= es) * (C66 - es * C68);
en[4] = t * es * C88;
}
return en;
}
template <typename T>
inline T pj_mlfn(T const& phi, T sphi, T cphi, detail::en<T> const& en)
{
cphi *= sphi;
sphi *= sphi;
return(en[0] * phi - cphi * (en[1] + sphi*(en[2]
+ sphi*(en[3] + sphi*en[4]))));
}
template <typename T>
inline T pj_inv_mlfn(T const& arg, T const& es, detail::en<T> const& en)
{
static const T EPS = 1e-11;
static const int MAX_ITER = 10;
T s, t, phi, k = 1./(1.-es);
int i;
phi = arg;
for (i = MAX_ITER; i ; --i) { /* rarely goes over 2 iterations */
s = sin(phi);
t = 1. - es * s * s;
phi -= t = (pj_mlfn(phi, s, cos(phi), en) - arg) * (t * sqrt(t)) * k;
if (geometry::math::abs(t) < EPS)
return phi;
}
BOOST_THROW_EXCEPTION( projection_exception(error_non_conv_inv_meri_dist) );
return phi;
}
} // namespace detail
}}} // namespace boost::geometry::projections
#endif
| {
"pile_set_name": "Github"
} |
from fnmatch import fnmatch
import re
__all__ = ("make_active_helper", )
def make_active_helper(request):
def active(*url_patterns, partial=False, class_name="active"):
curr_path = re.sub("index.html$", "", request.path).strip("/")
for urlp in url_patterns:
urlp = re.sub("index.html$", "", urlp.strip("/")).strip("/")
if fnmatch(curr_path, urlp) or (partial and curr_path.startswith(urlp)):
return class_name
return ""
return active
| {
"pile_set_name": "Github"
} |
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSTACKEDLAYOUT_H
#define QSTACKEDLAYOUT_H
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qlayout.h>
QT_BEGIN_NAMESPACE
class QStackedLayoutPrivate;
class Q_WIDGETS_EXPORT QStackedLayout : public QLayout
{
Q_OBJECT
Q_DECLARE_PRIVATE(QStackedLayout)
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
Q_PROPERTY(StackingMode stackingMode READ stackingMode WRITE setStackingMode)
QDOC_PROPERTY(int count READ count)
public:
enum StackingMode {
StackOne,
StackAll
};
Q_ENUM(StackingMode)
QStackedLayout();
explicit QStackedLayout(QWidget *parent);
explicit QStackedLayout(QLayout *parentLayout);
~QStackedLayout();
int addWidget(QWidget *w);
int insertWidget(int index, QWidget *w);
QWidget *currentWidget() const;
int currentIndex() const;
using QLayout::widget;
QWidget *widget(int) const;
int count() const override;
StackingMode stackingMode() const;
void setStackingMode(StackingMode stackingMode);
// abstract virtual functions:
void addItem(QLayoutItem *item) override;
QSize sizeHint() const override;
QSize minimumSize() const override;
QLayoutItem *itemAt(int) const override;
QLayoutItem *takeAt(int) override;
void setGeometry(const QRect &rect) override;
bool hasHeightForWidth() const override;
int heightForWidth(int width) const override;
Q_SIGNALS:
void widgetRemoved(int index);
void currentChanged(int index);
public Q_SLOTS:
void setCurrentIndex(int index);
void setCurrentWidget(QWidget *w);
private:
Q_DISABLE_COPY(QStackedLayout)
};
QT_END_NAMESPACE
#endif // QSTACKEDLAYOUT_H
| {
"pile_set_name": "Github"
} |
/****************************************************************************
**
** https://www.qxorm.com/
** Copyright (C) 2013 Lionel Marty ([email protected])
**
** This file is part of the QxOrm library
**
** This software is provided 'as-is', without any express or implied
** warranty. In no event will the authors be held liable for any
** damages arising from the use of this software
**
** Commercial Usage
** Licensees holding valid commercial QxOrm licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Lionel Marty
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file 'license.gpl3.txt' included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met : http://www.gnu.org/copyleft/gpl.html
**
** If you are unsure which license is appropriate for your use, or
** if you have questions regarding the use of this file, please contact :
** [email protected]
**
****************************************************************************/
#ifndef _QX_IS_QX_POD_H_
#define _QX_IS_QX_POD_H_
#ifdef _MSC_VER
#pragma once
#endif
/*!
* \file is_qx_pod.h
* \author Lionel Marty
* \ingroup QxTraits
* \brief qx::trait::is_qx_pod<T>::value : return true if T is a POD type and not a pointer
*/
namespace qx {
namespace trait {
/*!
* \ingroup QxTraits
* \brief qx::trait::is_qx_pod<T>::value : return true if T is a POD type and not a pointer
*/
template <typename T>
struct is_qx_pod
{
enum { value = (std::is_pod<T>::value && ! std::is_pointer<T>::value && ! std::is_member_pointer<T>::value) };
typedef typename std::conditional<qx::trait::is_qx_pod<T>::value, std::true_type, std::false_type>::type type;
};
} // namespace trait
} // namespace qx
#endif // _QX_IS_QX_POD_H_
| {
"pile_set_name": "Github"
} |
<?php
/**
* @package plugins.tvComDistribution
* @subpackage lib
*/
class TVComDistributionProvider implements IDistributionProvider
{
/**
* @var TVComDistributionProvider
*/
protected static $instance;
protected function __construct()
{
}
/**
* @return TVComDistributionProvider
*/
public static function get()
{
if(!self::$instance)
self::$instance = new TVComDistributionProvider();
return self::$instance;
}
/* (non-PHPdoc)
* @see IDistributionProvider::getType()
*/
public function getType()
{
return TVComDistributionPlugin::getDistributionProviderTypeCoreValue(TVComDistributionProviderType::TVCOM);
}
/**
* @return string
*/
public function getName()
{
return 'TV.com';
}
/* (non-PHPdoc)
* @see IDistributionProvider::isDeleteEnabled()
*/
public function isDeleteEnabled()
{
return true;
}
/* (non-PHPdoc)
* @see IDistributionProvider::isUpdateEnabled()
*/
public function isUpdateEnabled()
{
return true;
}
/* (non-PHPdoc)
* @see IDistributionProvider::isMediaUpdateEnabled()
*/
public function isMediaUpdateEnabled()
{
return true;
}
/* (non-PHPdoc)
* @see IDistributionProvider::isReportsEnabled()
*/
public function isReportsEnabled()
{
return false;
}
/* (non-PHPdoc)
* @see IDistributionProvider::isScheduleUpdateEnabled()
*/
public function isScheduleUpdateEnabled()
{
return true;
}
/* (non-PHPdoc)
* @see IDistributionProvider::isAvailabilityUpdateEnabled()
*/
public function isAvailabilityUpdateEnabled()
{
return false;
}
/* (non-PHPdoc)
* @see IDistributionProvider::isLocalFileRequired()
*/
public function isLocalFileRequired($jobType)
{
return false;
}
/* (non-PHPdoc)
* @see IDistributionProvider::useDeleteInsteadOfUpdate()
*/
public function useDeleteInsteadOfUpdate()
{
return false;
}
/* (non-PHPdoc)
* @see IDistributionProvider::getJobIntervalBeforeSunrise()
*/
public function getJobIntervalBeforeSunrise()
{
return 0;
}
/* (non-PHPdoc)
* @see IDistributionProvider::getJobIntervalBeforeSunset()
*/
public function getJobIntervalBeforeSunset()
{
return 0;
}
/* (non-PHPdoc)
* @see IDistributionProvider::getUpdateRequiredEntryFields()
*/
public function getUpdateRequiredEntryFields($distributionProfileId = null)
{
return array();
}
/* (non-PHPdoc)
* @see IDistributionProvider::getUpdateRequiredMetadataXPaths()
*/
public function getUpdateRequiredMetadataXPaths($distributionProfileId = null)
{
return array();
}
} | {
"pile_set_name": "Github"
} |
#defaults=no
#cm=OSC
Wave=2
<?
float Wave[ 128 ];
Wave[0] = 0.24238586;
Wave[1] = 0.41617107;
Wave[2] = 0.46353912;
Wave[3] = 0.48039913;
Wave[4] = 0.4921379;
Wave[5] = 0.49693775;
Wave[6] = 0.49484444;
Wave[7] = 0.49568653;
Wave[8] = 0.4960327;
Wave[9] = 0.49604797;
Wave[10] = 0.49585915;
Wave[11] = 0.49537563;
Wave[12] = 0.49440002;
Wave[13] = 0.49623775;
Wave[14] = 0.48931885;
Wave[15] = 0.48100853;
Wave[16] = 0.45385742;
Wave[17] = 0.35899734;
Wave[18] = -0.36828995;
Wave[19] = -0.44202328;
Wave[20] = -0.46016312;
Wave[21] = -0.46931553;
Wave[22] = -0.46839714;
Wave[23] = -0.4694624;
Wave[24] = -0.47022247;
Wave[25] = -0.46396542;
Wave[26] = -0.4549904;
Wave[27] = -0.43542957;
Wave[28] = -0.39808655;
Wave[29] = -0.31289768;
Wave[30] = 0.2768135;
Wave[31] = 0.36634064;
Wave[32] = 0.38983154;
Wave[33] = 0.39865685;
Wave[34] = 0.38128662;
Wave[35] = 0.34444332;
Wave[36] = 0.14352417;
Wave[37] = -0.3370676;
Wave[38] = -0.4019947;
Wave[39] = -0.43534946;
Wave[40] = -0.4539795;
Wave[41] = -0.4656229;
Wave[42] = -0.47224998;
Wave[43] = -0.47598076;
Wave[44] = -0.48213196;
Wave[45] = -0.47880745;
Wave[46] = -0.48221016;
Wave[47] = -0.4791441;
Wave[48] = -0.47694397;
Wave[49] = -0.46932793;
Wave[50] = -0.46334076;
Wave[51] = -0.4541874;
Wave[52] = -0.43317795;
Wave[53] = -0.40482998;
Wave[54] = -0.3462391;
Wave[55] = 0.12877083;
Wave[56] = 0.35277557;
Wave[57] = 0.40117455;
Wave[58] = 0.42041397;
Wave[59] = 0.43679905;
Wave[60] = 0.44541168;
Wave[61] = 0.45211506;
Wave[62] = 0.45650864;
Wave[63] = 0.46191692;
Wave[64] = 0.45610046;
Wave[65] = 0.45303917;
Wave[66] = 0.4391346;
Wave[67] = 0.42031956;
Wave[68] = 0.39373016;
Wave[69] = 0.3386736;
Wave[70] = 0.2028389;
Wave[71] = -0.2721529;
Wave[72] = -0.3352661;
Wave[73] = -0.36938477;
Wave[74] = -0.38748932;
Wave[75] = -0.39518642;
Wave[76] = -0.39886856;
Wave[77] = -0.39587688;
Wave[78] = -0.38757706;
Wave[79] = -0.36933517;
Wave[80] = -0.33569336;
Wave[81] = -0.2830286;
Wave[82] = 0.023773193;
Wave[83] = 0.26341438;
Wave[84] = 0.3042717;
Wave[85] = 0.3101349;
Wave[86] = 0.31197166;
Wave[87] = 0.3047905;
Wave[88] = 0.28457642;
Wave[89] = 0.24487782;
Wave[90] = 0.020082474;
Wave[91] = -0.24949074;
Wave[92] = -0.2975769;
Wave[93] = -0.33198357;
Wave[94] = -0.3554325;
Wave[95] = -0.37625694;
Wave[96] = -0.3957672;
Wave[97] = -0.40959644;
Wave[98] = -0.4214363;
Wave[99] = -0.4309044;
Wave[100] = -0.4325409;
Wave[101] = -0.43899727;
Wave[102] = -0.44270706;
Wave[103] = -0.44280243;
Wave[104] = -0.43627167;
Wave[105] = -0.43244553;
Wave[106] = -0.4311161;
Wave[107] = -0.42015362;
Wave[108] = -0.41301727;
Wave[109] = -0.40781212;
Wave[110] = -0.39965248;
Wave[111] = -0.3901863;
Wave[112] = -0.38417053;
Wave[113] = -0.37187862;
Wave[114] = -0.3564911;
Wave[115] = -0.34715748;
Wave[116] = -0.35260773;
Wave[117] = -0.3540678;
Wave[118] = -0.36891747;
Wave[119] = -0.38233852;
Wave[120] = -0.3957367;
Wave[121] = -0.41210938;
Wave[122] = -0.42630386;
Wave[123] = -0.43379116;
Wave[124] = -0.4417343;
Wave[125] = -0.4360962;
Wave[126] = -0.4243431;
Wave[127] = -0.37822437;
Selected.WaveTable.set( 1 , Wave );
Wave[0] = 0.4960785;
Wave[1] = 0.49593544;
Wave[2] = 0.49580765;
Wave[3] = 0.49564934;
Wave[4] = 0.49549103;
Wave[5] = 0.49531555;
Wave[6] = 0.49513817;
Wave[7] = 0.49491215;
Wave[8] = 0.4947052;
Wave[9] = 0.4945011;
Wave[10] = 0.4942417;
Wave[11] = 0.49790573;
Wave[12] = 0.49759674;
Wave[13] = 0.49730396;
Wave[14] = 0.4969616;
Wave[15] = 0.49660873;
Wave[16] = 0.49623108;
Wave[17] = 0.49194717;
Wave[18] = 0.49148178;
Wave[19] = 0.49103546;
Wave[20] = 0.49050522;
Wave[21] = 0.4938717;
Wave[22] = 0.49325943;
Wave[23] = 0.49262524;
Wave[24] = 0.48806;
Wave[25] = 0.487319;
Wave[26] = 0.4865017;
Wave[27] = 0.48954296;
Wave[28] = 0.48862076;
Wave[29] = 0.4836731;
Wave[30] = 0.48257446;
Wave[31] = 0.4852705;
Wave[32] = 0.48007202;
Wave[33] = 0.4786358;
Wave[34] = 0.48098755;
Wave[35] = 0.47540855;
Wave[36] = 0.4774704;
Wave[37] = 0.47152328;
Wave[38] = 0.47319984;
Wave[39] = 0.46998215;
Wave[40] = 0.46408844;
Wave[41] = 0.46424484;
Wave[42] = 0.46167183;
Wave[43] = 0.45793724;
Wave[44] = 0.45280838;
Wave[45] = 0.44543839;
Wave[46] = 0.43989372;
Wave[47] = 0.43654633;
Wave[48] = 0.43086243;
Wave[49] = 0.42164898;
Wave[50] = 0.41345787;
Wave[51] = 0.40236378;
Wave[52] = 0.3889885;
Wave[53] = 0.36850548;
Wave[54] = 0.35069466;
Wave[55] = 0.32259083;
Wave[56] = 0.2799225;
Wave[57] = 0.13707638;
Wave[58] = 0.0;
Wave[59] = 0.0;
Wave[60] = 0.0;
Wave[61] = 0.0;
Wave[62] = 0.0;
Wave[63] = 0.0;
Wave[64] = 0.0;
Wave[65] = 0.0;
Wave[66] = 0.0;
Wave[67] = 0.0;
Wave[68] = 0.0;
Wave[69] = 0.0;
Wave[70] = -0.010377884;
Wave[71] = -0.2576542;
Wave[72] = -0.31333923;
Wave[73] = -0.34516525;
Wave[74] = -0.36541367;
Wave[75] = -0.3834076;
Wave[76] = -0.39888;
Wave[77] = -0.40995026;
Wave[78] = -0.42110825;
Wave[79] = -0.43081284;
Wave[80] = -0.43930054;
Wave[81] = -0.44439793;
Wave[82] = -0.44970703;
Wave[83] = -0.45214844;
Wave[84] = -0.45649338;
Wave[85] = -0.4603777;
Wave[86] = -0.4638443;
Wave[87] = -0.46767426;
Wave[88] = -0.4736786;
Wave[89] = -0.47305584;
Wave[90] = -0.47511864;
Wave[91] = -0.47893238;
Wave[92] = -0.47864532;
Wave[93] = -0.480402;
Wave[94] = -0.48591232;
Wave[95] = -0.4834633;
Wave[96] = -0.48872375;
Wave[97] = -0.4899807;
Wave[98] = -0.4872036;
Wave[99] = -0.48849297;
Wave[100] = -0.49310684;
Wave[101] = -0.4940138;
Wave[102] = -0.490942;
Wave[103] = -0.491704;
Wave[104] = -0.496315;
Wave[105] = -0.496974;
Wave[106] = -0.49757195;
Wave[107] = -0.49422455;
Wave[108] = -0.49474716;
Wave[109] = -0.4952488;
Wave[110] = -0.49568748;
Wave[111] = -0.4973173;
Wave[112] = -0.500412;
Wave[113] = -0.50075436;
Wave[114] = -0.50107765;
Wave[115] = -0.5014229;
Wave[116] = -0.5016937;
Wave[117] = -0.5002575;
Wave[118] = -0.4982891;
Wave[119] = -0.4985447;
Wave[120] = -0.49876404;
Wave[121] = -0.49895287;
Wave[122] = -0.4991417;
Wave[123] = -0.4993391;
Wave[124] = -0.49949265;
Wave[125] = -0.49966145;
Wave[126] = -0.49977493;
Wave[127] = -0.49993324;
Selected.WaveTable.set( 2 , Wave );
Wave[0] = 0.49601746;
Wave[1] = 0.4951172;
Wave[2] = 0.4977646;
Wave[3] = 0.49198627;
Wave[4] = 0.49308014;
Wave[5] = 0.48712254;
Wave[6] = 0.47885323;
Wave[7] = 0.46846485;
Wave[8] = 0.45150757;
Wave[9] = 0.4143896;
Wave[10] = 0.32100487;
Wave[11] = 0.0;
Wave[12] = 0.0;
Wave[13] = 0.0;
Wave[14] = 0.0;
Wave[15] = 0.0;
Wave[16] = 0.0;
Wave[17] = 0.0;
Wave[18] = 0.0;
Wave[19] = 0.0;
Wave[20] = 0.0;
Wave[21] = 0.0;
Wave[22] = 0.0;
Wave[23] = 0.0;
Wave[24] = 0.0;
Wave[25] = 0.0;
Wave[26] = 0.0;
Wave[27] = 0.0;
Wave[28] = 0.0;
Wave[29] = 0.0;
Wave[30] = 0.0;
Wave[31] = 0.0;
Wave[32] = 0.0;
Wave[33] = 0.0;
Wave[34] = 0.0;
Wave[35] = 0.0;
Wave[36] = 0.0;
Wave[37] = 0.0;
Wave[38] = 0.0;
Wave[39] = 0.0;
Wave[40] = 0.0;
Wave[41] = 0.0;
Wave[42] = 0.0;
Wave[43] = 0.0;
Wave[44] = 0.0;
Wave[45] = 0.0;
Wave[46] = 0.0;
Wave[47] = 0.0;
Wave[48] = 0.0;
Wave[49] = 0.0;
Wave[50] = 0.0;
Wave[51] = 0.0;
Wave[52] = 0.0;
Wave[53] = 0.0;
Wave[54] = 0.0;
Wave[55] = 0.0;
Wave[56] = 0.0;
Wave[57] = 0.0;
Wave[58] = 0.0;
Wave[59] = 0.0;
Wave[60] = 0.0;
Wave[61] = 0.0;
Wave[62] = 0.0;
Wave[63] = 0.0;
Wave[64] = 0.0;
Wave[65] = 0.0;
Wave[66] = 0.0;
Wave[67] = 0.0;
Wave[68] = 0.0;
Wave[69] = 0.0;
Wave[70] = 0.0;
Wave[71] = 0.0;
Wave[72] = 0.0;
Wave[73] = 0.0;
Wave[74] = 0.0;
Wave[75] = 0.0;
Wave[76] = 0.0;
Wave[77] = 0.0;
Wave[78] = 0.0;
Wave[79] = 0.0;
Wave[80] = 0.0;
Wave[81] = 0.0;
Wave[82] = 0.0;
Wave[83] = 0.0;
Wave[84] = 0.0;
Wave[85] = 0.0;
Wave[86] = 0.0;
Wave[87] = 0.0;
Wave[88] = 0.0;
Wave[89] = 0.0;
Wave[90] = 0.0;
Wave[91] = 0.0;
Wave[92] = 0.0;
Wave[93] = 0.0;
Wave[94] = 0.0;
Wave[95] = 0.0;
Wave[96] = 0.0;
Wave[97] = 0.0;
Wave[98] = 0.0;
Wave[99] = 0.0;
Wave[100] = 0.0;
Wave[101] = 0.0;
Wave[102] = 0.0;
Wave[103] = 0.0;
Wave[104] = 0.0;
Wave[105] = 0.0;
Wave[106] = 0.0;
Wave[107] = -0.31201744;
Wave[108] = -0.38224792;
Wave[109] = -0.41823387;
Wave[110] = -0.44052696;
Wave[111] = -0.45562744;
Wave[112] = -0.4664917;
Wave[113] = -0.47186375;
Wave[114] = -0.47831917;
Wave[115] = -0.4853449;
Wave[116] = -0.48934555;
Wave[117] = -0.49016762;
Wave[118] = -0.49088287;
Wave[119] = -0.49673653;
Wave[120] = -0.49443054;
Wave[121] = -0.49573994;
Wave[122] = -0.5006771;
Wave[123] = -0.50155735;
Wave[124] = -0.49838257;
Wave[125] = -0.49894142;
Wave[126] = -0.49944687;
Wave[127] = -0.49986076;
Selected.WaveTable.set( 3 , Wave );
Wave[0] = 0.4960785;
Wave[1] = 0.49568462;
Wave[2] = 0.49524498;
Wave[3] = 0.494668;
Wave[4] = 0.49694443;
Wave[5] = 0.49712086;
Wave[6] = 0.49565125;
Wave[7] = 0.49103355;
Wave[8] = 0.49343872;
Wave[9] = 0.4877348;
Wave[10] = 0.4893818;
Wave[11] = 0.48270226;
Wave[12] = 0.47922134;
Wave[13] = 0.4747963;
Wave[14] = 0.4706459;
Wave[15] = 0.4645357;
Wave[16] = 0.45213318;
Wave[17] = 0.44146442;
Wave[18] = 0.41967773;
Wave[19] = 0.39403725;
Wave[20] = 0.33927536;
Wave[21] = 0.11698723;
Wave[22] = 0.0;
Wave[23] = 0.0;
Wave[24] = 0.0;
Wave[25] = 0.0;
Wave[26] = 0.0;
Wave[27] = 0.0;
Wave[28] = 0.0;
Wave[29] = 0.0;
Wave[30] = 0.0;
Wave[31] = 0.0;
Wave[32] = 0.0;
Wave[33] = 0.0;
Wave[34] = 0.0;
Wave[35] = 0.0;
Wave[36] = 0.0;
Wave[37] = 0.0;
Wave[38] = 0.0;
Wave[39] = 0.0;
Wave[40] = 0.0;
Wave[41] = 0.0;
Wave[42] = 0.0;
Wave[43] = 0.0;
Wave[44] = 0.0;
Wave[45] = 0.0;
Wave[46] = 0.0;
Wave[47] = 0.0;
Wave[48] = 0.0;
Wave[49] = 0.0;
Wave[50] = 0.0;
Wave[51] = 0.0;
Wave[52] = 0.0;
Wave[53] = 0.0;
Wave[54] = 0.0;
Wave[55] = 0.0;
Wave[56] = 0.0;
Wave[57] = 0.0;
Wave[58] = 0.0;
Wave[59] = 0.0;
Wave[60] = 0.0;
Wave[61] = 0.0;
Wave[62] = 0.0;
Wave[63] = 0.0;
Wave[64] = 0.0;
Wave[65] = 0.0;
Wave[66] = 0.0;
Wave[67] = 0.0;
Wave[68] = 0.0;
Wave[69] = 0.0;
Wave[70] = 0.0;
Wave[71] = 0.0;
Wave[72] = 0.0;
Wave[73] = 0.0;
Wave[74] = 0.0;
Wave[75] = 0.0;
Wave[76] = 0.0;
Wave[77] = 0.0;
Wave[78] = 0.0;
Wave[79] = 0.0;
Wave[80] = 0.0;
Wave[81] = 0.0;
Wave[82] = 0.0;
Wave[83] = 0.0;
Wave[84] = 0.0;
Wave[85] = 0.0;
Wave[86] = 0.0;
Wave[87] = 0.0;
Wave[88] = 0.0;
Wave[89] = 0.0;
Wave[90] = 0.0;
Wave[91] = 0.0;
Wave[92] = 0.0;
Wave[93] = 0.0;
Wave[94] = 0.0;
Wave[95] = 0.0;
Wave[96] = 0.0;
Wave[97] = 0.0;
Wave[98] = 0.0;
Wave[99] = 0.0;
Wave[100] = 0.0;
Wave[101] = 0.0;
Wave[102] = 0.0;
Wave[103] = 0.0;
Wave[104] = 0.0;
Wave[105] = 0.0;
Wave[106] = 0.0;
Wave[107] = 0.0;
Wave[108] = 0.0;
Wave[109] = 0.0;
Wave[110] = 0.0;
Wave[111] = 0.0;
Wave[112] = 0.0;
Wave[113] = 0.0;
Wave[114] = 0.0;
Wave[115] = 0.0;
Wave[116] = 0.0;
Wave[117] = 0.0;
Wave[118] = 0.0;
Wave[119] = 0.0;
Wave[120] = 0.0;
Wave[121] = 0.0;
Wave[122] = 0.0;
Wave[123] = 0.0;
Wave[124] = 0.0;
Wave[125] = 0.0;
Wave[126] = 0.0;
Wave[127] = -0.4884081;
Selected.WaveTable.set( 4 , Wave );
Wave[0] = 0.49604797;
Wave[1] = 0.495368;
Wave[2] = 0.49444008;
Wave[3] = 0.49704933;
Wave[4] = 0.4913292;
Wave[5] = 0.4927311;
Wave[6] = 0.48913002;
Wave[7] = 0.48081875;
Wave[8] = 0.47442627;
Wave[9] = 0.46474934;
Wave[10] = 0.44244385;
Wave[11] = 0.409832;
Wave[12] = 0.32769394;
Wave[13] = 0.0;
Wave[14] = 0.0;
Wave[15] = 0.0;
Wave[16] = 0.0;
Wave[17] = 0.0;
Wave[18] = 0.0;
Wave[19] = 0.0;
Wave[20] = 0.0;
Wave[21] = 0.0;
Wave[22] = 0.0;
Wave[23] = 0.0;
Wave[24] = 0.0;
Wave[25] = 0.0;
Wave[26] = 0.0;
Wave[27] = 0.0;
Wave[28] = 0.0;
Wave[29] = 0.0;
Wave[30] = 0.0;
Wave[31] = 0.0;
Wave[32] = 0.0;
Wave[33] = 0.0;
Wave[34] = 0.0;
Wave[35] = 0.0;
Wave[36] = 0.0;
Wave[37] = 0.0;
Wave[38] = 0.0;
Wave[39] = 0.0;
Wave[40] = 0.0;
Wave[41] = 0.0;
Wave[42] = 0.0;
Wave[43] = 0.0;
Wave[44] = 0.0;
Wave[45] = 0.0;
Wave[46] = 0.0;
Wave[47] = 0.0;
Wave[48] = 0.0;
Wave[49] = 0.0;
Wave[50] = 0.0;
Wave[51] = 0.0;
Wave[52] = 0.0;
Wave[53] = 0.0;
Wave[54] = 0.0;
Wave[55] = 0.0;
Wave[56] = 0.0;
Wave[57] = 0.0;
Wave[58] = 0.0;
Wave[59] = 0.0;
Wave[60] = 0.0;
Wave[61] = 0.0;
Wave[62] = 0.0;
Wave[63] = 0.0;
Wave[64] = 0.0;
Wave[65] = 0.0;
Wave[66] = 0.0;
Wave[67] = 0.0;
Wave[68] = 0.0;
Wave[69] = 0.0;
Wave[70] = 0.0;
Wave[71] = 0.0;
Wave[72] = 0.0;
Wave[73] = 0.0;
Wave[74] = 0.0;
Wave[75] = 0.0;
Wave[76] = 0.0;
Wave[77] = 0.0;
Wave[78] = 0.0;
Wave[79] = 0.0;
Wave[80] = 0.0;
Wave[81] = 0.0;
Wave[82] = 0.0;
Wave[83] = 0.0;
Wave[84] = 0.0;
Wave[85] = 0.0;
Wave[86] = 0.0;
Wave[87] = 0.0;
Wave[88] = 0.0;
Wave[89] = 0.0;
Wave[90] = 0.0;
Wave[91] = 0.0;
Wave[92] = 0.0;
Wave[93] = 0.0;
Wave[94] = 0.0;
Wave[95] = 0.0;
Wave[96] = 0.0;
Wave[97] = 0.0;
Wave[98] = 0.0;
Wave[99] = 0.0;
Wave[100] = 0.0;
Wave[101] = 0.0;
Wave[102] = 0.0;
Wave[103] = 0.0;
Wave[104] = 0.0;
Wave[105] = 0.0;
Wave[106] = 0.0;
Wave[107] = 0.0;
Wave[108] = 0.0;
Wave[109] = 0.0;
Wave[110] = 0.0;
Wave[111] = 0.0;
Wave[112] = 0.0;
Wave[113] = -0.28205395;
Wave[114] = -0.39137077;
Wave[115] = -0.42966843;
Wave[116] = -0.45636368;
Wave[117] = -0.4690466;
Wave[118] = -0.4769516;
Wave[119] = -0.48387432;
Wave[120] = -0.48986053;
Wave[121] = -0.49137688;
Wave[122] = -0.49783516;
Wave[123] = -0.4958353;
Wave[124] = -0.50117874;
Wave[125] = -0.4983673;
Wave[126] = -0.4991703;
Wave[127] = -0.49978924;
Selected.WaveTable.set( 5 , Wave );
Wave[0] = 0.4960785;
Wave[1] = 0.49587345;
Wave[2] = 0.49567032;
Wave[3] = 0.4954481;
Wave[4] = 0.49519348;
Wave[5] = 0.49491596;
Wave[6] = 0.4946041;
Wave[7] = 0.49424648;
Wave[8] = 0.49777222;
Wave[9] = 0.49736118;
Wave[10] = 0.4968891;
Wave[11] = 0.49637794;
Wave[12] = 0.49189377;
Wave[13] = 0.4912672;
Wave[14] = 0.49056053;
Wave[15] = 0.4936819;
Wave[16] = 0.4928131;
Wave[17] = 0.48789978;
Wave[18] = 0.48682022;
Wave[19] = 0.48950005;
Wave[20] = 0.48521423;
Wave[21] = 0.4827175;
Wave[22] = 0.48489952;
Wave[23] = 0.47903538;
Wave[24] = 0.48073578;
Wave[25] = 0.47822666;
Wave[26] = 0.47148514;
Wave[27] = 0.4682598;
Wave[28] = 0.46451187;
Wave[29] = 0.46046448;
Wave[30] = 0.4576397;
Wave[31] = 0.4520092;
Wave[32] = 0.4462738;
Wave[33] = 0.43526745;
Wave[34] = 0.42538834;
Wave[35] = 0.41509247;
Wave[36] = 0.39842987;
Wave[37] = 0.37841702;
Wave[38] = 0.34524345;
Wave[39] = 0.30338764;
Wave[40] = 0.16029358;
Wave[41] = 0.0;
Wave[42] = 0.0;
Wave[43] = 0.0;
Wave[44] = 0.0;
Wave[45] = 0.0;
Wave[46] = 0.0;
Wave[47] = 0.0;
Wave[48] = 0.0;
Wave[49] = 0.0;
Wave[50] = 0.0;
Wave[51] = 0.0;
Wave[52] = 0.0;
Wave[53] = 0.0;
Wave[54] = 0.0;
Wave[55] = 0.0;
Wave[56] = 0.0;
Wave[57] = 0.0;
Wave[58] = 0.0;
Wave[59] = 0.0;
Wave[60] = 0.0;
Wave[61] = 0.0;
Wave[62] = 0.0;
Wave[63] = 0.0;
Wave[64] = 0.0;
Wave[65] = 0.0;
Wave[66] = 0.0;
Wave[67] = 0.0;
Wave[68] = 0.0;
Wave[69] = 0.0;
Wave[70] = 0.0;
Wave[71] = 0.0;
Wave[72] = 0.0;
Wave[73] = 0.0;
Wave[74] = 0.0;
Wave[75] = 0.0;
Wave[76] = 0.0;
Wave[77] = 0.0;
Wave[78] = 0.0;
Wave[79] = 0.0;
Wave[80] = 0.0;
Wave[81] = 0.0;
Wave[82] = 0.0;
Wave[83] = 0.0;
Wave[84] = 0.0;
Wave[85] = 0.0;
Wave[86] = 0.0;
Wave[87] = 0.0;
Wave[88] = -0.28250885;
Wave[89] = -0.3384695;
Wave[90] = -0.36959076;
Wave[91] = -0.39253998;
Wave[92] = -0.41004944;
Wave[93] = -0.4236784;
Wave[94] = -0.43699074;
Wave[95] = -0.44615078;
Wave[96] = -0.4547882;
Wave[97] = -0.45978832;
Wave[98] = -0.46485138;
Wave[99] = -0.4669447;
Wave[100] = -0.4718361;
Wave[101] = -0.47648525;
Wave[102] = -0.4811802;
Wave[103] = -0.47988033;
Wave[104] = -0.4860916;
Wave[105] = -0.4849472;
Wave[106] = -0.48991394;
Wave[107] = -0.48763084;
Wave[108] = -0.49293137;
Wave[109] = -0.4905548;
Wave[110] = -0.49144554;
Wave[111] = -0.49636936;
Wave[112] = -0.49728394;
Wave[113] = -0.4954157;
Wave[114] = -0.4949398;
Wave[115] = -0.49556828;
Wave[116] = -0.49910355;
Wave[117] = -0.50063324;
Wave[118] = -0.50109863;
Wave[119] = -0.5015297;
Wave[120] = -0.5;
Wave[121] = -0.498394;
Wave[122] = -0.49870872;
Wave[123] = -0.49899006;
Wave[124] = -0.49925995;
Wave[125] = -0.4994793;
Wave[126] = -0.4997139;
Wave[127] = -0.49990273;
Selected.WaveTable.set( 6 , Wave );
Wave[0] = 0.48851013;
Wave[1] = 0.48708057;
Wave[2] = 0.49298096;
Wave[3] = 0.49063206;
Wave[4] = 0.49186707;
Wave[5] = 0.49676037;
Wave[6] = 0.49752808;
Wave[7] = 0.494215;
Wave[8] = 0.4947281;
Wave[9] = 0.49509144;
Wave[10] = 0.49539948;
Wave[11] = 0.4956379;
Wave[12] = 0.4957962;
Wave[13] = 0.4959259;
Wave[14] = 0.49601746;
Wave[15] = 0.4960575;
Wave[16] = 0.4960785;
Wave[17] = 0.49604797;
Wave[18] = 0.49598694;
Wave[19] = 0.49587822;
Wave[20] = 0.49572372;
Wave[21] = 0.49554825;
Wave[22] = 0.49530602;
Wave[23] = 0.49496078;
Wave[24] = 0.4945221;
Wave[25] = 0.4979143;
Wave[26] = 0.49722862;
Wave[27] = 0.49634838;
Wave[28] = 0.49136353;
Wave[29] = 0.49368668;
Wave[30] = 0.48974228;
Wave[31] = 0.49000072;
Wave[32] = 0.48336792;
Wave[33] = 0.48114395;
Wave[34] = 0.47560692;
Wave[35] = 0.47412872;
Wave[36] = 0.46343994;
Wave[37] = 0.4567299;
Wave[38] = 0.4450283;
Wave[39] = 0.43540192;
Wave[40] = 0.41534424;
Wave[41] = 0.39927006;
Wave[42] = 0.37123108;
Wave[43] = 0.3442564;
Wave[44] = 0.3058586;
Wave[45] = 0.25712585;
Wave[46] = 0.16037369;
Wave[47] = 0.029519081;
Wave[48] = -0.0019378662;
Wave[49] = 0.07436085;
Wave[50] = 0.22535324;
Wave[51] = 0.27807426;
Wave[52] = 0.32381058;
Wave[53] = 0.35407066;
Wave[54] = 0.3818512;
Wave[55] = 0.40444946;
Wave[56] = 0.42264557;
Wave[57] = 0.4374199;
Wave[58] = 0.452713;
Wave[59] = 0.46053982;
Wave[60] = 0.46945572;
Wave[61] = 0.47630596;
Wave[62] = 0.48147774;
Wave[63] = 0.4853964;
Wave[64] = -0.48727417;
Wave[65] = -0.4838295;
Wave[66] = -0.47951317;
Wave[67] = -0.47803497;
Wave[68] = -0.4673462;
Wave[69] = -0.46063614;
Wave[70] = -0.44893456;
Wave[71] = -0.43930817;
Wave[72] = -0.4192505;
Wave[73] = -0.4031763;
Wave[74] = -0.37513733;
Wave[75] = -0.34816265;
Wave[76] = -0.30976486;
Wave[77] = -0.2610321;
Wave[78] = -0.16427994;
Wave[79] = -0.03342533;
Wave[80] = -0.0019683838;
Wave[81] = -0.0782671;
Wave[82] = -0.22925949;
Wave[83] = -0.2819805;
Wave[84] = -0.32771683;
Wave[85] = -0.3579769;
Wave[86] = -0.38575745;
Wave[87] = -0.4083557;
Wave[88] = -0.42655182;
Wave[89] = -0.44132614;
Wave[90] = -0.45710754;
Wave[91] = -0.46444607;
Wave[92] = -0.47336197;
Wave[93] = -0.4802122;
Wave[94] = -0.485384;
Wave[95] = -0.48930264;
Wave[96] = -0.49241638;
Wave[97] = -0.49098682;
Wave[98] = -0.4968872;
Wave[99] = -0.4945383;
Wave[100] = -0.49577332;
Wave[101] = -0.5006666;
Wave[102] = -0.5014343;
Wave[103] = -0.49885368;
Wave[104] = -0.49863434;
Wave[105] = -0.4989977;
Wave[106] = -0.49930573;
Wave[107] = -0.49954414;
Wave[108] = -0.49970245;
Wave[109] = -0.49983215;
Wave[110] = -0.4999237;
Wave[111] = -0.49996376;
Wave[112] = -0.49998474;
Wave[113] = -0.49995422;
Wave[114] = -0.4998932;
Wave[115] = -0.49978447;
Wave[116] = -0.49962997;
Wave[117] = -0.4994545;
Wave[118] = -0.49921227;
Wave[119] = -0.49886703;
Wave[120] = -0.49842834;
Wave[121] = -0.50182056;
Wave[122] = -0.5011349;
Wave[123] = -0.50025463;
Wave[124] = -0.49526978;
Wave[125] = -0.49759293;
Wave[126] = -0.49364853;
Wave[127] = -0.49390697;
Selected.WaveTable.set( 7 , Wave );
Wave[0] = 0.0072631836;
Wave[1] = 0.09886837;
Wave[2] = 0.19013405;
Wave[3] = 0.23463917;
Wave[4] = 0.257576;
Wave[5] = 0.2711916;
Wave[6] = 0.2867775;
Wave[7] = 0.2946043;
Wave[8] = 0.3068924;
Wave[9] = 0.3365879;
Wave[10] = 0.3991089;
Wave[11] = 0.42689228;
Wave[12] = 0.4493904;
Wave[13] = 0.45982456;
Wave[14] = 0.47120285;
Wave[15] = 0.47547913;
Wave[16] = 0.48442078;
Wave[17] = 0.48696327;
Wave[18] = 0.48718452;
Wave[19] = 0.49334335;
Wave[20] = 0.4912033;
Wave[21] = 0.4964819;
Wave[22] = 0.49756813;
Wave[23] = 0.49450588;
Wave[24] = 0.49521637;
Wave[25] = 0.49565125;
Wave[26] = 0.49570847;
Wave[27] = 0.49571228;
Wave[28] = 0.49578857;
Wave[29] = 0.49578857;
Wave[30] = 0.4958496;
Wave[31] = 0.4958706;
Wave[32] = 0.4958496;
Wave[33] = 0.49320793;
Wave[34] = 0.49050522;
Wave[35] = 0.4928732;
Wave[36] = 0.4868889;
Wave[37] = 0.486598;
Wave[38] = 0.48519325;
Wave[39] = 0.48119545;
Wave[40] = 0.47415924;
Wave[41] = 0.4671545;
Wave[42] = 0.46777153;
Wave[43] = 0.46831322;
Wave[44] = 0.47275925;
Wave[45] = 0.47326088;
Wave[46] = 0.47379494;
Wave[47] = 0.47430706;
Wave[48] = 0.4709015;
Wave[49] = 0.47137642;
Wave[50] = 0.47185135;
Wave[51] = 0.47232628;
Wave[52] = 0.47670364;
Wave[53] = 0.47712326;
Wave[54] = 0.47758102;
Wave[55] = 0.47802258;
Wave[56] = 0.4784088;
Wave[57] = 0.47773457;
Wave[58] = 0.4681568;
Wave[59] = 0.46180058;
Wave[60] = 0.45270157;
Wave[61] = 0.43364334;
Wave[62] = 0.4127121;
Wave[63] = 0.37638664;
Wave[64] = 0.30361938;
Wave[65] = -0.2223587;
Wave[66] = -0.35762596;
Wave[67] = -0.4024868;
Wave[68] = -0.43321228;
Wave[69] = -0.44918537;
Wave[70] = -0.4599018;
Wave[71] = -0.4716921;
Wave[72] = -0.47533417;
Wave[73] = -0.47959423;
Wave[74] = -0.4791546;
Wave[75] = -0.47878456;
Wave[76] = -0.48226547;
Wave[77] = -0.48184872;
Wave[78] = -0.48140907;
Wave[79] = -0.48098373;
Wave[80] = -0.4805298;
Wave[81] = -0.47615337;
Wave[82] = -0.4757023;
Wave[83] = -0.47521305;
Wave[84] = -0.47473907;
Wave[85] = -0.47813988;
Wave[86] = -0.47763252;
Wave[87] = -0.4771042;
Wave[88] = -0.47463226;
Wave[89] = -0.4767065;
Wave[90] = -0.47973442;
Wave[91] = -0.48362446;
Wave[92] = -0.48710632;
Wave[93] = -0.493783;
Wave[94] = -0.49204636;
Wave[95] = -0.49772263;
Wave[96] = -0.49539185;
Wave[97] = -0.49969482;
Wave[98] = -0.49973297;
Wave[99] = -0.49969482;
Wave[100] = -0.4996872;
Wave[101] = -0.49961853;
Wave[102] = -0.499588;
Wave[103] = -0.4995575;
Wave[104] = -0.49952698;
Wave[105] = -0.49939442;
Wave[106] = -0.49876595;
Wave[107] = -0.50018024;
Wave[108] = -0.50091934;
Wave[109] = -0.49577713;
Wave[110] = -0.49663925;
Wave[111] = -0.4948988;
Wave[112] = -0.49353027;
Wave[113] = -0.48894024;
Wave[114] = -0.48576927;
Wave[115] = -0.47626972;
Wave[116] = -0.4690323;
Wave[117] = -0.45915318;
Wave[118] = -0.44086075;
Wave[119] = -0.4189329;
Wave[120] = -0.3735733;
Wave[121] = -0.2956171;
Wave[122] = -0.2873993;
Wave[123] = -0.27113914;
Wave[124] = -0.25697327;
Wave[125] = -0.23630428;
Wave[126] = -0.16700935;
Wave[127] = -0.078635216;
Selected.WaveTable.set( 8 , Wave );
Wave[0] = 0.0033416748;
Wave[1] = 0.2840538;
Wave[2] = 0.33778572;
Wave[3] = 0.37115002;
Wave[4] = 0.39666367;
Wave[5] = 0.4108343;
Wave[6] = 0.42795372;
Wave[7] = 0.43780327;
Wave[8] = 0.44517517;
Wave[9] = 0.4535532;
Wave[10] = 0.4563961;
Wave[11] = 0.46362495;
Wave[12] = 0.4696808;
Wave[13] = 0.4734192;
Wave[14] = 0.4752121;
Wave[15] = 0.47558403;
Wave[16] = 0.4819641;
Wave[17] = 0.4802084;
Wave[18] = 0.4860096;
Wave[19] = 0.48378563;
Wave[20] = 0.48917007;
Wave[21] = 0.48658752;
Wave[22] = 0.48776054;
Wave[23] = 0.49269962;
Wave[24] = 0.4936447;
Wave[25] = 0.4905405;
Wave[26] = 0.49130058;
Wave[27] = 0.49195957;
Wave[28] = 0.49646378;
Wave[29] = 0.4970026;
Wave[30] = 0.4974842;
Wave[31] = 0.49792194;
Wave[32] = 0.4944458;
Wave[33] = 0.49470806;
Wave[34] = 0.4950199;
Wave[35] = 0.44475937;
Wave[36] = -0.47537613;
Wave[37] = -0.47069263;
Wave[38] = -0.46899414;
Wave[39] = -0.46017742;
Wave[40] = -0.4575653;
Wave[41] = -0.4496107;
Wave[42] = -0.4381218;
Wave[43] = -0.42686367;
Wave[44] = -0.41723633;
Wave[45] = -0.3997507;
Wave[46] = -0.37364388;
Wave[47] = -0.34047413;
Wave[48] = -0.2796173;
Wave[49] = 0.040934563;
Wave[50] = 0.29159737;
Wave[51] = 0.34437847;
Wave[52] = 0.37352753;
Wave[53] = 0.3950081;
Wave[54] = -0.4945011;
Wave[55] = -0.49759007;
Wave[56] = -0.4966507;
Wave[57] = -0.49168682;
Wave[58] = -0.4905262;
Wave[59] = -0.49314022;
Wave[60] = -0.48775482;
Wave[61] = -0.48973942;
Wave[62] = -0.48563957;
Wave[63] = -0.4859209;
Wave[64] = -0.47958374;
Wave[65] = -0.48069954;
Wave[66] = -0.4774723;
Wave[67] = -0.47376156;
Wave[68] = -0.46942902;
Wave[69] = -0.46267986;
Wave[70] = -0.45840073;
Wave[71] = -0.45062065;
Wave[72] = -0.44082642;
Wave[73] = -0.42911434;
Wave[74] = -0.41921043;
Wave[75] = -0.39838028;
Wave[76] = -0.37670517;
Wave[77] = -0.34321404;
Wave[78] = -0.2894535;
Wave[79] = -0.03168392;
Wave[80] = 0.28196716;
Wave[81] = 0.3363304;
Wave[82] = 0.37052536;
Wave[83] = 0.39643574;
Wave[84] = 0.41374588;
Wave[85] = 0.4254942;
Wave[86] = 0.4374466;
Wave[87] = 0.44592285;
Wave[88] = 0.45386505;
Wave[89] = 0.4560156;
Wave[90] = 0.46456528;
Wave[91] = 0.46942234;
Wave[92] = 0.47322083;
Wave[93] = 0.47258377;
Wave[94] = 0.47537422;
Wave[95] = 0.4817648;
Wave[96] = 0.48034668;
Wave[97] = 0.48567963;
Wave[98] = 0.4849472;
Wave[99] = 0.43192005;
Wave[100] = -0.4971695;
Wave[101] = -0.49581337;
Wave[102] = -0.49528313;
Wave[103] = -0.49441147;
Wave[104] = -0.49752045;
Wave[105] = -0.49660015;
Wave[106] = -0.49162292;
Wave[107] = -0.49045944;
Wave[108] = -0.493042;
Wave[109] = -0.48763084;
Wave[110] = -0.48986816;
Wave[111] = -0.48404312;
Wave[112] = -0.48580933;
Wave[113] = -0.47942448;
Wave[114] = -0.4790287;
Wave[115] = -0.4769888;
Wave[116] = -0.47349167;
Wave[117] = -0.46740913;
Wave[118] = -0.46012878;
Wave[119] = -0.45725822;
Wave[120] = -0.4488678;
Wave[121] = -0.44144154;
Wave[122] = -0.4315548;
Wave[123] = -0.41429806;
Wave[124] = -0.39710617;
Wave[125] = -0.37425137;
Wave[126] = -0.3429718;
Wave[127] = -0.28722477;
Selected.WaveTable.set( 9 , Wave );
Wave[0] = 0.4571228;
Wave[1] = 0.49116135;
Wave[2] = 0.49635315;
Wave[3] = 0.49735546;
Wave[4] = 0.49521255;
Wave[5] = 0.4948721;
Wave[6] = 0.49538612;
Wave[7] = 0.49577427;
Wave[8] = 0.48521423;
Wave[9] = 0.4775896;
Wave[10] = 0.48174667;
Wave[11] = 0.4826727;
Wave[12] = 0.4854126;
Wave[13] = 0.48402023;
Wave[14] = 0.4890766;
Wave[15] = 0.48992634;
Wave[16] = 0.48661804;
Wave[17] = 0.4869957;
Wave[18] = 0.48718262;
Wave[19] = 0.48718262;
Wave[20] = 0.48706818;
Wave[21] = 0.48669147;
Wave[22] = 0.49006653;
Wave[23] = 0.48935032;
Wave[24] = 0.48838043;
Wave[25] = 0.4832344;
Wave[26] = 0.4855976;
Wave[27] = 0.4798231;
Wave[28] = 0.4813881;
Wave[29] = 0.474679;
Wave[30] = 0.4712639;
Wave[31] = 0.468338;
Wave[32] = 0.46601868;
Wave[33] = 0.45731258;
Wave[34] = 0.45128822;
Wave[35] = 0.4404087;
Wave[36] = 0.43078613;
Wave[37] = 0.42140293;
Wave[38] = 0.4068699;
Wave[39] = 0.38594723;
Wave[40] = 0.3702469;
Wave[41] = 0.34821892;
Wave[42] = 0.32092857;
Wave[43] = 0.29863453;
Wave[44] = 0.27565765;
Wave[45] = 0.266963;
Wave[46] = 0.26568413;
Wave[47] = 0.27825928;
Wave[48] = 0.30062866;
Wave[49] = 0.32607746;
Wave[50] = 0.35377312;
Wave[51] = 0.3748188;
Wave[52] = 0.39912796;
Wave[53] = 0.41693592;
Wave[54] = 0.42865372;
Wave[55] = 0.44165134;
Wave[56] = 0.4534378;
Wave[57] = 0.46100235;
Wave[58] = 0.46793175;
Wave[59] = 0.47723675;
Wave[60] = 0.48103714;
Wave[61] = 0.48588276;
Wave[62] = 0.4889698;
Wave[63] = 0.48757458;
Wave[64] = 0.4571228;
Wave[65] = -0.375844;
Wave[66] = -0.28404236;
Wave[67] = 0.281456;
Wave[68] = 0.36732483;
Wave[69] = 0.40849972;
Wave[70] = 0.429348;
Wave[71] = 0.4451084;
Wave[72] = -0.01335144;
Wave[73] = -0.48023605;
Wave[74] = -0.47317505;
Wave[75] = -0.46792698;
Wave[76] = -0.4638939;
Wave[77] = -0.46169186;
Wave[78] = -0.4542961;
Wave[79] = -0.4483118;
Wave[80] = -0.4445343;
Wave[81] = -0.44575596;
Wave[82] = -0.44036674;
Wave[83] = -0.44027424;
Wave[84] = -0.44447708;
Wave[85] = -0.44400597;
Wave[86] = -0.4474163;
Wave[87] = -0.4522333;
Wave[88] = -0.45594788;
Wave[89] = -0.46125793;
Wave[90] = -0.46840477;
Wave[91] = -0.47316074;
Wave[92] = -0.4771347;
Wave[93] = -0.48048306;
Wave[94] = -0.47998428;
Wave[95] = -0.4828024;
Wave[96] = -0.48912048;
Wave[97] = -0.48731327;
Wave[98] = -0.49299622;
Wave[99] = -0.4906025;
Wave[100] = -0.49186325;
Wave[101] = -0.49683666;
Wave[102] = -0.49770737;
Wave[103] = -0.49452686;
Wave[104] = -0.49510956;
Wave[105] = -0.49557114;
Wave[106] = -0.49591827;
Wave[107] = -0.50009346;
Wave[108] = -0.50027466;
Wave[109] = -0.5003357;
Wave[110] = -0.5003357;
Wave[111] = -0.5002508;
Wave[112] = -0.5000305;
Wave[113] = -0.49586296;
Wave[114] = -0.4954586;
Wave[115] = -0.49487972;
Wave[116] = -0.49708176;
Wave[117] = -0.4971466;
Wave[118] = -0.49202728;
Wave[119] = -0.490489;
Wave[120] = -0.49046326;
Wave[121] = -0.48983383;
Wave[122] = -0.48256874;
Wave[123] = -0.48037148;
Wave[124] = -0.47523117;
Wave[125] = -0.4645691;
Wave[126] = -0.454731;
Wave[127] = -0.44120884;
Selected.WaveTable.set( 10 , Wave );
Wave[0] = 0.4944458;
Wave[1] = 0.49562073;
Wave[2] = 0.49524498;
Wave[3] = 0.49480343;
Wave[4] = 0.49425888;
Wave[5] = 0.4975443;
Wave[6] = 0.49685097;
Wave[7] = 0.49282265;
Wave[8] = 0.4910965;
Wave[9] = 0.49385452;
Wave[10] = 0.49244308;
Wave[11] = 0.48689842;
Wave[12] = 0.488842;
Wave[13] = 0.4825945;
Wave[14] = 0.4799919;
Wave[15] = 0.4818468;
Wave[16] = 0.47564697;
Wave[17] = 0.4769516;
Wave[18] = 0.473917;
Wave[19] = 0.46454144;
Wave[20] = 0.46137238;
Wave[21] = 0.45235157;
Wave[22] = 0.4372406;
Wave[23] = 0.42971897;
Wave[24] = 0.41844177;
Wave[25] = 0.40428448;
Wave[26] = 0.39300728;
Wave[27] = 0.373497;
Wave[28] = 0.3462143;
Wave[29] = 0.30491447;
Wave[30] = 0.23389053;
Wave[31] = -0.16799545;
Wave[32] = 0.46362305;
Wave[33] = 0.4711218;
Wave[34] = 0.46829414;
Wave[35] = 0.46872044;
Wave[36] = 0.46538925;
Wave[37] = 0.4595995;
Wave[38] = 0.45277214;
Wave[39] = 0.45059872;
Wave[40] = 0.44314575;
Wave[41] = 0.43714523;
Wave[42] = 0.42046547;
Wave[43] = 0.40006065;
Wave[44] = 0.36410522;
Wave[45] = 0.3035288;
Wave[46] = -0.073394775;
Wave[47] = -0.29298592;
Wave[48] = -0.3449707;
Wave[49] = -0.373641;
Wave[50] = -0.39501762;
Wave[51] = -0.42325306;
Wave[52] = -0.43766403;
Wave[53] = -0.4511013;
Wave[54] = -0.46247673;
Wave[55] = -0.46734333;
Wave[56] = -0.47453308;
Wave[57] = -0.48130894;
Wave[58] = -0.48435783;
Wave[59] = -0.4837141;
Wave[60] = -0.48898697;
Wave[61] = -0.48808765;
Wave[62] = -0.49374008;
Wave[63] = -0.49134064;
Wave[64] = 0.48043823;
Wave[65] = 0.48711205;
Wave[66] = 0.48941803;
Wave[67] = 0.48367977;
Wave[68] = 0.48550034;
Wave[69] = 0.47915363;
Wave[70] = 0.4762745;
Wave[71] = 0.47281837;
Wave[72] = 0.4688797;
Wave[73] = 0.4605055;
Wave[74] = 0.4528618;
Wave[75] = 0.4435501;
Wave[76] = 0.4278679;
Wave[77] = 0.4085598;
Wave[78] = 0.38490868;
Wave[79] = 0.35829067;
Wave[80] = 0.31973267;
Wave[81] = 0.256855;
Wave[82] = -0.14711761;
Wave[83] = -0.33280182;
Wave[84] = -0.37997818;
Wave[85] = -0.41208267;
Wave[86] = -0.4299698;
Wave[87] = -0.44100475;
Wave[88] = -0.4491577;
Wave[89] = -0.45380306;
Wave[90] = -0.4621086;
Wave[91] = -0.4643736;
Wave[92] = -0.46950912;
Wave[93] = -0.4739399;
Wave[94] = -0.47699738;
Wave[95] = -0.47580433;
Wave[96] = -0.33874512;
Wave[97] = 0.03026104;
Wave[98] = -0.26984596;
Wave[99] = -0.3228445;
Wave[100] = -0.35744858;
Wave[101] = -0.38022232;
Wave[102] = -0.39818192;
Wave[103] = -0.41229916;
Wave[104] = -0.42569733;
Wave[105] = -0.43394947;
Wave[106] = -0.44519043;
Wave[107] = -0.4571724;
Wave[108] = -0.46473312;
Wave[109] = -0.47423935;
Wave[110] = -0.47528458;
Wave[111] = -0.48195744;
Wave[112] = -0.48446655;
Wave[113] = -0.48273087;
Wave[114] = -0.4886074;
Wave[115] = -0.48730564;
Wave[116] = -0.49341965;
Wave[117] = -0.4913559;
Wave[118] = -0.49681854;
Wave[119] = -0.49496174;
Wave[120] = -0.49533844;
Wave[121] = -0.5001993;
Wave[122] = -0.5009861;
Wave[123] = -0.5016556;
Wave[124] = -0.4983406;
Wave[125] = -0.49884892;
Wave[126] = -0.49925995;
Wave[127] = -0.4996214;
Selected.WaveTable.set( 11 , Wave );
Wave[0] = 0.48213196;
Wave[1] = 0.4874258;
Wave[2] = 0.4879303;
Wave[3] = 0.4923153;
Wave[4] = 0.49274445;
Wave[5] = 0.4931364;
Wave[6] = 0.49352264;
Wave[7] = 0.4938116;
Wave[8] = 0.49409485;
Wave[9] = 0.49045372;
Wave[10] = 0.49063873;
Wave[11] = 0.49080086;
Wave[12] = 0.4908867;
Wave[13] = 0.49098206;
Wave[14] = 0.49109077;
Wave[15] = 0.49144363;
Wave[16] = 0.49171448;
Wave[17] = 0.49197006;
Wave[18] = 0.49215698;
Wave[19] = 0.49201584;
Wave[20] = 0.4917984;
Wave[21] = 0.49151993;
Wave[22] = 0.4911995;
Wave[23] = 0.49111938;
Wave[24] = 0.4911499;
Wave[25] = 0.49111938;
Wave[26] = 0.4910431;
Wave[27] = 0.49090862;
Wave[28] = 0.49074173;
Wave[29] = 0.49051094;
Wave[30] = 0.49264336;
Wave[31] = 0.49373436;
Wave[32] = 0.4954071;
Wave[33] = 0.49588013;
Wave[34] = 0.4957409;
Wave[35] = 0.49557304;
Wave[36] = 0.49539566;
Wave[37] = 0.49516487;
Wave[38] = 0.49489975;
Wave[39] = 0.4946251;
Wave[40] = 0.49422455;
Wave[41] = 0.49769115;
Wave[42] = 0.49698448;
Wave[43] = 0.49375057;
Wave[44] = 0.49073792;
Wave[45] = 0.49300575;
Wave[46] = 0.48703003;
Wave[47] = 0.48885632;
Wave[48] = 0.4862671;
Wave[49] = 0.479084;
Wave[50] = 0.4762478;
Wave[51] = 0.4676342;
Wave[52] = 0.45749283;
Wave[53] = 0.44391727;
Wave[54] = 0.4126854;
Wave[55] = 0.3632326;
Wave[56] = 0.029556274;
Wave[57] = -0.36066628;
Wave[58] = -0.42056465;
Wave[59] = -0.44750118;
Wave[60] = -0.46695328;
Wave[61] = -0.47797394;
Wave[62] = -0.48578072;
Wave[63] = -0.4872532;
Wave[64] = 0.48132324;
Wave[65] = 0.48500443;
Wave[66] = 0.47894096;
Wave[67] = 0.4683714;
Wave[68] = 0.4597168;
Wave[69] = 0.43862534;
Wave[70] = 0.40320206;
Wave[71] = 0.33554554;
Wave[72] = -0.26024628;
Wave[73] = -0.38546848;
Wave[74] = -0.42947388;
Wave[75] = -0.45314693;
Wave[76] = -0.46494293;
Wave[77] = -0.47739697;
Wave[78] = -0.48272705;
Wave[79] = -0.48542786;
Wave[80] = -0.48727417;
Wave[81] = -0.49359035;
Wave[82] = -0.4916191;
Wave[83] = -0.49747467;
Wave[84] = -0.4951172;
Wave[85] = -0.50023746;
Wave[86] = -0.5011959;
Wave[87] = -0.50176525;
Wave[88] = -0.4982605;
Wave[89] = -0.49859238;
Wave[90] = -0.498909;
Wave[91] = -0.4991579;
Wave[92] = -0.49936676;
Wave[93] = -0.49955273;
Wave[94] = -0.49968338;
Wave[95] = -0.49983215;
Wave[96] = -0.49539185;
Wave[97] = -0.497674;
Wave[98] = -0.49653053;
Wave[99] = -0.49438667;
Wave[100] = -0.49458313;
Wave[101] = -0.4947338;
Wave[102] = -0.4948616;
Wave[103] = -0.4949131;
Wave[104] = -0.49491882;
Wave[105] = -0.4948883;
Wave[106] = -0.49507904;
Wave[107] = -0.4953785;
Wave[108] = -0.4956398;
Wave[109] = -0.49583435;
Wave[110] = -0.49593735;
Wave[111] = -0.49573898;
Wave[112] = -0.49549866;
Wave[113] = -0.49519157;
Wave[114] = -0.49482918;
Wave[115] = -0.4947815;
Wave[116] = -0.49472046;
Wave[117] = -0.4946003;
Wave[118] = -0.494442;
Wave[119] = -0.49425316;
Wave[120] = -0.4979248;
Wave[121] = -0.4976387;
Wave[122] = -0.497324;
Wave[123] = -0.49697495;
Wave[124] = -0.49656296;
Wave[125] = -0.49611568;
Wave[126] = -0.49173164;
Wave[127] = -0.49121666;
Selected.WaveTable.set( 12 , Wave );
Wave[0] = 0.4577942;
Wave[1] = 0.4960785;
Wave[2] = 0.4960785;
Wave[3] = 0.4960785;
Wave[4] = 0.4960785;
Wave[5] = 0.4960785;
Wave[6] = 0.4960785;
Wave[7] = 0.4960785;
Wave[8] = 0.4960785;
Wave[9] = 0.4960785;
Wave[10] = 0.4960785;
Wave[11] = 0.4960785;
Wave[12] = 0.4960785;
Wave[13] = 0.4960785;
Wave[14] = 0.4960785;
Wave[15] = 0.4960785;
Wave[16] = 0.4960785;
Wave[17] = 0.4960785;
Wave[18] = 0.4960785;
Wave[19] = 0.4960785;
Wave[20] = 0.4960785;
Wave[21] = 0.4960785;
Wave[22] = 0.4960785;
Wave[23] = 0.4960785;
Wave[24] = 0.4960785;
Wave[25] = 0.4960785;
Wave[26] = 0.4960785;
Wave[27] = 0.4960785;
Wave[28] = 0.4960785;
Wave[29] = 0.4960785;
Wave[30] = 0.4960785;
Wave[31] = 0.4960785;
Wave[32] = 0.4960785;
Wave[33] = 0.4960785;
Wave[34] = 0.4960785;
Wave[35] = 0.4960785;
Wave[36] = 0.4960785;
Wave[37] = 0.4960785;
Wave[38] = 0.4960785;
Wave[39] = 0.4960785;
Wave[40] = 0.4960785;
Wave[41] = 0.4960785;
Wave[42] = 0.4960785;
Wave[43] = 0.4960785;
Wave[44] = 0.4960785;
Wave[45] = 0.4960785;
Wave[46] = 0.4960785;
Wave[47] = 0.4960785;
Wave[48] = 0.4960785;
Wave[49] = 0.4960785;
Wave[50] = 0.4960785;
Wave[51] = 0.4960785;
Wave[52] = 0.4960785;
Wave[53] = 0.4960785;
Wave[54] = 0.4960785;
Wave[55] = 0.4960785;
Wave[56] = 0.4960785;
Wave[57] = 0.4960785;
Wave[58] = 0.4960785;
Wave[59] = 0.4960785;
Wave[60] = 0.4960785;
Wave[61] = 0.4960785;
Wave[62] = 0.4960785;
Wave[63] = 0.4960785;
Wave[64] = 0.4960785;
Wave[65] = 0.4960785;
Wave[66] = 0.4960785;
Wave[67] = 0.4960785;
Wave[68] = 0.4960785;
Wave[69] = 0.4960785;
Wave[70] = 0.4960785;
Wave[71] = 0.4960785;
Wave[72] = 0.4960785;
Wave[73] = 0.4960785;
Wave[74] = 0.4960785;
Wave[75] = 0.4960785;
Wave[76] = 0.4960785;
Wave[77] = 0.4960785;
Wave[78] = 0.4960785;
Wave[79] = 0.4960785;
Wave[80] = 0.4960785;
Wave[81] = 0.4960785;
Wave[82] = 0.4960785;
Wave[83] = 0.4960785;
Wave[84] = 0.4960785;
Wave[85] = 0.4960785;
Wave[86] = 0.4960785;
Wave[87] = 0.4960785;
Wave[88] = 0.4960785;
Wave[89] = 0.4960785;
Wave[90] = 0.4960785;
Wave[91] = 0.4960785;
Wave[92] = 0.4960785;
Wave[93] = 0.4960785;
Wave[94] = 0.4960785;
Wave[95] = 0.4960785;
Wave[96] = 0.4960785;
Wave[97] = 0.4960785;
Wave[98] = 0.4960785;
Wave[99] = 0.4960785;
Wave[100] = 0.4960785;
Wave[101] = 0.4960785;
Wave[102] = 0.4960785;
Wave[103] = 0.4960785;
Wave[104] = 0.4960785;
Wave[105] = 0.4960785;
Wave[106] = 0.4960785;
Wave[107] = 0.4960785;
Wave[108] = 0.4960785;
Wave[109] = 0.4960785;
Wave[110] = 0.4960785;
Wave[111] = 0.4960785;
Wave[112] = 0.4960785;
Wave[113] = 0.4960785;
Wave[114] = 0.4960785;
Wave[115] = 0.4960785;
Wave[116] = 0.4960785;
Wave[117] = 0.4960785;
Wave[118] = 0.4960785;
Wave[119] = 0.4960785;
Wave[120] = 0.4960785;
Wave[121] = -0.49998474;
Wave[122] = -0.49998474;
Wave[123] = -0.49998474;
Wave[124] = -0.49998474;
Wave[125] = -0.49998474;
Wave[126] = -0.49998474;
Wave[127] = -0.49998474;
Selected.WaveTable.set( 16 , Wave );
?>
| {
"pile_set_name": "Github"
} |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import numpy as np
from ...core.node import OneTaskProcessorNode
class BoundingBoxTracker(OneTaskProcessorNode):
'''
Tracks bounding boxes from one frame to another.
It keeps an internal state representation that allows
it to track across frames.
'''
def _track(self, dets : np.array) -> np.array:
'''
- Arguments:
- dets: np.array of shape (nb_boxes, 6) \
Specifically (nb_boxes, [ymin, xmin, ymax, xmax, class_index, score])
'''
raise NotImplementedError("Subclass must implement _track method")
def process(self, dets : np.array) -> np.array:
'''
- Arguments:
- dets: np.array of shape (nb_boxes, 6) \
Specifically (nb_boxes, [ymin, xmin, ymax, xmax, class_index, score])
- Returns:
- tracks: np.array of shape (nb_boxes, 5) \
Specifically (nb_boxes, [ymin, xmin, ymax, xmax, track_id])
'''
return self._track(dets)
| {
"pile_set_name": "Github"
} |
@import url('widgets.css');
/* FORM ROWS */
.form-row {
overflow: hidden;
padding: 10px;
font-size: 13px;
border-bottom: 1px solid #eee;
}
.form-row img, .form-row input {
vertical-align: middle;
}
.form-row label input[type="checkbox"] {
margin-top: 0;
vertical-align: 0;
}
form .form-row p {
padding-left: 0;
}
.hidden {
display: none;
}
/* FORM LABELS */
label {
font-weight: normal;
color: #666;
font-size: 13px;
}
.required label, label.required {
font-weight: bold;
color: #333;
}
/* RADIO BUTTONS */
form ul.radiolist li {
list-style-type: none;
}
form ul.radiolist label {
float: none;
display: inline;
}
form ul.radiolist input[type="radio"] {
margin: -2px 4px 0 0;
padding: 0;
}
form ul.inline {
margin-left: 0;
padding: 0;
}
form ul.inline li {
float: left;
padding-right: 7px;
}
/* ALIGNED FIELDSETS */
.aligned label {
display: block;
padding: 4px 10px 0 0;
float: left;
width: 160px;
word-wrap: break-word;
line-height: 1;
}
.aligned label:not(.vCheckboxLabel):after {
content: '';
display: inline-block;
vertical-align: middle;
height: 26px;
}
.aligned label + p {
padding: 6px 0;
margin-top: 0;
margin-bottom: 0;
margin-left: 170px;
}
.aligned ul label {
display: inline;
float: none;
width: auto;
}
.aligned .form-row input {
margin-bottom: 0;
}
.colMS .aligned .vLargeTextField, .colMS .aligned .vXMLLargeTextField {
width: 350px;
}
form .aligned ul {
margin-left: 160px;
padding-left: 10px;
}
form .aligned ul.radiolist {
display: inline-block;
margin: 0;
padding: 0;
}
form .aligned p.help {
clear: left;
margin-top: 0;
margin-left: 160px;
padding-left: 10px;
}
form .aligned label + p.help {
margin-left: 0;
padding-left: 0;
}
form .aligned p.help:last-child {
margin-bottom: 0;
padding-bottom: 0;
}
form .aligned input + p.help,
form .aligned textarea + p.help,
form .aligned select + p.help {
margin-left: 160px;
padding-left: 10px;
}
form .aligned ul li {
list-style: none;
}
form .aligned table p {
margin-left: 0;
padding-left: 0;
}
.aligned .vCheckboxLabel {
float: none;
width: auto;
display: inline-block;
vertical-align: -3px;
padding: 0 0 5px 5px;
}
.aligned .vCheckboxLabel + p.help {
margin-top: -4px;
}
.colM .aligned .vLargeTextField, .colM .aligned .vXMLLargeTextField {
width: 610px;
}
.checkbox-row p.help {
margin-left: 0;
padding-left: 0;
}
fieldset .field-box {
float: left;
margin-right: 20px;
}
/* WIDE FIELDSETS */
.wide label {
width: 200px;
}
form .wide p, form .wide input + p.help {
margin-left: 200px;
}
form .wide p.help {
padding-left: 38px;
}
.colM fieldset.wide .vLargeTextField, .colM fieldset.wide .vXMLLargeTextField {
width: 450px;
}
/* COLLAPSED FIELDSETS */
fieldset.collapsed * {
display: none;
}
fieldset.collapsed h2, fieldset.collapsed {
display: block;
}
fieldset.collapsed {
border: 1px solid #eee;
border-radius: 4px;
overflow: hidden;
}
fieldset.collapsed h2 {
background: #f8f8f8;
color: #666;
}
fieldset .collapse-toggle {
color: #fff;
}
fieldset.collapsed .collapse-toggle {
background: transparent;
display: inline;
color: #447e9b;
}
/* MONOSPACE TEXTAREAS */
fieldset.monospace textarea {
font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
}
/* SUBMIT ROW */
.submit-row {
padding: 12px 14px;
margin: 0 0 20px;
background: #f8f8f8;
border: 1px solid #eee;
border-radius: 4px;
text-align: right;
overflow: hidden;
}
body.popup .submit-row {
overflow: auto;
}
.submit-row input {
height: 35px;
line-height: 15px;
margin: 0 0 0 5px;
}
.submit-row input.default {
margin: 0 0 0 8px;
text-transform: uppercase;
}
.submit-row p {
margin: 0.3em;
}
.submit-row p.deletelink-box {
float: left;
margin: 0;
}
.submit-row a.deletelink {
display: block;
background: #ba2121;
border-radius: 4px;
padding: 10px 15px;
height: 15px;
line-height: 15px;
color: #fff;
}
.submit-row a.deletelink:focus,
.submit-row a.deletelink:hover,
.submit-row a.deletelink:active {
background: #a41515;
}
/* CUSTOM FORM FIELDS */
.vSelectMultipleField {
vertical-align: top;
}
.vCheckboxField {
border: none;
}
.vDateField, .vTimeField {
margin-right: 2px;
margin-bottom: 4px;
}
.vDateField {
min-width: 6.85em;
}
.vTimeField {
min-width: 4.7em;
}
.vURLField {
width: 30em;
}
.vLargeTextField, .vXMLLargeTextField {
width: 48em;
}
.flatpages-flatpage #id_content {
height: 40.2em;
}
.module table .vPositiveSmallIntegerField {
width: 2.2em;
}
.vTextField {
width: 20em;
}
.vIntegerField {
width: 5em;
}
.vBigIntegerField {
width: 10em;
}
.vForeignKeyRawIdAdminField {
width: 5em;
}
/* INLINES */
.inline-group {
padding: 0;
margin: 0 0 30px;
}
.inline-group thead th {
padding: 8px 10px;
}
.inline-group .aligned label {
width: 160px;
}
.inline-related {
position: relative;
}
.inline-related h3 {
margin: 0;
color: #666;
padding: 5px;
font-size: 13px;
background: #f8f8f8;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
}
.inline-related h3 span.delete {
float: right;
}
.inline-related h3 span.delete label {
margin-left: 2px;
font-size: 11px;
}
.inline-related fieldset {
margin: 0;
background: #fff;
border: none;
width: 100%;
}
.inline-related fieldset.module h3 {
margin: 0;
padding: 2px 5px 3px 5px;
font-size: 11px;
text-align: left;
font-weight: bold;
background: #bcd;
color: #fff;
}
.inline-group .tabular fieldset.module {
border: none;
}
.inline-related.tabular fieldset.module table {
width: 100%;
}
.last-related fieldset {
border: none;
}
.inline-group .tabular tr.has_original td {
padding-top: 2em;
}
.inline-group .tabular tr td.original {
padding: 2px 0 0 0;
width: 0;
_position: relative;
}
.inline-group .tabular th.original {
width: 0px;
padding: 0;
}
.inline-group .tabular td.original p {
position: absolute;
left: 0;
height: 1.1em;
padding: 2px 9px;
overflow: hidden;
font-size: 9px;
font-weight: bold;
color: #666;
_width: 700px;
}
.inline-group ul.tools {
padding: 0;
margin: 0;
list-style: none;
}
.inline-group ul.tools li {
display: inline;
padding: 0 5px;
}
.inline-group div.add-row,
.inline-group .tabular tr.add-row td {
color: #666;
background: #f8f8f8;
padding: 8px 10px;
border-bottom: 1px solid #eee;
}
.inline-group .tabular tr.add-row td {
padding: 8px 10px;
border-bottom: 1px solid #eee;
}
.inline-group ul.tools a.add,
.inline-group div.add-row a,
.inline-group .tabular tr.add-row td a {
background: url(../img/icon-addlink.svg) 0 1px no-repeat;
padding-left: 16px;
font-size: 12px;
}
.empty-form {
display: none;
}
/* RELATED FIELD ADD ONE / LOOKUP */
.add-another, .related-lookup {
margin-left: 5px;
display: inline-block;
vertical-align: middle;
background-repeat: no-repeat;
background-size: 14px;
}
.add-another {
width: 16px;
height: 16px;
background-image: url(../img/icon-addlink.svg);
}
.related-lookup {
width: 16px;
height: 16px;
background-image: url(../img/search.svg);
}
form .related-widget-wrapper ul {
display: inline-block;
margin-left: 0;
padding-left: 0;
}
.clearable-file-input input {
margin-top: 0;
}
| {
"pile_set_name": "Github"
} |
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <ComponentKit/CKComponent.h>
#import <ABI36_0_0RCTSurfaceHostingComponent/ABI36_0_0RCTSurfaceHostingComponentOptions.h>
@class ABI36_0_0RCTSurface;
/**
* ComponentKit component represents given Surface instance.
*/
@interface ABI36_0_0RCTSurfaceHostingComponent : CKComponent
+ (instancetype)newWithSurface:(ABI36_0_0RCTSurface *)surface options:(ABI36_0_0RCTSurfaceHostingComponentOptions)options;
@end
| {
"pile_set_name": "Github"
} |
/*
* Cocktail, HTML rendering engine
* http://haxe.org/com/libs/cocktail
*
* Copyright (c) Silex Labs
* Cocktail is available under the MIT license
* http://www.silexlabs.org/labs/cocktail-licensing/
*/
package cocktail.html;
typedef ProgressEvent = cocktail.core.event.ProgressEvent; | {
"pile_set_name": "Github"
} |
* * * * * root /app/scripts/limit_containers
| {
"pile_set_name": "Github"
} |
config HFSPLUS_FS
tristate "Apple Extended HFS file system support"
depends on BLOCK
select NLS
select NLS_UTF8
help
If you say Y here, you will be able to mount extended format
Macintosh-formatted hard drive partitions with full read-write access.
This file system is often called HFS+ and was introduced with
MacOS 8. It includes all Mac specific filesystem data such as
data forks and creator codes, but it also has several UNIX
style features such as file ownership and permissions.
config HFSPLUS_FS_POSIX_ACL
bool "HFS+ POSIX Access Control Lists"
depends on HFSPLUS_FS
select FS_POSIX_ACL
help
POSIX Access Control Lists (ACLs) support permissions for users and
groups beyond the owner/group/world scheme.
To learn more about Access Control Lists, visit the POSIX ACLs for
Linux website <http://acl.bestbits.at/>.
It needs to understand that POSIX ACLs are treated only under
Linux. POSIX ACLs doesn't mean something under Mac OS X.
Mac OS X beginning with version 10.4 ("Tiger") support NFSv4 ACLs,
which are part of the NFSv4 standard.
If you don't know what Access Control Lists are, say N
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: bb7cc06f1689f364da847992b0da08f9
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
| {
"pile_set_name": "Github"
} |
{
"acno": "D09906",
"acquisitionYear": 1856,
"all_artists": "Joseph Mallord William Turner",
"catTextResId": 1149366,
"catalogueGroup": {
"accessionRanges": "D09889-D09986; D40813; D41524",
"completeStatus": "COMPLETE",
"finbergNumber": "CXXXV",
"groupType": "Turner Sketchbook",
"id": 65777,
"shortTitle": "Chemistry and Apuleia Sketchbook"
},
"classification": "on paper, unique",
"contributorCount": 1,
"contributors": [
{
"birthYear": 1775,
"date": "1775\u20131851",
"displayOrder": 1,
"fc": "Joseph Mallord William Turner",
"gender": "Male",
"id": 558,
"mda": "Turner, Joseph Mallord William",
"role": "artist",
"startLetter": "T"
}
],
"creditLine": "Accepted by the nation as part of the Turner Bequest 1856",
"dateRange": {
"endYear": 1813,
"startYear": 1813,
"text": "c.1813"
},
"dateText": "c.1813",
"depth": "",
"dimensions": "support: 88 x 113 mm",
"finberg": "CXXXV 10",
"foreignTitle": null,
"groupTitle": "Chemistry and Apuleia Sketchbook",
"height": "113",
"id": 37284,
"inscription": null,
"medium": "Graphite on paper",
"movementCount": 0,
"pageNumber": 21,
"subjectCount": 0,
"thumbnailCopyright": null,
"thumbnailUrl": "http://www.tate.org.uk/art/images/work/D/D09/D09906_8.jpg",
"title": "?A Tree and a Boat",
"units": "mm",
"url": "http://www.tate.org.uk/art/artworks/turner-a-tree-and-a-boat-d09906",
"width": "88"
} | {
"pile_set_name": "Github"
} |
.\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" This software is provided by Joseph Koshy ``as is'' and
.\" any express or implied warranties, including, but not limited to, the
.\" implied warranties of merchantability and fitness for a particular purpose
.\" are disclaimed. in no event shall Joseph Koshy be liable
.\" for any direct, indirect, incidental, special, exemplary, or consequential
.\" damages (including, but not limited to, procurement of substitute goods
.\" or services; loss of use, data, or profits; or business interruption)
.\" however caused and on any theory of liability, whether in contract, strict
.\" liability, or tort (including negligence or otherwise) arising in any way
.\" out of the use of this software, even if advised of the possibility of
.\" such damage.
.\"
.\" $Id: gelf_getsym.3 3734 2019-04-22 14:10:49Z jkoshy $
.\"
.Dd April 22, 2019
.Dt GELF_GETSYM 3
.Os
.Sh NAME
.Nm gelf_getsym ,
.Nm gelf_update_sym
.Nd read and update symbol information
.Sh LIBRARY
.Lb libelf
.Sh SYNOPSIS
.In gelf.h
.Ft "GElf_Sym *"
.Fn gelf_getsym "Elf_Data *data" "int ndx" "GElf_Sym *sym"
.Ft int
.Fn gelf_update_sym "Elf_Data *data" "int ndx" "GElf_Sym *sym"
.Sh DESCRIPTION
These convenience functions are used to retrieve and update class-dependent
.Vt Elf32_Sym
and
.Vt Elf64_Sym
structures in an ELF object.
.Pp
Argument
.Ar data
is an
.Vt Elf_Data
descriptor associated with a section of type
.Dv SHT_SYMTAB ,
.Dv SHT_DYNSYM
or
.Dv SHT_GNU_versym .
Argument
.Ar ndx
is the index of the symbol being retrieved or updated.
The class-independent
.Vt GElf_Sym
structure is described in
.Xr gelf 3 .
.Pp
Function
.Fn gelf_getsym
retrieves class-dependent symbol information at index
.Ar ndx
in data buffer
.Ar data
and copies it to the destination pointed to by argument
.Ar sym
after translation to class-independent form.
.Pp
Function
.Fn gelf_update_sym
converts the class-independent symbol information pointed to
by argument
.Ar sym
to class-dependent form, and writes it to the symbol entry at index
.Ar ndx
in the data buffer described by argument
.Ar data .
Function
.Fn gelf_update_sym
signals an error if any of the values in the class-independent
representation exceeds the representable limits of the target
type.
.Sh RETURN VALUES
Function
.Fn gelf_getsym
returns the value of argument
.Ar sym
if successful, or NULL in case of an error.
Function
.Fn gelf_update_sym
returns a non-zero value if successful, or zero in case of an error.
.Sh ERRORS
These functions may fail with the following errors:
.Bl -tag -width "[ELF_E_RESOURCE]"
.It Bq Er ELF_E_ARGUMENT
Arguments
.Ar data
or
.Ar sym
were NULL.
.It Bq Er ELF_E_ARGUMENT
Argument
.Ar ndx
was less than zero or larger than the number of symbols in the data
descriptor.
.It Bq Er ELF_E_ARGUMENT
Data descriptor
.Ar data
was not associated with a section containing symbol information.
.It Bq Er ELF_E_RANGE
A value was not representable in the target type.
.It Bq Er ELF_E_VERSION
The
.Vt Elf_Data
descriptor denoted by argument
.Ar data
is associated with an ELF object with an unsupported version.
.El
.Sh SEE ALSO
.Xr elf 3 ,
.Xr elf_getdata 3 ,
.Xr elf_getscn 3 ,
.Xr gelf 3 ,
.Xr gelf_getsyminfo 3 ,
.Xr gelf_update_syminfo 3
| {
"pile_set_name": "Github"
} |
/* Generated by camel build tools - do NOT edit this file! */
package org.apache.camel.component.aws.ec2;
import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.spi.PropertyConfigurerGetter;
import org.apache.camel.util.CaseInsensitiveMap;
import org.apache.camel.support.component.PropertyConfigurerSupport;
/**
* Generated by camel build tools - do NOT edit this file!
*/
@SuppressWarnings("unchecked")
public class EC2EndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
@Override
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
EC2Endpoint target = (EC2Endpoint) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "accesskey":
case "accessKey": target.getConfiguration().setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
case "amazonec2client":
case "amazonEc2Client": target.getConfiguration().setAmazonEc2Client(property(camelContext, com.amazonaws.services.ec2.AmazonEC2.class, value)); return true;
case "autodiscoverclient":
case "autoDiscoverClient": target.getConfiguration().setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
case "basicpropertybinding":
case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
case "lazystartproducer":
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
case "operation": target.getConfiguration().setOperation(property(camelContext, org.apache.camel.component.aws.ec2.EC2Operations.class, value)); return true;
case "proxyhost":
case "proxyHost": target.getConfiguration().setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
case "proxyport":
case "proxyPort": target.getConfiguration().setProxyPort(property(camelContext, java.lang.Integer.class, value)); return true;
case "proxyprotocol":
case "proxyProtocol": target.getConfiguration().setProxyProtocol(property(camelContext, com.amazonaws.Protocol.class, value)); return true;
case "region": target.getConfiguration().setRegion(property(camelContext, java.lang.String.class, value)); return true;
case "secretkey":
case "secretKey": target.getConfiguration().setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
case "synchronous": target.setSynchronous(property(camelContext, boolean.class, value)); return true;
default: return false;
}
}
@Override
public Map<String, Object> getAllOptions(Object target) {
Map<String, Object> answer = new CaseInsensitiveMap();
answer.put("accessKey", java.lang.String.class);
answer.put("amazonEc2Client", com.amazonaws.services.ec2.AmazonEC2.class);
answer.put("autoDiscoverClient", boolean.class);
answer.put("basicPropertyBinding", boolean.class);
answer.put("lazyStartProducer", boolean.class);
answer.put("operation", org.apache.camel.component.aws.ec2.EC2Operations.class);
answer.put("proxyHost", java.lang.String.class);
answer.put("proxyPort", java.lang.Integer.class);
answer.put("proxyProtocol", com.amazonaws.Protocol.class);
answer.put("region", java.lang.String.class);
answer.put("secretKey", java.lang.String.class);
answer.put("synchronous", boolean.class);
return answer;
}
@Override
public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
EC2Endpoint target = (EC2Endpoint) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "accesskey":
case "accessKey": return target.getConfiguration().getAccessKey();
case "amazonec2client":
case "amazonEc2Client": return target.getConfiguration().getAmazonEc2Client();
case "autodiscoverclient":
case "autoDiscoverClient": return target.getConfiguration().isAutoDiscoverClient();
case "basicpropertybinding":
case "basicPropertyBinding": return target.isBasicPropertyBinding();
case "lazystartproducer":
case "lazyStartProducer": return target.isLazyStartProducer();
case "operation": return target.getConfiguration().getOperation();
case "proxyhost":
case "proxyHost": return target.getConfiguration().getProxyHost();
case "proxyport":
case "proxyPort": return target.getConfiguration().getProxyPort();
case "proxyprotocol":
case "proxyProtocol": return target.getConfiguration().getProxyProtocol();
case "region": return target.getConfiguration().getRegion();
case "secretkey":
case "secretKey": return target.getConfiguration().getSecretKey();
case "synchronous": return target.isSynchronous();
default: return null;
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.net;
import java.lang.annotation.Native;
/**
* Represents the service level properties for the platform specific socket
* option {@link ExtendedSocketOptions#SO_FLOW_SLA}.
* <p>
* The priority and bandwidth parameters must be set before
* setting the socket option.
* <p>
* When the {@code SO_FLOW_SLA} option is set then it may not take effect
* immediately. If the value of the socket option is obtained with
* {@code getOption()} then the status may be returned as {@code INPROGRESS}
* until it takes effect. The priority and bandwidth values are only valid when
* the status is returned as OK.
* <p>
* When a security manager is installed, a {@link NetworkPermission}
* is required to set or get this option.
*
* @since 1.8
*/
public class SocketFlow {
@Native public static final int UNSET = -1;
@Native public static final int NORMAL_PRIORITY = 1;
@Native public static final int HIGH_PRIORITY = 2;
@Native private static final int NO_STATUS_VALUE = 0;
@Native private static final int OK_VALUE = 1;
@Native private static final int NO_PERMISSION_VALUE = 2;
@Native private static final int NOT_CONNECTED_VALUE = 3;
@Native private static final int NOT_SUPPORTED_VALUE = 4;
@Native private static final int ALREADY_CREATED_VALUE = 5;
@Native private static final int IN_PROGRESS_VALUE = 6;
@Native private static final int OTHER_VALUE = 7;
/**
* Enumeration of the return values from the SO_FLOW_SLA
* socket option. Both setting and getting the option return
* one of these statuses, which reflect the state of socket's
* flow.
*
* @since 1.8
*/
public enum Status {
/**
* Set or get socket option has not been called yet. Status
* values can only be retrieved after calling set or get.
*/
NO_STATUS(NO_STATUS_VALUE),
/**
* Flow successfully created.
*/
OK(OK_VALUE),
/**
* Caller has no permission to create flow.
*/
NO_PERMISSION(NO_PERMISSION_VALUE),
/**
* Flow can not be created because socket is not connected.
*/
NOT_CONNECTED(NOT_CONNECTED_VALUE),
/**
* Flow creation not supported for this socket.
*/
NOT_SUPPORTED(NOT_SUPPORTED_VALUE),
/**
* A flow already exists with identical attributes.
*/
ALREADY_CREATED(ALREADY_CREATED_VALUE),
/**
* A flow is being created.
*/
IN_PROGRESS(IN_PROGRESS_VALUE),
/**
* Some other unspecified error.
*/
OTHER(OTHER_VALUE);
private final int value;
Status(int value) { this.value = value; }
static Status from(int value) {
if (value == NO_STATUS.value) return NO_STATUS;
else if (value == OK.value) return OK;
else if (value == NO_PERMISSION.value) return NO_PERMISSION;
else if (value == NOT_CONNECTED.value) return NOT_CONNECTED;
else if (value == NOT_SUPPORTED.value) return NOT_SUPPORTED;
else if (value == ALREADY_CREATED.value) return ALREADY_CREATED;
else if (value == IN_PROGRESS.value) return IN_PROGRESS;
else if (value == OTHER.value) return OTHER;
else throw new InternalError("Unknown value: " + value);
}
}
private int priority = NORMAL_PRIORITY;
private long bandwidth = UNSET;
private Status status = Status.NO_STATUS;
/**
* Creates a new SocketFlow that can be used to set the SO_FLOW_SLA
* socket option and create a socket flow.
*/
public static SocketFlow create() {
return new SocketFlow();
}
private SocketFlow() { }
/**
* Sets this SocketFlow's priority. Must be either NORMAL_PRIORITY
* HIGH_PRIORITY. If not set, a flow's priority is normal.
*
* @throws IllegalArgumentException if priority is not NORMAL_PRIORITY or
* HIGH_PRIORITY.
*/
public SocketFlow priority(int priority) {
if (priority != NORMAL_PRIORITY && priority != HIGH_PRIORITY)
throw new IllegalArgumentException("invalid priority :" + priority);
this.priority = priority;
return this;
}
/**
* Sets this SocketFlow's bandwidth. Must be greater than or equal to zero.
* A value of zero drops all packets for the socket.
*
* @throws IllegalArgumentException if bandwidth is less than zero.
*/
public SocketFlow bandwidth(long bandwidth) {
if (bandwidth < 0)
throw new IllegalArgumentException("invalid bandwidth: " + bandwidth);
this.bandwidth = bandwidth;
return this;
}
/**
* Returns this SocketFlow's priority.
*/
public int priority() {
return priority;
}
/**
* Returns this SocketFlow's bandwidth.
*
* @return this SocketFlow's bandwidth, or {@code -1} if status is not OK.
*/
public long bandwidth() {
return bandwidth;
}
/**
* Returns the Status value of this SocketFlow. NO_STATUS is returned
* if the object was not used in a call to set or get the option.
*/
public Status status() {
return status;
}
void status(int status) {
this.status = Status.from(status);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder(super.toString());
sb.append(" [ priority=").append(priority())
.append(", bandwidth=").append(bandwidth())
.append(", status=").append(status())
.append(" ]");
return sb.toString();
}
}
| {
"pile_set_name": "Github"
} |
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2014-2018 Broadcom
* All rights reserved.
*/
#ifndef _BNXT_TXR_H_
#define _BNXT_TXR_H_
#include <rte_io.h>
#define MAX_TX_RINGS 16
#define BNXT_TX_PUSH_THRESH 92
#define BNXT_MAX_TSO_SEGS 32
#define BNXT_MIN_PKT_SIZE 52
#define B_TX_DB(db, prod) rte_write32((DB_KEY_TX | (prod)), db)
struct bnxt_tx_ring_info {
uint16_t tx_prod;
uint16_t tx_cons;
struct bnxt_db_info tx_db;
struct tx_bd_long *tx_desc_ring;
struct bnxt_sw_tx_bd *tx_buf_ring;
rte_iova_t tx_desc_mapping;
#define BNXT_DEV_STATE_CLOSING 0x1
uint32_t dev_state;
struct bnxt_ring *tx_ring_struct;
};
struct bnxt_sw_tx_bd {
struct rte_mbuf *mbuf; /* mbuf associated with TX descriptor */
uint8_t is_gso;
unsigned short nr_bds;
};
static inline uint32_t bnxt_tx_bds_in_hw(struct bnxt_tx_queue *txq)
{
return ((txq->tx_ring->tx_prod - txq->tx_ring->tx_cons) &
txq->tx_ring->tx_ring_struct->ring_mask);
}
static inline uint32_t bnxt_tx_avail(struct bnxt_tx_queue *txq)
{
/* Tell compiler to fetch tx indices from memory. */
rte_compiler_barrier();
return ((txq->tx_ring->tx_ring_struct->ring_size -
bnxt_tx_bds_in_hw(txq)) - 1);
}
void bnxt_free_tx_rings(struct bnxt *bp);
int bnxt_init_one_tx_ring(struct bnxt_tx_queue *txq);
int bnxt_init_tx_ring_struct(struct bnxt_tx_queue *txq, unsigned int socket_id);
uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
uint16_t nb_pkts);
uint16_t bnxt_dummy_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
uint16_t nb_pkts);
#ifdef RTE_ARCH_X86
uint16_t bnxt_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
uint16_t nb_pkts);
#endif
int bnxt_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
int bnxt_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);
#define PKT_TX_OIP_IIP_TCP_UDP_CKSUM (PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM | \
PKT_TX_IP_CKSUM | PKT_TX_OUTER_IP_CKSUM)
#define PKT_TX_OIP_IIP_UDP_CKSUM (PKT_TX_UDP_CKSUM | \
PKT_TX_IP_CKSUM | PKT_TX_OUTER_IP_CKSUM)
#define PKT_TX_OIP_IIP_TCP_CKSUM (PKT_TX_TCP_CKSUM | \
PKT_TX_IP_CKSUM | PKT_TX_OUTER_IP_CKSUM)
#define PKT_TX_IIP_TCP_UDP_CKSUM (PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM | \
PKT_TX_IP_CKSUM)
#define PKT_TX_IIP_TCP_CKSUM (PKT_TX_TCP_CKSUM | PKT_TX_IP_CKSUM)
#define PKT_TX_IIP_UDP_CKSUM (PKT_TX_UDP_CKSUM | PKT_TX_IP_CKSUM)
#define PKT_TX_OIP_TCP_UDP_CKSUM (PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM | \
PKT_TX_OUTER_IP_CKSUM)
#define PKT_TX_OIP_UDP_CKSUM (PKT_TX_UDP_CKSUM | \
PKT_TX_OUTER_IP_CKSUM)
#define PKT_TX_OIP_TCP_CKSUM (PKT_TX_TCP_CKSUM | \
PKT_TX_OUTER_IP_CKSUM)
#define PKT_TX_OIP_IIP_CKSUM (PKT_TX_IP_CKSUM | \
PKT_TX_OUTER_IP_CKSUM)
#define PKT_TX_TCP_UDP_CKSUM (PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM)
#define TX_BD_FLG_TIP_IP_TCP_UDP_CHKSUM (TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM | \
TX_BD_LONG_LFLAGS_T_IP_CHKSUM | \
TX_BD_LONG_LFLAGS_IP_CHKSUM)
#define TX_BD_FLG_IP_TCP_UDP_CHKSUM (TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM | \
TX_BD_LONG_LFLAGS_IP_CHKSUM)
#define TX_BD_FLG_TIP_IP_CHKSUM (TX_BD_LONG_LFLAGS_T_IP_CHKSUM | \
TX_BD_LONG_LFLAGS_IP_CHKSUM)
#define TX_BD_FLG_TIP_TCP_UDP_CHKSUM (TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM | \
TX_BD_LONG_LFLAGS_T_IP_CHKSUM)
#endif
| {
"pile_set_name": "Github"
} |
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DebuggerSample", "DebuggerSample.csproj", "{1C723058-89C6-43E6-AF8F-75EBBC68B6F6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1C723058-89C6-43E6-AF8F-75EBBC68B6F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C723058-89C6-43E6-AF8F-75EBBC68B6F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C723058-89C6-43E6-AF8F-75EBBC68B6F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C723058-89C6-43E6-AF8F-75EBBC68B6F6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
| {
"pile_set_name": "Github"
} |
Id Name Level[1] Level[2] Level[3] Level[4] Level[5] Level[6] Level[7] Level[8] Level[9] Level[10] Level[11] Level[12] Level[13] Level[14] Level[15] Level[16] Level[17] Level[18] Level[19] Level[20] Level[21] Level[22] Level[23] Level[24] Level[25] Level[26] Level[27] Level[28] Level[29] Level[30]
83200096 AddBuff 83200096
83200097 AddMissile 832099|1
83200098 AddBuff 83200098
83200099 HideJoint Root
83200094 AddBuff 83200094
83200095 AddNpcState 21
83200092 AddBuff 83200092
83200093 AddNpcState 22
83220096 AddBuff 83220096
83220097 AddMissile 832299|1
83220098 AddBuff 83220098
83220099 HideJoint Root
83220094 AddBuff 83220094
83220095 AddNpcState 21
83220092 AddBuff 83220092
83220093 AddNpcState 22
83310096 AddBuff 83310096
83310097 AddMissile 833199|1
83310098 AddBuff 83310098
83310099 HideJoint Root
83310094 AddBuff 83310094
83310095 AddNpcState 21
83310092 AddBuff 83310092
83310093 AddNpcState 22
83330096 AddBuff 83330096
83330097 AddMissile 833399|1
83330098 AddBuff 83330098
83330099 HideJoint Root
83330094 AddBuff 83330094
83330095 AddNpcState 21
83330092 AddBuff 83330092
83330093 AddNpcState 22
| {
"pile_set_name": "Github"
} |
import React from 'react';
import PropTypes from 'prop-types';
class ModalActions extends React.Component {
render() {
return (
<div className="cf-modal__actions">
{this.props.children}
</div>
);
}
}
ModalActions.propTypes = {
children: PropTypes.node
};
export default ModalActions;
| {
"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 rc4 implements RC4 encryption, as defined in Bruce Schneier's
// Applied Cryptography.
package rc4
// BUG(agl): RC4 is in common use but has design weaknesses that make
// it a poor choice for new protocols.
import "strconv"
// A Cipher is an instance of RC4 using a particular key.
type Cipher struct {
s [256]uint32
i, j uint8
}
type KeySizeError int
func (k KeySizeError) Error() string {
return "crypto/rc4: invalid key size " + strconv.Itoa(int(k))
}
// NewCipher creates and returns a new Cipher. The key argument should be the
// RC4 key, at least 1 byte and at most 256 bytes.
func NewCipher(key []byte) (*Cipher, error) {
k := len(key)
if k < 1 || k > 256 {
return nil, KeySizeError(k)
}
var c Cipher
for i := 0; i < 256; i++ {
c.s[i] = uint32(i)
}
var j uint8 = 0
for i := 0; i < 256; i++ {
j += uint8(c.s[i]) + key[i%k]
c.s[i], c.s[j] = c.s[j], c.s[i]
}
return &c, nil
}
// Reset zeros the key data so that it will no longer appear in the
// process's memory.
func (c *Cipher) Reset() {
for i := range c.s {
c.s[i] = 0
}
c.i, c.j = 0, 0
}
// xorKeyStreamGeneric sets dst to the result of XORing src with the
// key stream. Dst and src may be the same slice but otherwise should
// not overlap.
//
// This is the pure Go version. rc4_{amd64,386,arm}* contain assembly
// implementations. This is here for tests and to prevent bitrot.
func (c *Cipher) xorKeyStreamGeneric(dst, src []byte) {
i, j := c.i, c.j
for k, v := range src {
i += 1
j += uint8(c.s[i])
c.s[i], c.s[j] = c.s[j], c.s[i]
dst[k] = v ^ uint8(c.s[uint8(c.s[i]+c.s[j])])
}
c.i, c.j = i, j
}
| {
"pile_set_name": "Github"
} |
<?php
declare(strict_types = 1);
namespace Rx\Observer;
use Rx\ObserverInterface;
class DoObserver implements ObserverInterface
{
/** @var callable|null */
private $onNext;
/** @var callable|null */
private $onError;
/** @var callable|null */
private $onCompleted;
public function __construct(callable $onNext = null, callable $onError = null, callable $onCompleted = null)
{
$default = function () {
};
$this->onNext = $this->getOrDefault($onNext, $default);
$this->onError = $this->getOrDefault($onError, function ($e) {
throw $e;
});
$this->onCompleted = $this->getOrDefault($onCompleted, $default);
}
public function onCompleted()
{
($this->onCompleted)();
}
public function onError(\Throwable $error)
{
($this->onError)($error);
}
public function onNext($value)
{
($this->onNext)($value);
}
private function getOrDefault(callable $callback = null, $default = null): callable
{
if (null === $callback) {
return $default;
}
return $callback;
}
} | {
"pile_set_name": "Github"
} |
# == Class: mongodb::s3backup::restore
#
# Restore a MongoDB backup to a server from s3
#
# === Parameters:
#
# [*aws_access_key_id*]
# Key used to sign programmatic requests in AWS
#
# [*aws_secret_access_key*]
# Key used to sign programmatic requests in AWS
#
# [*backup_dir*]
# Defines the directory to restore the backups
#
# [*env_dir*]
# Defines directory for the environment
# variables
#
# [*private_gpg_key*]
# Defines the ascii exported private gpg to
# use for decrypting backups. This key should
# be created by the user and encrypted with eyaml
#
# [*private_gpg_key_fingerprint*]
# Defines the fingerprint of the gpg private
# key to dencrypt the backups. The fingerprint
# should be 40 characters without spaces
#
# [*s3_bucket*]
# Defines the AWS S3 bucket where the backups
# will be downloaded from. It should be created by the
# user
#
# [*cron*]
# Defines whether to enable the cron job. Value
# should be true or false
class mongodb::s3backup::restore(
$aws_access_key_id = undef,
$aws_secret_access_key = undef,
$env_dir = '/etc/mongo_s3backup',
$s3_bucket = $::mongodb::s3backup::backup::s3_bucket,
$backup_dir = '/var/lib/s3backup',
$user = 'govuk-backup',
$cron = false
){
include ::backup::client
contain ::mongodb::s3backup::package
file { '/usr/local/bin/mongodb-restore-s3':
ensure => file,
content => template('mongodb/mongodb-restore-s3.erb'),
mode => '0770',
owner => $user,
group => $user,
require => Class['::mongodb::s3backup::package'],
}
}
| {
"pile_set_name": "Github"
} |
Layout of member constants and member variables of AS3 classes in memory
------------------------------------------------------------------------
The AS3 class below defines a member variable v of type number and a
member constant c of type Boolean.
class MyClass {
public var v : Number;
public const c : Boolean;
}
When the VM allocates an instance of MyClass it must reserve space in
the instance to contain the values of v and c. The VM refers to the
space reserved for v and c as "slots". The slot for v is always 8 bytes
and the slot for c is always 4 bytes. Slots whose type is not one of
Boolean, Number, uint, or int are the same size as pointers ( 4 bytes in
32 bit targets, 8 bytes in 64 bit targets ).
The memory layout of an instance of MyClass is shown below:
-------------------------------------------
| avmplus::ScriptObject |
| includes C++ vtable and |
| base classes of avmplus::ScriptObject |
|-----------------------------------------|
| 4 byte slots for MyClass ( slot for c ) |
| pointer slots for MyClass ( empty ) |
| 8 byte slots for MyClass ( slot for v ) |
------------------------------------------|
Classes that are part of the AS3 API exposed by the FlashPlayer, AIR
Runtime, or AVM shell often contain native methods. If a class contains
a native method, then it is a native class. Native classes must extend
Object or another native class. Consider the following classes:
[native(cls="EventDispatcherClass", instance="EventDispatcherObject", methods="auto")]
class EventDispatcher {
.
.
.
public native function dispatchEvent(ev : Event, bubbles : Boolean, cancelable : Boolean) : Boolean;
private var m_handlers : Dictionary;
}
[native(cls="DisplayObjectClass", instance="DisplayObject", methods="auto")]
class DisplayObject extends EventDispatcher {
public function get x() : Number { return m_x; }
public native function set x(newX : Number);
.
.
.
private var m_x : Number;
.
.
.
}
The memory layout of instances of all subclasses of DisplayObject will
start with the layout shown below:
-------------------------------------------------------------
| avmplus::ScriptObject |
| includes C++ vtable and |
| base classes of avmplus::ScriptObject |
|-----------------------------------------------------------|
| avmplus::EventDispatchObject C++ member |
| variables. |
| 4 byte slots for EventDispatcher ( empty ) |
| pointer slots for EventDispatcher ( slot for m_handlers ) |
| 8 byte slots for MyClass ( empty ) |
|-----------------------------------------------------------|
| avmplus::DisplayObject C++ member variables |
| 4 byte slots for DisplayObject ( none ) |
| pointer slots for DisplayObject ( none ) |
| 8 byte slots for DisplayObject ( slot for m_x ) |
-------------------------------------------------------------
This memory layout has the property that the offset to a slot of a given
class does not depend on which C++ class is actually instantiated. This
is an important property that previous slot layout schemes did not have.
This slot layout also make it possible for nativegen.py to generate C++
code that can get or set any slot on an instance of a native AS3 class.
For each native AS3 class nativegen.py determines if that class has any
instance or class slots. nativegen.py will generate a class will
generate C++ class and macro for the class instance and class closure if
they each have slots. The macros expand to accessor methods for the
slots and an instance of the generate C++ classes. The last statement of
the C++ instance class and the C++ class closure classes of all AS3
native classes should a reference to the corresponding generated macros.
From the previous example, the C++ class definitions for instance and
classes closure classes for EventDispatch and DisplayObject should be as
follows:
namespace avmplus
{
class EventDispatcherClass : public ClassClosure
{
.
.
.
DECLARE_SLOTS_EventDispatcherClass;
};
class EventDispatcherObject : public ScriptObject
{
.
.
.
DECLARE_SLOTS_EventDispatcherObject;
};
.
.
.
.
class DisplayObjectClass : public ClassClosure
{
.
.
.
DECLARE_SLOTS_DisplayObjectClass;
};
class DisplayObject : public EventDispatcherObject
{
.
.
.
DECLARE_SLOTS_DisplayObject;
};
}
In the example above, the C++ class EventDispatcherObject will have two
generated methods for setting and getting the m_handlers slot: void
EventDispatcherObject::set_private_m_handlers(DictionaryObject*);
DictionaryObject* EventDispatcherObject::get_private_m_handlers() const;
Both methods are protected methods of EventDispatcherObject and should
fully inline. The get methods should compile down to a single load from
memory instruction in the release build. The set method will need to
fire a ref-counted write barrier, but is none the less as efficient as
code be written by hand or by the JIT.
The C++ class DisplayObject will have two generated methods for setting
and getting the m_x slot: void DisplayObject::set_private_m_x(double);
double DisplayObject::get_private_m_x() const;
Both of these methods will fully inline in the release build to memory
store and load instructions.
If a slot is declared using the const keyword instead of the var
keyword, then by default nativegen.py will not generate C++ setter
methods for that slot. If the C++ code needs to set the value of a
const slot, the constsetters meta data attribute should be added to the
native metadata of the AS3 class. For example:
[native(cls="StackFrameClass", instance="StackFrameObject", methods="auto", constsetters="true")] // @todo: native only for slot getter/setter
public final class StackFrame
{
.
.
.
public const name:String;
}
In the example above, the C++ class StackFrame will have two generted
methods for setting and getting the name slot: void
StackFrameObject::set_name(AvmString newVal); AvmString
StackFrameObject::get_name();
| {
"pile_set_name": "Github"
} |
class CreateSnapshotJob < ApplicationJob
queue_as :default
# @param date [Date]
def perform(date = nil)
date ||= Date.today - 1.day
SnapshotService.new(date).create
end
end
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Assets">
<UniqueIdentifier>4416d50a-7676-4d0a-9b2c-91ff70c6047f</UniqueIdentifier>
<Extensions>bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<Page Include="$(SharedContentDir)\xaml\MainPage.xaml" />
<Page Include="$(SharedContentDir)\xaml\Styles.xaml" />
<Page Include="Scenario1_Data.xaml" />
<Page Include="Scenario2_Stats.xaml" />
<Page Include="Scenario3_Enum.xaml" />
<Page Include="Scenario4_UnicodeExtensions.xaml" />
<Page Include="Scenario5_TimeZone.xaml" />
</ItemGroup>
<ItemGroup>
<Midl Include="Project.idl" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="Scenario1_ShortName.cpp" />
<ClCompile Include="Scenario2_ShortName.cpp" />
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="SampleConfiguration.cpp" />
<ClCompile Include="Scenario1_Data.cpp" />
<ClCompile Include="Scenario2_Stats.cpp" />
<ClCompile Include="Scenario3_Enum.cpp" />
<ClCompile Include="Scenario4_UnicodeExtensions.cpp" />
<ClCompile Include="Scenario5_TimeZone.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="Scenario1_ShortName.h" />
<ClInclude Include="Scenario2_ShortName.h" />
<ClInclude Include="SampleConfiguration.h" />
<ClInclude Include="Scenario1_Data.h" />
<ClInclude Include="Scenario2_Stats.h" />
<ClInclude Include="Scenario3_Enum.h" />
<ClInclude Include="Scenario4_UnicodeExtensions.h" />
<ClInclude Include="Scenario5_TimeZone.h" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest" />
</ItemGroup>
<ItemGroup>
<Image Include="$(SharedContentDir)\media\microsoft-sdk.png">
<Filter>Assets</Filter>
</Image>
<Image Include="$(SharedContentDir)\media\smalltile-sdk.png">
<Filter>Assets</Filter>
</Image>
<Image Include="$(SharedContentDir)\media\splash-sdk.png">
<Filter>Assets</Filter>
</Image>
<Image Include="$(SharedContentDir)\media\squaretile-sdk.png">
<Filter>Assets</Filter>
</Image>
<Image Include="$(SharedContentDir)\media\storelogo-sdk.png">
<Filter>Assets</Filter>
</Image>
<Image Include="$(SharedContentDir)\media\tile-sdk.png">
<Filter>Assets</Filter>
</Image>
<Image Include="$(SharedContentDir)\media\windows-sdk.png">
<Filter>Assets</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="$(SharedContentDir)\xaml\App.xaml" />
</ItemGroup>
</Project> | {
"pile_set_name": "Github"
} |
/*
* File : TrackerWebPageRequestImpl.java
* Created : 08-Dec-2003
* By : parg
*
* Azureus - a Java Bittorrent client
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License.
*
* 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 ( see the LICENSE file ).
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.gudy.azureus2.pluginsimpl.local.tracker;
/**
* @author parg
*
*/
import java.io.InputStream;
import java.net.InetSocketAddress;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import org.gudy.azureus2.plugins.tracker.*;
import org.gudy.azureus2.plugins.tracker.web.*;
public class
TrackerWebPageRequestImpl
implements TrackerWebPageRequest
{
private Tracker tracker;
private TrackerWebContext context;
private InetSocketAddress client_address;
private String user;
private String url;
private URL absolute_url;
private String header;
private InputStream is;
protected
TrackerWebPageRequestImpl(
Tracker _tracker,
TrackerWebContext _context,
InetSocketAddress _client_address,
String _user,
String _url,
URL _absolute_url,
String _header,
InputStream _is )
{
tracker = _tracker;
context = _context;
client_address = _client_address;
user = _user;
url = _url;
absolute_url = _absolute_url;
header = _header;
is = _is;
}
public Tracker
getTracker()
{
return( tracker );
}
public TrackerWebContext
getContext()
{
return( context );
}
public String
getURL()
{
return( url );
}
public URL
getAbsoluteURL()
{
return( absolute_url );
}
public String
getClientAddress()
{
return( client_address.getAddress().getHostAddress());
}
public InetSocketAddress
getClientAddress2()
{
return( client_address );
}
public String
getUser()
{
return( user );
}
public InputStream
getInputStream()
{
return( is );
}
public String
getHeader()
{
return( header );
}
public Map
getHeaders()
{
Map headers = new HashMap();
String[] header_parts = header.split("\r\n");
headers.put("status", header_parts[0].trim());
for (int i = 1;i<header_parts.length;i++) {
String[] key_value = header_parts[i].split(":",2);
headers.put(key_value[0].trim().toLowerCase(), key_value[1].trim());
}
return headers;
}
}
| {
"pile_set_name": "Github"
} |
package org.simpleflatmapper.reflect;
public interface IndexedSetter<T, P> {
void set(T target, P value, int index) throws Exception;
}
| {
"pile_set_name": "Github"
} |
package io.micronaut.aop
import io.micronaut.context.ApplicationContext
import spock.lang.Specification
class CombinedBeanSpec extends Specification {
void "test a bean with both AOP and executable methods"() {
given:
ApplicationContext ctx = ApplicationContext.run('spec.name': CombinedBeanSpec.simpleName)
expect:
ctx.getBean(CombinedBean) != null
}
}
| {
"pile_set_name": "Github"
} |
(CMR::FUNCTION-DEPS)
(CMR::FUNCTION-DEPS-LST)
(CMR::COLLECT-TOPOSORT-FUNCTION-DEPS)
(CMR::FORMULA-CHECK-TESTS)
(CMR::DEF-FORMULA-CHECKER-FN)
(CMR::FORMULA-CHECKS-LEMMAS)
(CMR::DEF-FORMULA-CHECKER-LEMMAS-FN)
(CMR::FORMALS-SUBSUBSTS)
(CMR::DEF-FORMULA-CHECK-DEFINITION-THM-FN-AUX)
(CMR::DEF-FORMULA-CHECK-DEFINITION-THM-FN)
(CMR::DEF-FORMULA-CHECKS-DEFINITION-THM-LIST-FN)
(CMR::FILTER-DEFINED-FUNCTIONS)
(CMR::DEF-FORMULA-CHECKS-FN)
| {
"pile_set_name": "Github"
} |
#!/bin/bash
#
# 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.
#
# source me
# (if your're deploying KYLIN on a powerful server and want to replace the default conservative settings)
# uncomment following to for it to take effect
export KYLIN_JVM_SETTINGS="-Xms1024M -Xmx4096M -Xss1024K -XX:MaxPermSize=512M -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$KYLIN_HOME/logs/kylin.gc.$$ -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=64M"
# Newer versions of glibc use an arena memory allocator that causes virtual
# memory usage to explode. Tune the variable down to prevent vmem explosion.
# See HADOOP-7154.
export MALLOC_ARENA_MAX=${MALLOC_ARENA_MAX:-4}
# export KYLIN_JVM_SETTINGS="-Xms16g -Xmx16g -XX:MaxPermSize=512m -XX:NewSize=3g -XX:MaxNewSize=3g -XX:SurvivorRatio=4 -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -XX:+HeapDumpOnOutOfMemoryError -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$KYLIN_HOME/logs/kylin.gc.$$ -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=64M"
# uncomment following to for it to take effect(the values need adjusting to fit your env)
# export KYLIN_DEBUG_SETTINGS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
# when running on HDP, try to determine the software stack version adn set hdp.version JVM property
if [[ -d "/usr/hdp/current/hadoop-client" ]]
then
export KYLIN_EXTRA_START_OPTS="-Dhdp.version=`ls -l /usr/hdp/current/hadoop-client | awk -F'/' '{print $8}'`"
# attempt to locate JVM native libraries and set corresponding property
if [[ -d "/usr/hdp/current/hadoop-client/lib/native" ]]
then
export KYLIN_LD_LIBRARY_SETTINGS="-Djava.library.path=/usr/hdp/current/hadoop-client/lib/native"
fi
else
export KYLIN_EXTRA_START_OPTS=""
# uncomment the following line to set JVM native library path, the values need to reflect your environment and hardware architecture
# export KYLIN_LD_LIBRARY_SETTINGS="-Djava.library.path=/apache/hadoop/lib/native/Linux-amd64-64"
fi
if [ ! -z "${KYLIN_JVM_SETTINGS}" ]
then
verbose "KYLIN_JVM_SETTINGS is ${KYLIN_JVM_SETTINGS}"
KYLIN_EXTRA_START_OPTS="${KYLIN_JVM_SETTINGS} ${KYLIN_EXTRA_START_OPTS}"
else
verbose "KYLIN_JVM_SETTINGS is not set, using default jvm settings: ${KYLIN_JVM_SETTINGS}"
fi
if [ ! -z "${KYLIN_DEBUG_SETTINGS}" ]
then
verbose "KYLIN_DEBUG_SETTINGS is ${KYLIN_DEBUG_SETTINGS}"
KYLIN_EXTRA_START_OPTS="${KYLIN_DEBUG_SETTINGS} ${KYLIN_EXTRA_START_OPTS}"
else
verbose "KYLIN_DEBUG_SETTINGS is not set, will not enable remote debuging"
fi
if [ ! -z "${KYLIN_LD_LIBRARY_SETTINGS}" ]
then
verbose "KYLIN_LD_LIBRARY_SETTINGS is ${KYLIN_LD_LIBRARY_SETTINGS}"
KYLIN_EXTRA_START_OPTS="${KYLIN_LD_LIBRARY_SETTINGS} ${KYLIN_EXTRA_START_OPTS}"
else
verbose "KYLIN_LD_LIBRARY_SETTINGS is not set, it is okay unless you want to specify your own native path"
fi
| {
"pile_set_name": "Github"
} |
// <copyright file="MMALDownstreamHandlerComponent.cs" company="Techyian">
// Copyright (c) Ian Auty and contributors. All rights reserved.
// Licensed under the MIT License. Please see LICENSE.txt for License info.
// </copyright>
namespace MMALSharp.Components
{
/// <summary>
/// Base class for all downstream components which support capture handlers.
/// </summary>
public abstract class MMALDownstreamHandlerComponent : MMALDownstreamComponent, IDownstreamHandlerComponent
{
/// <summary>
/// Creates a new instance of <see cref="MMALDownstreamHandlerComponent"/>.
/// </summary>
/// <param name="name">The name of the component.</param>
protected MMALDownstreamHandlerComponent(string name)
: base(name)
{
}
}
}
| {
"pile_set_name": "Github"
} |
GOFILES := $(shell find . -name '*.go' ! -path './.go*')
POSTGRES := postgres:12.4-alpine
SHELL := /bin/bash
export COMPOSE_FILE = docker/core.yml:docker/ports.yml
define STUB
package routes
import "net/http"
const holeJsPath = ""
const twemojiWoff2Path = ""
func Asset(w http.ResponseWriter, r *http.Request) {}
endef
bump:
@go get -u
@go mod tidy
cert:
@mkcert -install localhost
@chmod +r localhost-key.pem
.PHONY: db
db:
@ssh -t [email protected] docker run -it --rm \
--env-file /etc/code-golf.env $(POSTGRES) psql
db-admin:
@ssh -t [email protected] docker run -it --rm \
--env-file /etc/code-golf.env $(POSTGRES) psql -WU doadmin
db-dev:
@docker-compose exec db psql -U postgres code-golf
db-diff:
@diff --color --label beta --label dev --strip-trailing-cr -su \
<(ssh [email protected] "docker run --rm \
--env-file /etc/code-golf.env $(POSTGRES) pg_dump -Os code-golf-beta") \
<(docker-compose exec db pg_dump -OsU postgres code-golf) || true
@diff --color --label live --label dev --strip-trailing-cr -su \
<(ssh [email protected] "docker run --rm \
--env-file /etc/code-golf.env $(POSTGRES) pg_dump -Os") \
<(docker-compose exec db pg_dump -OsU postgres code-golf)
db-dump:
@rm -f db/*.gz
@ssh [email protected] "docker run --env-file /etc/code-golf.env \
--rm $(POSTGRES) sh -c 'pg_dump -a | gzip -9'" \
> db/code-golf-`date +%Y-%m-%d`.sql.gz
@cp db/*.gz ~/Dropbox/code-golf/
deps:
@yay -S mkcert python-brotli python-fonttools
dev:
@touch docker/.env
@docker-compose rm -f
@docker-compose up --build
e2e: export COMPOSE_FILE = docker/core.yml:docker/e2e.yml
e2e: export COMPOSE_PROJECT_NAME = code-golf-e2e
e2e:
# TODO Pass arguments to run specific tests.
# TODO Return correct exit code.
@touch docker/.env
@docker-compose rm -fs
@docker-compose pull
@docker-compose build -q
@docker-compose run e2e || docker-compose logs
@docker-compose rm -fs
fmt:
@gofmt -s -w $(GOFILES)
@goimports -w $(GOFILES)
font:
@docker build -t code-golf-font -f Dockerfile.font .
@id=`docker create code-golf-font`; \
docker cp "$$id:twemoji-colr/build/Twemoji Mozilla.woff2" assets/twemoji.woff2; \
docker rm $$id
lint:
# FIXME Stub out assets if it doesn't yet exist.
ifeq ($(wildcard routes/assets.go),)
$(file > routes/assets.go, $(STUB))
endif
@docker run --rm -v $(CURDIR):/app -w /app golangci/golangci-lint:v1.30.0 golangci-lint run
live:
@./build-assets
@docker build --pull -t codegolf/code-golf .
@docker push codegolf/code-golf
@ssh [email protected] " \
docker pull codegolf/code-golf && \
docker stop code-golf; \
docker rm code-golf; \
docker run \
--cap-add CAP_KILL \
--cap-add CAP_SETGID \
--cap-add CAP_SETUID \
--cap-add CAP_SYS_ADMIN \
--cap-drop ALL \
--detach \
--env-file /etc/code-golf.env \
--init \
--name code-golf \
--publish 80:1080 \
--publish 443:1443 \
--read-only \
--restart always \
--security-opt seccomp:unconfined \
--volume certs:/certs \
codegolf/code-golf && \
docker system prune -f"
logs:
@ssh [email protected] docker logs --tail 5 -f code-golf
test:
# FIXME Stub out assets if it doesn't yet exist.
ifeq ($(wildcard routes/assets.go),)
$(file > routes/assets.go, $(STUB))
endif
@go test ./...
| {
"pile_set_name": "Github"
} |
export default {
lang: 'ca',
dir: 'ltr',
common: {
ok: 'Salvar',
cancel: 'Cancel',
key_backspace: 'backspace',
key_del: 'delete',
key_down: 'down',
key_up: 'up',
more_opts: 'More Options',
url: 'URL',
width: 'Width',
height: 'Height'
},
misc: {
powered_by: 'Powered by'
},
ui: {
toggle_stroke_tools: 'Show/hide more stroke tools',
palette_info: 'Feu clic per canviar el color de farciment, shift-clic per canviar el color del traç',
zoom_level: 'Canviar el nivell de zoom',
panel_drag: 'Drag left/right to resize side panel',
quality: 'Quality:',
pathNodeTooltip: 'Drag node to move it. Double-click node to change segment type',
pathCtrlPtTooltip: 'Drag control point to adjust curve properties',
pick_stroke_paint_opacity: 'Pick a Stroke Paint and Opacity',
pick_fill_paint_opacity: 'Pick a Fill Paint and Opacity'
},
properties: {
id: 'Identify the element',
fill_color: 'Canviar el color de farciment',
stroke_color: 'Canviar el color del traç',
stroke_style: 'Canviar estil de traç guió',
stroke_width: 'Canviar l'amplada del traç',
pos_x: 'Change X coordinate',
pos_y: 'Change Y coordinate',
linecap_butt: 'Linecap: Butt',
linecap_round: 'Linecap: Round',
linecap_square: 'Linecap: Square',
linejoin_bevel: 'Linejoin: Bevel',
linejoin_miter: 'Linejoin: Miter',
linejoin_round: 'Linejoin: Round',
angle: 'Canviar l'angle de rotació',
blur: 'Change gaussian blur value',
opacity: 'Canviar la opacitat tema seleccionat',
circle_cx: 'CX cercle Canvi de coordenades',
circle_cy: 'Cercle Canvi CY coordinar',
circle_r: 'Ràdio de cercle Canvi',
ellipse_cx: 'Canviar lipse CX coordinar',
ellipse_cy: 'Lipse Canvi CY coordinar',
ellipse_rx: 'Ràdio x lipse Canvi',
ellipse_ry: 'Ràdio i lipse Canvi',
line_x1: 'Canviar la línia de partida de la coordenada x',
line_x2: 'Canviar la línia d'hores de coordenada x',
line_y1: 'Canviar la línia de partida i de coordinar',
line_y2: 'Canviar la línia d'hores de coordenada',
rect_height: 'Rectangle d'alçada Canvi',
rect_width: 'Ample rectangle Canvi',
corner_radius: 'Canviar Rectangle Corner Radius',
image_width: 'Amplada de la imatge Canvi',
image_height: 'Canviar l'altura de la imatge',
image_url: 'Canviar URL',
node_x: "Change node's x coordinate",
node_y: "Change node's y coordinate",
seg_type: 'Change Segment type',
straight_segments: 'Straight',
curve_segments: 'Curve',
text_contents: 'Contingut del text',
font_family: 'Canviar la font Família',
font_size: 'Change Font Size',
bold: 'Text en negreta',
italic: 'Text en cursiva'
},
tools: {
main_menu: 'Main Menu',
bkgnd_color_opac: 'Color de fons / opacitat',
connector_no_arrow: 'No arrow',
fitToContent: 'Ajustar al contingut',
fit_to_all: 'Ajustar a tot el contingut',
fit_to_canvas: 'Ajustar a la lona',
fit_to_layer_content: 'Ajustar al contingut de la capa d'',
fit_to_sel: 'Ajustar a la selecció',
align_relative_to: 'Alinear pel que fa a ...',
relativeTo: 'en relació amb:',
page: 'Pàgina',
largest_object: 'objecte més gran',
selected_objects: 'objectes escollits',
smallest_object: 'objecte més petit',
new_doc: 'Nova imatge',
open_doc: 'Obrir imatge',
export_img: 'Export',
save_doc: 'Guardar imatge',
import_doc: 'Import Image',
align_to_page: 'Align Element to Page',
align_bottom: 'Alinear baix',
align_center: 'Alinear al centre',
align_left: 'Alinear a l'esquerra',
align_middle: 'Alinear Medi',
align_right: 'Alinear a la dreta',
align_top: 'Alinear a dalt',
mode_select: 'Eina de selecció',
mode_fhpath: 'Eina Llapis',
mode_line: 'L'eina',
mode_rect: 'Rectangle Tool',
mode_square: 'Square Tool',
mode_fhrect: 'Free-Hand Rectangle',
mode_ellipse: 'Lipse',
mode_circle: 'Cercle',
mode_fhellipse: 'Free-Hand Ellipse',
mode_path: 'Path Tool',
mode_text: 'Eina de text',
mode_image: 'Image Tool',
mode_zoom: 'Zoom Tool',
no_embed: 'NOTE: This image cannot be embedded. It will depend on this path to be displayed',
undo: 'Desfés',
redo: 'Refer',
tool_source: 'Font Edita',
wireframe_mode: 'Wireframe Mode',
clone: 'Clone Element(s)',
del: 'Delete Element(s)',
group_elements: 'Elements de Grup de',
make_link: 'Make (hyper)link',
set_link_url: 'Set link URL (leave empty to remove)',
to_path: 'Convert to Path',
reorient_path: 'Reorient path',
ungroup: 'Desagrupar elements',
docprops: 'Propietats del document',
move_bottom: 'Mou al final',
move_top: 'Mou al principi',
node_clone: 'Clone Node',
node_delete: 'Delete Node',
node_link: 'Link Control Points',
add_subpath: 'Add sub-path',
openclose_path: 'Open/close sub-path',
source_save: 'Salvar',
cut: 'Cut',
copy: 'Copy',
paste: 'Paste',
paste_in_place: 'Paste in Place',
delete: 'Delete',
group: 'Group',
move_front: 'Bring to Front',
move_up: 'Bring Forward',
move_down: 'Send Backward',
move_back: 'Send to Back'
},
layers: {
layer: 'Layer',
layers: 'Layers',
del: 'Eliminar capa',
move_down: 'Mou la capa de Down',
new: 'Nova capa',
rename: 'Canvieu el nom de la capa',
move_up: 'Mou la capa Up',
dupe: 'Duplicate Layer',
merge_down: 'Merge Down',
merge_all: 'Merge All',
move_elems_to: 'Move elements to:',
move_selected: 'Move selected elements to a different layer'
},
config: {
image_props: 'Image Properties',
doc_title: 'Title',
doc_dims: 'Canvas Dimensions',
included_images: 'Included Images',
image_opt_embed: 'Embed data (local files)',
image_opt_ref: 'Use file reference',
editor_prefs: 'Editor Preferences',
icon_size: 'Icon size',
language: 'Language',
background: 'Editor Background',
editor_img_url: 'Image URL',
editor_bg_note: 'Note: Background will not be saved with image.',
icon_large: 'Large',
icon_medium: 'Medium',
icon_small: 'Small',
icon_xlarge: 'Extra Large',
select_predefined: 'Seleccioneu predefinides:',
units_and_rulers: 'Units & Rulers',
show_rulers: 'Show rulers',
base_unit: 'Base Unit:',
grid: 'Grid',
snapping_onoff: 'Snapping on/off',
snapping_stepsize: 'Snapping Step-Size:',
grid_color: 'Grid color'
},
notification: {
invalidAttrValGiven: 'Invalid value given',
noContentToFitTo: 'No content to fit to',
dupeLayerName: 'There is already a layer named that!',
enterUniqueLayerName: 'Please enter a unique layer name',
enterNewLayerName: 'Please enter the new layer name',
layerHasThatName: 'Layer already has that name',
QmoveElemsToLayer: "Move selected elements to layer '%s'?",
QwantToClear: 'Do you want to clear the drawing?\nThis will also erase your undo history!',
QwantToOpen: 'Do you want to open a new file?\nThis will also erase your undo history!',
QerrorsRevertToSource: 'There were parsing errors in your SVG source.\nRevert back to original SVG source?',
QignoreSourceChanges: 'Ignore changes made to SVG source?',
featNotSupported: 'Feature not supported',
enterNewImgURL: 'Enter the new image URL',
defsFailOnSave: 'NOTE: Due to a bug in your browser, this image may appear wrong (missing gradients or elements). It will however appear correct once actually saved.',
loadingImage: 'Loading image, please wait...',
saveFromBrowser: "Select 'Save As...' in your browser (possibly via file menu or right-click context-menu) to save this image as a %s file.",
noteTheseIssues: 'Also note the following issues: ',
unsavedChanges: 'There are unsaved changes.',
enterNewLinkURL: 'Enter the new hyperlink URL',
errorLoadingSVG: 'Error: Unable to load SVG data',
URLLoadFail: 'Unable to load from URL',
retrieving: "Retrieving '%s' ...",
popupWindowBlocked: 'Popup window may be blocked by browser',
exportNoBlur: 'Blurred elements will appear as un-blurred',
exportNoforeignObject: 'foreignObject elements will not appear',
exportNoDashArray: 'Strokes will appear filled',
exportNoText: 'Text may not appear as expected'
}
};
| {
"pile_set_name": "Github"
} |
using System;
using Microsoft.Extensions.Logging;
using Xunit;
namespace SIPSorcery.Net.UnitTests
{
/// <summary>This class contains parameterized unit tests for SessionParameter</summary>
[Trait("Category", "unit")]
public partial class SessionParameterUnitTest
{
private Microsoft.Extensions.Logging.ILogger logger = null;
public SessionParameterUnitTest(Xunit.Abstractions.ITestOutputHelper output)
{
logger = SIPSorcery.UnitTests.TestLogHelper.InitTestLogger(output);
}
[Fact]
public void ConstructorTestEnumParams()
{
logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);
foreach (var e in Enum.GetValues(typeof(SDPSecurityDescription.SessionParameter.SrtpSessionParams)))
{
SDPSecurityDescription.SessionParameter sessionParameter = SessionParameterFactory.Create((SDPSecurityDescription.SessionParameter.SrtpSessionParams)e);
Assert.NotNull((object)sessionParameter);
Assert.Equal<SDPSecurityDescription.SessionParameter.SrtpSessionParams>((SDPSecurityDescription.SessionParameter.SrtpSessionParams)e, sessionParameter.SrtpSessionParam);
}
}
[Fact]
public void ConstructorTestFecKey()
{
logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);
SDPSecurityDescription.SessionParameter sessionParameter = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.fec_key);
Assert.StartsWith(SDPSecurityDescription.SessionParameter.FEC_KEY_PREFIX, sessionParameter.ToString());
}
[Fact]
public void ConstructorTestFecOrder()
{
logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);
SDPSecurityDescription.SessionParameter sessionParameter = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.fec_order);
Assert.StartsWith(SDPSecurityDescription.SessionParameter.FEC_ORDER_PREFIX, sessionParameter.ToString());
}
[Fact]
public void ConstructorTestWsh()
{
logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);
SDPSecurityDescription.SessionParameter sessionParameter = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.wsh);
Assert.StartsWith(SDPSecurityDescription.SessionParameter.WSH_PREFIX, sessionParameter.ToString());
}
[Fact]
public void ConstructorTestKdr()
{
logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);
SDPSecurityDescription.SessionParameter sessionParameter = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.kdr);
Assert.StartsWith(SDPSecurityDescription.SessionParameter.KDR_PREFIX, sessionParameter.ToString());
}
[Fact]
public void ConstructorTestUNEnums()
{
logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);
SDPSecurityDescription.SessionParameter sessionParameter = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.UNAUTHENTICATED_SRTP);
Assert.Equal(SDPSecurityDescription.SessionParameter.SrtpSessionParams.UNAUTHENTICATED_SRTP.ToString(), sessionParameter.ToString());
sessionParameter = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.UNENCRYPTED_SRTCP);
Assert.Equal(SDPSecurityDescription.SessionParameter.SrtpSessionParams.UNENCRYPTED_SRTCP.ToString(), sessionParameter.ToString());
sessionParameter = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.UNENCRYPTED_SRTP);
Assert.Equal(SDPSecurityDescription.SessionParameter.SrtpSessionParams.UNENCRYPTED_SRTP.ToString(), sessionParameter.ToString());
}
[Fact]
public void WshTest()
{
logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);
SDPSecurityDescription.SessionParameter sessionParameter = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.wsh);
try
{
sessionParameter.Wsh = 0;
throw new Exception
("expected an exception of type ArgumentOutOfRangeException");
}
catch (ArgumentOutOfRangeException)
{
}
try
{
sessionParameter.Wsh = 1;
throw new Exception
("expected an exception of type ArgumentOutOfRangeException");
}
catch (ArgumentOutOfRangeException)
{
}
try
{
sessionParameter.Wsh = 3;
throw new Exception
("expected an exception of type ArgumentOutOfRangeException");
}
catch (ArgumentOutOfRangeException)
{
}
sessionParameter.Wsh = 64;
Assert.Equal(sessionParameter.ToString(), $"{SDPSecurityDescription.SessionParameter.WSH_PREFIX}64");
}
[Fact]
public void KdrTest()
{
logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);
SDPSecurityDescription.SessionParameter sessionParameter = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.kdr);
try
{
sessionParameter.Kdr = 100;
throw new Exception
("expected an exception of type ArgumentOutOfRangeException");
}
catch (ArgumentOutOfRangeException)
{
}
sessionParameter.Kdr = 2;
Assert.Equal($"{SDPSecurityDescription.SessionParameter.KDR_PREFIX}2", sessionParameter.ToString());
sessionParameter.Kdr = 4;
Assert.Equal($"{SDPSecurityDescription.SessionParameter.KDR_PREFIX}4", sessionParameter.ToString());
sessionParameter.Kdr = 3;
Assert.Equal($"{SDPSecurityDescription.SessionParameter.KDR_PREFIX}3", sessionParameter.ToString());
}
[Fact]
public void ParseTest()
{
logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);
SDPSecurityDescription.SessionParameter sessionParameterKdr = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.kdr, 4);
string sKdr = sessionParameterKdr.ToString();
Assert.Equal(sKdr, SDPSecurityDescription.SessionParameter.Parse(sKdr).ToString());
Assert.Equal("KDR=4", SDPSecurityDescription.SessionParameter.Parse(sKdr).ToString());
SDPSecurityDescription.SessionParameter sessionParameterWsh = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.wsh, 64);
string sWsh = sessionParameterWsh.ToString();
Assert.Equal(sWsh, SDPSecurityDescription.SessionParameter.Parse(sWsh).ToString());
Assert.Equal("WSH=64", SDPSecurityDescription.SessionParameter.Parse(sWsh).ToString());
SDPSecurityDescription.SessionParameter sessionParameterFecOrder = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.fec_order, (uint)SDPSecurityDescription.SessionParameter.FecTypes.FEC_SRTP);
string sFecOrder = sessionParameterFecOrder.ToString();
Assert.Equal(sFecOrder, SDPSecurityDescription.SessionParameter.Parse(sFecOrder).ToString());
Assert.Equal(sFecOrder, SDPSecurityDescription.SessionParameter.Parse("FEC_ORDER=FEC_SRTP").ToString());
sessionParameterFecOrder.FecOrder = SDPSecurityDescription.SessionParameter.FecTypes.SRTP_FEC;
Assert.NotEqual(sFecOrder, sessionParameterFecOrder.ToString());
sFecOrder = sessionParameterFecOrder.ToString();
Assert.Equal(sFecOrder, SDPSecurityDescription.SessionParameter.Parse(sFecOrder).ToString());
SDPSecurityDescription.SessionParameter sessionParameterFecKey = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.fec_key);
sessionParameterFecKey.FecKey = SDPSecurityDescription.KeyParameter.Parse("inline:MTIzNDU2Nzg5QUJDREUwMTIzNDU2Nzg5QUJjZGVm|2^20|1:4");
string FecKey = sessionParameterFecKey.ToString();
Assert.StartsWith(SDPSecurityDescription.SessionParameter.FEC_KEY_PREFIX, FecKey);
Assert.EndsWith("1:4", FecKey);
SDPSecurityDescription.SessionParameter sessionParameterUn1 = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.UNAUTHENTICATED_SRTP);
SDPSecurityDescription.SessionParameter sessionParameterUn2 = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.UNENCRYPTED_SRTCP);
SDPSecurityDescription.SessionParameter sessionParameterUn3 = SessionParameterFactory.Create(SDPSecurityDescription.SessionParameter.SrtpSessionParams.UNENCRYPTED_SRTP);
string sUn1 = sessionParameterUn1.ToString();
string sUn2 = sessionParameterUn2.ToString();
string sUn3 = sessionParameterUn3.ToString();
Assert.Equal(sUn1, SDPSecurityDescription.SessionParameter.Parse(sUn1).ToString());
Assert.NotEqual(SDPSecurityDescription.SessionParameter.SrtpSessionParams.UNENCRYPTED_SRTP, SDPSecurityDescription.SessionParameter.Parse(sUn2).SrtpSessionParam);
Assert.Equal(SDPSecurityDescription.SessionParameter.SrtpSessionParams.UNENCRYPTED_SRTP, SDPSecurityDescription.SessionParameter.Parse(sUn3).SrtpSessionParam);
Assert.Null(SDPSecurityDescription.SessionParameter.Parse(null));
Assert.Null(SDPSecurityDescription.SessionParameter.Parse(""));
Assert.Throws<FormatException>(() => SDPSecurityDescription.SessionParameter.Parse("wsh=64"));
Assert.Throws<FormatException>(() => SDPSecurityDescription.SessionParameter.Parse("ĀĀ\0\0\0\0\0\0\0\0\0\0\0\0\0\0"));
}
}
}
| {
"pile_set_name": "Github"
} |
infected
| {
"pile_set_name": "Github"
} |
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLV0SrKD4z1TRxRhAPUvZ
Content-Length: 178
------TLV0SrKD4z1TRxRhAPUvZ
Content-Disposition: form-data; name="upload"; filename="plain.txt"
Content-Type: text/plain
I am a plain text file
------TLV0SrKD4z1TRxRhAPUvZ
| {
"pile_set_name": "Github"
} |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Aws.WafV2.Inputs
{
public sealed class WebAclRuleStatementOrStatementStatementNotStatementStatementRegexPatternSetReferenceStatementFieldToMatchSingleHeaderArgs : Pulumi.ResourceArgs
{
/// <summary>
/// The name of the query header to inspect. This setting must be provided as lower case characters.
/// </summary>
[Input("name", required: true)]
public Input<string> Name { get; set; } = null!;
public WebAclRuleStatementOrStatementStatementNotStatementStatementRegexPatternSetReferenceStatementFieldToMatchSingleHeaderArgs()
{
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2016-2018 VMware, Inc. All Rights Reserved.
*
* This product is licensed to you under the Apache License, Version 2.0 (the "License").
* You may not use this product except in compliance with the License.
*
* This product may include a number of subcomponents with separate copyright notices
* and license terms. Your use of these subcomponents is subject to the terms and
* conditions of the subcomponent's license, as noted in the LICENSE file.
*/
package com.vmware.admiral.common.util;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
/**
* Test for DockerImage parsing methods
*/
@RunWith(Parameterized.class)
public class DockerImageTest {
private final String description;
private final String fullImageName;
private final String expectedHost;
private final String expectedNamespace;
private final String expectedRepo;
private final String expectedNamespaceAndRepo;
private final String expectedTag;
@Parameters
public static List<String[]> data() {
List<String[]> data = new ArrayList<>();
data.add(new String[] { "all sections", "myhost:300/namespace/repo:tag", "myhost:300",
"namespace", "repo", "namespace/repo", "tag" });
data.add(new String[] { "repo and tag", "repo:tag", null, null, "repo", "library/repo",
"tag" });
data.add(new String[] { "implicit registry, repo and tag", "library/repo:tag", null,
"library", "repo", "library/repo", "tag" });
data.add(new String[] { "repo without tag", "repo", null, null, "repo", "library/repo",
"latest" });
data.add(new String[] { "namespace and repo", "namespace/repo", null, "namespace", "repo",
"namespace/repo", "latest" });
data.add(new String[] { "host with dot and repo", "host.name:443/repo", "host.name:443",
null, "repo", "repo", "latest" });
data.add(new String[] { "host with colon and repo", "host:3000/repo", "host:3000", null,
"repo", "repo", "latest" });
data.add(new String[] { "host with colon, repo and tag", "host:3000/repo:tag", "host:3000",
null, "repo", "repo", "tag" });
data.add(new String[] { "official repo with default namespace",
"registry.hub.docker.com/library/repo:tag", "registry.hub.docker.com", "library",
"repo", "library/repo", "tag" });
data.add(new String[] { "official repo with custom namespace",
"registry.hub.docker.com/user/repo:tag", "registry.hub.docker.com", "user", "repo",
"user/repo", "tag" });
data.add(new String[] { "official repo with default namespace",
"docker.io/library/repo:tag", "docker.io", "library", "repo", "library/repo",
"tag" });
data.add(new String[] { "official repo with custom namespace",
"docker.io/user/repo:tag", "docker.io", "user", "repo", "user/repo", "tag" });
data.add(new String[] { "host and three path components of repo",
"host/namespace/category/repo", "host", "namespace/category", "repo",
"namespace/category/repo", "latest" });
data.add(new String[] { "host, port, three path components of repo and tag",
"host:5000/namespace/category/repo:tag", "host:5000", "namespace/category", "repo",
"namespace/category/repo", "tag" });
data.add(new String[] { "host, port, three path components containing dash, repo and tag",
"host:5000/namespace-project/category/repo:tag", "host:5000",
"namespace-project/category", "repo", "namespace-project/category/repo", "tag" });
data.add(new String[] { "host with dot, two path components of repo and tag",
"host-123.local/library/repo:tag", "host-123.local", "library", "repo",
"library/repo", "tag" });
data.add(new String[] { "host, two path components of repo and tag",
"host-123/library/repo:tag", "host-123", "library", "repo",
"library/repo", "tag" });
data.add(new String[] { "host, repo and tag",
"host-123:443/repo:tag", "host-123:443", null, "repo",
"repo", "tag" });
return data;
}
/**
* @param expectedHost
* @param expectedNamespace
* @param expectedRepo
*/
public DockerImageTest(String description, String fullImageName, String expectedHost,
String expectedNamespace,
String expectedRepo,
String expectedNamespaceAndRepo,
String expectedTag) {
this.description = description;
this.fullImageName = fullImageName;
this.expectedHost = expectedHost;
this.expectedNamespace = expectedNamespace;
this.expectedRepo = expectedRepo;
this.expectedNamespaceAndRepo = expectedNamespaceAndRepo;
this.expectedTag = expectedTag;
}
@Test
public void testDockerImageParsing() {
DockerImage dockerImage = DockerImage.fromImageName(fullImageName);
assertEquals(description + ": host", expectedHost, dockerImage.getHost());
assertEquals(description + ": namespace", expectedNamespace, dockerImage.getNamespace());
assertEquals(description + ": repository", expectedRepo, dockerImage.getRepository());
assertEquals(description + ": namespace and repo", expectedNamespaceAndRepo,
dockerImage.getNamespaceAndRepo());
assertEquals(description + ": tag", expectedTag, dockerImage.getTag());
}
}
| {
"pile_set_name": "Github"
} |
{
"name": "league/uri-hostname-parser",
"description": "ICANN base hostname parsing implemented in PHP.",
"homepage": "https://github.com/thephphleague/uri-hostname-parser",
"support": {
"issues": "https://github.com/thephphleague/uri-hostname-parser/issues",
"source": "https://github.com/thephphleague/uri-hostname-parser"
},
"license": "MIT",
"authors": [
{
"name": "Jeremy Kendall",
"homepage": "http://about.me/jeremykendall",
"role": "Developer"
},
{
"name": "Ignace Nyamagana Butera",
"homepage": "http://nyamsprod.com",
"role": "Developer"
},
{
"name": "Contributors",
"homepage": "https://github.com/phpleague/uri-hostname-parser/graphs/contributors"
}
],
"bin": [
"bin/update-psl-icann-section"
],
"keywords": [
"Public Suffix List",
"ICANN",
"domain parsing"
],
"require": {
"php": ">=7.0",
"ext-intl": "*",
"psr/simple-cache": "^1"
},
"require-dev": {
"phpunit/phpunit": "^6.3",
"mikey179/vfsStream": "^1.6",
"friendsofphp/php-cs-fixer": "^2.7"
},
"suggest": {
"ext-curl": "To use the bundle cURL HTTP client",
"psr/simple-cache-implementation": "To enable using other cache providers"
},
"autoload": {
"psr-4": {
"League\\Uri\\": "src"
},
"files": ["src/functions_include.php"]
},
"autoload-dev": {
"psr-4": {
"League\\Uri\\Tests\\": "tests/"
}
},
"scripts": {
"post-install-cmd": "\\League\\Uri\\Installer\\ICANNSection::update",
"post-update-cmd": "\\League\\Uri\\Installer\\ICANNSection::update",
"test": "phpunit --coverage-text; php-cs-fixer fix -vv --diff --dry-run --allow-risky=yes",
"phpunit": "phpunit --coverage-text",
"phpcs": "php-cs-fixer fix -vv --diff --dry-run --allow-risky=yes"
}
} | {
"pile_set_name": "Github"
} |
var baseForRight = require('../internal/baseForRight'),
createForIn = require('../internal/createForIn');
/**
* This method is like `_.forIn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {Object} Returns `object`.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forInRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
*/
var forInRight = createForIn(baseForRight);
module.exports = forInRight;
| {
"pile_set_name": "Github"
} |
{
"Enable Events": "Aktifkan Acara",
"Min. Bits": "Bit Min.",
"Max Events": "Acara Maks.",
"Text Color": "Warna Teks",
"Font": "Font",
"Font Size": "Ukuran Font",
"Theme": "Tema",
"Theme Color": "Warna Tema",
"Background Color": "Warna Latar Belakang",
"Show Animation": "Tampilkan Animasi",
"Hide Animation": "Sembunyikan Animasi",
"Animation Speed": "Kecepatan Animasi",
"Fade Time": "Waktu Memudar",
"Other Options": "Opsi Lain",
"Flip X": "Balikkan X",
"Flip Y": "Balikkan Y",
"Keep Events History": "Simpan Riwayat Acara",
"Manage List": "Kelola Daftar",
"Show Resubs": "Tampilkan Langganan Ulang",
"Show Sub Tiers": "Tampilkan Sub-tingkat",
"Raids": "Raids",
"Members": "Anggota",
"Super Chats": "Super Chat"
}
| {
"pile_set_name": "Github"
} |
#tb 0: 1/25
0, 0, 0, 1, 152064, 0x05b789ef
0, 1, 1, 1, 152064, 0x4bb46551
0, 2, 2, 1, 152064, 0x9dddf64a
0, 3, 3, 1, 152064, 0x2a8380b0
0, 4, 4, 1, 152064, 0x4de3b652
0, 5, 5, 1, 152064, 0xedb5a8e6
0, 6, 6, 1, 152064, 0xe20f7c23
0, 7, 7, 1, 152064, 0x5ab58bac
0, 8, 8, 1, 152064, 0x1f1b8026
0, 9, 9, 1, 152064, 0x91373915
0, 10, 10, 1, 152064, 0x02344760
0, 11, 11, 1, 152064, 0x30f5fcd5
0, 12, 12, 1, 152064, 0xc711ad61
0, 13, 13, 1, 152064, 0x24eca223
0, 14, 14, 1, 152064, 0x52a48ddd
0, 15, 15, 1, 152064, 0xa91c0f05
0, 16, 16, 1, 152064, 0x8e364e18
0, 17, 17, 1, 152064, 0xb15d38c8
0, 18, 18, 1, 152064, 0xf25f6acc
0, 19, 19, 1, 152064, 0xf34ddbff
0, 20, 20, 1, 152064, 0xfc7bf570
0, 21, 21, 1, 152064, 0x9dc72412
0, 22, 22, 1, 152064, 0x445d1d59
0, 23, 23, 1, 152064, 0x2f2768ef
0, 24, 24, 1, 152064, 0xce09f9d6
0, 25, 25, 1, 152064, 0x95579936
0, 26, 26, 1, 152064, 0x43d796b5
0, 27, 27, 1, 152064, 0xd780d887
0, 28, 28, 1, 152064, 0x76d2a455
0, 29, 29, 1, 152064, 0x6dc3650e
0, 30, 30, 1, 152064, 0x0f9d6aca
0, 31, 31, 1, 152064, 0xe295c51e
0, 32, 32, 1, 152064, 0xd766fc8d
0, 33, 33, 1, 152064, 0xe22f7a30
0, 34, 34, 1, 152064, 0x7fea4378
0, 35, 35, 1, 152064, 0xfa8d94fb
0, 36, 36, 1, 152064, 0x4c9737ab
0, 37, 37, 1, 152064, 0xa50d01f8
0, 38, 38, 1, 152064, 0x0b07594c
0, 39, 39, 1, 152064, 0x88734edd
0, 40, 40, 1, 152064, 0xd2735925
0, 41, 41, 1, 152064, 0xd4e49e08
0, 42, 42, 1, 152064, 0x20cebfa9
0, 43, 43, 1, 152064, 0x575c20ec
0, 44, 44, 1, 152064, 0xfd500471
0, 45, 45, 1, 152064, 0x61b47e73
0, 46, 46, 1, 152064, 0x09ef53ff
0, 47, 47, 1, 152064, 0x6e88c5c2
0, 48, 48, 1, 152064, 0xbb87b483
0, 49, 49, 1, 152064, 0x4bbad8ea
| {
"pile_set_name": "Github"
} |
package stressql
import (
"bufio"
"bytes"
"io"
"log"
"os"
"strings"
"github.com/influxdata/influxdb/influxql"
"github.com/influxdata/influxdb/stress/v2/statement"
stressql "github.com/influxdata/influxdb/stress/v2/stressql/statement"
)
// Token represents a lexical token.
type Token int
// These are the lexical tokens used by the file parser
const (
ILLEGAL Token = iota
EOF
STATEMENT
BREAK
)
var eof = rune(0)
func check(e error) {
if e != nil {
log.Fatal(e)
}
}
func isNewline(r rune) bool {
return r == '\n'
}
// Scanner scans the file and tokenizes the raw text
type Scanner struct {
r *bufio.Reader
}
// NewScanner returns a Scanner
func NewScanner(r io.Reader) *Scanner {
return &Scanner{r: bufio.NewReader(r)}
}
func (s *Scanner) read() rune {
ch, _, err := s.r.ReadRune()
if err != nil {
return eof
}
return ch
}
func (s *Scanner) unread() { _ = s.r.UnreadRune() }
func (s *Scanner) peek() rune {
ch := s.read()
s.unread()
return ch
}
// Scan moves the Scanner forward one character
func (s *Scanner) Scan() (tok Token, lit string) {
ch := s.read()
if isNewline(ch) {
s.unread()
return s.scanNewlines()
} else if ch == eof {
return EOF, ""
} else {
s.unread()
return s.scanStatements()
}
// golint marks as unreachable code
// return ILLEGAL, string(ch)
}
func (s *Scanner) scanNewlines() (tok Token, lit string) {
var buf bytes.Buffer
buf.WriteRune(s.read())
for {
if ch := s.read(); ch == eof {
break
} else if !isNewline(ch) {
s.unread()
break
} else {
buf.WriteRune(ch)
}
}
return BREAK, buf.String()
}
func (s *Scanner) scanStatements() (tok Token, lit string) {
var buf bytes.Buffer
buf.WriteRune(s.read())
for {
if ch := s.read(); ch == eof {
break
} else if isNewline(ch) && isNewline(s.peek()) {
s.unread()
break
} else if isNewline(ch) {
s.unread()
buf.WriteRune(ch)
} else {
buf.WriteRune(ch)
}
}
return STATEMENT, buf.String()
}
// ParseStatements takes a configFile and returns a slice of Statements
func ParseStatements(file string) ([]statement.Statement, error) {
seq := []statement.Statement{}
f, err := os.Open(file)
check(err)
s := NewScanner(f)
for {
t, l := s.Scan()
if t == EOF {
break
}
_, err := influxql.ParseStatement(l)
if err == nil {
seq = append(seq, &statement.InfluxqlStatement{Query: l, StatementID: stressql.RandStr(10)})
} else if t == BREAK {
continue
} else {
f := strings.NewReader(l)
p := stressql.NewParser(f)
s, err := p.Parse()
if err != nil {
return nil, err
}
seq = append(seq, s)
}
}
f.Close()
return seq, nil
}
| {
"pile_set_name": "Github"
} |
version https://git-lfs.github.com/spec/v1
oid sha256:249495ad382c83e6070e6a880a2ba13a16369091f412e2f22ea70063c7f7e668
size 14095
| {
"pile_set_name": "Github"
} |
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_onlyjio_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_onlyjio_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>view_field_submit_action_dialog</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>3.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Field Submit Action</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Foo_viewFieldSubmitDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
| {
"pile_set_name": "Github"
} |
start_server {tags {"repl"}} {
start_server {} {
test {First server should have role slave after SLAVEOF} {
r -1 slaveof [srv 0 host] [srv 0 port]
after 1000
s -1 role
} {slave}
if {$::accurate} {set numops 50000} else {set numops 5000}
test {MASTER and SLAVE consistency with expire} {
createComplexDataset r $numops useexpire
after 4000 ;# Make sure everything expired before taking the digest
r keys * ;# Force DEL syntesizing to slave
after 1000 ;# Wait another second. Now everything should be fine.
if {[r debug digest] ne [r -1 debug digest]} {
set csv1 [csvdump r]
set csv2 [csvdump {r -1}]
set fd [open /tmp/repldump1.txt w]
puts -nonewline $fd $csv1
close $fd
set fd [open /tmp/repldump2.txt w]
puts -nonewline $fd $csv2
close $fd
puts "Master - Slave inconsistency"
puts "Run diff -u against /tmp/repldump*.txt for more info"
}
assert_equal [r debug digest] [r -1 debug digest]
}
}
}
| {
"pile_set_name": "Github"
} |
#ifndef VNEWDIRDIALOG_H
#define VNEWDIRDIALOG_H
#include <QDialog>
class QLabel;
class VMetaWordLineEdit;
class QDialogButtonBox;
class QString;
class VDirectory;
class VNewDirDialog : public QDialog
{
Q_OBJECT
public:
VNewDirDialog(const QString &title,
const QString &info,
const QString &defaultName,
VDirectory *directory,
QWidget *parent = 0);
QString getNameInput() const;
private slots:
void handleInputChanged();
private:
void setupUI();
VMetaWordLineEdit *m_nameEdit;
QDialogButtonBox *m_btnBox;
QLabel *m_warnLabel;
QString title;
QString info;
QString defaultName;
VDirectory *m_directory;
};
#endif // VNEWDIRDIALOG_H
| {
"pile_set_name": "Github"
} |
<?php
//============================================================+
// File name : example_063.php
// Begin : 2010-09-29
// Last Update : 2013-05-14
//
// Description : Example 063 for TCPDF class
// Text stretching and spacing (tracking)
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com LTD
// www.tecnick.com
// [email protected]
//============================================================+
/**
* Creates an example PDF TEST document using TCPDF
* @package com.tecnick.tcpdf
* @abstract TCPDF - Example: Text stretching and spacing (tracking)
* @author Nicola Asuni
* @since 2010-09-29
*/
// Include the main TCPDF library (search for installation path).
require_once('tcpdf_include.php');
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 063');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 063', PDF_HEADER_STRING);
// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', 'B', 16);
// add a page
$pdf->AddPage();
$pdf->Write(0, 'Example of Text Stretching and Spacing (tracking)', '', 0, 'L', true, 0, false, false, 0);
$pdf->Ln(5);
// create several cells to display all cases of stretching and spacing combinations.
$fonts = array('times', 'dejavuserif');
$alignments = array('L' => 'LEFT', 'C' => 'CENTER', 'R' => 'RIGHT', 'J' => 'JUSTIFY');
// Test all cases using direct stretching/spacing methods
foreach ($fonts as $fkey => $font) {
$pdf->SetFont($font, '', 14);
foreach ($alignments as $align_mode => $align_name) {
for ($stretching = 90; $stretching <= 110; $stretching += 10) {
for ($spacing = -0.254; $spacing <= 0.254; $spacing += 0.254) {
$pdf->setFontStretching($stretching);
$pdf->setFontSpacing($spacing);
$txt = $align_name.' | Stretching = '.$stretching.'% | Spacing = '.sprintf('%+.3F', $spacing).'mm';
$pdf->Cell(0, 0, $txt, 1, 1, $align_mode);
}
}
}
$pdf->AddPage();
}
// Test all cases using CSS stretching/spacing properties
foreach ($fonts as $fkey => $font) {
$pdf->SetFont($font, '', 11);
foreach ($alignments as $align_mode => $align_name) {
for ($stretching = 90; $stretching <= 110; $stretching += 10) {
for ($spacing = -0.254; $spacing <= 0.254; $spacing += 0.254) {
$html = '<span style="font-stretch:'.$stretching.'%;letter-spacing:'.$spacing.'mm;"><span style="color:red;">'.$align_name.'</span> | <span style="color:green;">Stretching = '.$stretching.'%</span> | <span style="color:blue;">Spacing = '.sprintf('%+.3F', $spacing).'mm</span><br />Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</span>';
$pdf->writeHTMLCell(0, 0, '', '', $html, 1, 1, false, true, $align_mode, false);
}
}
if (!(($fkey == 1) AND ($align_mode == 'J'))) {
$pdf->AddPage();
}
}
}
// reset font stretching
$pdf->setFontStretching(100);
// reset font spacing
$pdf->setFontSpacing(0);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_063.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="cp1125"?>
<!--
SkipUnless: __import__('codecs').lookup('cp1125')
Description: \x80 character in cp1125 encoding
Expect: bozo and feed['title'] == u'\u0410'
-->
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<title>€</title>
</feed | {
"pile_set_name": "Github"
} |
# balanced-match
Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well!
[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match)
[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)
[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match)
## Example
Get the first matching pair of braces:
```js
var balanced = require('balanced-match');
console.log(balanced('{', '}', 'pre{in{nested}}post'));
console.log(balanced('{', '}', 'pre{first}between{second}post'));
console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'));
```
The matches are:
```bash
$ node example.js
{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
{ start: 3,
end: 9,
pre: 'pre',
body: 'first',
post: 'between{second}post' }
{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
```
## API
### var m = balanced(a, b, str)
For the first non-nested matching pair of `a` and `b` in `str`, return an
object with those keys:
* **start** the index of the first match of `a`
* **end** the index of the matching `b`
* **pre** the preamble, `a` and `b` not included
* **body** the match, `a` and `b` not included
* **post** the postscript, `a` and `b` not included
If there's no match, `undefined` will be returned.
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`.
### var r = balanced.range(a, b, str)
For the first non-nested matching pair of `a` and `b` in `str`, return an
array with indexes: `[ <a index>, <b index> ]`.
If there's no match, `undefined` will be returned.
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`.
## Installation
With [npm](https://npmjs.org) do:
```bash
npm install balanced-match
```
## License
(MIT)
Copyright (c) 2013 Julian Gruber <[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.
| {
"pile_set_name": "Github"
} |
1
| {
"pile_set_name": "Github"
} |
/*
Copyright The containerd 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 server
import (
"expvar"
"io"
"net"
"net/http"
"net/http/pprof"
"os"
"path/filepath"
"strings"
"github.com/boltdb/bolt"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/content/local"
"github.com/containerd/containerd/events/exchange"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/metadata"
"github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/snapshots"
metrics "github.com/docker/go-metrics"
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
"github.com/pkg/errors"
"golang.org/x/net/context"
"google.golang.org/grpc"
)
// New creates and initializes a new containerd server
func New(ctx context.Context, config *Config) (*Server, error) {
switch {
case config.Root == "":
return nil, errors.New("root must be specified")
case config.State == "":
return nil, errors.New("state must be specified")
case config.Root == config.State:
return nil, errors.New("root and state must be different paths")
}
if err := os.MkdirAll(config.Root, 0711); err != nil {
return nil, err
}
if err := os.MkdirAll(config.State, 0711); err != nil {
return nil, err
}
if err := apply(ctx, config); err != nil {
return nil, err
}
plugins, err := LoadPlugins(config)
if err != nil {
return nil, err
}
rpc := grpc.NewServer(
grpc.MaxRecvMsgSize(config.GRPC.MaxRecvMsgSize),
grpc.MaxSendMsgSize(config.GRPC.MaxSendMsgSize),
grpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor),
grpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor),
)
var (
services []plugin.Service
s = &Server{
rpc: rpc,
events: exchange.NewExchange(),
config: config,
}
initialized = plugin.NewPluginSet()
)
for _, p := range plugins {
id := p.URI()
log.G(ctx).WithField("type", p.Type).Infof("loading plugin %q...", id)
initContext := plugin.NewContext(
ctx,
p,
initialized,
config.Root,
config.State,
)
initContext.Events = s.events
initContext.Address = config.GRPC.Address
// load the plugin specific configuration if it is provided
if p.Config != nil {
pluginConfig, err := config.Decode(p.ID, p.Config)
if err != nil {
return nil, err
}
initContext.Config = pluginConfig
}
result := p.Init(initContext)
if err := initialized.Add(result); err != nil {
return nil, errors.Wrapf(err, "could not add plugin result to plugin set")
}
instance, err := result.Instance()
if err != nil {
if plugin.IsSkipPlugin(err) {
log.G(ctx).WithField("type", p.Type).Infof("skip loading plugin %q...", id)
} else {
log.G(ctx).WithError(err).Warnf("failed to load plugin %s", id)
}
continue
}
// check for grpc services that should be registered with the server
if service, ok := instance.(plugin.Service); ok {
services = append(services, service)
}
s.plugins = append(s.plugins, result)
}
// register services after all plugins have been initialized
for _, service := range services {
if err := service.Register(rpc); err != nil {
return nil, err
}
}
return s, nil
}
// Server is the containerd main daemon
type Server struct {
rpc *grpc.Server
events *exchange.Exchange
config *Config
plugins []*plugin.Plugin
}
// ServeGRPC provides the containerd grpc APIs on the provided listener
func (s *Server) ServeGRPC(l net.Listener) error {
if s.config.Metrics.GRPCHistogram {
// enable grpc time histograms to measure rpc latencies
grpc_prometheus.EnableHandlingTimeHistogram()
}
// before we start serving the grpc API regster the grpc_prometheus metrics
// handler. This needs to be the last service registered so that it can collect
// metrics for every other service
grpc_prometheus.Register(s.rpc)
return trapClosedConnErr(s.rpc.Serve(l))
}
// ServeMetrics provides a prometheus endpoint for exposing metrics
func (s *Server) ServeMetrics(l net.Listener) error {
m := http.NewServeMux()
m.Handle("/v1/metrics", metrics.Handler())
return trapClosedConnErr(http.Serve(l, m))
}
// ServeDebug provides a debug endpoint
func (s *Server) ServeDebug(l net.Listener) error {
// don't use the default http server mux to make sure nothing gets registered
// that we don't want to expose via containerd
m := http.NewServeMux()
m.Handle("/debug/vars", expvar.Handler())
m.Handle("/debug/pprof/", http.HandlerFunc(pprof.Index))
m.Handle("/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline))
m.Handle("/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
m.Handle("/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol))
m.Handle("/debug/pprof/trace", http.HandlerFunc(pprof.Trace))
return trapClosedConnErr(http.Serve(l, m))
}
// Stop the containerd server canceling any open connections
func (s *Server) Stop() {
s.rpc.Stop()
for i := len(s.plugins) - 1; i >= 0; i-- {
p := s.plugins[i]
instance, err := p.Instance()
if err != nil {
log.L.WithError(err).WithField("id", p.Registration.ID).
Errorf("could not get plugin instance")
continue
}
closer, ok := instance.(io.Closer)
if !ok {
continue
}
if err := closer.Close(); err != nil {
log.L.WithError(err).WithField("id", p.Registration.ID).
Errorf("failed to close plugin")
}
}
}
// LoadPlugins loads all plugins into containerd and generates an ordered graph
// of all plugins.
func LoadPlugins(config *Config) ([]*plugin.Registration, error) {
// load all plugins into containerd
if err := plugin.Load(filepath.Join(config.Root, "plugins")); err != nil {
return nil, err
}
// load additional plugins that don't automatically register themselves
plugin.Register(&plugin.Registration{
Type: plugin.ContentPlugin,
ID: "content",
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
ic.Meta.Exports["root"] = ic.Root
return local.NewStore(ic.Root)
},
})
plugin.Register(&plugin.Registration{
Type: plugin.MetadataPlugin,
ID: "bolt",
Requires: []plugin.Type{
plugin.ContentPlugin,
plugin.SnapshotPlugin,
},
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
if err := os.MkdirAll(ic.Root, 0711); err != nil {
return nil, err
}
cs, err := ic.Get(plugin.ContentPlugin)
if err != nil {
return nil, err
}
snapshottersRaw, err := ic.GetByType(plugin.SnapshotPlugin)
if err != nil {
return nil, err
}
snapshotters := make(map[string]snapshots.Snapshotter)
for name, sn := range snapshottersRaw {
sn, err := sn.Instance()
if err != nil {
log.G(ic.Context).WithError(err).
Warnf("could not use snapshotter %v in metadata plugin", name)
continue
}
snapshotters[name] = sn.(snapshots.Snapshotter)
}
path := filepath.Join(ic.Root, "meta.db")
ic.Meta.Exports["path"] = path
db, err := bolt.Open(path, 0644, nil)
if err != nil {
return nil, err
}
mdb := metadata.NewDB(db, cs.(content.Store), snapshotters)
if err := mdb.Init(ic.Context); err != nil {
return nil, err
}
return mdb, nil
},
})
// return the ordered graph for plugins
return plugin.Graph(config.DisabledPlugins), nil
}
func trapClosedConnErr(err error) error {
if err == nil {
return nil
}
if strings.Contains(err.Error(), "use of closed network connection") {
return nil
}
return err
}
| {
"pile_set_name": "Github"
} |
fib: func [n /f][ do f: func [m] [ either m < 2 [m][(f m - 1) + f m - 2]] n]
| {
"pile_set_name": "Github"
} |
/*
**********************************************************************
* Copyright (c) 2004-2006, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Author: Alan Liu
* Created: April 26, 2004
* Since: ICU 3.0
**********************************************************************
*/
#ifndef __CURRENCYUNIT_H__
#define __CURRENCYUNIT_H__
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#include "unicode/measunit.h"
/**
* \file
* \brief C++ API: Currency Unit Information.
*/
U_NAMESPACE_BEGIN
/**
* A unit of currency, such as USD (U.S. dollars) or JPY (Japanese
* yen). This class is a thin wrapper over a UChar string that
* subclasses MeasureUnit, for use with Measure and MeasureFormat.
*
* @author Alan Liu
* @stable ICU 3.0
*/
class U_I18N_API CurrencyUnit: public MeasureUnit {
public:
/**
* Construct an object with the given ISO currency code.
* @param isoCode the 3-letter ISO 4217 currency code; must not be
* NULL and must have length 3
* @param ec input-output error code. If the isoCode is invalid,
* then this will be set to a failing value.
* @stable ICU 3.0
*/
CurrencyUnit(const UChar* isoCode, UErrorCode &ec);
/**
* Copy constructor
* @stable ICU 3.0
*/
CurrencyUnit(const CurrencyUnit& other);
/**
* Assignment operator
* @stable ICU 3.0
*/
CurrencyUnit& operator=(const CurrencyUnit& other);
/**
* Return a polymorphic clone of this object. The result will
* have the same class as returned by getDynamicClassID().
* @stable ICU 3.0
*/
virtual UObject* clone() const;
/**
* Destructor
* @stable ICU 3.0
*/
virtual ~CurrencyUnit();
/**
* Equality operator. Return true if this object is equal
* to the given object.
* @stable ICU 3.0
*/
UBool operator==(const UObject& other) const;
/**
* Returns a unique class ID for this object POLYMORPHICALLY.
* This method implements a simple form of RTTI used by ICU.
* @return The class ID for this object. All objects of a given
* class have the same class ID. Objects of other classes have
* different class IDs.
* @stable ICU 3.0
*/
virtual UClassID getDynamicClassID() const;
/**
* Returns the class ID for this class. This is used to compare to
* the return value of getDynamicClassID().
* @return The class ID for all objects of this class.
* @stable ICU 3.0
*/
static UClassID U_EXPORT2 getStaticClassID();
/**
* Return the ISO currency code of this object.
* @stable ICU 3.0
*/
inline const UChar* getISOCurrency() const;
private:
/**
* The ISO 4217 code of this object.
*/
UChar isoCode[4];
};
inline const UChar* CurrencyUnit::getISOCurrency() const {
return isoCode;
}
U_NAMESPACE_END
#endif // !UCONFIG_NO_FORMATTING
#endif // __CURRENCYUNIT_H__
| {
"pile_set_name": "Github"
} |
cpu <null>
cpuacct <null>
cpuset /not/really/sys/fs/cgroup/cpuset
memory <null>
devices <null>
freezer /not/really/sys/fs/cgroup/freezer
blkio <null>
net_cls /not/really/sys/fs/cgroup/net_cls
perf_event /not/really/sys/fs/cgroup/perf_event
name=systemd <null>
unified /not/really/sys/fs/cgroup/unified
| {
"pile_set_name": "Github"
} |
package org.bouncycastle.crypto.generators;
import org.bouncycastle.crypto.CipherParameters;
import org.bouncycastle.crypto.Mac;
import org.bouncycastle.crypto.PBEParametersGenerator;
import org.bouncycastle.crypto.digests.SHA1Digest;
import org.bouncycastle.crypto.macs.HMac;
import org.bouncycastle.crypto.params.KeyParameter;
import org.bouncycastle.crypto.params.ParametersWithIV;
/**
* Generator for PBE derived keys and ivs as defined by PKCS 5 V2.0 Scheme 2.
* This generator uses a SHA-1 HMac as the calculation function.
* <p>
* The document this implementation is based on can be found at
* <a href=http://www.rsasecurity.com/rsalabs/pkcs/pkcs-5/index.html>
* RSA's PKCS5 Page</a>
*/
public class PKCS5S2ParametersGenerator
extends PBEParametersGenerator
{
private Mac hMac = new HMac(new SHA1Digest());
/**
* construct a PKCS5 Scheme 2 Parameters generator.
*/
public PKCS5S2ParametersGenerator()
{
}
private void F(
byte[] P,
byte[] S,
int c,
byte[] iBuf,
byte[] out,
int outOff)
{
byte[] state = new byte[hMac.getMacSize()];
CipherParameters param = new KeyParameter(P);
hMac.init(param);
if (S != null)
{
hMac.update(S, 0, S.length);
}
hMac.update(iBuf, 0, iBuf.length);
hMac.doFinal(state, 0);
System.arraycopy(state, 0, out, outOff, state.length);
if (c == 0)
{
throw new IllegalArgumentException("iteration count must be at least 1.");
}
for (int count = 1; count < c; count++)
{
hMac.init(param);
hMac.update(state, 0, state.length);
hMac.doFinal(state, 0);
for (int j = 0; j != state.length; j++)
{
out[outOff + j] ^= state[j];
}
}
}
private void intToOctet(
byte[] buf,
int i)
{
buf[0] = (byte)(i >>> 24);
buf[1] = (byte)(i >>> 16);
buf[2] = (byte)(i >>> 8);
buf[3] = (byte)i;
}
private byte[] generateDerivedKey(
int dkLen)
{
int hLen = hMac.getMacSize();
int l = (dkLen + hLen - 1) / hLen;
byte[] iBuf = new byte[4];
byte[] out = new byte[l * hLen];
for (int i = 1; i <= l; i++)
{
intToOctet(iBuf, i);
F(password, salt, iterationCount, iBuf, out, (i - 1) * hLen);
}
return out;
}
/**
* Generate a key parameter derived from the password, salt, and iteration
* count we are currently initialised with.
*
* @param keySize the size of the key we want (in bits)
* @return a KeyParameter object.
*/
public CipherParameters generateDerivedParameters(
int keySize)
{
keySize = keySize / 8;
byte[] dKey = generateDerivedKey(keySize);
return new KeyParameter(dKey, 0, keySize);
}
/**
* Generate a key with initialisation vector parameter derived from
* the password, salt, and iteration count we are currently initialised
* with.
*
* @param keySize the size of the key we want (in bits)
* @param ivSize the size of the iv we want (in bits)
* @return a ParametersWithIV object.
*/
public CipherParameters generateDerivedParameters(
int keySize,
int ivSize)
{
keySize = keySize / 8;
ivSize = ivSize / 8;
byte[] dKey = generateDerivedKey(keySize + ivSize);
return new ParametersWithIV(new KeyParameter(dKey, 0, keySize), dKey, keySize, ivSize);
}
/**
* Generate a key parameter for use with a MAC derived from the password,
* salt, and iteration count we are currently initialised with.
*
* @param keySize the size of the key we want (in bits)
* @return a KeyParameter object.
*/
public CipherParameters generateDerivedMacParameters(
int keySize)
{
return generateDerivedParameters(keySize);
}
}
| {
"pile_set_name": "Github"
} |
-----BEGIN CERTIFICATE-----
MIIDATCCAemgAwIBAgIBAzANBgkqhkiG9w0BAQsFADAuMRAwDgYDVQQKDAdDb2Nr
cGl0MQ0wCwYDVQQLDAR0ZXN0MQswCQYDVQQDDAJDQTAeFw0yMDA3MTYxMDAwMDRa
Fw0yMDA3MTcxMDAwMDRaMD4xDjAMBgNVBAMMBWFsaWNlMRcwFQYKCZImiZPyLGQB
GRYHQ09DS1BJVDETMBEGCgmSJomT8ixkARkWA0xBTjCCASIwDQYJKoZIhvcNAQEB
BQADggEPADCCAQoCggEBAKCyJitfhk/xbb+Y9vOX5qbNu6ZKggvmDvT7NLv8PZoV
zi8GYtDhCCBEj80tfAbFlf34Vk/TtLFEbuETFpeMKjgX15dTtvUHOYfUQ1pSOIAa
rDPrf57rcbtxkTUHEgVg21RxzglTl17VQjl7JzS3F/pr/JifleGKxgTWDNAfpQJF
tppLkanzSOfNDGTy2cxv82I20SSI5AhAXKz7h3NWnXCBdinFbhtlkAl/j9zlZJou
dCht6qA92ZvbOjl6ta+DlykCg0fMuRiy4X96DRwCdCW8Bht/g1x0AlUXUI5MKH68
xmnb2xeYwFrT5Tf0p20kVIQaBjOD9mmywYNnlfWu/nsCAwEAAaMaMBgwCQYDVR0T
BAIwADALBgNVHQ8EBAMCA6gwDQYJKoZIhvcNAQELBQADggEBAAlw3KdjUyhGJoQ9
E4rMFkZcEpY1T9sNvk1NKqzFgk9IV0uMvefs0r6Q+B790U2JbjcXfRXkfN/0+VEf
k+bx2ReHXkNhRoiP2bNhSPelm9HXdCzEtSegat8o6ze5/Dp74ALLBxsPyZehO2h/
uNL4d3tJ6Rl3rc4yv6Ap0sqSSi9nvjoAAJtJp9XuHTzRlWNeDYU+8Tc/bhJYk1jA
KAmmrFpuMnE/JC3eJ63foM8oiww3dCYK4efq5UXMz844QswZjk9YTGSMal3/V01V
Wy26r7soTOCPBRoPynF4A/JatWBBa/9TbYWO/+bJe6ctophkFC77jC8MJCz9r0JC
3eTDbwI=
-----END CERTIFICATE-----
| {
"pile_set_name": "Github"
} |
__________________________________________________________________________________________________
__________________________________________________________________________________________________
__________________________________________________________________________________________________
| {
"pile_set_name": "Github"
} |
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Uri
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Http.php 23970 2011-05-03 15:46:57Z ralph $
*/
/**
* @see Zend_Uri
*/
require_once 'Zend/Uri.php';
/**
* @see Zend_Validate_Hostname
*/
require_once 'Zend/Validate/Hostname.php';
/**
* HTTP(S) URI handler
*
* @category Zend
* @package Zend_Uri
* @uses Zend_Uri
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Uri_Http extends Zend_Uri
{
/**
* Character classes for validation regular expressions
*/
const CHAR_ALNUM = 'A-Za-z0-9';
const CHAR_MARK = '-_.!~*\'()\[\]';
const CHAR_RESERVED = ';\/?:@&=+$,';
const CHAR_SEGMENT = ':@&=+$,;';
const CHAR_UNWISE = '{}|\\\\^`';
/**
* HTTP username
*
* @var string
*/
protected $_username = '';
/**
* HTTP password
*
* @var string
*/
protected $_password = '';
/**
* HTTP host
*
* @var string
*/
protected $_host = '';
/**
* HTTP post
*
* @var string
*/
protected $_port = '';
/**
* HTTP part
*
* @var string
*/
protected $_path = '';
/**
* HTTP query
*
* @var string
*/
protected $_query = '';
/**
* HTTP fragment
*
* @var string
*/
protected $_fragment = '';
/**
* Regular expression grammar rules for validation; values added by constructor
*
* @var array
*/
protected $_regex = array();
/**
* Constructor accepts a string $scheme (e.g., http, https) and a scheme-specific part of the URI
* (e.g., example.com/path/to/resource?query=param#fragment)
*
* @param string $scheme The scheme of the URI
* @param string $schemeSpecific The scheme-specific part of the URI
* @throws Zend_Uri_Exception When the URI is not valid
*/
protected function __construct($scheme, $schemeSpecific = '')
{
// Set the scheme
$this->_scheme = $scheme;
// Set up grammar rules for validation via regular expressions. These
// are to be used with slash-delimited regular expression strings.
// Escaped special characters (eg. '%25' for '%')
$this->_regex['escaped'] = '%[[:xdigit:]]{2}';
// Unreserved characters
$this->_regex['unreserved'] = '[' . self::CHAR_ALNUM . self::CHAR_MARK . ']';
// Segment can use escaped, unreserved or a set of additional chars
$this->_regex['segment'] = '(?:' . $this->_regex['escaped'] . '|[' .
self::CHAR_ALNUM . self::CHAR_MARK . self::CHAR_SEGMENT . '])*';
// Path can be a series of segmets char strings seperated by '/'
$this->_regex['path'] = '(?:\/(?:' . $this->_regex['segment'] . ')?)+';
// URI characters can be escaped, alphanumeric, mark or reserved chars
$this->_regex['uric'] = '(?:' . $this->_regex['escaped'] . '|[' .
self::CHAR_ALNUM . self::CHAR_MARK . self::CHAR_RESERVED .
// If unwise chars are allowed, add them to the URI chars class
(self::$_config['allow_unwise'] ? self::CHAR_UNWISE : '') . '])';
// If no scheme-specific part was supplied, the user intends to create
// a new URI with this object. No further parsing is required.
if (strlen($schemeSpecific) === 0) {
return;
}
// Parse the scheme-specific URI parts into the instance variables.
$this->_parseUri($schemeSpecific);
// Validate the URI
if ($this->valid() === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception('Invalid URI supplied');
}
}
/**
* Creates a Zend_Uri_Http from the given string
*
* @param string $uri String to create URI from, must start with
* 'http://' or 'https://'
* @throws InvalidArgumentException When the given $uri is not a string or
* does not start with http:// or https://
* @throws Zend_Uri_Exception When the given $uri is invalid
* @return Zend_Uri_Http
*/
public static function fromString($uri)
{
if (is_string($uri) === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception('$uri is not a string');
}
$uri = explode(':', $uri, 2);
$scheme = strtolower($uri[0]);
$schemeSpecific = isset($uri[1]) === true ? $uri[1] : '';
if (in_array($scheme, array('http', 'https')) === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception("Invalid scheme: '$scheme'");
}
$schemeHandler = new Zend_Uri_Http($scheme, $schemeSpecific);
return $schemeHandler;
}
/**
* Parse the scheme-specific portion of the URI and place its parts into instance variables.
*
* @param string $schemeSpecific The scheme-specific portion to parse
* @throws Zend_Uri_Exception When scheme-specific decoposition fails
* @throws Zend_Uri_Exception When authority decomposition fails
* @return void
*/
protected function _parseUri($schemeSpecific)
{
// High-level decomposition parser
$pattern = '~^((//)([^/?#]*))([^?#]*)(\?([^#]*))?(#(.*))?$~';
$status = @preg_match($pattern, $schemeSpecific, $matches);
if ($status === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception('Internal error: scheme-specific decomposition failed');
}
// Failed decomposition; no further processing needed
if ($status === false) {
return;
}
// Save URI components that need no further decomposition
$this->_path = isset($matches[4]) === true ? $matches[4] : '';
$this->_query = isset($matches[6]) === true ? $matches[6] : '';
$this->_fragment = isset($matches[8]) === true ? $matches[8] : '';
// Additional decomposition to get username, password, host, and port
$combo = isset($matches[3]) === true ? $matches[3] : '';
$pattern = '~^(([^:@]*)(:([^@]*))?@)?((?(?=[[])[[][^]]+[]]|[^:]+))(:(.*))?$~';
$status = @preg_match($pattern, $combo, $matches);
if ($status === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception('Internal error: authority decomposition failed');
}
// Save remaining URI components
$this->_username = isset($matches[2]) === true ? $matches[2] : '';
$this->_password = isset($matches[4]) === true ? $matches[4] : '';
$this->_host = isset($matches[5]) === true
? preg_replace('~^\[([^]]+)\]$~', '\1', $matches[5]) // Strip wrapper [] from IPv6 literal
: '';
$this->_port = isset($matches[7]) === true ? $matches[7] : '';
}
/**
* Returns a URI based on current values of the instance variables. If any
* part of the URI does not pass validation, then an exception is thrown.
*
* @throws Zend_Uri_Exception When one or more parts of the URI are invalid
* @return string
*/
public function getUri()
{
if ($this->valid() === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception('One or more parts of the URI are invalid');
}
$password = strlen($this->_password) > 0 ? ":$this->_password" : '';
$auth = strlen($this->_username) > 0 ? "$this->_username$password@" : '';
$port = strlen($this->_port) > 0 ? ":$this->_port" : '';
$query = strlen($this->_query) > 0 ? "?$this->_query" : '';
$fragment = strlen($this->_fragment) > 0 ? "#$this->_fragment" : '';
return $this->_scheme
. '://'
. $auth
. $this->_host
. $port
. $this->_path
. $query
. $fragment;
}
/**
* Validate the current URI from the instance variables. Returns true if and only if all
* parts pass validation.
*
* @return boolean
*/
public function valid()
{
// Return true if and only if all parts of the URI have passed validation
return $this->validateUsername()
and $this->validatePassword()
and $this->validateHost()
and $this->validatePort()
and $this->validatePath()
and $this->validateQuery()
and $this->validateFragment();
}
/**
* Returns the username portion of the URL, or FALSE if none.
*
* @return string
*/
public function getUsername()
{
return strlen($this->_username) > 0 ? $this->_username : false;
}
/**
* Returns true if and only if the username passes validation. If no username is passed,
* then the username contained in the instance variable is used.
*
* @param string $username The HTTP username
* @throws Zend_Uri_Exception When username validation fails
* @return boolean
* @link http://www.faqs.org/rfcs/rfc2396.html
*/
public function validateUsername($username = null)
{
if ($username === null) {
$username = $this->_username;
}
// If the username is empty, then it is considered valid
if (strlen($username) === 0) {
return true;
}
// Check the username against the allowed values
$status = @preg_match('/^(?:' . $this->_regex['escaped'] . '|[' .
self::CHAR_ALNUM . self::CHAR_MARK . ';:&=+$,' . '])+$/', $username);
if ($status === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception('Internal error: username validation failed');
}
return $status === 1;
}
/**
* Sets the username for the current URI, and returns the old username
*
* @param string $username The HTTP username
* @throws Zend_Uri_Exception When $username is not a valid HTTP username
* @return string
*/
public function setUsername($username)
{
if ($this->validateUsername($username) === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception("Username \"$username\" is not a valid HTTP username");
}
$oldUsername = $this->_username;
$this->_username = $username;
return $oldUsername;
}
/**
* Returns the password portion of the URL, or FALSE if none.
*
* @return string
*/
public function getPassword()
{
return strlen($this->_password) > 0 ? $this->_password : false;
}
/**
* Returns true if and only if the password passes validation. If no password is passed,
* then the password contained in the instance variable is used.
*
* @param string $password The HTTP password
* @throws Zend_Uri_Exception When password validation fails
* @return boolean
* @link http://www.faqs.org/rfcs/rfc2396.html
*/
public function validatePassword($password = null)
{
if ($password === null) {
$password = $this->_password;
}
// If the password is empty, then it is considered valid
if (strlen($password) === 0) {
return true;
}
// If the password is nonempty, but there is no username, then it is considered invalid
if (strlen($password) > 0 and strlen($this->_username) === 0) {
return false;
}
// Check the password against the allowed values
$status = @preg_match('/^(?:' . $this->_regex['escaped'] . '|[' .
self::CHAR_ALNUM . self::CHAR_MARK . ';:&=+$,' . '])+$/', $password);
if ($status === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception('Internal error: password validation failed.');
}
return $status == 1;
}
/**
* Sets the password for the current URI, and returns the old password
*
* @param string $password The HTTP password
* @throws Zend_Uri_Exception When $password is not a valid HTTP password
* @return string
*/
public function setPassword($password)
{
if ($this->validatePassword($password) === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception("Password \"$password\" is not a valid HTTP password.");
}
$oldPassword = $this->_password;
$this->_password = $password;
return $oldPassword;
}
/**
* Returns the domain or host IP portion of the URL, or FALSE if none.
*
* @return string
*/
public function getHost()
{
return strlen($this->_host) > 0 ? $this->_host : false;
}
/**
* Returns true if and only if the host string passes validation. If no host is passed,
* then the host contained in the instance variable is used.
*
* @param string $host The HTTP host
* @return boolean
* @uses Zend_Filter
*/
public function validateHost($host = null)
{
if ($host === null) {
$host = $this->_host;
}
// If the host is empty, then it is considered invalid
if (strlen($host) === 0) {
return false;
}
// Check the host against the allowed values; delegated to Zend_Filter.
$validate = new Zend_Validate_Hostname(Zend_Validate_Hostname::ALLOW_ALL);
return $validate->isValid($host);
}
/**
* Sets the host for the current URI, and returns the old host
*
* @param string $host The HTTP host
* @throws Zend_Uri_Exception When $host is nota valid HTTP host
* @return string
*/
public function setHost($host)
{
if ($this->validateHost($host) === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception("Host \"$host\" is not a valid HTTP host");
}
$oldHost = $this->_host;
$this->_host = $host;
return $oldHost;
}
/**
* Returns the TCP port, or FALSE if none.
*
* @return string
*/
public function getPort()
{
return strlen($this->_port) > 0 ? $this->_port : false;
}
/**
* Returns true if and only if the TCP port string passes validation. If no port is passed,
* then the port contained in the instance variable is used.
*
* @param string $port The HTTP port
* @return boolean
*/
public function validatePort($port = null)
{
if ($port === null) {
$port = $this->_port;
}
// If the port is empty, then it is considered valid
if (strlen($port) === 0) {
return true;
}
// Check the port against the allowed values
return ctype_digit((string) $port) and 1 <= $port and $port <= 65535;
}
/**
* Sets the port for the current URI, and returns the old port
*
* @param string $port The HTTP port
* @throws Zend_Uri_Exception When $port is not a valid HTTP port
* @return string
*/
public function setPort($port)
{
if ($this->validatePort($port) === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception("Port \"$port\" is not a valid HTTP port.");
}
$oldPort = $this->_port;
$this->_port = $port;
return $oldPort;
}
/**
* Returns the path and filename portion of the URL.
*
* @return string
*/
public function getPath()
{
return strlen($this->_path) > 0 ? $this->_path : '/';
}
/**
* Returns true if and only if the path string passes validation. If no path is passed,
* then the path contained in the instance variable is used.
*
* @param string $path The HTTP path
* @throws Zend_Uri_Exception When path validation fails
* @return boolean
*/
public function validatePath($path = null)
{
if ($path === null) {
$path = $this->_path;
}
// If the path is empty, then it is considered valid
if (strlen($path) === 0) {
return true;
}
// Determine whether the path is well-formed
$pattern = '/^' . $this->_regex['path'] . '$/';
$status = @preg_match($pattern, $path);
if ($status === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception('Internal error: path validation failed');
}
return (boolean) $status;
}
/**
* Sets the path for the current URI, and returns the old path
*
* @param string $path The HTTP path
* @throws Zend_Uri_Exception When $path is not a valid HTTP path
* @return string
*/
public function setPath($path)
{
if ($this->validatePath($path) === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception("Path \"$path\" is not a valid HTTP path");
}
$oldPath = $this->_path;
$this->_path = $path;
return $oldPath;
}
/**
* Returns the query portion of the URL (after ?), or FALSE if none.
*
* @return string
*/
public function getQuery()
{
return strlen($this->_query) > 0 ? $this->_query : false;
}
/**
* Returns the query portion of the URL (after ?) as a
* key-value-array. If the query is empty an empty array
* is returned
*
* @return array
*/
public function getQueryAsArray()
{
$query = $this->getQuery();
$querryArray = array();
if ($query !== false) {
parse_str($query, $querryArray);
}
return $querryArray;
}
/**
* Returns true if and only if the query string passes validation. If no query is passed,
* then the query string contained in the instance variable is used.
*
* @param string $query The query to validate
* @throws Zend_Uri_Exception When query validation fails
* @return boolean
* @link http://www.faqs.org/rfcs/rfc2396.html
*/
public function validateQuery($query = null)
{
if ($query === null) {
$query = $this->_query;
}
// If query is empty, it is considered to be valid
if (strlen($query) === 0) {
return true;
}
// Determine whether the query is well-formed
$pattern = '/^' . $this->_regex['uric'] . '*$/';
$status = @preg_match($pattern, $query);
if ($status === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception('Internal error: query validation failed');
}
return $status == 1;
}
/**
* Add or replace params in the query string for the current URI, and
* return the old query.
*
* @param array $queryParams
* @return string Old query string
*/
public function addReplaceQueryParameters(array $queryParams)
{
$queryParams = array_merge($this->getQueryAsArray(), $queryParams);
return $this->setQuery($queryParams);
}
/**
* Remove params in the query string for the current URI, and
* return the old query.
*
* @param array $queryParamKeys
* @return string Old query string
*/
public function removeQueryParameters(array $queryParamKeys)
{
$queryParams = array_diff_key($this->getQueryAsArray(), array_fill_keys($queryParamKeys, 0));
return $this->setQuery($queryParams);
}
/**
* Set the query string for the current URI, and return the old query
* string This method accepts both strings and arrays.
*
* @param string|array $query The query string or array
* @throws Zend_Uri_Exception When $query is not a valid query string
* @return string Old query string
*/
public function setQuery($query)
{
$oldQuery = $this->_query;
// If query is empty, set an empty string
if (empty($query) === true) {
$this->_query = '';
return $oldQuery;
}
// If query is an array, make a string out of it
if (is_array($query) === true) {
$query = http_build_query($query, '', '&');
} else {
// If it is a string, make sure it is valid. If not parse and encode it
$query = (string) $query;
if ($this->validateQuery($query) === false) {
parse_str($query, $queryArray);
$query = http_build_query($queryArray, '', '&');
}
}
// Make sure the query is valid, and set it
if ($this->validateQuery($query) === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception("'$query' is not a valid query string");
}
$this->_query = $query;
return $oldQuery;
}
/**
* Returns the fragment portion of the URL (after #), or FALSE if none.
*
* @return string|false
*/
public function getFragment()
{
return strlen($this->_fragment) > 0 ? $this->_fragment : false;
}
/**
* Returns true if and only if the fragment passes validation. If no fragment is passed,
* then the fragment contained in the instance variable is used.
*
* @param string $fragment Fragment of an URI
* @throws Zend_Uri_Exception When fragment validation fails
* @return boolean
* @link http://www.faqs.org/rfcs/rfc2396.html
*/
public function validateFragment($fragment = null)
{
if ($fragment === null) {
$fragment = $this->_fragment;
}
// If fragment is empty, it is considered to be valid
if (strlen($fragment) === 0) {
return true;
}
// Determine whether the fragment is well-formed
$pattern = '/^' . $this->_regex['uric'] . '*$/';
$status = @preg_match($pattern, $fragment);
if ($status === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception('Internal error: fragment validation failed');
}
return (boolean) $status;
}
/**
* Sets the fragment for the current URI, and returns the old fragment
*
* @param string $fragment Fragment of the current URI
* @throws Zend_Uri_Exception When $fragment is not a valid HTTP fragment
* @return string
*/
public function setFragment($fragment)
{
if ($this->validateFragment($fragment) === false) {
require_once 'Zend/Uri/Exception.php';
throw new Zend_Uri_Exception("Fragment \"$fragment\" is not a valid HTTP fragment");
}
$oldFragment = $this->_fragment;
$this->_fragment = $fragment;
return $oldFragment;
}
}
| {
"pile_set_name": "Github"
} |
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
%{
#nowarn "1182" // the generated code often has unused variable "parseState"
open Internal.Utilities
open Internal.Utilities.Text
open FSharp.Compiler.AbstractIL
open FSharp.Compiler.AbstractIL.Internal
open FSharp.Compiler.AbstractIL.Internal.AsciiConstants
open FSharp.Compiler.AbstractIL.Diagnostics
open FSharp.Compiler.AbstractIL.Extensions.ILX.Types
open FSharp.Compiler.AbstractIL.IL
open FSharp.Compiler.AbstractIL.Internal.Library
let pfailwith s =
stderr.WriteLine ("*** error: "+s);
raise Parsing.RecoverableParseError
type ResolvedAtMethodSpecScope<'T> =
ResolvedAtMethodSpecScope of (ILGenericParameterDefs -> 'T)
let noMethodSpecScope x = ResolvedAtMethodSpecScope (fun _cgparams -> x)
let resolveMethodSpecScope (ResolvedAtMethodSpecScope f) x = f x
let resolveMethodSpecScopeThen (ResolvedAtMethodSpecScope f) g =
ResolvedAtMethodSpecScope (fun x -> resolveMethodSpecScope (g(f x)) x)
let resolveCurrentMethodSpecScope obj =
resolveMethodSpecScope obj mkILEmptyGenericParams
let findSystemRuntimeAssemblyRef() =
match parseILGlobals.primaryAssemblyScopeRef with
| ILScopeRef.Assembly aref -> aref
| _ -> pfailwith "systemRuntimeScopeRef not set to valid assembly reference in parseILGlobals"
let findAssemblyRef nm =
if nm = "mscorlib" then findSystemRuntimeAssemblyRef()
else
pfailwith ("Undefined assembly ref '" + nm + "'")
%}
/*-----------------------------------------------------------------------
* The YACC Grammar
*----------------------------------------------------------------------*/
%token <int64> VAL_INT64 /* 342534523534534 0x34FA434644554 */
%token <int32> VAL_INT32_ELIPSES /* 342534523534534... */
%token <double> VAL_FLOAT64 /* -334234 24E-34 */
%token <Int32Instr> INSTR_I
%token <Int32Int32Instr> INSTR_I32_I32
%token <Int64Instr> INSTR_I8
%token <DoubleInstr> INSTR_R
%token <NoArgInstr> INSTR_NONE
%token <StringInstr> INSTR_STRING
%token <TokenInstr> INSTR_TOK
%token <TypeInstr> INSTR_TYPE
%token <IntTypeInstr> INSTR_INT_TYPE
%token <ValueTypeInstr> INSTR_VALUETYPE
%token <int> VAL_HEXBYTE /* 05 1A FA */
%token <string> VAL_ID /* testing343 */
%token <string> VAL_DOTTEDNAME /* testing343.abd */
%token <string> VAL_QSTRING /* "Hello World\n" */
%token <string> VAL_SQSTRING /* 'Hello World\n' */
%token AMP
%token BANG
%token BOOL
%token BYTEARRAY
%token CHAR
%token CLASS
%token COMMA
%token DCOLON
%token DEFAULT
%token DOT
%token ELIPSES
%token EOF
%token EXPLICIT
%token FIELD
%token FLOAT32
%token FLOAT64
%token GREATER
%token INSTANCE
%token INT
%token INT16
%token INT32
%token INT64
%token INT8
%token LBRACK
%token LESS
%token LPAREN
%token METHOD
%token NATIVE
%token OBJECT
%token PLUS
%token RBRACK
%token RPAREN
%token SLASH
%token STAR
%token STRING
%token UINT
%token UINT16
%token UINT32
%token UINT64
%token UINT8
%token UNMANAGED
%token UNSIGNED
%token VALUE
%token VALUETYPE
%token VARARG
%token VOID
%type <string> name1
%type <ILType ResolvedAtMethodSpecScope> typ
%type <ILInstr array> ilInstrs
%type <ILType> ilType
%start ilInstrs ilType
/**************************************************************************/
%%
/* ENTRYPOINT */
ilType: typ EOF
{ resolveMethodSpecScope $1 [] }
/* ENTRYPOINT */
ilInstrs: instrs2 EOF
{ Array.ofList $1 }
compQstring:
VAL_QSTRING { $1 }
| compQstring PLUS VAL_QSTRING { $1 + $3 }
methodName: name1 { $1 }
instrs2:
| instr instrs2
{ $1 :: $2 }
| { [] }
instr:
INSTR_NONE
{ ($1 ()) }
| INSTR_I int32
{ ($1 $2) }
| INSTR_I32_I32 int32 int32
{ ($1 ($2,$3)) }
| INSTR_I8 int64
{ ($1 $2) }
| INSTR_R float64
{ ($1 (ILConst.R8 $2)) }
| INSTR_R int64
{ ($1 (ILConst.R8 (float $2))) }
| INSTR_TYPE typSpec
{ $1 (resolveCurrentMethodSpecScope $2) }
| INSTR_INT_TYPE int32 typSpec
{ $1 ( $2,resolveCurrentMethodSpecScope $3) }
| INSTR_VALUETYPE typSpec
{ $1 (resolveCurrentMethodSpecScope $2) }
| INSTR_TOK typSpec
{ ($1 (ILToken.ILType (resolveCurrentMethodSpecScope $2))) }
/*-----------------------------------------------
* Type names
*---------------------------------------------*/
name1:
| id
{ $1 }
| VAL_DOTTEDNAME
{ $1 }
| name1 DOT id
{ $1 + "." + $3 }
className:
LBRACK name1 RBRACK slashedName
{ let (enc,nm) = $4
let aref = findAssemblyRef $2
ILScopeRef.Assembly aref, enc, nm }
| slashedName
{ let enc, nm = $1 in (ILScopeRef.Local, enc, nm) }
slashedName:
name1
{ ([],$1) }
| name1 SLASH slashedName
{ let (enc,nm) = $3 in ($1 :: enc, nm) }
typeNameInst:
className opt_actual_tyargs
{ let (a,b,c) = $1
resolveMethodSpecScopeThen $2 (fun inst ->
noMethodSpecScope ( (mkILTySpec ( (mkILNestedTyRef (a,b,c)), inst)))) }
typeName:
className
{ let (a,b,c) = $1
noMethodSpecScope ( (mkILTySpec ( (mkILNestedTyRef (a,b,c)), []))) }
typSpec:
typeName
{ resolveMethodSpecScopeThen $1 (fun tref ->
noMethodSpecScope (mkILBoxedType tref)) }
| typ
{ $1 }
| LPAREN typ RPAREN
{ $2 }
callConv:
INSTANCE callKind
{ Callconv (ILThisConvention.Instance,$2) }
| EXPLICIT callKind
{ Callconv (ILThisConvention.InstanceExplicit,$2) }
| callKind
{ Callconv (ILThisConvention.Static,$1) }
callKind:
/* EMPTY */
{ ILArgConvention.Default }
| DEFAULT
{ ILArgConvention.Default }
| VARARG
{ ILArgConvention.VarArg }
/*-----------------------------------------------
* The full algebra of types, typically producing results
* awaiting further info about how to fix up type
* variable numbers etc.
*---------------------------------------------*/
typ: STRING
{ noMethodSpecScope parseILGlobals.typ_String }
| OBJECT
{ noMethodSpecScope parseILGlobals.typ_Object }
| CLASS typeNameInst
{ resolveMethodSpecScopeThen $2 (fun tspec ->
noMethodSpecScope (mkILBoxedType tspec)) }
| VALUE CLASS typeNameInst
{ resolveMethodSpecScopeThen $3 (fun tspec ->
noMethodSpecScope (ILType.Value tspec)) }
| VALUETYPE typeNameInst
{ resolveMethodSpecScopeThen $2 (fun tspec ->
noMethodSpecScope (ILType.Value tspec)) }
| typ LBRACK RBRACK
{ resolveMethodSpecScopeThen $1 (fun ty -> noMethodSpecScope (mkILArr1DTy ty)) }
| typ LBRACK bounds1 RBRACK
{ resolveMethodSpecScopeThen $1 (fun ty -> noMethodSpecScope (mkILArrTy (ty,ILArrayShape $3))) }
| typ AMP
{ resolveMethodSpecScopeThen $1 (fun ty -> noMethodSpecScope (ILType.Byref ty)) }
| typ STAR
{ resolveMethodSpecScopeThen $1 (fun ty -> noMethodSpecScope (ILType.Ptr ty)) }
| CHAR
{ noMethodSpecScope parseILGlobals.typ_Char }
| VOID
{ noMethodSpecScope ILType.Void }
| BOOL
{ noMethodSpecScope parseILGlobals.typ_Bool }
| INT8
{ noMethodSpecScope parseILGlobals.typ_SByte }
| INT16
{ noMethodSpecScope parseILGlobals.typ_Int16 }
| INT32
{ noMethodSpecScope parseILGlobals.typ_Int32 }
| INT64
{ noMethodSpecScope parseILGlobals.typ_Int64 }
| FLOAT32
{ noMethodSpecScope parseILGlobals.typ_Single }
| FLOAT64
{ noMethodSpecScope parseILGlobals.typ_Double }
| UNSIGNED INT8
{ noMethodSpecScope parseILGlobals.typ_Byte }
| UNSIGNED INT16
{ noMethodSpecScope parseILGlobals.typ_UInt16 }
| UNSIGNED INT32
{ noMethodSpecScope parseILGlobals.typ_UInt32 }
| UNSIGNED INT64
{ noMethodSpecScope parseILGlobals.typ_UInt64 }
| UINT8
{ noMethodSpecScope parseILGlobals.typ_Byte }
| UINT16
{ noMethodSpecScope parseILGlobals.typ_UInt16 }
| UINT32
{ noMethodSpecScope parseILGlobals.typ_UInt32 }
| UINT64
{ noMethodSpecScope parseILGlobals.typ_UInt64 }
| NATIVE INT
{ noMethodSpecScope parseILGlobals.typ_IntPtr }
| NATIVE UNSIGNED INT
{ noMethodSpecScope parseILGlobals.typ_UIntPtr }
| NATIVE UINT
{ noMethodSpecScope parseILGlobals.typ_UIntPtr }
| BANG int32
{ noMethodSpecScope (ILType.TypeVar (uint16 ( $2))) }
bounds1:
bound
{ [$1] }
| bounds1 COMMA bound
{ $1 @ [$3] }
bound:
/*EMPTY*/
{ (None, None) }
| int32
{ (None, Some $1) }
| int32 ELIPSES int32
{ (Some $1, Some ($3 - $1 + 1)) }
| int32 ELIPSES
{ (Some $1, None) }
/* We need to be able to parse all of */
/* ldc.r8 0. */
/* float64(-657435.) */
/* and int32[0...,0...] */
/* The problem is telling an integer-followed-by-ellipses from a floating-point-nubmer-followed-by-dots */
| VAL_INT32_ELIPSES int32
{ (Some $1, Some ($2 - $1 + 1)) }
| VAL_INT32_ELIPSES
{ (Some $1, None) }
id:
VAL_ID
{ $1 }
| VAL_SQSTRING
{ $1 }
int32:
VAL_INT64
{ int32 $1 }
int64:
VAL_INT64
{ $1 }
float64:
VAL_FLOAT64
{ $1 }
| FLOAT64 LPAREN int64 RPAREN
{ System.BitConverter.Int64BitsToDouble $3 }
opt_actual_tyargs:
/* EMPTY */
{ noMethodSpecScope [] }
| actual_tyargs
{ resolveMethodSpecScopeThen $1 (fun res ->
noMethodSpecScope res) }
actual_tyargs:
LESS actualTypSpecs GREATER
{ $2 }
actualTypSpecs:
typSpec
{ resolveMethodSpecScopeThen $1 (fun res ->
noMethodSpecScope [ res]) }
| actualTypSpecs COMMA typSpec
{ resolveMethodSpecScopeThen $1 (fun x ->
resolveMethodSpecScopeThen $3 (fun y ->
noMethodSpecScope (x @ [ y]))) }
| {
"pile_set_name": "Github"
} |
// @tag core
// @define Ext.Boot
var Ext = Ext || {};
//<editor-fold desc="Boot">
/**
* @class Ext.Boot
* @singleton
* @private
*/
Ext.Boot = Ext.Boot || (function (emptyFn) {
var doc = document,
_emptyArray = [],
_config = {
/**
* @cfg {Boolean} [disableCaching=true]
* If `true` current timestamp is added to script URL's to prevent caching.
* In debug builds, adding a "cache" or "disableCacheBuster" query parameter
* to the page's URL will set this to `false`.
*/
disableCaching: (/[?&](?:cache|disableCacheBuster)\b/i.test(location.search) ||
!(/http[s]?\:/i.test(location.href)) ||
/(^|[ ;])ext-cache=1/.test(doc.cookie)) ? false :
true,
/**
* @cfg {String} [disableCachingParam="_dc"]
* The query parameter name for the cache buster's timestamp.
*/
disableCachingParam: '_dc',
/**
* @cfg {Boolean} loadDelay
* Millisecond delay between asynchronous script injection (prevents stack
* overflow on some user agents) 'false' disables delay but potentially
* increases stack load.
*/
loadDelay: false,
/**
* @cfg {Boolean} preserveScripts
* `false` to remove asynchronously loaded scripts, `true` to retain script
* element for browser debugger compatibility and improved load performance.
*/
preserveScripts: true,
/**
* @cfg {String} [charset=UTF-8]
* Optional charset to specify encoding of dynamic content.
*/
charset: 'UTF-8'
},
_assetConfig= {},
cssRe = /\.css(?:\?|$)/i,
resolverEl = doc.createElement('a'),
isBrowser = typeof window !== 'undefined',
_environment = {
browser: isBrowser,
node: !isBrowser && (typeof require === 'function'),
phantom: (window && (window._phantom || window.callPhantom)) || /PhantomJS/.test(window.navigator.userAgent)
},
_tags = (Ext.platformTags = {}),
//<debug>
// All calls to _debug are commented out to speed up old browsers a bit;
// yes that makes a difference because the cost of concatenating strings
// and passing them into _debug() adds up pretty quickly.
_debug = function (message) {
//console.log(message);
},
//</debug>
_apply = function (object, config, defaults) {
if (defaults) {
_apply(object, defaults);
}
if (object && config && typeof config === 'object') {
for (var i in config) {
object[i] = config[i];
}
}
return object;
},
_merge = function() {
var lowerCase = false,
obj = Array.prototype.shift.call(arguments),
index, i, len, value;
if (typeof arguments[arguments.length - 1] === 'boolean') {
lowerCase = Array.prototype.pop.call(arguments);
}
len = arguments.length;
for (index = 0; index < len; index++) {
value = arguments[index];
if (typeof value === 'object') {
for (i in value) {
obj[lowerCase ? i.toLowerCase() : i] = value[i];
}
}
}
return obj;
},
_getKeys = (typeof Object.keys == 'function') ?
function(object){
if (!object) {
return [];
}
return Object.keys(object);
} :
function(object) {
var keys = [],
property;
for (property in object) {
if (object.hasOwnProperty(property)) {
keys.push(property);
}
}
return keys;
},
/*
* The Boot loader class manages Request objects that contain one or
* more individual urls that need to be loaded. Requests can be performed
* synchronously or asynchronously, but will always evaluate urls in the
* order specified on the request object.
*/
Boot = {
loading: 0,
loaded: 0,
apply: _apply,
env: _environment,
config: _config,
/**
* @cfg {Object} assetConfig
* A map (url->assetConfig) that contains information about assets loaded by the Microlaoder.
*/
assetConfig: _assetConfig,
// Keyed by absolute URL this object holds "true" if that URL is already loaded
// or an array of callbacks to call once it loads.
scripts: {
/*
Entry objects
'http://foo.com/bar/baz/Thing.js': {
done: true,
el: scriptEl || linkEl,
preserve: true,
requests: [ request1, ... ]
}
*/
},
/**
* contains the current script name being loaded
* (loadSync or sequential load only)
*/
currentFile: null,
suspendedQueue: [],
currentRequest: null,
// when loadSync is called, need to cause subsequent load requests to also be loadSync,
// eg, when Ext.require(...) is called
syncMode: false,
/*
* simple helper method for debugging
*/
//<debug>
debug: _debug,
//</debug>
/**
* enables / disables loading scripts via script / link elements rather
* than using ajax / eval
*/
useElements: true,
listeners: [],
Request: Request,
Entry: Entry,
allowMultipleBrowsers: false,
browserNames: {
ie: 'IE',
firefox: 'Firefox',
safari: 'Safari',
chrome: 'Chrome',
opera: 'Opera',
dolfin: 'Dolfin',
edge: 'Edge',
webosbrowser: 'webOSBrowser',
chromeMobile: 'ChromeMobile',
chromeiOS: 'ChromeiOS',
silk: 'Silk',
other: 'Other'
},
osNames: {
ios: 'iOS',
android: 'Android',
windowsPhone: 'WindowsPhone',
webos: 'webOS',
blackberry: 'BlackBerry',
rimTablet: 'RIMTablet',
mac: 'MacOS',
win: 'Windows',
tizen: 'Tizen',
linux: 'Linux',
bada: 'Bada',
chromeOS: 'ChromeOS',
other: 'Other'
},
browserPrefixes: {
ie: 'MSIE ',
edge: 'Edge/',
firefox: 'Firefox/',
chrome: 'Chrome/',
safari: 'Version/',
opera: 'OPR/',
dolfin: 'Dolfin/',
webosbrowser: 'wOSBrowser/',
chromeMobile: 'CrMo/',
chromeiOS: 'CriOS/',
silk: 'Silk/'
},
// When a UA reports multiple browsers this list is used to prioritize the 'real' browser
// lower index number will win
browserPriority: [
'edge',
'opera',
'dolfin',
'webosbrowser',
'silk',
'chromeiOS',
'chromeMobile',
'ie',
'firefox',
'safari',
'chrome'
],
osPrefixes: {
tizen: '(Tizen )',
ios: 'i(?:Pad|Phone|Pod)(?:.*)CPU(?: iPhone)? OS ',
android: '(Android |HTC_|Silk/)', // Some HTC devices ship with an OSX userAgent by default,
// so we need to add a direct check for HTC_
windowsPhone: 'Windows Phone ',
blackberry: '(?:BlackBerry|BB)(?:.*)Version\/',
rimTablet: 'RIM Tablet OS ',
webos: '(?:webOS|hpwOS)\/',
bada: 'Bada\/',
chromeOS: 'CrOS '
},
fallbackOSPrefixes: {
windows: 'win',
mac: 'mac',
linux: 'linux'
},
devicePrefixes: {
iPhone: 'iPhone',
iPod: 'iPod',
iPad: 'iPad'
},
maxIEVersion: 12,
/**
* The default function that detects various platforms and sets tags
* in the platform map accordingly. Examples are iOS, android, tablet, etc.
* @param tags the set of tags to populate
*/
detectPlatformTags: function () {
var me = this,
ua = navigator.userAgent,
isMobile = /Mobile(\/|\s)/.test(ua),
element = document.createElement('div'),
isEventSupported = function (name, tag) {
if (tag === undefined) {
tag = window;
}
var eventName = 'on' + name.toLowerCase(),
isSupported = (eventName in element);
if (!isSupported) {
if (element.setAttribute && element.removeAttribute) {
element.setAttribute(eventName, '');
isSupported = typeof element[eventName] === 'function';
if (typeof element[eventName] !== 'undefined') {
element[eventName] = undefined;
}
element.removeAttribute(eventName);
}
}
return isSupported;
},
// Browser Detection
getBrowsers = function () {
var browsers = {},
maxIEVersion, prefix,
value, key, index, len, match, version, matched;
// MS Edge browser (and possibly others) can report multiple browsers in the UserAgent
// "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
// we use this to prioritize the actual browser in this situation
len = me.browserPriority.length;
for (index = 0; index < len; index++) {
key = me.browserPriority[index];
if (!matched) {
value = me.browserPrefixes[key];
match = ua.match(new RegExp('(' + value + ')([\\w\\._]+)'));
version = match && match.length > 1 ? parseInt(match[2]) : 0;
if (version) {
matched = true;
}
} else {
version = 0;
}
browsers[key] = version;
}
//Deal with IE document mode
if (browsers.ie) {
var mode = document.documentMode;
if (mode >= 8) {
browsers.ie = mode;
}
}
// Fancy IE greater than and less then quick tags
version = browsers.ie || false;
maxIEVersion = Math.max(version, me.maxIEVersion);
for (index = 8; index <= maxIEVersion; ++index) {
prefix = 'ie' + index;
browsers[prefix + 'm'] = version ? version <= index : 0;
browsers[prefix] = version ? version === index : 0;
browsers[prefix + 'p'] = version ? version >= index : 0;
}
return browsers;
},
//OS Detection
getOperatingSystems = function () {
var systems = {},
value, key, keys, index, len, match, matched, version, activeCount;
keys = _getKeys(me.osPrefixes);
len = keys.length;
for (index = 0, activeCount = 0; index < len; index++) {
key = keys[index];
value = me.osPrefixes[key];
match = ua.match(new RegExp('(' + value + ')([^\\s;]+)'));
matched = match ? match[1] : null;
// This is here because some HTC android devices show an OSX Snow Leopard userAgent by default.
// And the Kindle Fire doesn't have any indicator of Android as the OS in its User Agent
if (matched && (matched === 'HTC_' || matched === 'Silk/')) {
version = 2.3;
} else {
version = match && match.length > 1 ? parseFloat(match[match.length - 1]) : 0;
}
if (version) {
activeCount++;
}
systems[key] = version;
}
keys = _getKeys(me.fallbackOSPrefixes);
// If no OS could be found we resort to the fallbacks, otherwise we just
// falsify the fallbacks
len = keys.length;
for (index = 0; index < len; index++) {
key = keys[index];
// No OS was detected from osPrefixes
if (activeCount === 0) {
value = me.fallbackOSPrefixes[key];
match = ua.toLowerCase().match(new RegExp(value));
systems[key] = match ? true : 0;
} else {
systems[key] = 0;
}
}
return systems;
},
// Device Detection
getDevices = function () {
var devices = {},
value, key, keys, index, len, match;
keys = _getKeys(me.devicePrefixes);
len = keys.length;
for (index = 0; index < len; index++) {
key = keys[index];
value = me.devicePrefixes[key];
match = ua.match(new RegExp(value));
devices[key] = match ? true : 0;
}
return devices;
},
browsers = getBrowsers(),
systems = getOperatingSystems(),
devices = getDevices(),
platformParams = Boot.loadPlatformsParam();
// We apply platformParams from the query here first to allow for forced user valued
// to be used in calculation of generated tags
_merge(_tags, browsers, systems, devices, platformParams, true);
_tags.phone = !!((_tags.iphone || _tags.ipod) ||
(!_tags.silk && (_tags.android && (_tags.android < 3 || isMobile))) ||
(_tags.blackberry && isMobile) ||
(_tags.windowsphone));
_tags.tablet = !!(!_tags.phone && (
_tags.ipad ||
_tags.android ||
_tags.silk ||
_tags.rimtablet ||
(_tags.ie10 && /; Touch/.test(ua))
));
_tags.touch =
// if the browser has touch events we can be reasonably sure the device has
// a touch screen
isEventSupported('touchend') ||
// browsers that use pointer event have maxTouchPoints > 0 if the
// device supports touch input
// http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints
navigator.maxTouchPoints ||
// IE10 uses a vendor-prefixed maxTouchPoints property
navigator.msMaxTouchPoints;
_tags.desktop = !_tags.phone && !_tags.tablet;
_tags.cordova = _tags.phonegap = !!(window.PhoneGap || window.Cordova || window.cordova);
_tags.webview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)(?!.*FBAN)/i.test(ua);
_tags.androidstock = (_tags.android <= 4.3) && (_tags.safari || _tags.silk);
// Re-apply any query params here to allow for user override of generated tags (desktop, touch, tablet, etc)
_merge(_tags, platformParams, true);
},
/**
* Extracts user supplied platform tags from the "platformTags" query parameter
* of the form:
*
* ?platformTags=name:state,name:state,...
*
* (each tag defaults to true when state is unspecified)
*
* Example:
*
* ?platformTags=isTablet,isPhone:false,isDesktop:0,iOS:1,Safari:true, ...
*
* @returns {Object} the platform tags supplied by the query string
*/
loadPlatformsParam: function () {
// Check if the ?platform parameter is set in the URL
var paramsString = window.location.search.substr(1),
paramsArray = paramsString.split("&"),
params = {}, i,
platforms = {},
tmpArray, tmplen, platform, name, enabled;
for (i = 0; i < paramsArray.length; i++) {
tmpArray = paramsArray[i].split("=");
params[tmpArray[0]] = tmpArray[1];
}
if (params.platformTags) {
tmpArray = params.platformTags.split(",");
for (tmplen = tmpArray.length, i = 0; i < tmplen; i++) {
platform = tmpArray[i].split(":");
name = platform[0];
enabled=true;
if (platform.length > 1) {
enabled = platform[1];
if (enabled === 'false' || enabled === '0') {
enabled = false;
}
}
platforms[name] = enabled;
}
}
return platforms;
},
filterPlatform: function (platform, excludes) {
platform = _emptyArray.concat(platform || _emptyArray);
excludes = _emptyArray.concat(excludes || _emptyArray);
var plen = platform.length,
elen = excludes.length,
include = (!plen && elen), // default true if only excludes specified
i, tag;
for (i = 0; i < plen && !include; i++) {
tag = platform[i];
include = !!_tags[tag];
}
for (i = 0; i < elen && include; i++) {
tag = excludes[i];
include = !_tags[tag];
}
return include;
},
init: function () {
var scriptEls = doc.getElementsByTagName('script'),
script = scriptEls[0],
len = scriptEls.length,
re = /\/ext(\-[a-z\-]+)?\.js$/,
entry, src, state, baseUrl, key, n, origin;
// No check for script definedness because there always should be at least one
Boot.hasReadyState = ("readyState" in script);
Boot.hasAsync = ("async" in script);
Boot.hasDefer = ("defer" in script);
Boot.hasOnLoad = ("onload" in script);
// Feature detecting IE
Boot.isIE8 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && !Boot.hasOnLoad;
Boot.isIE9 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
Boot.isIE10p = Boot.hasReadyState && Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
Boot.isIE10 = (new Function('/*@cc_on return @_jscript_version @*/')()) === 10;
Boot.isIE10m = Boot.isIE10 || Boot.isIE9 || Boot.isIE8;
// IE11 does not support conditional compilation so we detect it by exclusion
Boot.isIE11 = Boot.isIE10p && !Boot.isIE10;
// Since we are loading after other scripts, and we needed to gather them
// anyway, we track them in _scripts so we don't have to ask for them all
// repeatedly.
for (n = 0; n < len; n++) {
src = (script = scriptEls[n]).src;
if (!src) {
continue;
}
state = script.readyState || null;
// If we find a script file called "ext-*.js", then the base path is that file's base path.
if (!baseUrl && re.test(src)) {
baseUrl = src;
}
if (!Boot.scripts[key = Boot.canonicalUrl(src)]) {
//<debug>
// _debug("creating entry " + key + " in Boot.init");
//</debug>
entry = new Entry({
key: key,
url: src,
done: state === null || // non-IE
state === 'loaded' || state === 'complete', // IE only
el: script,
prop: 'src'
});
}
}
if (!baseUrl) {
script = scriptEls[scriptEls.length - 1];
baseUrl = script.src;
}
Boot.baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1);
origin = window.location.origin ||
window.location.protocol +
"//" +
window.location.hostname +
(window.location.port ? ':' + window.location.port: '');
Boot.origin = origin;
Boot.detectPlatformTags();
Ext.filterPlatform = Boot.filterPlatform;
},
/**
* This method returns a canonical URL for the given URL.
*
* For example, the following all produce the same canonical URL (which is the
* last one):
*
* http://foo.com/bar/baz/zoo/derp/../../goo/Thing.js?_dc=12345
* http://foo.com/bar/baz/zoo/derp/../../goo/Thing.js
* http://foo.com/bar/baz/zoo/derp/../jazz/../../goo/Thing.js
* http://foo.com/bar/baz/zoo/../goo/Thing.js
* http://foo.com/bar/baz/goo/Thing.js
*
* @private
*/
canonicalUrl: function (url) {
// *WARNING WARNING WARNING*
// This method yields the most correct result we can get but it is EXPENSIVE!
// In ALL browsers! When called multiple times in a sequence, as if when
// we resolve dependencies for entries, it will cause garbage collection events
// and overall painful slowness. This is why we try to avoid it as much as we can.
//
// @TODO - see if we need this fallback logic
// http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue
resolverEl.href = url;
var ret = resolverEl.href,
dc = _config.disableCachingParam,
pos = dc ? ret.indexOf(dc + '=') : -1,
c, end;
// If we have a _dc query parameter we need to remove it from the canonical
// URL.
if (pos > 0 && ((c = ret.charAt(pos - 1)) === '?' || c === '&')) {
end = ret.indexOf('&', pos);
end = (end < 0) ? '' : ret.substring(end);
if (end && c === '?') {
++pos; // keep the '?'
end = end.substring(1); // remove the '&'
}
ret = ret.substring(0, pos - 1) + end;
}
return ret;
},
/**
* Get the config value corresponding to the specified name. If no name is given, will return the config object
* @param {String} name The config property name
* @return {Object}
*/
getConfig: function (name) {
return name ? Boot.config[name] : Boot.config;
},
/**
* Set the configuration.
* @param {Object} config The config object to override the default values.
* @return {Ext.Boot} this
*/
setConfig: function (name, value) {
if (typeof name === 'string') {
Boot.config[name] = value;
} else {
for (var s in name) {
Boot.setConfig(s, name[s]);
}
}
return Boot;
},
getHead: function () {
return Boot.docHead ||
(Boot.docHead = doc.head ||
doc.getElementsByTagName('head')[0]);
},
create: function (url, key, cfg) {
var config = cfg || {};
config.url = url;
config.key = key;
return Boot.scripts[key] = new Entry(config);
},
getEntry: function (url, cfg, canonicalPath) {
var key, entry;
// Canonicalizing URLs via anchor element href yields the most correct result
// but is *extremely* resource heavy so we need to avoid it whenever possible
key = canonicalPath ? url : Boot.canonicalUrl(url);
entry = Boot.scripts[key];
if (!entry) {
entry = Boot.create(url, key, cfg);
if (canonicalPath) {
entry.canonicalPath = true;
}
}
return entry;
},
registerContent: function (url, type, content) {
var cfg = {
content: content,
loaded: true,
css: type === 'css'
};
return Boot.getEntry(url, cfg);
},
processRequest: function(request, sync) {
request.loadEntries(sync);
},
load: function (request) {
//<debug>
// _debug("Boot.load called");
//</debug>
var request = new Request(request);
if (request.sync || Boot.syncMode) {
return Boot.loadSync(request);
}
// If there is a request in progress, we must
// queue this new request to be fired when the current request completes.
if (Boot.currentRequest) {
//<debug>
// _debug("current active request, suspending this request");
//</debug>
// trigger assignment of entries now to ensure that overlapping
// entries with currently running requests will synchronize state
// with this pending one as they complete
request.getEntries();
Boot.suspendedQueue.push(request);
} else {
Boot.currentRequest = request;
Boot.processRequest(request, false);
}
return Boot;
},
loadSync: function (request) {
//<debug>
// _debug("Boot.loadSync called");
//</debug>
var request = new Request(request);
Boot.syncMode++;
Boot.processRequest(request, true);
Boot.syncMode--;
return Boot;
},
loadBasePrefix: function(request) {
request = new Request(request);
request.prependBaseUrl = true;
return Boot.load(request);
},
loadSyncBasePrefix: function(request) {
request = new Request(request);
request.prependBaseUrl = true;
return Boot.loadSync(request);
},
requestComplete: function(request) {
var next;
if (Boot.currentRequest === request) {
Boot.currentRequest = null;
while(Boot.suspendedQueue.length > 0) {
next = Boot.suspendedQueue.shift();
if(!next.done) {
//<debug>
// _debug("resuming suspended request");
//</debug>
Boot.load(next);
break;
}
}
}
if (!Boot.currentRequest && Boot.suspendedQueue.length == 0) {
Boot.fireListeners();
}
},
isLoading: function () {
return !Boot.currentRequest && Boot.suspendedQueue.length == 0;
},
fireListeners: function () {
var listener;
while (Boot.isLoading() && (listener = Boot.listeners.shift())) {
listener();
}
},
onBootReady: function (listener) {
if (!Boot.isLoading()) {
listener();
} else {
Boot.listeners.push(listener);
}
},
/**
* this is a helper function used by Ext.Loader to flush out
* 'uses' arrays for classes in some Ext versions
*/
getPathsFromIndexes: function (indexMap, loadOrder) {
// In older versions indexMap was an object instead of a sparse array
if (!('length' in indexMap)) {
var indexArray = [],
index;
for (index in indexMap) {
if (!isNaN(+index)) {
indexArray[+index] = indexMap[index];
}
}
indexMap = indexArray;
}
return Request.prototype.getPathsFromIndexes(indexMap, loadOrder);
},
createLoadOrderMap: function(loadOrder) {
return Request.prototype.createLoadOrderMap(loadOrder);
},
fetch: function(url, complete, scope, async) {
async = (async === undefined) ? !!complete : async;
var xhr = new XMLHttpRequest(),
result, status, content, exception = false,
readyStateChange = function () {
if (xhr && xhr.readyState == 4) {
status = (xhr.status === 1223) ? 204 :
(xhr.status === 0 && ((self.location || {}).protocol === 'file:' ||
(self.location || {}).protocol === 'ionp:')) ? 200 : xhr.status;
content = xhr.responseText;
result = {
content: content,
status: status,
exception: exception
};
if (complete) {
complete.call(scope, result);
}
xhr.onreadystatechange = emptyFn;
xhr = null;
}
};
if (async) {
xhr.onreadystatechange = readyStateChange;
}
try {
//<debug>
// _debug("fetching " + url + " " + (async ? "async" : "sync"));
//</debug>
xhr.open('GET', url, async);
xhr.send(null);
} catch (err) {
exception = err;
readyStateChange();
return result;
}
if (!async) {
readyStateChange();
}
return result;
},
notifyAll: function(entry) {
entry.notifyRequests();
}
};
function Request(cfg) {
//The request class encapsulates a series of Entry objects
//and provides notification around the completion of all Entries
//in this request.
if(cfg.$isRequest) {
return cfg;
}
var cfg = cfg.url ? cfg : {url: cfg},
url = cfg.url,
urls = url.charAt ? [ url ] : url,
charset = cfg.charset || Boot.config.charset;
_apply(this, cfg);
delete this.url;
this.urls = urls;
this.charset = charset;
};
Request.prototype = {
$isRequest: true,
createLoadOrderMap: function (loadOrder) {
var len = loadOrder.length,
loadOrderMap = {},
i, element;
for (i = 0; i < len; i++) {
element = loadOrder[i];
loadOrderMap[element.path] = element;
}
return loadOrderMap;
},
getLoadIndexes: function (item, indexMap, loadOrder, includeUses, skipLoaded) {
var resolved = [],
queue = [item],
itemIndex = item.idx,
queue, entry, dependencies, depIndex, i, len;
if (indexMap[itemIndex]) {
// prevent cycles
return resolved;
}
// Both indexMap and resolved are sparse arrays keyed by indexes.
// This gives us a naturally sorted sequence of indexes later on
// when we need to convert them to paths.
// indexMap is the map of all indexes we have visited at least once
// per the current expandUrls() invocation, and resolved is the map
// of all dependencies for the current item that are not included
// in indexMap.
indexMap[itemIndex] = resolved[itemIndex] = true;
while (item = queue.shift()) {
// Canonicalizing URLs is expensive, we try to avoid it
if (item.canonicalPath) {
entry = Boot.getEntry(item.path, null, true);
}
else {
entry = Boot.getEntry(this.prepareUrl(item.path));
}
if (!(skipLoaded && entry.done)) {
if (includeUses && item.uses && item.uses.length) {
dependencies = item.requires.concat(item.uses);
}
else {
dependencies = item.requires;
}
for (i = 0, len = dependencies.length; i < len; i++) {
depIndex = dependencies[i];
if (!indexMap[depIndex]) {
indexMap[depIndex] = resolved[depIndex] = true;
queue.push(loadOrder[depIndex]);
}
}
}
}
return resolved;
},
getPathsFromIndexes: function (indexes, loadOrder) {
var paths = [],
index, len;
// indexes is a sparse array with values being true for defined indexes
for (index = 0, len = indexes.length; index < len; index++) {
if (indexes[index]) {
paths.push(loadOrder[index].path);
}
}
return paths;
},
expandUrl: function (url, loadOrder, loadOrderMap, indexMap, includeUses, skipLoaded) {
var item, resolved;
if (loadOrder) {
item = loadOrderMap[url];
if (item) {
resolved = this.getLoadIndexes(item, indexMap, loadOrder, includeUses, skipLoaded);
if (resolved.length) {
return this.getPathsFromIndexes(resolved, loadOrder);
}
}
}
return [url];
},
expandUrls: function (urls, includeUses) {
var me = this,
loadOrder = me.loadOrder,
expanded = [],
expandMap = {},
indexMap = [],
loadOrderMap, tmpExpanded, i, len, t, tlen, tUrl;
if (typeof urls === "string") {
urls = [urls];
}
if (loadOrder) {
loadOrderMap = me.loadOrderMap;
if (!loadOrderMap) {
loadOrderMap = me.loadOrderMap = me.createLoadOrderMap(loadOrder);
}
}
for (i = 0, len = urls.length; i < len; i++) {
// We don't want to skip loaded entries (last argument === false).
// There are some overrides that get loaded before their respective classes,
// and when the class dependencies are processed we don't want to skip over
// the overrides' dependencies just because they were loaded first.
tmpExpanded = this.expandUrl(urls[i], loadOrder, loadOrderMap, indexMap, includeUses, false);
for (t = 0, tlen = tmpExpanded.length; t < tlen; t++) {
tUrl = tmpExpanded[t];
if (!expandMap[tUrl]) {
expandMap[tUrl] = true;
expanded.push(tUrl);
}
}
}
if (expanded.length === 0) {
expanded = urls;
}
return expanded;
},
expandLoadOrder: function () {
var me = this,
urls = me.urls,
expanded;
if (!me.expanded) {
expanded = this.expandUrls(urls, true);
me.expanded = true;
} else {
expanded = urls;
}
me.urls = expanded;
// if we added some urls to the request to honor the indicated
// load order, the request needs to be sequential
if (urls.length != expanded.length) {
me.sequential = true;
}
return me;
},
getUrls: function () {
this.expandLoadOrder();
return this.urls;
},
prepareUrl: function(url) {
if(this.prependBaseUrl) {
return Boot.baseUrl + url;
}
return url;
},
getEntries: function () {
var me = this,
entries = me.entries,
loadOrderMap, item, i, entry, urls, url;
if (!entries) {
entries = [];
urls = me.getUrls();
// If we have loadOrder array then the map will be expanded by now
if (me.loadOrder) {
loadOrderMap = me.loadOrderMap;
}
for (i = 0; i < urls.length; i++) {
url = me.prepareUrl(urls[i]);
if (loadOrderMap) {
item = loadOrderMap[url];
}
entry = Boot.getEntry(url, {
buster: me.buster,
charset: me.charset
}, item && item.canonicalPath);
entry.requests.push(me);
entries.push(entry);
}
me.entries = entries;
}
return entries;
},
loadEntries: function(sync) {
var me = this,
entries = me.getEntries(),
len = entries.length,
start = me.loadStart || 0,
continueLoad, entries, entry, i;
if(sync !== undefined) {
me.sync = sync;
}
me.loaded = me.loaded || 0;
me.loading = me.loading || len;
for(i = start; i < len; i++) {
entry = entries[i];
if(!entry.loaded) {
continueLoad = entries[i].load(me.sync);
} else {
continueLoad = true;
}
if(!continueLoad) {
me.loadStart = i;
entry.onDone(function(){
me.loadEntries(sync);
});
break;
}
}
me.processLoadedEntries();
},
processLoadedEntries: function () {
var me = this,
entries = me.getEntries(),
len = entries.length,
start = me.startIndex || 0,
i, entry;
if (!me.done) {
for (i = start; i < len; i++) {
entry = entries[i];
if (!entry.loaded) {
me.startIndex = i;
return;
}
if (!entry.evaluated) {
entry.evaluate();
}
if (entry.error) {
me.error = true;
}
}
me.notify();
}
},
notify: function () {
var me = this;
if (!me.done) {
var error = me.error,
fn = me[error ? 'failure' : 'success'],
delay = ('delay' in me)
? me.delay
: (error ? 1 : Boot.config.chainDelay),
scope = me.scope || me;
me.done = true;
if (fn) {
if (delay === 0 || delay > 0) {
// Free the stack (and defer the next script)
setTimeout(function () {
fn.call(scope, me);
}, delay);
} else {
fn.call(scope, me);
}
}
me.fireListeners();
Boot.requestComplete(me);
}
},
onDone: function(listener) {
var me = this,
listeners = me.listeners || (me.listeners = []);
if(me.done) {
listener(me);
} else {
listeners.push(listener);
}
},
fireListeners: function() {
var listeners = this.listeners,
listener;
if(listeners) {
//<debug>
// _debug("firing request listeners");
//</debug>
while((listener = listeners.shift())) {
listener(this);
}
}
}
};
function Entry(cfg) {
//The Entry class is a token to manage the load and evaluation
//state of a particular url. It is used to notify all Requests
//interested in this url that the content is available.
if(cfg.$isEntry) {
return cfg;
}
//<debug>
// _debug("creating entry for " + cfg.url);
//</debug>
var charset = cfg.charset || Boot.config.charset,
manifest = Ext.manifest,
loader = manifest && manifest.loader,
cache = (cfg.cache !== undefined) ? cfg.cache : (loader && loader.cache),
buster, busterParam;
if (Boot.config.disableCaching) {
if (cache === undefined) {
cache = !Boot.config.disableCaching;
}
if (cache === false) {
buster = +new Date();
} else if (cache !== true) {
buster = cache;
}
if (buster) {
busterParam = (loader && loader.cacheParam) || Boot.config.disableCachingParam;
buster = busterParam + "=" + buster;
}
}
_apply(this, cfg);
this.charset = charset;
this.buster = buster;
this.requests = [];
};
Entry.prototype = {
$isEntry: true,
done: false,
evaluated: false,
loaded: false,
isCrossDomain: function() {
var me = this;
if(me.crossDomain === undefined) {
//<debug>
// _debug("checking " + me.getLoadUrl() + " for prefix " + Boot.origin);
//</debug>
me.crossDomain = (me.getLoadUrl().indexOf(Boot.origin) !== 0);
}
return me.crossDomain;
},
isCss: function () {
var me = this;
if (me.css === undefined) {
if (me.url) {
var assetConfig = Boot.assetConfig[me.url];
me.css = assetConfig ? assetConfig.type === "css" : cssRe.test(me.url);
} else {
me.css = false;
}
}
return this.css;
},
getElement: function (tag) {
var me = this,
el = me.el;
if (!el) {
//<debug>
// _debug("creating element for " + me.url);
//</debug>
if (me.isCss()) {
tag = tag || "link";
el = doc.createElement(tag);
if(tag == "link") {
el.rel = 'stylesheet';
me.prop = 'href';
} else {
me.prop="textContent";
}
el.type = "text/css";
} else {
tag = tag || "script";
el = doc.createElement(tag);
el.type = 'text/javascript';
me.prop = 'src';
if (me.charset) {
el.charset = me.charset;
}
if (Boot.hasAsync) {
el.async = false;
}
}
me.el = el;
}
return el;
},
getLoadUrl: function () {
var me = this,
url;
url = me.canonicalPath ? me.url : Boot.canonicalUrl(me.url);
if (!me.loadUrl) {
me.loadUrl = !!me.buster
? (url + (url.indexOf('?') === -1 ? '?' : '&') + me.buster)
: url;
}
return me.loadUrl;
},
fetch: function (req) {
var url = this.getLoadUrl(),
async = !!req.async,
complete = req.complete;
Boot.fetch(url, complete, this, async);
},
onContentLoaded: function (response) {
var me = this,
status = response.status,
content = response.content,
exception = response.exception,
url = this.getLoadUrl();
me.loaded = true;
if ((exception || status === 0) && !_environment.phantom) {
me.error =
//<debug>
("Failed loading synchronously via XHR: '" + url +
"'. It's likely that the file is either being loaded from a " +
"different domain or from the local file system where cross " +
"origin requests are not allowed for security reasons. Try " +
"asynchronous loading instead.") ||
//</debug>
true;
me.evaluated = true;
}
else if ((status >= 200 && status < 300) || status === 304
|| _environment.phantom
|| (status === 0 && content.length > 0)
) {
me.content = content;
}
else {
me.error =
//<debug>
("Failed loading synchronously via XHR: '" + url +
"'. Please verify that the file exists. XHR status code: " +
status) ||
//</debug>
true;
me.evaluated = true;
}
},
createLoadElement: function(callback) {
var me = this,
el = me.getElement();
me.preserve = true;
el.onerror = function() {
me.error = true;
if (callback) {
callback();
callback = null;
}
};
if (Boot.isIE10m) {
el.onreadystatechange = function() {
if (this.readyState === 'loaded' || this.readyState === 'complete') {
if (callback) {
callback();
callback = this.onreadystatechange = this.onerror = null;
}
}
};
}
else {
el.onload = function() {
callback();
callback = this.onload = this.onerror = null;
};
}
// IE starts loading here
el[me.prop] = me.getLoadUrl();
},
onLoadElementReady: function() {
Boot.getHead().appendChild(this.getElement());
this.evaluated = true;
},
inject: function (content, asset) {
//<debug>
// _debug("injecting content for " + this.url);
//</debug>
var me = this,
head = Boot.getHead(),
url = me.url,
key = me.key,
base, el, ieMode, basePath;
if (me.isCss()) {
me.preserve = true;
basePath = key.substring(0, key.lastIndexOf("/") + 1);
base = doc.createElement('base');
base.href = basePath;
if(head.firstChild) {
head.insertBefore(base, head.firstChild);
} else {
head.appendChild(base);
}
// reset the href attribute to cuase IE to pick up the change
base.href = base.href;
if (url) {
content += "\n/*# sourceURL=" + key + " */";
}
// create element after setting base
el = me.getElement("style");
ieMode = ('styleSheet' in el);
head.appendChild(base);
if(ieMode) {
head.appendChild(el);
el.styleSheet.cssText = content;
} else {
el.textContent = content;
head.appendChild(el);
}
head.removeChild(base);
} else {
// Debugger friendly, file names are still shown even though they're
// eval'ed code. Breakpoints work on both Firebug and Chrome's Web
// Inspector.
if (url) {
content += "\n//# sourceURL=" + key;
}
Ext.globalEval(content);
}
return me;
},
loadCrossDomain: function() {
var me = this,
complete = function(){
me.el.onerror = me.el.onload = emptyFn;
me.el = null;
me.loaded = me.evaluated = me.done = true;
me.notifyRequests();
};
me.createLoadElement(function(){
complete();
});
me.evaluateLoadElement();
// at this point, we need sequential evaluation,
// which means we can't advance the load until
// this entry has fully completed
return false;
},
loadElement: function() {
var me = this,
complete = function(){
me.el.onerror = me.el.onload = emptyFn;
me.el = null;
me.loaded = me.evaluated = me.done = true;
me.notifyRequests();
};
me.createLoadElement(function(){
complete();
});
me.evaluateLoadElement();
return true;
},
loadSync: function() {
var me = this;
me.fetch({
async: false,
complete: function (response) {
me.onContentLoaded(response);
}
});
me.evaluate();
me.notifyRequests();
},
load: function (sync) {
var me = this;
if (!me.loaded) {
if(me.loading) {
// if we're calling back through load and we're loading but haven't
// yet loaded, then we should be in a sequential, cross domain
// load scenario which means we can't continue the load on the
// request until this entry has fully evaluated, which will mean
// loaded = evaluated = done = true in one step. For css files, this
// will happen immediately upon <link> element creation / insertion,
// but <script> elements will set this upon load notification
return false;
}
me.loading = true;
// for async modes, we have some options
if (!sync) {
// if cross domain, just inject the script tag and let the onload
// events drive the progression.
// IE10 also needs sequential loading because of a bug that makes it
// fire readystate event prematurely:
// https://connect.microsoft.com/IE/feedback/details/729164/ie10-dynamic-script-element-fires-loaded-readystate-prematurely
if (Boot.isIE10 || me.isCrossDomain()) {
return me.loadCrossDomain();
}
// for IE, use the readyStateChange allows us to load scripts in parallel
// but serialize the evaluation by appending the script node to the
// document
else if(!me.isCss() && Boot.hasReadyState) {
me.createLoadElement(function () {
me.loaded = true;
me.notifyRequests();
});
}
else if(Boot.useElements &&
// older webkit, phantomjs included, won't fire load for link elements
!(me.isCss() && _environment.phantom)) {
return me.loadElement();
}
// for other browsers, just ajax the content down in parallel, and use
// globalEval to serialize evaluation
else {
me.fetch({
async: !sync,
complete: function (response) {
me.onContentLoaded(response);
me.notifyRequests();
}
});
}
}
// for sync mode in js, global eval FTW. IE won't honor the comment
// paths in the debugger, so eventually we need a sync mode for IE that
// uses the readyStateChange mechanism
else {
me.loadSync();
}
}
// signal that the load process can continue
return true;
},
evaluateContent: function () {
this.inject(this.content);
this.content = null;
},
evaluateLoadElement: function() {
Boot.getHead().appendChild(this.getElement());
},
evaluate: function () {
var me = this;
if(!me.evaluated) {
if(me.evaluating) {
return;
}
me.evaluating = true;
if(me.content !== undefined) {
me.evaluateContent();
} else if(!me.error) {
me.evaluateLoadElement();
}
me.evaluated = me.done = true;
me.cleanup();
}
},
cleanup: function () {
var me = this,
el = me.el,
prop;
if (!el) {
return;
}
if (!me.preserve) {
me.el = null;
el.parentNode.removeChild(el); // Remove, since its useless now
for (prop in el) {
try {
if (prop !== me.prop) {
// If we set the src property to null IE
// will try and request a script at './null'
el[prop] = null;
}
delete el[prop]; // and prepare for GC
} catch (cleanEx) {
//ignore
}
}
}
// Setting to null can cause exceptions if IE ever needs to call these
// again (like onreadystatechange). This emptyFn has nothing locked in
// closure scope so it is about as safe as null for memory leaks.
el.onload = el.onerror = el.onreadystatechange = emptyFn;
},
notifyRequests: function () {
var requests = this.requests,
len = requests.length,
i, request;
for (i = 0; i < len; i++) {
request = requests[i];
request.processLoadedEntries();
}
if(this.done) {
this.fireListeners();
}
},
onDone: function(listener) {
var me = this,
listeners = me.listeners || (me.listeners = []);
if(me.done) {
listener(me);
} else {
listeners.push(listener);
}
},
fireListeners: function() {
var listeners = this.listeners,
listener;
if(listeners && listeners.length > 0) {
//<debug>
// _debug("firing event listeners for url " + this.url);
//</debug>
while((listener = listeners.shift())) {
listener(this);
}
}
}
};
/**
* Turns on or off the "cache buster" applied to dynamically loaded scripts. Normally
* dynamically loaded scripts have an extra query parameter appended to avoid stale
* cached scripts. This method can be used to disable this mechanism, and is primarily
* useful for testing. This is done using a cookie.
* @param {Boolean} disable True to disable the cache buster.
* @param {String} [path="/"] An optional path to scope the cookie.
*/
Ext.disableCacheBuster = function (disable, path) {
var date = new Date();
date.setTime(date.getTime() + (disable ? 10 * 365 : -1) * 24 * 60 * 60 * 1000);
date = date.toGMTString();
doc.cookie = 'ext-cache=1; expires=' + date + '; path=' + (path || '/');
};
//<if nonBrowser>
if (_environment.node) {
Boot.prototype.load = Boot.prototype.loadSync = function (request) {
// @TODO
require(filePath);
onLoad.call(scope);
};
Boot.prototype.init = emptyFn;
}
//</if>
Boot.init();
return Boot;
// NOTE: We run the eval at global scope to protect the body of the function and allow
// compressors to still process it.
}(function () {
}));//(eval("/*@cc_on!@*/!1"));
/**
* This method evaluates the given code free of any local variable. This
* will be at global scope, in others it will be in a function.
* @param {String} code The code to evaluate.
* @private
* @method
* @member Ext
*/
Ext.globalEval = Ext.globalEval || (this.execScript
? function (code) { execScript(code); }
: function ($$code) { eval.call(window, $$code); });
//<feature legacyBrowser>
/*
* Only IE8 & IE/Quirks lack Function.prototype.bind so we polyfill that here.
*/
if (!Function.prototype.bind) {
(function () {
var slice = Array.prototype.slice,
// To reduce overhead on call of the bound fn we have two flavors based on
// whether we have args to prepend or not:
bind = function (me) {
var args = slice.call(arguments, 1),
method = this;
if (args.length) {
return function () {
var t = arguments;
// avoid the slice/concat if the caller does not supply args
return method.apply(me, t.length ? args.concat(slice.call(t)) : args);
};
}
// this is the majority use case - just fn.bind(this) and no args
args = null;
return function () {
return method.apply(me, arguments);
};
};
Function.prototype.bind = bind;
bind.$extjs = true; // to detect this polyfill if one want to improve it
}());
}
//</feature>
//</editor-fold>
Ext.setResourcePath = function (poolName, path) {
var manifest = Ext.manifest || (Ext.manifest = {}),
paths = manifest.resources || (manifest.resources = {});
if (manifest) {
if (typeof poolName !== 'string') {
Ext.apply(paths, poolName);
} else {
paths[poolName] = path;
}
manifest.resources = paths;
}
};
Ext.getResourcePath = function (path, poolName, packageName) {
if (typeof path !== 'string') {
poolName = path.pool;
packageName = path.packageName;
path = path.path;
}
var manifest = Ext.manifest,
paths = manifest && manifest.resources,
poolPath = paths[poolName],
output = [];
if (poolPath == null) {
poolPath = paths.path;
if (poolPath == null) {
poolPath = 'resources';
}
}
if (poolPath) {
output.push(poolPath);
}
if (packageName) {
output.push(packageName);
}
output.push(path);
return output.join('/');
}; | {
"pile_set_name": "Github"
} |
#!/bin/sh
GitRoot=$(git rev-parse --show-toplevel)
GitCommitMessageHookPath="$GitRoot/.git/hooks/commit-msg"
NewCommitMessageHookFile="/hooks/commit-msg"
NewCommitMessageHookPath="$GitRoot/tools/$NewCommitMessageHookFile"
if [ ! -e $NewCommitMessageHookPath ]; then
echo "Something's gone wrong, I can't find $NewCommitMessageHookPath"
exit 1
fi
echo "Installing Git commit-msg hook..."
if [ -e $GitCommitMessageHookPath ]; then
BackedUpCommitMessageHook="$GitCommitMessageHookPath.previous"
echo "You already have a Git commit-msg hook installed."
echo "Backing it up as $BackedUpCommitMessageHook"
if [ -e $BackedUpCommitMessageHook ]; then
rm $BackedUpCommitMessageHook
fi
mv $GitCommitMessageHookPath $BackedUpCommitMessageHook
fi
cp $NewCommitMessageHookPath $GitCommitMessageHookPath
echo "Done."
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>H+已不再支持老旧的IE</title>
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="description" content="">
<meta name="keywords" content="">
<style>
html,
body {
height: 100%;
overflow: hidden;
}
body {
background: #3cbbdc url(img/browser.png) no-repeat center center;
}
</style>
</head>
<body>
</body>
</html>
| {
"pile_set_name": "Github"
} |
package io.digdag.core.database.migrate;
import org.skife.jdbi.v2.Handle;
public class Migration_20160602123456_SessionsOnProjectIdIndexToDesc
implements Migration
{
@Override
public void migrate(Handle handle, MigrationContext context)
{
handle.update("create index sessions_on_project_id_desc on sessions (project_id, id desc)");
handle.update("drop index sessions_on_project_id");
}
}
| {
"pile_set_name": "Github"
} |
module Listen
# Allows two threads to wait on eachother.
#
# @note Only two threads can be used with this Turnstile
# because of the current implementation.
class Turnstile
# Initialize the turnstile.
#
def initialize
# Until ruby offers semahpores, only queues can be used
# to implement a turnstile.
@q = Queue.new
end
# Blocks the current thread until a signal is received.
#
def wait
@q.pop if @q.num_waiting == 0
end
# Unblocks the waiting thread if there is one.
#
def signal
@q.push :dummy if @q.num_waiting == 1
end
end
end
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PROTOBUF_H_
#define WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PROTOBUF_H_
#include "webrtc/rtc_base/ignore_wundef.h"
RTC_PUSH_IGNORING_WUNDEF()
#include "webrtc/rtc_tools/event_log_visualizer/chart.pb.h"
RTC_POP_IGNORING_WUNDEF()
#include "webrtc/rtc_tools/event_log_visualizer/plot_base.h"
namespace webrtc {
namespace plotting {
class ProtobufPlot final : public Plot {
public:
ProtobufPlot();
~ProtobufPlot() override;
void Draw() override;
void ExportProtobuf(webrtc::analytics::Chart* chart);
};
class ProtobufPlotCollection final : public PlotCollection {
public:
ProtobufPlotCollection();
~ProtobufPlotCollection() override;
void Draw() override;
Plot* AppendNewPlot() override;
void ExportProtobuf(webrtc::analytics::ChartCollection* collection);
};
} // namespace plotting
} // namespace webrtc
#endif // WEBRTC_RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PROTOBUF_H_
| {
"pile_set_name": "Github"
} |
/* -------------------------------------------------------------------------- *
* OpenSim: ExpressionBasedPointToPointForce.cpp *
* -------------------------------------------------------------------------- *
* The OpenSim API is a toolkit for musculoskeletal modeling and simulation. *
* See http://opensim.stanford.edu and the NOTICE file for more information. *
* OpenSim is developed at Stanford University and supported by the US *
* National Institutes of Health (U54 GM072970, R24 HD065690) and by DARPA *
* through the Warrior Web program. *
* *
* Copyright (c) 2005-2017 Stanford University and the Authors *
* Author(s): Ajay Seth *
* *
* 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. *
* -------------------------------------------------------------------------- */
//=============================================================================
// INCLUDES
//=============================================================================
#include "ExpressionBasedPointToPointForce.h"
#include <OpenSim/Simulation/Model/Model.h>
#include <lepton/Parser.h>
#include <lepton/ParsedExpression.h>
using namespace OpenSim;
using namespace std;
//=============================================================================
// STATICS
//=============================================================================
//=============================================================================
// CONSTRUCTOR(S) AND DESTRUCTOR
//=============================================================================
//_____________________________________________________________________________
//Default constructor.
ExpressionBasedPointToPointForce::ExpressionBasedPointToPointForce()
{
setNull();
constructProperties();
}
//_____________________________________________________________________________
// Convenience constructor for API users.
ExpressionBasedPointToPointForce::ExpressionBasedPointToPointForce(
const string& body1Name, const SimTK::Vec3& point1,
const string& body2Name, const SimTK::Vec3& point2,
const string& expression)
{
setNull();
constructProperties();
// Set properties to the passed-in values.
setBody1Name(body1Name);
setBody2Name(body2Name);
setPoint1(point1);
setPoint2(point2);
setExpression(expression);
}
// Set the expression for the force function and create it's lepton program
void ExpressionBasedPointToPointForce::setExpression(const string& expression)
{
set_expression(expression);
}
//=============================================================================
// CONSTRUCTION
//=============================================================================
//_____________________________________________________________________________
/**
* Set the data members of this force to their null values.
*/
void ExpressionBasedPointToPointForce::setNull()
{
setAuthors("Ajay Seth");
}
//_____________________________________________________________________________
/**
* Construct properties and initialize to their default values.
*/
void ExpressionBasedPointToPointForce::constructProperties()
{
constructProperty_body1();
constructProperty_body2();
const SimTK::Vec3 bodyOrigin(0.0, 0.0, 0.0);
constructProperty_point1(bodyOrigin);
constructProperty_point2(bodyOrigin);
std::string zero = "0.0";
constructProperty_expression( zero );
}
//=============================================================================
// Connect this force element to the rest of the model.
//=============================================================================
void ExpressionBasedPointToPointForce::extendConnectToModel(Model& model)
{
Super::extendConnectToModel(model); // Let base class connect first.
// Look up the two bodies being connected by bushing by name in the
// model. TODO: use Sockets
const string& body1Name = getBody1Name();
const string& body2Name = getBody2Name();
if(getModel().hasComponent(body1Name))
_body1 = &(getModel().getComponent<PhysicalFrame>(body1Name));
else
_body1 = &(getModel().getComponent<PhysicalFrame>(
"./bodyset/" + body1Name));
if (getModel().hasComponent(body2Name))
_body2 = &(getModel().getComponent<PhysicalFrame>(body2Name));
else
_body2 = &(getModel().getComponent<PhysicalFrame>(
"./bodyset/" + body2Name));
if(getName() == "")
setName("expressionP2PForce_"+body1Name+"To"+body2Name);
string& expression = upd_expression();
expression.erase(
remove_if(expression.begin(), expression.end(), ::isspace),
expression.end() );
_forceProg = Lepton::Parser::parse(expression).optimize().createProgram();
}
//=============================================================================
// Create the underlying system component(s)
//=============================================================================
void ExpressionBasedPointToPointForce::
extendAddToSystem(SimTK::MultibodySystem& system) const
{
Super::extendAddToSystem(system); // Base class first.
this->_forceMagnitudeCV = addCacheVariable("force_magnitude", 0.0, SimTK::Stage::Velocity);
// Beyond the const Component get access to underlying SimTK elements
ExpressionBasedPointToPointForce* mutableThis =
const_cast<ExpressionBasedPointToPointForce *>(this);
// Get underlying mobilized bodies
mutableThis->_b1 = _body1->getMobilizedBody();
mutableThis->_b2 = _body2->getMobilizedBody();
}
//=============================================================================
// Computing
//=============================================================================
// Compute and apply the force
void ExpressionBasedPointToPointForce::computeForce(const SimTK::State& s,
SimTK::Vector_<SimTK::SpatialVec>& bodyForces,
SimTK::Vector& generalizedForces) const
{
using namespace SimTK;
const Transform& X_GB1 = _b1->getBodyTransform(s);
const Transform& X_GB2 = _b2->getBodyTransform(s);
const Vec3 s1_G = X_GB1.R() * getPoint1();
const Vec3 s2_G = X_GB2.R() * getPoint2();
const Vec3 p1_G = X_GB1.p() + s1_G; // point measured from ground origin
const Vec3 p2_G = X_GB2.p() + s2_G;
const Vec3 r_G = p2_G - p1_G; // vector from point1 to point2
const double d = r_G.norm(); // distance between the points
const Vec3 v1_G = _b1->findStationVelocityInGround(s, getPoint1());
const Vec3 v2_G = _b2->findStationVelocityInGround(s, getPoint2());
const Vec3 vRel = v2_G - v1_G; // relative velocity
//speed along the line connecting the two bodies
const double ddot = dot(vRel, r_G)/d;
std::map<std::string, double> forceVars;
forceVars["d"] = d;
forceVars["ddot"] = ddot;
double forceMag = _forceProg.evaluate(forceVars);
setCacheVariableValue(s, _forceMagnitudeCV, forceMag);
const Vec3 f1_G = (forceMag/d) * r_G;
bodyForces[_b1->getMobilizedBodyIndex()] += SpatialVec(s1_G % f1_G, f1_G);
bodyForces[_b2->getMobilizedBodyIndex()] -= SpatialVec(s2_G % f1_G, f1_G);
}
// get the force magnitude that has already been computed
const double& ExpressionBasedPointToPointForce::
getForceMagnitude(const SimTK::State& s)
{
return getCacheVariableValue(s, _forceMagnitudeCV);
}
//=============================================================================
// Reporting
//=============================================================================
// Provide names of the quantities (column labels) of the force value(s)
// reported.
OpenSim::Array<std::string> ExpressionBasedPointToPointForce::getRecordLabels() const
{
const string& body1Name = getBody1Name();
const string& body2Name = getBody2Name();
OpenSim::Array<std::string> labels("");
labels.append(getName()+"."+body1Name+".force.X");
labels.append(getName()+"."+body1Name+".force.Y");
labels.append(getName()+"."+body1Name+".force.Z");
labels.append(getName()+"."+body1Name+".point.X");
labels.append(getName()+"."+body1Name+".point.Y");
labels.append(getName()+"."+body1Name+".point.Z");
labels.append(getName()+"."+body2Name+".force.X");
labels.append(getName()+"."+body2Name+".force.Y");
labels.append(getName()+"."+body2Name+".force.Z");
labels.append(getName()+"."+body2Name+".point.X");
labels.append(getName()+"."+body2Name+".point.Y");
labels.append(getName()+"."+body2Name+".point.Z");
return labels;
}
// Provide the value(s) to be reported that correspond to the labels.
OpenSim::Array<double> ExpressionBasedPointToPointForce::
getRecordValues(const SimTK::State& state) const
{
OpenSim::Array<double> values(1);
SimTK::Vector_<SimTK::SpatialVec> bodyForces(0);
SimTK::Vector_<SimTK::Vec3> particleForces(0);
SimTK::Vector mobilityForces(0);
//get the net force added to the system contributed by the Spring
_model->getForceSubsystem().getForce(_index)
.calcForceContribution(state, bodyForces, particleForces, mobilityForces);
SimTK::Vec3 forces = bodyForces(_body1->getMobilizedBodyIndex())[1];
values.append(3, &forces[0]);
SimTK::Vec3 gpoint = _body1->findStationLocationInGround(state, getPoint1());
values.append(3, &gpoint[0]);
forces = bodyForces(_body2->getMobilizedBodyIndex())[1];
values.append(3, &forces[0]);
gpoint = _body2->findStationLocationInGround(state, getPoint2());
values.append(3, &gpoint[0]);
return values;
}
| {
"pile_set_name": "Github"
} |
.. _pt Proctored Session Results:
###################################################
Viewing Proctored Session Results with Proctortrack
###################################################
To review individual violation videos and screenshots, follow these steps:
#. In the LMS, open the Proctortrack Review Dashboard by navigating to the **edX Instructor Dashboard**
-> **Special Exams** tab -> **Review Dashboard**.
#. The Verificient **Proctortrack Review Dashboard** will load inline in the LMS.
#. Navigate to the **Quiz List** tab and locate the exam you want to review.
#. Click on **View Sessions** to open the list of learners who took the exam
#. Review all learners who are flagged as “Require Attention” as follows.
#. To review an individual learner’s session, click on the learner’s name to pop out
their detailed exam results in a new tab. Here you can review their exam data, including Video
Monitoring, Online Violations, Verification scans, and Onboarding tabs to understand what infractions
(if any) were flagged as suspicious
#. If the suspicious behavior is deemed to be in violation of proctoring rules of your course,
select **Fail** to fail the learner and set their grade to 0. Learners will get an email informing them that they did not pass proctoring review, and their grade was set to 0.
#. If needed, you can later revert this decision by clicking **Pass** to pass the learner and
restore their original exam grade.
#. If needed, you can download the violation screenshot and data by clicking the **Export Data arrow**.
To see a summary of proctored exam results, you use the Proctored Exam Results
report. This report is a .csv file that you can download from the instructor
dashboard. You can use this report to view proctoring results for all learners,
or :ref:`determine whether a specific learner has passed the proctoring
review<Determine if Learner Passed Proctoring Review>`.
.. note::
The Proctored Exam Results report contains information about the proctoring
review. The report does not include information about the learner's score on
the exam. A learner might pass the proctoring review but not earn a high
enough score to pass the exam itself.
For more information about the Proctored Exam Results report, see the following
sections.
.. contents::
:local:
:depth: 1
.. _Viewing PT Proctored Session Results:
*********************************************
Download the Proctored Exam Results Report
*********************************************
At any time after learners have taken the proctored exam in your course, you
can download a .csv file that displays the current status of the proctoring
session for participating learners.
To generate and download the Proctored Exam Results report, follow these
steps.
.. important::
This report contains confidential, personally identifiable data. Be sure to
follow your institution's data stewardship policies when you open or save
this report.
#. View the live version of your course.
#. In the LMS, select **Instructor**, then select **Data Download**.
#. In the **Reports** section, select **Generate Proctored Exam Results
Report**.
A status message indicates that the report generation process is in
progress. This process can take some time to complete. You can navigate away
from this page while the process runs.
#. To check the progress of the report generation, reload the page in your
browser and scroll to the **Pending Tasks** section. The table shows the
status of active tasks.
When the report is complete, a linked .csv file name becomes available in
the **Reports Available for Download** section. The most recently generated
reports appear at the top of the list.
File names are in the following format.
``{course_id}_proctored_exam_results_report_{datetime}.csv``
#. To download a report file, select the link for the report you requested.
The .csv file begins downloading automatically.
.. note::
To prevent the accidental distribution of learner data, you can download
exam result report files only by clicking the links on this page. These
links expire after 5 minutes. If necessary, refresh the page to generate new
links.
#. When the download is complete, open the .csv files in a spreadsheet
application to sort, graph, and compare data.
.. _PT Proctored Session Results File:
********************************************
Interpret the Proctored Exam Results Report
********************************************
The Proctored Exam Results report contains the following fields.
.. list-table::
:widths: 30 55
:header-rows: 1
* - Column
- Description
* - course_id
- The ID of the course.
* - exam_name
- The name of the proctored exam in the body of the course.
* - username
- The username that identifies the learner taking the proctored exam.
* - email
- The email address that identifies the learner taking the proctored exam.
* - attempt_code
- An identifier for the exam attempt. The attempt code is an
internal identifier and is included in the report for use in
troubleshooting.
* - allowed_time_limit_mins
- The amount of time in minutes that this learner was allotted for
completing the exam.
* - is_sample_attempt
- Indicates whether this exam attempt was for a practice exam.
* - started_at
- The date and time that the learner started to take the proctored exam.
* - completed_at
- The date and time that the learner submitted the proctored exam.
* - status
- The current status of the proctoring session as a whole. The proctoring
session encompasses the time from when the learner chooses to take the
proctored exam until the proctored exam review is complete. If the
proctored exam review is complete, the value in the ``review_status``
column affects the value in this column.
For possible values in the status column and an explanation of each
value, see :ref:`Proctoring Results Status Column`.
* - review_status
- The current status of the proctoring exam review by
Proctortrack/the course team. If the proctored exam review is
complete, the value in this column affects the value in the
``status`` column.
For possible values and an explanation of each value, see
:ref:`Proctoring Results Review Status Column PT`.
* - Suspicious Count
- Number of incidents during the exam that Proctortrack marked as
"Suspicious".
* - Suspicious Comments
- The comments that Proctortrack entered for each "Suspicious"
incident, separated by semicolons (;).
* - Rules Violation Count
- Number of incidents during the exam that Proctortrack marked as
"Rules Violation".
* - Rules Violation Comments
- The comments that Proctortrack entered for each "Rules Violation"
incident, separated by semicolons (;).
.. _Proctoring Results Status Column:
===============================
Values in the ``status`` Column
===============================
The following table describes the possible values in the ``status`` column.
.. list-table::
:widths: 30 55
:header-rows: 1
* - Value
- Description
* - completed
- The learner has completed the proctored exam.
* - created
- The exam attempt record has been created, but the exam has not yet been
started.
* - declined
- The learner declined to take the exam as a proctored exam.
* - error
- An error has occurred with the exam.
* - expired
- The course end date passed before the learner completed the proctored
exam.
* - ready_to_start
- The exam attempt record has been created. The learner still needs to
start the exam.
* - ready_to_submit
- The learner has completed but not yet submitted the proctored exam.
* - rejected
- The proctoring session review has been completed, and the learner has
not passed the review. The learner receives a value of "Unsatisfactory"
on the learner exam page and in a notification email message.
Additionally, the learner automatically receives a score of 0 for the
exam. For most courses, the learner is no longer eligible for academic
credit.
This value results from a value of "Suspicious" in the
:ref:`review_status<Proctoring Results Review Status Column PT>`
column after a member of the course team marks the exam session
a failure in the Proctortrack dashboard.
* - second_review_required
- The exam attempt has been reviewed and the review team has determined
that the exam requires additional evaluation. Course teams
should perform this second round of review, as described
:ref:`above<pt Proctored Session Results>`
This status results from a value of "Suspicious" in the
:ref:`review_status<Proctoring Results Review Status Column PT>` column.
* - started
- The learner has started the proctored exam.
* - submitted
- The learner has completed the proctored exam and results have been
submitted for review.
* - timed_out
- The proctored exam has timed out.
* - verified
- The proctoring session review has been completed, and the learner has
passed the review. The learner receives a value of "Satisfactory" on the
learner exam page and in a notification email message.
This value results from a value of "Clean" or "Rules Violation" in the
:ref:`review_status<Proctoring Results Review Status Column PT>` column.
.. _Proctoring Results Review Status Column PT:
======================================
Values in the ``review_status`` Column
======================================
After learners complete a proctored exam, a reviewer from the proctoring
service provider reviews the exam according to specific criteria, including the
:ref:`Online Proctoring Rules <CA Online Proctoring Rules>`. The value in the
``review_status`` column shows the outcome of the proctored exam review.
Additionally, the value in the ``review_status`` column affects the following
information for the course team and for the learner.
* The values in the ``status`` column.
* The proctoring result that is visible on the learner exam page and in the
email notification that the learner receives.
For example, if the ``review_status`` column has a value of "Clean", the value
in the ``status`` column is "verified". On the learner exam page and in the
email notification, the status of the exam is "Satisfactory".
If the ``review_status`` column has a value of "Suspicious", the value
in the ``status`` column is "second_review_required" or "rejected". If
the ``status`` is "rejected", then on the learner exam page and in the email
notification, the status of the exam is "Unsatisfactory".
The following table describes the possible values in the ``review_status``
column.
.. list-table::
:widths: 30 20 55
:header-rows: 1
* - Value
- Exam Result
- Description
* - Clean
- Pass
- No rules violations or suspicious incidents occurred. The learner has
passed the proctoring review.
This value causes a value of "verified" in the ``status`` column. The
learner receives a result of "Satisfactory" for the proctored exam.
* - Not Reviewed
- n/a
- The proctoring review is not yet complete.
* - Rules Violation
- Pass
- An incident occurred that violates proctored exam rules, but the
incident does not compromise exam integrity. For example, music may be
playing. The learner has passed the proctoring review.
This value causes a value of "verified" in the ``status`` column. The
learner receives a result of "Satisfactory" for the proctored exam.
* - Suspicious
- Fail
- An incident has occurred that directly compromises exam integrity. For
example, cheating might have occurred. The learner has failed the
proctoring review.
This value causes a value of "second_review_required" or
"rejected" in the ``status`` column. The learner receives a
result of "Unsatisfactory" for the proctored exam in the latter
case. The learner also receives a score of 0 on the exam. In
most courses, the learner is no longer eligible for academic
credit.
.. _Determine if Learner Passed Proctoring Review:
*******************************************************
Determine if a Learner Passed the Proctored Exam Review
*******************************************************
To determine whether a specific learner passed the proctored exam review, you
can either view the Proctored Session Results report or view the course as the
learner.
=========================================
View the Proctored Session Results Report
=========================================
#. Download and open the Proctored Session Results report.
#. In the row for the learner, check the ``status`` column.
* If the value in the column is "verified", the learner passed the review.
* If the value is "rejected", the learner did not pass the review. The
learner automatically receives a score of 0 on the exam. Additionally, for
most courses, the learner is no longer eligible for academic credit.
==============================
View the Course as the Learner
==============================
#. :ref:`View the course as the learner that you want<Roles for Viewing Course
Content>`.
#. Open the page for the proctored exam.
On the page, the learner's status is visible as "Pending", "Satisfactory", or
"Unsatisfactory".
| {
"pile_set_name": "Github"
} |
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2018 MediaTek Inc.
* Author: Weijie Gao <[email protected]>
*/
#ifndef _MT753X_H_
#define _MT753X_H_
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/netdevice.h>
#include <linux/of_mdio.h>
#include <linux/workqueue.h>
#include <linux/gpio/consumer.h>
#ifdef CONFIG_SWCONFIG
#include <linux/switch.h>
#endif
#include "mt753x_vlan.h"
#define MT753X_DFL_CPU_PORT 6
#define MT753X_NUM_PHYS 5
#define MT753X_DFL_SMI_ADDR 0x1f
#define MT753X_SMI_ADDR_MASK 0x1f
struct gsw_mt753x;
enum mt753x_model {
MT7530 = 0x7530,
MT7531 = 0x7531
};
struct mt753x_port_cfg {
struct device_node *np;
int phy_mode;
u32 enabled: 1;
u32 force_link: 1;
u32 speed: 2;
u32 duplex: 1;
};
struct mt753x_phy {
struct gsw_mt753x *gsw;
struct net_device netdev;
struct phy_device *phydev;
};
struct gsw_mt753x {
u32 id;
struct device *dev;
struct mii_bus *host_bus;
struct mii_bus *gphy_bus;
struct mutex mii_lock; /* MII access lock */
u32 smi_addr;
u32 phy_base;
int direct_phy_access;
enum mt753x_model model;
const char *name;
struct mt753x_port_cfg port5_cfg;
struct mt753x_port_cfg port6_cfg;
int phy_status_poll;
struct mt753x_phy phys[MT753X_NUM_PHYS];
int phy_link_sts;
int irq;
int reset_pin;
struct work_struct irq_worker;
#ifdef CONFIG_SWCONFIG
struct switch_dev swdev;
u32 cpu_port;
#endif
int global_vlan_enable;
struct mt753x_vlan_entry vlan_entries[MT753X_NUM_VLANS];
struct mt753x_port_entry port_entries[MT753X_NUM_PORTS];
int (*mii_read)(struct gsw_mt753x *gsw, int phy, int reg);
void (*mii_write)(struct gsw_mt753x *gsw, int phy, int reg, u16 val);
int (*mmd_read)(struct gsw_mt753x *gsw, int addr, int devad, u16 reg);
void (*mmd_write)(struct gsw_mt753x *gsw, int addr, int devad, u16 reg,
u16 val);
struct list_head list;
};
struct chip_rev {
const char *name;
u32 rev;
};
struct mt753x_sw_id {
enum mt753x_model model;
int (*detect)(struct gsw_mt753x *gsw, struct chip_rev *crev);
int (*init)(struct gsw_mt753x *gsw);
int (*post_init)(struct gsw_mt753x *gsw);
};
extern struct list_head mt753x_devs;
struct gsw_mt753x *mt753x_get_gsw(u32 id);
struct gsw_mt753x *mt753x_get_first_gsw(void);
void mt753x_put_gsw(void);
void mt753x_lock_gsw(void);
u32 mt753x_reg_read(struct gsw_mt753x *gsw, u32 reg);
void mt753x_reg_write(struct gsw_mt753x *gsw, u32 reg, u32 val);
int mt753x_mii_read(struct gsw_mt753x *gsw, int phy, int reg);
void mt753x_mii_write(struct gsw_mt753x *gsw, int phy, int reg, u16 val);
int mt753x_mmd_read(struct gsw_mt753x *gsw, int addr, int devad, u16 reg);
void mt753x_mmd_write(struct gsw_mt753x *gsw, int addr, int devad, u16 reg,
u16 val);
int mt753x_mmd_ind_read(struct gsw_mt753x *gsw, int addr, int devad, u16 reg);
void mt753x_mmd_ind_write(struct gsw_mt753x *gsw, int addr, int devad, u16 reg,
u16 val);
void mt753x_irq_worker(struct work_struct *work);
void mt753x_irq_enable(struct gsw_mt753x *gsw);
/* MDIO Indirect Access Registers */
#define MII_MMD_ACC_CTL_REG 0x0d
#define MMD_CMD_S 14
#define MMD_CMD_M 0xc000
#define MMD_DEVAD_S 0
#define MMD_DEVAD_M 0x1f
/* MMD_CMD: MMD commands */
#define MMD_ADDR 0
#define MMD_DATA 1
#define MII_MMD_ADDR_DATA_REG 0x0e
/* Procedure of MT753x Internal Register Access
*
* 1. Internal Register Address
*
* The MT753x has a 16-bit register address and each register is 32-bit.
* This means the lowest two bits are not used as the register address is
* 4-byte aligned.
*
* Rest of the valid bits are divided into two parts:
* Bit 15..6 is the Page address
* Bit 5..2 is the low address
*
* -------------------------------------------------------------------
* | 15 14 13 12 11 10 9 8 7 6 | 5 4 3 2 | 1 0 |
* |----------------------------------------|---------------|--------|
* | Page Address | Address | Unused |
* -------------------------------------------------------------------
*
* 2. MDIO access timing
*
* The MT753x uses the following MDIO timing for a single register read
*
* Phase 1: Write Page Address
* -------------------------------------------------------------------
* | ST | OP | PHY_ADDR | TYPE | RSVD | TA | RSVD | PAGE_ADDR |
* -------------------------------------------------------------------
* | 01 | 01 | 11111 | 1 | 1111 | xx | 00000 | REG_ADDR[15..6] |
* -------------------------------------------------------------------
*
* Phase 2: Write low Address & Read low word
* -------------------------------------------------------------------
* | ST | OP | PHY_ADDR | TYPE | LOW_ADDR | TA | DATA |
* -------------------------------------------------------------------
* | 01 | 10 | 11111 | 0 | REG_ADDR[5..2] | xx | DATA[15..0] |
* -------------------------------------------------------------------
*
* Phase 3: Read high word
* -------------------------------------------------------------------
* | ST | OP | PHY_ADDR | TYPE | RSVD | TA | DATA |
* -------------------------------------------------------------------
* | 01 | 10 | 11111 | 1 | 0000 | xx | DATA[31..16] |
* -------------------------------------------------------------------
*
* The MT753x uses the following MDIO timing for a single register write
*
* Phase 1: Write Page Address (The same as read)
*
* Phase 2: Write low Address and low word
* -------------------------------------------------------------------
* | ST | OP | PHY_ADDR | TYPE | LOW_ADDR | TA | DATA |
* -------------------------------------------------------------------
* | 01 | 01 | 11111 | 0 | REG_ADDR[5..2] | xx | DATA[15..0] |
* -------------------------------------------------------------------
*
* Phase 3: write high word
* -------------------------------------------------------------------
* | ST | OP | PHY_ADDR | TYPE | RSVD | TA | DATA |
* -------------------------------------------------------------------
* | 01 | 01 | 11111 | 1 | 0000 | xx | DATA[31..16] |
* -------------------------------------------------------------------
*
*/
/* Internal Register Address fields */
#define MT753X_REG_PAGE_ADDR_S 6
#define MT753X_REG_PAGE_ADDR_M 0xffc0
#define MT753X_REG_ADDR_S 2
#define MT753X_REG_ADDR_M 0x3c
#endif /* _MT753X_H_ */
| {
"pile_set_name": "Github"
} |
{default_translation_domain domain='bo.default'}
<div id="condition-add-operators-values" class="form-group">
<label for="operator">{$label}</label>
<div class="row">
<div class="col-lg-6">
{$operatorSelectHtml nofilter}
</div>
<div class="input-group col-lg-6">
<input type="text" class="form-control" id="{$inputKey}-value" name="{$inputKey}[value]" value="{$currentValue}">
</div>
</div>
</div> | {
"pile_set_name": "Github"
} |
/*
* Author: illuz <iilluzen[at]gmail.com>
* File: AC_merge_n.cpp
* Create Date: 2014-11-27 14:41:15
* Descripton: merge two array and find, O(n+m) + log(n+m)
* complexity is too large, but it had AC!
*/
#include <bits/stdc++.h>
using namespace std;
const int N = 0;
class Solution {
public:
double findMedianSortedArrays(int A[], int m, int B[], int n) {
vector<int> C;
int pa = 0, pb = 0; // point of A & B
while (pa < m || pb < n) {
if (pa == m) {
C.push_back(B[pb++]);
continue;
}
if (pb == n) {
C.push_back(A[pa++]);
continue;
}
if (A[pa] > B[pb])
C.push_back(B[pb++]);
else
C.push_back(A[pa++]);
}
if ((n + m)&1)
return C[(n+m)/2];
else
return (C[(n+m)/2 - 1] + C[(n+m)/2]) / 2.0;
}
};
int main() {
int n, m;
int A[100], B[100];
Solution s;
while (cin >> n) {
for (int i = 0; i < n; i++)
cin >> A[i];
cin >> m;
for (int i = 0; i < m; i++)
cin >> B[i];
cout << s.findMedianSortedArrays(A, n, B, m) << endl;
}
return 0;
}
| {
"pile_set_name": "Github"
} |
// Code generated by "go run msg_generate.go"; DO NOT EDIT.
package dns
// pack*() functions
func (rr *A) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDataA(rr.A, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *AAAA) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDataAAAA(rr.AAAA, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *AFSDB) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Subtype, msg, off)
if err != nil {
return off, err
}
off, err = packDomainName(rr.Hostname, msg, off, compression, false)
if err != nil {
return off, err
}
return off, nil
}
func (rr *ANY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
return off, nil
}
func (rr *AVC) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packStringTxt(rr.Txt, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *CAA) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint8(rr.Flag, msg, off)
if err != nil {
return off, err
}
off, err = packString(rr.Tag, msg, off)
if err != nil {
return off, err
}
off, err = packStringOctet(rr.Value, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *CDNSKEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Flags, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Protocol, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Algorithm, msg, off)
if err != nil {
return off, err
}
off, err = packStringBase64(rr.PublicKey, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *CDS) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.KeyTag, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Algorithm, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.DigestType, msg, off)
if err != nil {
return off, err
}
off, err = packStringHex(rr.Digest, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *CERT) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Type, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.KeyTag, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Algorithm, msg, off)
if err != nil {
return off, err
}
off, err = packStringBase64(rr.Certificate, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *CNAME) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Target, msg, off, compression, compress)
if err != nil {
return off, err
}
return off, nil
}
func (rr *CSYNC) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint32(rr.Serial, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.Flags, msg, off)
if err != nil {
return off, err
}
off, err = packDataNsec(rr.TypeBitMap, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *DHCID) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packStringBase64(rr.Digest, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *DLV) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.KeyTag, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Algorithm, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.DigestType, msg, off)
if err != nil {
return off, err
}
off, err = packStringHex(rr.Digest, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *DNAME) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Target, msg, off, compression, false)
if err != nil {
return off, err
}
return off, nil
}
func (rr *DNSKEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Flags, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Protocol, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Algorithm, msg, off)
if err != nil {
return off, err
}
off, err = packStringBase64(rr.PublicKey, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *DS) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.KeyTag, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Algorithm, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.DigestType, msg, off)
if err != nil {
return off, err
}
off, err = packStringHex(rr.Digest, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *EID) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packStringHex(rr.Endpoint, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *EUI48) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint48(rr.Address, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *EUI64) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint64(rr.Address, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *GID) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint32(rr.Gid, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *GPOS) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packString(rr.Longitude, msg, off)
if err != nil {
return off, err
}
off, err = packString(rr.Latitude, msg, off)
if err != nil {
return off, err
}
off, err = packString(rr.Altitude, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *HINFO) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packString(rr.Cpu, msg, off)
if err != nil {
return off, err
}
off, err = packString(rr.Os, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *HIP) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint8(rr.HitLength, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.PublicKeyAlgorithm, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.PublicKeyLength, msg, off)
if err != nil {
return off, err
}
off, err = packStringHex(rr.Hit, msg, off)
if err != nil {
return off, err
}
off, err = packStringBase64(rr.PublicKey, msg, off)
if err != nil {
return off, err
}
off, err = packDataDomainNames(rr.RendezvousServers, msg, off, compression, false)
if err != nil {
return off, err
}
return off, nil
}
func (rr *KEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Flags, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Protocol, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Algorithm, msg, off)
if err != nil {
return off, err
}
off, err = packStringBase64(rr.PublicKey, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *KX) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Preference, msg, off)
if err != nil {
return off, err
}
off, err = packDomainName(rr.Exchanger, msg, off, compression, false)
if err != nil {
return off, err
}
return off, nil
}
func (rr *L32) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Preference, msg, off)
if err != nil {
return off, err
}
off, err = packDataA(rr.Locator32, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *L64) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Preference, msg, off)
if err != nil {
return off, err
}
off, err = packUint64(rr.Locator64, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *LOC) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint8(rr.Version, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Size, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.HorizPre, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.VertPre, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.Latitude, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.Longitude, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.Altitude, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *LP) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Preference, msg, off)
if err != nil {
return off, err
}
off, err = packDomainName(rr.Fqdn, msg, off, compression, false)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MB) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Mb, msg, off, compression, compress)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MD) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Md, msg, off, compression, compress)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MF) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Mf, msg, off, compression, compress)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MG) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Mg, msg, off, compression, compress)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MINFO) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Rmail, msg, off, compression, compress)
if err != nil {
return off, err
}
off, err = packDomainName(rr.Email, msg, off, compression, compress)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MR) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Mr, msg, off, compression, compress)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MX) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Preference, msg, off)
if err != nil {
return off, err
}
off, err = packDomainName(rr.Mx, msg, off, compression, compress)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NAPTR) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Order, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.Preference, msg, off)
if err != nil {
return off, err
}
off, err = packString(rr.Flags, msg, off)
if err != nil {
return off, err
}
off, err = packString(rr.Service, msg, off)
if err != nil {
return off, err
}
off, err = packString(rr.Regexp, msg, off)
if err != nil {
return off, err
}
off, err = packDomainName(rr.Replacement, msg, off, compression, false)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NID) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Preference, msg, off)
if err != nil {
return off, err
}
off, err = packUint64(rr.NodeID, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NIMLOC) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packStringHex(rr.Locator, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NINFO) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packStringTxt(rr.ZSData, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NS) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Ns, msg, off, compression, compress)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NSAPPTR) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Ptr, msg, off, compression, false)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NSEC) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.NextDomain, msg, off, compression, false)
if err != nil {
return off, err
}
off, err = packDataNsec(rr.TypeBitMap, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NSEC3) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint8(rr.Hash, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Flags, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.Iterations, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.SaltLength, msg, off)
if err != nil {
return off, err
}
// Only pack salt if value is not "-", i.e. empty
if rr.Salt != "-" {
off, err = packStringHex(rr.Salt, msg, off)
if err != nil {
return off, err
}
}
off, err = packUint8(rr.HashLength, msg, off)
if err != nil {
return off, err
}
off, err = packStringBase32(rr.NextDomain, msg, off)
if err != nil {
return off, err
}
off, err = packDataNsec(rr.TypeBitMap, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NSEC3PARAM) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint8(rr.Hash, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Flags, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.Iterations, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.SaltLength, msg, off)
if err != nil {
return off, err
}
// Only pack salt if value is not "-", i.e. empty
if rr.Salt != "-" {
off, err = packStringHex(rr.Salt, msg, off)
if err != nil {
return off, err
}
}
return off, nil
}
func (rr *NULL) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packStringAny(rr.Data, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *OPENPGPKEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packStringBase64(rr.PublicKey, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *OPT) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDataOpt(rr.Option, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *PTR) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Ptr, msg, off, compression, compress)
if err != nil {
return off, err
}
return off, nil
}
func (rr *PX) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Preference, msg, off)
if err != nil {
return off, err
}
off, err = packDomainName(rr.Map822, msg, off, compression, false)
if err != nil {
return off, err
}
off, err = packDomainName(rr.Mapx400, msg, off, compression, false)
if err != nil {
return off, err
}
return off, nil
}
func (rr *RFC3597) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packStringHex(rr.Rdata, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *RKEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Flags, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Protocol, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Algorithm, msg, off)
if err != nil {
return off, err
}
off, err = packStringBase64(rr.PublicKey, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *RP) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Mbox, msg, off, compression, false)
if err != nil {
return off, err
}
off, err = packDomainName(rr.Txt, msg, off, compression, false)
if err != nil {
return off, err
}
return off, nil
}
func (rr *RRSIG) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.TypeCovered, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Algorithm, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Labels, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.OrigTtl, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.Expiration, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.Inception, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.KeyTag, msg, off)
if err != nil {
return off, err
}
off, err = packDomainName(rr.SignerName, msg, off, compression, false)
if err != nil {
return off, err
}
off, err = packStringBase64(rr.Signature, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *RT) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Preference, msg, off)
if err != nil {
return off, err
}
off, err = packDomainName(rr.Host, msg, off, compression, false)
if err != nil {
return off, err
}
return off, nil
}
func (rr *SIG) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.TypeCovered, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Algorithm, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Labels, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.OrigTtl, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.Expiration, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.Inception, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.KeyTag, msg, off)
if err != nil {
return off, err
}
off, err = packDomainName(rr.SignerName, msg, off, compression, false)
if err != nil {
return off, err
}
off, err = packStringBase64(rr.Signature, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *SMIMEA) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint8(rr.Usage, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Selector, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.MatchingType, msg, off)
if err != nil {
return off, err
}
off, err = packStringHex(rr.Certificate, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *SOA) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Ns, msg, off, compression, compress)
if err != nil {
return off, err
}
off, err = packDomainName(rr.Mbox, msg, off, compression, compress)
if err != nil {
return off, err
}
off, err = packUint32(rr.Serial, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.Refresh, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.Retry, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.Expire, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.Minttl, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *SPF) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packStringTxt(rr.Txt, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *SRV) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Priority, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.Weight, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.Port, msg, off)
if err != nil {
return off, err
}
off, err = packDomainName(rr.Target, msg, off, compression, false)
if err != nil {
return off, err
}
return off, nil
}
func (rr *SSHFP) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint8(rr.Algorithm, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Type, msg, off)
if err != nil {
return off, err
}
off, err = packStringHex(rr.FingerPrint, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *TA) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.KeyTag, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Algorithm, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.DigestType, msg, off)
if err != nil {
return off, err
}
off, err = packStringHex(rr.Digest, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *TALINK) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.PreviousName, msg, off, compression, false)
if err != nil {
return off, err
}
off, err = packDomainName(rr.NextName, msg, off, compression, false)
if err != nil {
return off, err
}
return off, nil
}
func (rr *TKEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Algorithm, msg, off, compression, false)
if err != nil {
return off, err
}
off, err = packUint32(rr.Inception, msg, off)
if err != nil {
return off, err
}
off, err = packUint32(rr.Expiration, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.Mode, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.Error, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.KeySize, msg, off)
if err != nil {
return off, err
}
off, err = packStringHex(rr.Key, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.OtherLen, msg, off)
if err != nil {
return off, err
}
off, err = packStringHex(rr.OtherData, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *TLSA) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint8(rr.Usage, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.Selector, msg, off)
if err != nil {
return off, err
}
off, err = packUint8(rr.MatchingType, msg, off)
if err != nil {
return off, err
}
off, err = packStringHex(rr.Certificate, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *TSIG) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packDomainName(rr.Algorithm, msg, off, compression, false)
if err != nil {
return off, err
}
off, err = packUint48(rr.TimeSigned, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.Fudge, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.MACSize, msg, off)
if err != nil {
return off, err
}
off, err = packStringHex(rr.MAC, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.OrigId, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.Error, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.OtherLen, msg, off)
if err != nil {
return off, err
}
off, err = packStringHex(rr.OtherData, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *TXT) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packStringTxt(rr.Txt, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *UID) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint32(rr.Uid, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *UINFO) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packString(rr.Uinfo, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *URI) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packUint16(rr.Priority, msg, off)
if err != nil {
return off, err
}
off, err = packUint16(rr.Weight, msg, off)
if err != nil {
return off, err
}
off, err = packStringOctet(rr.Target, msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *X25) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
off, err = packString(rr.PSDNAddress, msg, off)
if err != nil {
return off, err
}
return off, nil
}
// unpack*() functions
func (rr *A) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.A, off, err = unpackDataA(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *AAAA) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.AAAA, off, err = unpackDataAAAA(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *AFSDB) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Subtype, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Hostname, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *ANY) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
return off, nil
}
func (rr *AVC) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Txt, off, err = unpackStringTxt(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *CAA) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Flag, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Tag, off, err = unpackString(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Value, off, err = unpackStringOctet(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *CDNSKEY) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Flags, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Protocol, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Algorithm, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *CDS) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.KeyTag, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Algorithm, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.DigestType, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *CERT) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Type, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.KeyTag, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Algorithm, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Certificate, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *CNAME) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Target, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *CSYNC) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Serial, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Flags, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.TypeBitMap, off, err = unpackDataNsec(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *DHCID) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Digest, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *DLV) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.KeyTag, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Algorithm, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.DigestType, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *DNAME) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Target, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *DNSKEY) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Flags, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Protocol, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Algorithm, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *DS) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.KeyTag, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Algorithm, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.DigestType, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *EID) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Endpoint, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *EUI48) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Address, off, err = unpackUint48(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *EUI64) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Address, off, err = unpackUint64(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *GID) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Gid, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *GPOS) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Longitude, off, err = unpackString(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Latitude, off, err = unpackString(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Altitude, off, err = unpackString(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *HINFO) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Cpu, off, err = unpackString(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Os, off, err = unpackString(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *HIP) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.HitLength, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.PublicKeyAlgorithm, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.PublicKeyLength, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Hit, off, err = unpackStringHex(msg, off, off+int(rr.HitLength))
if err != nil {
return off, err
}
rr.PublicKey, off, err = unpackStringBase64(msg, off, off+int(rr.PublicKeyLength))
if err != nil {
return off, err
}
rr.RendezvousServers, off, err = unpackDataDomainNames(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *KEY) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Flags, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Protocol, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Algorithm, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *KX) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Preference, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Exchanger, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *L32) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Preference, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Locator32, off, err = unpackDataA(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *L64) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Preference, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Locator64, off, err = unpackUint64(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *LOC) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Version, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Size, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.HorizPre, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.VertPre, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Latitude, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Longitude, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Altitude, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *LP) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Preference, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Fqdn, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MB) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Mb, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MD) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Md, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MF) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Mf, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MG) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Mg, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MINFO) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Rmail, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Email, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MR) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Mr, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *MX) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Preference, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Mx, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NAPTR) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Order, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Preference, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Flags, off, err = unpackString(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Service, off, err = unpackString(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Regexp, off, err = unpackString(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Replacement, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NID) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Preference, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.NodeID, off, err = unpackUint64(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NIMLOC) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Locator, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *NINFO) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.ZSData, off, err = unpackStringTxt(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NS) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Ns, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NSAPPTR) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Ptr, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NSEC) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.NextDomain, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.TypeBitMap, off, err = unpackDataNsec(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NSEC3) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Hash, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Flags, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Iterations, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.SaltLength, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Salt, off, err = unpackStringHex(msg, off, off+int(rr.SaltLength))
if err != nil {
return off, err
}
rr.HashLength, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.NextDomain, off, err = unpackStringBase32(msg, off, off+int(rr.HashLength))
if err != nil {
return off, err
}
rr.TypeBitMap, off, err = unpackDataNsec(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *NSEC3PARAM) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Hash, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Flags, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Iterations, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.SaltLength, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Salt, off, err = unpackStringHex(msg, off, off+int(rr.SaltLength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *NULL) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Data, off, err = unpackStringAny(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *OPENPGPKEY) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *OPT) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Option, off, err = unpackDataOpt(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *PTR) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Ptr, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *PX) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Preference, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Map822, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Mapx400, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *RFC3597) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Rdata, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *RKEY) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Flags, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Protocol, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Algorithm, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.PublicKey, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *RP) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Mbox, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Txt, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *RRSIG) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.TypeCovered, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Algorithm, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Labels, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.OrigTtl, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Expiration, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Inception, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.KeyTag, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.SignerName, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Signature, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *RT) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Preference, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Host, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *SIG) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.TypeCovered, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Algorithm, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Labels, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.OrigTtl, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Expiration, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Inception, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.KeyTag, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.SignerName, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Signature, off, err = unpackStringBase64(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *SMIMEA) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Usage, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Selector, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.MatchingType, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Certificate, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *SOA) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Ns, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Mbox, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Serial, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Refresh, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Retry, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Expire, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Minttl, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *SPF) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Txt, off, err = unpackStringTxt(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *SRV) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Priority, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Weight, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Port, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Target, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *SSHFP) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Algorithm, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Type, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.FingerPrint, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *TA) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.KeyTag, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Algorithm, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.DigestType, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Digest, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *TALINK) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.PreviousName, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.NextName, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *TKEY) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Algorithm, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Inception, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Expiration, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Mode, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Error, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.KeySize, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Key, off, err = unpackStringHex(msg, off, off+int(rr.KeySize))
if err != nil {
return off, err
}
rr.OtherLen, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.OtherData, off, err = unpackStringHex(msg, off, off+int(rr.OtherLen))
if err != nil {
return off, err
}
return off, nil
}
func (rr *TLSA) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Usage, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Selector, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.MatchingType, off, err = unpackUint8(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Certificate, off, err = unpackStringHex(msg, off, rdStart+int(rr.Hdr.Rdlength))
if err != nil {
return off, err
}
return off, nil
}
func (rr *TSIG) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Algorithm, off, err = UnpackDomainName(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.TimeSigned, off, err = unpackUint48(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Fudge, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.MACSize, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.MAC, off, err = unpackStringHex(msg, off, off+int(rr.MACSize))
if err != nil {
return off, err
}
rr.OrigId, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Error, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.OtherLen, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.OtherData, off, err = unpackStringHex(msg, off, off+int(rr.OtherLen))
if err != nil {
return off, err
}
return off, nil
}
func (rr *TXT) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Txt, off, err = unpackStringTxt(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *UID) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Uid, off, err = unpackUint32(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *UINFO) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Uinfo, off, err = unpackString(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *URI) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.Priority, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Weight, off, err = unpackUint16(msg, off)
if err != nil {
return off, err
}
if off == len(msg) {
return off, nil
}
rr.Target, off, err = unpackStringOctet(msg, off)
if err != nil {
return off, err
}
return off, nil
}
func (rr *X25) unpack(msg []byte, off int) (off1 int, err error) {
rdStart := off
_ = rdStart
rr.PSDNAddress, off, err = unpackString(msg, off)
if err != nil {
return off, err
}
return off, nil
}
| {
"pile_set_name": "Github"
} |
import { onMounted, Ref, ref, onUnmounted } from '@vue/composition-api';
export function useIntersectionObserver(
target: Ref<HTMLElement>,
options: IntersectionObserverInit = { root: null, rootMargin: '0px' }
) {
const intersectionRatio = ref(0);
const isIntersecting = ref(false);
const isFullyInView = ref(false);
function observe() {
if (target.value) {
observer.observe(target.value);
}
}
let observer: IntersectionObserver;
onMounted(() => {
observer = new IntersectionObserver(([entry]) => {
intersectionRatio.value = entry.intersectionRatio;
if (entry.intersectionRatio > 0) {
isIntersecting.value = true;
isFullyInView.value = entry.intersectionRatio >= 1;
return;
}
isIntersecting.value = false;
}, options);
observe();
});
function unobserve() {
if (!observer) return;
if (target.value) {
observer.unobserve(target.value);
}
}
onUnmounted(unobserve);
return {
intersectionRatio,
isIntersecting,
isFullyInView,
observe,
unobserve
};
}
| {
"pile_set_name": "Github"
} |
polygon
1
1.396830E+01 4.108947E+01
1.396947E+01 4.109373E+01
1.396996E+01 4.109558E+01
1.397060E+01 4.109694E+01
1.397395E+01 4.110243E+01
1.398138E+01 4.110329E+01
1.398622E+01 4.110317E+01
1.398685E+01 4.110313E+01
1.398721E+01 4.110303E+01
1.398738E+01 4.110298E+01
1.399328E+01 4.110216E+01
1.400929E+01 4.110618E+01
1.402354E+01 4.110576E+01
1.402389E+01 4.110576E+01
1.402437E+01 4.110581E+01
1.402624E+01 4.110606E+01
1.402801E+01 4.110640E+01
1.402833E+01 4.110649E+01
1.402891E+01 4.110684E+01
1.402880E+01 4.110646E+01
1.402879E+01 4.110617E+01
1.402893E+01 4.110508E+01
1.402939E+01 4.110206E+01
1.403038E+01 4.110103E+01
1.403141E+01 4.110003E+01
1.403230E+01 4.109885E+01
1.403379E+01 4.109661E+01
1.403418E+01 4.109547E+01
1.403430E+01 4.109451E+01
1.403357E+01 4.109077E+01
1.403276E+01 4.108704E+01
1.403226E+01 4.108613E+01
1.403198E+01 4.108548E+01
1.403190E+01 4.108508E+01
1.403143E+01 4.108150E+01
1.403142E+01 4.108066E+01
1.403455E+01 4.107516E+01
1.403482E+01 4.107474E+01
1.403520E+01 4.107432E+01
1.403564E+01 4.107397E+01
1.403654E+01 4.107340E+01
1.403730E+01 4.107319E+01
1.403846E+01 4.107302E+01
1.403954E+01 4.107300E+01
1.403966E+01 4.107300E+01
1.404049E+01 4.107358E+01
1.404100E+01 4.107456E+01
1.404046E+01 4.107604E+01
1.403963E+01 4.107705E+01
1.403943E+01 4.107721E+01
1.403931E+01 4.107732E+01
1.403835E+01 4.107811E+01
1.403689E+01 4.107923E+01
1.403678E+01 4.107939E+01
1.403650E+01 4.107982E+01
1.403625E+01 4.108021E+01
1.403611E+01 4.108096E+01
1.403714E+01 4.108202E+01
1.403765E+01 4.108252E+01
1.403894E+01 4.108330E+01
1.403999E+01 4.108387E+01
1.404066E+01 4.108423E+01
1.404313E+01 4.108551E+01
1.405869E+01 4.109174E+01
1.405911E+01 4.109190E+01
1.405960E+01 4.109210E+01
1.406020E+01 4.109207E+01
1.406183E+01 4.109153E+01
1.406475E+01 4.108984E+01
1.406541E+01 4.108707E+01
1.406533E+01 4.108661E+01
1.406437E+01 4.108326E+01
1.406256E+01 4.107803E+01
1.406086E+01 4.107383E+01
1.405791E+01 4.107274E+01
1.405715E+01 4.107086E+01
1.405975E+01 4.106356E+01
1.406555E+01 4.106555E+01
1.406640E+01 4.106479E+01
1.406820E+01 4.106169E+01
1.406815E+01 4.105982E+01
1.406805E+01 4.105626E+01
1.406573E+01 4.105456E+01
1.406703E+01 4.105243E+01
1.407708E+01 4.105058E+01
1.408079E+01 4.104991E+01
1.408163E+01 4.103356E+01
1.407428E+01 4.103230E+01
1.406491E+01 4.103067E+01
1.403375E+01 4.102500E+01
1.403275E+01 4.102479E+01
1.403238E+01 4.102472E+01
1.403219E+01 4.102463E+01
1.403066E+01 4.102396E+01
1.401376E+01 4.101483E+01
1.400907E+01 4.101244E+01
1.400445E+01 4.101008E+01
1.400562E+01 4.102265E+01
1.400591E+01 4.104183E+01
1.400549E+01 4.105195E+01
1.400530E+01 4.106377E+01
1.400560E+01 4.106490E+01
1.400562E+01 4.106497E+01
1.400605E+01 4.106607E+01
1.400679E+01 4.106723E+01
1.400724E+01 4.106769E+01
1.400754E+01 4.106799E+01
1.400791E+01 4.106878E+01
1.400797E+01 4.106891E+01
1.400806E+01 4.106911E+01
1.400801E+01 4.107000E+01
1.400799E+01 4.107034E+01
1.400759E+01 4.107101E+01
1.400690E+01 4.107184E+01
1.399118E+01 4.108307E+01
1.399033E+01 4.108362E+01
1.397639E+01 4.109077E+01
1.397592E+01 4.109084E+01
1.397537E+01 4.109092E+01
1.396830E+01 4.108947E+01
END
END
| {
"pile_set_name": "Github"
} |
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 25 2017 03:49:04).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <Install/IFDInstallController.h>
@interface IFDInstallController (IA_InstallController_PreInstallActionsExtensions)
- (id)applicationsToQuitBeforeInstallation;
@end
| {
"pile_set_name": "Github"
} |
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'justify', 'nl', {
block: 'Uitvullen',
center: 'Centreren',
left: 'Links uitlijnen',
right: 'Rechts uitlijnen'
} );
| {
"pile_set_name": "Github"
} |
package vendor.huawei.hardware.hisiradio.V1_0;
import android.os.HidlSupport;
import android.os.HwBlob;
import android.os.HwParcel;
import java.util.ArrayList;
import java.util.Objects;
public final class CellInfoWcdma {
public final CellIdentityWcdma cellIdentityWcdma = new CellIdentityWcdma();
public final WcdmaSignalStrength signalStrengthWcdma = new WcdmaSignalStrength();
public final boolean equals(Object otherObject) {
if (this == otherObject) {
return true;
}
if (otherObject == null || otherObject.getClass() != CellInfoWcdma.class) {
return false;
}
CellInfoWcdma other = (CellInfoWcdma) otherObject;
if (HidlSupport.deepEquals(this.cellIdentityWcdma, other.cellIdentityWcdma) && HidlSupport.deepEquals(this.signalStrengthWcdma, other.signalStrengthWcdma)) {
return true;
}
return false;
}
public final int hashCode() {
return Objects.hash(new Object[]{Integer.valueOf(HidlSupport.deepHashCode(this.cellIdentityWcdma)), Integer.valueOf(HidlSupport.deepHashCode(this.signalStrengthWcdma))});
}
public final String toString() {
return "{" + ".cellIdentityWcdma = " + this.cellIdentityWcdma + ", .signalStrengthWcdma = " + this.signalStrengthWcdma + "}";
}
public final void readFromParcel(HwParcel parcel) {
readEmbeddedFromParcel(parcel, parcel.readBuffer(56), 0);
}
public static final ArrayList<CellInfoWcdma> readVectorFromParcel(HwParcel parcel) {
ArrayList<CellInfoWcdma> _hidl_vec = new ArrayList<>();
HwBlob _hidl_blob = parcel.readBuffer(16);
int _hidl_vec_size = _hidl_blob.getInt32(8);
HwBlob childBlob = parcel.readEmbeddedBuffer((long) (_hidl_vec_size * 56), _hidl_blob.handle(), 0, true);
_hidl_vec.clear();
for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) {
CellInfoWcdma _hidl_vec_element = new CellInfoWcdma();
_hidl_vec_element.readEmbeddedFromParcel(parcel, childBlob, (long) (_hidl_index_0 * 56));
_hidl_vec.add(_hidl_vec_element);
}
return _hidl_vec;
}
public final void readEmbeddedFromParcel(HwParcel parcel, HwBlob _hidl_blob, long _hidl_offset) {
this.cellIdentityWcdma.readEmbeddedFromParcel(parcel, _hidl_blob, 0 + _hidl_offset);
this.signalStrengthWcdma.readEmbeddedFromParcel(parcel, _hidl_blob, 48 + _hidl_offset);
}
public final void writeToParcel(HwParcel parcel) {
HwBlob _hidl_blob = new HwBlob(56);
writeEmbeddedToBlob(_hidl_blob, 0);
parcel.writeBuffer(_hidl_blob);
}
public static final void writeVectorToParcel(HwParcel parcel, ArrayList<CellInfoWcdma> _hidl_vec) {
HwBlob _hidl_blob = new HwBlob(16);
int _hidl_vec_size = _hidl_vec.size();
_hidl_blob.putInt32(8, _hidl_vec_size);
_hidl_blob.putBool(12, false);
HwBlob childBlob = new HwBlob(_hidl_vec_size * 56);
for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) {
_hidl_vec.get(_hidl_index_0).writeEmbeddedToBlob(childBlob, (long) (_hidl_index_0 * 56));
}
_hidl_blob.putBlob(0, childBlob);
parcel.writeBuffer(_hidl_blob);
}
public final void writeEmbeddedToBlob(HwBlob _hidl_blob, long _hidl_offset) {
this.cellIdentityWcdma.writeEmbeddedToBlob(_hidl_blob, 0 + _hidl_offset);
this.signalStrengthWcdma.writeEmbeddedToBlob(_hidl_blob, 48 + _hidl_offset);
}
}
| {
"pile_set_name": "Github"
} |
// <auto-generated />
namespace Thinktecture.IdentityServer.Core.Repositories.Migrations.SqlCe
{
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
public sealed partial class DisableSSL : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(DisableSSL));
string IMigrationMetadata.Id
{
get { return "201308171332371_DisableSSL"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice including the dates of first publication and
* either this permission notice or a reference to
* http://oss.sgi.com/projects/FreeB/
* 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
* SILICON GRAPHICS, INC. 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.
*
* Except as contained in this notice, the name of Silicon Graphics, Inc.
* shall not be used in advertising or otherwise to promote the sale, use or
* other dealings in this Software without prior written authorization from
* Silicon Graphics, Inc.
*
* OpenGL ES CM 1.0 port of GLU by Mike Gorchak <[email protected]>
*/
#ifndef __GLUES_PROJECT_H__
#define __GLUES_PROJECT_H__
#if defined(__USE_SDL_GLES__)
#include <SDL/SDL_opengles.h>
#ifndef GLAPI
#define GLAPI GL_API
#endif
#elif defined (__QNXNTO__)
#include <GLES/gl.h>
#elif defined(_WIN32) && (defined(_M_IX86) || defined(_M_X64))
/* mainly for PowerVR OpenGL ES 1.x win32 emulator */
#include <GLES\gl.h>
#undef APIENTRY
#define APIENTRY
#if defined(GLUES_EXPORTS)
#define GLAPI __declspec(dllexport)
#else
#define GLAPI __declspec(dllimport)
#endif
#else
#error "Platform is unsupported"
#endif
#ifdef __cplusplus
extern "C" {
#endif
GLAPI void APIENTRY gluOrtho2D(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top);
GLAPI void APIENTRY gluPerspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar);
GLAPI void APIENTRY gluLookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez,
GLfloat centerx, GLfloat centery, GLfloat centerz,
GLfloat upx, GLfloat upy, GLfloat upz);
GLAPI GLint APIENTRY gluProject(GLfloat objx, GLfloat objy, GLfloat objz,
const GLfloat modelMatrix[16], const GLfloat projMatrix[16],
const GLint viewport[4], GLfloat* winx, GLfloat* winy, GLfloat* winz);
GLAPI GLint APIENTRY gluUnProject(GLfloat winx, GLfloat winy, GLfloat winz,
const GLfloat modelMatrix[16], const GLfloat projMatrix[16],
const GLint viewport[4], GLfloat* objx, GLfloat* objy, GLfloat* objz);
GLAPI GLint APIENTRY gluUnProject4(GLfloat winx, GLfloat winy, GLfloat winz, GLfloat clipw,
const GLfloat modelMatrix[16], const GLfloat projMatrix[16],
const GLint viewport[4], GLclampf nearVal, GLclampf farVal,
GLfloat* objx, GLfloat* objy, GLfloat* objz, GLfloat* objw);
GLAPI void APIENTRY gluPickMatrix(GLfloat x, GLfloat y, GLfloat deltax, GLfloat deltay, GLint viewport[4]);
#ifdef __cplusplus
}
#endif
#endif /* __GLUES_PROJECT_H__ */
| {
"pile_set_name": "Github"
} |
/*
* This file is part of the SDWebImage package.
* (c) Olivier Poitrey <[email protected]>
* (c) Laurin Brandner
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
#import "UIImage+GIF.h"
#import "SDImageGIFCoder.h"
@implementation UIImage (GIF)
+ (nullable UIImage *)sd_imageWithGIFData:(nullable NSData *)data {
if (!data) {
return nil;
}
return [[SDImageGIFCoder sharedCoder] decodedImageWithData:data options:0];
}
@end
| {
"pile_set_name": "Github"
} |
const path = require('path');
const dist = path.join(__dirname, 'dist');
module.exports = [
{
name: 'client',
target: 'web',
mode: 'development',
context: __dirname,
entry: './client',
output: {
path: dist,
filename: 'client.js'
}
}, {
name: 'server',
target: 'node',
mode: 'development',
context: __dirname,
entry: './server',
output: {
path: dist,
filename: 'server.js',
libraryTarget: 'commonjs2'
}
}
];
| {
"pile_set_name": "Github"
} |
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin dragonfly freebsd linux netbsd openbsd
package test
import (
"bytes"
"crypto/rand"
"testing"
"golang.org/x/crypto/ssh"
)
// Test both logging in with a cert, and also that the certificate presented by an OpenSSH host can be validated correctly
func TestCertLogin(t *testing.T) {
s := newServer(t)
defer s.Shutdown()
// Use a key different from the default.
clientKey := testSigners["dsa"]
caAuthKey := testSigners["ecdsa"]
cert := &ssh.Certificate{
Key: clientKey.PublicKey(),
ValidPrincipals: []string{username()},
CertType: ssh.UserCert,
ValidBefore: ssh.CertTimeInfinity,
}
if err := cert.SignCert(rand.Reader, caAuthKey); err != nil {
t.Fatalf("SetSignature: %v", err)
}
certSigner, err := ssh.NewCertSigner(cert, clientKey)
if err != nil {
t.Fatalf("NewCertSigner: %v", err)
}
conf := &ssh.ClientConfig{
User: username(),
HostKeyCallback: (&ssh.CertChecker{
IsHostAuthority: func(pk ssh.PublicKey, addr string) bool {
return bytes.Equal(pk.Marshal(), testPublicKeys["ca"].Marshal())
},
}).CheckHostKey,
}
conf.Auth = append(conf.Auth, ssh.PublicKeys(certSigner))
for _, test := range []struct {
addr string
succeed bool
}{
{addr: "host.example.com:22", succeed: true},
{addr: "host.example.com:10000", succeed: true}, // non-standard port must be OK
{addr: "host.example.com", succeed: false}, // port must be specified
{addr: "host.ex4mple.com:22", succeed: false}, // wrong host
} {
client, err := s.TryDialWithAddr(conf, test.addr)
// Always close client if opened successfully
if err == nil {
client.Close()
}
// Now evaluate whether the test failed or passed
if test.succeed {
if err != nil {
t.Fatalf("TryDialWithAddr: %v", err)
}
} else {
if err == nil {
t.Fatalf("TryDialWithAddr, unexpected success")
}
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2017-2020 47 Degrees Open Source <https://www.47deg.com>
*
* 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 higherkindness.mu.rpc
package fs2
import cats.effect.IO
import higherkindness.mu.rpc.common._
import higherkindness.mu.rpc.server._
import _root_.fs2.Stream
import org.scalatest._
class RPCTests extends RpcBaseTestSuite with BeforeAndAfterAll {
import higherkindness.mu.rpc.fs2.Utils._
import higherkindness.mu.rpc.fs2.Utils.database._
import higherkindness.mu.rpc.fs2.Utils.implicits._
override protected def beforeAll(): Unit =
serverStart[IO].unsafeRunSync()
override protected def afterAll(): Unit =
serverStop[IO].unsafeRunSync()
"mu-rpc server" should {
"allow to startup a server and check if it's alive" in {
def check[F[_]](implicit S: GrpcServer[F]): F[Boolean] =
S.isShutdown
check[IO].unsafeRunSync() shouldBe false
}
"allow to get the port where it's running" in {
def check[F[_]](implicit S: GrpcServer[F]): F[Int] =
S.getPort
check[IO].unsafeRunSync() shouldBe SC.port
}
}
"mu-rpc client with fs2.Stream as streaming implementation" should {
"be able to run unary services" in {
muAvroRPCServiceClient.use(_.unary(a1)).unsafeRunSync() shouldBe c1
}
"be able to run unary services with avro schemas" in {
muAvroWithSchemaRPCServiceClient.use(_.unaryWithSchema(a1)).unsafeRunSync() shouldBe c1
}
"be able to run server streaming services" in {
muProtoRPCServiceClient
.use(_.serverStreaming(b1).flatMap(_.compile.toList))
.unsafeRunSync() shouldBe cList
}
"handle errors in server streaming services" in {
def clientProgram(errorCode: String): IO[List[C]] =
muProtoRPCServiceClient
.use(
_.serverStreamingWithError(E(a1, errorCode))
.map(_.handleErrorWith(ex => Stream(C(ex.getMessage, a1))))
.flatMap(_.compile.toList)
)
clientProgram("SE")
.unsafeRunSync() shouldBe List(C("INVALID_ARGUMENT: SE", a1))
clientProgram("SRE")
.unsafeRunSync() shouldBe List(C("INVALID_ARGUMENT: SRE", a1))
clientProgram("RTE")
.unsafeRunSync() shouldBe List(C("INTERNAL: RTE", a1))
clientProgram("Thrown")
.unsafeRunSync() shouldBe List(C("INTERNAL: Thrown", a1))
}
"be able to run client streaming services" in {
muProtoRPCServiceClient
.use(_.clientStreaming(Stream.fromIterator[IO](aList.iterator)))
.unsafeRunSync() shouldBe dResult33
}
"be able to run client bidirectional streaming services" in {
muAvroRPCServiceClient
.use(_.biStreaming(Stream.fromIterator[IO](eList.iterator)).flatMap(_.compile.toList))
.unsafeRunSync()
.distinct shouldBe eList
}
"be able to run client bidirectional streaming services with avro schema" in {
muAvroWithSchemaRPCServiceClient
.use(
_.biStreamingWithSchema(Stream.fromIterator[IO](eList.iterator)).flatMap(_.compile.toList)
)
.unsafeRunSync()
.distinct shouldBe eList
}
"be able to run multiple rpc services" in {
val tuple =
(
muAvroRPCServiceClient.use(_.unary(a1)),
muAvroWithSchemaRPCServiceClient.use(_.unaryWithSchema(a1)),
muProtoRPCServiceClient.use(_.serverStreaming(b1).flatMap(_.compile.toList)),
muProtoRPCServiceClient.use(
_.clientStreaming(Stream.fromIterator[IO](aList.iterator))
),
muAvroRPCServiceClient.use(
_.biStreaming(Stream.fromIterator[IO](eList.iterator)).flatMap(_.compile.toList)
),
muAvroWithSchemaRPCServiceClient.use(
_.biStreamingWithSchema(Stream.fromIterator[IO](eList.iterator))
.flatMap(_.compile.toList)
)
)
tuple._1.unsafeRunSync() shouldBe c1
tuple._2.unsafeRunSync() shouldBe c1
tuple._3.unsafeRunSync() shouldBe cList
tuple._4.unsafeRunSync() shouldBe dResult33
tuple._5.unsafeRunSync().distinct shouldBe eList
tuple._6.unsafeRunSync().distinct shouldBe eList
}
}
"mu-rpc client with fs2.Stream as streaming implementation and compression enabled" should {
"be able to run unary services" in {
muCompressedAvroRPCServiceClient.use(_.unaryCompressed(a1)).unsafeRunSync() shouldBe c1
}
"be able to run unary services with avro schema" in {
muCompressedAvroWithSchemaRPCServiceClient
.use(_.unaryCompressedWithSchema(a1))
.unsafeRunSync() shouldBe c1
}
"be able to run server streaming services" in {
muCompressedProtoRPCServiceClient
.use(_.serverStreamingCompressed(b1).flatMap(_.compile.toList))
.unsafeRunSync() shouldBe cList
}
"be able to run client streaming services" in {
muCompressedProtoRPCServiceClient
.use(_.clientStreamingCompressed(Stream.fromIterator[IO](aList.iterator)))
.unsafeRunSync() shouldBe dResult33
}
"be able to run client bidirectional streaming services" in {
muCompressedAvroRPCServiceClient
.use(
_.biStreamingCompressed(Stream.fromIterator[IO](eList.iterator)).flatMap(_.compile.toList)
)
.unsafeRunSync()
.distinct shouldBe eList
}
"be able to run client bidirectional streaming services with avro schema" in {
muCompressedAvroWithSchemaRPCServiceClient
.use(
_.biStreamingCompressedWithSchema(Stream.fromIterator[IO](eList.iterator))
.flatMap(_.compile.toList)
)
.unsafeRunSync()
.distinct shouldBe eList
}
"be able to run multiple rpc services" in {
val tuple =
(
muCompressedAvroRPCServiceClient.use(_.unaryCompressed(a1)),
muCompressedAvroWithSchemaRPCServiceClient.use(_.unaryCompressedWithSchema(a1)),
muCompressedProtoRPCServiceClient.use(
_.serverStreamingCompressed(b1).flatMap(_.compile.toList)
),
muCompressedProtoRPCServiceClient.use(
_.clientStreamingCompressed(Stream.fromIterator[IO](aList.iterator))
),
muCompressedAvroRPCServiceClient.use(
_.biStreamingCompressed(Stream.fromIterator[IO](eList.iterator))
.flatMap(_.compile.toList)
),
muCompressedAvroWithSchemaRPCServiceClient
.use(
_.biStreamingCompressedWithSchema(
Stream.fromIterator[IO](eList.iterator)
).flatMap(_.compile.toList)
)
)
tuple._1.unsafeRunSync() shouldBe c1
tuple._2.unsafeRunSync() shouldBe c1
tuple._3.unsafeRunSync() shouldBe cList
tuple._4.unsafeRunSync() shouldBe dResult33
tuple._5.unsafeRunSync().distinct shouldBe eList
tuple._6.unsafeRunSync().distinct shouldBe eList
}
}
}
| {
"pile_set_name": "Github"
} |
(**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
(* *)
(* Copyright 1998 Institut National de Recherche en Informatique et *)
(* en Automatique. *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)
(* Auxiliaries for type-based optimizations, e.g. array kinds *)
val is_function_type :
Env.t -> Types.type_expr -> (Types.type_expr * Types.type_expr) option
val is_base_type : Env.t -> Types.type_expr -> Path.t -> bool
val classify_lazy_argument : Typedtree.expression ->
[ `Constant_or_function
| `Float_that_cannot_be_shortcut
| `Identifier of [`Forward_value | `Other]
| `Other]
| {
"pile_set_name": "Github"
} |
package main
import (
"errors"
"fmt"
"github.com/geo-data/cesium-terrain-server/handlers"
"strconv"
)
// Adapted from <https://golang.org/doc/effective_go.html#constants>.
type ByteSize float64
const (
_ = iota // ignore first value by assigning to blank identifier
KB ByteSize = 1 << (10 * iota)
MB
GB
TB
)
func (b ByteSize) String() string {
switch {
case b >= TB:
return fmt.Sprintf("%.2fTB", b/TB)
case b >= GB:
return fmt.Sprintf("%.2fGB", b/GB)
case b >= MB:
return fmt.Sprintf("%.2fMB", b/MB)
case b >= KB:
return fmt.Sprintf("%.2fkB", b/KB)
}
return fmt.Sprintf("%.2fB", b)
}
func ParseByteSize(size string) (bytes ByteSize, err error) {
defer func() {
if bytes < 0 {
err = errors.New("size cannot be negative")
}
}()
val, err := strconv.ParseFloat(size, 64)
if err == nil {
bytes = ByteSize(val)
return
}
if len(size) < 3 {
err = errors.New("the size must be specified as a suffix e.g 5MB")
return
}
val, err = strconv.ParseFloat(size[:len(size)-2], 64)
if err != nil {
return
}
bytes = ByteSize(val)
suffix := size[len(size)-2:]
switch suffix {
case "TB":
bytes *= TB
case "GB":
bytes *= GB
case "MB":
bytes *= MB
case "KB":
bytes *= KB
default:
err = errors.New("bad size suffix: " + suffix)
}
return
}
type LimitOpt struct {
Value handlers.Bytes
}
func NewLimitOpt() *LimitOpt {
return &LimitOpt{}
}
func (this *LimitOpt) String() string {
return ByteSize(this.Value).String()
}
func (this *LimitOpt) Set(size string) error {
byteSize, err := ParseByteSize(size)
if err != nil {
return err
}
this.Value = handlers.Bytes(byteSize)
return nil
}
| {
"pile_set_name": "Github"
} |
import torch
import torch.nn as nn
from collections import OrderedDict
__all__ = ['inception_resnet_v2']
""" inception_resnet_v2.
References:
Inception-v4, Inception-ResNet and the Impact of Residual Connections
on Learning
Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, Alex Alemi.
Links:
http://arxiv.org/abs/1602.07261
"""
def conv_bn(in_planes, out_planes, kernel_size, stride=1, padding=0, bias=False):
"convolution with batchnorm, relu"
return nn.Sequential(
nn.Conv2d(in_planes, out_planes, kernel_size, stride=stride,
padding=padding, bias=False),
nn.BatchNorm2d(out_planes, eps=1e-3),
nn.ReLU()
)
class Concat(nn.Sequential):
def __init__(self, *kargs, **kwargs):
super(Concat, self).__init__(*kargs, **kwargs)
def forward(self, inputs):
return torch.cat([m(inputs) for m in self._modules.values()], 1)
class block(nn.Module):
def __init__(self, in_planes, scale=1.0, activation=nn.ReLU(True)):
super(block, self).__init__()
self.scale = scale
self.activation = activation or (lambda x: x)
def forward(self, inputs):
branch0 = self.Branch_0(inputs)
branch1 = self.Branch_1(inputs)
if hasattr(self, 'Branch_2'):
branch2 = self.Branch_2(inputs)
tower_mixed = torch.cat([branch0, branch1, branch2], 1)
else:
tower_mixed = torch.cat([branch0, branch1], 1)
tower_out = self.Conv2d_1x1(tower_mixed)
output = self.activation(self.scale * tower_out + inputs)
return output
class block35(block):
def __init__(self, in_planes, scale=1.0, activation=nn.ReLU(True)):
super(block35, self).__init__(in_planes, scale, activation)
self.Branch_0 = nn.Sequential(OrderedDict([
('Conv2d_1x1', conv_bn(in_planes, 32, 1))
]))
self.Branch_1 = nn.Sequential(OrderedDict([
('Conv2d_0a_1x1', conv_bn(in_planes, 32, 1)),
('Conv2d_0b_3x3', conv_bn(32, 32, 3, padding=1))
]))
self.Branch_2 = nn.Sequential(OrderedDict([
('Conv2d_0a_1x1', conv_bn(in_planes, 32, 1)),
('Conv2d_0b_3x3', conv_bn(32, 48, 3, padding=1)),
('Conv2d_0c_3x3', conv_bn(48, 64, 3, padding=1))
]))
self.Conv2d_1x1 = conv_bn(128, in_planes, 1)
class block17(block):
def __init__(self, in_planes, scale=1.0, activation=nn.ReLU(True)):
super(block17, self).__init__(in_planes, scale, activation)
self.Branch_0 = nn.Sequential(OrderedDict([
('Conv2d_1x1', conv_bn(in_planes, 192, 1))
]))
self.Branch_1 = nn.Sequential(OrderedDict([
('Conv2d_0a_1x1', conv_bn(in_planes, 128, 1)),
('Conv2d_0b_1x7', conv_bn(128, 160, (1, 7), padding=(0, 3))),
('Conv2d_0c_7x1', conv_bn(160, 192, (7, 1), padding=(3, 0)))
]))
self.Conv2d_1x1 = conv_bn(384, in_planes, 1)
class block8(block):
def __init__(self, in_planes, scale=1.0, activation=nn.ReLU(True)):
super(block8, self).__init__(in_planes, scale, activation)
self.Branch_0 = nn.Sequential(OrderedDict([
('Conv2d_1x1', conv_bn(in_planes, 192, 1))
]))
self.Branch_1 = nn.Sequential(OrderedDict([
('Conv2d_0a_1x1', conv_bn(in_planes, 192, 1)),
('Conv2d_0b_1x7', conv_bn(192, 224, (1, 3), padding=(0, 1))),
('Conv2d_0c_7x1', conv_bn(224, 256, (3, 1), padding=(1, 0)))
]))
self.Conv2d_1x1 = conv_bn(448, in_planes, 1)
class InceptionResnetV2(nn.Module):
def __init__(self, num_classes=1000):
super(InceptionResnetV2, self).__init__()
self.end_points = {}
self.num_classes = num_classes
self.stem = nn.Sequential(OrderedDict([
('Conv2d_1a_3x3', conv_bn(3, 32, 3, stride=2, padding=1)),
('Conv2d_2a_3x3', conv_bn(32, 32, 3, padding=1)),
('Conv2d_2b_3x3', conv_bn(32, 64, 3)),
('MaxPool_3a_3x3', nn.MaxPool2d(3, 2)),
('Conv2d_3b_1x1', conv_bn(64, 80, 1)),
('Conv2d_4a_3x3', conv_bn(80, 192, 3)),
('MaxPool_5a_3x3', nn.MaxPool2d(3, 2))
]))
tower_conv = nn.Sequential(OrderedDict([
('Conv2d_5b_b0_1x1', conv_bn(192, 96, 1))
]))
tower_conv1 = nn.Sequential(OrderedDict([
('Conv2d_5b_b1_0a_1x1', conv_bn(192, 48, 1)),
('Conv2d_5b_b1_0b_5x5', conv_bn(48, 64, 5, padding=2))
]))
tower_conv2 = nn.Sequential(OrderedDict([
('Conv2d_5b_b2_0a_1x1', conv_bn(192, 64, 1)),
('Conv2d_5b_b2_0b_3x3', conv_bn(64, 96, 3, padding=1)),
('Conv2d_5b_b2_0c_3x3', conv_bn(96, 96, 3, padding=1))
]))
tower_pool3 = nn.Sequential(OrderedDict([
('AvgPool_5b_b3_0a_3x3', nn.AvgPool2d(3, stride=1, padding=1)),
('Conv2d_5b_b3_0b_1x1', conv_bn(192, 64, 1))
]))
self.mixed_5b = Concat(OrderedDict([
('Branch_0', tower_conv),
('Branch_1', tower_conv1),
('Branch_2', tower_conv2),
('Branch_3', tower_pool3)
]))
self.blocks35 = nn.Sequential()
for i in range(10):
self.blocks35.add_module('Block35.%s' %
i, block35(320, scale=0.17))
tower_conv = nn.Sequential(OrderedDict([
('Conv2d_6a_b0_0a_3x3', conv_bn(320, 384, 3, stride=2))
]))
tower_conv1 = nn.Sequential(OrderedDict([
('Conv2d_6a_b1_0a_1x1', conv_bn(320, 256, 1)),
('Conv2d_6a_b1_0b_3x3', conv_bn(256, 256, 3, padding=1)),
('Conv2d_6a_b1_0c_3x3', conv_bn(256, 384, 3, stride=2))
]))
tower_pool = nn.Sequential(OrderedDict([
('MaxPool_1a_3x3', nn.MaxPool2d(3, stride=2))
]))
self.mixed_6a = Concat(OrderedDict([
('Branch_0', tower_conv),
('Branch_1', tower_conv1),
('Branch_2', tower_pool)
]))
self.blocks17 = nn.Sequential()
for i in range(20):
self.blocks17.add_module('Block17.%s' %
i, block17(1088, scale=0.1))
tower_conv = nn.Sequential(OrderedDict([
('Conv2d_0a_1x1', conv_bn(1088, 256, 1)),
('Conv2d_1a_3x3', conv_bn(256, 384, 3, stride=2)),
]))
tower_conv1 = nn.Sequential(OrderedDict([
('Conv2d_0a_1x1', conv_bn(1088, 256, 1)),
('Conv2d_1a_3x3', conv_bn(256, 64, 3, stride=2))
]))
tower_conv2 = nn.Sequential(OrderedDict([
('Conv2d_0a_1x1', conv_bn(1088, 256, 1)),
('Conv2d_0b_3x3', conv_bn(256, 288, 3, padding=1)),
('Conv2d_1a_3x3', conv_bn(288, 320, 3, stride=2))
]))
tower_pool3 = nn.Sequential(OrderedDict([
('MaxPool_1a_3x3', nn.MaxPool2d(3, stride=2))
]))
self.mixed_7a = Concat(OrderedDict([
('Branch_0', tower_conv),
('Branch_1', tower_conv1),
('Branch_2', tower_conv2),
('Branch_3', tower_pool3)
]))
self.blocks8 = nn.Sequential()
for i in range(9):
self.blocks8.add_module('Block8.%s' %
i, block8(1856, scale=0.2))
self.blocks8.add_module('Block8.9', block8(
1856, scale=0.2, activation=None))
self.conv_pool = nn.Sequential(OrderedDict([
('Conv2d_7b_1x1', conv_bn(1856, 1536, 1)),
('AvgPool_1a_8x8', nn.AvgPool2d(8, 1)),
('Dropout', nn.Dropout(0.2))
]))
self.classifier = nn.Linear(1536, num_classes)
self.aux_classifier = nn.Sequential(OrderedDict([
('Conv2d_1a_3x3', nn.AvgPool2d(5, 3)),
('Conv2d_1b_1x1', conv_bn(1088, 128, 1)),
('Conv2d_2a_5x5', conv_bn(128, 768, 5)),
('Dropout', nn.Dropout(0.2)),
('Logits', conv_bn(768, num_classes, 1))
]))
class aux_loss(nn.Module):
def __init__(self):
super(aux_loss,self).__init__()
self.loss = nn.CrossEntropyLoss()
def forward(self, outputs, target):
return self.loss(outputs[0], target) +\
0.4 * (self.loss(outputs[1], target))
self.criterion = aux_loss
self.regime = [
{'epoch': 0, 'optimizer': 'SGD', 'lr': 1e-1,
'weight_decay': 1e-4, 'momentum': 0.9},
{'epoch': 30, 'lr': 1e-2},
{'epoch': 60, 'lr': 1e-3, 'weight_decay': 0},
{'epoch': 90, 'lr': 1e-4}
]
def forward(self, x):
x = self.stem(x) # (B, 192, 35, 35)
x = self.mixed_5b(x) # (B, 320, 35, 35)
x = self.blocks35(x) # (B, 320, 35, 35)
x = self.mixed_6a(x) # (B, 1088, 17, 17)
branch1 = self.blocks17(x) # (B, 1088, 17, 17)
x = self.mixed_7a(branch1) # (B, 1856, 8, 8)
x = self.blocks8(x) # (B, 1856, 8, 8)
x = self.conv_pool(x) # (B, 1536, 1, 1)
x = x.view(-1, 1536) # (B, 1536)
output = self.classifier(x) # (B, num_classes)
if hasattr(self, 'aux_classifier'):
branch1 = self.aux_classifier(branch1).view(-1, self.num_classes)
output = [output, branch1]
return output
def inception_resnet_v2(**kwargs):
num_classes = getattr(kwargs, 'num_classes', 1000)
return InceptionResnetV2(num_classes=num_classes)
| {
"pile_set_name": "Github"
} |
/*!
* accepts
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module dependencies.
* @private
*/
var Negotiator = require('negotiator')
var mime = require('mime-types')
/**
* Module exports.
* @public
*/
module.exports = Accepts
/**
* Create a new Accepts object for the given req.
*
* @param {object} req
* @public
*/
function Accepts (req) {
if (!(this instanceof Accepts)) {
return new Accepts(req)
}
this.headers = req.headers
this.negotiator = new Negotiator(req)
}
/**
* Check if the given `type(s)` is acceptable, returning
* the best match when true, otherwise `undefined`, in which
* case you should respond with 406 "Not Acceptable".
*
* The `type` value may be a single mime type string
* such as "application/json", the extension name
* such as "json" or an array `["json", "html", "text/plain"]`. When a list
* or array is given the _best_ match, if any is returned.
*
* Examples:
*
* // Accept: text/html
* this.types('html');
* // => "html"
*
* // Accept: text/*, application/json
* this.types('html');
* // => "html"
* this.types('text/html');
* // => "text/html"
* this.types('json', 'text');
* // => "json"
* this.types('application/json');
* // => "application/json"
*
* // Accept: text/*, application/json
* this.types('image/png');
* this.types('png');
* // => undefined
*
* // Accept: text/*;q=.5, application/json
* this.types(['html', 'json']);
* this.types('html', 'json');
* // => "json"
*
* @param {String|Array} types...
* @return {String|Array|Boolean}
* @public
*/
Accepts.prototype.type =
Accepts.prototype.types = function (types_) {
var types = types_
// support flattened arguments
if (types && !Array.isArray(types)) {
types = new Array(arguments.length)
for (var i = 0; i < types.length; i++) {
types[i] = arguments[i]
}
}
// no types, return all requested types
if (!types || types.length === 0) {
return this.negotiator.mediaTypes()
}
// no accept header, return first given type
if (!this.headers.accept) {
return types[0]
}
var mimes = types.map(extToMime)
var accepts = this.negotiator.mediaTypes(mimes.filter(validMime))
var first = accepts[0]
return first
? types[mimes.indexOf(first)]
: false
}
/**
* Return accepted encodings or best fit based on `encodings`.
*
* Given `Accept-Encoding: gzip, deflate`
* an array sorted by quality is returned:
*
* ['gzip', 'deflate']
*
* @param {String|Array} encodings...
* @return {String|Array}
* @public
*/
Accepts.prototype.encoding =
Accepts.prototype.encodings = function (encodings_) {
var encodings = encodings_
// support flattened arguments
if (encodings && !Array.isArray(encodings)) {
encodings = new Array(arguments.length)
for (var i = 0; i < encodings.length; i++) {
encodings[i] = arguments[i]
}
}
// no encodings, return all requested encodings
if (!encodings || encodings.length === 0) {
return this.negotiator.encodings()
}
return this.negotiator.encodings(encodings)[0] || false
}
/**
* Return accepted charsets or best fit based on `charsets`.
*
* Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
* an array sorted by quality is returned:
*
* ['utf-8', 'utf-7', 'iso-8859-1']
*
* @param {String|Array} charsets...
* @return {String|Array}
* @public
*/
Accepts.prototype.charset =
Accepts.prototype.charsets = function (charsets_) {
var charsets = charsets_
// support flattened arguments
if (charsets && !Array.isArray(charsets)) {
charsets = new Array(arguments.length)
for (var i = 0; i < charsets.length; i++) {
charsets[i] = arguments[i]
}
}
// no charsets, return all requested charsets
if (!charsets || charsets.length === 0) {
return this.negotiator.charsets()
}
return this.negotiator.charsets(charsets)[0] || false
}
/**
* Return accepted languages or best fit based on `langs`.
*
* Given `Accept-Language: en;q=0.8, es, pt`
* an array sorted by quality is returned:
*
* ['es', 'pt', 'en']
*
* @param {String|Array} langs...
* @return {Array|String}
* @public
*/
Accepts.prototype.lang =
Accepts.prototype.langs =
Accepts.prototype.language =
Accepts.prototype.languages = function (languages_) {
var languages = languages_
// support flattened arguments
if (languages && !Array.isArray(languages)) {
languages = new Array(arguments.length)
for (var i = 0; i < languages.length; i++) {
languages[i] = arguments[i]
}
}
// no languages, return all requested languages
if (!languages || languages.length === 0) {
return this.negotiator.languages()
}
return this.negotiator.languages(languages)[0] || false
}
/**
* Convert extnames to mime.
*
* @param {String} type
* @return {String}
* @private
*/
function extToMime (type) {
return type.indexOf('/') === -1
? mime.lookup(type)
: type
}
/**
* Check if mime is valid.
*
* @param {String} type
* @return {String}
* @private
*/
function validMime (type) {
return typeof type === 'string'
}
| {
"pile_set_name": "Github"
} |